DAP.BasicMoulds.hpp 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #pragma once
  2. #include <string>
  3. #include <algorithm>
  4. using namespace std;
  5. //
  6. //#include "TmplMould.tlh"
  7. //#include "TmplMould.tli"
  8. #include "DIOS.Dev.MouldDefine.hpp"
  9. #pragma warning (disable:4244) // warning C4244: “初始化”: 从“double”转换到“float”,可能丢失数据
  10. namespace DIOS::Dev::Detail
  11. {
  12. namespace DAP
  13. {
  14. static const char* DeviceDriverType = "{18FDF176-DECE-445F-A52C-A14BDD3AC2C1}";
  15. static const char* DAPUnitType = "{123492D6-A546-4ACF-8EF1-2CCAA9EA974E}";
  16. namespace AttrKey
  17. {
  18. static const char* DAP = "DAP";
  19. }
  20. namespace ActionKey
  21. {
  22. static const char* Clear_DAP = "Clear_DAP";
  23. static const char* GetValue_DAP = "GetValue_DAP";
  24. }
  25. ////-----------------------------------------------------------------------------
  26. //// FloatMould
  27. ////-----------------------------------------------------------------------------
  28. //class FloatMould : public TmplMould <float>
  29. //{
  30. // using super = TmplMould <float>;
  31. //public:
  32. // FloatMould(const char* strkey, float initialvalue, float min, float max, float accuracy)
  33. // :super(initialvalue, min, max, accuracy)
  34. // {
  35. // Key = strkey;
  36. // m_Value = initialvalue;
  37. // }
  38. //
  39. // ~FloatMould() {}
  40. // std::string GetDescription ();
  41. // std::string GetAttribute ();
  42. // std::string JSGet();
  43. // std::string GetKey();
  44. //protected:
  45. // std::string Key;
  46. //};
  47. //-----------------------------------------------------------------------------
  48. // DOSEMould
  49. //-----------------------------------------------------------------------------
  50. class DOSEMould : public FloatMould
  51. {
  52. using super = FloatMould;
  53. public:
  54. DOSEMould(float initialvalue, float min, float max, float accuracy)
  55. :super(AttrKey::DAP, initialvalue, min, max, accuracy) {}
  56. ~DOSEMould() {}
  57. static constexpr const char * Unit { "dGycm2" };
  58. std::string strUnit = Unit;
  59. //std::string GetDescription();
  60. };
  61. //-----------------------------------------------------------------------------
  62. // ConfigInfo
  63. //-----------------------------------------------------------------------------
  64. namespace ConfKey
  65. {
  66. static const char* DiosType = "Vender";
  67. static const char* DiosModel = "Model";
  68. static const char* DiosConfig = "DeviceConfig";
  69. static const char* DiosAttribute = "Attribute";
  70. static const char* DiosDescription = "Description";
  71. static const char* DiosSCFType = "SCFType";
  72. static const char* DiosSCFTCPIP = "TCPIP";
  73. static const char* DiosSCFCOM = "COM";
  74. static const char* DiosSCFIP = "ip";
  75. static const char* DiosSCFPort = "port";
  76. static const char* DiosSCFBaudrate = "baudrate";
  77. static const char* DiosSCFBytesize = "bytesize";
  78. static const char* DiosSCFParity = "parity";
  79. static const char* DiosSCFStopbits = "stopbits";
  80. static const char* DiosIsConnect = "IsConnect";
  81. }
  82. }
  83. }