Programmaschema: <= moest < zijn; betere debugging
This commit is contained in:
@@ -89,7 +89,7 @@ QUERY;
|
||||
if($item->startdate) print "-- (Item start is {$item->startdate->format('Y-m-d H:i')}, end is ". ($item->enddate ? $item->enddate->format('Y-m-d H:i') : "never") . ")<br/>\n";
|
||||
}
|
||||
|
||||
if($item->startdate && $itemStart <= $item->startdate) {
|
||||
if($item->startdate && $itemStart < $item->startdate) {
|
||||
if($DEBUG) print "-- Skipping {$item->name} {$item->suffix} (#$item->scheduleid) at {$itemStart->format('Y-m-d H:i')} because it is before the schedule instance start.<br/>\n";
|
||||
} else if($item->enddate && $itemStart >= $item->enddate) {
|
||||
if($DEBUG) print "-- Skipping {$item->name} {$item->suffix} (#$item->scheduleid) at {$itemStart->format('Y-m-d H:i')} because it is after the schedule instance end.<br/>\n";
|
||||
@@ -112,7 +112,7 @@ QUERY;
|
||||
if($DEBUG) {
|
||||
print "<h2>Schedule changes</h2><ul>";
|
||||
foreach(clone $scheduleChanges as $c) {
|
||||
print "<li>#{$c[2]->scheduleid}: {$c[1]->format('d-m-Y H:i')}: " . ($c[0] == $START ? 'Start' : 'Einde') . " {$c[2]->name} {$c[2]->suffix}</li>";
|
||||
print "<li>#{$c[2]->scheduleid}: {$c[1]->format('d-m-Y H:i')}: " . ($c[0] == $START ? 'Start' : 'Einde') . " {$c[2]->name} {$c[2]->suffix} (prio {$c[2]->priority})</li>";
|
||||
}
|
||||
print "</ul><hr/>";
|
||||
}
|
||||
@@ -132,8 +132,12 @@ QUERY;
|
||||
$priority = $item[2]->priority;
|
||||
if($item[0] == $START) {
|
||||
if($active[$priority] != null) {
|
||||
print( "<b>Error:</b>" . $item[2]->name . ' starts at ' . $item[1]->format('d-m-Y H:i') . ' but ' . $active[$priority]->name . ' is still active then.' );
|
||||
print "<pre>"; var_dump($active); print "</pre>";
|
||||
print( "<b>Error:</b>" . $item[2]->name . ' starts at ' . $item[1]->format('d-m-Y H:i') . ' (prio ' . $item[2]->id . ') but ' . $active[$priority]->name . ' is still active then.' );
|
||||
if($DEBUG) {
|
||||
foreach($active as $prio => $act) {
|
||||
print "-- " . ($act ? $act->name : "[No program]") . " at prio $prio<br/>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// When a program starts, it becomes the active program in its layer
|
||||
@@ -152,7 +156,11 @@ QUERY;
|
||||
} else if($item[0] == $END) {
|
||||
if($active[$priority] == null) {
|
||||
print( "<b>Error:</b>" . $item[2]->name . ' ends at ' . $item[1]->format('d-m-Y H:i') . ' but no program is active at that priority and timestamp.');
|
||||
print "<pre>"; var_dump($active); print "</pre>";
|
||||
if($DEBUG) {
|
||||
foreach($active as $prio => $act) {
|
||||
print "-- " . ($act ? $act->name : "[No program]") . " at prio $prio<br/>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// When the program ends, its layer becomes inactive.
|
||||
|
||||
Reference in New Issue
Block a user