PDA

View Full Version : NetRemote - actions changed



28seven
February 18th, 2010, 07:34 PM
i am running NetRemote 2.0.0.17. i have been doing some work in it for the past few days, and everything was working. when i opened the ccf file last night in netremote i found a good number of the buttons had stopped working. after checking out the actions i found that on all the buttons that stopped working the actions changed from a girder, "send event to girder" action to a IR action. and it is sending out the old event string as ir, or trying to at least.

is this a known bug? anyway to fix without manually reprograming each button cff and lua attached

Rob H
February 19th, 2010, 02:49 PM
I'm not aware of such a bug, I'll have to see if I can work out how that could happen.

Rob H
February 23rd, 2010, 06:18 AM
Sorry to take so long to get back to you on this.

Can you give me an example of a button that has transformed a Girder event action to an IR action? I can't find any.

I did spot something though but in the Lua - you have the following code in the .lua file



--Girder Sync
local girderPlugin = NetRemote.GetPlugin("Girder"):GetCurrentInstance()
NetRemote.RegisterVariableWatch("Did", girderPlugin)


It really isn't safe to do that in the body of the Lua code - it should be in the OnCCFLoad() function to guarantee that the Girder plugin has been initialised.

Similarly with the animation code near the start of the file. When you first load up NetRemote these may fail.

Rob H
February 23rd, 2010, 07:47 AM
Ok, I think I've worked out how this happens.

If you have a plugin action that is targeted to a specific plugin instance and the copy of NetRemote that NRD is connected to no longer has that instance for some reason, e.g. you've deleted it or assigned a different plugin ID to it (or maybe that copy of Girder isn't running?), then this can cause the problem you've seen. The solution is to reinstate the plugin instance with the correct id (e.g. enable auto-discovery and right click on the instance to set the id). If you edit the IR action you should see a number such as -2101 - that is the plugin instance id.

28seven
February 23rd, 2010, 08:31 PM
ya that is defiantly it. i have been doing alot of offsite/onsite programing, connecting to different instances for testing. can i make an action that. seting the instance fixed it. can i have a send event without an instance? i dont think i will have a situation when i need to have more then one at a time

also i was about to ask about the get current instance because it always causes an error on first load. i add the OnCCFLoad function to my file? or do i need to edit another lua?

anything else that looks problematic?

Rob H
February 24th, 2010, 06:01 AM
I'd generally recommend using the default -1 instance rather than coding against specific instances unless you really need to control multiple instances.

dsmes
February 24th, 2010, 10:23 PM
I'd generally recommend using the default -1 instance rather than coding against specific instances unless you really need to control multiple instances.Rob, I'm confused because you once told me:
You shouldn't have a real -1 instance of the girder plugin - the -1 instance is the default instance. If it's showing up as a real instance in the list of plugins then please delete it.I've therefore been changing my CCF actions to target instance -2501 (Girder on machine 1) and -2601 [Girder on machine 2 as listed below the NR/Settings/Plugins Girder (-1) plugin]. Or are you saying a button (or IR) action that targets the -1 Girder plugin will send an event to ALL real machine instances listed under the Girder plugin?

Rob H
February 25th, 2010, 02:58 AM
All plugins have a current instance which is known by two different ids, the assigned id e.g. -2501 and the default id for the plugin e.g. -1 for the Girder plugin. The -1 instance is an alias for whichever instance happens to be current, this is why it is inadvisable to have an instance that has been assigned the id of -1 explicitly.

dsmes
February 25th, 2010, 05:20 AM
Thanks for the explanation; the first part makes sense. For the second part, I read that to say a button action or Lua script that sends an event to the -1 Girder instance will send that event to all real instances e.g. event will be sent to both -2501 and -2601 in my example provided both are current instances. Can both instances be current or can there only be one current instance?

Rob H
February 25th, 2010, 05:40 AM
No, you can only have a single current instance, so sending an event to the default instance will still only send it to that one instance.

If you really want to broadcast an event to multiple instances then you can use Lua.

BTW the next build of NetRemote will prevent you from setting an instance id to the default instance id for the plugin (however it won't change a pre-existing erroneous instance id).