Difference between revisions of "Component database XML format"

From OpenRocket wiki
Jump to navigation Jump to search
m (1 revision: Import existing wiki English pages)
Line 1: Line 1:
Ideas for the design of an XML format for component databases.
+
Design of an XML format for component database.
  
Please clean this up, it's horribly messy...
+
A serialized database of components is created by reading one or more XML files that contain components.  
  
 +
<OpenRocketComponent> - base container element, surrounds everything
  
<componentdatabase> - base container element, surrounds everything
+
(Manufacturers is not implemented in version 0.1)
  
 +
<Manufacturers> - list of manufacturers used in this database file
 +
: <Manufacturer id="mfgid"> - definition of a single manufacturer
 +
::: (id must be unique within this file, does not need to be globally unique)
 +
:: <DisplayName> - a short display/common name of the manufacturer
 +
:: <FullName> - the full name of the manufacturer
 +
:: <URL> - Manufacturer URL
 +
:: <LogoURL> - Link to Manufacturer's logo, must be of size xx by yy pixels.
 +
: <Manufacturer>
 +
<Manufacturers>
  
<manufacturers> - list of manufacturers used in this database file
+
<Materials> - list of materials used in this database file
 +
: <Material UnitsOfMeasure="{text}">
 +
:: <Name lang=""> {text} </Name>
 +
:: <Density> {float} </Density>
 +
:: <Type> {BULK | SURFACE | LINE} </Type>
 +
: </Material>
 +
</Materials>
  
<manufacturer id="mfgid"> - definition of a single manufacturer<br>
+
* Are materials really needed?  For most components the total mass should be known, and the best way to use it is to compute the component density from the mass.  This allows the user to modify the component (e.g. shorten a body tube) and the mass changes correspondingly.
(id must be unique within this file, does not need to be globally unique)
 
  
<displayname> - a short display/common name of the manufacturer<br>
 
<fullname> - the full name of the manufacturer<br>
 
<url> - Manufacturer URL<br>
 
<logo> - Manufacturer logo (? - maybe a bit problematic)
 
  
 +
<Components>
  
<materials> - list of materials used in this database file
+
: < common to all components, inside each of those elements >
 +
:: <Manufacturer>Estes</Manufacturer>
 +
:: <PartNumber>PNC-80FB</PartNumber>
 +
:: <Description>Estes PNC-80 Fat Boy profile cone</Description>
 +
:: <Material Type="BULK">Polystyrene PS</Material>
 +
:: <Mass Unit="kg">0.035892</Mass>
 +
: < /common to all components, inside each of those elements >
  
<material id="matid"><br>
+
<BodyTube>
<name lang=""><br>
+
EngineBlock
<type>bulk|surface|line</type><br>
+
LaunchLug
<density>
 
  
* Are materials really needed?  For most components the total mass should be known, and the best way to use it is to compute the component density from the mass.  This allows the user to modify the component (e.g. shorten a body tube) and the mass changes correspondingly.
+
<NoseCone>
  
 +
            <Shape>ELLIPSOID</Shape>
 +
            <OutsideDiameter Unit="m">0.06604</OutsideDiameter>
 +
            <ShoulderDiameter Unit="m">0.064922</ShoulderDiameter>
 +
            <ShoulderLength Unit="m">0.0381</ShoulderLength>
 +
            <Length Unit="m">0.1016</Length>
 +
            <Thickness Unit="m">0.003175</Thickness>
 +
</NoseCone?
  
<components>
+
Parachute
 +
Streamer
 +
TubeCoupler
 +
<Transition>
  
<bodytube>
 
 
Common data:
 
Common data:
  
Line 41: Line 67:
 
<diameter><br>
 
<diameter><br>
 
<length><br>
 
<length><br>
...
+
 
 +
</Components>

Revision as of 11:15, 9 June 2013

Design of an XML format for component database.

A serialized database of components is created by reading one or more XML files that contain components.

<OpenRocketComponent> - base container element, surrounds everything

(Manufacturers is not implemented in version 0.1)

<Manufacturers> - list of manufacturers used in this database file

<Manufacturer id="mfgid"> - definition of a single manufacturer
(id must be unique within this file, does not need to be globally unique)
<DisplayName> - a short display/common name of the manufacturer
<FullName> - the full name of the manufacturer
<URL> - Manufacturer URL
<LogoURL> - Link to Manufacturer's logo, must be of size xx by yy pixels.
<Manufacturer>

<Manufacturers>

<Materials> - list of materials used in this database file

<Material UnitsOfMeasure="{text}">
<Name lang=""> {text} </Name>
<Density> {float} </Density>
<Type> {BULK | SURFACE | LINE} </Type>
</Material>

</Materials>

  • Are materials really needed? For most components the total mass should be known, and the best way to use it is to compute the component density from the mass. This allows the user to modify the component (e.g. shorten a body tube) and the mass changes correspondingly.


<Components>

< common to all components, inside each of those elements >
<Manufacturer>Estes</Manufacturer>
<PartNumber>PNC-80FB</PartNumber>
<Description>Estes PNC-80 Fat Boy profile cone</Description>
<Material Type="BULK">Polystyrene PS</Material>
<Mass Unit="kg">0.035892</Mass>
< /common to all components, inside each of those elements >

<BodyTube> EngineBlock LaunchLug

<NoseCone>

           <Shape>ELLIPSOID</Shape>
           <OutsideDiameter Unit="m">0.06604</OutsideDiameter>
           <ShoulderDiameter Unit="m">0.064922</ShoulderDiameter>
           <ShoulderLength Unit="m">0.0381</ShoulderLength>
           <Length Unit="m">0.1016</Length>
           <Thickness Unit="m">0.003175</Thickness>

</NoseCone?

Parachute Streamer TubeCoupler <Transition>

Common data:

<name> - short name of the part (? - is this necessary, or should it just be labeled by mfg and partno)
<partno> - Part number / ID
<description> - longer description of the part
<manufacturer ref="mfgid">
<url> - URL related to the component (? - is this useful)

<diameter>
<length>

</Components>