openc3 5.5.2 → 5.6.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.

Potentially problematic release.


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

Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/bin/openc3cli +167 -69
  3. data/data/config/_interfaces.yaml +1 -6
  4. data/data/config/interface_modifiers.yaml +55 -4
  5. data/data/config/microservice.yaml +30 -3
  6. data/ext/openc3/ext/crc/crc.c +82 -1
  7. data/lib/openc3/api/cmd_api.rb +19 -7
  8. data/lib/openc3/api/tlm_api.rb +13 -12
  9. data/lib/openc3/bridge/bridge_config.rb +4 -4
  10. data/lib/openc3/config/config_parser.rb +1 -0
  11. data/lib/openc3/conversions/unix_time_conversion.rb +3 -1
  12. data/lib/openc3/ext/.keep +0 -0
  13. data/lib/openc3/interfaces/interface.rb +54 -26
  14. data/lib/openc3/interfaces/serial_interface.rb +4 -5
  15. data/lib/openc3/interfaces/simulated_target_interface.rb +4 -4
  16. data/lib/openc3/interfaces/stream_interface.rb +2 -2
  17. data/lib/openc3/interfaces/tcpip_client_interface.rb +4 -3
  18. data/lib/openc3/interfaces/tcpip_server_interface.rb +18 -19
  19. data/lib/openc3/interfaces/udp_interface.rb +10 -4
  20. data/lib/openc3/io/json_api.rb +72 -0
  21. data/lib/openc3/io/serial_driver.rb +4 -5
  22. data/lib/openc3/logs/buffered_packet_log_writer.rb +2 -4
  23. data/lib/openc3/logs/log_writer.rb +9 -8
  24. data/lib/openc3/logs/packet_log_reader.rb +8 -1
  25. data/lib/openc3/logs/packet_log_writer.rb +3 -4
  26. data/lib/openc3/logs/stream_log.rb +116 -0
  27. data/lib/openc3/logs/stream_log_pair.rb +70 -0
  28. data/lib/openc3/microservices/cleanup_microservice.rb +1 -1
  29. data/lib/openc3/microservices/decom_microservice.rb +17 -2
  30. data/lib/openc3/microservices/interface_decom_common.rb +42 -0
  31. data/lib/openc3/microservices/interface_microservice.rb +24 -17
  32. data/lib/openc3/microservices/router_microservice.rb +46 -4
  33. data/lib/openc3/migrations/20221202214600_add_target_names.rb +1 -1
  34. data/lib/openc3/migrations/20230319154100_log_stream.rb +40 -0
  35. data/lib/openc3/migrations/20230413101100_remove_log.rb +30 -0
  36. data/lib/openc3/models/gem_model.rb +2 -2
  37. data/lib/openc3/models/interface_model.rb +13 -14
  38. data/lib/openc3/models/metadata_model.rb +1 -1
  39. data/lib/openc3/models/note_model.rb +1 -1
  40. data/lib/openc3/models/plugin_model.rb +3 -2
  41. data/lib/openc3/operators/operator.rb +2 -0
  42. data/lib/openc3/packets/commands.rb +2 -0
  43. data/lib/openc3/packets/packet_config.rb +3 -2
  44. data/lib/openc3/packets/parsers/xtce_converter.rb +2 -1
  45. data/lib/openc3/script/gems.rb +125 -0
  46. data/lib/openc3/script/plugins.rb +186 -0
  47. data/lib/openc3/script/screen.rb +119 -0
  48. data/lib/openc3/script/script.rb +3 -0
  49. data/lib/openc3/script/script_runner.rb +19 -8
  50. data/lib/openc3/script/suite_results.rb +2 -2
  51. data/lib/openc3/script/web_socket_api.rb +5 -1
  52. data/lib/openc3/streams/serial_stream.rb +14 -11
  53. data/lib/openc3/streams/tcpip_client_stream.rb +5 -2
  54. data/lib/openc3/streams/tcpip_socket_stream.rb +37 -71
  55. data/lib/openc3/streams/web_socket_client_stream.rb +5 -3
  56. data/lib/openc3/system/system.rb +2 -0
  57. data/lib/openc3/topics/interface_topic.rb +13 -4
  58. data/lib/openc3/topics/router_topic.rb +6 -6
  59. data/lib/openc3/topics/telemetry_decom_topic.rb +10 -1
  60. data/lib/openc3/utilities/bucket_utilities.rb +12 -5
  61. data/lib/openc3/utilities/cli_generator.rb +56 -4
  62. data/lib/openc3/utilities/crc.rb +42 -7
  63. data/lib/openc3/utilities/process_manager.rb +3 -1
  64. data/lib/openc3/utilities/ruby_lex_utils.rb +265 -504
  65. data/lib/openc3/version.rb +6 -6
  66. data/templates/conversion/conversion.rb +10 -2
  67. data/templates/microservice/microservices/TEMPLATE/microservice.rb +1 -1
  68. data/templates/plugin/Rakefile +8 -1
  69. data/templates/widget/.browserslistrc +16 -0
  70. data/templates/widget/.eslintrc.js +43 -0
  71. data/templates/widget/.nycrc +3 -0
  72. data/templates/widget/.prettierrc.js +5 -0
  73. data/templates/widget/LICENSE.txt +20 -0
  74. data/templates/widget/Rakefile +24 -0
  75. data/templates/widget/babel.config.json +11 -0
  76. data/templates/widget/package.json +35 -0
  77. data/templates/widget/src/Widget.vue +46 -0
  78. data/templates/widget/vue.config.js +25 -0
  79. data/templates/widget/yarn.lock +8938 -0
  80. metadata +23 -4
  81. data/lib/openc3/io/raw_logger.rb +0 -170
  82. data/lib/openc3/io/raw_logger_pair.rb +0 -80
@@ -1,14 +1,14 @@
1
1
  # encoding: ascii-8bit
2
2
 
3
- OPENC3_VERSION = '5.5.2'
3
+ OPENC3_VERSION = '5.6.0'
4
4
  module OpenC3
5
5
  module Version
6
6
  MAJOR = '5'
7
- MINOR = '5'
8
- PATCH = '2'
7
+ MINOR = '6'
8
+ PATCH = '0'
9
9
  OTHER = ''
10
- BUILD = '9c73d9c7c86512a01e0373b12b3058d3ae6b5adf'
10
+ BUILD = '56316d9eb44190cd24889b5cdc667b83bee266b1'
11
11
  end
12
- VERSION = '5.5.2'
13
- GEM_VERSION = '5.5.2'
12
+ VERSION = '5.6.0'
13
+ GEM_VERSION = '5.6.0'
14
14
  end
@@ -36,8 +36,16 @@ module OpenC3
36
36
  # @param packet [Packet] The packet object where the conversion is defined
37
37
  # @param buffer [String] The raw packet buffer
38
38
  def call(value, packet, buffer)
39
- # Typically perform conversion logic directly on value
40
- # e.g. value.upcase()
39
+ # Read values from the packet and do a conversion
40
+ # Used for DERVIVED items that don't have a value
41
+ # item1 = packet.read("ITEM1") # returns CONVERTED value (default)
42
+ # item2 = packet.read("ITEM2", :RAW) # returns RAW value
43
+ # return (item1 + item2) / 2
44
+ #
45
+ # Perform conversion logic directly on value
46
+ # Used when conversion is applied to a regular (not DERIVED) item
47
+ # NOTE: You can also use packet.read("ITEM") to get additional values
48
+ # return value / 2 * packet.read("OTHER_ITEM")
41
49
  end
42
50
  end
43
51
  end
@@ -35,7 +35,7 @@ module OpenC3
35
35
  break if @cancel_thread
36
36
 
37
37
  # Do your microservice work here
38
- Logger.info("Template Microservice ran")
38
+ @logger.info("Template Microservice ran")
39
39
  # cmd("INST ABORT")
40
40
 
41
41
  # The @state variable is set to 'RUNNING' by the microservice base class
@@ -8,5 +8,12 @@ task :require_version do
8
8
  end
9
9
 
