Commit b786bb44 authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

LC: Add specific Lateral contribution types.

Showing with 24 additions and 48 deletions
+24 -48
......@@ -6,9 +6,7 @@ from tools import trace, timer
from Model.Except import NotImplementedMethodeError
from Model.LateralContribution.LateralContributionTypes import (
NotDefined,
PonctualContribution,
TimeOverZ, TimeOverDebit, ZOverDebit
NotDefined, LateralContrib, Rain, Evaporation,
)
class LateralContributionList(object):
......
......@@ -16,54 +16,38 @@ class NotDefined(LateralContribution):
def _default_0(self):
return 0.0
class PonctualContribution(LateralContribution):
class LateralContrib(LateralContribution):
def __init__(self, name:str = ""):
super(PonctualContribution, self).__init__(name=name)
super(LateralContrib, self).__init__(name=name)
self._type = "PC"
self._type = "LC"
self._header = ["time", "debit"]
self._types = [PonctualContribution.time_convert, float]
self._types = [LateralContrib.time_convert, float]
@classmethod
def compatibility(cls):
return ["liquid"]
class TimeOverZ(LateralContribution):
class Rain(LateralContribution):
def __init__(self, name:str = ""):
super(TimeOverZ, self).__init__(name=name)
super(Rain, self).__init__(name=name)
self._type = "TZ"
self._header = ["time", "z"]
self._types = [TimeOverZ.time_convert, float]
@classmethod
def compatibility(cls):
return ["liquid"]
class TimeOverDebit(LateralContribution):
def __init__(self, name:str = ""):
super(TimeOverDebit, self).__init__(name=name)
self._type = "TD"
self._type = "RA"
self._header = ["time", "debit"]
self._types = [TimeOverDebit.time_convert, float]
self._types = [Rain.time_convert, float]
@classmethod
def compatibility(cls):
return ["liquid"]
class ZOverDebit(LateralContribution):
class Evaporation(LateralContribution):
def __init__(self, name:str = ""):
super(ZOverDebit, self).__init__(name=name)
super(Evaporation, self).__init__(name=name)
self._type = "ZD"
self._header = ["z", "debit"]
self._types = [float, float]
self._type = "EV"
self._header = ["time", "debit"]
self._types = [Evaporation.time_convert, float]
@classmethod
def compatibility(cls):
return ["liquid"]
@property
def _default_0(self):
return 0.0
......@@ -19,8 +19,7 @@ from PyQt5.QtWidgets import (
)
from Model.LateralContribution.LateralContributionTypes import (
NotDefined, PonctualContribution,
TimeOverZ, TimeOverDebit, ZOverDebit
NotDefined, LateralContrib, Rain, Evaporation,
)
from View.LateralContribution.Edit.UndoCommand import (
......
......@@ -22,8 +22,7 @@ from View.LateralContribution.UndoCommand import (
)
from Model.LateralContribution.LateralContributionTypes import (
NotDefined, PonctualContribution,
TimeOverZ, TimeOverDebit, ZOverDebit
NotDefined, LateralContrib, Rain, Evaporation,
)
from View.LateralContribution.translate import *
......
......@@ -29,8 +29,7 @@ from View.LateralContribution.UndoCommand import (
)
from Model.LateralContribution.LateralContributionTypes import (
NotDefined, PonctualContribution,
TimeOverZ, TimeOverDebit, ZOverDebit
NotDefined, LateralContrib, Rain, Evaporation,
)
from View.LateralContribution.Table import (
......
......@@ -3,18 +3,16 @@
from PyQt5.QtCore import QCoreApplication
from Model.LateralContribution.LateralContributionTypes import (
NotDefined, PonctualContribution,
TimeOverZ, TimeOverDebit, ZOverDebit
NotDefined, LateralContrib, Rain, Evaporation,
)
_translate = QCoreApplication.translate
long_types = {
"ND": _translate("LateralContribution", "Not defined"),
"PC": _translate("LateralContribution", "Ponctual contribution"),
"TZ": _translate("LateralContribution", "Time over Z"),
"TD": _translate("LateralContribution", "Time over Debit"),
"ZD": _translate("LateralContribution", "Z over Debit"),
"LC": _translate("LateralContribution", "Lateral contribution"),
"RA": _translate("LateralContribution", "Rain"),
"EV": _translate("LateralContribution", "Evaporation"),
}
table_headers = {
......@@ -25,8 +23,7 @@ table_headers = {
LC_types = {
"ND": NotDefined,
"PC": PonctualContribution,
"TZ": TimeOverZ,
"TD": TimeOverDebit,
"ZD": ZOverDebit
"LC": LateralContrib,
"RA": Rain,
"EV": Evaporation,
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment