WheelOemDevice.cpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #include "StdAfx.h"
  2. #include "WheelOemDevice.h"
  3. #define CRTDBG_MAP_ALLOC
  4. #include <stdlib.h>
  5. #include <crtdbg.h>
  6. //------------------OEM device----------------------------
  7. Wheel_OemDevice::Wheel_OemDevice(void)
  8. {
  9. }
  10. Wheel_OemDevice::~Wheel_OemDevice(void)
  11. {
  12. }
  13. //Data Access
  14. int Wheel_OemDevice::GetStatus(bool &status)
  15. {
  16. //two way to get status
  17. //interrupt way,just get data
  18. return WheelUnitLogic::GetStatus(status);
  19. //Ñ­»·¶ÁÈ¡µÄ·½·¨,get it from device,and update data
  20. }
  21. int Wheel_OemDevice::SetStatus(bool status)
  22. {
  23. return WheelUnitLogic::SetStatus(status);
  24. }
  25. //Actions
  26. int Wheel_OemDevice::StartRoll()
  27. {
  28. int m_Round = 1;
  29. TPRINTA_TRACE("Trace:Round %d Start-----------------------------", m_Round++);
  30. TPRINTA_DEBUG("Debug:Round %d Start-----------------------------", m_Round++);
  31. TPRINTA_INFO("Info:Round %d Start-----------------------------", m_Round++);
  32. TPRINTA_WARN("Warning:Round %d Start-----------------------------", m_Round++);
  33. TPRINTA_ERROR("Error:Round %d Start-----------------------------", m_Round++);
  34. TPRINTA_FATAL("Fatal:Round %d Start-----------------------------", m_Round++);
  35. //make warning&errors
  36. return SetStatus(true);
  37. }
  38. int Wheel_OemDevice::StopRoll()
  39. {
  40. //make warning&errors
  41. return SetStatus(false);
  42. }
  43. //we need check each action resource is Support or not
  44. //return yes or no inside of OEM module
  45. bool Wheel_OemDevice::Support_GetStatus()
  46. {
  47. return false;
  48. }
  49. bool Wheel_OemDevice::Support_SetStatus()
  50. {
  51. return false;
  52. }
  53. bool Wheel_OemDevice::Support_StartRoll()
  54. {
  55. return true;
  56. }
  57. bool Wheel_OemDevice::Support_StopRoll()
  58. {
  59. return true;
  60. }
  61. int DEVICE_ACTION Wheel_OemDevice::ChangeStatus(bool PARAM_IN st)
  62. {
  63. RET_STATUS ret = RET_SUCCEED;
  64. bool status;
  65. GetStatus(status);
  66. if (st)
  67. {
  68. ret = (RET_STATUS)SetStatus(!status);
  69. }
  70. return ret;
  71. }
  72. bool DEVICE_SUPPORT Wheel_OemDevice::Support_ChangeStatus()
  73. {
  74. return true;
  75. }