mirror of https://gitlab.com/pamhyr/pamhyr2
debug frictions
parent
fce034419d
commit
ba8a50e0b9
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Reference in New Issue