feat(forecast): integrate full forecast charts and complete SDL visualization
Tests / test (push) Failing after 52s
Tests / test (push) Failing after 52s
This commit is contained in:
@@ -273,8 +273,9 @@ trait ManagerEnergieTrait
|
||||
throw new RuntimeException('Unterobjekt EnergyPie hat einen unpassenden Typ.');
|
||||
}
|
||||
IPS_SetHidden($instanzID, false);
|
||||
$this->synchronisiereEnergyPieAnteile($instanzID);
|
||||
|
||||
return 'Bestehende Energy-Pie-Konfiguration bleibt unveraendert.';
|
||||
return 'Bestehende Energy-Pie-Messquellen und Darstellung bleiben unveraendert.';
|
||||
}
|
||||
IPS_SetName($instanzID, 'Energy Pie');
|
||||
IPS_SetPosition($instanzID, 500);
|
||||
@@ -288,11 +289,35 @@ trait ManagerEnergieTrait
|
||||
] as $property => $wert) {
|
||||
IPS_SetProperty($instanzID, $property, $wert);
|
||||
}
|
||||
$this->synchronisiereEnergyPieAnteile($instanzID, false);
|
||||
IPS_ApplyChanges($instanzID);
|
||||
|
||||
return 'Energy Pie wurde erstellt oder aktualisiert.';
|
||||
}
|
||||
|
||||
private function synchronisiereEnergyPieAnteile(int $instanzID, bool $anwenden = true): void
|
||||
{
|
||||
// Physischer Netzbezug enthaelt SDL, die Hausenergie dagegen nicht.
|
||||
$berechenbar = !$this->ReadPropertyBoolean('SDLAktiv');
|
||||
$konfiguration = json_decode(IPS_GetConfiguration($instanzID), true, 512, JSON_THROW_ON_ERROR);
|
||||
if (!is_array($konfiguration) || !array_key_exists('EnergieanteileBerechenbar', $konfiguration)) {
|
||||
IPS_SetHidden($instanzID, !$berechenbar);
|
||||
if (!$berechenbar) {
|
||||
IPS_LogMessage('Enelix Manager ' . $this->InstanceID,
|
||||
'Energy Pie ausgeblendet: Enelix Utils aktualisieren, damit bei aktiver SDL keine unbestimmbaren Energieanteile angezeigt werden.');
|
||||
}
|
||||
return;
|
||||
}
|
||||
IPS_SetHidden($instanzID, false);
|
||||
if (IPS_GetProperty($instanzID, 'EnergieanteileBerechenbar') === $berechenbar) {
|
||||
return;
|
||||
}
|
||||
IPS_SetProperty($instanzID, 'EnergieanteileBerechenbar', $berechenbar);
|
||||
if ($anwenden) {
|
||||
IPS_ApplyChanges($instanzID);
|
||||
}
|
||||
}
|
||||
|
||||
private function erstelleEnergiefluss(): string
|
||||
{
|
||||
if (!in_array(self::ENERGY_FLOW_MODULE_ID, IPS_GetModuleList(), true)) {
|
||||
|
||||
@@ -23,7 +23,7 @@ trait ManagerNetzfahrplanV4AktivtestTrait
|
||||
$this->RegisterAttributeInteger('NetzfahrplanV4AktivtestEnde', 0);
|
||||
$this->RegisterVariableBoolean(
|
||||
'NetzfahrplanV4Aktivtest',
|
||||
'V4 Prognosemanager aktiv (Testbetrieb)',
|
||||
'Netzfahrplansteuerung (Testbetrieb)',
|
||||
'~Switch',
|
||||
952
|
||||
);
|
||||
|
||||
@@ -21,7 +21,7 @@ trait ManagerNetzfahrplanV4DatenTrait
|
||||
$this->RegisterAttributeInteger('NetzfahrplanV4DatenVersion', 0);
|
||||
$this->RegisterAttributeInteger('NetzfahrplanV4DatenVersuch', 0);
|
||||
$this->RegisterAttributeInteger('NetzfahrplanV4DatenFehlerzahl', 0);
|
||||
$this->RegisterVariableString('NetzfahrplanV4Datenstatus', 'V4 Messdaten und Modellversorgung', '', 199);
|
||||
$this->RegisterVariableString('NetzfahrplanV4Datenstatus', 'Prognosedaten und Modellversorgung', '', 199);
|
||||
$this->RegisterTimer('NetzfahrplanV4DatenErfassen', 0,
|
||||
"IPS_RequestAction(\$_IPS['TARGET'], 'NetzfahrplanV4DatenErfassen', true);");
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@ trait ManagerNetzfahrplanV4EmpfangTrait
|
||||
$this->RegisterAttributeString('NetzfahrplanV4EmpfangStatus', '{}');
|
||||
$this->RegisterAttributeString('NetzfahrplanV4LetzteBestaetigung', '{}');
|
||||
$this->RegisterAttributeInteger('NetzfahrplanV4NaechsterAbruf', 0);
|
||||
$this->RegisterVariableString('NetzfahrplanV4Vorschau', 'V4 Sollwert-Vorschau (KEINE Stellfreigabe)', '~HTMLBox', 950);
|
||||
$this->RegisterVariableString('NetzfahrplanV4VorschauJSON', 'V4 Vorschau Diagnose (nur lesen)', '', 951);
|
||||
$this->RegisterVariableString('NetzfahrplanV4Vorschau', 'Netzfahrplanvorschau (keine Stellfreigabe)', '~HTMLBox', 950);
|
||||
$this->RegisterVariableString('NetzfahrplanV4VorschauJSON', 'Netzfahrplandiagnose', '', 951);
|
||||
$this->RegisterTimer('NetzfahrplanV4VorschauAktualisieren', 0,
|
||||
"IPS_RequestAction(\$_IPS['TARGET'], 'NetzfahrplanV4VorschauAktualisieren', true);");
|
||||
$this->RegisterTimer('NetzfahrplanV4EmpfangAktualisieren', 0,
|
||||
@@ -256,7 +256,7 @@ trait ManagerNetzfahrplanV4EmpfangTrait
|
||||
$value = array_merge(['gridTargetW' => null, 'plannedBatteryW' => null, 'previewBatteryW' => null], $value,
|
||||
['canDispatch' => false, 'liveEnabled' => false]);
|
||||
$escape = static fn($v): string => htmlspecialchars((string) $v, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
|
||||
$html = '<h3>V4: NUR VORSCHAU - KEINE STELLFREIGABE</h3><table>';
|
||||
$html = '<h3>Netzfahrplanvorschau - keine Stellfreigabe</h3><table>';
|
||||
foreach (['status' => 'Status', 'planId' => 'Plan-ID', 'family' => 'Modellfamilie', 'step' => 'Zeitschritt (UTC)',
|
||||
'stepValidUntil' => 'Gueltig bis', 'gridTargetW' => 'Geplantes Netzziel W', 'plannedBatteryW' => 'Geplante Batterie W',
|
||||
'previewBatteryW' => 'Lokal berechnete Batterie W (nicht ausgegeben)', 'reason' => 'Ablehnungsgrund'] as $key => $label) {
|
||||
|
||||
@@ -9,6 +9,17 @@ use LogicException;
|
||||
/** Form composition only. Existing configuration, control authority and backend stay unchanged. */
|
||||
final class ManagerPrognoseFormular
|
||||
{
|
||||
/** Stable identifiers remain for archives and integrations; operation belongs in Forecast. */
|
||||
public static function laufzeitAnzeige(): array
|
||||
{
|
||||
return [
|
||||
'NetzfahrplanV4Aktivtest' => 'Netzfahrplansteuerung (Testbetrieb)',
|
||||
'NetzfahrplanV4Vorschau' => 'Netzfahrplanvorschau (keine Stellfreigabe)',
|
||||
'NetzfahrplanV4VorschauJSON' => 'Netzfahrplandiagnose',
|
||||
'NetzfahrplanV4Datenstatus' => 'Prognosedaten und Modellversorgung',
|
||||
];
|
||||
}
|
||||
|
||||
public static function startErlaubt(array $zustand): bool
|
||||
{
|
||||
foreach (['prognoseAktiv', 'lizenziert', 'senderAktiv', 'empfangAktiv', 'managerAktiv',
|
||||
|
||||
Reference in New Issue
Block a user