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
@@ -0,0 +1,43 @@
1
+ # encoding: ascii-8bit
2
+
3
+ # Copyright 2023 OpenC3, Inc
4
+ # All Rights Reserved.
5
+ #
6
+ # This program is free software; you can modify and/or redistribute it
7
+ # under the terms of the GNU Affero General Public License
8
+ # as published by the Free Software Foundation; version 3 with
9
+ # attribution addendums as found in the LICENSE.txt
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+
16
+ # This file may also be used under the terms of a commercial license
17
+ # if purchased from OpenC3, Inc.
18
+
19
+ require 'openc3/conversions/conversion'
20
+
21
+ module OpenC3
22
+ # Custom conversion class
23
+ # See https://openc3.com/docs/v5/telemetry#read_conversion
24
+ class <%= conversion_class %> < Conversion
25
+ def initialize
26
+ super()
27
+ # Should be one of :INT, :UINT, :FLOAT, :STRING, :BLOCK
28
+ @converted_type = :STRING
29
+ # Size of the converted type in bits
30
+ # Use 0 for :STRING or :BLOCK where the size can be variable
31
+ @converted_bit_size = 0
32
+ end
33
+
34
+ # @param value [Object] Value based on the item definition. This could be
35
+ # a string, integer, float, or array of values.
36
+ # @param packet [Packet] The packet object where the conversion is defined
37
+ # @param buffer [String] The raw packet buffer
38
+ def call(value, packet, buffer)
39
+ # Typically perform conversion logic directly on value
40
+ # e.g. value.upcase()
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,51 @@
1
+ # encoding: ascii-8bit
2
+
3
+ # Copyright 2022 OpenC3, Inc.
4
+ # All Rights Reserved.
5
+ #
6
+ # This program is free software; you can modify and/or redistribute it
7
+ # under the terms of the GNU Affero General Public License
8
+ # as published by the Free Software Foundation; version 3 with
9
+ # attribution addendums as found in the LICENSE.txt
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+
16
+ # This file may also be used under the terms of a commercial license
17
+ # if purchased from OpenC3, Inc.
18
+
19
+ require 'openc3/packets/limits_response'
20
+
21
+ module OpenC3
22
+ class <%= response_class %> < LimitsResponse
23
+ # @param packet [Packet] Packet the limits response is assigned to
24
+ # @param item [PacketItem] PacketItem the limits response is assigned to
25
+ # @param old_limits_state [Symbol] Previous value of the limit. One of nil,
26
+ # :GREEN_HIGH, :GREEN_LOW, :YELLOW, :YELLOW_HIGH, :YELLOW_LOW,
27
+ # :RED, :RED_HIGH, :RED_LOW. nil if the previous limit state has not yet
28
+ # been established.
29
+ def call(packet, item, old_limits_state)
30
+ # Take action based on the current limits state
31
+ # Delete any of the 'when' lines that do not apply or you don't care about
32
+ case item.limits.state
33
+ when :RED_HIGH
34
+ # Take action like sending a command:
35
+ # cmd('TARGET SAFE')
36
+ when :RED_LOW
37
+ when :YELLOW_LOW
38
+ when :YELLOW_HIGH
39
+ # GREEN limits are only available if a telemetry item has them defined
40
+ # COSMOS refers to these as "operational limits"
41
+ # See https://openc3.com/docs/v5/telemetry#limits
42
+ when :GREEN_LOW
43
+ when :GREEN_HIGH
44
+ # :RED and :YELLOW limits are triggered for STATES with defined RED and YELLOW states
45
+ # See https://openc3.com/docs/v5/telemetry#state
46
+ when :RED
47
+ when :YELLOW
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,62 @@
1
+ # encoding: ascii-8bit
2
+
3
+ # Copyright 2023 OpenC3, Inc.
4
+ # All Rights Reserved.
5
+ #
6
+ # This file may also be used under the terms of a commercial license
7
+ # if purchased from OpenC3, Inc.
8
+
9
+ require 'openc3/microservices/microservice'
10
+ require 'openc3/api/api'
11
+
12
+ module OpenC3
13
+ class <%= microservice_class %> < Microservice
14
+ include Api # Provides access to api methods
15
+
16
+ def initialize(name)
17
+ super(name)
18
+ @config['options'].each do |option|
19
+ # Update with your own OPTION handling
20
+ case option[0].upcase
21
+ when 'PERIOD'
22
+ @period = option[1].to_i
23
+ else
24
+ @logger.error("Unknown option passed to microservice #{@name}: #{option}")
25
+ end
26
+ end
27
+
28
+ @period = 60 unless @period # 1 minutes
29
+ @sleeper = Sleeper.new
30
+ end
31
+
32
+ def run
33
+ while true
34
+ start_time = Time.now
35
+ break if @cancel_thread
36
+
37
+ # Do your microservice work here
38
+ Logger.info("Template Microservice ran")
39
+ # cmd("INST ABORT")
40
+
41
+ # The @state variable is set to 'RUNNING' by the microservice base class
42
+ # The @state is reflected to the user in the MICROSERVICES tab so you can
43
+ # convey long running actions by changing it, e.g. @state = 'CALCULATING ...'
44
+
45
+ run_time = Time.now - start_time
46
+ delta = @period - run_time
47
+ if delta > 0
48
+ # Delay till the next period
49
+ break if @sleeper.sleep(delta) # returns true and breaks loop on shutdown
50
+ end
51
+ @count += 1
52
+ end
53
+ end
54
+
55
+ def shutdown
56
+ @sleeper.cancel # Breaks out of run()
57
+ super()
58
+ end
59
+ end
60
+ end
61
+
62
+ OpenC3::<%= microservice_class %>.run if __FILE__ == $0
@@ -0,0 +1 @@
1
+ # Set VARIABLEs here to allow variation in your plugin
@@ -2,8 +2,7 @@ SCREEN AUTO AUTO 1.0
2
2
 
