12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #include "stdafx.h"
- #include "CanDeviceMessageCenter.h"
- #include "IWorkflowManager.h"
- #include "DeviceHandlerManager.h"
- #include "DeviceDataDef.h"
- #include "IDeviceHandler.h"
- using namespace DIOS::Dev::Detail::MachineryECOM;
- CanDeviceMessageCenter *CanDeviceMessageCenter::m_instance = nullptr;
- CanDeviceMessageCenter::CanDeviceMessageCenter()
- {
- }
- CanDeviceMessageCenter::~CanDeviceMessageCenter()
- {
- }
- CanDeviceMessageCenter *CanDeviceMessageCenter::Instance()
- {
- if (m_instance == nullptr)
- {
- m_instance = new CanDeviceMessageCenter();
- }
- return m_instance;
- }
- void CanDeviceMessageCenter::OnMessageArrived(IWorkflowManager *workflowmanager, CanDeviceData *data)
- {
- if (!data)
- {
- return;
- }
- switch (data->stdid)
- {
- case CAN_STD_ID_COLLIMATOR:
- {
- auto devicehandelr = DeviceHandlerManager::Instance()->Resove(DEVICE_HANDLER_COLLIMATOR);
- if (devicehandelr)
- {
- devicehandelr->OnDeviceDataArrived(data->data, data->dlc);
- }
- }
- break;
- default:
- break;
- }
- }
|