DynExp
Highly flexible laboratory automation for dynamically changing experiments.
Loading...
Searching...
No Matches
SpectrumViewerBackend.h
Go to the documentation of this file.
1// This file is part of DynExp.
2
8#pragma once
9
10#include <qqml.h>
11
12#include "stdafx.h"
14
16{
17 class SpectrumViewerBackend : public QObject
18 {
19 Q_OBJECT
20 QML_ELEMENT
21
22 Q_PROPERTY(bool SilentFocused MEMBER SilentFocused READ IsSilentFocused)
26 Q_PROPERTY(QPointF LimitRange READ GetLimitRange WRITE SetLimitRange NOTIFY rangesChanged)
27 Q_PROPERTY(QString LimitUnit READ GetLimitUnit WRITE SetLimitUnit NOTIFY rangesChanged)
30 Q_PROPERTY(double Progress READ GetProgress WRITE SetProgress NOTIFY progressChanged)
31 Q_PROPERTY(StateType State READ GetState WRITE SetState NOTIFY stateChanged)
32
33 Q_PROPERTY(bool Silent READ IsSilent WRITE SetSilent NOTIFY silentChanged)
35 Q_PROPERTY(double LowerLimit READ GetLowerLimit WRITE SetLowerLimit NOTIFY lowerLimitChanged)
36 Q_PROPERTY(double UpperLimit READ GetUpperLimit WRITE SetUpperLimit NOTIFY upperLimitChanged)
37
38 public:
40 Q_ENUM(StateType)
41
42 SpectrumViewerBackend(QObject* parent = nullptr);
44
45 bool IsSilentFocused() const noexcept { return SilentFocused; }
46 QPoint GetExposureTimeRange() const noexcept { return ExposureTimeRange; }
47 void SetExposureTimeRange(QPoint Range) noexcept;
48 QString GetExposureTimeUnit() const noexcept { return ExposureTimeUnit; }
49 void SetExposureTimeUnit(QString Unit) noexcept;
50 bool IsExposureTimeFocused() const noexcept { return ExposureTimeFocused; }
51 QPointF GetLimitRange() const noexcept { return LimitRange; }
52 void SetLimitRange(QPointF Range) noexcept;
53 QString GetLimitUnit() const noexcept { return LimitUnit; }
54 void SetLimitUnit(QString Unit) noexcept;
55 bool IsLowerLimitFocused() const noexcept { return LowerLimitFocused; }
56 bool IsUpperLimitFocused() const noexcept { return UpperLimitFocused; }
57 double GetProgress() const noexcept { return Progress; }
58 void SetProgress(double Progress) noexcept;
59 StateType GetState() const noexcept { return State; }
60 void SetState(StateType State) noexcept;
61
62 bool IsSilent() const noexcept { return Silent; }
63 void SetSilent(bool Silent) noexcept;
64 int GetExposureTime() const noexcept { return ExposureTime; }
65 void SetExposureTime(int ExposureTime) noexcept;
66 double GetLowerLimit() const noexcept { return LowerLimit; }
67 void SetLowerLimit(double LowerLimit) noexcept;
68 double GetUpperLimit() const noexcept { return UpperLimit; }
69 void SetUpperLimit(double UpperLimit) noexcept;
70
73
74 Q_INVOKABLE void SetGraphBackend(QObject* Object);
75
76 signals:
77 void saveData();
78 void runClicked();
80 void silentChanged(bool);
82 void lowerLimitChanged(double);
83 void upperLimitChanged(double);
85 void progressChanged(double);
87
88 private:
89 bool SilentFocused = false;
90 QPoint ExposureTimeRange = { 0, 1 };
91 QString ExposureTimeUnit;
92 bool ExposureTimeFocused = false;
93 QPointF LimitRange = { 0., 1. };
94 QString LimitUnit;
95 bool LowerLimitFocused = false;
96 bool UpperLimitFocused = false;
97 double Progress = 0;
99
100 bool Silent = false;
101 int ExposureTime = 0;
102 double LowerLimit = .0;
103 double UpperLimit = .0;
104
106 };
107}
C++ backend of the QDynExpLineGraph QML component.
DynExpQuick::DynExpLineGraphBackend * GetGraph() const
Accumulates include statements to provide a precompiled header.