12 #include "../MetaInstruments/DataStreamInstrument.h"
15 #include "ui_SignalPlotter.h"
42 bool AllowResize() const noexcept override final {
return true; }
50 void SetData(
const SampleDataType& SampleData);
129 virtual const char*
GetParamClassTag() const noexcept
override {
return "SignalPlotterParams"; }
132 "DataStreamInstr",
"Data stream instrument(s)",
"Underlying data stream instrument(s) to be used as a data source(s)",
DynExpUI::Icons::Instrument };
161 constexpr
static auto Name() noexcept {
return "Signal Plotter"; }
162 constexpr
static auto Category() noexcept {
return "I/O"; }
171 std::chrono::milliseconds
GetMainLoopDelay() const override final {
return std::chrono::milliseconds(50); }
176 void ResetImpl(dispatch_tag<QModuleBase>)
override final;
178 std::unique_ptr<DynExp::QModuleWidget>
MakeUIWidget() override final;
192 void OnInit(
DynExp::ModuleInstance* Instance) const override final;
193 void OnExit(
DynExp::ModuleInstance* Instance) const override final;
Defines DynExp's core module as an interface between the UI and DynExp objects.
UnitType
Units which can be used for data stream instruments.
SignalPlotterConfigurator()=default
virtual DynExp::ParamsBasePtrType MakeParams(DynExp::ItemIDType ID, const DynExp::DynExpCore &Core) const override final
Override to make derived classes call DynExp::MakeParams with the correct configurator type derived f...
virtual ~SignalPlotterConfigurator()=default
void ResetImpl(dispatch_tag< QModuleDataBase >) override final
bool IsBasicSampleTimeUsed
void UnlockInstruments(DynExp::ModuleInstance *Instance)
DynExp::LinkedObjectWrapperContainerList< DynExpInstr::DataStreamInstrument > DataStreamInstr
virtual void ResetImpl(dispatch_tag< SignalPlotterData >)
virtual ~SignalPlotterData()=default
void LockInstruments(DynExp::ModuleInstance *Instance, const DynExp::ParamsBase::ListParam< DynExp::ObjectLink< DynExpInstr::DataStreamInstrument >> &InstrParam)
SignalPlotterWidget::SampleDataType SampleData
bool IsUIInitialized() const noexcept
void SetUIInitialized() noexcept
DynExpInstr::DataStreamInstrumentData::UnitType ValueUnit
auto & GetDataStreamInstr()
std::string_view GetDataStreamInstrIconPath() const
void SetCurrentSourceIndex(int Index)
const auto & GetDataStreamInstrLabels() const noexcept
Param< bool > RollingView
SignalPlotterParams(DynExp::ItemIDType ID, const DynExp::DynExpCore &Core)
ListParam< DynExp::ObjectLink< DynExpInstr::DataStreamInstrument > > DataStreamInstr
virtual const char * GetParamClassTag() const noexcept override
This function is intended to be overridden once in each derived class returning the name of the respe...
void ConfigureParamsImpl(dispatch_tag< QModuleParamsBase >) override final
virtual ~SignalPlotterParams()=default
std::chrono::milliseconds GetMainLoopDelay() const override final
Specifies in which time intervals the module's event queue runs to handle pending events.
virtual std::string GetName() const override
Returns the name of this Object type.
virtual std::string GetCategory() const override
Returns the category of this Object type.
Util::DynExpErrorCodes::DynExpErrorCodes ModuleMainLoop(DynExp::ModuleInstance &Instance) override final
Module main loop. The function is executed periodically by the module thread. Also refer to GetMainLo...
void OnExit(DynExp::ModuleInstance *Instance) const override final
This event is triggered right before the module thread terminates (not due to an exception,...
void OnPlotRollingViewClicked(DynExp::ModuleInstance *Instance, bool Checked) const
constexpr static auto Category() noexcept
SignalPlotter(const std::thread::id OwnerThreadID, DynExp::ParamsBasePtrType &&Params)
void OnRunClicked(DynExp::ModuleInstance *Instance, bool Checked) const
void ResetImpl(dispatch_tag< QModuleBase >) override final
size_t NumFailedUpdateAttempts
void OnSourceChanged(DynExp::ModuleInstance *Instance, int Index) const
bool ProcessBasicSamples(std::vector< DynExpInstr::BasicSample > &&BasicSamples, bool IsBasicSampleTimeUsed)
Converts BasicSamples to displayable format.
std::unique_ptr< DynExp::QModuleWidget > MakeUIWidget() override final
Used by InitUI() as a factory function for the module's user interface widget. Create the widget here...
constexpr static auto Name() noexcept
void OnInit(DynExp::ModuleInstance *Instance) const override final
This event is triggered right before the module thread starts. Override it to lock instruments this m...
void OnPlotAutoscaleClicked(DynExp::ModuleInstance *Instance, bool Checked) const
void OnClearStream(DynExp::ModuleInstance *Instance, bool) const
virtual ~SignalPlotter()=default
void UpdateUIChild(const ModuleBase::ModuleDataGetterType &ModuleDataGetter) override final
DynExp's core class acts as the interface between the user interface and DynExp's internal data like ...
const auto & GetLabels() const noexcept
Returns ObjectLabels.
std::string_view GetIconPath() const
Returns IconPath.
Base class for modules. Modules implement programs on their own (e.g. measurement protocols or server...
Util::CallableMemberWrapper< ModuleBase, ModuleDataTypeSyncPtrType(ModuleBase::*)(const std::chrono::milliseconds)> ModuleDataGetterType
Invoking an instance of this alias is supposed to call ModuleBase::GetModuleData() of the instance th...
ModuleBase(const std::thread::id OwnerThreadID, ParamsBasePtrType &&Params)
Constructs a ModuleBase instance.
Configurator class for ModuleBase.
Data structure to contain data which is synchronized in between different threads....
Refer to ParamsBase::dispatch_tag.
Defines data for a thread belonging to a ModuleBase instance. Refer to RunnableInstance.
Parameter class for ModuleBase.
Type to define object link parameters as ParamsBase::Param< ObjectLink< ObjectT > > or to define obje...
const std::thread::id OwnerThreadID
Thread id of the thread which has constructed (and owns) this Object instance.
const ParamsBasePtrType Params
Pointer to the parameter class instance belonging to this Object instance.
const ItemIDType ID
ID of the Object this parameter class instance belongs to.
const auto & GetCore() const noexcept
Returns a reference to DynExp's core.
const DynExpCore & Core
Reference to DynExp's core.
Tag for function dispatching mechanism within this class used when derived classes are not intended t...
Base class for modules with a Qt-based user interface. Derive from this class to implement modules wi...
QModuleBase(const std::thread::id OwnerThreadID, DynExp::ParamsBasePtrType &&Params)
Constructs a QModuleBase instance.
Configurator class for QModuleBase.
Data class for QModuleBase.
Parameter class for QModuleBase.
QModuleParamsBase(ItemIDType ID, const DynExpCore &Core)
Constructs the parameters for a QModuleBase instance.
void UnlockObject(LinkedObjectWrapperContainer< ObjectT > &ObjectWrapperContainer)
Unlocks an Object instance stored in the LinkedObjectWrapperContainer ObjectWrapperContainer....
void LockObject(const ParamsBase::Param< ObjectLink< ObjectT >> &LinkParam, LinkedObjectWrapperContainer< ObjectT > &ObjectWrapperContainer, std::chrono::milliseconds Timeout=ObjectLinkBase::LockObjectTimeoutDefault)
Locks an Object instance referenced by a parameter LinkParam of type ParamsBase::Param< ObjectLink< O...
Holds a CallableMemberWrapper and invokes its callable when being destroyed.
DynExp's instrument namespace contains the implementation of DynExp instruments which extend DynExp's...
DynExp's module namespace contains the implementation of DynExp modules which extend DynExp's core fu...
constexpr auto Instrument
DynExp's main namespace contains the implementation of DynExp including classes to manage resources (...
std::unique_ptr< ParamsBase > ParamsBasePtrType
Alias for a pointer to the parameter system base class ParamsBase.
size_t ItemIDType
ID type of objects/items managed by DynExp.
DynExpErrorCodes
DynExp's error codes
Accumulates include statements to provide a precompiled header.