ys-hwang 6 vuotta sitten
vanhempi
commit
448facf734

+ 4 - 2
Dev/OHV/OHV.Module.Interactivity/PopUp/ConveyorControlViewModel.cs

@@ -346,6 +346,7 @@ namespace OHV.Module.Interactivity.PopUp
             var left = args.Args[ "Left" ] as AxisState;
             var right = args.Args[ "Right" ] as AxisState;
 
+            /*Left*/
             if ( left.IsServoOn )
                 this.AxisLeftIsServoOn = Brushes.LimeGreen;
             else
@@ -354,13 +355,14 @@ namespace OHV.Module.Interactivity.PopUp
             if ( left.IsOriginReturn )
                 this.AxisLeftIsOrg = Brushes.LimeGreen;
             else
-                this.AxisLeftIsOrg = Brushes.Red;
+                this.AxisLeftIsOrg = Brushes.Gray;
 
             if ( left.IsAmpFault )
                 this.AxisLeftAmpFault = Brushes.Red;
             else
                 this.AxisLeftAmpFault = Brushes.Gray;
 
+            /*Right*/
             if ( right.IsServoOn )
                 this.AxisRightIsServoOn = Brushes.LimeGreen;
             else
@@ -369,7 +371,7 @@ namespace OHV.Module.Interactivity.PopUp
             if ( right.IsOriginReturn )
                 this.AxisRightIsOrg = Brushes.LimeGreen;
             else
-                this.AxisRightIsOrg = Brushes.Red;
+                this.AxisRightIsOrg = Brushes.Gray;
 
             if ( right.IsAmpFault )
                 this.AxisRightAmpFault = Brushes.Red;

+ 4 - 3
Dev/OHV/OHV.Module.Interactivity/PopUp/DriveServoView.xaml

@@ -227,19 +227,20 @@
 
 
                 <!--Jog Button-->
-                <RepeatButton
+                <Button
                             Margin="5"
                             Grid.Row="0" 
                             Grid.Column="2"
                             HorizontalAlignment="Right"
                             Width="120"
                             Height="auto"
-                            Command="{Binding JogCommand}" CommandParameter="-">
+                            Command="{Binding JogCommand}" CommandParameter="-"
+                            >
                     <StackPanel>
                         <materialDesign:PackIcon Kind="MinusBoxOutline" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="30" Width="auto"/>
                         <TextBlock><Run Text="Jog(-)"/></TextBlock>
                     </StackPanel>
-                </RepeatButton>
+                </Button>
 
                 <Button
                             Margin="5"

+ 9 - 0
Dev/OHV/OHV.Module.Interactivity/PopUp/DriveServoView.xaml.cs

@@ -24,5 +24,14 @@ namespace OHV.Module.Interactivity.PopUp
         {
             InitializeComponent();
         }
+
+        private void Button_PreviewMouseDown( object sender , MouseButtonEventArgs e )
+        {  
+        }
+
+        private void Button_PreviewMouseUp( object sender , MouseButtonEventArgs e )
+        {
+
+        }
     }
 }

+ 6 - 6
Dev/OHV/OHV.Module.Interactivity/PopUp/LockServoView.xaml

@@ -281,7 +281,7 @@
                     </Grid.ColumnDefinitions>
                     <StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
                         <StackPanel Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Center" >
-                            <Button
+                            <!--<Button
                             Style="{StaticResource MaterialDesignRaisedButton}"
                             materialDesign:ButtonAssist.CornerRadius="10"
                             ToolTip="MaterialDesignRaisedButton with Round Corners"
@@ -293,9 +293,9 @@
                                 <StackPanel>
                                     <TextBlock><Run Text="Limit(-)"/></TextBlock>
                                 </StackPanel>
-                            </Button>
+                            </Button>-->
 
-                            <Button
+                            <!--<Button
                             Style="{StaticResource MaterialDesignRaisedButton}"
                             materialDesign:ButtonAssist.CornerRadius="10"
                             ToolTip="MaterialDesignRaisedButton with Round Corners"
@@ -307,9 +307,9 @@
                                 <StackPanel>
                                     <TextBlock><Run Text="Origin"/></TextBlock>
                                 </StackPanel>
-                            </Button>
+                            </Button>-->
 
-                            <Button
+                            <!--<Button
                             Style="{StaticResource MaterialDesignRaisedButton}"
                             materialDesign:ButtonAssist.CornerRadius="10"
                             ToolTip="MaterialDesignRaisedButton with Round Corners"
@@ -320,7 +320,7 @@
                                 <StackPanel>
                                     <TextBlock><Run Text="Limit(+)"/></TextBlock>
                                 </StackPanel>
