pyspectrace 2.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyspectrace/Control/Configuration/Acquisition/Communication/__init__.py +0 -0
- pyspectrace/Control/Configuration/Acquisition/Communication/communicationcontrol.py +34 -0
- pyspectrace/Control/Configuration/Acquisition/Info/__init__.py +0 -0
- pyspectrace/Control/Configuration/Acquisition/Saving/__init__.py +0 -0
- pyspectrace/Control/Configuration/Acquisition/Saving/savingcontrol.py +190 -0
- pyspectrace/Control/Configuration/Acquisition/__init__.py +0 -0
- pyspectrace/Control/Configuration/Acquisition/acquisitioncontrol.py +10 -0
- pyspectrace/Control/Configuration/Plotting/Sensorgramcontrol/__init__.py +6 -0
- pyspectrace/Control/Configuration/Plotting/Sensorgramcontrol/sensorgramcontrol.py +192 -0
- pyspectrace/Control/Configuration/Plotting/Spectrumcontrol/spectrumcontrol.py +99 -0
- pyspectrace/Control/Configuration/Plotting/__init__.py +0 -0
- pyspectrace/Control/Configuration/Plotting/plottingcontrol.py +11 -0
- pyspectrace/Control/Configuration/Processing/Shift/PolynomialFitting/polynomialfittingcontrol.py +126 -0
- pyspectrace/Control/Configuration/Processing/ShiftPeak/GaussianPeakFitting/gaussianpeakfittingcontrol.py +167 -0
- pyspectrace/Control/Configuration/Processing/ShiftPeak/LorentzianPeakFitting/lorentzianpeakfittingcontrol.py +158 -0
- pyspectrace/Control/Configuration/Processing/ShiftPeak/PolyPeakFitting/polypeakfittingcontrol.py +125 -0
- pyspectrace/Control/Configuration/Processing/ShiftPeak/PolynomialPeakFitting/polynomialpeakfittingcontrol.py +235 -0
- pyspectrace/Control/Configuration/Processing/ShiftPeak/__init.py +0 -0
- pyspectrace/Control/Configuration/Processing/ShiftWidthPeak/GaussianWidthPeakFitting/gaussianwidthpeakfittingcontrol.py +140 -0
- pyspectrace/Control/Configuration/Processing/ShiftWidthPeak/LorentzianWidthPeakFitting/lorentzianwidthpeakfittingcontrol.py +139 -0
- pyspectrace/Control/Configuration/Processing/ShiftWidthPeak/PolynomialWidthPeakFitting/polynomialwidthpeakfittingcontrol.py +140 -0
- pyspectrace/Control/Configuration/Processing/ShiftWidthPeak/__init__.py +0 -0
- pyspectrace/Control/Configuration/Processing/__init__.py +0 -0
- pyspectrace/Control/Configuration/Processing/processingcontrol.py +21 -0
- pyspectrace/Control/Configuration/Reference/BaselineSpectrum/__init__.py +0 -0
- pyspectrace/Control/Configuration/Reference/BaselineSpectrum/baselinespectrumcontrol.py +56 -0
- pyspectrace/Control/Configuration/Reference/NormalizationSpectrum/BrightSpectrum/__init__.py +0 -0
- pyspectrace/Control/Configuration/Reference/NormalizationSpectrum/BrightSpectrum/brightspectrumcontrol.py +65 -0
- pyspectrace/Control/Configuration/Reference/NormalizationSpectrum/DarkSpectrum/__init__.py +0 -0
- pyspectrace/Control/Configuration/Reference/NormalizationSpectrum/DarkSpectrum/darkspectrumcontrol.py +66 -0
- pyspectrace/Control/Configuration/Reference/NormalizationSpectrum/normalizationspectrumcontrol.py +28 -0
- pyspectrace/Control/Configuration/Reference/__init__.py +0 -0
- pyspectrace/Control/Configuration/Reference/referencecontrol.py +129 -0
- pyspectrace/Control/Configuration/__init__.py +0 -0
- pyspectrace/Control/Configuration/configurationcontrol.py +17 -0
- pyspectrace/Control/Menusbar/File/filecontrol.py +8 -0
- pyspectrace/Control/Menusbar/SDK/__init__.py +1 -0
- pyspectrace/Control/Menusbar/SDK/sdkcontrol.py +68 -0
- pyspectrace/Control/Menusbar/Tool/Convert/convertcontrol.py +205 -0
- pyspectrace/Control/Menusbar/Tool/Plot3D/plot3dcontrol.py +186 -0
- pyspectrace/Control/Menusbar/Tool/PlotSensorgram/plotsensorgramcontrol.py +68 -0
- pyspectrace/Control/Menusbar/Tool/toolcontrol.py +26 -0
- pyspectrace/Control/Menusbar/__init__.py +0 -0
- pyspectrace/Control/Menusbar/menusbarcontrol.py +14 -0
- pyspectrace/Control/Plotting/Sensorgram/__init__.py +0 -0
- pyspectrace/Control/Plotting/Sensorgram/sensorgramcontrol.py +25 -0
- pyspectrace/Control/Plotting/Spectrum/__init__.py +0 -0
- pyspectrace/Control/Plotting/Spectrum/spectrumcontrol.py +17 -0
- pyspectrace/Control/Plotting/__init__.py +0 -0
- pyspectrace/Control/Plotting/plottingcontrol.py +11 -0
- pyspectrace/Control/__init__.py +0 -0
- pyspectrace/Control/maincontrol.py +818 -0
- pyspectrace/Layout/Configuration/Acquisition/Communication/__init__.py +0 -0
- pyspectrace/Layout/Configuration/Acquisition/Communication/communicationlayout.py +94 -0
- pyspectrace/Layout/Configuration/Acquisition/Info/__init__.py +0 -0
- pyspectrace/Layout/Configuration/Acquisition/Info/infolayout.py +27 -0
- pyspectrace/Layout/Configuration/Acquisition/Saving/__init__.py +0 -0
- pyspectrace/Layout/Configuration/Acquisition/Saving/iconrecord.png +0 -0
- pyspectrace/Layout/Configuration/Acquisition/Saving/iconrecording.png +0 -0
- pyspectrace/Layout/Configuration/Acquisition/Saving/iconrecordoff.png +0 -0
- pyspectrace/Layout/Configuration/Acquisition/Saving/iconrecordon.png +0 -0
- pyspectrace/Layout/Configuration/Acquisition/Saving/savinglayout.py +223 -0
- pyspectrace/Layout/Configuration/Acquisition/__init__.py +0 -0
- pyspectrace/Layout/Configuration/Acquisition/acquisitionlayout.py +52 -0
- pyspectrace/Layout/Configuration/Plotting/Sensorgram/sensorgramlayout.py +99 -0
- pyspectrace/Layout/Configuration/Plotting/Spectrum/spectrumlayout.py +81 -0
- pyspectrace/Layout/Configuration/Plotting/__init__.py +0 -0
- pyspectrace/Layout/Configuration/Plotting/plottinglayout.py +24 -0
- pyspectrace/Layout/Configuration/Processing/Shift/PolynomialFitting/polynomialfittinglayout.py +231 -0
- pyspectrace/Layout/Configuration/Processing/Shift/shiftlayout.py +17 -0
- pyspectrace/Layout/Configuration/Processing/ShiftPeak/GaussianPeakFitting/gaussianpeakfittinglayout.py +230 -0
- pyspectrace/Layout/Configuration/Processing/ShiftPeak/LorentzianPeakFitting/lorentzianpeakfittinglayout.py +229 -0
- pyspectrace/Layout/Configuration/Processing/ShiftPeak/PolyPeakFitting/polypeakfittinglayout.py +246 -0
- pyspectrace/Layout/Configuration/Processing/ShiftPeak/PolynomialPeakFitting/polynomialpeakfittinglayout.py +259 -0
- pyspectrace/Layout/Configuration/Processing/ShiftPeak/__init__.py +0 -0
- pyspectrace/Layout/Configuration/Processing/ShiftPeak/shiftpeaklayout.py +28 -0
- pyspectrace/Layout/Configuration/Processing/ShiftPeakWidth/GaussianPeakWidthFitting/gaussianpeakwidthfittinglayout.py +214 -0
- pyspectrace/Layout/Configuration/Processing/ShiftPeakWidth/LorentzianPeakWidthFitting/lorentzianpeakwidthfittinglayout.py +215 -0
- pyspectrace/Layout/Configuration/Processing/ShiftPeakWidth/PolynomialPeakWidthFitting/__init__.py +0 -0
- pyspectrace/Layout/Configuration/Processing/ShiftPeakWidth/PolynomialPeakWidthFitting/polynomialpeakwidthfittinglayout.py +232 -0
- pyspectrace/Layout/Configuration/Processing/ShiftPeakWidth/__init__.py +0 -0
- pyspectrace/Layout/Configuration/Processing/ShiftPeakWidth/shiftpeakwidthlayout.py +24 -0
- pyspectrace/Layout/Configuration/Processing/__init__.py +0 -0
- pyspectrace/Layout/Configuration/Processing/processinglayout.py +39 -0
- pyspectrace/Layout/Configuration/Reference/BaselineSpectrum/baselinespectrumlayout.py +90 -0
- pyspectrace/Layout/Configuration/Reference/NormalizationSpectrum/normalizationspectrumlayout.py +104 -0
- pyspectrace/Layout/Configuration/Reference/__init__.py +0 -0
- pyspectrace/Layout/Configuration/Reference/referencelayout.py +28 -0
- pyspectrace/Layout/Configuration/__init__.py +0 -0
- pyspectrace/Layout/Configuration/configurationlayout.py +24 -0
- pyspectrace/Layout/Menusbar/File/__init__.py +0 -0
- pyspectrace/Layout/Menusbar/File/exitlayout.py +6 -0
- pyspectrace/Layout/Menusbar/File/showrecordcontrollerlayout.py +3 -0
- pyspectrace/Layout/Menusbar/SDK/__init__.py +1 -0
- pyspectrace/Layout/Menusbar/SDK/sdklayout.py +11 -0
- pyspectrace/Layout/Menusbar/Tool/Convert/convertlayout.py +7 -0
- pyspectrace/Layout/Menusbar/Tool/Plot3D/plot3dlayout.py +8 -0
- pyspectrace/Layout/Menusbar/Tool/PlotSensorgram/plotsensorgramlayout.py +7 -0
- pyspectrace/Layout/Menusbar/Tool/toollayout.py +10 -0
- pyspectrace/Layout/Menusbar/__init__.py +0 -0
- pyspectrace/Layout/Menusbar/menusbarlayout.py +54 -0
- pyspectrace/Layout/Plotting/Sensorgram/__init__.py +0 -0
- pyspectrace/Layout/Plotting/Sensorgram/sensorgramlayout.py +610 -0
- pyspectrace/Layout/Plotting/Spectrum/__init__.py +0 -0
- pyspectrace/Layout/Plotting/Spectrum/spectrumlayout.py +621 -0
- pyspectrace/Layout/Plotting/__init__.py +0 -0
- pyspectrace/Layout/Plotting/plottinglayout.py +13 -0
- pyspectrace/Layout/__init__.py +0 -0
- pyspectrace/Layout/mainlayout.py +193 -0
- pyspectrace/Model/AvanterSpectrometer/HelloSpectrometer.py +53 -0
- pyspectrace/Model/AvanterSpectrometer/avantesspectrometermodel.py +171 -0
- pyspectrace/Model/AvanterSpectrometer/avaspec.py +571 -0
- pyspectrace/Model/CNILaserSpectrometer/cnilaserspectrometermodel.py +103 -0
- pyspectrace/Model/OceanSpectrometer/Oceandirect/OceanDirectAPI.py +3927 -0
- pyspectrace/Model/OceanSpectrometer/Oceandirect/__init__.py +0 -0
- pyspectrace/Model/OceanSpectrometer/Oceandirect/od_logger.py +56 -0
- pyspectrace/Model/OceanSpectrometer/Oceandirect/sdk_properties.py +35 -0
- pyspectrace/Model/OceanSpectrometer/__init__.py +0 -0
- pyspectrace/Model/OceanSpectrometer/oceanspectrometermodel.py +88 -0
- pyspectrace/Model/RecordSpectrometer/recordspectrometermodel.py +280 -0
- pyspectrace/Model/SimulatorSpectrometer/__init__.py +0 -0
- pyspectrace/Model/SimulatorSpectrometer/simulatorspectrometermodel.py +308 -0
- pyspectrace/Model/VirtualSpectrometer/__init__.py +0 -0
- pyspectrace/Model/VirtualSpectrometer/virtualspectrometermodel.py +107 -0
- pyspectrace/Model/__init__.py +0 -0
- pyspectrace/Model/mainmodel.py +84 -0
- pyspectrace/Model/sdkmanager.py +60 -0
- pyspectrace/__init__.py +0 -0
- pyspectrace/main.py +20 -0
- pyspectrace-2.0.0.dist-info/METADATA +104 -0
- pyspectrace-2.0.0.dist-info/RECORD +134 -0
- pyspectrace-2.0.0.dist-info/WHEEL +4 -0
- pyspectrace-2.0.0.dist-info/entry_points.txt +2 -0
- pyspectrace-2.0.0.dist-info/licenses/LICENSE +178 -0
|
File without changes
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
class CommunicationControl:
|
|
3
|
+
def __init__(self, model, view):
|
|
4
|
+
self.model = model
|
|
5
|
+
self.view = view
|
|
6
|
+
|
|
7
|
+
self.delay_time = 250
|
|
8
|
+
|
|
9
|
+
self.view.configurationlayout.acquisitionlayout.communicationlayout.time_integration_button.clicked.connect(
|
|
10
|
+
lambda: self.integration_time_change(
|
|
11
|
+
self.view.configurationlayout.acquisitionlayout.communicationlayout.time_integration_spinbox.value()
|
|
12
|
+
)
|
|
13
|
+
)
|
|
14
|
+
self.view.configurationlayout.acquisitionlayout.communicationlayout.acquisitiondelay_button.clicked.connect(
|
|
15
|
+
lambda: self.acquisition_delay_change(
|
|
16
|
+
self.view.configurationlayout.acquisitionlayout.communicationlayout.acquisitiondelay_spinbox.value()
|
|
17
|
+
)
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
def mainloop(self):
|
|
21
|
+
self.acquire()
|
|
22
|
+
|
|
23
|
+
def acquire(self):
|
|
24
|
+
cumulative_plot = [self.model.acquire_spectrum()]
|
|
25
|
+
self.view.plottinglayout.spectrumlayout.num_spectrum = [None]
|
|
26
|
+
self.view.plottinglayout.spectrumlayout.plot_spectrum(cumulative_plot, cumulative_plot)
|
|
27
|
+
|
|
28
|
+
def integration_time_change(self, slot_integration_value):
|
|
29
|
+
self.model.set_integration_time(slot_integration_value)
|
|
30
|
+
|
|
31
|
+
def acquisition_delay_change(self, slot_delay_value):
|
|
32
|
+
self.delay_time = slot_delay_value
|
|
33
|
+
self.model.set_acquisition_delay(slot_delay_value)
|
|
34
|
+
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
from datetime import datetime, timedelta
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
class SavingControl:
|
|
6
|
+
def __init__(self, model, view):
|
|
7
|
+
self.model = model
|
|
8
|
+
self.view = view
|
|
9
|
+
self.mainpath = self.view.configurationlayout.acquisitionlayout.savinglayout.combined_path_text
|
|
10
|
+
self.processed_wavelengths = None
|
|
11
|
+
self.processed_intensities = None
|
|
12
|
+
|
|
13
|
+
self.raw_wavelengths = None
|
|
14
|
+
self.raw_intensities = None
|
|
15
|
+
|
|
16
|
+
self.stateresume = True
|
|
17
|
+
|
|
18
|
+
self.current_forprogress = 0
|
|
19
|
+
self.elapsed_time = 0
|
|
20
|
+
|
|
21
|
+
# self.current_progress = 0
|
|
22
|
+
self.count_saved = 0
|
|
23
|
+
|
|
24
|
+
self.cumulative_delta_time = 0
|
|
25
|
+
self.frame_list_txt = 0
|
|
26
|
+
self.cumulative_delta_time_raw = 0
|
|
27
|
+
|
|
28
|
+
self.cumulative_delta_time_list = []
|
|
29
|
+
self.cumulative_delta_time_list_raw = []
|
|
30
|
+
|
|
31
|
+
self.delta_timestart = datetime.now()
|
|
32
|
+
# self.delta_timestart_raw = datetime.now()
|
|
33
|
+
# self.delta_timestart = time.perf_counter()
|
|
34
|
+
# self.delta_timestart_raw = time.perf_counter()
|
|
35
|
+
self.start_time = datetime.now()
|
|
36
|
+
self.start_time_progress = datetime.now()
|
|
37
|
+
|
|
38
|
+
self.view.configurationlayout.acquisitionlayout.savinglayout.enable_record_checkbox.stateChanged.connect(self.inittime_save_slot)
|
|
39
|
+
self.view.configurationlayout.acquisitionlayout.savinglayout.apply_button.clicked.connect(self.init_time_save)
|
|
40
|
+
self.view.configurationlayout.acquisitionlayout.savinglayout.pauseresumebuttom.clicked.connect(self.pauseresumestate)
|
|
41
|
+
|
|
42
|
+
def mainloop(self):
|
|
43
|
+
if self.view.configurationlayout.acquisitionlayout.savinglayout.status_saving:
|
|
44
|
+
if self.stateresume:
|
|
45
|
+
_current_time = datetime.now()
|
|
46
|
+
self.elapsed_time = (_current_time - self.start_time).total_seconds()
|
|
47
|
+
|
|
48
|
+
interval = self.view.configurationlayout.acquisitionlayout.savinglayout.interval_saving.value()
|
|
49
|
+
progress_percent = min(int((self.elapsed_time / interval) * 100), 100)
|
|
50
|
+
self.view.configurationlayout.acquisitionlayout.savinglayout.progress.setValue(progress_percent)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
if self.elapsed_time >= self.view.configurationlayout.acquisitionlayout.savinglayout.interval_saving.value():
|
|
54
|
+
self.intervalstart()
|
|
55
|
+
self.savingtxt()
|
|
56
|
+
self.start_time = _current_time
|
|
57
|
+
self.current_progress = 0
|
|
58
|
+
self.view.record_value_saved.setText(f"{self.count_saved}")
|
|
59
|
+
self.view.configurationlayout.acquisitionlayout.savinglayout.progress.setValue(0)
|
|
60
|
+
self.intervalend()
|
|
61
|
+
else:
|
|
62
|
+
_current_time = datetime.now()
|
|
63
|
+
self.start_time = _current_time - timedelta(seconds=self.elapsed_time)
|
|
64
|
+
|
|
65
|
+
self.delta_timestart = _current_time - timedelta(seconds=self.elapsed_time)
|
|
66
|
+
# self.delta_timestart_raw = _current_time - timedelta(seconds=self.elapsed_time)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def pauseresumestate(self):
|
|
70
|
+
if self.view.configurationlayout.acquisitionlayout.savinglayout.pauseresumebuttom.text() == "Pause":
|
|
71
|
+
self.stateresume = False
|
|
72
|
+
self.view.configurationlayout.acquisitionlayout.savinglayout.pauseresumebuttom.setText("Resume")
|
|
73
|
+
|
|
74
|
+
elif self.view.configurationlayout.acquisitionlayout.savinglayout.pauseresumebuttom.text() == "Resume":
|
|
75
|
+
self.stateresume = True
|
|
76
|
+
self.view.configurationlayout.acquisitionlayout.savinglayout.pauseresumebuttom.setText("Pause")
|
|
77
|
+
|
|
78
|
+
def intervalstart(self):
|
|
79
|
+
self.current_time = datetime.now()
|
|
80
|
+
self.current_time_raw = datetime.now()
|
|
81
|
+
|
|
82
|
+
def intervalend(self):
|
|
83
|
+
self.delta_timestart = self.delta_timeend
|
|
84
|
+
# self.delta_timestart_raw = self.delta_timeend_raw
|
|
85
|
+
|
|
86
|
+
def savingtxt(self):
|
|
87
|
+
processed_wavelengths, processed_intensities = self.model.acquire_spectrum()
|
|
88
|
+
raw_wavelengths, raw_intensities = self.model.acquire_spectrum_for_normalization()
|
|
89
|
+
|
|
90
|
+
self.delta_timeend = datetime.now()
|
|
91
|
+
self.delta_timeend_raw = datetime.now()
|
|
92
|
+
# self.delta_timeend = time.perf_counter()
|
|
93
|
+
# self.delta_timeend_raw = time.perf_counter()
|
|
94
|
+
|
|
95
|
+
self.delta_time = (self.delta_timeend - self.delta_timestart).total_seconds()
|
|
96
|
+
self.delta_time = np.array(self.delta_time)
|
|
97
|
+
self.delta_time = np.full(len(processed_intensities), self.delta_time)
|
|
98
|
+
|
|
99
|
+
self.frame_list_txt = self.frame_list_txt + 1
|
|
100
|
+
|
|
101
|
+
processed_data = [processed_wavelengths, processed_intensities, self.delta_time]
|
|
102
|
+
raw_data = [raw_wavelengths, raw_intensities, self.delta_time]
|
|
103
|
+
|
|
104
|
+
processed_data_transposed = list(map(list, zip(*processed_data)))
|
|
105
|
+
raw_data_transposed = list(map(list, zip(*raw_data)))
|
|
106
|
+
|
|
107
|
+
filename = self.current_time.strftime("%Y-%m-%d_%H-%M-%S")
|
|
108
|
+
|
|
109
|
+
self.mainpath = self.view.configurationlayout.acquisitionlayout.savinglayout.combined_path_text
|
|
110
|
+
os.makedirs(os.path.join(self.mainpath, 'processed'), exist_ok=True)
|
|
111
|
+
os.makedirs(os.path.join(self.mainpath, 'raw'), exist_ok=True)
|
|
112
|
+
|
|
113
|
+
save_path_processed = os.path.join(self.mainpath, 'processed', f'{self.frame_list_txt}-index-processed_spectrum_{filename}.txt')
|
|
114
|
+
save_path_raw = os.path.join(self.mainpath, 'raw', f'{self.frame_list_txt}-index-raw_spectrum_{filename}.txt')
|
|
115
|
+
|
|
116
|
+
for sublist in processed_data_transposed:
|
|
117
|
+
sublist.append(self.current_time.strftime("%Y-%m-%d %H-%M-%S-%f"))
|
|
118
|
+
try:
|
|
119
|
+
with open(save_path_processed, "w") as file:
|
|
120
|
+
file.write(("[wavelength, intensities, timedelta, date, time]") + "\n")
|
|
121
|
+
file.write((">>>>>Begin Processed Spectral Data<<<<<") + "\n")
|
|
122
|
+
for sublist in processed_data_transposed:
|
|
123
|
+
file.write(" ".join(map(str, sublist)) + "\n")
|
|
124
|
+
file.write((">>>>>End Processed Spectral Data<<<<<") + "\n")
|
|
125
|
+
self.count_saved = self.count_saved + 1
|
|
126
|
+
except:
|
|
127
|
+
print("error txt processed saved")
|
|
128
|
+
pass
|
|
129
|
+
|
|
130
|
+
for sublist in raw_data_transposed:
|
|
131
|
+
sublist.append(self.current_time.strftime("%Y-%m-%d %H-%M-%S-%f"))
|
|
132
|
+
try:
|
|
133
|
+
with open(save_path_raw, "w") as file:
|
|
134
|
+
file.write(("[wavelength, intensities, timedelta, date, time]") + "\n")
|
|
135
|
+
file.write((">>>>>Begin Processed Spectral Data<<<<<") + "\n")
|
|
136
|
+
for sublist in raw_data_transposed:
|
|
137
|
+
file.write(" ".join(map(str, sublist)) + "\n")
|
|
138
|
+
file.write((">>>>>End Processed Spectral Data<<<<<") + "\n")
|
|
139
|
+
self.count_saved = self.count_saved + 1
|
|
140
|
+
except:
|
|
141
|
+
print("error txt raw saved")
|
|
142
|
+
pass
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
def inittime_save_slot(self, state):
|
|
146
|
+
if state == 2:
|
|
147
|
+
self.view.configurationlayout.acquisitionlayout.savinglayout.inittime_save = datetime.now().strftime("%Y-%m-%d_%H-%M-%S_%f")
|
|
148
|
+
self.view.configurationlayout.acquisitionlayout.savinglayout.update_combined_text()
|
|
149
|
+
self.mainpath = self.view.configurationlayout.acquisitionlayout.savinglayout.combined_path_text
|
|
150
|
+
|
|
151
|
+
if state == 0:
|
|
152
|
+
self.count_saved = 0
|
|
153
|
+
self.view.record_value_saved.setText(f"{self.count_saved}")
|
|
154
|
+
|
|
155
|
+
def init_time_save(self):
|
|
156
|
+
if self.view.configurationlayout.acquisitionlayout.savinglayout.syncsensorgram.isChecked():
|
|
157
|
+
self.view.configurationlayout.plottinglayout.sensorgramlayout.reset_button.click()
|
|
158
|
+
|
|
159
|
+
self.processed_wavelengths = None
|
|
160
|
+
self.processed_intensities = None
|
|
161
|
+
|
|
162
|
+
self.raw_wavelengths = None
|
|
163
|
+
self.raw_intensities = None
|
|
164
|
+
|
|
165
|
+
# self.current_progress = 0
|
|
166
|
+
self.current_forprogress = 0
|
|
167
|
+
self.count_saved = 0
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
self.cumulative_delta_time = 0
|
|
171
|
+
self.frame_list_txt = 0
|
|
172
|
+
self.cumulative_delta_time_raw = 0
|
|
173
|
+
|
|
174
|
+
self.delta_timestart = datetime.now()
|
|
175
|
+
# self.delta_timestart = time.perf_counter()
|
|
176
|
+
self.cumulative_delta_time_list = []
|
|
177
|
+
# self.delta_timestart_raw = datetime.now()
|
|
178
|
+
# self.delta_timestart_raw = time.perf_counter()
|
|
179
|
+
self.cumulative_delta_time_list_raw = []
|
|
180
|
+
self.start_time = datetime.now()
|
|
181
|
+
self.start_time_progress = datetime.now()
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
def onesecond_left(self, start_time):
|
|
186
|
+
current_time = datetime.now()
|
|
187
|
+
elapsed_time = (current_time - start_time).total_seconds()
|
|
188
|
+
if elapsed_time >= 0.1:
|
|
189
|
+
return True
|
|
190
|
+
return False
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from pyspectrace.Control.Configuration.Acquisition.Communication.communicationcontrol import CommunicationControl
|
|
2
|
+
from pyspectrace.Control.Configuration.Acquisition.Saving.savingcontrol import SavingControl
|
|
3
|
+
class AcquisitionControl:
|
|
4
|
+
def __init__(self,
|
|
5
|
+
model,
|
|
6
|
+
view):
|
|
7
|
+
self.model = model
|
|
8
|
+
self.view = view
|
|
9
|
+
self.communicationcontrol = CommunicationControl(model, view)
|
|
10
|
+
self.savingcontrol = SavingControl(model, view)
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import matplotlib.pyplot as plt
|
|
2
|
+
from PyQt5.QtWidgets import QFileDialog
|
|
3
|
+
import os
|
|
4
|
+
import csv
|
|
5
|
+
from datetime import datetime
|
|
6
|
+
|
|
7
|
+
class SensorgramControl:
|
|
8
|
+
def __init__(self, model, view):
|
|
9
|
+
self.model = model
|
|
10
|
+
self.view = view
|
|
11
|
+
self.current_time = datetime.now()
|
|
12
|
+
# self.view.configurationlayout.plottinglayout.sensorgramlayout.autoscale_y.clicked.connect(
|
|
13
|
+
# self.view.plottinglayout.sensorgramlayout.setscale)
|
|
14
|
+
self.view.configurationlayout.plottinglayout.sensorgramlayout.autoscale_y.clicked.connect(
|
|
15
|
+
self.view.plottinglayout.sensorgramlayout.autoscale_y)
|
|
16
|
+
self.view.configurationlayout.plottinglayout.sensorgramlayout.autoscale_x.clicked.connect(
|
|
17
|
+
self.view.plottinglayout.sensorgramlayout.autoscale_x)
|
|
18
|
+
# self.view.configurationlayout.plottinglayout.sensorgramlayout.update_fixed_range.clicked.connect(self.update_fixed_range)
|
|
19
|
+
self.view.configurationlayout.plottinglayout.sensorgramlayout.update_fixed_range.clicked.connect(self.update_fixed_range_merge)
|
|
20
|
+
# self.view.configurationlayout.plottinglayout.sensorgramlayout.update_fixed_range_merge.clicked.connect(self.update_fixed_range_merge)
|
|
21
|
+
self.view.configurationlayout.plottinglayout.sensorgramlayout.reset_button.clicked.connect(self.show_confirmation)
|
|
22
|
+
self.view.configurationlayout.plottinglayout.sensorgramlayout.savesensorgram.clicked.connect(self.savesensorgram)
|
|
23
|
+
self.view.configurationlayout.plottinglayout.sensorgramlayout.plotsensorgram.clicked.connect(self.plotsensorgram)
|
|
24
|
+
self.view.configurationlayout.plottinglayout.sensorgramlayout.select_time_unit.currentIndexChanged.connect(self.time_unit)
|
|
25
|
+
|
|
26
|
+
self.inittime = 0
|
|
27
|
+
def mainloop(self):
|
|
28
|
+
x = self.view.plottinglayout.sensorgramlayout.gaussianshiftpeak_list
|
|
29
|
+
if any(val > 600 for row in x for val in row):
|
|
30
|
+
# do something
|
|
31
|
+
print("trigger arduino to take an action!")
|
|
32
|
+
pass
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def time_unit(self):
|
|
36
|
+
if self.view.configurationlayout.plottinglayout.sensorgramlayout.select_time_unit.currentIndex() == 0:
|
|
37
|
+
self.view.plottinglayout.sensorgramlayout.time_unit_update(1/1000)
|
|
38
|
+
self.view.plottinglayout.sensorgramlayout.pI.setLabel('bottom', 'Milisecond (ms)')
|
|
39
|
+
if self.view.configurationlayout.plottinglayout.sensorgramlayout.select_time_unit.currentIndex() == 1:
|
|
40
|
+
self.view.plottinglayout.sensorgramlayout.time_unit_update(1)
|
|
41
|
+
self.view.plottinglayout.sensorgramlayout.pI.setLabel('bottom', 'Time (s)')
|
|
42
|
+
if self.view.configurationlayout.plottinglayout.sensorgramlayout.select_time_unit.currentIndex() == 2:
|
|
43
|
+
self.view.plottinglayout.sensorgramlayout.pI.setLabel('bottom', 'Minute (m)')
|
|
44
|
+
self.view.plottinglayout.sensorgramlayout.time_unit_update(1*60)
|
|
45
|
+
|
|
46
|
+
def update_fixed_range(self):
|
|
47
|
+
min = self.view.configurationlayout.plottinglayout.sensorgramlayout.min_range_input.value()
|
|
48
|
+
max = self.view.configurationlayout.plottinglayout.sensorgramlayout.max_range_input.value()
|
|
49
|
+
self.view.plottinglayout.sensorgramlayout.setscale_y(min, max)
|
|
50
|
+
|
|
51
|
+
def update_fixed_range_merge(self):
|
|
52
|
+
min = self.view.configurationlayout.plottinglayout.sensorgramlayout.min_range_input.value()
|
|
53
|
+
max = self.view.configurationlayout.plottinglayout.sensorgramlayout.max_range_input.value()
|
|
54
|
+
self.view.plottinglayout.sensorgramlayout.mergesetscale_y(min, max)
|
|
55
|
+
|
|
56
|
+
def plotsensorgram(self):
|
|
57
|
+
descriptor, time, name, color = self.sensorgram_data()
|
|
58
|
+
descriptor_list = []
|
|
59
|
+
time_list = []
|
|
60
|
+
name_list = []
|
|
61
|
+
color_list = []
|
|
62
|
+
for i in range(len(descriptor)):
|
|
63
|
+
for j in range (len(descriptor[i])):
|
|
64
|
+
descriptor_list.append(descriptor[i][j])
|
|
65
|
+
time_list.append(time[i][j])
|
|
66
|
+
name_list.append(name[i][j])
|
|
67
|
+
color_list.append(color[i][j].name())
|
|
68
|
+
|
|
69
|
+
for i in range(len(descriptor_list)):
|
|
70
|
+
plt.figure(figsize=(10, 6))
|
|
71
|
+
plt.plot(time_list[i], descriptor_list[i], label=name_list[i], color=color_list[i])
|
|
72
|
+
plt.legend()
|
|
73
|
+
plt.title(f'Plot for "{name_list[i]}"')
|
|
74
|
+
plt.show()
|
|
75
|
+
|
|
76
|
+
def savesensorgram(self):
|
|
77
|
+
descriptor, time, name, color = self.sensorgram_data()
|
|
78
|
+
descriptor_list = []
|
|
79
|
+
time_list = []
|
|
80
|
+
name_list = []
|
|
81
|
+
color_list = []
|
|
82
|
+
for i in range(len(descriptor)):
|
|
83
|
+
for j in range (len(descriptor[i])):
|
|
84
|
+
descriptor_list.append(descriptor[i][j])
|
|
85
|
+
time_list.append(time[i][j])
|
|
86
|
+
name_list.append(name[i][j])
|
|
87
|
+
color_list.append(color[i][j].name())
|
|
88
|
+
|
|
89
|
+
folder = QFileDialog.getExistingDirectory(None, "Pilih Folder untuk Menyimpan CSV")
|
|
90
|
+
if not folder:
|
|
91
|
+
print("Penyimpanan dibatalkan. Tidak ada folder yang dipilih.")
|
|
92
|
+
return
|
|
93
|
+
|
|
94
|
+
for i in range(len(descriptor_list)):
|
|
95
|
+
file_name = f'{i}{self.current_time.strftime("%Y-%m-%d_%H-%M-%S_%f")}{name_list[i]}.csv'
|
|
96
|
+
file_path = os.path.join(folder, file_name)
|
|
97
|
+
|
|
98
|
+
# Tulis data ke file CSV
|
|
99
|
+
with open(file_path, mode='w', newline='') as file:
|
|
100
|
+
writer = csv.writer(file)
|
|
101
|
+
# Menulis header
|
|
102
|
+
writer.writerow(['Time', 'Descriptor', 'Label', 'Color'])
|
|
103
|
+
|
|
104
|
+
# Menulis data (loop berdasarkan sub-data `time_list[i]` dan `descriptor_list[i]`)
|
|
105
|
+
for j in range(len(time_list[i])):
|
|
106
|
+
writer.writerow([time_list[i][j], descriptor_list[i][j], name_list[i], color_list[i]])
|
|
107
|
+
print(f"Data disimpan ke: {file_path}")
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def show_confirmation(self):
|
|
113
|
+
# reply = QMessageBox.question(self.view, 'Info', 'Are you sure to reset sensorgram?',
|
|
114
|
+
# QMessageBox.Yes | QMessageBox.No, QMessageBox.No)
|
|
115
|
+
|
|
116
|
+
# if reply == QMessageBox.Yes:
|
|
117
|
+
# self.resetsensorgram()
|
|
118
|
+
self.resetsensorgram()
|
|
119
|
+
|
|
120
|
+
def resetsensorgram(self):
|
|
121
|
+
self.view.plottinglayout.sensorgramlayout.frame_list_gaussianshiftpeak.clear()
|
|
122
|
+
self.view.plottinglayout.sensorgramlayout.gaussianshiftpeak_list.clear()
|
|
123
|
+
|
|
124
|
+
self.view.plottinglayout.sensorgramlayout.frame_list_lorentzianshiftpeak.clear()
|
|
125
|
+
self.view.plottinglayout.sensorgramlayout.lorentzianshiftpeak_list.clear()
|
|
126
|
+
|
|
127
|
+
self.view.plottinglayout.sensorgramlayout.frame_list_polynomialshiftpeak.clear()
|
|
128
|
+
self.view.plottinglayout.sensorgramlayout.polynomialshiftpeak_list.clear()
|
|
129
|
+
|
|
130
|
+
self.view.plottinglayout.sensorgramlayout.frame_list_polyshiftpeak.clear()
|
|
131
|
+
self.view.plottinglayout.sensorgramlayout.polyshiftpeak_list.clear()
|
|
132
|
+
|
|
133
|
+
self.view.plottinglayout.sensorgramlayout.frame_list_polynomialshift.clear()
|
|
134
|
+
self.view.plottinglayout.sensorgramlayout.polynomialshift_list.clear()
|
|
135
|
+
|
|
136
|
+
self.view.plottinglayout.sensorgramlayout.frame_list_lorentzianshiftpeakwidth.clear()
|
|
137
|
+
self.view.plottinglayout.sensorgramlayout.lorentzianshiftpeakwidth_list.clear()
|
|
138
|
+
|
|
139
|
+
self.view.plottinglayout.sensorgramlayout.frame_list_gaussianshiftpeakwidth.clear()
|
|
140
|
+
self.view.plottinglayout.sensorgramlayout.gaussianshiftpeakwidth_list.clear()
|
|
141
|
+
|
|
142
|
+
self.view.plottinglayout.sensorgramlayout.frame_list_polynomialshiftpeakwidth.clear()
|
|
143
|
+
self.view.plottinglayout.sensorgramlayout.polynomialshiftpeakwidth_list.clear()
|
|
144
|
+
|
|
145
|
+
self.view.plottinglayout.sensorgramlayout.frame = 0
|
|
146
|
+
self.view.plottinglayout.sensorgramlayout.clearplot_plot_obj()
|
|
147
|
+
|
|
148
|
+
def sensorgram_data(self):
|
|
149
|
+
descriptor = [
|
|
150
|
+
self.view.plottinglayout.sensorgramlayout.gaussianshiftpeak_list,
|
|
151
|
+
self.view.plottinglayout.sensorgramlayout.lorentzianshiftpeak_list,
|
|
152
|
+
self.view.plottinglayout.sensorgramlayout.polynomialshiftpeak_list,
|
|
153
|
+
self.view.plottinglayout.sensorgramlayout.polyshiftpeak_list,
|
|
154
|
+
self.view.plottinglayout.sensorgramlayout.polynomialshift_list,
|
|
155
|
+
self.view.plottinglayout.sensorgramlayout.lorentzianshiftpeakwidth_list,
|
|
156
|
+
self.view.plottinglayout.sensorgramlayout.gaussianshiftpeakwidth_list,
|
|
157
|
+
self.view.plottinglayout.sensorgramlayout.polynomialshiftpeakwidth_list,
|
|
158
|
+
]
|
|
159
|
+
|
|
160
|
+
time = [
|
|
161
|
+
self.view.plottinglayout.sensorgramlayout.frame_list_gaussianshiftpeak,
|
|
162
|
+
self.view.plottinglayout.sensorgramlayout.frame_list_lorentzianshiftpeak,
|
|
163
|
+
self.view.plottinglayout.sensorgramlayout.frame_list_polynomialshiftpeak,
|
|
164
|
+
self.view.plottinglayout.sensorgramlayout.frame_list_polyshiftpeak,
|
|
165
|
+
self.view.plottinglayout.sensorgramlayout.frame_list_polynomialshift,
|
|
166
|
+
self.view.plottinglayout.sensorgramlayout.frame_list_lorentzianshiftpeakwidth,
|
|
167
|
+
self.view.plottinglayout.sensorgramlayout.frame_list_gaussianshiftpeakwidth,
|
|
168
|
+
self.view.plottinglayout.sensorgramlayout.frame_list_polynomialshiftpeakwidth,
|
|
169
|
+
]
|
|
170
|
+
|
|
171
|
+
name = [
|
|
172
|
+
self.view.plottinglayout.sensorgramlayout.name_gaussianpeakfitting,
|
|
173
|
+
self.view.plottinglayout.sensorgramlayout.name_lorentzianpeakfitting,
|
|
174
|
+
self.view.plottinglayout.sensorgramlayout.name_polynomialpeakfitting,
|
|
175
|
+
self.view.plottinglayout.sensorgramlayout.name_polypeakfitting,
|
|
176
|
+
self.view.plottinglayout.sensorgramlayout.name_polynomialfitting,
|
|
177
|
+
self.view.plottinglayout.sensorgramlayout.name_lorentzianpeakwidthfitting,
|
|
178
|
+
self.view.plottinglayout.sensorgramlayout.name_gaussianpeakwidthfitting,
|
|
179
|
+
self.view.plottinglayout.sensorgramlayout.name_polynomialpeakwidthfitting,
|
|
180
|
+
]
|
|
181
|
+
|
|
182
|
+
color = [
|
|
183
|
+
self.view.plottinglayout.sensorgramlayout.color_gaussianshiftpeak,
|
|
184
|
+
self.view.plottinglayout.sensorgramlayout.color_lorentzianshiftpeak,
|
|
185
|
+
self.view.plottinglayout.sensorgramlayout.color_polynomialshiftpeak,
|
|
186
|
+
self.view.plottinglayout.sensorgramlayout.color_polyshiftpeak,
|
|
187
|
+
self.view.plottinglayout.sensorgramlayout.color_polynomialshift,
|
|
188
|
+
self.view.plottinglayout.sensorgramlayout.color_lorentzianshiftpeakwidth,
|
|
189
|
+
self.view.plottinglayout.sensorgramlayout.color_gaussianshiftpeakwidth,
|
|
190
|
+
self.view.plottinglayout.sensorgramlayout.color_polynomialshiftpeakwidth,
|
|
191
|
+
]
|
|
192
|
+
return descriptor, time, name, color
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
from datetime import datetime, timedelta
|
|
2
|
+
from PyQt5.QtWidgets import QMessageBox
|
|
3
|
+
import pyqtgraph as pg
|
|
4
|
+
import random
|
|
5
|
+
|
|
6
|
+
class SpectrumControl:
|
|
7
|
+
def __init__(self, model, view):
|
|
8
|
+
self.model = model
|
|
9
|
+
self.view = view
|
|
10
|
+
|
|
11
|
+
self.start_time = datetime.now()
|
|
12
|
+
self.current_forprogress = 0
|
|
13
|
+
self.elapsed_time = 0
|
|
14
|
+
|
|
15
|
+
self.start_time_foraccumulated = datetime.now()
|
|
16
|
+
self.current_foraccumulated = 0
|
|
17
|
+
|
|
18
|
+
self.accumulated_wavelengths = []
|
|
19
|
+
self.accumulated_intensities = []
|
|
20
|
+
self.accumulated_second = []
|
|
21
|
+
|
|
22
|
+
self.state_accumulated = False
|
|
23
|
+
self.view.configurationlayout.plottinglayout.spectrumlayout.start_acquire.setEnabled(True)
|
|
24
|
+
self.view.configurationlayout.plottinglayout.spectrumlayout.pause_acquire.setEnabled(False)
|
|
25
|
+
self.view.configurationlayout.plottinglayout.spectrumlayout.restart.clicked.connect(self.show_confirmation)
|
|
26
|
+
self.view.configurationlayout.plottinglayout.spectrumlayout.plot.clicked.connect(self.plot)
|
|
27
|
+
self.view.configurationlayout.plottinglayout.spectrumlayout.start_acquire.clicked.connect(self.truestate)
|
|
28
|
+
self.view.configurationlayout.plottinglayout.spectrumlayout.pause_acquire.clicked.connect(self.falsestate)
|
|
29
|
+
|
|
30
|
+
self.view.configurationlayout.plottinglayout.spectrumlayout.fit_interest_x.clicked.connect(
|
|
31
|
+
self.view.plottinglayout.spectrumlayout.autoscale_x)
|
|
32
|
+
self.view.configurationlayout.plottinglayout.spectrumlayout.fit_interest_y.clicked.connect(
|
|
33
|
+
self.view.plottinglayout.spectrumlayout.autoscale_y)
|
|
34
|
+
|
|
35
|
+
def truestate(self):
|
|
36
|
+
self.state_accumulated = True
|
|
37
|
+
self.view.configurationlayout.plottinglayout.spectrumlayout.start_acquire.setEnabled(False)
|
|
38
|
+
self.view.configurationlayout.plottinglayout.spectrumlayout.pause_acquire.setEnabled(True)
|
|
39
|
+
|
|
40
|
+
def falsestate(self):
|
|
41
|
+
self.state_accumulated = False
|
|
42
|
+
self.view.configurationlayout.plottinglayout.spectrumlayout.start_acquire.setEnabled(True)
|
|
43
|
+
self.view.configurationlayout.plottinglayout.spectrumlayout.pause_acquire.setEnabled(False)
|
|
44
|
+
|
|
45
|
+
def mainloop(self):
|
|
46
|
+
if self.state_accumulated:
|
|
47
|
+
_current_time = datetime.now()
|
|
48
|
+
self.elapsed_time = (_current_time - self.start_time).total_seconds()
|
|
49
|
+
interval = self.view.configurationlayout.plottinglayout.spectrumlayout.interval_acquire.value()
|
|
50
|
+
progress_percent = min(int((self.elapsed_time / interval) * 100), 100)
|
|
51
|
+
self.view.configurationlayout.plottinglayout.spectrumlayout.progress.setValue(progress_percent)
|
|
52
|
+
if self.elapsed_time >= self.view.configurationlayout.plottinglayout.spectrumlayout.interval_acquire.value():
|
|
53
|
+
self.intervalstart()
|
|
54
|
+
self.accumulated_second.append((_current_time - self.start_time_foraccumulated).total_seconds())
|
|
55
|
+
self.accumulating_spectrum()
|
|
56
|
+
self.start_time = _current_time
|
|
57
|
+
self.view.configurationlayout.plottinglayout.spectrumlayout.progress.setValue(0)
|
|
58
|
+
else:
|
|
59
|
+
_current_time = datetime.now()
|
|
60
|
+
self.start_time = _current_time - timedelta(seconds=self.elapsed_time)
|
|
61
|
+
|
|
62
|
+
def spectrum_data(self):
|
|
63
|
+
spectrum = [
|
|
64
|
+
self.view.plottinglayout.spectrumlayout.wavelengths,
|
|
65
|
+
self.view.plottinglayout.spectrumlayout.intensities,
|
|
66
|
+
]
|
|
67
|
+
return spectrum[0][0], spectrum[1][0]
|
|
68
|
+
|
|
69
|
+
def intervalstart(self):
|
|
70
|
+
self.current_time = datetime.now()
|
|
71
|
+
|
|
72
|
+
def accumulating_spectrum(self):
|
|
73
|
+
wavelengths, intensities = self.spectrum_data()
|
|
74
|
+
self.accumulated_wavelengths.append(wavelengths)
|
|
75
|
+
self.accumulated_intensities.append(intensities)
|
|
76
|
+
self.view.configurationlayout.plottinglayout.spectrumlayout.sum.setText(f"{len(self.accumulated_intensities)}")
|
|
77
|
+
|
|
78
|
+
def show_confirmation(self):
|
|
79
|
+
reply = QMessageBox.question(self.view, 'Info', 'Are you sure to reset plot?',
|
|
80
|
+
QMessageBox.Yes | QMessageBox.No, QMessageBox.No)
|
|
81
|
+
|
|
82
|
+
if reply == QMessageBox.Yes:
|
|
83
|
+
self.restart()
|
|
84
|
+
|
|
85
|
+
def restart(self):
|
|
86
|
+
self.accumulated_wavelengths = []
|
|
87
|
+
self.accumulated_intensities = []
|
|
88
|
+
self.view.configurationlayout.plottinglayout.spectrumlayout.sum.setText(f"{len(self.accumulated_intensities)}")
|
|
89
|
+
|
|
90
|
+
def plot(self):
|
|
91
|
+
self.window = pg.GraphicsLayoutWidget(show=True, title="Spectrum Over Time")
|
|
92
|
+
self.window.setBackground('w')
|
|
93
|
+
self.plotting = self.window.addPlot()
|
|
94
|
+
self.plotting.addLegend()
|
|
95
|
+
for i, (wavelengths, intensities) in enumerate(zip(self.accumulated_wavelengths, self.accumulated_intensities)):
|
|
96
|
+
color = (random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))
|
|
97
|
+
pen = pg.mkPen(color=color, width=1)
|
|
98
|
+
self.plotting.plot(wavelengths, intensities, pen=pen, name=f"{self.accumulated_second[i]:.2f} second")
|
|
99
|
+
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from pyspectrace.Control.Configuration.Plotting.Spectrumcontrol.spectrumcontrol import SpectrumControl
|
|
2
|
+
from pyspectrace.Control.Configuration.Plotting.Sensorgramcontrol.sensorgramcontrol import SensorgramControl
|
|
3
|
+
class PlottingLayout:
|
|
4
|
+
def __init__(self,
|
|
5
|
+
model,
|
|
6
|
+
view):
|
|
7
|
+
self.model = model
|
|
8
|
+
self.view = view
|
|
9
|
+
self.spectrumcontrol = SpectrumControl(model, view)
|
|
10
|
+
self.sensorgramcontrol = SensorgramControl(model, view)
|
|
11
|
+
|