hlp:merge
This commit is contained in:
@@ -1,381 +1,381 @@
|
|||||||
/*
|
/*
|
||||||
* DevOp.h
|
* DevOp.h
|
||||||
*
|
*
|
||||||
* Created on: Jun 25, 2013
|
* Created on: Jun 25, 2013
|
||||||
* Author: yiyu
|
* Author: yiyu
|
||||||
* QQ:1036184468
|
* QQ:1036184468
|
||||||
* Descriptoin:
|
* Descriptoin:
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef DEVOP_H_
|
#ifndef DEVOP_H_
|
||||||
#define DEVOP_H_
|
#define DEVOP_H_
|
||||||
|
|
||||||
/************以前的硬件版本,跟VX5版本号冲突,取消
|
/************以前的硬件版本,跟VX5版本号冲突,取消
|
||||||
#define JETV1 1
|
#define JETV1 1
|
||||||
#define JETV2 2
|
#define JETV2 2
|
||||||
#define JETV3 3 // EP3C10F144
|
#define JETV3 3 // EP3C10F144
|
||||||
#define JETV23 4 // V5,V4主板编号均为4; V6没有正式投入使用
|
#define JETV23 4 // V5,V4主板编号均为4; V6没有正式投入使用
|
||||||
#define JETV7 7 // EP4CE15F144, ARM 335X
|
#define JETV7 7 // EP4CE15F144, ARM 335X
|
||||||
#define PRODUCT_VERSION(ver) ((ver>>13) & 0x7)
|
#define PRODUCT_VERSION(ver) ((ver>>13) & 0x7)
|
||||||
**********************/
|
**********************/
|
||||||
class SysPara;
|
class SysPara;
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include "myinclude.h"
|
#include "myinclude.h"
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QQueue>
|
#include <QQueue>
|
||||||
#include <QMetaType>
|
#include <QMetaType>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
#include <QReadWriteLock>
|
#include <QReadWriteLock>
|
||||||
#include <QSerialPort>
|
#include <QSerialPort>
|
||||||
|
|
||||||
#define DisTraceMsg() printf("###############TRACE,Line:%d File:%s Fun:%s\n",__LINE__,__FILE__,__FUNCTION__);
|
#define DisTraceMsg() printf("###############TRACE,Line:%d File:%s Fun:%s\n",__LINE__,__FILE__,__FUNCTION__);
|
||||||
#define DisWarnmsg() printf("~~~~~~~~~~~~~~~WARN,Line:%d File:%s Fun:%s\n",__LINE__,__FILE__,__FUNCTION__);
|
#define DisWarnmsg() printf("~~~~~~~~~~~~~~~WARN,Line:%d File:%s Fun:%s\n",__LINE__,__FILE__,__FUNCTION__);
|
||||||
#define DisErrorMsg() printf("!!!!!!!!!!!!!!!ERROR! ,Line:%d File:%s Fun:%s\n",__LINE__,__FILE__,__FUNCTION__);
|
#define DisErrorMsg() printf("!!!!!!!!!!!!!!!ERROR! ,Line:%d File:%s Fun:%s\n",__LINE__,__FILE__,__FUNCTION__);
|
||||||
|
|
||||||
#define PRINT_CTRL_STOP 0
|
#define PRINT_CTRL_STOP 0
|
||||||
#define PRINT_CTRL_START 1
|
#define PRINT_CTRL_START 1
|
||||||
#define PRINT_CTRL_PAUSE 2
|
#define PRINT_CTRL_PAUSE 2
|
||||||
#define PRINT_CTRL_DAC_DISABLE 3
|
#define PRINT_CTRL_DAC_DISABLE 3
|
||||||
#define PRINT_CTRL_DAC_ENABLE 4
|
#define PRINT_CTRL_DAC_ENABLE 4
|
||||||
#define PRINT_CTRL_STOPSYNCNT 5
|
#define PRINT_CTRL_STOPSYNCNT 5
|
||||||
|
|
||||||
|
|
||||||
#define MAX_FPGA_DAC_VALUE_FOR_NEW ((1<<12)*95/100) //由于硬件原因,当DAC大于一定值后,电压不再变化,所以做一下限制
|
#define MAX_FPGA_DAC_VALUE_FOR_NEW ((1<<12)*95/100) //由于硬件原因,当DAC大于一定值后,电压不再变化,所以做一下限制
|
||||||
#define MAX_FPGA_DAC_VALUE_FOR_V1 (255) //老板子的最大值到256
|
#define MAX_FPGA_DAC_VALUE_FOR_V1 (255) //老板子的最大值到256
|
||||||
//#define MAX_FPGA_DAC_VALUE ((PRODUCT_VERSION(sysPara->status.fpgaVersionNum) == JETV1)?MAX_FPGA_DAC_VALUE_FOR_V1:MAX_FPGA_DAC_VALUE_FOR_NEW)
|
//#define MAX_FPGA_DAC_VALUE ((PRODUCT_VERSION(sysPara->status.fpgaVersionNum) == JETV1)?MAX_FPGA_DAC_VALUE_FOR_V1:MAX_FPGA_DAC_VALUE_FOR_NEW)
|
||||||
#define MAX_FPGA_DAC_VALUE MAX_FPGA_DAC_VALUE_FOR_NEW
|
#define MAX_FPGA_DAC_VALUE MAX_FPGA_DAC_VALUE_FOR_NEW
|
||||||
|
|
||||||
#define MAX_POINT_DISTANCE_ADJUST_VAL (1<<10) //点距微调的最大值
|
#define MAX_POINT_DISTANCE_ADJUST_VAL (1<<10) //点距微调的最大值
|
||||||
|
|
||||||
#define MAX_MOTOR_RUN_CURRENT 600
|
#define MAX_MOTOR_RUN_CURRENT 600
|
||||||
#define MIN_MOTOR_RUN_CURRENT 80
|
#define MIN_MOTOR_RUN_CURRENT 80
|
||||||
|
|
||||||
#define MAX_RECLAIM_BLOCK_CNT 5 //500ms
|
#define MAX_RECLAIM_BLOCK_CNT 5 //500ms
|
||||||
|
|
||||||
#define MAX_RELEASE_VALVE_DELAY_CNT 4
|
#define MAX_RELEASE_VALVE_DELAY_CNT 4
|
||||||
/*所有警告都是高电平警告*/
|
/*所有警告都是高电平警告*/
|
||||||
#define WARN_STATUS_INK_SWINT (1<<7) /*墨线开头,来自喷头,必须开的时候才能打印,关的时候为1,开的时候为0*/
|
#define WARN_STATUS_INK_SWINT (1<<7) /*墨线开头,来自喷头,必须开的时候才能打印,关的时候为1,开的时候为0*/
|
||||||
#define WARN_STATUS_POWER_MON (1<<6) //高压报警
|
#define WARN_STATUS_POWER_MON (1<<6) //高压报警
|
||||||
#define WARN_STATUS_RECYCLE_FAULT (1<<5) //高电平表示有故障
|
#define WARN_STATUS_RECYCLE_FAULT (1<<5) //高电平表示有故障
|
||||||
#define WARN_STATUS_INK_WARN (1<<4)
|
#define WARN_STATUS_INK_WARN (1<<4)
|
||||||
#define WARN_STATUS_SOLV_WARN (1<<3)
|
#define WARN_STATUS_SOLV_WARN (1<<3)
|
||||||
#define WARN_STATUS_SUMP_WARN (1<<2) //墨水渗漏
|
#define WARN_STATUS_SUMP_WARN (1<<2) //墨水渗漏
|
||||||
#define WARN_STATUS_HDINT (1<<1) /*喷头盖,盖上为0,否则为1,必须盖上才能打印,电磁铁有正反面*/
|
#define WARN_STATUS_HDINT (1<<1) /*喷头盖,盖上为0,否则为1,必须盖上才能打印,电磁铁有正反面*/
|
||||||
#define WARN_STATUS_VISCOTITY_MEASURE_READY (1<<0) // 球已经到上位等灯
|
#define WARN_STATUS_VISCOTITY_MEASURE_READY (1<<0) // 球已经到上位等灯
|
||||||
|
|
||||||
|
|
||||||
#define FPGA_SYS_HZ 100000000
|
#define FPGA_SYS_HZ 100000000
|
||||||
|
|
||||||
#define MAX_WR_MEM_SIZE (1<<16) //写空间最大地址范围
|
#define MAX_WR_MEM_SIZE (1<<16) //写空间最大地址范围
|
||||||
#define MAX_WR_MEM_SIZE_MASK (MAX_WR_MEM_SIZE - 1)
|
#define MAX_WR_MEM_SIZE_MASK (MAX_WR_MEM_SIZE - 1)
|
||||||
#define MAX_RD_MEM_SIZE (1<<9) //读空间最大地址范围
|
#define MAX_RD_MEM_SIZE (1<<9) //读空间最大地址范围
|
||||||
#define MAX_RD_MEM_SIZE_MASK (MAX_RD_MEM_SIZE - 1)
|
#define MAX_RD_MEM_SIZE_MASK (MAX_RD_MEM_SIZE - 1)
|
||||||
|
|
||||||
/* am335x core board control pwm output */
|
/* am335x core board control pwm output */
|
||||||
#define VISCO_PUMP_REQUEST "echo 1 > /sys/class/pwm/ecap.2/request"
|
#define VISCO_PUMP_REQUEST "echo 1 > /sys/class/pwm/ecap.2/request"
|
||||||
#define VISCO_PUMP_RELEASE "echo 0 > /sys/class/pwm/ecap.2/request"
|
#define VISCO_PUMP_RELEASE "echo 0 > /sys/class/pwm/ecap.2/request"
|
||||||
#define VISCO_PUMP_RUN "echo 1 > /sys/class/pwm/ecap.2/run"
|
#define VISCO_PUMP_RUN "echo 1 > /sys/class/pwm/ecap.2/run"
|
||||||
#define VISCO_PUMP_STOP "echo 0 > /sys/class/pwm/ecap.2/run"
|
#define VISCO_PUMP_STOP "echo 0 > /sys/class/pwm/ecap.2/run"
|
||||||
#define VISCO_PUMP_50Hz "echo 50 > /sys/class/pwm/ecap.2/period_freq"
|
#define VISCO_PUMP_50Hz "echo 50 > /sys/class/pwm/ecap.2/period_freq"
|
||||||
#define VISCO_PUMP_50P "echo 50 > /sys/class/pwm/ecap.2/duty_percent"
|
#define VISCO_PUMP_50P "echo 50 > /sys/class/pwm/ecap.2/duty_percent"
|
||||||
#define VISCO_PUMP_HIGH "echo 1 > /sys/class/pwm/ecap.2/polarity"
|
#define VISCO_PUMP_HIGH "echo 1 > /sys/class/pwm/ecap.2/polarity"
|
||||||
#define VISCO_PUMP_LOW "echo 0 > /sys/class/pwm/ecap.2/polarity"
|
#define VISCO_PUMP_LOW "echo 0 > /sys/class/pwm/ecap.2/polarity"
|
||||||
|
|
||||||
#define SUCTION_PUMP_REQUEST "echo 1 > /sys/class/pwm/ehrpwm.0:1/request"
|
#define SUCTION_PUMP_REQUEST "echo 1 > /sys/class/pwm/ehrpwm.0:1/request"
|
||||||
#define SUCTION_PUMP_RELEASE "echo 0 > /sys/class/pwm/ehrpwm.0:1/request"
|
#define SUCTION_PUMP_RELEASE "echo 0 > /sys/class/pwm/ehrpwm.0:1/request"
|
||||||
#define SUCTION_PUMP_RUN "echo 1 > /sys/class/pwm/ehrpwm.0:1/run"
|
#define SUCTION_PUMP_RUN "echo 1 > /sys/class/pwm/ehrpwm.0:1/run"
|
||||||
#define SUCTION_PUMP_STOP "echo 0 > /sys/class/pwm/ehrpwm.0:1/run"
|
#define SUCTION_PUMP_STOP "echo 0 > /sys/class/pwm/ehrpwm.0:1/run"
|
||||||
#define SUCTION_PUMP_HIGH "echo 1 > /sys/class/pwm/ehrpwm.0:1/polarity"
|
#define SUCTION_PUMP_HIGH "echo 1 > /sys/class/pwm/ehrpwm.0:1/polarity"
|
||||||
#define SUCTION_PUMP_LOW "echo 0 > /sys/class/pwm/ehrpwm.0:1/polarity"
|
#define SUCTION_PUMP_LOW "echo 0 > /sys/class/pwm/ehrpwm.0:1/polarity"
|
||||||
#define SUCTION_PUMP_90P "echo 90 > /sys/class/pwm/ehrpwm.0:1/duty_percent"
|
#define SUCTION_PUMP_90P "echo 90 > /sys/class/pwm/ehrpwm.0:1/duty_percent"
|
||||||
#define SUCTION_PUMP_12000Hz "echo 12000 > /sys/class/pwm/ehrpwm.0:1/period_freq"
|
#define SUCTION_PUMP_12000Hz "echo 12000 > /sys/class/pwm/ehrpwm.0:1/period_freq"
|
||||||
|
|
||||||
#define PRINT_CTRL_ADDR_BASE 0xa400
|
#define PRINT_CTRL_ADDR_BASE 0xa400
|
||||||
|
|
||||||
#define PRINT_DIGITAL_CHAR_BASE_ADDR (0xe000)
|
#define PRINT_DIGITAL_CHAR_BASE_ADDR (0xe000)
|
||||||
|
|
||||||
#define WRITE_CALENDAR_DAT_ADDR (0xb100)
|
#define WRITE_CALENDAR_DAT_ADDR (0xb100)
|
||||||
|
|
||||||
#define RECYCLE_SLOT_STOP 0x1
|
#define RECYCLE_SLOT_STOP 0x1
|
||||||
#define RECYCLE_SLOT_CLOSE 0x2
|
#define RECYCLE_SLOT_CLOSE 0x2
|
||||||
#define RECYCLE_SLOT_OPEN 0x0
|
#define RECYCLE_SLOT_OPEN 0x0
|
||||||
#define PRINT_START_STOP_CTRL (PRINT_CTRL_ADDR_BASE + 0x40)
|
#define PRINT_START_STOP_CTRL (PRINT_CTRL_ADDR_BASE + 0x40)
|
||||||
#define PRINT_RESET_PRODUCT_CNT (PRINT_CTRL_ADDR_BASE + 0x41)
|
#define PRINT_RESET_PRODUCT_CNT (PRINT_CTRL_ADDR_BASE + 0x41)
|
||||||
#define RECYCLE_SLOT_CTRL_ADDR (PRINT_CTRL_ADDR_BASE + 0x42)
|
#define RECYCLE_SLOT_CTRL_ADDR (PRINT_CTRL_ADDR_BASE + 0x42)
|
||||||
#define RESUME_FAULT_ADDR (PRINT_CTRL_ADDR_BASE + 0x43)
|
#define RESUME_FAULT_ADDR (PRINT_CTRL_ADDR_BASE + 0x43)
|
||||||
|
|
||||||
#define VAR_CNT_ADDR (PRINT_CTRL_ADDR_BASE + 0x50)
|
#define VAR_CNT_ADDR (PRINT_CTRL_ADDR_BASE + 0x50)
|
||||||
#define VAR_CTRL_REG_ADDR (PRINT_CTRL_ADDR_BASE + 0x51)
|
#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 + 0x59)
|
||||||
//#define MAININKCTRL_ADDR (PRINT_CTRL_ADDR_BASE + 0x5a)
|
//#define MAININKCTRL_ADDR (PRINT_CTRL_ADDR_BASE + 0x5a)
|
||||||
#define WRITE_CNT1GROUP_COUNT 0xB13E
|
#define WRITE_CNT1GROUP_COUNT 0xB13E
|
||||||
#define WRITE_CNT1GROUP_NUM 0xB13F
|
#define WRITE_CNT1GROUP_NUM 0xB13F
|
||||||
#define WRITE_CNT1GROUP_SETTING 0xB140
|
#define WRITE_CNT1GROUP_SETTING 0xB140
|
||||||
#define READ_CNT1GROUP_CURR_LOOP 0x0190
|
#define READ_CNT1GROUP_CURR_LOOP 0x0190
|
||||||
#define READ_CNT1GROUP_CURR_INDEX 0x0194
|
#define READ_CNT1GROUP_CURR_INDEX 0x0194
|
||||||
|
|
||||||
#define WRITE_CNT2GROUP_COUNT 0xB16E
|
#define WRITE_CNT2GROUP_COUNT 0xB16E
|
||||||
#define WRITE_CNT2GROUP_NUM 0xB16F
|
#define WRITE_CNT2GROUP_NUM 0xB16F
|
||||||
#define WRITE_CNT2GROUP_SETTING 0xB170
|
#define WRITE_CNT2GROUP_SETTING 0xB170
|
||||||
#define READ_CNT2GROUP_CURR_LOOP 0x0195
|
#define READ_CNT2GROUP_CURR_LOOP 0x0195
|
||||||
#define READ_CNT2GROUP_CURR_INDEX 0x0199
|
#define READ_CNT2GROUP_CURR_INDEX 0x0199
|
||||||
|
|
||||||
#define FPGA_STATUS_BASE_ADDR 0x0000
|
#define FPGA_STATUS_BASE_ADDR 0x0000
|
||||||
#define FPGA_VERSOIN_NUM (FPGA_STATUS_BASE_ADDR + 0xfe)
|
#define FPGA_VERSOIN_NUM (FPGA_STATUS_BASE_ADDR + 0xfe)
|
||||||
|
|
||||||
|
|
||||||
#define READ_BUILD_DAT (FPGA_STATUS_BASE_ADDR + 0xf0)
|
#define READ_BUILD_DAT (FPGA_STATUS_BASE_ADDR + 0xf0)
|
||||||
|
|
||||||
#define READ_PRINTDATA_XOR (FPGA_STATUS_BASE_ADDR + 0xf2)
|
#define READ_PRINTDATA_XOR (FPGA_STATUS_BASE_ADDR + 0xf2)
|
||||||
#define READ_SYNC_COUNTER (FPGA_STATUS_BASE_ADDR + 0xf4)
|
#define READ_SYNC_COUNTER (FPGA_STATUS_BASE_ADDR + 0xf4)
|
||||||
|
|
||||||
#define PHASE_DETECT_HIGH_VOLTAGE_TM 0x100
|
#define PHASE_DETECT_HIGH_VOLTAGE_TM 0x100
|
||||||
#define READ_CALENDAR_DAT_ADDR 0x180
|
#define READ_CALENDAR_DAT_ADDR 0x180
|
||||||
|
|
||||||
#define READ_RAND_FIFO_ADDR 0x200 // 读FPGA的随机码FIFO
|
#define READ_RAND_FIFO_ADDR 0x200 // 读FPGA的随机码FIFO
|
||||||
|
|
||||||
#define ROW_PRINT_SEQNENCE_ADDR 0xb200 //行扫描顺序
|
#define ROW_PRINT_SEQNENCE_ADDR 0xb200 //行扫描顺序
|
||||||
#define DAC_TABLE_ADDR 0xb280 //每一个行点对应的DAC值
|
#define DAC_TABLE_ADDR 0xb280 //每一个行点对应的DAC值
|
||||||
#define NOT_GAP_DAC_TABLE_ADDR 0xb380 //每一个不隔点对应的DAC值
|
#define NOT_GAP_DAC_TABLE_ADDR 0xb380 //每一个不隔点对应的DAC值
|
||||||
#define FULL_COL_DAC_TABLE_ADDR 0xb480 //每一个不隔点对应的DAC值
|
#define FULL_COL_DAC_TABLE_ADDR 0xb480 //每一个不隔点对应的DAC值
|
||||||
|
|
||||||
#define MATCH_FULL_DAC_TABLE_ADDR 0xB500 // 匹配满列 DAC表 起始地址
|
#define MATCH_FULL_DAC_TABLE_ADDR 0xB500 // 匹配满列 DAC表 起始地址
|
||||||
#define MATCH_1_DAC_TABLE_ADDR 0xB600 // 匹配单点 DAC表 起始地址
|
#define MATCH_1_DAC_TABLE_ADDR 0xB600 // 匹配单点 DAC表 起始地址
|
||||||
#define MATCH_2_DAC_TABLE_ADDR 0xB700 // 匹配两点 DAC表 起始地址
|
#define MATCH_2_DAC_TABLE_ADDR 0xB700 // 匹配两点 DAC表 起始地址
|
||||||
#define MATCH_3_DAC_TABLE_ADDR 0xB800 // 匹配三点 DAC表 起始地址
|
#define MATCH_3_DAC_TABLE_ADDR 0xB800 // 匹配三点 DAC表 起始地址
|
||||||
#define MATCH_4_DAC_TABLE_ADDR 0xB900 // 匹配四点 DAC表 起始地址
|
#define MATCH_4_DAC_TABLE_ADDR 0xB900 // 匹配四点 DAC表 起始地址
|
||||||
#define MATCH_5_DAC_TABLE_ADDR 0xBA00 // 匹配五点 DAC表 起始地址
|
#define MATCH_5_DAC_TABLE_ADDR 0xBA00 // 匹配五点 DAC表 起始地址
|
||||||
#define MATCH_G1_DAC_TABLE_ADDR 0xBC00 // 匹配空一点 DAC表 起始地址
|
#define MATCH_G1_DAC_TABLE_ADDR 0xBC00 // 匹配空一点 DAC表 起始地址
|
||||||
#define MATCH_G2_DAC_TABLE_ADDR 0xBC80 // 匹配空两点 DAC表 起始地址
|
#define MATCH_G2_DAC_TABLE_ADDR 0xBC80 // 匹配空两点 DAC表 起始地址
|
||||||
#define MATCH_G3_DAC_TABLE_ADDR 0xBD00 // 匹配空三点 DAC表 起始地址
|
#define MATCH_G3_DAC_TABLE_ADDR 0xBD00 // 匹配空三点 DAC表 起始地址
|
||||||
#define MATCH_G4_DAC_TABLE_ADDR 0xBD80 // 匹配空四点 DAC表 起始地址
|
#define MATCH_G4_DAC_TABLE_ADDR 0xBD80 // 匹配空四点 DAC表 起始地址
|
||||||
#define MATCH_G5_DAC_TABLE_ADDR 0xBE00 // 匹配空五点 DAC表 起始地址
|
#define MATCH_G5_DAC_TABLE_ADDR 0xBE00 // 匹配空五点 DAC表 起始地址
|
||||||
#define MATCH_G6_DAC_TABLE_ADDR 0xBE80 // 匹配空六点 DAC表 起始地址
|
#define MATCH_G6_DAC_TABLE_ADDR 0xBE80 // 匹配空六点 DAC表 起始地址
|
||||||
#define MATCH_P1_DAC_TABLE_ADDR 0xBF00 // 匹配预备一 DAC表 起始地址
|
#define MATCH_P1_DAC_TABLE_ADDR 0xBF00 // 匹配预备一 DAC表 起始地址
|
||||||
#define MATCH_P2_DAC_TABLE_ADDR 0xBF80 // 匹配预备二 DAC表 起始地址
|
#define MATCH_P2_DAC_TABLE_ADDR 0xBF80 // 匹配预备二 DAC表 起始地址
|
||||||
#define MATCH_C_DAC_TABLE_ADDR 0xC000 // 匹配复杂 DAC表 起始地址
|
#define MATCH_C_DAC_TABLE_ADDR 0xC000 // 匹配复杂 DAC表 起始地址
|
||||||
|
|
||||||
#define WRITE_COUNTER3_ADDR (0xb150)
|
#define WRITE_COUNTER3_ADDR (0xb150)
|
||||||
#define WRITE_COUNTER4_ADDR (0xb164)
|
#define WRITE_COUNTER4_ADDR (0xb164)
|
||||||
//#define READ_CNT3_CURVALUE_ADDR 0x01b4
|
//#define READ_CNT3_CURVALUE_ADDR 0x01b4
|
||||||
#define READ_CNT3_CURVALUE_ADDR 0x1834
|
#define READ_CNT3_CURVALUE_ADDR 0x1834
|
||||||
|
|
||||||
#define LOCADDR '1'
|
#define LOCADDR '1'
|
||||||
|
|
||||||
//#define NOLEDLIGHT 0x10
|
//#define NOLEDLIGHT 0x10
|
||||||
//#define REDLIGHTCODE 0X11
|
//#define REDLIGHTCODE 0X11
|
||||||
//#define YELLOWLIGHTCODE 0X13
|
//#define YELLOWLIGHTCODE 0X13
|
||||||
//#define GREENLIGHTCODE 0X12
|
//#define GREENLIGHTCODE 0X12
|
||||||
// 高四位:颜色
|
// 高四位:颜色
|
||||||
#define LED_COLOR_NONE 0x00 // 0000 0000
|
#define LED_COLOR_NONE 0x00 // 0000 0000
|
||||||
#define LED_COLOR_YELLOW 0x10 // 0001 0000
|
#define LED_COLOR_YELLOW 0x10 // 0001 0000
|
||||||
#define LED_COLOR_GREEN 0x20 // 0010 0000
|
#define LED_COLOR_GREEN 0x20 // 0010 0000
|
||||||
#define LED_COLOR_RED 0x30 // 0011 0000
|
#define LED_COLOR_RED 0x30 // 0011 0000
|
||||||
// 低四位:操作
|
// 低四位:操作
|
||||||
#define LED_OP_OFF 0x00 // 灭
|
#define LED_OP_OFF 0x00 // 灭
|
||||||
#define LED_OP_ON 0x01 // 亮
|
#define LED_OP_ON 0x01 // 亮
|
||||||
#define LED_OP_FLASH 0x02 // 闪烁
|
#define LED_OP_FLASH 0x02 // 闪烁
|
||||||
|
|
||||||
//绿灯
|
//绿灯
|
||||||
#define LED_COLOR_GREEN_ON LED_COLOR_GREEN|LED_OP_ON //绿灯亮
|
#define LED_COLOR_GREEN_ON LED_COLOR_GREEN|LED_OP_ON //绿灯亮
|
||||||
#define LED_COLOR_GREEN_OFF LED_COLOR_GREEN|LED_OP_OFF //绿灯灭
|
#define LED_COLOR_GREEN_OFF LED_COLOR_GREEN|LED_OP_OFF //绿灯灭
|
||||||
#define LED_COLOR_GREEN_FLASH LED_COLOR_GREEN|LED_OP_FLASH //绿灯闪烁
|
#define LED_COLOR_GREEN_FLASH LED_COLOR_GREEN|LED_OP_FLASH //绿灯闪烁
|
||||||
//红灯
|
//红灯
|
||||||
#define LED_COLOR_RED_ON LED_COLOR_RED|LED_OP_ON //红灯亮
|
#define LED_COLOR_RED_ON LED_COLOR_RED|LED_OP_ON //红灯亮
|
||||||
#define LED_COLOR_RED_OFF LED_COLOR_RED|LED_OP_OFF //红灯灭
|
#define LED_COLOR_RED_OFF LED_COLOR_RED|LED_OP_OFF //红灯灭
|
||||||
#define LED_COLOR_RED_FLASH LED_COLOR_RED|LED_OP_FLASH //红灯闪烁
|
#define LED_COLOR_RED_FLASH LED_COLOR_RED|LED_OP_FLASH //红灯闪烁
|
||||||
//黄灯
|
//黄灯
|
||||||
#define LED_COLOR_YELLOW_ON LED_COLOR_YELLOW|LED_OP_ON //黄灯亮
|
#define LED_COLOR_YELLOW_ON LED_COLOR_YELLOW|LED_OP_ON //黄灯亮
|
||||||
#define LED_COLOR_YELLOW_OFF LED_COLOR_YELLOW|LED_OP_OFF //黄灯灭
|
#define LED_COLOR_YELLOW_OFF LED_COLOR_YELLOW|LED_OP_OFF //黄灯灭
|
||||||
#define LED_COLOR_YELLOW_FLASH LED_COLOR_YELLOW|LED_OP_FLASH //黄灯闪烁
|
#define LED_COLOR_YELLOW_FLASH LED_COLOR_YELLOW|LED_OP_FLASH //黄灯闪烁
|
||||||
|
|
||||||
#define LED_ALL_OFF 0x00 //关闭所有灯
|
#define LED_ALL_OFF 0x00 //关闭所有灯
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 请不要直接初始化此函数,如果需要,请通过SysPara的devOP来访问此类
|
* 请不要直接初始化此函数,如果需要,请通过SysPara的devOP来访问此类
|
||||||
* */
|
* */
|
||||||
class DevOp : public QObject
|
class DevOp : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public :
|
public :
|
||||||
DevOp(SysPara * sysPara);
|
DevOp(SysPara * sysPara);
|
||||||
~DevOp();
|
~DevOp();
|
||||||
|
|
||||||
void set_totalSynPulseNum(bool wren);// 设置可变长度
|
void set_totalSynPulseNum(bool wren);// 设置可变长度
|
||||||
void WriteMoterPump();
|
void WriteMoterPump();
|
||||||
void controlReleaseValve(bool openFlag);
|
void controlReleaseValve(bool openFlag);
|
||||||
void controlMixValve(bool openFlag);
|
void controlMixValve(bool openFlag);
|
||||||
void controlInkValve(bool openFlag); //控制墨线,即供墨阀
|
void controlInkValve(bool openFlag); //控制墨线,即供墨阀
|
||||||
void controlInkValvePWMSTM32(int PWMPulse);
|
void controlInkValvePWMSTM32(int PWMPulse);
|
||||||
void controlCycleValve(bool openFlag);
|
void controlCycleValve(bool openFlag);
|
||||||
void controlCompressPump(bool openFlag);
|
void controlCompressPump(bool openFlag);
|
||||||
void controlViscosityPump(bool openFlag);
|
void controlViscosityPump(bool openFlag);
|
||||||
void controlMainInkPump(bool openFlag);
|
void controlMainInkPump(bool openFlag);
|
||||||
void setHighVoltageAmplitudetoSTM32();
|
void setHighVoltageAmplitudetoSTM32();
|
||||||
void controlReclaimPump(bool openFlag,bool fullSpeed);
|
void controlReclaimPump(bool openFlag,bool fullSpeed);
|
||||||
void controlReclaimPump2();
|
void controlReclaimPump2();
|
||||||
void controlInkValvePWM(bool openFlag);
|
void controlInkValvePWM(bool openFlag);
|
||||||
void controlInkValvePWM2();
|
void controlInkValvePWM2();
|
||||||
void controlHeater(bool openFlag);
|
void controlHeater(bool openFlag);
|
||||||
void controlBeeper(bool openFlag);
|
void controlBeeper(bool openFlag);
|
||||||
|
|
||||||
void controlReclaimTankOpen(bool enableFlag);
|
void controlReclaimTankOpen(bool enableFlag);
|
||||||
void controlReclaimTankClose(bool enableFlag);
|
void controlReclaimTankClose(bool enableFlag);
|
||||||
|
|
||||||
void powerOff(void);
|
void powerOff(void);
|
||||||
|
|
||||||
bool isReleaseValveOpen();
|
bool isReleaseValveOpen();
|
||||||
bool isMixValveOpen();
|
bool isMixValveOpen();
|
||||||
bool isInkValveOpen();
|
bool isInkValveOpen();
|
||||||
bool isInkValveOpen1();
|
bool isInkValveOpen1();
|
||||||
bool isCycleValveOpen();
|
bool isCycleValveOpen();
|
||||||
bool isCompressPumpOpen();
|
bool isCompressPumpOpen();
|
||||||
bool isViscosityPumpOpen();
|
bool isViscosityPumpOpen();
|
||||||
bool isMainInkPumpOpen();
|
bool isMainInkPumpOpen();
|
||||||
bool isReclaimPumpOpen();
|
bool isReclaimPumpOpen();
|
||||||
bool isHighVoltageOpen();
|
bool isHighVoltageOpen();
|
||||||
|
|
||||||
bool isReclaimTankOpenEnable();
|
bool isReclaimTankOpenEnable();
|
||||||
bool isReclaimTankCloseEnable();
|
bool isReclaimTankCloseEnable();
|
||||||
bool isBeeperEnable();
|
bool isBeeperEnable();
|
||||||
bool isHearterEnable();
|
bool isHearterEnable();
|
||||||
|
|
||||||
int writeFpgaPrintPara(bool ignoreWarn = false);
|
int writeFpgaPrintPara(bool ignoreWarn = false);
|
||||||
void readFgaStatus(void);
|
void readFgaStatus(void);
|
||||||
void writeDacValue2Fpga_No73();
|
void writeDacValue2Fpga_No73();
|
||||||
|
|
||||||
void printCtrl(int cmd);
|
void printCtrl(int cmd);
|
||||||
void ReadCnt1GroupStatus(void);
|
void ReadCnt1GroupStatus(void);
|
||||||
void ReadCnt2GroupStatus(void);
|
void ReadCnt2GroupStatus(void);
|
||||||
void writeCnt1GroupSetting(bool bCntByGroupEnable);
|
void writeCnt1GroupSetting(bool bCntByGroupEnable);
|
||||||
void writeCnt2GroupSetting(bool bCntByGroupEnable);
|
void writeCnt2GroupSetting(bool bCntByGroupEnable);
|
||||||
void writeFpgaCalandar(bool Enable);
|
void writeFpgaCalandar(bool Enable);
|
||||||
void writeFpgaVariCtrl();
|
void writeFpgaVariCtrl();
|
||||||
void readCalandarDat();
|
void readCalandarDat();
|
||||||
void resumeFault();
|
void resumeFault();
|
||||||
void highVoltageCtrl(int val);
|
void highVoltageCtrl(int val);
|
||||||
void maxHighVoltageDACCtrl(int val);
|
void maxHighVoltageDACCtrl(int val);
|
||||||
void setPhaseByHand(int val);
|
void setPhaseByHand(int val);
|
||||||
void readPhaseDetectHighTm();
|
void readPhaseDetectHighTm();
|
||||||
void setPhaseDetectVoltageDutyCycle(int duty);
|
void setPhaseDetectVoltageDutyCycle(int duty);
|
||||||
void setBlickLightPeriod(int value);
|
void setBlickLightPeriod(int value);
|
||||||
void setOscillatorVoltage(int value);
|
void setOscillatorVoltage(int value);
|
||||||
void setDivideRatio(int value);
|
void setDivideRatio(int value);
|
||||||
void setLastLineEndPointFixedValue(int value);
|
void setLastLineEndPointFixedValue(int value);
|
||||||
|
|
||||||
void mainInkCtrl();
|
void mainInkCtrl();
|
||||||
void pumpValveCtrl(int viscosityAdjustByTemp=0);
|
void pumpValveCtrl(int viscosityAdjustByTemp=0);
|
||||||
void clearProductCnt(unsigned int mode);
|
void clearProductCnt(unsigned int mode);
|
||||||
unsigned int readFpgaVersionNum(void);
|
unsigned int readFpgaVersionNum(void);
|
||||||
void fpgaWr(int addr,unsigned char*dat,int len);
|
void fpgaWr(int addr,unsigned char*dat,int len);
|
||||||
void fpgaRd(int addr,unsigned char*dat,int len);
|
void fpgaRd(int addr,unsigned char*dat,int len);
|
||||||
void fpgaWrD(int addr,unsigned int dat,int len);
|
void fpgaWrD(int addr,unsigned int dat,int len);
|
||||||
void fpgaWrD2(int addr,unsigned char*dat,int len);
|
void fpgaWrD2(int addr,unsigned char*dat,int len);
|
||||||
void fpgaResetWarning(char mode);
|
void fpgaResetWarning(char mode);
|
||||||
void sendSTM32SetPowerOnTimer(quint16);
|
void sendSTM32SetPowerOnTimer(quint16);
|
||||||
void DACValueWithVoltageAdj();
|
void DACValueWithVoltageAdj();
|
||||||
void writeDataToFpga_No67HighSpeedMode(Voltage_Version version,bool flag);
|
void writeDataToFpga_No67HighSpeedMode(Voltage_Version version,bool flag);
|
||||||
bool fpgaDevOpenFlag;
|
bool fpgaDevOpenFlag;
|
||||||
|
|
||||||
void stm32Rd(int addr,unsigned char*dat,int len);
|
void stm32Rd(int addr,unsigned char*dat,int len);
|
||||||
void stm32Wr(int addr,unsigned char*dat,int len);
|
void stm32Wr(int addr,unsigned char*dat,int len);
|
||||||
|
|
||||||
unsigned char memWrMap[MAX_WR_MEM_SIZE];
|
unsigned char memWrMap[MAX_WR_MEM_SIZE];
|
||||||
unsigned char memRdMap[MAX_RD_MEM_SIZE];
|
unsigned char memRdMap[MAX_RD_MEM_SIZE];
|
||||||
unsigned char color_flag;
|
unsigned char color_flag;
|
||||||
void controlRedLight(bool openFlag);
|
void controlRedLight(bool openFlag);
|
||||||
void controlGreenLight(bool openFlag);
|
void controlGreenLight(bool openFlag);
|
||||||
void controlYellowLight(bool openFlag);
|
void controlYellowLight(bool openFlag);
|
||||||
void controlFan1(bool openFlag);
|
void controlFan1(bool openFlag);
|
||||||
void controlFan2(bool openFlag);
|
void controlFan2(bool openFlag);
|
||||||
|
|
||||||
bool isGreenLightEnable();
|
bool isGreenLightEnable();
|
||||||
bool isYellowLightEnable();
|
bool isYellowLightEnable();
|
||||||
bool isRedLightEnable();
|
bool isRedLightEnable();
|
||||||
void readbuilDat();
|
void readbuilDat();
|
||||||
void readPrintDataXor();
|
void readPrintDataXor();
|
||||||
void readSyncCounterAtZero();
|
void readSyncCounterAtZero();
|
||||||
void printCtrl2(int cmd);
|
void printCtrl2(int cmd);
|
||||||
void ReadSomeDataForLostPrint(void);
|
void ReadSomeDataForLostPrint(void);
|
||||||
void readSTM32Version(void);
|
void readSTM32Version(void);
|
||||||
void readSTM32Time(void);
|
void readSTM32Time(void);
|
||||||
bool stopSendDataFPGA;
|
bool stopSendDataFPGA;
|
||||||
bool stopSendDataSTM32;
|
bool stopSendDataSTM32;
|
||||||
|
|
||||||
void Read_RanddomFromFpga(); // 读FPGARANDFIFO
|
void Read_RanddomFromFpga(); // 读FPGARANDFIFO
|
||||||
void RandTxtBakup(char ok);
|
void RandTxtBakup(char ok);
|
||||||
void showData(QByteArray dat);
|
void showData(QByteArray dat);
|
||||||
void writeDacValue2Fpga_No72NewVoltData();
|
void writeDacValue2Fpga_No72NewVoltData();
|
||||||
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void resendFPGADate(int,int,unsigned char *,int,int);
|
void resendFPGADate(int,int,unsigned char *,int,int);
|
||||||
void resendSTM32Date(int,int,unsigned char *,int,int);
|
void resendSTM32Date(int,int,unsigned char *,int,int);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void dataReceived(char,const QByteArray &dataReceived,int);
|
void dataReceived(char,const QByteArray &dataReceived,int);
|
||||||
/***cmd:1--读 2--写*********************************************/
|
/***cmd:1--读 2--写*********************************************/
|
||||||
/***addr:地址***************************************************/
|
/***addr:地址***************************************************/
|
||||||
/***dat:数据指针*************************************************/
|
/***dat:数据指针*************************************************/
|
||||||
/***len:数据长度*************************************************/
|
/***len:数据长度*************************************************/
|
||||||
/***type:1--FPGA 2--STM32***************************************/
|
/***type:1--FPGA 2--STM32***************************************/
|
||||||
void sendSerialDataToSTM32(int cmd,int addr,unsigned char *dat,int len,int type);
|
void sendSerialDataToSTM32(int cmd,int addr,unsigned char *dat,int len,int type);
|
||||||
void sendSerialDataToFPGA(int cmd,int addr,unsigned char *dat,int len,int type);
|
void sendSerialDataToFPGA(int cmd,int addr,unsigned char *dat,int len,int type);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int WdgttyUsb0Cnt;
|
int WdgttyUsb0Cnt;
|
||||||
bool releaseValveOpenFlag;
|
bool releaseValveOpenFlag;
|
||||||
bool mixValveFlag;
|
bool mixValveFlag;
|
||||||
bool inkValveOpenFlag;
|
bool inkValveOpenFlag;
|
||||||
bool inkValveOpenFlag1;
|
bool inkValveOpenFlag1;
|
||||||
bool cycleValveOpenFlag;
|
bool cycleValveOpenFlag;
|
||||||
bool compressPumpOpenFlag;
|
bool compressPumpOpenFlag;
|
||||||
bool viscosityPumpOpenFlag;
|
bool viscosityPumpOpenFlag;
|
||||||
bool mainInkPumpOpenFlag;
|
bool mainInkPumpOpenFlag;
|
||||||
bool reclaimPumpOpenFlag;
|
bool reclaimPumpOpenFlag;
|
||||||
bool highVoltageOpenFlag;
|
bool highVoltageOpenFlag;
|
||||||
|
|
||||||
bool reclaimTankOpenEnableFlag;
|
bool reclaimTankOpenEnableFlag;
|
||||||
bool reclaimTankCloseEnableFlag;
|
bool reclaimTankCloseEnableFlag;
|
||||||
bool beeperOnFlag;
|
bool beeperOnFlag;
|
||||||
|
|
||||||
bool RedLightOnFlag;
|
bool RedLightOnFlag;
|
||||||
bool GreenLightOnFlag;
|
bool GreenLightOnFlag;
|
||||||
bool YellowLightOnFlag;
|
bool YellowLightOnFlag;
|
||||||
|
|
||||||
bool heaterOnFlag;
|
bool heaterOnFlag;
|
||||||
int com2;
|
int com2;
|
||||||
int pwm_sp;
|
int pwm_sp;
|
||||||
int pwm_fd;
|
int pwm_fd;
|
||||||
int Interrupt_fd;
|
int Interrupt_fd;
|
||||||
int iocontrl;
|
int iocontrl;
|
||||||
int DAdataout;
|
int DAdataout;
|
||||||
int pwm_ink;
|
int pwm_ink;
|
||||||
int adc_fd;
|
int adc_fd;
|
||||||
qint8 OscillatorVoltage[100];//VX 电路不一样,所以需要重新调整
|
qint8 OscillatorVoltage[100];//VX 电路不一样,所以需要重新调整
|
||||||
SysPara *sysPara;
|
SysPara *sysPara;
|
||||||
|
|
||||||
|
|
||||||
unsigned int fpgaRdD(int addr,int len);
|
unsigned int fpgaRdD(int addr,int len);
|
||||||
|
|
||||||
// 0xA451--- 为什么ARM的顺序相反呢?
|
// 0xA451--- 为什么ARM的顺序相反呢?
|
||||||
typedef struct {
|
typedef struct {
|
||||||
unsigned int varDigitalNum:4; // 数字的个数
|
unsigned int varDigitalNum:4; // 数字的个数
|
||||||
unsigned int charRamBaseAddr:12; // 基址
|
unsigned int charRamBaseAddr:12; // 基址
|
||||||
unsigned int colOffset:16; // 列偏移
|
unsigned int colOffset:16; // 列偏移
|
||||||
unsigned int horizonWidth:9;//字模宽度
|
unsigned int horizonWidth:9;//字模宽度
|
||||||
unsigned int verticalOffset:6; // 行偏移
|
unsigned int verticalOffset:6; // 行偏移
|
||||||
unsigned int charRowNum:6; // 每个字符占行个数
|
unsigned int charRowNum:6; // 每个字符占行个数
|
||||||
unsigned int charColNum:6; // 每个字符占列个数
|
unsigned int charColNum:6; // 每个字符占列个数
|
||||||
unsigned int varTypeSel:4;
|
unsigned int varTypeSel:4;
|
||||||
unsigned int dummy:1;
|
unsigned int dummy:1;
|
||||||
}reg_var_print_ctrl_t;
|
}reg_var_print_ctrl_t;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* DEVOP_H_ */
|
#endif /* DEVOP_H_ */
|
||||||
|
|||||||
@@ -1,380 +0,0 @@
|
|||||||
/*
|
|
||||||
* DevOp.h
|
|
||||||
*
|
|
||||||
* Created on: Jun 25, 2013
|
|
||||||
* Author: yiyu
|
|
||||||
* QQ:1036184468
|
|
||||||
* Descriptoin:
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef DEVOP_H_
|
|
||||||
#define DEVOP_H_
|
|
||||||
|
|
||||||
#define JETV1 1
|
|
||||||
#define JETV2 2
|
|
||||||
#define JETV3 3 // EP3C10F144
|
|
||||||
#define JETV23 4 // V5,V4主板编号均为4; V6没有正式投入使用
|
|
||||||
#define JETV7 7 // EP4CE15F144, ARM 335X
|
|
||||||
#define PRODUCT_VERSION(ver) ((ver>>13) & 0x7)
|
|
||||||
|
|
||||||
class SysPara;
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <QString>
|
|
||||||
#include "myinclude.h"
|
|
||||||
#include <QObject>
|
|
||||||
#include <QQueue>
|
|
||||||
#include <QMetaType>
|
|
||||||
#include <QThread>
|
|
||||||
#include <QMutex>
|
|
||||||
#include <QReadWriteLock>
|
|
||||||
|
|
||||||
#ifdef UART2
|
|
||||||
#include "posix_qextserialport.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define DisTraceMsg() printf("###############TRACE,Line:%d File:%s Fun:%s\n",__LINE__,__FILE__,__FUNCTION__);
|
|
||||||
#define DisWarnmsg() printf("~~~~~~~~~~~~~~~WARN,Line:%d File:%s Fun:%s\n",__LINE__,__FILE__,__FUNCTION__);
|
|
||||||
#define DisErrorMsg() printf("!!!!!!!!!!!!!!!ERROR! ,Line:%d File:%s Fun:%s\n",__LINE__,__FILE__,__FUNCTION__);
|
|
||||||
|
|
||||||
#define PRINT_CTRL_STOP 0
|
|
||||||
#define PRINT_CTRL_START 1
|
|
||||||
#define PRINT_CTRL_PAUSE 2
|
|
||||||
#define PRINT_CTRL_DAC_DISABLE 3
|
|
||||||
#define PRINT_CTRL_DAC_ENABLE 4
|
|
||||||
#define PRINT_CTRL_STOPSYNCNT 5
|
|
||||||
|
|
||||||
|
|
||||||
#define MAX_FPGA_DAC_VALUE_FOR_NEW ((1<<12)*95/100) //由于硬件原因,当DAC大于一定值后,电压不再变化,所以做一下限制
|
|
||||||
#define MAX_FPGA_DAC_VALUE_FOR_V1 (255) //老板子的最大值到256
|
|
||||||
#define MAX_FPGA_DAC_VALUE ((PRODUCT_VERSION(sysPara->status.fpgaVersionNum) == JETV1)?MAX_FPGA_DAC_VALUE_FOR_V1:MAX_FPGA_DAC_VALUE_FOR_NEW)
|
|
||||||
|
|
||||||
#define MAX_POINT_DISTANCE_ADJUST_VAL (1<<10) //点距微调的最大值
|
|
||||||
|
|
||||||
#define MAX_MOTOR_RUN_CURRENT 600
|
|
||||||
#define MIN_MOTOR_RUN_CURRENT 80
|
|
||||||
|
|
||||||
#define MAX_RECLAIM_BLOCK_CNT 5 //500ms
|
|
||||||
|
|
||||||
#define MAX_RELEASE_VALVE_DELAY_CNT 4
|
|
||||||
/*所有警告都是高电平警告*/
|
|
||||||
#define WARN_STATUS_INK_SWINT (1<<7) /*墨线开头,来自喷头,必须开的时候才能打印,关的时候为1,开的时候为0*/
|
|
||||||
#define WARN_STATUS_POWER_MON (1<<6) //高压报警
|
|
||||||
#define WARN_STATUS_RECYCLE_FAULT (1<<5) //高电平表示有故障
|
|
||||||
#define WARN_STATUS_INK_WARN (1<<4)
|
|
||||||
#define WARN_STATUS_SOLV_WARN (1<<3)
|
|
||||||
#define WARN_STATUS_SUMP_WARN (1<<2) //墨水渗漏
|
|
||||||
#define WARN_STATUS_HDINT (1<<1) /*喷头盖,盖上为0,否则为1,必须盖上才能打印,电磁铁有正反面*/
|
|
||||||
#define WARN_STATUS_VISCOTITY_MEASURE_READY (1<<0) // 球已经到上位等灯
|
|
||||||
|
|
||||||
|
|
||||||
#define FPGA_SYS_HZ 100000000
|
|
||||||
|
|
||||||
#define MAX_WR_MEM_SIZE (1<<16) //写空间最大地址范围
|
|
||||||
#define MAX_WR_MEM_SIZE_MASK (MAX_WR_MEM_SIZE - 1)
|
|
||||||
#define MAX_RD_MEM_SIZE (1<<9) //读空间最大地址范围
|
|
||||||
#define MAX_RD_MEM_SIZE_MASK (MAX_RD_MEM_SIZE - 1)
|
|
||||||
|
|
||||||
/* am335x core board control pwm output */
|
|
||||||
#define VISCO_PUMP_REQUEST "echo 1 > /sys/class/pwm/ecap.2/request"
|
|
||||||
#define VISCO_PUMP_RELEASE "echo 0 > /sys/class/pwm/ecap.2/request"
|
|
||||||
#define VISCO_PUMP_RUN "echo 1 > /sys/class/pwm/ecap.2/run"
|
|
||||||
#define VISCO_PUMP_STOP "echo 0 > /sys/class/pwm/ecap.2/run"
|
|
||||||
#define VISCO_PUMP_50Hz "echo 50 > /sys/class/pwm/ecap.2/period_freq"
|
|
||||||
#define VISCO_PUMP_50P "echo 50 > /sys/class/pwm/ecap.2/duty_percent"
|
|
||||||
#define VISCO_PUMP_HIGH "echo 1 > /sys/class/pwm/ecap.2/polarity"
|
|
||||||
#define VISCO_PUMP_LOW "echo 0 > /sys/class/pwm/ecap.2/polarity"
|
|
||||||
|
|
||||||
#define SUCTION_PUMP_REQUEST "echo 1 > /sys/class/pwm/ehrpwm.0:1/request"
|
|
||||||
#define SUCTION_PUMP_RELEASE "echo 0 > /sys/class/pwm/ehrpwm.0:1/request"
|
|
||||||
#define SUCTION_PUMP_RUN "echo 1 > /sys/class/pwm/ehrpwm.0:1/run"
|
|
||||||
#define SUCTION_PUMP_STOP "echo 0 > /sys/class/pwm/ehrpwm.0:1/run"
|
|
||||||
#define SUCTION_PUMP_HIGH "echo 1 > /sys/class/pwm/ehrpwm.0:1/polarity"
|
|
||||||
#define SUCTION_PUMP_LOW "echo 0 > /sys/class/pwm/ehrpwm.0:1/polarity"
|
|
||||||
#define SUCTION_PUMP_90P "echo 90 > /sys/class/pwm/ehrpwm.0:1/duty_percent"
|
|
||||||
#define SUCTION_PUMP_12000Hz "echo 12000 > /sys/class/pwm/ehrpwm.0:1/period_freq"
|
|
||||||
|
|
||||||
#ifdef __ADC_INPUT__
|
|
||||||
#define BOART_TEMP_DEVICE "/sys/bus/iio/devices/iio:device0/in_voltage4_raw"
|
|
||||||
#define INK_TEMP_DEVICE "/sys/bus/iio/devices/iio:device0/in_voltage5_raw"
|
|
||||||
#define REVERSE_TEMP_DEVICE "/sys/bus/iio/devices/iio:device0/in_voltage6_raw"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef UART2
|
|
||||||
class UartThread;
|
|
||||||
typedef struct {
|
|
||||||
char mode;
|
|
||||||
int addr;
|
|
||||||
int len;
|
|
||||||
char flag_m;
|
|
||||||
QByteArray Buf;
|
|
||||||
}rec_cmd_t;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 请不要直接初始化此函数,如果需要,请通过SysPara的devOP来访问此类
|
|
||||||
* */
|
|
||||||
class DevOp : public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public :
|
|
||||||
DevOp(SysPara * sysPara);
|
|
||||||
~DevOp();
|
|
||||||
|
|
||||||
void set_totalSynPulseNum(bool wren);// 设置可变长度
|
|
||||||
void TTYS0ToConsole();
|
|
||||||
void WriteMoterPump(int);
|
|
||||||
void controlReleaseValve(bool openFlag);
|
|
||||||
void controlMixValve(bool openFlag);
|
|
||||||
void controlInkValve(bool openFlag); //控制墨线,即供墨阀
|
|
||||||
void controlInkValvePWMSTM32(int PWMPulse);
|
|
||||||
void controlCycleValve(bool openFlag);
|
|
||||||
void controlCompressPump(bool openFlag);
|
|
||||||
void controlViscosityPump(bool openFlag);
|
|
||||||
void controlMainInkPump(bool openFlag);
|
|
||||||
void setHighVoltageAmplitudetoSTM32();
|
|
||||||
void controlReclaimPump(bool openFlag,bool fullSpeed);
|
|
||||||
void controlReclaimPump2();
|
|
||||||
void controlInkValvePWM(bool openFlag);
|
|
||||||
void controlInkValvePWM2();
|
|
||||||
void controlHeater(bool openFlag);
|
|
||||||
void controlBeeper(bool openFlag);
|
|
||||||
|
|
||||||
void controlReclaimTankOpen(bool enableFlag);
|
|
||||||
void controlReclaimTankClose(bool enableFlag);
|
|
||||||
|
|
||||||
void powerOff(void);
|
|
||||||
|
|
||||||
bool isReleaseValveOpen();
|
|
||||||
bool isMixValveOpen();
|
|
||||||
bool isInkValveOpen();
|
|
||||||
bool isInkValveOpen1();
|
|
||||||
bool isCycleValveOpen();
|
|
||||||
bool isCompressPumpOpen();
|
|
||||||
bool isViscosityPumpOpen();
|
|
||||||
bool isMainInkPumpOpen();
|
|
||||||
bool isReclaimPumpOpen();
|
|
||||||
|
|
||||||
bool isReclaimTankOpenEnable();
|
|
||||||
bool isReclaimTankCloseEnable();
|
|
||||||
bool isBeeperEnable();
|
|
||||||
bool isHearterEnable();
|
|
||||||
|
|
||||||
int writeFpgaPrintPara(bool ignoreWarn = false);
|
|
||||||
void readFgaStatus(void);
|
|
||||||
void writeDacValue2Fpga_No73();
|
|
||||||
|
|
||||||
void printCtrl(int cmd);
|
|
||||||
void ReadCnt1GroupStatus(void);
|
|
||||||
void writeCnt1GroupSetting(bool bCntByGroupEnable);
|
|
||||||
void writeFpgaCalandar(bool Enable);
|
|
||||||
void writeFpgaVariCtrl();
|
|
||||||
void readCalandarDat();
|
|
||||||
void resumeFault();
|
|
||||||
void highVoltageCtrl(int val);
|
|
||||||
void maxHighVoltageDACCtrl(int val);
|
|
||||||
void setPhaseByHand(int val);
|
|
||||||
void readPhaseDetectHighTm();
|
|
||||||
void setPhaseDetectVoltageDutyCycle(int duty);
|
|
||||||
void setBlickLightPeriod(int value);
|
|
||||||
void setOscillatorVoltage(int value);
|
|
||||||
void setDivideRatio(int value);
|
|
||||||
void setLastLineEndPointFixedValue(int value);
|
|
||||||
// void checkAuthorization(QString str);
|
|
||||||
|
|
||||||
void mainInkCtrl();
|
|
||||||
void pumpValveCtrl(int viscosityAdjustByTemp=0);
|
|
||||||
void clearProductCnt(unsigned int mode);
|
|
||||||
unsigned int readFpgaVersionNum(void);
|
|
||||||
void fpgaWr(int addr,unsigned char*dat,int len);
|
|
||||||
void fpgaRd(int addr,unsigned char*dat,int len);
|
|
||||||
void fpgaWrD(int addr,unsigned int dat,int len);
|
|
||||||
void fpgaResetWarning(char mode);
|
|
||||||
bool fpgaDevOpenFlag;
|
|
||||||
|
|
||||||
void stm32Rd(int addr,unsigned char*dat,int len);
|
|
||||||
void stm32Wr(int addr,unsigned char*dat,int len);
|
|
||||||
|
|
||||||
unsigned char memWrMap[MAX_WR_MEM_SIZE];
|
|
||||||
unsigned char memRdMap[MAX_RD_MEM_SIZE];
|
|
||||||
unsigned char color_flag;
|
|
||||||
void controlRedLight(bool openFlag);
|
|
||||||
void controlGreenLight(bool openFlag);
|
|
||||||
void controlYellowLight(bool openFlag);
|
|
||||||
void controlFan1(bool openFlag);
|
|
||||||
void controlFan2(bool openFlag);
|
|
||||||
|
|
||||||
bool isGreenLightEnable();
|
|
||||||
bool isYellowLightEnable();
|
|
||||||
bool isRedLightEnable();
|
|
||||||
void readbuilDat();
|
|
||||||
void readPrintDataXor();
|
|
||||||
void readSyncCounterAtZero();
|
|
||||||
void printCtrl2(int cmd);
|
|
||||||
void ReadSomeDataForLostPrint(void);
|
|
||||||
|
|
||||||
bool stopSendDataFPGA;
|
|
||||||
bool stopSendDataSTM32;
|
|
||||||
// unsigned char *dataOfViscosity;
|
|
||||||
|
|
||||||
#ifdef __STC_POWER__
|
|
||||||
int Heartbeat(char bPowerOn);
|
|
||||||
int setWakeUpTimer(char wakeUpTime_day);
|
|
||||||
int getPowerSource(void);
|
|
||||||
Posix_QextSerialPort *comForPower;
|
|
||||||
void comForPower_init();
|
|
||||||
#endif
|
|
||||||
#ifdef __RFID_CARD
|
|
||||||
Posix_QextSerialPort *comForRFID;
|
|
||||||
void comForRFID_init();
|
|
||||||
int comReadRFID_data();
|
|
||||||
int comWriteRFID_data();
|
|
||||||
int setRFIDCarKey(void);
|
|
||||||
int setRFIDReaderKey(void);
|
|
||||||
int setRFIDReaderOriginalKey(void);
|
|
||||||
int setRFIDReaderWorkMode(void);
|
|
||||||
int receiveReadRFID_data(void);
|
|
||||||
int queryReadRFID_address(void);
|
|
||||||
QString strRevdata;
|
|
||||||
bool noticeICReaderError;
|
|
||||||
bool setICReaderModeFlag;
|
|
||||||
uint checkCardIntervalTime;
|
|
||||||
QReadWriteLock CardDataRwLock;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __ADC_INPUT__
|
|
||||||
qint8 GetTemp(QString ainFile, quint8 *pTemp);
|
|
||||||
#endif
|
|
||||||
void Read_RanddomFromFpga(); // 读FPGARANDFIFO
|
|
||||||
void RandTxtBakup(char ok);
|
|
||||||
// 上海外接屏功能
|
|
||||||
int BigDisp(unsigned char Module[], unsigned char Wirediameter[]);
|
|
||||||
int RecDim();//unsigned char buf[], unsigned char Dim[]);
|
|
||||||
int SmallDisp(unsigned char Module[], unsigned char Wirediameter[]);
|
|
||||||
void DatToDisp(char FileName[], bool big);
|
|
||||||
void DatToDisp2();
|
|
||||||
void showData(QByteArray dat);
|
|
||||||
void uart2Init();
|
|
||||||
void writeDacValue2Fpga_No72NewVoltData();
|
|
||||||
|
|
||||||
#ifdef UART2
|
|
||||||
Posix_QextSerialPort *myCom;
|
|
||||||
// MySerialPort * myserialport;
|
|
||||||
QByteArray recData;
|
|
||||||
QQueue<QByteArray> recQueue;
|
|
||||||
int recLen;
|
|
||||||
void stopReceiving();
|
|
||||||
bool isReceivingEnable() const;
|
|
||||||
void disableReceiving();
|
|
||||||
void enableReceiving();
|
|
||||||
|
|
||||||
uchar sendData(const QByteArray &data);
|
|
||||||
|
|
||||||
void stopSending();
|
|
||||||
bool isSendingEnable() const;
|
|
||||||
void disableSending();
|
|
||||||
void enableSending();
|
|
||||||
uchar uartThreadStart();
|
|
||||||
|
|
||||||
//void printCtrl2(int cmd);
|
|
||||||
int recUart2();
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void readCom(char mode,QByteArray recData,int addr);
|
|
||||||
void sendCom(QString s);
|
|
||||||
void sendCom(char *buf, int len);
|
|
||||||
void resendFPGADate(int,int,unsigned char *,int,int);
|
|
||||||
void resendSTM32Date(int,int,unsigned char *,int,int);
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void dataReceived(char,const QByteArray &dataReceived,int);
|
|
||||||
void sendSerialDataToSTM32(int,int,unsigned char *,int,int);
|
|
||||||
void sendSerialDataToFPGA(int,int,unsigned char *,int,int);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
private:
|
|
||||||
int WdgttyUsb0Cnt;
|
|
||||||
bool releaseValveOpenFlag;
|
|
||||||
bool mixValveFlag;
|
|
||||||
bool inkValveOpenFlag;
|
|
||||||
bool inkValveOpenFlag1;
|
|
||||||
bool cycleValveOpenFlag;
|
|
||||||
bool compressPumpOpenFlag;
|
|
||||||
bool viscosityPumpOpenFlag;
|
|
||||||
bool mainInkPumpOpenFlag;
|
|
||||||
bool reclaimPumpOpenFlag;
|
|
||||||
|
|
||||||
bool reclaimTankOpenEnableFlag;
|
|
||||||
bool reclaimTankCloseEnableFlag;
|
|
||||||
bool beeperOnFlag;
|
|
||||||
|
|
||||||
bool RedLightOnFlag;
|
|
||||||
bool GreenLightOnFlag;
|
|
||||||
bool YellowLightOnFlag;
|
|
||||||
|
|
||||||
bool heaterOnFlag;
|
|
||||||
int com2;
|
|
||||||
int pwm_sp;
|
|
||||||
int pwm_fd;
|
|
||||||
int Interrupt_fd;
|
|
||||||
int iocontrl;
|
|
||||||
int DAdataout;
|
|
||||||
int pwm_ink;
|
|
||||||
int adc_fd;
|
|
||||||
#ifdef __VX_OSC_VOL__
|
|
||||||
qint8 OscillatorVoltage[100];//VX 电路不一样,所以需要重新调整
|
|
||||||
#endif
|
|
||||||
SysPara *sysPara;
|
|
||||||
|
|
||||||
|
|
||||||
unsigned int fpgaRdD(int addr,int len);
|
|
||||||
|
|
||||||
// 0xA451--- 为什么ARM的顺序相反呢?
|
|
||||||
typedef struct {
|
|
||||||
unsigned int varDigitalNum:4; // 数字的个数
|
|
||||||
unsigned int charRamBaseAddr:12; // 基址
|
|
||||||
unsigned int colOffset:16; // 列偏移
|
|
||||||
unsigned int horizonWidth:9;//字模宽度
|
|
||||||
unsigned int verticalOffset:6; // 行偏移
|
|
||||||
unsigned int charRowNum:6; // 每个字符占行个数
|
|
||||||
unsigned int charColNum:6; // 每个字符占列个数
|
|
||||||
unsigned int varTypeSel:4;
|
|
||||||
unsigned int dummy:1;
|
|
||||||
}reg_var_print_ctrl_t;
|
|
||||||
|
|
||||||
#ifdef UART2
|
|
||||||
UartThread *uartThread;
|
|
||||||
bool sendingEnable;
|
|
||||||
bool receivingEnable;
|
|
||||||
bool saveStateReceiveData;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef UART2
|
|
||||||
class UartThread : public QThread
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
UartThread(Posix_QextSerialPort &adrPort);
|
|
||||||
~UartThread();
|
|
||||||
void stopReceiving();
|
|
||||||
QQueue<QByteArray> dataToSend;
|
|
||||||
QMutex mutexSend;
|
|
||||||
void stopSending();
|
|
||||||
void addDataToSend(const QByteArray &dataToAdd);
|
|
||||||
protected:
|
|
||||||
void run();
|
|
||||||
signals:
|
|
||||||
void dataReceived(char,const QByteArray &dataReceived,int);
|
|
||||||
private :
|
|
||||||
Posix_QextSerialPort &port;
|
|
||||||
QMutex mutexReceive;
|
|
||||||
bool stopped;
|
|
||||||
rec_cmd_t rec_cmd;
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
#endif /* DEVOP_H_ */
|
|
||||||
+57
-27
@@ -799,6 +799,27 @@ float PID_realize2(float speed, float act){
|
|||||||
|
|
||||||
void InkJetPrinter::pressureAdj()
|
void InkJetPrinter::pressureAdj()
|
||||||
{
|
{
|
||||||
|
// 关机压力控制首次进入时从停泵状态重新开始,禁止继承正常运行或手动控制转速
|
||||||
|
if(sysPara->status.powerOffAppending && !m_powerOffPressureControlActive)
|
||||||
|
{
|
||||||
|
u = 0.0f;
|
||||||
|
sysPara->para.gearPumpValue = 0;
|
||||||
|
m_pumpState = DPUMP_STOPPED;
|
||||||
|
m_stateChangeCount = 0;
|
||||||
|
m_adjSkip = 0;
|
||||||
|
m_lastActualPressure = 0;
|
||||||
|
m_startingStepCount = 0;
|
||||||
|
m_bufValidCount = 0;
|
||||||
|
for(int i = 0; i < 10; i++) m_pressureBuf[i] = 0;
|
||||||
|
m_bufIdx = 0;
|
||||||
|
sysPara->devOp->WriteMoterPump();
|
||||||
|
m_powerOffPressureControlActive = true;
|
||||||
|
}
|
||||||
|
else if(!sysPara->status.powerOffAppending)
|
||||||
|
{
|
||||||
|
m_powerOffPressureControlActive = false;
|
||||||
|
}
|
||||||
|
|
||||||
// 故障停机处理
|
// 故障停机处理
|
||||||
if(sysPara->status.gearPumpRunStopFlag || sysPara->status.flagOfSpeedAlarm)
|
if(sysPara->status.gearPumpRunStopFlag || sysPara->status.flagOfSpeedAlarm)
|
||||||
{
|
{
|
||||||
@@ -834,6 +855,8 @@ void InkJetPrinter::pressureAdj()
|
|||||||
|
|
||||||
int actual = sysPara->status.PRESSURE;
|
int actual = sysPara->status.PRESSURE;
|
||||||
int target = (int)sysPara->para.pressure;
|
int target = (int)sysPara->para.pressure;
|
||||||
|
if(sysPara->status.powerOffAppending && target > 650)
|
||||||
|
target = 650; // 关机压力目标不超过650,不修改用户设定值
|
||||||
int err = target - actual; // 正值=压力偏低,负值=压力偏高
|
int err = target - actual; // 正值=压力偏低,负值=压力偏高
|
||||||
|
|
||||||
// 更新滑动平均缓冲
|
// 更新滑动平均缓冲
|
||||||
@@ -849,8 +872,9 @@ void InkJetPrinter::pressureAdj()
|
|||||||
// 检查是否允许状态切换(距上次切换>=800ms)
|
// 检查是否允许状态切换(距上次切换>=800ms)
|
||||||
bool canSwitch = (m_stateChangeCount >= MIN_STATE_INTERVAL);
|
bool canSwitch = (m_stateChangeCount >= MIN_STATE_INTERVAL);
|
||||||
|
|
||||||
// 硬保护:压力严重超标,立即强制停泵(不受800ms限制)
|
// 关机压力上限:超过关机目标10立即停泵,不受状态和800ms切换间隔限制
|
||||||
if(actual > target + 80)
|
int hardStopThreshold = sysPara->status.powerOffAppending ? 10 : 80;
|
||||||
|
if(actual > target + hardStopThreshold)
|
||||||
{
|
{
|
||||||
if(m_pumpState != DPUMP_STOPPED) {
|
if(m_pumpState != DPUMP_STOPPED) {
|
||||||
u = 0.0f;
|
u = 0.0f;
|
||||||
@@ -1331,20 +1355,18 @@ void InkJetPrinter::timerHandler(void){
|
|||||||
ControledSwitchFlag = false;
|
ControledSwitchFlag = false;
|
||||||
pulse_3s = 0;
|
pulse_3s = 0;
|
||||||
}
|
}
|
||||||
// 检测手动→自动边沿,直接恢复压力控制,不走 gearPumpStartFlag 的 3s 等待
|
// 检测手动→自动边沿,恢复压力控制时从停止状态安全重启
|
||||||
if(m_lastByHand && !sysPara->status.isPumpValveControledByHand)
|
if(m_lastByHand && !sysPara->status.isPumpValveControledByHand)
|
||||||
{
|
{
|
||||||
ControledSwitchFlag = true;
|
ControledSwitchFlag = true;
|
||||||
u = (float)sysPara->para.gearPumpValue; // 同步当前转速,避免突变
|
u = 0.0f;
|
||||||
// 重置隔膜泵状态机,从当前转速状态开始
|
sysPara->para.gearPumpValue = 0;
|
||||||
if(u > 40.0f) {
|
sysPara->devOp->WriteMoterPump();
|
||||||
m_pumpState = DPUMP_RUNNING; // 如果当前有转速,进入运行状态
|
m_pumpState = DPUMP_STOPPED;
|
||||||
} else {
|
|
||||||
m_pumpState = DPUMP_STOPPED; // 否则从停止状态开始
|
|
||||||
}
|
|
||||||
m_stateChangeCount = 0;
|
m_stateChangeCount = 0;
|
||||||
m_adjSkip = 0;
|
m_adjSkip = 0;
|
||||||
m_lastActualPressure = 0;
|
m_lastActualPressure = 0;
|
||||||
|
m_startingStepCount = 0;
|
||||||
m_bufValidCount = 0;
|
m_bufValidCount = 0;
|
||||||
for(int i = 0; i < 10; i++) m_pressureBuf[i] = 0;
|
for(int i = 0; i < 10; i++) m_pressureBuf[i] = 0;
|
||||||
m_bufIdx = 0;
|
m_bufIdx = 0;
|
||||||
@@ -1395,7 +1417,7 @@ void InkJetPrinter::timerHandler(void){
|
|||||||
test_flag = 0;
|
test_flag = 0;
|
||||||
}
|
}
|
||||||
if(pulse_1s) {
|
if(pulse_1s) {
|
||||||
if(sysPara->status.selfCheckDone && sysPara->para.gearPumpEnable && sysPara->para.flagOfReclaimPumEnable)
|
if(sysPara->status.selfCheckDone && sysPara->para.gearPumpEnable)
|
||||||
checkPressureControl();
|
checkPressureControl();
|
||||||
if((QTime::currentTime()>=QTime(00,00,00))&&(QTime::currentTime()<=QTime(00,00,02))&&sysPara->para.Reciclar){
|
if((QTime::currentTime()>=QTime(00,00,00))&&(QTime::currentTime()<=QTime(00,00,02))&&sysPara->para.Reciclar){
|
||||||
if(ui->tabMainWindow->getCurrPrintStatus() != 1){
|
if(ui->tabMainWindow->getCurrPrintStatus() != 1){
|
||||||
@@ -1567,7 +1589,7 @@ void InkJetPrinter::timerHandler(void){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(gearPumpRunFlag || sysPara->para.gearPumpEnable == 0)
|
if(gearPumpRunFlag || sysPara->para.gearPumpEnable == 0 || sysPara->status.powerOffAppending)
|
||||||
{
|
{
|
||||||
if(!sysPara->status.selfCheckDone && sysPara->status.isPrinting){
|
if(!sysPara->status.selfCheckDone && sysPara->status.isPrinting){
|
||||||
sysPara->status.selfCheckDone = true;
|
sysPara->status.selfCheckDone = true;
|
||||||
@@ -1615,14 +1637,13 @@ void InkJetPrinter::timerHandler(void){
|
|||||||
if(sysPara->status.selfCheckCnt >= MAX_SELF_CHECK_CNT)
|
if(sysPara->status.selfCheckCnt >= MAX_SELF_CHECK_CNT)
|
||||||
{
|
{
|
||||||
sysPara->status.selfCheckDone = 1;
|
sysPara->status.selfCheckDone = 1;
|
||||||
u = (float)sysPara->para.gearPumpValue;
|
// 自检完成后管道恢复正常阻力,必须重新从STOPPED状态开始
|
||||||
// 自检完成后管道恢复正常阻力,重置状态机让压力重新平稳收敛
|
// 清零 u 和状态机,让系统根据实际压力重新启动
|
||||||
// 不清零 u,从当前控制字开始,避免突变
|
u = 0.0f; // 关键:清零控制量,避免继承自检期间的大转速
|
||||||
if(u > 40.0f) {
|
sysPara->para.gearPumpValue = 0;
|
||||||
m_pumpState = DPUMP_RUNNING; // 如果当前有转速,进入运行状态
|
sysPara->devOp->WriteMoterPump(); // 立即停泵
|
||||||
} else {
|
|
||||||
m_pumpState = DPUMP_STOPPED; // 否则从停止状态开始
|
m_pumpState = DPUMP_STOPPED; // 强制进入STOPPED状态
|
||||||
}
|
|
||||||
m_stateChangeCount = 0;
|
m_stateChangeCount = 0;
|
||||||
m_adjSkip = 0;
|
m_adjSkip = 0;
|
||||||
m_lastActualPressure = 0;
|
m_lastActualPressure = 0;
|
||||||
@@ -1663,16 +1684,25 @@ void InkJetPrinter::timerHandler(void){
|
|||||||
m_lastReclaimMode = sysPara->para.flagOfReclaimPumEnable;
|
m_lastReclaimMode = sysPara->para.flagOfReclaimPumEnable;
|
||||||
gearPumpRunNormalFlag = false; // 泄漏保护重新学习
|
gearPumpRunNormalFlag = false; // 泄漏保护重新学习
|
||||||
gearPumpRunNormalValue = 0.0f;
|
gearPumpRunNormalValue = 0.0f;
|
||||||
// 重置隔膜泵状态机,适应新模式
|
// 重置隔膜泵状态机,适应新模式
|
||||||
m_pumpState = DPUMP_STOPPED;
|
u = 0.0f;
|
||||||
m_stateChangeCount = 0;
|
pid.integral = 0.0f;
|
||||||
m_adjSkip = 0;
|
pid.err_last = 0.0f;
|
||||||
m_lastActualPressure = 0;
|
sysPara->para.gearPumpValue = 0;
|
||||||
m_bufValidCount = 0;
|
sysPara->devOp->WriteMoterPump();
|
||||||
|
if(!sysPara->para.flagOfReclaimPumEnable)
|
||||||
|
sysPara->devOp->controlReclaimPump(false, false);
|
||||||
|
m_pumpState = DPUMP_STOPPED;
|
||||||
|
m_stateChangeCount = 0;
|
||||||
|
m_adjSkip = 0;
|
||||||
|
m_lastActualPressure = 0;
|
||||||
|
m_bufValidCount = 0;
|
||||||
for(int i = 0; i < 10; i++) m_pressureBuf[i] = 0;
|
for(int i = 0; i < 10; i++) m_pressureBuf[i] = 0;
|
||||||
m_bufIdx = 0;
|
m_bufIdx = 0;
|
||||||
}
|
}
|
||||||
if(pulse_100ms && sysPara->para.gearPumpEnable && !sysPara->status.isPumpValveControledByHand && ControledSwitchFlag ) {
|
if(pulse_100ms && sysPara->para.gearPumpEnable &&
|
||||||
|
(sysPara->status.powerOffAppending ||
|
||||||
|
(!sysPara->status.isPumpValveControledByHand && ControledSwitchFlag))) {
|
||||||
pressureAdj();
|
pressureAdj();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ private:
|
|||||||
int m_bufValidCount = 0; // 缓冲区有效点数(用于启动阶段判断)
|
int m_bufValidCount = 0; // 缓冲区有效点数(用于启动阶段判断)
|
||||||
bool m_lastReclaimMode = false; // 上次回收泵使能状态
|
bool m_lastReclaimMode = false; // 上次回收泵使能状态
|
||||||
bool m_lastByHand = false; // 上次手动控制状态
|
bool m_lastByHand = false; // 上次手动控制状态
|
||||||
|
bool m_powerOffPressureControlActive = false; // 关机压力控制已初始化
|
||||||
|
|
||||||
// 隔膜泵控制函数
|
// 隔膜泵控制函数
|
||||||
float calculateTargetSpeed(int err);
|
float calculateTargetSpeed(int err);
|
||||||
|
|||||||
+1
-1
@@ -2233,7 +2233,7 @@ void PrintSetting::ModuleDecimalHideDisplay(const bool bEnabled)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PrintSetting::specailMachineSetting(bool enable){
|
void PrintSetting::specailMachineSetting(bool enable){
|
||||||
ui->checkBox_ReclaimPumpEnable->setEnabled(enable);
|
ui->checkBox_ReclaimPumpEnable->setEnabled(enable && PUMP_VER == QString("G"));
|
||||||
ui->spinBox_gearPumpSpeedAlarm->setEnabled(enable);
|
ui->spinBox_gearPumpSpeedAlarm->setEnabled(enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+229
-229
@@ -1,229 +1,229 @@
|
|||||||
#ifndef PRINTSETTING_H
|
#ifndef PRINTSETTING_H
|
||||||
#define PRINTSETTING_H
|
#define PRINTSETTING_H
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include "dialogmodifypasswd.h"
|
#include "dialogmodifypasswd.h"
|
||||||
#include "DialogAuthorization.h"
|
#include "DialogAuthorization.h"
|
||||||
#include "ParaSettingUI.h"
|
#include "ParaSettingUI.h"
|
||||||
#include "dlginputaddr.h"
|
#include "dlginputaddr.h"
|
||||||
|
|
||||||
#include "dlgvarlength.h"
|
#include "dlgvarlength.h"
|
||||||
#include "dialogshowcounter.h"
|
#include "dialogshowcounter.h"
|
||||||
|
|
||||||
#include "TextEditOption.h" // 需要使用文件文本编辑功能
|
#include "TextEditOption.h" // 需要使用文件文本编辑功能
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QTableWidget>
|
#include <QTableWidget>
|
||||||
#include "dialogmoduleseletion.h"
|
#include "dialogmoduleseletion.h"
|
||||||
#include "SectionalCounting/sectionalwid.h"
|
#include "SectionalCounting/sectionalwid.h"
|
||||||
//#include "mainwindow.h"
|
//#include "mainwindow.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class PrintSetting;
|
class PrintSetting;
|
||||||
}
|
}
|
||||||
|
|
||||||
class PicScene;
|
class PicScene;
|
||||||
class PicTextItem;
|
class PicTextItem;
|
||||||
|
|
||||||
class PrintSetting : public QWidget,public ParaSettingUI
|
class PrintSetting : public QWidget,public ParaSettingUI
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit PrintSetting(QWidget *parent = 0);
|
explicit PrintSetting(QWidget *parent = 0);
|
||||||
~PrintSetting();
|
~PrintSetting();
|
||||||
QString cmd;
|
QString cmd;
|
||||||
QString addr;
|
QString addr;
|
||||||
QString data;
|
QString data;
|
||||||
QString len;
|
QString len;
|
||||||
// QString comport;
|
// QString comport;
|
||||||
QString type;
|
QString type;
|
||||||
|
|
||||||
void updateSysParaToUI(); //重载
|
void updateSysParaToUI(); //重载
|
||||||
void applyUIPara(); //重载
|
void applyUIPara(); //重载
|
||||||
void updateCnt1GroupsTblWgt();
|
void updateCnt1GroupsTblWgt();
|
||||||
|
|
||||||
void ApplyCnt1GroupSetting();
|
void ApplyCnt1GroupSetting();
|
||||||
void updateSysStatusToUI();
|
void updateSysStatusToUI();
|
||||||
void updateAuthorization(int auth);
|
void updateAuthorization(int auth);
|
||||||
void PreviewEdit(); //
|
void PreviewEdit(); //
|
||||||
void bindSysPara(SysPara *sysPara);
|
void bindSysPara(SysPara *sysPara);
|
||||||
//分段计米
|
//分段计米
|
||||||
void LoadCnt1GroupSettingsToUI();
|
void LoadCnt1GroupSettingsToUI();
|
||||||
void rowWidgetCreate(int rowIndex);
|
void rowWidgetCreate(int rowIndex);
|
||||||
void moveRow(int currentRow, int toRow);
|
void moveRow(int currentRow, int toRow);
|
||||||
void on_moveUp_clicked();
|
void on_moveUp_clicked();
|
||||||
void on_moveDown_clicked();
|
void on_moveDown_clicked();
|
||||||
//分段计米end
|
//分段计米end
|
||||||
|
|
||||||
void PrintSettingLog();
|
void PrintSettingLog();
|
||||||
|
|
||||||
DlgInputAddr *dlgInputAddr;
|
DlgInputAddr *dlgInputAddr;
|
||||||
DialogModuleSeletion *dialogModuleSeletion;
|
DialogModuleSeletion *dialogModuleSeletion;
|
||||||
bool flagOfSpecailSettng ;
|
bool flagOfSpecailSettng ;
|
||||||
bool flagOfEngineeringMode;
|
bool flagOfEngineeringMode;
|
||||||
void SpecailSettingsDisplay();
|
void SpecailSettingsDisplay();
|
||||||
void EngineeringModeDisplay();
|
void EngineeringModeDisplay();
|
||||||
bool flagOfModuleDecimal;
|
bool flagOfModuleDecimal;
|
||||||
bool flagOfModuleHide;
|
bool flagOfModuleHide;
|
||||||
void ModuleDecimalDisplay();
|
void ModuleDecimalDisplay();
|
||||||
void ModuleHideDisplay();
|
void ModuleHideDisplay();
|
||||||
void ModuleDecimalHideDisplay(const bool bEnabled);
|
void ModuleDecimalHideDisplay(const bool bEnabled);
|
||||||
void uiSettingForNo66();
|
void uiSettingForNo66();
|
||||||
void uiSettingForNo67();
|
void uiSettingForNo67();
|
||||||
void uiSettingForNo72();
|
void uiSettingForNo72();
|
||||||
void uiSettingForNo73();
|
void uiSettingForNo73();
|
||||||
void specailMachineSetting(bool);
|
void specailMachineSetting(bool);
|
||||||
void displayForAdjustVoltage(bool);
|
void displayForAdjustVoltage(bool);
|
||||||
void setForAdjustVoltage();
|
void setForAdjustVoltage();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void updateUIForSpecialCondition();
|
void updateUIForSpecialCondition();
|
||||||
|
|
||||||
void getFpgaVersionSetDisable();
|
void getFpgaVersionSetDisable();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void resizeEvent(QResizeEvent *event) override;
|
void resizeEvent(QResizeEvent *event) override;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void HiddenFunction(bool);
|
void HiddenFunction(bool);
|
||||||
void sendDataToFPGA(QString,QString,QString,QString,QString);
|
void sendDataToFPGA(QString,QString,QString,QString,QString);
|
||||||
void engineerMode(bool);
|
void engineerMode(bool);
|
||||||
void checkPrintIntervalSignal();
|
void checkPrintIntervalSignal();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void showMotorIsenVal(int,int);
|
void showMotorIsenVal(int,int);
|
||||||
void showReclaimTankstatusslot(unsigned char);
|
void showReclaimTankstatusslot(unsigned char);
|
||||||
void on_radioButtonSpecialCondition_clicked(bool checked);
|
void on_radioButtonSpecialCondition_clicked(bool checked);
|
||||||
void refreshtimerHandler(void);
|
void refreshtimerHandler(void);
|
||||||
|
|
||||||
void ondialogShowCounterAccepted(void);
|
void ondialogShowCounterAccepted(void);
|
||||||
|
|
||||||
void on_checkVarLenChg();
|
void on_checkVarLenChg();
|
||||||
void on_VarLenSet();
|
void on_VarLenSet();
|
||||||
|
|
||||||
void on_pushButtonRanddomBackUP_pressed();
|
void on_pushButtonRanddomBackUP_pressed();
|
||||||
void PrintupdateSysParaToUI();
|
void PrintupdateSysParaToUI();
|
||||||
void showVolDacEdit(int auth);
|
void showVolDacEdit(int auth);
|
||||||
void on_pushButtonApply_pressed();
|
void on_pushButtonApply_pressed();
|
||||||
void on_checkBoxResetCnt1CurrValue_released();
|
void on_checkBoxResetCnt1CurrValue_released();
|
||||||
void on_checkBoxResetCnt2CurrValue_released();
|
void on_checkBoxResetCnt2CurrValue_released();
|
||||||
void on_pushButtonClearRunTime_pressed();
|
void on_pushButtonClearRunTime_pressed();
|
||||||
void on_pushOnlyCNT1Clear_pressed();
|
void on_pushOnlyCNT1Clear_pressed();
|
||||||
void on_pushOnlyCNT2Clear_pressed();
|
void on_pushOnlyCNT2Clear_pressed();
|
||||||
|
|
||||||
void ondialogAuthorizationAccepted();
|
void ondialogAuthorizationAccepted();
|
||||||
void ondialogAuthVarSetAccepted();
|
void ondialogAuthVarSetAccepted();
|
||||||
void on_dialogModPasswdAccepted();
|
void on_dialogModPasswdAccepted();
|
||||||
|
|
||||||
void on_checkBoxSuspendAfterPhaseFault_clicked();
|
void on_checkBoxSuspendAfterPhaseFault_clicked();
|
||||||
void on_checkBoxPowerOffAfterPhaseFault_clicked();
|
void on_checkBoxPowerOffAfterPhaseFault_clicked();
|
||||||
|
|
||||||
void on_pushButtonAuth_pressed();
|
void on_pushButtonAuth_pressed();
|
||||||
// void on_pushButtonXFileSelect_pressed();
|
// void on_pushButtonXFileSelect_pressed();
|
||||||
|
|
||||||
void on_spinBoxLastLineEndPointFixedValue_valueChanged(int arg1);
|
void on_spinBoxLastLineEndPointFixedValue_valueChanged(int arg1);
|
||||||
|
|
||||||
void on_pushButtonRecommendedSetting_clicked();
|
void on_pushButtonRecommendedSetting_clicked();
|
||||||
// todo
|
// todo
|
||||||
void onUpdateCnt1GroupDisp(bool bChangeToNext);
|
void onUpdateCnt1GroupDisp(bool bChangeToNext);
|
||||||
|
|
||||||
void on_Cnt3AddRowBtn_pressed();
|
void on_Cnt3AddRowBtn_pressed();
|
||||||
|
|
||||||
void on_Cnt3RemoveRowBtn_pressed();
|
void on_Cnt3RemoveRowBtn_pressed();
|
||||||
|
|
||||||
void on_Cnt3InsertRowBtn_pressed();
|
void on_Cnt3InsertRowBtn_pressed();
|
||||||
|
|
||||||
void on_checkBoxGroupCnt1_clicked(bool checked);
|
void on_checkBoxGroupCnt1_clicked(bool checked);
|
||||||
|
|
||||||
void on_cnt3RemoveAllRowsBtn_pressed();
|
void on_cnt3RemoveAllRowsBtn_pressed();
|
||||||
|
|
||||||
void on_comboBoxAlterPrintEnable_currentIndexChanged(int index);
|
void on_comboBoxAlterPrintEnable_currentIndexChanged(int index);
|
||||||
|
|
||||||
void on_checkVol1of8En_clicked(bool checked);
|
void on_checkVol1of8En_clicked(bool checked);
|
||||||
|
|
||||||
void on_checkmode0211_clicked(bool checked);
|
void on_checkmode0211_clicked(bool checked);
|
||||||
void on_spinBoxExpiryDate_valueChanged(int arg1);
|
void on_spinBoxExpiryDate_valueChanged(int arg1);
|
||||||
|
|
||||||
void on_CBDateFormat1_currentIndexChanged(int index);
|
void on_CBDateFormat1_currentIndexChanged(int index);
|
||||||
void showMachInfo(QString);
|
void showMachInfo(QString);
|
||||||
void showRemoteControl(QString SuperNodeIP,QString EdgeIP);
|
void showRemoteControl(QString SuperNodeIP,QString EdgeIP);
|
||||||
|
|
||||||
void on_volButton_clicked();
|
void on_volButton_clicked();
|
||||||
|
|
||||||
void on_spinBoxColDelay_valueChanged(int arg1);
|
void on_spinBoxColDelay_valueChanged(int arg1);
|
||||||
|
|
||||||
void on_radioButtonFUllColFIxVal_clicked(bool checked);
|
void on_radioButtonFUllColFIxVal_clicked(bool checked);
|
||||||
|
|
||||||
void on_metreCountButton_clicked();
|
void on_metreCountButton_clicked();
|
||||||
|
|
||||||
void on_lockoulsepushButton_clicked();
|
void on_lockoulsepushButton_clicked();
|
||||||
|
|
||||||
void on_spinBoxCnt1EndValue_valueChanged(int arg1);
|
void on_spinBoxCnt1EndValue_valueChanged(int arg1);
|
||||||
|
|
||||||
//todo
|
//todo
|
||||||
void on_pushButtonUpRow_clicked();
|
void on_pushButtonUpRow_clicked();
|
||||||
|
|
||||||
void on_pushButtonDownRow_clicked();
|
void on_pushButtonDownRow_clicked();
|
||||||
|
|
||||||
|
|
||||||
void on_checkBoxResetCnt3CurrValue_released();
|
void on_checkBoxResetCnt3CurrValue_released();
|
||||||
void on_checkBoxSaveCNTStateValue_released();
|
void on_checkBoxSaveCNTStateValue_released();
|
||||||
void on_checkBoxCircleProductCnt_released();
|
void on_checkBoxCircleProductCnt_released();
|
||||||
|
|
||||||
void on_pushOnlyCNT3Clear_pressed();
|
void on_pushOnlyCNT3Clear_pressed();
|
||||||
void setCNT1BackColor(bool flag);
|
void setCNT1BackColor(bool flag);
|
||||||
void setCNT2BackColor(bool flag);
|
void setCNT2BackColor(bool flag);
|
||||||
void setCNT3BackColor(bool flag);
|
void setCNT3BackColor(bool flag);
|
||||||
// void setDisableFontWidth(bool);
|
// void setDisableFontWidth(bool);
|
||||||
void updateMachineMac(QString);
|
void updateMachineMac(QString);
|
||||||
void setDisableFontWidth(bool);
|
void setDisableFontWidth(bool);
|
||||||
private slots:
|
private slots:
|
||||||
void autoUpdateFontWidth(const unsigned int);
|
void autoUpdateFontWidth(const unsigned int);
|
||||||
|
|
||||||
void on_checkBox_FastMode_clicked();
|
void on_checkBox_FastMode_clicked();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void on_spinBox_1_valueChanged(int arg1);
|
void on_spinBox_1_valueChanged(int arg1);
|
||||||
|
|
||||||
void on_pushButton_2_pressed();
|
void on_pushButton_2_pressed();
|
||||||
|
|
||||||
void on_pushButton_3_pressed();
|
void on_pushButton_3_pressed();
|
||||||
|
|
||||||
void on_pushButton_4_pressed();
|
void on_pushButton_4_pressed();
|
||||||
|
|
||||||
void slt_updateCntShow(bool);
|
void slt_updateCntShow(bool);
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void authChanged(int auth);
|
void authChanged(int auth);
|
||||||
void printPriveiw();
|
void printPriveiw();
|
||||||
void change_OutputPulse();
|
void change_OutputPulse();
|
||||||
void SwitchTimerShowItem(bool flag);
|
void SwitchTimerShowItem(bool flag);
|
||||||
private:
|
private:
|
||||||
Ui::PrintSetting *ui;
|
Ui::PrintSetting *ui;
|
||||||
//MainWindow *mainWindow;
|
//MainWindow *mainWindow;
|
||||||
DialogAuthorization *dialogAuthorization;
|
DialogAuthorization *dialogAuthorization;
|
||||||
DialogAuthorization *dialogAuthVarSet;
|
DialogAuthorization *dialogAuthVarSet;
|
||||||
DlgVarLength *dlgvarLen;
|
DlgVarLength *dlgvarLen;
|
||||||
int auth;
|
int auth;
|
||||||
|
|
||||||
Dialogmodifypasswd *dialogModPasswd;
|
Dialogmodifypasswd *dialogModPasswd;
|
||||||
DialogShowCounter *dialogShowCounter;
|
DialogShowCounter *dialogShowCounter;
|
||||||
int modify_vol;
|
int modify_vol;
|
||||||
int keepVolVal;
|
int keepVolVal;
|
||||||
QTimer *refresh_timer;
|
QTimer *refresh_timer;
|
||||||
|
|
||||||
int lockpulse;
|
int lockpulse;
|
||||||
int area_end;
|
int area_end;
|
||||||
int last_area_end;
|
int last_area_end;
|
||||||
PicScene* pGetPicScene;
|
PicScene* pGetPicScene;
|
||||||
|
|
||||||
//当前打印的长度
|
//当前打印的长度
|
||||||
unsigned int current_print_col_num;
|
unsigned int current_print_col_num;
|
||||||
|
|
||||||
// 分段计米
|
// 分段计米
|
||||||
SectionalWid* sectionalWid = nullptr;
|
SectionalWid* sectionalWid = nullptr;
|
||||||
void initSection();
|
void initSection();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PRINTSETTING_H
|
#endif // PRINTSETTING_H
|
||||||
|
|||||||
@@ -417,15 +417,3 @@ if(contains(DEFINES,__2451WIFI__))
|
|||||||
#INCLUDEPATH += /home/student/newDisk/2451_linux/wpa_supplicant_hostapd/wpa_supplicant_hostapd-0.8/src
|
#INCLUDEPATH += /home/student/newDisk/2451_linux/wpa_supplicant_hostapd/wpa_supplicant_hostapd-0.8/src
|
||||||
#INCLUDEPATH += /home/student/newDisk/2451_linux/wpa_supplicant_hostapd/wpa_supplicant_hostapd-0.8/src/utils
|
#INCLUDEPATH += /home/student/newDisk/2451_linux/wpa_supplicant_hostapd/wpa_supplicant_hostapd-0.8/src/utils
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include<iostream>
|
#include<iostream>
|
||||||
#include<string>
|
#include<string>
|
||||||
|
#include "VerBVersion.h"
|
||||||
|
|
||||||
#define VNLG
|
#define VNLG
|
||||||
SysPara::SysPara(void):
|
SysPara::SysPara(void):
|
||||||
@@ -60,6 +61,10 @@ SysPara::SysPara(void):
|
|||||||
|
|
||||||
//para.HVFaultCloseEn= 1; //开机默认为1,允许高压故障自动关闭回收功能
|
//para.HVFaultCloseEn= 1; //开机默认为1,允许高压故障自动关闭回收功能
|
||||||
|
|
||||||
|
// 隔膜泵版本强制开启回收泵模式
|
||||||
|
if(PUMP_VER == QString("D"))
|
||||||
|
para.flagOfReclaimPumEnable = true;
|
||||||
|
|
||||||
devOp->writeFpgaPrintPara(true); //系统起来的时候,将上次记录的配置写入fpga,比如晶振分频等信息
|
devOp->writeFpgaPrintPara(true); //系统起来的时候,将上次记录的配置写入fpga,比如晶振分频等信息
|
||||||
devOp->writeFpgaVariCtrl();
|
devOp->writeFpgaVariCtrl();
|
||||||
devOp->resumeFault();
|
devOp->resumeFault();
|
||||||
|
|||||||
+847
-847
File diff suppressed because it is too large
Load Diff
+70
-70
@@ -1,70 +1,70 @@
|
|||||||
#ifndef SSYSTEMSETTING_H
|
#ifndef SSYSTEMSETTING_H
|
||||||
#define SSYSTEMSETTING_H
|
#define SSYSTEMSETTING_H
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QProgressBar>
|
#include <QProgressBar>
|
||||||
#include "ParaSettingUI.h"
|
#include "ParaSettingUI.h"
|
||||||
#include "TimeSettingDialog.h"
|
#include "TimeSettingDialog.h"
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include "DialogAuthorization.h"
|
#include "DialogAuthorization.h"
|
||||||
#include "dlgmutilanguage.h"
|
#include "dlgmutilanguage.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class SystemSetting;
|
class SystemSetting;
|
||||||
}
|
}
|
||||||
|
|
||||||
class SystemSetting : public QWidget,public ParaSettingUI
|
class SystemSetting : public QWidget,public ParaSettingUI
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SystemSetting(QWidget *parent = 0);
|
explicit SystemSetting(QWidget *parent = 0);
|
||||||
~SystemSetting();
|
~SystemSetting();
|
||||||
|
|
||||||
void updateSysParaToUI(); //重载
|
void updateSysParaToUI(); //重载
|
||||||
void applyUIPara(); //重载
|
void applyUIPara(); //重载
|
||||||
void updateSysStatusToUI(); //重载
|
void updateSysStatusToUI(); //重载
|
||||||
QProgressBar progressBar;
|
QProgressBar progressBar;
|
||||||
void updateReclaimTime(int time);
|
void updateReclaimTime(int time);
|
||||||
void updateViscosityAdjust(int offset);
|
void updateViscosityAdjust(int offset);
|
||||||
void updateAuthorization(int auth);
|
void updateAuthorization(int auth);
|
||||||
void setSpinBoxPressureMaxValue(int pressureVal);
|
void setSpinBoxPressureMaxValue(int pressureVal);
|
||||||
void SystemSettingLog();
|
void SystemSettingLog();
|
||||||
|
|
||||||
bool lastHighVoltageOpen;
|
bool lastHighVoltageOpen;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setFreqFixVisible(bool visible);
|
void setFreqFixVisible(bool visible);
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void changeEditMode(int);
|
void changeEditMode(int);
|
||||||
void setRunStatus(QString);
|
void setRunStatus(QString);
|
||||||
void pressureAdjust();
|
void pressureAdjust();
|
||||||
private slots:
|
private slots:
|
||||||
void setInterfaceMode();
|
void setInterfaceMode();
|
||||||
void SystemupdateSysParaToUI();
|
void SystemupdateSysParaToUI();
|
||||||
|
|
||||||
void on_spinBoxReclaimPumpPower_valueChanged(int arg1);
|
void on_spinBoxReclaimPumpPower_valueChanged(int arg1);
|
||||||
void on_pushButtonCleanUP_pressed();
|
void on_pushButtonCleanUP_pressed();
|
||||||
void on_pushButtonHighVoltageData_pressed();
|
void on_pushButtonHighVoltageData_pressed();
|
||||||
void on_pushButtonApply_pressed();
|
void on_pushButtonApply_pressed();
|
||||||
void on_pushButtonSearchBestOscillatorVoltage_pressed();
|
void on_pushButtonSearchBestOscillatorVoltage_pressed();
|
||||||
void on_pushButtonSearchBestOscillatorFreq_pressed();
|
void on_pushButtonSearchBestOscillatorFreq_pressed();
|
||||||
void timerHandler();
|
void timerHandler();
|
||||||
void on_spinBoxOscillatorVoltage_valueChanged(int arg1);
|
void on_spinBoxOscillatorVoltage_valueChanged(int arg1);
|
||||||
void on_pushButtonInterFace_pressed();
|
void on_pushButtonInterFace_pressed();
|
||||||
void ondialogAuthorizationAccepted();
|
void ondialogAuthorizationAccepted();
|
||||||
void onCleanUPNow();
|
void onCleanUPNow();
|
||||||
void timerHandler2();
|
void timerHandler2();
|
||||||
void autoControlPressure();
|
void autoControlPressure();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::SystemSetting *ui;
|
Ui::SystemSetting *ui;
|
||||||
DlgMutiLanguage dlgLanguage;
|
DlgMutiLanguage dlgLanguage;
|
||||||
QTimer *timer,*timer2, *SetinkcloseCountTimer, *timerAuto;
|
QTimer *timer,*timer2, *SetinkcloseCountTimer, *timerAuto;
|
||||||
unsigned char enCleanUpAppendFlag; // 0空闲,1关开回收槽,2手动,3清洗,4恢复,5停止,6
|
unsigned char enCleanUpAppendFlag; // 0空闲,1关开回收槽,2手动,3清洗,4恢复,5停止,6
|
||||||
bool r_PumpValveControledByHand;
|
bool r_PumpValveControledByHand;
|
||||||
DialogAuthorization *dialogUpateMm;
|
DialogAuthorization *dialogUpateMm;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SSYSTEMSETTING_H
|
#endif // SSYSTEMSETTING_H
|
||||||
|
|||||||
+2595
-2595
File diff suppressed because it is too large
Load Diff
+4602
-4608
File diff suppressed because it is too large
Load Diff
+2
-1
@@ -63,7 +63,7 @@ public:
|
|||||||
void enableReclaimCtrlButton(bool enable);
|
void enableReclaimCtrlButton(bool enable);
|
||||||
void resetReclaimCtrlButtonText();
|
void resetReclaimCtrlButtonText();
|
||||||
void enablePushButtonStart(bool enable);
|
void enablePushButtonStart(bool enable);
|
||||||
double getMaxSpeedCalcPara();
|
int getMaxSpeedCalcPara();
|
||||||
|
|
||||||
void PreviewPressed();
|
void PreviewPressed();
|
||||||
int getCurrPrintStatus();
|
int getCurrPrintStatus();
|
||||||
@@ -243,6 +243,7 @@ private:
|
|||||||
bool printingFlag; //判断当前是否在打印
|
bool printingFlag; //判断当前是否在打印
|
||||||
bool startPrintingFlag;
|
bool startPrintingFlag;
|
||||||
bool previewFlag;
|
bool previewFlag;
|
||||||
|
bool m_powerOffInProgress = false; // 防止MySleep处理事件时重复进入关机流程
|
||||||
|
|
||||||
int searchExpiryVar(QString html = "");//检索有效期变量
|
int searchExpiryVar(QString html = "");//检索有效期变量
|
||||||
void ExpiryDotUpdate(char Mode);
|
void ExpiryDotUpdate(char Mode);
|
||||||
|
|||||||
+1062
-1062
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user