mirror of https://gitlab.com/pamhyr/pamhyr2
debug old .INI file read
parent
a29df8f904
commit
a31e2127e7
|
|
@ -292,9 +292,27 @@ class InitialConditionTableModel(PamhyrTableModel):
|
|||
if not (line.startswith("#") or
|
||||
line.startswith("*") or
|
||||
line.startswith("$")):
|
||||
line = line.split()
|
||||
if int(line[0]) == reach_id:
|
||||
data.append([line[4], line[2], line[3]])
|
||||
line_split = line.split()
|
||||
formated = False
|
||||
if len(line_split[0]) > 3:
|
||||
formated = True
|
||||
elif len(line_split[2]) > 10:
|
||||
formated = True
|
||||
elif len(line_split[3]) > 11:
|
||||
formated = True
|
||||
elif len(line_split[4]) > 9:
|
||||
formated = True
|
||||
|
||||
if formated: # old PamHyr format
|
||||
if int(line[1:4]) == reach_id:
|
||||
data.append([line[31:40],
|
||||
line[10:20],
|
||||
line[20:31]])
|
||||
else:
|
||||
if int(line_split[0]) == reach_id:
|
||||
data.append([line_split[4],
|
||||
line_split[2],
|
||||
line_split[3]])
|
||||
|
||||
self._undo.push(
|
||||
ReplaceDataCommand(
|
||||
|
|
|
|||
|
|
@ -220,6 +220,8 @@ class InitialConditionsWindow(PamhyrWindow):
|
|||
def _update_plot(self):
|
||||
self.plot_1.draw()
|
||||
self.plot_2.draw()
|
||||
self.plot_1.idle()
|
||||
self.plot_2.idle()
|
||||
|
||||
def _propagated_update(self, key=Modules(0)):
|
||||
if Modules.GEOMETRY not in key:
|
||||
|
|
@ -315,10 +317,12 @@ class InitialConditionsWindow(PamhyrWindow):
|
|||
def _import_from_results(self, results):
|
||||
logger.debug(f"import from results: {results}")
|
||||
self._table.import_from_results(results)
|
||||
self._update()
|
||||
|
||||
def _import_from_ini_file(self, file_name):
|
||||
logger.debug(f"import from INI file: {file_name}")
|
||||
self._table.read_from_ini(file_name)
|
||||
self._update()
|
||||
|
||||
def move_up(self):
|
||||
row = self.index_selected_row()
|
||||
|
|
|
|||
Loading…
Reference in New Issue