Kaynağa Gözat

Updated class to save the tx, offline onus and bias current on Pon Ports, wasn't reflecting the values

Jean Sumara Leopoldo 5 yıl önce
ebeveyn
işleme
e8c36f0736

+ 2 - 5
src/App/Service/Huawei/HuaweiOltService.php

@@ -13,17 +13,14 @@ class HuaweiOltService
      */
     private $huawei;
     private $sendData;
-    private $stats;
 
     /**
      * HuaweiOltService constructor.
      * @param $sendData
-     * @param $stats
      */
     public function __construct(&$sendData)
     {
         $this->sendData = &$sendData;
-        $this->stats = &$stats;
     }
 
     public function configure(Huawei $huawei){
@@ -39,7 +36,7 @@ class HuaweiOltService
             $v = $data[$this->huawei->getIndex()] * 0.01;
             $this->sendData[$m] = "{$v}|g";
 
-            $this->stats[$metricName] = $v;
+            $this->huawei->stats[$metricName] = $v;
         }
 
         return $this;
@@ -53,7 +50,7 @@ class HuaweiOltService
             $v = $data[$this->huawei->getIndex()];
             $this->sendData[$m] = "{$v}|g";
 
-            $this->stats[$metricName] = $v;
+            $this->huawei->stats[$metricName] = $v;
         }
 
         return $this;

+ 3 - 3
src/Domain/Huawei.php

@@ -9,7 +9,7 @@ class Huawei implements AbstractOnu
     private $index;
     private $sn;
     private $ponPort;
-    private $stats;
+    public $stats;
 
     /**
      * Huawei constructor.
@@ -18,12 +18,12 @@ class Huawei implements AbstractOnu
      * @param $ponPort
      * @param $stats
      */
-    public function __construct($index, $sn, $ponPort = null, $stats = null)
+    public function __construct($index, $sn, $ponPort = null, &$stats = null)
     {
         $this->index = $index;
         $this->sn = $sn;
         $this->ponPort = $ponPort;
-        $this->stats = $stats;
+        $this->stats = &$stats;
     }
 
     /**