This commit is contained in:
+4
-23
@@ -2757,29 +2757,10 @@ class Manager extends IPSModule implements ManagerSchnittstelle
|
||||
return null;
|
||||
}
|
||||
|
||||
$jetzt = time();
|
||||
$naechsterAbstand = PHP_INT_MAX;
|
||||
$vorgabe = null;
|
||||
foreach ($fahrplan['points'] as $punkt) {
|
||||
if (!is_array($punkt)
|
||||
|| !is_string($punkt['time'] ?? null)
|
||||
|| (!is_int($punkt['gridTargetW'] ?? null)
|
||||
&& !is_float($punkt['gridTargetW'] ?? null))
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
$zeitpunkt = strtotime($punkt['time']);
|
||||
if ($zeitpunkt === false) {
|
||||
continue;
|
||||
}
|
||||
$abstand = abs($zeitpunkt - $jetzt);
|
||||
if ($abstand < $naechsterAbstand) {
|
||||
$naechsterAbstand = $abstand;
|
||||
$vorgabe = (float) $punkt['gridTargetW'];
|
||||
}
|
||||
}
|
||||
|
||||
return $naechsterAbstand <= 1800 ? $vorgabe : null;
|
||||
return ManagerRegler::interpolierteFahrplanVorgabe(
|
||||
$fahrplan['points'],
|
||||
time()
|
||||
);
|
||||
}
|
||||
|
||||
private function synchronisiereAnlagentopologie(): void
|
||||
|
||||
Reference in New Issue
Block a user