WebGui like MrlComm

Ahoy Mates !

It's good to be back on the "develop" branch.... :)

I like the way ArduinoMsgGenerator came out and the generated RPC interface it now has..
It supports the following :

(Java Land)                                                                                                                             
msg.ultrasonicSensorAttach(deviceId, triggerPin, echoPin)

--- serialization -->   and auto-magically calls

(MrlComm Land)
void MrlComm::ultrasonicSensorAttach(byte deviceId, byte triggerPin, byte echoPin) 

with no hand tooled parsing or serialization code, or custom method signatures, etc.. etc..

I'd like to continue this conceptual interface into the webgui controllers.  It is already available in service html files...

Here for example is the clock using this dynamically generated interface to do RPC calls to the Clock service.   message interface example .. 

I want to make this interface available available through the controller as "msg"..
possibly with the same notation as the Java/MrlComm for consistency ..  
e.g.
(in ServoGui.js)
msg.attach(controllerName, pin, velocity)   and it would be a  nice rpc message which would do what you'd expect.   

But I'm raising this post, because I saw some changes and comments that I'd thought I'd ask about..
First thing was I was suprised it was moved off of $scope which I think is a good idea...   but under a "temp" variable ?  Would it be a bad idea to build the generated interface on msg ?

Comment from MaVo 

msg interface being built up under temp

currently I have to access it like this ?

msg.temp.msg.attach( ....    :(


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
MaVo's picture

You should be able to use

You should be able to use msg.remotemethod() in your controller ...

It should be bound to the controller, the important bits should be these:

https://github.com/MyRobotLab/myrobotlab/blob/develop/src/resource/WebGu...

https://github.com/MyRobotLab/myrobotlab/blob/develop/src/resource/WebGu...

( and https://github.com/MyRobotLab/myrobotlab/blob/develop/src/resource/WebGu... ).

I introduced temp as a return value when I dirty-patched the method to be async (I didn't wanted to modify to much of your code).

This place (along many others) should definately be cleaned up. There is also a lot of old,unused code that's still in there. It annoys me that I haven't worked on it for so long, but to clean this up in efficient way Node would be more than helpful ...