Developer Workflow¶
This guide describes the SysML-based development workflow for creating and deploying GVA-compliant data interfaces using the Land Data Model (LDM) SDK and Bohemian.
Overview¶
The LDM uses a Model Driven Architecture (MDA) approach where data models are created as Platform Independent Models (PIMs) in SysML/UML, then automatically translated to deployable code for DDS communication.
IBM Rhapsody] --> B[Platform Independent
Model PIM] end subgraph Transform["Translation Phase"] B --> C[Platform Specific
Model PSM] C --> D[OMG IDL Files] end subgraph Deploy["Deployment Phase"] D --> E[C++ Types
AstuteDDS] E --> F[Qt Wrapper
Classes] end
Key Concepts¶
Platform Independent Model (PIM)¶
The PIM captures the data requirements without any implementation details. It defines:
- Classes: Data structures representing entities (sensors, actuators, vehicles)
- Attributes: Properties of each class
- Operations: Commands that can be sent to entities
- Associations: Relationships between classes
- Types: Enumerations, structures, and typedefs
Platform Specific Model (PSM)¶
The PSM is automatically generated from the PIM and adds DDS-specific elements:
- Topic types with DDS annotations
- Key fields for instance identification
- Command and response structures
- Metadata for tracking
Platform Specific Implementation (PSI)¶
The final generated code (IDL → C++ → Qt wrappers) ready for integration.
The MDA Translation Process¶
Workflow with Bohemian¶
Bohemian simplifies the translation process by providing a graphical interface for viewing Rhapsody models and generating IDL files directly.
Step 1: Design Your Model¶
Create your SysML model in IBM Rhapsody following the LDM Methodology:
- Define Use Cases describing system capabilities
- Create a Domain Model partitioning the system into subject areas
- Design Sequence Diagrams showing interactions
- Build Class Models defining data structures
- Add State Models for stateful entities
Step 2: View and Validate with Bohemian¶
Open your Rhapsody project in Bohemian to explore and validate the model:
Navigate the model tree to verify:
- All classes have proper attributes and types
- Associations are correctly defined
- Operations have appropriate parameters
- State diagrams are complete
Step 3: Export IDL Files¶
Use Bohemian to generate IDL files:
Interactive Mode:
- Open the project in Bohemian
- Select File > Export IDL...
- Choose the output directory
- Click Export
Command Line Mode:
Step 4: Compile IDL with AstuteDDS¶
Use the astutedds-idl compiler to generate C++ types from your IDL files:
# Generate C++ code from IDL files
astutedds-idl -o ./generated/cpp -I ./ldm/UK/GVA/v10.0.0/IDL mymodule.idl
# Generate with verbose output
astutedds-idl -v -o ./generated/cpp -I ./includes shapes.idl
# Generate Python bindings instead
astutedds-idl -l python -o ./generated/python mymodule.idl
# Generate C code
astutedds-idl -l c -o ./generated/c mymodule.idl
AstuteDDS IDL Compiler Options¶
| Option | Description |
|---|---|
-o <dir> |
Output directory for generated files (default: ./generated) |
-l <lang> |
Output language: cpp (default), c, python |
-I <dir> |
Add include search path (can be specified multiple times) |
-D <macro> |
Define a preprocessor macro (NAME or NAME=value) |
-v |
Verbose output |
-h, --help |
Show help message |
Step 5: Build the LDM SDK¶
The LDM SDK automatically compiles IDL files and generates Qt wrappers:
Step 6: Use Generated Code¶
Include the generated Qt wrapper classes in your application:
#include "QtWrapperCSensorPubSub.h"
// Create a publisher
auto publisher = std::make_unique<ldm::pubsub::QtDdsPublisherCSensor>(
domainId, P_Sensors_PSM::KC_Sensor_TopicName,
ldm::pubsub::LdmMessagePattern::eState);
// Connect signals
connect(publisher.get(), &ldm::pubsub::QtDdsPublisherCSensor::OnSamplePublished,
this, &MyClass::onPublished);
// Publish data
P_Sensors_PSM::C_Sensor sensorData;
sensorData.A_Temperature(25.0f);
publisher->publish(sensorData);
LDM Translation Rules¶
The translators apply consistent naming conventions:
| SysML Element | IDL Naming | Example |
|---|---|---|
| Package | P_<PackageName> |
P_Alarms_PSM |
| Class | C_<ClassName> |
C_Alarm |
| Type (Enum) | T_<TypeName> |
T_AlarmType |
| Type (Struct) | T_<TypeName> |
T_Position |
| Attribute | A_<AttributeName> |
A_Severity |
| Enum Literal | L_<LiteralName> |
L_Warning |
| Topic Constant | KC_<Class>_TopicName |
KC_Alarm_TopicName |
DDS Annotations¶
The PSM Translator adds DDS X-Types annotations for extensibility:
@mutable: Allows adding/removing optional fields@key: Marks fields used for instance identification@optional: Fields that may not be present@autoid(HASH): Automatic member ID generation
Reference Documentation¶
Official LDM documentation, SysML models, and tools are available from the Land Open Systems Architecture (LOSA) Portal:
- Portal: https://landopensystems.mod.gov.uk
- LDM Repository: https://gitlab.landopensystems.mod.gov.uk
Key Documents¶
The following documents are available from the LOSA Portal:
| Document | Description |
|---|---|
| LDM Methodology and Modelling Standard Issue v1.9 | Comprehensive guide to building PIMs |
| LDM User Guide v2.0 | Repository access and tool usage |
| LDM Adopters Guide Issue v1.1 | Getting started for new adopters |
| GVA Translator Guide 2021 Issue 1.2 | PIM to PSM to IDL mapping rules |
| GVA Development and Deployment Standards and Guidelines v2.1 | DDS deployment rules and QoS policies |
| GVA Multifunction Display Integration Guide v1.0 | HMI integration patterns |
| Battlespace Objects Domain Guidance | Modelling battlespace entities |
| J1939 and Automotive Specification Domains User Guide | Vehicle bus integration |
Registration Required
Access to the LOSA Portal requires registration. Contact the UK MOD GVA Office at deslelca-pi-eng-losa@mod.gov.uk for access requests.
Best Practices¶
Model Design¶
- One domain, one subject: Keep each domain focused on a single subject matter
- Avoid pollution: Don't mix application logic with technology-specific details
- Use counterparts: Represent the same entity in different domains using counterpart classes
- Follow naming conventions: Use the LDM naming patterns consistently
Development Workflow¶
- Validate early: Use Bohemian to check model structure before export
- Incremental changes: Make small, focused changes to the model
- Test generated code: Build and test after each model change
- Version control: Track both model files and generated IDL
Deployment¶
- Match QoS policies: Use appropriate DDS QoS for each topic type
- Register resources: All resources must register with the GVA Registry
- Handle extensibility: Use X-Types annotations for forward compatibility