DESKTOP-Kang 6 лет назад
Родитель
Сommit
299c6565b9
61 измененных файлов с 17909 добавлено и 965 удалено
  1. 1 0
      Dev/Connection/OHVProtocolServer/OHVProtocolClient/MainWindow.xaml
  2. 14 1
      Dev/Connection/OHVProtocolServer/OHVProtocolClient/MainWindow.xaml.cs
  3. BIN
      Dev/OHV/Assambly/FluentFTP.dll
  4. BIN
      Dev/OHV/Assambly/FluentFTP.pdb
  5. 6721 0
      Dev/OHV/Assambly/FluentFTP.xml
  6. BIN
      Dev/OHV/Assambly/GSG.NET.PLC.dll
  7. BIN
      Dev/OHV/Assambly/GSG.NET.PLC.pdb
  8. 156 0
      Dev/OHV/Assambly/GSG.NET.XML
  9. BIN
      Dev/OHV/Assambly/GSG.NET.dll
  10. BIN
      Dev/OHV/Assambly/GSG.NET.pdb
  11. BIN
      Dev/OHV/Assambly/NetMq/AsyncIO.dll
  12. BIN
      Dev/OHV/Assambly/NetMq/JetBrains.Annotations.dll
  13. BIN
      Dev/OHV/Assambly/NetMq/NaCl.dll
  14. BIN
      Dev/OHV/Assambly/NetMq/NetMQ.dll
  15. BIN
      Dev/OHV/Assambly/NetMq/NetMQ.pdb
  16. 10339 0
      Dev/OHV/Assambly/NetMq/NetMQ.xml
  17. BIN
      Dev/OHV/Assambly/NetMq/System.Buffers.dll
  18. BIN
      Dev/OHV/Assambly/NetMq/System.Memory.dll
  19. BIN
      Dev/OHV/Assambly/NetMq/System.Runtime.CompilerServices.Unsafe.dll
  20. BIN
      Dev/OHV/Assambly/NetMq/System.ValueTuple.dll
  21. 0 9
      Dev/OHV/OHV.Module.Interactivity/PopUp/DriveServoViewModel.cs
  22. 21 16
      Dev/OHV/VehicleControlSystem/Managers/HostManager.cs
  23. 0 0
      Dev/OHVDriveLogger/OHVDriveLogger/.vs/OHVDriveLogger/v16/Server/sqlite3/db.lock
  24. BIN
      Dev/OHVDriveLogger/OHVDriveLogger/.vs/OHVDriveLogger/v16/Server/sqlite3/storage.ide
  25. 25 0
      Dev/OHVDriveLogger/OHVDriveLogger/OHVDriveLogger.sln
  26. 1 1
      Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryCommTest/App.config
  27. 106 0
      Dev/OHVDriveLogger/OHVDriveLogger/OHVDriveLogger/Config/log4net.xml
  28. 73 0
      Dev/OHVDriveLogger/OHVDriveLogger/OHVDriveLogger/FTPLogger.cs
  29. 82 0
      Dev/OHVDriveLogger/OHVDriveLogger/OHVDriveLogger/FormMain.Designer.cs
  30. 71 0
      Dev/OHVDriveLogger/OHVDriveLogger/OHVDriveLogger/FormMain.cs
  31. 120 0
      Dev/OHVDriveLogger/OHVDriveLogger/OHVDriveLogger/FormMain.resx
  32. 44 53
      Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryCommTest/BatteryCommTest.csproj
  33. 50 0
      Dev/OHVDriveLogger/OHVDriveLogger/OHVDriveLogger/Program.cs
  34. 12 12
      Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryTabos/Properties/AssemblyInfo.cs
  35. 5 5
      Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryCommTest/Properties/Resources.Designer.cs
  36. 0 0
      Dev/OHVDriveLogger/OHVDriveLogger/OHVDriveLogger/Properties/Resources.resx
  37. 3 3
      Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryCommTest/Properties/Settings.Designer.cs
  38. 7 0
      Dev/OHVDriveLogger/OHVDriveLogger/OHVDriveLogger/Properties/Settings.settings
  39. 54 0
      Dev/OHVDriveLogger/OHVDriveLogger/OHVDriveLogger/ZmqManager.cs
  40. BIN
      Dev/OHVLoggerTest/.vs/OHVLoggerTest/v16/Server/sqlite3/storage.ide
  41. BIN
      Dev/OHVLoggerTest/.vs/OHVLoggerTest/v16/Server/sqlite3/storage.ide-shm
  42. BIN
      Dev/OHVLoggerTest/.vs/OHVLoggerTest/v16/Server/sqlite3/storage.ide-wal
  43. 1 0
      Dev/OHVLoggerTest/OHVLoggerTest/Form1.cs
  44. 0 105
      Dev/OHVLoggerTest/OHVLoggerTest/KV8000.cs
  45. 3 1
      Dev/OHVLoggerTest/OHVLoggerTest/OHVLoggerTest.csproj
  46. BIN
      Dev/SerialModule/BatteryTabos/BatteryTabos/.vs/BatteryTabos/v16/Server/sqlite3/storage.ide
  47. 0 9
      Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryCommTest/App.xaml
  48. 0 17
      Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryCommTest/App.xaml.cs
  49. 0 20
      Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryCommTest/MainWindow.xaml
  50. 0 41
      Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryCommTest/MainWindow.xaml.cs
  51. 0 55
      Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryCommTest/Properties/AssemblyInfo.cs
  52. 0 7
      Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryCommTest/Properties/Settings.settings
  53. 0 4
      Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryCommTest/packages.config
  54. 0 31
      Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryTabos.sln
  55. 0 59
      Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryTabos/BatteryTabos.csproj
  56. 0 36
      Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryTabos/Config.cs
  57. 0 36
      Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryTabos/Delegates.cs
  58. 0 24
      Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryTabos/EnumBatteryStatus.cs
  59. 0 276
      Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryTabos/Manager.cs
  60. 0 26
      Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryTabos/QueObject.cs
  61. 0 118
      Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryTabos/Rs232c.cs

+ 1 - 0
Dev/Connection/OHVProtocolServer/OHVProtocolClient/MainWindow.xaml

@@ -21,6 +21,7 @@
         <Button Content="Send" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75" Margin="395,88,0,0" Click="Button_Click" Height="22"/>
         <TextBox x:Name="txtSubCode" HorizontalAlignment="Left" Height="22" Margin="267,88,0,0" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Width="120"/>
         <ComboBox HorizontalAlignment="Left" Margin="10,88,0,0" VerticalAlignment="Top" Width="120" ItemsSource="{Binding Source={StaticResource MessageKind}}" x:Name="comboMessageKind"/>
+        <Button Content="Send M" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75" Margin="395,134,0,0" Click="Button_Click_1" Height="22"/>
 
     </Grid>
 </Window>

+ 14 - 1
Dev/Connection/OHVProtocolServer/OHVProtocolClient/MainWindow.xaml.cs

@@ -185,7 +185,7 @@ namespace OHVProtocolClient
         {
             OCSMessage meg = new OCSMessage();
             meg.RevID = "V0001";
-            meg.SendID = "A0";
+            meg.SendID = "S0";
             meg.Kind = (eKind)Enum.ToObject( typeof( eKind ), this.comboMessageKind.SelectedItem );
             meg.Tag = this.txtTag.Text;
             meg.SubCode = this.txtSubCode.Text;
@@ -193,5 +193,18 @@ namespace OHVProtocolClient
             this.manager.Send( meg );
         }
 
+        private void Button_Click_1( object sender, RoutedEventArgs e )
+        {
+            OCSMessage meg = new OCSMessage();
+            meg.RevID = "V0001";
+            meg.SendID = "S0";
+            meg.Kind = (eKind)Enum.ToObject( typeof( eKind ), this.comboMessageKind.SelectedItem );
+            meg.Tag = this.txtTag.Text;
+            meg.SubCode = this.txtSubCode.Text;
+            meg.ViaRouteList.Add( "0029" );
+            meg.ViaRouteList.Add( "0030" );
+
+            this.manager.Send( meg );
+        }
     }
 }

