Skip to content

Commit

Permalink
20241008
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-ShiRui committed Oct 7, 2024
1 parent 9b8fb8b commit 41c1360
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 49 deletions.
8 changes: 3 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

6 changes: 0 additions & 6 deletions program.log
Original file line number Diff line number Diff line change
@@ -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
Binary file modified resources/qrc/__pycache__/res_rc.cpython-311.pyc
Binary file not shown.
18 changes: 10 additions & 8 deletions src/POT.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions src/PSSA.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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())
8 changes: 0 additions & 8 deletions src/UDSA.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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())
Binary file modified src/__pycache__/POT.cpython-311.pyc
Binary file not shown.
Binary file modified src/__pycache__/PSSA.cpython-311.pyc
Binary file not shown.
Binary file modified src/__pycache__/UDSA.cpython-311.pyc
Binary file not shown.
Binary file modified src/__pycache__/mainwindow.cpython-311.pyc
Binary file not shown.
41 changes: 27 additions & 14 deletions src/mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__()
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 41c1360

Please sign in to comment.