修改主页面右侧硬件栏目宽度,运动控制修改增加图标按钮切换。
@@ -136,6 +136,27 @@ namespace XP.Common.Controls
|
||||
|
||||
#endregion
|
||||
|
||||
#region SwapMouseButtons 依赖属性 | SwapMouseButtons Dependency Property
|
||||
|
||||
public static readonly DependencyProperty SwapMouseButtonsProperty =
|
||||
DependencyProperty.Register(nameof(SwapMouseButtons), typeof(bool), typeof(VirtualJoystick),
|
||||
new PropertyMetadata(false, OnSwapMouseButtonsChanged));
|
||||
|
||||
/// <summary>是否交换左右键功能 | Whether to swap left and right button functions</summary>
|
||||
public bool SwapMouseButtons
|
||||
{
|
||||
get => (bool)GetValue(SwapMouseButtonsProperty);
|
||||
set => SetValue(SwapMouseButtonsProperty, value);
|
||||
}
|
||||
|
||||
private static void OnSwapMouseButtonsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (d is VirtualJoystick joystick)
|
||||
joystick.UpdateIconVisibility();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 四向图标依赖属性 | Directional Icon Dependency Properties
|
||||
|
||||
// 左键图标 | Left button icons
|
||||
@@ -185,7 +206,9 @@ namespace XP.Common.Controls
|
||||
{
|
||||
base.OnMouseLeftButtonDown(e);
|
||||
if (_isDragging || !IsEnabled) return;
|
||||
StartDrag(MouseButtonType.Left);
|
||||
// 如果启用了左右键交换,则左键触发右键逻辑,反之亦然
|
||||
var buttonType = SwapMouseButtons ? MouseButtonType.Right : MouseButtonType.Left;
|
||||
StartDrag(buttonType);
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
@@ -193,7 +216,9 @@ namespace XP.Common.Controls
|
||||
{
|
||||
base.OnMouseRightButtonDown(e);
|
||||
if (_isDragging || !IsEnabled) return;
|
||||
StartDrag(MouseButtonType.Right);
|
||||
// 如果启用了左右键交换,则右键触发左键逻辑,反之亦然
|
||||
var buttonType = SwapMouseButtons ? MouseButtonType.Left : MouseButtonType.Right;
|
||||
StartDrag(buttonType);
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
@@ -233,7 +258,10 @@ namespace XP.Common.Controls
|
||||
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
|
||||
{
|
||||
base.OnMouseLeftButtonUp(e);
|
||||
if (!_isDragging || ActiveMouseButton != MouseButtonType.Left) return;
|
||||
if (!_isDragging) return;
|
||||
// 结束拖拽时,根据当前实际按下的按钮类型判断
|
||||
var expectedType = SwapMouseButtons ? MouseButtonType.Right : MouseButtonType.Left;
|
||||
if (ActiveMouseButton != expectedType) return;
|
||||
EndDrag();
|
||||
e.Handled = true;
|
||||
}
|
||||
@@ -241,7 +269,10 @@ namespace XP.Common.Controls
|
||||
protected override void OnMouseRightButtonUp(MouseButtonEventArgs e)
|
||||
{
|
||||
base.OnMouseRightButtonUp(e);
|
||||
if (!_isDragging || ActiveMouseButton != MouseButtonType.Right) return;
|
||||
if (!_isDragging) return;
|
||||
// 结束拖拽时,根据当前实际按下的按钮类型判断
|
||||
var expectedType = SwapMouseButtons ? MouseButtonType.Left : MouseButtonType.Right;
|
||||
if (ActiveMouseButton != expectedType) return;
|
||||
EndDrag();
|
||||
e.Handled = true;
|
||||
}
|
||||
@@ -326,16 +357,21 @@ namespace XP.Common.Controls
|
||||
SetVisibility(Visibility.Visible, defaultTop, defaultBottom, defaultLeft, defaultRight);
|
||||
|
||||
// 根据 ActiveMouseButton 切换 | Switch based on ActiveMouseButton
|
||||
// 如果启用了左右键交换,则显示相反的图标组
|
||||
switch (ActiveMouseButton)
|
||||
{
|
||||
case MouseButtonType.Left:
|
||||
SetVisibility(Visibility.Collapsed, defaultTop, defaultBottom, defaultLeft, defaultRight);
|
||||
SetVisibility(Visibility.Visible, leftTop, leftBottom, leftLeft, leftRight);
|
||||
// 如果交换了左右键,这里显示的是右键图标组
|
||||
var leftIcons = SwapMouseButtons ? new[] { rightTop, rightBottom, rightLeft, rightRight } : new[] { leftTop, leftBottom, leftLeft, leftRight };
|
||||
SetVisibility(Visibility.Visible, leftIcons);
|
||||
if (_thumbElement != null) _thumbElement.Fill = new SolidColorBrush(Color.FromRgb(0x3A, 0x7B, 0xC8));
|
||||
break;
|
||||
case MouseButtonType.Right:
|
||||
SetVisibility(Visibility.Collapsed, defaultTop, defaultBottom, defaultLeft, defaultRight);
|
||||
SetVisibility(Visibility.Visible, rightTop, rightBottom, rightLeft, rightRight);
|
||||
// 如果交换了左右键,这里显示的是左键图标组
|
||||
var rightIcons = SwapMouseButtons ? new[] { leftTop, leftBottom, leftLeft, leftRight } : new[] { rightTop, rightBottom, rightLeft, rightRight };
|
||||
SetVisibility(Visibility.Visible, rightIcons);
|
||||
if (_thumbElement != null) _thumbElement.Fill = new SolidColorBrush(Color.FromRgb(0x5B, 0xA8, 0x5B));
|
||||
break;
|
||||
default:
|
||||
|
||||
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 6.3 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 8.0 KiB |
|
After Width: | Height: | Size: 8.8 KiB |
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
@@ -82,6 +82,7 @@ namespace XP.Hardware.MotionControl.ViewModels
|
||||
|
||||
// 初始化命令 | Initialize commands
|
||||
ToggleEnableCommand = new DelegateCommand(ExecuteToggleEnable, () => IsPlcConnected);
|
||||
ToggleSwapMouseButtonsCommand = new DelegateCommand(ExecuteToggleSwapMouseButtons);
|
||||
SavePositionsCommand = new DelegateCommand(ExecuteSavePositions);
|
||||
RestorePositionsCommand = new DelegateCommand(ExecuteRestorePositions, () => _savedPositions != null && IsPlcConnected);
|
||||
|
||||
@@ -254,6 +255,10 @@ namespace XP.Hardware.MotionControl.ViewModels
|
||||
/// <summary>摇杆使能状态 | Joystick enable state</summary>
|
||||
public bool IsJoystickEnabled { get => _isJoystickEnabled; set => SetProperty(ref _isJoystickEnabled, value); }
|
||||
|
||||
private bool _swapMouseButtons;
|
||||
/// <summary>是否交换摇杆左右键功能 | Whether to swap left and right joystick button functions</summary>
|
||||
public bool SwapMouseButtons { get => _swapMouseButtons; set => SetProperty(ref _swapMouseButtons, value); }
|
||||
|
||||
private bool _isPlcConnected;
|
||||
/// <summary>PLC 连接状态 | PLC connection status</summary>
|
||||
public bool IsPlcConnected { get => _isPlcConnected; set => SetProperty(ref _isPlcConnected, value); }
|
||||
@@ -264,11 +269,21 @@ namespace XP.Hardware.MotionControl.ViewModels
|
||||
|
||||
#endregion
|
||||
|
||||
#region 保存位置状态 | Saved Positions State
|
||||
|
||||
/// <summary>是否有保存的位置数据 | Whether saved position data exists</summary>
|
||||
public bool HasSavedPositions => _savedPositions != null;
|
||||
|
||||
#endregion
|
||||
|
||||
#region 命令 | Commands
|
||||
|
||||
/// <summary>切换使能开关命令 | Toggle enable switch command</summary>
|
||||
public DelegateCommand ToggleEnableCommand { get; }
|
||||
|
||||
/// <summary>切换摇杆左右键功能命令 | Toggle joystick button swap command</summary>
|
||||
public DelegateCommand ToggleSwapMouseButtonsCommand { get; }
|
||||
|
||||
/// <summary>保存当前轴位置命令 | Save current axis positions command</summary>
|
||||
public DelegateCommand SavePositionsCommand { get; }
|
||||
|
||||
@@ -375,6 +390,7 @@ namespace XP.Hardware.MotionControl.ViewModels
|
||||
private void RaiseCommandCanExecuteChanged()
|
||||
{
|
||||
ToggleEnableCommand.RaiseCanExecuteChanged();
|
||||
ToggleSwapMouseButtonsCommand.RaiseCanExecuteChanged();
|
||||
SavePositionsCommand.RaiseCanExecuteChanged();
|
||||
RestorePositionsCommand.RaiseCanExecuteChanged();
|
||||
}
|
||||
@@ -440,6 +456,15 @@ namespace XP.Hardware.MotionControl.ViewModels
|
||||
// TODO: 发送使能状态到 PLC(根据实际 PLC 信号定义)| Send enable state to PLC (based on actual PLC signal definition)
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 切换左右键交换状态 | Toggle swap mouse buttons state
|
||||
/// </summary>
|
||||
private void ExecuteToggleSwapMouseButtons()
|
||||
{
|
||||
SwapMouseButtons = !SwapMouseButtons;
|
||||
_logger.Info("摇杆左右键功能交换:{Enabled} | Joystick button swap toggled: {Enabled}", SwapMouseButtons);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存当前 6 个轴位置到内部变量 | Save current 6 axis positions to internal variable
|
||||
/// </summary>
|
||||
@@ -456,6 +481,7 @@ namespace XP.Hardware.MotionControl.ViewModels
|
||||
FixtureRotation = FixtureRotationAngle
|
||||
};
|
||||
RestorePositionsCommand.RaiseCanExecuteChanged();
|
||||
RaisePropertyChanged(nameof(HasSavedPositions));
|
||||
_logger.Info("轴位置已保存 | Axis positions saved");
|
||||
}
|
||||
|
||||
|
||||
@@ -61,25 +61,25 @@
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" Text="{loc:Localization AC_StageX}" FontSize="11" VerticalAlignment="Center" Margin="3,1,1,1"/>
|
||||
<telerik:RadNumericUpDown Grid.Row="0" Grid.Column="0" x:Name="NumStageX" Value="{Binding StageXPosition, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ValueFormat="Numeric" NumberDecimalDigits="1" SmallChange="0.1" IsEditable="True" GotFocus="NumStageX_GotFocus" LostFocus="NumStageX_LostFocus" KeyDown="NumStageX_KeyDown" Margin="0,1" Height="24" FontSize="11" telerik:StyleManager.Theme="Crystal"/>
|
||||
<telerik:RadNumericUpDown Grid.Row="0" Grid.Column="0" x:Name="NumStageX" Value="{Binding StageXPosition, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ValueFormat="Numeric" NumberDecimalDigits="3" SmallChange="0.1" IsEditable="True" GotFocus="NumStageX_GotFocus" LostFocus="NumStageX_LostFocus" KeyDown="NumStageX_KeyDown" Margin="0,1" Height="24" FontSize="11" telerik:StyleManager.Theme="Crystal"/>
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="1" Text="{loc:Localization AC_StageY}" FontSize="11" VerticalAlignment="Center" Margin="3,1,1,1"/>
|
||||
<telerik:RadNumericUpDown Grid.Row="1" Grid.Column="0" x:Name="NumStageY" Value="{Binding StageYPosition, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ValueFormat="Numeric" NumberDecimalDigits="1" SmallChange="0.1" IsEditable="True" GotFocus="NumStageY_GotFocus" LostFocus="NumStageY_LostFocus" KeyDown="NumStageY_KeyDown" Margin="0,1" Height="24" FontSize="11" telerik:StyleManager.Theme="Crystal"/>
|
||||
<telerik:RadNumericUpDown Grid.Row="1" Grid.Column="0" x:Name="NumStageY" Value="{Binding StageYPosition, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ValueFormat="Numeric" NumberDecimalDigits="3" SmallChange="0.1" IsEditable="True" GotFocus="NumStageY_GotFocus" LostFocus="NumStageY_LostFocus" KeyDown="NumStageY_KeyDown" Margin="0,1" Height="24" FontSize="11" telerik:StyleManager.Theme="Crystal"/>
|
||||
|
||||
<TextBlock Grid.Row="2" Grid.Column="1" Text="{loc:Localization AC_SourceZ}" FontSize="11" VerticalAlignment="Center" Margin="3,1,1,1"/>
|
||||
<telerik:RadNumericUpDown Grid.Row="2" Grid.Column="0" x:Name="NumSourceZ" Value="{Binding SourceZPosition, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ValueFormat="Numeric" NumberDecimalDigits="1" SmallChange="0.1" IsEditable="True" GotFocus="NumSourceZ_GotFocus" LostFocus="NumSourceZ_LostFocus" KeyDown="NumSourceZ_KeyDown" Margin="0,1" Height="24" FontSize="11" telerik:StyleManager.Theme="Crystal"/>
|
||||
<telerik:RadNumericUpDown Grid.Row="2" Grid.Column="0" x:Name="NumSourceZ" Value="{Binding SourceZPosition, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ValueFormat="Numeric" NumberDecimalDigits="3" SmallChange="0.1" IsEditable="True" GotFocus="NumSourceZ_GotFocus" LostFocus="NumSourceZ_LostFocus" KeyDown="NumSourceZ_KeyDown" Margin="0,1" Height="24" FontSize="11" telerik:StyleManager.Theme="Crystal"/>
|
||||
|
||||
<TextBlock Grid.Row="3" Grid.Column="1" Text="{loc:Localization AC_DetectorZ}" FontSize="11" VerticalAlignment="Center" Margin="3,1,1,1"/>
|
||||
<telerik:RadNumericUpDown Grid.Row="3" Grid.Column="0" x:Name="NumDetectorZ" Value="{Binding DetectorZPosition, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ValueFormat="Numeric" NumberDecimalDigits="1" SmallChange="0.1" IsEditable="True" GotFocus="NumDetectorZ_GotFocus" LostFocus="NumDetectorZ_LostFocus" KeyDown="NumDetectorZ_KeyDown" Margin="0,1" Height="24" FontSize="11" telerik:StyleManager.Theme="Crystal"/>
|
||||
<telerik:RadNumericUpDown Grid.Row="3" Grid.Column="0" x:Name="NumDetectorZ" Value="{Binding DetectorZPosition, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ValueFormat="Numeric" NumberDecimalDigits="3" SmallChange="0.1" IsEditable="True" GotFocus="NumDetectorZ_GotFocus" LostFocus="NumDetectorZ_LostFocus" KeyDown="NumDetectorZ_KeyDown" Margin="0,1" Height="24" FontSize="11" telerik:StyleManager.Theme="Crystal"/>
|
||||
|
||||
<TextBlock Grid.Row="4" Grid.Column="1" Text="{loc:Localization AC_DetectorSwing}" FontSize="11" VerticalAlignment="Center" Margin="3,1,1,1" Visibility="{Binding DetectorSwingVisibility}"/>
|
||||
<telerik:RadNumericUpDown Grid.Row="4" Grid.Column="0" x:Name="NumDetSwing" Value="{Binding DetectorSwingAngle, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ValueFormat="Numeric" NumberDecimalDigits="1" SmallChange="0.1" IsEditable="True" GotFocus="NumDetSwing_GotFocus" LostFocus="NumDetSwing_LostFocus" KeyDown="NumDetSwing_KeyDown" Visibility="{Binding DetectorSwingVisibility}" Margin="0,1" Height="24" FontSize="11" telerik:StyleManager.Theme="Crystal"/>
|
||||
<telerik:RadNumericUpDown Grid.Row="4" Grid.Column="0" x:Name="NumDetSwing" Value="{Binding DetectorSwingAngle, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ValueFormat="Numeric" NumberDecimalDigits="3" SmallChange="0.1" IsEditable="True" GotFocus="NumDetSwing_GotFocus" LostFocus="NumDetSwing_LostFocus" KeyDown="NumDetSwing_KeyDown" Visibility="{Binding DetectorSwingVisibility}" Margin="0,1" Height="24" FontSize="11" telerik:StyleManager.Theme="Crystal"/>
|
||||
|
||||
<TextBlock Grid.Row="5" Grid.Column="1" Text="{loc:Localization AC_StageRotation}" FontSize="11" VerticalAlignment="Center" Margin="3,1,1,1" Visibility="{Binding StageRotationVisibility}"/>
|
||||
<telerik:RadNumericUpDown Grid.Row="5" Grid.Column="0" x:Name="NumStageRot" Value="{Binding StageRotationAngle, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ValueFormat="Numeric" NumberDecimalDigits="1" SmallChange="0.1" IsEditable="True" GotFocus="NumStageRot_GotFocus" LostFocus="NumStageRot_LostFocus" KeyDown="NumStageRot_KeyDown" Visibility="{Binding StageRotationVisibility}" Margin="0,1" Height="24" FontSize="11" telerik:StyleManager.Theme="Crystal"/>
|
||||
<telerik:RadNumericUpDown Grid.Row="5" Grid.Column="0" x:Name="NumStageRot" Value="{Binding StageRotationAngle, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ValueFormat="Numeric" NumberDecimalDigits="3" SmallChange="0.1" IsEditable="True" GotFocus="NumStageRot_GotFocus" LostFocus="NumStageRot_LostFocus" KeyDown="NumStageRot_KeyDown" Visibility="{Binding StageRotationVisibility}" Margin="0,1" Height="24" FontSize="11" telerik:StyleManager.Theme="Crystal"/>
|
||||
|
||||
<TextBlock Grid.Row="6" Grid.Column="1" Text="{loc:Localization AC_FixtureRotation}" FontSize="11" VerticalAlignment="Center" Margin="3,1,1,1" Visibility="{Binding FixtureRotationVisibility}"/>
|
||||
<telerik:RadNumericUpDown Grid.Row="6" Grid.Column="0" x:Name="NumFixtureRot" Value="{Binding FixtureRotationAngle, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ValueFormat="Numeric" NumberDecimalDigits="1" SmallChange="0.1" IsEditable="True" GotFocus="NumFixtureRot_GotFocus" LostFocus="NumFixtureRot_LostFocus" KeyDown="NumFixtureRot_KeyDown" Visibility="{Binding FixtureRotationVisibility}" Margin="0,1" Height="24" FontSize="11" telerik:StyleManager.Theme="Crystal"/>
|
||||
<telerik:RadNumericUpDown Grid.Row="6" Grid.Column="0" x:Name="NumFixtureRot" Value="{Binding FixtureRotationAngle, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ValueFormat="Numeric" NumberDecimalDigits="3" SmallChange="0.1" IsEditable="True" GotFocus="NumFixtureRot_GotFocus" LostFocus="NumFixtureRot_LostFocus" KeyDown="NumFixtureRot_KeyDown" Visibility="{Binding FixtureRotationVisibility}" Margin="0,1" Height="24" FontSize="11" telerik:StyleManager.Theme="Crystal"/>
|
||||
</Grid>
|
||||
|
||||
<!-- ===== 右侧:摇杆区域 ===== -->
|
||||
@@ -90,6 +90,7 @@
|
||||
JoystickMode="SingleAxisY"
|
||||
Width="41" Height="150"
|
||||
IsEnabled="{Binding IsJoystickEnabled}"
|
||||
SwapMouseButtons="{Binding SwapMouseButtons}"
|
||||
DefaultTopIcon="↑" DefaultBottomIcon="↓"
|
||||
LeftButtonTopIcon="SZ↑" LeftButtonBottomIcon="SZ↓"
|
||||
RightButtonTopIcon="DZ↑" RightButtonBottomIcon="DZ↓"
|
||||
@@ -100,6 +101,7 @@
|
||||
JoystickMode="DualAxis"
|
||||
Width="150" Height="150"
|
||||
IsEnabled="{Binding IsJoystickEnabled}"
|
||||
SwapMouseButtons="{Binding SwapMouseButtons}"
|
||||
DefaultTopIcon="↑" DefaultBottomIcon="↓" DefaultLeftIcon="←" DefaultRightIcon="→"
|
||||
LeftButtonTopIcon="Y+" LeftButtonBottomIcon="Y-" LeftButtonLeftIcon="X-" LeftButtonRightIcon="X+"
|
||||
RightButtonTopIcon="R+" RightButtonBottomIcon="R-" RightButtonLeftIcon="DT-" RightButtonRightIcon="DT+"
|
||||
@@ -107,64 +109,110 @@
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- ========== 下部:安全参数(一行均布)+ 操作按钮(一行均布)========== -->
|
||||
<StackPanel Grid.Row="2" Margin="6">
|
||||
|
||||
<!-- 安全参数一行(均布)-->
|
||||
<Grid Margin="0,0,0,6">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="16"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Grid.Column="0" Text="{loc:Localization AC_SafetyHeight}"
|
||||
FontSize="11" VerticalAlignment="Center" Margin="0,0,4,0"/>
|
||||
<telerik:RadNumericUpDown Grid.Column="1" x:Name="NumSafetyHeight"
|
||||
Value="{Binding SafetyHeight, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
ValueFormat="Numeric" NumberDecimalDigits="2" SmallChange="0.1" IsEditable="True"
|
||||
KeyDown="NumSafetyHeight_KeyDown"
|
||||
Height="24" MinWidth="70" FontSize="11" telerik:StyleManager.Theme="Crystal"/>
|
||||
|
||||
<TextBlock Grid.Column="3" Text="{loc:Localization AC_CalibrationValue}"
|
||||
FontSize="11" VerticalAlignment="Center" Margin="0,0,4,0"/>
|
||||
<telerik:RadNumericUpDown Grid.Column="4" x:Name="NumCalibration"
|
||||
Value="{Binding CalibrationValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
ValueFormat="Numeric" NumberDecimalDigits="2" SmallChange="0.1" IsEditable="True"
|
||||
KeyDown="NumCalibration_KeyDown"
|
||||
Height="24" MinWidth="70" FontSize="11" telerik:StyleManager.Theme="Crystal"/>
|
||||
</Grid>
|
||||
<!-- ========== 下部:操作按钮(一行均布)========== -->
|
||||
<StackPanel Grid.Row="2" Margin="6,0,6,6">
|
||||
|
||||
<!-- 操作按钮一行(均布)-->
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="16"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- 使能开关 -->
|
||||
<TextBlock Grid.Column="0" Text="{loc:Localization AC_Enable}" FontSize="11" VerticalAlignment="Center" Margin="0,0,4,0"/>
|
||||
<telerik:RadToggleSwitchButton Grid.Column="1" IsChecked="{Binding IsJoystickEnabled, Mode=TwoWay}"
|
||||
<!-- 虚拟摇杆使能开关 -->
|
||||
<telerik:RadButton Grid.Column="1" Width="35" Height="24" Margin="0,0,8,0"
|
||||
Command="{Binding ToggleEnableCommand}"
|
||||
telerik:StyleManager.Theme="Crystal"/>
|
||||
ToolTip="{loc:Localization AC_Enable}"
|
||||
telerik:StyleManager.Theme="Crystal">
|
||||
<telerik:RadButton.Style>
|
||||
<Style TargetType="telerik:RadButton">
|
||||
<Setter Property="Content">
|
||||
<Setter.Value>
|
||||
<Image Source="pack://application:,,,/XP.Hardware.MotionControl;component/Resources/ToggleDisable.png" Width="15" Height="15"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsJoystickEnabled}" Value="True">
|
||||
<Setter Property="Content">
|
||||
<Setter.Value>
|
||||
<Image Source="pack://application:,,,/XP.Hardware.MotionControl;component/Resources/ToggleEnable.png" Width="15" Height="15"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</telerik:RadButton.Style>
|
||||
</telerik:RadButton>
|
||||
|
||||
<!-- 摇杆左右键功能切换开关 -->
|
||||
<telerik:RadButton Grid.Column="2" Width="35" Height="24" Margin="0,0,8,0"
|
||||
Command="{Binding ToggleSwapMouseButtonsCommand}"
|
||||
ToolTip="{loc:Localization AC_SwapMouseButtons}"
|
||||
telerik:StyleManager.Theme="Crystal">
|
||||
<telerik:RadButton.Style>
|
||||
<Style TargetType="telerik:RadButton">
|
||||
<Setter Property="Content">
|
||||
<Setter.Value>
|
||||
<Image Source="pack://application:,,,/XP.Hardware.MotionControl;component/Resources/SwingDisable.png" Width="19" Height="17"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding SwapMouseButtons}" Value="True">
|
||||
<Setter Property="Content">
|
||||
<Setter.Value>
|
||||
<Image Source="pack://application:,,,/XP.Hardware.MotionControl;component/Resources/SwingEnable.png" Width="17" Height="17"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</telerik:RadButton.Style>
|
||||
</telerik:RadButton>
|
||||
|
||||
<!-- 保存当前位置 -->
|
||||
<telerik:RadButton Grid.Column="3" Content="{loc:Localization AC_Save}"
|
||||
<telerik:RadButton Grid.Column="3" Width="35" Height="24" Margin="0,0,8,0"
|
||||
Command="{Binding SavePositionsCommand}"
|
||||
Height="24" MinWidth="80" Padding="8,0" FontSize="11"
|
||||
telerik:StyleManager.Theme="Crystal"/>
|
||||
ToolTip="{loc:Localization AC_Save}"
|
||||
telerik:StyleManager.Theme="Crystal">
|
||||
<telerik:RadButton.Style>
|
||||
<Style TargetType="telerik:RadButton">
|
||||
<Setter Property="Content">
|
||||
<Setter.Value>
|
||||
<Image Source="pack://application:,,,/XP.Hardware.MotionControl;component/Resources/SavePoint.png" Width="14" Height="14"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</telerik:RadButton.Style>
|
||||
</telerik:RadButton>
|
||||
|
||||
<!-- 恢复前一位置 -->
|
||||
<telerik:RadButton Grid.Column="5" Content="{loc:Localization AC_Restore}"
|
||||
<telerik:RadButton Grid.Column="4" Width="35" Height="24" Margin="0,0,8,0"
|
||||
Command="{Binding RestorePositionsCommand}"
|
||||
Height="24" MinWidth="80" Padding="8,0" FontSize="11"
|
||||
telerik:StyleManager.Theme="Crystal"/>
|
||||
ToolTip="{loc:Localization AC_Restore}"
|
||||
IsEnabled="{Binding HasSavedPositions}"
|
||||
telerik:StyleManager.Theme="Crystal">
|
||||
<telerik:RadButton.Style>
|
||||
<Style TargetType="telerik:RadButton">
|
||||
<Setter Property="Content">
|
||||
<Setter.Value>
|
||||
<Image Source="pack://application:,,,/XP.Hardware.MotionControl;component/Resources/BackPointDisable.png" Width="14" Height="14"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding HasSavedPositions}" Value="True">
|
||||
<Setter Property="Content">
|
||||
<Setter.Value>
|
||||
<Image Source="pack://application:,,,/XP.Hardware.MotionControl;component/Resources/BackPointEnable.png" Width="14" Height="14"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</telerik:RadButton.Style>
|
||||
</telerik:RadButton>
|
||||
</Grid>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
@@ -13,16 +13,29 @@
|
||||
<ProjectReference Include="..\XP.Hardware.PLC\XP.Hardware.PLC.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Update="Resources\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<Resource Include="Resources\*.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="Resources\Resources.Designer.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Resource Update="Resources\BackPointDisable.png">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
<Resource Update="Resources\BackPointEnable.png">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
<Resource Update="Resources\SavePoint.png">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
<Resource Update="Resources\SwingDisable.png">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
<Resource Update="Resources\SwingEnable.png">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
<Resource Update="Resources\ToggleDisable.png">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
<Resource Update="Resources\ToggleEnable.png">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -148,7 +148,7 @@
|
||||
<add key="MotionControl:FixtureRotation:Min" value="-90" />
|
||||
<add key="MotionControl:FixtureRotation:Max" value="90" />
|
||||
<add key="MotionControl:FixtureRotation:Origin" value="0" />
|
||||
<add key="MotionControl:FixtureRotation:Enabled" value="true" />
|
||||
<add key="MotionControl:FixtureRotation:Enabled" value="false" />
|
||||
<!-- 几何原点(mm)| Geometry origins (mm) -->
|
||||
<add key="MotionControl:Geometry:SourceZOrigin" value="0" />
|
||||
<add key="MotionControl:Geometry:DetectorZOrigin" value="600" />
|
||||
|
||||
@@ -514,7 +514,7 @@
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="{Binding ViewportPanelWidth}" />
|
||||
<ColumnDefinition Width="{Binding ImagePanelWidth}" />
|
||||
<ColumnDefinition Width="350" />
|
||||
<ColumnDefinition Width="370" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Border
|
||||
@@ -533,16 +533,16 @@
|
||||
|
||||
<Grid Grid.Column="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="350*" />
|
||||
<ColumnDefinition Width="370"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<views1:RaySourceOperateView Grid.Row="0" Grid.ColumnSpan="2" />
|
||||
<mcViews:AxisControlView Grid.Row="1" Grid.ColumnSpan="2" />
|
||||
<views:NavigationPropertyPanelView Grid.Row="2" Grid.ColumnSpan="2" />
|
||||
<views1:RaySourceOperateView Grid.Row="0" Margin="0,0,5,0" />
|
||||
<mcViews:AxisControlView Grid.Row="1" Margin="0,0,5,0" />
|
||||
<views:NavigationPropertyPanelView Grid.Row="2" Margin="0,0,5,0" Grid.RowSpan="2" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
<PropertyGroup>
|
||||
<TelerikDir>..\ExternalLibraries\Telerik</TelerikDir>
|
||||
<BaseOutputPath>..\bin\</BaseOutputPath>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Telerik.Windows.Controls">
|
||||
|
||||