2020-03-11 01:58:06 +00:00
|
|
|
#include "stdafx.h"
|
|
|
|
#include "scn_config.h"
|
|
|
|
#include "math.h"
|
|
|
|
|
|
|
|
hgConfigClass::hgConfigClass(GScanCap param)
|
|
|
|
{
|
|
|
|
PaperStatus ps = { param.papertype,param.paperAlign };
|
|
|
|
m_param.paper = ContainspaperTypesKey(ps) ? SupPaperTyps[ps] : 0;
|
|
|
|
m_param.color = ContainsPixTypeKey(param.hardwarecaps.capturepixtype) ? SupPixelTypes[param.hardwarecaps.capturepixtype] : 2;
|
2020-04-03 01:29:57 +00:00
|
|
|
m_param.dpi = ContainsResolutionKey(param.resolution_native) ? SupResolutions[param.resolution_native] :
|
2020-03-11 01:58:06 +00:00
|
|
|
m_param.double_feed_enbale = param.hardwarecaps.en_doublefeed;
|
|
|
|
m_param.stable_enbale = param.hardwarecaps.en_stapledetect;
|
|
|
|
m_param.screw_detect_enable = param.hardwarecaps.en_skrewdetect;
|
|
|
|
m_param.screw_detect_level = m_param.screw_detect_enable? secrewMaps[param.hardwarecaps.skrewdetectlevel]:0;
|
2020-04-18 03:18:06 +00:00
|
|
|
#ifdef G200
|
2020-03-11 01:58:06 +00:00
|
|
|
m_param.pc_correct = 0;
|
2020-04-18 03:18:06 +00:00
|
|
|
#else // G200
|
|
|
|
m_param.correct_enable = 1;
|
|
|
|
#endif
|
|
|
|
|
2020-03-11 01:58:06 +00:00
|
|
|
m_param.unused_one = m_param.unused_two = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hgConfigClass::ContainspaperTypesKey(PaperStatus key)
|
|
|
|
{
|
|
|
|
if (SupPaperTyps.count(key) > 0)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hgConfigClass::ContainsPixTypeKey(uint16_t key)
|
|
|
|
{
|
|
|
|
if (SupPixelTypes.count(key)>0)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hgConfigClass::ContainsResolutionKey(float key)
|
|
|
|
{
|
|
|
|
if ( SupResolutions.count(key)>0)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|