diff --git a/src/View/Frictions/Table.py b/src/View/Frictions/Table.py index 9ba17e3a..64a3e18f 100644 --- a/src/View/Frictions/Table.py +++ b/src/View/Frictions/Table.py @@ -278,7 +278,6 @@ class FrictionTableModel(PamhyrTableModel): if int(line[1]) == reach_id: data.append(line[1:]) - print(data) new_data = [] for d in data: new = None diff --git a/src/View/Frictions/UndoCommand.py b/src/View/Frictions/UndoCommand.py index 4fc0637d..14d6395b 100644 --- a/src/View/Frictions/UndoCommand.py +++ b/src/View/Frictions/UndoCommand.py @@ -156,17 +156,6 @@ class ReplaceDataCommand(QUndoCommand): for row in self._old_rows: self._old_friction.append((row, self._frictions.lst[row])) - self._new_friction = [] - for row in self._new_rows: - new = Friction(status=self._frictions._status) - d = new_data[row] - new.edge = d[0] - new.begin_rk = d[1] - new.end_rk = d[2] - new.begin_strickler = d[3] - new.end_strickler = d[4] - self._new_friction.append((row, new)) - def undo(self): self._frictions.delete_i(self._new_rows) for row, el in self._old_friction: @@ -174,8 +163,14 @@ class ReplaceDataCommand(QUndoCommand): def redo(self): self._frictions.delete_i(self._old_rows) - for row, el in self._new_friction: - self._frictions.insert(row, el) + for row in self._new_rows: + new = self._frictions.new(row) + d = self._new_data[row] + new.edge = d[0] + new.begin_rk = d[1] + new.end_rk = d[2] + new.begin_strickler = d[3] + new.end_strickler = d[4] class DelCommand(QUndoCommand):