diff --git a/src/Model/Geometry/Reach.py b/src/Model/Geometry/Reach.py index 94ca70d6debdaa0f3d33210ace8c67e079cf9d11..1c8c95aa53e0fcb485f96aabe6f77cab6001847f 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 fc4e33d8add8fd4f741b3eff37248bb24c45a850..11d0987f4a9c27ecfe761aa649eb1f7642a14812 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 637ee1d41b72041707a11e20765ea1c3b465f1f3..b11ed471706b210a6938aceaf88c05ca71c2d539 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 ead3ed7a76c43702af16cb48650a89dc10f30fe8..6383114194869a0b884c16f273c570ce3ca97f44 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 0c1864db3e4da9d3717b6d30b0c458c069464378..99d9becd5a69cb10dad6c30550d5a6463861d646 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 34ca0b57ccf744f0c5c1f964c93c9edddf58916d..01608630f4dfd4b264bb9a0c4befd26c2f6a54ea 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 c4cb19844f118dc0b03d1c043ac5ec8adec423ee..0f68169934ad26088dd6543a2af28a6ed08c6bd8 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 43d96cdab8d7b01199b6231ab436e5cf777cce92..8cc29dc89b9e8cb032971bf85aa38779ff4dd943 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 2bbd100a3361062d78b9263b18b2010be0907505..0428a006578ffc819b1d456ab876d8d49711dd3a 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 94b412b646f6cf54b1eebe78e53ccce54db5a30f..187cedeb4d5341b534fef202a2ff71656b6cb0ae 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 4a05e54741f3a183039e1ae04cf01fdf4d940175..bf91bbea59f4d11c8efda3eddd2430a922dbfd8e 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)