-                            </Button>
+                            </Button>-->
                         </StackPanel>
 
                         <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" HorizontalAlignment="Center"

+ 26 - 14
Dev/OHV/OHV.Module.Interactivity/PopUp/LockServoViewModel.cs

@@ -540,22 +540,34 @@ namespace OHV.Module.Interactivity.PopUp
 
         private void ExecuteMoveToCommand( )
         {
-            this.messageController.ShowConfirmationPopupView( $"Clamp Move To {this.SelectedPosition}" , r =>
-              {
-                  if ( r.Result == ButtonResult.OK )
-                  {
-                      var msg = new AxisControlEventArgs();
-                      msg.Kind = AxisControlEventArgs.eAxisControlKind.Move;
-                      msg.AxisName = this.SelectAxis;
+            var error = string.Empty;
 
-                      if ( SelectedPosition.Equals( ConstString.TEACH_POSITION_LOCK ) )
-                          msg.PosDir = AxisControlEventArgs.ePosDir.Lock;
-                      else
-                          msg.PosDir = AxisControlEventArgs.ePosDir.UnLock;
+            if ( this.IsLeftServoFault || this.IsRightServoFault )
+                error = "Is Servo Fault";
+            else if ( !this.IsLeftServoOn || !this.IsRightServoOn )
+                error = "Is Servo OFF";
 
-                      this.PublishEvent( msg );
-                  }
-              } );
+            if ( error != string.Empty )
+                this.messageController.ShowNotificationView( error );
+            else
+            {
+                this.messageController.ShowConfirmationPopupView( $"Clamp Move To {this.SelectedPosition}" , r =>
+                {
+                    if ( r.Result == ButtonResult.OK )
+                    {
+                        var msg = new AxisControlEventArgs();
+                        msg.Kind = AxisControlEventArgs.eAxisControlKind.Move;
+                        msg.AxisName = this.SelectAxis;
+
+                        if ( SelectedPosition.Equals( ConstString.TEACH_POSITION_LOCK ) )
+                            msg.PosDir = AxisControlEventArgs.ePosDir.Lock;
+                        else
+                            msg.PosDir = AxisControlEventArgs.ePosDir.UnLock;
+
+                        this.PublishEvent( msg );
+                    }
+                } );
+            }
         }
 
         private void ExecuteSelectPosCommand( object obj )

+ 3 - 0
Dev/OHV/OHV.Vehicle/Concept/D_MainWindow.xaml.cs

@@ -55,6 +55,9 @@ namespace OHV.Vehicle.Concept
 
             App.splashScreen.AddMessage("Done !");
             App.splashScreen.LoadComplete();
+
+            var model = this.DataContext as D_MainWindowViewModel;
+            model.InitViewModel();
         }
 
         private void Button_Click(object sender, RoutedEventArgs e)

+ 4 - 4
Dev/OHV/VehicleControlSystem/ControlLayer/IO/EzIO.cs

@@ -89,9 +89,9 @@ namespace VehicleControlSystem.ControlLayer.IO
                 this.isConnectError = value;
 
                 if (isConnectError)
-                    this.qQ.Enqueue(new QoDiconnected());
+                    this.qQ.Enqueue(new QoDiconnected() { Arg0 = "EzIO" } );
                 else
-                    this.qQ.Enqueue(new QoConnected());
+                    this.qQ.Enqueue(new QoConnected() { Arg0 = "EzIO"} );
             }
         }
 
@@ -558,9 +558,9 @@ namespace VehicleControlSystem.ControlLayer.IO
                     var o = qQ.Dequeue();
 
                     if (o is QoConnected)
-                        DelegateUtils.Invoke(OnContd);
+                        DelegateUtils.Invoke(OnContd, o.Arg0);
                     else if (o is QoDiconnected)
-                        DelegateUtils.Invoke(OnDiscontd);
+                        DelegateUtils.Invoke(OnDiscontd, o.Arg0);
                     else if (o is QoChangedIO)
                         DelegateUtils.Invoke(OnChangedIO, o.Arg0);
                     else if (o is QoWriteIO)

+ 3 - 0
Dev/OHV/VehicleControlSystem/VCSystem.cs

@@ -73,6 +73,7 @@ namespace VehicleControlSystem
             this.vehicle.Init();
             this.scheduler.Init();
             this.autoManager.Init(this.vehicle);
+
         }
 
         private void Vehicle_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
@@ -107,6 +108,8 @@ namespace VehicleControlSystem
         }
         private void EzIO_OnContd(string ID)
         {
+            this.IO.OutputOn( "OUT_TEACH_MODE" );
+
             //throw new NotImplementedException();
         }
         #endregion