312 lines
13 KiB
XML
312 lines
13 KiB
XML
<UserControl x:Class="AuroraMotor.Views.UCAuroraMotor"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
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:local="clr-namespace:AuroraMotor.Views"
|
|
xmlns:behavior="http://schemas.microsoft.com/xaml/behaviors"
|
|
d:DataContext="{d:DesignInstance Type=local:UCAuroraMotorViewModel}"
|
|
mc:Ignorable="d">
|
|
<behavior:Interaction.Triggers>
|
|
<behavior:EventTrigger EventName="Loaded">
|
|
<behavior:InvokeCommandAction Command="{Binding CMD_ViewLoaded}"/>
|
|
</behavior:EventTrigger>
|
|
<behavior:EventTrigger EventName="Unloaded">
|
|
<behavior:InvokeCommandAction Command="{Binding CMD_ViewUnloaded}"/>
|
|
</behavior:EventTrigger>
|
|
</behavior:Interaction.Triggers>
|
|
<UserControl.Resources>
|
|
<ResourceDictionary>
|
|
<ResourceDictionary.MergedDictionaries>
|
|
<ResourceDictionary Source="/Style/Controls/JogStyle.xaml"/>
|
|
</ResourceDictionary.MergedDictionaries>
|
|
</ResourceDictionary>
|
|
</UserControl.Resources>
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="150"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="400"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
<GroupBox Margin="5,0"
|
|
Header="{Binding [Status], Source={StaticResource langTokens}}">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
<CheckBox
|
|
Grid.Row="0"
|
|
FontSize="16"
|
|
IsChecked="{Binding IsServoOn}"
|
|
Content="{Binding [ServoOn], Source={StaticResource langTokens}}"/>
|
|
<ListView
|
|
Grid.Row="1"
|
|
Margin="0,10,20,10"
|
|
ItemsSource="{Binding Alarms}">
|
|
<ListView.ItemContainerStyle>
|
|
<Style TargetType="{x:Type ListViewItem}">
|
|
<!-- disable mouse rollover effect and no select -->
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type ListViewItem}">
|
|
<ContentPresenter/>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</ListView.ItemContainerStyle>
|
|
<ListView.ItemTemplate>
|
|
<DataTemplate>
|
|
<TextBlock
|
|
Foreground="DarkRed"
|
|
Text="{Binding}"/>
|
|
</DataTemplate>
|
|
</ListView.ItemTemplate>
|
|
</ListView>
|
|
<Button
|
|
Grid.RowSpan="2"
|
|
Grid.Column="1"
|
|
Command="{Binding CMD_ClearAlarm}">
|
|
<StackPanel>
|
|
<TextBlock Text="{Binding [Alarm], Source={StaticResource langTokens}}"/>
|
|
<TextBlock Text="{Binding [Clear], Source={StaticResource langTokens}}"/>
|
|
</StackPanel>
|
|
</Button>
|
|
</Grid>
|
|
</GroupBox>
|
|
<GroupBox
|
|
Grid.Column="1"
|
|
Margin="5,0,0,0"
|
|
Header="{Binding [Position],
|
|
Source={StaticResource langTokens}}">
|
|
<TextBlock
|
|
Foreground="{Binding CurrentPosBrush}"
|
|
HorizontalAlignment="Right"
|
|
VerticalAlignment="Center"
|
|
FontFamily="Calibri"
|
|
FontSize="84"
|
|
FontWeight="ExtraBlack"
|
|
Text="{Binding CurrentPos, StringFormat={}{0:f3}}"/>
|
|
</GroupBox>
|
|
|
|
<GroupBox
|
|
Grid.Row="1"
|
|
Margin="5,0"
|
|
Padding="0,0,0,20"
|
|
Header="{Binding [Home], Source={StaticResource langTokens}}">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock
|
|
Grid.Row="0"
|
|
Grid.Column="0"
|
|
VerticalAlignment="Top"
|
|
Text="{Binding HomeStatus}"/>
|
|
<StackPanel
|
|
Grid.Row="0"
|
|
Grid.Column="1"
|
|
VerticalAlignment="Bottom"
|
|
Margin="20,0,0,0"
|
|
Orientation="Horizontal">
|
|
<Button
|
|
Command="{Binding CMD_Home}"
|
|
FontSize="16"
|
|
Content="{Binding [Home], Source={StaticResource langTokens}}"/>
|
|
<Button
|
|
Background="DarkOrange"
|
|
Foreground="GhostWhite"
|
|
Margin="10,0,0,0"
|
|
FontWeight="ExtraBlack"
|
|
Content="{Binding [Stop], Source={StaticResource langTokens}}"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
</GroupBox>
|
|
|
|
<GroupBox
|
|
Grid.Row="2"
|
|
Margin="5,0"
|
|
Header="{Binding [Jog], Source={StaticResource langTokens}}">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock
|
|
Grid.Row="0"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Bottom"
|
|
Text="{Binding [Velocity], Source={StaticResource langTokens}}"/>
|
|
<TextBox
|
|
Grid.Row="1"
|
|
VerticalAlignment="Top"
|
|
Text="{Binding TargetJogVel}"/>
|
|
<TextBlock
|
|
Grid.Row="2"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Bottom"
|
|
Text="{Binding [Distance], Source={StaticResource langTokens}}"/>
|
|
<TextBox
|
|
Grid.Row="3"
|
|
VerticalAlignment="Top"
|
|
Text="{Binding TargetJogIncrement}"/>
|
|
<Button
|
|
Grid.Row="0"
|
|
Grid.RowSpan="2"
|
|
Grid.Column="1"
|
|
Margin="20,0,10,0"
|
|
PreviewMouseDown="OnJogNegativePressed"
|
|
PreviewMouseUp="OnJogStop"
|
|
Content="( - )"/>
|
|
<Button
|
|
Grid.Row="0"
|
|
Grid.RowSpan="2"
|
|
Grid.Column="2"
|
|
PreviewMouseDown="OnJogPositivePressed"
|
|
PreviewMouseUp="OnJogStop"
|
|
Content="( + )"/>
|
|
<Button
|
|
Grid.Row="2"
|
|
Grid.RowSpan="2"
|
|
Grid.Column="1"
|
|
Margin="20,10,10,10"
|
|
Command="{Binding CMD_JogGo}"
|
|
Content="{Binding [Go], Source={StaticResource langTokens}}"/>
|
|
<Button
|
|
Grid.Row="2"
|
|
Grid.RowSpan="2"
|
|
Grid.Column="2"
|
|
Background="DarkOrange"
|
|
Foreground="GhostWhite"
|
|
Command="{Binding CMD_Stop}"
|
|
FontWeight="ExtraBlack"
|
|
Content="{Binding [Stop], Source={StaticResource langTokens}}"/>
|
|
</Grid>
|
|
</GroupBox>
|
|
|
|
<GroupBox
|
|
Grid.Row="1"
|
|
Grid.RowSpan="2"
|
|
Grid.Column="1"
|
|
Margin="5,0,0,0"
|
|
Header="{Binding [Move], Source={StaticResource langTokens}}">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
<StackPanel
|
|
Grid.Column="1"
|
|
Margin="0,0,0,10"
|
|
Orientation="Horizontal">
|
|
<RadioButton
|
|
FontSize="16"
|
|
GroupName="mode"
|
|
IsChecked="{Binding IsAbsTarget}"
|
|
Content="{Binding [Absolute], Source={StaticResource langTokens}}"/>
|
|
<RadioButton
|
|
Margin="20,0,0,0"
|
|
FontSize="16"
|
|
GroupName="mode"
|
|
IsChecked="{Binding IsRelTarget}"
|
|
Content="{Binding [Relative], Source={StaticResource langTokens}}"/>
|
|
</StackPanel>
|
|
<TextBlock
|
|
Grid.Row="1"
|
|
Margin="0,0,5,0"
|
|
Text="{Binding [TargetPosition], Source={StaticResource langTokens}}"/>
|
|
<TextBox
|
|
Grid.Row="1"
|
|
Grid.Column="1"
|
|
Text="{Binding TargetPos, StringFormat={}{0:f3}}"/>
|
|
<TextBlock
|
|
Grid.Row="2"
|
|
Grid.Column="1"
|
|
Foreground="Green"
|
|
HorizontalAlignment="Center"
|
|
Margin="0,0,5,0">
|
|
<TextBlock.Text>
|
|
<MultiBinding StringFormat="[{0} ~ {1}]">
|
|
<Binding Path="PosLimit.Min"/>
|
|
<Binding Path="PosLimit.Max"/>
|
|
</MultiBinding>
|
|
</TextBlock.Text>
|
|
</TextBlock>
|
|
<TextBlock
|
|
Grid.Row="3"
|
|
Margin="0,0,5,0"
|
|
Text="{Binding [VelocityLevel],
|
|
Source={StaticResource langTokens}}"/>
|
|
<TextBox
|
|
Grid.Row="3"
|
|
Grid.Column="1"
|
|
Margin="0,5,0,0"
|
|
Text="{Binding TargetVel, StringFormat={}{0:f3}}"/>
|
|
<TextBlock
|
|
Grid.Row="4"
|
|
Grid.Column="1"
|
|
Foreground="Green"
|
|
HorizontalAlignment="Center"
|
|
Margin="0,0,5,0">
|
|
<TextBlock.Text>
|
|
<MultiBinding StringFormat="[{0} ~ {1}]">
|
|
<Binding Path="VelLimit.Min"/>
|
|
<Binding Path="VelLimit.Max"/>
|
|
</MultiBinding>
|
|
</TextBlock.Text>
|
|
</TextBlock>
|
|
<StackPanel
|
|
Grid.Row="5"
|
|
Grid.Column="1"
|
|
Margin="0,10,0,0"
|
|
Orientation="Horizontal">
|
|
<Button
|
|
Grid.Row="1"
|
|
Grid.Column="1"
|
|
Command="{Binding CMD_Move}"
|
|
FontSize="16"
|
|
Content="{Binding [Move],
|
|
Source={StaticResource langTokens}}"/>
|
|
<Button
|
|
Grid.Row="2"
|
|
Grid.Column="2"
|
|
Background="DarkOrange"
|
|
Foreground="GhostWhite"
|
|
Margin="10,0,0,0"
|
|
Command="{Binding CMD_Stop}"
|
|
FontWeight="ExtraBlack"
|
|
Content="{Binding [Stop],
|
|
Source={StaticResource langTokens}}"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
</GroupBox>
|
|
</Grid>
|
|
</UserControl> |