Browse Source

no message

DESKTOP-Kang 6 years ago
parent
commit
b98d368f4c
33 changed files with 530 additions and 112 deletions
  1. 3 6
      Dev/Connection/OHVProtocolServer/OHVProtocolClient/MainWindow.xaml.cs
  2. BIN
      Dev/OHV/Assambly/System.Net.Json.dll
  3. 4 0
      Dev/OHV/OHV.Common/Events/MessageEventArgs.cs
  4. 1 0
      Dev/OHV/OHV.Common/Model/Route.cs
  5. 26 0
      Dev/OHV/OHV.Common/Model/RoutePoint.cs
  6. 16 0
      Dev/OHV/OHV.Common/Model/RouteSegment.cs
  7. 12 0
      Dev/OHV/OHV.Common/OHV.Common.csproj
  8. 10 0
      Dev/OHV/OHV.LanguageHalper/OHV.LanguageHelper.csproj
  9. 10 0
      Dev/OHV/OHV.Module.Interactivity/OHV.Module.Interactivity.csproj
  10. 10 0
      Dev/OHV/OHV.Module.Layout/OHV.Module.Layout.csproj
  11. 10 0
      Dev/OHV/OHV.Module.ListViews/OHV.Module.ListViews.csproj
  12. 12 4
      Dev/OHV/OHV.Module.ListViews/Views/CommandListViewModel.cs
  13. 10 0
      Dev/OHV/OHV.Module.MainViews/OHV.Module.MainViews.csproj
  14. 10 0
      Dev/OHV/OHV.Module.Monitoring/OHV.Module.Monitoring.csproj
  15. 10 0
      Dev/OHV/OHV.Module.Status/OHV.Module.Status.csproj
  16. 11 0
      Dev/OHV/OHV.OCS/OHV.OCS.csproj
  17. 10 0
      Dev/OHV/OHV.SqliteDAL/OHV.SqliteDAL.csproj
  18. 5 0
      Dev/OHV/OHV.SqliteDAL/OHVDbInitializer.cs
  19. 10 0
      Dev/OHV/OHV.UIControl/OHV.UIControl.csproj
  20. BIN
      Dev/OHV/OHV.Vehicle/Config/IO.xlsx
  21. 9 9
      Dev/OHV/OHV.Vehicle/Config/log4net.xml
  22. 11 0
      Dev/OHV/OHV.Vehicle/OHV.Vehicle.csproj
  23. 27 12
      Dev/OHV/OHV.sln
  24. 5 0
      Dev/OHV/VehicleControlSystem/ControlLayer/IO/BitBlock.cs
  25. 6 0
      Dev/OHV/VehicleControlSystem/ControlLayer/Serial/BatteryTabos/BMUManager.cs
  26. 2 1
      Dev/OHV/VehicleControlSystem/ControlLayer/Serial/DataModel/ReceivedData.cs
  27. 88 42
      Dev/OHV/VehicleControlSystem/ControlLayer/Vehicle.cs
  28. 36 1
      Dev/OHV/VehicleControlSystem/Managers/AutoManager.cs
  29. 73 26
      Dev/OHV/VehicleControlSystem/Managers/HostManager.cs
  30. 63 0
      Dev/OHV/VehicleControlSystem/Managers/RouteManager.cs
  31. 13 8
      Dev/OHV/VehicleControlSystem/Managers/Scheduler.cs
  32. 2 2
      Dev/OHV/VehicleControlSystem/VCSystem.cs
  33. 15 1
      Dev/OHV/VehicleControlSystem/VehicleControlSystem.csproj

+ 3 - 6
Dev/Connection/OHVProtocolServer/OHVProtocolClient/MainWindow.xaml.cs

@@ -100,6 +100,9 @@ namespace OHVProtocolClient
                 case eKind.F:
                 case eKind.I:
                 case eKind.O:
+                case eKind.P:
+                case eKind.L:
+                case eKind.U:
                     ReplyMessage( msg );
                     break;
 
@@ -107,14 +110,8 @@ namespace OHVProtocolClient
                     break;
                 case eKind.C:
                     break;
-                case eKind.P:
-                    break;
                 case eKind.A:
                     break;
-                case eKind.L:
-                    break;
-                case eKind.U:
-                    break;
                 case eKind.M:
                     break;
                 case eKind.R:

BIN
Dev/OHV/Assambly/System.Net.Json.dll


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

@@ -27,6 +27,8 @@ namespace OHV.Common.Events
             RspEStop,
             RspVihicleState,
             RspMachineModeChg,
+
+            RspAddCommand,
         }
 
         //Property 이름임.
@@ -65,6 +67,8 @@ namespace OHV.Common.Events
             ReqEStop,
             ReqBuzzerStop,
             ReqMachineModeChg,
+
+            ReqAddCommand,
         }
 
         public eVCSMessageKind Kind { get; set; }

+ 1 - 0
Dev/OHV/OHV.Common/Model/Route.cs

@@ -20,6 +20,7 @@ namespace OHV.Common.Model
         UnloadPort,
         Charging,
         Road, // 일반 길
+        Cross,
     }
 
 

