添加状态消息显示功能

This commit is contained in:
gb 2024-02-20 11:29:26 +08:00
parent 9ba7447d07
commit 3e2ca25e7c
24 changed files with 565 additions and 1043 deletions

View File

@ -373,6 +373,7 @@ void scanner_hw::thread_image_capture(bool paper_ready)
motor_->start(); motor_->start();
scanstream.mode = count_mode_ ? devui::SCAN_COUNT_MODE : devui::SCAN_NORMAL; scanstream.mode = count_mode_ ? devui::SCAN_COUNT_MODE : devui::SCAN_NORMAL;
scanstream.speed = sp_; scanstream.speed = sp_;
scanstream.err = 0;
devui::send_message(devui::UI_STATUS_SCANNING, (uint8_t*)&scanstream, sizeof(scanstream)); devui::send_message(devui::UI_STATUS_SCANNING, (uint8_t*)&scanstream, sizeof(scanstream));
while(scanning_) // auto scan cycle ... while(scanning_) // auto scan cycle ...
{ {
@ -469,8 +470,9 @@ void scanner_hw::thread_image_capture(bool paper_ready)
} }
{ {
uint8_t scan = devui::SCAN_PAUSED; scanstream.err = err;
devui::send_message(devui::UI_STATUS_SCANNING, &scan, sizeof(scan)); scanstream.mode = devui::SCAN_PAUSED;
devui::send_message(devui::UI_STATUS_SCANNING, (uint8_t*)&scanstream, sizeof(scanstream));
} }
if(!auto_scan_ || !scanning_) if(!auto_scan_ || !scanning_)
@ -510,11 +512,12 @@ void scanner_hw::thread_image_capture(bool paper_ready)
retrieve_v4l2_mem(&avail_mem, &used_v4l2_mem); retrieve_v4l2_mem(&avail_mem, &used_v4l2_mem);
std::this_thread::sleep_for(std::chrono::milliseconds(5)); std::this_thread::sleep_for(std::chrono::milliseconds(5));
} }
utils::to_log(LOG_LEVEL_DEBUG, "scanning thread exited.\n"); utils::to_log(LOG_LEVEL_DEBUG, "scanning thread exited with error: %d.\n", err);
{ {
uint8_t scan = devui::SCAN_STOPPED; scanstream.err = err;
devui::send_message(devui::UI_STATUS_SCANNING, &scan, sizeof(scan)); scanstream.mode = devui::SCAN_STOPPED;
devui::send_message(devui::UI_STATUS_SCANNING, (uint8_t*)&scanstream, sizeof(scanstream));
} }
scanning_ = false; scanning_ = false;
@ -877,7 +880,11 @@ int scanner_hw::start_scan(void)
utils::to_log(LOG_LEVEL_DEBUG, "start scan: status = 0x%08x.\n", val); utils::to_log(LOG_LEVEL_DEBUG, "start scan: status = 0x%08x.\n", val);
if (((SMBSTATUS*)&val)->open_machine) // 0x700fe if (((SMBSTATUS*)&val)->open_machine) // 0x700fe
{
devui::send_status_message(ID_WORDS_STATUS_COVER_OPEN);
return DEV_ERR(COVER_OPENNED); return DEV_ERR(COVER_OPENNED);
}
if(!motor_->read(MB_PORT_MODE, val)) if(!motor_->read(MB_PORT_MODE, val))
return DEV_ERR(GET_STATUS_FAILED); return DEV_ERR(GET_STATUS_FAILED);
@ -885,11 +892,19 @@ int scanner_hw::start_scan(void)
utils::to_log(LOG_LEVEL_DEBUG, "start scan: mode-status = 0x%08x.\n", val); utils::to_log(LOG_LEVEL_DEBUG, "start scan: mode-status = 0x%08x.\n", val);
if(((SMBMODE*)&val)->paper_jammed_in || if(((SMBMODE*)&val)->paper_jammed_in ||
((SMBMODE*)&val)->paper_jammed_out) ((SMBMODE*)&val)->paper_jammed_out)
{
devui::send_status_message(ID_WORDS_STATUS_JAMMED);
return DEV_ERR(PAPER_JAMMED); return DEV_ERR(PAPER_JAMMED);
}
bool paperok = ((SMBMODE*)&val)->feeding_paper_ready; bool paperok = ((SMBMODE*)&val)->feeding_paper_ready;
if(!paperok && !auto_scan_) if(!paperok && !auto_scan_)
{
devui::send_status_message(ID_WORDS_STATUS_NO_PAPER);
return DEV_ERR(NO_PAPER); return DEV_ERR(NO_PAPER);
}
scanning_ = true; scanning_ = true;
mb_events_.clear(); mb_events_.clear();

View File

@ -4,14 +4,10 @@
#include <uart/PinMonitor.h> #include <uart/PinMonitor.h>
#include "../uart/uartregsaccess.h" #include "../uart/uartregsaccess.h"
#include <iomanip> #include <iomanip>
// #include "StateControl.h"
// #include "MotorConfig.h"
#include <bitset> #include <bitset>
// #include "SensorConfig.h"
#include <base/utils.h> #include <base/utils.h>
#include <base/ui.h> #include <base/ui.h>
#include "../../ui/Displaydef.h"
#define MOTOR_UART "/dev/ttyS4" #define MOTOR_UART "/dev/ttyS4"
@ -453,7 +449,7 @@ void MotorBoard::pin_call(unsigned int pinNum)
if((val & 0x4) ||(val & 0x02000000)) if((val & 0x4) ||(val & 0x02000000))
{ {
if(val & 0x4){ if(val & 0x4){
PutMsg((int)DisType::Dis_Err_CoverOpen, 0, (int)ClearScreen::All); PutMsg(STATUS_WORDS_ID(COVER_OPEN), devui::ALIGN_COMPONENT_MID, devui::ALIGN_COMPONENT_MID);
set_auto_paper(false,false); set_auto_paper(false,false);
autopaperkeystop?autopaperkeystop():void(0); autopaperkeystop?autopaperkeystop():void(0);
// if(m_statecontrol){ // if(m_statecontrol){
@ -462,13 +458,15 @@ void MotorBoard::pin_call(unsigned int pinNum)
// } // }
} }
else{ else{
PutMsg((int)DisType::Dis_Idel,0,(int)ClearScreen::All); // PutMsg(STATUS_WORDS_ID(READY), devui::ALIGN_COMPONENT_MID, devui::ALIGN_COMPONENT_MID);
// m_statecontrol?m_statecontrol->setcoverstate(false):void(); // m_statecontrol?m_statecontrol->setcoverstate(false):void();
printf("pin_call(%x)\n", val);
} }
return; return;
} }
// if(smb_status->double_clean_f) // if(smb_status->double_clean_f)
PutMsg((int)DisType::Dis_Idel,0,(int)ClearScreen::All); // PutMsg(STATUS_WORDS_ID(READY), devui::ALIGN_COMPONENT_MID, devui::ALIGN_COMPONENT_MID);
printf("pin_call(%x)\n", val);
return; return;
} }
else else
@ -481,7 +479,6 @@ void MotorBoard::pin_call(unsigned int pinNum)
SMBMODE smbmode = *(SMBMODE*)&papercount; SMBMODE smbmode = *(SMBMODE*)&papercount;
printf("paper in arm count = %d ,motorcount = %d\n",++countindex,smbmode.scan_num); printf("paper in arm count = %d ,motorcount = %d\n",++countindex,smbmode.scan_num);
startcapimage(true); startcapimage(true);
PutMsg((int)DisType::Dis_Scan_Page, smbmode.scan_num,(int)ClearScreen::BOT);
} }
if(s->paper_left) if(s->paper_left)
{ {
@ -603,37 +600,35 @@ void MotorBoard::start_countmode()
} }
void MotorBoard::PutMsg(int type, int value, int clearscreen) void MotorBoard::PutMsg(int words, int align_v, int align_h, int font, int clear_method)
{ {
// if(m_statecontrol.get()) devui::send_status_message(words, align_h, align_v, font, clear_method);
// m_statecontrol->PutMsg(type,value,clearscreen);
// devui::send_message(type, clearscreen, value);
} }
void MotorBoard::errormsg(uint value) void MotorBoard::errormsg(uint value)
{ {
if(value & 0x4) if(value & 0x4)
PutMsg((int)DisType::Dis_Err_CoverOpen,0,(int)ClearScreen::All); PutMsg(STATUS_WORDS_ID(COVER_OPEN), devui::ALIGN_COMPONENT_MID, devui::ALIGN_COMPONENT_MID);
else if (value & 0x2) else if (value & 0x2)
PutMsg((int)DisType::Dis_Err_NoPaper,0,(int)ClearScreen::All); PutMsg(STATUS_WORDS_ID(NO_PAPER), devui::ALIGN_COMPONENT_MID, devui::ALIGN_COMPONENT_MID);
else if (value & 0x8) else if (value & 0x8)
PutMsg((int)DisType::Dis_Err_FeedError,0,(int)ClearScreen::All); PutMsg(STATUS_WORDS_ID(FEED_ERR), devui::ALIGN_COMPONENT_MID, devui::ALIGN_COMPONENT_MID);
// else if (value & 0x10) // else if (value & 0x10)
// PutMsg((int)DisType::Dis_Err_JamIn,0,(int)ClearScreen::All); // PutMsg((int)DisType::Dis_Err_JamIn,devui::ALIGN_COMPONENT_MID, devui::ALIGN_COMPONENT_MID);
else if (value & 0x20) else if (value & 0x20)
PutMsg((int)DisType::Dis_Err_DoubleFeed,0,(int)ClearScreen::All); PutMsg(STATUS_WORDS_ID(DOUBLE_FEED), devui::ALIGN_COMPONENT_MID, devui::ALIGN_COMPONENT_MID);
else if (value & 0x40) else if (value & 0x40)
PutMsg((int)DisType::Dis_Err_Stable,0,(int)ClearScreen::All); PutMsg(STATUS_WORDS_ID(STAPLE), devui::ALIGN_COMPONENT_MID, devui::ALIGN_COMPONENT_MID);
else if (value & 0x80) else if (value & 0x80)
PutMsg((int)DisType::Dis_Err_PaperScrew,0,(int)ClearScreen::All); PutMsg(STATUS_WORDS_ID(ASKEW), devui::ALIGN_COMPONENT_MID, devui::ALIGN_COMPONENT_MID);
else if (value & 0x00010000) else if (value & 0x00010000)
PutMsg((int)DisType::Dis_Err_AqrImgTimeout,0,(int)ClearScreen::All); PutMsg(STATUS_WORDS_ID(CIS_TIMEOUT), devui::ALIGN_COMPONENT_MID, devui::ALIGN_COMPONENT_MID);
else if((value & 0x1000010) == 0x1000010) else if((value & 0x1000010) == 0x1000010)
PutMsg((int)DisType::Dis_Err_JamIn,3,(int)ClearScreen::All); PutMsg(STATUS_WORDS_ID(JAMMED), devui::ALIGN_COMPONENT_MID, devui::ALIGN_COMPONENT_MID);
else if((value & 0x800010) == 0x800010) else if((value & 0x800010) == 0x800010)
PutMsg((int)DisType::Dis_Err_JamIn,2,(int)ClearScreen::All); PutMsg(STATUS_WORDS_ID(JAMMED), devui::ALIGN_COMPONENT_MID, devui::ALIGN_COMPONENT_MID);
else if((value & 0x400010) == 0x400010) else if((value & 0x400010) == 0x400010)
PutMsg((int)DisType::Dis_Err_JamIn,1,(int)ClearScreen::All); PutMsg(STATUS_WORDS_ID(JAMMED), devui::ALIGN_COMPONENT_MID, devui::ALIGN_COMPONENT_MID);
} }
void MotorBoard::SetKeyState(bool value) void MotorBoard::SetKeyState(bool value)
@ -726,7 +721,8 @@ void MotorBoard::init_statecontrol()
// set_auto_paper(false,false); // set_auto_paper(false,false);
// }); // });
init_sensor_duty(); init_sensor_duty();
PutMsg((int)DisType::Dis_Idel,0,(int)ClearScreen::All); // PutMsg(STATUS_WORDS_ID(READY), devui::ALIGN_COMPONENT_MID, devui::ALIGN_COMPONENT_MID);
printf("init_statecontrol()\n");
} }
void MotorBoard::release_statecontrol() void MotorBoard::release_statecontrol()

View File

@ -8,6 +8,7 @@
#include <math.h> #include <math.h>
#include <vector> #include <vector>
#include <atomic> #include <atomic>
#include <base/ui.h>
//static std::vector<std::uint32_t> frep_cfg(int a,int b,float k,int s) //static std::vector<std::uint32_t> frep_cfg(int a,int b,float k,int s)
static std::vector<std::uint32_t> frep_cfg(int finalPeriod, int Fmin, float stepnum, float a, float offset, float finalDelay,float acceleration_time) static std::vector<std::uint32_t> frep_cfg(int finalPeriod, int Fmin, float stepnum, float a, float offset, float finalDelay,float acceleration_time)
@ -254,7 +255,7 @@ public:
bool set_time_error(int value); bool set_time_error(int value);
void start_countmode(); void start_countmode();
std::shared_ptr<IRegsAccess> regs(); std::shared_ptr<IRegsAccess> regs();
void PutMsg(int type, int value, int clearscreen); void PutMsg(int words, int align_v, int align_h, int font = 16, int clear_method = devui::CLEAR_ALL);
void SetKeyState(bool value); void SetKeyState(bool value);
void set_freq(int motor_choose,int speedmode,int colormode,int dpi); void set_freq(int motor_choose,int speedmode,int colormode,int dpi);
void set_keystopenable(bool value); void set_keystopenable(bool value);

View File

@ -57,10 +57,10 @@ imgproc_mgr::imgproc_mgr(std::function<void(data_source_ptr)> sender
workers_.stop(thread_name); workers_.stop(thread_name);
add_busy_worker(-1); add_busy_worker(-1);
printf("\nrestart imgproc_mgr::thread_worker\n\n"); printf("\nrestart imgproc_mgr::thread_worker\n\n");
workers_.start(thrd, "imgproc_mgr::thread_worker", (void*)&imgproc_mgr::thread_worker); workers_.start(thrd, SIZE_MB(0), "imgproc_mgr::thread_worker", (void*)&imgproc_mgr::thread_worker);
}; };
workers_.set_exception_handler(restart); workers_.set_exception_handler(restart);
workers_.start(thrd, "imgproc_mgr::thread_worker", (void*)&imgproc_mgr::thread_worker); workers_.start(thrd, SIZE_MB(0), "imgproc_mgr::thread_worker", (void*)&imgproc_mgr::thread_worker);
} }
imgproc_mgr::~imgproc_mgr() imgproc_mgr::~imgproc_mgr()
{ {

View File

@ -120,8 +120,8 @@ void record_malloc(bool enable)
async_scanner::async_scanner() : usb_(nullptr), cfg_mgr_(nullptr), scan_id_(0) async_scanner::async_scanner() : usb_(nullptr), cfg_mgr_(nullptr), scan_id_(0)
{ {
utils::init_log(LOG_TYPE_FILE); utils::init_log(LOG_TYPE_FILE);
utils::to_log(LOG_LEVEL_DEBUG, "System info: page-size = %u, mapping-page-size = %u, disk-cluster-size = %u.\n" utils::to_log(LOG_LEVEL_DEBUG, "System info: page-size = %u, mapping-page-size = %u, disk-cluster-size = %u, default-stack-size = %u.\n"
, global_info::page_size, global_info::page_map_size, global_info::cluster_size); , global_info::page_size, global_info::page_map_size, global_info::cluster_size, global_info::stack_size);
init(); init();
auto bulk_handle = [&](dyn_mem_ptr data, uint32_t* used, packet_data_base_ptr* required) -> dyn_mem_ptr auto bulk_handle = [&](dyn_mem_ptr data, uint32_t* used, packet_data_base_ptr* required) -> dyn_mem_ptr

View File

@ -183,6 +183,7 @@ extern uint64_t GetCurrentThreadId(void);
#define FSEEK _fseeki64 #define FSEEK _fseeki64
#define FTELL _ftelli64 #define FTELL _ftelli64
#define pid_t int #define pid_t int
#define pthread_t HANDLE
#endif #endif

View File

@ -54,7 +54,7 @@ namespace devui
} }
}; };
worker_.start(r, "worker", (void*)&pipe_reader::worker); worker_.start(r, SIZE_MB(1), "worker", (void*)&pipe_reader::worker);
} }
protected: protected:
virtual ~pipe_reader() virtual ~pipe_reader()
@ -134,7 +134,7 @@ namespace devui
} }
}; };
worker_.start(r, "worker", (void*)&pipe_sender::worker); worker_.start(r, SIZE_MB(1), "worker", (void*)&pipe_sender::worker);
} }
protected: protected:
virtual ~pipe_sender() virtual ~pipe_sender()
@ -217,8 +217,8 @@ namespace devui
{ {
sender(); sender();
}; };
workers_.start(r, "receiver"); workers_.start(r, SIZE_MB(1), "receiver");
workers_.start(s, "sender"); workers_.start(s, SIZE_MB(1), "sender");
} }
} }
void close(void) void close(void)
@ -381,4 +381,17 @@ namespace devui
return ret; return ret;
} }
bool send_status_message(uint32_t msgid, int align_h, int align_v, int font, int clears)
{
devui::STATMSG msg;
msg.msg_words_id = msgid;
msg.align_h = align_h;
msg.align_v = align_v;
msg.clear = clears;
msg.font = font;
msg.reserved = 0;
return send_message(devui::UI_STATUS_MESSAGE, (uint8_t*)&msg, sizeof(msg));
}
}; };

View File

@ -25,6 +25,19 @@ namespace devui
UI_STATUS_SCANNING = 0x1000, // begin scanning. data: (LPSCANSTREAM) UI_STATUS_SCANNING = 0x1000, // begin scanning. data: (LPSCANSTREAM)
UI_STATUS_PAPER_CNT, // ONE paper has pass through. data: (uint32_t*)milliseconds for paper pass through UI_STATUS_PAPER_CNT, // ONE paper has pass through. data: (uint32_t*)milliseconds for paper pass through
UI_STATUS_MESSAGE, // status message, hold screen. data: LPSTATMSG
};
enum align_component
{
ALIGN_COMPONENT_HEAD = 0,
ALIGN_COMPONENT_MID,
ALIGN_COMPONENT_TAIL,
};
enum clear_method
{
CLEAR_NONE = 0, // no clear
CLEAR_ALL, // clear all screen
CLEAR_LINE, // clear the lines which the content will output
}; };
#pragma pack(push) #pragma pack(push)
@ -46,13 +59,24 @@ namespace devui
}MSGSTREAM, *LPMSGSTREAM; }MSGSTREAM, *LPMSGSTREAM;
typedef struct _scan_stream typedef struct _scan_stream
{ {
uint8_t mode; // see enum scan uint32_t mode : 5; // see enum scan
uint32_t speed; uint32_t speed : 27;
uint32_t err;
}SCANSTREAM, *LPSCANSTREAM; }SCANSTREAM, *LPSCANSTREAM;
typedef struct _status_msg
{
uint32_t msg_words_id; // words.h
uint32_t align_h : 3; // align_component
uint32_t align_v : 3; // align_component
uint32_t clear : 4; // clear screen method
uint32_t font : 8; // font size
uint32_t reserved : 14;
}STATMSG, *LPSTATMSG;
#pragma pack(pop) #pragma pack(pop)
void init_ui(std::function<void(LPMSGSTREAM)> uicb, bool ui); void init_ui(std::function<void(LPMSGSTREAM)> uicb, bool ui);
void uninit_ui(void); void uninit_ui(void);
bool send_message(uint32_t msgid, uint8_t* data = nullptr, uint8_t size = 0); // re-init if return false bool send_message(uint32_t msgid, uint8_t* data = nullptr, uint8_t size = 0); // re-init if return false
bool send_status_message(uint32_t msgid, int align_h = ALIGN_COMPONENT_MID, int align_v = ALIGN_COMPONENT_MID, int font = 16, int clears = CLEAR_ALL);
}; };

View File

