update Mi 6. Mai 13:31:01 CEST 2020

This commit is contained in:
Robert Richter 2020-05-06 13:31:01 +02:00
parent 9317e71030
commit 8f16b67b03

View File

@ -449,6 +449,8 @@ socket.on('io.response', function (data) {
var item_agt = arrayItem.agt; var item_agt = arrayItem.agt;
// Variablen für Anzeige vorbereiten // Variablen für Anzeige vorbereiten
var pg_waip_uuid = arrayItem.waip_uuid; var pg_waip_uuid = arrayItem.waip_uuid;
console.log(arrayItem.waip_uuid);
console.log(pg_waip_uuid);
var pg_rmld_uuid = arrayItem.rmld_uuid; var pg_rmld_uuid = arrayItem.rmld_uuid;
var pg_start = new Date(arrayItem.set_time); var pg_start = new Date(arrayItem.set_time);
var pg_end = new Date(arrayItem.arrival_time); var pg_end = new Date(arrayItem.arrival_time);
@ -499,34 +501,28 @@ function add_resp_progressbar(p_uuid, p_id, p_type, p_agt, p_start, p_end) {
bar_background = ''; bar_background = '';
break; break;
}; };
var bar_uuid = 'bar-' + p_uuid;
// pruefen ob div mit id 'pg-'+p_id schon vorhanden ist // pruefen ob div mit id 'pg-'+p_id schon vorhanden ist
var pgbar = document.getElementById('pg-' + p_id); var pgbar = document.getElementById('pg-' + p_id);
if (!pgbar) { if (!pgbar) {
//$('#pg-' + p_type).append('<div id="pg-uuid-' + p_uuid + '"></div>'); $('#pg-' + p_type).append('<div class="progress mt-1 position-relative ' + bar_border + ' ' + bar_uuid + '" id="pg-' + p_id + '" style="height: 15px; font-size: 14px;"></div>');
$('#pg-' + p_type).append('<div class="progress mt-1 position-relative ' + bar_border + '" id="pg-' + p_id + '" style="height: 15px; font-size: 14px;"></div>');
$('#pg-' + p_id).append('<div id="pg-bar-' + p_id + '" class="progress-bar progress-bar-striped ' + bar_background + '" role="progressbar" style="width: 0%" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>'); $('#pg-' + p_id).append('<div id="pg-bar-' + p_id + '" class="progress-bar progress-bar-striped ' + bar_background + '" role="progressbar" style="width: 0%" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>');
$('#pg-bar-' + p_id).append('<small id="pg-text-' + p_id + '" class="justify-content-center d-flex position-absolute w-100"></small>'); $('#pg-bar-' + p_id).append('<small id="pg-text-' + p_id + '" class="justify-content-center d-flex position-absolute w-100"></small>');
} else { } else {
// TODO PG-Bar ändern falls neue/angepasste Rückmeldung
}; };
// TODO PG-Bar ändern falls neue Rückmeldung // Zeitschiene Anpassen
clearInterval(counter_rmld[p_id]); clearInterval(counter_rmld[p_id]);
counter_rmld[p_id] = 0; counter_rmld[p_id] = 0;
counter_rmld[p_id] = setInterval(function () { counter_rmld[p_id] = setInterval(function () {
do_rmld_bar(p_id, p_start, p_end); do_rmld_bar(p_id, p_start, p_end);
}, 1000); }, 1000);
}; };
function do_rmld_bar(p_id, start, end) { function do_rmld_bar(p_id, start, end) {
//console.log(p_id); //console.log(p_id);
today = new Date(); today = new Date();
// restliche Zeit ermitteln // restliche Zeit ermitteln
//var current_progress = Math.round(100 / (end.getTime() - start.getTime()) * (end.getTime() - today.getTime()));
var current_progress = Math.round(100 / (start.getTime() - end.getTime()) * (start.getTime() - today.getTime())); var current_progress = Math.round(100 / (start.getTime() - end.getTime()) * (start.getTime() - today.getTime()));
var diff = Math.abs(end - today); var diff = Math.abs(end - today);
@ -538,7 +534,6 @@ function do_rmld_bar(p_id, start, end) {
}; };
var minutes = minutesDifference + ':' + secondsDifference; var minutes = minutesDifference + ':' + secondsDifference;
// Progressbar anpassen // Progressbar anpassen
if (current_progress >= 100) { if (current_progress >= 100) {
$("#pg-bar-" + p_id) $("#pg-bar-" + p_id)
@ -555,10 +550,8 @@ function do_rmld_bar(p_id, start, end) {
}; };
}; };
function recount_rmld(p_uuid, item_type, pg_agt) {
var bar_uuid = 'bar-' + p_uuid;
function recount_rmld(pg_waip_uuid, item_type, pg_agt) {
var tmp_count = parseInt($('#' + item_type + '-counter').text()); var tmp_count = parseInt($('#' + item_type + '-counter').text());
$('#' + item_type + '-counter').text(tmp_count + 1); $('#' + item_type + '-counter').text(tmp_count + 1);