Browse Source

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

ys-hwang 6 years ago
parent
commit
15afd768da
25 changed files with 1073 additions and 14 deletions
  1. 13 4
      Dev/OHV/OHV.Common/Model/DriveState.cs
  2. 12 0
      Dev/OHV/OHV.Module.ControlView.Modeless/Class1.cs
  3. 54 0
      Dev/OHV/OHV.Module.ControlView.Modeless/OHV.Module.ControlView.Modeless.csproj
  4. 36 0
      Dev/OHV/OHV.Module.ControlView.Modeless/Properties/AssemblyInfo.cs
  5. 5 3
      Dev/OHV/VehicleControlSystem/ControlLayer/Conveyor.cs
  6. 36 0
      Dev/OHV/VehicleControlSystem/ControlLayer/Motion/GSIDrive.cs
  7. 34 6
      Dev/OHV/VehicleControlSystem/ControlLayer/Vehicle.cs
  8. 8 1
      Dev/OHV/VehicleControlSystem/Managers/PhysicalCheckupLogger.cs
  9. 0 0
      Dev/OHVLoggerTest/.vs/OHVLoggerTest/v16/Server/sqlite3/db.lock
  10. BIN
      Dev/OHVLoggerTest/.vs/OHVLoggerTest/v16/Server/sqlite3/storage.ide
  11. 25 0
      Dev/OHVLoggerTest/OHVLoggerTest.sln
  12. 6 0
      Dev/OHVLoggerTest/OHVLoggerTest/App.config
  13. 106 0
      Dev/OHVLoggerTest/OHVLoggerTest/Config/log4net.xml
  14. 40 0
      Dev/OHVLoggerTest/OHVLoggerTest/Form1.Designer.cs
  15. 61 0
      Dev/OHVLoggerTest/OHVLoggerTest/Form1.cs
  16. 105 0
      Dev/OHVLoggerTest/OHVLoggerTest/KV8000.cs
  17. 106 0
      Dev/OHVLoggerTest/OHVLoggerTest/OHVLoggerTest.csproj
  18. 46 0
      Dev/OHVLoggerTest/OHVLoggerTest/Program.cs
  19. 36 0
      Dev/OHVLoggerTest/OHVLoggerTest/Properties/AssemblyInfo.cs
  20. 71 0
      Dev/OHVLoggerTest/OHVLoggerTest/Properties/Resources.Designer.cs
  21. 117 0
      Dev/OHVLoggerTest/OHVLoggerTest/Properties/Resources.resx
  22. 30 0
      Dev/OHVLoggerTest/OHVLoggerTest/Properties/Settings.Designer.cs
  23. 7 0
      Dev/OHVLoggerTest/OHVLoggerTest/Properties/Settings.settings
  24. 114 0
      Dev/OHVLoggerTest/OHVLoggerTest/Redis.cs
  25. 5 0
      Dev/OHVLoggerTest/OHVLoggerTest/packages.config

+ 13 - 4
Dev/OHV/OHV.Common/Model/DriveState.cs

@@ -9,9 +9,18 @@ namespace OHV.Common.Model
     public class DriveState
     {
         public string DirveName { get; set; }
-        public int Speed { get; set; }
-        public int Torque { get; set; }
-        public int Rpm { get; set; }
-        public int Loadage { get; set; }
+        public double Speed { get; set; }
+        public double Torque { get; set; }
+        public double Rpm { get; set; }
+        public double Loadage { get; set; }
+
+        public DriveState()
+        {
+            this.DirveName = string.Empty;
+            this.Speed = 0.0;
+            this.Torque = 0.0;
+            this.Rpm = 0.0;
+            this.Loadage = 0.0;
+        }
     }
 }

+ 12 - 0
Dev/OHV/OHV.Module.ControlView.Modeless/Class1.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OHV.Module.ControlView.Modeless
+{
+    public class Class1
+    {
+    }
+}

+ 54 - 0
Dev/OHV/OHV.Module.ControlView.Modeless/OHV.Module.ControlView.Modeless.csproj

@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>2b965366-444b-442a-9187-80df60433192</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>OHV.Module.ControlView.Modeless</RootNamespace>
+    <AssemblyName>OHV.Module.ControlView.Modeless</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <Deterministic>true</Deterministic>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System"/>
+    
+    <Reference Include="System.Core"/>
+    <Reference Include="System.Xml.Linq"/>
+    <Reference Include="System.Data.DataSetExtensions"/>
+    
+    
+    <Reference Include="Microsoft.CSharp"/>
+    
+    <Reference Include="System.Data"/>
+    
+    <Reference Include="System.Net.Http"/>
+    
+    <Reference Include="System.Xml"/>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Class1.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ </Project>

