Compare commits

...

3 Commits

Author SHA1 Message Date
Dylan Jeannin 084c22836b debug undo after deletion of BCA 2026-05-12 13:48:14 +02:00
Dylan Jeannin 726b81bf12 debug undo after add LateralContributionAdisTS 2026-05-12 08:40:35 +02:00
Dylan Jeannin 7c3de520d9 delete old references to pollutants in BoundaryConditionsAdisTS window 2026-05-12 08:39:58 +02:00
4 changed files with 5 additions and 21 deletions

View File

@ -548,11 +548,11 @@ class BoundaryConditionAdisTS(SQLSubModel):
self.modified() self.modified()
def delete_i(self, indexes): def delete_i(self, indexes):
self._data = list( list(
map( map(
lambda e: e[1].set_as_deleted(), lambda e: e[1].set_as_deleted(),
filter( filter(
lambda e: e[0] not in indexes, lambda e: e[0] in indexes,
enumerate(self.data) enumerate(self.data)
) )
) )

View File

@ -43,7 +43,7 @@ from View.Tools.PamhyrTable import PamhyrTableModel
from View.BoundaryConditionsAdisTS.UndoCommand import ( from View.BoundaryConditionsAdisTS.UndoCommand import (
SetNodeCommand, SetTypeCommand, SetNodeCommand, SetTypeCommand,
AddCommand, DelCommand, SetPolCommand AddCommand, DelCommand
) )
from View.BoundaryCondition.translate import BC_types from View.BoundaryCondition.translate import BC_types

View File

@ -62,22 +62,6 @@ class SetTypeCommand(QUndoCommand):
self._bcs.get(self._index).type = self._new self._bcs.get(self._index).type = self._new
class SetPolCommand(QUndoCommand):
def __init__(self, bcs, index, pollutant):
QUndoCommand.__init__(self)
self._bcs = bcs
self._index = index
self._old = self._bcs.get(self._index).pollutant
self._new = pollutant
def undo(self):
self._bcs.get(self._index).pollutant = self._old
def redo(self):
self._bcs.get(self._index).pollutant = self._new
class AddCommand(QUndoCommand): class AddCommand(QUndoCommand):
def __init__(self, pollutant, bcs, index): def __init__(self, pollutant, bcs, index):
QUndoCommand.__init__(self) QUndoCommand.__init__(self)
@ -106,7 +90,7 @@ class DelCommand(QUndoCommand):
self._bc = [] self._bc = []
for row in rows: for row in rows:
self._bc.append((row, self._bcs.get(row))) self._bc.append((row, self._bcs._lst[row]))
self._bc.sort() self._bc.sort()
def undo(self): def undo(self):

View File

@ -91,7 +91,7 @@ class AddCommand(QUndoCommand):
self._new = None self._new = None
def undo(self): def undo(self):
self._lcs.delete_i(self._index) self._lcs.delete_i([self._index])
def redo(self): def redo(self):
if self._new is None: if self._new is None: