commit 67913ab8e5b00cb8a5a172bca6d3c5360a1188dd Author: Pierre-Antoine Rouby Date: Fri Mar 3 16:04:30 2023 +0100 git, src: Initial commit. diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..30f2494a --- /dev/null +++ b/.gitignore @@ -0,0 +1,289 @@ +# Created by https://www.toptal.com/developers/gitignore/api/python +# Edit at https://www.toptal.com/developers/gitignore?templates=python + +### Python ### +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ + +### Python Patch ### +# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration +poetry.toml + +# ruff +.ruff_cache/ + +# End of https://www.toptal.com/developers/gitignore/api/python + +# Created by https://www.toptal.com/developers/gitignore/api/emacs +# Edit at https://www.toptal.com/developers/gitignore?templates=emacs + +### Emacs ### +# -*- mode: gitignore; -*- +*~ +\#*\# +/.emacs.desktop +/.emacs.desktop.lock +*.elc +auto-save-list +tramp +.\#* + +# Org-mode +.org-id-locations +*_archive + +# flymake-mode +*_flymake.* + +# eshell files +/eshell/history +/eshell/lastdir + +# elpa packages +/elpa/ + +# reftex files +*.rel + +# AUCTeX auto folder +/auto/ + +# cask packages +.cask/ +dist/ + +# Flycheck +flycheck_*.el + +# server auth directory +/server/ + +# projectiles files +.projectile + +# directory configuration +.dir-locals.el + +# network security +/network-security.data + + +# End of https://www.toptal.com/developers/gitignore/api/emacs +# Created by https://www.toptal.com/developers/gitignore/api/qt +# Edit at https://www.toptal.com/developers/gitignore?templates=qt + +### Qt ### +# C++ objects and libs +*.slo +*.lo +*.o +*.a +*.la +*.lai +*.so +*.so.* +*.dll +*.dylib + +# Qt-es +object_script.*.Release +object_script.*.Debug +*_plugin_import.cpp +/.qmake.cache +/.qmake.stash +*.pro.user +*.pro.user.* +*.qbs.user +*.qbs.user.* +*.moc +moc_*.cpp +moc_*.h +qrc_*.cpp +ui_*.h +*.qmlc +*.jsc +Makefile* +*build-* +*.qm +*.prl + +# Qt unit tests +target_wrapper.* + +# QtCreator +*.autosave + +# QtCreator Qml +*.qmlproject.user +*.qmlproject.user.* + +# QtCreator CMake +CMakeLists.txt.user* + +# QtCreator 4.8< compilation database +compile_commands.json + +# QtCreator local machine specific files for imported projects +*creator.user* + +*_qmlcache.qrc + +# End of https://www.toptal.com/developers/gitignore/api/qt diff --git a/README.md b/README.md new file mode 100644 index 00000000..aae49142 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# PamHyr (Programme d’Aide à la Modélisation en Hydraulique des Rivières) diff --git a/src/pamhyr.py b/src/pamhyr.py new file mode 100755 index 00000000..206755c7 --- /dev/null +++ b/src/pamhyr.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import sys + +from PyQt5.QtWidgets import ( + QMainWindow, QApplication, +) +from view.MainWindow import ApplicationWindow + +def main(): + app = QApplication(sys.argv) + application = ApplicationWindow() + application.show() + sys.exit(app.exec_()) + +if __name__ == "__main__": + main() diff --git a/src/view/ASubWindow.py b/src/view/ASubWindow.py new file mode 100644 index 00000000..eaa28638 --- /dev/null +++ b/src/view/ASubWindow.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- + +from PyQt5.QtWidgets import ( + QMainWindow, QApplication, QDesktopWidget, + QMdiArea, QMdiSubWindow, QDialog, + QPushButton +) +from PyQt5.uic import loadUi + + +# class ASubWindow(QMdiSubWindow): +# def __init__(self, ui="error"): +# super(ASubWindow, self).__init__() +# loadUi(f"ui/{ui}.ui", self) + +class ASubWindow(QDialog): + def __init__(self, ui="error"): + super(ASubWindow, self).__init__() + loadUi(f"ui/{ui}.ui", self) diff --git a/src/view/MainWindow.py b/src/view/MainWindow.py new file mode 100644 index 00000000..0466c4e5 --- /dev/null +++ b/src/view/MainWindow.py @@ -0,0 +1,11 @@ +from PyQt5 import QtGui +from PyQt5.QtWidgets import ( + QMainWindow, QApplication, +) +from PyQt5.uic import loadUi + +class ApplicationWindow(QMainWindow): + def __init__(self): + super(ApplicationWindow, self).__init__() + self.ui = loadUi("view/ui/MainWindow.ui", self) + self.showMaximized() diff --git a/src/view/ui/MainWindow.ui b/src/view/ui/MainWindow.ui new file mode 100644 index 00000000..27e22741 --- /dev/null +++ b/src/view/ui/MainWindow.ui @@ -0,0 +1,881 @@ + + + MainWindow + + + Qt::ApplicationModal + + + true + + + + 0 + 0 + 850 + 646 + + + + + Serif + 75 + true + false + + + + true + + + Qt::NoContextMenu + + + true + + + PAMHYR.2 + + + Qt::LeftToRight + + + false + + + + + + false + + + + Qt::NoContextMenu + + + + + + 0 + 0 + 850 + 20 + + + + + Sans Serif + + + + + &Fichier + + + + + + + + + + + + + + + + + + + + + + + + + + &Réseau + + + + + + &Géométrie + + + + Comparer + + + + Profil en travers + + + + + + + + + + + + + + + + + + + + + + + + &Exécuter + + + + Sous-étude Rubar3 + + + + + + + + + + + + + + + &Hydraulique + + + + + + + + + + + + + + + + &Graphiques + + + + + + + + + + + + + + + + &Cartographie + + + + + + &Aide + + + + + + + + + + + + + + + + + + true + + + + 0 + 0 + + + + + 50 + false + true + + + + true + + + Qt::ClickFocus + + + Qt::NoContextMenu + + + toolBar + + + + + + true + + + true + + + false + + + TopToolBarArea + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sans Serif + 9 + 50 + false + false + + + + toolBar_2 + + + TopToolBarArea + + + true + + + + + + + + + + + + + + + + + false + + + Nouvelle étude MAGE + + + + 75 + true + + + + + + + ../ressources/menu/open.png../ressources/menu/open.png + + + Ouvrir une étude + + + + + Nouvelle étude RubarBE + + + + + Ouvrir une étude + + + + + Importer un jeu de données MAGE + + + + + + + + Importer un jeu de données RubarBE + + + + + + ../ressources/menu/gtk-close.png../ressources/menu/gtk-close.png + + + Fermer + + + + + true + + + true + + + + ../ressources/menu/save.png../ressources/menu/save.png + + + Enregistrer le maillage + + + + + Enregistrer + + + + + Enregistrer sous ... + + + + + Archiver + + + + + Configuration de Pamhyr + + + + + + ../ressources/menu/gtk-quit.png../ressources/menu/gtk-quit.png + + + Quitter + + + + + Éditer le réseau + + + + + Éditer la géométrie + + + + + Importer une géométrie + + + + + Exporter la géométrie + + + + + Lancer le mailleur externe + + + + + Choix du mailleur par bief + + + + + Visualiser la géométrie maillée + + + + + Exporter le maillage + + + + + Supprimer le maillage du bief courant + + + + + Supprimer l'ensemble des maillages + + + + + Abscisse - Cote + + + + + XYZ + + + + + Paramètres numériques du solveur MAGE + + + + + Conditions aux Limites & Apports Ponctuels + + + + 75 + true + + + + + + Conditions initiales + + + + + true + + + Activer/Désactiver l'export des conditions initiales + + + + + Importer l'état final comme état initial + + + + + Édition des Frottements + + + + + Édition des Apports Latéraux + + + + + Édition des déversements + + + + + Édition des Tronçons + + + + + Édition des ouvrages en travers + + + + + Solveur MAGE + + + + + Stop Solveur + + + + + Afficher les listings + + + + + Gestion des répertoires de simulation + + + + + Ouvrir + + + + + Fermer + + + + + Hydrogramme + + + + Serif + 75 + true + + + + + + Limnigramme + + + + 75 + true + + + + + + Ligne d'eau + + + + + Ligne d'eau finale + + + + + Ligne d'eau enveloppe + + + + + Vitesse(Pk) à t fixé + + + + + Vitesse(t) à Pk fixé + + + + + Charge hydraulique(Pk) à t fixé + + + + + Charge hydraulique(t) à Pk fixé + + + + 75 + true + + + + + + Voir l'animation (MAGE) + + + + + Autres résulats MAGE + + + + 75 + true + + + + + + Cartographier le bief courant + + + + + Aide de PAMHYR + + + + + Aide de MAGE + + + + + À propos + + + + + + ../ressources/menu/open.png../ressources/menu/open.png + + + ouvrir + + + Ouvrir une étude + + + + + + ../ressources/menu/gtk-save-as.png../ressources/menu/gtk-save-as.png + + + enregistrer_etude_en_cours + + + Enrégistrer étude en cours (Ctrl+S) + + + Ctrl+S + + + + + + ../ressources/menu/gtk-close.png../ressources/menu/gtk-close.png + + + fermer_etude_en_cours + + + Fermer étude en cours (Ctrl+F) + + + Ctrl+F + + + + + + ../ressources/menu/exit_bis.png../ressources/menu/exit_bis.png + + + quitter_application + + + Quitter l'application (Ctrl+Q) + + + Ctrl+Q + + + + + + ../ressources/menu/gtk-execute.png../ressources/menu/gtk-execute.png + + + lancer_solveur + + + Lancer le solveur pour réaliser une simulation + + + + + + ../ressources/menu/gtk-stop.png../ressources/menu/gtk-stop.png + + + interrompt_simulation_en_cours + + + Interrompt la simulation en cours + + + + + + ../ressources/menu/gnome-stock-insert-table.png../ressources/menu/gnome-stock-insert-table.png + + + lancer_mailleur_externe + + + Lancer le mailleur externe sur la géométrie du bief courant + + + + + + ../ressources/menu/gnome-stock-edit.png../ressources/menu/gnome-stock-edit.png + + + afficher_listings_simulation + + + Aficher les listings de la simulation courante + + + + + + ../ressources/menu/reseau3_24.png../ressources/menu/reseau3_24.png + + + Réseau + + + Ouvrir l'éditeur de la topologie du réseau + + + + + + ../ressources/menu/geometrie0.png../ressources/menu/geometrie0.png + + + Géométrie + + + Ouvrir l'éditeur de géométrie + + + + + + ../ressources/menu/mailles-50.png../ressources/menu/mailles-50.png + + + Maillage + + + Afficher le maillage + + + + + Cond. Limites + + + Ouvir l'éditeur des Conditions aux Limites & Apports Ponctuels + + + + + + + + App. Latéraux + + + Ouvrir l'éditeur des Apports Latéraux Distribués + + + + + Déversements + + + Ouvrir l'éditeur des Déversements Latéraux + + + + + Tronçons + + + Ouvrir l'éditeur des tronçons pour les frottements et Apports Latéraux + + + + + Frottements + + + Ouvrir l'éditeur des frottements au fond + + + + + Ouvrages + + + Ouvrir l'éditeur des ouvrages (seuils, vannes, etc.), singularités et pompes + + + + + + + MainWindow + customContextMenuRequested(QPoint) + MainWindow + showMaximized() + + + 346 + 301 + + + 346 + 301 + + + + +