Parcourir la source

Merge branch 'master' of http://unque781.synology.me:3000/GSI/OHV

SK.Kang il y a 6 ans
Parent
commit
5111b63287

+ 9 - 10
Dev/OHV/OHV.Common/Events/MessageEventArgs.cs

@@ -30,9 +30,13 @@ namespace OHV.Common.Events
 
             RspAddCommand,
 
+            RspConveyorMove,
             RspConveyorLoad,
             RspConveyorUnload,
 
+            RspPIOConveyor,
+            RspPIOBatteryCharge,
+
             RspObstaclePatternChg,
             RspObstaclePatternNo,
         }
@@ -76,8 +80,13 @@ namespace OHV.Common.Events
 
             ReqAddCommand,
             ReqTest,
+
+            ReqConveyorMove,
             ReqConveyorLoad,
             ReqConveyorUnload,
+            
+            ReqPIOConveyor,
+            ReqPIOBatteryCharge,
 
             ReqObstaclePatternChg,
             ReqObstaclePatternNo,
@@ -210,20 +219,10 @@ namespace OHV.Common.Events
             RIGHT,
         }
 
-        public enum eCvDir
-        {
-            NONE = -1,
-            CW = 0,
-            CCW,
-            STOP
-        }
-
 
         public double CurrentPosition { get; set; }
         public int TargetRouteID { get; set; }
 
-        public eCvDir CvDir { get; set; }
-
         public eJogMoveDir JogDir { get; set; }
         public eEventDir EventDir { get; set; }
         public eControlKind ControlKind { get; set; }

+ 2 - 2
Dev/OHV/OHV.LanguageHalper/Languages/English.xaml

@@ -4,7 +4,7 @@
                     xmlns:system="clr-namespace:System;assembly=mscorlib"
                     >
 
-    <system:String x:Key="MainView_Main">Main</system:String>
-    <system:String x:Key="MainView_Teach">Teach</system:String>
+    <system:String x:Key="MainView_Main">MAIN</system:String>
+    <system:String x:Key="MainView_Teach">TEACH</system:String>
 
 </ResourceDictionary>

+ 130 - 56
Dev/OHV/OHV.Module.Interactivity/PopUp/ConveyorControlView.xaml

@@ -9,8 +9,8 @@
              prism:ViewModelLocator.AutoWireViewModel="True"
              xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
              Background="#455a64"
-             Height="650"
-             Width="800">
+             Height="750"
+             Width="900">
 
     <prism:Dialog.WindowStyle>
         <Style TargetType="Window">
@@ -44,21 +44,29 @@
         <Grid Grid.Row="0">
             <TextBlock Margin="15,0,0,0" Text="Conveyor View" FontSize="25" Foreground="White"/>
         </Grid>
-        
-        <Grid Grid.Column="0" Grid.Row="1">
+
+        <Grid Grid.Row="1">
             <Grid Margin="15" Background="#37474f">
                 <Grid.RowDefinitions>
                     <RowDefinition Height="*"/>
                     <RowDefinition Height="*"/>
                 </Grid.RowDefinitions>
-                
-                <Border BorderBrush="Gray" BorderThickness="1" Grid.Row="0"/>
-                <Border BorderBrush="Gray" BorderThickness="1" Grid.Row="1"/>
-                
+
+                <Rectangle Grid.Row="1" Stroke="Gray" Margin="0,84,0,0" RadiusY="23.833" RadiusX="23.833"/>
+
+                <StackPanel VerticalAlignment="Top" HorizontalAlignment="Center" Margin="250,0,0,0">
+                    <Button Content="Batch Command" Foreground="Orange" Background="{x:Null}" FontSize="20"
+                            VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5"
+                            Width="250" Height="50"
+                            Style="{StaticResource MaterialDesignRaisedButton}"
+                            materialDesign:ButtonAssist.CornerRadius="10"/>
+                </StackPanel>
+
                 <Grid Grid.Row="0">
                     <Grid.ColumnDefinitions>
                         <ColumnDefinition Width="*"/>
                         <ColumnDefinition Width="*"/>
+                        <ColumnDefinition Width="*"/>
                     </Grid.ColumnDefinitions>
 
                     <StackPanel Grid.Column="0"
@@ -66,7 +74,7 @@
                                 HorizontalAlignment="Center"
                                 VerticalAlignment="Center">
 
-                        <Button Background="{x:Null}" HorizontalContentAlignment="Left">
+                        <!--<Button Background="{x:Null}" HorizontalContentAlignment="Left">
                             <StackPanel Orientation="Horizontal">
                                 <Ellipse Margin="0,0,16,0" Width="20" Height="20" Fill="{Binding CvRun, FallbackValue=Gray}"/>
                                 <TextBlock Text="CV Running" />
@@ -106,39 +114,31 @@
                                 <Ellipse Margin="0,0,30,0" Width="20" Height="20" Fill="{Binding CvStop, FallbackValue=Gray}"/>
                                 <TextBlock Text="CV Stop"/>
                             </StackPanel>
-                        </Button>
-
+                        </Button>-->
                     </StackPanel>
 
-                    <Grid Grid.Column="1">
-                        <Grid.RowDefinitions>
-                            <RowDefinition Height="*"/>
-                            <RowDefinition Height="*"/>
-                            <RowDefinition Height="*"/>
-                        </Grid.RowDefinitions>
-
-                        <StackPanel Orientation="Horizontal"
-                                HorizontalAlignment="Center"
-                                VerticalAlignment="Top"
-                                Grid.Row="0" Margin="20">
-                            <Button Content="Conveyor Control" Foreground="Orange" Background="{x:Null}" FontSize="20"
-                            VerticalAlignment="Top" HorizontalAlignment="Left"
-                            Width="Auto" Height="50"/>
+                    <Grid Grid.Column="0">
+                        <Rectangle Stroke="Gray" Margin="0,60,0,0" RadiusY="23.833" RadiusX="23.833"/>
+                        
+                        <StackPanel VerticalAlignment="Top" HorizontalAlignment="Center">
+                            <Button Content="Unit Command" Foreground="Orange" Background="{x:Null}" FontSize="20"
+                            VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5"
+                            Width="Auto" Height="50"
+                            Style="{StaticResource MaterialDesignRaisedButton}"
+                            materialDesign:ButtonAssist.CornerRadius="10"/>
                         </StackPanel>
 
