From 33923a8e58d783234ca7de579405a2a16923f199 Mon Sep 17 00:00:00 2001
From: Pierre-Antoine Rouby <pierre-antoine.rouby@inrae.fr>
Date: Mon, 15 May 2023 14:30:20 +0200
Subject: [PATCH] pamhyr: Rename Network, Geometry and BC files.

---
 src/Model/Geometry/Reach.py                      |  4 +++-
 src/Model/River.py                               |  3 ++-
 src/Model/Saved.py                               |  4 ++--
 src/View/BoundaryCondition/Table.py              | 12 ++++++------
 .../{BCUndoCommand.py => UndoCommand.py}         |  0
 .../{BoundaryConditionWindow.py => Window.py}    | 12 ++++++------
 .../Profile/{qtableview_profile.py => Table.py}  |  2 +-
 .../{ProfileUndoCommand.py => UndoCommand.py}    |  0
 .../Profile/{ProfileWindow.py => Window.py}      |  7 ++++---
 .../Geometry/{qtableview_reach.py => Table.py}   |  2 +-
 .../{ReachUndoCommand.py => UndoCommand.py}      |  0
 .../Geometry/{GeometryWindow.py => Window.py}    |  4 ++--
 src/View/MainWindow.py                           |  6 +++---
 src/View/Network/{TableModel.py => Table.py}     |  0
 src/View/Network/{NetworkWindow.py => Window.py} | 16 ++++++++--------
 15 files changed, 38 insertions(+), 34 deletions(-)
 rename src/View/BoundaryCondition/{BCUndoCommand.py => UndoCommand.py} (100%)
 rename src/View/BoundaryCondition/{BoundaryConditionWindow.py => Window.py} (99%)
 rename src/View/Geometry/Profile/{qtableview_profile.py => Table.py} (99%)
 rename src/View/Geometry/Profile/{ProfileUndoCommand.py => UndoCommand.py} (100%)
 rename src/View/Geometry/Profile/{ProfileWindow.py => Window.py} (99%)
 rename src/View/Geometry/{qtableview_reach.py => Table.py} (99%)
 rename src/View/Geometry/{ReachUndoCommand.py => UndoCommand.py} (100%)
 rename src/View/Geometry/{GeometryWindow.py => Window.py} (99%)
 rename src/View/Network/{TableModel.py => Table.py} (100%)
 rename src/View/Network/{NetworkWindow.py => Window.py} (99%)

diff --git a/src/Model/Geometry/Reach.py b/src/Model/Geometry/Reach.py
index 94ca70d6..1c8c95aa 100644
--- a/src/Model/Geometry/Reach.py
+++ b/src/Model/Geometry/Reach.py
@@ -358,7 +358,9 @@ class Reach:
                     for i, data in enumerate(list_header[ind]):
                         d[profile_header[i]] = data
 
-                    prof = ProfileXYZ(**d, reach=self)
+                    prof = ProfileXYZ(
+                        **d, reach=self, status=self._status
+                    )
                     prof.import_points(profile)
                     self._profiles.append(prof)
                     self._update_profile_numbers()
diff --git a/src/Model/River.py b/src/Model/River.py
index fc4e33d8..11d0987f 100644
--- a/src/Model/River.py
+++ b/src/Model/River.py
@@ -43,7 +43,7 @@ class RiverReach(Edge):
             status = status
         )
 
-        self._reach = Reach(self)
+        self._reach = Reach(status=self._status, parent=self)
 
     @property
     def reach(self):
@@ -52,6 +52,7 @@ class RiverReach(Edge):
 
 class River(Graph):
     def __init__(self, status=None):
+        print(status)
         super(River, self).__init__(status=status)
 
         # Replace Node and Edge ctor by custom ctor
diff --git a/src/Model/Saved.py b/src/Model/Saved.py
index 637ee1d4..b11ed471 100644
--- a/src/Model/Saved.py
+++ b/src/Model/Saved.py
@@ -9,9 +9,9 @@ class SavedStatus(object):
         return self._saved
 
     def save(self):
-        print(" * save")
+        # print(" * save")
         self._saved = True
 
     def modified(self):
-        print(" * modified ...")
+        # print(" * modified ...")
         self._saved = False
diff --git a/src/View/BoundaryCondition/Table.py b/src/View/BoundaryCondition/Table.py
index ead3ed7a..63831141 100644
--- a/src/View/BoundaryCondition/Table.py
+++ b/src/View/BoundaryCondition/Table.py
@@ -15,16 +15,16 @@ from PyQt5.QtWidgets import (
     QComboBox,
 )
 
