Fix UI spacing & final tau timescale

master
michael 2021-08-11 10:53:04 -07:00
parent db276576b3
commit a57adf9a3b
3 changed files with 35 additions and 23 deletions

6
app.py
View File

@ -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()

View File

@ -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)

View File

@ -19,13 +19,13 @@
<widget class="QScrollArea" name="scrollArea">
<property name="minimumSize">
<size>
<width>280</width>
<width>286</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>280</width>
<width>286</width>
<height>16777215</height>
</size>
</property>
@ -39,9 +39,9 @@
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>261</width>
<height>926</height>
<y>-240</y>
<width>270</width>
<height>928</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
@ -49,14 +49,14 @@
<widget class="QGroupBox" name="groupBox_5">
<property name="minimumSize">
<size>
<width>239</width>
<width>248</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>239</width>
<height>16777215</height>
<width>248</width>
<height>64</height>
</size>
</property>
<property name="title">
@ -75,7 +75,7 @@
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="spin_timestep">
<property name="decimals">
<number>6</number>
<number>10</number>
</property>
<property name="minimum">
<double>0.000000000000000</double>
@ -94,14 +94,14 @@
<widget class="QGroupBox" name="groupBox">
<property name="minimumSize">
<size>
<width>239</width>
<height>278</height>
<width>248</width>
<height>306</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>239</width>
<height>278</height>
<width>248</width>
<height>306</height>
</size>
</property>
<property name="font">
@ -198,7 +198,7 @@
<x>0</x>
<y>0</y>
<width>211</width>
<height>91</height>
<height>111</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout">
@ -360,13 +360,13 @@
<widget class="QGroupBox" name="groupBox_4">
<property name="minimumSize">
<size>
<width>239</width>
<width>248</width>
<height>165</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>239</width>
<width>248</width>
<height>165</height>
</size>
</property>
@ -505,13 +505,13 @@
<widget class="QGroupBox" name="groupBox_2">
<property name="minimumSize">
<size>
<width>239</width>
<height>376</height>
<width>248</width>
<height>350</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>239</width>
<width>248</width>
<height>351</height>
</size>
</property>
@ -523,11 +523,18 @@
</font>
</property>
<property name="title">
<string>INITIAL FIT CONFIG</string>
<string>INITIAL FIT CONFIG (timescale: ticks)</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGraphicsView" name="equation_view"/>
<widget class="QGraphicsView" name="equation_view">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>66</height>
</size>
</property>
</widget>
</item>
<item>
<layout class="QFormLayout" name="formLayout_3">