30
30
import serial , serial .tools .list_ports
31
31
from PyQt5 import QtCore , QtGui , QtWidgets
32
32
from PyQt5 .QtCore import Qt , QCoreApplication , QObject , QThread , pyqtSignal , pyqtSlot , QModelIndex , QItemSelectionModel , QFileInfo , QTranslator , QLocale , QSettings
33
- from PyQt5 .QtGui import QKeySequence , QStandardItemModel , QStandardItem , QValidator , QPalette
33
+ from PyQt5 .QtGui import QKeySequence , QStandardItemModel , QStandardItem , QValidator , QPalette , QFontDatabase
34
34
from PyQt5 .QtWidgets import QDialog , QAbstractItemView , QMessageBox
35
35
from cn5X_config import *
36
36
from msgbox import *
@@ -882,33 +882,18 @@ def on_gotoG28(self):
882
882
Make a rapid move from current location to the position defined by the last G28.1
883
883
If no positions are stored with G28.1 then all axes will go to the machine origin.
884
884
'''
885
- '''
886
- if not self.__settings.value("dontConfirmG28", False, type=bool):
887
- # Confirmation :
888
- m = msgBox(
889
- title = self.tr("Go to G28 location?"),
890
- text = self.tr("Make a rapid move from current location to the position defined by the last G28.1?"),
891
- info = self.tr("If no positions are stored with G28.1 then all axes will go to the machine origin."),
892
- icon = msgIconList.Question,
893
- stdButton = msgButtonList.Yes | msgButtonList.Cancel,
894
- defButton = msgButtonList.Cancel,
895
- escButton = msgButtonList.Cancel,
896
- dontShowAgain = True,
897
- dontShowChecked = self.__settings.value("dontConfirmG28", False, type=bool)
898
- )
899
- if m.afficheMsg() == msgButtonList.Yes:
900
- # traitement si confirmé
901
- self.__grblCom.gcodePush("G28")
902
- # Mémorise le choix d'affichage de la boite de confirmation
903
- self.__settings.setValue("dontConfirmG28", m.chkDontShow.isChecked())
904
- else:
905
- # Envoi sans confirmation
906
- self.__grblCom.gcodePush("G28")
907
- '''
885
+ self .ui .btnG28 .setButtonStatus (True )
908
886
''' Appel de la boite de dialogue G28 '''
909
887
dlg = dlgG28_30_1 ("G28" , self .__grblCom , self .__decode , self .__nbAxis , self .__axisNames )
910
888
dlg .setParent (self )
911
889
dlg .showDialog ()
890
+ # On laisse le temps à Grbl de commencer
891
+ jusqua = time .time () + 0.25
892
+ while time .time () < jusqua :
893
+ QCoreApplication .processEvents ()
894
+ if self .__decode .get_etatMachine () == GRBL_STATUS_IDLE :
895
+ # La boite de dialogue à ete annulée ou le trajet est déja fini
896
+ self .ui .btnG28 .setButtonStatus (False )
912
897
913
898
914
899
@pyqtSlot ()
@@ -917,33 +902,18 @@ def on_gotoG30(self):
917
902
Make a rapid move from current location to the position defined by the last G30.1
918
903
If no positions are stored with G30.1 then all axes will go to the machine origin.
919
904
'''
920
- '''
921
- if not self.__settings.value("dontConfirmG30", False, type=bool):
922
- # Confirmation :
923
- m = msgBox(
924
- title = self.tr("Go to G30 location?"),
925
- text = self.tr("Make a rapid move from current location to the position defined by the last G30.1?"),
926
- info = self.tr("If no positions are stored with G30.1 then all axes will go to the machine origin."),
927
- icon = msgIconList.Question,
928
- stdButton = msgButtonList.Yes | msgButtonList.Cancel,
929
- defButton = msgButtonList.Cancel,
930
- escButton = msgButtonList.Cancel,
931
- dontShowAgain = True,
932
- dontShowChecked = self.__settings.value("dontConfirmG30", False, type=bool)
933
- )
934
- if m.afficheMsg() == msgButtonList.Yes:
935
- # traitement si confirmé
936
- self.__grblCom.gcodePush("G30")
937
- # Mémorise le choix d'affichage de la boite de confirmation
938
- self.__settings.setValue("dontConfirmG30", m.chkDontShow.isChecked())
939
- else:
940
- # Envoi sans confirmation
941
- self.__grblCom.gcodePush("G30")
942
- '''
905
+ self .ui .btnG30 .setButtonStatus (True )
943
906
''' Appel de la boite de dialogue G30 '''
944
907
dlg = dlgG28_30_1 ("G30" , self .__grblCom , self .__decode , self .__nbAxis , self .__axisNames )
945
908
dlg .setParent (self )
946
909
dlg .showDialog ()
910
+ # On laisse le temps à Grbl de commencer
911
+ jusqua = time .time () + 0.25
912
+ while time .time () < jusqua :
913
+ QCoreApplication .processEvents ()
914
+ if self .__decode .get_etatMachine () == GRBL_STATUS_IDLE :
915
+ # La boite de dialogue à ete annulée ou le trajet est déja fini
916
+ self .ui .btnG30 .setButtonStatus (False )
947
917
948
918
949
919
@pyqtSlot ()
@@ -2727,8 +2697,10 @@ def setTranslator(self, langue: QLocale):
2727
2697
2728
2698
2729
2699
if __name__ == '__main__' :
2730
- import sys
2731
-
2700
+
2701
+ # Suppress qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow)
2702
+ os .environ ["QT_LOGGING_RULES" ] = '*.debug=false;qt.qpa.*=false'
2703
+
2732
2704
app = QtWidgets .QApplication (sys .argv )
2733
2705
2734
2706
# Retrouve le répertoire de l'exécutable
@@ -2756,6 +2728,9 @@ def setTranslator(self, langue: QLocale):
2756
2728
translator .load (langue , "{}/i18n/cn5X" .format (app_path ), "." )
2757
2729
app .installTranslator (translator )
2758
2730
2731
+ # Chargement police LED Calculator depuis le fichier de ressources
2732
+ QFontDatabase .addApplicationFont (":/cn5X/fonts/LEDCalculator.ttf" )
2733
+
2759
2734
# Définition de la locale pour affichage des dates dans la langue du systeme
2760
2735
try :
2761
2736
locale .setlocale (locale .LC_TIME , '' )
0 commit comments