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

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

Merge branch 'feature/VECTO-1410-multistage-tool-buses' of...

Merge branch 'feature/VECTO-1410-multistage-tool-buses' of git+ssh://129.27.107.191:2211/vecto-dev into test
parents df37e6e8 298c9f40
No related branches found
No related tags found
No related merge requests found
Showing
with 677 additions and 122 deletions
......@@ -19,7 +19,8 @@ namespace VECTO3GUI2020.Helper.Converter
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
return value;
}
}
}
\ No newline at end of file
......@@ -10,12 +10,13 @@ namespace VECTO3GUI2020.Helper
public class IndexedStorage<T> where T : IEquatable<T>
{
private Dictionary<string, T> indexedStorageDictionary = new Dictionary<string, T>();
private readonly Action _onValueChanged;
private readonly Action<string> _valueChangedCallback;
public IndexedStorage(Action onValueChanged = null)
public IndexedStorage(Action<string> valueChangedCallback = null)
{
_onValueChanged = onValueChanged;
_valueChangedCallback = valueChangedCallback;
}
......@@ -41,9 +42,9 @@ namespace VECTO3GUI2020.Helper
indexedStorageDictionary.Add(identifier, default(T));
}
indexedStorageDictionary[identifier] = value;
if (value.Equals(oldValue))
if (!value.Equals(oldValue))
{
_onValueChanged?.Invoke();
_valueChangedCallback?.Invoke(identifier);
}
}
}
......
......@@ -11,12 +11,13 @@
xmlns:multistageviews="clr-namespace:VECTO3GUI2020.Views.Multistage"
xmlns:componentimpl="clr-namespace:VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components"
xmlns:componentviews="clr-namespace:VECTO3GUI2020.Views.JobEditViews.Vehicle.Components"
xmlns:multistageimpl="clr-namespace:VECTO3GUI2020.ViewModel.MultiStage.Implementation">
xmlns:multistageimpl="clr-namespace:VECTO3GUI2020.ViewModel.MultiStage.Implementation"
xmlns:viewModel="clr-namespace:VECTO3GUI2020.ViewModel">
<DataTemplate x:Shared="False" DataType="{x:Type impl:JobListViewModel}">
<views:JobListView />
</DataTemplate>
<DataTemplate x:Shared="False" DataType="{x:Type impl:MessageViewModel}">
<views:MessageView />
<DataTemplate x:Shared="False" DataType="{x:Type viewModel:OutputViewModel}">
<views:OutputView />
</DataTemplate>
<DataTemplate x:Shared="False" DataType="{x:Type impl:MainWindowViewModel}">
......@@ -27,6 +28,8 @@
<views:SettingsView/>
</DataTemplate>
......
......@@ -271,6 +271,7 @@ namespace VECTO3GUI2020.Util.XML.Implementation
aDASElement.Add(new XElement(adasNamespace + XMLNames.Vehicle_ADAS_EcoRollWithEngineStopStart, ecoRollWithEngineStop));
aDASElement.Add(new XElement(adasNamespace + XMLNames.Vehicle_ADAS_PCC,
_inputData.ADAS.PredictiveCruiseControl.ToXMLFormat()));
aDASElement.Add(new XElement(adasNamespace + XMLNames.Bus_ADAS_APTEcoRollReleaseLockupClutch, _inputData.ADAS?.ATEcoRollReleaseLockupClutch ));
}
_Xelement.DescendantsAndSelf().Where(e => e.Value.IsNullOrEmpty()).Remove();
......
......@@ -185,6 +185,7 @@
<Compile Include="ViewModel\Implementation\Document\DeclarationJobViewModel.cs" />
<Compile Include="ViewModel\Implementation\Document\DeclarationTrailerJobDocumentViewModel.cs" />
<Compile Include="Model\Interfaces\IAuxiliaryModelFactory.cs" />
<Compile Include="ViewModel\Implementation\MessageEntry.cs" />
<Compile Include="ViewModel\Interfaces\Document\IDocumentViewModel.cs" />
<Compile Include="ViewModel\Interfaces\Document\IDocumentViewModelFactory.cs" />
<Compile Include="ViewModel\Interfaces\Document\IJobViewModel.cs" />
......@@ -416,6 +417,9 @@
<Compile Include="Views\Multistage\VehicleView_v2_8.xaml.cs">
<DependentUpon>VehicleView_v2_8.xaml</DependentUpon>
</Compile>
<Compile Include="Views\OutputView.xaml.cs">
<DependentUpon>OutputView.xaml</DependentUpon>
</Compile>
<Compile Include="Views\SettingsView.xaml.cs">
<DependentUpon>SettingsView.xaml</DependentUpon>
</Compile>
......@@ -640,6 +644,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\OutputView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\SettingsView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
......
......@@ -26,11 +26,19 @@ namespace VECTO3GUI2020.ViewModel.Implementation.Document
get => _jobEditViewModel as IEditViewModel;
}
#endregion
public bool Selected
{
get => _selected;
set => SetProperty(ref _selected, value);
}
#endregion
#region Members
public IXMLInputDataReader _xMLInputDataReader;
#endregion
private bool _selected;
#endregion
public DeclarationJobViewModel(XmlDocumentType xmlDocumentType, string sourcefile, IXMLInputDataReader xMLInputDataReader,
......
......@@ -20,7 +20,13 @@ namespace VECTO3GUI2020.ViewModel.Implementation.Document
public IJobEditViewModel EditViewModel { get => _jobEditViewModel; }
IEditViewModel IDocumentViewModel.EditViewModel => throw new System.NotImplementedException();
public bool Selected
{
get => throw new System.NotImplementedException();
set => throw new System.NotImplementedException();
}
IEditViewModel IDocumentViewModel.EditViewModel => throw new System.NotImplementedException();
private IXMLInputDataReader _xMLInputDataReader;
......
using Microsoft.Win32;
using Ninject;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;
using System.Windows.Input;
using System.Xml;
using System.Xml.Linq;
using Microsoft.Toolkit.Mvvm.Input;
using Microsoft.WindowsAPICodePack.Shell.Interop;
using Microsoft.WindowsAPICodePack.Shell.PropertySystem;
using TUGraz.VectoCommon.Exceptions;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Resources;
using TUGraz.VectoCore;
using TUGraz.VectoCore.Configuration;
using TUGraz.VectoCore.InputData.FileIO.JSON;
using TUGraz.VectoCore.InputData.FileIO.XML;
using TUGraz.VectoCore.InputData.Impl;
using TUGraz.VectoCore.Models.Simulation.Impl;
using TUGraz.VectoCore.OutputData;
using TUGraz.VectoCore.OutputData.FileIO;
using TUGraz.VectoCore.Utils;
using VECTO3GUI2020.Annotations;
using VECTO3GUI2020.Helper;
......@@ -26,6 +42,7 @@ using VECTO3GUI2020.ViewModel.MultiStage.Interfaces;
using VECTO3GUI2020.Views;
using IDocumentViewModel = VECTO3GUI2020.ViewModel.Interfaces.Document.IDocumentViewModel;
using RelayCommand = VECTO3GUI2020.Util.RelayCommand;
using XmlDocumentType = TUGraz.VectoCore.Utils.XmlDocumentType;
namespace VECTO3GUI2020.ViewModel.Implementation
{
......@@ -51,7 +68,7 @@ namespace VECTO3GUI2020.ViewModel.Implementation
private BackgroundWorker fileReadingBackgroundWorker;
private object _jobsLock = new Object();
private ObservableCollection<IDocumentViewModel> _jobs = new ObservableCollection<IDocumentViewModel>();
public ObservableCollection<IDocumentViewModel> Jobs{ get => _jobs; set => SetProperty(ref _jobs, value);}
......@@ -65,6 +82,10 @@ namespace VECTO3GUI2020.ViewModel.Implementation
private IAsyncRelayCommand _simulationCommand;
private readonly IOutputViewModel _outputViewModel;
#endregion
......@@ -72,9 +93,10 @@ namespace VECTO3GUI2020.ViewModel.Implementation
public JobListViewModel()
{
BindingOperations.EnableCollectionSynchronization(Jobs, _jobsLock);
InitFileBackGroundWorker();
}
......@@ -110,30 +132,245 @@ namespace VECTO3GUI2020.ViewModel.Implementation
Debug.WriteLine(e.ProgressPercentage);
}
public void JobDataGrid_OnDrop(object sender, DragEventArgs e)
private CancellationTokenSource cancellationTokenSource = new CancellationTokenSource();
private bool _simulationRunning = false;
public bool SimulationRunning
{
throw new System.NotImplementedException();
get => _simulationRunning;
set
{
SetProperty(ref _simulationRunning, value);
OnPropertyChanged(nameof(SimulationCommand));
OnPropertyChanged(nameof(CancelSimulation));
}
}
private ICommand _cancelSimulationCommand;
private async Task RunSimulationExecute()
{
cancellationTokenSource = new CancellationTokenSource();
SimulationRunning = true;
await RunSimulationAsync(cancellationTokenSource.Token,
new Progress<MessageEntry>((message) => { _outputViewModel.Messages.Add(message); }),
new Progress<int>((i) => _outputViewModel.Progress = i));
SimulationRunning = false;
_outputViewModel.Progress = 0;
cancellationTokenSource.Dispose();
}
private async Task RunSimulationAsync(CancellationToken ct, IProgress<MessageEntry> outputMessages, IProgress<int> progress)
{
progress.Report(0);
for (int i = 0; i <= 100; i++) {
await Task.Delay(0);
progress.Report(i);
if (ct.IsCancellationRequested) {
return;
}
}
IDocumentViewModel[] jobs;
lock (_jobsLock) {
jobs = Jobs.Where(x => x.Selected).ToArray();
if (jobs.Length == 0) {
outputMessages.Report(new MessageEntry() {
Message = "No Jobs Selected",
Time = DateTime.Now,
Type = MessageType.InfoMessage,
});
}
}
//TODO add output path to settings
var outputPath = Settings.Default.DefaultFilePath;
var sumFileWriter = new FileOutputWriter(outputPath);
var sumContainer = new SummaryDataContainer(sumFileWriter);
var jobContainer = new JobContainer(sumContainer);
var mode = ExecutionMode.Declaration;
var fileWriters = new Dictionary<int, FileOutputWriter>();
var finishedRuns = new List<int>();
var xmlReader = _inputDataReader;
foreach (var jobEntry in jobs) {
try
{
var fullFileName = Path.GetFullPath(jobEntry.DataSource.SourceFile);
if (!File.Exists(fullFileName))
{
outputMessages.Report(new MessageEntry()
{
Type = MessageType.ErrorMessage,
Message =
$"File {Path.GetFileName(jobEntry.DataSource.SourceFile)} not found!"
});
continue;
}
outputMessages.Report(
new MessageEntry()
{
Type = MessageType.StatusMessage,
Message = $"Reading file {Path.GetFileName(fullFileName)}"
});
var extension = Path.GetExtension(jobEntry.DataSource.SourceFile);
IInputDataProvider input = null;
switch (extension)
{
case Constants.FileExtensions.VectoJobFile:
input = JSONInputDataFactory.ReadJsonJob(fullFileName);
var tmp = input as IDeclarationInputDataProvider;
mode = tmp?.JobInputData.SavedInDeclarationMode ?? false ? ExecutionMode.Declaration : ExecutionMode.Engineering;
break;
case ".xml":
var xdoc = XDocument.Load(fullFileName);
var rootNode = xdoc.Root?.Name.LocalName ?? "";
if (XMLNames.VectoInputEngineering.Equals(rootNode, StringComparison.InvariantCultureIgnoreCase))
{
input = xmlReader.CreateEngineering(fullFileName);
mode = ExecutionMode.Engineering;
}
else if (XMLNames.VectoInputDeclaration.Equals(rootNode, StringComparison.InvariantCultureIgnoreCase)
|| XMLNames.VectoOutputMultistage.Equals(rootNode, StringComparison.InvariantCultureIgnoreCase))
{
using (var reader = XmlReader.Create(fullFileName))
{
input = xmlReader.CreateDeclaration(reader);
}
mode = ExecutionMode.Declaration;
}
break;
}
if (input == null)
{
outputMessages.Report(
new MessageEntry()
{
Type = MessageType.ErrorMessage,
Message = $"No input provider for job {Path.GetFileName(fullFileName)}"
});
continue;
}
var fileWriter = new FileOutputWriter(GetOutputDirectory(fullFileName));
var runsFactory = new SimulatorFactory(mode, input, fileWriter)
{
WriteModalResults = true,
ModalResults1Hz = true,
Validate = true,
ActualModalData = true,
SerializeVectoRunData = true
};
foreach (var runId in jobContainer.AddRuns(runsFactory))
{
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();
}
}
*/
outputMessages.Report(
new MessageEntry()
{
Type = MessageType.StatusMessage,
Message = $"Finished reading data for job {Path.GetFileName(fullFileName)}"
});
}
catch (Exception ex)
{
/*
MessageBox.Show(
$"ERROR running job {Path.GetFileName(jobEntry.DataSource.SourceFile)}: {ex.Message}", "Error", MessageBoxButton.OK,
MessageBoxImage.Exclamation);
*/
outputMessages.Report(
new MessageEntry()
{
Type = MessageType.ErrorMessage,
Message = ex.Message
});
}
}
#region Commands
}
public IAsyncRelayCommand SimulationCommand
private string GetOutputDirectory(string jobFilePath)
{
get => _simulationCommand ?? new AsyncRelayCommand(RunSimulationAsync, () => true);
var outFile = jobFilePath;
var OutputDirectory = Settings.Default.DefaultFilePath;
if (!string.IsNullOrWhiteSpace(OutputDirectory))
{
if (Path.IsPathRooted(OutputDirectory))
{
outFile = Path.Combine(OutputDirectory, Path.GetFileName(jobFilePath) ?? "");
}
else
{
outFile = Path.Combine(Path.GetDirectoryName(jobFilePath) ?? "", OutputDirectory, Path.GetFileName(jobFilePath) ?? "");
}
if (!Directory.Exists(Path.GetDirectoryName(outFile)))
{
Directory.CreateDirectory(Path.GetDirectoryName(outFile));
}
}
return outFile;
}
private Task RunSimulationAsync(CancellationToken arg)
#region Commands
public ICommand CancelSimulation
{
_outputViewModel.Messages.Add("hi");
return null;
get
{
return _cancelSimulationCommand ?? new RelayCommand(() => { cancellationTokenSource.Cancel(); },
() => SimulationRunning);
}
}
public IAsyncRelayCommand SimulationCommand
{
get
{
return _simulationCommand ?? new AsyncRelayCommand(RunSimulationExecute, () => !SimulationRunning);
}
}
public ICommand NewManufacturingStageFile
{
get
......@@ -417,4 +654,25 @@ namespace VECTO3GUI2020.ViewModel.Implementation
#endregion
}
public class VectoSimulationProgress
{
public enum MsgType
{
StatusMessage,
InfoMessage,
Progress,
LogError,
LogWarning,
}
public string Message { get; set; }
public MsgType Type { get; set; }
public string Link { get; set; }
}
}
......@@ -27,12 +27,13 @@ namespace VECTO3GUI2020.ViewModel.Implementation
#endregion
public MainWindowViewModel(IWindowHelper windowHelper, ISettingsViewModel settingsViewModel, IJobListViewModel jobListViewModel)
public MainWindowViewModel(IWindowHelper windowHelper, ISettingsViewModel settingsViewModel, IJobListViewModel jobListViewModel, IOutputViewModel outputViewModel)
{
_windowHelper = windowHelper;
_settingsViewModel = settingsViewModel;
_jobListVm = jobListViewModel;
_bottomView = new TestViewModel();
_bottomView = outputViewModel;
//_bottomView = new TestViewModel();
}
public IMainViewModel CurrentViewModelTop
......
using System;
using Microsoft.Toolkit.Mvvm.ComponentModel;
namespace VECTO3GUI2020.ViewModel.Implementation
{
public enum MessageType
{
InfoMessage,
StatusMessage,
ErrorMessage,
WarningMessage,
}
public class MessageEntry : ObservableObject
{
private string _message;
private DateTime _time = DateTime.Today;
private string _source;
private MessageType _type;
public string Message
{
get { return _message; }
set { SetProperty(ref _message, value); }
}
public MessageType Type
{
get { return _type; }
set { SetProperty(ref _type, value); }
}
public DateTime Time
{
get { return _time; }
set { SetProperty(ref _time, value); }
}
public string Source
{
get { return _source; }
set { SetProperty(ref _source, value); }
}
}
}
using System;
using System.Collections.ObjectModel;
using System.Windows.Data;
using VECTO3GUI2020.ViewModel.Implementation;
using VECTO3GUI2020.ViewModel.Implementation.Common;
using VECTO3GUI2020.ViewModel.Interfaces;
using VECTO3GUI2020.ViewModel.Interfaces.Common;
namespace VECTO3GUI2020.ViewModel
......@@ -11,9 +13,10 @@ namespace VECTO3GUI2020.ViewModel
public class OutputViewModel : ViewModelBase, IOutputViewModel
{
private object _messageLock = new Object();
private ObservableCollection<string> _messages = new ObservableCollection<string>();
private ObservableCollection<MessageEntry> _messages = new ObservableCollection<MessageEntry>();
private int _progress;
public ObservableCollection<string> Messages
public ObservableCollection<MessageEntry> Messages
{
get
{
......@@ -21,16 +24,26 @@ namespace VECTO3GUI2020.ViewModel
}
}
public int Progress
{
get => _progress;
set => SetProperty(ref _progress, value);
}
public OutputViewModel()
{
BindingOperations.EnableCollectionSynchronization(Messages, _messageLock );
}
}
public interface IOutputViewModel
public interface IOutputViewModel : IMainViewModel
{
ObservableCollection<string> Messages { get; }
ObservableCollection<MessageEntry> Messages { get; }
int Progress { get; set; }
}
}
\ No newline at end of file
......@@ -11,5 +11,6 @@ namespace VECTO3GUI2020.ViewModel.Interfaces.Document
DataSource DataSource { get; }
IEditViewModel EditViewModel { get; }
bool Selected { get; set; }
}
}
......@@ -141,7 +141,12 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
.BusAuxiliaries);
AirdragModifiedMultistageEditingEnabled = false;
_editingEnabledDictionary = new IndexedStorage<bool>(() => OnPropertyChanged(nameof(EditingEnabledDictionary)));
_editingEnabledDictionary = new IndexedStorage<bool>((identifier) => {
OnPropertyChanged(identifier);
OnPropertyChanged(nameof(EditingEnabledDictionary));
});
}
public IVehicleDeclarationInputData ConsolidatedVehicleData
......@@ -178,6 +183,11 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
NumberOfPassengersLowerDeck = vehicleInputData.NumberOfPassengersLowerDeck;
VehicleCode = vehicleInputData.VehicleCode;
LowEntry = vehicleInputData.LowEntry;
MeasurementsGroupEditingEnabled =
vehicleInputData.Height != null ||
vehicleInputData.Width != null ||
vehicleInputData.Length != null ||
vehicleInputData.EntranceHeight != null;
Height = vehicleInputData.Height;
Width = vehicleInputData.Width;
Length = vehicleInputData.Length;
......@@ -257,7 +267,14 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
public bool MeasurementsGroupEditingEnabled
{
get { return _measurementsGroupEditingEnabled; }
set { SetProperty(ref _measurementsGroupEditingEnabled, value); }
set
{
SetProperty(ref _measurementsGroupEditingEnabled, value);
OnPropertyChanged(nameof(HeightInMm));
OnPropertyChanged(nameof(WidthInMm));
OnPropertyChanged(nameof(EntranceHeightInMm));
OnPropertyChanged(nameof(LengthInMm));
}
}
public ConvertedSI HeightInMm
......@@ -278,7 +295,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
set
{
SetProperty(ref _height, value);
//OnPropertyChanged(nameof(HeightInMm));
OnPropertyChanged(nameof(HeightInMm));
}
}
......@@ -301,7 +318,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
set
{
SetProperty(ref _length, value);
//OnPropertyChanged(nameof(LengthInMm));
OnPropertyChanged(nameof(LengthInMm));
}
}
......@@ -324,7 +341,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
set
{
SetProperty(ref _width, value);
//OnPropertyChanged(nameof(WidthInMm));
OnPropertyChanged(nameof(WidthInMm));
}
}
......@@ -351,7 +368,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
set
{
SetProperty(ref _entranceHeight, value);
//OnPropertyChanged(nameof(EntranceHeightInMm));
OnPropertyChanged(nameof(EntranceHeightInMm));
}
}
......@@ -584,6 +601,10 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
set
{
SetProperty(ref _adasEditingEnabled, value);
OnPropertyChanged(nameof(EngineStopStartNullable));
OnPropertyChanged(nameof(EcoRollTypeNullable));
OnPropertyChanged(nameof(PredictiveCruiseControlNullable));
OnPropertyChanged(nameof(ATEcoRollReleaseLockupClutch));
}
}
......@@ -853,6 +874,20 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
if (AirdragModifiedMultistageEditingEnabled && (AirdragModifiedEnum == AIRDRAGMODIFIED.UNKNOWN)) {
result = "Air drag modified has to be set";
}
break;
case nameof(EcoRollTypeNullable):
case nameof(EngineStopStartNullable):
case nameof(PredictiveCruiseControlNullable):
case nameof(ATEcoRollReleaseLockupClutch):
if (AdasEditingEnabled == true && this.GetType().GetProperty(propertyName).GetValue(this) == null){
result = $"{propertyName} has to be set if editing is enabled}}";
}
break;
default:
if (EditingEnabledDictionary[propertyName] == true && this.GetType().GetProperty(propertyName).GetValue(this) == null) {
result = $"{propertyName} has to be set if editing is enabled}}";
}
break;
}
//https://www.youtube.com/watch?v=5KF0GGObuAQ
......@@ -869,12 +904,15 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
}
}
public string Error { get => String.Join(",", Errors.Values); }
public string Error
{
get => String.Join(",", Errors.Values);
}
public bool HasErrors
{
get
{
return !Error.IsNullOrEmpty();
return !Error.IsNullOrEmpty() || MultistageAuxiliariesViewModel.HasErrors;
}
}
#endregion
......
......@@ -70,9 +70,10 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
public DigestData Signature => throw new NotImplementedException();
public void SetInputData(IVehicleDeclarationInputData vehicleInputData)
{
_vehicleViewModel.SetVehicleInputData(vehicleInputData);
_vehicleViewModel.MultistageAirdragViewModel.SetAirdragInputData(vehicleInputData?.Components?.AirdragInputData);
_vehicleViewModel.MultistageAuxiliariesViewModel.SetAuxiliariesInputData(vehicleInputData?.Components?.BusAuxiliaries);
VehicleViewModel.SetVehicleInputData(vehicleInputData);
VehicleViewModel.MultistageAirdragViewModel.SetAirdragInputData(vehicleInputData?.Components?.AirdragInputData);
VehicleViewModel.MultistageAuxiliariesViewModel.SetAuxiliariesInputData(vehicleInputData?.Components?.BusAuxiliaries);
OnPropertyChanged(nameof(CurrentView));
}
......
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Xml;
using Castle.Core.Internal;
using TUGraz.VectoCommon.BusAuxiliaries;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models;
......@@ -24,10 +26,12 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
void SetAuxiliariesInputData(IBusAuxiliariesDeclarationData componentsAuxiliaryInputData);
bool HasValues { get; }
object PrimaryVehicleHybridElectric { get; set; }
bool HasErrors { get; }
Dictionary<string, string> Errors { get; }
}
public class MultistageAuxiliariesViewModel : ViewModelBase, IMultistageAuxiliariesViewModel
public class MultistageAuxiliariesViewModel : ViewModelBase, IMultistageAuxiliariesViewModel, IDataErrorInfo
{
private IBusAuxiliariesDeclarationData _consolidatedInputData;
......@@ -169,13 +173,11 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
{
SetProperty(ref _heatPumpGroupEditingEnabled, value);
//if (value == false)
//{
// HeatPumpTypePassengerCompartment = null;
// HeatPumpModePassengerCompartment = null;
// HeatPumpModeDriverCompartment = null;
// HeatPumpTypeDriverCompartment = null;
//}
OnPropertyChanged(nameof(HeatPumpModeDriverCompartment));
OnPropertyChanged(nameof(HeatPumpTypeDriverCompartment));
OnPropertyChanged(nameof(HeatPumpTypePassengerCompartment));
OnPropertyChanged(nameof(HeatPumpModePassengerCompartment));
OnPropertyChanged(nameof(SystemConfiguration));
}
}
......@@ -403,6 +405,8 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
PositionlightsLED = componentsAuxiliaryInputData.ElectricConsumers?.PositionlightsLED;
HeadlightsLED = componentsAuxiliaryInputData.ElectricConsumers?.HeadlightsLED;
BrakelightsLED = componentsAuxiliaryInputData.ElectricConsumers?.BrakelightsLED;
OnPropertyChanged(String.Empty);
}
private void ResetData()
......@@ -427,14 +431,18 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
PositionlightsLED = null;
HeadlightsLED = null;
BrakelightsLED = null;
OnPropertyChanged(String.Empty);
}
public MultistageAuxiliariesViewModel(IBusAuxiliariesDeclarationData consolidatedAuxiliariesInputData)
{
ConsolidatedInputData = consolidatedAuxiliariesInputData;
HeatPumpGroupEditingEnabled = true;
_editingEnabledDictionary = new IndexedStorage<bool>(() => {
_editingEnabledDictionary = new IndexedStorage<bool>((identifier) => {
OnPropertyChanged(nameof(EditingEnabledDictionary));
OnPropertyChanged(nameof(identifier));
});
}
......@@ -475,5 +483,60 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
public ConsumerTechnology AdBlueDosing => throw new NotImplementedException();
#endregion
#region Implementation of IDataErrorInfo
public Dictionary<string, string> Errors { get; private set; } = new Dictionary<string, string>();
public string this[string propertyName]
{
get
{
string result = null;
switch (propertyName)
{
case nameof(HeatPumpTypeDriverCompartment):
case nameof(HeatPumpModeDriverCompartment):
case nameof(HeatPumpModePassengerCompartment):
case nameof(HeatPumpTypePassengerCompartment):
case nameof(SystemConfiguration):
if (HeatPumpGroupEditingEnabled == true &&
this.GetType().GetProperty(propertyName).GetValue(this) == null) {
result = $"{propertyName} has to be set if editing is enabled}}";
}
break;
default:
if (EditingEnabledDictionary[propertyName] == true && this.GetType().GetProperty(propertyName).GetValue(this) == null)
{
result = $"{propertyName} has to be set if editing is enabled}}";
}
break;
}
//https://www.youtube.com/watch?v=5KF0GGObuAQ
if (result == null)
{
if (Errors.ContainsKey(propertyName))
Errors.Remove(propertyName);
}
else
{
Errors[propertyName] = result;
}
return result;
}
}
public string Error { get => String.Join(",", Errors.Values); }
public bool HasErrors
{
get
{
return !Error.IsNullOrEmpty();
}
}
#endregion
}
}
\ No newline at end of file
using System;
using System.CodeDom;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
......@@ -101,21 +102,36 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
get
{
return _saveVifCommand ?? new RelayCommand(() => {
if (_manufacturingStageViewModel.Vehicle is IMultistageVehicleViewModel vehicleViewModel)
{
if (vehicleViewModel.HasErrors)
{
_dialogHelper.Value.ShowMessageBox("Vehicle\n" + string.Join("\n", vehicleViewModel.Errors.Values)
+ (vehicleViewModel.MultistageAuxiliariesViewModel.HasErrors ? ("\nAuxiliaries\n" + string.Join("\n", vehicleViewModel.MultistageAuxiliariesViewModel.Errors.Values)) : ""),
"Error");
return;
}
} else {
throw new NotImplementedException();
}
var outputFile = _multistageDependencies.DialogHelperLazy.Value.SaveToXMLDialog(Settings.Default.DefaultFilePath);
if (outputFile == null) {
return;
}
SaveVif(this, outputFile);
SaveVif(vifData:this, outputFile:outputFile, dialogHelper:_dialogHelper.Value);
}, () => true);
}
}
public static void SaveVif(IMultistageVIFInputData vifData, FileOutputVIFWriter writer)
public static void SaveVif(IMultistageVIFInputData vifData, FileOutputVIFWriter writer, IDialogHelper dialogHelper = null)
{
SaveVif(vifData, null, writer);
SaveVif(vifData, null, writer, dialogHelper);
}
public static void SaveVif(IMultistageVIFInputData vifData, string outputFile, FileOutputVIFWriter writer = null)
public static void SaveVif(IMultistageVIFInputData vifData, string outputFile,
FileOutputVIFWriter writer = null, IDialogHelper dialogHelper = null)
{
if (writer == null) {
var numberOfManufacturingStages = vifData.MultistageJobInputData.JobInputData.ManufacturingStages?.Count ?? 0;
......@@ -137,13 +153,22 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
jobContainer.Execute();
jobContainer.WaitFinished();
var validator = new XMLValidator(XmlReader.Create(writer.XMLMultistageReportFileName));
var valid = validator.ValidateXML(XmlDocumentType.MultistageOutputData);
if (!valid) {
Debug.WriteLine("Invalid Outputfile");
using (var reader = XmlReader.Create(writer.XMLMultistageReportFileName)) {
var validator = new XMLValidator(reader);
var valid = validator.ValidateXML(XmlDocumentType.MultistageOutputData);
if (!valid){
dialogHelper?.ShowMessageBox($"Error writing file {validator.ValidationError}", "Error",
MessageBoxButton.OK, MessageBoxImage.Error);
Debug.WriteLine("Invalid Outputfile");
return;
} else {
dialogHelper?.ShowMessageBox($"Written to {writer.XMLMultistageReportFileName}", "Info",
MessageBoxButton.OK, MessageBoxImage.Information);
Debug.WriteLine($"Written to {writer.XMLMultistageReportFileName}");
}
}
Debug.WriteLine($"Written to {writer.XMLMultistageReportFileName}");
}
private ICommand _saveInputDataCommand;
......@@ -164,7 +189,9 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
if(_manufacturingStageViewModel.Vehicle is IMultistageVehicleViewModel vehicleViewModel)
{
if (vehicleViewModel.HasErrors) {
_dialogHelper.Value.ShowMessageBox(string.Join("\n", vehicleViewModel.Errors.Values), "Error" );
_dialogHelper.Value.ShowMessageBox("Vehicle\n" + string.Join("\n", vehicleViewModel.Errors.Values)
+ (vehicleViewModel.MultistageAuxiliariesViewModel.HasErrors ? ("\nAuxiliaries\n" + string.Join("\n", vehicleViewModel.MultistageAuxiliariesViewModel.Errors.Values)) : ""),
"Error");
return;
}
}
......@@ -223,6 +250,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
private readonly IMultistageDependencies _multistageDependencies;
private readonly DataSource _dataSource;
private readonly IMultistageBusInputDataProvider _inputData;
private bool _selected;
public ICommand LoadVehicleDataCommand
{
......@@ -280,6 +308,12 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
public IEditViewModel EditViewModel => this;
public bool Selected
{
get => _selected;
set => SetProperty(ref _selected, value);
}
#endregion
#region Implementation of IMultistageVIFInputData
......
......@@ -20,7 +20,11 @@
<Grid>
<StackPanel HorizontalAlignment="Stretch">
<Button x:Name="button" Margin="4" HorizontalAlignment="Stretch"
Style="{StaticResource MultiStageButtonStyle1}" >Simulation</Button>
Style="{StaticResource MultiStageButtonStyle1}"
Command="{Binding SimulationCommand}">Simulation</Button>
<Button Margin="4" HorizontalAlignment="Stretch"
Style="{StaticResource MultiStageButtonStyle1}"
Command="{Binding CancelSimulation}">Stop</Button>
<Button x:Name="button1" Margin="4" HorizontalAlignment="Stretch"
Style="{StaticResource MultiStageButtonStyle1}"
Command="{Binding moveJobUp}"
......@@ -38,7 +42,7 @@
BorderBrush ="{StaticResource AccentColorButton}" BorderThickness="1"
Name="JobDataGrid"
HorizontalAlignment="Stretch"
IsReadOnly="True"
CanUserReorderColumns="False"
AutoGenerateColumns="False"
SelectionMode="Single"
......@@ -56,8 +60,10 @@
AlternatingRowBackground="LightGray" CellStyle="{DynamicResource DataGridCellStyle1}"
>
<DataGrid.Columns>
<DataGridTextColumn Header="Name" Binding="{Binding DocumentName}" Width="1*"></DataGridTextColumn>
<DataGridTextColumn Header="Type" Binding="{Binding DocumentType}" Width="1*"></DataGridTextColumn>
<DataGridCheckBoxColumn IsReadOnly="False" Header="Simulate" Binding="{Binding Selected}" Width="1*"></DataGridCheckBoxColumn>
<DataGridTextColumn IsReadOnly="True" Header="Name" Binding="{Binding DocumentName}" Width="4*"></DataGridTextColumn>
<DataGridTextColumn IsReadOnly ="True" Header="Type" Binding="{Binding DocumentType}" Width="4*"></DataGridTextColumn>
</DataGrid.Columns>
<DataGrid.RowDetailsTemplate>
<DataTemplate>
......
......@@ -96,13 +96,13 @@
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<!--ItemsSource="{Binding ListItems, ElementName=MultistageParameterControl}"-->
<!--SelectedIndex="{Binding EditingEnabled, ElementName=MultistageParameterControl, Converter={StaticResource BoolToIntConverter}}"-->
<!--ItemsSource="{Binding ListItems, ElementName=MultistageParameterControl}"-->
<ComboBox x:Name="comboBoxCurrent" Grid.Column="3" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="2 0 2 0"
SelectedIndex="{Binding EditingEnabled, ElementName=MultistageParameterControl, Converter={StaticResource BoolToIntConverter}}"
SelectedItem="{Binding Content, Mode=TwoWay, ElementName=MultistageParameterControl, ValidatesOnExceptions=True, UpdateSourceTrigger=PropertyChanged}"
IsEnabled="{Binding EditingEnabled, ElementName=MultistageParameterControl}"
IsEditable="False" MouseDoubleClick="Control_OnMouseDoubleClick">
SelectedItem="{Binding Content, Mode=TwoWay, ElementName=MultistageParameterControl, ValidatesOnExceptions=True, UpdateSourceTrigger=PropertyChanged}"
IsEnabled="{Binding EditingEnabled, ElementName=MultistageParameterControl}"
IsEditable="False" MouseDoubleClick="Control_OnMouseDoubleClick">
<ComboBox.ItemsSource>
<PriorityBinding>
<Binding Path="ListItems" ElementName="MultistageParameterControl" Converter="{StaticResource NullToUnsetValue}" UpdateSourceTrigger="PropertyChanged"/>
......@@ -146,15 +146,20 @@
Converter={StaticResource BooleanToVisibilityConverter}}"
IsChecked="{Binding EditingEnabled,
ElementName=MultistageParameterControl,
Mode=TwoWay}"/>
Mode=TwoWay}"
/>
<CheckBox x:Name="checkBox" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center" IsTabStop="False" IsChecked="{Binding ElementName=MultistageParameterControl,
Path=PreviousContent,
Converter={StaticResource XToBoolConverter}}" IsEnabled="False">
Converter={StaticResource XToBoolConverter}}" IsEnabled="False"
>
</CheckBox>
<CheckBox x:Name="checkBox1" Grid.Column="3" VerticalAlignment="Center" HorizontalAlignment="Center" IsEnabled="{Binding ElementName=MultistageParameterControl,
Path=EditingEnabled, UpdateSourceTrigger=PropertyChanged}">
<CheckBox x:Name="checkBox1" Grid.Column="3" VerticalAlignment="Center" HorizontalAlignment="Center"
IsEnabled="{Binding ElementName=MultistageParameterControl,
Path=EditingEnabled, UpdateSourceTrigger=PropertyChanged}"
IsChecked="{Binding Content, ElementName=MultistageParameterControl, Mode=TwoWay, ValidatesOnExceptions=True, Converter={StaticResource XToBoolConverter},
UpdateSourceTrigger=PropertyChanged}">
</CheckBox>
<Label x:Name="label4" Grid.Column="4"
......
......@@ -10,6 +10,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms.VisualStyles;
......@@ -23,6 +24,7 @@ using Microsoft.Build.Framework;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Utils;
using VECTO3GUI2020.Annotations;
using VECTO3GUI2020.Helper.Converter;
using VECTO3GUI2020.Properties;
using VECTO3GUI2020.Views.CustomControls;
......@@ -80,9 +82,30 @@ namespace VECTO3GUI2020.Views.Multistage.CustomControls
}
public static readonly DependencyProperty ModeProperty = DependencyProperty.Register(
"Mode", typeof(MultistageParameterViewMode), typeof(MultiStageParameter), new PropertyMetadata(MultistageParameterViewMode.TEXTBOX));
"Mode", typeof(MultistageParameterViewMode), typeof(MultiStageParameter),
new PropertyMetadata(MultistageParameterViewMode.TEXTBOX, propertyChangedCallback:ModeChanged));
public MultistageParameterViewMode Mode
private static void ModeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var param = (MultiStageParameter)d;
if(param.GetBindingExpression(e.Property)?.Status != BindingStatus.Active)
{
return;
}
param.OnModeChanged((MultistageParameterViewMode)e.NewValue);
}
public void OnModeChanged(MultistageParameterViewMode mode)
{
if (mode != MultistageParameterViewMode.CHECKBOX) {
checkBox1.SetValue(CheckBox.IsCheckedProperty, DependencyProperty.UnsetValue);
}
}
public MultistageParameterViewMode Mode
{
get { return (MultistageParameterViewMode)GetValue(ModeProperty); }
set { SetValue(ModeProperty, value); }
......@@ -147,7 +170,8 @@ namespace VECTO3GUI2020.Views.Multistage.CustomControls
}
set
{
SetValue(EditingEnabledProperty, value);
SetCurrentValue(EditingEnabledProperty, value);
OnPropertyChanged(nameof(EditingEnabled));
}
}
......@@ -195,8 +219,48 @@ namespace VECTO3GUI2020.Views.Multistage.CustomControls
private static object ContentCoerced(DependencyObject d, object basevalue)
{
((MultiStageParameter)d).ContentChanged();
var multiStageParameter = ((MultiStageParameter)d);
var binding = multiStageParameter.GetBindingExpression(ContentProperty);
if (binding?.Status != BindingStatus.Active)
{
return basevalue;
}
if (multiStageParameter.resolvedContentProperty == true)
{
return basevalue;
}
if (multiStageParameter.DummyContent == null)
{
multiStageParameter.DummyContent = multiStageParameter.CreateDummyContent();
}
if (multiStageParameter.Content != null && multiStageParameter.EditingEnabled == false)
{
multiStageParameter.EditingEnabled = true;
}
if (multiStageParameter.Mode == MultistageParameterViewMode.COMBOBOX)
{
multiStageParameter.GenerateListItemsAndSetComboboxValue();
}
if (multiStageParameter.GeneratedLabelText == null)
{
multiStageParameter.SetLabelText();
}
multiStageParameter.resolvedContentProperty = true;
......@@ -267,30 +331,16 @@ namespace VECTO3GUI2020.Views.Multistage.CustomControls
{
var multiStageParameter = (CustomControls.MultiStageParameter)this;
var binding = multiStageParameter.GetBindingExpression(ContentProperty);
if (binding?.Status != BindingStatus.Active || resolvedContentProperty) {
return;
}
if (multiStageParameter.DummyContent == null) {
multiStageParameter.DummyContent = multiStageParameter.CreateDummyContent();
if (binding?.Status != BindingStatus.Active) {
return;
}
if (multiStageParameter.Content != null) {
if (multiStageParameter.Content != null && multiStageParameter.EditingEnabled == false)
{
multiStageParameter.EditingEnabled = true;
}
if (multiStageParameter.Mode == MultistageParameterViewMode.COMBOBOX) {
multiStageParameter.GenerateListItemsAndSetComboboxValue();
}
if (multiStageParameter.GeneratedLabelText == null) {
multiStageParameter.SetLabelText();
}
resolvedContentProperty = true;
EditingEnabledChanged(EditingEnabled);
}
......@@ -402,6 +452,7 @@ namespace VECTO3GUI2020.Views.Multistage.CustomControls
if (multistageParameter.Content != null) {
multistageParameter.Content = null;
}
}
else
{
......@@ -416,8 +467,8 @@ namespace VECTO3GUI2020.Views.Multistage.CustomControls
if (multistageParameter.Mode == MultistageParameterViewMode.COMBOBOX)
{
//Set default value;
multistageParameter.GetBindingExpression(ListItemsProperty)?.UpdateTarget();
multistageParameter.GetBindingExpression(ContentProperty)?.UpdateTarget();
//multistageParameter.GetBindingExpression(ListItemsProperty)?.UpdateTarget();
//multistageParameter.GetBindingExpression(ContentProperty)?.UpdateTarget();
/*
......
......@@ -6,61 +6,70 @@
xmlns:local="clr-namespace:VECTO3GUI2020.Views.Multistage"
xmlns:customControls="clr-namespace:VECTO3GUI2020.Views.Multistage.CustomControls"
xmlns:impl="clr-namespace:VECTO3GUI2020.ViewModel.MultiStage.Implementation"
xmlns:properties="clr-namespace:VECTO3GUI2020.Properties"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800" BorderBrush="{DynamicResource ButtonHighlightColor}" BorderThickness="2" Margin="4"
d:DataContext="{d:DesignInstance impl:MultistageAuxiliariesViewModel}">
<UserControl.Resources>
<Style TargetType="customControls:MultiStageParameter">
<Setter Property="NameLookUpResourceManager" Value="{x:Static properties:BusStrings.ResourceManager}"/>
<Setter Property="Validation.ErrorTemplate" Value="{StaticResource multistageParameterControlErrorTemplate}"/>
</Style>
</UserControl.Resources>
<Grid>
<ScrollViewer>
<DockPanel>
<StackPanel DockPanel.Dock="Top">
<Label Background="{DynamicResource ButtonHighlightColor}" FontSize="15" HorizontalAlignment="Stretch">AUXILIARIES</Label>
<Label Style="{DynamicResource LabelStyle1}" FontSize="15" HorizontalAlignment="Stretch">AUXILIARIES</Label>
<Label Style="{DynamicResource LabelStyle1}">LED Lights</Label>
<customControls:MultiStageParameter Mode="CHECKBOX"
PreviousContent="{Binding ConsolidatedInputData.ElectricConsumers.InteriorLightsLED}"
Content="{Binding InteriorLightsLED}"
Content="{Binding InteriorLightsLED, ValidatesOnDataErrors=True}"
EditingEnabled="{Binding EditingEnabledDictionary[InteriorLightsLED]}"/>
<customControls:MultiStageParameter Mode="CHECKBOX"
PreviousContent="{Binding ConsolidatedInputData.ElectricConsumers.DayrunninglightsLED}"
Content="{Binding DayrunninglightsLED}"
Content="{Binding DayrunninglightsLED,ValidatesOnDataErrors=True}"
EditingEnabled="{Binding EditingEnabledDictionary[DayrunninglightsLED]}"/>
<customControls:MultiStageParameter Mode="CHECKBOX"
PreviousContent="{Binding ConsolidatedInputData.ElectricConsumers.PositionlightsLED}"
Content="{Binding PositionlightsLED}"
EditingEnabled="{Binding EditingEnabledDictionary[PositionLightsLED]}"/>
Content="{Binding PositionlightsLED,ValidatesOnDataErrors=True}"
EditingEnabled="{Binding EditingEnabledDictionary[PositionlightsLED]}"/>
<customControls:MultiStageParameter Mode="CHECKBOX"
PreviousContent="{Binding ConsolidatedInputData.ElectricConsumers.BrakelightsLED}"
Content="{Binding BrakelightsLED}"
EditingEnabled="{Binding EditingEnabledDictionary[PositionLightsLED]}"/>
Content="{Binding BrakelightsLED,ValidatesOnDataErrors=True}"
EditingEnabled="{Binding EditingEnabledDictionary[BrakelightsLED]}"/>
<customControls:MultiStageParameter Mode="CHECKBOX"
PreviousContent="{Binding ConsolidatedInputData.ElectricConsumers.HeadlightsLED}"
Content="{Binding HeadlightsLED}"
EditingEnabled="{Binding EditingEnabledDictionary[HeadLightsLED]}"/>
Content="{Binding HeadlightsLED,ValidatesOnDataErrors=True}"
EditingEnabled="{Binding EditingEnabledDictionary[HeadlightsLED]}"/>
<Separator/>
<!--<Separator/>-->
<Label Style="{DynamicResource LabelStyle1}">Heating, Ventilation and Air Conditioning</Label>
<customControls:MultiStageParameter Mode="COMBOBOX"
EditingEnabled="{Binding HeatPumpGroupEditingEnabled, Mode=TwoWay}"
PreviousContent="{Binding ConsolidatedInputData.HVACAux.SystemConfiguration}"
Content="{Binding HVACAux.SystemConfiguration}"/>
Content="{Binding SystemConfiguration, ValidatesOnDataErrors=True}"/>
<customControls:MultiStageParameter Mode="COMBOBOX"
EditingEnabled="{Binding HeatPumpGroupEditingEnabled, Mode=TwoWay}"
PreviousContent="{Binding ConsolidatedInputData.HVACAux.HeatPumpTypeDriverCompartment}"
Content="{Binding HeatPumpTypeDriverCompartment}"
Content="{Binding HeatPumpTypeDriverCompartment, ValidatesOnDataErrors=True}"
ShowCheckBox="False"/>
<customControls:MultiStageParameter Mode="COMBOBOX"
EditingEnabled="{Binding HeatPumpGroupEditingEnabled, Mode=TwoWay}"
PreviousContent="{Binding ConsolidatedInputData.HVACAux.HeatPumpModeDriverCompartment}"
Content="{Binding HeatPumpModeDriverCompartment}"
Content="{Binding HeatPumpModeDriverCompartment, ValidatesOnDataErrors=True}"
ListItems="{Binding HeatPumpModeDriverCompartmentAllowedValues}"
ShowCheckBox="False"/>
<customControls:MultiStageParameter Mode="COMBOBOX"
EditingEnabled="{Binding HeatPumpGroupEditingEnabled, Mode=TwoWay}"
PreviousContent="{Binding ConsolidatedInputData.HVACAux.HeatPumpTypePassengerCompartment}"
Content="{Binding HeatPumpTypePassengerCompartment}"
Content="{Binding HeatPumpTypePassengerCompartment,ValidatesOnDataErrors=True}"
ShowCheckBox="False"/>
<customControls:MultiStageParameter Mode="COMBOBOX"
EditingEnabled="{Binding HeatPumpGroupEditingEnabled, Mode=TwoWay}"
PreviousContent="{Binding ConsolidatedInputData.HVACAux.HeatPumpModePassengerCompartment}"
Content="{Binding HeatPumpModePassengerCompartment}"
Content="{Binding HeatPumpModePassengerCompartment,ValidatesOnDataErrors=True}"
ListItems="{Binding HeatPumpModePassengerCompartmentAllowedValues}"
ShowCheckBox="False"/>
<Separator/>
......@@ -71,36 +80,36 @@
<customControls:MultiStageParameter Mode="TEXTBOX"
Validation.ErrorTemplate="{DynamicResource multistageParameterControlErrorTemplate}"
PreviousContent="{Binding ConsolidatedInputData.HVACAux.AuxHeaterPower}"
Content="{Binding AuxHeaterPower}"
Content="{Binding AuxHeaterPower,ValidatesOnDataErrors=True}"
EditingEnabled="{Binding EditingEnabledDictionary[AuxHeaterPower]}"/>
<customControls:MultiStageParameter Mode="CHECKBOX"
PreviousContent="{Binding ConsolidatedInputData.HVACAux.DoubleGlazing}"
Content="{Binding DoubleGlazing}"
Content="{Binding DoubleGlazing,ValidatesOnDataErrors=True}"
EditingEnabled="{Binding EditingEnabledDictionary[DoubleGlazing]}"/>
<customControls:MultiStageParameter Mode="CHECKBOX"
PreviousContent="{Binding ConsolidatedInputData.HVACAux.AdjustableAuxiliaryHeater}"
EditingEnabled="{Binding EditingEnabledDictionary[AdjustableAuxiliaryHeater]}"
Content="{Binding AdjustableAuxiliaryHeater}"/>
Content="{Binding AdjustableAuxiliaryHeater,ValidatesOnDataErrors=True}"/>
<customControls:MultiStageParameter Mode="CHECKBOX"
PreviousContent="{Binding ConsolidatedInputData.HVACAux.SeparateAirDistributionDucts}"
EditingEnabled="{Binding EditingEnabledDictionary[SeparateAirDistributionDucts]}"
Content="{Binding SeparateAirDistributionDucts}"/>
Content="{Binding SeparateAirDistributionDucts,ValidatesOnDataErrors=True}"/>
<StackPanel Visibility="{Binding PrimaryVehicleHybridElectric, Converter={StaticResource BooleanToVisibilityConverter}}">
<customControls:MultiStageParameter Mode="CHECKBOX"
PreviousContent="{Binding ConsolidatedInputData.HVACAux.WaterElectricHeater}"
Content="{Binding WaterElectricHeater}"
Content="{Binding WaterElectricHeater,ValidatesOnDataErrors=True}"
EditingEnabled="{Binding EditingEnabledDictionary[WaterElectricHeater]}"/>
<customControls:MultiStageParameter Mode="CHECKBOX"
PreviousContent="{Binding ConsolidatedInputData.HVACAux.AirElectricHeater}"
EditingEnabled="{Binding AirElectricHeater}"
Content="{Binding AirElectricHeater}"/>
Content="{Binding AirElectricHeater,ValidatesOnDataErrors=True}"/>
<customControls:MultiStageParameter Mode="CHECKBOX"
PreviousContent="{Binding ConsolidatedInputData.HVACAux.OtherHeatingTechnology}"
EditingEnabled="{Binding OtherHeatingTechnology}"
Content="{Binding OtherHeatingTechnology}"/>
Content="{Binding OtherHeatingTechnology,ValidatesOnDataErrors=True}"/>
</StackPanel>
<Separator/>
</StackPanel>
......
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