Bladeren bron

revise robot flip cartoon

chenzk 2 weken geleden
bovenliggende
commit
91b9a1f384
2 gewijzigde bestanden met toevoegingen van 47 en 7 verwijderingen
  1. 4 2
      PunkHPX8_MainPages/ViewModels/EfemViewModel.cs
  2. 43 5
      PunkHPX8_Themes/Themes/Generic.xaml

+ 4 - 2
PunkHPX8_MainPages/ViewModels/EfemViewModel.cs

@@ -1198,14 +1198,16 @@ namespace PunkHPX8_MainPages.ViewModels
                 }
                 else  //使用上手臂
                 {
-                    if (oldValue.BladeTarget!=null && oldValue.BladeTarget.Split('.')[2] != newValue.BladeTarget.Split('.')[2] && newValue.BladeTarget.Split('.')[2]=="Down")
+                    //实现翻转动画
+                    if (newValue.BladeTarget.Split('.')[2]=="Down")
                     {
                         Robot2FAction = WaferRobotFAction.UpperToDown;
                     }
-                    else if(oldValue.BladeTarget == null || (oldValue.BladeTarget.Split('.')[2] != newValue.BladeTarget.Split('.')[2] && newValue.BladeTarget.Split('.')[2] == "Upper"))
+                    else if(newValue.BladeTarget.Split('.')[2] == "Upper")
                     {
                         Robot2FAction = WaferRobotFAction.DownToUpper;
                     }
+
                     var robot1Robot1TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
                     //Robot整体平移动画
                     await ChangePosition(robot1Robot1TAction, newValue.Action);

+ 43 - 5
PunkHPX8_Themes/Themes/Generic.xaml

@@ -1046,21 +1046,41 @@
                                 <VisualStateGroup.Transitions>
                                     <VisualTransition To="UpperToDown">
                                         <Storyboard FillBehavior="HoldEnd" SpeedRatio="18">
+                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="grip2RotateAct3D" Storyboard.TargetProperty="ScaleX">
+                                                <LinearDoubleKeyFrame Value="1" KeyTime="0:0:0"/>
+                                                <LinearDoubleKeyFrame Value="0" KeyTime="0:0:4"/>
+                                                <LinearDoubleKeyFrame Value="-1" KeyTime="0:0:8"/>
+                                            </DoubleAnimationUsingKeyFrames>
+                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="grip2DownRotateAct3D" Storyboard.TargetProperty="ScaleX">
+                                                <LinearDoubleKeyFrame Value="-1" KeyTime="0:0:0"/>
+                                                <LinearDoubleKeyFrame Value="0" KeyTime="0:0:4"/>
+                                                <LinearDoubleKeyFrame Value="1" KeyTime="0:0:8"/>
+                                            </DoubleAnimationUsingKeyFrames>
                                             <ObjectAnimationUsingKeyFrames Storyboard.TargetName="armGripper2" Storyboard.TargetProperty="Visibility">
-                                                <DiscreteObjectKeyFrame KeyTime="0:0:4.5" Value="{x:Static Visibility.Hidden}"/>
+                                                <DiscreteObjectKeyFrame KeyTime="0:0:8" Value="{x:Static Visibility.Hidden}"/>
                                             </ObjectAnimationUsingKeyFrames>
                                             <ObjectAnimationUsingKeyFrames Storyboard.TargetName="armGripper2Down" Storyboard.TargetProperty="Visibility">
-                                                <DiscreteObjectKeyFrame KeyTime="0:0:4.5" Value="{x:Static Visibility.Visible}"/>
+                                                <DiscreteObjectKeyFrame KeyTime="0:0:8" Value="{x:Static Visibility.Visible}"/>
                                             </ObjectAnimationUsingKeyFrames>
                                         </Storyboard>
                                     </VisualTransition>
                                     <VisualTransition To="DownToUpper">
                                         <Storyboard FillBehavior="HoldEnd" SpeedRatio="18">
+                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="grip2RotateAct3D" Storyboard.TargetProperty="ScaleX">
+                                                <LinearDoubleKeyFrame Value="-1" KeyTime="0:0:0"/>
+                                                <LinearDoubleKeyFrame Value="0" KeyTime="0:0:4"/>
+                                                <LinearDoubleKeyFrame Value="1" KeyTime="0:0:8"/>
+                                            </DoubleAnimationUsingKeyFrames>
+                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="grip2DownRotateAct3D" Storyboard.TargetProperty="ScaleX">
+                                                <LinearDoubleKeyFrame Value="1" KeyTime="0:0:0"/>
+                                                <LinearDoubleKeyFrame Value="0" KeyTime="0:0:4"/>
+                                                <LinearDoubleKeyFrame Value="-1" KeyTime="0:0:8"/>
+                                            </DoubleAnimationUsingKeyFrames>
                                             <ObjectAnimationUsingKeyFrames Storyboard.TargetName="armGripper2" Storyboard.TargetProperty="Visibility">
-                                                <DiscreteObjectKeyFrame KeyTime="0:0:4.5" Value="{x:Static Visibility.Hidden}"/>
+                                                <DiscreteObjectKeyFrame KeyTime="0:0:8" Value="{x:Static Visibility.Hidden}"/>
                                             </ObjectAnimationUsingKeyFrames>
                                             <ObjectAnimationUsingKeyFrames Storyboard.TargetName="armGripper2Down" Storyboard.TargetProperty="Visibility">
-                                                <DiscreteObjectKeyFrame KeyTime="0:0:4.5" Value="{x:Static Visibility.Visible}"/>
+                                                <DiscreteObjectKeyFrame KeyTime="0:0:8" Value="{x:Static Visibility.Visible}"/>
                                             </ObjectAnimationUsingKeyFrames>
                                         </Storyboard>
                                     </VisualTransition>
@@ -1068,6 +1088,14 @@
 
                                 <VisualState Name="UpperToDown">
                                     <Storyboard FillBehavior="HoldEnd">
+                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="grip2RotateAct3D" Storyboard.TargetProperty="ScaleX">
+
+                                            <LinearDoubleKeyFrame Value="-1" KeyTime="0:0:0"/>
+                                        </DoubleAnimationUsingKeyFrames>
+                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="grip2DownRotateAct3D" Storyboard.TargetProperty="ScaleX">
+
+                                            <LinearDoubleKeyFrame Value="1" KeyTime="0:0:0"/>
+                                        </DoubleAnimationUsingKeyFrames>
                                         <ObjectAnimationUsingKeyFrames Storyboard.TargetName="armGripper2" Storyboard.TargetProperty="Visibility">
                                             <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{x:Static Visibility.Hidden}"/>
                                         </ObjectAnimationUsingKeyFrames>
@@ -1078,6 +1106,14 @@
                                 </VisualState>
                                 <VisualState Name="DownToUpper">
                                     <Storyboard FillBehavior="HoldEnd">
+                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="grip2RotateAct3D" Storyboard.TargetProperty="ScaleX">
+                       
+                                            <LinearDoubleKeyFrame Value="1" KeyTime="0:0:0"/>
+                                        </DoubleAnimationUsingKeyFrames>
+                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="grip2DownRotateAct3D" Storyboard.TargetProperty="ScaleX">
+                    
+                                            <LinearDoubleKeyFrame Value="-1" KeyTime="0:0:0"/>
+                                        </DoubleAnimationUsingKeyFrames>
                                         <ObjectAnimationUsingKeyFrames Storyboard.TargetName="armGripper2" Storyboard.TargetProperty="Visibility">
                                             <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{x:Static Visibility.Visible}"/>
                                         </ObjectAnimationUsingKeyFrames>
@@ -1681,6 +1717,7 @@
                                             <Canvas.RenderTransform>
                                                 <TransformGroup>
                                                     <RotateTransform x:Name="grip2RotateAct"/>
+                                                    <ScaleTransform x:Name="grip2RotateAct3D" />
                                                 </TransformGroup>
                                             </Canvas.RenderTransform>
                                             <Image Width="48" Source="pack://application:,,,/PunkHPX8_Themes;component/Themes/Images/parts/atmrobot/hand1.png"></Image>
@@ -1689,10 +1726,11 @@
                                             </Viewbox>
                                         </Canvas>
 
-                                        <Canvas x:Name="armGripper2Down" Height="120" Width="50"  Canvas.Left="-30" Canvas.Top="-100" RenderTransformOrigin="0.5,1">
+                                        <Canvas x:Name="armGripper2Down" Height="120" Width="50"  Canvas.Left="-30" Canvas.Top="-100" RenderTransformOrigin="0.5,1" Visibility="Collapsed">
                                             <Canvas.RenderTransform>
                                                 <TransformGroup>
                                                     <RotateTransform x:Name="grip2DownRotateAct"/>
+                                                    <ScaleTransform x:Name="grip2DownRotateAct3D" />
                                                 </TransformGroup>
                                             </Canvas.RenderTransform>
                                             <Image Width="48" Source="pack://application:,,,/PunkHPX8_Themes;component/Themes/Images/parts/atmrobot/hand1.png" Panel.ZIndex="1"></Image>