diff --git a/main.py b/main.py index 97beb82..5378a26 100644 --- a/main.py +++ b/main.py @@ -22,22 +22,20 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -import sys from PySide6.QtWidgets import QApplication, QSplashScreen from PySide6.QtGui import QPixmap from src.mainwindow import MainWindow # Import MainWindow from src if __name__ == "__main__": - app = QApplication(sys.argv) + app = QApplication([]) splash_pix = QPixmap(":/png/loading.png") splash = QSplashScreen(splash_pix) splash.show() window = MainWindow() - + splash.finish(window) - window.show() - sys.exit(app.exec()) + app.exec() diff --git a/program.log b/program.log index fc7d0c3..e69de29 100644 --- a/program.log +++ b/program.log @@ -1,6 +0,0 @@ -2024-10-07 01:44:49,698 - ERROR - Error while loading config file: Config file ./config.ini not found. -2024-10-07 01:44:56,643 - ERROR - Error while setting language to English: 'Settings' -2024-10-07 01:50:14,836 - ERROR - Error while loading config file: Config file ./config.ini not found. -2024-10-07 01:50:20,192 - ERROR - Error while setting language to English: 'Settings' -2024-10-07 01:51:02,217 - ERROR - Error while loading config file: Config file ./config.ini not found. -2024-10-07 20:19:57,012 - ERROR - Failed to open the file: Guide_ENG.pdf diff --git a/resources/qrc/__pycache__/res_rc.cpython-311.pyc b/resources/qrc/__pycache__/res_rc.cpython-311.pyc index 891a65b..0ca2332 100644 Binary files a/resources/qrc/__pycache__/res_rc.cpython-311.pyc and b/resources/qrc/__pycache__/res_rc.cpython-311.pyc differ diff --git a/src/POT.py b/src/POT.py index 7ef176b..9f3fb1a 100644 --- a/src/POT.py +++ b/src/POT.py @@ -27,16 +27,9 @@ from PySide6.QtWidgets import QWidget, QTextBrowser from PySide6.QtCore import QThread, Signal -from pymoo.core.problem import Problem -from pymoo.algorithms.soo.nonconvex.ga import GA -from pymoo.algorithms.soo.nonconvex.de import DE -from pymoo.algorithms.soo.nonconvex.pso import PSO -from pymoo.algorithms.soo.nonconvex.pattern import PatternSearch -from pymoo.algorithms.moo.nsga2 import NSGA2 -from pymoo.optimize import minimize from multiprocessing.pool import ThreadPool from multiprocessing import cpu_count - +from pymoo.core.problem import Problem from libs import MUSE_API_GA from resources.ui.POT_ui import Ui_POT @@ -57,6 +50,12 @@ def __init__(self, pool, ga_muse_parameters, pop_size, n_gen, var, xl, xu, curre self.opimision_parameters = opimision_parameters def run(self): + from pymoo.algorithms.soo.nonconvex.ga import GA + from pymoo.algorithms.soo.nonconvex.de import DE + from pymoo.algorithms.soo.nonconvex.pso import PSO + from pymoo.algorithms.soo.nonconvex.pattern import PatternSearch + from pymoo.algorithms.moo.nsga2 import NSGA2 + from pymoo.optimize import minimize try: muse_problem = MyProblem(pool=self.pool, ga_muse_parameters=self.ga_muse_parameters, var=self.var, xl=self.xl, xu=self.xu, opimision_parameters=self.opimision_parameters ,show_messagge=self.show_mesg) @@ -193,6 +192,9 @@ def __init__(self): super().__init__() self.ui = Ui_POT() self.ui.setupUi(self) # Set up the UI + + # load_modules() + self.setWindowTitle("Parameter Optimization Tool (POT) module") # Set window title self.ga_thread = None self.pool = None diff --git a/src/PSSA.py b/src/PSSA.py index 2f5be24..4b8cf17 100644 --- a/src/PSSA.py +++ b/src/PSSA.py @@ -22,7 +22,6 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -import sys import numpy as np import pandas as pd @@ -642,10 +641,3 @@ def closeEvent(self, event): self.worker_thread.wait() self.gfw.close() event.accept() - - -if __name__ == "__main__": - app = QApplication(sys.argv) - widget = PSSA_Dialog() - widget.show() - sys.exit(app.exec()) diff --git a/src/UDSA.py b/src/UDSA.py index d7b7dda..9868a99 100644 --- a/src/UDSA.py +++ b/src/UDSA.py @@ -22,7 +22,6 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -import sys import numpy as np from pathlib import Path @@ -845,10 +844,3 @@ def closeEvent(self, event): thread.wait() event.accept() - - -if __name__ == "__main__": - app = QApplication(sys.argv) - window = UDSA_Dialog() - window.show() - sys.exit(app.exec()) diff --git a/src/__pycache__/POT.cpython-311.pyc b/src/__pycache__/POT.cpython-311.pyc index 1cd644c..3ef624c 100644 Binary files a/src/__pycache__/POT.cpython-311.pyc and b/src/__pycache__/POT.cpython-311.pyc differ diff --git a/src/__pycache__/PSSA.cpython-311.pyc b/src/__pycache__/PSSA.cpython-311.pyc index 884ed79..db12311 100644 Binary files a/src/__pycache__/PSSA.cpython-311.pyc and b/src/__pycache__/PSSA.cpython-311.pyc differ diff --git a/src/__pycache__/UDSA.cpython-311.pyc b/src/__pycache__/UDSA.cpython-311.pyc index 7cbc4ec..e525c94 100644 Binary files a/src/__pycache__/UDSA.cpython-311.pyc and b/src/__pycache__/UDSA.cpython-311.pyc differ diff --git a/src/__pycache__/mainwindow.cpython-311.pyc b/src/__pycache__/mainwindow.cpython-311.pyc index 2d57d2a..8b247a8 100644 Binary files a/src/__pycache__/mainwindow.cpython-311.pyc and b/src/__pycache__/mainwindow.cpython-311.pyc differ diff --git a/src/mainwindow.py b/src/mainwindow.py index 0394450..e19ed27 100644 --- a/src/mainwindow.py +++ b/src/mainwindow.py @@ -22,26 +22,37 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -import pickle -import pandas as pd -import configparser -import logging -from PySide6.QtWidgets import QFileDialog, QMainWindow, QWidget, QMessageBox, QDialog -from PySide6.QtCore import QSettings, QPropertyAnimation, Qt, Signal, QThread, QUrl -from PySide6.QtGui import QPainter, QColor, QDesktopServices -from pathlib import Path +def load_large_modules(): + global pd, pickle, configparser, logging + global QFileDialog, QMessageBox, QDesktopServices, QPainter, QColor + global QUrl, QSettings, QPropertyAnimation, Qt + global MUSE_API, CheckTifDimensions + global UDSA_Dialog, PSSA_Dialog + global Ui_MainWindow + global Path + + import pandas as pd + import pickle + import configparser + import logging -from libs import MUSE_API -from libs import CheckTifDimensions + from PySide6.QtWidgets import QFileDialog, QMessageBox + from PySide6.QtGui import QDesktopServices, QPainter, QColor + from PySide6.QtCore import QUrl, QSettings, QPropertyAnimation, Qt + from libs import MUSE_API, CheckTifDimensions + from src.UDSA import UDSA_Dialog + from src.PSSA import PSSA_Dialog -from src.UDSA import UDSA_Dialog -from src.PSSA import PSSA_Dialog -from src.POT import POT_Widget + from resources.ui.mainwindow_ui import Ui_MainWindow + from pathlib import Path -from resources.ui.mainwindow_ui import Ui_MainWindow +from src.POT import POT_Widget +from PySide6.QtWidgets import QDialog, QWidget, QMainWindow +from PySide6.QtCore import Signal, QThread from resources.ui.aboutus_ui import Ui_AboutUs + class AboutDialog(QDialog): def __init__(self): super().__init__() @@ -131,8 +142,10 @@ def mouseReleaseEvent(self, event): class MainWindow(QMainWindow): def __init__(self, parent=None): super().__init__(parent) + load_large_modules() self.ui = Ui_MainWindow() self.ui.setupUi(self) + self.mlcs_widget = UDSA_Dialog() self.pst_widget = PSSA_Dialog() self.mgot_widget = POT_Widget()