641 lines
22 KiB
PHP
641 lines
22 KiB
PHP
<?php
|
|
|
|
class Ladestation_Universal extends IPSModule
|
|
{
|
|
public function Create()
|
|
{
|
|
parent::Create();
|
|
|
|
// Ladestationspezifische Properties
|
|
$this->RegisterPropertyInteger("MinLeistung", 3600);
|
|
$this->RegisterPropertyInteger("MaxLeistung", 11000);
|
|
$this->RegisterPropertyInteger("MinLeistung_1ph", 1400);
|
|
$this->RegisterPropertyInteger("MaxLeistung_1ph", 7800);
|
|
$this->RegisterPropertyString("IP_Adresse", "0.0.0.0");
|
|
$this->RegisterPropertyInteger("Ladestation", 2);
|
|
$this->RegisterPropertyString("ID", "");
|
|
$this->RegisterPropertyString("Seriennummer", "");
|
|
$this->RegisterPropertyString("Username", "");
|
|
$this->RegisterPropertyString("Password", "");
|
|
|
|
|
|
// Ladestationspezifische Variabeln
|
|
$this->RegisterVariableBoolean("Ladebereit", "Ladebereit", "~Switch", 1);
|
|
$this->RegisterVariableBoolean("Solarladen", "Solarladen", "~Switch", 0);
|
|
$this->RegisterVariableInteger("Fahrzeugstatus", "Fahrzeugstatus", "", 0);
|
|
$this->RegisterVariableInteger("Lademodus", "Lademodus", "", 0);
|
|
$this->RegisterVariableFloat("Ladeleistung_Effektiv", "Ladeleistung_Effektiv", "", 0);
|
|
$this->RegisterVariableBoolean("Peak", "Peak", "", 0);
|
|
$this->RegisterVariableInteger("Ladestrom", "Ladestrom");
|
|
$this->RegisterVariableInteger("Ladeleistung", "Ladeleistung");
|
|
|
|
// Variabeln für Kommunkation mit Manager
|
|
$this->RegisterVariableInteger("Sperre_Prio", "Sperre_Prio");
|
|
$this->RegisterVariableInteger("PV_Prio", "PV_Prio");
|
|
$this->RegisterVariableBoolean("Idle", "Idle", "", 0);
|
|
$this->RegisterVariableInteger("Aktuelle_Leistung", "Aktuelle_Leistung", "", 0);
|
|
$this->RegisterVariableFloat("Bezogene_Energie", "Bezogene_Energie", "", 0);
|
|
$this->RegisterVariableString("PowerSteps", "PowerSteps");
|
|
|
|
// Hilfsvariabeln für Idle zustand
|
|
$this->RegisterPropertyInteger("IdleCounterMax", 2);
|
|
$this->RegisterVariableInteger("IdleCounter", "IdleCounter", "", 0);
|
|
$this->SetValue("IdleCounter", 0);
|
|
|
|
// Initialisiere Idle
|
|
$this->SetValue("Idle", true);
|
|
}
|
|
|
|
public function ApplyChanges()
|
|
{
|
|
parent::ApplyChanges();
|
|
// Zusätzliche Anpassungen nach Bedarf
|
|
}
|
|
|
|
// Aktionen verarbeiten
|
|
public function RequestAction($Ident, $Value)
|
|
{
|
|
switch ($Ident) {
|
|
case "SetAktuelle_Leistung":
|
|
$this->SetAktuelle_Leistung($Value);
|
|
break;
|
|
case "GetCurrentData":
|
|
$powerSteps = $this->GetCurrentData($Value);
|
|
return $powerSteps;
|
|
default:
|
|
throw new Exception("Invalid Ident");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function SetAktuelle_Leistung(int $power)
|
|
{
|
|
$internalPower = GetValue($this->GetIDForIdent("Aktuelle_Leistung"));
|
|
// Aktuelle Leistungsvorgabe setzen
|
|
SetValue($this->GetIDForIdent("Aktuelle_Leistung"), $power);
|
|
if ($power != $internalPower) {
|
|
// Setze die interne Leistungsvorgabe
|
|
|
|
// Idle für 4 Zyklen auf false setzen
|
|
SetValue($this->GetIDForIdent("Idle"), false);
|
|
SetValue(
|
|
$this->GetIDForIdent("IdleCounter"),
|
|
$this->ReadPropertyInteger("IdleCounterMax")
|
|
);
|
|
} else {
|
|
// IdleCallCounter herunterzählen, wenn power == interne Leistungsvorgabe
|
|
$idleCounter = GetValue($this->GetIDForIdent("IdleCounter"));
|
|
if ($idleCounter > 0) {
|
|
$idleCounter--;
|
|
SetValue($this->GetIDForIdent("IdleCounter"), $idleCounter);
|
|
if ($idleCounter == 0) {
|
|
SetValue($this->GetIDForIdent("Idle"), true);
|
|
}
|
|
}
|
|
}
|
|
|
|
// Ladeleistung setzen
|
|
$peak = GetValue($this->GetIDForIdent("Peak"));
|
|
$solarladen = GetValue($this->GetIDForIdent("Solarladen"));
|
|
$Ladebereit = GetValue($this->GetIDForIdent("Ladebereit"));
|
|
if (!$Ladebereit) {
|
|
$this->sendPowerToStation(0);
|
|
SetValue($this->GetIDForIdent("Ladeleistung"), 0);
|
|
SetValue($this->GetIDForIdent("Ladestrom"), 0);
|
|
} elseif (!$peak && !$solarladen) {
|
|
// Wenn weder Peak noch Solarladen aktiv sind, setze Ladeleistung auf MaxLeistung
|
|
SetValue(
|
|
$this->GetIDForIdent("Ladeleistung"),
|
|
$this->ReadPropertyInteger("MaxLeistung")
|
|
);
|
|
|
|
if (GetValue($this->GetIDForIdent("Lademodus")) == 0) {
|
|
SetValue(
|
|
$this->GetIDForIdent("Ladestrom"),
|
|
$this->ReadPropertyInteger("MaxLeistung_1ph") / 240
|
|
);
|
|
$this->sendPowerToStation(
|
|
$this->ReadPropertyInteger("MaxLeistung_1ph")
|
|
);
|
|
} elseif (GetValue($this->GetIDForIdent("Lademodus")) == 1) {
|
|
SetValue(
|
|
$this->GetIDForIdent("Ladestrom"),
|
|
$this->ReadPropertyInteger("MaxLeistung") / 400 / sqrt(3)
|
|
);
|
|
$this->sendPowerToStation(
|
|
$this->ReadPropertyInteger("MaxLeistung")
|
|
);
|
|
}
|
|
} else {
|
|
// Ansonsten setze Ladeleistung auf die aktuelle Leistungsvorgabe (Aktuelle_Leistung)
|
|
SetValue($this->GetIDForIdent("Ladeleistung"), $power);
|
|
|
|
if (GetValue($this->GetIDForIdent("Lademodus")) == 0) {
|
|
SetValue($this->GetIDForIdent("Ladestrom"), $power / 240);
|
|
} elseif (GetValue($this->GetIDForIdent("Lademodus")) == 1) {
|
|
SetValue(
|
|
$this->GetIDForIdent("Ladestrom"),
|
|
$power / 400 / sqrt(3)
|
|
);
|
|
}
|
|
|
|
$this->sendPowerToStation($power);
|
|
}
|
|
}
|
|
|
|
// Methode zum Abrufen der aktuellen Daten
|
|
public function GetCurrentData(bool $Peak)
|
|
{
|
|
// Aktuelle Properties abrufen
|
|
$ladebereit = GetValue($this->GetIDForIdent("Ladebereit"));
|
|
$solarladen = GetValue($this->GetIDForIdent("Solarladen"));
|
|
|
|
if (GetValue($this->GetIDForIdent("Lademodus")) == 0) {
|
|
$minLeistung = $this->ReadPropertyInteger("MinLeistung_1ph");
|
|
$maxLeistung = $this->ReadPropertyInteger("MaxLeistung_1ph");
|
|
} elseif (GetValue($this->GetIDForIdent("Lademodus")) == 1) {
|
|
$minLeistung = $this->ReadPropertyInteger("MinLeistung");
|
|
$maxLeistung = $this->ReadPropertyInteger("MaxLeistung");
|
|
}
|
|
|
|
$ch = curl_init();
|
|
|
|
// Setze die URL
|
|
if($this->ReadPropertyInteger("Ladestation")==2){
|
|
curl_setopt(
|
|
$ch,
|
|
CURLOPT_URL,
|
|
"http://" . $this->ReadPropertyString("IP_Adresse") . "/api/status"
|
|
);
|
|
}elseif($this->ReadPropertyInteger("Ladestation")==1){
|
|
curl_setopt(
|
|
$ch,
|
|
CURLOPT_URL,
|
|
"http://" . $this->ReadPropertyString("IP_Adresse") . "/mqtt?payload="
|
|
);
|
|
}
|
|
elseif($this->ReadPropertyInteger("Ladestation")==3){
|
|
curl_setopt(
|
|
$ch,
|
|
CURLOPT_URL,
|
|
"https://api.smart-me.com/pico/charging/". $this->ReadPropertyString("ID")
|
|
);
|
|
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
|
|
curl_setopt($ch, CURLOPT_USERPWD, $this->ReadPropertyString("Username") . ":" . $this->ReadPropertyString("Password"));
|
|
}
|
|
|
|
|
|
// Setze die Option, die Antwort als String zurückzugeben
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
|
|
|
// Führe die Anfrage aus und speichere die Antwort
|
|
$response = curl_exec($ch);
|
|
|
|
// Schließe cURL
|
|
curl_close($ch);
|
|
|
|
// Überprüfe, ob die Antwort nicht leer ist
|
|
if ($response) {
|
|
// Dekodiere die JSON-Antwort
|
|
$data = json_decode($response, true);
|
|
|
|
if($this->ReadPropertyInteger("Ladestation")==2||$this->ReadPropertyInteger("Ladestation")==1){
|
|
// Überprüfe, ob das JSON-Dekodieren erfolgreich war und der Schlüssel "car" existiert
|
|
if (json_last_error() === JSON_ERROR_NONE && isset($data["car"])) {
|
|
// Speichere den Wert von "car" in der Variable $status
|
|
|
|
SetValue(
|
|
$this->GetIDForIdent("Ladeleistung_Effektiv"),
|
|
$data["nrg"][11]
|
|
);
|
|
|
|
SetValue($this->GetIDForIdent("Fahrzeugstatus"), $data["car"]);
|
|
|
|
if ($data["nrg"][6] > 1 && $data["car"] == 2) {
|
|
SetValue($this->GetIDForIdent("Lademodus"), 1);
|
|
} elseif ($data["nrg"][6] <= 1 && $data["car"] == 2) {
|
|
SetValue($this->GetIDForIdent("Lademodus"), 0);
|
|
}
|
|
}
|
|
}
|
|
if($this->ReadPropertyInteger("Ladestation")==3){
|
|
// Überprüfe, ob das JSON-Dekodieren erfolgreich war und der Schlüssel "car" existiert
|
|
if (json_last_error() === JSON_ERROR_NONE && isset($data["State"])) {
|
|
// Speichere den Wert von "car" in der Variable $status
|
|
|
|
SetValue(
|
|
$this->GetIDForIdent("Ladeleistung_Effektiv"),
|
|
round($data["ActiveChargingPower"]*1000)
|
|
);
|
|
|
|
SetValue($this->GetIDForIdent("Fahrzeugstatus"), $data["State"]);
|
|
|
|
if($data["MaxAllowedChargingCurrent"]>0){
|
|
if ($data["ActiveChargingPower"]/$data["MaxAllowedChargingCurrent"] > 0.4 && $data["State"] != 1) {
|
|
SetValue($this->GetIDForIdent("Lademodus"), 1);
|
|
} elseif ($data["State"] != 1) {
|
|
SetValue($this->GetIDForIdent("Lademodus"), 0);
|
|
}
|
|
}else{
|
|
SetValue($this->GetIDForIdent("Lademodus"), 1);
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
// Peak-Wert speichern
|
|
$this->SetValue("Peak", $Peak);
|
|
|
|
// Array für die Powersteps initialisieren
|
|
$powerSteps = [0];
|
|
|
|
if (GetValue($this->GetIDForIdent("Fahrzeugstatus")) != 1) {
|
|
// Konfiguration des powerSteps-Arrays basierend auf den Properties
|
|
if (!$ladebereit) {
|
|
$powerSteps = [0];
|
|
} elseif (!$Peak && !$solarladen) {
|
|
$powerSteps = [$maxLeistung];
|
|
} elseif (!$Peak && $solarladen) {
|
|
$powerSteps = array_merge(
|
|
$powerSteps,
|
|
$this->getRangeLimits(
|
|
$minLeistung,
|
|
$maxLeistung,
|
|
GetValue($this->GetIDForIdent("Lademodus"))
|
|
)
|
|
);
|
|
} elseif ($solarladen && $Peak) {
|
|
$powerSteps = [0];
|
|
} else {
|
|
$powerSteps += $this->getRangeLimits(
|
|
$minLeistung,
|
|
$maxLeistung,
|
|
GetValue($this->GetIDForIdent("Lademodus"))
|
|
);
|
|
}
|
|
}
|
|
// PowerSteps in der RegisterVariable speichern
|
|
SetValue($this->GetIDForIdent("PowerSteps"), json_encode($powerSteps));
|
|
|
|
// Rückgabe der Powersteps
|
|
return $powerSteps;
|
|
}
|
|
|
|
public function sendPowerToStation($value)
|
|
{
|
|
|
|
if($this->ReadPropertyInteger("Ladestation")==2){
|
|
$baseUrl ="http://" . $this->ReadPropertyString("IP_Adresse") . "/api/set?";
|
|
}elseif($this->ReadPropertyInteger("Ladestation")==1){
|
|
$baseUrl ="http://" . $this->ReadPropertyString("IP_Adresse") . "/mqtt?payload=";
|
|
}elseif($this->ReadPropertyInteger("Ladestation")==3){
|
|
$baseUrl ="https://api.smart-me.com/pico/loadmanagementgroup/current/" . $this->ReadPropertyString("Seriennummer") . "?current=";
|
|
}
|
|
// Base URL
|
|
|
|
IPS_LogMessage("Ladestation", "Aufgerufene ip" . $baseUrl);
|
|
$value = $this->convertPowerToCurrent(
|
|
$value,
|
|
GetValue($this->GetIDForIdent("Lademodus"))
|
|
);
|
|
// Initialize a cURL session
|
|
$ch = curl_init();
|
|
|
|
// If value is 0, make a single request
|
|
if ($value == 0) {
|
|
if($this->ReadPropertyInteger("Ladestation")==2){
|
|
$url = $baseUrl . "frc=1";
|
|
curl_setopt($ch, CURLOPT_URL, $url);
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
$response = curl_exec($ch);
|
|
curl_close($ch);
|
|
return $response;
|
|
|
|
}elseif($this->ReadPropertyInteger("Ladestation")==1){
|
|
$url = $baseUrl . "alw=0";
|
|
curl_setopt($ch, CURLOPT_URL, $url);
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
$response = curl_exec($ch);
|
|
curl_close($ch);
|
|
return $response;
|
|
|
|
}elseif($this->ReadPropertyInteger("Ladestation")==3){
|
|
$url = $baseUrl . "0";
|
|
curl_setopt($ch, CURLOPT_URL, $url);
|
|
|
|
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
|
|
curl_setopt($ch, CURLOPT_USERPWD, $this->ReadPropertyString("Username") . ":" . $this->ReadPropertyString("Password"));
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
$response = curl_exec($ch);
|
|
curl_close($ch);
|
|
return $response;
|
|
|
|
}
|
|
|
|
|
|
}
|
|
// For value between 1 and 32, make two requests
|
|
elseif ($value >= 1 && $value <= 32) {
|
|
// First request
|
|
if($this->ReadPropertyInteger("Ladestation")==2){
|
|
$url = $baseUrl . "frc=2";
|
|
curl_setopt($ch, CURLOPT_URL, $url);
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
$response1 = curl_exec($ch);
|
|
|
|
// Check for errors
|
|
if (curl_errno($ch)) {
|
|
curl_close($ch);
|
|
return "Error:" . curl_error($ch);
|
|
}
|
|
}elseif($this->ReadPropertyInteger("Ladestation")==1){
|
|
$url = $baseUrl . "alw=1";
|
|
curl_setopt($ch, CURLOPT_URL, $url);
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
$response1 = curl_exec($ch);
|
|
|
|
// Check for errors
|
|
if (curl_errno($ch)) {
|
|
curl_close($ch);
|
|
return "Error:" . curl_error($ch);
|
|
}
|
|
|
|
}elseif($this->ReadPropertyInteger("Ladestation")==3){
|
|
// Nichts zu tun für Smart-Me station
|
|
}
|
|
|
|
|
|
// Second request
|
|
|
|
|
|
if($this->ReadPropertyInteger("Ladestation")==2){
|
|
$url2 = $baseUrl . "amp=$value";
|
|
curl_setopt($ch, CURLOPT_URL, $url2);
|
|
$response2 = curl_exec($ch);
|
|
|
|
// Check for errors
|
|
if (curl_errno($ch)) {
|
|
curl_close($ch);
|
|
return "Error:" . curl_error($ch);
|
|
}
|
|
|
|
// Close cURL session
|
|
curl_close($ch);
|
|
|
|
// Return responses
|
|
return ;
|
|
}elseif($this->ReadPropertyInteger("Ladestation")==1){
|
|
$url2 = $baseUrl . "amp=$value";
|
|
curl_setopt($ch, CURLOPT_URL, $url2);
|
|
$response2 = curl_exec($ch);
|
|
|
|
// Check for errors
|
|
if (curl_errno($ch)) {
|
|
curl_close($ch);
|
|
return "Error:" . curl_error($ch);
|
|
}
|
|
|
|
// Close cURL session
|
|
curl_close($ch);
|
|
|
|
// Return responses
|
|
return;
|
|
|
|
}
|
|
elseif($this->ReadPropertyInteger("Ladestation")==3){
|
|
$url2 = $baseUrl . $value*1000;
|
|
IPS_LogMessage("Ladestation", "Aufgerufene ip" . $url2);
|
|
|
|
curl_setopt($ch, CURLOPT_URL, $url2);
|
|
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
|
|
curl_setopt($ch, CURLOPT_USERPWD, $this->ReadPropertyString("Username") . ":" . $this->ReadPropertyString("Password"));
|
|
$response2 = curl_exec($ch);
|
|
IPS_LogMessage("Ladestation", "Antwort" . $response2);
|
|
|
|
// Check for errors
|
|
if (curl_errno($ch)) {
|
|
curl_close($ch);
|
|
return "Error:" . curl_error($ch);
|
|
}
|
|
|
|
// Close cURL session
|
|
curl_close($ch);
|
|
|
|
// Return responses
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// If value is out of range
|
|
else {
|
|
return "Invalid value. Must be between 0 and 32.";
|
|
}
|
|
|
|
}
|
|
|
|
public function convertPowerToCurrent($value, $Lademodus)
|
|
{
|
|
if ($Lademodus == 1) {
|
|
if ($value == 0) {
|
|
return 0;
|
|
} elseif ($value == 4150) {
|
|
return 6;
|
|
} elseif ($value == 4850) {
|
|
return 7;
|
|
} elseif ($value == 5550) {
|
|
return 8;
|
|
} elseif ($value == 6250) {
|
|
return 9;
|
|
} elseif ($value == 6950) {
|
|
return 10;
|
|
} elseif ($value == 7600) {
|
|
return 11;
|
|
} elseif ($value == 8300) {
|
|
return 12;
|
|
} elseif ($value == 9000) {
|
|
return 13;
|
|
} elseif ($value == 9700) {
|
|
return 14;
|
|
} elseif ($value == 10300) {
|
|
return 15;
|
|
} elseif ($value == 11000) {
|
|
return 16;
|
|
} elseif ($value == 11750) {
|
|
return 17;
|
|
} elseif ($value == 12450) {
|
|
return 18;
|
|
} elseif ($value == 13150) {
|
|
return 19;
|
|
} elseif ($value == 13850) {
|
|
return 20;
|
|
} elseif ($value == 14550) {
|
|
return 21;
|
|
} elseif ($value == 15250) {
|
|
return 22;
|
|
} elseif ($value == 15900) {
|
|
return 23;
|
|
} elseif ($value == 16600) {
|
|
return 24;
|
|
} elseif ($value == 17300) {
|
|
return 25;
|
|
} elseif ($value == 18000) {
|
|
return 26;
|
|
} elseif ($value == 18700) {
|
|
return 27;
|
|
} elseif ($value == 19400) {
|
|
return 28;
|
|
} elseif ($value == 20100) {
|
|
return 29;
|
|
} elseif ($value == 20800) {
|
|
return 30;
|
|
} elseif ($value == 21500) {
|
|
return 31;
|
|
} elseif ($value >= 22000) {
|
|
return 32;
|
|
}
|
|
return 0;
|
|
} elseif ($Lademodus == 0) {
|
|
if ($value == 0) {
|
|
return 0;
|
|
} elseif ($value == 1450) {
|
|
return 6;
|
|
} elseif ($value == 1690) {
|
|
return 7;
|
|
} elseif ($value == 1930) {
|
|
return 8;
|
|
} elseif ($value == 2170) {
|
|
return 9;
|
|
} elseif ($value == 2410) {
|
|
return 10;
|
|
} elseif ($value == 2650) {
|
|
return 11;
|
|
} elseif ($value == 2890) {
|
|
return 12;
|
|
} elseif ($value == 3130) {
|
|
return 13;
|
|
} elseif ($value == 3370) {
|
|
return 14;
|
|
} elseif ($value == 3610) {
|
|
return 15;
|
|
} elseif ($value == 3850) {
|
|
return 16;
|
|
} elseif ($value == 4090) {
|
|
return 17;
|
|
} elseif ($value == 4330) {
|
|
return 18;
|
|
} elseif ($value == 4570) {
|
|
return 19;
|
|
} elseif ($value == 4810) {
|
|
return 20;
|
|
} elseif ($value == 5050) {
|
|
return 21;
|
|
} elseif ($value == 5290) {
|
|
return 22;
|
|
} elseif ($value == 5530) {
|
|
return 23;
|
|
} elseif ($value == 5770) {
|
|
return 24;
|
|
} elseif ($value == 6010) {
|
|
return 25;
|
|
} elseif ($value == 6250) {
|
|
return 26;
|
|
} elseif ($value == 6490) {
|
|
return 27;
|
|
} elseif ($value == 6730) {
|
|
return 28;
|
|
} elseif ($value == 6970) {
|
|
return 29;
|
|
} elseif ($value == 7210) {
|
|
return 30;
|
|
} elseif ($value == 7450) {
|
|
return 31;
|
|
} elseif ($value >= 7690) {
|
|
return 32;
|
|
}
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
public function getRangeLimits($min, $max, $Lademodus)
|
|
{
|
|
if ($Lademodus == 1) {
|
|
$limits = [
|
|
4150,
|
|
4850,
|
|
5550,
|
|
6250,
|
|
6950,
|
|
7600,
|
|
8300,
|
|
9000,
|
|
9700,
|
|
10300,
|
|
11000,
|
|
11750,
|
|
12450,
|
|
13150,
|
|
13850,
|
|
14550,
|
|
15250,
|
|
15900,
|
|
16600,
|
|
17300,
|
|
18000,
|
|
18700,
|
|
19400,
|
|
20100,
|
|
20800,
|
|
21500,
|
|
22000,
|
|
];
|
|
} elseif ($Lademodus == 0) {
|
|
$limits = [
|
|
1450,
|
|
1690,
|
|
1930,
|
|
2170,
|
|
2410,
|
|
2650,
|
|
2890,
|
|
3130,
|
|
3370,
|
|
3610,
|
|
3850,
|
|
4090,
|
|
4330,
|
|
4570,
|
|
4810,
|
|
5050,
|
|
5290,
|
|
5530,
|
|
5770,
|
|
6010,
|
|
6250,
|
|
6490,
|
|
6730,
|
|
6970,
|
|
7210,
|
|
7450,
|
|
7690,
|
|
];
|
|
}
|
|
|
|
$result = [];
|
|
|
|
foreach ($limits as $limit) {
|
|
if ($limit >= $min && $limit <= $max) {
|
|
$result[] = $limit;
|
|
}
|
|
}
|
|
|
|
return $result;
|
|
}
|
|
|
|
}
|
|
?>
|