openc3 6.4.1 → 6.5.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.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/bin/openc3cli +172 -97
  3. data/data/config/_graph_params.yaml +4 -4
  4. data/data/config/conversions.yaml +274 -0
  5. data/data/config/item_modifiers.yaml +8 -70
  6. data/data/config/parameter_modifiers.yaml +9 -69
  7. data/data/config/plugins.yaml +14 -1
  8. data/data/config/processors.yaml +51 -0
  9. data/data/config/telemetry_modifiers.yaml +1 -0
  10. data/lib/openc3/api/api.rb +1 -1
  11. data/lib/openc3/api/tlm_api.rb +10 -5
  12. data/lib/openc3/conversions/unix_time_conversion.rb +2 -2
  13. data/lib/openc3/conversions/unix_time_formatted_conversion.rb +3 -3
  14. data/lib/openc3/conversions/unix_time_seconds_conversion.rb +3 -3
  15. data/lib/openc3/core_ext/time.rb +2 -9
  16. data/lib/openc3/microservices/cleanup_microservice.rb +2 -2
  17. data/lib/openc3/microservices/decom_microservice.rb +2 -2
  18. data/lib/openc3/microservices/interface_microservice.rb +18 -12
  19. data/lib/openc3/microservices/log_microservice.rb +4 -2
  20. data/lib/openc3/microservices/multi_microservice.rb +2 -2
  21. data/lib/openc3/microservices/periodic_microservice.rb +2 -2
  22. data/lib/openc3/microservices/reducer_microservice.rb +2 -2
  23. data/lib/openc3/microservices/router_microservice.rb +2 -2
  24. data/lib/openc3/microservices/scope_cleanup_microservice.rb +2 -2
  25. data/lib/openc3/microservices/text_log_microservice.rb +19 -6
  26. data/lib/openc3/models/plugin_model.rb +5 -4
  27. data/lib/openc3/models/scope_model.rb +87 -57
  28. data/lib/openc3/models/script_engine_model.rb +93 -0
  29. data/lib/openc3/models/script_status_model.rb +26 -4
  30. data/lib/openc3/models/target_model.rb +33 -5
  31. data/lib/openc3/packets/packet_config.rb +1 -1
  32. data/lib/openc3/script/autonomic.rb +359 -0
  33. data/lib/openc3/script/script.rb +6 -1
  34. data/lib/openc3/script_engines/script_engine.rb +118 -0
  35. data/lib/openc3/topics/interface_topic.rb +23 -3
  36. data/lib/openc3/utilities/cli_generator.rb +42 -15
  37. data/lib/openc3/utilities/running_script.rb +1460 -0
  38. data/lib/openc3/version.rb +6 -6
  39. data/templates/conversion/conversion.py +1 -1
  40. data/templates/conversion/conversion.rb +1 -1
  41. data/templates/processor/processor.py +32 -0
  42. data/templates/processor/processor.rb +36 -0
  43. data/templates/tool_angular/package.json +2 -2
  44. data/templates/tool_react/package.json +1 -1
  45. data/templates/tool_svelte/package.json +1 -1
  46. data/templates/tool_vue/package.json +3 -3
  47. data/templates/widget/package.json +2 -2
  48. metadata +9 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 864ffdf1957f4dc816dc54fb49e31da9b824ade6d4ff0e016dc81d0b4eaafc0c
4
- data.tar.gz: ad01826136970333f93f6fd24199b5c9f6d21245c342db1709f035a35d09ae49
3
+ metadata.gz: 5c28c663c7d3743f9bb095a0818ae486accf2f1bb69f5079ec95788153f3005f
4
+ data.tar.gz: 64a60dc5bad2e3cdc78953b2dbd49a689d4b91a08e80bf8a2c4668b308a811bf
5
5
  SHA512:
6
- metadata.gz: 8d3515bdd13040340bb39ac3d0bc51478c65b57e9b42ed31b11e6c10ed4228c4eccb9f7228cd2f7271e533bd66a9eee42e386f91ffabaf7c4e5179cc9ddd6efb
7
- data.tar.gz: 2ef03561529805ed8f09037ab664477071bf6d8e672095b979ad828ce8cddc819ec056999b022df0dd1f522254a36f58bf9b31656ce3845b12c65869eb8f011b
6
+ metadata.gz: 88c76af077c0feeec36831656367e9a5c2ff4968d8d567a6d3822f4a7dec1afea33d4921aa6d5941f97c4234a85da68aa7ef7b1767eeb629650a85589f9db673
7
+ data.tar.gz: 0c548964225e629edff50e0666347eedcc8e6b0d9fb7ab5d134fb0a206e481ba2353568fa6ab99f0fbdfdc6758c62eec7320deeb1c0a37a4448544b2ee26215d
data/bin/openc3cli CHANGED
@@ -15,7 +15,7 @@
15
15
  # GNU Affero General Public License for more details.
