Commit a5a14b95d12b3e775dbf7594ba56ebf6326bfd30

Authored by Benjamin Renard
1 parent ea8e0c6d
Exists in master and in 1 other branch amdadev

WIP

Showing 1 changed file with 20 additions and 6 deletions   Show diff stats
src/InputOutput/IHMImpl/Tools/IHMPlotContextFileClass.php
... ... @@ -67,16 +67,30 @@ class IHMPlotContextFileClass
67 67 $parametersNode = $parametersNodes->item(0);
68 68 $items = $parametersNode->getElementsByTagName($PARAMETER_TAG);
69 69 foreach ($items as $item) {
70   - $pContext = array(
  70 + $pContext = array(
71 71 'id' => $item->getAttribute('id'),
72   - 'name' => $item->getAttribute('name'),
73   - 'shortname' => $item->getAttribute('name'),
74   - 'units' => $item->getAttribute('units'),
  72 + 'name' => $item->getAttribute('name'),
  73 + 'shortname' => $item->getAttribute('name'),
  74 + 'units' => $item->getAttribute('units'),
75 75 'MinSampling' => floatval($item->getAttribute('MinSampling')),
76   - 'isHisto' => $item->getAttribute('isHisto'),
77   - 'fileName' => $item->getAttribute('fileName')
78 76 );
79 77  
  78 + $histogramsNodes = $item->getElementsByTagName("histograms");
  79 + $isHisto = $histogramsNodes->length > 0;
  80 + if ($isHisto) {
  81 + $histogramsNode = $histogramsNodes->item(0);
  82 + $histoNodes = $histogramsNode->getElementsByTagName("histo");
  83 + $histogramsContext = array();
  84 + foreach ($histoNodes as $histoNode) {
  85 + $histogramsContext[] = array(
  86 + 'shortInfo' => $histoNode->getAttribute("shortInfo"),
  87 + 'fullInfo' => $histoNode->getAttribute("fullInfo"),
  88 + 'fileName' => $histoNode->getAttribute("fileName"),
  89 + );
  90 + }
  91 + $pContext['histograms'] = $histogramsContext;
  92 + }
  93 +
80 94 $sampling_context = array();
81 95  
82 96 $samplingNodes = $item->getElementsByTagName('sampling');
... ...