So, I guess I managed to get it working, here is the resulting code:






































*ColumnLayout {        anchors.fill: parent        anchors.margins: 
5        Service {            id: halrcompService            type: 
"halrcomp"        }        Service {            id: 
halrcmdService            type: "halrcmd"        }        
HalRemoteComponent {             halrcmdUri: halrcmdService.uri             
halrcompUri: halrcompService.uri             ready: (halrcmdService.ready 
&& halrcompService.ready) || (state === 
HalRemoteComponent.Connected)             name: "anddemo"             
containerItem: anddemo         }         HalButton {             
Layout.alignment: Layout.Center             name: "button0"             
text: "Button 0"             checkable: true             visible: 
false         }         HalButton {             Layout.alignment: 
Layout.Center             name: "button1"             text: "Button 
1"             visible: false         }         HalLed {             
Layout.alignment: Layout.Center             name: "led"         }*
*    }*
However, it only works when I instantiate every single pin present in the 
hal component. I wonder if there is anything I could do so that I wouldn't 
need to enforce this one-to-one requirement. I mean, lets say that I would 
like to create a single led to represent the spindle status, say 
motion.spindle-on. 
Correct me if I am wrong, but, I would have two options:
1 - Instantiate every pin present in the motion component in the QML file;
2 - Create a new component, with a single pin and hardwire it to the 
motion.spindle-on and read this single component's pin.

Since both seems sub-optimal, I wonder if there would be another, simpler 
way, for me to get it done.

Paulo Sherring.


Em sexta-feira, 22 de março de 2019 17:30:19 UTC-3, Paulo Sherring escreveu:
>
> Hey there! I am new to QtQuickVCP - just got working a few apps, such as 
> Cetus and the AndDemo. 
> I am trying to add a Tab to Cetus, which would present a few redundant 
> values, such as spindle status, speed, some halui (whose are internal to 
> machinekit stack) and a few custom defined pins.
> I have successfully compiled Cetus and Anddemo UI. However, I still didn't 
> manage to get these working. 
> For instance, I would like to create a tab containing a LED which 
> represents the "motion.spindle-on" pin (The following code was patched from 
> the PrinterTab.qml):
>
> Tab {
>     id: testingTab
>     title: qsTr("Testing")
>     active: true
>     ColumnLayout {
>         anchors.fill: parent
>         anchors.margins: 5
>
>         Service {
>             id: halrcompService
>             type: "halrcomp"
>         }
>         Service {
>             id: halrcmdService
>             type: "halrcmd"
>         }
>         HalRemoteComponent {
>             halrcmdUri: halrcmdService.uri
>             halrcompUri: halrcompService.uri
>             ready: (halrcmdService.ready && halrcompService.ready) || 
> (state === HalRemoteComponent.Connected)
>             name: "testingui"
>             containerItem: testingTab
>         }
>         Label {
>             text: qsTr("Spindle On:")
>         }
>
>         HalLed {
>             name: "motion.spindle-on"
>         }
>     }
> }
>
> Thanks in advance for any tip!
> Paulo Sherring.
>

-- 
website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
https://github.com/machinekit
--- 
You received this message because you are subscribed to the Google Groups 
"Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to