no message
This commit is contained in:
+23
-2
@@ -17,10 +17,31 @@ class PV_Visu extends IPSModule
|
|||||||
$this->SetVisualizationType(1);
|
$this->SetVisualizationType(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ApplyChanges(): void
|
public function ApplyChanges(): void
|
||||||
{
|
{
|
||||||
parent::ApplyChanges();
|
parent::ApplyChanges();
|
||||||
$this->GetVisualizationTile();
|
// Auf Änderungen der Zähler-Variablen reagieren
|
||||||
|
foreach (['VarProduction', 'VarConsumption', 'VarFeedIn', 'VarGrid'] as $prop) {
|
||||||
|
$vid = $this->ReadPropertyInteger($prop);
|
||||||
|
if ($vid > 0) {
|
||||||
|
// Register event for variable update
|
||||||
|
$this->RegisterMessage(\$vid, VM_UPDATE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function MessageSink(int $TimeStamp, int $SenderID, int $Message, $Data): void
|
||||||
|
{
|
||||||
|
if ($Message === VM_UPDATE) {
|
||||||
|
// bei jeder Aktualisierung einer Zählervariable neu senden
|
||||||
|
$this->UpdateData();
|
||||||
|
}
|
||||||
|
}(int $TimeStamp, int $SenderID, int $Message, $Data): void
|
||||||
|
{
|
||||||
|
if ($Message === VM_UPDATE) {
|
||||||
|
// bei jeder Aktualisierung einer Zählervariable neu senden
|
||||||
|
$this->UpdateData();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user