From 6df1a30681e3c8d2f50e4bfe1acf69df64971a05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20Fr=C3=B6hle?= Date: Sat, 24 Nov 2018 20:40:35 +0100 Subject: [PATCH] ap0v --- dist/autoloader.js | 64 +++++++++++++++++++-------------------- dist/standalone.js | 2 +- script/mission/handler.js | 62 ++++++++++++++++++------------------- 3 files changed, 62 insertions(+), 66 deletions(-) diff --git a/dist/autoloader.js b/dist/autoloader.js index 2da1c1f..0811120 100755 --- a/dist/autoloader.js +++ b/dist/autoloader.js @@ -1,4 +1,4 @@ -/*Generated on:Sat Nov 24 2018 20:31:15 GMT+0100 (CET)*/ +/*Generated on:Sat Nov 24 2018 20:40:34 GMT+0100 (CET)*/ var AutomaticDispose_Branch = "master"; var AutomaticDispose_URL = "https://jf.git.rest/Jomaar/automatic-dispose/raw/branch/"; var da_lss_adis_time = new Date().getTime(); @@ -5423,39 +5423,39 @@ ADisDB.on("ready", () => { } function AD_StartAlarmProcess() { - console.log(" Automatic Dispose: Starte Alarmierungsprozess"); - - setTimeout(function () { - Promise.resolve().then(async () => { - return await ADis_PrepareVehicleNeedList(); - }).then(async () => { - return await ADis_CollectInvolvedVehicles(); - }).then(async () => { - return await ADis_CollectPatients(); + Promise.resolve().then(async () => { + return await ADis_PrepareVehicleNeedList(); + }).then(async () => { + return await ADis_CollectInvolvedVehicles(); + }).then(async () => { + return await ADis_CollectPatients(); + }) + .then(async () => { + return await Promise.all([ + ADis_ProcessEmergencyMedicalService(), + ADis_ProcessFireDepartment(), + ADis_ProcessPoliceDepartment(), + ADis_ProcessTechnicalEmergencyService(), + ADis_ProcessWaterRescue(), + ]).then((result) => { + var updateData = { + last_check: CurrentTime, + next_check: CurrentTime + 60 + }; + tellParent(` + console.log('ok:${window.name}:${MissionID}'); + ADis_MissionUpdateDone('${window.name}', '${MissionID}'); + `); + if (['adis-ownmissions', 'adis-krankentransporte', 'adis-verbandmission'].indexOf(window.name) !== -1) { + setTimeout(() => { + $('#mission_alarm_btn').click(); + }, 250); + } }) - .then(async () => { - return await Promise.all([ - ADis_ProcessEmergencyMedicalService(), - ADis_ProcessFireDepartment(), - ADis_ProcessPoliceDepartment(), - ADis_ProcessTechnicalEmergencyService(), - ADis_ProcessWaterRescue(), - ]).then((result) => { - var updateData = { - last_check: CurrentTime, - next_check: CurrentTime + 60 - }; - tellParent("console.log('ok:"+window.name+" "+ MissionID+"');ADis_MissionUpdateDone('"+window.name+"', '"+MissionID+"');"); - if (['adis-ownmissions', 'adis-krankentransporte', 'adis-verbandmission'].indexOf(window.name) != -1) { - setTimeout(() => { - $('#mission_alarm_btn').click(); - }, 250); - } - }) - }); + }); - }, 500); + }, 500); } // - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- @@ -5788,7 +5788,6 @@ ADisDB.on("ready", () => { if (typeof MissionConfig.fire_department == "object") // Wenn der FD-Block in der Config definiert ist { - console.log(ADis_VehiclesNeed); ADis_VehiclesNeed["0"] += parseInt(MissionConfig.fire_department.num_LF); ADis_VehiclesNeed["3"] += parseInt(MissionConfig.fire_department.num_ELW_1); @@ -6230,7 +6229,6 @@ ADisDB.on("ready", () => { for (VehicleTypeID = 0; VehicleTypeID <= MaxVehicleID; VehicleTypeID++) { ADis_CountInvolvedVehiclesOfType(VehicleTypeID); } - console.log("ADis_PrepareVehicleNeedList: ok"); return true; } diff --git a/dist/standalone.js b/dist/standalone.js index e3f70a2..2595e5f 100644 --- a/dist/standalone.js +++ b/dist/standalone.js @@ -1,4 +1,4 @@ -/*Generated on:Sat Nov 24 2018 20:31:15 GMT+0100 (CET)*/ +/*Generated on:Sat Nov 24 2018 20:40:34 GMT+0100 (CET)*/ function includesString(string1, string2) { return string1.toLowerCase().includes(string2.toLowerCase()); } diff --git a/script/mission/handler.js b/script/mission/handler.js index a3ea603..a5bcf8f 100755 --- a/script/mission/handler.js +++ b/script/mission/handler.js @@ -146,39 +146,39 @@ function AD_GetMissionConfiguration(MissionType) { } function AD_StartAlarmProcess() { - console.log(" Automatic Dispose: Starte Alarmierungsprozess"); - - setTimeout(function () { - Promise.resolve().then(async () => { - return await ADis_PrepareVehicleNeedList(); - }).then(async () => { - return await ADis_CollectInvolvedVehicles(); - }).then(async () => { - return await ADis_CollectPatients(); + Promise.resolve().then(async () => { + return await ADis_PrepareVehicleNeedList(); + }).then(async () => { + return await ADis_CollectInvolvedVehicles(); + }).then(async () => { + return await ADis_CollectPatients(); + }) + .then(async () => { + return await Promise.all([ + ADis_ProcessEmergencyMedicalService(), + ADis_ProcessFireDepartment(), + ADis_ProcessPoliceDepartment(), + ADis_ProcessTechnicalEmergencyService(), + ADis_ProcessWaterRescue(), + ]).then((result) => { + var updateData = { + last_check: CurrentTime, + next_check: CurrentTime + 60 + }; + tellParent(` + console.log('ok:${window.name}:${MissionID}'); + ADis_MissionUpdateDone('${window.name}', '${MissionID}'); + `); + if (['adis-ownmissions', 'adis-krankentransporte', 'adis-verbandmission'].indexOf(window.name) !== -1) { + setTimeout(() => { + $('#mission_alarm_btn').click(); + }, 250); + } }) - .then(async () => { - return await Promise.all([ - ADis_ProcessEmergencyMedicalService(), - ADis_ProcessFireDepartment(), - ADis_ProcessPoliceDepartment(), - ADis_ProcessTechnicalEmergencyService(), - ADis_ProcessWaterRescue(), - ]).then((result) => { - var updateData = { - last_check: CurrentTime, - next_check: CurrentTime + 60 - }; - tellParent("console.log('ok:"+window.name+" "+ MissionID+"');ADis_MissionUpdateDone('"+window.name+"', '"+MissionID+"');"); - if (['adis-ownmissions', 'adis-krankentransporte', 'adis-verbandmission'].indexOf(window.name) != -1) { - setTimeout(() => { - $('#mission_alarm_btn').click(); - }, 250); - } - }) - }); + }); - }, 500); + }, 500); } // - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- @@ -511,7 +511,6 @@ function ADis_ProcessFireDepartment() { if (typeof MissionConfig.fire_department == "object") // Wenn der FD-Block in der Config definiert ist { - console.log(ADis_VehiclesNeed); ADis_VehiclesNeed["0"] += parseInt(MissionConfig.fire_department.num_LF); ADis_VehiclesNeed["3"] += parseInt(MissionConfig.fire_department.num_ELW_1); @@ -953,7 +952,6 @@ function ADis_PrepareVehicleNeedList() { for (VehicleTypeID = 0; VehicleTypeID <= MaxVehicleID; VehicleTypeID++) { ADis_CountInvolvedVehiclesOfType(VehicleTypeID); } - console.log("ADis_PrepareVehicleNeedList: ok"); return true; }