Commit e925e4090eece1b6751dacf027840fb107234ee6
1 parent
8d0b7234
Exists in
master
and in
46 other branches
templating ok pour component
Showing
1 changed file
with
19 additions
and
5 deletions
Show diff stats
src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php
... | ... | @@ -541,24 +541,38 @@ class IHMParamManagerClass |
541 | 541 | } |
542 | 542 | |
543 | 543 | public function applyFilter($paramsData, $paramData, &$paramInfo) { |
544 | - $filter = (isset($paramData->{'filter_spikes'}) && ($paramData->{'filter_spikes'}=="true")); | |
545 | - if(! $filter){ | |
544 | + $filter = (isset($paramData->{'filter_spikes'}) && ($paramData->{'filter_spikes'}))? true:false; | |
545 | + if(!$filter){ | |
546 | 546 | return; |
547 | 547 | } |
548 | + $my_type= $paramData->{'type'}; | |
549 | + | |
548 | 550 | switch ($paramData->{'type'}) { |
549 | 551 | case 0: |
552 | + break; | |
553 | + case 1: | |
554 | + // vector | |
555 | + $dim1_index = ($dim1_is_range || !isset($paramData->{'dim1-index'}) || ($paramData->{'dim1-index'} == '')) ? '*' : $paramData->{'dim1-index'}; | |
556 | + $dim2_index = ($dim2_is_range || !isset($paramData->{'dim2-index'}) || ($paramData->{'dim2-index'} == '')) ? '*' : $paramData->{'dim2-index'}; | |
550 | 557 | $factor = !empty($paramData->{'filter_spikes_factor'}) ? $paramData->{'filter_spikes_factor'} : 5; |
551 | 558 | $nPoints = !empty($paramData->{'filter_spikes_nPoints'}) ? $paramData->{'filter_spikes_nPoints'} : 100; |
559 | + if($dim1_index != '*'){ | |
552 | 560 | $template_args = array( |
553 | 561 | 'paramid' => $paramInfo['id'], |
554 | 562 | 'factor' => $factor, |
555 | 563 | 'nPoints' => $nPoints, |
564 | + 'index' => $dim1_index | |
565 | + ); | |
566 | + $paramInfo = $this->addExistingParam('filter_spikes_component', $paramsData, $template_args); | |
567 | + }else{ | |
568 | + $template_args = array( | |
569 | + 'paramid' => $paramInfo['id'], | |
570 | + 'factor' => $factor, | |
571 | + 'nPoints' => $nPoints, | |
556 | 572 | ); |
557 | 573 | $paramInfo = $this->addExistingParam('filter_spikes', $paramsData, $template_args); |
574 | + } | |
558 | 575 | break; |
559 | - case 1: | |
560 | - return array('success' => FALSE, 'message' => '1D Table filtering not implémented yet'); | |
561 | - | |
562 | 576 | case 2: |
563 | 577 | return array('success' => FALSE, 'message' => '2D Table filtering not implémented yet'); |
564 | 578 | ... | ... |