From d0675990b5b446cd120f03c4fa72ac3159bdf2aa Mon Sep 17 00:00:00 2001
From: Elena.Budnik <ebudnik@irap.omp.eu>
Date: Wed, 25 Apr 2018 15:15:28 +0200
Subject: [PATCH] Tab2D args processing

---
 src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php b/src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php
index e7f0bfd..27fb8fe 100644
--- a/src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php
+++ b/src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php
@@ -699,9 +699,27 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
 					}
 					break;
 				case 2:
-					if (($dim1_index != '*') || ($dim2_index != '*')) {
+					//Tab2D
+					if ($paramData->{'dim1-is-range'} && $paramData->{'dim2-is-range'}) {
+						throw new Exception('SumInRange is not implemented for 2D objects');
+					}
+					// spectra with one dim fixed; serie with 2 dims fixed
+					else if ((($dim1_index != '*') || ($dim2_index != '*')) && !$paramData->{'dim1-is-range'} && !$paramData->{'dim2-is-range'}) {
 						$paramInfo['indexes'][] = "[".$dim1_index.",".$dim2_index."]";
 					}
+					else if ($paramData->{'dim1-is-range'}) {
+						throw new Exception('SumInRange is not implemented for 2D objects');
+					}
+					else if ($paramData->{'dim2-is-range'}) {
+						throw new Exception('SumInRange is not implemented for 2D objects');
+					}
+					//total over 2 dims
+					else if (($dim1_index == '*') && ($dim2_index == '*')) {
+						$template_args = array(
+							'paramid' => $paramInfo['id']
+						);
+						$paramInfo = $this->paramManager->addExistingParam('total_2D', $this->paramsData, $template_args);
+					}
 					break;
 			}
 			
--
libgit2 0.21.2