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

Skip to content
Snippets Groups Projects
Commit 1dd70dd9 authored by Markus QUARITSCH's avatar Markus QUARITSCH
Browse files

add look-ahead coasting override in new gui as well

parent 08f77b7c
No related branches found
No related tags found
No related merge requests found
......@@ -60,6 +60,7 @@ Partial Class MainForm
Me.TabPgOptions = New System.Windows.Forms.TabPage()
Me.PanelOptAllg = New System.Windows.Forms.Panel()
Me.GroupBox5 = New System.Windows.Forms.GroupBox()
Me.Label5 = New System.Windows.Forms.Label()
Me.Label4 = New System.Windows.Forms.Label()
Me.tbMinSpeedLAC = New System.Windows.Forms.TextBox()
Me.Label3 = New System.Windows.Forms.Label()
......@@ -125,7 +126,6 @@ Partial Class MainForm
Me.OpenInGraphWindowToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.ShowInFolderToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components)
Me.Label5 = New System.Windows.Forms.Label()
Me.StatusBAR.SuspendLayout
Me.TabControl1.SuspendLayout
Me.TabPageGEN.SuspendLayout
......@@ -410,6 +410,16 @@ Partial Class MainForm
Me.GroupBox5.TabIndex = 20
Me.GroupBox5.TabStop = false
Me.GroupBox5.Text = "Look-Ahead Coasting Override"
'
'Label5
'
Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, CType(0,Byte))
Me.Label5.Location = New System.Drawing.Point(7, 48)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(247, 36)
Me.Label5.TabIndex = 4
Me.Label5.Text = "Overrides Look-Ahead Coasting in declaration mode. Leave empty to use default beh"& _
"aviour."
'
'Label4
'
......@@ -919,16 +929,6 @@ Partial Class MainForm
Me.ShowInFolderToolStripMenuItem.Name = "ShowInFolderToolStripMenuItem"
Me.ShowInFolderToolStripMenuItem.Size = New System.Drawing.Size(173, 22)
Me.ShowInFolderToolStripMenuItem.Text = "Show in Folder"
'
'Label5
'
Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, CType(0,Byte))
Me.Label5.Location = New System.Drawing.Point(7, 48)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(247, 36)
Me.Label5.TabIndex = 4
Me.Label5.Text = "Overrides Look-Ahead Coasting in declaration mode. Leave empty to use default beh"& _
"aviour."
'
'MainForm
'
......
......@@ -21,12 +21,14 @@ using NLog.Targets;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Resources;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore;
using TUGraz.VectoCore.Configuration;
using TUGraz.VectoCore.InputData.FileIO.JSON;
using TUGraz.VectoCore.InputData.FileIO.XML;
using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider;
using TUGraz.VectoCore.Models.Simulation.Impl;
using TUGraz.VectoCore.Models.SimulationComponent.Data;
using TUGraz.VectoCore.OutputData;
using TUGraz.VectoCore.OutputData.FileIO;
using VECTO3GUI.Util;
......@@ -85,6 +87,7 @@ namespace VECTO3GUI.ViewModel.Impl
private ICommand _browseOutputDirectory;
private bool _writeModelData;
private ICommand _aboutViewCommand;
private string _lookAheadMinSpeedOverride;
#endregion
......@@ -144,6 +147,12 @@ namespace VECTO3GUI.ViewModel.Impl
set { SetProperty(ref _progress, value); }
}
public string LookAheadMinSpeedOverride
{
get { return _lookAheadMinSpeedOverride; }
set { SetProperty(ref _lookAheadMinSpeedOverride, value); }
}
#endregion
......@@ -935,6 +944,15 @@ namespace VECTO3GUI.ViewModel.Impl
fileWriters.Add(runId, fileWriter);
}
// TODO MQ-20200525: Remove the following loop in production (or after evaluation of LAC!!
if (!string.IsNullOrWhiteSpace(LookAheadMinSpeedOverride)) {
foreach (var run in jobContainer.Runs) {
var tmpDriver = ((VectoRun)run.Run).GetContainer().RunData.DriverData;
tmpDriver.LookAheadCoasting.Enabled = true;
tmpDriver.LookAheadCoasting.MinSpeed = LookAheadMinSpeedOverride.ToDouble().KMPHtoMeterPerSecond();
}
}
sender.ReportProgress(
0,
new VectoSimulationProgress() {
......@@ -945,7 +963,8 @@ namespace VECTO3GUI.ViewModel.Impl
MessageBox.Show(
$"ERROR running job {Path.GetFileName(jobEntry.JobEntryFilePath)}: {ex.Message}", "Error", MessageBoxButton.OK,
MessageBoxImage.Exclamation);
sender.ReportProgress(0, new VectoSimulationProgress() {Type = VectoSimulationProgress.MsgType.StatusMessage, Message = ex.Message});
sender.ReportProgress(
0, new VectoSimulationProgress() { Type = VectoSimulationProgress.MsgType.StatusMessage, Message = ex.Message });
}
}
......
......@@ -208,7 +208,7 @@
</StackPanel>
</GroupBox>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="5,0,0,0">
<StackPanel Orientation="Vertical" Margin="5,0,0,0" MaxWidth="300">
<GroupBox Header ="Output Directory">
<StackPanel Orientation="Horizontal">
<TextBox Width="200" Text="{Binding OutputDirectory}"/>
......@@ -225,6 +225,16 @@
<CheckBox IsChecked="{Binding WriteModelData}" Margin="0,0,0,3">Write internal model data (EXPERT!)</CheckBox>
</StackPanel>
</GroupBox>
<GroupBox Header="Look-Ahead Coasting Override (DEV!)" Margin="0,5,0,0">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<TextBlock>Min. Speed:</TextBlock>
<TextBox MinWidth="50" Margin="10,0,4,0" Text="{Binding LookAheadMinSpeedOverride}"/>
<TextBlock>[km/h]</TextBlock>
</StackPanel>
<TextBlock FontStyle="Italic" TextWrapping="Wrap" Margin="0,5,0,0">Overrides Lok-Ahead Coasting in declaration mode. Leave empty to use default behavious.</TextBlock>
</StackPanel>
</GroupBox>
</StackPanel>
</StackPanel>
......
......@@ -83,7 +83,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
ITransmissionInputData gear, uint i, bool useEfficiencyFallback, VehicleCategory vehicleCategory)
{
return TransmissionLossMapReader.Create(
gear.Ratio.IsEqual(1) ? GearEfficiencyDirectGear :GearEfficiencyIndirectGear, gear.Ratio, $"Gear {i + 1}");
gear.Ratio.IsEqual(1) ? GearEfficiencyDirectGear : GearEfficiencyIndirectGear, gear.Ratio, $"Gear {i + 1}");
}
protected override void CretateTCFirstGearATPowerSplit(GearData gearData, uint i, ShiftPolygon shiftPolygon)
......
......@@ -187,10 +187,10 @@ namespace TUGraz.VectoCore.Models.Declaration
result.Columns.Add(FuelConsumptionMapReader.Fields.FuelConsumption);
foreach (DataRow row in normalized.Rows) {
var engineSpeed = row.Field<double>("n_norm") * (n95h - nIdle) + nIdle;
var pwr = row.Field<double>("P_norm") * ratedPower;
var engineSpeed = row.ParseDouble("n_norm") * (n95h - nIdle) + nIdle;
var pwr = row.ParseDouble("P_norm") * ratedPower;
var torque = pwr / engineSpeed;
var fc = (row.Field<double>("FC_norm").SI(Unit.SI.Gramm.Per.Hour.Per.Kilo.Watt) * pwr).Cast<KilogramPerSecond>();
var fc = (row.ParseDouble("FC_norm").SI(Unit.SI.Gramm.Per.Hour.Kilo.Watt) * pwr).Cast<KilogramPerSecond>();
var newRow = result.NewRow();
newRow[FuelConsumptionMapReader.Fields.EngineSpeed] = Math.Round(engineSpeed.AsRPM,2, MidpointRounding.AwayFromZero);
......
......@@ -53,3 +53,4 @@ using System.Runtime.InteropServices;
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("XMLTest")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("VECTO_GIT")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("VectoAuxiliariesTests")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("VECTO3")]
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