[ref]kbd->iot

This commit is contained in:
shi_jq 2025-03-12 14:54:22 +08:00
parent fda072e2a4
commit 66a35d6a9d
964 changed files with 7657 additions and 7657 deletions

View File

@ -10,7 +10,7 @@
</message> </message>
<message> <message>
<location filename="fbd_editor/CAbout.ui" line="46"/> <location filename="fbd_editor/CAbout.ui" line="46"/>
<source> V1.0</source> <source>广 V1.0</source>
<translation>Shenzhen Kangbida Control Technology Co., Ltd.Function Block Diagram Programming Tool Version V1.0</translation> <translation>Shenzhen Kangbida Control Technology Co., Ltd.Function Block Diagram Programming Tool Version V1.0</translation>
</message> </message>
<message> <message>

View File

@ -10,7 +10,7 @@
</message> </message>
<message> <message>
<location filename="fbd_editor/CAbout.ui" line="46"/> <location filename="fbd_editor/CAbout.ui" line="46"/>
<source> V1.0</source> <source>广 V1.0</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>

View File

@ -18,7 +18,7 @@
#include "CAcsCardMng.h" #include "CAcsCardMng.h"
namespace kbd_application namespace iot_application
{ {
CAcsCardMng::CAcsCardMng(CAcsDeviceApiImpl *pParent) CAcsCardMng::CAcsCardMng(CAcsDeviceApiImpl *pParent)
@ -237,4 +237,4 @@ void CAcsCardMng::onSetCardCfgFinish(bool bSuccess)
} }
} //< namespace kbd_application } //< namespace iot_application

View File

@ -17,7 +17,7 @@ typedef unsigned long DWORD;
typedef unsigned int DWORD; typedef unsigned int DWORD;
#endif #endif
namespace kbd_application namespace iot_application
{ {
class CAcsDeviceApiImpl; class CAcsDeviceApiImpl;
@ -55,4 +55,4 @@ private:
}; };
} //< namespace kbd_application } //< namespace iot_application

View File

@ -14,7 +14,7 @@
#include "CAcsDeviceApiImplFactory.h" #include "CAcsDeviceApiImplFactory.h"
#include "app_bio_identify/acs_device_api/CAcsDeviceApi.h" #include "app_bio_identify/acs_device_api/CAcsDeviceApi.h"
namespace kbd_application namespace iot_application
{ {
CAcsDeviceApi::CAcsDeviceApi() : CAcsDeviceApi::CAcsDeviceApi() :
@ -114,4 +114,4 @@ bool CAcsDeviceApi::enableListenEvents(bool bEnable)
return m_pImpl->enableListenEvents(bEnable); return m_pImpl->enableListenEvents(bEnable);
} }
} //< namespace kbd_application } //< namespace iot_application

View File

@ -12,7 +12,7 @@
#include "app_bio_identify/acs_device_api/CAcsDeviceApi.h" #include "app_bio_identify/acs_device_api/CAcsDeviceApi.h"
namespace kbd_application namespace iot_application
{ {
CAcsDeviceApi::CAcsDeviceApi() : CAcsDeviceApi::CAcsDeviceApi() :
@ -74,4 +74,4 @@ bool CAcsDeviceApi::enableListenEvents(bool /*bEnable*/)
return false; return false;
} }
} //< namespace kbd_application } //< namespace iot_application

View File

@ -18,7 +18,7 @@
#include "app_bio_identify/acs_device_api/CAcsDeviceApi.h" #include "app_bio_identify/acs_device_api/CAcsDeviceApi.h"
#include "CAcsDeviceApiImpl.h" #include "CAcsDeviceApiImpl.h"
namespace kbd_application namespace iot_application
{ {
CAcsDeviceApiImpl::CAcsDeviceApiImpl(CAcsDeviceApi *pParent) : CAcsDeviceApiImpl::CAcsDeviceApiImpl(CAcsDeviceApi *pParent) :
@ -199,14 +199,14 @@ bool CAcsDeviceApiImpl::setUserInfoToDevice(const std::list<CUserInfo> &listUser
delete m_pListUserInfo; delete m_pListUserInfo;
m_pListUserInfo = new std::list<CUserInfo>(listUserInfo); m_pListUserInfo = new std::list<CUserInfo>(listUserInfo);
//< 先将结果全部设为false //< 先将结果全部设为false
for (std::list<kbd_application::CUserInfo>::iterator itUser = m_pListUserInfo->begin(); for (std::list<iot_application::CUserInfo>::iterator itUser = m_pListUserInfo->begin();
m_pListUserInfo->end() != itUser; ++itUser) m_pListUserInfo->end() != itUser; ++itUser)
{ {
itUser->m_bSetCarSuccess = false; itUser->m_bSetCarSuccess = false;
itUser->m_bSetFaceSuccess = false; itUser->m_bSetFaceSuccess = false;
std::list<kbd_application::CFingerprintInfo> &listFp = itUser->m_listFingerprint; std::list<iot_application::CFingerprintInfo> &listFp = itUser->m_listFingerprint;
for (std::list<kbd_application::CFingerprintInfo>::iterator itFp = listFp.begin(); for (std::list<iot_application::CFingerprintInfo>::iterator itFp = listFp.begin();
listFp.end() != itFp; ++itFp) listFp.end() != itFp; ++itFp)
{ {
itFp->m_bSetSuccess = false; itFp->m_bSetSuccess = false;
@ -463,4 +463,4 @@ bool CAcsDeviceApiImpl::enableListenEvents(bool bEnable)
return true; return true;
} }
} //< namespace kbd_application } //< namespace iot_application

View File

@ -20,7 +20,7 @@ typedef unsigned long DWORD;
typedef unsigned int DWORD; typedef unsigned int DWORD;
#endif #endif
namespace kbd_application namespace iot_application
{ {
class CAcsDeviceApi; class CAcsDeviceApi;
@ -82,4 +82,4 @@ private:
CAcsFingerprintMng m_objFpMng; CAcsFingerprintMng m_objFpMng;
}; };
} //< namespace kbd_application } //< namespace iot_application

View File

@ -16,7 +16,7 @@
#include "app_bio_identify/acs_device_api/CAcsDeviceApi.h" #include "app_bio_identify/acs_device_api/CAcsDeviceApi.h"
#include "CAcsDeviceApiImplFactory.h" #include "CAcsDeviceApiImplFactory.h"
namespace kbd_application namespace iot_application
{ {
#ifdef OS_WINDOWS #ifdef OS_WINDOWS
@ -294,4 +294,4 @@ void CAcsDeviceApiImplFactory::destoryAcsDeviceApiImpl(CAcsDeviceApiImpl **ppObj
releaseGlobal(); releaseGlobal();
} }
} //< namespace kbd_application } //< namespace iot_application

View File

@ -17,7 +17,7 @@
#include "CAcsDeviceApiImpl.h" #include "CAcsDeviceApiImpl.h"
namespace kbd_application namespace iot_application
{ {
class CAcsDeviceApi; class CAcsDeviceApi;
@ -49,4 +49,4 @@ private:
static std::set<CAcsDeviceApiImpl *> m_setInstance; static std::set<CAcsDeviceApiImpl *> m_setInstance;
}; };
} //< namespace kbd_application } //< namespace iot_application

View File

@ -19,7 +19,7 @@
#include "CAcsFaceMng.h" #include "CAcsFaceMng.h"
namespace kbd_application namespace iot_application
{ {
CAcsFaceMng::CAcsFaceMng(CAcsDeviceApiImpl *pParent) CAcsFaceMng::CAcsFaceMng(CAcsDeviceApiImpl *pParent)
@ -435,4 +435,4 @@ void CAcsFaceMng::onSetFaceCfgFinish(bool bSuccess)
//< 无需再启动后续步骤 //< 无需再启动后续步骤
} }
} //< namespace kbd_application } //< namespace iot_application

View File

@ -17,7 +17,7 @@ typedef unsigned long DWORD;
typedef unsigned int DWORD; typedef unsigned int DWORD;
#endif #endif
namespace kbd_application namespace iot_application
{ {
class CAcsFaceMng class CAcsFaceMng
@ -59,4 +59,4 @@ private:
}; };
} //< namespace kbd_application } //< namespace iot_application

View File

@ -18,7 +18,7 @@
#include "CAcsDeviceApiImpl.h" #include "CAcsDeviceApiImpl.h"
#include "CAcsFingerprintMng.h" #include "CAcsFingerprintMng.h"
namespace kbd_application namespace iot_application
{ {
CAcsFingerprintMng::CAcsFingerprintMng(CAcsDeviceApiImpl *pParent) CAcsFingerprintMng::CAcsFingerprintMng(CAcsDeviceApiImpl *pParent)
@ -507,4 +507,4 @@ void CAcsFingerprintMng::onSetFpCfgFinish(bool bSuccess)
} }
} }
} //< namespace kbd_application } //< namespace iot_application

View File

@ -17,7 +17,7 @@ typedef unsigned long DWORD;
typedef unsigned int DWORD; typedef unsigned int DWORD;
#endif #endif
namespace kbd_application namespace iot_application
{ {
class CAcsDeviceApiImpl; class CAcsDeviceApiImpl;
@ -63,4 +63,4 @@ private:
}; };
} //< namespace kbd_application } //< namespace iot_application

View File

