PDA

View Full Version : NR model.object.id?



yonu
October 20th, 2015, 01:55 PM
how to the NR model.object.id match up the the girder device and control IDs?

Thanks,
Yonu

yonu
October 20th, 2015, 02:18 PM
what I am trying to do is use this piece of code (which I do have all the other requiements in my qml file) to only point to a specific label I just can't figure out what to point it at.




Label {
visible: isControl && model.object.dtype === Promixis.Control.LABEL
enabled: visible
anchors.right: parent.right;
anchors.verticalCenter: parent.verticalCenter
anchors.rightMargin: 5
caption: qsTr(model.object.dConfig.formatString).arg(model. object.value ? model.object.value : "")
}



Thanks,
Yonu

Ron
October 20th, 2015, 02:23 PM
maybe add it to the visible line ? && model.object.id == 123123

yonu
October 20th, 2015, 02:29 PM
ok based on that I just tried

visible: isControl && model.object.dtype === Promixis.165.LABEL
and
visible: isControl && model.object.dtype === Promixis."165".LABEL


and both result in a blank NR screen am I missing something?

Thanks,
Yonu

Ron
October 20th, 2015, 02:48 PM
Yeah that is a syntax error. Use debugview from microsoft to see errors from NetRemote QML scripting.

Try this:

visible: isControl && model.object.dtype === Promixis.Control.LABEL && model.object.id == 165

yonu
October 20th, 2015, 02:55 PM
ok I used the cpde you provided an I don't get an error however don't get the proper caption or value I just get asdf what else should I change?

Thanks,
Yonu

Ron
October 20th, 2015, 03:09 PM
"asdf" :) first make sure the 165 is correct for the *control*

yonu
October 20th, 2015, 03:11 PM
The 165 is the control I'd listed in devicemanager

Yonu

yonu
October 20th, 2015, 04:45 PM
does this have anything to do with it? it is the data from debugview



[448] file:///C:/Program Files/Promixis/Girder 6/ui/test/dm.qml:435: ReferenceError: isControl is not defined


this is line 435
visible: isControl && model.object.dtype === Promixis.Control.LABEL && model.object.id == 166

Ron
October 22nd, 2015, 11:30 AM
Possible. Try changing to

visible: model.object.type === Promixis.DMObject.CONTROL && model.object.dtype === Promixis.Control.LABEL && model.object.id == 166

note that you have id 166 there. Can you attach a screenshot of the device manager with the control clicked/highlighted?

yonu
October 22nd, 2015, 01:40 PM
I can but 166 and 165 both exist they are both labels for the same device.
6926

Thanks,
Yonu

yonu
October 23rd, 2015, 08:22 PM
no joy with the line you supplied?

yonu
October 24th, 2015, 08:00 AM
I am playing with kv values as an alternate option however is there away to not get a blank box on NR loading until the script updates

Yonu

Ron
October 24th, 2015, 08:32 PM
You can use the "isDefined" property of the KV value to set the visibility of the box.

yonu
October 24th, 2015, 09:27 PM
ok thanks

yonu

yonu
October 30th, 2015, 08:51 PM
question is thier a way to track the variable changes as they happen between girder and netremote in more detail than debugview?

Thanks,
Yonu