Sha256: 60c94558940764ce6a45f4bf110f3b7e26274f9fe167e79e8401846c48049b4b

Contents?: true

Size: 1.15 KB

Versions: 37

Compression:

Stored size: 1.15 KB

Contents

# Example of using metadata. Note each call to metadata_set creates a new entry.
# metadata_update without a start time will update the latest metadata entry.
puts metadata_get()
puts metadata_set({ 'setkey' => 1 })
check_expression("#{metadata_all().length} >= 1")
check_expression("#{metadata_get()['metadata']} == {\"setkey\"=>1}")
puts metadata_get()['metadata']
puts metadata_update({ 'setkey' => 2, 'updatekey' => 3 })
check_expression("#{metadata_get()['metadata']['setkey']} == 2")
check_expression("#{metadata_get()['metadata']['updatekey']} == 3")
puts metadata_update({ 'setkey' => 4 }) # Ensure updatekey stays
check_expression("#{metadata_get()['metadata']['setkey']} == 4")
check_expression("#{metadata_get()['metadata']['updatekey']} == 3")
check_expression("#{metadata_all().length} >= 1")
metadata_input() # Creates a new entry
check_expression("#{metadata_all().length} >= 2")
wait 2 # Allow time to advance or it's an error
metadata_set({ 'new' => 5 }) # Another new entry
check_expression("#{metadata_all().length} >= 3")
# The first entry is the newest one we created
puts metadata_all
check_expression("#{metadata_all()[0]['metadata']} == {\"new\"=>5}")

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
openc3-cosmos-demo-5.18.0 targets/INST/procedures/metadata.rb
openc3-cosmos-demo-5.17.1 targets/INST/procedures/metadata.rb
openc3-cosmos-demo-5.17.0 targets/INST/procedures/metadata.rb
openc3-cosmos-demo-5.16.0 targets/INST/procedures/metadata.rb
openc3-cosmos-demo-5.15.2 targets/INST/procedures/metadata.rb
openc3-cosmos-demo-5.15.1 targets/INST/procedures/metadata.rb
openc3-cosmos-demo-5.15.0 targets/INST/procedures/metadata.rb
openc3-cosmos-demo-5.14.2 targets/INST/procedures/metadata.rb
openc3-cosmos-demo-5.14.1 targets/INST/procedures/metadata.rb
openc3-cosmos-demo-5.14.0 targets/INST/procedures/metadata.rb
openc3-cosmos-demo-5.13.0 targets/INST/procedures/metadata.rb
openc3-cosmos-demo-5.12.0 targets/INST/procedures/metadata.rb
openc3-cosmos-demo-5.11.3 targets/INST/procedures/metadata.rb
openc3-cosmos-demo-5.11.2 targets/INST/procedures/metadata.rb
openc3-cosmos-demo-5.11.1 targets/INST/procedures/metadata.rb
openc3-cosmos-demo-5.11.0 targets/INST/procedures/metadata.rb
openc3-cosmos-demo-5.10.1 targets/INST/procedures/metadata.rb
openc3-cosmos-demo-5.10.0 targets/INST/procedures/metadata.rb
openc3-cosmos-demo-5.9.1 targets/INST/procedures/metadata.rb
openc3-cosmos-demo-5.9.0 targets/INST/procedures/metadata.rb