openc3 6.4.1 → 6.4.2

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 (31) hide show
  1. checksums.yaml +4 -4
  2. data/data/config/conversions.yaml +273 -0
  3. data/data/config/item_modifiers.yaml +7 -70
  4. data/data/config/parameter_modifiers.yaml +9 -69
  5. data/lib/openc3/api/api.rb +1 -1
  6. data/lib/openc3/conversions/unix_time_conversion.rb +2 -2
  7. data/lib/openc3/conversions/unix_time_formatted_conversion.rb +3 -3
  8. data/lib/openc3/conversions/unix_time_seconds_conversion.rb +3 -3
  9. data/lib/openc3/core_ext/time.rb +2 -9
  10. data/lib/openc3/microservices/cleanup_microservice.rb +2 -2
  11. data/lib/openc3/microservices/decom_microservice.rb +2 -2
  12. data/lib/openc3/microservices/interface_microservice.rb +3 -3
  13. data/lib/openc3/microservices/log_microservice.rb +4 -2
  14. data/lib/openc3/microservices/multi_microservice.rb +2 -2
  15. data/lib/openc3/microservices/periodic_microservice.rb +2 -2
  16. data/lib/openc3/microservices/reducer_microservice.rb +2 -2
  17. data/lib/openc3/microservices/router_microservice.rb +2 -2
  18. data/lib/openc3/microservices/scope_cleanup_microservice.rb +2 -2
  19. data/lib/openc3/microservices/text_log_microservice.rb +19 -6
  20. data/lib/openc3/models/script_status_model.rb +22 -4
  21. data/lib/openc3/models/target_model.rb +26 -4
  22. data/lib/openc3/packets/packet_config.rb +1 -1
  23. data/lib/openc3/script/autonomic.rb +359 -0
  24. data/lib/openc3/script/script.rb +1 -0
  25. data/lib/openc3/version.rb +5 -5
  26. data/templates/tool_angular/package.json +2 -2
  27. data/templates/tool_react/package.json +1 -1
  28. data/templates/tool_svelte/package.json +1 -1
  29. data/templates/tool_vue/package.json +3 -3
  30. data/templates/widget/package.json +2 -2
  31. metadata +3 -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: f50276d75f7b083b8e4ab9bf5572978eb7b67b8d463d5757b7e5dcc64de861b1
4
+ data.tar.gz: c7af952c813bf8ca3032443225046ac74dd40d366e42a26e0ab5fd8a13e3de04
5
5
  SHA512:
