Subversion Repositories Projects

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#!/usr/bin/ruby

require 'inifile'

mkms={}

Dir["*.mkm"].each { |file|
  ini=IniFile.new(file)

  res=""
               
  (1..12).each { |engine_id|
    res+=ini["Gas"]["Motor"+engine_id.to_s].to_s+","
    res+=ini["Nick"]["Motor"+engine_id.to_s].to_s+","
    res+=ini["Roll"]["Motor"+engine_id.to_s].to_s+","
    res+=ini["Yaw"]["Motor"+engine_id.to_s].to_s

    res+="," if engine_id!=12
  }
  mkms[file.gsub(".mkm","")]=res
}


puts "String[] names={\"" + mkms.keys.sort.join("\",\"") + "\"};"
puts "int[][] arrays={{" + mkms.keys.map{ |e| mkms[e] }.join("},{") + "}};"