openc3 5.5.0.pre.beta0 → 5.5.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of openc3 might be problematic. Click here for more details.

Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/bin/openc3cli +58 -74
  3. data/data/config/_canvas_values.yaml +41 -0
  4. data/data/config/_graph_params.yaml +25 -0
  5. data/data/config/graph_settings.yaml +52 -0
  6. data/data/config/interface_modifiers.yaml +4 -0
  7. data/data/config/item_modifiers.yaml +1 -1
  8. data/data/config/microservice.yaml +5 -1
  9. data/data/config/plugins.yaml +5 -0
  10. data/data/config/screen.yaml +44 -50
  11. data/data/config/settings.yaml +144 -0
  12. data/data/config/widgets.yaml +1744 -1491
  13. data/lib/openc3/api/cmd_api.rb +43 -17
  14. data/lib/openc3/api/tlm_api.rb +37 -4
  15. data/lib/openc3/bridge/bridge.rb +3 -3
  16. data/lib/openc3/bridge/bridge_config.rb +68 -20
  17. data/lib/openc3/interfaces/interface.rb +8 -0
  18. data/lib/openc3/microservices/decom_microservice.rb +0 -3
  19. data/lib/openc3/microservices/interface_microservice.rb +2 -0
  20. data/lib/openc3/microservices/reaction_microservice.rb +0 -1
  21. data/lib/openc3/models/cvt_model.rb +1 -2
  22. data/lib/openc3/models/interface_model.rb +5 -2
  23. data/lib/openc3/models/metadata_model.rb +1 -1
  24. data/lib/openc3/models/microservice_model.rb +7 -6
  25. data/lib/openc3/models/note_model.rb +1 -1
  26. data/lib/openc3/models/plugin_model.rb +17 -8
  27. data/lib/openc3/models/timeline_model.rb +1 -1
  28. data/lib/openc3/models/trigger_group_model.rb +1 -1
  29. data/lib/openc3/operators/microservice_operator.rb +2 -2
  30. data/lib/openc3/packets/packet_item.rb +1 -1
  31. data/lib/openc3/script/storage.rb +5 -5
  32. data/lib/openc3/streams/web_socket_client_stream.rb +0 -1
  33. data/lib/openc3/tools/table_manager/table_manager_core.rb +1 -2
  34. data/lib/openc3/utilities/aws_bucket.rb +22 -4
  35. data/lib/openc3/utilities/bucket_file_cache.rb +3 -2
  36. data/lib/openc3/utilities/bucket_utilities.rb +1 -1
  37. data/lib/openc3/utilities/cli_generator.rb +210 -0
  38. data/lib/openc3/utilities/local_mode.rb +2 -2
  39. data/lib/openc3/utilities/redis_secrets.rb +4 -4
  40. data/lib/openc3/utilities/secrets.rb +5 -5
  41. data/lib/openc3/utilities/target_file.rb +43 -32
  42. data/lib/openc3/version.rb +6 -6
  43. data/templates/conversion/conversion.rb +43 -0
  44. data/templates/limits_response/response.rb +51 -0
  45. data/templates/microservice/microservices/TEMPLATE/microservice.rb +62 -0
  46. data/templates/plugin/plugin.txt +1 -0
  47. data/templates/{plugin-template → target}/targets/TARGET/screens/status.txt +1 -2
  48. metadata +23 -16
  49. data/lib/openc3/models/traefik_model.rb +0 -47
  50. data/templates/plugin-template/plugin.txt +0 -9
  51. /data/templates/{plugin-template → plugin}/LICENSE.txt +0 -0
  52. /data/templates/{plugin-template → plugin}/README.md +0 -0
  53. /data/templates/{plugin-template → plugin}/Rakefile +0 -0
  54. /data/templates/{plugin-template → plugin}/plugin.gemspec +0 -0
  55. /data/templates/{plugin-template → target}/targets/TARGET/cmd_tlm/cmd.txt +0 -0
  56. /data/templates/{plugin-template → target}/targets/TARGET/cmd_tlm/tlm.txt +0 -0
  57. /data/templates/{plugin-template → target}/targets/TARGET/lib/target.rb +0 -0
  58. /data/templates/{plugin-template → target}/targets/TARGET/procedures/procedure.rb +0 -0
  59. /data/templates/{plugin-template → target}/targets/TARGET/target.txt +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 47eef747a6f82da0e4cdf93863f00357e07be1002d58762c4345c611e53da9a5
