123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220 |
- #include "pch.h"
- #include "DriverDefine.h"
- #include "MachineDevice.h"
- std::string DEV_GetGUID(DEVICE_HANDLE hDev)
- {
- return "";
- }
- std::string DEV_GetResource(DEVICE_HANDLE hDev) //这里定义了该设备的模型资源,含属性、方法
- {
- return "";
- }
- void DEV_CompleteInit(DEVICE_HANDLE hDev)
- {
- }
- bool DEV_Prepare(DEVICE_HANDLE hDev)
- {
- return true;
- }
- void DEV_CompleteUnInit(DEVICE_HANDLE hDev)
- {
- }
- void DEV_SubscribeSelf(DEVICE_HANDLE hDev)
- {
- }
- //设备导出函数,设备对象为第一个参数,实现者可以利用类对象多态或者自行判断
- //设备路径、函数名(资源名)来自行进行功能实现
- int DEV_Add(DEVICE_HANDLE hDev, const std::string funcName, std::string In, std::string& Out)
- {
- return RET_NOSUPPORT;
- }
- int DEV_Delete(DEVICE_HANDLE hDev, const std::string funcName, std::string In, std::string& Out)
- {
- return RET_NOSUPPORT;
- }
- int DEV_Update(DEVICE_HANDLE hDev, const std::string funcName, std::string In, std::string& Out)
- {
- return RET_NOSUPPORT;
- }
- int DEV_Action(DEVICE_HANDLE hDev, const std::string funcName, std::string In, std::string& Out)
- {
- return RET_NOSUPPORT;
- }
- int DEV_Get(DEVICE_HANDLE hDev, const std::string funcName, std::string& Out)
- {
- return RET_NOSUPPORT;
- }
- int DEV_Set(DEVICE_HANDLE hDev, const std::string funcName, std::string In)
- {
- return RET_NOSUPPORT;
- }
- //路径设备导出函数,设备相对路径作为第一个参数,实现者需要根据
- //设备路径、函数名(资源名)来自行进行功能实现
- int DEVPath_Add(const std::string devPath, const std::string funcName, std::string In, std::string& Out)
- {
- return RET_NOSUPPORT;
- }
- int DEVPath_Delete(const std::string devPath, const std::string funcName, std::string In, std::string& Out)
- {
- return RET_NOSUPPORT;
- }
- int DEVPath_Update(const std::string devPath, const std::string funcName, std::string In, std::string& Out)
- {
- return RET_NOSUPPORT;
- }
- int DEVPath_Action(const std::string devPath, const std::string funcName, std::string In, std::string& Out)
- {
- return RET_NOSUPPORT;
- }
- int DEVPath_Get(const std::string devPath, const std::string funcName, std::string& Out)
- {
- return RET_NOSUPPORT;
- }
- int DEVPath_Set(const std::string devPath, const std::string funcName, std::string In)
- {
- return RET_NOSUPPORT;
- }
- //////////////////////////////////////////////////////////////////
- ///
- /// 设备模型接口 Part3,各中设备的标准方法
- /// XXX为属性名或者方法名,用于区分行为的Key
- /// 各驱动可以根据自己特点,定义标准方法集合
- //////////////////////////////////////////////////////////////////
- //实现者需要为每一个创建的设备对象定义模型实现,入口参数为设备时创建的对象句柄,需要自行区分对象与方法的对应
- int DEV_Add_XXX(DEVICE_HANDLE hDev, std::string In, std::string& Out)
- {
- return RET_NOSUPPORT;
- }
- int DEV_Delete_XXX(DEVICE_HANDLE hDev, std::string In, std::string& Out)
- {
- return RET_NOSUPPORT;
- }
- int DEV_Update_XXX(DEVICE_HANDLE hDev, std::string In, std::string& Out)
- {
- return RET_NOSUPPORT;
- }
- int DEV_Action_XXX(DEVICE_HANDLE hDev, std::string In, std::string& Out)
- {
- return RET_NOSUPPORT;
- }
- int DEV_Get_XXX(DEVICE_HANDLE hDev, std::string& Out)
- {
- return RET_NOSUPPORT;
- }
- int DEV_Set_XXX(DEVICE_HANDLE hDev, std::string In)
- {
- return RET_NOSUPPORT;
- }
- //实现者需要为每一个逻辑对象的设备路径 定义模型实现,需要自行根据设备路径和 方法进行区分
- int DEVPath_Add_XXX(const std::string devPath, std::string In, std::string& Out)
- {
- return RET_NOSUPPORT;
- }
- int DEVPath_Delete_XXX(const std::string devPath, std::string In, std::string& Out)
- {
- return RET_NOSUPPORT;
- }
- int DEVPath_Update_XXX(const std::string devPath, std::string In, std::string& Out)
- {
- return RET_NOSUPPORT;
- }
- int DEVPath_Action_XXX(const std::string devPath, std::string In, std::string& Out)
- {
- return RET_NOSUPPORT;
- }
- int DEVPath_Get_XXX(const std::string devPath, std::string& Out)
- {
- return RET_NOSUPPORT;
- }
- int DEVPath_Set_XXX(const std::string devPath, std::string In)
- {
- return RET_NOSUPPORT;
- }
- //设备树的模型实现
- //根设备的模型方法一套 XXX,实现时需要自己根据需要进行扩展、增删
- int DEVPath_Add_XXX_(std::string In, std::string& Out)
- {
- return RET_NOSUPPORT;
- }
- int DEVPath_Delete_XXX_(std::string In, std::string& Out)
- {
- return RET_NOSUPPORT;
- }
- int DEVPath_Update_XXX_(std::string In, std::string& Out)
- {
- return RET_NOSUPPORT;
- }
- int DEVPath_Action_XXX_(std::string In, std::string& Out)
- {
- return RET_NOSUPPORT;
- }
- int DEVPath_Get_XXX_(std::string& Out)
- {
- return RET_NOSUPPORT;
- }
- int DEVPath_Set_XXX_(std::string In)
- {
- return RET_NOSUPPORT;
- }
- //自定义的Action方法,root设备的
- DIOS_DRIVER_C_API int DEVPath_Action_MoveHome_(std::string In, std::string& Out)
- {
- return 2;
- }
- DIOS_DRIVER_C_API int DEVPath_Action_Move2Table_(std::string In, std::string& Out)
- {
- return 2;
- }
- DIOS_DRIVER_C_API int DEVPath_Action_Move2Pillar_(std::string In, std::string& Out)
- {
- return 2;
- }
- DIOS_DRIVER_C_API int DEVPath_Action_StartStichMove_(std::string In, std::string& Out)
- {
- return 2;
- }
- //自定义Set方法
- /*
- * 只有一个root设备
- //每一个逻辑设备路径一套,如下 /Dev01/SubDev的
- int DEVPath_Add_XXX_Dev01_SubDev(std::string In, std::string& Out);
- int DEVPath_Delete_XXX_Dev01_SubDev(std::string In, std::string& Out);
- int DEVPath_Update_XXX_Dev01_SubDev(std::string In, std::string& Out);
- int DEVPath_Action_XXX_Dev01_SubDev(std::string In, std::string& Out);
- int DEVPath_Get_XXX_Dev01_SubDev(std::string& Out);
- int DEVPath_Set_XXX_Dev01_SubDev(std::string In);
- */
|