ys-hwang 6 лет назад
Родитель
Сommit
1047b9b698
29 измененных файлов с 708 добавлено и 333 удалено
  1. 11 0
      Dev/OHV/OHV.Common/Events/MessageEventArgs.cs
  2. 10 0
      Dev/OHV/OHV.Common/OHV.Common.csproj
  3. 1 0
      Dev/OHV/OHV.Common/Shareds/SharedEnumType.cs
  4. 10 0
      Dev/OHV/OHV.LanguageHalper/OHV.LanguageHelper.csproj
  5. 10 0
      Dev/OHV/OHV.Module.Interactivity/OHV.Module.Interactivity.csproj
  6. 75 39
      Dev/OHV/OHV.Module.Interactivity/PopUp/ConveyorControlView.xaml
  7. 23 0
      Dev/OHV/OHV.Module.Interactivity/PopUp/ConveyorControlViewModel.cs
  8. 25 10
      Dev/OHV/OHV.Module.Interactivity/PopUp/OpticalReadingConfigViewModel.cs
  9. 10 0
      Dev/OHV/OHV.Module.Layout/OHV.Module.Layout.csproj
  10. 10 0
      Dev/OHV/OHV.Module.ListViews/OHV.Module.ListViews.csproj
  11. 10 0
      Dev/OHV/OHV.Module.MainViews/OHV.Module.MainViews.csproj
  12. 6 1
      Dev/OHV/OHV.Module.MainViews/Views/HistoryViewModel.cs
  13. 10 0
      Dev/OHV/OHV.Module.Monitoring/OHV.Module.Monitoring.csproj
  14. 10 0
      Dev/OHV/OHV.Module.Status/OHV.Module.Status.csproj
  15. 11 0
      Dev/OHV/OHV.OCS/OHV.OCS.csproj
  16. 10 0
      Dev/OHV/OHV.SqliteDAL/OHV.SqliteDAL.csproj
  17. 5 2
      Dev/OHV/OHV.SqliteDAL/OHVDbInitializer.cs
  18. 10 0
      Dev/OHV/OHV.UIControl/OHV.UIControl.csproj
  19. 1 1
      Dev/OHV/OHV.Vehicle/App.config
  20. 1 0
      Dev/OHV/OHV.Vehicle/Concept/D_MainWindowViewModel.cs
  21. 11 0
      Dev/OHV/OHV.Vehicle/OHV.Vehicle.csproj
  22. 54 27
      Dev/OHV/OHV.sln
  23. 196 196
      Dev/OHV/VehicleControlSystem/ControlLayer/IO/EzIO.cs
  24. 1 1
      Dev/OHV/VehicleControlSystem/ControlLayer/Serial/BatteryTabos/Advantech/Advantech.cs
  25. 1 1
      Dev/OHV/VehicleControlSystem/ControlLayer/Serial/BatteryTabos/BMUManager.cs
  26. 91 44
      Dev/OHV/VehicleControlSystem/ControlLayer/Vehicle.cs
  27. 27 6
      Dev/OHV/VehicleControlSystem/Managers/AutoManager.cs
  28. 58 5
      Dev/OHV/VehicleControlSystem/VCSystem.cs
  29. 10 0
      Dev/OHV/VehicleControlSystem/VehicleControlSystem.csproj

+ 11 - 0
Dev/OHV/OHV.Common/Events/MessageEventArgs.cs

@@ -29,6 +29,12 @@ namespace OHV.Common.Events
             RspMachineModeChg,
 
             RspAddCommand,
+
+            RspConveyorLoad,
+            RspConveyorUnload,
+
+            RspObstaclePatternChg,
+            RspObstaclePatternNo,
         }
 
         //Property 이름임.
@@ -70,6 +76,11 @@ namespace OHV.Common.Events
 
             ReqAddCommand,
             ReqTest,
+            ReqConveyorLoad,
+            ReqConveyorUnload,
+
+            ReqObstaclePatternChg,
+            ReqObstaclePatternNo,
         }
 
         public eVCSMessageKind Kind { get; set; }

+ 10 - 0
Dev/OHV/OHV.Common/OHV.Common.csproj

@@ -43,6 +43,16 @@
     <ErrorReport>prompt</ErrorReport>
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote1|AnyCPU'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\Remote1\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
       <HintPath>..\packages\EntityFramework.6.4.0\lib\net45\EntityFramework.dll</HintPath>

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

@@ -155,6 +155,7 @@
 
 	public enum eLampState
 	{
+		None,
 		Alarm,
 		Charging,
 		AutoRunNChargingFull, //충전 완료시에도 점등

+ 10 - 0
Dev/OHV/OHV.LanguageHalper/OHV.LanguageHelper.csproj

@@ -40,6 +40,16 @@
     <ErrorReport>prompt</ErrorReport>
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote1|AnyCPU'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\Remote1\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="PresentationCore" />
     <Reference Include="PresentationFramework" />

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

@@ -42,6 +42,16 @@
     <ErrorReport>prompt</ErrorReport>
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote1|AnyCPU'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\Remote1\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="CommonServiceLocator, Version=2.0.4.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
       <HintPath>..\packages\CommonServiceLocator.2.0.4\lib\net45\CommonServiceLocator.dll</HintPath>

+ 75 - 39
Dev/OHV/OHV.Module.Interactivity/PopUp/ConveyorControlView.xaml

@@ -58,43 +58,43 @@
                                 Orientation="Vertical"
                                 HorizontalAlignment="Center"
                                 VerticalAlignment="Center">
-                        
-                        <Button Background="{x:Null}">
+
+                        <Button Background="{x:Null}" HorizontalContentAlignment="Left">
                             <StackPanel Orientation="Horizontal">
                                 <Ellipse Margin="0,0,16,0" Width="20" Height="20" Fill="{Binding CvError, FallbackValue=Gray}"/>
-                                <TextBlock Text="CV ERROR"/>
+                                <TextBlock Text="CV ERROR" />
                             </StackPanel>
                         </Button>
 
-                        <Button Background="{x:Null}">
+                        <Button Background="{x:Null}" HorizontalContentAlignment="Left">
                             <StackPanel Orientation="Horizontal">
                                 <Ellipse Margin="0,0,38,0" Width="20" Height="20" Fill="{Binding CvCW, FallbackValue=Gray}"/>
-                                <TextBlock Text="CV CW"/>
+                                <TextBlock Text="CV CW" />
                             </StackPanel>
                         </Button>
 
-                        <Button Background="{x:Null}">
+                        <Button Background="{x:Null}" HorizontalContentAlignment="Left">
                             <StackPanel Orientation="Horizontal">
                                 <Ellipse Margin="0,0,30,0" Width="20" Height="20" Fill="{Binding CvCCW, FallbackValue=Gray}"/>
                                 <TextBlock Text="CV CCW"/>
                             </StackPanel>
                         </Button>
 
-                        <Button Background="{x:Null}">
-                            <StackPanel Orientation="Horizontal">
-                                <Ellipse Margin="0,0,16,0" Width="20" Height="20" Fill="{Binding CvEntryIn, FallbackValue=Gray}"/>
+                        <Button Background="{x:Null}" HorizontalContentAlignment="Left">
+                            <StackPanel Orientation="Horizontal" >
+                                <Ellipse Margin="0,0,16,0" Width="20" Height="20" Fill="{Binding CvEntryIn, FallbackValue=Gray}" />
                                 <TextBlock Text="CV EntryIn"/>
                             </StackPanel>
                         </Button>
 
-                        <Button Background="{x:Null}">
-                            <StackPanel Orientation="Horizontal">
+                        <Button Background="{x:Null}" HorizontalContentAlignment="Left">
+                            <StackPanel Orientation="Horizontal" >
                                 <Ellipse Margin="0,0,16,0" Width="20" Height="20" Fill="{Binding CvSlowStop, FallbackValue=Gray}"/>
                                 <TextBlock Text="CV Slow-S"/>
                             </StackPanel>
                         </Button>
 
-                        <Button Background="{x:Null}">
+                        <Button Background="{x:Null}" HorizontalContentAlignment="Left">
                             <StackPanel Orientation="Horizontal">
                                 <Ellipse Margin="0,0,30,0" Width="20" Height="20" Fill="{Binding CvStop, FallbackValue=Gray}"/>
                                 <TextBlock Text="CV Stop"/>
@@ -102,59 +102,95 @@
                         </Button>
 
                     </StackPanel>
-                    
-                    <StackPanel Orientation="Horizontal"
+
+                    <Grid Grid.Column="1">
+                        <Grid.RowDefinitions>
+                            <RowDefinition Height="*"/>
+                            <RowDefinition Height="*"/>
+                            <RowDefinition Height="*"/>
+                        </Grid.RowDefinitions>
+
+                        <StackPanel Orientation="Horizontal"
                                 HorizontalAlignment="Center"
                                 VerticalAlignment="Top"
-                                Grid.Column="1" Margin="20">
-                        <Button Content="Conveyor Control" Foreground="Orange" Background="{x:Null}" FontSize="20"
+                                Grid.Row="0" Margin="20">
+                            <Button Content="Conveyor Control" Foreground="Orange" Background="{x:Null}" FontSize="20"
                             VerticalAlignment="Top" HorizontalAlignment="Left"
                             Width="Auto" Height="50"/>
-                    </StackPanel>
-                    
-                    <StackPanel Orientation="Horizontal"
+                        </StackPanel>
+
+                        <StackPanel Orientation="Horizontal"
                                 HorizontalAlignment="Center"
-                                Grid.Column="1">
+                                Grid.Row="1">
 
-                        <Button HorizontalAlignment="Stretch"
+                            <Button HorizontalAlignment="Stretch"
                             Style="{StaticResource MaterialDesignRaisedButton}"
                             materialDesign:ButtonAssist.CornerRadius="10"
                             Command="{Binding ConveyorRunCommand}"
                             CommandParameter="CW"
                             Height="80" Width="80"
                             Margin="10">
-                            <StackPanel>
-                                <materialDesign:PackIcon Kind="TransferUp" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
-                                <TextBlock Text="CW" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
-                            </StackPanel>
-                        </Button>
+                                <StackPanel>
+                                    <materialDesign:PackIcon Kind="TransferUp" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
+                                    <TextBlock Text="CW" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
+                                </StackPanel>
+                            </Button>
 
-                        <Button 
+                            <Button 
                             Style="{StaticResource MaterialDesignRaisedButton}"
                             materialDesign:ButtonAssist.CornerRadius="10"
                             Height="80" Width="80"
                             Margin="10"
                             Command="{Binding ConveyorRunCommand}"
                             CommandParameter="CCW">
-                            <StackPanel>
-                                <materialDesign:PackIcon Kind="TransferDown" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
-                                <TextBlock Text="CCW" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
-                            </StackPanel>
-                        </Button>
+                                <StackPanel>
+                                    <materialDesign:PackIcon Kind="TransferDown" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
+                                    <TextBlock Text="CCW" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
+                                </StackPanel>
+                            </Button>
 
-                        <Button HorizontalAlignment="Stretch"
+                            <Button HorizontalAlignment="Stretch"
                             Style="{StaticResource MaterialDesignRaisedButton}"
                             materialDesign:ButtonAssist.CornerRadius="10"
                             Command="{Binding ConveyorRunCommand}"
                             CommandParameter="STOP"
                             Height="80" Width="80"
                             Margin="10">
-                            <StackPanel>
-                                <materialDesign:PackIcon Kind="StopCircleOutline" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
-                                <TextBlock Text="Stop" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
-                            </StackPanel>
-                        </Button>
-                    </StackPanel>
+                                <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">
+
+                            <Button HorizontalAlignment="Stretch"
+                            Style="{StaticResource MaterialDesignRaisedButton}"
+                            materialDesign:ButtonAssist.CornerRadius="10"
+                            Command="{Binding LoadUnloadCommand}"
+                            CommandParameter="Load"
+                            Height="80" Width="80"
+                            Margin="10">
+                                <StackPanel>
+                                    <materialDesign:PackIcon Kind="ArrowCollapseDown" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
+                                    <TextBlock Text="Load" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
+                                </StackPanel>
+                            </Button>
+
+                            <Button 
+                            Style="{StaticResource MaterialDesignRaisedButton}"
+                            materialDesign:ButtonAssist.CornerRadius="10"
+                            Height="80" Width="80"
+                            Margin="10"
+                            Command="{Binding LoadUnloadCommand}"
+                            CommandParameter="Unload">
+                                <StackPanel>
+                                    <materialDesign:PackIcon Kind="ArrowExpandUp" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
+                                    <TextBlock Text="Unlaod" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
+                                </StackPanel>
+                            </Button>
+                        </StackPanel>
+                    </Grid>
                 </Grid>
 
                 <Grid Grid.Row="1">

+ 23 - 0
Dev/OHV/OHV.Module.Interactivity/PopUp/ConveyorControlViewModel.cs

@@ -123,6 +123,7 @@ namespace OHV.Module.Interactivity.PopUp
 
         public ICommand ConveyorRunCommand { get; set; }
         public ICommand PosMoveCommand { get; set; }
+        public ICommand LoadUnloadCommand { get; set; }
 
         IEventAggregator eventAggregator;
         MessageController messageController;
@@ -155,6 +156,28 @@ namespace OHV.Module.Interactivity.PopUp
 
             this.ConveyorRunCommand = new DelegateCommand<object>( ExecuteCvCommand );
             this.PosMoveCommand = new DelegateCommand<object>( ExecutePosMoveCommand );
+            this.LoadUnloadCommand = new DelegateCommand<string>( ExecuteLoadUnloadCommand );
+
+        }
+
+        private void ExecuteLoadUnloadCommand( string obj )
+        {
+            if ( obj.ToString().Equals( "Load" ) )
+            {
+                var msg = new VCSMessageEventArgs()
+                {
+                    Kind = VCSMessageEventArgs.eVCSMessageKind.ReqConveyorLoad,
+                };
+                this.eventAggregator.GetEvent<VCSMessagePubSubEvent>().Publish( msg );
+            }
+            else
+            {
+                var msg = new VCSMessageEventArgs()
+                {
+                    Kind = VCSMessageEventArgs.eVCSMessageKind.ReqConveyorUnload,
+                };
+                this.eventAggregator.GetEvent<VCSMessagePubSubEvent>().Publish( msg );
+            }
         }
 
         private void GetSensorState( EzIO _iO )

+ 25 - 10
Dev/OHV/OHV.Module.Interactivity/PopUp/OpticalReadingConfigViewModel.cs

@@ -151,6 +151,11 @@ namespace OHV.Module.Interactivity.PopUp
                     }
                 }
             }
+
+            if ( obj.Kind == GUIMessageEventArgs.eGUIMessageKind.RspObstaclePatternNo )
+            {
+                this.ObstacleDrive = Convert.ToInt32( obj.MessageText );
+            }
         }
 
         private void ChangeObstacleState( eObstacleState lazer )
@@ -169,16 +174,25 @@ namespace OHV.Module.Interactivity.PopUp
         {
             var numpad = new CalcuratorView();
 
-            if (obj.ToString().Equals("D"))
-            {
-                var result = numpad.ShowDialog( this.ObstacleDrive );
-                this.ObstacleDrive = (int)result;
-            }
-            else
-            {
-                var result = numpad.ShowDialog( this.ObstacleCurve );
-                this.ObstacleCurve = (int)result;
-            }
+            var result =  numpad.ShowDialog( this.ObstacleDrive );
+            this.ObstacleCurve = (int)result;
+
+            var msg = new VCSMessageEventArgs();
+            msg.Kind = VCSMessageEventArgs.eVCSMessageKind.ReqObstaclePatternChg;
+            msg.MessageText = this.ObstacleCurve.ToString();
+
+            this.eventAggregator.GetEvent<VCSMessagePubSubEvent>().Publish( msg );
+
+            //if (obj.ToString().Equals("D"))
+            //{
+            //    var result = numpad.ShowDialog( this.ObstacleDrive );
+            //    this.ObstacleDrive = (int)result;
+            //}
+            //else
+            //{
+            //    var result = numpad.ShowDialog( this.ObstacleCurve );
+            //    this.ObstacleCurve = (int)result;
+            //}
         }
 
         private void ExecuteResultPattern(object _obj)
@@ -230,6 +244,7 @@ namespace OHV.Module.Interactivity.PopUp
 
         public void OnDialogOpened( IDialogParameters parameters )
         {
+            this.eventAggregator.GetEvent<VCSMessagePubSubEvent>().Publish( new VCSMessageEventArgs() { Kind = VCSMessageEventArgs.eVCSMessageKind.ReqObstaclePatternNo } );
             this.eventAggregator.GetEvent<ObstacleControlPubSubEvent>().Publish( new ObstacleControlEventArgs { EventDir = ObstacleControlEventArgs.eEventDir.ToBack , ControlKind = ObstacleControlEventArgs.eControlKind.INFO } );
             //this.eventAggregator.GetEvent<ObstacleControlPubSubEvent>().Publish( new ObstacleControlEventArgs { EventDir = ObstacleControlEventArgs.eEventDir.ToBack , ControlKind = ObstacleControlEventArgs.eControlKind.CURVE } );
         }

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

@@ -41,6 +41,16 @@
     <ErrorReport>prompt</ErrorReport>
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote1|AnyCPU'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\Remote1\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
       <HintPath>..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath>

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

@@ -42,6 +42,16 @@
     <ErrorReport>prompt</ErrorReport>
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote1|AnyCPU'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\Remote1\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="CommonServiceLocator, Version=2.0.4.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
       <HintPath>..\packages\CommonServiceLocator.2.0.4\lib\net45\CommonServiceLocator.dll</HintPath>

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

@@ -42,6 +42,16 @@
     <ErrorReport>prompt</ErrorReport>
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote1|AnyCPU'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\Remote1\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="CommonServiceLocator, Version=2.0.4.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
       <HintPath>..\packages\CommonServiceLocator.2.0.4\lib\net45\CommonServiceLocator.dll</HintPath>

+ 6 - 1
Dev/OHV/OHV.Module.MainViews/Views/HistoryViewModel.cs

@@ -28,8 +28,13 @@ namespace OHV.Module.MainViews.Views
         public HistoryViewModel( SqliteManager _sql )
         {
             this.sql = _sql;
+            var ll = sql.HisAlarmDAL.All;
+            if ( ll == null )
+                this.AlarmList = new List<HisAlarm>();
+            else
+                this.AlarmList = ll;
+
             this.sql.HisAlarmDAL.ChangedProperty += HisAlarmDAL_ChangedProperty;
-            this.AlarmList = new List<HisAlarm>( sql.HisAlarmDAL.All );
             this.AlarmResetCommand = new DelegateCommand( ExecuteAlarmResetCommand );
         }
 

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

@@ -42,6 +42,16 @@
     <ErrorReport>prompt</ErrorReport>
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote1|AnyCPU'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\Remote1\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="CommonServiceLocator, Version=2.0.4.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
       <HintPath>..\packages\CommonServiceLocator.2.0.4\lib\net45\CommonServiceLocator.dll</HintPath>

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

@@ -43,6 +43,16 @@
     <ErrorReport>prompt</ErrorReport>
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote1|AnyCPU'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\Remote1\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="CommonServiceLocator, Version=2.0.4.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
       <HintPath>..\packages\CommonServiceLocator.2.0.4\lib\net45\CommonServiceLocator.dll</HintPath>

+ 11 - 0
Dev/OHV/OHV.OCS/OHV.OCS.csproj

@@ -44,6 +44,17 @@
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     <Prefer32Bit>true</Prefer32Bit>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote1|AnyCPU'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\Remote1\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>true</Prefer32Bit>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="System" />
     <Reference Include="System.Data" />

+ 10 - 0
Dev/OHV/OHV.SqliteDAL/OHV.SqliteDAL.csproj

@@ -43,6 +43,16 @@
     <ErrorReport>prompt</ErrorReport>
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote1|AnyCPU'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\Remote1\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="CommonServiceLocator, Version=2.0.4.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
       <HintPath>..\packages\CommonServiceLocator.2.0.4\lib\net45\CommonServiceLocator.dll</HintPath>

+ 5 - 2
Dev/OHV/OHV.SqliteDAL/OHVDbInitializer.cs

@@ -182,8 +182,11 @@ namespace OHV.SqliteDAL
                 new Alarm { AlarmId = 25, Kind = eAlarmKind.Axis, Name = "Charge", Text="Charge Point Not Ready",                          Solution="", Description="", Level = eAlarmLevel.Falut, },
                 new Alarm { AlarmId = 26, Kind = eAlarmKind.Axis, Name = "Charge", Text="Charge Point PIO Error",                          Solution="", Description="", Level = eAlarmLevel.Falut, },
                 new Alarm { AlarmId = 27, Kind = eAlarmKind.Axis, Name = "Charge", Text="while Vehicle Move Obstacle Detected",Solution="", Description="", Level = eAlarmLevel.Falut, },
-                new Alarm { AlarmId = 28, Kind = eAlarmKind.Axis, Name = "Charge", Text="while Vehicle Move Obstacle Detected",Solution="", Description="", Level = eAlarmLevel.Falut, },
-                new Alarm { AlarmId = 29, Kind = eAlarmKind.Axis, Name = "Charge", Text="while Vehicle Move Obstacle Detected",Solution="", Description="", Level = eAlarmLevel.Falut, },
+                new Alarm { AlarmId = 28, Kind = eAlarmKind.Axis, Name = "System", Text="E - Stop Switch On",Solution="", Description="", Level = eAlarmLevel.Falut, },
+                new Alarm { AlarmId = 29, Kind = eAlarmKind.Axis, Name = "System", Text="MC Off",Solution="", Description="", Level = eAlarmLevel.Falut, },
+                new Alarm { AlarmId = 30, Kind = eAlarmKind.Axis, Name = "System", Text="CP Off 24V",Solution="", Description="", Level = eAlarmLevel.Falut, },
+                new Alarm { AlarmId = 31, Kind = eAlarmKind.Axis, Name = "System", Text="CP Off Safety",Solution="", Description="", Level = eAlarmLevel.Falut, },
+                new Alarm { AlarmId = 32, Kind = eAlarmKind.Axis, Name = "BMS", Text="Battery Manage System Disconnected",Solution="", Description="", Level = eAlarmLevel.Falut, },
             } );
 
             //context.Set<HisAlarm>().Add(new HisAlarm { AlarmId = 1, OccurTime = DateTime.Now.AddDays(-10) });

+ 10 - 0
Dev/OHV/OHV.UIControl/OHV.UIControl.csproj

@@ -41,6 +41,16 @@
     <ErrorReport>prompt</ErrorReport>
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote1|AnyCPU'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\Remote1\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="GSG.NET.WPF, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>

+ 1 - 1
Dev/OHV/OHV.Vehicle/App.config

@@ -5,7 +5,7 @@
     <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
   </configSections>
   <connectionStrings>
-    <add name="OHVDb" connectionString="data source=.\DB\OHVDb.sqlite;foreign keys=true" providerName="System.Data.SQLite" />
+    <add name="OHVDb" connectionString="data source=C:\DB\OHVDb.sqlite;foreign keys=true" providerName="System.Data.SQLite" />
   </connectionStrings>
   <startup>
     <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />

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