6
- metadata.gz: 8d3515bdd13040340bb39ac3d0bc51478c65b57e9b42ed31b11e6c10ed4228c4eccb9f7228cd2f7271e533bd66a9eee42e386f91ffabaf7c4e5179cc9ddd6efb
7
- data.tar.gz: 2ef03561529805ed8f09037ab664477071bf6d8e672095b979ad828ce8cddc819ec056999b022df0dd1f522254a36f58bf9b31656ce3845b12c65869eb8f011b
6
+ metadata.gz: e9724e49c5fa0cceffea2b5f3584820542d50a47b5dee4be7e0fafa5af7b6fecf4d152e48b65752ce73f51391219770bc650041ee676d3943eb48efd67f98770
7
+ data.tar.gz: 8e4429f6a6200454c4d98b1e8b5c881154be0582db9c096329f7c7039a93f7710533dce063d1d562835bfddc094dcc71e6b8ed0661ef2dcdb53ceae0c3412c8d
@@ -0,0 +1,273 @@
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
+ parameters:
122
+ - name: Processor Name
123
+ required: true
124
+ description: Name of the processor
125
+ values: .*
126
+ - name: Processor Value
127
+ required: true
128
+ description: Published processor value
129
+ values: .*
130
+ ruby_example: |
131
+ PROCESSOR TEMP1WATER watermark_processor.rb TEMP1
132
+ ITEM TEMP1HIGH 0 0 DERIVED "High-water mark for TEMP1"
133
+ READ_CONVERSION processor_conversion.rb TEMP1WATER HIGH_WATER
134
+ python_example: |
135
+ PROCESSOR TEMP1WATER watermark_processor.rb TEMP1
136
+ ITEM TEMP1HIGH 0 0 DERIVED "High-water mark for TEMP1"
137
+ READ_CONVERSION openc3/conversions/processor_conversion.py TEMP1WATER HIGH_WATER
138
+ RECEIVED_COUNT_CONVERSION:
139
+ summary: Converts the packet received count to a UINT 32 value
140
+ description: |
141
+ This in an internal conversion which is automatically applied to the
142
+ 'RECEIVED_COUNT' derived telemetry item. It is typically not explicitly used.
143
+ ruby_example: READ_CONVERSION received_count_conversion.rb
144
+ python_example: READ_CONVERSION openc3/conversions/received_count_conversion.py
145
+ RECEIVED_TIME_FORMATTED_CONVERSION:
146
+ summary: Converts the packet received time to a formatted string like "YYYY/MM/DD HH:MM:SS.US"
147
+ description: |
148
+ This in an internal conversion which is automatically applied to the
149
+ 'RECEIVED_TIMEFORMATTED' derived telemetry item. It is typically not explicitly used.
150
+ For more information see the [Received Time and Packet Time](/docs/configuration/telemetry#received-time-and-packet-time) documentation.
151
+ ruby_example: READ_CONVERSION received_time_formatted_conversion.rb
152
+ python_example: READ_CONVERSION openc3/conversions/received_time_formatted_conversion.py
153
+ RECEIVED_TIME_SECONDS_CONVERSION:
154
+ summary: Converts the packet received to a floating point number of seconds since the epoch
155
+ description: |
156
+ This in an internal conversion which is automatically applied to the
157
+ 'RECEIVED_TIMESECONDS' derived telemetry item. It is typically not explicitly used.
158
+ For more information see the [Received Time and Packet Time](/docs/configuration/telemetry#received-time-and-packet-time) documentation.
159
+ ruby_example: READ_CONVERSION received_time_formatted_conversion.rb
160
+ python_example: READ_CONVERSION openc3/conversions/received_time_formatted_conversion.py
161
+ SEGMENTED_POLYNOMIAL_CONVERSION:
162
+ summary: Adds a segmented polynomial conversion factor to the current item. Can be used as both a read and write conversion.
163
+ description:
164
+ For commands, this conversion factor is applied to the raw value set by the user
165
+ (via tool or script) before it is written into the binary command packet and sent.
166
+ For telemetry, the conversion factor is applied to the raw value in the telemetry packet
167
+ before it is displayed to the user. The user still has the ability to see the raw
168
+ unconverted value in a details dialog.
169
+ parameters:
170
+ - name: Lower Bound
171
+ required: true
172
+ description:
173
+ Defines the lower bound of the range of values that this segmented
174
+ polynomial applies to. Is ignored for the segment with the smallest lower bound.
175
+ values: .*
176
+ - name: C0
177
+ required: true
178
+ description: Coefficient
179
+ values: .*
180
+ - name: Cx
181
+ required: false
182
+ description: Additional coefficient values for the conversion. Any order
183
+ polynomial conversion may be used so the value of 'x' will vary with the
184
+ order of the polynomial. Note that larger order polynomials take longer
185
+ to process than shorter order polynomials, but are sometimes more accurate.
186
+ values: .*
187
+ ruby_example: |
188
+ READ_CONVERSION segmented_polynomial_conversion.rb 0 10 0.5 0.25 # Apply the conversion to all values < 50
189
+ # Since this is a common conversion it has an alias:
190
+ SEG_POLY_READ_CONVERSION 10 0.5 0.25 0 10 0.5 0.25 # Apply the conversion to all values < 50
191
+ SEG_POLY_READ_CONVERSION 50 11 0.5 0.275 # Apply the conversion to all values >= 50 and < 100
192
+ SEG_POLY_READ_CONVERSION 100 12 0.5 0.3 # Apply the conversion to all values >= 100
193
+
194
+ WRITE_CONVERSION segmented_polynomial_conversion.rb 0 10 0.5 0.25 # Apply the conversion to all values < 50
195
+ # Since this is a common conversion it has an alias:
196
+ SEG_POLY_WRITE_CONVERSION 10 0.5 0.25 0 10 0.5 0.25 # Apply the conversion to all values < 50
197
+ SEG_POLY_WRITE_CONVERSION 50 11 0.5 0.275 # Apply the conversion to all values >= 50 and < 100
198
+ SEG_POLY_WRITE_CONVERSION 100 12 0.5 0.3 # Apply the conversion to all values >= 100
199
+ python_example: |
200
+ READ_CONVERSION openc3/conversions/segmented_polynomial_conversion.py 0 10 0.5 0.25 # Apply the conversion to all values < 50
201
+ # Since this is a common conversion it has an alias:
202
+ SEG_POLY_READ_CONVERSION 10 0.5 0.25 0 10 0.5 0.25 # Apply the conversion to all values < 50
203
+ SEG_POLY_READ_CONVERSION 50 11 0.5 0.275 # Apply the conversion to all values >= 50 and < 100
204
+ SEG_POLY_READ_CONVERSION 100 12 0.5 0.3 # Apply the conversion to all values >= 100
205
+
206
+ WRITE_CONVERSION openc3/conversions/segmented_polynomial_conversion.py 0 10 0.5 0.25 # Apply the conversion to all values < 50
207
+ # Since this is a common conversion it has an alias:
208
+ SEG_POLY_WRITE_CONVERSION 10 0.5 0.25 0 10 0.5 0.25 # Apply the conversion to all values < 50
209
+ SEG_POLY_WRITE_CONVERSION 50 11 0.5 0.275 # Apply the conversion to all values >= 50 and < 100
210
+ SEG_POLY_WRITE_CONVERSION 100 12 0.5 0.3 # Apply the conversion to all values >= 100
211
+ UNIX_TIME_CONVERSION:
212
+ summary: Converts values to a native Ruby or Python time object
213
+ parameters:
214
+ - name: Seconds Item Name
215
+ required: true
216
+ description: The name of the item which contains the seconds since the epoch.
217
+ values: .*
218
+ - name: Microseconds Item Name
219
+ required: false
220
+ description: The name of the item which contains the microseconds since the epoch.
221
+ values: .*
222
+ - name: Seconds Type
223
+ required: false
224
+ description: How to read the seconds item. Defaults to 'RAW'.
225
+ values: [RAW, CONVERTED]
226
+ - name: Microseconds Type
227
+ required: false
228
+ description: How to read the microseconds item. Defaults to 'RAW'.
229
+ values: [RAW, CONVERTED]
230
+ ruby_example: READ_CONVERSION unix_time_conversion.rb TIMESEC TIMEUS
231
+ python_example: READ_CONVERSION openc3/conversions/unix_time_conversion.py TIMESEC TIMEUS
232
+ UNIX_TIME_FORMATTED_CONVERSION:
233
+ summary: Converts values to a formatted time string like "YYYY/MM/DD HH:MM:SS.US"
234
+ parameters:
235
+ - name: Seconds Item Name
236
+ required: true
237
+ description: The name of the item which contains the seconds since the epoch.
238
+ values: .*
239
+ - name: Microseconds Item Name
240
+ required: false
241
+ description: The name of the item which contains the microseconds since the epoch.
242
+ values: .*
243
+ - name: Seconds Type
244
+ required: false
245
+ description: How to read the seconds item. Defaults to 'RAW'.
246
+ values: [RAW, CONVERTED]
247
+ - name: Microseconds Type
248
+ required: false
249
+ description: How to read the microseconds item. Defaults to 'RAW'.
250
+ values: [RAW, CONVERTED]
251
+ ruby_example: READ_CONVERSION unix_time_formatted_conversion.rb TIMESEC TIMEUS
252
+ python_example: READ_CONVERSION openc3/conversions/unix_time_formatted_conversion.py TIMESEC TIMEUS
253
+ UNIX_TIME_SECONDS_CONVERSION:
254
+ summary: Converts values to a floating point number of seconds since the epoch
255
+ parameters:
256
+ - name: Seconds Item Name
257
+ required: true
258
+ description: The name of the item which contains the seconds since the epoch.
259
+ values: .*
260
+ - name: Microseconds Item Name
261
+ required: false
262
+ description: The name of the item which contains the microseconds since the epoch.
263
+ values: .*
264
+ - name: Seconds Type
265
+ required: false
266
+ description: How to read the seconds item. Defaults to 'RAW'.
267
+ values: [RAW, CONVERTED]
268
+ - name: Microseconds Type
269
+ required: false
270
+ description: How to read the microseconds item. Defaults to 'RAW'.
271
+ values: [RAW, CONVERTED]
272
+ ruby_example: READ_CONVERSION unix_time_seconds_conversion.rb TIMESEC TIMEUS
273
+ python_example: READ_CONVERSION openc3/conversions/unix_time_seconds_conversion.py TIMESEC TIMEUS
@@ -37,36 +37,7 @@ READ_CONVERSION:
37
37
  takes extra parameters and must always implement the `call` method. The conversion
38
38
  factor is applied to the raw value in the telemetry packet before it is displayed
39
39
  to the user. The user still has the ability to see the raw unconverted value
40
- in a details dialog.
41
- ruby_example: |
42
- READ_CONVERSION the_great_conversion.rb 1000
43
-
44
- Defined in the_great_conversion.rb:
45
-
46
- require 'openc3/conversions/conversion'
47
- module OpenC3
48
- class TheGreatConversion < Conversion
49
- def initialize(multiplier)
50
- super()
51
- @multiplier = multiplier.to_f
52
- end
53
- def call(value, packet, buffer)
54
- return value * @multiplier
55
- end
56
- end
57
- end
58
- python_example: |
59
- READ_CONVERSION the_great_conversion.py 1000
60
-
61
- Defined in the_great_conversion.py:
62
-
63
- from openc3.conversions.conversion import Conversion
64
- class TheGreatConversion(Conversion):
65
- def __init__(self, multiplier):
66
- super().__init__()
67
- self.multiplier = float(multiplier)
68
- def call(self, value, packet, buffer):
69
- return value * self.multiplier
40
+ in a details dialog. For more information see the [Conversion](/docs/configuration/conversions) documentation.
70
41
  parameters:
71
42
  - name: Class Filename
72
43
  required: true
@@ -80,50 +51,16 @@ READ_CONVERSION:
80
51
  description: Additional parameter values for the conversion which are passed
81
52
  to the class constructor.
82
53
  values: .*
54
+ ruby_example: |
55
+ READ_CONVERSION ip_read_conversion.rb
56
+ python_example: |
57
+ READ_CONVERSION openc3/conversions/ip_read_conversion.rb
83
58
  POLY_READ_CONVERSION:
84
59
  summary: Adds a polynomial conversion factor to the current telemetry item
85
- description: The conversion factor is applied to raw value in the telemetry
86
- packet before it is displayed to the user. The user still has the ability
87
- to see the raw unconverted value in a details dialog.
88
- example: POLY_READ_CONVERSION 10 0.5 0.25
89
- parameters:
90
- - name: C0
91
- required: true
92
- description: Coefficient
93
- values: .*
94
- - name: Cx
95
- required: false
96
- description: Additional coefficient values for the conversion. Any order
97
- polynomial conversion may be used so the value of 'x' will vary with the
98
- order of the polynomial. Note that larger order polynomials take longer
99
- to process than shorter order polynomials, but are sometimes more accurate.
100
- values: .*
60
+ description: See [Polynomial Conversion](/docs/configuration/conversions#polynomial_conversion) for more information.
101
61
  SEG_POLY_READ_CONVERSION:
102
62
  summary: Adds a segmented polynomial conversion factor to the current telemetry item
103
- description: This conversion factor is applied to the raw value in the telemetry packet
104
- before it is displayed to the user. The user still has the ability to see the raw
105
- unconverted value in a details dialog.
106
- example: |
107
- SEG_POLY_READ_CONVERSION 0 10 0.5 0.25 # Apply the conversion to all values < 50
108
- SEG_POLY_READ_CONVERSION 50 11 0.5 0.275 # Apply the conversion to all values >= 50 and < 100
109
- SEG_POLY_READ_CONVERSION 100 12 0.5 0.3 # Apply the conversion to all values >= 100
110
- parameters:
111
- - name: Lower Bound
112
- required: true
113
- description: Defines the lower bound of the range of values that this segmented
114
- polynomial applies to. Is ignored for the segment with the smallest lower bound.
115
- values: .*
116
- - name: C0
117
- required: true
118
- description: Coefficient
119
- values: .*
120
- - name: Cx
121
- required: false
122
- description: Additional coefficient values for the conversion. Any order
123
- polynomial conversion may be used so the value of 'x' will vary with the
124
- order of the polynomial. Note that larger order polynomials take longer
125
- to process than shorter order polynomials, but are sometimes more accurate.
126
- values: .*
63
+ description: See [Segmented Polynomial Conversion](/docs/configuration/conversions#segmented_polynomial_conversion) for more information.
127
64
  GENERIC_READ_CONVERSION_START:
128
65
  summary: Start a generic read conversion
129
66
  description: Adds a generic conversion function to the current telemetry item.
@@ -69,7 +69,7 @@ WRITE_CONVERSION:
69
69
  It must implement the `initialize` (Ruby) or `__init__` (Python) method if it
70
70
  takes extra parameters and must always implement the `call` method. The conversion
71
71
  factor is applied to the value entered by the user before it is written into
72
- the binary command packet and sent.
72
+ the binary command packet and sent. For more information see the [Conversion](/docs/configuration/conversions) documentation.
73
73
 
74
74
  When applying a write_conversion sometimes the data type changes,
75
75
  e.g. creating a UINT from an input STRING (for an example of this see
@@ -90,90 +90,30 @@ WRITE_CONVERSION:
90
90
  given_values() method which can be used to retrieve a hash of the user provided
91
91
  values to the command. That can be used to check parameter values passed in.
92
92
  :::
93
- ruby_example: |
94
- WRITE_CONVERSION the_great_conversion.rb 1000
95
-
96
- Defined in the_great_conversion.rb:
97
-
98
- require 'openc3/conversions/conversion'
99
- module OpenC3
100
- class TheGreatConversion < Conversion
101
- def initialize(multiplier)
102
- super()
103
- @multiplier = multiplier.to_f
104
- end
105
- def call(value, packet, buffer)
106
- return value * multiplier
107
- end
108
- end
109
- end
110
- python_example: |
111
- WRITE_CONVERSION the_great_conversion.py 1000
112
-
113
- Defined in the_great_conversion.py:
114
-
115
- from openc3.conversions.conversion import Conversion
116
- class TheGreatConversion(Conversion):
117
- def __init__(self, multiplier):
118
- super().__init__()
119
- self.multiplier = float(multiplier)
120
- def call(self, value, packet, buffer):
121
- return value * self.multiplier
122
93
  parameters:
123
94
  - name: Class Filename
124
95
  required: true
125
96
  description: The filename which contains the Ruby or Python class. The filename must
126
97
  be named after the class such that the class is a CamelCase version of the
127
98
  underscored filename. For example, 'the_great_conversion.rb' should contain
128
- 'class TheGreatConversion'.
99
+ 'class TheGreatConversion'. Note the built-in Python conversions must specify
100
+ the full path to the file, e.g. 'openc3/conversions/bit_reverse_conversion.py'.
129
101
  values: .*
130
102
  - name: Parameter
131
103
  required: false
132
104
  description: Additional parameter values for the conversion which are passed
133
105
  to the class constructor.
134
106
  values: .*
107
+ ruby_example: |
108
+ WRITE_CONVERSION ip_write_conversion.rb
109
+ python_example: |
110
+ WRITE_CONVERSION openc3/conversions/ip_write_conversion.py
135
111
  POLY_WRITE_CONVERSION:
136
112
  summary: Adds a polynomial conversion factor to the current command parameter
137
- description: The conversion factor is applied to the value entered by the user
138
- before it is written into the binary command packet and sent.
139
- example: POLY_WRITE_CONVERSION 10 0.5 0.25
140
- parameters:
141
- - name: C0
142
- required: true
143
- description: Coefficient
144
- values: .*
145
- - name: Cx
146
- required: false
147
- description: Additional coefficient values for the conversion. Any order
148
- polynomial conversion may be used so the value of 'x' will vary with the
149
- order of the polynomial. Note that larger order polynomials take longer
150
- to process than shorter order polynomials, but are sometimes more accurate.
151
- values: .*
113
+ description: See [Polynomial Conversion](/docs/configuration/conversions#polynomial_conversion) for more information.
152
114
  SEG_POLY_WRITE_CONVERSION:
153
115
  summary: Adds a segmented polynomial conversion factor to the current command parameter
154
- description: This conversion factor is applied to the value entered by the user
155
- before it is written into the binary command packet and sent.
156
- example: |
157
- SEG_POLY_WRITE_CONVERSION 0 10 0.5 0.25 # Apply the conversion to all values < 50
158
- SEG_POLY_WRITE_CONVERSION 50 11 0.5 0.275 # Apply the conversion to all values >= 50 and < 100
159
- SEG_POLY_WRITE_CONVERSION 100 12 0.5 0.3 # Apply the conversion to all values >= 100
160
- parameters:
161
- - name: Lower Bound
162
- required: true
163
- description: Defines the lower bound of the range of values that this segmented
164
- polynomial applies to. Is ignored for the segment with the smallest lower bound.
165
- values: .*
166
- - name: C0
167
- required: true
168
- description: Coefficient
169
- values: .*
170
- - name: Cx
171
- required: false
172
- description: Additional coefficient values for the conversion. Any order
173
- polynomial conversion may be used so the value of 'x' will vary with the
174
- order of the polynomial. Note that larger order polynomials take longer
175
- to process than shorter order polynomials, but are sometimes more accurate.
176
- values: .*
116
+ description: See [Segmented Polynomial Conversion](/docs/configuration/conversions#segmented_polynomial_conversion) for more information.
177
117
  GENERIC_WRITE_CONVERSION_START:
178
118
  summary: Start a generic write conversion
179
119
  description: |
@@ -38,7 +38,7 @@ require 'openc3/topics/topic'
38
38
  begin
39
39
  require 'openc3-enterprise/api/cmd_authority_api'
40
40
  rescue LoadError
41
- # LoadError expected for Open Source Edition
41
+ # LoadError expected for Core
42
42
  end
43
43
 
44
44
 
@@ -14,7 +14,7 @@
14
14
  # GNU Affero General Public License for more details.
15
15
 
16
16
  # Modified by OpenC3, Inc.
17
- # All changes Copyright 2022, OpenC3, Inc.
17
+ # All changes Copyright 2025, OpenC3, Inc.
18
18
  # All Rights Reserved
19
19
  #
20
20
  # This file may also be used under the terms of a commercial license
@@ -35,7 +35,7 @@ module OpenC3
35
35
  super()
36
36
  @seconds_item_name = seconds_item_name
37
37
  @microseconds_item_name = microseconds_item_name
38
- @converted_type = :RUBY_TIME
38
+ @converted_type = :TIME
39
39
  @converted_bit_size = 0
40
40
  @seconds_type = seconds_type.to_sym
41
41
  @microseconds_type = microseconds_type.to_sym
@@ -14,7 +14,7 @@
14
14
  # GNU Affero General Public License for more details.
15
15
 
16
16
  # Modified by OpenC3, Inc.
17
- # All changes Copyright 2024, OpenC3, Inc.
17
+ # All changes Copyright 2025, OpenC3, Inc.
18
18
  # All Rights Reserved
19
19
  #
20
20
  # This file may also be used under the terms of a commercial license
@@ -32,9 +32,9 @@ module OpenC3
32
32
  # represents the number of seconds since the UNIX time epoch
33
33
  # @param microseconds_item_name [String] The telemetry item in the packet
34
34
  # which represents microseconds
35
- def initialize(seconds_item_name, microseconds_item_name = nil)
35
+ def initialize(seconds_item_name, microseconds_item_name = nil, seconds_type = 'RAW', microseconds_type = 'RAW')
36
36
  # @params is set by the parent class in super()
37
- super(seconds_item_name, microseconds_item_name)
37
+ super(seconds_item_name, microseconds_item_name, seconds_type, microseconds_type)
38
38
  @converted_type = :STRING
39
39
  @converted_bit_size = 0
40
40
  end
@@ -14,7 +14,7 @@
14
14
  # GNU Affero General Public License for more details.
15
15
 
16
16
  # Modified by OpenC3, Inc.
17
- # All changes Copyright 2024, OpenC3, Inc.
17
+ # All changes Copyright 2025, OpenC3, Inc.
18
18
  # All Rights Reserved
19
19
  #
20
20
  # This file may also be used under the terms of a commercial license
@@ -32,9 +32,9 @@ module OpenC3
32
32
  # represents the number of seconds since the UNIX time epoch
33
33
  # @param microseconds_item_name [String] The telemetry item in the packet
34
34
  # which represents microseconds
35
- def initialize(seconds_item_name, microseconds_item_name = nil)
35
+ def initialize(seconds_item_name, microseconds_item_name = nil, seconds_type = 'RAW', microseconds_type = 'RAW')
36
36
  # @params is set by the parent class in super()
37
- super(seconds_item_name, microseconds_item_name)
37
+ super(seconds_item_name, microseconds_item_name, seconds_type, microseconds_type)
38
38
  @converted_type = :FLOAT
39
39
  @converted_bit_size = 64
40
40
  end
@@ -249,19 +249,12 @@ class Time
249
249
  Time.total_seconds(self.hour, self.min, self.sec, self.usec)
250
250
  end
251
251
 
252
- # @return [String] Date formatted as YYYY/MM/DD HH:MM:SS.US UTC_OFFSET
253
- def formatted(include_year = true, fractional_digits = 3, include_utc_offset = false)
252
+ # @return [String] Date formatted as YYYY/MM/DD HH:MM:SS.US
253
+ def formatted(include_year = true, fractional_digits = 3)
254
254
  str = ""
255
255
  str << "%Y/%m/%d " if include_year
256
256
  str << "%H:%M:%S"
257
257
  str << ".%#{fractional_digits}N" if fractional_digits > 0
258
- if include_utc_offset
259
- if self.utc?
260
- str << " UTC"
261
- else
262
- str << " %z"
263
- end
264
- end
265
258
  self.strftime(str)
266
259
  end
267
260
 
@@ -102,6 +102,6 @@ end
102
102
 
103
103
  if __FILE__ == $0
104
104
  OpenC3::CleanupMicroservice.run
105
- ThreadManager.instance.shutdown
106
- ThreadManager.instance.join
105
+ OpenC3::ThreadManager.instance.shutdown
106
+ OpenC3::ThreadManager.instance.join
107
107
  end
@@ -254,6 +254,6 @@ end
254
254
 
255
255
  if __FILE__ == $0
256
256
  OpenC3::DecomMicroservice.run
257
- ThreadManager.instance.shutdown
258
- ThreadManager.instance.join
257
+ OpenC3::ThreadManager.instance.shutdown
258
+ OpenC3::ThreadManager.instance.join
259
259
  end
@@ -824,7 +824,7 @@ module OpenC3
824
824
  end
825
825
 
826
826
  def sync_tlm_packet_counts(packet)
827
- if @sync_packet_count_delay_seconds <= 0
827
+ if @sync_packet_count_delay_seconds <= 0 or $openc3_redis_cluster
828
828
  # Perfect but slow method
829
829
  packet.received_count = TargetModel.increment_telemetry_count(packet.target_name, packet.packet_name, 1, scope: @scope)
830
830
  else
@@ -880,6 +880,6 @@ end
880
880
 
881
881
  if __FILE__ == $0
882
882
  OpenC3::InterfaceMicroservice.run
883
- ThreadManager.instance.shutdown
884
- ThreadManager.instance.join
883
+ OpenC3::ThreadManager.instance.shutdown
884
+ OpenC3::ThreadManager.instance.join
885
885
  end
@@ -55,6 +55,8 @@ module OpenC3
55
55
  @cycle_size = 50_000_000 unless @cycle_size # ~50 MB
56
56
 
57
57
  @buffer_depth = DEFAULT_BUFFER_DEPTH unless @buffer_depth
58
+ @plws = {}
59
+
58
60
  @error_count = 0
59
61
  @metric.set(name: 'log_total', value: @count, type: 'counter')
60
62
  @metric.set(name: 'log_error_total', value: @error_count, type: 'counter')
@@ -144,6 +146,6 @@ end
144
146
 
145
147
  if __FILE__ == $0
146
148
  OpenC3::LogMicroservice.run
147
- ThreadManager.instance.shutdown
148
- ThreadManager.instance.join
149
+ OpenC3::ThreadManager.instance.shutdown
150
+ OpenC3::ThreadManager.instance.join
149
151
  end
@@ -53,6 +53,6 @@ module OpenC3
53
53
  end
54
54
  if __FILE__ == $0
55
55
  OpenC3::MultiMicroservice.run
56
- ThreadManager.instance.shutdown
57
- ThreadManager.instance.join
56
+ OpenC3::ThreadManager.instance.shutdown
57
+ OpenC3::ThreadManager.instance.join
58
58
  end
@@ -91,6 +91,6 @@ end
91
91
 
92
92
  if __FILE__ == $0
93
93
  OpenC3::PeriodicMicroservice.run
94
- ThreadManager.instance.shutdown
95
- ThreadManager.instance.join
94
+ OpenC3::ThreadManager.instance.shutdown
95
+ OpenC3::ThreadManager.instance.join
96
96
  end