DynExp
Highly flexible laboratory automation for dynamically changing experiments.
Loading...
Searching...
No Matches
ODMRWidget.h
Go to the documentation of this file.
1// This file is part of DynExp.
2
8#pragma once
9
10#include "stdafx.h"
11#include "DynExpCore.h"
12
13#include <QWidget>
14#include "ui_ODMR.h"
15
16namespace DynExpModule::ODMR
17{
18 class ODMR;
19 class ODMRData;
20
33
35
37 {
38 // x is frequency in GHz, y is ODMR signal in units of SignalDetector.
39 QList<QPointF> DataPoints;
40 QList<QPointF> FitPoints;
41 std::tuple<double, double> FitParams; // tuple<c0, c1> with fit model ODMRSignal = c0 + c1 * frequency
45 bool HasChanged = false;
46 };
47
49 {
50 // x is frequency in Hz, y is sensitivity in T/sqrt(Hz).
51 QList<QPointF> DataPoints;
54 bool HasChanged = false;
55 };
56
58 {
59 Q_OBJECT
60
61 private:
74
75 public:
76 ODMRWidget(ODMR& Owner, QModuleWidget* parent = nullptr);
77 ~ODMRWidget() = default;
78
79 bool AllowResize() const noexcept override final { return true; }
80
84 void UpdateODMRPlot(const ODMRPlotType& ODMRPlot);
85 void UpdateSensitivityPlot(const SensitivityPlotType& SensitivityPlot);
86
87 const auto& GetUI() const noexcept { return ui; }
88 bool GetUIInitialized() const noexcept { return UIInitialized; }
89 auto GetODMRDataSeries() const noexcept { return ODMRDataSeries; }
90
91 private:
92 Ui::ODMR ui;
94
95 QLineSeries* ODMRDataSeries;
96 QLineSeries* ODMRFitSeries;
98 QValueAxis* ODMRXAxis;
99 QValueAxis* ODMRYAxis;
100
103 QLogValueAxis* SensitivityXAxis;
104 QLogValueAxis* SensitivityYAxis;
105
109
110 bool UIInitialized = false;
111
112 private slots:
114 void OnSweepSeriesParamChanged(int Index);
115 };
116}
Defines DynExp's core module as an interface between the UI and DynExp objects.
UnitType
Units which can be used for data stream instruments.
double ValueType
Data type to represent hardware limits on the sample values to write to the hardware adapter assigned...
auto GetODMRDataSeries() const noexcept
Definition ODMRWidget.h:89
QLogValueAxis * SensitivityXAxis
Definition ODMRWidget.h:103
void OnSweepSeriesParamChanged(int Index)
void UpdateUIData(Util::SynchronizedPointer< ODMRData > &ModuleData)
void InitializeUI(Util::SynchronizedPointer< ODMRData > &ModuleData)
void UpdateSensitivityPlot(const SensitivityPlotType &SensitivityPlot)
void UpdateODMRPlot(const ODMRPlotType &ODMRPlot)
QLogValueAxis * SensitivityYAxis
Definition ODMRWidget.h:104
void SetUIState(const StateMachineStateType *State, Util::SynchronizedPointer< ODMRData > &ModuleData)
bool AllowResize() const noexcept override final
Indicates the resizing behavior of the user interface window. Override to adjust.
Definition ODMRWidget.h:79
DynExpInstr::DataStreamInstrumentData::UnitType AuxAnalogOutValueUnit
Definition ODMRWidget.h:106
DynExpInstr::DataStreamInstrumentData::ValueType AuxAnalogOutMinValue
Definition ODMRWidget.h:107
DynExpInstr::DataStreamInstrumentData::ValueType AuxAnalogOutMaxValue
Definition ODMRWidget.h:108
bool GetUIInitialized() const noexcept
Definition ODMRWidget.h:88
const auto & GetUI() const noexcept
Definition ODMRWidget.h:87
Window class for Qt-based user interfaces belonging to DynExp modules. User interface Qt window class...
Definition Module.h:1079
QModuleBase & Owner
Module owning this user interface window (reference, because it should never change nor be nullptr).
Definition Module.h:1162
QModuleWidget(QModuleBase &Owner, QWidget *Parent=nullptr)
Constructs a QModuleWidget instance.
Definition Module.cpp:417
State machine state as used by class StateMachine. A state mainly wraps a state function of the membe...
Definition Util.h:1305
Pointer to lock a class derived from ISynchronizedPointerLockable for synchronizing between threads....
Definition Util.h:170
std::tuple< double, double > FitParams
Definition ODMRWidget.h:41
DynExp's main namespace contains the implementation of DynExp including classes to manage resources (...
Accumulates include statements to provide a precompiled header.
const StateMachineStateType * CurrentState
Definition ODMRWidget.h:68