Hi Jia,

The error you are getting is that the HAL component signature does not
match the remote version of the HAL remote component. In your case this
probably means that the HalLeds are created after the
HalApplicationWindow component searches for HalPins in its child items.

In this case it might be necessary to use a ServiceWindow instead. The
HalApplicationWindow is convenience Component that combines a
HalRemoteComponent and a ServiceWindow. You cannot control when the
HalRemoteComponent looks for pins in this case.

So the way to do this would be to create a ServiceWindow (see
BasicQtQuickVcp for an example) and a HalRemoteComponent (you can take a
look at the HalRemoteComponentWindow implementations itself for a
reference:
https://github.com/machinekoder/QtQuickVcp/blob/master/src/halremotecontrols/HalApplicationWindow.qml#L296)

and then set ready property of the HalRemoteComponet with
Component.onComplete of the top level ServiceWindow. This ensures that
the HalRemoteComponent is started after the Repeater does its work.

--
Alexander

maxh...@araisrobo.com writes:

> Hi Alexander ,
>
> Yishin and I are the same team.
> The question now, HAL can not correct link.
> The following source code:
> Tab {
>     id: signaltab
>     anchors.top:parent.top
>     title: qsTr("Signals")
>     active: true
>
>     HalApplicationWindow{
>         id: main
>         title: "My HAL application"
>         name: "signals"
>
>         Repeater {
>             model: 8
>                 HalLed {
>                     name: "gpio.in." + index
>                 }
>             }
>         }
> }
>
>
> Jia li
>
> Alexander Rössler於 2015年9月9日星期三 UTC+8上午9時46分41秒寫道:
>>
>> Actually Machineface uses a Repeater to create some user interface 
>> elements: 
>>
>> https://github.com/strahlex/Machineface/blob/master/Machineface/DisplayPanel.qml
>>  
>>
>> The key is that the Repeater needs to be loaded at start-up. So in case 
>> you have placed the snipped inside a Tab you need to set the active 
>> property to true in order to make it work. 
>>
>> So your code should be fine. What error do you get? 
>>
>> Yishin Li writes: 
>>
>> > We would like to create an array of HalLed for GPIO signals. The 
>> following 
>> > is our code snippet: 
>> >            Row { 
>> >                 Repeater { 
>> >                     model: 8 
>> >                     Rectangle { 
>> >                         width: 100; height: 40 
>> >                         border.width: 1 
>> >                         color: "yellow" 
>> >                         HalLed { 
>> >                             name: "gpio.in."+index 
>> >                         } 
>> >                     } 
>> >                 } 
>> >             } 
>> > We stuck at binding HAL signals for HalLed with above syntax. 
>> > Is there a reference code for creating an array of HAL components with 
>> > "Repeater" syntax? 
>> > 
>> > -Yishin 
>>
>> -- 
>> Alexander 
>>


-- 
Alexander

-- 
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 machinekit+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to