go away spammer

Author Topic: Webbot Studio: Create a new device  (Read 2605 times)

0 Members and 1 Guest are viewing this topic.

Offline Cristi_NeaguTopic starter

  • Robot Overlord
  • ****
  • Posts: 165
  • Helpful? 5
Webbot Studio: Create a new device
« on: March 06, 2014, 12:23:04 PM »
Hi.

Does anyone know how we can add a new part to Webbot Studio? I understand you must have a site to store the files on. Does this need to be true if you're creating a local device, just for yourself?

I'm mainly interested on how to create the xml file. The options for ProjectDesigner are pretty self explanatory, but the declaration part is harder to understand.

Thanks.

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Webbot Studio: Create a new device
« Reply #1 on: March 09, 2014, 06:44:03 PM »
In the same way as you can create local(ie without a website) boards and projects then you can also create local device definitions. However: you can only publish a project or board if all of its devices are also published.
As for the xml file: then there is no documentation for this currently - however all is not lost. You can:
1. Look at the other devices (especially if there is already one that is similar to what you need). If you copy an existing one then: remove the uuid attribute (studio will allocate it a new unique one).
2. Look at the xsd that they all reference. This contains comments - although more need adding. You may be using an xml editor that displays these comments from the xsd.

If you have any specific questions then let me know
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Cristi_NeaguTopic starter

  • Robot Overlord
  • ****
  • Posts: 165
  • Helpful? 5
Re: Webbot Studio: Create a new device
« Reply #2 on: March 11, 2014, 10:25:44 AM »
Thanks for the reply.

For now, i got the xml part working, meaning it shows up in Project Designer, and it shows all the right boxes that i wanted. Next is the actual coding part, and that's a bit more straightforward.

However, i do have one question about the xml. I'm making a part file for the MCP23S17 SPI IO expander, and i used as a template the spiEEPROM part files. I don't exactly understand how the values i set in Project Designer are passed to the actual code. For instance, in Project designer, i can set the number of address bytes used to access the eeprom. The xml code for that is:

Code: [Select]
<number-param defVal="2" maxVal="4" minVal="1" name="addr" prompt="Number bytes in address" type="number">
<description>
The number of bytes used to specify an address on the device. Check datasheet.
</description>
</number-param>

In the class declaration, i see the variable addrBytes. How does that "addr" value gets passed to the code?

Edit: completely unrelated, but does WebbotLib Studio support #pragma once in header files?
« Last Edit: March 11, 2014, 11:52:39 AM by Cristi_Neagu »

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Webbot Studio: Create a new device
« Reply #3 on: March 11, 2014, 01:54:27 PM »
Quote
completely unrelated, but does WebbotLib Studio support #pragma once in header files?
That's a compiler directive - so outside of WebbotLib Studio. ie it may be supported by avr-gcc for avr chips but what about other compilers for other chip types? Consult your compiler.

Hard to comment about your 'number-param' as it depends on the parent(s) tags. ie need moe info - PM me if you need to

The spi and i2c eeprom stuff is non-trivial. Simpler spi xml stuff includes spiSonyPS2.xml

In general:
Anything inside your makecpp tag is passed to the constructor of your class/code and so your constructor should expect it.

Stuff outside the makecpp tag is often used in choose tags to change the input panel based on that choice.
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

 


Get Your Ad Here

data_list