fbpx

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! 

 

Please or Register to create posts and topics.

my new screen vertical

PreviousPage 3 of 3

https://pastebin.com/DMDutyxH

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...

>> Maybe something like this: "if(gui.chBox_discardZmeasurement.getCheckboxState == False):
>>> d.setAxisProgPosition(Axis.Z,0+toolSetterHight".....

Yes, this is the correct solution.

carbonkid has reacted to this post.
carbonkid

Okay, that sounds good, then at least I'm working in the right direction.

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:
  • chBox_State.jpg

Hello.

There are two ways to read the state of the chBox:

  1. “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

 

carbonkid has reacted to this post.
carbonkid

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)

Uploaded files:
  • checkBox.jpg
  • checkBox2.jpg

If something is unclear to you or you feel like I didn't understand you, let me know.

Quote from CS-Lab Support on 27 February 2024, 08:54

If 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. 😉 

Does anyone know whether you can also use customtkinter in scripts or just tkinter?

Of course you can, just remember to download and import the correct libraries.

PreviousPage 3 of 3

PARTNERS:

 

USA

Germany

Slovenia / Bosnia

Spain

South Africa

UNI-CAM

The Netherlands

Portugal

Greece

  Distrib milionis logo

Hungary

Distrib logot

Bulgaria

Master

Kenya

Proteq Automation

Egypt

Germanelectronix

China

Jun Ma

Serbia

ALCO

Italy

LVL tech r

Denmark

Varntoft Dania

Finland

×

Hello!

Click one of our contacts below to chat on WhatsApp

× How can I help you?