mirror of https://gitlab.com/pamhyr/pamhyr2
add time slider (results)
parent
91e780432d
commit
92c9b106e3
|
|
@ -521,13 +521,11 @@ class AdisTSlc(AdisTS):
|
||||||
for k in range(0, ismax, kbl):
|
for k in range(0, ismax, kbl):
|
||||||
data = np.fromfile(f, dtype=np.int32, count=1) # line length (bytes) (start)
|
data = np.fromfile(f, dtype=np.int32, count=1) # line length (bytes) (start)
|
||||||
pk[k:min(k + kbl, ismax)] = np.fromfile(f, dtype=np.float32, count=min(k + kbl, ismax) - k)
|
pk[k:min(k + kbl, ismax)] = np.fromfile(f, dtype=np.float32, count=min(k + kbl, ismax) - k)
|
||||||
print("pk : ", pk)
|
|
||||||
data = np.fromfile(f, dtype=np.int32, count=1) # line length (bytes) (end)
|
data = np.fromfile(f, dtype=np.int32, count=1) # line length (bytes) (end)
|
||||||
|
|
||||||
# fifth line (useless)
|
# fifth line (useless)
|
||||||
data = np.fromfile(f, dtype=np.int32, count=1) # line length (bytes) (start)
|
data = np.fromfile(f, dtype=np.int32, count=1) # line length (bytes) (start)
|
||||||
zmin_OLD = np.fromfile(f, dtype=np.float32, count=1)[0]
|
zmin_OLD = np.fromfile(f, dtype=np.float32, count=1)[0]
|
||||||
print("zmin_OLD : ", zmin_OLD)
|
|
||||||
data = np.fromfile(f, dtype=np.int32, count=1) # line length (bytes) (end)
|
data = np.fromfile(f, dtype=np.int32, count=1) # line length (bytes) (end)
|
||||||
# sixth line
|
# sixth line
|
||||||
zf = np.zeros(ismax, dtype=np.float32)
|
zf = np.zeros(ismax, dtype=np.float32)
|
||||||
|
|
@ -539,12 +537,10 @@ class AdisTSlc(AdisTS):
|
||||||
# z[i*3+1] and z[i*3+2] are useless
|
# z[i*3+1] and z[i*3+2] are useless
|
||||||
data = np.fromfile(f, dtype=np.int32, count=1) # line length (bytes) (end)
|
data = np.fromfile(f, dtype=np.int32, count=1) # line length (bytes) (end)
|
||||||
zf = [z[i * 3] for i in range(ismax)]
|
zf = [z[i * 3] for i in range(ismax)]
|
||||||
print("zf : ", zf)
|
|
||||||
# seventh line (useless)
|
# seventh line (useless)
|
||||||
for k in range(0, ismax, kbl):
|
for k in range(0, ismax, kbl):
|
||||||
data = np.fromfile(f, dtype=np.int32, count=1) # line length (bytes) (start)
|
data = np.fromfile(f, dtype=np.int32, count=1) # line length (bytes) (start)
|
||||||
zero = np.fromfile(f, dtype=np.int32, count=ismax)
|
zero = np.fromfile(f, dtype=np.int32, count=ismax)
|
||||||
print("zero : ", zero)
|
|
||||||
data = np.fromfile(f, dtype=np.int32, count=1) # line length (bytes) (end)
|
data = np.fromfile(f, dtype=np.int32, count=1) # line length (bytes) (end)
|
||||||
# end header
|
# end header
|
||||||
|
|
||||||
|
|
@ -648,17 +644,12 @@ class AdisTSlc(AdisTS):
|
||||||
#print("isma")
|
#print("isma")
|
||||||
###print("iprofiles: ", iprofiles)
|
###print("iprofiles: ", iprofiles)
|
||||||
|
|
||||||
pi_tmp = []
|
for i in range(ismax):
|
||||||
reach_tmp = []
|
|
||||||
|
|
||||||
for i in range(ismax-1):
|
|
||||||
#print("first i: ", i)
|
#print("first i: ", i)
|
||||||
reach = ip_to_r(i)
|
reach = ip_to_r(i)
|
||||||
reach_tmp.append(reach)
|
|
||||||
#print("reach i:", reach)
|
#print("reach i:", reach)
|
||||||
#print("second i: ", i)
|
#print("second i: ", i)
|
||||||
p_i = ip_to_ri(reach, i)
|
p_i = ip_to_ri(reach, i)
|
||||||
pi_tmp.append(p_i)
|
|
||||||
|
|
||||||
for t_data in timestamps_keys:
|
for t_data in timestamps_keys:
|
||||||
pol_view = []
|
pol_view = []
|
||||||
|
|
|
||||||
|
|
@ -99,17 +99,12 @@ class TableModel(PamhyrTableModel):
|
||||||
tmp_list = self._data.pollutants_list.copy()
|
tmp_list = self._data.pollutants_list.copy()
|
||||||
tmp_list.remove("total_sediment")
|
tmp_list.remove("total_sediment")
|
||||||
tmp_list2 = self._data.pollutants_list.copy()
|
tmp_list2 = self._data.pollutants_list.copy()
|
||||||
print("=============================list polutants table raw: ", tmp_list)
|
|
||||||
print("=============================list polutants table raw: ", tmp_list2)
|
|
||||||
for pol in tmp_list:
|
for pol in tmp_list:
|
||||||
pol_index = tmp_list2.index(pol)
|
pol_index = tmp_list2.index(pol)
|
||||||
print("=============================pol index: ", pol_index)
|
|
||||||
header_name = pol + " Concentration"
|
header_name = pol + " Concentration"
|
||||||
print("=============================Headers: ", self._headers[column])
|
#print(f"_lst({row}): {len(self._lst[row])}")
|
||||||
print("=============================Headers: ", header_name)
|
#print(f"longueur : {len(self._lst[row].get_ts_key(self._timestamp, 'pols')[pol_index])}")
|
||||||
if self._headers[column] == header_name:
|
if self._headers[column] == header_name:
|
||||||
print("=============================Headers: ", self._headers[column])
|
|
||||||
print("=============================Headers: ", header_name)
|
|
||||||
v = self._lst[row].get_ts_key(self._timestamp, "pols")[pol_index][0]
|
v = self._lst[row].get_ts_key(self._timestamp, "pols")[pol_index][0]
|
||||||
return f"{v:.4f}"
|
return f"{v:.4f}"
|
||||||
elif self._headers[column] == pol + " Mass":
|
elif self._headers[column] == pol + " Mass":
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,9 @@ class ResultsWindowAdisTS(PamhyrWindow):
|
||||||
print("setup table adists results")
|
print("setup table adists results")
|
||||||
|
|
||||||
self.setup_table()
|
self.setup_table()
|
||||||
|
print("///setup table correct")
|
||||||
self.setup_plots()
|
self.setup_plots()
|
||||||
|
print("///setup plots correct")
|
||||||
self.setup_slider()
|
self.setup_slider()
|
||||||
print("///setup slider correct")
|
print("///setup slider correct")
|
||||||
self.setup_statusbar()
|
self.setup_statusbar()
|
||||||
|
|
@ -143,6 +145,27 @@ class ResultsWindowAdisTS(PamhyrWindow):
|
||||||
)
|
)
|
||||||
|
|
||||||
def setup_slider(self):
|
def setup_slider(self):
|
||||||
|
default_reach = self._results.river.reach(0)
|
||||||
|
|
||||||
|
self._slider_time = self.find(QSlider, f"horizontalSlider_time")
|
||||||
|
self._slider_time.setMaximum(len(self._timestamps) - 1)
|
||||||
|
self._slider_time.setValue(len(self._timestamps) - 1)
|
||||||
|
|
||||||
|
self._icon_start = QIcon()
|
||||||
|
self._icon_start.addPixmap(
|
||||||
|
QPixmap(self._path_file("media-playback-start.png"))
|
||||||
|
)
|
||||||
|
|
||||||
|
self._icon_pause = QIcon()
|
||||||
|
self._icon_pause.addPixmap(
|
||||||
|
QPixmap(self._path_file("media-playback-pause.png"))
|
||||||
|
)
|
||||||
|
self._button_play = self.find(QPushButton, f"playButton")
|
||||||
|
self._button_play.setIcon(self._icon_start)
|
||||||
|
self._button_back = self.find(QPushButton, f"backButton")
|
||||||
|
self._button_next = self.find(QPushButton, f"nextButton")
|
||||||
|
self._button_first = self.find(QPushButton, f"firstButton")
|
||||||
|
self._button_last = self.find(QPushButton, f"lastButton")
|
||||||
self._timer = QTimer(self)
|
self._timer = QTimer(self)
|
||||||
|
|
||||||
def setup_plots(self):
|
def setup_plots(self):
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>1280</width>
|
<width>1097</width>
|
||||||
<height>720</height>
|
<height>720</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
|
@ -54,8 +54,78 @@
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="layoutWidget">
|
<widget class="QWidget" name="layoutWidget">
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<item row="1" column="0">
|
<item row="4" column="0">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2"/>
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="firstButton">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<normaloff>ressources/media-skip-backward.png</normaloff>ressources/media-skip-backward.png</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="backButton">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<normaloff>ressources/media-seek-backward.png</normaloff>ressources/media-seek-backward.png</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="playButton">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<normaloff>ressources/player_play.png</normaloff>
|
||||||
|
<normalon>ressources/player_pause.png</normalon>ressources/player_play.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="nextButton">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<normaloff>ressources/media-seek-forward.png</normaloff>ressources/media-seek-forward.png</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="lastButton">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<normaloff>ressources/media-skip-forward.png</normaloff>ressources/media-skip-forward.png</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSlider" name="horizontalSlider_time">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
|
|
@ -170,7 +240,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>1280</width>
|
<width>1097</width>
|
||||||
<height>22</height>
|
<height>22</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue