methoden mit zufriffsmodifizierer ausgestattet

This commit is contained in:
dh
2025-02-05 15:51:31 +01:00
parent 1bbcf972a4
commit 0dde43a71f
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -81,7 +81,7 @@ class Boiler_2_Stufig_Landwirtschaft extends IPSModule
} }
} }
function getNextTimeAndTemperature($zeitplan) { public function getNextTimeAndTemperature($zeitplan) {
if (empty($zeitplan)) { if (empty($zeitplan)) {
return null; return null;
} }
@@ -95,7 +95,7 @@ class Boiler_2_Stufig_Landwirtschaft extends IPSModule
return $zeitplan[0]; return $zeitplan[0];
} }
function calculateRemainingTime($nextTime) { public function calculateRemainingTime($nextTime) {
$currentTime = new DateTime(); $currentTime = new DateTime();
$nextDateTime = DateTime::createFromFormat('H:i', $nextTime); $nextDateTime = DateTime::createFromFormat('H:i', $nextTime);
if ($nextDateTime < $currentTime) { if ($nextDateTime < $currentTime) {
@@ -105,7 +105,7 @@ class Boiler_2_Stufig_Landwirtschaft extends IPSModule
return $interval->h + ($interval->i / 60); return $interval->h + ($interval->i / 60);
} }
function calculateRequiredHeat($boilervolumen, $tempDiff) { public function calculateRequiredHeat($boilervolumen, $tempDiff) {
// Annahme: spezifische Wärmekapazität von Wasser = 4.186 J/g°C // Annahme: spezifische Wärmekapazität von Wasser = 4.186 J/g°C
// 1 Liter Wasser = 1000 Gramm // 1 Liter Wasser = 1000 Gramm
$specificHeatCapacity = 4.186; // J/g°C $specificHeatCapacity = 4.186; // J/g°C
@@ -113,7 +113,7 @@ class Boiler_2_Stufig_Landwirtschaft extends IPSModule
return $specificHeatCapacity * $waterMass * $tempDiff; // Joules return $specificHeatCapacity * $waterMass * $tempDiff; // Joules
} }
function canBoilerReachTemperature($boilervolumen, $boilerTemper, $nextTemp, $remainingTime, $vollleistung) { public function canBoilerReachTemperature($boilervolumen, $boilerTemper, $nextTemp, $remainingTime, $vollleistung) {
$tempDiff = $nextTemp - $boilerTemper; $tempDiff = $nextTemp - $boilerTemper;
$requiredHeat = calculateRequiredHeat($boilervolumen, $tempDiff); $requiredHeat = calculateRequiredHeat($boilervolumen, $tempDiff);
$availableHeat = $vollleistung * $remainingTime * 3600; // Leistung in Watt * Zeit in Sekunden $availableHeat = $vollleistung * $remainingTime * 3600; // Leistung in Watt * Zeit in Sekunden
+1 -1
View File
@@ -6,7 +6,7 @@
"compatibility": { "compatibility": {
"version": "7.1" "version": "7.1"
}, },
"version": "1.029", "version": "1.030",
"build": 0, "build": 0,
"date": 0 "date": 0
} }