Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 4b80e2f2 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

Merge pull request #438 in VECTO/vecto-sim from...

Merge pull request #438 in VECTO/vecto-sim from ~EMKRISPMI/vecto-sim:bugfix/VECTO-424-vectocmd-with-verbose-flags-failed to develop

* commit 'a39c4e8b':
  HashingLib: corrected some error (GetName after loading the assembly)
  Reversed Change in HashingCmd - now loading the correct dll again.
  VECTO-424 exchanged AssemblyName.GetAssemblyName by Assembly.Load with directory of executing assembly.
parents 9c5201bd a39c4e8b
No related branches found
No related tags found
No related merge requests found
......@@ -242,7 +242,6 @@ hashingcmd.exe
WriteLine("computing hashes");
var components = h.GetContainigComponents();
if (components.Count > 1) {
var grouped = components.GroupBy(s => s)
.Select(g => new { Entry = g.Key, Count = g.Count() });
......@@ -290,7 +289,7 @@ hashingcmd.exe
private static void ShowVersionInformation()
{
var hashingLib = AssemblyName.GetAssemblyName("VectoHashing.dll");
var hashingLib = Assembly.LoadFile(AppDomain.CurrentDomain.BaseDirectory + "VectoHashing.dll").GetName();
WriteLine(string.Format(@"HashingLibrary: {0}", hashingLib.Version));
}
}
......
......@@ -243,7 +243,6 @@ Examples:
timings.Add("Reading input files", stopWatch.Elapsed.TotalMilliseconds);
stopWatch.Reset();
WriteLine(@"Starting simulation runs", ConsoleColor.White);
if (_debugEnabled) {
WriteLine(@"Debug-Output is enabled, executing simulation runs sequentially", ConsoleColor.Yellow);
......@@ -337,9 +336,9 @@ Examples:
private static void ShowVersionInformation()
{
var vectodll = AssemblyName.GetAssemblyName("VectoCore.dll");
WriteLine(string.Format(@"VectoConsole: {0}", Assembly.GetExecutingAssembly().GetName().Version));
WriteLine(string.Format(@"VectoCore: {0}", vectodll.Version));
WriteLine(string.Format(@"VectoCore: {0}",
Assembly.LoadFrom(AppDomain.CurrentDomain.BaseDirectory + "VectoCore.dll").GetName().Version));
}
private static void PrintProgress(Dictionary<int, JobContainer.ProgressEntry> progessData,
......
......@@ -88,7 +88,7 @@ namespace TUGraz.VectoCore.OutputData.XML
new XElement(tns + "GearsCount", modelData.GearboxData.Gears.Count),
new XElement(tns + "Retarder", modelData.Retarder.Type.IsDedicatedComponent()),
new XElement(tns + "AxleRatio", modelData.AxleGearData.AxleGear.Ratio.ToXMLFormat(3))
);
);
InputDataIntegrity = new XElement(tns + "InputDataSignature",
modelData.InputDataHash == null ? CreateDummySig() : new XElement(modelData.InputDataHash));
}
......@@ -99,7 +99,7 @@ namespace TUGraz.VectoCore.OutputData.XML
new XElement(di + XMLNames.DI_Signature_Reference_DigestMethod,
new XAttribute(XMLNames.DI_Signature_Algorithm_Attr, "null")),
new XElement(di + XMLNames.DI_Signature_Reference_DigestValue, "NOT AVAILABLE")
);
);
}
public void AddResult(
......@@ -144,7 +144,7 @@ namespace TUGraz.VectoCore.OutputData.XML
private XElement GetApplicationInfo()
{
var vectodll = AssemblyName.GetAssemblyName("VectoCore.dll");
var vectodll = Assembly.LoadFrom(AppDomain.CurrentDomain.BaseDirectory + "VectoCore.dll").GetName();
return new XElement(tns + "ApplicationInformation",
new XElement(tns + "SimulationToolVersion", vectodll.Version),
new XElement(tns + "Date", XmlConvert.ToString(DateTime.Now, XmlDateTimeSerializationMode.Utc)));
......@@ -159,19 +159,19 @@ namespace TUGraz.VectoCore.OutputData.XML
var vehicle = new XElement(VehiclePart);
vehicle.Add(InputDataIntegrity);
retVal.Add(new XElement(tns + "VectoCustomerInformation",
new XAttribute("schemaVersion", "0.4"),
new XAttribute(XNamespace.Xmlns + "xsi", xsi.NamespaceName),
new XAttribute("xmlns", tns),
new XAttribute(XNamespace.Xmlns + "di", di),
new XAttribute(xsi + "schemaLocation",
string.Format("{0} {1}VectoCOC.xsd", tns, AbstractXMLWriter.SchemaLocationBaseUrl)),
new XElement(tns + "Data",
vehicle,
new XElement(tns + "ResultDataSignature", resultSignature),
results,
GetApplicationInfo())
new XAttribute("schemaVersion", "0.4"),
new XAttribute(XNamespace.Xmlns + "xsi", xsi.NamespaceName),
new XAttribute("xmlns", tns),
new XAttribute(XNamespace.Xmlns + "di", di),
new XAttribute(xsi + "schemaLocation",
string.Format("{0} {1}VectoCOC.xsd", tns, AbstractXMLWriter.SchemaLocationBaseUrl)),
new XElement(tns + "Data",
vehicle,
new XElement(tns + "ResultDataSignature", resultSignature),
results,
GetApplicationInfo())
)
);
);
var stream = new MemoryStream();
var writer = new StreamWriter(stream);
writer.Write(retVal);
......
......@@ -61,7 +61,6 @@ namespace TUGraz.VectoCore.OutputData.XML
protected XNamespace di;
private bool allSuccess = true;
public XMLFullReport()
{
di = "http://www.w3.org/2000/09/xmldsig#";
......@@ -91,8 +90,8 @@ namespace TUGraz.VectoCore.OutputData.XML
GetAirDragDescription(modelData.AirdragData),
GetAxleWheelsDescription(modelData.VehicleData),
GetAuxiliariesDescription(modelData.Aux)
)
);
)
);
InputDataIntegrity = new XElement(tns + "InputDataSignature",
modelData.InputDataHash == null ? CreateDummySig() : new XElement(modelData.InputDataHash));
}
......@@ -103,7 +102,7 @@ namespace TUGraz.VectoCore.OutputData.XML
new XElement(di + XMLNames.DI_Signature_Reference_DigestMethod,
new XAttribute(XMLNames.DI_Signature_Algorithm_Attr, "null")),
new XElement(di + XMLNames.DI_Signature_Reference_DigestValue, "NOT AVAILABLE")
);
);
}
private XElement GetTorqueLimits(CombustionEngineData modelData)
......@@ -134,7 +133,7 @@ namespace TUGraz.VectoCore.OutputData.XML
new XElement(tns + XMLNames.Engine_Displacement,
engineData.Displacement.ConvertTo().Cubic.Centi.Meter.ToXMLFormat(0)),
new XElement(tns + XMLNames.Engine_FuelType, engineData.FuelType.ToXMLFormat())
);
);
}
private XElement GetGearboxDescription(GearboxData gearboxData)
......@@ -144,7 +143,7 @@ namespace TUGraz.VectoCore.OutputData.XML
new XElement(tns + XMLNames.Gearbox_TransmissionType, gearboxData.Type.ToXMLFormat()),
new XElement(tns + "GearsCount", gearboxData.Gears.Count),
new XElement(tns + "TransmissionRatioFinalGear", gearboxData.Gears.Last().Value.Ratio.ToXMLFormat(3))
);
);
}
private XElement GetTorqueConverterDescription(TorqueConverterData torqueConverterData)
......@@ -187,7 +186,7 @@ namespace TUGraz.VectoCore.OutputData.XML
return new XElement(tns + XMLNames.Component_AirDrag,
new XElement(tns + "CertificationMethod", airdragData.CertificationMethod.ToXMLFormat()),
new XElement(tns + "CdxA", airdragData.DeclaredAirdragArea.ToXMLFormat(2))
);
);
}
return new XElement(tns + XMLNames.Component_AirDrag,
new XElement(tns + XMLNames.Component_Model, airdragData.ModelName),
......@@ -195,7 +194,7 @@ namespace TUGraz.VectoCore.OutputData.XML
new XElement(tns + "CertificationNumber", airdragData.CertificationNumber),
new XElement(tns + XMLNames.DI_Signature_Reference_DigestValue, airdragData.DigestValueInput),
new XElement(tns + "CdxA", airdragData.DeclaredAirdragArea.ToXMLFormat(2))
);
);
}
private XElement GetAxleWheelsDescription(VehicleData vehicleData)
......@@ -303,7 +302,7 @@ namespace TUGraz.VectoCore.OutputData.XML
new XElement(tns + "TotalVehicleMass", new XAttribute("unit", "kg"), result.TotalVehicleWeight.ToXMLFormat(0)),
new XElement(tns + "Payload", new XAttribute("unit", "kg"), result.Payload.ToXMLFormat(0)),
new XElement(tns + "FuelType", result.FuelType.ToXMLFormat())
),
),
new XElement(tns + "VehiclePerformance",
new XElement(tns + "AverageSpeed", new XAttribute("unit", "km/h"), result.AverageSpeed.AsKmph.ToXMLFormat(1)),
new XElement(tns + "MinSpeed", new XAttribute("unit", "km/h"), result.MinSpeed.AsKmph.ToXMLFormat(1)),
......@@ -312,7 +311,7 @@ namespace TUGraz.VectoCore.OutputData.XML
new XElement(tns + "MaxAcceleration", new XAttribute("unit", "m/s²"), result.MaxAcceleration.ToXMLFormat(2)),
new XElement(tns + "FullLoadDrivingtimePercentage", result.FullLoadPercentage.ToXMLFormat(0)),
new XElement(tns + "GearshiftCount", result.GearshiftCount.ToXMLFormat(0))
),
),
//FC
XMLDeclarationReport.GetResults(result, tns, true).Cast<object>().ToArray()
};
......@@ -320,7 +319,7 @@ namespace TUGraz.VectoCore.OutputData.XML
private XElement GetApplicationInfo()
{
var vectodll = AssemblyName.GetAssemblyName("VectoCore.dll");
var vectodll = Assembly.LoadFrom(AppDomain.CurrentDomain.BaseDirectory + "VectoCore.dll").GetName();
return new XElement(tns + "ApplicationInformation",
new XElement(tns + "SimulationToolVersion", vectodll.Version),
new XElement(tns + "Date", XmlConvert.ToString(DateTime.Now, XmlDateTimeSerializationMode.Utc)));
......@@ -335,18 +334,18 @@ namespace TUGraz.VectoCore.OutputData.XML
var vehicle = new XElement(VehiclePart);
vehicle.Add(InputDataIntegrity);
retVal.Add(new XElement(tns + "VectoOutput",
new XAttribute("schemaVersion", "0.4"),
new XAttribute(XNamespace.Xmlns + "xsi", xsi.NamespaceName),
new XAttribute("xmlns", tns),
new XAttribute(XNamespace.Xmlns + "di", di),
new XAttribute(xsi + "schemaLocation",
string.Format("{0} {1}VectoOutput.xsd", tns, AbstractXMLWriter.SchemaLocationBaseUrl)),
new XElement(tns + "Data",
vehicle,
results,
GetApplicationInfo())
new XAttribute("schemaVersion", "0.4"),
new XAttribute(XNamespace.Xmlns + "xsi", xsi.NamespaceName),
new XAttribute("xmlns", tns),
new XAttribute(XNamespace.Xmlns + "di", di),
new XAttribute(xsi + "schemaLocation",
string.Format("{0} {1}VectoOutput.xsd", tns, AbstractXMLWriter.SchemaLocationBaseUrl)),
new XElement(tns + "Data",
vehicle,
results,
GetApplicationInfo())
)
);
);
var stream = new MemoryStream();
var writer = new StreamWriter(stream);
writer.Write(retVal);
......
......@@ -210,7 +210,7 @@ namespace TUGraz.VectoCore.Utils
return;
}
if (addVersionHeader) {
var vectodll = AssemblyName.GetAssemblyName("VectoCore.dll");
var vectodll = Assembly.LoadFrom(AppDomain.CurrentDomain.BaseDirectory + "VectoCore.dll").GetName();
writer.WriteLine("# VECTO {0} - {1}", vectodll.Version, DateTime.Now.ToString("dd.MM.yyyy HH:mm"));
}
var header = table.Columns.Cast<DataColumn>().Select(col => col.Caption ?? col.ColumnName);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment