";
include "header.php";
echo " ";
echo "NMEA Configuration
";
echo "";
$Downloadpath = $Land."_".PATHNMEA.$_GET["NMEAFile"] .".cfg";
// Erhält ein Teil des Pfads zur Confluence-Wiki
$confluence = $_GET['space'];
If($_SESSION["ship"] != "")
{
// Zum Testen auf einem lokalen Server müssen die Verzeichnisse überprüft werden!!!
//$PathDevice = "/$Ship/"."_data/GESODocu/ascii/Device_Sensor.xml";
//$PathWiki = "/$Ship/"."data/GESODocu/ascii/WikiTrans.xml";
$PathWiki = "/".$Ship.PATHWIKI;
$PathDevice= "/".$Ship.PATHDEVICE;
//$PathDevice = "/Applications/XAMPP/xamppfiles/htdocs/Polarstern/Device_Sensor.xml";
//$PathWiki = "/Applications/XAMPP/xamppfiles/htdocs/Polarstern/WikiTrans.xml";
}
else
{
//$PathDevice = "/data1_1/ArchiveSystem/".$Ship."/Configuration/GESODocu/ascii/Device_Sensor.xml";
//$PathWiki = "/data1_1/ArchiveSystem/".$Ship."/Configuration/GESODocu/ascii/WikiTrans.xml";
$PathWiki = $Land.PATHWIKI;
$PathDevice = $Land.PATHDEVICE;
//echo "Land: ".$PathDevice;
// $PathDevice = "/Applications/XAMPP/xamppfiles/htdocs/Polarstern/Device_Sensor.xml";
// $PathWiki = "/Applications/XAMPP/xamppfiles/htdocs/Polarstern/WikiTrans.xml";
}
if (file_exists($PathDevice)){
$XmlDevice = simplexml_load_file($PathDevice);
if (!$XmlDevice){
echo "!file_exists($PathDevice)";
}
XmlMaster::setXmlFile($XmlDevice);
}
if (!isset($_SESSION["nmeas"]) or !empty($_GET["Restart"])) {
$nmeao = new NMEAObject();
$_SESSION["nmeas"] = serialize($nmeao);
$nmeao = unserialize($_SESSION["nmeas"]);
}
if(!empty($_GET["SendNMEA"])){
$nmeao = unserialize($_SESSION["nmeas"]);
$completePath = $Downloadpath;
if($nmeao->write_NMEA($Land,$_GET["NMEAFile"])){
if(!empty($_GET["EmailSendNMEA"])){
MailMaster::sendnmeafile($completePath,$_GET["EmailSendNMEA"]);
}
else{
echo "Please enter your email address";
}
}
}
if(isset($_POST["LoadNMEA"]) && $_POST["LoadNMEA"]=="LoadNMEA"){
// Das Formular wurde gesendet
$dername = $_FILES['LoadNMEAFile']['name'];
$realname = $Land."_".PATHNMEA.$dername;
//echo "in LOAD
";
if(!move_uploaded_file($_FILES['LoadNMEAFile']['tmp_name'],$realname)){
// Ups, es passierte ein Fehler beim Kopieren
echo "PROBLEM while uploading file to server
";
}
else{
$filenameload = $realname;
$nmeao = NMEALoader::loadNMEAFile($filenameload);
$_SESSION["nmeas"] = serialize($nmeao);
$nmeao = unserialize($_SESSION["nmeas"]);
}
}
else{
$nmeao = unserialize($_SESSION["nmeas"]);
}
//Write NMEA-File
if(!empty($_GET["SaveNMEA"])){
$nmeao = unserialize($_SESSION["nmeas"]);
$completePath = $Downloadpath;
if($nmeao->write_NMEA($Land,$_GET["NMEAFile"])){
echo "The File has been saved to ".$Downloadpath."
";
$mailto=EMAIL_TO;
$mailfrom=EMAIL_FROM;
MailMaster::sysmannotice($completePath,"abcd");
}
}
if(!empty($_GET["CreateNMEA"]) or isset($_POST["LoadNMEA"]) or !empty($_GET["SaveNMEA"]) or !empty($_GET["SendNMEA"])){
include "Overview.php";
}
// METAINFORMATION
else if(!empty($_GET["EditMeta"]) or !empty($_GET["AddIPAddress"]) or !empty($_GET["DeleteIP"]) or
!empty($_GET["AddUDPAddress"]) or !empty($_GET["DeleteUDP"])){
include "MetaInformation.php";
}
else if(!empty($_GET["SaveMeta"]) or !empty($_GET["MoveUpDescr"]) or !empty($_GET["MoveDownDescr"])){
include "Overview.php";
}
else if(!empty($_GET["AddDescription"])){
$nmeao->currentdescription->prolog = $_GET["prolog"];
$nmeao->currentdescription->separator = $_GET["separator"];
$nmeao->currentdescription->epilog = $_GET["epilog"];
$nmeao->add_description($nmeao->currentdescription);
$nmeao->currentdescription = new NMEADescription();
include "Overview.php";
}
else if(!empty($_GET["DeleteDescription"])){
if(!empty($_GET["descrradio"])){
$nmeao->remove_description($_GET["descrradio"]);
}
include "Overview.php";
}
else if(!empty($_GET["SaveDescription"])){
$nmeao->currentdescription->prolog = $_GET["prolog"];
$nmeao->currentdescription->separator = $_GET["separator"];
$nmeao->currentdescription->epilog = $_GET["epilog"];
$nmeao->currentdescription = new NMEADescription();
$nmeao->editingmode = false;
include "Overview.php";
}
// DESCRIPTIONS
else if(!empty($_GET["EditDescription"])){
if(!empty($_GET["descrradio"])){
$nmeao->currentdescription = $nmeao->descriptions[$_GET["descrradio"]-1];
$nmeao->editingmode = true;
include "Description.php";
}
else{
include "Overview.php";
}
}
//VALUES
else if(!empty($_GET["AddValueName"]) or !empty($_GET["DeleteValue"]) or !empty($_GET["EditValue"])
or !empty($_GET["SaveValue"]) or !empty($_GET["AddConstantsName"]) or !empty($_GET["SaveConstantsName"]) or
!empty($_GET["UpdateSensorsName"]) or !empty($_GET["UpdateSpecialsName"]) or
!empty($_GET["MoveUpValue"]) or !empty($_GET["MoveDownValue"])
or !empty($_GET["NewDescription"])){
include "Description.php";
}
else{
include "Start.php";
}
echo "
";
echo "";
$_SESSION["nmeas"] = serialize($nmeao);
?>