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 ...@@ -6,9 +6,7 @@ from tools import trace, timer
from Model.Except import NotImplementedMethodeError from Model.Except import NotImplementedMethodeError
from Model.LateralContribution.LateralContributionTypes import ( from Model.LateralContribution.LateralContributionTypes import (
NotDefined, NotDefined, LateralContrib, Rain, Evaporation,
PonctualContribution,
TimeOverZ, TimeOverDebit, ZOverDebit
) )
class LateralContributionList(object): class LateralContributionList(object):
......
...@@ -16,54 +16,38 @@ class NotDefined(LateralContribution): ...@@ -16,54 +16,38 @@ class NotDefined(LateralContribution):
def _default_0(self): def _default_0(self):
return 0.0 return 0.0
class PonctualContribution(LateralContribution): class LateralContrib(LateralContribution):
def __init__(self, name:str = ""): 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._header = ["time", "debit"]
self._types = [PonctualContribution.time_convert, float] self._types = [LateralContrib.time_convert, float]
@classmethod @classmethod
def compatibility(cls): def compatibility(cls):
return ["liquid"] return ["liquid"]
class TimeOverZ(LateralContribution): class Rain(LateralContribution):
def __init__(self, name:str = ""): def __init__(self, name:str = ""):
super(TimeOverZ, self).__init__(name=name) super(Rain, self).__init__(name=name)
self._type = "TZ" self._type = "RA"
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._header = ["time", "debit"] self._header = ["time", "debit"]
self._types = [TimeOverDebit.time_convert, float] self._types = [Rain.time_convert, float]
@classmethod @classmethod
def compatibility(cls): def compatibility(cls):
return ["liquid"] return ["liquid"]
class ZOverDebit(LateralContribution): class Evaporation(LateralContribution):
def __init__(self, name:str = ""): def __init__(self, name:str = ""):
super(ZOverDebit, self).__init__(name=name) super(Evaporation, self).__init__(name=name)
self._type = "ZD" self._type = "EV"
self._header = ["z", "debit"] self._header = ["time", "debit"]
self._types = [float, float] self._types = [Evaporation.time_convert, float]
@classmethod @classmethod
def compatibility(cls): def compatibility(cls):
return ["liquid"] return ["liquid"]
@property
def _default_0(self):
return 0.0
...@@ -19,8 +19,7 @@ from PyQt5.QtWidgets import ( ...@@ -19,8 +19,7 @@ from PyQt5.QtWidgets import (
) )
from Model.LateralContribution.LateralContributionTypes import ( from Model.LateralContribution.LateralContributionTypes import (
NotDefined, PonctualContribution, NotDefined, LateralContrib, Rain, Evaporation,
TimeOverZ, TimeOverDebit, ZOverDebit
) )
from View.LateralContribution.Edit.UndoCommand import ( from View.LateralContribution.Edit.UndoCommand import (
......
...@@ -22,8 +22,7 @@ from View.LateralContribution.UndoCommand import ( ...@@ -22,8 +22,7 @@ from View.LateralContribution.UndoCommand import (
) )
from Model.LateralContribution.LateralContributionTypes import ( from Model.LateralContribution.LateralContributionTypes import (
NotDefined, PonctualContribution, NotDefined, LateralContrib, Rain, Evaporation,
TimeOverZ, TimeOverDebit, ZOverDebit
) )
from View.LateralContribution.translate import * from View.LateralContribution.translate import *
......
...@@ -29,8 +29,7 @@ from View.LateralContribution.UndoCommand import ( ...@@ -29,8 +29,7 @@ from View.LateralContribution.UndoCommand import (
) )
from Model.LateralContribution.LateralContributionTypes import ( from Model.LateralContribution.LateralContributionTypes import (
NotDefined, PonctualContribution, NotDefined, LateralContrib, Rain, Evaporation,
TimeOverZ, TimeOverDebit, ZOverDebit
) )
from View.LateralContribution.Table import ( from View.LateralContribution.Table import (
......
...@@ -3,18 +3,16 @@ ...@@ -3,18 +3,16 @@
from PyQt5.QtCore import QCoreApplication from PyQt5.QtCore import QCoreApplication
from Model.LateralContribution.LateralContributionTypes import ( from Model.LateralContribution.LateralContributionTypes import (
NotDefined, PonctualContribution, NotDefined, LateralContrib, Rain, Evaporation,
TimeOverZ, TimeOverDebit, ZOverDebit
) )
_translate = QCoreApplication.translate _translate = QCoreApplication.translate
long_types = { long_types = {
"ND": _translate("LateralContribution", "Not defined"), "ND": _translate("LateralContribution", "Not defined"),
"PC": _translate("LateralContribution", "Ponctual contribution"), "LC": _translate("LateralContribution", "Lateral contribution"),
"TZ": _translate("LateralContribution", "Time over Z"), "RA": _translate("LateralContribution", "Rain"),
"TD": _translate("LateralContribution", "Time over Debit"), "EV": _translate("LateralContribution", "Evaporation"),
"ZD": _translate("LateralContribution", "Z over Debit"),
} }
table_headers = { table_headers = {
...@@ -25,8 +23,7 @@ table_headers = { ...@@ -25,8 +23,7 @@ table_headers = {
LC_types = { LC_types = {
"ND": NotDefined, "ND": NotDefined,
"PC": PonctualContribution, "LC": LateralContrib,
"TZ": TimeOverZ, "RA": Rain,
"TD": TimeOverDebit, "EV": Evaporation,
"ZD": ZOverDebit
} }
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