IHMInputOutputParamsMultiPlotClass.php 1.44 KB
<?php

/**
 * @class IHMInputOutputParamsMultiPlotClass
 * @brief Class that's implement an IHMInputOutputParamsPlotClass used to treat input/output of a "multiplot" request
 * @details
 */
class IHMInputOutputParamsMultiPlotClass extends IHMInputOutputParamsPlotClass
{
	/*
	 * @brief method to unmarshall a plot request
	 */
	public function unmarshallRequest($input) {
		$this->isMultiPlot = TRUE;

		$isAction = isset($input->{'action'});

		if ($isAction) {
			$multiplotInput = $this->loadIHMRequest('multiplot');
		}
		else {
			$multiplotInput = $input;
		}

		foreach ($multiplotInput->plots as $index => $plot) {
			if ($isAction) {
				$crtInteractiveId = PLOT_RESULT_FILE_KEY."_".$plot->{'tab-index'};
				if ((($input->{'action'}->action == 'zoom') || ($input->{'action'}->action == 'undozoom')) && ($input->{'action'}->axeId != 'timeAxis') && ($crtInteractiveId != $input->action->interactiveId)) {
					continue;
				}
				$request = clone $input;
				$request->action->interactiveId = $crtInteractiveId;
				parent::unmarshallRequest($request);
			}
			else {
                        	$plot->{'file-output'} = 'INTERACTIVE';
				$plot->timesrc = $multiplotInput->timesrc;
				$plot->timeTables = $multiplotInput->timeTables;
				$plot->startDate = $multiplotInput->startDate;
				$plot->stopDate  = $multiplotInput->stopDate;
                        	parent::unmarshallRequest($plot);
			}
		}

		$this->saveIHMRequest('multiplot', $multiplotInput);
	}
}

?>