Parts XML
The Parts XML
To import parts into the TDS, they can be uploaded as XML through the Desktop Tools software. Such an XML file can be generated by the Desktop Tools from existing parts in the TDS or they can be created individually through scripts or other software.
Note, that this documentation serves to enable custom XML generation for integration of an external toolchain into the Tessonics workflow. An export from Tessonics Desktop Tool might create additional fields that will be omitted here to avoid confusion.
Structure of a parts XML
The top level structure is given as
<parts>
<weld_categories> <!-- Optional -->
<!-- Weld categories used by this part -->
</weld_categories>
<Part>
<!-- General information about a part -->
</Part>
<!-- ... repeated <Part> tags for each part ... -->
<Weld>
<!-- Information about the first weld -->
</Weld>
<!-- ... repeated <Weld> tags for each weld ... -->
<Image>
<!-- Information about an image attached to the part. -->
</Image>
<!-- ... repeated <Image> tags for each image ... -->
<Route>
<!-- Information about a route -->
</Route>
<!-- ... repeated <Route> tags for each route ... -->
</parts>
Parts XML Tags by their name
Please note, that in the following, items oftentimes contain an ID tag. This has internal uses and can be provided upon insertion, however, this is not necessary, as the Tessonics tools will generate the necessary IDs.
The IDs can be used for reference within the XML, as <Part>
, <Image>
, <Weld>
and <Route>
may refer to one another. Upon import a new IDs will be generated by the software.
<parts>
The <parts>
tag opens and closes a part defining XML file. Every definition of a part, weld, image or route must be within this enclosing <parts>
field.
<weld_categories>
Each weld can be assigned to a named weld category for filtering and additional information. Since welds don't necessarily need to be assigned to a weld category, this section is optional.
A full <weld_category>
tag may look like this
<weld_categories>
<Category>
<id>1</id> <!-- unique category id -->
<name>My First Category Name</name> <!-- category name -->
<color>4040FF</color> <!-- category color as RGB value (HEX) -->
</Category>
<Category>
<id>2</id> <!-- unique category id -->
<name>My Second Category Name</name> <!-- category name -->
<color>FFFFFF</color> <!-- category color as RGB value (HEX) -->
</Category>
</weld_categories>
Here every category is listed sequentially as a <Category>
section containing an <id>
, a <name>
and a <color>
tag.
The IDs should be unique and the colors are encoded as hex RGB values. Such values can easily be generated here, for example.
<Part>
The <Part>
tag provides meta data about a part. A full <Part>
may look like this
<Part>
<id>1</id>
<group_id>-1</group_id>
<name>Teil</name>
<created>YYYY-MM-DD HH:MM:SS</created> <!-- Optional -->
<modified>YYYY-MM-DD HH:MM:SS</modified> <!-- Optional -->
<measurement_type>rswa-steel</measurement_type>
<meta /> <!-- Optional -->
</Part>
The <Part>
field contains a unique identifier as <id>
and a <group_id>
. The <id>
is a simple numeric identifier which must be different for every part, while the <group_id>
shows which group this part is assigned to. A value of -1
signifies that no group is associated with this part.
The following tags are rather self-explanatory with <name>
being the part's display name, <created>
and <modified>
being timestamps of the part's creation and last modification.
The <measurement_type>
can be either rswa_steel
, rswa-aluminum
, abis-steel
or abis-aluminum
to have the RSWA sort out the correct measuring routine.
Finally, <meta>
is an optional field for free style text to add additional information to a part.
<Weld>
For each weld on a part, a corresponding <Weld>
section defines the weld's characteristics. A full <Weld>
section may look like this
<Weld>
<id>1</id>
<name>The first weld</name>
<part_id>1</part_id>
<slots>1</slots>
<stack_front>2000</stack_front>
<stack_middle>1500</stack_middle> <!-- Optional -->
<stack_back>2000</stack_back>
<diameter_min>5000</diameter_min>
<diameter_target>7000</diameter_target> <!-- Optional -->
<indentation_min>100</indentation_min> <!-- Optional -->
<indentation_max>500</indentation_max> <!-- Optional -->
<thickness_min>4000</thickness_min> <!-- Optional -->
<thickness_max>5000</thickness_max> <!-- Optional -->
<robot>R2-D2</robot> <!-- Optional -->
<schedule>My Main Schedule</schedule> <!-- Optional -->
<meta>My Meta</meta> <!-- Optional -->
<category_id>1</category_id> <!-- Optional -->
</Weld>
Similar to before, the <id>
tag is a numeric identifier, and <name>
represents the weld's display name. <part_id>
must correspond to the <id>
tag under the associated <Part>
section.
<slots>
may either be 1
or 2
, meaning 2T or 3T, respectively.
The three tags <stack_front>
, <stack_middle>
and <stack_back>
define the weld layer thicknesses of the top, center and bottom layer in µm, respectively.
<diameter_min>
and <diameter_target>
represent the weld's minimal size and an optional target size that is tested against, given in µm. The diameter_min value must be between 100
and 15000
.
<indentation_min>
/ <indentation_max>
defines the margin of how much the electrodes may push into the material, given in µm.
<thickness_min>
/ <thickness_max>
defines the margin for the full residual material thickness in µm after a weld.
<robot>
, <schedule>
, <meta>
are descriptive fields to give additional filtering options for a part.
<category_id>
must correspond to the weld category this weld belongs to or set to 0
otherwise.
<stack_middle>
, <diameter_target>
, <indentation_min>
, <indentation_max>
, <thickness_min>
, <thickness_max>
, <robot>
, <schedule>
, <meta>
and <category_id>
are optional fields and can be omitted or left empty, if not needed.
<Image>
<Image>
<id>1</id>
<part_id>2</part_id>
<width>800</width> <!-- limited to 1400px -->
<height>1000</height> <!-- limited to 1000px -->
<position>1</position>
<crc32>-440858849</crc32>
<thumbnail>...thumbnail_data...</thumbnail>
<data>...image_data...</data>
<meta /> <!-- Optional -->
<HotSpot>
<!-- hotspot section -->
</HotSpot>
<!-- repeated for every hotspot -->
</Image>
The image data corresponding to the part are stored under the <Image>
field. Multiple images require multiple such fields.
Each image is identified by its <id>
and associated to a part via the respective <pard_id>
.
<width>
and <height>
denote the images dimensions in pixels. <position>
specifies the images order. The first image receives the position index 1.
The <crc32>
field contains a CRC32 checksum over the image data. How this checksum can be generated, a reference implementation and a calculator are given at crc32.online.
The actual image is stored in <thumbnail>
with reduced quality for sidebar previews and similar uses and again in <data>
with original
quality. Both fields store the image data in .PNG
-format as base-64 encoded strings.
Note, that the image might be subject to compression if the pixel size exceeds the limits of 1400x1000px
.
The <HotSpot>
section contains information about the location of hot spots on the displayed part image. It is explained in detail in <Hotspot>
Finally, the <meta>
tag can be used for additional information.
<HotSpot>
The <HotSpot>
section contains information about the location of hot spots on a given part image. Each hot spot needs
its own <HotSpot>
section. A full <Hotspot>
section may look like this
<HotSpot>
<id>7</id>
<image_id>2</image_id>
<weld_id>7</weld_id>
<data>{"lx":429, "ly":346, "ts": [{"x":373, "y":290}]}</data>
</HotSpot>
<id>
is a unique numerical identifier of this hot weld.
<image_id>
corresponds to the ID of the image this hot spot is displayed on.
<weld_id>
corresponds to the ID of the weld definition which is used for this hot spot.
<data>
encodes the location of the hot spot on the displayed image. It uses the JSON syntax forming the following object
{
"lx":429, // pixel location of the hot spot label (center) in x direction (starting left at 0)
"ly":346, // pixel location of the hot spot label (center) in y direction (starting top at 0)
"ts": [ // pixel location of the hot spot in x and y direction
{"x":373, "y":290}
]
}
The fields lx
and ly
specify the position of the hot spot on the given image. Both coordinates are given in pixel units
and x
starts with 0 at the top, while y
starts with 0 on the left.
<Route>
The <Route>
specifies the order in which the hot spots should be tested. A typicel <Route>
may look like this
<Route>
<id>1</id>
<part_id>1</part_id>
<name>My First Route</name>
<measurement_type>rswa-steel</measurement_type>
<comment /> <!-- Optional -->
<RouteItem>
<!-- descriptive section for a route item -->
</RouteItem>
<!-- repeated <RouteItem> fields for each route item -->
</Route>
As before, <id>
is a unique identifier for this specific route.
<part_id>
must correspond to the part's ID this route is associated with.
The <name>
tag gives the display name of the route.
<measurement_type>
is one of rswa_steel
, rswa-aluminum
, abis-steel
or abis-aluminum
depending on the measured material.
<comment>
is an optional field for additional descriptive text info.
Finally, the <Route>
tag contains one <RouteItem>
for each route item defined in this route.
The <RouteItem>
is explained in detail in <RouteItem>
<RouteItem>
The <RouteItem>
section provides further information about each item within a route. A full <RouteItem>
section may look like this
<RouteItem>
<id>23</id>
<route_id>3</route_id>
<position>2</position>
<weld_id>13</weld_id>
</RouteItem>
Each <RouteItem>
contains a unique identifier <id>
, the ID of the associated route <route_id>
, its position within
the route <position>
and the associated weld definition <weld_id>
.
The <position>
of 1
is given to the first hot spot in a route and increased for each subsequent one.