15#include "NetworkLaser.pb.h"
16#include "NetworkLaser.grpc.pb.h"
28 default:
throw Util::InvalidDataException(
"The given unit is not supported here. Did you forget to adjust this function or the FrequencyUnitType enumeration in file \"Common.proto\"?");
37 default:
throw Util::InvalidDataException(
"The given unit is not supported here. Did you forget to adjust this function or the IntensityUnitType enumeration in file \"Common.proto\"?");
50 default:
throw Util::InvalidDataException(
"The given state does not exist in the DynExpProto::NetworkLaser::StateType enumeration.");
54 namespace NetworkLaserTasks
206 virtual const char*
GetParamClassTag() const noexcept
override {
return "NetworkLaserParams"; }
235 constexpr static auto Name() noexcept {
return "Network Laser"; }
269 virtual std::unique_ptr<DynExp::InitTaskBase>
MakeInitTask()
const override {
return DynExp::MakeTask<NetworkLaserTasks::InitTask>(); }
270 virtual std::unique_ptr<DynExp::ExitTaskBase>
MakeExitTask()
const override {
return DynExp::MakeTask<NetworkLaserTasks::ExitTask>(); }
271 virtual std::unique_ptr<DynExp::UpdateTaskBase>
MakeUpdateTask()
const override {
return DynExp::MakeTask<NetworkLaserTasks::UpdateTask>(); }
Defines DynExp's core module as an interface between the UI and DynExp objects.
Defines a meta instrument for a laser source.
LaserStateType
Possible laser states.
@ Startup
The laser is warming up.
@ Error
The laser is in an error state.
@ EmissionEnabledConstant
The laser is emitting in constant mode.
@ EmissionEnabledScanning
The laser is emitting in scan mode.
@ Ready
The laser is ready for emission.
Meta instrument for a laser.
virtual ~NetworkLaserConfigurator()=default
NetworkLaserConfigurator()=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...
auto GetModeHopFreeTuningRange() const noexcept
auto GetMinIntensity() const noexcept
double HardwareMinFrequency
double HardwareMaxScanRate
double HardwareMaxFrequency
double HardwareMinScanRange
LaserStateType LaserState
auto GetIntensityUnit() const noexcept
double HardwareMaxIntensity
auto GetMaxFrequency() const noexcept
virtual ~NetworkLaserData()=default
auto GetMaxIntensity() const noexcept
double HardwareModeHopFreeTuningRange
void ResetImpl(dispatch_tag< gRPCInstrumentData< Laser, 0, DynExpProto::NetworkLaser::NetworkLaser > >) override final
NetworkLaserData()=default
double HardwareMinScanRate
auto GetMinScanRate() const noexcept
double HardwareMinIntensity
virtual LaserStateType GetLaserStateChild() const noexcept override
DynExp::Units::UnitType IntensityUnit
auto GetMinScanRange() const noexcept
auto GetMaxScanRange() const noexcept
auto GetMinFrequency() const noexcept
double HardwareMaxScanRange
auto GetMaxScanRate() const noexcept
auto GetFrequencyUnit() const noexcept
DynExp::Units::UnitType FrequencyUnit
virtual void ConfigureParamsImpl(dispatch_tag< NetworkLaserParams >)
virtual ~NetworkLaserParams()=default
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...
NetworkLaserParams(DynExp::ItemIDType ID, const DynExp::DynExpCore &Core)
void ConfigureParamsImpl(dispatch_tag< gRPCInstrumentParams< Laser, 0, DynExpProto::NetworkLaser::NetworkLaser > >) override final
DisableScanTask(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...
DisableTask(CallbackType CallbackFunc) noexcept
EnableTask(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 void ExitFuncImpl(dispatch_tag< ExitTask >, DynExp::InstrumentInstance &Instance)
void ExitFuncImpl(dispatch_tag< gRPCInstrumentTasks::ExitTask< Laser, 0, DynExpProto::NetworkLaser::NetworkLaser > >, DynExp::InstrumentInstance &Instance) override final
void InitFuncImpl(dispatch_tag< gRPCInstrumentTasks::InitTask< Laser, 0, DynExpProto::NetworkLaser::NetworkLaser > >, 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...
ScanContinuouslyTask(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...
SetFrequencyTask(double Frequency, CallbackType CallbackFunc) noexcept
SetIntensityTask(double Intensity, 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...
SetScanRangeTask(double ScanRange, 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...
SetScanRateTask(double ScanRate, CallbackType CallbackFunc) noexcept
virtual void UpdateFuncImpl(dispatch_tag< UpdateTask >, DynExp::InstrumentInstance &Instance)
void UpdateFuncImpl(dispatch_tag< gRPCInstrumentTasks::UpdateTask< Laser, 0, DynExpProto::NetworkLaser::NetworkLaser > >, DynExp::InstrumentInstance &Instance) override final
virtual void Disable(DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
Disables emission.
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 double GetMinScanRate() const override
Determines the minimal frequency scan rate. The default implementation returns 0.0,...
virtual double GetMinFrequency() const override
Determines the minimal emission frequency. The default implementation returns GetMaxFrequency() which...
virtual DynExp::Units::UnitType GetIntensityUnit() const override
Determines the intensity unit.
virtual void SetFrequency(double Frequency, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
Sets the laser's emission frequency.
virtual double GetMaxScanRange() const override
Determines the maximal frequency scan range. The default implementation returns 0....
virtual void SetScanRate(double ScanRate, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
Sets the laser's frequency scan rate.
virtual std::unique_ptr< DynExp::InitTaskBase > MakeInitTask() const override
Factory function for an init task (InitTaskBase). Override to define the desired initialization task ...
virtual void SetIntensity(double Intensity, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
Sets the laser's output intensity.
virtual void DisableScan(DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
Disables scan and changes to constant emission mode.
virtual double GetMaxScanRate() const override
Determines the maximal frequency scan rate. The default implementation returns 0.0,...
virtual std::string GetName() const override
Returns the name of this Object type.
virtual void ScanContinuously(DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
Enables emission in scan mode.
virtual DynExp::Units::UnitType GetFrequencyUnit() const override
Determines the frequency unit.
virtual double GetMinScanRange() const override
Determines the minimal frequency scan range. The default implementation returns 0....
static constexpr auto Name() noexcept
virtual void SetScanRange(double ScanRange, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
Sets the laser's frequency scan range.
virtual std::unique_ptr< DynExp::ExitTaskBase > MakeExitTask() const override
Factory function for an exit task (ExitTaskBase). Override to define the desired deinitialization tas...
virtual double GetModeHopFreeTuningRange() const override
Determines the mode hop free tuning range. The default implementation returns 0.0,...
virtual double GetMinIntensity() const override
Determines the minimal emission intensity. The default implementation returns GetMaxIntensity() which...
virtual double GetMaxIntensity() const override
Determines the maximal emission intensity.
virtual void Enable(DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
Enables emission in constant mode.
virtual double GetMaxFrequency() const override
Determines the maximal emission frequency.
void ResetImpl(dispatch_tag< gRPCInstrument< Laser, 0, DynExpProto::NetworkLaser::NetworkLaser > >) override final
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 ...
Defines data for a thread belonging to a InstrumentBase instance. Refer to RunnableInstance.
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.
Type owning a callback function which is invoked when a task has finished, failed,...
Base class for all tasks being processed by instruments. The class must not contain public virtual fu...
CallbackType CallbackFunc
This callback function is called after the task has finished (either successfully or not) with a poin...
TaskBase(CallbackType CallbackFunc=nullptr, std::chrono::system_clock::time_point DeferUntil={}) noexcept
Constructs an instrument task.
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 LaserData::LaserStateType ToLaserStateType(DynExpProto::NetworkLaser::StateType State)
constexpr DynExp::Units::UnitType ToLaserUnitType(DynExpProto::Common::FrequencyUnitType Unit)
UnitType
Units which can be used with DynExp instruments.
@ Freq_Hz
Frequency in Hz.
@ Wavelength_nm
Wavelength in nm.
@ Power_W
Power in Watt (W)
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.