BIN
Dev/OHV/Assambly/FluentFTP.dll


BIN
Dev/OHV/Assambly/FluentFTP.pdb


Разница между файлами не показана из-за своего большого размера
+ 6721 - 0
Dev/OHV/Assambly/FluentFTP.xml


BIN
Dev/OHV/Assambly/GSG.NET.PLC.dll


BIN
Dev/OHV/Assambly/GSG.NET.PLC.pdb


+ 156 - 0
Dev/OHV/Assambly/GSG.NET.XML

@@ -867,6 +867,162 @@
             Watch start
             </summary>
         </member>
+        <member name="T:GSG.NET.FTP.FTPClient">
+            <summary>
+            <para>WebClient에 CWD를 하는 함수는 없다</para>
+            <para>-</para>
+            <para>(주의) FTP Remote 경로는 모두 FTP 접속시 접근되는 폴더 기준으로 해야한다.</para>
+            <para>-</para>
+            <para>2012.07</para>
+            <para>UploadFile함수 기능 보강.</para>
+            <para>-</para>
+            </summary>
+        </member>
+        <member name="F:GSG.NET.FTP.FTPClient.lock1">
+            <summary>
+            Webclient Support Only One IO
+            </summary>
+        </member>
+        <member name="F:GSG.NET.FTP.FTPClient.ANONYMOUS">
+            <summary>Anonymous User ID</summary>
+        </member>
+        <member name="P:GSG.NET.FTP.FTPClient.User">
+            <summary>FTP Client User</summary>
+        </member>
+        <member name="P:GSG.NET.FTP.FTPClient.IpAddress">
+            <summary>FTP IpAddress</summary>
+        </member>
+        <member name="P:GSG.NET.FTP.FTPClient.Port">
+            <summary>FTP Port, Default 21</summary>
+        </member>
+        <member name="P:GSG.NET.FTP.FTPClient.Password">
+            <summary>FTP Password</summary>
+        </member>
+        <member name="M:GSG.NET.FTP.FTPClient.#ctor">
+            <summary/>
+        </member>
+        <member name="P:GSG.NET.FTP.FTPClient.Proxy">
+            <summary>
+            <para>Proxy</para>
+            <para>-</para>
+            <para>Default null</para>
+            </summary>
+        </member>
+        <member name="M:GSG.NET.FTP.FTPClient.CheckCredential">
+            <summary>
+            <para>필수 체크 항목</para>
+            <para>-</para>
+            <para>1. 계정 세팅 connect 호출 여부 체크.</para>
+            </summary>
+        </member>
+        <member name="M:GSG.NET.FTP.FTPClient.Connect">
+            <summary>
+            <para>User, Password 접속 정보만 세팅하며</para>
+            <para>바로 접속은 하지 않고 필요시 연결은 자동으로 처리한다.</para>
+            <para>User를 세팅하지 않으면 기본 Anonymous User로 접속된다.</para>
+            </summary>
+        </member>
+        <member name="M:GSG.NET.FTP.FTPClient.ListDirectory(System.String)">
+            <summary>
+            <para>FTP server 원격 ListDirectory 목록 조회.</para>
+            <para>-</para>
+            <para>현재 경로 List가져오기</para>
+            <para>ListDirectory("/")</para>
+            </summary>
+        </member>
+        <member name="M:GSG.NET.FTP.FTPClient.GetInitDirectory">
+            <summary>
+            <para>초기 접속 경로</para>
+            <para>에러가 발생할 경우 ??를 return한다</para>
+            </summary>
+        </member>
+        <member name="M:GSG.NET.FTP.FTPClient.ChangeFileName(System.String,System.String)">
+            <summary>
+            <para>예제.</para>
+            <para>ChangeFileName("/aaa.bbb", "aaa.ccc")</para>
+            </summary>
+        </member>
+        <member name="M:GSG.NET.FTP.FTPClient.MakeDirectory(System.String)">
+            <summary>
+            <para>Directory 생성이 필요할 경우마다 호출함, Exception이 발생하지 않으며 Debug로그만 Write한다.</para>
+            <para>-</para>
+            <para>모든 경로는 접속시 기본 경로에서 시작한다.</para>
+            <para>-</para>
+            <para>접속시 기본 경로: /home/fms</para>
+            <para>//home/fms/FTP 만들기 예제</para>
+            <para>-</para>
+            <para>상대 경로로 만들 경우</para>
+            <para>/FTP 앞에 /를 붙여 줘야 한다.</para>
+            <para>-</para>
+            <para>절대 경로로 만들 경우</para>
+            <para>//home/fms/FTP</para>
+            <param name="dir"></param>
+            </summary>
+        </member>
+        <member name="M:GSG.NET.FTP.FTPClient.DeleteFile(System.String)">
+            <summary>
+            <para>Delete Remote File or Directory</para>
+            </summary>
+            <param name="remote">File or Directory</param>
+        </member>
+        <member name="M:GSG.NET.FTP.FTPClient.DownloadFile(System.String)">
+            <summary>
+            <para>Use DownloadFile(remotePath, localPath)</para>
+            </summary>
+        </member>
+        <member name="M:GSG.NET.FTP.FTPClient.DownloadFile(System.String,System.String)">
+            <summary>
+            <para>Sync 방식 File Download</para>
+            <para>-</para>
+            <para>모든 경로는 접속시 기본 경로에서 시작한다.</para>
+            <para>-</para>
+            <para>접속시 기본 경로: /home/fms</para>
+            <para>//home/fms/FTP/aaa.txt Download 예제</para>
+            <para>-</para>
+            <para>상대 경로 Download</para>
+            <para>DownloadFile(/FTP/aaa.txt, c:\aaa.txt)</para>
+            <para>-</para>
+            <para>절대 경로 Download</para>
+            <para>DownloadFile("//home/fms/FTP/aaa.txt", "c:\aaa.txt")</para>
+            <para>-</para>/// </summary>
+            <param name="remotePath"></param>
+            <param name="localPath"></param>
+        </member>
+        <member name="M:GSG.NET.FTP.FTPClient.UploadFile(System.String,System.String)">
+            <summary>
+            <para>Sync방식 Upload FTP</para>
+            <para>-</para>
+            <para>모든 경로는 접속시 기본 경로에서 시작한다.</para>
+            <para>-</para>
+            <para>remoteFileName에는 파일 이름을 써줘야 한다.</para>
+            <para>-</para>
+            <para>접속시 기본 경로: /home/fms</para>
+            <para>//home/fms/FTP/aaa.txt파일 올리기 예제</para>
+            <para>-</para>
+            <para>상대 경로 Upload</para>
+            <para>UploadFile(/FTP/aaa.txt, c:\aaa.txt)</para>
+            <para>-</para>
+            <para>절대 경로 Upload</para>
+            <para>UploadFile(//home/fms/FTP/aaa.txt, c:\aaa.txt)</para>
+            <para>-</para>
+            <para>주의: Server에 해당 파일이 있을 경우는 Option에 따라 다르게 동작함</para>
+            <para>Delete 권한 있을 경우: Overwrite</para>
+            <para>Delete 권한 없을 경우: 에러 발생함</para>
+            <para>-</para>
+            </summary>
+        </member>
+        <member name="M:GSG.NET.FTP.FTPClient.UploadFileAsync(System.String,System.String)">
+            <summary>
+            <para>비동기 FTP File Upload Request</para>
+            <para>-</para>
+            <para>경로는 UploadFile을 참고한다.</para>
+            </summary>
+        </member>
+        <member name="M:GSG.NET.FTP.FTPClient.ToString">
+            <summary>
+            ("FTPClient '{0}/{1}' '{2}:{3}'", IpAddress, Port, User, Password);
+            </summary>
+        </member>
         <member name="T:GSG.NET.IO.ConsoleOutputter">
             <summary>
             console data를 richtext box로 redirect하는 class

BIN
Dev/OHV/Assambly/GSG.NET.dll


BIN
Dev/OHV/Assambly/GSG.NET.pdb


BIN
Dev/OHV/Assambly/NetMq/AsyncIO.dll


BIN
Dev/OHV/Assambly/NetMq/JetBrains.Annotations.dll


BIN
Dev/OHV/Assambly/NetMq/NaCl.dll


BIN
Dev/OHV/Assambly/NetMq/NetMQ.dll


BIN
Dev/OHV/Assambly/NetMq/NetMQ.pdb


Разница между файлами не показана из-за своего большого размера
+ 10339 - 0
Dev/OHV/Assambly/NetMq/NetMQ.xml


BIN
Dev/OHV/Assambly/NetMq/System.Buffers.dll


BIN
Dev/OHV/Assambly/NetMq/System.Memory.dll


BIN
Dev/OHV/Assambly/NetMq/System.Runtime.CompilerServices.Unsafe.dll


BIN
Dev/OHV/Assambly/NetMq/System.ValueTuple.dll


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

@@ -265,20 +265,11 @@ 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 )

