Browse Source

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

# Conflicts:
#	Dev/OHV/Assambly/OHVConnector.dll
#	Dev/OHV/Assambly/OHVConnector.pdb
#	Dev/OHV/OHV.Module.Interactivity/PopUp/DriveServoViewModel.cs
ys-hwang 6 years ago
parent
commit
e54106d507
29 changed files with 12352 additions and 74 deletions
  1. BIN
      Dev/OHV/Assambly/Newtonsoft.Json.dll
  2. BIN
      Dev/OHV/Assambly/Newtonsoft.Json.pdb
  3. 11262 0
      Dev/OHV/Assambly/Newtonsoft.Json.xml
  4. BIN
      Dev/OHV/Assambly/OHVConnector.dll
  5. BIN
      Dev/OHV/Assambly/OHVConnector.pdb
  6. 4 0
      Dev/OHV/OHV.Common/Events/MessageEventArgs.cs
  7. 42 0
      Dev/OHV/OHV.Common/Model/RouteMapModels.cs
  8. 5 0
      Dev/OHV/OHV.Common/OHV.Common.csproj
  9. 2 1
      Dev/OHV/OHV.Common/Shareds/ConstString.cs
  10. 16 0
      Dev/OHV/OHV.Module.Interactivity/PopUp/DriveServoViewModel.cs
  11. 7 0
      Dev/OHV/OHV.Module.Status/OHV.Module.Status.csproj
  12. 8 0
      Dev/OHV/OHV.SqliteDAL/OHVDbInitializer.cs
  13. 17 5
      Dev/OHV/OHV.Vehicle/OHV.Vehicle.csproj
  14. 4 4
      Dev/OHV/OHV.Vehicle/packages.config
  15. 11 0
      Dev/OHV/OHV.sln
  16. 3 8
      Dev/OHV/VehicleControlSystem/ControlLayer/DB/Redis.cs
  17. 38 38
      Dev/OHV/VehicleControlSystem/Managers/RouteManager.cs
  18. 8 8
      Dev/OHV/VehicleControlSystem/VCSystem.cs
  19. 4 5
      Dev/OHV/VehicleControlSystem/VehicleControlSystem.csproj
  20. 0 2
      Dev/OHV/VehicleControlSystem/packages.config
  21. BIN
      Dev/OHV/packages/System.Data.SQLite.1.0.112.0/.signature.p7s
  22. BIN
      Dev/OHV/packages/System.Data.SQLite.1.0.112.0/System.Data.SQLite.1.0.112.0.nupkg
  23. BIN
      Dev/OHVLoggerTest/.vs/OHVLoggerTest/v16/Server/sqlite3/storage.ide
  24. 23 2
      Dev/OHVLoggerTest/OHVLoggerTest/Form1.Designer.cs
  25. 51 1
      Dev/OHVLoggerTest/OHVLoggerTest/Form1.cs
  26. 120 0
      Dev/OHVLoggerTest/OHVLoggerTest/Form1.resx
  27. 644 0
      Dev/OHVLoggerTest/OHVLoggerTest/Json/ohv_testmap7.json
  28. 11 0
      Dev/OHVLoggerTest/OHVLoggerTest/OHVLoggerTest.csproj
  29. 72 0
      Dev/OHVLoggerTest/OHVLoggerTest/ohv_testmap7.json

BIN
Dev/OHV/Assambly/Newtonsoft.Json.dll


BIN
Dev/OHV/Assambly/Newtonsoft.Json.pdb


File diff suppressed because it is too large
+ 11262 - 0
Dev/OHV/Assambly/Newtonsoft.Json.xml


BIN
Dev/OHV/Assambly/OHVConnector.dll


BIN
Dev/OHV/Assambly/OHVConnector.pdb


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

@@ -42,6 +42,8 @@ namespace OHV.Common.Events
             RspObstaclePatternNo,
 
             RspBatteryState,
+
+            RspRouteManager,
         }
 
         //Property 이름임.
@@ -96,6 +98,8 @@ namespace OHV.Common.Events
             ReqObstaclePatternNo,
 
             ReqBatteryState,
+
+            ReqRouteManager,
         }
 
         public eVCSMessageKind Kind { get; set; }

+ 42 - 0
Dev/OHV/OHV.Common/Model/RouteMapModels.cs

@@ -0,0 +1,42 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OHV.Common.Model
+{
+    public class point
+    {
+        public int ID { get; set; }
+        public int x { get; set; }
+        public int y { get; set; }
+        public int barcode { get; set; }
+    }
+
+    public class segment
+    {
+        public int ID { get; set; }
+        public string route_type { get; set; }
+        public double speed { get; set; }
+        public int steering { get; set; }
+
+        [JsonProperty( "start" )]
+        public segmentPart Start { get; set; }
+
+        [JsonProperty( "middle" )]
+        public segmentPart Middle { get; set; }
+
+        [JsonProperty( "end" )]
+        public segmentPart End { get; set; }
+    }
+
+    public class segmentPart
+    {
+        public int pointID { get; set; }
+        public int skew { get; set; }
+        public int slope { get; set; }
+    }
+
+}

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

@@ -63,6 +63,10 @@
     <Reference Include="FluentResults">
       <HintPath>..\Assambly\FluentResults.dll</HintPath>
     </Reference>
+    <Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\Assambly\Newtonsoft.Json.dll</HintPath>
+    </Reference>
     <Reference Include="Prism, Version=7.2.0.1422, Culture=neutral, PublicKeyToken=40ee6c3a2184dc59, processorArchitecture=MSIL">
       <HintPath>..\packages\Prism.Core.7.2.0.1422\lib\net45\Prism.dll</HintPath>
     </Reference>
@@ -98,6 +102,7 @@
     <Compile Include="Model\DriveState.cs" />
     <Compile Include="Model\HisAlarm.cs" />
     <Compile Include="Model\Route.cs" />
+    <Compile Include="Model\RouteMapModels.cs" />
     <Compile Include="Model\RoutePoint.cs" />
     <Compile Include="Model\RouteSegment.cs" />
     <Compile Include="Model\SelectionItem.cs" />

+ 2 - 1
Dev/OHV/OHV.Common/Shareds/ConstString.cs

@@ -18,7 +18,8 @@ namespace OHV.Common.Shareds
         public const string PIOTimeOut = "PIO_TIMEOUT";
         public const string DriveSpeed = "DRIVE_SPEED";
         public const string FTPAddr = "FTP_ADDRESS";
-        public const string BatteryCanType = "BATTERY_CAN_TYPE";   
+        public const string BatteryCanType = "BATTERY_CAN_TYPE";
+        public const string RouteFilePath = "ROUTE_FILE_PATH";
 
         //Axis Name
         public const string AXIS_CARRIER_LOCK_LEFT = "Axis_CarrierLock_Left";

+ 16 - 0
Dev/OHV/OHV.Module.Interactivity/PopUp/DriveServoViewModel.cs

@@ -221,6 +221,11 @@ namespace OHV.Module.Interactivity.PopUp
                     }
                 }
             }
+
+            if ( obj.Kind == GUIMessageEventArgs.eGUIMessageKind.RspRouteManager )
+            {
+
+            }
         }
 
         private void ChagneVehicleState( eVehicleState v )
@@ -260,12 +265,20 @@ namespace OHV.Module.Interactivity.PopUp
                     case DriveControlEventArgs.eControlKind.STOP:
                         break;
                     case DriveControlEventArgs.eControlKind.Steering:
