ソースを参照

현장 Update

SK.Kang 6 年 前
コミット
fc60d497a2

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

@@ -40,7 +40,7 @@ namespace OHVProtocolClient
             QuartzUtils.Init( 10 );
 
             manager = new Manager();
-            manager.Config = new Config() { ID = "S0", HostID="V0001" };
+            manager.Config = new Config() {IpAddress="192.168.127.20", Port=5000, ID = "S0", HostID="V0002" };
             manager.Connect(true);
 
             manager.OnRecd += Cn_OnRecd;

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

@@ -867,162 +867,6 @@
             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/OHVConnector.dll


BIN
Dev/OHV/Assambly/OHVConnector.pdb


+ 58 - 0
Dev/OHV/Assambly/OHVDrive/OHVdrive.h

@@ -0,0 +1,58 @@
+#pragma once
+
+#ifdef OHV_DRIVE_EXPORTS
+#define OHV_DRIVE_API __declspec(dllexport)
+#else
+#define OHV_DRIVE_API __declspec(dllimport)
+#endif
+
+/*
+ 1. OHVdriveCrete()
+ 2. OHVdriveBegin()
+ 3. ..... do something ....
+ 4. OHVdriveEnd();
+ 5. OHVdriveDelete();
+*/
+
+extern "C" OHV_DRIVE_API void OHVdriveCreate(void);
+extern "C" OHV_DRIVE_API void OHVdriveDelete(void);
+
+extern "C" OHV_DRIVE_API void OHVdriveBegin(void);
+extern "C" OHV_DRIVE_API void OHVdriveEnd(void);
+
+// directional roller, 1 = left, -1 = right
+extern "C" OHV_DRIVE_API int OHVdriveGetDesiredSolenoid(void);
+
+
+#ifndef OHV_DRIVE_EXPORTS
+
+
+#endif
+
+//extern "C" OHV_DRIVE_API double addDouble(double a, double b);
+
+// The Fibonacci recurrence relation describes a sequence F
+// where F(n) is { n = 0, a
+//               { n = 1, b
+//               { n > 1, F(n-2) + F(n-1)
+// for some initial integral values a and b.
+// If the sequence is initialized F(0) = 1, F(1) = 1,
+// then this relation produces the well-known Fibonacci
+// sequence: 1, 1, 2, 3, 5, 8, 13, 21, 34, ...
+
+//// Initialize a Fibonacci relation sequence
+//// such that F(0) = a, F(1) = b.
+//// This function must be called before any other function.
+//extern "C" OHV_DRIVE_API void fibonacci_init(
+//	const unsigned long long a, const unsigned long long b);
+//
+//// Produce the next value in the sequence.
+//// Returns true on success and updates current value and index;
+//// false on overflow, leaves current value and index unchanged.
+//extern "C" OHV_DRIVE_API bool fibonacci_next();
+//
+//// Get the current value in the sequence.
+//extern "C" OHV_DRIVE_API unsigned long long fibonacci_current();
+//
+//// Get the position of the current value in the sequence.
+//extern "C" OHV_DRIVE_API unsigned fibonacci_index();

+ 7 - 0
Dev/OHV/Assambly/OHVDrive/logger_default.conf

@@ -0,0 +1,7 @@
+* GLOBAL:
+	FILENAME = "./maha-core.log"
+	TO_FILE = true
+	TO_STANDARD_OUTPUT = true
+	PERFORMANCE_TRACKING = false
+	MAX_LOG_FILE_SIZE = 2097152
+	LOG_FLUSH_THRESHOLD = 100

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

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

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

@@ -85,6 +85,14 @@ namespace OHV.SqliteDAL
                     Desc = "Drive Speed",
                     EditTime = DateTime.Now,
                 },
