1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- // *****************************************************************************
- // 版权所有(C)2023~2099 上海骄成超声波技术有限公司
- // 保留所有权利
- // *****************************************************************************
- // 作者 : 杨坚
- // 版本 : 1.0
- // 功能说明:
- // 发生器,协议
- // *****************************************************************************
- #ifndef __CUGWATCH_H__
- #define __CUGWATCH_H__ 1
- #include <CRS232.h>
- #include <vector>
- #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<CRS232> m_cUGSerial;
- /**自定义可以多个
- */
- std::vector<ComParameter> m_comPar;
- int iUGUserPara[6] = { 0 };
- };
- #endif //__CUGWATCH_H__
|