+<<<<<<< HEAD
                         //response 주석 처리
                         if ( args.Result.IsSuccess )
                         {
                             var dir = args.Result.ToResult<eSteeringState>().Value;
                             this.ChangeSteeringDirection( dir );
                         }
+=======
+                        //if ( args.Result.IsSuccess )
+                        //{
+                        //    var dir = args.Result.ToResult<eSteeringState>().Value;
+                        //    this.ChangeSteeringDirection( dir );
+                        //}
+>>>>>>> 5102bdb09d0f6db0d065bbce661dff3a85fda270
                         break;
                     case DriveControlEventArgs.eControlKind.SteeringState:
                         if ( args.Result.IsSuccess )
@@ -557,6 +570,9 @@ namespace OHV.Module.Interactivity.PopUp
 
                 this.eventAggregator.GetEvent<DriveControlPubSubEvent>().Publish( new DriveControlEventArgs { EventDir = DriveControlEventArgs.eEventDir.ToBack, ControlKind = DriveControlEventArgs.eControlKind.VehicleState } );
 
+                var vcsMsg = new VCSMessageEventArgs() { Kind = VCSMessageEventArgs.eVCSMessageKind.ReqRouteManager };
+                this.eventAggregator.GetEvent<VCSMessagePubSubEvent>().Publish( vcsMsg );
+
                 this.RouteList = new ObservableCollection<Route>( sql.RouteDal.All );
             } );
 

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

@@ -56,6 +56,7 @@
   <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>
+      <Private>True</Private>
     </Reference>
     <Reference Include="GSG.NET, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
@@ -63,24 +64,30 @@
     </Reference>
     <Reference Include="MaterialDesignColors, Version=1.2.2.920, Culture=neutral, processorArchitecture=MSIL">
       <HintPath>..\packages\MaterialDesignColors.1.2.2\lib\net45\MaterialDesignColors.dll</HintPath>
+      <Private>True</Private>
     </Reference>
     <Reference Include="MaterialDesignThemes.Wpf, Version=3.0.1.920, Culture=neutral, processorArchitecture=MSIL">
       <HintPath>..\packages\MaterialDesignThemes.3.0.1\lib\net45\MaterialDesignThemes.Wpf.dll</HintPath>
+      <Private>True</Private>
     </Reference>
     <Reference Include="Prism, Version=7.2.0.1422, Culture=neutral, PublicKeyToken=40ee6c3a2184dc59, processorArchitecture=MSIL">
       <HintPath>..\packages\Prism.Core.7.2.0.1422\lib\net45\Prism.dll</HintPath>
+      <Private>True</Private>
     </Reference>
     <Reference Include="Prism.Wpf, Version=7.2.0.1422, Culture=neutral, PublicKeyToken=40ee6c3a2184dc59, processorArchitecture=MSIL">
       <HintPath>..\packages\Prism.Wpf.7.2.0.1422\lib\net45\Prism.Wpf.dll</HintPath>
+      <Private>True</Private>
     </Reference>
     <Reference Include="System" />
     <Reference Include="System.Configuration" />
     <Reference Include="System.Data" />
     <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>
+      <Private>True</Private>
     </Reference>
     <Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
       <HintPath>..\packages\Prism.Wpf.7.2.0.1422\lib\net45\System.Windows.Interactivity.dll</HintPath>
+      <Private>True</Private>
     </Reference>
     <Reference Include="System.Xml" />
     <Reference Include="Microsoft.CSharp" />

+ 8 - 0
Dev/OHV/OHV.SqliteDAL/OHVDbInitializer.cs

@@ -93,6 +93,14 @@ namespace OHV.SqliteDAL
                     Desc = "Can Kind",
                     EditTime = DateTime.Now,
                 },
