CANdevStudio
Development tool for CAN bus simulation
Loading...
Searching...
No Matches
ComponentInterface Struct Referenceabstract

Interface to be implemented by every component. More...

#include <componentinterface.h>

Inheritance diagram for ComponentInterface:

Public Types

using PropertyEditable = bool
 
using CustomEditFieldCbk = std::function< QWidget *(void)>
 
using ComponentProperty = std::tuple< QString, QVariant::Type, PropertyEditable, CustomEditFieldCbk >
 
using ComponentProperties = std::vector< ComponentProperty >
 
using PropertyContainer = std::map< QString, QVariant >
 

Public Member Functions

virtual ~ComponentInterface ()
 
virtual void mainWidgetDockToggled (QWidget *widget)=0
 Signal to be implemented by Component. Indicates when dock/undock action was invoked.
 
virtual void stopSimulation ()=0
 Slot to be implemented by Component to execute simulation stop action.
 
virtual void startSimulation ()=0
 Slot to be implemented by Component to execute simulation start action.
 
virtual void setConfig (const QJsonObject &json)=0
 Sets configuration for component.
 
virtual void setConfig (const QWidget &qobject)=0
 Sets configuration for component.
 
virtual void configChanged ()=0
 Reconfigure component if necessary.
 
virtual QJsonObject getConfig () const =0
 Gets current component configuation.
 
virtual std::shared_ptr< QWidget > getQConfig () const =0
 Gets current component configuation.
 
virtual ComponentProperties getSupportedProperties () const =0
 
virtual QWidget * mainWidget ()=0
 Gets components's main widget.
 
virtual bool mainWidgetDocked () const =0
 Main widget docking status.
 
virtual void simBcastSnd (const QJsonObject &msg, const QVariant &param=QVariant())=0
 
virtual void simBcastRcv (const QJsonObject &msg, const QVariant &param)=0
 

Static Public Member Functions

static constexpr const QString & propertyName (const ComponentProperty &p)
 
static constexpr const QVariant::Type & propertyType (const ComponentProperty &p)
 
static constexpr const PropertyEditablepropertyEditability (const ComponentProperty &p)
 
static constexpr const CustomEditFieldCbkpropertyField (const ComponentProperty &p)
 

Detailed Description

Interface to be implemented by every component.

Member Typedef Documentation

◆ ComponentProperties

◆ ComponentProperty

using ComponentInterface::ComponentProperty = std::tuple<QString, QVariant::Type, PropertyEditable, CustomEditFieldCbk>

◆ CustomEditFieldCbk

using ComponentInterface::CustomEditFieldCbk = std::function<QWidget*(void)>

◆ PropertyContainer

using ComponentInterface::PropertyContainer = std::map<QString, QVariant>

◆ PropertyEditable

Constructor & Destructor Documentation

◆ ~ComponentInterface()

virtual ComponentInterface::~ComponentInterface ( )
inlinevirtual

Member Function Documentation

◆ configChanged()

virtual void ComponentInterface::configChanged ( )
pure virtual

◆ getConfig()

virtual QJsonObject ComponentInterface::getConfig ( ) const
pure virtual

◆ getQConfig()

virtual std::shared_ptr< QWidget > ComponentInterface::getQConfig ( ) const
pure virtual

◆ getSupportedProperties()

virtual ComponentProperties ComponentInterface::getSupportedProperties ( ) const
pure virtual

Gets list of properties supported by this component

Returns
list of supported properties

Implemented in CanDevice, CanLoad, CanRawFilter, CanRawLogger, CanRawPlayer, CanRawSender, CanRawView, CanSignalData, CanSignalDecoder, CanSignalEncoder, CanSignalSender, CanSignalViewer, and QMLExecutor.

◆ mainWidget()

virtual QWidget * ComponentInterface::mainWidget ( )
pure virtual

Gets components's main widget.

Returns
Main widget or nullptr if component doesn't have it

Implemented in CanDevice, CanLoad, CanRawFilter, CanRawLogger, CanRawPlayer, CanRawSender, CanRawView, CanSignalData, CanSignalDecoder, CanSignalEncoder, CanSignalSender, CanSignalViewer, and QMLExecutor.

◆ mainWidgetDocked()

virtual bool ComponentInterface::mainWidgetDocked ( ) const
pure virtual

Main widget docking status.

Returns
returns true if widget is docked (part of MDI) or undocked (separate window)

Implemented in CanDevice, CanLoad, CanRawFilter, CanRawLogger, CanRawPlayer, CanRawSender, CanRawView, CanSignalData, CanSignalDecoder, CanSignalEncoder, CanSignalSender, CanSignalViewer, and QMLExecutor.

◆ mainWidgetDockToggled()

virtual void ComponentInterface::mainWidgetDockToggled ( QWidget *  widget)
pure virtual

Signal to be implemented by Component. Indicates when dock/undock action was invoked.

Parameters
widgetWidget subjected to dock/undock action

◆ propertyEditability()

static constexpr const PropertyEditable & ComponentInterface::propertyEditability ( const ComponentProperty p)
inlinestaticconstexpr

◆ propertyField()

static constexpr const CustomEditFieldCbk & ComponentInterface::propertyField ( const ComponentProperty p)
inlinestaticconstexpr

◆ propertyName()

static constexpr const QString & ComponentInterface::propertyName ( const ComponentProperty p)
inlinestaticconstexpr

◆ propertyType()

static constexpr const QVariant::Type & ComponentInterface::propertyType ( const ComponentProperty p)
inlinestaticconstexpr

◆ setConfig() [1/2]

virtual void ComponentInterface::setConfig ( const QJsonObject &  json)
pure virtual

Sets configuration for component.

Parameters
jsonconfiguration to be aplied

Implemented in CanDevice, CanLoad, CanRawFilter, CanRawLogger, CanRawPlayer, CanRawSender, CanRawView, CanSignalData, CanSignalDecoder, CanSignalEncoder, CanSignalSender, CanSignalViewer, and QMLExecutor.

◆ setConfig() [2/2]

virtual void ComponentInterface::setConfig ( const QWidget &  qobject)
pure virtual

Sets configuration for component.

Parameters
QWidgetconfiguration to be aplied

Implemented in CanDevice, CanLoad, CanRawFilter, CanRawLogger, CanRawPlayer, CanRawSender, CanRawView, CanSignalData, CanSignalDecoder, CanSignalEncoder, CanSignalSender, CanSignalViewer, and QMLExecutor.

◆ simBcastRcv()

virtual void ComponentInterface::simBcastRcv ( const QJsonObject &  msg,
const QVariant &  param 
)
pure virtual

◆ simBcastSnd()

virtual void ComponentInterface::simBcastSnd ( const QJsonObject &  msg,
const QVariant &  param = QVariant() 
)
pure virtual

◆ startSimulation()

virtual void ComponentInterface::startSimulation ( )
pure virtual

Slot to be implemented by Component to execute simulation start action.

◆ stopSimulation()

virtual void ComponentInterface::stopSimulation ( )
pure virtual

Slot to be implemented by Component to execute simulation stop action.


The documentation for this struct was generated from the following file: