$params = $missionTag->getElementsByTagName('param'); //TODO calculate deltaY from number of vars $yStart = 0.1; fwrite($fileS, $params->length . PHP_EOL); foreach ($params as $param) { $yStop = $yStart + 0.2; fwrite($fileS, $param->getAttribute('name') . ' 0 ' . $yStart . ' 0.95 ' . $yStop . ' 0 0 0 0' . PHP_EOL); $yStart += 0.2; } $startTime = strtotime($start[$i]); $endTime = strtotime($stop[$i]); $TIMEINTERVAL = timeInterval2Days($endTime - $startTime); $STARTTIME = startTime2Days($startTime); fwrite($fileS, $STARTTIME . PHP_EOL . $TIMEINTERVAL . PHP_EOL); fclose($fileS); $myParamBuilder = new ParamBuilder(); // Process Local Params without codes if they exist if (file_exists(XML_BASE_DIR . "LocalParamsList.xml")) { $localParams = new DomDocument('1.0'); $localParams->load(XML_BASE_DIR . "LocalParamsList.xml"); $xp = new domxpath($localParams); foreach ($params as $param) { $var = $param->getAttribute('name'); $paramTag = $xp->query('//PARAM[.="' . $var . '"]'); if ($paramTag->length !== 0) { $myParamBuilder->paramLocalBuild($var); } } } // Run command if ($isMulti) {
} else { $paramArg = $thisParamName; } $lines[2] = str_replace("parameter", $paramArg, $lines[2]); if (Verbose) { fwrite(log, '$lines[2]= ' . $lines[2] . PHP_EOL); } $chain = $lines[1]; //TODO dispatch for multiples Vars $vars[0] = trim($lines[2]); $fileContents = implode(PHP_EOL, $lines); $fileInfo = $chain . ' ' . $vars; $fileRes = fopen(searchRes, "w"); fwrite($fileRes, $fileContents); fclose($fileRes); $myParamBuilder = new ParamBuilder(); // create IDL PARAMCALCUL PROCEDURE // Process Local Params without codes if they exist if (file_exists(XML_BASE_DIR . "LocalParamsList.xml")) { $localParams = new DomDocument('1.0'); $localParams->load(XML_BASE_DIR . "LocalParamsList.xml"); $xp = new domxpath($localParams); foreach ($vars as $var) { $paramTag = $xp->query('//PARAM[.="' . $var . '"]'); if ($paramTag->length !== 0) { $myParamBuilder->paramLocalBuild($var); } } } $myParamBuilder->makeParamCalcul($chain, $vars, ""); // Run command