diff --git a/src/View/BoundaryCondition/Edit/Table.py b/src/View/BoundaryCondition/Edit/Table.py index e50308fc..313abb89 100644 --- a/src/View/BoundaryCondition/Edit/Table.py +++ b/src/View/BoundaryCondition/Edit/Table.py @@ -227,7 +227,10 @@ class TableModel(PamhyrTableModel): line.startswith("*") or line.startswith("$")): line = line.split() - data0.append(float(line[0]) * mult) + if bctype == "ZD": + data0.append(float(line[0])) + else: + data0.append(old_pamhyr_date_to_timestamp(line[0])) data1.append(line[1]) self.replace_data(data0, data1) diff --git a/src/View/LateralContribution/Table.py b/src/View/LateralContribution/Table.py index 5bee4de8..9e69dddd 100644 --- a/src/View/LateralContribution/Table.py +++ b/src/View/LateralContribution/Table.py @@ -19,7 +19,7 @@ import logging import traceback -from tools import trace, timer +from tools import trace, timer, old_pamhyr_date_to_timestamp from PyQt5.QtCore import ( Qt, QVariant, QAbstractTableModel, @@ -310,12 +310,17 @@ class TableModel(PamhyrTableModel): if line[0] == "$": current_reach = int(line[1]) - 1 if (current_reach <= len(self._data.enable_edges()) and - current_reach > 0) : + current_reach >= 0) : data.append([self._data.enable_edges()[current_reach], float(line[2]), float(line[3])]) else: if (current_reach <= len(self._data.enable_edges()) and - current_reach > 0) : - data[-1].append([float(line[0]), float(line[1])]) + current_reach >= 0) : + data[-1].append( + [ + old_pamhyr_date_to_timestamp(line[0]), + float(line[1]) + ] + ) self.layoutAboutToBeChanged.emit() diff --git a/src/tools.py b/src/tools.py index 8c14e267..553cc1fb 100644 --- a/src/tools.py +++ b/src/tools.py @@ -260,7 +260,10 @@ def date_dmy_to_timestamp(date: str): def old_pamhyr_date_to_timestamp(date: str): v = date.split(":") if len(v) != 4: - return 0 + if len(v) == 1: # minutes + return int(float(v[0]) * 60) # Minute to sec + else: + return 0 m = [ (24 * 60 * 60), # Day to sec