code_production/code/base/test_base.h

452 lines
18 KiB
C
Raw Normal View History

2022-12-08 10:10:19 +00:00
#pragma once
#include "string"
#include "sane/sane_ex.h"
2022-12-15 02:54:09 +00:00
#include "ui_helper.h"
2022-12-15 06:05:53 +00:00
#include <Windows.h>
#include <map>
#include <thread>
#include <mutex>
#include <condition_variable>
2022-12-31 09:02:23 +00:00
2022-12-08 10:10:19 +00:00
//////////////////////////////////////TITLE//////////////////////////////////////
2023-01-03 03:12:53 +00:00
2022-12-08 10:10:19 +00:00
/* 拨码开关校验 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_TITLE_DIAL_SWITCH L"拨码开关校验"
2022-12-08 10:10:19 +00:00
/* 检查船型开关功能 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_TITLE_ROCKER_SWITCH L"检查船型开关功能"
2022-12-08 10:10:19 +00:00
/* 设备上电并观察开机状态 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_TITLE_BOOT_STATUS L"设备上电并观察开机状态"
2022-12-08 10:10:19 +00:00
/* 检查液晶显示 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_TITLE_LCD_DISPLAY L"检查液晶显示"
2022-12-08 10:10:19 +00:00
/* 清理纸道功能确认 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_TITLE_CLEAR_PAPER_PATH L"清理纸道功能确认" //1
2022-12-08 10:10:19 +00:00
/* 按键功能检测 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_TITLE_KEY_FUNCTION L"按键功能检测"
2022-12-08 10:10:19 +00:00
/* 计数模式检测 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_TITLE_COUNTING_MODE L"计数模式检测"//1
2022-12-08 10:10:19 +00:00
/* 歪斜检测 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_TITLE_SKEW_DETECTION L"歪斜检测"//1
2022-12-08 10:10:19 +00:00
/* 分纸电机检测 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_TITLE_SEPARATER_MOTOR L"分纸电机检测"
2022-12-08 10:10:19 +00:00
/* CIS原图初检 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_TITLE_CIS_ORIGINAL_IMAGE L"CIS原图初检"
2022-12-08 10:10:19 +00:00
/* 主机风扇功能检测 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_TITLE_HOST_FAN L"主机风扇功能检测"
/* 扫描工作状态 */
#define HGPDTTOOLDB_TITLE_SCAN_WORKING_STATUS L"扫描工作状态"
/* USB-PC接口 */
#define HGPDTTOOLDB_TITLE_USB_PC_INTERFACE L"USB-PC接口"
2022-12-08 10:10:19 +00:00
/* 超声波模块检验 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_TITLE_ULTRASONIC_MODULE L"超声波模块检验"
2022-12-08 10:10:19 +00:00
/* LED灯状态检查 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_TITLE_LED_LIGHT L"LED灯状态检查"
2022-12-08 10:10:19 +00:00
/* 复位检查 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_TITLE_RESET L"复位检查"
2022-12-08 10:10:19 +00:00
/* 走纸检查 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_TITLE_PAPER_FEED L"走纸检查"
2022-12-08 10:10:19 +00:00
/* 开盖传感器检查 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_TITLE_COVER_SENSOR L"开盖传感器检查"
2022-12-08 10:10:19 +00:00
/* 扫描传感器检查 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_TITLE_SCANNING_SENSOR L"扫描传感器检查"
2022-12-08 10:10:19 +00:00
/* 配置速度模式 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_TITLE_CONFIGURE_SPEED_MODE L"配置速度模式"
2022-12-08 10:10:19 +00:00
/* 放置校正纸 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_TITLE_PLACE_CORRECTION_PAPER L"放置校正纸"
2022-12-08 10:10:19 +00:00
/* 自动平场校正 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_TITLE_AUTO_FLAT_FIELD L"自动平场校正"
2022-12-08 10:10:19 +00:00
/* 重启设备 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_TITLE_REBOOT_DEVICE L"重启设备"
2022-12-08 10:10:19 +00:00
/* 扫描图像质量确认 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_TITLE_IMAGE_QUALITY L"扫描图像质量确认"
2022-12-08 10:10:19 +00:00
/* 色卡纸成像质量评估 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_TITLE_COLORCARD_IMAGEING_QUALITY L"色卡纸成像质量评估"
2022-12-08 10:10:19 +00:00
/* 色卡纸偏色成像质量评估 */
#define HGPDTTOOLDB_TITLE_COLORCARD_BIAS_IMAGEING_QUALITY L"色卡纸偏色成像质量评估"
/* 清晰度质量评估 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_TITLE_CLARITY_QUALITY L"清晰度质量评估"
2022-12-08 10:10:19 +00:00
/* 畸变修正 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_TITLE_DISTORTION L"畸变修正"
2022-12-08 10:10:19 +00:00
/* 设置休眠 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_TITLE_DORMANCY L"设置休眠"
2022-12-08 10:10:19 +00:00
/* 歪斜挡位检测 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_TITLE_SKEW_GEAR L"歪斜挡位检测"
2022-12-08 10:10:19 +00:00
/* 分纸强度检测 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_TITLE_PAPER_SEPARATION_STRENGTH L"分纸强度检测"
2022-12-08 10:10:19 +00:00
/* 机械走纸倾斜检测 */
#define HGPDTTOOLDB_TITLE_MECH_PAPER_FEEDING_INCLINATION L"机械走纸倾斜检测"
/* 单张测试1 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_TITLE_SINGLE_PAGE_TEST_1 L"单张测试"
2022-12-08 10:10:19 +00:00
/* 清除滚轴计数 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_TITLE_CLEAR_ROLLER_COUNT L"清除滚轴计数"
/* 清除滚轴计数 */
#define HGPDTTOOLDB_TITLE_CLEAR_HISTORY_COUNT L"清除历史计数"
2022-12-31 09:02:23 +00:00
/*压力测试彩色+200dpi*/
#define HGPDTTOOLDB_TITLE_PRESSUER_TEST_RGB_200DPI L"压力测试彩色_200dpi"
/*压力测试彩色+300dpi*/
2023-10-13 01:54:59 +00:00
#define HGPDTTOOLDB_TITLE_PRESSUER_TEST_RGB_300DPI L"压力测试彩色_300dpi"
/*压力测试彩色+600dpi*/
#define HGPDTTOOLDB_TITLE_PRESSUER_TEST_RGB_600DPI L"压力测试彩色_600dpi"
/*压力测试灰色+200dpi*/
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_TITLE_PRESSUER_TEST_GRAY_200DPI L"压力测试灰色_200dpi"
/*压力测试灰色+300dpi*/
#define HGPDTTOOLDB_TITLE_PRESSUER_TEST_GRAY_300DPI L"压力测试灰色_300dpi"
2023-10-13 01:54:59 +00:00
/*压力测试灰色+600dpi*/
#define HGPDTTOOLDB_TITLE_PRESSUER_TEST_GRAY_600DPI L"压力测试灰色_600dpi"
/*获取设备配置*/
#define HGPDTTOOLDB_TITLE_GET_DEVICE_CONFIG L"获取设备配置"
/*获取设备内存和硬盘容量大小*/
#define HGPDTTOOLDB_TITLE_GET_DEVICE_CPU_DISK L"获取设备内存和硬盘容量大小"
2023-11-02 02:42:55 +00:00
/*备份设备配置*/
#define HGPDTTOOLDB_TITLE_BACKUP L"备份设备配置"
/*关机*/
#define HGPDTTOOLDB_TITLE_SHUTDOWN L"关机"
2024-01-19 01:10:31 +00:00
/*设置固件语言模式*/
#define HGPDTTOOLDB_TITLE_SET_FIRMWARE_LANGUAGE L"设置固件语言模式"
/*图像扫描校正*/
#define HGPDTTOOLDB_TITLE_IMAGE_CORRECTION L"图像扫描校正"
2024-06-25 14:24:04 +00:00
/*彩色图像扫描校正+200dpi*/
#define HGPDTTOOLDB_TITLE_IMAGE_CORRECTION_RGB_200DPI L"彩色图像扫描校正+200dpi"
/*灰度图像扫描校正+200dpi*/
#define HGPDTTOOLDB_TITLE_IMAGE_CORRECTION_GRAY_200DPI L"灰度图像扫描校正+200dpi"
/*彩色图像扫描校正+300dpi*/
#define HGPDTTOOLDB_TITLE_IMAGE_CORRECTION_RGB_300DPI L"彩色图像扫描校正+300dpi"
/*灰度图像扫描校正+300dpi*/
#define HGPDTTOOLDB_TITLE_IMAGE_CORRECTION_GRAY_300DPI L"灰度图像扫描校正+300dpi"
/*彩色图像扫描校正+600dpi*/
#define HGPDTTOOLDB_TITLE_IMAGE_CORRECTION_RGB_600DPI L"彩色图像扫描校正+600dpi"
/*灰度图像扫描校正+600dpi*/
#define HGPDTTOOLDB_TITLE_IMAGE_CORRECTION_GRAY_600DPI L"灰度图像扫描校正+600dpi"
/*关键项检查*/
#define HGPDTTOOLDB_TITLE_KEY_INSPECTION L"关键项检查"
/* 获取设备序列号 */
#define HGPDTTOOLDB_TITLE_GET_SN L"获取设备序列号"
2022-12-08 10:10:19 +00:00
//////////////////////////////////////NAME//////////////////////////////////////
2023-01-03 03:12:53 +00:00
#define WRITE_CFG_NAME L"write-cfg"
2023-01-05 09:46:52 +00:00
/* 设置json序列号 */
#define HGPDTTOOLDB_NAME_SET_JSON_SN L"SET_JSON_SN"
/* 获取设备序列号 */
#define HGPDTTOOLDB_NAME_GET_SN L"GET_SN"
2022-12-08 10:10:19 +00:00
/* 拨码开关校验 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_NAME_DIAL_SWITCH L"DIAL_SWITCH"
2022-12-08 10:10:19 +00:00
/* 检查船型开关功能 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_NAME_ROCKER_SWITCH L"ROCKER_SWITCH"
2022-12-08 10:10:19 +00:00
/* 设备上电并观察开机状态 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_NAME_BOOT_STATUS L"BOOT_STATUS"
2022-12-08 10:10:19 +00:00
/* 检查液晶显示 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_NAME_LCD_DISPLAY L"LCD_DISPLAY"
2022-12-08 10:10:19 +00:00
/* 清理纸道功能确认 */
2023-01-03 03:12:53 +00:00
#define HGPDTTOOLDB_NAME_CLEAR_PAPER_PATH L"PAPER_PATH"
2022-12-08 10:10:19 +00:00
/* 按键功能检测 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_NAME_KEY_FUNCTION L"KEY_FUNCTION"
2022-12-08 10:10:19 +00:00
/* 计数模式检测 */
2023-01-03 03:12:53 +00:00
#define HGPDTTOOLDB_NAME_COUNTING_MODE L"COUNTING_MODE"
2022-12-08 10:10:19 +00:00
/* 歪斜检测 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_NAME_SKEW_DETECTION L"SKEW_DETECTION"
2024-07-09 03:32:54 +00:00
/* 显示屏装配检查 */
#define HGPDTTOOLDB_NAME_SCREEN L"SCREEN"
2022-12-08 10:10:19 +00:00
/* 分纸电机检测 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_NAME_SEPARATER_MOTOR L"SEPARATER_MOTOR"
2022-12-08 10:10:19 +00:00
/* CIS原图初检 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_NAME_CIS_ORIGINAL_IMAGE L"CIS_ORIGINAL_IMAGE"
2022-12-08 10:10:19 +00:00
/* 主机风扇功能检测 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_NAME_HOST_FAN L"HOST_FAN"
/* 扫描工作状态 */
#define HGPDTTOOLDB_NAME_SCAN_WORKING_STATUS L"SCAN_WORKING_STATUS"
/* USB-PC接口 */
#define HGPDTTOOLDB_NAME_USB_PC_INTERFACE L"USB_PC_INTERFACE"
2022-12-08 10:10:19 +00:00
/* 超声波模块检验 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_NAME_ULTRASONIC_MODULE L"ULTRASONIC_MODULE"
2022-12-08 10:10:19 +00:00
/* LED灯状态检查 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_NAME_LED_LIGHT L"LED_LIGHT"
2022-12-08 10:10:19 +00:00
/* 复位检查 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_NAME_RESET L"RESET"
2022-12-08 10:10:19 +00:00
/* 走纸检查 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_NAME_PAPER_FEED L"PAPER_FEED"
2022-12-08 10:10:19 +00:00
/* 开盖传感器检查 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_NAME_COVER_SENSOR L"COVER_SENSOR"
2022-12-08 10:10:19 +00:00
/* 扫描传感器检查 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_NAME_SCANNING_SENSOR L"SCANNING_SENSOR"
2022-12-08 10:10:19 +00:00
/* 配置速度模式 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_NAME_CONFIGURE_SPEED_MODE L"CONFIGURE_SPEED_MODE"
2022-12-08 10:10:19 +00:00
/* 放置校正纸 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_NAME_PLACE_CORRECTION_PAPER L"PLACE_CORRECTION_PAPER"
2022-12-08 10:10:19 +00:00
/* 自动平场校正 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_NAME_AUTO_FLAT_FIELD L"AUTO_FLAT_FIELD"
2022-12-08 10:10:19 +00:00
/* 重启设备 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_NAME_REBOOT_DEVICE L"REBOOT_DEVICE"
2023-02-08 07:25:54 +00:00
/* 扫描图像彩色质量确认 */
#define HGPDTTOOLDB_NAME_IMAGE_COLOR_QUALITY L"IMAGE_COLOR_QUALITY"
/* 扫描图像灰度质量确认 */
#define HGPDTTOOLDB_NAME_IMAGE_GRAY_QUALITY L"IMAGE_GRAY_QUALITY"
2022-12-08 10:10:19 +00:00
/* 色卡纸成像质量评估 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_NAME_COLORCARD_IMAGEING_QUALITY L"COLORCARD_IMAGEING_QUALITY"
2022-12-08 10:10:19 +00:00
/* 色卡纸偏色成像质量评估 */
2022-12-30 09:13:18 +00:00
#define HGPDTTOOLDB_NAME_COLORCARD_BIAS_IMAGEING_QUALITY L"COLORCARD_BIAS_IMAGEING_QUALITY"
2022-12-08 10:10:19 +00:00
/* 清晰度质量评估 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_NAME_CLARITY_QUALITY L"CLARITY_QUALITY"
2023-01-05 09:46:52 +00:00
/* 获取畸变修正值 */
#define HGPDTTOOLDB_NAME_GET_DISTORTION_VAL L"GET_DISTORTION_VAL"
/* 设置畸变修正值 */
#define HGPDTTOOLDB_NAME_SET_DISTORTION_VAL L"SET_DISTORTION_VAL"
2023-03-14 10:00:47 +00:00
/* 确认畸变修正值 */
2024-01-19 01:10:31 +00:00
#define HGPDTTOOLDB_NAME_CONFIRM_DISTORTION_VAL L"CONFIRM_DISTORTION_VAL"
/* 扫描验证畸变修正值 */
#define HGPDTTOOLDB_NAME_VERIFY_DISTORTION_VAL L"VERIFY_DISTORTION_VAL"
2022-12-08 10:10:19 +00:00
/* 设置休眠 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_NAME_DORMANCY L"DORMANCY"
2022-12-08 10:10:19 +00:00
/* 歪斜挡位检测 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_NAME_SKEW_GEAR L"SKEW_GEAR"
2022-12-08 10:10:19 +00:00
/* 分纸强度检测 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_NAME_PAPER_SEPARATION_STRENGTH L"PAPER_SEPARATION_STRENGTH"
2022-12-08 10:10:19 +00:00
/* 机械走纸倾斜检测 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_NAME_MECH_PAPER_FEEDING_INCLINATION L"MECH_PAPER_FEEDING_INCLINATION"
/* 单张测试 */
#define HGPDTTOOLDB_NAME_SINGLE_PAGE_TEST L"SINGLE_PAGE_TEST"
2022-12-08 10:10:19 +00:00
/* 压力测试2轮 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_NAME_PRESSUER_TEST L"PRESSUER_TEST"
2022-12-08 10:10:19 +00:00
/* 清除滚轴计数 */
2022-12-31 09:02:23 +00:00
#define HGPDTTOOLDB_NAME_CLEAR_ROLLER_COUNT L"CLEAR_ROLLER_COUNT"
/* 清除历史计数 */
#define HGPDTTOOLDB_NAME_CLEAR_HISTORY_COUNT L"CLEAR_HISTORY_COUNT"
2022-12-31 09:02:23 +00:00
/*压力测试彩色+200dpi*/
#define HGPDTTOOLDB_NAME_PRESSUER_TEST_RGB_200DPI L"PRESSUER_TEST_RGB_200DPI"
/*压力测试灰色+200dpi*/
#define HGPDTTOOLDB_NAME_PRESSUER_TEST_GRAY_200DPI L"PRESSUER_TEST_GRAY_200DPI"
/*压力测试彩色+300dpi*/
#define HGPDTTOOLDB_NAME_PRESSUER_TEST_RGB_300DPI L"PRESSUER_TEST_RGB_300DPI"
/*压力测试灰色+300dpi*/
#define HGPDTTOOLDB_NAME_PRESSUER_TEST_GRAY_300DPI L"PRESSUER_TEST_GRAY_300DPI"
2023-10-13 01:54:59 +00:00
/*压力测试彩色+600dpi*/
#define HGPDTTOOLDB_NAME_PRESSUER_TEST_RGB_600DPI L"PRESSUER_TEST_RGB_600DPI"
/*压力测试灰色+600dpi*/
#define HGPDTTOOLDB_NAME_PRESSUER_TEST_GRAY_600DPI L"PRESSUER_TEST_GRAY_600DPI"
2023-02-15 11:40:08 +00:00
/*获取设备配置*/
#define HGPDTTOOLDB_NAME_GET_DEVICE_CONFIG L"GET_DEVICE_CONFIG"
/*获取设备内存和硬盘容量大小*/
2024-01-19 01:10:31 +00:00
#define HGPDTTOOLDB_NAME_GET_DEVICE_CPU_DISK L"GET_DEVICE_CPU_DISK"
2023-11-02 02:42:55 +00:00
/*备份设备配置*/
#define HGPDTTOOLDB_NAME_BACKUP L"BACKUP"
/*关机*/
#define HGPDTTOOLDB_NAME_SHUTDOWN L"SHUTDOWN"
2024-01-19 01:10:31 +00:00
/*设置固件语言模式*/
#define HGPDTTOOLDB_NAME_SET_FIRMWARE_LANGUAGE L"SET_FIRMWARE_LANGUAGE"
/*图像扫描校正*/
#define HGPDTTOOLDB_NAME_IMAGE_CORRECTION L"IMAGE_CORRECTION"
2024-06-25 14:24:04 +00:00
/*彩色图像扫描校正+200dpi*/
#define HGPDTTOOLDB_NAME_IMAGE_CORRECTION_RGB_200DPI L"IMAGE_CORRECTION_RGB_200DPI"
/*灰度图像扫描校正+200dpi*/
#define HGPDTTOOLDB_NAME_IMAGE_CORRECTION_GRAY_200DPI L"IMAGE_CORRECTION_GRAY_200DPI"
/*彩色图像扫描校正+300dpi*/
#define HGPDTTOOLDB_NAME_IMAGE_CORRECTION_RGB_300DPI L"IMAGE_CORRECTION_RGB_300DPI"
/*灰度图像扫描校正+300dpi*/
#define HGPDTTOOLDB_NAME_IMAGE_CORRECTION_GRAY_300DPI L"IMAGE_CORRECTION_GRAY_300DPI"
/*彩色图像扫描校正+600dpi*/
#define HGPDTTOOLDB_NAME_IMAGE_CORRECTION_RGB_600DPI L"IMAGE_CORRECTION_RGB_600DPI"
/*灰度图像扫描校正+600dpi*/
#define HGPDTTOOLDB_NAME_IMAGE_CORRECTION_GRAY_600DPI L"IMAGE_CORRECTION_GRAY_600DPI"
/*关键项检查*/
#define HGPDTTOOLDB_NAME_KEY_INSPECTION L"KEY_INSPECTION"
2022-12-15 11:53:41 +00:00
2022-12-15 06:39:32 +00:00
#define TEST_DLL
2022-12-08 10:10:19 +00:00
#ifdef TEST_DLL
#define DECL_API(ret) __declspec(dllexport) ret __stdcall
#else
#define DECL_API(ret) __declspec(dllimport) ret __stdcall
#endif
// Function: initialize module
// helper - parameter and testing process callback
DECL_API(int) func_test_init(void* init, ui_helper* helper);
2022-12-31 09:02:23 +00:00
2022-12-30 06:34:20 +00:00
enum write_cat
{
2023-01-03 03:12:53 +00:00
WRITE_CAT_VID_PID = 0, // val = (int*)
2022-12-30 06:34:20 +00:00
WRITE_CAT_SPEED, // val = (int*)
WRITE_CAT_SLEEP, // val = (int*)
2023-03-20 04:11:00 +00:00
WRITE_CAT_SERIALNUM, // val = (wchar_t*)
WRITE_CAT_DEVS_MODEL // val = (wchar_t*)
2022-12-30 06:34:20 +00:00
};
typedef struct _write_cfg
{
enum write_cat cat;
void* val;
}WRITECFG, *LPWRITECFG;
2022-12-08 10:10:19 +00:00
// Function: do ONE function test
//
2022-12-30 06:34:20 +00:00
// Parameter: name - function name. "write-cfg" for write predefined configuration, oper is LPWRITECFG
2022-12-08 10:10:19 +00:00
//
// oper - test operation, "start", "pause", "resume", "stop", ...
//
//
// Return: error code
DECL_API(int) func_test_go(const wchar_t* name // test name
, const wchar_t* oper);
2022-12-08 10:10:19 +00:00
// Function: uninitialize module
DECL_API(int) func_test_uninit(void*);
// Function: do dynamic image correction
//
// Parameter: currentIndex - Get current correct type; 1:200dpi-color; 2:200dpi-gray;3:300dpi-color; 4:300dpi-gray;5:600dpi-color; 6:600dpi-gray;
//
// isSuccess - Explain whether the correction was successful this time.
//
// Return: error code
DECL_API(int) func_test_correct(bool isSuccess, int* currentIndex);
2022-12-08 10:10:19 +00:00
DECL_API(int) func_test_distortion();
2022-12-08 10:10:19 +00:00
class test
2022-12-08 10:10:19 +00:00
{
public:
test(ui_helper* helper);
~test();
2022-12-08 10:10:19 +00:00
std::map<std::wstring, int(test::*)(void*)> test_map_;
std::condition_variable m_waitCorrect;
std::condition_variable m_waitDistortion;
std::mutex m_lock;
ui_helper* helper_;
int fw_;
std::string m_sn;
std::mutex mutex_;
std::condition_variable cv_;
2022-12-08 10:10:19 +00:00
void init_test_map_();
int set_test(const wchar_t* name, const wchar_t* oper);
2022-12-08 10:10:19 +00:00
private:
std::unique_ptr<std::thread> thread_dynamic_correct_handle;
void thread_dynamic_correct(std::string correctData);
2022-12-08 10:10:19 +00:00
std::unique_ptr<std::thread> thread_distortion_handle;
void thread_distortion();
struct CorrectMode
2022-12-08 10:10:19 +00:00
{
int dpi;
bool isColor;
2022-12-08 10:10:19 +00:00
};
2022-12-08 10:10:19 +00:00
std::map<int, CorrectMode> m_correctModeMap
2022-12-08 10:10:19 +00:00
{
{1, CorrectMode{200, true}},
{2, CorrectMode{200, false}},
{3, CorrectMode{300, true}},
{4, CorrectMode{300, false}},
{5, CorrectMode{600, true}},
{6, CorrectMode{600, false}}
};
private:
std::string get_serial_num();
/*设置vid pid*/
int test_set_vidpid(void* data);
/*设置序列号*/
int test_set_serial_num(void* data);
/* 设置休眠 */
int test_dormancy(void* data);
/*获取固件版本号*/
std::string get_firmware_version();
/* 配置速度模式 */
int test_configure_speed_mode(void* data);
int set_init_cfg(void* data);
/*设置序列号*/
int test_set_json_serial_num(void* data);
int test_get_serial_num(void *data);
/* 清理纸道功能确认 */
int tset_clear_paper_path(void* data);
/* 按键功能检测 */
int test_key_funtion(void* data);
/* 计数模式检测 */
int test_count_mode(void* data);
/* 歪斜检测 */
int test_skew_detection(void* data);
/* 分纸电机检测 */
int test_separater_motor(void* data);
/* cis原图初检 */
int test_cis__original_image(void* data);
/* 主机风扇功能检测 */
int test_host_fan(void* data);
/* 扫描工作状态 */
int test_scan_work_status(void* data);
/* USB-PC接口 */
int test_usb_pc_interface(void* data);
/* 超声波模块检验 */
int test_ultrasonic_module(void* data);
/* led灯状态检查 */
int test_led_light(void* data);
/* 复位检查 */
int test_reset(void* data);
/* 走纸检查 */
int test_paper_feed(void* data);
/* 扫描传感器检查 */
int test_scanning_sensor(void* data);
/* 放置校正纸 */
int test_place_correction_paper(void* data);
/* 自动平场校正 */
int test_auto_flat_field(void* data);
/* 重启设备 */
int test_reboot_device(void* data);
/* 扫描图像彩色质量确认 */
int test_image_color_quality(void* data);
/* 扫描图像灰度质量确认 */
int test_image_gray_quality(void* data);
/* 获取自动计算畸变值 */
int test_get_auto_distortion(void* data);
int test_set_auto_distortion(void* data);
int test_confirm_auto_distortion(void* data);
int test_verify_auto_distortion(void* data);
/* 分纸强度检测 */
int test_paper_separation_strength(void* data);
/* 机械走纸倾斜检测 */
int test_mech_paper_feeding_inclination(void* data);
/* 清除滚轴计数 */
int test_clear_roller_count(void* data);
/* 清除历史计数 */
int test_clear_history_count(void* data);
/* 单张测试 */
int test_single_page_test(void* data);
/*压力测试彩色_200dpi*/
int test_pressuer_test_rgb_200dpi(void* data);
/*压力测试灰色_200dpi*/
int test_pressuer_test_gray_200dpi(void* data);
/*压力测试彩色_300dpi*/
int test_pressuer_test_rgb_300dpi(void* data);
/*压力测试灰色_300dpi*/
int test_pressuer_test_gray_300dpi(void* data);
/*压力测试彩色_600dpi*/
int test_pressuer_test_rgb_600dpi(void* data);
/*压力测试灰色_600dpi*/
int test_pressuer_test_gray_600dpi(void* data);
/*获取设备配置*/
int test_get_device_config(void* data);
/*获取设备内存和硬盘容量大小*/
int test_get_device_cpu_disk(void* data);
/* 备份设备配置 */
int test_backup(void* data);
/* 关机 */
int test_shutdown(void* data);
/* 设置固件语言模式 */
int test_set_firmware_language(void* data);
/*设置设备型号*/
int test_set_devs_model(void* data);
/*动态图像校正*/
int public_test_image_correct(std::string correctData, int dpi, bool isColor);
int public_test_image_correct(void* data, int dpi, bool isColor);
int test_image_correct_all(void* data);
int test_image_correct_rgb_200dpi(void* data);
int test_image_correct_gray_200dpi(void* data);
int test_image_correct_rgb_300dpi(void* data);
int test_image_correct_gray_300dpi(void* data);
int test_image_correct_rgb_600dpi(void* data);
int test_image_correct_gray_600dpi(void* data);
2022-12-08 10:10:19 +00:00
};