#pragma once #include "ModuleDevice.h" #include "ImagePool.h" #include "CCOS.Dev.IODevice.hpp" namespace nsDEV = CCOS::Dev; //属性Action typedef enum _AttrAction{ ATTRACTION_GET, ATTRACTION_SET, ATTRACTION_ADD, ATTRACTION_DEL, ATTRACTION_UPDATE, ATTRACTION_DATA, ATTRACTION_MSG, ATTRACTION_MAX }ATTRACTION; //typedef bool(__stdcall* AutoCropProcessFunc)(LPVOID* pInArray, float* pMicroParam, int MicroParamNum, LPVOID* pOutArray, int nOutParamNum); typedef int(* ImageRotate)(unsigned short* input, int nWidth, int nHeight, unsigned int angle, unsigned short* output, int& outWidth, int& outHeight); typedef int(* ImageFlip)(unsigned short* input, int nWidth, int nHeight, int mode, unsigned short* output, int& outWidth, int& outHeight); class NewModelDevice : public ModuleDevice { std::unique_ptr m_pMidObject; ImagePoolEx* m_ImagePool; std::shared_ptr m_DisconnectEvt; unsigned short m_nRotateAngle; unsigned short m_nFlipDirection; ImageRotate m_funcRoate; ImageFlip m_funcFlip; //std::vector m_strSubTopics; //要订阅的主题列表 public: NewModelDevice(); virtual ~NewModelDevice(); void Init(unique_ptr &&pMid, std::shared_ptr DisconnectEvt); virtual bool SYSTEM_CALL GetDeviceType(GUID &DevType); void DEVICE_ACTION OnPassiveDisconnected(); void DEVICE_ACTION OnLog(int LogLevel, string Context); void DEVICE_ACTION OnSystemLog(int cmd, string Code, string Context, string SenderId = ""); void DEVICE_ACTION NotifyCallBackEntry(int cmdType, string keyType, string Context); void DEVICE_ACTION RawDataNotifyCallBackEntry(int cmdType, string keyType, string Context, string Head, char *pRawData, int DataLength); void DEVICE_ACTION NotifyCallBackSetBlockSize(string QueName, DWORD BlockSize, DWORD FulBlockCount, DWORD PrevBlockSize, DWORD PrevBlockCount); virtual void SubscribeSelf() override; //get device resource RET_STATUS SYSTEM_CALL GetDeviceResource(ResDataObject PARAM_OUT *pDeviceResource) override; //normal sync routine,Request to device and response from device virtual RET_STATUS SYSTEM_CALL Request(ResDataObject PARAM_IN *pRequest, ResDataObject PARAM_OUT *pResponse); virtual RET_STATUS SYSTEM_CALL CmdToLogicDev(ResDataObject PARAM_IN *pCmd); //void OnSetClientID() override; RET_STATUS OnUpdate(const char* pszProperty, const char* pszValueUpdate, ResDataObject& resRespons) override; RET_STATUS OnDel(const char* pszPropery, ResDataObject& resDelValue, ResDataObject& resResponse) override; RET_STATUS OnAdd(const char* pszPropery, ResDataObject& reAddValue, ResDataObject& resResponse) override; RET_STATUS SetItem(const char* pszPropery, ResDataObject& resSetValue, ResDataObject& resResponse) override; RET_STATUS GetItem(const char* pszPropery, ResDataObject& resResponse) override; RET_STATUS OnAction(const char* pszActionName, const char* pszParams, ResDataObject& resResponse) override; /* void ConnectMQTTServer(); void NOTIFY(string topic, string context); void DispatchAction(string topic, string context); void ReSubscribe(); void SubscribeOne(string topic, bool unSubscribe=false); void SubscribeAction();*/ };