-                        <StackPanel Orientation="Horizontal"
-                                HorizontalAlignment="Center"
-                                Grid.Row="1">
-
+                        <StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Center"
+                                    Margin="0,60,0,0">
                             <Button HorizontalAlignment="Stretch"
                             Style="{StaticResource MaterialDesignRaisedButton}"
                             materialDesign:ButtonAssist.CornerRadius="10"
                             Command="{Binding ConveyorRunCommand}"
                             CommandParameter="CW"
-                            Height="80" Width="80"
+                            Height="Auto" Width="154"
                             Margin="10">
                                 <StackPanel>
-                                    <materialDesign:PackIcon Kind="TransferUp" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
+                                    <materialDesign:PackIcon Kind="RotateRight" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
                                     <TextBlock Text="CW" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
                                 </StackPanel>
                             </Button>
@@ -146,12 +146,12 @@
                             <Button 
                             Style="{StaticResource MaterialDesignRaisedButton}"
                             materialDesign:ButtonAssist.CornerRadius="10"
-                            Height="80" Width="80"
+                            Height="Auto" Width="154"
                             Margin="10"
                             Command="{Binding ConveyorRunCommand}"
                             CommandParameter="CCW">
                                 <StackPanel>
-                                    <materialDesign:PackIcon Kind="TransferDown" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
+                                    <materialDesign:PackIcon Kind="RotateLeft" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
                                     <TextBlock Text="CCW" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
                                 </StackPanel>
                             </Button>
@@ -161,45 +161,120 @@
                             materialDesign:ButtonAssist.CornerRadius="10"
                             Command="{Binding ConveyorRunCommand}"
                             CommandParameter="STOP"
-                            Height="80" Width="80"
-                            Margin="10">
+                            Height="Auto" Width="154"
+                            Margin="5">
                                 <StackPanel>
                                     <materialDesign:PackIcon Kind="StopCircleOutline" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
                                     <TextBlock Text="Stop" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
                                 </StackPanel>
                             </Button>
                         </StackPanel>
-                        <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center">
+                    </Grid>
+
+                    <Grid Grid.Column="1">
+                        <Rectangle Stroke="Gray" Margin="0,60,0,0" RadiusY="23.833" RadiusX="23.833"/>
+
+                        <StackPanel Grid.Row="2" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,60,0,0">
 
                             <Button HorizontalAlignment="Stretch"
                             Style="{StaticResource MaterialDesignRaisedButton}"
                             materialDesign:ButtonAssist.CornerRadius="10"
                             Command="{Binding LoadUnloadCommand}"
                             CommandParameter="Load"
-                            Height="80" Width="80"
+                            Height="Auto" Width="154"
                             Margin="10">
                                 <StackPanel>
                                     <materialDesign:PackIcon Kind="ArrowCollapseDown" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
-                                    <TextBlock Text="Load" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
+                                    <TextBlock Text="Tray Load" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
                                 </StackPanel>
                             </Button>
 
                             <Button 
                             Style="{StaticResource MaterialDesignRaisedButton}"
                             materialDesign:ButtonAssist.CornerRadius="10"
-                            Height="80" Width="80"
+                            Height="Auto" Width="154"
                             Margin="10"
                             Command="{Binding LoadUnloadCommand}"
                             CommandParameter="Unload">
-                                <StackPanel>
+                                <StackPanel RenderTransformOrigin="0.5,0.5" >
                                     <materialDesign:PackIcon Kind="ArrowExpandUp" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
-                                    <TextBlock Text="Unlaod" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
+                                    <TextBlock Text="Tray UnLoad" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
+                                </StackPanel>
+                            </Button>
+                        </StackPanel>
+                    </Grid>
+
+                    <Grid Grid.Column="2">
+                        <Rectangle Stroke="Gray" Margin="0,60,0,0" RadiusY="23.833" RadiusX="23.833"/>
+                        
+                        <StackPanel Grid.Row="2" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,60,0,0">
+
+                            <Button HorizontalAlignment="Stretch"
+                            Style="{StaticResource MaterialDesignRaisedButton}"
+                            materialDesign:ButtonAssist.CornerRadius="10"
+                            Command="{Binding LoadUnloadCommand}"
+                            CommandParameter="PL"
+                            Height="Auto" Width="Auto"
+                            Margin="10">
+                                <StackPanel>
+                                    <materialDesign:PackIcon Kind="ContactlessPayment" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto" RenderTransformOrigin="0.5,0.5">
+                                        <materialDesign:PackIcon.RenderTransform>
+                                            <TransformGroup>
+                                                <ScaleTransform/>
+                                                <SkewTransform/>
+                                                <RotateTransform Angle="90"/>
+                                                <TranslateTransform/>
+                                            </TransformGroup>
+                                        </materialDesign:PackIcon.RenderTransform>
+                                    </materialDesign:PackIcon>
+                                    <TextBlock Text="PIO Tray Load" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
+                                </StackPanel>
+                            </Button>
+
+                            <Button 
+                            Style="{StaticResource MaterialDesignRaisedButton}"
+                            materialDesign:ButtonAssist.CornerRadius="10"
+                            Height="Auto" Width="Auto"
+                            Margin="10"
+                            Command="{Binding LoadUnloadCommand}"
+                            CommandParameter="PU">
+                                <StackPanel RenderTransformOrigin="0.5,0.5" >
+                                    <materialDesign:PackIcon Kind="ContactlessPayment" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto" RenderTransformOrigin="0.5,0.5">
+                                        <materialDesign:PackIcon.RenderTransform>
+                                            <TransformGroup>
+                                                <ScaleTransform ScaleY="1" ScaleX="-1"/>
+                                                <SkewTransform AngleY="0" AngleX="0"/>
+                                                <RotateTransform Angle="90"/>
+                                                <TranslateTransform/>
+                                            </TransformGroup>
+                                        </materialDesign:PackIcon.RenderTransform>
+                                    </materialDesign:PackIcon>
+                                    <TextBlock Text="PIO Tray UnLoad" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
+                                </StackPanel>
+                            </Button>
+
+                            <Button 
+                            Style="{StaticResource MaterialDesignRaisedButton}"
+                            materialDesign:ButtonAssist.CornerRadius="10"
+                            Height="Auto" Width="Auto"
+                            Margin="10"
+                            Command="{Binding PIOCharge}"
+                            CommandParameter="PB">
+                                <StackPanel RenderTransformOrigin="0.5,0.5" >
+                                    <materialDesign:PackIcon Kind="BatteryChargingWirelessEmpty" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
+                                    <TextBlock Text="PIO Battery Charge" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
                                 </StackPanel>
                             </Button>
                         </StackPanel>
                     </Grid>
                 </Grid>
 
