15 #include "NetworkSpectrometer.pb.h"
16 #include "NetworkSpectrometer.grpc.pb.h"
20 class NetworkSpectrometer;
29 default:
throw Util::InvalidDataException(
"The given unit does not exist in the SpectrometerData::FrequencyUnitType enumeration. Did you forget to adjust the FrequencyUnitType enumeration in class \"SpectrometerData\"?");
40 default:
throw Util::InvalidDataException(
"The given unit does not exist in the DynExpProto::Common::FrequencyUnitType enumeration. Did you forget to adjust the FrequencyUnitType enumeration in file \"Common.proto\"?");
49 default:
throw Util::InvalidDataException(
"The given unit does not exist in the SpectrometerData::IntensityUnitType enumeration. Did you forget to adjust the IntensityUnitType enumeration in class \"SpectrometerData\"?");
58 default:
throw Util::InvalidDataException(
"The given unit does not exist in the DynExpProto::Common::IntensityUnitType enumeration. Did you forget to adjust the IntensityUnitType enumeration in file \"Common.proto\"?");
70 default:
throw Util::InvalidDataException(
"The given state does not exist in the DynExpProto::NetworkSpectrometer::StateType enumeration.");
74 namespace NetworkSpectrometerTasks
186 virtual const char*
GetParamClassTag() const noexcept
override {
return "NetworkSpectrometerParams"; }
215 constexpr
static auto Name() noexcept {
return "Network Spectrometer"; }
229 virtual void SetFrequencyRange(
double LowerFrequency,
double UpperFrequency,
DynExp::TaskBase::CallbackType CallbackFunc =
nullptr)
const override { MakeAndEnqueueTask<NetworkSpectrometerTasks::SetFrequencyRangeTask>(LowerFrequency, UpperFrequency, CallbackFunc); }
239 virtual std::unique_ptr<DynExp::InitTaskBase>
MakeInitTask()
const override {
return DynExp::MakeTask<NetworkSpectrometerTasks::InitTask>(); }
240 virtual std::unique_ptr<DynExp::ExitTaskBase>
MakeExitTask()
const override {
return DynExp::MakeTask<NetworkSpectrometerTasks::ExitTask>(); }
241 virtual std::unique_ptr<DynExp::UpdateTaskBase>
MakeUpdateTask()
const override {
return DynExp::MakeTask<NetworkSpectrometerTasks::UpdateTask>(); }
Defines DynExp's core module as an interface between the UI and DynExp objects.
Defines a meta instrument for a spectrometer.
virtual ~NetworkSpectrometerConfigurator()=default
NetworkSpectrometerConfigurator()=default
virtual DynExp::ParamsBasePtrType MakeParams(DynExp::ItemIDType ID, const DynExp::DynExpCore &Core) const override
Override to make derived classes call DynExp::MakeParams with the correct configurator type derived f...
NetworkSpectrometerData()=default
void ResetImpl(dispatch_tag< gRPCInstrumentData< Spectrometer, 0, DynExpProto::NetworkSpectrometer::NetworkSpectrometer >>) override final
IntensityUnitType IntensityUnit
auto GetFrequencyUnit() const noexcept
auto GetMinFrequency() const noexcept
auto GetIntensityUnit() const noexcept
CapturingStateType CapturingState
virtual double GetCapturingProgressChild() const noexcept override
virtual CapturingStateType GetCapturingStateChild() const noexcept override
virtual ~NetworkSpectrometerData()=default
FrequencyUnitType FrequencyUnit
auto GetMaxFrequency() const noexcept
virtual ~NetworkSpectrometerParams()=default
virtual void ConfigureParamsImpl(dispatch_tag< NetworkSpectrometerParams >)
NetworkSpectrometerParams(DynExp::ItemIDType ID, const DynExp::DynExpCore &Core)
void ConfigureParamsImpl(dispatch_tag< gRPCInstrumentParams< Spectrometer, 0, DynExpProto::NetworkSpectrometer::NetworkSpectrometer >>) override final
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...
AbortTask(CallbackType CallbackFunc) noexcept
virtual DynExp::TaskResultType RunChild(DynExp::InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
void ExitFuncImpl(dispatch_tag< gRPCInstrumentTasks::ExitTask< Spectrometer, 0, DynExpProto::NetworkSpectrometer::NetworkSpectrometer >>, DynExp::InstrumentInstance &Instance) override final
virtual void ExitFuncImpl(dispatch_tag< ExitTask >, DynExp::InstrumentInstance &Instance)
void InitFuncImpl(dispatch_tag< gRPCInstrumentTasks::InitTask< Spectrometer, 0, DynExpProto::NetworkSpectrometer::NetworkSpectrometer >>, DynExp::InstrumentInstance &Instance) override final
virtual void InitFuncImpl(dispatch_tag< InitTask >, DynExp::InstrumentInstance &Instance)
virtual DynExp::TaskResultType RunChild(DynExp::InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
RecordTask(CallbackType CallbackFunc) noexcept
SetFrequencyRangeTask(double LowerFrequency, double UpperFrequency, CallbackType CallbackFunc) noexcept
virtual DynExp::TaskResultType RunChild(DynExp::InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
virtual DynExp::TaskResultType RunChild(DynExp::InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
SetSetSilentModeTask(bool Enable, CallbackType CallbackFunc) noexcept
void UpdateFuncImpl(dispatch_tag< gRPCInstrumentTasks::UpdateTask< Spectrometer, 0, DynExpProto::NetworkSpectrometer::NetworkSpectrometer >>, DynExp::InstrumentInstance &Instance) override final
virtual void UpdateFuncImpl(dispatch_tag< UpdateTask >, DynExp::InstrumentInstance &Instance)
constexpr static auto Name() noexcept
virtual std::unique_ptr< DynExp::ExitTaskBase > MakeExitTask() const override
Factory function for an exit task (ExitTaskBase). Override to define the desired deinitialization tas...
virtual void Abort(DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
Aborts a currently running spectrum acquisition.
virtual SpectrometerData::IntensityUnitType GetIntensityUnit() const
Determines the intensity (y-axis) unit of the spectra acquired by the derived instrument.
void ResetImpl(dispatch_tag< gRPCInstrument< Spectrometer, 0, DynExpProto::NetworkSpectrometer::NetworkSpectrometer >>) override final
virtual std::unique_ptr< DynExp::UpdateTaskBase > MakeUpdateTask() const override
Factory function for an update task (UpdateTaskBase). Override to define the desired update task in d...
virtual ~NetworkSpectrometer()
virtual void SetFrequencyRange(double LowerFrequency, double UpperFrequency, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
Sets the spectrometer's frequency range where the spectrum acquisition begins and ends.
virtual SpectrometerData::FrequencyUnitType GetFrequencyUnit() const
Determines the frequency (x-axis) unit of the spectra acquired by the derived instrument.
virtual std::unique_ptr< DynExp::InitTaskBase > MakeInitTask() const override
Factory function for an init task (InitTaskBase). Override to define the desired initialization task ...
virtual double GetMinFrequency() const
Determines the minimal lower frequency limit where the spectrum acquisition can begin.
virtual void Record(DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
Starts the acquisition of a single spectrum.
virtual void SetSilentMode(bool Enable, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
Enables or disables the spectrometer's silent mode, i.e. disables or enables e.g. the spectrometer's ...
virtual void SetExposureTime(SpectrometerData::TimeType ExposureTime, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
Sets the spectrometer's exposure time.
virtual std::string GetName() const override
Returns the name of this Object type.
virtual double GetMaxFrequency() const
Determines the maximal upper frequency limit where the spectrum acquisition can end.
NetworkSpectrometer(const std::thread::id OwnerThreadID, DynExp::ParamsBasePtrType &&Params)
CapturingStateType
Possible spectrometer states.
@ Warning
The spectrometer is in a warning state, but still ready to acquire a spectrum.
@ Capturing
The spectrometer is currently acquiring a spectrum.
@ Error
The spectrometer is in an error state.
@ Ready
The spectrometer is ready to acquire a spectrum.
std::chrono::milliseconds TimeType
Time type describing the spectrometer's times like its exposure time.
FrequencyUnitType
Supported spectrometer frequency units.
@ Inv_cm
Wavenumber in 1/cm.
IntensityUnitType
Supported spectrometer intensity units.
@ Counts
Number of counts (arbitrary unit)
Meta instrument for a spectrometer.
Configurator class for gRPCInstrument.
Data class for gRPCInstrument.
Parameter class for gRPCInstrument.
Defines a task for deinitializing an instrument within an instrument inheritance hierarchy....
DynExp::ExitTaskBase::dispatch_tag< Type > dispatch_tag
Refer to DynExp::ParamsBase::dispatch_tag.
Defines a task for initializing an instrument within an instrument inheritance hierarchy....
DynExp::InitTaskBase::dispatch_tag< Type > dispatch_tag
Refer to DynExp::ParamsBase::dispatch_tag.
Defines a task for updating an instrument within an instrument inheritance hierarchy....
DynExp::UpdateTaskBase::dispatch_tag< Type > dispatch_tag
Refer to DynExp::ParamsBase::dispatch_tag.
Meta instrument template for transforming meta instruments into network instruments,...
DynExp's core class acts as the interface between the user interface and DynExp's internal data like ...
Configurator class for InstrumentBase.
Data structure to contain data which is synchronized in between different threads....
Defines data for a thread belonging to a InstrumentBase instance. Refer to RunnableInstance.
Parameter class for InstrumentBase.
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.
Refer to ParamsBase::dispatch_tag.
Base class for all tasks being processed by instruments. The class must not contain public virtual fu...
std::function< void(const TaskBase &, ExceptionContainer &)> CallbackType
Type of a callback function which is invoked when a task has finished, failed or has been aborted....
TaskBase(CallbackType CallbackFunc=nullptr) noexcept
Constructs an instrument task.
const CallbackType CallbackFunc
This callback function is called after the task has finished (either successfully or not) with a refe...
Defines the return type of task functions.
Data to operate on is invalid for a specific purpose. This indicates a corrupted data structure or fu...
Defines a meta instrument template for transforming meta instruments into network instruments,...
DynExp's instrument namespace contains the implementation of DynExp instruments which extend DynExp's...
constexpr DynExpProto::Common::UnitType ToPrototUnitType(DataStreamInstrumentData::UnitType Unit)
constexpr SpectrometerData::FrequencyUnitType ToSpectrometerUnitType(DynExpProto::Common::FrequencyUnitType Unit)
constexpr SpectrometerData::CapturingStateType ToSpectrometerStateType(DynExpProto::NetworkSpectrometer::StateType State)
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.
Accumulates include statements to provide a precompiled header.