mirror of https://gitlab.com/pamhyr/pamhyr2
Merge remote-tracking branch 'origin/master' into scenarios
commit
73eb9919eb
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in New Issue