openc3 6.9.1 → 6.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/openc3cli +289 -0
- data/data/config/command_modifiers.yaml +79 -0
- data/data/config/item_modifiers.yaml +5 -0
- data/data/config/parameter_modifiers.yaml +5 -0
- data/data/config/telemetry_modifiers.yaml +79 -0
- data/ext/openc3/ext/packet/packet.c +9 -0
- data/lib/openc3/accessors/accessor.rb +27 -3
- data/lib/openc3/accessors/binary_accessor.rb +21 -4
- data/lib/openc3/accessors/template_accessor.rb +3 -2
- data/lib/openc3/api/cmd_api.rb +7 -3
- data/lib/openc3/api/tlm_api.rb +17 -7
- data/lib/openc3/interfaces/protocols/fixed_protocol.rb +19 -13
- data/lib/openc3/interfaces.rb +6 -4
- data/lib/openc3/io/json_rpc.rb +6 -0
- data/lib/openc3/microservices/decom_microservice.rb +97 -17
- data/lib/openc3/microservices/interface_decom_common.rb +32 -0
- data/lib/openc3/microservices/interface_microservice.rb +12 -80
- data/lib/openc3/microservices/queue_microservice.rb +30 -7
- data/lib/openc3/migrations/20251022000000_remove_unique_id.rb +23 -0
- data/lib/openc3/models/plugin_model.rb +69 -6
- data/lib/openc3/models/queue_model.rb +32 -5
- data/lib/openc3/models/reaction_model.rb +26 -10
- data/lib/openc3/models/target_model.rb +85 -13
- data/lib/openc3/models/trigger_model.rb +1 -1
- data/lib/openc3/packets/commands.rb +33 -7
- data/lib/openc3/packets/packet.rb +75 -71
- data/lib/openc3/packets/packet_config.rb +78 -29
- data/lib/openc3/packets/packet_item.rb +11 -103
- data/lib/openc3/packets/parsers/packet_item_parser.rb +177 -34
- data/lib/openc3/packets/parsers/xtce_converter.rb +2 -2
- data/lib/openc3/packets/structure.rb +29 -21
- data/lib/openc3/packets/structure_item.rb +31 -19
- data/lib/openc3/packets/telemetry.rb +37 -11
- data/lib/openc3/script/script.rb +1 -1
- data/lib/openc3/script/suite_results.rb +2 -2
- data/lib/openc3/subpacketizers/subpacketizer.rb +18 -0
- data/lib/openc3/system/system.rb +3 -3
- data/lib/openc3/system/target.rb +3 -32
- data/lib/openc3/tools/table_manager/table_config.rb +9 -1
- data/lib/openc3/tools/table_manager/table_item_parser.rb +2 -2
- data/lib/openc3/top_level.rb +45 -19
- data/lib/openc3/topics/decom_interface_topic.rb +31 -0
- data/lib/openc3/utilities/authentication.rb +25 -6
- data/lib/openc3/utilities/cli_generator.rb +347 -3
- data/lib/openc3/utilities/env_helper.rb +10 -0
- data/lib/openc3/utilities/logger.rb +7 -11
- data/lib/openc3/version.rb +6 -6
- data/tasks/spec.rake +2 -1
- data/templates/command_validator/command_validator.py +49 -0
- data/templates/command_validator/command_validator.rb +54 -0
- data/templates/tool_angular/package.json +48 -2
- data/templates/tool_react/package.json +51 -1
- data/templates/tool_svelte/package.json +48 -1
- data/templates/tool_vue/package.json +36 -3
- data/templates/widget/package.json +28 -2
- metadata +8 -5
- data/templates/tool_vue/.browserslistrc +0 -16
- data/templates/widget/.browserslistrc +0 -16
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1432f7bc925107320f327e82f47ebe6d6da648d00fc6c6469f4f093e69a8dc96
|
|
4
|
+
data.tar.gz: 5aea790bee69e50decbbf418b295eda17a653305f78661c334531afa94f9d265
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dbb54c3b45300cc626c4497ef71c7069567dad94d6f6c73fb1a7dd7093219531d31ffee8bd175ac08b9fee682ab93a488c796d3bf408365a64027740ed9913a3
|
|
7
|
+
data.tar.gz: a703fe408f123953eccf8e9e2b6fb63306404501456a5463410babb95512c68387440279e0d91e61b674ea3bf72122d3480d0001d994cf943d6b901f1a10cc08
|
data/bin/openc3cli
CHANGED
|
@@ -875,6 +875,22 @@ if not ARGV[0].nil? # argument(s) given
|
|
|
875
875
|
case ARGV[0].downcase
|
|
876
876
|
|
|
877
877
|
when 'irb'
|
|
878
|
+
if ARGV[1] == '--help' || ARGV[1] == '-h'
|
|
879
|
+
puts "Usage: cli irb"
|
|
880
|
+
puts ""
|
|
881
|
+
puts "Start an interactive Ruby (IRB) session with COSMOS libraries loaded"
|
|
882
|
+
puts ""
|
|
883
|
+
puts "This provides access to all COSMOS classes and methods for interactive"
|
|
884
|
+
puts "debugging and exploration. Use 'exit' or Ctrl-D to quit the IRB session."
|
|
885
|
+
puts ""
|
|
886
|
+
puts "Example:"
|
|
887
|
+
puts " cli irb"
|
|
888
|
+
puts " > require 'openc3'"
|
|
889
|
+
puts " > OpenC3::System.targets"
|
|
890
|
+
puts ""
|
|
891
|
+
puts "Note: For IRB-specific options, start IRB first then type 'help'"
|
|
892
|
+
exit 0
|
|
893
|
+
end
|
|
878
894
|
ARGV.clear
|
|
879
895
|
IRB.start
|
|
880
896
|
|
|
@@ -882,6 +898,29 @@ if not ARGV[0].nil? # argument(s) given
|
|
|
882
898
|
cli_script(ARGV[1..-1])
|
|
883
899
|
|
|
884
900
|
when 'rake'
|
|
901
|
+
# Check for --help first, before checking for Rakefile
|
|
902
|
+
if ARGV[1] == '--help' || ARGV[1] == '-h'
|
|
903
|
+
puts "Usage: cli rake [RAKE_OPTIONS] [TASKS...]"
|
|
904
|
+
puts ""
|
|
905
|
+
puts "Run rake tasks in the current directory"
|
|
906
|
+
puts ""
|
|
907
|
+
puts "This runs the standard Ruby rake tool with all COSMOS libraries available."
|
|
908
|
+
puts "A Rakefile must exist in the current directory."
|
|
909
|
+
puts ""
|
|
910
|
+
puts "Common rake options:"
|
|
911
|
+
puts " -T, --tasks List all available rake tasks with descriptions"
|
|
912
|
+
puts " -D, --describe PATTERN Describe tasks matching PATTERN"
|
|
913
|
+
puts " -h, --help Show rake's full help message"
|
|
914
|
+
puts ""
|
|
915
|
+
puts "Examples:"
|
|
916
|
+
puts " cli rake -T # List all available tasks"
|
|
917
|
+
puts " cli rake build # Run the 'build' task"
|
|
918
|
+
puts " cli rake test # Run tests"
|
|
919
|
+
puts ""
|
|
920
|
+
puts "Note: Must be run in a directory containing a Rakefile"
|
|
921
|
+
exit 0
|
|
922
|
+
end
|
|
923
|
+
# Now check for Rakefile existence
|
|
885
924
|
if File.exist?('Rakefile')
|
|
886
925
|
puts `rake #{ARGV[1..-1].join(' ')}`
|
|
887
926
|
else
|
|
@@ -889,9 +928,70 @@ if not ARGV[0].nil? # argument(s) given
|
|
|
889
928
|
end
|
|
890
929
|
|
|
891
930
|
when 'validate'
|
|
931
|
+
if ARGV[1].nil? || ARGV[1] == '--help' || ARGV[1] == '-h'
|
|
932
|
+
puts "Usage: cli validate PLUGIN.gem [SCOPE] [VARIABLES.json]"
|
|
933
|
+
puts ""
|
|
934
|
+
puts "Validate a COSMOS plugin gem file"
|
|
935
|
+
puts ""
|
|
936
|
+
puts "Arguments:"
|
|
937
|
+
puts " PLUGIN.gem Plugin gem file to validate (required)"
|
|
938
|
+
puts " SCOPE Scope for validation (optional, default: DEFAULT)"
|
|
939
|
+
puts " VARIABLES.json Variables JSON file (optional)"
|
|
940
|
+
puts ""
|
|
941
|
+
puts "Options:"
|
|
942
|
+
puts " -h, --help Show this help message"
|
|
943
|
+
exit(ARGV[1].nil? ? 1 : 0)
|
|
944
|
+
end
|
|
892
945
|
validate_plugin(ARGV[1], scope: ARGV[2], variables_file: ARGV[3])
|
|
893
946
|
|
|
894
947
|
when 'load'
|
|
948
|
+
# Check for help flag or missing arguments
|
|
949
|
+
if ARGV[1].nil? || ARGV[1] == '--help' || ARGV[1] == '-h'
|
|
950
|
+
puts "Usage:"
|
|
951
|
+
puts " cli load PLUGIN.gem"
|
|
952
|
+
puts " cli load PLUGIN.gem --variables VARIABLES.json"
|
|
953
|
+
puts " cli load PLUGIN.gem SCOPE PLUGIN_HASH.json [force]"
|
|
954
|
+
puts " cli load PLUGIN.gem --variables VARIABLES.json SCOPE PLUGIN_HASH.json [force]"
|
|
955
|
+
puts ""
|
|
956
|
+
puts "Load a COSMOS plugin gem file"
|
|
957
|
+
puts ""
|
|
958
|
+
puts "Common Usage (Auto-detect):"
|
|
959
|
+
puts " cli load PLUGIN.gem"
|
|
960
|
+
puts " - Installs new plugin in DEFAULT scope"
|
|
961
|
+
puts " - Automatically detects and upgrades if plugin already exists"
|
|
962
|
+
puts " - Skips installation if same version already installed"
|
|
963
|
+
puts ""
|
|
964
|
+
puts " cli load PLUGIN.gem --variables VARIABLES.json"
|
|
965
|
+
puts " - Same as above, but provides variables for plugin configuration"
|
|
966
|
+
puts ""
|
|
967
|
+
puts "Advanced Usage (Manual Control):"
|
|
968
|
+
puts " cli load PLUGIN.gem SCOPE PLUGIN_HASH.json [force]"
|
|
969
|
+
puts " - Used by Admin UI for plugin create/edit/upgrade operations"
|
|
970
|
+
puts " - Requires PLUGIN_HASH.json (output from install_phase1)"
|
|
971
|
+
puts " - 'force' argument forces reinstall even if version unchanged"
|
|
972
|
+
puts ""
|
|
973
|
+
puts "Arguments:"
|
|
974
|
+
puts " PLUGIN.gem Plugin gem file to load (required)"
|
|
975
|
+
puts " SCOPE Scope to install plugin in (default: DEFAULT)"
|
|
976
|
+
puts " PLUGIN_HASH.json Plugin hash JSON file from install_phase1 (optional)"
|
|
977
|
+
puts " force Force plugin installation even if no changes (optional)"
|
|
978
|
+
puts ""
|
|
979
|
+
puts "Options:"
|
|
980
|
+
puts " --variables FILE Variables JSON file for plugin installation"
|
|
981
|
+
puts " -h, --help Show this help message"
|
|
982
|
+
puts ""
|
|
983
|
+
puts "IMPORTANT LIMITATION:"
|
|
984
|
+
puts " To specify SCOPE without PLUGIN_HASH.json, you must use the --variables"
|
|
985
|
+
puts " option (even with an empty JSON file) to prevent argument misinterpretation."
|
|
986
|
+
puts ""
|
|
987
|
+
puts "Examples:"
|
|
988
|
+
puts " cli load my-plugin-1.0.0.gem"
|
|
989
|
+
puts " cli load my-plugin-1.0.0.gem --variables vars.json"
|
|
990
|
+
puts " cli load my-plugin-1.0.0.gem DEFAULT plugin_hash.json"
|
|
991
|
+
puts " cli load my-plugin-1.0.0.gem DEFAULT plugin_hash.json force"
|
|
992
|
+
exit(ARGV[1].nil? ? 1 : 0)
|
|
993
|
+
end
|
|
994
|
+
|
|
895
995
|
# force is a boolean so if they pass 'force' it is true
|
|
896
996
|
# See plugins_controller.rb install for usage
|
|
897
997
|
variables_option = ARGV.find_index('--variables')
|
|
@@ -908,15 +1008,68 @@ if not ARGV[0].nil? # argument(s) given
|
|
|
908
1008
|
load_plugin(ARGV[1], scope: scope, plugin_hash_file: plugin_hash_file, force: force, variables_file: variables_file)
|
|
909
1009
|
|
|
910
1010
|
when 'list'
|
|
1011
|
+
if ARGV[1] == '--help' || ARGV[1] == '-h'
|
|
1012
|
+
puts "Usage: cli list [SCOPE]"
|
|
1013
|
+
puts ""
|
|
1014
|
+
puts "List all installed plugins in the specified scope"
|
|
1015
|
+
puts ""
|
|
1016
|
+
puts "Arguments:"
|
|
1017
|
+
puts " SCOPE Scope to list plugins from (optional, default: DEFAULT)"
|
|
1018
|
+
puts ""
|
|
1019
|
+
puts "Options:"
|
|
1020
|
+
puts " -h, --help Show this help message"
|
|
1021
|
+
exit 0
|
|
1022
|
+
end
|
|
911
1023
|
list_plugins(scope: ARGV[1])
|
|
912
1024
|
|
|
913
1025
|
when 'unload'
|
|
1026
|
+
if ARGV[1].nil? || ARGV[1] == '--help' || ARGV[1] == '-h'
|
|
1027
|
+
puts "Usage: cli unload PLUGIN_NAME [SCOPE]"
|
|
1028
|
+
puts ""
|
|
1029
|
+
puts "Unload a COSMOS plugin"
|
|
1030
|
+
puts ""
|
|
1031
|
+
puts "Arguments:"
|
|
1032
|
+
puts " PLUGIN_NAME Name of the plugin to unload (required)"
|
|
1033
|
+
puts " SCOPE Scope to unload from (optional, default: DEFAULT)"
|
|
1034
|
+
puts ""
|
|
1035
|
+
puts "Options:"
|
|
1036
|
+
puts " -h, --help Show this help message"
|
|
1037
|
+
exit(ARGV[1].nil? ? 1 : 0)
|
|
1038
|
+
end
|
|
914
1039
|
unload_plugin(ARGV[1], scope: ARGV[2])
|
|
915
1040
|
|
|
916
1041
|
when 'pkginstall', 'geminstall'
|
|
1042
|
+
if ARGV[1].nil? || ARGV[1] == '--help' || ARGV[1] == '-h'
|
|
1043
|
+
puts "Usage: cli pkginstall PACKAGE_NAME [SCOPE]"
|
|
1044
|
+
puts " cli geminstall GEM_NAME [SCOPE]"
|
|
1045
|
+
puts ""
|
|
1046
|
+
puts "Install a package/gem into a loaded plugin"
|
|
1047
|
+
puts ""
|
|
1048
|
+
puts "Arguments:"
|
|
1049
|
+
puts " PACKAGE_NAME Name of the package to install (required)"
|
|
1050
|
+
puts " SCOPE Scope for installation (optional, default: DEFAULT)"
|
|
1051
|
+
puts ""
|
|
1052
|
+
puts "Options:"
|
|
1053
|
+
puts " -h, --help Show this help message"
|
|
1054
|
+
exit(ARGV[1].nil? ? 1 : 0)
|
|
1055
|
+
end
|
|
917
1056
|
cli_pkg_install(ARGV[1], scope: ARGV[2])
|
|
918
1057
|
|
|
919
1058
|
when 'pkguninstall', 'gemuninstall'
|
|
1059
|
+
if ARGV[1].nil? || ARGV[1] == '--help' || ARGV[1] == '-h'
|
|
1060
|
+
puts "Usage: cli pkguninstall PACKAGE_NAME [SCOPE]"
|
|
1061
|
+
puts " cli gemuninstall GEM_NAME [SCOPE]"
|
|
1062
|
+
puts ""
|
|
1063
|
+
puts "Uninstall a package/gem from a loaded plugin"
|
|
1064
|
+
puts ""
|
|
1065
|
+
puts "Arguments:"
|
|
1066
|
+
puts " PACKAGE_NAME Name of the package to uninstall (required)"
|
|
1067
|
+
puts " SCOPE Scope for uninstallation (optional, default: DEFAULT)"
|
|
1068
|
+
puts ""
|
|
1069
|
+
puts "Options:"
|
|
1070
|
+
puts " -h, --help Show this help message"
|
|
1071
|
+
exit(ARGV[1].nil? ? 1 : 0)
|
|
1072
|
+
end
|
|
920
1073
|
cli_pkg_uninstall(ARGV[1], scope: ARGV[2])
|
|
921
1074
|
|
|
922
1075
|
when 'generate'
|
|
@@ -934,6 +1087,19 @@ if not ARGV[0].nil? # argument(s) given
|
|
|
934
1087
|
xtce_converter(ARGV[1..-1])
|
|
935
1088
|
|
|
936
1089
|
when 'bridge'
|
|
1090
|
+
if ARGV[1] == '--help' || ARGV[1] == '-h'
|
|
1091
|
+
puts "Usage: cli bridge [FILENAME] [PARAMS...]"
|
|
1092
|
+
puts ""
|
|
1093
|
+
puts "Run a COSMOS bridge from a bridge configuration file"
|
|
1094
|
+
puts ""
|
|
1095
|
+
puts "Arguments:"
|
|
1096
|
+
puts " FILENAME Bridge config file (optional, default: bridge.txt)"
|
|
1097
|
+
puts " PARAMS Additional parameters to pass to bridge"
|
|
1098
|
+
puts ""
|
|
1099
|
+
puts "Options:"
|
|
1100
|
+
puts " -h, --help Show this help message"
|
|
1101
|
+
exit 0
|
|
1102
|
+
end
|
|
937
1103
|
ENV['OPENC3_NO_STORE'] = '1'
|
|
938
1104
|
filename = ARGV[1]
|
|
939
1105
|
filename = 'bridge.txt' unless filename
|
|
@@ -942,6 +1108,19 @@ if not ARGV[0].nil? # argument(s) given
|
|
|
942
1108
|
run_bridge(filename, params)
|
|
943
1109
|
|
|
944
1110
|
when 'bridgegem'
|
|
1111
|
+
if ARGV[1].nil? || ARGV[1] == '--help' || ARGV[1] == '-h'
|
|
1112
|
+
puts "Usage: cli bridgegem GEM_NAME [PARAMS...]"
|
|
1113
|
+
puts ""
|
|
1114
|
+
puts "Run a COSMOS bridge from a gem's bridge.txt file"
|
|
1115
|
+
puts ""
|
|
1116
|
+
puts "Arguments:"
|
|
1117
|
+
puts " GEM_NAME Name of the gem containing bridge.txt (required)"
|
|
1118
|
+
puts " PARAMS Additional parameters to pass to bridge"
|
|
1119
|
+
puts ""
|
|
1120
|
+
puts "Options:"
|
|
1121
|
+
puts " -h, --help Show this help message"
|
|
1122
|
+
exit(ARGV[1].nil? ? 1 : 0)
|
|
1123
|
+
end
|
|
945
1124
|
ENV['OPENC3_NO_STORE'] = '1'
|
|
946
1125
|
filename = nil
|
|
947
1126
|
gem_name = ARGV[1]
|
|
@@ -967,6 +1146,18 @@ if not ARGV[0].nil? # argument(s) given
|
|
|
967
1146
|
run_bridge(filename, params)
|
|
968
1147
|
|
|
969
1148
|
when 'bridgesetup'
|
|
1149
|
+
if ARGV[1] == '--help' || ARGV[1] == '-h'
|
|
1150
|
+
puts "Usage: cli bridgesetup [FILENAME]"
|
|
1151
|
+
puts ""
|
|
1152
|
+
puts "Generate a default bridge configuration file"
|
|
1153
|
+
puts ""
|
|
1154
|
+
puts "Arguments:"
|
|
1155
|
+
puts " FILENAME Output filename (optional, default: bridge.txt)"
|
|
1156
|
+
puts ""
|
|
1157
|
+
puts "Options:"
|
|
1158
|
+
puts " -h, --help Show this help message"
|
|
1159
|
+
exit 0
|
|
1160
|
+
end
|
|
970
1161
|
ENV['OPENC3_NO_STORE'] = '1'
|
|
971
1162
|
filename = ARGV[1]
|
|
972
1163
|
filename = 'bridge.txt' unless filename
|
|
@@ -978,10 +1169,36 @@ if not ARGV[0].nil? # argument(s) given
|
|
|
978
1169
|
print_usage()
|
|
979
1170
|
|
|
980
1171
|
when 'redis'
|
|
1172
|
+
if ARGV[1] == '--help' || ARGV[1] == '-h'
|
|
1173
|
+
puts "Usage: cli redis COMMAND [ARGS...]"
|
|
1174
|
+
puts ""
|
|
1175
|
+
puts "Interact with the Redis database"
|
|
1176
|
+
puts ""
|
|
1177
|
+
puts "Commands:"
|
|
1178
|
+
puts " keys Get all Redis keys"
|
|
1179
|
+
puts " hget HASH KEY Get a value from a Redis hash"
|
|
1180
|
+
puts ""
|
|
1181
|
+
puts "Options:"
|
|
1182
|
+
puts " -h, --help Show this help message"
|
|
1183
|
+
exit 0
|
|
1184
|
+
end
|
|
981
1185
|
case (ARGV[1])
|
|
982
1186
|
when 'keys'
|
|
983
1187
|
get_redis_keys()
|
|
984
1188
|
when 'hget'
|
|
1189
|
+
if ARGV[2].nil? || ARGV[3].nil? || ARGV[2] == '--help' || ARGV[2] == '-h'
|
|
1190
|
+
puts "Usage: cli redis hget HASH KEY"
|
|
1191
|
+
puts ""
|
|
1192
|
+
puts "Get a value from a Redis hash"
|
|
1193
|
+
puts ""
|
|
1194
|
+
puts "Arguments:"
|
|
1195
|
+
puts " HASH Redis hash name (required)"
|
|
1196
|
+
puts " KEY Key within the hash (required)"
|
|
1197
|
+
puts ""
|
|
1198
|
+
puts "Options:"
|
|
1199
|
+
puts " -h, --help Show this help message"
|
|
1200
|
+
exit(ARGV[2].nil? || ARGV[3].nil? ? 1 : 0)
|
|
1201
|
+
end
|
|
985
1202
|
redis = Redis.new(url: $redis_url, username: ENV['OPENC3_REDIS_USERNAME'], password: ENV['OPENC3_REDIS_PASSWORD'])
|
|
986
1203
|
puts JSON.parse(redis.hget(ARGV[2], ARGV[3]), allow_nan: true, create_additions: true)
|
|
987
1204
|
else
|
|
@@ -990,6 +1207,16 @@ if not ARGV[0].nil? # argument(s) given
|
|
|
990
1207
|
end
|
|
991
1208
|
|
|
992
1209
|
when 'removebase'
|
|
1210
|
+
if ARGV[1] == '--help' || ARGV[1] == '-h'
|
|
1211
|
+
puts "Usage: cli removebase"
|
|
1212
|
+
puts ""
|
|
1213
|
+
puts "Remove non-enterprise tool base and admin plugins from all scopes"
|
|
1214
|
+
puts "This is typically used to support enterprise upgrades"
|
|
1215
|
+
puts ""
|
|
1216
|
+
puts "Options:"
|
|
1217
|
+
puts " -h, --help Show this help message"
|
|
1218
|
+
exit 0
|
|
1219
|
+
end
|
|
993
1220
|
# Used to remove tool base to better support enterprise upgrade
|
|
994
1221
|
scopes = OpenC3::ScopeModel.all
|
|
995
1222
|
scopes.each do |scope_name, _scope|
|
|
@@ -1005,6 +1232,16 @@ if not ARGV[0].nil? # argument(s) given
|
|
|
1005
1232
|
end
|
|
1006
1233
|
|
|
1007
1234
|
when 'removeenterprise'
|
|
1235
|
+
if ARGV[1] == '--help' || ARGV[1] == '-h'
|
|
1236
|
+
puts "Usage: cli removeenterprise"
|
|
1237
|
+
puts ""
|
|
1238
|
+
puts "Remove all enterprise plugins from all scopes"
|
|
1239
|
+
puts "This is typically used to support downgrades"
|
|
1240
|
+
puts ""
|
|
1241
|
+
puts "Options:"
|
|
1242
|
+
puts " -h, --help Show this help message"
|
|
1243
|
+
exit 0
|
|
1244
|
+
end
|
|
1008
1245
|
# Used to remove enterprise plugins to better support downgrade
|
|
1009
1246
|
scopes = OpenC3::ScopeModel.all
|
|
1010
1247
|
scopes.each do |scope_name, _scope|
|
|
@@ -1017,6 +1254,19 @@ if not ARGV[0].nil? # argument(s) given
|
|
|
1017
1254
|
end
|
|
1018
1255
|
|
|
1019
1256
|
when 'createqueue'
|
|
1257
|
+
if ARGV[1].nil? || ARGV[1] == '--help' || ARGV[1] == '-h'
|
|
1258
|
+
puts "Usage: cli createqueue QUEUE_NAME [SCOPE]"
|
|
1259
|
+
puts ""
|
|
1260
|
+
puts "Create a new queue in the specified scope"
|
|
1261
|
+
puts ""
|
|
1262
|
+
puts "Arguments:"
|
|
1263
|
+
puts " QUEUE_NAME Name of the queue to create (required)"
|
|
1264
|
+
puts " SCOPE Scope for the queue (optional, default: DEFAULT)"
|
|
1265
|
+
puts ""
|
|
1266
|
+
puts "Options:"
|
|
1267
|
+
puts " -h, --help Show this help message"
|
|
1268
|
+
exit(ARGV[1].nil? ? 1 : 0)
|
|
1269
|
+
end
|
|
1020
1270
|
queue = OpenC3::QueueModel.get(name: ARGV[1], scope: ARGV[2])
|
|
1021
1271
|
unless queue
|
|
1022
1272
|
queue = OpenC3::QueueModel.new(name: ARGV[1], state: 'RELEASE', scope: ARGV[2])
|
|
@@ -1024,13 +1274,43 @@ if not ARGV[0].nil? # argument(s) given
|
|
|
1024
1274
|
end
|
|
1025
1275
|
|
|
1026
1276
|
when 'destroyscope'
|
|
1277
|
+
if ARGV[1].nil? || ARGV[1] == '--help' || ARGV[1] == '-h'
|
|
1278
|
+
puts "Usage: cli destroyscope SCOPE_NAME"
|
|
1279
|
+
puts ""
|
|
1280
|
+
puts "Destroy a scope and all its associated data"
|
|
1281
|
+
puts ""
|
|
1282
|
+
puts "Arguments:"
|
|
1283
|
+
puts " SCOPE_NAME Name of the scope to destroy (required)"
|
|
1284
|
+
puts ""
|
|
1285
|
+
puts "Options:"
|
|
1286
|
+
puts " -h, --help Show this help message"
|
|
1287
|
+
exit(ARGV[1].nil? ? 1 : 0)
|
|
1288
|
+
end
|
|
1027
1289
|
scope = OpenC3::ScopeModel.get_model(name: ARGV[1])
|
|
1028
1290
|
scope.destroy
|
|
1029
1291
|
|
|
1030
1292
|
when 'localinit'
|
|
1293
|
+
if ARGV[1] == '--help' || ARGV[1] == '-h'
|
|
1294
|
+
puts "Usage: cli localinit"
|
|
1295
|
+
puts ""
|
|
1296
|
+
puts "Initialize local mode configuration"
|
|
1297
|
+
puts ""
|
|
1298
|
+
puts "Options:"
|
|
1299
|
+
puts " -h, --help Show this help message"
|
|
1300
|
+
exit 0
|
|
1301
|
+
end
|
|
1031
1302
|
OpenC3::LocalMode.local_init()
|
|
1032
1303
|
|
|
1033
1304
|
when 'initbuckets'
|
|
1305
|
+
if ARGV[1] == '--help' || ARGV[1] == '-h'
|
|
1306
|
+
puts "Usage: cli initbuckets"
|
|
1307
|
+
puts ""
|
|
1308
|
+
puts "Initialize all configured COSMOS buckets"
|
|
1309
|
+
puts ""
|
|
1310
|
+
puts "Options:"
|
|
1311
|
+
puts " -h, --help Show this help message"
|
|
1312
|
+
exit 0
|
|
1313
|
+
end
|
|
1034
1314
|
client = OpenC3::Bucket.getClient()
|
|
1035
1315
|
ENV.map do |key, value|
|
|
1036
1316
|
if key.match(/^OPENC3_(.+)_BUCKET$/) && !value.empty?
|
|
@@ -1040,6 +1320,15 @@ if not ARGV[0].nil? # argument(s) given
|
|
|
1040
1320
|
client.ensure_public(ENV['OPENC3_TOOLS_BUCKET'])
|
|
1041
1321
|
|
|
1042
1322
|
when 'runmigrations'
|
|
1323
|
+
if ARGV[1] == '--help' || ARGV[1] == '-h'
|
|
1324
|
+
puts "Usage: cli runmigrations"
|
|
1325
|
+
puts ""
|
|
1326
|
+
puts "Run database migrations"
|
|
1327
|
+
puts ""
|
|
1328
|
+
puts "Options:"
|
|
1329
|
+
puts " -h, --help Show this help message"
|
|
1330
|
+
exit 0
|
|
1331
|
+
end
|
|
1043
1332
|
run_migrations(ARGV[1])
|
|
1044
1333
|
|
|
1045
1334
|
else # Unknown task
|
|
@@ -96,6 +96,68 @@ APPEND_ARRAY_PARAMETER:
|
|
|
96
96
|
values: .*
|
|
97
97
|
<%= MetaConfigParser.load('_array_params.yaml').to_meta_config_yaml(4) %>
|
|
98
98
|
example: APPEND_ARRAY_PARAMETER ARRAY 64 FLOAT 640 "Array of 10 64bit floats"
|
|
99
|
+
STRUCTURE:
|
|
100
|
+
modifiers:
|
|
101
|
+
<%= MetaConfigParser.load('parameter_modifiers.yaml').to_meta_config_yaml(4) %>
|
|
102
|
+
summary: Adds and flattens a structure (generally a virtual packet) into the current packet. The specific named item is BLOCK type and hidden.
|
|
103
|
+
parameters:
|
|
104
|
+
- name: Name
|
|
105
|
+
required: true
|
|
106
|
+
description: Name of the parameter. Must be unique within the command.
|
|
107
|
+
values: .*
|
|
108
|
+
- name: Bit Offset
|
|
109
|
+
required: true
|
|
110
|
+
description: Bit offset into the command packet of the Most Significant Bit of this parameter.
|
|
111
|
+
May be negative to indicate an offset from the end of the packet.
|
|
112
|
+
Always use a bit offset of 0 for derived parameters.
|
|
113
|
+
values: '[-]?\d+'
|
|
114
|
+
- name: Bit Size
|
|
115
|
+
required: true
|
|
116
|
+
description: Bit size of this parameter. Zero or Negative values may be used
|
|
117
|
+
to indicate that a string fills the packet up to the offset from the end of
|
|
118
|
+
the packet specified by this value. If Bit Offset is 0 and Bit Size is 0 then
|
|
119
|
+
this is a derived parameter and the Data Type must be set to 'DERIVED'.
|
|
120
|
+
values: \d+
|
|
121
|
+
- name: Command or telemetry
|
|
122
|
+
required: true
|
|
123
|
+
description: Whether the structure packet is a command or telemetry packet
|
|
124
|
+
values: <%= %w(CMD COMMAND TLM TELEMETRY) %>
|
|
125
|
+
- name: Target Name
|
|
126
|
+
required: true
|
|
127
|
+
description: Target Name of the structure packet
|
|
128
|
+
values: .+
|
|
129
|
+
- name: Packet Name
|
|
130
|
+
required: true
|
|
131
|
+
description: Packet Name of the structure packet
|
|
132
|
+
values: .+
|
|
133
|
+
APPEND_STRUCTURE:
|
|
134
|
+
modifiers:
|
|
135
|
+
<%= MetaConfigParser.load('parameter_modifiers.yaml').to_meta_config_yaml(4) %>
|
|
136
|
+
summary: Adds and flattens a structure (generally a virtual packet) into the current packet. The specific named item is BLOCK type and hidden.
|
|
137
|
+
parameters:
|
|
138
|
+
- name: Name
|
|
139
|
+
required: true
|
|
140
|
+
description: Name of the parameter. Must be unique within the command.
|
|
141
|
+
values: .*
|
|
142
|
+
- name: Bit Size
|
|
143
|
+
required: true
|
|
144
|
+
description: Bit size of this parameter. Zero or Negative values may be used
|
|
145
|
+
to indicate that a string fills the packet up to the offset from the end of
|
|
146
|
+
the packet specified by this value. If Bit Offset is 0 and Bit Size is 0 then
|
|
147
|
+
this is a derived parameter and the Data Type must be set to 'DERIVED'.
|
|
148
|
+
values: \d+
|
|
149
|
+
- name: Command or telemetry
|
|
150
|
+
required: true
|
|
151
|
+
description: Whether the structure packet is a command or telemetry packet
|
|
152
|
+
values: <%= %w(CMD COMMAND TLM TELEMETRY) %>
|
|
153
|
+
- name: Target Name
|
|
154
|
+
required: true
|
|
155
|
+
description: Target Name of the structure packet
|
|
156
|
+
values: .+
|
|
157
|
+
- name: Packet Name
|
|
158
|
+
required: true
|
|
159
|
+
description: Packet Name of the structure packet
|
|
160
|
+
values: .+
|
|
99
161
|
SELECT_PARAMETER:
|
|
100
162
|
modifiers:
|
|
101
163
|
<%= MetaConfigParser.load('parameter_modifiers.yaml').to_meta_config_yaml(4) %>
|
|
@@ -176,6 +238,19 @@ ACCESSOR:
|
|
|
176
238
|
description: Additional argument passed to the accessor class constructor
|
|
177
239
|
values: .+
|
|
178
240
|
since: 5.0.10
|
|
241
|
+
SUBPACKETIZER:
|
|
242
|
+
summary: Defines a class used to break up the packet into subpackets before decom
|
|
243
|
+
description: Defines a class used to break up the packet into subpackets before decom. Defaults to nil/None.
|
|
244
|
+
parameters:
|
|
245
|
+
- name: Subpacketizer Class Name
|
|
246
|
+
required: true
|
|
247
|
+
description: The name of the Subpacketizer class
|
|
248
|
+
values: .+
|
|
249
|
+
- name: Argument
|
|
250
|
+
required: false
|
|
251
|
+
description: Additional argument passed to the Subpacketizer class constructor
|
|
252
|
+
values: .+
|
|
253
|
+
since: 6.10.0
|
|
179
254
|
TEMPLATE:
|
|
180
255
|
summary: Defines a template string used to initialize the command before default values are filled in
|
|
181
256
|
description: Generally the template string is formatted in JSON or HTML and then values are filled in with
|
|
@@ -256,6 +331,10 @@ RESTRICTED:
|
|
|
256
331
|
summary: Marks this packet as restricted and will require approval if critical commanding is enabled
|
|
257
332
|
description: Used as one of the two types of critical commands (HAZARDOUS and RESTRICTED)
|
|
258
333
|
since: 5.20.0
|
|
334
|
+
SUBPACKET:
|
|
335
|
+
summary: Marks this packet as as a subpacket which will exclude it from Interface level identification
|
|
336
|
+
description: Used with a SUBPACKETIZER to breakup up packets into subpackets at decom time
|
|
337
|
+
since: 6.10.0
|
|
259
338
|
VALIDATOR:
|
|
260
339
|
summary: Defines a validator class for a command
|
|
261
340
|
description: Validator class is used to validate the command success or failure with both a pre_check and post_check method.
|
|
@@ -176,3 +176,8 @@ LIMITS_RESPONSE:
|
|
|
176
176
|
description: Variable length number of options that will be passed to the
|
|
177
177
|
class constructor
|
|
178
178
|
values: .+
|
|
179
|
+
HIDDEN:
|
|
180
|
+
summary: Hides this item from all the OpenC3 tools
|
|
181
|
+
description: This item will not appear in PacketViewer or Item Choosers.
|
|
182
|
+
It also hides this item from appearing in the Script Runner popup helper
|
|
183
|
+
when writing scripts. The item will also not be included in decom data.
|
|
@@ -167,3 +167,8 @@ OVERFLOW:
|
|
|
167
167
|
description: How OpenC3 treats an overflow value. Only applies to signed and
|
|
168
168
|
unsigned integer data types.
|
|
169
169
|
values: <%= %w(ERROR ERROR_ALLOW_HEX TRUNCATE SATURATE) %>
|
|
170
|
+
HIDDEN:
|
|
171
|
+
summary: Hides this parameter from all the OpenC3 tools
|
|
172
|
+
description: This item will not appear in CmdSender.
|
|
173
|
+
It also hides this item from appearing in the Script Runner popup helper
|
|
174
|
+
when writing scripts. The parameter should not be provided to commands.
|
|
@@ -86,6 +86,68 @@ APPEND_ARRAY_ITEM:
|
|
|
86
86
|
description: Name of the telemety item. Must be unique within the packet.
|
|
87
87
|
values: \'
|
|
88
88
|
<%= MetaConfigParser.load('_array_params.yaml').to_meta_config_yaml(4) %>
|
|
89
|
+
STRUCTURE:
|
|
90
|
+
modifiers:
|
|
91
|
+
<%= MetaConfigParser.load('item_modifiers.yaml').to_meta_config_yaml(4) %>
|
|
92
|
+
summary: Adds and flattens a structure (generally a virtual packet) into the current packet. The specific named item is BLOCK type and hidden.
|
|
93
|
+
parameters:
|
|
94
|
+
- name: Name
|
|
95
|
+
required: true
|
|
96
|
+
description: Name of the parameter. Must be unique within the command.
|
|
97
|
+
values: .*
|
|
98
|
+
- name: Bit Offset
|
|
99
|
+
required: true
|
|
100
|
+
description: Bit offset into the command packet of the Most Significant Bit of this parameter.
|
|
101
|
+
May be negative to indicate an offset from the end of the packet.
|
|
102
|
+
Always use a bit offset of 0 for derived parameters.
|
|
103
|
+
values: '[-]?\d+'
|
|
104
|
+
- name: Bit Size
|
|
105
|
+
required: true
|
|
106
|
+
description: Bit size of this parameter. Zero or Negative values may be used
|
|
107
|
+
to indicate that a string fills the packet up to the offset from the end of
|
|
108
|
+
the packet specified by this value. If Bit Offset is 0 and Bit Size is 0 then
|
|
109
|
+
this is a derived parameter and the Data Type must be set to 'DERIVED'.
|
|
110
|
+
values: \d+
|
|
111
|
+
- name: Command or telemetry
|
|
112
|
+
required: true
|
|
113
|
+
description: Whether the structure packet is a command or telemetry packet
|
|
114
|
+
values: <%= %w(CMD COMMAND TLM TELEMETRY) %>
|
|
115
|
+
- name: Target Name
|
|
116
|
+
required: true
|
|
117
|
+
description: Target Name of the structure packet
|
|
118
|
+
values: .+
|
|
119
|
+
- name: Packet Name
|
|
120
|
+
required: true
|
|
121
|
+
description: Packet Name of the structure packet
|
|
122
|
+
values: .+
|
|
123
|
+
APPEND_STRUCTURE:
|
|
124
|
+
modifiers:
|
|
125
|
+
<%= MetaConfigParser.load('item_modifiers.yaml').to_meta_config_yaml(4) %>
|
|
126
|
+
summary: Adds and flattens a structure (generally a virtual packet) into the current packet. The specific named item is BLOCK type and hidden.
|
|
127
|
+
parameters:
|
|
128
|
+
- name: Name
|
|
129
|
+
required: true
|
|
130
|
+
description: Name of the parameter. Must be unique within the command.
|
|
131
|
+
values: .*
|
|
132
|
+
- name: Bit Size
|
|
133
|
+
required: true
|
|
134
|
+
description: Bit size of this parameter. Zero or Negative values may be used
|
|
135
|
+
to indicate that a string fills the packet up to the offset from the end of
|
|
136
|
+
the packet specified by this value. If Bit Offset is 0 and Bit Size is 0 then
|
|
137
|
+
this is a derived parameter and the Data Type must be set to 'DERIVED'.
|
|
138
|
+
values: \d+
|
|
139
|
+
- name: Command or telemetry
|
|
140
|
+
required: true
|
|
141
|
+
description: Whether the structure packet is a command or telemetry packet
|
|
142
|
+
values: <%= %w(CMD COMMAND TLM TELEMETRY) %>
|
|
143
|
+
- name: Target Name
|
|
144
|
+
required: true
|
|
145
|
+
description: Target Name of the structure packet
|
|
146
|
+
values: .+
|
|
147
|
+
- name: Packet Name
|
|
148
|
+
required: true
|
|
149
|
+
description: Packet Name of the structure packet
|
|
150
|
+
values: .+
|
|
89
151
|
SELECT_ITEM:
|
|
90
152
|
modifiers:
|
|
91
153
|
<%= MetaConfigParser.load('item_modifiers.yaml').to_meta_config_yaml(4) %>
|
|
@@ -173,6 +235,19 @@ ACCESSOR:
|
|
|
173
235
|
description: The name of the accessor class
|
|
174
236
|
values: .+
|
|
175
237
|
since: 5.0.10
|
|
238
|
+
SUBPACKETIZER:
|
|
239
|
+
summary: Defines a class used to break up the packet into subpackets before decom
|
|
240
|
+
description: Defines a class used to break up the packet into subpackets before decom. Defaults to nil/None.
|
|
241
|
+
parameters:
|
|
242
|
+
- name: Subpacketizer Class Name
|
|
243
|
+
required: true
|
|
244
|
+
description: The name of the Subpacketizer class
|
|
245
|
+
values: .+
|
|
246
|
+
- name: Argument
|
|
247
|
+
required: false
|
|
248
|
+
description: Additional argument passed to the Subpacketizer class constructor
|
|
249
|
+
values: .+
|
|
250
|
+
since: 6.10.0
|
|
176
251
|
TEMPLATE:
|
|
177
252
|
summary: Defines a template string used to pull telemetry values from a string buffer
|
|
178
253
|
parameters:
|
|
@@ -198,3 +273,7 @@ VIRTUAL:
|
|
|
198
273
|
summary: Marks this packet as virtual and not participating in identification
|
|
199
274
|
description: Used for packet definitions that can be used as structures for items with a given packet.
|
|
200
275
|
since: 5.18.0
|
|
276
|
+
SUBPACKET:
|
|
277
|
+
summary: Marks this packet as as a subpacket which will exclude it from Interface level identification
|
|
278
|
+
description: Used with a SUBPACKETIZER to breakup up packets into subpackets at decom time
|
|
279
|
+
since: 6.10.0
|
|
@@ -64,6 +64,9 @@ static ID id_ivar_packet_time = 0;
|
|
|
64
64
|
static ID id_ivar_ignore_overlap = 0;
|
|
65
65
|
static ID id_ivar_virtual = 0;
|
|
66
66
|
static ID id_ivar_restricted = 0;
|
|
67
|
+
static ID id_ivar_subpacket = 0;
|
|
68
|
+
static ID id_ivar_subpacketizer = 0;
|
|
69
|
+
static ID id_ivar_obfuscated_items = 0;
|
|
67
70
|
|
|
68
71
|
/* Sets the target name this packet is associated with. Unidentified packets
|
|
69
72
|
* will have target name set to nil.
|
|
@@ -291,6 +294,9 @@ static VALUE packet_initialize(int argc, VALUE *argv, VALUE self)
|
|
|
291
294
|
rb_ivar_set(self, id_ivar_ignore_overlap, Qfalse);
|
|
292
295
|
rb_ivar_set(self, id_ivar_virtual, Qfalse);
|
|
293
296
|
rb_ivar_set(self, id_ivar_restricted, Qfalse);
|
|
297
|
+
rb_ivar_set(self, id_ivar_subpacket, Qfalse);
|
|
298
|
+
rb_ivar_set(self, id_ivar_subpacketizer, Qnil);
|
|
299
|
+
rb_ivar_set(self, id_ivar_obfuscated_items, Qnil);
|
|
294
300
|
return self;
|
|
295
301
|
}
|
|
296
302
|
|
|
@@ -335,6 +341,9 @@ void Init_packet(void)
|
|
|
335
341
|
id_ivar_ignore_overlap = rb_intern("@ignore_overlap");
|
|
336
342
|
id_ivar_virtual = rb_intern("@virtual");
|
|
337
343
|
id_ivar_restricted = rb_intern("@restricted");
|
|
344
|
+
id_ivar_subpacket = rb_intern("@subpacket");
|
|
345
|
+
id_ivar_subpacketizer = rb_intern("@subpacketizer");
|
|
346
|
+
id_ivar_obfuscated_items = rb_intern("@obfuscated_items");
|
|
338
347
|
|
|
339
348
|
cPacket = rb_define_class_under(mOpenC3, "Packet", cStructure);
|
|
340
349
|
rb_define_method(cPacket, "initialize", packet_initialize, -1);
|