- 删除订单启动、暂停、复位相关 PLC 握手及无效反馈配置 - 清除报警改为仅写 clearAlarmCommand,不等待反馈 - 将拍照位移动、视觉处理和 RackPick 拆分为三个独立动作 - 增加 M850/M851 拍照位动作及 R60/M852 视觉结果流程 - 暂停改为等待当前机器人动作完成,视觉结果不确定时转人工确认 - 删除复位按钮,合并为恢复/重试按钮 - 普通 PAUSED 订单通过启动按钮继续 - 恢复前检查 PLC、安全状态、订单及动作命令反馈 - 支持在途动作接管、已完成动作收尾、安全重试和人工确认 - 故障状态保持订单 RUNNING,并持久化实际恢复阶段 - 恢复成功后仅清除本次软件故障对应的报警 - 更新小轴 PLC 地址、Modbus 配置和视觉集成文档
84 lines
2.0 KiB
C++
84 lines
2.0 KiB
C++
#ifndef CONFIGMANAGER_H
|
|
#define CONFIGMANAGER_H
|
|
|
|
#include "../db/dbconfig.h"
|
|
#include "../modbus/modbusconfig.h"
|
|
|
|
#include <QString>
|
|
#include <QStringList>
|
|
#include <QMap>
|
|
|
|
struct VisionConfig
|
|
{
|
|
bool enabled = false;
|
|
bool contractConfirmed = false;
|
|
bool photoPoseReadyConfirmed = false;
|
|
QString executablePath;
|
|
QString ipcName = "ssp_visionguide_v1";
|
|
int startupTimeoutMs = 15000;
|
|
int initializeTimeoutMs = 60000;
|
|
int requestTimeoutMs = 15000;
|
|
int photoPoseR = 40;
|
|
int graspPoseR = 60;
|
|
bool lowWordFirst = true;
|
|
int photoMoveCoil = 850;
|
|
int photoMoveCoilFeedback = 851;
|
|
int comparisonPickCoil = 852;
|
|
QMap<int, int> trayMap;
|
|
|
|
bool isValid(QString *error = nullptr) const;
|
|
int visionTrayNo(int sspTrayNo) const;
|
|
};
|
|
|
|
struct ProductionConfig
|
|
{
|
|
int loadStep = 1;
|
|
int frontCheckStep = 2;
|
|
int backCheckStep = 3;
|
|
int unloadStep = 4;
|
|
int cycleCompleteStep = 5;
|
|
int okResult = 1;
|
|
int ngResult = 2;
|
|
int errorResult = 3;
|
|
int simulationResult = 1;
|
|
int timeoutWarningMs = 8000;
|
|
int stateTimeoutMs = 10000;
|
|
int maxRecoveryRetries = 1;
|
|
int simulationStepMs = 500;
|
|
bool usePlcErrorCode = false;
|
|
};
|
|
|
|
class ConfigManager
|
|
{
|
|
public:
|
|
static ConfigManager &instance();
|
|
|
|
bool load(const QString &filePath = QString());
|
|
QString filePath() const;
|
|
|
|
DbConfig databaseConfig() const;
|
|
ModbusConfig modbusConfig() const;
|
|
ProductionConfig productionConfig() const;
|
|
VisionConfig visionConfig() const;
|
|
bool simulationMode() const;
|
|
bool productionEnabled() const;
|
|
bool validate(QString *error = nullptr) const;
|
|
|
|
private:
|
|
ConfigManager();
|
|
ConfigManager(const ConfigManager &) = delete;
|
|
ConfigManager &operator=(const ConfigManager &) = delete;
|
|
|
|
QString defaultFilePath() const;
|
|
|
|
QString m_filePath;
|
|
DbConfig m_databaseConfig;
|
|
ModbusConfig m_modbusConfig;
|
|
ProductionConfig m_productionConfig;
|
|
VisionConfig m_visionConfig;
|
|
bool m_simulationMode;
|
|
bool m_productionEnabled;
|
|
};
|
|
|
|
#endif // CONFIGMANAGER_H
|