portree_kid 4 years ago
parent 93a5c954e5
commit febd720588

@ -31,9 +31,8 @@ export function checkMapper(o) {
'box': o.box !== undefined ? o.box.getLatLngs() : null
};
} else if (o instanceof L.RunwayNode) {
console.log(o)
return { 'index': Number(o['glueindex']), '_leaflet_id': o._leaflet_id, 'lat': o._latlng.lat, 'lng': o._latlng.lng, 'type': 'runway' };
console.log(o)
return { 'index': Number(o['glueindex']), '_leaflet_id': o._leaflet_id, 'lat': o._latlng.lat, 'lng': o._latlng.lng, 'type': 'runway' };
} else if (o instanceof L.HoldNode) {
console.log(o)
return { 'index': Number(o['glueindex']), '_leaflet_id': o._leaflet_id, 'type': o.holdPointType };
@ -44,7 +43,6 @@ export function checkMapper(o) {
}
} else if (o instanceof L.Polyline) {
console.log(o)
//_latlngs[""0""].__vertex.glueindex
var latLngs = o.getLatLngs().map(l => ({ lat: l.lat, lng: l.lng, index: l.glueindex }));
if (o.options.attributes===undefined) {
return null;

@ -190,7 +190,7 @@ You should have received a copy of the GNU General Public License along with FG
view.scanning = Boolean(workery.checking)
workery.view = view
}
}, 1000)
}, 500)
},
test() {
this.$parent.$parent.$refs.editLayer.test()

@ -117,7 +117,7 @@
view.scanning = Boolean(workery.checking)
workery.view = view
}
}, 1000)
}, 500)
},
check () {
try {
@ -137,15 +137,27 @@
worker.progress = 0
// var worker = new Worker(fileUrl('src/renderer/utils/worker.js'))
this.worker = worker
var xml = []
var groundnet = []
this.$parent.$parent.$parent.$refs.editLayer.groundnetLayerGroup.eachLayer(l => {
console.log(l)
xml.push(l)
})
if (l instanceof L.Polyline) {
l._latlngs[0].glueindex = this.begin;
l._latlngs.slice(-1)[0].glueindex = this.end;
l.extensions(this)
}
var features = xml.map(mapper.checkMapper).filter(n => n)
groundnet.push(l)
})
var features = groundnet.map(mapper.checkMapper).filter(n => n)
var pavement = []
this.$parent.$parent.$parent.$refs.pavementLayer.pavement.eachLayer(l => {
console.log(l)
pavement.push(l)
})
var features2 = pavement.map(mapper.checkMapper).filter(n => n)
worker.postMessage(['check', features ] )
worker.postMessage(['check', features.concat(features2) ] )
this.pollData()
// the reply
var store = this.$store

@ -33,15 +33,17 @@ exports.extendTaxiSegment = function (taxiwaySegment) {
this.editLayer = editLayer;
this._latlngs[0].glueindex = this.begin;
this._latlngs.slice(-1)[0].glueindex = this.end;
if (typeof this.featureLookup[this.begin] === 'undefined') {
this.featureLookup[this.begin] = new Array();
}
if (typeof this.featureLookup[this.end] === 'undefined') {
this.featureLookup[this.end] = new Array();
if(this.featureLookup) {
if (typeof this.featureLookup[this.begin] === 'undefined') {
this.featureLookup[this.begin] = new Array();
}
if (typeof this.featureLookup[this.end] === 'undefined') {
this.featureLookup[this.end] = new Array();
}
this.featureLookup[this.begin].push(this);
this.featureLookup[this.end].push(this);
this.bidirectional = true;
}
this.featureLookup[this.begin].push(this);
this.featureLookup[this.end].push(this);
this.bidirectional = true;
};
taxiwaySegment.__proto__.select = function () {
this.options.attributes.selected = true;

@ -98,11 +98,11 @@ async function checkGroundnet(data) {
console.log(edges);
if (edges === undefined) {
resolve({ id: -1, message: check_msg.NO_EDGES });
resolve([{ id: -1, message: check_msg.NO_EDGES }]);
}
this.postMessage(['progress', 1]);
if (runways.length === 0) {
resolve({ id: -1, message: check_msg.NO_RUNWAYS });
resolve([{ id: -1, message: check_msg.NO_RUNWAYS }]);
}
this.postMessage(['progress', 1]);
edges.forEach(edge => {
@ -380,6 +380,7 @@ async function checkGroundnet(data) {
//Check if nodes no normal nodes are on runway
normalNodes.forEach(normalNode => {
//debugger;
if( runways.filter(r => turf.booleanContains(r, latToTurf(normalNode))).length > 0 ) {
notOkNodes.push({ id: normalNode.index, message: check_msg.NON_RUNWAYNODE_ON_RUNWAY });
}

Loading…
Cancel
Save