} include_once "BluePHP/BluePortail/BluePortailLang.inc"; $bpl = new BluePortailLang(array()); $ref = $argv[1]; $period = array("start" => $argv[2], "end" => $argv[3], "hstart" => $argv[4], "hend" => $argv[5]); $capteurs = $bpl->getIPTable(); $clientId = null; for ($i = 0; $clientId == null && $i < count($capteurs); ++$i) { if ($capteurs[$i]["bluecountId"] == $ref) { $clientId = $capteurs[$i]["clientId"]; } } if (!$clientId) { throw new Exception("Identifiant capteur {$ref} non trouvé"); } $bpl->setClientId($clientId); include_once "BluePHP/Utils/DateOps.inc"; $res = getTimeSlicesAsStrings($period["start"] . "000000", $period["end"] . "000000", array('second' => 0, 'minute' => 0, 'hour' => 0, 'day' => 1, 'month' => 0, 'year' => 0)); echo "Indicateur FlowCountingProcessing\n" . "---------------------------------\n"; include_once "BluePHP/BTopLocalServer/FlowCountingProcessing.inc"; $fcp = new FlowCountingProcessing(); $fcpList = $fcp->getFlowsFromCounter($ref); echo showCountingData($res, $period, $fcpList, $fcp); echo "\nIndicateur ZoneCountingProcessing\n" . "---------------------------------\n"; include_once "BluePHP/BTopLocalServer/ZoneCounting.inc"; $zcp = new ZoneCounting(); $zcpList = $zcp->getZonesFromCounter($ref); echo showCountingData($res, $period, $zcpList, $zcp, $zcpExcluded[$clientId]); } catch (Exception $e) { echo "Exception reçue : ", $e->getMessage(), "\n"; }
if ($clients[$i]["clientId"] == $ref) { $clientId = $ref; } } if (!$clientId) { throw new Exception("Identifiant client {$ref} non trouvé"); } $bpl->setClientId($clientId); include_once "BluePHP/Utils/DateOps.inc"; $res = getTimeSlicesAsStrings($period["start"] . "000000", $period["end"] . "000000", array('second' => 0, 'minute' => 0, 'hour' => 0, 'day' => 1, 'month' => 0, 'year' => 0)); include_once "BluePHP/BTopLocalServer/Tasks.inc"; $tasks = new Tasks(); include_once "BluePHP/BTopLocalServer/FlowCountingProcessing.inc"; include_once "BluePHP/BTopLocalServer/ZoneCounting.inc"; $fcp = new FlowCountingProcessing(); $zcp = new ZoneCounting(); $refs = $bpl->getBlueCountData(["clientId" => $clientId]); $sensorsClientIds = []; foreach ($refs as $ref) { $sensorClientId = getClientIdFromRef($ref["ref"]); if (!isset($sensorsClientIds[$sensorClientId])) { $fcpList = $fcp->getFlowsFromCounter($sensorClientId); addTasksDAY("FlowCounting", $tasks, $res, $fcpList); $zcpList = $zcp->getZonesFromCounter($sensorClientId); addTasksDAY("ZoneCounting", $tasks, $res, $zcpList, $zcpExcluded[$clientId]); $sensorsClientIds[$sensorClientId] = true; } } } catch (Exception $e) { echo "Exception reçue : ", $e->getMessage(), "\n"; }
throw new Exception("Identifiant capteur {$ref} non trouvé"); } $bpl->setClientId($clientId); include_once "BluePHP/BTopLocalServer/Calendar.inc"; $cal = new Calendar(); $calendrier = $argv[2]; $calId = null; $cals = $cal->getCalendars(); for ($i = 0; $calId == null && $i < count($cals); ++$i) { if ($cals[$i]["calId"] == $calendrier) { $calId = $calendrier; } } if (!$calId) { throw new Exception("Identifiant calendrier {$calendrier} non trouvé"); } include_once "BluePHP/BTopLocalServer/FlowCountingProcessing.inc"; $fcp = new FlowCountingProcessing(); foreach ($fcp->getFlowsFromCounter($ref) as $v) { $fcp->setCalendar($v["fcpId"], $calendrier); } include_once "BluePHP/BTopLocalServer/ZoneCounting.inc"; $zcp = new ZoneCounting(); foreach ($zcp->getZonesFromCounter($ref) as $v) { if (!in_array($v["zcpId"], $zcpExcluded[$clientId])) { $zcp->setCalendar($v["zcpId"], $calendrier); } } } catch (Exception $e) { echo "Exception reçue : ", $e->getMessage(), "\n"; }
$ref = $argv[1]; $capteurs = $bpl->getIPTable(); $clientId = null; for ($i = 0; $clientId == null && $i < count($capteurs); ++$i) { if ($capteurs[$i]["bluecountId"] == $ref) { $clientId = $capteurs[$i]["clientId"]; } } if (!$clientId) { throw new Exception("Identifiant capteur {$ref} non trouvé"); } $bpl->setClientId($clientId); include_once "BluePHP/BTopLocalServer/FlowCountingProcessing.inc"; $fcp = new FlowCountingProcessing(); echo "Indicateur FlowCountingProcessing\n" . "---------------------------------\n"; echo sprintf("%16s%16s%16s%16s\n", "Identifiant", "Nom Porte", "Id Cal", "Nom Cal"); foreach ($fcp->getFlowsFromCounter($ref) as $v) { echo sprintf("%16s%16s%16s%16s\n", $v["fcpId"], $v["fcpName"], $v["calId"], $v["calName"]); } include_once "BluePHP/BTopLocalServer/ZoneCounting.inc"; $zcp = new ZoneCounting(); echo "\nIndicateur ZoneCountingProcessing\n" . "---------------------------------\n"; echo sprintf("%16s%16s%16s%16s\n", "Identifiant", "Nom Zone", "Id Cal", "Nom Cal"); foreach ($zcp->getZonesFromCounter($ref) as $v) { if (!in_array($v["zcpId"], $zcpExcluded[$clientId])) { echo sprintf("%16s%16s%16s%16s\n", $v["zcpId"], $v["zcpName"], $v["calId"], $v["calName"]); } } } catch (Exception $e) { echo "Exception reçue : ", $e->getMessage(), "\n"; }
$in = "value1"; $out = "value0"; $str .= $cp["name"] . ";" . strftime("%d/%m/%Y", $time) . ";" . $v[$in] . ";" . $v[$out] . "\n"; } } } } } return $str; } try { if (count($argv) < 3) { echo "Erreur:\tArguments manquants\n" . "Usage:\tgetCSVDay.php dateDebut dateFin\n" . "\tdateDebut\tDate du début de la période au format 'YYYYMMDD'\n" . "\tdateFin\t\tDate de fin de la période au format 'YYYYMMDD'\n"; exit(1); } include_once "BluePHP/BluePortail/BluePortailLang.inc"; include_once "BluePHP/Utils/DateOps.inc"; $bpl = new BluePortailLang(array()); $refs = $bpl->getIPTable(); $clientId = "CRTBretagne"; $bpl->setClientId($clientId); include_once "BluePHP/BTopLocalServer/ZoneCounting.inc"; $period = array("start" => $argv[1], "end" => $argv[2]); $res = getTimeSlicesAsStrings($period["start"] . "000000", $period["end"] . "000000", array('second' => 0, 'minute' => 0, 'hour' => 0, 'day' => 1, 'month' => 0, 'year' => 0)); echo "Porte ; Date ; Entrees ; Sorties\n"; $cp = new ZoneCounting(); $cpList = $cp->getZones(); echo showCountingData($res, $cpList, $cp, 8, $zcpExcluded[$clientId]); } catch (Exception $e) { echo "Exception reçue : ", $e->getMessage(), "\n"; }
} include_once "BluePHP/BluePortail/BluePortailLang.inc"; $bpl = new BluePortailLang(array()); $ref = $argv[1]; $period = array("start" => $argv[2], "end" => $argv[3]); $capteurs = $bpl->getIPTable(); $clientId = null; for ($i = 0; $clientId == null && $i < count($capteurs); ++$i) { if ($capteurs[$i]["bluecountId"] == $ref) { $clientId = $capteurs[$i]["clientId"]; } } if (!$clientId) { throw new Exception("Identifiant capteur {$ref} non trouvé"); } $bpl->setClientId($clientId); include_once "BluePHP/Utils/DateOps.inc"; $res = getTimeSlicesAsStrings($period["start"] . "000000", $period["end"] . "000000", array('second' => 0, 'minute' => 0, 'hour' => 0, 'day' => 1, 'month' => 0, 'year' => 0)); include_once "BluePHP/BTopLocalServer/Tasks.inc"; $tasks = new Tasks(); include_once "BluePHP/BTopLocalServer/FlowCountingProcessing.inc"; $fcp = new FlowCountingProcessing(); $fcpList = $fcp->getFlowsFromCounter($ref); addTasksDAY("FlowCounting", $tasks, $res, $fcpList); include_once "BluePHP/BTopLocalServer/ZoneCounting.inc"; $zcp = new ZoneCounting(); $zcpList = $zcp->getZonesFromCounter($ref); addTasksDAY("ZoneCounting", $tasks, $res, $zcpList, $zcpExcluded[$clientId]); } catch (Exception $e) { echo "Exception reçue : ", $e->getMessage(), "\n"; }