-from View.BoundaryCondition.BCUndoCommand import (
-    SetNameCommand, SetNodeCommand, SetTypeCommand,
-    AddCommand, DelCommand, SortCommand,
-    MoveCommand, PasteCommand, DuplicateCommand,
-)
-
 from Model.BoundaryCondition.BoundaryConditionTypes import (
     NotDefined, PonctualContribution,
     TimeOverZ, TimeOverDebit, ZOverDebit
 )
+
+from View.BoundaryCondition.UndoCommand import (
+    SetNameCommand, SetNodeCommand, SetTypeCommand,
+    AddCommand, DelCommand, SortCommand,
+    MoveCommand, PasteCommand, DuplicateCommand,
+)
 from View.BoundaryCondition.translate import *
 
 _translate = QCoreApplication.translate
diff --git a/src/View/BoundaryCondition/BCUndoCommand.py b/src/View/BoundaryCondition/UndoCommand.py
similarity index 100%
rename from src/View/BoundaryCondition/BCUndoCommand.py
rename to src/View/BoundaryCondition/UndoCommand.py
diff --git a/src/View/BoundaryCondition/BoundaryConditionWindow.py b/src/View/BoundaryCondition/Window.py
similarity index 99%
rename from src/View/BoundaryCondition/BoundaryConditionWindow.py
rename to src/View/BoundaryCondition/Window.py
index 0c1864db..99d9becd 100644
--- a/src/View/BoundaryCondition/BoundaryConditionWindow.py
+++ b/src/View/BoundaryCondition/Window.py
@@ -22,17 +22,17 @@ from PyQt5.QtWidgets import (
     QComboBox, QVBoxLayout, QHeaderView, QTabWidget,
 )
 
-from View.BoundaryCondition.BCUndoCommand import (
-    SetNameCommand, SetNodeCommand, SetTypeCommand,
-    AddCommand, DelCommand, SortCommand,
-    MoveCommand, PasteCommand, DuplicateCommand,
-)
-
 from Model.BoundaryCondition.BoundaryConditionTypes import (
     NotDefined, PonctualContribution,
     TimeOverZ, TimeOverDebit, ZOverDebit
 )
 
+from View.BoundaryCondition.UndoCommand import (
+    SetNameCommand, SetNodeCommand, SetTypeCommand,
+    AddCommand, DelCommand, SortCommand,
+    MoveCommand, PasteCommand, DuplicateCommand,
+)
+
 from View.BoundaryCondition.Table import (
     TableModel, ComboBoxDelegate
 )
