Skip to content

Getting Started

Trais McAllister edited this page Mar 5, 2024 · 2 revisions

Getting Started with MtconnectTranspiler

Welcome to the starting point for working with the MtconnectTranspiler! This guide will walk you through the basic components involved in the transpilation process, providing a high-level understanding of how the MtconnectTranspiler transforms the SysML model into usable code.

Overview

Transpiling the SysML model into another format, such as C# code, involves a series of steps and components working together seamlessly. Here’s what you need to know to get started.

Components of the Transpilation Process

  1. XML Document of the SysML Model: This is your starting point, containing the SysML model that describes the structure and semantics of the information you wish to transpile.

  2. MtconnectTranspiler (The Core Deserializer): Acts as the bridge between the raw SysML model and the contextual model by deserializing the XML document into a format that is easier to work with programmatically.

  3. ITranspilerSink Implementation: This component takes the contextual model provided by the MtconnectTranspiler and turns it into the desired output format (e.g., C# code). It’s where the actual conversion process happens, tailored to your specific needs.

How the Process Works

The transpilation process is illustrated in the sequence diagram below, which outlines the interactions between the SysML model, MtconnectTranspiler, ITranspilerSink implementation, and the final output.

sequenceDiagram
  participant SysML as SysML XML Model
  participant MtconnectTranspiler as MtconnectTranspiler
  participant ITranspilerSink as ITranspilerSink Implementation
  participant Output as Output (e.g., CSharp Code)
  SysML->>MtconnectTranspiler: Deserialize
  MtconnectTranspiler->>ITranspilerSink: Provide Contextual Model
  ITranspilerSink-->>MtconnectTranspiler: Lookup References (if needed)
  ITranspilerSink->>Output: Compile into Output Format
Loading

Step-by-Step Guide

  1. Prepare Your SysML Model: Ensure you have the SysML model ready in an XML document format. This model is the blueprint for the information you wish to convert.

  2. Set Up MtconnectTranspiler: Install and configure the MtconnectTranspiler to be ready to take your SysML model and deserialize it into a contextual model.

  3. Implement ITranspilerSink: Depending on your output requirements (e.g., generating C# code), implement the ITranspilerSink interface to define how the contextual model should be transformed into your desired format.

  4. Run the Process: With all components in place, initiate the transpilation process. The MtconnectTranspiler will deserialize the SysML model and pass the contextual model to your ITranspilerSink implementation, which then generates the final output.

By following this guide and understanding each component’s role in the process, you’ll be well on your way to effectively utilizing the MtconnectTranspiler for your development needs.