Просмотр исходного кода

드라이브 On/Off/Fault 상태 표시 변경

ys-hwang 5 лет назад
Родитель
Сommit
97da102bd4

+ 16 - 0
Dev/OHV/OHV.Common/Shareds/SharedEnumType.cs

@@ -21,6 +21,22 @@
 		Output = 1,
 		Both = 2,
 	}
+
+	public enum ePopupType
+    {
+		ConfigView,
+		NotificatioinView,
+		ConfirmationPopupView,
+		MapView,
+		ServoConfigView,
+		InOutView,
+		LockServoView,
+		DriveServoView,
+		BatteryConfigView,
+		OpticalReadingConfigView,
+		InOutControlView,
+		ConveyorControlView,
+	}
 	#endregion
 
 	#region Machine State

+ 42 - 47
Dev/OHV/OHV.Module.Interactivity/MessageController.cs

@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using OHV.Common.Shareds;
 using OHV.Module.Interactivity.PopUp;
 using Prism.Interactivity.InteractionRequest;
 using Prism.Ioc;
@@ -40,9 +41,48 @@ namespace OHV.Module.Interactivity
             containerRegistry.RegisterDialog<ConveyorControlView , ConveyorControlViewModel>();
         }
 
-        public void ShowConfigPopupView()
+        public void ShowPopupView(ePopupType type, string message = null, bool isOk = true)
         {
-            this.dialogService.ShowDialog("ConfigView", new DialogParameters(), null);
+            var dlgName = string.Empty;
+            switch ( type )
+            {
+                case ePopupType.ConfigView:
+                    dlgName = "ConfigView";
+                    break;
+                case ePopupType.NotificatioinView:
+                    break;
+                case ePopupType.ConfirmationPopupView:
+                    break;
+                case ePopupType.MapView:
+                    dlgName = "MapView";
+                    break;
+                case ePopupType.ServoConfigView:
+                    dlgName = "ServoConfigView";
+                    break;
+                case ePopupType.InOutView:
+                    dlgName = "InOutView";
+                    break;
+                case ePopupType.LockServoView:
+                    dlgName = "LockServoView";
+                    break;
+                case ePopupType.DriveServoView:
+                    dlgName = "DriveServoView";
+                    break;
+                case ePopupType.BatteryConfigView:
+                    dlgName = "BatteryConfigView";
+                    break;
+                case ePopupType.OpticalReadingConfigView:
+                    dlgName = "OpticalReadingConfigView";
+                    break;
+                case ePopupType.InOutControlView:
+                    dlgName = "InOutControlView";
+                    break;
+                case ePopupType.ConveyorControlView:
+                    dlgName = "ConveyorControlView";
+                    break;
+            }
+
+            this.dialogService.ShowDialog( dlgName , new DialogParameters() , null );
         }
 
         public void ShowNotificationView( string Message , bool isOK = true )
@@ -57,50 +97,5 @@ namespace OHV.Module.Interactivity
         {
             this.dialogService.ShowDialog( "ConfirmationPopupView" , new DialogParameters( $"message={Message}" ) , callBack );
         }
-
-        public void ShowMapPopupView( )
-        {
-            this.dialogService.ShowDialog( "MapView" , new DialogParameters() , null );
-        }
-
-        public void ShowServoConfigPopupView( )
-        {
-            this.dialogService.ShowDialog( "ServoConfigView" , new DialogParameters() , null );
-        }
-
-        public void ShowInOutPopupView( )
-        {
-            this.dialogService.ShowDialog( "InOutView" , new DialogParameters() , null );
-        }
-
-        public void ShowLockPopupView( )
-        {
-            this.dialogService.ShowDialog( "LockServoView" , new DialogParameters() , null );
-        }
-
-        public void ShowDrivePopupView( )
-        {
-            this.dialogService.ShowDialog( "DriveServoView" , new DialogParameters() , null );
-        }
-
-        public void ShowBatteryPopupView( )
-        {
-            this.dialogService.ShowDialog( "BatteryConfigView" , new DialogParameters() , null );
-        }
-
-        public void ShowOpticalReadPopupView()
-        {
-            this.dialogService.ShowDialog( "OpticalReadingConfigView" , new DialogParameters() , null );
-        }
-
-        public void ShowInOutControlPopupView()
-        {
-            this.dialogService.ShowDialog( "InOutControlView" , new DialogParameters() , null );
-        }
-
-        public void ShowConveyorPopupView()
-        {
-            this.dialogService.ShowDialog( "ConveyorControlView" , new DialogParameters() , null );
-        }
     }
 }

+ 1 - 1
Dev/OHV/OHV.Module.Interactivity/PopUp/DriveServoView.xaml

@@ -555,7 +555,7 @@
                         </StackPanel>
                     </Button>
 
