debug frictions

master
Theophile Terraz 2025-09-19 16:03:23 +02:00
parent fce034419d
commit ba8a50e0b9
1 changed files with 15 additions and 9 deletions

View File

@ -151,6 +151,7 @@ class ReplaceDataCommand(QUndoCommand):
self._new_data = new_data
self._old_rows = list(range(len(frictions)))
self._new_rows = list(range(len(new_data)))
self._new = []
self._old_friction = []
for row in self._old_rows:
@ -162,6 +163,7 @@ class ReplaceDataCommand(QUndoCommand):
self._frictions.insert(row, el)
def redo(self):
if len(self._new) == 0:
self._frictions.delete_i(self._old_rows)
for row in self._new_rows:
new = self._frictions.new(row)
@ -171,6 +173,10 @@ class ReplaceDataCommand(QUndoCommand):
new.end_rk = d[2]
new.begin_strickler = d[3]
new.end_strickler = d[4]
self._new.append((row, new))
else:
for row, el in self._new:
self._frictions.insert(row, el)
class DelCommand(QUndoCommand):