1345 lines
47 KiB
C++
1345 lines
47 KiB
C++
/*
|
||
* SysPara.h
|
||
*
|
||
* Created on: Jun 25, 2013
|
||
* Author: yiyu
|
||
* QQ:1036184468
|
||
* Descriptoin:
|
||
|
||
* 2013-11-09 聂雄
|
||
* 修改了para 结构,增加了 alterPrint_t,setepPrint_t两组参数,放在0x3C~0x43传替给FPGA
|
||
* 占用的原来预留的17个字(68B)中的8字节,故预留空间改为 15字(60字节)
|
||
*/
|
||
|
||
#ifndef SYSPARA_H_
|
||
#define SYSPARA_H_
|
||
|
||
|
||
#include "DevOp.h"
|
||
#include <QString>
|
||
|
||
#ifndef SYS1
|
||
#define PARA_ROOT_DIR "/home/plg/conf/"
|
||
#define DOC_ROOT_DIR "/home/plg/doc/"
|
||
#define UDISK_DOC_ROOT_DIR "/udisk/doc/"
|
||
#define UDISK_CONF_ROOT_DIR "/udisk/conf/"
|
||
#define TESTDIR "/home/plg/r_conf/"
|
||
#else
|
||
#define PARA_ROOT_DIR "./conf/"
|
||
#define DOC_ROOT_DIR "./doc/"
|
||
#define UDISK_DOC_ROOT_DIR "./udisk/doc/"
|
||
#define TESTDIR "./r_conf/"
|
||
#endif
|
||
|
||
#define SPACEFLAG // 增加空列 2017.3.8
|
||
|
||
#define TESTFILES TESTDIR"UP.png"
|
||
#define TESTFILED DOC_ROOT_DIR"UP.png"
|
||
#define TESTFILECS TESTDIR"UP.dpn"
|
||
#define TESTFILECD PARA_ROOT_DIR"UP.dpn"
|
||
|
||
#define PARA_FILE_PATH PARA_ROOT_DIR"sysPara.bin"
|
||
#define DeviceCode_FILE_PATH "/home/plg/conf/deviceCode.bin"
|
||
#define RFID_FILE_PATH "/home/plg/conf/RFID.bin"
|
||
#define FPGA_PRINT_PARA_BYTE_NUM 0x3C
|
||
|
||
#define BATCHLEN 3
|
||
#define VOLUMELEN 2
|
||
|
||
#define AUTH_NONE 0
|
||
#define AUTH_DISPLAY_SYSTEM_SETTING (1<<0)
|
||
#define AUTH_DISPLAY_SYSTEM_MANAGE (1<<1)
|
||
#define AUTH_DISPLAY_LOG_INFO (1<<2)
|
||
#define AUTH_DISPLAY_OTHER_INFO (1<<3)
|
||
|
||
#define AUTH_SUPER_USER1 (1<<16)
|
||
#define AUTH_SUPER_USER2 (1<<17)
|
||
typedef enum {
|
||
PRINT_TRIGGER_TIME = 0,
|
||
PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL = 1,
|
||
PRINT_TRIGGER_ELEC_EYE_EDGE =2,
|
||
PRINT_TRIGGER_SYNCHRONIZER = 3,
|
||
PRINT_TRIGGER_NONE = 4,
|
||
PRINT_TRIGGER_EYESYN =5
|
||
}print_trigger_mode_t;
|
||
typedef enum {
|
||
OSCILLATTOR_FREQ_64K = 0,
|
||
OSCILLATTOR_FREQ_76K = 1,
|
||
OSCILLATTOR_FREQ_96K =2,
|
||
OSCILLATTOR_FREQ_128K =3
|
||
}oscillator_freq_t;
|
||
|
||
#define TIME_TRIGGER_PRINT_MODE_END_TO_HEAD 0
|
||
#define TIME_TRIGGER_PRINT_MODE_HEAD_TO_HEAD 1
|
||
|
||
#define SYN_PRINT_MODE_ACCORDING_CHAR_WIDTH 0
|
||
#define SYN_PRINT_MODE_ACCORDING_RATIO 1
|
||
|
||
#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
|
||
#define MAX_QVARI_NUM 4
|
||
#define MAX_CNT1_GROUPS_NUM 50
|
||
|
||
typedef struct {
|
||
unsigned int second:6;
|
||
unsigned int minute:6;
|
||
unsigned int hour:5;
|
||
unsigned day:9;
|
||
unsigned month:4;
|
||
unsigned dummy:2;
|
||
unsigned dayofweek:3;
|
||
unsigned year:12;
|
||
|
||
unsigned int leap_year:1; //标记当年是否是闰年
|
||
unsigned int cntCurrValueInitEnable:8; //{[0] -> cnt1CurrValue [1] ->cun2CurrValue [2] ->cun3CurrValue}
|
||
unsigned int week:8;
|
||
unsigned int cnt1CurrValue;// BCD码 9
|
||
unsigned int cnt2CurrValue; // 0x0f 13
|
||
|
||
unsigned int cnt1End; //0x10 17
|
||
unsigned int cnt2End; //0x14 21
|
||
|
||
unsigned short cnt1Repeat;//0x18 25
|
||
unsigned short cnt2Repeat;//0x1a 29
|
||
|
||
unsigned int cnt1Step;//0x1c 33
|
||
unsigned int cnt2Step;//0x20 37
|
||
|
||
unsigned int cnt1InitValue; //0x24 41
|
||
unsigned int cnt2InitValue; //0x28 45
|
||
|
||
unsigned int RandomValue1; //0x2c
|
||
unsigned int RandomValue2; //0x30
|
||
|
||
}calandar_and_dat_t;
|
||
|
||
typedef struct {
|
||
unsigned int cnt3CurrValue;// BCD码
|
||
unsigned int cnt3End;
|
||
unsigned int cnt3Repeat;
|
||
unsigned int cnt3Step;
|
||
unsigned int cnt3InitValue;
|
||
|
||
}stru_counter3;
|
||
|
||
//hiddenfunction
|
||
typedef struct {
|
||
unsigned int cnt4CurrValue;// BCD码 0xb164
|
||
unsigned int cnt4End = 0;
|
||
unsigned int cnt4Repeat = 0;
|
||
unsigned int cnt4Step = 0;
|
||
unsigned int cnt4InitValue = 0;
|
||
|
||
}stru_counter4;
|
||
|
||
typedef struct
|
||
{
|
||
unsigned short builTime;
|
||
unsigned short inkDot; //
|
||
unsigned char year;
|
||
unsigned char month;
|
||
unsigned char day;
|
||
|
||
}build_dat_t;
|
||
|
||
typedef struct
|
||
{
|
||
quint8 print_data_xor;
|
||
quint8 counter1_current_value;
|
||
quint64 sync_counter_at_zero;
|
||
|
||
}xor_sync_couter;
|
||
|
||
typedef struct
|
||
{
|
||
unsigned short startValue; // 起始值
|
||
unsigned short StepValue; // 跳米间隔
|
||
unsigned short endValue; // 结束值
|
||
unsigned char enbale; //
|
||
unsigned char nncc; // 实际跳米数
|
||
}stepPrint_t; // 8Byte
|
||
|
||
typedef struct
|
||
{
|
||
unsigned short startValue; // 起始值
|
||
unsigned short repeatValue; // 重复间隔
|
||
unsigned short repeatPrintTimes; //重复打印次数
|
||
unsigned char DistanceTail; //距离尾部
|
||
unsigned char enable:2; // 交替便能
|
||
unsigned char lineSpace:6; //行距
|
||
//unsigned int bak[10]; // 保留参数
|
||
}alterPrint_t; // 8Byte
|
||
|
||
//隐藏功能
|
||
typedef struct
|
||
{
|
||
unsigned char SpecialVarEnable; //特殊变量使能
|
||
unsigned char MeterEnable; //计数器4带米标使能
|
||
unsigned short SpecialConditionValue; // 隐藏条件倍数值
|
||
unsigned short SpecialVarCountEnd;
|
||
unsigned short SpecialVarColStart;
|
||
unsigned short SpecialVarColEnd;
|
||
unsigned char SpecialVarRowStart;
|
||
unsigned char SpecialVarRowEnd;
|
||
}SpecialVarPrint; // 8Byte
|
||
|
||
typedef struct // BarCodeOption
|
||
{
|
||
unsigned char xpos;
|
||
unsigned char font;
|
||
unsigned char width;
|
||
unsigned char height;
|
||
unsigned char scale;
|
||
unsigned char type:6;
|
||
unsigned char InkColor:1;
|
||
unsigned char autoFlash:1;
|
||
|
||
unsigned char RecFromHost:1;// RecFromHost
|
||
unsigned char DisplayUpdate:1; //变量更新标志
|
||
unsigned char AutoCount:1; // 自动变化
|
||
unsigned char var1En:1; //变量1使用
|
||
unsigned char var2En:1; //变量2使用
|
||
|
||
unsigned char barType;// 条形码类型
|
||
|
||
unsigned short var1Type;// 变量1类型
|
||
unsigned short var2Type;// 变量2类型
|
||
unsigned char var1Num;// 变量1位数
|
||
unsigned char var2Num;// 变量2位数
|
||
|
||
|
||
unsigned char NC2[11];
|
||
char text[80];
|
||
char TxtModule[40];
|
||
char TxtLine[30];
|
||
char TxtLine1[30];
|
||
// unsigned char var3Num;// 变量3位数
|
||
}bcOption_t;
|
||
|
||
typedef struct {
|
||
unsigned int posx;
|
||
unsigned char cntNum;
|
||
unsigned char width;
|
||
unsigned char height;
|
||
unsigned char VarNum:3; //1
|
||
unsigned char AutoRefresh:1;
|
||
unsigned char AutoCount:1;
|
||
unsigned char InkColor:1;
|
||
unsigned char RecFromHost:1;// RecFromHost
|
||
unsigned char DisplayUpdate:1; //变量更新标志
|
||
unsigned char type; //0-DataMatrix, 1-QRCode,2-BAR
|
||
unsigned long counter;
|
||
char text[100];
|
||
char textCnt[10];
|
||
char text2[80];
|
||
char text3[8];
|
||
unsigned short CntInc;
|
||
unsigned char barCodeFlag:1;//条形码
|
||
}qrOption_t;
|
||
|
||
typedef struct {
|
||
int type;
|
||
int width;
|
||
int height;
|
||
int startColPos;
|
||
int endRowPos;
|
||
int startRowPos;
|
||
unsigned int Counter; //
|
||
unsigned char countEn;
|
||
unsigned char TimeEn;
|
||
unsigned char cntNum; // 未使用
|
||
unsigned char NNC2; // 未使用
|
||
//---------------------
|
||
char text[100]; //指向申请内存的空间 生成字模数据
|
||
char textCnt[10];
|
||
char text2[90];
|
||
bool original; //表示当前dat是通过calloc申请而来还是直接引用别人的指针,主要是影响到指针的释放
|
||
}QRvars_t;
|
||
|
||
/* 分段计米相关设定 */
|
||
typedef struct {
|
||
unsigned char cnt1GroupCnt; //总共组数
|
||
struct{
|
||
int StartValue;
|
||
int EndValue;
|
||
//int StepValue;
|
||
//int RepeateValue;
|
||
int LoopTimes;
|
||
}cnt1GroupSettings[MAX_CNT1_GROUPS_NUM];
|
||
}Cnt1ByGroup_t;
|
||
typedef struct {
|
||
unsigned char cnt2GroupCnt; //总共组数
|
||
struct{
|
||
int StartValue;
|
||
int EndValue;
|
||
//int StepValue;
|
||
//int RepeateValue;
|
||
int LoopTimes;
|
||
}cnt2GroupSettings[MAX_CNT1_GROUPS_NUM];
|
||
}Cnt2ByGroup_t;
|
||
|
||
typedef struct
|
||
{
|
||
int type;//
|
||
int width;
|
||
int height;
|
||
int startColPos;
|
||
int endRowPos;
|
||
int startRowPos;
|
||
unsigned int year; //
|
||
unsigned char month;
|
||
unsigned char day;
|
||
unsigned char separate[3];
|
||
unsigned char bold;
|
||
unsigned char letterSpace;
|
||
unsigned char splitMode;// '-','/',年05月24日
|
||
//unsigned int addDays; //
|
||
//---------------------
|
||
char text2[20];
|
||
//bool original; //表示当前dat是通过calloc申请而来还是直接引用别人的指针,主要是影响到指针的释放
|
||
}EXPIRYVAR_t;
|
||
// 打印参数
|
||
/*
|
||
typedef struct {
|
||
// 打印参数
|
||
unsigned int printTotalColNum:16; // 0,1
|
||
unsigned int printDirection:8; // 2[0] 上下颠倒 [1] 左右颠倒 [2] 扫描颠倒
|
||
unsigned int reducedPixelNum:6; // 3 冗余点数
|
||
unsigned int reducedPixelMode:2; // 冗余点比例
|
||
|
||
unsigned int printRowDelay:8; //4 打印模式
|
||
unsigned int printColDelay:24; // 打印设置下的 5,6,7 字宽
|
||
|
||
unsigned char charBold; //8 字体加宽
|
||
unsigned char pixNumPerCol; // 9 每列点阵数
|
||
unsigned int timeTriggerPrintDelayMs:16; //a,b
|
||
unsigned int photoElectricityRepeateNum:16; //c,d
|
||
unsigned short eleEyeTriggerPrintDelay; // e,f
|
||
|
||
unsigned int printTriggerMode:8; // 10
|
||
unsigned int totalSynPulseNum:24; //11,12,13
|
||
unsigned int elecEyeTriggerInterval:32; //14,15,16,17
|
||
unsigned char lineEndAdjustPointCnt; //18
|
||
unsigned char lineEndAdjustPointDelay; //19
|
||
short lastLineEndPointFixedDACValue; //1a 1b
|
||
unsigned char extClearAllCntEnable; // 1c --- 通过外部(同步器或电眼)清零 0x3a
|
||
unsigned char HighVoltageAmplitude; //0x1d 字高// 字高电压系数
|
||
unsigned char mmmee[2];
|
||
//unsigned short timeTriggerPrintDelayMsH:16; // no use 1e,1f
|
||
|
||
// FPGA ADDR 0x60~0x63
|
||
unsigned short productNumToGenerateOutputPulse; //0x1d,1e num产品 out put a pulse
|
||
unsigned short outputPulseDelayMs; // 0x1f,0x20
|
||
|
||
// FPGA ADDR 0x44~
|
||
alterPrint_t alterPrint; // 8Byte FPAG由地址0x44~0x4B
|
||
unsigned char Cnt1NatureValue:1; //0自然数
|
||
unsigned char eleEyeTriggerSynPrintEn:1; //1电眼触发的同步打印使能
|
||
unsigned char autoSynSpeedEn:1; //2同步打印自动模式
|
||
unsigned char newAmplifyPlate:1;//新放大板选项
|
||
unsigned char SynCntEn1:1; // 4 不打印走米
|
||
unsigned char Vol1of8En:1; // 5 1/8电压打印
|
||
unsigned char eleEyeReTrigDisable:1; // 6
|
||
unsigned char set_HVData_Flag:1; // checkBoxYH
|
||
|
||
unsigned char rrr_nc[1]; // 0x4d
|
||
unsigned short synPulsePerMmX8 ;// 0x4e~4f
|
||
|
||
|
||
bool leftRightInverse;
|
||
bool upDownInverse;
|
||
bool scanInverse;
|
||
int currPrintMode;
|
||
|
||
int cnt1EndValue;
|
||
int cnt1StartValue;
|
||
int cnt1StepValue;
|
||
int cnt1RepeateValue;
|
||
int cnt1CurrValue;
|
||
int cnt2EndValue;
|
||
int cnt2StartValue;
|
||
int cnt2StepValue;
|
||
int cnt2RepeateValue;
|
||
int cnt2CurrValue;
|
||
|
||
float synTriggerPrintLenMm;
|
||
|
||
int synTriggerPrintLenRatio;
|
||
|
||
int timeTriggerPrintMode;
|
||
int printDelayMs;
|
||
int sysTriggerPrintMode; //在同步模式下选择按字宽或时喷印比例进行打印
|
||
int synCharWidthRatio;
|
||
int rowSequenceMode;
|
||
int pointVoltageAdjustPos;
|
||
int PointVoltageAdjustValue;
|
||
|
||
int synClearCntInEleEyeMode; //在电眼触发模式下通过同步器清零
|
||
int eleEyeClearCntInSynMode;
|
||
int reducedPixelNumRatio;
|
||
int lastLineEndPointFixedValue; //对高压部分点的修正
|
||
int pulseOutputEnable; // 脉冲使能输出
|
||
int productCntPerOutputPulse;//
|
||
|
||
int startVoltage; //首行电压
|
||
int endVoltage; //行末电压
|
||
|
||
float synPulseNumPerMm;// 同步器参数 脉冲/毫米
|
||
// 添加参数
|
||
unsigned char adjVolDacRate[40]; //增加了DAC电压间隔调整比例
|
||
int FullColFixVal;
|
||
unsigned char SynCntEn:1;
|
||
unsigned char ENNCC:7;
|
||
unsigned char NCCC22;
|
||
unsigned short eleMaskTime; // 16bit
|
||
unsigned short AltMirrorGap;// 镜像打印间隔 Mirror image alternation
|
||
unsigned short headLen;
|
||
unsigned short endLen;//6
|
||
unsigned char varLenEn;//
|
||
short varLen; // 可变长
|
||
short varLen1; // 可变长
|
||
unsigned char NCCC;
|
||
QRvars_t QRvars[MAX_QVARI_NUM];
|
||
//BCvars_t BCvars[MAX_QVARI_NUM];
|
||
stepPrint_t stepPrint; // 8Byte
|
||
int phaseHighLowRatio; //保存相检
|
||
short phaseShift; //相位偏移
|
||
unsigned short OuputPulseCol; //桂林客户,精准控制输出脉冲的位置,精确到打印的列数
|
||
int phaseDetectVol;
|
||
unsigned int phase_detect_pulse_num:4; // 检测个数
|
||
unsigned int phase_detect_voltage:12; // 相检电压阀值
|
||
unsigned short phaseDetectDelay;
|
||
unsigned char rrrccc[2];
|
||
quint16 phaseHighCnt;
|
||
#ifdef COUNTER1_BY_GROUP //分段计米
|
||
Cnt1ByGroup_t Cnt1ByGroup;
|
||
#endif
|
||
EXPIRYVAR_t ExpiryVar; //有效期变量 2018.5.24
|
||
EXPIRYVAR_t CurDateVar;
|
||
EXPIRYVAR_t ClassVari;
|
||
int ExpiryDay; //有效期天数
|
||
//unsigned char ExpirySplitMode;
|
||
|
||
int cnt4CurrValue;
|
||
int HiddenConditionValue;
|
||
bool HiddenFuncEnable;
|
||
bool HiddenMeterEnable;
|
||
|
||
// int cnt3EndValue;
|
||
// int cnt3StartValue;
|
||
// int cnt3StepValue;
|
||
// int cnt3RepeateValue;
|
||
int cnt3CurrValue;
|
||
int textEditLineSpace;
|
||
unsigned char speedoverPaushPrint; // 3速度超速不打印标志
|
||
}printPara_t;
|
||
*/
|
||
|
||
|
||
typedef struct{
|
||
/* 打印参数 */
|
||
// unsigned int printTotalColNum:16; // 0,1
|
||
// unsigned int printDirection:8; // 2[0] 上下颠倒 [1] 左右颠倒 [2] 扫描颠倒
|
||
// unsigned int reducedPixelNum:6; // 3 冗余点数
|
||
// unsigned int reducedPixelMode:2; // 冗余点比例
|
||
// unsigned int printRowDelay:8; //4 打印模式
|
||
unsigned int printColDelay:24; // 打印设置下的 5,6,7 字宽
|
||
|
||
unsigned char charBold; //8 字体加宽
|
||
// unsigned char pixNumPerCol; // 9 每列点阵数
|
||
unsigned int timeTriggerPrintDelayMs:16; //a,b
|
||
unsigned int photoElectricityRepeateNum:16; //c,d
|
||
unsigned short eleEyeTriggerPrintDelay; // e,f
|
||
|
||
unsigned int printTriggerMode:8; // 10
|
||
// unsigned int totalSynPulseNum:24; //11,12,13
|
||
unsigned int elecEyeTriggerInterval:32; //14,15,16,17
|
||
|
||
// unsigned char extClearAllCntEnable; // 1c --- 通过外部(同步器或电眼)清零 0x3a
|
||
|
||
unsigned char HighVoltageAmplitude; //0x1d 字高// 字高电压系数
|
||
// unsigned char mmmee[2];
|
||
|
||
// FPGA ADDR 0x60~0x63
|
||
// unsigned short productNumToGenerateOutputPulse; //0x1d,1e num产品 out put a pulse
|
||
unsigned short outputPulseDelayMs; // 0x1f,0x20
|
||
|
||
// FPGA ADDR 0x44~
|
||
alterPrint_t alterPrint; // 8Byte FPAG由地址0x44~0x4B
|
||
unsigned char Cnt1NatureValue:1; //0自然数
|
||
unsigned char eleEyeTriggerSynPrintEn:1; //1电眼触发的同步打印使能
|
||
// unsigned char autoSynSpeedEn:1; //2同步打印自动模式
|
||
// unsigned char newAmplifyPlate:1;//新放大板选项
|
||
// unsigned char SynCntEn1:1; // 4 不打印走米
|
||
// unsigned char Vol1of8En:1; // 5 1/8电压打印
|
||
unsigned char eleEyeReTrigDisable:1; // 6
|
||
// unsigned char set_HVData_Flag:1; // checkBoxYH
|
||
|
||
unsigned char decimalBits; // 0x4d 小数点位数
|
||
|
||
// unsigned short synPulsePerMmX8 ;// 0x4e~4f
|
||
|
||
bool leftRightInverse;
|
||
bool upDownInverse;
|
||
bool scanInverse;
|
||
int currPrintMode;
|
||
|
||
int cnt1EndValue;
|
||
int cnt1StartValue;
|
||
int cnt1StepValue;
|
||
int cnt1RepeateValue;
|
||
int cnt1CurrValue;
|
||
int cnt2EndValue;
|
||
int cnt2StartValue;
|
||
int cnt2StepValue;
|
||
int cnt2RepeateValue;
|
||
int cnt2CurrValue;
|
||
float synTriggerPrintLenMm;
|
||
int timeTriggerPrintMode;
|
||
int printDelayMs;
|
||
int sysTriggerPrintMode; //在同步模式下选择按字宽或时喷印比例进行打印
|
||
int rowSequenceMode;
|
||
|
||
int synClearCntInEleEyeMode; //在电眼触发模式下通过同步器清零
|
||
int eleEyeClearCntInSynMode;
|
||
int reducedPixelNumRatio;
|
||
int pulseOutputEnable; // 脉冲使能输出
|
||
int productCntPerOutputPulse;//
|
||
|
||
int startVoltage; //首行电压
|
||
// int endVoltage; //行末电压
|
||
|
||
float synPulseNumPerMm;// 同步器参数 脉冲/毫米
|
||
// 添加参数
|
||
unsigned char adjVolDacRate[40]; //增加了DAC电压间隔调整比例
|
||
// int FullColFixVal;
|
||
unsigned char SynCntEn:1;
|
||
// unsigned char ENNCC:7;
|
||
// unsigned char NCCC22;
|
||
unsigned short eleMaskTime; // 16bit
|
||
// unsigned short AltMirrorGap;// 镜像打印间隔 Mirror image alternation
|
||
unsigned short headLen;
|
||
unsigned short endLen;//6
|
||
unsigned char varLenEn;//
|
||
short varLen; // 可变长
|
||
short varLen1; // 可变长
|
||
// unsigned char NCCC;
|
||
QRvars_t QRvars[MAX_QVARI_NUM];
|
||
//BCvars_t BCvars[MAX_QVARI_NUM];
|
||
stepPrint_t stepPrint; // 8Byte
|
||
// int phaseHighLowRatio; //保存相检
|
||
// short phaseShift; //相位偏移
|
||
// unsigned short OuputPulseCol; //桂林客户,精准控制输出脉冲的位置,精确到打印的列数
|
||
// int phaseDetectVol;
|
||
// unsigned int phase_detect_pulse_num:4; // 检测个数
|
||
// unsigned int phase_detect_voltage:12; // 相检电压阀值
|
||
// unsigned short phaseDetectDelay;
|
||
// unsigned char rrrccc[2];
|
||
// quint16 phaseHighCnt;
|
||
bool cnt1ByGroupEnalbe; // hlp todo 上面注释内容大概率要使用
|
||
bool cnt2ByGroupEnalbe;
|
||
#ifdef COUNTER1_BY_GROUP /* 分段计米 */
|
||
Cnt1ByGroup_t Cnt1ByGroup;
|
||
#endif
|
||
#ifdef COUNTER2_BY_GROUP /* 分段计米2 */
|
||
Cnt2ByGroup_t Cnt2ByGroup;
|
||
#endif
|
||
EXPIRYVAR_t ExpiryVar; //有效期变量 2018.5.24
|
||
EXPIRYVAR_t CurDateVar;
|
||
EXPIRYVAR_t ClassVari;
|
||
int ExpiryDay; //有效期天数
|
||
|
||
int cnt4CurrValue;
|
||
int HiddenConditionValue;
|
||
bool HiddenFuncEnable;
|
||
bool HiddenMeterEnable;
|
||
|
||
int cnt3CurrValue;
|
||
int textEditLineSpace;
|
||
int textEditCharSpace;
|
||
// unsigned char speedoverPaushPrint; // 3速度超速不打印标志
|
||
}printPara_t;
|
||
|
||
|
||
typedef struct {
|
||
|
||
unsigned int printTotalColNum:16;
|
||
unsigned int printDirection:8; //[0] 上下颠倒 [1] 左右颠倒 [2] 扫描颠倒
|
||
unsigned int reducedPixelNum:6;
|
||
unsigned int reducedPixelMode:2;
|
||
|
||
unsigned int printRowDelay:8;
|
||
unsigned int printColDelay:24;
|
||
|
||
unsigned char oscillatorVoltage; //0x08
|
||
unsigned char phaseByHand;
|
||
unsigned char charBold;
|
||
unsigned char pixNumPerCol;
|
||
|
||
unsigned int timeTriggerPrintDelayMs:16;
|
||
unsigned int photoElectricityRepeateNum:16;
|
||
|
||
unsigned int printTriggerMode:8; //0x10
|
||
unsigned int totalSynPulseNum:24;
|
||
|
||
|
||
unsigned int elecEyeTriggerInterval:32;
|
||
|
||
unsigned short divideRatio; //0x18
|
||
unsigned char lineEndAdjustPointCnt; // 0x1a
|
||
unsigned char lineEndAdjustPointDelay; // 0x1b
|
||
unsigned char enableChargeFullTime; // 0x1c
|
||
unsigned char timeTriggerPrintDelayMsH:8; // 0x1
|
||
//unsigned char phaseGroupCount:8; // 0x1
|
||
short lastLineEndPointFixedDACValue;
|
||
|
||
unsigned int synNumPerCol:16; //0x20,小数位占8位 //每列同步起脉冲数
|
||
unsigned int dotNumPerCol:16; // 平均每列的像素点(减去冗余的点后) + 列延迟(即打印设置界面中的字体宽度printColDelay)
|
||
|
||
unsigned short phase_detect_high_cnt; //
|
||
unsigned int phase_detect_pulse_num:4; // 检测个数
|
||
unsigned int phase_detect_voltage:12; // 相检电压阀值
|
||
|
||
unsigned short maxHighVoltageDAC;//0x28
|
||
|
||
unsigned short phaseDetectDelay; //相检延迟 //可以认为是相检的间隔, 以墨点为单位
|
||
short phaseShift; // 相位偏移
|
||
unsigned char HighVoltageAmplitude;
|
||
unsigned char magicNum;
|
||
|
||
unsigned short productNumToGenerateOutputPulse; //产生一个脉冲所需的产品计数个数//0x30
|
||
unsigned short outputPulseDelayMs;
|
||
unsigned short septalPostion; //设置的隔膜位置
|
||
unsigned short blinkLightPeriod; //频闪灯周期,以墨点为单位
|
||
unsigned short eleEyeTriggerPrintDelay; // 0x38
|
||
unsigned char extClearAllCntEnable; //通过外部(同步器或电眼)清零 0x3a
|
||
unsigned char FullColFixDacVal; // 0x3b
|
||
// 0x3C 0x3D 3E 3F USEING
|
||
|
||
alterPrint_t alterPrint; // 8Byte
|
||
|
||
unsigned char Cnt1NatureValue:1; //自然数
|
||
unsigned char eleEyeTriggerSynPrintEn:1; //电眼触发的同步打印使能
|
||
unsigned char autoSynSpeedEn:1; //同步打印自动模式
|
||
unsigned char newAmplifyPlate:1;
|
||
unsigned char SynCntEn1:1; // 不打印走米
|
||
unsigned char Vol1of8En:1; //打印优化
|
||
unsigned char eleEyeReTrigDisable:1; // 6
|
||
unsigned char set_HVData_Flag:1; //
|
||
unsigned char mode0211:1; //0211 模式
|
||
unsigned char synchronizorActType:2; // 0b00:同步器正反转打印; 0b01:同步器只正转打印; 0b10:同步器只反转打印
|
||
unsigned char cnt1ResetToInitValue:1; // 电眼复位时,选择复位到起始值还是当前值
|
||
unsigned char flagOfFastMode:1;
|
||
unsigned char rrr_nc0:1; // 0x4D :[5:5]
|
||
unsigned char printNumPoint:1; // 0x4D :[6:6]计数器1打印小数点使能位
|
||
unsigned char rrr_nc:1; // 0x4D :[7:7]
|
||
|
||
unsigned short synPulsePerMmX8 ;// 0x4e~4f
|
||
/*-------------------------------cut line--------------------------------------*/
|
||
|
||
stepPrint_t stepPrint; // 8Byte
|
||
unsigned int reserved_reg[12]; // 4*(12)=48Byte // 地址: ~0x7F
|
||
unsigned short highVoltageRecord[10]; // 0x80 = 128开始
|
||
int reclaimPumpPWMWidth;
|
||
bool leftRightInverse;
|
||
bool upDownInverse;
|
||
bool scanInverse;
|
||
int currPrintMode;
|
||
float synPulseNumPerMm; // 每100mm同步器脉冲数
|
||
int cnt1EndValue;
|
||
int cnt1StartValue;
|
||
int cnt1StepValue;
|
||
int cnt1RepeateValue;
|
||
int cnt1CurrValue;
|
||
int cnt2EndValue;
|
||
int cnt2StartValue;
|
||
int cnt2StepValue;
|
||
int cnt2RepeateValue;
|
||
int cnt2CurrValue;
|
||
|
||
int startVoltage;
|
||
int endVoltage;
|
||
float synTriggerPrintLenMm;
|
||
|
||
int highVoltageLevel;
|
||
int pressure;
|
||
int viscosityPumpInterval;
|
||
int reclaimTankTime;
|
||
int temperature;//喷头温度
|
||
int viscosity;
|
||
int viscosityAdjust;
|
||
bool stopCounterMeterAfterFault;
|
||
bool suspendAfterPhaseFault;
|
||
int oscillatoFreq;
|
||
int synTriggerPrintLenRatio;
|
||
char lastOpenedFileName[100];
|
||
int phaseHighLowRatio; //相位高电平占空比
|
||
int phaseDetectVol; //因为和实际的值有一个转换过程,所以用此变量做中转
|
||
int oscillatorFreqFix;
|
||
unsigned int totalProductCnt;
|
||
int timeTriggerPrintMode;
|
||
int printDelayMs;
|
||
int sysTriggerPrintMode; //在同步模式下选择按字宽或时喷印比例进行打印
|
||
int synCharWidthRatio; //字符宽度 或 喷印比例 触发设置界面
|
||
int rowSequenceMode;
|
||
int pointVoltageAdjustPos; // 点距电压调整位置
|
||
int PointVoltageAdjustValue; //点距调压调整值, 超过调整位置就需要增加充电电压
|
||
int RecycleWarnAction;
|
||
int powerOffAfterPhaseFault;
|
||
int synClearCntInEleEyeMode; //在点眼触发模式下通过同步器清零
|
||
int eleEyeClearCntInSynMode; // CNT2 D5=0选择电眼复位 D5=1选择电眼加1 ;
|
||
// CNT1 D4=0选择电眼复位 D4=1选择电眼加1 ;
|
||
// D2D1D0 =00 禁止电眼操作,01 电眼复位,打印完成,10 电眼立即复位
|
||
|
||
int fontPixelSize; //用来记录上一次设置的字体大小
|
||
//int septalPostion;
|
||
int mixValveisNewVersion; //混和阀是否是新管路
|
||
int lastLineEndPointFixedValue; //对高压部分点的修正
|
||
int textEditLineSpace;
|
||
int textEditCharSpace;
|
||
int industryIndex;
|
||
int recommendedPrintSpeed;
|
||
int pulseOutputEnable;
|
||
int productCntPerOutputPulse;
|
||
int reducedPixelNumRatio;
|
||
int EditMode; //编辑模式 0 txt , 1 dot, 2 场景
|
||
//int nncc:31;
|
||
int AlterMode; // 交替状态 0,1,2
|
||
int SynCntEn:1;
|
||
int ResetProductCntEn:1; // 复位产品计数器
|
||
int ResetAllProductCntEn:1;// 复位总产品计数器
|
||
int HVFaultCloseEn:1;// 高压故障关回收槽
|
||
int MirrABCEnable:2; // 0 无镜像,1 水平,2 垂直
|
||
int checkSpace:1; //使用空列
|
||
int varLenEn:1;//
|
||
int ExtScreenType:3;// 外接屏类型
|
||
int ExtMeterType:3; // 显示屏显示米数类型
|
||
int unc:15; //
|
||
int FullColFixVal;
|
||
unsigned char ReadFileErrorCnt; //
|
||
unsigned char PowerOnErrorCnt; //
|
||
unsigned char NozzleType; // 0 -- 小,1- 大
|
||
unsigned char NNCC; //预留,这样可以保证每次的配置文件大小一致
|
||
short varLen; // 头部可变长
|
||
short varLen1; // 尾部可变长
|
||
unsigned short OuputPulseCol; //桂林客户,精准控制输出脉冲的位置,精确到打印的列数-->现在用作充电脉宽
|
||
// short reverse; //留,这样可以保证每次的配置文件大小一致
|
||
unsigned char diameter:3; // 喷嘴直径,0->50um; 1->60um; 2->70um
|
||
unsigned char Reciclar:1;
|
||
unsigned char ResetSendData:1;
|
||
unsigned char reverse:2;
|
||
bool isCheckInsertTime;
|
||
calandar_and_dat_t calandar_and_dat;
|
||
// 添加参数
|
||
unsigned char adjVolDacRate[40]; //增加了DAC电压间隔调整比例
|
||
|
||
bcOption_t bcOption;
|
||
qrOption_t qrOption;
|
||
unsigned short eleMaskTime; //0x3C,3D 电眼锁定(屏蔽)间隔ms
|
||
unsigned short AltMirrorGap;// 镜像打印间隔 Mirror image alternation
|
||
long long openInkLineTime; //记录墨线开关时间 136年 以秒为单位
|
||
long TrunOnPowerCnt; // 开机次数 20151218
|
||
// int varLenEn:1;//
|
||
// unsigned char varLen; // 可变长
|
||
unsigned short headLen;
|
||
unsigned short endLen;
|
||
int ExpiryDay; //有效期天数
|
||
unsigned char ExpirySplitMode;
|
||
quint16 diaphramOffset; // 隔膜位置偏移,当隔膜位置低于(设定的隔膜位置-偏移),主墨泵就开启
|
||
unsigned char gearPumpEnable:1;
|
||
|
||
quint16 gearPumpValue;
|
||
quint16 steal_dac_row;
|
||
quint16 phaseHighCnt;
|
||
int reserved2[13];// 23 -1预留,这样可以保证每次的配置文件大小一致
|
||
unsigned short reverse3;
|
||
bool isCheckBarDate; //条形码加入日期
|
||
bool isCheckBarTime; //条形码加入时间
|
||
bool cnt1ByGroupEnalbe;
|
||
bool cnt2ByGroupEnalbe;
|
||
#ifdef COUNTER1_BY_GROUP /* 分段计米 */
|
||
Cnt1ByGroup_t Cnt1ByGroup;
|
||
#endif
|
||
#ifdef COUNTER2_BY_GROUP
|
||
Cnt2ByGroup_t Cnt2ByGroup;
|
||
#endif
|
||
quint16 printed_adj_dac[40];
|
||
quint16 printed_continue_col_dac[40];
|
||
quint16 printed_full_col_dac[40];
|
||
quint16 dacScale;
|
||
unsigned int pulse_sinal_value:16;
|
||
|
||
int cnt3EndValue;
|
||
int cnt3StartValue;
|
||
int cnt3StepValue;
|
||
int cnt3RepeateValue;
|
||
int cnt3CurrValue;
|
||
stru_counter3 Counter3;
|
||
stru_counter4 Counter4;
|
||
int cnt4CurrValue;
|
||
int HiddenConditionValue;
|
||
bool HiddenFuncEnable;
|
||
bool HiddenMeterEnable;
|
||
|
||
//quint16 Json_device_code;
|
||
unsigned char Json_IP[4];
|
||
quint16 Json_server_port;
|
||
bool charWidthSetEnable;
|
||
bool isCheckMagnet;//检测喷头盖磁铁
|
||
bool isRemoveCode;//不显示二维码
|
||
bool isCheckPrintLight;//
|
||
bool isEnableGetDataButton;//使能获取数据按钮
|
||
bool isRemoveDigitCode;//不显示数字码
|
||
bool isCntSaveStateValue;//计数器保存关机值
|
||
bool isCheckBarCodeAddText;
|
||
bool isCnt1ShowNumPoint; //计数器1是否显示小数点
|
||
char FanTemperature;
|
||
char Json_device_code[10];
|
||
unsigned char speedoverPaushPrint:1; // 速度超速不打印标志
|
||
bool flagOfModuleDecimal;
|
||
bool flagOfModuleHide;
|
||
bool flagOfstepPrint;
|
||
bool flagOfCnt1GroupDisp;
|
||
bool flagOfReclaimPumEnable;
|
||
unsigned int gearPumpSpeedAlarm;
|
||
char comport[20];
|
||
bool flagOfContinueHeat;
|
||
unsigned int heatTime;
|
||
bool RFIDSolventWarn;
|
||
int RFIDSolventWarnMixCnt;
|
||
bool RFIDInkWarn;
|
||
bool flagOf5Row5Dot;
|
||
unsigned int inkWarnDate;
|
||
unsigned int inkWarnTime;
|
||
unsigned int solventWarnDate;
|
||
unsigned int solventWarnTime;
|
||
unsigned short moduleSelection;
|
||
bool flagOfAdjustVoltage;
|
||
unsigned short currSelectVolPara;
|
||
|
||
int airPushDurationSec; // 排气时间,单位 秒
|
||
/* */
|
||
// 1108Bytes
|
||
}sysPara_t;
|
||
|
||
typedef struct
|
||
{
|
||
quint8 header[32];
|
||
qint16 pixel_full_table[40];
|
||
qint16 pixel_1_table[40];
|
||
qint16 pixel_2_table[40][2];
|
||
qint16 pixel_3_table[40][3];
|
||
qint16 pixel_4_table[40][4];
|
||
qint16 pixel_para_table[16];
|
||
qint16 pixel_5_table[40][5];
|
||
qint16 pixel_gap_table[48][5];
|
||
qint16 pixel_pre_table[16][5];
|
||
qint16 pixel_c_table[32][4];
|
||
}voltePara_t;
|
||
|
||
typedef struct
|
||
{
|
||
quint16 matchTotalTableDACArray1[64];
|
||
quint16 matchTotalTableDACArray2[64][2];
|
||
quint16 matchTotalTableDACArray3[64][3];
|
||
quint16 matchTotalTableDACArray4[64][4];
|
||
quint16 matchTotalTableDACArray5[64][5];
|
||
quint16 matchContinousDACArray[64];
|
||
qint8 matchTotalDiffVoltageValue[50][64];
|
||
quint8 matchExtraLineDACArray[64];
|
||
qint8 matchFirstOnePointExtraLineDACArray[64];
|
||
qint8 matchAdjustParaDACArray[8];
|
||
qint8 matchGiantPointVoltageValue[16][64];
|
||
quint16 matchTotalTableDACArrayFirst1[64]; //调一列的第一个单点
|
||
}voltePara_t_25Dots;
|
||
typedef struct
|
||
{
|
||
quint8 header[32];
|
||
qint16 pixel_full_table[48];
|
||
qint16 pixel_steal_table[48];
|
||
qint16 pixel_head2_table[48];
|
||
qint16 pixel_head3_table[48];
|
||
|
||
qint16 pixel_1_table[48];
|
||
qint16 pixel_tail2_table[48];
|
||
|
||
qint16 pixel_2_table[48][2];
|
||
|
||
qint16 pixel_3_table[48][3];
|
||
|
||
qint16 pixel_4_table[48][4];
|
||
|
||
qint16 pixel_para_table[16];
|
||
|
||
qint16 pixel_5_table[48][5];
|
||
qint16 pixel_continous_table[48];
|
||
qint16 pixel_gap_table[48][5]; // kongdian
|
||
qint8 pixel_big_table[8][8];
|
||
qint16 pixel_gap_post_3dot_table[48][5]; // 3 kongdian
|
||
|
||
qint16 row_delay_table[48];
|
||
qint16 head1_row_delay_table[48];
|
||
qint16 full_row_delay_table[48];
|
||
qint16 pixel_general_dac_parameter[64];
|
||
}voltePara_t_No73;
|
||
typedef struct
|
||
{
|
||
unsigned int PrintInkDots;
|
||
unsigned int InkEmptyCnt;
|
||
unsigned int SOLVEmptyCnt;
|
||
unsigned int InkRFIDCnt;
|
||
unsigned int SOLVRFIDCnt;
|
||
unsigned short solventNumber;
|
||
}RFIDPara_t;
|
||
|
||
#define MDT 0
|
||
#define QR 1
|
||
#define BAR 2
|
||
#define QR_NETWORK 3 // 网络二维码
|
||
|
||
#define MAX_SELF_CHECK_CNT 6000 //60S,以10ms为单位s
|
||
|
||
#if defined(BNS_AARCH64_DEBUG) || defined(FPGATEST)
|
||
#undef MAX_SELF_CHECK_CNT
|
||
#define MAX_SELF_CHECK_CNT 1000
|
||
#endif
|
||
|
||
#define MIX_VALVE_OPEN_DELAY 90 //混合阀打开的时间
|
||
#define RECYCLE_WARN_DELAY 50 //回收故障延时,以100ms为单位
|
||
#define MAX_VISCOSITY_WORK_TIME 500 //10ms为单位
|
||
#define MAX_MAIN_INK_PUMP_RUN_TIME 1000 //10s
|
||
#define MAX_HEATER_TIME 3000 //300s
|
||
#define MAX_COMPRESS_PUMP_RUN_TIME 6000 //60
|
||
|
||
#define FPGA_MAGIC_NUM_AFTER_CONF 0x73
|
||
#define MAX_CYCLEVALVE_OPEN_TIME_AFTER_SWITN_OFF 280 // 以10ms为单位 230
|
||
|
||
|
||
|
||
#define FPGA_STATUS_BYTE_NUM 0x44
|
||
|
||
#define MAX_PRINT_COL_NUM_Wide (1000*8 - 1)
|
||
#define MAX_PRINT_COL_NUM_Normal (500*8 - 1)
|
||
#define MAX_PRINT_ROW_NUM 40
|
||
#define MAX_PRINT_ROW_BYTE_NUM 5
|
||
#define BLANK_COL_NUM 3 //信息前空3列
|
||
#define RECLAIM_PUMP_FULL_SPEED_CNT 5300 //5s钟
|
||
#define MAX_VARI_NUM 8
|
||
|
||
|
||
#define CALANDAR_YEAR 0
|
||
#define CALANDAR_MONTH 1
|
||
#define CALANDAR_DAY 2
|
||
#define CALANDAR_WEEK 3
|
||
#define CALANDAR_HOUR 4
|
||
#define CALANDAR_MINUTE 5
|
||
#define CALANDAR_SECOND 6
|
||
#define CALANDAR_CNT1 7
|
||
#define CALANDAR_CNT2 8
|
||
#define CALANDAR_CNT3 13
|
||
#define CALANDAR_XDAY 14
|
||
#define CALANDAR_CNT4 15
|
||
#define RANDOMNUM 12
|
||
#define EXPIRYDATE 80
|
||
#define CURDATE 81
|
||
#define CURCLASS 82
|
||
|
||
#define MAX_INK_EMTYTIME 86400//10800 // s 3hour 3*60*60 = 10800s
|
||
#define MAX_SOLV_EMTYTIME 21600//10800 // s 3hour 3*60*60 = 10800s
|
||
#define MAX_INK_RFIDTIME 86400//10800 // s 3hour 3*60*60 = 10800s
|
||
#define MAX_SOLV_RFIDTIME 7200//21600//10800 // s 3hour 3*60*60 = 10800s
|
||
#define MAX_INK_DOTS 2300000000//PrintInkDots
|
||
#define MAX_SOLV_OPENNUM 400//OpenNumber
|
||
#define MAX_INK_SOLV_EMTYTIME 10800 // s 3hour 3*60*60 = 10800s
|
||
|
||
#define AUTOCLEAN_STATUS_NONE 0
|
||
#define AUTOCLEAN_STATUS_STEP1 1
|
||
#define AUTOCLEAN_STATUS_STEP2 2
|
||
#define AUTOCLEAN_STATUS_STEP3 3
|
||
#define AUTOCLEAN_STATUS_STEP1_TIME 60
|
||
#define AUTOCLEAN_STATUS_STEP2_TIME (60*3)
|
||
#define AUTOCLEAN_STATUS_STEP3_TIME (5)
|
||
|
||
typedef struct {
|
||
int type;
|
||
int digitalNum;
|
||
int width; // 字模的宽度
|
||
int height; // 字模的高度
|
||
int startColPos;
|
||
int endRowPos;
|
||
int startRowPos;
|
||
int bassAddr; // 字模的地址, 从0开始,不同类型会一直增加
|
||
int currVal;
|
||
int bold;
|
||
int letterSpace;
|
||
//int chartype;// 字体类型:0 常规,1 左横,2 右横, 4 倒立(Nc)
|
||
//---------------------
|
||
unsigned char *dat; //指向申请内存的空间 生成字模数据
|
||
int datWidth; //datWidth * datHeight为像素的数目,申请空间的大小为datWidth*rowByteNum;
|
||
int datHeight; // 变量的高度
|
||
int rowByteNum;
|
||
bool original; //表示当前dat是通过calloc申请而来还是直接引用别人的指针,主要是影响到指针的释放
|
||
char fontname[128]; // 字体名
|
||
}vars_t;
|
||
|
||
|
||
typedef struct{
|
||
|
||
unsigned int unUse1:16;
|
||
unsigned int unUse2:16;
|
||
|
||
unsigned int unUse3:16;
|
||
unsigned int unUse4:16;
|
||
|
||
unsigned int unUse5:16;
|
||
unsigned int unUse6:16;
|
||
|
||
unsigned int unUse7:16;
|
||
unsigned int unUse8:16;
|
||
|
||
|
||
unsigned int maginNum:8; //0x10
|
||
|
||
unsigned int unUse9:8;
|
||
|
||
unsigned int flightTm:16;
|
||
|
||
unsigned int phase:16;
|
||
|
||
unsigned int unUse10:16;
|
||
|
||
unsigned char phaseChargeResult[8];
|
||
|
||
/*
|
||
unsigned short ink_dot_num:6; //飞过相检头上的墨点数 0x20
|
||
unsigned short detect_phase_error:1;
|
||
unsigned short flight_tm_error:1;
|
||
unsigned short synPulseCntPer1sH:8;
|
||
unsigned short synPulseCntPer1s:16;
|
||
*/
|
||
unsigned int ink_dot_num:6; //飞过相检头上的墨点数 0x20
|
||
unsigned int detect_phase_error:1;
|
||
unsigned int flight_tm_error:1;
|
||
unsigned int synPulseCntPer1s:24;
|
||
|
||
unsigned int productCnt;
|
||
|
||
unsigned int synColDelay:16; //0x28
|
||
unsigned char phasePosEdge; //0x2a
|
||
unsigned char phaseNegEdge; //0x2b
|
||
|
||
unsigned int synTotalPulseCnt; //0x2c~2f
|
||
|
||
unsigned int warm_InkPump:1; // 0x30
|
||
unsigned int ink_Ctrl:1;
|
||
unsigned int adj_warn:1; // 自动调速状态 NC 20140305
|
||
unsigned int lesslen_warn:1; // 喷印不完整报警 20140305
|
||
unsigned int wait_phdetect_ok:1; // 等待相检完成 V3W 版还没有对此作修改。 原V6S的参数
|
||
unsigned int set_HVData_Flag:1; // 设置高压包电流标志
|
||
unsigned int dummy:2; //FPGA回传是否正在打印 20260306
|
||
unsigned char unUse11; // 0x31 130113
|
||
unsigned short unUse12; // 0x32 33 电机当前开关时长(s) 130113
|
||
unsigned char read_nc11[2]; //34,35 // no use
|
||
unsigned char ele_product_cnt_reset; //36 {ele_product_cnt_reset[1:0]};
|
||
unsigned char RandomNum; // 目前实际只[4:0] 37
|
||
unsigned int totalProductCnt ; // 总产品计数器 38393A3B // [1:0] 11立即清零, [2]计数器1单独清零 [3]计数2单独清零 [4]总产品计数器清零
|
||
unsigned int total_syn_pulse_num ; //
|
||
unsigned int volGap_pulse_num:24; //
|
||
unsigned int AlterMode:8; // 交替状态 0,1,2; //0x43 共 0x44个字节
|
||
unsigned int VREF:16;
|
||
unsigned int MOTOR_ISEN:16;
|
||
|
||
unsigned int TEMP_ADIN:16;
|
||
unsigned int HV_DETOUT:16;
|
||
|
||
unsigned int AD_FIXED:16;
|
||
unsigned int SEPTAL_POSITION:16;
|
||
|
||
unsigned int PRESSURE:16;
|
||
unsigned int AD_UNUSED:16;
|
||
unsigned int statWarn:8; //0x11
|
||
unsigned int viscosity:16;
|
||
unsigned int mainPumpWarm:8;
|
||
unsigned char reclaimTankstatus; // 0x31 130113
|
||
unsigned short curr_reclaimTankTime; // 0x32 33 电机当前开关时长(s) 130113
|
||
//unsigned char read_ncba[6]; // 不用 3C
|
||
|
||
|
||
/*----------------------------cut line----------------------------*/
|
||
unsigned short phaseDetectHighTm[64]; //每一个相位的高电平时间
|
||
|
||
unsigned char RandomDigitNum;// 随机码长度
|
||
unsigned char RandomBackCnt; // 0不需要备份,>0需要备份
|
||
|
||
bool isPumpValveControledByHand; //0x20
|
||
bool isCleanUp;
|
||
int reclaimCloseCnt;
|
||
bool selfCheckDone;
|
||
int selfCheckCnt;
|
||
int viscosityDelayCnt;
|
||
int viscosityFaultCnt;
|
||
int rWarnViscoReady;
|
||
int viscosityMaxFaultCnt;
|
||
int reclaimPumpFullSpeedCnt; //全速开
|
||
bool mainInkPumpError; //主墨泵故障
|
||
int mainInkPumpRunTmCnt;
|
||
bool compressPumpError;
|
||
int compressPumpRunTmCnt;
|
||
int currPrintCol;
|
||
int currPrintRow;
|
||
unsigned char printDat[MAX_PRINT_COL_NUM_Wide*MAX_PRINT_ROW_BYTE_NUM];
|
||
unsigned char printDat_Normal[MAX_PRINT_COL_NUM_Normal*MAX_PRINT_ROW_BYTE_NUM];
|
||
int currAlterPrintCol;
|
||
int currAlterPrintRow;
|
||
// unsigned char printAlterDat1[MAX_PRINT_COL_NUM*MAX_PRINT_ROW_BYTE_NUM];
|
||
// unsigned char printAlterDat2[MAX_PRINT_COL_NUM*MAX_PRINT_ROW_BYTE_NUM];
|
||
int delay10ms;
|
||
int delay100ms;
|
||
int delay1s;
|
||
int delay10s;
|
||
int delay100s;
|
||
int viscosityFault;// 0 正常,1-粘度值高,2-粘度值低
|
||
int lastViscosityFault; //用来记录上一次的粘度错误状态
|
||
int lastStatWarn;
|
||
int lastPhaseFault;
|
||
int phaseErrorCnt;
|
||
|
||
/* Yang */
|
||
int lastRecycleWarn; //记录上一次的回收故障状态
|
||
int RecycleWarnCnt;
|
||
int LightUpCnt;
|
||
|
||
bool gearPumpRunStopFlag;
|
||
unsigned short gearPumpRunSpeed; //齿轮泵转速
|
||
int visocityValueOverflowNum; /*记录粘度溢出次数*/
|
||
unsigned int lastProductCnt;
|
||
unsigned int lastSynPulseCntPer1s; //
|
||
int lastSynColDelay;
|
||
int configDone; //配置完成
|
||
unsigned int fpgaVersionNum;
|
||
unsigned char FPGAChipType; //VX4区分E15和E22芯片,VX5不需要
|
||
bool detectHighVoltageAppending; //检测高压
|
||
bool detectedValidHighVoltage; //是否检测到高压
|
||
unsigned int detectHighVoltageCnt; //检测高压的次数
|
||
int lastwarmInkPump;
|
||
int variNum,QRvariNum,BCvariNum,ExpiryVarNum,ExpiryDispUpdate,CurrDateVariNum,classVariNum;
|
||
vars_t vars[MAX_VARI_NUM];
|
||
//QRvars_t QRvars[MAX_QVARI_NUM];
|
||
calandar_and_dat_t calandar_and_dat;
|
||
|
||
/*---------------回收槽控制相关----------------------*/
|
||
int currReclaimTankPos;
|
||
int currReclaimOperationCnt;
|
||
bool reclainTankReachEnd; //完全打开
|
||
bool reclainOpenAppending;
|
||
bool reclainCloseAppending;
|
||
bool canRunAirPushing;
|
||
|
||
int currMsCnt;
|
||
/*---------------------------------------------*/
|
||
bool cnt1CurrentValueInitDoneFlag; // 将这两个值设为false,会另cnt1和cnt2的当前值初始化
|
||
bool cnt2CurrentValueInitDoneFlag; //
|
||
/*----------------------------------------------*/
|
||
/*----------------------------------------------*/
|
||
bool RedLightOnFlag;
|
||
bool GreenLightOnFlag;
|
||
bool YellowLightOnFlag;
|
||
|
||
bool beeperOnFlag;
|
||
/*--------------------------------------------*/
|
||
int heaterONTimeCnt; //连续加热有时间限制
|
||
|
||
bool lostCommuFlag; //失去通信
|
||
|
||
bool isPrinting; //
|
||
|
||
int cycleValveOpenCntAfterSWintOff; //墨线关掉的时候关循环阀的时间
|
||
int cycleValveOpenCntAfterSWintOn; //墨线开启的时候开循环阀的时间
|
||
|
||
//2019/10/26
|
||
bool autoCtlReclaimAfterSWintOff;
|
||
int reclaimOpenCntAfterSWintOff; //墨线关掉的时候关回收阀的时间
|
||
bool byHandStore; // 为了控制主墨泵, 保存当前是否在手动状态,然后切换手动状态,
|
||
|
||
bool powerOffAppending; //按下快速关机
|
||
|
||
bool reclaimTankBlockedAppending; //回收槽被卡住
|
||
int airPushingOnTime; // 排气的运行时间
|
||
bool airPushing; // 开回收槽执行排气动作
|
||
bool airPushingDone; // 开回收槽执行排气动作完成
|
||
|
||
bool DACDisable; //相位故障,DAC被disable
|
||
bool WorkTimeOut;
|
||
bool detectBestOscillatorFreqAppending; //检测最佳晶振频率
|
||
bool detectBestOscillatorVoltageAppending; //检测最佳晶振频率
|
||
int currentDetectBestOscillatorCnt;
|
||
int longestPhaseHightLevelTm; //最长的相位高电平时间
|
||
int detectedBestOscillatorFreq; //
|
||
int detectedStartOscillatorFreq;
|
||
int detectedBestOscillatorVoltage; //
|
||
int releaseValveDelayCnt; //开泄压阀后立刻关掉,等一定间隔在检测
|
||
int reclaimBlockedCnt;
|
||
bool releaseValveOpenApending;
|
||
int powerOffAfterPhaseFaultAppending;
|
||
unsigned int pressureOverFlowCnt;
|
||
unsigned int septalPositionOverFlowCnt;
|
||
bool powerOffAfterInkOrSOLVEmptyAppending; //墨水或溶剂空3小时标志
|
||
//
|
||
alterPrint_t alterPrint; // 交替打印
|
||
stepPrint_t stepPrint; // 跳米打印
|
||
build_dat_t build_dat;
|
||
xor_sync_couter xor_sync;
|
||
unsigned int InkOrSOLVEmptyCnt;
|
||
unsigned char EditMode; //
|
||
|
||
unsigned char updateSoftEN:1;
|
||
unsigned char adjHightVolInitEN:1;
|
||
unsigned char FileChangeRestCntFlag:1; // 更换文件,清除计数器
|
||
unsigned char HVFaultCloseEn:1;// 高压故障关回收槽
|
||
unsigned char ExtScreenEn; // 外接屏连接正常
|
||
unsigned char waitHightVolOff,waitHightVolOn; //
|
||
unsigned char addSpace;//sysPara->para.checkSpace
|
||
unsigned char autoCleanStatus; // clean status, 0: NONE,1: Step1 ...
|
||
unsigned int autoCleanTime; // clean time
|
||
|
||
unsigned int cnt1GroupCurrentLoop; //分段计米 计数器1当前第几次循环
|
||
unsigned int cnt2GroupCurrentLoop; //分段计米 计数器2当前第几次循环
|
||
unsigned char cnt1GroupRunningIndex; //分段计米 计数器1当前第几次段
|
||
unsigned char cnt2GroupRunningIndex; //分段计米 计数器2当前第几次段
|
||
unsigned int indoorTemperature; //开机记录喷头温度,作为是否调整粘度的根据
|
||
unsigned int needPowerOffTimerout;
|
||
unsigned char bLanConfigManual; //手动设定有线ip 地址
|
||
quint16 r_print_q;
|
||
quint8 col_state;
|
||
quint8 r_row_sequcence;
|
||
quint8 dot_num;
|
||
quint8 curr_index;
|
||
quint16 RowADC;
|
||
quint16 w_curr_DAC;
|
||
quint16 curr_DAC;
|
||
quint16 printed_column;
|
||
|
||
quint16 printed_adj_dac[40];
|
||
bool cnt3CurrentValueInitDoneFlag;
|
||
stru_counter3 Status_Counter3;
|
||
bool printDoneFlag;
|
||
bool oneCodePrintOnce;
|
||
bool forTemplateUse;
|
||
SpecialVarPrint specialVarPrint;
|
||
bool lastHighVoltageFault; //高压错误
|
||
bool circleProductCnt;
|
||
unsigned int printTotalColNum:16;
|
||
unsigned char pixNumPerCol;
|
||
unsigned short XXXDay;
|
||
int cnt4CurrValue;
|
||
bool flagOfAdjustWidth_1;
|
||
unsigned char splitMode_Adjust_1;
|
||
bool flagOfAdjustWidth_2;
|
||
unsigned char splitMode_Adjust_2;
|
||
//edit-12.2
|
||
bool flagOfNo67FPGA; //识别67版本,67版本使用4000列,其他版本使用8000列
|
||
short FPGAVersionType; //兼容旧的FPGA版本,0=新FPGA. 旧FPGA: 1=No66,2=No67,3=No72,4=No73 //VX4使用,VX5不需要
|
||
unsigned int textEditTotalCol;
|
||
quint16 gearspeed;
|
||
int sizeFPGA;
|
||
int sizeSTM32;
|
||
bool flagOfSpeedAlarm;
|
||
bool flagOfPressureFault;
|
||
int currVoltageVersion;
|
||
int lastVoltageVersion;
|
||
unsigned int stm32Verion;
|
||
bool stm32Time;
|
||
unsigned int machineMac;
|
||
int sizequeueFPGA;
|
||
bool flagOfRebootEnable;
|
||
bool logflag;
|
||
unsigned int TextInkDots;
|
||
bool flagOfSolventMaxNum;
|
||
bool flagOfInkMaxDot;
|
||
bool flagOfNeedInkCard;
|
||
bool flagOfNeedSolventCard;
|
||
bool flagOfKeyBoardType;
|
||
bool flagOfAbnormalStatus;//如果在打印过程中死机,重启后为异常状态
|
||
bool flagOfPowerOnMode;//0为正常开机,1为24小时自动开机
|
||
unsigned int waitPowerOffTime;
|
||
}sysStatus_t;
|
||
|
||
#include <stdint.h>
|
||
|
||
/* input registers */
|
||
typedef struct {
|
||
uint16_t printFinishFlag;//(0)
|
||
uint16_t orderCode;//顺序号(1)
|
||
|
||
uint8_t usedFileName[100];//(2-51)
|
||
uint16_t printStatus;// 1:正在打印, 2:暂停打印, 3:停止打印(52)
|
||
uint16_t statWarn;//(53)
|
||
calandar_and_dat_t curCalendarAndDate;//(54-79)
|
||
uint32_t mbCurrPrintRow;//(80-81)
|
||
uint32_t mbCurrPrintCol;//(82-83)
|
||
uint32_t productCnt; //产品计数器(84-85)
|
||
uint16_t receiveEnbleFlag;//(86)
|
||
}ModbusPrintStatus;
|
||
|
||
/* holding registers */
|
||
typedef struct {
|
||
uint8_t QRcode_buf[110]; //存二维码的buf(0-54)
|
||
uint16_t printCommand; // 1:开始打印, 2:暂停打印, 3:停止打印(55)
|
||
uint8_t selectFileName[100]; // 选择要打印的文件(56-105)
|
||
uint16_t faultRusume;//(106)
|
||
calandar_and_dat_t setCalendar;//(107-133)
|
||
uint32_t lineSpaceAndCharSpace; //高16作为行间距,低16位作为字符间距(134-135)
|
||
uint16_t clearProductCnt; //产品计数器(136)
|
||
uint16_t printContent;//2位数的打印内容(137)
|
||
}ModbusPrintParas;
|
||
|
||
|
||
/* net data */
|
||
typedef struct {
|
||
//get data
|
||
char PrintingContent[2048];
|
||
int ProductPlanQty;
|
||
char ProductUniqueCode[110];// 产品唯一编码
|
||
int ProductionTask;
|
||
char QRCodeContent[110];
|
||
int StartMetre;
|
||
bool TasdNeedConfirm;
|
||
int TaskSwitchingMode;
|
||
}JSON_DATA;
|
||
|
||
class SysPara{
|
||
//Q_OBJECT
|
||
public :
|
||
|
||
SysPara(void);
|
||
QString sysFile;
|
||
printPara_t print;
|
||
printPara_t printPre;
|
||
printPara_t printInit;
|
||
sysPara_t para;
|
||
voltePara_t voltePara;
|
||
voltePara_t_25Dots voltePara_25Dots;
|
||
voltePara_t_No73 voltePara_No73;
|
||
RFIDPara_t RFIDPara;
|
||
sysStatus_t status;
|
||
ModbusPrintStatus modbusStatus;
|
||
ModbusPrintParas modbusParas;
|
||
JSON_DATA Get_JSON_DATA;
|
||
DevOp *devOp; /*设备操作*/
|
||
void loadParaFromFile();
|
||
void saveParaToFile();
|
||
void loadDefaultPara();
|
||
void loadDefaultPrintPara();
|
||
void loadPrintParaFromFile(QString fileName);
|
||
void savePrintParaToFile();
|
||
void loadVolteParaFromFile(PRINT_MODE mode);
|
||
void saveRFIDPara();
|
||
bool loadRFIDPara();
|
||
void comparePrintStruct();
|
||
void loadParaToPrintInit();
|
||
void updatePrintInitToPara();
|
||
private:
|
||
|
||
};
|
||
|
||
#endif /* SYSPARA_H_ */
|