diff --git a/src/Model/BoundaryCondition/BoundaryCondition.py b/src/Model/BoundaryCondition/BoundaryCondition.py
new file mode 100644
index 00000000..806bceeb
--- /dev/null
+++ b/src/Model/BoundaryCondition/BoundaryCondition.py
@@ -0,0 +1,38 @@
+# -*- coding: utf-8 -*-
+
+from Model.Except import NotImplementedMethodeError
+
+class BoundaryCondition(object):
+ def __init__(self, name:str = ""):
+ super(BoundaryCondition, self).__init__()
+
+ self._name = name
+ self._type = ""
+ self._node = None
+ self._data = None
+
+ @property
+ def name(self):
+ return self._name
+
+ @name.setter
+ def name(self, name):
+ self._name = name
+
+ @property
+ def bctype(self):
+ return self._type
+
+ @property
+ def node(self):
+ return self._node
+
+ @node.setter
+ def node(self, node):
+ self._node = node
+
+ def has_node(self):
+ return self._node is not None
+
+ def is_define(self):
+ return self._data is not None
diff --git a/src/Model/River.py b/src/Model/River.py
index a386cbae..daaf0afb 100644
--- a/src/Model/River.py
+++ b/src/Model/River.py
@@ -7,6 +7,8 @@ from Model.Network.Graph import Graph
from Model.Geometry.Profile import Profile
from Model.Geometry.Reach import Reach
+from Model.BoundaryCondition.BoundaryCondition import BoundaryCondition
+
class RiverNode(Node):
def __init__(self, id:str, name:str,
x:float, y:float):
@@ -51,6 +53,7 @@ class River(Graph):
self._edge_ctor = RiverReach
self._current_reach = None
+ self._boundary_condition = []
def has_current_reach(self):
return self._current_reach is not None
diff --git a/src/View/BoundaryCondition/BoundaryConditionWindow.py b/src/View/BoundaryCondition/BoundaryConditionWindow.py
new file mode 100644
index 00000000..13f3f288
--- /dev/null
+++ b/src/View/BoundaryCondition/BoundaryConditionWindow.py
@@ -0,0 +1,29 @@
+# -*- coding: utf-8 -*-
+
+from View.ASubWindow import ASubMainWindow
+from View.ListedSubWindow import ListedSubWindow
+
+from PyQt5.QtCore import (
+ Qt, QVariant, QAbstractTableModel,
+)
+
+from PyQt5.QtWidgets import (
+ QDialogButtonBox, QPushButton, QLineEdit,
+ QFileDialog, QTableView, QAbstractItemView,
+)
+
+from View.BoundaryCondition.EditBoundaryConditionWindow import EditBoundaryConditionWindow
+
+class BoundaryConditionWindow(ASubMainWindow, ListedSubWindow):
+ def __init__(self, title="BoundaryConditions", study=None, parent=None):
+ super(BoundaryConditionWindow, self).__init__(
+ name=title, ui="BoundaryConditions", parent=parent
+ )
+
+ self._study = study
+
+ self.ui.setWindowTitle(title)
+
+ def edit(self):
+ win = EditBoundaryConditionWindow(data=None, parent=self)
+ win.show()
diff --git a/src/View/BoundaryCondition/EditBoundaryConditionWindow.py b/src/View/BoundaryCondition/EditBoundaryConditionWindow.py
new file mode 100644
index 00000000..c3943440
--- /dev/null
+++ b/src/View/BoundaryCondition/EditBoundaryConditionWindow.py
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+
+from View.ASubWindow import ASubMainWindow
+from View.ListedSubWindow import ListedSubWindow
+
+from PyQt5.QtCore import (
+ Qt, QVariant, QAbstractTableModel,
+)
+
+from PyQt5.QtWidgets import (
+ QDialogButtonBox, QPushButton, QLineEdit,
+ QFileDialog, QTableView, QAbstractItemView,
+)
+
+
+class EditBoundaryConditionWindow(ASubMainWindow, ListedSubWindow):
+ def __init__(self, title="Edit BoundaryConditions", data=None, parent=None):
+ super(EditBoundaryConditionWindow, self).__init__(
+ name=title, ui="EditBoundaryConditions", parent=parent
+ )
+
+ self._data = data
+
+ self.ui.setWindowTitle(title)
diff --git a/src/View/MainWindow.py b/src/View/MainWindow.py
index bf8f80d5..a37a6a9e 100644
--- a/src/View/MainWindow.py
+++ b/src/View/MainWindow.py
@@ -22,6 +22,7 @@ from View.Main.NewStudyWindow import NewStudyWindow
from View.Main.AboutWindow import AboutWindow
from View.Network.NetworkWindow import NetworkWindow
from View.Geometry.GeometryWindow import GeometryWindow
+from View.BoundaryCondition.BoundaryConditionWindow import BoundaryConditionWindow
from Model.Study import Study
@@ -114,7 +115,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
"action_toolBar_geometry": self.open_geometry,
"action_toolBar_mesh": lambda: self.open_dummy("Mesh"),
"action_toolBar_run_meshing_tool": lambda: self.open_dummy("Lancement mailleur externe"),
- "action_toolBar_boundary_cond": lambda: self.open_dummy("Condition Limites"),
+ "action_toolBar_boundary_cond": self.open_boundary_cond,
"action_toolBar_lateral_contrib": lambda: self.open_dummy("Apport Lateraux"),
"action_toolBar_spills": lambda: self.open_dummy("Deversement"),
"action_toolBar_sections": lambda: self.open_dummy("Tronçons"),
@@ -315,6 +316,11 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
"Geometry edition need a reach selected "
"into river network window to work on it")
+ def open_boundary_cond(self):
+ self.bound = BoundaryConditionWindow(study = self.model, parent=self)
+ self.bound.show()
+
+
# TODO: Delete me !
###############
# DUMMY STUFF #
diff --git a/src/View/ui/BoundaryConditions.ui b/src/View/ui/BoundaryConditions.ui
new file mode 100644
index 00000000..8a0f8f96
--- /dev/null
+++ b/src/View/ui/BoundaryConditions.ui
@@ -0,0 +1,134 @@
+
+
+ MainWindow
+
+
+
+ 0
+ 0
+ 800
+ 450
+
+
+
+
+ 0
+ 0
+
+
+
+ MainWindow
+
+
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Qt::Horizontal
+
+
+
+
+
+
+
+
+
+
+
+
+ toolBar
+
+
+ TopToolBarArea
+
+
+ false
+
+
+
+
+
+
+
+
+ false
+
+
+
+ ressources/gtk-add.pngressources/gtk-add.png
+
+
+ Add
+
+
+ Add a new boundary condition or lateral contribution
+
+
+ Ctrl+N
+
+
+
+
+
+ ressources/gtk-remove.pngressources/gtk-remove.png
+
+
+ Delete
+
+
+ Delete current selected rows
+
+
+ Ctrl+D
+
+
+
+
+
+ ressources/edit.pngressources/edit.png
+
+
+ Edit
+
+
+ Edit boundary condition or lateral contribution
+
+
+ Ctrl+E
+
+
+
+
+
+ ressources/gtk-sort-ascending.pngressources/gtk-sort-ascending.png
+
+
+ Sort
+
+
+ Sort boundary condition by name
+
+
+
+
+
+
diff --git a/src/View/ui/EditBoundaryConditions.ui b/src/View/ui/EditBoundaryConditions.ui
new file mode 100644
index 00000000..6a36a552
--- /dev/null
+++ b/src/View/ui/EditBoundaryConditions.ui
@@ -0,0 +1,118 @@
+
+
+ MainWindow
+
+
+
+ 0
+ 0
+ 800
+ 450
+
+
+
+
+ 0
+ 0
+
+
+
+ MainWindow
+
+
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Qt::Horizontal
+
+
+
+
+
+
+
+
+
+
+
+
+ toolBar
+
+
+ TopToolBarArea
+
+
+ false
+
+
+
+
+
+
+
+ false
+
+
+
+ ressources/gtk-add.pngressources/gtk-add.png
+
+
+ Add
+
+
+ Add a new point in boundary condition or lateral contribution
+
+
+ Ctrl+N
+
+
+
+
+
+ ressources/gtk-remove.pngressources/gtk-remove.png
+
+
+ Delete
+
+
+ Delete current selected rows
+
+
+ Ctrl+D
+
+
+
+
+
+ ressources/gtk-sort-ascending.pngressources/gtk-sort-ascending.png
+
+
+ Sort
+
+
+ Sort boundary condition point
+
+
+
+
+
+