Skip to content
Browse files

ignore comments

  • Loading branch information...
1 parent d61f4c5 commit 60d872990713ac91c76f4d7023fbb680b5155144 @cail committed Nov 1, 2010
Showing with 6 additions and 2 deletions.
  1. +2 −1 config/default.vehicles
  2. +3 −1 src/ConfigData.cs
  3. +1 −0 src/HomePage.cs
View
3 config/default.vehicles
@@ -13,10 +13,11 @@
<vehicle name="Toyota Matrix/Voltz/Pontiac Vibe 1.8 (1ZZ-FE)">
<obd>
<engine>hobd.OBD2Engine</engine>
+ <!-- Sensor definition Order is important! -->
<sensors>hobd.OBD2Sensors</sensors>
<sensors>hobd.ToyotaSensors</sensors>
- <sensors>hobd.CommonSensors</sensors>
<sensors>hobd.InjectorSensors</sensors>
+ <sensors>hobd.CommonSensors</sensors>
</obd>
<liters>1.8</liters>
<cylinders>4</cylinders>
View
4 src/ConfigData.cs
@@ -75,6 +75,7 @@ public ConfigData(string file)
XmlReaderSettings xrs = new XmlReaderSettings();
xrs.IgnoreWhitespace = true;
+ xrs.IgnoreComments = true;
this.file = file;
XmlReader reader = XmlReader.Create(file, xrs);
@@ -96,9 +97,9 @@ public ConfigData(string file)
break;
case "vehicles":
var v_file = reader.ReadElementContentAsString();
+ this.vehicle_files.Add(v_file);
try{
ReadVehicles(v_file);
- this.vehicle_files.Add(v_file);
}catch(Exception e){
Logger.error("ConfigData", "fault reading vehicle from " + v_file, e);
}
@@ -136,6 +137,7 @@ void ReadVehicles(string vfile)
{
XmlReaderSettings xrs = new XmlReaderSettings();
xrs.IgnoreWhitespace = true;
+ xrs.IgnoreComments = true;
XmlReader reader = XmlReader.Create(Path.Combine(Path.GetDirectoryName(file), vfile), xrs);
View
1 src/HomePage.cs
@@ -185,6 +185,7 @@ private void LoadSections()
try{
XmlReaderSettings xrs = new XmlReaderSettings();
xrs.IgnoreWhitespace = true;
+ xrs.IgnoreComments = true;
XmlReader reader = XmlReader.Create(Path.Combine(HOBD.AppPath, HOBD.config.Layout), xrs);
reader.Read();

0 comments on commit 60d8729

Please sign in to comment.
Something went wrong with that request. Please try again.