Component Type Anatomy
Component Types
A Component Type model is an XML file that describes the properties and behaviour of a Component Type. It is used to capture the model of the Component Type and generate the code for the and its associated component model.
Below is an example skeleton of a Component Type which has been generated using codegen. The model is written in XML and contains various elements that define the Component Type, such as a description, Events, Tasks, and Parameters.
Show the example Component Type
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file describes the test component type.
Author: Bright Ascension
Date: 2024-04-16
-->
<ModelElement xmlns="http://www.brightascension.com/schemas/gen1/model"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ComponentType name="MessagePrinter">
<Description>
The test component.
<!-- Note: The order of the tags is important and should not be changed. -->
</Description>
<!-- Component Imports -->
<!-- Exceptions (Status Codes) -->
<!-- Events -->
<!-- Required Components -->
<!-- Services (Provided and Required) -->
<!-- Tasks -->
<!-- Event Sources -->
<!-- Event Sinks -->
<!-- Actions -->
<!-- Parameters -->
<!-- Implementation -->
</ComponentType>
</ModelElement>
The below table provides a brief description and example of each element that can be included in a Component Type definition.
Element |
Description |
Example |
|
The root element of the Component Type definition. It specifies the XML namespace and schema used. |
|
|
Defines the Component Type. The name attribute specifies the unique name of the Component Type. |
|
|
Provides a brief description of the Component Type. |
|
|
For specifying Component Type dependencies. Component Types can be imported using <Import> elements. |
|
|
For defining custom status codes or exceptions specific to the Component Type. Exceptions can be defined using <Exception> elements. |
|
|
For defining events that the Component Type can raise. Events can be defined using <Event> elements. |
|
|
For specifying other Component Types that this Component Type depends on. Required components can be specified using <RequiredComponent> elements. |
|
|
For defining Services that the Component Type provides or requires. Services can be defined using <ProvidedService> and <RequiredService> elements. |
|
|
For defining Tasks associated with the Component Type. Tasks can be periodic, sporadic, or interrupt-driven and can be defined using <PeriodicTask>, <SporadicTask>, and <InterruptTask> elements. |
|
|
For defining event sources that the Component Type can use to raise Events. event sources can be defined using <EventSource> elements. |
|
|
For defining event sinks that the Component Type can use to handle Events. event sinks can be defined using <EventSink> elements. |
|
|
For defining Actions that the Component Type can perform. Actions can be defined using <Action> elements. |
|
|
For defining Parameters associated with the Component Type. Parameters can be defined using <Parameter> elements. |
|
|
Used to specify whether Service operations are synchronous or asynchronous. They are also used to define whether they’re not implemented by the Component. This will affect what functions are generated for the Component Type and component model. |
|
Parameter Types
Parameters in the FSDK can be of various types, including scalar and vector types. The following table lists the supported Parameter types and their descriptions:
| Type | Description | Exmaple |
|---|---|---|
|
Unsigned integer, with any bit length up to 32-bits supported |
|
|
Signed integer, with any bit length up to 32-bits supported |
|
|
Bitfields, with any bit length up to 32-bits supported |
|
|
Raw values of a fixed size |
|
|
Raw values of a variable size |
|
|
A vector of fixed-length values. Note that the vector must have a fixed number of rows and columns and therefore |
|
|