16
16
 
17
17
  # Modified by OpenC3, Inc.
18
- # All changes Copyright 2024, OpenC3, Inc.
18
+ # All changes Copyright 2025, OpenC3, Inc.
19
19
  # All Rights Reserved
20
20
  #
21
21
  # This file may also be used under the terms of a commercial license
@@ -62,14 +62,7 @@ def print_usage
62
62
  puts " cli help # Displays this information"
63
63
  puts " cli rake # Runs rake in the local directory"
64
64
  puts " cli irb # Runs irb in the local directory"
65
- puts " cli script list /PATH SCOPE # lists script names filtered by path within scope, 'DEFAULT' if not given"
66
- puts " cli script spawn NAME SCOPE variable1=value1 variable2=value2 # Starts named script remotely"
67
- puts " cli script run NAME SCOPE variable1=value1 variable2=value2 # Starts named script, monitoring status on console,\
68
- by default until error or exit"
69
- puts " cli script init # initialize running scripts (Enterprise Only)"
70
- puts " PARAMETERS name-value pairs to form the script's runtime environment"
71
- puts " OPTIONS: --wait 0 seconds to monitor status before detaching from the running script; ie --wait 100"
72
- puts " --disconnect run the script in disconnect mode"
65
+ puts " cli script # Interact with scripts. Run with --help for more info."
73
66
  puts " cli validate /PATH/FILENAME.gem SCOPE variables.txt # Validate a COSMOS plugin gem file"
74
67
  puts " cli load /PATH/FILENAME.gem SCOPE variables.txt # Loads a COSMOS plugin gem file"
75
68
  puts " cli list <SCOPE> # Lists installed plugins, SCOPE is DEFAULT if not given"
@@ -619,86 +612,180 @@ def cli_script_monitor(script_id)
619
612
  return ret_code
620
613
  end
621
614
 
622
- def cli_script_list(args=[])
623
- path = ''
624
- if (args[0] && args[0][0] == '/')
625
- path = (args.shift)[1..-1]+'/'
615
+ def get_env_from_args(args)
616
+ # Figure out if there are any optional environment variables
617
+ # args[0] is the command, args[1] is the script file
618
+ # args[2..-1] are environment variables specified as NAME=VALUE
619
+ environ = {}
620
+ if args.length > 2
621
+ args[2..-1].each do |arg|
622
+ name, value = arg.split('=')
623
+ if name and value
624
+ environ[name] = value
625
+ end
626
+ end
626
627
  end
627
- scope = args[1]
628
- scope ||= 'DEFAULT'
628
+ return environ
629
+ end
630
+
631
+ def cli_script_init
629
632
  require 'openc3/script'
630
- script_list(scope: scope).each do |script_name|
631
- puts(script_name) if script_name.start_with?(path)
632
- end
633
+ initialize_offline_access()
633
634
  return 0
634
635
  end
635
636
 
636
- def cli_script_run(disconnect=false, environment={}, args=[])
637
- # we are limiting the wait for status, not the script run time
638
- # we make 0 mean 'forever'
637
+ def cli_script_list(args, options)
638
+ require 'openc3/script'
639
+ puts script_list(scope: options[:scope])
640
+ return 0
641
+ end
642
+
643
+ def cli_script_run(args, options)
644
+ environment = get_env_from_args(args)
645
+
639
646
  ret_code = ERROR_CODE
640
- wait_limit = 0
641
- if (i = args.index('--wait'))
642
- begin
643
- args.delete('--wait')
644
- # pull out the flag
645
- seconds = args[i]
646
- wait_limit = Integer(seconds, 10) # only decimal, ignore leading 0
647
- args.delete_at(i)
648
- # and its value
649
- rescue ArgumentError
650
- abort(" --wait requires a number of seconds to wait, not [#{seconds}]")
651
- end
652
- end
653
- abort("No script file provided") if args[0].nil?
654
- scope = args[1]
655
- scope ||= 'DEFAULT'
656
647
  require 'openc3/script'
657
- id = script_run(args[0], disconnect: disconnect, environment: environment, scope: scope) # could raise
658
- $script_interrupt_text = " Script #{args[0]} still running remotely.\n" # for Ctrl-C
659
- if (wait_limit < 1) then
660
- ret_code = cli_script_monitor(id)
661
- else
662
- Timeout::timeout(wait_limit, nil, "--wait #{wait_limit} exceeded") do
648
+ if (id = script_run(args[1], disconnect: options[:disconnect], environment: environment, scope: options[:scope]))
649
+ puts id
650
+ $script_interrupt_text = " Script #{args[1]} still running remotely.\n" # for Ctrl-C
651
+ if (options[:wait] < 1) then
663
652
  ret_code = cli_script_monitor(id)
