CommondServer.cpp 920 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // CommondServer.cpp: implementation of the CCommondServer class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #include "stdafx.h"
  5. #include "DrawObj.h"
  6. #include "IDE.h"
  7. #include "commondserver.h"
  8. #include "Utility.h"
  9. #pragma warning (disable : 4244)
  10. CString GetBlockFromVarAddr(CString addr)
  11. {
  12. int pos = addr.Find('[');
  13. if (-1 != pos)
  14. {
  15. return addr.Left(pos);
  16. }
  17. return "";
  18. }
  19. //////////////////////////////////////////////////////////////////////
  20. // Construction/Destruction
  21. //////////////////////////////////////////////////////////////////////
  22. CCommondServer::CCommondServer()
  23. {
  24. }
  25. CCommondServer::~CCommondServer()
  26. {
  27. }
  28. void CCommondServer::PushCommondToDevice(CAction* action)
  29. {
  30. CAnalog* pAnalog = pVariantsManager->FindAnalog(action->m_strVariant);
  31. if (pAnalog == NULL)
  32. {
  33. return;
  34. }
  35. pAnalog->SetValue(atof(action->m_strActionValue));
  36. }