From 2f2f6cee2b4b3c4933381c0b6e4949d24104e52a Mon Sep 17 00:00:00 2001 From: Elena.Budnik Date: Tue, 12 Dec 2017 13:00:28 +0100 Subject: [PATCH] FillValue by default --- src/DATA/MANAGER/DDBaseMgr.php | 9 +++++++-- src/REMOTEDATA/CDAWEB.php | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/DATA/MANAGER/DDBaseMgr.php b/src/DATA/MANAGER/DDBaseMgr.php index 2db3d9d..3fd44f9 100644 --- a/src/DATA/MANAGER/DDBaseMgr.php +++ b/src/DATA/MANAGER/DDBaseMgr.php @@ -12,7 +12,7 @@ class DDBaseMgr private $ViId, $remoteViId; private $DDsysDoc, $DDsys; private $base, $mission, $instrument; - private $min_sampling, $max_sampling; + private $min_sampling, $max_sampling, $fillValue = null; public $location, $ViDir; public $globalStart = null, $globalStop = null; @@ -74,6 +74,7 @@ class DDBaseMgr if (!$infoXml->load($infoXmlFile)) return -10; + $this->base = $base; $this->mission = $infoXml->getElementsByTagName("Mission")->item(0)->nodeValue; $this->instrument = $infoXml->getElementsByTagName("Instrument")->item(0)->nodeValue; @@ -81,7 +82,9 @@ class DDBaseMgr $this->remoteViId = $ds; $this->globalStart = $infoXml->getElementsByTagName("GlobalStart")->item(0)->nodeValue; $this->globalStop = $infoXml->getElementsByTagName("GlobalStop")->item(0)->nodeValue; - + $fillValue = $infoXml->getElementsByTagName("FillValue"); + if ($fillValue->length > 0) $this->fillValue = $fillValue->item(0)->nodeValue; + $this->location = getenv("DDBASE")."/".$this->base."/".strtoupper($this->ViId)."/"; $this->ViDir = $this->location; //--------- Check if additional Info should be added to VI @@ -172,6 +175,8 @@ class DDBaseMgr $rootElement->appendChild($xml_dom->createElement("MinSampling", $this->min_sampling)); if ($this->max_sampling > $this->min_sampling) $rootElement->appendChild($xml_dom->createElement("MaxSampling", $this->max_sampling)); + if ($this->fillValue) + $rootElement->appendChild($xml_dom->createElement("FillValue", $this->fillValue)); $rootElement->appendChild($xml_dom->createElement("LocalStart")); $rootElement->appendChild($xml_dom->createElement("LocalStop")); $xml_dom->appendChild($rootElement); diff --git a/src/REMOTEDATA/CDAWEB.php b/src/REMOTEDATA/CDAWEB.php index 477ef3e..08882ed 100644 --- a/src/REMOTEDATA/CDAWEB.php +++ b/src/REMOTEDATA/CDAWEB.php @@ -351,7 +351,7 @@ class CDAWEB extends RemoteDataCenterClass $rootNode->appendChild($this->DDserverXml->createElement("GlobalStop")); $rootNode->appendChild($this->DDserverXml->createElement("MinSampling")); // fill value by default - if different - add into param description - $rootNode->appendChild($this->DDserverXml->createElement("FillValue"), -1.0E31); + $rootNode->appendChild($this->DDserverXml->createElement("FillValue", -1.0E31)); } protected function updateDDServerXml($target, $value) -- libgit2 0.21.2