664
- rescue Timeout::ExitException, Timeout::Error => e
665
- # Timeout exceptions are also raised by the Websocket API, so we check
666
- if e.message =~ /^--wait /
667
- puts e.message + ", detaching from running script #{args[0]}"
668
- else
669
- raise
653
+ else
654
+ Timeout::timeout(options[:wait], nil, "--wait #{options[:wait]} exceeded") do
655
+ ret_code = cli_script_monitor(id)
656
+ rescue Timeout::ExitException, Timeout::Error => e
657
+ # Timeout exceptions are also raised by the Websocket API, so we check
658
+ if e.message =~ /^--wait /
659
+ puts e.message + ", detaching from running script #{args[1]}"
660
+ else
661
+ raise
662
+ end
670
663
  end
671
664
  end
672
665
  end
673
666
  return ret_code
667
+ rescue => e
668
+ puts "Error running script: #{e.message}"
669
+ puts "Have you called 'script init'?"
670
+ puts e.backtrace
671
+ return ERROR_CODE
674
672
  end
675
673
 
676
- def cli_script_spawn(disconnect=false, environment={}, args=[])
674
+ def cli_script_spawn(args, options)
675
+ environment = get_env_from_args(args)
676
+
677
677
  ret_code = ERROR_CODE
678
- if (args.index('--wait'))
679
- abort("Did you mean \"script run --wait <seconds> [...]\"?")
680
- end
681
- abort("No script file provided") if args[0].nil?
682
- # heaven help you if you left out the script name
683
- scope = args[1]
684
- scope ||= 'DEFAULT'
685
678
  require 'openc3/script'
686
- if (id = script_run(args[0], disconnect: disconnect, environment: environment, scope: scope))
679
+ if (id = script_run(args[1], disconnect: options[:disconnect], environment: environment, scope: options[:scope]))
687
680
  puts id
688
681
  ret_code = 0
689
682
  end
690
683
  return ret_code
684
+ rescue => e
685
+ puts "Error running script: #{e.message}"
686
+ puts "Have you called 'script init'?"
687
+ puts e.backtrace
688
+ return ERROR_CODE
691
689
  end
692
690
 
693
- def cli_script_init
691
+ def cli_script_running(args, options)
692
+ ret_code = ERROR_CODE
694
693
  require 'openc3/script'
695
- initialize_offline_access()
694
+ if args[1]
695
+ limit = args[1].to_i
696
+ else
697
+ limit = 100
698
+ end
699
+ if args[2]
700
+ offset = args[2].to_i
701
+ else
702
+ offset = 0
703
+ end
704
+ if (list = running_script_list(limit: limit, offset: offset, scope: options[:scope]))
705
+ if options[:verbose]
706
+ pp list
707
+ else
708
+ printf("%-5s %-20s %-30s %-22s %-10s\n", "ID", "User", "Filename", "Start Time", "State")
709
+ list.each do |hash|
710
+ printf("%-5s %-20s %-30s %-22s %-10s\n", hash['name'], hash['user_full_name'], hash['filename'], hash['start_time'], hash['state'])
711
+ end
712
+ end
713
+ ret_code = 0
714
+ end
715
+ return ret_code
716
+ rescue => e
717
+ puts "Error getting script status for #{args[1]}: #{e.message}"
718
+ puts "Have you called 'script init'?"
719
+ puts e.backtrace
720
+ return ERROR_CODE
721
+ end
722
+
723
+ def cli_script_status(args, options)
724
+ ret_code = ERROR_CODE
725
+ require 'openc3/script'
726
+ if (hash = script_get(args[1], scope: options[:scope]))
727
+ if options[:verbose]
728
+ pp hash
729
+ else
730
+ printf("%-5s %-20s %-30s %-22s %-10s\n", "ID", "User", "Filename", "Start Time", "State")
731
+ printf("%-5s %-20s %-30s %-22s %-10s\n", hash['name'], hash['user_full_name'], hash['filename'], hash['start_time'], hash['state'])
732
+ end
733
+ ret_code = 0
734
+ end
735
+ return ret_code
736
+ rescue => e
737
+ puts "Error getting script status for #{args[1]}: #{e.message}"
738
+ puts "Have you called 'script init'?"
739
+ puts e.backtrace
740
+ return ERROR_CODE
741
+ end
742
+
743
+ def cli_script_stop(args, options)
744
+ require 'openc3/script'
745
+ running_script_stop(args[1], scope: options[:scope])
696
746
  return 0
