CS-Lab Support Forum for CNC Community
Help to run this brand-new forum and stay with us.
Ask your questions, we are here to help!
my new screen vertical
Quote from carbonkid on 20 February 2024, 18:07Okay, that seems to be more complicated than the ideas in my head. I actually don't want any further interaction from the user other than ticking the corresponding checkbox. These checkboxes should be queried in the script and if they have the status checked, the Z height, the zero point or both should not be set new (ignored or discarded) but only the measured value should be displayed in the Python console.
In the link you can see the script for measuring the circular pocket. Now I thought you could write the query before the new zero points are made. (Line 91/92 Z height and line 158/159 XY zero point)Maybe something like this: "if(gui.chBox_discardZmeasurement.getCheckboxState == False):
d.setAxisProgPosition(Axis.Z,0+toolSetterHight".....But what next is the question...maybe I'm completely on the wrong track...
Okay, that seems to be more complicated than the ideas in my head. I actually don't want any further interaction from the user other than ticking the corresponding checkbox. These checkboxes should be queried in the script and if they have the status checked, the Z height, the zero point or both should not be set new (ignored or discarded) but only the measured value should be displayed in the Python console.
In the link you can see the script for measuring the circular pocket. Now I thought you could write the query before the new zero points are made. (Line 91/92 Z height and line 158/159 XY zero point)
Maybe something like this: "if(gui.chBox_discardZmeasurement.getCheckboxState == False):
d.setAxisProgPosition(Axis.Z,0+toolSetterHight".....
But what next is the question...maybe I'm completely on the wrong track...
Quote from CS-Lab Support on 21 February 2024, 13:20>> Maybe something like this: "if(gui.chBox_discardZmeasurement.getCheckboxState == False):
>>> d.setAxisProgPosition(Axis.Z,0+toolSetterHight".....Yes, this is the correct solution.
>> Maybe something like this: "if(gui.chBox_discardZmeasurement.getCheckboxState == False):
>>> d.setAxisProgPosition(Axis.Z,0+toolSetterHight".....
Yes, this is the correct solution.
Quote from carbonkid on 22 February 2024, 20:27What should I select for my checkbox to check the status? Here at Output: stateChanged -> setMachineParam is the correct one? Can you then query whether it is true or false?
What should I select for my checkbox to check the status? Here at Output: stateChanged -> setMachineParam is the correct one? Can you then query whether it is true or false?
Uploaded files:Quote from CS-Lab Support on 23 February 2024, 14:31Hello.
There are two ways to read the state of the chBox:
- “if (gui.chBox_setZeroPoint_discard.getCheckboxState()):”
Note that "gui.chBox_setZeroPoint_discard.getCheckboxState()" returns "True" or "False"
2. „if(d.getMachineParam( 8 )):”
We are dealing here with a comparison.
For this method to work, we need to set the number of the parameters in which the chBox state will be stored in the settings for the "chBox_setZeroPoint_discard" object.
For example, I used machine parameter number 8 (the first thousand is non-volatile).
Note that ChBox sets the machine parameter to 0 or 1.
Regards,
Wojtek
Hello.
There are two ways to read the state of the chBox:
- “if (gui.chBox_setZeroPoint_discard.getCheckboxState()):”
Note that "gui.chBox_setZeroPoint_discard.getCheckboxState()" returns "True" or "False"
2. „if(d.getMachineParam( 8 )):”
We are dealing here with a comparison.
For this method to work, we need to set the number of the parameters in which the chBox state will be stored in the settings for the "chBox_setZeroPoint_discard" object.
For example, I used machine parameter number 8 (the first thousand is non-volatile).
Note that ChBox sets the machine parameter to 0 or 1.
Regards,
Wojtek
Quote from carbonkid on 25 February 2024, 18:21Hello, I tested method 1 and what can I say it works great.
The function itself is there but there are still problems with the checkbox.
By default, the checkbox should not be set, the LED should light up red and the zero point should be reset. Only when the checkbox is clicked should it light up green and the zero point should not be reset.
Unfortunately, that's exactly the opposite at the moment. I could turn this around in the GUI editor for the respective checkbox by checking the checkbox state, right?.
So that the corresponding color now lights up, I wanted to create a checkbox in the style.css especially for this purpose, but I don't know exactly how. Can you give me a tip? For the elements with an id or group it was easy - I simply created the element with a new id or group name and adjusted it to my liking. But the checkbox is currently created as global.
Edit:
It didn't leave me alone and now I've managed to create a suitable checkbox in the style css.(picture2)
Hello, I tested method 1 and what can I say it works great.
The function itself is there but there are still problems with the checkbox.
By default, the checkbox should not be set, the LED should light up red and the zero point should be reset. Only when the checkbox is clicked should it light up green and the zero point should not be reset.
Unfortunately, that's exactly the opposite at the moment. I could turn this around in the GUI editor for the respective checkbox by checking the checkbox state, right?.
So that the corresponding color now lights up, I wanted to create a checkbox in the style.css especially for this purpose, but I don't know exactly how. Can you give me a tip? For the elements with an id or group it was easy - I simply created the element with a new id or group name and adjusted it to my liking. But the checkbox is currently created as global.
Edit:
It didn't leave me alone and now I've managed to create a suitable checkbox in the style css.(picture2)
Quote from CS-Lab Support on 27 February 2024, 08:54If something is unclear to you or you feel like I didn't understand you, let me know.
If something is unclear to you or you feel like I didn't understand you, let me know.
Quote from carbonkid on 27 February 2024, 14:51Quote from CS-Lab Support on 27 February 2024, 08:54If something is unclear to you or you feel like I didn't understand you, let me know.
no, no now everything is clear and works as desired. 😉
Quote from CS-Lab Support on 27 February 2024, 08:54If something is unclear to you or you feel like I didn't understand you, let me know.
no, no now everything is clear and works as desired. 😉
Quote from CS-Lab Support on 4 March 2024, 13:57Of course you can, just remember to download and import the correct libraries.
Of course you can, just remember to download and import the correct libraries.