Kandis exporter geschrieben

Deckel und Sohlhöhe werden gespeichert
This commit is contained in:
2023-04-19 20:52:02 +02:00
parent 1555e54e82
commit 0877d2b308
16 changed files with 400 additions and 112 deletions

View File

@@ -77,10 +77,10 @@ namespace SewerStammGen.WPF.ViewModel
private void RecalculateLength()
{
double x1 = (double)Model.StartSchacht.RechtsWert;
double x2 = (double)Model.EndSchacht.RechtsWert;
double y1 = (double)Model.StartSchacht.HochWert;
double y2 = (double)Model.EndSchacht.HochWert;
double x1 = (double)Model.StartSchacht.DeckelRechtsWert;
double x2 = (double)Model.EndSchacht.DeckelRechtsWert;
double y1 = (double)Model.StartSchacht.DeckelHochWert;
double y2 = (double)Model.EndSchacht.DeckelHochWert;
double length = Math.Sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));

View File

@@ -36,25 +36,25 @@ namespace SewerStammGen.WPF.ViewModel
}
}
}
public decimal RechtsWert
public decimal DeckelRechtsWert
{
get => _model.RechtsWert;
get => _model.DeckelRechtsWert;
set
{
if(_model.RechtsWert != value)
if(_model.DeckelRechtsWert != value)
{
_model.RechtsWert = value;
_model.DeckelRechtsWert = value;
OnPropertyChanged();
}
}
}
public decimal HochWert
public decimal DeckelHochWert
{
get => _model.HochWert; set
get => _model.DeckelHochWert; set
{
if (_model.HochWert != value)
if (_model.DeckelHochWert != value)
{
_model.HochWert = value;
_model.DeckelHochWert = value;
OnPropertyChanged();
}
}
@@ -71,6 +71,31 @@ namespace SewerStammGen.WPF.ViewModel
}
}
}
public decimal SohlHochWert
{
get => _model.SohlHochWert;
set
{
if(_model.SohlHochWert != value)
{
_model.SohlHochWert = value;
OnPropertyChanged();
}
}
}
public decimal SohlRechtsWert
{
get => _model.SohlRechtsWert;
set
{
if(_model.SohlRechtsWert != value)
{
_model.SohlRechtsWert = value;
OnPropertyChanged();
}
}
}
public decimal SohlHoehe
{
get => _model.SohlHoehe;

View File

@@ -0,0 +1,24 @@
using SewerStammGen.Shared.Domain;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
namespace SewerStammGen.WPF.Views.Converters
{
public class EqualValueToEntwaesserungConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return value.ToString() == parameter.ToString();
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return (EEntwaeserung)parameter;
}
}
}

View File

