cosmosc2-demo 5.0.2 → 5.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/Rakefile +8 -1
- data/plugin.txt +12 -0
- data/targets/INST/procedures/file_dialog.rb +13 -0
- data/targets/INST/procedures/target_file.rb +4 -4
- data/targets/INST/screens/commanding.txt +11 -1
- data/targets/INST/tables/config/ConfigTables_def.txt +0 -1
- data/targets/INST/tables/procedures/download.rb +16 -0
- data/targets/INST/tables/procedures/upload.rb +19 -0
- data/tools/widgets/BigWidget/BigWidget.umd.min.js +3 -1
- data/tools/widgets/BigWidget/BigWidget.umd.min.js.map +1 -1
- data/tools/widgets/HelloworldWidget/HelloworldWidget.umd.min.js +1 -1
- data/tools/widgets/HelloworldWidget/HelloworldWidget.umd.min.js.map +1 -1
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d6f101df9ca41febf8914d7e211149885235a03ef49c839f59e0d773384692e
|
4
|
+
data.tar.gz: ed8598c7887fae3134e9440573ce839f63c6afc41c7102c862e32c22ee37e8ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f83259af0bfd971acf3e9f697068108e3c4afd34b3c5351e5e6889eadb66f37dfe528dc228a3acb61ce5e47099fe549207b0dbac096d6e0a4bfd148047994a55
|
7
|
+
data.tar.gz: 61458d5ffe593ccdc6f5bb1770d2022e6c56ed7ad732660a563bb9d48a1ba0613ad34a15f1e125c47edf8131bbf464c035ac0ca4b34570016581a95b76806dc6
|
data/README.md
CHANGED
@@ -8,7 +8,7 @@ This plugin provides a simple demo configuration for COSMOS that shows off a lot
|
|
8
8
|
|
9
9
|
1. At the COSMOS Admin - Plugins, upload the cosmosc2-demo.gem file
|
10
10
|
|
11
|
-
2. To build widgets run:
|
11
|
+
2. To build widgets run: yarn && yarn build
|
12
12
|
|
13
13
|
## Contributing
|
14
14
|
|
data/Rakefile
CHANGED
@@ -20,7 +20,12 @@
|
|
20
20
|
PLUGIN_NAME = Dir['*.gemspec'][0].split('.')[0..-2].join('.')
|
21
21
|
|
22
22
|
task :require_version do
|
23
|
-
|
23
|
+
if ENV['VERSION']
|
24
|
+
if ENV['VERSION'] =~ /-/
|
25
|
+
# Add Timestamp to prerelease versions
|
26
|
+
ENV['VERSION'] = ENV['VERSION'] + "." + Time.now.utc.strftime("%Y%m%d%H%M%S")
|
27
|
+
end
|
28
|
+
else
|
24
29
|
puts "VERSION is required: rake <task> VERSION=X.X.X"
|
25
30
|
exit 1
|
26
31
|
end
|
@@ -31,5 +36,7 @@ task :build => [:require_version] do
|
|
31
36
|
if platform == 'mswin32' or platform == 'mingw32'
|
32
37
|
puts "Warning: Building gem on Windows will lose file permissions"
|
33
38
|
end
|
39
|
+
# Build the widgets in the src directory
|
40
|
+
system("yarn run build")
|
34
41
|
system("gem build #{PLUGIN_NAME}")
|
35
42
|
end
|
data/plugin.txt
CHANGED
@@ -17,6 +17,8 @@ VARIABLE example_microservice_name cosmos-example
|
|
17
17
|
VARIABLE templated_microservice_name cosmos-templated
|
18
18
|
VARIABLE example_port 9999
|
19
19
|
VARIABLE templated_port 5025
|
20
|
+
VARIABLE log_retain_time 172800
|
21
|
+
VARIABLE reduced_log_retain_time 2592000
|
20
22
|
|
21
23
|
<% include_inst = (inst_target_name.strip.length > 0) %>
|
22
24
|
<% include_inst2 = (inst2_target_name.strip.length > 0) %>
|
@@ -33,24 +35,34 @@ VARIABLE templated_port 5025
|
|
33
35
|
|
34
36
|
<% if include_inst %>
|
35
37
|
TARGET INST <%= inst_target_name %>
|
38
|
+
LOG_RETAIN_TIME <%= log_retain_time %>
|
39
|
+
REDUCED_LOG_RETAIN_TIME <%= reduced_log_retain_time %>
|
36
40
|
TLM_LOG_CYCLE_TIME 300
|
37
41
|
<% end %>
|
38
42
|
|
39
43
|
<% if include_inst2 %>
|
40
44
|
TARGET INST <%= inst2_target_name %>
|
45
|
+
LOG_RETAIN_TIME <%= log_retain_time %>
|
46
|
+
REDUCED_LOG_RETAIN_TIME <%= reduced_log_retain_time %>
|
41
47
|
TLM_LOG_CYCLE_TIME 600
|
42
48
|
<% end %>
|
43
49
|
|
44
50
|
<% if include_example %>
|
45
51
|
TARGET EXAMPLE <%= example_target_name %>
|
52
|
+
LOG_RETAIN_TIME <%= log_retain_time %>
|
53
|
+
REDUCED_LOG_RETAIN_TIME <%= reduced_log_retain_time %>
|
46
54
|
<% end %>
|
47
55
|
|
48
56
|
<% if include_templated %>
|
49
57
|
TARGET TEMPLATED <%= templated_target_name %>
|
58
|
+
LOG_RETAIN_TIME <%= log_retain_time %>
|
59
|
+
REDUCED_LOG_RETAIN_TIME <%= reduced_log_retain_time %>
|
50
60
|
<% end %>
|
51
61
|
|
52
62
|
<% if include_system %>
|
53
63
|
TARGET SYSTEM <%= system_target_name %>
|
64
|
+
LOG_RETAIN_TIME <%= log_retain_time %>
|
65
|
+
REDUCED_LOG_RETAIN_TIME <%= reduced_log_retain_time %>
|
54
66
|
<% end %>
|
55
67
|
|
56
68
|
<% if include_inst and include_inst_int %>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# Specify the title and message and filter to txt files
|
2
|
+
file = open_file_dialog("Open a single file", "Choose something interesting", filter: ".txt")
|
3
|
+
puts file # Ruby File object
|
4
|
+
puts file.read
|
5
|
+
file.delete
|
6
|
+
|
7
|
+
files = open_files_dialog("Open multiple files") # message is optional
|
8
|
+
puts files # Array of File objects (even if you select only one)
|
9
|
+
files.each do |file|
|
10
|
+
puts file
|
11
|
+
puts file.read
|
12
|
+
file.delete
|
13
|
+
end
|
@@ -1,21 +1,21 @@
|
|
1
1
|
put_target_file("INST/test.txt", "this is a string test")
|
2
2
|
file = get_target_file("INST/test.txt")
|
3
3
|
puts file.read
|
4
|
-
file.
|
4
|
+
file.delete
|
5
5
|
delete_target_file("INST/test.txt")
|
6
6
|
|
7
7
|
save_file = Tempfile.new('test')
|
8
8
|
save_file.write("this is a Io test")
|
9
9
|
save_file.rewind
|
10
10
|
put_target_file("INST/test.txt", save_file)
|
11
|
-
save_file.
|
11
|
+
save_file.delete
|
12
12
|
file = get_target_file("INST/test.txt")
|
13
13
|
puts file.read
|
14
|
-
file.
|
14
|
+
file.delete
|
15
15
|
delete_target_file("INST/test.txt")
|
16
16
|
|
17
17
|
put_target_file("INST/test.bin", "\x00\x01\x02\x03\xFF\xEE\xDD\xCC")
|
18
18
|
file = get_target_file("INST/test.bin")
|
19
19
|
puts file.read.formatted
|
20
|
-
file.
|
20
|
+
file.delete
|
21
21
|
delete_target_file("INST/test.bin")
|
@@ -17,7 +17,9 @@ VERTICAL
|
|
17
17
|
LABEL " Duration: "
|
18
18
|
NAMED_WIDGET DURATION TEXTFIELD 12 "10.0"
|
19
19
|
END
|
20
|
-
|
20
|
+
# This is an example of using a varible named 'type'. You can operate on variables with Javascript code.
|
21
|
+
# All COSMOS commands (api.cmd) must be separated by newlines '\n'. All code separated by semicolons is evaluated together.
|
22
|
+
BUTTON 'Start Collect' "var type=screen.get_named_widget('COLLECT_TYPE').text(); api.cmd('<%= target_name %> COLLECT with TYPE '+type+', DURATION '+screen.get_named_widget('DURATION').text())"
|
21
23
|
END
|
22
24
|
SETTING BACKCOLOR 163 185 163
|
23
25
|
|
@@ -31,4 +33,12 @@ VERTICAL
|
|
31
33
|
BUTTON 'Send' "screen.get_named_widget('GROUP').selected() === 0 ? api.cmd('<%= target_name %> ABORT') : (screen.get_named_widget('CHECK').checked() ? api.cmd_no_hazardous_check('<%= target_name %> CLEAR') : api.cmd('<%= target_name %> CLEAR'))"
|
32
34
|
END
|
33
35
|
SETTING BACKCOLOR 163 185 163
|
36
|
+
|
37
|
+
VERTICALBOX
|
38
|
+
SECTIONHEADER "Run Script:"
|
39
|
+
NAMED_WIDGET SCRIPTNAME COMBOBOX collect.rb checks.rb
|
40
|
+
NAMED_WIDGET BG CHECKBUTTON 'Background'
|
41
|
+
BUTTON 'Run Script' "var script=screen.get_named_widget('SCRIPTNAME').text(); run_script('INST/procedures/'+script, !screen.get_named_widget('BG').checked())"
|
42
|
+
END
|
43
|
+
SETTING BACKCOLOR 163 185 163
|
34
44
|
END
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# TBL_FILENAME is set to the name of the table file to overwrite
|
2
|
+
puts "file:#{ENV['TBL_FILENAME']}"
|
3
|
+
# Download the file
|
4
|
+
# Implement custom commanding logic to download the table
|
5
|
+
# You probably want to do something like:
|
6
|
+
buffer = ''
|
7
|
+
# i = 1
|
8
|
+
# num_segments = 5 # calculate based on TBL_FILENAME
|
9
|
+
# table_id = 1 # calculate based on TBL_FILENAME
|
10
|
+
# while i < num_segments
|
11
|
+
# # Request a part of the table buffer
|
12
|
+
# cmd("TGT DUMP with TABLE_ID #{table_id}, SEGMENT #{i}")
|
13
|
+
# buffer += tlm("TGT DUMP_PKT DATA")
|
14
|
+
# i += 1
|
15
|
+
# end
|
16
|
+
put_target_file(ENV['TBL_FILENAME'], buffer)
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# TBL_FILENAME is set to the name of the table file
|
2
|
+
puts "file:#{ENV['TBL_FILENAME']}"
|
3
|
+
# Open the file
|
4
|
+
file = get_target_file(ENV['TBL_FILENAME'])
|
5
|
+
buffer = file.read
|
6
|
+
# puts buffer.formatted
|
7
|
+
# Implement custom commanding logic to upload the table
|
8
|
+
# Note that buffer is a Ruby string of bytes
|
9
|
+
# You probably want to do something like:
|
10
|
+
# buf_size = 512 # Size of a buffer in the upload command
|
11
|
+
# i = 0
|
12
|
+
# while i < buffer.length
|
13
|
+
# # Send a part of the buffer
|
14
|
+
# # NOTE: triple dots means start index, up to but not including, end index
|
15
|
+
# # while double dots means start index, up to AND including, end index
|
16
|
+
# cmd("TGT", "UPLOAD", "DATA" => buffer[i...(i + buf_size)])
|
17
|
+
# i += buf_size
|
18
|
+
# end
|
19
|
+
file.delete
|