+                new Config
+                {
+                    ID = ConstString.RouteFilePath,
+                    Name= ConstString.RouteFilePath,
+                    Value = @"C:\OHV\mahaOHV\route_map\ohv_testmap7.json",
+                    Desc = "Route File Path",
+                    EditTime = DateTime.Now,
+                },
             } );
 
             context.Set<AxisPositionData>().AddRange( new List<AxisPositionData>()

+ 17 - 5
Dev/OHV/OHV.Vehicle/OHV.Vehicle.csproj

@@ -110,12 +110,15 @@
     </Reference>
     <Reference Include="Prism, Version=7.2.0.1422, Culture=neutral, PublicKeyToken=40ee6c3a2184dc59, processorArchitecture=MSIL">
       <HintPath>..\packages\Prism.Core.7.2.0.1422\lib\net45\Prism.dll</HintPath>
+      <Private>True</Private>
     </Reference>
     <Reference Include="Prism.Unity.Wpf, Version=7.2.0.1422, Culture=neutral, PublicKeyToken=40ee6c3a2184dc59, processorArchitecture=MSIL">
       <HintPath>..\packages\Prism.Unity.7.2.0.1422\lib\net45\Prism.Unity.Wpf.dll</HintPath>
+      <Private>True</Private>
     </Reference>
     <Reference Include="Prism.Wpf, Version=7.2.0.1422, Culture=neutral, PublicKeyToken=40ee6c3a2184dc59, processorArchitecture=MSIL">
       <HintPath>..\packages\Prism.Wpf.7.2.0.1422\lib\net45\Prism.Wpf.dll</HintPath>
+      <Private>True</Private>
     </Reference>
     <Reference Include="Quartz, Version=1.0.3.2, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
@@ -126,26 +129,33 @@
     <Reference Include="System.Configuration" />
     <Reference Include="System.Data" />
     <Reference Include="System.Data.SQLite, Version=1.0.112.1, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
-      <HintPath>..\packages\System.Data.SQLite.Core.1.0.112.1\lib\net40\System.Data.SQLite.dll</HintPath>
+      <HintPath>..\packages\System.Data.SQLite.Core.1.0.112.2\lib\net40\System.Data.SQLite.dll</HintPath>
+      <Private>True</Private>
     </Reference>
     <Reference Include="System.Data.SQLite.EF6, Version=1.0.112.1, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
-      <HintPath>..\packages\System.Data.SQLite.EF6.1.0.112.1\lib\net40\System.Data.SQLite.EF6.dll</HintPath>
+      <HintPath>..\packages\System.Data.SQLite.EF6.1.0.112.2\lib\net40\System.Data.SQLite.EF6.dll</HintPath>
+      <Private>True</Private>
     </Reference>
     <Reference Include="System.Data.SQLite.Linq, Version=1.0.112.1, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
-      <HintPath>..\packages\System.Data.SQLite.Linq.1.0.112.1\lib\net40\System.Data.SQLite.Linq.dll</HintPath>
+      <HintPath>..\packages\System.Data.SQLite.Linq.1.0.112.2\lib\net40\System.Data.SQLite.Linq.dll</HintPath>
+      <Private>True</Private>
     </Reference>
     <Reference Include="System.Management" />
     <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
       <HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
+      <Private>True</Private>
     </Reference>
     <Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
       <HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\portable-net45+win8+wp8+wpa81\System.Threading.Tasks.Extensions.dll</HintPath>
+      <Private>True</Private>
     </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>
+      <Private>True</Private>
     </Reference>
     <Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
       <HintPath>..\packages\Prism.Wpf.7.2.0.1422\lib\net45\System.Windows.Interactivity.dll</HintPath>
+      <Private>True</Private>
     </Reference>
     <Reference Include="System.Xml" />
     <Reference Include="Microsoft.CSharp" />
@@ -158,9 +168,11 @@
     </Reference>
     <Reference Include="Unity.Abstractions, Version=5.11.1.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
       <HintPath>..\packages\Unity.Abstractions.5.11.1\lib\net45\Unity.Abstractions.dll</HintPath>
+      <Private>True</Private>
     </Reference>
     <Reference Include="Unity.Container, Version=5.11.1.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
       <HintPath>..\packages\Unity.Container.5.11.1\lib\net45\Unity.Container.dll</HintPath>
+      <Private>True</Private>
     </Reference>
     <Reference Include="WindowsBase" />
     <Reference Include="PresentationCore" />
@@ -300,9 +312,9 @@ copy "$(SolutionDir)\Assambly\OHVDrive\*.*" "$(TargetDir)"</PostBuildEvent>
     <Error Condition="!Exists('..\packages\EntityFramework.6.3.0\build\EntityFramework.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.3.0\build\EntityFramework.props'))" />
     <Error Condition="!Exists('..\packages\EntityFramework.6.3.0\build\EntityFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.3.0\build\EntityFramework.targets'))" />
     <Error Condition="!Exists('..\packages\MaterialDesignThemes.3.0.1\build\MaterialDesignThemes.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MaterialDesignThemes.3.0.1\build\MaterialDesignThemes.targets'))" />
-    <Error Condition="!Exists('..\packages\System.Data.SQLite.Core.1.0.112.1\build\net40\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Data.SQLite.Core.1.0.112.1\build\net40\System.Data.SQLite.Core.targets'))" />
+    <Error Condition="!Exists('..\packages\System.Data.SQLite.Core.1.0.112.2\build\net40\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Data.SQLite.Core.1.0.112.2\build\net40\System.Data.SQLite.Core.targets'))" />
   </Target>
   <Import Project="..\packages\EntityFramework.6.3.0\build\EntityFramework.targets" Condition="Exists('..\packages\EntityFramework.6.3.0\build\EntityFramework.targets')" />
   <Import Project="..\packages\MaterialDesignThemes.3.0.1\build\MaterialDesignThemes.targets" Condition="Exists('..\packages\MaterialDesignThemes.3.0.1\build\MaterialDesignThemes.targets')" />
-  <Import Project="..\packages\System.Data.SQLite.Core.1.0.112.1\build\net40\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.112.1\build\net40\System.Data.SQLite.Core.targets')" />
+  <Import Project="..\packages\System.Data.SQLite.Core.1.0.112.2\build\net40\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.112.2\build\net40\System.Data.SQLite.Core.targets')" />
 </Project>

+ 4 - 4
Dev/OHV/OHV.Vehicle/packages.config

@@ -7,10 +7,10 @@
   <package id="Prism.Core" version="7.2.0.1422" targetFramework="net45" />
   <package id="Prism.Unity" version="7.2.0.1422" targetFramework="net45" />
   <package id="Prism.Wpf" version="7.2.0.1422" targetFramework="net45" />
-  <package id="System.Data.SQLite" version="1.0.112.0" targetFramework="net45" />
-  <package id="System.Data.SQLite.Core" version="1.0.112.1" targetFramework="net45" />
-  <package id="System.Data.SQLite.EF6" version="1.0.112.1" targetFramework="net45" />
-  <package id="System.Data.SQLite.Linq" version="1.0.112.1" targetFramework="net45" />
+  <package id="System.Data.SQLite" version="1.0.112.2" targetFramework="net45" />
+  <package id="System.Data.SQLite.Core" version="1.0.112.2" targetFramework="net45" />
+  <package id="System.Data.SQLite.EF6" version="1.0.112.2" targetFramework="net45" />
+  <package id="System.Data.SQLite.Linq" version="1.0.112.2" targetFramework="net45" />
   <package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net45" />
   <package id="System.Threading.Tasks.Extensions" version="4.5.2" targetFramework="net45" />
   <package id="System.ValueTuple" version="4.5.0" targetFramework="net45" />

+ 11 - 0
Dev/OHV/OHV.sln

@@ -43,6 +43,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OHV.Module.Status", "OHV.Mo
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OHVConnector", "..\Connection\OHVProtocolServer\OHVConnector\OHVConnector.csproj", "{B9A8B13B-518B-4AE4-B8B6-C2684DF6608A}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OHV.Module.ControlView.Modeless", "OHV.Module.ControlView.Modeless\OHV.Module.ControlView.Modeless.csproj", "{2B965366-444B-442A-9187-80DF60433192}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -163,6 +165,14 @@ Global
 		{B9A8B13B-518B-4AE4-B8B6-C2684DF6608A}.Remote1|Any CPU.Build.0 = Debug|Any CPU
 		{B9A8B13B-518B-4AE4-B8B6-C2684DF6608A}.Remote2|Any CPU.ActiveCfg = Debug|Any CPU
 		{B9A8B13B-518B-4AE4-B8B6-C2684DF6608A}.Remote2|Any CPU.Build.0 = Debug|Any CPU
+		{2B965366-444B-442A-9187-80DF60433192}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{2B965366-444B-442A-9187-80DF60433192}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{2B965366-444B-442A-9187-80DF60433192}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{2B965366-444B-442A-9187-80DF60433192}.Release|Any CPU.Build.0 = Release|Any CPU
+		{2B965366-444B-442A-9187-80DF60433192}.Remote1|Any CPU.ActiveCfg = Release|Any CPU
+		{2B965366-444B-442A-9187-80DF60433192}.Remote1|Any CPU.Build.0 = Release|Any CPU
+		{2B965366-444B-442A-9187-80DF60433192}.Remote2|Any CPU.ActiveCfg = Release|Any CPU
+		{2B965366-444B-442A-9187-80DF60433192}.Remote2|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -184,6 +194,7 @@ Global
 		{0043B4EC-A651-401C-9845-57A7C7576E28} = {6C7A1445-7F2F-46C4-9AAD-AEB739F9BD2D}
 		{D00450D6-DE54-4584-A377-7AA5D5964D2C} = {6C7A1445-7F2F-46C4-9AAD-AEB739F9BD2D}
 		{B9A8B13B-518B-4AE4-B8B6-C2684DF6608A} = {E991DE17-D541-45A9-85B0-1AA1B0D50D89}
+		{2B965366-444B-442A-9187-80DF60433192} = {6C7A1445-7F2F-46C4-9AAD-AEB739F9BD2D}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {2222F9E2-CBEF-4156-9636-5DF54ECDDA89}

+ 3 - 8
Dev/OHV/VehicleControlSystem/ControlLayer/DB/Redis.cs

@@ -2,8 +2,6 @@
 using GSG.NET.ObjectBase;
 using OHV.Common.Shareds;
 using StackExchange.Redis;
-using StackExchange.Redis.Extensions.Core;
-using StackExchange.Redis.Extensions.Newtonsoft;
 using System;
 using System.Threading;
 
@@ -11,7 +9,6 @@ namespace VehicleControlSystem.ControlLayer.DB
 {
     public class Redis : SingletonBase<Redis>, IDisposable
     {
-        StackExchangeRedisCacheClient cacheClient = null;
         ConnectionMultiplexer redisMaster = null;
         IDatabase database = null;
 
@@ -21,20 +18,18 @@ namespace VehicleControlSystem.ControlLayer.DB
 
         public void Dispose()
         {
-            this.cacheClient.Dispose();
+            this.redisMaster.Dispose();
         }
 
         public void Init()
         {
-            var serializer = new NewtonsoftSerializer();
             redisMaster = ConnectionMultiplexer.Connect( "127.0.0.1:6379" + ",allowAdmin=true,password=..." );
-            cacheClient = new StackExchangeRedisCacheClient( redisMaster, serializer );
-            database = cacheClient.Database;
+            database = redisMaster.GetDatabase();
         }
 
         public bool SetValue(string key, string val) => database.StringSet( key, val );
         public string GetValue( string key ) => database.StringGet( key );
-        public int GetIntValue( string key ) => cacheClient.Get<int>( key );
+        //public int GetIntValue( string key ) => cacheClient.Get<int>( key );
 
 
         #region GetLogData

+ 38 - 38
Dev/OHV/VehicleControlSystem/Managers/RouteManager.cs

@@ -1,9 +1,11 @@
-using GSG.NET.FileSystem;
+using Newtonsoft.Json.Linq;
 using OHV.Common.Model;
+using OHV.Common.Shareds;
+using OHV.SqliteDAL;
 using System;
 using System.Collections.Generic;
+using System.IO;
 using System.Linq;
-using System.Net.Json;
 using System.Text;
 using System.Threading.Tasks;
 
@@ -11,53 +13,51 @@ namespace VehicleControlSystem.Managers
 {
     public class RouteManager
     {
-        public List<RoutePoint> RoutePoints { get; set; } = new List<RoutePoint>();
-        public string Path { get; set; }
+        SqliteManager sql = null;
 
-        public RouteManager(string path)
-        {
-            this.Path = path;
-        }
+        public List<segment> Segments = new List<segment>();
+        public List<point> Points = new List<point>();
 
-        public bool LoadRoute()
+        public RouteManager( SqliteManager sql)
         {
-            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;
+            this.sql = sql;
 
-            return true;
+            this.LoadJson();
         }
 
-        public bool SaveRoute()
+        void LoadJson()
         {
-            if ( System.IO.File.Exists( this.Path + "\\Route.json" ) ) return false;
+            var path = sql.ConfigDal.GetK( ConstString.RouteFilePath ).Value;
+            if ( !System.IO.File.Exists( path ) )
+                return;
 
-            List<RoutePoint> ll = new List<RoutePoint>();
-            ll.Add( new RoutePoint
+            using ( StreamReader r = new StreamReader( path ) )
             {
-                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,
-            } );
-
+                string json = r.ReadToEnd();
+                var o = JObject.Parse( json );
+                this.Points = o["points"].ToObject<List<point>>();
+                this.Segments = o["segments"].ToObject<List<segment>>();
+            }
 
-            return true;
+            this.WriteToDB();
         }
 
+        /// <summary>
+        /// File 에서 읽어 와서 DB로 넣엇 사용하자 View 에서 같이 사용하기 위해
+        /// </summary>
+        void WriteToDB()
+        {
+            this.sql.RouteDal.Clean();
+
+            this.Points.ForEach( p =>
+             {
+                 Route route = new Route()
+                 {
+                     ScaleValue = p.barcode,
+                     Name = p.ID.ToString(),
+                 };
+                 sql.RouteDal.Add( route );
+             } );
+        }
     }
 }

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

@@ -1,14 +1,8 @@
 using System;
-using System.Collections.Generic;
 using System.IO;
-using System.Linq;
-using System.Text;
 using System.Threading;
-using System.Threading.Tasks;
-using GSG.NET;
 using GSG.NET.Extensions;
 using GSG.NET.Logging;
-using GSG.NET.ObjectBase;
 using GSG.NET.Quartz;
 using OHV.Common.Events;
 using OHV.Common.Model;
@@ -35,6 +29,7 @@ namespace VehicleControlSystem
         HostManager hostManager = null;
         Vehicle vehicle = null;
         SqliteManager sql = null;
+        RouteManager routeManager = null;
 
         public VCSystem(IEventAggregator ea, SqliteManager sql)
         {
@@ -74,6 +69,8 @@ namespace VehicleControlSystem
             this.vehicle.Init();
             this.scheduler.Init();
             this.autoManager.Init(this.vehicle);
+
+            this.routeManager = new RouteManager(this.sql);
         }
 
         private void Vehicle_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
@@ -361,8 +358,8 @@ namespace VehicleControlSystem
 
         private void ReqAlarmReset()
         {
-            this.autoManager.IsErrorProcessing = false;
-            this.vehicle.VehicleStateProperty = eVehicleState.Idle;
+            //this.autoManager.IsErrorProcessing = false;
+            //this.vehicle.VehicleStateProperty = eVehicleState.Idle;
 
             if ( !this.IO.IsOn( "IN_MC_ON" ) )
             {
@@ -371,6 +368,9 @@ namespace VehicleControlSystem
                 this.IO.WriteOutputIO( "OUT_SAFETY_RESET" , false );
                 Thread.Sleep( 1000 );
             }
+
+            this.autoManager.IsErrorProcessing = false;
+            this.vehicle.VehicleStateProperty = eVehicleState.Idle;
         }
 
         private void ReqEStop()

+ 4 - 5
Dev/OHV/VehicleControlSystem/VehicleControlSystem.csproj

@@ -70,8 +70,9 @@
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\Assambly\ExcelMapper\GSG.NET.Excel.dll</HintPath>
     </Reference>
-    <Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
-      <HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
+    <Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\Assambly\Newtonsoft.Json.dll</HintPath>
     </Reference>
     <Reference Include="NPOI">
       <HintPath>..\Assambly\ExcelMapper\NPOI.dll</HintPath>
@@ -89,9 +90,6 @@
     <Reference Include="StackExchange.Redis.Extensions.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=d7d863643bcd13ef, processorArchitecture=MSIL">
       <HintPath>..\packages\StackExchange.Redis.Extensions.Core.3.5.0\lib\net45\StackExchange.Redis.Extensions.Core.dll</HintPath>
     </Reference>
-    <Reference Include="StackExchange.Redis.Extensions.Newtonsoft, Version=3.5.0.0, Culture=neutral, PublicKeyToken=d7d863643bcd13ef, processorArchitecture=MSIL">
-      <HintPath>..\packages\StackExchange.Redis.Extensions.Newtonsoft.3.5.0\lib\net45\StackExchange.Redis.Extensions.Newtonsoft.dll</HintPath>
-    </Reference>
     <Reference Include="StackExchange.Redis.StrongName, Version=1.2.6.0, Culture=neutral, PublicKeyToken=c219ff1ca8c2ce46, processorArchitecture=MSIL">
       <HintPath>..\packages\StackExchange.Redis.StrongName.1.2.6\lib\net45\StackExchange.Redis.StrongName.dll</HintPath>
     </Reference>
@@ -158,6 +156,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" />

+ 0 - 2
Dev/OHV/VehicleControlSystem/packages.config

@@ -2,11 +2,9 @@
 <packages>
   <package id="CommonServiceLocator" version="2.0.4" targetFramework="net45" />
   <package id="FluentFTP" version="32.2.2" targetFramework="net45" />
-  <package id="Newtonsoft.Json" version="11.0.2" targetFramework="net45" />
   <package id="Prism.Core" version="7.2.0.1422" targetFramework="net45" />
   <package id="Prism.Wpf" version="7.2.0.1422" targetFramework="net45" />
   <package id="StackExchange.Redis.Extensions.Core" version="3.5.0" targetFramework="net45" />
-  <package id="StackExchange.Redis.Extensions.Newtonsoft" version="3.5.0" targetFramework="net45" />
   <package id="StackExchange.Redis.StrongName" version="1.2.6" targetFramework="net45" />
   <package id="System.ValueTuple" version="4.5.0" targetFramework="net45" />
 </packages>

BIN
Dev/OHV/packages/System.Data.SQLite.1.0.112.0/.signature.p7s


BIN
Dev/OHV/packages/System.Data.SQLite.1.0.112.0/System.Data.SQLite.1.0.112.0.nupkg


BIN
Dev/OHVLoggerTest/.vs/OHVLoggerTest/v16/Server/sqlite3/storage.ide


+ 23 - 2
Dev/OHVLoggerTest/OHVLoggerTest/Form1.Designer.cs

@@ -28,13 +28,34 @@
         /// </summary>
         private void InitializeComponent()
         {
-            this.components = new System.ComponentModel.Container();
+            this.button1 = new System.Windows.Forms.Button();
+            this.SuspendLayout();
+            // 
+            // button1
+            // 
+            this.button1.Location = new System.Drawing.Point(34, 22);
+            this.button1.Name = "button1";
+            this.button1.Size = new System.Drawing.Size(132, 49);
+            this.button1.TabIndex = 0;
+            this.button1.Text = "button1";
+            this.button1.UseVisualStyleBackColor = true;
+            this.button1.Click += new System.EventHandler(this.button1_Click);
+            // 
+            // Form1
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size( 800, 450 );
+            this.ClientSize = new System.Drawing.Size(800, 450);
+            this.Controls.Add(this.button1);
+            this.Name = "Form1";
             this.Text = "Form1";
+            this.ResumeLayout(false);
+
         }
 
         #endregion
+
+        private System.Windows.Forms.Button button1;
     }
 }
 

+ 51 - 1
Dev/OHVLoggerTest/OHVLoggerTest/Form1.cs

@@ -3,12 +3,15 @@ using System.Collections.Generic;
 using System.ComponentModel;
 using System.Data;
 using System.Drawing;
+using System.IO;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Forms;
 using GSG.NET.Concurrent;
 using GSG.NET.Logging;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
 
 namespace OHVLoggerTest
 {
@@ -39,7 +42,6 @@ namespace OHVLoggerTest
         private void Form1_Load( object sender, EventArgs e )
         {
             Redis.Instance.Init();
-            plc.Connecte();
 
             this.threadCancel.AddGo( Thread_Dowork );
         }
@@ -57,5 +59,53 @@ namespace OHVLoggerTest
                 }
             }
         }
+
+        private void button1_Click( object sender, EventArgs e )
+        {
+            if ( !System.IO.File.Exists( Application.StartupPath + @"\Json\ohv_testmap7.json" ) )
+                return;
+
+            using ( StreamReader r = new StreamReader( Application.StartupPath + @"\Json\ohv_testmap7.json" ) )
+            {
+                string json = r.ReadToEnd();
+                var o = JObject.Parse( json );
+
+                var ll = JsonConvert.DeserializeObject<JObject>( json );
+                var pll = o["points"].ToObject<List<point>>();
+                var sll = o["segments"].ToObject<List<segment>>();
+            }
+        }
+    }
+
+    public class point
+    {
+        public int ID { get; set; }
+        public int x { get; set; }
+        public int y { get; set; }
+        public int barcode { get; set; }
+    }
+
+    public class segment
+    {
+        public int ID { get; set; }
+        public string route_type { get; set; }
+        public double speed { get; set; }
+        public int steering { get; set; }
+
+        [JsonProperty( "start" )]
+        public segmentPart Start { get; set; }
+
+        [JsonProperty( "middle" )]
+        public segmentPart Middle { get; set; }
+
+        [JsonProperty( "end" )]
+        public segmentPart End { get; set; }
+    }
+
+    public class segmentPart
+    {
+        public int pointID { get; set; }
+        public int skew { get; set; }
+        public int slope { get; set; }
     }
 }