3
3
  TITLE "Status"
4
4
 
5
- VERTICALBOX
6
- SECTIONHEADER "Information"
5
+ VERTICALBOX "Information"
7
6
  LABELVALUE <%= target_name %> STATUS VALUE
8
7
  LABELVALUE <%= target_name %> STATUS BOOL
9
8
  END
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openc3
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.5.0.pre.beta0
4
+ version: 5.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Melton
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-02-17 00:00:00.000000000 Z
12
+ date: 2023-02-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -692,6 +692,8 @@ files:
692
692
  - bin/openc3cli
693
693
  - bin/rubysloc
694
694
  - data/config/_array_params.yaml
695
+ - data/config/_canvas_values.yaml
696
+ - data/config/_graph_params.yaml
695
697
  - data/config/_id_items.yaml
696
698
  - data/config/_id_params.yaml
697
699
  - data/config/_interfaces.yaml
@@ -700,6 +702,7 @@ files:
700
702
  - data/config/command.yaml
701
703
  - data/config/command_modifiers.yaml
702
704
  - data/config/command_telemetry.yaml
705
+ - data/config/graph_settings.yaml
703
706
  - data/config/interface_modifiers.yaml
704
707
  - data/config/item_modifiers.yaml
705
708
  - data/config/microservice.yaml
@@ -708,6 +711,7 @@ files:
708
711
  - data/config/plugins.yaml
709
712
  - data/config/protocols.yaml
710
713
  - data/config/screen.yaml
714
+ - data/config/settings.yaml
711
715
  - data/config/table_manager.yaml
712
716
  - data/config/table_parameter_modifiers.yaml
713
717
  - data/config/target.yaml
@@ -899,7 +903,6 @@ files:
899
903
  - lib/openc3/models/timeline_model.rb
900
904
  - lib/openc3/models/tool_config_model.rb
901
905
  - lib/openc3/models/tool_model.rb
902
- - lib/openc3/models/traefik_model.rb
903
906
  - lib/openc3/models/trigger_group_model.rb
904
907
  - lib/openc3/models/trigger_model.rb
905
908
  - lib/openc3/models/widget_model.rb
@@ -985,6 +988,7 @@ files:
985
988
  - lib/openc3/utilities/bucket.rb
986
989
  - lib/openc3/utilities/bucket_file_cache.rb
987
990
  - lib/openc3/utilities/bucket_utilities.rb
991
+ - lib/openc3/utilities/cli_generator.rb
988
992
  - lib/openc3/utilities/crc.rb
989
993
  - lib/openc3/utilities/csv.rb
990
994
  - lib/openc3/utilities/local_bucket.rb
@@ -1012,17 +1016,20 @@ files:
1012
1016
  - lib/openc3/win32/win32_main.rb
1013
1017
  - tasks/gemfile_stats.rake
1014
1018
  - tasks/spec.rake