+ 36 - 0
Dev/OHV/OHV.Module.ControlView.Modeless/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해 
+// 제어됩니다. 어셈블리와 관련된 정보를 수정하려면
+// 이러한 특성 값을 변경하세요.
+[assembly: AssemblyTitle("OHV.Module.ControlView.Modeless")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("OHV.Module.ControlView.Modeless")]
+[assembly: AssemblyCopyright("Copyright ©  2020")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에 
+// 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면
+// 해당 형식에 대해 ComVisible 특성을 true로 설정하세요.
+[assembly: ComVisible(false)]
+
+// 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다.
+[assembly: Guid("2b965366-444b-442a-9187-80df60433192")]
+
+// 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다.
+//
+//      주 버전
+//      부 버전 
+//      빌드 번호
+//      수정 버전
+//
+// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를
+// 기본값으로 할 수 있습니다.
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 5 - 3
Dev/OHV/VehicleControlSystem/ControlLayer/Conveyor.cs

@@ -17,6 +17,8 @@ namespace VehicleControlSystem.ControlLayer
 
         public int OnOffConveyor( bool isOn, bool isLoad = false )
         {
+            this.SetConveyorSpeed( isLoad ); //Load 시 속도를 조금 더 빠르게 하기 위해.
+
             if ( isLoad )
                 this.ezIO.OutputOn( "OUT_CV_CWCCW" );
             else
@@ -30,9 +32,9 @@ namespace VehicleControlSystem.ControlLayer
             return 0;
         }
 
-        public void SetConveyorSpeed( bool IsHight )
+        public void SetConveyorSpeed( bool IsLoad )
         {
-            if ( IsHight )
+            if ( IsLoad )
                 this.ezIO.WriteOutputIO( "OUT_CV_DA", true );
             else
                 this.ezIO.WriteOutputIO( "OUT_CV_DA", false );
@@ -82,7 +84,7 @@ namespace VehicleControlSystem.ControlLayer
 
                 if ( !this.IsDetectedLoadStart() && isStartDetected )
                 {
-                    this.SetConveyorSpeed( false );
+                    //this.SetConveyorSpeed( false );
                     logger.D( "[Manual Load] - Conveyor Slow State" );
                 }
 

+ 36 - 0
Dev/OHV/VehicleControlSystem/ControlLayer/Motion/GSIDrive.cs

@@ -1,5 +1,6 @@
 using GSG.NET.Concurrent;
 using GSG.NET.Logging;
+using OHV.Common.Model;
 using OHV.Common.Shareds;
 using OHV.SqliteDAL;
 using System;
@@ -50,6 +51,23 @@ namespace VehicleControlSystem.ControlLayer.Drive
             set { SetField( ref driveServoState, value ); }
         }
 
+        private DriveState frontDriveState;
+
+        public DriveState FrontDriveState
+        {
+            get { return frontDriveState; }
+            set { SetField(ref this.frontDriveState, value); }
+        }
+
+        private DriveState rearDriveState;
+
+        public DriveState RearDriveState
+        {
+            get { return rearDriveState; }
+            set { SetField( ref this.rearDriveState, value ); }
+        }
+
+
         TaskCancel taskCancel = new TaskCancel();
         ThreadCancel threadCancel = new ThreadCancel();
         SqliteManager sql = null;
@@ -75,6 +93,8 @@ namespace VehicleControlSystem.ControlLayer.Drive
             this.threadCancel.Cancel();
             LockUtils.Wait( 50 );
             this.threadCancel.StopWaitAll();
+
+            PhysicalCheckupLogger.Instance.Dispose();
         }
 
         void Thread_DriveStateChcker()
@@ -150,10 +170,26 @@ namespace VehicleControlSystem.ControlLayer.Drive
             var fLoadFacter = Redis.Instance.LoadFacterFront();
             PhysicalCheckupLogger.Instance.FrontWheelLogging( speed.ToString(), fTorque.ToString(), fRPM.ToString(), fLoadFacter.ToString(), currentBCR.ToString() );
 
+            var fState = new DriveState();
+            fState.DirveName = "Front";
+            fState.Speed = speed;
+            fState.Torque = fTorque;
+            fState.Rpm = fRPM;
+            fState.Loadage = fLoadFacter;
+            this.FrontDriveState = fState;
+
             var rTorque = Redis.Instance.TorqueRear();
             var rRPM = Redis.Instance.ActualVelocityToRearRPM();
             var rLoadFacter = Redis.Instance.LoadFacterRear();
             PhysicalCheckupLogger.Instance.RearWheelLoggging( speed.ToString(), rTorque.ToString(), rRPM.ToString(), rLoadFacter.ToString(), currentBCR.ToString() );
