ecutools 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -62,7 +62,12 @@ module ECUTools
62
62
  count = 0
63
63
  tables.each do |table|
64
64
  elements = 1 # all tables start with one element
65
- element_size = rom_xml.xpath("/rom/scaling[@name='#{table.attr('scaling')}']").attr('storagetype').value().gsub(/[^\d]+/,'').to_i / 8
65
+ scaling = rom_xml.xpath("/rom/scaling[@name='#{table.attr('scaling')}']")
66
+ if scaling.count == 0
67
+ $stderr.puts "WARNING: Failed to find scaling: #{table.attr('scaling')}, skipping table #{table.attr('name')}" if verbose
68
+ next
69
+ end
70
+ element_size = scaling.attr('storagetype').value().gsub(/[^\d]+/,'').to_i / 8
66
71
  address = from_hex table.attr('address')
67
72
  is_data = false
68
73
 
@@ -97,8 +97,8 @@ module ECUTools
97
97
 
98
98
  load_rom.xpath('/rom/include').each do |include_tag|
99
99
 
100
- include_rom = Nokogiri::XML(File.open(File.dirname(__FILE__) + "/../xml/rom/#{include_tag.text}.xml"))
101
-
100
+ include_rom = load_rom_xml(include_tag.text)
101
+
102
102
  # import scalings
103
103
  include_rom.xpath('/rom/scaling').each do |scaling|
104
104
  if load_rom.xpath("/rom/scaling[@name='#{scaling.attr('name')}']").count == 0
@@ -1,3 +1,3 @@
1
1
  module ECUTools
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
Binary file
@@ -0,0 +1,45 @@
1
+ <?xml version="1.0"?>
2
+ <EvoScanDataLogger>
3
+ <vehicle name="EcuTools Mitsubishi Evo X" LastUpdated="28th May 2011" LastAuthor="Hamish Ahern" LastAuthorContact="http://www.evoscan.com/help-and-support">
4
+ <ecu name="52690021">
5
+ <Mode2 name="Mode2" type="Data List Items">
6
+ <DataListItem DataLog="Y" Color="" Display="RPM" LogReference="RPM" RequestID="23808746" Eval="3.90625*x" Unit="rpm" MetricEval="" MetricUnit="" ResponseBytes="2" GaugeMin="0" GaugeMax="8000" ChartMin="0" ChartMax="8000" ScalingFactor="0.01" Notes="" Priority="1" Visible="False" />
7
+ <DataListItem DataLog="Y" Color="" Display="Speed" LogReference="Speed" RequestID="238087E7" Eval="1.26*x" Unit="mph" MetricEval="" MetricUnit="" ResponseBytes="1" GaugeMin="0" GaugeMax="255" ChartMin="0" ChartMax="255" ScalingFactor="1" Notes="" Priority="1" Visible="False" />
8
+ <DataListItem DataLog="Y" Color="" Display="Load (Fuel)" LogReference="Load" RequestID="2380876E" Eval="x*10/32" Unit="load" MetricEval="" MetricUnit="" ResponseBytes="2" GaugeMin="0" GaugeMax="340" ChartMin="0" ChartMax="340" ScalingFactor="1" Notes="" Priority="1" Visible="False" />
9
+ <DataListItem DataLog="N" Color="" Display="Barometer" LogReference="Baro" RequestID="2380A909" Eval="x/2" Unit="bar" MetricEval="" MetricUnit="" ResponseBytes="1" GaugeMin="0" GaugeMax="255" ChartMin="0" ChartMax="255" ScalingFactor="1" Notes="Used for Fuel compensation for differences in altitude above sea level. " Priority="1" Visible="False" />
10
+ <DataListItem DataLog="Y" Color="#4b0000" Display="Boost" LogReference="Boost" RequestID="2380871A" Eval="(x/4*0.19347)-14.5" Unit="PSIG" MetricEval="" MetricUnit="" ResponseBytes="2" GaugeMin="0" GaugeMax="255" ChartMin="0" ChartMax="255" ScalingFactor="1" Notes="" Priority="1" Visible="False" />
11
+ <DataListItem DataLog="Y" Color="" Display="Injector Pulse Width (IPW)" LogReference="IPW" RequestID="2380A944" Eval="x/1000" Unit="ms" MetricEval="" MetricUnit="" ResponseBytes="2" GaugeMin="0" GaugeMax="255" ChartMin="0" ChartMax="255" ScalingFactor="1" Notes="Injector Pulse Width (Fuel utilisation)&#xD;&#xA;Length of time the injectors are open using fuel." Priority="1" Visible="False" />
12
+ <DataListItem DataLog="Y" Color="#ff002d" Display="Knock Sum" LogReference="KnockSum" RequestID="23808A4B" Eval="x" Unit="count" MetricEval="" MetricUnit="" ResponseBytes="1" GaugeMin="0" GaugeMax="255" ChartMin="0" ChartMax="255" ScalingFactor="1" Notes="" Priority="1" Visible="False" />
13
+ <DataListItem DataLog="N" Color="#90ff00" Display="External Wideband A/F Ratio" LogReference="WideBandAF" RequestID="WDB" Eval="x" Unit="a/f ratio" MetricEval="" MetricUnit="" ResponseBytes="1" GaugeMin="0" GaugeMax="20" ChartMin="0" ChartMax="20" ScalingFactor="1" Notes="Plug in your serial port from your wideband oxygen sensor if you have one." Priority="1" Visible="False" />
14
+ <DataListItem DataLog="Y" Color="" Display="Timing Advance" LogReference="TimingAdv" RequestID="23808A07" Eval="x-20" Unit="deg" MetricEval="" MetricUnit="" ResponseBytes="1" GaugeMin="-15" GaugeMax="50" ChartMin="-15" ChartMax="50" ScalingFactor="1" Notes="" Priority="1" Visible="False" />
15
+ <DataListItem DataLog="Y" Color="" Display="Throttle Position (TPS)" LogReference="TPS" RequestID="238086F9" Eval="(x-32)*129/255" Unit="%" MetricEval="" MetricUnit="" ResponseBytes="1" GaugeMin="0" GaugeMax="255" ChartMin="0" ChartMax="255" ScalingFactor="1" Notes="" Priority="1" Visible="False" />
16
+ <DataListItem DataLog="N" Color="" Display="Transmission Temp" LogReference="Trans_Temp" RequestID="CAN28-0" Eval="1.8*x-50" Unit="Deg F" MetricEval="x-50" MetricUnit="Deg C" ResponseBytes="1" GaugeMin="0" GaugeMax="1000" ChartMin="0" ChartMax="1000" ScalingFactor="1" Notes="" Priority="1" Visible="False" />
17
+ <DataListItem DataLog="Y" Color="" Display="Intake Air Temp (IAT)" LogReference="IAT" RequestID="23808659" Eval="1.8*x-40" Unit="Deg F" MetricEval="x-40" MetricUnit="Deg C" ResponseBytes="1" GaugeMin="0" GaugeMax="255" ChartMin="0" ChartMax="255" ScalingFactor="1" Notes="" Priority="1" Visible="False" />
18
+ <DataListItem DataLog="Y" Color="" Display="Manifold Air Temp (MAT)" LogReference="MAT" RequestID="2380865F" Eval="1.8*x-40" Unit="Deg F" MetricEval="x-40" MetricUnit="Deg C" ResponseBytes="1" GaugeMin="0" GaugeMax="255" ChartMin="0" ChartMax="255" ScalingFactor="1" Notes="" Priority="1" Visible="False" />
19
+ <DataListItem DataLog="Y" Color="" Display="Octane" LogReference="Octane" RequestID="2380459F" Eval="x*100/255" Unit="%" MetricEval="" MetricUnit="" ResponseBytes="1" GaugeMin="0" GaugeMax="255" ChartMin="0" ChartMax="255" ScalingFactor="1" Notes="The Octane Level will start at 100% and decrease if there is persistant knock sum present. the Octane Level % is used as part of adjustment to the Timing (% between Low Octane Timing ecu map and High Octane Timing ecu map) to help protect the engine from excessive knock, normally caused by lean fuel conditions (excessive heat), or bad octane fuel." Priority="1" Visible="False" />
20
+ <DataListItem DataLog="Y" Color="" Display="Fuel Trim (STFT)" LogReference="STFT" RequestID="23808898" Eval="(0.1953125*x)-25" Unit="%" MetricEval="" MetricUnit="" ResponseBytes="1" GaugeMin="0" GaugeMax="255" ChartMin="0" ChartMax="255" ScalingFactor="1" Notes="Short Term Fuel Trim" Priority="1" Visible="False" />
21
+ <DataListItem DataLog="Y" Color="" Display="Fuel Trim Idle/Low (LTFT)" LogReference="LTFT_Idle" RequestID="23804573" Eval="(0.1953125*x)-25" Unit="%" MetricEval="" MetricUnit="" ResponseBytes="1" GaugeMin="0" GaugeMax="255" ChartMin="0" ChartMax="255" ScalingFactor="1" Notes="Long Term Fuel Trim" Priority="1" Visible="False" />
22
+ <DataListItem DataLog="Y" Color="" Display="Fuel Trim Cruise/Mid (LTFT)" LogReference="LTFT_Cruise" RequestID="23804575" Eval="(0.1953125*x)-25" Unit="%" MetricEval="" MetricUnit="" ResponseBytes="1" GaugeMin="0" GaugeMax="255" ChartMin="0" ChartMax="255" ScalingFactor="1" Notes="Long Term Fuel Trim Cruise" Priority="1" Visible="False" />
23
+ <DataListItem DataLog="Y" Color="" Display="Fuel Trim High (LTFT)" LogReference="LTFT_High" RequestID="23804577" Eval="(0.1953125*x)-25" Unit="%" MetricEval="" MetricUnit="" ResponseBytes="1" GaugeMin="0" GaugeMax="255" ChartMin="0" ChartMax="255" ScalingFactor="1" Notes="Long Term Fuel Trim Cruise" Priority="1" Visible="False" />
24
+ <DataListItem DataLog="Y" Color="" Display="Engine Coolant Temp (ECT)" LogReference="ECT" RequestID="2380863F" Eval="1.8*x-40" Unit="Deg F" MetricEval="x-40" MetricUnit="Deg C" ResponseBytes="1" GaugeMin="0" GaugeMax="255" ChartMin="0" ChartMax="255" ScalingFactor="1" Notes="Water coolant temp." Priority="1" Visible="False" />
25
+ <DataListItem DataLog="N" Color="" Display="Injector Duty Cycle (IDC)" LogReference="IDC" RequestID="23808746" Eval="[IPW]*3.90625*x/1200" Unit="%" MetricEval="" MetricUnit="" ResponseBytes="2" GaugeMin="0" GaugeMax="100" ChartMin="0" ChartMax="100" ScalingFactor="1" Notes="Injector Duty Cycle. A percentage of injector utilisation." Priority="1" Visible="False" />
26
+ <DataListItem DataLog="Y" Color="" Display="Active WasteGateDuty (WGDC)" LogReference="ActiveWGDC" RequestID="23808B53" Eval="x/2" Unit="%" MetricEval="" MetricUnit="" ResponseBytes="1" GaugeMin="0" GaugeMax="255" ChartMin="0" ChartMax="255" ScalingFactor="1" Notes="Active Wastegate Duty Cycle" Priority="1" Visible="False" />
27
+ <DataListItem DataLog="Y" Color="" Display="Passive WasteGateDuty (WGDC)" LogReference="PassiveWGDC" RequestID="2380A53F" Eval="x/2" Unit="%" MetricEval="" MetricUnit="" ResponseBytes="1" GaugeMin="0" GaugeMax="255" ChartMin="0" ChartMax="255" ScalingFactor="1" Notes="Passive Wastegate Duty Cycle" Priority="1" Visible="False" />
28
+ <DataListItem DataLog="Y" Color="" Display="Active WGDC Correction" LogReference="ActiveWGDCC" RequestID="23808B51" Eval="0.5*x-64" Unit="%" MetricEval="" MetricUnit="" ResponseBytes="1" GaugeMin="0" GaugeMax="255" ChartMin="0" ChartMax="255" ScalingFactor="1" Notes="Active Wastegate Duty Cycle Correction" Priority="1" Visible="False" />
29
+ <DataListItem DataLog="Y" Color="" Display="Boost Error Correction" LogReference="BoostError" RequestID="23808B50" Eval="(x-128)/2" Unit="unit" MetricEval="" MetricUnit="" ResponseBytes="2" GaugeMin="0" GaugeMax="255" ChartMin="0" ChartMax="255" ScalingFactor="1" Notes="" Priority="1" Visible="False" />
30
+ <DataListItem DataLog="Y" Color="" Display="AFRMAP" LogReference="AFRMAP" RequestID="238088F5" Eval="14.7*128/x" Unit="AFR" MetricEval="" MetricUnit="" ResponseBytes="1" GaugeMin="0" GaugeMax="255" ChartMin="0" ChartMax="255" ScalingFactor="1" Notes="ECU ROM Fuel Map Target AFR (Air Fuel Ratio)" Priority="1" Visible="False" />
31
+ <DataListItem DataLog="Y" Color="" Display="MAF Volts" LogReference="MAFVolts" RequestID="23808F50" Eval="x/1024*5" Unit="V" MetricEval="" MetricUnit="" ResponseBytes="2" GaugeMin="0" GaugeMax="255" ChartMin="0" ChartMax="255" ScalingFactor="1" Notes="Intake Manifold Air Flow Sensor voltage." Priority="1" Visible="False" />
32
+ <DataListItem DataLog="Y" Color="" Display="Load (MIVEC) and (Timing if IAT GT 75F)" LogReference="LoadMIVEC" RequestID="23808774" Eval="x*10/32" Unit="load" MetricEval="" MetricUnit="" ResponseBytes="2" GaugeMin="0" GaugeMax="340" ChartMin="0" ChartMax="340" ScalingFactor="1" Notes="" Priority="1" Visible="False" />
33
+ <DataListItem DataLog="Y" Color="" Display="Load (Timing if IAT LE 75F)" LogReference="LoadLowIATTiming" RequestID="23808F70" Eval="x*10/32" Unit="load" MetricEval="" MetricUnit="" ResponseBytes="2" GaugeMin="0" GaugeMax="340" ChartMin="0" ChartMax="340" ScalingFactor="1" Notes="" Priority="1" Visible="False" />
34
+ <DataListItem DataLog="Y" Color="" Display="InVVT (target)" LogReference="InVVTtarget" RequestID="2380942E" Eval="(x-4096)*-0.01953125" Unit="Deg" MetricEval="" MetricUnit="" ResponseBytes="2" GaugeMin="-40" GaugeMax="50" ChartMin="-40" ChartMax="50" ScalingFactor="1" Notes="Intake Variable Valve Timing" Priority="1" Visible="False" />
35
+ <DataListItem DataLog="Y" Color="" Display="ExVVT (target)" LogReference="ExVVTtarget" RequestID="2380943A" Eval="(x-4096)*-0.01953125" Unit="Deg" MetricEval="" MetricUnit="" ResponseBytes="2" GaugeMin="-40" GaugeMax="50" ChartMin="-40" ChartMax="50" ScalingFactor="1" Notes="Exhaust Variable Valve Timing" Priority="1" Visible="False" />
36
+ <DataListItem DataLog="Y" Color="" Display="InVVT (actual)" LogReference="InVVTactual" RequestID="23809466" Eval="(x-4096)*-0.01953125" Unit="Deg" MetricEval="" MetricUnit="" ResponseBytes="2" GaugeMin="-40" GaugeMax="50" ChartMin="-40" ChartMax="50" ScalingFactor="1" Notes="Intake Variable Valve Timing" Priority="1" Visible="False" />
37
+ <DataListItem DataLog="Y" Color="" Display="ExVVT (actual)" LogReference="ExVVTactual" RequestID="23809472" Eval="(x-4096)*-0.01953125" Unit="Deg" MetricEval="" MetricUnit="" ResponseBytes="2" GaugeMin="-40" GaugeMax="50" ChartMin="-40" ChartMax="50" ScalingFactor="1" Notes="Exhaust Variable Valve Timing" Priority="1" Visible="False" />
38
+ <DataListItem DataLog="Y" Color="" Display="Accel Pedal Position" LogReference="APP" RequestID="23809505" Eval="(x-32)*129/255" Unit="%" MetricEval="" MetricUnit="" ResponseBytes="1" GaugeMin="0" GaugeMax="255" ChartMin="0" ChartMax="255" ScalingFactor="1" Notes="" Priority="1" Visible="False" />
39
+ <DataListItem DataLog="N" Color="" Display="Gear in use" LogReference="Gear" RequestID="2380886E" Eval="x/22.6" Unit="Gear" MetricEval="" MetricUnit="" ResponseBytes="2" GaugeMin="0" GaugeMax="255" ChartMin="0" ChartMax="255" ScalingFactor="1" Notes="" Priority="1" Visible="False" />
40
+ <DataListItem DataLog="N" Color="" Display="Battery" LogReference="Battery" RequestID="238086EF" Eval="x*18.75/255" Unit="V" MetricEval="" MetricUnit="" ResponseBytes="1" GaugeMin="0" GaugeMax="255" ChartMin="0" ChartMax="255" ScalingFactor="1" Notes="" Priority="1" Visible="False" />
41
+ <DataListItem DataLog="N" Color="" Display="LC-1 AFR " LogReference="LC1AFR" RequestID="2380934E" Eval="(x/1023*5.99)+10" Unit="afr" MetricEval="" MetricUnit="" ResponseBytes="1" GaugeMin="10" GaugeMax="16" ChartMin="10" ChartMax="16" ScalingFactor="1" Notes="Innovate LC-1 Air Fuel Ratio when connected directly to the ecu pin.&#xD;&#xA;Rear 02 Sensor ecu pin used for LC-1 volts output." Priority="1" Visible="False" />
42
+ </Mode2>
43
+ </ecu>
44
+ </vehicle>
45
+ </EvoScanDataLogger>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecutools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-03-19 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
16
- requirement: &2160472380 !ruby/object:Gem::Requirement
16
+ requirement: &2156488480 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0.14'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *2160472380
24
+ version_requirements: *2156488480
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: nokogiri
27
- requirement: &2160471600 !ruby/object:Gem::Requirement
27
+ requirement: &2156487680 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '1.5'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *2160471600
35
+ version_requirements: *2156487680
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: thor
38
- requirement: &2160471020 !ruby/object:Gem::Requirement
38
+ requirement: &2156486580 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0.14'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2160471020
46
+ version_requirements: *2156486580
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: nokogiri
49
- requirement: &2160470400 !ruby/object:Gem::Requirement
49
+ requirement: &2156486000 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '1.5'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *2160470400
57
+ version_requirements: *2156486000
58
58
  description: Toolkit for ECU disassembly and analysis
59
59
  email: javier@granicus.com
60
60
  executables:
@@ -77,9 +77,11 @@ files:
77
77
  - tests/52690021.asm
78
78
  - tests/52690021.hex
79
79
  - tests/52690022.hex
80
+ - tests/52690122.hex
80
81
  - xml/code/52690021.xml
81
82
  - xml/ram/52690021.xml
82
83
  - xml/ram/52690022.xml
84
+ - xml/ram/52690122.xml
83
85
  - xml/rom/52370023.xml
84
86
  - xml/rom/52370024.xml
85
87
  - xml/rom/52690019.xml