/* * DevOp.cpp * * Created on: Jun 25, 2013 * Author: yiyu * QQ:1036184468 * Descriptoin:设备操作模块,各种泵阀之类的操作都在此处 */ #include #include #include #include #include #include #include #include #include "LogInfo.h" #include #include "InputMethod.h" #include #include #include #include #include #include #ifndef Q_OS_WIN32 #include #include #else #define ioctl(a,...) (0 == 0) #endif #include #include #include #include #include #include #include "SysPara.h" #include #include "DevOp.h" #include "Public.h" #include "myinclude.h" #include "qnamespace.h" #define PRINT_CTRL_ADDR_BASE 0xa400 #define PRINT_DIGITAL_CHAR_BASE_ADDR (0xe000) #define WRITE_CALENDAR_DAT_ADDR (0xb100) #define RECYCLE_SLOT_STOP 0x1 #define RECYCLE_SLOT_CLOSE 0x2 #define RECYCLE_SLOT_OPEN 0x0 #define PRINT_START_STOP_CTRL (PRINT_CTRL_ADDR_BASE + 0x40) #define PRINT_RESET_PRODUCT_CNT (PRINT_CTRL_ADDR_BASE + 0x41) #define RECYCLE_SLOT_CTRL_ADDR (PRINT_CTRL_ADDR_BASE + 0x42) #define RESUME_FAULT_ADDR (PRINT_CTRL_ADDR_BASE + 0x43) #define VAR_CNT_ADDR (PRINT_CTRL_ADDR_BASE + 0x50) #define VAR_CTRL_REG_ADDR (PRINT_CTRL_ADDR_BASE + 0x51) #define MAININKCTRL_ADDR (PRINT_CTRL_ADDR_BASE + 0x59) //#define MAININKCTRL_ADDR (PRINT_CTRL_ADDR_BASE + 0x5a) #define WRITE_CNT1GROUP_COUNT 0xB13E #define WRITE_CNT1GROUP_NUM 0xB13F #define WRITE_CNT1GROUP_SETTING 0xB140 #define READ_CNT1GROUP_CURR_LOOP 0x0190 #define READ_CNT1GROUP_CURR_INDEX 0x0194 #define FPGA_STATUS_BASE_ADDR 0x0000 #define FPGA_VERSOIN_NUM (FPGA_STATUS_BASE_ADDR + 0xfe) #define READ_BUILD_DAT (FPGA_STATUS_BASE_ADDR + 0xf0) #define READ_PRINTDATA_XOR (FPGA_STATUS_BASE_ADDR + 0xf2) #define READ_SYNC_COUNTER (FPGA_STATUS_BASE_ADDR + 0xf4) #define PHASE_DETECT_HIGH_VOLTAGE_TM 0x100 #define READ_CALENDAR_DAT_ADDR 0x180 #define READ_RAND_FIFO_ADDR 0x200 // 读FPGA的随机码FIFO #define ROW_PRINT_SEQNENCE_ADDR 0xb200 //行扫描顺序 #define DAC_TABLE_ADDR 0xb280 //每一个行点对应的DAC值 #define NOT_GAP_DAC_TABLE_ADDR 0xb380 //每一个不隔点对应的DAC值 #define FULL_COL_DAC_TABLE_ADDR 0xb480 //每一个不隔点对应的DAC值 #define MATCH_FULL_DAC_TABLE_ADDR 0xB500 // 匹配满列 DAC表 起始地址 #define MATCH_1_DAC_TABLE_ADDR 0xB600 // 匹配单点 DAC表 起始地址 #define MATCH_2_DAC_TABLE_ADDR 0xB700 // 匹配两点 DAC表 起始地址 #define MATCH_3_DAC_TABLE_ADDR 0xB800 // 匹配三点 DAC表 起始地址 #define MATCH_4_DAC_TABLE_ADDR 0xB900 // 匹配四点 DAC表 起始地址 #define MATCH_5_DAC_TABLE_ADDR 0xBA00 // 匹配五点 DAC表 起始地址 #define MATCH_G1_DAC_TABLE_ADDR 0xBC00 // 匹配空一点 DAC表 起始地址 #define MATCH_G2_DAC_TABLE_ADDR 0xBC80 // 匹配空两点 DAC表 起始地址 #define MATCH_G3_DAC_TABLE_ADDR 0xBD00 // 匹配空三点 DAC表 起始地址 #define MATCH_G4_DAC_TABLE_ADDR 0xBD80 // 匹配空四点 DAC表 起始地址 #define MATCH_G5_DAC_TABLE_ADDR 0xBE00 // 匹配空五点 DAC表 起始地址 #define MATCH_G6_DAC_TABLE_ADDR 0xBE80 // 匹配空六点 DAC表 起始地址 #define MATCH_P1_DAC_TABLE_ADDR 0xBF00 // 匹配预备一 DAC表 起始地址 #define MATCH_P2_DAC_TABLE_ADDR 0xBF80 // 匹配预备二 DAC表 起始地址 #define MATCH_C_DAC_TABLE_ADDR 0xC000 // 匹配复杂 DAC表 起始地址 #define WRITE_COUNTER3_ADDR (0xb150) //#define READ_CNT3_CURVALUE_ADDR 0x01b4 #define READ_CNT3_CURVALUE_ADDR 0x1834 #define LOCADDR '1' // 传送打印内容的数据结构 // $D1rccccLLLLddd...ddco struct _DataFromPC { char keyword; // 特征字符 $ char fun; // 功能码,固定为"D", 表示传送打印点阵信息 char devAddr; // 默认01, (01~08) char printRowDotNum; // 信息点阵垂直有效行数5~40点 int printColDotNum; // 信息点阵水平有效列数8~3100列,均为8的整数倍值。 int Length; // (printRowDotNum* (1+printColDotNum/8)) + 1字节(检验码)+1字节(结束字符) char *dotData; // 按行列顺序排列的点阵数据,实际点阵数据总字节数为:printRowDotNum* printColDotNum/8 char crc; // 校验字节 char eoc; // 结束符,固定为小写字母'o' }dataFromPC,r_dataFromPC; struct _TextFromPC { char keyword; // 特征字符 ‘#’ char fun; // 功能码,固定为‘T’, 表示传送打印点阵信息 char devAddr; // 默认 1, (1~8) unsigned char Length; // Head(4) + 字串长度[32] + 1字节(检验码)+1字节(结束字符) char mStr[32]; // 定长,不足补 '\0' char crc; // 校验字节 char eoc; // 结束符,固定为小写字母'o' }TextFromPC,r_TextFromPC; // 38字节 // 传送参数和命令的数据结构 // &C14PPFco struct _ParaFromPC{ unsigned char keyword; // 特征字符 & unsigned char fun; // 功能码,固定为"C",表示传送参数或命令 unsigned char devAddr; // 默认01, (01~08) unsigned char Length; // 参数长度,从参数printCmd到 eoc 的总字节数 unsigned char printCmd; // "P"表示开始打印,"S"表示停止打印,"p"表示暂停打印, "O"表示不操作 unsigned char printMode; // "F" 正向打印,"R" 正向打印, "U" 上下颠倒打印,"T" 上下左右同时颠倒打印 // 还可以添加其它参数 unsigned char crc; // 校验字节 unsigned char eoc; // 结束符,固定为小写字母'o' }paraFromPC,r_paraFromPC; // &R14S?co 查询喷码机状态 // &R14D?co 查询打印内容点阵 // 查询喷码机状态的数据结构 /*所有警告都是高电平警告*/ struct _StatusToPC{ unsigned char keyword; // 特征字符 # unsigned char fun; // 功能码,固定为"S",表示传送喷码机状态数据 unsigned char devAddr; // 默认01, (01~08) unsigned char Length; // 参数长度,从参数printCmd到 eoc 的总字节数 unsigned char printCmd; // 打印操作当前状态, "P"表示正在打印,"S"表示停止打印,"p"表示暂停打印, "C"表示回收槽未开,"W"表示等待状态 unsigned char printMode; // 当前打印方向状态,其中:"F" 正向打印,"R" 正向打印, "U" 上下颠倒打印,"T" 上下左右同时颠倒打印 unsigned char statWarn:8; // {墨线开关,高压报警,回收故障,墨水液位,溶剂液位,墨水渗漏,喷头盖开,粘度故障} unsigned char isPumpValveControledByHand:1; // 手动控制阀泵标志,1手动,0自动 unsigned char mainInkPumpError:1; //主墨泵故障 unsigned char selfCheckDone:1; // 自检完成标志, 1完成,0没有完成 unsigned char reclainTankReachEnd:1; //回收槽打开完成标志 unsigned char beeperOnFlag:1; // 报警标志 有故障 unsigned char lostCommuFlag:1; //失去通信 unsigned char isPrinting:1; // 正在打印标志 unsigned char reclaimTankBlockedAppending:1; //回收槽被卡住 unsigned int selfCheckCnt; // 自检时间计数器,60s倒计时 unsigned int currReclaimTankPos; // 回收槽开位置 //unsigned char InkLineStaus; // 0 关,1-开ing,2--关ing,3-开完成 unsigned int productCnt; // 产品计数器 // 还可以添加一些其它状态 unsigned char crc; // 校验字节 unsigned char eoc; // 结束符,固定为小写字母'o' }statusToPC; // 不足4的倍数时,自动补足到4的倍数。 如statusToPC原本为 22字节,但实际的sizeof(statusToPC) = 24 // 传送当前打印内容点阵到PC的数据结构 struct _DataToPC { unsigned char keyword; // 特征字符 # unsigned char fun; // 功能码,固定为"D", 表示传送打印点阵信息 unsigned char devAddr; // 默认01, (01~08) unsigned char printRowDotNum; // 信息点阵垂直有效行数5~40点 unsigned int printColDotNum; // 信息点阵水平有效列数8~3100列,均为8的整数倍值。 unsigned int Length; // (printRowDotNum* (1+printColDotNum/8)) + 1字节(检验码)+1字节(结束字符) unsigned char *dotData; // 按行列顺序排列的点阵数据,实际点阵数据总字节数为:printRowDotNum* printColDotNum/8 unsigned char crc; // 校验字节 unsigned char eoc; // 结束符,固定为小写字母'o' }dataToPC; typedef struct adjlen_strut { unsigned char uint8varLenHeadEn:8; // 头部使能 unsigned int changeHeadlen:24; // 头部可变长的长度。实际长度 unsigned int headCounter:16; // 变量1起始值+这个数,执行可变长 unsigned int endCounter:16; // 变量1结束值-这个数,执行可变长 unsigned char uint8varLenEndEn:8; // 尾部使能 unsigned int changeEndlen:24; // 尾部可变长的长度。实际长度 // unsigned char uint8varLenEn; // unsigned int changelen:24; }Adjlen_strut; static unsigned short WireDim_mm=3745; void GetCRC(unsigned char *send_tab,unsigned int strlen,unsigned char *CRC_tab) //strlen为校验数组的长度,CRC_tab生成长度为的CRC数组低位在前 { unsigned int CRCfull=0xffff; unsigned char CRChigh=0xff; unsigned char CRClow=0xff; unsigned char CRCLSB; unsigned int i,j; for(i=0;i>1)&0x7fff); if(CRCLSB==1) { CRCfull=(unsigned int)(CRCfull^0xa001); } } } CRClow = (unsigned char)((CRCfull) & 0xff); CRChigh = (unsigned char)((CRCfull>>8) & 0xFF); CRC_tab[0]=CRClow; CRC_tab[1]=CRChigh; } unsigned char ValidCRC(unsigned char *send_tab,unsigned int strlen) //strlen为校验数组的长度,CRC_tab生成长度为的CRC数组低位在前 { unsigned int CRCfull=0xffff; unsigned char CRChigh=0xff; unsigned char CRClow=0xff; unsigned char CRCLSB; unsigned int i,j; if(strlen>=2) { for(i=0;i>1)&0x7fff); if(CRCLSB==1) { CRCfull=(unsigned int)(CRCfull^0xa001); } } } CRClow = (unsigned char)((CRCfull) & 0xff); CRChigh = (unsigned char)((CRCfull>>8) & 0xFF); if((send_tab[strlen-2]==CRClow)&&(send_tab[strlen-1]==CRChigh)) return 1; else return 0; } else return 0; } int DevOp::BigDisp(unsigned char Module[],unsigned char Wirediameter[]) { int Len=23; int i; unsigned char CrcBuf[2]; unsigned char SendBuf[]={ 0x01,0x10, 0x00,0x00,0x00,0x07,//7 0x0e,//14 0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x30,0x31,0x32,//10 0x00,0x00,0x00,0x01, 0,0}; for(i=0;i<10;i++) SendBuf[7+i]=Module[i]; for(i=0;i<4;i++) SendBuf[17+i]=Wirediameter[i]; GetCRC(SendBuf ,7+ SendBuf[6], CrcBuf);// SendBuf[Len-2] = CrcBuf[0]; SendBuf[Len-1] = CrcBuf[1]; #ifdef UART2 sendCom((char*)SendBuf,Len); #endif //showData( QByteArray((char *)SendBuf,Len)); //01 10 00 00 00 07 0E 63 64 65 77 73 61 20 20 20 20 0E A1 00 00 74 D0 } int DevOp::SmallDisp(unsigned char Module[],unsigned char Wirediameter[]) { int Len=21; int i=0; unsigned char CrcBuf[2]; unsigned char SendBuf[]={ 0x01,0x10,//2 0x00,0x00,0x00,0x06,//4 0x0c,//1 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,//10 0x00,0x00,//0x00,0x01, 0,0}; for(i=0;i<10;i++) SendBuf[7+i]=Module[i]; for(i=0;i<2;i++) SendBuf[17+i]=Wirediameter[i]; GetCRC(SendBuf ,7+ SendBuf[6], CrcBuf);// SendBuf[Len-2] = CrcBuf[0]; SendBuf[Len-1] = CrcBuf[1]; #ifdef UART2 sendCom((char*)SendBuf,Len); #endif //showData( QByteArray((char *)SendBuf,Len)); } int DevOp::RecDim() { unsigned char CrcBuf[2]; unsigned char SendBuf[]={ 0x02,0x03, 0x00,0x61,0x00,0x01, 0,0}; GetCRC(SendBuf ,6, CrcBuf);// SendBuf[6] = CrcBuf[0]; SendBuf[7] = CrcBuf[1]; #ifdef UART2 if(myCom==0) uart2Init(); sendCom((char *)SendBuf,8); #endif //showData( QByteArray((char *)SendBuf,Len)); } /* "02 03 00 61 00 01 D5 E7 " "01 10 00 00 00 07 0E 42 41 44 43 45 46 47 30 31 32 00 00 00 01 90 4E " "02 03 00 61 00 01 D5 E7 " "01 10 00 00 00 06 0C 42 41 44 43 45 46 47 30 31 32 00 12 46 A6 " 02 03 02 23 83 A4 D5 // 02 03 02 00 00 FC 44 02 03 02 0B C0 FB 24 02 03 02 27 11 27 B8 02 03 02 0D E3 B9 5D 02 03 02 0D FC F8 95 02 03 02 07 E2 7E 3D 02 03 02 00 00 FC 44 02 03 02 00 00 FC 44 02 03 02 35 9C EB 7D 02 03 02 0B A4 FA CF 02 03 02 15 B4 F2 A3 02 03 02 25 0B A7 13 // 3.745 02 03 02 0E 9B B9 8F 02 03 02 0E 9B B9 8F 02 03 02 0E A1 39 9C 02 03 02 0E B3 B9 91 02 03 02 0E B8 F8 56 01 10 00 00 00 06 0C 42 41 44 43 45 46 47 30 31 32 0E B8 C2 B9 */ void DevOp::DatToDisp(char FileName[], bool big ) { unsigned char cc[4]={0x00,0x00,0x00,0x00}; RecDim(); if(big){ unsigned short m= WireDim_mm; cc[0]=(m>>8) & 0xff; cc[1]=(m) & 0xff; cc[2]=(m>>8) & 0xff; cc[3]=(m) & 0xff; BigDisp((unsigned char *)FileName,cc); } else { unsigned short m= WireDim_mm/10; cc[0]=(m>>8) & 0xff; cc[1]=(m) & 0xff; SmallDisp((unsigned char *)FileName,cc); } } void DevOp::DatToDisp2() { //(char *)(QFileInfo(sysPara->para.lastOpenedFileName).baseName().toAscii().data()); QString FileName=QFileInfo(sysPara->para.lastOpenedFileName).fileName(); unsigned char cc[4]={0x00,0x00,0x00,0x00}; unsigned char buf[30]={0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20};//10 //RecDim(); char big =sysPara->para.ExtScreenType; int len=FileName.length(),n; //n=len; while(len) { len--; if(FileName.at(len)=='.') break; } //qDebug()<<"send to Ping"<< (unsigned char)big; if(big<1) return; //无外接屏时 WdgttyUsb0Cnt++; if(WdgttyUsb0Cnt>2){ WdgttyUsb0Cnt=0;//myCom=0; uart2Init(); } //qDebug()<<"WdgttyUsb0Cnt"<para.ExtMeterType==0) m=sysPara->status.productCnt;//总米数 else if(sysPara->para.ExtMeterType==1)m=QString::number(sysPara->status.calandar_and_dat.cnt1CurrValue,16).toInt(); else m= QString::number(sysPara->status.calandar_and_dat.cnt2CurrValue,16).toInt(); cc[0]=(m>>23) & 0xff; cc[1]=(m>>16) & 0xff; cc[2]=(m>>8) & 0xff; cc[3]=(m) & 0xff; BigDisp((unsigned char *)buf,cc); } else if(big==1) { unsigned short m= WireDim_mm/10; cc[0]=(m>>8) & 0xff; cc[1]=(m) & 0xff; SmallDisp((unsigned char *)buf,cc); } } void DevOp::uart2Init() { //#ifdef ARMUART // myCom = new Posix_QextSerialPort("/dev/ttySAC1",QextSerialBase::Polling); //#else static int mm=0; #ifdef UART2 qDebug()<< "UART2 "<isOpen())myCom->close(); if(myCom==0) { myCom = new Posix_QextSerialPort("/dev/ttyUSB0",QextSerialBase::Polling); if(myCom==0) myCom = new Posix_QextSerialPort("/dev/ttyUSB1",QextSerialBase::Polling); } //#endif if(myCom->isOpen()) myCom->close(); myCom ->open(QIODevice::ReadWrite); if (!myCom->isOpen()) { qDebug()<<"Uart2 is not open!"; //sysPara->status.ExtScreenEn=0; return; } sysPara->status.ExtScreenEn=1; myCom->setBaudRate(BAUD9600); myCom->setDataBits(DATA_8); myCom->setParity(PAR_NONE); myCom->setStopBits(STOP_1); myCom->setFlowControl(FLOW_OFF); myCom->setTimeout(1); //uartThreadStart(); sendCom("Uart Init ok."); //qDebug()<status.ExtScreenEn; #endif } DevOp::DevOp(SysPara * sysPara) { this->sysPara = sysPara; #ifndef Q_OS_WIN32 int fp; char *pPwmMode; #ifdef UART1 uartThread = NULL; // 线程初始化 #ifdef ARMUART //fp = open("/dev/tty1",O_RDONLY); // 改变console //ioctl(fp,TIOCCONS); //TIOCCONS 的作用是使成为虚拟控制台 //close(fp); myCom = new Posix_QextSerialPort("/dev/ttySAC0",QextSerialBase::Polling); #else printf("change1\n"); fp = open("/dev/tty1",O_RDONLY); // 改变console ioctl(fp,TIOCCONS); //TIOCCONS 的作用是使成为虚拟控制台 close(fp); //myCom = new Posix_QextSerialPort("/dev/ttyS0",QextSerialBase::Polling); // myCom = new Posix_QextSerialPort("/dev/ttyUSB0",QextSerialBase::Polling); myCom = new Posix_QextSerialPort("/dev/ttyS1",QextSerialBase::Polling); #endif data.clear(); byteArray.clear(); rec_cmd.mode=0; myCom ->open(QIODevice::ReadWrite); if (!myCom->isOpen()) qDebug()<<"Uart1 is not open!"; myCom->setBaudRate(BAUD115200); myCom->setDataBits(DATA_8); myCom->setParity(PAR_NONE); myCom->setStopBits(STOP_1); myCom->setFlowControl(FLOW_OFF); myCom->setTimeout(30); //uartThreadStart(); sendingEnable = true; sendCom("The Printer Uart1 is Ok."); //qDebug()<<("change TO TTY1.\n"); //system("echo '123'>ttyS0"); //qDebug()<<("change2\n"); #endif #ifdef DEBUG_CNT //qDebug()<<"QT_MAJOR_VERSION"<20) OscillatorVoltage[i] = 68+i-50; else if(i>11) { OscillatorVoltage[i] = 15+2*(i-10); } else { OscillatorVoltage[i]=11; } } OscillatorVoltage[0]=0; #endif if(!sysPara){ QMessageBox::critical(0,"错误","DevOp构造函数的sysParam不能为空"); //设个陷阱,防止误操作 } } void DevOp::TTYS0ToConsole(void) { int fp; #ifdef UART1 if(myCom->isOpen()) myCom->close(); fp = open("/dev/tty0",O_RDONLY); //恢复console 到串口0 ioctl(fp,TIOCCONS); close(fp); //qDebug()<<"ttyS0 to Console."; #endif #ifdef UART2 #else fp = open("/dev/tty0",O_RDONLY); //恢复console 到串口0 ioctl(fp,TIOCCONS); close(fp); #endif } DevOp::~DevOp(){ #ifdef UART2 if(myCom->isOpen()) myCom->close(); #endif if(DAdataout >= 0) close(DAdataout); #ifdef UART1 if(myCom->isOpen()) myCom->close(); #endif if(pwm_sp >= 0) close(pwm_sp); if(pwm_fd >= 0) close(pwm_fd); if(Interrupt_fd >= 0) close(Interrupt_fd); if(iocontrl >= 0) close(iocontrl); if(adc_fd >= 0) close(adc_fd); for(int i = 0; i < MAX_VARI_NUM; i++){ vars_t *p_var = &sysPara->status.vars[i]; if(p_var->original){ if(p_var->dat) free(p_var->dat); } } if(myCom) { delete(myCom); } #ifdef __STC_POWER__ if(comForPower) { comForPower->close(); delete(comForPower); } #endif //TTYS0ToConsole(); } //QFile PrintDatafile("/home/plg/doc/printData.txt"); void DevOp::fpgaWr(int addr,unsigned char*dat,int len){ #ifdef DEBUG_CNT #else /* for(int i = addr;i < addr + len ; i++){ memWrMap[i%MAX_WR_MEM_SIZE] = dat[i - addr]; } */ if(DAdataout < 0) return; lseek(DAdataout, addr, SEEK_SET); write(DAdataout, dat, len); #endif #if 0 { QString strtmp = "Addr:<" + QString::number(addr,16) + ">Data:"; //PrintDatafile.seek(0); //file.write((char *)&jd.addr,(long long int)sizeof(jd)); PrintDatafile.write(strtmp.toStdString().c_str()); //PrintDatafile.write((char *)dat,(qint64)len); strtmp = ""; QString strTxt; for(int i =0; i 4){ DisErrorMsg(); return 0; } fpgaRd(addr, (unsigned char *)&data, len); return data; } void DevOp::controlReleaseValve(bool openFlag){ ioctl(iocontrl, openFlag, 7); releaseValveOpenFlag = openFlag; pumpValveCtrl(); } void DevOp::controlMixValve(bool openFlag){ ioctl(iocontrl, openFlag, 6); mixValveFlag = openFlag; pumpValveCtrl(); } void DevOp::controlInkValve(bool openFlag){ ioctl(iocontrl, openFlag, 4); inkValveOpenFlag = openFlag; pumpValveCtrl(); } void DevOp::controlCycleValve(bool openFlag){ ioctl(iocontrl, openFlag, 5); cycleValveOpenFlag = openFlag; pumpValveCtrl(); } void DevOp::controlCompressPump(bool openFlag){ ioctl(iocontrl, !openFlag, 1); compressPumpOpenFlag = openFlag; pumpValveCtrl(); } #define PWM_IOCTL_SET_FREQ 1 // PWM输出 #define PWM_IOCTL_STOP 0 //设置为低电平输出 #define PWM_IOCTL_HIGH 2 // 设置为高电平输出 #define PWM_IOCTL_SET_WIDE 3 //#define FRE_SP 12000 #define FRE_SP 13760 void DevOp::controlViscosityPump(bool openFlag){ viscosityPumpOpenFlag = openFlag; pumpValveCtrl(); if(openFlag){ if(pwm_fd == -1) pwm_fd = open("/dev/pwm", 0 |O_NONBLOCK); ioctl(pwm_fd, PWM_IOCTL_SET_FREQ,50);//50 #ifdef __VX__ ioctl(pwm_fd, PWM_IOCTL_SET_WIDE,0); #else ioctl(pwm_fd, PWM_IOCTL_SET_WIDE,50); #endif //(sysPara->para.vicosityPumpType)?50:1); //50hz } else { if(pwm_fd != -1){ ioctl(pwm_fd, PWM_IOCTL_HIGH); close(pwm_fd); pwm_fd = -1; } } //qDebug()<<"pwm_fd"<para.reclaimPumpPWMWidth?sysPara->para.reclaimPumpPWMWidth:90)); } else{ //ioctl(iocontrl, 0, 2); ioctl(pwm_sp, PWM_IOCTL_STOP); //PWM_IOCTL_STOP= 2 } reclaimPumpOpenFlag = openFlag; pumpValveCtrl(); } void DevOp::controlHeater(bool openFlag){ ioctl(iocontrl, !openFlag, 11); heaterOnFlag = openFlag; pumpValveCtrl(); } void DevOp::controlBeeper(bool openFlag){ ioctl(iocontrl, !openFlag, 9); beeperOnFlag = openFlag; } void DevOp::controlRedLight(bool openFlag){ //2013-12-11 红绿黄报警灯 ioctl(iocontrl, openFlag, 12); RedLightOnFlag = openFlag; } void DevOp::controlGreenLight(bool openFlag){ ioctl(iocontrl, openFlag, 13); GreenLightOnFlag = openFlag; } void DevOp::controlYellowLight(bool openFlag){ ioctl(iocontrl, openFlag, 14); YellowLightOnFlag = openFlag; } void DevOp::controlFan1(bool openFlag) { ioctl(iocontrl, openFlag, 15); sysPara->status.flagOfStirrer = openFlag; } void DevOp::controlFan2(bool openFlag) { ioctl(iocontrl, openFlag, 16); } void DevOp::powerOff(void){ ioctl(iocontrl, 0, 0); } void DevOp::controlReclaimTankOpen(bool enableFlag){ if(enableFlag) fpgaWrD(RECYCLE_SLOT_CTRL_ADDR,RECYCLE_SLOT_OPEN,1); else fpgaWrD(RECYCLE_SLOT_CTRL_ADDR,RECYCLE_SLOT_STOP,1); reclaimTankCloseEnableFlag = false; reclaimTankOpenEnableFlag = enableFlag; } void DevOp::controlReclaimTankClose(bool enableFlag){ if(enableFlag) fpgaWrD(RECYCLE_SLOT_CTRL_ADDR,RECYCLE_SLOT_CLOSE,1); else fpgaWrD(RECYCLE_SLOT_CTRL_ADDR,RECYCLE_SLOT_STOP,1); reclaimTankOpenEnableFlag = false; reclaimTankCloseEnableFlag = enableFlag; } bool DevOp::isReleaseValveOpen(){ return releaseValveOpenFlag; } bool DevOp::isMixValveOpen(){ return mixValveFlag; } bool DevOp::isInkValveOpen(){ return inkValveOpenFlag; } bool DevOp::isCycleValveOpen(){ return cycleValveOpenFlag; } bool DevOp::isCompressPumpOpen(){ return compressPumpOpenFlag; } bool DevOp::isViscosityPumpOpen(){ return viscosityPumpOpenFlag; } bool DevOp::isMainInkPumpOpen(){ return mainInkPumpOpenFlag; } bool DevOp::isReclaimPumpOpen(){ return reclaimPumpOpenFlag; } bool DevOp::isReclaimTankOpenEnable(){ return reclaimTankOpenEnableFlag; } bool DevOp::isReclaimTankCloseEnable(){ return reclaimTankCloseEnableFlag; } bool DevOp::isBeeperEnable(){ return beeperOnFlag; } bool DevOp::isRedLightEnable(){ //2013-12-11 红绿黄报警灯 return RedLightOnFlag; } bool DevOp::isGreenLightEnable(){ return GreenLightOnFlag; } bool DevOp::isYellowLightEnable(){ return YellowLightOnFlag; } bool DevOp::isHearterEnable(){ return heaterOnFlag; } void DevOp::readFgaStatus(){ fpgaRd(FPGA_STATUS_BASE_ADDR,(unsigned char *)&sysPara->status,FPGA_STATUS_BYTE_NUM); } void DevOp::checkAuthorization(QString str){ fpgaWr(0xA800,(unsigned char *) str.toStdString().c_str(),str.length()); } void DevOp::set_totalSynPulseNum(bool wren) { short adjLen=0; // unsigned int temp; // unsigned char uint8varLenEn; Adjlen_strut adjlen_strut; int val = QString::number(sysPara->status.calandar_and_dat.cnt1CurrValue,16).toInt(); if(sysPara==0)return; if(sysPara->para.varLenEn) { #ifdef __VX_OSC_VOL__ adjLen = sysPara->para.varLen; adjlen_strut.changeHeadlen = (int )( (sysPara->para.synTriggerPrintLenMm+adjLen) *sysPara->para.synPulseNumPerMm); //adjlen_strut.headCounter = sysPara->para.headLen?sysPara->para.headLen:0; adjlen_strut.headCounter = QString::number(sysPara->para.cnt1StartValue + sysPara->para.headLen).toUInt(0,16);//vx版本 adjlen_strut.uint8varLenHeadEn = sysPara->para.headLen?1:0; adjLen = sysPara->para.varLen1; adjlen_strut.changeEndlen = (int )( (sysPara->para.synTriggerPrintLenMm+adjLen) *sysPara->para.synPulseNumPerMm); //adjlen_strut.endCounter = sysPara->para.endLen?sysPara->para.endLen:0; adjlen_strut.endCounter = QString::number(sysPara->para.cnt1EndValue - sysPara->para.endLen).toUInt(0,16); adjlen_strut.uint8varLenEndEn = sysPara->para.endLen?1:0; #else adjLen = sysPara->para.varLen; adjlen_strut.changeHeadlen = (int )( (sysPara->para.synTriggerPrintLenMm+adjLen) *sysPara->para.synPulseNumPerMm); adjlen_strut.headCounter = sysPara->para.headLen?sysPara->para.headLen:0; adjlen_strut.uint8varLenHeadEn = sysPara->para.headLen?1:0; adjLen = sysPara->para.varLen1; adjlen_strut.changeEndlen = (int )( (sysPara->para.synTriggerPrintLenMm+adjLen) *sysPara->para.synPulseNumPerMm); adjlen_strut.endCounter = sysPara->para.endLen?sysPara->para.endLen:0; adjlen_strut.uint8varLenEndEn = sysPara->para.endLen?1:0; #endif // qDebug()<< "uint8varLenHeadEn"<para.printTriggerMode == PRINT_TRIGGER_SYNCHRONIZER)) { sysPara->para.totalSynPulseNum = (int )((sysPara->para.synTriggerPrintLenMm)*sysPara->para.synPulseNumPerMm); } else if(((sysPara->para.printTriggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL ||sysPara->para.printTriggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE) && sysPara->para.eleEyeTriggerSynPrintEn)) { sysPara->para.totalSynPulseNum = (int )((sysPara->para.elecEyeTriggerInterval)*sysPara->para.synPulseNumPerMm); } // if(sysPara->para.varLenEn == 0){ // adjlen_strut.uint8varLenEn = 0; // }else // { // adjlen_strut.uint8varLenEn = 1; // } LogInfo::setRunStatusText(QString("a400: %1").arg(sysPara->para.printTotalColNum)); fpgaWr(PRINT_CTRL_ADDR_BASE, (unsigned char *)&sysPara->para, 0x14); fpgaWr(PRINT_CTRL_ADDR_BASE + 0x76, (unsigned char *)&adjlen_strut, sizeof(Adjlen_strut)); // } // qDebug()<<"adjlen_strut.changelen = "<para.varLen1="<para.varLen1; // qDebug()<<"sysPara->para.varLenEn="<para.varLenEn; // qDebug()<<"synTriggerPrintLenMm:"<para.synTriggerPrintLenMm; // qDebug()<<"synPulseNumPerMm:"<para.synPulseNumPerMm; // qDebug()<<"adjLen"<para.totalSynPulseNum; #ifdef DEBUG_CNT qDebug()<<"adjLen"<para.totalSynPulseNum; #endif } unsigned short short2BCD(unsigned short value) { unsigned short bcd = 0; bcd = (value/1000)*4096 + ((value%1000)/100)*256 + ((value%100)/10)*16 + value%10; return bcd; } int DevOp::writeFpgaPrintPara(bool ignoreWarn){ #ifdef SYS_LINUX unsigned int type = sysPara->status.fpgaVersionNum >> 12; if((sysPara->para.currPrintMode == FAST_PRINT) && !sysPara->para.charWidthSetEnable || sysPara->status.build_dat.builTime == 73 || type == 6) sysPara->loadVolteParaFromFile((PRINT_MODE)sysPara->para.currPrintMode); int currPrintCol = sysPara->status.currPrintCol + BLANK_COL_NUM; sysPara->para.printRowDelay = sysPara->para.currPrintMode; sysPara->para.pixNumPerCol = sysPara->status.currPrintRow; sysPara->para.reducedPixelNum = sysPara->para.reducedPixelNumRatio*sysPara->para.pixNumPerCol/100; sysPara->para.printDirection = (sysPara->para.upDownInverse?1:0) + ((sysPara->para.leftRightInverse?1:0)<<1) + ((sysPara->para.scanInverse?1:0)<<2); sysPara->para.dotNumPerCol = (sysPara->para.pixNumPerCol- sysPara->para.lineEndAdjustPointCnt)*(sysPara->para.printRowDelay + 1) + (sysPara->para.lineEndAdjustPointCnt)*(sysPara->para.lineEndAdjustPointDelay + 1); sysPara->para.dotNumPerCol = sysPara->para.pixNumPerCol? ((sysPara->para.dotNumPerCol*(sysPara->para.pixNumPerCol - sysPara->para.reducedPixelNum))/sysPara->para.pixNumPerCol):1; sysPara->para.dotNumPerCol += sysPara->para.printColDelay; sysPara->para.dotNumPerCol =( sysPara->para.alterPrint.enable)? sysPara->para.dotNumPerCol/2:sysPara->para.dotNumPerCol; sysPara->para.lastLineEndPointFixedDACValue = sysPara->para.lastLineEndPointFixedValue * MAX_FPGA_DAC_VALUE/ 1000; sysPara->para.productNumToGenerateOutputPulse = sysPara->para.pulseOutputEnable?sysPara->para.productCntPerOutputPulse:0; sysPara->para.FullColFixDacVal = sysPara->para.FullColFixVal ; // NC qDebug()<<"dotNumPerCol"<para.dotNumPerCol; if(sysPara->para.pixNumPerCol - sysPara->para.reducedPixelNum < 2 && sysPara->para.pixNumPerCol > 4){ if(!ignoreWarn){ QMessageBox::warning(0,tr("警告"),QString("当前行数:%1 冗点数:%2,冗点数过多,请修改您的配置!!").arg(sysPara->para.pixNumPerCol).arg(sysPara->para.reducedPixelNum)); } } int DACStep = (sysPara->status.currPrintRow && sysPara->status.currAlterPrintRow > 0)? (sysPara->para.endVoltage - sysPara->para.startVoltage) * MAX_FPGA_DAC_VALUE/(100 * ((sysPara->para.alterPrint.enable)?sysPara->status.currAlterPrintRow :sysPara->status.currPrintRow)) :0; int steal_dac_step = sysPara->status.currPrintRow > 3? (sysPara->para.endVoltage - sysPara->para.startVoltage) * MAX_FPGA_DAC_VALUE/(100 * ((sysPara->para.alterPrint.enable)?sysPara->status.currAlterPrintRow-1:sysPara->status.currPrintRow-1)) :0; sysPara->para.steal_dac_row = steal_dac_step; int printVerticalButtom = sysPara->para.startVoltage * MAX_FPGA_DAC_VALUE/100; int printVerticalTop = sysPara->para.endVoltage * MAX_FPGA_DAC_VALUE/100; int pointAdjustVoltagePos = sysPara->para.pointVoltageAdjustPos * MAX_FPGA_DAC_VALUE/100; //点距电压调整位置 /*---------------------------------------------------------------------------------*/ #if 1 /*---------------------------------------------------------------------------------*/ // 将 满列/单点/两点/三点/四点表格 电压值 转换成 DAC(12位)值 // unsigned int pixel_full_table[32] = { // 满点电压表 // 60, 70, 79, 88, 96, 104, 112, 120, // 128, 136, 144, 152, 159, 166, 173, 180, // 187, 194, 201, 208, 215, 222, 229, 236, // 245, 250, 257, 264, 271, 277, 283, 289 // }; unsigned int pixel_1_table_64k[32] = { // 单点电压表 682, 745, 849, 941, 1051, 1146, 1242, 1337, 1433, 1528, 1624, 1719, 1815, 1911, 1992, 2088, 2184, 2279, 2375, 2457, 2538, 2620, 2702, 2784, 2866, 2948, 3030, 3112, 3194, 3276, 3357, 3439 }; #if 1 unsigned int fast_pixel_1_table_96k[32] = { // 单点电压表 950, 1200, 1550, 1780, 2000, 2180, 2330, 2280, 2450, 2620, 2730, 2870, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; #endif // unsigned int fast_pixel_1_table_96k[32] = { // 单点电压表 // 950, 1150, 1400, 1560, 1680, 1810, 1900, 0, // 0, 0, 0, 0, 0, 0, 0, 0, // 0, 0, 0, 0, 0, 0, 0, 0, // 0, 0, 0, 0, 0, 0, 0, 0 // }; unsigned int normal_pixel_1_table_128k[32] = { // 单点电压表 950, 1200, 1550, 1780, 2000, 2180, 2330, 2280, 2450, 2620, 2730, 2870, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; // unsigned int pixel_2_table[32][2] = { // 两点电压表 // { 60, 69 }, { 67, 76 }, { 74, 83 }, { 81, 90 }, { 88, 97 }, { 95, 104 }, { 102, 112 }, { 109, 119 }, // { 116, 126 }, { 123, 133 }, { 130, 140 }, { 137, 147 }, { 144, 154 }, { 151, 161 }, { 158, 168 }, { 165, 175 }, // { 172, 182 }, { 179, 189 }, { 186, 196 }, { 193, 203 }, { 200, 210 }, { 207, 217 }, { 214, 224 }, { 221, 231 }, // { 228, 238 }, { 235, 245 }, { 242, 252 }, { 249, 259 }, { 256, 266 }, { 263, 273 }, { 270, 280 }, { 277, 287 } // }; // unsigned int pixel_3_table[32][3] = { // 三点电压表 // { 60, 69, 76 }, { 67, 76, 83 }, { 74, 83, 90 }, { 81, 90, 97 }, // { 88, 97, 104 }, { 95, 104, 112 }, { 102, 112, 120 }, { 109, 119, 127 }, // { 116, 126, 134 }, { 123, 134, 142 }, { 130, 141, 149 }, { 137, 148, 156 }, // { 144, 156, 163 }, { 151, 163, 170 }, { 158, 170, 177 }, { 165, 177, 184 }, // { 172, 184, 191 }, { 179, 191, 197 }, { 186, 198, 205 }, { 193, 205, 212 }, // { 200, 212, 219 }, { 207, 219, 226 }, { 214, 226, 233 }, { 221, 233, 240 }, // { 228, 240, 247 }, { 235, 247, 254 }, { 242, 254, 261 }, { 249, 261, 268 }, // { 256, 268, 275 }, { 263, 275, 282 }, { 270, 282, 289 }, { 277, 289, 296 } // }; // unsigned int pixel_4_table[32][4] = { // 四点电压表 // { 60, 69, 76, 83 }, { 67, 76, 83, 90 }, { 74, 83, 90, 97 }, { 81, 90, 97, 104 }, // { 88, 97, 104, 112 }, { 95, 104, 112, 120 }, { 102, 112, 120, 127 }, { 109, 119, 127, 134 }, // { 116, 126, 134, 142 }, { 123, 134, 142, 149 }, { 130, 141, 149, 156 }, { 137, 148, 156, 163 }, // { 144, 156, 163, 170 }, { 151, 163, 170, 177 }, { 158, 170, 177, 184 }, { 165, 177, 184, 191 }, // { 172, 184, 191, 197 }, { 179, 191, 197, 205 }, { 186, 198, 205, 212 }, { 193, 205, 212, 219 }, // { 200, 212, 219, 226 }, { 207, 219, 226, 233 }, { 214, 226, 233, 240 }, { 221, 233, 240, 247 }, // { 228, 240, 247, 254 }, { 235, 247, 254, 261 }, { 242, 254, 261, 268 }, { 249, 261, 268, 275 }, // { 256, 268, 275, 282 }, { 263, 275, 282, 289 }, { 270, 282, 289, 296 }, { 277, 289, 296, 303 } // }; //#define DAC_RADIO (((float)sysPara->para.dacScale)/100) // 1V 对应的DAC,看起来13.05比较接近 //整体阶梯缩放算法:比如缩放比例为80%,一列4个点最后一个点的比例为80%,阶梯为5%(100-80)/4=5,倒数第二个刚是75%,依此类推。 //#define DAC_RADIO2 (nCurrPrintRow > 1 ? (((float)(100-((100-sysPara->para.dacScale)/((nCurrPrintRow-1)>0?(nCurrPrintRow-1):1)*i)))/100) : 13.05) int nCurrPrintRow = sysPara->status.currPrintRow; qint16 matchFullDACArray[40]; qint16 matchOneDACArray[40]; qint16 matchTwoDACArray[40][2]; qint16 matchThreeDACArray[40][3]; qint16 matchFourDACArray[40][4]; qint16 matchFiveDACArray[40][5]; qint16 matchGapDACArray[48][5]; qint16 matchPreDACArray[16][5]; qint16 matchComplexDACArray[32][4]; qint16 matchOneDACArrayStandard[32]; memset(matchFullDACArray, 0, sizeof(matchFullDACArray)); memset(matchOneDACArray, 0, sizeof(matchOneDACArray)); memset(matchTwoDACArray, 0, sizeof(matchTwoDACArray)); memset(matchThreeDACArray, 0, sizeof(matchThreeDACArray)); memset(matchFourDACArray, 0, sizeof(matchFourDACArray)); memset(matchFiveDACArray, 0, sizeof(matchFiveDACArray)); memset(matchGapDACArray, 0, sizeof(matchGapDACArray)); memset(matchPreDACArray, 0, sizeof(matchPreDACArray)); memset(matchComplexDACArray, 0, sizeof(matchComplexDACArray)); memset(matchOneDACArrayStandard, 0, sizeof(matchOneDACArrayStandard)); if((sysPara->para.currPrintMode == FAST_PRINT) && !sysPara->para.charWidthSetEnable){ for (int i = 0; i < 40; i++) { matchFullDACArray[i] = sysPara->voltePara.pixel_full_table[i] ; } for (int i = 0; i < 40; i++) { matchOneDACArray[i] = sysPara->voltePara.pixel_1_table[i] ; } for (int i = 0; i < 40; i++) { for (int j = 0; j < 2; j++) { matchTwoDACArray[i][j] = sysPara->voltePara.pixel_2_table[i][j] ; } } for (int i = 0; i < 40; i++) { for (int j = 0; j < 3; j++) { matchThreeDACArray[i][j] = sysPara->voltePara.pixel_3_table[i][j] ; } } for (int i = 0; i < 40; i++) { for (int j = 0; j < 4; j++) { matchFourDACArray[i][j] = sysPara->voltePara.pixel_4_table[i][j] ; } } for (int i = 0; i < 40; i++) { for (int j = 0; j < 5; j++) { matchFiveDACArray[i][j] = sysPara->voltePara.pixel_5_table[i][j] ; } } for (int i = 0; i < 48; i++) { for (int j = 0; j < 5; j++) { matchGapDACArray[i][j] = sysPara->voltePara.pixel_gap_table[i][j] ; } } for (int i = 0; i < 16; i++) { for (int j = 0; j < 5; j++) { matchPreDACArray[i][j] = sysPara->voltePara.pixel_pre_table[i][j] ; } } for (int i = 0; i < 32; i++) { for (int j = 0; j < 4; j++) { matchComplexDACArray[i][j] = sysPara->voltePara.pixel_c_table[i][j] ; } } for (int i = 0; i < 16; i++) { sysPara->voltePara.pixel_para_table[i] = 0; } } else{ #if 1 if (sysPara->para.oscillatoFreq == 0) { // 64K for (int i = 0; i < 32; i++) { matchOneDACArrayStandard[i] = pixel_1_table_64k[i] ; } } else if (sysPara->para.oscillatoFreq == 2) { // 96K if(sysPara->para.printRowDelay == 0) { for (int i = 0; i < 32; i++) { matchOneDACArrayStandard[i] = fast_pixel_1_table_96k[i] ; } } else if(sysPara->para.printRowDelay == 1) { for (int i = 0; i < 32; i++) { matchOneDACArrayStandard[i] = fast_pixel_1_table_96k[i] ; } } } else if (sysPara->para.oscillatoFreq == 3) { // 128k for (int i = 0; i < 32; i++) { matchOneDACArrayStandard[i] = normal_pixel_1_table_128k[i] ; } } #endif } // for (int i = 0; i < 32; i++) // { // for (int j = 0; j < 2; j++) // { // matchTwoDACArray[i][j] = pixel_2_table[i][j] *DAC_RADIO2; // } // } // for (int i = 0; i < 32; i++) // { // for (int j = 0; j < 3; j++) // { // matchThreeDACArray[i][j] = pixel_3_table[i][j] *DAC_RADIO2; // } // } // for (int i = 0; i < 32; i++) // { // for (int j = 0; j < 4; j++) // { // matchFourDACArray[i][j] = pixel_4_table[i][j] *DAC_RADIO2; // } // } // 将 满列/单点/两点/三点/四点表格 电压值 转换成 DAC(12位)值 /*---------------------------------------------------------------------------------*/ #endif unsigned short DACArray[64]; memset(DACArray,0,sizeof(DACArray)); quint16 notGapDACArray[64]; quint16 fullColDACArray[64]; memset(notGapDACArray,0,sizeof(notGapDACArray)); memset(fullColDACArray,0,sizeof(fullColDACArray)); //#define DAC_RADIO (14.36) // 1V 对应的DAC,看起来13.05比较接近 //#define DAC_RADIO (13.05) // 1V 对应的DAC,看起来13.05比较接近 //#define DAC_RADIO (13.05*sysPara->para.dacScale/100) // 1V 对应的DAC,看起来13.05比较接近 #define DAC_RADIO (nCurrPrintRow > 1 ? (13.05*(100-((100-sysPara->para.dacScale)/((nCurrPrintRow-1)>0?(nCurrPrintRow-1):1)*i))/100) : 13.05) if(1) { //int nCurrPrintRow = sysPara->status.currPrintRow; #if 0 if(sysPara->para.FullColFixVal == 1) { //qDebug()<<"adj voltage"<status.currPrintRow; i++) { if (i<40) { float temp = sysPara->para.printed_adj_dac[i] * DAC_RADIO; // qDebug()<<"normal dac:"<status.currPrintRow; i++) { if (i<40) { float temp = sysPara->para.printed_continue_col_dac[i] * DAC_RADIO; // qDebug()<<"not gap:"<status.currPrintRow; i++) { if (i<40) { float temp = sysPara->para.printed_full_col_dac[i] * DAC_RADIO; // qDebug()<<"full_col:"<status.currPrintRow; i++) { if(!sysPara->para.scanInverse) DACArray[i] = printVerticalButtom + i*DACStep; else DACArray[i] = printVerticalTop - i*DACStep; if(DACArray[i] >= pointAdjustVoltagePos) { DACArray[i] += sysPara->para.PointVoltageAdjustValue; } notGapDACArray[i] = DACArray[i]; fullColDACArray[i] = DACArray[i]; // qDebug()<<"[writeFpgaPrintPara fun]DACArray[i]:"<status.currPrintRow; i++) { if(!sysPara->para.scanInverse) DACArray[i] = printVerticalButtom + i*DACStep; else DACArray[i] = printVerticalTop - i*DACStep; if(DACArray[i] >= pointAdjustVoltagePos) { DACArray[i] += sysPara->para.PointVoltageAdjustValue; } notGapDACArray[i] = DACArray[i]; fullColDACArray[i] = DACArray[i]; // qDebug()<<"[writeFpgaPrintPara fun]DACArray[i]:"<para.mode0211) { fast_96k_9dot_full_default_dac[0] = 58; fast_96k_9dot_full_default_dac[1] = 80; fast_96k_9dot_full_default_dac[2] = 93; fast_96k_9dot_full_default_dac[3] = 106; fast_96k_9dot_full_default_dac[4] = 120; fast_96k_9dot_full_default_dac[5] = 132; fast_96k_9dot_full_default_dac[6] = 138; fast_96k_9dot_full_default_dac[7] = 136; fast_96k_9dot_full_default_dac[8] = 141; } int fast_96k_9dot_adj_default_dac[] = {62, 73, 84, 95, 106, 117, 128, 139, 150}; int fast_96k_9dot_continue_default_dac[] = {0, 85, 98, 111, 124, 137, 148, 146, 153}; int fast_96k_12dot_full_default_dac[] = {60, 82, 96, 110, 124, 138, 152, 152, 164, 176, 188, 200}; int fast_96k_12dot_adj_default_dac[] = {57, 71, 83, 95, 107, 119, 131, 143, 155, 167, 179, 191}; int fast_96k_12dot_continue_default_dac[] = {0, 82, 98, 113, 126, 139, 152, 152, 164, 176, 188, 200}; int fast_96k_12dot_full_default_dac_U[] = {68, 92, 106, 120, 132, 144, 154, 154, 166, 178, 190, 200}; int fast_96k_12dot_adj_default_dac_U[] = {0, 65, 83, 95, 108, 120, 132, 144, 156, 168, 180, 192}; int fast_96k_12dot_continue_default_dac_U[] = {0, 0, 95, 111, 126 , 139, 151, 153, 165, 177, 188, 200}; int fast_96k_12dot_full_default_dac_UD[] = {63, 85, 99, 111, 123, 135, 147, 147, 158, 169, 180, 190}; int fast_96k_12dot_adj_default_dac_UD[] = {0, 60, 77, 88, 99, 110, 122, 134, 146, 158, 170, 182}; int fast_96k_12dot_continue_default_dac_UD[] = {0, 0, 90, 106, 121, 134, 146, 148, 160, 171, 181, 190}; int fast_96k_12dot_full_default_dac_H[] = {68, 90, 108, 125, 141, 156, 170, 170, 180, 193, 204, 214}; int fast_96k_12dot_adj_default_dac_H[] = {59, 73, 86, 99, 112, 125, 138, 151, 164, 177, 190, 203}; int fast_96k_12dot_continue_default_dac_H[] = {0, 87, 102, 117, 131 , 145, 159, 161, 173, 186, 199, 212}; int fast_96k_12dot_full_default_dac_HU[] = {68, 90, 108, 125, 141, 156, 169, 170, 181, 192, 203, 212}; int fast_96k_12dot_adj_default_dac_HU[] = {0, 70, 86, 99, 112, 125, 138, 151, 164, 177, 190, 202}; int fast_96k_12dot_continue_default_dac_HU[] = {0, 0, 100, 117, 130, 143, 157, 160, 173, 186, 199, 211}; int normal_96k_5dot_full_default_dac[] = {70, 84, 96, 106, 116}; int normal_96k_5dot_adj_default_dac[] = {70, 81, 91, 101, 111}; int normal_96k_5dot_continue_default_dac[] = {0, 82, 94, 104, 114}; int normal_96k_5dot_full_default_dac_S[] = {70, 83, 93, 103, 113}; int normal_96k_5dot_adj_default_dac_S[] = {68, 78, 88, 98, 108}; int normal_96k_5dot_continue_default_dac_S[] = {0, 83, 93, 103, 113}; int normal_96k_5dot_full_default_dac_H[] = {80, 96, 110, 124, 134}; int normal_96k_5dot_adj_default_dac_H[] = {78, 91, 105, 117, 129}; int normal_96k_5dot_continue_default_dac_H[] = {0, 94, 108, 121, 134}; int normal_96k_7dot_full_default_dac[] = {70, 84, 96, 106, 116, 126, 135}; int normal_96k_7dot_adj_default_dac[] = {69, 80, 90, 100, 110, 120, 129}; int normal_96k_7dot_continue_default_dac[] = {0, 82, 94, 104, 114, 124, 134}; int normal_96k_7dot_full_default_dac_S[] = {70, 83, 94, 105, 114, 124, 133}; int normal_96k_7dot_adj_default_dac_S[] = {68, 77, 87, 97, 107, 117, 128}; int normal_96k_7dot_continue_default_dac_S[] = {0, 83, 93, 103, 113, 123, 133}; int normal_96k_7dot_full_default_dac_H[] = {80, 96, 110, 124, 138, 152, 162}; int normal_96k_7dot_adj_default_dac_H[] = {78, 91, 105, 118, 131, 144, 156}; int normal_96k_7dot_continue_default_dac_H[] = {0, 94, 108, 121, 134, 147, 160}; int normal_96k_9dot_full_default_dac[] = {70, 84, 94, 104, 114, 124, 134, 144, 150}; int normal_96k_9dot_adj_default_dac[] = {68, 78, 88, 98, 107, 117, 126, 136, 143}; int normal_96k_9dot_continue_default_dac[] = {0, 82, 92, 102, 112, 122, 132, 142, 152}; int normal_96k_9dot_full_default_dac_H[] = {80, 98, 112, 126, 138, 148, 158, 168, 178}; int normal_96k_9dot_adj_default_dac_H[] = {76, 88, 100, 112, 124, 135, 146, 157, 170}; int normal_96k_9dot_continue_default_dac_H[] = {0, 94, 108, 120, 132, 144, 155, 165, 176}; int normal_96k_12dot_full_default_dac[] = {70, 86, 97, 106, 115, 124, 133, 142, 151, 160, 169, 176}; int normal_96k_12dot_adj_default_dac[] = {68, 77, 86, 95, 104, 113, 122, 131, 140, 149, 158, 167}; int normal_96k_12dot_continue_default_dac[] = {0, 83, 92, 101, 110, 119, 128, 137, 146, 156, 165, 174}; int normal_96k_12dot_full_default_dac_U[] = {72, 83, 92, 101, 110, 119, 128, 137, 146, 155, 164}; int normal_96k_12dot_adj_default_dac_U[] = {0, 74, 83, 92, 101, 110, 119, 128, 137, 146, 155, 164}; int normal_96k_12dot_continue_default_dac_U[] = {0, 0, 92, 101, 110, 119, 128, 137, 146, 155, 164, 173}; int normal_96k_12dot_full_default_dac_H[] = {80, 94, 106, 118, 130, 142, 153, 163, 173, 183, 193, 200}; int normal_96k_12dot_adj_default_dac_H[] = {76, 87, 98, 108, 118, 128, 138, 148, 158, 168, 178, 189}; int normal_96k_12dot_continue_default_dac_H[] = {0, 92, 104, 115, 126, 137, 148, 158, 168, 178, 188, 198}; int normal_96k_12dot_full_default_dac_HU[] = {78, 92, 102, 112, 122, 132, 142, 152, 162, 172, 182, 190}; int normal_96k_12dot_adj_default_dac_HU[] = {0, 72, 83, 93, 103, 113, 123, 134, 146, 158, 170, 180}; int normal_96k_12dot_continue_default_dac_HU[] = {0, 0, 92, 102, 112, 122, 132, 143, 155, 167, 179, 188}; int normal_96k_16dot_full_default_dac[] = {70, 80, 88, 98, 107, 116, 125, 134, 143, 153, 162, 171, 180, 189, 198, 205}; int normal_96k_16dot_adj_default_dac[] = {64, 74, 88, 89, 97, 105, 113, 121, 129, 138, 147, 156, 165, 174, 183, 192}; int normal_96k_16dot_continue_default_dac[] = {0, 77, 86, 95, 104, 113, 121, 130, 139, 147, 156, 166, 175, 185, 194,200}; int normal_96k_16dot_full_default_dac_H[] = {80, 96, 108, 118, 128, 138, 148, 158, 168, 178, 188, 198, 208, 218, 228, 236}; int normal_96k_16dot_adj_default_dac_H[] = {76, 87, 98, 108, 118, 128, 137, 146, 155, 164, 173, 183, 193, 203, 214, 224}; int normal_96k_16dot_continue_default_dac_H[] = {0, 92, 104, 114, 124, 134, 144, 154, 164, 174, 184, 194, 204, 214, 224, 234}; int slow1_96k_5dot_full_default_dac[] = {70, 80, 88, 97, 104}; int slow1_96k_5dot_adj_default_dac[] = {68, 76, 85, 93, 101}; int slow1_96k_5dot_continue_default_dac[] = {0, 79, 88, 96, 103}; int slow1_96k_5dot_full_default_dac_S[] = {70, 79, 87, 96, 104}; int slow1_96k_5dot_adj_default_dac_S[] = {69, 77, 84, 91, 102}; int slow1_96k_5dot_continue_default_dac_S[] = {0, 79, 88, 96, 104}; int slow1_96k_7dot_full_default_dac[] = {70, 80, 88, 97, 104, 111, 118}; int slow1_96k_7dot_adj_default_dac[] = {68, 76, 85, 93, 101, 108, 113}; int slow1_96k_7dot_continue_default_dac[] = {0, 79, 88, 96, 103, 110, 117}; int slow1_96k_7dot_full_default_dac_S[] = {70, 79, 87, 96, 104, 112, 119}; int slow1_96k_7dot_adj_default_dac_S[] = {69, 77, 82, 90, 99, 107, 116}; int slow1_96k_7dot_continue_default_dac_S[] = {0, 79, 88, 96, 103, 110, 119}; int slow1_96k_9dot_full_default_dac[] = {70, 81, 88, 97, 104, 112, 119, 126, 133}; int slow1_96k_9dot_adj_default_dac[] = {68, 76, 84, 91, 99, 106, 113, 120, 127}; int slow1_96k_9dot_continue_default_dac[] = {0, 79, 88, 96, 103, 110, 117, 124, 131}; int slow1_96k_12dot_full_default_dac[] = {70, 81, 88, 97, 104, 112, 119, 126, 133, 140, 147, 155}; int slow1_96k_12dot_adj_default_dac[] = {68, 76, 84, 91, 99, 106, 113, 120, 127, 134, 141, 147}; int slow1_96k_12dot_continue_default_dac[] = {0, 79, 88, 96, 103, 110, 117, 124, 131, 138, 145, 152}; int slow1_96k_16dot_full_default_dac[] = {70, 81, 88, 97, 104, 112, 119, 126, 133, 140, 147, 154, 161, 168, 175, 181}; int slow1_96k_16dot_adj_default_dac[] = {68, 76, 84, 91, 99, 106, 113, 120, 127, 134, 141, 148, 155, 162, 169, 176}; int slow1_96k_16dot_continue_default_dac[] = {0, 79, 88, 96, 103, 110, 117, 124, 131, 138, 145, 152, 159, 166, 173, 180}; int slow1_96k_24dot_full_default_dac[] = {70, 80 , 88, 96, 104, 112, 120, 128, 136, 144, 152, 160, 168, 173, 181, 187,194,201,208,215,222,229,236,242}; int slow1_96k_24dot_adj_default_dac[] = {69, 76, 84, 91, 98, 106, 114, 121, 128, 136, 143, 150, 157, 164, 171, 177,183,190,196,203,209,215,221,227}; int slow1_96k_24dot_continue_default_dac[] = {0, 79, 87, 95, 103, 110, 118, 125, 133, 140, 148, 155, 161, 169, 175, 181,186,195,200,208,215,222,228,234}; int fast_96k_5dot_full_default_dac_F[] = {70, 92, 107, 120, 130}; int fast_96k_7dot_full_default_dac_F[] = {70, 92, 107, 120, 132, 142, 151}; int normal_96k_5dot_full_default_dac_F[] = {70, 85, 95, 106, 116}; int normal_96k_7dot_full_default_dac_F[] = {70, 85, 95, 107, 117, 126, 135}; /* ==============96k end ========================*/ /* ==============128k ========================*/ int fast_128k_5dot_full_default_dac[] = {80, 106, 121, 135, 145}; int fast_128k_5dot_adj_default_dac[] = {77, 87, 100, 111, 122}; int fast_128k_5dot_continue_default_dac[] = {0, 101, 114, 128, 142}; int fast_128k_7dot_full_default_dac[] = {79, 105, 122, 140, 155, 169, 178}; int fast_128k_7dot_adj_default_dac[] = {75, 87, 102, 113, 130, 142, 157}; int fast_128k_7dot_continue_default_dac[] = { 0, 101, 119, 134, 149, 164, 178}; int fast_128k_7dot_full_default_dac_A[] = {79, 105, 122, 137, 149, 164, 175}; int fast_128k_7dot_adj_default_dac_A[] = {73, 84, 98, 112, 126, 140, 154}; int fast_128k_7dot_continue_default_dac_A[] = { 0, 100, 117, 132, 147, 162, 175}; int fast_128k_5dot_full_default_dac_A[] = {80, 106, 121, 140, 154}; int fast_128k_5dot_adj_default_dac_A[] = {75, 90, 106, 120, 134}; int fast_128k_5dot_continue_default_dac_A[] = {0, 105, 127, 142, 158}; int fast_128k_5dot_full_default_dac_B[] = {83, 110, 123, 140, 148}; int fast_128k_5dot_adj_default_dac_B[] = {78, 90, 103, 114, 126}; int fast_128k_5dot_continue_default_dac_B[] = {0, 105, 118, 133, 146}; int fast_128k_7dot_full_default_dac_B[] = {79, 105, 122, 140, 156, 167, 178}; int fast_128k_7dot_adj_default_dac_B[] = {75, 87, 101, 114, 128, 142, 156}; int fast_128k_7dot_continue_default_dac_B[] = { 0, 105, 120, 135, 150, 165, 180}; int fast_128k_7dot_full_default_dac_C[] = {79, 105, 120, 135, 145, 155, 165}; int fast_128k_7dot_adj_default_dac_C[] = {71, 85, 96, 107, 120, 133, 143}; int fast_128k_7dot_continue_default_dac_C[] = { 0, 97, 113, 126, 139, 152, 165}; int fast_128k_9dot_full_default_dac_A[] = {74, 99, 115, 130, 140, 150, 163, 158, 166}; int fast_128k_9dot_adj_default_dac_A[] = {72, 82, 92, 104, 115, 127, 138, 149, 160}; int fast_128k_9dot_continue_default_dac_A[] = {0, 95, 108, 121, 133, 145, 158, 157, 169}; int fast_128k_9dot_full_default_dac_C[] = {78, 108, 125, 143, 158, 172, 185, 180, 191}; int fast_128k_9dot_adj_default_dac_C[] = {73, 86, 99, 112, 125, 138, 151, 164, 178}; int fast_128k_9dot_continue_default_dac_C[] = {0, 100, 116, 132, 144, 158, 174, 176, 191}; int fast_128k_9dot_full_default_dac_B[] = {74, 100, 120, 140, 155, 170, 190, 188, 199}; int fast_128k_9dot_adj_default_dac_B[] = {70, 86, 102, 117, 132, 147, 162, 177, 190}; int fast_128k_9dot_continue_default_dac_B[] = {0, 100, 120, 136, 152, 168, 185, 187, 200}; if(sysPara->para.reducedPixelNumRatio >=20){ fast_128k_7dot_continue_default_dac_B[2] = 115; fast_128k_9dot_continue_default_dac_B[2] = 115; fast_128k_9dot_full_default_dac_B[8] = 202; } if(sysPara->para.recommendedPrintSpeed == 3){ fast_128k_7dot_full_default_dac[0] = 78; fast_128k_7dot_continue_default_dac[1] = 100; fast_128k_7dot_continue_default_dac[2] = 116; fast_128k_7dot_continue_default_dac[3] = 132; fast_128k_7dot_adj_default_dac[0] = 72; } int fast_128k_9dot_full_default_dac[9] = {74, 99, 115, 130, 140, 153, 163, 158, 166}; if(sysPara->para.mode0211) { fast_128k_9dot_full_default_dac[0] = 74; fast_128k_9dot_full_default_dac[1] = 99; fast_128k_9dot_full_default_dac[2] = 117; fast_128k_9dot_full_default_dac[3] = 134; fast_128k_9dot_full_default_dac[4] = 145; fast_128k_9dot_full_default_dac[5] = 158; fast_128k_9dot_full_default_dac[6] = 171; fast_128k_9dot_full_default_dac[7] = 163; fast_128k_9dot_full_default_dac[8] = 166; } int fast_128k_9dot_adj_default_dac[] = {72, 83, 96, 106, 118, 127, 138, 149, 158}; int fast_128k_9dot_continue_default_dac[] = {0, 95, 108, 121, 133, 145, 158, 157, 167}; if(sysPara->para.recommendedPrintSpeed == 1){ fast_128k_5dot_full_default_dac[3] = 133; fast_128k_5dot_full_default_dac[4] = 143; fast_128k_5dot_adj_default_dac[1] = 89; fast_128k_5dot_adj_default_dac[2] = 102; fast_128k_5dot_adj_default_dac[3] = 114; fast_128k_5dot_adj_default_dac[4] = 126; fast_128k_7dot_full_default_dac[0] = 74; fast_128k_7dot_full_default_dac[1] = 99; fast_128k_7dot_full_default_dac[2] = 115; fast_128k_7dot_full_default_dac[3] = 130; fast_128k_7dot_full_default_dac[4] = 140; fast_128k_7dot_full_default_dac[5] = 150; fast_128k_7dot_full_default_dac[6] = 160; fast_128k_7dot_adj_default_dac[0] = 72; fast_128k_7dot_adj_default_dac[1] = 83; fast_128k_7dot_adj_default_dac[2] = 96; fast_128k_7dot_adj_default_dac[3] = 106; fast_128k_7dot_adj_default_dac[4] = 118; fast_128k_7dot_adj_default_dac[5] = 130; fast_128k_7dot_adj_default_dac[6] = 142; fast_128k_7dot_continue_default_dac[1] = 95; fast_128k_7dot_continue_default_dac[2] = 108; fast_128k_7dot_continue_default_dac[3] = 121; fast_128k_7dot_continue_default_dac[4] = 133; fast_128k_7dot_continue_default_dac[5] = 146; fast_128k_7dot_continue_default_dac[6] = 158; fast_128k_9dot_full_default_dac[5] = 152; fast_128k_9dot_full_default_dac[6] = 162; fast_128k_9dot_full_default_dac[7] = 160; if(sysPara->para.mode0211) { fast_128k_9dot_full_default_dac[0] = 74; fast_128k_9dot_full_default_dac[1] = 99; fast_128k_9dot_full_default_dac[2] = 117; fast_128k_9dot_full_default_dac[3] = 134; fast_128k_9dot_full_default_dac[4] = 145; fast_128k_9dot_full_default_dac[5] = 158; fast_128k_9dot_full_default_dac[6] = 171; fast_128k_9dot_full_default_dac[7] = 163; fast_128k_9dot_full_default_dac[8] = 166; } fast_128k_9dot_adj_default_dac[0] = 70; fast_128k_9dot_adj_default_dac[1] = 81; fast_128k_9dot_adj_default_dac[2] = 92; fast_128k_9dot_adj_default_dac[3] = 103; fast_128k_9dot_adj_default_dac[4] = 114; fast_128k_9dot_adj_default_dac[5] = 125; fast_128k_9dot_adj_default_dac[6] = 136; fast_128k_9dot_adj_default_dac[7] = 147; fast_128k_9dot_adj_default_dac[8] = 158; } int normal_128k_5dot_full_default_dac[] = {80, 96, 107, 118, 128}; int normal_128k_5dot_adj_default_dac[] = {77, 87, 98, 108, 118}; int normal_128k_5dot_continue_default_dac[] = {0, 94, 105, 116, 127}; int normal_128k_7dot_full_default_dac[] = {80, 96, 107, 118, 128, 137, 143}; int normal_128k_7dot_adj_default_dac[] = {77, 87, 98, 108, 116, 127, 134}; int normal_128k_7dot_continue_default_dac[] = {0, 94, 104, 115, 126, 135, 144}; int normal_128k_9dot_full_default_dac[] = {80, 96, 107, 118, 128, 137, 143, 154, 162}; int normal_128k_9dot_adj_default_dac[] = {77, 87, 98, 108, 118, 128, 137, 147, 156}; int normal_128k_9dot_continue_default_dac[] = {0, 93, 104, 115, 126, 135, 140, 151, 161}; /* ==============128k end ========================*/ #endif for(int i = 0; i < sysPara->status.currPrintRow; i++) { if(!sysPara->para.scanInverse) DACArray[i] = printVerticalButtom + i*DACStep; else DACArray[i] = printVerticalTop - i*DACStep; if(DACArray[i] >= pointAdjustVoltagePos) { DACArray[i] += sysPara->para.PointVoltageAdjustValue; } notGapDACArray[i] = DACArray[i]; fullColDACArray[i] = DACArray[i]; // qDebug()<<"[writeFpgaPrintPara fun]DACArray[i]:"<para.FullColFixVal == 1) { if (sysPara->status.currPrintRow <= 5) { for(int i = 0; i < sysPara->status.currPrintRow; i++) { if (sysPara->para.oscillatoFreq == 0) { // 64K if (sysPara->para.printRowDelay == 0) { float adj_dac_temp = fast_64k_5dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = fast_64k_5dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = fast_64k_5dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if (sysPara->para.printRowDelay == 1) { float adj_dac_temp = normal_64k_5dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = normal_64k_5dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = normal_64k_5dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if (sysPara->para.printRowDelay == 2) { float adj_dac_temp = slow1_64k_5dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = slow1_64k_5dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = slow1_64k_5dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } } else if (sysPara->para.oscillatoFreq == 2) { // 96 if (sysPara->para.printRowDelay == 0) { float adj_dac_temp = fast_96k_5dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = fast_96k_5dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = fast_96k_5dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; if(sysPara->para.recommendedPrintSpeed == 1){ adj_dac_temp = fast_96k_5dot_adj_default_dac_H[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = fast_96k_5dot_continue_default_dac_H[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = fast_96k_5dot_full_default_dac_H[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } if(!sysPara->para.Vol1of8En && sysPara->para.FullColFixVal){ full_dac_temp = fast_96k_5dot_full_default_dac_F[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } } else if (sysPara->para.printRowDelay == 1) { float adj_dac_temp = normal_96k_5dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = normal_96k_5dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = normal_96k_5dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; if(sysPara->para.recommendedPrintSpeed == 1){ adj_dac_temp = normal_96k_5dot_adj_default_dac_H[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = normal_96k_5dot_continue_default_dac_H[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = normal_96k_5dot_full_default_dac_H[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if(sysPara->para.recommendedPrintSpeed == 2){ adj_dac_temp = normal_96k_5dot_adj_default_dac_S[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = normal_96k_5dot_continue_default_dac_S[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = normal_96k_5dot_full_default_dac_S[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } if(!sysPara->para.Vol1of8En && sysPara->para.FullColFixVal){ full_dac_temp = normal_96k_5dot_full_default_dac_F[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } sysPara->voltePara.pixel_para_table[0] = 15; sysPara->voltePara.pixel_para_table[1] = 15; sysPara->voltePara.pixel_para_table[2] = 15; sysPara->voltePara.pixel_para_table[3] = 15; sysPara->voltePara.pixel_para_table[4] = 10; } else if (sysPara->para.printRowDelay == 2) { float adj_dac_temp = slow1_96k_5dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = slow1_96k_5dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = slow1_96k_5dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; if(sysPara->para.recommendedPrintSpeed == 2){ adj_dac_temp = slow1_96k_5dot_adj_default_dac_S[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = slow1_96k_5dot_continue_default_dac_S[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = slow1_96k_5dot_full_default_dac_S[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } sysPara->voltePara.pixel_para_table[0] = 15; sysPara->voltePara.pixel_para_table[1] = 15; sysPara->voltePara.pixel_para_table[2] = 15; sysPara->voltePara.pixel_para_table[3] = 15; sysPara->voltePara.pixel_para_table[4] = 10; } } else if (sysPara->para.oscillatoFreq == 3) { // 128k if (sysPara->para.printRowDelay == 0) { float adj_dac_temp = fast_128k_5dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = fast_128k_5dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = fast_128k_5dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; if(sysPara->para.recommendedPrintSpeed == 1){ adj_dac_temp = fast_128k_5dot_adj_default_dac_A[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = fast_128k_5dot_continue_default_dac_A[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = fast_128k_5dot_full_default_dac_A[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if(sysPara->para.recommendedPrintSpeed == 1){ adj_dac_temp = fast_128k_5dot_adj_default_dac_B[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = fast_128k_5dot_continue_default_dac_B[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = fast_128k_5dot_full_default_dac_B[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } } else if (sysPara->para.printRowDelay == 1) { float adj_dac_temp = normal_128k_5dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = normal_128k_5dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = normal_128k_5dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if (sysPara->para.printRowDelay == 2) { // float adj_dac_temp = slow1_128k_5dot_adj_default_dac[i] * DAC_RADIO; // DACArray[i] = adj_dac_temp; // float continue_dac_temp = slow1_128k_5dot_continue_default_dac[i] * DAC_RADIO; // notGapDACArray[i] = continue_dac_temp; // float full_dac_temp = slow1_128k_5dot_full_default_dac[i] * DAC_RADIO; // fullColDACArray[i] = full_dac_temp; } } } } else if (sysPara->status.currPrintRow <= 7) { for(int i = 0; i < sysPara->status.currPrintRow; i++) { if (sysPara->para.oscillatoFreq == 0) { // 64K if (sysPara->para.printRowDelay == 0) { float adj_dac_temp = fast_64k_7dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = fast_64k_7dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = fast_64k_7dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if (sysPara->para.printRowDelay == 1) { float adj_dac_temp = normal_64k_7dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = normal_64k_7dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = normal_64k_7dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if (sysPara->para.printRowDelay == 2) { float adj_dac_temp = slow1_64k_7dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = slow1_64k_7dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = slow1_64k_7dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } } else if (sysPara->para.oscillatoFreq == 2) { // 96K if (sysPara->para.printRowDelay == 0) { float adj_dac_temp = fast_96k_7dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = fast_96k_7dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = fast_96k_7dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; if(sysPara->para.recommendedPrintSpeed == 1){ adj_dac_temp = fast_96k_7dot_adj_default_dac_H[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = fast_96k_7dot_continue_default_dac_H[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = fast_96k_7dot_full_default_dac_H[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } if(sysPara->para.recommendedPrintSpeed == 2){ adj_dac_temp = fast_96k_7dot_adj_default_dac_S[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = fast_96k_7dot_continue_default_dac_S[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = fast_96k_7dot_full_default_dac_S[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } if(!sysPara->para.Vol1of8En && sysPara->para.FullColFixVal){ full_dac_temp = fast_96k_7dot_full_default_dac_F[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } } else if (sysPara->para.printRowDelay == 1) { float adj_dac_temp = normal_96k_7dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = normal_96k_7dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = normal_96k_7dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; if(sysPara->para.recommendedPrintSpeed == 1){ adj_dac_temp = normal_96k_7dot_adj_default_dac_H[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = normal_96k_7dot_continue_default_dac_H[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = normal_96k_7dot_full_default_dac_H[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if(sysPara->para.recommendedPrintSpeed == 2){ adj_dac_temp = normal_96k_7dot_adj_default_dac_S[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = normal_96k_7dot_continue_default_dac_S[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = normal_96k_7dot_full_default_dac_S[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } if(!sysPara->para.Vol1of8En && sysPara->para.FullColFixVal){ full_dac_temp = normal_96k_7dot_full_default_dac_F[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } sysPara->voltePara.pixel_para_table[0] = 15; sysPara->voltePara.pixel_para_table[1] = 15; sysPara->voltePara.pixel_para_table[2] = 15; sysPara->voltePara.pixel_para_table[3] = 15; sysPara->voltePara.pixel_para_table[4] = 10; } else if (sysPara->para.printRowDelay == 2) { float adj_dac_temp = slow1_96k_7dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = slow1_96k_7dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = slow1_96k_7dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; if(sysPara->para.recommendedPrintSpeed == 2){ adj_dac_temp = slow1_96k_7dot_adj_default_dac_S[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = slow1_96k_7dot_continue_default_dac_S[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = slow1_96k_7dot_full_default_dac_S[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } sysPara->voltePara.pixel_para_table[0] = 15; sysPara->voltePara.pixel_para_table[1] = 15; sysPara->voltePara.pixel_para_table[2] = 15; sysPara->voltePara.pixel_para_table[3] = 15; sysPara->voltePara.pixel_para_table[4] = 10; } } else if (sysPara->para.oscillatoFreq == 3) { // 128K if (sysPara->para.printRowDelay == 0) { float adj_dac_temp = fast_128k_7dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = fast_128k_7dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = fast_128k_7dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; if(sysPara->para.recommendedPrintSpeed == 2){ adj_dac_temp = fast_128k_7dot_adj_default_dac_A[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = fast_128k_7dot_continue_default_dac_A[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = fast_128k_7dot_full_default_dac_A[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if(sysPara->para.recommendedPrintSpeed == 1){ adj_dac_temp = fast_128k_7dot_adj_default_dac_B[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = fast_128k_7dot_continue_default_dac_B[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = fast_128k_7dot_full_default_dac_B[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if(sysPara->para.recommendedPrintSpeed == 3){ adj_dac_temp = fast_128k_7dot_adj_default_dac_C[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = fast_128k_7dot_continue_default_dac_C[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = fast_128k_7dot_full_default_dac_C[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } sysPara->voltePara.pixel_para_table[0] = 15; sysPara->voltePara.pixel_para_table[1] = 15; sysPara->voltePara.pixel_para_table[2] = 15; sysPara->voltePara.pixel_para_table[3] = 25; sysPara->voltePara.pixel_para_table[4] = 10; } else if (sysPara->para.printRowDelay == 1) { float adj_dac_temp = normal_128k_7dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = normal_128k_7dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = normal_128k_7dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; sysPara->voltePara.pixel_para_table[0] = 15; sysPara->voltePara.pixel_para_table[1] = 15; sysPara->voltePara.pixel_para_table[2] = 15; sysPara->voltePara.pixel_para_table[3] = 15; sysPara->voltePara.pixel_para_table[4] = 10; } else if (sysPara->para.printRowDelay == 2) { // float adj_dac_temp = slow1_128k_7dot_adj_default_dac[i] * DAC_RADIO; // DACArray[i] = adj_dac_temp; // float continue_dac_temp = slow1_128k_7dot_continue_default_dac[i] * DAC_RADIO; // notGapDACArray[i] = continue_dac_temp; // float full_dac_temp = slow1_128k_7dot_full_default_dac[i] * DAC_RADIO; // fullColDACArray[i] = full_dac_temp; } } } } else if (sysPara->status.currPrintRow <= 9) { for(int i = 0; i < sysPara->status.currPrintRow; i++) { if (sysPara->para.oscillatoFreq == 0) { // 64K if (sysPara->para.printRowDelay == 0) { float adj_dac_temp = fast_64k_9dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = fast_64k_9dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = fast_64k_9dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if (sysPara->para.printRowDelay == 1) { float adj_dac_temp = normal_64k_9dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = normal_64k_9dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = normal_64k_9dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if (sysPara->para.printRowDelay == 2) { float adj_dac_temp = slow1_64k_9dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = slow1_64k_9dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = slow1_64k_9dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } } else if (sysPara->para.oscillatoFreq == 2) { // 96K if (sysPara->para.printRowDelay == 0) { float adj_dac_temp = fast_96k_9dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = fast_96k_9dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = fast_96k_9dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; // sysPara->voltePara.pixel_para_table[0] = 20; // sysPara->voltePara.pixel_para_table[1] = 20; // sysPara->voltePara.pixel_para_table[2] = 15; // sysPara->voltePara.pixel_para_table[3] = 15; // sysPara->voltePara.pixel_para_table[4] = 15; } else if (sysPara->para.printRowDelay == 1) { float adj_dac_temp = normal_96k_9dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = normal_96k_9dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = normal_96k_9dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; if(sysPara->para.recommendedPrintSpeed == 1){ adj_dac_temp = normal_96k_9dot_adj_default_dac_H[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = normal_96k_9dot_continue_default_dac_H[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = normal_96k_9dot_full_default_dac_H[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } // sysPara->voltePara.pixel_para_table[0] = 20; // sysPara->voltePara.pixel_para_table[1] = 20; // sysPara->voltePara.pixel_para_table[2] = 30; // sysPara->voltePara.pixel_para_table[3] = 30; // sysPara->voltePara.pixel_para_table[4] = 10; } else if (sysPara->para.printRowDelay == 2) { float adj_dac_temp = slow1_96k_9dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = slow1_96k_9dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = slow1_96k_9dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } } if (sysPara->para.oscillatoFreq == 3) { // 128K if (sysPara->para.printRowDelay == 0) { float adj_dac_temp = fast_128k_9dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = fast_128k_9dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = fast_128k_9dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; if(sysPara->para.recommendedPrintSpeed == 1){ adj_dac_temp = fast_128k_9dot_adj_default_dac_A[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = fast_128k_9dot_continue_default_dac_A[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = fast_128k_9dot_full_default_dac_A[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if(sysPara->para.recommendedPrintSpeed == 2){ adj_dac_temp = fast_128k_9dot_adj_default_dac_B[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = fast_128k_9dot_continue_default_dac_B[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = fast_128k_9dot_full_default_dac_B[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if(sysPara->para.recommendedPrintSpeed == 3){ adj_dac_temp = fast_128k_9dot_adj_default_dac_C[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = fast_128k_9dot_continue_default_dac_C[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = fast_128k_9dot_full_default_dac_C[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } sysPara->voltePara.pixel_para_table[0] = 15; sysPara->voltePara.pixel_para_table[1] = 15; sysPara->voltePara.pixel_para_table[2] = 15; sysPara->voltePara.pixel_para_table[3] = 25; sysPara->voltePara.pixel_para_table[4] = 10; } else if (sysPara->para.printRowDelay == 1) { float adj_dac_temp = normal_128k_9dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = normal_128k_9dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = normal_128k_9dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; sysPara->voltePara.pixel_para_table[0] = 15; sysPara->voltePara.pixel_para_table[1] = 15; sysPara->voltePara.pixel_para_table[2] = 15; sysPara->voltePara.pixel_para_table[3] = 15; sysPara->voltePara.pixel_para_table[4] = 10; } else if (sysPara->para.printRowDelay == 2) { // float adj_dac_temp = slow1_128k_9dot_adj_default_dac[i] * DAC_RADIO; // DACArray[i] = adj_dac_temp; // float continue_dac_temp = slow1_128k_9dot_continue_default_dac[i] * DAC_RADIO; // notGapDACArray[i] = continue_dac_temp; // float full_dac_temp = slow1_128k_9dot_full_default_dac[i] * DAC_RADIO; // fullColDACArray[i] = full_dac_temp; } } } } else if (sysPara->status.currPrintRow <= 12) { for(int i = 0; i < sysPara->status.currPrintRow; i++) { if (sysPara->para.oscillatoFreq == 0) { // 64K if ((sysPara->para.printRowDelay == 0) && (i < 5)) {//交替 float adj_dac_temp = fast_64k_5dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = fast_64k_5dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = fast_64k_5dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if (sysPara->para.printRowDelay == 1) { float adj_dac_temp = normal_64k_12dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = normal_64k_12dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = normal_64k_12dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if (sysPara->para.printRowDelay == 2) { float adj_dac_temp = slow1_64k_12dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = slow1_64k_12dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = slow1_64k_12dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } } else if (sysPara->para.oscillatoFreq == 2) { // 96K if (sysPara->para.printRowDelay == 0) { float adj_dac_temp = fast_96k_12dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = fast_96k_12dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = fast_96k_12dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; if((sysPara->para.recommendedPrintSpeed == 1) && (sysPara->para.upDownInverse)){ adj_dac_temp = fast_96k_12dot_adj_default_dac_HU[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = fast_96k_12dot_continue_default_dac_HU[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = fast_96k_12dot_full_default_dac_HU[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if(sysPara->para.recommendedPrintSpeed == 1){ adj_dac_temp = fast_96k_12dot_adj_default_dac_H[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = fast_96k_12dot_continue_default_dac_H[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = fast_96k_12dot_full_default_dac_H[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if(sysPara->para.upDownInverse){ adj_dac_temp = fast_96k_12dot_adj_default_dac_U[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = fast_96k_12dot_continue_default_dac_U[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = fast_96k_12dot_full_default_dac_U[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } if((sysPara->para.recommendedPrintSpeed == 2) && (sysPara->para.upDownInverse)){ adj_dac_temp = fast_96k_12dot_adj_default_dac_UD[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = fast_96k_12dot_continue_default_dac_UD[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = fast_96k_12dot_full_default_dac_UD[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } sysPara->voltePara.pixel_para_table[0] = 30; sysPara->voltePara.pixel_para_table[1] = 15; sysPara->voltePara.pixel_para_table[2] = 15; sysPara->voltePara.pixel_para_table[3] = 15; sysPara->voltePara.pixel_para_table[4] = 25; } if ((sysPara->para.printRowDelay == 0) && (i < 5) && sysPara->para.alterPrint.enable) {//交替 float adj_dac_temp = fast_96k_5dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = fast_96k_5dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = fast_96k_5dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if ((sysPara->para.printRowDelay == 1) && (i < 5) && sysPara->para.alterPrint.enable) {//交替 float adj_dac_temp = normal_96k_5dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = normal_96k_5dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = normal_96k_5dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if ((sysPara->para.printRowDelay == 2) && (i < 5) && sysPara->para.alterPrint.enable) {//交替 float adj_dac_temp = slow1_96k_5dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = slow1_96k_5dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = slow1_96k_5dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if (sysPara->para.printRowDelay == 1) { float adj_dac_temp = normal_96k_12dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = normal_96k_12dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = normal_96k_12dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; if((sysPara->para.recommendedPrintSpeed == 1) && (sysPara->para.upDownInverse)){ adj_dac_temp = normal_96k_12dot_adj_default_dac_HU[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = normal_96k_12dot_continue_default_dac_HU[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = normal_96k_12dot_full_default_dac_HU[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if(sysPara->para.recommendedPrintSpeed == 1){ adj_dac_temp = normal_96k_12dot_adj_default_dac_H[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = normal_96k_12dot_continue_default_dac_H[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = normal_96k_12dot_full_default_dac_H[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if((sysPara->para.recommendedPrintSpeed == 2) && (sysPara->para.upDownInverse)){ adj_dac_temp = normal_96k_12dot_adj_default_dac_U[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = normal_96k_12dot_continue_default_dac_U[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = normal_96k_12dot_full_default_dac_U[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } } else if (sysPara->para.printRowDelay == 2) { float adj_dac_temp = slow1_96k_12dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = slow1_96k_12dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = slow1_96k_12dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } } if ((sysPara->para.oscillatoFreq == 3) && (i < 5) && sysPara->para.alterPrint.enable) { // 128K if (sysPara->para.printRowDelay == 0) { float adj_dac_temp = fast_128k_5dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = fast_128k_5dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = fast_128k_5dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if (sysPara->para.printRowDelay == 1) { float adj_dac_temp = normal_128k_5dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = normal_128k_5dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = normal_128k_5dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if (sysPara->para.printRowDelay == 2) { // float adj_dac_temp = slow1_128k_9dot_adj_default_dac[i] * DAC_RADIO; // DACArray[i] = adj_dac_temp; // float continue_dac_temp = slow1_128k_9dot_continue_default_dac[i] * DAC_RADIO; // notGapDACArray[i] = continue_dac_temp; // float full_dac_temp = slow1_128k_9dot_full_default_dac[i] * DAC_RADIO; // fullColDACArray[i] = full_dac_temp; } } } } else if (sysPara->status.currPrintRow <= 16) { for(int i = 0; i < sysPara->status.currPrintRow; i++) { if (sysPara->para.oscillatoFreq == 0) { // 64K if ((sysPara->para.printRowDelay == 0) && (i < 7) && sysPara->para.alterPrint.enable) {//交替 float adj_dac_temp = fast_64k_7dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = fast_64k_7dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = fast_64k_7dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if (sysPara->para.printRowDelay == 1) { float adj_dac_temp = normal_64k_16dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = normal_64k_16dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = normal_64k_16dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; sysPara->voltePara.pixel_para_table[0] = 20; sysPara->voltePara.pixel_para_table[1] = 20; sysPara->voltePara.pixel_para_table[2] = 30; sysPara->voltePara.pixel_para_table[3] = 30; sysPara->voltePara.pixel_para_table[4] = 10; } else if (sysPara->para.printRowDelay == 2) { float adj_dac_temp = slow1_64k_16dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = slow1_64k_16dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = slow1_64k_16dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } } else if (sysPara->para.oscillatoFreq == 2) { // 96K if ((sysPara->para.printRowDelay == 0) && (i < 7) && sysPara->para.alterPrint.enable) {//交替 float adj_dac_temp = fast_96k_7dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = fast_96k_7dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = fast_96k_7dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if ((sysPara->para.printRowDelay == 1) && (i < 7) && sysPara->para.alterPrint.enable) {//交替 float adj_dac_temp = normal_96k_7dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = normal_96k_7dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = normal_96k_7dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if ((sysPara->para.printRowDelay == 2) && (i < 7) && sysPara->para.alterPrint.enable) {//交替 float adj_dac_temp = slow1_96k_7dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = slow1_96k_7dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = slow1_96k_7dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if (sysPara->para.printRowDelay == 1) { float adj_dac_temp = normal_96k_16dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = normal_96k_16dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = normal_96k_16dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; if(sysPara->para.recommendedPrintSpeed == 1){ adj_dac_temp = normal_96k_16dot_adj_default_dac_H[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = normal_96k_16dot_continue_default_dac_H[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = normal_96k_16dot_full_default_dac_H[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } // sysPara->voltePara.pixel_para_table[4] = 38; } else if (sysPara->para.printRowDelay == 2) { float adj_dac_temp = slow1_96k_16dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = slow1_96k_16dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = slow1_96k_16dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } } if ((sysPara->para.oscillatoFreq == 3) && (i < 7) && sysPara->para.alterPrint.enable) { // 128K if (sysPara->para.printRowDelay == 0) { float adj_dac_temp = fast_128k_7dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = fast_128k_7dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = fast_128k_7dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; sysPara->voltePara.pixel_para_table[0] = 15; sysPara->voltePara.pixel_para_table[1] = 15; sysPara->voltePara.pixel_para_table[2] = 15; sysPara->voltePara.pixel_para_table[3] = 15; sysPara->voltePara.pixel_para_table[4] = 10; } else if (sysPara->para.printRowDelay == 1) { float adj_dac_temp = normal_128k_7dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = normal_128k_7dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = normal_128k_7dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; sysPara->voltePara.pixel_para_table[0] = 15; sysPara->voltePara.pixel_para_table[1] = 15; sysPara->voltePara.pixel_para_table[2] = 15; sysPara->voltePara.pixel_para_table[3] = 15; sysPara->voltePara.pixel_para_table[4] = 10; } else if (sysPara->para.printRowDelay == 2) { // float adj_dac_temp = slow1_128k_9dot_adj_default_dac[i] * DAC_RADIO; // DACArray[i] = adj_dac_temp; // float continue_dac_temp = slow1_128k_9dot_continue_default_dac[i] * DAC_RADIO; // notGapDACArray[i] = continue_dac_temp; // float full_dac_temp = slow1_128k_9dot_full_default_dac[i] * DAC_RADIO; // fullColDACArray[i] = full_dac_temp; } } } } else if (sysPara->status.currPrintRow <= 24) { for(int i = 0; i < sysPara->status.currPrintRow; i++) { if (sysPara->para.oscillatoFreq == 0) { // 64K if ((sysPara->para.printRowDelay == 0) && (i < 9) && sysPara->para.alterPrint.enable) {//交替 float adj_dac_temp = fast_64k_9dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = fast_64k_9dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = fast_64k_9dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if (sysPara->para.printRowDelay == 1) { float adj_dac_temp = normal_64k_24dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = normal_64k_24dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = normal_64k_24dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if (sysPara->para.printRowDelay == 2) { float adj_dac_temp = slow1_64k_24dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = slow1_64k_24dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = slow1_64k_24dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } } else if (sysPara->para.oscillatoFreq == 2) { // 96K if ((sysPara->para.printRowDelay == 0) && (i < 9) && sysPara->para.alterPrint.enable) {//交替 float adj_dac_temp = fast_96k_9dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = fast_96k_9dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = fast_96k_9dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; // sysPara->voltePara.pixel_para_table[0] = 20; // sysPara->voltePara.pixel_para_table[1] = 20; // sysPara->voltePara.pixel_para_table[2] = 15; // sysPara->voltePara.pixel_para_table[3] = 15; // sysPara->voltePara.pixel_para_table[4] = 15; } else if ((sysPara->para.printRowDelay == 1) && (i < 9) && sysPara->para.alterPrint.enable) {//交替 float adj_dac_temp = normal_96k_9dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = normal_96k_9dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = normal_96k_9dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; // sysPara->voltePara.pixel_para_table[0] = 20; // sysPara->voltePara.pixel_para_table[1] = 20; // sysPara->voltePara.pixel_para_table[2] = 30; // sysPara->voltePara.pixel_para_table[3] = 30; // sysPara->voltePara.pixel_para_table[4] = 10; } else if ((sysPara->para.printRowDelay == 2) && (i < 9) && sysPara->para.alterPrint.enable) {//交替 float adj_dac_temp = slow1_96k_9dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = slow1_96k_9dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = slow1_96k_9dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; // sysPara->voltePara.pixel_para_table[0] = 20; // sysPara->voltePara.pixel_para_table[1] = 20; // sysPara->voltePara.pixel_para_table[2] = 30; // sysPara->voltePara.pixel_para_table[3] = 30; // sysPara->voltePara.pixel_para_table[4] = 10; } else if (sysPara->para.printRowDelay == 2) { float adj_dac_temp = slow1_96k_24dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = slow1_96k_24dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = slow1_96k_24dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } } if ((sysPara->para.oscillatoFreq == 3) && (i < 9) && sysPara->para.alterPrint.enable) { // 128K if (sysPara->para.printRowDelay == 0) { float adj_dac_temp = fast_128k_9dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = fast_128k_9dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = fast_128k_9dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; sysPara->voltePara.pixel_para_table[0] = 15; sysPara->voltePara.pixel_para_table[1] = 15; sysPara->voltePara.pixel_para_table[2] = 15; sysPara->voltePara.pixel_para_table[3] = 15; sysPara->voltePara.pixel_para_table[4] = 10; } else if (sysPara->para.printRowDelay == 1) { float adj_dac_temp = normal_128k_9dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = normal_128k_9dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = normal_128k_9dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; sysPara->voltePara.pixel_para_table[0] = 15; sysPara->voltePara.pixel_para_table[1] = 15; sysPara->voltePara.pixel_para_table[2] = 15; sysPara->voltePara.pixel_para_table[3] = 15; sysPara->voltePara.pixel_para_table[4] = 10; } else if (sysPara->para.printRowDelay == 2) { // float adj_dac_temp = slow1_128k_9dot_adj_default_dac[i] * DAC_RADIO; // DACArray[i] = adj_dac_temp; // float continue_dac_temp = slow1_128k_9dot_continue_default_dac[i] * DAC_RADIO; // notGapDACArray[i] = continue_dac_temp; // float full_dac_temp = slow1_128k_9dot_full_default_dac[i] * DAC_RADIO; // fullColDACArray[i] = full_dac_temp; } } } } else if (sysPara->status.currPrintRow <= 32) { for(int i = 0; i < sysPara->status.currPrintRow; i++){ if (sysPara->para.oscillatoFreq == 2) { if ((sysPara->para.printRowDelay == 0) && (i <= 12) && sysPara->para.alterPrint.enable) {//交替 float adj_dac_temp = fast_96k_12dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = fast_96k_12dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = fast_96k_12dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; if((sysPara->para.recommendedPrintSpeed == 1) && (sysPara->para.upDownInverse)){ adj_dac_temp = fast_96k_12dot_adj_default_dac_HU[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = fast_96k_12dot_continue_default_dac_HU[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = fast_96k_12dot_full_default_dac_HU[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if(sysPara->para.recommendedPrintSpeed == 1){ adj_dac_temp = fast_96k_12dot_adj_default_dac_H[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = fast_96k_12dot_continue_default_dac_H[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = fast_96k_12dot_full_default_dac_H[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if(sysPara->para.upDownInverse){ adj_dac_temp = fast_96k_12dot_adj_default_dac_U[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = fast_96k_12dot_continue_default_dac_U[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = fast_96k_12dot_full_default_dac_U[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } if((sysPara->para.recommendedPrintSpeed == 2) && (sysPara->para.upDownInverse)){ adj_dac_temp = fast_96k_12dot_adj_default_dac_UD[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = fast_96k_12dot_continue_default_dac_UD[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = fast_96k_12dot_full_default_dac_UD[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } } else if ((sysPara->para.printRowDelay == 1) && (i <= 12) && sysPara->para.alterPrint.enable) {//交替 float adj_dac_temp = normal_96k_12dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = normal_96k_12dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = normal_96k_12dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; if((sysPara->para.recommendedPrintSpeed == 1) && (sysPara->para.upDownInverse)){ adj_dac_temp = normal_96k_12dot_adj_default_dac_HU[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = normal_96k_12dot_continue_default_dac_HU[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = normal_96k_12dot_full_default_dac_HU[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if(sysPara->para.recommendedPrintSpeed == 1){ adj_dac_temp = normal_96k_12dot_adj_default_dac_H[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = normal_96k_12dot_continue_default_dac_H[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = normal_96k_12dot_full_default_dac_H[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } else if((sysPara->para.recommendedPrintSpeed == 2) && (sysPara->para.upDownInverse)){ adj_dac_temp = normal_96k_12dot_adj_default_dac_U[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; continue_dac_temp = normal_96k_12dot_continue_default_dac_U[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; full_dac_temp = normal_96k_12dot_full_default_dac_U[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } } else if ((sysPara->para.printRowDelay == 2) && (i <= 12) && sysPara->para.alterPrint.enable) {//交替 float adj_dac_temp = slow1_96k_12dot_adj_default_dac[i] * DAC_RADIO; DACArray[i] = adj_dac_temp; float continue_dac_temp = slow1_96k_12dot_continue_default_dac[i] * DAC_RADIO; notGapDACArray[i] = continue_dac_temp; float full_dac_temp = slow1_96k_12dot_full_default_dac[i] * DAC_RADIO; fullColDACArray[i] = full_dac_temp; } sysPara->voltePara.pixel_para_table[0] = 30; sysPara->voltePara.pixel_para_table[1] = 15; sysPara->voltePara.pixel_para_table[2] = 15; sysPara->voltePara.pixel_para_table[3] = 15; sysPara->voltePara.pixel_para_table[4] = 25; } } } } /* sysPara->para.FullColFixVal == 1 */ #endif #ifdef FXCHG if(sysPara->para.alterPrint.enable) { for(int i = 0; i < sysPara->status.currPrintRow/2+1 && (i+sysPara->status.currPrintRow/2+1<40); i++) { DACArray[i+sysPara->status.currPrintRow/2+1] =(i < sysPara->status.currPrintRow )?DACArray[i]:0; } } #endif } else { // "Vol 1167 6984 13909 19726 25543 26928 " 1167 1491 1815 2139 2463 2787 3111 int DacVolRang=printVerticalTop-printVerticalButtom; int DacRateRang=0; for(int i = 1; i < ((sysPara->para.alterPrint.enable)?sysPara->status.currAlterPrintRow :sysPara->status.currPrintRow); i++) DacRateRang+=sysPara->para.adjVolDacRate[i]; if(DacRateRang<5) DacRateRang=5*sysPara->status.currPrintRow; // //QString strv="Vol\n"; /* ===0 */ if(!sysPara->para.scanInverse) DACArray[0]=printVerticalButtom; else DACArray[0]=printVerticalTop; if(DACArray[0] >= pointAdjustVoltagePos) DACArray[0] += sysPara->para.PointVoltageAdjustValue; /* 1 -- n */ for(int i = 1; i < ((sysPara->para.alterPrint.enable)?sysPara->status.currAlterPrintRow :sysPara->status.currPrintRow); i++) { if(!sysPara->para.scanInverse) DACArray[i] = DACArray[i-1]+ sysPara->para.adjVolDacRate[i] *DacVolRang/DacRateRang; else DACArray[i] = DACArray[i-1] - sysPara->para.adjVolDacRate[i] *DacVolRang/DacRateRang; if(DACArray[i] >= pointAdjustVoltagePos) DACArray[i] += sysPara->para.PointVoltageAdjustValue; } #ifdef FXCHG if(sysPara->para.alterPrint.enable) { for(int i = 0; i < sysPara->status.currPrintRow/2+1 && (i+sysPara->status.currPrintRow/2+1<40); i++) { DACArray[i+sysPara->status.currPrintRow/2+1] =(i < sysPara->status.currPrintRow )?DACArray[i]:0; } } #endif } unsigned short fast_128k_7dot_dac[]={ 0, 0, 0, 0, 0, 0, 0, 0, 0, 900, 0, 0, 0, 0, 0, 0, 0, 0, 0,1050, 0, 0, 0, 0, 0, 0, 0, 920,1240, 0, 0, 0, 0, 0, 0, 0, 0, 0,1240, 0, 0, 0, 0, 0, 0, 940, 0,1350, 0, 0, 0, 0, 0, 0, 0,1050,1400, 0, 0, 0, 0, 0, 0, 950,1280,1460, 0, 0, 0, 0, 0, 0, 0, 0, 0,1380, 0, 0, 0, 0, 0, 920, 0, 0,1510, 0, 0, 0, 0, 0, 0,1050, 0,1510, 0, 0, 0, 0, 0, 950,1280, 0,1600, 0, 0, 0, 0, 0, 0, 0,1220,1600, 0, 0, 0, 0, 0, 940, 0,1380,1600, 0, 0, 0, 0, 0, 0,1050,1400,1600, 0, 0, 0, 0, 0, 950,1290,1490,1630, 0, 0, 0, 0, 0, 0, 0, 0, 0,1550, 0, 0, 0, 0, 950, 0, 0, 0,1670, 0, 0, 0, 0, 0,1050, 0, 0,1700, 0, 0, 0, 0, 950,1280, 0, 0,1730, 0, 0, 0, 0, 0, 0,1240, 0,1730, 0, 0, 0, 0, // 950, 0,1400, 0,1760, 0, 0, 0, 0, // 0,1050,1400, 0,1770, 0, 0, 0, 0, // 950,1290,1490, 0,1770, 0, 0, 0, 0, // 0, 0, 0,1370,1770, 0, 0, 0, 0, // 950, 0, 0,1540,1820, 0, 0, 0, 0, // 0,1070, 0,1560,1820, 0, 0, 0, 0, // 940,1280, 0,1620,1820, 0, 0, 0, 0, // 0, 0,1260,1640,1820, 0, 0, 0, 0, // 950, 0,1400,1640,1820, 0, 0, 0, 0, // 0,1070,1400,1640,1820, 0, 0, 0, 0, 940, 0,1400, 1,1600, 0, 0, 0, 0, 0,1050,1400, 1,1600, 0, 0, 0, 0, 930,1280,1480, 1,1600, 0, 0, 0, 0, 0, 0, 0,5460,1600, 0, 0, 0, 0, 950, 0, 0,5626,1620, 0, 0, 0, 0, 0,1070, 0,5626,1620, 0, 0, 0, 0, 940,1280, 0,5696,1620, 0, 0, 0, 0, 0, 0,1260,5706,1620, 0, 0, 0, 0, 950, 0,1400,5746,1620, 0, 0, 0, 0, 0,1070,1440,5746,1620, 0, 0, 0, 0, // 950,1290,1490,1700,1840, 0, 0, 0, 0, // 950,1290,1490,1680,1800, 0, 0, 0, 0, // 0, 0, 0, 0, 0,1720, 0, 0, 0, // 940, 0, 0, 0, 0,1830, 0, 0, 0, // 0,1050, 0, 0, 0,1840, 0, 0, 0, // 940,1280, 0, 0, 0,1880, 0, 0, 0, // 0, 0,1240, 0, 0,1880, 0, 0, 0, // 940, 0,1390, 0, 0,1920, 0, 0, 0, // 0,1070,1420, 0, 0,1920, 0, 0, 0, // 950,1280,1480, 0, 0,1940, 0, 0, 0, // 0, 0, 0,1430, 0,1940, 0, 0, 0, 950,1290,1480,5746,1620, 0, 0, 0, 0, 0, 0, 0, 0, 0,1700, 0, 0, 0, 940, 0, 0, 0, 0,1830, 0, 0, 0, 0,1050, 0, 0, 0,1840, 0, 0, 0, 940,1260, 0, 0, 0,1760, 0, 0, 0, 0, 0,1240, 0, 0,1880, 0, 0, 0, 940, 0,1380, 0, 1,1780, 0, 0, 0, 0,1060,1400, 0, 1,1780, 0, 0, 0, 940,1260,1440, 0, 1,1780, 0, 0, 0, 0, 0, 0,1400, 1,1780, 0, 0, 0, // 940, 0, 0,1560, 0,1970, 0, 0, 0, // 0,1060, 0,1580, 0,1970, 0, 0, 0, // 950,1280, 0,1640, 0,1970, 0, 0, 0, // 0, 0,1240,1640, 0,1970, 0, 0, 0, // 950, 0,1400,1650, 0,1970, 0, 0, 0, // 0,1070,1420,1650, 0,1970, 0, 0, 0, // 950,1290,1490,1690, 0,1970, 0, 0, 0, // 0, 0, 0, 0,1560,1970, 0, 0, 0, // 940, 0, 0, 0,1710,2000, 0, 0, 0, // 0,1060, 0, 0,1710,1990, 0, 0, 0, 940, 0, 0,1500, 1,1780, 0, 0, 0, 0,1060, 0,1540, 1,1780, 0, 0, 0, 940,1280, 0,1600, 1,1780, 0, 0, 0, 0, 0,1240,1600, 1,1780, 0, 0, 0, 940, 0,1400,1640, 1,1780, 0, 0, 0, 0,1060,1430,1640, 1,1780, 0, 0, 0, 940,1260,1480,1660, 1,1780, 0, 0, 0, 0, 0, 0, 0,5646,1780, 0, 0, 0, 940, 0, 0, 0,5796,1800, 0, 0, 0, 0,1060, 0, 0,5796,1800, 0, 0, 0, // 940,1280, 0, 0,1790,2020, 0, 0, 0, // 0, 0,1240, 0,1790,2020, 0, 0, 0, // 950, 0,1400, 0,1790,2000, 0, 0, 0, // 0,1060,1420, 0,1810,2000, 0, 0, 0, // 950,1280,1480, 0,1820,2000, 0, 0, 0, // 0, 0, 0,1400,1810,2020, 0, 0, 0, // 940, 0, 0,1600,1860,2020, 0, 0, 0, // 0,1050, 0,1600,1860,2020, 0, 0, 0, // 950,1280, 0,1660,1860,2020, 0, 0, 0, // 0, 0,1290,1660,1860,2020, 0, 0, 0, 940,1260, 0, 0,5856,1800, 0, 0, 0, 0, 0,1240, 0,5856,1800, 0, 0, 0, 940, 0,1400, 0,5866,1800, 0, 0, 0, 0,1060,1420, 0,5866,1800, 0, 0, 0, 940,1280,1480, 0,5876,1800, 0, 0, 0, 0, 0, 0,1390,5876,1800, 0, 0, 0, 940, 0, 0,1540,5896,1800, 0, 0, 0, 0,1050, 0,1540,5896,1800, 0, 0, 0, 940,1260, 0,1660,5916,1800, 0, 0, 0, 0, 0,1240,1660,5916,1800, 0, 0, 0, // 950, 0,1410,1660,5940,1820, 0, 0, 0, // 0,1070,1440,1660,5940,1820, 0, 0, 0, // 950,1290,1510,1710,5960,1820, 0, 0, 0, // 0, 0, 0, 0, 0, 0,1830, 0, 0, // 930, 0, 0, 0, 0, 0,1830, 0, 0, // 0,1050, 0, 0, 0, 0,1950, 0, 0, // 940,1280, 0, 0, 0, 0,1980, 0, 0, // 0, 0,1240, 0, 0, 0,1980, 0, 0, // 940, 0,1380, 0, 0, 0,2000, 0, 0, // 0,1060,1420, 0, 0, 0,2000, 0, 0, 950, 0,1400,1670,5926,1800, 0, 0, 0, 0,1060,1420,1670,5926,1800, 0, 0, 0, 950,1260,1460,1670,5926,1800, 0, 0, 0, 0, 0, 0, 0, 0, 0,1830, 0, 0, 930, 0, 0, 0, 0, 0,1830, 0, 0, 0,1050, 0, 0, 0, 0,1950, 0, 0, 940,1280, 0, 0, 0, 0,1980, 0, 0, 0, 0,1240, 0, 0, 0,1980, 0, 0, 940, 0,1380, 0, 0, 0,2000, 0, 0, 0,1060,1420, 0, 0, 0,2000, 0, 0, // 950,1280,1480, 0, 0, 0,2000, 0, 0, // 0, 0, 0,1390, 0, 0,2000, 0, 0, // 940, 0, 0,1530, 0, 0,2020, 0, 0, // 0,1060, 0,1550, 0, 0,2020, 0, 0, // 950,1280, 0,1630, 0, 0,2040, 0, 0, // 0, 0,1240,1620, 0, 0,2040, 0, 0, // 930, 0,1410,1660, 0, 0,2040, 0, 0, // 0,1070,1440,1660, 0, 0,2060, 0, 0, // 950,1290,1500,1680, 0, 0,2060, 0, 0, // 0, 0, 0, 0,1570, 1,1900, 0, 0, 940,1260,1440, 0, 0, 0,2000, 0, 0, 0, 0, 0,1390, 0, 0,2000, 0, 0, 940, 0, 0,1530, 0, 0,2000, 0, 0, 0,1060, 0,1540, 0, 0,2000, 0, 0, 940,1260, 0,1600, 0, 1,1870, 0, 0, 0, 0,1240,1620, 0, 0,2000, 0, 0, 940, 0,1410,1620, 0, 1,1900, 0, 0, 0,1060,1420,1620, 0, 1,1900, 0, 0, 940,1260,1460,1640, 0, 1,1900, 0, 0, 0, 0, 0, 0,1570, 1,1900, 0, 0, 950, 0, 0, 0,1700, 1,1900, 0, 0, 0,1060, 0, 0,1710, 1,1900, 0, 0, 940,1280, 0, 0,1750, 1,1900, 0, 0, 0, 0,1260, 0,1750, 1,1900, 0, 0, 940, 0,1400, 0,1770, 1,1900, 0, 0, 0,1060,1420, 0,1770, 1,1900, 0, 0, 950,1280,1480, 0,1810, 1,1900, 0, 0, 0, 0, 0,1400,1800, 1,1910, 0, 0, 950, 0, 0,1560,1830, 1,1920, 0, 0, 0,1060, 0,1580,1830, 1,1920, 0, 0, 940,1280, 0,1630,1830, 1,1920, 0, 0, 0, 0,1260,1630,1830, 1,1920, 0, 0, 950, 0,1420,1650,1840, 1,1920, 0, 0, 0,1070,1430,1650,1840, 1,1920, 0, 0, 950,1280,1480,1680,1850, 1,1920, 0, 0, 0, 0, 0, 0, 0,5776,1930, 0, 0, 940, 0, 0, 0, 0,5896,1930, 0, 0, 0,1070, 0, 0, 1,5816,1930, 0, 0, 950,1280, 0, 0, 1,5836,1930, 0, 0, 0, 0,1240, 0, 1,5836,1930, 0, 0, 950, 0,1380, 0, 1,5836,1930, 0, 0, 0,1070,1420, 0, 1,5836,1930, 0, 0, 950,1280,1480, 0, 1,5836,1930, 0, 0, 0, 0, 0,1480, 1,5876,1930, 0, 0, 940, 0, 0,1550, 1,5876,1930, 0, 0, 0,1070, 0,1550, 1,5876,1930, 0, 0, 940,1280, 0,1620, 1,5876,1930, 0, 0, 0, 0,1240,1620, 1,5876,1930, 0, 0, 940, 0,1380,1620, 1,5876,1930, 0, 0, 0,1070,1440,1660, 1,5876,1930, 0, 0, 950,1290,1490,1680, 1,1780,2080, 0, 0, 0, 0, 0, 0,5656,5876,1930, 0, 0, 950, 0, 0, 1,5676,5876,1930, 0, 0, 0,1070, 0, 1,5676,5876,1930, 0, 0, 940,1280, 0, 1,1580,6036,1930, 0, 0, 0, 0,1240, 1,1580,6036,1930, 0, 0, 940, 0,1400, 1,1580,6036,1930, 0, 0, 0,1060,1440, 1,1580,6036,1930, 0, 0, 950,1280,1480, 0,1780,6056,1930, 0, 0, 0, 0, 0,1420,1790,6056,1930, 0, 0, 950, 0, 1,1400,1770,6056,1930, 0, 0, 0,1070, 1,1400,1770,6056,1930, 0, 0, 950,1280, 0,1630,1850,6091,1940, 0, 0, 0, 0,1290,1650,1850,6091,1940, 0, 0, 950, 0,1400,1670,1850,6091,1940, 0, 0, 0,1100,1460,1670,1850,6091,1940, 0, 0, 960,1320,1570,1760,1980, 1,1940, 0, 0 }; unsigned short normal_128k_7dot_dac[]={ 0, 0, 0, 0, 0, 0, 0, 0, 0, 970, 0, 0, 0, 0, 0, 0, 0, 0, 0,1115, 0, 0, 0, 0, 0, 0, 0, 5066,1180, 0, 0, 0, 0, 0, 0, 0, 0, 0,1245, 0, 0, 0, 0, 0, 0, 970, 1,1310, 0, 0, 0, 0, 0, 0, 0,5211,1340, 0, 0, 0, 0, 0, 0, 5086,5296,1340, 0, 0, 0, 0, 0, 0, 0, 0, 0,1385, 0, 0, 0, 0, 0, 970, 1, 0,1430, 0, 0, 0, 0, 0, 0,1120, 1,1450, 0, 0, 0, 0, 0, 5076,1200, 1,1460, 0, 0, 0, 0, 0, 0, 0,5356,1490, 0, 0, 0, 0, 0, 980, 1,5416,1490, 0, 0, 0, 0, 0, 0,5256,5456,1480, 0, 0, 0, 0, 0, 5086,5316,5456,1480, 0, 0, 0, 0, 0, 0, 0, 0, 0,1535, 0, 0, 0, 0, 980, 1, 0, 0,1560, 0, 0, 0, 0, 0,1140, 1, 0,1580, 0, 0, 0, 0, 5076,1200, 1, 0,1580, 0, 0, 0, 0, 0, 0,1275, 1,1585, 0, 0, 0, 0, 980, 1,1310, 1,1585, 0, 0, 0, 0, 0,5246,1360, 1,1585, 0, 0, 0, 0, 5076,5296,1360, 1,1620, 0, 0, 0, 0, 0, 0, 0,5521,1645, 0, 0, 0, 0, 980, 1, 0,5546,1635, 0, 0, 0, 0, 0,1140, 1,5566,1635, 0, 0, 0, 0, 5076,1200, 1,5576,1635, 0, 0, 0, 0, 0, 0,5406,5626,1635, 0, 0, 0, 0, 980, 1,5436,5616,1635, 0, 0, 0, 0, 0,5276,5476,5596,1635, 0, 0, 0, 0, 5086,5316,5456,5596,1635, 0, 0, 0, 0, 0, 0, 0, 0, 0,1680, 0, 0, 0, 980, 1, 0, 0, 0,1700, 0, 0, 0, 0,1130, 1, 0, 0,1700, 0, 0, 0, 5076,1200, 1, 0, 0,1720, 0, 0, 0, 0, 0,1280, 1, 0,1720, 0, 0, 0, 980, 1,1315, 1, 0,1720, 0, 0, 0, 0,5236,1360, 1, 0,1740, 0, 0, 0, 5086,5296,1360, 1, 0,1750, 0, 0, 0, 0, 0, 0,1430, 1,1750, 0, 0, 0, 980, 1, 0,1460, 1,1750, 0, 0, 0, 0,1140, 1,1470, 1,1750, 0, 0, 0, 5076,1200, 1,1480, 1,1750, 0, 0, 0, 0, 0,5396,1500, 1,1760, 0, 0, 0, 980, 1,5426,1510, 1,1760, 0, 0, 0, 0,5256,5456,1510, 1,1760, 0, 0, 0, 5076,5316,5456,1510, 1,1770, 0, 0, 0, 0, 0, 0, 0,5666,1780, 0, 0, 0, 980, 1, 0, 0,5676,1780, 0, 0, 0, 0,1130, 1, 0,5686,1780, 0, 0, 0, 5076,1200, 1, 0,5696,1780, 0, 0, 0, 0, 0,1290, 1,5716,1780, 0, 0, 0, 980, 1,1330, 1,5756,1780, 0, 0, 0, 0,5236,1360, 1,5756,1780, 0, 0, 0, 5076,5296,1360, 1,5756,1780, 0, 0, 0, 0, 0, 0,5526,5746,1780, 0, 0, 0, 980, 1, 0,5556,5756,1780, 0, 0, 0, 0,1130, 1,5586,5756,1780, 0, 0, 0, 5076,1200, 1,5586,5756,1780, 0, 0, 0, 0, 0,5386,5601,5756,1780, 0, 0, 0, 980, 1,5436,5601,5756,1780, 0, 0, 0, 0,5246,5466,5601,5756,1780, 0, 0, 0, 5086,5306,5476,5601,5756,1780, 0, 0, 0, 0, 0, 0, 0, 0, 0,1810, 0, 0, 980, 1, 0, 0, 0, 0,1810, 0, 0, 0,1130, 1, 0, 0, 0,1840, 0, 0, 5076,1200, 1, 0, 0, 0,1840, 0, 0, 0, 0,1290, 1, 0, 0,1850, 0, 0, 980, 1,1330, 1, 0, 0,1850, 0, 0, 0,5231,1360, 1, 0, 0,1850, 0, 0, 5076,5296,1360, 1, 0, 0,1850, 0, 0, 0, 0, 0,1410, 1, 0,1850, 0, 0, 980, 1, 0,1440, 1, 0,1860, 0, 0, 0,1135, 1,1470, 1, 0,1860, 0, 0, 5076,1200, 1,1480, 1, 0,1870, 0, 0, 0, 0,5381,1505, 1, 0,1870, 0, 0, 980, 1,5416,1510, 1, 0,1870, 0, 0, 0,5236,5456,1510, 1, 0,1870, 0, 0, 5086,5296,5456,1510, 1, 0,1880, 0, 0, 0, 0, 0, 0,1550, 1,1880, 0, 0, 980, 1, 0, 0,1570, 1,1880, 0, 0, 0,1130, 1, 0,1590, 1,1880, 0, 0, 5076,1200, 1, 0,1610, 1,1890, 0, 0, 0, 0,1300, 1,1620, 1,1890, 0, 0, 980, 1,1330, 1,1620, 1,1890, 0, 0, 0,5236,1360, 1,1630, 1,1890, 0, 0, 5076,5296,1360, 1,1640, 1,1890, 0, 0, 0, 0, 0,5506,1640, 1,1900, 0, 0, 980, 1, 0,5546,1640, 1,1900, 0, 0, 0,1135, 1,5556,1640, 1,1900, 0, 0, 5076,1200, 1,5556,1640, 1,1900, 0, 0, 0, 0,5386,5596,1640, 1,1900, 0, 0, 980, 1,5436,5606,1650, 1,1910, 0, 0, 0,5226,5456,5606,1650, 1,1910, 0, 0, 5086,5306,5466,5606,1650, 1,1910, 0, 0, 0, 0, 0, 0, 0,5791,1910, 0, 0, 980, 1, 0, 0, 0,5816,1910, 0, 0, 0,1130, 1, 0, 0,5816,1910, 0, 0, 5076,1200, 1, 0, 0,5816,1910, 0, 0, 0, 0,1290, 1, 0,5816,1910, 0, 0, 990, 1,1320, 1, 0,5816,1910, 0, 0, 0,5226,1360, 1, 0,5836,1910, 0, 0, 5086,5306,1360, 1, 0,5836,1910, 0, 0, 0, 0, 0,1420, 1,5846,1910, 0, 0, 980, 1, 0,1450, 1,5846,1910, 0, 0, 0,1130, 1,1450, 1,5846,1910, 0, 0, 5076,1200, 1,1480, 1,5866,1910, 0, 0, 0, 0,5386,1480, 1,5866,1910, 0, 0, 980, 1,5426,1510, 1,5876,1920, 0, 0, 0,5236,5476,1510, 1,5886,1920, 0, 0, 5086,5306,5456,1510, 1,5886,1920, 0, 0, 0, 0, 0, 0,5641,5886,1920, 0, 0, 980, 1, 0, 0,5646,5886,1920, 0, 0, 0,1130, 1, 0,5676,5886,1920, 0, 0, 5076,1200, 1, 0,5696,5886,1920, 0, 0, 0, 0,1290, 1,5706,5896,1920, 0, 0, 980, 1,1310, 1,5706,5896,1920, 0, 0, 0,5226,1350, 1,5706,5896,1920, 0, 0, 5086,5306,1350, 1,5706,5896,1920, 0, 0, 0, 0, 0,5506,5736,5896,1920, 0, 0, 980, 1, 0,5526,5736,5896,1920, 0, 0, 0,1130, 1,5546,5736,5896,1920, 0, 0, 5076,1200, 1,5546,5736,5896,1920, 0, 0, 0, 0,5386,5586,5736,5896,1920, 0, 0, 980, 1,5406,5586,5736,5896,1920, 0, 0, 0,5226,5456,5606,5756,5896,1920, 0, 0, // 1000,1220,1360,1510,1660,1810,1940, 0, 0 5096,5316,5456,5606,5756,5906,1940, 0, 0 }; unsigned short fast_128k_9dot_dac[]={ 0, 0, 0, 0, 0, 0, 0, 0, 0, 950, 0, 0, 0, 0, 0, 0, 0, 0, 0,1070, 0, 0, 0, 0, 0, 0, 0, 970,1300, 0, 0, 0, 0, 0, 0, 0, 0, 0,1240, 0, 0, 0, 0, 0, 0, 970, 0,1410, 0, 0, 0, 0, 0, 0, 0,1090,1450, 0, 0, 0, 0, 0, 0, 970,1320,1500, 0, 0, 0, 0, 0, 0, 0, 0, 0,1440, 0, 0, 0, 0, 0, 970, 0, 0,1540, 0, 0, 0, 0, 0, 0,1090, 0,1560, 0, 0, 0, 0, 0, 970,1320, 0,1630, 0, 0, 0, 0, 0, 0, 0,1250,1630, 0, 0, 0, 0, 0, 970, 0,1430,1660, 0, 0, 0, 0, 0, 0,1090,1460,1660, 0, 0, 0, 0, 0, 990,1340,1540,1700, 0, 0, 0, 0, 0, 0, 0, 0, 0,1580, 0, 0, 0, 0, 970, 0, 0, 0,1700, 0, 0, 0, 0, 0,1090, 0, 0,1700, 0, 0, 0, 0, 970,1320, 0, 0,1770, 0, 0, 0, 0, 0, 0,1300, 0,1770, 0, 0, 0, 0, 970, 0,1430, 0,1770, 0, 0, 0, 0, 0,1090,1460, 0,1800, 0, 0, 0, 0, 990,1340,1540, 0,1830, 0, 0, 0, 0, 0, 0, 0,1440,1830, 0, 0, 0, 0, 970, 0, 0,1560,1830, 0, 0, 0, 0, 0,1090, 0,1590,1830, 0, 0, 0, 0, 990,1340, 0,1650,1840, 0, 0, 0, 0, 0, 0,1300,1680,1840, 0, 0, 0, 0, 990, 0,1440,1680,1840, 0, 0, 0, 0, 0,1120,1480,1680,1840, 0, 0, 0, 0, 990,1340,1540,1720,1860, 0, 0, 0, 0, 0, 0, 0, 0, 0,1720, 0, 0, 0, 970, 0, 0, 0, 0,1860, 0, 0, 0, 0,1090, 0, 0, 0,1860, 0, 0, 0, 990,1340, 0, 0, 0,1900, 0, 0, 0, 0, 0,1300, 0, 0,1900, 0, 0, 0, 990, 0,1430, 0, 0,1900, 0, 0, 0, 0,1090,1460, 0, 0,1920, 0, 0, 0, 990,1340,1540, 0, 0,1920, 0, 0, 0, 0, 0, 0,1440, 0,1920, 0, 0, 0, 990, 0, 0,1600, 0,1940, 0, 0, 0, 0,1120, 0,1600, 0,1940, 0, 0, 0, 990,1320, 0,1660, 0,1940, 0, 0, 0, 0, 0,1260,1660, 0,1960, 0, 0, 0, 990, 0,1460,1700, 0,1960, 0, 0, 0, 0,1120,1480,1700, 0,1980, 0, 0, 0, 990,1340,1540,1720, 0,1980, 0, 0, 0, 0, 0, 0, 0,1570,1980, 0, 0, 0, 990, 0, 0, 0,1710,2010, 0, 0, 0, 0,1120, 0, 0,1730,2010, 0, 0, 0, 990,1340, 0, 0,1800,2010, 0, 0, 0, 0, 0,1260, 0,1780,2010, 0, 0, 0, 990, 0,1460, 0,1820,2010, 0, 0, 0, 0,1120,1500, 0,1830,2010, 0, 0, 0, 990,1340,1540, 0,1850,2020, 0, 0, 0, 0, 0, 0,1480,1880,2020, 0, 0, 0, 990, 0, 0,1600,1880,2020, 0, 0, 0, 0,1120, 0,1620,1880,2020, 0, 0, 0, 990,1340, 0,1670,1880,2020, 0, 0, 0, 0, 0,1280,1670,1880,2020, 0, 0, 0, 990, 0,1440,1710,5976,1820, 0, 0, 0, 0,1120,1500,1740,5976,1820, 0, 0, 0, 990,1340,1540,1740,5976,1820, 0, 0, 0, 0, 0, 0, 0, 0, 0,1820, 0, 0, 970, 0, 0, 0, 0, 0,1960, 0, 0, 0,1120, 0, 0, 0, 0,1980, 0, 0, 990,1320, 0, 0, 0, 0,2020, 0, 0, 0, 0,1260, 0, 0, 0,2020, 0, 0, 990, 0,1440, 0, 0, 0,2060, 0, 0, 0,1120,1500, 0, 0, 0,2060, 0, 0, 990,1340,1540, 0, 0, 0,2060, 0, 0, 0, 0, 0,1480, 0, 0,2060, 0, 0, 990, 0, 0,1580, 0, 0,2080, 0, 0, 0,1120, 0,1620, 0, 0,2080, 0, 0, 990,1320, 0,1680, 0, 0,2080, 0, 0, 0, 0,1260,1680, 0, 0,2080, 0, 0, 990, 0,1480,1700, 0, 0,2100, 0, 0, 0,1120,1500,1700, 0, 0,2100, 0, 0, 990,1340,1540,1720, 0, 0,2100, 0, 0, 0, 0, 0, 0,1700, 1,1940, 0, 0, 990, 0, 0, 0,1740, 1,1940, 0, 0, 0,1120, 0, 0,1760, 1,1940, 0, 0, 990,1320, 0, 0,1780, 1,1940, 0, 0, 0, 0,1320, 0,1800, 1,1940, 0, 0, 990, 0,1480, 0,1830, 1,1940, 0, 0, 0,1120,1500, 0,1840, 1,1940, 0, 0, 990,1340,1540, 0,1860, 1,1940, 0, 0, 0, 0, 0,1440,1860, 1,1940, 0, 0, 990, 0, 0,1580,1860, 1,1940, 0, 0, 0,1120, 0,1600,1860, 1,1940, 0, 0, 990,1320, 0,1660,1860, 1,1940, 0, 0, 0, 0,1240,1660,1860, 1,1940, 0, 0, 990, 1,1320,1660,1860, 1,1940, 0, 0, 0,1120,1500,1660,1860, 1,1940, 0, 0, 990,1340,1540,1660,1860, 1,1940, 0, 0, 0, 0, 0, 0, 0,5776,1940, 0, 0, 990, 0, 0, 0, 0,5956,1940, 0, 0, 0,1120, 0, 0, 0,5956,1940, 0, 0, 990,1320, 0, 0, 0,5996,1940, 0, 0, 0, 0,1240, 0, 0,5996,1940, 0, 0, 990, 0,1440, 0, 0,5996,1940, 0, 0, 0,1120,1500, 0, 0,5996,1940, 0, 0, 990,1340,1540, 0, 0,5996,1940, 0, 0, 0, 0, 0,1440, 0,5996,1940, 0, 0, 990, 0, 0,1600, 0,5996,1940, 0, 0, 0,1120, 0,1630, 0,5996,1940, 0, 0, 990,1320, 0,1650, 0,5996,1940, 0, 0, 0, 0,1240,1660, 0,5996,1940, 0, 0, 990, 0,1460,1660, 0,5996,1940, 0, 0, 0,1120,1500,1680, 0,5996,1940, 0, 0, 990,1340,1540,1680, 0,5996,1940, 0, 0, 0, 0, 0, 0,5656,5876,1940, 0, 0, 990, 0, 0, 0,5676,5876,1940, 0, 0, 0,1120, 0, 0,5676,5876,1940, 0, 0, 990,1320, 0, 1,1580,6036,1940, 0, 0, 0, 0,1240, 1,1580,6036,1940, 0, 0, 990, 0,1460, 1,1580,6036,1940, 0, 0, 0,1120,1500, 1,1580,6036,1940, 0, 0, 990,1340,1540, 1,1600,6036,1940, 0, 0, 0, 0, 0,1420,1800,6056,1940, 0, 0, 990, 0, 1,1400,1700,6065,1940, 0, 0, 0,1120, 1,1460,1700,6065,1940, 0, 0, 990,1320, 1,1500,1700,6065,1940, 0, 0, 0, 0,1320,1660,1860,6091,1940, 0, 0, 990, 0,1400,1680,1860,6091,1940, 0, 0, 0,1120,1480,1680,1880,6091,1940, 0, 0, 990,1340,1540,1680,1880,6091,1940, 0, 0, 0, 0, 0, 0, 0, 0, 0,2000, 0, 990, 0, 0, 0, 0, 0, 0,2000, 0, 0,1120, 0, 0, 0, 0, 0,2000, 0, 990,1320, 0, 0, 0, 0, 0,2000, 0, 0, 0,1240, 0, 0, 0, 0,2000, 0, 990, 0,1440, 0, 0, 0, 0,2180, 0, 0,1120,1500, 0, 0, 0, 0,2180, 0, 990,1340,1540, 0, 0, 0, 0,2180, 0, 0, 0, 0,1400, 0, 0, 0,2180, 0, 990, 0, 0,1560, 0, 0, 0,2180, 0, 0,1120, 0,1600, 0, 0, 0,2180, 0, 990,1320, 0,1660, 0, 0, 0,2180, 0, 0, 0,1240,1680, 0, 0, 0,2180, 0, 990, 0,1440,1680, 0, 0, 0,2200, 0, 0,1120,1500,1680, 0, 0, 0,2200, 0, 990,1340,1540,1700, 0, 0, 0,2200, 0, 0, 0, 0, 0,1600, 0, 0,2200, 0, 990, 0, 0, 0,1720, 0, 0,2200, 0, 0,1120, 0, 0,1720, 0, 0,2200, 0, 990,1320, 0, 0,1740, 0, 0,2200, 0, 0, 0,1240, 0,1760, 0, 0,2200, 0, 990, 0,1480, 0,1780, 0, 0,2200, 0, 0,1120,1500, 0,1780, 0, 1,2040, 0, 990,1340,1540, 0,1820, 0, 1,2040, 0, 0, 0, 0,1420,1840, 0, 1,2040, 0, 990, 0, 0,1560,1860, 0, 1,2040, 0, 0,1120, 0,1600,1880, 0, 1,2040, 0, 990,1320, 0,1620,1900, 0, 1,2040, 0, 0, 0,1240,1660,1900, 0, 1,2040, 0, 990, 0,1440,1680,1900, 0, 1,2040, 0, 0,1120,1500,1700,1900, 0, 1,2040, 0, 990,1340,1540,1720,1900, 0, 1,2040, 0, 0, 0, 0, 0, 0,1720, 1,2040, 0, 990, 0, 0, 0, 0,1880, 1,2040, 0, 0,1120, 0, 0, 0,1880, 1,2040, 0, 990,1320, 0, 0, 0,1900, 1,2040, 0, 0, 0,1240, 0, 0,1900, 1,2040, 0, 990, 0,1480, 0, 0,1900, 1,2040, 0, 0,1120,1500, 0, 0,1900, 1,2040, 0, 990,1340,1540, 0, 0,1900, 1,2040, 0, 0, 0, 0,1400, 0,1980, 1,2040, 0, 990, 0, 0,1600, 0,1980, 1,2040, 0, 0,1120, 0,1600, 0,1980, 1,2040, 0, 990,1320, 0,1660, 0,1980, 1,2040, 0, 0, 0,1260,1660, 0,1980, 1,2040, 0, 990, 0,1440,1700, 0,1980, 1,2040, 0, 0,1120,1500,1700, 0,1980, 1,2040, 0, 990,1340,1540,1720, 0,1980, 1,2040, 0, 0, 0, 0, 0,1600,2040, 1,2040, 0, 990, 0, 0, 0,1740,2040, 1,2080, 0, 0,1120, 0, 0,1800,2040, 1,2080, 0, 990,1320, 0, 0,1800,2040, 1,2080, 0, 0, 0,1260, 0,1800,2040, 1,2080, 0, 990, 0,1440, 0,1880,2040, 1,2080, 0, 0,1120,1500, 0,1880,2040, 1,2080, 0, 990,1340,1540, 0,1880,2040, 1,2080, 0, 0, 0, 0,1440,1880,2040, 1,2080, 0, 990, 0, 0,1620,1880,2040, 1,2080, 0, 0,1120, 0,1640,1880,2040, 1,2080, 0, 990,1320, 0,1660,1880,2040, 1,2080, 0, 0, 0,1260,1680,1880,2040, 1,2080, 0, 990, 0,1460,1680,1880,2040, 1,2080, 0, 0,1120,1500,1680,1880,2040, 1,2080, 0, 990,1340,1540,1680,1880,2040, 1,2080, 0, 0, 0, 0, 0, 0, 0,5900,2080, 0, 990, 0, 0, 0, 0, 0,6040,2080, 0, 0,1120, 0, 0, 0, 0,6040,2080, 0, 990,1320, 0, 0, 0, 0,6040,2080, 0, 0, 0,1260, 0, 0, 0,6040,2080, 0, 990, 0,1440, 0, 0, 0,6040,2080, 0, 0,1120,1500, 0, 0, 0,6040,2080, 0, 990,1340,1540, 0, 0, 0,6040,2080, 0, 0, 0, 0,1440, 0, 0,6040,2080, 0, 990, 0, 0,1580, 0, 1,5960,2120, 0, 0,1120, 0,1600, 0, 1,5960,2120, 0, 990,1320, 0,1640, 0, 1,5960,2120, 0, 0, 0,1260,1660, 0, 1,5960,2120, 0, 990, 0,1440,1660, 0, 1,6020,2120, 0, 0,1120,1500,1700, 0, 1,6020,2120, 0, 990,1340,1540,1720, 0, 1,6020,2120, 0, 0, 0, 0, 0,1600, 1,6020,2120, 0, 990, 0, 0, 0,1740, 1,6020,2120, 0, 0,1120, 0, 0,1760, 1,6020,2120, 0, 990,1320, 0, 0,1800, 1,6020,2120, 0, 0, 0,1260, 0,1800, 1,6020,2120, 0, 990, 0,1440, 0,1800, 1,6020,2120, 0, 0,1120,1500, 0,1800, 1,6020,2120, 0, 990,1340,1540, 0,1800, 1,6020,2120, 0, 0, 0, 0,1400,1820, 1,6020,2120, 0, 990, 0, 0,1560,1860, 1,6020,2120, 0, 0,1120, 0,1580,1860, 1,6020,2120, 0, 990,1320, 0,1620,1860, 1,6020,2120, 0, 0, 0,1260,1660,1860, 1,6020,2120, 0, 990, 0,1440,5800,1860, 1,6020,2120, 0, 0,1120,1500,5800,1860, 1,6020,2120, 0, 990,1340,1540,5820,1860, 1,6020,2120, 0, 0, 0, 0, 0, 0,5790,6020,2120, 0, 990, 0, 0, 0, 0,5860,6020,2120, 0, 0,1120, 0, 0, 0,5880,6020,2120, 0, 990,1320, 0, 0, 0,5900,6020,2120, 0, 0, 0,1260, 0, 0,5920,6020,2120, 0, 990, 0,1440, 0, 0,5940,6020,2120, 0, 0,1120,1500, 0, 0,5960,6020,2120, 0, 990,1340,1540, 0, 0,5980,6020,2120, 0, 0, 0, 0,1380, 1,5840,6020,2120, 0, 990, 0, 0,1540, 1,5840,6020,2120, 0, 0,1120, 0,1560, 1,5840,6020,2120, 0, 990,1320, 0,1580, 1,5840,6020,2120, 0, 0, 0,1260,1660, 1,5840,6020,2120, 0, 990, 0,1420,1660, 1,5840,6020,2120, 0, 0,1120,1500,1700, 1,5840,6020,2120, 0, 990,1340,1540,1720, 1,5840,6020,2120, 0, 0, 0, 0, 0,5600,5840,6020,2120, 0, 990, 0, 0, 1,5680,5900,6060,2120, 0, 0,1120, 0, 1,5680,5900,6060,2120, 0, 990,1320, 0, 1,5680,5900,6060,2120, 0, 0, 0,1260, 1,5680,5900,6060,2120, 0, 990, 0,1440, 1,5680,5900,6060,2120, 0, 0,1120,1500, 1,5680,5900,6060,2120, 0, 990,1340,1540, 1,5680,5900,6060,2120, 0, 0, 0, 0,5520,5760,5900,6060,2120, 0, 990, 0, 0,5640,5780,5900,6100,2120, 0, 0,1120, 0,5680,5780,5900,6100,2120, 0, 990,1320, 0,5680,5780,5900,6100,2120, 0, 0, 0,5430,5680,5780,5900,6100,2120, 0, 990, 1,5460,5680,5780,5900,6100,2120, 0, 0,5216,5460,5680,5780,5900,6100,2120, 0, 990,1360,1640,1860,2020,2180, 1,2100, 0, 0, 0, 0, 0, 0, 0, 0, 0,2100, 990, 0, 0, 0, 0, 0, 0, 0,2100, 0,1120, 0, 0, 0, 0, 0, 0,2220, 990,1320, 0, 0, 0, 0, 0, 0,2260, 0, 0,1260, 0, 0, 0, 0, 0,2260, 990, 0,1440, 0, 0, 0, 0, 0,2300, 0,1120,1500, 0, 0, 0, 0, 0,2300, 990,1340,1540, 0, 0, 0, 0, 0,2300, 0, 0, 0,1420, 0, 0, 0, 0,2300, 990, 0, 0,1580, 0, 0, 0, 0,2300, 0,1120, 0,1600, 0, 0, 0, 0,2300, 990,1320, 0,1660, 0, 0, 0, 1,2200, 0, 0,1260,1660, 0, 0, 0, 1,2200, 990, 0,1440,1680, 0, 0, 0, 1,2200, 0,1120,1500,1700, 0, 0, 0, 1,2200, 990,1340,1540,1720, 0, 0, 0, 1,2200, 0, 0, 0, 0,1480, 0, 0, 1,2200, 990, 0, 0, 0,1740, 0, 0, 1,2200, 0,1120, 0, 0,1760, 0, 0, 1,2200, 990,1320, 0, 0,1780, 0, 0, 1,2200, 0, 0,1260, 0,1800, 0, 0, 1,2200, 990, 0,1440, 0,1820, 0, 0, 1,2200, 0,1120,1500, 0,1840, 0, 0, 1,2200, 990,1340,1540, 0,1860, 0, 0, 1,2200, 0, 0, 0,1440,1860, 0, 0, 1,2200, 990, 0, 0,1620,1880, 0, 0, 1,2200, 0,1120, 0,1620,1880, 0, 0, 1,2200, 990,1320, 0,1660,1880, 0, 0, 1,2200, 0, 0,1260,1680,1880, 0, 0, 1,2200, 990, 0,1460,1700,1880, 0, 0, 1,2200, 0,1120,1500,1720,1880, 0, 0, 1,2200, 990,1340,1540,1740,1880, 0, 0, 1,2200, 0, 0, 0, 0, 0,1740, 0, 1,2200, 990, 0, 0, 0, 0,1860, 0, 1,2200, 0,1120, 0, 0, 0,1860, 0, 1,2200, 990,1320, 0, 0, 0,1880, 0, 1,2200, 0, 0,1260, 0, 0,1880, 0, 1,2200, 990, 0,1440, 0, 0,1960, 0, 1,2200, 0,1120,1500, 0, 0,1960, 0, 1,2200, 990,1340,1540, 0, 0,1960, 0, 1,2200, 0, 0, 0,1440, 0,1960, 0, 1,2200, 990, 0, 0,1580, 0,1980, 0, 1,2200, 0,1120, 0,1600, 0,1980, 0, 1,2200, 990,1320, 0,1660, 0,1980, 0, 1,2200, 0, 0,1260,1660, 0,1980, 0, 1,2200, 990, 0,1440,1680, 0,2020, 0, 1,2200, 0,1120,1500,1700, 0,2020, 0, 1,2200, 990,1340,1540,1720, 0,2020, 0, 1,2200, 0, 0, 0, 0,1580,2040, 0, 1,2200, 990, 0, 0, 0,5820,1860, 0, 1,2200, 0,1120, 0, 0,5860,1860, 0, 1,2200, 990,1320, 0, 0,5880,1860, 0, 1,2200, 0, 0,1260, 0,5900,1860, 0, 1,2200, 990, 0,1440, 0,5920,1860, 0, 1,2200, 0,1120,1500, 0,5920,1860, 0, 1,2200, 990,1340,1540, 0,5920,1860, 0, 1,2200, 0, 0, 0,1400,5940,1860, 0, 1,2200, 990, 0, 0,1600,5940,1860, 0, 1,2200, 0,1120, 0,1620,5940,1860, 0, 1,2200, 990,1320, 0,1640,5940,1860, 0, 1,2200, 0, 0,1260,1660,5960,1860, 0, 1,2200, 990, 0,1420,1680,5960,1860, 0, 1,2200, 0,1120,1500,1700,5960,1860, 0, 1,2200, 990,1340,1540,1720,5960,1860, 0, 1,2200, 0, 0, 0, 0, 0, 0,1880, 1,2200, 990, 0, 0, 0, 0, 0,2020, 1,2200, 0,1120, 0, 0, 0, 0,2020, 1,2200, 990,1320, 0, 0, 0, 0,2060, 1,2200, 0, 0,1260, 0, 0, 0,2060, 1,2200, 990, 0,1440, 0, 0, 0,2080, 1,2200, 0,1120,1500, 0, 0, 0,2080, 1,2200, 990,1340,1540, 0, 0, 0,2080, 1,2200, 0, 0, 0,1440, 0, 0,2080, 1,2200, 990, 0, 0,1580, 0, 0,2080, 1,2200, 0,1120, 0,1620, 0, 0,2080, 1,2200, 990,1320, 0,1640, 0, 0,2080, 1,2200, 0, 0,1260,1660, 0, 0,2080, 1,2200, 990, 0,1440,1680, 0, 0,2120, 1,2200, 0,1120,1500,1700, 0, 0,2120, 1,2200, 990,1340,1540,1720, 0, 0,2120, 1,2200, 0, 0, 0, 0,1600, 0,2120, 1,2200, 990, 0, 0, 0,1800, 0,2160, 1,2200, 0,1120, 0, 0,1820, 0,2160, 1,2200, 990,1320, 0, 0,1860, 0,2160, 1,2200, 0, 0,1260, 0,1860, 0,2160, 1,2200, 990, 0,1460, 0,1860, 0,2160, 1,2200, 0,1120,1500, 0,1860, 0,2160, 1,2200, 990,1340,1540, 0,1860, 0,2160, 1,2200, 0, 0, 0,1420,1860, 0,2160, 1,2200, 990, 0, 0,1580,1860, 1,2000, 1,2200, 0,1120, 0,1600,1860, 1,2000, 1,2200, 990,1320, 0,1660,1860, 1,2000, 1,2200, 0, 0,1260,1660,1860, 1,2000, 1,2200, 990, 0,1460,1700,1900, 1,2000, 1,2200, 0,1120,1500,1760,1900, 1,2000, 1,2200, 990,1340,1540,1780,1900, 1,2000, 1,2200, 0, 0, 0, 0, 0,5840,2000, 1,2200, 990, 0, 0, 0, 1,5870,2000, 1,2200, 0,1120, 0, 0, 1,5870,2000, 1,2200, 990,1320, 0, 0, 1,5870,2000, 1,2220, 0, 0,1260, 0, 1,5870,2000, 1,2220, 990, 0,1480, 0, 1,5880,2000, 1,2220, 0,1120,1500, 0, 1,5880,2000, 1,2220, 990,1340,1540, 0, 1,5900,2000, 1,2220, 0, 0, 0,1440, 1,5900,2000, 1,2220, 990, 0, 0,1600, 1,5900,2000, 1,2220, 0,1120, 0,1600, 1,5900,2000, 1,2220, 990,1340, 0,1660, 1,5920,2000, 1,2220, 0, 0,1260,1660, 1,5920,2000, 1,2220, 990, 0,1480,1700, 1,5920,2000, 1,2220, 0,1120,1500,1720, 1,5920,2000, 1,2220, 990,1340,1540,1740, 1,5920,2000, 1,2220, 0, 0, 0, 0,5680,5920,2000, 1,2220, 990, 0, 0, 1,5700,5920,2000, 1,2220, 0,1120, 0, 1,5700,5920,2000, 1,2220, 990,1320, 0, 1,5700,5920,2000, 1,2220, 0, 0,1260, 1,5700,5920,2000, 1,2220, 990, 0,1480, 1,5700,5920,2000, 1,2220, 0,1120,1500, 1,5700,5920,2000, 1,2220, 990,1340,1540, 1,5740,5920,2000, 1,2220, 0, 0, 0,5500,5740,5920,2000, 1,2220, 990, 0, 1,5560,5780,5920,2000, 1,2220, 0,1120, 1,5560,5780,5920,2000, 1,2220, 990,1320, 1,5580,5780,5920,2000, 1,2220, 0, 0,5360,5580,5780,5920,2000, 1,2220, 990, 1,5420,5620,5780,5960,2020, 1,2240, 0,5126,5460,5620,5780,5960,2020, 1,2240, 990,5420,5460,5640,5820,5980,2020, 1,2240, 0, 0, 0, 0, 0, 0, 0,6080,2260, 990, 0, 0, 0, 0, 0, 1,6100,2240, 0,1120, 0, 0, 0, 0, 1,6100,2240, 990,1320, 0, 0, 0, 0, 1,6120,2240, 0, 0,1260, 0, 0, 0, 1,6120,2240, 990, 0,1440, 0, 0, 0, 1,6120,2240, 0,1120,1500, 0, 0, 0, 1,6120,2240, 990,1340,1540, 0, 0, 0, 1,6120,2240, 0, 0, 0,1440, 0, 0, 1,6120,2240, 990, 0, 0,1620, 0, 0, 1,6120,2240, 0,1120, 0,1620, 0, 0, 1,6120,2240, 990,1320, 0,1660, 0, 0, 1,6120,2240, 0, 0,1260,1660, 0, 0, 1,6120,2240, 990, 0,1440,1680, 0, 0, 1,6120,2240, 0,1120,1500,1700, 0, 0, 1,6120,2240, 990,1340,1540,1740, 0, 0, 1,6120,2240, 0, 0, 0, 0,1600, 0, 1,6120,2240, 990, 0, 0, 0,1740, 0, 1,6120,2240, 0,1120, 0, 0,1760, 0, 1,6120,2240, 990,1320, 0, 0,1800, 0, 1,6120,2240, 0, 0,1260, 0,1800, 0, 1,6120,2240, 990, 0,1460, 0,1840, 0, 1,6120,2240, 0,1120,1500, 0,1860, 0, 1,6120,2240, 990,1340,1540, 0,1880, 0, 1,6140,2240, 0, 0, 0,1440,1880, 0, 1,6140,2240, 990, 0, 0,1600,1880, 0, 1,6140,2240, 0,1120, 0,1620,1880, 0, 1,6140,2240, 990,1320, 0,1660,1880, 0, 1,6140,2240, 0, 0,1260,1660,1880, 0, 1,6140,2240, 990, 0,1460,1700,1900, 0, 1,6140,2240, 0,1120,1500,1700,1900, 0, 1,6140,2240, 990,1340,1540,1710,1900, 0, 1,6140,2240, 0, 0, 0, 0, 0,1720, 1,6140,2240, 990, 0, 0, 0, 0,1920, 1,6140,2240, 0,1120, 0, 0, 0,1920, 1,6140,2240, 990,1340, 0, 0, 0,1940, 1,6140,2240, 0, 0,1260, 0, 0,1940, 1,6140,2240, 990, 0,1440, 0, 0,2000, 1,6140,2240, 0,1120,1500, 0, 0,2000, 1,6140,2240, 990,1340,1540, 0, 0,2020, 1,6140,2240, 0, 0, 0,1440, 0,2020, 1,6140,2240, 990, 0, 0,1600, 0,2020, 1,6140,2240, 0,1120, 0,1620, 0,2020, 1,6140,2240, 990,1320, 0,1660, 0,2020, 1,6140,2240, 0, 0,1260,1660, 0,2020, 1,6140,2240, 990, 0,1440,1700, 0,2020, 1,6140,2240, 0,1120,1500,1700, 0,2020, 1,6140,2240, 990,1340,1540,1740, 0,2020, 1,6140,2240, 0, 0, 0, 0,1560,2020, 1,6140,2240, 990, 0, 0, 0,1700,2020, 1,6140,2240, 0,1120, 0, 0,1720,2020, 1,6140,2240, 990,1340, 0, 0,1780,2020, 1,6140,2240, 0, 0,1260, 0,1780,2020, 1,6140,2240, 990, 0,1440, 0,1820,2020, 1,6140,2240, 0,1120,1500, 0,1820,2020, 1,6140,2240, 990,1340,1540, 1,1660,2020, 1,6140,2240, 0, 0, 0,5540,5786,1800, 1,6140,2240, 990, 0, 1,5560,5776,1820, 1,6200,2240, 0,1120, 1,5560,5776,1820, 1,6200,2240, 990,1320, 1,5560,5776,1840, 1,6200,2240, 0, 0,5356,5570,5776,1840, 1,6200,2240, 990, 1,5396,5600,5786,1840, 1,6200,2240, 0,5200,5435,5600,5786,1840, 1,6200,2240, 990,5390,5435,5600,5786,1840, 1,6200,2240, 0, 0, 0, 0, 0, 0,10076,10286,2180, 990, 0, 0, 0, 0, 1,5971,6220,2240, 0,1120, 0, 0, 0, 1,5971,6220,2240, 990,1320, 0, 0, 0, 1,5971,6220,2240, 0, 0,1260, 0, 0, 1,5971,6220,2240, 990, 0,1440, 0, 0, 1,5989,6220,2240, 0,1120,1500, 0, 0, 1,5989,6220,2240, 990,1340,1540, 0, 0, 1,5999,6220,2240, 0, 0, 0,1440, 0, 1,5999,6220,2240, 990, 0, 0,1580, 0, 1,5999,6220,2240, 0,1120, 0,1600, 0, 1,5999,6220,2240, 990,1320, 0,1660, 0, 1,6011,6220,2240, 0, 0,1260,1660, 0, 1,6011,6220,2240, 990, 0,1440,1680, 0, 1,6011,6220,2240, 0,1120,1500,1700, 0, 1,6011,6220,2240, 990,1340,1540,1740, 0, 1,6019,6220,2240, 0, 0, 0, 0,1600, 1,6019,6220,2240, 990, 0, 0, 0,1780, 1,6019,6220,2240, 0,1120, 0, 0,1780, 1,6019,6220,2240, 990,1320, 0, 0,1820, 1,6019,6220,2240, 0, 0,1260, 0,1820, 1,6019,6220,2240, 990, 0,1440, 0,1820, 1,6019,6220,2240, 0,1120,1500, 0,1820, 1,6019,6220,2240, 990,1340,1540, 0,1860, 1,6019,6220,2240, 0, 0, 0,1400,1860, 1,6019,6220,2240, 990, 0, 0,1600,1860, 1,6019,6220,2240, 0,1120, 0,1600,1860, 1,6019,6220,2240, 990,1340, 0,1640,1860, 1,6029,6220,2240, 0, 0,1260,1660,1860, 1,6029,6220,2240, 990, 0,1440,1700,1860, 1,6029,6220,2240, 0,1120,1480,1700,1860, 1,6029,6220,2240, 990,1350,1570,1720,1920, 1,6029,6220,2240, 0, 0, 0, 0, 0,9920,6029,6220,2240, 990, 0, 0, 0, 1,5810,6029,6220,2240, 0,1120, 0, 0, 1,5810,6029,6220,2240, 990,1340, 0, 0, 1,5820,6029,6220,2240, 0, 0,1260, 0, 1,5820,6029,6220,2240, 990, 0,1440, 0, 1,5820,6029,6220,2240, 0,1120,1500, 0, 1,5820,6029,6220,2240, 990,1340,1540, 0, 1,5840,6029,6220,2240, 0, 0, 0,1440, 1,5820,6029,6220,2240, 990, 0, 0,1600, 1,5820,6029,6220,2240, 0,1120, 0,1600, 1,5820,6029,6220,2240, 990,1320, 0,1660, 1,5820,6029,6220,2240, 0, 0,1260,1660, 1,5820,6029,6220,2240, 990, 0,1440,1680, 1,5820,6029,6220,2240, 0,1120,1500,1700, 1,5820,6029,6220,2240, 990,1340,1540,1720, 1,5820,6029,6220,2240, 0, 0, 0, 0,5580,5820,6029,6220,2240, 990, 0, 0, 1,5620,5820,6029,6220,2240, 0,1120, 0, 1,5620,5820,6029,6220,2240, 990,1320, 0, 1,5640,5820,6029,6220,2240, 0, 0,1260, 1,5640,5820,6029,6220,2240, 990, 0,1440, 1,5640,5820,6029,6220,2240, 0,1120,1500, 1,5640,5820,6029,6220,2240, 990,1340,1540, 1,5660,5820,6029,6220,2240, 0, 0, 0,5400,5660,5820,6029,6220,2240, 990, 0, 1,5460,5660,5820,6029,6220,2240, 0,1120, 1,5460,5660,5820,6029,6220,2240, 990,1340, 1,5460,5660,5820,6029,6220,2240, 0, 0, 0,5460,5660,5820,6029,6220,2240, 990, 0, 1,5460,5660,5820,6029,6220,2240, 0,1120, 1,5460,5660,5820,6029,6220,2240, 1020,1400,1660,1860,2060,2240,2350, 1,2250 }; unsigned short normal_128k_9dot_dac[]={ 0, 0, 0, 0, 0, 0, 0, 0, 0, 960, 0, 0, 0, 0, 0, 0, 0, 0, 0,1100, 0, 0, 0, 0, 0, 0, 0, 980,1280, 0, 0, 0, 0, 0, 0, 0, 0, 0,1250, 0, 0, 0, 0, 0, 0, 980, 0,1390, 0, 0, 0, 0, 0, 0, 0,1130,1440, 0, 0, 0, 0, 0, 0, 980,1320,1480, 0, 0, 0, 0, 0, 0, 0, 0, 0,1400, 0, 0, 0, 0, 0, 980, 0, 0,1510, 0, 0, 0, 0, 0, 0,1130, 0,1530, 0, 0, 0, 0, 0, 980,1320, 0,1580, 0, 0, 0, 0, 0, 0, 0,1260,1580, 0, 0, 0, 0, 0, 980, 1,1300,1580, 0, 0, 0, 0, 0, 0,5246,5446,1460, 0, 0, 0, 0, 0, 5076,5296,5446,1460, 0, 0, 0, 0, 0, 0, 0, 0, 0,1520, 0, 0, 0, 0, 980, 0, 0, 0,1620, 0, 0, 0, 0, 0,1130, 0, 0,1640, 0, 0, 0, 0, 980,1320, 0, 0,1690, 0, 0, 0, 0, 0, 0,1280, 0,1680, 0, 0, 0, 0, 1000, 0,1430, 1,1570, 0, 0, 0, 0, 0,1090,1460, 1,1570, 0, 0, 0, 0, 990,1340,1540, 1,1580, 0, 0, 0, 0, 0, 0, 0,5496,1600, 0, 0, 0, 0, 970, 0, 1,5546,1600, 0, 0, 0, 0, 0,1140, 1,5546,1600, 0, 0, 0, 0, 1000,1320, 1,5546,1600, 0, 0, 0, 0, 0, 0,5346,5566,1600, 0, 0, 0, 0, 1000, 1,5416,5586,1600, 0, 0, 0, 0, 0,5226,5446,5586,1600, 0, 0, 0, 0, 5076,5286,5446,5586,1600, 0, 0, 0, 0, 0, 0, 0, 0, 0,1640, 0, 0, 0, 980, 0, 0, 0, 0,1760, 0, 0, 0, 0,1130, 0, 0, 0,1780, 0, 0, 0, 980,1320, 0, 0, 1,1680, 0, 0, 0, 0, 0,1280, 0, 0,1800, 0, 0, 0, 980, 0,1420, 0, 1,1680, 0, 0, 0, 0,1130,1460, 0, 1,1680, 0, 0, 0, 1000,1320,1480, 0, 1,1680, 0, 0, 0, 0, 0, 0,1380, 1,1680, 0, 0, 0, 980, 0, 0,1540, 1,1700, 0, 0, 0, 0,1130, 0,1580, 1,1700, 0, 0, 0, 1000,1320, 0,1620, 1,1700, 0, 0, 0, 0, 0,5346,1480, 1,1700, 0, 0, 0, 980, 1,5386,1480, 1,1700, 0, 0, 0, 0,5246,5446,1480, 1,1700, 0, 0, 0, 5076,5296,5446,1480, 1,1700, 0, 0, 0, 0, 0, 0, 0,5616,1740, 0, 0, 0, 980, 0, 0, 1,5636,1740, 0, 0, 0, 0,1130, 0, 1,5646,1740, 0, 0, 0, 1000,1320, 0, 1,5656,1740, 0, 0, 0, 0, 0,1280, 1,5666,1740, 0, 0, 0, 980, 0,1420, 1,5676,1740, 0, 0, 0, 0,1130,1460, 1,5676,1740, 0, 0, 0, 1000,1320,1480, 1,5676,1740, 0, 0, 0, 0, 0, 0,5498,5726,1740, 0, 0, 0, 980, 0, 1,5526,5706,1740, 0, 0, 0, 0,1130, 1,5526,5706,1740, 0, 0, 0, 1000,1320, 1,5526,5706,1740, 0, 0, 0, 0, 0,5356,5576,5706,1740, 0, 0, 0, 980, 1,5406,5576,5726,1740, 0, 0, 0, 0,5216,5416,5576,5726,1740, 0, 0, 0, 5076,5296,5446,5576,5726,1740, 0, 0, 0, 0, 0, 0, 0, 0, 0,1760, 0, 0, 980, 0, 0, 0, 0, 1,1780, 0, 0, 0,1130, 0, 0, 0, 1,1790, 0, 0, 1000,1320, 0, 0, 0, 1,1800, 0, 0, 0, 0,1280, 0, 0, 1,1800, 0, 0, 980, 0,1420, 0, 0, 1,1820, 0, 0, 0,1130,1460, 0, 0, 1,1820, 0, 0, 1000,1320,1480, 0, 0, 1,1820, 0, 0, 0, 0, 0,1400, 0, 1,1820, 0, 0, 980, 0, 0,1540, 0, 1,1820, 0, 0, 0,1130, 0,1560, 0, 1,1820, 0, 0, 1000,1320, 0,1610, 0, 1,1830, 0, 0, 0, 0,1280,1620, 0, 1,1830, 0, 0, 980, 1,5386,1480, 0, 1,1840, 0, 0, 0,5246,5446,1480, 0, 1,1840, 0, 0, 5076,5296,5446,1480, 0, 1,1840, 0, 0, 0, 0, 0, 0,1540, 1,1860, 0, 0, 980, 0, 0, 0,1690, 1,1840, 0, 0, 0,1130, 0, 0,1700, 1,1840, 0, 0, 1000,1320, 0, 0,1730, 1,1840, 0, 0, 0, 0,1280, 0,1730, 1,1850, 0, 0, 980, 0,1420, 1,1580, 1,1850, 0, 0, 0,1130,1460, 1,1580, 1,1850, 0, 0, 1000,1320,1480, 1,1580, 1,1850, 0, 0, 0, 0, 0,5486,1600, 1,1850, 0, 0, 980, 0, 1,5516,1610, 1,1850, 0, 0, 0,1130, 1,5526,1610, 1,1850, 0, 0, 1000,1320, 1,5546,1610, 1,1850, 0, 0, 0, 0,5326,5586,1610, 1,1850, 0, 0, 980, 1,5396,5596,1630, 1,1850, 0, 0, 0,5246,5446,5596,1630, 1,1850, 0, 0, 5076,5296,5446,5596,1630, 1,1850, 0, 0, 0, 0, 0, 0, 0,5776,1880, 0, 0, 980, 0, 0, 0, 1,5796,1880, 0, 0, 0,1130, 0, 0, 1,5796,1880, 0, 0, 1000,1320, 0, 0, 1,5796,1880, 0, 0, 0, 0,1280, 0, 1,5796,1880, 0, 0, 980, 0,1430, 0, 1,5796,1880, 0, 0, 0,1130,1470, 0, 1,5796,1880, 0, 0, 1000,1320,1490, 0, 1,5796,1880, 0, 0, 0, 0, 0,1400, 1,5796,1880, 0, 0, 980, 0, 0,1600, 1,5796,1880, 0, 0, 0,1130, 0,1620, 1,5806,1880, 0, 0, 1000,1320, 0,1640, 1,5816,1880, 0, 0, 0, 0,1290,1660, 1,5816,1880, 0, 0, 980, 1,5396,1500, 1,5826,1890, 0, 0, 0,5246,5446,1500, 1,5826,1890, 0, 0, 5076,5296,5446,1500, 1,5826,1890, 0, 0, 0, 0, 0, 0,5616,5846,1890, 0, 0, 980, 0, 0, 1,5646,5866,1900, 0, 0, 0,1130, 0, 1,5656,5866,1900, 0, 0, 1000,1320, 0, 1,5666,5866,1900, 0, 0, 0, 0,1280, 1,5666,5866,1900, 0, 0, 980, 0,1430, 1,5686,5876,1900, 0, 0, 0,1120,1470, 1,5696,5876,1900, 0, 0, 1000,1320,1490, 1,5706,5876,1900, 0, 0, 0, 0, 0,5466,5706,5876,1900, 0, 0, 980, 0, 1,5536,5746,5896,1900, 0, 0, 0,1130, 1,5546,5746,5896,1900, 0, 0, 1000,1320, 1,5566,5746,5896,1900, 0, 0, 0, 0,5366,5596,5746,5896,1900, 0, 0, 980, 1,5396,5596,5746,5896,1900, 0, 0, 0,5206,5446,5596,5746,5896,1900, 0, 0, 5076,5296,5446,5596,5746,5896,1900, 0, 0, 0, 0, 0, 0, 0, 0, 0,1920, 0, 980, 0, 0, 0, 0, 0, 1,1920, 0, 0,1130, 0, 0, 0, 0, 1,1930, 0, 1000,1320, 0, 0, 0, 0, 1,1940, 0, 0, 0,1280, 0, 0, 0, 1,1940, 0, 980, 0,1410, 0, 0, 0, 1,1940, 0, 0,1130,1460, 0, 0, 0, 1,1940, 0, 1000,1320,1490, 0, 0, 0, 1,1940, 0, 0, 0, 0,1390, 0, 0, 1,1940, 0, 980, 0, 0,1540, 0, 0, 1,1950, 0, 0,1130, 0,1560, 0, 0, 1,1950, 0, 1000,1320, 0,1600, 0, 0, 1,1950, 0, 0, 0,1280,1620, 0, 0, 1,1960, 0, 980, 1,5386,1480, 0, 0, 1,1960, 0, 0,5246,5446,1480, 0, 0, 1,1960, 0, 5076,5296,5446,1480, 0, 0, 1,1960, 0, 0, 0, 0, 0,1540, 0, 1,1960, 0, 980, 0, 0, 1,1540, 0, 1,1960, 0, 0,1130, 0, 1,1550, 0, 1,1960, 0, 1000,1320, 0, 1,1560, 0, 1,1960, 0, 0, 0,1280, 1,1580, 0, 1,1960, 0, 980, 0,1420, 1,1590, 0, 1,1960, 0, 0,1130,1460, 1,1600, 0, 1,1960, 0, 1000,1320,1490, 1,1620, 0, 1,1960, 0, 0, 0, 0,5496,1640, 0, 1,1960, 0, 980, 0, 1,5516,1620, 0, 1,1960, 0, 0,1130, 1,5526,1620, 0, 1,1960, 0, 1000,1320, 1,5526,1620, 0, 1,1960, 0, 0, 0,5246,5536,1620, 0, 1,1960, 0, 980, 1,5386,5596,1620, 0, 1,1970, 0, 0,5206,5446,5596,1620, 0, 1,1970, 0, 5076,5296,5446,5596,1620, 0, 1,1970, 0, 0, 0, 0, 0, 0,1660, 1,1970, 0, 980, 0, 0, 0, 1,1700, 1,1980, 0, 0,1130, 0, 0, 1,1700, 1,1980, 0, 1000,1320, 0, 0, 1,1700, 1,1980, 0, 0, 0,1280, 0, 1,1710, 1,1980, 0, 980, 0,1430, 0, 1,1720, 1,1980, 0, 0,1130,1470, 0, 1,1720, 1,1980, 0, 1000,1320,1490, 0, 1,1720, 1,1980, 0, 0, 0, 0,1420, 1,1720, 1,1980, 0, 980, 0, 1,1430, 1,1720, 1,1980, 0, 0,1130, 1,1460, 1,1720, 1,1980, 0, 1000,1320, 1,1480, 1,1720, 1,1980, 0, 0, 0,5356,1480, 1,1720, 1,1980, 0, 990, 1,5386,1480, 1,1730, 1,1990, 0, 0,5246,5446,1480, 1,1730, 1,1990, 0, 5076,5296,5446,1480, 1,1730, 1,1990, 0, 0, 0, 0, 0,5616,1750, 1,1990, 0, 980, 0, 0, 1,5636,1760, 1,1990, 0, 0,1130, 0, 1,5646,1760, 1,1990, 0, 1000,1320, 0, 1,5666,1760, 1,1990, 0, 0, 0,1280, 1,5666,1760, 1,1990, 0, 980, 0,1430, 1,5666,1760, 1,1990, 0, 0,1130,1470, 1,5666,1760, 1,1990, 0, 1000,1320,1490, 1,5696,1780, 1,1990, 0, 0, 0, 0,5496,5706,1770, 1,1990, 0, 980, 0, 1,5516,5706,1780, 1,2020, 0, 0,1130, 1,5526,5716,1780, 1,2020, 0, 1000,1320, 1,5546,5726,1780, 1,2020, 0, 0, 0,5356,5546,5726,1780, 1,2020, 0, 980, 1,5396,5596,5746,1780, 1,2020, 0, 0,5206,5446,5596,5746,1780, 1,2020, 0, 5076,5296,5446,5596,5746,1780, 1,2020, 0, 0, 0, 0, 0, 0, 0,5896,2020, 0, 980, 0, 0, 0, 0, 1,5886,2020, 0, 0,1120, 0, 0, 0, 1,5896,2020, 0, 1000,1320, 0, 0, 0, 1,5896,2020, 0, 0, 0,1280, 0, 0, 1,5896,2020, 0, 980, 0,1430, 0, 0, 1,5946,2020, 0, 0,1130,1470, 0, 0, 1,5946,2020, 0, 1000,1320,1490, 0, 0, 1,5956,2020, 0, 0, 0, 0,1400, 0, 1,5946,2020, 0, 980, 0, 1,1430, 0, 1,5956,2030, 0, 0,1140, 1,1450, 0, 1,5956,2030, 0, 1000,1320, 1,1460, 0, 1,5956,2030, 0, 0, 0,5366,1480, 0, 1,5956,2030, 0, 980, 1,5386,1480, 0, 1,5956,2030, 0, 0,5246,5446,1480, 0, 1,5956,2030, 0, 5076,5296,5446,1480, 0, 1,5956,2030, 0, 0, 0, 0, 0,1580, 1,5956,2030, 0, 980, 0, 0, 1,1590, 1,5976,2050, 0, 0,1140, 0, 1,1600, 1,5976,2050, 0, 1000,1320, 0, 1,1600, 1,5976,2050, 0, 0, 0,1300, 1,1600, 1,5976,2050, 0, 980, 0,1440, 1,1610, 1,5976,2050, 0, 0,1140,1480, 1,1620, 1,5976,2050, 0, 1000,1330,1500, 1,1620, 1,5976,2050, 0, 0, 0, 0,5496,1620, 1,5976,2050, 0, 980, 0, 1,5526,1620, 1,5996,2050, 0, 0,1140, 1,5546,1630, 1,5996,2050, 0, 1000,1330, 1,5546,1630, 1,5996,2050, 0, 0, 0,5346,5586,1630, 1,5996,2050, 0, 980, 1,5386,5596,1630, 1,5996,2050, 0, 0,5246,5446,5596,1630, 1,5996,2050, 0, 5076,5296,5446,5596,1630, 1,5996,2050, 0, 0, 0, 0, 0, 0,5766,6006,2050, 0, 980, 0, 0, 0, 1,5806,6006,2050, 0, 0,1140, 0, 0, 1,5806,6006,2050, 0, 1000,1320, 0, 0, 1,5816,6006,2050, 0, 0, 0,1280, 0, 1,5806,6006,2050, 0, 980, 0,1440, 0, 1,5816,6006,2050, 0, 0,1140,1480, 0, 1,5826,6006,2050, 0, 1000,1320,1490, 0, 1,5826,6006,2050, 0, 0, 0, 0,1430, 1,5826,6006,2050, 0, 980, 0, 1,1450, 1,5826,6006,2050, 0, 0,1140, 1,1460, 1,5836,6006,2050, 0, 1000,1320, 1,1480, 1,5846,6006,2050, 0, 0, 0,5366,1500, 1,5846,6006,2050, 0, 980, 1,5406,1500, 1,5866,6026,2050, 0, 0,5246,5446,1500, 1,5866,6026,2050, 0, 5076,5296,5446,1500, 1,5866,6026,2050, 0, 0, 0, 0, 0,5626,5886,6026,2050, 0, 980, 0, 0, 1,5676,5886,6026,2050, 0, 0,1140, 0, 1,5676,5886,6026,2050, 0, 1000,1320, 0, 1,5696,5886,6026,2050, 0, 0, 0,1290, 1,5696,5886,6026,2050, 0, 980, 0,1440, 1,5696,5896,6026,2050, 0, 0,1140,1480, 1,5696,5896,6026,2050, 0, 1000,1320,1500, 1,5716,5896,6026,2050, 0, 0, 0, 0,5466,5716,5896,6026,2050, 0, 980, 0, 1,5516,5726,5896,6026,2050, 0, 0,1140, 1,5526,5726,5896,6026,2050, 0, 1000,1320, 1,5566,5726,5896,6026,2050, 0, 0, 0,5356,5566,5726,5896,6026,2050, 0, 980, 1,5376,5566,5726,5896,6026,2050, 0, 0,5246,5446,5566,5726,5896,6026,2050, 0, 5076,5296,5446,5566,5726,5896,6026,2050, 0, 0, 0, 0, 0, 0, 0, 0, 0,2040, 980, 0, 0, 0, 0, 0, 0, 1,2050, 0,1130, 0, 0, 0, 0, 0, 1,2060, 1000,1320, 0, 0, 0, 0, 0, 1,2070, 0, 0,1280, 0, 0, 0, 0, 1,2070, 980, 0,1420, 0, 0, 0, 0, 1,2070, 0,1130,1470, 0, 0, 0, 0, 1,2070, 1000,1320,1490, 0, 0, 0, 0, 1,2070, 0, 0, 0,1400, 0, 0, 0, 1,2070, 980, 0, 0,1530, 0, 0, 0, 1,2080, 0,1130, 0,1570, 0, 0, 0, 1,2080, 1000,1320, 0,1610, 0, 0, 0, 1,2090, 0, 0,1280,1630, 0, 0, 0, 1,2080, 980, 1,5386,1480, 0, 0, 0, 1,2090, 0,5246,5446,1480, 0, 0, 0, 1,2090, 5076,5296,5446,1490, 0, 0, 0, 1,2090, 0, 0, 0, 0,1530, 0, 0, 1,2090, 980, 0, 0, 1,1550, 0, 0, 1,2090, 0,1130, 0, 1,1560, 0, 0, 1,2090, 1000,1320, 0, 1,1580, 0, 0, 1,2090, 0, 0,1280, 1,1580, 0, 0, 1,2090, 980, 0,1430, 1,1580, 0, 0, 1,2090, 0,1130,1470, 1,1590, 0, 0, 1,2090, 1000,1320,1490, 1,1600, 0, 0, 1,2090, 0, 0, 0,5496,1620, 0, 0, 1,2090, 980, 0, 1,5536,1620, 0, 0, 1,2100, 0,1130, 1,5546,1620, 0, 0, 1,2100, 1000,1320, 1,5566,1620, 0, 0, 1,2100, 0, 0,5366,5586,1620, 0, 0, 1,2100, 980, 1,5376,5566,1620, 0, 0, 1,2100, 0,5246,5446,5566,1620, 0, 0, 1,2100, 5096,5296,5446,5566,1620, 0, 0, 1,2100, 0, 0, 0, 0, 0,1660, 0, 1,2100, 980, 0, 0, 0, 1,1670, 0, 1,2100, 0,1130, 0, 0, 1,1680, 0, 1,2100, 1000,1320, 0, 0, 1,1700, 0, 1,2100, 0, 0,1280, 0, 1,1700, 0, 1,2100, 980, 0,1430, 0, 1,1710, 0, 1,2110, 0,1130,1470, 0, 1,1720, 0, 1,2110, 1000,1320,1490, 0, 1,1730, 0, 1,2110, 0, 0, 0,1400, 1,1720, 0, 1,2110, 980, 0, 1,1420, 1,1720, 0, 1,2110, 0,1130, 1,1440, 1,1720, 0, 1,2110, 1000,1320, 1,1460, 1,1730, 0, 1,2110, 0, 0,5346,1460, 1,1730, 0, 1,2110, 980, 1,5386,1480, 1,1740, 0, 1,2120, 0,5246,5446,1480, 1,1740, 0, 1,2120, 5076,5296,5446,1500, 1,1740, 0, 1,2120, 0, 0, 0, 0,5616,1740, 0, 1,2120, 980, 0, 0, 1,5626,1750, 0, 1,2120, 0,1130, 0, 1,5636,1750, 0, 1,2120, 1000,1320, 0, 1,5656,1750, 0, 1,2120, 0, 0,1280, 1,5666,1750, 0, 1,2120, 980, 0,1440, 1,5666,1750, 0, 1,2120, 0,1130,1480, 1,5666,1750, 0, 1,2120, 1000,1320,1490, 1,5686,1750, 0, 1,2120, 0, 0, 0,5486,5726,1750, 0, 1,2120, 980, 0, 1,5496,5726,1750, 0, 1,2130, 0,1140, 1,5526,5726,1750, 0, 1,2130, 1000,1320, 1,5546,5726,1760, 0, 1,2130, 0, 0,5356,5576,5726,1760, 0, 1,2130, 980, 1,5376,5566,5726,1760, 0, 1,2130, 0,5246,5446,5566,5726,1760, 0, 1,2130, 5076,5296,5446,5566,5726,1760, 0, 1,2130, 0, 0, 0, 0, 0, 0,1810, 1,2130, 980, 0, 0, 0, 0, 1,1820, 1,2130, 0,1130, 0, 0, 0, 1,1820, 1,2130, 1000,1320, 0, 0, 0, 1,1830, 1,2130, 0, 0,1280, 0, 0, 1,1830, 1,2130, 980, 0,1430, 0, 0, 1,1830, 1,2130, 0,1130,1470, 0, 0, 1,1830, 1,2130, 1000,1320,1490, 0, 0, 1,1830, 1,2130, 0, 0, 0,1400, 0, 1,1830, 1,2130, 980, 0, 1,1420, 0, 1,1850, 1,2130, 0,1130, 1,1440, 0, 1,1850, 1,2130, 1000,1320, 1,1460, 0, 1,1850, 1,2130, 0, 0,5346,1460, 0, 1,1850, 1,2130, 980, 1,5386,1480, 0, 1,1860, 1,2130, 0,5246,5446,1480, 0, 1,1860, 1,2130, 5076,5296,5446,1500, 0, 1,1870, 1,2130, 0, 0, 0, 0,1530, 1,1860, 1,2130, 980, 0, 0, 1,1560, 1,1870, 1,2130, 0,1130, 0, 1,1570, 1,1870, 1,2130, 1000,1320, 0, 1,1580, 1,1870, 1,2130, 0, 0,1280, 1,1580, 1,1870, 1,2130, 980, 0,1430, 1,1600, 1,1880, 1,2140, 0,1130,1470, 1,1610, 1,1880, 1,2140, 1000,1320,1490, 1,1610, 1,1880, 1,2140, 0, 0, 0,5486,1620, 1,1880, 1,2140, 980, 0, 1,5516,1620, 1,1890, 1,2140, 0,1130, 1,5536,1620, 1,1890, 1,2140, 1000,1320, 1,5566,1620, 1,1890, 1,2140, 0, 0,5366,5586,1620, 1,1890, 1,2140, 980, 1,5376,5566,1630, 1,1900, 1,2140, 0,5246,5466,5566,1630, 1,1900, 1,2140, 5076,5296,5446,5566,1630, 1,1900, 1,2140, 0, 0, 0, 0, 0,5376,1900, 1,2140, 980, 0, 0, 0, 1,5776,1900, 1,2150, 0,1130, 0, 0, 1,5796,1900, 1,2150, 1000,1320, 0, 0, 1,5796,1900, 1,2150, 0, 0,1280, 0, 1,5796,1900, 1,2150, 980, 0,1440, 0, 1,5796,1900, 1,2150, 0,1130,1480, 0, 1,5806,1900, 1,2150, 1000,1320,1500, 0, 1,5806,1900, 1,2150, 0, 0, 0,1430, 1,5806,1900, 1,2150, 980, 0, 1,1450, 1,5806,1910, 1,2160, 0,1130, 1,1460, 1,5806,1910, 1,2160, 1000,1320, 1,1470, 1,5816,1910, 1,2160, 0, 0,5346,1480, 1,5816,1910, 1,2160, 980, 1,5386,1480, 1,5816,1910, 1,2160, 0,5246,5446,1480, 1,5816,1910, 1,2160, 5076,5296,5446,1500, 1,5816,1910, 1,2160, 0, 0, 0, 0,5586,5836,1910, 1,2160, 980, 0, 0, 1,5626,5836,1910, 1,2160, 0,1140, 0, 1,5636,5836,1910, 1,2160, 1000,1320, 0, 1,5646,5836,1910, 1,2160, 0, 0,1290, 1,5646,5836,1910, 1,2160, 980, 0,1430, 1,5646,5836,1910, 1,2160, 0,1140,1480, 1,5656,5836,1910, 1,2160, 1000,1320,1500, 1,5686,5836,1910, 1,2160, 0, 0, 0,5446,5686,5836,1910, 1,2160, 980, 0, 1,5516,5716,5856,1920, 1,2160, 0,1140, 1,5536,5716,5856,1920, 1,2160, 1000,1320, 1,5566,5726,5856,1920, 1,2160, 0, 0,5366,5586,5736,5856,1920, 1,2160, 980, 1,5376,5566,5726,5856,1930, 1,2170, 0,5246,5446,5566,5726,5856,1930, 1,2170, 5076,5296,5446,5566,5726,5856,1930, 1,2170, 0, 0, 0, 0, 0, 0, 0,6046,2170, 980, 0, 0, 0, 0, 0, 1,6076,2180, 0,1130, 0, 0, 0, 0, 1,6086,2180, 1000,1320, 0, 0, 0, 0, 1,6086,2180, 0, 0,1280, 0, 0, 0, 1,6086,2180, 980, 0,1420, 0, 0, 0, 1,6086,2180, 0,1130,1470, 0, 0, 0, 1,6086,2180, 1000,1320,1490, 0, 0, 0, 1,6086,2180, 0, 0, 0,1400, 0, 0, 1,6086,2180, 980, 0, 1,1420, 0, 0, 1,6086,2180, 0,1130, 1,1440, 0, 0, 1,6086,2180, 1000,1320, 1,1460, 0, 0, 1,6086,2180, 0, 0,5346,1460, 0, 0, 1,6086,2180, 980, 1,5386,1480, 0, 0, 1,6096,2180, 0,5246,5446,1480, 0, 0, 1,6096,2180, 5076,5296,5446,1500, 0, 0, 1,6096,2180, 0, 0, 0, 0,1540, 0, 1,6096,2180, 980, 0, 0, 1,1570, 0, 1,6106,2180, 0,1130, 0, 1,1580, 0, 1,6106,2180, 1000,1320, 0, 1,1600, 0, 1,6106,2180, 0, 0,1280, 1,1600, 0, 1,6106,2180, 980, 0,1430, 1,1600, 0, 1,6106,2180, 0,1130,1470, 1,1600, 0, 1,6106,2180, 1000,1320,1490, 1,1610, 0, 1,6106,2180, 0, 0, 0,5486,1610, 0, 1,6106,2180, 980, 0, 1,5526,1620, 0, 1,6106,2180, 0,1130, 1,5546,1620, 0, 1,6106,2180, 1000,1320, 1,5546,1630, 0, 1,6106,2180, 0, 0,5346,5586,1630, 0, 1,6106,2180, 980, 1,5376,5566,1630, 0, 1,6116,2180, 0,5246,5446,5566,1630, 0, 1,6116,2180, 5076,5296,5446,5566,1630, 0, 1,6116,2180, 0, 0, 0, 0, 0,1700, 1,6116,2180, 980, 0, 0, 0, 1,1720, 1,6116,2180, 0,1130, 0, 0, 1,1730, 1,6116,2180, 1000,1320, 0, 0, 1,1730, 1,6116,2180, 0, 0,1280, 0, 1,1730, 1,6116,2180, 980, 0,1430, 0, 1,1740, 1,6116,2180, 0,1130,1470, 0, 1,1740, 1,6116,2180, 1000,1320,1490, 0, 1,1740, 1,6116,2180, 0, 0, 0,1430, 1,1740, 1,6116,2180, 980, 0, 1,1430, 1,1740, 1,6116,2180, 0,1130, 1,1450, 1,1740, 1,6116,2180, 1000,1320, 1,1460, 1,1740, 1,6116,2180, 0, 0,5366,1470, 1,1740, 1,6116,2180, 980, 1,5386,1480, 1,1750, 1,6116,2180, 0,5246,5446,1480, 1,1750, 1,6116,2180, 5076,5296,5446,1500, 1,1750, 1,6116,2180, 0, 0, 0, 0,5616,1750, 1,6116,2180, 980, 0, 0, 1,5616,1770, 1,6126,2190, 0,1130, 0, 1,5636,1770, 1,6126,2190, 1000,1320, 0, 1,5646,1770, 1,6126,2190, 0, 0,1280, 1,5646,1770, 1,6126,2190, 980, 0,1430, 1,5646,1770, 1,6126,2190, 0,1130,1480, 1,5666,1770, 1,6126,2190, 1000,1320,1500, 1,5686,1770, 1,6126,2190, 0, 0, 0,5446,5686,1770, 1,6126,2190, 980, 0, 1,5516,5716,1770, 1,6126,2190, 0,1130, 1,5536,5726,1770, 1,6126,2190, 1000,1320, 1,5566,5726,1770, 1,6126,2190, 0, 0,5366,5586,5736,1770, 1,6126,2190, 980, 1,5376,5566,5726,1780, 1,6136,2190, 0,5246,5446,5566,5726,1780, 1,6136,2190, 5076,5296,5446,5566,5726,1780, 1,6136,2190, 0, 0, 0, 0, 0, 0,5886,6136,2190, 980, 0, 0, 0, 0, 1,5906,6156,2190, 0,1130, 0, 0, 0, 1,5916,6156,2190, 1000,1320, 0, 0, 0, 1,5936,6156,2190, 0, 0,1280, 0, 0, 1,5916,6156,2190, 980, 0,1430, 0, 0, 1,5946,6176,2190, 0,1130,1470, 0, 0, 1,5956,6176,2190, 1000,1320,1490, 0, 0, 1,5956,6176,2190, 0, 0, 0,1420, 0, 1,5966,6176,2190, 980, 0, 1,1430, 0, 1,5966,6166,2190, 0,1130, 1,1450, 0, 1,5966,6166,2190, 1000,1320, 1,1460, 0, 1,5966,6166,2190, 0, 0,5366,1470, 0, 1,5966,6166,2190, 980, 1,5376,1480, 0, 1,5966,6166,2190, 0,5246,5446,1480, 0, 1,5966,6166,2190, 5076,5296,5446,1500, 0, 1,5966,6166,2190, 0, 0, 0, 0,1580, 1,5966,6166,2190, 980, 0, 0, 1,1600, 1,5976,6166,2190, 0,1130, 0, 1,1600, 1,5976,6166,2190, 1000,1320, 0, 1,1600, 1,5976,6166,2190, 0, 0,1280, 1,1600, 1,5976,6166,2190, 980, 0,1430, 1,1600, 1,5976,6166,2190, 0,1130,1480, 1,1600, 1,5976,6166,2190, 1000,1320,1490, 1,1610, 1,5976,6166,2190, 0, 0, 0,5446,1620, 1,5976,6166,2190, 980, 0, 1,5526,1620, 1,5986,6166,2190, 0,1130, 1,5546,1620, 1,5986,6166,2190, 1000,1320, 1,5546,1630, 1,5986,6166,2190, 0, 0,5346,5566,1630, 1,5986,6166,2190, 980, 1,5376,5566,1630, 1,5986,6166,2190, 0,5246,5446,5566,1630, 1,5986,6166,2190, 5076,5296,5446,5566,1630, 1,5986,6166,2190, 0, 0, 0, 0, 0,9876,10080,10240,2160, 980, 0, 0, 0, 1,5776,6016,6166,2190, 0,1130, 0, 0, 1,5786,6016,6166,2190, 1000,1320, 0, 0, 1,5796,6016,6166,2190, 0, 0,1280, 0, 1,5786,6016,6166,2190, 980, 0,1440, 0, 1,5796,6016,6166,2190, 0,1130,1480, 0, 1,5796,6016,6166,2190, 1000,1320,1490, 0, 1,5796,6016,6166,2190, 0, 0, 0,1430, 1,5796,6016,6166,2190, 980, 0, 1,1430, 1,5796,6016,6166,2190, 0,1130, 1,1450, 1,5796,6016,6166,2190, 1000,1320, 1,1460, 1,5796,6016,6166,2190, 0, 0,5366,1470, 1,5816,6016,6166,2190, 980, 1,5376,1480, 1,5826,6016,6166,2200, 0,5246,5446,1480, 1,5836,6016,6166,2200, 5076,5296,5446,1500, 1,5836,6016,6166,2200, 0, 0, 0, 0,9736,5836,6016,6166,2200, 980, 0, 0, 1,9736,5846,6016,6166,2200, 0,1130, 0, 1,9736,5846,6016,6166,2200, 1000,1320, 0, 1,9736,5846,6016,6166,2200, 0, 0,1290, 1,9736,5846,6016,6166,2200, 980, 0,1440, 1,9756,5846,6016,6166,2200, 0,1130,1480, 1,9756,5846,6016,6166,2200, 1000,1320,1500, 1,9756,5846,6016,6166,2200, 0, 0, 0,9586, 1,5746,5986,6146,2200, 980, 0, 1,9576,5666,5866,6016,6166,2210, 0,1130, 1,9586,5666,5866,6016,6166,2210, 1000,1320, 1,9596,5666,5866,6016,6166,2210, 0, 0,9486, 1,5626,5846,6016,6166,2210, 980, 1,5386,5566,5726,5866,6016,6166,2210, 0,5246, 1,5436,5666,5856,6006,6166,2210, 5100,5300,5450,5600,5750,5900,6050,6200,2200 }; if(sysPara->para.flagOfFastMode && sysPara->status.FPGAVersionType == 0) { if ((sysPara->para.currPrintMode == FAST_PRINT) && (sysPara->status.currPrintRow <= 7)) fpgaWr(0xB500,(unsigned char *)fast_128k_7dot_dac,2304); else if((sysPara->para.currPrintMode == STANDARD_PRINT) && (sysPara->status.currPrintRow <= 7)) fpgaWr(0xB500,(unsigned char *)normal_128k_7dot_dac,2304); else if((sysPara->para.currPrintMode == FAST_PRINT) && (sysPara->status.currPrintRow <= 9)) fpgaWr(0xB500,(unsigned char *)normal_128k_9dot_dac,9216); else if((sysPara->para.currPrintMode == STANDARD_PRINT) && (sysPara->status.currPrintRow <= 9)) fpgaWr(0xB500,(unsigned char *)normal_128k_9dot_dac,9216); } else if(type == 6){ writeDacValue2Fpga_No72NewVoltData(); } else if(sysPara->status.FPGAVersionType == 1 || (sysPara->status.FPGAVersionType == 2 && sysPara->para.flagOfFastMode)) { if ((sysPara->para.currPrintMode == FAST_PRINT) && (sysPara->status.currPrintRow <= 7)) fpgaWr(0xB200,(unsigned char *)fast_128k_7dot_dac,2304); else if((sysPara->para.currPrintMode == STANDARD_PRINT) && (sysPara->status.currPrintRow <= 7)) fpgaWr(0xB200,(unsigned char *)normal_128k_7dot_dac,2304); else if((sysPara->para.currPrintMode == FAST_PRINT) && (sysPara->status.currPrintRow <= 9)) fpgaWr(0xB200,(unsigned char *)normal_128k_9dot_dac,9216); else if((sysPara->para.currPrintMode == STANDARD_PRINT) && (sysPara->status.currPrintRow <= 9)) fpgaWr(0xB200,(unsigned char *)normal_128k_9dot_dac,9216); } else if(sysPara->status.build_dat.builTime == 73) writeDacValue2Fpga_No73(); else{ fpgaWr(DAC_TABLE_ADDR,(unsigned char *)DACArray,sizeof(DACArray)); /* DAC vol: 0xB280 */ fpgaWr(NOT_GAP_DAC_TABLE_ADDR,(unsigned char *)notGapDACArray,sizeof(notGapDACArray)); /* DAC vol: 0xB380 */ fpgaWr(FULL_COL_DAC_TABLE_ADDR,(unsigned char *)fullColDACArray,sizeof(fullColDACArray)); /* DAC vol: 0xB480 */ if((sysPara->para.currPrintMode == FAST_PRINT) && !sysPara->para.charWidthSetEnable){ fpgaWr(MATCH_FULL_DAC_TABLE_ADDR, (unsigned char *)matchFullDACArray, sizeof(matchFullDACArray));// 写入 匹配满列 DAC表 fpgaWr(MATCH_1_DAC_TABLE_ADDR, (unsigned char *)matchOneDACArray, sizeof(matchOneDACArray));// 写入 匹配单点 DAC表 fpgaWr(MATCH_2_DAC_TABLE_ADDR, (unsigned char *)matchTwoDACArray, sizeof(matchTwoDACArray));// 写入 匹配两点 DAC表 fpgaWr(MATCH_3_DAC_TABLE_ADDR, (unsigned char *)matchThreeDACArray, sizeof(matchThreeDACArray));// 写入 匹配三点 DAC表 fpgaWr(MATCH_4_DAC_TABLE_ADDR, (unsigned char *)matchFourDACArray, sizeof(matchFourDACArray));// 写入 匹配四点 DAC表 fpgaWr(0xA4C0, (unsigned char *)sysPara->voltePara.pixel_para_table, sizeof(sysPara->voltePara.pixel_para_table));// 写入8个 fpgaWr(MATCH_5_DAC_TABLE_ADDR, (unsigned char *)matchFiveDACArray, sizeof(matchFiveDACArray));// 写入 匹配五点 DAC表 fpgaWr(MATCH_G1_DAC_TABLE_ADDR, (unsigned char *)(matchGapDACArray[0]), (40 * 2));// 写入 匹配空一点 DAC表 fpgaWr(MATCH_G2_DAC_TABLE_ADDR, (unsigned char *)(matchGapDACArray[8]), (40 * 2));// 写入 匹配空两点 DAC表 fpgaWr(MATCH_G3_DAC_TABLE_ADDR, (unsigned char *)(matchGapDACArray[16]), (40 * 2));// 写入 匹配空三点 DAC表 fpgaWr(MATCH_G4_DAC_TABLE_ADDR, (unsigned char *)(matchGapDACArray[24]), (40 * 2));// 写入 匹配空四点 DAC表 fpgaWr(MATCH_G5_DAC_TABLE_ADDR, (unsigned char *)(matchGapDACArray[32]), (40 * 2));// 写入 匹配空五点 DAC表 fpgaWr(MATCH_G6_DAC_TABLE_ADDR, (unsigned char *)(matchGapDACArray[40]), (40 * 2));// 写入 匹配空六点 DAC表 fpgaWr(MATCH_P1_DAC_TABLE_ADDR, (unsigned char *)(matchPreDACArray[0]), (40 * 2));// 写入 匹配预备一 DAC表 fpgaWr(MATCH_P2_DAC_TABLE_ADDR, (unsigned char *)(matchPreDACArray[8]), (40 * 2));// 写入 匹配预备二 DAC表 fpgaWr(MATCH_C_DAC_TABLE_ADDR, (unsigned char *)(matchComplexDACArray), sizeof(matchComplexDACArray));// 写入 匹配复杂 DAC表 } else fpgaWr(MATCH_1_DAC_TABLE_ADDR, (unsigned char *)matchOneDACArrayStandard, sizeof(matchOneDACArrayStandard));// 写入 匹配单点 DAC表 } /*---------------------------------------------------------------------------------*/ unsigned char sequenceArray[64]; memset(sequenceArray,0,sizeof(sequenceArray)); int sequenceNum = 0; int startSequencePos = 0; int currSequencePos = 0; int rowSequenceMode = sysPara->para.rowSequenceMode?sysPara->para.rowSequenceMode:1; for(int i = 0; i < sysPara->status.currPrintRow; i++){ sequenceArray[i] = currSequencePos; currSequencePos += rowSequenceMode; if(currSequencePos >= sysPara->status.currPrintRow){ startSequencePos ++; currSequencePos = startSequencePos; } sequenceNum ++; if(sequenceNum >= sysPara->status.currPrintRow) break; } if(!sysPara->para.flagOfFastMode) fpgaWr(ROW_PRINT_SEQNENCE_ADDR,(unsigned char *)sequenceArray,sizeof(sequenceArray)); /* 0xB200 */ /*---------------------------------------------------------------------------------*/ //sysPara->para.phase_detect_high_cnt = (sysPara->para.phaseHighLowRatio*sysPara->para.divideRatio*2)/100; sysPara->para.phase_detect_high_cnt = (50*sysPara->para.divideRatio*2)/100; sysPara->para.phase_detect_voltage = sysPara->para.phaseDetectVol* MAX_FPGA_DAC_VALUE/1000; //qDebug()<<"WriteFPGA:"<para.phase_detect_high_cnt<para.phaseHighLowRatio<para.divideRatio; //qDebug()<<"WriteFPGA:"<para.phase_detect_voltage; if(( sysPara->para.printTriggerMode == PRINT_TRIGGER_SYNCHRONIZER && (sysPara->para.eleEyeClearCntInSynMode ) ) || ((sysPara->para.printTriggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL || sysPara->para.printTriggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE) && sysPara->para.synClearCntInEleEyeMode)) sysPara->para.extClearAllCntEnable = sysPara->para.eleEyeClearCntInSynMode; // 01 10 11 else sysPara->para.extClearAllCntEnable = 0; // 0 //qDebug()<<"extClearAllCntEnable"<para.extClearAllCntEnable<para.eleEyeClearCntInSynMode; //if(sysPara->para.eleEyeClearCntInSynMode==2) sysPara->para.extClearAllCntEnable |=0x02; /*-----------------------------------------------------------------------------------------------*/ //sysPara->para.timeTriggerPrintDelayMs = sysPara->para.printDelayMs; unsigned int timeTpDly=sysPara->para.printDelayMs; if(sysPara->para.printTriggerMode == PRINT_TRIGGER_TIME){ if((sysPara->para.timeTriggerPrintMode == TIME_TRIGGER_PRINT_MODE_END_TO_HEAD)){ int dotNumPerCol = sysPara->para.dotNumPerCol; //int printClkNum = dotNumPerCol*(1 + sysPara->para.charBold)*currPrintCol*(2*sysPara->para.divideRatio); //int printTmMs = printClkNum/(FPGA_SYS_HZ/1000); long printTmMs = 1.0f*dotNumPerCol*(1 + sysPara->para.charBold)*currPrintCol*(2*sysPara->para.divideRatio)/(FPGA_SYS_HZ/1000); //qDebug()<para.timeTriggerPrintDelayMs += printTmMs; timeTpDly +=printTmMs; //qDebug()<<"DelayMs:"<para.printDelayMs<<"TmMS:"<para.printDelayMs<para.timeTriggerPrintDelayMs; } sysPara->para.timeTriggerPrintDelayMs = timeTpDly; // 20150112 sysPara->para.timeTriggerPrintDelayMsH=timeTpDly>>16; //qDebug()<<"timeTpDly"<para.HighVoltageAmplitude/10; if((unsigned int)currHighVoltageIndex >= ARRAY_SIZE(sysPara->para.highVoltageRecord)){ if(!ignoreWarn){ QMessageBox::warning(NULL,tr("警告"),tr("字高超出范围")); } } else { int expected_voltage_DAC = sysPara->para.highVoltageRecord[currHighVoltageIndex]; int highVoltageStep = 0; if((unsigned int)currHighVoltageIndex < (ARRAY_SIZE(sysPara->para.highVoltageRecord) - 1)){ highVoltageStep = sysPara->para.highVoltageRecord[currHighVoltageIndex + 1] - sysPara->para.highVoltageRecord[currHighVoltageIndex]; } else highVoltageStep = sysPara->para.highVoltageRecord[currHighVoltageIndex] - sysPara->para.highVoltageRecord[currHighVoltageIndex - 1]; expected_voltage_DAC += highVoltageStep*(sysPara->para.HighVoltageAmplitude%10)/10; if(!expected_voltage_DAC){ sysPara->para.maxHighVoltageDAC = 0; //为零时,逻辑将忽略所有高压故障 #ifndef DEBUG_CNT if(!ignoreWarn && (PRODUCT_VERSION(sysPara->status.fpgaVersionNum) != JETV1)) QMessageBox::warning(NULL,tr("警告"),tr("字高太小或是高压包数据未初始化,您当前错误将忽略所有高压错误")); #endif } else sysPara->para.maxHighVoltageDAC = expected_voltage_DAC + sysPara->para.highVoltageLevel; } sysPara->para.printTotalColNum = currPrintCol; set_totalSynPulseNum(0); /* int adjLen=0; if(sysPara->para.varLenEn){//sysPara->para.cnt1EndValue adjLen =( ((sysPara->para.cnt1StartValue+sysPara->para.headLen)>sysPara->status.calandar_and_dat.cnt1CurrValue) || ((sysPara->para.cnt1EndValue-sysPara->para.endLen)status.calandar_and_dat.cnt1CurrValue) )?sysPara->para.varLen:0; } sysPara->para.totalSynPulseNum = (int )( (sysPara->para.synTriggerPrintLenMm+adjLen) *sysPara->para.synPulseNumPerMm); */ if((sysPara->para.printTriggerMode == PRINT_TRIGGER_SYNCHRONIZER) ||((sysPara->para.printTriggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL ||sysPara->para.printTriggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE) && sysPara->para.eleEyeTriggerSynPrintEn)) { unsigned int displayAreaTotalSynNum; if(sysPara->para.sysTriggerPrintMode == SYN_PRINT_MODE_ACCORDING_CHAR_WIDTH) { #define MIN_CHAR_WIDTH 0.1 //0.1mm/列 #define MAX_CHAR_WIDTH 4.0 //4.0mm/列 displayAreaTotalSynNum = (int )( (MIN_CHAR_WIDTH +sysPara->para.synCharWidthRatio*(MAX_CHAR_WIDTH - MIN_CHAR_WIDTH) /100) *currPrintCol*sysPara->para.synPulseNumPerMm ); // sysPara->para.synCharWidthRatio=8 -->列宽(0.1+ 8*(4.0-0.1)/100) = 0.412 mm if(displayAreaTotalSynNum >= 99*sysPara->para.totalSynPulseNum/100){ //if((displayAreaTotalSynNum*(1 + sysPara->para.charBold)) >= 99*sysPara->para.totalSynPulseNum/100){ displayAreaTotalSynNum = 99*sysPara->para.totalSynPulseNum/100; if(!ignoreWarn && currPrintCol) QMessageBox::warning(NULL,tr("警告"),tr("喷印间隔太短,无法满足同步打印宽度设置,字宽将自动缩短!")); } } else displayAreaTotalSynNum = (int )(sysPara->para.totalSynPulseNum*sysPara->para.synTriggerPrintLenRatio/100); if(!displayAreaTotalSynNum){ if(!ignoreWarn && currPrintCol) QMessageBox::critical(NULL,tr("错误"),tr("在同步计米的情况下无打印串或显示区域为零")); } else { if(currPrintCol){ int synNumPerCol = displayAreaTotalSynNum*(1<<8)/(currPrintCol*(1 + sysPara->para.charBold)); //加宽的时候,相当于列数翻倍 if(displayAreaTotalSynNum >= (1<<24)){ if(!ignoreWarn) QMessageBox::critical(NULL,tr("错误"),tr("在同步计米的情况下喷印同步脉冲数过多,请检查你的配置")); } if(synNumPerCol >= (1<< 16)){ if(!ignoreWarn) QMessageBox::critical(NULL,tr("警告"),tr("喷印字符串太短,请增加字符串长度或在打印设置中减少喷印长度")); } if(synNumPerCol < 5){ if(!ignoreWarn) QMessageBox::critical(NULL,tr("警告"),tr("喷印长度太短,请减少字符串长度或在打印设置中增加喷印长度")); } sysPara->para.synNumPerCol = synNumPerCol; } //sysPara->para.synPulsePerMmX8 = (unsigned short)(sysPara->para.synPulseNumPerMm *256); if(sysPara->para.synPulseNumPerMm<1 || sysPara->para.synPulseNumPerMm>50) { // sysPara->para.synPulseNumPerMm = 10; 不对脉冲数作出限制 // if(!ignoreWarn) // QMessageBox::critical(NULL,tr("警告"),tr("Encoder pulse counter per MM parameter error!")); } sysPara->para.synPulsePerMmX8 = (unsigned short)((unsigned int)sysPara->para.synPulseNumPerMm <<8); qDebug ()<<"s-"<para.synNumPerCol<<"-"<para.synPulsePerMmX8 ; } } sysPara->para.magicNum = FPGA_MAGIC_NUM_AFTER_CONF; //用来做验证的 /*-----------------------------------临时处理一下------------------------------------------------*/ unsigned char tmpHighVoltageAmplitude = sysPara->para.HighVoltageAmplitude; short phaseShift = sysPara->para.phaseShift; if(phaseShift < 0){ sysPara->para.phaseShift += 2*sysPara->para.divideRatio; } if(!sysPara->status.reclainTankReachEnd){ sysPara->para.HighVoltageAmplitude = 0; } #if 0 /* 原始值发给FPGA */ if(sysPara->para.SynCntEn) sysPara->para.SynCntEn1 = sysPara->para.SynCntEn; else { sysPara->para.SynCntEn1 = sysPara->status.isPrinting; } #else sysPara->para.SynCntEn1 = sysPara->para.SynCntEn; #endif if(sysPara->para.diaphramOffset == 0 || sysPara->para.diaphramOffset > 60) { sysPara->para.diaphramOffset = 10; } fpgaWr(PRINT_CTRL_ADDR_BASE+0x72,(unsigned char *)&sysPara->para.diaphramOffset,2); //发送隔膜位置偏移量 fpgaWr(PRINT_CTRL_ADDR_BASE+0x74,(unsigned char *)&sysPara->para.steal_dac_row,2); //fpgaWr(PRINT_CTRL_ADDR_BASE+0x76,(unsigned char *)&sysPara->para.phaseHighCnt,2); // qDebug()<<"DACStep:"<para.steal_dac_row; #if 0 int actHvAmp = sysPara->para.HighVoltageAmplitude; float tempHvAmp;// = sysPara->para.HighVoltageAmplitude * 1.73; if(sysPara->para.HighVoltageAmplitude == 0) { tempHvAmp = 0; } else if(sysPara->para.HighVoltageAmplitude == 1) { tempHvAmp = 63.5; } else { tempHvAmp = 63.5 + (sysPara->para.HighVoltageAmplitude - 1) * 1.0; //0.51 //tempHvAmp = 63.5 + (sysPara->para.HighVoltageAmplitude - 1) * 0.95; } sysPara->para.HighVoltageAmplitude = (unsigned char)tempHvAmp; //qDebug()<<"HighVoltageAmplitude:"<para.HighVoltageAmplitude; #endif fpgaWr(PRINT_CTRL_ADDR_BASE,(unsigned char *)&sysPara->para,FPGA_PRINT_PARA_BYTE_NUM); //0x3C #if 0 sysPara->para.HighVoltageAmplitude = actHvAmp; #endif // unsigned char eleMaskTimeAndMirrorCnt[4]; // eleMaskTimeAndMirrorCnt[0] = sysPara->para.eleMaskTime & 0xFF; // eleMaskTimeAndMirrorCnt[1] = (sysPara->para.eleMaskTime & 0xFF00)>>8; // eleMaskTimeAndMirrorCnt[2] = sysPara->para.AltMirrorGap & 0xFF; // eleMaskTimeAndMirrorCnt[3] = (sysPara->para.AltMirrorGap & 0xFF00)>>8; // fpgaWr(PRINT_CTRL_ADDR_BASE+0x3C,&eleMaskTimeAndMirrorCnt[0],4); //0x3C 3D 3E 3F LockTime Alt-MirrorGap fpgaWr(PRINT_CTRL_ADDR_BASE+0x3C,(unsigned char *)&sysPara->para.eleMaskTime,4); //0x3C 3D 3E 3F LockTime Alt-MirrorGap #ifdef ALT16 fpgaWr(PRINT_CTRL_ADDR_BASE+0x44,(unsigned char *)&sysPara->para.alterPrint,12); // Send AltePrit and cntNatureValue option 2017-7-18 fpgaWr(PRINT_CTRL_ADDR_BASE+0x68,(unsigned char *)&sysPara->para.stepPrint,sizeof(sysPara->para.stepPrint)); // Send StepPring 2017-7-18 #else fpgaWr(PRINT_CTRL_ADDR_BASE+0x44,(unsigned char *)&sysPara->para.stepPrint,12); // Send StepPring and AltePrit and cntNatureValue option 2014-2-23 #endif sysPara->devOp->pumpValveCtrl(); // send data to A45A~5B Ctrl Para //20140423 unsigned int volGap = (int )(sysPara->para.outputPulseDelayMs *sysPara->para.synPulseNumPerMm); fpgaWr(PRINT_CTRL_ADDR_BASE+0x64,(unsigned char *)&volGap,4);// 0x64~0x68 // 发送卷间隔 unsigned short pulseOutputAfterCnt1Printed = sysPara->para.pulse_sinal_value*10*sysPara->para.synPulseNumPerMm; sysPara->devOp->fpgaWr(PRINT_CTRL_ADDR_BASE + 0x88, (unsigned char *)&pulseOutputAfterCnt1Printed, 2); unsigned short pulseOutputAfterCnt1Print = short2BCD(sysPara->para.productNumToGenerateOutputPulse); //qDebug()<<"pulseOutputAfterCnt1Print:"<para.printRowDelay*sysPara->para.printRowDelay); //v[2]=v[0]/sqrt(v[1]); //reg_adv[i] = (reg_adv1[i]<256)? reg_adv1[i]:255; //str+= QString().sprintf("[%d,%d,%d,%d]\n",v[0],v[1], int(v[0]/v[1]),int(v[2])); v[0] =v[0]+(DACStep/(2+i*i)); str+= QString().sprintf("%d,",v[0]); } //fpgaWr(PRINT_CTRL_ADDR_BASE+0xA0,(unsigned char *)®_adv,32);// 0x64~0x68 #ifdef DEBUG_CNT qDebug()<para.HighVoltageAmplitude = tmpHighVoltageAmplitude; sysPara->para.phaseShift = phaseShift; if(sysPara->para.OuputPulseCol > 200) sysPara->para.OuputPulseCol = 200; //quint32 chargeDivideRatio_total = sysPara->para.OuputPulseCol; quint16 chargeDivideRatio = sysPara->para.OuputPulseCol; // 这是加减速误差的补偿 //fpgaWr(PRINT_CTRL_ADDR_BASE+0x6e,(unsigned char *)&chargeDivideRatio,2); /*---------------------------------------------------------------------------------------*/ #ifdef DEBUG1 qDebug()<<"writeFpgaPrintPara"<para.oscillatorVoltage); //因为经过调整参数,所以开机也要多发送一次 #endif sysPara->saveParaToFile(); sysPara->status.configDone = 1; #ifdef DEBUG1 qDebug()<<"writeFpgaPrintPara"<<"12"; #endif #endif return 0; } // 齿轮泵设置 void DevOp::WriteMoterPump(void) { fpgaWr(PRINT_CTRL_ADDR_BASE+0x70, (unsigned char *)&sysPara->para.gearPumpValue, 2); } void DevOp::ReadSomeDataForLostPrint(void) { #ifdef SYS_LINUX fpgaRd(FPGA_STATUS_BASE_ADDR+0x46,(unsigned char *)&sysPara->status.r_print_q, 14); #endif } void DevOp::ReadCnt1GroupStatus(void) { #ifdef SYS_LINUX #ifdef COUNTER1_BY_GROUP /* 分段计米 */ fpgaRd(READ_CNT1GROUP_CURR_LOOP,(unsigned char *)&sysPara->status.cnt1GroupCurrentLoop,sizeof(sysPara->status.cnt1GroupCurrentLoop)); fpgaRd(READ_CNT1GROUP_CURR_INDEX,(unsigned char *)&sysPara->status.cnt1GroupRunningIndex,sizeof(sysPara->status.cnt1GroupRunningIndex)); #endif #endif } void DevOp::writeCnt1GroupSetting(bool bCntByGroupEnable){ #ifdef SYS_LINUX #ifdef COUNTER1_BY_GROUP /* 分段计米 */ struct { unsigned char cnt1GroupNum; int StartValue; int EndValue; int LoopTimes; }cnt1GroupSettingSend; if(sysPara->para.cnt1ByGroupEnalbe) { fpgaWr(WRITE_CNT1GROUP_COUNT,(unsigned char *)&sysPara->para.Cnt1ByGroup.cnt1GroupCnt,sizeof(sysPara->para.Cnt1ByGroup.cnt1GroupCnt)); for(int i=0;ipara.Cnt1ByGroup.cnt1GroupCnt;i++) { cnt1GroupSettingSend.cnt1GroupNum = (unsigned char)i; //memcpy((unsigned char *)&cnt1GroupSettingSend.cnt1GroupSettings, &sysPara->para.Cnt1ByGroup.cnt1GroupSettings[i], sizeof(sysPara->para.Cnt1ByGroup.cnt1GroupSettings[i])); cnt1GroupSettingSend.StartValue = QString::number(sysPara->para.Cnt1ByGroup.cnt1GroupSettings[i].StartValue).toUInt(0,16);//bcd cnt1GroupSettingSend.EndValue = QString::number(sysPara->para.Cnt1ByGroup.cnt1GroupSettings[i].EndValue).toUInt(0,16); cnt1GroupSettingSend.LoopTimes = sysPara->para.Cnt1ByGroup.cnt1GroupSettings[i].LoopTimes; fpgaWr(WRITE_CNT1GROUP_NUM,(unsigned char *)&cnt1GroupSettingSend.cnt1GroupNum,1); fpgaWr(WRITE_CNT1GROUP_SETTING,(unsigned char *)&cnt1GroupSettingSend.StartValue,12); #if 0 qDebug()<<"index "<status.calandar_and_dat,16); fpgaRd((READ_CALENDAR_DAT_ADDR + 0x34) ,(unsigned char *)&sysPara->status.Status_Counter3.cnt3CurrValue,4); } void DevOp::writeFpgaCalandar(bool Enable){ Q_UNUSED(Enable); #ifdef SYS_LINUX time_t rawtime; struct tm *pTm; char buffer[20]; time( &rawtime ); pTm = localtime( &rawtime ); strftime(buffer, sizeof buffer, "%U", pTm);//%U 从星期天算,%W 从星期一算 QTime t = QTime::currentTime(); QDate d = QDate::currentDate(); int year = d.year(); sysPara->para.calandar_and_dat.leap_year = (year%400 == 0) || ((year%4 == 0) && (year%100 != 0)); //sysPara->para.calandar_and_dat.week = d.weekNumber();// sysPara->para.calandar_and_dat.dayofweek = d.dayOfWeek(); // sysPara->para.calandar_and_dat.week = QString(buffer).toInt(); sysPara->para.calandar_and_dat.week = d.weekNumber(); sysPara->para.calandar_and_dat.year = d.year(); sysPara->para.calandar_and_dat.month = d.month(); sysPara->para.calandar_and_dat.day = d.day(); sysPara->para.calandar_and_dat.hour = t.hour(); sysPara->para.calandar_and_dat.minute = t.minute(); sysPara->para.calandar_and_dat.second = t.second(); //将变量初始值写入寄存器 sysPara->para.calandar_and_dat.cnt1InitValue = QString::number(sysPara->para.cnt1StartValue).toUInt(0,16); //bcd sysPara->para.calandar_and_dat.cnt1End = QString::number(sysPara->para.cnt1EndValue).toUInt(0,16); sysPara->para.calandar_and_dat.cnt1Repeat = sysPara->para.cnt1RepeateValue; sysPara->para.calandar_and_dat.cnt1CurrValue = QString::number(sysPara->para.cnt1CurrValue).toUInt(0,16); int step = sysPara->para.cnt1StepValue; if (step == 0) step = 1; step = step < 0?(100000000 + step):step; //务必对负数的值小心处理 sysPara->para.calandar_and_dat.cnt1Step = QString::number(step).toUInt(0,16); sysPara->para.calandar_and_dat.cnt2InitValue = QString::number(sysPara->para.cnt2StartValue).toUInt(0,16); sysPara->para.calandar_and_dat.cnt2End = QString::number(sysPara->para.cnt2EndValue).toUInt(0,16); sysPara->para.calandar_and_dat.cnt2Repeat = sysPara->para.cnt2RepeateValue; sysPara->para.calandar_and_dat.cnt2CurrValue = QString::number(sysPara->para.cnt2CurrValue).toUInt(0,16); step = sysPara->para.cnt2StepValue; if (step == 0) step = 1; step = step < 0?(100000000 + step):step; sysPara->para.calandar_and_dat.cnt2Step = QString::number(step).toUInt(0,16); sysPara->para.calandar_and_dat.cntCurrValueInitEnable = (sysPara->status.cnt3CurrentValueInitDoneFlag?0:4)+ (sysPara->status.cnt2CurrentValueInitDoneFlag?0:2) + (sysPara->status.cnt1CurrentValueInitDoneFlag?0:1); fpgaWr(WRITE_CALENDAR_DAT_ADDR,(unsigned char *)&sysPara->para.calandar_and_dat,sizeof(sysPara->para.calandar_and_dat)); /*write counter3*/ sysPara->para.Counter3.cnt3CurrValue = QString::number(sysPara->para.cnt3CurrValue).toUInt(0,16); // qDebug()<<"cnt3CurrValue:"<para.cnt3CurrValue; // qDebug()<<"sysPara->status.cnt3CurrentValueInitDoneFlag:"<status.cnt3CurrentValueInitDoneFlag; sysPara->para.Counter3.cnt3End = QString::number(sysPara->para.cnt3EndValue).toUInt(0,16); sysPara->para.Counter3.cnt3InitValue = QString::number(sysPara->para.cnt3StartValue).toUInt(0,16); sysPara->para.Counter3.cnt3Repeat = sysPara->para.cnt3RepeateValue; step = sysPara->para.cnt3StepValue; if (step == 0) step = 1; step = step < 0?(100000000 + step):step; sysPara->para.Counter3.cnt3Step = QString::number(step).toUInt(0,16); fpgaWr(WRITE_COUNTER3_ADDR,(unsigned char *)&sysPara->para.Counter3,sizeof(sysPara->para.Counter3)); //qDebug()<<"sizeof(sysPara->para.Counter3):"<para.Counter3); /*write counter3 end*/ sysPara->status.cnt3CurrentValueInitDoneFlag = true; sysPara->status.cnt2CurrentValueInitDoneFlag = true; sysPara->status.cnt1CurrentValueInitDoneFlag = true; //qDebug()<<"year:"<para.calandar_and_dat.year; #endif } void DevOp::writeFpgaVariCtrl(void){ #ifdef SYS_LINUX writeFpgaCalandar(0); fpgaWrD(VAR_CNT_ADDR,sysPara->status.variNum,1); /* 0xa450 变量个数 */ reg_var_print_ctrl_t reg_var_print_ctrl; for(int i = 0; i < sysPara->status.variNum; i++){ vars_t *p_var = &sysPara->status.vars[i]; if(p_var->original && p_var->dat){ fpgaWr(PRINT_DIGITAL_CHAR_BASE_ADDR + p_var->bassAddr,p_var->dat,p_var->datWidth *p_var->rowByteNum); } memset((char *)®_var_print_ctrl,0,sizeof(reg_var_print_ctrl)); reg_var_print_ctrl.charColNum = p_var->digitalNum?p_var->width/p_var->digitalNum:0; reg_var_print_ctrl.charRamBaseAddr = p_var->bassAddr; reg_var_print_ctrl.charRowNum = p_var->endRowPos - p_var->startRowPos; reg_var_print_ctrl.horizonWidth = p_var->width;//字模的宽度 reg_var_print_ctrl.colOffset = p_var->startColPos+BLANK_COL_NUM; reg_var_print_ctrl.verticalOffset = p_var->startRowPos; reg_var_print_ctrl.varDigitalNum = p_var->digitalNum; // reg_var_print_ctrl.varTypeSel = p_var->type %20; reg_var_print_ctrl.varTypeSel = Public::getType(p_var->type) %20; fpgaWr(VAR_CTRL_REG_ADDR,(unsigned char *)®_var_print_ctrl,sizeof(reg_var_print_ctrl)); } #endif } void DevOp::printCtrl(int cmd){ //printCtrl2(cmd); fpgaWrD(PRINT_START_STOP_CTRL,cmd,1); } void DevOp::printCtrl2(int cmd){ if(sysPara->para.SynCntEn) sysPara->para.SynCntEn1 = sysPara->para.SynCntEn; else { sysPara->para.SynCntEn1 = sysPara->status.isPrinting; } #ifdef ALT16 fpgaWr(PRINT_CTRL_ADDR_BASE+0x44,(unsigned char *)&sysPara->para.alterPrint,12); // Send AltePrit and cntNatureValue option 2017-7-18 fpgaWr(PRINT_CTRL_ADDR_BASE+0x68,(unsigned char *)&sysPara->para.stepPrint,sizeof(sysPara->para.stepPrint)); // Send StepPring 2017-7-18 #else fpgaWr(PRINT_CTRL_ADDR_BASE+0x44,(unsigned char *)&sysPara->para.stepPrint,12); // Send StepPring and AltePrit and cntNatureValue option 2014-2-23 #endif cmd=1; } unsigned int DevOp::readFpgaVersionNum(){ fpgaRd(0x00EC,&sysPara->status.FPGAChipType,1); return (sysPara->status.fpgaVersionNum = fpgaRdD(FPGA_VERSOIN_NUM,2)); } void DevOp::readbuilDat(void){ fpgaRd(READ_BUILD_DAT,(unsigned char *)&sysPara->status.build_dat,sizeof(sysPara->status.build_dat)); fpgaRd(FPGA_STATUS_BASE_ADDR + 0xed,(unsigned char *)&sysPara->status.build_dat.year,sizeof(sysPara->status.build_dat.year)); fpgaRd(FPGA_STATUS_BASE_ADDR + 0xee,(unsigned char *)&sysPara->status.build_dat.month,sizeof(sysPara->status.build_dat.month)); fpgaRd(FPGA_STATUS_BASE_ADDR + 0xef,(unsigned char *)&sysPara->status.build_dat.day,sizeof(sysPara->status.build_dat.day)); } void DevOp::readPrintDataXor(void){ fpgaRd(READ_PRINTDATA_XOR, (unsigned char *)&sysPara->status.xor_sync, 2); } void DevOp::readSyncCounterAtZero(void){ fpgaRd(READ_SYNC_COUNTER, (unsigned char *)&sysPara->status.xor_sync.sync_counter_at_zero, sizeof(sysPara->status.xor_sync.sync_counter_at_zero)); } void DevOp::clearProductCnt(unsigned int mode){ fpgaWrD(PRINT_RESET_PRODUCT_CNT,mode,1); } void DevOp::resumeFault(){ fpgaWrD(RESUME_FAULT_ADDR,1,1); } void DevOp::highVoltageCtrl(int val){ fpgaWrD(PRINT_CTRL_ADDR_BASE + (unsigned int)(&sysPara->para.HighVoltageAmplitude) - (unsigned int)(&sysPara->para),(unsigned int)val,1); //qDebug()<<"highVoltageCtrl"<status.waitHightVolOn =0; fpgaWrD(PRINT_CTRL_ADDR_BASE + (unsigned int)(&sysPara->para.maxHighVoltageDAC) - (unsigned int)(&sysPara->para),(unsigned int)val,2); } void DevOp::setPhaseByHand(int val){ sysPara->para.phaseByHand = val; fpgaWrD(PRINT_CTRL_ADDR_BASE + (unsigned int)(&sysPara->para.phaseByHand) - (unsigned int)(&sysPara->para),(unsigned int)val,1); } void DevOp::readPhaseDetectHighTm(void){ fpgaRd(PHASE_DETECT_HIGH_VOLTAGE_TM,(unsigned char *)&sysPara->status.phaseDetectHighTm,sizeof(sysPara->status.phaseDetectHighTm)); } void DevOp::setPhaseDetectVoltageDutyCycle(int duty){ unsigned value = (duty * sysPara->para.divideRatio * 2) / 100; fpgaWrD(PRINT_CTRL_ADDR_BASE + (unsigned int)(&sysPara->para.phase_detect_high_cnt) - (unsigned int)(&sysPara->para),value,2); //qDebug()<<"WriteFPGA:"<para.phaseHighLowRatio<para.divideRatio; } void DevOp::setBlickLightPeriod(int value){ fpgaWrD(PRINT_CTRL_ADDR_BASE + (unsigned int)(&sysPara->para.blinkLightPeriod) - (unsigned int)(&sysPara->para),value,2); } void DevOp::setOscillatorVoltage(int value){ #ifdef __VX_OSC_VOL__ if(value<100) fpgaWrD(PRINT_CTRL_ADDR_BASE + (unsigned int)(&sysPara->para.oscillatorVoltage) - (unsigned int)(&sysPara->para),OscillatorVoltage[value],1); #else fpgaWrD(PRINT_CTRL_ADDR_BASE + (unsigned int)(&sysPara->para.oscillatorVoltage) - (unsigned int)(&sysPara->para),value,1); #endif } void DevOp::setDivideRatio(int value){ fpgaWrD(PRINT_CTRL_ADDR_BASE + (unsigned int)(&sysPara->para.divideRatio) - (unsigned int)(&sysPara->para),value,2); } void DevOp::setLastLineEndPointFixedValue(int value){ fpgaWrD(PRINT_CTRL_ADDR_BASE + (unsigned int)(&sysPara->para.lastLineEndPointFixedDACValue) - (unsigned int)(&sysPara->para),value*MAX_FPGA_DAC_VALUE/1000,2); } void DevOp::mainInkCtrl() { fpgaWrD(MAININKCTRL_ADDR,(isReleaseValveOpen()?(1<<3):0)+(isMainInkPumpOpen()?(1<<2):0) + (sysPara->status.selfCheckDone?(1<<1):0) + (sysPara->status.isPumpValveControledByHand?1:0),1); } void DevOp::pumpValveCtrl(int viscosityAdjustByTemp)//20140423 OK { char buf[20]; int i=0; int viscostyRealValue, tempOffset; static int hadGetIndoorTemperature=0; memset(buf,0,sizeof(buf)); buf[i++]=(isReleaseValveOpen()?(1<<3):0) +(isMainInkPumpOpen()?(1<<2):0) + (sysPara->status.selfCheckDone?(1<<1):0) + (sysPara->status.isPumpValveControledByHand?1:0); if(!sysPara->para.gearPumpEnable) { buf[i++] = (sysPara->para.pressure/5)&0xff; //buf[i++]=((sysPara->para.pressure/5)/256)&0xff; buf[i++] = ((sysPara->para.pressure/5)>>8)&0xff; } else { buf[i++] = (sysPara->para.pressure)&0xff; //buf[i++]=((sysPara->para.pressure/5)/256)&0xff; buf[i++] = (sysPara->para.pressure>>8)&0xff; } buf[i++]=(sysPara->para.viscosityPumpInterval*100)&0xff; //buf[i++]=((sysPara->para.viscosityPumpInterval*100)/256)&0xff; buf[i++]=((sysPara->para.viscosityPumpInterval*100)>>8)&0xff; if(!hadGetIndoorTemperature) { hadGetIndoorTemperature = viscosityAdjustByTemp; } if(!hadGetIndoorTemperature) { buf[i++]=(sysPara->para.viscosity)&0xff; //buf[i++]=((sysPara->para.viscosity)/256)&0xff; buf[i++]=((sysPara->para.viscosity)>>8)&0xff; } else { tempOffset = sysPara->status.indoorTemperature-35; if(tempOffset>5)//超过40度就按照40度计算 { tempOffset = 5; } if(tempOffset>0) { if(sysPara->para.viscosityAdjust==1)//0.6% { //viscostyRealValue = sysPara->para.viscosity - sysPara->para.viscosity*(tempOffset*3)/5/100; viscostyRealValue = sysPara->para.viscosity - sysPara->para.viscosity*(tempOffset*3)/500; } else if(sysPara->para.viscosityAdjust==2)//1.0% { //viscostyRealValue = sysPara->para.viscosity - sysPara->para.viscosity*(tempOffset*5)/5/100; viscostyRealValue = sysPara->para.viscosity - sysPara->para.viscosity*tempOffset/100; } else if(sysPara->para.viscosityAdjust==3)//1.6% { //viscostyRealValue = sysPara->para.viscosity - sysPara->para.viscosity*(tempOffset*8)/5/100; viscostyRealValue = sysPara->para.viscosity - sysPara->para.viscosity*tempOffset*8/500; } else if(sysPara->para.viscosityAdjust==3)//2.0% { //viscostyRealValue = sysPara->para.viscosity - sysPara->para.viscosity*(tempOffset*10)/5/100; viscostyRealValue = sysPara->para.viscosity - sysPara->para.viscosity*tempOffset*2/100; } else { viscostyRealValue = sysPara->para.viscosity; } } else { viscostyRealValue = sysPara->para.viscosity; } buf[i++]=viscostyRealValue&0xff; buf[i++]=(viscostyRealValue>>8)&0xff; } buf[i++]=(sysPara->para.reclaimPumpPWMWidth)&0xff; buf[i++]=((sysPara->para.temperature))&0xff; buf[i++]=(sysPara->devOp->isReclaimPumpOpen()?(1<<0):0) | (sysPara->devOp->isCompressPumpOpen()?(1<<1):0) | (sysPara->devOp->isViscosityPumpOpen()?(1<<2):0) | (sysPara->devOp->isCycleValveOpen()?(1<<3):0) | (sysPara->devOp->isInkValveOpen()?(1<<4):0) | (sysPara->devOp->isMixValveOpen()?(1<<5):0); // fpgaWrD(MAININKCTRL_ADDR,(isReleaseValveOpen()?(1<<3):0)+(isMainInkPumpOpen()?(1<<2):0) + (sysPara->status.selfCheckDone?(1<<1):0) + (sysPara->status.isPumpValveControledByHand?1:0),1); fpgaWr(MAININKCTRL_ADDR,(unsigned char *)buf,i);// //20140423 5A,5B /* `ifdef AUTOCTRL 8'h5c: reg_set_viscosityPumpInterval[0+:8]<= ctrl_reg_dat; // 粘度泵动作时间间隔(默认值60s) 8'h5d: reg_set_viscosityPumpInterval[8+:6]<= ctrl_reg_dat[5:0]; // 粘度泵动作时间间隔, 上位机 *100后再传送 8'h5e: reg_set_viscosity[0+:8] <= {ctrl_reg_dat}; // 粘度设定值 8'h5f: reg_set_viscosity[8+:8] <= {ctrl_reg_dat}; // 粘度设定值 8'h60: reg_set_reclaimPumpPWMWidth <= ctrl_reg_dat; // 回收泵力度PWM 0~90 8'h61: reg_set_temperature <= ctrl_reg_dat; // 喷头温度设定值 8'h62: {reg_is_MixValve_open,reg_is_InkValve_open, reg_is_CycleValve_open,reg_is_ViscoPump_open, reg_is_CompressPump_open,reg_is_ReclaimPump_open}<=ctrl_reg_dat; // 混合阀//供墨阀// 循环阀//粘度泵 // 压缩机// 回收泵 `endif */ } #ifdef __STC_POWER__ #include #include #include //#include #define STC_CHIP_ADDR 0x50 int DevOp::Heartbeat(char bPowerOn) { // int flag = bPowerOn; // qDebug()<<"Heartbeat: "<isOpen()) { int n = comForPower->write(temp); //qDebug()<<"power com send "<isOpen()) { int n; #if 0 n= comForPower->bytesAvailable(); if(n>0) { recResponse.append(comForPower->read(n)); QString str; str.sprintf("%d - %d - %d", recResponse.at(0),recResponse.at(1),recResponse.at(2)); qDebug()<write(temp); qDebug()<<"set wake up "<bytesAvailable(); if(n>0) { recResponse.append(comForPower->read(n)); QString str; str.sprintf("%d - %d - %d", recResponse.at(0),recResponse.at(1),recResponse.at(2)); qDebug()<< "n" << n <<" " <isOpen()) { int n = comForPower->bytesAvailable(); if(n>0) { recResponse.append(comForPower->read(n)); } n = comForPower->write(temp); // QElapsedTimer timer; // timer.start(); // while(timer.elapsed()<50) // { // ; // } MySleep(200); n = comForPower->bytesAvailable(); if(n<=0) { return 0; } // 接收数据 recResponse.append(comForPower->read(n)); //qDebug()<<"n" << n<<" power by:"< #include #include #include #include qint8 DevOp::GetTemp(QString ainFile, quint8 *pTemp) { int value; qint8 ret = 0; FILE *fp; std::string ain_str = ainFile.toStdString(); const char *file_path = ain_str.c_str(); //sprintf(pChar, "%s", BOART_TEMP_DEVICE); fp = fopen(file_path, "r" ); if( fp==NULL ) { //qDebug()<<"open file fail:"<status.ExtScreenEn; } #ifdef UART2 //======================================================================================= void DevOp::sendCom(char *buf,int len) { QByteArray temp; temp.append(buf,len); if(sysPara->status.ExtScreenEn && (myCom->isOpen())) myCom->write(temp); } void DevOp::sendCom(QString s) { if(sysPara->status.ExtScreenEn && (myCom->isOpen())) { myCom->write(s.toAscii()); } } int DevOp::recUart2() { if(!sysPara->status.ExtScreenEn)return 0; int n=myCom->bytesAvailable(); if(n<=0) { if(recData.length()) { //showData(recData); //recData.constBegin() readCom(recData.at(1),recData,recData.at(0)); recData.clear(); } return 0; } if (!myCom->isOpen()) return 0; // 接收数据 recData.append(myCom->read(n)); return recData.length(); } void DevOp::readCom(char mode,QByteArray rec,int addr) { //qDebug() << "read11:"<< rec.length(); recLen = rec.length(); recData = rec; int len=recData.length(); if(mode== 'R' || mode== 'S' ) { if(addr==FPGA_STATUS_BASE_ADDR){ //if(len>FPGA_STATUS_BYTE_NUM) return; //qDebug() << "read11:"<< rec.length()<status,recData,FPGA_STATUS_BYTE_NUM); len = sizeof(sysPara->status.calandar_and_dat); addr = 0x80; memcpy((unsigned char *)&sysPara->status.calandar_and_dat,recData.mid(addr,len),len); if(sysPara->status.detectBestOscillatorVoltageAppending || sysPara->status.detectHighVoltageAppending ) { memcpy((unsigned char *)&sysPara->status.phaseDetectHighTm, recData.mid(PHASE_DETECT_HIGH_VOLTAGE_TM,sizeof(sysPara->status.phaseDetectHighTm)), sizeof(sysPara->status.phaseDetectHighTm)); } len = sizeof(sysPara->status.fpgaVersionNum); addr = 0x62; memcpy((unsigned char *)&sysPara->status.fpgaVersionNum,recData.mid(addr,len),len); memcpy((unsigned char *)&sysPara->status.build_dat, recData.mid(0x60,sizeof(sysPara->status.build_dat)), sizeof(sysPara->status.build_dat)); if(!sysPara->para.gearPumpEnable) sysPara->status.PRESSURE *= 5; //响应群众号召,数值放大五倍 } else return; } } else if(addr ==0x01 )//仪表返回到信息 { // qDebug()<<"C:"<isOpen()) { return 2;} // check if sending operation is enable if (!sendingEnable ) { //qDebug()<<"com is busy."; return 3;} if(uartThread) { uartThread->addDataToSend(data); } else { myCom->write(data); } //showData(data); return 1; } // Stop the currently receiving data operation (don't terminate the thread) void DevOp::stopReceiving() { // If the Receiving is not alread active OR the uartThread is not initialized if (!receivingEnable || !uartThread) return; // If the SerialPort is currently receiving data, stop if (uartThread->isRunning()) { saveStateReceiveData = false; uartThread->stopReceiving(); // wait(); //uartThread->wait(); } } // Start the receiving thread // return 1 OK // return 2 port closed // return 3 receiving operation disable uchar DevOp::uartThreadStart() { // check the port if is open if (!myCom->isOpen()) return 2; if (!uartThread) uartThread = new UartThread(*myCom); enableReceiving(); enableSending(); // check if receiving operation is enable if (!receivingEnable && !uartThread) return 3; // If the SerialPort receiving thread is not currently active, start it if (!uartThread->isRunning()) { saveStateReceiveData = true; uartThread->start(); //qDebug()<<"uartThread start."; } return 1; } /******************************* Methods **************************************/ // Add the data to the Send Queue void UartThread::addDataToSend(const QByteArray &dataToAdd) { for (int i=0; i0) { recDelay1=10; data.append(port.read(numBytes)); //qDebug()<<"rec"<write(temp); } void DevOp::readUart1(){ int numBytes = 0; static int r_num=0,rlen=0; unsigned char crc8; numBytes = myCom->bytesAvailable(); if (numBytes>0) { //recDelay1=0; //mutexReceive.lock(); data = myCom->read(numBytes); //mutexReceive.unlock(); //qDebug()<<"Rec:"<write(QByteArray().append("sos.")); //rec and process different; switch(rec_cmd.mode){ case 0: // &S14??co if((data.at(0)=='&' && (data.at(1)=='R' ||data.at(1)=='S' || data.at(1)=='C' )) &&(data.at(2)==LOCADDR) && data.endsWith("o")) { // qDebug()<30){ if((rec_r.at(0)=='$' ) &&(rec_r.at(1)=='D' ) && (rec_r.at(2)==LOCADDR) )//data.endsWith("o")) { if(rec_cmd.addr==0){ rec_cmd.addr = rec_r.at(2); r_dataFromPC.printRowDotNum =dat_r.at(0); // r_dataFromPC.printColDotNum = (dat_r.at(0)<<24)+(dat_r.at(1)<<16) + (dat_r.at(2)<<8)+(dat_r.at(3)<<0); // r_dataFromPC.Length = (dat_r.at(0)<<24)+(dat_r.at(1)<<16) + (dat_r.at(2)<<8)+(dat_r.at(3)<<0); // //qDebug()<<"len:"< (rec_cmd.len +12) && rec_cmd.len) rec_cmd.mode=0; } else { rec_cmd.mode=0; } if((data.left(2)=="&C" || data.left(2)=="&R" ||data.left(2)=="&S" )&&(data.at(2)==LOCADDR) && data.endsWith("o")) { rec_cmd.flag_m= data.at(1); rec_cmd.addr = data.at(2); rec_r.clear(); rec_r.append(data); readCom( rec_cmd.flag_m,rec_r,rec_cmd.addr ); rec_cmd.mode=0; } } else rec_cmd.mode=0; break; case 2:// $D1rccccLLLLddd...ddco dat_r.append(data); rec_r.append(data); //qDebug()<(1+r_dataFromPC.printRowDotNum*(1+r_dataFromPC.printColDotNum/8) )) {rec_cmd.mode=0;r_dataFromPC.keyword=0;} dat_r.clear(); crc8=0; } else if(r_num>11){ if(rlen){ dat_r.append(data) ; rlen=rlen-data.length(); crc8 = crc8 ^ data.at(0); } else { rec_cmd.mode=0; if(data.at(0)=='o' && crc8==0 ) readCom( rec_cmd.flag_m,dat_r,rec_cmd.addr ); else readCom( rec_cmd.flag_m,QByteArray("!Error"),rec_cmd.addr); } } r_num++; break; case 3: break; case 4: break; default: break; } //recDelay=0; } } void DevOp::sendCom(QString s) { myCom->write(s.toAscii()); } void DevOp::readCom(char mode,QByteArray rec,int addr) { // sendData ?? qDebug() << "read11:"<status.printCmd; statusToPC.printMode='X';//sysPara->status.printMode; statusToPC.statWarn=sysPara->status.statWarn; statusToPC.isPumpValveControledByHand=sysPara->status.isPumpValveControledByHand; statusToPC.mainInkPumpError=sysPara->status.mainInkPumpError; statusToPC.selfCheckDone=sysPara->status.selfCheckDone; statusToPC.reclainTankReachEnd=sysPara->status.reclainTankReachEnd; statusToPC.beeperOnFlag=sysPara->status.beeperOnFlag; statusToPC.lostCommuFlag=sysPara->status.lostCommuFlag; statusToPC.isPrinting=sysPara->status.isPrinting; statusToPC.reclaimTankBlockedAppending=sysPara->status.reclaimTankBlockedAppending; statusToPC.selfCheckCnt=sysPara->status.selfCheckCnt; statusToPC.currReclaimTankPos=sysPara->status.currReclaimTankPos; statusToPC.productCnt=sysPara->status.productCnt; //unsigned int productCnt; //statusToPC.selfCheckCnt=sysPara->status.selfCheckCnt; //statusToPC.selfCheckCnt=sysPara->status.selfCheckCnt; //statusToPC.selfCheckCnt=sysPara->status.selfCheckCnt; qDebug()<status.currPrintRow; dataToPC.printColDotNum = sysPara->status.currPrintCol; //dataToPC.Length = (dataToPC.printRowDotNum* (1+dataToPC.printColDotNum/8))+2; dataToPC.Length = (dataToPC.printColDotNum* MAX_PRINT_ROW_BYTE_NUM)+2; dataToPC.dotData = sysPara->status.printDat;//(unsigned char *)calloc(dataToPC.printRowDotNum,MAX_PRINT_ROW_BYTE_NUM); //memcpy((void *)dataToPC.dotData, , dataToPC.Length-2); //qDebug()<status.currPrintRow<status.printDat,dataToPC.Length-2); sendCom((char *) &dataToPC.crc,2); //sendCom("dfsaffadsf"); //QString s=""; for(int i=0;istatus.currPrintRow; dataToPC.printColDotNum = sysPara->status.currPrintCol; dataToPC.Length = (dataToPC.printColDotNum* MAX_PRINT_ROW_BYTE_NUM)+2; dataToPC.dotData = sysPara->status.printDat;//(unsigned char *)calloc(dataToPC.printRowDotNum,MAX_PRINT_ROW_BYTE_NUM); sendCom((char *) &dataToPC,12); sendCom((char *) &sysPara->status.printDat,dataToPC.Length-2); sendCom((char *) &dataToPC.crc,2); //sendCom("dfsaffadsf"); //QString s=""; for(int i=0;ipara.qrOption.text,s.toAscii(),s.length()); memcpy( (unsigned char *)sysPara->para.qrOption.text,s.toAscii(),s.length()); //sprintf(sysPara->para.qrOption.text,s.toAscii(),s.length()); sysPara->para.qrOption.text[s.length()]='\0'; // 不可缺少的哦 sysPara->para.qrOption.RecFromHost=1; //RecFromHost sysPara->para.qrOption.VarNum = (mode=='V'); //qDebug()<para.qrOption.text)<<"sysPara->para.qrOption.VarNum"<para.qrOption.VarNum; sendCom("OK");//sendCom(s); sendCom("\r\n"); sysPara->saveParaToFile(); // 设置标志位 1,主程序中根据标志位来进行转换,并刷新显示 } else if(mode== 'C' && rec.startsWith("&")&& rec.endsWith("o")){// 写paraCmd 参数的命令 sendCom(rec); } else if(mode== 'D' && rec.startsWith("$")&& rec.endsWith("o")){// 写paraData点阵内容的命令 //memcpy((unsigned char *)&sysPara->status,recData,FPGA_STATUS_BYTE_NUM); //memcpy((unsigned char *)&sysPara->status.calandar_and_dat,recData.mid(addr,len),len); sendCom(rec); } else { sendCom(QString().sprintf("addr:%d",LOCADDR)); } } // Enable the SerialPort to send data (init the thread) void DevOp::enableSending() { if (!uartThread) uartThread = new UartThread1(*myCom); if (!sendingEnable) { sendingEnable = true; } } // Disable the SerialPort to send data (terminate the thread) void DevOp::disableSending() { // If the Sending is already active AND there is a sendThread if (sendingEnable) { sendingEnable = false; } if ( !isReceivingEnable() && uartThread) { delete uartThread; uartThread = NULL; } } bool DevOp::isSendingEnable() const { return sendingEnable; } // Enable the SerialPort to receive data (init the thread) void DevOp::enableReceiving() { // If the Receiving is not already active AND the receiveThead is not initialized if (!uartThread) uartThread = new UartThread1(*myCom); if (!receivingEnable) { if(uartThread) qDebug()<isOpen()) { return 2;} // check if sending operation is enable if (!sendingEnable ) { //qDebug()<<"com is busy."; return 3;} if(uartThread) { uartThread->addDataToSend(data); } else myCom->write(data); return 1; } // Stop the currently receiving data operation (don't terminate the thread) void DevOp::stopReceiving() { // If the Receiving is not alread active OR the uartThread is not initialized if (!receivingEnable || !uartThread) return; // If the SerialPort is currently receiving data, stop if (uartThread->isRunning()) { saveStateReceiveData = false; uartThread->stopReceiving(); // wait(); //uartThread->wait(); } } // Start the receiving thread // return 1 OK // return 2 port closed // return 3 receiving operation disable uchar DevOp::uartThreadStart() { // check the port if is open if (!myCom->isOpen()) return 2; if (!uartThread) uartThread = new UartThread1(*myCom); enableReceiving(); //qDebug()<<("recOK\n"); enableSending(); // check if receiving operation is enable if (!receivingEnable && !uartThread) return 3; // If the SerialPort receiving thread is not currently active, start it if (!uartThread->isRunning()) { saveStateReceiveData = true; uartThread->start(); qDebug()<<"uartThread start."; } return 1; } /******************************* Methods **************************************/ // Add the data to the Send Queue void UartThread1::addDataToSend(const QByteArray &dataToAdd) { for (int i=0; i0) { recDelay1=0; mutexReceive.lock(); data = port.read(numBytes); mutexReceive.unlock(); //qDebug()<<"Rec:"<30){ if((rec_r.at(0)=='$' ) &&(rec_r.at(1)=='D' ) && (rec_r.at(2)==LOCADDR) )//data.endsWith("o")) { if(rec_cmd.addr==0){ rec_cmd.addr = rec_r.at(2); r_dataFromPC.printRowDotNum =dat_r.at(0); // r_dataFromPC.printColDotNum = (dat_r.at(0)<<24)+(dat_r.at(1)<<16) + (dat_r.at(2)<<8)+(dat_r.at(3)<<0); // r_dataFromPC.Length = (dat_r.at(0)<<24)+(dat_r.at(1)<<16) + (dat_r.at(2)<<8)+(dat_r.at(3)<<0); // //qDebug()<<"len:"< (rec_cmd.len +12) && rec_cmd.len) rec_cmd.mode=0; } else { rec_cmd.mode=0; } if((data.left(2)=="&C" || data.left(2)=="&R" ||data.left(2)=="&S" )&&(data.at(2)==LOCADDR) && data.endsWith("o")) { rec_cmd.flag_m= data.at(1); rec_cmd.addr = data.at(2); rec_r.clear(); rec_r.append(data); emit dataReceived( rec_cmd.flag_m,rec_r,rec_cmd.addr ); rec_cmd.mode=0; } } else rec_cmd.mode=0; break; case 2:// $D1rccccLLLLddd...ddco dat_r.append(data); rec_r.append(data); //qDebug()<(1+r_dataFromPC.printRowDotNum*(1+r_dataFromPC.printColDotNum/8) )) {rec_cmd.mode=0;r_dataFromPC.keyword=0;} dat_r.clear(); crc8=0; } else if(r_num>11){ if(rlen){ dat_r.append(data) ; rlen=rlen-data.length(); crc8 = crc8 ^ data.at(0); } else { rec_cmd.mode=0; if(data.at(0)=='o' && crc8==0 ) emit dataReceived( rec_cmd.flag_m,dat_r,rec_cmd.addr ); else emit dataReceived( rec_cmd.flag_m,QByteArray("!Error"),rec_cmd.addr); } } r_num++; break; case 3: break; case 4: break; default: break; } recDelay=0; } } } // 26 52 01 04 3F 3F 63 6F &S14??co // 24 43 01 04 3F 3F 63 6F $C14??co #endif #ifdef __STC_POWER__ void DevOp::comForPower_init(void) { if(comForPower==NULL) comForPower = new Posix_QextSerialPort("/dev/ttyO4",QextSerialBase::Polling); if(comForPower) { comForPower ->open(QIODevice::ReadWrite); if (!comForPower->isOpen()) { qDebug()<<"uart for power is not open!"; return; } comForPower->setBaudRate(BAUD115200); comForPower->setDataBits(DATA_8); comForPower->setParity(PAR_NONE); comForPower->setStopBits(STOP_1); comForPower->setFlowControl(FLOW_OFF); comForPower->setTimeout(1);; } else { qDebug()<<"uart for power not exit!"; } } #endif #ifdef __com_485_ extern void MySleep(unsigned int msec); Posix_QextSerialPort* DevOp::comForRFID = NULL; void DevOp::comForRFID_init(void) { if(comForRFID==NULL) comForRFID = new Posix_QextSerialPort("/dev/ttyO1",QextSerialBase::Polling); if(comForRFID) { comForRFID->open(QIODevice::ReadWrite); if (!comForRFID->isOpen()) { qDebug()<<"uart for RFID is not open!"; return; } comForRFID->setBaudRate(BAUD38400); comForRFID->setDataBits(DATA_8); comForRFID->setParity(PAR_EVEN); comForRFID->setStopBits(STOP_1); comForRFID->setFlowControl(FLOW_OFF); comForRFID->setTimeout(1); } else { qDebug()<<"uart for RFID not exit!"; } } #if 0 int DevOp::comReadRFID_data() { // UCHAR Cmd[23] = { 0x01, 0x17, 0xA4, 0x20, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; // UCHAR revdata[100]; // Cmd[1] = 0x08; // Cmd[2] = 0xA3; // Cmd[4] = 0x06; //读块6 // CheckSumOut(Cmd, Cmd[1]); // QByteArray temp; QByteArray recResponse; // temp.append((const char*)Cmd,Cmd[1]); if(comForRFID->isOpen()) { //int n = comForRFID->write(temp); //qDebug()<<"power com send "<bytesAvailable(); if(n>0) { recResponse.append(comForRFID->read(n)); QString str; str.sprintf("%d - %d - %d", recResponse.at(0),recResponse.at(1),recResponse.at(2)); qDebug()<isOpen()) // { // int n = comForRFID->write(temp); // //qDebug()<<"power com send "<bytesAvailable(); // if(n>0) // { // recResponse.append(comForRFID->read(n)); // QString str; // str.sprintf("%d - %d - %d", recResponse.at(0),recResponse.at(1),recResponse.at(2)); // qDebug()<status.RandomNum>0) DevOp.Read_RanddomFromFpga(); */ // 20161217 修改测试 // 20170711 随机码位置错位问题 void DevOp::Read_RanddomFromFpga() { unsigned char buf[256]; QByteArray str; QString ss; int i,len,n,c; //fpgaRd(READ_RAND_FIFO_ADDR ,(unsigned char *)buf,sizeof(sysPara->status.calandar_and_dat)); if(sysPara->status.RandomNum>0) { if(sysPara->status.RandomNum>32){ qDebug()<<"RandomNum:"<status.RandomNum; return; } len = sysPara->status.RandomNum*8; if(len>256)return; fpgaRd(READ_RAND_FIFO_ADDR ,(unsigned char *)buf,len); ss=""; n=0; for(i=0;istatus.RandomDigitNum) //12 ; //0,1,2,3 4,5,6,7,8,9 0 1,2,3,4,5 else if( k >= 16-sysPara->status.RandomDigitNum) { //ss+=QString().sprintf("%02X ",buf[i]); if(c==0) str.append( ((buf[i]>>4)& 0x0f)|0x30); else if(c==1) str.append((buf[i]& 0x0f)|0x30); if(k==15) { str.append(" "); //ss+="\r\n"; } } else ; n++; } } //qDebug()<3500000) { sysPara->status.RandomBackCnt=10; ss= "mv /home/plg/Xrand2.txt /home/plg/rand" + QDateTime::currentDateTime().toString("yyMMddhhmmss")+".txt"; system(ss.toAscii()); return; } } } /* 原来的 void DevOp::Read_RanddomFromFpga() { unsigned char buf[256]; QByteArray str; QString ss; int i,len,n; //fpgaRd(READ_RAND_FIFO_ADDR ,(unsigned char *)buf,sizeof(sysPara->status.calandar_and_dat)); if(sysPara->status.RandomNum>0) { len = sysPara->status.RandomNum*8; fpgaRd(READ_RAND_FIFO_ADDR ,(unsigned char *)buf,len); ss=""; n=0; for(i=0;istatus.RandomDigitNum) //12 ; //0,1,2,3 4,5,6,7,8,9 0 1,2,3,4,5 else if( k >= 16-sysPara->status.RandomDigitNum) { //ss+=QString().sprintf("%02X ",buf[i]); str.append( buf[i]>>4& 0x0f|0x30); str.append(buf[i]& 0x0f|0x30); if(k==14) { str.append(" "); //ss+="\r\n"; } } else ; n+=2; } //qDebug()<3500000) { sysPara->status.RandomBackCnt=10; ss= "mv /home/plg/Xrand2.txt /home/plg/rand" + QDateTime::currentDateTime().toString("yyMMddhhmmss")+".txt"; system(ss.toAscii()); return; } } } */ void DevOp::RandTxtBakup(char ok) // ok 0:不一定备份,1直接备份 { QFile f1("/home/plg/Xrand2.txt"); QString str; str= "mv /home/plg/Xrand2.txt /udisk/rand" + QDateTime::currentDateTime().toString("yyMMddhhmmss")+".txt"; if(sysPara->status.RandomBackCnt>5){ system(str.toAscii()); system("mv /home/plg/rand*.txt /udisk/"); //system("rm /home/plg/rand*.txt"); sysPara->status.RandomBackCnt=0; } else { //f1.open(QFile::ReadWrite); int len= f1.size(); //f1.close(); if(len>3500000 || ok ) { system(str.toAscii()); system("mv /home/plg/rand*.txt /udisk/"); } } } void DevOp::writeDacValue2Fpga_No72NewVoltData(){ // LogInfo::setRunStatusText(tr("writeDacValue2Fpga_No72NewVoltData")); qDebug()<<"writeDacValue2Fpga_No72NewVoltData"; fpgaWr(0xA600, (unsigned char *)(sysPara->voltePara_25Dots.matchTotalTableDACArray1), (128)); fpgaWr(0xA680, (unsigned char *)(sysPara->voltePara_25Dots.matchTotalTableDACArray2[0]), (64 * 2*2)); fpgaWr(0xA780, (unsigned char *)(sysPara->voltePara_25Dots.matchTotalTableDACArray3[0]), (64 * 3*2)); fpgaWr(0xA900, (unsigned char *)(sysPara->voltePara_25Dots.matchTotalTableDACArray4[0]), (64 * 4*2)); fpgaWr(0xAB00, (unsigned char *)(sysPara->voltePara_25Dots.matchTotalTableDACArray5[0]), (64 * 5*2)); fpgaWr(0xB380, (unsigned char *)(sysPara->voltePara_25Dots.matchContinousDACArray), (64 * 2)); fpgaWr(0xBC00, (unsigned char *)(sysPara->voltePara_25Dots.matchTotalDiffVoltageValue[0]), (64 * 50)); fpgaWr(0xB400, (unsigned char *)(sysPara->voltePara_25Dots.matchExtraLineDACArray), (64)); fpgaWr(0xB440, (unsigned char *)(sysPara->voltePara_25Dots.matchFirstOnePointExtraLineDACArray), (64)); fpgaWr(0xD200, (unsigned char *)(sysPara->voltePara_25Dots.matchAdjustParaDACArray), (8)); //超10个空点巨点补偿 fpgaWr(0xCD00, (unsigned char *)(sysPara->voltePara_25Dots.matchGiantPointVoltageValue[0]), (64*16)); fpgaWr(0xB280, (unsigned char *)(sysPara->voltePara_25Dots.matchTotalTableDACArrayFirst1), (64*2)); //一列第一个点是单点 } void DevOp::writeDacValue2Fpga_No73() { LogInfo::setRunStatusText(tr("No73 send DAC Data.")); quint16 matchFullDACArray[48]; quint16 matchStealDACArray[48]; quint16 matchContinousDACArray[48]; quint16 rowDelayArray[64]; quint16 head1RowDelayArray[64]; quint8 adjDACParameter[64]; quint8 matchTotalTableDACArray[15][64]; quint8* matchOneDACArray = &matchTotalTableDACArray[0][0]; quint8* matchTwoDACArray = &matchTotalTableDACArray[1][0]; quint8* matchThreeDACArray = &matchTotalTableDACArray[3][0]; quint8* matchFourDACArray = &matchTotalTableDACArray[6][0]; quint8* matchFiveDACArray = &matchTotalTableDACArray[10][0]; quint8 matchPrevious1DotDACArray[48]; quint8 matchPrevious2DotDACArray[48]; quint8 matchPrevious3DotDACArray[48]; quint8 matchPrevious4DotDACArray[48]; quint8 matchPrevious5DotDACArray[48]; quint8 matchGapDACArray[64][5]; quint8 matchP3dotGapDACArray[64][5]; memset(matchFullDACArray, 0, sizeof(matchFullDACArray)); memset(matchStealDACArray, 0, sizeof(matchStealDACArray)); memset(matchContinousDACArray, 0, sizeof(matchContinousDACArray)); memset(rowDelayArray, 0, sizeof(rowDelayArray)); memset(head1RowDelayArray, 0, sizeof(head1RowDelayArray)); memset(matchTotalTableDACArray, 0, sizeof(matchTotalTableDACArray)); memset(matchPrevious1DotDACArray, 0, sizeof(matchPrevious1DotDACArray)); memset(matchPrevious2DotDACArray, 0, sizeof(matchPrevious2DotDACArray)); memset(matchPrevious3DotDACArray, 0, sizeof(matchPrevious3DotDACArray)); memset(matchPrevious4DotDACArray, 0, sizeof(matchPrevious4DotDACArray)); memset(matchPrevious5DotDACArray, 0, sizeof(matchPrevious5DotDACArray)); memset(matchGapDACArray, 0, sizeof(matchGapDACArray)); memset(matchP3dotGapDACArray, 0, sizeof(matchP3dotGapDACArray)); memset(adjDACParameter, 0, sizeof(adjDACParameter)); QFile file("./conf/full_dac_raw.txt"); file.open(QIODevice::WriteOnly); for (int i = 0; i < 48; i++) { QTextStream out(&file); matchFullDACArray[i] = sysPara->voltePara_No73.pixel_full_table[i] ; out << sysPara->voltePara_No73.pixel_full_table[i]<< "\n"; } file.close(); file.setFileName("./conf/steal_dac_raw.txt"); file.open(QIODevice::WriteOnly); for (int i = 0; i < 48; i++) { QTextStream out(&file); matchStealDACArray[i] = sysPara->voltePara_No73.pixel_steal_table[i]; out << sysPara->voltePara_No73.pixel_steal_table[i]<< "\n"; } file.close(); file.setFileName("./conf/continous_dac_raw.txt"); file.open(QIODevice::WriteOnly); for (int i = 0; i < 48; i++) { QTextStream out(&file); matchContinousDACArray[i] = sysPara->voltePara_No73.pixel_continous_table[i]; out << sysPara->voltePara_No73.pixel_continous_table[i]<< "\n"; } file.close(); file.setFileName("./conf/row_delay.txt"); file.open(QIODevice::WriteOnly); for (int i = 0; i < 48; i++) { QTextStream out(&file); rowDelayArray[i] = sysPara->voltePara_No73.row_delay_table[i]; out << sysPara->voltePara_No73.row_delay_table[i]<< "\n"; } file.close(); file.setFileName("./conf/head1_row_delay.txt"); file.open(QIODevice::WriteOnly); for (int i = 0; i < 48; i++) { QTextStream out(&file); head1RowDelayArray[i] = sysPara->voltePara_No73.head1_row_delay_table[i]; out << sysPara->voltePara_No73.head1_row_delay_table[i]<< "\n"; } file.close(); file.setFileName("./conf/1_table_dac_raw.txt"); file.open(QIODevice::WriteOnly); for (int i = 0; i < 48; i++) { QTextStream out(&file); *matchOneDACArray = sysPara->voltePara_No73.pixel_1_table[i];// - head1_base_table[i]; out << sysPara->voltePara_No73.pixel_1_table[i] <<" "<< *matchOneDACArray << "\n"; ++matchOneDACArray; } file.close(); file.setFileName("./conf/2_table_dac_raw.txt"); file.open(QIODevice::WriteOnly); for (int i = 0; i < 48; i++) { QTextStream out(&file); *matchTwoDACArray = sysPara->voltePara_No73.pixel_2_table[i][0];// - head1_base_table[i]; ++matchTwoDACArray; *matchTwoDACArray = sysPara->voltePara_No73.pixel_2_table[i][1];// - tail1_base_table[i]; ++matchTwoDACArray; out << sysPara->voltePara_No73.pixel_2_table[i][0]; out << ","; out << sysPara->voltePara_No73.pixel_2_table[i][1]; out << "\n"; } file.close(); file.setFileName("./conf/3_table_dac_raw.txt"); file.open(QIODevice::WriteOnly); for (int i = 0; i < 48; i++) { QTextStream out(&file); *matchThreeDACArray = sysPara->voltePara_No73.pixel_3_table[i][0];// - head1_base_table[i]; ++matchThreeDACArray; *matchThreeDACArray = sysPara->voltePara_No73.pixel_3_table[i][1];// - head2_base_table[i]; ++matchThreeDACArray; *matchThreeDACArray = sysPara->voltePara_No73.pixel_3_table[i][2];// - tail1_base_table[i]; ++matchThreeDACArray; out << sysPara->voltePara_No73.pixel_3_table[i][0]; out << ","; out << sysPara->voltePara_No73.pixel_3_table[i][1]; out << ","; out << sysPara->voltePara_No73.pixel_3_table[i][2]; out << "\n"; } file.close(); file.setFileName("./conf/4_table_dac_raw.txt"); file.open(QIODevice::WriteOnly); for (int i = 0; i < 48; i++) { QTextStream out(&file); *matchFourDACArray = sysPara->voltePara_No73.pixel_4_table[i][0];// - head1_base_table[i]; ++matchFourDACArray; *matchFourDACArray = sysPara->voltePara_No73.pixel_4_table[i][1];// - head2_base_table[i]; ++matchFourDACArray; *matchFourDACArray = sysPara->voltePara_No73.pixel_4_table[i][2];// - head3_base_table[i]; ++matchFourDACArray; *matchFourDACArray = sysPara->voltePara_No73.pixel_4_table[i][3];// - tail1_base_table[i]; ++matchFourDACArray; out << sysPara->voltePara_No73.pixel_4_table[i][0]; out << ","; out << sysPara->voltePara_No73.pixel_4_table[i][1]; out << ","; out << sysPara->voltePara_No73.pixel_4_table[i][2]; out << ","; out << sysPara->voltePara_No73.pixel_4_table[i][3]; out << "\n"; } file.close(); file.setFileName("./conf/5_table_dac_raw.txt"); file.open(QIODevice::WriteOnly); for (int i = 0; i < 48; i++) { QTextStream out(&file); *matchFiveDACArray = sysPara->voltePara_No73.pixel_5_table[i][0];// - head1_base_table[i]; ++matchFiveDACArray; *matchFiveDACArray = sysPara->voltePara_No73.pixel_5_table[i][1];// - head2_base_table[i]; ++matchFiveDACArray; *matchFiveDACArray = sysPara->voltePara_No73.pixel_5_table[i][2];// - head3_base_table[i]; ++matchFiveDACArray; *matchFiveDACArray = sysPara->voltePara_No73.pixel_5_table[i][3];// - tail2_base_table[i]; ++matchFiveDACArray; *matchFiveDACArray = sysPara->voltePara_No73.pixel_5_table[i][4];// - tail1_base_table[i]; ++matchFiveDACArray; out << sysPara->voltePara_No73.pixel_5_table[i][0]; out << ","; out << sysPara->voltePara_No73.pixel_5_table[i][1]; out << ","; out << sysPara->voltePara_No73.pixel_5_table[i][2]; out << ","; out << sysPara->voltePara_No73.pixel_5_table[i][3]; out << ","; out << sysPara->voltePara_No73.pixel_5_table[i][4]; out << "\n"; } file.close(); file.setFileName("./conf/gap_dac_raw.txt"); file.open(QIODevice::WriteOnly); for (int i = 0; i < 48; i++) { for (int j = 0; j < 5; j++) { matchGapDACArray[i][j] = sysPara->voltePara_No73.pixel_gap_table[i][j]; } QTextStream out(&file); out << sysPara->voltePara_No73.pixel_gap_table[i][0]; out << ","; out << sysPara->voltePara_No73.pixel_gap_table[i][1]; out << ","; out << sysPara->voltePara_No73.pixel_gap_table[i][2]; out << ","; out << sysPara->voltePara_No73.pixel_gap_table[i][3]; out << ","; out << sysPara->voltePara_No73.pixel_gap_table[i][4]; out << "\n"; } file.close(); file.setFileName("./conf/p3dot_gap_dac_raw.txt"); file.open(QIODevice::WriteOnly); for (int i = 0; i < 48; i++) { for (int j = 0; j < 5; j++) { matchP3dotGapDACArray[i][j] = sysPara->voltePara_No73.pixel_gap_post_3dot_table[i][j]; } QTextStream out(&file); out << sysPara->voltePara_No73.pixel_gap_post_3dot_table[i][0]; out << ","; out << sysPara->voltePara_No73.pixel_gap_post_3dot_table[i][1]; out << ","; out << sysPara->voltePara_No73.pixel_gap_post_3dot_table[i][2]; out << ","; out << sysPara->voltePara_No73.pixel_gap_post_3dot_table[i][3]; out << ","; out << sysPara->voltePara_No73.pixel_gap_post_3dot_table[i][4]; out << "\n"; } file.close(); file.setFileName("./conf/general_dac_parameter.txt"); file.open(QIODevice::WriteOnly); for (int i = 0; i < sizeof(sysPara->voltePara_No73.pixel_general_dac_parameter)/sizeof(sysPara->voltePara_No73.pixel_general_dac_parameter[0]); i++) { adjDACParameter[i] = sysPara->voltePara_No73.pixel_general_dac_parameter[i]; QTextStream out(&file); out << adjDACParameter[i]; out << "\n"; } file.close(); fpgaWr(0xB300, (unsigned char *)(matchFullDACArray), sizeof (matchFullDACArray)); fpgaWr(0xB380, (unsigned char *)(matchContinousDACArray), sizeof (matchContinousDACArray)); fpgaWr(0xB400, (unsigned char *)(&rowDelayArray[0]), sizeof (rowDelayArray)); fpgaWr(0xB480, (unsigned char *)(&head1RowDelayArray[0]), sizeof (head1RowDelayArray)); fpgaWr(0xB500, (unsigned char *)(matchTotalTableDACArray[0]), sizeof (matchTotalTableDACArray)); fpgaWr(0xBC00, (unsigned char *)(matchP3dotGapDACArray[0]), sizeof (matchP3dotGapDACArray)); fpgaWr(0xBE00, (unsigned char *)(matchGapDACArray[0]), sizeof (matchGapDACArray)); fpgaWr(0xC000, (unsigned char *)sysPara->voltePara_No73.pixel_big_table, sizeof(sysPara->voltePara_No73.pixel_big_table));// 写入8个 big data fpgaWr(0xC100, (unsigned char *)adjDACParameter, sizeof(adjDACParameter));// 写入8个 }