feat(production): modify
- 添加终止按钮 - 点击操作前进行提示 - 取放料的时候,除了写slot,也写行和列
This commit is contained in:
@@ -551,7 +551,7 @@ void DeviceService::beginProductionAction(
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (trayNo <= 0 || slotNo < 1 || slotNo > 49) {
|
||||
if (trayNo <= 0 || trayNo > 65535 || slotNo < 1 || slotNo > 49) {
|
||||
if (callback) {
|
||||
callback(VisionWriteOutcome::NotSent, "PLC tray or slot position is invalid");
|
||||
}
|
||||
@@ -628,7 +628,27 @@ void DeviceService::beginProductionAction(
|
||||
m_modbus->writeHoldingRegister(
|
||||
addresses.slotNumber,
|
||||
static_cast<quint16>(slotNo),
|
||||
writeCommand);
|
||||
[this, addresses, slotNo, writeCommand](
|
||||
bool slotSuccess, const QString &slotError) {
|
||||
if (!slotSuccess) {
|
||||
writeCommand(false, slotError);
|
||||
return;
|
||||
}
|
||||
m_modbus->writeHoldingRegister(
|
||||
addresses.slotRowNumber,
|
||||
static_cast<quint16>((slotNo - 1) / 7 + 1),
|
||||
[this, addresses, slotNo, writeCommand](
|
||||
bool rowSuccess, const QString &rowError) {
|
||||
if (!rowSuccess) {
|
||||
writeCommand(false, rowError);
|
||||
return;
|
||||
}
|
||||
m_modbus->writeHoldingRegister(
|
||||
addresses.slotColumNumber,
|
||||
static_cast<quint16>((slotNo - 1) % 7 + 1),
|
||||
writeCommand);
|
||||
});
|
||||
});
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -920,12 +940,28 @@ void DeviceService::moveToPhotoPosition(int trayNo, int slotNo,
|
||||
return;
|
||||
}
|
||||
m_modbus->writeVisionHoldingRegister(addresses.slotNumber, quint16(slotNo),
|
||||
[this, callback, beforeSend](VisionWriteOutcome outcome, const QString &error) {
|
||||
[this, addresses, slotNo, callback, beforeSend](VisionWriteOutcome outcome, const QString &error) {
|
||||
if (outcome != VisionWriteOutcome::Confirmed) {
|
||||
if (callback) callback(outcome, error);
|
||||
return;
|
||||
}
|
||||
writeVisionSignal(PhotoMove, true, callback, beforeSend);
|
||||
m_modbus->writeVisionHoldingRegister(addresses.slotRowNumber,
|
||||
quint16((slotNo - 1) / 7 + 1),
|
||||
[this, addresses, slotNo, callback, beforeSend](VisionWriteOutcome outcome, const QString &error) {
|
||||
if (outcome != VisionWriteOutcome::Confirmed) {
|
||||
if (callback) callback(outcome, error);
|
||||
return;
|
||||
}
|
||||
m_modbus->writeVisionHoldingRegister(addresses.slotColumNumber,
|
||||
quint16((slotNo - 1) % 7 + 1),
|
||||
[this, callback, beforeSend](VisionWriteOutcome outcome, const QString &error) {
|
||||
if (outcome != VisionWriteOutcome::Confirmed) {
|
||||
if (callback) callback(outcome, error);
|
||||
return;
|
||||
}
|
||||
writeVisionSignal(PhotoMove, true, callback, beforeSend);
|
||||
}, beforeSend);
|
||||
}, beforeSend);
|
||||
}, beforeSend);
|
||||
}, beforeSend);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user