4
- data.tar.gz: 6b6b804cac37eab03765a619aedd6ec4e6d4e8a9dfe5048507d23bd9c0987542
3
+ metadata.gz: a2b1524aa1d06a8149e80ffb2843b3a9304d73cf432ecd641396292bf5209439
4
+ data.tar.gz: f35947a803088cb83705c3748fb860751cf40228a5c4720d151c867a001157ce
5
5
  SHA512:
6
- metadata.gz: 9f862cfdc31ded71fe8eaa59f8771ccb88d45b0363fa17636c6ed8a0c1cfcb30343f4850b57fba89dc9fd221e9a70cb7af7524081bb4d7f24e8d263c816b3879
7
- data.tar.gz: 3604545c30b970d8ed6e6c0bf69c8d6ba0eeffefd3cb0c043d65ea140dfb15936bcd3d9ffb94bdb21493d40c05213838bdf7df215ee12597e41275cc903d16ee
6
+ metadata.gz: 245f9f7fe39f5ac4f82bab653de55f413432b3ad9f73b586f2d82f2a14e50bcd6d77a5bc11e1b4a9a2f95c4b11c2aef55dcc325ab330da076ecdb7f0245fb374
7
+ data.tar.gz: 2f142eea4029f7b1efd3564578413e09d23acd6b9136799d123db48e733577d28a50c3e90640143e20e8f092874ec08c277df6ca721cf2a33bc4c1ffeabf42ba
data/bin/openc3cli CHANGED
@@ -26,6 +26,7 @@
26
26
  require 'openc3'
27
27
  require 'openc3/utilities/local_mode'
28
28
  require 'openc3/utilities/bucket'
29
+ require 'openc3/utilities/cli_generator'
29
30
  require 'openc3/models/scope_model'
30
31
  require 'openc3/models/plugin_model'
31
32
  require 'openc3/models/gem_model'
@@ -42,20 +43,17 @@ require 'json'
42
43
  require 'redis'
43
44
  require 'erb'
44
45
  require 'pp'
45
- # require 'psych' # Psych code is commented out
46
46
  require "irb"
47
47
  require "irb/completion"
48
48
 
49
49
  $redis_url = "redis://#{ENV['OPENC3_REDIS_HOSTNAME']}:#{ENV['OPENC3_REDIS_PORT']}"
50
- # Initialize the connection to the bucket library
51
- OpenC3::Bucket.getClient()
52
50
 
53
51
  # Build the OpenStruct and OptionParser here as constants so we can use in methods
54
52
  MIGRATE_OPTIONS = OpenStruct.new
55
53
  MIGRATE_OPTIONS.all = false
56
54
  MIGRATE_PARSER = OptionParser.new do |op|
57
- op.banner = "cli migrate PLUGIN [TGT1...] # Create a OpenC3 plugin from existing COSMOS 4 targets"
58
- op.on("-a", "--all", " Move all COSMOS 4 targets into a single OpenC3 plugin") do
55
+ op.banner = "cli migrate PLUGIN [TGT1...] # Create a OpenC3 plugin from existing COSMOS 4 targets"
56
+ op.on("-a", "--all", " Move all COSMOS 4 targets into a single OpenC3 plugin") do
59
57
  MIGRATE_OPTIONS.all = true
60
58
  end
61
59
  end
@@ -69,9 +67,10 @@ def print_usage
69
67
  puts " cli irb # Runs irb in the local directory"
70
68
  puts " cli validate /PATH/FILENAME.gem SCOPE variables.txt # Validate a COSMOS plugin gem file"
71
69
  puts " cli load /PATH/FILENAME.gem SCOPE variables.txt # Loads a COSMOS plugin gem file"
