This commit is contained in:
2018-11-24 20:40:35 +01:00
parent fbee0fb7bc
commit 6df1a30681
3 changed files with 62 additions and 66 deletions

View File

@@ -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;
}