#pragma once #define _HAS_STD_BYTE 0 //此项需在所有包含之前 #include #include "SCF.hpp" #include "SerialSCF.h" #include "Logger.temp.h" #include "Logger.h" #include "DIOS.Dev.IODevice.hpp" using namespace DIOS::Dev::Detail; #include "DIOS.Dev.Machinery.Model.h" #include "SimpleLog.hpp" // TODO: 在此处引用程序需要的其他头文件 //通讯协议 #define PACKET_HEAD1 (0xEE) #define PACKET_HEAD2 (0x5A) #define PACKET_TAIL1 (0x0D) #define PACKET_TAIL2 (0x0A) #define DIOSCTRLCPU_COM_TIMEOUT (2000) typedef union _FunctionID { struct { unsigned char DEVID : 4;// unsigned char BLOCKID : 4;// }; unsigned char CharPart; } FUNCTIONID; typedef struct _CtrlPacketHead { unsigned char szTitle[2]; unsigned char FrameSize; unsigned char FrameId; unsigned char FrameCmd; unsigned char FuncId; unsigned char Data1; unsigned char Data2; unsigned char Data3; unsigned char Data4; unsigned char Data5; }CTRLPACKETHEAD; typedef union _ShortData { struct { unsigned char Low; unsigned char High; }; unsigned short ShortPart; } SHORTDATA; typedef union _ShortData_2 { struct { unsigned char Low; unsigned char High; }; short ShortPart; } SHORTDATA_2; typedef struct _TOMONODEINFO { //unsigned short Pos;先不要位置坐标 unsigned short Angle; }TOMONODEINFO; #define SAFE_DELETE_ARRAY(p) { if(p) { delete[] (p); (p)=NULL; } } #define SAFE_DELETE(p) { if(p) { delete (p); (p)=NULL; } } #define SAFE_CLOSEHANDLE(h) { if(h) { CloseHandle(h); (h)=NULL; } } #pragma warning(disable: 4800) extern SimpleLog *gmotionLog; extern SimpleLog *gcommLog; extern SimpleLog *gdriverLog; extern SimpleLog *gbusinessLog; extern SimpleLog *gdigitalTwinLog; //#define if (gmotionLog) gmotionLog->Info(format,...) __DebugPrintA(gmotionLog,LOG_LEVEL_INFO,__FILE__,__LINE__,__FUNCTION__,format,__VA_ARGS__) //#define if (gmotionLog) gmotionLog->Warn(format,...) __DebugPrintA(gmotionLog,LOG_LEVEL_WARNING,__FILE__,__LINE__,__FUNCTION__,format,__VA_ARGS__) //#define if (gmotionLog) gmotionLog->Error(format,...) __DebugPrintA(gmotionLog,LOG_LEVEL_ERROR,__FILE__,__LINE__,__FUNCTION__,format,__VA_ARGS__) // //#define if(gcommLog) gcommLog->Info(format,...) __DebugPrintA(gcommLog,LOG_LEVEL_INFO,__FILE__,__LINE__,__FUNCTION__,format,__VA_ARGS__) //#define if(gcommLog) gcommLog->Warn(format,...) __DebugPrintA(gcommLog,LOG_LEVEL_WARNING,__FILE__,__LINE__,__FUNCTION__,format,__VA_ARGS__) //#define if(gcommLog) gcommLog->Error(format,...) __DebugPrintA(gcommLog,LOG_LEVEL_ERROR,__FILE__,__LINE__,__FUNCTION__,format,__VA_ARGS__) // //#define if(gdriverLog) gdriverLog->Info(format,...) __DebugPrintA(gdriverLog,LOG_LEVEL_INFO,__FILE__,__LINE__,__FUNCTION__,format,__VA_ARGS__) //#define if(gdriverLog) gdriverLog->Warn(format,...) __DebugPrintA(gdriverLog,LOG_LEVEL_WARNING,__FILE__,__LINE__,__FUNCTION__,format,__VA_ARGS__) //#define if(gdriverLog) gdriverLog->Error(format,...) __DebugPrintA(gdriverLog,LOG_LEVEL_ERROR,__FILE__,__LINE__,__FUNCTION__,format,__VA_ARGS__) // //#define if(gbusinessLog) gbusinessLog->Info(format,...) __DebugPrintA(gbusinessLog,LOG_LEVEL_INFO,__FILE__,__LINE__,__FUNCTION__,format,__VA_ARGS__) //#define if(gbusinessLog) gbusinessLog->Warn(format,...) __DebugPrintA(gbusinessLog,LOG_LEVEL_WARNING,__FILE__,__LINE__,__FUNCTION__,format,__VA_ARGS__) //#define if(gbusinessLog) gbusinessLog->Error(format,...) __DebugPrintA(gbusinessLog,LOG_LEVEL_ERROR,__FILE__,__LINE__,__FUNCTION__,format,__VA_ARGS__) // //#define DIG_TWIN(format,...) __DebugPrintA(gdigitalTwinLog,LOG_LEVEL_INFO,__FILE__,__LINE__,__FUNCTION__,format,__VA_ARGS__) ///#define DIG_TWIN(format,...) //__ReleasePrintA(LOG_LEVEL_INFO,__LINE__,__FUNCTION__,format,__VA_ARGS__) #ifdef DIOSDEVMACHINERYBASE_EXPORTS #define _DIOSDEVMACHBASE_API __declspec(dllexport) #else #define _DIOSDEVMACHBASE_API __declspec(dllimport) #endif #ifndef DIOSBOX_LIB #ifdef _WIN64 #ifdef _DEBUG #pragma comment(lib, "DIOS.Dev.Machinery.BaseX64D.lib") #else #pragma comment(lib, "DIOS.Dev.Machinery.BaseX64.lib") #endif #else #ifdef _DEBUG #pragma comment(lib, "DIOS.Dev.Machinery.BaseD.lib") #else #pragma comment(lib, "DIOS.Dev.Machinery.Base.lib") #endif #endif #endif // DIOSBOX_LIB