feat(vision): 新增拍照到位前置流程并支持视觉失败降级取料
- 在普通 RackPick 前写托盘号、格位并置 M850,收到 M851 后清除两位 - 使用 vision/enabled 控制识别,关闭时仍执行拍照到位流程 - 识别成功且 R60 写入确认后写 M852=1,视觉关闭或失败时写 M852=0 - 确认 M852 写入后启动 RackPick,动作结束保留 M852 - 移除旧 850–854 五信号握手,更新配置和协议文档 - 允许未就绪的视觉服务接收测量,扩展超时以覆盖初始化重试 - 保留 PLC 写入失败阻断、暂停发送门控及迟到结果拒绝 - 持久化未完成事务,支持 PLC 暂停后的视觉维护与人工恢复 验证:MinGW 32/64 位编译通过;生产流程47、IPC14、PLC11项测试通过
This commit is contained in:
@@ -93,7 +93,7 @@ signals:
|
||||
void visionMeasureRequested(const QJsonObject &request);
|
||||
void visionCancelRequested(const QString &requestId);
|
||||
void visionCycleChanged(const QJsonObject &cycle);
|
||||
void visionProductionActiveChanged(bool active);
|
||||
void visionProductionActiveChanged(bool active, bool maintenanceAllowed);
|
||||
|
||||
private slots:
|
||||
void tick();
|
||||
@@ -107,23 +107,27 @@ public:
|
||||
private:
|
||||
friend class VisionProductionTest;
|
||||
enum class VisionStage {
|
||||
Idle, Preflight, Armed, WaitRequest, SettingBusy, ReadingPose,
|
||||
Measuring, WritingPose, Publishing, WaitAck, WaitReset, Clearing,
|
||||
Complete, Fault
|
||||
Idle, Preflight, Moving, WaitArrival, Clearing, ReadingPose,
|
||||
Measuring, WritingPose, Publishing, Complete, Fault
|
||||
};
|
||||
bool requiresVision(DeviceService::ProductionAction action) const;
|
||||
void prepareVision();
|
||||
void advanceVision();
|
||||
void handleVisionHandshake(const VisionHandshake &handshake);
|
||||
void beginVisionMeasurement();
|
||||
void publishPickMode(bool useVision);
|
||||
void skipVision(const QString &reason);
|
||||
void clearVisionOutputs(int index, quint64 generation);
|
||||
bool visionCurrent(quint64 generation) const;
|
||||
void setVisionStage(VisionStage stage, const QString &message);
|
||||
void reportVision(const QString &phase, const QString &message, bool invalidated = false);
|
||||
void invalidateVision(const QString &reason);
|
||||
void visionFault(const QString &reason, bool reportComparisonError = false);
|
||||
void visionFault(const QString &reason);
|
||||
bool recoverVision(QString *error);
|
||||
void resetVisionForRecovery(int index, quint64 generation);
|
||||
void publishVisionControl();
|
||||
bool saveVisionRecoveryState(bool pending, QString *error);
|
||||
void loadVisionRecoveryState();
|
||||
ProductionService(const ProductionService &) = delete;
|
||||
ProductionService &operator=(const ProductionService &) = delete;
|
||||
|
||||
@@ -220,15 +224,15 @@ private:
|
||||
int m_visionTrayNo = 0;
|
||||
QString m_visionSession;
|
||||
QString m_availableVisionSession;
|
||||
bool m_visionReady = false;
|
||||
bool m_visionBusy = false;
|
||||
bool m_visionEnabled = false;
|
||||
bool m_visionIoPending = false;
|
||||
bool m_visionSuspended = false;
|
||||
bool m_visionCommitStarted = false;
|
||||
bool m_visionNeedsReconcile = false;
|
||||
bool m_visionRecoveryChecking = false;
|
||||
bool m_visionFaultCleanupPending = false;
|
||||
QString m_visionRecoverySession;
|
||||
bool m_visionPauseConfirmed = false;
|
||||
QString m_visionStatePath;
|
||||
std::atomic_bool *m_externalPauseRequested = nullptr;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user