DynExp
Highly flexible laboratory automation for dynamically changing experiments.
Loading...
Searching...
No Matches
SpectrumViewerBackend.cpp
Go to the documentation of this file.
1// This file is part of DynExp.
2
3#include "stdafx.h"
5
7{
8 SpectrumViewerBackend::SpectrumViewerBackend(QObject* parent) : QObject(parent)
9 {
10 }
11
13 {
14 if (ExposureTimeRange == Range)
15 return;
16
17 ExposureTimeRange = Range;
18
19 emit rangesChanged();
20 }
21
23 {
24 if (ExposureTimeUnit == Unit)
25 return;
26
27 ExposureTimeUnit = Unit;
28
29 emit rangesChanged();
30 }
31
32 void SpectrumViewerBackend::SetLimitRange(QPointF Range) noexcept
33 {
34 if (LimitRange == Range)
35 return;
36
37 LimitRange = Range;
38
39 emit rangesChanged();
40 }
41
42 void SpectrumViewerBackend::SetLimitUnit(QString Unit) noexcept
43 {
44 if (LimitUnit == Unit)
45 return;
46
47 LimitUnit = Unit;
48
49 emit rangesChanged();
50 }
51
52 void SpectrumViewerBackend::SetProgress(double Progress) noexcept
53 {
54 if (this->Progress == Progress)
55 return;
56
57 this->Progress = Progress;
58
59 emit progressChanged(Progress);
60 }
61
63 {
64 if (this->State == State)
65 return;
66
67 this->State = State;
68
69 emit stateChanged(State);
70 }
71
72 void SpectrumViewerBackend::SetSilent(bool Silent) noexcept
73 {
74 if (this->Silent == Silent)
75 return;
76
77 this->Silent = Silent;
78
79 emit silentChanged(Silent);
80 }
81
82 void SpectrumViewerBackend::SetExposureTime(int ExposureTime) noexcept
83 {
84 if (this->ExposureTime == ExposureTime)
85 return;
86
87 this->ExposureTime = ExposureTime;
88
89 emit exposureTimeChanged(ExposureTime);
90 }
91
92 void SpectrumViewerBackend::SetLowerLimit(double LowerLimit) noexcept
93 {
94 if (this->LowerLimit == LowerLimit)
95 return;
96
97 this->LowerLimit = LowerLimit;
98
99 emit lowerLimitChanged(LowerLimit);
100 }
101
102 void SpectrumViewerBackend::SetUpperLimit(double UpperLimit) noexcept
103 {
104 if (this->UpperLimit == UpperLimit)
105 return;
106
107 this->UpperLimit = UpperLimit;
108
109 emit upperLimitChanged(UpperLimit);
110 }
111
113 {
114 if (!Graph)
115 throw Util::InvalidStateException("Graph backend has not been assigned yet.");
116
117 return Graph;
118 }
119
121 {
122 return const_cast<DynExpQuick::DynExpLineGraphBackend*>(std::as_const(*this).GetGraph());
123 }
124
125 Q_INVOKABLE void SpectrumViewerBackend::SetGraphBackend(QObject* Object)
126 {
127 Graph = qobject_cast<DynExpQuick::DynExpLineGraphBackend*>(Object);
128 }
129}
C++ backend of the SpectrumViewer QML module.
DynExpQuick::DynExpLineGraphBackend * GetGraph() const
An operation cannot be performed currently since the related object is in an invalid state like an er...
Definition Exception.h:151
Accumulates include statements to provide a precompiled header.