修复文件格式协议BUG

This commit is contained in:
gb 2023-07-02 09:47:00 +08:00
parent 4d0400816c
commit 3ceff40f82
1 changed files with 14 additions and 14 deletions

View File

@ -1828,7 +1828,7 @@ void huagao_ds::init_support_caps(void)
if (Msg::Set == msg) { if (Msg::Set == msg) {
auto show = data.currentItem<CapType::Indicators>(); auto show = data.currentItem<CapType::Indicators>();
m_bIndicator = show; m_bIndicator = show;
load_sane_util::log_info(m_bIndicator ? L"Set show indicator: true\r\n" : L"Set show indicator: false\r\n", 0); load_sane_util::log_info(m_bIndicator ? L"Set show indicator: true\r\n" : L"Set show indicator: false\r\n", 1);
return success(); return success();
} }
// data.type // data.type
@ -1876,7 +1876,7 @@ void huagao_ds::init_support_caps(void)
{ {
wchar_t info[128] = { 0 }; wchar_t info[128] = { 0 };
swprintf_s(info, _countof(info) - 1, L"set CapType::ICompression = %s\r\n", Compression::None == mech ? L"None" : L"Group4"); swprintf_s(info, _countof(info) - 1, L"set CapType::ICompression = %s\r\n", Compression::None == mech ? L"None" : L"Group4");
load_sane_util::log_info(info, 0); load_sane_util::log_info(info, 1);
} }
return success(); return success();
} }
@ -1953,7 +1953,7 @@ void huagao_ds::init_support_caps(void)
{ {
wchar_t info[128] = { 0 }; wchar_t info[128] = { 0 };
swprintf_s(info, _countof(info) - 1, L"set CapType::IBitDepth = %d\r\n", val); swprintf_s(info, _countof(info) - 1, L"set CapType::IBitDepth = %d\r\n", val);
load_sane_util::log_info(info, 0); load_sane_util::log_info(info, 1);
} }
SET_SANE_OPT_EX(ret, scanner_, ex_color_mode, &val); SET_SANE_OPT_EX(ret, scanner_, ex_color_mode, &val);
if (Msg::Reset == msg) if (Msg::Reset == msg)
@ -2144,7 +2144,7 @@ void huagao_ds::init_support_caps(void)
{ {
wchar_t info[128] = { 0 }, * des[] = {L"Native", L"File", L"Memory"}; wchar_t info[128] = { 0 }, * des[] = {L"Native", L"File", L"Memory"};
swprintf_s(info, _countof(info) - 1, L"set CapType::IXferMech = %s\r\n", des[(int)m_capXferMech]); swprintf_s(info, _countof(info) - 1, L"set CapType::IXferMech = %s\r\n", des[(int)m_capXferMech]);
load_sane_util::log_info(info, 0); load_sane_util::log_info(info, 1);
} }
return success(); return success();
} }
@ -2176,7 +2176,7 @@ void huagao_ds::init_support_caps(void)
swprintf_s(info, _countof(info) - 1, L"set CapType::IPixelType = %s\r\n", des[(int)init]); swprintf_s(info, _countof(info) - 1, L"set CapType::IPixelType = %s\r\n", des[(int)init]);
else else
swprintf_s(info, _countof(info) - 1, L"set CapType::IPixelType = 0x%x\r\n", (int)init); swprintf_s(info, _countof(info) - 1, L"set CapType::IPixelType = 0x%x\r\n", (int)init);
load_sane_util::log_info(info, 0); load_sane_util::log_info(info, 1);
} }
int ret = SCANNER_ERR_OK; int ret = SCANNER_ERR_OK;
SET_SANE_OPT_EX(ret, scanner_, ex_color_mode, &init); SET_SANE_OPT_EX(ret, scanner_, ex_color_mode, &init);
@ -2356,7 +2356,7 @@ void huagao_ds::init_support_caps(void)
GET_SANE_OPT_EX(bool, scanner_, ex_duplex, NULL, &all); GET_SANE_OPT_EX(bool, scanner_, ex_duplex, NULL, &all);
dup = all[sane_opts::RANGE_POS_CURRENT]; dup = all[sane_opts::RANGE_POS_CURRENT];
load_sane_util::log_info(dup ? L"Get Duplex is: true\r\n" : L"Get Duplex is: false\r\n", 0); load_sane_util::log_info(dup ? L"Get Duplex is: true\r\n" : L"Get Duplex is: false\r\n", 1);
int ret = SCANNER_ERR_OK; int ret = SCANNER_ERR_OK;
int count = count_; int count = count_;
@ -2401,11 +2401,11 @@ void huagao_ds::init_support_caps(void)
init.img_format = (SANE_ImageType)fmt; init.img_format = (SANE_ImageType)fmt;
{ {
if (fmt == Twpp::ImageFileFormat::Bmp) if (fmt == Twpp::ImageFileFormat::Bmp)
load_sane_util::log_info(L"set CapType::IImageFileFormat = Bmp\r\n", 0); load_sane_util::log_info(L"set CapType::IImageFileFormat = Bmp\r\n", 1);
else if (fmt == Twpp::ImageFileFormat::Jfif) else if (fmt == Twpp::ImageFileFormat::Jfif)
load_sane_util::log_info(L"set CapType::IImageFileFormat = Jfif\r\n", 0); load_sane_util::log_info(L"set CapType::IImageFileFormat = Jfif\r\n", 1);
else if (fmt == Twpp::ImageFileFormat::Tiff) else if (fmt == Twpp::ImageFileFormat::Tiff)
load_sane_util::log_info(L"set CapType::IImageFileFormat = Tiff\r\n", 0); load_sane_util::log_info(L"set CapType::IImageFileFormat = Tiff\r\n", 1);
} }
} }
else else
@ -2427,10 +2427,10 @@ void huagao_ds::init_support_caps(void)
for (size_t ind = sane_opts::RANGE_POS_ENUM_BEGIN; ind < all.size(); ++ind) for (size_t ind = sane_opts::RANGE_POS_ENUM_BEGIN; ind < all.size(); ++ind)
{ {
vals.push_back((ImageFileFormat)(int)all[ind].img_format); vals.push_back((ImageFileFormat)(int)all[ind].img_format);
if (all[ind].img_format == init.img_format) if ((int)all[ind].img_format == (int)Init) // init.img_format)
i = ind; i = ind - sane_opts::RANGE_POS_ENUM_BEGIN;
else if (all[ind].img_format == now.img_format) else if ((int)all[ind].img_format == (int)Now) //now.img_format)
n = ind; n = ind - sane_opts::RANGE_POS_ENUM_BEGIN;
} }
return cap_get_enum_values<ImageFileFormat, CapType::IImageFileFormat>(msg, data, vals, Now, Init, n, i); return cap_get_enum_values<ImageFileFormat, CapType::IImageFileFormat>(msg, data, vals, Now, Init, n, i);
@ -2781,7 +2781,7 @@ void huagao_ds::init_support_caps(void)
if (double_check_mode_ == DOUBLE_CHECK_ULTRASONIC) if (double_check_mode_ == DOUBLE_CHECK_ULTRASONIC)
{ {
enable = (bool)val; enable = (bool)val;
load_sane_util::to_log(1, L"DoubleFeedDetection parameter is for boolean of Ultrasonic. set to %s\r\n", enable ? L"TRUE" : L"FALSE"); load_sane_util::to_log(1, L"DoubleFeedDetection parameter is boolean for Ultrasonic. set to %s\r\n", enable ? L"TRUE" : L"FALSE");
} }
SET_SANE_OPT_EX(ret, scanner_, is_ultrasonic_check, &enable); SET_SANE_OPT_EX(ret, scanner_, is_ultrasonic_check, &enable);
return ret == SCANNER_ERR_OK ? success() : seqError(); return ret == SCANNER_ERR_OK ? success() : seqError();