-                    <Button Margin="10,10,10,5" HorizontalAlignment="Stretch" Height="90" BorderBrush="Gray" BorderThickness="2" Command="{Binding FaultResetCommand}">
+                    <Button Margin="10,10,10,5" HorizontalAlignment="Stretch" Height="90" BorderBrush="Gray" BorderThickness="2" Command="{Binding FaultResetCommand}" Background="{Binding DriveFaultStateBrush, FallbackValue=Dodgerblue}">
                         <StackPanel>
                             <materialDesign:PackIcon Kind="CircleArrows" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
                             <TextBlock Text="Fault Reset" FontSize="16" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>

+ 176 - 142
Dev/OHV/OHV.Module.Interactivity/PopUp/DriveServoViewModel.cs

@@ -33,7 +33,7 @@ namespace OHV.Module.Interactivity.PopUp
             get { return this._title; }
             set
             {
-                this.SetProperty( ref this._title, value );
+                this.SetProperty( ref this._title , value );
             }
         }
 
@@ -43,7 +43,7 @@ namespace OHV.Module.Interactivity.PopUp
             get => this._selectedPosition;
             set
             {
-                this.SetProperty( ref this._selectedPosition, value );
+                this.SetProperty( ref this._selectedPosition , value );
             }
         }
 
@@ -51,7 +51,7 @@ namespace OHV.Module.Interactivity.PopUp
         public string SelectDirection
         {
             get => this._selectDirection;
-            set { this.SetProperty( ref this._selectDirection, value ); }
+            set { this.SetProperty( ref this._selectDirection , value ); }
         }
 
         #region Motor Left Binding Value
@@ -59,7 +59,7 @@ namespace OHV.Module.Interactivity.PopUp
         public double DriveTargetPos
         {
             get { return this._driveTargetPos; }
-            set { this.SetProperty( ref this._driveTargetPos, value ); }
+            set { this.SetProperty( ref this._driveTargetPos , value ); }
         }
 
         private double _currentPosition;
@@ -69,21 +69,21 @@ namespace OHV.Module.Interactivity.PopUp
         public double CurrentPosition
         {
             get { return this._currentPosition; }
-            set { this.SetProperty( ref this._currentPosition, value ); }
+            set { this.SetProperty( ref this._currentPosition , value ); }
         }
 
         private double _differenceDrive;
         public double DifferenceDrive
         {
             get { return this._differenceDrive; }
-            set { this.SetProperty( ref this._differenceDrive, value ); }
+            set { this.SetProperty( ref this._differenceDrive , value ); }
         }
 
         private double _jogVelocity = 3.0;
         public double JogVelocity
         {
             get { return this._jogVelocity; }
-            set { this.SetProperty( ref this._jogVelocity, value ); }
+            set { this.SetProperty( ref this._jogVelocity , value ); }
         }
         #endregion
 
@@ -107,7 +107,7 @@ namespace OHV.Module.Interactivity.PopUp
         public ICommand SteeringMoveCommand { get; set; }
         public ICommand SelectedDirection { get; set; }
         public ICommand JogVelPopupCommand { get; set; }
-        public ICommand JogCommand { get; set; } 
+        public ICommand JogCommand { get; set; }
         #endregion
 
         #region Brushes
@@ -115,36 +115,45 @@ namespace OHV.Module.Interactivity.PopUp
         public Brush SteeringLeftBrushProperty
         {
             get { return steeringLeftBrush; }
-            set { SetProperty( ref this.steeringLeftBrush, value ); }
+            set { SetProperty( ref this.steeringLeftBrush , value ); }
         }
 
         private Brush steeringRightBrush = Brushes.Gray;
         public Brush SteeringRightBrushProperty
         {
             get { return steeringRightBrush; }
-            set { SetProperty( ref this.steeringRightBrush, value ); }
+            set { SetProperty( ref this.steeringRightBrush , value ); }
         }
 
         Brush driveOnStateBrush = Brushes.DodgerBlue;
         public Brush DriveOnStateBrush
         {
             get { return this.driveOnStateBrush; }
-            set { SetProperty(ref this.driveOnStateBrush, value); }
+            set { SetProperty( ref this.driveOnStateBrush , value ); }
         }
 
         Brush driveOffStateBrush = Brushes.DodgerBlue;
         public Brush DriveOffStateBrush
         {
             get { return this.driveOffStateBrush; }
-            set { SetProperty(ref this.driveOffStateBrush, value); }
+            set { SetProperty( ref this.driveOffStateBrush , value ); }
         }
+
+        private Brush driveFaultStateBrush = Brushes.DodgerBlue;
+
+        public Brush DriveFaultStateBrush
+        {
+            get { return driveFaultStateBrush; }
+            set { SetProperty( ref this.driveFaultStateBrush , value ); }
+        }
+
         #endregion
 
         private ObservableCollection<Route> _routeList;
         public ObservableCollection<Route> RouteList
         {
             get { return this._routeList; }
-            set { SetProperty( ref this._routeList, value ); }
+            set { SetProperty( ref this._routeList , value ); }
         }
 
         public SqliteDAL.DAL.AxisPositionDataDAL axisPositionDataDal;
