OpenFMB.Templates.Tools 1.0.0

dotnet add package OpenFMB.Templates.Tools --version 1.0.0
                    
NuGet\Install-Package OpenFMB.Templates.Tools -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OpenFMB.Templates.Tools" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OpenFMB.Templates.Tools" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="OpenFMB.Templates.Tools" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OpenFMB.Templates.Tools --version 1.0.0
                    
#r "nuget: OpenFMB.Templates.Tools, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package OpenFMB.Templates.Tools@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OpenFMB.Templates.Tools&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=OpenFMB.Templates.Tools&version=1.0.0
                    
Install as a Cake Tool

OpenFMB Configuration Generator

Overview

A simple tool to manipulate pre-mapped template file and generate:

  • Adapter main configuration

  • Device specific template

    The following Parameters are used to manipulate the pre-mapped template and generate adapter main configuration:

        public class Parameters
        {
            public string DeviceIp { get; set; } = "127.0.0.1";
            public int DevicePort { get; set; } = 20000;
            public List<string> DeviceNames { get; set; } = new List<string>() { "MyDevice" };
            public List<string> DeviceMrids { get; set; } = new List<string>() { Guid.Empty.ToString() };
            public int MasterAddress { get; set; } = 1;
            public int OutstationAddress { get; set; } = 1;
    
            public Protocol Protocol { get; set; } = Protocol.Unknown;
            public TransportProtocol TransportProtocol { get; set; } = TransportProtocol.NATS;
    
            public string NatsUrl { get; set; } = "nats://localhost:4222";
            public string NatsJwtCredsFile { get; set; } = "jwt.creds";
    
            public string MqttUrl { get; set; } = "tcp://localhost:1883";
            public string MqttUsername { get; set; } = "username";
            public string MqttPassword { get; set; } = "password";
    
            public List<ITopic> PublishTopics { get; set; } = new List<ITopic>();
            public List<ITopic> SubscribeTopics { get; set; } = new List<ITopic>();
    
            public string TemplatePath { get; set; } = "/openfmb/template.yaml";        
        }
    

Installation

  1. NuGet Package: Install teh library via NuGet Package Manager using the following command (TODO):

    Install-Package OpenFMB.Templates.Tools
    
  2. Manual Download: You can manually download the library DLL from the GitHub releases page and reference it in your project

Usage

Here is a simple example of how to use the OpenFMB Template Tools:

    using OpenFMB.Templates.Tools.Configurations;

    class Program
    {
        static void Main(string[] args) 
        {
            var config = new Parameters
            {
                DevicePort = 20000,
                DeviceMrids = new List<string>() { Guid.NewGuid().ToString().ToLower() }
            };

            // Pre-mapped template file
            var f = "templates/template1.yaml";
            var yaml = File.ReadAllText(f);

            var tuple = ConfigGenerator.GenerateAdapterConfigurations(yaml, config);
        }
    }
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 221 12/13/2023