LAPTOP-SNT8I5JK\Boounion
2025-03-10 9543f2d581d05a0f98de787ab131e8d97e0291a2
1.清除警告,更新数据库(待测);
已修改3个文件
14 ■■■■ 文件已修改
SourceCode/Bond/Servo/AlarmManager.cpp 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/AlarmManager.h 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Model.cpp 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/AlarmManager.cpp
@@ -717,7 +717,7 @@
}
// 通过多个属性查找并解除报警(更新结束时间)
bool AlarmManager::clearAlarmByAttributes(int nId, int nSeverityLevel, int nDeviceId, int nUnitId, const std::string& strDescription, const std::string& endTime) {
bool AlarmManager::clearAlarmByAttributes(int nId, int nDeviceId, int nUnitId, const std::string& endTime) {
    if (!m_pDB) {
        return false;
    }
@@ -729,10 +729,8 @@
    for (AlarmDataMap::const_iterator it = m_mapCache.begin(); it != m_mapCache.end(); ++it) {
        const AlarmData& alarm = it->second;
        if (alarm.nId == nId &&
            alarm.nSeverityLevel == nSeverityLevel &&
            alarm.nDeviceId == nDeviceId &&
            alarm.nUnitId == nUnitId &&
            alarm.strDescription == strDescription) {
            alarm.nUnitId == nUnitId) {
            alarmEventId = it->first;
            break;
SourceCode/Bond/Servo/AlarmManager.h
@@ -232,7 +232,7 @@
    * @param endTime 结束时间
    * @return 成功返回true,失败返回false
    */
    bool clearAlarmByAttributes(int nId, int nSeverityLevel, int nDeviceId, int nUnitId, const std::string& strDescription, const std::string& endTime);
    bool clearAlarmByAttributes(int nId, int nDeviceId, int nUnitId, const std::string& endTime);
    /**
     * 读取报警文件
SourceCode/Bond/Servo/Model.cpp
@@ -152,8 +152,10 @@
                }
                else {
                    LOGE("<CAlarmDlg> i消除警告");
                    //alarmManager.updateAlarmEndTime(std::to_string(pEqAlarmStep->getAlarmId()),
                    //    pEquipment->getName());
                    alarmManager.clearAlarmByAttributes(pEqAlarmStep->getAlarmId(),
                        pEqAlarmStep->getEquipment()->getID(),
                        pEqAlarmStep->getUnitId(),
                        CToolUnits::getCurrentTimeString());
                }
                m_hsmsPassive.requestAlarmReport(pEqAlarmStep->getAlarmState(),