构建新的cmakelist工程

修改了  delay_tc函数
修返回频率为20hz
修改波特率修改后先重新设置通讯波特率在保存
This commit is contained in:
xin
2023-02-13 09:15:17 +08:00
parent d870c42486
commit 277e347e56
12 changed files with 61 additions and 7 deletions

View File

@ -0,0 +1,73 @@
#ifndef COMMANDLINEPARSER_H
#define COMMANDLINEPARSER_H
#include <QCommandLineParser>
#include <QDir>
#include <string>
#include "witcommand.h"
enum CommandLineParseResult
{
CommandLineOk,
CommandLineError,
CommandLineVersionRequested,
CommandLineHelpRequested
};
struct TcQuery
{
QString serialPort;
int connectBaudrate;
bool isSetAlgorithm;
ALGROITHM_ENUM algorithm;
bool isSetInstallationOrientation;
ORIENT_ENUM installationOrientation;
bool isSetTimeZone;
TIMEZONE_ENUM timeZone;
bool isSetDefaultReturnContent;//wit默认 + 经纬度
RETURN_CONTENT_STRUCT defaultReturnContent;
RETURN_CONTENT_STRUCT returnContent;
bool isSetBaudrate;
BAUD_ENUM baudrate;
bool isSetReturnRate;
RRATE_ENUM returnRate;
bool isSetDeviceAddress;
int deviceAddress;
bool isSetInterface_D0;
MODEL_D0_D2_D3_ENUM modelForInterface_D0;//模式
int pulseWidth_D0;//脉宽
int period_D0;//周期
bool isSetInterface_D1;
MODEL_D1_ENUM modelForInterface_D1;//模式
int pulseWidth_D1;//脉宽
int period_D1;//周期
bool isSetInterface_D2;
MODEL_D0_D2_D3_ENUM modelForInterface_D2;//模式
int pulseWidth_D2;//脉宽
int period_D2;//周期
bool isSetInterface_D3;
MODEL_D0_D2_D3_ENUM modelForInterface_D3;//模式
int pulseWidth_D3;//脉宽
int period_D3;//周期
};
CommandLineParseResult parseCommandLine2(QCommandLineParser &parser, TcQuery *query, QString *errorMessage);
bool getModel(int modelIndex, MODEL_D0_D2_D3_ENUM & model);
bool getModel_D1(int modelIndex, MODEL_D1_ENUM & model);
bool processModelParm(QCommandLineParser &parser, QCommandLineOption commandLineOption, MODEL_D0_D2_D3_ENUM & model, bool &isSetInterface);
bool processModelParm_D1(QCommandLineParser &parser, QCommandLineOption commandLineOption, MODEL_D1_ENUM & model, bool &isSetInterface);
bool processPulseWidthParm(QCommandLineParser &parser, QCommandLineOption commandLineOption, int & pulseWidth, bool &isSetInterface);
bool processPeriodParm(QCommandLineParser &parser, QCommandLineOption commandLineOption, int & period, bool &isSetInterface);
#endif // COMMANDLINEPARSER_H