12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- #include "StdAfx.h"
- #include "WheelOemDevice.h"
- #define CRTDBG_MAP_ALLOC
- #include <stdlib.h>
- #include <crtdbg.h>
- //------------------OEM device----------------------------
- Wheel_OemDevice::Wheel_OemDevice(void)
- {
- }
- Wheel_OemDevice::~Wheel_OemDevice(void)
- {
- }
- //Data Access
- int Wheel_OemDevice::GetStatus(bool &status)
- {
- //two way to get status
- //interrupt way,just get data
- return WheelUnitLogic::GetStatus(status);
- //Ñ»·¶ÁÈ¡µÄ·½·¨,get it from device,and update data
- }
- int Wheel_OemDevice::SetStatus(bool status)
- {
- return WheelUnitLogic::SetStatus(status);
- }
- //Actions
- int Wheel_OemDevice::StartRoll()
- {
- int m_Round = 1;
- TPRINTA_TRACE("Trace:Round %d Start-----------------------------", m_Round++);
- TPRINTA_DEBUG("Debug:Round %d Start-----------------------------", m_Round++);
- TPRINTA_INFO("Info:Round %d Start-----------------------------", m_Round++);
- TPRINTA_WARN("Warning:Round %d Start-----------------------------", m_Round++);
- TPRINTA_ERROR("Error:Round %d Start-----------------------------", m_Round++);
- TPRINTA_FATAL("Fatal:Round %d Start-----------------------------", m_Round++);
- //make warning&errors
- return SetStatus(true);
- }
- int Wheel_OemDevice::StopRoll()
- {
- //make warning&errors
- return SetStatus(false);
- }
- //we need check each action resource is Support or not
- //return yes or no inside of OEM module
- bool Wheel_OemDevice::Support_GetStatus()
- {
- return false;
- }
- bool Wheel_OemDevice::Support_SetStatus()
- {
- return false;
- }
- bool Wheel_OemDevice::Support_StartRoll()
- {
- return true;
- }
- bool Wheel_OemDevice::Support_StopRoll()
- {
- return true;
- }
- int DEVICE_ACTION Wheel_OemDevice::ChangeStatus(bool PARAM_IN st)
- {
- RET_STATUS ret = RET_SUCCEED;
- bool status;
- GetStatus(status);
- if (st)
- {
- ret = (RET_STATUS)SetStatus(!status);
- }
- return ret;
- }
- bool DEVICE_SUPPORT Wheel_OemDevice::Support_ChangeStatus()
- {
- return true;
- }
|