getChildInstanceByName(REQUESTOUTPUTPLOTAXES_XAXIS, true); if (!$noYAxis) $node = $this->getChildInstanceByName(REQUESTOUTPUTPLOTAXES_YAXIS, true); if (!$noZAxis) $node = $this->getChildInstanceByName(REQUESTOUTPUTPLOTAXES_ZAXIS, true); } public function addDigitalAxis($axisType,$id = "") { if (($axisType != RequestOutputPlotAxisTypeEnum::XAXIS) && ($axisType != RequestOutputPlotAxisTypeEnum::YAXIS)) return NULL; $axisNode = $this->getChildInstanceByName($axisType); //add digital axis $digitalAxisNode = new RequestOutputPlotDigitalAxisNodeClass(); $digitalAxisNode->setId($id); $axisNode->addChild($digitalAxisNode); return $digitalAxisNode; } public function getDigitalAxis($axisType,$id) { if (($axisType != RequestOutputPlotAxisTypeEnum::XAXIS) && ($axisType != RequestOutputPlotAxisTypeEnum::YAXIS)) return NULL; $axisNode = $this->getChildInstanceByName($axisType); $digitalAxisNodes = $axisNode->getChildrenByName(REQUESTOUTPUTPLOTDIGITALAXIS_NAME); foreach ($digitalAxisNodes as $digitalAxisNode) if ($digitalAxisNode->getId() == $id) return $digitalAxisNode; return NULL; } public function getTimeAxis() { $axisNode = $this->getChildInstanceByName(RequestOutputPlotAxisTypeEnum::XAXIS); $timeAxisNode = $axisNode->getFirstChildByName(REQUESTOUTPUTPLOTTIMEAXIS_NAME); if (!isset($timeAxisNode)) { $timeAxisNode = new RequestOutputPlotTimeAxisNodeClass(); $axisNode->addChild($timeAxisNode); } return $timeAxisNode; } public function getEpochAxis() { $axisNode = $this->getChildInstanceByName(RequestOutputPlotAxisTypeEnum::XAXIS); $epochAxisNode = $axisNode->getFirstChildByName(REQUESTOUTPUTPLOTEPOCHAXIS_NAME); if (!isset($epochAxisNode)) { $epochAxisNode = new RequestOutputPlotEpochAxisNodeClass(); $axisNode->addChild($epochAxisNode); } return $epochAxisNode; } public function getColorAxis() { $axisNode = $this->getChildInstanceByName(RequestOutputPlotAxisTypeEnum::ZAXIS); $colorAxisNode = $axisNode->getFirstChildByName(REQUESTOUTPUTPLOTCOLORAXIS_NAME); if (!isset($colorAxisNode)) { $colorAxisNode = new RequestOutputPlotColorAxisNodeClass(); $axisNode->addChild($colorAxisNode); } 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); } } } ?>