qt/ledset/expertwin.h
2023-09-15 10:59:00 +08:00

373 lines
24 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef EXPERTWIN_H
#define EXPERTWIN_H
#include "basewin.h"
#include "gutil/qjson.h"
#include <QLabel>
#include <QSpinBox>
#include <QComboBox>
#include <QCheckBox>
#include <QRadioButton>
#include <QStackedLayout>
#include <QStackedWidget>
class ExpertWin : public BaseWin {
Q_OBJECT
public:
explicit ExpertWin(QWidget *parent, int);
QByteArray savedData();
JObj connSavedData();
void addMapData(QByteArray &);
QLabel *fdModuleWidth, *fdModuleHeight, *fdGroupNum, *fdScanNum, *fdDataGroupColor ,*fdChouDian;
QLabel *fdChipType, *fdDecodeMode;
JObj cfg;
JObj mBox {
{"ModuleRow", 1},
{"ModuleCol", 1},
{"Direction", 1},
{"SectorCount", 1}
};
JObj mModule {
{"ModuleWidth", 32},
{"ModuleHeight", 16},
{"GroupNum", 2},
{"ScanNum", 4},
{"ChipType", "通用"},
{"DecodeMode", "138译码"},
{"GroupMode", "三线并行"}
};
QStackedLayout *connStack;
QSpinBox *fdCardWidth, *fdCardHeight;
QComboBox *fdDirection, *fdSectorCount;
QRadioButton *fdAdvacned;
QPushButton *btnConnReadBack, *btnReceiveReadBack;
// QSpinBox *spinGclkXw,*spinGclkZkb,*spinLineNs,*spinLineWz,*spinLineXy,*spinPointsOnePort;
// QComboBox *cbDCLKf,*cbDclkXw, *cbDclkZkb,*freshBeiLv,*cbGCLKf,*cbGryLevel,*cbNoSign,*cbStb,*cbDE,*cbABC,*cbXiaoYinDianPing,*cbSTB,*cbSRowOut;
// QLabel * m_ctrlFreshRate,*m_ctrlBrightEff,*m_ctrlMinOE;
// QCheckBox * checkSyncXianKa,*checkJianLiang,*checkDoubleCopy,*checkDsignalAsCLk;
QStackedWidget *m_effectStack;//added by alahover 20230904
// NormalEffectWin * normalPanel ;
// PwmEffectWin * pwmPanel ;
// DoubleLatchEffectWin * doublelatchPanel;
//added by alahover -o 20230830
//added by alahover -s 20230817
int m_iRcvCardType;
bool needInit1 = true;
bool needInit2 = true;
struct St_Rcv_Pos{
unsigned char imgXL8 = 0;//接收卡图像列起始低八位
unsigned char imgYL8 = 0;//接收卡图像行起始低八位
unsigned char imgXH4_YH4 = 0;//接收卡图像列起始高四位+行起始高四位
unsigned char imgWidthL8 = 0;//接收卡图像宽度低八位
unsigned char imgWidthH4_HeightH4 = 0x14;//接收卡图像宽度低八位
unsigned char imgHeightL8 = 0;//接收卡图像宽度低八位
unsigned char imgPosNumInScreenL8 = 0;//接收卡在屏内的位置号低八位
unsigned char imgPosNumInScreenH8 = 0;//接收卡在屏内的位置号高八位
};
class zrf_rcv_card{
public:
/////////////////描点参数成员变量////////////////
unsigned char b0_7 = 0b0; //DAT信号 方式 0高有效共阴 1低有效共阳;
unsigned char b0_6 = 0b0; //STB信号有效方式 0正向 1反向;
unsigned char b0_5 = 0b1; //OE信号有效0 :低有 效1 :高有效;
unsigned char b0_4 = 0b0; //行有效方式0 低有效1 :高有效;
unsigned char b0_3_1 = 0b000; //行译码方式bit2~bit0与地址0x01 bit7~bit6 表示 bit4~bit3。0普通常规138译码00001SM526600010SM536601000:ICN201300100无译码00101595译码0110:5958译码01110ICND2018其他保留;
unsigned char b0_0 = 0b0; //0 :全色1 :单双色;
// unsigned char b0 = (b0_7 << 7 & 0b10000000)| (b0_6 << 6 & 0b01000000)| (b0_5 << 5 & 0b00100000)| (b0_4 << 4 & 0b00010000)| (b0_3_1 << 1 & 0b00001110) | (b0_0 & 0b00000001);
unsigned char b1_7_6 = 0b00; //行译码方式 bit4~bit3
unsigned char b1_5 = 0b0; //消影控制电平0高有效1低有效
unsigned char b1_4 = 0b0; //双卡备份0关闭1启用
unsigned char b1_3_2 = 0b00; //颜色深度00:8bit01:10bit10:12bit
unsigned char b1_1 = 0b0; //D信号扩展为第二时钟0关闭1启用
unsigned char b1_0 = 0b0; //上电渐亮0启用;1关闭
// unsigned char b1 = (b1_7_6<< 6 & 0b11000000) | (b1_5<<5 & 0b00100000) | (b1_4<<4 & 0b00010000) | (b1_3_2<<2 & 0b00001100) | (b1_1<<1 & 0b00000010) |(b1_0&0b00000001);
unsigned char b2 = 0x5; //实际消影时间为:(输入值 * 2 + 1 * 48ns
unsigned char b3 = 0x8; //一组数据控制模组的行数1~64其他无效
unsigned char b4 = 0x10; //一组数据控制的模组列数1~128其他无效
unsigned char b5 = 0x08; //模组扫描方式1~64其他无效
unsigned char b6 = 0x00; //模组每行空点数详见说明2
unsigned char b7_7_6 = 0b11; //输出数据线4,0001绿1011
unsigned char b7_5_4 = 0b10; //输出数据线3,0001绿1011
unsigned char b7_3_2 = 0b01; //输出数据线2,0001绿1011
unsigned char b7_1_0 = 0b00; //输出数据线1,0001绿1011
// unsigned char b7 = (b7_7_6 << 6 & 0b11000000) | (b7_5_4<<4 & 0b00110000) | (b7_3_2 << 2 & 0b00001100) | (b7_1_0 & 0b00000011) ;
//数据传输方向及数据输出模式
unsigned char b8_7 = 0b0; //多种描点数据 0关闭1启用
unsigned char b8_6 = 0b0; //扫描复用模式0行扫1列扫
unsigned char b8_5_4 = 0b00; //模组级联方向:00从右往左01从上往下10从左往右11从下往上
unsigned char b8_3_0 = 0b0000; //数据输出模式0000标准16组并行数据输出0001增强20组并行数据输出0010增强24组并行数据输出0101串行16组数据输出0100串行32组数据输出0011串行 64 组数据输出0110增强32组并行数据输出0111串行 128 组数据1000串行 96 组数据1001~1111保留
// unsigned char b8 = (b8_7<<7 &0b10000000) | (b8_6<<6 & 0b01000000) | (b8_5_4<<4 & 0b00110000) | (b8_3_0 & 0b00001111) ;
unsigned char b9 = 0xFF; //静态亮度 0最暗ff最亮区别于帧同步包中的动态亮度
unsigned char b10 = 0xFF; //红亮度0最暗ff最亮
unsigned char b11 = 0xFF; //绿亮度0最暗ff最亮
unsigned char b12 = 0xFF; //蓝亮度0最暗ff最亮
unsigned char b13 = 0x00; //模组驱动芯片类型选择: //0x00普通恒流芯片 0x0FICN2053 0x01MBI5042、MBI5041 0x10ICN2038S 0x02MY9268 0x11MBI5124 0x03MBI5050 0x12SM16017 0x04SD16749 0x13SM16207
//0x05SM16136 0x14SM16159 0x06APA101 0x15LS9929IP 0x07MY9266 0x16ICND2110 0x08MY9868 0x17LS9918IP 0x09MBI5052 0x18SM16237
//0x0ASUM2017 0x19SUM2028 0x0BMY9862 0x1ASUM2017TD 0x0CSUM2032 0x1BSM16259 0x0DMBI5153 0x1CICND2065/ICND2055; 0x1DSM16359 0x1ERT5965/RT5966;
//0x1FMBI5264 其他未定义
unsigned char b14 = 0x00; //芯片辅助识别标志
unsigned char b15 = 0xAC; //红电流增益 0最暗ff最亮
unsigned char b16 = 0xAC; //绿电流增益 0最暗ff最亮
unsigned char b17 = 0xAC; //蓝电流增益 0最暗ff最亮
//数据时钟频率
unsigned char b18_7_4 = 0x0; //保留
unsigned char b18_3_0 = 0x5; //输出数据时钟频率选择031.25M 125M 220.83M 317.8M 415.625M 512.5M 610.4M 78.9M 87.8M 96.25M 105.2M 114.5M 123.9M 133.125M 141.9M 151M
// unsigned char b18 = (b18_7_4<<4 & 0b11110000) | (b18_3_0 & 0b00001111);
//数据时钟相位及占空比
unsigned char b19_7_4 = 0b0000; //输出数据时钟相位00000 度; 0001- 90 度; 0010+90 度; 其他暂时保留;
unsigned char b19_3_0 = 0b0000; //输出数据时钟占空比000050% 000125% 001075% 其他暂时保留;
// unsigned char b19 = (b19_7_4<<4 & 0b11110000) | (b19_3_0 & 0b00001111);
//PWM芯片灰度时钟周期
unsigned char b20 = 0x20; //PWM 类智能芯片的灰度时钟周期设定MBI5042 芯片,软件计算; MY9268MBI5050用户设定设定有效值范围 4~128 其他不支持;
//灰度等级及倍频模式
unsigned char b21_7_5 = 0b000; //倍频模式: 000普通模式 0012 倍频; 0104 倍频; 0118 倍频; 10016 倍频; 101MBI5042 倍频模式,4096 110MBI5042 倍频模式,16384 110MBI5042 倍频模式,32768
unsigned char b21_4_0 = 0b11111; //灰度等级选择0无灰度1无 OE8 级2无 OE16 级3无 OE32 级4无 OE64 级5正常 16 级6高亮 16 级7正常 32 级8高亮 32 级9正常 64 级10高亮 64 级11正常 128 级12高亮 128 级13正常 256 级14高亮 256 级15正常 512 级16高亮 512 级
//17正常 1024 级 18高亮 1024 级19低亮 2048 级20正常 2048 级21高亮 2048 级22低亮 4096 级23正常 4096 级24高亮 4096 级25低亮 8192 级26正常 8192 级27高亮 8192 级28低亮 16384 级29正常 16384 级30正常 32768 级31正常 65536 级
// unsigned char b21 = (b21_7_5 << 5 & 0b11100000) | (b21_4_0 & 0b00011111);
//倍频模式 、低灰优化
unsigned char b22_7_6 = 0b00; //倍频模式00无倍频01VPWM10VPWM211VPWM3
unsigned char b22_5_2 = 0b0000; //补偿等级暂未定义0000~1111
unsigned char b22_1_0 = 0b00; //低辉补偿00普通模式, 01合并补偿, 10累加补偿
// unsigned char b22 = (b22_7_6 << 6 & 0b11000000) | (b22_5_2<<2 & 0b00111100) | (b22_1_0 & 0b00000011);
unsigned char b23 = 0x00; //保留
//画面刷新频率
unsigned char b24_7_5 = 0b000; //图像帧频率00060Hz00150Hz01075Hz01130Hz100120Hz其他保留
unsigned char b24_4_0 = 0b00000; //画面刷新频率 ,高 5bit
// unsigned char b24 = (b24_7_5<<5 & 0b11100000) | (b24_4_0 & 0b00011111);
unsigned char b25 = 0xF0; //画面刷新频率 ,低 8bit
//与显卡同步
unsigned char b26_7 = 0b1; //0与显卡同步1不同步
unsigned char b26_6 = 0b0; //低于 120hz时该位置1选择为行外扫描灰度
unsigned char b26_5_0 = 0b000000; //显卡同步时,帧频倍数
// unsigned char b26 = (b26_7<<7 & 0b10000000) | (b26_6<<6 & 0b01000000) | (b26_5_0 & 0b00111111);
unsigned char b27_28[2] = { 0x01,0x33}; //非 5030/5042 时ldq 值 = 166M/场频/扫描方式/遍数, 此数据必须小于 65535当帧频不准时利用微调选项调整
//5030/5042 时ldq 值 = 166M/场频/扫描方式/19/遍数, 此数据必须小于 65535,此处遍数为4096 级时:5 8192 级时:9 16384级时:17 此值最小为 485.
//Ldq_vpwm普通芯片的普通模式和 PWM 芯片与 ldq 一致,普通芯片的 VPWM 模式下,对遍数进行了修正(4096-38 遍8192-39 遍16384-134 遍);
//Ldq_vpwm2方式时即普通芯片的VPWM灰度优先模式下对遍数进行了修正(4096-58 遍8192-59 遍16384-116 遍32768-117 遍65536-118 遍);
//MY9268、MBI5050 时:画面刷新率/60Hz注意同步刷新时数据源的帧频率需要考虑是 60Hz还是50Hz还是 75Hz低字节在前
//与显卡同步
unsigned char b29_7_4 = 0b0000; //0与显卡同步1不同步
unsigned char b29_3_2 = 0b00; //低于 120hz时该位置1选择为行外扫描灰度
unsigned char b29_1_0 = 0b00; //显卡同步时,帧频倍数
// unsigned char b29 = (b29_7_4<<4 & 0b11110000) | (b29_3_2<<2 &0b00001100) | (b29_1_0 & 0b00000011);
unsigned char b30 = 0x00; //DPWM 芯片刷新倍频数 ICND2055/ICND2065 刷新倍频数 b7~b0
unsigned char b31 = 0x80; //接收卡带载列数低字节
unsigned char b32 = 0x00; //接收卡带载列数高字节
//空行模式
unsigned char b33_7_4 = 0b0000; //偶数图像区空行4bit
unsigned char b33_3_0 = 0b0000; //奇数图像区空行 4bit
// unsigned char b33 = (b33_7_4<<4 & 0b11110000) | (b33_3_0 & 0b00001111);
//模组端口空行位置
unsigned char b34_7_4 = 0b0000; //1~14 表示第1到15组数据0 保留15 表示所有数据组都有空行
unsigned char b34_3_0 = 0b0000; //1~15表示1到15组数据0 保留
// unsigned char b34 = (b34_7_4<<5 & 0b11110000) | (b34_3_0 & 0b00001111);
unsigned char b35 = 0x00; //消隐控制结束时刻
//行驱动芯片参数
unsigned char b36_7_6 = 0b00; //保留
unsigned char b36_5_0 = 0b000000; //详见说明3
// unsigned char b36 = (b36_7_6<<6 & 0b11000000) | (b36_5_0 & 0b00111111);
//行驱动芯片参数
unsigned char b37_7_5 = 0b000; //保留
unsigned char b37_4_3 = 0b00; //端口内空数据通道数
unsigned char b37_2 = 0b0; //UD口交换
unsigned char b37_1 = 0b0; //逆序
unsigned char b37_0 = 0b0; //奇偶交换
// unsigned char b37 = (b37_7_5<<5 & 0b11100000) | (b37_4_3<<3 & 0b00011000) | (b37_2<<2 & 0b00000100) | (b37_1 <<1 & 0b00000010) | (b37_0 & 0b00000001);
unsigned char b38_69[32] = {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f}; //端口1~31输出图像区
//行驱动芯片参数
unsigned char b70_7 = 0b000; //空行模式 0关闭 1打开
unsigned char b70_6 = 0b00; //对折偏移 0关闭 1打开
unsigned char b70_5_2 = 0b0; //对折模式: 0正常模式 1两折 2镜像对折 3:3折 4:4折 5:5折 6:6折 7:8折其他保留
unsigned char b70_1 = 0b0; //空列模式: 0禁止 1允许
unsigned char b70_0 = 0b1; //bit0 图像区偏移: 0菱形偏移模式 1梯形 偏移模式
// unsigned char b70 = (b70_7<<7 & 0b10000000) | (b70_6<<6 & 0b01000000) | (b70_5_2<<2 & 0b00111100) | (b70_1<<1 & 0b00000010) | (b70_0 & 0b00000001);
//{0x00,0x00,0x00}图像区1列偏移低8bit,图像区1行偏移低8bit,图像区1列偏移低4bit+行偏移高4bit
unsigned char b71_166[32][3] = {{0x00,0x00,0x00},{0x00,0x01,0x00},{0x00,0x02,0x00},{0x00,0x03,0x00},{0x00,0x04,0x00},{0x00,0x05,0x00},{0x00,0x06,0x00},{0x00,0x07,0x00},
{0x00,0x08,0x00},{0x00,0x09,0x00},{0x00,0x0A,0x00},{0x00,0x0B,0x00},{0x00,0x0C,0x00},{0x00,0x0D,0x00},{0x00,0x0E,0x00},{0x00,0x0F,0x00},
{0x00,0x00,0x01},{0x00,0x10,0x01},{0x00,0x20,0x01},{0x00,0x30,0x01},{0x00,0x40,0x01},{0x00,0x50,0x01},{0x00,0x60,0x01},{0x00,0x70,0x01},
{0x00,0x80,0x01},{0x00,0x90,0x01},{0x00,0xA0,0x01},{0x00,0xB0,0x01},{0x00,0xC0,0x01},{0x00,0xD0,0x01},{0x00,0xE0,0x01},{0x00,0xF0,0x01}};
unsigned char b167 = 0x00; //同步预留时间
unsigned char b168_7_5 = 0b000; //保留
unsigned char b168_4_0 = 0b00000; //消隐延迟时间:(输入值+1*48ns
// unsigned char b168 = (b168_7_5<<5 & 0b11100000) | (b168_4_0 & 0b00011111);
unsigned char b169_192[48] = {0x00,0x00,//红芯片参数 1 高字节,红芯片参数 1 低字节
0x00,0x00,//红芯片参数 2 高字节,红芯片参数 2 低字节
0x00,0x00,//红芯片参数 3 高字节,红芯片参数 3 低字节
0x00,0x00,//绿芯片参数 1 高字节,绿芯片参数 1 低字节
0x00,0x00,//绿芯片参数 2 高字节,绿芯片参数 2 低字节
0x00,0x00,//绿芯片参数 3 高字节,绿芯片参数 3 低字节
0x00,0x00,//蓝芯片参数 1 高字节,蓝芯片参数 1 低字节
0x00,0x00,//蓝芯片参数 2 高字节,蓝芯片参数 2 低字节
0x00,0x00,//蓝芯片参数 3 高字节,蓝芯片参数 3 低字节
0x00,0x00,//红芯片参数 4 高字节,红芯片参数 4 低字节
0x00,0x00,//绿芯片参数 4 高字节,绿芯片参数 4 低字节
0x00,0x00 //蓝芯片参数 4 高字节,蓝芯片参数 4 低字节
};
unsigned char b193 = 0x00; //保留
/////////////////描点参数成员变量////////////////
unsigned char m_scanIndex[64]={0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F};
unsigned char m_pixelPos[2048][2];//描点参数中一点占用 2字节8bit 列 + 8 bit 行)
/////////////////排序参数成员变量////////////////
unsigned char p0_cardIndexInNet=0;//当前卡在网线内的序号
unsigned char p1_SendCardCode=0;//当前网线所在的发送卡编号
unsigned char p2_netIndexInSendCard=0;//当前网线所在发送卡输出口编号
unsigned char p3_fenXianNum=0;//当前分线号
unsigned char p4_rcvCardsNumInNet=0;//当前网线内接收卡总数
unsigned char p5_netScreenIndex=0;//当前网线所在屏号
unsigned char p6_reserve=0;//保留
unsigned char p7_reserve1=0;//保留
St_Rcv_Pos p8_st_rcv_pos[256];
unsigned short p_x[256]={0};
unsigned short p_y[256]={0};
unsigned short p_w[256]={256};
unsigned short p_h[256]={1024};
unsigned short p_posNum[256]={0};
/////////////////gamma参数成员变量////////////////
unsigned short g_all[256];
unsigned short g_red[256];
unsigned short g_green[256];
unsigned short g_blue[256];
//其他中间成员变量
unsigned char ucZheHuiCiShu;//折回次数
int m_pwmFlag=0;
};
zrf_rcv_card zrf_rcv_obj;
void classToBaseMsg();
void classToGammaMsg(int iColorType,quint8 flashPage);
void classToPaiXuSMsg(quint8 flashPage);
void classToMiaoDianMsg(quint8 flashPage);
void baseMsgToClass(quint8 * data);
void gammaMsgToClass(quint8 * data , quint8 flashPage);
void paiXuMsgToClass(quint8 * data , quint8 flashPage );
void miaoDianMsgToClass(quint8 * data, quint8 flashPage);
//added by alahover -s 20230830
void changeValueBySmart();
void changeValueByEffectControler();
void SetEffectControlerValueByClass();
int GetIcTypeIndexFromName(QString strName);
int GetRowYiMaIndexFromName(QString strName);
//added by alahover -o 20230830
//added by alahover -s 20230903
void SendBaseParam_zrf();//added by alahover 20230903
void SendGammaParam_zrf();//added by alahover 20230903
void SendMiaoDianParam_zrf();//added by alahover 20230903
void SendPaiXuParam_zrf();//added by alahover 20230903
int GetPaiXuJObjFromName(QString strName);//added by alahover 20230903
void GetPaiXuJObjFromJObj(JObj obj);
JObj ClassToJObj();
//added by alahover -o 20230903
protected:
void closeEvent(QCloseEvent *) override;
};
#define MACRO_FUNC_SEND_PARAM(TIP_MESSAGE,FUNC,SEND_FLASHPAGE_NUM,FLASH_ADDR) \
for(int iSendCount=0;iSendCount<SEND_FLASHPAGE_NUM;iSendCount++)\
{\
int flashPage=FLASH_ADDR+iSendCount;\
zrf_msg = zrf_msg.left(headMap_zrf.end+st_zrf_cmd_param.param);\
FUNC;\
for(int n=0;n<4;n++)\
{\
*(quint8 *)(zrf_msg.data()+headMap_zrf.paramStart+st_zrf_cmd_param.flashPage+n)=flashPage;\
*(quint8 *)(zrf_cmd_msg.data()+headMap_zrf.paramStart+st_zrf_cmd_param.flashPage+n)=flashPage;\
}\
zrf_msg.append(zrf_param_msg);\
res1 = sendMsg(zrf_msg, 0x1E0, 10000, [=](int, const QByteArray data) {\
});\
if(res1) {\
QString err = pcap_geterr(pcapSend);\
if(! err.endsWith("(2150891551)")) QMessageBox::critical(this, "Error", QString(tr("sendMsg发送失败: "))+QString::fromLocal8Bit(pcap_geterr(pcapSend)));\
}\
Sleep(1);\
}
#define MACRO_FUNC_GUHUA_PARAM(TIP_MESSAGE,FUNC,SEND_FLASHPAGE_NUM,FLASH_ADDR) \
for(int iSendCount=0;iSendCount<SEND_FLASHPAGE_NUM;iSendCount++)\
{\
int flashPage=FLASH_ADDR+iSendCount;\
zrf_msg = zrf_msg.left(headMap_zrf.end+st_zrf_cmd_param.param);\
FUNC;\
for(int n=0;n<4;n++)\
{\
*(quint8 *)(zrf_msg.data()+headMap_zrf.paramStart+st_zrf_cmd_param.flashPage+n)=flashPage;\
*(quint8 *)(zrf_cmd_msg.data()+headMap_zrf.paramStart+st_zrf_cmd_param.flashPage+n)=flashPage;\
}\
zrf_msg.append(zrf_param_msg);\
res1 = sendMsg(zrf_msg, 0x1E0, 10000, [=](int, const QByteArray data) {\
});\
if(res1) {\
QString err = pcap_geterr(pcapSend);\
if(! err.endsWith("(2150891551)")) QMessageBox::critical(this, "Error", QString(tr("sendMsg发送失败: "))+QString::fromLocal8Bit(pcap_geterr(pcapSend)));\
}\
Sleep(100);\
for(int i=0;i<iReSendCount;i++){\
auto res = sendMsgSync(zrf_cmd_msg, 0x105B14, iTimeout, NULL);\
if(res.code==5){if(i>=2) {QMessageBox::critical(this, "提示", tr(TIP_MESSAGE)+tr("超时")); return;} }\
else if(res.code) {if(i>=2) {QMessageBox::critical(this, "Error", QString(tr("sendMsgSync发送失败: "))+QString::fromLocal8Bit(pcap_geterr(pcapSend))); return;} }\
else {\
int ioffset=headMap_zrf.paramStart+st_zrf_rb_param.param;\
QByteArray return_msg=res.msg.mid(ioffset,256);\
int iCmpLen=256;\
if(flashPage == 0x00)\
iCmpLen=st_zrf_base_param.end;\
else \
iCmpLen=256;\
if(memcmp((quint8 *)zrf_param_msg.data(),(quint8 *)return_msg.data(),iCmpLen)==0)\
{\
qDebug()<< tr(TIP_MESSAGE)+tr("成功")<<iSendCount;\
}\
else\
{\
qDebug()<< tr(TIP_MESSAGE)+tr("失败")<<iSendCount;\
qDebug()<<"zrf_param_msg = "<<zrf_param_msg.toHex();\
qDebug()<<"return_msg = "<<return_msg.toHex();\
qDebug()<<"zrf_msg = "<<zrf_msg.toHex();\
qDebug()<<"res.msg = "<<res.msg.toHex();\
QMessageBox::information(this, tr("提示"), tr(TIP_MESSAGE)+tr("比对不一致"));\
return;\
}\
break;\
}\
}\
}
#endif // EXPERTWIN_H