|
|
|
@ -519,33 +519,73 @@ namespace AksWebBrowser
|
|
|
|
|
{ |
|
|
|
|
try |
|
|
|
|
{ |
|
|
|
|
if (Parame.isGPY) |
|
|
|
|
{ |
|
|
|
|
//拍照 |
|
|
|
|
string param = getFrame(); |
|
|
|
|
//Log.Info("img2" + (param)); |
|
|
|
|
if (string.IsNullOrEmpty(param)) |
|
|
|
|
{ |
|
|
|
|
//关闭 |
|
|
|
|
//StopSn("0"); |
|
|
|
|
string result = "{\"timestamp\":\"" + Utils.GetTimestamp() + "\",\"keycode\":\"" + code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"jpg\",\"data\":\"" + "获取图片失败" + "\"}"; |
|
|
|
|
SubmitLogs(result, "openCamera"); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
param = Utils.ImagesByRotate(param, 90); |
|
|
|
|
//关闭 |
|
|
|
|
//StopSn("0"); |
|
|
|
|
string result = "{\"timestamp\":\"" + Utils.GetTimestamp() + "\",\"keycode\":\"" + code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"suffix\":\"jpg\",\"data\":\"" + param + "\"}"; |
|
|
|
|
SubmitLogs(result, "openCamera"); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
//if (Parame.isGPY) |
|
|
|
|
//{ |
|
|
|
|
// //拍照 |
|
|
|
|
// string param = getFrame(); |
|
|
|
|
// //Log.Info("img2" + (param)); |
|
|
|
|
// if (string.IsNullOrEmpty(param)) |
|
|
|
|
// { |
|
|
|
|
// //关闭 |
|
|
|
|
// //StopSn("0"); |
|
|
|
|
// string result = "{\"timestamp\":\"" + Utils.GetTimestamp() + "\",\"keycode\":\"" + code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"jpg\",\"data\":\"" + "获取图片失败" + "\"}"; |
|
|
|
|
// SubmitLogs(result, "openCamera"); |
|
|
|
|
// return result; |
|
|
|
|
// } |
|
|
|
|
// else |
|
|
|
|
// { |
|
|
|
|
// param = Utils.ImagesByRotate(param, 90); |
|
|
|
|
// //关闭 |
|
|
|
|
// //StopSn("0"); |
|
|
|
|
// string result = "{\"timestamp\":\"" + Utils.GetTimestamp() + "\",\"keycode\":\"" + code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"suffix\":\"jpg\",\"data\":\"" + param + "\"}"; |
|
|
|
|
// SubmitLogs(result, "openCamera"); |
|
|
|
|
// return result; |
|
|
|
|
// } |
|
|
|
|
//} |
|
|
|
|
//else |
|
|
|
|
//{ |
|
|
|
|
// //打开高拍仪 |
|
|
|
|
// string param = OpenSn(Parame.gpydevIndex); |
|
|
|
|
// if (string.IsNullOrEmpty(param)) |
|
|
|
|
// { |
|
|
|
|
// string result = "{\"timestamp\":\"" + Utils.GetTimestamp() + "\",\"keycode\":\"" + code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"jpg\",\"data\":\"" + "扫描仪打开失败" + "\"}"; |
|
|
|
|
// SubmitLogs(result, "openCamera"); |
|
|
|
|
// return result; |
|
|
|
|
// } |
|
|
|
|
// else |
|
|
|
|
// { |
|
|
|
|
// Task.Delay(1000).Wait(); |
|
|
|
|
// //拍照 |
|
|
|
|
// param = getFrame(); |
|
|
|
|
// //Log.Info("img2" + (param)); |
|
|
|
|
// if (string.IsNullOrEmpty(param)) |
|
|
|
|
// { |
|
|
|
|
// //关闭 |
|
|
|
|
// //StopSn("0"); |
|
|
|
|
// string result = "{\"timestamp\":\"" + Utils.GetTimestamp() + "\",\"keycode\":\"" + code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"jpg\",\"data\":\"" + "获取图片失败" + "\"}"; |
|
|
|
|
// SubmitLogs(result, "openCamera"); |
|
|
|
|
// return result; |
|
|
|
|
// } |
|
|
|
|
// else |
|
|
|
|
// { |
|
|
|
|
// string base64 = Utils.ImagesByRotate(param, 90); |
|
|
|
|
// //关闭 |
|
|
|
|
// //StopSn("0"); |
|
|
|
|
// string result = "{\"timestamp\":\"" + Utils.GetTimestamp() + "\",\"keycode\":\"" + code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"suffix\":\"jpg\",\"data\":\"" + param + "\"}"; |
|
|
|
|
// SubmitLogs(result, "openCamera"); |
|
|
|
|
// return result; |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
//} |
|
|
|
|
|
|
|
|
|
string devindex = GetSnIndex(); |
|
|
|
|
if (string.IsNullOrEmpty(devindex)) { |
|
|
|
|
devindex = Parame.gpydevIndex; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
//打开高拍仪 |
|
|
|
|
string param = OpenSn(Parame.gpydevIndex); |
|
|
|
|
string param = OpenSn(devindex); |
|
|
|
|
if (string.IsNullOrEmpty(param)) |
|
|
|
|
{ |
|
|
|
|
string result = "{\"timestamp\":\"" + Utils.GetTimestamp() + "\",\"keycode\":\"" + code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"jpg\",\"data\":\"" + "扫描仪打开失败" + "\"}"; |
|
|
|
@ -554,14 +594,15 @@ namespace AksWebBrowser
|
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
Task.Delay(1000).Wait(); |
|
|
|
|
//开启纠偏 |
|
|
|
|
EnableDeskImage(1); |
|
|
|
|
//拍照 |
|
|
|
|
param = getFrame(); |
|
|
|
|
//Log.Info("img2" + (param)); |
|
|
|
|
if (string.IsNullOrEmpty(param)) |
|
|
|
|
{ |
|
|
|
|
//关闭 |
|
|
|
|
//StopSn("0"); |
|
|
|
|
StopSn(devindex); |
|
|
|
|
string result = "{\"timestamp\":\"" + Utils.GetTimestamp() + "\",\"keycode\":\"" + code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"jpg\",\"data\":\"" + "获取图片失败" + "\"}"; |
|
|
|
|
SubmitLogs(result, "openCamera"); |
|
|
|
|
return result; |
|
|
|
@ -570,16 +611,12 @@ namespace AksWebBrowser
|
|
|
|
|
{ |
|
|
|
|
string base64 = Utils.ImagesByRotate(param, 90); |
|
|
|
|
//关闭 |
|
|
|
|
//StopSn("0"); |
|
|
|
|
StopSn(devindex); |
|
|
|
|
string result = "{\"timestamp\":\"" + Utils.GetTimestamp() + "\",\"keycode\":\"" + code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"suffix\":\"jpg\",\"data\":\"" + param + "\"}"; |
|
|
|
|
SubmitLogs(result, "openCamera"); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
catch (Exception ex) |
|
|
|
|
{ |
|
|
|
|