123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- // CCOS.Dev.FPDDriverMould.cpp : 定义 DLL 应用程序的导出函数。
- //
- #include "stdafx.h"
- #include "EasyJSONEncoder.hpp"
- #include "CCOS.Dev.FPDDeviceMould.hpp"
- #include "common_api.h"
- using namespace CCOS::Dev::Detail::Detector;
- namespace nsFPD = CCOS::Dev::Detail::Detector;
- template <typename _Container, typename T>
- inline _Container & operator << (_Container & ar, const T & t)
- {
- //ar.push_back(t);
- return ar;
- }
- Log4CPP::Logger* gLogger = nullptr;
- FPDDeviceMould::FPDDeviceMould(/*std::shared_ptr <IOEventCenter> center) : super(center*/)
- {
- m_strIODevicePath = "/Detector";
- if (gLogger == nullptr)
- {
- string strLogPath = GetProcessDirectory() + R"(\OEMDrivers\Detector\Conf\Log4CPP.Config.FPD.xml)";
- Log4CPP::GlobalContext::Map::Set(ZSKK::Utility::Hash("LogFileName"), "FPD.Mould");
- auto rc = Log4CPP::LogManager::LoadConfigFile(strLogPath.c_str());
- gLogger = Log4CPP::LogManager::GetLogger("FPD.Mould");
- }
- Info("------------version 3.0.0.0------------");
- }
- FPDDeviceMould::~FPDDeviceMould()
- {}
- nsFPD::FPDDriverMould::FPDDriverMould()
- {
- }
- nsFPD::FPDDriverMould::~FPDDriverMould()
- {
- }
- std::string nsFPD::FPDDriverMould::GetGUID() const
- {
- return UltrasonicDriverType;
- }
- void nsFPD::FPDDriverMould::AddConfig(ConfigInfo config)
- {
- m_ConfigInfo << config;
- }
- ConfigInfo::ConfigInfo(const char* Key, const char* strType, const char* strAccess, const char* strRequired, const char* strDefaultValue)
- {
- strConfKey = Key;
- ResDataObject temp;
- temp.update(AttributeType, strType);
- temp.update(AttributeAccess, strAccess);
- temp.update(AttributeRequired, strRequired);
- temp.update(AttributeDefaultValue, strDefaultValue);
- resDescription = temp.encode();
- }
- ConfigInfo::~ConfigInfo()
- {
- }
- void ConfigInfo::SetList(const char* str)
- {
- ResDataObject temp;
- temp.decode(resDescription.c_str());
- temp.update(AttributeList, str);
- resDescription = temp.encode();
- }
- void ConfigInfo::SetRange(const char* strmin, const char* strmax)
- {
- ResDataObject temp;
- temp.decode(resDescription.c_str());
- temp.update(AttributeRangeMin, strmin);
- temp.update(AttributeRangeMax, strmax);
- resDescription = temp.encode();
- }
- const char* ConfigInfo::GetDescription()
- {
- return resDescription.c_str();
- }
- const char* ConfigInfo::GetCurrentValue()
- {
- return resValue.c_str();
- }
- void ConfigInfo::SetCurrentValue(const char* res)
- {
- resValue = res;
- }
- const char* ConfigInfo::GetKey()
- {
- return strConfKey.c_str();
- }
|