+                new Config
+                {
+                    ID = ConstString.BatteryCanType,
+                    Name= ConstString.BatteryCanType,
+                    Value = "1",
+                    Desc = "Can Kind",
+                    EditTime = DateTime.Now,
+                },
             } );
 
             context.Set<AxisPositionData>().AddRange( new List<AxisPositionData>()

+ 3 - 2
Dev/OHV/OHV.Vehicle/OHV.Vehicle.csproj

@@ -65,7 +65,7 @@
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote1|AnyCPU'">
     <DebugSymbols>true</DebugSymbols>
-    <OutputPath>\\192.168.127.10\VCS\</OutputPath>
+    <OutputPath>\\192.168.127.10\vcs\</OutputPath>
     <DefineConstants>TRACE;DEBUG</DefineConstants>
     <DebugType>full</DebugType>
     <PlatformTarget>AnyCPU</PlatformTarget>
@@ -290,7 +290,8 @@
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <PropertyGroup>
-    <PostBuildEvent>copy "$(SolutionDir)\Assambly\EzPlus2\*.*" "$(TargetDir)"</PostBuildEvent>
+    <PostBuildEvent>copy "$(SolutionDir)\Assambly\EzPlus2\*.*" "$(TargetDir)"
+copy "$(SolutionDir)\Assambly\OHVDrive\*.*" "$(TargetDir)"</PostBuildEvent>
   </PropertyGroup>
   <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
     <PropertyGroup>

+ 1 - 0
Dev/OHV/VehicleControlSystem/ControlLayer/IO/EzIO.cs

@@ -652,6 +652,7 @@ namespace VehicleControlSystem.ControlLayer.IO
             //    if ( !this._readThread.Join( 3000 ) )
             //        this._readThread.Abort();
             //}
+            LockUtils.Wait( 100 );
             this.threadCancel.StopWaitAll();
 
             this.BoardList.ForEach( b =>

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

@@ -0,0 +1,164 @@
+using GSG.NET.Concurrent;
+using GSG.NET.Logging;
+using OHV.Common.Shareds;
+using OHV.SqliteDAL;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace VehicleControlSystem.ControlLayer.Drive
+{
+    public class GSIDrive : ControlObjectBase
+    {
+        #region Dll Import
+        [DllImport( "OHVdrive.dll" )]
+        static extern void OHVdriveCreate( );
+
+        [DllImport( "OHVdrive.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl )]
+        static extern void OHVdriveBegin();
+
+        [DllImport( "OHVdrive.dll" )]
+        static extern void OHVdriveEnd();
+
+        [DllImport( "OHVdrive.dll" )]
+        static extern void OHVdriveDelete();
+
+        [DllImport( "OHVdrive.dll" )]
+        static extern int OHVdriveGetDesiredSolenoid();
+        #endregion
+
+        Logger logger = Logger.GetLogger();
+
+        public bool IsStop { get; set; }
+
+        double currentPos = 0;
+        public double CurrentPos { get { return this.currentPos; } set { SetField(ref this.currentPos, value); } }
+
+        private string currentTag;
+        public string CurrentTag { get { return currentTag; } set { SetField(ref this.currentTag, value); } }
+
+        private double currentSpeed = 0;
+        public double CurrentSpeed { get { return currentSpeed; } set { SetField(ref this.currentSpeed, value); } }
+
+        private double currentTorque = 0;
+        public double CurrentTorque { get { return currentTorque; } set { SetField(ref this.currentTorque, value); } }
+
+        public bool IsErrorOn { get; set; }
+
+        eSteeringState reqSteeringState = eSteeringState.None;
+        public eSteeringState ReqSteeringState { get { return this.reqSteeringState; } set { SetField( ref this.reqSteeringState, value ); } }
+
+        TaskCancel taskCancel = new TaskCancel();
+        ThreadCancel threadCancel = new ThreadCancel();
+        SqliteManager sql = null;
+
+        public GSIDrive(SqliteManager sql)
+        {
+            this.sql = sql;
+        }
+
+        public void Init()
+        {
+            //OHVdriveCreate();
+            //OHVdriveBegin();
+
+            //this.threadCancel.AddGo( Thread_DriveStateChcker );
+        }
+
+        public void Dispose()
+        {
+            //this.threadCancel.Cancel();
+            //LockUtils.Wait( 50 );
+            //this.threadCancel.StopWaitAll();
+
+            //OHVdriveEnd();
+            //OHVdriveDelete();
+        }
+
+        void Thread_DriveStateChcker()
+        {
+            logger.D( "[Drive] - Thread Drive State Checker Start" );
+
+            while ( !this.threadCancel.Canceled )
+            {
+                try
+                {
+                    LockUtils.Wait( 10 );
+                    this.GetReqSteeringState();
+                }
+                catch ( Exception )
+                {
+
+                    throw;
+                }
+            }
+
+            logger.D( "[Drive] - Thread Drive State Checker Disposed" );
+        }
+
+        void GetReqSteeringState()
+        {
+            var gV = OHVdriveGetDesiredSolenoid();
+            if ( gV < 0 )
+                this.ReqSteeringState = eSteeringState.Right;
+            else
+                this.ReqSteeringState = eSteeringState.Left;
+        }
+
+        public bool MoveToPoint(string point, double velocity)
+        {
+            //var task = Task.Factory.StartNew(() =>
+            //{
+            //    int index = 0;
+            //    while (true)
+            //    {
+            //        LockUtils.Wait(500);
+            //        this.CurrentPos = index++;
+
+            //        if (CurrentPos > 20)
+            //            break;
+            //    }
+            //});
+
+            return true;
+        }
+
+        public void EStop()
+        {
+
+        }
+
+        public bool Stop()
+        {
+            return true;
+        }
+
+        public bool SlowStop()
+        {
+            return true;
+        }
+
+        public void SetObstacleState( eObstacleState state )
+        {
+
+        }
+
+        public bool VelocityChainge(double velocity)
+        {
+            return true;
+        }
+
+        public bool AmpFaultReset()
+        {
+            return true;
+        }
+
+        #region Test Method
+
+        #endregion
+    }
+}

+ 0 - 97
Dev/OHV/VehicleControlSystem/ControlLayer/Motion/GSIMotion.cs

@@ -1,97 +0,0 @@
-using GSG.NET.Concurrent;
-using OHV.Common.Shareds;
-using OHV.SqliteDAL;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace VehicleControlSystem.ControlLayer.Motion
-{
-    /// <summary>
-    /// 나성권 부장이 만든 Dll 을 사용할 클래스
-    /// </summary>
-    public class GSIMotion : ControlObjectBase
-    {
-        public bool IsStop { get; set; }
-
-        double currentPos = 0;
-        public double CurrentPos { get { return this.currentPos; } set { SetField(ref this.currentPos, value); } }
-
-        private string currentTag;
-        public string CurrentTag { get { return currentTag; } set { SetField(ref this.currentTag, value); } }
-
-        private double currentSpeed = 0;
-        public double CurrentSpeed { get { return currentSpeed; } set { SetField(ref this.currentSpeed, value); } }
-
-        private double currentTorque = 0;
-        public double CurrentTorque { get { return currentTorque; } set { SetField(ref this.currentTorque, value); } }
-
-        public bool IsErrorOn { get; set; }
-
-        TaskCancel taskCancel = new TaskCancel();
-        SqliteManager sql = null;
-
-        public GSIMotion(SqliteManager sql)
-        {
-            this.sql = sql;
-        }
-
-        public void Init()
-        {
-        }
-
-        public bool MoveToPoint(string point, double velocity)
-        {
-            //var task = Task.Factory.StartNew(() =>
-            //{
-            //    int index = 0;
-            //    while (true)
-            //    {
-            //        LockUtils.Wait(500);
-            //        this.CurrentPos = index++;
-
-            //        if (CurrentPos > 20)
-            //            break;
-            //    }
-            //});
-
-            return true;
-        }
-
-        public void EStop()
-        {
-
-        }
-
-        public bool Stop()
-        {
-            return true;
-        }
-
-        public bool SlowStop()
-        {
-            return true;
-        }
-
-        public void SetObstacleState( eObstacleState state )
-        {
-
-        }
-
-        public bool VelocityChainge(double velocity)
-        {
-            return true;
-        }
-
-        public bool AmpFaultReset()
-        {
-            return true;
-        }
-
-        #region Test Method
-
-        #endregion
-    }
-}

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

@@ -19,8 +19,11 @@ namespace VehicleControlSystem.ControlLayer.Serial.BatteryTabos
 
         Peak peakCom = null;
         Advantech adCom = null;
+
+        ICanConnecter can = null;
+
         public Config BMUConfig { get; set; }
-        public bool IsConnected { get { return this.adCom.IsConnected; } }
+        public bool IsConnected { get { return this.can.IsConnected; } }
         //public bool IsConnected { get { return this.peakCom.IsConnected; } }
 
         internal Dictionary<eDataKind, ReceivedData> ReceivedDataDic = new Dictionary<eDataKind , DataModel.ReceivedData>();
@@ -99,12 +102,11 @@ namespace VehicleControlSystem.ControlLayer.Serial.BatteryTabos
 
         protected void EnqueueToNet( object o )
         {
-            this.adCom.Enqueue( o );
+            this.can.Enqueue( o );
             
             //this.peakCom.Enqueue( o );
         }
 
-
         protected void _ThPullQueue()
         {
             while ( !cancel.Canceled )
@@ -221,12 +223,12 @@ namespace VehicleControlSystem.ControlLayer.Serial.BatteryTabos
             switch ( select )
             {
                 case eCANSelect.Advantech:
-                    this.adCom = new Advantech( this , "can1" );
-                    this.cancel.AddGo( this.adCom._ThreadPoolingReceiveData );
+                    this.can = new Advantech( this , "can1" );
+                    this.cancel.AddGo( this.can._ThreadPoolingReceiveData );
                     break;
                 case eCANSelect.Peak:
-                    this.peakCom = new Peak( this );
-                    this.cancel.AddGo( this.peakCom._ThreadPoolingReceiveData );
+                    this.can = new Peak( this );
+                    this.cancel.AddGo( this.can._ThreadPoolingReceiveData );
                     break;
             }
         }

+ 36 - 12
Dev/OHV/VehicleControlSystem/ControlLayer/Vehicle.cs

@@ -17,8 +17,8 @@ using OHV.Common.Shareds;
 using OHV.SqliteDAL;
 using Prism.Events;
 using VehicleControlSystem.ControlLayer.Actuator.Cylinder;
+using VehicleControlSystem.ControlLayer.Drive;
 using VehicleControlSystem.ControlLayer.IO;
-using VehicleControlSystem.ControlLayer.Motion;
 using VehicleControlSystem.ControlLayer.Serial.BatteryTabos;
 using VehicleControlSystem.ControlLayer.Serial.DataModel;
 using VehicleControlSystem.Managers;
@@ -308,7 +308,7 @@ namespace VehicleControlSystem.ControlLayer
         #endregion
 
         EzIO iO = null;
-        GSIMotion motion = null;
+        GSIDrive drive = null;
         SqliteManager sql = null;
         Clamp clamp = null;
         Steering steering = null;
@@ -514,7 +514,7 @@ namespace VehicleControlSystem.ControlLayer
             else
                 result = this.clamp.Unlock_Sync();
 
-            if ( this.motion.IsErrorOn )
+            if ( this.drive.IsErrorOn )
                 return 22;
 
             this.VehicleStateProperty = eVehicleState.Idle;
@@ -529,6 +529,8 @@ namespace VehicleControlSystem.ControlLayer
             this.cancel.StopWaitAll();
 
             this.bMUManager.Disconnect();
+
+            this.drive.Dispose();
         }
 
         #region Request Method
@@ -778,7 +780,7 @@ namespace VehicleControlSystem.ControlLayer
             OnOffConveyor( false );
             //Clamp EStop
             this.clamp.ClampEStop();
-            this.motion.EStop();
+            this.drive.EStop();
 
             this.OccurVehicleAlarm( 23 );
         }
@@ -820,7 +822,7 @@ namespace VehicleControlSystem.ControlLayer
             this.taskMoveCancel.Add( CheckCrossPoint() );
 
             //this.BuzzerOnOff(true, eBuzzerKind.Moving);
-            this.motion.MoveToPoint( pointID, 100 );
+            this.drive.MoveToPoint( pointID, 100 );
 
             bool result = Wait4MoveDone();
             //this.BuzzerOnOff(false);
@@ -828,7 +830,7 @@ namespace VehicleControlSystem.ControlLayer
             this.taskMoveCancel.Cancel();
             this.taskMoveCancel.WaitAll();
 
-            if ( motion.IsStop )
+            if ( drive.IsStop )
             {
                 this.IsMoving = false;
                 this.OnMoveFinish?.Invoke();
@@ -866,7 +868,7 @@ namespace VehicleControlSystem.ControlLayer
                     if ( cmd == null )
                     {
                         logger.D( "[Wait Move Done] - Main Command not Exist Motion Stop" );
-                        motion.Stop();
+                        drive.Stop();
                         return true;
                     }
                     else
@@ -876,7 +878,7 @@ namespace VehicleControlSystem.ControlLayer
                     }
                 }
 
-                PhysicalCheckupLogger.Instance.DriveStateLog( this.motion.CurrentSpeed.ToString(), this.motion.CurrentTorque.ToString() );
+                PhysicalCheckupLogger.Instance.DriveStateLog( this.drive.CurrentSpeed.ToString(), this.drive.CurrentTorque.ToString() );
 
                 //20.04.04 Kang Drive 측으로 상태만 알려주면 알아서 처리함.
                 //if ( this.ObstacleStateProperty != eObstacleState.Normal )
@@ -1117,7 +1119,7 @@ namespace VehicleControlSystem.ControlLayer
             //}
 
             this.ObstacleStateProperty = eObstacleState.Normal;
-            this.motion.SetObstacleState( this.ObstacleStateProperty );
+            this.drive.SetObstacleState( this.ObstacleStateProperty );
 
             return false;
         }
