Giter VIP home page Giter VIP logo

yololshipsystemspec's Introduction

Yolol Ship System Spec

This library supplies all the basics types needed to specify a Yolol network within a C# project.

Every single device type has an interface representing it. This interface has a C# property for each device field which contains the name of that device field in the network. For example, a button is represented by this interface:

public interface IButton
    : IDevice
{
    string ButtonState { get; }
    string ButtonOnStateValue { get; }
    string ButtonOffStateValue { get; }
    string ButtonStyle { get; }

    ButtonTypes TypeOf { get; }
}

There are some additional convenience properties available on device interfaces.

The TypeOf field (not yet implemented for all types) contains TypeInfo for every device field, specifying the expected values for a field. For example the ButtonTypes class looks like this:

public class ButtonTypes
{
    public TypeInfo ButtonState => new TypeInfo(YololType.Number | YololType.String);
    public TypeInfo ButtonOnStateValue => new TypeInfo(YololType.Number | YololType.String);
    public TypeInfo ButtonOffStateValue => new TypeInfo(YololType.Number | YololType.String);
    public TypeInfo ButtonStyle => new TypeInfo(YololType.Number, 0, 2);
}

Serialisation

Constructing these graphs is done by deserialising a YAML file which specifies the network layout. This is intended to act as a general way to specify network layouts which can be used to exchange network topology information between different tools (compilers, optimisers etc).

The file specifies a list of named networks, each network has a list of devices. There is also a list of relays which connect together the named networks. For example:

networks:
 - &primary                                             # Specify a network named `primary`
   name: "primary network"                              # Give it a human readable name
   remark: "Primary data backbone of the ship"          # Optional human readable remarks
   devices:
    - !radio_transmitter                                # Specify a device of type `radio_transmitter` 
      prefix: pre_                                      # Prefix all fields with `pre_`
      suffix: _post                                     # Suffix all fields with `_post`
      TransmitMessage: tm                               # Name the `Transmitmessage` field `pre_tm_post`
      TransmitRange: tr
      Frequency: fq
    - !cargo_beam
      prefix: range

 - &hull_integrity                                      # Another network
   name: "integrity"
   remark: "wires on hull plating to detect breaches"

 - &bridge                                              # Yet another network
   name: "bridge"
   remark: "Data network for bridge terminals"

relays:
 - src: *hull_integrity                                 # A relay connecting `hull integrity` to `primary` network
   dst: *primary
 - src: *bridge
   dst: *primary

yololshipsystemspec's People

Contributors

martindevans avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

yololshipsystemspec's Issues

Spec versioning

Add versioning to the spec, example:

version: "1.2.0"

networks:
  __Stuff__

relays:
  __Stuff__

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.