Files

212 lines
20 KiB
XML

<Window x:Class="XP.Hardware.MotionControl.Views.MotionDebugWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:loc="clr-namespace:XP.Common.Localization.Extensions;assembly=XP.Common"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
xmlns:prism="http://prismlibrary.com/"
prism:ViewModelLocator.AutoWireViewModel="True"
mc:Ignorable="d"
Title="{loc:Localization MC_DebugWindow_Title}" SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterOwner" ResizeMode="NoResize" Background="White">
<StackPanel Margin="10">
<!-- 速度滑块 | Speed Slider -->
<GroupBox Margin="0,0,0,8">
<GroupBox.Header>
<TextBlock Text="{loc:Localization MC_JogSpeed_Title}" FontWeight="Bold" FontSize="12"/>
</GroupBox.Header>
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<telerik:RadSlider Grid.Column="0" Minimum="1" Maximum="150"
Value="{Binding SpeedPercent, Mode=TwoWay}"
SmallChange="1" LargeChange="10"
TickFrequency="10" TickPlacement="BottomRight"
IsSnapToTickEnabled="False"
telerik:StyleManager.Theme="Crystal"
VerticalAlignment="Center" Margin="0,0,8,0"/>
<TextBlock Grid.Column="1" FontSize="12" FontWeight="SemiBold" VerticalAlignment="Center">
<Run Text="{Binding SpeedPercent, StringFormat=F0}"/><Run Text="% ("/><Run Text="{Binding ActualSpeed, StringFormat=F1, Mode=OneWay}"/><Run Text=")"/>
</TextBlock>
</Grid>
</GroupBox>
<!-- Jog 按钮区 | Jog Buttons Area -->
<GroupBox>
<GroupBox.Header>
<TextBlock Text="{loc:Localization MC_Debug_Title}" FontWeight="Bold" FontSize="12"/>
</GroupBox.Header>
<StackPanel Margin="5">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="18"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- Row 0: SourceZ | DetectorZ -->
<TextBlock Grid.Row="0" Grid.Column="0" Text="{loc:Localization MC_SourceZ}" FontSize="12" VerticalAlignment="Center" Margin="0,2,5,2"/>
<telerik:RadButton Grid.Row="0" Grid.Column="1" Content="+" Width="28" Height="28" FontSize="13" FontWeight="Bold" Padding="0" Margin="0,2,2,2" telerik:StyleManager.Theme="Crystal">
<i:Interaction.Triggers>
<i:EventTrigger EventName="PreviewMouseLeftButtonDown"><i:InvokeCommandAction Command="{Binding JogPlusCommand}" CommandParameter="SourceZ"/></i:EventTrigger>
<i:EventTrigger EventName="PreviewMouseLeftButtonUp"><i:InvokeCommandAction Command="{Binding JogStopCommand}" CommandParameter="SourceZ"/></i:EventTrigger>
</i:Interaction.Triggers>
</telerik:RadButton>
<telerik:RadButton Grid.Row="0" Grid.Column="2" Content="&#x2212;" Width="28" Height="28" FontSize="13" FontWeight="Bold" Padding="0" Margin="0,2,2,2" telerik:StyleManager.Theme="Crystal">
<i:Interaction.Triggers>
<i:EventTrigger EventName="PreviewMouseLeftButtonDown"><i:InvokeCommandAction Command="{Binding JogMinusCommand}" CommandParameter="SourceZ"/></i:EventTrigger>
<i:EventTrigger EventName="PreviewMouseLeftButtonUp"><i:InvokeCommandAction Command="{Binding JogStopCommand}" CommandParameter="SourceZ"/></i:EventTrigger>
</i:Interaction.Triggers>
</telerik:RadButton>
<telerik:RadButton Grid.Row="0" Grid.Column="3" Content="R" Width="28" Height="28" FontSize="11" FontWeight="Bold" Padding="0" Margin="0,2" ToolTip="Home" Command="{Binding HomeAxisCommand}" CommandParameter="SourceZ" telerik:StyleManager.Theme="Crystal"/>
<TextBlock Grid.Row="0" Grid.Column="5" Text="{loc:Localization MC_DetectorZ}" FontSize="12" VerticalAlignment="Center" Margin="0,2,5,2"/>
<telerik:RadButton Grid.Row="0" Grid.Column="6" Content="+" Width="28" Height="28" FontSize="13" FontWeight="Bold" Padding="0" Margin="0,2,2,2" telerik:StyleManager.Theme="Crystal">
<i:Interaction.Triggers>
<i:EventTrigger EventName="PreviewMouseLeftButtonDown"><i:InvokeCommandAction Command="{Binding JogPlusCommand}" CommandParameter="DetectorZ"/></i:EventTrigger>
<i:EventTrigger EventName="PreviewMouseLeftButtonUp"><i:InvokeCommandAction Command="{Binding JogStopCommand}" CommandParameter="DetectorZ"/></i:EventTrigger>
</i:Interaction.Triggers>
</telerik:RadButton>
<telerik:RadButton Grid.Row="0" Grid.Column="7" Content="&#x2212;" Width="28" Height="28" FontSize="13" FontWeight="Bold" Padding="0" Margin="0,2,2,2" telerik:StyleManager.Theme="Crystal">
<i:Interaction.Triggers>
<i:EventTrigger EventName="PreviewMouseLeftButtonDown"><i:InvokeCommandAction Command="{Binding JogMinusCommand}" CommandParameter="DetectorZ"/></i:EventTrigger>
<i:EventTrigger EventName="PreviewMouseLeftButtonUp"><i:InvokeCommandAction Command="{Binding JogStopCommand}" CommandParameter="DetectorZ"/></i:EventTrigger>
</i:Interaction.Triggers>
</telerik:RadButton>
<telerik:RadButton Grid.Row="0" Grid.Column="8" Content="R" Width="28" Height="28" FontSize="11" FontWeight="Bold" Padding="0" Margin="0,2" ToolTip="Home" Command="{Binding HomeAxisCommand}" CommandParameter="DetectorZ" telerik:StyleManager.Theme="Crystal"/>
<!-- Row 1: StageX | StageY -->
<TextBlock Grid.Row="1" Grid.Column="0" Text="{loc:Localization MC_StageX}" FontSize="12" VerticalAlignment="Center" Margin="0,2,5,2"/>
<telerik:RadButton Grid.Row="1" Grid.Column="1" Content="+" Width="28" Height="28" FontSize="13" FontWeight="Bold" Padding="0" Margin="0,2,2,2" telerik:StyleManager.Theme="Crystal">
<i:Interaction.Triggers>
<i:EventTrigger EventName="PreviewMouseLeftButtonDown"><i:InvokeCommandAction Command="{Binding JogPlusCommand}" CommandParameter="StageX"/></i:EventTrigger>
<i:EventTrigger EventName="PreviewMouseLeftButtonUp"><i:InvokeCommandAction Command="{Binding JogStopCommand}" CommandParameter="StageX"/></i:EventTrigger>
</i:Interaction.Triggers>
</telerik:RadButton>
<telerik:RadButton Grid.Row="1" Grid.Column="2" Content="&#x2212;" Width="28" Height="28" FontSize="13" FontWeight="Bold" Padding="0" Margin="0,2,2,2" telerik:StyleManager.Theme="Crystal">
<i:Interaction.Triggers>
<i:EventTrigger EventName="PreviewMouseLeftButtonDown"><i:InvokeCommandAction Command="{Binding JogMinusCommand}" CommandParameter="StageX"/></i:EventTrigger>
<i:EventTrigger EventName="PreviewMouseLeftButtonUp"><i:InvokeCommandAction Command="{Binding JogStopCommand}" CommandParameter="StageX"/></i:EventTrigger>
</i:Interaction.Triggers>
</telerik:RadButton>
<telerik:RadButton Grid.Row="1" Grid.Column="3" Content="R" Width="28" Height="28" FontSize="11" FontWeight="Bold" Padding="0" Margin="0,2" ToolTip="Home" Command="{Binding HomeAxisCommand}" CommandParameter="StageX" telerik:StyleManager.Theme="Crystal"/>
<TextBlock Grid.Row="1" Grid.Column="5" Text="{loc:Localization MC_StageY}" FontSize="12" VerticalAlignment="Center" Margin="0,2,5,2"/>
<telerik:RadButton Grid.Row="1" Grid.Column="6" Content="+" Width="28" Height="28" FontSize="13" FontWeight="Bold" Padding="0" Margin="0,2,2,2" telerik:StyleManager.Theme="Crystal">
<i:Interaction.Triggers>
<i:EventTrigger EventName="PreviewMouseLeftButtonDown"><i:InvokeCommandAction Command="{Binding JogPlusCommand}" CommandParameter="StageY"/></i:EventTrigger>
<i:EventTrigger EventName="PreviewMouseLeftButtonUp"><i:InvokeCommandAction Command="{Binding JogStopCommand}" CommandParameter="StageY"/></i:EventTrigger>
</i:Interaction.Triggers>
</telerik:RadButton>
<telerik:RadButton Grid.Row="1" Grid.Column="7" Content="&#x2212;" Width="28" Height="28" FontSize="13" FontWeight="Bold" Padding="0" Margin="0,2,2,2" telerik:StyleManager.Theme="Crystal">
<i:Interaction.Triggers>
<i:EventTrigger EventName="PreviewMouseLeftButtonDown"><i:InvokeCommandAction Command="{Binding JogMinusCommand}" CommandParameter="StageY"/></i:EventTrigger>
<i:EventTrigger EventName="PreviewMouseLeftButtonUp"><i:InvokeCommandAction Command="{Binding JogStopCommand}" CommandParameter="StageY"/></i:EventTrigger>
</i:Interaction.Triggers>
</telerik:RadButton>
<telerik:RadButton Grid.Row="1" Grid.Column="8" Content="R" Width="28" Height="28" FontSize="11" FontWeight="Bold" Padding="0" Margin="0,2" ToolTip="Home" Command="{Binding HomeAxisCommand}" CommandParameter="StageY" telerik:StyleManager.Theme="Crystal"/>
<!-- Row 2: DetSwing | StageRot -->
<TextBlock Grid.Row="2" Grid.Column="0" Text="{loc:Localization MC_DetSwing}" FontSize="12" VerticalAlignment="Center" Margin="0,2,5,2"/>
<telerik:RadButton Grid.Row="2" Grid.Column="1" Content="+" Width="28" Height="28" FontSize="13" FontWeight="Bold" Padding="0" Margin="0,2,2,2" telerik:StyleManager.Theme="Crystal">
<i:Interaction.Triggers>
<i:EventTrigger EventName="PreviewMouseLeftButtonDown"><i:InvokeCommandAction Command="{Binding JogPlusCommand}" CommandParameter="DetectorSwing"/></i:EventTrigger>
<i:EventTrigger EventName="PreviewMouseLeftButtonUp"><i:InvokeCommandAction Command="{Binding JogStopCommand}" CommandParameter="DetectorSwing"/></i:EventTrigger>
</i:Interaction.Triggers>
</telerik:RadButton>
<telerik:RadButton Grid.Row="2" Grid.Column="2" Content="&#x2212;" Width="28" Height="28" FontSize="13" FontWeight="Bold" Padding="0" Margin="0,2,2,2" telerik:StyleManager.Theme="Crystal">
<i:Interaction.Triggers>
<i:EventTrigger EventName="PreviewMouseLeftButtonDown"><i:InvokeCommandAction Command="{Binding JogMinusCommand}" CommandParameter="DetectorSwing"/></i:EventTrigger>
<i:EventTrigger EventName="PreviewMouseLeftButtonUp"><i:InvokeCommandAction Command="{Binding JogStopCommand}" CommandParameter="DetectorSwing"/></i:EventTrigger>
</i:Interaction.Triggers>
</telerik:RadButton>
<telerik:RadButton Grid.Row="2" Grid.Column="3" Content="R" Width="28" Height="28" FontSize="11" FontWeight="Bold" Padding="0" Margin="0,2" ToolTip="Home" Command="{Binding HomeAxisCommand}" CommandParameter="DetectorSwing" telerik:StyleManager.Theme="Crystal"/>
<TextBlock Grid.Row="2" Grid.Column="5" Text="{loc:Localization MC_StageRot}" FontSize="12" VerticalAlignment="Center" Margin="0,2,5,2" Visibility="{Binding StageRotationVisibility}"/>
<telerik:RadButton Grid.Row="2" Grid.Column="6" Content="+" Width="28" Height="28" FontSize="13" FontWeight="Bold" Padding="0" Margin="0,2,2,2" Visibility="{Binding StageRotationVisibility}" telerik:StyleManager.Theme="Crystal">
<i:Interaction.Triggers>
<i:EventTrigger EventName="PreviewMouseLeftButtonDown"><i:InvokeCommandAction Command="{Binding JogPlusCommand}" CommandParameter="StageRotation"/></i:EventTrigger>
<i:EventTrigger EventName="PreviewMouseLeftButtonUp"><i:InvokeCommandAction Command="{Binding JogStopCommand}" CommandParameter="StageRotation"/></i:EventTrigger>
</i:Interaction.Triggers>
</telerik:RadButton>
<telerik:RadButton Grid.Row="2" Grid.Column="7" Content="&#x2212;" Width="28" Height="28" FontSize="13" FontWeight="Bold" Padding="0" Margin="0,2,2,2" Visibility="{Binding StageRotationVisibility}" telerik:StyleManager.Theme="Crystal">
<i:Interaction.Triggers>
<i:EventTrigger EventName="PreviewMouseLeftButtonDown"><i:InvokeCommandAction Command="{Binding JogMinusCommand}" CommandParameter="StageRotation"/></i:EventTrigger>
<i:EventTrigger EventName="PreviewMouseLeftButtonUp"><i:InvokeCommandAction Command="{Binding JogStopCommand}" CommandParameter="StageRotation"/></i:EventTrigger>
</i:Interaction.Triggers>
</telerik:RadButton>
<telerik:RadButton Grid.Row="2" Grid.Column="8" Content="R" Width="28" Height="28" FontSize="11" FontWeight="Bold" Padding="0" Margin="0,2" ToolTip="Home" Visibility="{Binding StageRotationVisibility}" Command="{Binding HomeAxisCommand}" CommandParameter="StageRotation" telerik:StyleManager.Theme="Crystal"/>
<!-- Row 3: FixtureRot | (empty) -->
<TextBlock Grid.Row="3" Grid.Column="0" Text="{loc:Localization MC_FixtureRot}" FontSize="12" VerticalAlignment="Center" Margin="0,2,5,2" Visibility="{Binding FixtureRotationVisibility}"/>
<telerik:RadButton Grid.Row="3" Grid.Column="1" Content="+" Width="28" Height="28" FontSize="13" FontWeight="Bold" Padding="0" Margin="0,2,2,2" Visibility="{Binding FixtureRotationVisibility}" telerik:StyleManager.Theme="Crystal">
<i:Interaction.Triggers>
<i:EventTrigger EventName="PreviewMouseLeftButtonDown"><i:InvokeCommandAction Command="{Binding JogPlusCommand}" CommandParameter="FixtureRotation"/></i:EventTrigger>
<i:EventTrigger EventName="PreviewMouseLeftButtonUp"><i:InvokeCommandAction Command="{Binding JogStopCommand}" CommandParameter="FixtureRotation"/></i:EventTrigger>
</i:Interaction.Triggers>
</telerik:RadButton>
<telerik:RadButton Grid.Row="3" Grid.Column="2" Content="&#x2212;" Width="28" Height="28" FontSize="13" FontWeight="Bold" Padding="0" Margin="0,2,2,2" Visibility="{Binding FixtureRotationVisibility}" telerik:StyleManager.Theme="Crystal">
<i:Interaction.Triggers>
<i:EventTrigger EventName="PreviewMouseLeftButtonDown"><i:InvokeCommandAction Command="{Binding JogMinusCommand}" CommandParameter="FixtureRotation"/></i:EventTrigger>
<i:EventTrigger EventName="PreviewMouseLeftButtonUp"><i:InvokeCommandAction Command="{Binding JogStopCommand}" CommandParameter="FixtureRotation"/></i:EventTrigger>
</i:Interaction.Triggers>
</telerik:RadButton>
<telerik:RadButton Grid.Row="3" Grid.Column="3" Content="R" Width="28" Height="28" FontSize="11" FontWeight="Bold" Padding="0" Margin="0,2" ToolTip="Home" Visibility="{Binding FixtureRotationVisibility}" Command="{Binding HomeAxisCommand}" CommandParameter="FixtureRotation" telerik:StyleManager.Theme="Crystal"/>
</Grid>
<!-- 轴复位 | Axis Reset -->
<telerik:RadButton Content="{loc:Localization MC_AxisReset}" Command="{Binding AxisResetCommand}" Height="28" Margin="0,6,0,0" telerik:StyleManager.Theme="Crystal" FontSize="12" FontWeight="Bold">
<telerik:RadButton.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="White"/>
<GradientStop Color="#FFFFAB91" Offset="1"/>
</LinearGradientBrush>
</telerik:RadButton.Background>
</telerik:RadButton>
</StackPanel>
</GroupBox>
<!-- 门控制区(调试模式,不检查联锁)| Door Control (debug mode, no interlock check) -->
<GroupBox Margin="0,8,0,0">
<GroupBox.Header>
<TextBlock Text="{loc:Localization MC_DoorStatus_Title}" FontWeight="Bold" FontSize="12"/>
</GroupBox.Header>
<UniformGrid Columns="3" Margin="5">
<telerik:RadButton Content="{loc:Localization MC_OpenDoor}" Command="{Binding OpenDoorCommand}" Height="26" Margin="2" telerik:StyleManager.Theme="Crystal"/>
<telerik:RadButton Content="{loc:Localization MC_CloseDoor}" Command="{Binding CloseDoorCommand}" Height="26" Margin="2" telerik:StyleManager.Theme="Crystal"/>
<telerik:RadButton Content="{loc:Localization MC_StopDoor}" Command="{Binding StopDoorCommand}" Height="26" Margin="2" telerik:StyleManager.Theme="Crystal"/>
</UniformGrid>
</GroupBox>
<!-- 几何反算区 | Geometry Inverse Calculation -->
<GroupBox Margin="0,8,0,0">
<GroupBox.Header>
<TextBlock Text="{loc:Localization MC_Geometry_Title}" FontWeight="Bold" FontSize="12"/>
</GroupBox.Header>
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="{loc:Localization MC_TargetFOD}" FontSize="12" Foreground="#616161" VerticalAlignment="Center"/>
<telerik:RadNumericUpDown Grid.Column="1" Value="{Binding TargetFOD, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ValueFormat="Numeric" NumberDecimalDigits="2" SmallChange="0.1" LargeChange="1" Margin="4,2" telerik:StyleManager.Theme="Crystal"/>
<TextBlock Grid.Column="2" Text="{loc:Localization MC_TargetFDD}" FontSize="12" Foreground="#616161" VerticalAlignment="Center" Margin="4,0,0,0"/>
<telerik:RadNumericUpDown Grid.Column="3" Value="{Binding TargetFDD, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ValueFormat="Numeric" NumberDecimalDigits="2" SmallChange="0.1" LargeChange="1" Margin="4,2" telerik:StyleManager.Theme="Crystal"/>
<telerik:RadButton Grid.Column="4" Content="{loc:Localization MC_CalculateGeometry}" Command="{Binding ApplyGeometryCommand}" Margin="4,2,0,2" Height="24" Padding="8,2" telerik:StyleManager.Theme="Crystal" FontSize="12"/>
</Grid>
</GroupBox>
</StackPanel>
</Window>