Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 70d7f5ac authored by Harald Martini's avatar Harald Martini
Browse files

Changed usage of GetLabel() in XMLBusAuxiliariesWriter

Added XmlNode to IAirdragViewModel

Implemented LegislativeCategory in VehicleViewModel

Added CompressorDrive to MultistageAuxiliariesViewModel

Implemented VIF Writing (WIP)

Added GuiLabels to CompressorDriveEnum
parent ae809ebf
No related branches found
No related tags found
No related merge requests found
Showing
with 96 additions and 18 deletions
......@@ -85,9 +85,9 @@ namespace VECTO3GUI2020.Util.XML.Implementation.ComponentWriter
var hvacElement = new XElement(_defaultNamespace + "HVAC");
hvacElement.Add(new XElement(_defaultNamespace + XMLNames.Bus_SystemConfiguration, _inputData.HVACAux.SystemConfiguration.GetXmlFormat()));
hvacElement.Add(new XElement(_defaultNamespace + XMLNames.Bus_HeatPumpTypeDriver, _inputData.HVACAux.HeatPumpTypeDriverCompartment.GetLabel()));
hvacElement.Add(new XElement(_defaultNamespace + XMLNames.Bus_HeatPumpModeDriver, _inputData.HVACAux.HeatPumpModeDriverCompartment?.GetLabel()));
hvacElement.Add(new XElement(_defaultNamespace + XMLNames.Bus_HeatPumpTypePassenger, _inputData.HVACAux.HeatPumpTypePassengerCompartment?.GetLabel()));
hvacElement.Add(new XElement(_defaultNamespace + XMLNames.Bus_HeatPumpModePassenger, _inputData.HVACAux.HeatPumpModePassengerCompartment?.GetLabel()));
hvacElement.Add(new XElement(_defaultNamespace + XMLNames.Bus_HeatPumpModeDriver, _inputData.HVACAux.HeatPumpModeDriverCompartment.GetLabel()));
hvacElement.Add(new XElement(_defaultNamespace + XMLNames.Bus_HeatPumpTypePassenger, _inputData.HVACAux.HeatPumpTypePassengerCompartment.GetLabel()));
hvacElement.Add(new XElement(_defaultNamespace + XMLNames.Bus_HeatPumpModePassenger, _inputData.HVACAux.HeatPumpModePassengerCompartment.GetLabel()));
hvacElement.Add(new XElement(_defaultNamespace + XMLNames.Bus_AuxiliaryHeaterPower, _inputData.HVACAux.AuxHeaterPower?.ToXMLFormat(0)));
hvacElement.Add(new XElement(_defaultNamespace + XMLNames.Bus_DoubleGlazing, _inputData.HVACAux.DoubleGlazing));
hvacElement.Add(new XElement(_defaultNamespace + XMLNames.Bus_AdjustableAuxiliaryHeater, _inputData.HVACAux.AdjustableAuxiliaryHeater));
......
......@@ -684,6 +684,10 @@
<Project>{B673E12F-D323-4C4C-8805-9915B2C72D3D}</Project>
<Name>VectoHashing</Name>
</ProjectReference>
<ProjectReference Include="..\VectoCore\VectoCoreTest\VectoCoreTest.csproj">
<Project>{6A27F93E-4A58-48F6-B00B-3908C5D3D5A2}</Project>
<Name>VectoCoreTest</Name>
</ProjectReference>
<ProjectReference Include="..\VectoCore\VectoCore\VectoCore.csproj">
<Project>{cd36938a-add9-4c65-96da-b397cdeea90a}</Project>
<Name>VectoCore</Name>
......
using System;
using System.Diagnostics;
using System.Reflection.Emit;
using System.Xml;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Utils;
......@@ -17,6 +18,8 @@ namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components
protected IAirdragDeclarationInputData _inputData;
public XmlNode XMLSource { get; }
private ICommonComponentViewModel _commonComponentViewModel;
public ICommonComponentViewModel CommonComponentViewModel
{
......@@ -39,6 +42,8 @@ namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components
Debug.Assert(_inputData != null);
_isPresent = (_inputData?.DataSource?.SourceFile != null);
XMLSource = (inputData as AbstractCommonComponentType)?.XMLSource;
_commonComponentViewModel = vmFactory.CreateCommonComponentViewModel(_inputData);
SetProperties();
}
......
......@@ -179,6 +179,8 @@ namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle
set => throw new NotImplementedException();
}
public virtual string LegislativeCategory => throw new NotImplementedException();
LegislativeClass? IVehicleDeclarationInputData.LegislativeClass { get; }
public virtual LegislativeClass LegislativeClass
......
using TUGraz.VectoCommon.InputData;
using System.Xml;
using TUGraz.VectoCommon.InputData;
namespace VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components
{
......@@ -6,5 +7,6 @@ namespace VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components
{
bool LabelVisible { get; set; }
bool IsReadOnly { get; set; }
}
XmlNode XMLSource { get; }
}
}
......@@ -485,6 +485,10 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
#region not implemented
public string LegislativeCategory
{
get => throw new NotImplementedException();
}
public IGearboxDeclarationInputData GearboxInputData => throw new NotImplementedException();
public ITorqueConverterDeclarationInputData TorqueConverterInputData => throw new NotImplementedException();
......
......@@ -185,6 +185,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
private bool? _positionlightsLed;
private bool? _headlightsLed;
private bool? _brakelightsLed;
public bool? InteriorLightsLED
{
......@@ -219,7 +220,22 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
#endregion
#region IPneumaticSuppyDeclarationData
public IPneumaticSupplyDeclarationData PneumaticSupply
{
get => this;
set => throw new NotImplementedException();
}
private CompressorDrive _compressorDrive;
public CompressorDrive CompressorDrive
{
get => _compressorDrive;
set => SetProperty(ref _compressorDrive, value);
}
#endregion
#region Implementation of interfaces (unused Properties);
......@@ -242,11 +258,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
set => throw new NotImplementedException();
}
public IPneumaticSupplyDeclarationData PneumaticSupply
{
get => this;
set => throw new NotImplementedException();
}
public IPneumaticConsumersDeclarationData PneumaticConsumers
{
......@@ -254,8 +266,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
set => throw new NotImplementedException();
}
......@@ -331,6 +342,8 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
#region Implementation of IPneumaticSupplyDeclarationData
public string Clutch => throw new NotImplementedException();
public double Ratio => throw new NotImplementedException();
......
......@@ -2,14 +2,19 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Windows;
using System.Windows.Input;
using System.Windows.Navigation;
using System.Xml;
using System.Xml.Linq;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCore.InputData.FileIO.XML;
using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider;
using TUGraz.VectoCore.Models.Simulation.Impl;
using TUGraz.VectoCore.OutputData.FileIO;
using TUGraz.VectoCore.Tests.Models.Simulation;
using TUGraz.VectoCore.Utils;
using VECTO3GUI2020.Helper;
using VECTO3GUI2020.Ninject;
......@@ -54,16 +59,44 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
get
{
return _saveVifCommand ?? new RelayCommand(() => {
SaveVIF(this);
var outPutFile = _multistageDependencies.DialogHelperLazy.Value.SaveToXMLDialog(Settings.Default.DefaultFilePath);
if (outPutFile == null) {
return;
}
SaveVIF(this, outPutFile);
}, () => true);
}
}
private static void SaveVIF(IMultistageVIFInputData inputData)
private static void SaveVIF(IMultistageVIFInputData vifData, string outputFile)
{
var numberOfManufacturingStages =
vifData.MultistageJobInputData.JobInputData.ManufacturingStages?.Count ?? 1;
var writer = new FileOutputVIFWriter(outputFile, numberOfManufacturingStages);
var inputData = new XMLDeclarationVIFInputData(vifData.MultistageJobInputData, vifData.VehicleInputData);
var factory = new SimulatorFactory(ExecutionMode.Declaration, inputData, writer);
var jobContainer = new JobContainer(new MockSumWriter()); //TODO: Replace with real sumwriter
var runs = factory.SimulationRuns().ToList();
foreach (var run in runs)
{
jobContainer.AddRun(run);
}
jobContainer.Execute();
jobContainer.WaitFinished();
var progress = jobContainer.GetProgress();
var validator = new XMLValidator(XmlReader.Create(writer.XMLMultistageReportFileName));
var vifInputData = inputData;
}
......@@ -202,7 +235,8 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
public IVehicleDeclarationInputData VehicleInputData => _manufacturingStageViewModel.Vehicle;
public IMultistageBusInputDataProvider MultistageInputData => this;
public IMultistageBusInputDataProvider MultistageJobInputData => this;
#endregion
......
......@@ -7,7 +7,7 @@
xmlns:customControls="clr-namespace:VECTO3GUI2020.Views.Multistage.CustomControls"
xmlns:implementation="clr-namespace:VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components" d:DataContext="{d:DesignInstance Type=implementation:AirDragViewModel_v2_8}"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
d:DesignHeight="450" d:DesignWidth="800" Background="BlueViolet">
<Grid>
<StackPanel>
<Label
......
using System;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Xml;
using Moq;
using Ninject;
using NUnit.Framework;
......@@ -9,7 +11,11 @@ using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCore;
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.Strategies;
using TUGraz.VectoCore.OutputData.FileIO;
using TUGraz.VectoCore.Utils;
using VECTO3GUI2020.Helper;
using VECTO3GUI2020.Ninject;
using VECTO3GUI2020.Ninject.Vehicle;
......@@ -204,6 +210,11 @@ namespace Vecto3GUI2020Test
Assert.AreEqual(VehicleDeclarationType.interim, vehicle.VehicleDeclarationType);
var airdrag = vehicle.MultistageAirdragViewModel;
Assert.NotNull(airdrag.AirDragViewModel.XMLSource);
}
......@@ -215,6 +226,7 @@ namespace Vecto3GUI2020Test
}
#region Helper
......@@ -224,7 +236,7 @@ namespace Vecto3GUI2020Test
var exists = File.Exists(filePath);
if (!exists)
{
Console.WriteLine(filePath + " not existing");
Console.WriteLine(filePath + @" not existing");
}
Assert.IsTrue(exists);
......
......@@ -990,7 +990,9 @@ namespace TUGraz.VectoCommon.InputData
public enum CompressorDrive
{
[GuiLabel("Electrically")]
electrically,
[GuiLabel("Mechanically")]
mechanically
}
......
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