Skip to content

About

4th Semester Project @ SDU

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Component Based Production System

Important

Remember to update DB_PASSWORD= and POSTGRES_PASSWORD= in .env

Creating a new component

Components are .dll files that implements the IComponent interface from the Orchestrator.

  1. Step To create a new component start out by creating a C# class library.
mkdir MyComponent
cd MyComponent
dotnet new classlib -n MyComponent
  1. Step Your component needs to know about the IComponent interface from Orchestrator.Core add a project reference (Update the path accordingly, the path below assumes you created your component in components/):
dotnet add reference ../orchestrator/Orchestrator.Core/Orchestrator.Core.csproj
  1. Step Implement IComponent in your component
using Orchestrator.Core;

public class MyComponent : IComponent
{
  public string ComponentType => "Mixer";
  public string Protocol => "MQTT";
  public string Host => "localhost";
  public ushort Port => 1234;
  public List<CommandDefinition> SupportedCommands => new()
  {
    new CommandDefinition { Name = "mix", Parameters = new() { "speed", "duration" } },
    new CommandDefinition { Name = "stop", Parameters = new() }
  };
}
  1. Step Build the component as a .dll
dotnet build -c Release

The build dll will be in bin/Release/net9.0/MyComponent.dll

  1. Step Drop your component into components/

About

4th Semester Project @ SDU

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages