debuggage
This commit is contained in:
@ -164,7 +164,7 @@ class rdc_store extends hook
|
||||
}elseif ($rafale != 0)
|
||||
{
|
||||
//calcul du maxlevel par rapport a la vitesse des rafales
|
||||
$r = round(($rafale-30)/4, 0, PHP_ROUND_HALF_UP)*10;
|
||||
$r = round(($rafale-20)/4, 0, PHP_ROUND_HALF_UP)*10;
|
||||
if ($r < 0) $r = 0;
|
||||
if ($motorReversal)
|
||||
{
|
||||
@ -191,17 +191,17 @@ class rdc_store extends hook
|
||||
logger(DEBUG, "maxLevel = " . $this->maxLevel . ' result => $r = ' . $r, __FILE__ . ":" . __LINE__);
|
||||
if ($this->storeLevel > $this->maxLevel)
|
||||
{
|
||||
$this->set($this->maxLevel);
|
||||
$this->setTo($this->maxLevel, AUTO);
|
||||
}elseif ($store2level !== false) //$store2level = false then no change on store position
|
||||
{
|
||||
if ( $store2level > $this->maxLevel )
|
||||
{
|
||||
logger(DEBUG, "store2level > maxLevel", __FILE__ . ":" . __LINE__);
|
||||
$this->set($this->maxLevel);
|
||||
$this->setTo($this->maxLevel, AUTO);
|
||||
}else
|
||||
{
|
||||
logger(DEBUG, "store2level <= maxLevel", __FILE__ . ":" . __LINE__);
|
||||
$this->set($store2level);
|
||||
$this->setTo($store2level, AUTO);
|
||||
}
|
||||
}
|
||||
}else
|
||||
@ -211,13 +211,13 @@ class rdc_store extends hook
|
||||
|
||||
}
|
||||
|
||||
private function set ($level)
|
||||
private function setTo($level, $method)
|
||||
{
|
||||
logger(DEBUG, "function 'set' to level : " . $level, __FILE__ . ":" . __LINE__);
|
||||
if ($level <= 100)
|
||||
{
|
||||
logger(DEBUG, "Open store :" . $level, __FILE__ . ":" . __LINE__);
|
||||
$this->send(100 - $level);
|
||||
$this->send(100 - $level, $method);
|
||||
}//else
|
||||
/*{
|
||||
logger(DEBUG, "store is already at level" . $this->storeLevel . " so < at " . $level, __FILE__ . ":" . __LINE__);
|
||||
@ -230,7 +230,7 @@ class rdc_store extends hook
|
||||
if ($this->storeLevel > 0)
|
||||
{
|
||||
logger(DEBUG, "Close store :" . $reason, __FILE__ . ":" . __LINE__);
|
||||
$this->send(100);
|
||||
$this->send(100, IDLE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -241,7 +241,7 @@ class rdc_store extends hook
|
||||
$msg = array("position" => $level);
|
||||
logger(INFO, sprintf(_("publishing message: %s to %s"), json_encode($msg), $deviceObject->friendlyName), __FILE__ . ":" . __LINE__);
|
||||
$deviceObject->payload = $msg;
|
||||
$deviceObject->set(AUTO);
|
||||
$deviceObject->set("position", $method);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user