Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Simple-HMI-with-WPF/SimpleHmi/Views/MainWindow.xaml
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
141 lines (141 sloc)
5.51 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Window x:Class="SimpleHmi.Views.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:Converters="clr-namespace:SimpleHmi.Converters" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
xmlns:vm="clr-namespace:SimpleHmi.ViewModels" | |
Title="MainWindow" | |
Width="525" | |
Height="350" | |
mc:Ignorable="d"> | |
<Window.Resources> | |
<Converters:BooleanToBrushConverter x:Key="BooleanToBrushConverter" /> | |
</Window.Resources> | |
<Window.DataContext> | |
<vm:MainWindowViewModel /> | |
</Window.DataContext> | |
<Grid> | |
<Grid.RowDefinitions> | |
<RowDefinition Height="*" /> | |
<RowDefinition Height="auto" /> | |
</Grid.RowDefinitions> | |
<TextBlock Width="117" | |
Height="17" | |
Margin="11,13,0,0" | |
HorizontalAlignment="Left" | |
VerticalAlignment="Top" | |
Text="Ip address" | |
TextWrapping="Wrap" /> | |
<TextBox Width="117" | |
Height="28" | |
Margin="11,35,0,0" | |
HorizontalAlignment="Left" | |
VerticalAlignment="Top" | |
Text="{Binding IpAddress}" | |
TextWrapping="Wrap" /> | |
<Button Width="90" | |
Height="28" | |
Margin="144,35,0,0" | |
HorizontalAlignment="Left" | |
VerticalAlignment="Top" | |
Command="{Binding ConnectCommand, | |
Mode=OneWay}" | |
Content="Connect" /> | |
<Button Width="90" | |
Height="28" | |
Margin="249,35,0,0" | |
HorizontalAlignment="Left" | |
VerticalAlignment="Top" | |
Command="{Binding DisconnectCommand, | |
Mode=OneWay}" | |
Content="Disconnect" /> | |
<Ellipse Width="19" | |
Height="18" | |
Margin="29,107,0,0" | |
HorizontalAlignment="Left" | |
VerticalAlignment="Top" | |
Fill="{Binding HighLimit, | |
Converter={StaticResource BooleanToBrushConverter}}" | |
Stroke="Black" /> | |
<TextBlock Width="117" | |
Height="17" | |
Margin="53,108,0,0" | |
HorizontalAlignment="Left" | |
VerticalAlignment="Top" | |
Text="High limit" | |
TextWrapping="Wrap" /> | |
<Ellipse Width="19" | |
Height="18" | |
Margin="29,136,0,0" | |
HorizontalAlignment="Left" | |
VerticalAlignment="Top" | |
Fill="{Binding LowLimit, | |
Converter={StaticResource BooleanToBrushConverter}}" | |
Stroke="Black" /> | |
<TextBlock Width="117" | |
Height="17" | |
Margin="53,137,0,0" | |
HorizontalAlignment="Left" | |
VerticalAlignment="Top" | |
Text="Low limit" | |
TextWrapping="Wrap" /> | |
<ProgressBar Width="145" | |
Height="18" | |
Margin="27,200,0,0" | |
HorizontalAlignment="Left" | |
VerticalAlignment="Top" | |
Value="{Binding TankLevel}" /> | |
<TextBlock Width="69" | |
Height="17" | |
Margin="27,183,0,0" | |
HorizontalAlignment="Left" | |
VerticalAlignment="Top" | |
Text="Filling level:" | |
TextWrapping="Wrap" /> | |
<TextBlock Width="61" | |
Height="17" | |
Margin="96,183,0,0" | |
HorizontalAlignment="Left" | |
VerticalAlignment="Top" | |
Text="{Binding TankLevel, | |
StringFormat={}{0}%}" | |
TextWrapping="Wrap" /> | |
<Ellipse Width="19" | |
Height="18" | |
Margin="183,200,0,0" | |
HorizontalAlignment="Left" | |
VerticalAlignment="Top" | |
Fill="{Binding PumpState, | |
Converter={StaticResource BooleanToBrushConverter}}" | |
Stroke="Black" /> | |
<TextBlock Width="117" | |
Height="17" | |
Margin="207,201,0,0" | |
HorizontalAlignment="Left" | |
VerticalAlignment="Top" | |
Text="Pump state" | |
TextWrapping="Wrap" /> | |
<Button Width="110" | |
Height="31" | |
Margin="339,94,0,0" | |
HorizontalAlignment="Left" | |
VerticalAlignment="Top" | |
Command="{Binding StartCommand, | |
Mode=OneWay}" | |
Content="Start" /> | |
<Button Width="110" | |
Height="31" | |
Margin="339,133,0,0" | |
HorizontalAlignment="Left" | |
VerticalAlignment="Top" | |
Command="{Binding StopCommand, | |
Mode=OneWay}" | |
Content="Stop" /> | |
<StatusBar Grid.Row="1"> | |
<TextBlock Text="{Binding ConnectionState, StringFormat=Connection state: {0}}" /> | |
<Separator /> | |
<TextBlock Text="{Binding ScanTime, StringFormat=ScanTime {0}}" /> | |
</StatusBar> | |
</Grid> | |
</Window> |