feat: 重构视觉取料流程及生产故障恢复
- 删除订单启动、暂停、复位相关 PLC 握手及无效反馈配置 - 清除报警改为仅写 clearAlarmCommand,不等待反馈 - 将拍照位移动、视觉处理和 RackPick 拆分为三个独立动作 - 增加 M850/M851 拍照位动作及 R60/M852 视觉结果流程 - 暂停改为等待当前机器人动作完成,视觉结果不确定时转人工确认 - 删除复位按钮,合并为恢复/重试按钮 - 普通 PAUSED 订单通过启动按钮继续 - 恢复前检查 PLC、安全状态、订单及动作命令反馈 - 支持在途动作接管、已完成动作收尾、安全重试和人工确认 - 故障状态保持订单 RUNNING,并持久化实际恢复阶段 - 恢复成功后仅清除本次软件故障对应的报警 - 更新小轴 PLC 地址、Modbus 配置和视觉集成文档
This commit is contained in:
+13
-15
@@ -32,6 +32,12 @@ struct DeviceStatus
|
||||
|
||||
Q_DECLARE_METATYPE(DeviceStatus)
|
||||
|
||||
struct ProductionActionStatus
|
||||
{
|
||||
bool command = false;
|
||||
bool feedback = false;
|
||||
};
|
||||
|
||||
class QTimer;
|
||||
|
||||
class DeviceService : public QObject
|
||||
@@ -44,14 +50,17 @@ public:
|
||||
std::function<void(bool, const DeviceStatus &, const QString &)>;
|
||||
using ActionCallback =
|
||||
std::function<void(bool, bool, const QString &)>;
|
||||
using ActionStatusCallback =
|
||||
std::function<void(bool, const ProductionActionStatus &, const QString &)>;
|
||||
using PoseCallback = std::function<void(bool, const RobotPose &, const QString &)>;
|
||||
using HandshakeCallback = std::function<void(bool, const VisionHandshake &, const QString &)>;
|
||||
using VisionWriteCallback = std::function<void(VisionWriteOutcome, const QString &)>;
|
||||
|
||||
enum VisionSignal { PhotoMove, PhotoArrived, ComparisonPick };
|
||||
enum VisionSignal { PhotoMove, PhotoMoveFeedback, ComparisonPick };
|
||||
|
||||
enum ProductionAction
|
||||
{
|
||||
PhotoMoveAction,
|
||||
RackPick,
|
||||
FrontLoad,
|
||||
Inspect,
|
||||
@@ -70,9 +79,6 @@ public:
|
||||
bool isPolling() const;
|
||||
|
||||
void requestStatus(const StatusCallback &callback);
|
||||
void start(const OperationCallback &callback);
|
||||
void pause(const OperationCallback &callback);
|
||||
void reset(const OperationCallback &callback);
|
||||
void clearAlarm(const OperationCallback &callback);
|
||||
void setInspectionMode(const QString &mode,
|
||||
const OperationCallback &callback);
|
||||
@@ -81,6 +87,9 @@ public:
|
||||
int slotNo, const OperationCallback &callback,
|
||||
const std::function<bool()> &beforeSend = {});
|
||||
void pollProductionAction(const ActionCallback &callback);
|
||||
void inspectProductionAction(ProductionAction action,
|
||||
const ActionStatusCallback &callback);
|
||||
void adoptProductionAction(ProductionAction action);
|
||||
void cancelProductionAction(const OperationCallback &callback);
|
||||
bool productionActionActive() const;
|
||||
bool productionActionBusy() const;
|
||||
@@ -104,15 +113,6 @@ private:
|
||||
void readStatusStep(int index, const DeviceStatus &status);
|
||||
void finishStatusRequest(bool success, const DeviceStatus &status,
|
||||
const QString &error);
|
||||
void executeCommand(int commandAddress, int feedbackAddress,
|
||||
const OperationCallback &callback,
|
||||
bool allowDuringTermination = false);
|
||||
void writeCommandAndWaitFeedback(int commandAddress, int feedbackAddress,
|
||||
const OperationCallback &callback,
|
||||
bool allowDuringTermination = false);
|
||||
void pollFeedback(int commandAddress, int feedbackAddress,
|
||||
const OperationCallback &callback,
|
||||
bool allowDuringTermination = false);
|
||||
void clearSignals(int commandAddress, int feedbackAddress,
|
||||
const OperationCallback &callback);
|
||||
void clearActionSignals(const OperationCallback &callback);
|
||||
@@ -136,8 +136,6 @@ private:
|
||||
QList<QPair<int, int>> m_terminationSignals;
|
||||
int m_terminationSignalIndex;
|
||||
OperationCallback m_terminationCallback;
|
||||
int m_controlCommandAddress;
|
||||
int m_controlFeedbackAddress;
|
||||
quint64 m_visionGeneration = 0;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user