This commit is contained in:
portree_kid
2020-03-04 10:54:39 +01:00
parent 8b3b8635c4
commit 37b14de1fd
5 changed files with 59 additions and 9 deletions
+6 -5
View File
@@ -37,12 +37,13 @@ onmessage = function (event) {
async function checkGroundnet(data) {
var promise = new Promise(function (resolve, reject) {
try {
this.max = 4;
debugger;
// debugger;
var parkings = data.map(mapParkings).filter(n => n !== undefined);
var runwayNodes = data.map(mapRunwayNodes).filter(n => n !== undefined);
var edges = data.map(mapEdges).filter(n => n !== undefined);
this.max = parkings.length * runwayNodes.length;
this.postMessage(['max', this.max]);
var graph = {};
parkings.forEach(element => {
graph[element] = {};
@@ -69,7 +70,7 @@ async function checkGroundnet(data) {
okNodes.push(parkingNode);
okNodes.push(runwayNode);
}
this.progress += 1;
this.postMessage(['progress', 1]);
});
});
okNodes = okNodes.filter((v,i) => okNodes.indexOf(v) === i);
@@ -96,7 +97,7 @@ async function checkGroundnet(data) {
// check1(graph);
// check2();
// this.progress += 1;
// this.postMessage(['progress', 1]);
resolve(notOkNodes);
} catch (error) {