@ -991,6 +991,26 @@ namespace utils
return str.c_str(); return str.c_str();
} }
int get_stack_size(void)
{
int size = 0;
#if OS_WIN
ULONG_PTR low = 0, up = 0;
GetCurrentThreadStackLimits(&low, &up);
size = up - low;
#else
pthread_attr_t attr;
pthread_getattr_np(pthread_self(), &attr);
// pthread_attr_init(&attr);
pthread_attr_getstacksize(&attr, (size_t*)&size);
pthread_attr_destroy(&attr);
#endif
return size;
}
static bool hex_str_2_num(char hex, uint8_t* v) static bool hex_str_2_num(char hex, uint8_t* v)
{ {
*v = 0; *v = 0;
@ -1865,6 +1885,7 @@ void chronograph::reset()
uint32_t global_info::page_size = 0; uint32_t global_info::page_size = 0;
uint32_t global_info::page_map_size = 0; uint32_t global_info::page_map_size = 0;
uint32_t global_info::cluster_size = 0; uint32_t global_info::cluster_size = 0;
uint32_t global_info::stack_size = 0;
uint32_t global_info::gray_pallete[] = {0}; uint32_t global_info::gray_pallete[] = {0};
global_info::global_info() global_info::global_info()
@ -1879,7 +1900,9 @@ global_info::global_info()
for(int i = 0; i < _countof(global_info::gray_pallete); ++i) for(int i = 0; i < _countof(global_info::gray_pallete); ++i)
global_info::gray_pallete[i] = MAKELONG(MAKEWORD(i, i), MAKEWORD(i, 0)); global_info::gray_pallete[i] = MAKELONG(MAKEWORD(i, i), MAKEWORD(i, 0));
printf("Page size: %u\nMap size: %u\nCluster : %u\n", global_info::page_size, global_info::page_map_size, global_info::cluster_size); path = utils::get_command_result("ulimit -s");
global_info::stack_size = SIZE_KB(atoi(path.c_str()));
printf("Page size: %u\nMap size: %u\nCluster : %u\nStck size: %u\n", global_info::page_size, global_info::page_map_size, global_info::cluster_size, global_info::stack_size);
} }
global_info::~global_info() global_info::~global_info()
{} {}
@ -2292,6 +2315,7 @@ safe_thread::~safe_thread()
void safe_thread::thread_worker(std::function<void(void)> func, std::string name, void* addr) void safe_thread::thread_worker(std::function<void(void)> func, std::string name, void* addr)
{ {
printf("stack size of thread '%s': %u\n", name.c_str(), utils::get_stack_size());
try try
{ {
utils::to_log(LOG_LEVEL_DEBUG, "+++ safe_thread of '%s(addr: %p) - id: %p' is running ...\n", name.c_str(), addr, GetCurrentThreadId()); utils::to_log(LOG_LEVEL_DEBUG, "+++ safe_thread of '%s(addr: %p) - id: %p' is running ...\n", name.c_str(), addr, GetCurrentThreadId());
@ -2321,18 +2345,67 @@ void safe_thread::thread_notify_exception(void)
} }
} }
} }
void* safe_thread::raw_thread(void* lp)
{
safe_thread *obj = ((LPCRAWTHRD)lp)->obj;
std::function<void(void)> func = ((LPCRAWTHRD)lp)->func;
std::string name(((LPCRAWTHRD)lp)->name);
void* addr = ((LPCRAWTHRD)lp)->addr;
delete lp;
obj->thread_worker(func, name, addr);
return 0;
}
void safe_thread::set_exception_handler(std::function<void(const char*)> on_exception) void safe_thread::set_exception_handler(std::function<void(const char*)> on_exception)
{ {
excep_handler_ = on_exception; excep_handler_ = on_exception;
} }
int safe_thread::start(std::function<void(void)> f, const char* thread_name, void* addr) int safe_thread::start(std::function<void(void)> f, std::size_t stack, const char* thread_name, void* addr)
{ {
SAFETHRD st; SAFETHRD st;
st.name = thread_name ? thread_name : ""; st.name = thread_name ? thread_name : "";
st.thread.reset(new std::thread(&safe_thread::thread_worker, this, f, thread_name, addr)); if(stack == 0)
{
st.raw = false;
st.thread.reset(new std::thread(&safe_thread::thread_worker, this, f, thread_name, addr));
}
else
{
// st.thread.reset(new std::thread(std::thread(&safe_thread::thread_worker, this, f, thread_name, addr), std::move(stack)));
LPCRAWTHRD param = new CRAWTHRD;
int err = 0;
param->obj = this;
param->func = f;
param->name = thread_name;
param->addr = addr;
#if OS_WIN
st.thread_raw = CreateThread(NULL, stack, &safe_thread::thread_worker, param, 0, nullptr);
if(!st.thread_raw)
err = GetLastError();
#else
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_setstacksize(&attr, stack);
st.raw = true;
err = pthread_create(&st.thread_raw, &attr, &safe_thread::raw_thread, param);
if(err)
err = errno;
pthread_attr_destroy(&attr);
#endif
if(err)
{
delete param;
return err;
}
}
{ {
SIMPLE_LOCK(lock_); SIMPLE_LOCK(lock_);
threads_.push_back(st); threads_.push_back(st);
@ -2349,8 +2422,20 @@ int safe_thread::stop(const char* thread_name)
{ {
if(!thread_name || threads_[i].name == thread_name) if(!thread_name || threads_[i].name == thread_name)
{ {
if(threads_[i].thread.get() && threads_[i].thread->joinable()) if(threads_[i].raw)
threads_[i].thread->join(); {
#if OS_WIN
WaitForSingleObject(threads_[i].thread_raw, INFINITE);
CloseHandle(threads_[i].thread_raw);
#else
pthread_join(threads_[i].thread_raw, nullptr);
#endif
}
else
{
if(threads_[i].thread.get() && threads_[i].thread->joinable())
threads_[i].thread->join();
}
threads_.erase(threads_.begin() + i); threads_.erase(threads_.begin() + i);
ret = 0; ret = 0;
if(thread_name) if(thread_name)

View File

@ -79,6 +79,8 @@ namespace utils
const char* to_lower(std::string& str); // return str.c_str() const char* to_lower(std::string& str); // return str.c_str()
const char* trim(std::string& str, const char* sp = "\r\n\t "); // return str.c_str() const char* trim(std::string& str, const char* sp = "\r\n\t "); // return str.c_str()
int get_stack_size(void);
bool from_hex_string(const char* hex, uint8_t* val); bool from_hex_string(const char* hex, uint8_t* val);
bool from_hex_string(const char* hex, uint16_t* val); bool from_hex_string(const char* hex, uint16_t* val);
bool from_hex_string(const char* hex, uint32_t* val); bool from_hex_string(const char* hex, uint32_t* val);
@ -314,6 +316,7 @@ public:
static uint32_t page_size; static uint32_t page_size;
static uint32_t page_map_size; static uint32_t page_map_size;
static uint32_t cluster_size; static uint32_t cluster_size;
static uint32_t stack_size;
static uint32_t gray_pallete[256]; static uint32_t gray_pallete[256];
}; };
@ -460,8 +463,10 @@ class safe_thread
{ {
typedef struct _safe_thrd typedef struct _safe_thrd
{ {
bool raw;
std::string name; std::string name;
std::shared_ptr<std::thread> thread; std::shared_ptr<std::thread> thread; // valid when !raw
pthread_t thread_raw; // valid when raw
}SAFETHRD; }SAFETHRD;
volatile bool run_ = true; volatile bool run_ = true;
MUTEX lock_; MUTEX lock_;
@ -473,13 +478,22 @@ class safe_thread
void thread_worker(std::function<void(void)> func, std::string name, void* addr); void thread_worker(std::function<void(void)> func, std::string name, void* addr);
void thread_notify_exception(void); void thread_notify_exception(void);
typedef struct _cr_raw_thread
{
safe_thread* obj;
std::function<void(void)> func;
std::string name;
void* addr;
}CRAWTHRD, *LPCRAWTHRD;
static void* raw_thread(void* lp);
public: public:
safe_thread(void); safe_thread(void);
~safe_thread(); ~safe_thread();
public: public:
void set_exception_handler(std::function<void(const char*)> on_exception = std::function<void(const char*)>()); void set_exception_handler(std::function<void(const char*)> on_exception = std::function<void(const char*)>());
int start(std::function<void(void)> f, const char* thread_name, void* addr = nullptr); int start(std::function<void(void)> f, std::size_t stack = 0, const char* thread_name = nullptr, void* addr = nullptr);
int stop(const char* thread_name); int stop(const char* thread_name);
}; };

141
sdk/base/words.cpp Normal file
View File

@ -0,0 +1,141 @@
#include "words.h"
#define WORDS_AND_ID_IMPL(def, str) \
const char* def = str; \
const int ID_##def = __LINE__;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
WORDS_AND_ID_IMPL(WORDS_COLOR_COLOR, "\345\275\251\350\211\262");
WORDS_AND_ID_IMPL(WORDS_COLOR_GRAY, "\347\201\260\345\272\246");
WORDS_AND_ID_IMPL(WORDS_PAPER_ORIGIN_SIZE, "\345\214\271\351\205\215\345\216\237\345\247\213\345\260\272\345\257\270");
WORDS_AND_ID_IMPL(WORDS_PAPER_MAX_SIZE_CROP, "\346\234\200\345\244\247\346\211\253\346\217\217\345\260\272\345\257\270\350\207\252\345\212\250\350\243\201\345\210\207");
WORDS_AND_ID_IMPL(WORDS_FORBIDDEN, "\347\246\201\347\224\250");
WORDS_AND_ID_IMPL(WORDS_SCAN_CONTINUOUS, "\350\277\236\347\273\255\346\211\253\346\217\217");
WORDS_AND_ID_IMPL(WORDS_FILLBG_CONVEX, "\345\207\270\345\244\232\350\276\271\345\275\242");
WORDS_AND_ID_IMPL(WORDS_MENU_WELCOME, "\346\254\242\350\277\216");
WORDS_AND_ID_IMPL(WORDS_MENU_SELECTED, "\342\210\232");
WORDS_AND_ID_IMPL(WORDS_MENU_RETURN, "\350\277\224\345\233\236\344\270\212\347\272\247\350\217\234\345\215\225");
WORDS_AND_ID_IMPL(WORDS_MENU_SEPARATE_STRENGTH, "\345\210\206\347\272\270\345\274\272\345\272\246");
WORDS_AND_ID_IMPL(WORDS_MENU_LOW, "\344\275\216");
WORDS_AND_ID_IMPL(WORDS_MENU_MID, "\344\270\255");
WORDS_AND_ID_IMPL(WORDS_MENU_HIGH, "\351\253\230");
WORDS_AND_ID_IMPL(WORDS_MENU_POWER, "\344\274\221\347\234\240\346\227\266\351\227\264");
WORDS_AND_ID_IMPL(WORDS_MENU_SLEEP_NONE, "\344\270\215\344\274\221\347\234\240");
WORDS_AND_ID_IMPL(WORDS_MENU_SLEEP_NOW, "\347\253\213\345\215\263\344\274\221\347\234\240");
WORDS_AND_ID_IMPL(WORDS_MENU_SLEEP_5_MIN, "5min");
WORDS_AND_ID_IMPL(WORDS_MENU_SLEEP_10_MIN, "10min");
WORDS_AND_ID_IMPL(WORDS_MENU_SLEEP_20_MIN, "20min");
WORDS_AND_ID_IMPL(WORDS_MENU_SLEEP_30_MIN, "30min");
WORDS_AND_ID_IMPL(WORDS_MENU_SLEEP_1_HOUR, "1h");
WORDS_AND_ID_IMPL(WORDS_MENU_SLEEP_2_HOUR, "2h");
WORDS_AND_ID_IMPL(WORDS_MENU_SLEEP_4_HOUR, "4h");
WORDS_AND_ID_IMPL(WORDS_MENU_LIFTER_POS, "\345\215\207\351\231\215\345\217\260\344\275\215\347\275\256");
WORDS_AND_ID_IMPL(WORDS_MENU_COUNT_MODE, "\350\256\241\346\225\260\346\250\241\345\274\217");
WORDS_AND_ID_IMPL(WORDS_MENU_MANUAL_MODE, "\346\211\213\345\212\250\346\250\241\345\274\217");
WORDS_AND_ID_IMPL(WORDS_MENU_CLEAR_PASSWAY, "\346\270\205\347\220\206\347\272\270\351\201\223");
WORDS_AND_ID_IMPL(WORDS_MENU_HISTORY_COUNT, "\345\216\206\345\217\262\345\274\240\346\225\260");
WORDS_AND_ID_IMPL(WORDS_MENU_ROLLER_COUNT, "\346\273\232\350\275\264\345\274\240\346\225\260");
WORDS_AND_ID_IMPL(WORDS_MENU_RESET_ROLLOER_CNT, "\346\270\205\351\231\244\346\273\232\350\275\264\345\274\240\346\225\260");
WORDS_AND_ID_IMPL(WORDS_MENU_SHUTDOWN, "\345\205\263\346\234\272");
WORDS_AND_ID_IMPL(WORDS_MENU_YES, "\347\241\256\345\256\232");
WORDS_AND_ID_IMPL(WORDS_MENU_NO, "\345\217\226\346\266\210");
WORDS_AND_ID_IMPL(WORDS_FUNCTION_COUNT, "\345\274\240\346\225\260\357\274\232");
WORDS_AND_ID_IMPL(WORDS_STATUS_READY, "\345\260\261\347\273\252");
WORDS_AND_ID_IMPL(WORDS_STATUS_SCANNING_NORMAL, "\346\255\243\345\234\250\346\211\253\346\217\217\342\200\246");
WORDS_AND_ID_IMPL(WORDS_STATUS_SCANNING_COUNT, "\346\255\243\345\234\250\350\256\241\346\225\260\346\211\253\346\217\217\342\200\246");
WORDS_AND_ID_IMPL(WORDS_STATUS_TOTAL, "\346\200\273\357\274\232");
WORDS_AND_ID_IMPL(WORDS_STATUS_NO_PAPER, "\346\227\240\347\272\270");
WORDS_AND_ID_IMPL(WORDS_STATUS_COVER_OPEN, "\347\233\226\346\235\277\346\211\223\345\274\200");
WORDS_AND_ID_IMPL(WORDS_STATUS_FEED_ERR, "\346\220\223\347\272\270\345\244\261\350\264\245");
WORDS_AND_ID_IMPL(WORDS_STATUS_DOUBLE_FEED, "\346\243\200\346\265\213\345\210\260\345\217\214\345\274\240");
WORDS_AND_ID_IMPL(WORDS_STATUS_STAPLE, "\346\243\200\346\265\213\345\210\260\351\222\211\344\271\246\351\222\211");
WORDS_AND_ID_IMPL(WORDS_STATUS_ASKEW, "\347\272\270\345\274\240\346\255\252\346\226\234");
WORDS_AND_ID_IMPL(WORDS_STATUS_CIS_TIMEOUT, "\345\217\226\345\233\276\350\266\205\346\227\266");
WORDS_AND_ID_IMPL(WORDS_STATUS_JAMMED, "\345\215\241\347\272\270");
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
#define RETURN_ID_STR(val, def) \
if(val == ID_##def) \
return def;
const char* words_from_id(int id)
{
RETURN_ID_STR(id, WORDS_COLOR_COLOR);
RETURN_ID_STR(id, WORDS_COLOR_GRAY);
RETURN_ID_STR(id, WORDS_PAPER_ORIGIN_SIZE);
RETURN_ID_STR(id, WORDS_PAPER_MAX_SIZE_CROP);
RETURN_ID_STR(id, WORDS_FORBIDDEN);
RETURN_ID_STR(id, WORDS_SCAN_CONTINUOUS);
RETURN_ID_STR(id, WORDS_FILLBG_CONVEX);
RETURN_ID_STR(id, WORDS_MENU_WELCOME);
RETURN_ID_STR(id, WORDS_MENU_SELECTED);
RETURN_ID_STR(id, WORDS_MENU_RETURN);
RETURN_ID_STR(id, WORDS_MENU_SEPARATE_STRENGTH);
RETURN_ID_STR(id, WORDS_MENU_LOW);
RETURN_ID_STR(id, WORDS_MENU_MID);
RETURN_ID_STR(id, WORDS_MENU_HIGH);
RETURN_ID_STR(id, WORDS_MENU_POWER);
RETURN_ID_STR(id, WORDS_MENU_SLEEP_NONE);
RETURN_ID_STR(id, WORDS_MENU_SLEEP_NOW);
RETURN_ID_STR(id, WORDS_MENU_SLEEP_5_MIN);
RETURN_ID_STR(id, WORDS_MENU_SLEEP_10_MIN);
RETURN_ID_STR(id, WORDS_MENU_SLEEP_20_MIN);
RETURN_ID_STR(id, WORDS_MENU_SLEEP_30_MIN);
RETURN_ID_STR(id, WORDS_MENU_SLEEP_1_HOUR);
RETURN_ID_STR(id, WORDS_MENU_SLEEP_2_HOUR);
RETURN_ID_STR(id, WORDS_MENU_SLEEP_4_HOUR);
RETURN_ID_STR(id, WORDS_MENU_LIFTER_POS);
RETURN_ID_STR(id, WORDS_MENU_COUNT_MODE);
RETURN_ID_STR(id, WORDS_MENU_MANUAL_MODE);
RETURN_ID_STR(id, WORDS_MENU_CLEAR_PASSWAY);
RETURN_ID_STR(id, WORDS_MENU_HISTORY_COUNT);
RETURN_ID_STR(id, WORDS_MENU_ROLLER_COUNT);
RETURN_ID_STR(id, WORDS_MENU_RESET_ROLLOER_CNT);
RETURN_ID_STR(id, WORDS_MENU_SHUTDOWN);
RETURN_ID_STR(id, WORDS_MENU_YES);
RETURN_ID_STR(id, WORDS_MENU_NO);
RETURN_ID_STR(id, WORDS_FUNCTION_COUNT);
RETURN_ID_STR(id, WORDS_STATUS_READY);
RETURN_ID_STR(id, WORDS_STATUS_SCANNING_NORMAL);
RETURN_ID_STR(id, WORDS_STATUS_SCANNING_COUNT);
RETURN_ID_STR(id, WORDS_STATUS_TOTAL);
RETURN_ID_STR(id, WORDS_STATUS_NO_PAPER);
RETURN_ID_STR(id, WORDS_STATUS_COVER_OPEN);
RETURN_ID_STR(id, WORDS_STATUS_FEED_ERR);
RETURN_ID_STR(id, WORDS_STATUS_DOUBLE_FEED);
RETURN_ID_STR(id, WORDS_STATUS_STAPLE);
RETURN_ID_STR(id, WORDS_STATUS_ASKEW);
RETURN_ID_STR(id, WORDS_STATUS_CIS_TIMEOUT);
RETURN_ID_STR(id, WORDS_STATUS_JAMMED);
return "";
}

View File

@ -3,52 +3,83 @@
// Date: 2024-01-24 // Date: 2024-01-24
#pragma once #pragma once
#define WORDS_COLOR_COLOR "\345\275\251\350\211\262" #define WORDS_AND_ID_DECL(def) \
#define WORDS_COLOR_GRAY "\347\201\260\345\272\246" extern const char* def; \
extern const int ID_##def;
#define WORDS_PAPER_ORIGIN_SIZE "\345\214\271\351\205\215\345\216\237\345\247\213\345\260\272\345\257\270"
#define WORDS_PAPER_MAX_SIZE_CROP "\346\234\200\345\244\247\346\211\253\346\217\217\345\260\272\345\257\270\350\207\252\345\212\250\350\243\201\345\210\207"
#define WORDS_FORBIDDEN "\347\246\201\347\224\250" #define WORDS_STR(tail) WORDS_##tail
#define WORDS_ID(tail) ID_WORDS_##tail
#define WORDS_SCAN_CONTINUOUS "\350\277\236\347\273\255\346\211\253\346\217\217" #define MENU_WORDS_STR(tail) WORDS_MENU_##tail
#define MENU_WORDS_ID(tail) ID_WORDS_MENU_##tail
#define WORDS_FILLBG_CONVEX "\345\207\270\345\244\232\350\276\271\345\275\242" #define STATUS_WORDS_STR(tail) WORDS_STATUS_##tail
#define STATUS_WORDS_ID(tail) ID_WORDS_STATUS_##tail
#define WORDS_MENU_WELCOME "\346\254\242\350\277\216" ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#define WORDS_MENU_SELECTED "\342\210\232" //
#define WORDS_MENU_RETURN "\350\277\224\345\233\236\344\270\212\347\272\247\350\217\234\345\215\225" const char* words_from_id(int id);
#define WORDS_MENU_SEPARATE_STRENGTH "\345\210\206\347\272\270\345\274\272\345\272\246"
#define WORDS_MENU_LOW "\344\275\216"
#define WORDS_MENU_MID "\344\270\255"
#define WORDS_MENU_HIGH "\351\253\230"
#define WORDS_MENU_POWER "\344\274\221\347\234\240\346\227\266\351\227\264"
#define WORDS_MENU_SLEEP_NONE "\344\270\215\344\274\221\347\234\240"
#define WORDS_MENU_SLEEP_NOW "\347\253\213\345\215\263\344\274\221\347\234\240"
#define WORDS_MENU_SLEEP_5_MIN "5min"
#define WORDS_MENU_SLEEP_10_MIN "10min"
#define WORDS_MENU_SLEEP_20_MIN "20min"
#define WORDS_MENU_SLEEP_30_MIN "30min"
#define WORDS_MENU_SLEEP_1_HOUR "1h"
#define WORDS_MENU_SLEEP_2_HOUR "2h"
#define WORDS_MENU_SLEEP_4_HOUR "4h"
#define WORDS_MENU_LIFTER_POS "\345\215\207\351\231\215\345\217\260\344\275\215\347\275\256"
#define WORDS_MENU_COUNT_MODE "\350\256\241\346\225\260\346\250\241\345\274\217"
#define WORDS_MENU_MANUAL_MODE "\346\211\213\345\212\250\346\250\241\345\274\217"
#define WORDS_MENU_CLEAR_PASSWAY "\346\270\205\347\220\206\347\272\270\351\201\223"
#define WORDS_MENU_HISTORY_COUNT "\345\216\206\345\217\262\345\274\240\346\225\260"
#define WORDS_MENU_ROLLER_COUNT "\346\273\232\350\275\264\345\274\240\346\225\260"
#define WORDS_MENU_RESET_ROLLOER_CNT "\346\270\205\351\231\244\346\273\232\350\275\264\345\274\240\346\225\260"
#define WORDS_MENU_SHUTDOWN "\345\205\263\346\234\272"
#define WORDS_MENU_YES "\347\241\256\345\256\232"
#define WORDS_MENU_NO "\345\217\226\346\266\210"
#define WORDS_FUNCTION_COUNT "\345\274\240\346\225\260\357\274\232"
#define WORDS_STATUS_READY "\345\260\261\347\273\252"
#define WORDS_STATUS_SCANNING_NORMAL "\346\255\243\345\234\250\346\211\253\346\217\217\342\200\246" ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#define WORDS_STATUS_SCANNING_COUNT "\346\255\243\345\234\250\350\256\241\346\225\260\346\211\253\346\217\217\342\200\246" //
#define WORDS_STATUS_TOTAL "\346\200\273\357\274\232" WORDS_AND_ID_DECL(WORDS_COLOR_COLOR);
WORDS_AND_ID_DECL(WORDS_COLOR_GRAY);
WORDS_AND_ID_DECL(WORDS_PAPER_ORIGIN_SIZE);
WORDS_AND_ID_DECL(WORDS_PAPER_MAX_SIZE_CROP);
WORDS_AND_ID_DECL(WORDS_FORBIDDEN);
WORDS_AND_ID_DECL(WORDS_SCAN_CONTINUOUS);
WORDS_AND_ID_DECL(WORDS_FILLBG_CONVEX);
WORDS_AND_ID_DECL(WORDS_MENU_WELCOME);
WORDS_AND_ID_DECL(WORDS_MENU_SELECTED);
WORDS_AND_ID_DECL(WORDS_MENU_RETURN);
WORDS_AND_ID_DECL(WORDS_MENU_SEPARATE_STRENGTH);
WORDS_AND_ID_DECL(WORDS_MENU_LOW);
WORDS_AND_ID_DECL(WORDS_MENU_MID);
WORDS_AND_ID_DECL(WORDS_MENU_HIGH);
WORDS_AND_ID_DECL(WORDS_MENU_POWER);
WORDS_AND_ID_DECL(WORDS_MENU_SLEEP_NONE);
WORDS_AND_ID_DECL(WORDS_MENU_SLEEP_NOW);
WORDS_AND_ID_DECL(WORDS_MENU_SLEEP_5_MIN);
WORDS_AND_ID_DECL(WORDS_MENU_SLEEP_10_MIN);
WORDS_AND_ID_DECL(WORDS_MENU_SLEEP_20_MIN);
WORDS_AND_ID_DECL(WORDS_MENU_SLEEP_30_MIN);
WORDS_AND_ID_DECL(WORDS_MENU_SLEEP_1_HOUR);
WORDS_AND_ID_DECL(WORDS_MENU_SLEEP_2_HOUR);
WORDS_AND_ID_DECL(WORDS_MENU_SLEEP_4_HOUR);
WORDS_AND_ID_DECL(WORDS_MENU_LIFTER_POS);
WORDS_AND_ID_DECL(WORDS_MENU_COUNT_MODE);
WORDS_AND_ID_DECL(WORDS_MENU_MANUAL_MODE);
WORDS_AND_ID_DECL(WORDS_MENU_CLEAR_PASSWAY);
WORDS_AND_ID_DECL(WORDS_MENU_HISTORY_COUNT);
WORDS_AND_ID_DECL(WORDS_MENU_ROLLER_COUNT);
WORDS_AND_ID_DECL(WORDS_MENU_RESET_ROLLOER_CNT);
WORDS_AND_ID_DECL(WORDS_MENU_SHUTDOWN);
WORDS_AND_ID_DECL(WORDS_MENU_YES);
WORDS_AND_ID_DECL(WORDS_MENU_NO);
WORDS_AND_ID_DECL(WORDS_FUNCTION_COUNT);
WORDS_AND_ID_DECL(WORDS_STATUS_READY);
WORDS_AND_ID_DECL(WORDS_STATUS_SCANNING_NORMAL);
WORDS_AND_ID_DECL(WORDS_STATUS_SCANNING_COUNT);
WORDS_AND_ID_DECL(WORDS_STATUS_TOTAL);
WORDS_AND_ID_DECL(WORDS_STATUS_NO_PAPER);
WORDS_AND_ID_DECL(WORDS_STATUS_COVER_OPEN);
WORDS_AND_ID_DECL(WORDS_STATUS_FEED_ERR);
WORDS_AND_ID_DECL(WORDS_STATUS_DOUBLE_FEED);
WORDS_AND_ID_DECL(WORDS_STATUS_STAPLE);
WORDS_AND_ID_DECL(WORDS_STATUS_ASKEW);
WORDS_AND_ID_DECL(WORDS_STATUS_CIS_TIMEOUT);
WORDS_AND_ID_DECL(WORDS_STATUS_JAMMED);

View File

@ -1,55 +0,0 @@
#include "DisplayCenter.h"
#include "LCDDisplay.h"
DisplayCenter::DisplayCenter() : m_lcd(new LCDDisplay())
,brun(false), m_msgs("DisplayCenter")
{
m_showthread.reset(new std::thread(&DisplayCenter::runloop,this));
m_distype = DisType::Dis_Unkown;
PutMsg(DisType::Dis_Init, code_page_, ClearScreen::All);
}
DisplayCenter::~DisplayCenter()
{
brun = false;
m_msgs.trigger();
if(m_showthread.get()&& m_showthread->joinable())
{
m_showthread->join();
m_showthread.reset();
}
m_msgs.clear();
m_lcd.reset();
}
void DisplayCenter::PutMsg(DisType distype,int pagenum,ClearScreen clearscreen)
{
m_msgs.save({distype,clearscreen,(unsigned int )pagenum,""}, true);
}
void DisplayCenter::ResetMsgQueue()
{
m_msgs.clear();
}
void DisplayCenter::runloop()
{
brun = true;
while (brun)
{
MsgPair msg;
if(m_msgs.take(msg, true))
{
m_distype = msg.distype;
m_lcd->DisplayState(msg.distype, msg.pagenum, msg.clearscree);
}
}
}
DisType DisplayCenter::getcurdistype()
{
return m_distype;
}

View File

@ -1,33 +0,0 @@
#pragma once
#include <thread>
#include <base/utils.h>
#include "Displaydef.h"
class LCDDisplay;
class DisplayCenter
{
int code_page_ = 0;
public:
DisplayCenter();
~DisplayCenter();
void PutMsg(DisType distype,int pagenum,ClearScreen clearscreen);
void ResetMsgQueue();
DisType getcurdistype();
private:
struct MsgPair{
DisType distype;
ClearScreen clearscree;
unsigned int pagenum;
std::string infomsg;
};
void runloop();
private:
safe_fifo<MsgPair> m_msgs;
std::shared_ptr<std::thread> m_showthread;
std::shared_ptr<LCDDisplay> m_lcd;
volatile DisType m_distype;
bool brun;
};

View File

@ -1,70 +0,0 @@
#pragma once
enum class DisType{
Dis_Unkown,
Dis_Init,//启动欢迎界面
Dis_Welcome,
Dis_Idel,//就绪
Dis_Scan,
Dis_Err_JamIn,
Dis_Err_DoubleFeed,
Dis_Err_PaperScrew,
Dis_Err_Stable,
Dis_Err_AqrImgTimeout,
Dis_Err_CoverOpen,
Dis_Err_JamOut,
Dis_Err_HandModeJam,
Dis_Err_FeedError,
Dis_Err_NoPaper,
Dis_Err_DogEar,
Dis_Err_Size,
Dis_Set_PollPaperIntensity,
Dis_Set_PollPI_High,
Dis_Set_PollPI_Mid,
Dis_Set_PollPI_Low,
Dis_Count_Page,
Dis_Scan_Page,
Dis_Set_ClearPaperPass,
Dis_Set_Count,
Dis_Set_SleepMode,
Dis_Set_SleepMode_5M,
Dis_Set_SleepMode_10M,
Dis_Set_SleepMode_20M,
Dis_Set_SleepMode_30M,
Dis_Set_SleepMode_1H,
Dis_Set_SleepMode_2H,
Dis_Set_SleepMode_4H,
Dis_Set_SleepMode_NEVER,
Dis_Set_Poweroff,
Dis_Set_Return,
Dis_HandMode,
Dis_Set_Item_Return,
Dis_Set_TrayPosition,
Dis_Set_TrayPosition_Low,
Dis_Set_TrayPosition_Mid,
Dis_Set_TrayPosition_High,
Dis_Device_Lock,
Dis_Set_ScanNum_Option,
Dis_Set_Get_History_ScanNum,
Dis_Set_Clear_Roller_ScanNum,
Dis_Set_Get_Roller_ScanNum,
Dis_Set_Is_Sure,
Dis_Set_YES,
Dis_Set_No,
};
enum class DisDrawtype
{
DD_All,
DD_TopLeft,
DD_BotRight
};
enum class ClearScreen
{
All,
TOP,
BOT,
};

View File

@ -1,573 +0,0 @@
#pragma once
#include "Displaydef.h"
#include <map>
#include <vector>
/*就绪*/
static unsigned char f_ready[]={
0x04,0xE4,0x25,0x26,0x24,0xE4,0x04,0x20,0x20,0xFF,0x20,0xE2,0x2C,0x20,0x20,0x00,
0x10,0x4B,0x82,0x7E,0x02,0x0B,0x90,0x60,0x1C,0x03,0x00,0x3F,0x40,0x40,0x70,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x20,0x30,0xAC,0x63,0x10,0x20,0x24,0x24,0xA4,0x7F,0x24,0x34,0x28,0x26,0x20,0x00,
0x22,0x67,0x22,0x12,0x12,0x04,0x02,0xFF,0x49,0x49,0x49,0x49,0xFF,0x00,0x00,0x00
};
/*图标*/
static unsigned char f_logo[]={
0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,
0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x03,
0xFF,0xFF,0xFF,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xF0,0xFC,0xFC,
0x3C,0x3F,0x3F,0x3F,0x3C,0x3C,0x3C,0x00,0x00,0x00,0x00,0xC0,0xF0,0xFC,0xFC,0x3C,
0x3F,0x3F,0x3C,0xFC,0xFC,0xF0,0xC0,0x00,0x00,0x00,0x00,0xF0,0xFC,0x3C,0x3F,0x3F,
0x3F,0x3C,0x3C,0x3C,0x00,0x00,0x00,0xC0,0xF0,0xFC,0xFC,0x3F,0x3F,0x3F,0x3F,0x3C,
0x3C,0xFC,0x30,0x00,0x00,0x00,0x00,0x00,0xC3,0xFF,0xFF,0xFF,0xFF,0xFC,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFC,0xC0,0x00,0x00,0x00,0x03,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xF0,0xC0,0xC0,0xC0,0xC0,0xF0,0xFF,0xFF,0x00,0x00,0x00,0x00,
0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0xC0,0xFC,
0xFF,0x3F,0x00,0x03,0xFF,0xFF,0xFC,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x0F,0x00,
0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x00,0xC0,0xFF,0xFF,0x03,0x00,0x00,
0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,0xF0,0x00,0x00,0x0F,0xFF,0xFF,0xF0,0xF0,0xC0,
0xC0,0xC0,0x00,0x00,0x00,0x00,0xFC,0xFF,0x0F,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0xFF,0x03,0x00,0x00,0x3F,0xFF,0xFF,0x00,
0x00,0x00,0x00,0x00,0x00,0xFF,0x03,0x0F,0x3F,0xFF,0xFC,0x00,0x00,0x00,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0x07,0x01,0x01,0x01,0x01,0x07,0xFF,0xFF,0x00,0x00,0x00,0x00,
0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x7F,0x00,0x00,0x80,0xFF,0xFF,
0xF9,0xE0,0xE0,0xE0,0xE0,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0xFF,0xFF,0xFF,0xE0,0x00,
0x00,0x00,0x07,0x07,0x07,0xFF,0xFF,0x00,0x00,0x00,0x01,0xFF,0xFF,0xE0,0x00,0x00,
0x00,0x00,0x00,0x00,0x80,0xFF,0xFF,0x1F,0x00,0x00,0x00,0x00,0x01,0x01,0x07,0x07,
0x1F,0xFF,0xFF,0xF8,0x00,0x00,0x7F,0xFF,0xF8,0x80,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xE0,0xFE,0xFF,0xFF,0xE0,0xE0,0xE0,0xE0,0xF9,0xFF,0xFE,
0x80,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x01,0x1F,0xF8,0x80,0x80,0xFF,0xFF,
0x7F,0x7F,0x7F,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x7F,0x00,0x00,0x00,0x00,
0x01,0x1F,0x7F,0x7E,0x78,0x78,0x7E,0x7E,0x1F,0x07,0x00,0x00,0x60,0x7F,0x1F,0x07,
0x01,0x01,0x01,0x01,0x01,0x01,0x07,0x7F,0x7F,0x60,0x00,0x01,0x07,0x1F,0x1F,0x7E,
0x7E,0x78,0x78,0x78,0x78,0x7F,0x7F,0x00,0x00,0x00,0x00,0x07,0x1F,0x1F,0x7E,0x7E,
0x78,0x78,0x7E,0x7E,0x7F,0x1F,0x01,0x00,0x00,0x00,0x00,0x78,0x78,0x78,0x78,0x7E,
0x7E,0x7F,0x1F,0x01,0x00,0x00,0x00,0x01,0x1F,0x7F,0x7E,0x7E,0x78,0x78,0x78,0x7E,
0x7E,0x1E,0x18,0x00,0x78,0x7F,0x7F,0x07,0x01,0x01,0x01,0x01,0x01,0x01,0x07,0x7F,
0x7F,0x78,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x1F,0x7F,0x7F,0x7F,0x7F
};
/*欢迎使用*/
static unsigned char f_welcome[] = {
0x04,0x24,0x44,0x84,0x64,0x9C,0x40,0x30,0x0F,0xC8,0x08,0x08,0x28,0x18,0x00,0x00,
0x10,0x08,0x06,0x01,0x82,0x4C,0x20,0x18,0x06,0x01,0x06,0x18,0x20,0x40,0x80,0x00,
0x40,0x40,0x42,0xCC,0x00,0x00,0xFC,0x04,0x02,0x00,0xFC,0x04,0x04,0xFC,0x00,0x00,
0x00,0x40,0x20,0x1F,0x20,0x40,0x4F,0x44,0x42,0x40,0x7F,0x42,0x44,0x43,0x40,0x00,
0x80,0x60,0xF8,0x07,0x04,0xE4,0x24,0x24,0x24,0xFF,0x24,0x24,0x24,0xE4,0x04,0x00,
0x00,0x00,0xFF,0x00,0x80,0x81,0x45,0x29,0x11,0x2F,0x41,0x41,0x81,0x81,0x80,0x00,
0x00,0x00,0xFE,0x22,0x22,0x22,0x22,0xFE,0x22,0x22,0x22,0x22,0xFE,0x00,0x00,0x00,
0x80,0x60,0x1F,0x02,0x02,0x02,0x02,0x7F,0x02,0x02,0x42,0x82,0x7F,0x00,0x00,0x00,
};
/*清理纸道*/
static unsigned char f_clearpaperpass[]={
0x10,0x60,0x02,0x8C,0x00,0x44,0x54,0x54,0x54,0x7F,0x54,0x54,0x54,0x44,0x40,0x00,
0x04,0x04,0x7E,0x01,0x00,0x00,0xFF,0x15,0x15,0x15,0x55,0x95,0x7F,0x00,0x00,0x00,
0x04,0x84,0x84,0xFC,0x84,0x84,0x00,0xFE,0x92,0x92,0xFE,0x92,0x92,0xFE,0x00,0x00,
0x20,0x60,0x20,0x1F,0x10,0x10,0x40,0x44,0x44,0x44,0x7F,0x44,0x44,0x44,0x40,0x00,
0x20,0x30,0xAC,0x63,0x30,0x00,0xFC,0x84,0x84,0x84,0xFE,0x82,0x83,0x82,0x80,0x00,
0x22,0x67,0x22,0x12,0x12,0x00,0xFF,0x40,0x20,0x00,0x01,0x0E,0x30,0x40,0xF8,0x00,
0x40,0x40,0x42,0xCC,0x00,0x08,0xE9,0xAA,0xB8,0xA8,0xA8,0xAA,0xE9,0x08,0x00,0x00,
0x00,0x40,0x20,0x1F,0x20,0x40,0x5F,0x4A,0x4A,0x4A,0x4A,0x4A,0x5F,0x40,0x40,0x00
};
/*计数*/
static unsigned char f_countmode[] = {
0x40,0x40,0x42,0xCC,0x00,0x40,0x40,0x40,0x40,0xFF,0x40,0x40,0x40,0x40,0x40,0x00,
0x00,0x00,0x00,0x7F,0x20,0x10,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x90,0x52,0x34,0x10,0xFF,0x10,0x34,0x52,0x80,0x70,0x8F,0x08,0x08,0xF8,0x08,0x00,
0x82,0x9A,0x56,0x63,0x22,0x52,0x8E,0x00,0x80,0x40,0x33,0x0C,0x33,0x40,0x80,0x00
};
static unsigned char f_dogear[] = {
0x10,0x10,0x10,0xFF,0x10,0x90,0x00,0xFC,0x44,0x44,0x44,0xC2,0x43,0x42,0x40,0x00,
0x04,0x44,0x82,0x7F,0x01,0x80,0x60,0x1F,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x20,0x10,0xE8,0x24,0x27,0x24,0x24,0xE4,0x24,0x34,0x2C,0x20,0xE0,0x00,0x00,0x00,
0x80,0x60,0x1F,0x09,0x09,0x09,0x09,0x7F,0x09,0x09,0x49,0x89,0x7F,0x00,0x00,0x00,
};
static unsigned char f_size[] = {
0x00,0x00,0x00,0xFE,0x42,0x42,0x42,0x42,0xC2,0x42,0x42,0x42,0x7E,0x00,0x00,0x00,
0x80,0x40,0x30,0x0F,0x00,0x00,0x00,0x00,0x03,0x0C,0x10,0x20,0x40,0x80,0x80,0x00,
0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xFF,0x10,0x10,0x10,0x10,0x10,0x00,
0x00,0x00,0x00,0x01,0x06,0x00,0x00,0x40,0x80,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x02,0x02,0x02,0x02,0x82,0x42,0xF2,0x0E,0x42,0x82,0x02,0x02,0x02,0x00,0x00,
0x10,0x08,0x04,0x02,0x01,0x00,0x00,0xFF,0x00,0x00,0x00,0x01,0x02,0x0C,0x00,0x00,
0x10,0x08,0x04,0x87,0x6C,0x14,0x84,0x94,0x88,0x87,0x84,0xEC,0x94,0x84,0x84,0x00,
0x04,0x02,0x01,0xFF,0x00,0x00,0x00,0x02,0x0C,0x40,0x80,0x7F,0x00,0x00,0x00,0x00,
};
/*双张*/
static unsigned char f_doublefeed[] = {
0x04,0x34,0xC4,0x04,0xC4,0x3C,0x00,0x04,0xFC,0x04,0x04,0x04,0xC4,0x3C,0x00,0x00,
0x40,0x30,0x0C,0x03,0x0C,0x30,0x80,0x40,0x20,0x13,0x0C,0x13,0x20,0x40,0x80,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x02,0xE2,0x22,0x22,0x3E,0x80,0x80,0xFF,0x80,0xA0,0x90,0x88,0x86,0x80,0x80,0x00,
0x00,0x43,0x82,0x42,0x3E,0x00,0x00,0xFF,0x40,0x21,0x06,0x08,0x10,0x20,0x40,0x00
};
/*订书针*/
static unsigned char f_stable[] = {
0x10,0x10,0xD0,0xFF,0x90,0x50,0x20,0x50,0x4C,0x43,0x4C,0x50,0x20,0x40,0x40,0x00,
0x04,0x03,0x00,0xFF,0x00,0x41,0x44,0x58,0x41,0x4E,0x60,0x58,0x47,0x40,0x40,0x00,
0x10,0x60,0x02,0x8C,0x00,0xFE,0x02,0xF2,0x02,0xFE,0x00,0xF8,0x00,0xFF,0x00,0x00,
0x04,0x04,0x7E,0x01,0x80,0x47,0x30,0x0F,0x10,0x27,0x00,0x47,0x80,0x7F,0x00,0x00,
0x42,0x62,0x52,0x4A,0xC6,0x42,0x52,0x62,0xC2,0x00,0xF8,0x00,0x00,0xFF,0x00,0x00,
0x40,0xC4,0x44,0x44,0x7F,0x24,0x24,0x24,0x20,0x00,0x0F,0x40,0x80,0x7F,0x00,0x00,
0x40,0x40,0x42,0xCC,0x00,0x00,0x04,0x04,0x04,0x04,0xFC,0x04,0x04,0x04,0x04,0x00,
0x00,0x00,0x00,0x7F,0x20,0x10,0x00,0x00,0x40,0x80,0x7F,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x08,0x08,0x08,0x08,0xFF,0x08,0x08,0x08,0xF9,0x02,0x04,0x00,0x00,0x00,
0x01,0x01,0x01,0x01,0x01,0x01,0xFF,0x01,0x01,0x01,0x21,0x41,0x21,0x1F,0x00,0x00,
0x40,0x20,0x38,0xE7,0x24,0x24,0x44,0x40,0x40,0x40,0xFF,0x40,0x40,0x40,0x40,0x00,
0x01,0x01,0x01,0x7F,0x21,0x11,0x09,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,
};
/*开盖*/
static unsigned char f_coveropen[] = {
0x40,0x40,0x42,0xCC,0x00,0x40,0xA0,0x9E,0x82,0x82,0x82,0x9E,0xA0,0x20,0x20,0x00,
0x00,0x00,0x00,0x3F,0x90,0x88,0x40,0x43,0x2C,0x10,0x28,0x46,0x41,0x80,0x80,0x00,
0x80,0x90,0x90,0x48,0x4C,0x57,0x24,0x24,0x24,0x54,0x4C,0x44,0x80,0x80,0x80,0x00,
0x00,0x00,0x00,0xFF,0x49,0x49,0x49,0x7F,0x49,0x49,0x49,0xFF,0x00,0x00,0x00,0x00,
0x80,0x82,0x82,0x82,0xFE,0x82,0x82,0x82,0x82,0x82,0xFE,0x82,0x82,0x82,0x80,0x00,
0x00,0x80,0x40,0x30,0x0F,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,
0x00,0x04,0x24,0x24,0x25,0x26,0x24,0xFC,0x24,0x26,0x25,0x24,0x24,0x04,0x00,0x00,
0x81,0x81,0xF9,0x89,0x89,0xF9,0x89,0x89,0x89,0xF9,0x89,0x89,0xF9,0x81,0x81,0x00
};
/*手动模式卡纸*/
static unsigned char f_handmodepaperjam[] = {
0x00,0x00,0x24,0x24,0x24,0x24,0x24,0xFC,0x22,0x22,0x22,0x23,0x22,0x00,0x00,0x00,
0x02,0x02,0x02,0x02,0x02,0x42,0x82,0x7F,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00,/*"手",0*/
0x40,0x44,0xC4,0x44,0x44,0x44,0x40,0x10,0x10,0xFF,0x10,0x10,0x10,0xF0,0x00,0x00,
0x10,0x3C,0x13,0x10,0x14,0xB8,0x40,0x30,0x0E,0x01,0x40,0x80,0x40,0x3F,0x00,0x00,/*"动",1*/
0x10,0x10,0xD0,0xFF,0x90,0x14,0xE4,0xAF,0xA4,0xA4,0xA4,0xAF,0xE4,0x04,0x00,0x00,
0x04,0x03,0x00,0xFF,0x00,0x89,0x4B,0x2A,0x1A,0x0E,0x1A,0x2A,0x4B,0x88,0x80,0x00,/*"模",2*/
0x10,0x10,0x90,0x90,0x90,0x90,0x90,0x10,0x10,0xFF,0x10,0x10,0x11,0x16,0x10,0x00,
0x00,0x20,0x60,0x20,0x3F,0x10,0x10,0x10,0x00,0x03,0x0C,0x10,0x20,0x40,0xF8,0x00,/*"式",3*/
0x40,0x40,0x40,0x40,0x40,0x40,0xFF,0x44,0x44,0x44,0x44,0x44,0x44,0x40,0x40,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x02,0x04,0x08,0x10,0x00,0x00,0x00,/*"卡",4*/
0x20,0x30,0xAC,0x63,0x30,0x00,0xFC,0x84,0x84,0x84,0xFE,0x82,0x83,0x82,0x80,0x00,
0x22,0x67,0x22,0x12,0x12,0x00,0xFF,0x40,0x20,0x00,0x01,0x0E,0x30,0x40,0xF8,0x00,/*"纸",5*/
};
/*手动模式*/
static unsigned char f_handmode[] = {
0x00,0x00,0x24,0x24,0x24,0x24,0x24,0xFC,0x22,0x22,0x22,0x23,0x22,0x00,0x00,0x00,
0x02,0x02,0x02,0x02,0x02,0x42,0x82,0x7F,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00,
0x40,0x44,0xC4,0x44,0x44,0x44,0x40,0x10,0x10,0xFF,0x10,0x10,0x10,0xF0,0x00,0x00,
0x10,0x3C,0x13,0x10,0x14,0xB8,0x40,0x30,0x0E,0x01,0x40,0x80,0x40,0x3F,0x00,0x00,
0x10,0x10,0xD0,0xFF,0x90,0x14,0xE4,0xAF,0xA4,0xA4,0xA4,0xAF,0xE4,0x04,0x00,0x00,
0x04,0x03,0x00,0xFF,0x00,0x89,0x4B,0x2A,0x1A,0x0E,0x1A,0x2A,0x4B,0x88,0x80,0x00,
0x10,0x10,0x90,0x90,0x90,0x90,0x90,0x10,0x10,0xFF,0x10,0x10,0x11,0x16,0x10,0x00,
0x00,0x20,0x60,0x20,0x3F,0x10,0x10,0x10,0x00,0x03,0x0C,0x10,0x20,0x40,0xF8,0x00,
};
/*纸张歪斜*/
static unsigned char f_paperscrew[] = {
0x20,0x30,0xAC,0x63,0x30,0x00,0xFC,0x84,0x84,0x84,0xFE,0x82,0x83,0x82,0x80,0x00,
0x22,0x67,0x22,0x12,0x12,0x00,0xFF,0x40,0x20,0x00,0x01,0x0E,0x30,0x40,0xF8,0x00,
0x02,0xE2,0x22,0x22,0x3E,0x80,0x80,0xFF,0x80,0xA0,0x90,0x88,0x86,0x80,0x80,0x00,
0x00,0x43,0x82,0x42,0x3E,0x00,0x00,0xFF,0x40,0x21,0x06,0x08,0x10,0x20,0x40,0x00,
0x00,0x42,0x42,0x22,0x22,0x12,0x0A,0x7E,0x02,0x12,0x12,0x22,0x22,0x42,0x00,0x00,
0x40,0x41,0x41,0x7D,0x41,0x41,0x41,0x7F,0x49,0x49,0x49,0x49,0x49,0x41,0x40,0x00,
0x20,0x10,0x28,0x24,0xE3,0x24,0x28,0x10,0x00,0x22,0xCC,0x00,0xFF,0x00,0x00,0x00,
0x20,0x11,0x4D,0x81,0x7F,0x01,0x05,0x19,0x00,0x02,0x02,0x02,0xFF,0x01,0x01,0x00
};
/*卡纸*/
static unsigned char f_paperjam[] = {
0x40,0x40,0x40,0x40,0x40,0x40,0xFF,0x44,0x44,0x44,0x44,0x44,0x44,0x40,0x40,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x02,0x04,0x08,0x10,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x20,0x30,0xAC,0x63,0x30,0x00,0xFC,0x84,0x84,0x84,0xFE,0x82,0x83,0x82,0x80,0x00,
0x22,0x67,0x22,0x12,0x12,0x00,0xFF,0x40,0x20,0x00,0x01,0x0E,0x30,0x40,0xF8,0x00
};
/*卡纸001*/
static unsigned char f_paperjam001[] = {
0x40,0x40,0x40,0x40,0x40,0x40,0xFF,0x44,0x44,0x44,0x44,0x44,0x44,0x40,0x40,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x02,0x04,0x08,0x10,0x00,0x00,0x00,
0x20,0x30,0xAC,0x63,0x30,0x00,0xFC,0x84,0x84,0x84,0xFE,0x82,0x83,0x82,0x80,0x00,
0x22,0x67,0x22,0x12,0x12,0x00,0xFF,0x40,0x20,0x00,0x01,0x0E,0x30,0x40,0xF8,0x00,
0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00,
0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00,
0x00,0x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00
};
/*卡纸002*/
static unsigned char f_paperjam002[] = {
0x40,0x40,0x40,0x40,0x40,0x40,0xFF,0x44,0x44,0x44,0x44,0x44,0x44,0x40,0x40,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x02,0x04,0x08,0x10,0x00,0x00,0x00,
0x20,0x30,0xAC,0x63,0x30,0x00,0xFC,0x84,0x84,0x84,0xFE,0x82,0x83,0x82,0x80,0x00,
0x22,0x67,0x22,0x12,0x12,0x00,0xFF,0x40,0x20,0x00,0x01,0x0E,0x30,0x40,0xF8,0x00,
0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00,
0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00,
0x00,0x70,0x08,0x08,0x08,0x08,0xF0,0x00,0x00,0x30,0x28,0x24,0x22,0x21,0x30,0x00
};
/*卡纸003*/
static unsigned char f_paperjam003[] = {
0x40,0x40,0x40,0x40,0x40,0x40,0xFF,0x44,0x44,0x44,0x44,0x44,0x44,0x40,0x40,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x02,0x04,0x08,0x10,0x00,0x00,0x00,
0x20,0x30,0xAC,0x63,0x30,0x00,0xFC,0x84,0x84,0x84,0xFE,0x82,0x83,0x82,0x80,0x00,
0x22,0x67,0x22,0x12,0x12,0x00,0xFF,0x40,0x20,0x00,0x01,0x0E,0x30,0x40,0xF8,0x00,
0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00,
0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00,
0x00,0x30,0x08,0x08,0x08,0x88,0x70,0x00,0x00,0x18,0x20,0x21,0x21,0x22,0x1C,0x00
};
/*搓纸失败*/
static unsigned char f_feederror[] = {
0x10,0x10,0x10,0xFF,0x10,0x90,0x88,0xA9,0xAE,0xF8,0xA8,0xAC,0xAB,0x88,0x80,0x00,
0x04,0x44,0x82,0x7F,0x21,0x10,0x48,0x46,0x45,0x44,0x7C,0x44,0x44,0x44,0x40,0x00,
0x20,0x30,0xAC,0x63,0x30,0x00,0xFC,0x84,0x84,0x84,0xFE,0x82,0x83,0x82,0x80,0x00,
0x22,0x67,0x22,0x12,0x12,0x00,0xFF,0x40,0x20,0x00,0x01,0x0E,0x30,0x40,0xF8,0x00,
0x00,0x40,0x30,0x1E,0x10,0x10,0x10,0xFF,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,
0x81,0x81,0x41,0x21,0x11,0x0D,0x03,0x01,0x03,0x0D,0x11,0x21,0x41,0x81,0x81,0x00,
0x00,0xFE,0x02,0xFA,0x02,0xFE,0x40,0x20,0xD8,0x17,0x10,0x10,0xF0,0x10,0x10,0x00,
0x80,0x47,0x30,0x0F,0x10,0x67,0x80,0x40,0x21,0x16,0x08,0x16,0x21,0x40,0x80,0x00
};
/*取图超时*/
static unsigned char f_aqrimgtimeout[] = {
0x02,0x02,0xFE,0x92,0x92,0x92,0xFE,0x02,0x06,0xFC,0x04,0x04,0x04,0xFC,0x00,0x00,
0x08,0x18,0x0F,0x08,0x08,0x04,0xFF,0x04,0x84,0x40,0x27,0x18,0x27,0x40,0x80,0x00,
0x00,0xFE,0x02,0x42,0x22,0x32,0x5E,0x92,0x52,0x32,0x12,0x02,0x02,0xFE,0x00,0x00,
0x00,0xFF,0x42,0x42,0x42,0x51,0x55,0x64,0x69,0x41,0x42,0x42,0x42,0xFF,0x00,0x00,
0x40,0x48,0x48,0x48,0xFF,0x48,0x48,0x42,0xA2,0x9E,0x82,0xA2,0xC2,0xBE,0x00,0x00,
0x80,0x60,0x1F,0x20,0x7F,0x44,0x44,0x40,0x4F,0x48,0x48,0x48,0x48,0x4F,0x40,0x00,
0x00,0xFC,0x84,0x84,0x84,0xFC,0x00,0x10,0x10,0x10,0x10,0x10,0xFF,0x10,0x10,0x00,
0x00,0x3F,0x10,0x10,0x10,0x3F,0x00,0x00,0x01,0x06,0x40,0x80,0x7F,0x00,0x00,0x00
};
/*分纸强度*/
static unsigned char f_pollpaperintensity[] = {
0x80,0x40,0x20,0x90,0x88,0x86,0x80,0x80,0x80,0x83,0x8C,0x10,0x20,0x40,0x80,0x00,
0x00,0x80,0x40,0x20,0x18,0x07,0x00,0x40,0x80,0x40,0x3F,0x00,0x00,0x00,0x00,0x00,
0x20,0x30,0xAC,0x63,0x30,0x00,0xFC,0x84,0x84,0x84,0xFE,0x82,0x83,0x82,0x80,0x00,
0x22,0x67,0x22,0x12,0x12,0x00,0xFF,0x40,0x20,0x00,0x01,0x0E,0x30,0x40,0xF8,0x00,
0x02,0xE2,0x22,0x22,0x3E,0x00,0x80,0x9E,0x92,0x92,0xF2,0x92,0x92,0x9E,0x80,0x00,
0x00,0x43,0x82,0x42,0x3E,0x40,0x47,0x44,0x44,0x44,0x7F,0x44,0x44,0x54,0xE7,0x00,
0x00,0x00,0xFC,0x24,0x24,0x24,0xFC,0x25,0x26,0x24,0xFC,0x24,0x24,0x24,0x04,0x00,
0x40,0x30,0x8F,0x80,0x84,0x4C,0x55,0x25,0x25,0x25,0x55,0x4C,0x80,0x80,0x80,0x00,
};
/*高*/
static unsigned char f_intensityHigh[] = {
0x04,0x04,0x04,0x04,0xF4,0x94,0x95,0x96,0x94,0x94,0xF4,0x04,0x04,0x04,0x04,0x00,
0x00,0xFE,0x02,0x02,0x7A,0x4A,0x4A,0x4A,0x4A,0x4A,0x7A,0x02,0x82,0xFE,0x00,0x00
};
/*中*/
static unsigned char f_intensityMid[] = {
0x00,0x00,0xF0,0x10,0x10,0x10,0x10,0xFF,0x10,0x10,0x10,0x10,0xF0,0x00,0x00,0x00,
0x00,0x00,0x0F,0x04,0x04,0x04,0x04,0xFF,0x04,0x04,0x04,0x04,0x0F,0x00,0x00,0x00
};
/*弱*/
static unsigned char f_intensityLow[] = {
0x00,0xF2,0x92,0x92,0x92,0x92,0x9E,0x00,0xF2,0x92,0x92,0x92,0x92,0x9E,0x00,0x00,
0x00,0x10,0x11,0x4A,0x88,0x44,0x3F,0x00,0x10,0x11,0x4A,0x88,0x44,0x3F,0x00,0x00
};
/*低*/
static unsigned char f_traypositionLow[] = {
0x00,0x80,0x60,0xF8,0x07,0x00,0xFC,0x84,0x84,0x84,0xFE,0x82,0x83,0x82,0x80,0x00,
0x01,0x00,0x00,0xFF,0x00,0x00,0xFF,0x40,0x20,0x00,0x41,0x8E,0x30,0x40,0xF8,0x00
};
/*张*/
static unsigned char f_page[] = {
0x02,0xE2,0x22,0x22,0x3E,0x80,0x80,0xFF,0x80,0xA0,0x90,0x88,0x86,0x80,0x80,0x00,
0x00,0x43,0x82,0x42,0x3E,0x00,0x00,0xFF,0x40,0x21,0x06,0x08,0x10,0x20,0x40,0x00
};
/*扫描*/
static unsigned char f_scan[] = {
0x10,0x10,0x10,0xFF,0x10,0x90,0x04,0x84,0x84,0x84,0x84,0x84,0x84,0xFC,0x00,0x00,
0x04,0x44,0x82,0x7F,0x01,0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7F,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x10,0x10,0x10,0xFF,0x10,0x90,0x04,0xC4,0x5F,0x44,0xC4,0x44,0x5F,0xC4,0x04,0x00,
0x04,0x44,0x82,0x7F,0x01,0x00,0x00,0xFF,0x44,0x44,0x7F,0x44,0x44,0xFF,0x00,0x00
};
/*返回*/
static unsigned char f_back[] = {
0x40,0x40,0x42,0xCE,0xCC,0x00,0xFC,0xFC,0xA4,0xA4,0x26,0x22,0xA3,0xE3,0x62,0x00,
0x00,0x40,0x60,0x3F,0x3F,0x78,0x5F,0x57,0x58,0x4D,0x47,0x47,0x4D,0x58,0x50,0x40,
0x00,0x00,0xFE,0xFE,0x02,0xF2,0xF2,0x12,0x12,0xF2,0xF2,0x02,0xFE,0xFE,0x00,0x00,
0x00,0x00,0x7F,0x7F,0x20,0x27,0x27,0x24,0x24,0x27,0x27,0x20,0x7F,0x7F,0x00,0x00
};
/*确认*/
static unsigned char f_confirm[] = {
0x04,0x84,0xE4,0x5C,0x44,0xC4,0x20,0x10,0xE8,0x27,0x24,0xE4,0x34,0x2C,0xE0,0x00,
0x02,0x01,0x7F,0x10,0x10,0x3F,0x80,0x60,0x1F,0x09,0x09,0x3F,0x49,0x89,0x7F,0x00,
0x40,0x40,0x42,0xCC,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x3F,0x90,0x48,0x20,0x18,0x07,0x00,0x07,0x18,0x20,0x40,0x80,0x00
};
/*开*/
static unsigned char f_opened[] = {
0x80,0x82,0x82,0x82,0xFE,0x82,0x82,0x82,0x82,0x82,0xFE,0x82,0x82,0x82,0x80,0x00,
0x00,0x80,0x40,0x30,0x0F,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00
};
/*关*/
static unsigned char f_closed[] = {
0x80,0x82,0x82,0x82,0xFE,0x82,0x82,0x82,0x82,0x82,0xFE,0x82,0x82,0x82,0x80,0x00,
0x00,0x80,0x40,0x30,0x0F,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00
};
/*无纸*/
static unsigned char f_nopaper[] = {
0x00,0x40,0x42,0x42,0x42,0xC2,0x7E,0x42,0xC2,0x42,0x42,0x42,0x40,0x40,0x00,0x00,
0x80,0x40,0x20,0x10,0x0C,0x03,0x00,0x00,0x3F,0x40,0x40,0x40,0x40,0x70,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x20,0x30,0xAC,0x63,0x30,0x00,0xFC,0x84,0x84,0x84,0xFE,0x82,0x83,0x82,0x80,0x00,
0x22,0x67,0x22,0x12,0x12,0x00,0xFF,0x40,0x20,0x00,0x01,0x0E,0x30,0x40,0xF8,0x00
};
/*休眠模式*/
static unsigned char f_sleepmode[] = {
0x00,0x80,0x60,0xF8,0x07,0x10,0x10,0x10,0xD0,0xFF,0xD0,0x10,0x10,0x10,0x10,0x00,
0x01,0x00,0x00,0xFF,0x10,0x08,0x04,0x03,0x00,0xFF,0x00,0x03,0x04,0x08,0x10,0x00,
0x00,0xFC,0x24,0x24,0x24,0xFC,0x00,0xFE,0x22,0x22,0xE2,0x22,0x22,0x3E,0x00,0x00,
0x00,0x3F,0x11,0x11,0x11,0x3F,0x00,0xFF,0x41,0x21,0x07,0x19,0x21,0x41,0xF1,0x00,
0x10,0x10,0xD0,0xFF,0x90,0x14,0xE4,0xAF,0xA4,0xA4,0xA4,0xAF,0xE4,0x04,0x00,0x00,
0x04,0x03,0x00,0xFF,0x00,0x89,0x4B,0x2A,0x1A,0x0E,0x1A,0x2A,0x4B,0x88,0x80,0x00,
0x10,0x10,0x90,0x90,0x90,0x90,0x90,0x10,0x10,0xFF,0x10,0x10,0x11,0x16,0x10,0x00,
0x00,0x20,0x60,0x20,0x3F,0x10,0x10,0x10,0x00,0x03,0x0C,0x10,0x20,0x40,0xF8,0x00
};
/*三十分钟*/
static unsigned char f_30min[] = {
0x00,0x04,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x04,0x00,0x00,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,
0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xFF,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x80,0x40,0x20,0x90,0x88,0x86,0x80,0x80,0x80,0x83,0x8C,0x10,0x20,0x40,0x80,0x00,
0x00,0x80,0x40,0x20,0x18,0x07,0x00,0x40,0x80,0x40,0x3F,0x00,0x00,0x00,0x00,0x00,
0x20,0x10,0x2C,0xE7,0x24,0x24,0x00,0xF0,0x10,0x10,0xFF,0x10,0x10,0xF0,0x00,0x00,
0x01,0x01,0x01,0x7F,0x21,0x11,0x00,0x07,0x02,0x02,0xFF,0x02,0x02,0x07,0x00,0x00,
};
/*一小时*/
static unsigned char f_1hour[] = {
0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xE0,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x20,0x40,0x80,0x00,0x00,
0x08,0x04,0x03,0x00,0x00,0x40,0x80,0x7F,0x00,0x00,0x00,0x00,0x00,0x01,0x0E,0x00,
0x00,0xFC,0x84,0x84,0x84,0xFC,0x00,0x10,0x10,0x10,0x10,0x10,0xFF,0x10,0x10,0x00,
0x00,0x3F,0x10,0x10,0x10,0x3F,0x00,0x00,0x01,0x06,0x40,0x80,0x7F,0x00,0x00,0x00
};
/*二小时*/
static unsigned char f_2hour[] = {
0x02,0xE2,0x22,0x22,0x22,0xFE,0x22,0x22,0x22,0xFE,0x22,0x22,0x22,0xE2,0x02,0x00,
0x00,0xFF,0x00,0x08,0x06,0x01,0x16,0x08,0x06,0x01,0x02,0x4C,0x80,0x7F,0x00,0x00,
0x00,0x00,0x00,0xE0,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x20,0x40,0x80,0x00,0x00,
0x08,0x04,0x03,0x00,0x00,0x40,0x80,0x7F,0x00,0x00,0x00,0x00,0x00,0x01,0x0E,0x00,
0x00,0xFC,0x84,0x84,0x84,0xFC,0x00,0x10,0x10,0x10,0x10,0x10,0xFF,0x10,0x10,0x00,
0x00,0x3F,0x10,0x10,0x10,0x3F,0x00,0x00,0x01,0x06,0x40,0x80,0x7F,0x00,0x00,0x00
};
/*不休眠*/
static unsigned char f_never[] = {
0x00,0x02,0x02,0x02,0x02,0x82,0x42,0xF2,0x0E,0x42,0x82,0x02,0x02,0x02,0x00,0x00,
0x10,0x08,0x04,0x02,0x01,0x00,0x00,0xFF,0x00,0x00,0x00,0x01,0x02,0x0C,0x00,0x00,
0x00,0x80,0x60,0xF8,0x07,0x10,0x10,0x10,0xD0,0xFF,0xD0,0x10,0x10,0x10,0x10,0x00,
0x01,0x00,0x00,0xFF,0x10,0x08,0x04,0x03,0x00,0xFF,0x00,0x03,0x04,0x08,0x10,0x00,
0x00,0xFC,0x24,0x24,0x24,0xFC,0x00,0xFE,0x22,0x22,0xE2,0x22,0x22,0x3E,0x00,0x00,
0x00,0x3F,0x11,0x11,0x11,0x3F,0x00,0xFF,0x41,0x21,0x07,0x19,0x21,0x41,0xF1,0x00
};
/*返回*/
static unsigned char f_return[] = {
0x40,0x40,0x42,0xCC,0x00,0x00,0xFC,0x24,0xA4,0x24,0x22,0x22,0xA3,0x62,0x00,0x00,
0x00,0x40,0x20,0x1F,0x20,0x58,0x47,0x50,0x48,0x45,0x42,0x45,0x48,0x50,0x40,0x00,
0x00,0x00,0xFE,0x02,0x02,0xF2,0x12,0x12,0x12,0xF2,0x02,0x02,0xFE,0x00,0x00,0x00,
0x00,0x00,0x7F,0x20,0x20,0x27,0x24,0x24,0x24,0x27,0x20,0x20,0x7F,0x00,0x00,0x00
};
/*关机*/
static unsigned char f_powerof[] = {
0x00,0x00,0x10,0x11,0x16,0x10,0x10,0xF0,0x10,0x10,0x14,0x13,0x10,0x00,0x00,0x00,
0x81,0x81,0x41,0x41,0x21,0x11,0x0D,0x03,0x0D,0x11,0x21,0x41,0x41,0x81,0x81,0x00,
0x10,0x10,0xD0,0xFF,0x90,0x10,0x00,0xFE,0x02,0x02,0x02,0xFE,0x00,0x00,0x00,0x00,
0x04,0x03,0x00,0xFF,0x00,0x83,0x60,0x1F,0x00,0x00,0x00,0x3F,0x40,0x40,0x78,0x00
};
/*托盘位置*/
static unsigned char f_trayposition[] = {
0x10,0x10,0x10,0xFF,0x10,0x90,0x04,0x04,0x04,0xFC,0x82,0x82,0x83,0x82,0x80,0x00,
0x04,0x44,0x82,0x7F,0x01,0x00,0x01,0x01,0x01,0x3F,0x40,0x40,0x40,0x40,0x78,0x00,
0x20,0x20,0x20,0xFC,0x24,0x26,0xA5,0x2C,0x34,0x24,0x24,0xFC,0x20,0x20,0x20,0x00,
0x40,0x42,0x7D,0x44,0x44,0x7C,0x44,0x45,0x44,0x7D,0x46,0x45,0x7C,0x40,0x40,0x00,
0x00,0x80,0x60,0xF8,0x07,0x10,0x90,0x10,0x11,0x16,0x10,0x10,0xD0,0x10,0x00,0x00,
0x01,0x00,0x00,0xFF,0x40,0x40,0x41,0x5E,0x40,0x40,0x70,0x4E,0x41,0x40,0x40,0x00,
0x00,0x17,0x15,0xD5,0x55,0x57,0x55,0x7D,0x55,0x57,0x55,0xD5,0x15,0x17,0x00,0x00,
0x40,0x40,0x40,0x7F,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x7F,0x40,0x40,0x40,0x00
};
/*设备已锁定*/
static unsigned char f_deviceLock[] = {
0x40,0x40,0x42,0xCC,0x00,0x40,0xA0,0x9E,0x82,0x82,0x82,0x9E,0xA0,0x20,0x20,0x00,
0x00,0x00,0x00,0x3F,0x90,0x88,0x40,0x43,0x2C,0x10,0x28,0x46,0x41,0x80,0x80,0x00,/*"设",0*/
0x80,0x90,0x90,0x48,0x4C,0x57,0x24,0x24,0x24,0x54,0x4C,0x44,0x80,0x80,0x80,0x00,
0x00,0x00,0x00,0xFF,0x49,0x49,0x49,0x7F,0x49,0x49,0x49,0xFF,0x00,0x00,0x00,0x00,/*"备",1*/
0x00,0x00,0xE2,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0xFE,0x00,0x00,0x00,0x00,
0x00,0x00,0x3F,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x78,0x00,0x00,/*"已",2*/
0x20,0x10,0x2C,0xE7,0x24,0x24,0x00,0xE2,0x2C,0x20,0xBF,0x20,0x28,0xE6,0x00,0x00,
0x01,0x01,0x01,0x7F,0x21,0x11,0x80,0x4F,0x20,0x10,0x0F,0x10,0x20,0x4F,0x80,0x00,/*"锁",3*/
0x10,0x0C,0x44,0x44,0x44,0x44,0x45,0xC6,0x44,0x44,0x44,0x44,0x44,0x14,0x0C,0x00,
0x80,0x40,0x20,0x1E,0x20,0x40,0x40,0x7F,0x44,0x44,0x44,0x44,0x44,0x40,0x40,0x00,/*"定",4*/
};
/*耗材查询*/
static unsigned char f_scannum[] ={
0x88,0xA8,0xA8,0xFF,0xA8,0xA8,0x88,0x00,0x44,0x44,0xFC,0x22,0x23,0x22,0x00,0x00,
0x20,0x18,0x06,0xFF,0x02,0x0C,0x00,0x04,0x04,0x04,0x7F,0x82,0x82,0x82,0xF2,0x00,/*"耗",0*/
0x10,0x10,0x10,0xD0,0xFF,0x90,0x10,0x00,0x10,0x10,0x10,0xD0,0xFF,0x10,0x10,0x00,
0x08,0x04,0x03,0x00,0xFF,0x00,0x03,0x00,0x08,0x04,0x43,0x80,0x7F,0x00,0x00,0x00,/*"材",1*/
0x40,0x44,0x24,0xA4,0x94,0x8C,0x84,0xFF,0x84,0x8C,0x94,0xA4,0x24,0x44,0x40,0x00,
0x40,0x40,0x40,0x5F,0x4A,0x4A,0x4A,0x4A,0x4A,0x4A,0x4A,0x5F,0x40,0x40,0x40,0x00,/*"查",2*/
0x40,0x40,0x42,0xCC,0x00,0x20,0xD0,0x4C,0x4B,0x48,0xC8,0x08,0x08,0xF8,0x00,0x00,
0x00,0x00,0x00,0x7F,0x20,0x10,0x1F,0x12,0x12,0x12,0x5F,0x80,0x40,0x3F,0x00,0x00,/*"询",3*/
};
/*历史张数*/
static unsigned char f_history_num[] ={
0x00,0x00,0xFE,0x02,0x42,0x42,0x42,0x42,0xFA,0x42,0x42,0x42,0x42,0xC2,0x02,0x00,
0x80,0x60,0x1F,0x80,0x40,0x20,0x18,0x06,0x01,0x00,0x40,0x80,0x40,0x3F,0x00,0x00,/*"历",0*/
0x00,0x00,0xF8,0x88,0x88,0x88,0x88,0xFF,0x88,0x88,0x88,0x88,0xF8,0x00,0x00,0x00,
0x80,0x80,0x81,0x44,0x48,0x30,0x10,0x2F,0x20,0x40,0x40,0x40,0x81,0x80,0x80,0x00,/*"史",1*/
0x02,0xE2,0x22,0x22,0x3E,0x80,0x80,0xFF,0x80,0xA0,0x90,0x88,0x86,0x80,0x80,0x00,
0x00,0x43,0x82,0x42,0x3E,0x00,0x00,0xFF,0x40,0x21,0x06,0x08,0x10,0x20,0x40,0x00,/*"张",2*/
0x90,0x52,0x34,0x10,0xFF,0x10,0x34,0x52,0x80,0x70,0x8F,0x08,0x08,0xF8,0x08,0x00,
0x82,0x9A,0x56,0x63,0x22,0x52,0x8E,0x00,0x80,0x40,0x33,0x0C,0x33,0x40,0x80,0x00/*"数",3*/
};
/*滚轴张数*/
static unsigned char f_roller_num[] ={
0x10,0x60,0x02,0x8C,0x00,0x24,0x94,0xCC,0xA5,0x96,0xC4,0x8C,0x14,0x24,0x00,0x00,
0x04,0x04,0x7E,0x01,0x20,0x10,0x08,0xFC,0x42,0x24,0x08,0x15,0x22,0x40,0x40,0x00,/*"滚",0*/
0xC8,0xB8,0x8F,0xE8,0x88,0x88,0x00,0xF0,0x10,0x10,0xFF,0x10,0x10,0xF0,0x00,0x00,
0x08,0x18,0x08,0xFF,0x04,0x04,0x00,0xFF,0x42,0x42,0x7F,0x42,0x42,0xFF,0x00,0x00,/*"轴",1*/
0x02,0xE2,0x22,0x22,0x3E,0x80,0x80,0xFF,0x80,0xA0,0x90,0x88,0x86,0x80,0x80,0x00,
0x00,0x43,0x82,0x42,0x3E,0x00,0x00,0xFF,0x40,0x21,0x06,0x08,0x10,0x20,0x40,0x00,/*"张",2*/
0x90,0x52,0x34,0x10,0xFF,0x10,0x34,0x52,0x80,0x70,0x8F,0x08,0x08,0xF8,0x08,0x00,
0x82,0x9A,0x56,0x63,0x22,0x52,0x8E,0x00,0x80,0x40,0x33,0x0C,0x33,0x40,0x80,0x00/*"数",3*/
};
/*滚轴清零*/
static unsigned char f_clrea_roller[] ={
0x10,0x60,0x02,0x8C,0x00,0x24,0x94,0xCC,0xA5,0x96,0xC4,0x8C,0x14,0x24,0x00,0x00,
0x04,0x04,0x7E,0x01,0x20,0x10,0x08,0xFC,0x42,0x24,0x08,0x15,0x22,0x40,0x40,0x00,/*"滚",0*/
0xC8,0xB8,0x8F,0xE8,0x88,0x88,0x00,0xF0,0x10,0x10,0xFF,0x10,0x10,0xF0,0x00,0x00,
0x08,0x18,0x08,0xFF,0x04,0x04,0x00,0xFF,0x42,0x42,0x7F,0x42,0x42,0xFF,0x00,0x00,/*"轴",1*/
0x10,0x60,0x02,0x8C,0x00,0x44,0x54,0x54,0x54,0x7F,0x54,0x54,0x54,0x44,0x40,0x00,
0x04,0x04,0x7E,0x01,0x00,0x00,0xFF,0x15,0x15,0x15,0x55,0x95,0x7F,0x00,0x00,0x00,/*"清",2*/
0x10,0x0C,0x05,0x55,0x55,0x55,0x85,0x7F,0x85,0x55,0x55,0x55,0x05,0x14,0x0C,0x00,
0x04,0x04,0x02,0x0A,0x09,0x29,0x2A,0x4C,0x48,0xA9,0x19,0x02,0x02,0x04,0x04,0x00,/*"零",3*/
};
/*是否确认?*/
static unsigned char f_is_sure[] ={
0x00,0x00,0x00,0x7F,0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x7F,0x00,0x00,0x00,0x00,
0x81,0x41,0x21,0x1D,0x21,0x41,0x81,0xFF,0x89,0x89,0x89,0x89,0x89,0x81,0x81,0x00,/*"是",0*/
0x00,0x02,0x82,0x82,0x42,0x22,0x12,0xFA,0x06,0x22,0x22,0x42,0x42,0x82,0x00,0x00,
0x01,0x01,0x00,0xFC,0x44,0x44,0x44,0x45,0x44,0x44,0x44,0xFC,0x00,0x00,0x01,0x00,/*"否",1*/
0x04,0x84,0xE4,0x5C,0x44,0xC4,0x20,0x10,0xE8,0x27,0x24,0xE4,0x34,0x2C,0xE0,0x00,
0x02,0x01,0x7F,0x10,0x10,0x3F,0x80,0x60,0x1F,0x09,0x09,0x3F,0x49,0x89,0x7F,0x00,/*"确",2*/
0x40,0x40,0x42,0xCC,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x3F,0x90,0x48,0x20,0x18,0x07,0x00,0x07,0x18,0x20,0x40,0x80,0x00,/*"认",3*/
0x00,0x00,0x38,0x34,0x02,0x82,0xC2,0x7C,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x37,0x37,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"",4*/
};
/*"是"*/
static unsigned char f_yes[] ={
0x00,0x00,0x00,0x7F,0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x7F,0x00,0x00,0x00,0x00,
0x81,0x41,0x21,0x1D,0x21,0x41,0x81,0xFF,0x89,0x89,0x89,0x89,0x89,0x81,0x81,0x00,/*"是",0*/
};
/*"否"*/
static unsigned char f_no[] ={
0x00,0x02,0x82,0x82,0x42,0x22,0x12,0xFA,0x06,0x22,0x22,0x42,0x42,0x82,0x00,0x00,
0x01,0x01,0x00,0xFC,0x44,0x44,0x44,0x45,0x44,0x44,0x44,0xFC,0x00,0x00,0x01,0x00,/*"否",1*/
};
struct DisInfo{
unsigned char page;
unsigned char col;
DisDrawtype drawtype;
std::vector<unsigned char> str;
};
static std::map<DisType,DisInfo> map_Display={
{DisType::Dis_Welcome,{1,1,DisDrawtype::DD_All,std::vector<unsigned char>(f_logo,f_logo+sizeof(f_logo))}},
{DisType::Dis_Init,{1,1,DisDrawtype::DD_All,std::vector<unsigned char>(f_welcome,f_welcome+sizeof(f_welcome))}},
{DisType::Dis_Idel,{1,1,DisDrawtype::DD_TopLeft,std::vector<unsigned char>(f_ready,f_ready+sizeof(f_ready))}},
{DisType::Dis_Scan,{1,1,DisDrawtype::DD_TopLeft,std::vector<unsigned char>(f_scan,f_scan+sizeof(f_scan))}},
{DisType::Dis_Set_ClearPaperPass,{1,1,DisDrawtype::DD_TopLeft,std::vector<unsigned char>(f_clearpaperpass,f_clearpaperpass+sizeof(f_clearpaperpass))}},
{DisType::Dis_Set_Count,{1,1,DisDrawtype::DD_TopLeft,std::vector<unsigned char>(f_countmode,f_countmode+sizeof(f_countmode))}},
{DisType::Dis_Err_DoubleFeed,{1,1,DisDrawtype::DD_TopLeft,std::vector<unsigned char>(f_doublefeed,f_doublefeed+sizeof(f_doublefeed))}},
{DisType::Dis_Err_Stable,{1,1,DisDrawtype::DD_TopLeft,std::vector<unsigned char>(f_stable,f_stable+sizeof(f_stable))}},
{DisType::Dis_Err_CoverOpen,{1,1,DisDrawtype::DD_TopLeft,std::vector<unsigned char>(f_coveropen,f_coveropen+sizeof(f_coveropen))}},
{DisType::Dis_Err_JamIn,{1,1,DisDrawtype::DD_TopLeft,std::vector<unsigned char>(f_paperjam,f_paperjam+sizeof(f_paperjam))}},
{DisType::Dis_Err_JamOut,{1,1,DisDrawtype::DD_TopLeft,std::vector<unsigned char>(f_paperjam,f_paperjam+sizeof(f_paperjam))}},
{DisType::Dis_Err_HandModeJam,{1,1,DisDrawtype::DD_TopLeft,std::vector<unsigned char>(f_handmodepaperjam,f_handmodepaperjam+sizeof(f_handmodepaperjam))}},
{DisType::Dis_Err_PaperScrew,{1,1,DisDrawtype::DD_TopLeft,std::vector<unsigned char>(f_paperscrew,f_paperscrew+sizeof(f_paperscrew))}},
{DisType::Dis_Err_FeedError,{1,1,DisDrawtype::DD_TopLeft,std::vector<unsigned char>(f_feederror,f_feederror+sizeof(f_feederror))}},
{DisType::Dis_Err_AqrImgTimeout,{1,1,DisDrawtype::DD_TopLeft,std::vector<unsigned char>(f_aqrimgtimeout,f_aqrimgtimeout+sizeof(f_aqrimgtimeout))}},
{DisType::Dis_Err_DogEar,{1,1,DisDrawtype::DD_TopLeft,std::vector<unsigned char>(f_dogear,f_dogear+sizeof(f_dogear))}},
{DisType::Dis_Err_Size,{1,1,DisDrawtype::DD_TopLeft,std::vector<unsigned char>(f_size,f_size+sizeof(f_size))}},
{DisType::Dis_Set_PollPaperIntensity,{1,1,DisDrawtype::DD_TopLeft,std::vector<unsigned char>(f_pollpaperintensity,f_pollpaperintensity+sizeof(f_pollpaperintensity))}},
{DisType::Dis_Set_PollPI_High,{3,96,DisDrawtype::DD_BotRight,std::vector<unsigned char>(f_intensityHigh,f_intensityHigh+sizeof(f_intensityHigh))}},
{DisType::Dis_Set_PollPI_Mid,{3,96,DisDrawtype::DD_BotRight,std::vector<unsigned char>(f_intensityMid,f_intensityMid+sizeof(f_intensityMid))}},
{DisType::Dis_Set_PollPI_Low,{3,96,DisDrawtype::DD_BotRight,std::vector<unsigned char>(f_intensityLow,f_intensityLow+sizeof(f_intensityLow))}},
{DisType::Dis_Set_TrayPosition,{1,1,DisDrawtype::DD_TopLeft,std::vector<unsigned char>(f_trayposition,f_trayposition+sizeof(f_trayposition))}},
{DisType::Dis_Set_TrayPosition_High,{3,96,DisDrawtype::DD_BotRight,std::vector<unsigned char>(f_intensityHigh,f_intensityHigh+sizeof(f_intensityHigh))}},
{DisType::Dis_Set_TrayPosition_Mid,{3,96,DisDrawtype::DD_BotRight,std::vector<unsigned char>(f_intensityMid,f_intensityMid+sizeof(f_intensityMid))}},
{DisType::Dis_Set_TrayPosition_Low,{3,96,DisDrawtype::DD_BotRight,std::vector<unsigned char>(f_traypositionLow,f_traypositionLow+sizeof(f_traypositionLow))}},
{DisType::Dis_Count_Page,{3,112,DisDrawtype::DD_BotRight,std::vector<unsigned char>(f_page,f_page+sizeof(f_page))}},
{DisType::Dis_Scan_Page,{3,112,DisDrawtype::DD_BotRight,std::vector<unsigned char>(f_page,f_page+sizeof(f_page))}},
{DisType::Dis_Err_NoPaper,{1,1,DisDrawtype::DD_TopLeft,std::vector<unsigned char>(f_nopaper,f_nopaper+sizeof(f_nopaper))}},
{DisType::Dis_Set_SleepMode,{1,1,DisDrawtype::DD_TopLeft,std::vector<unsigned char>(f_sleepmode,f_sleepmode+sizeof(f_sleepmode))}},
// {DisType::Dis_Set_SleepMode_30M,{3,64,DisDrawtype::DD_BotRight,std::vector<unsigned char>(f_30min,f_30min+sizeof(f_30min))}},
// {DisType::Dis_Set_SleepMode_1H,{3,80,DisDrawtype::DD_BotRight,std::vector<unsigned char>(f_1hour,f_1hour+sizeof(f_1hour))}},
// {DisType::Dis_Set_SleepMode_2H,{3,80,DisDrawtype::DD_BotRight,std::vector<unsigned char>(f_2hour,f_2hour+sizeof(f_2hour))}},
{DisType::Dis_Set_SleepMode_NEVER,{3,80,DisDrawtype::DD_BotRight,std::vector<unsigned char>(f_never,f_never+sizeof(f_never))}},
{DisType::Dis_Set_Return,{1,1,DisDrawtype::DD_TopLeft,std::vector<unsigned char>(f_return,f_return+sizeof(f_return))}},
{DisType::Dis_Set_Poweroff,{1,1,DisDrawtype::DD_TopLeft,std::vector<unsigned char>(f_powerof,f_powerof+sizeof(f_powerof))}},
{DisType::Dis_HandMode,{1,1,DisDrawtype::DD_TopLeft,std::vector<unsigned char>(f_handmode,f_handmode+sizeof(f_handmode))}},
{DisType::Dis_Set_Item_Return,{3,96,DisDrawtype::DD_BotRight,std::vector<unsigned char>(f_return,f_return+sizeof(f_return))}},
{DisType::Dis_Device_Lock,{1,1,DisDrawtype::DD_TopLeft,std::vector<unsigned char>(f_deviceLock,f_deviceLock+sizeof(f_deviceLock))}},
{DisType::Dis_Set_ScanNum_Option,{1,1,DisDrawtype::DD_TopLeft,std::vector<unsigned char>(f_scannum,f_scannum+sizeof(f_scannum))}},
{DisType::Dis_Set_Get_History_ScanNum,{3,1,DisDrawtype::DD_BotRight,std::vector<unsigned char>(f_history_num,f_history_num+sizeof(f_history_num))}},
{DisType::Dis_Set_Get_Roller_ScanNum,{3,1,DisDrawtype::DD_BotRight,std::vector<unsigned char>(f_roller_num,f_roller_num+sizeof(f_roller_num))}},
{DisType::Dis_Set_Clear_Roller_ScanNum,{3,64,DisDrawtype::DD_BotRight,std::vector<unsigned char>(f_clrea_roller,f_clrea_roller+sizeof(f_clrea_roller))}},
{DisType::Dis_Set_Is_Sure,{1,1,DisDrawtype::DD_TopLeft,std::vector<unsigned char>(f_is_sure,f_is_sure+sizeof(f_is_sure))}},
{DisType::Dis_Set_YES,{3,112,DisDrawtype::DD_BotRight,std::vector<unsigned char>(f_yes,f_yes+sizeof(f_yes))}},
{DisType::Dis_Set_No,{3,112,DisDrawtype::DD_BotRight,std::vector<unsigned char>(f_no,f_no+sizeof(f_no))}},
};

View File

@ -1,164 +0,0 @@
#include "LCDDisplay.h"
#include "Lcd.h"
#include <iostream>
#include <thread>
#include <algorithm>
LCDDisplay::LCDDisplay()
{
lcd.reset(new Lcd());
lcd->Lcd_Initial_Lcd(false);
// lcd->Lcd_Clear_screen();
// lcd->Lcd_Display_Graphic_16x16(map_Display[DisType::Dis_Init].page, map_Display[DisType::Dis_Init].col, map_Display[DisType::Dis_Init].str.data(),map_Display[DisType::Dis_Init].str.size()/32);
}
LCDDisplay::~LCDDisplay()
{
lcd->Lcd_Clear_screen();
lcd.reset();
}
void LCDDisplay::DisplayState(DisType ds, unsigned int pagenum,ClearScreen clearscree)
{
if(clearscree == ClearScreen::All)
lcd->Lcd_Clear_screen();
if(clearscree == ClearScreen::TOP)
lcd->Lcd_Clear_Half_Screen(true);
if(clearscree == ClearScreen::BOT)
lcd->Lcd_Clear_Half_Screen(false);
if (map_Display.count(ds) > 0)
{
m_status = ds;
auto dsinfo = map_Display[ds];
if (ds == DisType::Dis_Welcome)//show logo
{
lcd->Lcd_Display_Graphic_128x64(dsinfo.page, dsinfo.col, dsinfo.str.data());
}
else
{
lcd->Lcd_Display_Graphic_16x16(dsinfo.page, dsinfo.col, dsinfo.str.data(), dsinfo.str.size() / 32);
//if (ds == DisType::Dis_Scan || ds == DisType::Dis_Set_Count) //扫描或者计数 更新下半部分内容
//{
//lcd->Lcd_Clear_Half_Screen(false);
//lcd->Lcd_Display_String_8x16(3, 96, "0");
//lcd->Lcd_Display_Graphic_16x16(map_Display[DisType::Dis_Scan_Page].page, map_Display[DisType::Dis_Scan_Page].col, map_Display[DisType::Dis_Scan_Page].str.data(), map_Display[DisType::Dis_Scan_Page].str.size() / 32);
//}
}
switch (ds)
{
case DisType::Dis_Count_Page:
case DisType::Dis_Scan_Page:
{
//std::string val = std::to_string(pagenum);
//auto offsetdot = bitnum(pagenum) - 1;
std::string val(std::to_string(pagenum));
int offsetdot = val.length();
//printf("\n val = %s lenght = %d",val.c_str(),val.size());
lcd->Lcd_Display_String_8x16(3, 112 - offsetdot * 8, val.c_str()); //8 -> 一个数字所占点个数宽度
lcd->Lcd_Display_Graphic_16x16(map_Display[DisType::Dis_Scan_Page].page, map_Display[DisType::Dis_Scan_Page].col, map_Display[DisType::Dis_Scan_Page].str.data(), map_Display[DisType::Dis_Scan_Page].str.size() / 32);
break;
}
case DisType::Dis_Err_JamIn:
{
if(pagenum == 1)
lcd->Lcd_Display_String_8x16(3, 56, "P a 1 0 1"); //8 -> 一个数字所占点个数宽度
else if(pagenum == 2)
lcd->Lcd_Display_String_8x16(3, 56, "P a 1 0 2");
else if(pagenum == 3)
lcd->Lcd_Display_String_8x16(3, 56, "P a 1 0 3");
break;
}
case DisType::Dis_Err_AqrImgTimeout:
lcd->Lcd_Display_String_8x16(3, 56, "G p 0 0 1");
break;
case DisType::Dis_Err_CoverOpen:
lcd->Lcd_Display_String_8x16(3, 56, "C o 0 0 1");
break;
case DisType::Dis_Err_PaperScrew:
lcd->Lcd_Display_String_8x16(3, 56, "S K 0 0 1");
break;
case DisType::Dis_Err_DoubleFeed:
lcd->Lcd_Display_String_8x16(3, 56, "D b 0 0 1");
break;
case DisType::Dis_Err_NoPaper:
lcd->Lcd_Display_String_8x16(3, 56, "N o 0 0 1");
break;
case DisType::Dis_Err_Stable:
lcd->Lcd_Display_String_8x16(3, 56, "S T 0 0 1");
break;
case DisType::Dis_Err_FeedError:
lcd->Lcd_Display_String_8x16(3, 56, "P f 0 0 1");
break;
case DisType::Dis_Err_DogEar:
lcd->Lcd_Display_String_8x16(3, 56, "Z J 0 0 1");
break;
case DisType::Dis_Err_Size:
lcd->Lcd_Display_String_8x16(3, 56, "C C 0 0 1");
break;
case DisType::Dis_Set_Get_History_ScanNum:
{
std::string val = std::to_string(pagenum);
int offsetdot = 8 > val.length() ? val.length() : 8;
lcd->Lcd_Display_String_8x16(3, 128 - offsetdot * 8, val.c_str()); //8 -> 一个数字所占点个数宽度
break;
}
case DisType::Dis_Set_Get_Roller_ScanNum:
{
std::string val = std::to_string(pagenum);
int offsetdot = 8 > val.length() ? val.length() : 8;
lcd->Lcd_Display_String_8x16(3, 128 - offsetdot * 8, val.c_str()); //8 -> 一个数字所占点个数宽度
break;
}
default:
break;
}
}
else
{
switch (ds){
case DisType::Dis_Set_SleepMode_5M:
lcd->Lcd_Display_String_8x16(3, 112, "5M");
break;
case DisType::Dis_Set_SleepMode_10M:
lcd->Lcd_Display_String_8x16(3, 104, "10M");
break;
case DisType::Dis_Set_SleepMode_20M:
lcd->Lcd_Display_String_8x16(3, 104, "20M");
break;
case DisType::Dis_Set_SleepMode_30M:
lcd->Lcd_Display_String_8x16(3, 104, "30M");
break;
case DisType::Dis_Set_SleepMode_1H:
lcd->Lcd_Display_String_8x16(3, 112, "1H");
break;
case DisType::Dis_Set_SleepMode_2H:
lcd->Lcd_Display_String_8x16(3, 112, "2H");
break;
case DisType::Dis_Set_SleepMode_4H:
lcd->Lcd_Display_String_8x16(3, 112, "4H");
break;
default:
m_status= DisType::Dis_Unkown;
break;
}
}
}
int LCDDisplay::bitnum(unsigned int num)
{
int count = 0;
do
{
num = num / 10;
count++;
} while (num > 0);
return count;
}
DisType LCDDisplay::GetCurrentStatus() const
{
return m_status;
}

View File

@ -1,22 +0,0 @@
#pragma once
#include <map>
#include <memory>
#include "HgLCDfont.h"
class Lcd;
class LCDDisplay
{
private:
/* data */
public:
LCDDisplay(/* args */);
~LCDDisplay();
void DisplayState(DisType ds,unsigned int pagenum,ClearScreen clearscree);
DisType GetCurrentStatus() const;
private:
int bitnum(unsigned int num);
private:
std::shared_ptr<Lcd> lcd;
DisType m_status;
};

View File

@ -1,7 +1,7 @@
#include "dev_menu.h" #include "dev_menu.h"
#include <string.h> #include <string.h>
#include "Displaydef.h" // #include "Displaydef.h"
#include <base/words.h> #include <base/words.h>
#include <base/ui.h> #include <base/ui.h>
#include "keymonitor.h" #include "keymonitor.h"
@ -443,7 +443,7 @@ ui_mgr::ui_mgr() : disp_data_("lcd-msg")
#ifdef TEST_PLATFORM_EVENT #ifdef TEST_PLATFORM_EVENT
to__.enable_log(false); to__.enable_log(false);
#endif #endif
disp_thrd_.start(display, "thread_display"); disp_thrd_.start(display, SIZE_MB(4), "thread_display");
#ifdef TEST_PLATFORM_EVENT #ifdef TEST_PLATFORM_EVENT
// display thread starting, sleep 3000ms ... // display thread starting, sleep 3000ms ...
@ -472,7 +472,7 @@ ui_mgr::ui_mgr() : disp_data_("lcd-msg")
{ {
devui::LPSCANSTREAM scan = (devui::LPSCANSTREAM)pack->data; devui::LPSCANSTREAM scan = (devui::LPSCANSTREAM)pack->data;
scanning_ = scan->mode != devui::SCAN_STOPPED; scanning_ = scan->mode != devui::SCAN_STOPPED;
set_ready_status_enabled(!scanning_); set_ready_status_enabled(!scanning_ && scan->err == 0);
if(scanning_) if(scanning_)
{ {
paper_cnt_ = 0; paper_cnt_ = 0;
@ -527,6 +527,10 @@ ui_mgr::ui_mgr() : disp_data_("lcd-msg")
dd.x -= dd.ptr[i][0] + 1; dd.x -= dd.ptr[i][0] + 1;
cnt = disp_data_.save(dd, true); cnt = disp_data_.save(dd, true);
} }
else if(pack->msg == devui::UI_STATUS_MESSAGE)
{
display_status(pack->data);
}
}; };
devui::init_ui(statu, true); devui::init_ui(statu, true);
} }
@ -971,7 +975,7 @@ void ui_mgr::thread_display(void)
if(dd.method == DISP_METHOD_PART_LINE) if(dd.method == DISP_METHOD_PART_LINE)
lcd_->write_line(dd.ptr, dd.cnt, dd.x, dd.y, dd.mask); lcd_->write_line(dd.ptr, dd.cnt, dd.x, dd.y, dd.mask);
else if(dd.method == DISP_METHOD_CLEAR) else if(dd.method == DISP_METHOD_CLEAR)
lcd_->clear(dd.x, dd.y, dd.cnt, dd.mask); lcd_->clear_pages();
else if(dd.method == DISP_METHOD_WHOLE_LINE) else if(dd.method == DISP_METHOD_WHOLE_LINE)
lcd_->write_whole_line(dd.ptr, dd.cnt, dd.x, dd.y, dd.mask); lcd_->write_whole_line(dd.ptr, dd.cnt, dd.x, dd.y, dd.mask);
wait = 6; wait = 6;
@ -992,6 +996,60 @@ void ui_mgr::display_ready(void)
lcd_->write_whole_line(ready_.ptr, ready_.cnt, ready_.x, ready_.y, ready_.mask); lcd_->write_whole_line(ready_.ptr, ready_.cnt, ready_.x, ready_.y, ready_.mask);
} }
void ui_mgr::display_status(void* data)
{
devui::LPSTATMSG lpstatus = (devui::LPSTATMSG)data;
const char* text = words_from_id(lpstatus->msg_words_id);
DISPDATA dd;
custom_font::font_size fs = (custom_font::font_size)(lpstatus->font / 8 - 1);
if(!text || !text[0])
{
utils::to_log(LOG_LEVEL_DEBUG, "Error, No message text for ID %u.\n", lpstatus->msg_words_id);
return;
}
if(lpstatus->font < 8)
fs = custom_font::FONT_SIZE_16;
memset(&dd, 0, sizeof(dd));
if(lpstatus->clear == devui::CLEAR_ALL)
{
dd.method = DISP_METHOD_CLEAR;
disp_data_.save(dd, true);
dd.method = DISP_METHOD_PART_LINE;
}
else if(lpstatus->clear == devui::CLEAR_NONE)
dd.method = DISP_METHOD_PART_LINE;
else
dd.method = DISP_METHOD_WHOLE_LINE;
dd.cnt = custom_font::get_string_font(text, dd.ptr, fs);
if(dd.cnt == 0)
{
utils::to_log(LOG_LEVEL_DEBUG, "No font size %u for status message '%s'.\n", lpstatus->font, text);
return;
}
if(lpstatus->align_h != devui::ALIGN_COMPONENT_HEAD)
{
int w = 0;
for(int i = 0; i < dd.cnt; ++i)
w += dd.ptr[i][0] + 1;
if(lpstatus->align_h == devui::ALIGN_COMPONENT_MID)
dd.x = (Lcd::LCD_WIDTH - w) / 2;
else
dd.x = Lcd::LCD_WIDTH - w;
}
if(lpstatus->align_v == devui::ALIGN_COMPONENT_MID)
dd.y = (Lcd::LCD_HEIGHT - dd.ptr[0][0]) / 2;
else if(lpstatus->align_v == devui::ALIGN_COMPONENT_TAIL)
dd.y = Lcd::LCD_HEIGHT - dd.ptr[0][0];
set_ready_status_enabled(false);
disp_data_.save(dd, true);
}
void ui_mgr::set_ready_status_enabled(bool enable) void ui_mgr::set_ready_status_enabled(bool enable)
{ {
SIMPLE_LOCK(ready_lck_); SIMPLE_LOCK(ready_lck_);

View File

@ -306,7 +306,8 @@ class ui_mgr : public refer
void thread_display(void); void thread_display(void);
void display_ready(void); void display_ready(void);
void set_ready_status_enabled(bool enable); void display_status(void* data);
void set_ready_status_enabled(bool enable); // disable ready message, the last message will display until keyboard event triggered
void reset_ready_watch(void); void reset_ready_watch(void);
int get_ready_watch_ms(void); int get_ready_watch_ms(void);

View File

@ -517,35 +517,95 @@ namespace custom_font
}; };
font_map_["\357\274\232"] = maohao; font_map_["\357\274\232"] = maohao;
static uint8_t zheng[] = {16, 16 static uint8_t zheng[] = {16, 16
, 0x00, 0x00, 0x00, 0x02, 0x02, 0xE2, 0x02, 0x02, 0x02, 0xFE, 0xFE, 0x82, 0x82, 0x82, 0x82, 0x82 , 0x00, 0x00, 0x00, 0x02, 0x02, 0xE2, 0x02, 0x02, 0x02, 0xFE, 0xFE, 0x82, 0x82, 0x82, 0x82, 0x82
, 0x00, 0x00, 0x40, 0x40, 0x40, 0x7F, 0x40, 0x40, 0x40, 0x7F, 0x7F, 0x40, 0x40, 0x40, 0x40, 0x40 , 0x00, 0x00, 0x40, 0x40, 0x40, 0x7F, 0x40, 0x40, 0x40, 0x7F, 0x7F, 0x40, 0x40, 0x40, 0x40, 0x40
}; };
font_map_["\346\255\243"] = zheng; font_map_["\346\255\243"] = zheng;
static uint8_t zai[] = {16, 16 static uint8_t zai[] = {16, 16
, 0x00, 0x00, 0x08, 0x08, 0x88, 0xC8, 0x68, 0x3C, 0x0F, 0x08, 0xE8, 0xE8, 0x08, 0x08, 0x08, 0x08 , 0x00, 0x00, 0x08, 0x08, 0x88, 0xC8, 0x68, 0x3C, 0x0F, 0x08, 0xE8, 0xE8, 0x08, 0x08, 0x08, 0x08
, 0x00, 0x08, 0x04, 0x02, 0xFF, 0x40, 0x40, 0x41, 0x41, 0x41, 0x7F, 0x7F, 0x41, 0x41, 0x41, 0x41 , 0x00, 0x08, 0x04, 0x02, 0xFF, 0x40, 0x40, 0x41, 0x41, 0x41, 0x7F, 0x7F, 0x41, 0x41, 0x41, 0x41
}; };
font_map_["\345\234\250"] = zai; font_map_["\345\234\250"] = zai;
static uint8_t sao[] = {16, 16 static uint8_t sao[] = {16, 16
, 0x00, 0x00, 0x10, 0x10, 0xFF, 0xFF, 0x10, 0x90, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0xF8 , 0x00, 0x00, 0x10, 0x10, 0xFF, 0xFF, 0x10, 0x90, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0xF8
, 0x00, 0x02, 0x86, 0x82, 0xFF, 0xFF, 0x01, 0x00, 0x40, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0xFF , 0x00, 0x02, 0x86, 0x82, 0xFF, 0xFF, 0x01, 0x00, 0x40, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0xFF
}; };
font_map_["\346\211\253"] = sao; font_map_["\346\211\253"] = sao;
static uint8_t miao[] = {16, 16 static uint8_t miao[] = {16, 16
, 0x00, 0x00, 0x10, 0x10, 0xFF, 0x11, 0x10, 0x10, 0x88, 0x88, 0xFF, 0x88, 0x88, 0xBF, 0x8A, 0x88 , 0x00, 0x00, 0x10, 0x10, 0xFF, 0x11, 0x10, 0x10, 0x88, 0x88, 0xFF, 0x88, 0x88, 0xBF, 0x8A, 0x88
, 0x00, 0x04, 0x86, 0x82, 0xFF, 0x01, 0x01, 0x00, 0xFF, 0x44, 0x44, 0x7F, 0x7F, 0x44, 0x44, 0xFF , 0x00, 0x04, 0x86, 0x82, 0xFF, 0x01, 0x01, 0x00, 0xFF, 0x44, 0x44, 0x7F, 0x7F, 0x44, 0x44, 0xFF
}; };
font_map_["\346\217\217"] = miao; font_map_["\346\217\217"] = miao;
static uint8_t ellipsis[] = {16, 16 static uint8_t ellipsis[] = {16, 16
, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0x00 , 0x00, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0x00
, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
}; };
font_map_["\342\200\246"] = ellipsis; font_map_["\342\200\246"] = ellipsis;
static uint8_t wai[] = {16, 16
, 0x00, 0x00, 0x02, 0x42, 0x42, 0x22, 0x32, 0x1A, 0x8E, 0xFE, 0x02, 0x12, 0x12, 0x32, 0x22, 0x63
, 0x00, 0x00, 0x80, 0x81, 0x81, 0xF9, 0x89, 0x81, 0x81, 0xFF, 0x91, 0x91, 0x91, 0x91, 0x91, 0xD1
};
font_map_["\346\255\252"] = wai;
static uint8_t xie[] = {16, 16
, 0x00, 0x80, 0x60, 0x30, 0x3C, 0xE7, 0xE3, 0x24, 0x2C, 0x18, 0x44, 0xCC, 0x98, 0x00, 0xFF, 0x00
, 0x00, 0x80, 0x61, 0x3D, 0x8D, 0xFF, 0xFF, 0x05, 0x19, 0x71, 0x08, 0x09, 0x09, 0x00, 0xFF, 0x04
};
font_map_["\346\226\234"] = xie;
static uint8_t jian3[] = {16, 16
, 0x00, 0x10, 0x10, 0xD0, 0xFF, 0x90, 0x90, 0x50, 0xA0, 0x98, 0x8F, 0x83, 0x8C, 0x98, 0xB0, 0x60
, 0x00, 0x08, 0x06, 0x03, 0xFF, 0x00, 0x83, 0x80, 0xBC, 0xB0, 0x82, 0x9C, 0x90, 0xF8, 0x9F, 0x82
};
font_map_["\346\243\200"] = jian3;
static uint8_t ce[] = {16, 16
, 0x00, 0x00, 0xE2, 0xC6, 0x8C, 0x20, 0xFE, 0x02, 0xF2, 0x02, 0xFE, 0xFE, 0x00, 0xF8, 0x00, 0xFE
, 0x00, 0x08, 0xD8, 0xFC, 0x07, 0x80, 0xCF, 0x70, 0x1F, 0x30, 0xEF, 0xC7, 0x00, 0x9F, 0x80, 0xFF
};
font_map_["\346\265\213"] = ce;
static uint8_t dao4[] = {16, 16
, 0x00, 0x00, 0xC2, 0xC2, 0x72, 0x5E, 0xCE, 0x42, 0x72, 0xE2, 0xC2, 0x00, 0xF8, 0x08, 0x00, 0xFF
, 0x00, 0x80, 0x84, 0x84, 0x84, 0xC4, 0x7F, 0x44, 0x44, 0x44, 0x04, 0x00, 0x1F, 0x80, 0x80, 0xFF
};
font_map_["\345\210\260"] = dao4;
static uint8_t shuang[] = {16, 16
, 0x00, 0x00, 0x04, 0x24, 0xC4, 0x84, 0x84, 0xFC, 0x1C, 0x00, 0x1C, 0xE4, 0x04, 0x04, 0xFC, 0x3C
, 0x00, 0x40, 0x20, 0x10, 0x08, 0x07, 0x07, 0x8C, 0xB8, 0x40, 0x20, 0x31, 0x1E, 0x1F, 0x73, 0x60
};
font_map_["\345\217\214"] = shuang;
static uint8_t ding4[] = {16, 16
, 0x00, 0x80, 0xE0, 0x7C, 0xDE, 0xD0, 0x50, 0x50, 0x00, 0x04, 0x04, 0x04, 0xFC, 0xFC, 0x04, 0x04
, 0x00, 0x01, 0x02, 0x02, 0xFF, 0xFF, 0x62, 0x32, 0x12, 0x00, 0x80, 0x80, 0xFF, 0xFF, 0x00, 0x00
};
font_map_["\351\222\211"] = ding4;
static uint8_t shu1[] = {16, 16
, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0xFF, 0xFF, 0x08, 0x08, 0x08, 0x88, 0xFA, 0x06, 0x0C
, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0xFF, 0xFF, 0x01, 0x01, 0x01, 0x21, 0x21, 0x61, 0x7F
};
font_map_["\344\271\246"] = shu1;
static uint8_t ka[] = {16, 16
, 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xFF, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x40
, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x02, 0x06, 0x04, 0x0C, 0x0C, 0x18, 0x00
};
font_map_["\345\215\241"] = ka;
static uint8_t wu[] = {16, 16
, 0x00, 0x00, 0x80, 0x82, 0x82, 0x82, 0x82, 0x82, 0xFE, 0xFE, 0x82, 0x82, 0x82, 0x82, 0x82, 0xC2
, 0x00, 0x00, 0x00, 0x80, 0x80, 0x40, 0x30, 0x1C, 0x0F, 0x01, 0xFF, 0x80, 0x80, 0x80, 0x80, 0x80
};
font_map_["\346\227\240"] = wu;
} }
~font_init() ~font_init()

View File

@ -12,7 +12,6 @@
#include <functional> #include <functional>
#include <base/utils.h> #include <base/utils.h>
#include "DisplayCenter.h"
#include "Lcd.h" #include "Lcd.h"
#include "dev_menu.h" #include "dev_menu.h"

View File

@ -112,10 +112,10 @@ async_usb_gadget::async_usb_gadget(std::function<FUNCTION_PROTO_COMMAND_HANDLE>
utils::to_log(LOG_LEVEL_DEBUG, "Prepare %u(%u * %u) for IO.\n", io_buf_.size() * unit_out_, io_buf_.size(), unit_in_); utils::to_log(LOG_LEVEL_DEBUG, "Prepare %u(%u * %u) for IO.\n", io_buf_.size() * unit_out_, io_buf_.size(), unit_in_);
#endif #endif
threads_.start(task, "thread_pump_task", (void*)&async_usb_gadget::thread_pump_task); threads_.start(task, SIZE_MB(4), "thread_pump_task", (void*)&async_usb_gadget::thread_pump_task);
threads_.start(bulkw, "thread_write_bulk", (void*)&async_usb_gadget::thread_write_bulk); threads_.start(bulkw, SIZE_MB(2), "thread_write_bulk", (void*)&async_usb_gadget::thread_write_bulk);
threads_.start(bulkr, "thread_read_bulk", (void*)&async_usb_gadget::thread_read_bulk); threads_.start(bulkr, SIZE_MB(2), "thread_read_bulk", (void*)&async_usb_gadget::thread_read_bulk);
threads_.start(ep0, "thread_read_ep0", (void*)&async_usb_gadget::thread_read_ep0); threads_.start(ep0, SIZE_MB(1), "thread_read_ep0", (void*)&async_usb_gadget::thread_read_ep0);
} }
async_usb_gadget::~async_usb_gadget() async_usb_gadget::~async_usb_gadget()

View File

@ -60,8 +60,8 @@ add_packagedirs("sdk")
add_defines("BUILD_AS_DEVICE") add_defines("BUILD_AS_DEVICE")
add_defines("VER_MAIN=2") add_defines("VER_MAIN=2")
add_defines("VER_FAMILY=200") add_defines("VER_FAMILY=200")
add_defines("VER_DATE=20240219") add_defines("VER_DATE=20240220")
add_defines("VER_BUILD=2") add_defines("VER_BUILD=17")
target("conf") target("conf")
set_kind("phony") set_kind("phony")