@@ -475,6 +475,7 @@ namespace OHV.Vehicle.Concept
                 var hisAlarm = args.Args as HisAlarm;
                 this.messageController.ShowNotificationView(args.MessageText);
                 this.VehicleModeChange(false);//알람이 발생하면 자동으로 Manual Mode 로 변경됨
+                this.IsVehicleAlarm = true;
             }
 
             if (args.MessageKey.Equals(MessageKey.Vehicle))

+ 11 - 0
Dev/OHV/OHV.Vehicle/OHV.Vehicle.csproj

@@ -53,6 +53,17 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote|AnyCPU'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>\\192.168.127.20\VCS\</OutputPath>
+    <DefineConstants>TRACE;DEBUG</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>true</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote1|AnyCPU'">
     <DebugSymbols>true</DebugSymbols>
     <OutputPath>\\192.168.127.10\VCS\</OutputPath>
     <DefineConstants>TRACE;DEBUG</DefineConstants>

+ 54 - 27
Dev/OHV/OHV.sln

@@ -45,87 +45,114 @@ Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
 		Release|Any CPU = Release|Any CPU
-		Remote|Any CPU = Remote|Any CPU
+		Remote1|Any CPU = Remote1|Any CPU
+		Remote2|Any CPU = Remote2|Any CPU
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
 		{122D81C8-9AB9-4CED-80D2-9C4F2F9DEB4C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{122D81C8-9AB9-4CED-80D2-9C4F2F9DEB4C}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{122D81C8-9AB9-4CED-80D2-9C4F2F9DEB4C}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{122D81C8-9AB9-4CED-80D2-9C4F2F9DEB4C}.Release|Any CPU.Build.0 = Release|Any CPU
-		{122D81C8-9AB9-4CED-80D2-9C4F2F9DEB4C}.Remote|Any CPU.ActiveCfg = Remote|Any CPU
-		{122D81C8-9AB9-4CED-80D2-9C4F2F9DEB4C}.Remote|Any CPU.Build.0 = Remote|Any CPU
+		{122D81C8-9AB9-4CED-80D2-9C4F2F9DEB4C}.Remote1|Any CPU.ActiveCfg = Remote1|Any CPU
+		{122D81C8-9AB9-4CED-80D2-9C4F2F9DEB4C}.Remote1|Any CPU.Build.0 = Remote1|Any CPU
+		{122D81C8-9AB9-4CED-80D2-9C4F2F9DEB4C}.Remote2|Any CPU.ActiveCfg = Remote|Any CPU
+		{122D81C8-9AB9-4CED-80D2-9C4F2F9DEB4C}.Remote2|Any CPU.Build.0 = Remote|Any CPU
 		{12D8B660-6FC6-4228-9198-63E3E455CAAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{12D8B660-6FC6-4228-9198-63E3E455CAAF}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{12D8B660-6FC6-4228-9198-63E3E455CAAF}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{12D8B660-6FC6-4228-9198-63E3E455CAAF}.Release|Any CPU.Build.0 = Release|Any CPU
-		{12D8B660-6FC6-4228-9198-63E3E455CAAF}.Remote|Any CPU.ActiveCfg = Remote|Any CPU
-		{12D8B660-6FC6-4228-9198-63E3E455CAAF}.Remote|Any CPU.Build.0 = Remote|Any CPU
+		{12D8B660-6FC6-4228-9198-63E3E455CAAF}.Remote1|Any CPU.ActiveCfg = Remote1|Any CPU
+		{12D8B660-6FC6-4228-9198-63E3E455CAAF}.Remote1|Any CPU.Build.0 = Remote1|Any CPU
+		{12D8B660-6FC6-4228-9198-63E3E455CAAF}.Remote2|Any CPU.ActiveCfg = Remote|Any CPU
+		{12D8B660-6FC6-4228-9198-63E3E455CAAF}.Remote2|Any CPU.Build.0 = Remote|Any CPU
 		{165DD79F-9DC2-4441-8E83-3FA973CB82FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{165DD79F-9DC2-4441-8E83-3FA973CB82FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{165DD79F-9DC2-4441-8E83-3FA973CB82FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{165DD79F-9DC2-4441-8E83-3FA973CB82FD}.Release|Any CPU.Build.0 = Release|Any CPU
-		{165DD79F-9DC2-4441-8E83-3FA973CB82FD}.Remote|Any CPU.ActiveCfg = Remote|Any CPU
-		{165DD79F-9DC2-4441-8E83-3FA973CB82FD}.Remote|Any CPU.Build.0 = Remote|Any CPU
+		{165DD79F-9DC2-4441-8E83-3FA973CB82FD}.Remote1|Any CPU.ActiveCfg = Remote1|Any CPU
+		{165DD79F-9DC2-4441-8E83-3FA973CB82FD}.Remote1|Any CPU.Build.0 = Remote1|Any CPU
+		{165DD79F-9DC2-4441-8E83-3FA973CB82FD}.Remote2|Any CPU.ActiveCfg = Remote|Any CPU
+		{165DD79F-9DC2-4441-8E83-3FA973CB82FD}.Remote2|Any CPU.Build.0 = Remote|Any CPU
 		{902A80B4-DECE-41C1-9552-51A1362537C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{902A80B4-DECE-41C1-9552-51A1362537C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{902A80B4-DECE-41C1-9552-51A1362537C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{902A80B4-DECE-41C1-9552-51A1362537C9}.Release|Any CPU.Build.0 = Release|Any CPU
-		{902A80B4-DECE-41C1-9552-51A1362537C9}.Remote|Any CPU.ActiveCfg = Remote|Any CPU
-		{902A80B4-DECE-41C1-9552-51A1362537C9}.Remote|Any CPU.Build.0 = Remote|Any CPU
+		{902A80B4-DECE-41C1-9552-51A1362537C9}.Remote1|Any CPU.ActiveCfg = Remote1|Any CPU
+		{902A80B4-DECE-41C1-9552-51A1362537C9}.Remote1|Any CPU.Build.0 = Remote1|Any CPU
+		{902A80B4-DECE-41C1-9552-51A1362537C9}.Remote2|Any CPU.ActiveCfg = Remote|Any CPU
+		{902A80B4-DECE-41C1-9552-51A1362537C9}.Remote2|Any CPU.Build.0 = Remote|Any CPU
 		{0D1F7FBC-BFB0-4EE4-852D-E2A8D62C5708}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{0D1F7FBC-BFB0-4EE4-852D-E2A8D62C5708}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{0D1F7FBC-BFB0-4EE4-852D-E2A8D62C5708}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{0D1F7FBC-BFB0-4EE4-852D-E2A8D62C5708}.Release|Any CPU.Build.0 = Release|Any CPU
-		{0D1F7FBC-BFB0-4EE4-852D-E2A8D62C5708}.Remote|Any CPU.ActiveCfg = Remote|Any CPU
-		{0D1F7FBC-BFB0-4EE4-852D-E2A8D62C5708}.Remote|Any CPU.Build.0 = Remote|Any CPU
+		{0D1F7FBC-BFB0-4EE4-852D-E2A8D62C5708}.Remote1|Any CPU.ActiveCfg = Remote1|Any CPU
+		{0D1F7FBC-BFB0-4EE4-852D-E2A8D62C5708}.Remote1|Any CPU.Build.0 = Remote1|Any CPU
+		{0D1F7FBC-BFB0-4EE4-852D-E2A8D62C5708}.Remote2|Any CPU.ActiveCfg = Remote|Any CPU
+		{0D1F7FBC-BFB0-4EE4-852D-E2A8D62C5708}.Remote2|Any CPU.Build.0 = Remote|Any CPU
 		{D045DC91-1AD5-4EBF-A062-0C6C5FE203C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{D045DC91-1AD5-4EBF-A062-0C6C5FE203C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{D045DC91-1AD5-4EBF-A062-0C6C5FE203C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{D045DC91-1AD5-4EBF-A062-0C6C5FE203C5}.Release|Any CPU.Build.0 = Release|Any CPU
-		{D045DC91-1AD5-4EBF-A062-0C6C5FE203C5}.Remote|Any CPU.ActiveCfg = Remote|Any CPU
-		{D045DC91-1AD5-4EBF-A062-0C6C5FE203C5}.Remote|Any CPU.Build.0 = Remote|Any CPU
+		{D045DC91-1AD5-4EBF-A062-0C6C5FE203C5}.Remote1|Any CPU.ActiveCfg = Remote1|Any CPU
+		{D045DC91-1AD5-4EBF-A062-0C6C5FE203C5}.Remote1|Any CPU.Build.0 = Remote1|Any CPU
+		{D045DC91-1AD5-4EBF-A062-0C6C5FE203C5}.Remote2|Any CPU.ActiveCfg = Remote|Any CPU
+		{D045DC91-1AD5-4EBF-A062-0C6C5FE203C5}.Remote2|Any CPU.Build.0 = Remote|Any CPU
 		{73BAB40E-FC7D-4AB5-85CA-B4CF221DFBD1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{73BAB40E-FC7D-4AB5-85CA-B4CF221DFBD1}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{73BAB40E-FC7D-4AB5-85CA-B4CF221DFBD1}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{73BAB40E-FC7D-4AB5-85CA-B4CF221DFBD1}.Release|Any CPU.Build.0 = Release|Any CPU
-		{73BAB40E-FC7D-4AB5-85CA-B4CF221DFBD1}.Remote|Any CPU.ActiveCfg = Remote|Any CPU
-		{73BAB40E-FC7D-4AB5-85CA-B4CF221DFBD1}.Remote|Any CPU.Build.0 = Remote|Any CPU
+		{73BAB40E-FC7D-4AB5-85CA-B4CF221DFBD1}.Remote1|Any CPU.ActiveCfg = Remote1|Any CPU
+		{73BAB40E-FC7D-4AB5-85CA-B4CF221DFBD1}.Remote1|Any CPU.Build.0 = Remote1|Any CPU
+		{73BAB40E-FC7D-4AB5-85CA-B4CF221DFBD1}.Remote2|Any CPU.ActiveCfg = Remote|Any CPU
+		{73BAB40E-FC7D-4AB5-85CA-B4CF221DFBD1}.Remote2|Any CPU.Build.0 = Remote|Any CPU
 		{CF748E61-69C2-4DEC-A9EC-755B6999077E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{CF748E61-69C2-4DEC-A9EC-755B6999077E}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{CF748E61-69C2-4DEC-A9EC-755B6999077E}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{CF748E61-69C2-4DEC-A9EC-755B6999077E}.Release|Any CPU.Build.0 = Release|Any CPU
-		{CF748E61-69C2-4DEC-A9EC-755B6999077E}.Remote|Any CPU.ActiveCfg = Remote|Any CPU
-		{CF748E61-69C2-4DEC-A9EC-755B6999077E}.Remote|Any CPU.Build.0 = Remote|Any CPU
+		{CF748E61-69C2-4DEC-A9EC-755B6999077E}.Remote1|Any CPU.ActiveCfg = Remote1|Any CPU
+		{CF748E61-69C2-4DEC-A9EC-755B6999077E}.Remote1|Any CPU.Build.0 = Remote1|Any CPU
+		{CF748E61-69C2-4DEC-A9EC-755B6999077E}.Remote2|Any CPU.ActiveCfg = Remote|Any CPU
+		{CF748E61-69C2-4DEC-A9EC-755B6999077E}.Remote2|Any CPU.Build.0 = Remote|Any CPU
 		{EAFDB5FF-20F9-4172-9A11-EC8CF3AB6EDC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{EAFDB5FF-20F9-4172-9A11-EC8CF3AB6EDC}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{EAFDB5FF-20F9-4172-9A11-EC8CF3AB6EDC}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{EAFDB5FF-20F9-4172-9A11-EC8CF3AB6EDC}.Release|Any CPU.Build.0 = Release|Any CPU
-		{EAFDB5FF-20F9-4172-9A11-EC8CF3AB6EDC}.Remote|Any CPU.ActiveCfg = Remote|Any CPU
-		{EAFDB5FF-20F9-4172-9A11-EC8CF3AB6EDC}.Remote|Any CPU.Build.0 = Remote|Any CPU
+		{EAFDB5FF-20F9-4172-9A11-EC8CF3AB6EDC}.Remote1|Any CPU.ActiveCfg = Remote1|Any CPU
+		{EAFDB5FF-20F9-4172-9A11-EC8CF3AB6EDC}.Remote1|Any CPU.Build.0 = Remote1|Any CPU
+		{EAFDB5FF-20F9-4172-9A11-EC8CF3AB6EDC}.Remote2|Any CPU.ActiveCfg = Remote|Any CPU
+		{EAFDB5FF-20F9-4172-9A11-EC8CF3AB6EDC}.Remote2|Any CPU.Build.0 = Remote|Any CPU
 		{D6402D97-2206-4D55-8097-8DA9A01568CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{D6402D97-2206-4D55-8097-8DA9A01568CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{D6402D97-2206-4D55-8097-8DA9A01568CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{D6402D97-2206-4D55-8097-8DA9A01568CB}.Release|Any CPU.Build.0 = Release|Any CPU
-		{D6402D97-2206-4D55-8097-8DA9A01568CB}.Remote|Any CPU.ActiveCfg = Remote|Any CPU
-		{D6402D97-2206-4D55-8097-8DA9A01568CB}.Remote|Any CPU.Build.0 = Remote|Any CPU
+		{D6402D97-2206-4D55-8097-8DA9A01568CB}.Remote1|Any CPU.ActiveCfg = Remote1|Any CPU
+		{D6402D97-2206-4D55-8097-8DA9A01568CB}.Remote1|Any CPU.Build.0 = Remote1|Any CPU
+		{D6402D97-2206-4D55-8097-8DA9A01568CB}.Remote2|Any CPU.ActiveCfg = Remote|Any CPU
+		{D6402D97-2206-4D55-8097-8DA9A01568CB}.Remote2|Any CPU.Build.0 = Remote|Any CPU
 		{712D75B5-89DD-4064-BC4B-2F9D9F157604}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{712D75B5-89DD-4064-BC4B-2F9D9F157604}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{712D75B5-89DD-4064-BC4B-2F9D9F157604}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{712D75B5-89DD-4064-BC4B-2F9D9F157604}.Release|Any CPU.Build.0 = Release|Any CPU
-		{712D75B5-89DD-4064-BC4B-2F9D9F157604}.Remote|Any CPU.ActiveCfg = Remote|Any CPU
-		{712D75B5-89DD-4064-BC4B-2F9D9F157604}.Remote|Any CPU.Build.0 = Remote|Any CPU
+		{712D75B5-89DD-4064-BC4B-2F9D9F157604}.Remote1|Any CPU.ActiveCfg = Remote1|Any CPU
+		{712D75B5-89DD-4064-BC4B-2F9D9F157604}.Remote1|Any CPU.Build.0 = Remote1|Any CPU
+		{712D75B5-89DD-4064-BC4B-2F9D9F157604}.Remote2|Any CPU.ActiveCfg = Remote|Any CPU
+		{712D75B5-89DD-4064-BC4B-2F9D9F157604}.Remote2|Any CPU.Build.0 = Remote|Any CPU
 		{0043B4EC-A651-401C-9845-57A7C7576E28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{0043B4EC-A651-401C-9845-57A7C7576E28}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{0043B4EC-A651-401C-9845-57A7C7576E28}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{0043B4EC-A651-401C-9845-57A7C7576E28}.Release|Any CPU.Build.0 = Release|Any CPU
-		{0043B4EC-A651-401C-9845-57A7C7576E28}.Remote|Any CPU.ActiveCfg = Remote|Any CPU
-		{0043B4EC-A651-401C-9845-57A7C7576E28}.Remote|Any CPU.Build.0 = Remote|Any CPU
+		{0043B4EC-A651-401C-9845-57A7C7576E28}.Remote1|Any CPU.ActiveCfg = Remote1|Any CPU
+		{0043B4EC-A651-401C-9845-57A7C7576E28}.Remote1|Any CPU.Build.0 = Remote1|Any CPU
+		{0043B4EC-A651-401C-9845-57A7C7576E28}.Remote2|Any CPU.ActiveCfg = Remote|Any CPU
+		{0043B4EC-A651-401C-9845-57A7C7576E28}.Remote2|Any CPU.Build.0 = Remote|Any CPU
 		{D00450D6-DE54-4584-A377-7AA5D5964D2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{D00450D6-DE54-4584-A377-7AA5D5964D2C}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{D00450D6-DE54-4584-A377-7AA5D5964D2C}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{D00450D6-DE54-4584-A377-7AA5D5964D2C}.Release|Any CPU.Build.0 = Release|Any CPU
-		{D00450D6-DE54-4584-A377-7AA5D5964D2C}.Remote|Any CPU.ActiveCfg = Remote|Any CPU
-		{D00450D6-DE54-4584-A377-7AA5D5964D2C}.Remote|Any CPU.Build.0 = Remote|Any CPU
+		{D00450D6-DE54-4584-A377-7AA5D5964D2C}.Remote1|Any CPU.ActiveCfg = Remote1|Any CPU
+		{D00450D6-DE54-4584-A377-7AA5D5964D2C}.Remote1|Any CPU.Build.0 = Remote1|Any CPU
+		{D00450D6-DE54-4584-A377-7AA5D5964D2C}.Remote2|Any CPU.ActiveCfg = Remote|Any CPU
+		{D00450D6-DE54-4584-A377-7AA5D5964D2C}.Remote2|Any CPU.Build.0 = Remote|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

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

@@ -84,56 +84,56 @@ namespace VehicleControlSystem.ControlLayer.IO
             get => this.isConnectError;
             set
             {
-                if (this.isConnectError == value)
+                if ( this.isConnectError == value )
                     return;
                 this.isConnectError = value;
 
-                if (isConnectError)
-                    this.qQ.Enqueue(new QoDiconnected() { Arg0 = "EzIO" } );
+                if ( isConnectError )
+                    this.qQ.Enqueue( new QoDiconnected() {Arg0 = "EzIO" } );
                 else
-                    this.qQ.Enqueue(new QoConnected() { Arg0 = "EzIO"} );
+                    this.qQ.Enqueue( new QoConnected() {Arg0 = "EzIO" } );
             }
         }
 
-        TsMap<string, SyncObject> ddWaitChgBlock = new TsMap<string, SyncObject>(); 
+        TsMap<string, SyncObject> ddWaitChgBlock = new TsMap<string, SyncObject>();
 
         #region Pull Thread
-        public TsQueue<QueueObject> qQ = new TsQueue<QueueObject>(512);
+        public TsQueue<QueueObject> qQ = new TsQueue<QueueObject>( 512 );
         public Thread pullThread;
         #endregion
 
         #region public Method
-        public int GetBit(uint usIOAddr, bool pbval)
+        public int GetBit( uint usIOAddr, bool pbval )
         {
             throw new NotImplementedException();
         }
 
-        public int GetBit(string strIOAddr, bool pbVal)
+        public int GetBit( string strIOAddr, bool pbVal )
         {
             throw new NotImplementedException();
         }
 
-        public int GetByte(uint usIOAddr, byte pcValue)
+        public int GetByte( uint usIOAddr, byte pcValue )
         {
             throw new NotImplementedException();
         }
 
-        public int GetByte(string strIOAddr, byte pcValue)
+        public int GetByte( string strIOAddr, byte pcValue )
         {
             throw new NotImplementedException();
         }
 
-        public int GetWord(uint usIOAddr, short pwValue)
+        public int GetWord( uint usIOAddr, short pwValue )
         {
             throw new NotImplementedException();
         }
 
-        public int GetWord(string strIOAddr, short pwValue)
+        public int GetWord( string strIOAddr, short pwValue )
         {
             throw new NotImplementedException();
         }
 
-        public int Initialize(List<EzBoard> ezBoards)
+        public int Initialize( List<EzBoard> ezBoards )
         {
             this.BoardList = ezBoards;
 
@@ -141,7 +141,7 @@ namespace VehicleControlSystem.ControlLayer.IO
             this._outcomingBuffer = new ushort[ezBoards.Count];
 
             this.IsThreadAlive = true;
-            _readThread = new Thread(this.IOThread);
+            _readThread = new Thread( this.IOThread );
             this._readThread.IsBackground = true;
             this._readThread.Start();
 
@@ -155,23 +155,23 @@ namespace VehicleControlSystem.ControlLayer.IO
             throw new NotImplementedException();
         }
 
-        public bool IsOff(uint usIOAddr)
+        public bool IsOff( uint usIOAddr )
         {
             throw new NotImplementedException();
         }
 
-        public bool IsOff(string ioTag, bool isInput = true)
+        public bool IsOff( string ioTag, bool isInput = true )
         {
             BitBlock bit = null;
-            if (isInput)
-                bit = this._inPutIOList.Where(x => ioTag.Equals(x.Tag)).FirstOrDefault();
+            if ( isInput )
+                bit = this._inPutIOList.Where( x => ioTag.Equals( x.Tag ) ).FirstOrDefault();
             else
-                bit = this._outPutIOList.Where(x => ioTag.Equals(x.Tag)).FirstOrDefault();
+                bit = this._outPutIOList.Where( x => ioTag.Equals( x.Tag ) ).FirstOrDefault();
 
             return !bit.IsBitOn;
         }
 
-        public bool IsOn(uint usIOAddr)
+        public bool IsOn( uint usIOAddr )
         {
             throw new NotImplementedException();
         }
@@ -187,80 +187,80 @@ namespace VehicleControlSystem.ControlLayer.IO
         //    return 0;
         //}
 
-        public bool IsOn(string ioTag, bool isInput = true)
+        public bool IsOn( string ioTag, bool isInput = true )
         {
             BitBlock bit = null;
-            if (isInput)
-                bit = this._inPutIOList.Where(x => ioTag.Equals(x.Tag)).FirstOrDefault();
+            if ( isInput )
+                bit = this._inPutIOList.Where( x => ioTag.Equals( x.Tag ) ).FirstOrDefault();
             else
-                bit = this._outPutIOList.Where(x => ioTag.Equals(x.Tag)).FirstOrDefault();
+                bit = this._outPutIOList.Where( x => ioTag.Equals( x.Tag ) ).FirstOrDefault();
 
             return bit.IsBitOn;
         }
 
-        public bool WaitChangeInputIO(bool exp, int timeout, string tag)
+        public bool WaitChangeInputIO( bool exp, int timeout, string tag )
         {
-            if (exp == IsOn(tag))
+            if ( exp == IsOn( tag ) )
                 return true;
 
-            Assert.IsFalse(ddWaitChgBlock.ContainsKey(tag), "WaitChg InputIO already waiting:{0}", tag);
+            Assert.IsFalse( ddWaitChgBlock.ContainsKey( tag ), "WaitChg InputIO already waiting:{0}", tag );
             try
             {
                 var so = new SyncObject { };
-                ddWaitChgBlock.Add(tag, so);
+                ddWaitChgBlock.Add( tag, so );
                 so.Lock();
-                return so.Await(timeout);
+                return so.Await( timeout );
             }
             finally
             {
-                this.ddWaitChgBlock.Remove(tag);
+                this.ddWaitChgBlock.Remove( tag );
             }
         }
 
-        public int LoadIOMap(string strFileName)
+        public int LoadIOMap( string strFileName )
         {
-            var bl = new ExcelMapper(strFileName).Fetch<EzBoard>("BOARD").ToList();
+            var bl = new ExcelMapper( strFileName ).Fetch<EzBoard>( "BOARD" ).ToList();
             this.BoardList = bl;
 
-            var il = new ExcelMapper(strFileName).Fetch<BitBlock>("IN_IO").ToList();
-            var inputIO = il.Where(x => !string.IsNullOrEmpty(x.Tag)).ToList();
+            var il = new ExcelMapper( strFileName ).Fetch<BitBlock>( "IN_IO" ).ToList();
+            var inputIO = il.Where( x => !string.IsNullOrEmpty( x.Tag ) ).ToList();
             this._inPutIOList = inputIO;
 
-            var ol = new ExcelMapper(strFileName).Fetch<BitBlock>("OUT_IO").ToList();
-            var outputIO = ol.Where(x => !string.IsNullOrEmpty(x.Tag)).ToList();
+            var ol = new ExcelMapper( strFileName ).Fetch<BitBlock>( "OUT_IO" ).ToList();
+            var outputIO = ol.Where( x => !string.IsNullOrEmpty( x.Tag ) ).ToList();
             this._outPutIOList = outputIO;
 
             return 0;
         }
 
-        public int OutputOff(uint usIOAddr)
+        public int OutputOff( uint usIOAddr )
         {
             throw new NotImplementedException();
         }
 
-        public int OutputOff(string strIOAddr)
+        public int OutputOff( string strIOAddr )
         {
             int result = 0;
 
-            var outIO = this._outPutIOList.Where(x => strIOAddr.Equals(x.Tag)).FirstOrDefault();
-            var boardType = this.BoardList.Where(x => x.BoardID == outIO.BoardNo).FirstOrDefault().Type;
+            var outIO = this._outPutIOList.Where( x => strIOAddr.Equals( x.Tag ) ).FirstOrDefault();
+            var boardType = this.BoardList.Where( x => x.BoardID == outIO.BoardNo ).FirstOrDefault().Type;
 
             uint bitMask = 0;
-            if (boardType == E_EzboardType.Servo)
+            if ( boardType == E_EzboardType.Servo )
             {
                 bitMask = this.servoAmpOutputBitMask[outIO.Index];
-                result = EziMOTIONPlusELib.FAS_SetIOOutput(outIO.BoardNo, 0, bitMask);
+                result = EziMOTIONPlusELib.FAS_SetIOOutput( outIO.BoardNo, 0, bitMask );
             }
             else
             {
                 bitMask = bitOnMask[outIO.Index];
-                result = EziMOTIONPlusELib.FAS_SetOutput(outIO.BoardNo, 0, bitMask);
+                result = EziMOTIONPlusELib.FAS_SetOutput( outIO.BoardNo, 0, bitMask );
             }
 
             return result;
         }
 
-        public int OutputOn(uint usIOAddr)
+        public int OutputOn( uint usIOAddr )
         {
             //var outIO = this._inPutIOList.Where( x => strIOAddr.Equals( x.Tag ) ).FirstOrDefault();
 
@@ -269,113 +269,113 @@ namespace VehicleControlSystem.ControlLayer.IO
             return 0;
         }
 
-        public int OutputOn(string outputTag)
+        public int OutputOn( string outputTag )
         {
             int result = 0;
 
-            var outIO = this._outPutIOList.Where(x => outputTag.Equals(x.Tag)).FirstOrDefault();
-            var boardType = this.BoardList.Where(x => x.BoardID == outIO.BoardNo).FirstOrDefault().Type;
+            var outIO = this._outPutIOList.Where( x => outputTag.Equals( x.Tag ) ).FirstOrDefault();
+            var boardType = this.BoardList.Where( x => x.BoardID == outIO.BoardNo ).FirstOrDefault().Type;
 
             uint bitMask = 0;
-            if (boardType == E_EzboardType.Servo)
+            if ( boardType == E_EzboardType.Servo )
             {
                 bitMask = this.servoAmpOutputBitMask[outIO.Index];
-                result = EziMOTIONPlusELib.FAS_SetIOOutput(outIO.BoardNo, bitMask, 0);
+                result = EziMOTIONPlusELib.FAS_SetIOOutput( outIO.BoardNo, bitMask, 0 );
             }
             else
             {
                 bitMask = bitOnMask[outIO.Index];
-                result = EziMOTIONPlusELib.FAS_SetOutput(outIO.BoardNo, bitMask, 0);
+                result = EziMOTIONPlusELib.FAS_SetOutput( outIO.BoardNo, bitMask, 0 );
             }
 
             return result;
         }
 
         #region 일정시간 이후 동작 구현
-        void WriteOutputOn(string outputTag)
+        void WriteOutputOn( string outputTag )
         {
             int result = 0;
 
-            var outIO = this._outPutIOList.Where(x => outputTag.Equals(x.Tag)).FirstOrDefault();
-            var boardType = this.BoardList.Where(x => x.BoardID == outIO.BoardNo).FirstOrDefault().Type;
+            var outIO = this._outPutIOList.Where( x => outputTag.Equals( x.Tag ) ).FirstOrDefault();
+            var boardType = this.BoardList.Where( x => x.BoardID == outIO.BoardNo ).FirstOrDefault().Type;
 
             uint bitMask = 0;
-            if (boardType == E_EzboardType.Servo)
+            if ( boardType == E_EzboardType.Servo )
             {
                 bitMask = this.servoAmpOutputBitMask[outIO.Index];
-                result = EziMOTIONPlusELib.FAS_SetIOOutput(outIO.BoardNo, bitMask, 0);
+                result = EziMOTIONPlusELib.FAS_SetIOOutput( outIO.BoardNo, bitMask, 0 );
             }
             else
             {
                 bitMask = bitOnMask[outIO.Index];
-                result = EziMOTIONPlusELib.FAS_SetOutput(outIO.BoardNo, bitMask, 0);
+                result = EziMOTIONPlusELib.FAS_SetOutput( outIO.BoardNo, bitMask, 0 );
             }
         }
-        void WriteOutputOff(string strIOAddr)
+        void WriteOutputOff( string strIOAddr )
         {
             int result = 0;
 
-            var outIO = this._outPutIOList.Where(x => strIOAddr.Equals(x.Tag)).FirstOrDefault();
-            var boardType = this.BoardList.Where(x => x.BoardID == outIO.BoardNo).FirstOrDefault().Type;
+            var outIO = this._outPutIOList.Where( x => strIOAddr.Equals( x.Tag ) ).FirstOrDefault();
+            var boardType = this.BoardList.Where( x => x.BoardID == outIO.BoardNo ).FirstOrDefault().Type;
 
             uint bitMask = 0;
-            if (boardType == E_EzboardType.Servo)
+            if ( boardType == E_EzboardType.Servo )
             {
                 bitMask = this.servoAmpOutputBitMask[outIO.Index];
-                result = EziMOTIONPlusELib.FAS_SetIOOutput(outIO.BoardNo, 0, bitMask);
+                result = EziMOTIONPlusELib.FAS_SetIOOutput( outIO.BoardNo, 0, bitMask );
             }
             else
             {
                 bitMask = bitOnMask[outIO.Index];
-                result = EziMOTIONPlusELib.FAS_SetOutput(outIO.BoardNo, 0, bitMask);
+                result = EziMOTIONPlusELib.FAS_SetOutput( outIO.BoardNo, 0, bitMask );
             }
         }
 
-        public void WriteOutputIO(string tag, bool on, int after = 0)
+        public void WriteOutputIO( string tag, bool on, int after = 0 )
         {
-            if ( on)
+            if ( on )
             {
-                if (after > 0)
-                    TimerUtils.Once(after, WriteOutputOn, tag);
+                if ( after > 0 )
+                    TimerUtils.Once( after, WriteOutputOn, tag );
                 else
-                    WriteOutputOn(tag);
+                    WriteOutputOn( tag );
             }
             else
             {
-                if (after > 0)
-                    TimerUtils.Once(after, WriteOutputOff, tag);
+                if ( after > 0 )
+                    TimerUtils.Once( after, WriteOutputOff, tag );
                 else
-                    WriteOutputOff(tag);
+                    WriteOutputOff( tag );
             }
-        } 
+        }
         #endregion
 
-        public int OutputToggle(uint usIOAddr)
+        public int OutputToggle( uint usIOAddr )
         {
             throw new NotImplementedException();
         }
 
-        public int OutputToggle(string strIOAddr)
+        public int OutputToggle( string strIOAddr )
         {
             throw new NotImplementedException();
         }
 
-        public int PutByte(uint usIOAddr, byte pcValue)
+        public int PutByte( uint usIOAddr, byte pcValue )
         {
             throw new NotImplementedException();
         }
 
-        public int PutByte(string strIOAddr, byte pcValue)
+        public int PutByte( string strIOAddr, byte pcValue )
         {
             throw new NotImplementedException();
         }
 
-        public int PutWord(uint usIOAddr, short pwValue)
+        public int PutWord( uint usIOAddr, short pwValue )
         {
             throw new NotImplementedException();
         }
 
-        public int PutWord(string strIOAddr, short pwValue)
+        public int PutWord( string strIOAddr, short pwValue )
         {
             throw new NotImplementedException();
         }
@@ -387,7 +387,7 @@ namespace VehicleControlSystem.ControlLayer.IO
             {
                 ThreadStart();
             }
-            catch (Exception)
+            catch ( Exception )
             {
             }
             finally
@@ -397,26 +397,26 @@ namespace VehicleControlSystem.ControlLayer.IO
         public void ThreadStart()
         {
             this.IsThreadAlive = true;
-            this._readThread = ThreadUtils.Invoke(IOThread);
+            this._readThread = ThreadUtils.Invoke( IOThread );
 
-            this.pullThread = ThreadUtils.Invoke(PullQueueThread);
+            this.pullThread = ThreadUtils.Invoke( PullQueueThread );
         }
         void IOThread()
         {
             var sTime = SwUtils.CurrentTimeMillis;
 
-            while (IsThreadAlive)
+            while ( IsThreadAlive )
             {
-                Thread.Sleep(5);
+                Thread.Sleep( 5 );
                 try
                 {
-                    if (!IsConnetedAllBoard())
+                    if ( !IsConnetedAllBoard() )
                     {
-                        if (!ConnectAllBoard())
+                        if ( !ConnectAllBoard() )
                         {
                             IsConnectError = true;
                         }
-                        Thread.Sleep(1000);
+                        Thread.Sleep( 1000 );
                         continue;
                     }
                     IsConnectError = false;
@@ -426,22 +426,22 @@ namespace VehicleControlSystem.ControlLayer.IO
                     //Console.WriteLine( $"Read Time - { SwUtils.Elapsed( sTime ) } mm" );
                     //sTime = SwUtils.CurrentTimeMillis;
                 }
-                catch (Exception ex)
+                catch ( Exception ex )
                 {
-                    logger.E($"Exception [EzIO IORead Thread] - {ex.StackTrace}");
+                    logger.E( $"Exception [EzIO IORead Thread] - {ex.StackTrace}" );
                 }
             }
-            logger.D("[EzIO] - Dispose");
+            logger.D( "[EzIO] - Dispose" );
         }
 
         void ReadBoardIO()
         {
-            foreach (var board in this.BoardList)
+            foreach ( var board in this.BoardList )
             {
-                if (!IsConnetedBoard(board.BoardID))
+                if ( !IsConnetedBoard( board.BoardID ) )
                     continue;
 
-                switch (board.Type)
+                switch ( board.Type )
                 {
                     case E_EzboardType.Servo:
                         {
@@ -449,28 +449,28 @@ namespace VehicleControlSystem.ControlLayer.IO
                             int cmdPos = 0, actPos = 0, posErr = 0, actVel = 0;
                             ushort posItemNo = 0;
 
-                            if (EziMOTIONPlusELib.FAS_GetAllStatus(board.BoardID, ref axisDIn, ref axisDOut, ref axisStatus,
-                                ref cmdPos, ref actPos, ref posErr, ref actVel, ref posItemNo) == EziMOTIONPlusELib.FMM_OK)
+                            if ( EziMOTIONPlusELib.FAS_GetAllStatus( board.BoardID, ref axisDIn, ref axisDOut, ref axisStatus,
+                                ref cmdPos, ref actPos, ref posErr, ref actVel, ref posItemNo ) == EziMOTIONPlusELib.FMM_OK )
                             {
                                 //if ( this._inPutIOList.Where( x => x.BoardNo == board.BoardID ).Count() <= 0 ) break;
 
                                 var input = this._inPutIOList.Where( x => x.BoardNo == board.BoardID ).ToList();
-                                input.ForEach(i =>
-                               {
-                                   var isOn = Convert.ToBoolean(axisDIn & this.servoAmpInputBitOnMask[i.Index]) ? true : false;
-                                   if (i.IsBitOn != isOn) 
-                                       i.IsChanged = true;
-                                   i.IsBitOn = isOn;
-                               });
-
-                                var output = this._outPutIOList.Where(x => x.BoardNo == board.BoardID).ToList();
-                                output.ForEach(o =>
-                               {
-                                   var isOn = Convert.ToBoolean(axisDOut & this.servoAmpOutputBitMask[o.Index]) ? true : false;
-                                   if (o.IsBitOn != isOn) 
-                                       o.IsChanged = true;
-                                   o.IsBitOn = isOn;
-                               });
+                                input.ForEach( i =>
+                                {
+                                    var isOn = Convert.ToBoolean( axisDIn & this.servoAmpInputBitOnMask[i.Index] ) ? true : false;
+                                    if ( i.IsBitOn != isOn )
+                                        i.IsChanged = true;
+                                    i.IsBitOn = isOn;
+                                } );
+
+                                var output = this._outPutIOList.Where( x => x.BoardNo == board.BoardID ).ToList();
+                                output.ForEach( o =>
+                                {
+                                    var isOn = Convert.ToBoolean( axisDOut & this.servoAmpOutputBitMask[o.Index] ) ? true : false;
+                                    if ( o.IsBitOn != isOn )
+                                        o.IsChanged = true;
+                                    o.IsBitOn = isOn;
+                                } );
                             }
                         }
                         break;
@@ -479,20 +479,20 @@ namespace VehicleControlSystem.ControlLayer.IO
                         {
                             uint inValue = 0, latchValue = 0;
                             int result = EziMOTIONPlusELib.FMM_OK;
-                            result = EziMOTIONPlusELib.FAS_GetInput(board.BoardID, ref inValue, ref latchValue);
-                            if (result == EziMOTIONPlusELib.FMM_OK)
+                            result = EziMOTIONPlusELib.FAS_GetInput( board.BoardID, ref inValue, ref latchValue );
+                            if ( result == EziMOTIONPlusELib.FMM_OK )
                             {
-                                var input = this._inPutIOList.Where(x => x.BoardNo == board.BoardID).ToList();
-                                input.ForEach(i =>
-                               {
-                                   var isOn = Convert.ToBoolean(inValue & this.bitOnMask[i.Index]) ? true : false;
-                                   if (i.IsBitOn != isOn) 
-                                       i.IsChanged = true;
-                                   i.IsBitOn = isOn;
-                               });
+                                var input = this._inPutIOList.Where( x => x.BoardNo == board.BoardID ).ToList();
+                                input.ForEach( i =>
+                                {
+                                    var isOn = Convert.ToBoolean( inValue & this.bitOnMask[i.Index] ) ? true : false;
+                                    if ( i.IsBitOn != isOn )
+                                        i.IsChanged = true;
+                                    i.IsBitOn = isOn;
+                                } );
                             }
                             else
-                                logger.E($"EzIO - [{board.BoardID}] Read Fail Error Code {result}");
+                                logger.E( $"EzIO - [{board.BoardID}] Read Fail Error Code {result}" );
                         }
                         break;
 
@@ -500,20 +500,20 @@ namespace VehicleControlSystem.ControlLayer.IO
                         {
                             uint outValue = 0, outStatus = 0;
                             int result = EziMOTIONPlusELib.FMM_OK;
-                            result = EziMOTIONPlusELib.FAS_GetOutput(board.BoardID, ref outValue, ref outStatus);
-                            if (result == EziMOTIONPlusELib.FMM_OK)
+                            result = EziMOTIONPlusELib.FAS_GetOutput( board.BoardID, ref outValue, ref outStatus );
+                            if ( result == EziMOTIONPlusELib.FMM_OK )
                             {
-                                var output = this._outPutIOList.Where(x => x.BoardNo == board.BoardID).ToList();
-                                output.ForEach(o =>
-                               {
-                                   var isOn = Convert.ToBoolean(outValue & this.bitOnMask[o.Index]) ? true : false;
-                                   if (o.IsBitOn != isOn) 
-                                       o.IsChanged = true;
-                                   o.IsBitOn = isOn;
-                               });
+                                var output = this._outPutIOList.Where( x => x.BoardNo == board.BoardID ).ToList();
+                                output.ForEach( o =>
+                                {
+                                    var isOn = Convert.ToBoolean( outValue & this.bitOnMask[o.Index] ) ? true : false;
+                                    if ( o.IsBitOn != isOn )
+                                        o.IsChanged = true;
+                                    o.IsBitOn = isOn;
+                                } );
                             }
                             else
-                                logger.E($"EzIO - [{board.BoardID}] Read Fail Error Code {result}");
+                                logger.E( $"EzIO - [{board.BoardID}] Read Fail Error Code {result}" );
                         }
                         break;
 
@@ -527,58 +527,58 @@ namespace VehicleControlSystem.ControlLayer.IO
 
         void FireChangedIO()
         {
-            this.InPutIOList.ForEach(i =>
-            {
-                if (i.IsChanged)
-                {
-                    i.IsChanged = false;
-                    var clone = ObjectCopyUtils.DeepClone<BitBlock>(i);
-                    this.qQ.Enqueue(new QoChangedIO { Arg0 = clone });
-                    NotifySyncBit(clone);
-                }
-            });
-
-            this.OutPutIOList.ForEach(o =>
-            {
-                if (o.IsChanged)
-                {
-                    o.IsChanged = false;
-                    var clone = ObjectCopyUtils.DeepClone<BitBlock>(o);
-                    this.qQ.Enqueue(new QoChangedIO { Arg0 = clone });
-                }
-            });
+            this.InPutIOList.ForEach( i =>
+             {
+                 if ( i.IsChanged )
+                 {
+                     i.IsChanged = false;
+                     var clone = ObjectCopyUtils.DeepClone<BitBlock>( i );
+                     this.qQ.Enqueue( new QoChangedIO { Arg0 = clone } );
+                     NotifySyncBit( clone );
+                 }
+             } );
+
+            this.OutPutIOList.ForEach( o =>
+             {
+                 if ( o.IsChanged )
+                 {
+                     o.IsChanged = false;
+                     var clone = ObjectCopyUtils.DeepClone<BitBlock>( o );
+                     this.qQ.Enqueue( new QoChangedIO { Arg0 = clone } );
+                 }
+             } );
         }
 
         void PullQueueThread()
         {
-            while(IsThreadAlive)
+            while ( IsThreadAlive )
             {
                 try
                 {
                     var o = qQ.Dequeue();
 
-                    if (o is QoConnected)
-                        DelegateUtils.Invoke(OnContd, o.Arg0);
-                    else if (o is QoDiconnected)
-                        DelegateUtils.Invoke(OnDiscontd, o.Arg0);
-                    else if (o is QoChangedIO)
-                        DelegateUtils.Invoke(OnChangedIO, o.Arg0);
-                    else if (o is QoWriteIO)
-                        DelegateUtils.Invoke(OnWriteIO, o.Arg0);
-                    else if (o is QoLog)
-                        DelegateUtils.Invoke(OnLog, o.Arg0, o.Arg1);
+                    if ( o is QoConnected )
+                        DelegateUtils.Invoke( OnContd, o.Arg0 );
+                    else if ( o is QoDiconnected )
+                        DelegateUtils.Invoke( OnDiscontd, o.Arg0 );
+                    else if ( o is QoChangedIO )
+                        DelegateUtils.Invoke( OnChangedIO, o.Arg0 );
+                    else if ( o is QoWriteIO )
+                        DelegateUtils.Invoke( OnWriteIO, o.Arg0 );
+                    else if ( o is QoLog )
+                        DelegateUtils.Invoke( OnLog, o.Arg0, o.Arg1 );
                     else
-                        Assert.Fail("Unk Object {0}", o);
+                        Assert.Fail( "Unk Object {0}", o );
                 }
-                catch (ThreadAbortException) 
+                catch ( ThreadAbortException )
                 {
                 }
-                catch (Exception e)
+                catch ( Exception e )
                 {
-                    logger.E(e);
+                    logger.E( e );
                 }
             }
-            logger.D("[EzIO] - PullQueue Thread Dispose");
+            logger.D( "[EzIO] - PullQueue Thread Dispose" );
         }
         #endregion
 
@@ -586,9 +586,9 @@ namespace VehicleControlSystem.ControlLayer.IO
         /// InputIO 변경 알림
         /// </summary>
         /// <param name="block"></param>
-        void NotifySyncBit(BitBlock block)
+        void NotifySyncBit( BitBlock block )
         {
-            if (ddWaitChgBlock.ContainsKey(block.Tag))
+            if ( ddWaitChgBlock.ContainsKey( block.Tag ) )
             {
                 var so = ddWaitChgBlock[block.Tag];
                 so.Expect = block;
@@ -596,16 +596,16 @@ namespace VehicleControlSystem.ControlLayer.IO
             }
         }
 
-        bool IsConnetedBoard(int boardNo)
+        bool IsConnetedBoard( int boardNo )
         {
-            return EziMOTIONPlusELib.FAS_IsSlaveExist(boardNo) == 1;
+            return EziMOTIONPlusELib.FAS_IsSlaveExist( boardNo ) == 1;
         }
 
         bool IsConnetedAllBoard()
         {
-            foreach (var b in this.BoardList)
+            foreach ( var b in this.BoardList )
             {
-                if (!IsConnetedBoard(b.BoardID))
+                if ( !IsConnetedBoard( b.BoardID ) )
                 {
                     this.qQ.Clear();//연결이 끊어지면 내용을 삭제.
                     return false;
@@ -617,16 +617,16 @@ namespace VehicleControlSystem.ControlLayer.IO
 
         bool ConnectAllBoard()
         {
-            foreach (var b in this.BoardList)
+            foreach ( var b in this.BoardList )
             {
-                if (IsConnetedBoard(b.BoardID))
+                if ( IsConnetedBoard( b.BoardID ) )
                     continue;
 
                 var addr = b.IPAddress.Split( '.' );
                 byte boardNo = Convert.ToByte( addr[3] );
-                if (EziMOTIONPlusELib.FAS_Connect((byte)192, (byte)168, (byte)0, boardNo, b.BoardID ) != EziMOTIONPlusELib.FMM_OK)
+                if ( EziMOTIONPlusELib.FAS_Connect( (byte)192, (byte)168, (byte)0, boardNo, b.BoardID ) != EziMOTIONPlusELib.FMM_OK )
                 {
-                    logger.E($"EzIO - Connect Fail {b.BoardID}");
+                    logger.E( $"EzIO - Connect Fail {b.BoardID}" );
                     return false;
                 }
             }
@@ -637,16 +637,16 @@ namespace VehicleControlSystem.ControlLayer.IO
         public int Terminate()
         {
             this.IsThreadAlive = false;
-            if (this._readThread != null && this._readThread.IsAlive)
+            if ( this._readThread != null && this._readThread.IsAlive )
             {
-                if (!this._readThread.Join(3000))
+                if ( !this._readThread.Join( 3000 ) )
                     this._readThread.Abort();
             }
 
-            this.BoardList.ForEach(b =>
-           {
-               EziMOTIONPlusELib.FAS_Close(b.BoardID);
-           });
+            this.BoardList.ForEach( b =>
+            {
+                EziMOTIONPlusELib.FAS_Close( b.BoardID );
+            } );
 
             return 0;
         }
@@ -656,7 +656,7 @@ namespace VehicleControlSystem.ControlLayer.IO
             throw new NotImplementedException();
         }
 
-        int GetModuleAndBitNoByAddress(uint usIOAddr, out int boardNo, out int bitNo)
+        int GetModuleAndBitNoByAddress( uint usIOAddr, out int boardNo, out int bitNo )
         {
             long nOffset = 0;
             long nCount = 0;
@@ -666,14 +666,14 @@ namespace VehicleControlSystem.ControlLayer.IO
             boardNo = 0;
             bitNo = 0;
 
-            if (usIOAddr < OUTPUT_ORIGIN)
+            if ( usIOAddr < OUTPUT_ORIGIN )
             {
                 nOffset = usIOAddr - INPUT_ORIGIN;
-                for (int nModNo = 0; nModNo < this.BoardList.Count; nModNo++)
+                for ( int nModNo = 0; nModNo < this.BoardList.Count; nModNo++ )
                 {
                     // Get Input CH Count Using Module ID
                     //AxdInfoGetInputCount( nModNo, nCount );
-                    if (nOffset - nCount < 0)
+                    if ( nOffset - nCount < 0 )
                     {
                         boardNo = nModNo;
                         bitNo = (int)nOffset;
@@ -685,11 +685,11 @@ namespace VehicleControlSystem.ControlLayer.IO
             else
             {
                 nOffset = usIOAddr - OUTPUT_ORIGIN;
-                for (int nModNo = 0; nModNo < this.BoardList.Count; nModNo++)
+                for ( int nModNo = 0; nModNo < this.BoardList.Count; nModNo++ )
                 {
                     // Get Output CH Count Using Module ID
                     //AxdInfoGetOutputCount( nModNo, nCount );
-                    if (nOffset - nCount < 0)
+                    if ( nOffset - nCount < 0 )
                     {
                         boardNo = nModNo;
                         bitNo = (int)nOffset;
@@ -705,24 +705,24 @@ namespace VehicleControlSystem.ControlLayer.IO
         #region IDisposable Support
         private bool disposedValue = false; // 중복 호출을 검색하려면
 
-        protected virtual void Dispose(bool disposing)
+        protected virtual void Dispose( bool disposing )
         {
-            if (!disposedValue)
+            if ( !disposedValue )
             {
-                if (disposing)
+                if ( disposing )
                 {
                     // TODO: 관리되는 상태(관리되는 개체)를 삭제합니다.
-                    if (this.pullThread != null)
+                    if ( this.pullThread != null )
                     {
                         this.IsThreadAlive = false;
-                        if (!this.pullThread.Join(2000) && this.pullThread.IsAlive)
+                        if ( !this.pullThread.Join( 2000 ) && this.pullThread.IsAlive )
                         {
                             this.pullThread.Abort();
                         }
                         this.pullThread = null;
                     }
 
-                    ThreadUtils.Kill(this.pullThread);
+                    ThreadUtils.Kill( this.pullThread );
 
                     Terminate(); //Board Close 
                 }
@@ -745,7 +745,7 @@ namespace VehicleControlSystem.ControlLayer.IO
         public void Dispose()
         {
             // 이 코드를 변경하지 마세요. 위의 Dispose(bool disposing)에 정리 코드를 입력하세요.
-            Dispose(true);
+            Dispose( true );
             // TODO: 위의 종료자가 재정의된 경우 다음 코드 줄의 주석 처리를 제거합니다.
             // GC.SuppressFinalize(this);
         }

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

@@ -31,7 +31,7 @@ namespace VehicleControlSystem.ControlLayer.Serial.BatteryTabos
 
         //Todo:Dll 에서 상태 가져오기
         //bool IsConnected = false;
-        bool IsConnected
+        public bool IsConnected
         {
             get 
             {

+ 1 - 1
Dev/OHV/VehicleControlSystem/ControlLayer/Serial/BatteryTabos/BMUManager.cs

@@ -20,7 +20,7 @@ namespace VehicleControlSystem.ControlLayer.Serial.BatteryTabos
         Peak com = null;
         Advantech adCom = null;
         public Config BMUConfig { get; set; }
-        public bool IsConnected { get; set; }
+        public bool IsConnected { get { return this.adCom.IsConnected; } }
 
         internal Dictionary<eDataKind, ReceivedData> ReceivedDataDic = new Dictionary<eDataKind , DataModel.ReceivedData>();
         protected TsQueue<QueObject> qq = new TsQueue<QueObject>( 512 );

+ 91 - 44
Dev/OHV/VehicleControlSystem/ControlLayer/Vehicle.cs

@@ -167,6 +167,14 @@ namespace VehicleControlSystem.ControlLayer
             }
         }
 
+        private int obstaclePattern;
+        public int ObstaclePattern
+        {
+            get { return obstaclePattern; }
+            set { SetField( ref this.obstaclePattern, value ); }
+        }
+
+
         //이동
         public bool Busy
         {
@@ -451,6 +459,8 @@ namespace VehicleControlSystem.ControlLayer
             if ( this.motion.IsErrorOn )
                 return 22;
 
+            this.VehicleStateProperty = eVehicleState.Idle;
+
             return result;
         }
 
@@ -600,6 +610,8 @@ namespace VehicleControlSystem.ControlLayer
                 {
                     if ( this.autoManager.OperationModeProperty == eOperatationMode.AutoMode )
                         this.CheckObstacle();
+
+                    this.CheckIOState();
                 }
                 catch ( ThreadInterruptedException threadInterruptedException )
                 {
@@ -616,6 +628,19 @@ namespace VehicleControlSystem.ControlLayer
             logger.D( "Vehicle - _ThObstacleChecker Dispose" );
         }
 
+        private void CheckIOState()
+        {
+            //이미 알람이면 체크 안함.
+            if ( this.VehicleStateProperty == eVehicleState.Abnormal ) return;
+
+            if ( this.iO.IsConnectError ) return;
+
+            if ( this.iO.IsOn( "IN_EMS_SW" ) ) this.OccurVehicleAlarm( 28 );
+            if ( !this.iO.IsOn( "IN_CP_ON_SAFETY" ) ) this.OccurVehicleAlarm( 31 );
+            if ( !this.iO.IsOn( "IN_CP_ON_24V" ) ) this.OccurVehicleAlarm( 30 );
+            if ( !this.iO.IsOn( "IN_MC_ON" ) ) this.OccurVehicleAlarm( 29 );
+        }
+
         /// <summary>
         /// Scheduler 가 주는 Sub Command 를 이용하여 동작하자.
         /// </summary>
@@ -787,18 +812,19 @@ namespace VehicleControlSystem.ControlLayer
                     }
                 }
 
-                if ( this.ObstacleStateProperty != eObstacleState.Normal )
-                {
-                    if ( this.ObstacleStateProperty == eObstacleState.Blocked )
-                        this.VehicleStateProperty = eVehicleState.Blocked;
-
-                    if ( this.ObstacleStateProperty == eObstacleState.Abnormal )
-                    {
-                        this.VehicleStateProperty = eVehicleState.Abnormal;
-                        this.OccurVehicleAlarm( 24 );
-                        return false;
-                    }
-                }
+                //20.04.04 Kang Drive 측으로 상태만 알려주면 알아서 처리함.
+                //if ( this.ObstacleStateProperty != eObstacleState.Normal )
+                //{
+                //    if ( this.ObstacleStateProperty == eObstacleState.Blocked )
+                //        this.VehicleStateProperty = eVehicleState.Blocked;
+
+                //    if ( this.ObstacleStateProperty == eObstacleState.Abnormal )
+                //    {
+                //        this.VehicleStateProperty = eVehicleState.Abnormal;
+                //        this.OccurVehicleAlarm( 24 );
+                //        return false;
+                //    }
+                //}
             }
 
             return true;
@@ -815,6 +841,8 @@ namespace VehicleControlSystem.ControlLayer
                     Thread.Sleep( 10 );
 
                     //ToDo: approach Cross Point Check
+
+                    //ToDo: Obstacle Laser Sensor Pattern Change Method 구현 필요.
                 }
             } );
 
@@ -1001,26 +1029,26 @@ namespace VehicleControlSystem.ControlLayer
         #region Check Method
         bool CheckObstacle()
         {
-            if ( this.iO.IsOn( "IN_OBSTRUCTION_DETECT_SAFETY" ) || this.iO.IsOn( "IN_OBSTRUCTION_DETECT_ERROR" ) )
-            {
-                this.ObstacleStateProperty = eObstacleState.Abnormal;
-                this.motion.SetObstacleState( this.ObstacleStateProperty );
-                return true;
-            }
-
-            if ( this.iO.IsOn( "IN_OBSTRUCTION_DETECT_STOP" ) )
-            {
-                this.ObstacleStateProperty = eObstacleState.Blocked;
-                this.motion.SetObstacleState( this.ObstacleStateProperty );
-                return true;
-            }
-
-            if ( this.iO.IsOn( "IN_OBSTRUCTION_DETECT_SLOW" ) )
-            {
-                this.ObstacleStateProperty = eObstacleState.Decelerate;
-                this.motion.SetObstacleState( this.ObstacleStateProperty );
-                return true;
-            }
+            //if ( this.iO.IsOn( "IN_OBSTRUCTION_DETECT_SAFETY" ) || this.iO.IsOn( "IN_OBSTRUCTION_DETECT_ERROR" ) )
+            //{
+            //    this.ObstacleStateProperty = eObstacleState.Abnormal;
+            //    this.motion.SetObstacleState( this.ObstacleStateProperty );
+            //    return true;
+            //}
+
+            //if ( this.iO.IsOn( "IN_OBSTRUCTION_DETECT_STOP" ) )
+            //{
+            //    this.ObstacleStateProperty = eObstacleState.Blocked;
+            //    this.motion.SetObstacleState( this.ObstacleStateProperty );
+            //    return true;
+            //}
+
+            //if ( this.iO.IsOn( "IN_OBSTRUCTION_DETECT_SLOW" ) )
+            //{
+            //    this.ObstacleStateProperty = eObstacleState.Decelerate;
+            //    this.motion.SetObstacleState( this.ObstacleStateProperty );
+            //    return true;
+            //}
 
             this.ObstacleStateProperty = eObstacleState.Normal;
             this.motion.SetObstacleState( this.ObstacleStateProperty );
@@ -1045,9 +1073,9 @@ namespace VehicleControlSystem.ControlLayer
                 return 16;
 
             if ( isLoad )
-                this.iO.OutputOff( "OUT_CV_CWCCW" );
-            else
                 this.iO.OutputOn( "OUT_CV_CWCCW" );
+            else
+                this.iO.OutputOff( "OUT_CV_CWCCW" );
 
             if ( isOn )
                 this.iO.OutputOn( "OUT_CV_RUN" );
@@ -1081,18 +1109,20 @@ namespace VehicleControlSystem.ControlLayer
         public bool IsDetectedCenter() => this.iO.IsOn( "IN_CV_DETECT_01" );
 
         bool IsDetectedLoadStop() => this.iO.IsOn( "IN_CV_DETECT_02" );
-        bool IsInverterError() => this.iO.IsOn( "IN_CV_ERROR" );
+        bool IsInverterError() => !this.iO.IsOn( "IN_CV_ERROR" ); //Normal Close로 생각 됨.
         bool IsLifterPositinCheck() => this.iO.IsOn( "IN_LIFTER_POSITION_DETECT" );
         bool IsLifterDuplication() => this.iO.IsOn( "IN_LIFTER_DUPLICATION_DETECT" );
         bool IsPIOInterLockOn() => this.iO.IsOn( "OUT_PIO_INTERLOCK" );
 
-        int Load_Carrier()
+        public int ConveyorLoad()
         {
             if ( IsDetectedCenter() )
                 return 9;
 
+            logger.D( "[Manual Load] - Conveyor On" );
             OnOffConveyor( true, true );
 
+            bool isStartDetected = false;
             long sTime = SwUtils.CurrentTimeMillis;
             while ( true )
             {
@@ -1102,18 +1132,30 @@ namespace VehicleControlSystem.ControlLayer
                     return 10;
                 }
 
-                if ( IsDetectedLoadStart() )
+                if ( this.IsDetectedLoadStart() && !isStartDetected )
+                    isStartDetected = true;
+
+                if ( !this.IsDetectedLoadStart() && isStartDetected )
+                {
+                    this.SetConveyorSpeed( false );
+                    logger.D( "[Manual Load] - Conveyor Slow State" );
+                }
+
+                if ( IsDetectedLoadStop() )
                     break;
             }
+            OnOffConveyor( false );
+            logger.D( "[Manual Load] - Conveyor Off" );
 
             return 0;
         }
 
-        int UnloadCarrier()
+        public int ConveyorUnload()
         {
-            if ( !IsDetectedLoadStart() )
+            if ( !IsDetectedCenter() )
                 return 11;
 
+            logger.D( "[Manual Unload] - Conveyor On" );
             OnOffConveyor( true, false );
 
             long sTime = SwUtils.CurrentTimeMillis;
@@ -1125,9 +1167,11 @@ namespace VehicleControlSystem.ControlLayer
                     return 12;
                 }
 
-                if ( !IsDetectedLoadStart() )
+                if ( !IsDetectedLoadStart() && !IsDetectedCenter() )
                     break;
             }
+            OnOffConveyor( false );
+            logger.D( "[Manual Unload] - Conveyor Off" );
 
             return 0;
         }
@@ -1411,6 +1455,7 @@ namespace VehicleControlSystem.ControlLayer
 
         private void BMUManager_OnDisconnect( string obj )
         {
+            this.OccurVehicleAlarm( 32 );
         }
 
         private void BMUManager_OnConnect( string obj )
@@ -1494,7 +1539,7 @@ namespace VehicleControlSystem.ControlLayer
         /// </summary>
         /// <param name="no"> 0 == Off Laser</param>
         /// <returns></returns>
-        bool ChgObstacleDetectPattern( int no )
+        public bool ChgObstacleDetectPattern( int no )
         {
             var bitArray = BitUtils.ChgBitArray( no );
 
@@ -1508,10 +1553,12 @@ namespace VehicleControlSystem.ControlLayer
                  bitIndex++;
              } );
 
+            ObstaclePattern = no;
+
             return true;
         }
 
-        int GetObstacleDetectPattern()
+        public int GetObstacleDetectPattern()
         {
             int bitIndex = 0;
 
@@ -1519,7 +1566,7 @@ namespace VehicleControlSystem.ControlLayer
 
             this.obstacleBitList.ForEach( b =>
              {
-                 if ( this.iO.IsOn( b ) )
+                 if ( this.iO.IsOn( b, false ) )
                      bitArray.Set( bitIndex, false );
                  else
                      bitArray.Set( bitIndex, true );
@@ -1536,7 +1583,7 @@ namespace VehicleControlSystem.ControlLayer
             this.autoManager.ProcessAlarm( alarmID );
         }
 
-        void SetObstaclePattern( ObstacleControlEventArgs.eControlKind state, int value )
+        public void SetObstaclePattern( ObstacleControlEventArgs.eControlKind state, int value )
         {
             if ( state == ObstacleControlEventArgs.eControlKind.DRIVE )
             {

+ 27 - 6
Dev/OHV/VehicleControlSystem/Managers/AutoManager.cs

@@ -84,10 +84,30 @@ namespace VehicleControlSystem.Managers
 
                 autoModeState = value;
                 logger.D($"[AutoManager] AutoModeState - {value}");
+                switch ( value )
+                {
+                    case eAutoModeState.ErrorStop:
+                        this.LampStateProperty = eLampState.Alarm;
+                        break;
+                    case eAutoModeState.StartRun:
+                        this.LampStateProperty = eLampState.AutoRunNChargingFull;
+                        break;
+                    case eAutoModeState.Run:
+                        this.LampStateProperty = eLampState.AutoRunNChargingFull;
+                        break;
+                    case eAutoModeState.Stop:
+                        this.LampStateProperty = eLampState.Alarm;
+                        break;
+                    case eAutoModeState.WaitStop:
+                        this.LampStateProperty = eLampState.Alarm;
+                        break;
+                    default:
+                        break;
+                }
             }
         }
 
-        private eLampState lampState;
+        private eLampState lampState = eLampState.None;
         public eLampState LampStateProperty
         {
             get { return lampState; }
@@ -168,14 +188,14 @@ namespace VehicleControlSystem.Managers
             switch (state)
             {
                 case eLampState.Alarm:
-                    this.iO.OutputOff("OUT_TOWER_LAMP_RED");
+                    this.iO.OutputOn("OUT_TOWER_LAMP_RED");
                     break;
                 case eLampState.Charging:
-                    this.iO.OutputOff( "OUT_TOWER_LAMP_RED" );
-                    this.iO.OutputOff( "OUT_TOWER_LAMP_GREEN" );
+                    this.iO.OutputOn( "OUT_TOWER_LAMP_RED" );
+                    this.iO.OutputOn( "OUT_TOWER_LAMP_GREEN" );
                     break;
                 case eLampState.AutoRunNChargingFull:
-                    this.iO.OutputOff( "OUT_TOWER_LAMP_GREEN" );
+                    this.iO.OutputOn( "OUT_TOWER_LAMP_GREEN" );
                     //Blue 없음
                     //this.iO.OutputOff("OUT_TOWER_LAMP_BLUE");
                     break;
@@ -249,7 +269,6 @@ namespace VehicleControlSystem.Managers
                             break;
                         case eAutoModeState.StartRun:
                             this.AutoModeStateProperty = eAutoModeState.Run;
-                            this.LampStateProperty = eLampState.AutoRunNChargingFull;
                             break;
                         case eAutoModeState.Run:
                             break;
@@ -262,8 +281,10 @@ namespace VehicleControlSystem.Managers
                 default:
                     break;
             }
+
         }
 
+
         public void ProcessAlarm(int alarmID)
         {
             this.AutoModeStateProperty = eAutoModeState.ErrorStop;

+ 58 - 5
Dev/OHV/VehicleControlSystem/VCSystem.cs

@@ -108,7 +108,9 @@ namespace VehicleControlSystem
         }
         private void EzIO_OnContd(string ID)
         {
+            //IO 연결 시 할일 들을 여기서 하자.
             this.IO.OutputOn( "OUT_TEACH_MODE" );
+            this.autoManager.LampStateProperty = eLampState.Alarm;
 
             //throw new NotImplementedException();
         }
@@ -152,18 +154,63 @@ namespace VehicleControlSystem
                 case VCSMessageEventArgs.eVCSMessageKind.ReqTest:
                     ReqTest();
                     break;
+                case VCSMessageEventArgs.eVCSMessageKind.ReqConveyorLoad:
+                    ReqConveyorLoad();
+                    break;
+                case VCSMessageEventArgs.eVCSMessageKind.ReqConveyorUnload:
+                    ReqConveyorUnload();
+                    break;
+                case VCSMessageEventArgs.eVCSMessageKind.ReqObstaclePatternChg:
+                    ReqObsticlePatternChange(msg);
+                    break;
+                case VCSMessageEventArgs.eVCSMessageKind.ReqObstaclePatternNo:
+                    ReqObsticlePatternNo();
+                    break;
                 default:
                     break;
             }
         }
 
+        private void ReqObsticlePatternNo()
+        {
+            var reply = new GUIMessageEventArgs();
+            reply.Kind = GUIMessageEventArgs.eGUIMessageKind.RspObstaclePatternNo;
+            reply.MessageText = this.vehicle.GetObstacleDetectPattern().ToString();
+
+            GUIMessageEventPublish( reply );
+        }
+
+        private void ReqObsticlePatternChange( VCSMessageEventArgs msg )
+        {
+            var patternNo = Convert.ToInt32( msg.MessageText );
+            this.vehicle.ChgObstacleDetectPattern( patternNo );
+
+            var reply = new GUIMessageEventArgs();
+            reply.Kind = GUIMessageEventArgs.eGUIMessageKind.RspObstaclePatternChg;
+            reply.Result = FluentResults.Results.Ok();
+
+            GUIMessageEventPublish( reply );
+        }
+
+        private void ReqConveyorUnload()
+        {
+            int result = 0;
+            result = this.vehicle.ConveyorUnload();
+        }
+
+        private void ReqConveyorLoad()
+        {
+            int result = 0;
+            result = this.vehicle.ConveyorLoad();
+        }
+
         private void ReqTest()
         {
-            logger.D( "Test Request" );
-            if ( this.IO.WaitChangeInputIO( true, 30000, "IN_CV_DETECT_00" ) )
-                logger.D( "Test - Time in" );
-            else
-                logger.D( "Test - Time out" );
+            //logger.D( "Test Request" );
+            //if ( this.IO.WaitChangeInputIO( true, 30000, "IN_CV_DETECT_00" ) )
+            //    logger.D( "Test - Time in" );
+            //else
+            //    logger.D( "Test - Time out" );
         }
 
         private void ReqMachineModeChg( VCSMessageEventArgs msg )
@@ -204,6 +251,12 @@ namespace VehicleControlSystem
         {
             this.autoManager.IsErrorProcessing = false;
             this.vehicle.VehicleStateProperty = eVehicleState.Idle;
+
+            if ( !this.IO.IsOn( "IN_MC_ON" ) )
+            {
+                this.IO.WriteOutputIO( "OUT_SAFETY_RESET", true );
+                this.IO.WriteOutputIO( "OUT_SAFETY_RESET", false, 3000 );
+            }
         }
 
         private void ReqEStop()

+ 10 - 0
Dev/OHV/VehicleControlSystem/VehicleControlSystem.csproj

@@ -43,6 +43,16 @@
     <ErrorReport>prompt</ErrorReport>
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote1|AnyCPU'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\Remote1\</OutputPath>
+    <DefineConstants>TRACE;DEBUG</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="CommonServiceLocator, Version=2.0.4.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
       <HintPath>..\packages\CommonServiceLocator.2.0.4\lib\net45\CommonServiceLocator.dll</HintPath>