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