CCOS.Dev.FPDDeviceMould.cpp 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. // CCOS.Dev.FPDDriverMould.cpp : 定义 DLL 应用程序的导出函数。
  2. //
  3. #include "FileVersion.hpp"
  4. #include "EasyJSONEncoder.hpp"
  5. #include "CCOS.Dev.FPDDeviceMould.hpp"
  6. #include "common_api.h"
  7. using namespace CCOS::Dev::Detail::Detector;
  8. namespace nsFPD = CCOS::Dev::Detail::Detector;
  9. extern const char* g_szMouldPath;
  10. //Log4CPP::Logger* ////mLog::gLogger = nullptr;
  11. template <typename _Container, typename T>
  12. inline _Container & operator << (_Container & ar, const T & t)
  13. {
  14. //ar.push_back(t);
  15. return ar;
  16. }
  17. FPDDeviceMould::FPDDeviceMould()
  18. {
  19. m_strIODevicePath = "/Detector";
  20. // if (//mLog::gLogger == nullptr)
  21. // {
  22. // string strLogPath = GetProcessDirectory() + R"(\Conf\Log4CPP.Config.xml)";
  23. // auto rc = Log4CPP::LogManager::LoadConfigFile(strLogPath.c_str());
  24. // ////mLog::gLogger = Log4CPP::LogManager::GetLogger("Module");
  25. //
  26. // ////mLog::FINFO("Code Build datetime [{$} {$}]", __DATE__, __TIME__);
  27. //#ifdef _WIN64
  28. // ////mLog::FINFO("=============================Version: {$} (64-bit)==================================", FileVersion(g_szMouldPath).GetVersionString());
  29. //#else
  30. // ////mLog::FINFO("=============================Version: {$} (32-bit)==================================", FileVersion(g_szMouldPath).GetVersionString());
  31. //#endif
  32. // }
  33. }
  34. FPDDeviceMould::~FPDDeviceMould()
  35. {
  36. }
  37. nsFPD::FPDDriverMould::FPDDriverMould()
  38. {
  39. }
  40. nsFPD::FPDDriverMould::~FPDDriverMould()
  41. {
  42. }
  43. std::string nsFPD::FPDDriverMould::GetGUID() const
  44. {
  45. return DetectorDriverType;
  46. }
  47. void nsFPD::FPDDriverMould::AddConfig(ConfigInfo config)
  48. {
  49. m_ConfigInfo << config;
  50. }
  51. ConfigInfo::ConfigInfo(const char* Key, const char* strType, const char* strAccess, const char* strRequired, const char* strDefaultValue)
  52. {
  53. strConfKey = Key;
  54. ResDataObject temp;
  55. temp.update(AttributeType, strType);
  56. temp.update(AttributeAccess, strAccess);
  57. temp.update(AttributeRequired, strRequired);
  58. temp.update(AttributeDefaultValue, strDefaultValue);
  59. resDescription = temp.encode();
  60. }
  61. ConfigInfo::~ConfigInfo()
  62. {
  63. }
  64. void ConfigInfo::SetList(const char* str)
  65. {
  66. ResDataObject temp;
  67. temp.decode(resDescription.c_str());
  68. temp.update(AttributeList, str);
  69. resDescription = temp.encode();
  70. }
  71. void ConfigInfo::SetRange(const char* strmin, const char* strmax)
  72. {
  73. ResDataObject temp;
  74. temp.decode(resDescription.c_str());
  75. temp.update(AttributeRangeMin, strmin);
  76. temp.update(AttributeRangeMax, strmax);
  77. resDescription = temp.encode();
  78. }
  79. const char* ConfigInfo::GetDescription()
  80. {
  81. return resDescription.c_str();
  82. }
  83. const char* ConfigInfo::GetCurrentValue()
  84. {
  85. return resValue.c_str();
  86. }
  87. void ConfigInfo::SetCurrentValue(const char* res)
  88. {
  89. resValue = res;
  90. }
  91. const char* ConfigInfo::GetKey()
  92. {
  93. return strConfKey.c_str();
  94. }