示例#1
0
             } else {
                 $value = null;
             }
             $previsousValue = $history->getValue() === null ? null : floatval($history->getValue());
         }
         $info_history[] = $value;
         if ($value != null && $value > $return['maxValue'] || $return['maxValue'] == '') {
             $return['maxValue'] = $value;
         }
         if ($value != null && $value < $return['minValue'] || $return['minValue'] == '') {
             $return['minValue'] = $value;
         }
         $data[] = $info_history;
     }
 } else {
     $histories = history::getHistoryFromCalcul(init('id'), $dateStart, $dateEnd, init('allowZero', true));
     if (is_array($histories)) {
         foreach ($histories as $datetime => $value) {
             $info_history = array();
             $info_history[] = floatval($datetime) * 1000;
             $info_history[] = $value === null ? null : floatval($value);
             if ($value > $return['maxValue'] || $return['maxValue'] == '') {
                 $return['maxValue'] = $value;
             }
             if ($value < $return['minValue'] || $return['minValue'] == '') {
                 $return['minValue'] = $value;
             }
             $data[] = $info_history;
         }
     }
     $return['cmd_name'] = init('name');