@@ -156,21 +165,21 @@ namespace OHV.Module.Interactivity.PopUp
         public string AutoReadyFlag
         {
             get { return autoReadyFlag; }
-            set { this.SetProperty(ref this.autoReadyFlag, value); }
+            set { this.SetProperty( ref this.autoReadyFlag , value ); }
         }
 
         Brush autoReadyFlagColor = Brushes.Gray;
         public Brush AutoReadyFlagColor
         {
             get { return this.autoReadyFlagColor; }
-            set { this.SetProperty(ref this.autoReadyFlagColor, value); }
+            set { this.SetProperty( ref this.autoReadyFlagColor , value ); }
         }
 
-        private string  currentMCR = "None";
-        public string  CurrentMCR
+        private string currentMCR = "None";
+        public string CurrentMCR
         {
             get { return currentMCR; }
-            set { this.SetProperty(ref this.currentMCR, value); }
+            set { this.SetProperty( ref this.currentMCR , value ); }
         }
 
         private string currentTag = "None";
@@ -178,19 +187,19 @@ namespace OHV.Module.Interactivity.PopUp
         public string CurrentTag
         {
             get { return currentTag; }
-            set { SetProperty(ref this.currentTag, value); }
+            set { SetProperty( ref this.currentTag , value ); }
         }
 
         ZmqManager zmqManager;
-       
-        public DriveServoViewModel( IEventAggregator _ea, SqliteManager _sql, MessageController _messageController, VCSystem system )
+
+        public DriveServoViewModel(IEventAggregator _ea , SqliteManager _sql , MessageController _messageController , VCSystem system)
         {
             this.eventAggregator = _ea;
             this.eventAggregator.GetEvent<DriveControlPubSubEvent>().Unsubscribe( DriveControlCallBack );
-            this.eventAggregator.GetEvent<DriveControlPubSubEvent>().Subscribe( DriveControlCallBack, ThreadOption.UIThread );
+            this.eventAggregator.GetEvent<DriveControlPubSubEvent>().Subscribe( DriveControlCallBack , ThreadOption.UIThread );
 
             this.eventAggregator.GetEvent<GUIMessagePubSubEvent>().Unsubscribe( UICallBackCommunication );
-            this.eventAggregator.GetEvent<GUIMessagePubSubEvent>().Subscribe( UICallBackCommunication, ThreadOption.UIThread );
+            this.eventAggregator.GetEvent<GUIMessagePubSubEvent>().Subscribe( UICallBackCommunication , ThreadOption.UIThread );
 
             this.sql = _sql;
 
@@ -227,50 +236,75 @@ namespace OHV.Module.Interactivity.PopUp
             this.CurrentMCR = this.zmqManager.CurrentMCR;
             this.CurrentTag = this.zmqManager.GetCurrentPointNo().ToString();
 
+            this.DriveAutoReadyState( this.zmqManager.IsCanStanbyLocation );
+            this.UpdateDriveState( this.zmqManager.DriveState );
+        }
 
-            //TODO: Drive 상태 Update (On/Off, Fault)
-            //if (zmqManager.IsDriveOn)
-            //    this.DriveOnStateBrush = Brushes.LimeGreen;
-            //else
-            //    this.DriveOnStateBrush = Brushes.DodgerBlue;
+        void UpdateDriveState(eDriveState state)
+        {
+            switch ( state )
+            {
+                case eDriveState.ServoOff:
+                    this.DriveOnStateBrush = Brushes.Gray;
+                    break;
+                case eDriveState.ServoOn:
+                    this.DriveOnStateBrush = Brushes.LimeGreen;
+                    this.DriveFaultStateBrush = Brushes.DodgerBlue;
+                    break;
+                case eDriveState.Fault:
+                    this.DriveFaultStateBrush = Brushes.Red;
+                    this.DriveOnStateBrush = Brushes.Gray;
+                    break;
 
-            DriveAutoReadyState(this.zmqManager.IsCanStanbyLocation);
+                default:
+                    break;
+            }
         }
 
-        private void ZmqManager_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
+        private void ZmqManager_PropertyChanged(object sender , System.ComponentModel.PropertyChangedEventArgs e)
         {
-            var property = sender.GetType().GetProperty(e.PropertyName);
-            var newValue = property.GetValue(sender, null);
+            var property = sender.GetType().GetProperty( e.PropertyName );
+            var newValue = property.GetValue( sender , null );
 
-            switch(e.PropertyName)
+            switch ( e.PropertyName )
             {
                 case "CurrentTag":
-                    this.CurrentTag = CastTo<int>.From<object>(newValue).ToString();
+                    this.CurrentTag = CastTo<int>.From<object>( newValue ).ToString();
                     break;
 
                 case "CurrentMCR":
-                    this.CurrentMCR = CastTo<string>.From<object>(newValue);
+                    this.CurrentMCR = CastTo<string>.From<object>( newValue );
                     break;
 
                 case "IsCanStanbyLocation":
                     {
-                        var ll = CastTo<bool>.From<object>(newValue);
-                        DriveAutoReadyState(ll);
+                        var ll = CastTo<bool>.From<object>( newValue );
+                        DriveAutoReadyState( ll );
                     }
                     break;
-                case "IsDriveOn":
+                //case "IsDriveOn":
+                //    {
+                //        var result = CastTo<bool>.From<object>( newValue );
+                //        if ( result )
+                //            this.DriveOnStateBrush = Brushes.LimeGreen;
+                //        else
+                //            this.DriveOnStateBrush = Brushes.DodgerBlue;
+                //    }
+                //    break;
+
+                case "DriveState":
                     {
-                        var result = CastTo<bool>.From<object>(newValue);
-                        if (result)
-                            this.DriveOnStateBrush = Brushes.LimeGreen;
-                        else
-                            this.DriveOnStateBrush = Brushes.DodgerBlue;
+                        var ll = CastTo<eDriveState>.From<object>( newValue );
+                        this.UpdateDriveState( ll );
                     }
                     break;
+
+                default:
+                    break;
             }
         }
 
