HGGitLab

Commit f9fd7fa7 authored by luoliangyi's avatar luoliangyi

websdk,完善设置和获取设备配置的功能

parent 13583d6b
......@@ -257,6 +257,8 @@ void HttpUser::HandleCmd(const HttpCmdParam* param)
devParam.single = GetJsonBoolValue(json, "single");
devParam.format = GetJsonStringValue(json, "format");
devParam.resolution = GetJsonIntValue(json, "resolution");
if (0 == devParam.resolution)
devParam.resolution = atoi(GetJsonStringValue(json, "resolution").c_str());
devParam.orentation = GetJsonIntValue(json, "orentation");
devParam.paperType = GetJsonStringValue(json, "paperType");
devParam.splitImage = GetJsonIntValue(json, "splitImage");
......
This diff is collapsed.
......@@ -18,25 +18,12 @@
struct DevParam
{
DevParam()
{
autofeeder = true;
pixel = 1;
white = false;
discardBlankThre = 5;
single = false;
format = "jpg";
resolution = 200;
orentation = 0;
paperType = "Auto";
splitImage = 0;
noiseDetachEnable = true;
noiseDetach = 15;
DevParam();
~DevParam();
uploadMode = 2;
ftpPort = 21;
ftpMode = 2;
}
void Reset();
void Load(const std::string& cfgPath);
void Save(const std::string& cfgPath);
std::string device; // 设备名称,默认null
bool autofeeder; // 自动进纸,默认true
......@@ -45,7 +32,7 @@ struct DevParam
int discardBlankThre; // 跳过空白页阈值 1­-100 默认值5
bool single; // 单页扫描,默认false
std::string format; // 输出格式 jpg png bmp tiff pdf ofd,默认jpg
int resolution; // 扫描分辨率 范围 100­600 默认值200
int resolution; // 扫描分辨率 范围 100­-600 默认值200
int orentation; // 图片旋转 0:原图 90:度 180:旋转180度 270:旋转270度,默认0
std::string paperType; // 扫描幅面 A3:A3幅面 Auto:自适应幅面 A4:A4幅面,默认Auto
int splitImage; // 图像分割 0:disable 1:垂直分割 2: 水平分割,默认0
......@@ -168,6 +155,7 @@ private:
class MsgLoop* m_loop;
std::string m_devName;
SANE_Handle m_devHandle;
DevParam m_devParam;
std::string m_scanInsertImgName;
bool m_scanIsInsert;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment