mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Import INI files: handle INI RK matching and refresh table after import
This commit is contained in:
1 parent
e19eeedcc3
commit
3458a5df9f
2 files changed
+27
-21
No files matched your search
@@ -290,8 +290,6 @@ class InitialConditionTableModel(PamhyrTableModel):
|
||||
logger.error("No results data")
|
||||
return
|
||||
|
||||
self.layoutAboutToBeChanged.emit()
|
||||
|
||||
ts = max(results.get("timestamps"))
|
||||
res_reach = results.river.get_reach_by_geometry(
|
||||
self._reach.reach
|
||||
@@ -307,19 +305,15 @@ class InitialConditionTableModel(PamhyrTableModel):
|
||||
)
|
||||
)
|
||||
|
||||
self._undo.push(
|
||||
ReplaceDataCommand(
|
||||
self._lst,
|
||||
list(
|
||||
map(
|
||||
lambda d: self._lst.new_from_data(*d),
|
||||
data
|
||||
)
|
||||
)
|
||||
new_data = list(
|
||||
map(
|
||||
lambda d: self._lst.new_from_data(*d),
|
||||
data
|
||||
)
|
||||
)
|
||||
|
||||
self.layoutAboutToBeChanged.emit()
|
||||
self._undo.push(ReplaceDataCommand(self._lst, new_data))
|
||||
self.layoutChanged.emit()
|
||||
|
||||
def read_from_ini(self, file_name):
|
||||
@@ -355,18 +349,17 @@ class InitialConditionTableModel(PamhyrTableModel):
|
||||
line_split[2],
|
||||
line_split[3]])
|
||||
|
||||
self._undo.push(
|
||||
ReplaceDataCommand(
|
||||
self._lst,
|
||||
list(
|
||||
map(
|
||||
lambda d: self._lst.new_from_data(*d),
|
||||
data
|
||||
)
|
||||
)
|
||||
new_data = list(
|
||||
map(
|
||||
lambda d: self._lst.new_from_data(*d),
|
||||
data
|
||||
)
|
||||
)
|
||||
|
||||
self.layoutAboutToBeChanged.emit()
|
||||
self._undo.push(ReplaceDataCommand(self._lst, new_data))
|
||||
self.layoutChanged.emit()
|
||||
|
||||
def undo(self):
|
||||
self._undo.undo()
|
||||
self.layoutChanged.emit()
|
||||
|
||||
Reference in new issue
Block a user