CANdevStudio
Development tool for CAN bus simulation
Loading...
Searching...
No Matches
newlinemanager.h
Go to the documentation of this file.
1#ifndef NEWLINEMANAGER_H
2#define NEWLINEMANAGER_H
3
4#include "enumiterator.h" // EnumIterator
5#include "nlmfactory.h"
6#include <QJsonObject>
7#include <QTimer>
8#include <QValidator>
9#include <QtSerialBus/QCanBusFrame>
10
11#include <memory> // unique_ptr
12
13class CanRawSender;
14
17class NewLineManager : public QObject {
18 Q_OBJECT
19public:
26 NewLineManager(CanRawSender* q, bool _simulationState, NLMFactoryInterface& factory);
27
30 enum class ColName {
31 IdLine = 0,
37 };
41
45 QWidget* GetColsWidget(ColNameIterator name);
46
50 void SetSimulationState(bool state);
51
54 void Line2Json(QJsonObject& json) const;
55
62 bool RestoreLine(QString& id, QString data, bool remote, QString interval, bool loop, bool send);
63
64private:
66 void UpdateFrameData();
67
69 void StopTimer();
70 void StartTimer();
71
72private:
73 CanRawSender* _canRawSender;
74 QCanBusFrame _frame;
75 bool _simState;
76
77 QTimer _timer;
78 QValidator* _vDec;
79 QValidator* _vIdHex;
80 QValidator* _vDataHex;
81
82 NLMFactoryInterface& mFactory;
83 std::unique_ptr<CheckBoxInterface> _loop;
84 std::unique_ptr<CheckBoxInterface> _remote;
85 std::unique_ptr<LineEditInterface> _id;
86 std::unique_ptr<LineEditInterface> _data;
87 std::unique_ptr<LineEditInterface> _interval;
88 std::unique_ptr<PushButtonInterface> _send;
89
90signals:
91
92private slots:
93 void LoopToggled(bool checked);
94 void RemoteToggled(bool checked);
95 void SetSendButtonState();
96 void SendButtonPressed();
97 void TimerExpired();
98 void FrameDataChanged();
99};
100
101#endif // NEWLINEMANAGER_H
Definition canrawsender.h:13
Definition enumiterator.h:26
This class holds informations about all the columns in line and relationships beteewn them.
Definition newlinemanager.h:17
ColName
Definition newlinemanager.h:30
QWidget * GetColsWidget(ColNameIterator name)
The function return information about an appropriate column.
Definition newlinemanager.cpp:144
void Line2Json(QJsonObject &json) const
The function is responsible for convert line content to json format.
Definition newlinemanager.cpp:182
void SetSimulationState(bool state)
The function is responsible for set simulation state. The state influence for sending frame out and t...
Definition newlinemanager.cpp:168
bool RestoreLine(QString &id, QString data, bool remote, QString interval, bool loop, bool send)
The function is responsible for restore line content from config.
Definition newlinemanager.cpp:192
Definition nlmfactoryinterface.h:8