+ 21 - 16
Dev/OHV/VehicleControlSystem/Managers/HostManager.cs

@@ -18,7 +18,8 @@ namespace VehicleControlSystem.Managers
     /// </summary>
     public class HostManager : IDisposable
     {
-        static Logger logger = Logger.GetLogger( "Host" );
+        static Logger loggerHost = Logger.GetLogger( "Host" );
+        static Logger logger = Logger.GetLogger();
 
         OHVConnector.Manager manager = new OHVConnector.Manager();
         IEventAggregator eventAggregator = null;
@@ -332,12 +333,12 @@ namespace VehicleControlSystem.Managers
         #region Event Method
         private void Manager_OnSent( OHVConnector.OCSMessage msg )
         {
-            logger.I( "[Sent] : " + msg.LogFormat() );
+            loggerHost.I( "[Sent] : " + msg.LogFormat() );
         }
 
         private void Manager_OnRecd( OHVConnector.OCSMessage msg )
         {
-            logger.I( "[Received] : " + msg.LogFormat() );
+            loggerHost.I( "[Received] : " + msg.LogFormat() );
 
             switch ( msg.Kind )
             {
@@ -410,27 +411,30 @@ namespace VehicleControlSystem.Managers
         {
             this.Reply( msg );
 
+            var cmd = new Command();
+
             var info = sql.VehicleInfoDAL.GetInfo();
             if ( info.MachineMode == eMachineMode.LocalMode )
             {
-                logger.E( $"[OCS] Cmd - Current Mode Local Mode " );
+                loggerHost.E( $"[OCS] Cmd - Current Mode Local Mode " );
                 return;
             }
 
             var hasCommand = this.sql.CommandDAL.GetCmd();
             if ( hasCommand != null )
             {
-                //Todo: 충전 중에는 어떻게 하지???
                 if ( !hasCommand.IsSecondCommanded )
                     sql.CommandDAL.Delete( hasCommand );
                 else
                 {
-                    logger.E( $"[OCS] Cmd - {msg.Kind} Message Tag [{msg.Tag}] - Already Load/Unload " );
+                    loggerHost.E( $"[OCS] Cmd - {msg.Kind} Message Tag [{msg.Tag}] - Already Load/Unload " );
                     return;
                 }
+                cmd.ByWho = eCommandByWho.HostOverWrite;
             }
+            else
+                cmd.ByWho = eCommandByWho.Host;
 
-            var cmd = new Command();
 
             switch ( msg.SubCode )
             {
@@ -451,26 +455,27 @@ namespace VehicleControlSystem.Managers
             }
 
             //Todo: 등록 되어 있는 경로 가 있는 지 확인 필요.
-            var route = this.sql.RouteDal.GetRouteFromOCSMatchID( msg.Tag );
-            if ( route == null )
-            {
-                logger.E( $"[OCS] Message Tag [{msg.Tag}] - not found route" );
-                return;
-            }
+            //var route = this.sql.RouteDal.GetRouteFromOCSMatchID( msg.Tag );
+            //if ( route == null )
+            //{
+            //    loggerHost.E( $"[OCS] Message Tag [{msg.Tag}] - not found route" );
+            //    return;
+            //}
 
-            cmd.TargetID = route.Name;
+            cmd.TargetID = msg.Tag;
 
             this.sql.CommandDAL.Add( cmd );
+            logger.I( $"[Command] - Add Host : Target {cmd.TargetID} / Type {cmd.Type}" );
         }
 
         private void Manager_OnT3Timeout( OHVConnector.OCSMessage msg )
         {
-            logger.E( "[TimeOut] : " + msg.LogFormat() );
+            loggerHost.E( "[TimeOut] : " + msg.LogFormat() );
         }
 
         private void Manager_OnLog( string id, string log )
         {
-            logger.I( "[Log] : " + log );
+            loggerHost.I( "[Log] : " + log );
         }
 
         private void Manager_OnDiscontd( string id, Exception e )

Dev/SerialModule/BatteryTabos/BatteryTabos/.vs/BatteryTabos/v16/Server/sqlite3/db.lock → Dev/OHVDriveLogger/OHVDriveLogger/.vs/OHVDriveLogger/v16/Server/sqlite3/db.lock


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


+ 25 - 0
Dev/OHVDriveLogger/OHVDriveLogger/OHVDriveLogger.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}") = "OHVDriveLogger", "OHVDriveLogger\OHVDriveLogger.csproj", "{2C4A899E-68A7-45AB-BB81-65D0D941AF1E}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{2C4A899E-68A7-45AB-BB81-65D0D941AF1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{2C4A899E-68A7-45AB-BB81-65D0D941AF1E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{2C4A899E-68A7-45AB-BB81-65D0D941AF1E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{2C4A899E-68A7-45AB-BB81-65D0D941AF1E}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {90CE6F42-0D9F-422F-9BDA-D01842CFFA9F}
+	EndGlobalSection
+EndGlobal

+ 1 - 1
Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryCommTest/App.config

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

+ 106 - 0
Dev/OHVDriveLogger/OHVDriveLogger/OHVDriveLogger/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>

+ 73 - 0
Dev/OHVDriveLogger/OHVDriveLogger/OHVDriveLogger/FTPLogger.cs

@@ -0,0 +1,73 @@
+using FluentFTP;
+using GSG.NET.FileSystem;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace OHVDriveLogger
+{
+    public class FTPLogger
+    {
+        public void FTPUpload()
+        {
+            using ( var ftp = new FtpClient( "127.0.0.1", "ftptest", "ftptest" ) )
+            {
+                ftp.Connect();
+
+                // upload a folder and all its files
+                ftp.UploadDirectory( @"C:\website\videos\", @"/public_html/videos", FtpFolderSyncMode.Update );
+
+                // upload a folder and all its files, and delete extra files on the server
+                //ftp.UploadDirectory( @"C:\website\assets\", @"/public_html/assets", FtpFolderSyncMode.Mirror );
+            }
+
+        }
+
+        public void FTPDownload()
+        {
+            using ( var ftp = new FtpClient( "192.168.0.20", "KV", "1234" ) )
+            {
+                ftp.Connect();
+
+                // download a folder and all its files
+                ftp.DownloadDirectory( @"C:\LOG\FTP\", @"/0_CARD/log0/", FtpFolderSyncMode.Update );
+
+                //ftp.DeleteFile( "/0_CARD/log0" );
+            }
+        }
+
+        void FTPServerDeleteFile()
+        {
+            using ( var ftp = new FtpClient( "192.168.0.20", "KV", "1234" ) )
+            {
+                ftp.Connect();
+                ftp.DeleteDirectory( "/0_CARD/log0/" );
+            }
+        }
+
+        async Task DeleteDirectoryAsync()
+        {
+            var token = new CancellationToken();
+            using ( var conn = new FtpClient( "127.0.0.1", "ftptest", "ftptest" ) )
+            {
+                await conn.ConnectAsync( token );
+
+                await conn.DeleteFileAsync( "/full/or/relative/path/to/file" );
+            }
+        }
+
+        /// <summary>
+        /// FTP 전송 후에 파일을 삭제 용도로.
+        /// </summary>
+        /// <param name="path"></param>
+        void DeleteLocalFiles(string path )
+        {
+            FileUtils.DeleteFileIfExist(path);
+        }
+
+
+    }
+}

+ 82 - 0
Dev/OHVDriveLogger/OHVDriveLogger/OHVDriveLogger/FormMain.Designer.cs

@@ -0,0 +1,82 @@
+namespace OHVDriveLogger
+{
+    partial class FormMain
+    {
+        /// <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.lblPLCCommState = new System.Windows.Forms.Label();
+            this.label55 = new System.Windows.Forms.Label();
+            this.SuspendLayout();
+            // 
+            // lblPLCCommState
+            // 
+            this.lblPLCCommState.BackColor = System.Drawing.Color.Silver;
+            this.lblPLCCommState.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.lblPLCCommState.Font = new System.Drawing.Font("Segoe UI Symbol", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.lblPLCCommState.ForeColor = System.Drawing.Color.Black;
+            this.lblPLCCommState.Location = new System.Drawing.Point(12, 34);
+            this.lblPLCCommState.Name = "lblPLCCommState";
+            this.lblPLCCommState.Padding = new System.Windows.Forms.Padding(5, 0, 0, 0);
+            this.lblPLCCommState.Size = new System.Drawing.Size(86, 30);
+            this.lblPLCCommState.TabIndex = 11;
+            this.lblPLCCommState.Text = "Unknown";
+            this.lblPLCCommState.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // label55
+            // 
+            this.label55.BackColor = System.Drawing.Color.SteelBlue;
+            this.label55.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.label55.Font = new System.Drawing.Font("Segoe UI Symbol", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.label55.ForeColor = System.Drawing.Color.White;
+            this.label55.Location = new System.Drawing.Point(12, 9);
+            this.label55.Name = "label55";
+            this.label55.Size = new System.Drawing.Size(86, 24);
+            this.label55.TabIndex = 12;
+            this.label55.Text = "PLC COMM";
+            this.label55.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // FormMain
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.BackColor = System.Drawing.SystemColors.ActiveBorder;
+            this.ClientSize = new System.Drawing.Size(419, 72);
+            this.Controls.Add(this.lblPLCCommState);
+            this.Controls.Add(this.label55);
+            this.Name = "FormMain";
+            this.Text = "OHV Drive Logger";
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        public System.Windows.Forms.Label lblPLCCommState;
+        private System.Windows.Forms.Label label55;
+    }
+}
+

+ 71 - 0
Dev/OHVDriveLogger/OHVDriveLogger/OHVDriveLogger/FormMain.cs

@@ -0,0 +1,71 @@
+using GSG.NET.Logging;
+using GSG.NET.PLC;
+using GSG.NET.PLC.KNC;
+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;
+
+namespace OHVDriveLogger
+{
+    public partial class FormMain : Form
+    {
+        Logger logger = Logger.GetLogger();
+        KncManager plc = new KncManager();
+        
+        public FormMain()
+        {
+            InitializeComponent();
+
+            this.Load += FormMain_Load;
+            this.FormClosing += FormMain_FormClosing;
+        }
+
+        private void FormMain_FormClosing( object sender, FormClosingEventArgs e )
+        {
+            this.plc.Disconnect();
+        }
+
+        private void FormMain_Load( object sender, EventArgs e )
+        {
+            this.plc.Config.Id = "KV8000";
+            this.plc.Config.IpAddress = "192.168.0.20";
+            this.plc.Config.Port = 8501; //5000
+            this.plc.Config.MonitorInterval = 500;
+
+            var grpB = new KncGroup { Device = KncDevice.MR, Name = "MR" };
+            grpB.AddBitBlock( new KncBitBlock { Name = "DRIVE_LOGGING_ONOFF",Address=100, SubNo=0 } );
+
+            this.plc.AddGroup( grpB );
+
+            this.plc.OnLog += logger.I;
+            this.plc.OnBitChanged += Plc_OnBitChanged;
+            this.plc.OnConnect += Plc_OnConnect;
+            this.plc.OnDisconnect += Plc_OnDisconnect;
+
+            this.plc.Connect();
+        }
+
+        private void Plc_OnDisconnect( string id )
+        {
+            lblPLCCommState.BackColor = Color.OrangeRed;
+            lblPLCCommState.Text = "NOT COMM";
+        }
+
+        private void Plc_OnConnect( string id )
+        {
+            lblPLCCommState.BackColor = Color.Lime;
+            lblPLCCommState.Text = "COMM";
+        }
+
+        private void Plc_OnBitChanged( GSG.NET.PLC.Model.BitBlock block )
+        {
+            logger.I( $"[Bit Change] - {block.Name} / {block.IsBitOn}" );
+        }
+    }
+}

+ 120 - 0
Dev/OHVDriveLogger/OHVDriveLogger/OHVDriveLogger/FormMain.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>

+ 44 - 53
Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryCommTest/BatteryCommTest.csproj

@@ -4,15 +4,12 @@
   <PropertyGroup>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProjectGuid>{B791F486-2213-4BF5-9A3F-9CF4264075F8}</ProjectGuid>
+    <ProjectGuid>{2C4A899E-68A7-45AB-BB81-65D0D941AF1E}</ProjectGuid>
     <OutputType>WinExe</OutputType>
-    <RootNamespace>BatteryCommTest</RootNamespace>
-    <AssemblyName>BatteryCommTest</AssemblyName>
-    <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
+    <RootNamespace>OHVDriveLogger</RootNamespace>
+    <AssemblyName>OHVDriveLogger</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
-    <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
-    <WarningLevel>4</WarningLevel>
-    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
     <Deterministic>true</Deterministic>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -35,77 +32,71 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\packages\MSTest.TestFramework.2.1.0\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
+    <Reference Include="FluentFTP">
+      <HintPath>..\..\..\OHV\Assambly\FluentFTP.dll</HintPath>
+    </Reference>
+    <Reference Include="GSG.NET">
+      <HintPath>..\..\..\OHV\Assambly\GSG.NET.dll</HintPath>
+    </Reference>
+    <Reference Include="GSG.NET.PLC">
+      <HintPath>..\..\..\OHV\Assambly\GSG.NET.PLC.dll</HintPath>
     </Reference>
-    <Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\packages\MSTest.TestFramework.2.1.0\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
+    <Reference Include="NetMQ">
+      <HintPath>..\..\..\OHV\Assambly\NetMq\NetMQ.dll</HintPath>
     </Reference>
     <Reference Include="System" />
-    <Reference Include="System.Data" />
-    <Reference Include="System.Xml" />
-    <Reference Include="Microsoft.CSharp" />
     <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.Deployment" />
+    <Reference Include="System.Drawing" />
     <Reference Include="System.Net.Http" />
-    <Reference Include="System.Xaml">
-      <RequiredTargetFramework>4.0</RequiredTargetFramework>
-    </Reference>
-    <Reference Include="WindowsBase" />
-    <Reference Include="PresentationCore" />
-    <Reference Include="PresentationFramework" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
-    <ApplicationDefinition Include="App.xaml">
-      <Generator>MSBuild:Compile</Generator>
-      <SubType>Designer</SubType>
-    </ApplicationDefinition>
-    <Page Include="MainWindow.xaml">
-      <Generator>MSBuild:Compile</Generator>
-      <SubType>Designer</SubType>
-    </Page>
-    <Compile Include="App.xaml.cs">
-      <DependentUpon>App.xaml</DependentUpon>
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="MainWindow.xaml.cs">
-      <DependentUpon>MainWindow.xaml</DependentUpon>
-      <SubType>Code</SubType>
+    <Compile Include="FormMain.cs">
+      <SubType>Form</SubType>
     </Compile>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Properties\AssemblyInfo.cs">
-      <SubType>Code</SubType>
+    <Compile Include="FormMain.Designer.cs">
+      <DependentUpon>FormMain.cs</DependentUpon>
     </Compile>
+    <Compile Include="FTPLogger.cs" />
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="ZmqManager.cs" />
+    <EmbeddedResource Include="FormMain.resx">
+      <DependentUpon>FormMain.cs</DependentUpon>
+    </EmbeddedResource>
+    <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>
-      <DesignTime>True</DesignTime>
       <DependentUpon>Resources.resx</DependentUpon>
     </Compile>
+    <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>
-    <EmbeddedResource Include="Properties\Resources.resx">
-      <Generator>ResXFileCodeGenerator</Generator>
-      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
-    </EmbeddedResource>
-    <None Include="packages.config" />
-    <None Include="Properties\Settings.settings">
-      <Generator>SettingsSingleFileGenerator</Generator>
-      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
-    </None>
   </ItemGroup>
   <ItemGroup>
     <None Include="App.config" />
   </ItemGroup>
+  <ItemGroup />
   <ItemGroup>
-    <ProjectReference Include="..\BatteryTabos\BatteryTabos.csproj">
-      <Project>{915bd4d3-768f-466a-9df0-984f04e5a05f}</Project>
-      <Name>BatteryTabos</Name>
-    </ProjectReference>
+    <None Include="Config\log4net.xml">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 </Project>

+ 50 - 0
Dev/OHVDriveLogger/OHVDriveLogger/OHVDriveLogger/Program.cs

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

+ 12 - 12
Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryTabos/Properties/AssemblyInfo.cs

@@ -5,22 +5,22 @@ using System.Runtime.InteropServices;
 // 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해 
 // 제어됩니다. 어셈블리와 관련된 정보를 수정하려면
 // 이러한 특성 값을 변경하세요.
-[assembly: AssemblyTitle("BatteryTabos")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("BatteryTabos")]
-[assembly: AssemblyCopyright("Copyright ©  2020")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
+[assembly: AssemblyTitle( "OHVDriveLogger" )]
+[assembly: AssemblyDescription( "" )]
+[assembly: AssemblyConfiguration( "" )]
+[assembly: AssemblyCompany( "" )]
+[assembly: AssemblyProduct( "OHVDriveLogger" )]
+[assembly: AssemblyCopyright( "Copyright ©  2020" )]
+[assembly: AssemblyTrademark( "" )]
+[assembly: AssemblyCulture( "" )]
 
 // ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에 
 // 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면
 // 해당 형식에 대해 ComVisible 특성을 true로 설정하세요.
-[assembly: ComVisible(false)]
+[assembly: ComVisible( false )]
 
 // 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다.
-[assembly: Guid("915bd4d3-768f-466a-9df0-984f04e5a05f")]
+[assembly: Guid( "2c4a899e-68a7-45ab-bb81-65d0d941af1e" )]
 
 // 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다.
 //
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
 // 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를
 // 기본값으로 할 수 있습니다.
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion( "1.0.0.0" )]
+[assembly: AssemblyFileVersion( "1.0.0.0" )]

+ 5 - 5
Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryCommTest/Properties/Resources.Designer.cs

@@ -8,7 +8,7 @@
 // </auto-generated>
 //------------------------------------------------------------------------------
 
-namespace BatteryCommTest.Properties
+namespace OHVDriveLogger.Properties
 {
 
 
@@ -19,7 +19,7 @@ namespace BatteryCommTest.Properties
     // 클래스에서 자동으로 생성되었습니다.
     // 멤버를 추가하거나 제거하려면 .ResX 파일을 편집한 다음 /str 옵션을 사용하여
     // ResGen을 다시 실행하거나 VS 프로젝트를 다시 빌드하십시오.
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute( "System.Resources.Tools.StronglyTypedResourceBuilder" , "4.0.0.0" )]
+    [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
@@ -29,8 +29,8 @@ namespace BatteryCommTest.Properties
 
         private static global::System.Globalization.CultureInfo resourceCulture;
 
-        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute( "Microsoft.Performance" , "CA1811:AvoidUncalledPrivateCode" )]
-        internal Resources( )
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute( "Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode" )]
+        internal Resources()
         {
         }
 
@@ -44,7 +44,7 @@ namespace BatteryCommTest.Properties
             {
                 if ( ( resourceMan == null ) )
                 {
-                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager( "BatteryCommTest.Properties.Resources" , typeof( Resources ).Assembly );
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager( "OHVDriveLogger.Properties.Resources", typeof( Resources ).Assembly );
                     resourceMan = temp;
                 }
                 return resourceMan;

Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryCommTest/Properties/Resources.resx → Dev/OHVDriveLogger/OHVDriveLogger/OHVDriveLogger/Properties/Resources.resx


+ 3 - 3
Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryCommTest/Properties/Settings.Designer.cs

@@ -8,16 +8,16 @@
 // </auto-generated>
 //------------------------------------------------------------------------------
 
-namespace BatteryCommTest.Properties
+namespace OHVDriveLogger.Properties
 {
 
 
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute( "Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator" , "11.0.0.0" )]
+    [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() ) ) );
+        private static Settings defaultInstance = ( (Settings)( global::System.Configuration.ApplicationSettingsBase.Synchronized( new Settings() ) ) );
 
         public static Settings Default
         {

+ 7 - 0
Dev/OHVDriveLogger/OHVDriveLogger/OHVDriveLogger/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>

+ 54 - 0
Dev/OHVDriveLogger/OHVDriveLogger/OHVDriveLogger/ZmqManager.cs

@@ -0,0 +1,54 @@
+using GSG.NET.Concurrent;
+using GSG.NET.Logging;
+using NetMQ.Sockets;
+using NetMQ;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OHVDriveLogger
+{
+    public class ZmqManager
+    {
+        Logger logger = Logger.GetLogger();
+
+        SubscriberSocket sub = null;
+        RequestSocket req = null;
+
+        ThreadCancel threadCancel = new ThreadCancel();
+
+        public ZmqManager()
+        {
+            NetMQ.NetMQConfig.Cleanup();
+        }
+
+        void CrateClientSocket()
+        {
+            sub = new SubscriberSocket();
+            sub.Connect( "tcp://127.0.0.1:5565" );
+            sub.Subscribe(string.Empty); //All
+
+            sub.ReceiveReady += Sub_ReceiveReady;
+
+            req = new RequestSocket();
+            req.Connect( "tcp://127.0.0.1:5567" );
+        }
+
+        private void Sub_ReceiveReady( object sender, NetMQ.NetMQSocketEventArgs e )
+        {
+            logger.I( e.Socket.ReceiveMultipartStrings() );
+        }
+
+        string Request(string topic )
+        {
+            this.req.SendFrame( topic );
+
+            if ( this.req.Poll( TimeSpan.FromSeconds( 5 ) ) )
+            {
+
+            }
+        }
+    }
+}

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


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


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


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

@@ -139,6 +139,7 @@ namespace OHVLoggerTest
             this.graph.Connect( 27, 16, 10, null );
             this.graph.Connect( 27, 21, 20, null );
 
+
             //this.Segments.ForEach( s => 
             //{ 
             //    if ( s.Middle == null )

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

@@ -1,105 +0,0 @@
-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;
-        }
-
-
-    }
-}

+ 3 - 1
Dev/OHVLoggerTest/OHVLoggerTest/OHVLoggerTest.csproj

@@ -41,6 +41,9 @@
     <Reference Include="GSG.NET">
       <HintPath>..\..\OHV\Assambly\GSG.NET.dll</HintPath>
     </Reference>
+    <Reference Include="GSG.NET.PLC">
+      <HintPath>..\..\..\..\GSG\GSG\bin\PLC\GSG.NET.PLC.dll</HintPath>
+    </Reference>
     <Reference Include="log4net">
       <HintPath>..\..\OHV\Assambly\log4net.dll</HintPath>
     </Reference>
@@ -77,7 +80,6 @@
     <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" />

BIN
Dev/SerialModule/BatteryTabos/BatteryTabos/.vs/BatteryTabos/v16/Server/sqlite3/storage.ide


+ 0 - 9
Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryCommTest/App.xaml

@@ -1,9 +0,0 @@
-<Application x:Class="BatteryCommTest.App"
-             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-             xmlns:local="clr-namespace:BatteryCommTest"
-             StartupUri="MainWindow.xaml">
-    <Application.Resources>
-         
-    </Application.Resources>
-</Application>

+ 0 - 17
Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryCommTest/App.xaml.cs

@@ -1,17 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-using System.Data;
-using System.Linq;
-using System.Threading.Tasks;
-using System.Windows;
-
-namespace BatteryCommTest
-{
-    /// <summary>
-    /// App.xaml에 대한 상호 작용 논리
-    /// </summary>
-    public partial class App : Application
-    {
-    }
-}

+ 0 - 20
Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryCommTest/MainWindow.xaml

@@ -1,20 +0,0 @@
-<Window x:Class="BatteryCommTest.MainWindow"
-        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
-        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
-        xmlns:local="clr-namespace:BatteryCommTest"
-        mc:Ignorable="d"
-        Title="MainWindow" Height="600" Width="1000"
-        Background="Black">
-
-    <Grid >
-        <Grid Margin="15" Background="Gray">
-            <Button x:Name="SerialOpen" Content="Open" Margin="10,10,822,457" Click="SerialOpen_Click"/>
-            <Button x:Name="SerialClose" Content="Close" Margin="145,10,686,457" Click="SerialClose_Click"/>
-            <Button x:Name="WriteToByte" Content="Write Byte" Margin="10,122,818,345" Click="WriteToByte_Click"/>
-            <Button x:Name="WriteToString" Content="Write String" Margin="149,122,686,345" Click="WriteToString_Click"/>
-            <TextBox x:Name="tbRecv" Margin="10,199,0,0" IsReadOnly="True"/>
-        </Grid>
-    </Grid>
-</Window>

+ 0 - 41
Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryCommTest/MainWindow.xaml.cs

@@ -1,41 +0,0 @@
-using BatteryTabos;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using System.Windows;
-using static BatteryTabos.Manager;
-
-namespace BatteryCommTest
-{
-    /// <summary>
-    /// MainWindow.xaml에 대한 상호 작용 논리
-    /// </summary>
-    public partial class MainWindow : Window
-    {
-        Manager tabos;
-        public MainWindow( )
-        {
-            InitializeComponent();
-
-            this.tabos = new Manager( "COM3" );
-        }
-
-        private void SerialOpen_Click( object sender , RoutedEventArgs e )
-        {
-            this.tabos.Open();
-        }
-
-        private void SerialClose_Click( object sender , RoutedEventArgs e )
-        {
-            this.tabos.Close();
-        }
-
-        private void WriteToByte_Click( object sender , RoutedEventArgs e )
-        {
-            this.tabos.WriteToByte( ePacketType.VCSST );
-        }
-
-        private void WriteToString_Click( object sender , RoutedEventArgs e )
-        {
-            this.tabos.WriteToString();
-        }
-    }
-}

+ 0 - 55
Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryCommTest/Properties/AssemblyInfo.cs

@@ -1,55 +0,0 @@
-using System.Reflection;
-using System.Resources;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using System.Windows;
-
-// 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해 
-// 제어됩니다. 어셈블리와 관련된 정보를 수정하려면
-// 이러한 특성 값을 변경하세요.
-[assembly: AssemblyTitle( "BatteryCommTest" )]
-[assembly: AssemblyDescription( "" )]
-[assembly: AssemblyConfiguration( "" )]
-[assembly: AssemblyCompany( "" )]
-[assembly: AssemblyProduct( "BatteryCommTest" )]
-[assembly: AssemblyCopyright( "Copyright ©  2020" )]
-[assembly: AssemblyTrademark( "" )]
-[assembly: AssemblyCulture( "" )]
-
-// ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에 
-// 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면
-// 해당 형식에 대해 ComVisible 특성을 true로 설정하세요.
-[assembly: ComVisible( false )]
-
-//지역화 가능 애플리케이션 빌드를 시작하려면 다음을 설정하세요.
-//.csproj 파일에서 <PropertyGroup> 내에 <UICulture>CultureYouAreCodingWith</UICulture>를
-//설정하십시오. 예를 들어 소스 파일에서 영어(미국)를
-//사용하는 경우 <UICulture>를 en-US로 설정합니다. 그런 다음 아래
-//NeutralResourceLanguage 특성의 주석 처리를 제거합니다. 아래 줄의 "en-US"를 업데이트하여
-//프로젝트 파일의 UICulture 설정과 일치시킵니다.
-
-//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
-
-
-[assembly: ThemeInfo(
-    ResourceDictionaryLocation.None , //테마별 리소스 사전의 위치
-                                      //(페이지 또는 응용 프로그램 리소스 사진에
-                                      // 리소스가 없는 경우에 사용됨)
-    ResourceDictionaryLocation.SourceAssembly //제네릭 리소스 사전의 위치
-                                              //(페이지 또는 응용 프로그램 리소스 사진에
-                                              // 리소스가 없는 경우에 사용됨)
-)]
-
-
-// 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다.
-//
-//      주 버전
-//      부 버전 
-//      빌드 번호
-//      수정 버전
-//
-// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를
-// 기본값으로 할 수 있습니다.
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion( "1.0.0.0" )]
-[assembly: AssemblyFileVersion( "1.0.0.0" )]

+ 0 - 7
Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryCommTest/Properties/Settings.settings

@@ -1,7 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
-  <Profiles>
-    <Profile Name="(Default)" />
-  </Profiles>
-  <Settings />
-</SettingsFile>

+ 0 - 4
Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryCommTest/packages.config

@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
-  <package id="MSTest.TestFramework" version="2.1.0" targetFramework="net472" />
-</packages>

+ 0 - 31
Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryTabos.sln

@@ -1,31 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.29709.97
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BatteryTabos", "BatteryTabos\BatteryTabos.csproj", "{915BD4D3-768F-466A-9DF0-984F04E5A05F}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BatteryCommTest", "BatteryCommTest\BatteryCommTest.csproj", "{B791F486-2213-4BF5-9A3F-9CF4264075F8}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Any CPU = Debug|Any CPU
-		Release|Any CPU = Release|Any CPU
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{915BD4D3-768F-466A-9DF0-984F04E5A05F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{915BD4D3-768F-466A-9DF0-984F04E5A05F}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{915BD4D3-768F-466A-9DF0-984F04E5A05F}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{915BD4D3-768F-466A-9DF0-984F04E5A05F}.Release|Any CPU.Build.0 = Release|Any CPU
-		{B791F486-2213-4BF5-9A3F-9CF4264075F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{B791F486-2213-4BF5-9A3F-9CF4264075F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{B791F486-2213-4BF5-9A3F-9CF4264075F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{B791F486-2213-4BF5-9A3F-9CF4264075F8}.Release|Any CPU.Build.0 = Release|Any CPU
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-	GlobalSection(ExtensibilityGlobals) = postSolution
-		SolutionGuid = {A2B2AE46-20C3-48D4-A0DB-8F683C722D2B}
-	EndGlobalSection
-EndGlobal

+ 0 - 59
Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryTabos/BatteryTabos.csproj

@@ -1,59 +0,0 @@
-<?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>{915BD4D3-768F-466A-9DF0-984F04E5A05F}</ProjectGuid>
-    <OutputType>Library</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>BatteryTabos</RootNamespace>
-    <AssemblyName>BatteryTabos</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="GSG.NET">
-      <HintPath>..\..\..\..\OHV\Assambly\GSG.NET.dll</HintPath>
-    </Reference>
-    <Reference Include="GSG.NET.WPF">
-      <HintPath>..\..\..\..\OHV\Assambly\GSG.NET.WPF.dll</HintPath>
-    </Reference>
-    <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="Config.cs" />
-    <Compile Include="Delegates.cs" />
-    <Compile Include="EnumBatteryStatus.cs" />
-    <Compile Include="Manager.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="QueObject.cs" />
-    <Compile Include="Rs232c.cs" />
-  </ItemGroup>
-  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
-</Project>

+ 0 - 36
Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryTabos/Config.cs

@@ -1,36 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace BatteryTabos
-{
-    public class Config
-    {
-        public double Voltage { get; set; }
-        public double Current { get; set; }
-        public double SOC { get; set; }
-        public double BatteryStatus { get; set; }
-        public double ChargeTime { get; set; }
-        public double DisChargeTime { get; set; }
-        public double Temperature { get; set; }
-        public double SOH { get; set; }
-        public double Capacity { get; set; }
-        public double Energy { get; set; }
-
-        public Config()
-        {
-            Voltage = -1;
-            Current = -1;
-            SOC = -1;
-            BatteryStatus = -1;
-            ChargeTime = -1;
-            DisChargeTime = -1;
-            Temperature = -1;
-            SOH = -1;
-            Capacity = -1;
-            Energy = -1;
-        }
-    }
-}

+ 0 - 36
Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryTabos/Delegates.cs

@@ -1,36 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace BatteryTabos
-{
-    public delegate void DlgId(string _id);
-    public delegate void DlgVoltage(double _value);
-    public delegate void DlgCurrent(double _value);
-    public delegate void DlgSOC(double _value);
-    public delegate void DlgBattery(double _value);
-    public delegate void DlgCharge(double _value);
-    public delegate void DlgDisCharge(double _value);
-    public delegate void DlgTemperature(double _value);
-    public delegate void DlgSOH(double _value);
-    public delegate void DlgCapacity(double _value);
-    public delegate void DlgEnergy(double _value);
-
-    public partial class Manager
-    {
-        public event DlgId OnConnect;
-
-        public event DlgVoltage OnVoltage;
-        public event DlgCurrent OnCurrent;
-        public event DlgSOC OnSOC;
-        public event DlgBattery OnBattery;
-        public event DlgCharge OnCharge;
-        public event DlgDisCharge OnDisCharge;
-        public event DlgTemperature OnTemperature;
-        public event DlgSOH OnSOH;
-        public event DlgCapacity OnCapacity;
-        public event DlgEnergy OnEnergy;
-    }
-}

+ 0 - 24
Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryTabos/EnumBatteryStatus.cs

@@ -1,24 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace BatteryTabos
-{
-    /// <summary>
-    /// Battery Status Bit Flag
-    /// 2^7 = 127
-    /// </summary>
-
-    public enum E_BatteryStatus
-    {
-        HIGH_CURRENT = 0,
-        LOW_CURRENT,
-        OVER_CHARGE_CURRENT,
-        OVER_DISCHARGE_CURRENT,
-        HIGH_TEMPERATURE,
-        LOW_TEMPERATURE,
-        BMU_ERROR
-    }
-}

+ 0 - 276
Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryTabos/Manager.cs

@@ -1,276 +0,0 @@
-using GSG.NET.Concurrent;
-using GSG.NET.Utils;
-using System;
-using System.Collections.Generic;
-using System.IO.Ports;
-using System.Linq;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace BatteryTabos
-{
-    public partial class Manager
-    {
-        #region Total Packet Data
-        readonly byte StartSentence1 = 0xAF;
-        readonly byte StartSentence2 = 0xFA;
-        readonly byte Address = 0x60;
-        readonly byte Length = 0x05;
-        readonly byte ReqCommand = 0x01;
-        readonly byte Order = 0x60;
-        readonly byte Kind1 = 0x7F;
-        readonly byte Kind2 = 0x07;
-        readonly byte _CheckSum = 0x4C;
-        readonly byte EndSentence1 = 0xAF;
-        readonly byte EndSentence2 = 0xA0;
-
-        readonly byte SendCommand = 0x02;
-        readonly byte BatteryCommand = 0x03;
-        readonly byte BatteryDataErrorCommand = 0x1F;
-        #endregion
-
-        public enum ePacketType
-        {
-            VCSST = 0, // Voltage, Current, Soc, State
-            SCTDCT,    // Soh, ChargeTime, DisChargeTime
-        }
-        public ePacketType packetType { get; set; }
-
-        Rs232c battery;
-        Config _config { get; set; }
-
-        byte[] _allpacket;
-
-        Queue<QueObject> QQ = new Queue<QueObject>();
-
-        Thread QW;
-
-        public bool IsOpen
-        {
-            get { return battery.serial.IsOpen; }
-        }
-
-        byte[] packet;
-
-        public Manager( string _com )
-        {
-            this._config = new Config();
-
-            this.battery = new Rs232c( _com );
-
-            /*event Thread Pull Start*/
-            QW = ThreadUtils.Invoke( QueWorker );
-
-            //this.battery.Open();
-        }
-
-        public Int32 Checksum(byte[] _checksum)
-        {
-            Int32 check = 0;
-            for(int i = 2; i < _checksum[3]+3; i++ )
-            {
-                check += _checksum[ i ];
-            }
-
-            return check;
-        }
-
-        public void Open( )
-        {
-            if ( this.battery != null && !this.battery.serial.IsOpen )
-            {
-                this.battery.Open();
-
-                this.battery.serial.DataReceived += Receive;
-
-                System.Diagnostics.Debug.WriteLine( $"[Serial] - Open {this.battery.serial.PortName} -" );
-            }
-        }
-
-        public void Close( )
-        {
-            if ( this.battery != null && this.battery.serial.IsOpen )
-            {
-                this.battery.Close();
-                System.Diagnostics.Debug.WriteLine( $"[Serial] - Close -" );
-            }
-        }
-
-        private void Receive( object sender , SerialDataReceivedEventArgs e )
-        { 
-            try
-            {
-                if ( this.battery.serial.IsOpen && this.battery.serial != null )
-                {
-                    var recv = new Byte[ this.battery.serial.BytesToRead ];
-                    this.battery.serial.Read( recv , 0 , recv.Length );
-                    ByteParse( recv );
-
-                    System.Diagnostics.Debug.WriteLine( $"[Serial] - Recv :{recv} -" );
-                }
-            }
-            catch ( Exception ex ) { }
-        }
-
-        private void ByteParse( Byte[] data )
-        {
-            //var rt = CheckSum(data);
-            //if(rt){}
-
-            var V = ( (int)data[6]*256 + (int)data[7] ) * 0.01;
-
-            var A = ( data[ 8 ] * 256 + data[ 9 ] ) * 0.01;
-
-            var SOC = ( data[ 10 ] * 256 + data[ 11 ] );
-
-            var B = ( data[ 12 ] * 256 + data[ 13 ] );
-
-            var CT = ( data[ 14 ] * 256 + data[ 15 ] );
-
-            var DCT = ( data[ 16 ] * 256 + data[ 17 ] );
-
-            var T = ( data[ 18 ] * 256 + data[ 19 ] ) * 0.1;
-
-            var SOH = ( data[ 20 ] * 256 + data[ 21 ] );
-
-            var Cap = ( data[ 22 ] * 256 + data[ 23 ] ) * 0.01;
-
-            var E = ( data[ 24 ] * 256 + data[ 25 ] ) * 0.1;
-        }
-
-        private void QueWorker( )
-        {
-            for (; ; )
-            {
-                if(this.QQ.Count > 0)
-                {
-                    try
-                    {
-                        var qo = this.QQ.Dequeue();
-                        if ( qo is QoConnect ) { DelegateUtils.Invoke( OnConnect , this.battery.serial.PortName ); }
-                        else if ( qo is QoVoltage ) { DelegateUtils.Invoke( OnVoltage , _config.Voltage ); }
-                        else if ( qo is QoCurrent ) { DelegateUtils.Invoke( OnCurrent , _config.Current ); }
-                        else if ( qo is QoSOC ) { DelegateUtils.Invoke( OnSOC , _config.SOC ); }
-                        else if ( qo is QoBattery ) { DelegateUtils.Invoke( OnBattery , _config.BatteryStatus ); }
-                        else if ( qo is QoCharge ) { DelegateUtils.Invoke( OnCharge , _config.ChargeTime ); }
-                        else if ( qo is QoDisCharge ) { DelegateUtils.Invoke( OnDisCharge , _config.DisChargeTime ); }
-                        else if ( qo is QoTemperature ) { DelegateUtils.Invoke( OnTemperature , _config.Temperature ); }
-                        else if ( qo is QoCapacity ) { DelegateUtils.Invoke( OnCapacity , _config.Capacity ); }
-                        else if ( qo is QoEnergy ) { DelegateUtils.Invoke( OnEnergy , _config.Energy ); }
-                        else { /* null */ }
-                    }
-                    catch ( Exception ex ) { }
-                }
-            }
-        }
-
-        public void WriteToByte( ePacketType packetType )
-        {
-            try
-            {
-                if ( this.IsOpen && this.battery.serial != null )
-                {
-                    byte[] _data = null;
-                    switch ( packetType )
-                    {
-                        case ePacketType.VCSST:
-                            _data = OrderToInfomation();
-                            break;
-                        case ePacketType.SCTDCT:
-                            _data = OrderToCharging();
-                            break;
-                    }
-                    
-                    this.battery.serial.Write( _data , 0 , _data.Length );
-
-                    System.Diagnostics.Debug.WriteLine( $"[Serial] - Write : {_allpacket.ToString()} -" );
-                }
-            }
-            catch ( Exception ex ) { }
-        }
-
-        private byte[] OrderToInfomation()
-        {
-            packet = new byte[ 11 ];
-            packet[ 0 ] = 0xAF;
-            packet[ 1 ] = 0xFA;
-            packet[ 2 ] = 0x61; //addr
-            packet[ 3 ] = 0x05;
-            packet[ 4 ] = 0x01;
-            packet[ 5 ] = 0x61;
-            packet[ 6 ] = 0x4F; // kind 1
-            packet[ 7 ] = 0x00; // kind 2
-            packet[ 8 ] = 0x17; //Checksum();
-            packet[ 9 ] = 0xAF;
-            packet[ 10 ] = 0xA0;
-
-            return packet;
-        }
-
-        private byte[] OrderToCharging()
-        {
-            packet = new byte[ 11 ];
-            packet[ 0 ] = 0xAF;
-            packet[ 1 ] = 0xFA;
-            packet[ 2 ] = 0x61; //addr
-            packet[ 3 ] = 0x05;
-            packet[ 4 ] = 0x01;
-            packet[ 5 ] = 0x61; //addr
-            packet[ 6 ] = 0x30; // kind 1
-            packet[ 7 ] = 0x07; // kind 2
-            packet[ 8 ] = 0x17; //0x4E; //0x17;//CheckSum( pp );
-            packet[ 9 ] = 0xAF;
-            packet[ 10 ] = 0xA0;
-
-            return packet;
-        }
-
-        public void WriteToString( /*string _packet*/ )
-        {
-            //var _packet = Encoding.Default.GetString( _allpacket );
-            try
-            {
-                if ( this.IsOpen )
-                {
-                    //this.battery.serial.Write( _packet );
-                }
-            }
-            catch ( Exception ex ) { throw new Exception(); }
-        }
-
-        private bool CheckSum( byte[] _data )
-        {
-            bool ret = false;
-
-            int size = _data.Length;
-            var cdLow = _data[ size - 2 ];
-            var cdHigh = _data[ size - 3 ];
-            var cdResult = cdHigh + cdLow;
-
-            var csData = _data[ 2 ] + _data[ 3 ] + _data[ 4 ] + _data[ 5 ] + _data[ 6 ] + _data[ 7 ] + _data[ 8 ] + _data[ 9 ];
-
-            if ( cdResult == csData )
-            {
-                ret = true;
-                return ret;
-            }
-            else ret = false;
-
-            return ret;
-        }
-
-        private void BatteryState( byte _data )
-        {
-            var batteryState = BitConverter.GetBytes( _data );
-        }
-
-
-        /*
-         * 미처리 작업 내용
-         * Enque 시 값이 같으면 return 어떻게할? 
-         * Deque 시 값이 같으면 return 어떻게할?
-         * Battery 상태 값 표기 어찌할? 2^7 = 조합가능 개수 2^7개 만큼
-         */
-    }
-}

+ 0 - 26
Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryTabos/QueObject.cs

@@ -1,26 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace BatteryTabos
-{
-    public abstract class QueObject
-    {
-        public object Arg0 { get; set; }
-        public object Arg1 { get; set; }
-    }
-
-    public class QoConnect : QueObject { }
-    public class QoVoltage : QueObject { }
-    public class QoCurrent : QueObject { }
-    public class QoSOC : QueObject { }
-    public class QoBattery : QueObject { }
-    public class QoCharge : QueObject { }
-    public class QoDisCharge : QueObject { }
-    public class QoTemperature : QueObject { }
-    public class QoSOH : QueObject { }
-    public class QoCapacity : QueObject { }
-    public class QoEnergy : QueObject { }
-}

+ 0 - 118
Dev/SerialModule/BatteryTabos/BatteryTabos/BatteryTabos/Rs232c.cs

@@ -1,118 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO.Ports;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace BatteryTabos
-{
-    public class Rs232c
-    {
-        public SerialPort serial { get; set; }
-
-
-        public string Port
-        {
-            get => this.serial.PortName;
-            set
-            {
-                if ( this.serial.PortName == value ) return;
-                this.serial.PortName = value;
-            }
-        }
-        public int BaudRate
-        {
-            get => this.serial.BaudRate;
-            set
-            {
-                if ( this.serial.BaudRate == value ) return;
-                this.serial.BaudRate = value;
-            }
-        }
-        public int DataBits
-        {
-            get => this.serial.DataBits;
-            set
-            {
-                if ( this.serial.DataBits == value ) return;
-                this.serial.DataBits = value;
-            }
-        }
-        public Parity Parity
-        {
-            get => this.serial.Parity;
-            set
-            {
-                if ( this.serial.Parity == value ) return;
-                this.serial.Parity = value;
-            }
-        }
-        public StopBits StopBits
-        {
-            get => this.serial.StopBits;
-            set
-            {
-                if ( this.serial.StopBits == value ) return;
-                this.serial.StopBits = value;
-            }
-        }
-        public int ReadTimeout
-        {
-            get => this.serial.ReadTimeout;
-            set
-            {
-                if ( this.serial.ReadTimeout == value ) return;
-                this.serial.ReadTimeout = value;
-            }
-        }
-        public int WriteTimeout
-        {
-            get => this.serial.WriteTimeout;
-            set
-            {
-                if ( this.serial.WriteTimeout == value ) return;
-                this.serial.WriteTimeout = value;
-            }
-        }
-
-
-        /// <summary>
-        ///  ctor Value
-        /// <para>_comPort = string Port Name</para>
-        /// <para>setMode = false 세부항목 설정</para> 
-        /// </summary>
-
-        public Rs232c( string _comPort , bool setMode = false )
-        {
-            if ( !setMode )
-            {
-                this.serial = new SerialPort
-                {
-                    PortName = _comPort,
-                    BaudRate = 19200 ,
-                    DataBits = 8 ,
-                    Parity = Parity.None ,
-                    StopBits = StopBits.One ,
-                    //Encoding = Encoding.ASCII
-                };
-            }
-            else this.serial = new SerialPort( _comPort );
-        }
-
-        public void Open( )
-        {
-            this.serial.Open();
-        }
-
-        public void Close( )
-        {
-            this.serial.Close();
-        }
-
-        public void Write( )
-        {
-
-        }
-    }
-}