+                <StackPanel Grid.Row="1" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="20">
+                    <Button Content="Clamp Control" Foreground="Orange" Background="{x:Null}" FontSize="20" Width="Auto" Height="50"
+                             Style="{StaticResource MaterialDesignRaisedButton}"
+                            materialDesign:ButtonAssist.CornerRadius="10"/>
+                </StackPanel>
+                
                 <Grid Grid.Row="1">
                     <Grid.ColumnDefinitions>
                         <ColumnDefinition Width="*"/>
@@ -207,9 +282,11 @@
                     </Grid.ColumnDefinitions>
                     
                     
+
                     <Grid Grid.Column="0">
-                        <StackPanel VerticalAlignment="Center"
-                                    HorizontalAlignment="Center">
+                        <StackPanel VerticalAlignment="Bottom"
+                                    HorizontalAlignment="Center"
+                                    Margin="20">
 
                             <Button Background="{x:Null}">
                                 <StackPanel Orientation="Horizontal">
@@ -256,30 +333,26 @@
                     </Grid>
 
                     <Grid Grid.Column="1">
-                        <StackPanel VerticalAlignment="Top" HorizontalAlignment="Center" Margin="20">
-                            <Button Content="Clamp Control" Foreground="Orange" Background="{x:Null}" FontSize="20"
-                            VerticalAlignment="Top" Width="Auto" Height="50"
-                            HorizontalAlignment="Left"/>
-                        </StackPanel>
 
                         <StackPanel Orientation="Horizontal"
-                                HorizontalAlignment="Center">
+                                HorizontalAlignment="Center" VerticalAlignment="Bottom"
+                                    Margin="0,0,0,70">
 
                             <Button Margin="15" 
-                                Width="100" Height="100"
+                                Width="154" Height="Auto"
                                 Style="{StaticResource MaterialDesignRaisedButton}"
                                 materialDesign:ButtonAssist.CornerRadius="10"
                                 Command="{Binding PosMoveCommand}"
                                 CommandParameter="Lock">
                                 <StackPanel>
                                     <materialDesign:PackIcon Kind="ElectricSwitchClosed" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
-                                    <TextBlock Text="Clamp" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
-                                    <TextBlock Text="Lock" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
+                                    <TextBlock Text="Clamp" FontSize="20" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
+                                    <TextBlock Text="Lock" FontSize="20" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
                                 </StackPanel>
                             </Button>
 
                             <Button Margin="15"
-                                Width="100" Height="100"
+                                Width="154" Height="Auto"
                                 Style="{StaticResource MaterialDesignRaisedButton}"
                                 materialDesign:ButtonAssist.CornerRadius="10"
                                 Command="{Binding PosMoveCommand}"
@@ -288,13 +361,14 @@
                                 <MouseBinding Gesture="LeftClick" Command="{Binding KeyInTargetPosCommand}" CommandParameter="Left"/>
                                 </Button.InputBindings>-->
                                 <StackPanel>
-                                    <materialDesign:PackIcon Kind="ElectricSwitch" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>                                    <TextBlock Text="Clamp" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
-                                    <TextBlock Text="UnLock" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
+                                    <materialDesign:PackIcon Kind="ElectricSwitch" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
+                                    <TextBlock Text="Clamp" FontSize="20" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
+                                    <TextBlock Text="UnLock" FontSize="20" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
                                 </StackPanel>
                             </Button>
                         </StackPanel>
                     </Grid>
-                    
+
                 </Grid>
             </Grid>
         </Grid>

+ 85 - 40
Dev/OHV/OHV.Module.Interactivity/PopUp/ConveyorControlViewModel.cs

@@ -124,6 +124,7 @@ namespace OHV.Module.Interactivity.PopUp
         public ICommand ConveyorRunCommand { get; set; }
         public ICommand PosMoveCommand { get; set; }
         public ICommand LoadUnloadCommand { get; set; }
+        public ICommand PIOCharge { get; set; }
 
         IEventAggregator eventAggregator;
         MessageController messageController;
@@ -157,9 +158,29 @@ namespace OHV.Module.Interactivity.PopUp
             this.ConveyorRunCommand = new DelegateCommand<object>( ExecuteCvCommand );
             this.PosMoveCommand = new DelegateCommand<object>( ExecutePosMoveCommand );
             this.LoadUnloadCommand = new DelegateCommand<string>( ExecuteLoadUnloadCommand );
+            this.PIOCharge = new DelegateCommand<string>( ExecutePIOChargeCommand );
 
         }
 
+        private void ExecutePIOChargeCommand( string obj )
+        {
+            this.messageController.ShowConfirmationPopupView( $"PIO Battery Charge ?" , r =>
+            {
+                if(r.Result == ButtonResult.OK)
+                {
+                    if(obj.ToString().Equals("PB"))
+                    {
+                        var msg = new VCSMessageEventArgs()
+                        {
+                            Kind = VCSMessageEventArgs.eVCSMessageKind.ReqPIOBatteryCharge ,
+                            MessageText = obj.ToString(),
+                        };
+                        this.eventAggregator.GetEvent<VCSMessagePubSubEvent>().Publish( msg );
+                    }
+                }
+            } );
+        }
+
         private void ExecuteLoadUnloadCommand( string obj )
         {
             this.messageController.ShowConfirmationPopupView( $"Conveyor Move Start ?" , r =>
@@ -174,7 +195,7 @@ namespace OHV.Module.Interactivity.PopUp
                           };
                           this.eventAggregator.GetEvent<VCSMessagePubSubEvent>().Publish( msg );
                       }
