function makeSearchList($startTime, $endTime) { $TIMEINTERVAL = timeInterval2Days($endTime - $startTime); $STARTTIME = startTime2Days($startTime); $fileS = fopen(searchList, "w"); fwrite($fileS, $STARTTIME . PHP_EOL . $TIMEINTERVAL . PHP_EOL); fclose($fileS); }
$i = 0; foreach ($missions as $mission) { $fileS = fopen(requestList, "w"); $missionTag = $dom->getElementById($mission); $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); }
function createSearchListFile($startTime, $endTime, $ID) { $TIMEINTERVAL = timeInterval2Days($endTime - $startTime); $STARTTIME = startTime2Days($startTime); // Down to working directory chdir(resultDir . $ID . "/RES"); $fileInfo = $TIMEINTERVAL; // Add StartTime\n and TimeInterval in search.list file in the $ID directory $fileSearch = 'search.list'; $fileS = fopen($fileSearch, "w"); fwrite($fileS, $STARTTIME . "\n" . $TIMEINTERVAL . "\n"); fclose($fileS); }