mirror of https://gitlab.com/pamhyr/pamhyr2
IC: Fix row display.
parent
74b914001b
commit
5a900578c8
|
|
@ -5,7 +5,7 @@ from tools import trace, timer
|
||||||
|
|
||||||
class Data(object):
|
class Data(object):
|
||||||
def __init__(self, status = None):
|
def __init__(self, status = None):
|
||||||
super(Data, self).__init()
|
super(Data, self).__init__()
|
||||||
|
|
||||||
self._status = status
|
self._status = status
|
||||||
|
|
||||||
|
|
@ -17,7 +17,7 @@ class Data(object):
|
||||||
self._cote = 0.0
|
self._cote = 0.0
|
||||||
self._tiran = 0.0
|
self._tiran = 0.0
|
||||||
|
|
||||||
def __getitems__(self, key):
|
def __getitem__(self, key):
|
||||||
val = None
|
val = None
|
||||||
|
|
||||||
if key == "name":
|
if key == "name":
|
||||||
|
|
@ -35,7 +35,7 @@ class Data(object):
|
||||||
|
|
||||||
return val
|
return val
|
||||||
|
|
||||||
def __setitems__(self, key, value):
|
def __setitem__(self, key, value):
|
||||||
if key == "name":
|
if key == "name":
|
||||||
self._name = str(value)
|
self._name = str(value)
|
||||||
elif key == "comment":
|
elif key == "comment":
|
||||||
|
|
|
||||||
|
|
@ -34,3 +34,4 @@ class InitialConditionsDict(object):
|
||||||
def new(self, reach):
|
def new(self, reach):
|
||||||
new = InitialConditions(reach = reach, status = self._status)
|
new = InitialConditions(reach = reach, status = self._status)
|
||||||
self.set(reach, new)
|
self.set(reach, new)
|
||||||
|
return new
|
||||||
|
|
|
||||||
|
|
@ -16,14 +16,15 @@ class SetCommand(QUndoCommand):
|
||||||
|
|
||||||
self._ics = ics
|
self._ics = ics
|
||||||
self._row = row
|
self._row = row
|
||||||
|
self._column = column
|
||||||
self._old = self._ics.get(self._row)[column]
|
self._old = self._ics.get(self._row)[column]
|
||||||
self._new = new_value
|
self._new = new_value
|
||||||
|
|
||||||
def undo(self):
|
def undo(self):
|
||||||
self._ics.get(self._row)[column] = self._old
|
self._ics.get(self._row)[self._column] = self._old
|
||||||
|
|
||||||
def redo(self):
|
def redo(self):
|
||||||
self._ics.get(self._row)[column] = self._new
|
self._ics.get(self._row)[self._column] = self._new
|
||||||
|
|
||||||
class AddCommand(QUndoCommand):
|
class AddCommand(QUndoCommand):
|
||||||
def __init__(self, ics, index):
|
def __init__(self, ics, index):
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,7 @@ class InitialConditionsWindow(ASubMainWindow, ListedSubWindow):
|
||||||
|
|
||||||
def add(self):
|
def add(self):
|
||||||
rows = self.index_selected_rows()
|
rows = self.index_selected_rows()
|
||||||
if self._ics.len(tab) == 0 or len(rows) == 0:
|
if len(self._ics) == 0 or len(rows) == 0:
|
||||||
self._table.add(0)
|
self._table.add(0)
|
||||||
else:
|
else:
|
||||||
self._table.add(rows[0])
|
self._table.add(rows[0])
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue