NewModelDevice.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #pragma once
  2. #include "ModuleDevice.h"
  3. #include "ImagePool.h"
  4. #include "CCOS.Dev.IODevice.hpp"
  5. namespace nsDEV = CCOS::Dev;
  6. //ÊôÐÔAction
  7. typedef enum _AttrAction{
  8. ATTRACTION_GET,
  9. ATTRACTION_SET,
  10. ATTRACTION_ADD,
  11. ATTRACTION_DEL,
  12. ATTRACTION_UPDATE,
  13. ATTRACTION_DATA,
  14. ATTRACTION_MSG,
  15. ATTRACTION_MAX
  16. }ATTRACTION;
  17. //typedef bool(__stdcall* AutoCropProcessFunc)(LPVOID* pInArray, float* pMicroParam, int MicroParamNum, LPVOID* pOutArray, int nOutParamNum);
  18. typedef int(* ImageRotate)(unsigned short* input, int nWidth, int nHeight, unsigned int angle, unsigned short* output, int& outWidth, int& outHeight);
  19. typedef int(* ImageFlip)(unsigned short* input, int nWidth, int nHeight, int mode, unsigned short* output, int& outWidth, int& outHeight);
  20. class NewModelDevice : public ModuleDevice
  21. {
  22. std::unique_ptr <nsDEV::IODevice> m_pMidObject;
  23. ImagePoolEx* m_ImagePool;
  24. std::shared_ptr<LinuxEvent> m_DisconnectEvt;
  25. unsigned short m_nRotateAngle;
  26. unsigned short m_nFlipDirection;
  27. ImageRotate m_funcRoate;
  28. ImageFlip m_funcFlip;
  29. //std::vector<string> m_strSubTopics; //Òª¶©ÔĵÄÖ÷ÌâÁбí
  30. public:
  31. NewModelDevice();
  32. virtual ~NewModelDevice();
  33. void Init(unique_ptr <nsDEV::IODevice> &&pMid, std::shared_ptr<LinuxEvent> DisconnectEvt);
  34. virtual bool SYSTEM_CALL GetDeviceType(GUID &DevType);
  35. void DEVICE_ACTION OnPassiveDisconnected();
  36. void DEVICE_ACTION OnLog(int LogLevel, string Context);
  37. void DEVICE_ACTION OnSystemLog(int cmd, string Code, string Context, string SenderId = "");
  38. void DEVICE_ACTION NotifyCallBackEntry(int cmdType, string keyType, string Context);
  39. void DEVICE_ACTION RawDataNotifyCallBackEntry(int cmdType, string keyType, string Context, string Head, char *pRawData, int DataLength);
  40. void DEVICE_ACTION NotifyCallBackSetBlockSize(string QueName, DWORD BlockSize, DWORD FulBlockCount, DWORD PrevBlockSize, DWORD PrevBlockCount);
  41. virtual void SubscribeSelf() override;
  42. //get device resource
  43. RET_STATUS SYSTEM_CALL GetDeviceResource(ResDataObject PARAM_OUT *pDeviceResource) override;
  44. //normal sync routine,Request to device and response from device
  45. virtual RET_STATUS SYSTEM_CALL Request(ResDataObject PARAM_IN *pRequest, ResDataObject PARAM_OUT *pResponse);
  46. virtual RET_STATUS SYSTEM_CALL CmdToLogicDev(ResDataObject PARAM_IN *pCmd);
  47. //void OnSetClientID() override;
  48. RET_STATUS OnUpdate(const char* pszProperty, const char* pszValueUpdate, ResDataObject& resRespons) override;
  49. RET_STATUS OnDel(const char* pszPropery, ResDataObject& resDelValue, ResDataObject& resResponse) override;
  50. RET_STATUS OnAdd(const char* pszPropery, ResDataObject& reAddValue, ResDataObject& resResponse) override;
  51. RET_STATUS SetItem(const char* pszPropery, ResDataObject& resSetValue, ResDataObject& resResponse) override;
  52. RET_STATUS GetItem(const char* pszPropery, ResDataObject& resResponse) override;
  53. RET_STATUS OnAction(const char* pszActionName, const char* pszParams, ResDataObject& resResponse) override;
  54. /*
  55. void ConnectMQTTServer();
  56. void NOTIFY(string topic, string context);
  57. void DispatchAction(string topic, string context);
  58. void ReSubscribe();
  59. void SubscribeOne(string topic, bool unSubscribe=false);
  60. void SubscribeAction();*/
  61. };