-        private void ExecuteSteeringMove( object obj )
+        private void ExecuteSteeringMove(object obj)
         {
             var msg = new DriveControlEventArgs
             {
@@ -286,11 +320,11 @@ namespace OHV.Module.Interactivity.PopUp
             this.PublishEvent( msg );
         }
 
-        private void UICallBackCommunication( GUIMessageEventArgs obj )
+        private void UICallBackCommunication(GUIMessageEventArgs obj)
         {
             if ( obj.Kind == GUIMessageEventArgs.eGUIMessageKind.ModelPropertyChange )
             {
-                if ( obj.MessageKey.Equals( MessageKey.Vehicle ) ) 
+                if ( obj.MessageKey.Equals( MessageKey.Vehicle ) )
                 {
                     switch ( obj.ModelPropertyName )
                     {
@@ -332,7 +366,7 @@ namespace OHV.Module.Interactivity.PopUp
 
         void DriveAutoReadyState(bool state)
         {
-            if(state)
+            if ( state )
             {
                 this.AutoReadyFlag = "OK";
                 this.AutoReadyFlagColor = Brushes.LimeGreen;
@@ -344,7 +378,7 @@ namespace OHV.Module.Interactivity.PopUp
             }
         }
 
-        private void ChagneVehicleState( eVehicleState v )
+        private void ChagneVehicleState(eVehicleState v)
         {
             switch ( v )
             {
@@ -369,7 +403,7 @@ namespace OHV.Module.Interactivity.PopUp
             }
         }
 
-        private void DriveControlCallBack( DriveControlEventArgs args )
+        private void DriveControlCallBack(DriveControlEventArgs args)
         {
             if ( args.EventDir == DriveControlEventArgs.eEventDir.ToFront )
             {
@@ -420,14 +454,14 @@ namespace OHV.Module.Interactivity.PopUp
             }
         }
 
-        private void ResponseVehicleState( DriveControlEventArgs args )
+        private void ResponseVehicleState(DriveControlEventArgs args)
         {
             var state = CastTo<VehicleInfo>.From<object>( args.Args );
 
             this.CurrentPosition = state.CurrentPosition;
         }
 
-        private void ResponseMove( DriveControlEventArgs args )
+        private void ResponseMove(DriveControlEventArgs args)
         {
             var msg = string.Empty;
             if ( args.Result.IsSuccess )
@@ -437,30 +471,30 @@ namespace OHV.Module.Interactivity.PopUp
             else
             {
                 var error = args.Result.Errors.FirstOrDefault();
-                var alarm = error.Metadata["Alarm"] as Alarm;
+                var alarm = error.Metadata[ "Alarm" ] as Alarm;
                 msg = alarm.Name + " " + alarm.Text;
             }
 
             this.messageController.ShowNotificationView( msg );
         }
 
-        void PublishEvent( DriveControlEventArgs args )
+        void PublishEvent(DriveControlEventArgs args)
         {
             args.EventDir = DriveControlEventArgs.eEventDir.ToBack;
             this.eventAggregator.GetEvent<DriveControlPubSubEvent>().Publish( args );
         }
 
-        void ChangeSteeringDirection( eSteeringState state )
+        void ChangeSteeringDirection(eSteeringState state)
         {
             if ( state == eSteeringState.Left )
             {
-                this.SteeringLeftBrushProperty = (Brush)new BrushConverter().ConvertFromString( "#FF00FFD3" );
+                this.SteeringLeftBrushProperty = ( Brush )new BrushConverter().ConvertFromString( "#FF00FFD3" );
                 this.SteeringRightBrushProperty = Brushes.Gray;
             }
             else if ( state == eSteeringState.Right )
             {
                 this.SteeringLeftBrushProperty = Brushes.Gray;
-                this.SteeringRightBrushProperty = (Brush)new BrushConverter().ConvertFromString( "#FF00FFD3" );
+                this.SteeringRightBrushProperty = ( Brush )new BrushConverter().ConvertFromString( "#FF00FFD3" );
             }
             else
             {
@@ -470,7 +504,7 @@ namespace OHV.Module.Interactivity.PopUp
         }
 
         #region Execute Method
-        private void ExecuteJogCommand( object obj )
+        private void ExecuteJogCommand(object obj)
         {
             if ( this.JogVelocity <= 0 )
             {
@@ -480,8 +514,8 @@ namespace OHV.Module.Interactivity.PopUp
 
             var msg = new DriveControlEventArgs
             {
-                EventDir = DriveControlEventArgs.eEventDir.ToBack,
-                ControlKind = DriveControlEventArgs.eControlKind.JOG,
+                EventDir = DriveControlEventArgs.eEventDir.ToBack ,
+                ControlKind = DriveControlEventArgs.eControlKind.JOG ,
             };
 
             if ( obj.ToString().Equals( "+" ) )
@@ -500,7 +534,7 @@ namespace OHV.Module.Interactivity.PopUp
             this.JogVelocity = result;
         }
 
-        private void ExecuteSelectedDirection( object obj )
+        private void ExecuteSelectedDirection(object obj)
         {
             this.SelectDirection = obj.ToString();
         }
@@ -508,55 +542,55 @@ namespace OHV.Module.Interactivity.PopUp
 
         private void ExecutePositionSaveCommand()
         {
-            this.messageController.ShowConfirmationPopupView( "Save To Data ?", r =>
-             {
-                 if ( r.Result == ButtonResult.OK )
-                 {
-                     var result = this.RouteList.Any( x => x.IsSelected != false );
+            this.messageController.ShowConfirmationPopupView( "Save To Data ?" , r =>
+              {
+                  if ( r.Result == ButtonResult.OK )
+                  {
+                      var result = this.RouteList.Any( x => x.IsSelected != false );
 
-                     if ( !result )
-                     {
-                         this.messageController.ShowNotificationView( "Pos Not Selected" );
-                         return;
-                     }
+                      if ( !result )
+                      {
+                          this.messageController.ShowNotificationView( "Pos Not Selected" );
+                          return;
+                      }
 
-                     var ll = this.RouteList.Where( x => x.IsSelected ).FirstOrDefault();
-                 }
-             } );
+                      var ll = this.RouteList.Where( x => x.IsSelected ).FirstOrDefault();
+                  }
+              } );
         }
 
         private void ExecutePositionDeleteCommand()
         {
-            this.messageController.ShowConfirmationPopupView( "Select To Delete ?", r =>
-           {
-               if ( r.Result == ButtonResult.OK )
-               {
-                   var deleteList = new List<Route>();
+            this.messageController.ShowConfirmationPopupView( "Select To Delete ?" , r =>
+            {
+                if ( r.Result == ButtonResult.OK )
+                {
+                    var deleteList = new List<Route>();
 
-                   foreach ( var item in this.RouteList )
-                   {
-                       if ( item.IsSelected )
-                           deleteList.Add( item );
-                   }
-                   deleteList.ForEach( x => { this.RouteList.Remove( x ); } );
-               }
-           } );
+                    foreach ( var item in this.RouteList )
+                    {
+                        if ( item.IsSelected )
+                            deleteList.Add( item );
+                    }
+                    deleteList.ForEach( x => { this.RouteList.Remove( x ); } );
+                }
+            } );
         }
 
         private void ExecutePositionAddCommand()
         {
-            this.messageController.ShowConfirmationPopupView( "Position Add ?", r =>
-           {
-               if ( r.Result == ButtonResult.OK )
-               {
-                   this.RouteList.Add( new Route() );
+            this.messageController.ShowConfirmationPopupView( "Position Add ?" , r =>
+            {
+                if ( r.Result == ButtonResult.OK )
+                {
+                    this.RouteList.Add( new Route() );
 
-                   this.messageController.ShowNotificationView( "Create Success" );
-               }
-           } );
+                    this.messageController.ShowNotificationView( "Create Success" );
+                }
+            } );
         }
 
-        private void ExecuteKeyInCommadn( object obj )
+        private void ExecuteKeyInCommadn(object obj)
         {
             var numPad = new CalcuratorView();
             var result = numPad.ShowDialog( this.DriveTargetPos );
@@ -565,20 +599,20 @@ namespace OHV.Module.Interactivity.PopUp
 
         private void ExecuteOriginCommand()
         {
-            this.messageController.ShowConfirmationPopupView( "Origin ?", r =>
-           {
-               if ( r.Result == ButtonResult.OK )
-               {
-               }
-           } );
+            this.messageController.ShowConfirmationPopupView( "Origin ?" , r =>
+            {
+                if ( r.Result == ButtonResult.OK )
+                {
+                }
+            } );
         }
 
         private void ExecuteFaultResetCommand()
         {
             var msg = new DriveControlEventArgs
             {
-                EventDir = DriveControlEventArgs.eEventDir.ToBack,
-                ControlKind = DriveControlEventArgs.eControlKind.FaultReset,
+                EventDir = DriveControlEventArgs.eEventDir.ToBack ,
+                ControlKind = DriveControlEventArgs.eControlKind.FaultReset ,
             };
 
             this.PublishEvent( msg );
@@ -588,8 +622,8 @@ namespace OHV.Module.Interactivity.PopUp
         {
             var msg = new DriveControlEventArgs
             {
-                EventDir = DriveControlEventArgs.eEventDir.ToBack,
-                ControlKind = DriveControlEventArgs.eControlKind.DriveOFF,
+                EventDir = DriveControlEventArgs.eEventDir.ToBack ,
+                ControlKind = DriveControlEventArgs.eControlKind.DriveOFF ,
             };
 
             this.PublishEvent( msg );
@@ -599,8 +633,8 @@ namespace OHV.Module.Interactivity.PopUp
         {
             var msg = new DriveControlEventArgs
             {
-                EventDir = DriveControlEventArgs.eEventDir.ToBack,
-                ControlKind = DriveControlEventArgs.eControlKind.DriveON,
+                EventDir = DriveControlEventArgs.eEventDir.ToBack ,
+                ControlKind = DriveControlEventArgs.eControlKind.DriveON ,
             };
 
             this.PublishEvent( msg );
@@ -608,43 +642,43 @@ namespace OHV.Module.Interactivity.PopUp
 
         private void ExecuteCurrentToTargetCommand()
         {
-            this.messageController.ShowConfirmationPopupView( "Current To Target ?", r =>
-           {
-               if ( r.Result == ButtonResult.OK )
-               {
-                   this.DriveTargetPos = this.CurrentPosition;
-               }
-           } );
+            this.messageController.ShowConfirmationPopupView( "Current To Target ?" , r =>
+            {
+                if ( r.Result == ButtonResult.OK )
+                {
+                    this.DriveTargetPos = this.CurrentPosition;
+                }
+            } );
         }
 
         private void ExecuteMoveToCommand()
         {
-            this.messageController.ShowConfirmationPopupView( "Move To Selected Position ?", r =>
-           {
-               if ( r.Result == ButtonResult.OK )
-               {
-                   var result = this.RouteList.Any( x => x.IsSelected != false );
-                   if ( !result )
-                   {
-                       this.messageController.ShowNotificationView( "Pos Not Selected" );
-                       return;
-                   }
+            this.messageController.ShowConfirmationPopupView( "Move To Selected Position ?" , r =>
+            {
+                if ( r.Result == ButtonResult.OK )
+                {
+                    var result = this.RouteList.Any( x => x.IsSelected != false );
+                    if ( !result )
+                    {
+                        this.messageController.ShowNotificationView( "Pos Not Selected" );
+                        return;
+                    }
 
-                   var ll = this.RouteList.Where( x => x.IsSelected ).FirstOrDefault();
+                    var ll = this.RouteList.Where( x => x.IsSelected ).FirstOrDefault();
 
-                   var msg = new DriveControlEventArgs
-                   {
-                       EventDir = DriveControlEventArgs.eEventDir.ToBack,
-                       ControlKind = DriveControlEventArgs.eControlKind.MOVE,
-                       TargetRouteID = ll.Id,
-                   };
+                    var msg = new DriveControlEventArgs
+                    {
+                        EventDir = DriveControlEventArgs.eEventDir.ToBack ,
+                        ControlKind = DriveControlEventArgs.eControlKind.MOVE ,
+                        TargetRouteID = ll.Id ,
+                    };
 
-                   this.PublishEvent( msg );
-               }
-           } );
+                    this.PublishEvent( msg );
+                }
+            } );
         }
 
-        private void ExecuteSelectPosCommand( object obj )
+        private void ExecuteSelectPosCommand(object obj)
         {
             this.SelectedPosition = obj.ToString();
         }
@@ -659,23 +693,23 @@ namespace OHV.Module.Interactivity.PopUp
 
         public void OnDialogClosed()
         {
-            this.eventAggregator.GetEvent<DriveControlPubSubEvent>().Publish( new DriveControlEventArgs { EventDir = DriveControlEventArgs.eEventDir.ToBack, ControlKind = DriveControlEventArgs.eControlKind.ReqStopCurrentPos } );
+            this.eventAggregator.GetEvent<DriveControlPubSubEvent>().Publish( new DriveControlEventArgs { EventDir = DriveControlEventArgs.eEventDir.ToBack , ControlKind = DriveControlEventArgs.eControlKind.ReqStopCurrentPos } );
             this.eventAggregator.GetEvent<DriveControlPubSubEvent>().Unsubscribe( DriveControlCallBack );
             this.eventAggregator.GetEvent<GUIMessagePubSubEvent>().Unsubscribe( UICallBackCommunication );
         }
 
-        public async void OnDialogOpened( IDialogParameters parameters )
+        public async void OnDialogOpened(IDialogParameters parameters)
         {
             Task task = Task.Run( () =>
             {
                 var msg = new DriveControlEventArgs
                 {
-                    EventDir = DriveControlEventArgs.eEventDir.ToBack,
-                    ControlKind = DriveControlEventArgs.eControlKind.SteeringState,
+                    EventDir = DriveControlEventArgs.eEventDir.ToBack ,
+                    ControlKind = DriveControlEventArgs.eControlKind.SteeringState ,
                 };
                 this.PublishEvent( msg );
 
-                this.eventAggregator.GetEvent<DriveControlPubSubEvent>().Publish( new DriveControlEventArgs { EventDir = DriveControlEventArgs.eEventDir.ToBack, ControlKind = DriveControlEventArgs.eControlKind.VehicleState } );
+                this.eventAggregator.GetEvent<DriveControlPubSubEvent>().Publish( new DriveControlEventArgs { EventDir = DriveControlEventArgs.eEventDir.ToBack , ControlKind = DriveControlEventArgs.eControlKind.VehicleState } );
 
                 var vcsMsg = new VCSMessageEventArgs() { Kind = VCSMessageEventArgs.eVCSMessageKind.ReqRouteManager };
                 this.eventAggregator.GetEvent<VCSMessagePubSubEvent>().Publish( vcsMsg );
@@ -688,7 +722,7 @@ namespace OHV.Module.Interactivity.PopUp
             await task;
         }
 
-        private void CloseDialog( string parameter )
+        private void CloseDialog(string parameter)
         {
             ButtonResult result = ButtonResult.None;
 
@@ -700,7 +734,7 @@ namespace OHV.Module.Interactivity.PopUp
             RaiseRequestClose( new DialogResult( result ) );
         }
 
-        public virtual void RaiseRequestClose( IDialogResult dialogResult )
+        public virtual void RaiseRequestClose(IDialogResult dialogResult)
         {
             RequestClose?.Invoke( dialogResult );
         }

+ 2 - 8
Dev/OHV/OHV.Module.Interactivity/PopUp/OpticalReadingConfigViewModel.cs

@@ -176,14 +176,6 @@ namespace OHV.Module.Interactivity.PopUp
             {
                 if ( r.Result == ButtonResult.OK )
                 {
-                    //var msg = new ObstacleControlEventArgs
-                    //{
-                    //    Curve = this.ObstacleCurve ,
-                    //    Drive = this.ObstacleDrive,
-                    //    ControlKind = ObstacleControlEventArgs.eControlKind.SAVE
-                    //};
-                    //this.ObstaclePublishEvent( msg );
-
                     var msg = new VCSMessageEventArgs();
                     msg.Kind = VCSMessageEventArgs.eVCSMessageKind.ReqObstaclePatternChg;
                     msg.MessageText = this.SetPattern.ToString();
@@ -199,6 +191,8 @@ namespace OHV.Module.Interactivity.PopUp
             this.eventAggregator.GetEvent<ObstacleControlPubSubEvent>().Publish( _args );
         }
 
+        //TODO: Obstacle 통신 연결 상태??? 표현 해야 할까요?
+        //IsObstacleConnect ? 
         #region Dialog Function
         public bool CanCloseDialog( )
         {

+ 6 - 6
Dev/OHV/OHV.Module.MainViews/Views/ControlViewModel.cs

@@ -43,32 +43,32 @@ namespace OHV.Module.MainViews.Views
 
         private void ExecuteConveyorCommand( )
         {
-            this.msgController.ShowConveyorPopupView();
+            this.msgController.ShowPopupView( Common.Shareds.ePopupType.ConveyorControlView );
         }
 
         private void ExecuteConfigCommand( )
         {
-            this.msgController.ShowConfigPopupView();
+            this.msgController.ShowPopupView( Common.Shareds.ePopupType.ConfigView );
         }
 
         private void ExecuteOpticalReadCommand( )
         {
-            this.msgController.ShowOpticalReadPopupView();
+            this.msgController.ShowPopupView( Common.Shareds.ePopupType.OpticalReadingConfigView );
         }
 
         private void ExecuteBatteryCommand( )
         {
-            this.msgController.ShowBatteryPopupView();
+            this.msgController.ShowPopupView( Common.Shareds.ePopupType.BatteryConfigView );
         }
 
         private void ExecuteInOutCommand( )
         {
-            this.msgController.ShowInOutPopupView();
+            this.msgController.ShowPopupView( Common.Shareds.ePopupType.InOutView );
         }
 
         private void ExecuteServoConfigCommand( )
         {
-            this.msgController.ShowServoConfigPopupView();
+            this.msgController.ShowPopupView( Common.Shareds.ePopupType.ServoConfigView );
         }
 
         public void Init( ) { }

+ 9 - 9
Dev/OHV/OHV.Module.MainViews/Views/SettingsViewModel.cs

@@ -47,47 +47,47 @@ namespace OHV.Module.MainViews.Views
 
         private void ExecuteDriveConfigPopupCommand()
         {
-            this.msgController.ShowServoConfigPopupView();
+            this.msgController.ShowPopupView( Common.Shareds.ePopupType.ServoConfigView );
         }
 
         private void ExecuteLockPopupCommand( )
         {
-            this.msgController.ShowLockPopupView();
+            this.msgController.ShowPopupView( Common.Shareds.ePopupType.LockServoView );
         }
 
         private void ExecuteDriveTeachPopupCommand( )
         {
-            this.msgController.ShowDrivePopupView();
+            this.msgController.ShowPopupView( Common.Shareds.ePopupType.DriveServoView );
         }
 
         private void ExecuteConveyorCommand( )
         {
-            this.msgController.ShowConveyorPopupView();
+            this.msgController.ShowPopupView( Common.Shareds.ePopupType.ConveyorControlView );
         }
 
         private void ExecuteConfigCommand()
         {
-            this.msgController.ShowConfigPopupView();
+            this.msgController.ShowPopupView( Common.Shareds.ePopupType.ConfigView );
         }
 
         private void ExecuteOpticalReadCommand( )
         {
-            this.msgController.ShowOpticalReadPopupView();
+            this.msgController.ShowPopupView( Common.Shareds.ePopupType.OpticalReadingConfigView );
         }
 
         private void ExecuteBatteryCommand( )
         {
-            this.msgController.ShowBatteryPopupView();
+            this.msgController.ShowPopupView( Common.Shareds.ePopupType.BatteryConfigView );
         }
 
         private void ExecuteInOutCommand( )
         {
-            this.msgController.ShowInOutPopupView();
+            this.msgController.ShowPopupView( Common.Shareds.ePopupType.InOutView );
         }
 
         private void ExecuteServoConfigCommand( )
         {
-            this.msgController.ShowServoConfigPopupView();
+            this.msgController.ShowPopupView( Common.Shareds.ePopupType.ServoConfigView );
         }
 
         public void Init()

+ 5 - 5
Dev/OHV/OHV.Module.MainViews/Views/TeachViewModel.cs

@@ -41,27 +41,27 @@ namespace OHV.Module.MainViews.Views
 
         private void ExecuteInOutControlPopup( )
         {
-            this.msgController.ShowInOutControlPopupView();
+            this.msgController.ShowPopupView( Common.Shareds.ePopupType.InOutControlView );
         }
 
         private void ExecuteDriveTeachPopupCommand( )
         {
-            this.msgController.ShowDrivePopupView();
+            this.msgController.ShowPopupView( Common.Shareds.ePopupType.DriveServoView );
         }
 
         private void ExecuteLockPopupCommand( )
         {
-            this.msgController.ShowLockPopupView();
+            this.msgController.ShowPopupView( Common.Shareds.ePopupType.LockServoView );
         }
 
         private void ExecuteServoConfigCommand( )
         {
-            this.msgController.ShowServoConfigPopupView();
+            this.msgController.ShowPopupView( Common.Shareds.ePopupType.ServoConfigView );
         }
 
         private void ExecuteMapCommand( )
         {
-            this.msgController.ShowMapPopupView();
+            this.msgController.ShowPopupView( Common.Shareds.ePopupType.MapView );
         }
 
         public void Init( )

+ 1 - 1
Dev/OHV/OHV.Vehicle/Concept/D_MainWindowViewModel.cs

@@ -295,7 +295,7 @@ namespace OHV.Vehicle.Concept
 
         private void ExecuteBatteryPopup()
         {
-            this.messageController.ShowBatteryPopupView();
+            this.messageController.ShowPopupView( Common.Shareds.ePopupType.BatteryConfigView );
         }
 
         void QuzOnResourceUsage()

+ 18 - 15
Dev/OHV/VehicleControlSystem/ControlLayer/MQ/ZmqManager.cs

@@ -273,20 +273,6 @@ namespace VehicleControlSystem.ControlLayer.MQ
             set { SetField(ref this.jogSpeed, value); }
         }
 
-        private bool isDriveOn;
-
-        public bool IsDriveOn
-        {
-            get { return isDriveOn; }
-            set 
-            {
-                if(SetField(ref this.isDriveOn, value))
-                {
-
-                }
-            }
-        }
-
         #endregion
 
         IO.EzIO iO = null;
@@ -365,6 +351,8 @@ namespace VehicleControlSystem.ControlLayer.MQ
             this.DecelSpeed = this.GetDecelSpeed();
             this.CreepSpeed = this.GetCreepSpeed();
             this.CreepDistance = this.GetCreepDistance();
+
+            this.DriveState = this.GetCurrentDriveState();
         }
 
         private void BMUManager_OnChangedReceivedData( Serial.DataModel.ReceivedData obj )
@@ -1170,12 +1158,27 @@ namespace VehicleControlSystem.ControlLayer.MQ
             return true;
         }
 
+        public eDriveState GetCurrentDriveState()
+        {
+            //TODO: GetCurrentDriveState(???) Value 입력 필요
+            var result = this.RequestDrive( "getm" , "9999" );
+            if(result.Count == 0)
+            {
+                logger.E( $"[GetDriveState] - DriveState TimeOut" );
+            }
+
+            int ret = 0;
+            int.TryParse( result[ 0 ] , out ret );
+
+            return ( eDriveState )ret;
+        }
+
         public double GetDriveLinerSpeed()
         {
             var rll = this.RequestDrive( "getm", "3016" );
             if ( rll.Count == 0 )
             {
-                logger.E( $"[Set Drive Speed] - Drive Speed Time Out" );
+                logger.E( $"[Get Drive Speed] - Drive Speed Time Out" );
                 return 0d;
             }