@ -9,7 +9,7 @@
#include "BisCommon.h" #include "BisCommon.h"
namespace kbd_application namespace iot_application
{ {
} //< namespace kbd_application } //< namespace iot_application

View File

@ -9,9 +9,9 @@
#pragma once #pragma once
namespace kbd_application namespace iot_application
{ {
} //< namespace kbd_application } //< namespace iot_application

View File

@ -37,7 +37,7 @@
#include "CAcsWorkThread.h" #include "CAcsWorkThread.h"
#include "CAcsDevice.h" #include "CAcsDevice.h"
namespace kbd_application namespace iot_application
{ {
CAcsDevice::CAcsDevice(CAcsWorkThread *pParent, const char *szTagName, CAcsDevice::CAcsDevice(CAcsWorkThread *pParent, const char *szTagName,
@ -73,7 +73,7 @@ void CAcsDevice::handleFingerprintInfo(bool bSuccess, size_t nDataLen, const cha
LOGERROR("handleFingerprintInfo(): 服务程序不应运行至此处,检查程序!"); LOGERROR("handleFingerprintInfo(): 服务程序不应运行至此处,检查程序!");
} }
void CAcsDevice::handleSetUserInfoResult(const std::list<kbd_application::CUserInfo> &listUserInfo, void *pUserData) void CAcsDevice::handleSetUserInfoResult(const std::list<iot_application::CUserInfo> &listUserInfo, void *pUserData)
{ {
(void) listUserInfo; (void) listUserInfo;
(void) pUserData; (void) pUserData;
@ -345,4 +345,4 @@ void CAcsDevice::processStateMachine()
} }
} }
} //< namespace kbd_application } //< namespace iot_application

View File

@ -15,12 +15,12 @@
#include "net_msg_bus_api/MsgBusApi.h" #include "net_msg_bus_api/MsgBusApi.h"
#include "app_bio_identify/acs_device_api/CAcsDeviceApi.h" #include "app_bio_identify/acs_device_api/CAcsDeviceApi.h"
namespace kbd_application namespace iot_application
{ {
class CAcsWorkThread; class CAcsWorkThread;
class CAcsDevice : private kbd_application::CAcsDeviceApi class CAcsDevice : private iot_application::CAcsDeviceApi
{ {
public: public:
CAcsDevice(CAcsWorkThread *pParent, const char *szTagName, CAcsDevice(CAcsWorkThread *pParent, const char *szTagName,
@ -70,7 +70,7 @@ private:
void handleFingerprintInfo(bool bSuccess, size_t nDataLen, const char *pData, void *pUserData) override; void handleFingerprintInfo(bool bSuccess, size_t nDataLen, const char *pData, void *pUserData) override;
void handleSetUserInfoResult(const std::list<kbd_application::CUserInfo> &listUserInfo, void *pUserData) override; void handleSetUserInfoResult(const std::list<iot_application::CUserInfo> &listUserInfo, void *pUserData) override;
void handleIdentificationEvent(bool bPass, int nUserID, size_t nPicDataLen, const char *pPicData) override; void handleIdentificationEvent(bool bPass, int nUserID, size_t nPicDataLen, const char *pPicData) override;
@ -104,5 +104,5 @@ private:
typedef boost::shared_ptr<CAcsDevice> CAcsDevicePtr; typedef boost::shared_ptr<CAcsDevice> CAcsDevicePtr;
} //< namespace kbd_application } //< namespace iot_application

View File

@ -37,7 +37,7 @@
#include "CAcsWorkThread.h" #include "CAcsWorkThread.h"
namespace kbd_application namespace iot_application
{ {
CAcsWorkThread::CAcsWorkThread() : CAcsWorkThread::CAcsWorkThread() :
@ -276,5 +276,5 @@ void CAcsWorkThread::handleOneMbMsg()
} }
} }
} //< namespace kbd_application } //< namespace iot_application

View File

@ -17,7 +17,7 @@
#include "CAcsDevice.h" #include "CAcsDevice.h"
namespace kbd_application namespace iot_application
{ {
class CAcsWorkThread : private iot_public::CTimerThreadBase class CAcsWorkThread : private iot_public::CTimerThreadBase
@ -59,5 +59,5 @@ private:
std::map<std::string, CAcsDevicePtr> m_mapAcsDevice; std::map<std::string, CAcsDevicePtr> m_mapAcsDevice;
}; };
} //< namespace kbd_application } //< namespace iot_application

View File

@ -22,7 +22,7 @@
#define BIS_PROC_NAME "app_bio_identify_srv" #define BIS_PROC_NAME "app_bio_identify_srv"
namespace kbd_application namespace iot_application
{ {
CBioIdentifySrv::CBioIdentifySrv() CBioIdentifySrv::CBioIdentifySrv()
@ -147,7 +147,7 @@ bool CBioIdentifySrv::start(int argc, char *argv[], int & /*nStatus*/)
break; break;
case RM_NO_PROC_MNG_MASTER: case RM_NO_PROC_MNG_MASTER:
{ {
if (kbdSuccess != m_ptrRedunSw->redundantSwitch(true, false)) if (iotSuccess != m_ptrRedunSw->redundantSwitch(true, false))
{ {
LOGFATAL("以主机模式启动失败!"); LOGFATAL("以主机模式启动失败!");
return false; return false;
@ -156,7 +156,7 @@ bool CBioIdentifySrv::start(int argc, char *argv[], int & /*nStatus*/)
break; break;
case RM_NO_PROC_MNG_SLAVE: case RM_NO_PROC_MNG_SLAVE:
{ {
if (kbdSuccess != m_ptrRedunSw->redundantSwitch(false, true)) if (iotSuccess != m_ptrRedunSw->redundantSwitch(false, true))
{ {
LOGFATAL("以备机模式启动失败!"); LOGFATAL("以备机模式启动失败!");
return false; return false;
@ -234,7 +234,7 @@ bool CBioIdentifySrv::stop()
int CBioIdentifySrv::toQuit() int CBioIdentifySrv::toQuit()
{ {
shutdown(); shutdown();
return kbdSuccess; return iotSuccess;
} }
@ -245,7 +245,7 @@ int CBioIdentifySrv::updateProcInfo(bool bActive, bool bMaster, bool bSlave)
return m_ptrProcMng->updateProcessInfo(bActive, bMaster, bSlave); return m_ptrProcMng->updateProcessInfo(bActive, bMaster, bSlave);
} }
return kbdFailed; return iotFailed;
} }
@ -329,7 +329,7 @@ bool CBioIdentifySrv::loadSysInfo()
iot_public::SRunAppInfo objRunAppInfo; iot_public::SRunAppInfo objRunAppInfo;
int nRc = sysInfoPtr->getLocalRunAppInfoById(CN_AppId_COMAPP, objRunAppInfo); int nRc = sysInfoPtr->getLocalRunAppInfoById(CN_AppId_COMAPP, objRunAppInfo);
if (kbdSuccess != nRc) if (iotSuccess != nRc)
{ {
LOGERROR("loadSysInfo(): getLocalRunAppInfoByName failed !"); LOGERROR("loadSysInfo(): getLocalRunAppInfoByName failed !");
return false; return false;
@ -346,5 +346,5 @@ int CBioIdentifySrv::getDomainID() const
return m_nDomainID; return m_nDomainID;
} }
} //< namespace kbd_application } //< namespace iot_application

View File

@ -14,7 +14,7 @@
#include "CBisRedunSw.h" #include "CBisRedunSw.h"
namespace kbd_application namespace iot_application
{ {
class CBioIdentifySrv : public iot_public::CBaseService, iot_sys::CProcessQuitInterface class CBioIdentifySrv : public iot_public::CBaseService, iot_sys::CProcessQuitInterface
@ -63,5 +63,5 @@ private:
iot_sys::CRedundantMngInterfacePtr m_ptrRedundantMng; iot_sys::CRedundantMngInterfacePtr m_ptrRedundantMng;
}; };
} //< namespace kbd_application } //< namespace iot_application

View File

@ -11,9 +11,9 @@
#include "CBisRedunSw.h" #include "CBisRedunSw.h"
extern kbd_application::CBioIdentifySrv *g_pBioIdentifySrv; extern iot_application::CBioIdentifySrv *g_pBioIdentifySrv;
namespace kbd_application namespace iot_application
{ {
CBisRedunSw::CBisRedunSw() CBisRedunSw::CBisRedunSw()
@ -40,8 +40,8 @@ int CBisRedunSw::redundantSwitch(bool bMaster, bool bSlave)
g_pBioIdentifySrv->updateProcInfo(true, m_objAcsWorkThread.isThreadRunning(), bSlave); g_pBioIdentifySrv->updateProcInfo(true, m_objAcsWorkThread.isThreadRunning(), bSlave);
return kbdSuccess; return iotSuccess;
} }
} //< namespace kbd_application } //< namespace iot_application

View File

@ -13,7 +13,7 @@
#include "CAcsWorkThread.h" #include "CAcsWorkThread.h"
namespace kbd_application namespace iot_application
{ {
class CBisRedunSw : public ::iot_sys::CRedundantSwitchInterface class CBisRedunSw : public ::iot_sys::CRedundantSwitchInterface
@ -32,5 +32,5 @@ private:
typedef boost::shared_ptr<CBisRedunSw> CCBisRedunSwPtr; typedef boost::shared_ptr<CBisRedunSw> CCBisRedunSwPtr;
} //< namespace kbd_application } //< namespace iot_application

View File

@ -9,11 +9,11 @@
#include "CBioIdentifySrv.h" #include "CBioIdentifySrv.h"
kbd_application::CBioIdentifySrv *g_pBioIdentifySrv = nullptr; iot_application::CBioIdentifySrv *g_pBioIdentifySrv = nullptr;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
kbd_application::CBioIdentifySrv objApp; iot_application::CBioIdentifySrv objApp;
g_pBioIdentifySrv = &objApp; g_pBioIdentifySrv = &objApp;
return objApp.main(argc, argv); return objApp.main(argc, argv);
} }

View File

@ -4,7 +4,7 @@
#include "mainwindow.h" #include "mainwindow.h"
#include "ui_mainwindow.h" #include "ui_mainwindow.h"
using namespace kbd_application; using namespace iot_application;
MainWindow::MainWindow(QWidget *parent) MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent), ui(new Ui::MainWindow) : QMainWindow(parent), ui(new Ui::MainWindow)
@ -12,7 +12,7 @@ MainWindow::MainWindow(QWidget *parent)
ui->setupUi(this); ui->setupUi(this);
qRegisterMetaType<std::string>("std::string"); qRegisterMetaType<std::string>("std::string");
qRegisterMetaType<std::list<kbd_application::CUserInfo>>("std::list<kbd_application::CUserInfo>"); qRegisterMetaType<std::list<iot_application::CUserInfo>>("std::list<iot_application::CUserInfo>");
qRegisterMetaType<size_t>("size_t"); qRegisterMetaType<size_t>("size_t");
connect(this, SIGNAL(faceInfoFinish(bool, std::string, void * )), connect(this, SIGNAL(faceInfoFinish(bool, std::string, void * )),
@ -21,8 +21,8 @@ MainWindow::MainWindow(QWidget *parent)
connect(this, SIGNAL(fingerprintInfoFinish(bool, std::string, void * )), connect(this, SIGNAL(fingerprintInfoFinish(bool, std::string, void * )),
this, SLOT(on_fingerprintInfoFinish(bool, std::string, void * ))); this, SLOT(on_fingerprintInfoFinish(bool, std::string, void * )));
connect(this, SIGNAL(setUserInfoFinish(std::list<kbd_application::CUserInfo>, void * )), connect(this, SIGNAL(setUserInfoFinish(std::list<iot_application::CUserInfo>, void * )),
this, SLOT(on_setUserInfoFinish(std::list<kbd_application::CUserInfo>, void * ))); this, SLOT(on_setUserInfoFinish(std::list<iot_application::CUserInfo>, void * )));
connect(this, SIGNAL(identificationEvent(bool, int, size_t, const char *)), connect(this, SIGNAL(identificationEvent(bool, int, size_t, const char *)),
this, SLOT(on_identificationEvent(bool, int, size_t, const char *))); this, SLOT(on_identificationEvent(bool, int, size_t, const char *)));
@ -49,7 +49,7 @@ void MainWindow::handleFingerprintInfo(bool bSuccess, size_t nDataLen, const cha
emit fingerprintInfoFinish(bSuccess, strData, pUserData); emit fingerprintInfoFinish(bSuccess, strData, pUserData);
} }
void MainWindow::handleSetUserInfoResult(const std::list<kbd_application::CUserInfo> &listUserInfo, void *pUserData) void MainWindow::handleSetUserInfoResult(const std::list<iot_application::CUserInfo> &listUserInfo, void *pUserData)
{ {
emit setUserInfoFinish(listUserInfo, pUserData); emit setUserInfoFinish(listUserInfo, pUserData);
} }
@ -131,13 +131,13 @@ void MainWindow::on_fingerprintInfoFinish(bool bSuccess, std::string strData, vo
} }
} }
void MainWindow::on_setUserInfoFinish(std::list<kbd_application::CUserInfo> listUserInfo, void *pUserData) void MainWindow::on_setUserInfoFinish(std::list<iot_application::CUserInfo> listUserInfo, void *pUserData)
{ {
(void) pUserData; (void) pUserData;
bool bSuccess = true; bool bSuccess = true;
for (std::list<kbd_application::CUserInfo>::const_iterator itUser = listUserInfo.cbegin(); for (std::list<iot_application::CUserInfo>::const_iterator itUser = listUserInfo.cbegin();
listUserInfo.cend() != itUser; ++itUser) listUserInfo.cend() != itUser; ++itUser)
{ {
if (!itUser->m_bSetCarSuccess) if (!itUser->m_bSetCarSuccess)
@ -157,8 +157,8 @@ void MainWindow::on_setUserInfoFinish(std::list<kbd_application::CUserInfo> list
itUser->m_strName.c_str())); itUser->m_strName.c_str()));
} }
const std::list<kbd_application::CFingerprintInfo> &listFp = itUser->m_listFingerprint; const std::list<iot_application::CFingerprintInfo> &listFp = itUser->m_listFingerprint;
for (std::list<kbd_application::CFingerprintInfo>::const_iterator itFp = listFp.cbegin(); for (std::list<iot_application::CFingerprintInfo>::const_iterator itFp = listFp.cbegin();
listFp.cend() != itFp; ++itFp) listFp.cend() != itFp; ++itFp)
{ {
if (!itFp->m_bSetSuccess) if (!itFp->m_bSetSuccess)

View File

@ -12,7 +12,7 @@ class MainWindow;
} }
QT_END_NAMESPACE QT_END_NAMESPACE
class MainWindow : public QMainWindow, private kbd_application::CAcsDeviceApi class MainWindow : public QMainWindow, private iot_application::CAcsDeviceApi
{ {
Q_OBJECT Q_OBJECT
@ -25,7 +25,7 @@ private:
void handleFingerprintInfo(bool bSuccess, size_t nDataLen, const char *pData, void *pUserData) override; void handleFingerprintInfo(bool bSuccess, size_t nDataLen, const char *pData, void *pUserData) override;
void handleSetUserInfoResult(const std::list<kbd_application::CUserInfo> &listUserInfo, void *pUserData) override; void handleSetUserInfoResult(const std::list<iot_application::CUserInfo> &listUserInfo, void *pUserData) override;
void handleIdentificationEvent(bool bPass, int nUserID, size_t nPicDataLen, const char *pPicData) override; void handleIdentificationEvent(bool bPass, int nUserID, size_t nPicDataLen, const char *pPicData) override;
@ -34,7 +34,7 @@ signals:
void fingerprintInfoFinish(bool bSuccess, std::string strData, void *pUserData); void fingerprintInfoFinish(bool bSuccess, std::string strData, void *pUserData);
void setUserInfoFinish(std::list<kbd_application::CUserInfo> listUserInfo, void *pUserData); void setUserInfoFinish(std::list<iot_application::CUserInfo> listUserInfo, void *pUserData);
void identificationEvent(bool bPass, int nUserID, size_t nPicDataLen, const char *pPicData); void identificationEvent(bool bPass, int nUserID, size_t nPicDataLen, const char *pPicData);
@ -44,7 +44,7 @@ private slots:
void on_fingerprintInfoFinish(bool bSuccess, std::string strData, void *pUserData); void on_fingerprintInfoFinish(bool bSuccess, std::string strData, void *pUserData);
void on_setUserInfoFinish(std::list<kbd_application::CUserInfo> listUserInfo, void *pUserData); void on_setUserInfoFinish(std::list<iot_application::CUserInfo> listUserInfo, void *pUserData);
void on_identificationEvent(bool bPass, int nUserID, size_t nPicDataLen, const char *pPicData); void on_identificationEvent(bool bPass, int nUserID, size_t nPicDataLen, const char *pPicData);

View File

@ -13,7 +13,7 @@
#include "FbdConfigParse.h" #include "FbdConfigParse.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -29,10 +29,10 @@ int CFbdConfigParse::initialize()
if ( strCfgFilePath.empty()) if ( strCfgFilePath.empty())
{ {
LOGERROR( "获取平台fbd_server.xml配置文件路径失败" ); LOGERROR( "获取平台fbd_server.xml配置文件路径失败" );
return kbdFailed; return iotFailed;
} }
nRc = parseCfgFile( strCfgFilePath ); nRc = parseCfgFile( strCfgFilePath );
if ( kbdSuccess != nRc ) if ( iotSuccess != nRc )
return nRc; return nRc;
} }
@ -43,12 +43,12 @@ int CFbdConfigParse::initialize()
if ( !strCfgFilePath.empty()) if ( !strCfgFilePath.empty())
{ {
nRc = parseCfgFile( strCfgFilePath ); nRc = parseCfgFile( strCfgFilePath );
if ( kbdSuccess != nRc ) if ( iotSuccess != nRc )
return nRc; return nRc;
} }
} }
return kbdSuccess; return iotSuccess;
} }
@ -87,10 +87,10 @@ int CFbdConfigParse::parseCfgFile( const std::string &strCfgFilePath )
catch ( std::exception &ex ) catch ( std::exception &ex )
{ {
LOGERROR( "解析配置文件[%s]失败.Msg=[%s]", strCfgFilePath.c_str(), ex.what()); LOGERROR( "解析配置文件[%s]失败.Msg=[%s]", strCfgFilePath.c_str(), ex.what());
return kbdFailed; return iotFailed;
} }
return kbdSuccess; return iotSuccess;
} }
@ -100,12 +100,12 @@ int CFbdConfigParse::getModuleCfgInfo( const std::string &strType, SFbdModuleCfg
if ( itMap == m_mapModCfg.end()) if ( itMap == m_mapModCfg.end())
{ {
LOGERROR( "获取模块配置信息失败,module_type=[%s]", strType.c_str()); LOGERROR( "获取模块配置信息失败,module_type=[%s]", strType.c_str());
return kbdFailed; return iotFailed;
} }
stModCfg = itMap->second; stModCfg = itMap->second;
return kbdSuccess; return iotSuccess;
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -7,7 +7,7 @@
#include <map> #include <map>
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -29,7 +29,7 @@ public:
/** /**
@brief @brief
@return kbdSuccess, @return iotSuccess,
*/ */
int initialize(); int initialize();
@ -37,7 +37,7 @@ public:
@brief ID获取模块配置信息 @brief ID获取模块配置信息
@param strType @param strType
@param stModCfg @param stModCfg
@return kbdSuccess, @return iotSuccess,
*/ */
int getModuleCfgInfo( const std::string &strType, SFbdModuleCfg &stModCfg ); int getModuleCfgInfo( const std::string &strType, SFbdModuleCfg &stModCfg );
@ -50,4 +50,4 @@ private:
}; };
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -16,7 +16,7 @@
#include "app_fbd/fbd_common/FbdAlarmSrcApi.h" #include "app_fbd/fbd_common/FbdAlarmSrcApi.h"
#include "FbdGroupMng.h" #include "FbdGroupMng.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -43,13 +43,13 @@ int CFbdGroupMng::initialize()
if ( m_ptrFbdUtil == nullptr ) if ( m_ptrFbdUtil == nullptr )
{ {
LOGERROR( "创建FBD公共操作类失败" ); LOGERROR( "创建FBD公共操作类失败" );
return kbdFailed; return iotFailed;
} }
if ( kbdSuccess != m_ptrFbdUtil->initialize()) if ( iotSuccess != m_ptrFbdUtil->initialize())
{ {
LOGERROR( "初始化FBD公共操作类失败" ); LOGERROR( "初始化FBD公共操作类失败" );
return kbdFailed; return iotFailed;
} }
} }
@ -60,16 +60,16 @@ int CFbdGroupMng::initialize()
int CFbdGroupMng::redundantSwitch( bool bMaster, bool bSlave ) int CFbdGroupMng::redundantSwitch( bool bMaster, bool bSlave )
{ {
int nRet = kbdSuccess; int nRet = iotSuccess;
boost::mutex::scoped_lock lock( m_objRedundantLock ); boost::mutex::scoped_lock lock( m_objRedundantLock );
for ( auto it = m_mapGrpId_Thread.begin(); it != m_mapGrpId_Thread.end(); ++it ) for ( auto it = m_mapGrpId_Thread.begin(); it != m_mapGrpId_Thread.end(); ++it )
{ {
const CFbdGrpWorkThreadPtr &ptrThread = it->second; const CFbdGrpWorkThreadPtr &ptrThread = it->second;
if ( kbdSuccess != ptrThread->redundantSwitch( bMaster, bSlave )) if ( iotSuccess != ptrThread->redundantSwitch( bMaster, bSlave ))
{ {
LOGERROR( "调度FBD组[%d]冗余状态失败.Master[%d],Slave=[%d]", it->first, bMaster, bSlave ); LOGERROR( "调度FBD组[%d]冗余状态失败.Master[%d],Slave=[%d]", it->first, bMaster, bSlave );
nRet = kbdFailed; nRet = iotFailed;
} }
} }
@ -83,10 +83,10 @@ int CFbdGroupMng::checkAndApplyConfig()
{ {
//< 1.获取当前最新的FBD组列表 //< 1.获取当前最新的FBD组列表
std::vector<SFbdGroupInfo> vecGrpInfo; std::vector<SFbdGroupInfo> vecGrpInfo;
if ( kbdSuccess != m_ptrFbdUtil->getFbdGroupInfoList( vecGrpInfo )) if ( iotSuccess != m_ptrFbdUtil->getFbdGroupInfoList( vecGrpInfo ))
{ {
LOGERROR( "获取FBD组信息失败" ); LOGERROR( "获取FBD组信息失败" );
return kbdFailed; return iotFailed;
} }
//< 2.对比哪些组发生了改变vecModifyFbd 记录新增和修改的mapDelFbdGrp 中记录删除的 //< 2.对比哪些组发生了改变vecModifyFbd 记录新增和修改的mapDelFbdGrp 中记录删除的
@ -143,13 +143,13 @@ int CFbdGroupMng::createGroupThread( const SFbdGroupInfo &stGrpInfo )
if ( ptrThread == nullptr ) if ( ptrThread == nullptr )
{ {
LOGERROR( "创建FBD组[%s]工作线程失败", stGrpInfo.m_szName ); LOGERROR( "创建FBD组[%s]工作线程失败", stGrpInfo.m_szName );
return kbdFailed; return iotFailed;
} }
if ( kbdSuccess != ptrThread->initialize()) if ( iotSuccess != ptrThread->initialize())
{ {
LOGERROR( "初始化FBD组[%s]失败", stGrpInfo.m_szName ); LOGERROR( "初始化FBD组[%s]失败", stGrpInfo.m_szName );
return kbdFailed; return iotFailed;
} }
//< 记录已经创建的FBD组线程同时根据当前的主备状态决定是否激活当前线程 //< 记录已经创建的FBD组线程同时根据当前的主备状态决定是否激活当前线程
@ -165,14 +165,14 @@ int CFbdGroupMng::createGroupThread( const SFbdGroupInfo &stGrpInfo )
LOGINFO( "当前服务非主,挂起FBD组[%s]处理线程", stGrpInfo.m_szName ); LOGINFO( "当前服务非主,挂起FBD组[%s]处理线程", stGrpInfo.m_szName );
} }
if ( kbdSuccess != ptrThread->redundantSwitch( m_bMaster, !m_bMaster )) if ( iotSuccess != ptrThread->redundantSwitch( m_bMaster, !m_bMaster ))
{ {
bool bMaster = m_bMaster; bool bMaster = m_bMaster;
LOGERROR( "调度FBD组[%s]主备状态失败,主=[%d]", stGrpInfo.m_szName, bMaster ); LOGERROR( "调度FBD组[%s]主备状态失败,主=[%d]", stGrpInfo.m_szName, bMaster );
return kbdFailed; return iotFailed;
} }
return kbdSuccess; return iotSuccess;
} }
@ -180,12 +180,12 @@ int CFbdGroupMng::modifyFbdGroup( const std::vector<SFbdGroupInfo> &vecGrpInfo )
{ {
if ( vecGrpInfo.empty()) if ( vecGrpInfo.empty())
{ {
return kbdSuccess; return iotSuccess;
} }
//< 获取增加的和更新的FBD组相关信息 //< 获取增加的和更新的FBD组相关信息
GrpIdToDataInfoMAP mapGrpData; GrpIdToDataInfoMAP mapGrpData;
if ( kbdSuccess != m_ptrFbdUtil->getGroupDataFromDB( vecGrpInfo, mapGrpData )) if ( iotSuccess != m_ptrFbdUtil->getGroupDataFromDB( vecGrpInfo, mapGrpData ))
{ {
//< 发告警 //< 发告警
auto ptrAlmSrcApi = getFbdAlarmSrcApi(); auto ptrAlmSrcApi = getFbdAlarmSrcApi();
@ -211,7 +211,7 @@ int CFbdGroupMng::modifyFbdGroup( const std::vector<SFbdGroupInfo> &vecGrpInfo )
ptrAlmSrcApi->addAlarm( objAddAlm ); ptrAlmSrcApi->addAlarm( objAddAlm );
return kbdFailed; return iotFailed;
} }
//< 1.停止所有发生修改的组线程2.更新内存记录3.启动线程 //< 1.停止所有发生修改的组线程2.更新内存记录3.启动线程
@ -241,10 +241,10 @@ int CFbdGroupMng::modifyFbdGroup( const std::vector<SFbdGroupInfo> &vecGrpInfo )
{ {
const SFbdGroupData &stGrpData = itGrpData->second; const SFbdGroupData &stGrpData = itGrpData->second;
//< 先重新加载数据 //< 先重新加载数据
if ( kbdSuccess == reloadGroupData( stGrpInfo, stGrpData )) if ( iotSuccess == reloadGroupData( stGrpInfo, stGrpData ))
{ {
//< 创建处理线程,此时会加载插件动态库 //< 创建处理线程,此时会加载插件动态库
if ( kbdSuccess != createGroupThread( stGrpInfo )) if ( iotSuccess != createGroupThread( stGrpInfo ))
{ {
//< 发告警 //< 发告警
{ {
@ -312,7 +312,7 @@ int CFbdGroupMng::modifyFbdGroup( const std::vector<SFbdGroupInfo> &vecGrpInfo )
} }
} }
return kbdSuccess; return iotSuccess;
} }
@ -333,7 +333,7 @@ int CFbdGroupMng::deleteFbdGroup( const FbdGrpToInfoMAP &mapGrpInfo )
LOGINFO( "停止FBD组[%s]处理线程成功", stGrpInfo.m_szName ); LOGINFO( "停止FBD组[%s]处理线程成功", stGrpInfo.m_szName );
} }
if ( kbdSuccess != m_ptrFbdUtil->deleteAllDataByGroup( stGrpInfo.m_nId )) if ( iotSuccess != m_ptrFbdUtil->deleteAllDataByGroup( stGrpInfo.m_nId ))
{ {
//< 发告警 //< 发告警
{ {
@ -366,20 +366,20 @@ int CFbdGroupMng::deleteFbdGroup( const FbdGrpToInfoMAP &mapGrpInfo )
} }
} }
return kbdSuccess; return iotSuccess;
} }
int CFbdGroupMng::reloadGroupData( const SFbdGroupInfo &stGrpInfo, const SFbdGroupData &stGrpData ) int CFbdGroupMng::reloadGroupData( const SFbdGroupInfo &stGrpInfo, const SFbdGroupData &stGrpData )
{ {
if ( kbdSuccess != m_ptrFbdUtil->deleteAllDataByGroup( stGrpInfo.m_nId )) if ( iotSuccess != m_ptrFbdUtil->deleteAllDataByGroup( stGrpInfo.m_nId ))
{ {
LOGERROR( "删除FBD组[%s]数据失败", stGrpInfo.m_szName ); LOGERROR( "删除FBD组[%s]数据失败", stGrpInfo.m_szName );
return kbdFailed; return iotFailed;
} }
return m_ptrFbdUtil->insertAllDataByGroup( stGrpInfo, stGrpData ); return m_ptrFbdUtil->insertAllDataByGroup( stGrpInfo, stGrpData );
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -10,7 +10,7 @@
#include "FbdGrpWorkThread.h" #include "FbdGrpWorkThread.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -26,7 +26,7 @@ public:
/** /**
@brief @brief
@return kbdSuccess, @return iotSuccess,
*/ */
int initialize(); int initialize();
@ -34,13 +34,13 @@ public:
@brief @brief
@param bool bMaster @param bool bMaster
@param bool bSlave @param bool bSlave
@return kbdSuccess, @return iotSuccess,
*/ */
int redundantSwitch( bool bMaster, bool bSlave ); int redundantSwitch( bool bMaster, bool bSlave );
/** /**
@brief 线 @brief 线
@return kbdSuccess, @return iotSuccess,
*/ */
int checkAndApplyConfig(); int checkAndApplyConfig();
@ -48,21 +48,21 @@ private:
/** /**
@brief FBD组处理线程 @brief FBD组处理线程
@param const SFbdGroupInfo & m_stGrpInfo FBD组信息 @param const SFbdGroupInfo & m_stGrpInfo FBD组信息
@return kbdSuccess, @return iotSuccess,
*/ */
int createGroupThread( const SFbdGroupInfo &stGrpInfo ); int createGroupThread( const SFbdGroupInfo &stGrpInfo );
/** /**
@brief 线FBD组() @brief 线FBD组()
@param const std::vector<SFbdGroupInfo> & vecGrpInfo FBD组集合 @param const std::vector<SFbdGroupInfo> & vecGrpInfo FBD组集合
@return kbdSuccess, @return iotSuccess,
*/ */
int modifyFbdGroup( const std::vector<SFbdGroupInfo> &vecGrpInfo ); int modifyFbdGroup( const std::vector<SFbdGroupInfo> &vecGrpInfo );
/** /**
@brief 线FBD组处理线程 @brief 线FBD组处理线程
@param const FbdGrpToInfoMAP & mapGrpInfo FBD组 @param const FbdGrpToInfoMAP & mapGrpInfo FBD组
@return kbdSuccess, @return iotSuccess,
*/ */
int deleteFbdGroup( const FbdGrpToInfoMAP &mapGrpInfo ); int deleteFbdGroup( const FbdGrpToInfoMAP &mapGrpInfo );
@ -70,7 +70,7 @@ private:
@brief FBD组的数据到内存() @brief FBD组的数据到内存()
@param const SFbdGroupInfo &stGrpInfo FBD组相关表信息 @param const SFbdGroupInfo &stGrpInfo FBD组相关表信息
@param const SFbdGroupData & stGrpData FBD组相关表数据 @param const SFbdGroupData & stGrpData FBD组相关表数据
@return kbdSuccess, @return iotSuccess,
*/ */
int reloadGroupData( const SFbdGroupInfo &stGrpInfo, const SFbdGroupData &stGrpData ); int reloadGroupData( const SFbdGroupInfo &stGrpInfo, const SFbdGroupData &stGrpData );
@ -86,4 +86,4 @@ private:
typedef boost::shared_ptr<CFbdGroupMng> CFbdGroupMngPtr; typedef boost::shared_ptr<CFbdGroupMng> CFbdGroupMngPtr;
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -35,7 +35,7 @@
#include "app_fbd/fbd_common/FbdSysInfoApi.h" #include "app_fbd/fbd_common/FbdSysInfoApi.h"
#include "FbdGrpWorkThread.h" #include "FbdGrpWorkThread.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -122,7 +122,7 @@ void CFbdGrpWorkThread::execute()
} }
iot_idl::SFBDDebugResponse objRep; iot_idl::SFBDDebugResponse objRep;
if ( kbdSuccess != m_ptrFbdUtil->getDebugResponse( objReq, objRep )) if ( iotSuccess != m_ptrFbdUtil->getDebugResponse( objReq, objRep ))
{ {
LOGERROR( "调用 getDebugResponse 失败" ); LOGERROR( "调用 getDebugResponse 失败" );
continue; continue;
@ -163,17 +163,17 @@ void CFbdGrpWorkThread::execute()
int CFbdGrpWorkThread::initialize() int CFbdGrpWorkThread::initialize()
{ {
//< 创建所有的模块对象 //< 创建所有的模块对象
if ( kbdSuccess != createAllFbdModule()) if ( iotSuccess != createAllFbdModule())
return kbdFailed; return iotFailed;
return kbdSuccess; return iotSuccess;
} }
int CFbdGrpWorkThread::redundantSwitch( bool bMaster, bool bSlave ) int CFbdGrpWorkThread::redundantSwitch( bool bMaster, bool bSlave )
{ {
LOGINFO( "当前FBD组[%s]接收到切换指令,bMaster=[%d],bSlave=[%d]", m_stGrpInfo.m_szName, bMaster, bSlave ); LOGINFO( "当前FBD组[%s]接收到切换指令,bMaster=[%d],bSlave=[%d]", m_stGrpInfo.m_szName, bMaster, bSlave );
int nRet = kbdFailed; int nRet = iotFailed;
if ( bMaster ) //< 为主 if ( bMaster ) //< 为主
{ {
CTimerThreadBase::suspend(); //< 先挂起线程,防止修改数据冲突 CTimerThreadBase::suspend(); //< 先挂起线程,防止修改数据冲突
@ -205,10 +205,10 @@ int CFbdGrpWorkThread::createAllFbdModule()
{ {
//< 获取本组所有的模块信息 //< 获取本组所有的模块信息
std::vector<SFbdModInfo> vecModInfo; std::vector<SFbdModInfo> vecModInfo;
if ( kbdSuccess != m_ptrFbdUtil->getFbdModuleInfoList( m_stGrpInfo.m_nId, vecModInfo )) if ( iotSuccess != m_ptrFbdUtil->getFbdModuleInfoList( m_stGrpInfo.m_nId, vecModInfo ))
{ {
LOGERROR( "获取FBD组[%s]中的模块列表失败", m_stGrpInfo.m_szName ); LOGERROR( "获取FBD组[%s]中的模块列表失败", m_stGrpInfo.m_szName );
return kbdFailed; return iotFailed;
} }
if ( vecModInfo.empty()) if ( vecModInfo.empty())
@ -220,11 +220,11 @@ int CFbdGrpWorkThread::createAllFbdModule()
for ( const auto &stModInfo : vecModInfo ) for ( const auto &stModInfo : vecModInfo )
{ {
bool bNeedLoad = false; bool bNeedLoad = false;
if ( kbdSuccess != m_ptrFbdUtil->isModuleNeedLoad( stModInfo.m_strModType, bNeedLoad )) if ( iotSuccess != m_ptrFbdUtil->isModuleNeedLoad( stModInfo.m_strModType, bNeedLoad ))
{ {
LOGERROR( "根据模块类型获取模块配置信息失败module_key=[%s],module_type=[%s]", LOGERROR( "根据模块类型获取模块配置信息失败module_key=[%s],module_type=[%s]",
stModInfo.m_stModKey.toString().c_str(), stModInfo.m_strModType.c_str()); stModInfo.m_stModKey.toString().c_str(), stModInfo.m_strModType.c_str());
return kbdFailed; return iotFailed;
} }
if ( bNeedLoad ) if ( bNeedLoad )
@ -239,7 +239,7 @@ int CFbdGrpWorkThread::createAllFbdModule()
{ {
LOGERROR( "创建模块失败module_key=[%s]", LOGERROR( "创建模块失败module_key=[%s]",
stModInfo.m_stModKey.toString().c_str()); stModInfo.m_stModKey.toString().c_str());
return kbdFailed; return iotFailed;
} }
LOGINFO( "添加到mapmodule_key=[%s],level=[%d]", LOGINFO( "添加到mapmodule_key=[%s],level=[%d]",
@ -252,7 +252,7 @@ int CFbdGrpWorkThread::createAllFbdModule()
} }
LOGINFO( "加载FBD组[%s]成功", m_stGrpInfo.m_szName ); LOGINFO( "加载FBD组[%s]成功", m_stGrpInfo.m_szName );
return kbdSuccess; return iotSuccess;
} }
@ -260,7 +260,7 @@ CBaseModulePtr CFbdGrpWorkThread::createFbdModule( const SFbdModInfo &stModInfo
{ {
//< 从fbd_server.xml中获取模块的dll相关信息 //< 从fbd_server.xml中获取模块的dll相关信息
SFbdModuleCfg stModCfg; SFbdModuleCfg stModCfg;
if ( kbdSuccess != m_ptrFbdUtil->getModuleDllInfo( stModInfo.m_strModType, stModCfg )) if ( iotSuccess != m_ptrFbdUtil->getModuleDllInfo( stModInfo.m_strModType, stModCfg ))
{ {
LOGERROR( "获取动态库文件名失败module_key=[%s],module_type=[%s]", LOGERROR( "获取动态库文件名失败module_key=[%s],module_type=[%s]",
stModInfo.m_stModKey.toString().c_str(), stModInfo.m_stModKey.toString().c_str(),
@ -305,7 +305,7 @@ CBaseModulePtr CFbdGrpWorkThread::createFbdModule( const SFbdModInfo &stModInfo
} }
//< 调用fbd模块的初始化接口 //< 调用fbd模块的初始化接口
if ( kbdSuccess != ptrModule->init( stModInfo.m_stModKey, stModCfg.m_strExtraParam )) if ( iotSuccess != ptrModule->init( stModInfo.m_stModKey, stModCfg.m_strExtraParam ))
{ {
LOGERROR( "初始化模块失败module_key=[%s]", LOGERROR( "初始化模块失败module_key=[%s]",
stModInfo.m_stModKey.toString().c_str()); stModInfo.m_stModKey.toString().c_str());
@ -323,16 +323,16 @@ int CFbdGrpWorkThread::resetModule( bool bMaster )
const SModInfoOrder &stModInfo = it.first; const SModInfoOrder &stModInfo = it.first;
const CBaseModulePtr &ptrMod = it.second; const CBaseModulePtr &ptrMod = it.second;
if ( kbdSuccess != ptrMod->reset( bMaster )) if ( iotSuccess != ptrMod->reset( bMaster ))
{ {
LOGERROR( "调用模块的reset接口失败module_key=[%s],Master=[%d]", LOGERROR( "调用模块的reset接口失败module_key=[%s],Master=[%d]",
stModInfo.m_stModKey.toString().c_str(), bMaster ); stModInfo.m_stModKey.toString().c_str(), bMaster );
return kbdFailed; return iotFailed;
} }
} }
return kbdSuccess; return iotSuccess;
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -12,7 +12,7 @@
#include "app_fbd/fbd_common/BaseModule.h" #include "app_fbd/fbd_common/BaseModule.h"
#include "FbdUtil.h" #include "FbdUtil.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -31,7 +31,7 @@ public:
/** /**
@brief @brief
@return kbdSuccess, @return iotSuccess,
*/ */
int initialize(); int initialize();
@ -39,7 +39,7 @@ public:
@brief @brief
@param bool bMaster @param bool bMaster
@param bool bSlave @param bool bSlave
@return kbdSuccess, @return iotSuccess,
*/ */
int redundantSwitch( bool bMaster, bool bSlave ); int redundantSwitch( bool bMaster, bool bSlave );
@ -52,7 +52,7 @@ private:
/** /**
@brief FBD模块(dll) @brief FBD模块(dll)
@return kbdSuccess, @return iotSuccess,
*/ */
int createAllFbdModule(); int createAllFbdModule();
@ -66,7 +66,7 @@ private:
/** /**
@brief @brief
@param bool bMaster @param bool bMaster
@return kbdSuccess, @return iotSuccess,
*/ */
int resetModule( bool bMaster ); int resetModule( bool bMaster );
@ -115,4 +115,4 @@ private:
typedef boost::shared_ptr<CFbdGrpWorkThread> CFbdGrpWorkThreadPtr; typedef boost::shared_ptr<CFbdGrpWorkThread> CFbdGrpWorkThreadPtr;
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -16,7 +16,7 @@
#define OPT_DESC_APP "app" #define OPT_DESC_APP "app"
#define OPT_DESC_HELP "help" #define OPT_DESC_HELP "help"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -86,14 +86,14 @@ bool CFbdServerApp::start( int argc, char *argv[], int &/*nStatus*/)
} }
//8.设置冗余通知回调 //8.设置冗余通知回调
if ( kbdSuccess != m_ptrRedundancyMng->setCallback( m_ptrFbdSvrMng )) if ( iotSuccess != m_ptrRedundancyMng->setCallback( m_ptrFbdSvrMng ))
{ {
LOGERROR( "设置冗余回调接口失败" ); LOGERROR( "设置冗余回调接口失败" );
return false; return false;
} }
//9.更新当前进程冗余状态 //9.更新当前进程冗余状态
if ( kbdSuccess != m_ptrProcMng->updateProcessInfo( true, false, false )) if ( iotSuccess != m_ptrProcMng->updateProcessInfo( true, false, false ))
{ {
LOGERROR( "更新本进程的进程信息失败" ); LOGERROR( "更新本进程的进程信息失败" );
return false; return false;
@ -150,7 +150,7 @@ int CFbdServerApp::toQuit()
} }
shutdown(); shutdown();
return kbdSuccess; return iotSuccess;
} }
@ -242,7 +242,7 @@ bool CFbdServerApp::getSystemInfo( const std::string &strAppName )
} }
iot_public::SRunAppInfo stRunAppInfo; iot_public::SRunAppInfo stRunAppInfo;
if ( kbdSuccess != m_ptrSysInfo->getSysInfo().getLocalRunAppInfoByName( strAppName, stRunAppInfo )) if ( iotSuccess != m_ptrSysInfo->getSysInfo().getLocalRunAppInfoByName( strAppName, stRunAppInfo ))
{ {
LOGERROR( "获取系统信息失败" ); LOGERROR( "获取系统信息失败" );
return false; return false;
@ -272,7 +272,7 @@ bool CFbdServerApp::registToProcMng( const std::string &strStartArgs )
return false; return false;
} }
if ( kbdSuccess != m_ptrProcMng->setCallback( this )) if ( iotSuccess != m_ptrProcMng->setCallback( this ))
{ {
LOGERROR( "向进程管理设置回调函数失败" ); LOGERROR( "向进程管理设置回调函数失败" );
return false; return false;
@ -298,7 +298,7 @@ bool CFbdServerApp::initialize()
if ( !iot_net::initMsgBus( CN_ProcName_FbdServer, "" )) if ( !iot_net::initMsgBus( CN_ProcName_FbdServer, "" ))
{ {
LOGERROR( "初始化消息总线失败" ); LOGERROR( "初始化消息总线失败" );
return kbdFailed; return iotFailed;
} }
//< 创建发送告警接口 //< 创建发送告警接口
@ -317,7 +317,7 @@ bool CFbdServerApp::initialize()
return false; return false;
} }
if ( kbdSuccess != m_ptrFbdSvrMng->initialize()) if ( iotSuccess != m_ptrFbdSvrMng->initialize())
{ {
LOGERROR( "初始化FBD服务管理类失败" ); LOGERROR( "初始化FBD服务管理类失败" );
return false; return false;
@ -337,4 +337,4 @@ bool CFbdServerApp::clean()
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -13,7 +13,7 @@
#include "FbdServerMng.h" #include "FbdServerMng.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -88,4 +88,4 @@ private:
}; };
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -5,7 +5,7 @@
*/ */
#pragma once #pragma once
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -13,4 +13,4 @@ namespace app_fbd
//< todo //< todo
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -8,7 +8,7 @@
#include "FbdServerMng.h" #include "FbdServerMng.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -50,7 +50,7 @@ int CFbdServerMng::redundantSwitch( bool bMaster, bool bSlave )
} }
//< 切换失败,报告为非主非备 //< 切换失败,报告为非主非备
if ( kbdSuccess == nAlmCltRet && kbdSuccess == nPntSubRet && kbdSuccess == nGrpMngRet ) if ( iotSuccess == nAlmCltRet && iotSuccess == nPntSubRet && iotSuccess == nGrpMngRet )
{ {
m_ptrProcMng->updateProcessInfo( true, bMaster, bSlave ); m_ptrProcMng->updateProcessInfo( true, bMaster, bSlave );
} }
@ -59,7 +59,7 @@ int CFbdServerMng::redundantSwitch( bool bMaster, bool bSlave )
m_ptrProcMng->updateProcessInfo( true, false, false ); m_ptrProcMng->updateProcessInfo( true, false, false );
} }
return kbdSuccess; return iotSuccess;
} }
@ -68,20 +68,20 @@ int CFbdServerMng::initialize()
//< FBD组扫描线程管理类管理了所有的扫描线程 //< FBD组扫描线程管理类管理了所有的扫描线程
{ {
m_ptrFbdGrpMng = boost::make_shared<CFbdGroupMng>(); m_ptrFbdGrpMng = boost::make_shared<CFbdGroupMng>();
if ( kbdSuccess != m_ptrFbdGrpMng->initialize()) if ( iotSuccess != m_ptrFbdGrpMng->initialize())
{ {
LOGERROR( "初始化FBD组管理类失败" ); LOGERROR( "初始化FBD组管理类失败" );
return kbdFailed; return iotFailed;
} }
} }
//< 在线组态更新线程,为了防止在线组态阻塞其他业务,所以单独出来一个线程 //< 在线组态更新线程,为了防止在线组态阻塞其他业务,所以单独出来一个线程
{ {
m_ptrOnlieModifyThread = boost::make_shared<COnlieModifyThread>( m_ptrFbdGrpMng ); m_ptrOnlieModifyThread = boost::make_shared<COnlieModifyThread>( m_ptrFbdGrpMng );
if ( kbdSuccess != m_ptrOnlieModifyThread->initialize()) if ( iotSuccess != m_ptrOnlieModifyThread->initialize())
{ {
LOGERROR( "初始化在线组态线程失败" ); LOGERROR( "初始化在线组态线程失败" );
return kbdFailed; return iotFailed;
} }
} }
@ -89,25 +89,25 @@ int CFbdServerMng::initialize()
//< 测点数据订阅处理线程 //< 测点数据订阅处理线程
{ {
m_ptrPointSubThread = boost::make_shared<CPointSubThread>(); m_ptrPointSubThread = boost::make_shared<CPointSubThread>();
if ( kbdSuccess != m_ptrPointSubThread->initialize()) if ( iotSuccess != m_ptrPointSubThread->initialize())
{ {
LOGERROR( "初始化测点数据订阅处理线程失败" ); LOGERROR( "初始化测点数据订阅处理线程失败" );
return kbdFailed; return iotFailed;
} }
} }
//< 告警(包括事件)客户端处理线程 //< 告警(包括事件)客户端处理线程
{ {
m_ptrAlarmCltThread = boost::make_shared<CAlarmCltThread>(); m_ptrAlarmCltThread = boost::make_shared<CAlarmCltThread>();
if ( kbdSuccess != m_ptrAlarmCltThread->initialize()) if ( iotSuccess != m_ptrAlarmCltThread->initialize())
{ {
LOGERROR( "初始化告警客户端处理线程失败" ); LOGERROR( "初始化告警客户端处理线程失败" );
return kbdFailed; return iotFailed;
} }
} }
return kbdSuccess; return iotSuccess;
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -14,7 +14,7 @@
#include "alarm_client/AlarmCltThread.h" #include "alarm_client/AlarmCltThread.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -30,13 +30,13 @@ public:
@param bool bMaster @param bool bMaster
@param bool bSlave @param bool bSlave
@return kbdSuccess, @return iotSuccess,
*/ */
int redundantSwitch( bool bMaster, bool bSlave ) override; int redundantSwitch( bool bMaster, bool bSlave ) override;
/** /**
@brief @brief
@return kbdSuccess, @return iotSuccess,
*/ */
int initialize(); int initialize();
@ -53,4 +53,4 @@ private:
typedef boost::shared_ptr<CFbdServerMng> CFbdServerMngPtr; typedef boost::shared_ptr<CFbdServerMng> CFbdServerMngPtr;
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -19,7 +19,7 @@
#include "FbdUtil.h" #include "FbdUtil.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -39,10 +39,10 @@ CFbdUtil::~CFbdUtil()
int CFbdUtil::initialize() int CFbdUtil::initialize()
{ {
//1.解析配置文件 //1.解析配置文件
if ( kbdSuccess != m_objCfgParse.initialize()) if ( iotSuccess != m_objCfgParse.initialize())
{ {
LOGERROR( "加载配置文件失败" ); LOGERROR( "加载配置文件失败" );
return kbdFailed; return iotFailed;
} }
//2.初始化Diagram数据接口 //2.初始化Diagram数据接口
@ -50,10 +50,10 @@ int CFbdUtil::initialize()
if ( m_ptrDiagData == nullptr ) if ( m_ptrDiagData == nullptr )
{ {
LOGERROR( "创建Diagram数据接口失败" ); LOGERROR( "创建Diagram数据接口失败" );
return kbdFailed; return iotFailed;
} }
return kbdSuccess; return iotSuccess;
} }
@ -72,14 +72,14 @@ std::string CFbdUtil::getFbdPluginsPath( const std::string &strDllName )
int CFbdUtil::isModuleNeedLoad( const std::string &strModType, bool &bNeedLoad ) int CFbdUtil::isModuleNeedLoad( const std::string &strModType, bool &bNeedLoad )
{ {
SFbdModuleCfg stModInfo; SFbdModuleCfg stModInfo;
if ( kbdSuccess != m_objCfgParse.getModuleCfgInfo( strModType, stModInfo )) if ( iotSuccess != m_objCfgParse.getModuleCfgInfo( strModType, stModInfo ))
{ {
LOGERROR( "获取模块配置信息失败,module_type=[%s]", strModType.c_str()); LOGERROR( "获取模块配置信息失败,module_type=[%s]", strModType.c_str());
return kbdFailed; return iotFailed;
} }
bNeedLoad = !stModInfo.m_strDllName.empty(); bNeedLoad = !stModInfo.m_strDllName.empty();
return kbdSuccess; return iotSuccess;
} }
@ -371,7 +371,7 @@ int CFbdUtil::getGroupDataFromDB( const std::vector<SFbdGroupInfo> &vecGrpInfo,
if ( !objDbConn.open()) if ( !objDbConn.open())
{ {
LOGERROR( "打开数据库失败" ); LOGERROR( "打开数据库失败" );
return kbdFailed; return iotFailed;
} }
LOGINFO( "数据库地址=[%s],名称=[%s]", objDbConn.getCurrentDbPara().getHostName().toUtf8().data(), LOGINFO( "数据库地址=[%s],名称=[%s]", objDbConn.getCurrentDbPara().getHostName().toUtf8().data(),
objDbConn.getCurrentDbPara().getDatabaseName().toUtf8().data()); objDbConn.getCurrentDbPara().getDatabaseName().toUtf8().data());
@ -402,7 +402,7 @@ int CFbdUtil::getGroupDataFromDB( const std::vector<SFbdGroupInfo> &vecGrpInfo,
if ( !objDbConn.execute( strSql, objQuery )) if ( !objDbConn.execute( strSql, objQuery ))
{ {
LOGERROR( "查询错误SQL语句如下\n%s", strSql.toUtf8().constData()); LOGERROR( "查询错误SQL语句如下\n%s", strSql.toUtf8().constData());
return kbdFailed; return iotFailed;
} }
strLastDiagName.clear(); strLastDiagName.clear();
@ -419,7 +419,7 @@ int CFbdUtil::getGroupDataFromDB( const std::vector<SFbdGroupInfo> &vecGrpInfo,
LOGINFO( "开始解析XMLDiagName=[%s]", strLastDiagName.toUtf8().constData()); LOGINFO( "开始解析XMLDiagName=[%s]", strLastDiagName.toUtf8().constData());
if ( !parseFbdXmlFile( stGrpInfo, strLastDiagName.toStdString(), if ( !parseFbdXmlFile( stGrpInfo, strLastDiagName.toStdString(),
baCompressedBase64, mapGrpData[stGrpInfo.m_nId] )) baCompressedBase64, mapGrpData[stGrpInfo.m_nId] ))
return kbdFailed; return iotFailed;
baCompressedBase64.clear(); baCompressedBase64.clear();
} }
@ -436,7 +436,7 @@ int CFbdUtil::getGroupDataFromDB( const std::vector<SFbdGroupInfo> &vecGrpInfo,
stGrpInfo.m_nId, stGrpInfo.m_nId,
objQuery.value( "GROUP_ID" ).toInt(), objQuery.value( "GROUP_ID" ).toInt(),
objQuery.value( "ENABLE" ).toInt()); objQuery.value( "ENABLE" ).toInt());
return kbdFailed; return iotFailed;
} }
baCompressedBase64 += objQuery.value( "CONTENT" ).toByteArray(); baCompressedBase64 += objQuery.value( "CONTENT" ).toByteArray();
@ -451,14 +451,14 @@ int CFbdUtil::getGroupDataFromDB( const std::vector<SFbdGroupInfo> &vecGrpInfo,
LOGINFO( "开始解析XMLDiagName=[%s]", strLastDiagName.toUtf8().constData()); LOGINFO( "开始解析XMLDiagName=[%s]", strLastDiagName.toUtf8().constData());
if ( !parseFbdXmlFile( stGrpInfo, strLastDiagName.toStdString(), if ( !parseFbdXmlFile( stGrpInfo, strLastDiagName.toStdString(),
baCompressedBase64, mapGrpData[stGrpInfo.m_nId] )) baCompressedBase64, mapGrpData[stGrpInfo.m_nId] ))
return kbdFailed; return iotFailed;
baCompressedBase64.clear(); baCompressedBase64.clear();
} }
} }
return kbdSuccess; return iotSuccess;
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -11,7 +11,7 @@
#include "FbdConfigParse.h" #include "FbdConfigParse.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -27,7 +27,7 @@ public:
/** /**
@brief @brief
@return kbdSuccess, @return iotSuccess,
*/ */
int initialize(); int initialize();
@ -45,7 +45,7 @@ public:
@brief dll @brief dll
@param strModType @param strModType
@param bNeedLoad @param bNeedLoad
@return kbdSuccess, @return iotSuccess,
*/ */
int isModuleNeedLoad( const std::string &strModType, bool &bNeedLoad ); int isModuleNeedLoad( const std::string &strModType, bool &bNeedLoad );
@ -60,7 +60,7 @@ public:
@brief fbd组的相关配置信息 @brief fbd组的相关配置信息
@param vecGrpInfo FBD组列表 @param vecGrpInfo FBD组列表
@param mapGrpData FBD组相关信息 @param mapGrpData FBD组相关信息
@return kbdSuccess, @return iotSuccess,
*/ */
static int getGroupDataFromDB( const std::vector<SFbdGroupInfo> &vecGrpInfo, static int getGroupDataFromDB( const std::vector<SFbdGroupInfo> &vecGrpInfo,
GrpIdToDataInfoMAP &mapGrpData ); GrpIdToDataInfoMAP &mapGrpData );
@ -107,4 +107,4 @@ private:
typedef boost::shared_ptr<CFbdUtil> CFbdUtilPtr; typedef boost::shared_ptr<CFbdUtil> CFbdUtilPtr;
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -8,7 +8,7 @@
#include "OnlineModifyThread.h" #include "OnlineModifyThread.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -34,8 +34,8 @@ void COnlieModifyThread::execute()
int COnlieModifyThread::initialize() int COnlieModifyThread::initialize()
{ {
return kbdSuccess; return iotSuccess;
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -8,7 +8,7 @@
#include "pub_utility_api/TimerThreadBase.h" #include "pub_utility_api/TimerThreadBase.h"
#include "FbdGroupMng.h" #include "FbdGroupMng.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -26,7 +26,7 @@ public:
/** /**
@brief @brief
@return kbdSuccess @return iotSuccess
*/ */
int initialize(); int initialize();
@ -43,4 +43,4 @@ private:
typedef boost::shared_ptr<COnlieModifyThread> COnlieModifyThreadPtr; typedef boost::shared_ptr<COnlieModifyThread> COnlieModifyThreadPtr;
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -17,7 +17,7 @@
#include "app_fbd/fbd_common/FbdSysInfoApi.h" #include "app_fbd/fbd_common/FbdSysInfoApi.h"
#include "PointSubThread.h" #include "PointSubThread.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -42,7 +42,7 @@ CPointSubThread::~CPointSubThread()
int CPointSubThread::initialize() int CPointSubThread::initialize()
{ {
( void ) this; ( void ) this;
return kbdSuccess; return iotSuccess;
} }
@ -70,7 +70,7 @@ int CPointSubThread::redundantSwitch( bool bMaster, bool /*bSlave*/ )
clear(); clear();
} }
return kbdSuccess; return iotSuccess;
} }
@ -219,4 +219,4 @@ void CPointSubThread::recvPntMsg( const int nTimeoutMsec )
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -14,7 +14,7 @@
#include "app_fbd/fbd_common/FbdPointSubApi.h" #include "app_fbd/fbd_common/FbdPointSubApi.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -28,7 +28,7 @@ public:
/******************************************************************************//** /******************************************************************************//**
* @brief * @brief
* @param * @param
* @return kbdSuccess * @return iotSuccess
**********************************************************************************/ **********************************************************************************/
int initialize(); int initialize();
@ -36,7 +36,7 @@ public:
* @brief * @brief
* @param bMaster * @param bMaster
* bSlave * bSlave
* @return kbdSuccess, * @return iotSuccess,
**********************************************************************************/ **********************************************************************************/
int redundantSwitch( bool bMaster, bool bSlave ); int redundantSwitch( bool bMaster, bool bSlave );
@ -48,7 +48,7 @@ private:
/******************************************************************************//** /******************************************************************************//**
* @brief * @brief
* @param nTimeoutMsec * @param nTimeoutMsec
* @return kbdSuccess, * @return iotSuccess,
**********************************************************************************/ **********************************************************************************/
void recvPntMsg( const int nTimeoutMsec ); void recvPntMsg( const int nTimeoutMsec );
@ -65,4 +65,4 @@ private:
typedef boost::shared_ptr<CPointSubThread> CPointSubThreadPtr; typedef boost::shared_ptr<CPointSubThread> CPointSubThreadPtr;
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -13,7 +13,7 @@
#include "AlarmCltThread.h" #include "AlarmCltThread.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -39,7 +39,7 @@ CAlarmCltThread::~CAlarmCltThread()
int CAlarmCltThread::initialize() int CAlarmCltThread::initialize()
{ {
( void ) this; ( void ) this;
return kbdSuccess; return iotSuccess;
} }
@ -70,7 +70,7 @@ int CAlarmCltThread::redundantSwitch( bool bMaster, bool /*bSlave*/ )
clear(); clear();
} }
return kbdSuccess; return iotSuccess;
} }
@ -138,4 +138,4 @@ void CAlarmCltThread::execute()
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -17,7 +17,7 @@
#include "AlarmMsgHandler.h" #include "AlarmMsgHandler.h"
#include "ItlAlmMsgHandler.h" #include "ItlAlmMsgHandler.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -33,7 +33,7 @@ public:
/******************************************************************************//** /******************************************************************************//**
* @brief * @brief
* @param * @param
* @return kbdSuccess * @return iotSuccess
**********************************************************************************/ **********************************************************************************/
int initialize(); int initialize();
@ -41,7 +41,7 @@ public:
* @brief * @brief
* @param bMaster * @param bMaster
* bSlave * bSlave
* @return kbdSuccess, * @return iotSuccess,
**********************************************************************************/ **********************************************************************************/
int redundantSwitch( bool bMaster, bool bSlave ); int redundantSwitch( bool bMaster, bool bSlave );
@ -64,4 +64,4 @@ private:
typedef boost::shared_ptr<CAlarmCltThread> CAlarmCltThreadPtr; typedef boost::shared_ptr<CAlarmCltThread> CAlarmCltThreadPtr;
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -16,7 +16,7 @@
#include "AlarmMsgHandler.h" #include "AlarmMsgHandler.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -487,4 +487,4 @@ void CAlarmMsgHandler::handle_MT_ALM_AS2AC_WAVE()
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -34,7 +34,7 @@
#include "boost/integer.hpp" #include "boost/integer.hpp"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -112,4 +112,4 @@ private:
}; };
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -16,7 +16,7 @@
#include "ItlAlmMsgHandler.h" #include "ItlAlmMsgHandler.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -437,4 +437,4 @@ void CItlAlmMsgHandler::handle_MT_IA_S2C_RELEASE()
m_pParent->m_ptrFbdAlmCltAip->releaseItlAlm( objReleaseAlm ); m_pParent->m_ptrFbdAlmCltAip->releaseItlAlm( objReleaseAlm );
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -34,7 +34,7 @@
#include "boost/integer.hpp" #include "boost/integer.hpp"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -110,4 +110,4 @@ private:
}; };
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -12,7 +12,7 @@ int main( int argc, char *argv[] )
//< 控制释放 //< 控制释放
{ {
kbd_app::app_fbd::CFbdServerApp objApp; iot_app::app_fbd::CFbdServerApp objApp;
nRc = objApp.main( argc, argv ); nRc = objApp.main( argc, argv );
} }

View File

@ -16,7 +16,7 @@
#include "app_fbd/fbd_common/FbdSysInfoApi.h" #include "app_fbd/fbd_common/FbdSysInfoApi.h"
#include "FbdAlarmSrcImpl.h" #include "FbdAlarmSrcImpl.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -94,4 +94,4 @@ bool CFbdAlarmSrcImpl::addAlarm( iot_idl::SAppAddAlm &objAlarm )
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -12,7 +12,7 @@
#include "app_fbd/fbd_common/FbdAlarmSrcApi.h" #include "app_fbd/fbd_common/FbdAlarmSrcApi.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -37,4 +37,4 @@ private:
typedef boost::shared_ptr<CFbdAlarmSrcImpl> CFbdAlarmSrcImplPtr; typedef boost::shared_ptr<CFbdAlarmSrcImpl> CFbdAlarmSrcImplPtr;
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -34,7 +34,7 @@
#include "FbdDiagDataImpl.h" #include "FbdDiagDataImpl.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -59,7 +59,7 @@ FBD_COMMON_API CFbdDiagDataApiPtr getFbdDiagDataApi()
spInst = boost::make_shared<CFbdDiagDataImpl>(); spInst = boost::make_shared<CFbdDiagDataImpl>();
if ( kbdSuccess == spInst->initialize()) if ( iotSuccess == spInst->initialize())
{ {
g_wpSingleton = spInst; g_wpSingleton = spInst;
return spInst; return spInst;
@ -109,7 +109,7 @@ int CFbdDiagDataImpl::initialize()
if ( nullptr == ptrSysInfo || ptrSysInfo->getCurrentRunAppInfo().strAppName.empty()) if ( nullptr == ptrSysInfo || ptrSysInfo->getCurrentRunAppInfo().strAppName.empty())
{ {
LOGERROR( "initialize(): 系统信息非预期,检查程序!" ); LOGERROR( "initialize(): 系统信息非预期,检查程序!" );
return kbdFailed; return iotFailed;
} }
m_pRdbTableMng = new iot_dbms::CRdbTableMng( getFbdSysInfoApi()->getCurrentRunAppInfo().strAppName ); m_pRdbTableMng = new iot_dbms::CRdbTableMng( getFbdSysInfoApi()->getCurrentRunAppInfo().strAppName );
} }
@ -118,10 +118,10 @@ int CFbdDiagDataImpl::initialize()
|| nullptr == m_pMutexModOutputTable || nullptr == m_pMutexModPropTable ) || nullptr == m_pMutexModOutputTable || nullptr == m_pMutexModPropTable )
{ {
LOGERROR( "initialize(): 空指针,非预期,检查程序!" ); LOGERROR( "initialize(): 空指针,非预期,检查程序!" );
return kbdFailed; return iotFailed;
} }
return kbdSuccess; return iotSuccess;
} }
@ -132,7 +132,7 @@ int CFbdDiagDataImpl::getModProperty( const SFbdModPropKey &stPropertyKey, std::
if ( !stPropertyKey.isValid()) if ( !stPropertyKey.isValid())
{ {
LOGERROR( "getModProperty(): 无效的输入 stPropertyKey返回失败" ); LOGERROR( "getModProperty(): 无效的输入 stPropertyKey返回失败" );
return kbdFailed; return iotFailed;
} }
//< 读锁 //< 读锁
@ -143,10 +143,10 @@ int CFbdDiagDataImpl::getModProperty( const SFbdModPropKey &stPropertyKey, std::
{ {
LOGERROR( "getModProperty(): m_objModPropTable 中未找到记录 Key=[%s]", LOGERROR( "getModProperty(): m_objModPropTable 中未找到记录 Key=[%s]",
stPropertyKey.toString().c_str()); stPropertyKey.toString().c_str());
return kbdFailed; return iotFailed;
} }
strValue = ( *it )->m_strValue; strValue = ( *it )->m_strValue;
return kbdSuccess; return iotSuccess;
} }
@ -157,7 +157,7 @@ int CFbdDiagDataImpl::getValKeyByModInput( const SFbdModInputKey &stInputKey, SF
if ( !stInputKey.isValid()) if ( !stInputKey.isValid())
{ {
LOGERROR( "getValKeyByModInput(): 无效的输入 stInputKey返回失败" ); LOGERROR( "getValKeyByModInput(): 无效的输入 stInputKey返回失败" );
return kbdFailed; return iotFailed;
} }
SFbdModOutputKey stOutputKey; SFbdModOutputKey stOutputKey;
@ -170,7 +170,7 @@ int CFbdDiagDataImpl::getValKeyByModInput( const SFbdModInputKey &stInputKey, SF
{ {
LOGERROR( "getValKeyByModInput(): m_objModInputTable 中未找到记录 Key=[%s]", LOGERROR( "getValKeyByModInput(): m_objModInputTable 中未找到记录 Key=[%s]",
stInputKey.toString().c_str()); stInputKey.toString().c_str());
return kbdFailed; return iotFailed;
} }
stOutputKey = ( *it )->m_stOutputKey; stOutputKey = ( *it )->m_stOutputKey;
} }
@ -184,7 +184,7 @@ int CFbdDiagDataImpl::getValKeyByModInput( const SFbdModInputKey &stInputKey, SF
{ {
LOGERROR( "getValKeyByModInput(): m_objModOutputTable 中未找到记录 Key=[%s]", LOGERROR( "getValKeyByModInput(): m_objModOutputTable 中未找到记录 Key=[%s]",
stOutputKey.toString().c_str()); stOutputKey.toString().c_str());
return kbdFailed; return iotFailed;
} }
stValueKey.m_bWriteable = false; stValueKey.m_bWriteable = false;
@ -192,10 +192,10 @@ int CFbdDiagDataImpl::getValKeyByModInput( const SFbdModInputKey &stInputKey, SF
} }
if ( stValueKey.isValid()) if ( stValueKey.isValid())
return kbdSuccess; return iotSuccess;
LOGERROR( "getValKeyByModInput(): 无效的输出,检查程序!" ); LOGERROR( "getValKeyByModInput(): 无效的输出,检查程序!" );
return kbdFailed; return iotFailed;
} }
@ -206,7 +206,7 @@ int CFbdDiagDataImpl::getValKeyByModOutput( const SFbdModOutputKey &stOutputKey,
if ( !stOutputKey.isValid()) if ( !stOutputKey.isValid())
{ {
LOGERROR( "getValKeyByModOutput(): 无效的输入 stOutputKey返回失败" ); LOGERROR( "getValKeyByModOutput(): 无效的输入 stOutputKey返回失败" );
return kbdFailed; return iotFailed;
} }
//< 读锁 //< 读锁
@ -217,17 +217,17 @@ int CFbdDiagDataImpl::getValKeyByModOutput( const SFbdModOutputKey &stOutputKey,
{ {
LOGERROR( "getValKeyByModOutput(): m_objModOutputTable 中未找到记录 Key=[%s]", LOGERROR( "getValKeyByModOutput(): m_objModOutputTable 中未找到记录 Key=[%s]",
stOutputKey.toString().c_str()); stOutputKey.toString().c_str());
return kbdFailed; return iotFailed;
} }
stValueKey.m_bWriteable = true; stValueKey.m_bWriteable = true;
stValueKey.m_ptrModOutput = *it; stValueKey.m_ptrModOutput = *it;
if ( stValueKey.isValid()) if ( stValueKey.isValid())
return kbdSuccess; return iotSuccess;
LOGERROR( "getValKeyByModOutput(): 无效的输出,检查程序!" ); LOGERROR( "getValKeyByModOutput(): 无效的输出,检查程序!" );
return kbdFailed; return iotFailed;
} }
@ -238,7 +238,7 @@ int CFbdDiagDataImpl::getNumericValByKey( const SFbdValueKey &stValueKey, SFbdNu
if ( !stValueKey.isValid()) if ( !stValueKey.isValid())
{ {
LOGERROR( "getNumericValByKey(): 无效的输入 stValueKey返回失败" ); LOGERROR( "getNumericValByKey(): 无效的输入 stValueKey返回失败" );
return kbdFailed; return iotFailed;
} }
//< 读锁 //< 读锁
@ -251,12 +251,12 @@ int CFbdDiagDataImpl::getNumericValByKey( const SFbdValueKey &stValueKey, SFbdNu
LOGERROR( "getNumericValByKey(): 类型不一致key=[%s],type=[%s]", LOGERROR( "getNumericValByKey(): 类型不一致key=[%s],type=[%s]",
stValueKey.toString().c_str(), stValueKey.toString().c_str(),
stValueKey.m_ptrModOutput->m_anyOutputValue.type().name()); stValueKey.m_ptrModOutput->m_anyOutputValue.type().name());
return kbdFailed; return iotFailed;
} }
stValAndSta = *pValue; stValAndSta = *pValue;
return kbdSuccess; return iotSuccess;
} }
@ -265,13 +265,13 @@ int CFbdDiagDataImpl::setNumericValByKey( const SFbdValueKey &stValueKey, const
if ( !stValueKey.isValid()) if ( !stValueKey.isValid())
{ {
LOGERROR( "setNumericValByKey(): 无效的输入 stValueKey返回失败" ); LOGERROR( "setNumericValByKey(): 无效的输入 stValueKey返回失败" );
return kbdFailed; return iotFailed;
} }
if ( !stValueKey.m_bWriteable ) if ( !stValueKey.m_bWriteable )
{ {
LOGERROR( "setNumericValByKey(): 非可写 Key" ); LOGERROR( "setNumericValByKey(): 非可写 Key" );
return kbdFailed; return iotFailed;
} }
//< 写锁 //< 写锁
@ -279,7 +279,7 @@ int CFbdDiagDataImpl::setNumericValByKey( const SFbdValueKey &stValueKey, const
stValueKey.m_ptrModOutput->m_anyOutputValue = stValAndSta; stValueKey.m_ptrModOutput->m_anyOutputValue = stValAndSta;
return kbdSuccess; return iotSuccess;
} }
@ -290,7 +290,7 @@ int CFbdDiagDataImpl::getStringValByKey( const SFbdValueKey &stValueKey, SFbdStr
if ( !stValueKey.isValid()) if ( !stValueKey.isValid())
{ {
LOGERROR( "getStringValByKey(): 无效的输入 stValueKey返回失败" ); LOGERROR( "getStringValByKey(): 无效的输入 stValueKey返回失败" );
return kbdFailed; return iotFailed;
} }
//< 读锁 //< 读锁
@ -303,12 +303,12 @@ int CFbdDiagDataImpl::getStringValByKey( const SFbdValueKey &stValueKey, SFbdStr
LOGERROR( "getStringValByKey(): 类型不一致key=[%s],type=[%s]", LOGERROR( "getStringValByKey(): 类型不一致key=[%s],type=[%s]",
stValueKey.toString().c_str(), stValueKey.toString().c_str(),
stValueKey.m_ptrModOutput->m_anyOutputValue.type().name()); stValueKey.m_ptrModOutput->m_anyOutputValue.type().name());
return kbdFailed; return iotFailed;
} }
stValAndSta = *pValue; stValAndSta = *pValue;
return kbdSuccess; return iotSuccess;
} }
@ -317,13 +317,13 @@ int CFbdDiagDataImpl::setStringValByKey( const SFbdValueKey &stValueKey, const S
if ( !stValueKey.isValid()) if ( !stValueKey.isValid())
{ {
LOGERROR( "setStringValByKey(): 无效的输入 stValueKey返回失败" ); LOGERROR( "setStringValByKey(): 无效的输入 stValueKey返回失败" );
return kbdFailed; return iotFailed;
} }
if ( !stValueKey.m_bWriteable ) if ( !stValueKey.m_bWriteable )
{ {
LOGERROR( "setStringValByKey(): 非可写 Key" ); LOGERROR( "setStringValByKey(): 非可写 Key" );
return kbdFailed; return iotFailed;
} }
//< 写锁 //< 写锁
@ -331,7 +331,7 @@ int CFbdDiagDataImpl::setStringValByKey( const SFbdValueKey &stValueKey, const S
stValueKey.m_ptrModOutput->m_anyOutputValue = stValAndSta; stValueKey.m_ptrModOutput->m_anyOutputValue = stValAndSta;
return kbdSuccess; return iotSuccess;
} }
@ -342,7 +342,7 @@ int CFbdDiagDataImpl::getAlarmValByKey( const SFbdValueKey &stValueKey, SFbdAlar
if ( !stValueKey.isValid()) if ( !stValueKey.isValid())
{ {
LOGERROR( "getAlarmValByKey(): 无效的输入 stValueKey返回失败" ); LOGERROR( "getAlarmValByKey(): 无效的输入 stValueKey返回失败" );
return kbdFailed; return iotFailed;
} }
//< 读锁 //< 读锁
@ -355,12 +355,12 @@ int CFbdDiagDataImpl::getAlarmValByKey( const SFbdValueKey &stValueKey, SFbdAlar
LOGERROR( "getAlarmValByKey(): 类型不一致key=[%s],type=[%s]", LOGERROR( "getAlarmValByKey(): 类型不一致key=[%s],type=[%s]",
stValueKey.toString().c_str(), stValueKey.toString().c_str(),
stValueKey.m_ptrModOutput->m_anyOutputValue.type().name()); stValueKey.m_ptrModOutput->m_anyOutputValue.type().name());
return kbdFailed; return iotFailed;
} }
stValAndSta = *pValue; stValAndSta = *pValue;
return kbdSuccess; return iotSuccess;
} }
@ -369,13 +369,13 @@ int CFbdDiagDataImpl::setAlarmValByKey( const SFbdValueKey &stValueKey, const SF
if ( !stValueKey.isValid()) if ( !stValueKey.isValid())
{ {
LOGERROR( "setAlarmValByKey(): 无效的输入 stValueKey返回失败" ); LOGERROR( "setAlarmValByKey(): 无效的输入 stValueKey返回失败" );
return kbdFailed; return iotFailed;
} }
if ( !stValueKey.m_bWriteable ) if ( !stValueKey.m_bWriteable )
{ {
LOGERROR( "setAlarmValByKey(): 非可写 Key" ); LOGERROR( "setAlarmValByKey(): 非可写 Key" );
return kbdFailed; return iotFailed;
} }
//< 写锁 //< 写锁
@ -383,7 +383,7 @@ int CFbdDiagDataImpl::setAlarmValByKey( const SFbdValueKey &stValueKey, const SF
stValueKey.m_ptrModOutput->m_anyOutputValue = stValAndSta; stValueKey.m_ptrModOutput->m_anyOutputValue = stValAndSta;
return kbdSuccess; return iotSuccess;
} }
@ -397,9 +397,9 @@ int CFbdDiagDataImpl::getAllGroupInfo( std::vector<SFbdGroupInfo> &vecGrpInfo )
if ( !m_pRdbTableMng->selectAllColumnNoCondition( strTableName, vecGrpInfo )) if ( !m_pRdbTableMng->selectAllColumnNoCondition( strTableName, vecGrpInfo ))
{ {
LOGERROR( "getAllGroupInfo(): 从RDB获取FBD组信息失败" ); LOGERROR( "getAllGroupInfo(): 从RDB获取FBD组信息失败" );
return kbdFailed; return iotFailed;
} }
return kbdSuccess; return iotSuccess;
} }
@ -415,7 +415,7 @@ int CFbdDiagDataImpl::getModuleInfoByGroup( const int nFbdGrpId, std::vector<SFb
{ {
//< 允许空组,不作为错误 //< 允许空组,不作为错误
LOGWARN( "getModuleInfoByGroup(): m_objModInfoTable 中未找到记录 GroupId=[%d],返回成功", nFbdGrpId ); LOGWARN( "getModuleInfoByGroup(): m_objModInfoTable 中未找到记录 GroupId=[%d],返回成功", nFbdGrpId );
return kbdSuccess; return iotSuccess;
} }
//< 预先分配空间,避免频繁内存移动 //< 预先分配空间,避免频繁内存移动
@ -427,7 +427,7 @@ int CFbdDiagDataImpl::getModuleInfoByGroup( const int nFbdGrpId, std::vector<SFb
vecModuleInfo.emplace_back( **it ); vecModuleInfo.emplace_back( **it );
} }
return kbdSuccess; return iotSuccess;
} }
@ -443,7 +443,7 @@ int CFbdDiagDataImpl::deleteAllDataByGroup( const int nFbdGrpId )
if ( pairModInfo.first == pairModInfo.second ) if ( pairModInfo.first == pairModInfo.second )
{ {
LOGWARN( "deleteAllDataByGroup(): m_objModInfoTable 中未找到记录 GroupId=[%d],返回成功", nFbdGrpId ); LOGWARN( "deleteAllDataByGroup(): m_objModInfoTable 中未找到记录 GroupId=[%d],返回成功", nFbdGrpId );
return kbdSuccess; return iotSuccess;
} }
//< 按图名删除其他表中的记录 //< 按图名删除其他表中的记录
@ -479,7 +479,7 @@ int CFbdDiagDataImpl::deleteAllDataByGroup( const int nFbdGrpId )
//< 删除 ModInfoTable 中的记录 //< 删除 ModInfoTable 中的记录
indexGrpId.erase( nFbdGrpId ); indexGrpId.erase( nFbdGrpId );
return kbdSuccess; return iotSuccess;
} }
@ -548,7 +548,7 @@ int CFbdDiagDataImpl::insertAllDataByGroup( const SFbdGroupInfo &stGrpInfo, cons
} }
} }
return kbdSuccess; return iotSuccess;
} }
@ -578,8 +578,8 @@ int CFbdDiagDataImpl::getDebugResponse( const iot_idl::SFBDDebugRequest &objReq,
pDbgData->set_nvalid( nStatus ); pDbgData->set_nvalid( nStatus );
} }
return kbdSuccess; return iotSuccess;
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -14,7 +14,7 @@
#include "FbdDiagDataStructPrivate.h" #include "FbdDiagDataStructPrivate.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -27,7 +27,7 @@ public:
/** /**
@brief @brief
@return kbdSuccess, @return iotSuccess,
*/ */
int initialize(); int initialize();
@ -100,4 +100,4 @@ typedef boost::shared_ptr<CFbdDiagDataImpl> CFbdDiagDataImplPtr;
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -36,7 +36,7 @@
#include "FbdDiagDataStructPrivate.h" #include "FbdDiagDataStructPrivate.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -385,4 +385,4 @@ bool SFbdModOutput::getValueString( int &nStatus, std::string &strValue ) const
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -21,7 +21,7 @@
#include "app_fbd/fbd_common/FbdDiagDataStruct.h" #include "app_fbd/fbd_common/FbdDiagDataStruct.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -275,4 +275,4 @@ struct SFbdGroupData
}; };
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -12,7 +12,7 @@
#include "FbdPointSubImpl.h" #include "FbdPointSubImpl.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -37,7 +37,7 @@ FBD_COMMON_API CFbdPointSubApiPtr getFbdPointSubApi()
spInst = boost::make_shared<CFbdPointSubImpl>(); spInst = boost::make_shared<CFbdPointSubImpl>();
if ( kbdSuccess == spInst->initialize()) if ( iotSuccess == spInst->initialize())
{ {
g_wpSingleton = spInst; g_wpSingleton = spInst;
return spInst; return spInst;
@ -60,7 +60,7 @@ FBD_COMMON_API int splitLongKeyIdTag( const std::string &strLongKeyIdTag, SLongK
if ( vecStr.size() < 5 ) if ( vecStr.size() < 5 )
{ {
LOGERROR( "KEY=[%s]格式不正确", strLongKeyIdTag.c_str()); LOGERROR( "KEY=[%s]格式不正确", strLongKeyIdTag.c_str());
return kbdFailed; return iotFailed;
} }
stKeyInfo.strOriginalKey = strLongKeyIdTag; //< 原始主键 stKeyInfo.strOriginalKey = strLongKeyIdTag; //< 原始主键
@ -78,7 +78,7 @@ FBD_COMMON_API int splitLongKeyIdTag( const std::string &strLongKeyIdTag, SLongK
stKeyInfo.strKeyExcludeLocSub = stKeyInfo.strTableName + "." + stKeyInfo.strTagName + "." + stKeyInfo.strColName; stKeyInfo.strKeyExcludeLocSub = stKeyInfo.strTableName + "." + stKeyInfo.strTagName + "." + stKeyInfo.strColName;
return kbdSuccess; return iotSuccess;
} }
@ -109,14 +109,14 @@ int CFbdPointSubImpl::initialize()
if ( !iot_service::CDpcdaForApp::initGlobalThread()) if ( !iot_service::CDpcdaForApp::initGlobalThread())
{ {
LOGERROR( "初始化数据订阅服务接口失败" ); LOGERROR( "初始化数据订阅服务接口失败" );
return kbdFailed; return iotFailed;
} }
m_ptrDpSub = boost::make_shared<iot_service::CDpcdaForApp>(); m_ptrDpSub = boost::make_shared<iot_service::CDpcdaForApp>();
if ( m_ptrDpSub == nullptr ) if ( m_ptrDpSub == nullptr )
{ {
LOGERROR( "创建数据订阅服务接口失败" ); LOGERROR( "创建数据订阅服务接口失败" );
return kbdFailed; return iotFailed;
} }
//< 初始化数据处理接口,主要用来判断测点状态字是否有效 //< 初始化数据处理接口,主要用来判断测点状态字是否有效
@ -124,16 +124,16 @@ int CFbdPointSubImpl::initialize()
if ( m_ptrDpApi == nullptr ) if ( m_ptrDpApi == nullptr )
{ {
LOGERROR( "创建数据处理接口失败" ); LOGERROR( "创建数据处理接口失败" );
return kbdFailed; return iotFailed;
} }
if ( kbdSuccess != m_ptrDpApi->initialize()) if ( iotSuccess != m_ptrDpApi->initialize())
{ {
LOGERROR( "初始化数据处理接口失败" ); LOGERROR( "初始化数据处理接口失败" );
return kbdFailed; return iotFailed;
} }
return kbdSuccess; return iotSuccess;
} }
@ -178,10 +178,10 @@ int CFbdPointSubImpl::getPntValAndSta( const std::string &strPntKey,
if ( pIter != m_mapPntKeyToValue.end()) if ( pIter != m_mapPntKeyToValue.end())
{ {
pIter->second.getValAndSta( dValue, nStatus ); pIter->second.getValAndSta( dValue, nStatus );
return kbdSuccess; return iotSuccess;
} }
return kbdFailed; return iotFailed;
} }
@ -201,7 +201,7 @@ int CFbdPointSubImpl::setPntValAndSta( const std::string &strPntKey, double dVal
pIter->second.updateRefreshTime( iot_public::getMonotonicMsec()); pIter->second.updateRefreshTime( iot_public::getMonotonicMsec());
} }
return kbdSuccess; return iotSuccess;
} }
@ -213,7 +213,7 @@ int CFbdPointSubImpl::batchSetPntValAndSta( const std::vector<std::string> &vecP
{ {
LOGERROR( "批量设置中Key=[%d],Value=[%d],Status=[%d]个数不匹配", LOGERROR( "批量设置中Key=[%d],Value=[%d],Status=[%d]个数不匹配",
( int ) vecPntKey.size(), ( int ) vecValue.size(), ( int ) vecSta.size()); ( int ) vecPntKey.size(), ( int ) vecValue.size(), ( int ) vecSta.size());
return kbdFailed; return iotFailed;
} }
int64 lCurTime = iot_public::getMonotonicMsec(); int64 lCurTime = iot_public::getMonotonicMsec();
@ -229,7 +229,7 @@ int CFbdPointSubImpl::batchSetPntValAndSta( const std::vector<std::string> &vecP
} }
} }
return kbdSuccess; return iotSuccess;
} }
@ -246,4 +246,4 @@ void CFbdPointSubImpl::resetOverTimePntValAndSta()
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -11,7 +11,7 @@
#include "data_process_api/DataProcessApi.h" #include "data_process_api/DataProcessApi.h"
#include "app_fbd/fbd_common/FbdPointSubApi.h" #include "app_fbd/fbd_common/FbdPointSubApi.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -104,7 +104,7 @@ public:
/** /**
@brief @brief
@return kbdSuccess, @return iotSuccess,
*/ */
int initialize(); int initialize();
@ -113,7 +113,7 @@ public:
@param const std::string & strTableName @param const std::string & strTableName
@param const std::string & strTagName @param const std::string & strTagName
@param const std::string & strColName @param const std::string & strColName
@return kbdSuccess, @return iotSuccess,
*/ */
void addPointSub( const std::string &strTableName, void addPointSub( const std::string &strTableName,
const std::string &strTagName, const std::string &strTagName,
@ -124,7 +124,7 @@ public:
@param const std::string & strTableName @param const std::string & strTableName
@param const std::string & strTagName @param const std::string & strTagName
@param const std::string & strColName @param const std::string & strColName
@return kbdSuccess, @return iotSuccess,
*/ */
void delPointSub( const std::string &strTableName, void delPointSub( const std::string &strTableName,
const std::string &strTagName, const std::string &strTagName,
@ -135,7 +135,7 @@ public:
@param const std::string & strPntKey .... @param const std::string & strPntKey ....
@param double & dValue @param double & dValue
@param int & nStatus @param int & nStatus
@return kbdSuccess, @return iotSuccess,
*/ */
int getPntValAndSta( const std::string &strPntKey, double &dValue, int &nStatus ) override; int getPntValAndSta( const std::string &strPntKey, double &dValue, int &nStatus ) override;
@ -155,7 +155,7 @@ public:
@param const std::string & strPntKey .... @param const std::string & strPntKey ....
@param double & dValue @param double & dValue
@param int & nStatus @param int & nStatus
@return kbdSuccess, @return iotSuccess,
*/ */
int setPntValAndSta( const std::string &strPntKey, double dValue, int nStatus ) override; int setPntValAndSta( const std::string &strPntKey, double dValue, int nStatus ) override;
@ -164,7 +164,7 @@ public:
@param const std::vector<std::string> & vecPntKey @param const std::vector<std::string> & vecPntKey
@param const std::vector<double> & vecValue @param const std::vector<double> & vecValue
@param const std::vector<int> & vecSta @param const std::vector<int> & vecSta
@return kbdSuccess, @return iotSuccess,
*/ */
int batchSetPntValAndSta( const std::vector<std::string> &vecPntKey, int batchSetPntValAndSta( const std::vector<std::string> &vecPntKey,
const std::vector<double> &vecValue, const std::vector<double> &vecValue,
@ -186,4 +186,4 @@ private:
typedef boost::shared_ptr<CFbdPointSubImpl> CFbdPointSubImplPtr; typedef boost::shared_ptr<CFbdPointSubImpl> CFbdPointSubImplPtr;
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -15,7 +15,7 @@
#include "FbdSysInfoImpl.h" #include "FbdSysInfoImpl.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -78,4 +78,4 @@ void CFbdSysInfoImpl::setCurrentRunAppInfo( const iot_public::SRunAppInfo &stSet
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -10,7 +10,7 @@
#include "app_fbd/fbd_common/FbdSysInfoApi.h" #include "app_fbd/fbd_common/FbdSysInfoApi.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -47,4 +47,4 @@ private:
typedef boost::shared_ptr<CFbdSysInfoImpl> CFbdSysInfoImplPtr; typedef boost::shared_ptr<CFbdSysInfoImpl> CFbdSysInfoImplPtr;
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -15,7 +15,7 @@
#include "AlarmDataMng.h" #include "AlarmDataMng.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -41,10 +41,10 @@ int CAlarmDataMng::initialize()
if ( nullptr == m_pMutexLiveAlmTable ) if ( nullptr == m_pMutexLiveAlmTable )
{ {
LOGERROR( "initialize(): 空指针,非预期,检查程序!" ); LOGERROR( "initialize(): 空指针,非预期,检查程序!" );
return kbdFailed; return iotFailed;
} }
return kbdSuccess; return iotSuccess;
} }
@ -57,11 +57,11 @@ int CAlarmDataMng::getLastAlarm( SFbdAlarmInfo &stAlmOutput ) const
{ {
LOGINFO( "getLastAlarm(): 当前没有任何告警,返回失败" ); LOGINFO( "getLastAlarm(): 当前没有任何告警,返回失败" );
stAlmOutput.m_ptrAlmInfo = nullptr; stAlmOutput.m_ptrAlmInfo = nullptr;
return kbdFailed; return iotFailed;
} }
stAlmOutput.m_ptrAlmInfo = m_objLiveAlmTable.rbegin()->m_ptrAlmInfo; stAlmOutput.m_ptrAlmInfo = m_objLiveAlmTable.rbegin()->m_ptrAlmInfo;
return kbdSuccess; return iotSuccess;
} }
@ -77,7 +77,7 @@ int CAlarmDataMng::getAlarmAfter( const SFbdAlarmInfo &stPosition, std::vector<S
{ {
//< 注意:参数 stPosition 和 stLastAlm 允许是同一个,不能在一开始就设置 //< 注意:参数 stPosition 和 stLastAlm 允许是同一个,不能在一开始就设置
stLastAlm.m_ptrAlmInfo = nullptr; stLastAlm.m_ptrAlmInfo = nullptr;
return kbdSuccess; return iotSuccess;
} }
const auto &indexSeq = m_objLiveAlmTable.get<SLiveAlm_Seq>(); const auto &indexSeq = m_objLiveAlmTable.get<SLiveAlm_Seq>();
@ -112,7 +112,7 @@ int CAlarmDataMng::getAlarmAfter( const SFbdAlarmInfo &stPosition, std::vector<S
//< 前面已判断 m_objLiveAlmTable 不为空,所以 rbegin 有效 //< 前面已判断 m_objLiveAlmTable 不为空,所以 rbegin 有效
stLastAlm.m_ptrAlmInfo = m_objLiveAlmTable.rbegin()->m_ptrAlmInfo; stLastAlm.m_ptrAlmInfo = m_objLiveAlmTable.rbegin()->m_ptrAlmInfo;
return kbdSuccess; return iotSuccess;
} }
@ -126,11 +126,11 @@ int CAlarmDataMng::getAlarmByUuid( const std::string &strUuidBase64, SFbdAlarmIn
if ( indexUuid.end() == itUuid ) if ( indexUuid.end() == itUuid )
{ {
stOutput.m_ptrAlmInfo = nullptr; stOutput.m_ptrAlmInfo = nullptr;
return kbdFailed; return iotFailed;
} }
stOutput.m_ptrAlmInfo = itUuid->m_ptrAlmInfo; stOutput.m_ptrAlmInfo = itUuid->m_ptrAlmInfo;
return kbdSuccess; return iotSuccess;
} }
@ -640,4 +640,4 @@ void CAlarmDataMng::linkWave2Alarm( iot_idl::SAlmCltLinkWave2Alm &objWave2Alm )
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -40,7 +40,7 @@
#include "app_fbd/fbd_common/FbdDiagDataStruct.h" #include "app_fbd/fbd_common/FbdDiagDataStruct.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -57,7 +57,7 @@ public:
/******************************************************************************//** /******************************************************************************//**
* @brief * @brief
* @param * @param
* @return kbdSuccess, * @return iotSuccess,
**********************************************************************************/ **********************************************************************************/
int initialize(); int initialize();
@ -260,4 +260,4 @@ private:
}; };
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -17,7 +17,7 @@
#include "FbdAlarmCltImpl.h" #include "FbdAlarmCltImpl.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -42,7 +42,7 @@ FBD_COMMON_API CFbdAlarmCltApiPtr getFbdAlarmCltApi()
spInst = boost::make_shared<CFbdAlarmCltImpl>(); spInst = boost::make_shared<CFbdAlarmCltImpl>();
if ( kbdSuccess == spInst->initialize()) if ( iotSuccess == spInst->initialize())
{ {
g_wpSingleton = spInst; g_wpSingleton = spInst;
return spInst; return spInst;
@ -63,13 +63,13 @@ FBD_COMMON_API long getFbdAlarmCltApiUseCount()
int CFbdAlarmCltImpl::initialize() int CFbdAlarmCltImpl::initialize()
{ {
if ( kbdSuccess != m_objAlarmDataMng.initialize()) if ( iotSuccess != m_objAlarmDataMng.initialize())
return kbdFailed; return iotFailed;
if ( kbdSuccess != m_objItlAlmDataMng.initialize()) if ( iotSuccess != m_objItlAlmDataMng.initialize())
return kbdFailed; return iotFailed;
return kbdSuccess; return iotSuccess;
} }
@ -203,4 +203,4 @@ void CFbdAlarmCltImpl::releaseItlAlm( iot_idl::SIntelliAlmRelease &objReleaseItl
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -13,7 +13,7 @@
#include "app_fbd/fbd_common/FbdAlarmCltApi.h" #include "app_fbd/fbd_common/FbdAlarmCltApi.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -28,7 +28,7 @@ public:
/******************************************************************************//** /******************************************************************************//**
* @brief * @brief
* @param * @param
* @return kbdSuccess, * @return iotSuccess,
**********************************************************************************/ **********************************************************************************/
int initialize(); int initialize();
@ -112,4 +112,4 @@ private:
typedef boost::shared_ptr<CFbdAlarmCltImpl> CFbdAlarmCltImplPtr; typedef boost::shared_ptr<CFbdAlarmCltImpl> CFbdAlarmCltImplPtr;
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -15,7 +15,7 @@
#include "ItlAlmDataMng.h" #include "ItlAlmDataMng.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -38,10 +38,10 @@ int CItlAlmDataMng::initialize()
if ( nullptr == m_pMutexLiveRawAlmTable ) if ( nullptr == m_pMutexLiveRawAlmTable )
{ {
LOGERROR( "initialize(): 空指针,非预期,检查程序!" ); LOGERROR( "initialize(): 空指针,非预期,检查程序!" );
return kbdFailed; return iotFailed;
} }
return kbdSuccess; return iotSuccess;
} }
@ -51,7 +51,7 @@ int CItlAlmDataMng::getItlAlmByRawAlm( const SFbdAlarmInfo &stRawAlm, SFbdItlAlm
{ {
LOGERROR( "getItlAlmByRawAlm(): 输入参数 stRawAlm 无效,返回失败" ); LOGERROR( "getItlAlmByRawAlm(): 输入参数 stRawAlm 无效,返回失败" );
stItlAlm.m_ptrItlAlmInfo = nullptr; stItlAlm.m_ptrItlAlmInfo = nullptr;
return kbdFailed; return iotFailed;
} }
//< 读锁 //< 读锁
@ -64,11 +64,11 @@ int CItlAlmDataMng::getItlAlmByRawAlm( const SFbdAlarmInfo &stRawAlm, SFbdItlAlm
//< 没找到,不属于任何智能告警 //< 没找到,不属于任何智能告警
//< 和智能告警服务端代码不一样,没有服务端复杂 //< 和智能告警服务端代码不一样,没有服务端复杂
stItlAlm.m_ptrItlAlmInfo = nullptr; stItlAlm.m_ptrItlAlmInfo = nullptr;
return kbdFailed; return iotFailed;
} }
stItlAlm.m_ptrItlAlmInfo = itUuid->m_ptrItlAlmInfo; stItlAlm.m_ptrItlAlmInfo = itUuid->m_ptrItlAlmInfo;
return kbdSuccess; return iotSuccess;
} }
@ -83,11 +83,11 @@ int CItlAlmDataMng::getItlAlmByUuid( const std::string &strUuidBase64, SFbdItlAl
{ {
//< 没找到 //< 没找到
stOutput.m_ptrItlAlmInfo = nullptr; stOutput.m_ptrItlAlmInfo = nullptr;
return kbdFailed; return iotFailed;
} }
stOutput.m_ptrItlAlmInfo = pairRange.first->m_ptrItlAlmInfo; stOutput.m_ptrItlAlmInfo = pairRange.first->m_ptrItlAlmInfo;
return kbdSuccess; return iotSuccess;
} }
@ -326,4 +326,4 @@ void CItlAlmDataMng::releaseItlAlm( iot_idl::SIntelliAlmRelease &objReleaseItlAl
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -41,7 +41,7 @@
#include "app_fbd/fbd_common/FbdDiagDataStruct.h" #include "app_fbd/fbd_common/FbdDiagDataStruct.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -58,7 +58,7 @@ public:
/******************************************************************************//** /******************************************************************************//**
* @brief * @brief
* @param * @param
* @return kbdSuccess, * @return iotSuccess,
**********************************************************************************/ **********************************************************************************/
int initialize(); int initialize();
@ -175,4 +175,4 @@ private:
}; };
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -10,7 +10,7 @@
#include "pub_logger_api/logger.h" #include "pub_logger_api/logger.h"
#include "pub_utility_api/TimeUtil.h" #include "pub_utility_api/TimeUtil.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -38,20 +38,20 @@ int CAntiShake::init( const SFbdModKey &stModuleKey, const std::string & )
if ( m_ptrDiagData == nullptr ) if ( m_ptrDiagData == nullptr )
{ {
LOGERROR( "获取Diagram数据接口单例失败" ); LOGERROR( "获取Diagram数据接口单例失败" );
return kbdFailed; return iotFailed;
} }
//1.获取输入、输出参数 //1.获取输入、输出参数
if ( kbdSuccess != m_ptrDiagData->getValKeyByModInput( stModuleKey, 1, m_stInKey1 ) || if ( iotSuccess != m_ptrDiagData->getValKeyByModInput( stModuleKey, 1, m_stInKey1 ) ||
kbdSuccess != m_ptrDiagData->getValKeyByModInput( stModuleKey, 2, m_stInKey2 ) || iotSuccess != m_ptrDiagData->getValKeyByModInput( stModuleKey, 2, m_stInKey2 ) ||
kbdSuccess != m_ptrDiagData->getValKeyByModOutput( stModuleKey, 1, m_stOutputKey )) iotSuccess != m_ptrDiagData->getValKeyByModOutput( stModuleKey, 1, m_stOutputKey ))
{ {
LOGERROR( "获取模块[%s]的输入输出参数失败", stModuleKey.toString().c_str()); LOGERROR( "获取模块[%s]的输入输出参数失败", stModuleKey.toString().c_str());
return kbdFailed; return iotFailed;
} }
LOGINFO( "[%s]加载成功", m_stModKey.toString().c_str()); LOGINFO( "[%s]加载成功", m_stModKey.toString().c_str());
return kbdSuccess; return iotSuccess;
} }
@ -61,11 +61,11 @@ int CAntiShake::calculate()
SFbdNumericValue stInput2( 0, CN_FBD_STATUS_Invalid ); SFbdNumericValue stInput2( 0, CN_FBD_STATUS_Invalid );
//< 获取输入参数值和状态 //< 获取输入参数值和状态
if ( kbdSuccess != m_ptrDiagData->getNumericValByKey( m_stInKey1, stInput1 ) || if ( iotSuccess != m_ptrDiagData->getNumericValByKey( m_stInKey1, stInput1 ) ||
kbdSuccess != m_ptrDiagData->getNumericValByKey( m_stInKey2, stInput2 )) iotSuccess != m_ptrDiagData->getNumericValByKey( m_stInKey2, stInput2 ))
{ {
LOGERROR( "获取模块[%s]的输入参数失败", m_stModKey.toString().c_str()); LOGERROR( "获取模块[%s]的输入参数失败", m_stModKey.toString().c_str());
return kbdFailed; return iotFailed;
} }
//< 判断输入参数的状态是否有效,无效则直接写输出 //< 判断输入参数的状态是否有效,无效则直接写输出
@ -79,10 +79,10 @@ int CAntiShake::calculate()
if ( m_lChangeTimeMsec == 0 ) //< 启动后第一次,先将输出值设置为无效,同时开始计时 if ( m_lChangeTimeMsec == 0 ) //< 启动后第一次,先将输出值设置为无效,同时开始计时
{ {
SFbdNumericValue stOutputTemp( 0, CN_FBD_STATUS_Invalid ); SFbdNumericValue stOutputTemp( 0, CN_FBD_STATUS_Invalid );
if ( kbdSuccess != m_ptrDiagData->setNumericValByKey( m_stOutputKey, stOutputTemp )) if ( iotSuccess != m_ptrDiagData->setNumericValByKey( m_stOutputKey, stOutputTemp ))
{ {
LOGERROR( "首次计算,写模块[%s]输出值失败", m_stModKey.toString().c_str()); LOGERROR( "首次计算,写模块[%s]输出值失败", m_stModKey.toString().c_str());
return kbdFailed; return iotFailed;
} }
m_lChangeTimeMsec = iot_public::getMonotonicMsec(); m_lChangeTimeMsec = iot_public::getMonotonicMsec();
@ -111,7 +111,7 @@ int CAntiShake::calculate()
} }
} }
return kbdSuccess; return iotSuccess;
} }
@ -136,4 +136,4 @@ boost::shared_ptr<CAntiShake> CAntiShake::create()
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -9,7 +9,7 @@
#include "app_fbd/fbd_common/BaseModule.h" #include "app_fbd/fbd_common/BaseModule.h"
#include "app_fbd/fbd_common/FbdDiagDataApi.h" #include "app_fbd/fbd_common/FbdDiagDataApi.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -51,4 +51,4 @@ BOOST_DLL_ALIAS(
) )
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -20,7 +20,7 @@
#include "AoCtrl.h" #include "AoCtrl.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -42,41 +42,41 @@ int CAoCtrl::init( const SFbdModKey &stModuleKey, const std::string & )
if ( m_ptrDiagData == nullptr ) if ( m_ptrDiagData == nullptr )
{ {
LOGERROR( "获取Diagram数据接口单例失败" ); LOGERROR( "获取Diagram数据接口单例失败" );
return kbdFailed; return iotFailed;
} }
//1.解析配置 //1.解析配置
if ( kbdSuccess != initCtrlParam()) if ( iotSuccess != initCtrlParam())
{ {
LOGERROR( "初始化模块[%s]的控制参数失败", stModuleKey.toString().c_str()); LOGERROR( "初始化模块[%s]的控制参数失败", stModuleKey.toString().c_str());
return kbdFailed; return iotFailed;
} }
//2.获取输入、输出参数 //2.获取输入、输出参数
if ( m_stCmdCfgInfo.strKeyIdTag.empty()) if ( m_stCmdCfgInfo.strKeyIdTag.empty())
{ {
//< 3个输入从输入动态获取测点串 //< 3个输入从输入动态获取测点串
if ( kbdSuccess != m_ptrDiagData->getValKeyByModInput( stModuleKey, 1, m_stInKeyCtrlStr ) || if ( iotSuccess != m_ptrDiagData->getValKeyByModInput( stModuleKey, 1, m_stInKeyCtrlStr ) ||
kbdSuccess != m_ptrDiagData->getValKeyByModInput( stModuleKey, 2, m_stInKeyTargetVal ) || iotSuccess != m_ptrDiagData->getValKeyByModInput( stModuleKey, 2, m_stInKeyTargetVal ) ||
kbdSuccess != m_ptrDiagData->getValKeyByModInput( stModuleKey, 3, m_stInKeyEnable )) iotSuccess != m_ptrDiagData->getValKeyByModInput( stModuleKey, 3, m_stInKeyEnable ))
{ {
LOGERROR( "获取模块[%s]的输入输出参数失败", stModuleKey.toString().c_str()); LOGERROR( "获取模块[%s]的输入输出参数失败", stModuleKey.toString().c_str());
return kbdFailed; return iotFailed;
} }
} }
else else
{ {
//< 2个输入测点串在配置中 //< 2个输入测点串在配置中
if ( kbdSuccess != m_ptrDiagData->getValKeyByModInput( stModuleKey, 1, m_stInKeyTargetVal ) || if ( iotSuccess != m_ptrDiagData->getValKeyByModInput( stModuleKey, 1, m_stInKeyTargetVal ) ||
kbdSuccess != m_ptrDiagData->getValKeyByModInput( stModuleKey, 2, m_stInKeyEnable )) iotSuccess != m_ptrDiagData->getValKeyByModInput( stModuleKey, 2, m_stInKeyEnable ))
{ {
LOGERROR( "获取模块[%s]的输入输出参数失败", stModuleKey.toString().c_str()); LOGERROR( "获取模块[%s]的输入输出参数失败", stModuleKey.toString().c_str());
return kbdFailed; return iotFailed;
} }
} }
LOGINFO( "[%s]加载成功", m_stModKey.toString().c_str()); LOGINFO( "[%s]加载成功", m_stModKey.toString().c_str());
return kbdSuccess; return iotSuccess;
} }
@ -87,7 +87,7 @@ int CAoCtrl::calculate()
if ( nullptr == m_pMbComm ) if ( nullptr == m_pMbComm )
{ {
LOGERROR( "通讯器指针为空,非预期,检查程序!" ); LOGERROR( "通讯器指针为空,非预期,检查程序!" );
return kbdFailed; return iotFailed;
} }
iot_net::CMbMessage objMsg; iot_net::CMbMessage objMsg;
@ -121,20 +121,20 @@ int CAoCtrl::calculate()
//< 获取输入 //< 获取输入
{ {
SFbdNumericValue stInValEnable; SFbdNumericValue stInValEnable;
if ( kbdSuccess != m_ptrDiagData->getNumericValByKey( m_stInKeyEnable, stInValEnable )) if ( iotSuccess != m_ptrDiagData->getNumericValByKey( m_stInKeyEnable, stInValEnable ))
{ {
LOGERROR( "获取模块[%s]的输入 使能 的值失败", m_stModKey.toString().c_str()); LOGERROR( "获取模块[%s]的输入 使能 的值失败", m_stModKey.toString().c_str());
return kbdFailed; return iotFailed;
} }
//< 判断是否使能,检测到使能,放入命令队列 //< 判断是否使能,检测到使能,放入命令队列
if ( 0 != static_cast<int>(stInValEnable.m_dValue) && isValidOfStatus( stInValEnable.m_nStatus )) if ( 0 != static_cast<int>(stInValEnable.m_dValue) && isValidOfStatus( stInValEnable.m_nStatus ))
{ {
SFbdNumericValue stInValTargetVal; SFbdNumericValue stInValTargetVal;
if ( kbdSuccess != m_ptrDiagData->getNumericValByKey( m_stInKeyTargetVal, stInValTargetVal )) if ( iotSuccess != m_ptrDiagData->getNumericValByKey( m_stInKeyTargetVal, stInValTargetVal ))
{ {
LOGERROR( "获取模块[%s]的输入 目标值 的值失败", m_stModKey.toString().c_str()); LOGERROR( "获取模块[%s]的输入 目标值 的值失败", m_stModKey.toString().c_str());
return kbdFailed; return iotFailed;
} }
if ( isValidOfStatus( stInValTargetVal.m_nStatus )) if ( isValidOfStatus( stInValTargetVal.m_nStatus ))
@ -149,18 +149,18 @@ int CAoCtrl::calculate()
{ {
//< 为空,说明从输入获取 //< 为空,说明从输入获取
SFbdStringValue stInValCtrlStr; SFbdStringValue stInValCtrlStr;
if ( kbdSuccess != m_ptrDiagData->getStringValByKey( m_stInKeyCtrlStr, stInValCtrlStr )) if ( iotSuccess != m_ptrDiagData->getStringValByKey( m_stInKeyCtrlStr, stInValCtrlStr ))
{ {
LOGERROR( "获取模块[%s]的输入 测点 的值失败", m_stModKey.toString().c_str()); LOGERROR( "获取模块[%s]的输入 测点 的值失败", m_stModKey.toString().c_str());
return kbdFailed; return iotFailed;
} }
if ( kbdSuccess != parseKeyIdTag( stInValCtrlStr.m_strValue, *ptrCmd ) if ( iotSuccess != parseKeyIdTag( stInValCtrlStr.m_strValue, *ptrCmd )
|| ptrCmd->strKeyIdTag.empty()) || ptrCmd->strKeyIdTag.empty())
{ {
LOGERROR( "模块[%s]解析输入的控制测点串失败.strCtrlStr=[%s]", LOGERROR( "模块[%s]解析输入的控制测点串失败.strCtrlStr=[%s]",
m_stModKey.toString().c_str(), stInValCtrlStr.m_strValue.c_str()); m_stModKey.toString().c_str(), stInValCtrlStr.m_strValue.c_str());
return kbdFailed; return iotFailed;
} }
} }
@ -216,13 +216,13 @@ int CAoCtrl::calculate()
} }
} }
return kbdSuccess; return iotSuccess;
} }
int CAoCtrl::reset( const bool bMaster ) int CAoCtrl::reset( const bool bMaster )
{ {
int nRet = kbdSuccess; int nRet = iotSuccess;
if ( bMaster ) if ( bMaster )
{ {
if ( nullptr == m_pMbComm ) if ( nullptr == m_pMbComm )
@ -262,12 +262,12 @@ int CAoCtrl::initCtrlParam()
std::string strRetryTimes; //< 失败重试次数 std::string strRetryTimes; //< 失败重试次数
std::string strInPortCtrlStr; //< 输入控制测点串 std::string strInPortCtrlStr; //< 输入控制测点串
if ( kbdSuccess != m_ptrDiagData->getModProperty( m_stModKey, "ControlTimeout", strCtrlTimeout ) || if ( iotSuccess != m_ptrDiagData->getModProperty( m_stModKey, "ControlTimeout", strCtrlTimeout ) ||
kbdSuccess != m_ptrDiagData->getModProperty( m_stModKey, "RedoTimes", strRetryTimes ) || iotSuccess != m_ptrDiagData->getModProperty( m_stModKey, "RedoTimes", strRetryTimes ) ||
kbdSuccess != m_ptrDiagData->getModProperty( m_stModKey, "InPortCtrlStr", strInPortCtrlStr )) iotSuccess != m_ptrDiagData->getModProperty( m_stModKey, "InPortCtrlStr", strInPortCtrlStr ))
{ {
LOGERROR( "获取模块[%s]属性失败", m_stModKey.toString().c_str()); LOGERROR( "获取模块[%s]属性失败", m_stModKey.toString().c_str());
return kbdFailed; return iotFailed;
} }
//2.获取超时、失败后处理逻辑等参数 //2.获取超时、失败后处理逻辑等参数
@ -286,29 +286,29 @@ int CAoCtrl::initCtrlParam()
catch ( const std::exception &e ) catch ( const std::exception &e )
{ {
LOGERROR( "模块[%s]参数格式非法Err\n%s", m_stModKey.toString().c_str(), e.what()); LOGERROR( "模块[%s]参数格式非法Err\n%s", m_stModKey.toString().c_str(), e.what());
return kbdFailed; return iotFailed;
} }
//3.解析控制动作串 //3.解析控制动作串
if ( 0 == nInPortCtrlStr ) if ( 0 == nInPortCtrlStr )
{ {
std::string strCtrlStr; std::string strCtrlStr;
if ( kbdSuccess != m_ptrDiagData->getModProperty( m_stModKey, "CtrlStr", strCtrlStr )) if ( iotSuccess != m_ptrDiagData->getModProperty( m_stModKey, "CtrlStr", strCtrlStr ))
{ {
LOGERROR( "获取模块[%s]属性 CtrlStr 失败", m_stModKey.toString().c_str()); LOGERROR( "获取模块[%s]属性 CtrlStr 失败", m_stModKey.toString().c_str());
return kbdFailed; return iotFailed;
} }
//< m_stCmdCfgInfo.strKeyIdTag 必须不能为空,后续以此判断是否从输入端口获取测点串 //< m_stCmdCfgInfo.strKeyIdTag 必须不能为空,后续以此判断是否从输入端口获取测点串
if ( kbdSuccess != parseKeyIdTag( strCtrlStr, m_stCmdCfgInfo ) if ( iotSuccess != parseKeyIdTag( strCtrlStr, m_stCmdCfgInfo )
|| m_stCmdCfgInfo.strKeyIdTag.empty()) || m_stCmdCfgInfo.strKeyIdTag.empty())
{ {
LOGERROR( "模块[%s]解析控制测点串失败.strCtrlStr=[%s]", m_stModKey.toString().c_str(), strCtrlStr.c_str()); LOGERROR( "模块[%s]解析控制测点串失败.strCtrlStr=[%s]", m_stModKey.toString().c_str(), strCtrlStr.c_str());
return kbdFailed; return iotFailed;
} }
} }
return kbdSuccess; return iotSuccess;
} }
@ -338,7 +338,7 @@ int CAoCtrl::handleCmd( SCmdOfOnePnt &stCmdOfOnePnt )
} }
} }
return kbdSuccess; return iotSuccess;
} }
@ -467,38 +467,38 @@ int CAoCtrl::parseKeyIdTag( const std::string &strKeyIdTag, SCtrlCmd &stCtrlCmd
if ( strKeyIdTag.empty()) if ( strKeyIdTag.empty())
{ {
LOGERROR( "测点信息为空.module_name=[%s]", m_stModKey.toString().c_str()); LOGERROR( "测点信息为空.module_name=[%s]", m_stModKey.toString().c_str());
return kbdFailed; return iotFailed;
} }
SLongKeyIdTagInfo stKeyInfo; SLongKeyIdTagInfo stKeyInfo;
if ( kbdSuccess != splitLongKeyIdTag( strKeyIdTag, stKeyInfo )) if ( iotSuccess != splitLongKeyIdTag( strKeyIdTag, stKeyInfo ))
{ {
LOGERROR( "解析测点信息失败.KeyIdTag=[%s]", strKeyIdTag.c_str()); LOGERROR( "解析测点信息失败.KeyIdTag=[%s]", strKeyIdTag.c_str());
return kbdFailed; return iotFailed;
} }
CFbdSysInfoApiPtr ptrSysInfo = getFbdSysInfoApi(); CFbdSysInfoApiPtr ptrSysInfo = getFbdSysInfoApi();
if ( ptrSysInfo == nullptr ) if ( ptrSysInfo == nullptr )
{ {
LOGERROR( "获取系统信息库失败" ); LOGERROR( "获取系统信息库失败" );
return kbdFailed; return iotFailed;
} }
iot_public::SSubsystemInfo stSubsysInfo; iot_public::SSubsystemInfo stSubsysInfo;
iot_public::SLocationInfo stLocationInfo; iot_public::SLocationInfo stLocationInfo;
if ( kbdSuccess != ptrSysInfo->getSysInfo().getSubsystemInfoByName( stKeyInfo.strSubsystemName, stSubsysInfo ) || if ( iotSuccess != ptrSysInfo->getSysInfo().getSubsystemInfoByName( stKeyInfo.strSubsystemName, stSubsysInfo ) ||
kbdSuccess != ptrSysInfo->getSysInfo().getLocationInfoByName( stKeyInfo.strLocationName, stLocationInfo )) iotSuccess != ptrSysInfo->getSysInfo().getLocationInfoByName( stKeyInfo.strLocationName, stLocationInfo ))
{ {
LOGERROR( "获取测点所属域和应用信息失败.位置ID=[%s],专业ID=[%s]", LOGERROR( "获取测点所属域和应用信息失败.位置ID=[%s],专业ID=[%s]",
stKeyInfo.strSubsystemName.c_str(), stKeyInfo.strLocationName.c_str()); stKeyInfo.strSubsystemName.c_str(), stKeyInfo.strLocationName.c_str());
return kbdFailed; return iotFailed;
} }
stCtrlCmd.strKeyIdTag = stKeyInfo.strKeyExcludeLocSub; stCtrlCmd.strKeyIdTag = stKeyInfo.strKeyExcludeLocSub;
stCtrlCmd.nDstDomainId = stLocationInfo.nDomainId; stCtrlCmd.nDstDomainId = stLocationInfo.nDomainId;
stCtrlCmd.nAppId = stSubsysInfo.nAppId; stCtrlCmd.nAppId = stSubsysInfo.nAppId;
return kbdSuccess; return iotSuccess;
} }
@ -508,4 +508,4 @@ boost::shared_ptr<CAoCtrl> CAoCtrl::create()
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -17,7 +17,7 @@
#include "app_fbd/fbd_common/BaseModule.h" #include "app_fbd/fbd_common/BaseModule.h"
#include "app_fbd/fbd_common/FbdDiagDataApi.h" #include "app_fbd/fbd_common/FbdDiagDataApi.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -95,14 +95,14 @@ private:
private: private:
/** /**
@brief @brief
@return kbdSuccess, @return iotSuccess,
*/ */
int initCtrlParam(); int initCtrlParam();
/** /**
@brief @brief
@param stCmdOfOnePnt @param stCmdOfOnePnt
@return kbdSuccess, @return iotSuccess,
*/ */
int handleCmd( SCmdOfOnePnt &stCmdOfOnePnt ); int handleCmd( SCmdOfOnePnt &stCmdOfOnePnt );
@ -135,7 +135,7 @@ private:
@brief @brief
@param const std::string & strKeyIdTag @param const std::string & strKeyIdTag
@param SCtrlCmd & stCtrlCmd @param SCtrlCmd & stCtrlCmd
@return kbdSuccess, @return iotSuccess,
*/ */
int parseKeyIdTag( const std::string &strKeyIdTag, SCtrlCmd &stCtrlCmd ); int parseKeyIdTag( const std::string &strKeyIdTag, SCtrlCmd &stCtrlCmd );
@ -162,4 +162,4 @@ BOOST_DLL_ALIAS(
) )
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -13,7 +13,7 @@
#include "BitSplit.h" #include "BitSplit.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -41,22 +41,22 @@ int CBitSplit::init( const SFbdModKey &stModuleKey, const std::string & )
if ( m_ptrDiagData == nullptr ) if ( m_ptrDiagData == nullptr )
{ {
LOGERROR( "获取Diagram数据接口单例失败" ); LOGERROR( "获取Diagram数据接口单例失败" );
return kbdFailed; return iotFailed;
} }
//1.获取输入、输出参数 //1.获取输入、输出参数
if ( kbdSuccess != m_ptrDiagData->getValKeyByModInput( stModuleKey, 1, m_stInKey1 )) if ( iotSuccess != m_ptrDiagData->getValKeyByModInput( stModuleKey, 1, m_stInKey1 ))
{ {
LOGERROR( "获取模块[%s]的输入参数失败", stModuleKey.toString().c_str()); LOGERROR( "获取模块[%s]的输入参数失败", stModuleKey.toString().c_str());
return kbdFailed; return iotFailed;
} }
//< 获取输出参数 //< 获取输出参数
std::string strOutputNum = "0"; std::string strOutputNum = "0";
if ( kbdSuccess != m_ptrDiagData->getModProperty( stModuleKey, CN_SwitchINum, strOutputNum )) if ( iotSuccess != m_ptrDiagData->getModProperty( stModuleKey, CN_SwitchINum, strOutputNum ))
{ {
LOGERROR( "获取模块[%s]的输入参数数量失败", stModuleKey.toString().c_str()); LOGERROR( "获取模块[%s]的输入参数数量失败", stModuleKey.toString().c_str());
return kbdFailed; return iotFailed;
} }
m_nOutputNum = iot_public::StringToInt( strOutputNum ); m_nOutputNum = iot_public::StringToInt( strOutputNum );
@ -64,21 +64,21 @@ int CBitSplit::init( const SFbdModKey &stModuleKey, const std::string & )
{ {
LOGERROR( "模块[%s]要求的输出参数个数最小=%d,最大=%d", LOGERROR( "模块[%s]要求的输出参数个数最小=%d,最大=%d",
stModuleKey.toString().c_str(), CN_MinOutputNum, CN_MaxOutputNum ); stModuleKey.toString().c_str(), CN_MinOutputNum, CN_MaxOutputNum );
return kbdFailed; return iotFailed;
} }
m_vecOutputKey.resize( static_cast<unsigned long>(m_nOutputNum)); m_vecOutputKey.resize( static_cast<unsigned long>(m_nOutputNum));
for ( int i = 0; i < m_nOutputNum; ++i ) //< 获取输出参数主键 for ( int i = 0; i < m_nOutputNum; ++i ) //< 获取输出参数主键
{ {
if ( kbdSuccess != m_ptrDiagData->getValKeyByModOutput( stModuleKey, i + 1, m_vecOutputKey[i] )) if ( iotSuccess != m_ptrDiagData->getValKeyByModOutput( stModuleKey, i + 1, m_vecOutputKey[i] ))
{ {
LOGERROR( "获取模块[%s]的输入参数失败", stModuleKey.toString().c_str()); LOGERROR( "获取模块[%s]的输入参数失败", stModuleKey.toString().c_str());
return kbdFailed; return iotFailed;
} }
} }
LOGINFO( "[%s]加载成功", stModuleKey.toString().c_str()); LOGINFO( "[%s]加载成功", stModuleKey.toString().c_str());
return kbdSuccess; return iotSuccess;
} }
@ -88,7 +88,7 @@ int CBitSplit::calculate()
SFbdNumericValue stOutput( 0, CN_FBD_STATUS_Invalid ); SFbdNumericValue stOutput( 0, CN_FBD_STATUS_Invalid );
//< 获取输入参数的值和状态 //< 获取输入参数的值和状态
if ( kbdSuccess != m_ptrDiagData->getNumericValByKey( m_stInKey1, stInput1 )) if ( iotSuccess != m_ptrDiagData->getNumericValByKey( m_stInKey1, stInput1 ))
{ {
LOGERROR( "获取模块[%s]的输入参数失败", m_stModKey.toString().c_str()); LOGERROR( "获取模块[%s]的输入参数失败", m_stModKey.toString().c_str());
return setAllOutput( stOutput ); return setAllOutput( stOutput );
@ -98,14 +98,14 @@ int CBitSplit::calculate()
stOutput.m_nStatus = stInput1.m_nStatus; stOutput.m_nStatus = stInput1.m_nStatus;
boost::dynamic_bitset<> setBit( m_nOutputNum, static_cast<int>(stInput1.m_dValue)); boost::dynamic_bitset<> setBit( m_nOutputNum, static_cast<int>(stInput1.m_dValue));
int nRet = kbdSuccess; int nRet = iotSuccess;
for ( size_t i = 0; i < m_vecOutputKey.size(); ++i ) for ( size_t i = 0; i < m_vecOutputKey.size(); ++i )
{ {
stOutput.m_dValue = setBit[i]; stOutput.m_dValue = setBit[i];
if ( kbdSuccess != m_ptrDiagData->setNumericValByKey( m_vecOutputKey[i], stOutput )) if ( iotSuccess != m_ptrDiagData->setNumericValByKey( m_vecOutputKey[i], stOutput ))
{ {
LOGERROR( "设置[%s]输出值失败", m_vecOutputKey[i].toString().c_str()); LOGERROR( "设置[%s]输出值失败", m_vecOutputKey[i].toString().c_str());
nRet = kbdFailed; nRet = iotFailed;
} }
} }
@ -129,13 +129,13 @@ int CBitSplit::clean()
int CBitSplit::setAllOutput( const SFbdNumericValue &stValue ) int CBitSplit::setAllOutput( const SFbdNumericValue &stValue )
{ {
int nRet = kbdSuccess; int nRet = iotSuccess;
for ( size_t i = 0; i < m_vecOutputKey.size(); ++i ) for ( size_t i = 0; i < m_vecOutputKey.size(); ++i )
{ {
if ( kbdSuccess != m_ptrDiagData->setNumericValByKey( m_vecOutputKey[i], stValue )) if ( iotSuccess != m_ptrDiagData->setNumericValByKey( m_vecOutputKey[i], stValue ))
{ {
LOGERROR( "设置[%s]输出值失败", m_vecOutputKey[i].toString().c_str()); LOGERROR( "设置[%s]输出值失败", m_vecOutputKey[i].toString().c_str());
nRet = kbdFailed; nRet = iotFailed;
} }
} }
@ -149,4 +149,4 @@ boost::shared_ptr<CBitSplit> CBitSplit::create()
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -9,7 +9,7 @@
#include "app_fbd/fbd_common/BaseModule.h" #include "app_fbd/fbd_common/BaseModule.h"
#include "app_fbd/fbd_common/FbdDiagDataApi.h" #include "app_fbd/fbd_common/FbdDiagDataApi.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -36,7 +36,7 @@ private:
/** /**
@brief @brief
@param const SFbdNumericValue & stValue @param const SFbdNumericValue & stValue
@return kbdSuccess, @return iotSuccess,
*/ */
int setAllOutput( const SFbdNumericValue &stValue ); int setAllOutput( const SFbdNumericValue &stValue );
@ -56,5 +56,5 @@ BOOST_DLL_ALIAS(
) )
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -7,7 +7,7 @@
#include "app_fbd/fbd_common/FbdDiagDataStruct.h" #include "app_fbd/fbd_common/FbdDiagDataStruct.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -23,7 +23,7 @@ public:
@param const SFbdNumericValue & stInput1 @param const SFbdNumericValue & stInput1
@param const SFbdNumericValue & stInput2 @param const SFbdNumericValue & stInput2
@param SFbdNumericValue & stOutput @param SFbdNumericValue & stOutput
@return kbdSuccess, @return iotSuccess,
*/ */
virtual int compare( const SFbdNumericValue &stInput1, virtual int compare( const SFbdNumericValue &stInput1,
const SFbdNumericValue &stInput2, const SFbdNumericValue &stInput2,
@ -33,4 +33,4 @@ public:
typedef boost::shared_ptr<CCompareInterface> CCompareInterfacePtr; typedef boost::shared_ptr<CCompareInterface> CCompareInterfacePtr;
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -16,7 +16,7 @@
#include "LT.h" #include "LT.h"
#include "NE.h" #include "NE.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -45,16 +45,16 @@ int CCompareOpt::init( const SFbdModKey &stModuleKey, const std::string &strExtr
if ( m_ptrDiagData == nullptr ) if ( m_ptrDiagData == nullptr )
{ {
LOGERROR( "获取Diagram数据接口单例失败" ); LOGERROR( "获取Diagram数据接口单例失败" );
return kbdFailed; return iotFailed;
} }
//1.获取输入、输出参数 //1.获取输入、输出参数
if ( kbdSuccess != m_ptrDiagData->getValKeyByModInput( stModuleKey, 1, m_stInKey1 ) || if ( iotSuccess != m_ptrDiagData->getValKeyByModInput( stModuleKey, 1, m_stInKey1 ) ||
kbdSuccess != m_ptrDiagData->getValKeyByModInput( stModuleKey, 2, m_stInKey2 ) || iotSuccess != m_ptrDiagData->getValKeyByModInput( stModuleKey, 2, m_stInKey2 ) ||
kbdSuccess != m_ptrDiagData->getValKeyByModOutput( stModuleKey, 1, m_stOutputKey )) iotSuccess != m_ptrDiagData->getValKeyByModOutput( stModuleKey, 1, m_stOutputKey ))
{ {
LOGERROR( "获取模块[%s]的输入输出参数失败", stModuleKey.toString().c_str()); LOGERROR( "获取模块[%s]的输入输出参数失败", stModuleKey.toString().c_str());
return kbdFailed; return iotFailed;
} }
//< 创建比较函数处理类 //< 创建比较函数处理类
@ -62,11 +62,11 @@ int CCompareOpt::init( const SFbdModKey &stModuleKey, const std::string &strExtr
if ( m_ptrCompare == nullptr ) if ( m_ptrCompare == nullptr )
{ {
LOGERROR( "创建比较模块失败.ModName=[%s],compare=[%s]", stModuleKey.toString().c_str(), strExtraParam.c_str()); LOGERROR( "创建比较模块失败.ModName=[%s],compare=[%s]", stModuleKey.toString().c_str(), strExtraParam.c_str());
return kbdFailed; return iotFailed;
} }
LOGINFO( "[%s]加载成功", stModuleKey.toString().c_str()); LOGINFO( "[%s]加载成功", stModuleKey.toString().c_str());
return kbdSuccess; return iotSuccess;
} }
@ -76,13 +76,13 @@ int CCompareOpt::calculate()
SFbdNumericValue stInput2( 0, CN_FBD_STATUS_Invalid ); SFbdNumericValue stInput2( 0, CN_FBD_STATUS_Invalid );
SFbdNumericValue stOutput( 0, CN_FBD_STATUS_Invalid ); SFbdNumericValue stOutput( 0, CN_FBD_STATUS_Invalid );
if ( kbdSuccess != m_ptrDiagData->getNumericValByKey( m_stInKey1, stInput1 ) || if ( iotSuccess != m_ptrDiagData->getNumericValByKey( m_stInKey1, stInput1 ) ||
kbdSuccess != m_ptrDiagData->getNumericValByKey( m_stInKey2, stInput2 )) iotSuccess != m_ptrDiagData->getNumericValByKey( m_stInKey2, stInput2 ))
{ {
LOGERROR( "获取输入参数[%s]值失败", m_stModKey.toString().c_str()); LOGERROR( "获取输入参数[%s]值失败", m_stModKey.toString().c_str());
} }
if ( kbdSuccess != m_ptrCompare->compare( stInput1, stInput2, stOutput )) if ( iotSuccess != m_ptrCompare->compare( stInput1, stInput2, stOutput ))
{ {
LOGERROR( "模块[%s]执行比较操作失败", m_stModKey.toString().c_str()); LOGERROR( "模块[%s]执行比较操作失败", m_stModKey.toString().c_str());
} }
@ -144,4 +144,4 @@ boost::shared_ptr<CCompareOpt> CCompareOpt::create()
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -10,7 +10,7 @@
#include "app_fbd/fbd_common/FbdDiagDataApi.h" #include "app_fbd/fbd_common/FbdDiagDataApi.h"
#include "CompareInterface.h" #include "CompareInterface.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -54,4 +54,4 @@ BOOST_DLL_ALIAS(
) )
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -8,7 +8,7 @@
#include "EQ.h" #include "EQ.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -36,8 +36,8 @@ int CEQ::compare( const SFbdNumericValue &stInput1,
stOutput.m_nStatus = CN_FBD_STATUS_Invalid; stOutput.m_nStatus = CN_FBD_STATUS_Invalid;
} }
return kbdSuccess; return iotSuccess;
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -7,7 +7,7 @@
#include "CompareInterface.h" #include "CompareInterface.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -28,4 +28,4 @@ public:
typedef boost::shared_ptr<CEQ> CEQPtr; typedef boost::shared_ptr<CEQ> CEQPtr;
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -6,7 +6,7 @@
#include "GE.h" #include "GE.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -34,8 +34,8 @@ int CGE::compare( const SFbdNumericValue &stInput1,
stOutput.m_nStatus = CN_FBD_STATUS_Invalid; stOutput.m_nStatus = CN_FBD_STATUS_Invalid;
} }
return kbdSuccess; return iotSuccess;
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -7,7 +7,7 @@
#include "CompareInterface.h" #include "CompareInterface.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -27,4 +27,4 @@ public:
typedef boost::shared_ptr<CGE> CGEPtr; typedef boost::shared_ptr<CGE> CGEPtr;
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -6,7 +6,7 @@
#include "GT.h" #include "GT.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -37,8 +37,8 @@ int CGT::compare( const SFbdNumericValue &stInput1,
stOutput.m_nStatus = CN_FBD_STATUS_Invalid; stOutput.m_nStatus = CN_FBD_STATUS_Invalid;
} }
return kbdSuccess; return iotSuccess;
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -7,7 +7,7 @@
#include "CompareInterface.h" #include "CompareInterface.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -28,4 +28,4 @@ public:
typedef boost::shared_ptr<CGT> CGTPtr; typedef boost::shared_ptr<CGT> CGTPtr;
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -6,7 +6,7 @@
#include "LE.h" #include "LE.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -34,8 +34,8 @@ int CLE::compare( const SFbdNumericValue &stInput1,
stOutput.m_nStatus = CN_FBD_STATUS_Invalid; stOutput.m_nStatus = CN_FBD_STATUS_Invalid;
} }
return kbdSuccess; return iotSuccess;
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -7,7 +7,7 @@
#include "CompareInterface.h" #include "CompareInterface.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -28,4 +28,4 @@ public:
typedef boost::shared_ptr<CLE> CLEPtr; typedef boost::shared_ptr<CLE> CLEPtr;
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -6,7 +6,7 @@
#include "LT.h" #include "LT.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -37,8 +37,8 @@ int CLT::compare( const SFbdNumericValue &stInput1,
stOutput.m_nStatus = CN_FBD_STATUS_Invalid; stOutput.m_nStatus = CN_FBD_STATUS_Invalid;
} }
return kbdSuccess; return iotSuccess;
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -7,7 +7,7 @@
#include "CompareInterface.h" #include "CompareInterface.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -28,4 +28,4 @@ public:
typedef boost::shared_ptr<CLT> CLTPtr; typedef boost::shared_ptr<CLT> CLTPtr;
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -6,7 +6,7 @@
#include "NE.h" #include "NE.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -34,8 +34,8 @@ int CNE::compare( const SFbdNumericValue &stInput1,
stOutput.m_nStatus = CN_FBD_STATUS_Invalid; stOutput.m_nStatus = CN_FBD_STATUS_Invalid;
} }
return kbdSuccess; return iotSuccess;
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -7,7 +7,7 @@
#include "CompareInterface.h" #include "CompareInterface.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -27,4 +27,4 @@ public:
typedef boost::shared_ptr<CNE> CNEPtr; typedef boost::shared_ptr<CNE> CNEPtr;
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -5,7 +5,7 @@
*/ */
#include "BToI.h" #include "BToI.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -20,8 +20,8 @@ int CBToI::conv( const SFbdNumericValue &stInput, SFbdNumericValue &stOutput )
stOutput.m_dValue = static_cast<int>(stInput.m_dValue); stOutput.m_dValue = static_cast<int>(stInput.m_dValue);
stOutput.m_nStatus = stInput.m_nStatus; stOutput.m_nStatus = stInput.m_nStatus;
return kbdSuccess; return iotSuccess;
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -7,7 +7,7 @@
#include "DataTypeConvInterface.h" #include "DataTypeConvInterface.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -26,4 +26,4 @@ public:
typedef boost::shared_ptr<CBToI> CBToIPtr; typedef boost::shared_ptr<CBToI> CBToIPtr;
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -13,7 +13,7 @@
#include "IToB.h" #include "IToB.h"
#include "IToF.h" #include "IToF.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -41,15 +41,15 @@ int CDataTypeConv::init( const SFbdModKey &stModuleKey, const std::string &strEx
if ( m_ptrDiagData == nullptr ) if ( m_ptrDiagData == nullptr )
{ {
LOGERROR( "获取Diagram数据接口单例失败" ); LOGERROR( "获取Diagram数据接口单例失败" );
return kbdFailed; return iotFailed;
} }
//1.获取输入、输出参数 //1.获取输入、输出参数
if ( kbdSuccess != m_ptrDiagData->getValKeyByModInput( stModuleKey, 1, m_stInKey1 ) || if ( iotSuccess != m_ptrDiagData->getValKeyByModInput( stModuleKey, 1, m_stInKey1 ) ||
kbdSuccess != m_ptrDiagData->getValKeyByModOutput( stModuleKey, 1, m_stOutputKey )) iotSuccess != m_ptrDiagData->getValKeyByModOutput( stModuleKey, 1, m_stOutputKey ))
{ {
LOGERROR( "获取模块[%s]的输入输出参数失败", stModuleKey.toString().c_str()); LOGERROR( "获取模块[%s]的输入输出参数失败", stModuleKey.toString().c_str());
return kbdFailed; return iotFailed;
} }
//< 创建转换处理类 //< 创建转换处理类
@ -57,11 +57,11 @@ int CDataTypeConv::init( const SFbdModKey &stModuleKey, const std::string &strEx
if ( m_ptrConv == nullptr ) if ( m_ptrConv == nullptr )
{ {
LOGERROR( "创建运算模块失败.ModName=[%s],Calc=[%s]", stModuleKey.toString().c_str(), strExtraParam.c_str()); LOGERROR( "创建运算模块失败.ModName=[%s],Calc=[%s]", stModuleKey.toString().c_str(), strExtraParam.c_str());
return kbdFailed; return iotFailed;
} }
LOGINFO( "[%s]加载成功", stModuleKey.toString().c_str()); LOGINFO( "[%s]加载成功", stModuleKey.toString().c_str());
return kbdSuccess; return iotSuccess;
} }
@ -70,13 +70,13 @@ int CDataTypeConv::calculate()
SFbdNumericValue stInput( 0, CN_FBD_STATUS_Invalid ); SFbdNumericValue stInput( 0, CN_FBD_STATUS_Invalid );
SFbdNumericValue stOutput( 0, CN_FBD_STATUS_Invalid ); SFbdNumericValue stOutput( 0, CN_FBD_STATUS_Invalid );
if ( kbdSuccess != m_ptrDiagData->getNumericValByKey( m_stInKey1, stInput )) if ( iotSuccess != m_ptrDiagData->getNumericValByKey( m_stInKey1, stInput ))
{ {
LOGERROR( "获取参数[%s]值失败", m_stInKey1.toString().c_str()); LOGERROR( "获取参数[%s]值失败", m_stInKey1.toString().c_str());
} }
else else
{ {
if ( kbdSuccess != m_ptrConv->conv( stInput, stOutput )) if ( iotSuccess != m_ptrConv->conv( stInput, stOutput ))
{ {
LOGERROR( "模块[%s]转换失败", m_stModKey.toString().c_str()); LOGERROR( "模块[%s]转换失败", m_stModKey.toString().c_str());
} }
@ -131,4 +131,4 @@ boost::shared_ptr<CDataTypeConv> CDataTypeConv::create()
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -10,7 +10,7 @@
#include "app_fbd/fbd_common/FbdDiagDataApi.h" #include "app_fbd/fbd_common/FbdDiagDataApi.h"
#include "DataTypeConvInterface.h" #include "DataTypeConvInterface.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -58,4 +58,4 @@ BOOST_DLL_ALIAS(
) )
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -7,7 +7,7 @@
#include "app_fbd/fbd_common/FbdDiagDataStruct.h" #include "app_fbd/fbd_common/FbdDiagDataStruct.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -22,7 +22,7 @@ public:
@brief @brief
@param const SFbdNumericValue & stInput @param const SFbdNumericValue & stInput
@param SFbdNumericValue & stOutput @param SFbdNumericValue & stOutput
@return kbdSuccess, @return iotSuccess,
*/ */
virtual int conv( const SFbdNumericValue &stInput, virtual int conv( const SFbdNumericValue &stInput,
SFbdNumericValue &stOutput ) = 0; SFbdNumericValue &stOutput ) = 0;
@ -31,4 +31,4 @@ public:
typedef boost::shared_ptr<CDataTypeConvInterface> CDataTypeConvInterfacePtr; typedef boost::shared_ptr<CDataTypeConvInterface> CDataTypeConvInterfacePtr;
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -6,7 +6,7 @@
#include "FToI.h" #include "FToI.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -21,8 +21,8 @@ int CFToI::conv( const SFbdNumericValue &stInput, SFbdNumericValue &stOutput )
stOutput.m_dValue = static_cast<int>(stInput.m_dValue); stOutput.m_dValue = static_cast<int>(stInput.m_dValue);
stOutput.m_nStatus = stInput.m_nStatus; stOutput.m_nStatus = stInput.m_nStatus;
return kbdSuccess; return iotSuccess;
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -7,7 +7,7 @@
#include "DataTypeConvInterface.h" #include "DataTypeConvInterface.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -26,4 +26,4 @@ public:
typedef boost::shared_ptr<CFToI> CFToIPtr; typedef boost::shared_ptr<CFToI> CFToIPtr;
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -6,7 +6,7 @@
#include "IToB.h" #include "IToB.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -21,8 +21,8 @@ int CIToB::conv( const SFbdNumericValue &stInput, SFbdNumericValue &stOutput )
stOutput.m_dValue = ( static_cast<int>(stInput.m_dValue) != 0 ); stOutput.m_dValue = ( static_cast<int>(stInput.m_dValue) != 0 );
stOutput.m_nStatus = stInput.m_nStatus; stOutput.m_nStatus = stInput.m_nStatus;
return kbdSuccess; return iotSuccess;
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -7,7 +7,7 @@
#include "DataTypeConvInterface.h" #include "DataTypeConvInterface.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -26,4 +26,4 @@ public:
typedef boost::shared_ptr<CIToB> CIToBPtr; typedef boost::shared_ptr<CIToB> CIToBPtr;
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -6,7 +6,7 @@
#include "IToF.h" #include "IToF.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -21,8 +21,8 @@ int CIToF::conv( const SFbdNumericValue &stInput, SFbdNumericValue &stOutput )
stOutput.m_dValue = stInput.m_dValue; stOutput.m_dValue = stInput.m_dValue;
stOutput.m_nStatus = stInput.m_nStatus; stOutput.m_nStatus = stInput.m_nStatus;
return kbdSuccess; return iotSuccess;
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -7,7 +7,7 @@
#include "DataTypeConvInterface.h" #include "DataTypeConvInterface.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -26,4 +26,4 @@ public:
typedef boost::shared_ptr<CIToF> CIToFPtr; typedef boost::shared_ptr<CIToF> CIToFPtr;
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

View File

@ -20,7 +20,7 @@
#include "DoCtrl.h" #include "DoCtrl.h"
namespace kbd_app namespace iot_app
{ {
namespace app_fbd namespace app_fbd
{ {
@ -42,41 +42,41 @@ int CDoCtrl::init( const SFbdModKey &stModuleKey, const std::string & )
if ( m_ptrDiagData == nullptr ) if ( m_ptrDiagData == nullptr )
{ {
LOGERROR( "获取Diagram数据接口单例失败" ); LOGERROR( "获取Diagram数据接口单例失败" );
return kbdFailed; return iotFailed;
} }
//1.解析配置 //1.解析配置
if ( kbdSuccess != initCtrlParam()) if ( iotSuccess != initCtrlParam())
{ {
LOGERROR( "初始化模块[%s]的控制参数失败", stModuleKey.toString().c_str()); LOGERROR( "初始化模块[%s]的控制参数失败", stModuleKey.toString().c_str());
return kbdFailed; return iotFailed;
} }
//2.获取输入、输出参数 //2.获取输入、输出参数
if ( m_stCmdCfgInfo.strKeyIdTag.empty()) if ( m_stCmdCfgInfo.strKeyIdTag.empty())
{ {
//< 3个输入从输入动态获取测点串 //< 3个输入从输入动态获取测点串
if ( kbdSuccess != m_ptrDiagData->getValKeyByModInput( stModuleKey, 1, m_stInKeyCtrlStr ) || if ( iotSuccess != m_ptrDiagData->getValKeyByModInput( stModuleKey, 1, m_stInKeyCtrlStr ) ||
kbdSuccess != m_ptrDiagData->getValKeyByModInput( stModuleKey, 2, m_stInKeyTargetVal ) || iotSuccess != m_ptrDiagData->getValKeyByModInput( stModuleKey, 2, m_stInKeyTargetVal ) ||
kbdSuccess != m_ptrDiagData->getValKeyByModInput( stModuleKey, 3, m_stInKeyEnable )) iotSuccess != m_ptrDiagData->getValKeyByModInput( stModuleKey, 3, m_stInKeyEnable ))
{ {
LOGERROR( "获取模块[%s]的输入输出参数失败", stModuleKey.toString().c_str()); LOGERROR( "获取模块[%s]的输入输出参数失败", stModuleKey.toString().c_str());
return kbdFailed; return iotFailed;
} }
} }
else else
{ {
//< 2个输入测点串在配置中 //< 2个输入测点串在配置中
if ( kbdSuccess != m_ptrDiagData->getValKeyByModInput( stModuleKey, 1, m_stInKeyTargetVal ) || if ( iotSuccess != m_ptrDiagData->getValKeyByModInput( stModuleKey, 1, m_stInKeyTargetVal ) ||
kbdSuccess != m_ptrDiagData->getValKeyByModInput( stModuleKey, 2, m_stInKeyEnable )) iotSuccess != m_ptrDiagData->getValKeyByModInput( stModuleKey, 2, m_stInKeyEnable ))
{ {
LOGERROR( "获取模块[%s]的输入输出参数失败", stModuleKey.toString().c_str()); LOGERROR( "获取模块[%s]的输入输出参数失败", stModuleKey.toString().c_str());
return kbdFailed; return iotFailed;
} }
} }
LOGINFO( "[%s]加载成功", m_stModKey.toString().c_str()); LOGINFO( "[%s]加载成功", m_stModKey.toString().c_str());
return kbdSuccess; return iotSuccess;
} }
@ -87,7 +87,7 @@ int CDoCtrl::calculate()
if ( nullptr == m_pMbComm ) if ( nullptr == m_pMbComm )
{ {
LOGERROR( "通讯器指针为空,非预期,检查程序!" ); LOGERROR( "通讯器指针为空,非预期,检查程序!" );
return kbdFailed; return iotFailed;
} }
iot_net::CMbMessage objMsg; iot_net::CMbMessage objMsg;
@ -121,20 +121,20 @@ int CDoCtrl::calculate()
//< 获取输入 //< 获取输入
{ {
SFbdNumericValue stInValEnable; SFbdNumericValue stInValEnable;
if ( kbdSuccess != m_ptrDiagData->getNumericValByKey( m_stInKeyEnable, stInValEnable )) if ( iotSuccess != m_ptrDiagData->getNumericValByKey( m_stInKeyEnable, stInValEnable ))
{ {
LOGERROR( "获取模块[%s]的输入 使能 的值失败", m_stModKey.toString().c_str()); LOGERROR( "获取模块[%s]的输入 使能 的值失败", m_stModKey.toString().c_str());
return kbdFailed; return iotFailed;
} }
//< 判断是否使能,检测到使能,放入命令队列 //< 判断是否使能,检测到使能,放入命令队列
if ( 0 != static_cast<int>(stInValEnable.m_dValue) && isValidOfStatus( stInValEnable.m_nStatus )) if ( 0 != static_cast<int>(stInValEnable.m_dValue) && isValidOfStatus( stInValEnable.m_nStatus ))
{ {
SFbdNumericValue stInValTargetVal; SFbdNumericValue stInValTargetVal;
if ( kbdSuccess != m_ptrDiagData->getNumericValByKey( m_stInKeyTargetVal, stInValTargetVal )) if ( iotSuccess != m_ptrDiagData->getNumericValByKey( m_stInKeyTargetVal, stInValTargetVal ))
{ {
LOGERROR( "获取模块[%s]的输入 目标值 的值失败", m_stModKey.toString().c_str()); LOGERROR( "获取模块[%s]的输入 目标值 的值失败", m_stModKey.toString().c_str());
return kbdFailed; return iotFailed;
} }
if ( isValidOfStatus( stInValTargetVal.m_nStatus )) if ( isValidOfStatus( stInValTargetVal.m_nStatus ))
@ -149,18 +149,18 @@ int CDoCtrl::calculate()
{ {
//< 为空,说明从输入获取 //< 为空,说明从输入获取
SFbdStringValue stInValCtrlStr; SFbdStringValue stInValCtrlStr;
if ( kbdSuccess != m_ptrDiagData->getStringValByKey( m_stInKeyCtrlStr, stInValCtrlStr )) if ( iotSuccess != m_ptrDiagData->getStringValByKey( m_stInKeyCtrlStr, stInValCtrlStr ))
{ {
LOGERROR( "获取模块[%s]的输入 测点 的值失败", m_stModKey.toString().c_str()); LOGERROR( "获取模块[%s]的输入 测点 的值失败", m_stModKey.toString().c_str());
return kbdFailed; return iotFailed;
} }
if ( kbdSuccess != parseKeyIdTag( stInValCtrlStr.m_strValue, *ptrCmd ) if ( iotSuccess != parseKeyIdTag( stInValCtrlStr.m_strValue, *ptrCmd )
|| ptrCmd->strKeyIdTag.empty()) || ptrCmd->strKeyIdTag.empty())
{ {
LOGERROR( "模块[%s]解析输入的控制测点串失败.strCtrlStr=[%s]", LOGERROR( "模块[%s]解析输入的控制测点串失败.strCtrlStr=[%s]",
m_stModKey.toString().c_str(), stInValCtrlStr.m_strValue.c_str()); m_stModKey.toString().c_str(), stInValCtrlStr.m_strValue.c_str());
return kbdFailed; return iotFailed;
} }
} }
@ -218,13 +218,13 @@ int CDoCtrl::calculate()
} }
} }
return kbdSuccess; return iotSuccess;
} }
int CDoCtrl::reset( const bool bMaster ) int CDoCtrl::reset( const bool bMaster )
{ {
int nRet = kbdSuccess; int nRet = iotSuccess;
if ( bMaster ) if ( bMaster )
{ {
if ( nullptr == m_pMbComm ) if ( nullptr == m_pMbComm )
@ -264,12 +264,12 @@ int CDoCtrl::initCtrlParam()
std::string strRetryTimes; //< 失败重试次数 std::string strRetryTimes; //< 失败重试次数
std::string strInPortCtrlStr; //< 输入控制测点串 std::string strInPortCtrlStr; //< 输入控制测点串
if ( kbdSuccess != m_ptrDiagData->getModProperty( m_stModKey, "ControlTimeout", strCtrlTimeout ) || if ( iotSuccess != m_ptrDiagData->getModProperty( m_stModKey, "ControlTimeout", strCtrlTimeout ) ||
kbdSuccess != m_ptrDiagData->getModProperty( m_stModKey, "RedoTimes", strRetryTimes ) || iotSuccess != m_ptrDiagData->getModProperty( m_stModKey, "RedoTimes", strRetryTimes ) ||
kbdSuccess != m_ptrDiagData->getModProperty( m_stModKey, "InPortCtrlStr", strInPortCtrlStr )) iotSuccess != m_ptrDiagData->getModProperty( m_stModKey, "InPortCtrlStr", strInPortCtrlStr ))
{ {
LOGERROR( "获取模块[%s]属性失败", m_stModKey.toString().c_str()); LOGERROR( "获取模块[%s]属性失败", m_stModKey.toString().c_str());
return kbdFailed; return iotFailed;
} }
//2.获取超时、失败后处理逻辑等参数 //2.获取超时、失败后处理逻辑等参数
@ -288,29 +288,29 @@ int CDoCtrl::initCtrlParam()
catch ( const std::exception &e ) catch ( const std::exception &e )
{ {
LOGERROR( "模块[%s]参数格式非法Err\n%s", m_stModKey.toString().c_str(), e.what()); LOGERROR( "模块[%s]参数格式非法Err\n%s", m_stModKey.toString().c_str(), e.what());
return kbdFailed; return iotFailed;
} }
//3.解析控制动作串 //3.解析控制动作串
if ( 0 == nInPortCtrlStr ) if ( 0 == nInPortCtrlStr )
{ {
std::string strCtrlStr; std::string strCtrlStr;
if ( kbdSuccess != m_ptrDiagData->getModProperty( m_stModKey, "CtrlStr", strCtrlStr )) if ( iotSuccess != m_ptrDiagData->getModProperty( m_stModKey, "CtrlStr", strCtrlStr ))
{ {
LOGERROR( "获取模块[%s]属性 CtrlStr 失败", m_stModKey.toString().c_str()); LOGERROR( "获取模块[%s]属性 CtrlStr 失败", m_stModKey.toString().c_str());
return kbdFailed; return iotFailed;
} }
//< m_stCmdCfgInfo.strKeyIdTag 必须不能为空,后续以此判断是否从输入端口获取测点串 //< m_stCmdCfgInfo.strKeyIdTag 必须不能为空,后续以此判断是否从输入端口获取测点串
if ( kbdSuccess != parseKeyIdTag( strCtrlStr, m_stCmdCfgInfo ) if ( iotSuccess != parseKeyIdTag( strCtrlStr, m_stCmdCfgInfo )
|| m_stCmdCfgInfo.strKeyIdTag.empty()) || m_stCmdCfgInfo.strKeyIdTag.empty())
{ {
LOGERROR( "模块[%s]解析控制测点串失败.strCtrlStr=[%s]", m_stModKey.toString().c_str(), strCtrlStr.c_str()); LOGERROR( "模块[%s]解析控制测点串失败.strCtrlStr=[%s]", m_stModKey.toString().c_str(), strCtrlStr.c_str());
return kbdFailed; return iotFailed;
} }
} }
return kbdSuccess; return iotSuccess;
} }
@ -340,7 +340,7 @@ int CDoCtrl::handleCmd( SCmdOfOnePnt &stCmdOfOnePnt )
} }
} }
return kbdSuccess; return iotSuccess;
} }
@ -469,38 +469,38 @@ int CDoCtrl::parseKeyIdTag( const std::string &strKeyIdTag, SCtrlCmd &stCtrlCmd
if ( strKeyIdTag.empty()) if ( strKeyIdTag.empty())
{ {
LOGERROR( "测点信息为空.module_name=[%s]", m_stModKey.toString().c_str()); LOGERROR( "测点信息为空.module_name=[%s]", m_stModKey.toString().c_str());
return kbdFailed; return iotFailed;
} }
SLongKeyIdTagInfo stKeyInfo; SLongKeyIdTagInfo stKeyInfo;
if ( kbdSuccess != splitLongKeyIdTag( strKeyIdTag, stKeyInfo )) if ( iotSuccess != splitLongKeyIdTag( strKeyIdTag, stKeyInfo ))
{ {
LOGERROR( "解析测点信息失败.KeyIdTag=[%s]", strKeyIdTag.c_str()); LOGERROR( "解析测点信息失败.KeyIdTag=[%s]", strKeyIdTag.c_str());
return kbdFailed; return iotFailed;
} }
CFbdSysInfoApiPtr ptrSysInfo = getFbdSysInfoApi(); CFbdSysInfoApiPtr ptrSysInfo = getFbdSysInfoApi();
if ( ptrSysInfo == nullptr ) if ( ptrSysInfo == nullptr )
{ {
LOGERROR( "获取系统信息库失败" ); LOGERROR( "获取系统信息库失败" );
return kbdFailed; return iotFailed;
} }
iot_public::SSubsystemInfo stSubsysInfo; iot_public::SSubsystemInfo stSubsysInfo;
iot_public::SLocationInfo stLocationInfo; iot_public::SLocationInfo stLocationInfo;
if ( kbdSuccess != ptrSysInfo->getSysInfo().getSubsystemInfoByName( stKeyInfo.strSubsystemName, stSubsysInfo ) || if ( iotSuccess != ptrSysInfo->getSysInfo().getSubsystemInfoByName( stKeyInfo.strSubsystemName, stSubsysInfo ) ||
kbdSuccess != ptrSysInfo->getSysInfo().getLocationInfoByName( stKeyInfo.strLocationName, stLocationInfo )) iotSuccess != ptrSysInfo->getSysInfo().getLocationInfoByName( stKeyInfo.strLocationName, stLocationInfo ))
{ {
LOGERROR( "获取测点所属域和应用信息失败.位置ID=[%s],专业ID=[%s]", LOGERROR( "获取测点所属域和应用信息失败.位置ID=[%s],专业ID=[%s]",
stKeyInfo.strSubsystemName.c_str(), stKeyInfo.strLocationName.c_str()); stKeyInfo.strSubsystemName.c_str(), stKeyInfo.strLocationName.c_str());
return kbdFailed; return iotFailed;
} }
stCtrlCmd.strKeyIdTag = stKeyInfo.strKeyExcludeLocSub; stCtrlCmd.strKeyIdTag = stKeyInfo.strKeyExcludeLocSub;
stCtrlCmd.nDstDomainId = stLocationInfo.nDomainId; stCtrlCmd.nDstDomainId = stLocationInfo.nDomainId;
stCtrlCmd.nAppId = stSubsysInfo.nAppId; stCtrlCmd.nAppId = stSubsysInfo.nAppId;
return kbdSuccess; return iotSuccess;
} }
@ -510,4 +510,4 @@ boost::shared_ptr<CDoCtrl> CDoCtrl::create()
} }
} //< namespace app_fbd } //< namespace app_fbd
} //< namespace kbd_app } //< namespace iot_app

Some files were not shown because too many files have changed in this diff Show More