747
+ rescue => e
748
+ puts "Error stopping script #{args[1]}: #{e.message}"
749
+ puts "Have you called 'script init'?"
750
+ puts e.backtrace
751
+ return ERROR_CODE
697
752
  end
698
753
 
699
- ## cli_script(args) turns an ARGV of [spawn|run] <--wait 123...> <--disconnect> SCRIPT <scope> <ENV_A=1 ENV_B=2 ...>
700
- # into function calls and tidied parameters to remote-control a script via RunningScriptWebSocketApi
701
754
  def cli_script(args=[])
755
+ options = {scope: 'DEFAULT', disconnect: false, wait: 0, verbose: false}
756
+ option_parser = OptionParser.new do |opts|
757
+ opts.banner = "Usage: script --scope SCOPE [init | list | spawn | run]\n" +
758
+ " init Initialize running scripts (Enterprise Only)\n" +
759
+ " list List scripts in the specified scope\n" +
760
+ " spawn SCRIPT [ENV=VALUE] Spawn SCRIPT in the specified scope with optional env vars and return script ID\n" +
761
+ " run SCRIPT [ENV=VALUE] Run SCRIPT in the specified scope with optional env vars and print script output\n" +
762
+ " running [LIMIT] [OFFSET] Get a list of all running scripts (limit 100 by default). Use LIMIT and OFFSET to get large batches.\n" +
763
+ " status SCRIPT_ID Get status for the running script given by SCRIPT_ID\n" +
764
+ " stop SCRIPT_ID Stop the running script given by SCRIPT_ID\n"
765
+ opts.on("-h", "--help", "Show this message") do
766
+ puts opts
767
+ exit
768
+ end
769
+ opts.on("--scope SCOPE", "Run with specified scope (default = DEFAULT)") do |arg|
770
+ options[:scope] = arg
771
+ end
772
+ opts.on("-d", "--disconnect", "Run a script in disconnect mode (default = false)") do |arg|
773
+ options[:disconnect] = arg
774
+ end
775
+ opts.on("-w SECONDS", "--wait SECONDS", "*run only* - wait for the specified number of seconds before aborting script monitoring") do |arg|
776
+ options[:wait] = Integer(arg)
777
+ end
778
+ opts.on("-v", "--verbose", "*status only* - output ALL status information") do |arg|
779
+ options[:verbose] = arg
780
+ end
781
+ end
782
+
783
+ begin
784
+ option_parser.parse!(args)
785
+ rescue
786
+ abort(option_parser.to_s)
787
+ end
788
+
702
789
  ret_code = ERROR_CODE
703
790
  check_environment()
704
791
  # Double check for the OPENC3_API_PASSWORD because it is absolutely required
@@ -706,38 +793,30 @@ def cli_script(args=[])
706
793
  if ENV['OPENC3_API_PASSWORD'].nil? or ENV['OPENC3_API_PASSWORD'].empty?
707
794
  abort "OPENC3_API_PASSWORD environment variable is required for cli script"
708
795
  end
709
- command = args.shift
710
- # pull out the disconnect flag
711
- discon = args.delete('--disconnect')
712
- discon = (discon.is_a? String) ? true : false
713
- environ = {}
714
- args.each do |arg|
715
- name, value = arg.split('=')
716
- if name and value
717
- # add env[k]=v ; pull out "k=v"
718
- environ[name] = value
719
- args.delete(arg)
720
- end
721
- end
796
+
797
+ # The script command is the first parameter and it is required
798
+ command = args[0]
799
+ abort(option_parser.to_s) unless command
800
+
722
801
  case command
723
- # for list
724
- # args[] should now be ["/<path>", "<scope>"]
725
- # or ["/<path>"]
726
- # or ["<scope>"]
727
- # or []
802
+ when 'init'
803
+ ret_code = cli_script_init()
728
804
  when 'list'
729
- ret_code = cli_script_list(args)
730
- # for spawn or run
731
- # args[] should now be ["--wait 100", "script_name", "<scope>"]
732
- # or ["--wait 100", "script_name"]
733
- # or ["script_name", "<scope>"]
734
- # or ["script_name"]
805
+ ret_code = cli_script_list(args, options)
735
806
  when 'spawn'
736
- ret_code = cli_script_spawn(discon, environ, args)
807
+ abort(option_parser.to_s) unless args[1] # script file is required
808
+ ret_code = cli_script_spawn(args, options)
737
809
  when 'run'
738
- ret_code = cli_script_run(discon, environ, args)
739
- when 'init'
740
- ret_code = cli_script_init()
810
+ abort(option_parser.to_s) unless args[1] # script file is required
811
+ ret_code = cli_script_run(args, options)
812
+ when 'running'
813
+ ret_code = cli_script_running(args, options)
814
+ when 'status'
815
+ abort(option_parser.to_s) unless args[1] # script ID is required
816
+ ret_code = cli_script_status(args, options)
817
+ when 'stop'
818
+ abort(option_parser.to_s) unless args[1] # script ID is required
819
+ ret_code = cli_script_stop(args, options)
741
820
  else
742
821
  abort 'openc3cli internal error: parsing arguments'
743
822
  end
@@ -754,13 +833,7 @@ if not ARGV[0].nil? # argument(s) given
754
833
  IRB.start
755
834
 
756
835
  when 'script'
757
- case ARGV[1]
758
- when 'list', 'run', 'spawn', 'init'
759
- cli_script(ARGV[1..-1])
760
- else
761
- # invalid actions, misplaced and malformed leading options and 'help' come here
762
- abort("cli script <action> must be one of #{CLI_SCRIPT_ACTIONS}, not [#{ARGV[1]}]")
763
- end
836
+ cli_script(ARGV[1..-1])
764
837
 
765
838
  when 'rake'
766
839
  if File.exist?('Rakefile')
@@ -790,6 +863,8 @@ if not ARGV[0].nil? # argument(s) given
790
863
  cli_pkg_uninstall(ARGV[1], scope: ARGV[2])
791
864
 
792
865
  when 'generate'
866
+ # To test against a local copy call this file from the root cosmos directory like this:
867
+ # ruby -Iopenc3/lib openc3/bin/openc3cli generate ...
793
868
  OpenC3::CliGenerator.generate(ARGV[1..-1])
794
869
 
795
870
  when 'rubysloc'
@@ -1,17 +1,17 @@
1
1
  ---
2
- - name: Target name
2
+ - name: Target Name
3
3
  required: true
4
4
  description: The target name
5
5
  values: .+
6
- - name: Packet name
6
+ - name: Packet Name
7
7
  required: true
8
8
  description: The packet name
9
9
  values: .+
10
- - name: Item name
10
+ - name: Item Name
11
11
  required: true
12
12
  description: The item name
13
13
  values: .+
14
- - name: Value type
14
+ - name: Value Type
15
15
  required: false
16
16
  description: The type of the value to display. Default is CONVERTED.
17
17
  values: <%= %w(RAW CONVERTED) %>
