|
@@ -1282,7 +1282,6 @@ namespace TeamAAS_VP.Core
|
|
|
//位置编号
|
|
//位置编号
|
|
|
Int16 positionIndex = plc.ReadNode<Int16>(addressConfig.In_ProductNum.Address);
|
|
Int16 positionIndex = plc.ReadNode<Int16>(addressConfig.In_ProductNum.Address);
|
|
|
SendTaskMessage($"编号:{positionIndex}", MessageLevel.Info);
|
|
SendTaskMessage($"编号:{positionIndex}", MessageLevel.Info);
|
|
|
- await plc.WriteNodeAsync(addressConfig.In_WorkStart.Address, (Int16)0);
|
|
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
@@ -1296,47 +1295,50 @@ namespace TeamAAS_VP.Core
|
|
|
{
|
|
{
|
|
|
if (tuple.value is Int16 state)
|
|
if (tuple.value is Int16 state)
|
|
|
{
|
|
{
|
|
|
- if (state==1)
|
|
|
|
|
|
|
+ if (state==1 || state == 2)
|
|
|
{
|
|
{
|
|
|
SendTaskMessage($"收到停止锁付信号...", MessageLevel.Debug);
|
|
SendTaskMessage($"收到停止锁付信号...", MessageLevel.Debug);
|
|
|
//位置编号
|
|
//位置编号
|
|
|
Int16 positionIndex = plc.ReadNode<Int16>(addressConfig.In_ProductNum.Address);
|
|
Int16 positionIndex = plc.ReadNode<Int16>(addressConfig.In_ProductNum.Address);
|
|
|
SendTaskMessage($"编号:{positionIndex}", MessageLevel.Info);
|
|
SendTaskMessage($"编号:{positionIndex}", MessageLevel.Info);
|
|
|
- //获取当前锁付点
|
|
|
|
|
- var screwPoint = currentProduct.ScrewPoints.FirstOrDefault(p=>p.Number== positionIndex);
|
|
|
|
|
- //获取当前的机器人点位
|
|
|
|
|
- var robot = _robotService.GetAllRobots().FirstOrDefault();
|
|
|
|
|
- var currentPosition = robot.GetRobotPos();
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- await Task.Delay(60);
|
|
|
|
|
- //获取电批结果
|
|
|
|
|
- ScrewDriver.GetData();
|
|
|
|
|
- LockResult lockResult=new LockResult();
|
|
|
|
|
- lockResult.Number = positionIndex;
|
|
|
|
|
- lockResult.LockPassed = ScrewDriver.Success;
|
|
|
|
|
- lockResult.ProductNumber = "";
|
|
|
|
|
- lockResult.LockTurns= (float)ScrewDriver.Truns;
|
|
|
|
|
- lockResult.LockTorque= (float)ScrewDriver.TorqueValue;
|
|
|
|
|
- lockResult.LockDuration= (float)ScrewDriver.FinalTime;
|
|
|
|
|
- lockResult.ScrewdriverProgramNumber= ScrewDriver.ProgramNumber;
|
|
|
|
|
- lockResult.ResultDetails = ScrewDriver.ErrorInfo;
|
|
|
|
|
- lockResult.Pressure= 0;
|
|
|
|
|
- lockResult.TargetTorque= 0;
|
|
|
|
|
- lockResult.TargetTurnsUpperLimit= 0;
|
|
|
|
|
- lockResult.TargetTurnsLowerLimit= 0;
|
|
|
|
|
- lockResult.TargetLockSpeed= 0;
|
|
|
|
|
- lockResult.StartPositionX= currentPosition.X;
|
|
|
|
|
- lockResult.StartPositionY= currentPosition.Y;
|
|
|
|
|
- lockResult.StartPositionZ= screwPoint.Z_Position_Start;
|
|
|
|
|
- lockResult.EndPositionZ= currentPosition.Z;
|
|
|
|
|
- lockResult.LockDescentSpeed= screwPoint.Z_Velocity_Stop;
|
|
|
|
|
- lockResult.FeederNumber= screwPoint!=null?screwPoint.Feeder:0;
|
|
|
|
|
- lockResult.NozzleNumber = "";
|
|
|
|
|
- lockResult.OperatorName = "";
|
|
|
|
|
- lockResult.WaveDatas= ScrewDriver.WaveDatas;
|
|
|
|
|
- _eventAggregator.GetEvent<LockFinishNotification>().Publish(lockResult);
|
|
|
|
|
- await _systemDatabaseService.RecordLockResultAsync(lockResult);
|
|
|
|
|
|
|
+ ////获取当前锁付点
|
|
|
|
|
+ //var screwPoint = currentProduct.ScrewPoints.FirstOrDefault(p=>p.Number== positionIndex);
|
|
|
|
|
+ ////获取当前的机器人点位
|
|
|
|
|
+ //var robot = _robotService.GetAllRobots().FirstOrDefault();
|
|
|
|
|
+ //var currentPosition = robot.GetRobotPos();
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ //await Task.Delay(60);
|
|
|
|
|
+ ////获取电批结果
|
|
|
|
|
+ //ScrewDriver.GetData();
|
|
|
|
|
+ //LockResult lockResult=new LockResult();
|
|
|
|
|
+ //lockResult.Number = positionIndex;
|
|
|
|
|
+ //lockResult.LockPassed = ScrewDriver.Success;
|
|
|
|
|
+ //lockResult.ProductNumber = "";
|
|
|
|
|
+ //lockResult.LockTurns= (float)ScrewDriver.Truns;
|
|
|
|
|
+ //lockResult.LockTorque= (float)ScrewDriver.TorqueValue;
|
|
|
|
|
+ //lockResult.LockDuration= (float)ScrewDriver.FinalTime;
|
|
|
|
|
+ //lockResult.ScrewdriverProgramNumber= ScrewDriver.ProgramNumber;
|
|
|
|
|
+ //lockResult.ResultDetails = ScrewDriver.ErrorInfo;
|
|
|
|
|
+ //lockResult.Pressure= 0;
|
|
|
|
|
+ //lockResult.TargetTorque= 0;
|
|
|
|
|
+ //lockResult.TargetTurnsUpperLimit= 0;
|
|
|
|
|
+ //lockResult.TargetTurnsLowerLimit= 0;
|
|
|
|
|
+ //lockResult.TargetLockSpeed= 0;
|
|
|
|
|
+ //lockResult.StartPositionX= currentPosition.X;
|
|
|
|
|
+ //lockResult.StartPositionY= currentPosition.Y;
|
|
|
|
|
+ //lockResult.StartPositionZ= screwPoint.Z_Position_Start;
|
|
|
|
|
+ //lockResult.EndPositionZ= currentPosition.Z;
|
|
|
|
|
+ //lockResult.LockDescentSpeed= screwPoint.Z_Velocity_Stop;
|
|
|
|
|
+ //lockResult.FeederNumber= screwPoint!=null?screwPoint.Feeder:0;
|
|
|
|
|
+ //lockResult.NozzleNumber = "";
|
|
|
|
|
+ //lockResult.OperatorName = "";
|
|
|
|
|
+ //lockResult.WaveDatas= ScrewDriver.WaveDatas;
|
|
|
|
|
+ //App.Current.Dispatcher.Invoke(() =>
|
|
|
|
|
+ //{
|
|
|
|
|
+ // _eventAggregator.GetEvent<LockFinishNotification>().Publish(lockResult);
|
|
|
|
|
+ //});
|
|
|
|
|
+ //await _systemDatabaseService.RecordLockResultAsync(lockResult);
|
|
|
await plc.WriteNodeAsync(addressConfig.In_WorkDone.Address, (Int16)0);
|
|
await plc.WriteNodeAsync(addressConfig.In_WorkDone.Address, (Int16)0);
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|