From fc25b6273773cb3b74672a4d3b16aa9f23e16969 Mon Sep 17 00:00:00 2001 From: portree_kid Date: Sat, 16 May 2020 10:47:18 +0200 Subject: [PATCH] Check of RunwayNodes --- src/renderer/components/Frequency.vue | 6 +++--- src/renderer/utils/check.js | 12 ++++++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/renderer/components/Frequency.vue b/src/renderer/components/Frequency.vue index 63a0ef1..5409ac2 100644 --- a/src/renderer/components/Frequency.vue +++ b/src/renderer/components/Frequency.vue @@ -46,11 +46,11 @@ this.$store.dispatch('removeFrequency', this.frequency) }, isValid (frequency) { - let ok = frequency >= 118 && frequency <= 137 + let ok = frequency >= 11800 && frequency <= 13700 if (!ok) { return false } - let fractions = (frequency - Math.trunc(frequency)) * 1000 + let fractions = (frequency - (Math.trunc(frequency/100)*100)) let subFraction = Math.round(fractions % 25) switch (subFraction) { case 0: @@ -100,7 +100,7 @@ // setter set: function (newValue) { this.frequency.value = newValue; - ok = this.isValid(newValue); + this.ok = this.isValid(newValue); } } } diff --git a/src/renderer/utils/check.js b/src/renderer/utils/check.js index 95c8b76..af4f1a4 100644 --- a/src/renderer/utils/check.js +++ b/src/renderer/utils/check.js @@ -125,11 +125,17 @@ async function checkGroundnet(data) { okNodes = okNodes.filter((v, i) => okNodes.indexOf(v) === i); var allLegitimateEndNodes = parkings.concat(runwayNodes).concat(pushbackNodes); - var notOkNodes = parkings.concat(runwayNodes).filter( + var notOkNodes = parkings.filter( (v, i) => okNodes.indexOf(v) < 0 ).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) { 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' } } ); notOkNodes = notOkNodes.concat(danglingEnds); + notOkNodes = notOkNodes.concat(notOkNodes2); + // Ends that are not on Runway and not a Parking or Pushback var wrongPushbackEnds = pushbackNodes.filter( (v, i) => allEnds.map(a => Number(a[0])).indexOf(Number(v)) < 0