mirror of https://gitlab.com/pamhyr/pamhyr2
Ensemble: Draw ensemble scenario as rect and minor fix.
parent
e64c45b621
commit
3b83377f3c
|
|
@ -78,7 +78,7 @@ class Scenario(SQLSubModel):
|
||||||
self._x, self._y = x, y
|
self._x, self._y = x, y
|
||||||
self._name = name
|
self._name = name
|
||||||
self._description = description
|
self._description = description
|
||||||
self._is_ensemble = False
|
self._is_ensemble = is_ensemble
|
||||||
self._revision = revision
|
self._revision = revision
|
||||||
self._parent = parent
|
self._parent = parent
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -682,7 +682,7 @@ class Study(SQLModel):
|
||||||
|
|
||||||
new.name = self.status.scenario.name + " (ensemble)"
|
new.name = self.status.scenario.name + " (ensemble)"
|
||||||
new.set_pos(self.status.scenario.x + 100,
|
new.set_pos(self.status.scenario.x + 100,
|
||||||
self.status.scenario.y + 100)
|
self.status.scenario.y)
|
||||||
|
|
||||||
if switch:
|
if switch:
|
||||||
self.status.scenario = new
|
self.status.scenario = new
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,7 @@ class ScenarioMenu(AbstractMenu):
|
||||||
self._trad["menu_dup_scenario"]
|
self._trad["menu_dup_scenario"]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not item.scenario.is_ensemble():
|
||||||
if item.scenario.id == current_scenario:
|
if item.scenario.id == current_scenario:
|
||||||
ensemble = self._menu.addAction(
|
ensemble = self._menu.addAction(
|
||||||
self._trad["menu_ens_scenario"]
|
self._trad["menu_ens_scenario"]
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,10 @@ class ScenarioItem(QGraphicsTextItem):
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
painter.setBrush(QBrush(color))
|
painter.setBrush(QBrush(color))
|
||||||
|
|
||||||
|
if self.scenario.is_ensemble():
|
||||||
|
painter.drawRect(self.boundingRect())
|
||||||
|
else:
|
||||||
painter.drawEllipse(self.boundingRect())
|
painter.drawEllipse(self.boundingRect())
|
||||||
|
|
||||||
super(ScenarioItem, self).paint(painter, option, widget)
|
super(ScenarioItem, self).paint(painter, option, widget)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue