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

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

Added Consolidated Heatpumpconfigurations

parent a9a05851
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,11 @@ namespace VECTO3GUI2020.Helper.Converter
/// <returns></returns>
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
bool invert = parameter as string == "invert";
var invert = false;
if (parameter != null) {
invert = string.Equals("invert", (string) parameter, StringComparison.InvariantCultureIgnoreCase);
}
if (value == null)
{
if (invert) {
......
......@@ -162,13 +162,12 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
.BusAuxiliaries);
_airdragModifiedEditingEnabled = false;
_editingEnabledDictionary = new IndexedStorage<bool>((identifier) => {
OnPropertyChanged(identifier);
OnPropertyChanged(nameof(EditingEnabledDictionary));
});
CreateParameterViewModels();
}
private void CreateParameterViewModels()
{
_parameterViewModels = new Dictionary<string, MultistageParameterViewModel>();
var properties = this.GetType().GetProperties();
var backedUpParameters = new HashSet<string>() {
......@@ -200,7 +199,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
nameof(ATEcoRollReleaseLockupClutch),
};
foreach(var property in properties) {
foreach (var property in properties) {
if (!backedUpParameters.Contains(property.Name)) {
continue;
}
......@@ -210,13 +209,13 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
try {
previousInputData = ConsolidatedVehicleData?.GetType().GetProperty(property.Name)?
.GetValue(ConsolidatedVehicleData);
} catch (Exception e) {
Debug.WriteLine(e.Message);
}
_parameterViewModels.Add(property.Name, new MultistageParameterViewModel(property.Name, previousInputData, this, resourceManagers:new ResourceManager[]{BusStrings.ResourceManager, Strings.ResourceManager}
));
_parameterViewModels.Add(property.Name, new MultistageParameterViewModel(property.Name, previousInputData, this,
resourceManagers: new ResourceManager[] { BusStrings.ResourceManager, Strings.ResourceManager }
));
}
_parameterViewModels[nameof(WidthInMm)].PreviousContent = ConsolidatedWidthInMm;
......@@ -271,10 +270,12 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
_parameterViewModels[nameof(VehicleCode)].AllowedItems =
EnumHelper.GetValuesAsObservableCollectionExcluding<Enum, VehicleCode>((TUGraz.VectoCommon.Models.VehicleCode.NOT_APPLICABLE));
EnumHelper.GetValuesAsObservableCollectionExcluding<Enum, VehicleCode>((TUGraz.VectoCommon.Models.VehicleCode
.NOT_APPLICABLE));
_parameterViewModels[nameof(LegislativeClass)].AllowedItems =
EnumHelper.GetValuesAsObservableCollectionExcluding<Enum, LegislativeClass>((TUGraz.VectoCommon.Models.LegislativeClass.Unknown));
EnumHelper.GetValuesAsObservableCollectionExcluding<Enum, LegislativeClass>((TUGraz.VectoCommon.Models
.LegislativeClass.Unknown));
_parameterViewModels[nameof(RegisteredClass)].AllowedItems =
EnumHelper.GetValuesAsObservableCollectionExcluding<Enum, RegistrationClass>(RegistrationClass.unknown);
......@@ -294,8 +295,6 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
_parameterViewModels[nameof(Manufacturer)].Mandatory = true;
_parameterViewModels[nameof(ManufacturerAddress)].Mandatory = true;
_parameterViewModels[nameof(VIN)].Mandatory = true;
}
#region Overrides of ViewModelBase
......
......@@ -39,15 +39,28 @@
<ContentControl Content="{Binding ParameterViewModels[HeatPumpTypeDriverCompartment]}"/>
<ContentControl Content="{Binding ParameterViewModels[HeatPumpModeDriverCompartment]}"/>
<Label Padding="10 4 0 4" Style="{DynamicResource LabelStyle1}">Consolidated Data</Label>
<ListView>
<ListView.ItemsSource>
<Binding Path="ConsolidatedInputData.HVACAux.HeatPumpPassengerCompartments" FallbackValue="null"/>
</ListView.ItemsSource>
<ListView.Visibility>
<Binding Path="ConsolidatedInputData.HVACAux.HeatPumpPassengerCompartments" FallbackValue="Collapsed" Converter="{StaticResource NullToVisibilityConverter}"/>
</ListView.Visibility>
</ListView>
<Separator></Separator>
<ItemsControl
Visibility="{Binding ConsolidatedHeatPumpConfigurationsPassenger, Converter={StaticResource NullToVisibilityConverter}}"
ItemsSource="{Binding ConsolidatedHeatPumpConfigurationsPassenger}"
HorizontalContentAlignment="Stretch"
Padding="5 5 29 5 " >
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border BorderThickness="1">
<DockPanel LastChildFill="true">
<UniformGrid DockPanel.Dock="Left" Columns="2">
<ContentControl Grid.Column="0" DockPanel.Dock="Top" Content="{Binding Path=HeatPumpTypeVM}"/>
<ContentControl Grid.Column="1" DockPanel.Dock="Top" Content="{Binding Path=HeatPumpModeVM}"/>
</UniformGrid>
</DockPanel>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<Label Visibility="{Binding ConsolidatedHeatPumpConfigurationsPassenger,
Converter={StaticResource NullToVisibilityConverter},
ConverterParameter=invert}"
HorizontalAlignment="Center"> No consolidated data available </Label>
<DockPanel LastChildFill="true">
<Button DockPanel.Dock="right" ContentTemplate="{DynamicResource AddIcon}" Command="{Binding AddPassengerHeatpumpCommand}">
......@@ -55,14 +68,15 @@
<Label Style="{DynamicResource LabelStyle1}" Padding="10 4 0 4">Current Stage</Label>
</DockPanel>
<ListView ItemsSource="{Binding PassengerHeatPumps}" HorizontalContentAlignment="Stretch">
<ListView.ItemTemplate>
<ItemsControl ItemsSource="{Binding HeatPumpConfigurationsPassenger}" HorizontalContentAlignment="Stretch"
Padding="5">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border BorderThickness="1">
<DockPanel LastChildFill="true">
<Button DockPanel.Dock="Right"
<Button DockPanel.Dock="Right" Height="24"
ContentTemplate="{DynamicResource TrashIcon}"
Command="{Binding RelativeSource={RelativeSource AncestorType=ListView},
Command="{Binding RelativeSource={RelativeSource AncestorType=ItemsControl},
Path=DataContext.RemovePassengerHeatpumpCommand}"
CommandParameter="{Binding }"/>
<UniformGrid DockPanel.Dock="Left" Columns="2">
......@@ -72,11 +86,9 @@
</DockPanel>
</Border>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ItemsControl.ItemTemplate>
</ItemsControl>
<Separator/>
<ContentControl Content="{Binding ParameterViewModels[AuxHeaterPower]}"/>
<ContentControl Content="{Binding ParameterViewModels[DoubleGlazing]}"/>
......
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