openc3 5.10.0 → 5.11.0

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 (94) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/Rakefile +3 -2
  4. data/data/config/target.yaml +9 -0
  5. data/ext/openc3/ext/packet/packet.c +3 -0
  6. data/ext/openc3/ext/reducer_microservice/extconf.rb +13 -0
  7. data/ext/openc3/ext/reducer_microservice/reducer_microservice.c +165 -0
  8. data/ext/openc3/ext/structure/structure.c +7 -9
  9. data/lib/openc3/accessors/accessor.rb +53 -3
  10. data/lib/openc3/accessors/binary_accessor.rb +16 -0
  11. data/lib/openc3/accessors/cbor_accessor.rb +3 -3
  12. data/lib/openc3/accessors/form_accessor.rb +78 -0
  13. data/lib/openc3/accessors/http_accessor.rb +145 -0
  14. data/lib/openc3/accessors/json_accessor.rb +19 -3
  15. data/lib/openc3/accessors/xml_accessor.rb +18 -1
  16. data/lib/openc3/accessors.rb +3 -1
  17. data/lib/openc3/config/config_parser.rb +7 -5
  18. data/lib/openc3/config/meta_config_parser.rb +1 -1
  19. data/lib/openc3/core_ext/string.rb +16 -1
  20. data/lib/openc3/interfaces/http_client_interface.rb +202 -0
  21. data/lib/openc3/interfaces/http_server_interface.rb +183 -0
  22. data/lib/openc3/interfaces/interface.rb +86 -16
  23. data/lib/openc3/interfaces/mqtt_interface.rb +6 -5
  24. data/lib/openc3/interfaces/protocols/burst_protocol.rb +11 -11
  25. data/lib/openc3/interfaces/protocols/cobs_protocol.rb +7 -7
  26. data/lib/openc3/interfaces/protocols/crc_protocol.rb +7 -7
  27. data/lib/openc3/interfaces/protocols/length_protocol.rb +6 -6
  28. data/lib/openc3/interfaces/protocols/preidentified_protocol.rb +9 -5
  29. data/lib/openc3/interfaces/protocols/protocol.rb +8 -6
  30. data/lib/openc3/interfaces/protocols/slip_protocol.rb +8 -8
  31. data/lib/openc3/interfaces/protocols/template_protocol.rb +6 -7
  32. data/lib/openc3/interfaces/protocols/terminated_protocol.rb +4 -4
  33. data/lib/openc3/interfaces/simulated_target_interface.rb +2 -0
  34. data/lib/openc3/interfaces/stream_interface.rb +6 -4
  35. data/lib/openc3/interfaces/tcpip_server_interface.rb +2 -0
  36. data/lib/openc3/interfaces/udp_interface.rb +8 -5
  37. data/lib/openc3/interfaces.rb +2 -0
  38. data/lib/openc3/logs/buffered_packet_log_writer.rb +6 -7
  39. data/lib/openc3/logs/log_writer.rb +2 -10
  40. data/lib/openc3/logs/packet_log_constants.rb +13 -3
  41. data/lib/openc3/logs/packet_log_reader.rb +35 -98
  42. data/lib/openc3/logs/packet_log_writer.rb +24 -62
  43. data/lib/openc3/logs/text_log_writer.rb +32 -6
  44. data/lib/openc3/microservices/cleanup_microservice.rb +23 -16
  45. data/lib/openc3/microservices/decom_microservice.rb +8 -20
  46. data/lib/openc3/microservices/log_microservice.rb +3 -1
  47. data/lib/openc3/microservices/reaction_microservice.rb +22 -11
  48. data/lib/openc3/microservices/reducer_microservice.rb +174 -130
  49. data/lib/openc3/{models/notification_model.rb → microservices/scope_cleanup_microservice.rb} +20 -21
  50. data/lib/openc3/microservices/text_log_microservice.rb +2 -5
  51. data/lib/openc3/microservices/timeline_microservice.rb +0 -1
  52. data/lib/openc3/microservices/trigger_group_microservice.rb +6 -3
  53. data/lib/openc3/migrations/20230915000002_no_scope_log_messages.rb +44 -0
  54. data/lib/openc3/models/microservice_model.rb +1 -1
  55. data/lib/openc3/models/scope_model.rb +65 -34
  56. data/lib/openc3/models/target_model.rb +25 -5
  57. data/lib/openc3/models/tool_model.rb +14 -2
  58. data/lib/openc3/models/widget_model.rb +1 -1
  59. data/lib/openc3/packets/json_packet.rb +10 -2
  60. data/lib/openc3/packets/packet.rb +37 -22
  61. data/lib/openc3/packets/packet_config.rb +6 -2
  62. data/lib/openc3/packets/parsers/packet_item_parser.rb +11 -6
  63. data/lib/openc3/packets/structure.rb +19 -12
  64. data/lib/openc3/packets/structure_item.rb +0 -3
  65. data/lib/openc3/script/storage.rb +1 -1
  66. data/lib/openc3/script/web_socket_api.rb +17 -14
  67. data/lib/openc3/topics/command_decom_topic.rb +0 -4
  68. data/lib/openc3/topics/telemetry_decom_topic.rb +0 -4
  69. data/lib/openc3/topics/telemetry_reduced_topics.rb +1 -13
  70. data/lib/openc3/topics/telemetry_topic.rb +2 -1
  71. data/lib/openc3/topics/topic.rb +0 -8
  72. data/lib/openc3/utilities/aws_bucket.rb +40 -38
  73. data/lib/openc3/utilities/bucket_utilities.rb +2 -0
  74. data/lib/openc3/utilities/cli_generator.rb +1 -1
  75. data/lib/openc3/utilities/logger.rb +62 -47
  76. data/lib/openc3/utilities/metric.rb +19 -1
  77. data/lib/openc3/utilities/sleeper.rb +3 -1
  78. data/lib/openc3/utilities/throttle.rb +76 -0
  79. data/lib/openc3/version.rb +5 -5
  80. data/templates/tool_angular/package.json +20 -20
  81. data/templates/tool_angular/yarn.lock +1815 -1009
  82. data/templates/tool_react/package.json +24 -26
  83. data/templates/tool_react/yarn.lock +1269 -902
  84. data/templates/tool_svelte/.prettierrc.js +5 -0
  85. data/templates/tool_svelte/package.json +26 -26
  86. data/templates/tool_svelte/src/services/cable.js +1 -1
  87. data/templates/tool_svelte/src/services/openc3-api.js +173 -173
  88. data/templates/tool_svelte/yarn.lock +981 -735
  89. data/templates/tool_vue/package.json +13 -13
  90. data/templates/tool_vue/yarn.lock +363 -147
  91. data/templates/widget/package.json +14 -14
  92. data/templates/widget/yarn.lock +367 -99
  93. metadata +41 -4
  94. data/lib/openc3/topics/notifications_topic.rb +0 -31
