Skip to content

Commit

Permalink
Immediate versions of load and activate (#26)
Browse files Browse the repository at this point in the history
* Add immediate versions of activate and load

* Version inc

* test cases

* fixup! Add immediate versions of activate and load
  • Loading branch information
cartermak authored Nov 4, 2024
1 parent fdad4b3 commit d8614fd
Show file tree
Hide file tree
Showing 7 changed files with 232 additions and 30 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nasa-jpl/seq-json-schema",
"version": "1.0.21",
"version": "1.1.0",
"license": "MIT",
"type": "module",
"repository": {
Expand Down
135 changes: 112 additions & 23 deletions schema.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,45 @@
{
"$id": "https://github.com/NASA-AMMOS/seq-json-schema/tree/v1.0.21",
"$id": "https://github.com/NASA-AMMOS/seq-json-schema/tree/v1.1.0",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"immediate_activate": {
"additionalProperties": false,
"description": "Untimed activate object",
"properties": {
"args": {
"$ref": "#/$defs/args"
},
"description": {
"$ref": "#/$defs/description"
},
"engine": {
"type": "integer",
"description": "Sequence target engine."
},
"epoch": {
"type": "string",
"description": "Onboard epoch to pass to the sequence for derivation of epoch-relative timetags"
},
"metadata": {
"$ref": "#/$defs/metadata"
},
"models": {
"items": {
"$ref": "#/$defs/model"
},
"type": "array"
},
"sequence": {
"type": "string",
"description": "Onboard path and filename of sequence to be loaded."
},
"type": {
"const": "activate"
}
},
"required": ["sequence", "type"],
"type": "object"
},
"activate": {
"additionalProperties": false,
"description": "Activate object",
Expand Down Expand Up @@ -69,6 +107,30 @@
]
}
},
"immediate_fsw_command": {
"additionalProperties": false,
"description": "Object representing a single Immediate Command",
"properties": {
"args": {
"$ref": "#/$defs/args"
},
"description": {
"$ref": "#/$defs/description"
},
"metadata": {
"$ref": "#/$defs/metadata"
},
"stem": {
"type": "string",
"description": "Command stem"
},
"type": {
"const": "command"
}
},
"required": ["stem", "args"],
"type": "object"
},
"command": {
"additionalProperties": false,
"description": "Command object",
Expand Down Expand Up @@ -190,6 +252,44 @@
"required": ["name", "time", "type"],
"type": "object"
},
"immediate_load": {
"additionalProperties": false,
"description": "Untimed load object",
"properties": {
"args": {
"$ref": "#/$defs/args"
},
"description": {
"$ref": "#/$defs/description"
},
"engine": {
"type": "integer",
"description": "Sequence target engine."
},
"epoch": {
"type": "string",
"description": "Onboard epoch to pass to the sequence for derivation of epoch-relative timetags"
},
"metadata": {
"$ref": "#/$defs/metadata"
},
"models": {
"items": {
"$ref": "#/$defs/model"
},
"type": "array"
},
"sequence": {
"type": "string",
"description": "Onboard path and filename of sequence to be loaded."
},
"type": {
"const": "load"
}
},
"required": ["sequence", "type"],
"type": "object"
},
"load": {
"additionalProperties": false,
"description": "Load object",
Expand Down Expand Up @@ -317,27 +417,6 @@
}
]
},
"immediate_command": {
"additionalProperties": false,
"description": "Object representing a single Immediate Command",
"properties": {
"args": {
"$ref": "#/$defs/args"
},
"description": {
"$ref": "#/$defs/description"
},
"metadata": {
"$ref": "#/$defs/metadata"
},
"stem": {
"type": "string",
"description": "Command stem"
}
},
"required": ["stem", "args"],
"type": "object"
},
"hardware_command": {
"additionalProperties": false,
"description": "Object representing a single Hardware Command",
Expand Down Expand Up @@ -674,7 +753,17 @@
"immediate_commands": {
"description": "Immediate commands which are interpreted by FSW and not part of any sequence.",
"items": {
"$ref": "#/$defs/immediate_command"
"oneOf": [
{
"$ref": "#/$defs/immediate_fsw_command"
},
{
"$ref": "#/$defs/immediate_load"
},
{
"$ref": "#/$defs/immediate_activate"
}
]
},
"type": "array"
},
Expand Down
15 changes: 15 additions & 0 deletions test/invalid-seq-json/immediate-activate-with-time.seq.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"id": "immediate-activate-with-time",
"metadata": {},
"immediate_commands": [
{
"args": [],
"sequence": "d:/eng/test.mod",
"description": "immediate activate with time field",
"type": "activate",
"time": {
"type": "COMMAND_RELATIVE"
}
}
]
}
17 changes: 17 additions & 0 deletions test/invalid-seq-json/immediate-command-with-time.seq.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"id": "immediate-command-with-time",
"metadata": {},
"immediate_commands": [
{
"stem": "NOOP",
"description": "immediate command with time field",
"metadata": {
"processor": "VC1A"
},
"args": [],
"time": {
"type": "COMMAND_COMPLETE"
}
}
]
}
15 changes: 15 additions & 0 deletions test/invalid-seq-json/immediate-load-with-time.seq.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"id": "immediate-load-with-time",
"metadata": {},
"immediate_commands": [
{
"args": [],
"sequence": "d:/eng/test.mod",
"description": "immediate load with time field",
"type": "load",
"time": {
"type": "COMMAND_RELATIVE"
}
}
]
}
74 changes: 70 additions & 4 deletions test/valid-seq-json/rtc.seq.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,84 @@
{
"stem": "IC",
"args": [
{ "type": "string", "value": "1" },
{ "type": "number", "value": 2 },
{ "type": "number", "value": 3.0 }
{
"type": "string",
"value": "1"
},
{
"type": "number",
"value": 2
},
{
"type": "number",
"value": 3.0
}
],
"description": "immediate command",
"metadata": {}
},
{
"stem": "NOOP",
"description": "noop command, no arguments",
"metadata": { "processor": "VC1A" },
"metadata": {
"processor": "VC1A"
},
"args": []
},
{
"stem": "NOOP",
"description": "noop command, no arguments, with optional type",
"metadata": {
"processor": "VC1A"
},
"args": [],
"type": "command"
},
{
"args": [
{
"type": "number",
"value": 30
}
],
"description": "Immediate activate step.",
"engine": 2,
"epoch": "TEST_EPOCH",
"models": [
{
"offset": "00:00:00.000",
"variable": "model_var_float",
"value": "1.234"
}
],
"sequence": "d:/eng/test.mod",
"type": "activate",
"metadata": {
"metadata_arg": "metadata_value"
}
},
{
"args": [
{
"type": "number",
"value": 30
}
],
"description": "Immediate load step.",
"engine": 2,
"epoch": "TEST_EPOCH",
"models": [
{
"offset": "00:00:00.000",
"variable": "model_var_float",
"value": "1.234"
}
],
"sequence": "d:/eng/test.mod",
"type": "load",
"metadata": {
"metadata_arg": "metadata_value"
}
}
]
}

0 comments on commit d8614fd

Please sign in to comment.