Commit ecdabbec6ca6e52461213542de33b110820d6020
1 parent
30a70818
Exists in
master
and in
66 other branches
index for statistics
Showing
2 changed files
with
32 additions
and
5 deletions
Show diff stats
src/InputOutput/IHMImpl/Params/StatisticsImpl/IHMInputOutputParamsStatisticsClass.php
... | ... | @@ -36,10 +36,11 @@ class IHMInputOutputParamsStatisticsClass extends IHMInputOutputParamsAbstractCl |
36 | 36 | } |
37 | 37 | |
38 | 38 | foreach ($paramFunctionAssociation as $param => $functions) { |
39 | - $paramsNode->addParam($param); | |
40 | - $outputParamNode = $catalogNode->addParam($param); | |
41 | - foreach ($functions as $function) $outputParamNode->addFunction($function); | |
42 | - $paramInfo = $this->paramManager->addExistingParam($param,$this->paramsData); | |
39 | + | |
40 | + $paramInfo = $this->paramManager->addExistingParam($param,$this->paramsData); | |
41 | + $paramsNode->addParam($paramInfo['id']); | |
42 | + $outputParamNode = $catalogNode->addParam($paramInfo['id'],$paramInfo['indexes']); | |
43 | + foreach ($functions as $function) $outputParamNode->addFunction($function); | |
43 | 44 | } |
44 | 45 | |
45 | 46 | $resultFile = "result_".$this->requestID; | ... | ... |
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputStatisticNodeClass.php
... | ... | @@ -9,6 +9,7 @@ define ("REQUESTOUTPUTSTATISTIC_FILENAME", "fileName"); |
9 | 9 | define ("REQUESTOUTPUTSTATISTICPARAM_NAME", "param"); |
10 | 10 | define ("REQUESTOUTPUTSTATISTICFUNCTION_NAME", "function"); |
11 | 11 | define ("REQUESTOUTPUTSTATISTICPARAM_ID", "id"); |
12 | +define ("REQUESTOUTPUTSTATISTICPARAM_INDEX", "index"); | |
12 | 13 | define ("REQUESTOUTPUTSTATISTICFUNCTION_ID", "name"); |
13 | 14 | |
14 | 15 | abstract class RequestOutputStatisticTimeFormatEnum |
... | ... | @@ -68,6 +69,24 @@ class RequestOutputStatisticParamNodeClass extends NodeClass |
68 | 69 | $this->addChild($node); |
69 | 70 | $node->setFunctionName($name); |
70 | 71 | } |
72 | + | |
73 | + public function indexExist($index) | |
74 | + { | |
75 | + if ($this->getAttribute(REQUESTOUTPUTSTATISTICPARAM_INDEX) == $index) | |
76 | + return true; | |
77 | + | |
78 | + | |
79 | + return false; | |
80 | + } | |
81 | + | |
82 | + public function setIndex($index) | |
83 | + { | |
84 | + if ($this->indexExist($index)) | |
85 | + return; | |
86 | + | |
87 | + $this->setAttribute(REQUESTOUTPUTSTATISTICPARAM_INDEX, $index); | |
88 | + | |
89 | + } | |
71 | 90 | } |
72 | 91 | |
73 | 92 | /** |
... | ... | @@ -105,8 +124,9 @@ class RequestOutputStatisticNodeClass extends NodeClass |
105 | 124 | $node = $this->getChildInstanceByName(REQUESTOUTPUTSTATISTIC_FILENAME, true); |
106 | 125 | $node->setValue($fileName); |
107 | 126 | } |
127 | + | |
108 | 128 | |
109 | - public function addParam($id) | |
129 | + public function addParam($id, $indexes) | |
110 | 130 | { |
111 | 131 | $paramsNode = $this->getFirstChildByName(REQUESTPARAMS_NAME); |
112 | 132 | |
... | ... | @@ -121,6 +141,12 @@ class RequestOutputStatisticNodeClass extends NodeClass |
121 | 141 | |
122 | 142 | $node->setId($id); |
123 | 143 | |
144 | + if (isset($indexes)) | |
145 | + { | |
146 | + foreach ($indexes as $index) | |
147 | + $node->setIndex($index); | |
148 | + } | |
149 | + | |
124 | 150 | return $node; |
125 | 151 | } |
126 | 152 | ... | ... |