Check of RunwayNodes
This commit is contained in:
parent
503dacd54a
commit
fc25b62737
@ -46,11 +46,11 @@
|
|||||||
this.$store.dispatch('removeFrequency', this.frequency)
|
this.$store.dispatch('removeFrequency', this.frequency)
|
||||||
},
|
},
|
||||||
isValid (frequency) {
|
isValid (frequency) {
|
||||||
let ok = frequency >= 118 && frequency <= 137
|
let ok = frequency >= 11800 && frequency <= 13700
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
let fractions = (frequency - Math.trunc(frequency)) * 1000
|
let fractions = (frequency - (Math.trunc(frequency/100)*100))
|
||||||
let subFraction = Math.round(fractions % 25)
|
let subFraction = Math.round(fractions % 25)
|
||||||
switch (subFraction) {
|
switch (subFraction) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -100,7 +100,7 @@
|
|||||||
// setter
|
// setter
|
||||||
set: function (newValue) {
|
set: function (newValue) {
|
||||||
this.frequency.value = newValue;
|
this.frequency.value = newValue;
|
||||||
ok = this.isValid(newValue);
|
this.ok = this.isValid(newValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -125,11 +125,17 @@ async function checkGroundnet(data) {
|
|||||||
|
|
||||||
okNodes = okNodes.filter((v, i) => okNodes.indexOf(v) === i);
|
okNodes = okNodes.filter((v, i) => okNodes.indexOf(v) === i);
|
||||||
var allLegitimateEndNodes = parkings.concat(runwayNodes).concat(pushbackNodes);
|
var allLegitimateEndNodes = parkings.concat(runwayNodes).concat(pushbackNodes);
|
||||||
var notOkNodes = parkings.concat(runwayNodes).filter(
|
var notOkNodes = parkings.filter(
|
||||||
(v, i) => okNodes.indexOf(v) < 0
|
(v, i) => okNodes.indexOf(v) < 0
|
||||||
).map(
|
).map(
|
||||||
id => { return { id: id, message: 'No way to each runway' } }
|
id => { return { id: id, message: 'No way from parking to each runway' } }
|
||||||
|
);
|
||||||
|
var notOkNodes2 = runwayNodes.filter(
|
||||||
|
(v, i) => okNodes.indexOf(v) < 0
|
||||||
|
).map(
|
||||||
|
id => { return { id: id, message: 'No way from runway to each parking' } }
|
||||||
);
|
);
|
||||||
|
|
||||||
if (parkings.length === 0) {
|
if (parkings.length === 0) {
|
||||||
notOkNodes.push({ id: 0, message: 'No parkings' });
|
notOkNodes.push({ id: 0, message: 'No parkings' });
|
||||||
}
|
}
|
||||||
@ -146,6 +152,8 @@ async function checkGroundnet(data) {
|
|||||||
v => { return { id: Number(v[0]), message: 'Node not a legimate end' } }
|
v => { return { id: Number(v[0]), message: 'Node not a legimate end' } }
|
||||||
);
|
);
|
||||||
notOkNodes = notOkNodes.concat(danglingEnds);
|
notOkNodes = notOkNodes.concat(danglingEnds);
|
||||||
|
notOkNodes = notOkNodes.concat(notOkNodes2);
|
||||||
|
|
||||||
// Ends that are not on Runway and not a Parking or Pushback
|
// Ends that are not on Runway and not a Parking or Pushback
|
||||||
var wrongPushbackEnds = pushbackNodes.filter(
|
var wrongPushbackEnds = pushbackNodes.filter(
|
||||||
(v, i) => allEnds.map(a => Number(a[0])).indexOf(Number(v)) < 0
|
(v, i) => allEnds.map(a => Number(a[0])).indexOf(Number(v)) < 0
|
||||||
|
Loading…
Reference in New Issue
Block a user