- Posts: 233
- Thank you received: 0
pyVCP Documents
I was wondering... since <bg> was short for background... would't <fg> would work for foreground??
I searched for <fg>... but it returned NO MATCH anywhere in the manual. I tried it anyway, and it worked.
I just thought you may want to add that information as it seemed to be missing.
linuxcnc.org/docs/html/hal/pyvcp.html#_label
Panel Screenshot...
Attachment not found
Please Log in to join the conversation.
JT
Please Log in to join the conversation.
<bar>
<halpin>"my-bar"</halpin>
<min_>0</min_>
<max_>150</max_>
<bgcolor>"grey"</bgcolor>
<fillcolor>"red"</fillcolor>
<range1>0,100,"green"</range1>
<range2>101,135,"orange"</range1>
<range3>136, 150,"red"</range1>
</bar>
Look at the three ranges...
<range1>0,100,"green"</range1>
<range2>101,135,"orange"</range1>
<range3>136, 150,"red"</range1>
I was chasing code until I realized they should have range 1,2,3 not 1,1,1. :blink:
Please Log in to join the conversation.
JT
Please Log in to join the conversation.
First off... here is the document reference: linuxcnc.org/docs/html/hal/pyvcp.html#_multi_label
This is the example right from the page... it fails.
1) You need commas between the legends.
2) The document makes it sound like you send it a number and it reacts to that... not quite... I'll explain.
I created a multilable called "my-multi-label" and found that when I looked up the pins while in AXIS using the HAL CONFIGURATION... what I actually found was...
- pyvcp.my-multi-label.legend0
- pyvcp.my-multi-label.legend2
- pyvcp.my-multi-label.legend1
So I needed to create THREE buttons, one tied to each state...
This worked perfectly... and I could select from the three states that I created.
But that wasn't enough... oh no... I had to push the envelope...
Could it handle color?
Text wrapping? (That would be cool huh?)
So... this is what I got... in my default panel blue too...
I tied these together in the postgui file...
And it all works... the colors, the wrapped text, everything.
NOTE: The multilable will latch... it will stay in the last state you select... so clicking the button will set it, releasing the button has no effect... not until another button is pressed. (Or it gets another signal by whatever means.)
So now... I'll see if I can't pass data from my G-Code to this label.. things like instructions... then when they click the button... "WARNING - THE SPINDLE IS ABOUT TO START"
I hope you found this helpful.
Jerry
Please Log in to join the conversation.
I found another one for you to update... the multilabel.
First off... here is the document reference: linuxcnc.org/docs/html/hal/pyvcp.html#_multi_label
This is the example right from the page... it fails.
<multilabel>
<legends>["Label1" "Label2" "Label3" "Label4" "Label5" "Label6"]</legends>
<font>("Helvetica",20)</font>
<disable>False</disable>
</multilabel>
1) You need commas between the legends.
You are quite right.
When I wrote multilabel, the original test xml file snippet was as below
Somehow that comma separation didn't get into the docs
Don't know if it was a typo or some weird interaction in conversion from text to asciidoc to html.
Hopefully JT can easily amend without a PR
regards
Please Log in to join the conversation.
Also... I don't get the <disable_pin>True</disable_pin> part... don't you want to have a pin to pass the information to???
Or am I missing the context of the pin?
Thanks,
Jerry
Please Log in to join the conversation.
It still has the incorrect sample for the bar. (As of 8 NOV 2015)
<bar>
<halpin>"my-bar"</halpin>
<min_>0</min_>
<max_>150</max_>
<bgcolor>"grey"</bgcolor>
<fillcolor>"red"</fillcolor>
<range1>0,100,"green"</range1>
<range2>101,135,"orange"</range1 >
<range3>136, 150,"red"</range1 >
</bar>
Also, reference: linuxcnc.org/docs/html/hal/pyvcp.html#_buttons
It does not include the <fg> attribute.
I think you may have updated your local documents... but not yet uploaded them to the public.
Jerry
Please Log in to join the conversation.
It is also missing the <halpin>name</halpin> assignments... without those how would you pass information to it.
They are not missing, just not listed. If not specified it defaults to 'multilabel' in the same way as all the widgets default to the widget name.
Also... I don't get the <disable_pin>True</disable_pin> part... don't you want to have a pin to pass the information to???
Or am I missing the context of the pin?
Yes, you are missing the point of it.
The disable field creates a disable pin, with which you can disable the widget (greyed out typically, depends upon your display manager etc)
regards
Please Log in to join the conversation.
Here is the XML from a section of my PECK DRILL pyvcp panel...
The label is then associated with PROGRAM... if it is running or if it is idle.
Here is the section of my postgui file...
And here is the panel in operation...
Attachment not found
Attachment not found
Please Log in to join the conversation.
