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!
Question/suggestion on the GUI editor
Quote from carbonkid on 9 March 2023, 22:05I created a completely new screen. On my machine with Win10 OS I have hidden the taskbar to use the full size of my monitor. But now I can't see the time anymore. Would it be possible to insert the time into the screen with the Gui Editor? The second question would be can i also clear the Python console in the screen? For example how it is possible in the Script Editor.
I created a completely new screen. On my machine with Win10 OS I have hidden the taskbar to use the full size of my monitor. But now I can't see the time anymore. Would it be possible to insert the time into the screen with the Gui Editor? The second question would be can i also clear the Python console in the screen? For example how it is possible in the Script Editor.
Quote from CS-Lab Support on 13 March 2023, 08:03Hello,
>> Would it be possible to insert the time into the screen with the Gui Editor?
It is possible:
1) Add to GUI LineEdit
2) Write a macro that reads the time and saves it to LineEdit with the command gui.edPosX.setText( str v )
edPosX is the LineEdit ID for the X-axis DRO (this is an example).
3) To cycle the macro every second, use a Python action (use the "Timer" trigger)If you feel lost after reading this hint, let me know, I will make a small guide.
>> The second question would be can and also clear the Python console in the screen?
Yes.
Right-click on the python console, and you will see the cleanup option.Wojtek
Hello,
>> Would it be possible to insert the time into the screen with the Gui Editor?
It is possible:
1) Add to GUI LineEdit
2) Write a macro that reads the time and saves it to LineEdit with the command gui.edPosX.setText( str v )
edPosX is the LineEdit ID for the X-axis DRO (this is an example).
3) To cycle the macro every second, use a Python action (use the "Timer" trigger)
If you feel lost after reading this hint, let me know, I will make a small guide.
>> The second question would be can and also clear the Python console in the screen?
Yes.
Right-click on the python console, and you will see the cleanup option.
Wojtek
Quote from carbonkid on 13 March 2023, 22:02I have a macro for the time but I don't know how to display it in Line Edit. But this way I can at least display them in the Python console with a button.
>Yes.
Right-click on the python console, and you will see the cleanup option.Thanks ist works. 😉
But one more question? Can I change colors in the style file without problems? I tried that, but there are always errors. simCNC version is 3.4.22 beta.
Fixed, now it works with the changed colors. There was probably a problem saving the file with Notepad++
I have a macro for the time but I don't know how to display it in Line Edit. But this way I can at least display them in the Python console with a button.
>Yes.
Right-click on the python console, and you will see the cleanup option.
Thanks ist works. 😉
But one more question? Can I change colors in the style file without problems? I tried that, but there are always errors. simCNC version is 3.4.22 beta.
Fixed, now it works with the changed colors. There was probably a problem saving the file with Notepad++
Quote from carbonkid on 15 March 2023, 20:47I have to ask again, it gives me no peace. I created the following macro.
from datetime import datetime
# datetime object containing current date and time
now = datetime.now()
# dd/mm/YY H:M:S
dt_string = now.strftime("%H:%M:%S")
gui.edTime.setText( dt_string)
Then created a PyAction, selected it as Event "Timer" and then selected my macro. Create a LineEdit with the ID "edTime" in the GUI Editor. Unfortunately the time is not displayed. What am I doing wrong?
I have to ask again, it gives me no peace. I created the following macro.
from datetime import datetime
# datetime object containing current date and time
now = datetime.now()
# dd/mm/YY H:M:S
dt_string = now.strftime("%H:%M:%S")
gui.edTime.setText( dt_string)
Then created a PyAction, selected it as Event "Timer" and then selected my macro. Create a LineEdit with the ID "edTime" in the GUI Editor. Unfortunately the time is not displayed. What am I doing wrong?
Quote from alexanderbeese on 16 March 2023, 09:57gui.edTime.setText( dt_string)
put the ID from the EditLine insde
I follow these instructions from th support und it works fine
gui.edTime.setText( dt_string)
put the ID from the EditLine insde
I follow these instructions from th support und it works fine
Quote from carbonkid on 16 March 2023, 12:06ok the problem is solved. For everyone who wants to copy it: The name of the LineEdit must match the one in the macro and the pyaction must be ticked.
ok the problem is solved. For everyone who wants to copy it: The name of the LineEdit must match the one in the macro and the pyaction must be ticked.
Quote from carbonkid on 16 March 2023, 12:18@Wojtek
I have another question. I would like to add a progress bar to my screen to display the spindle speed and feed. Practically what is displayed in the original screen in the edSro or edFro. How do I have to configure the progress bar? I've tried but it doesn't show the right one.
I have another question. I would like to add a progress bar to my screen to display the spindle speed and feed. Practically what is displayed in the original screen in the edSro or edFro. How do I have to configure the progress bar? I've tried but it doesn't show the right one.
Quote from CS-Lab Support on 17 March 2023, 12:52Hi
You probably forgot to set the max value of "ProgressBar"
Here's the modified screen.
Please, test it.https://en.cs-lab.eu/wp-content/uploads/2023/03/screen.zip
Hi
You probably forgot to set the max value of "ProgressBar"
Here's the modified screen.
Please, test it.
https://en.cs-lab.eu/wp-content/uploads/2023/03/screen.zip
Quote from carbonkid on 19 March 2023, 18:49Hi Wojtek, I tested it. It works on feed. I entered the maximum feed as the value, which is also in the settings for motor tuning (helper information). For Input Value I selected current velocity. The current speed is now displayed as a percentage and the block accordingly. With the spindle, the current spindle speed does not work with the input value. I selected the Spindle speed there, and then it worked.
The color of the ProgressBar is light blue. Can I change the color anywhere? I changed the colors of the group ctrlButtons in dark mode for my screen in the style.css but found nothing for the progress bar.
Another question about the Tool Button with LED. I have inserted this and start a script to warm up the spindle. How can I set the LED to flash while the script is running? What do I have to select at Input: LED Interval? There's not a lot of choices there.
Hi Wojtek, I tested it. It works on feed. I entered the maximum feed as the value, which is also in the settings for motor tuning (helper information). For Input Value I selected current velocity. The current speed is now displayed as a percentage and the block accordingly. With the spindle, the current spindle speed does not work with the input value. I selected the Spindle speed there, and then it worked.
The color of the ProgressBar is light blue. Can I change the color anywhere? I changed the colors of the group ctrlButtons in dark mode for my screen in the style.css but found nothing for the progress bar.
Another question about the Tool Button with LED. I have inserted this and start a script to warm up the spindle. How can I set the LED to flash while the script is running? What do I have to select at Input: LED Interval? There's not a lot of choices there.
Quote from carbonkid on 20 March 2023, 20:50Tested again today. When I create a LineEdit with Input: text current spindle speed, nothing is displayed either.
It's the same with your default screen, nothing is displayed there in LineEdit TrueRpm either.
I have no idea what that is. Don't know if you can reproduce that.
Tested again today. When I create a LineEdit with Input: text current spindle speed, nothing is displayed either.
It's the same with your default screen, nothing is displayed there in LineEdit TrueRpm either.
I have no idea what that is. Don't know if you can reproduce that.