diff --git a/app.py b/app.py index 8093502..b399823 100644 --- a/app.py +++ b/app.py @@ -58,7 +58,9 @@ class AppWindow(QtWidgets.QMainWindow, Ui_MainWindow): timestep = (mem['x_data'][-1] - mem['x_data'][0]) / len(mem['x_data']) mem['timestep'] = timestep self.spin_timestep.setValue(timestep) - print(timestep) + def set_timestep(x): + mem['timestep'] = x + self.spin_timestep.valueChanged.connect(lambda v: set_timestep(v)) self.raw_data_graph.plot() # Graph new stuff # self.groups_graph.clear() # Clear old stuff @@ -78,6 +80,8 @@ class AppWindow(QtWidgets.QMainWindow, Ui_MainWindow): self.graph_tabs.setCurrentIndex(0) # Load from persistent storage & bind write actions + # NOTE: This is incomplete, but can very easily finished if someone can figure out what's wrong. + # Currently using https://github.com/RaRe-Technologies/sqlitedict for local db handling. # path_hash = md5(filename.encode('utf-8')).hexdigest() diff --git a/crds_calc.py b/crds_calc.py index ba80efb..ec7a67e 100644 --- a/crds_calc.py +++ b/crds_calc.py @@ -282,6 +282,7 @@ def fit_peaks( for peak_data in peaks_cut: x_data = np.arange(len(peak_data)) # just placeholder indices # x_data = np.arange(0, len(peak_data)*mem['timestep'], mem['timestep']) + print(x_data) if not use_advanced: peak_index = np.argmax(peak_data, axis=0) else: @@ -314,7 +315,7 @@ def get_time_constants(equation_data): for r in equation_data: row = [] for e in r: - tau = e['popt'][3] + tau = e['popt'][3]*mem['timestep'] row.append(tau) tau_data.append(row) diff --git a/ui/mainwin.ui b/ui/mainwin.ui index 8dd073d..fcddd5e 100644 --- a/ui/mainwin.ui +++ b/ui/mainwin.ui @@ -19,13 +19,13 @@ - 280 + 286 0 - 280 + 286 16777215 @@ -39,9 +39,9 @@ 0 - 0 - 261 - 926 + -240 + 270 + 928 @@ -49,14 +49,14 @@ - 239 + 248 0 - 239 - 16777215 + 248 + 64 @@ -75,7 +75,7 @@ - 6 + 10 0.000000000000000 @@ -94,14 +94,14 @@ - 239 - 278 + 248 + 306 - 239 - 278 + 248 + 306 @@ -198,7 +198,7 @@ 0 0 211 - 91 + 111 @@ -360,13 +360,13 @@ - 239 + 248 165 - 239 + 248 165 @@ -505,13 +505,13 @@ - 239 - 376 + 248 + 350 - 239 + 248 351 @@ -523,11 +523,18 @@ - INITIAL FIT CONFIG + INITIAL FIT CONFIG (timescale: ticks) - + + + + 16777215 + 66 + + +