72
- puts " cli generate plugin PLUGIN_NAME # Generate a COSMOS plugin"
70
+ puts " cli generate TYPE OPTIONS # Generate various COSMOS entities"
73
71
  puts " #{MIGRATE_PARSER}"
74
72
  puts " cli bridge CONFIG_FILENAME # Run COSMOS host bridge"
73
+ puts " cli bridgegem gem_name variable1=value1 variable2=value2 # Runs bridge using gem bridge.txt"
75
74
  puts " cli bridgesetup CONFIG_FILENAME # Create a default config file"
76
75
  puts " cli geminstall GEMFILENAME SCOPE # Install loaded gem to /gems"
77
76
  puts " cli rubysloc # Counts Ruby SLOC recursively. Run with --help for more info."
@@ -80,55 +79,6 @@ def print_usage
80
79
  puts ""
81
80
  end
82
81
 
83
- def generate(args)
84
- case args[0]
85
- when 'plugin'
86
- if args.length != 2
87
- abort("Usage: cli generate plugin <NAME>")
88
- end
89
- if args[1] =~ /\s/
90
- abort("Plugin names can not have spaces!")
91
- end
92
-
93
- plugin = args[1].downcase.gsub(/_+|-+/, '-')
94
- plugin_name = "openc3-cosmos-#{plugin}"
95
- if File.exist?(plugin_name)
96
- abort("Plugin #{plugin_name} already exists!")
97
- end
98
- FileUtils.mkdir(plugin_name)
99
- Dir.chdir(plugin_name) # Change to the plugin path to make copying easier
100
-
101
- # Grab the plugin template
102
- template_dir = "#{File.dirname(__FILE__)}/../templates/plugin-template"
103
- target_name = plugin.upcase.gsub('-', '_')
104
- target_lib_filename = "#{target_name.downcase}.rb"
105
- target_class = target_lib_filename.filename_to_class_name
106
- target_object = target_name.downcase
107
- b = binding
108
-
109
- Dir.glob("#{template_dir}/**/*").each do |file|
110
- base_name = file.sub("#{template_dir}/", '')
111
- # Rename the template TARGET to our actual target named after the plugin
112
- base_name.sub!("targets/TARGET", "targets/#{target_name}")
113
- if File.directory?(file)
114
- FileUtils.mkdir(base_name)
115
- next
116
- end
117
- base_name.sub!("target.rb", target_lib_filename)
118
- base_name.sub!("plugin.gemspec", "#{plugin_name}.gemspec")
119
- output = ERB.new(File.read(file), trim_mode: "-").result(b)
120
- File.open(base_name, 'w') do |file|
121
- file.write output
122
- end
123
- end
124
-
125
- puts "Plugin #{plugin_name} successfully generated!\n"
126
- return target_name # This makes the migrate method easier
127
- else # Unknown generator
128
- abort("Unknown generator #{args[0]}")
129
- end
130
- end
131
-
132
82
  def migrate(args)
133
83
  MIGRATE_PARSER.parse!(args)
134
84
  abort(MIGRATE_PARSER.to_s) if args.length == 0
@@ -151,7 +101,7 @@ def migrate(args)
151
101
  # NOTE: generate does a chdir to be inside the plugin directory
152
102
  ###############################################################
153
103
  plugin = args.shift
154
- target_name = generate(['plugin', plugin])
104
+ target_name = OpenC3::CliGenerator.generate(['plugin', plugin])
155
105
  # Delete target contents from the plugin framework (but keep directory)
156
106
  FileUtils.rm_rf Dir.glob("targets/#{target_name}/*")
157
107
 
@@ -263,10 +213,6 @@ def xtce_converter(args)
263
213
  puts e.backtrace
264
214
  result = ERROR_CODE
265
215
  ensure
266
- # Uninstall not necessary because this is run against a temporary container
267
- # name = Psych.safe_load(`gem spec #{options[:plugin]} name`).to_s
268
- # version = Psych.safe_load(`gem spec #{options[:plugin]} version`, permitted_classes: [Gem::Version]).to_s
269
- # Gem::Uninstaller.new(name, {:version => version, :force => true}).uninstall
270
216
  exit(result)
