DME.ConfigInfo.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //
  2. #include "stdafx.h"
  3. #include "ResDataObject.h"
  4. #include "Collimator.ConfigInfo.hpp"
  5. using namespace DIOS::Dev::Detail;
  6. using namespace DIOS::Dev::Detail::Collimator;
  7. //-----------------------------------------------------------------------------
  8. // ConfigInfo
  9. //-----------------------------------------------------------------------------
  10. ConfigInfo::ConfigInfo (const char* Key, const char* strType, const char* strAccess, const char* strRequired, const char* strDefaultValue)
  11. {
  12. strConfKey = Key;
  13. ResDataObject temp;
  14. temp.update ("Type", strType);
  15. temp.update ("Access", strAccess);
  16. temp.update ("Required", strRequired);
  17. temp.update ("DefaultValue", strDefaultValue);
  18. resDescription = temp.encode ();
  19. }
  20. ConfigInfo::~ConfigInfo ()
  21. {
  22. }
  23. void ConfigInfo::SetList (const char* str)
  24. {
  25. ResDataObject temp;
  26. temp.decode (resDescription.c_str ());
  27. temp.update ("List", str);
  28. resDescription = temp.encode ();
  29. }
  30. void ConfigInfo::SetRange (const char* strmin, const char* strmax)
  31. {
  32. ResDataObject temp;
  33. temp.decode (resDescription.c_str ());
  34. temp.update ("RangeMin", strmin);
  35. temp.update ("RangeMax", strmax);
  36. resDescription = temp.encode ();
  37. }
  38. const char* ConfigInfo::GetDescription ()
  39. {
  40. return resDescription.c_str ();
  41. }
  42. const char* ConfigInfo::GetCurrentValue ()
  43. {
  44. return resValue.c_str ();
  45. }
  46. void ConfigInfo::SetCurrentValue (const char* res)
  47. {
  48. resValue = res;
  49. }
  50. const char* ConfigInfo::GetKey ()
  51. {
  52. return strConfKey.c_str ();
  53. }