Skip to content

Commit 0025df4

Browse files
committed
updated the logo
1 parent 408ecd2 commit 0025df4

File tree

2 files changed

+30
-27
lines changed

2 files changed

+30
-27
lines changed
1.01 KB
Loading

arcjetCV/gui/main_window.py

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from PySide6 import QtWidgets
99
from PySide6.QtWidgets import QMessageBox
1010
from PySide6.QtCore import Signal
11-
from PySide6.QtGui import QIcon
11+
from PySide6.QtGui import QIcon,QPixmap
1212
import matplotlib.pyplot as plt
1313
from matplotlib.colors import rgb_to_hsv
1414
from matplotlib.widgets import RectangleSelector
@@ -36,13 +36,14 @@ def __init__(self):
3636
self.testing = False
3737

3838
# Set the application icon
39-
self.logo_path = os.path.join(
39+
self.logo_white_path = os.path.join(
4040
Path(__file__).parent.absolute(), "logo/arcjetCV_logo_white.png"
4141
)
42+
self.logo_path = os.path.join(Path(__file__).parent.absolute(), "logo/arcjetCV_logo_.png")
4243
self.setWindowIcon(QIcon(self.logo_path))
4344

4445
# Load and process the application logo
45-
self.rgb_frame = cv.imread(self.logo_path)
46+
self.rgb_frame = cv.imread(self.logo_white_path)
4647
self.rgb_frame = cv.cvtColor(self.rgb_frame, cv.COLOR_BGR2RGB)
4748

4849
# Initialize frame and plotting windows
@@ -549,10 +550,9 @@ def load_outputs(self):
549550

550551
except Exception as e:
551552
if self.testing:
552-
print("!!! File loading failed !!!:\n" + str(e))
553+
print("! File loading failed !:\n" + str(e))
553554
else:
554-
QMessageBox.warning(
555-
None, "Warning", "!!! File loading failed !!!:\n" + str(e)
555+
self.arcjetcv_message_box("Warning", "! File loading failed !:\n" + str(e)
556556
)
557557

558558
self.plot_outputs()
@@ -812,20 +812,18 @@ def plot_outputs(self):
812812
if self.testing:
813813
print("Not enough data to plot")
814814
else:
815-
QMessageBox.warning(
816-
None,
815+
self.arcjetcv_message_box(
817816
"Warning",
818-
"!!! Not enough data to plot !!!: only %i points"
819-
% len(self.raw_outputs),
817+
"! Not enough data to plot !: only %i points"
818+
% len(self.raw_outputs)
820819
)
821820

822821
except Exception as e:
823-
self.ui.basebar.setText("!!! Plotting failed !!!")
822+
self.ui.basebar.setText("! Plotting failed !")
824823
if self.testing:
825-
print("Warning", "!!! Plotting failed !!!:\n" + str(e))
824+
print("Warning", "! Plotting failed !:\n" + str(e))
826825
else:
827-
QMessageBox.warning(
828-
None, "Warning", "!!! Plotting failed !!!:\n" + str(e)
826+
self.arcjetcv_message_box("Warning", "! Plotting failed !:\n" + str(e)
829827
)
830828

831829
self.ui.Window1.repaint()
@@ -872,12 +870,11 @@ def save_plots(self, name):
872870
plt.close(fig)
873871

874872
except Exception as e:
875-
self.ui.basebar.setText("!!! Plot saving failed !!!")
873+
self.ui.basebar.setText("! Plot saving failed !")
876874
if self.testing:
877-
print("Warning", "!!! Plot saving failed !!!:\n" + str(e))
875+
print("Warning", "! Plot saving failed !:\n" + str(e))
878876
else:
879-
QMessageBox.warning(
880-
None, "Warning", "!!! Plot saving failed !!!:\n" + str(e)
877+
self.arcjetcv_message_box("Warning", "! Plot saving failed !:\n" + str(e)
881878
)
882879

883880
def export_to_csv(self):
@@ -931,12 +928,11 @@ def export_to_csv(self):
931928
df.to_csv(csv_file_path, index=False)
932929

933930
except Exception as e:
934-
self.ui.basebar.setText("!!! CSV export failed !!!")
931+
self.ui.basebar.setText("! CSV export failed !")
935932
if self.testing:
936-
print("Warning", "!!! CSV export failed !!!:\n" + str(e))
933+
print("Warning", "! CSV export failed !:\n" + str(e))
937934
else:
938-
QMessageBox.warning(
939-
None, "Warning", "!!! CSV export failed !!!:\n" + str(e)
935+
self.arcjetcv_message_box("Warning", "! CSV export failed !:\n" + str(e)
940936
)
941937

942938
def fit_data(self):
@@ -994,10 +990,17 @@ def fit_data(self):
994990
self.fit_dict = fit_dict
995991

996992
except Exception as e:
997-
self.ui.basebar.setText("!!! Fitting failed !!!")
993+
self.ui.basebar.setText("! Fitting failed !")
998994
if self.testing:
999-
print("Warning", "!!! Fitting failed !!!:\n" + str(e))
995+
print("Warning", "! Fitting failed !:\n" + str(e))
1000996
else:
1001-
QMessageBox.warning(
1002-
None, "Warning", "!!! Fitting failed !!!:\n" + str(e)
1003-
)
997+
self.arcjetcv_message_box("Warning", "! Fitting failed !:\n" + str(e))
998+
999+
def arcjetcv_message_box(self,title,message):
1000+
1001+
msg_box = QMessageBox()
1002+
msg_box.setIconPixmap(QPixmap(self.logo_path))
1003+
msg_box.setWindowTitle(title)
1004+
msg_box.setText(message)
1005+
msg_box.setStandardButtons(QMessageBox.Ok)
1006+
msg_box.exec_()

0 commit comments

Comments
 (0)