修复无法设置不休眠问题

This commit is contained in:
masayume 2021-12-17 13:46:57 +08:00
parent d905029292
commit 4cb327198c
3 changed files with 36 additions and 30 deletions

View File

@ -215,7 +215,6 @@ void CA3::UpdateSleepTime(bool get)
USES_CONVERSION;
std::string str(W2A(str_sp));
int value = atoi(str.c_str());
if (value <= 0) value = 60;
parent->m_drv->SetSleepTime(value);
}
}
@ -301,6 +300,8 @@ void CA3::updatespeedmode(bool get)
{
if (parent->m_drv->PID == 0x0139 || parent->m_drv->PID == 0x0239)
{
if((parent->m_drv->PID == 0x239) && (i<4))
continue;
if (speedmodeMap[i].Speedmode == speedmode)
{
m_cmbSpeedmode.SetCurSel(i);
@ -312,6 +313,8 @@ void CA3::updatespeedmode(bool get)
}
else if (parent->m_drv->PID == 0x0300 || parent->m_drv->PID == 0x0400)
{
if ((parent->m_drv->PID == 0x0400) && (i < 12))
continue;
int startindex = parent->m_drv->PID == 0x0300 ? 6 : 10;
m_cmbSpeedmode.SetCurSel(startindex+ speedmode);
bfound = true;

View File

@ -56,39 +56,41 @@ private:
std::map<int, speedmodeparam> speedmodeMap = {
{0,{70,0x42d,0xc88}},
{1,{80,0x37f,0xa7f}},
{2,{90,0x2b6,0x882}},
{3,{100,0x27c,0x775}},
{4,{110,0x27c,0x775}},
{5,{120,0x27c,0x775}},
{6,{130,0x27c,0x775}},
{7,{1,0,0}},
{8,{2,0,0}},
{9,{3,0,0}},
{10,{4,0,0}},
{11,{1,0,0}},
{12,{2,0,0}},
{13,{3,0,0}},
{14,{4,0,0}},
{15,{5,0,0}}
{2,{90,0x2b6,0x822}},
{3,{110,0x24e,0x706}},
{4,{100,0x27c,0x775}},
{5,{110,0x27c,0x775}},
{6,{120,0x27c,0x775}},
{7,{130,0x27c,0x775}},
{8,{1,0,0}},
{9,{2,0,0}},
{10,{3,0,0}},
{11,{4,0,0}},
{12,{1,0,0}},
{13,{2,0,0}},
{14,{3,0,0}},
{15,{4,0,0}},
{16,{5,0,0}}
};
std::map<int, CString> speedmodeMapString = {
{0,L"G139_70PPM"},
{1,L"G139_80PPM"},
{2,L"G139_90PPM"},
{3,L"G239_100PPM"},
{4,L"G239_110PPM"},
{5,L"G239_120PPM"},
{6,L"G239_130PPM"},
{7,L"G300_40PPM"},
{8,L"G300_50PPM"},
{9,L"G300_60PPM"},
{10,L"G300_700PPM"},
{11,L"G400_40PPM"},
{12,L"G400_50PPM"},
{13,L"G400_60PPM"},
{14,L"G400_70PPM"},
{15,L"G400_80PPM"},
{3,L"G139_110PPM"},
{4,L"G239_100PPM"},
{5,L"G239_110PPM"},
{6,L"G239_120PPM"},
{7,L"G239_130PPM"},
{8,L"G300_40PPM"},
{9,L"G300_50PPM"},
{10,L"G300_60PPM"},
{11,L"G300_700PPM"},
{12,L"G400_40PPM"},
{13,L"G400_50PPM"},
{14,L"G400_60PPM"},
{15,L"G400_70PPM"},
{16,L"G400_80PPM"},
};
CComboBox m_cmbSpeedmode;
public:

View File

@ -340,7 +340,7 @@ void CHuaGoCorrectDlg::RefreshTabChange()
void CHuaGoCorrectDlg::Scan()
{
HGScanConfig config = { 0 };
if (m_drv->PID == 0x0139 || m_drv->PID == 0x0239)
if (m_drv->PID == 0x0139 || m_drv->PID == 0x0239 || m_drv->PID == 0x8739 || m_drv->PID == 0x8629)
{
config.g200params.dpi = 1;//only support 200DPI
config.g200params.paper = 0;
@ -607,7 +607,8 @@ void CHuaGoCorrectDlg::OnCbnSelchangeCmbUsbs()
{
if (j == ret)
{
if ((i->vid == 0x3072 && i->pid == 0x0139) || (i->vid == 0x3072 && i->pid == 0x0239))
if ((i->vid == 0x3072 && i->pid == 0x0139) || (i->vid == 0x3072 && i->pid == 0x0239)
|| (i->vid == 0x31c9 && i->pid == 0x8739) || (i->vid == 0x31c9 && i->pid == 0x8629))
m_drv.reset(new gscan3399());
else
{