|
|
@@ -101,37 +101,37 @@ function ParseConfig() {
|
|
|
param[catname] = new Object();
|
|
|
ParamAddValue(param, catname, "RawImagesLocation");
|
|
|
ParamAddValue(param, catname, "RawImagesRetention");
|
|
|
- ParamAddValue(param, catname, "WaitBeforeTakingPicture");
|
|
|
- ParamAddValue(param, catname, "CamGainceiling"); // Image gain (GAINCEILING_x2, x4, x8, x16, x32, x64 or x128)
|
|
|
- ParamAddValue(param, catname, "CamQuality"); // 0 - 63
|
|
|
- ParamAddValue(param, catname, "CamBrightness"); // (-2 to 2) - set brightness
|
|
|
- ParamAddValue(param, catname, "CamContrast"); //-2 - 2
|
|
|
- ParamAddValue(param, catname, "CamSaturation"); //-2 - 2
|
|
|
- ParamAddValue(param, catname, "CamSharpness"); //-2 - 2
|
|
|
- ParamAddValue(param, catname, "CamAutoSharpness"); // (1 or 0)
|
|
|
- ParamAddValue(param, catname, "CamSpecialEffect"); // 0 - 6
|
|
|
- ParamAddValue(param, catname, "CamWbMode"); // 0 to 4 - if awb_gain enabled (0 - Auto, 1 - Sunny, 2 - Cloudy, 3 - Office, 4 - Home)
|
|
|
- ParamAddValue(param, catname, "CamAwb"); // white balance enable (0 or 1)
|
|
|
- ParamAddValue(param, catname, "CamAwbGain"); // Auto White Balance enable (0 or 1)
|
|
|
- ParamAddValue(param, catname, "CamAec"); // auto exposure off (1 or 0)
|
|
|
- ParamAddValue(param, catname, "CamAec2"); // automatic exposure sensor (0 or 1)
|
|
|
- ParamAddValue(param, catname, "CamAeLevel"); // auto exposure levels (-2 to 2)
|
|
|
- ParamAddValue(param, catname, "CamAecValue"); // set exposure manually (0-1200)
|
|
|
- ParamAddValue(param, catname, "CamAgc"); // auto gain off (1 or 0)
|
|
|
- ParamAddValue(param, catname, "CamAgcGain"); // set gain manually (0 - 30)
|
|
|
- ParamAddValue(param, catname, "CamBpc"); // black pixel correction
|
|
|
- ParamAddValue(param, catname, "CamWpc"); // white pixel correction
|
|
|
- ParamAddValue(param, catname, "CamRawGma"); // (1 or 0)
|
|
|
- ParamAddValue(param, catname, "CamLenc"); // lens correction (1 or 0)
|
|
|
- ParamAddValue(param, catname, "CamHmirror"); // (0 or 1) flip horizontally
|
|
|
- ParamAddValue(param, catname, "CamVflip"); // Invert image (0 or 1)
|
|
|
- ParamAddValue(param, catname, "CamDcw"); // downsize enable (1 or 0)
|
|
|
- ParamAddValue(param, catname, "CamDenoise"); // The OV2640 does not support it, OV3660 and OV5640 (0 to 8)
|
|
|
- ParamAddValue(param, catname, "CamZoom");
|
|
|
- ParamAddValue(param, catname, "CamZoomOffsetX");
|
|
|
- ParamAddValue(param, catname, "CamZoomOffsetY");
|
|
|
- ParamAddValue(param, catname, "CamZoomSize");
|
|
|
- ParamAddValue(param, catname, "LEDIntensity");
|
|
|
+ ParamAddValue(param, catname, "WaitBeforeTakingPicture", 1, false, "5");
|
|
|
+ ParamAddValue(param, catname, "CamGainceiling", 1, false, "x8"); // Image gain (GAINCEILING_x2, x4, x8, x16, x32, x64 or x128)
|
|
|
+ ParamAddValue(param, catname, "CamQuality", 1, false, "10"); // 0 - 63
|
|
|
+ ParamAddValue(param, catname, "CamBrightness", 1, false, "0"); // (-2 to 2) - set brightness
|
|
|
+ ParamAddValue(param, catname, "CamContrast", 1, false, "0"); //-2 - 2
|
|
|
+ ParamAddValue(param, catname, "CamSaturation", 1, false, "0"); //-2 - 2
|
|
|
+ ParamAddValue(param, catname, "CamSharpness", 1, false, "0"); //-2 - 2
|
|
|
+ ParamAddValue(param, catname, "CamAutoSharpness", 1, false, "false"); // (1 or 0)
|
|
|
+ ParamAddValue(param, catname, "CamSpecialEffect", 1, false, "no_effect"); // 0 - 6
|
|
|
+ ParamAddValue(param, catname, "CamWbMode", 1, false, "auto"); // 0 to 4 - if awb_gain enabled (0 - Auto, 1 - Sunny, 2 - Cloudy, 3 - Office, 4 - Home)
|
|
|
+ ParamAddValue(param, catname, "CamAwb", 1, false, "true"); // white balance enable (0 or 1)
|
|
|
+ ParamAddValue(param, catname, "CamAwbGain", 1, false, "true"); // Auto White Balance enable (0 or 1)
|
|
|
+ ParamAddValue(param, catname, "CamAec", 1, false, "true"); // auto exposure off (1 or 0)
|
|
|
+ ParamAddValue(param, catname, "CamAec2", 1, false, "true"); // automatic exposure sensor (0 or 1)
|
|
|
+ ParamAddValue(param, catname, "CamAeLevel", 1, false, "2"); // auto exposure levels (-2 to 2)
|
|
|
+ ParamAddValue(param, catname, "CamAecValue", 1, false, "600"); // set exposure manually (0-1200)
|
|
|
+ ParamAddValue(param, catname, "CamAgc", 1, false, "true"); // auto gain off (1 or 0)
|
|
|
+ ParamAddValue(param, catname, "CamAgcGain", 1, false, "8"); // set gain manually (0 - 30)
|
|
|
+ ParamAddValue(param, catname, "CamBpc", 1, false, "true"); // black pixel correction
|
|
|
+ ParamAddValue(param, catname, "CamWpc", 1, false, "true"); // white pixel correction
|
|
|
+ ParamAddValue(param, catname, "CamRawGma", 1, false, "true"); // (1 or 0)
|
|
|
+ ParamAddValue(param, catname, "CamLenc", 1, false, "true"); // lens correction (1 or 0)
|
|
|
+ ParamAddValue(param, catname, "CamHmirror", 1, false, "false"); // (0 or 1) flip horizontally
|
|
|
+ ParamAddValue(param, catname, "CamVflip", 1, false, "false"); // Invert image (0 or 1)
|
|
|
+ ParamAddValue(param, catname, "CamDcw", 1, false, "true"); // downsize enable (1 or 0)
|
|
|
+ ParamAddValue(param, catname, "CamDenoise", 1, false, "0"); // The OV2640 does not support it, OV3660 and OV5640 (0 to 8)
|
|
|
+ ParamAddValue(param, catname, "CamZoom", 1, false, "false");
|
|
|
+ ParamAddValue(param, catname, "CamZoomOffsetX", 1, false, "0");
|
|
|
+ ParamAddValue(param, catname, "CamZoomOffsetY", 1, false, "0");
|
|
|
+ ParamAddValue(param, catname, "CamZoomSize", 1, false, "0");
|
|
|
+ ParamAddValue(param, catname, "LEDIntensity", 1, false, "50");
|
|
|
ParamAddValue(param, catname, "Demo");
|
|
|
|
|
|
var catname = "Alignment";
|
|
|
@@ -139,7 +139,7 @@ function ParseConfig() {
|
|
|
category[catname]["enabled"] = false;
|
|
|
category[catname]["found"] = false;
|
|
|
param[catname] = new Object();
|
|
|
- ParamAddValue(param, catname, "InitialRotate");
|
|
|
+ ParamAddValue(param, catname, "InitialRotate", 1, false, "false");
|
|
|
ParamAddValue(param, catname, "SearchFieldX");
|
|
|
ParamAddValue(param, catname, "SearchFieldY");
|
|
|
ParamAddValue(param, catname, "AlignmentAlgo");
|
|
|
@@ -289,7 +289,7 @@ function ParseConfig() {
|
|
|
category[catname]["enabled"] = false;
|
|
|
category[catname]["found"] = false;
|
|
|
param[catname] = new Object();
|
|
|
- ParamAddValue(param, catname, "Tooltip");
|
|
|
+ ParamAddValue(param, catname, "Tooltip", 1, false, "true");
|
|
|
ParamAddValue(param, catname, "TimeZone");
|
|
|
ParamAddValue(param, catname, "TimeServer");
|
|
|
ParamAddValue(param, catname, "Hostname");
|
|
|
@@ -364,6 +364,40 @@ function ParseConfig() {
|
|
|
NUMBERS[_num]["PostProcessing"]["ContinuousLastDigit"]["value1"] = "false";
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ // Apply declared defaults centrally after parsing config.ini.
|
|
|
+ for (var defaultCategory in param) {
|
|
|
+ for (var defaultName in param[defaultCategory]) {
|
|
|
+ var definition = param[defaultCategory][defaultName];
|
|
|
+ if (definition["defaultValue"] === "") {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (definition["Numbers"] === true) {
|
|
|
+ // For per-meter parameters, preserve explicit values (including
|
|
|
+ // commented-out ones) and fill only entries missing from config.ini.
|
|
|
+ for (var defaultNumber in NUMBERS) {
|
|
|
+ var numberCategory = NUMBERS[defaultNumber][defaultCategory];
|
|
|
+ var numberParameter = numberCategory ? numberCategory[defaultName] : null;
|
|
|
+ if (numberParameter && !numberParameter["found"]) {
|
|
|
+ numberParameter["found"] = true;
|
|
|
+ numberParameter["enabled"] = true;
|
|
|
+ for (var defaultIndex = 1; defaultIndex <= definition["anzParam"]; ++defaultIndex) {
|
|
|
+ numberParameter["value" + defaultIndex] = definition["defaultValue"];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // Preserve values already parsed; keep parameters with declared
|
|
|
+ // defaults active, matching the former camera-page behavior.
|
|
|
+ if (!definition["found"]) {
|
|
|
+ definition["found"] = true;
|
|
|
+ definition["value1"] = definition["defaultValue"];
|
|
|
+ }
|
|
|
+ definition["enabled"] = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
function ParamAddValue(param, _cat, _param, _anzParam = 1, _isNUMBER = false, _defaultValue = "", _checkRegExList = null) {
|
|
|
@@ -478,183 +512,6 @@ function ParamExtractValueAll(_param, _linesplit, _catname, _aktline, _iscom) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-function getCamConfig() {
|
|
|
- ParseConfig();
|
|
|
-
|
|
|
- param["System"]["Tooltip"]["enabled"] = true;
|
|
|
- param["Alignment"]["InitialRotate"]["enabled"] = true;
|
|
|
-
|
|
|
- param["TakeImage"]["WaitBeforeTakingPicture"]["enabled"] = true;
|
|
|
- param["TakeImage"]["CamGainceiling"]["enabled"] = true; // Image gain (GAINCEILING_x2, x4, x8, x16, x32, x64 or x128)
|
|
|
- param["TakeImage"]["CamQuality"]["enabled"] = true; // 0 - 63
|
|
|
- param["TakeImage"]["CamBrightness"]["enabled"] = true; // (-2 to 2) - set brightness
|
|
|
- param["TakeImage"]["CamContrast"]["enabled"] = true; //-2 - 2
|
|
|
- param["TakeImage"]["CamSaturation"]["enabled"] = true; //-2 - 2
|
|
|
- param["TakeImage"]["CamSharpness"]["enabled"] = true; //-2 - 2
|
|
|
- param["TakeImage"]["CamAutoSharpness"]["enabled"] = true; //(1 or 0)
|
|
|
- param["TakeImage"]["CamSpecialEffect"]["enabled"] = true; // 0 - 6
|
|
|
- param["TakeImage"]["CamWbMode"]["enabled"] = true; // 0 to 4 - if awb_gain enabled (0 - Auto, 1 - Sunny, 2 - Cloudy, 3 - Office, 4 - Home)
|
|
|
- param["TakeImage"]["CamAwb"]["enabled"] = true; // white balance enable (0 or 1)
|
|
|
- param["TakeImage"]["CamAwbGain"]["enabled"] = true; // Auto White Balance enable (0 or 1)
|
|
|
- param["TakeImage"]["CamAec"]["enabled"] = true; // auto exposure off (1 or 0)
|
|
|
- param["TakeImage"]["CamAec2"]["enabled"] = true; // automatic exposure sensor (0 or 1)
|
|
|
- param["TakeImage"]["CamAeLevel"]["enabled"] = true; // auto exposure levels (-2 to 2)
|
|
|
- param["TakeImage"]["CamAecValue"]["enabled"] = true; // set exposure manually (0-1200)
|
|
|
- param["TakeImage"]["CamAgc"]["enabled"] = true; // auto gain off (1 or 0)
|
|
|
- param["TakeImage"]["CamAgcGain"]["enabled"] = true; // set gain manually (0 - 30)
|
|
|
- param["TakeImage"]["CamBpc"]["enabled"] = true; // black pixel correction
|
|
|
- param["TakeImage"]["CamWpc"]["enabled"] = true; // white pixel correction
|
|
|
- param["TakeImage"]["CamRawGma"]["enabled"] = true; // (1 or 0)
|
|
|
- param["TakeImage"]["CamLenc"]["enabled"] = true; // lens correction (1 or 0)
|
|
|
- param["TakeImage"]["CamHmirror"]["enabled"] = true; // (0 or 1) flip horizontally
|
|
|
- param["TakeImage"]["CamVflip"]["enabled"] = true; // Invert image (0 or 1)
|
|
|
- param["TakeImage"]["CamDcw"]["enabled"] = true; // downsize enable (1 or 0)
|
|
|
- param["TakeImage"]["CamDenoise"]["enabled"] = true; // The OV2640 does not support it, OV3660 and OV5640 (0 to 8)
|
|
|
- param["TakeImage"]["CamZoom"]["enabled"] = true;
|
|
|
- param["TakeImage"]["CamZoomOffsetX"]["enabled"] = true;
|
|
|
- param["TakeImage"]["CamZoomOffsetY"]["enabled"] = true;
|
|
|
- param["TakeImage"]["CamZoomSize"]["enabled"] = true;
|
|
|
- param["TakeImage"]["LEDIntensity"]["enabled"] = true;
|
|
|
-
|
|
|
- if (!param["System"]["Tooltip"]["found"]) {
|
|
|
- param["System"]["Tooltip"]["found"] = true;
|
|
|
- param["System"]["Tooltip"].value1 = 'true';
|
|
|
- }
|
|
|
-
|
|
|
- if (!param["Alignment"]["InitialRotate"]["found"]) {
|
|
|
- param["Alignment"]["InitialRotate"]["found"] = true;
|
|
|
- param["Alignment"]["InitialRotate"].value1 = 'false';
|
|
|
- }
|
|
|
-
|
|
|
- if (!param["TakeImage"]["WaitBeforeTakingPicture"]["found"]) {
|
|
|
- param["TakeImage"]["WaitBeforeTakingPicture"]["found"] = true;
|
|
|
- param["TakeImage"]["WaitBeforeTakingPicture"].value1 = '5';
|
|
|
- }
|
|
|
- if (!param["TakeImage"]["CamGainceiling"]["found"]) {
|
|
|
- param["TakeImage"]["CamGainceiling"]["found"] = true;
|
|
|
- // param["TakeImage"]["CamGainceiling"].value1 = '2';
|
|
|
- param["TakeImage"]["CamGainceiling"].value1 = 'x8';
|
|
|
- }
|
|
|
- if (!param["TakeImage"]["CamQuality"]["found"]) {
|
|
|
- param["TakeImage"]["CamQuality"]["found"] = true;
|
|
|
- param["TakeImage"]["CamQuality"].value1 = '10';
|
|
|
- }
|
|
|
- if (!param["TakeImage"]["CamBrightness"]["found"]) {
|
|
|
- param["TakeImage"]["CamBrightness"]["found"] = true;
|
|
|
- param["TakeImage"]["CamBrightness"].value1 = '0';
|
|
|
- }
|
|
|
- if (!param["TakeImage"]["CamContrast"]["found"]) {
|
|
|
- param["TakeImage"]["CamContrast"]["found"] = true;
|
|
|
- param["TakeImage"]["CamContrast"].value1 = '0';
|
|
|
- }
|
|
|
- if (!param["TakeImage"]["CamSaturation"]["found"]) {
|
|
|
- param["TakeImage"]["CamSaturation"]["found"] = true;
|
|
|
- param["TakeImage"]["CamSaturation"].value1 = '0';
|
|
|
- }
|
|
|
- if (!param["TakeImage"]["CamSharpness"]["found"]) {
|
|
|
- param["TakeImage"]["CamSharpness"]["found"] = true;
|
|
|
- param["TakeImage"]["CamSharpness"].value1 = '0';
|
|
|
- }
|
|
|
- if (!param["TakeImage"]["CamAutoSharpness"]["found"]) {
|
|
|
- param["TakeImage"]["CamAutoSharpness"]["found"] = true;
|
|
|
- param["TakeImage"]["CamAutoSharpness"].value1 = 'false';
|
|
|
- }
|
|
|
- if (!param["TakeImage"]["CamSpecialEffect"]["found"]) {
|
|
|
- param["TakeImage"]["CamSpecialEffect"]["found"] = true;
|
|
|
- param["TakeImage"]["CamSpecialEffect"].value1 = 'no_effect';
|
|
|
- }
|
|
|
- if (!param["TakeImage"]["CamWbMode"]["found"]) {
|
|
|
- param["TakeImage"]["CamWbMode"]["found"] = true;
|
|
|
- param["TakeImage"]["CamWbMode"].value1 = 'auto';
|
|
|
- }
|
|
|
- if (!param["TakeImage"]["CamAwb"]["found"]) {
|
|
|
- param["TakeImage"]["CamAwb"]["found"] = true;
|
|
|
- param["TakeImage"]["CamAwb"].value1 = 'true';
|
|
|
- }
|
|
|
- if (!param["TakeImage"]["CamAwbGain"]["found"]) {
|
|
|
- param["TakeImage"]["CamAwbGain"]["found"] = true;
|
|
|
- param["TakeImage"]["CamAwbGain"].value1 = 'true';
|
|
|
- }
|
|
|
- if (!param["TakeImage"]["CamAec"]["found"]) {
|
|
|
- param["TakeImage"]["CamAec"]["found"] = true;
|
|
|
- param["TakeImage"]["CamAec"].value1 = 'true';
|
|
|
- }
|
|
|
- if (!param["TakeImage"]["CamAec2"]["found"]) {
|
|
|
- param["TakeImage"]["CamAec2"]["found"] = true;
|
|
|
- param["TakeImage"]["CamAec2"].value1 = 'true';
|
|
|
- }
|
|
|
- if (!param["TakeImage"]["CamAeLevel"]["found"]) {
|
|
|
- param["TakeImage"]["CamAeLevel"]["found"] = true;
|
|
|
- param["TakeImage"]["CamAeLevel"].value1 = '2';
|
|
|
- }
|
|
|
- if (!param["TakeImage"]["CamAecValue"]["found"]) {
|
|
|
- param["TakeImage"]["CamAecValue"]["found"] = true;
|
|
|
- param["TakeImage"]["CamAecValue"].value1 = '600';
|
|
|
- }
|
|
|
- if (!param["TakeImage"]["CamAgc"]["found"]) {
|
|
|
- param["TakeImage"]["CamAgc"]["found"] = true;
|
|
|
- param["TakeImage"]["CamAgc"].value1 = 'true';
|
|
|
- }
|
|
|
- if (!param["TakeImage"]["CamAgcGain"]["found"]) {
|
|
|
- param["TakeImage"]["CamAgcGain"]["found"] = true;
|
|
|
- param["TakeImage"]["CamAgcGain"].value1 = '8';
|
|
|
- }
|
|
|
- if (!param["TakeImage"]["CamBpc"]["found"]) {
|
|
|
- param["TakeImage"]["CamBpc"]["found"] = true;
|
|
|
- param["TakeImage"]["CamBpc"].value1 = 'true';
|
|
|
- }
|
|
|
- if (!param["TakeImage"]["CamWpc"]["found"]) {
|
|
|
- param["TakeImage"]["CamWpc"]["found"] = true;
|
|
|
- param["TakeImage"]["CamWpc"].value1 = 'true';
|
|
|
- }
|
|
|
- if (!param["TakeImage"]["CamRawGma"]["found"]) {
|
|
|
- param["TakeImage"]["CamRawGma"]["found"] = true;
|
|
|
- param["TakeImage"]["CamRawGma"].value1 = 'true';
|
|
|
- }
|
|
|
- if (!param["TakeImage"]["CamLenc"]["found"]) {
|
|
|
- param["TakeImage"]["CamLenc"]["found"] = true;
|
|
|
- param["TakeImage"]["CamLenc"].value1 = 'true';
|
|
|
- }
|
|
|
- if (!param["TakeImage"]["CamHmirror"]["found"]) {
|
|
|
- param["TakeImage"]["CamHmirror"]["found"] = true;
|
|
|
- param["TakeImage"]["CamHmirror"].value1 = 'false';
|
|
|
- }
|
|
|
- if (!param["TakeImage"]["CamVflip"]["found"]) {
|
|
|
- param["TakeImage"]["CamVflip"]["found"] = true;
|
|
|
- param["TakeImage"]["CamVflip"].value1 = 'false';
|
|
|
- }
|
|
|
- if (!param["TakeImage"]["CamDcw"]["found"]) {
|
|
|
- param["TakeImage"]["CamDcw"]["found"] = true;
|
|
|
- param["TakeImage"]["CamDcw"].value1 = 'true';
|
|
|
- }
|
|
|
- if (!param["TakeImage"]["CamDenoise"]["found"]) {
|
|
|
- param["TakeImage"]["CamDenoise"]["found"] = true;
|
|
|
- param["TakeImage"]["CamDenoise"].value1 = '0';
|
|
|
- }
|
|
|
- if (!param["TakeImage"]["CamZoom"]["found"]) {
|
|
|
- param["TakeImage"]["CamZoom"]["found"] = true;
|
|
|
- param["TakeImage"]["CamZoom"].value1 = 'false';
|
|
|
- }
|
|
|
- if (!param["TakeImage"]["CamZoomOffsetX"]["found"]) {
|
|
|
- param["TakeImage"]["CamZoomOffsetX"]["found"] = true;
|
|
|
- param["TakeImage"]["CamZoomOffsetX"].value1 = '0';
|
|
|
- }
|
|
|
- if (!param["TakeImage"]["CamZoomOffsetY"]["found"]) {
|
|
|
- param["TakeImage"]["CamZoomOffsetY"]["found"] = true;
|
|
|
- param["TakeImage"]["CamZoomOffsetY"].value1 = '0';
|
|
|
- }
|
|
|
- if (!param["TakeImage"]["CamZoomSize"]["found"]) {
|
|
|
- param["TakeImage"]["CamZoomSize"]["found"] = true;
|
|
|
- param["TakeImage"]["CamZoomSize"].value1 = '0';
|
|
|
- }
|
|
|
- if (!param["TakeImage"]["LEDIntensity"]["found"]) {
|
|
|
- param["TakeImage"]["LEDIntensity"]["found"] = true;
|
|
|
- param["TakeImage"]["LEDIntensity"].value1 = '50';
|
|
|
- }
|
|
|
-
|
|
|
- return param;
|
|
|
-}
|
|
|
-
|
|
|
function getConfigParameters() {
|
|
|
return param;
|
|
|
}
|