publisher_csv.h
Go to the documentation of this file.
1 #ifndef STATE_PUBLISHER_ZMQ_H
2 #define STATE_PUBLISHER_ZMQ_H
3 
4 #include <QObject>
5 #include <QtPlugin>
6 #include <QDialog>
7 #include <QTimer>
8 #include <thread>
9 #include <mutex>
10 #include "ui_publisher_csv_dialog.h"
12 
14 {
15  Q_OBJECT
16  Q_PLUGIN_METADATA(IID "facontidavide.PlotJuggler3.StatePublisher")
17  Q_INTERFACES(PJ::StatePublisher)
18 
19 public:
21 
22  virtual const char* name() const override
23  {
24  return "CSV Exporter";
25  }
26 
27  virtual ~StatePublisherCSV() override;
28 
29  virtual bool enabled() const override
30  {
31  return _enabled;
32  }
33 
34  virtual void updateState(double current_time) override
35  {
36  _previous_time = current_time;
37  }
38 
39  virtual void play(double) override
40  {
41  }
42 
43 public slots:
44  virtual void setEnabled(bool enabled) override;
45 
46 private slots:
47  void onWindowClosed();
48 
49 private:
50  std::mutex _mutex;
51 
52  bool _enabled = false;
53  double _previous_time = 0;
54  double _start_time = std::numeric_limits<double>::quiet_NaN();
55  double _end_time = std::numeric_limits<double>::quiet_NaN();
56 
57  QDialog* _dialog;
58  Ui::PublisherCSV_DIalog* _ui;
59 
61 
63 
64  QString generateRangeCSV(double time_start, double time_end);
65 
66  QString generateStatisticsCSV(double time_start, double time_end);
67 
68  bool getTimeRanges(double* first, double* last);
69 
70  void updateButtonsState();
71 
72  void saveFile(QString text);
73 };
74 
75 #endif // STATE_PUBLISHER_ZMQ_H
detail::first
auto first(const T &value, const Tail &...) -> const T &
Definition: compile.h:60
StatePublisherCSV::~StatePublisherCSV
virtual ~StatePublisherCSV() override
Definition: publisher_csv.cpp:18
StatePublisherCSV::_dialog
QDialog * _dialog
Definition: publisher_csv.h:57
StatePublisherCSV::_mutex
std::mutex _mutex
Definition: publisher_csv.h:50
StatePublisherCSV::saveFile
void saveFile(QString text)
Definition: publisher_csv.cpp:219
StatePublisherCSV
Definition: publisher_csv.h:13
StatePublisherCSV::name
virtual const char * name() const override
Name of the plugin type, NOT the particular instance.
Definition: publisher_csv.h:22
StatePublisherCSV::enabled
virtual bool enabled() const override
True if started.
Definition: publisher_csv.h:29
StatePublisherCSV::getTimeRanges
bool getTimeRanges(double *first, double *last)
Definition: publisher_csv.cpp:194
StatePublisherCSV::_start_time
double _start_time
Definition: publisher_csv.h:54
StatePublisherCSV::_ui
Ui::PublisherCSV_DIalog * _ui
Definition: publisher_csv.h:58
statepublisher_base.h
StatePublisherCSV::_end_time
double _end_time
Definition: publisher_csv.h:55
StatePublisherCSV::generateStatisticsCSV
QString generateStatisticsCSV(double time_start, double time_end)
Definition: publisher_csv.cpp:127
StatePublisherCSV::_enabled
bool _enabled
Definition: publisher_csv.h:52
StatePublisherCSV::play
virtual void play(double) override
Definition: publisher_csv.h:39
StatePublisherCSV::generateRangeCSV
QString generateRangeCSV(double time_start, double time_end)
Definition: publisher_csv.cpp:254
StatePublisherCSV::setEnabled
virtual void setEnabled(bool enabled) override
Definition: publisher_csv.cpp:22
StatePublisherCSV::updateState
virtual void updateState(double current_time) override
Method called when the timetracker is moved manually to a certain position.
Definition: publisher_csv.h:34
StatePublisherCSV::_notification_timer
QTimer * _notification_timer
Definition: publisher_csv.h:60
StatePublisherCSV::delayedClearNotification
void delayedClearNotification()
StatePublisherCSV::updateButtonsState
void updateButtonsState()
Definition: publisher_csv.cpp:210
PJ::StatePublisher
Definition: statepublisher_base.h:20
StatePublisherCSV::StatePublisherCSV
StatePublisherCSV()
Definition: publisher_csv.cpp:14
StatePublisherCSV::_previous_time
double _previous_time
Definition: publisher_csv.h:53
StatePublisherCSV::onWindowClosed
void onWindowClosed()
Definition: publisher_csv.cpp:121


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:45