Commit 8d0b72343e9b82f1437459d46c99d67d331ac345

Authored by Hacene SI HADJ MOHAND
1 parent 1ff81371

templeting filter

src/InputOutput/IHMImpl/Params/DownloadImpl/IHMInputOutputParamsDownloadClass.php
... ... @@ -100,6 +100,7 @@ class IHMInputOutputParamsDownloadClass extends IHMInputOutputParamsAbstractClas
100 100 $paramInfo = $this->paramManager->addExistingParam($param->paramid, $this->paramsData, $param->template_args);
101 101 $paramInfo['indexes'] = array();
102 102 $this->paramManager->applyRangesAndIndexes($this->paramsData, $param, FALSE, $paramInfo);
  103 + $this->paramManager->applyFilter($this->paramsData, $param,$paramInfo);
103 104 $downloadNode->addParam($paramInfo['id'],$paramInfo['indexes'],$paramInfo['calib_infos']);
104 105 $paramsNode->addParam($paramInfo['id']);
105 106 }
... ...
src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php
... ... @@ -623,7 +623,8 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
623 623 $paramInfo['indexes'] = array();
624 624  
625 625 $this->paramManager->applyRangesAndIndexes($this->paramsData, $paramData, !$this->isInstantPlot, $paramInfo);
626   -
  626 +
  627 + $this->paramManager->applyFilter($this->paramsData, $paramData, $paramInfo);
627 628  
628 629 $requestParamsNode->addParam($paramInfo['id']);
629 630  
... ...
src/InputOutput/IHMImpl/Tools/.IHMParamManagerClass.php.swp 0 → 100644
No preview for this file type
src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php
... ... @@ -539,6 +539,32 @@ class IHMParamManagerClass
539 539  
540 540 return array("id" => $paramId, "plotType" => $res["param"]["info"]["plotType"]);
541 541 }
  542 +
  543 + public function applyFilter($paramsData, $paramData, &$paramInfo) {
  544 + $filter = (isset($paramData->{'filter_spikes'}) && ($paramData->{'filter_spikes'}=="true"));
  545 + if(! $filter){
  546 + return;
  547 + }
  548 + switch ($paramData->{'type'}) {
  549 + case 0:
  550 + $factor = !empty($paramData->{'filter_spikes_factor'}) ? $paramData->{'filter_spikes_factor'} : 5;
  551 + $nPoints = !empty($paramData->{'filter_spikes_nPoints'}) ? $paramData->{'filter_spikes_nPoints'} : 100;
  552 + $template_args = array(
  553 + 'paramid' => $paramInfo['id'],
  554 + 'factor' => $factor,
  555 + 'nPoints' => $nPoints,
  556 + );
  557 + $paramInfo = $this->addExistingParam('filter_spikes', $paramsData, $template_args);
  558 + break;
  559 + case 1:
  560 + return array('success' => FALSE, 'message' => '1D Table filtering not implémented yet');
  561 +
  562 + case 2:
  563 + return array('success' => FALSE, 'message' => '2D Table filtering not implémented yet');
  564 +
  565 + }
  566 + }
  567 +
542 568  
543 569 public function applyRangesAndIndexes($paramsData, $paramData, $force_total_2d, &$paramInfo) {
544 570 $dim1_min = 0;
... ...