1.实现IGscan中新增加的获取扫描张数接口

2.增加通知图像处理线程扫描仪停止状态通知接口
This commit is contained in:
pm 2019-12-06 20:12:23 +08:00
parent d9056ec3d0
commit cf19411ba9
2 changed files with 14 additions and 3 deletions

View File

@ -11,15 +11,20 @@
#include <sstream>
#include "StopWatch.h"
#include "device_common.h"
#include "GScan200.h"
#ifndef WIN32
#include <unistd.h>
#endif
#include <windows.h>
#define DSP_CODE_ADDR 0
#define USER_ADDR 0x4000
using namespace std;
//class GScan200;
GDevice::GDevice(std::shared_ptr<IUsb> usb)
{
@ -221,7 +226,6 @@ bool GDevice::read_flash(unsigned int addr, void* data, int size)
const int int_buffer_size = 1024;
int index_count = 0;
#include <windows.h>
static void write_log(std::string fullname, std::string log)
{
std::string savepath;
@ -325,11 +329,18 @@ void GDevice::Int_main()
}
MotorStatus* ms = (MotorStatus*)int_buffer;
if (ms->value && 0x7fe) {
if(m_eventcall_userdata){
((GScan200*)m_eventcall_userdata)->set_scan_status(false);//停止或异常停止时,通知图像处理线程扫描仪已停止
}
m_run = false;
}
if (event_call)
{
//0x3fe ==>b 1111 1111 10
//0x3fe ==>b 1111 1111 10 异常位高有效时
if (ms->value & 0x3fe) {
((GScan200*)m_eventcall_userdata)->set_scan_status(false);
event_call(ms->value, m_eventcall_userdata);
}
}
}
}

View File

@ -78,7 +78,7 @@ private:
void* m_imagecall_userdata;
void* m_eventcall_userdata;
bool m_run;
volatile bool m_run;
// 通过 IGDevice 继承