diff --git a/src/Solver/AdisTS.py b/src/Solver/AdisTS.py index 6f0a9be0c2c0281a67cd3de0a1f8f00531c54f66..bff284a9e8ba5d18b88827a21162bc43e60a49a4 100644 --- a/src/Solver/AdisTS.py +++ b/src/Solver/AdisTS.py @@ -521,13 +521,11 @@ class AdisTSlc(AdisTS): for k in range(0, ismax, kbl): 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) - print("pk : ", pk) data = np.fromfile(f, dtype=np.int32, count=1) # line length (bytes) (end) # fifth line (useless) data = np.fromfile(f, dtype=np.int32, count=1) # line length (bytes) (start) 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) # sixth line 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 data = np.fromfile(f, dtype=np.int32, count=1) # line length (bytes) (end) zf = [z[i * 3] for i in range(ismax)] - print("zf : ", zf) # seventh line (useless) for k in range(0, ismax, kbl): data = np.fromfile(f, dtype=np.int32, count=1) # line length (bytes) (start) 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) # end header @@ -648,17 +644,12 @@ class AdisTSlc(AdisTS): #print("isma") ###print("iprofiles: ", iprofiles) - pi_tmp = [] - reach_tmp = [] - - for i in range(ismax-1): + for i in range(ismax): #print("first i: ", i) reach = ip_to_r(i) - reach_tmp.append(reach) #print("reach i:", reach) #print("second i: ", i) p_i = ip_to_ri(reach, i) - pi_tmp.append(p_i) for t_data in timestamps_keys: pol_view = [] diff --git a/src/View/Results/TableAdisTS.py b/src/View/Results/TableAdisTS.py index 039956c045bd442e78644121dafa8ebba2029491..2a377410a01f0518c8af9e6ffca2f27cc8aaaa62 100644 --- a/src/View/Results/TableAdisTS.py +++ b/src/View/Results/TableAdisTS.py @@ -99,17 +99,12 @@ class TableModel(PamhyrTableModel): tmp_list = self._data.pollutants_list.copy() tmp_list.remove("total_sediment") 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: pol_index = tmp_list2.index(pol) - print("=============================pol index: ", pol_index) header_name = pol + " Concentration" - print("=============================Headers: ", self._headers[column]) - print("=============================Headers: ", header_name) + #print(f"_lst({row}): {len(self._lst[row])}") + #print(f"longueur : {len(self._lst[row].get_ts_key(self._timestamp, 'pols')[pol_index])}") 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] return f"{v:.4f}" elif self._headers[column] == pol + " Mass": diff --git a/src/View/Results/WindowAdisTS.py b/src/View/Results/WindowAdisTS.py index ae2c497f802d2f61078cc78a3ba8a8468bb43a53..9e614845ab24ad41753990c6ba6d1c25159e9c70 100644 --- a/src/View/Results/WindowAdisTS.py +++ b/src/View/Results/WindowAdisTS.py @@ -114,7 +114,9 @@ class ResultsWindowAdisTS(PamhyrWindow): print("setup table adists results") self.setup_table() + print("///setup table correct") self.setup_plots() + print("///setup plots correct") self.setup_slider() print("///setup slider correct") self.setup_statusbar() @@ -143,6 +145,27 @@ class ResultsWindowAdisTS(PamhyrWindow): ) 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) def setup_plots(self): diff --git a/src/View/ui/ResultsAdisTS.ui b/src/View/ui/ResultsAdisTS.ui index 8a9a8ad5330a20ef15466b1dd77f7e9880c0ec66..be9fa2103473c3a64d4636de8c38b253717eecbc 100644 --- a/src/View/ui/ResultsAdisTS.ui +++ b/src/View/ui/ResultsAdisTS.ui @@ -6,7 +6,7 @@ <rect> <x>0</x> <y>0</y> - <width>1280</width> + <width>1097</width> <height>720</height> </rect> </property> @@ -54,8 +54,78 @@ </widget> <widget class="QWidget" name="layoutWidget"> <layout class="QGridLayout" name="gridLayout_2"> - <item row="1" column="0"> - <layout class="QHBoxLayout" name="horizontalLayout_2"/> + <item row="4" column="0"> + <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 row="0" column="0"> <widget class="QTabWidget" name="tabWidget"> @@ -170,7 +240,7 @@ <rect> <x>0</x> <y>0</y> - <width>1280</width> + <width>1097</width> <height>22</height> </rect> </property>