271
217
  end
272
218
  else
@@ -318,10 +264,6 @@ rescue => e
318
264
  puts "Error: #{e.message}"
319
265
  result = ERROR_CODE
320
266
  ensure
321
- # Uninstall not necessary because this is run against a temporary container
322
- # name = Psych.safe_load(`gem spec #{plugin_file_path} name`).to_s
323
- # version = Psych.safe_load(`gem spec #{plugin_file_path} version`, permitted_classes: [Gem::Version]).to_s
324
- # Gem::Uninstaller.new(name, {:version => version, :force => true}).uninstall
325
267
  exit(result)
326
268
  end
327
269
 
@@ -524,6 +466,26 @@ def run_migrations(folder)
524
466
  end
525
467
  end
526
468
 
469
+ def run_bridge(filename, params)
470
+ variables = {}
471
+ params.each do |param|
472
+ name, value = param.split('=')
473
+ if name and value
474
+ variables[name] = value
475
+ else
476
+ raise "Invalid variable passed to bridgegem (syntax name=value): #{param}"
477
+ end
478
+ end
479
+ bridge = OpenC3::Bridge.new(filename, variables)
480
+ begin
481
+ while true
482
+ sleep(1)
483
+ end
484
+ rescue Interrupt
485
+ exit(0)
486
+ end
487
+ end
488
+
527
489
  if not ARGV[0].nil? # argument(s) given
528
490
 
529
491
  # Handle each task
@@ -551,7 +513,7 @@ if not ARGV[0].nil? # argument(s) given
551
513
  gem_install(ARGV[1], scope: ARGV[2])
552
514
 
553
515
  when 'generate'
554
- generate(ARGV[1..-1])
516
+ OpenC3::CliGenerator.generate(ARGV[1..-1])
555
517
 
556
518
  when 'migrate'
557
519
  migrate(ARGV[1..-1])
@@ -569,14 +531,34 @@ if not ARGV[0].nil? # argument(s) given
569
531
  ENV['OPENC3_NO_STORE'] = '1'
570
532
  filename = ARGV[1]
571
533
  filename = 'bridge.txt' unless filename
572
- bridge = OpenC3::Bridge.new(filename)
573
- begin
574
- while true
575
- sleep(1)
534
+ params = ARGV[2..-1]
535
+ params = [] unless params
536
+ run_bridge(filename, params)
537
+
538
+ when 'bridgegem'
539
+ ENV['OPENC3_NO_STORE'] = '1'
540
+ filename = nil
541
+ gem_name = ARGV[1]
542
+ Gem::Specification.each do |s|
543
+ # This appears to return the newest version of each gem first,
544
+ # so its ok that we stop on the first time it is found
545
+ if s.name == gem_name
546
+ if Array === Gem.path
547
+ Gem.path.each do |gem_path|
548
+ filename = File.join(gem_path, 'gems', "#{s.name}-#{s.version}", 'bridge.txt')
549
+ puts "Trying #{filename}"
550
+ break if File.exist?(filename)
551
+ end
552
+ else
553
+ filename = File.join(Gem.path, 'gems', "#{s.name}-#{s.version}", 'bridge.txt')
554
+ end
555
+ raise "#{filename} not found" unless File.exist?(filename)
576
556
  end
577
- rescue Interrupt
578
- exit(0)
579
557
  end
558
+ raise "gem #{gem_name} not found" unless filename
559
+ params = ARGV[2..-1]
560
+ params = [] unless params
561
+ run_bridge(filename, params)
580
562
 
581
563
  when 'bridgesetup'
582
564
  ENV['OPENC3_NO_STORE'] = '1'
@@ -637,9 +619,11 @@ if not ARGV[0].nil? # argument(s) given
637
619
 
638
620
  when 'initbuckets'
639
621
  client = OpenC3::Bucket.getClient()
640
- client.create(ENV['OPENC3_CONFIG_BUCKET'])
641
- client.create(ENV['OPENC3_LOGS_BUCKET'])
642
- client.create(ENV['OPENC3_TOOLS_BUCKET'])
622
+ ENV.map do |key, value|
623
+ if key.match(/^OPENC3_(.+)_BUCKET$/) && !value.empty?
624
+ client.create(value)
625
+ end
626
+ end
643
627
  client.ensure_public(ENV['OPENC3_TOOLS_BUCKET'])
644
628
 
645
629
  when 'runmigrations'
@@ -0,0 +1,41 @@
1
+ VALUE_EQ:
2
+ summary: Map a value to a color
3
+ parameters:
4
+ - name: Value
5
+ required: true
6
+ description: State or value
7
+ values: .+
8
+ - name: Color
9
+ required: true
10
+ description: Color of the line
11
+ values: .+
12
+ # TODO: At one point for CANVASIMAGEVALUE, CANVASLABELVALUE, and CANVASLINEVALUE
13
+ # supported VALUE_GT, VALUE_GTEQ, VALUE_LT, VALUE_LTEQ
14
+ # which are identical to VALUE_EQ except greater than, less than.
15
+ # They also supported TLM_AND and TLM_OR defined as:
16
+ ### TLM_AND
17
+ # The TLM_AND setting allows added another comparison that is anded with the original comparison for a canvas value widget to determine 'ON' state
18
+ # | Parameter | Description | Required |
19
+ # | --------------- | ---------------------------------------------------------------------------- | -------- |
20
+ # | Target Name | The target name portion of the telemetry mnemonic | Yes |
21
+ # | Packet Name | The packet name portion of the telemetry mnemonic | Yes |
22
+ # | Item Name | The item name portion of the telemetry mnemonic | Yes |
23
+ # | Comparison Type | The comparison type: VALUE_EQ, VALUE_GT, VALUE_GTEQ, VALUE_LT, or VALUE_LTEQ | Yes |
24
+ # | Value | The value to compare against | Yes |
25
+ # Example Usage:
26
+ # CANVASIMAGEVALUE INST HEALTH_STATUS TEMP1 "ground" 400 100
27
+ # SETTING VALUE_LTEQ 10.0
28
+ # SETTING TLM_AND INST HEALTH_STATUS TEMP2 VALUE_GT 20.0
29
+ ### TLM_OR
30
+ #The TLM_OR setting allows added another comparison that is ored with the original comparison for a canvas value widget to determine 'ON' state
31
+ # | Parameter | Description | Required |
32
+ # | --------------- | ---------------------------------------------------------------------------- | -------- |
33
+ # | Target Name | The target name portion of the telemetry mnemonic | Yes |
34
+ # | Packet Name | The packet name portion of the telemetry mnemonic | Yes |
35
+ # | Item Name | The item name portion of the telemetry mnemonic | Yes |
36
+ # | Comparison Type | The comparison type: VALUE_EQ, VALUE_GT, VALUE_GTEQ, VALUE_LT, or VALUE_LTEQ | Yes |
37
+ # | Value | The value to compare against | Yes |
38
+ # Example Usage:
39
+ # CANVASIMAGEVALUE INST HEALTH_STATUS TEMP1 "ground" 400 100
40
+ # SETTING VALUE_LTEQ 10.0
41
+ # SETTING TLM_OR INST HEALTH_STATUS TEMP2 VALUE_GT 20.0
@@ -0,0 +1,25 @@
1
+ ---
2
+ - name: Target name
3
+ required: true
4
+ description: The target name
5
+ values: .+
6
+ - name: Packet name
7
+ required: true
8
+ description: The packet name
9
+ values: .+
10
+ - name: Item name
11
+ required: true
12
+ description: The item name
13
+ values: .+
14
+ - name: Value type
15
+ required: false
16
+ description: The type of the value to display. Default is CONVERTED.
17
+ values: <%= %w(RAW CONVERTED) %>
18
+ - name: Reduced
19
+ required: false
20
+ description: Whether to display reduced data. Default is DECOM.
21
+ values: <%= %w(DECOM REDUCED_MINUTE REDUCED_HOUR REDUCED_DAY) %>
22
+ - name: Reduced Type
23
+ required: false
24
+ description: The type of reduce data to display. Only applies if Reduced is not DECOM.
25
+ values: <%= %w(MIN MAX AVG STDDEV) %>
@@ -0,0 +1,52 @@
1
+ ---
2
+ ITEM:
3
+ summary: Add a telemetry item to the graph
4
+ parameters:
5
+ # Inject the graph parameters
6
+ <%= MetaConfigParser.load('_graph_params.yaml').to_meta_config_yaml(4) %>
7
+ STARTTIME:
8
+ summary: Start the graph history at the designated Time
9
+ parameters:
10
+ - name: Start Time
11
+ required: true
12
+ description: Start time as formatted 'YYYY/MM/DD HH:MM:SS'
13
+ values: .+
14
+ HISTORY:
15
+ summary: Display an initial history of data
16
+ parameters:
17
+ - name: Value
18
+ required: true
19
+ description: Value{d,h,m,s}. For example 1d, 2h, 30m, 15s
20
+ values: .+
21
+ SECONDSGRAPHED:
22
+ summary: Display the specified number of seconds in the graph
23
+ parameters:
24
+ - name: Time
25
+ required: true
26
+ description: Number of seconds to display
27
+ values: .+
28
+ POINTSSAVED:
29
+ summary: Save the number of seconds in graph memory
30
+ parameters:
31
+ - name: Time
32
+ required: true
33
+ description: Number of seconds to save
34
+ values: .+
35
+ POINTSGRAPHED:
36
+ summary: Number of points to display on the graph
37
+ parameters:
38
+ - name: Time
39
+ required: true
40
+ description: Number of points to graph
41
+ values: .+
42
+ SIZE:
43
+ summary: Size of the graph
44
+ parameters:
45
+ - name: Width
46
+ required: true
47
+ description: Width in pixels
48
+ values: .+
49
+ - name: Height
50
+ required: true
51
+ description: Height in pixels
52
+ values: .+
@@ -111,3 +111,7 @@ SECRET:
111
111
  required: false
112
112
  description: Interface option to pass the secret value
113
113
  values: .*
114
+ - name: Secret Store Name
115
+ required: false
116
+ description: Name of the secret store for stores with multipart keys
117
+ values: .*
@@ -52,7 +52,7 @@ READ_CONVERSION:
52
52
  @multiplier = multiplier.to_f
53
53
  end
54
54
  def call(value, packet, buffer)
55
- return value * multiplier
55
+ return value * @multiplier
56
56
  end
57
57
  end
58
58
  end
@@ -102,10 +102,14 @@ MICROSERVICE:
102
102
  required: true
103
103
  description: The name of the secret to retrieve
104
104
  values: .*
105
- - name: Environment Variable of File Path
105
+ - name: Environment Variable or File Path
106
106
  required: true
107
107
  description: Environment variable name or file path to store secret
108
108
  values: .*
109
+ - name: Secret Store Name
110
+ required: false
111
+ description: Name of the secret store for stores with multipart keys
112
+ values: .*
109
113
  ROUTE_PREFIX:
110
114
  summary: Prefix of route
111
115
  description: Prefix of route to the microservice to expose externally with Traefik
@@ -13,6 +13,11 @@ VARIABLE:
13
13
  required: true
14
14
  description: Default value of the variable
15
15
  values: .+
16
+ NEEDS_DEPENDENCIES:
17
+ summary: Indicates the plugin needs dependencies and sets the GEM_HOME environment variable
18
+ description: If the plugin has a top level lib folder or lists runtime dependencies in the gemspec,
19
+ NEEDS_DEPENDENCIES is effectively already set. Note that in Enterprise Edition, having
20
+ NEEDS_DEPENDENCIES adds the NFS volume mount to the Kuberentes pod.
16
21
  INTERFACE:
17
22
  modifiers:
18
23
  <%= MetaConfigParser.load('interface_modifiers.yaml').to_meta_config_yaml(4) %>
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  SCREEN:
3
3
  summary: Define a telemetry viewer screen
4
+ description: The SCREEN keyword is the first keyword in any telemetry screen definition.
5
+ It defines the name of the screen and parameters that affect the screen overall.
4
6
  parameters:
5
7
  - name: Width
6
8
  required: true
@@ -16,6 +18,8 @@ SCREEN:
16
18
  required: true
17
19
  description: Number of seconds between screen updates
18
20
  values: '[0-9]*\.?[0-9]+'
21
+ example: |
22
+ SCREEN AUTO AUTO 1.0 FIXED
19
23
  END:
20
24
  summary: Indicates the close of a layout widget
21
25
  description: All layout widgets must be closed to properly identify where they
@@ -29,6 +33,8 @@ STALE_TIME:
29
33
  description: Items from packets with RECEIVED_TIMESECONDS greater than this value in the past will be marked stale.
30
34
  The default is 30s. Recommend a minimum of 2s to avoid false positives due to race conditions.
31
35
  values: \d+
36
+ example: |
37
+ STALE_TIME 5 # Number of seconds to wait before marking data stale
32
38
  GLOBAL_SETTING:
33
39
  summary: Applies a widget setting to all widgets of a certain type
34
40
  parameters:
@@ -39,19 +45,14 @@ GLOBAL_SETTING:
39
45
  values: .+
40
46
  - name: Setting Name
41
47
  required: true
42
- description: Widget specific setting name. OpenC3 defines several settings
43
- which apply across many different widget types. However, you can also use
44
- the 'RAW' setting which allows any stylesheet values.
45
- values: <%= %w(TEXTALIGN PADDING MARGIN BACKCOLOR TEXTCOLOR BORDERCOLOR WIDTH HEIGHT RAW) %>
48
+ description: See SETTING for details.
49
+ values: .+
46
50
  - name: Setting Value(s)
47
51
  required: false
48
- description: >
49
- The setting value which varies by setting. Note that color
50
- settings can be given as a common string, e.g. 'red', or by RGB values,
51
- e.g. 255 0 0. If the setting is a length the units are required, e.g. 200px.
52
- If the setting is RAW the value should be the raw stylesheet
53
- key and value, e.g. font-size 10px
52
+ description: See SETTING for details.
54
53
  values: .*
54
+ example: |
55
+ GLOBAL_SETTING LABELVALUELIMITSBAR COLORBLIND TRUE
55
56
  GLOBAL_SUBSETTING:
56
57
  summary: Applies a widget subsetting to all widgets of a certain type
57
58
  description: Subsettings are only valid for widgets that are
@@ -68,42 +69,33 @@ GLOBAL_SUBSETTING:
68
69
  values: .+
69
70
  - name: Subwidget Index
70
71
  required: true
71
- description: Index to the desired subwidget or 'ALL' to apply the setting
72
- to all the subwidgets of this composite widget.
72
+ description: Index to the desired subwidget
73
73
  values: .+
74
74
  - name: Setting Name
75
75
  required: true
76
- description: Widget specific setting name. OpenC3 defines several settings
77
- which apply across many different widget types. However, you can also use
78
- the 'RAW' setting which allows any stylesheet values.
79
- values: <%= %w(TEXTALIGN PADDING MARGIN BACKCOLOR TEXTCOLOR BORDERCOLOR WIDTH HEIGHT RAW) %>
76
+ description: See SETTING for details.
77
+ values: .+
80
78
  - name: Setting Value(s)
81
79
  required: false
82
- description: >
83
- The setting value which varies by setting. Note that color
84
- settings can be given as a common string, e.g. 'red', or by RGB values,
85
- e.g. 255 0 0. If the setting is a length the units are required, e.g. 200px.
86
- If the setting is RAW the value should be the raw stylesheet
87
- key and value, e.g. font-size 10px
80
+ description: See SETTING for details.
88
81
  values: .*
82
+ example: |
83
+ GLOBAL_SUBSETTING LABELVALUELIMITSBAR 1 COLORBLIND TRUE
84
+ # Set all text color to white for labelvaluelimitsbars
85
+ GLOBAL_SUBSETTING LABELVALUELIMITSBAR 0:0 TEXTCOLOR white
89
86
  SETTING:
90
87
  summary: Applies a widget setting to the previously defined widget
91
- parameters:
92
- - name: Setting Name
93
- required: true
94
- description: Widget specific setting name. OpenC3 defines several settings
95
- which apply across many different widget types. However, you can also use
96
- the 'RAW' setting which allows any stylesheet values.
97
- values: <%= %w(TEXTALIGN PADDING MARGIN BACKCOLOR TEXTCOLOR BORDERCOLOR WIDTH HEIGHT RAW) %>
98
- - name: Setting Value(s)
99
- required: false
100
- description: >
101
- The setting value which varies by setting. Note that color
102
- settings can be given as a common string, e.g. 'red', or by RGB values,
103
- e.g. 255 0 0. If the setting is a length the units are required, e.g. 200px.
104
- If the setting is RAW the value should be the raw stylesheet
105
- key and value, e.g. font-size 10px
106
- values: .*
88
+ description: |
89
+ Settings allow for additional tweaks and options to be applied to widgets
90
+ that are not available in their parameters. These settings are all configured
91
+ through the SETTING, SUBSETTING, GLOBAL_SETTING and GLOBAL_SUBSETTING keywords.
92
+ SETTING and SUBSETTING applies only to the widget defined immediately before it.
93
+ GLOBAL_SETTING and GLOBAL_SUBSETTING applies to all widgets.
94
+
95
+ Common wiget settings are defined here. Some widgets define their own
96
+ unqiue settings which are documented under that specific widget.
97
+ collection:
98
+ <%= MetaConfigParser.load('settings.yaml').to_meta_config_yaml(4) %>
107
99
  SUBSETTING:
108
100
  summary: Applies a widget subsetting to the previously defined widget
109
101
  description: Subsettings are only valid for widgets that are
@@ -120,19 +112,19 @@ SUBSETTING:
120
112
  values: .+
121
113
  - name: Setting Name
122
114
  required: true
123
- description: Widget specific setting name. OpenC3 defines several settings
124
- which apply across many different widget types. However, you can also use
125
- the 'RAW' setting which allows any stylesheet.
126
- values: <%= %w(TEXTALIGN PADDING MARGIN BACKCOLOR TEXTCOLOR BORDERCOLOR WIDTH HEIGHT RAW) %>
115
+ description: See SETTING for details.
116
+ values: .+
127
117
  - name: Setting Value(s)
128
118
  required: false
129
- description: >
130
- The setting value which varies by setting. Note that color
131
- settings can be given as a common string, e.g. 'red', or by RGB values,
132
- e.g. 255 0 0. If the setting is a length the units are required, e.g. 200px.
133
- If the setting is RAW the value should be the raw stylesheet
134
- key and value, e.g. font-size 10px
119
+ description: See SETTING for details.
135
120
  values: .*
121
+ example: |
122
+ VERTICALBOX
123
+ LABELVALUE INST HEALTH_STATUS TEMP1
124
+ SUBSETTING 0 TEXTCOLOR blue # Change the label's text to blue
125
+ LABELVALUELIMITSBAR INST HEALTH_STATUS TEMP1
126
+ SUBSETTING 0:0 TEXTCOLOR green # Change the label's text to green
127
+ END
136
128
  NAMED_WIDGET:
137
129
  summary: Name a widget to allow access to it via the getNamedWidget method
138
130
  description: To programatically access parts of a telemetry screen you need
@@ -154,6 +146,8 @@ NAMED_WIDGET:
154
146
  required: true
155
147
  description: The unique parameters for the given widget type
156
148
  values: .+
157
- # Even though these are technically SCREEN modifiers we load them at the top_frame
158
- # level so they appear as available keywords
149
+ example: |
150
+ NAMED_WIDGET DURATION TEXTFIELD
151
+ BUTTON "Push" "screen.getNamedWidget('DURATION').text()"
152
+
159
153
  <%= MetaConfigParser.load('widgets.yaml').to_meta_config_yaml(0) %>