+
+            var rState = new DriveState();
+            rState.DirveName = "Rear";
+            rState.Speed = speed;
+            rState.Torque = rTorque;
+            rState.Rpm = rRPM;
+            rState.Loadage = rLoadFacter;
+            this.RearDriveState = rState;
         }
 
         void GetReqSteeringState()

+ 34 - 6
Dev/OHV/VehicleControlSystem/ControlLayer/Vehicle.cs

@@ -117,8 +117,8 @@ namespace VehicleControlSystem.ControlLayer
         public eSteeringState SteeringState
         {
             get { return steeringState; }
-            set 
-            { 
+            set
+            {
                 if ( SetField( ref this.steeringState, value ) )
                 {
                     Redis.Instance.SetActualSteeringPos( value );
@@ -184,6 +184,22 @@ namespace VehicleControlSystem.ControlLayer
             set { SetField( ref this.obstaclePattern, value ); }
         }
 
+        private DriveState frontDriveState;
+
+        public DriveState FrontDriveState
+        {
+            get { return frontDriveState; }
+            set { SetField( ref this.frontDriveState, value ); }
+        }
+
+        private DriveState rearDriveState;
+
+        public DriveState RearDriveState
+        {
+            get { return rearDriveState; }
+            set { SetField( ref this.rearDriveState, value ); }
+        }
+
 
         //이동
         public bool Busy
@@ -1328,7 +1344,7 @@ namespace VehicleControlSystem.ControlLayer
             }
             loggerPIO.E( "[Port] - 4 Ready On" );
 
-            this.conveyor.SetConveyorSpeed( true );
+            //this.conveyor.SetConveyorSpeed( true );
             this.conveyor.OnOffConveyor( true, true );
             this.iO.WriteOutputIO( "OUT_PIO_RECEIVE_RUN", true, 1000 ); //1Sec 이후 On
             loggerPIO.I( "[Vehicle] - Conveyor Run" );
@@ -1366,8 +1382,8 @@ namespace VehicleControlSystem.ControlLayer
                 if ( this.conveyor.IsDetectedLoadStart() && !isStartDetected )
                     isStartDetected = true;
 
-                if ( !this.conveyor.IsDetectedLoadStart() && isStartDetected )
-                    this.conveyor.SetConveyorSpeed( false );
+                if ( !this.conveyor.IsDetectedLoadStart() && isStartDetected ) { }
+                    //this.conveyor.SetConveyorSpeed( false );
 
                 if ( this.conveyor.IsDetectedLoadStop() ) break;
 
@@ -1491,7 +1507,7 @@ namespace VehicleControlSystem.ControlLayer
             this.iO.WriteOutputIO( "OUT_PIO_SENDING_RUN", true );
             loggerPIO.I( "[Vehicle] - 2 Send Run On" );
 
-            this.conveyor.SetConveyorSpeed( true );
+            //this.conveyor.SetConveyorSpeed( true );
             this.conveyor.OnOffConveyor( true );
             this.OnConveyorStart?.Invoke( false );
 
@@ -1808,6 +1824,18 @@ namespace VehicleControlSystem.ControlLayer
                             this.iO.OutputOff( "OUT_DRIVE_BRAKE_OFF" );
                     }
                     break;
+                case "FrontDriveState":
+                    {
+                        var v = CastTo<DriveState>.From<object>( newValue );
+                        this.FrontDriveState = v;
+                    }
+                    break;
+                case "RearDriveState":
+                    {
+                        var v = CastTo<DriveState>.From<object>( newValue );
+                        this.RearDriveState = v;
+                    }
+                    break;
                 default:
                     break;
             }

+ 8 - 1
Dev/OHV/VehicleControlSystem/Managers/PhysicalCheckupLogger.cs

@@ -16,7 +16,7 @@ namespace VehicleControlSystem.Managers
     /// 아날로그 입력 정보를 종합하여 로그로 남기는 역할
     /// FTP 를 이용하여 파일 전송
     /// </summary>
-    class PhysicalCheckupLogger : SingletonBase<PhysicalCheckupLogger>
+    class PhysicalCheckupLogger : SingletonBase<PhysicalCheckupLogger>, IDisposable
     {
         Logger frontlogger = Logger.GetLogger( "PhysicalCheckup_Front" );
         Logger rearlogger = Logger.GetLogger( "PhysicalCheckup_Rear" );
@@ -35,6 +35,11 @@ namespace VehicleControlSystem.Managers
         {
         }
 
+        public void Dispose()
+        {
+            this.h.CloseSocket();
+        }
+
         public void FrontWheelLogging( string speed, string torque, string RPM, string LoadFactor, string MCR ) => frontlogger.I( $"Speed : {speed} / Torque : {torque} / RPM : {RPM} / LoadFactor : {LoadFactor} / MCR : {MCR}" );
         public void RearWheelLoggging( string speed, string torque, string RPM, string LoadFactor, string MCR ) => rearlogger.I( $"Speed : {speed} / Torque : {torque} / RPM : {RPM} / LoadFactor : {LoadFactor} / MCR : {MCR}" );
 
@@ -121,6 +126,7 @@ namespace VehicleControlSystem.Managers
             }
             catch ( Exception e )
             {
+                h.CloseSocket();
                 logger.E( $"[PLC] - Set Value Connection Error {e}" );
                 return false;
             }
@@ -159,6 +165,7 @@ namespace VehicleControlSystem.Managers
             }
             catch ( Exception e )
             {
+                h.CloseSocket();
                 logger.E( $"[PLC] - Reset Value Connection Error {e}" );
                 return false;
             }

+ 0 - 0
Dev/OHVLoggerTest/.vs/OHVLoggerTest/v16/Server/sqlite3/db.lock


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


+ 25 - 0
Dev/OHVLoggerTest/OHVLoggerTest.sln

@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29905.134
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OHVLoggerTest", "OHVLoggerTest\OHVLoggerTest.csproj", "{29027F4C-8DFC-420E-9B5E-AA947A9D8DFF}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{29027F4C-8DFC-420E-9B5E-AA947A9D8DFF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{29027F4C-8DFC-420E-9B5E-AA947A9D8DFF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{29027F4C-8DFC-420E-9B5E-AA947A9D8DFF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{29027F4C-8DFC-420E-9B5E-AA947A9D8DFF}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {B99035A4-9E11-47FD-B230-5CDFAD07CC72}
+	EndGlobalSection
+EndGlobal

+ 6 - 0
Dev/OHVLoggerTest/OHVLoggerTest/App.config

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
+    </startup>
+</configuration>

+ 106 - 0
Dev/OHVLoggerTest/OHVLoggerTest/Config/log4net.xml

@@ -0,0 +1,106 @@
+<log4net>
+
+	<root name="root">
+		<level value="ALL" />
+		<appender-ref ref="FileAppender" />
+		<!--<appender-ref ref="WarnFileAppender" />-->
+		<!--<appender-ref ref="MongoAppender" />-->
+	</root>
+
+	<logger name="PhysicalCheckup_Front" additivity="false">
+		<appender-ref ref="PhysicalCheckupFileAppender_Front" />
+	</logger>
+
+	<logger name="PhysicalCheckup_Rear" additivity="false">
+		<appender-ref ref="PhysicalCheckupFileAppender_Rear" />
+	</logger>
+
+	<!--
+	ALL    DEBUG   INFO    WARN    ERROR   FATAL   OFF
+	•All
+	•DEBUG  •DEBUG
+	•INFO   •INFO   •INFO
+	•WARN   •WARN   •WARN   •WARN
+	•ERROR  •ERROR  •ERROR  •ERROR  •ERROR
+	•FATAL  •FATAL  •FATAL  •FATAL  •FATAL  •FATAL
+	•OFF    •OFF    •OFF    •OFF    •OFF    •OFF    •OFF
+	-->
+
+	<appender name="PhysicalCheckupFileAppender_Front" type="GSG.NET.Logging.FileAppender, GSG.NET">
+		<threshold value="INFO"/>
+		<file value="C:\LOG\OHV\Vehicle\PhysicalCheckup\Front_Wheel.log" />
+		<staticLogFileName value="true"/>
+		<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
+		<appendToFile value="true" />
+		<rollingStyle value="Date" />
+		<backupDays value="10" />
+		<datePattern value="-MMdd'.log'" />
+		<layout type="log4net.Layout.PatternLayout">
+			<conversionPattern value="%d{MM-dd HH:mm:ss.fff} %2t %p %m%n" />
+		</layout>
+	</appender>
+
+	<appender name="PhysicalCheckupFileAppender_Rear" type="GSG.NET.Logging.FileAppender, GSG.NET">
+		<threshold value="INFO"/>
+		<file value="C:\LOG\OHV\Vehicle\PhysicalCheckup\Rear_Wheel.log" />
+		<staticLogFileName value="true"/>
+		<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
+		<appendToFile value="true" />
+		<rollingStyle value="Date" />
+		<backupDays value="10" />
+		<datePattern value="-MMdd'.log'" />
+		<layout type="log4net.Layout.PatternLayout">
+			<conversionPattern value="%d{MM-dd HH:mm:ss.fff} %2t %p %m%n" />
+		</layout>
+	</appender>
+
+	<appender name="FileAppender" type="GSG.NET.Logging.FileAppender, GSG.NET">
+		<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
+		<file type="log4net.Util.PatternString">
+			<conversionPattern value="C:\LOG\OHV\DriveLogger\DriveLogger.log"  />
+		</file>
+		<appendToFile value="true" />
+		<rollingStyle value="Date" />
+		<backupDays value="10" />
+		<datePattern value="-MMdd'.log'" />
+		<layout type="log4net.Layout.PatternLayout">
+			<conversionPattern value="%d{MM-dd HH:mm:ss.fff} %-2t %p %m%n" />
+		</layout>
+	</appender>
+
+	<appender name="DebugFileAppender" type="GSG.NET.Logging.FileAppender, GSG.NET">
+		<filter type="log4net.Filter.LevelRangeFilter">
+			<param name="LevelMin" value="DEBUG"></param>
+			<param name="LevelMax" value="DEBUG"></param>
+		</filter>
+		<threshold value="DEBUG"/>
+		<file value="C:\LOG\OHV\DEBUG\Vehicle_DEBUG.log" />
+		<appendToFile value="true" />
+		<rollingStyle value="Date" />
+		<backupDays value="10" />
+		<datePattern value="-MMdd'.log'" />
+		<layout type="log4net.Layout.PatternLayout">
+			<conversionPattern value="%d{MM-dd HH:mm:ss.fff} %2t %p %m%n" />
+		</layout>
+	</appender>
+
+	<appender name="WarnFileAppender" type="GSG.NET.Logging.FileAppender, GSG.NET">
+		<threshold value="WARN"/>
+		<file value="C:\LOG\OHV\Vehicle\Vehicle_WARN.log" />
+		<appendToFile value="true" />
+		<rollingStyle value="Date" />
+		<backupDays value="180" />
+		<datePattern value="-MMdd'.log'" />
+		<layout type="log4net.Layout.PatternLayout">
+			<conversionPattern value="%d{MM-dd HH:mm:ss.fff} %2t %p %m%n" />
+		</layout>
+	</appender>
+
+	<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender"   >
+		<layout type="log4net.Layout.PatternLayout">
+			<param name="ConversionPattern" value="%d %m%n" />
+		</layout>
+		<threshold value="ALL"/>
+	</appender>
+
+</log4net>

+ 40 - 0
Dev/OHVLoggerTest/OHVLoggerTest/Form1.Designer.cs

@@ -0,0 +1,40 @@
+namespace OHVLoggerTest
+{
+    partial class Form1
+    {
+        /// <summary>
+        /// 필수 디자이너 변수입니다.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// 사용 중인 모든 리소스를 정리합니다.
+        /// </summary>
+        /// <param name="disposing">관리되는 리소스를 삭제해야 하면 true이고, 그렇지 않으면 false입니다.</param>
+        protected override void Dispose( bool disposing )
+        {
+            if ( disposing && ( components != null ) )
+            {
+                components.Dispose();
+            }
+            base.Dispose( disposing );
+        }
+
+        #region Windows Form 디자이너에서 생성한 코드
+
+        /// <summary>
+        /// 디자이너 지원에 필요한 메서드입니다. 
+        /// 이 메서드의 내용을 코드 편집기로 수정하지 마세요.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.components = new System.ComponentModel.Container();
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size( 800, 450 );
+            this.Text = "Form1";
+        }
+
+        #endregion
+    }
+}
+

+ 61 - 0
Dev/OHVLoggerTest/OHVLoggerTest/Form1.cs

@@ -0,0 +1,61 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using GSG.NET.Concurrent;
+using GSG.NET.Logging;
+
+namespace OHVLoggerTest
+{
+    public partial class Form1 : Form
+    {
+        Logger frontWheelLogger = Logger.GetLogger( "PhysicalCheckup_Front" );
+        Logger rearWheelLogger = Logger.GetLogger( "PhysicalCheckup_Rear" );
+
+        ThreadCancel threadCancel = new ThreadCancel();
+        KV8000 plc = new KV8000();
+
+        public Form1()
+        {
+            InitializeComponent();
+
+            this.Load += Form1_Load;
+            this.FormClosing += Form1_FormClosing;
+        }
+
+        private void Form1_FormClosing( object sender, FormClosingEventArgs e )
+        {
+            this.threadCancel.Cancel();
+            this.threadCancel.StopWaitAll();
+
+            Redis.Instance.Dispose();
+        }
+
+        private void Form1_Load( object sender, EventArgs e )
+        {
+            Redis.Instance.Init();
+            plc.Connecte();
+
+            this.threadCancel.AddGo( Thread_Dowork );
+        }
+
+        void Thread_Dowork()
+        {
+            while ( !this.threadCancel.Canceled )
+            {
+                try
+                {
+                    LockUtils.Wait( 10 );
+                }
+                catch ( Exception )
+                {
+                }
+            }
+        }
+    }
+}

+ 105 - 0
Dev/OHVLoggerTest/OHVLoggerTest/KV8000.cs

@@ -0,0 +1,105 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using GSG.NET.Logging;
+using GSG.NET.TCP;
+using GSG.NET.Utils;
+
+namespace OHVLoggerTest
+{
+    public class KV8000
+    {
+        static Logger logger = Logger.GetLogger();
+
+        TcpConnector h = new TcpConnector();
+        const byte CR = 0x0d;
+
+        public bool Connecte()
+        {
+            h.Connect( new TcpComm
+            {
+                Active = true,
+                Ip = "192.168.0.20",
+                PortNo = 8501,
+            } ) ;
+
+            return h.Connected;
+        }
+
+        /// <summary>
+        /// 주행 시작 시 진단 PLC Bit On
+        /// </summary>
+        /// <returns></returns>
+        public bool SetPLCStartDrive()
+        {
+            try
+            {
+                if ( !h.Connected )
+                {
+                    h.Connect( new TcpComm
+                    {
+                        Active = true,
+                        Ip = "192.168.0.20",
+                        PortNo = 8501,
+                    } );
+                }
+
+                if ( !h.Connected )
+                    return false;
+
+                var mb = new MemoryBuffer();
+                mb.AppendAscii( "WR MR100 1" );
+                mb.Append( CR );
+                this.h.WriteFlush( mb.ToBytes );
+            }
+            catch ( Exception e )
+            {
+                h.CloseSocket();
+                logger.E( $"[PLC] - Set Value Connection Error {e}" );
+                return false;
+            }
+
+            return true;
+        }
+
+        /// <summary>
+        /// 주행 정지 시 진단 PLC Bit Off
+        /// </summary>
+        /// <returns></returns>
+        public bool ResetPLCStartDrive()
+        {
+            try
+            {
+                if ( !h.Connected )
+                {
+                    h.Connect( new TcpComm
+                    {
+                        Active = true,
+                        Ip = "192.168.0.20",
+                        PortNo = 8501,
+                    } );
+                }
+
+                if ( !h.Connected )
+                    return false;
+
+                var mb = new MemoryBuffer();
+                mb.AppendAscii( "WR MR100 0" );
+                mb.Append( CR );
+                this.h.WriteFlush( mb.ToBytes );
+            }
+            catch ( Exception e )
+            {
+                h.CloseSocket();
+                logger.E( $"[PLC] - Reset Value Connection Error {e}" );
+                return false;
+            }
+
+            return true;
+        }
+
+
+    }
+}

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

@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{29027F4C-8DFC-420E-9B5E-AA947A9D8DFF}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <RootNamespace>OHVLoggerTest</RootNamespace>
+    <AssemblyName>OHVLoggerTest</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <Deterministic>true</Deterministic>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Common.Logging">
+      <HintPath>..\..\OHV\Assambly\Common.Logging.dll</HintPath>
+    </Reference>
+    <Reference Include="GSG.NET">
+      <HintPath>..\..\OHV\Assambly\GSG.NET.dll</HintPath>
+    </Reference>
+    <Reference Include="log4net">
+      <HintPath>..\..\OHV\Assambly\log4net.dll</HintPath>
+    </Reference>
+    <Reference Include="Quartz">
+      <HintPath>..\..\OHV\Assambly\Quartz.dll</HintPath>
+    </Reference>
+    <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.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>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.IO.Compression" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Deployment" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Form1.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Form1.Designer.cs">
+      <DependentUpon>Form1.cs</DependentUpon>
+    </Compile>
+    <Compile Include="KV8000.cs" />
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Redis.cs" />
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <None Include="packages.config" />
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="Config\log4net.xml">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>

+ 46 - 0
Dev/OHVLoggerTest/OHVLoggerTest/Program.cs

@@ -0,0 +1,46 @@
+using System;
+using System.Windows.Forms;
+using GSG.NET.Concurrent;
+using GSG.NET.Logging;
+using GSG.NET.Utils;
+
+namespace OHVLoggerTest
+{
+    static class Program
+    {
+        static Logger logger = Logger.GetLogger();
+
+        /// <summary>
+        /// 해당 애플리케이션의 주 진입점입니다.
+        /// </summary>
+        [STAThread]
+        static void Main()
+        {
+            if ( !ProcessUtils.IsOnlyOneInstance )
+            {
+                MessageBox.Show( "SECS Server is running duplicate" );
+                return;
+            }
+
+            LogUtils.Configure( "Config/log4net.xml", true );
+
+            AppUtils.LogGlobalException();
+            //ThreadUtils.InitPoolSize( 20 );
+
+            logger.I( "{0} Logger Seviece Started {0}", string.Empty.PadRight( 40, '+' ) );
+            try
+            {
+                Application.EnableVisualStyles();
+                Application.SetCompatibleTextRenderingDefault( false );
+                Application.Run( new Form1() );
+
+            }
+            catch ( Exception e)
+            {
+                logger.E( e );
+            }
+            logger.I( "{0} Logger Seviece Stopped {0}", string.Empty.PadRight( 40, '-' ) );
+        }
+
+    }
+}

+ 36 - 0
Dev/OHVLoggerTest/OHVLoggerTest/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해 
+// 제어됩니다. 어셈블리와 관련된 정보를 수정하려면
+// 이러한 특성 값을 변경하세요.
+[assembly: AssemblyTitle( "OHVLoggerTest" )]
+[assembly: AssemblyDescription( "" )]
+[assembly: AssemblyConfiguration( "" )]
+[assembly: AssemblyCompany( "" )]
+[assembly: AssemblyProduct( "OHVLoggerTest" )]
+[assembly: AssemblyCopyright( "Copyright ©  2020" )]
+[assembly: AssemblyTrademark( "" )]
+[assembly: AssemblyCulture( "" )]
+
+// ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에 
+// 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면
+// 해당 형식에 대해 ComVisible 특성을 true로 설정하세요.
+[assembly: ComVisible( false )]
+
+// 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다.
+[assembly: Guid( "29027f4c-8dfc-420e-9b5e-aa947a9d8dff" )]
+
+// 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다.
+//
+//      주 버전
+//      부 버전 
+//      빌드 번호
+//      수정 버전
+//
+// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를
+// 기본값으로 할 수 있습니다.
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion( "1.0.0.0" )]
+[assembly: AssemblyFileVersion( "1.0.0.0" )]

+ 71 - 0
Dev/OHVLoggerTest/OHVLoggerTest/Properties/Resources.Designer.cs

@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     이 코드는 도구를 사용하여 생성되었습니다.
+//     런타임 버전:4.0.30319.42000
+//
+//     파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면
+//     이러한 변경 내용이 손실됩니다.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace OHVLoggerTest.Properties
+{
+
+
+    /// <summary>
+    ///   지역화된 문자열 등을 찾기 위한 강력한 형식의 리소스 클래스입니다.
+    /// </summary>
+    // 이 클래스는 ResGen 또는 Visual Studio와 같은 도구를 통해 StronglyTypedResourceBuilder
+    // 클래스에서 자동으로 생성되었습니다.
+    // 멤버를 추가하거나 제거하려면 .ResX 파일을 편집한 다음 /str 옵션을 사용하여
+    // ResGen을 다시 실행하거나 VS 프로젝트를 다시 빌드하십시오.
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute( "System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0" )]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    internal class Resources
+    {
+
+        private static global::System.Resources.ResourceManager resourceMan;
+
+        private static global::System.Globalization.CultureInfo resourceCulture;
+
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute( "Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode" )]
+        internal Resources()
+        {
+        }
+
+        /// <summary>
+        ///   이 클래스에서 사용하는 캐시된 ResourceManager 인스턴스를 반환합니다.
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute( global::System.ComponentModel.EditorBrowsableState.Advanced )]
+        internal static global::System.Resources.ResourceManager ResourceManager
+        {
+            get
+            {
+                if ( ( resourceMan == null ) )
+                {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager( "OHVLoggerTest.Properties.Resources", typeof( Resources ).Assembly );
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+
+        /// <summary>
+        ///   이 강력한 형식의 리소스 클래스를 사용하여 모든 리소스 조회에 대해 현재 스레드의 CurrentUICulture 속성을
+        ///   재정의합니다.
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute( global::System.ComponentModel.EditorBrowsableState.Advanced )]
+        internal static global::System.Globalization.CultureInfo Culture
+        {
+            get
+            {
+                return resourceCulture;
+            }
+            set
+            {
+                resourceCulture = value;
+            }
+        }
+    }
+}

+ 117 - 0
Dev/OHVLoggerTest/OHVLoggerTest/Properties/Resources.resx

@@ -0,0 +1,117 @@
+<?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.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: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" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+            </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" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 30 - 0
Dev/OHVLoggerTest/OHVLoggerTest/Properties/Settings.Designer.cs

@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.42000
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace OHVLoggerTest.Properties
+{
+
+
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute( "Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0" )]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+    {
+
+        private static Settings defaultInstance = ( (Settings)( global::System.Configuration.ApplicationSettingsBase.Synchronized( new Settings() ) ) );
+
+        public static Settings Default
+        {
+            get
+            {
+                return defaultInstance;
+            }
+        }
+    }
+}

+ 7 - 0
Dev/OHVLoggerTest/OHVLoggerTest/Properties/Settings.settings

@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
+  <Profiles>
+    <Profile Name="(Default)" />
+  </Profiles>
+  <Settings />
+</SettingsFile>

+ 114 - 0
Dev/OHVLoggerTest/OHVLoggerTest/Redis.cs

@@ -0,0 +1,114 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using GSG.NET.Extensions;
+using GSG.NET.ObjectBase;
+using StackExchange.Redis;
+
+namespace OHVLoggerTest
+{
+    public class Redis : SingletonBase<Redis>, IDisposable
+    {
+        ConnectionMultiplexer redisMaster = null;
+        IDatabase database = null;
+
+        private Redis()
+        {
+        }
+
+        public void Dispose()
+        {
+            this.redisMaster.Dispose();
+        }
+
+        public void Init()
+        {
+            redisMaster = ConnectionMultiplexer.Connect( "127.0.0.1:6379" + ",allowAdmin=true,password=..." );
+            database = redisMaster.GetDatabase();
+        }
+
+        public bool SetValue( string key, string val ) => database.StringSet( key, val );
+        public string GetValue( string key ) => database.StringGet( key );
+
+
+        #region GetLogData
+
+        /// <summary>
+        /// 0.1% 단위
+        /// 100% 1.9Nm
+        /// </summary>
+        /// <returns></returns>
+        public double TorqueFront()
+        {
+            return LoadFacterFront() * 1.9 / 100;
+        }
+
+        /// <summary>
+        /// 0.1% 단위 
+        /// </summary>
+        /// <returns></returns>
+        public double TorqueRear()
+        {
+            return LoadFacterRear() * 1.9 / 100;
+        }
+
+        public double LoadFacterFront()
+        {
+            var ret = database.HashGet( "7028", "7" );
+            return Math.Abs( CastTo<double>.From<RedisValue>( ret ) * 0.1 );
+        }
+
+        public double LoadFacterRear()
+        {
+            var ret = database.HashGet( "7028", "7" );
+            return Math.Abs( CastTo<double>.From<RedisValue>( ret ) * 0.1 );
+        }
+
+        public double ActualVelocityToFrontRPM()
+        {
+            var ret = database.HashGet( "7026", "7" );
+            return CastTo<double>.From<RedisValue>( ret ) * 60 * 10 / ( 2 * Math.PI ) / 0.06;
+        }
+        public double ActualVelocityToRearRPM()
+        {
+            var ret = database.HashGet( "7026", "8" );
+            return CastTo<double>.From<RedisValue>( ret ) * 60 * 10 / ( 2 * Math.PI ) / 0.06;
+        }
+        public double ActualVelocityToSpeed()
+        {
+            var ret = database.HashGet( "4034", "7" );
+            return CastTo<double>.From<RedisValue>( ret ) * 0.0001; //m/sec
+        }
+
+        public int CurrentBCRValue()
+        {
+            var ret = database.HashGet( "7121", "7" );
+            return CastTo<int>.From<RedisValue>( ret );
+        }
+
+        public bool GetDriveMove()
+        {
+            var ret = database.HashGet( "3011", "7" );
+            if ( ret == 0 )
+                return false;
+            else
+                return true;
+
+        }
+
+        #endregion
+
+        /// <summary>
+        /// System State
+        /// </summary>
+        /// <returns>0=StartUp, 1=DeviceOpened, 2=DiviceOpenFailed, 3=ManualOP, 4=AutomaticOp, 5=DeviceCloseed, 6=Finished</returns>
+        public int GetSystemState()
+        {
+            var ret = database.HashGet( "111", "7" );
+            return CastTo<int>.From<RedisValue>( ret );
+        }
+
+    }
+}

+ 5 - 0
Dev/OHVLoggerTest/OHVLoggerTest/packages.config

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="StackExchange.Redis.Extensions.Core" version="3.5.0" targetFramework="net45" />
+  <package id="StackExchange.Redis.StrongName" version="1.2.6" targetFramework="net45" />
+</packages>