// ***************************************************************************** // 版权所有(C)2023~2099 上海骄成超声波技术有限公司 // 保留所有权利 // ***************************************************************************** // 作者 : 杨坚 // 版本 : 1.0 // 功能说明: // 发生器,协议 // ***************************************************************************** #ifndef __CUGWATCH_H__ #define __CUGWATCH_H__ 1 #include #include #define MAX_COM_BUFFER_LEN 256 // 端口配置参数,//TODO:目前只有一个,多个的话在封装,目前先实现功能 struct ComParameter { int nSerialPortNumber; // 串口号 int nBaudRate; // 波特率 0~ 65535 int nDataBits; //数据位为8位 int nFlowControl; //无流控制 int nParity; //无校验位 int nStopBits; //一位停止位 }; // 串口数量 enum EN_COM_NUMBER { ONE, TWO }; class CUGWatch { public: CUGWatch(); ~CUGWatch(); void ReadConfig(); //void aaa(); bool GetUserParaUT100(int& iMode, int& iVolFullScale, int& iCurFullScale, int& iPowFullScale, int& iSignSns, int& iTestLev, int iOverTime = 2000); bool SetUserParaUT100(int iMode, int iVolFullScale, int iCurFullScale, int iPowFullScale, int iSignSns, int iTestLev, int iOverTime = 2000); //设置标定中心频率 bool SetCaliCenterFrqUT100(int iCenterFrq, int iOverTime = 2000); /**校准数据 */ bool CalibrationUG_UT100(); /**检查完成 */ bool CheckCaliFinish(); /**打开端口 */ int JOpenPort(); void JClosePort(); private: std::unique_ptr m_cUGSerial; /**自定义可以多个 */ std::vector m_comPar; int iUGUserPara[6] = { 0 }; }; #endif //__CUGWATCH_H__