10
10
  task :build => [:require_version] do
11
- system("gem build #{PLUGIN_NAME}")
11
+ # The sh command is built into Rake:
12
+ # https://rubydoc.info/gems/rake/FileUtils#sh-instance_method
13
+ sh('gem', 'build', PLUGIN_NAME)
14
+ sh('openc3cli validate *.gem') do |ok, status|
15
+ if !ok && status.exitstatus == 127 # command not found
16
+ puts "Install the openc3 gem to validate! (gem install openc3)"
17
+ end
18
+ end
12
19
  end
@@ -0,0 +1,16 @@
1
+ > 0.2%
2
+ # Chome 80 is circa Feb 2020
3
+ # See https://en.wikipedia.org/wiki/Google_Chrome_version_history
4
+ chrome >= 80
5
+ # Edge 80 is circa Jan 2020
6
+ # See https://docs.microsoft.com/en-us/deployedge/microsoft-edge-relnote-archive-stable-channel
7
+ edge >= 80
8
+ # Firefox ESR is extended support release
9
+ firefox ESR
10
+ # Safari 13.1 released Mar 24, 2020
11
+ # See https://en.wikipedia.org/wiki/Safari_version_history
12
+ safari >= 13.1
13
+ not dead
14
+ not ie 11
15
+ # Opera mini doesn't have built-in support for ES6
16
+ not op_mini all
@@ -0,0 +1,43 @@
1
+ module.exports = {
2
+ root: true,
3
+ env: {
4
+ node: true,
5
+ },
6
+ extends: [
7
+ 'plugin:vue/essential',
8
+ 'plugin:prettier/recommended',
9
+ '@vue/prettier',
10
+ ],
11
+ plugins: ['prettier'],
12
+ rules: {
13
+ 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
14
+ 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
15
+ 'prettier/prettier': [
16
+ 'warn',
17
+ {
18
+ endOfLine: 'auto',
19
+ },
20
+ ],
21
+ 'vue/multi-word-component-names': 'off',
22
+ 'vue/valid-v-slot': [
23
+ 'error',
24
+ {
25
+ allowModifiers: true,
26
+ },
27
+ ],
28
+ },
29
+ parserOptions: {
30
+ parser: '@babel/eslint-parser',
31
+ },
32
+ overrides: [
33
+ {
34
+ files: [
35
+ '**/__tests__/*.{j,t}s?(x)',
36
+ '**/tests/unit/**/*.spec.{j,t}s?(x)',
37
+ ],
38
+ env: {
39
+ jest: true,
40
+ },
41
+ },
42
+ ],
43
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "extension": [".js", ".vue"]
3
+ }
@@ -0,0 +1,5 @@
1
+ module.exports = {
2
+ singleQuote: true,
3
+ semi: false,
4
+ bracketSpacing: true,
5
+ }
@@ -0,0 +1,20 @@
1
+ The MIT License
2
+
3
+ Copyright 2023 OpenC3, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in the
7
+ Software without restriction, including without limitation the rights to use,
8
+ copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
9
+ Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16
+ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
17
+ PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
18
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,24 @@
1
+ PLUGIN_NAME = Dir['*.gemspec'][0].split('.')[0..-2].join('.')
2
+
3
+ task :require_version do
4
+ unless ENV['VERSION']
5
+ puts "VERSION is required: rake build VERSION=X.Y.Z"
6
+ exit 1
7
+ end
8
+ end
9
+
10
+ task :build => [:require_version] do
11
+ _, platform, *_ = RUBY_PLATFORM.split("-")
12
+ if platform == 'mswin32' or platform == 'mingw32'
13
+ puts "Warning: Building gem on Windows will lose file permissions"
14
+ end
15
+ # Build the widget and gem using sh built into Rake:
16
+ # https://rubydoc.info/gems/rake/FileUtils#sh-instance_method
17
+ sh('yarn', 'run', 'build')
18
+ sh('gem', 'build', PLUGIN_NAME)
19
+ sh('openc3cli validate *.gem') do |ok, status|
20
+ if !ok && status.exitstatus == 127 # command not found
21
+ puts "Install the openc3 gem to validate! (gem install openc3)"
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,11 @@
1
+ {
2
+ "presets": ["@vue/cli-plugin-babel/preset"],
3
+ "plugins": [
4
+ [
5
+ "babel-plugin-istanbul",
6
+ {
7
+ "extension": [".js", ".vue"]
8
+ }
9
+ ]
10
+ ]
11
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "widget",
3
+ "version": "5.6.0",
4
+ "private": true,
5
+ "scripts": {
6
+ "build": "vue-cli-service build --target lib --dest tools/widgets/<%= widget_name %> --formats umd-min <%= widget_path %> --name <%= widget_name %>"
7
+ },
8
+ "dependencies": {
9
+ "@openc3/tool-common": "5.6.0",
10
+ "vue": "2.7.14",
11
+ "vuetify": "2.6.14"
12
+ },
13
+ "devDependencies": {
14
+ "@babel/eslint-parser": "7.21.3",
15
+ "@rushstack/eslint-patch": "1.2.0",
16
+ "@vue/babel-preset-app": "5.0.8",
17
+ "@vue/cli": "5.0.8",
18
+ "@vue/cli-plugin-babel": "5.0.8",
19
+ "@vue/cli-plugin-eslint": "5.0.8",
20
+ "@vue/cli-service": "5.0.8",
21
+ "@vue/eslint-config-prettier": "7.1.0",
22
+ "babel-loader": "9.1.2",
23
+ "babel-plugin-istanbul": "6.1.1",
24
+ "eslint": "8.38.0",
25
+ "eslint-config-prettier": "8.8.0",
26
+ "eslint-plugin-prettier": "4.2.1",
27
+ "eslint-plugin-vue": "9.11.0",
28
+ "prettier": "2.8.7",
29
+ "sass": "1.62.0",
30
+ "sass-loader": "13.2.2",
31
+ "vue-cli-plugin-vuetify": "2.5.8",
32
+ "vue-template-compiler": "2.7.14",
33
+ "webpack": "5.79.0"
34
+ }
35
+ }
@@ -0,0 +1,46 @@
1
+ <!--
2
+ # Copyright 2023 OpenC3, Inc.
3
+ # All Rights Reserved.
4
+ #
5
+ # This file may also be used under the terms of a commercial license
6
+ # if purchased from OpenC3, Inc.
7
+ -->
8
+
9
+ <template>
10
+ <div class="value-widget-container">
11
+ <template>
12
+ <v-text-field
13
+ solo
14
+ dense
15
+ readonly
16
+ single-line
17
+ hide-no-data
18
+ hide-details
19
+ placeholder="Value"
20
+ :value="_value"
21
+ :class="valueClass"
22
+ :style="computedStyle"
23
+ data-test="value"
24
+ />
25
+ </template>
26
+ </div>
27
+ </template>
28
+
29
+ <script>
30
+ import VWidget from '@openc3/tool-common/src/components/widgets/VWidget'
31
+
32
+ export default {
33
+ mixins: [VWidget],
34
+ }
35
+ </script>
36
+
37
+ <style lang="scss" scoped>
38
+ .value-widget-container {
39
+ min-height: 100px;
40
+ }
41
+ .value-widget-container :deep(input) {
42
+ max-height: none !important;
43
+ line-height: 70px !important;
44
+ font-size: 60px !important;
45
+ }
46
+ </style>
@@ -0,0 +1,25 @@
1
+ const path = require('path')
2
+
3
+ module.exports = {
4
+ css: {
5
+ extract: false,
6
+ },
7
+ filenameHashing: false,
8
+ transpileDependencies: ['vuetify'],
9
+ chainWebpack(config) {
10
+ config.module
11
+ .rule('js')
12
+ .use('babel-loader')
13
+ .tap((options) => {
14
+ return {
15
+ rootMode: 'upward',
16
+ }
17
+ })
18
+ config.externals([
19
+ 'vue',
20
+ 'vuetify',
21
+ 'vuex',
22
+ 'vue-router',
23
+ ])
24
+ },
25
+ }