@@ -1471,8 +1473,10 @@ namespace VehicleControlSystem.ControlLayer
         }
         void CreateDrive()
         {
-            this.motion = new GSIMotion( this.sql );
-            this.motion.PropertyChanged += Motion_PropertyChanged;
+            this.drive = new GSIDrive( this.sql );
+            this.drive.PropertyChanged += Motion_PropertyChanged;
+
+            this.drive.Init();
         }
         void CreateConveyor()
         {
@@ -1487,7 +1491,9 @@ namespace VehicleControlSystem.ControlLayer
             this.bMUManager.OnChangedReceivedData += BMUManager_OnChangedReceivedData;
             this.bMUManager.OnFirstColtd += BMUManager_OnFirstColtd;
 
-            this.bMUManager.Connect( BMUManager.eCANSelect.Advantech );
+            var setV = sql.ConfigDal.GetValueToInt( ConstString.BatteryCanType );
+            var canType = CastTo<BMUManager.eCANSelect>.From<int>( setV );
+            this.bMUManager.Connect( canType );
         }
 
         private void BMUManager_OnDisconnect( string obj, bool state )
@@ -1668,6 +1674,24 @@ namespace VehicleControlSystem.ControlLayer
                 var v = CastTo<double>.From<object>( newValue );
                 this.CurrentTorque = v;
             }
