AddLocalVI.php 1.16 KB
<?php

/**
*  @file AddLocalVI.php
*  @version 
*  @brief DD Server Tools: 
*  @arg    
*/

	if (!function_exists('__autoload')) 
	{
		function __autoload($class_name) {
				require_once $class_name . '.php';
		}
	}
   
   putenv("LD_LIBRARY_PATH=".getenv("LD_LIBRARY_PATH"));
	putenv("PATH=./:".getenv("DDBASEBIN").":/bin:/usr/bin");
	set_include_path("./:".getenv("DATAMANAGER").":".getenv("REMOTEDATA").":".getenv("CALLEXT")); 

/*
*  DEFINITIONS TO FILL
*/
   $brief = "jedi"; // prefix $argv[1]
   $ViId = "juno_jedi_i180"; // $argv[2]
   $mission = "JUNO";  // $argv[3]
   $instrument= "JEDI"; // $argv[4]
   $mission_dir = "JUNO/"; // $argv[5]
   $location = "JEDI/I_180"; // $argv[6]
   $min_sampling = 2;// $argv[7]
   $max_sampling = 3;// $argv[8]  // 0 if constant sampling
/*
*  DO NOT TOUCH
*/
   $base = "LOCAL";
	$baseMgr = new DDBaseMgr();

	if ($baseMgr->viExists($ViId, $base)) die("$ViId Already Exists!!!".PHP_EOL);

	$baseMgr->setViId($ViId);
	$baseMgr->setViInfo($brief);
	$baseMgr->setViParentsInfo($base, $mission, $instrument);
	$baseMgr->setViLocation($mission_dir, $location);
	$baseMgr->setViSampling($min_sampling, $max_sampling);

	$baseMgr->createVi();
		 
?>