+ 120 - 0
Dev/OHVLoggerTest/OHVLoggerTest/Form1.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 644 - 0
Dev/OHVLoggerTest/OHVLoggerTest/Json/ohv_testmap7.json

@@ -0,0 +1,644 @@
+{
+    "name" : "ohv_testmap6",
+  "points": 
+  [
+    {
+      "ID": 0,
+      "x": 7820,
+      "y": 0,
+      "barcode": 2163123
+    },
+    {
+      "ID": 1,
+      "x": 37820,
+      "y": 0,
+      "barcode": 2133179
+    },
+    {
+      "ID": 2,
+      "x": 48336,
+      "y": 0,
+      "barcode": 2122607
+    },
+    {
+      "ID": 3,
+      "x": 106400,
+      "y": 0,
+      "barcode": 2064839
+    },
+    {
+      "ID": 4,
+      "x": 108580,
+      "y": 0,
+      "barcode": 2062659
+    },
+    {
+      "ID": 5,
+      "x": 170315,
+      "y": 0,
+      "barcode": 2000924
+    },
+    {
+      "ID": 6,
+      "x": 171175,
+      "y": 0,
+      "barcode": 2000064
+    },
+
+    {
+      "ID": 7,
+      "x": 175580,
+      "y": 16100,
+      "barcode": 1163261
+    },
+    {
+      "ID": 8,
+      "x": 163273,
+      "y": 16100,
+      "barcode": 1152011
+    },
+    {
+      "ID": 9,
+      "x": 151625,
+      "y": 16100,
+      "barcode": 1140363
+    },
+    {
+      "ID": 10,
+      "x": 108580,
+      "y": 16100,
+      "barcode": 1097318
+    },
+    {
+      "ID": 11,
+      "x": 97273,
+      "y": 16100,
+      "barcode": 1086130
+    },
+    {
+      "ID": 12,
+      "x": 84417,
+      "y": 16100,
+      "barcode": 1073274
+    },
+    {
+      "ID": 13,
+      "x": 63477,
+      "y": 16100,
+      "barcode": 1052334
+    },
+    {
+      "ID": 14,
+      "x": 50587,
+      "y": 16100,
+      "barcode": 1039444
+    },
+    {
+      "ID": 15,
+      "x": 40000,
+      "y": 16100,
+      "barcode": 1028857
+    },
+    {
+      "ID": 16,
+      "x": 37820,
+      "y": 16100,
+      "barcode": 1026677
+    },
+    {
+      "ID": 17,
+      "x": 16576,
+      "y": 16100,
+      "barcode": 1005433
+    },
+    {
+      "ID": 18,
+      "x": 11992,
+      "y": 16100,
+      "barcode": 1000849
+    },
+    {
+      "ID": 19,
+      "x": 10944,
+      "y": 16100,
+      "barcode": 999801
+    },
+
+    {
+      "ID": 20,
+      "x": 12000,
+      "y": 0,
+      "barcode": 2158943
+    },
+    {
+      "ID": 21,
+      "x": 22820,
+      "y": 0,
+      "barcode": 2148123
+    },
+    {
+      "ID": 22,
+      "x": 42000,
+      "y": 0,
+      "barcode": 2128999
+    },
+    {
+      "ID": 23,
+      "x": 128400,
+      "y": 0,
+      "barcode": 2042839
+    },
+    {
+      "ID": 24,
+      "x": 171400,
+      "y": 16100,
+      "barcode": 1159081
+    },
+    {
+      "ID": 25,
+      "x": 125400,
+      "y": 16100,
+      "barcode": 1114138
+    },
+    {
+      "ID": 26,
+      "x": 106400,
+      "y": 16100,
+      "barcode": 1095138
+    },
+    {
+      "ID": 27,
+      "x": 18000,
+      "y": 16100,
+      "barcode": 1006857
+    },
+
+    {
+      "ID": 28,
+      "x": 20410,
+      "y": 0,
+      "barcode": 2150533
+    }
+  ],
+
+  "segments": 
+  [
+    {
+      "ID": 0,
+      "route_type": "ohcurve",
+      "speed": 0.3,
+      "steering": -12,
+      "start": {
+        "pointID": 0,
+        "skew": 0,
+        "slope": 18000
+      },
+      "middle": {
+        "pointID": 19,
+        "skew": 0,
+        "slope": 0
+      },
+      "end": {
+        "pointID": 18,
+        "skew": 0,
+        "slope": 0
+      }
+    },
+
+    {
+      "ID": 1,
+      "route_type": "line",
+      "speed": 2.5,
+      "steering": -12,
+      "start": {
+        "pointID": 20,
+        "skew": 0,
+        "slope": 18000
+      },
+      "end": {
+        "pointID": 0,
+        "skew": 0,
+        "slope": 18000
+      }
+    },
+    {
+      "ID": 2,
+      "route_type": "line",
+      "speed": 0.4,
+      "steering": -2,
+      "start": {
+        "pointID": 28,
+        "skew": 0,
+        "slope": 18000
+      },
+      "end": {
+        "pointID": 20,
+        "skew": 0,
+        "slope": 18000
+      }
+    },
+    {
+      "ID": 3,
+      "route_type": "line",
+      "speed": 2.5,
+      "steering": -11,
+      "start": {
+        "pointID": 1,
+        "skew": 0,
+        "slope": 18000
+      },
+      "end": {
+        "pointID": 21,
+        "skew": 0,
+        "slope": 18000
+      }
+    },
+    {
+      "ID": 4,
+      "route_type": "line",
+      "speed": 0.5,
+      "steering": 0,
+      "start": {
+        "pointID": 22,
+        "skew": 0,
+        "slope": 18000
+      },
+      "end": {
+        "pointID": 1,
+        "skew": 0,
+        "slope": 18000
+      }
+    },
+    {
+      "ID": 5,
+      "route_type": "line",
+      "speed": 2.5,
+      "steering": 2,
+      "start": {
+        "pointID": 2,
+        "skew": 0,
+        "slope": 18000
+      },
+      "end": {
+        "pointID": 22,
+        "skew": 0,
+        "slope": 18000
+      }
+    },
+    {
+      "ID": 6,
+      "route_type": "line",
+      "speed": 2.5,
+      "steering": 3,
+      "start": {
+        "pointID": 3,
+        "skew": 0,
+        "slope": 18000
+      },
+      "end": {
+        "pointID": 2,
+        "skew": 0,
+        "slope": 18000
+      }
+    },
+    {
+      "ID": 7,
+      "route_type": "line",
+      "speed": 2.5,
+      "steering": -11,
+      "start": {
+        "pointID": 23,
+        "skew": 0,
+        "slope": 18000
+      },
+      "end": {
+        "pointID": 3,
+        "skew": 0,
+        "slope": 18000
+      }
+    },
+    {
+      "ID": 8,
+      "route_type": "line",
+      "speed": 2.5,
+      "steering": -1,
+      "start": {
+        "pointID": 5,
+        "skew": 0,
+        "slope": 18000
+      },
+      "end": {
+        "pointID": 23,
+        "skew": 0,
+        "slope": 18000
+      }
+    },
+
+    {
+      "ID": 9,
+      "route_type": "ohcurve",
+      "speed": 0.5,
+      "steering": -12,
+      "start": {
+        "pointID": 7,
+        "skew": 0,
+        "slope": 18000
+      },
+      "middle": {
+        "pointID": 6,
+        "skew": 0,
+        "slope": 18000
+      },
+      "end": {
+        "pointID": 5,
+        "skew": 0,
+        "slope": 18000
+      }
+    },
+
+    {
+      "ID": 10,
+      "route_type": "line",
+      "speed": 0.5,
+      "steering": -12,
+      "start": {
+        "pointID": 24,
+        "skew": 0,
+        "slope": 0
+      },
+      "end": {
+        "pointID": 7,
+        "skew": 0,
+        "slope": 0
+      }
+    },
+    {
+      "ID": 11,
+      "route_type": "line",
+      "speed": 2.5,
+      "steering": -2,
+      "start": {
+        "pointID": 8,
+        "skew": 0,
+        "slope": 0
+      },
+      "end": {
+        "pointID": 24,
+        "skew": 0,
+        "slope": 0
+      }
+    },
+    {
+      "ID": 12,
+      "route_type": "line",
+      "speed": 2.5,
+      "steering": -2,
+      "start": {
+        "pointID": 9,
+        "skew": 0,
+        "slope": 0
+      },
+      "end": {
+        "pointID": 8,
+        "skew": 0,
+        "slope": 0
+      }
+    },
+    {
+      "ID": 13,
+      "route_type": "line",
+      "speed": 2.5,
+      "steering": 0,
+      "start": {
+        "pointID": 25,
+        "skew": 0,
+        "slope": 0
+      },
+      "end": {
+        "pointID": 9,
+        "skew": 0,
+        "slope": 0
+      }
+    },
+    {
+      "ID": 14,
+      "route_type": "line",
+      "speed": 2.5,
+      "steering": -11,
+      "start": {
+        "pointID": 10,
+        "skew": 0,
+        "slope": 0
+      },
+      "end": {
+        "pointID": 25,
+        "skew": 0,
+        "slope": 0
+      }
+    },
+    {
+      "ID": 15,
+      "route_type": "line",
+      "speed": 0.5,
+      "steering": 0,
+      "start": {
+        "pointID": 26,
+        "skew": 0,
+        "slope": 0
+      },
+      "end": {
+        "pointID": 10,
+        "skew": 0,
+        "slope": 0
+      }
+    },
+    {
+      "ID": 16,
+      "route_type": "line",
+      "speed": 2.5,
+      "steering": 2,
+      "start": {
+        "pointID": 11,
+        "skew": 0,
+        "slope": 0
+      },
+      "end": {
+        "pointID": 26,
+        "skew": 0,
+        "slope": 0
+      }
+    },
+    {
+      "ID": 17,
+      "route_type": "line",
+      "speed": 2.5,
+      "steering": 3,
+      "start": {
+        "pointID": 12,
+        "skew": 0,
+        "slope": 0
+      },
+      "end": {
+        "pointID": 11,
+        "skew": 0,
+        "slope": 0
+      }
+    },
+    {
+      "ID": 18,
+      "route_type": "line",
+      "speed": 2.5,
+      "steering": 4,
+      "start": {
+        "pointID": 13,
+        "skew": 0,
+        "slope": 0
+      },
+      "end": {
+        "pointID": 12,
+        "skew": 0,
+        "slope": 0
+      }
+    },
+    {
+      "ID": 19,
+      "route_type": "line",
+      "speed": 2.5,
+      "steering": 5,
+      "start": {
+        "pointID": 14,
+        "skew": 0,
+        "slope": 0
+      },
+      "end": {
+        "pointID": 13,
+        "skew": 0,
+        "slope": 0
+      }
+    },
+    {
+      "ID": 20,
+      "route_type": "line",
+      "speed": 2.5,
+      "steering": 0,
+      "start": {
+        "pointID": 15,
+        "skew": 0,
+        "slope": 0
+      },
+      "end": {
+        "pointID": 14,
+        "skew": 0,
+        "slope": 0
+      }
+    },
+    {
+      "ID": 21,
+      "route_type": "line",
+      "speed": 2.5,
+      "steering": -11,
+      "start": {
+        "pointID": 27,
+        "skew": 0,
+        "slope": 0
+      },
+      "end": {
+        "pointID": 15,
+        "skew": 0,
+        "slope": 0
+      }
+    },
+    {
+      "ID": 22,
+      "route_type": "line",
+      "speed": 2.5,
+      "steering": -1,
+      "start": {
+        "pointID": 17,
+        "skew": 0,
+        "slope": 0
+      },
+      "end": {
+        "pointID": 27,
+        "skew": 0,
+        "slope": 0
+      }
+    },
+    {
+      "ID": 23,
+      "route_type": "line",
+      "speed": 2.5,
+      "steering": -1,
+      "start": {
+        "pointID": 18,
+        "skew": 0,
+        "slope": 0
+      },
+      "end": {
+        "pointID": 17,
+        "skew": 0,
+        "slope": 0
+      }
+    },
+
+    {
+      "ID": 24,
+      "route_type": "ohcurve",
+      "speed": 0.5,
+      "steering": -12,
+      "start": {
+        "pointID": 1,
+        "skew": 0,
+        "slope": 18000
+      },
+      "middle": {
+        "pointID": 16,
+        "skew": 0,
+        "slope": 0
+      },
+      "end": {
+        "pointID": 15,
+        "skew": 0,
+        "slope": 0
+      }
+    },
+
+    {
+      "ID": 25,
+      "route_type": "ohcurve",
+      "speed": 0.5,
+      "steering": -12,
+      "start": {
+        "pointID": 10,
+        "skew": 0,
+        "slope": 0
+      },
+      "middle": {
+        "pointID": 4,
+        "skew": 0,
+        "slope": 18000
+      },
+      "end": {
+        "pointID": 3,
+        "skew": 0,
+        "slope": 18000
+      }
+    },
+    {
+      "ID": 26,
+      "route_type": "line",
+      "speed": 0.4,
+      "steering": -2,
+      "start": {
+        "pointID": 21,
+        "skew": 0,
+        "slope": 18000
+      },
+      "end": {
+        "pointID": 28,
+        "skew": 0,
+        "slope": 18000
+      }
+    }
+  ]
+}