-                      else
+                      else if ( obj.ToString().Equals( "Unload" ) )
                       {
                           var msg = new VCSMessageEventArgs()
                           {
@@ -182,6 +203,25 @@ namespace OHV.Module.Interactivity.PopUp
                           };
                           this.eventAggregator.GetEvent<VCSMessagePubSubEvent>().Publish( msg );
                       }
+                      else if ( obj.ToString().Equals( "PL" ) )
+                      {
+                          var msg = new VCSMessageEventArgs()
+                          {
+                              MessageText = obj.ToString(),
+                              Kind = VCSMessageEventArgs.eVCSMessageKind.ReqPIOConveyor,
+                          };
+                          this.eventAggregator.GetEvent<VCSMessagePubSubEvent>().Publish( msg );
+                      }
+                      else if ( obj.ToString().Equals( "PU" ) )
+                      {
+                          var msg = new VCSMessageEventArgs()
+                          {
+                              MessageText = obj.ToString() ,
+                              Kind = VCSMessageEventArgs.eVCSMessageKind.ReqPIOConveyor ,
+                          };
+                          this.eventAggregator.GetEvent<VCSMessagePubSubEvent>().Publish( msg );
+                      }
+                      else { }
                   }
               } );
         }
@@ -237,6 +277,11 @@ namespace OHV.Module.Interactivity.PopUp
             else
                 this.CvStop = Brushes.Gray;
 