diff --git a/src/View/Geometry/Profile/qtableview_profile.py b/src/View/Geometry/Profile/Table.py
similarity index 99%
rename from src/View/Geometry/Profile/qtableview_profile.py
rename to src/View/Geometry/Profile/Table.py
index 34ca0b57..01608630 100644
--- a/src/View/Geometry/Profile/qtableview_profile.py
+++ b/src/View/Geometry/Profile/Table.py
@@ -18,7 +18,7 @@ from PyQt5.QtCore import (
 from Model.Geometry.PointXYZ import PointXYZ
 from Model.Geometry.ProfileXYZ import ProfileXYZ
 
-from View.Geometry.Profile.ProfileUndoCommand import *
+from View.Geometry.Profile.UndoCommand import *
 
 _translate = QCoreApplication.translate
 
diff --git a/src/View/Geometry/Profile/ProfileUndoCommand.py b/src/View/Geometry/Profile/UndoCommand.py
similarity index 100%
rename from src/View/Geometry/Profile/ProfileUndoCommand.py
rename to src/View/Geometry/Profile/UndoCommand.py
diff --git a/src/View/Geometry/Profile/ProfileWindow.py b/src/View/Geometry/Profile/Window.py
similarity index 99%
rename from src/View/Geometry/Profile/ProfileWindow.py
rename to src/View/Geometry/Profile/Window.py
index c4cb1984..0f681699 100644
--- a/src/View/Geometry/Profile/ProfileWindow.py
+++ b/src/View/Geometry/Profile/Window.py
@@ -18,12 +18,13 @@ from PyQt5.QtWidgets import (
     QUndoStack, QShortcut,
 )
 
+from Model.Geometry.Reach import Reach
+from Model.Geometry.ProfileXYZ import ProfileXYZ
+
 from View.ASubWindow import WindowToolKit
 from View.Geometry.Profile.mainwindow_ui_profile import Ui_MainWindow
 from View.Geometry.Profile.Plot import Plot
-from View.Geometry.Profile.qtableview_profile import *
-from Model.Geometry.Reach import Reach
-from Model.Geometry.ProfileXYZ import ProfileXYZ
+from View.Geometry.Profile.Table import *
 
 _translate = QCoreApplication.translate
 
diff --git a/src/View/Geometry/qtableview_reach.py b/src/View/Geometry/Table.py
similarity index 99%
rename from src/View/Geometry/qtableview_reach.py
rename to src/View/Geometry/Table.py
index 43d96cda..8cc29dc8 100644
--- a/src/View/Geometry/qtableview_reach.py
+++ b/src/View/Geometry/Table.py
@@ -19,7 +19,7 @@ from PyQt5.QtWidgets import (
 
 from Model.Geometry import Reach
 from Model.Geometry.ProfileXYZ import ProfileXYZ
-from View.Geometry.ReachUndoCommand import *
+from View.Geometry.UndoCommand import *
 
 
 _translate = QCoreApplication.translate
diff --git a/src/View/Geometry/ReachUndoCommand.py b/src/View/Geometry/UndoCommand.py
similarity index 100%
rename from src/View/Geometry/ReachUndoCommand.py
rename to src/View/Geometry/UndoCommand.py
diff --git a/src/View/Geometry/GeometryWindow.py b/src/View/Geometry/Window.py
similarity index 99%
rename from src/View/Geometry/GeometryWindow.py
rename to src/View/Geometry/Window.py
index 2bbd100a..0428a006 100644
--- a/src/View/Geometry/GeometryWindow.py
+++ b/src/View/Geometry/Window.py
@@ -27,8 +27,8 @@ from View.Geometry.PlotAC import PlotAC
 
 from View.ASubWindow import WindowToolKit
 from View.Geometry.mainwindow_ui_reach import Ui_MainWindow
-from View.Geometry.qtableview_reach import *
-from View.Geometry.Profile.ProfileWindow import ProfileWindow
+from View.Geometry.Table import *
+from View.Geometry.Profile.Window import ProfileWindow
 
 _translate = QCoreApplication.translate
 
diff --git a/src/View/MainWindow.py b/src/View/MainWindow.py
index 94b412b6..187cedeb 100644
--- a/src/View/MainWindow.py
+++ b/src/View/MainWindow.py
@@ -20,9 +20,9 @@ from View.DummyWindow import DummyWindow
 from View.Main.ConfigureWindow import ConfigureWindow
 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 View.Network.Window import NetworkWindow
+from View.Geometry.Window import GeometryWindow
+from View.BoundaryCondition.Window import BoundaryConditionWindow
 from View.LateralContribution.Window import LateralContributionWindow
 
 from Model.Study import Study
diff --git a/src/View/Network/TableModel.py b/src/View/Network/Table.py
similarity index 100%
rename from src/View/Network/TableModel.py
rename to src/View/Network/Table.py
diff --git a/src/View/Network/NetworkWindow.py b/src/View/Network/Window.py
similarity index 99%
rename from src/View/Network/NetworkWindow.py
rename to src/View/Network/Window.py
index 4a05e547..bf91bbea 100644
--- a/src/View/Network/NetworkWindow.py
+++ b/src/View/Network/Window.py
@@ -1,13 +1,5 @@
 # -*- coding: utf-8 -*-
 
-from Model.River import RiverNode, RiverReach, River
-
-from View.ASubWindow import ASubMainWindow
-from View.Network.GraphWidget import GraphWidget
-from View.Network.TableModel import (
-    GraphTableModel, ComboBoxDelegate, TrueFalseComboBoxDelegate,
-)
-
 from PyQt5.QtCore import (
     Qt, QRect, QVariant, QAbstractTableModel, pyqtSlot, pyqtSignal,
     QEvent,
@@ -19,6 +11,14 @@ from PyQt5.QtWidgets import (
     QApplication, QToolBar, QAction,
 )
 
+from Model.River import RiverNode, RiverReach, River
+
+from View.ASubWindow import ASubMainWindow
+from View.Network.GraphWidget import GraphWidget
+from View.Network.Table import (
+    GraphTableModel, ComboBoxDelegate, TrueFalseComboBoxDelegate,
+)
+
 class NetworkWindow(ASubMainWindow):
     def __init__(self, model=None, title="River network", parent=None):
         super(NetworkWindow, self).__init__(name=title, ui="Network", parent=parent)
-- 
GitLab