Browse Source

新增 R轴 速度设定

jiangjy 1 month ago
parent
commit
9abcc9f414

+ 33 - 11
Furnace/FurnaceUI/Views/Maintenances/BoatRobotView.xaml

@@ -368,16 +368,38 @@
 
                 <!--<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Title}" Grid.Row="5" Grid.Column="0" Padding="5,1,0,1">
                     <TextBlock Text="Origin Done" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="14"  VerticalAlignment="Center" />
-                </Border>-->
-                <!--<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Row="5" Grid.Column="1">
+                </Border>
+                <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Row="5" Grid.Column="1">
                     <deviceControl:AITSensor CustomColorOn="#FF07FF07" IsCustomRender="True" CustomColorOff="Gray" LightOnValue="{Binding BoatRAxisIsInitDone}" EnableToolTip="False"/>
-                </Border>-->
-                <!--<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Title}" Grid.Row="5" Grid.Column ="2"  Padding="5,1">
+                </Border>
+                <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Title}" Grid.Row="5" Grid.Column ="2"  Padding="5,1">
                     <TextBlock Text="Origin" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="14"  VerticalAlignment="Center" />
-                </Border>-->
-                <!--<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Row="5" Grid.Column="3">
+                </Border>
+                <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Row="5" Grid.Column="3">
                     <deviceControl:AITSensor CustomColorOn="#FF07FF07" IsCustomRender="True" CustomColorOff="Gray" LightOnValue="{Binding BoatRAxisIsInitializing}" EnableToolTip="False"/>
                 </Border>-->
+                <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Title}" Grid.Row="6" Grid.Column="0" Padding="5,1,0,1">
+                    <TextBlock Text="Set Speed (rpm)" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="14"  VerticalAlignment="Center" />
+                </Border>
+
+                <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Row="6" Grid.Column="1">
+                    <TextBlock Text="{Binding RAxisMoveSpeed, StringFormat={}{0:f2},UpdateSourceTrigger=PropertyChanged}" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="14"  VerticalAlignment="Center" HorizontalAlignment="Center"/>
+                </Border>
+                <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Row="6" Grid.Column="2" Grid.ColumnSpan="2">
+                    <StackPanel   Orientation="Horizontal"  >
+                        <TextBox Text="{Binding RAxisMoveSpeed,Mode=OneTime}" x:Name="tbSetSpeed" HorizontalContentAlignment="Center" Width="90" Height="30" Tag="Number"></TextBox>
+                        <Button Content="Save" Width="80" Height="30" Margin="10,0,10,0">
+                            <i:Interaction.Triggers>
+                                <i:EventTrigger EventName="Click">
+                                    <cal:ActionMessage MethodName="BoatRSaveValue">
+                                        <cal:Parameter Value="MoveSpeed" />
+                                        <cal:Parameter Value="{Binding ElementName=tbSetSpeed}" />
+                                    </cal:ActionMessage>
+                                </i:EventTrigger>
+                            </i:Interaction.Triggers>
+                        </Button>
+                    </StackPanel>
+                </Border>
 
                 <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Title}" Grid.Row="5" Grid.Column="0" Padding="5,1,0,1">
                     <TextBlock Text="Rotation Direction" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="14"  VerticalAlignment="Center" />
@@ -385,9 +407,9 @@
                 <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Row="5" Grid.Column ="1" Padding="5,1">
                     <TextBlock Text="{Binding BoatRAxisDirection,StringFormat={}{0:f2}}" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="14"/>
                 </Border>
-                <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Title}" Grid.Row="5" Grid.Column="2" Grid.ColumnSpan="2" Padding="5,1,0,1">
-                    <StackPanel   Orientation="Horizontal"  >
-                        <Button Content="CW" Width="80" Height="30" Margin="40,0,10,0" IsEnabled="{Binding IsSystemStaus}">
+                <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Row="5" Grid.Column="2" Grid.ColumnSpan="2" Padding="5,1,0,1">
+                    <StackPanel   Orientation="Horizontal"   >
+                        <Button Content="CW" Width="80" Height="30" IsEnabled="{Binding IsSystemStaus}">
                             <i:Interaction.Triggers>
                                 <i:EventTrigger EventName="Click">
                                     <cal:ActionMessage MethodName="RAxisMoveTo">
@@ -396,7 +418,7 @@
                                 </i:EventTrigger>
                             </i:Interaction.Triggers>
                         </Button>
-                        <Button Content="CCW" Width="80" Height="30" Margin="30,0,10,0" IsEnabled="{Binding IsSystemStaus}">
+                        <Button Content="CCW" Width="80" Height="30" Margin="15,0,10,0" IsEnabled="{Binding IsSystemStaus}">
                             <i:Interaction.Triggers>
                                 <i:EventTrigger EventName="Click">
                                     <cal:ActionMessage MethodName="RAxisMoveTo">
@@ -410,7 +432,7 @@
 
 
 
-                <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Row="6" Grid.RowSpan="2" Grid.ColumnSpan="4" Padding="80,0,0,0">
+                <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Row="7" Grid.RowSpan="2" Grid.ColumnSpan="4" Padding="80,0,0,0">
                     <StackPanel   Orientation="Horizontal"  >
                         <Button Content="Home" Width="92" Height="30" Margin="22,-70,10,0" IsEnabled="{Binding IsSystemStaus}">
                             <i:Interaction.Triggers>

+ 10 - 1
Furnace/FurnaceUI/Views/Maintenances/BoatRobotViewModel.cs

@@ -94,7 +94,7 @@ namespace FurnaceUI.Views.Maintenances
         public double ZAxisAccTime { get; set; }
         public double ZAxisDecTime { get; set; }
 
-      
+
         private Dictionary<string, string> zPositionTranslate = new Dictionary<string, string>()
         {{"Position1","Position1" }, {"Position2","Position2" },{"Position3","Position3" }};
         #endregion
@@ -358,6 +358,15 @@ namespace FurnaceUI.Views.Maintenances
                 case "Position4":
                     InvokeClient.Instance.Service.DoOperation($"PM1.BoatRotationServo.ServoMoveTo", targetPosition);
                     break;
+                case "CW":
+                    var speed = (double)QueryDataClient.Instance.Service.GetConfig($"Boat.BoatRotationServo.MoveSpeed");
+                    InvokeClient.Instance.Service.DoOperation($"PM1.BoatRotationServo.ServoMoveTo", targetPosition, speed);
+                    break;
+                case "CCW":
+                    speed = (double)QueryDataClient.Instance.Service.GetConfig($"Boat.BoatRotationServo.MoveSpeed");
+
+                    InvokeClient.Instance.Service.DoOperation($"PM1.BoatRotationServo.ServoMoveTo", targetPosition, speed);
+                    break;
                 default:
                     InvokeClient.Instance.Service.DoOperation($"PM1.BoatRotationServo.ServoMoveTo", targetPosition);
                     break;