@@ -0,0 +1,76 @@
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
+ # Usage:
20
+ # throttle = OpenC3::Throttle.new(50.0) # Use max 50% cpu for work
21
+ #
22
+ # throttle.reset # Necessary if there are large periods of idle between hard work
23
+ # 1000.times do
24
+ # throttle.start
25
+ # # Do one iteration of cpu itensive work here
26
+ # # complete will sleep if necessary to not use too much CPU
27
+ # throttle.complete
28
+ # end
29
+
30
+ module OpenC3
31
+ class Throttle
32
+ MIN_SLEEP_SECONDS = 0.001
33
+ MAX_SLEEP_SECONDS = 0.100
34
+
35
+ attr_reader :reset_time
36
+ attr_reader :total_sleep_time
37
+
38
+ # @param max_cpu_utilization [Float] 0.0-100.0
39
+ def initialize(max_cpu_utilization)
40
+ @max_cpu_utilization = Float(max_cpu_utilization)
41
+ raise ArgumentError "max_cpu_utilization must be between 0.0 and 100.0" if @max_cpu_utilization > 100.0 or @max_cpu_utilization < 0.0
42
+ @max_cpu_utilization /= 100.0 # Normalize
43
+ reset()
44
+ end
45
+
46
+ def reset
47
+ @reset_time = Time.now
48
+ @total_sleep_time = 0
49
+ end
50
+
51
+ def throttle_sleep
52
+ return if @max_cpu_utilization >= 1.0
53
+ total_time = Time.now - @reset_time
54
+ if total_time > 0
55
+ cpu_utilization = 1.0 - (@total_sleep_time / total_time)
56
+ if cpu_utilization > @max_cpu_utilization
57
+ # Need to throttle
58
+ # max_cpu_utilization = sleep_time + total_sleep_time
59
+ # ----------------------------
60
+ # total_time
61
+ #
62
+ # (max_cpu_utilization * total_time) = sleep_time + total_sleep_time
63
+ #
64
+ # sleep_time = (max_cpu_utilization * total_time) - total_sleep_time
65
+ #
66
+ sleep_time = (@max_cpu_utilization * total_time) - @total_sleep_time
67
+ if sleep_time > MIN_SLEEP_SECONDS
68
+ sleep_time = MAX_SLEEP_SECONDS if sleep_time > MAX_SLEEP_SECONDS
69
+ sleep(sleep_time)
70
+ @total_sleep_time += sleep_time
71
+ end
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
@@ -1,14 +1,14 @@
1
1
  # encoding: ascii-8bit
