1#ifndef CANRAWSENDER_P_H
2#define CANRAWSENDER_P_H
8#include <QtGui/QStandardItemModel>
28 :
_ctx(std::move(ctx))
31 , _simulationState(false)
32 , _columnsOrder({
"Id",
"Data",
"Remote",
"Loop",
"Interval",
"" })
38 _tvModel.setHorizontalHeaderLabels(_columnsOrder);
42 _ui.
setAddCbk(std::bind(&CanRawSenderPrivate::addNewItem,
this));
43 _ui.
setRemoveCbk(std::bind(&CanRawSenderPrivate::removeRowsSelectedByMouse,
this));
78 void writeColumnsOrder(QJsonObject& json)
const;
82 void writeSortingRules(QJsonObject& json)
const;
86 bool columnAdopt(QJsonObject
const& json);
90 bool sortingAdopt(QJsonObject
const& json);
94 bool contentAdopt(QJsonObject
const& json);
99 for (
const auto& p: _supportedProps)
107 void removeRowsSelectedByMouse();
120 std::vector<std::unique_ptr<NewLineManager>> _lines;
121 QStandardItemModel _tvModel;
122 bool _simulationState;
124 QStringList _columnsOrder;
127 const QString _nameProperty =
"name";
134 std::make_tuple(_nameProperty, QVariant::String,
true, cf(
nullptr))
Definition canrawsender.h:13
void mainWidgetDockToggled(QWidget *widget) override
This class is responsible for manage can raw sender window.
Definition canrawsender_p.h:19
bool restoreConfiguration(const QJsonObject &json)
Used to restore rawsender configurations.
Definition canrawsender_p.cpp:252
CRSGuiInterface & _ui
Definition canrawsender_p.h:114
int getLineCount() const
This method returns actual number of lines in table.
Definition canrawsender_p.cpp:31
void saveSettings(QJsonObject &json) const
This method writes to json format actual can raw sender window properties.
Definition canrawsender_p.cpp:14
bool docked
Definition canrawsender_p.h:116
NLMFactoryInterface & _nlmFactory
Definition canrawsender_p.h:115
void setSimulationState(bool state)
This method propagates the system simulator state.
Definition canrawsender_p.cpp:6
CanRawSenderCtx _ctx
Definition canrawsender_p.h:113
ComponentInterface::ComponentProperties getSupportedProperties() const
Used to get list of properties supported by component.
Definition canrawsender_p.cpp:65
virtual ~CanRawSenderPrivate()=default
destructor
std::map< QString, QVariant > _props
Definition canrawsender_p.h:117
CanRawSenderPrivate(CanRawSender *q, CanRawSenderCtx &&ctx=CanRawSenderCtx(new CRSGui, new NLMFactory))
constructor
Definition canrawsender_p.h:27
Context< CRSGuiInterface, NLMFactoryInterface > CanRawSenderCtx
Definition context.h:45
Definition canrawsender_p.h:13
Definition crsguiinterface.h:12
virtual QWidget * mainWidget()=0
virtual void initTableView(QAbstractItemModel &_tvModel)=0
virtual void setAddCbk(const add_t &cb)=0
virtual void setRemoveCbk(const remove_t &cb)=0
virtual void setDockUndockCbk(const dockUndock_t &cb)=0
std::vector< ComponentProperty > ComponentProperties
Definition componentinterface.h:66
std::function< QWidget *(void)> CustomEditFieldCbk
Definition componentinterface.h:64
static constexpr const QString & propertyName(const ComponentProperty &p)
Definition componentinterface.h:69
Definition nlmfactory.h:9
Definition nlmfactoryinterface.h:8