+
+            if ( e.PropertyName.Equals( "ReqSteeringState" ) )
+            {
+                var v = CastTo<eSteeringState>.From<object>( newValue );
+                switch ( v )
+                {
+                    case eSteeringState.None:
+                        break;
+                    case eSteeringState.Left:
+                        this.steering.ControlSteering(true);
+                        break;
+                    case eSteeringState.Right:
+                        this.steering.ControlSteering();
+                        break;
+                    default:
+                        break;
+                }
+            }
         }
 
         private void Steering_PropertyChanged( object sender, System.ComponentModel.PropertyChangedEventArgs e )

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

@@ -128,7 +128,7 @@
     <Compile Include="ControlLayer\IO\Lib\MOTION_DEFINE_PlusE.cs" />
     <Compile Include="ControlLayer\IO\Lib\MOTION_EziSERVO2_DEFINE.cs" />
     <Compile Include="ControlLayer\IO\QueueObjects.cs" />
-    <Compile Include="ControlLayer\Motion\GSIMotion.cs" />
+    <Compile Include="ControlLayer\Motion\GSIDrive.cs" />
     <Compile Include="ControlLayer\Serial\BatteryTabos\Advantech\Advantech.cs" />
     <Compile Include="ControlLayer\Serial\BatteryTabos\Advantech\AdvCan.cs" />
     <Compile Include="ControlLayer\Serial\BatteryTabos\Advantech\AdvCANIO.cs" />