+ 11 - 0
Dev/OHVLoggerTest/OHVLoggerTest/OHVLoggerTest.csproj

@@ -41,6 +41,10 @@
     <Reference Include="log4net">
       <HintPath>..\..\OHV\Assambly\log4net.dll</HintPath>
     </Reference>
+    <Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\OHV\Assambly\Newtonsoft.Json.dll</HintPath>
+    </Reference>
     <Reference Include="Quartz">
       <HintPath>..\..\OHV\Assambly\Quartz.dll</HintPath>
     </Reference>
@@ -74,6 +78,9 @@
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="Redis.cs" />
+    <EmbeddedResource Include="Form1.resx">
+      <DependentUpon>Form1.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="Properties\Resources.resx">
       <Generator>ResXFileCodeGenerator</Generator>
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>
@@ -83,6 +90,9 @@
       <AutoGen>True</AutoGen>
       <DependentUpon>Resources.resx</DependentUpon>
     </Compile>
+    <None Include="Json\ohv_testmap7.json">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
     <None Include="packages.config" />
     <None Include="Properties\Settings.settings">
       <Generator>SettingsSingleFileGenerator</Generator>
@@ -102,5 +112,6 @@
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
   </ItemGroup>
+  <ItemGroup />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 </Project>

+ 72 - 0
Dev/OHVLoggerTest/OHVLoggerTest/ohv_testmap7.json

