Fix copy camera settings (#30)
This commit is contained in:
parent
c702b9421a
commit
319af970ba
|
@ -364,8 +364,8 @@ function updateVisionCameraDataFromJson(i, data) {
|
||||||
var wbAuto = false;
|
var wbAuto = false;
|
||||||
var exAuto = false;
|
var exAuto = false;
|
||||||
|
|
||||||
for (var i = 0; i < data.properties.length; i++) {
|
for (var j = 0; j < data.properties.length; j++) {
|
||||||
var name = data.properties[i].name;
|
var name = data.properties[j].name;
|
||||||
|
|
||||||
// remove all raw properties
|
// remove all raw properties
|
||||||
if (name.startsWith('raw_')) {
|
if (name.startsWith('raw_')) {
|
||||||
|
@ -374,13 +374,13 @@ function updateVisionCameraDataFromJson(i, data) {
|
||||||
|
|
||||||
// brightness
|
// brightness
|
||||||
if (name === 'brightness') {
|
if (name === 'brightness') {
|
||||||
data.brightness = data.properties[i].value;
|
data.brightness = data.properties[j].value;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// white balance
|
// white balance
|
||||||
if (name === 'white_balance_temperature_auto') {
|
if (name === 'white_balance_temperature_auto') {
|
||||||
if (data.properties[i].value === true) {
|
if (data.properties[j].value === true) {
|
||||||
data['white balance'] = 'auto';
|
data['white balance'] = 'auto';
|
||||||
wbAuto = true;
|
wbAuto = true;
|
||||||
}
|
}
|
||||||
|
@ -395,7 +395,7 @@ function updateVisionCameraDataFromJson(i, data) {
|
||||||
|
|
||||||
// exposure
|
// exposure
|
||||||
if (name === 'exposure_auto') {
|
if (name === 'exposure_auto') {
|
||||||
if (data.properties[i].value === 3) {
|
if (data.properties[j].value === 3) {
|
||||||
data.exposure = 'auto';
|
data.exposure = 'auto';
|
||||||
exAuto = true;
|
exAuto = true;
|
||||||
}
|
}
|
||||||
|
@ -407,7 +407,7 @@ function updateVisionCameraDataFromJson(i, data) {
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
newProps.push(data.properties[i]);
|
newProps.push(data.properties[j]);
|
||||||
}
|
}
|
||||||
data.properties = newProps;
|
data.properties = newProps;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user