+ 26 - 0
Dev/OHV/OHV.Common/Model/RoutePoint.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OHV.Common.Model
+{
+    public class RoutePoint
+    {
+        public string Name { get; set; }
+        public ePointType Type { get; set; }
+        public List<RouteSegment> Segments { get; set; }
+        public List<string> SegmentsID { get; set; }
+        public List<string> PreRoutes { get; set; }
+        public List<string> NextRoutes { get; set; }
+
+        public RoutePoint()
+        {
+            this.SegmentsID = new List<string>();
+            this.Segments = new List<RouteSegment>();
+            this.PreRoutes = new List<string>();
+            this.NextRoutes = new List<string>();
+        }
+    }
+}

+ 16 - 0
Dev/OHV/OHV.Common/Model/RouteSegment.cs

@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OHV.Common.Model
+{
+    public class RouteSegment
+    {
+        public string Name { get; set; }
+        public double Length { get; set; }
+        public eRoadForm From {get;set;}
+        public int MaxSpeed { get; set; }
+    }
+}

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

@@ -33,6 +33,16 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote|AnyCPU'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\Remote\</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>
@@ -76,6 +86,8 @@
     <Compile Include="Model\Config.cs" />
     <Compile Include="Model\HisAlarm.cs" />
     <Compile Include="Model\Route.cs" />
+    <Compile Include="Model\RoutePoint.cs" />
+    <Compile Include="Model\RouteSegment.cs" />
     <Compile Include="Model\SelectionItem.cs" />
     <Compile Include="Model\SelectionList.cs" />
     <Compile Include="Model\SubCmd.cs" />

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

@@ -30,6 +30,16 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote|AnyCPU'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\Remote\</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

@@ -32,6 +32,16 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote|AnyCPU'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\Remote\</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.Layout/OHV.Module.Layout.csproj

@@ -31,6 +31,16 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote|AnyCPU'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\Remote\</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

@@ -32,6 +32,16 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote|AnyCPU'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\Remote\</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>

+ 12 - 4
Dev/OHV/OHV.Module.ListViews/Views/CommandListViewModel.cs

@@ -99,15 +99,23 @@ namespace OHV.Module.ListViews.Views
 
         private void ExecuteSaveCommand()
         {
-            Command cmd = new Command() { TargetID = TargetID, Type = SelectedCommandType };
-            cmd.ByWho = eCommandByWho.LocalSystem;
-
             var route = sql.RouteDal.GetRoute( TargetID );
             if (route ==null )
                 messageController.ShowNotificationView( "Not Found TargetID" );
             else
-                sql.CommandDAL.Add(cmd);
+            {
+                Command cmd = new Command() { TargetID = TargetID, Type = SelectedCommandType };
+                cmd.ByWho = eCommandByWho.LocalSystem;
+
+                var msg = new VCSMessageEventArgs();
+                msg.Kind = VCSMessageEventArgs.eVCSMessageKind.ReqAddCommand;
+                msg.Command = cmd;
+
+                this.eventAggregator.GetEvent<VCSMessagePubSubEvent>().Publish( msg );
+            }
+
 
+            //UI 초기화
             this.TargetID = "None";
             this.SelectedCommandType = eCommandType.Move;
         }

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

@@ -32,6 +32,16 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote|AnyCPU'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\Remote\</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.Monitoring/OHV.Module.Monitoring.csproj

@@ -32,6 +32,16 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote|AnyCPU'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\Remote\</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

@@ -33,6 +33,16 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote|AnyCPU'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\Remote\</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

@@ -33,6 +33,17 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote|AnyCPU'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\Remote\</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

@@ -33,6 +33,16 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote|AnyCPU'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\Remote\</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 - 0
Dev/OHV/OHV.SqliteDAL/OHVDbInitializer.cs

@@ -179,6 +179,11 @@ namespace OHV.SqliteDAL
                 new Alarm { AlarmId = 22, Kind = eAlarmKind.Axis, Name = "Init",           Text="Vehicle Drive Error",                     Solution="", Description="", Level = eAlarmLevel.Falut, },
                 new Alarm { AlarmId = 23, Kind = eAlarmKind.Axis, Name = "EStop",          Text="EStop",                                   Solution="", Description="", Level = eAlarmLevel.Falut, },
                 new Alarm { AlarmId = 24, Kind = eAlarmKind.Axis, Name = "Vehicle Move Error", Text="while Vehicle Move Obstacle Detected",Solution="", Description="", Level = eAlarmLevel.Falut, },
+                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, },
             } );
 
             //context.Set<HisAlarm>().Add(new HisAlarm { AlarmId = 1, OccurTime = DateTime.Now.AddDays(-10) });

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

@@ -31,6 +31,16 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote|AnyCPU'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\Remote\</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>

BIN
Dev/OHV/OHV.Vehicle/Config/IO.xlsx


+ 9 - 9
Dev/OHV/OHV.Vehicle/Config/log4net.xml

@@ -38,10 +38,10 @@
 
   <appender name="PhysicalCheckupFileAppender" type="GSG.NET.Logging.FileAppender, GSG.NET">
     <threshold value="WARN"/>
-    <file value="D:\LOG\OHV\Vehicle\PhysicalCheckup\PhysicalCheckup.log" />
+    <file value="C:\LOG\OHV\Vehicle\PhysicalCheckup\PhysicalCheckup.log" />
     <appendToFile value="true" />
     <rollingStyle value="Date" />
-    <backupDays value="180" />
+    <backupDays value="20" />
     <datePattern value="-MMdd'.log'" />
     <layout type="log4net.Layout.PatternLayout">
       <conversionPattern value="%d{MM-dd HH:mm:ss.fff} %2t %p %m%n" />
@@ -49,13 +49,13 @@
   </appender>
 
   <appender name="FileAppender" type="GSG.NET.Logging.FileAppender, GSG.NET">
-		<!--<filter type="log4net.Filter.LevelRangeFilter">
+		<filter type="log4net.Filter.LevelRangeFilter">
 			<param name="LevelMin" value="INFO"></param>
 			<param name="LevelMax" value="OFF"></param>
-		</filter>-->
+		</filter>
     <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
     <file type="log4net.Util.PatternString">
-      <conversionPattern value="D:\LOG\OHV\Vehicle\Vehicle.log"  />
+      <conversionPattern value="C:\LOG\OHV\Vehicle\Vehicle.log"  />
     </file>
 		<appendToFile value="true" />
 		<rollingStyle value="Date" />
@@ -67,7 +67,7 @@
 	</appender>
 
 	<appender name="HostAppender" type="GSG.NET.Logging.FileAppender, GSG.NET">
-		<file value="D:\LOG\OHV\Vehicle\OCS\Host.log" />
+		<file value="C:\LOG\OHV\Vehicle\OCS\Host.log" />
 		<appendToFile value="true" />
 		<rollingStyle value="Date" />
 		<backupDays value="20" />
@@ -78,7 +78,7 @@
 	</appender>
 
 	<appender name="PIOAppender" type="GSG.NET.Logging.FileAppender, GSG.NET">
-		<file value="D:\LOG\OHV\Vehicle\PIO\PIO.log" />
+		<file value="C:\LOG\OHV\Vehicle\PIO\PIO.log" />
 		<appendToFile value="true" />
 		<rollingStyle value="Date" />
 		<backupDays value="20" />
@@ -94,7 +94,7 @@
 			<param name="LevelMax" value="DEBUG"></param>
 		</filter>
 		<threshold value="DEBUG"/>
-		<file value="D:\LOG\OHV\DEBUG\Vehicle_DEBUG.log" />
+		<file value="C:\LOG\OHV\DEBUG\Vehicle_DEBUG.log" />
 		<appendToFile value="true" />
 		<rollingStyle value="Date" />
 		<backupDays value="10" />
@@ -106,7 +106,7 @@
 
 	<appender name="WarnFileAppender" type="GSG.NET.Logging.FileAppender, GSG.NET">
 		<threshold value="WARN"/>
-		<file value="D:\LOG\OHV\Vehicle\Vehicle_WARN.log" />
+		<file value="C:\LOG\OHV\Vehicle\Vehicle_WARN.log" />
 		<appendToFile value="true" />
 		<rollingStyle value="Date" />
 		<backupDays value="180" />

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

@@ -52,6 +52,17 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote|AnyCPU'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>\\LAPTOP_KANG\Shared\</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>
   <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>

+ 27 - 12
Dev/OHV/OHV.sln

@@ -25,8 +25,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OHV.UIControl", "OHV.UICont
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OHV.Common", "OHV.Common\OHV.Common.csproj", "{0D1F7FBC-BFB0-4EE4-852D-E2A8D62C5708}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GSG.NET.WPF", "..\..\..\GSG\GSG\GSG.NET.WPF\GSG.NET.WPF.csproj", "{6B91FCA2-0A26-41D5-8959-A6F27645DACD}"
-EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OHV.OCS", "OHV.OCS\OHV.OCS.csproj", "{D045DC91-1AD5-4EBF-A062-0C6C5FE203C5}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VehicleControlSystem", "VehicleControlSystem\VehicleControlSystem.csproj", "{73BAB40E-FC7D-4AB5-85CA-B4CF221DFBD1}"
@@ -37,8 +35,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OHV.Module.MainViews", "OHV
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OHV.Module.Interactivity", "OHV.Module.Interactivity\OHV.Module.Interactivity.csproj", "{D6402D97-2206-4D55-8097-8DA9A01568CB}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GSG.NET.Excel", "..\..\..\GSG\GSG\GSG.NET.ExcelMapper\GSG.NET.Excel.csproj", "{83824C10-4BF7-48DD-9CD5-686A552F8E97}"
-EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OHV.LanguageHelper", "OHV.LanguageHalper\OHV.LanguageHelper.csproj", "{712D75B5-89DD-4064-BC4B-2F9D9F157604}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OHV.Module.ListViews", "OHV.Module.ListViews\OHV.Module.ListViews.csproj", "{0043B4EC-A651-401C-9845-57A7C7576E28}"
@@ -49,68 +45,87 @@ Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
 		Release|Any CPU = Release|Any CPU