@@ -0,0 +1,72 @@
+{
+    "name" : "ohv_testmap6",
+    "points" : [
+        { "ID" : 0,  "x" :   7820, "y" :     0, "barcode" : 2163123},
+        { "ID" : 1,  "x" :  37820, "y" :     0, "barcode" : 2133179},
+        { "ID" : 2,  "x" :  48336, "y" :     0, "barcode" : 2122607},
+        { "ID" : 3,  "x" : 106400, "y" :     0, "barcode" : 2064839},
+        { "ID" : 4,  "x" : 108580, "y" :     0, "barcode" : 2062659},
+        { "ID" : 5,  "x" : 170315, "y" :     0, "barcode" : 2000924},
+        { "ID" : 6, "x" :  171175, "y" :     0, "barcode" : 2000064},
+
+        { "ID" : 7, "x" :  175580, "y" : 16100, "barcode" : 1163261},
+        { "ID" : 8, "x" :  163273, "y" : 16100, "barcode" : 1152011},
+        { "ID" : 9, "x" :  151625, "y" : 16100, "barcode" : 1140363},
+        { "ID" : 10, "x" : 108580, "y" : 16100, "barcode" : 1097318},
+        { "ID" : 11, "x" :  97273, "y" : 16100, "barcode" : 1086130},
+        { "ID" : 12, "x" :  84417, "y" : 16100, "barcode" : 1073274},
+        { "ID" : 13, "x" :  63477, "y" : 16100, "barcode" : 1052334},
+        { "ID" : 14, "x" :  50587, "y" : 16100, "barcode" : 1039444},
+        { "ID" : 15, "x" :  40000, "y" : 16100, "barcode" : 1028857},
+        { "ID" : 16, "x" :  37820, "y" : 16100, "barcode" : 1026677},
+        { "ID" : 17, "x" :  16576, "y" : 16100, "barcode" : 1005433},
+        { "ID" : 18, "x" :  11992, "y" : 16100, "barcode" : 1000849},
+        { "ID" : 19, "x" :  10944, "y" : 16100, "barcode" :  999801},
+
+        { "ID" : 20, "x" :  12000, "y" :     0, "barcode" : 2158943},
+        { "ID" : 21, "x" :  22820, "y" :     0, "barcode" : 2148123},
+        { "ID" : 22, "x" :  42000, "y" :     0, "barcode" : 2128999},
+        { "ID" : 23, "x" : 128400, "y" :     0, "barcode" : 2042839},
+        { "ID" : 24, "x" : 171400, "y" : 16100, "barcode" : 1159081},
+        { "ID" : 25, "x" : 125400, "y" : 16100, "barcode" : 1114138},
+        { "ID" : 26, "x" : 106400, "y" : 16100, "barcode" : 1095138},
+        { "ID" : 27, "x" :  18000, "y" : 16100, "barcode" : 1006857},
+
+        { "ID" : 28, "x" :  20410, "y" :     0, "barcode" : 2150533}
+    ],
+
+    "segments" : [
+        { "ID" : 0, "route_type" : "ohcurve", "speed" : 0.3, "steering" : -12, "start" : { "pointID" : 0, "skew" : 0, "slope" :  18000}, "middle" : {"pointID" : 19, "skew" : 0, "slope" : 0}, "end" : { "pointID" : 18, "skew" : 0, "slope" : 0 } },
+
+        { "ID" :  1, "route_type" : "line", "speed" : 2.5, "steering" : -12, "start" : { "pointID" : 20, "skew" : 0, "slope" : 18000}, "end" : { "pointID" : 0, "skew" : 0, "slope" : 18000} },
+        { "ID" :  2, "route_type" : "line", "speed" : 0.4, "steering" : -2, "start" : { "pointID" : 28, "skew" : 0, "slope" : 18000}, "end" : { "pointID" : 20, "skew" : 0, "slope" : 18000} },
+        { "ID" :  3, "route_type" : "line", "speed" : 2.5, "steering" : -11, "start" : { "pointID" : 1, "skew" : 0, "slope" : 18000}, "end" : { "pointID" : 21, "skew" : 0, "slope" : 18000} },
+        { "ID" :  4, "route_type" : "line", "speed" : 0.5, "steering" : 0, "start" : { "pointID" : 22, "skew" : 0, "slope" : 18000}, "end" : { "pointID" : 1, "skew" : 0, "slope" : 18000} },
+        { "ID" :  5, "route_type" : "line", "speed" : 2.5, "steering" : 2, "start" : { "pointID" : 2, "skew" : 0, "slope" : 18000}, "end" : { "pointID" : 22, "skew" : 0, "slope" : 18000} },
+        { "ID" :  6, "route_type" : "line", "speed" : 2.5, "steering" : 3, "start" : { "pointID" : 3, "skew" : 0, "slope" : 18000}, "end" : { "pointID" : 2, "skew" : 0, "slope" : 18000} },
+        { "ID" :  7, "route_type" : "line", "speed" : 2.5, "steering" : -11, "start" : { "pointID" : 23, "skew" : 0, "slope" : 18000}, "end" : { "pointID" : 3, "skew" : 0, "slope" : 18000} },
+        { "ID" :  8, "route_type" : "line", "speed" : 2.5, "steering" : -1, "start" : { "pointID" : 5, "skew" : 0, "slope" : 18000}, "end" : { "pointID" : 23, "skew" : 0, "slope" : 18000} },
+
+        { "ID" : 9, "route_type" : "ohcurve", "speed" : 0.5, "steering" : -12, "start" : { "pointID" : 7, "skew" : 0, "slope" :  18000}, "middle" : { "pointID" : 6, "skew" : 0, "slope" : 18000 },"end" : { "pointID" : 5, "skew" : 0, "slope" : 18000 } },
+
+        { "ID" :  10, "route_type" : "line", "speed" : 0.5, "steering" : -12, "start" : { "pointID" : 24, "skew" : 0, "slope" : 0}, "end" : { "pointID" : 7, "skew" : 0, "slope" : 0} },
+        { "ID" :  11, "route_type" : "line", "speed" : 2.5, "steering" : -2, "start" : { "pointID" : 8, "skew" : 0, "slope" : 0}, "end" : { "pointID" : 24, "skew" : 0, "slope" : 0} },
+        { "ID" :  12, "route_type" : "line", "speed" : 2.5, "steering" : -2, "start" : { "pointID" : 9, "skew" : 0, "slope" : 0}, "end" : { "pointID" : 8, "skew" : 0, "slope" : 0} },
+        { "ID" :  13, "route_type" : "line", "speed" : 2.5, "steering" : 0, "start" : { "pointID" : 25, "skew" : 0, "slope" : 0}, "end" : { "pointID" : 9, "skew" : 0, "slope" : 0} },
+        { "ID" :  14, "route_type" : "line", "speed" : 2.5, "steering" : -11, "start" : { "pointID" : 10, "skew" : 0, "slope" : 0}, "end" : { "pointID" : 25, "skew" : 0, "slope" : 0} },
+        { "ID" :  15, "route_type" : "line", "speed" : 0.5, "steering" : 0, "start" : { "pointID" : 26, "skew" : 0, "slope" : 0}, "end" : { "pointID" : 10, "skew" : 0, "slope" : 0} },
+        { "ID" :  16, "route_type" : "line", "speed" : 2.5, "steering" : 2, "start" : { "pointID" : 11, "skew" : 0, "slope" : 0}, "end" : { "pointID" : 26, "skew" : 0, "slope" : 0} },
+        { "ID" :  17, "route_type" : "line", "speed" : 2.5, "steering" : 3, "start" : { "pointID" : 12, "skew" : 0, "slope" : 0}, "end" : { "pointID" : 11, "skew" : 0, "slope" : 0} },
+        { "ID" :  18, "route_type" : "line", "speed" : 2.5, "steering" : 4, "start" : { "pointID" : 13, "skew" : 0, "slope" : 0}, "end" : { "pointID" : 12, "skew" : 0, "slope" : 0} },
+        { "ID" :  19, "route_type" : "line", "speed" : 2.5, "steering" : 5, "start" : { "pointID" : 14, "skew" : 0, "slope" : 0}, "end" : { "pointID" : 13, "skew" : 0, "slope" : 0} },
+        { "ID" :  20, "route_type" : "line", "speed" : 2.5, "steering" : 0, "start" : { "pointID" : 15, "skew" : 0, "slope" : 0}, "end" : { "pointID" : 14, "skew" : 0, "slope" : 0} },
+        { "ID" :  21, "route_type" : "line", "speed" : 2.5, "steering" : -11, "start" : { "pointID" : 27, "skew" : 0, "slope" : 0}, "end" : { "pointID" : 15, "skew" : 0, "slope" : 0} },
+        { "ID" :  22, "route_type" : "line", "speed" : 2.5, "steering" : -1, "start" : { "pointID" : 17, "skew" : 0, "slope" : 0}, "end" : { "pointID" : 27, "skew" : 0, "slope" : 0} },
+        { "ID" :  23, "route_type" : "line", "speed" : 2.5, "steering" : -1, "start" : { "pointID" : 18, "skew" : 0, "slope" : 0}, "end" : { "pointID" : 17, "skew" : 0, "slope" : 0} },
+
+        { "ID" : 24, "route_type" : "ohcurve", "speed" : 0.5, "steering" : -12, "start" : { "pointID" : 1, "skew" : 0, "slope" :  18000}, "middle" : { "pointID" : 16, "skew" : 0, "slope" : 0 },"end" : { "pointID" : 15, "skew" : 0, "slope" : 0 } },
+        
+        { "ID" : 25, "route_type" : "ohcurve", "speed" : 0.5, "steering" : -12, "start" : { "pointID" : 10, "skew" : 0, "slope" :  0}, "middle" : { "pointID" : 4, "skew" : 0, "slope" : 18000 },"end" : { "pointID" : 3, "skew" : 0, "slope" : 18000 } },
+        { "ID" :  26, "route_type" : "line", "speed" : 0.4, "steering" : -2, "start" : { "pointID" : 21, "skew" : 0, "slope" : 18000}, "end" : { "pointID" : 28, "skew" : 0, "slope" : 18000} }
+    ]
+}