@@ -3,9 +3,14 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:converter="clr-namespace:SewerStammGen.WPF.Views.Converters"
xmlns:stat="clr-namespace:SewerStammGen.Shared.Domain;assembly=SewerStammGen.Shared"
xmlns:local="clr-namespace:SewerStammGen.WPF.Views"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<converter:EqualValueToEntwaesserungConverter x:Key="EqualValueToEntwaesserungConverter" />
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" />
@@ -18,29 +23,37 @@
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Label Grid.Column="0" Grid.Row="0" Content="Bezeichnung" />
<Label Grid.Column="0" Grid.Row="1" Content="Rechtswert" />
<Label Grid.Column="0" Grid.Row="2" Content="Hochwert" />
<Label Grid.Column="0" Grid.Row="3" Content="Sohlhöhe" />
<Label Grid.Column="0" Grid.Row="4" Content="Deckelhöhe" />
<Label Grid.Column="0" Grid.Row="5" Content="Entwässerungsart" />
<Label Grid.Column="0" Grid.Row="1" Content="Deckel Rechtswert" />
<Label Grid.Column="0" Grid.Row="2" Content="Deckel Hochwert" />
<Label Grid.Column="0" Grid.Row="3" Content="Deckel Höhe" />
<Label Grid.Column="0" Grid.Row="4" Content="Sohl Rechtswert" />
<Label Grid.Column="0" Grid.Row="5" Content="Sohl Hochwert" />
<Label Grid.Column="0" Grid.Row="6" Content="Sohl Höhe" />
<!--<Label Grid.Column="0" Grid.Row="7" Content="Deckelhöhe" />-->
<Label Grid.Column="0" Grid.Row="7" Content="Entwässerungsart" />
<TextBox Margin="2" Grid.Column="1" Grid.Row="0" Text="{Binding Objektbezeichnung}" />
<TextBox Margin="2" Grid.Column="1" Grid.Row="1" Text="{Binding RechtsWert}" />
<TextBox Margin="2" Grid.Column="1" Grid.Row="2" Text="{Binding HochWert}" />
<TextBox Margin="2" Grid.Column="1" Grid.Row="3" Text="{Binding SohlHoehe}" />
<TextBox Margin="2" Grid.Column="1" Grid.Row="4" Text="{Binding DeckelHoehe}" />
<DockPanel Grid.Column="1" Grid.Row="5">
<RadioButton Style="{StaticResource ToggleButtonList}" Content="Regenwasser" />
<RadioButton Style="{StaticResource ToggleButtonList}" Content="Schmutzwasser" />
<RadioButton Style="{StaticResource ToggleButtonList}" Content="Mischwasser" />
<TextBox Margin="2" Grid.Column="1" Grid.Row="1" Text="{Binding DeckelRechtsWert}" />
<TextBox Margin="2" Grid.Column="1" Grid.Row="2" Text="{Binding DeckelHochWert}" />
<TextBox Margin="2" Grid.Column="1" Grid.Row="3" Text="{Binding DeckelHoehe}" />
<TextBox Margin="2" Grid.Column="1" Grid.Row="4" Text="{Binding SohlRechtsWert}" />
<TextBox Margin="2" Grid.Column="1" Grid.Row="5" Text="{Binding SohlHochWert}" />
<TextBox Margin="2" Grid.Column="1" Grid.Row="6" Text="{Binding SohlHoehe}" />
<DockPanel Grid.Column="1" Grid.Row="7">
<RadioButton Style="{StaticResource ToggleButtonList}" Content="Regenwasser" IsChecked="{Binding Entwaeserung, Converter={StaticResource EqualValueToEntwaesserungConverter},ConverterParameter={x:Static stat:EEntwaeserung.Regenwasser}}" />
<RadioButton Style="{StaticResource ToggleButtonList}" Content="Schmutzwasser" IsChecked="{Binding Entwaeserung, Converter={StaticResource EqualValueToEntwaesserungConverter},ConverterParameter={x:Static stat:EEntwaeserung.Schmutzwasser}}" />
<RadioButton Style="{StaticResource ToggleButtonList}" Content="Mischwasser" IsChecked="{Binding Entwaeserung, Converter={StaticResource EqualValueToEntwaesserungConverter},ConverterParameter={x:Static stat:EEntwaeserung.Mischwasser}}" />
</DockPanel>
<StackPanel Grid.ColumnSpan="2" Grid.Row="6">
<StackPanel Grid.ColumnSpan="2" Grid.Row="8">
<Button Content="Speichern" Command="{Binding Speichern}" />
</StackPanel>

View File

@@ -15,10 +15,10 @@
<DataGrid Grid.Row="0" ItemsSource="{Binding Schaechte}" AutoGenerateColumns="False" IsReadOnly="True" SelectionMode="Single" SelectedItem="{Binding SelectedSchacht}">
<DataGrid.Columns>
<DataGridTextColumn Header="Schachtnummer" Binding="{Binding Objektbezeichnung}" />
<DataGridTextColumn Header="Rechtswert" Binding="{Binding RechtsWert}" />
<DataGridTextColumn Header="Hochwert" Binding="{Binding HochWert}" />
<DataGridTextColumn Header="Sohlhöhe" Binding="{Binding SohlHoehe}" />
<DataGridTextColumn Header="Deckelhöhe" Binding="{Binding DeckelHoehe}" />
<!--<DataGridTextColumn Header="Rechtswert" Binding="{Binding RechtsWert}" />-->
<!--<DataGridTextColumn Header="Hochwert" Binding="{Binding HochWert}" />-->
<!--<DataGridTextColumn Header="Sohlhöhe" Binding="{Binding SohlHoehe}" />-->
<!--<DataGridTextColumn Header="Deckelhöhe" Binding="{Binding DeckelHoehe}" />-->
<DataGridTextColumn Header="Entwässerung" Binding="{Binding Entwaesserung}" />
</DataGrid.Columns>
</DataGrid>