@@ -0,0 +1,274 @@
1
+ BIT_REVERSE_CONVERSION:
2
+ summary: Reverses the bits of the current telemetry item. Can be used as both a read and write conversion.
3
+ ruby_example: |
4
+ READ_CONVERSION bit_reverse_conversion.rb
5
+ WRITE_CONVERSION bit_reverse_conversion.rb
6
+ python_example: |
7
+ READ_CONVERSION openc3/conversions/bit_reverse_conversion.py
8
+ WRITE_CONVERSION openc3/conversions/bit_reverse_conversion.py
9
+ IP_READ_CONVERSION:
10
+ summary: Reads a packed 32 bit integer into an IP address string
11
+ description: |
12
+ This command reads a packed 32 bit integer into an IP address string.
13
+ For example, 0xFFFF8000 would be converted to '255.255.128.0'.
14
+ ruby_example: READ_CONVERSION ip_read_conversion.rb
15
+ python_example: READ_CONVERSION openc3/conversions/ip_read_conversion.py
16
+ IP_WRITE_CONVERSION:
17
+ summary: Write an ip address string into a packed 32 bit integer
18
+ description: |
19
+ This command writes an IP address string into a packed 32 bit integer. The IP address
20
+ string should be in the format 'x.x.x.x' where x is a number between 0 and 255.
21
+ For example, '255.255.128.0' would be converted to 0xFFFF8000.
22
+ ruby_example: WRITE_CONVERSION ip_write_conversion.rb
23
+ python_example: WRITE_CONVERSION openc3/conversions/ip_write_conversion.py
24
+ OBJECT_READ_CONVERSION:
25
+ summary: Reads values from the given packet object
26
+ description: |
27
+ This command reads all the values from the given packet object. The values are
28
+ returned as a Ruby hash or Python dict. The packet object must be defined in the target's configuration.
29
+ parameters:
30
+ - name: Command or Telemetry
31
+ required: true
32
+ description: Whether the packet is a command or telemetry
33
+ values: [CMD, TLM]
34
+ - name: Target Name
35
+ required: true
36
+ description: Name of the target
37
+ values: .*
38
+ - name: Packet Name
39
+ required: true
40
+ description: Name of the packet
41
+ values: .*
42
+ ruby_example: READ_CONVERSION object_read_conversion.rb CMD INST COLLECT
43
+ python_example: READ_CONVERSION openc3/conversions/object_read_conversion.py CMD INST COLLECT
44
+ OBJECT_WRITE_CONVERSION:
45
+ summary: Writes values into the given packet object
46
+ description: |
47
+ This command writes values into the given packet object. The values are specified
48
+ in a hash format where the keys are the field names in the packet and the values
49
+ are the values to write. The packet object must be defined in the target's configuration.
50
+ parameters:
51
+ - name: Command or Telemetry
52
+ required: true
53
+ description: Whether the packet is a command or telemetry
54
+ values: [CMD, TLM]
55
+ - name: Target Name
56
+ required: true
57
+ description: Name of the target
58
+ values: .*
59
+ - name: Packet Name
60
+ required: true
61
+ description: Name of the packet
62
+ values: .*
63
+ ruby_example: WRITE_CONVERSION object_write_conversion.rb CMD INST COLLECT
64
+ python_example: WRITE_CONVERSION openc3/conversions/object_write_conversion.py CMD INST COLLECT
65
+ PACKET_TIME_FORMATTED_CONVERSION:
66
+ summary: Converts the packet time to a formatted string like "YYYY/MM/DD HH:MM:SS.US"
67
+ description: |
68
+ This in an internal conversion which is automatically applied to the
69
+ 'PACKET_TIMEFORMATTED' derived telemetry item. It is typically not explicitly used.
70
+ For more information see the [Received Time and Packet Time](/docs/configuration/telemetry#received-time-and-packet-time) documentation.
71
+ ruby_example: READ_CONVERSION packet_time_formatted_conversion.rb
72
+ python_example: READ_CONVERSION openc3/conversions/packet_time_formatted_conversion.py
73
+ PACKET_TIME_SECONDS_CONVERSION:
74
+ summary: Converts the packet time to a floating point number of seconds since the epoch
75
+ description: |
76
+ This in an internal conversion which is automatically applied to the
77
+ 'PACKET_TIMESECONDS' derived telemetry item. It is typically not explicitly used.
78
+ For more information see the [Received Time and Packet Time](/docs/configuration/telemetry#received-time-and-packet-time) documentation.
79
+ ruby_example: READ_CONVERSION packet_time_seconds_conversion.rb
80
+ python_example: READ_CONVERSION openc3/conversions/packet_time_seconds_conversion.py
81
+ POLYNOMIAL_CONVERSION:
82
+ summary: Adds a polynomial conversion factor to the current item. Can be used as both a read and write conversion.
83
+ description:
84
+ For commands, the conversion factor is applied to raw value set by the user (via tool or script)
85
+ before it is written into the binary command packet and sent. For telemetry, the conversion factor
86
+ is applied to the raw value in the telemetry packet before it is displayed to the user. The user still
87
+ has the ability to see the raw unconverted value in a details dialog.
88
+ parameters:
89
+ - name: C0
90
+ required: true
91
+ description: Coefficient
92
+ values: .*
93
+ - name: Cx
94
+ required: false
95
+ description: Additional coefficient values for the conversion. Any order
96
+ polynomial conversion may be used so the value of 'x' will vary with the
97
+ order of the polynomial. Note that larger order polynomials take longer
98
+ to process than shorter order polynomials, but are sometimes more accurate.
99
+ values: .*
100
+ ruby_example: |
101
+ READ_CONVERSION polynomial_conversion.rb 10 0.5 0.25
102
+ # Since this is a common conversion it has an alias:
103
+ POLY_READ_CONVERSION 10 0.5 0.25
104
+
105
+ WRITE_CONVERSION polynomial_conversion.rb 10 0.5 0.25
106
+ # Since this is a common conversion it has an alias:
107
+ POLY_WRITE_CONVERSION 10 0.5 0.25
108
+ python_example: |
109
+ READ_CONVERSION openc3/conversions/polynomial_conversion.py 10 0.5 0.25
110
+ # Since this is a common conversion it has an alias:
111
+ POLY_READ_CONVERSION 10 0.5 0.25
112
+
113
+ WRITE_CONVERSION openc3/conversions/polynomial_conversion.py 10 0.5 0.25
114
+ # Since this is a common conversion it has an alias:
115
+ POLY_WRITE_CONVERSION 10 0.5 0.25
116
+ PROCESSOR_CONVERSION:
117
+ summary: Read a value from a processor
118
+ description: |
119
+ This command reads a value from a processor. The value is read from the
120
+ processor's available values. The processor must be defined in the target's configuration.
121
+ See the [Processor](/docs/configuration/processors) documentation for more information.
122
+ parameters:
123
+ - name: Processor Name
124
+ required: true
125
+ description: Name of the processor
126
+ values: .*
127
+ - name: Processor Value
128
+ required: true
129
+ description: Published processor value
130
+ values: .*
131
+ ruby_example: |
132
+ PROCESSOR TEMP1WATER watermark_processor.rb TEMP1
133
+ ITEM TEMP1HIGH 0 0 DERIVED "High-water mark for TEMP1"
134
+ READ_CONVERSION processor_conversion.rb TEMP1WATER HIGH_WATER
135
+ python_example: |
136
+ PROCESSOR TEMP1WATER openc3/conversions/watermark_processor.py TEMP1
137
+ ITEM TEMP1HIGH 0 0 DERIVED "High-water mark for TEMP1"
138
+ READ_CONVERSION openc3/conversions/processor_conversion.py TEMP1WATER HIGH_WATER
139
+ RECEIVED_COUNT_CONVERSION:
140
+ summary: Converts the packet received count to a UINT 32 value
141
+ description: |
142
+ This in an internal conversion which is automatically applied to the
143
+ 'RECEIVED_COUNT' derived telemetry item. It is typically not explicitly used.
144
+ ruby_example: READ_CONVERSION received_count_conversion.rb
145
+ python_example: READ_CONVERSION openc3/conversions/received_count_conversion.py
146
+ RECEIVED_TIME_FORMATTED_CONVERSION:
147
+ summary: Converts the packet received time to a formatted string like "YYYY/MM/DD HH:MM:SS.US"
148
+ description: |
149
+ This in an internal conversion which is automatically applied to the
150
+ 'RECEIVED_TIMEFORMATTED' derived telemetry item. It is typically not explicitly used.
151
+ For more information see the [Received Time and Packet Time](/docs/configuration/telemetry#received-time-and-packet-time) documentation.
152
+ ruby_example: READ_CONVERSION received_time_formatted_conversion.rb
153
+ python_example: READ_CONVERSION openc3/conversions/received_time_formatted_conversion.py
154
+ RECEIVED_TIME_SECONDS_CONVERSION:
155
+ summary: Converts the packet received to a floating point number of seconds since the epoch
156
+ description: |
157
+ This in an internal conversion which is automatically applied to the
158
+ 'RECEIVED_TIMESECONDS' derived telemetry item. It is typically not explicitly used.
159
+ For more information see the [Received Time and Packet Time](/docs/configuration/telemetry#received-time-and-packet-time) documentation.
160
+ ruby_example: READ_CONVERSION received_time_formatted_conversion.rb
161
+ python_example: READ_CONVERSION openc3/conversions/received_time_formatted_conversion.py
162
+ SEGMENTED_POLYNOMIAL_CONVERSION:
163
+ summary: Adds a segmented polynomial conversion factor to the current item. Can be used as both a read and write conversion.
164
+ description:
165
+ For commands, this conversion factor is applied to the raw value set by the user
166
+ (via tool or script) before it is written into the binary command packet and sent.
167
+ For telemetry, the conversion factor is applied to the raw value in the telemetry packet
168
+ before it is displayed to the user. The user still has the ability to see the raw
169
+ unconverted value in a details dialog.
170
+ parameters:
171
+ - name: Lower Bound
172
+ required: true
173
+ description:
174
+ Defines the lower bound of the range of values that this segmented
175
+ polynomial applies to. Is ignored for the segment with the smallest lower bound.
176
+ values: .*
177
+ - name: C0
178
+ required: true
179
+ description: Coefficient
180
+ values: .*
181
+ - name: Cx
182
+ required: false
183
+ description: Additional coefficient values for the conversion. Any order
184
+ polynomial conversion may be used so the value of 'x' will vary with the
185
+ order of the polynomial. Note that larger order polynomials take longer
186
+ to process than shorter order polynomials, but are sometimes more accurate.
187
+ values: .*
188
+ ruby_example: |
189
+ READ_CONVERSION segmented_polynomial_conversion.rb 0 10 0.5 0.25 # Apply the conversion to all values < 50
190
+ # Since this is a common conversion it has an alias:
191
+ SEG_POLY_READ_CONVERSION 10 0.5 0.25 0 10 0.5 0.25 # Apply the conversion to all values < 50
192
+ SEG_POLY_READ_CONVERSION 50 11 0.5 0.275 # Apply the conversion to all values >= 50 and < 100
193
+ SEG_POLY_READ_CONVERSION 100 12 0.5 0.3 # Apply the conversion to all values >= 100
194
+
195
+ WRITE_CONVERSION segmented_polynomial_conversion.rb 0 10 0.5 0.25 # Apply the conversion to all values < 50
196
+ # Since this is a common conversion it has an alias:
197
+ SEG_POLY_WRITE_CONVERSION 10 0.5 0.25 0 10 0.5 0.25 # Apply the conversion to all values < 50
198
+ SEG_POLY_WRITE_CONVERSION 50 11 0.5 0.275 # Apply the conversion to all values >= 50 and < 100
199
+ SEG_POLY_WRITE_CONVERSION 100 12 0.5 0.3 # Apply the conversion to all values >= 100
200
+ python_example: |
201
+ READ_CONVERSION openc3/conversions/segmented_polynomial_conversion.py 0 10 0.5 0.25 # Apply the conversion to all values < 50
202
+ # Since this is a common conversion it has an alias:
203
+ SEG_POLY_READ_CONVERSION 10 0.5 0.25 0 10 0.5 0.25 # Apply the conversion to all values < 50
204
+ SEG_POLY_READ_CONVERSION 50 11 0.5 0.275 # Apply the conversion to all values >= 50 and < 100
205
+ SEG_POLY_READ_CONVERSION 100 12 0.5 0.3 # Apply the conversion to all values >= 100
206
+
207
+ WRITE_CONVERSION openc3/conversions/segmented_polynomial_conversion.py 0 10 0.5 0.25 # Apply the conversion to all values < 50
208
+ # Since this is a common conversion it has an alias:
209
+ SEG_POLY_WRITE_CONVERSION 10 0.5 0.25 0 10 0.5 0.25 # Apply the conversion to all values < 50
210
+ SEG_POLY_WRITE_CONVERSION 50 11 0.5 0.275 # Apply the conversion to all values >= 50 and < 100
211
+ SEG_POLY_WRITE_CONVERSION 100 12 0.5 0.3 # Apply the conversion to all values >= 100
212
+ UNIX_TIME_CONVERSION:
213
+ summary: Converts values to a native Ruby or Python time object
214
+ parameters:
215
+ - name: Seconds Item Name
216
+ required: true
217
+ description: The name of the item which contains the seconds since the epoch.
218
+ values: .*
219
+ - name: Microseconds Item Name
220
+ required: false
221
+ description: The name of the item which contains the microseconds since the epoch.
222
+ values: .*
223
+ - name: Seconds Type
224
+ required: false
225
+ description: How to read the seconds item. Defaults to 'RAW'.
226
+ values: [RAW, CONVERTED]
227
+ - name: Microseconds Type
228
+ required: false
229
+ description: How to read the microseconds item. Defaults to 'RAW'.
230
+ values: [RAW, CONVERTED]
231
+ ruby_example: READ_CONVERSION unix_time_conversion.rb TIMESEC TIMEUS
232
+ python_example: READ_CONVERSION openc3/conversions/unix_time_conversion.py TIMESEC TIMEUS
233
+ UNIX_TIME_FORMATTED_CONVERSION:
234
+ summary: Converts values to a formatted time string like "YYYY/MM/DD HH:MM:SS.US"
235
+ parameters:
236
+ - name: Seconds Item Name
237
+ required: true
238
+ description: The name of the item which contains the seconds since the epoch.
239
+ values: .*
240
+ - name: Microseconds Item Name
241
+ required: false
242
+ description: The name of the item which contains the microseconds since the epoch.
243
+ values: .*
244
+ - name: Seconds Type
245
+ required: false
246
+ description: How to read the seconds item. Defaults to 'RAW'.
247
+ values: [RAW, CONVERTED]
248
+ - name: Microseconds Type
249
+ required: false
250
+ description: How to read the microseconds item. Defaults to 'RAW'.
251
+ values: [RAW, CONVERTED]
252
+ ruby_example: READ_CONVERSION unix_time_formatted_conversion.rb TIMESEC TIMEUS
253
+ python_example: READ_CONVERSION openc3/conversions/unix_time_formatted_conversion.py TIMESEC TIMEUS
254
+ UNIX_TIME_SECONDS_CONVERSION:
255
+ summary: Converts values to a floating point number of seconds since the epoch
256
+ parameters:
257
+ - name: Seconds Item Name
258
+ required: true
259
+ description: The name of the item which contains the seconds since the epoch.
260
+ values: .*
261
+ - name: Microseconds Item Name
262
+ required: false
263
+ description: The name of the item which contains the microseconds since the epoch.
264
+ values: .*
265
+ - name: Seconds Type
266
+ required: false
267
+ description: How to read the seconds item. Defaults to 'RAW'.
268
+ values: [RAW, CONVERTED]
269
+ - name: Microseconds Type
270
+ required: false
271
+ description: How to read the microseconds item. Defaults to 'RAW'.
272
+ values: [RAW, CONVERTED]
273
+ ruby_example: READ_CONVERSION unix_time_seconds_conversion.rb TIMESEC TIMEUS
274
+ python_example: READ_CONVERSION openc3/conversions/unix_time_seconds_conversion.py TIMESEC TIMEUS