| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- <UserControl x:Class="TeamAAS.Robot.UI.DefaultRobotDebugPage"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:loc="clr-namespace:TeamAAS.Localization;assembly=TeamAAS.Global">
- <UserControl.Resources>
- <!-- Jog 按钮样式(从主程序 SettingView 局部资源复制,库页独立自带) -->
- <Style x:Key="JogButton" TargetType="Button">
- <Setter Property="FontSize" Value="18"/>
- <Setter Property="FontWeight" Value="Bold"/>
- <Setter Property="Margin" Value="4"/>
- <Setter Property="Padding" Value="0,14"/>
- <Setter Property="MinHeight" Value="48"/>
- <Setter Property="Cursor" Value="Hand"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="Button">
- <Border x:Name="bd" Background="{DynamicResource SecondaryRegionBrush}"
- CornerRadius="4" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}">
- <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="bd" Property="Background" Value="{DynamicResource PrimaryBrush}"/>
- <Setter Property="Foreground" Value="White"/>
- </Trigger>
- <Trigger Property="IsPressed" Value="True">
- <Setter TargetName="bd" Property="Background" Value="{DynamicResource PrimaryBrush}"/>
- <Setter Property="Foreground" Value="White"/>
- </Trigger>
- <Trigger Property="IsEnabled" Value="False">
- <Setter TargetName="bd" Property="Opacity" Value="0.4"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </UserControl.Resources>
- <Border Background="{DynamicResource RegionBrush}" CornerRadius="8">
- <DockPanel Margin="8">
- <TextBlock DockPanel.Dock="Top" Text="{loc:Translate '手动调试'}" FontSize="14" FontWeight="Bold"
- Margin="8,4,0,8" Foreground="{DynamicResource PrimaryTextBrush}"/>
- <!-- 状态栏 -->
- <Border DockPanel.Dock="Top" Background="{DynamicResource SecondaryRegionBrush}" CornerRadius="4" Padding="12,6" Margin="4,0,4,8">
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="{loc:Translate '状态: '}" FontSize="12" Foreground="{DynamicResource SecondaryTextBrush}"/>
- <TextBlock x:Name="TxtStatus" FontSize="12" FontWeight="Bold" Foreground="{DynamicResource PrimaryBrush}"/>
- <TextBlock Text=" | " FontSize="12" Foreground="{DynamicResource SecondaryTextBrush}"/>
- <TextBlock x:Name="TxtMessage" FontSize="12" Foreground="{DynamicResource SecondaryTextBrush}"/>
- </StackPanel>
- </Border>
- <!-- 坐标显示 -->
- <Border DockPanel.Dock="Top" Background="#1E1E1E" CornerRadius="4" Padding="16,10" Margin="4,0,4,8">
- <StackPanel>
- <TextBlock Text="{loc:Translate '当前坐标'}" FontSize="11" Foreground="#888888" Margin="0,0,0,4"/>
- <TextBlock x:Name="TxtPos" Text="X: --- Y: --- Z: ---" FontSize="13" FontFamily="Consolas" Foreground="#4FC3F7"/>
- </StackPanel>
- </Border>
- <!-- 操作区(未绑定机器人时整体禁用) -->
- <StackPanel x:Name="OpsRoot" DockPanel.Dock="Top" IsEnabled="False">
- <WrapPanel Orientation="Horizontal" Margin="4,0,4,8">
- <Button x:Name="BtnMotorOn" Content="{loc:Translate '电机开'}" Click="BtnMotorOn_Click" Padding="12,4" Margin="0,0,6,6"/>
- <Button x:Name="BtnMotorOff" Content="{loc:Translate '电机关'}" Click="BtnMotorOff_Click" Padding="12,4" Margin="0,0,6,6"/>
- <Button x:Name="BtnReset" Content="{loc:Translate '重置'}" Click="BtnReset_Click" Padding="12,4" Margin="0,0,6,6"/>
- <Button x:Name="BtnSFree" Content="{loc:Translate '释放刹车'}" Click="BtnSFree_Click" Padding="12,4" Margin="0,0,6,6"/>
- <Button x:Name="BtnSLock" Content="{loc:Translate '锁定刹车'}" Click="BtnSLock_Click" Padding="12,4" Margin="0,0,6,6"/>
- <Button x:Name="BtnGetPos" Content="{loc:Translate '读坐标'}" Click="BtnGetPos_Click" Padding="12,4" Margin="0,0,6,6"/>
- </WrapPanel>
- <Grid Margin="4,0,4,8">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="*"/>
- </Grid.ColumnDefinitions>
- <StackPanel Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center">
- <TextBlock Text="{loc:Translate '步进:'}" FontSize="12" VerticalAlignment="Center" Margin="0,0,6,0"/>
- <TextBox x:Name="TxtStep" Text="1.0" Width="80" FontSize="12" VerticalContentAlignment="Center"/>
- <TextBlock Text="mm" FontSize="12" VerticalAlignment="Center" Margin="4,0,0,0"/>
- </StackPanel>
- <StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center">
- <TextBlock Text="Tool:" FontSize="12" VerticalAlignment="Center" Margin="0,0,6,0"/>
- <ComboBox x:Name="ToolCombo" SelectedIndex="0" Width="60" FontSize="12">
- <ComboBoxItem Content="0"/><ComboBoxItem Content="1"/><ComboBoxItem Content="2"/><ComboBoxItem Content="3"/>
- <ComboBoxItem Content="4"/><ComboBoxItem Content="5"/><ComboBoxItem Content="6"/><ComboBoxItem Content="7"/>
- <ComboBoxItem Content="8"/><ComboBoxItem Content="9"/><ComboBoxItem Content="10"/><ComboBoxItem Content="11"/>
- <ComboBoxItem Content="12"/><ComboBoxItem Content="13"/><ComboBoxItem Content="14"/><ComboBoxItem Content="15"/>
- </ComboBox>
- <Button x:Name="BtnSelectTool" Content="{loc:Translate '选择'}" Click="BtnSelectTool_Click" FontSize="11" Padding="8,2" Margin="6,0,0,0"/>
- </StackPanel>
- </Grid>
- <Border Background="{DynamicResource SecondaryRegionBrush}" CornerRadius="4" Padding="16" Margin="4,0,4,8">
- <StackPanel>
- <TextBlock Text="{loc:Translate '空间轴 (X / Y / Z)'}" FontSize="11" Foreground="{DynamicResource SecondaryTextBrush}" Margin="0,0,0,8" HorizontalAlignment="Center"/>
- <Grid Margin="0,0,0,12">
- <Grid.RowDefinitions><RowDefinition Height="Auto"/><RowDefinition Height="Auto"/></Grid.RowDefinitions>
- <Grid.ColumnDefinitions><ColumnDefinition Width="*"/><ColumnDefinition Width="*"/><ColumnDefinition Width="*"/></Grid.ColumnDefinitions>
- <Button Grid.Row="0" Grid.Column="0" Content="X+" Tag="X+" Style="{StaticResource JogButton}" Click="BtnJog_Click"/>
- <Button Grid.Row="0" Grid.Column="1" Content="Y+" Tag="Y+" Style="{StaticResource JogButton}" Click="BtnJog_Click"/>
- <Button Grid.Row="0" Grid.Column="2" Content="Z+" Tag="Z+" Style="{StaticResource JogButton}" Click="BtnJog_Click"/>
- <Button Grid.Row="1" Grid.Column="0" Content="X-" Tag="X-" Style="{StaticResource JogButton}" Click="BtnJog_Click"/>
- <Button Grid.Row="1" Grid.Column="1" Content="Y-" Tag="Y-" Style="{StaticResource JogButton}" Click="BtnJog_Click"/>
- <Button Grid.Row="1" Grid.Column="2" Content="Z-" Tag="Z-" Style="{StaticResource JogButton}" Click="BtnJog_Click"/>
- </Grid>
- <Border Height="1" Background="{DynamicResource BorderBrush}" Margin="0,0,0,12"/>
- <TextBlock Text="{loc:Translate '旋转轴 (U / V / W)'}" FontSize="11" Foreground="{DynamicResource SecondaryTextBrush}" Margin="0,0,0,8" HorizontalAlignment="Center"/>
- <Grid>
- <Grid.RowDefinitions><RowDefinition Height="Auto"/><RowDefinition Height="Auto"/></Grid.RowDefinitions>
- <Grid.ColumnDefinitions><ColumnDefinition Width="*"/><ColumnDefinition Width="*"/><ColumnDefinition Width="*"/></Grid.ColumnDefinitions>
- <Button Grid.Row="0" Grid.Column="0" Content="U+" Tag="U+" Style="{StaticResource JogButton}" Click="BtnJog_Click"/>
- <Button Grid.Row="0" Grid.Column="1" Content="V+" Tag="V+" Style="{StaticResource JogButton}" Click="BtnJog_Click"/>
- <Button Grid.Row="0" Grid.Column="2" Content="W+" Tag="W+" Style="{StaticResource JogButton}" Click="BtnJog_Click"/>
- <Button Grid.Row="1" Grid.Column="0" Content="U-" Tag="U-" Style="{StaticResource JogButton}" Click="BtnJog_Click"/>
- <Button Grid.Row="1" Grid.Column="1" Content="V-" Tag="V-" Style="{StaticResource JogButton}" Click="BtnJog_Click"/>
- <Button Grid.Row="1" Grid.Column="2" Content="W-" Tag="W-" Style="{StaticResource JogButton}" Click="BtnJog_Click"/>
- </Grid>
- </StackPanel>
- </Border>
- </StackPanel>
- </DockPanel>
- </Border>
- </UserControl>
|