summaryrefslogtreecommitdiffstats
path: root/Website
diff options
context:
space:
mode:
authorTriatmoko2011-11-15 01:37:35 +0100
committerTriatmoko2011-11-15 01:37:35 +0100
commit2b850a5d8d9c3d0a76e05542636657647351d4b1 (patch)
treec94c3b6ad0eccb119254032fe7cd2471ef69ebe4 /Website
parentMerge branch 'master' of lab.ks.uni-freiburg.de:lsfks/projekte/gsm-selftest (diff)
downloadgsm-selftest-2b850a5d8d9c3d0a76e05542636657647351d4b1.tar.gz
gsm-selftest-2b850a5d8d9c3d0a76e05542636657647351d4b1.tar.xz
gsm-selftest-2b850a5d8d9c3d0a76e05542636657647351d4b1.zip
Cleaning the unused commenting from the first auhtor!
Diffstat (limited to 'Website')
-rw-r--r--Website/TaskTest.html2
-rw-r--r--Website/devconf.php2
-rw-r--r--Website/insertData.php15
-rw-r--r--Website/mutexSmartTest.php15
-rwxr-xr-xWebsite/mutexTry.php26
-rw-r--r--Website/post.php18
-rw-r--r--Website/testCase.php20
7 files changed, 23 insertions, 75 deletions
diff --git a/Website/TaskTest.html b/Website/TaskTest.html
index 5202ed5..67c154b 100644
--- a/Website/TaskTest.html
+++ b/Website/TaskTest.html
@@ -57,8 +57,8 @@
<label><input type="checkbox" name="landline_gsmrz1"> Landline to RZ-GSM 1</label><br />
-
</td> </font>
+
<td style="text-align:top;">
<font size="2" face="Century Gothic" color="white">
<label><input type="checkbox" name="landline_gsmrz2"> Landline to RZ-GSM 2</label><br />
diff --git a/Website/devconf.php b/Website/devconf.php
index 4f8cede..bd13067 100644
--- a/Website/devconf.php
+++ b/Website/devconf.php
@@ -12,7 +12,7 @@ $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die('Error connecting to mys
mysql_select_db($dbname);
//End of connection stuff
include 'mutexFunctions.php'; //mutex functions, isfree, lock and release
-//include 'insertData.php'; //insert task functions
+
$nameOfLock = 'Webpage';
$timeToKeepTheMutex = 360;
diff --git a/Website/insertData.php b/Website/insertData.php
index 6a9bdb4..2facf1c 100644
--- a/Website/insertData.php
+++ b/Website/insertData.php
@@ -1,18 +1,5 @@
<?
-/*
-//Connection stuff
-//DB
-$dbhost = 'localhost';
-$dbuser = 'root';
-$dbpass = 'randompasswordSQL';
-
-$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die('Error connecting to mysql');
-
-$dbname = 'gsmselftesting';
-mysql_select_db($dbname);
-//End of connection stuff
-*/
function getNewTaskNo()
{
$sql = "SELECT MAX(taskNo) FROM TaskTable"; //the SQL command to find the max value in taskNo
@@ -78,5 +65,5 @@ function insertTask($taskNo, $from, $to)
return 0; //nothing was added to the table, some error occured
}
}
- //include 'post.php';
+
?>
diff --git a/Website/mutexSmartTest.php b/Website/mutexSmartTest.php
index cfb8916..5ce264a 100644
--- a/Website/mutexSmartTest.php
+++ b/Website/mutexSmartTest.php
@@ -32,10 +32,6 @@ if ($locking == '1') //1 means nobody is on the website
$lockMe = Lock($nameOfLock,$timeToKeepTheMutex); //Set a mutex for the webpage
if ($lockMe == '1') //1 means a successful lock
{
- // read posted data and add them to the database
-// echo 'WE had errors: '. $errorAdding;
- //stuff to do here
- //check if the software is running!
$softwareLock = 'SoftwareStarted';
$taskAmount= 1;
$numberofTask =0;
@@ -57,10 +53,9 @@ if ($locking == '1') //1 means nobody is on the website
fclose($startApp);
}
- //exec("/usr/bin/python /var/www/tricode/gsmselftest2.py > /dev/null 2>&1 &"); //start the software in background and don't wait for any output
- sleep(6); //sleep half second till the software starts
- //the software should be running already and set the lock, now we test it and then connect to it!
-
+ sleep(6); //sleep till the software starts
+
+ //the software should be running already and set the lock, now we test it and then connect to it!
$softwareRunning1 = isLocked($softwareLock);
if($softwareRunning1 == '0') //Software running and waiting for connection!
{
@@ -148,7 +143,6 @@ if ($locking == '1') //1 means nobody is on the website
$callFrom = strtoupper($dataForTable[1]);
$callTo = strtoupper($dataForTable[2]);
$testStatus = strtoupper($dataForTable[3]);
- //ADD HERE THE TEST CASES BUT MAKE IT INSIDE OF A FILE (e.q. include 'testing.php'); HERE I PUT IT ONLY FOR EXAMPLE PURPOSES!
if($callFrom == 'SIP' || $callTo == 'SIP')
{
@@ -895,7 +889,6 @@ if ($locking == '1') //1 means nobody is on the website
<td> ' . $dataForTable[4] . ' </td>
<td>' . $dataForTable[3] . '</td>
</tr>';
- //echo $received . '<br>';
echo str_repeat("\n",7024);
flush();
usleep(100);
@@ -927,8 +920,6 @@ if ($locking == '1') //1 means nobody is on the website
echo 'We have an unknown error! Refresh te web page!';
}
- //$release = ReleaseLock($nameOfLock);
- //echo $release . "<br>";
}
else
{
diff --git a/Website/mutexTry.php b/Website/mutexTry.php
index e9dc366..5579437 100755
--- a/Website/mutexTry.php
+++ b/Website/mutexTry.php
@@ -36,12 +36,9 @@ if ($locking == '1') //1 means nobody is on the website
{
include 'post.php'; // read posted data and add them to the database
-// echo 'WE had errors: '. $errorAdding;
- //stuff to do here
//check if the software is running!
$softwareLock = 'SoftwareStarted';
-
- //$taskAmount= 1
+
if($taskAmount != 0)
{
$softwareRunning = isLocked($softwareLock);
@@ -60,8 +57,7 @@ if ($locking == '1') //1 means nobody is on the website
fclose($startApp);
}
- //exec("/usr/bin/python /var/www/tricode/gsmselftest2.py > /dev/null 2>&1 &"); //start the software in background and don't wait for any output
- sleep(6); //sleep half second till the software starts
+ sleep(6); //sleep till the software starts
//the software should be running already and set the lock, now we test it and then connect to it!
$softwareRunning1 = isLocked($softwareLock);
@@ -81,7 +77,6 @@ if ($locking == '1') //1 means nobody is on the website
fwrite($fp, "START TEST");
- //fwrite($fp, "SMART TEST"); //send command to start the tests
if(!feof($fp))
{
while(!feof($fp))
@@ -162,7 +157,6 @@ if ($locking == '1') //1 means nobody is on the website
$callFrom = strtoupper($dataForTable[1]);
$callTo = strtoupper($dataForTable[2]);
$testStatus = strtoupper($dataForTable[3]);
- //ADD HERE THE TEST CASES BUT MAKE IT INSIDE OF A FILE (e.q. include 'testing.php'); HERE I PUT IT ONLY FOR EXAMPLE PURPOSES!
if($callFrom == 'SIP' || $callTo == 'SIP')
{
@@ -265,7 +259,7 @@ if ($locking == '1') //1 means nobody is on the website
}
elseif($testStatus == '998' || $testStatus == '802')
{
- $GSMRZ1 = 0; //where is nanoBTS1
+ $GSMRZ1 = 0;
}
}
elseif ($callTo == 'GSMRZ1')
@@ -279,7 +273,7 @@ if ($locking == '1') //1 means nobody is on the website
}
elseif($testStatus == '999' || $testStatus == '801')
{
- $GSMRZ1 = 0; //where is nanoBTS1
+ $GSMRZ1 = 0;
}
}
}
@@ -327,7 +321,7 @@ if ($locking == '1') //1 means nobody is on the website
}
elseif($testStatus == '998' || $testStatus == '802')
{
- $GSMRZ2 = 0; //where is nanoBTS1
+ $GSMRZ2 = 0;
$NANOBTS1P= 1;
}
}
@@ -358,7 +352,7 @@ if ($locking == '1') //1 means nobody is on the website
}
elseif($testStatus == '999' || $testStatus == '801')
{
- $GSMRZ2 = 0; //where is nanoBTS1
+ $GSMRZ2 = 0;
if ($NANOBTS1P != 1)
{
$NANOBTS1P= 2;
@@ -413,7 +407,7 @@ if ($locking == '1') //1 means nobody is on the website
}
elseif($testStatus == '998' || $testStatus == '802')
{
- $GSMRZ3 = 0; //where is nanoBTS1
+ $GSMRZ3 = 0;
$NANOBTS2P= 1;
}
}
@@ -444,7 +438,7 @@ if ($locking == '1') //1 means nobody is on the website
}
elseif($testStatus == '999' || $testStatus == '801')
{
- $GSMRZ3 = 0; //where is nanoBTS1
+ $GSMRZ3 = 0;
if ($NANOBTS1P != 1)
{
$NANOBTS2P= 2;
@@ -909,7 +903,7 @@ if ($locking == '1') //1 means nobody is on the website
<td> ' . $dataForTable[4] . ' </td>
<td>' . $dataForTable[3] . '</td>
</tr>';
- //echo $received . '<br>';
+
echo str_repeat("\n",7024);
flush();
usleep(100);
@@ -941,8 +935,6 @@ if ($locking == '1') //1 means nobody is on the website
echo 'We have an unknown error! Refresh te web page!';
}
- //$release = ReleaseLock($nameOfLock);
- //echo $release . "<br>";
}
else
{
diff --git a/Website/post.php b/Website/post.php
index b01f646..c574768 100644
--- a/Website/post.php
+++ b/Website/post.php
@@ -7,10 +7,10 @@ $sipgsmrz3 = $_REQUEST["sip_gsmrz3"]; //SIP to GSMRZ3
$sipland = $_REQUEST["sip_landln"]; //SIP to landline
$sipuniv = $_REQUEST["sip_sipuniv"]; //SIP to University
-$sipgsmee = $_REQUEST["sip_gsmee"]; //GSMRZ1 to E-Plus
-$sipgsmev = $_REQUEST["sip_gsmev"]; //GSMRZ1 to E-Plus
-$sipgsmet = $_REQUEST["sip_gsmet"]; //GSMRZ1 to E-Plus
-$sipgsmeo = $_REQUEST["sip_gsmeo"]; //GSMRZ1 to E-Plus
+$sipgsmee = $_REQUEST["sip_gsmee"];
+$sipgsmev = $_REQUEST["sip_gsmev"];
+$sipgsmet = $_REQUEST["sip_gsmet"];
+$sipgsmeo = $_REQUEST["sip_gsmeo"];
$gsmrzsip1 = $_REQUEST["gsmrz1_sip"]; //GSMRZ1 to SIP
$gsmrzsip2 = $_REQUEST["gsmrz2_sip"]; //GSMRZ2 to SIP
@@ -46,8 +46,8 @@ $gsmrz3gsmet = $_REQUEST["gsmrz3_gsmet"]; //GSMRZ3 to E-Plus
$gsmrz3gsmeo = $_REQUEST["gsmrz3_gsmeo"]; //GSMRZ3 to E-Plus
-$gsmrz1unisip = $_REQUEST["gsmrz1_unisip"]; //GSMRZ3 to E-Plus
-$gsmrz2unisip = $_REQUEST["gsmrz2_unisip"]; //GSMRZ3 to E-Plus
+$gsmrz1unisip = $_REQUEST["gsmrz1_unisip"]; //GSMRZ1 to E-Plus
+$gsmrz2unisip = $_REQUEST["gsmrz2_unisip"]; //GSMRZ2 to E-Plus
$gsmrz3unisip = $_REQUEST["gsmrz3_unisip"]; //GSMRZ3 to E-Plus
@@ -56,12 +56,6 @@ $taskNo = getNewTaskNo();
$errorAdding = 0;
$taskAmount = 0;
-/*function insertTask($me,$mb,$md)
-{
- echo $me.$mb.$md;
- return 1;
-}*/
-
if($smartStatus == 'on')
{
diff --git a/Website/testCase.php b/Website/testCase.php
index b00189d..fe5c655 100644
--- a/Website/testCase.php
+++ b/Website/testCase.php
@@ -28,21 +28,7 @@ $LANDLINEP = $_GET['SGP'];
$UNISIPP = $_GET['USP'];
$NANOBTS1P = $_GET['NBP1'];
$NANOBTS2P = $_GET['NBP2'];
-/*
-$GSMRZ1 = 0;
-$GSMRZ2 = -10;
-$GSMRZ3 = 10;
-
-$SIP = 4;
-$UNISIP = 0;
-$LANDLINE = 1;
-$LSFKS = 1;
-
-$GSMEE = 10;
-$GSMEV = 10;
-$GSMET = -10;
-$GSMEO = 10;
-*/
+
$GSMEXTCOL = 'icons/box_dunno.png';
$GSMINTCOL = "icons/server_dunno.png";
$LSFKSCOL = "icons/server_dunno.png";
@@ -254,7 +240,5 @@ $SIPPercent = $SIP*100;
$UNISIPPercent = $UNISIP*100;
$LANDLINEPercent = $LANDLINE*100;
-//print_r($GSMINTCOL);
-// add here to set the color for each node after the test ;)
-// setNode(0,$SIPCOL) or something as that :)
+
?>