Re: [Instrumentelem-developer] Plugins..
Brought to you by:
francesco-lelli
|
From: Navid A. <ah...@us...> - 2009-08-11 07:54:20
|
Hi, > > Then Sohrab can load them into the environment. Not to forget, for > the setParameters instruction, since the dataType is also being > generated on the fly, > > I didn't exactly understand what you mean by setParameters > Instruction. The way I imagined it is like this: > The service will provide a list of available commands as "PlugIn" > XMLs (similar to the generic template you showed me, which I know is > called VID) to the UI at the time when the UI loads. Using these > plugins, the UI will generate the "visual" plugins inside the UI. > The commands will allow some parameters of some particular types. So, IE(instrument element) returns us commands (using getCommands) and parameters (using getParameters). For each command we create a VID plugin, as you already know. What is left is parameters. Now, I assume we will have many parameters (10 or more for sensors, motors, etc). for setting each parameter we do not want to have one single instruction. Instead, we have to add one general VID insturction (let's call it setParameters) to our UI environment, where users can choose the parameter from a drop-down box and set its value. The instruction UI looks like this: now, we know we always have such an instruction for all the devices. Therefore, unlike other instructions(plugins) that are being generated on-the-fly, we can create a single XML file inside our project directory and load it whenever we wan. > > Alimur has to develop the VDT on-the-fly generation (similar to the > VID generation), and Sohrab has to develop similar initFromText in > VDT.js as well to make it work for setParameter. > > "VDT on-the-fly generation" - it is not clear. I talked to Sohrab > yesterday and I think he also has some confusion. > > Currently I am able to generate arrays containing the VIDs for the > available commands I get from the device, in my index.html. > > In the mean time, I still have some things to do in the server side > and for that I am working with Krzysztof's codes. > > Hope you are enjoying over there :-) take care. > Now, look again on the setParameters instruction(plugin). What part has to be generated on-the-fly from the information coming from the device(lego)? For sure the parameter list comes from the device. i.e., first we call the instrument Element getParameters() which returns the list of the parameters of the device. Then we have to generate the Drop box that you can see in the UI. That drop box is a VDT (Visual Data Type) that in this case is a list of parameters. This VDT has to be generated on the fly. For an example of VDT look at VDTNumber.XML. in VDTNumber we create an empty text box. Here we have to create an HTML list box filled with the names of the paramters. We can call it VDTDeviceParams. Similar to generating VID plugins, you to generate this VDT plugin, which will be loaded into the setParameters instruction. shortly, we need: 1- one fixed VIDSetParameter.XML which is the definition of the UI above and has two inputs, a VDTDeviceParams, and a VDTValue, which is just a simple text box. 2- A VDTParams.XML which is a VDT for UI of a Drop-down box, but empty. It has to be read and loaded into the memory and the items list has to be filled with the name of parameters coming form the instrument element getParameters(). I hope it makes it clear for you. Navid > -- Alimur > > > 2009/8/3 Navid Ahmadi <ah...@us...> > Good Job!, > > Alimur, Did you get the Proxy working? it has to be working to be > able to connect AgentWeb project to IE project. Right? > > > The next Step: > Sohrab, Alimur is generating some VIDs(Visual Instructions) on the > fly, which are basically the instructions to load inside the > programming environment so that End-user can control the > device(Device=Lego now). Now, instead of having these VIDS in XML > files, we have the XML text in memory. Therefore, we need another > init() method in VID that loads the XML text as an XML doc and > passes it to the parseVIDDefinition mehtod. There is no need for > overloading. Sohrab can create a method like > initFromMemory(XMLText). Then You can both sit together and create > an instance of the element to see if the instruction (plugin) is > well generated. Look at the VIDTest file as an example.Then Sohrab > can load them into the environment. Not to forget, for the > setParameters instruction, since the dataType is also being > generated on the fly, Alimur has to develop the VDT on-the-fly > generation (similar to the VID generation), and Sohrab has to > develop similar initFromText in VDT.js as well to make it work for > setParameter. > > I am excited to see the instructions loaded automatically into the > programming environment of end users. > Navid > > > On Aug 3, 2009, at 3:20 PM, Alimur Rashid wrote: > > Hello Navid, > > I am working on plugin generation for your UI. I was having some > difficulty working with the code you gave me. Finally, it works, I > had to modify the regular expression. > > Now, I have an array containing all the plugin XMLs, customised for > each of the command I get from the SOAP response. > > I think it's time for me and Sohrab to sit together and try to test > it with your UI. > > What do you think? > > Take care. > > -- Alimur > > |