NASA-AMMOS / aerie-ui

The client application for Aerie.
https://nasa-ammos.github.io/aerie-docs/
MIT License
28 stars 4 forks source link

Feat/grammar support for more command types #1258

Open joswig opened 2 months ago

joswig commented 2 months ago

Examples of potential representations for remaining seq.json object types

Activate and Load

Activate and Load have the same structure and differ only in type, and intent.

Schema Reference

A one line representation including engine and epoch would be useful, but as they are optional we need to label them or use more structure which we've avoided so far

@ACTIVATE A2024-123T12:34:56 "sequence.name" 1 "2" [ "three" 4 ]  # Multiple Args
@ENGINE 10
@EPOCH "epoch string"
@METADATA "name 1" [ 1,2  , 3 ]
@METADATA "name 2" ["a",    true  ,
  2 ]

@ACTIVATE R123T12:34:56 "sequence2.name"
@ENGINE -1

@LOAD A2024-123T12:34:56 "sequence.name" # No Args
@ENGINE 10
@EPOCH "epoch string"

@LOAD R123T12:34:56 "sequence2.name" "foo" 1 2 3  # Description
@ENGINE -1

A proposed alternate syntax would be to group like below, but this is trending towards the eDSL approach.

@ACTIVATE(10, "epoch string") A2024-123T12:34:56 "sequence.name" 1 "2" [ "three" 4 ]  # Multiple Args

Ground Event and Ground Epoch

Ground Event and Epoch have the same structure, but different meanings.

@GROUND_BLOCK A2024-123T12:34:56 "sequence.name" # No Args

@GROUND_EVENT R123T12:34:56 "sequence2.name" "foo" 1 2 3  # With some Args

Alternate Syntax

R123T12:34:56 @GROUND_EVENT("sequence2.name") "foo" 1 2 3  # With some Args

Request

@REQUEST_START A2024-123T12:34:56 "request.name" # No Args
C CMD_1 1 2 3
R100 CMD_2 "1 2 3"
@REQUEST_END

@REQUEST_START @GROUND_EPOCH "Delta" "Name" { "extra": true } "request.name" # No Args
C CMD_1 1 2 3
R100 CMD_2 "1 2 3"
C CMD_1 1 2 3
R100 CMD_2 "1 2 3"
@REQUEST_END

Alternate

A2024-123T12:34:56 @REQUEST_START ("request.name") # No Args
C CMD_1 1 2 3
R100 CMD_2 "1 2 3"
@REQUEST_END

@GROUND_EPOCH("Delta" "Name" { "extra": true } @REQUEST_START ("request.name") # No Args
C CMD_1 1 2 3
R100 CMD_2 "1 2 3"
C CMD_1 1 2 3
R100 CMD_2 "1 2 3"
@REQUEST_END

alternative 2

@REQUEST_START ("request.name") @GROUND_EPOCH("Delta" "Name" { "extra": true } # No Args
C CMD_1 1 2 3
R100 CMD_2 "1 2 3"
C CMD_1 1 2 3
R100 CMD_2 "1 2 3"
@REQUEST_END

@REQUEST_START_EPOCH ("request.name" "Delta" "Name" { "extra": true }) # No Args
C CMD_1 1 2 3
R100 CMD_2 "1 2 3"
C CMD_1 1 2 3
R100 CMD_2 "1 2 3"
@REQUEST_END
joswig commented 2 months ago

seq.json

Small changes.

Request are going to be hard since they could look like this. We should probably start looking at auto-indentation or a format button which could help with readablity.


@REQUEST_START @GROUND_EPOCH "Delta" "Name" { "extra": true } "request.name" # No Args
C CMD_1 1 2 3 # description
@MODELES "foo" "bar"
R100 CMD_2 "1 2 3"
C CMD_1 1 2 3
R100 CMD_2 "1 2 3"
@REQUEST_END
@MODELS "a" 1 "00:00:00"
@METADATA "foo" "bar"

Model objects aren't allowed on requests, but your point stands these have potential to test the limits of readability. I assume we'll end up folding away most of the request top level details outside of the name, but we'll need some user feedback there

@REQUEST_START @GROUND_EPOCH "Delta" "Name" { "extra": true } "request.name" # No Args
@METADATA "foo" "bar"
  C CMD_1 1 2 3
  @METADATA "foo" "bar"
  @MODEL "a" 1 "00:00:00"

  R100 CMD_2 "1 2 3"

  C CMD_1 1 2 3

  R100 CMD_2 "1 2 3"

@REQUEST_END
joswig commented 2 months ago
@REQUEST_START("request.name") "Delta" "Name" { "extra": true } # Description Text
  C CMD_1 1 2 3
  @METADATA "foo" "bar"
  @MODEL "a" 1 "00:00:00"

  R100 CMD_2 "1 2 3"

  C CMD_1 1 2 3

  R100 CMD_2 "1 2 3"

@REQUEST_END
@METADATA "foo" "bar"
joswig commented 1 month ago

Updated alternate syntax on this branch

https://github.com/NASA-AMMOS/aerie-ui/compare/cleanup/inline_grammar_tests...feat/seqgen_grammar_v2?expand=1