297 lines
14 KiB
XML
297 lines
14 KiB
XML
<Page x:Class="Common.UI.Pages.SetMetrologyParameters"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:VM="clr-namespace:Common.UI.ViewModels"
|
|
DataContext="{Binding SetMetrologyParametersVM, Source={StaticResource VMLocator}}"
|
|
FontFamily="Consolas"
|
|
FontSize="12">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="10*" />
|
|
<ColumnDefinition Width="2*" />
|
|
</Grid.ColumnDefinitions>
|
|
<ScrollViewer Background="Transparent"
|
|
BorderThickness="0"
|
|
Grid.Column="0"
|
|
Margin="0"
|
|
HorizontalScrollBarVisibility="Hidden"
|
|
VerticalScrollBarVisibility="Auto">
|
|
<Border BorderBrush="LightGray"
|
|
BorderThickness="1 1 0 0">
|
|
<ItemsControl ItemsSource="{Binding Properties}">
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate DataType="{x:Type VM:PropertyVM}">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="1*" />
|
|
<ColumnDefinition Width="3*" />
|
|
<ColumnDefinition Width="8*" />
|
|
</Grid.ColumnDefinitions>
|
|
<Label Background="WhiteSmoke"
|
|
BorderBrush="LightGray"
|
|
BorderThickness="0 0 1 1"
|
|
Content="{Binding Source}"
|
|
FontWeight="Bold"
|
|
Grid.Column="0" />
|
|
<Label Background="WhiteSmoke"
|
|
BorderBrush="LightGray"
|
|
BorderThickness="0 0 1 1"
|
|
Content="{Binding Name}"
|
|
FontWeight="Bold"
|
|
Grid.Column="1" />
|
|
<Label Background="{Binding Source, Converter={StaticResource TaskStateToBG}}"
|
|
BorderBrush="LightGray"
|
|
BorderThickness="0 0 1 1"
|
|
Content="{Binding Value}"
|
|
Foreground="{Binding Source, Converter={StaticResource TaskStateToFG}}"
|
|
Grid.Column="2" />
|
|
</Grid>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</Border>
|
|
</ScrollViewer>
|
|
<StackPanel Background="{Binding Status, Converter={StaticResource TaskStateToBG}}"
|
|
Grid.Column="1"
|
|
Orientation="Vertical">
|
|
<TextBlock FontWeight="Bold"
|
|
Text="Activate SIRT"
|
|
Padding="5 3 5 0"/>
|
|
<Grid Margin="3 3 3 0">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="3" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
<Button Command="{Binding ActivateSIRTCommand}"
|
|
CommandParameter="{Binding SIRT_433}"
|
|
Content="433MHz"
|
|
Cursor="Hand"
|
|
Grid.Column="0"
|
|
Padding="5" />
|
|
<Button Command="{Binding ActivateSIRTCommand}"
|
|
CommandParameter="{Binding SIRT_868}"
|
|
Content="868MHz"
|
|
Cursor="Hand"
|
|
Grid.Column="2"
|
|
Padding="5" />
|
|
</Grid>
|
|
<TextBlock Foreground="Gray"
|
|
FontStyle="Italic"
|
|
Text="{Binding SIRTInfo}"
|
|
Padding="5 3 5 0" />
|
|
<TextBlock FontWeight="Bold"
|
|
Text="Address"
|
|
Padding="5 3 5 0" />
|
|
<TextBox Margin="3 3 3 0"
|
|
Padding="5"
|
|
Text="{Binding Address}" />
|
|
<TextBlock FontWeight="Bold"
|
|
Text="Meter size"
|
|
Padding="5 3 5 0" />
|
|
<ComboBox ItemsSource="{Binding MeterSizes}"
|
|
Margin="3 3 3 0"
|
|
Padding="5 7"
|
|
SelectedValue="{Binding MeterSize}" />
|
|
<TextBlock FontWeight="Bold"
|
|
Text="Volume per pulse"
|
|
Padding="5 3 5 0" />
|
|
<TextBox Margin="3 3 3 0"
|
|
Padding="5"
|
|
Text="{Binding VPP}" />
|
|
<TextBlock FontWeight="Bold"
|
|
Text="Offset factor"
|
|
Padding="5 3 5 0" />
|
|
<TextBox Margin="3 3 3 0"
|
|
Padding="5"
|
|
Text="{Binding OffsetFactor}" />
|
|
<TextBlock FontWeight="Bold"
|
|
Text="Offset time"
|
|
Padding="5 3 5 0" />
|
|
<TextBox Margin="3 3 3 0"
|
|
Padding="5"
|
|
Text="{Binding OffsetTime}" />
|
|
<TextBlock FontWeight="Bold"
|
|
Text="Factory calibration"
|
|
Padding="5 3 5 0" />
|
|
<TextBox Margin="3 3 3 0"
|
|
Padding="5"
|
|
Text="{Binding FactoryCalibration}" />
|
|
<TextBlock FontWeight="Bold"
|
|
Text="Units"
|
|
Padding="5 3 5 0" />
|
|
<ComboBox ItemsSource="{Binding MessurementUnitsSource}"
|
|
Margin="3 3 3 0"
|
|
Padding="5 7"
|
|
SelectedValue="{Binding Units}" />
|
|
<TextBlock FontWeight="Bold"
|
|
Text="Decimal places"
|
|
Padding="5 3 5 0" />
|
|
<ComboBox ItemsSource="{Binding DecimalPlacesSource}"
|
|
Margin="3 3 3 0"
|
|
Padding="5 7"
|
|
SelectedValue="{Binding DecimalPlaces}" />
|
|
<CheckBox Content="Use C&I rules"
|
|
IsChecked="{Binding UseCandIRules}"
|
|
Margin="3 5 3 0"
|
|
Padding="5"
|
|
VerticalContentAlignment="Center"/>
|
|
<TextBlock FontWeight="Bold"
|
|
Text="Volume per LED pulse"
|
|
Padding="5 3 5 0" />
|
|
<TextBox Margin="3 3 3 0"
|
|
Padding="5"
|
|
Text="{Binding VPPLED}" />
|
|
<CheckBox Content="Wake up & stay awake"
|
|
IsChecked="{Binding StayAwake}"
|
|
Margin="3 5 3 0"
|
|
Padding="5"
|
|
VerticalContentAlignment="Center"/>
|
|
<CheckBox Content="Set test mode on/off"
|
|
IsChecked="{Binding ChangeMode}"
|
|
Margin="3 5 3 0"
|
|
Padding="5"
|
|
VerticalContentAlignment="Center"/>
|
|
<Button Command="{Binding SetMetrologyParametersCommand}"
|
|
Content="Send PAM's"
|
|
Cursor="Hand"
|
|
Margin="3 1 3 0"
|
|
Padding="5" />
|
|
<TextBlock Foreground="Gray"
|
|
FontSize="11"
|
|
FontStyle="Italic"
|
|
Text="{Binding ModeInfo}"
|
|
Margin="0 3 0 0"
|
|
Padding="5 0" />
|
|
<TextBlock Foreground="Gray"
|
|
FontSize="11"
|
|
FontStyle="Italic"
|
|
Text="{Binding LEDInfo}"
|
|
Margin="0"
|
|
Padding="5 0" />
|
|
<Label BorderBrush="DarkBlue"
|
|
BorderThickness="0 0 0 1"
|
|
FontWeight="Bold"
|
|
FontStyle="Italic"
|
|
Foreground="DarkBlue"
|
|
Content="Open settings"
|
|
Cursor="Hand"
|
|
Padding="5 3 5 0"
|
|
Margin="3 3 3 0"
|
|
HorizontalAlignment="Stretch"
|
|
HorizontalContentAlignment="Left">
|
|
<Label.InputBindings>
|
|
<MouseBinding MouseAction="LeftClick" Command="{Binding SwitchSettingsVisibilityCommand}" />
|
|
</Label.InputBindings>
|
|
</Label>
|
|
<TextBlock FontSize="13"
|
|
FontWeight="Bold"
|
|
Foreground="{Binding Status, Converter={StaticResource TaskStateToFG}}"
|
|
Text="{Binding Status}"
|
|
Padding="5 3 5 0" />
|
|
</StackPanel>
|
|
<Border Background="#20000000"
|
|
BorderThickness="0"
|
|
Grid.Column="0"
|
|
Grid.ColumnSpan="2"
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Stretch"
|
|
Visibility="{Binding AreSettingsVisible, Converter={StaticResource BooleanToVisibility}, FallbackValue=Collapsed}">
|
|
<Border Background="White"
|
|
BorderBrush="LightGray"
|
|
BorderThickness="1"
|
|
CornerRadius="5"
|
|
Height="300"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Width="500">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
<Border Background="WhiteSmoke"
|
|
BorderBrush="LightGray"
|
|
BorderThickness="0 0 0 1"
|
|
CornerRadius="5"
|
|
Grid.Row="0">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock FontSize="13"
|
|
FontWeight="Bold"
|
|
Grid.Column="0"
|
|
HorizontalAlignment="Left"
|
|
Padding="10 0"
|
|
Text="Settings"
|
|
VerticalAlignment="Center"/>
|
|
<Button Background="Transparent"
|
|
BorderThickness="0"
|
|
Cursor="Hand"
|
|
Grid.Column="2"
|
|
Command="{Binding SwitchSettingsVisibilityCommand}">
|
|
<Path Data="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708"
|
|
Fill="Black"
|
|
Height="16"
|
|
Margin="10"
|
|
Stroke="Black"
|
|
Width="16" />
|
|
</Button>
|
|
</Grid>
|
|
</Border>
|
|
<StackPanel Grid.Row="1"
|
|
Margin="10"
|
|
Orientation="Vertical">
|
|
<TextBlock FontWeight="Bold"
|
|
Margin="0 10 0 0"
|
|
Text="COM port for SIRT 433"
|
|
Padding="0 3 5 0" />
|
|
<TextBox Margin="0 1 0 0"
|
|
Padding="5"
|
|
Text="{Binding SIRT_433}" />
|
|
<TextBlock FontWeight="Bold"
|
|
Margin="0 10 0 0"
|
|
Text="COM port for SIRT 868"
|
|
Padding="0 3 5 0" />
|
|
<TextBox Margin="0 1 0 0"
|
|
Padding="5"
|
|
Text="{Binding SIRT_868}" />
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="3" />
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
<StackPanel Grid.Column="0" Orientation="Vertical">
|
|
<TextBlock FontWeight="Bold"
|
|
Margin="0 10 0 0"
|
|
Text="Test mode: 0-off, 1-72 h on"
|
|
Padding="0 3 5 0" />
|
|
<TextBox Margin="0 1 0 0"
|
|
Padding="5"
|
|
Text="{Binding TestModeHours}" />
|
|
</StackPanel>
|
|
<StackPanel Grid.Column="2" Orientation="Vertical">
|
|
<TextBlock FontWeight="Bold"
|
|
Margin="0 10 0 0"
|
|
Text="LED: 0-off, 1-255 min on"
|
|
Padding="0 3 5 0" />
|
|
<TextBox Margin="0 1 0 0"
|
|
Padding="5"
|
|
Text="{Binding LEDOnTime}" />
|
|
</StackPanel>
|
|
</Grid>
|
|
<Button Content="Save changes"
|
|
Cursor="Hand"
|
|
Margin="0 15 0 0"
|
|
Padding="5" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</Border>
|
|
</Border>
|
|
</Grid>
|
|
</Page>
|