12 #include "../../MetaInstruments/Spectrometer.h"
13 #include "../../Instruments/InterModuleCommunicator.h"
18 #include "ui_SpectrumViewer.h"
23 class SpectrumViewerData;
48 bool AllowResize() const noexcept override final {
return true; }
50 const auto&
GetUI() const noexcept {
return ui; }
65 Ui::SpectrumViewer
ui;
124 virtual const char*
GetParamClassTag() const noexcept
override {
return "SpectrumViewerParams"; }
129 "InterModuleCommunicator",
"Inter-module communicator",
"Inter-module communicator to control this module with",
DynExpUI::Icons::Instrument,
true };
155 constexpr
static auto Name() noexcept {
return "Spectrum Viewer"; }
156 constexpr
static auto Category() noexcept {
return "Image Capturing"; }
165 std::chrono::milliseconds
GetMainLoopDelay() const override final {
return std::chrono::milliseconds(50); }
170 void ResetImpl(dispatch_tag<QModuleBase>)
override final;
172 std::unique_ptr<DynExp::QModuleWidget>
MakeUIWidget() override final;
181 void OnInit(
DynExp::ModuleInstance* Instance) const override final;
182 void OnExit(
DynExp::ModuleInstance* Instance) const override final;
Defines DynExp's core module as an interface between the UI and DynExp objects.
Events for inter-module communication handled by the DynExpModule::SpectrumViewer::SpectrumViewer mod...
CapturingStateType
Possible spectrometer states.
std::chrono::milliseconds TimeType
Time type describing the spectrometer's times like its exposure time.
FrequencyUnitType
Supported spectrometer frequency units.
IntensityUnitType
Supported spectrometer intensity units.
SpectrumViewerConfigurator()=default
virtual ~SpectrumViewerConfigurator()=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...
SpectrumViewerWidget::SampleDataType CurrentSpectrum
DynExpInstr::SpectrometerData::TimeType CurrentExposureTime
DynExpInstr::SpectrometerData::CapturingStateType CapturingState
virtual ~SpectrumViewerData()=default
std::string AutoSaveFilename
DynExpInstr::SpectrometerData::TimeType AcquisitionExposureTime
DynExpInstr::SpectrometerData::TimeType MinExposureTime
double CurrentLowerFrequency
DynExp::LinkedObjectWrapperContainer< DynExpInstr::InterModuleCommunicator > Communicator
void ResetImpl(dispatch_tag< QModuleDataBase >) override final
bool IsUIInitialized() const noexcept
DynExpInstr::SpectrometerData::TimeType MaxExposureTime
void SetUIInitialized() noexcept
DynExpInstr::SpectrometerData::FrequencyUnitType FrequencyUnit
virtual void ResetImpl(dispatch_tag< SpectrumViewerData >)
DynExp::LinkedObjectWrapperContainer< DynExpInstr::Spectrometer > Spectrometer
bool SpectrumRecordingPaused
DynExpInstr::SpectrometerData::IntensityUnitType IntensityUnit
double CurrentUpperFrequency
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...
Param< DynExp::ObjectLink< DynExpInstr::Spectrometer > > Spectrometer
void ConfigureParamsImpl(dispatch_tag< QModuleParamsBase >) override final
SpectrumViewerParams(DynExp::ItemIDType ID, const DynExp::DynExpCore &Core)
virtual ~SpectrumViewerParams()=default
Param< DynExp::ObjectLink< DynExpInstr::InterModuleCommunicator > > Communicator
void OnRunClicked(DynExp::ModuleInstance *Instance, bool) const
void OnExit(DynExp::ModuleInstance *Instance) const override final
This event is triggered right before the module thread terminates (not due to an exception,...
void OnUpperLimitChanged(DynExp::ModuleInstance *Instance, double Value) const
constexpr static auto Category() noexcept
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...
size_t NumFailedUpdateAttempts
SpectrumViewer(const std::thread::id OwnerThreadID, DynExp::ParamsBasePtrType &&Params)
void OnStopClicked(DynExp::ModuleInstance *Instance, bool) const
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...
constexpr static auto Name() noexcept
void OnPauseSpectrumRecording(DynExp::ModuleInstance *Instance) const
void ResetImpl(dispatch_tag< QModuleBase >) override final
void OnLowerLimitChanged(DynExp::ModuleInstance *Instance, double Value) const
virtual ~SpectrumViewer()=default
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
virtual std::string GetName() const override
Returns the name of this Object type.
void SaveSpectrum(const SpectrumViewerWidget::SampleDataType &Spectrum, Util::SynchronizedPointer< SpectrumViewerData > &ModuleData)
SpectrumViewerWidget::SampleDataType ProcessSpectrum(DynExpInstr::SpectrometerData::SpectrumType &&Spectrum, Util::SynchronizedPointer< SpectrumViewerData > &ModuleData)
void OnSilentModeToggled(DynExp::ModuleInstance *Instance, bool Checked) const
virtual std::string GetCategory() const override
Returns the category of this Object type.
void OnResumeSpectrumRecording(DynExp::ModuleInstance *Instance) const
void OnRecordAndSaveSpectrum(DynExp::ModuleInstance *Instance, std::string SaveDataFilename) const
std::chrono::milliseconds GetMainLoopDelay() const override final
Specifies in which time intervals the module's event queue runs to handle pending events.
void OnExposureTimeChanged(DynExp::ModuleInstance *Instance, int Value) const
DynExp's core class acts as the interface between the user interface and DynExp's internal data like ...
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...
const std::unique_ptr< ModuleDataType > ModuleData
Module data belonging to this ModuleBase instance.
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.
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.
Holds a CallableMemberWrapper and invokes its callable when being destroyed.
Pointer to lock a class derived from ISynchronizedPointerLockable for synchronizing between threads....
DynExp's instrument namespace contains the implementation of DynExp instruments which extend DynExp's...
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
DynExp's Util namespace contains commonly used functions and templates as well as extensions to Qt an...
Accumulates include statements to provide a precompiled header.