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
15namespace Ui
16{
17 class ODMR;
18}
19
20namespace DynExpModule::ODMR
21{
22 class ODMR;
23 class ODMRData;
24
37
39
41 {
42 // x is frequency in GHz, y is ODMR signal in units of SignalDetector.
43 QList<QPointF> DataPoints;
44 QList<QPointF> FitPoints;
45 std::tuple<double, double> FitParams; // tuple<c0, c1> with fit model ODMRSignal = c0 + c1 * frequency
49 bool HasChanged = false;
50 };
51
53 {
54 // x is frequency in Hz, y is sensitivity in T/sqrt(Hz).
55 QList<QPointF> DataPoints;
58 bool HasChanged = false;
59 };
60
62 {
63 Q_OBJECT
64
65 private:
78
79 public:
80 ODMRWidget(ODMR& Owner, QModuleWidget* parent = nullptr);
81 ~ODMRWidget() = default;
82
83 bool AllowResize() const noexcept override final { return true; }
84
88 void UpdateODMRPlot(const ODMRPlotType& ODMRPlot);
89 void UpdateSensitivityPlot(const SensitivityPlotType& SensitivityPlot);
90
91 const auto GetUI() const noexcept { return ui.get(); }
92 bool GetUIInitialized() const noexcept { return UIInitialized; }
93 auto GetODMRDataSeries() const noexcept { return ODMRDataSeries; }
94
95 private:
96 std::unique_ptr<Ui::ODMR> ui;
98
99 QLineSeries* ODMRDataSeries;
100 QLineSeries* ODMRFitSeries;
102 QValueAxis* ODMRXAxis;
103 QValueAxis* ODMRYAxis;
104
107 QLogValueAxis* SensitivityXAxis;
108 QLogValueAxis* SensitivityYAxis;
109
113
114 bool UIInitialized = false;
115
116 private slots:
118 void OnSweepSeriesParamChanged(int Index);
119 };
120}
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:93
QLogValueAxis * SensitivityXAxis
Definition ODMRWidget.h:107
void OnSweepSeriesParamChanged(int Index)
void UpdateUIData(Util::SynchronizedPointer< ODMRData > &ModuleData)
void InitializeUI(Util::SynchronizedPointer< ODMRData > &ModuleData)
void UpdateSensitivityPlot(const SensitivityPlotType &SensitivityPlot)
const auto GetUI() const noexcept
Definition ODMRWidget.h:91
void UpdateODMRPlot(const ODMRPlotType &ODMRPlot)
QLogValueAxis * SensitivityYAxis
Definition ODMRWidget.h:108
void SetUIState(const StateMachineStateType *State, Util::SynchronizedPointer< ODMRData > &ModuleData)
std::unique_ptr< Ui::ODMR > ui
Definition ODMRWidget.h:96
bool AllowResize() const noexcept override final
Indicates the resizing behavior of the user interface window. Override to adjust.
Definition ODMRWidget.h:83
DynExpInstr::DataStreamInstrumentData::UnitType AuxAnalogOutValueUnit
Definition ODMRWidget.h:110
DynExpInstr::DataStreamInstrumentData::ValueType AuxAnalogOutMinValue
Definition ODMRWidget.h:111
DynExpInstr::DataStreamInstrumentData::ValueType AuxAnalogOutMaxValue
Definition ODMRWidget.h:112
bool GetUIInitialized() const noexcept
Definition ODMRWidget.h:92
Window class for Qt-based user interfaces belonging to DynExp modules. User interface Qt window class...
Definition Module.h:1395
QModuleBase & Owner
Module owning this user interface window (reference, because it should never change nor be nullptr).
Definition Module.h:1478
QModuleWidget(QModuleBase &Owner, QWidget *Parent=nullptr)
Constructs a QModuleWidget instance.
Definition Module.cpp:451
State machine state as used by class StateMachine. A state mainly wraps a state function of the membe...
Definition Util.h:1367
Pointer to lock a class derived from ISynchronizedPointerLockable for synchronizing between threads....
Definition Util.h:170
std::tuple< double, double > FitParams
Definition ODMRWidget.h:45
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:72