Subversion Repositories Projects

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
308 ligi 1
#!/usr/bin/ruby
2
 
3
require 'inifile'
4
 
5
mkms={}
6
 
7
Dir["*.mkm"].each { |file|
8
  ini=IniFile.new(file)
9
 
10
  res=""
11
 
12
  (1..12).each { |engine_id|
13
    res+=ini["Gas"]["Motor"+engine_id.to_s].to_s+","
14
    res+=ini["Nick"]["Motor"+engine_id.to_s].to_s+","
15
    res+=ini["Roll"]["Motor"+engine_id.to_s].to_s+","
16
    res+=ini["Yaw"]["Motor"+engine_id.to_s].to_s
17
 
18
    res+="," if engine_id!=12
19
  }
20
  mkms[file.gsub(".mkm","")]=res
21
}
22
 
23
 
24
puts "String[] names={\"" + mkms.keys.sort.join("\",\"") + "\"};"
25
puts "int[][] arrays={{" + mkms.keys.map{ |e| mkms[e] }.join("},{") + "}};"
26