| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312 |
- <UserControl x:Class="TeamAAS.Motion.MotionDebugView"
- 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"
- Background="Transparent">
- <UserControl.Resources>
- <Style x:Key="SectionCard" TargetType="Border">
- <Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}"/>
- <Setter Property="CornerRadius" Value="6"/>
- <Setter Property="Padding" Value="12"/>
- <Setter Property="Margin" Value="0,0,0,10"/>
- </Style>
- <Style x:Key="SectionTitle" TargetType="TextBlock">
- <Setter Property="FontSize" Value="11"/>
- <Setter Property="FontWeight" Value="SemiBold"/>
- <Setter Property="Foreground" Value="{DynamicResource SecondaryTextBrush}"/>
- <Setter Property="Margin" Value="0,0,0,8"/>
- </Style>
- <Style x:Key="MetricLabel" TargetType="TextBlock">
- <Setter Property="FontSize" Value="11"/>
- <Setter Property="Foreground" Value="{DynamicResource SecondaryTextBrush}"/>
- </Style>
- <Style x:Key="MetricValue" TargetType="TextBlock">
- <Setter Property="FontFamily" Value="Consolas"/>
- <Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
- </Style>
- <Style x:Key="FieldLabel" TargetType="TextBlock">
- <Setter Property="FontSize" Value="12"/>
- <Setter Property="VerticalAlignment" Value="Center"/>
- <Setter Property="Margin" Value="0,0,8,0"/>
- <Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
- </Style>
- <Style x:Key="FieldBox" TargetType="TextBox">
- <Setter Property="MinWidth" Value="88"/>
- <Setter Property="Height" Value="28"/>
- <Setter Property="VerticalContentAlignment" Value="Center"/>
- <Setter Property="Padding" Value="6,2"/>
- </Style>
- <Style x:Key="StatusTile" TargetType="Border">
- <Setter Property="CornerRadius" Value="6"/>
- <Setter Property="Padding" Value="10,12"/>
- <Setter Property="Margin" Value="0,0,8,0"/>
- <Setter Property="MinHeight" Value="72"/>
- </Style>
- <Style x:Key="IoBitButton" TargetType="ToggleButton">
- <Setter Property="Foreground" Value="White"/>
- <Setter Property="BorderThickness" Value="0"/>
- <Setter Property="Cursor" Value="Hand"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ToggleButton">
- <Border Background="{TemplateBinding Background}" CornerRadius="4"
- Padding="2" Opacity="{TemplateBinding Opacity}">
- <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </UserControl.Resources>
- <DockPanel Margin="4">
- <DockPanel DockPanel.Dock="Top" Margin="4,2,4,10">
- <TextBlock DockPanel.Dock="Left" Text="{loc:Translate '运动调试'}"
- FontSize="15" FontWeight="Bold" VerticalAlignment="Center"
- Foreground="{DynamicResource PrimaryTextBrush}"/>
- <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
- <TextBlock Text="{loc:Translate '当前轴'}" Style="{StaticResource FieldLabel}"/>
- <ComboBox x:Name="CmbAxis" Width="160" Height="28"
- SelectionChanged="CmbAxis_SelectionChanged">
- <ComboBox.ItemTemplate>
- <DataTemplate>
- <TextBlock>
- <TextBlock.Text>
- <MultiBinding StringFormat="{}{0} (轴{1})">
- <Binding Path="Name"/>
- <Binding Path="AxisNo"/>
- </MultiBinding>
- </TextBlock.Text>
- </TextBlock>
- </DataTemplate>
- </ComboBox.ItemTemplate>
- </ComboBox>
- </StackPanel>
- </DockPanel>
- <Border DockPanel.Dock="Top" Style="{StaticResource SectionCard}" Padding="12,8" Margin="0,0,0,10">
- <DockPanel>
- <StackPanel DockPanel.Dock="Left" Orientation="Horizontal" VerticalAlignment="Center">
- <Ellipse x:Name="DotConn" Width="9" Height="9" Fill="#9E9E9E" Margin="0,0,8,0"/>
- <TextBlock Text="{loc:Translate '状态'}" FontSize="12"
- Foreground="{DynamicResource SecondaryTextBrush}" Margin="0,0,6,0"/>
- <TextBlock x:Name="TxtStatus" FontSize="12" FontWeight="Bold"
- Foreground="{DynamicResource PrimaryTextBrush}" Text="---"/>
- </StackPanel>
- <TextBlock x:Name="TxtMessage" FontSize="12" TextWrapping="Wrap"
- VerticalAlignment="Center" Margin="16,0,0,0"
- Foreground="{DynamicResource SecondaryTextBrush}"/>
- </DockPanel>
- </Border>
- <TabControl x:Name="TabsMain">
- <TabItem Header="{loc:Translate '轴'}">
- <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" Padding="4,8,4,4">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="1.1*"/>
- <ColumnDefinition Width="16"/>
- <ColumnDefinition Width="1.2*"/>
- </Grid.ColumnDefinitions>
- <!-- 左侧:实时状态 -->
- <StackPanel Grid.Column="0">
- <Border x:Name="BannerSafety" CornerRadius="6" Padding="16,18" Margin="0,0,0,10"
- Background="#B71C1C" Visibility="Collapsed">
- <StackPanel>
- <TextBlock x:Name="TxtSafetyHeadline" Text="急停有效"
- FontSize="26" FontWeight="Bold" Foreground="White"/>
- <TextBlock x:Name="TxtSafetyHint"
- Text="所有轴已下使能,手动/自动使能与运动均被禁止。"
- FontSize="14" FontWeight="SemiBold" Foreground="#FFECB3"
- Margin="0,8,0,0" TextWrapping="Wrap"/>
- </StackPanel>
- </Border>
- <Border x:Name="BannerState" CornerRadius="6" Padding="14,16" Margin="0,0,0,10" Background="#616161">
- <StackPanel>
- <TextBlock x:Name="TxtAxisTitle" Text="---" FontSize="12" Foreground="#E0E0E0" Margin="0,0,0,6"/>
- <TextBlock x:Name="TxtStateHeadline" Text="未选择轴" FontSize="22" FontWeight="Bold" Foreground="White"/>
- <TextBlock x:Name="TxtStateHint" Text="请选择轴并连接控制卡" FontSize="12" Foreground="#F5F5F5" Margin="0,6,0,0" TextWrapping="Wrap"/>
- </StackPanel>
- </Border>
- <UniformGrid Columns="3" Margin="0,0,0,10">
- <Border x:Name="TileEnable" Style="{StaticResource StatusTile}" Margin="0,0,6,0" Background="#757575">
- <StackPanel VerticalAlignment="Center">
- <TextBlock Text="{loc:Translate '使能'}" FontSize="11" Foreground="#EEEEEE"/>
- <TextBlock x:Name="TxtEnable" Text="未使能" FontSize="16" FontWeight="Bold" Foreground="White" Margin="0,4,0,0"/>
- </StackPanel>
- </Border>
- <Border x:Name="TileMoving" Style="{StaticResource StatusTile}" Margin="3,0,3,0" Background="#757575">
- <StackPanel VerticalAlignment="Center">
- <TextBlock Text="{loc:Translate '运动'}" FontSize="11" Foreground="#EEEEEE"/>
- <TextBlock x:Name="TxtMoving" Text="静止" FontSize="16" FontWeight="Bold" Foreground="White" Margin="0,4,0,0"/>
- </StackPanel>
- </Border>
- <Border x:Name="TileHomed" Style="{StaticResource StatusTile}" Margin="6,0,0,0" Background="#757575">
- <StackPanel VerticalAlignment="Center">
- <TextBlock Text="{loc:Translate '回零'}" FontSize="11" Foreground="#EEEEEE"/>
- <TextBlock x:Name="TxtHomed" Text="未回零" FontSize="16" FontWeight="Bold" Foreground="White" Margin="0,4,0,0"/>
- </StackPanel>
- </Border>
- </UniformGrid>
- <Border Style="{StaticResource SectionCard}">
- <StackPanel>
- <TextBlock Text="{loc:Translate '位置 / 速度'}" Style="{StaticResource SectionTitle}"/>
- <TextBlock Text="{loc:Translate '实际位置'}" Style="{StaticResource MetricLabel}"/>
- <TextBlock x:Name="TxtPosActual" Text="---" FontSize="28" FontWeight="Bold"
- Style="{StaticResource MetricValue}" Margin="0,2,0,10"/>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="*"/>
- </Grid.ColumnDefinitions>
- <StackPanel Grid.Column="0">
- <TextBlock Text="{loc:Translate '指令位置'}" Style="{StaticResource MetricLabel}"/>
- <TextBlock x:Name="TxtPosCommand" Text="---" FontSize="16"
- Style="{StaticResource MetricValue}" Margin="0,2,0,0"/>
- </StackPanel>
- <StackPanel Grid.Column="1">
- <TextBlock Text="{loc:Translate '实际速度'}" Style="{StaticResource MetricLabel}"/>
- <TextBlock x:Name="TxtVelocity" Text="---" FontSize="16"
- Style="{StaticResource MetricValue}" Margin="0,2,0,0"/>
- </StackPanel>
- </Grid>
- </StackPanel>
- </Border>
- </StackPanel>
- <!-- 右侧:操作 -->
- <StackPanel x:Name="OpsRoot" Grid.Column="2" IsEnabled="False">
- <Border Style="{StaticResource SectionCard}">
- <StackPanel>
- <TextBlock Text="{loc:Translate '轴控制'}" Style="{StaticResource SectionTitle}"/>
- <WrapPanel>
- <Button x:Name="BtnEnable" Content="{loc:Translate '使能'}" Style="{DynamicResource ButtonPrimary}"
- Padding="16,6" Margin="0,0,8,8" Click="BtnEnable_Click"/>
- <Button x:Name="BtnDisable" Content="{loc:Translate '下使能'}" Style="{DynamicResource ButtonDefault}"
- Padding="16,6" Margin="0,0,8,8" Click="BtnDisable_Click"/>
- <Button x:Name="BtnStop" Content="{loc:Translate '停止'}" Style="{DynamicResource ButtonDefault}"
- Padding="16,6" Margin="0,0,8,8" Click="BtnStop_Click"/>
- <Button Content="{loc:Translate '急停'}" Style="{DynamicResource ButtonDanger}"
- Padding="16,6" Margin="0,0,0,8" Click="BtnEStop_Click"/>
- </WrapPanel>
- </StackPanel>
- </Border>
- <TextBlock x:Name="TxtNeedEnable" Text="{loc:Translate '当前未使能,请先点击「使能」后再点动或定位'}"
- FontSize="12" FontWeight="SemiBold" Foreground="#E53935" Margin="0,0,0,8"
- TextWrapping="Wrap" Visibility="Collapsed"/>
- <StackPanel x:Name="MotionOps">
- <Border Style="{StaticResource SectionCard}">
- <StackPanel>
- <DockPanel Margin="0,0,0,4">
- <TextBlock Text="{loc:Translate '点动'}" Style="{StaticResource SectionTitle}" Margin="0"/>
- <TextBlock DockPanel.Dock="Right" HorizontalAlignment="Right"
- Text="{loc:Translate '按住移动,松开停止'}"
- FontSize="11" Foreground="{DynamicResource SecondaryTextBrush}"/>
- </DockPanel>
- <StackPanel Orientation="Horizontal" Margin="0,8,0,10">
- <TextBlock Text="{loc:Translate '速度'}" Style="{StaticResource FieldLabel}"/>
- <TextBox x:Name="TxtJogVel" Text="50" Style="{StaticResource FieldBox}"/>
- </StackPanel>
- <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
- <Button Content="−" Tag="-" Style="{DynamicResource ButtonDefault}"
- Width="88" Height="48" FontSize="20" FontWeight="Bold" Margin="0,0,8,0"
- PreviewMouseLeftButtonDown="BtnJog_Down"
- PreviewMouseLeftButtonUp="BtnJog_Up"
- LostMouseCapture="BtnJog_LostCapture"/>
- <Button Content="+" Tag="+" Style="{DynamicResource ButtonPrimary}"
- Width="88" Height="48" FontSize="20" FontWeight="Bold"
- PreviewMouseLeftButtonDown="BtnJog_Down"
- PreviewMouseLeftButtonUp="BtnJog_Up"
- LostMouseCapture="BtnJog_LostCapture"/>
- </StackPanel>
- </StackPanel>
- </Border>
- <Border Style="{StaticResource SectionCard}">
- <StackPanel>
- <TextBlock Text="{loc:Translate '定位'}" Style="{StaticResource SectionTitle}"/>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto"/>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="Auto"/>
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- </Grid.RowDefinitions>
- <TextBlock Grid.Row="0" Grid.Column="0" Text="{loc:Translate '定位速度'}" Style="{StaticResource FieldLabel}" Margin="0,0,8,8"/>
- <TextBox x:Name="TxtMoveVel" Grid.Row="0" Grid.Column="1" Text="100" Style="{StaticResource FieldBox}" Margin="0,0,8,8"/>
- <TextBlock Grid.Row="1" Grid.Column="0" Text="{loc:Translate '目标位置'}" Style="{StaticResource FieldLabel}" Margin="0,0,8,8"/>
- <TextBox x:Name="TxtTargetPos" Grid.Row="1" Grid.Column="1" Text="0" Style="{StaticResource FieldBox}" Margin="0,0,8,8"/>
- <Button Grid.Row="1" Grid.Column="2" Content="{loc:Translate '绝对定位'}"
- Style="{DynamicResource ButtonPrimary}" Padding="16,6" Margin="0,0,0,8"
- Click="BtnMoveAbs_Click"/>
- <TextBlock Grid.Row="2" Grid.Column="0" Text="{loc:Translate '相对距离'}" Style="{StaticResource FieldLabel}" Margin="0,0,8,0"/>
- <TextBox x:Name="TxtRelativeDist" Grid.Row="2" Grid.Column="1" Text="10" Style="{StaticResource FieldBox}" Margin="0,0,8,0"/>
- <Button Grid.Row="2" Grid.Column="2" Content="{loc:Translate '相对定位'}"
- Style="{DynamicResource ButtonDefault}" Padding="16,6" Margin="0"
- Click="BtnMoveRel_Click"/>
- </Grid>
- <WrapPanel Margin="0,10,0,0">
- <Button Content="{loc:Translate '回零'}" Style="{DynamicResource ButtonDefault}"
- Padding="16,6" Margin="0,0,8,0" Click="BtnHome_Click"/>
- <Button Content="{loc:Translate '位置清零'}" Style="{DynamicResource ButtonDefault}"
- Padding="16,6" Click="BtnSetZero_Click"/>
- </WrapPanel>
- </StackPanel>
- </Border>
- </StackPanel>
- </StackPanel>
- </Grid>
- </ScrollViewer>
- </TabItem>
- <TabItem Header="{loc:Translate 'IO'}">
- <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" Padding="4,8,4,4">
- <StackPanel x:Name="IoRoot" IsEnabled="False">
- <TextBlock x:Name="TxtIoHint"
- Text="{loc:Translate '本地端子与 EtherCAT 扩展点号相互独立。仿真卡可点击 DI 模拟输入;真实卡 DI 只读,DO 点击翻转。急停/停止点会标红或橙色。'}"
- TextWrapping="Wrap" FontSize="12" Margin="0,0,0,12"
- Foreground="{DynamicResource SecondaryTextBrush}"/>
- <Border Style="{StaticResource SectionCard}">
- <StackPanel>
- <TextBlock Text="{loc:Translate '本地 DI'}" Style="{StaticResource SectionTitle}"/>
- <WrapPanel x:Name="PanelLocalDi"/>
- </StackPanel>
- </Border>
- <Border Style="{StaticResource SectionCard}">
- <StackPanel>
- <TextBlock Text="{loc:Translate '本地 DO'}" Style="{StaticResource SectionTitle}"/>
- <WrapPanel x:Name="PanelLocalDo"/>
- </StackPanel>
- </Border>
- <Border Style="{StaticResource SectionCard}">
- <StackPanel>
- <TextBlock Text="{loc:Translate 'EtherCAT DI'}" Style="{StaticResource SectionTitle}"/>
- <WrapPanel x:Name="PanelEcatDi"/>
- </StackPanel>
- </Border>
- <Border Style="{StaticResource SectionCard}">
- <StackPanel>
- <TextBlock Text="{loc:Translate 'EtherCAT DO'}" Style="{StaticResource SectionTitle}"/>
- <WrapPanel x:Name="PanelEcatDo"/>
- </StackPanel>
- </Border>
- </StackPanel>
- </ScrollViewer>
- </TabItem>
- </TabControl>
- </DockPanel>
- </UserControl>
|