1015
- - templates/plugin-template/LICENSE.txt
1016
- - templates/plugin-template/README.md
1017
- - templates/plugin-template/Rakefile
1018
- - templates/plugin-template/plugin.gemspec
1019
- - templates/plugin-template/plugin.txt
1020
- - templates/plugin-template/targets/TARGET/cmd_tlm/cmd.txt
1021
- - templates/plugin-template/targets/TARGET/cmd_tlm/tlm.txt
1022
- - templates/plugin-template/targets/TARGET/lib/target.rb
1023
- - templates/plugin-template/targets/TARGET/procedures/procedure.rb
1024
- - templates/plugin-template/targets/TARGET/screens/status.txt
1025
- - templates/plugin-template/targets/TARGET/target.txt
1019
+ - templates/conversion/conversion.rb
1020
+ - templates/limits_response/response.rb
1021
+ - templates/microservice/microservices/TEMPLATE/microservice.rb
1022
+ - templates/plugin/LICENSE.txt
1023
+ - templates/plugin/README.md
1024
+ - templates/plugin/Rakefile
1025
+ - templates/plugin/plugin.gemspec
1026
+ - templates/plugin/plugin.txt
1027
+ - templates/target/targets/TARGET/cmd_tlm/cmd.txt
1028
+ - templates/target/targets/TARGET/cmd_tlm/tlm.txt
1029
+ - templates/target/targets/TARGET/lib/target.rb
1030
+ - templates/target/targets/TARGET/procedures/procedure.rb
1031
+ - templates/target/targets/TARGET/screens/status.txt
1032
+ - templates/target/targets/TARGET/target.txt
1026
1033
  homepage: https://github.com/OpenC3/openc3
1027
1034
  licenses:
1028
1035
  - AGPL-3.0-only
@@ -1041,9 +1048,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
1041
1048
  version: '2.7'
1042
1049
  required_rubygems_version: !ruby/object:Gem::Requirement
1043
1050
  requirements:
1044
- - - ">"
1051
+ - - ">="
1045
1052
  - !ruby/object:Gem::Version
1046
- version: 1.3.1
1053
+ version: '0'
1047
1054
  requirements: []
1048
1055
  rubygems_version: 3.3.14
1049
1056
  signing_key:
@@ -1,47 +0,0 @@
1
- # encoding: ascii-8bit
2
-
3
- # Copyright 2023 OpenC3, Inc.
4
- # All Rights Reserved.
5
- #
6
- # This program is free software; you can modify and/or redistribute it
7
- # under the terms of the GNU Affero General Public License
8
- # as published by the Free Software Foundation; version 3 with
9
- # attribution addendums as found in the LICENSE.txt
10
- #
11
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # This file may also be used under the terms of a commercial license
17
- # if purchased from OpenC3, Inc.
18
-
19
- require 'openc3/utilities/store'
20
-
21
- module OpenC3
22
- class TraefikModel
23
- def self.register_route(microservice_name:, port:, prefix:, priority: 20)
24
- prefix = '/' + prefix unless prefix[0] == '/'
25
- if ENV['KUBERNETES_SERVICE_HOST']
26
- url = "http://#{microservice_name.gsub('__', '-')}:#{port}"
27
- else
28
- url = "http://openc3-operator:#{port}"
29
- end
30
- service_name = microservice_name
31
- router_name = microservice_name
32
- Store.set("traefik/http/services/#{service_name}/loadbalancer/servers/0/url", url)
33
- Store.set("traefik/http/routers/#{router_name}/service", service_name)
34
- Store.set("traefik/http/routers/#{router_name}/priority", priority)
35
- Store.set("traefik/http/routers/#{router_name}/rule", "PathPrefix(`#{prefix}`)")
36
- end
37
-
38
- def self.unregister_route(microservice_name:)
39
- service_name = microservice_name
40
- router_name = microservice_name
41
- Store.del("traefik/http/routers/#{router_name}/rule")
42
- Store.del("traefik/http/routers/#{router_name}/priority")
43
- Store.del("traefik/http/routers/#{router_name}/service")
44
- Store.del("traefik/http/services/#{service_name}/loadbalancer/servers/0/url")
45
- end
46
- end
47
- end
@@ -1,9 +0,0 @@
1
- # Set VARIABLEs here to allow variation in your plugin
2
- # See https://openc3.com/docs/v5/plugins for more information
3
- VARIABLE <%= target_name.downcase %>_target_name <%= target_name %>
4
-
5
- # Modify this according to your actual target connection
6
- # See https://openc3.com/docs/v5/interfaces for more information
7
- TARGET <%= target_name %> <%%= <%= target_name.downcase %>_target_name %>
8
- INTERFACE <%%= <%= target_name.downcase %>_target_name %>_INT tcpip_client_interface.rb host.docker.internal 8080 8081 10.0 nil BURST
9
- MAP_TARGET <%%= <%= target_name.downcase %>_target_name %>
File without changes
File without changes
File without changes