addDistanceFix
This commit is contained in:
parent
9199977b89
commit
196bbfd05b
@ -115,7 +115,7 @@ window.addEventListener("load", function(evt) {
|
||||
});
|
||||
|
||||
function prepareForDistanceCalc(data) {
|
||||
if('SOURCE_TCP' in data && data.SOURCE_TCP.length > 0 && 'SOURCE_SERIAL' in data) {
|
||||
if('SOURCE_TCP' in data && data.SOURCE_TCP.length > 0 && 'SOURCE_SERIAL' in data && data.SOURCE_SERIAL.length > 0) {
|
||||
let sensorPoints = [];
|
||||
data.SOURCE_TCP.forEach(element => {
|
||||
if (element.Position[0] !== 0 && element.Position[1] !== 0) {
|
||||
@ -123,7 +123,6 @@ function prepareForDistanceCalc(data) {
|
||||
differenceMs: Number.MAX_VALUE,
|
||||
tcp: element,
|
||||
ser: null,
|
||||
speed: null
|
||||
})
|
||||
}
|
||||
})
|
||||
@ -151,7 +150,18 @@ function prepareForDistanceCalc(data) {
|
||||
differenceMs: Number.MAX_VALUE,
|
||||
tcp: null,
|
||||
ser: element,
|
||||
speed: null
|
||||
})
|
||||
}
|
||||
})
|
||||
return sensorPoints
|
||||
} else if ('SOURCE_TCP' in data && data.SOURCE_TCP.length > 0) {
|
||||
let sensorPoints = [];
|
||||
data.SOURCE_TCP.forEach(element => {
|
||||
if (element.Position[0] !== 0 && element.Position[1] !== 0) {
|
||||
sensorPoints.push({
|
||||
differenceMs: Number.MAX_VALUE,
|
||||
tcp: element,
|
||||
ser: null,
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user