+		Remote|Any CPU = Remote|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
 		{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
 		{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
 		{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
 		{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
-		{6B91FCA2-0A26-41D5-8959-A6F27645DACD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{6B91FCA2-0A26-41D5-8959-A6F27645DACD}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{6B91FCA2-0A26-41D5-8959-A6F27645DACD}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{6B91FCA2-0A26-41D5-8959-A6F27645DACD}.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
 		{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
 		{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
 		{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
 		{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
 		{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
-		{83824C10-4BF7-48DD-9CD5-686A552F8E97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{83824C10-4BF7-48DD-9CD5-686A552F8E97}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{83824C10-4BF7-48DD-9CD5-686A552F8E97}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{83824C10-4BF7-48DD-9CD5-686A552F8E97}.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
 		{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
 		{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
 		{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
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 5 - 0
Dev/OHV/VehicleControlSystem/ControlLayer/IO/BitBlock.cs

@@ -32,5 +32,10 @@ namespace VehicleControlSystem.ControlLayer.IO
 
         public bool IsBitOn { get; set; } = false;
         public bool IsChanged { get; set; } = false;
+
+        public BitBlock Clone()
+        {
+            return ( BitBlock)MemberwiseClone();
+        }
     }
 }

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

@@ -174,6 +174,12 @@ namespace VehicleControlSystem.ControlLayer.Serial.BatteryTabos
             this.cancel.Cancel();
             this.cancel.StopWaitAll();
         }
+
+        public void test()
+        {
+            var clone = this.ReceivedDataDic.Values.FirstOrDefault(); 
+            this.qq.Enqueue( new QoReceivedDataChanged { Arg0 = clone } );
+        }
         #endregion
     }
 }

+ 2 - 1
Dev/OHV/VehicleControlSystem/ControlLayer/Serial/DataModel/ReceivedData.cs

@@ -36,9 +36,10 @@ namespace VehicleControlSystem.ControlLayer.Serial.DataModel
         public Enum DataKind { get; set; } = eDataKind.BatteryState;
         public eBatteryState BatteryState { get; set; }
 
+        
         public double Value 
         {
-            get { return Value; }
+            get { return 0.0; }
         }
         public string OrgValue { get; set; } = "0";
 

+ 88 - 42
Dev/OHV/VehicleControlSystem/ControlLayer/Vehicle.cs

@@ -227,6 +227,7 @@ namespace VehicleControlSystem.ControlLayer
 
         ThreadCancel cancel = new ThreadCancel();
         TaskCancel taskCancel = new TaskCancel();
+        TaskCancel taskMoveCancel = new TaskCancel();
 
         IEventAggregator eventAggregator;
 
@@ -641,6 +642,7 @@ namespace VehicleControlSystem.ControlLayer
             }
             logger.D( "Vehicle - _ThSubCmdWorker Dispose" );
         }
+
         #endregion
 
         #region Control Action Method
@@ -653,18 +655,14 @@ namespace VehicleControlSystem.ControlLayer
             this.OccurVehicleAlarm( 23 );
         }
 
+        #region For Moving
         void Move( SubCmd sub )
         {
             if ( this.MoveTo( sub.TargetID ) )
             {
-                sql.SubCmdDAL.Delete( sub );
-            }
-            else
-            {
-                if ( this.ObstacleStateProperty == eObstacleState.Blocked )
-                {
-                }
             }
+
+            sql.SubCmdDAL.Delete( sub );
         }
 
         bool MoveTo( string pointID )
@@ -687,11 +685,21 @@ namespace VehicleControlSystem.ControlLayer
             this.OnMoving?.Invoke();
             this.IsMoving = true;
 
+            //이전에 있던 작업들 종료 및 삭제
+            this.taskMoveCancel.Cancel();
+            this.taskMoveCancel.WaitAll();
+
+            this.taskMoveCancel.Add( CheckCrossPoint() );
+
             //this.BuzzerOnOff(true, eBuzzerKind.Moving);
             this.motion.MoveToPoint( pointID, 100 );
 
             bool result = Wait4MoveDone();
             //this.BuzzerOnOff(false);
+
+            this.taskMoveCancel.Cancel();
+            this.taskMoveCancel.WaitAll();
+
             if ( motion.IsStop )
             {
                 this.IsMoving = false;
@@ -755,6 +763,24 @@ namespace VehicleControlSystem.ControlLayer
             return true;
         }
 
+        Task CheckCrossPoint()
+        {
+            var task = Task.Run( () => 
+            {
+                long sTime = SwUtils.CurrentTimeMillis;
+
+                while ( !this.taskMoveCancel.Canceled )
+                {
+                    Thread.Sleep( 10 );
+
+                    //ToDo: approach Cross Point Check
+                }
+            } );
+
+            return task;
+        }
+        #endregion
+
         public bool LoadCarrier( SubCmd sub )
         {
             this.VehicleStateProperty = eVehicleState.Load;
@@ -774,12 +800,15 @@ namespace VehicleControlSystem.ControlLayer
                 return false;
             }
 
+            this.iO.OutputOn( "OUT_PIO_SENSOR_ONOFF" );
             result = this.PIOAndLoad( sub.TargetID );
             if ( result != 0 )
             {
+                this.iO.OutputOff( "OUT_PIO_SENSOR_ONOFF" );
                 this.OccurVehicleAlarm( result );
                 return false;
             }
+            this.iO.OutputOff( "OUT_PIO_SENSOR_ONOFF" );
 
             result = this.clamp.Lock_Sync();
             if ( result != 0 )
@@ -816,12 +845,16 @@ namespace VehicleControlSystem.ControlLayer
                 return false;
             }
 
+            this.iO.OutputOn( "OUT_PIO_SENSOR_ONOFF" );
+
             result = this.PIOAndUnload( sub.TargetID );
             if ( result != 0 )
             {
+                this.iO.OutputOff( "OUT_PIO_SENSOR_ONOFF" );
                 this.OccurVehicleAlarm( result );
                 return false;
             }
+            this.iO.OutputOff( "OUT_PIO_SENSOR_ONOFF" );
 
             sql.CommandDAL.UpdateState( sub.CmdID, eCommandState.Complete );
             sql.SubCmdDAL.Delete( sub );
@@ -831,33 +864,48 @@ namespace VehicleControlSystem.ControlLayer
             return true;
         }
 
+        private void BatteryCharge( SubCmd subCmd )
+        {
+            this.VehicleStateProperty = eVehicleState.Charge;
+
+            this.iO.OutputOn( "OUT_PIO_SENSOR_ONOFF" );
+            
+            this.PIOBatteryCharge( subCmd );
+            
+            this.iO.OutputOff( "OUT_PIO_SENSOR_ONOFF" );
+
+            sql.CommandDAL.UpdateState( subCmd.CmdID, eCommandState.Complete );
+            sql.SubCmdDAL.Delete( subCmd );
+
+            this.VehicleStateProperty = eVehicleState.Idle;
+        }
+
         /// <summary>
         /// Battery Charge
         /// 충전 시 PIO 를 해야 함.
         /// </summary>
         /// <param name="sub"></param>
         /// <returns></returns>
-        public bool BatteryCharge( SubCmd sub )
+        public int PIOBatteryCharge( SubCmd sub )
         {
             var route = sql.RouteDal.GetRoute( sub.TargetID );
 
             if ( !CorrectPosition( route, this.CurrentPosition ) )
             {
                 this.OccurVehicleAlarm( 21 );
-                return false; //Alarm
+                return 0; //Alarm
             }
 
             var pioTimeout = sql.ConfigDal.GetValueToInt( ConstString.PIOTimeOut );
 
             PIOClear();
-            loggerPIO.I( $"Start Unload PIO - [{sub.TargetID}]" );
-            this.OnPIOStart?.Invoke( false );
-
+            loggerPIO.I( $"Start Charge PIO - [{sub.TargetID}]" );
             if ( !this.iO.IsOn( "IN_PIO_READY" ) )
             {
                 loggerPIO.E( "[Port] - 1 Ready not On" );
-                this.OnFailReport?.Invoke( eFailCode.UnlaodPIOInterlockTimeout );
-                //return 0;
+                this.iO.OutputOff( "OUT_PIO_SENSOR_ONOFF" );
+                this.OccurVehicleAlarm( 25 );
+                return 0;
             }
 
             this.iO.WriteOutputIO( "OUT_PIO_READY", true );
@@ -867,51 +915,44 @@ namespace VehicleControlSystem.ControlLayer
             {
                 PIOClear();
                 loggerPIO.E( "[Port] - 2 Receive CV Run Timeout" );
-                this.OnFailReport?.Invoke( eFailCode.UnlaodPIOInterlockTimeout );
-                //return 0;
+                this.OccurVehicleAlarm( 26 );
+                return 0;
             }
 
             this.iO.WriteOutputIO( "OUT_PIO_SENDING_RUN", true );
             loggerPIO.I( "[Vehicle] - 2 Send Run On" );
 
-            this.SetConveyorSpeed( true );
-            this.OnOffConveyor( true );
-            this.OnConveyorStart?.Invoke( false );
-
             var sTime = SwUtils.CurrentTimeMillis;
             while ( true )
             {
-                if ( SwUtils.Gt( sTime, 20 * ConstUtils.ONE_SECOND ) )
-                {
-                    PIOClear();
-                    this.OnOffConveyor( false, true );
-                    loggerPIO.E( "[Port] Conveyor Wait Time Out" );
-                    this.OnFailReport?.Invoke( eFailCode.UnlaodPIOInterlockTimeout );
+                Thread.Sleep( 5 );
 
-                    //if (IsDetectedLoadStart() || IsDetectedCenter()) //중간에 걸려 있다고 생각해서 알람 처리.
-                    //    return 12; //Conveyor Moving Timeout
-                    //else
-                    //    return 0;
-                }
+                if ( !this.iO.IsOn( "IN_PIO_READY" ) || this.iO.IsOn( "IN_PIO_RECEIVE_RUN" ) )
+                    break;
 
-                if ( this.iO.IsOn( "IN_PIO_RECEIVE_COMPLITE" ) )
+                if ( !sql.CommandDAL.HasK( this.CurrentSubCommand.CmdID ) )
+                {
+                    PIOClear();
+                    logger.D( "[Wait Charging] - 메인 명령 사라짐" );
                     break;
+                }
             }
 
-            if ( !IsDetectedCenter() )
-                this.OnCarrierDetected?.Invoke( false );
+            if ( !this.iO.WaitChangeInputIO( true, pioTimeout, "IN_PIO_RECEIVE_COMPLITE" ) )
+            {
+                PIOClear();
+                loggerPIO.E( "[Port] - 3 Receive Complete Timeout" );
+                this.OccurVehicleAlarm( 26 );
+                return 0;
+            }
 
-            this.OnOffConveyor( false ); //Stop
-            this.OnConveyorStop?.Invoke( false );
             PIOClear();
 
             this.iO.WriteOutputIO( "OUT_PIO_SEND_COMPLITE", true );
-            this.iO.WriteOutputIO( "OUT_PIO_SEND_COMPLITE", false, 1000 );
-
-            this.OnUnloadComplete?.Invoke();
-
+            Thread.Sleep( 1000 );
+            this.iO.WriteOutputIO( "OUT_PIO_SEND_COMPLITE", false );
 
-            return true;
+            return 0;
         }
 
         #endregion
@@ -1073,6 +1114,9 @@ namespace VehicleControlSystem.ControlLayer
             PIOClear();
             Thread.Sleep( 1000 );
             this.OnConveyorStop?.Invoke( true );
+
+            Thread.Sleep( 1000 );
+            this.OnLoadComplete?.Invoke();
 #else
             var pioTimeout = sql.ConfigDal.GetValueToInt( ConstString.PIOTimeOut );
 
@@ -1195,6 +1239,7 @@ namespace VehicleControlSystem.ControlLayer
             this.OnConveyorStop?.Invoke( false );
             PIOClear();
 
+            Thread.Sleep( 1000 );
             this.OnUnloadComplete?.Invoke();
 #else
             var pioTimeout = sql.ConfigDal.GetValueToInt( ConstString.PIOTimeOut );
@@ -1274,7 +1319,8 @@ namespace VehicleControlSystem.ControlLayer
             PIOClear();
 
             this.iO.WriteOutputIO( "OUT_PIO_SEND_COMPLITE" , true );
-            this.iO.WriteOutputIO( "OUT_PIO_SEND_COMPLITE" , false , 1000 );
+            Thread.Sleep( 1000 );
+            this.iO.WriteOutputIO( "OUT_PIO_SEND_COMPLITE" , false );
 
             this.OnUnloadComplete?.Invoke();
 #endif

+ 36 - 1
Dev/OHV/VehicleControlSystem/Managers/AutoManager.cs

@@ -9,6 +9,7 @@ using OHV.SqliteDAL;
 using OHV.Common.Model;
 using OHV.Common.Events;
 using VehicleControlSystem.ControlLayer;
+using GSG.NET.Utils;
 
 namespace VehicleControlSystem.Managers
 {
@@ -23,7 +24,32 @@ namespace VehicleControlSystem.Managers
         bool isThreadAlive = false;
 
         IIO iO = null;
-        public bool IsErrorProcessing { get; set; } = false;
+
+        private bool isErrorProcessing = false;
+        public bool IsErrorProcessing 
+        { 
+            get { return this.isErrorProcessing; }
+            set
+            {
+                if ( this.isErrorProcessing == value ) return;
+                this.isErrorProcessing = value;
+                if ( value )
+                {
+                    if ( this.activeAlarm == null ) return;
+                    this.OnOccurAlarm?.BeginInvoke( this.activeAlarm.AlarmId, null, null );
+                }
+                else
+                {
+                    if ( this.activeAlarm == null ) return;
+                    this.OnClearAlarm?.BeginInvoke( this.activeAlarm.AlarmId, null, null );
+                    this.activeAlarm = null;
+                }
+            } 
+        }
+        public event Action<int> OnOccurAlarm;
+        public event Action<int> OnClearAlarm;
+        Alarm activeAlarm = null;
+
         IEventAggregator eventAggregator = null;
         SqliteManager sql = null;
 
@@ -242,6 +268,7 @@ namespace VehicleControlSystem.Managers
         {
             this.AutoModeStateProperty = eAutoModeState.ErrorStop;
             this.LampStateProperty = eLampState.Alarm;
+            this.BuzzerStateProperty = eBuzzerKind.Alarm;
 
             this.sql.CommandDAL.Clean();
             this.sql.SubCmdDAL.Clean();
@@ -252,6 +279,10 @@ namespace VehicleControlSystem.Managers
             {
                 hisAlarm.AlarmId = alarmID;
                 hisAlarm.Text = "Not Define Alarm";
+
+                alarm = new Alarm();
+                alarm.AlarmId = alarmID;
+                alarm.Text = "Not Define Alarm";
             }
             else
             {
@@ -266,6 +297,10 @@ namespace VehicleControlSystem.Managers
             if (IsErrorProcessing)
                 return;
 
+            IsErrorProcessing = true;
+
+            this.activeAlarm = ObjectCopyUtils.DeepClone<Alarm>( alarm );
+
             var msg = new GUIMessageEventArgs
             {
                 Kind = GUIMessageEventArgs.eGUIMessageKind.ModelPropertyChange,

+ 73 - 26
Dev/OHV/VehicleControlSystem/Managers/HostManager.cs

@@ -1,8 +1,4 @@
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 using GSG.NET.Logging;
 using OHV.Common.Events;
 using OHV.Common.Shareds;
@@ -28,12 +24,64 @@ namespace VehicleControlSystem.Managers
         Vehicle vehicle;
         SqliteManager sql = null;
 
-        public HostManager( IEventAggregator ea, Vehicle vehicle, SqliteManager sqlite, AutoManager autoManager )
+        public HostManager( IEventAggregator ea, Vehicle vehicle, SqliteManager sqlite, AutoManager autoManager, Scheduler scheduler )
         {
             this.eventAggregator = ea;
             this.vehicle = vehicle;
             this.vehicle.PropertyChanged += Vehicle_PropertyChanged;
             this.sql = sqlite;
+            autoManager.OnOccurAlarm += AutoManager_OnOccurAlarm;
+            autoManager.OnClearAlarm += AutoManager_OnClearAlarm;
+            scheduler.OnMaualAddedCommand += Scheduler_OnMaualAddedCommand;
+        }
+
+        private void Scheduler_OnMaualAddedCommand( Command obj )
+        {
+            var route = sql.RouteDal.GetRoute( obj.TargetID );
+            var msg = new OCSMessage()
+            {
+                Kind = eKind.P,
+                Tag = route.OCSMatchID,
+            };
+
+            switch ( obj.Type )
+            {
+                case eCommandType.Move:
+                    msg.SubCode = "001";
+                    break;
+                case eCommandType.MoveNLoad:
+                    msg.SubCode = "010";
+                    break;
+                case eCommandType.MoveNUnload:
+                    msg.SubCode = "100";
+                    break;
+                case eCommandType.Charging:
+                    msg.SubCode = "111";
+                    break;
+                default:
+                    break;
+            }
+
+            this.manager.Send( msg );
+
+        }
+
+        private void AutoManager_OnClearAlarm( int obj )
+        {
+            var msg = new OCSMessage();
+            msg.Kind = eKind.E;
+            msg.Tag = obj.ToString();
+            msg.SubCode = "100";
+            this.manager.Send( msg );
+        }
+
+        private void AutoManager_OnOccurAlarm( int obj )
+        {
+            var msg = new OCSMessage();
+            msg.Kind = eKind.E;
+            msg.Tag = obj.ToString();
+            msg.SubCode = "101";
+            this.manager.Send( msg );
         }
 
         private void Vehicle_PropertyChanged( object sender, System.ComponentModel.PropertyChangedEventArgs e )
@@ -96,10 +144,10 @@ namespace VehicleControlSystem.Managers
 
             vehicle.OnCurrentTagChanged += Vehicle_OnCurrentTagChanged;
 
-            vehicle.OnManualLoad += Vehicle_OnManualLoad;
-            vehicle.OnManualMove += Vehicle_OnManualMove;
-            vehicle.OnManualUnload += Vehicle_OnManualUnload;
-            vehicle.OnManualCharging += Vehicle_OnManualCharging;
+            //vehicle.OnManualLoad += Vehicle_OnManualLoad;
+            //vehicle.OnManualMove += Vehicle_OnManualMove;
+            //vehicle.OnManualUnload += Vehicle_OnManualUnload;
+            //vehicle.OnManualCharging += Vehicle_OnManualCharging;
 
             vehicle.OnPIOStart += Vehicle_OnPIOStart;
             vehicle.OnConveyorStart += Vehicle_OnConveyorStart;
@@ -249,25 +297,25 @@ namespace VehicleControlSystem.Managers
             this.manager.Send( msg );
         }
 
-        private void Vehicle_OnManualCharging()
-        {
-            this.Send_ManualCharging();
-        }
+        //private void Vehicle_OnManualCharging()
+        //{
+        //    this.Send_ManualCharging();
+        //}
 
-        private void Vehicle_OnManualUnload()
-        {
-            this.Send_ManualUnlaod();
-        }
+        //private void Vehicle_OnManualUnload()
+        //{
+        //    this.Send_ManualUnlaod();
+        //}
 
-        private void Vehicle_OnManualMove()
-        {
-            this.Send_ManualMove();
-        }
+        //private void Vehicle_OnManualMove()
+        //{
+        //    this.Send_ManualMove();
+        //}
 
-        private void Vehicle_OnManualLoad()
-        {
-            this.Send_ManualLoad();
-        }
+        //private void Vehicle_OnManualLoad()
+        //{
+        //    this.Send_ManualLoad();
+        //}
 
         private void Vehicle_OnCurrentTagChanged( string point )
         {
@@ -501,7 +549,6 @@ namespace VehicleControlSystem.Managers
             this.manager.Send( msg );
         }
 
-
         public void Send_Ccmd( string crossPointID )
         {
             var msg = new OCSMessage();

+ 63 - 0
Dev/OHV/VehicleControlSystem/Managers/RouteManager.cs

@@ -0,0 +1,63 @@
+using GSG.NET.FileSystem;
+using OHV.Common.Model;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net.Json;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace VehicleControlSystem.Managers
+{
+    public class RouteManager
+    {
+        public List<RoutePoint> RoutePoints { get; set; } = new List<RoutePoint>();
+        public string Path { get; set; }
+
+        public RouteManager(string path)
+        {
+            this.Path = path;
+        }
+
+        public bool LoadRoute()
+        {
+            if ( !System.IO.File.Exists( this.Path + "\\Route.json" ) ) return false;
+
+            string strReturn = System.IO.File.ReadAllText( this.Path + "\\Route.json" );
+            JsonTextParser jtr = new JsonTextParser();
+            JsonObject jo = jtr.Parse( strReturn );
+
+            JsonObjectCollection jac = (JsonObjectCollection)jo;
+
+            return true;
+        }
+
+        public bool SaveRoute()
+        {
+            if ( System.IO.File.Exists( this.Path + "\\Route.json" ) ) return false;
+
+            List<RoutePoint> ll = new List<RoutePoint>();
+            ll.Add( new RoutePoint
+            {
+                Name = "1000",
+                NextRoutes = new List<string>() { "1001" },
+                PreRoutes = new List<string>() { "1100" },
+                SegmentsID = new List<string>() { "S001"},
+                Type  = ePointType.Road
+            } );
+
+            List<RouteSegment> sll = new List<RouteSegment>();
+            sll.Add( new RouteSegment
+            {
+                From = eRoadForm.Straight,
+                Name = "S001",
+                Length = 1000,
+                MaxSpeed = 100,
+            } );
+
+
+            return true;
+        }
+
+    }
+}

+ 13 - 8
Dev/OHV/VehicleControlSystem/Managers/Scheduler.cs

@@ -34,6 +34,8 @@ namespace VehicleControlSystem.Managers
         AutoManager autoManager;
         SqliteManager sql = null;
 
+        public event Action<Command> OnMaualAddedCommand;
+
         public Scheduler( IEventAggregator ea, AutoManager autoManager, SqliteManager sqlite )
         {
             this.CommandsList = new List<Command>();
@@ -46,11 +48,16 @@ namespace VehicleControlSystem.Managers
 
         private void OnReceivedMessageEvent( VCSMessageEventArgs obj )
         {
-            var vInof = sql.VehicleInfoDAL.GetInfo();
-            if ( vInof.VehicleState == OHV.Common.Shareds.eVehicleState.Move )
-                this.sql.CommandDAL.Clean();
+            if ( obj.Kind == VCSMessageEventArgs.eVCSMessageKind.ReqAddCommand )
+            {
+                //var vInof = sql.VehicleInfoDAL.GetInfo();
+                //if ( vInof.VehicleState == OHV.Common.Shareds.eVehicleState.Move )
+                //    this.sql.CommandDAL.Clean();
 
-            this.AddCommand( obj.Command );
+                this.AddCommand( obj.Command );
+                if ( obj.Command.ByWho == OHV.Common.Shareds.eCommandByWho.LocalSystem || obj.Command.ByWho == OHV.Common.Shareds.eCommandByWho.LocalOverWrite )
+                    this.OnMaualAddedCommand?.BeginInvoke( obj.Command, null, null );
+            }
 
             //var m = new GUIMessageEventArgs() { MessageText = obj.MessageText, MessageKey = obj.MessageKey };
             //m.Command = ObjectCopyUtils.DeepClone(obj.Command);
@@ -70,10 +77,9 @@ namespace VehicleControlSystem.Managers
 
         public bool AddCommand( Command cmd )
         {
-            if ( this.CommandsList == null ) return false;
             try
             {
-                this.CommandsList.Add( cmd );
+                this.sql.CommandDAL.Add( cmd );
             }
             catch ( Exception ex )
             {
@@ -154,9 +160,8 @@ namespace VehicleControlSystem.Managers
                             case OHV.Common.Shareds.eCommandType.Move:
                             case OHV.Common.Shareds.eCommandType.MoveNLoad:
                             case OHV.Common.Shareds.eCommandType.MoveNUnload:
-                                CreateSubCommand( cmd, SubCmd.eType.Move );
-                                break;
                             case OHV.Common.Shareds.eCommandType.Charging:
+                                CreateSubCommand( cmd, SubCmd.eType.Move );
                                 break;
                             default:
                                 break;

+ 2 - 2
Dev/OHV/VehicleControlSystem/VCSystem.cs

@@ -64,7 +64,7 @@ namespace VehicleControlSystem
             this.vehicle = new Vehicle(this.IO, this.sql, this.eventAggregator, this.autoManager);
             this.vehicle.PropertyChanged += Vehicle_PropertyChanged;
 
-            this.hostManager = new HostManager(this.eventAggregator, this.vehicle, this.sql, this.autoManager);
+            this.hostManager = new HostManager(this.eventAggregator, this.vehicle, this.sql, this.autoManager, this.scheduler);
 
             this.hostManager.Init();
             this.vehicle.Init();
@@ -108,7 +108,7 @@ namespace VehicleControlSystem
         }
         #endregion
 
-        #region RspMessage Method
+        #region ReqMessage Method
         void ReceivedMessageEvent(VCSMessageEventArgs msg)
         {
             switch ( msg.Kind )

+ 15 - 1
Dev/OHV/VehicleControlSystem/VehicleControlSystem.csproj

@@ -18,7 +18,7 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>TRACE;DEBUG</DefineConstants>
+    <DefineConstants>TRACE;DEBUG;SIMULATION</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
@@ -33,6 +33,16 @@
   <PropertyGroup>
     <StartupObject />
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote|AnyCPU'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\Remote\</OutputPath>
+    <DefineConstants>TRACE;DEBUG;SIMULATION</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>
@@ -70,6 +80,9 @@
     <Reference Include="System" />
     <Reference Include="System.Configuration" />
     <Reference Include="System.Core" />
+    <Reference Include="System.Net.Json">
+      <HintPath>..\Assambly\System.Net.Json.dll</HintPath>
+    </Reference>
     <Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
       <HintPath>..\packages\System.ValueTuple.4.5.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
     </Reference>
@@ -123,6 +136,7 @@
     <Compile Include="Managers\AutoManager.cs" />
     <Compile Include="Managers\HostManager.cs" />
     <Compile Include="Managers\PhysicalCheckupLogger.cs" />
+    <Compile Include="Managers\RouteManager.cs" />
     <Compile Include="Managers\Scheduler.cs" />
     <Compile Include="VCSystem.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />