Privacy
An open-source, flexible 3D physical simulation framework
data_broker_plotter2::DataBrokerPlotter Class Reference

#include <DataBrokerPlotter.hpp>

Public Slots

void valueChanged (std::string key, std::string value)
 
void checkChanged (std::string key, bool checked)
 
void exportPlot ()
 

Public Member Functions

 DataBrokerPlotter (DataBrokerPlotterLib *_mainLib, lib_manager::LibManager *theManager, mars::data_broker::DataBrokerInterface *_dataBroker, mars::cfg_manager::CFGManagerInterface *cfg, std::string _name, QWidget *parent=0)
 
 ~DataBrokerPlotter ()
 
void receiveData (const mars::data_broker::DataInfo &info, const mars::data_broker::DataPackage &dataPackage, int callbackParam)
 The DataBroker will call this method to notify the receiver of whenever the condition for which the receiver registered occur. More...
 
void cfgUpdateProperty (mars::cfg_manager::cfgPropertyStruct _property)
 
void update ()
 
std::string getName ()
 
- Public Member Functions inherited from mars::main_gui::BaseWidget
 BaseWidget (QWidget *parent, cfg_manager::CFGManagerInterface *_cfg, std::string _widgetName)
 
 ~BaseWidget ()
 
void setHiddenCloseState (bool v)
 
bool getHiddenCloseState ()
 
void show ()
 
void hide ()
 
bool isHidden ()
 
void saveState ()
 
const std::string & getName ()
 
- Public Member Functions inherited from mars::cfg_manager::CFGClient
 CFGClient ()
 
virtual ~CFGClient ()
 
virtual void cfgParamCreated (cfgParamId _id)
 
virtual void cfgParamRemoved (cfgParamId _id)
 
- Public Member Functions inherited from mars::data_broker::ReceiverInterface
 ReceiverInterface ()
 
virtual ~ReceiverInterface ()
 
- Public Member Functions inherited from mars::utils::Thread
 Thread ()
 
virtual ~Thread ()
 
void start ()
 Starts the execution of this Thread. More...
 
void cancel (bool block=false)
 Tries to cancel the Thread. More...
 
void setCancellationPoint ()
 Adds a cancellation point to your run method. More...
 
bool wait ()
 stops execution until the thread has finished. More...
 
bool join ()
 
bool wait (unsigned long timeoutMilliseconds)
 puts the Thread to sleep for a specified amount of time. More...
 
bool isRunning () const
 returns true if the Thread is running. More...
 
bool isFinished () const
 
void setStackSize (std::size_t stackSize)
 
std::size_t getStackSize () const
 
bool isCurrentThread () const
 

Protected Member Functions

void timerEvent (QTimerEvent *event)
 
void closeEvent (QCloseEvent *event)
 
void run ()
 The thread will execute this method once it has been started . More...
 
- Protected Member Functions inherited from mars::main_gui::BaseWidget
void changeEvent (QEvent *ev)
 
void cfgWindow (void)
 
void applyGeometry ()
 
void hideEvent (QHideEvent *event)
 
void closeEvent (QCloseEvent *event)
 

Private Member Functions

void createNewPlot (std::string label, const mars::data_broker::DataInfo &info)
 
void shiftDown (QRect &rect, int offset) const
 
void showPlot (Plot *plot)
 
void hidePlot (Plot *plot)
 
void checkMap (std::string key, std::string path, configmaps::ConfigMap &map, bool checked)
 
void checkSub (configmaps::ConfigMap &map, std::string path, bool checked)
 

Private Attributes

mars::config_map_gui::DataWidgetdw
 
configmaps::ConfigMap map
 
configmaps::ConfigMap loadMap
 
lib_manager::LibManagerlibManager
 
mars::data_broker::DataBrokerInterfacedataBroker
 
DataBrokerPlotterLibmainLib
 
QCustomPlot * qcPlot
 
QMutex dataLock
 
QMutex plotLock
 
std::string name
 
std::string configPath
 
std::string exportPath
 
std::vector< PackageDatapackageList
 
std::vector< std::string > filter
 
unsigned long xRange
 
int updateFilterTicks
 
std::map< unsigned long, int > registerMap
 
std::map< std::string, Plot * > plotMap
 
std::vector< Plot * > plots
 
std::map< std::string, mars::data_broker::DataInfopendingIDs
 
std::map< mars::cfg_manager::cfgParamId, Plot * > cfgParamIdToPlot
 
int nextPlotId
 
bool updateMap
 
bool needReplot
 
bool inReceive
 
bool exit
 
bool threadRunning
 
double penSize
 
double dataUpdateRate
 
double simTime
 
std::default_random_engine generator
 

Additional Inherited Members

- Signals inherited from mars::main_gui::BaseWidget
void hideSignal (void)
 
void closeSignal (void)
 
- Static Public Member Functions inherited from mars::utils::Thread
static ThreadgetCurrentThread ()
 
static void cancelAll (bool block=false)
 
- Static Protected Member Functions inherited from mars::utils::Thread
static void msleep (unsigned long msec)
 causes the current thread to sleep for More...
 
- Protected Attributes inherited from mars::main_gui::BaseWidget
cfg_manager::CFGManagerInterfacecfg
 
bool setWindowProp
 
bool hiddenState
 

Detailed Description

Definition at line 66 of file DataBrokerPlotter.hpp.

Constructor & Destructor Documentation

◆ DataBrokerPlotter()

data_broker_plotter2::DataBrokerPlotter::DataBrokerPlotter ( DataBrokerPlotterLib _mainLib,
lib_manager::LibManager theManager,
mars::data_broker::DataBrokerInterface _dataBroker,
mars::cfg_manager::CFGManagerInterface cfg,
std::string  _name,
QWidget *  parent = 0 
)

Definition at line 19 of file DataBrokerPlotter.cpp.

◆ ~DataBrokerPlotter()

data_broker_plotter2::DataBrokerPlotter::~DataBrokerPlotter ( void  )

Definition at line 114 of file DataBrokerPlotter.cpp.

Member Function Documentation

◆ cfgUpdateProperty()

void data_broker_plotter2::DataBrokerPlotter::cfgUpdateProperty ( mars::cfg_manager::cfgPropertyStruct  _property)
virtual

Reimplemented from mars::main_gui::BaseWidget.

Definition at line 252 of file DataBrokerPlotter.cpp.

◆ checkChanged

void data_broker_plotter2::DataBrokerPlotter::checkChanged ( std::string  key,
bool  checked 
)
slot

Definition at line 372 of file DataBrokerPlotter.cpp.

◆ checkMap()

void data_broker_plotter2::DataBrokerPlotter::checkMap ( std::string  key,
std::string  path,
configmaps::ConfigMap map,
bool  checked 
)
private

Definition at line 418 of file DataBrokerPlotter.cpp.

◆ checkSub()

void data_broker_plotter2::DataBrokerPlotter::checkSub ( configmaps::ConfigMap map,
std::string  path,
bool  checked 
)
private

Definition at line 381 of file DataBrokerPlotter.cpp.

◆ closeEvent()

void data_broker_plotter2::DataBrokerPlotter::closeEvent ( QCloseEvent *  event)
protected

Definition at line 543 of file DataBrokerPlotter.cpp.

◆ createNewPlot()

void data_broker_plotter2::DataBrokerPlotter::createNewPlot ( std::string  label,
const mars::data_broker::DataInfo info 
)
private

Definition at line 202 of file DataBrokerPlotter.cpp.

◆ exportPlot

void data_broker_plotter2::DataBrokerPlotter::exportPlot ( )
slot

Definition at line 505 of file DataBrokerPlotter.cpp.

◆ getName()

std::string data_broker_plotter2::DataBrokerPlotter::getName ( )
inline

Definition at line 85 of file DataBrokerPlotter.hpp.

◆ hidePlot()

void data_broker_plotter2::DataBrokerPlotter::hidePlot ( Plot plot)
private

Definition at line 568 of file DataBrokerPlotter.cpp.

◆ receiveData()

void data_broker_plotter2::DataBrokerPlotter::receiveData ( const mars::data_broker::DataInfo info,
const mars::data_broker::DataPackage dataPackage,
int  callbackParam 
)
virtual

The DataBroker will call this method to notify the receiver of whenever the condition for which the receiver registered occur.

Parameters
infoInformation about the DataPackage.
dataPackageThe DataPackage containing all the data.
callbackParamThe int the receiver passed during registration. The default (the receiver didn't provide a callbackParam) is 0. This can be used to easily distinguish different registrations.

Implements mars::data_broker::ReceiverInterface.

Definition at line 159 of file DataBrokerPlotter.cpp.

◆ run()

void data_broker_plotter2::DataBrokerPlotter::run ( )
protectedvirtual

The thread will execute this method once it has been started .

See also
start(), cancel(), wait(), wait(unsigned long)

Implements mars::utils::Thread.

Definition at line 441 of file DataBrokerPlotter.cpp.

◆ shiftDown()

void data_broker_plotter2::DataBrokerPlotter::shiftDown ( QRect &  rect,
int  offset 
) const
private

◆ showPlot()

void data_broker_plotter2::DataBrokerPlotter::showPlot ( Plot plot)
private

Definition at line 547 of file DataBrokerPlotter.cpp.

◆ timerEvent()

void data_broker_plotter2::DataBrokerPlotter::timerEvent ( QTimerEvent *  event)
protected

Definition at line 585 of file DataBrokerPlotter.cpp.

◆ update()

void data_broker_plotter2::DataBrokerPlotter::update ( void  )

Definition at line 134 of file DataBrokerPlotter.cpp.

◆ valueChanged

void data_broker_plotter2::DataBrokerPlotter::valueChanged ( std::string  key,
std::string  value 
)
slot

Definition at line 262 of file DataBrokerPlotter.cpp.

Member Data Documentation

◆ cfgParamIdToPlot

std::map<mars::cfg_manager::cfgParamId, Plot*> data_broker_plotter2::DataBrokerPlotter::cfgParamIdToPlot
private

Definition at line 115 of file DataBrokerPlotter.hpp.

◆ configPath

std::string data_broker_plotter2::DataBrokerPlotter::configPath
private

Definition at line 105 of file DataBrokerPlotter.hpp.

◆ dataBroker

mars::data_broker::DataBrokerInterface* data_broker_plotter2::DataBrokerPlotter::dataBroker
private

Definition at line 101 of file DataBrokerPlotter.hpp.

◆ dataLock

QMutex data_broker_plotter2::DataBrokerPlotter::dataLock
private

Definition at line 104 of file DataBrokerPlotter.hpp.

◆ dataUpdateRate

double data_broker_plotter2::DataBrokerPlotter::dataUpdateRate
private

Definition at line 119 of file DataBrokerPlotter.hpp.

◆ dw

mars::config_map_gui::DataWidget* data_broker_plotter2::DataBrokerPlotter::dw
private

Definition at line 98 of file DataBrokerPlotter.hpp.

◆ exit

bool data_broker_plotter2::DataBrokerPlotter::exit
private

Definition at line 118 of file DataBrokerPlotter.hpp.

◆ exportPath

std::string data_broker_plotter2::DataBrokerPlotter::exportPath
private

Definition at line 105 of file DataBrokerPlotter.hpp.

◆ filter

std::vector<std::string> data_broker_plotter2::DataBrokerPlotter::filter
private

Definition at line 107 of file DataBrokerPlotter.hpp.

◆ generator

std::default_random_engine data_broker_plotter2::DataBrokerPlotter::generator
private

Definition at line 120 of file DataBrokerPlotter.hpp.

◆ inReceive

bool data_broker_plotter2::DataBrokerPlotter::inReceive
private

Definition at line 118 of file DataBrokerPlotter.hpp.

◆ libManager

lib_manager::LibManager* data_broker_plotter2::DataBrokerPlotter::libManager
private

Definition at line 100 of file DataBrokerPlotter.hpp.

◆ loadMap

configmaps::ConfigMap data_broker_plotter2::DataBrokerPlotter::loadMap
private

Definition at line 99 of file DataBrokerPlotter.hpp.

◆ mainLib

DataBrokerPlotterLib* data_broker_plotter2::DataBrokerPlotter::mainLib
private

Definition at line 102 of file DataBrokerPlotter.hpp.

◆ map

configmaps::ConfigMap data_broker_plotter2::DataBrokerPlotter::map
private

Definition at line 99 of file DataBrokerPlotter.hpp.

◆ name

std::string data_broker_plotter2::DataBrokerPlotter::name
private

Definition at line 105 of file DataBrokerPlotter.hpp.

◆ needReplot

bool data_broker_plotter2::DataBrokerPlotter::needReplot
private

Definition at line 118 of file DataBrokerPlotter.hpp.

◆ nextPlotId

int data_broker_plotter2::DataBrokerPlotter::nextPlotId
private

Definition at line 117 of file DataBrokerPlotter.hpp.

◆ packageList

std::vector<PackageData> data_broker_plotter2::DataBrokerPlotter::packageList
private

Definition at line 106 of file DataBrokerPlotter.hpp.

◆ pendingIDs

std::map<std::string, mars::data_broker::DataInfo> data_broker_plotter2::DataBrokerPlotter::pendingIDs
private

Definition at line 114 of file DataBrokerPlotter.hpp.

◆ penSize

double data_broker_plotter2::DataBrokerPlotter::penSize
private

Definition at line 119 of file DataBrokerPlotter.hpp.

◆ plotLock

QMutex data_broker_plotter2::DataBrokerPlotter::plotLock
private

Definition at line 104 of file DataBrokerPlotter.hpp.

◆ plotMap

std::map<std::string, Plot*> data_broker_plotter2::DataBrokerPlotter::plotMap
private

Definition at line 112 of file DataBrokerPlotter.hpp.

◆ plots

std::vector<Plot*> data_broker_plotter2::DataBrokerPlotter::plots
private

Definition at line 113 of file DataBrokerPlotter.hpp.

◆ qcPlot

QCustomPlot* data_broker_plotter2::DataBrokerPlotter::qcPlot
private

Definition at line 103 of file DataBrokerPlotter.hpp.

◆ registerMap

std::map<unsigned long, int> data_broker_plotter2::DataBrokerPlotter::registerMap
private

Definition at line 111 of file DataBrokerPlotter.hpp.

◆ simTime

double data_broker_plotter2::DataBrokerPlotter::simTime
private

Definition at line 119 of file DataBrokerPlotter.hpp.

◆ threadRunning

bool data_broker_plotter2::DataBrokerPlotter::threadRunning
private

Definition at line 118 of file DataBrokerPlotter.hpp.

◆ updateFilterTicks

int data_broker_plotter2::DataBrokerPlotter::updateFilterTicks
private

Definition at line 109 of file DataBrokerPlotter.hpp.

◆ updateMap

bool data_broker_plotter2::DataBrokerPlotter::updateMap
private

Definition at line 118 of file DataBrokerPlotter.hpp.

◆ xRange

unsigned long data_broker_plotter2::DataBrokerPlotter::xRange
private

Definition at line 108 of file DataBrokerPlotter.hpp.


The documentation for this class was generated from the following files: