DynExp
Highly flexible laboratory automation for dynamically changing experiments.
|
Defines a parameter class with parameters common to all DynExp projects. More...
Public Types | |
enum | StoreWindowStatesType { ApplyStoredWindowStates , ApplyDefaultWindowStates } |
Indicates whether to apply window states (like position and size) from the project files. More... | |
Public Types inherited from DynExp::ParamsBase | |
enum | UsageType { Unique , Shared } |
Determines whether an Object can be linked to only one (unique) or multiple (shared) other objects. More... | |
using | ObjectLinkParamsType = std::vector< std::reference_wrapper< LinkBase > > |
Type of a list of all owned object link parameters. More... | |
using | EnumParamSignedIntegerType = intmax_t |
Parameter type to convert signed eumeration parameters to. More... | |
using | EnumParamUnsignedIntegerType = uintmax_t |
Parameter type to convert unsigned eumeration parameters to. More... | |
template<typename EnumType > | |
using | LargestEnumUnderlyingType = std::conditional_t< std::is_signed_v< std::underlying_type_t< EnumType > >, EnumParamSignedIntegerType, EnumParamUnsignedIntegerType > |
Type trait providing an integer type for enumeration types which allows to store the value of enumeration variables of that type in a file. More... | |
using | Text = Util::TextType |
String type of text-type parameters (DynExp::ParamsBase::Param) More... | |
template<typename ArithmeticType > | |
using | UnderlyingArithmeticParamType = TypedParamBase< ArithmeticType > |
using | UnderlyingTextParamType = TypedParamBase< Util::TextType > |
using | UnderlyingTextListParamType = TypedParamBase< Util::TextType > |
using | UnderlyingIndexedTextListParamType = TypedParamBase< Util::TextListIndexType > |
template<typename EnumType > | |
using | UnderlyingEnumParamType = TypedParamBase< LargestEnumUnderlyingType< EnumType > > |
If ParamType is an enum, then use largest signed/unsigned integral type as the underlying type since the enum's underlying type has to be integral. More... | |
using | UnderlyingLinkParamType = TypedParamBase< ItemIDType > |
template<typename ArithmeticType > | |
using | UnderlyingArithmeticListParamType = TypedListParamBase< ArithmeticType > |
using | UnderlyingLinkListParamType = TypedListParamBase< ItemIDType > |
Public Member Functions | |
ProjectParams (const DynExpCore &Core) | |
Constructs the parameters for a ProjectParams instance. The ID argument passed to ParamsBase::ParamsBase() is always 0. More... | |
~ProjectParams () | |
const char * | GetParamClassTag () const noexcept override final |
This function is intended to be overridden once in each derived class returning the name of the respective class. Parameters defined in any class within the ParamsBase hierarchy will receive a 'this' pointer pointing to ParamsBase when their ParamBase constructors are called. The ParamBase constructors will register the respective parameter in ParamsBase::OwnedParams calling GetParamClassTag() on the given 'this' pointer. This allows the ParamBase constructor to obtain the name of the class where the respective parameter was declared in. The name is used as an XML tag containing related parameters in the project files. Here, it is fully intended that the virtual call to GetParamClassTag() leads only to a call of GetParamClassTag() of the current dynamic type of ParamsBase! More... | |
Public Member Functions inherited from DynExp::ParamsBase | |
ParamsBase (ItemIDType ID, const DynExpCore &Core) | |
Constructs the base class of an object parameter class. More... | |
virtual | ~ParamsBase ()=0 |
QDomElement | ConfigToXML (QDomDocument &Document) const |
Creates an XML node with a tag name as determined by GetParamClassTag() containing all parameters belonging to this ParamsBase instance. More... | |
void | ConfigFromXML (const QDomElement &XMLElement) const |
Retrieves all parameters belonging to this ParamsBase instance from an XML node with a tag name as determined by GetParamClassTag() More... | |
void | ConfigFromDialog (ParamsConfigDialog &Dialog) |
Adds all parameters belonging to this ParamsBase instance to a settings dialog to let the user configure the parameter values. More... | |
bool | Validate () const |
Refer to ParamBase::Validate(). More... | |
ItemIDType | GetID () const noexcept |
Returns the ID of the Object this parameter class instance belongs to. More... | |
const auto & | GetCore () const noexcept |
Returns a reference to DynExp's core. More... | |
const auto & | GetObjectLinkParams () const noexcept |
Returns a list of all object link parameters owned by this parameter class instance. More... | |
bool | ConfigureUsageType () const noexcept |
Determines whether the Usage parameter should be configurable in the settings dialog. Override ConfigureUsageTypeChild() in order to adjust. More... | |
const NetworkParamsExtension * | GetNetworkAddressParams () const noexcept |
Returns the network address parameters of a derived gRPC instrument. Override GetNetworkAddressParamsChild() in order to adjust. More... | |
Public Member Functions inherited from Util::INonCopyable | |
INonCopyable (const INonCopyable &)=delete | |
INonCopyable & | operator= (const INonCopyable &)=delete |
Static Public Member Functions | |
static Util::TextValueListType< StoreWindowStatesType > | AvlblStoreWindowStatesTypeStrList () |
Assigns labels to the entries of StoreWindowStatesType . More... | |
Static Public Member Functions inherited from DynExp::ParamsBase | |
static Util::TextValueListType< UsageType > | AvlblUsageTypeStrList () |
Maps description strings to the ParamsBase::UsageType enum's items. More... | |
static void | DisableUserEditable (ParamBase &Param) noexcept |
Sets the UserEditable property of the parameter Param to false. Refer to ParamBase::UserEditable. More... | |
Public Attributes | |
Param< ParamsConfigDialog::TextType > | Authors = { *this, "Authors", "Authors", "Name of the project's authors.", false } |
Author of project file. More... | |
Param< ParamsConfigDialog::TextType > | Version = { *this, "Version", "Version", "Current version of the project.", false } |
Version of project file. More... | |
Param< ParamsConfigDialog::TextType > | Comment = { *this, "Comment", "Comment", "Comments related to the project.", false } |
Comment to project file. More... | |
Param< StoreWindowStatesType > | StoreWindowStates |
Indicates whether to apply window states (like position and size) from the project files. More... | |
WindowStyleParamsExtension | MainWindowStyleParams |
Window states of the main window. WindowStyleParamsExtension::WindowDockingState member is ignored. More... | |
WindowStyleParamsExtension | CircuitWindowStyleParams |
Window states of the circuit diagram window (CircuitDiagram ). WindowStyleParamsExtension::WindowDockingState determines the window's visibility (WindowStyleParamsExtension::WindowDockingStateType::Undocked means visible, every other value means hidden). More... | |
ListParam< int > | HSplitterWidgetWidths = { *this, "HSplitterWidgetWidths", {}, 0 } |
Widths of areas split horizontally by the main splitter widget in the main window. More... | |
ListParam< int > | VSplitterWidgetHeights = { *this, "VSplitterWidgetHeights", {}, 0 } |
Widths of areas split vertically by the main splitter widget in the main window. More... | |
Public Attributes inherited from DynExp::ParamsBase | |
Param< ParamsConfigDialog::TextType > | ObjectName = { *this, "ObjectName", "Name", "Name to identify this item", false } |
String set by the user to identify the object this parameter class instance belongs to. More... | |
Param< UsageType > | Usage |
Determines whether an object can be used by only one other ("unique") or by multiple other ("shared") objects. More... | |
Private Member Functions | |
void | ConfigureParamsImpl (dispatch_tag< ParamsBase >) override final |
Called by DynExp::ParamsBase::ConfigureParams() as a starting point for the tag dispatch mechanism to descend the inheritance hierarchy. Override to add functionality to ConfigureParams(). Refer to DynExp::ParamsBase::dispatch_tag. More... | |
Private Attributes | |
Thread-safe variables | |
These variables have been defined here, to guarantee thread-safe access. They are not stored in the project file. | |
std::filesystem::path | ProjectFilename |
Path to project file. Only non-empty if project has been saved or if it was loaded from file. More... | |
std::filesystem::path | LastDataSaveDirectory |
Path to directory where modules saved their data most recently. More... | |
Friends | |
class | DynExpCore |
Additional Inherited Members | |
Protected Member Functions inherited from Util::ISynchronizedPointerLockable | |
ISynchronizedPointerLockable () | |
~ISynchronizedPointerLockable () | |
Object should never be destroyed before completely unlocked. More... | |
Protected Member Functions inherited from Util::INonCopyable | |
constexpr | INonCopyable ()=default |
~INonCopyable ()=default | |
Defines a parameter class with parameters common to all DynExp projects.
Definition at line 24 of file DynExpCore.h.
Indicates whether to apply window states (like position and size) from the project files.
Definition at line 33 of file DynExpCore.h.
|
inline |
Constructs the parameters for a ProjectParams
instance. The ID
argument passed to ParamsBase::ParamsBase() is always 0.
ID | ID of the Object this parameter class instance belongs to |
Core | Reference to DynExp's core |
Definition at line 54 of file DynExpCore.h.
|
inline |
Definition at line 57 of file DynExpCore.h.
|
static |
Assigns labels to the entries of StoreWindowStatesType
.
StoreWindowStatesType
and human-readable descriptions Definition at line 8 of file DynExpCore.cpp.
|
finaloverrideprivatevirtual |
Called by DynExp::ParamsBase::ConfigureParams() as a starting point for the tag dispatch mechanism to descend the inheritance hierarchy. Override to add functionality to ConfigureParams(). Refer to DynExp::ParamsBase::dispatch_tag.
Reimplemented from DynExp::ParamsBase.
Definition at line 18 of file DynExpCore.cpp.
|
inlinefinaloverridevirtualnoexcept |
This function is intended to be overridden once in each derived class returning the name of the respective class. Parameters defined in any class within the ParamsBase hierarchy will receive a 'this' pointer pointing to ParamsBase when their ParamBase constructors are called. The ParamBase constructors will register the respective parameter in ParamsBase::OwnedParams calling GetParamClassTag() on the given 'this' pointer. This allows the ParamBase constructor to obtain the name of the class where the respective parameter was declared in. The name is used as an XML tag containing related parameters in the project files. Here, it is fully intended that the virtual call to GetParamClassTag() leads only to a call of GetParamClassTag() of the current dynamic type of ParamsBase!
Reimplemented from DynExp::ParamsBase.
Definition at line 59 of file DynExpCore.h.
|
friend |
Definition at line 26 of file DynExpCore.h.
Param<ParamsConfigDialog::TextType> DynExp::ProjectParams::Authors = { *this, "Authors", "Authors", "Name of the project's authors.", false } |
Author of project file.
Definition at line 61 of file DynExpCore.h.
WindowStyleParamsExtension DynExp::ProjectParams::CircuitWindowStyleParams |
Window states of the circuit diagram window (CircuitDiagram
). WindowStyleParamsExtension::WindowDockingState determines the window's visibility (WindowStyleParamsExtension::WindowDockingStateType::Undocked means visible, every other value means hidden).
Definition at line 82 of file DynExpCore.h.
Param<ParamsConfigDialog::TextType> DynExp::ProjectParams::Comment = { *this, "Comment", "Comment", "Comments related to the project.", false } |
Comment to project file.
Definition at line 63 of file DynExpCore.h.
ListParam<int> DynExp::ProjectParams::HSplitterWidgetWidths = { *this, "HSplitterWidgetWidths", {}, 0 } |
Widths of areas split horizontally by the main splitter widget in the main window.
Definition at line 87 of file DynExpCore.h.
|
private |
Path to directory where modules saved their data most recently.
Definition at line 110 of file DynExpCore.h.
WindowStyleParamsExtension DynExp::ProjectParams::MainWindowStyleParams |
Window states of the main window. WindowStyleParamsExtension::WindowDockingState member is ignored.
Definition at line 75 of file DynExpCore.h.
|
private |
Path to project file. Only non-empty if project has been saved or if it was loaded from file.
Definition at line 105 of file DynExpCore.h.
Param<StoreWindowStatesType> DynExp::ProjectParams::StoreWindowStates |
Indicates whether to apply window states (like position and size) from the project files.
Definition at line 68 of file DynExpCore.h.
Param<ParamsConfigDialog::TextType> DynExp::ProjectParams::Version = { *this, "Version", "Version", "Current version of the project.", false } |
Version of project file.
Definition at line 62 of file DynExpCore.h.
ListParam<int> DynExp::ProjectParams::VSplitterWidgetHeights = { *this, "VSplitterWidgetHeights", {}, 0 } |
Widths of areas split vertically by the main splitter widget in the main window.
Definition at line 92 of file DynExpCore.h.