Skip to content

Commit

Permalink
Include partials in marshal file creation. Fix partial local variable…
Browse files Browse the repository at this point in the history
… creation. #170
  • Loading branch information
jmthomas committed Jul 17, 2015
1 parent c46030f commit c2a2fdd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion demo/config/targets/INST/cmd_tlm/_ccsds_cmd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
PARAMETER CCSDSSEQCNT 18 14 UINT 0 16383 0 "CCSDS primary header sequence count"
OVERFLOW TRUNCATE
PARAMETER CCSDSLENGTH 32 16 UINT 0 65535 12 "CCSDS primary header packet length"
ID_PARAMETER PKTID 48 16 UINT 0 65535 <%= @id %> "Packet id"
ID_PARAMETER PKTID 48 16 UINT 0 65535 <%= id %> "Packet id"
2 changes: 1 addition & 1 deletion lib/cosmos/config/config_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def render(template_name, options = {})
b = binding
if options[:locals]
options[:locals].each do |key, value|
eval("@#{key} = #{value}", b)
eval("#{key} = #{value}", b)
end
end
# Assume the file is there. If not we raise a pretty obvious error
Expand Down
5 changes: 4 additions & 1 deletion lib/cosmos/packets/packet_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,16 @@ def initialize
# @param filename [String] The name of the configuration file
# @param target_name [String] The target name
def process_file(filename, process_target_name)
# Partial files are included into another file and thus aren't directly processed
return if File.basename(filename)[0] == '_' # Partials start with underscore

@converted_type = nil
@converted_bit_size = nil
@proc_text = ''
@building_generic_conversion = false

process_target_name = process_target_name.upcase
parser = ConfigParser.new("https://github.com/BallAerospace/COSMOS/wiki/Command-and-Telemetry-Configuration")
parser = ConfigParser.new("http://cosmosrb.com/docs/cmdtlm")
parser.parse_file(filename) do |keyword, params|

if @building_generic_conversion
Expand Down
3 changes: 1 addition & 2 deletions lib/cosmos/system/target.rb
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,7 @@ def add_all_cmd_tlm(dir)
if Dir.exist?(File.join(dir, 'cmd_tlm'))
# Only grab *.txt files in the root of the cmd_tlm folder
Dir[File.join(dir, 'cmd_tlm', '*.txt')].each do |filename|
# Don't add partial files which begin with '_'
cmd_tlm_files << filename unless filename[0] == '_'
cmd_tlm_files << filename
end
end
cmd_tlm_files.sort!
Expand Down

0 comments on commit c2a2fdd

Please sign in to comment.