diff --git a/src/InputOutput/IHMImpl/IHMInputOutputClass.php b/src/InputOutput/IHMImpl/IHMInputOutputClass.php index f423ab2..5d758e9 100644 --- a/src/InputOutput/IHMImpl/IHMInputOutputClass.php +++ b/src/InputOutput/IHMImpl/IHMInputOutputClass.php @@ -88,6 +88,9 @@ class IHMInputOutputClass implements InputOutputInterface case FunctionTypeEnumClass::TTUNION : $this->inputOutput = new IHMInputOutputUnionTTClass(); break;*/ + case FunctionTypeEnumClass::PARAMINFO : + $this->inputOutput = new IHMInputOutputParamInfoClass(); + break; default : throw new Exception('Request type '.$function.' not implemented for this client.'); } diff --git a/src/InputOutput/IHMImpl/ParamInfo/IHMInputOutputParamInfoClass.php b/src/InputOutput/IHMImpl/ParamInfo/IHMInputOutputParamInfoClass.php new file mode 100644 index 0000000..e63e09d --- /dev/null +++ b/src/InputOutput/IHMImpl/ParamInfo/IHMInputOutputParamInfoClass.php @@ -0,0 +1,349 @@ +<?php + +/** + * @class IHMInputOutputParamInfoClass + * @brief Class that's implement an InputOutputInterface used to treat a get param info request + * @details + */ +class IHMInputOutputParamInfoClass implements InputOutputInterface +{ + private $paramInfoData = null; + + /* + * @brief Constructor + */ + function __construct() + { + } + + /* + * @brief translate input data from IHM client to AMDA_Integration module for a get param info request + */ + public function getInputData($input,$function,$requestId="") + { + $this->paramInfoData = new ParamInfoRequestDataClass(); + + switch ($input->type) { + case 'plot_init' : + $this->paramInfoData->setType(ParamInfoTypeEnumClass::PLOTINIT); + break; + default : + throw new Exception("Para info request type '".$input->type."' not yet implemented"); + } + if (!isset($input->paramId) || empty($input->paramId)) + throw new Exception("Param info request need a param id as argument"); + $paramFilePath = IHMConfigClass::getLocalParamDBPath().$input->paramId.".xml"; + + if (!file_exists($paramFilePath)) + throw new Exception("Cannot find parameter definition file"); + + $this->paramInfoData->setParamId($input->paramId); + $this->paramInfoData->setParamPath($paramFilePath); + + return $this->paramInfoData; + } + + /* + * @brief translate output data from AMDA_Integration module to IHM client for a get param info request + */ + public function getOutput($data) + { + $result = array("success" => false, "message" => "Cannot load plot init"); + + switch ($data->getType()) { + case ParamInfoTypeEnumClass::PLOTINIT : + if (($data->getResultNode() != NULL) && ($data->getResultNode()->getName() == "plot") && (count($data->getResultNode()->getChildren()) >= 1)) { + $result_data = array(); + + $panelNode = $data->getResultNode()->getChildren()[0]; + + $plotNode = NULL; + if (count($panelNode->getChildren()) >= 1) { + foreach ($panelNode->getChildren() as $crtNode) { + if (!in_array($crtNode->getName(), array('timePlot', 'epochPlot', 'xyPlot', 'instantPlot', 'statusPlot', 'tickPlot'))) + continue; + $plotNode = $crtNode; + break; + } + + if (isset($plotNode)) { + $result_data['panel'] = array(); + switch ($plotNode->getName()) { + case 'timePlot' : + $result_data['panel']['plotType'] = 'timePlot'; + + break; + case 'epochPlot' : + $result_data['panel']['plotType'] = 'epochPlot'; + + break; + case 'xyPlot' : + $result_data['panel']['plotType'] = 'xyPlot'; + $result_data['panel']['isotropic'] = ($plotNode->getIsIsotropic() == "true"); + $result_data['additionalObjects'] = $this->unmarshallAdditionalObjectsData($plotNode); + break; + case 'instantPlot' : + $result_data['panel']['plotType'] = 'instantPlot'; + + break; + case 'statusPlot' : + $result_data['panel']['plotType'] = 'statusPlot'; + + break; + case 'tickPlot' : + $result_data['panel']['plotType'] = 'tickPlot'; + + break; + } + + $result_data['draw'] = $this->unmarshallDrawData($plotNode, $data->getParamId()); + } + + $result = array( + "success" => true, + "data" => $result_data + ); + //var_dump($result); + } + + /*if (count($paramsNode->getChildren()) >= 1) { + $paramNode = $paramsNode->getChildren()[0]; + if (count($paramNode->getChildren()) >= 1) { + $drawNode = $paramNode->getChildren()[0]; + + + switch ($drawNode->getName()) { + case 'serie' : + $data['drawType'] = 'serie'; + break; + case 'orbitserie' : + $data['drawType'] = 'orbit-serie'; + break; + } + + $result = array( + "success" => true, + "data" => $data + ); + } + }*/ + } + break; + default: + //Nothing ToDo + } + + return $result; + } + + private function unmarshallDrawData($plotNode, $paramId) { + $result_data = array(); + + if (!isset($plotNode)) + return $result_data; + + $paramsNode = $plotNode->getParams(); + + if (!isset($paramsNode)) + return $result_data; + + $paramNode = $paramsNode->getParamById($paramId); + + if (!isset($paramNode) || (count($paramNode->getChildren()) < 1)) + return $result_data; + + $mainDrawNode = NULL; + $otherDrawNodes = array(); + + foreach ($paramNode->getChildren() as $crtDrawNode) { + if (in_array($crtDrawNode->getName(), array('serie', 'spectro', 'yserie', 'orbitserie'))) + $mainDrawNode = $crtDrawNode; + else + $otherDrawNodes[$mainDrawNode->getName()] = $crtDrawNode; + } + + if (!isset($mainDrawNode)) + return $result_data; + + switch ($mainDrawNode->getName()) { + case 'serie' : + $result_data['type'] = 'serie'; + $this->unmarshallBaseSerieData($mainDrawNode, $result_data); + //if (array_key_exists('colorserie', $otherDrawNodes)) + // $this->unmarshallColorSerieData($mainDrawNode, $result_data); + break; + case 'spectro' : + $result_data['type'] = 'spectro'; + $this->unmarshallSpectroData($mainDrawNode, $result_data); + break; + case 'yserie' : + if (!array_key_exists('xserie', $otherDrawNodes)) + return $result_data; + $this->unmarshallBaseSerieData($mainDrawNode, $result_data); + //$this->unmarshallXSerieData($mainDrawNode, $result_data); + //if (array_key_exists('colorserie', $otherDrawNodes)) + // $this->unmarshallColorSerieData($mainDrawNode, $result_data); + break; + case 'orbitserie' : + $result_data['type'] = 'orbit-serie'; + $result_data['serie-projection'] = $mainDrawNode->getProjection(); + $this->unmarshallBaseSerieData($mainDrawNode, $result_data); + //if (array_key_exists('colorserie', $otherDrawNodes)) + // $this->unmarshallColorSerieData($mainDrawNode, $result_data); + break; + default : + return $result_data; + } + + return $result_data; + } + + private function unmarshallSpectroData($drawNode, &$result_array) { + if (!isset($drawNode)) + return; + + if (!empty($drawNode->getAttribute(REQUESTOUTPUTPLOTSPECTRO_YAXIS))) + $result_array['spectro-yaxis'] = $drawNode->getAttribute(REQUESTOUTPUTPLOTSPECTRO_YAXIS); + + if (!empty($drawNode->getAttribute(REQUESTOUTPUTPLOTSPECTRO_MIN))) + $result_array['spectro-value-min'] = $drawNode->getAttribute(REQUESTOUTPUTPLOTSPECTRO_MIN); + + if (!empty($drawNode->getAttribute(REQUESTOUTPUTPLOTSPECTRO_MAX))) + $result_array['spectro-value-max'] = $drawNode->getAttribute(REQUESTOUTPUTPLOTSPECTRO_MAX); + } + + private function unmarshallAdditionalObjectsData($plotNode) { + $result_data = array(); + + if (!isset($plotNode)) + return $result_data; + + $additionalObjectsNode = $plotNode->getAdditionalObjects(); + + //curvePlot + $result_data['curves'] = array(); + $curveObjectsNode = $additionalObjectsNode->getCurveObjects(); + foreach ($curveObjectsNode as $curveNode) { + $crt_curve_data = array(); + $crt_curve_data['curve-serie-id'] = $curveNode->getSerieId(); + $this->unmarshallLineData($curveNode, "curve-line-", $crt_curve_data); + + if ($curveNode->isFunctionDefined()) { + $crt_curve_data['curve-name'] = $curveNode->getFunction()->getFunctionName(); + $crt_curve_data['curve-attributes'] = array(); + + foreach ($curveNode->getFunction()->getAttributes()->getChildren() as $attributeNode) { + $crt_attribute_data = array(); + + $crt_attribute_data['curve-param-name'] = $attributeNode->getAttribute(REQUESTOUTPUTPLOTCURVEOBJECTFUNCTION_ATTRIBUTENAME); + $crt_attribute_data['curve-param-value'] = $attributeNode->getAttribute(REQUESTOUTPUTPLOTCURVEOBJECTFUNCTION_ATTRIBUTEVALUE); + + $crt_curve_data['curve-attributes'][] = $crt_attribute_data; + } + + } + + $result_data['curves'][] = $crt_curve_data; + } + + return $result_data; + } + + private function unmarshallBaseSerieData($drawNode, &$result_array) { + if (!isset($drawNode)) + return; + + $result_array['serie-id'] = $drawNode->getId(); + + $result_array['serie-yaxis'] = $drawNode->getYAxisId(); + + if ($drawNode->isLineDefined()) { + $result_array['serie-lines-activated'] = true; + $this->unmarshallLineData($drawNode->getLine(), "serie-lines-", $result_array); + } + + if ($drawNode->isSymbolDefined()) { + $result_array['serie-symbols-activated'] = true; + $this->unmarshallSymbolData($drawNode->getSymbol(), "serie-symbols-", $result_array); + } + + if (!empty($drawNode->getColorSerieId())) { + //ToDo + } + + if ($drawNode->isTimeTicksDefined()) { + $result_array['serie-timetick-activated'] = true; + + $result_array['serie-timetick-step'] = $drawNode->getTimeTicks()->getStep(); + $result_array['serie-timetick-nbmajor'] = $drawNode->getTimeTicks()->getNumber(); + $result_array['serie-timetick-nbminor'] = $drawNode->getTimeTicks()->getMinor(); + $result_array['serie-timetick-color'] = $this->toHexColor($drawNode->getTimeTicks()->getColor()); + + if (!empty($result_array['serie-timetick-nbmajor']) && intval($result_array['serie-timetick-nbmajor']) > 0) + $result_array['serie-timetick-type'] = 'nb-major'; + else if (!empty($result_array['serie-timetick-step']) && intval($result_array['serie-timetick-step']) > 0) + $result_array['serie-timetick-type'] = 'time-step'; + else + $result_array['serie-timetick-type'] = 'auto'; + + if ($drawNode->getTimeTicks()->isSymbolDefined()) { + $this->unmarshallSymbolData($drawNode->getTimeTicks()->getSymbol(), "serie-timetick-symbols-", $result_array); + } + + if ($drawNode->getTimeTicks()->isFirstSymbolDefined()) { + $result_array['serie-timetick-firstsymbols-activated'] = true; + $this->unmarshallSymbolData($drawNode->getTimeTicks()->getFirstSymbol(), "serie-timetick-firstsymbols-", $result_array); + } + + if ($drawNode->getTimeTicks()->isFontDefined()) { + $result_array['serie-timetick-font-activated'] = true; + $this->unmarshallFontData($drawNode->getTimeTicks()->getFont(), "serie-timetick-font-", $result_array); + } + } + + if ($drawNode->isIntervalTicksDefined()) { + $result_array['serie-intervaltick-activated'] = true; + + $result_array['serie-intervaltick-mode'] = $drawNode->getIntervalTicks()->getMode(); + $result_array['serie-intervaltick-color'] = $this->toHexColor($drawNode->getIntervalTicks()->getColor()); + + if ($drawNode->getIntervalTicks()->isSymbolDefined()) { + $this->unmarshallSymbolData($drawNode->getIntervalTicks()->getSymbol(), "serie-intervaltick-", $result_array); + } + + if ($drawNode->getIntervalTicks()->isFontDefined()) { + $result_array['serie-intervaltick-font-activated'] = true; + $this->unmarshallFontData($drawNode->getIntervalTicks()->getFont(), "serie-intervaltick-font-", $result_array); + } + } + } + + private function unmarshallLineData($lineNode, $prefix, &$result_array) { + $result_array[$prefix.'style'] = $lineNode->getStyle(); + $result_array[$prefix.'width'] = $lineNode->getWidth(); + $result_array[$prefix.'color'] = $this->toHexColor($lineNode->getColor()); + } + + private function unmarshallSymbolData($symbolNode, $prefix, &$result_array) { + $result_array[$prefix.'type'] = $symbolNode->getType(); + $result_array[$prefix.'size'] = $symbolNode->getSize(); + $result_array[$prefix.'color'] = $this->toHexColor($symbolNode->getColor()); + } + + private function unmarshallFontData($fontNode, $prefix, &$result_array) { + $result_array[$prefix.'name'] = $fontNode->getFontName(); + $result_array[$prefix.'size'] = $fontNode->getSize(); + $result_array[$prefix.'bold'] = ($fontNode->getWeight() == RequestOutputPlotFontWeight::BOLD); + $result_array[$prefix.'italic'] = ($fontNode->getStyle() == RequestOutputPlotFontStyle::ITALIC); + } + + private function toHexColor($color) { + $temp = str_replace(array('[', ']', ' '), '', $color); + $arr = explode(',', $temp); + if (count ($arr) != 3) + return '#000000'; + return '#'.sprintf('%02x', $arr[0]).sprintf('%02x', $arr[1]).sprintf('%02x', $arr[2]); + } +} + +?> \ No newline at end of file diff --git a/src/Request/ParamInfoRequestClass.php b/src/Request/ParamInfoRequestClass.php new file mode 100644 index 0000000..83b8cbc --- /dev/null +++ b/src/Request/ParamInfoRequestClass.php @@ -0,0 +1,73 @@ +<?php +/** + * @class ParamInfoRequestClass + * @brief Implementation of a ParamInfoRequestClass for a param info request + * @details + */ +class ParamInfoRequestClass extends RequestAbstractClass +{ + /* + * @brief Init a param info request + */ + public function init() + { + if (!isset($this->requestData)) + return false; + + //Force load of node files to init the NodeFactory + foreach (glob(dirname(__FILE__)."/ParamsRequestImpl/Nodes/Requests/*NodeClass.php") as $filename) { + require_once $filename; + } + + return TRUE; + } + + /* + * @brief Run a param info request + */ + public function run() + { + $dom = new DOMDocument("1.0","UTF-8"); + $dom->preserveWhiteSpace = false; + $dom->formatOutput = true; + $res = $dom->load($this->requestData->getParamPath()); + + $this->requestData->setSuccess(false); + + if (!$res) { + $this->requestData->setLastErrorMessage("Cannot load parameter file"); + return false; + } + + $paramNode = new ParamNodeClass(); + + try { + $paramNode->loadFromNode($dom->documentElement); + } catch (Exception $e) { + $this->requestData->setLastErrorMessage("Error to parse parameter file : Exception detected : ".$e->getMessage()); + return false; + } + + switch ($this->requestData->getType()) { + case ParamInfoTypeEnumClass::PLOTINIT : + $outputNode = $paramNode->getOutput(); + if (!isset($outputNode)) { + $this->requestData->setLastErrorMessage("Cannot parse output node"); + return false; + } + $plotNode = $outputNode->getChildInstanceByName("plot"); + if (!isset($plotNode)) { + $this->requestData->setLastErrorMessage("Cannot parse plot node"); + return false; + } + $this->requestData->setResultNode($plotNode); + $this->requestData->setSuccess(true); + break; + default : + $this->requestData->setLastErrorMessage("Unknown param info request"); + } + + return $this->requestData->getSuccess(); + } +} +?> \ No newline at end of file diff --git a/src/Request/ParamInfoRequestDataClass.php b/src/Request/ParamInfoRequestDataClass.php new file mode 100644 index 0000000..9a03075 --- /dev/null +++ b/src/Request/ParamInfoRequestDataClass.php @@ -0,0 +1,67 @@ +<?php + +/** + * @class ParamInfoTypeEnumClass + * @brief Enumerate for param info request type + * @details + */ +abstract class ParamInfoTypeEnumClass +{ + const UNKNOWN = ""; + const PLOTINIT = "plot_init"; +} + +/** + * @class ParamInfoRequestDataClass + * @brief Data for a param info request + * @details + */ +class ParamInfoRequestDataClass extends RequestDataClass +{ + private $paramPath = ""; + private $paramId = ""; + private $type = ParamInfoTypeEnumClass::UNKNOWN; + private $resultNode = NULL; + + public function getParamPath() + { + return $this->paramPath; + } + + public function setParamPath($paramPath) + { + $this->paramPath = $paramPath; + } + + public function getType() + { + return $this->type; + } + + public function setType($type) + { + $this->type = $type; + } + + public function getResultNode() + { + return $this->resultNode; + } + + public function setResultNode($resultNode) + { + $this->resultNode = $resultNode; + } + + public function getParamId() + { + return $this->paramId; + } + + public function setParamId($paramId) + { + $this->paramId = $paramId; + } +} + +?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Infos/InfoParamNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Infos/InfoParamNodeClass.php index 1cb625f..0750948 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Infos/InfoParamNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Infos/InfoParamNodeClass.php @@ -53,12 +53,66 @@ class InfoParamNodeClass extends NodeClass public function setName($name) { $node = $this->getChildInstanceByName(INFOPARAM_NAME,true); - $node->setValue($sampling); + $node->setValue($name); + } + + public function setShortName($short_name) + { + $node = $this->getChildInstanceByName(INFOPARAM_SHORTNAME,true); + $node->setValue($short_name); + } + + public function setComponents($components) + { + $node = $this->getChildInstanceByName(INFOPARAM_COMPONENTS,true); + $node->setValue($components); + } + + public function setUnits($units) + { + $node = $this->getChildInstanceByName(INFOPARAM_UNITS,true); + $node->setValue($units); + } + + public function setCoordSyst($coord_sys) + { + $node = $this->getChildInstanceByName(INFOPARAM_COORDSYS,true); + $node->setValue($coord_sys); + } + + public function setTensorOrder($tensor_order) + { + $node = $this->getChildInstanceByName(INFOPARAM_TENSORORDER,true); + $node->setValue($tensor_order); + } + + public function setSIConv($si_conv) + { + $node = $this->getChildInstanceByName(INFOPARAM_SICONV,true); + $node->setValue($si_conv); + } + + public function setFillVal($fill) + { + $node = $this->getChildInstanceByName(INFOPARAM_FILLVAL,true); + $node->setValue($fill); + } + + public function setUCD($ucd) + { + $node = $this->getChildInstanceByName(INFOPARAM_UCD,true); + $node->setValue($ucd); + } + + public function setDatasetID($dataset_id) + { + $node = $this->getChildInstanceByName(INFOPARAM_DATASETID,true); + $node->setValue($dataset_id); } public function addTable($type, $name) { - $node = $this->getChildInstanceByName(INFOPARAM_TABLE, true); + $node = $this->getTable(); switch ($type) { @@ -75,7 +129,7 @@ class InfoParamNodeClass extends NodeClass $tableDef = new InfoParamTableDefCenterWidthNodeClass(); break; default : - throw new Exception('Table definition node not implemented'); + //throw new Exception('Table definition node not implemented'); } $tableDef->setTableName($name); @@ -84,6 +138,76 @@ class InfoParamNodeClass extends NodeClass return $tableDef; } + + public function getTable() + { + return $this->getChildInstanceByName(INFOPARAM_TABLE, true); + } + + public function loadFromNode($xmlNode) + { + $nameXmlNode = $this->getXmlNodeChildByTagName($xmlNode, INFOPARAM_NAME); + if (isset($nameXmlNode)) + $this->setName($this->getXmlNodeValue($nameXmlNode)); + + $shortnameXmlNode = $this->getXmlNodeChildByTagName($xmlNode, INFOPARAM_SHORTNAME); + if (isset($shortnameXmlNode)) + $this->setShortName($this->getXmlNodeValue($shortnameXmlNode)); + + $componentsXmlNode = $this->getXmlNodeChildByTagName($xmlNode, INFOPARAM_COMPONENTS); + if (isset($componentsXmlNode)) + $this->setComponents($this->getXmlNodeValue($componentsXmlNode)); + + $unitsXmlNode = $this->getXmlNodeChildByTagName($xmlNode, INFOPARAM_UNITS); + if (isset($unitsXmlNode)) + $this->setUnits($this->getXmlNodeValue($unitsXmlNode)); + + $coordsysXmlNode = $this->getXmlNodeChildByTagName($xmlNode, INFOPARAM_COORDSYS); + if (isset($coordsysXmlNode)) + $this->setCoordSyst($this->getXmlNodeValue($coordsysXmlNode)); + + $tensororderXmlNode = $this->getXmlNodeChildByTagName($xmlNode, INFOPARAM_TENSORORDER); + if (isset($tensororderXmlNode)) + $this->setTensorOrder($this->getXmlNodeValue($tensororderXmlNode)); + + $siconvXmlNode = $this->getXmlNodeChildByTagName($xmlNode, INFOPARAM_SICONV); + if (isset($siconvXmlNode)) + $this->setSIConv($this->getXmlNodeValue($siconvXmlNode)); + + $tableXmlNode = $this->getXmlNodeChildByTagName($xmlNode, INFOPARAM_TABLE); + if (isset($tableXmlNode)) { + foreach ($this->getXmlNodeChildren($tableXmlNode) as $tableDefXmlNode) { + switch ($this->getXmlNodeName($tableDefXmlNode)) { + case INFOPARAMTABLEDEFBOUNDS_TAGNAME : + $this->addTable(InfoParamTableTypeEnum::BOUNDS, "")->loadFromNode($tableDefXmlNode); + break; + case INFOPARAMTABLEDEFCENTER_TAGNAME : + $this->addTable(InfoParamTableTypeEnum::CENTER, "")->loadFromNode($tableDefXmlNode); + break; + case INFOPARAMTABLEDEFCENTERWIDTH_TAGNAME : + $this->addTable(InfoParamTableTypeEnum::CENTERWIDTH, "")->loadFromNode($tableDefXmlNode); + break; + case InfoParamTableDefMinMaxNodeClass : + $this->addTable(InfoParamTableTypeEnum::MINMAX, "")->loadFromNode($tableDefXmlNode); + break; + default : + //throw new Exception('Table definition node not implemented'); + } + } + } + + $fillvalXmlNode = $this->getXmlNodeChildByTagName($xmlNode, INFOPARAM_FILLVAL); + if (isset($fillvalXmlNode)) + $this->setFillVal($this->getXmlNodeValue($fillvalXmlNode)); + + $ucdXmlNode = $this->getXmlNodeChildByTagName($xmlNode, INFOPARAM_UCD); + if (isset($ucdXmlNode)) + $this->setUCD($this->getXmlNodeValue($ucdXmlNode)); + + $datasetidXmlNode = $this->getXmlNodeChildByTagName($xmlNode, INFOPARAM_DATASETID); + if (isset($datasetidXmlNode)) + $this->setDatasetID($this->getXmlNodeValue($datasetidXmlNode)); + } } ?> diff --git a/src/Request/ParamsRequestImpl/Nodes/Infos/InfoParamTableDefBoundsNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Infos/InfoParamTableDefBoundsNodeClass.php index 1fa32bb..92f60cc 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Infos/InfoParamTableDefBoundsNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Infos/InfoParamTableDefBoundsNodeClass.php @@ -24,6 +24,12 @@ class InfoParamTableDefBoundsNodeClass extends InfoParamTableDefNodeClass { return $this->getAttribute(INFOPARAMTABLEDEFBOUNDS_BOUNDSNAME); } + + public function loadFromNode($xmlNode) + { + parent::loadFromNode($xmlNode); + $this->setBoundsName($this->getXmlNodeAttribute($xmlNode, INFOPARAMTABLEDEFBOUNDS_BOUNDSNAME)); + } } ?> diff --git a/src/Request/ParamsRequestImpl/Nodes/Infos/InfoParamTableDefCenterNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Infos/InfoParamTableDefCenterNodeClass.php index a4c8d94..d0d00d9 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Infos/InfoParamTableDefCenterNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Infos/InfoParamTableDefCenterNodeClass.php @@ -35,6 +35,13 @@ class InfoParamTableDefCenterNodeClass extends InfoParamTableDefNodeClass { return $this->getAttribute(INFOPARAMTABLEDEFCENTER_SIZE); } + + public function loadFromNode($xmlNode) + { + parent::loadFromNode($xmlNode); + $this->setCenterName($this->getXmlNodeAttribute($xmlNode, INFOPARAMTABLEDEFCENTER_CENTERNAME)); + $this->setSize($this->getXmlNodeAttribute($xmlNode, INFOPARAMTABLEDEFCENTER_SIZE)); + } } ?> diff --git a/src/Request/ParamsRequestImpl/Nodes/Infos/InfoParamTableDefCenterWidthNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Infos/InfoParamTableDefCenterWidthNodeClass.php index 22c23ec..9830dc7 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Infos/InfoParamTableDefCenterWidthNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Infos/InfoParamTableDefCenterWidthNodeClass.php @@ -35,6 +35,13 @@ class InfoParamTableDefCenterWidthNodeClass extends InfoParamTableDefNodeClass { return $this->getAttribute(INFOPARAMTABLEDEFCENTERWIDTH_WIDTHNAME); } + + public function loadFromNode($xmlNode) + { + parent::loadFromNode($xmlNode); + $this->setCenterName($this->getXmlNodeAttribute($xmlNode, INFOPARAMTABLEDEFCENTERWIDTH_CENTERNAME)); + $this->setWidthName($this->getXmlNodeAttribute($xmlNode, INFOPARAMTABLEDEFCENTERWIDTH_WIDTHNAME)); + } } ?> diff --git a/src/Request/ParamsRequestImpl/Nodes/Infos/InfoParamTableDefMinMaxNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Infos/InfoParamTableDefMinMaxNodeClass.php index 9c2400a..b17edd5 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Infos/InfoParamTableDefMinMaxNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Infos/InfoParamTableDefMinMaxNodeClass.php @@ -35,6 +35,13 @@ class InfoParamTableDefMinMaxNodeClass extends InfoParamTableDefNodeClass { return $this->getAttribute(INFOPARAMTABLEDEFMINMAX_MAXNAME); } + + public function loadFromNode($xmlNode) + { + parent::loadFromNode($xmlNode); + $this->setMinName($this->getXmlNodeAttribute($xmlNode, INFOPARAMTABLEDEFMINMAX_MINNAME)); + $this->setMaxName($this->getXmlNodeAttribute($xmlNode, INFOPARAMTABLEDEFMINMAX_MAXNAME)); + } } ?> diff --git a/src/Request/ParamsRequestImpl/Nodes/Infos/InfoParamTableDefNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Infos/InfoParamTableDefNodeClass.php index c156656..b983a3b 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Infos/InfoParamTableDefNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Infos/InfoParamTableDefNodeClass.php @@ -45,6 +45,13 @@ class InfoParamTableDefNodeClass extends NodeClass { return $this->getAttribute(INFOPARAMTABLEDEF_UNITS); } + + public function loadFromNode($xmlNode) + { + $this->setTableName($this->getXmlNodeAttribute($xmlNode, INFOPARAMTABLEDEF_NAME)); + $this->setDim($this->getXmlNodeAttribute($xmlNode, INFOPARAMTABLEDEF_DIM)); + $this->setUnits($this->getXmlNodeAttribute($xmlNode, INFOPARAMTABLEDEF_UNITS)); + } } ?> diff --git a/src/Request/ParamsRequestImpl/Nodes/NodeClass.php b/src/Request/ParamsRequestImpl/Nodes/NodeClass.php index 3be33f5..108f3a1 100644 --- a/src/Request/ParamsRequestImpl/Nodes/NodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/NodeClass.php @@ -29,7 +29,7 @@ class NodeClass { $this->value = $val; } - + protected function getValue() { return $this->value; @@ -40,7 +40,7 @@ class NodeClass $this->attributes[$attName] = $attVal; } - protected function getAttribute($attName) + public function getAttribute($attName) { return $this->attributes[$attName]; } @@ -69,7 +69,7 @@ class NodeClass $this->addChild($child); } - protected function getChildren() + public function getChildren() { return $this->children; } @@ -94,11 +94,10 @@ class NodeClass return NULL; } - protected function getChildInstanceByName($name, $createIfNoExist = false) + public function getChildInstanceByName($name, $createIfNoExist = false) { $node = $this->getFirstChildByName($name); - if ($node == NULL) - if ($createIfNoExist) + if (!isset($node) && $createIfNoExist) { $node = new NodeClass($name); $this->addChild($node); @@ -127,6 +126,74 @@ class NodeClass return $xmlNode; } + + /* + * @brief Method to load a XML node + */ + public function getXmlNodeAttribute($xmlNode, $attribute) + { + return $xmlNode->getAttribute($attribute); + } + + public function getXmlNodeValue($xmlNode) + { + return $xmlNode->nodeValue; + } + + public function getXmlNodeName($xmlNode) + { + return $xmlNode->nodeName; + } + + public function getXmlNodeChildren($xmlNode) + { + return $xmlNode->childNodes; + } + + public function getXmlNodeChildrenByTagName($xmlNode, $childrenName) + { + $result = array(); + for ($n = $xmlNode->firstChild; $n !== null; $n = $n->nextSibling) { + if ($n instanceof DOMElement && $n->tagName == $childrenName) { + $result[] = $n; + } + } + return $result; + } + + public function getXmlNodeChildByTagName($xmlNode, $childName) + { + $xmlChildrenNodes = $this->getXmlNodeChildrenByTagName($xmlNode, $childName); + if (count($xmlChildrenNodes) <= 0) + return NULL; + return $xmlChildrenNodes[0]; + } + + public function loadFromNode($xmlNode) { + /*//Attributes + + //Value + if ($this->getXmlNodeChildren($xmlNode) == NULL) { + if ($this->getXmlNodeValue($xmlNode)) { + $result[$childXmlNode->nodeName] = $this->getXmlNodeValue($xmlNode); + } + return; + } + //Children + foreach ($this->getXmlNodeChildren($xmlNode) as $childXmlNode) { + echo $childXmlNode->nodeName.PHP_EOL; + $nodeObject = NodeFactory::getNodeObject ($childXmlNode->nodeName, $this->getContext()); + if (isset($nodeObject)) { + $cloneNodeObject = clone $nodeObject; + if (!array_key_exists($childXmlNode->nodeName,$result)) + $result[$childXmlNode->nodeName] = array(); + $result[$childXmlNode->nodeName][] = array(); + $cloneNodeObject->loadFromNode($childXmlNode, $result[$childXmlNode->nodeName][count($result[$childXmlNode->nodeName])-1]); + } + else + echo "[WARNING] ".$childXmlNode->nodeName." ".$this->getContext().PHP_EOL; + }*/ + } } ?> diff --git a/src/Request/ParamsRequestImpl/Nodes/Params/ParamClbManualNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Params/ParamClbManualNodeClass.php index 08182b9..43ba599 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Params/ParamClbManualNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Params/ParamClbManualNodeClass.php @@ -31,12 +31,22 @@ class ParamClbManualNodeClass extends NodeClass $valueNode = new NodeClass(PARAMCLBMANUAL_VALUE); $valueNode->setValue($value); $this->addChild($valueNode); + return $valueNode; } public function getClbValues() { return $this->getChildrenByName(PARAMCLBMANUAL_VALUE); } + + public function loadFromNode($xmlNode) + { + $this->setClbName($this->getXmlNodeAttribute($xmlNode, PARAMCLBMANUAL_NAME)); + + foreach ($this->getXmlNodeChildrenByTagName($xmlNode, PARAMCLBMANUAL_VALUE) as $clbXmlNode) { + $this->addClbValue($this->getXmlNodeValue($clbXmlNode)); + } + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Params/ParamGetAmdaParamNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Params/ParamGetAmdaParamNodeClass.php index b4749d2..df3a25e 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Params/ParamGetAmdaParamNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Params/ParamGetAmdaParamNodeClass.php @@ -24,6 +24,11 @@ class ParamGetAmdaParamNodeClass extends NodeClass { return $this->getAttribute(PARAMGETAMDAPARAM_NAMEATT); } + + public function loadFromNode($xmlNode) + { + $this->setParamName($this->getXmlNodeAttribute($xmlNode, PARAMGETAMDAPARAM_NAMEATT)); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Params/ParamGetDDBaseBaseParamNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Params/ParamGetDDBaseBaseParamNodeClass.php index 926b717..eb6f3fc 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Params/ParamGetDDBaseBaseParamNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Params/ParamGetDDBaseBaseParamNodeClass.php @@ -18,12 +18,12 @@ class ParamGetDDBaseBaseParamNodeClass extends NodeClass parent::__construct(PARAMGETDDBASEBASEPARAM_NAME); } - public function setName($name) + public function setParamName($name) { $this->setAttribute(PARAMGETDDBASEBASEPARAM_NAMEATT, $name); } - public function getName() + public function getParamName() { return $this->getAttribute(PARAMGETDDBASEBASEPARAM_NAMEATT); } @@ -34,14 +34,16 @@ class ParamGetDDBaseBaseParamNodeClass extends NodeClass $tensorNode->setValue($tensor_order); } - public function addCalibInfo($calibInfo) + public function addCalibInfo($calibInfo = "") { if ($this->calibInfoExist($calibInfo)) - return; + return NULL; $node = new NodeClass(PARAMGETDDBASEBASEPARAM_CALIB); $node->setAttribute(PARAMGETDDBASEBASEPARAM_CALIBNAME,$calibInfo); $this->addChild($node); + + return $node; } public function calibInfoExist($calibInfo) @@ -54,6 +56,19 @@ class ParamGetDDBaseBaseParamNodeClass extends NodeClass return false; } + + public function loadFromNode($xmlNode) + { + $this->setParamName($this->getXmlNodeAttribute($xmlNode, PARAMGETDDBASEBASEPARAM_NAMEATT)); + + $tensorOrderXmlNode = $this->getXmlNodeChildByTagName($xmlNode, PARAMGETDDBASEBASEPARAM_TENSORORDER); + if (isset($tensorOrderXmlNode)) + $this->setTensorOrder($this->getXmlNodeValue($tensorOrderXmlNode)); + + foreach ($this->getXmlNodeChildrenByTagName($xmlNode, PARAMGETDDBASEBASEPARAM_CALIB) as $clbXmlNode) { + $this->addCalibInfo($this->getXmlNodeAttribute($xmlNode, PARAMGETDDBASEBASEPARAM_CALIBNAME)); + } + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Params/ParamGetDDBaseNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Params/ParamGetDDBaseNodeClass.php index 93a33af..7509de8 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Params/ParamGetDDBaseNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Params/ParamGetDDBaseNodeClass.php @@ -1,5 +1,7 @@ <?php +require_once "ParamGetDDBaseBaseParamNodeClass.php"; + define ("PARAMGETDDBASE_NAME", "vi"); define ("PARAMGETDDBASE_NAMEATT", "name"); @@ -15,24 +17,35 @@ class ParamGetDDBaseNodeClass extends NodeClass parent::__construct(PARAMGETDDBASE_NAME); } - public function setName($name) + public function setVIName($name) { $this->setAttribute(PARAMGETDDBASE_NAMEATT, $name); } - public function getName() + public function getVIName() { return $this->getAttribute(PARAMGETDDBASE_NAMEATT); } - public function addBaseParam($name,$calib_info_list, $tensor_order = -1) + public function addBaseParam($name = "", $calib_info_list = array(), $tensor_order = -1) { - $baseParamNode = new ParamGetDDBaseBaseParamNode(); - $baseParamNode->setName($name); + $baseParamNode = new ParamGetDDBaseBaseParamNodeClass(); + $baseParamNode->setParamName($name); if ($tensor_order > -1) $baseParamNode->setTensorOrder($tensor_order); foreach ($calib_info_list as $calib_info) $baseParamNode->addCalibInfo($calib_info); + $this->addChild($baseParamNode); + return $baseParamNode; + } + + public function loadFromNode($xmlNode) + { + $this->setVIName($this->getXmlNodeAttribute($xmlNode, PARAMGETDDBASE_NAMEATT)); + + foreach ($this->getXmlNodeChildrenByTagName($xmlNode, PARAMGETDDBASEBASEPARAM_NAME) as $baseParamXmlNode) { + $this->addBaseParam()->loadFromNode($baseParamXmlNode); + } } } diff --git a/src/Request/ParamsRequestImpl/Nodes/Params/ParamGetLocalBaseNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Params/ParamGetLocalBaseNodeClass.php index 0d6cc3c..3ee043b 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Params/ParamGetLocalBaseNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Params/ParamGetLocalBaseNodeClass.php @@ -1,5 +1,7 @@ <?php +require_once "ParamGetLocalBaseParamNodeClass.php"; + define ("PARAMGETLOCALBASE_VI", "localvi"); define ("PARAMGETLOCALBASE_VIID", "id"); @@ -30,7 +32,7 @@ class ParamGetLocalBaseNodeClass extends NodeClass return NULL; } - public function addLocalParam($id, $minSampling, $maxSampling) + public function addLocalParam($id = "", $minSampling = "", $maxSampling = "") { $paramNode = new ParamGetLocalBaseParamNodeClass(); @@ -39,6 +41,17 @@ class ParamGetLocalBaseNodeClass extends NodeClass $paramNode->setMaxSampling($maxSampling); $this->addChild($paramNode); + + return $paramNode; + } + + public function loadFromNode($xmlNode) + { + $this->setVIId($this->getXmlNodeAttribute($xmlNode, PARAMGETLOCALBASE_VIID)); + + foreach ($this->getXmlNodeChildrenByTagName($xmlNode, PARAMGETLOCALBASEPARAM_NAME) as $localParamXmlNode) { + $this->addLocalParam()->loadFromNode($localParamXmlNode); + } } } diff --git a/src/Request/ParamsRequestImpl/Nodes/Params/ParamGetLocalBaseParamNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Params/ParamGetLocalBaseParamNodeClass.php index 980976a..395878a 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Params/ParamGetLocalBaseParamNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Params/ParamGetLocalBaseParamNodeClass.php @@ -40,14 +40,16 @@ class ParamGetLocalBaseParamNodeClass extends NodeClass $this->setAttribute(PARAMGETLOCALBASEPARAM_MAXSAMPLING, $maxSampling); } - public function addCalibInfo($calibInfo) + public function addCalibInfo($calibInfo = "") { if ($this->calibInfoExist($calibInfo)) - return; + return NULL; $node = new NodeClass(PARAMGETLOCALBASEPARAM_CALIB); $node->setAttribute(PARAMGETLOCALBASEPARAM_CALIBNAME,$calibInfo); $this->addChild($node); + + return $node; } public function calibInfoExist($calibInfo) @@ -60,6 +62,19 @@ class ParamGetLocalBaseParamNodeClass extends NodeClass return false; } + + public function loadFromNode($xmlNode) + { + $this->setId($this->getXmlNodeAttribute($xmlNode, PARAMGETLOCALBASEPARAM_ID)); + + $this->setMinSampling($this->getXmlNodeAttribute($xmlNode, PARAMGETLOCALBASEPARAM_MINSAMPLING)); + + $this->setMaxSampling($this->getXmlNodeAttribute($xmlNode, PARAMGETLOCALBASEPARAM_MAXSAMPLING)); + + foreach ($this->getXmlNodeChildrenByTagName($xmlNode, PARAMGETLOCALBASEPARAM_CALIB) as $calibXmlNode) { + $this->addCalibInfo($this->getXmlNodeAttribute($xmlNode, PARAMGETLOCALBASEPARAM_CALIBNAME)); + } + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Params/ParamNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Params/ParamNodeClass.php index c887ce2..a51d9ce 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Params/ParamNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Params/ParamNodeClass.php @@ -1,5 +1,12 @@ <?php +require_once "ParamClbManualNodeClass.php"; +require_once "ParamGetAmdaParamNodeClass.php"; +require_once "ParamGetDDBaseNodeClass.php"; +require_once "ParamGetLocalBaseNodeClass.php"; +require_once dirname(__FILE__)."/../Infos/InfoParamNodeClass.php"; +require_once dirname(__FILE__)."/../Requests/RequestOutputPlotPanelNodeClass.php"; + define ("PARAM_NAME", "param"); define ("PARAM_ID", "xml:id"); define ("PARAM_SAMPLING", "time_resolution"); @@ -57,7 +64,7 @@ class ParamNodeClass extends NodeClass return $infoNode; } - public function addClbManual($name) + public function addClbManual($name = "") { $clbManualNode = new ParamClbManualNodeClass(); $clbManualNode->setClbName($name); @@ -108,6 +115,72 @@ class ParamNodeClass extends NodeClass public function setOutput() { $node = $this->getChildInstanceByName(PARAM_OUTPUT, true); + return $node; + } + + public function getOutput() + { + return $this->getChildInstanceByName(PARAM_OUTPUT, false); + } + + public function loadFromNode($xmlNode) + { + $this->setId($this->getXmlNodeAttribute($xmlNode, PARAM_ID)); + + $samplingXmlNode = $this->getXmlNodeChildByTagName($xmlNode, PARAM_SAMPLING); + if (isset($samplingXmlNode)) + $this->setSampling($this->getXmlNodeValue($samplingXmlNode)); + + $gapXmlNode = $this->getXmlNodeChildByTagName($xmlNode, PARAM_GAP); + if (isset($gapXmlNode)) + $this->setGap($this->getXmlNodeValue($gapXmlNode)); + + $infoXmlNode = $this->getXmlNodeChildByTagName($xmlNode, INFOPARAM_TAGNAME); + if (isset($infoXmlNode)) + $this->getInfo()->loadFromNode($infoXmlNode); + + foreach ($this->getXmlNodeChildrenByTagName($xmlNode, PARAMCLBMANUAL_TAGNAME) as $clbXmlNode) { + $this->addClbManual()->loadFromNode($clbXmlNode); + } + + $paramGetXmlNode = $this->getXmlNodeChildByTagName($xmlNode, PARAM_GET); + if (isset($paramGetXmlNode)) { + foreach ($this->getXmlNodeChildren($paramGetXmlNode) as $paramGetDefXmlNode) { + switch ($this->getXmlNodeName($paramGetDefXmlNode)) { + case PARAMGETAMDAPARAM_NAME : + $this->addParamGet(ParamGetTypeEnum::AMDAPARAM)->loadFromNode($paramGetDefXmlNode); + break; + case PARAMGETDDBASE_NAME : + $this->addParamGet(ParamGetTypeEnum::DDBASE)->loadFromNode($paramGetDefXmlNode); + break; + case PARAMGETLOCALBASE_VI : + $this->addParamGet(ParamGetTypeEnum::LOCALBASE)->loadFromNode($paramGetDefXmlNode); + break; + } + } + } + + $processXmlNode = $this->getXmlNodeChildByTagName($xmlNode, PARAM_PROCESS); + if (isset($processXmlNode)) + $this->setProcess($this->getXmlNodeValue($processXmlNode)); + + $outputNode = $this->setOutput(); + $outputXmlNode = $this->getXmlNodeChildByTagName($xmlNode, PARAM_OUTPUT); + if (isset($outputXmlNode)) + { + foreach ($this->getXmlNodeChildren($outputXmlNode) as $outputTypeXmlNode) { + switch ($this->getXmlNodeName($outputTypeXmlNode)) + { + case "plot" : + $plotNode = $outputNode->getChildInstanceByName("plot", TRUE); + $node = new RequestOutputPlotPanelNodeClass(); + $plotNode->addChild($node); + $node->loadFromNode($outputTypeXmlNode); + break; + } + } + } + } } diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestNodeClass.php index d59943c..6b94313 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestNodeClass.php @@ -1,5 +1,8 @@ <?php +require_once "RequestTimesNodeClass.php"; +require_once "RequestOutputsNodeClass.php"; + define ("REQUESTPARAM_NAME", "param"); define ("REQUESTPARAM_ID", "id"); @@ -24,6 +27,11 @@ class RequestParamNodeClass extends NodeClass { return $this->getAttribute(REQUESTPARAM_ID); } + + public function loadFromNode($xmlNode) + { + $this->setId($this->getXmlNodeAttribute($xmlNode, REQUESTPARAM_ID)); + } } define ("REQUESTPARAMS_NAME", "params"); @@ -40,20 +48,29 @@ class RequestParamsNodeClass extends NodeClass parent::__construct(REQUESTPARAMS_NAME); } - public function addParam($id) + public function addParam($id = "") { foreach ($this->getChildrenByName(REQUESTPARAM_NAME) as $paramNode) if ($paramNode->getId() == $id) - return; + return $paramNode; $param = new RequestParamNodeClass(); $param->setId($id); $this->addChild($param); + + return $param; } public function getParamList() { return $this->getChildrenByName(REQUESTPARAM_NAME); } + + public function loadFromNode($xmlNode) + { + foreach ($this->getXmlNodeChildrenByTagName($xmlNode, REQUESTPARAM_NAME) as $requestParamXmlNode) { + $this->addParam()->loadFromNode($requestParamXmlNode); + } + } } define ("REQUEST_NAME", "request"); @@ -100,6 +117,22 @@ class RequestNodeClass extends NodeClass { return $this->realIndex; } + + public function loadFromNode($xmlNode) + { + $paramsXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTPARAMS_NAME); + if (isset($paramsXmlNode)) + $this->getParamsNode()->loadFromNode($paramsXmlNode); + + $timesXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTTIMES_NAME); + if (isset($timesXmlNode)) + $this->getTimesNode()->loadFromNode($timesXmlNode); + + $outputsXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTS_NAME); + if (isset($outputsXmlNode)) + $this->getOutputsNode()->loadFromNode($outputsXmlNode); + + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputDataMiningNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputDataMiningNodeClass.php index 3974ea2..70d0332 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputDataMiningNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputDataMiningNodeClass.php @@ -1,5 +1,7 @@ <?php +require_once "RequestOutputPostProcessingNodeClass.php"; + define ("REQUESTOUTPUTDATAMINING_NAME", "dataMining"); define ("REQUESTOUTPUTDATAMINING_TIMEFORMAT", "timeFormat"); define ("REQUESTOUTPUTDATAMINING_FILEFORMAT", "fileFormat"); @@ -46,6 +48,11 @@ class RequestOutputDataMiningParamNodeClass extends NodeClass { return $this->getAttribute(REQUESTOUTPUTDATAMININGPARAM_ID); } + + public function loadFromNode($xmlNode) + { + $this->setId($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTDATAMININGPARAM_ID)); + } } /** @@ -84,7 +91,7 @@ class RequestOutputDataMiningNodeClass extends NodeClass $node->setValue($fileName); } - public function setParam($id) + public function setParam($id = "") { $node = $this->getFirstChildByName(REQUESTOUTPUTDATAMININGPARAM_NAME); if (!$node) @@ -93,9 +100,10 @@ class RequestOutputDataMiningNodeClass extends NodeClass $this->addChild($node); } $node->setId($id); + return $node; } - public function addPostProcessing($process) + public function addPostProcessing($process = "") { $node = $this->getChildInstanceByName(REQUESTOUTPUTPOSTPROCESSING_NAME); if ($node == NULL) @@ -104,7 +112,9 @@ class RequestOutputDataMiningNodeClass extends NodeClass $this->addChild($node); } - $node->addPostProcessing($process); + if ($process != "") + $node->addPostProcessing($process); + return $node; } public function isPostProcessing($process) @@ -116,6 +126,33 @@ class RequestOutputDataMiningNodeClass extends NodeClass return $node->isPostProcessing($process); } + + public function loadFromNode($xmlNode) + { + $timeformatXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTDATAMINING_TIMEFORMAT); + if (isset($timeformatXmlNode)) + $this->setTimeFormat($this->getXmlNodeValue($timeformatXmlNode)); + + $fileformatXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTDATAMINING_FILEFORMAT); + if (isset($fileformatXmlNode)) + $this->setFileFormat($this->getXmlNodeValue($fileformatXmlNode)); + + $structureXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTDATAMINING_STRUCTURE); + if (isset($structureXmlNode)) + $this->setStructure($this->getXmlNodeValue($structureXmlNode)); + + $filenameXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTDATAMINING_FILENAME); + if (isset($filenameXmlNode)) + $this->setFileName($this->getXmlNodeValue($filenameXmlNode)); + + foreach ($this->getXmlNodeChildrenByTagName($xmlNode, REQUESTOUTPUTDATAMININGPARAM_NAME) as $paramXmlNode) { + $this->setParam()->loadFromNode($paramXmlNode); + } + + $postProcessingXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPOSTPROCESSING_NAME); + if (isset($postProcessingXmlNode)) + $this->addPostProcessing()->loadFromNode($postProcessingXmlNode); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputDownloadNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputDownloadNodeClass.php index f13c656..8481404 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputDownloadNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputDownloadNodeClass.php @@ -59,46 +59,71 @@ class RequestOutputDownloadParamNodeClass extends NodeClass return $this->getAttribute(REQUESTOUTPUTDOWNLOADPARAM_ID); } - public function addIndex($index) + public function addIndex($index = "") { if ($this->indexExist($index)) - return; + return $this->getIndex($index); $node = new NodeClass(REQUESTOUTPUTDOWNLOADPARAM_INDEX); $node->setValue($index); $this->addChild($node); + return $node; } - public function indexExist($index) + public function getIndex($index) { $indexNodes = $this->getChildrenByName(REQUESTOUTPUTDOWNLOADPARAM_INDEX); - + foreach ($indexNodes as $indexNode) - if ($indexNode->getValue() == $index) - return true; - - return false; + if ($indexNode->getValue() == $index) + return $indexNode; + + return NULL; + } + + public function indexExist($index) + { + return ($this->getIndex($index) != NULL); } public function addCalibInfo($calibInfo) { if ($this->calibInfoExist($calibInfo)) - return; + return $this->getCalibInfo($calibInfo); $node = new NodeClass(REQUESTOUTPUTDOWNLOADPARAM_CALIB); $node->setValue($calibInfo); $this->addChild($node); + return $node; } - public function calibInfoExist($calibInfo) + public function getCalibInfo($calibInfo) { $calibNodes = $this->getChildrenByName(REQUESTOUTPUTDOWNLOADPARAM_CALIB); - + foreach ($calibNodes as $calibNode) if ($calibNode->getValue() == $calibInfo) - return true; - - return false; + return $calibNode; + + return NULL; + } + + public function calibInfoExist($calibInfo) + { + return ($this->getCalibInfo($calibInfo) != NULL); + } + + public function loadFromNode($xmlNode) + { + $this->setId($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTDOWNLOADPARAM_ID)); + + foreach ($this->getXmlNodeChildrenByTagName($xmlNode, REQUESTOUTPUTDOWNLOADPARAM_INDEX) as $indexXmlNode) { + $this->addIndex($this->getXmlNodeValue($indexXmlNode)); + } + + foreach ($this->getXmlNodeChildrenByTagName($xmlNode, REQUESTOUTPUTDOWNLOADPARAM_CALIB) as $calibInfoXmlNode) { + $this->addCalibInfo($this->getXmlNodeValue($calibInfoXmlNode)); + } } } @@ -184,7 +209,7 @@ class RequestOutputDownloadNodeClass extends NodeClass return $this->getAttribute(REQUESTOUTPUTDOWNLOAD_PRECISION); } - public function addParam($id, $indexes, $calib_infos) + public function addParam($id = "", $indexes = NULL, $calib_infos = NULL) { $node = new RequestOutputDownloadParamNodeClass(); $node->setId($id); @@ -199,6 +224,7 @@ class RequestOutputDownloadNodeClass extends NodeClass $node->addCalibInfo($calib_infos); } $this->addChild($node); + return $node; } public function getParam($id) @@ -211,7 +237,7 @@ class RequestOutputDownloadNodeClass extends NodeClass return NULL; } - public function addPostProcessing($process) + public function addPostProcessing($process = "") { $node = $this->getChildInstanceByName(REQUESTOUTPUTPOSTPROCESSING_NAME); if ($node == NULL) @@ -220,7 +246,10 @@ class RequestOutputDownloadNodeClass extends NodeClass $this->addChild($node); } - $node->addPostProcessing($process); + if ($process != "") + $node->addPostProcessing($process); + + return $node; } public function isPostProcessing($process) @@ -232,6 +261,37 @@ class RequestOutputDownloadNodeClass extends NodeClass return $node->isPostProcessing($process); } + + public function loadFromNode($xmlNode) + { + $timeformatXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTDOWNLOAD_TIMEFORMAT); + if (isset($timeformatXmlNode)) + $this->setTimeFormat($this->getXmlNodeValue($timeformatXmlNode)); + + $fileformatXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTDOWNLOAD_FILEFORMAT); + if (isset($fileformatXmlNode)) + $this->FileFormat($this->getXmlNodeValue($fileformatXmlNode)); + + $filenameXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTDOWNLOAD_FILENAME); + if (isset($filenameXmlNode)) + $this->setFileName($this->getXmlNodeValue($filenameXmlNode)); + + $structureXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTDOWNLOAD_STRUCTURE); + if (isset($structureXmlNode)) + $this->setStructure($this->getXmlNodeValue($structureXmlNode)); + + $precisionXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTDOWNLOAD_PRECISION); + if (isset($precisionXmlNode)) + $this->setPrecision($this->getXmlNodeValue($precisionXmlNode)); + + $paramXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTDOWNLOADPARAM_NAME); + if (isset($paramXmlNode)) + $this->addParam()->loadFromNode($paramXmlNode); + + $postProcessingXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPOSTPROCESSING_NAME); + if (isset($postProcessingXmlNode)) + $this->addPostProcessing()->loadFromNode($postProcessingXmlNode); + } } ?> diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputDownloadPostProcessingNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputDownloadPostProcessingNodeClass.php index 385a9bc..8ca27ba 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputDownloadPostProcessingNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputDownloadPostProcessingNodeClass.php @@ -34,6 +34,13 @@ class RequestOutputDownloadPostProcessingNodeClass extends NodeClass return false; return ($this->getChildInstanceByName($type) != NULL); } + + public function loadFromNode($xmlNode) + { + foreach ($this->getXmlNodeChildren($xmlNode) as $postProcessingXmlNode) { + $this->addPostProcessing($this->getXmlNodeName($postProcessingXmlNode)); + } + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotAdditionalObjectsNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotAdditionalObjectsNodeClass.php index 08adc0b..eebac86 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotAdditionalObjectsNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotAdditionalObjectsNodeClass.php @@ -1,5 +1,8 @@ <?php +require_once "RequestOutputPlotTextNodeClass.php"; +require_once "RequestOutputPlotCurveObjectNodeClass.php"; + define ("REQUESTOUTPUTPLOTADDITIONALOBJECTS_NAME", "additionalObjects"); /** @@ -27,6 +30,22 @@ class RequestOutputPlotAdditionalObjectsNodeClass extends NodeClass $this->addChild($node); return $node; } + + public function getCurveObjects() + { + return $this->getChildrenByName(REQUESTOUTPUTPLOTCURVEOBJECT_NAME); + } + + public function loadFromNode($xmlNode) + { + foreach ($this->getXmlNodeChildrenByTagName($xmlNode, REQUESTOUTPUTPLOTTEXT_NAME) as $plotTextXmlNode) { + $this->addTextObject()->loadFromNode($plotTextXmlNode); + } + + foreach ($this->getXmlNodeChildrenByTagName($xmlNode, REQUESTOUTPUTPLOTCURVEOBJECT_NAME) as $curveXmlNode) { + $this->addCurveObject()->loadFromNode($curveXmlNode); + } + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotAxesNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotAxesNodeClass.php index 99bac2b..e32be47 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotAxesNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotAxesNodeClass.php @@ -36,7 +36,7 @@ class RequestOutputPlotAxesNodeClass extends NodeClass $node = $this->getChildInstanceByName(REQUESTOUTPUTPLOTAXES_ZAXIS, true); } - public function addDigitalAxis($axisType,$id) + public function addDigitalAxis($axisType,$id = "") { if (($axisType != RequestOutputPlotAxisTypeEnum::XAXIS) && ($axisType != RequestOutputPlotAxisTypeEnum::YAXIS)) return NULL; @@ -101,6 +101,41 @@ class RequestOutputPlotAxesNodeClass extends NodeClass return $colorAxisNode; } + + public function loadFromNode($xmlNode) + { + $xaxisXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTAXES_XAXIS); + if (isset($xaxisXmlNode)) + { + $timeXmlNode = $this->getXmlNodeChildByTagName($xaxisXmlNode, REQUESTOUTPUTPLOTTIMEAXIS_NAME); + if (isset($timeXmlNode)) + $this->getTimeAxis()->loadFromNode($timeXmlNode); + + $epochXmlNode = $this->getXmlNodeChildByTagName($xaxisXmlNode, REQUESTOUTPUTPLOTEPOCHAXIS_NAME); + if (isset($epochXmlNode)) + $this->getEpochAxis()->loadFromNode($epochXmlNode); + + foreach ($this->getXmlNodeChildrenByTagName($xaxisXmlNode, REQUESTOUTPUTPLOTDIGITALAXIS_NAME) as $xXmlNode) { + $this->addDigitalAxis(RequestOutputPlotAxisTypeEnum::XAXIS)->loadFromNode($xXmlNode); + } + } + + $yaxisXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTAXES_YAXIS); + if (isset($yaxisXmlNode)) + { + foreach ($this->getXmlNodeChildrenByTagName($yaxisXmlNode, REQUESTOUTPUTPLOTDIGITALAXIS_NAME) as $yXmlNode) { + $this->addDigitalAxis(RequestOutputPlotAxisTypeEnum::YAXIS)->loadFromNode($yXmlNode); + } + } + + $zaxisXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTAXES_ZAXIS); + if (isset($zaxisXmlNode)) + { + $colorXmlNode = $this->getXmlNodeChildByTagName($xaxisXmlNode, REQUESTOUTPUTPLOTCOLORAXIS_NAME); + if (isset($colorXmlNode)) + $this->getColorAxis()->loadFromNode($colorXmlNode); + } + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotAxisElementNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotAxisElementNodeClass.php index b4ba789..e75a34c 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotAxisElementNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotAxisElementNodeClass.php @@ -1,5 +1,7 @@ <?php +require_once "RequestOutputPlotConstantNodeClass.php"; + define ("REQUESTOUTPUTPLOTAXISELEMENT_POSITION", "position"); define ("REQUESTOUTPUTPLOTAXISELEMENT_REVERSE", "reverse"); define ("REQUESTOUTPUTPLOTAXISELEMENT_VISIBLE", "visible"); @@ -79,6 +81,12 @@ class RequestOutputPlotAxisElementRangeNodeClass extends NodeClass { return $this->getAttribute(REQUESTOUTPUTPLOTAXISELEMENTRANGE_EXTEND); } + + public function loadFromNode($xmlNode) + { + $this->setMinMax($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTAXISELEMENTRANGE_MIN), $this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTAXISELEMENTRANGE_MAX)); + $this->setExtend($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTAXISELEMENTRANGE_EXTEND)); + } } /** @@ -122,6 +130,13 @@ class RequestOutputPlotAxisElementTickClass extends NodeClass { return $this->getAttribute(REQUESTOUTPUTPLOTAXISELEMENTTICK_MAJORGRID); } + + public function loadFromNode($xmlNode) + { + $this->setPosition($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTAXISELEMENTTICK_POSITION)); + $this->setMinorGrid($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTAXISELEMENTTICK_MINORGRID)); + $this->setMajorGrid($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTAXISELEMENTTICK_MAJORGRID)); + } } /** @@ -145,6 +160,12 @@ class RequestOutputPlotAxisElementLegendNodeClass extends RequestOutputPlotLabel { return $this->getAttribute(REQUESTOUTPUTPLOTAXISELEMENTLEGEND_TEXT); } + + public function loadFromNode($xmlNode) + { + $this->setText($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTAXISELEMENTLEGEND_TEXT)); + parent::loadFromNode($xmlNode); + } } /** @@ -276,6 +297,34 @@ class RequestOutputPlotAxisElementNodeClass extends NodeClass { return $this->getAttribute(REQUESTOUTPUTPLOTAXISELEMENT_TICKMARKS); } + + public function loadFromNode($xmlNode) + { + $rangeXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTAXISELEMENTRANGE_NAME); + if (isset($rangeXmlNode)) + $this->getRange()->loadFromNode($rangeXmlNode); + + $tickXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTAXISELEMENTTICK_NAME); + if (isset($tickXmlNode)) + $this->getTick()->loadFromNode($tickXmlNode); + + $legendXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTAXISELEMENTLEGEND_NAME); + if (isset($legendXmlNode)) + $this->getLegend()->loadFromNode($legendXmlNode); + + foreach ($this->getXmlNodeChildrenByTagName($xmlNode, REQUESTOUTPUTPLOTCONSTANT_NAME) as $constantXmlNode) { + $this->addConstant()->loadFromNode($clbXmlNode); + } + + $this->setPosition($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTAXISELEMENT_POSITION)); + $this->setThickness($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTAXISELEMENT_THICKNESS)); + $this->setColor($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTAXISELEMENT_COLOR)); + $this->setReverse($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTAXISELEMENT_REVERSE)); + $this->setVisible($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTAXISELEMENT_VISIBLE)); + $this->setScale($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTAXISELEMENT_SCALE)); + $this->setShowLegend($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTAXISELEMENT_SHOWLEGEND)); + $this->setShowTickMarks($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTAXISELEMENT_TICKMARKS)); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotBaseSerieNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotBaseSerieNodeClass.php index 5538081..6980617 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotBaseSerieNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotBaseSerieNodeClass.php @@ -1,5 +1,10 @@ <?php +require_once "RequestOutputPlotLineNodeClass.php"; +require_once "RequestOutputPlotSymbolNodeClass.php"; +require_once "RequestOutputPlotSerieTimeTicksNodeClass.php"; +require_once "RequestOutputPlotSerieIntervalTicksNodeClass.php"; + define ("REQUESTOUTPUTPLOTBASESERIE_YAXIS", "yAxis"); define ("REQUESTOUTPUTPLOTBASESERIE_XAXIS", "xAxis"); define ("REQUESTOUTPUTPLOTBASESERIE_COLORSERIEID", "colorSerieId"); @@ -73,6 +78,12 @@ class RequestOutputPlotBaseSerieNodeClass extends NodeClass return $this->getAttribute(REQUESTOUTPUTPLOTBASESERIE_MAX); } + public function isLineDefined() + { + $node = $this->getFirstChildByName(REQUESTOUTPUTPLOTBASESERIE_LINE); + return isset($node); + } + public function getLine() { $node = $this->getFirstChildByName(REQUESTOUTPUTPLOTBASESERIE_LINE); @@ -86,6 +97,12 @@ class RequestOutputPlotBaseSerieNodeClass extends NodeClass return $node; } + public function isSymbolDefined() + { + $node = $this->getFirstChildByName(REQUESTOUTPUTPLOTBASESERIE_SYMBOL); + return isset($node); + } + public function getSymbol() { $node = $this->getFirstChildByName(REQUESTOUTPUTPLOTBASESERIE_SYMBOL); @@ -99,6 +116,12 @@ class RequestOutputPlotBaseSerieNodeClass extends NodeClass return $node; } + public function isTimeTicksDefined() + { + $node = $this->getFirstChildByName(REQUESTOUTPUTPLOTBASESERIE_TIMETICKS); + return isset($node); + } + public function getTimeTicks() { $node = $this->getFirstChildByName(REQUESTOUTPUTPLOTBASESERIE_TIMETICKS); @@ -112,6 +135,12 @@ class RequestOutputPlotBaseSerieNodeClass extends NodeClass return $node; } + public function isIntervalTicksDefined() + { + $node = $this->getFirstChildByName(REQUESTOUTPUTPLOTBASESERIE_INTERVALTICKS); + return isset($node); + } + public function getIntervalTicks() { $node = $this->getFirstChildByName(REQUESTOUTPUTPLOTBASESERIE_INTERVALTICKS); @@ -134,6 +163,33 @@ class RequestOutputPlotBaseSerieNodeClass extends NodeClass { return $this->getAttribute(REQUESTOUTPUTPLOTBASESERIE_ID); } + + public function loadFromNode($xmlNode) + { + $this->setYAxisId($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTBASESERIE_YAXIS)); + $this->setXAxisId($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTBASESERIE_XAXIS)); + $this->setColorSerieId($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTBASESERIE_COLORSERIEID)); + $this->setMin($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTBASESERIE_MIN)); + $this->setMax($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTBASESERIE_MAX)); + + $lineXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTBASESERIE_LINE); + if (isset($lineXmlNode)) + $this->getLine()->loadFromNode($lineXmlNode); + + $symbolXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTBASESERIE_SYMBOL); + if (isset($symbolXmlNode)) { + $this->getSymbol()->loadFromNode($symbolXmlNode); + } + $timeTicksXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTBASESERIE_TIMETICKS); + if (isset($timeTicksXmlNode)) + $this->getTimeTicks()->loadFromNode($timeTicksXmlNode); + + $intervalTicksXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTBASESERIE_INTERVALTICKS); + if (isset($intervalTicksXmlNode)) + $this->getIntervalTicks()->loadFromNode($intervalTicksXmlNode); + + $this->setId($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTBASESERIE_ID)); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotColorAxisNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotColorAxisNodeClass.php index 63fcfd9..dc3609b 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotColorAxisNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotColorAxisNodeClass.php @@ -46,6 +46,14 @@ class RequestOutputPlotColorAxisNodeClass extends RequestOutputPlotAxisElementNo { return $this->getAttribute(REQUESTOUTPUTPLOTCOLORAXIS_MAXVALCOLOR); } + + public function loadFromNode($xmlNode) + { + $this->setColorMapIndex($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTCOLORAXIS_MAPINDEX)); + $this->setMinValColor($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTCOLORAXIS_MINVALCOLOR)); + $this->setMaxValColor($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTCOLORAXIS_MAXVALCOLOR)); + parent::loadFromNode($xmlNode); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotConstantNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotConstantNodeClass.php index 2113aed..f015ff9 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotConstantNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotConstantNodeClass.php @@ -35,6 +35,13 @@ class RequestOutputPlotConstantNodeClass extends RequestOutputPlotCurveNodeClass { return $this->getAttribute(REQUESTOUTPUTPLOTCONSTANT_ID); } + + public function loadFromNode($xmlNode) + { + $this->setConstantValue($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTCONSTANT_VALUE)); + $this->setId($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTCONSTANT_ID)); + parent::loadFromNode($xmlNode); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotCurveNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotCurveNodeClass.php index 05da42e..afcae48 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotCurveNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotCurveNodeClass.php @@ -53,6 +53,13 @@ class RequestOutputPlotCurveNodeClass extends NodeClass { return $this->getAttribute(REQUESTOUTPUTPLOTCURVE_COLOR); } + + public function loadFromNode($xmlNode) + { + $this->setStyle($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTCURVE_STYLE)); + $this->setWidth($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTCURVE_WIDTH)); + $this->setColor($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTCURVE_COLOR)); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotCurveObjectNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotCurveObjectNodeClass.php index 0fd0c10..91ec00c 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotCurveObjectNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotCurveObjectNodeClass.php @@ -57,6 +57,18 @@ class RequestOutputPlotCurveObjectFunctionNodeClass extends NodeClass $attributesNode->addChild($node); return $node; } + + public function loadFromNode($xmlNode) + { + $this->setFunctionName($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTCURVEOBJECTFUNCTION_FUNCTIONNAME)); + + $attributesXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTCURVEOBJECTFUNCTION_ATTRIBUTES); + if (isset($attributesXmlNode)) { + foreach ($this->getXmlNodeChildrenByTagName($attributesXmlNode, REQUESTOUTPUTPLOTCURVEOBJECTFUNCTION_ATTRIBUTE) as $attributeXmlNode) { + $this->addAttribute($this->getXmlNodeAttribute($attributeXmlNode, REQUESTOUTPUTPLOTCURVEOBJECTFUNCTION_ATTRIBUTENAME),$this->getXmlNodeAttribute($attributeXmlNode, REQUESTOUTPUTPLOTCURVEOBJECTFUNCTION_ATTRIBUTEVALUE)); + } + } + } } /** @@ -81,6 +93,12 @@ class RequestOutputPlotCurveObjectNodeClass extends RequestOutputPlotCurveNodeCl return $this->getAttribute(REQUESTOUTPUTPLOTCURVEOBJECT_SERIEID); } + public function isFunctionDefined() + { + $node = $this->getFirstChildByName(REQUESTOUTPUTPLOTCURVEOBJECTFUNCTION_NAME); + return isset($node); + } + public function getFunction() { $node = $this->getFirstChildByName(REQUESTOUTPUTPLOTCURVEOBJECTFUNCTION_NAME); @@ -93,6 +111,16 @@ class RequestOutputPlotCurveObjectNodeClass extends RequestOutputPlotCurveNodeCl return $node; } + + public function loadFromNode($xmlNode) + { + $this->setSerieId($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTCURVEOBJECT_SERIEID)); + + $functionXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTCURVEOBJECTFUNCTION_NAME); + if (isset($functionXmlNode)) + $this->getFunction()->loadFromNode($functionXmlNode); + parent::loadFromNode($xmlNode); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotDigitalAxisNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotDigitalAxisNodeClass.php index 84fdef0..32ac5df 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotDigitalAxisNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotDigitalAxisNodeClass.php @@ -26,6 +26,12 @@ class RequestOutputPlotDigitalAxisNodeClass extends RequestOutputPlotAxisElement { return $this->getAttribute(REQUESTOUTPUTPLOTDIGITALAXIS_ID); } + + public function loadFromNode($xmlNode) + { + $this->setId($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTDIGITALAXIS_ID)); + parent::loadFromNode($xmlNode); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotElementEpochNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotElementEpochNodeClass.php index 65cd8db..545663c 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotElementEpochNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotElementEpochNodeClass.php @@ -50,6 +50,12 @@ class RequestOutputPlotElementEpochNodeClass extends RequestOutputPlotElementNod { return $this->getAttribute(REQUESTOUTPUTPLOTELEMENTEPOCH_CENTERTIMEID); } + + public function loadFromNode($xmlNode) + { + $this->setCenterTimeId($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTELEMENTEPOCH_CENTERTIMEID)); + parent::loadFromNode($xmlNode); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotElementInstantNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotElementInstantNodeClass.php index f139263..163e26c 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotElementInstantNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotElementInstantNodeClass.php @@ -50,6 +50,11 @@ class RequestOutputPlotElementInstantNodeClass extends RequestOutputPlotElementN { return $this->getAttribute(REQUESTOUTPUTPLOTELEMENTINSTANT_TIME); } + + public function loadFromNode($xmlNode) + { + parent::loadFromNode($xmlNode); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotElementNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotElementNodeClass.php index e50dc0d..9afcd5f 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotElementNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotElementNodeClass.php @@ -3,8 +3,8 @@ require_once("RequestOutputPlotLegendsNodeClass.php"); require_once("RequestOutputPlotParamsNodeClass.php"); require_once("RequestOutputPlotAxesNodeClass.php"); -//require_once("RequestOutputPlotAdditionalObjectsNodeClass.php"); -//require_once("RequestOutputPlotFillsNodeClass.php"); +require_once("RequestOutputPlotAdditionalObjectsNodeClass.php"); +require_once("RequestOutputPlotFillsNodeClass.php"); define ("REQUESTOUTPUTPLOTLEGENDS_NAME", "legends"); @@ -81,6 +81,29 @@ class RequestOutputPlotElementNodeClass extends NodeClass $node = $this->getChildInstanceByName(REQUESTOUTPUTPLOTFILLS_NAME); return $node; } + + public function loadFromNode($xmlNode) + { + $legendXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTLEGENDS_NAME); + if (isset($legendXmlNode)) + $this->getLegends()->loadFromNode($legendXmlNode); + + $paramsXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTPARAMS_NAME); + if (isset($paramsXmlNode)) + $this->getParams()->loadFromNode($paramsXmlNode); + + $axesXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTAXES_NAME); + if (isset($axesXmlNode)) + $this->getAxes()->loadFromNode($axesXmlNode); + + $additionalObjXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTADDITIONALOBJECTS_NAME); + if (isset($additionalObjXmlNode)) + $this->getAdditionalObjects()->loadFromNode($additionalObjXmlNode); + + $fillsXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTFILLS_NAME); + if (isset($fillsXmlNode)) + $this->getFills()->loadFromNode($fillsXmlNode); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotElementStatusNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotElementStatusNodeClass.php index 09545e1..8294ecd 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotElementStatusNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotElementStatusNodeClass.php @@ -53,6 +53,13 @@ class RequestOutputPlotElementStatusNodeClass extends RequestOutputPlotElementNo { return $this->getAttribute(REQUESTOUTPUTPLOTELEMENTSTATUS_COLORMAP); } + + public function loadFromNode($xmlNode) + { + $this->setPosition($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTELEMENTSTATUS_POSITION)); + $this->setColorMap($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTELEMENTSTATUS_COLORMAP)); + parent::loadFromNode($xmlNode); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotElementTickNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotElementTickNodeClass.php index b974b10..ed3023a 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotElementTickNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotElementTickNodeClass.php @@ -36,6 +36,12 @@ class RequestOutputPlotElementTickNodeClass extends RequestOutputPlotElementNode { return $this->getAttribute(REQUESTOUTPUTPLOTELEMENTTICK_FORMAT); } + + public function loadFromNode($xmlNode) + { + $this->setFormat($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTELEMENTTICK_FORMAT)); + parent::loadFromNode($xmlNode); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotElementTimeNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotElementTimeNodeClass.php index 91b5623..ba61879 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotElementTimeNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotElementTimeNodeClass.php @@ -39,6 +39,11 @@ class RequestOutputPlotElementTimeNodeClass extends RequestOutputPlotElementNode { return $this->getAxes()->getColorAxis(); } + + public function loadFromNode($xmlNode) + { + parent::loadFromNode($xmlNode); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotElementXYNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotElementXYNodeClass.php index ce75f91..01f8622 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotElementXYNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotElementXYNodeClass.php @@ -56,6 +56,12 @@ class RequestOutputPlotElementXYNodeClass extends RequestOutputPlotElementNodeCl { return $this->getAxes()->getColorAxis(); } + + public function loadFromNode($xmlNode) + { + $this->setIsIsotropic($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTELEMENTXY_ISOTROPIC) == "true"); + parent::loadFromNode($xmlNode); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotEpochAxisNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotEpochAxisNodeClass.php index 48987b0..0895634 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotEpochAxisNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotEpochAxisNodeClass.php @@ -26,6 +26,12 @@ class RequestOutputPlotEpochAxisNodeClass extends RequestOutputPlotAxisElementNo { return $this->getAttribute(REQUESTOUTPUTPLOTEPOCHAXIS_NORMALIZED); } + + public function loadFromNode($xmlNode) + { + $this->setNormalized($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTEPOCHAXIS_NORMALIZED)); + parent::loadFromNode($xmlNode); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotFillNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotFillNodeClass.php index 665bbc0..ec90142 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotFillNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotFillNodeClass.php @@ -34,6 +34,12 @@ class RequestOutputPlotFillNodeClass extends NodeClass { return $this->getAttribute(REQUESTOUTPUTPLOTFILL_LESSCOLOR); } + + public function loadFromNode($xmlNode) + { + $this->setGreaterColor($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTFILL_GREATERCOLOR)); + $this->setLessColor($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTFILL_LESSCOLOR)); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotFillSerieConstantNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotFillSerieConstantNodeClass.php index 4b8481b..fa31484 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotFillSerieConstantNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotFillSerieConstantNodeClass.php @@ -35,6 +35,13 @@ class RequestOutputPlotFillSerieConstantNodeClass extends RequestOutputPlotFillN { return $this->getAttribute(REQUESTOUTPUTPLOTFILLSERIECONSTANT_CONSTANTID); } + + public function loadFromNode($xmlNode) + { + $this->setSerieId($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTFILLSERIECONSTANT_SERIEID)); + $this->setConstantId($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTFILLSERIECONSTANT_CONSTANTID)); + parent::loadFromNode($xmlNode); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotFillSerieSerieNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotFillSerieSerieNodeClass.php index 10bea6e..703ed41 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotFillSerieSerieNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotFillSerieSerieNodeClass.php @@ -35,6 +35,13 @@ class RequestOutputPlotFillSerieSerieNodeClass extends RequestOutputPlotFillNode { return $this->getAttribute(REQUESTOUTPUTPLOTFILLSERIESERIE_SECONDSERIEID); } + + public function loadFromNode($xmlNode) + { + $this->setFirstSerieId($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTFILLSERIESERIE_FIRSTSERIEID)); + $this->setSecondSerieId($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTFILLSERIESERIE_SECONDSERIEID)); + parent::loadFromNode($xmlNode); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotFillsNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotFillsNodeClass.php index e8a8340..b20aad4 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotFillsNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotFillsNodeClass.php @@ -1,5 +1,8 @@ <?php +require_once "RequestOutputPlotFillSerieConstantNodeClass.php"; +require_once "RequestOutputPlotFillSerieSerieNodeClass.php"; + define ("REQUESTOUTPUTPLOTFILLS_NAME", "fills"); abstract class RequestOutputPlotFillTypeEnum @@ -36,6 +39,17 @@ class RequestOutputPlotFillsNodeClass extends NodeClass $this->addChild($node); return $node; } + + public function loadFromNode($xmlNode) + { + foreach ($this->getXmlNodeChildrenByTagName($xmlNode, REQUESTOUTPUTPLOTFILLSERIECONSTANT_NAME) as $fillserieconstantXmlNode) { + $this->addFill(RequestOutputPlotFillTypeEnum::SERIECONSTANT)->loadFromNode($fillserieconstantXmlNode); + } + + foreach ($this->getXmlNodeChildrenByTagName($xmlNode, REQUESTOUTPUTPLOTFILLSERIESERIE_NAME) as $fillserieserieXmlNode) { + $this->addFill(RequestOutputPlotFillTypeEnum::SERIESERIE)->loadFromNode($fillserieserieXmlNode); + } + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotFontNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotFontNodeClass.php index 4c06675..9de26c4 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotFontNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotFontNodeClass.php @@ -72,6 +72,14 @@ class RequestOutputPlotFontNodeClass extends NodeClass { return $this->getAttribute(REQUESTOUTPUTPLOTFONT_WEIGHT); } + + public function loadFromNode($xmlNode) + { + $this->setFontName($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTFONT_NAME)); + $this->setSize($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTFONT_SIZE)); + $this->setStyle($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTFONT_STYLE)); + $this->setWeight($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTFONT_WEIGHT)); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotInstantSerieNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotInstantSerieNodeClass.php index 5ae6c74..b79051f 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotInstantSerieNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotInstantSerieNodeClass.php @@ -1,5 +1,8 @@ <?php +require_once "RequestOutputPlotLineNodeClass.php"; +require_once "RequestOutputPlotSymbolNodeClass.php"; + define ("REQUESTOUTPUTPLOTINSTANTSERIE_NAME", "iserie"); define ("REQUESTOUTPUTPLOTINSTANTSERIE_YAXIS", "yAxis"); @@ -75,6 +78,21 @@ class RequestOutputPlotInstantSerieNodeClass extends NodeClass return $node; } + + public function loadFromNode($xmlNode) + { + $this->setYAxisId($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTINSTANTSERIE_YAXIS)); + $this->setXAxisId($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTINSTANTSERIE_XAXIS)); + $this->setTableOnXAxis($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTINSTANTSERIE_TABLEONXAXIS)); + + $lineXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTINSTANTSERIE_LINE); + if (isset($lineXmlNode)) + $this->getLine()->loadFromNode($lineXmlNode); + + $symbolXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTINSTANTSERIE_SYMBOL); + if (isset($symbolXmlNode)) + $this->getSymbol()->loadFromNode($symbolXmlNode); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotLabelNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotLabelNodeClass.php index f71fd7c..9874a4b 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotLabelNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotLabelNodeClass.php @@ -67,6 +67,15 @@ class RequestOutputPlotLabelNodeClass extends NodeClass { return $this->getAttribute(REQUESTOUTPUTPLOTLABEL_COLORMAPINDEX); } + + public function loadFromNode($xmlNode) + { + $this->setFontName($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTLABEL_FONTNAME)); + $this->setFontSize($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTLABEL_FONTSIZE)); + $this->setFontStyle($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTLABEL_STYLE)); + $this->setColor($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTLABEL_COLOR)); + $this->setColorMapIndex($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTLABEL_COLORMAPINDEX)); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotLayoutNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotLayoutNodeClass.php index dee0c52..ccfd419 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotLayoutNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotLayoutNodeClass.php @@ -75,6 +75,15 @@ class RequestOutputPlotLayoutNodeClass extends NodeClass { return $this->getAttribute(REQUESTOUTPUTPLOTLAYOUT_EXPAND); } + + public function loadFromNode($xmlNode) + { + $this->setType($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTLAYOUT_TYPE)); + $this->setPanelHeight($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTLAYOUT_PANELHEIGHT)); + $this->setPanelSpacing($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTLAYOUT_PANELSPACING)); + $this->setFirstPanelHeightFactor($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTLAYOUT_FIRSTPANELHEIGHTFACTOR)); + $this->setExpand($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTLAYOUT_EXPAND)); + } } ?> diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotLegendsNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotLegendsNodeClass.php index 0da5e74..7858da1 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotLegendsNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotLegendsNodeClass.php @@ -33,6 +33,13 @@ class RequestOutputPlotLegendsNodeClass extends NodeClass $this->addChild($node); return $node; } + + public function loadFromNode($xmlNode) + { + foreach ($this->getXmlNodeChildrenByTagName($xmlNode, REQUESTOUTPUTPLOTPARAMSLEGEND_NAME) as $paramsLegendXmlNode) { + $this->addTextLegend()->loadFromNode($paramsLegendXmlNode); + } + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotLineNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotLineNodeClass.php index e341435..34dce12 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotLineNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotLineNodeClass.php @@ -29,6 +29,12 @@ class RequestOutputPlotLineNodeClass extends RequestOutputPlotCurveNodeClass { $this->getAttribute(REQUESTOUTPUTPLOTLINE_TYPE); } + + public function loadFromNode($xmlNode) + { + $this->setType($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTLINE_TYPE)); + parent::loadFromNode($xmlNode); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotMarginsNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotMarginsNodeClass.php index f8acc58..86eb5ec 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotMarginsNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotMarginsNodeClass.php @@ -37,6 +37,12 @@ class RequestOutputPlotMarginsNodeClass extends NodeClass { return $this->getAttribute(REQUESTOUTPUTPLOTMARGINS_VERTIVAL); } + + public function loadFromNode($xmlNode) + { + $this->setHorizontal($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTMARGINS_HORIZONTAL)); + $this->setVertical($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTMARGINS_VERTIVAL)); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotNodeClass.php index adb4274..130184f 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotNodeClass.php @@ -77,7 +77,7 @@ class RequestOutputPlotNodeClass extends NodeClass return $node; } - public function addPostProcessing($process) + public function addPostProcessing($process = "") { $node = $this->getChildInstanceByName(REQUESTOUTPUTPOSTPROCESSING_NAME); if ($node == NULL) @@ -86,7 +86,10 @@ class RequestOutputPlotNodeClass extends NodeClass $this->addChild($node); } - $node->addPostProcessing($process); + if ($process == "") + $node->addPostProcessing($process); + + return $node; } public function isPostProcessing($process) @@ -98,6 +101,27 @@ class RequestOutputPlotNodeClass extends NodeClass return $node->isPostProcessing($process); } + + public function loadFromNode($xmlNode) + { + $structureXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOT_STRUCTURE); + if (isset($structureXmlNode)) + $this->setStructure($this->getXmlNodeValue($structureXmlNode)); + + $this->setWriteContextFile($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOT_WRITECONTEXTFILE)); + + $fileprefixXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOT_FILEPREFIX); + if (isset($fileprefixXmlNode)) + $this->setFilePrefix($this->getXmlNodeValue($fileprefixXmlNode)); + + $pageXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTPAGE_NAME); + if (isset($pageXmlNode)) + $this->getPage()->loadFromNode($pageXmlNode); + + $postprocessingXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPOSTPROCESSING_NAME); + if (isset($postprocessingXmlNode)) + $this->addPostProcessing()->loadFromNode($postprocessingXmlNode); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotOrbitSerieNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotOrbitSerieNodeClass.php index bef4d0a..0e66ab7 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotOrbitSerieNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotOrbitSerieNodeClass.php @@ -35,6 +35,12 @@ class RequestOutputPlotOrbitSerieNodeClass extends RequestOutputPlotBaseSerieNod { return $this->getAttribute(REQUESTOUTPUTPLOTORBITSERIE_PROJECTION); } + + public function loadFromNode($xmlNode) + { + $this->setProjection($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTORBITSERIE_PROJECTION)); + parent::loadFromNode($xmlNode); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotPageNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotPageNodeClass.php index 611f0b0..3e37984 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotPageNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotPageNodeClass.php @@ -223,6 +223,40 @@ class RequestOutputPlotPageNodeClass extends NodeClass { $this->setAttribute(REQUESTOUTPUTPLOTPAGE_DEFAULTXYPLOTXMARGIN, "[".$left.",".$right."]"); } + + public function loadFromNode($xmlNode) + { + $titleXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTPAGE_TITLE); + if (isset($titleXmlNode)) + $this->getTitle()->loadFromNode($titleXmlNode); + + $marginsXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTMARGINS_NAME); + if (isset($marginsXmlNode)) + $this->getMargins()->loadFromNode($marginsXmlNode); + + $fontXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTFONT_NODENAME); + if (isset($fontXmlNode)) + $this->getFont()->loadFromNode($fontXmlNode); + + $layoutXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTLAYOUT_NAME); + if (isset($layoutXmlNode)) + $this->getLayout()->loadFromNode($layoutXmlNode); + + foreach ($this->getXmlNodeChildrenByTagName($xmlNode, REQUESTOUTPUTPLOTPANEL_NAME) as $panelXmlNode) { + $this->addPanel()->loadFromNode($panelXmlNode); + } + + $this->setFormat($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTPAGE_FORMAT)); + $this->setDimension($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTPAGE_DIMENSION)); + $this->setOrientation($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTPAGE_ORIENTATION)); + $this->setMode($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTPAGE_MODE)); + $this->setSuperposeMode($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTPAGE_SUPERPOSEMODE)); + $this->setDefaultTimePlotWidth($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTPAGE_DEFAULTTIMEPLOTWIDTH)); + $this->setDefaultTimePlotHeight($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTPAGE_DEFAULTTIMEPLOTHEIGHT)); + $this->setDefaultXYPlotWidth($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTPAGE_DEFAULTXYPLOTWIDTH)); + $this->setDefaultXYPlotHeight($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTPAGE_DEFAULTXYPLOTHEIGHT)); + $this->setDefaultTimePlotXMargin($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTPAGE_DEFAULTTIMEPLOTXMARGIN)); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotPanelBoundsNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotPanelBoundsNodeClass.php index 985ca76..c5c084f 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotPanelBoundsNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotPanelBoundsNodeClass.php @@ -57,6 +57,14 @@ class RequestOutputPlotPanelBoundsNodeClass extends NodeClass { return $this->getAttribute(REQUESTOUTPUTPLOTPANELBOUNDS_HEIGHT); } + + public function loadFromNode($xmlNode) + { + $this->setX($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTPANELBOUNDS_X)); + $this->setY($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTPANELBOUNDS_Y)); + $this->setWidth($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTPANELBOUNDS_WIDTH)); + $this->setHeight($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTPANELBOUNDS_HEIGHT)); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotPanelNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotPanelNodeClass.php index 989fa9a..294a338 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotPanelNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotPanelNodeClass.php @@ -4,6 +4,8 @@ require_once("RequestOutputPlotElementTimeNodeClass.php"); require_once("RequestOutputPlotElementXYNodeClass.php"); require_once("RequestOutputPlotElementStatusNodeClass.php"); require_once("RequestOutputPlotElementTickNodeClass.php"); +require_once "RequestOutputPlotElementEpochNodeClass.php"; +require_once "RequestOutputPlotElementInstantNodeClass.php"; define ("REQUESTOUTPUTPLOTPANEL_NAME", "panel"); define ("REQUESTOUTPUTPLOTPANEL_TITLE", "title"); @@ -138,6 +140,11 @@ class RequestOutputPlotPanelNodeClass extends NodeClass $this->setAttribute(REQUESTOUTPUTPLOTPANEL_XMARGIN, "[".$left.",".$right."]"); } + public function setXMargin2($margin) + { + $this->setAttribute(REQUESTOUTPUTPLOTPANEL_XMARGIN, $margin); + } + public function setId($id) { $this->setAttribute(REQUESTOUTPUTPLOTPANEL_ID, $id); @@ -148,6 +155,55 @@ class RequestOutputPlotPanelNodeClass extends NodeClass return $this->getAttribute(REQUESTOUTPUTPLOTPANEL_ID); } + public function loadFromNode($xmlNode) + { + $this->setBackgroundColor($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTPANEL_BACKGROUNDCOLOR)); + + $boundsXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTPANELBOUNDS_NAME); + if (isset($boundsXmlNode)) + $this->getBounds()->loadFromNode($boundsXmlNode); + + $boundsXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTFONT_NODENAME); + if (isset($boundsXmlNode)) + $this->getBounds()->loadFromNode($boundsXmlNode); + + $fontXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTFONT_NODENAME); + if (isset($fontXmlNode)) + $this->getFont()->loadFromNode($fontXmlNode); + + $titleXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTPANEL_TITLE); + if (isset($titleXmlNode)) + $this->getTitle()->loadFromNode($titleXmlNode); + + $timePlotXmlNode = $this->getXmlNodeChildByTagName($xmlNode,REQUESTOUTPUTPLOTELEMENTTIME_NAME); + if (isset($timePlotXmlNode)) + $this->addPlotElement(RequestOutputPlotElementTypeEnum::TIMEPLOT)->loadFromNode($timePlotXmlNode); + + $xyPlotXmlNode = $this->getXmlNodeChildByTagName($xmlNode,REQUESTOUTPUTPLOTELEMENTXY_NAME); + if (isset($xyPlotXmlNode)) + $this->addPlotElement(RequestOutputPlotElementTypeEnum::XYPLOT)->loadFromNode($xyPlotXmlNode); + + $statusPlotXmlNode = $this->getXmlNodeChildByTagName($xmlNode,REQUESTOUTPUTPLOTELEMENTSTATUS_NAME); + if (isset($statusPlotXmlNode)) + $this->addPlotElement(RequestOutputPlotElementTypeEnum::STATUSPLOT)->loadFromNode($statusPlotXmlNode); + + $tickPlotXmlNode = $this->getXmlNodeChildByTagName($xmlNode,REQUESTOUTPUTPLOTELEMENTTICK_NAME); + if (isset($tickPlotXmlNode)) + $this->addPlotElement(RequestOutputPlotElementTypeEnum::TICKPLOT)->loadFromNode($tickPlotXmlNode); + + $epochPlotXmlNode = $this->getXmlNodeChildByTagName($xmlNode,REQUESTOUTPUTPLOTELEMENTEPOCH_NAME); + if (isset($epochPlotXmlNode)) + $this->addPlotElement(RequestOutputPlotElementTypeEnum::EPOCHPLOT)->loadFromNode($epochPlotXmlNode); + + $instantPlotXmlNode = $this->getXmlNodeChildByTagName($xmlNode,REQUESTOUTPUTPLOTELEMENTINSTANT_NAME); + if (isset($instantPlotXmlNode)) + $this->addPlotElement(RequestOutputPlotElementTypeEnum::INSTANTPLOT)->loadFromNode($instantPlotXmlNode); + + $this->setPreferedWidth($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTPANEL_PREFEREDWIDTH)); + $this->setPreferedHeight($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTPANEL_PREFEREDHEIGHT)); + $this->setXMargin2($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTPANEL_XMARGIN)); + $this->setId($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTPANEL_ID)); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotParamsLegendNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotParamsLegendNodeClass.php index aae2060..0cd27bb 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotParamsLegendNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotParamsLegendNodeClass.php @@ -132,6 +132,22 @@ class RequestOutputPlotParamsLegendNodeClass extends NodeClass return $node; } + + public function loadFromNode($xmlNode) + { + $this->setType($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTPARAMSLEGEND_TYPE)); + $this->setShowParamInfo($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTPARAMSLEGEND_SHOWPARAMINFO)); + $this->setShowIntervalInfo($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTPARAMSLEGEND_SHOWINTERVALINFO)); + $this->setIntervalInfoType($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTPARAMSLEGEND_INTERVALINFOTYPE)); + $this->setPosition($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTPARAMSLEGEND_POSITION)); + $this->setDefaultTextColor($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTPARAMSLEGEND_DEFAULTTEXTCOLOR)); + $this->setBorderVisible($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTPARAMSLEGEND_BORDERVISIBLE)); + $this->setBorderColor($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTPARAMSLEGEND_BORDERCOLOR)); + + $fontXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTPARAMSLEGEND_FONT); + if (isset($fontXmlNode)) + $this->getFont()->loadFromNode($fontXmlNode); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotParamsNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotParamsNodeClass.php index cb0a029..603bfd2 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotParamsNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotParamsNodeClass.php @@ -1,6 +1,8 @@ <?php require_once("RequestOutputPlotYSerieNodeClass.php"); +require_once "RequestOutputPlotOrbitSerieNodeClass.php"; +require_once "RequestOutputPlotInstantSerieNodeClass.php"; define ("REQUESTOUTPUTPLOTPARAMS_NAME", "params"); @@ -45,6 +47,11 @@ class RequestOutputPlotParamNodeClass extends NodeClass { return $this->getAttribute(REQUESTOUTPUTPLOTPARAM_ID); } + + public function setId($id) + { + $this->setAttribute(REQUESTOUTPUTPLOTPARAM_ID,$id); + } public function addYSerie($yAxis, $index, $xAxis = "", $colorSerieId = -1, $min = NULL, $max = NULL) { @@ -88,7 +95,7 @@ class RequestOutputPlotParamNodeClass extends NodeClass return $iserieNode; } - public function addSpectro($yAxis, $min = NULL, $max = NULL) + public function addSpectro($yAxis = "", $min = NULL, $max = NULL) { $spectroNode = new NodeClass(REQUESTOUTPUTPLOTSPECTRO_NAME); $spectroNode->setAttribute(REQUESTOUTPUTPLOTSPECTRO_YAXIS, $yAxis); @@ -100,7 +107,7 @@ class RequestOutputPlotParamNodeClass extends NodeClass return $spectroNode; } - public function addXSerie($xAxis, $index, $min = NULL, $max = NULL) + public function addXSerie($xAxis = "", $index = -1, $min = NULL, $max = NULL) { $xSerieNode = new NodeClass(REQUESTOUTPUTPLOTXSERIE_NAME); $xSerieNode->setAttribute(REQUESTOUTPUTPLOTXSERIE_XAXIS, $xAxis); @@ -114,7 +121,7 @@ class RequestOutputPlotParamNodeClass extends NodeClass return $xSerieNode; } - public function addColorSerie($id, $index) + public function addColorSerie($id = "", $index = -1) { $colorSerieNode = new NodeClass(REQUESTOUTPUTPLOTCOLORSERIE_NAME); $colorSerieNode->setAttribute(REQUESTOUTPUTPLOTCOLORSERIE_ID, $id); @@ -141,6 +148,70 @@ class RequestOutputPlotParamNodeClass extends NodeClass $this->addChild($tickBarNode); return $tickBarNode; } + + public function loadFromNode($xmlNode) + { + $this->setId($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTPARAM_ID)); + + foreach ($this->getXmlNodeChildren($xmlNode) as $plottypeXmlNode) { + $node = NULL; + switch ($this->getXmlNodeName($plottypeXmlNode)) { + case REQUESTOUTPUTPLOTYSERIE_XYPLOT_NAME : + $node = new RequestOutputPlotYSerieNodeClass(REQUESTOUTPUTPLOTYSERIE_XYPLOT_NAME); + break; + case REQUESTOUTPUTPLOTYSERIE_TIMEPLOT_NAME : + $node = new RequestOutputPlotYSerieNodeClass(REQUESTOUTPUTPLOTYSERIE_TIMEPLOT_NAME); + break; + case REQUESTOUTPUTPLOTORBITSERIE_NAME : + $node = new RequestOutputPlotOrbitSerieNodeClass(); + break; + case REQUESTOUTPUTPLOTINSTANTSERIE_NAME : + $node = new RequestOutputPlotInstantSerieNodeClass(); + break; + case REQUESTOUTPUTPLOTSPECTRO_NAME : + $yAxis = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTSPECTRO_YAXIS); + $min = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTSPECTRO_MIN); + $max = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTSPECTRO_MAX); + $node = $this->addSpectro($yAxis, $min, $max); + break; + case REQUESTOUTPUTPLOTXSERIE_NAME : + $xAxis = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTXSERIE_XAXIS); + $index = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTXSERIE_INDEX); + if (empty($index)) + $index = -1; + $min = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTXSERIE_MIN); + $max = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTXSERIE_MAX); + $node = $this->addXSerie($xAxis, $index, $min, $max); + break; + case REQUESTOUTPUTPLOTCOLORSERIE_NAME : + $id = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTCOLORSERIE_ID); + $index = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTCOLORSERIE_INDEX); + if (empty($index)) + $index = -1; + $node = $this->addColorSerie($id, $index); + break; + case REQUESTOUTPUTPLOTSTATUSBAR_NAME : + $index = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTSTATUSBAR_INDEX); + if (empty($index)) + $index = -1; + $node = $this->addStatusBar($index); + break; + case REQUESTOUTPUTPLOTTICKBAR_NAME : + $index = $this->getXmlNodeAttribute($plottypeXmlNode, REQUESTOUTPUTPLOTTICKBAR_INDEX); + if (empty($index)) + $index = -1; + $node = $this->addTickBar($index); + break; + default: + + } + + if (isset($node)) { + $node->loadFromNode($plottypeXmlNode); + $this->addChild($node); + } + } + } } /** @@ -155,7 +226,7 @@ class RequestOutputPlotParamsNodeClass extends NodeClass parent::__construct(REQUESTOUTPUTPLOTPARAMS_NAME); } - public function getParamById($id) + public function getParamById($id = "") { $paramNodes = $this->getChildrenByName(REQUESTOUTPUTPLOTPARAM_NAME); foreach ($paramNodes as $paramNode) @@ -166,6 +237,13 @@ class RequestOutputPlotParamsNodeClass extends NodeClass $this->addChild($paramNode); return $paramNode; } + + public function loadFromNode($xmlNode) + { + foreach ($this->getXmlNodeChildrenByTagName($xmlNode, REQUESTOUTPUTPLOTPARAM_NAME) as $paramXmlNode) { + $this->getParamById()->loadFromNode($paramXmlNode); + } + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotResamplingNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotResamplingNodeClass.php index de5ebbf..836b5b2 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotResamplingNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotResamplingNodeClass.php @@ -42,6 +42,12 @@ class RequestOutputPlotResamplingNodeClass extends NodeClass { $this->getAttribute(REQUESTOUTPUTPLOTRESAMPLING_VALUE); } + + public function loadFromNode($xmlNode) + { + $this->setType($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTRESAMPLING_TYPE)); + $this->setValue($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTRESAMPLING_VALUE)); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotSerieIntervalTicksNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotSerieIntervalTicksNodeClass.php index b228ba7..95f8482 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotSerieIntervalTicksNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotSerieIntervalTicksNodeClass.php @@ -44,6 +44,12 @@ class RequestOutputPlotSerieIntervalTicksNodeClass extends NodeClass return $this->getAttribute(REQUESTOUTPUTPLOTSERIEINTERVALTICKS_COLOR); } + public function isSymbolDefined() + { + $node = $this->getFirstChildByName(REQUESTOUTPUTPLOTSERIEINTERVALTICKS_SYMBOL); + return isset($node); + } + public function getSymbol() { $node = $this->getFirstChildByName(REQUESTOUTPUTPLOTSERIEINTERVALTICKS_SYMBOL); @@ -57,6 +63,12 @@ class RequestOutputPlotSerieIntervalTicksNodeClass extends NodeClass return $node; } + public function isFontDefined() + { + $node = $this->getFirstChildByName(REQUESTOUTPUTPLOTFONT_NODENAME); + return isset($node); + } + public function getFont() { $node = $this->getFirstChildByName(REQUESTOUTPUTPLOTFONT_NODENAME); @@ -69,6 +81,20 @@ class RequestOutputPlotSerieIntervalTicksNodeClass extends NodeClass return $node; } + + public function loadFromNode($xmlNode) + { + $this->setMode($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTSERIEINTERVALTICKS_MODE)); + $this->setColor($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTSERIEINTERVALTICKS_COLOR)); + + $symbolXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTSERIEINTERVALTICKS_SYMBOL); + if (isset($symbolXmlNode)) + $this->getSymbol()->loadFromNode($symbolXmlNode); + + $fontXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTFONT_NODENAME); + if (isset($fontXmlNode)) + $this->getFont()->loadFromNode($fontXmlNode); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotSerieTimeTicksNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotSerieTimeTicksNodeClass.php index 7ee8604..de2eb6d 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotSerieTimeTicksNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotSerieTimeTicksNodeClass.php @@ -19,6 +19,12 @@ class RequestOutputPlotSerieTimeTicksNodeClass extends NodeClass parent::__construct($name); } + public function isSymbolDefined() + { + $node = $this->getFirstChildByName(REQUESTOUTPUTPLOTSERIETIMETICKS_SYMBOL); + return isset($node); + } + public function getSymbol() { $node = $this->getFirstChildByName(REQUESTOUTPUTPLOTSERIETIMETICKS_SYMBOL); @@ -32,6 +38,12 @@ class RequestOutputPlotSerieTimeTicksNodeClass extends NodeClass return $node; } + public function isFirstSymbolDefined() + { + $node = $this->getFirstChildByName(REQUESTOUTPUTPLOTSERIETIMETICKS_FIRSTSYMBOL); + return isset($node); + } + public function getFirstSymbol() { $node = $this->getFirstChildByName(REQUESTOUTPUTPLOTSERIETIMETICKS_FIRSTSYMBOL); @@ -45,6 +57,12 @@ class RequestOutputPlotSerieTimeTicksNodeClass extends NodeClass return $node; } + public function isFontDefined() + { + $node = $this->getFirstChildByName(REQUESTOUTPUTPLOTFONT_NODENAME); + return isset($node); + } + public function getFont() { $node = $this->getFirstChildByName(REQUESTOUTPUTPLOTFONT_NODENAME); @@ -97,6 +115,26 @@ class RequestOutputPlotSerieTimeTicksNodeClass extends NodeClass { return $this->getAttribute(REQUESTOUTPUTPLOTSERIETIMETICKS_COLOR); } + + public function loadFromNode($xmlNode) + { + $symbolXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTSERIETIMETICKS_SYMBOL); + if (isset($symbolXmlNode)) + $this->getSymbol()->loadFromNode($symbolXmlNode); + + $firstsymbolXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTSERIETIMETICKS_FIRSTSYMBOL); + if (isset($firstsymbolXmlNode)) + $this->getFirstSymbol()->loadFromNode($firstsymbolXmlNode); + + $fontXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTFONT_NODENAME); + if (isset($fontXmlNode)) + $this->getFont()->loadFromNode($fontXmlNode); + + $this->setStep($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTSERIETIMETICKS_STEP)); + $this->setNumber($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTSERIETIMETICKS_NUMBER)); + $this->setMinor($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTSERIETIMETICKS_MINOR)); + $this->setColor($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTSERIETIMETICKS_COLOR)); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotSymbolNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotSymbolNodeClass.php index c49d39d..d8aeb60 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotSymbolNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotSymbolNodeClass.php @@ -65,6 +65,13 @@ class RequestOutputPlotSymbolNodeClass extends NodeClass { return $this->getAttribute(REQUESTOUTPUTPLOTSYMBOL_COLOR); } + + public function loadFromNode($xmlNode) + { + $this->setType($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTSYMBOL_TYPE)); + $this->setSize($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTSYMBOL_SIZE)); + $this->setColor($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTSYMBOL_COLOR)); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotTextLegendNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotTextLegendNodeClass.php index 96112f4..ec3f9d8 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotTextLegendNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotTextLegendNodeClass.php @@ -67,6 +67,17 @@ class RequestOutputPlotTextLegendNodeClass extends NodeClass return $node; } + + public function loadFromNode($xmlNode) + { + $this->setText($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTTEXTLEGEND_TEXT)); + $this->setPosition($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTTEXTLEGEND_POSITION)); + $this->setColor($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTTEXTLEGEND_COLOR)); + + $fontXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTPARAMSLEGEND_FONT); + if (isset($fontXmlNode)) + $this->getFont()->loadFromNode($fontXmlNode); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotTextNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotTextNodeClass.php index 15f556a..8ca5122 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotTextNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotTextNodeClass.php @@ -111,6 +111,21 @@ class RequestOutputPlotTextNodeClass extends NodeClass return $node; } + + public function loadFromNode($xmlNode) + { + $this->setText($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTTEXT_TEXT)); + $this->setYAxis($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTTEXT_YAXIS)); + $this->setX($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTTEXT_X)); + $this->setY($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTTEXT_Y)); + $this->setAngle($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTTEXT_ANGLE)); + $this->setColor($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTTEXT_COLOR)); + $this->setAlign($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTTEXT_ALIGN)); + + $fontXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTTEXT_FONT); + if (isset($fontXmlNode)) + $this->getFont()->loadFromNode($fontXmlNode); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotTimeAxisNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotTimeAxisNodeClass.php index dd8851b..3217675 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotTimeAxisNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotTimeAxisNodeClass.php @@ -26,6 +26,12 @@ class RequestOutputPlotTimeAxisNodeClass extends RequestOutputPlotAxisElementNod { return $this->getAttribute(REQUESTOUTPUTPLOTTIMEAXIS_FORMAT); } + + public function loadFromNode($xmlNode) + { + $this->setFormat($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTTIMEAXIS_FORMAT)); + parent::loadFromNode($xmlNode); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotTitleNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotTitleNodeClass.php index a03e07d..c738330 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotTitleNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotTitleNodeClass.php @@ -59,6 +59,14 @@ class RequestOutputPlotTitleNodeClass extends RequestOutputPlotLabelNodeClass { return $this->getAttribute(REQUESTOUTPUTPLOTTITLE_ALIGN); } + + public function loadFromNode($xmlNode) + { + $this->setText($this->getXmlNodeValue($xmlNode)); + $this->setPosition($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTTITLE_POSITION)); + $this->setAlign($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTTITLE_ALIGN)); + parent::loadFromNode($xmlNode); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotYSerieErrorBarNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotYSerieErrorBarNodeClass.php index 9e4a0a6..bc7f957 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotYSerieErrorBarNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotYSerieErrorBarNodeClass.php @@ -43,6 +43,12 @@ class RequestOutputPlotYSerieErrorBarMinMaxNodeClass extends NodeClass if ($index != -1) $this->setAttribute(REQUESTOUTPUTPLOTYSERIEERRORBARMINMAX_MAXPARAMINDEX, $index); } + + public function loadFromNode($xmlNode) + { + $this->setMinParam($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTYSERIEERRORBARMINMAX_MINPARAM), $this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTYSERIEERRORBARMINMAX_MINPARAMINDEX)); + $this->setMaxParam($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTYSERIEERRORBARMINMAX_MAXPARAM), $this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTYSERIEERRORBARMINMAX_MAXPARAMINDEX)); + } } /** diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotYSerieNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotYSerieNodeClass.php index 9c3ca37..9fdfd25 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotYSerieNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotYSerieNodeClass.php @@ -1,5 +1,8 @@ <?php +require_once "RequestOutputPlotResamplingNodeClass.php"; +require_once "RequestOutputPlotYSerieErrorBarNodeClass.php"; + define ("REQUESTOUTPUTPLOTYSERIE_XYPLOT_NAME", "yserie"); define ("REQUESTOUTPUTPLOTYSERIE_TIMEPLOT_NAME", "serie"); @@ -54,6 +57,21 @@ class RequestOutputPlotYSerieNodeClass extends RequestOutputPlotBaseSerieNodeCla return $node; } + + public function loadFromNode($xmlNode) + { + $this->setIndex($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTYSERIE_INDEX)); + + $resamplingXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTYSERIE_RESAMPLING); + if (isset($resamplingXmlNode)) + $this->getResampling()->loadFromNode($resamplingXmlNode); + + $errorbarXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTYSERIE_ERRORBAR); + if (isset($errorbarXmlNode)) + $this->getErrorBar()->loadFromNode($errorbarXmlNode); + + parent::loadFromNode($xmlNode); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPostProcessingNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPostProcessingNodeClass.php index 4b4ca91..fff3e5a 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPostProcessingNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPostProcessingNodeClass.php @@ -27,6 +27,13 @@ class RequestOutputPostProcessingNodeClass extends NodeClass return false; return ($this->getChildInstanceByName($type) != NULL); } + + public function loadFromNode($xmlNode) + { + foreach ($this->getXmlNodeChildren($xmlNode) as $postprocessingXmlNode) { + $this->addPostProcessing($this->getXmlNodeName($postprocessingXmlNode)); + } + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputStatisticNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputStatisticNodeClass.php index fb5af03..f0603cc 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputStatisticNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputStatisticNodeClass.php @@ -44,6 +44,11 @@ class RequestOutputStatisticFunctionNodeClass extends NodeClass { $this->setAttribute(REQUESTOUTPUTSTATISTICFUNCTION_ID, $name); } + + public function loadFromNode($xmlNode) + { + $this->setFunctionName($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTSTATISTICFUNCTION_ID)); + } } class RequestOutputStatisticParamNodeClass extends NodeClass @@ -63,19 +68,18 @@ class RequestOutputStatisticParamNodeClass extends NodeClass return $this->getAttribute(REQUESTOUTPUTSTATISTICPARAM_ID); } - public function addFunction($name) + public function addFunction($name = "") { $node = new RequestOutputStatisticFunctionNodeClass(); $this->addChild($node); - $node->setFunctionName($name); + $node->setFunctionName($name); + return $node; } public function indexExist($index) { if ($this->getAttribute(REQUESTOUTPUTSTATISTICPARAM_INDEX) == $index) - return true; - - + return true; return false; } @@ -83,10 +87,21 @@ class RequestOutputStatisticParamNodeClass extends NodeClass { if ($this->indexExist($index)) return; - $this->setAttribute(REQUESTOUTPUTSTATISTICPARAM_INDEX, $index); } + + public function loadFromNode($xmlNode) + { + $this->setId($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTSTATISTICPARAM_ID)); + + foreach ($this->getXmlNodeChildrenByTagName($xmlNode, REQUESTOUTPUTSTATISTICFUNCTION_NAME) as $functionXmlNode) { + $this->addFunction()->loadFromNode($functionXmlNode); + } + + $this->setIndex($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTSTATISTICPARAM_INDEX)); + } + } /** @@ -126,7 +141,7 @@ class RequestOutputStatisticNodeClass extends NodeClass } - public function addParam($id, $indexes) + public function addParam($id = "", $indexes = array()) { $paramsNode = $this->getFirstChildByName(REQUESTPARAMS_NAME); @@ -150,7 +165,7 @@ class RequestOutputStatisticNodeClass extends NodeClass return $node; } - public function addPostProcessing($process) + public function addPostProcessing($process = "") { $node = $this->getChildInstanceByName(REQUESTOUTPUTPOSTPROCESSING_NAME); if ($node == NULL) @@ -160,6 +175,8 @@ class RequestOutputStatisticNodeClass extends NodeClass } $node->addPostProcessing($process); + + return $node; } public function isPostProcessing($process) @@ -171,6 +188,26 @@ class RequestOutputStatisticNodeClass extends NodeClass return $node->isPostProcessing($process); } + + public function loadFromNode($xmlNode) + { + $this->setTimeFormat($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTSTATISTIC_TIMEFORMAT)); + $this->setFileFormat($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTSTATISTIC_FILEFORMAT)); + $this->setStructure($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTSTATISTIC_STRUCTURE)); + $this->setFileName($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTSTATISTIC_FILENAME)); + + $paramsXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTPARAMS_NAME); + if (isset($paramsXmlNode)) + { + foreach ($this->getXmlNodeChildrenByTagName($paramsXmlNode, REQUESTOUTPUTSTATISTICPARAM_NAME) as $paramXmlNode) { + $this->addParam()->loadFromNode($paramXmlNode); + } + } + + $postprocessingXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPOSTPROCESSING_NAME); + if (isset($postprocessingXmlNode)) + $this->addPostProcessing()->loadFromNode($paramXmlNode); + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputsNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputsNodeClass.php index fe7e55d..42e7341 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputsNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputsNodeClass.php @@ -1,4 +1,10 @@ <?php + +require_once "RequestOutputDownloadNodeClass.php"; +require_once "RequestOutputPlotNodeClass.php"; +require_once "RequestOutputDataMiningNodeClass.php"; +require_once "RequestOutputStatisticNodeClass.php"; + define ("REQUESTOUTPUTS_NAME", "outputs"); abstract class RequestOutputTypeEnum @@ -46,6 +52,29 @@ class RequestOutputsNodeClass extends NodeClass return $output; } + + public function loadFromNode($xmlNode) + { + foreach ($this->getXmlNodeChildren($xmlNode) as $outputXmlNode) { + switch ($this->getXmlNodeName($outputXmlNode)) { + case REQUESTOUTPUTDOWNLOAD_NAME : + $this->addNewOutput(RequestOutputTypeEnum::DOWNLOAD)->loadFromNode($outputXmlNode); + break; + case REQUESTOUTPUTDATAMINING_NAME : + $this->addNewOutput(RequestOutputTypeEnum::DATAMINING)->loadFromNode($outputXmlNode); + break; + case REQUESTOUTPUTPLOT_NAME : + $this->addNewOutput(RequestOutputTypeEnum::PLOT)->loadFromNode($outputXmlNode); + break; + case REQUESTOUTPUTSTATISTIC_NAME : + $this->addNewOutput(RequestOutputTypeEnum::STATISTIC)->loadFromNode($outputXmlNode); + break; + default : + throw new Exception('Output node not implemented'); + } + + } + } } ?> \ No newline at end of file diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestTimesNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestTimesNodeClass.php index a07671b..e0cd4e8 100644 --- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestTimesNodeClass.php +++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestTimesNodeClass.php @@ -39,6 +39,14 @@ class RequestTimesIntervalNodeClass extends NodeClass return ""; return $durationNode->getValue(); } + + public function loadFromNode($xmlNode) + { + $startXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTTIMEINTERVAL_START); + $durationXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTTIMEINTERVAL_DURATION); + if (isset($startXmlNode) && isset($durationXmlNode)) + $this->setInterval($this->getXmlNodeValue($startXmlNode), $this->getXmlNodeValue($durationXmlNode)); + } } define ("REQUESTTIMETABLE_NAME", "timetable"); @@ -87,6 +95,13 @@ class RequestTimesTimeTableNodeClass extends NodeClass { return $this->getAttribute(REQUESTTIMETABLE_INDEX); } + + public function loadFromNode($xmlNode) + { + $this->setId($this->getXmlNodeAttribute($xmlNode, REQUESTTIMETABLE_ID)); + $this->setTTName($this->getXmlNodeAttribute($xmlNode, REQUESTTIMETABLE_TTNAME)); + $this->setIndex($this->getXmlNodeAttribute($xmlNode, REQUESTTIMETABLE_INDEX)); + } } define ("REQUESTCATALOG_NAME", "catalog"); @@ -135,6 +150,13 @@ class RequestCatalogNodeClass extends NodeClass { return $this->getAttribute(REQUESTCATALOG_INDEX); } + + public function loadFromNode($xmlNode) + { + $this->setId($this->getXmlNodeAttribute($xmlNode, REQUESTCATALOG_ID)); + $this->setCatalogName($this->getXmlNodeAttribute($xmlNode, REQUESTCATALOG_TTNAME)); + $this->setIndex($this->getXmlNodeAttribute($xmlNode, REQUESTCATALOG_INDEX)); + } } define ("REQUESTTIMES_NAME", "times"); @@ -151,11 +173,12 @@ class RequestTimesNodeClass extends NodeClass parent::__construct(REQUESTTIMES_NAME); } - public function addInterval($start, $duration) + public function addInterval($start = "", $duration = "") { $interval = new RequestTimesIntervalNodeClass(); $interval->setInterval($start, $duration); $this->addChild($interval); + return $interval; } public function getIntervals() @@ -163,7 +186,7 @@ class RequestTimesNodeClass extends NodeClass return $this->getChildrenByName(REQUESTTIMEINTERVAL_NAME); } - public function addTimeTable($id, $name, $index = -1) + public function addTimeTable($id = "", $name = "", $index = -1) { $timeTable = new RequestTimesTimeTableNodeClass(); $timeTable->setId($id); @@ -172,9 +195,10 @@ class RequestTimesNodeClass extends NodeClass if ($index >= 0) $timeTable->setIndex($index); $this->addChild($timeTable); + return $timeTable; } - public function addCatalog($id, $name, $index = -1) + public function addCatalog($id = "", $name = "", $index = -1) { $catalogNode = new RequestCatalogNodeClass(); $catalogNode->setId($id); @@ -183,8 +207,23 @@ class RequestTimesNodeClass extends NodeClass if ($index >= 0) $catalogNode->setIndex($index); $this->addChild($catalogNode); + return $catalogNode; } + public function loadFromNode($xmlNode) + { + foreach ($this->getXmlNodeChildrenByTagName($xmlNode, REQUESTTIMEINTERVAL_NAME) as $timeintervalXmlNode) { + $this->addInterval()->loadFromNode($timeintervalXmlNode); + } + + foreach ($this->getXmlNodeChildrenByTagName($xmlNode, REQUESTTIMETABLE_NAME) as $timetableXmlNode) { + $this->addTimeTable()->loadFromNode($timetableXmlNode); + } + + foreach ($this->getXmlNodeChildrenByTagName($xmlNode, REQUESTCATALOG_NAME) as $catalogXmlNode) { + $this->addCatalog()->loadFromNode($catalogXmlNode); + } + } } ?> \ No newline at end of file diff --git a/src/RequestManager.php b/src/RequestManager.php index c531663..c67afd7 100644 --- a/src/RequestManager.php +++ b/src/RequestManager.php @@ -14,6 +14,7 @@ function amdaintegration_autoload($class_name) 'InputOutput/IHMImpl/Params/PlotImpl', 'InputOutput/IHMImpl/Params/GeneratorImpl', 'InputOutput/IHMImpl/Process', + 'InputOutput/IHMImpl/ParamInfo', 'InputOutput/IHMImpl/Tools', 'InputOutput/TestImpl', 'Request', @@ -55,7 +56,8 @@ abstract class FunctionTypeEnumClass const PROCESSGETINFO = "process_get_info"; const PROCESSCLEAN = "process_clean"; const TTMERGE = "tt_merge"; - const TTUNION = "tt_merge"; + const TTUNION = "tt_union"; + const PARAMINFO = "param_info"; } /** @@ -76,7 +78,7 @@ abstract class ClientTypeEnumClass */ Class RequestManagerClass { - public static $version = "1.2.0"; + public static $version = "1.3.0"; /* * @brief Constructor @@ -121,6 +123,8 @@ Class RequestManagerClass case FunctionTypeEnumClass::TTMERGE : case FunctionTypeEnumClass::TTUNION : return new TTRequestClass($userHost); + case FunctionTypeEnumClass::PARAMINFO : + return new ParamInfoRequestClass($userHost); default : throw new Exception('Request '.$function.' not implemented.'); } -- libgit2 0.21.2