diff --git a/src/Meshing/Internal.py b/src/Meshing/Internal.py index 5aa62063..d30b2309 100644 --- a/src/Meshing/Internal.py +++ b/src/Meshing/Internal.py @@ -192,6 +192,7 @@ class InternalMeshing(AMeshingTool): sect2.point(start2).name = '' if tag2 == '': # left end point sect2.point(start2+1).name = '' + len2 += 1 elif ltot1 < 0.0001: sect2.add_npoints(len1-len2) len2 = len1 diff --git a/src/View/InitialConditions/Table.py b/src/View/InitialConditions/Table.py index 1f4ace72..e3aad3cc 100644 --- a/src/View/InitialConditions/Table.py +++ b/src/View/InitialConditions/Table.py @@ -330,9 +330,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( diff --git a/src/View/InitialConditions/Window.py b/src/View/InitialConditions/Window.py index 93e06d46..c3ff5394 100644 --- a/src/View/InitialConditions/Window.py +++ b/src/View/InitialConditions/Window.py @@ -224,6 +224,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: @@ -320,10 +322,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()