4 #include "moc_OutputPortWriter.cpp"
13 ui.AnalogOutWidget->setVisible(
false);
14 ui.DigitalOutWidget->setVisible(
false);
39 auto InstrData = DynExp::dynamic_InstrumentData_cast<DynExpInstr::OutputPort>(
ModuleData->OutputPort->GetInstrumentData());
41 InstrData->GetSampleStream()->SeekEnd(std::ios_base::out);
42 InstrData->GetSampleStream()->WriteBasicSample({
ModuleData->Value });
58 auto Widget = std::make_unique<OutputPortWriterWidget>(*
this);
68 auto Widget = GetWidget<OutputPortWriterWidget>();
69 auto ModuleData = DynExp::dynamic_ModuleData_cast<OutputPortWriter>(ModuleDataGetter());
71 QString ValueUnitStr(
" ");
84 Widget->ui.MinValueLabel->setText(QString::number(
ModuleData->MinAllowedValue) + ValueUnitStr);
85 Widget->ui.MaxValueLabel->setText(QString::number(
ModuleData->MaxAllowedValue) + ValueUnitStr);
92 if (!
Widget->ui.ValueDial->hasFocus())
95 Widget->ui.ValueLabel->setText(QString::number(
ModuleData->Value) + ValueUnitStr);
101 Widget->ui.StateButton->setStyleSheet(
ModuleData->Value ?
"background-color: lime;" :
"background-color: red;");
107 auto ModuleParams = DynExp::dynamic_Params_cast<OutputPortWriter>(Instance->
ParamsGetter());
Implementation of a module to write single values to output port instruments.
@ LogicLevel
Logic level (TTL) units (1 or 0)
static const char * UnitTypeToStr(const UnitType &Unit)
Returns a descriptive string of a respective unit to be e.g. used in plots.
void ResetImpl(dispatch_tag< QModuleDataBase >) override final
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 OnStateButtonClicked(DynExp::ModuleInstance *Instance, bool Checked) const
void OnExit(DynExp::ModuleInstance *Instance) const override final
This event is triggered right before the module thread terminates (not due to an exception,...
static constexpr auto DialControlValueDivider
void OnValueChanged(DynExp::ModuleInstance *Instance, int Value) const
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...
void UpdateUIChild(const ModuleBase::ModuleDataGetterType &ModuleDataGetter) override final
void ResetImpl(dispatch_tag< QModuleBase >) override final
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...
const std::unique_ptr< ModuleDataType > ModuleData
Module data belonging to this ModuleBase instance.
Refer to ParamsBase::dispatch_tag.
Defines data for a thread belonging to a ModuleBase instance. Refer to RunnableInstance.
const ModuleBase::ModuleDataGetterType ModuleDataGetter
Getter for module's data. Refer to ModuleBase::ModuleDataGetterType.
Refer to ParamsBase::dispatch_tag.
QModuleWidget * Widget
User interface widget belonging to the module.
void Connect(SenderType *Sender, SignalType Signal, ReceiverType *Receiver, EventType Event)
Uses Qt's connect mechanism to connect a QObject's signal to a DynExp module's event....
const Object::ParamsGetterType ParamsGetter
Invoke to obtain the parameters (derived from ParamsBase) of Owner.
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...
DynExp's module namespace contains the implementation of DynExp modules which extend DynExp's core fu...
DynExpErrorCodes
DynExp's error codes
Accumulates include statements to provide a precompiled header.