|
|
@ -51,10 +51,19 @@ namespace SlnMesnac.Business
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Task.Run(() =>
|
|
|
|
Task.Run(() =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
isFlag = true;
|
|
|
|
|
|
|
|
|
|
|
|
Task.Delay(1000).Wait();
|
|
|
|
Task.Delay(1000).Wait();
|
|
|
|
|
|
|
|
|
|
|
|
base.InitEquip(2); //判断PLC状态,下发工作模式
|
|
|
|
base.InitEquip(2); //判断PLC状态,下发工作模式
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isFlag)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_log.Info($"定点巡检取消");
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!_plc.writeInt32ByAddress("VD1516", 1)) //下发轨道电机启动信号
|
|
|
|
if (!_plc.writeInt32ByAddress("VD1516", 1)) //下发轨道电机启动信号
|
|
|
|
{
|
|
|
|
{
|
|
|
|
throw new ArgumentException($"定点巡检模式启动信号写入PLC失败;VD1516写1");
|
|
|
|
throw new ArgumentException($"定点巡检模式启动信号写入PLC失败;VD1516写1");
|
|
|
@ -63,6 +72,10 @@ namespace SlnMesnac.Business
|
|
|
|
_log.Info($"定点巡检模式启动信号写入PLC成功;VD1516写1");
|
|
|
|
_log.Info($"定点巡检模式启动信号写入PLC成功;VD1516写1");
|
|
|
|
|
|
|
|
|
|
|
|
SendTrackMotorAddress(busbarInfo);
|
|
|
|
SendTrackMotorAddress(busbarInfo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
isFlag = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_log.Info($"定点巡检结束");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception ex)
|
|
|
|
catch (Exception ex)
|
|
|
@ -71,8 +84,16 @@ namespace SlnMesnac.Business
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void EndFixedPoint(base_busbar_info busbarInfo)
|
|
|
|
public void EndFixedPoint(base_busbar_info busbarInfo,bool isClose = false)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isClose)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_log.Info($"定点巡检取消");
|
|
|
|
|
|
|
|
isFlag = false;
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (busbarInfo.isRotate == 1)
|
|
|
|
if (busbarInfo.isRotate == 1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
GimbaRotationControlEvent?.Invoke("20", "4", "10");
|
|
|
|
GimbaRotationControlEvent?.Invoke("20", "4", "10");
|
|
|
@ -83,7 +104,7 @@ namespace SlnMesnac.Business
|
|
|
|
throw new ArgumentException($"定点巡检模式下发检测完成信号写入失败;VD1512写1");
|
|
|
|
throw new ArgumentException($"定点巡检模式下发检测完成信号写入失败;VD1512写1");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_log.Info($"定点巡检模式下发检测完成信号写入PLC成功;VD1512写1");
|
|
|
|
_log.Info($"定点巡检模式下发检测完成信号写入PLC成功;VD1512写1");
|
|
|
|
_log.Info($"定点巡检结束");
|
|
|
|
//_log.Info($"定点巡检结束");
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -103,6 +124,11 @@ namespace SlnMesnac.Business
|
|
|
|
|
|
|
|
|
|
|
|
this.AwaitArriveSignal("VD1528"); //等待轨道相机到位信号
|
|
|
|
this.AwaitArriveSignal("VD1528"); //等待轨道相机到位信号
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isFlag)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.SendLiftMotorDict(busbarInfo);
|
|
|
|
this.SendLiftMotorDict(busbarInfo);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -119,6 +145,11 @@ namespace SlnMesnac.Business
|
|
|
|
bool is_arrive = true;
|
|
|
|
bool is_arrive = true;
|
|
|
|
while (is_arrive)
|
|
|
|
while (is_arrive)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!isFlag)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int is_arrive_flag = _plc.readInt32ByAddress(signal); //读取PLC轨道电机到位信号
|
|
|
|
int is_arrive_flag = _plc.readInt32ByAddress(signal); //读取PLC轨道电机到位信号
|
|
|
|
if (is_arrive_flag == 1)
|
|
|
|
if (is_arrive_flag == 1)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -155,7 +186,6 @@ namespace SlnMesnac.Business
|
|
|
|
|
|
|
|
|
|
|
|
private void SendLiftMotorDict(base_busbar_info busbar)
|
|
|
|
private void SendLiftMotorDict(base_busbar_info busbar)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
if (!_plc.writeFloatByAddress("VD1524", ((float)busbar.busbarDist))) //下发母排距离,升降电机升降的距离
|
|
|
|
if (!_plc.writeFloatByAddress("VD1524", ((float)busbar.busbarDist))) //下发母排距离,升降电机升降的距离
|
|
|
|
{
|
|
|
|
{
|
|
|
|
throw new ArgumentException($"下发母排升降距离写入失败;VD1524写{busbar.cabinetCode}");
|
|
|
|
throw new ArgumentException($"下发母排升降距离写入失败;VD1524写{busbar.cabinetCode}");
|
|
|
@ -164,6 +194,11 @@ namespace SlnMesnac.Business
|
|
|
|
|
|
|
|
|
|
|
|
this.AwaitArriveSignal("VD1504"); //等待升降电机到位信号
|
|
|
|
this.AwaitArriveSignal("VD1504"); //等待升降电机到位信号
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isFlag)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//控制云台旋转
|
|
|
|
//控制云台旋转
|
|
|
|
if (busbar.isRotate == 1)
|
|
|
|
if (busbar.isRotate == 1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|