+            if ( bit.Tag.Equals( "OUT_CV_RUN" ) )
+                this.CvRun = Brushes.LimeGreen;
+            else
+                this.CvRun = Brushes.Gray;
+
             if ( bit.Tag.Equals( "OUT_CV_CWCCW" ) )
             {
                 this.CvCW = Brushes.LimeGreen;
@@ -251,22 +296,48 @@ namespace OHV.Module.Interactivity.PopUp
 
         private void UICallbackCommunication( GUIMessageEventArgs _args )
         {
-            if( _args.Kind == GUIMessageEventArgs.eGUIMessageKind.ModelPropertyChange)
+            var msg = string.Empty;
+
+            if ( _args.Kind == GUIMessageEventArgs.eGUIMessageKind.RspPIOConveyor)
             {
-                if( _args.MessageKey.Equals(MessageKey.Vehicle))
+                switch ( _args.MessageText )
                 {
-                    switch(_args.ModelPropertyName)
-                    {
-                        case "":
-                            break;
-                    }
+                    case "PL":
+                        {
+                            if ( _args.Result.IsSuccess )
+                                msg = "SUCCESS";
+                            else
+                                msg = "FAIL";
+                        }
+                        break;
+                    case "PU":
+                        {
+                            if ( _args.Result.IsSuccess )
+                                msg = "SUCCESS";
+                            else
+                                msg = "FAIL";
+
+                        }
+                        break;
                 }
+
+                this.messageController.ShowNotificationView( msg );
+
+            }
+            else if (_args.Kind == GUIMessageEventArgs.eGUIMessageKind.RspPIOBatteryCharge)
+            {
+                if ( _args.Result.IsSuccess )
+                    msg = "SUCCESS";
+                else
+                    msg = "FAIL";
+
+                this.messageController.ShowNotificationView( msg );
             }
         }
 
         private void ExecutePosMoveCommand( object obj )
         {
-            this.messageController.ShowConfirmationPopupView( "Carrier Move To ?" , r =>
+            this.messageController.ShowConfirmationPopupView( "Clamp Move ?" , r =>
             {
                 if ( r.Result == ButtonResult.OK )
                 {
@@ -396,39 +467,13 @@ namespace OHV.Module.Interactivity.PopUp
 
         private void ExecuteCvCommand( object _obj )
         {
-            var type = _obj.ToString();
-            DriveControlEventArgs.eCvDir dir = DriveControlEventArgs.eCvDir.NONE;
-
-            switch ( type )
-            {
-                case "CW":
-                    dir = DriveControlEventArgs.eCvDir.CW;
-                    break;
-                case "CCW":
-                    dir = DriveControlEventArgs.eCvDir.CCW;
-                    break;
-                case "STOP":
-                    dir = DriveControlEventArgs.eCvDir.STOP;
-                    break;
-            }
-
-            var msg = new DriveControlEventArgs
+            var dir = _obj.ToString();
+            var msg = new VCSMessageEventArgs()
             {
-                EventDir = DriveControlEventArgs.eEventDir.ToBack ,
-                ControlKind = DriveControlEventArgs.eControlKind.Conveyor ,
-                CvDir = dir
+                Kind = VCSMessageEventArgs.eVCSMessageKind.ReqConveyorMove ,
+                MessageText = dir
             };
-            this.PublishEvent( msg );
-        }
-
-        private void PublishEvent( DriveControlEventArgs _args )
-        {
-            this.eventAggregator.GetEvent<DriveControlPubSubEvent>().Publish( _args );
-        }
-
-        private void IOPublish( VCSMessageEventArgs _args )
-        {
-            this.eventAggregator.GetEvent<VCSMessagePubSubEvent>().Publish( _args );
+            this.eventAggregator.GetEvent<VCSMessagePubSubEvent>().Publish( msg );
         }
 
         #region Dialog

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

@@ -59,7 +59,7 @@
     <Grid>
         <Grid.ColumnDefinitions>
             <ColumnDefinition/>
-            <ColumnDefinition Width="130"/>
+            <!--<ColumnDefinition Width="130"/>-->
             <ColumnDefinition Width="130"/>
         </Grid.ColumnDefinitions>
         <Grid.RowDefinitions>
@@ -148,7 +148,7 @@
                     <ColumnDefinition Width="*"/>
                 </Grid.ColumnDefinitions>
 
-                <Border Margin="0,5,163,5" BorderBrush="#FF00FFD3" BorderThickness="2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.RowSpan="4" Grid.Column="2"/>
+                <Border Margin="0,5,189,5" BorderBrush="#FF00FFD3" BorderThickness="2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.RowSpan="4" Grid.Column="2"/>
                 <Border Margin="33,-2,34,82" BorderBrush="#FF00FFD3" BorderThickness="2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.Column="2" Grid.ColumnSpan="3" Grid.RowSpan="2"/>
 
                 <Button Grid.Column="0" Grid.Row="1" HorizontalAlignment="Stretch" Margin="5" Height="auto"
@@ -288,12 +288,12 @@
         </Grid>
 
         <!--Sub Drive Menu-->
-        <Grid Grid.Column="1" Background="#37474f" Grid.RowSpan="2">
+        <!--<Grid Grid.Column="1" Background="#37474f" Grid.RowSpan="2">
             <StackPanel Orientation="Vertical" VerticalAlignment="Top">
-                <!--<Button Margin="7, 10" HorizontalAlignment="Stretch" Height="60" BorderBrush="Gray" BorderThickness="2" 
+                <Button Margin="7, 10" HorizontalAlignment="Stretch" Height="60" BorderBrush="Gray" BorderThickness="2" 
                         Command="{Binding PositionAddCommand}">
                     <StackPanel>
-                        --><!--<materialDesign:PackIcon Kind="PowerSettings" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>--><!--
+                        <materialDesign:PackIcon Kind="PowerSettings" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
                         <TextBlock Text="Add" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
                     </StackPanel>
                 </Button>
@@ -301,33 +301,33 @@
                 <Button Margin="7, 10" HorizontalAlignment="Stretch" Height="60" BorderBrush="Gray" BorderThickness="2" 
                         Command="{Binding PositionDeleteCommand}">
                     <StackPanel>
-                        --><!--<materialDesign:PackIcon Kind="PowerSettings" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>--><!--
+                        <materialDesign:PackIcon Kind="PowerSettings" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
                         <TextBlock Text="Delete" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
                     </StackPanel>
-                </Button>-->
+                </Button>
 
             </StackPanel>
 
             <StackPanel Grid.Column="1" VerticalAlignment="Center" Orientation="Vertical"
                         Margin="0,130,0,0">
-                <!--<Button Margin="7" HorizontalAlignment="Stretch" Height="60" BorderBrush="Gray" BorderThickness="2" 
+                <Button Margin="7" HorizontalAlignment="Stretch" Height="60" BorderBrush="Gray" BorderThickness="2" 
                         Command="{Binding CurrentToTargetCommand}">
                     <StackPanel>
-                        --><!--<materialDesign:PackIcon Kind="PowerSettings" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>--><!--
+                        <materialDesign:PackIcon Kind="PowerSettings" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
                         <TextBlock Text="Current To" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
                         <TextBlock Text="Target" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
                     </StackPanel>
-                </Button>-->
+                </Button>
 
                 <Button Margin="10,0,10,10" HorizontalAlignment="Stretch" Height="90" BorderBrush="Gray" BorderThickness="2" 
                         Command="{Binding MoveToCommand}">
                     <StackPanel>
-                        <!--<materialDesign:PackIcon Kind="PowerSettings" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>-->
+                        <materialDesign:PackIcon Kind="PowerSettings" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
                         <TextBlock Text="Move To" VerticalAlignment="Stretch" HorizontalAlignment="Center" FontSize="20"/>
                     </StackPanel>
                 </Button>
             </StackPanel>
-        </Grid>
+        </Grid>-->
 
         <!--Right Drive Menu-->
         <Grid Grid.Column="2" Background="#263238" Grid.RowSpan="2">
@@ -354,12 +354,12 @@
                     </StackPanel>
                 </Button>
 
-                <Button Margin="10,10,10,5" HorizontalAlignment="Stretch" Height="90" BorderBrush="Gray" BorderThickness="2" Command="{Binding OriginCommand}">
+                <!--<Button Margin="10,10,10,5" HorizontalAlignment="Stretch" Height="90" BorderBrush="Gray" BorderThickness="2" Command="{Binding OriginCommand}">
                     <StackPanel>
                         <materialDesign:PackIcon Kind="Origin" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
                         <TextBlock Text="Origin" VerticalAlignment="Stretch" HorizontalAlignment="Center" FontSize="20"/>
                     </StackPanel>
-                </Button>
+                </Button>-->
             </StackPanel>
 
             <StackPanel VerticalAlignment="Bottom">

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

@@ -68,7 +68,7 @@
                             Margin="30">
                     <Button Height="60">
                         <StackPanel>
-                            <TextBlock><Run Text="SafeDetect State" FontSize="20"/></TextBlock>
+                            <TextBlock><Run Text="Detect State" FontSize="20"/></TextBlock>
                         </StackPanel>
                     </Button>
 

+ 10 - 0
Dev/OHV/OHV.Module.MainViews/OHV.Module.MainViews.csproj

@@ -100,6 +100,12 @@
     <Compile Include="Views\HistoryViewModel.cs">
       <DependentUpon>HistoryView.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\SettingView.xaml.cs">
+      <DependentUpon>SettingView.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\SettingViewModel.cs">
+      <DependentUpon>SettingView.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\TeachView.xaml.cs">
       <DependentUpon>TeachView.xaml</DependentUpon>
     </Compile>
@@ -121,6 +127,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\SettingView.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\TeachView.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 20 - 0
Dev/OHV/OHV.Module.MainViews/Views/SettingView.xaml

@@ -0,0 +1,20 @@
+<UserControl x:Class="OHV.Module.MainViews.Views.SettingView"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:local="clr-namespace:OHV.Module.MainViews.Views"
+             xmlns:prism="http://prismlibrary.com/"      
+             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+             prism:ViewModelLocator.AutoWireViewModel="True"
+             mc:Ignorable="d" 
+             Height="942"
+             Width="Auto"
+             MinWidth="1386"
+             Background="#37474f">
+    <Grid>
+        <Grid Margin="15,15" Background="#263238">
+            
+        </Grid>
+    </Grid>
+</UserControl>

+ 28 - 0
Dev/OHV/OHV.Module.MainViews/Views/SettingView.xaml.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace OHV.Module.MainViews.Views
+{
+    /// <summary>
+    /// SettingView.xaml에 대한 상호 작용 논리
+    /// </summary>
+    public partial class SettingView : UserControl
+    {
+        public SettingView( )
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 12 - 0
Dev/OHV/OHV.Module.MainViews/Views/SettingViewModel.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OHV.Module.MainViews.Views
+{
+    class SettingViewModel
+    {
+    }
+}

+ 2 - 2
Dev/OHV/OHV.Module.MainViews/Views/TeachView.xaml

@@ -34,7 +34,7 @@
                             Height="150" Width="220">
                         <StackPanel>
                             <materialDesign:PackIcon Kind="CarTractionControl" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="100"/>
-                            <TextBlock FontSize="30" Text="Drive Teach" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
+                            <TextBlock FontSize="30" Text="Drive" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
                         </StackPanel>
                     </Button>
 
@@ -46,7 +46,7 @@
                              Height="150" Width="220">
                         <StackPanel>
                             <materialDesign:PackIcon Kind="PackageUp" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="100"/>
-                            <TextBlock FontSize="30" Text="Lock Teach" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
+                            <TextBlock FontSize="30" Text="Clamp" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
                         </StackPanel>
                     </Button>
 

+ 2 - 2
Dev/OHV/OHV.Module.MainViews/Views/UnitView.xaml

@@ -52,7 +52,7 @@
                             Height="150" Width="220">
                             <StackPanel>
                                 <materialDesign:PackIcon Kind="RobotMowerOutline" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="100"/>
-                                <TextBlock FontSize="30" Text="Driving" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
+                                <TextBlock FontSize="30" Text="Drive" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
                             </StackPanel>
                         </Button>
 
@@ -95,7 +95,7 @@
                             Command="{Binding OpticalReaderPopup}"
                             Height="150" Width="220">
                             <StackPanel>
-                                <materialDesign:PackIcon Kind="WifiStrength2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="auto" Height="100"/>
+                                <materialDesign:PackIcon Kind="Altimeter" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="auto" Height="100"/>
                                 <TextBlock FontSize="30" Text="Detect" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
                             </StackPanel>
                         </Button>

+ 18 - 13
Dev/OHV/VehicleControlSystem/ControlLayer/Serial/BatteryTabos/Advantech/Advantech.cs

@@ -328,19 +328,24 @@ namespace VehicleControlSystem.ControlLayer.Serial.BatteryTabos
             var ll = recv.Select( x => x.data ).ToList();
             
             if ( ll.Count <= 0 && !ll.Any() )
-                return;
-
-            ll.ForEach( r =>
-             {
-                 if ( r[ 1 ] == 1 )
-                 { CanRecvSave( r , 1 ); }
-                 else if (r[1] == 2)
-                 { CanRecvSave( r , 2 ); }
-                 else if (r[1] == 3)
-                 { CanRecvSave( r , 3 ); }
-                 else
-                 { }
-             } );
+                return; 
+
+            try
+            {
+                ll.ForEach( r =>
+                {
+                    if ( r[ 1 ] == 1 )
+                    { CanRecvSave( r , 1 ); }
+                    else if ( r[ 1 ] == 2 )
+                    { CanRecvSave( r , 2 ); }
+                    else if ( r[ 1 ] == 3 )
+                    { CanRecvSave( r , 3 ); }
+                    else
+                    { }
+                } );
+            }
+            catch (Exception e)
+            { } 
         }
 
         void CanRecvSave(byte[] data, int index)

+ 67 - 26
Dev/OHV/VehicleControlSystem/ControlLayer/Serial/BatteryTabos/Peak/Peak.cs

@@ -37,6 +37,13 @@ namespace VehicleControlSystem.ControlLayer.Serial.BatteryTabos
         string errormsg = string.Empty;
 
         #region Enum
+        public enum eSendMode
+        {
+            MANUAL = 0,
+            AUTO,
+            AUTO_STOP
+        }
+
         enum eMsgCaseFirst : int
         {
             Voltage_LOW = 2,
@@ -95,23 +102,28 @@ namespace VehicleControlSystem.ControlLayer.Serial.BatteryTabos
 
             var result = PCANBasic.Initialize( this.handle , TPCANBaudrate.PCAN_BAUD_500K , TPCANType.PCAN_TYPE_ISA , IOPort: 460 , 3 );
 
-            if ( result == TPCANStatus.PCAN_ERROR_OK )
-            {
-                this.IsConnected = true;
-                //qqW.Enqueue( new QoConnected() );
-            }
+            if ( result != TPCANStatus.PCAN_ERROR_OK )
+                throw new Exception( "AdvCan Write Error" );
             else
-            {
-                this.IsConnected = false;
-                this.GetStatus();
-                logger.E( $"[Battery Peak] - {this.errormsg} - " );
-            }
-
-            manager._OnConnected();
+                this.IsConnected = this.GetStatus();
         }
 
         //Todo:Dll 에서 상태 가져오기
-        bool IsConnected = false;
+        bool isConnected = false;
+        public bool IsConnected
+        {
+            get => this.isConnected;
+            set
+            {
+                if ( this.isConnected == value ) return;
+                this.isConnected = value;
+
+                if ( value )
+                    this.manager._OnConnected();
+                else
+                    this.manager._OnDisconnected();
+            }
+        }
 
 
 
@@ -124,12 +136,9 @@ namespace VehicleControlSystem.ControlLayer.Serial.BatteryTabos
                     if ( !IsConnected )
                     {
                         this.TryToConnect();
-                        continue;
-                    }
-
-                    if ( !GetStatus() )
-                    {
-                        this.DisConnect();
+                        
+                        Thread.Sleep( 100 );
+                        
                         continue;
                     }
 
@@ -138,7 +147,7 @@ namespace VehicleControlSystem.ControlLayer.Serial.BatteryTabos
                     if ( o is PollingObject ) //Scan 을 주기적 으로 진행.
                     {
                         //this.PollingBattery();
-                        this.Write();
+                        this.Write(eSendMode.MANUAL);
                         this.ReadMessage();
                     }
                     //else if ( o is ISetData ) //하나의 명령을 수행.
@@ -150,7 +159,6 @@ namespace VehicleControlSystem.ControlLayer.Serial.BatteryTabos
                         //this.manager._InvokeChgdReceivedData();
                         this.manager._InvokeChgdWordsAndBits();
                     }
-
                 }
                 catch ( ThreadAbortException exception )
                 {
@@ -213,6 +221,38 @@ namespace VehicleControlSystem.ControlLayer.Serial.BatteryTabos
         /// true - auto,   false - manual
         /// </summary>
         /// <param name="auto"></param>
+        
+        public int Write(eSendMode mode)
+        {
+            var data = new TPCANMsg();
+            data.DATA = new byte[ 8 ];
+            data.ID = idOffset + Convert.ToByte( this.manager.BMUConfig.ID );
+            data.LEN = Convert.ToByte( 8 );
+            data.MSGTYPE = TPCANMessageType.PCAN_MESSAGE_STANDARD;
+
+            switch ( mode )
+            {
+                case eSendMode.MANUAL:
+                    data.DATA[ 0 ] = Convert.ToByte( 0x60 + Convert.ToByte( this.manager.BMUConfig.ID ) );
+                    break;
+                case eSendMode.AUTO:
+                    data.DATA[ 0 ] = 0xAA;
+                    data.DATA[ 1 ] = 0xE0;
+                    break;
+                case eSendMode.AUTO_STOP:
+                    data.DATA[ 0 ] = 0xAA;
+                    data.DATA[ 1 ] = 0x60;
+                    break;
+            }
+
+            var result = PeakCanWrite( this.handle , data );
+            
+            if ( result != TPCANStatus.PCAN_ERROR_OK )
+                throw new Exception( "Peak Write Fail" );
+
+            return 0;
+        }
+
         public int Write(bool auto = false)
         {
             var data = new TPCANMsg();
@@ -268,20 +308,21 @@ namespace VehicleControlSystem.ControlLayer.Serial.BatteryTabos
                 if ( stsResult == TPCANStatus.PCAN_ERROR_BUSHEAVY )
                     throw new Exception( "DisConnect" );
 
-                if ( stsResult != TPCANStatus.PCAN_ERROR_QRCVEMPTY)
+                if ( stsResult != TPCANStatus.PCAN_ERROR_QRCVEMPTY )
                 {
                     this.PeackCANRecv( canMsg );
                 }
                 // We process the received message
                 else if ( !Convert.ToBoolean( stsResult & TPCANStatus.PCAN_ERROR_QRCVEMPTY ) == false )
                 {
-                    logger.E( $"[Battery Peak] - {stsResult} -" );
-                    return stsResult;
+                    throw new Exception( "Peak Buffer Empty" );
                 }
-                else if (stsResult == TPCANStatus.PCAN_ERROR_BUSHEAVY || stsResult == TPCANStatus.PCAN_ERROR_BUSOFF)
+                else if ( stsResult == TPCANStatus.PCAN_ERROR_BUSHEAVY || stsResult == TPCANStatus.PCAN_ERROR_BUSOFF )
                 {
-                    throw new Exception("CAN DisConnect");
+                    throw new Exception( "Peak CAN DisConnect" );
                 }
+                else
+                    throw new Exception( "" );
             }
 
             return stsResult;

+ 51 - 50
Dev/OHV/VehicleControlSystem/ControlLayer/Vehicle.cs

@@ -186,87 +186,89 @@ namespace VehicleControlSystem.ControlLayer
         }
 
         public bool IsMoving { get; set; }
+        #region Battery Property
 
         double batteryVoltage;
-        public double BatteryVoltage 
-        { 
-            get { return this.batteryVoltage; } 
-            set { this.SetField( ref this.batteryVoltage , value );} 
+        public double BatteryVoltage
+        {
+            get { return this.batteryVoltage; }
+            set { this.SetField( ref this.batteryVoltage , value ); }
         }
 
         double batteryCurrent;
-        public double BatteryCurrent 
-        { 
-            get { return this.batteryCurrent; } 
-            set{this.SetField(ref this.batteryCurrent, value); } 
+        public double BatteryCurrent
+        {
+            get { return this.batteryCurrent; }
+            set { this.SetField( ref this.batteryCurrent , value ); }
         }
 
         double batteryState;
-        public double BatteryState 
-        { 
-            get { return this.batteryState; } 
-            set { this.SetField( ref this.batteryState , value); } 
+        public double BatteryState
+        {
+            get { return this.batteryState; }
+            set { this.SetField( ref this.batteryState , value ); }
         }
 
         double batteryChargeTime;
-        public double BatteryChargeTime 
-        { 
-            get { return this.batteryChargeTime; } 
-            set { this.SetField( ref this.batteryChargeTime , value ); } 
+        public double BatteryChargeTime
+        {
+            get { return this.batteryChargeTime; }
+            set { this.SetField( ref this.batteryChargeTime , value ); }
         }
 
         double batteryDisChargeTime;
-        public double BatteryDisChargeTime 
-        { 
-            get { return this.batteryDisChargeTime; } 
-            set { this.SetField( ref this.batteryDisChargeTime , value ); } 
+        public double BatteryDisChargeTime
+        {
+            get { return this.batteryDisChargeTime; }
+            set { this.SetField( ref this.batteryDisChargeTime , value ); }
         }
 
         double batteryStateOfCharge;
-        public double BatteryStateOfCharge 
-        { 
-            get { return this.batteryStateOfCharge; } 
-            set { this.SetField( ref this.batteryStateOfCharge , value ); } 
+        public double BatteryStateOfCharge
+        {
+            get { return this.batteryStateOfCharge; }
+            set { this.SetField( ref this.batteryStateOfCharge , value ); }
         }
 
         double batteryStateOfHealth;
-        public double BatteryStateOfHealth 
-        { 
-            get { return this.batteryStateOfHealth; } 
-            set { this.SetField( ref this.batteryStateOfHealth , value ); } 
+        public double BatteryStateOfHealth
+        {
+            get { return this.batteryStateOfHealth; }
+            set { this.SetField( ref this.batteryStateOfHealth , value ); }
         }
 
         double batteryCapacity;
-        public double BatteryCapacity 
-        { 
-            get { return this.batteryCapacity; } 
-            set { this.SetField( ref this.batteryCapacity , value ); } 
+        public double BatteryCapacity
+        {
+            get { return this.batteryCapacity; }
+            set { this.SetField( ref this.batteryCapacity , value ); }
         }
 
         double batteryEnergy;
-        public double BatteryEnergy 
-        { 
-            get { return this.batteryEnergy; } 
-            set { this.SetField( ref this.batteryEnergy , value ); } 
+        public double BatteryEnergy
+        {
+            get { return this.batteryEnergy; }
+            set { this.SetField( ref this.batteryEnergy , value ); }
         }
 
         double batteryTemperature;
-        public double BatteryTemperature 
-        { 
-            get { return this.batteryTemperature; } 
-            set { this.SetField( ref this.batteryTemperature , value ); } 
+        public double BatteryTemperature
+        {
+            get { return this.batteryTemperature; }
+            set { this.SetField( ref this.batteryTemperature , value ); }
         }
 
         bool batteryIsConnect;
-        public bool BatteryIsConnect 
-        { 
-            get 
+        public bool BatteryIsConnect
+        {
+            get
             {
                 this.BatteryIsConnect = this.bMUManager.IsConnected;
-                return this.bMUManager.IsConnected; 
+                return this.bMUManager.IsConnected;
             }
             set { this.SetField( ref this.batteryIsConnect , value ); }
-        }
+        } 
+        #endregion
         public bool IsError { get; set; }
 
         public SubCmd CurrentSubCommand { get; private set; }
@@ -458,7 +460,6 @@ namespace VehicleControlSystem.ControlLayer
                     case DriveControlEventArgs.eControlKind.NONE:
                         break;
                     case DriveControlEventArgs.eControlKind.Conveyor:
-                        this.ReqConveyor( _args );
                         break;
                     default:
                         break;
@@ -466,13 +467,13 @@ namespace VehicleControlSystem.ControlLayer
             }
         }
 
-        private void ReqConveyor( DriveControlEventArgs args )
+        public void ReqConveyorMove( string dir )
         {
-            if ( args.CvDir == DriveControlEventArgs.eCvDir.CW ) //Load
+            if ( dir.Equals("CW") ) 
                 this.OnOffConveyor( true, false );
-            else if ( args.CvDir == DriveControlEventArgs.eCvDir.CCW ) //Unload
+            else if ( dir.Equals("CCW")) 
                 this.OnOffConveyor( true, true );
-            else if ( args.CvDir == DriveControlEventArgs.eCvDir.STOP )
+            else if ( dir.Equals("STOP") )
                 this.OnOffConveyor( false, false );
         }
 

+ 67 - 4
Dev/OHV/VehicleControlSystem/VCSystem.cs

@@ -154,23 +154,38 @@ namespace VehicleControlSystem
                 case VCSMessageEventArgs.eVCSMessageKind.ReqTest:
                     ReqTest();
                     break;
+                case VCSMessageEventArgs.eVCSMessageKind.ReqConveyorMove:
+                    ReqConveyorMove( msg );
+                    break;
                 case VCSMessageEventArgs.eVCSMessageKind.ReqConveyorLoad:
-                    ReqConveyorLoad();
+                    ReqConveyorLoad( msg );
                     break;
                 case VCSMessageEventArgs.eVCSMessageKind.ReqConveyorUnload:
                     ReqConveyorUnload();
                     break;
                 case VCSMessageEventArgs.eVCSMessageKind.ReqObstaclePatternChg:
-                    ReqObsticlePatternChange(msg);
+                    ReqObsticlePatternChange( msg );
                     break;
                 case VCSMessageEventArgs.eVCSMessageKind.ReqObstaclePatternNo:
                     ReqObsticlePatternNo();
                     break;
+                case VCSMessageEventArgs.eVCSMessageKind.ReqPIOConveyor:
+                    this.ReqPIOConveyor( msg );
+                    break;
+                case VCSMessageEventArgs.eVCSMessageKind.ReqPIOBatteryCharge:
+                    this.ReqPIOBattery( msg );
+                    break;
                 default:
                     break;
             }
         }
 
+        private void ReqConveyorMove( VCSMessageEventArgs msg )
+        {
+            var result = 0;
+            this.vehicle.ReqConveyorMove(msg.MessageText);
+        }
+
         private void ReqObsticlePatternNo()
         {
             var reply = new GUIMessageEventArgs();
@@ -198,12 +213,60 @@ namespace VehicleControlSystem
             result = this.vehicle.ConveyorUnload();
         }
 
-        private void ReqConveyorLoad()
+        private void ReqConveyorLoad(VCSMessageEventArgs msg)
         {
             int result = 0;
+           
             result = this.vehicle.ConveyorLoad();
         }
 
+        private void ReqPIOConveyor(VCSMessageEventArgs msg)
+        {
+            int result = 0;
+
+            var reply = new GUIMessageEventArgs()
+            {
+                Kind = GUIMessageEventArgs.eGUIMessageKind.RspPIOConveyor,
+                MessageText = msg.MessageText,
+                
+            };
+
+            /*PIO Load// Unload*/
+            if ( msg.MessageText.Equals( "PL" ) )
+                result = this.vehicle.PIOAndLoad( "" );
+            else
+                result = this.vehicle.PIOAndUnload( "" );
+
+            //실행 결과 확인 
+            if ( result <= 0 )
+                reply.Result = FluentResults.Results.Ok();
+            else
+                reply.Result = FluentResults.Results.Fail("PIO Fail");
+
+            GUIMessageEventPublish( reply );
+        }
+
+        private void ReqPIOBattery(VCSMessageEventArgs msg)
+        {
+            //TODO: PIOBattery Sub Cmd 필요
+            int result = 1;
+
+            var reply = new GUIMessageEventArgs()
+            {
+                Kind = GUIMessageEventArgs.eGUIMessageKind.RspPIOBatteryCharge ,
+                MessageText = msg.MessageText,
+            };
+
+            //result = this.vehicle.PIOBatteryCharge( SubCmd.eSubCmdState );
+
+            if ( result <= 0 )
+                reply.Result = FluentResults.Results.Ok();
+            else
+                reply.Result = FluentResults.Results.Fail( "Battery Charge Fail" );
+
+            GUIMessageEventPublish( reply );
+        }
+
         private void ReqTest()
         {
             //logger.D( "Test Request" );
@@ -275,7 +338,7 @@ namespace VehicleControlSystem
                 int result = vehicle.InitializationVehicle();
                 if (result != 0)
                 {
-                    this.autoManager.ProcessAlarm(result); //Alarm 내용을 UI로 전달 해주니까 Reply 가 필요 없다.
+                    this.autoManager.ProcessAlarm(result); 
                     return;
                 }