how to make my own custom page for qtdragon_hd?
I would read the prefeence file and find out which button is to be checked.
Call .setChecked(True) on that button only.
That should cause the python command to call it,s function, that I think you use to check the buttons are not straight across.
Then do the same for the other button group.
Which looks close to what you got there.
But what is this for?
self.frontBeltSelected(self.front_belt)
Please Log in or Create an account to join the conversation.
Thats what I do with an if..elif statement to map a numeric number in prefs to the relevant button. But you can see from the log it gets overridden after qt_makepinsCall .setChecked(True) on that button only.
That should cause the python command to call it,s function, that I think you use to check the buttons are not straight across.
[QTvcp.QTVCP.QT_PSTAT][INFO] (embed) Using LOCAL ui file from: /home/rod/linuxcnc/configs/sim.qtdragon_hd.qtdragon_hd_xyz/qtvcp/panels/belts/belts.ui (qt_pstat.py:359)
front: back = 1 : 6
frontBeltSelected - front: back : number = 1 : 6 : 1
backBeltSelected - front: back : number = 1 : 6 : 6
[QTvcp.QTVCP.QT_MAKEPINS][DEBUG] QTVCP: Parsing external qtvcp belts panel for EMBEDDED HAL widgets. (qt_makepins.py:109)
frontBeltSelected - front: back : number = 3 : 6 : 3
backBeltSelected - front: back : number = 3 : 8 : 8
frontbeltselected and backbelt selected are called from the window by the button goups.
Their purpose is to disable the button beside the one selected so you can't have t belts on the one idler pulley sheave.
It does not change checked.
def frontBeltSelected(self, number):
self.w.belt_5.setEnabled(True)
self.w.belt_6.setEnabled(True)
self.w.belt_7.setEnabled(True)
self.w.belt_8.setEnabled(True)
self.front_belt = number
backnumber = number + 4
if (backnumber == 5):
self.w.belt_5.setEnabled(False)
elif (backnumber == 6):
self.w.belt_6.setEnabled(False)
elif (backnumber == 7):
self.w.belt_7.setEnabled(False)
elif (backnumber == 8):
self.w.belt_8.setEnabled(False)
print(" frontBeltSelected - front: back : number = ",self.front_belt,":",self.back_belt,":",number)
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
The prefs are loaded perfectly and buttons initialised
But the prefs file is not updated on a change to the buttons on exit
From what I can see, closing_cleanup__() is not called as your print statement is never displayed.
I appreciate you teaching me about enumerate. Much nicer!
Please Log in or Create an account to join the conversation.
Ya I did both styles to hopefully not confuse things to much.
Please Log in or Create an account to join the conversation.
install: cannot stat '../lib/python/qtvcpqtvcp_plugin.py': No such file or directory
make[2]: *** [Makefile:793: install-python] Error 1
make[2]: Leaving directory '/home/rod/linuxcnc-dev/src'
make[1]: *** [debian/rules:72: override_dh_auto_install-arch] Error 2
make[1]: Leaving directory '/home/rod/linuxcnc-dev'
make: *** [debian/rules:38: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
rod@penguin:~/linuxcnc-dev$
Seems like a typo but does not seem to be one of yours!
Please Log in or Create an account to join the conversation.
Removed the INSTANCE. prefix in designer. eg.
Spindle_Extras.frontBeltSelected(1)
[QTvcp.QTVCP.WIDGETS.SIMPLE_WIDGETS][ERROR] (belt_1 called exec in error:'NoneType' object is not subscriptable (simple_widgets.py:615)
[QTvcp.QTVCP.WIDGETS.SIMPLE_WIDGETS][WARNING] Command was Spindle_Extras.frontBeltSelected(1) (simple_widgets.py:616)
[QTvcp.QTVCP.LIB.KEYBINDINGS][DEBUG] Exception in KEYBINDING: no function name conversion for QT Event: '<unknown - 16777251>' (keybindings.py:27
The belts selected are now being saved so its not all bad
Please Log in or Create an account to join the conversation.
Removed the Spindle_Extras prefix and behaviour is the same
eg. format now frontBeltSelected(2)
[QTvcp.QTVCP.WIDGETS.SIMPLE_WIDGETS][ERROR] (belt_2 called exec in error:'NoneType' object is not subscriptable (simple_widgets.py:615)
[QTvcp.QTVCP.WIDGETS.SIMPLE_WIDGETS][WARNING] Command was frontBeltSelected(2) (simple_widgets.py:616)
false command
Please Log in or Create an account to join the conversation.
INSTANCE.backBeltSelected(8)
I think I must be done!
Please Log in or Create an account to join the conversation.
When u got the panel just the way you like, I'd like to add it to the builtin panels - seems pretty useful.
Please Log in or Create an account to join the conversation.