You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

173 lines
14 KiB

<UserControl x:Class="Gumming.RobotStatusView"
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"
mc:Ignorable="d"
xmlns:local="clr-namespace:Gumming"
xmlns:tool="clr-namespace:GummingCommon;assembly=GummingCommon"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
d:DesignHeight="700" d:DesignWidth="1000"
Background="Transparent"
x:Name="rootControl">
<UserControl.Resources>
<tool:RadioButtonConverter x:Key="RadioConverter"/>
<tool:BooleanToOpacityConverter x:Key="OpacityConverter"/>
<tool:EditorTextConverter x:Key="TextBrushConverter"/>
<tool:EditorBorderConverter x:Key="BorderBrushConverter"/>
<tool:PathTypeToThemeConverter x:Key="PathTypeConverter"/>
<tool:StepStyleConverter x:Key="StepStyleConverter"/>
<tool:TagStyleConverter x:Key="TagStyleConverter"/>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*"></RowDefinition>
<RowDefinition Height="5"></RowDefinition>
<RowDefinition Height="120"></RowDefinition>
<RowDefinition Height="5"></RowDefinition>
<RowDefinition Height="100"></RowDefinition>
</Grid.RowDefinitions>
<Border BorderThickness="1" BorderBrush="{DynamicResource BlackBrushNormal}" Margin="10,10,10,0">
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="10"></RowDefinition>
<RowDefinition Height="3*"></RowDefinition>
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="10"></ColumnDefinition>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition Width="10"></ColumnDefinition>
<ColumnDefinition Width="300"></ColumnDefinition>
<ColumnDefinition Width="10"></ColumnDefinition>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition Width="10"></ColumnDefinition>
<ColumnDefinition Width="160"></ColumnDefinition>
<ColumnDefinition Width="10"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="状态" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="2" FontSize="15" FontWeight="Bold" Foreground="{DynamicResource FontBrush1}" ></TextBlock>
<TextBlock Grid.Column="6" Text="查询状态" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="2" FontSize="14" Foreground="{DynamicResource FontBrush1}" ></TextBlock>
<TextBox Grid.Column="8" IsEnabled="True" Text="{Binding CurrentStatus}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalContentAlignment="Center" FontSize="14"></TextBox>
</Grid>
<Grid Grid.Row="2">
<Grid.RowDefinitions>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="10"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="10"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"></ColumnDefinition>
<ColumnDefinition Width="10"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Text="错误信息" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="2" FontSize="14" Foreground="{DynamicResource FontBrush1}" ></TextBlock>
<TextBlock Grid.Row="2" Grid.Column="0" Text="错误原因" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="14" Foreground="{DynamicResource FontBrush1}" ></TextBlock>
<TextBlock Grid.Row="4" Grid.Column="0" Text="恢复方法" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="14" Foreground="{DynamicResource FontBrush1}" ></TextBlock>
<TextBox Grid.Row="0" Grid.Column="2" IsEnabled="True" Text="{Binding ErrorInfo}" ToolTip="{Binding ErrorInfo}" HorizontalAlignment="Stretch" TextWrapping="Wrap" FontSize="14" ></TextBox>
<TextBox Grid.Row="2" Grid.Column="2" IsEnabled="True" Text="{Binding ErrorCause}" ToolTip="{Binding ErrorCause}" HorizontalAlignment="Stretch" TextWrapping="Wrap" FontSize="14" ></TextBox>
<TextBox Grid.Row="4" Grid.Column="2" IsEnabled="True" Text="{Binding ErrorWay}" ToolTip="{Binding ErrorWay}" HorizontalAlignment="Stretch" TextWrapping="Wrap" FontSize="14" ></TextBox>
</Grid>
</Grid>
</Border>
<Border Grid.Row="2" BorderThickness="1" BorderBrush="{DynamicResource BlackBrushNormal}" Margin="10,0,10,0" >
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="10"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="10"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="10"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="10"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="10"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Grid.ColumnSpan="2" Text="坐标" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="2" FontSize="15" FontWeight="Bold" Foreground="{DynamicResource FontBrush1}" ></TextBlock>
<TextBlock Grid.Row="2" Grid.Column="1" Text="当前坐标" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="14" Foreground="{DynamicResource FontBrush1}" ></TextBlock>
<TextBlock Grid.Row="0" Grid.Column="3" Text="T" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="14" Foreground="{DynamicResource FontBrush1}" ></TextBlock>
<TextBlock Grid.Row="0" Grid.Column="5" Text="Z" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="14" Foreground="{DynamicResource FontBrush1}" ></TextBlock>
<TextBlock Grid.Row="0" Grid.Column="7" Text="R" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="14" Foreground="{DynamicResource FontBrush1}" ></TextBlock>
<TextBlock Grid.Row="0" Grid.Column="9" Text="W" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="14" Foreground="{DynamicResource FontBrush1}" ></TextBlock>
<TextBox Grid.Row="2" Grid.Column="3" IsEnabled="True" Text="{Binding CoordTRead, StringFormat=F2}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalContentAlignment="Center" FontSize="14"></TextBox>
<TextBox Grid.Row="2" Grid.Column="5" IsEnabled="True" Text="{Binding CoordZRead, StringFormat=F2}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalContentAlignment="Center" FontSize="14"></TextBox>
<TextBox Grid.Row="2" Grid.Column="7" IsEnabled="True" Text="{Binding CoordRRead, StringFormat=F2}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalContentAlignment="Center" FontSize="14"></TextBox>
<TextBox Grid.Row="2" Grid.Column="9" IsEnabled="True" Text="{Binding CoordLRead, StringFormat=F2}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalContentAlignment="Center" FontSize="14"></TextBox>
</Grid>
</Border>
<Grid Grid.Row="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="2"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="2"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Border Grid.Column="1" BorderThickness="1" BorderBrush="{DynamicResource BlackBrushNormal}" Margin="8,0,8,3" >
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="5"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="2"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="10"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="10"></ColumnDefinition>
<ColumnDefinition Width="50"></ColumnDefinition>
<ColumnDefinition Width="10"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="1" Grid.Row="1" Text="相对移动" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="2" FontSize="15" FontWeight="Bold" Foreground="{DynamicResource FontBrush1}" ></TextBlock>
<ComboBox Grid.Row="1" Grid.Column="3" Margin="0,3,0,3" BorderThickness="0" ItemsSource="{Binding Path=RobotAxises}" SelectedItem="{Binding SelectedRobotAxis, Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding ComboName, Mode=TwoWay}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<local:FloatBox Grid.Row="3" Grid.Column="3" Text="{Binding MovePosition, UpdateSourceTrigger=LostFocus, StringFormat=F2}" ToolTip="{Binding MovePosition}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalContentAlignment="Center" FontSize="14"></local:FloatBox>
<Button Grid.Row="1" Grid.Column="5" FontSize="15" Style="{Binding Path=Status[0],Converter={StaticResource TagStyleConverter}}" Tag="{Binding Status[0]}" Command="{Binding AddCommand}" Content="+"></Button>
<Button Grid.Row="3" Grid.Column="5" FontSize="15" Style="{Binding Path=Status[1],Converter={StaticResource TagStyleConverter}}" Tag="{Binding Status[1]}" Command="{Binding MintusCommand}" Content="-"></Button>
</Grid>
</Border>
<Border Grid.Column="3" BorderThickness="1" BorderBrush="{DynamicResource BlackBrushNormal}" Margin="8,0,8,3">
<Grid Margin="3">
<Grid.RowDefinitions>
<RowDefinition Height="2"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="5"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="2"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="10"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="10"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="1" Grid.ColumnSpan="2" Text="速度设置" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="2" FontSize="15" FontWeight="Bold" Foreground="{DynamicResource FontBrush1}" ></TextBlock>
<local:IntBox Grid.Row="3" Grid.Column="1" Text="{Binding MoveSpeed, UpdateSourceTrigger=LostFocus, StringFormat=F0}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalContentAlignment="Center" FontSize="14" LostFocus="MoveSpeed_LostFocus"></local:IntBox>
<TextBox IsEnabled="False" Grid.Row="3" Grid.Column="3" Text="{Binding MoveSpeedRead}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalContentAlignment="Center" FontSize="14"></TextBox>
</Grid>
</Border>
</Grid>
</Grid>
</UserControl>