Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit d345ac2d authored by Michael KRISPER's avatar Michael KRISPER
Browse files

errors and warnings in gui and console

parent a8d985cb
Branches
Tags
No related merge requests found
' Copyright 2014 European Union.
' Licensed under the EUPL (the 'Licence');
' '
' * You may not use this work except in compliance with the Licence. ' This file is part of VECTO.
' * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl '
' * Unless required by applicable law or agreed to in writing, ' Copyright © 2012-2016 European Union
' software distributed under the Licence is distributed on an "AS IS" basis, '
' Developed by Graz University of Technology,
' Institute of Internal Combustion Engines and Thermodynamics,
' Institute of Technical Informatics
'
' VECTO is licensed under the EUPL, Version 1.1 or - as soon they will be approved
' by the European Commission - subsequent versions of the EUPL (the "Licence");
' You may not use VECTO except in compliance with the Licence.
' You may obtain a copy of the Licence at:
'
' https://joinup.ec.europa.eu/community/eupl/og_page/eupl
'
' Unless required by applicable law or agreed to in writing, VECTO
' distributed under the Licence is distributed on an "AS IS" basis,
' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
' See the Licence for the specific language governing permissions and
' limitations under the Licence.
'
' Authors:
' Stefan Hausberger, hausberger@ivt.tugraz.at, IVT, Graz University of Technology
' Christian Kreiner, christian.kreiner@tugraz.at, ITI, Graz University of Technology
' Michael Krisper, michael.krisper@tugraz.at, ITI, Graz University of Technology
' Raphael Luz, luz@ivt.tugraz.at, IVT, Graz University of Technology
' Markus Quaritsch, markus.quaritsch@tugraz.at, IVT, Graz University of Technology
' Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology
' '
' See the LICENSE.txt for the specific language governing permissions and limitations.
Imports System.Collections.Generic Imports System.Collections.Generic
Imports System.ComponentModel Imports System.ComponentModel
Imports System.IO Imports System.IO
Imports System.Linq Imports System.Linq
Imports System.Reflection Imports System.Reflection
Imports System.Threading
Imports TUGraz.VectoCore.Models.Simulation.Impl Imports TUGraz.VectoCore.Models.Simulation.Impl
Imports TUGraz.VectoCore.InputData Imports TUGraz.VectoCore.InputData
Imports TUGraz.VectoCore.InputData.FileIO.JSON Imports TUGraz.VectoCore.InputData.FileIO.JSON
Imports System.Text Imports System.Text
Imports System.Threading
Imports NLog
Imports NLog.Config
Imports NLog.Targets
Imports TUGraz.VectoCore.OutputData Imports TUGraz.VectoCore.OutputData
Imports TUGraz.VectoCore.OutputData.FileIO Imports TUGraz.VectoCore.OutputData.FileIO
...@@ -536,6 +559,31 @@ Public Class F_MAINForm ...@@ -536,6 +559,31 @@ Public Class F_MAINForm
End If End If
DeclOnOff() DeclOnOff()
'Init Log Writer for Listening to VectoCore Nlog
Dim config As LoggingConfiguration = LogManager.Configuration
Dim methodCallTarget As MethodCallTarget = New MethodCallTarget()
methodCallTarget.ClassName = "VECTO.F_MAINForm, vecto"
methodCallTarget.MethodName = "LogMessage"
methodCallTarget.Name = "WarningLogger"
methodCallTarget.Parameters.Add(New MethodCallParameter("${level}"))
methodCallTarget.Parameters.Add(New MethodCallParameter("${message}"))
config.LoggingRules.Add(New LoggingRule("*", LogLevel.Warn, methodCallTarget))
LogManager.Configuration = config
End Sub
Public Shared Sub LogMessage(level As String, message As String)
Try
If level = "Warn" Then
VECTOworkerV3.ReportProgress(100, New With {.Target = "ListBoxWarning", .Message = message})
ElseIf level = "Error" Or level = "Fatal" Then
VECTOworkerV3.ReportProgress(100, New With {.Target = "ListBoxError", .Message = message})
End If
Catch e As InvalidOperationException
End Try
End Sub End Sub
'Declaration mode GUI settings 'Declaration mode GUI settings
...@@ -1584,7 +1632,7 @@ lbFound: ...@@ -1584,7 +1632,7 @@ lbFound:
sender.ReportProgress(0, New With {.Target = "ListBox", .Message = "Finished Reading Data for job: " + jobFile}) sender.ReportProgress(0, New With {.Target = "ListBox", .Message = "Finished Reading Data for job: " + jobFile})
Catch ex As Exception Catch ex As Exception
MsgBox(String.Format("ERROR running job {0}: {1}", jobFile, ex.Message), MsgBoxStyle.Critical) MsgBox(String.Format("ERROR running job {0}: {1}", jobFile, ex.Message), MsgBoxStyle.Critical)
sender.ReportProgress(0, New With {.Target = "ListBox", .Message = ex.Message}) sender.ReportProgress(0, New With {.Target = "ListBoxError", .Message = ex.Message})
End Try End Try
Next Next
...@@ -1597,7 +1645,6 @@ lbFound: ...@@ -1597,7 +1645,6 @@ lbFound:
jobContainer.Execute(True) jobContainer.Execute(True)
Dim start As DateTime = DateTime.Now() Dim start As DateTime = DateTime.Now()
While Not jobContainer.AllCompleted While Not jobContainer.AllCompleted
If sender.CancellationPending Then If sender.CancellationPending Then
jobContainer.Cancel() jobContainer.Cancel()
...@@ -1610,73 +1657,44 @@ lbFound: ...@@ -1610,73 +1657,44 @@ lbFound:
Dim duration As Double = (DateTime.Now() - start).TotalSeconds Dim duration As Double = (DateTime.Now() - start).TotalSeconds
sender.ReportProgress(Int((sumProgress * 100.0) / progress.Count), sender.ReportProgress(Int((sumProgress * 100.0) / progress.Count),
New With {.Target = "Status", .Message = New With {.Target = "Status", .Message = String.Format("Duration: {0:0}s, Current Progress: {1:P} ({2})", duration, sumProgress / progress.Count,
String.Format("Duration: {0:0}s, Current Progress: {1:P} ({2})", duration, String.Join(", ", progress.Select(Function(pair) String.Format("{0,4:P}", pair.Value.Progress))))})
sumProgress / progress.Count,
String.Join(", ",
progress.Select(
Function(pair) _
String.Format("{0,4:P}",
pair.Value.Progress))))})
For Each p As KeyValuePair(Of UInteger, JobContainer.ProgressEntry) In progress For Each p As KeyValuePair(Of UInteger, JobContainer.ProgressEntry) In progress
If p.Value.Done And Not doneProcesses.Contains(p.Key) Then If p.Value.Done And Not doneProcesses.Contains(p.Key) Then
Dim modFilename As String = fileWriter.GetModDataFileName(p.Value.RunName, p.Value.CycleName, Dim modFilename As String = fileWriter.GetModDataFileName(p.Value.RunName, p.Value.CycleName, p.Value.RunSuffix)
p.Value.RunSuffix)
Dim runName As String = String.Format("{0} {1} {2}", p.Value.RunName, p.Value.CycleName, p.Value.RunSuffix) Dim runName As String = String.Format("{0} {1} {2}", p.Value.RunName, p.Value.CycleName, p.Value.RunSuffix)
sender.ReportProgress(0, sender.ReportProgress(0, New With {.Target = "ListBox", .Message = String.Format("Finished Run {0}", runName)})
New _
With {.Target = "ListBox",
.Message = String.Format("Finished Run {0}", runName)})
If Not p.Value.Error Is Nothing Then If Not p.Value.Error Is Nothing Then
sender.ReportProgress(0, New With {.Target = "ListBox", sender.ReportProgress(0, New With {.Target = "ListBoxError", .Message = String.Format("ERROR {0}: {1}", runName, p.Value.Error.Message), .Link = modFilename})
.Message =
String.Format("ERROR {0}: {1}", runName, p.Value.Error.Message),
.Link = modFilename})
End If End If
'If Not Cfg.DeclMode Then 'If Not Cfg.DeclMode Then
sender.ReportProgress(0, New With {.Target = "ListBox", sender.ReportProgress(0, New With {.Target = "ListBox", .Message = String.Format("Run {0}: Modal Results written to {1}", runName, modFilename), .Link = modFilename})
.Message =
String.Format("Run {0}: Modal Results written to {1}", runName, modFilename),
.Link = modFilename})
'End If 'End If
doneProcesses.Add(p.Key) doneProcesses.Add(p.Key)
End If End If
Next Next
Thread.Sleep(500) Thread.Sleep(250)
End While End While
Dim sumFilename As String = fileWriter.GetSumFileName() Dim sumFilename As String = fileWriter.GetSumFileName()
If File.Exists(sumFilename) Then If File.Exists(sumFilename) Then
sender.ReportProgress(100, sender.ReportProgress(100, New With {.Target = "ListBox", .Message = String.Format("Sum File written to {0}", sumFilename), .Link = sumFilename})
New _
With {.Target = "ListBox",
.Message = String.Format("Sum File written to {0}", sumFilename),
.Link = sumFilename})
End If End If
If Cfg.DeclMode Then If Cfg.DeclMode Then
For Each job As String In JobFileList For Each job As String In JobFileList
Dim report As String = Path.Combine(Path.GetDirectoryName(job), Dim report As String = Path.Combine(Path.GetDirectoryName(job), Path.GetFileNameWithoutExtension(job) + ".pdf")
Path.GetFileNameWithoutExtension(job) + ".pdf")
If File.Exists(report) Then If File.Exists(report) Then
sender.ReportProgress(100, sender.ReportProgress(100, New With {.Target = "ListBox", .Message = String.Format("PDF Report written to {0}", report), .Link = report})
New _
With {.Target = "ListBox",
.Message = String.Format("PDF Report written to {0}", report),
.Link = report})
End If End If
Next Next
End If End If
For Each progressEntry As KeyValuePair(Of UInteger, JobContainer.ProgressEntry) In jobContainer.GetProgress() For Each progressEntry As KeyValuePair(Of UInteger, JobContainer.ProgressEntry) In jobContainer.GetProgress()
Dim runName As String = String.Format("{0} {1} {2}", progressEntry.Value.RunName, progressEntry.Value.CycleName, progressEntry.Value.RunSuffix) Dim runName As String = String.Format("{0} {1} {2}", progressEntry.Value.RunName, progressEntry.Value.CycleName, progressEntry.Value.RunSuffix)
sender.ReportProgress(100, sender.ReportProgress(100, New With {.Target = "ListBox", .Message = String.Format("{0,-60} {1,8:P} {2,10:F2}s - {3}", runName, progressEntry.Value.Progress,
New _
With {.Target = "ListBox",
.Message = String.Format("{0,-60} {1,8:P} {2,10:F2}s - {3}",
runName, progressEntry.Value.Progress,
progressEntry.Value.ExecTime / 1000.0, progressEntry.Value.ExecTime / 1000.0,
IIf(progressEntry.Value.Success, "Success", "Aborted"))}) IIf(progressEntry.Value.Success, "Success", "Aborted"))})
If (Not progressEntry.Value.Success) Then If (Not progressEntry.Value.Success) Then
...@@ -1697,6 +1715,10 @@ lbFound: ...@@ -1697,6 +1715,10 @@ lbFound:
Else Else
MSGtoForm(tMsgID.Normal, e.UserState.Message, "", e.UserState.Link) MSGtoForm(tMsgID.Normal, e.UserState.Message, "", e.UserState.Link)
End If End If
Case "ListBoxWarning"
MSGtoForm(tMsgID.Warn, e.UserState.Message, "", "")
Case "ListBoxError"
MSGtoForm(tMsgID.Err, e.UserState.Message, "", "")
Case "Status" Case "Status"
Status(e.UserState.Message) Status(e.UserState.Message)
End Select End Select
......
...@@ -94,6 +94,10 @@ ...@@ -94,6 +94,10 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference> </Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\NLog.4.2.0\lib\net45\NLog.dll</HintPath>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Deployment" /> <Reference Include="System.Deployment" />
......
...@@ -2,4 +2,5 @@ ...@@ -2,4 +2,5 @@
<packages> <packages>
<package id="iTextSharp" version="5.5.7" targetFramework="net45" /> <package id="iTextSharp" version="5.5.7" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" /> <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
<package id="NLog" version="4.2.0" targetFramework="net45" />
</packages> </packages>
\ No newline at end of file
...@@ -38,6 +38,7 @@ using System.Reflection; ...@@ -38,6 +38,7 @@ using System.Reflection;
using System.Threading; using System.Threading;
using NLog; using NLog;
using NLog.Config; using NLog.Config;
using NLog.Targets;
using TUGraz.VectoCore.Configuration; using TUGraz.VectoCore.Configuration;
using TUGraz.VectoCore.InputData.FileIO.JSON; using TUGraz.VectoCore.InputData.FileIO.JSON;
using TUGraz.VectoCore.Models.Simulation.Impl; using TUGraz.VectoCore.Models.Simulation.Impl;
...@@ -48,6 +49,8 @@ namespace VectoConsole ...@@ -48,6 +49,8 @@ namespace VectoConsole
{ {
internal static class Program internal static class Program
{ {
public static List<string> WarningMessages = new List<string>();
private static int _numLines; private static int _numLines;
private static int ProgessCounter { get; set; } private static int ProgessCounter { get; set; }
...@@ -119,9 +122,21 @@ Examples: ...@@ -119,9 +122,21 @@ Examples:
} }
var config = LogManager.Configuration; var config = LogManager.Configuration;
//config.LoggingRules.Add(new LoggingRule("*", logLevel, config.FindTargetByName("ConsoleLogger")));
config.LoggingRules.Add(new LoggingRule("*", logLevel, config.FindTargetByName("LogFile"))); config.LoggingRules.Add(new LoggingRule("*", logLevel, config.FindTargetByName("LogFile")));
if (logLevel > LogLevel.Warn) {
var methodCallTarget = new MethodCallTarget {
ClassName = "VectoConsole.Program, vectocmd",
MethodName = "LogWarning",
Name = "WarningLogger"
};
methodCallTarget.Parameters.Add(new MethodCallParameter("${level}"));
methodCallTarget.Parameters.Add(new MethodCallParameter("${message}"));
config.LoggingRules.Add(new LoggingRule("*", LogLevel.Warn, methodCallTarget));
}
LogManager.Configuration = config; LogManager.Configuration = config;
// todo mk 2016-03-02: trace listener still needed?
Trace.Listeners.Add(new ConsoleTraceListener(true)); Trace.Listeners.Add(new ConsoleTraceListener(true));
if (args.Contains("-V") || debugEnabled) { if (args.Contains("-V") || debugEnabled) {
...@@ -140,8 +155,6 @@ Examples: ...@@ -140,8 +155,6 @@ Examples:
var timings = new Dictionary<string, double>(); var timings = new Dictionary<string, double>();
// process the file list and start simulation // process the file list and start simulation
//var sumFileName = Path.Combine(Path.GetDirectoryName(fileList.First()) ?? "",
// Path.GetFileNameWithoutExtension(fileList.First()) + Constants.FileExtensions.SumFile);
var fileWriter = new FileOutputWriter(fileList.First()); var fileWriter = new FileOutputWriter(fileList.First());
var sumWriter = new SummaryDataContainer(fileWriter); var sumWriter = new SummaryDataContainer(fileWriter);
_jobContainer = new JobContainer(sumWriter); _jobContainer = new JobContainer(sumWriter);
...@@ -154,9 +167,19 @@ Examples: ...@@ -154,9 +167,19 @@ Examples:
Console.ResetColor(); Console.ResetColor();
} }
Console.WriteLine(@"Reading Job Files");
stopWatch.Start(); stopWatch.Start();
foreach (var file in fileList.Where(f => Path.GetExtension(f) == Constants.FileExtensions.VectoJobFile)) {
var jobFiles = fileList.Where(f => Path.GetExtension(f) == Constants.FileExtensions.VectoJobFile).ToList();
if (!jobFiles.Any()) {
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine(@"No Job files found. Please restart the application with a valid '.vecto' file.");
Console.ResetColor();
return 1;
}
foreach (var file in jobFiles) {
Console.WriteLine(@"Reading job: " + file);
var dataProvider = JSONInputDataFactory.ReadJsonJob(file); var dataProvider = JSONInputDataFactory.ReadJsonJob(file);
var runsFactory = new SimulatorFactory(mode, dataProvider, fileWriter); var runsFactory = new SimulatorFactory(mode, dataProvider, fileWriter);
...@@ -170,7 +193,6 @@ Examples: ...@@ -170,7 +193,6 @@ Examples:
Console.ForegroundColor = ConsoleColor.White; Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine(@"Detected cycles:"); Console.WriteLine(@"Detected cycles:");
Console.ResetColor(); Console.ResetColor();
var cycles = _jobContainer.GetCycleTypes().ToList();
foreach (var cycle in _jobContainer.GetCycleTypes()) { foreach (var cycle in _jobContainer.GetCycleTypes()) {
Console.WriteLine(@" {0}: {1}", cycle.Name, cycle.CycleType); Console.WriteLine(@" {0}: {1}", cycle.Name, cycle.CycleType);
} }
...@@ -188,6 +210,9 @@ Examples: ...@@ -188,6 +210,9 @@ Examples:
} }
Console.ResetColor(); Console.ResetColor();
Console.WriteLine(); Console.WriteLine();
DisplayWarnings();
Console.WriteLine();
stopWatch.Start(); stopWatch.Start();
_jobContainer.Execute(!debugEnabled); _jobContainer.Execute(!debugEnabled);
...@@ -205,20 +230,48 @@ Examples: ...@@ -205,20 +230,48 @@ Examples:
stopWatch.Stop(); stopWatch.Stop();
timings.Add("Simulation runs", stopWatch.Elapsed.TotalMilliseconds); timings.Add("Simulation runs", stopWatch.Elapsed.TotalMilliseconds);
PrintProgress(_jobContainer.GetProgress(), args.Contains("-t")); PrintProgress(_jobContainer.GetProgress(), args.Contains("-t"));
if (args.Contains("-t")) { if (args.Contains("-t")) {
PrintTimings(timings); PrintTimings(timings);
} }
DisplayWarnings();
} catch (Exception e) { } catch (Exception e) {
Console.Error.WriteLine(e.Message);
Console.ForegroundColor = ConsoleColor.Red; Console.ForegroundColor = ConsoleColor.Red;
Console.Error.WriteLine("Please see log-file for further details (logs/log.txt)"); Console.Error.WriteLine(e.Message);
Console.ResetColor(); Console.ResetColor();
Console.Error.WriteLine("Please see log-file for further details (logs/log.txt)");
Environment.ExitCode = Environment.ExitCode != 0 ? Environment.ExitCode : 1; Environment.ExitCode = Environment.ExitCode != 0 ? Environment.ExitCode : 1;
} }
Console.ReadKey();
return Environment.ExitCode; return Environment.ExitCode;
} }
private static void DisplayWarnings()
{
if (WarningMessages.Any()) {
Console.ForegroundColor = ConsoleColor.Yellow;
foreach (var message in WarningMessages) {
Console.Error.WriteLine(message);
}
Console.ResetColor();
}
WarningMessages.Clear();
}
public static void LogWarning(string level, string message)
{
if (level == "Warn") {
WarningMessages.Add(message);
}
}
private static void ShowVersionInformation() private static void ShowVersionInformation()
{ {
var vectodll = AssemblyName.GetAssemblyName("VectoCore.dll"); var vectodll = AssemblyName.GetAssemblyName("VectoCore.dll");
...@@ -253,7 +306,14 @@ Examples: ...@@ -253,7 +306,14 @@ Examples:
var spinner = "/-\\|"[ProgessCounter++ % 4]; var spinner = "/-\\|"[ProgessCounter++ % 4];
var bar = new string('#', (int)(sumProgress * 100.0 / 2)); var bar = new string('#', (int)(sumProgress * 100.0 / 2));
Console.WriteLine(@" {2} [{1,-50}] [{0,7:P}]", sumProgress, bar, spinner); Console.WriteLine(@" {2} [{1,-50}] [{0,7:P}]", sumProgress, bar, spinner);
_numLines++;
if (WarningMessages.Any()){
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine(@"Warnings: {0,5}", WarningMessages.Count);
Console.ResetColor();
}
_numLines +=2;
} }
private static void PrintTimings(Dictionary<string, double> timings) private static void PrintTimings(Dictionary<string, double> timings)
......
...@@ -62,13 +62,22 @@ namespace TUGraz.VectoCore.Models.Declaration ...@@ -62,13 +62,22 @@ namespace TUGraz.VectoCore.Models.Declaration
if (grossVehicleMassRating < 7.5.SI<Ton>()) { if (grossVehicleMassRating < 7.5.SI<Ton>()) {
throw new VectoException("Gross vehicle mass must be greater than 7.5 tons"); throw new VectoException("Gross vehicle mass must be greater than 7.5 tons");
} }
var row =
SegmentTable.Rows.Cast<DataRow>().First(r => r.Field<string>("valid") == "1" DataRow row;
try {
row = SegmentTable.Rows.Cast<DataRow>().First(r => r.Field<string>("valid") == "1"
&& r.Field<string>("vehiclecategory") == vehicleCategory.ToString() && r.Field<string>("vehiclecategory") == vehicleCategory.ToString()
&& r.Field<string>("axleconf.") == axleConfiguration.GetName() && r.Field<string>("axleconf.") == axleConfiguration.GetName()
&& r.ParseDouble("gvw_min").SI<Ton>() < grossVehicleMassRating && r.ParseDouble("gvw_min").SI<Ton>() < grossVehicleMassRating
&& r.ParseDouble("gvw_max").SI<Ton>() >= grossVehicleMassRating && r.ParseDouble("gvw_max").SI<Ton>() >= grossVehicleMassRating
); );
} catch (InvalidOperationException e) {
var errorMessage = string.Format(
"ERROR: Could not find the declaration segment for vehicle. Category: {0}, AxleConfiguration: {1}, GrossVehicleMassRating: {2}",
vehicleCategory, axleConfiguration.GetName(), grossVehicleMassRating);
Log.Fatal(errorMessage);
throw new VectoException(errorMessage, e);
}
var segment = new Segment { var segment = new Segment {
GrossVehicleWeightMin = row.ParseDouble("gvw_min").SI().Ton.Cast<Kilogram>(), GrossVehicleWeightMin = row.ParseDouble("gvw_min").SI().Ton.Cast<Kilogram>(),
GrossVehicleWeightMax = row.ParseDouble("gvw_max").SI().Ton.Cast<Kilogram>(), GrossVehicleWeightMax = row.ParseDouble("gvw_max").SI().Ton.Cast<Kilogram>(),
......
...@@ -166,12 +166,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -166,12 +166,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
container[ModalResultField.P_trac] = CurrentState.VehicleTractionForce * averageVelocity; container[ModalResultField.P_trac] = CurrentState.VehicleTractionForce * averageVelocity;
// sanity check: is the vehicle in step with the cycle? // sanity check: is the vehicle in step with the cycle?
if (container[ModalResultField.dist] == DBNull.Value) { if (container[ModalResultField.dist] == DBNull.Value) {
Log.Warn("distance field is not set!"); Log.Warn("Distance field is not set!");
} else { } else {
var distance = (SI)container[ModalResultField.dist]; var distance = (SI)container[ModalResultField.dist];
if (!distance.IsEqual(CurrentState.Distance, 1e-12.SI<Meter>())) { if (!distance.IsEqual(CurrentState.Distance, 1e-12.SI<Meter>())) {
Log.Warn("distance diverges: {0}, distance: {1}", (distance - CurrentState.Distance).Value(), Log.Warn("Vehicle Distance diverges from Cycle by {0} [m]. Distance: {1}", (distance - CurrentState.Distance).Value(), distance);
distance);
} }
} }
} }
......
...@@ -135,7 +135,7 @@ namespace TUGraz.VectoCore.Utils ...@@ -135,7 +135,7 @@ namespace TUGraz.VectoCore.Utils
if (!string.IsNullOrWhiteSpace(message)) { if (!string.IsNullOrWhiteSpace(message)) {
if (!skip(list[index]) || skip(list[index + 1])) { if (!skip(list[index]) || skip(list[index + 1])) {
LogManager.GetLogger(typeof(T).ToString()).Error(message); LogManager.GetLogger(typeof(T).ToString()).Warn(message);
} }
} }
......
{
"Header": {
"CreatedBy": " ()",
"Date": "3/4/2015 2:09:13 PM",
"AppVersion": "2.0.4-beta3",
"FileVersion": 2
},
"Body": {
"SavedInDeclMode": false,
"VehicleFile": "../Components/24t Coach.vveh",
"EngineFile": "../Components/24t Coach.veng",
"GearboxFile": "../Components/24t Coach_smallLossMap.vgbx",
"Cycles": [
"../Cycles/Coach_24t_xshort.vdri"
],
"Aux": [
{
"ID": "ALT1",
"Type": "Alternator",
"Path": "../Components/24t_Coach_ALT.vaux",
"Technology": ""
},
{
"ID": "ALT2",
"Type": "Alternator",
"Path": "../Components/24t_Coach_ALT.vaux",
"Technology": ""
},
{
"ID": "ALT3",
"Type": "Alternator",
"Path": "../Components/24t_Coach_ALT.vaux",
"Technology": ""
}
],
"VACC": "../Components/Coach.vacc",
"EngineOnlyMode": false,
"StartStop": {
"Enabled": false,
"MaxSpeed": 5.0,
"MinTime": 0.0,
"Delay": 0
},
"LAC": {
"Enabled": true,
"Dec": -0.5,
"MinSpeed": 50.0
},
"OverSpeedEcoRoll": {
"Mode": "OverSpeed",
"MinSpeed": 70.0,
"OverSpeed": 5.0,
"UnderSpeed": 5.0
}
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment