Table of Contents

C#: Custom Components Tutorial

Nominal Editor ships with Editor CSharp, a C# solution file that enables custom components to be written in a more traditional programming language. The Mono runtime interpreter can read from C# DLLs and handle the data interoperability between the two environments. This tutorial series will demonstrate how to create a C# component and import it into Nominal Editor. The tutorial will create a custom solar panel that calculates the total power produced over the simulation lifetime and a custom thermal sensor that uses the atmosphere’s temperature and the solar panel’s power to produce an estimate of the temperature with some noise.

Untitled

Untitled


Table of Contents

  1. Creating a Simulation Class
  2. Creating a Solar Panel
  3. Creating a Sensor
  4. Creating a Message
  5. Building the Solution
  6. Creating the Object Blueprints
  7. Building the Level
  8. Plotting Data

Minimum Requirements

  • Nominal Editor must be installed before this tutorial commences. Information about how to install Nominal Editor can be found in the document below.

    Installing Editor

  • Visual Studio 2022 is used in this tutorial, although other IDEs can be used instead. An appropriate IDE with a C# builder must be installed before this tutorial commences. Information about how to install a solution can be found in the tutorial below.

    Installing Visual Studio

  • The data downlink tutorial must have been completed before this tutorial. Although no TT&C elements will be present in this tutorial, some of the blueprint and Nominal architecture knowledge will be required at certain points.

    Data Downlink Tutorial


Key Learnings

  • Simulation Components: Understand how to code simulation components in C# using Visual Studio and the Nominal simulation infrastructure.
  • Custom Messages: Create custom C# messages to store data from simulation components within the Nominal simulation infrastructure.
  • Mono Objects: Compile DLLs in a C# solution with custom simulation objects and import them into Nominal Editor to use within simulations.
  • Mono Properties: Understand how to use the Mono property functions in Nominal Editor to read and write data from C# components.