/** * Fonction qui recupere les valeurs actuellement des capteurs, * les mets dans la BDD et archive celle-ci */ public static function historize() { $listHistorizedCmd = cmd::allHistoryCmd(true); foreach ($listHistorizedCmd as $cmd) { try { if ($cmd->getEqLogic()->getIsEnable() == 1) { $value = $cmd->execCmd(null, 0); if ($value !== false) { $cmd->addHistoryValue($value); } } } catch (Exception $e) { log::add('historized', 'error', 'Erreur sur ' . $cmd->getHumanName() . ' : ' . $e->getMessage(), 'historized::cmd::' . $cmd->getId()); } } }
<?php if (!isConnect()) { throw new Exception('{{401 - Accès non autorisé}}'); } $date = array('start' => date('Y-m-d', strtotime(config::byKey('history::defautShowPeriod') . ' ' . date('Y-m-d'))), 'end' => date('Y-m-d')); ?> <div class="row row-overflow"> <div class="col-lg-3 col-md-4 col-sm-5 bs-sidebar"> <ul id="ul_history" class="nav nav-list bs-sidenav"> <li class="nav-header">{{Historique}}</li> <li class="filter"><input class="filter form-control input-sm" placeholder="{{Rechercher}}" /></li> <?php $object_id = -1; foreach (cmd::allHistoryCmd() as $cmd) { $eqLogic = $cmd->getEqLogic(); if (!$eqLogic->hasRight('r')) { continue; } if ($object_id != $eqLogic->getObject_id()) { if ($object_id != -1) { echo '</div>'; } $object = $eqLogic->getObject(); if (is_object($object)) { if ($object->getDisplay('tagColor') != '') { echo '<span class="label cursor displayObject" data-object_id="o' . $eqLogic->getObject_id() . '" style="text-shadow : none;background-color:' . $object->getDisplay('tagColor') . ';color:' . $object->getDisplay('tagTextColor', 'white') . '">' . $object->getName() . ' <i class="fa fa-arrow-circle-right"></i></span>'; } else { echo '<span class="label label-primary cursor displayObject" data-object_id="o' . $eqLogic->getObject_id() . '" style="text-shadow : none;">' . $object->getName() . ' <i class="fa fa-arrow-circle-right"></i></span>'; }