2
2
 
3
- OPENC3_VERSION = '5.10.0'
3
+ OPENC3_VERSION = '5.11.0'
4
4
  module OpenC3
5
5
  module Version
6
6
  MAJOR = '5'
7
- MINOR = '10'
7
+ MINOR = '11'
8
8
  PATCH = '0'
9
9
  OTHER = ''
10
- BUILD = '926e6a3798993710a67729b9599c5a295b210152'
10
+ BUILD = 'f994eee0c2fadfc67ffbf0865ba798ed11ec1f5c'
11
11
  end
12
- VERSION = '5.10.0'
13
- GEM_VERSION = '5.10.0'
12
+ VERSION = '5.11.0'
13
+ GEM_VERSION = '5.11.0'
14
14
  end
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "<%= tool_name %>",
3
- "version": "5.10.0",
3
+ "version": "5.11.0",
4
4
  "scripts": {
5
5
  "ng": "ng",
6
6
  "start": "ng serve",
@@ -12,36 +12,36 @@
12
12
  },
13
13
  "private": true,
14
14
  "dependencies": {
15
- "@angular/animations": "^16.1.3",
16
- "@angular/cdk": "^16.1.3",
17
- "@angular/common": "^16.1.3",
18
- "@angular/compiler": "^16.1.3",
19
- "@angular/core": "^16.1.3",
20
- "@angular/forms": "^16.1.3",
21
- "@angular/material": "16.1.3",
22
- "@angular/platform-browser": "^16.1.3",
23
- "@angular/platform-browser-dynamic": "^16.1.3",
24
- "@angular/router": "^16.1.3",
25
- "@openc3/tool-common": "5.10.0",
15
+ "@openc3/tool-common": "5.11.0",
16
+ "@angular/animations": "^16.2.4",
17
+ "@angular/cdk": "^16.2.3",
18
+ "@angular/common": "^16.2.4",
19
+ "@angular/compiler": "^16.2.4",
20
+ "@angular/core": "^16.2.4",
21
+ "@angular/forms": "^16.2.4",
22
+ "@angular/material": "16.2.3",
23
+ "@angular/platform-browser": "^16.2.4",
24
+ "@angular/platform-browser-dynamic": "^16.2.4",
25
+ "@angular/router": "^16.2.4",
26
26
  "rxjs": "~7.8.0",
27
27
  "single-spa": ">=5.9.5",
28
28
  "single-spa-angular": "^8.1.0",
29
- "tslib": "^2.6.0",
30
- "zone.js": "~0.13.1"
29
+ "tslib": "^2.6.2",
30
+ "zone.js": "~0.13.3"
31
31
  },
32
32
  "devDependencies": {
33
- "@angular-builders/custom-webpack": "16.0.0",
34
- "@angular-devkit/build-angular": "^16.0.5",
35
- "@angular/cli": "~16.1.3",
36
- "@angular/compiler-cli": "^16.0.0",
33
+ "@angular-builders/custom-webpack": "16.0.1",
34
+ "@angular-devkit/build-angular": "^16.2.1",
35
+ "@angular/cli": "~16.2.1",
36
+ "@angular/compiler-cli": "^16.2.4",
37
37
  "@types/jasmine": "~4.3.0",
38
- "jasmine-core": "~5.0.1",
38
+ "jasmine-core": "~5.1.1",
39
39
  "karma": "~6.4.0",
40
40
  "karma-chrome-launcher": "~3.2.0",
41
41
  "karma-coverage": "~2.2.0",
42
42
  "karma-jasmine": "~5.1.0",
43
43
  "karma-jasmine-html-reporter": "~2.1.0",
44
44
  "style-loader": "^3.3.1",
45
- "typescript": "~5.1.6"
45
+ "typescript": "~5.2.2"
46
46
  }
47
47
  }