Files
VX5_KRO_GearPump/DevOp.cpp
T
2026-05-23 14:16:57 +08:00

5288 lines
234 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* DevOp.cpp
*
* Created on: Jun 25, 2013
* Author: yiyu
* QQ:1036184468
* Descriptoin:设备操作模块,各种泵阀之类的操作都在此处
*/
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <DevOp.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include <time.h>
//#include "LogInfo.h"
#include <QVBoxLayout>
#include "InputMethod.h"
#include "InkJetPrinter.h"
#include <QKeyEvent>
#include <QTextCodec>
#include <QTextEdit>
#include <QFont>
//#include <TextEditOption.h>
#include <QDesktopWidget>
#ifndef Q_OS_WIN32
#include <sys/reboot.h>
#include <sys/ioctl.h>
#else
#define ioctl(a,...) (0 == 0)
#endif
#include <QPainter>
#include <QImage>
#include <QRgb>
#include <QDebug>
#include <QTime>
#include <QScrollBar>
#include "SysPara.h"
#include <QObject>
#include "DevOp.h"
#include "Public.h"
#include "myinclude.h"
#include "qnamespace.h"
#include <QMetaObject>
#include <QMetaProperty>
#include "rfid/rfidfunction.h"
#include <QElapsedTimer>
#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 WRITE_COUNTER4_ADDR (0xb164)
//#define READ_CNT3_CURVALUE_ADDR 0x01b4
#define READ_CNT3_CURVALUE_ADDR 0x1834
#define LOCADDR '1'
#define NOLEDLIGHT 0x10
#define REDLIGHTCODE 0X11
#define YELLOWLIGHTCODE 0X13
#define GREENLIGHTCODE 0X12
unsigned short DACArray[64];
quint16 notGapDACArray[64];
quint16 fullColDACArray[64];
int fast_64k_5dot_full_default_dac[] = {65, 87, 105, 121, 134};
int fast_64k_5dot_adj_default_dac[] = {62, 77, 91, 105, 120};
int fast_64k_5dot_continue_default_dac[] = {0, 86, 102, 117, 133};
int fast_64k_7dot_full_default_dac[] = {65, 87, 104, 120, 134, 147, 157};
int fast_64k_7dot_adj_default_dac[] = {62, 77, 90, 102, 114, 126, 140};
int fast_64k_7dot_continue_default_dac[] = {0, 86, 102, 116, 130, 142, 155};
int fast_64k_9dot_full_default_dac[] = {65, 87, 105, 121, 137, 151, 164, 168, 181};
int fast_64k_9dot_adj_default_dac[] = {62, 77, 90, 103, 116, 131, 143, 157, 173};
int fast_64k_9dot_continue_default_dac[] = {0, 86, 102, 117, 132, 145, 161, 164, 181};
int normal_64k_5dot_full_default_dac[] = {65, 80, 91, 102, 113};
int normal_64k_5dot_adj_default_dac[] = {64, 76, 87, 97, 109};
int normal_64k_5dot_continue_default_dac[] = {0, 79, 91, 102, 113};
int normal_64k_7dot_full_default_dac[] = {65, 80, 92, 104, 115, 126, 137};
int normal_64k_7dot_adj_default_dac[] = {64, 76, 87, 97, 108, 119, 131};
int normal_64k_7dot_continue_default_dac[] = {0, 79, 91, 102, 114, 125, 136};
int normal_64k_9dot_full_default_dac[] = {65, 80, 92, 104, 115, 126, 137, 148, 158};
int normal_64k_9dot_adj_default_dac[] = {64, 76, 87, 97, 108, 119, 130, 141, 152};
int normal_64k_9dot_continue_default_dac[] = {0, 79, 91, 102, 114, 125, 136, 147, 157};
int normal_64k_12dot_full_default_dac[] = {65, 80, 92, 104, 115, 126, 137, 148, 159, 170, 179, 190};
int normal_64k_12dot_adj_default_dac[] = {64, 76, 87, 97, 108, 119, 129, 140, 150, 160, 170, 181};
int normal_64k_12dot_continue_default_dac[] = {0, 79, 91, 102, 114, 124, 135, 146, 156, 166, 176, 187};
int normal_64k_16dot_full_default_dac[] = {65, 80, 92, 104, 115, 126, 137, 148, 159, 170, 181, 192, 202, 212, 221, 227};
int normal_64k_16dot_adj_default_dac[] = {64, 76, 87, 97, 108, 119, 129, 140, 150, 160, 170, 180, 190, 200, 210, 220};
int normal_64k_16dot_continue_default_dac[] = {0, 79, 91, 102, 114, 124, 135, 146, 156, 166, 176, 187, 197, 207, 217, 226};
int normal_64k_24dot_full_default_dac[] = {65, 80, 90, 101, 112, 122, 133, 144, 155, 166, 177, 188, 198, 208, 217, 225,235,243,256,263,275,283,292,300};
int normal_64k_24dot_adj_default_dac[] = {64, 75, 85, 95, 104, 114, 123, 135, 145, 154, 165, 175, 185, 195, 205, 215,224,232,242,252,260,269,278,287};
int normal_64k_24dot_continue_default_dac[] = {0, 79, 89, 99, 110, 120, 130, 140, 150, 160, 171, 182, 192, 202, 210, 220,230,239,248,257,266,275,284,293};
int slow1_64k_5dot_full_default_dac[] = {65, 77, 87, 97, 107};
int slow1_64k_5dot_adj_default_dac[] = {65, 75, 85, 95, 105};
int slow1_64k_5dot_continue_default_dac[] = {0, 77, 87, 97, 107};
int slow1_64k_7dot_full_default_dac[] = {65, 77, 87, 97, 107, 117, 127};
int slow1_64k_7dot_adj_default_dac[] = {65, 75, 85, 95, 104, 113, 124};
int slow1_64k_7dot_continue_default_dac[] = {0, 77, 87, 97, 107, 117, 127};
int slow1_64k_9dot_full_default_dac[] = {65, 77, 87, 97, 107, 117, 127, 137, 146};
int slow1_64k_9dot_adj_default_dac[] = {65, 75, 85, 95, 104, 113, 123, 133, 143};
int slow1_64k_9dot_continue_default_dac[] = {0, 77, 87, 96, 106, 116, 126, 136, 146};
int slow1_64k_12dot_full_default_dac[] = {65, 77, 87, 97, 107, 117, 127, 137, 147, 157, 167, 176};
int slow1_64k_12dot_adj_default_dac[] = {65, 75, 85, 94, 104, 113, 123, 133, 142, 151, 161, 171};
int slow1_64k_12dot_continue_default_dac[] = {0, 77, 87, 96, 106, 116, 126, 136, 146, 155, 165, 175};
int slow1_64k_16dot_full_default_dac[] = {65, 77, 87, 97, 107, 117, 127, 137, 147, 157, 167, 176, 186, 195, 204, 213};
int slow1_64k_16dot_adj_default_dac[] = {65, 75, 85, 94, 104, 113, 123, 133, 142, 151, 161, 170, 179, 188, 197, 206};
int slow1_64k_16dot_continue_default_dac[] = {0, 77, 87, 96, 106, 116, 126, 136, 146, 155, 165, 174, 183, 192, 201, 210};
int slow1_64k_24dot_full_default_dac[] = {65, 76, 85, 94, 103, 112, 121, 130, 139, 148, 157, 166, 175, 184, 192, 201,210,219,228,236,245,253,261,268};
int slow1_64k_24dot_adj_default_dac[] = {65, 74, 83, 92, 101, 109, 117, 126, 134, 142, 150, 159, 168, 176, 185, 193,202,210,218,226,234,242,250,257};
int slow1_64k_24dot_continue_default_dac[] = {0, 76, 84, 93, 101, 110, 119, 128, 137, 146, 153, 162, 171, 180, 189, 198,206,215,223,231,239,247,255,263};
/* ==============64k end ========================*/
/* ============== 96k ========================*/
int fast_96k_5dot_full_default_dac[] = {68, 92, 107, 118, 125};
int fast_96k_5dot_adj_default_dac[] = {66, 77, 88, 99, 109};
int fast_96k_5dot_continue_default_dac[] = {0, 91, 103, 115, 127};
int fast_96k_5dot_full_default_dac_H[] = {80, 108, 124, 144, 156};
int fast_96k_5dot_adj_default_dac_H[] = {74, 89, 105, 121, 136};
int fast_96k_5dot_continue_default_dac_H[] = {0, 104, 120, 136, 152};
int fast_96k_7dot_full_default_dac[] = {68, 92, 107, 120, 132, 142, 151};
int fast_96k_7dot_adj_default_dac[] = {62, 74, 85, 97, 108, 120, 132};
int fast_96k_7dot_continue_default_dac[] = {0, 85, 98, 111, 124, 137, 150};
int fast_96k_7dot_full_default_dac_H[] = {80, 108, 125, 144, 160, 176, 186};
int fast_96k_7dot_adj_default_dac_H[] = {76, 91, 106, 118, 132, 146, 164};
int fast_96k_7dot_continue_default_dac_H[] = {0, 104, 120, 136, 152, 166, 184};
int fast_96k_7dot_full_default_dac_S[] = {80, 108, 124, 138, 152, 164, 174};
int fast_96k_7dot_adj_default_dac_S[] = {76, 91, 102, 114, 127, 140, 152};
int fast_96k_7dot_continue_default_dac_S[] = {0, 104, 120, 134, 147, 160, 172};
int fast_96k_9dot_full_default_dac[] = {68, 92, 107, 120, 132, 142, 150, 146, 154};
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_9dot_full_default_dac_S[] = {68, 92, 107, 120, 131, 142, 150, 160, 170};
int fast_96k_9dot_adj_default_dac_S[] = {60, 72, 83, 94, 105, 116, 127, 138, 148};
int fast_96k_9dot_continue_default_dac_S[] = {0, 85, 98, 113, 125, 141, 153, 164, 172};
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_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_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_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_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_D[] = {80, 106, 123, 137, 150, 163, 173, 185, 192};
int fast_128k_9dot_adj_default_dac_D[] = {73, 84, 96, 106, 116, 126, 136, 146, 156};
int fast_128k_9dot_continue_default_dac_D[] = {0, 102, 116, 134, 144, 158, 168, 182, 192};
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};
int fast_128k_9dot_full_default_dac[9] = {74, 99, 115, 130, 140, 153, 163, 158, 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};
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};
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,
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,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,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,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,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,
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,
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
};
extern InkJetPrinter *pInkJectPrinter;
// 传送打印内容的数据结构
// $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; // 尾部可变长的长度。实际长度
}Adjlen_strut;
DevOp::DevOp(SysPara * sysPara)
{
this->sysPara = sysPara;
#ifndef Q_OS_WIN32
DAdataout = open("/dev/fpga_driver", O_RDWR);
if(DAdataout < 0){
qDebug()<<"fpga_driver false.";
fpgaDevOpenFlag = false;
}
else {
qDebug()<<"fpga_driver ok.";
fpgaDevOpenFlag = true;
}
pwm_sp = open("/dev/pwm1",0);
if(pwm_sp <0 ){
qDebug()<<"pwm_sp open error,ret:"<<pwm_sp;
}
pwm_fd = open("/dev/pwm", 0);
if(pwm_fd < 0){
qDebug()<<"pwm_sp open error,ret:"<<pwm_fd;
}
pwm_ink = open("/dev/am335x_ink_pwm", 0);
if(pwm_ink < 0){
qDebug()<<"pwm_ink open error,ret:"<<pwm_ink;
}
Interrupt_fd = open("/dev/buttons", 0);
if(Interrupt_fd < 0){
}
iocontrl = open("/dev/print_contrl", O_RDWR);
if(iocontrl < 0){
}
adc_fd = open("/dev/adc", 0);
if(adc_fd < 0){
}
color_flag = 0;//检测齿轮泵转速超过1900就提示,有的机器使用小泵,转速已经超过2000,与该功能冲突,不使用
#endif
#ifdef __RFID_CARD
comForRFID_init();
checkCardIntervalTime = 0;
setICReaderModeFlag = false;
#endif
releaseValveOpenFlag = false;
mixValveFlag = false;
inkValveOpenFlag = false;
inkValveOpenFlag1 = false;
cycleValveOpenFlag = false;
compressPumpOpenFlag = false;
viscosityPumpOpenFlag = false;
mainInkPumpOpenFlag = false;
reclaimPumpOpenFlag = false;
highVoltageOpenFlag = false;
reclaimTankOpenEnableFlag = false;
reclaimTankCloseEnableFlag = false;
beeperOnFlag = false;
heaterOnFlag = false;
for(qint8 i=50;i<100;i++)
{
if(i<90)
OscillatorVoltage[i] = 68+(i-50)/2;
else
{
OscillatorVoltage[i]=i;
}
}
for(qint8 i=0;i<50;i++)
{
if(i>20)
OscillatorVoltage[i] = 68+i-50;
else if(i>11)
{
OscillatorVoltage[i] = 15+2*(i-10);
}
else
{
OscillatorVoltage[i]=11;
}
}
OscillatorVoltage[0]=0;
if(!sysPara){
QMessageBox::critical(0,"错误","DevOp构造函数的sysParam不能为空"); //设个陷阱,防止误操作
}
}
DevOp::~DevOp(){
if(DAdataout >= 0) close(DAdataout);
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);
}
}
}
void DevOp::stm32Rd(int addr,unsigned char*dat,int len){
// 没有使用为何要判空?是否过度扩大其引用范围?
if(pInkJectPrinter == NULL)
return;
if(!stopSendDataSTM32)
emit sendSerialDataToSTM32(1,addr,dat,len,2);
else
emit sendSerialDataToSTM32(0,0,dat,0,2);
}
void DevOp::stm32Wr(int addr,unsigned char*dat,int len){
if(pInkJectPrinter == NULL)
return;
if(!stopSendDataSTM32)
emit sendSerialDataToSTM32(2,addr,dat,len,2);
}
void DevOp::fpgaRd(int addr,unsigned char*dat,int len){
if(pInkJectPrinter == NULL)
return;
emit sendSerialDataToFPGA(1,addr,dat,len,1);
}
unsigned char dataOfPowerOnTimer[2]={};
void DevOp::sendSTM32SetPowerOnTimer(quint16 time)
{
dataOfPowerOnTimer[0] = time;
dataOfPowerOnTimer[1] = time>>8;
stm32Wr(0xA2,dataOfPowerOnTimer,2);
}
typedef struct{
int addr;
unsigned char* data;
int len;
}writeData;
QMap<int,writeData> map;
typedef struct{
int addr;
unsigned char data[2];
int len;
}writeDataValue;
QMap<int,writeDataValue> mapValue;
void DevOp::fpgaWrD2(int addr,unsigned char*dat,int len){
if(pInkJectPrinter == NULL)
return;
writeData writedata;
writedata.addr = addr;
writedata.data = dat;
writedata.len = len;
map.insert(addr,writedata);
emit sendSerialDataToFPGA(0xD2,map.value(addr).addr,map.value(addr).data,map.value(addr).len,1);
}
void DevOp::fpgaWr(int addr,unsigned char*dat,int len){
if(pInkJectPrinter == NULL)
return;
writeData writedata;
writedata.addr = addr;
writedata.data = dat;
writedata.len = len;
map.insert(addr,writedata);
emit sendSerialDataToFPGA(2,map.value(addr).addr,map.value(addr).data,map.value(addr).len,1);
}
unsigned char data_a440[1];
void DevOp::fpgaWrD(int addr,unsigned int dat,int len){
if(len > 2){
QString hexStr = QString::number(addr, 16).toUpper();
return;
}
writeDataValue writedata;
writedata.addr = addr;
writedata.data[0] = dat;
writedata.data[1] = dat>>8;
writedata.len = len;
mapValue.insert(addr,writedata);
fpgaWr(addr,data_a440,1);
}
void DevOp::fpgaResetWarning(char mode){
if(mode==1){
resumeFault();
}
}
unsigned int DevOp::fpgaRdD(int addr,int len){
unsigned int data = 0;
if(len > 4){
DisErrorMsg();
return 0;
}
fpgaRd(addr, (unsigned char *)&data, len);
return data;
}
unsigned char dataofReleaseValve[1];
void DevOp::controlReleaseValve(bool openFlag){
if(pInkJectPrinter == NULL)
return;
unsigned char dat=0;
if(openFlag){
dataofReleaseValve[0]=0x11;
emit sendSerialDataToSTM32(2,0x17,dataofReleaseValve,1,2);
}else{
dataofReleaseValve[0]=0x10;
emit sendSerialDataToSTM32(2,0x17,dataofReleaseValve,1,2);
}
releaseValveOpenFlag = openFlag;
pumpValveCtrl();
}
unsigned char dataofMixValve[1];
void DevOp::controlMixValve(bool openFlag){
if(pInkJectPrinter == NULL)
return;
if(openFlag){
dataofMixValve[0]=0x11;
emit sendSerialDataToSTM32(2,0x18,dataofMixValve,1,2);
}else{
dataofMixValve[0]=0x10;
emit sendSerialDataToSTM32(2,0x18,dataofMixValve,1,2);
}
mixValveFlag = openFlag;
pumpValveCtrl();
}
unsigned char dataofInkValve[1];
void DevOp::controlInkValve(bool openFlag){
if(pInkJectPrinter == NULL)
return;
unsigned char dat=0;
if(openFlag){
dataofInkValve[0]=0x11;
emit sendSerialDataToSTM32(2,0x15,dataofInkValve,1,2);
}else{
dataofInkValve[0]=0x10;
emit sendSerialDataToSTM32(2,0x15,dataofInkValve,1,2);
}
inkValveOpenFlag = openFlag;
pumpValveCtrl();
}
unsigned char dataofInkValvePWM[1];
void DevOp::controlInkValvePWMSTM32(int PWMPulse){
if(pInkJectPrinter == NULL)
return;
dataofInkValvePWM[0]=0x11+PWMPulse;
emit sendSerialDataToSTM32(2,0x15,dataofInkValvePWM,1,2);
}
unsigned char dataofCycleValve[1];
void DevOp::controlCycleValve(bool openFlag){
if(pInkJectPrinter == NULL)
return;
if(openFlag){
dataofCycleValve[0]=0x11;
emit sendSerialDataToSTM32(2,0x16,dataofCycleValve,1,2);
}else{
dataofCycleValve[0]=0x10;
emit sendSerialDataToSTM32(2,0x16,dataofCycleValve,1,2);
}
cycleValveOpenFlag = openFlag;
pumpValveCtrl();
}
unsigned char dataofCompressPump[1];
void DevOp::controlCompressPump(bool openFlag){
if(pInkJectPrinter == NULL)
return;
if(openFlag){
dataofCompressPump[0]=0x11;
emit sendSerialDataToSTM32(2,0x11,dataofCompressPump,1,2);
}else{
dataofCompressPump[0]=0x10;
emit sendSerialDataToSTM32(2,0x11,dataofCompressPump,1,2);
}
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
unsigned char dataofViscosity[1];
void DevOp::controlViscosityPump(bool openFlag){
if(pInkJectPrinter == NULL)
return;
viscosityPumpOpenFlag = openFlag;
QDateTime currentDateTime = QDateTime::currentDateTime();
QString timeString = currentDateTime.toString("yyyy-MM-dd hh:mm:ss.zzz");
pumpValveCtrl();
if(openFlag){
dataofViscosity[0] = 0x11;
emit sendSerialDataToSTM32(2,0x13,dataofViscosity,1,2);
}else{
dataofViscosity[0] = 0x10;
emit sendSerialDataToSTM32(2,0x13,dataofViscosity,1,2);
}
}
unsigned char dataofMainInkPump[1];
void DevOp::controlMainInkPump(bool openFlag){
ioctl(iocontrl, !openFlag, 3);
mainInkPumpOpenFlag = openFlag;
if(openFlag){
dataofMainInkPump[0]=0x11;
emit sendSerialDataToSTM32(2,0x14,dataofMainInkPump,1,2);
}else{
dataofMainInkPump[0]=0x10;
emit sendSerialDataToSTM32(2,0x14,dataofMainInkPump,1,2);
}
}
void DevOp::controlInkValvePWM(bool openFlag)
{
if(openFlag){
// 先设置高电平,然后设置占空比和频率
ioctl(pwm_ink, PWM_IOCTL_HIGH, 1);
ioctl(pwm_ink, PWM_IOCTL_SET_WIDE, 100); // 设置为100%占空比,即全开,持续2秒
ioctl(pwm_ink, PWM_IOCTL_SET_FREQ, FRE_SP);
// 使用MySleep函数等待2秒,保持高电平状态
MySleep(100);
// 2秒后,调整为原来的占空比和频率
ioctl(pwm_ink, PWM_IOCTL_SET_WIDE, 70);
ioctl(pwm_ink, PWM_IOCTL_SET_FREQ, FRE_SP);
// 根据需要决定是否停止PWM信号,如果希望持续输出,则注释掉这一行
// ioctl(pwm_ink, PWM_IOCTL_STOP);
}
else{
// 关闭时直接停止PWM信号
ioctl(pwm_ink, PWM_IOCTL_STOP);
}
inkValveOpenFlag1 = openFlag;
if(!reclaimPumpOpenFlag && inkValveOpenFlag1)
controlReclaimPump2();
pumpValveCtrl();
}
void DevOp::controlInkValvePWM2()
{
// 先设置高电平,然后设置占空比和频率
ioctl(pwm_ink, PWM_IOCTL_HIGH, 1);
ioctl(pwm_ink, PWM_IOCTL_SET_WIDE, 100); // 设置为100%占空比,即全开,持续2秒
ioctl(pwm_ink, PWM_IOCTL_SET_FREQ, FRE_SP);
// 使用MySleep函数等待100ms,保持高电平状态
MySleep(50);
// 100ms后,调整为原来的占空比和频率
ioctl(pwm_ink, PWM_IOCTL_SET_WIDE, 70);
ioctl(pwm_ink, PWM_IOCTL_SET_FREQ, FRE_SP);
// 关闭时直接停止PWM信号
ioctl(pwm_ink, PWM_IOCTL_STOP);
}
unsigned char dataofReclaimPump[1];
void DevOp::controlReclaimPump(bool openFlag,bool fullSpeed)
{
if(openFlag){
// 如果只发送0x11则是50%占空比。其余占空比公式:发送数据=占空比+0x11
dataofReclaimPump[0]=fullSpeed?90:(sysPara->para.reclaimPumpPWMWidth?sysPara->para.reclaimPumpPWMWidth:90)+0x11;
emit sendSerialDataToSTM32(2,0x12,dataofReclaimPump,1,2);
}else{
dataofReclaimPump[0]=0x10;
emit sendSerialDataToSTM32(2,0x12,dataofReclaimPump,1,2);
}
reclaimPumpOpenFlag = openFlag;
pumpValveCtrl();
}
void DevOp::controlReclaimPump2()
{
ioctl(pwm_sp, PWM_IOCTL_SET_FREQ, FRE_SP); //sysset.phaseByHandValue 总数100,设置成100好像无效
ioctl(pwm_sp, PWM_IOCTL_SET_WIDE, 50);
ioctl(pwm_sp, PWM_IOCTL_STOP); //PWM_IOCTL_STOP= 2
}
unsigned char dataofHeater[1];
void DevOp::controlHeater(bool openFlag){
if(!openFlag)
dataofHeater[0] = 0x10;
else
dataofHeater[0] = 0x11;
emit sendSerialDataToSTM32(2,0x1A,dataofHeater,1,2);
heaterOnFlag = openFlag;
pumpValveCtrl();
}
unsigned char dataofBeeper[1];
void DevOp::controlBeeper(bool openFlag){
if(TEST_MODE) openFlag = false;
if(!openFlag)
dataofBeeper[0] = 0x10;
else
dataofBeeper[0] = 0x11;
emit sendSerialDataToSTM32(2,0x19,dataofBeeper,1,2);
beeperOnFlag = openFlag;
}
unsigned char dataofLEDLight[1];
void DevOp::controlRedLight(bool openFlag){
if(openFlag)//2013-12-11 红绿黄报警灯
dataofLEDLight[0] = REDLIGHTCODE;
else
dataofLEDLight[0] = NOLEDLIGHT;
emit sendSerialDataToSTM32(2,0x1C,dataofLEDLight,1,2);
RedLightOnFlag = openFlag;
}
void DevOp::controlGreenLight(bool openFlag){
if(openFlag)//2013-12-11 红绿黄报警灯
dataofLEDLight[0] = GREENLIGHTCODE;
else
dataofLEDLight[0] = NOLEDLIGHT;
emit sendSerialDataToSTM32(2,0x1C,dataofLEDLight,1,2);
GreenLightOnFlag = openFlag;
}
void DevOp::controlYellowLight(bool openFlag){
if(openFlag)//2013-12-11 红绿黄报警灯
dataofLEDLight[0] = YELLOWLIGHTCODE;
else
dataofLEDLight[0] = NOLEDLIGHT;
emit sendSerialDataToSTM32(2,0x1C,dataofLEDLight,1,2);
YellowLightOnFlag = openFlag;
}
void DevOp::controlFan1(bool openFlag)
{
ioctl(iocontrl, openFlag, 15);
}
void DevOp::controlFan2(bool openFlag)
{
ioctl(iocontrl, openFlag, 16);
}
unsigned char dataofPowerOff[1];
void DevOp::powerOff(void){
dataofPowerOff[0]=0x10;
stm32Wr(0xFE,dataofPowerOff,1);
qDebug()<<"Send PowerOFF Command";
}
unsigned char dataofReclaimTank[1];
void DevOp::controlReclaimTankOpen(bool enableFlag){
if(enableFlag){
dataofReclaimTank[0]=0x12;
emit sendSerialDataToSTM32(2,0x01,dataofReclaimTank,1,2);
}
else{
dataofReclaimTank[0]=0x10;
emit sendSerialDataToSTM32(2,0x01,dataofReclaimTank,1,2);
}
reclaimTankCloseEnableFlag = false;
reclaimTankOpenEnableFlag = enableFlag;
}
void DevOp::controlReclaimTankClose(bool enableFlag){
if(enableFlag){
dataofReclaimTank[0]=0x11;
emit sendSerialDataToSTM32(2,0x01,dataofReclaimTank,1,2);
}
else{
dataofReclaimTank[0]=0x10;
emit sendSerialDataToSTM32(2,0x01,dataofReclaimTank,1,2);
}
reclaimTankOpenEnableFlag = false;
reclaimTankCloseEnableFlag = enableFlag;
}
bool DevOp::isReleaseValveOpen(){
return releaseValveOpenFlag;
}
bool DevOp::isMixValveOpen(){
return mixValveFlag;
}
bool DevOp::isInkValveOpen(){
return inkValveOpenFlag;
}
bool DevOp::isInkValveOpen1(){
return inkValveOpenFlag1;
}
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::isHighVoltageOpen(){
return highVoltageOpenFlag;
}
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;
}
unsigned char sendStatusToFPGA[1];
void DevOp::readFgaStatus(){
fpgaRd(FPGA_STATUS_BASE_ADDR,(unsigned char *)&sysPara->status,FPGA_STATUS_BYTE_NUM);
stm32Rd(0xff,((unsigned char *)&sysPara->status)+0x44,23);
sendStatusToFPGA[0] = 0x00;
emit sendSerialDataToFPGA(2,0xA488,sendStatusToFPGA,1,1);
}
void DevOp::set_totalSynPulseNum(bool wren)
{
short adjLen=0;
Adjlen_strut adjlen_strut ={0,0,0,0,0,0};
if(sysPara==0)return;
if(sysPara->para.varLenEn)
{
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 = QString::number(sysPara->para.cnt1EndValue - sysPara->para.endLen).toUInt(0,16);
adjlen_strut.uint8varLenEndEn = sysPara->para.endLen?1:0;
}
if((sysPara->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);
}
fpgaWr(PRINT_CTRL_ADDR_BASE + 0x76, (unsigned char *)&adjlen_strut, sizeof(Adjlen_strut));
}
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;
}
unsigned char dataofa[1];
unsigned int volGap;
int DevOp::writeFpgaPrintPara(bool ignoreWarn){
unsigned int type = sysPara->status.fpgaVersionNum >> 12;
// unsigned int type = 6;
// if((sysPara->para.currPrintMode == FAST_PRINT) && !sysPara->para.charWidthSetEnable
// || sysPara->status.build_dat.builTime == 73 || type == 6 || type == 8)
if(type == 6 || type == 8)
sysPara->loadVolteParaFromFile((PRINT_MODE)sysPara->para.currPrintMode);
int currPrintCol = sysPara->status.currPrintCol + BLANK_COL_NUM;
sysPara->para.printRowDelay = sysPara->para.currPrintMode;
if(sysPara->status.isPrinting == false)
sysPara->status.pixNumPerCol = sysPara->status.currPrintRow;
else
sysPara->status.currPrintRow = sysPara->status.pixNumPerCol;
sysPara->para.pixNumPerCol = sysPara->status.pixNumPerCol;
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
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; //点距电压调整位置
/*---------------------------------------------------------------------------------*/
// 将 满列/单点/两点/三点/四点表格 电压值 转换成 DAC(12位)值
//#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)
// 将 满列/单点/两点/三点/四点表格 电压值 转换成 DAC(12位)值
/*---------------------------------------------------------------------------------*/
//#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比较接近
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;
}
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];
}
if(sysPara->para.FullColFixVal == 1)//勾选了调整电压
DACValueWithVoltageAdj();
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;
}
}
if(sysPara->para.flagOfFastMode)
{
if ((sysPara->para.currPrintMode == FAST_PRINT) && (sysPara->status.currPrintRow <= 7)){
sysPara->status.currVoltageVersion = VersionOf67And7SuperSpeed;
if(sysPara->status.currVoltageVersion != sysPara->status.lastVoltageVersion){
writeDataToFpga_No67HighSpeedMode(VersionOf67And7SuperSpeed,true);
sysPara->status.lastVoltageVersion = sysPara->status.currVoltageVersion;
}
}
else if((sysPara->para.currPrintMode == STANDARD_PRINT) && (sysPara->status.currPrintRow <= 7)){
sysPara->status.currVoltageVersion = VersionOf67And7HighSpeed;
if(sysPara->status.currVoltageVersion != sysPara->status.lastVoltageVersion){
writeDataToFpga_No67HighSpeedMode(VersionOf67And7HighSpeed,true);
sysPara->status.lastVoltageVersion = sysPara->status.currVoltageVersion;
}
}
else if((sysPara->para.currPrintMode == FAST_PRINT) && (sysPara->status.currPrintRow <= 9)){
sysPara->status.currVoltageVersion = VersionOf67And9SuperSpeed;
if(sysPara->status.currVoltageVersion != sysPara->status.lastVoltageVersion){
writeDataToFpga_No67HighSpeedMode(VersionOf67And9SuperSpeed,true);
sysPara->status.lastVoltageVersion = sysPara->status.currVoltageVersion;
}
}
else if((sysPara->para.currPrintMode == STANDARD_PRINT) && (sysPara->status.currPrintRow <= 9)){
sysPara->status.currVoltageVersion = VersionOf67And9HighSpeed;
if(sysPara->status.currVoltageVersion != sysPara->status.lastVoltageVersion){
writeDataToFpga_No67HighSpeedMode(VersionOf67And9HighSpeed,true);
sysPara->status.lastVoltageVersion = sysPara->status.currVoltageVersion;
}
}
}
else if(type == 6 || type == 8){
if(sysPara->status.currVoltageVersion != sysPara->status.lastVoltageVersion){
writeDacValue2Fpga_No72NewVoltData();
sysPara->status.lastVoltageVersion = sysPara->status.currVoltageVersion;
}
}
else if(sysPara->status.build_dat.builTime == 73){
if(sysPara->status.currVoltageVersion != sysPara->status.lastVoltageVersion){
writeDacValue2Fpga_No73();
sysPara->status.lastVoltageVersion = sysPara->status.currVoltageVersion;
}
}
else{
sysPara->status.currVoltageVersion = VersionOf67;
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 */
sysPara->status.lastVoltageVersion = sysPara->status.currVoltageVersion;
}
/*---------------------------------------------------------------------------------*/
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 && type!=6)
fpgaWr(ROW_PRINT_SEQNENCE_ADDR,(unsigned char *)sequenceArray,sizeof(sequenceArray)); /* 0xB200 */
/*---------------------------------------------------------------------------------*/
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;
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
/*-----------------------------------------------------------------------------------------------*/
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;
long printTmMs = 1.0f*dotNumPerCol*(1 + sysPara->para.charBold)*currPrintCol*(2*sysPara->para.divideRatio)/(FPGA_SYS_HZ/1000);
timeTpDly +=printTmMs;
}
}
sysPara->para.timeTriggerPrintDelayMs = timeTpDly; // 20150112
sysPara->para.timeTriggerPrintDelayMsH=timeTpDly>>16;
/*---------------------------------------线性平均拟合---------------------------------*/
int currHighVoltageIndex = sysPara->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; //为零时,逻辑将忽略所有高压故障
if(!ignoreWarn)
QMessageBox::warning(NULL,tr("警告"),tr("字高太小或是高压包数据未初始化,您当前错误将忽略所有高压错误"));
}
else
sysPara->para.maxHighVoltageDAC = expected_voltage_DAC + sysPara->para.highVoltageLevel;
}
if(sysPara->status.isPrinting==false){
sysPara->para.printTotalColNum = currPrintCol;
sysPara->status.printTotalColNum = currPrintCol;
}
else
sysPara->para.printTotalColNum = sysPara->status.printTotalColNum;
set_totalSynPulseNum(0);
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.printColDelay*(MAX_CHAR_WIDTH - MIN_CHAR_WIDTH) /100)
*currPrintCol*sysPara->para.synPulseNumPerMm
);
if(displayAreaTotalSynNum >= 99*sysPara->para.totalSynPulseNum/100){
displayAreaTotalSynNum = 99*sysPara->para.totalSynPulseNum/100;
}
}
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;
}
if(sysPara->para.synPulseNumPerMm<1 || sysPara->para.synPulseNumPerMm>50) {
}
sysPara->para.synPulsePerMmX8 = (unsigned short)((unsigned int)sysPara->para.synPulseNumPerMm <<8);
qDebug ()<<"s-"<<sysPara->para.synNumPerCol<<"-"<<sysPara->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;
}
sysPara->para.SynCntEn1 = sysPara->para.SynCntEn;
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,(unsigned char *)&sysPara->para,FPGA_PRINT_PARA_BYTE_NUM); //0x3C
fpgaWr(PRINT_CTRL_ADDR_BASE+0x3C,(unsigned char *)&sysPara->para.eleMaskTime,4); //0x3C 3D 3E 3F LockTime Alt-MirrorGap
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
sysPara->devOp->pumpValveCtrl(); // send data to A45A~5B Ctrl Para //20140423
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);
fpgaWr(PRINT_CTRL_ADDR_BASE+0x90,(unsigned char *)&pulseOutputAfterCnt1Print,2);
unsigned int v[32];
QString str="ADJ:";
str+= QString().sprintf("%d,",DACStep);
v[0]=0;
for(int i=0;i<32;i++)
{
v[0] =v[0]+(DACStep/(2+i*i));
str+= QString().sprintf("%d,",v[0]);
}
sysPara->para.HighVoltageAmplitude = tmpHighVoltageAmplitude;
sysPara->para.phaseShift = phaseShift;
if(sysPara->para.OuputPulseCol > 200)
sysPara->para.OuputPulseCol = 200;
/*---------------------------------------------------------------------------------------*/
setOscillatorVoltage(sysPara->para.oscillatorVoltage); //因为经过调整参数,所以开机也要多发送一次
sysPara->saveParaToFile();
sysPara->status.configDone = 1;
return 0;
}
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个
}
// 齿轮泵设置
unsigned char dataofGearPump[2];
void DevOp::WriteMoterPump()
{
dataofGearPump[0] = sysPara->para.gearPumpValue;
dataofGearPump[1] = sysPara->para.gearPumpValue>>8;
stm32Wr(0x1d,dataofGearPump,2);
}
void DevOp::ReadSomeDataForLostPrint(void)
{
fpgaRd(FPGA_STATUS_BASE_ADDR+0x46,(unsigned char *)&sysPara->status.r_print_q, 14);
}
void DevOp::ReadCnt1GroupStatus(void)
{
#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
}
unsigned char dataofcnt1GroupCntTmp[1];
unsigned char dataofcnt1GroupNum[1];
unsigned char dataofcnt1GroupSettingSend[12];
void DevOp::writeCnt1GroupSetting(bool bCntByGroupEnable){
#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;i<sysPara->para.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;
dataofcnt1GroupNum[0]=cnt1GroupSettingSend.cnt1GroupNum;
fpgaWr(WRITE_CNT1GROUP_NUM,dataofcnt1GroupNum,1);
memcpy(dataofcnt1GroupSettingSend,(unsigned char *)&cnt1GroupSettingSend.StartValue,12);
fpgaWr(WRITE_CNT1GROUP_SETTING,dataofcnt1GroupSettingSend,12);
}
}
else
{
dataofcnt1GroupCntTmp[0]=0;
fpgaWr(WRITE_CNT1GROUP_COUNT,(unsigned char *)&dataofcnt1GroupCntTmp,sizeof(dataofcnt1GroupCntTmp));
}
#endif
}
void DevOp::readCalandarDat(void){
fpgaRd(READ_CALENDAR_DAT_ADDR,(unsigned char *)&sysPara->status.calandar_and_dat,16);
fpgaRd((READ_CALENDAR_DAT_ADDR + 0x34) ,(unsigned char *)&sysPara->status.Status_Counter3.cnt3CurrValue,4);
fpgaRd((READ_CALENDAR_DAT_ADDR + 0x38) ,(unsigned char *)&sysPara->status.XXXDay,2);
}
void DevOp::writeFpgaCalandar(bool Enable){
Q_UNUSED(Enable);
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);
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));
sysPara->para.Counter4.cnt4CurrValue= QString::number(sysPara->para.cnt4CurrValue).toUInt(0,16); //计数器4当前值用于隐藏功能
fpgaWr(WRITE_COUNTER4_ADDR,(unsigned char *)&sysPara->para.Counter4,sizeof(sysPara->para.Counter4));
sysPara->status.cnt3CurrentValueInitDoneFlag = true;
sysPara->status.cnt2CurrentValueInitDoneFlag = true;
sysPara->status.cnt1CurrentValueInitDoneFlag = true;
}
unsigned char dataOfvariNum[1];
unsigned char dataOfreg_var_print_ctrl[8][8];
void DevOp::writeFpgaVariCtrl(void){
writeFpgaCalandar(0);
dataOfvariNum[0]=sysPara->status.variNum;
fpgaWr(VAR_CNT_ADDR,dataOfvariNum,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 *)&reg_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 = Public::getType(p_var->type) %20;
memcpy(dataOfreg_var_print_ctrl[i],(unsigned char *)&reg_var_print_ctrl,8);
fpgaWr(VAR_CTRL_REG_ADDR,dataOfreg_var_print_ctrl[i],8);
}
}
unsigned char dataOfCmd[1];
void DevOp::printCtrl(int cmd){
dataOfCmd[0]=cmd;
fpgaWr(PRINT_START_STOP_CTRL,dataOfCmd,1);
}
void DevOp::printCtrl2(int cmd){
if(sysPara->para.SynCntEn) sysPara->para.SynCntEn1 = sysPara->para.SynCntEn;
else {
sysPara->para.SynCntEn1 = sysPara->status.isPrinting;
}
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
cmd=1;
}
unsigned int DevOp::readFpgaVersionNum(){
fpgaRd(0x00EC,&sysPara->status.FPGAChipType,1);
fpgaRd(0x00FE,(unsigned char *)&sysPara->status.fpgaVersionNum,2);
return 0;
}
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::readSTM32Version(void){
unsigned char stm32Verion[3];
stm32Rd(0xFA,(unsigned char *)&stm32Verion,3);
}
void DevOp::readSTM32Time(void){
static unsigned char stm32Time[8] = {};
stm32Rd(0xA1,(unsigned char *)&stm32Time,8);
}
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));
}
unsigned char dataOfMode[1];
void DevOp::clearProductCnt(unsigned int mode){
dataOfMode[0]=mode;
fpgaWr(PRINT_RESET_PRODUCT_CNT,dataOfMode,1);
}
unsigned char dataOfnum[1];
void DevOp::resumeFault(){
dataOfnum[0]=1;
fpgaWr(RESUME_FAULT_ADDR,dataOfnum,1);
}
unsigned char dataOfhighVoltage[1];
void DevOp::highVoltageCtrl(int val){
dataOfhighVoltage[0]=val;
stm32Wr(0x20,dataOfhighVoltage,1);
if(val == 0){
highVoltageOpenFlag = false;
}else{
highVoltageOpenFlag = true;
}
}
unsigned char dataOfmaxHighVoltageDAC[2];
void DevOp::maxHighVoltageDACCtrl(int val){
dataOfmaxHighVoltageDAC[0]=val;
dataOfmaxHighVoltageDAC[1]=val>>8;
sysPara->status.waitHightVolOn =0;
fpgaWr(PRINT_CTRL_ADDR_BASE + (unsigned int)(&sysPara->para.maxHighVoltageDAC) - (unsigned int)(&sysPara->para),dataOfmaxHighVoltageDAC,2);
}
unsigned char dataOfsetPhaseByHand[1];
void DevOp::setPhaseByHand(int val){
dataOfsetPhaseByHand[0]=val;
sysPara->para.phaseByHand = val;
fpgaWr(PRINT_CTRL_ADDR_BASE + (unsigned int)(&sysPara->para.phaseByHand) - (unsigned int)(&sysPara->para),dataOfsetPhaseByHand,1);
}
void DevOp::readPhaseDetectHighTm(void){
fpgaRd(PHASE_DETECT_HIGH_VOLTAGE_TM,(unsigned char *)&sysPara->status.phaseDetectHighTm,sizeof(sysPara->status.phaseDetectHighTm));
}
unsigned char dataOfPhaseDetectVoltageDutyCycle[2];
void DevOp::setPhaseDetectVoltageDutyCycle(int duty){
unsigned value = (duty * sysPara->para.divideRatio * 2) / 100;
dataOfPhaseDetectVoltageDutyCycle[0]=value;
dataOfPhaseDetectVoltageDutyCycle[1]=value>>8;
fpgaWr(PRINT_CTRL_ADDR_BASE + (unsigned int)(&sysPara->para.phase_detect_high_cnt) - (unsigned int)(&sysPara->para),dataOfPhaseDetectVoltageDutyCycle,2);
}
unsigned char dataOfBlickLightPeriod[2];
void DevOp::setBlickLightPeriod(int value){
dataOfBlickLightPeriod[0]=value;
dataOfBlickLightPeriod[1]=value>>8;
fpgaWr(PRINT_CTRL_ADDR_BASE + (unsigned int)(&sysPara->para.blinkLightPeriod) - (unsigned int)(&sysPara->para),dataOfBlickLightPeriod,2);
}
void DevOp::setOscillatorVoltage(int value){
if(value<100)
fpgaWr(PRINT_CTRL_ADDR_BASE + (unsigned int)(&sysPara->para.oscillatorVoltage) - (unsigned int)(&sysPara->para),(unsigned char*)&OscillatorVoltage[value],1);
}
void DevOp::setDivideRatio(int value){
fpgaWr(PRINT_CTRL_ADDR_BASE + (unsigned int)(&sysPara->para.divideRatio) - (unsigned int)(&sysPara->para),(unsigned char*)&sysPara->para.divideRatio,2);
}
unsigned char dataOfLastLineEndPointFixedValue[2];
void DevOp::setLastLineEndPointFixedValue(int value){
value=value*MAX_FPGA_DAC_VALUE/1000;
dataOfLastLineEndPointFixedValue[0]=value;
dataOfLastLineEndPointFixedValue[1]=value>>8;
fpgaWr(PRINT_CTRL_ADDR_BASE + (unsigned int)(&sysPara->para.lastLineEndPointFixedDACValue) - (unsigned int)(&sysPara->para),dataOfLastLineEndPointFixedValue,2);
}
unsigned char dataOfmainInkCtrl[1];
void DevOp::mainInkCtrl()
{
dataOfmainInkCtrl[0]=(isReleaseValveOpen()?(1<<3):0)+(isMainInkPumpOpen()?(1<<2):0) + (sysPara->status.selfCheckDone?(1<<1):0) + (sysPara->status.isPumpValveControledByHand?1:0);
fpgaWr(MAININKCTRL_ADDR,dataOfmainInkCtrl,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)>>8)&0xff;
}
else {
buf[i++] = (sysPara->para.pressure)&0xff;
buf[i++] = (sysPara->para.pressure>>8)&0xff;
}
buf[i++]=(sysPara->para.viscosityPumpInterval*100)&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)>>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)/500;
}
else if(sysPara->para.viscosityAdjust==2)//1.0%
{
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/500;
}
else if(sysPara->para.viscosityAdjust==3)//2.0%
{
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);
fpgaWr(MAININKCTRL_ADDR,(unsigned char *)buf,i);// //20140423 5A,5B
}
void DevOp::showData( QByteArray dat)
{
int i,len;
QString s="";
len = dat.length();
for(i=0;i<len;i++)
{
s+=QString().sprintf("%02X ",(unsigned char)dat.at(i));
}
qDebug()<<"ShowData"<<s;
}
// 20161217 修改测试
// 20170711 随机码位置错位问题
void DevOp::Read_RanddomFromFpga()
{
unsigned char buf[256];
QByteArray str;
QString ss;
int i,len,n,c;
if(sysPara->status.RandomNum>0)
{
if(sysPara->status.RandomNum>32){
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;i<len;i++)
{
for(c=0;c<2;c++)
{
int k=(n%16);
if( k < 16-sysPara->status.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)
{
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(" ");
}
}
else ;
n++;
}
}
QFile f1("/home/plg/Xrand2.txt");
f1.open(QFile::ReadWrite);
f1.seek(f1.size());
f1.write(str);
len = f1.size();
f1.close();
if(len>3500000)
{
sysPara->status.RandomBackCnt=10;
ss= "mv /home/plg/Xrand2.txt /home/plg/rand" + QDateTime::currentDateTime().toString("yyMMddhhmmss")+".txt";
system(ss.toLatin1());
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.toLatin1());
system("mv /home/plg/rand*.txt /udisk/");
sysPara->status.RandomBackCnt=0;
}
else
{
//f1.open(QFile::ReadWrite);
int len= f1.size();
//f1.close();
if(len>3500000 || ok )
{
system(str.toLatin1());
system("mv /home/plg/rand*.txt /udisk/");
}
}
}
#ifdef __RFID_CARD
typedef unsigned char UCHAR;
void CheckSumOut(UCHAR *buf, UCHAR len)
{
UCHAR i;
UCHAR checksum;
checksum = 0;
for (i = 0; i < (len - 1); i++)
{
checksum ^= buf[i];
}
buf[len - 1] = (UCHAR)~checksum;
}
bool CheckSumIn(UCHAR *buf, UCHAR len)
{
UCHAR i;
UCHAR checksum;
checksum = 0;
for (i = 0; i < (len - 1); i++)
{
checksum ^= buf[i];
}
if (buf[len - 1] == (UCHAR)~checksum)
{
return true;
}
return false;
}
//字节流转换为十六进制字符串的另一种实现方式
void Hex2Str(const UCHAR *sSrc, UCHAR *sDest, int nSrcLen)
{
int i;
char szTmp[3];
for (i = 0; i < nSrcLen; i++)
{
sprintf(szTmp, "%02X", (unsigned char)sSrc[i]);
memcpy(&sDest[i * 2], szTmp, 2);
}
sDest[nSrcLen * 2] = '\0';
return;
}
//十六进制字符串转换为字节流
void HexStrToByte(const UCHAR* source, UCHAR* dest, int sourceLen)
{
short i;
unsigned char highByte, lowByte;
for (i = 0; i < sourceLen; i += 2)
{
highByte = toupper(source[i]);
lowByte = toupper(source[i + 1]);
if (highByte > 0x39)
highByte -= 0x37;
else
highByte -= 0x30;
if (lowByte > 0x39)
lowByte -= 0x37;
else
lowByte -= 0x30;
dest[i / 2] = (highByte << 4) | lowByte;
}
return;
}
void DevOp::comForRFID_init(void)
{
// return;
comForRFID = new QSerialPort();
comForRFID->setPortName("/dev/ttyAS1");
// 覆盖默认串口名称,用于x86架构调试
#ifdef ARCH_X86
comForRFID->setPortName("/dev/ttyUSB0");
#endif
LogInfo::setRunStatusText("RFID port dev name: " + comForRFID->portName());
comForRFID->setBaudRate(9600);
comForRFID->setDataBits(QSerialPort::Data8);
comForRFID->setParity(QSerialPort::NoParity);
comForRFID->setStopBits(QSerialPort::OneStop);
comForRFID->setFlowControl(QSerialPort::NoFlowControl);
if (comForRFID->open(QIODevice::ReadWrite)) {
qInfo() << "RFID串口打开成功";
connect(comForRFID,SIGNAL(readyRead()),this,SLOT(readRFIDData()));
LogInfo::setRunStatusText("Successed to open RFID port");
} else {
qDebug() << "RFID串口打开失败: " << comForRFID->errorString();
LogInfo::setRunStatusText("Failed to open RFID port");
}
}
void DevOp::readRFIDData(){
RFIDReadData.append(comForRFID->readAll());
}
extern void MySleep(unsigned int msec);
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] = {0};
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())
{
LogInfo::setRunStatusText(tr("readB6Req"));
comForRFID->clear(QSerialPort::Input);
comForRFID->write(temp);
}
else
{
qDebug()<<"read uart for RFID not open!";
}
MySleep(200);
int n = RFIDReadData.size();
if(n>0)
{
recResponse = RFIDReadData;
RFIDReadData.clear();
LogInfo::setRunStatusText(tr("readB6com"));
}
memcpy(revdata, recResponse.constData(), n);
if ((revdata[0] == 0x01) && ((revdata[1] == 8) || (revdata[1] == 22)) && (revdata[1] == n) && (revdata[2] == 0xA3) && (revdata[3] == 0x20))//判断是否为读数据块返回的数据包
{
LogInfo::setRunStatusText(tr("readB6suc"));
bool status = CheckSumIn(revdata, revdata[1]); //计算校验和
if (status)
{
if (revdata[4] == 0x00) //读数据块成功
{
UCHAR blockdata[16];
UCHAR temp[33];
for (int i = 0; i < 16; i++)
{
blockdata[i] = revdata[5 + i]; //复制数据到数组
}
Hex2Str(&blockdata[0], &temp[0], 16); // 数据块数据转换为字符
//CardDataRwLock.lockForWrite();
strRevdata = QString((const char*)temp);
// CardDataRwLock.unlock();
// qDebug() << "读数据块成功,数据块6" << "数据为:" << temp << endl << endl;
return 1;
}
}
}
return 0;
}
/*
int DevOp::comWriteRFID_data(int type)
{
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] = 0x17;
Cmd[2] = 0x5B;
if(type == 1)
Cmd[4] = 0x06; //块6
else if(type == 2)
Cmd[4] = 0x0A; //块10
//save current date and time
QDateTime curDateTime = QDateTime::currentDateTime();
QString str = curDateTime.toString("yy:MM:dd:hh:mm:ss");
QList<QString> list = str.split(":");
for(int i = 0;i < list.size();i++){
Cmd[i+6] = list.at(i).toInt();
LogInfo::setRunStatusText(tr("Cmd[%1]: %2").arg(i+6).arg(Cmd[i+6]));
qDebug()<<"Cmd["<<i+6<<"]: "<<Cmd[i+6];
}
CheckSumOut(Cmd, Cmd[1]);
QByteArray temp;
QByteArray recResponse;
temp.append((const char*)Cmd,Cmd[1]);
if(comForRFID->isOpen())
{
comForRFID->clear(QSerialPort::Input);
comForRFID->write(temp);
}
else
{
qDebug()<<"read uart for RFID not open!";
}
MySleep(200);
int n = RFIDReadData.size();
if(n>0)
{
recResponse = RFIDReadData;
RFIDReadData.clear();
QString str;
str.sprintf("%d - %d - %d", recResponse.at(0),recResponse.at(1),recResponse.at(2));
qDebug()<<"写数据到数据块6: "<<str;
}
memcpy(revdata, recResponse.constData(), n);
if ((revdata[0] == 0x01) && (revdata[1] == 8) && (revdata[1] == n) && (revdata[2] == 0x5B) && (revdata[3] == 0x20)) //判断是否为写数据返回的数据包
{
bool status = CheckSumIn(revdata, revdata[1]); //计算校验和
if (status)
{
if (revdata[4] == 0x00) //写数据块成功
{
qDebug() << "写数据到数据块6" << "成功!" << endl << endl;
return 1;
}
else //写数据块失败
{
qDebug() << "写数据到数据块6" << "失败!" << endl << endl;
}
}
}
else
{
qDebug() << "写数据到数据块6" << "失败2!" << endl << endl;
}
return 0;
}
*/
int DevOp::RFIDmarkCardUsedAsync(int type)
{
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] = 0x17;
Cmd[2] = 0x5B;
Cmd[4] = 0x06; //读块6
//save current date and time
QDateTime curDateTime = QDateTime::currentDateTime();
QString str = curDateTime.toString("yy:MM:dd:hh:mm:ss");
QList<QString> list = str.split(":");
for(int i = 0;i < list.size();i++){
Cmd[i+6] = list.at(i).toInt();
LogInfo::setRunStatusText(tr("Cmd[%1]: %2").arg(i+6).arg(Cmd[i+6]));
qDebug()<<"Cmd["<<i+6<<"]: "<<Cmd[i+6];
}
//
if(type == 0) {
Cmd[6] = 0x10;
Cmd[7] = 0x0A;
}
else if(type == 1) {
Cmd[6] = 0x10;
Cmd[7] = 0x0B;
}
else if(type == 2) {
Cmd[6] = 0x10;
Cmd[7] = 0x0C;
}
CheckSumOut(Cmd, Cmd[1]);
QByteArray temp;
QByteArray recResponse;
temp.append((const char*)Cmd,Cmd[1]);
if(comForRFID->isOpen())
{
comForRFID->clear(QSerialPort::Input);
comForRFID->clear(QSerialPort::Output);
comForRFID->disconnect(this);
comForRFID->write(temp);
}
else
{
qDebug()<<"read uart for RFID not open!";
}
QElapsedTimer elapsedTimer;
elapsedTimer.start();
while(comForRFID->bytesAvailable() < 8 && !elapsedTimer.hasExpired(2000)) {
QApplication::processEvents(QEventLoop::AllEvents, 100);
}
int n = comForRFID->bytesAvailable();
qDebug() << "RFIDReader response time: " << elapsedTimer.elapsed() << "ms";
connect(comForRFID, &QSerialPort::readyRead, this, &DevOp::readRFIDData);
if(n < 8) {
qDebug() << "读取数据失败, 数据长度不足8字节" << endl << endl;
return 0;
}
n = 8;
recResponse = comForRFID->read(n);
memcpy(revdata, recResponse.constData(), n);
if ((revdata[0] == 0x01) && (revdata[1] == 8) && (revdata[1] == n) && (revdata[2] == 0x5B) && (revdata[3] == 0x20)) //判断是否为写数据返回的数据包
{
bool status = CheckSumIn(revdata, revdata[1]); //计算校验和
if (status)
{
if (revdata[4] == 0x00) //写数据块成功
{
qDebug() << "写数据到数据块6" << "成功!" << endl << endl;
return 1;
}
else //写数据块失败
{
qDebug() << "写数据到数据块6" << "失败!" << endl << endl;
}
}
}
else
{
qDebug() << "写数据到数据块6" << "失败2!" << endl << endl;
}
return 0;
}
int DevOp::setRFIDCarKey(void)
{
UCHAR revdata[100] = {0};
UCHAR Cmd[8] ;
Cmd[0] = 0x01; //命令格式请核对协议手册充值章节
Cmd[1] = 0x08;
Cmd[2] = 0xA5; //加密扇区
Cmd[3] = 0x20;
Cmd[4] = 0x07; //块7
Cmd[5] = 0x01;
Cmd[6] = 0x00;
Cmd[7] = 0x00;
CheckSumOut(Cmd, Cmd[1]);
QByteArray temp;
QByteArray recResponse;
temp.append((const char*)Cmd,Cmd[1]);
if(comForRFID->isOpen())
{
comForRFID->clear(QSerialPort::Input);
comForRFID->write(temp);
}
else
{
qDebug()<<"read uart for RFID not open!";
}
MySleep(200);
int n = RFIDReadData.size();
if(n>2)
{
recResponse = RFIDReadData;
RFIDReadData.clear();
QString str;
str.sprintf("%d - %d - %d", recResponse.at(0),recResponse.at(1),recResponse.at(2));
qDebug()<<"加密IC卡: "<<str;
}
if(n > (int)sizeof(revdata)) n = sizeof(revdata);
memcpy(revdata, recResponse.constData(), n);
if ((revdata[0] == 0x01) &&( revdata[1] == 8 )&& (revdata[1] == n) && (revdata[2] == 0xA5) && (revdata[3] == 0x20)) //判断是否为设置地址返回的数据包
{
bool status = CheckSumIn(revdata, revdata[1]); //计算校验和
if (status)
{
if (revdata[4] == 0x00) //成功
{
qDebug() << "加密IC卡成功!" << endl << endl;
}
else
{
qDebug() << "加密IC卡失败!" << endl << endl;
}
}
}
else
{
qDebug() << "加密IC卡失败2!" << endl << endl;
}
}
int DevOp::setRFIDReaderKey(int mac,int type)
{
if(mac == 0) mac = 100;
QString strMac1 = QString::number(mac).mid(0,3);
strMac1 = "Vernon" + strMac1 + "Bach";
strMac1 = strMac1.leftJustified(16,'6');
QString strMac2 =QString::number(mac).mid(0,3);
strMac2 = "VernonBach" + strMac2;
strMac2 = strMac2.leftJustified(16,'6');
QByteArray password = "";
if(type == 1)
password = RFIDFunction::createPassword((const QByteArray)strMac1.toUtf8());
else if(type == 2)
password = RFIDFunction::createPassword((const QByteArray)strMac2.toUtf8());
const QByteArray pw = password.mid(12,12);
UCHAR revdata[100];
UCHAR Cmd[21] ;
Cmd[0] = 0x03; //命令格式请核对协议手册充值章节
Cmd[1] = 0x15;
Cmd[2] = 0xC3; //设置密钥
Cmd[3] = 0x20;
Cmd[4] = 0x99;
Cmd[5] = 0x88;
Cmd[6] = 0x77;
Cmd[7] = 0x66;
Cmd[8] = 0x55;
Cmd[9] = 0x44;
Cmd[10] = 0xFF;
Cmd[11] = 0x07;
Cmd[12] = 0x80;
Cmd[13] = 0x69;
Cmd[14] = 0xAA;
Cmd[15] = 0xBB;
Cmd[16] = 0xCC;
Cmd[17] = 0xDD;
Cmd[18] = 0xEE;
Cmd[19] = 0xFF;
Cmd[20] = 0x1B;
#ifndef __RFID_OLD
bool ok;
for(int i = 0;i<6;i++){
int pwInt = Cmd[i+14] = pw.mid(i*2,2).toInt(&ok,16);
if (!ok) {
qDebug() << "Error: Invalid hex value: "<<pw.mid(i*2,2);
return -1;
}
if(pwInt < 256)
Cmd[i+4] = Cmd[i+14] = pwInt;
else{
qDebug() << "Error: Invalid pwInt value: "<<pwInt;
return -1;
}
}
#endif
CheckSumOut(Cmd, Cmd[1]);
QByteArray temp;
QByteArray recResponse;
temp.append((const char*)Cmd,Cmd[1]);
if(comForRFID->isOpen())
{
comForRFID->clear(QSerialPort::Input);
comForRFID->clear(QSerialPort::Output);
comForRFID->disconnect(this);
comForRFID->write(temp);
}
else
{
qDebug()<<"read uart for RFID not open!";
return -2;
}
QElapsedTimer elapsedTimer;
elapsedTimer.start();
while(comForRFID->bytesAvailable() < 8 && !elapsedTimer.hasExpired(20000)) {
QApplication::processEvents(QEventLoop::AllEvents, 100);
}
int n = comForRFID->bytesAvailable();
qDebug() << "RFIDReader response time: " << elapsedTimer.elapsed() << "ms";
connect(comForRFID, &QSerialPort::readyRead, this, &DevOp::readRFIDData);
if(n < 8) {
LogInfo::setRunStatusText(u8"读取数据失败, 数据长度不足8字节");
return -3;
}
n = 8;
recResponse = comForRFID->read(n);
memcpy(revdata, recResponse.constData(), n);
if ((revdata[0] == 0x03) &&( revdata[1] == 8 )&& (revdata[1] == n) && (revdata[2] == 0xC3) && (revdata[3] == 0x20)) //判断是否为设置地址返回的数据包
{
bool status = CheckSumIn(revdata, revdata[1]); //计算校验和
if (status)
{
if (revdata[4] == 0x00) //成功
{
qDebug() << "设置读写器密码成功!" << endl << endl;
LogInfo::setRunStatusText(tr("设置读写器密码成功!"));
return 0;
}
else
{
qDebug() << "设置读写器密码失败!" << endl << endl;
}
}
}
else
{
qDebug() << "设置读写器密码失败!" << endl << endl;
}
return -4;
}
int DevOp::setRFIDReaderOriginalKey(void)
{
UCHAR revdata[100] = {0};
UCHAR Cmd[11] ;
Cmd[0] = 0x03; //命令格式请核对协议手册充值章节
Cmd[1] = 0x0B;
Cmd[2] = 0xC4; //设置密钥
Cmd[3] = 0x20;
Cmd[4] = 0xFF;
Cmd[5] = 0xFF;
Cmd[6] = 0xFF;
Cmd[7] = 0xFF;
Cmd[8] = 0xFF;
Cmd[9] = 0xFF;
Cmd[10] = 0x00;
CheckSumOut(Cmd, Cmd[1]);
QByteArray temp;
QByteArray recResponse;
temp.append((const char*)Cmd,Cmd[1]);
if(comForRFID->isOpen())
{
comForRFID->clear(QSerialPort::Input);
comForRFID->write(temp);
}
else
{
qDebug()<<"read uart for RFID not open!";
}
MySleep(200);
int n = RFIDReadData.size();
if(n>2)
{
recResponse = RFIDReadData;
RFIDReadData.clear();
QString str;
str.sprintf("%d - %d - %d", recResponse.at(0),recResponse.at(1),recResponse.at(2));
qDebug()<<"设置读写器原始密码: "<<str;
}
if(n > (int)sizeof(revdata)) n = sizeof(revdata);
memcpy(revdata, recResponse.constData(), n);
if ((revdata[0] == 0x03) &&( revdata[1] == 8 )&& (revdata[1] == n) && (revdata[2] == 0xC4) && (revdata[3] == 0x20)) //判断是否为设置地址返回的数据包
{
bool status = CheckSumIn(revdata, revdata[1]); //计算校验和
if (status)
{
if (revdata[4] == 0x00) //成功
{
qDebug() << "设置读写器原始密码成功!" << endl << endl;
}
else
{
qDebug() << "设置读写器原始密码失败!" << endl << endl;
}
}
}
else
{
qDebug() << "设置读写器原始密码失败!" << endl << endl;
}
}
int DevOp::setRFIDReaderWorkMode(void)
{
UCHAR revdata[100] = {0};
UCHAR Cmd[8] ;
Cmd[0] = 0x03; //命令格式请核对协议手册充值章节
Cmd[1] = 0x08; // 包长度
Cmd[2] = 0xC1; //设置工作模式
Cmd[3] = 0x20; // 地址,固定0x20
Cmd[4] = 0x03; // 自动读块数据
Cmd[5] = 0x06; //读块6
Cmd[6] = 0x00; //主动发送数据
Cmd[7] = 0x00;
CheckSumOut(Cmd, Cmd[1]);
QByteArray temp;
QByteArray recResponse;
temp.append((const char*)Cmd,Cmd[1]);
if(comForRFID->isOpen())
{
comForRFID->clear(QSerialPort::Input);
comForRFID->clear(QSerialPort::Output);
comForRFID->disconnect(this);
comForRFID->write(temp);
}
else
{
qDebug()<<"read uart for RFID not open!";
return -1;
}
QElapsedTimer elapsedTimer;
elapsedTimer.start();
while(comForRFID->bytesAvailable() < 8 && !elapsedTimer.hasExpired(20000)) {
QApplication::processEvents(QEventLoop::AllEvents, 100);
}
int n = comForRFID->bytesAvailable();
qDebug() << "RFIDReader response time: " << elapsedTimer.elapsed() << "ms";
connect(comForRFID, &QSerialPort::readyRead, this, &DevOp::readRFIDData);
if(n < 8) {
LogInfo::setRunStatusText(u8"读取数据失败, 数据长度不足8字节");
return -2;
}
n = 8;
recResponse = comForRFID->read(n);
memcpy(revdata, recResponse.constData(), n);
if ((revdata[0] == 0x03) &&( revdata[1] == 8 )&& (revdata[1] == n) && (revdata[2] == 0xC1) && (revdata[3] == 0x20)) //判断是否为设置地址返回的数据包
{
bool status = CheckSumIn(revdata, revdata[1]); //计算校验和
if (status)
{
if (revdata[4] == 0x00) //成功
{
qDebug() << "设置读写器工作模式成功!" << endl << endl;
LogInfo::setRunStatusText(tr("设置读写器工作模式成功!"));
return 0;
}
else
{
qDebug() << "设置读写器工作模式失败!" << endl << endl;
LogInfo::setRunStatusText("Failed to set RFID reader work mode!");
}
}
}
else
{
qDebug() << "设置读写器工作模式失败!" << endl << endl;
LogInfo::setRunStatusText("Failed to set RFID reader work mode!");
}
return -3;
}
int DevOp::receiveReadRFID_data(void)
{
UCHAR revdata[100] = {0};
QByteArray recResponse;
int n = RFIDReadData.size();
if(n>0)
{
recResponse = RFIDReadData;
RFIDReadData.clear();
showData(recResponse);
}
else
return 0;
if(n > (int)sizeof(revdata)) // 防止越界
n = sizeof(revdata);
memcpy(revdata, recResponse.constData(), n);
if ((revdata[0] == 0x04) && ((revdata[1] == 8) || (revdata[1] == 22)) && (revdata[1] == n) && (revdata[2] == 0x03) && (revdata[3] == 0x20))//判断是否为读数据块返回的数据包
{
bool status = CheckSumIn(revdata, revdata[1]); //计算校验和
if (status)
{
if (revdata[4] == 0x00) //读数据块成功
{
UCHAR blockdata[16] = {0};
UCHAR temp[33] = {0};
for (int i = 0; i < 16; i++)
{
blockdata[i] = revdata[5 + i]; //复制数据到数组
}
Hex2Str(&blockdata[0], &temp[0], 16); // 数据块数据转换为字符
strRevdata = QString((const char*)temp);
qDebug() << "读数据块成功, 数据块6" << "数据为:" << strRevdata << endl << endl;
return 1;
}
else
{
return 0;
}
}
}
return 0;
}
int DevOp::queryReadRFID_address(void)
{
UCHAR Cmd[8] ;
Cmd[0] = 0x02; //命令格式请核对协议手册充值章节
Cmd[1] = 0x08;
Cmd[2] = 0xB0; //查询读写器地址
Cmd[3] = 0x00;
Cmd[4] = 0x00;
Cmd[5] = 0x00;
Cmd[6] = 0x00;
Cmd[7] = 0x00;
CheckSumOut(Cmd, Cmd[1]);
QByteArray temp;
temp.append((const char*)Cmd,Cmd[1]);
if(comForRFID->isOpen())
{
comForRFID->clear(QSerialPort::Input);
RFIDReadData.clear();
comForRFID->write(temp);
}
else
{
qDebug()<<"read uart for RFID not open!";
}
MySleep(100);
int n = RFIDReadData.size();
UCHAR revdata[100] = {0};
if(n > (int)sizeof(revdata)) n = sizeof(revdata);
memcpy(revdata, RFIDReadData.constData(), n);
if(n>4)
{
showData(RFIDReadData);
if(CheckSumIn(revdata, revdata[1]) == false){
RFIDReadData.clear();
return 0;
}
if(revdata[0] == 0x02 && revdata[1] == 0x08 && revdata[2] == 0xB0 && revdata[4] == 0x00){
RFIDReadData.clear();
return 1;
}
}
else
{
return 2;
}
}
#endif
void DevOp::writeDacValue2Fpga_No72NewVoltData(){
// LogInfo::setRunStatusText("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)); //一列第一个点是单点
}
unsigned char dataofHighVoltageAmplitude[1];
void DevOp::setHighVoltageAmplitudetoSTM32(){
dataofHighVoltageAmplitude[0]=sysPara->para.HighVoltageAmplitude;
emit sendSerialDataToSTM32(2,0x1f,dataofHighVoltageAmplitude,1,2);
}
void DevOp::resendFPGADate(int cmd, int addr, unsigned char *dat, int len, int type){
emit sendSerialDataToFPGA(cmd,addr,dat,len,type);
}
void DevOp::resendSTM32Date(int cmd, int addr, unsigned char *dat, int len, int type){
emit sendSerialDataToSTM32(cmd,addr,dat,len,type);
}
void DevOp::DACValueWithVoltageAdj(){
memset(DACArray,0,sizeof(DACArray));
memset(notGapDACArray,0,sizeof(notGapDACArray));
memset(fullColDACArray,0,sizeof(fullColDACArray));
int nCurrPrintRow = sysPara->status.currPrintRow;
#define DAC_RADIO (nCurrPrintRow > 1 ? (13.05*(100-((100-sysPara->para.dacScale)/((nCurrPrintRow-1)>0?(nCurrPrintRow-1):1)*i))/100) : 13.05)
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;
}
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;
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 == 2){
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->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;
}
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;
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->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;
if(sysPara->para.recommendedPrintSpeed == 1){
adj_dac_temp = fast_96k_9dot_adj_default_dac_S[i] * DAC_RADIO;
DACArray[i] = adj_dac_temp;
continue_dac_temp = fast_96k_9dot_continue_default_dac_S[i] * DAC_RADIO;
notGapDACArray[i] = continue_dac_temp;
full_dac_temp = fast_96k_9dot_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] = 25;
sysPara->voltePara.pixel_para_table[5] = 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;
}
}
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->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;
if(sysPara->para.alterPrint.enable){
adj_dac_temp = normal_64k_5dot_adj_default_dac[i] * DAC_RADIO;
DACArray[i] = adj_dac_temp;
continue_dac_temp = normal_64k_5dot_continue_default_dac[i] * DAC_RADIO;
notGapDACArray[i] = continue_dac_temp;
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_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;
if(sysPara->para.alterPrint.enable){
adj_dac_temp = slow1_64k_5dot_adj_default_dac[i] * DAC_RADIO;
DACArray[i] = adj_dac_temp;
continue_dac_temp = slow1_64k_5dot_continue_default_dac[i] * DAC_RADIO;
notGapDACArray[i] = continue_dac_temp;
full_dac_temp = slow1_64k_5dot_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.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;
}
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((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) {
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((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) {
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((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.oscillatoFreq == 3){// 128K
if( (i < 5) && sysPara->para.alterPrint.enable) {//交替
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->status.currPrintRow <= 16) {
for(int i = 0; i < sysPara->status.currPrintRow; i++)
{
if (sysPara->para.oscillatoFreq == 0) { // 64K
if (sysPara->para.printRowDelay == 0){
if((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;
if((i < 7) && sysPara->para.alterPrint.enable){
adj_dac_temp = normal_64k_7dot_adj_default_dac[i] * DAC_RADIO;
DACArray[i] = adj_dac_temp;
continue_dac_temp = normal_64k_7dot_continue_default_dac[i] * DAC_RADIO;
notGapDACArray[i] = continue_dac_temp;
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_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;
if((i < 7) && sysPara->para.alterPrint.enable){
adj_dac_temp = slow1_64k_7dot_adj_default_dac[i] * DAC_RADIO;
DACArray[i] = adj_dac_temp;
continue_dac_temp = slow1_64k_7dot_continue_default_dac[i] * DAC_RADIO;
notGapDACArray[i] = continue_dac_temp;
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){
if((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){
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((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) {
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((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.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->status.currPrintRow <= 24) {
for(int i = 0; i < sysPara->status.currPrintRow; i++)
{
if (sysPara->para.oscillatoFreq == 0) { // 64K
if (sysPara->para.printRowDelay == 0){
if((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;
if((i < 9) && sysPara->para.alterPrint.enable){
adj_dac_temp = normal_64k_9dot_adj_default_dac[i] * DAC_RADIO;
DACArray[i] = adj_dac_temp;
continue_dac_temp = normal_64k_9dot_continue_default_dac[i] * DAC_RADIO;
notGapDACArray[i] = continue_dac_temp;
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_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;
if((i < 9) && sysPara->para.alterPrint.enable){
adj_dac_temp = slow1_64k_9dot_adj_default_dac[i] * DAC_RADIO;
DACArray[i] = adj_dac_temp;
continue_dac_temp = slow1_64k_9dot_continue_default_dac[i] * DAC_RADIO;
notGapDACArray[i] = continue_dac_temp;
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){
if((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;
}
}
else if (sysPara->para.printRowDelay == 1){
if((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;
}
}
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((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;
}
}
}
else 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->status.currPrintRow <= 32) {
for(int i = 0; i < sysPara->status.currPrintRow; i++){
if (sysPara->para.oscillatoFreq == 0) {
if((sysPara->para.printRowDelay == 1) && (sysPara->para.alterPrint.enable)){
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) && (sysPara->para.alterPrint.enable)){
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) {
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.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;
}
}
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;
}
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;
}
}
}
else{
for(int i = 0; i < sysPara->status.currPrintRow; i++){
if (sysPara->para.oscillatoFreq == 0) {
if((sysPara->para.printRowDelay == 1) && (sysPara->para.alterPrint.enable)){
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_12dot_full_default_dac[i] * DAC_RADIO;
fullColDACArray[i] = full_dac_temp;
}
else if((sysPara->para.printRowDelay == 2) && (sysPara->para.alterPrint.enable)){
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) {
if((sysPara->para.printRowDelay == 1) && (sysPara->para.alterPrint.enable)){
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_12dot_full_default_dac[i] * DAC_RADIO;
fullColDACArray[i] = full_dac_temp;
}
else if((sysPara->para.printRowDelay == 2) && (sysPara->para.alterPrint.enable)){
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;
}
}
}
}
}
static unsigned short * voltArray = NULL;
static unsigned short highspeedmode_7dot_dac[1152]; //128*9=1152
static unsigned short highspeedmode_9dot_dac[4608]; //512*9 = 4608
void DevOp::writeDataToFpga_No67HighSpeedMode(Voltage_Version version,bool flag){
// LogInfo::setRunStatusText("writeDataToFpga_No67HighSpeedMode");
memset(highspeedmode_7dot_dac, 0, sizeof(highspeedmode_7dot_dac));
memset(highspeedmode_9dot_dac, 0, sizeof(highspeedmode_9dot_dac));
QString volParaFilePath;
if(version == VersionOf67And7HighSpeed){
volParaFilePath = ":/conf/normal_128k_7dot_dac.txt";
}
else if(version == VersionOf67And7SuperSpeed){
volParaFilePath = ":/conf/fast_128k_7dot_dac.txt";
}
else if(version == VersionOf67And9HighSpeed){
volParaFilePath = ":/conf/normal_128k_9dot_dac.txt";
}
else if(version == VersionOf67And9SuperSpeed){
volParaFilePath = ":/conf/normal_128k_9dot_dac.txt";
}
int max_size = 0;
if(sysPara->status.currPrintRow <= 7){
voltArray = (unsigned short *)highspeedmode_7dot_dac;
max_size = 1152;
}else if(sysPara->status.currPrintRow <= 9){
voltArray = (unsigned short *)highspeedmode_9dot_dac;
max_size = 4608;
}
QFile file(volParaFilePath);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
qDebug() << "open failed normal_128k_7dot_dac.txt!";
return;
}
QTextStream in(&file);
int i = 0;
while (!in.atEnd()) {
QString str = in.readLine();
QStringList list = str.split(","); // 确保文件中的分隔符是逗号
for (int j = 0; j < 9 && j < list.size(); j++) {
if (!list[j].isEmpty() && (voltArray != NULL) && i<max_size) { // 检查列表项不为空
voltArray[i] =list[j].toShort();
}
i++;
}
}
file.close();
if(sysPara->status.currPrintRow <= 7){
if(flag)
fpgaWr(0xB500,(unsigned char *)voltArray,2304); //128*9=1152 1152*2 = 2304
else
fpgaWr(0xB200,(unsigned char *)voltArray,2304);
}
else if(sysPara->status.currPrintRow <= 9){
if(flag)
fpgaWr(0xB500,(unsigned char *)voltArray,9216); //512*9 = 4608 4608*2=9216
else
fpgaWr(0xB200,(unsigned char *)voltArray,9216);
}
}