- Posts: 28
- Thank you received: 0
FlexGui touch - FSC-like myOwn tab from ext UI file
1 year 1 month ago #334752
by ts
FlexGui touch - FSC-like myOwn tab from ext UI file was created by ts
Hello
Im trying to include my own tab to flex gui touch (great wotks! Thanks to author!). I see that already there fsc_container which corresponds to /usr/lib/libflexgui/fsc.ui and now i wanna to add my own tab - for example i have some rs232 device to read some parameters (thc, edm for example, device already connected to hal via user space component linuxcnc). And i dont understand how to include thc.ui to the tab like dsf / fsc ?
Im trying to include my own tab to flex gui touch (great wotks! Thanks to author!). I see that already there fsc_container which corresponds to /usr/lib/libflexgui/fsc.ui and now i wanna to add my own tab - for example i have some rs232 device to read some parameters (thc, edm for example, device already connected to hal via user space component linuxcnc). And i dont understand how to include thc.ui to the tab like dsf / fsc ?
Please Log in to join the conversation.
1 year 1 month ago #334878
by JT
Replied by JT on topic FlexGui touch - FSC-like myOwn tab from ext UI file
The simple way is to just create your tab in the ui and add your widgets then using the Python module connect all of your widgets to your Python code.
gnipsel.com/linuxcnc/flexgui/python.html
github.com/jethornton/flexgui/blob/maste...gui/startup.py#L2381
github.com/jethornton/flexgui/blob/maste...rc/libflexgui/tpc.py
JT
gnipsel.com/linuxcnc/flexgui/python.html
github.com/jethornton/flexgui/blob/maste...gui/startup.py#L2381
github.com/jethornton/flexgui/blob/maste...rc/libflexgui/tpc.py
JT
Please Log in to join the conversation.
1 year 1 month ago #335327
by ts
Replied by ts on topic FlexGui touch - FSC-like myOwn tab from ext UI file
Hi,
JT thanks for your reply.
additional for this situation question. I have two sliders. Usong Slider1 user may choose value 10..20. slider2 could be 0..100 . But if slider1 is more than 15, Slider2 could be only 80..100.
How i may realise this?
Thanks in advance.
JT thanks for your reply.
additional for this situation question. I have two sliders. Usong Slider1 user may choose value 10..20. slider2 could be 0..100 . But if slider1 is more than 15, Slider2 could be only 80..100.
How i may realise this?
Thanks in advance.
Please Log in to join the conversation.
1 year 1 month ago #335328
by JT
Replied by JT on topic FlexGui touch - FSC-like myOwn tab from ext UI file
That would have to be done in your custom Python code using the sliders valueChanged() signal to trigger a call to your function and use the setMinimum() function of the slider to change the minimum set point.
JT
JT
Please Log in to join the conversation.
1 year 1 month ago #335330
by JT
Replied by JT on topic FlexGui touch - FSC-like myOwn tab from ext UI file
I just tried this and it works fine
Code:
from functools import partial
def startup(parent):
parent.slider_1.valueChanged.connect(partial(slider_1, parent))
parent.slider_2.valueChanged.connect(partial(slider_2, parent))
def slider_1(parent):
parent.label_1.setText(f'{parent.slider_1.value()}')
if parent.slider_1.value() >= 15:
parent.slider_2.setMinimum(80)
else:
parent.slider_2.setMinimum(0)
def slider_2(parent):
parent.label_2.setText(f'{parent.slider_2.value()}')
Please Log in to join the conversation.
1 year 1 month ago #335331
by JT
Replied by JT on topic FlexGui touch - FSC-like myOwn tab from ext UI file
Please Log in to join the conversation.
1 year 1 month ago #335477
by ts
Replied by ts on topic FlexGui touch - FSC-like myOwn tab from ext UI file
Hi, JT!
thanks a lot.
Its works fine.
Also im used parent.slider1.setSliderPosition(int) for setting needed value with 'if' to controlling the range without changing min/max.
Best regards
thanks a lot.
Its works fine.
Also im used parent.slider1.setSliderPosition(int) for setting needed value with 'if' to controlling the range without changing min/max.
Best regards
Please Log in to join the conversation.
Time to create page: 0.214 seconds
