summaryrefslogtreecommitdiffstats
path: root/Website/mutexTry.php
diff options
context:
space:
mode:
Diffstat (limited to 'Website/mutexTry.php')
-rw-r--r--[-rwxr-xr-x]Website/mutexTry.php47
1 files changed, 27 insertions, 20 deletions
diff --git a/Website/mutexTry.php b/Website/mutexTry.php
index 5579437..f6c22b0 100755..100644
--- a/Website/mutexTry.php
+++ b/Website/mutexTry.php
@@ -1,5 +1,4 @@
-<html>
-<head>
+d>
<script src='delayedLoading.js' type="text/javascript"></script>
<!--ADD HERE ALL THE NEEDED META DATA -->
<title>Network test live results!</title>
@@ -8,10 +7,12 @@
<body onscroll="scrollEvent();" onload="loaderInit();">
<div>
<?php
-
+@apache_setenv('no-gzip',1);
+@ini_set('zlib.output_compression',0);
+@ini_set('implicit_flush',1);
//Connection stuff
//DB
-include 'dbconnection.php'
+include 'dbconnection.php';
//Socket
$port = 34500;
@@ -19,6 +20,7 @@ $ip = 'localhost';
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die('Error connecting to mysql');
+//$dbname = 'gsmselftesting';
mysql_select_db($dbname);
//End of connection stuff
include 'mutexFunctions.php'; //mutex functions, isfree, lock and release
@@ -36,9 +38,12 @@ 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);
@@ -57,7 +62,8 @@ if ($locking == '1') //1 means nobody is on the website
fclose($startApp);
}
- sleep(6); //sleep till the software starts
+ //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!
$softwareRunning1 = isLocked($softwareLock);
@@ -77,6 +83,7 @@ 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))
@@ -119,8 +126,7 @@ if ($locking == '1') //1 means nobody is on the website
</thead>
<!-- start of the table rows-->
<tbody>';
- echo str_repeat("\n",7024);
- flush();
+ ob_implicit_flush(1);
sleep(6);
$pings = mysql_query("select * from PingResultTable where taskNo=(select max(taskNo) from PingResultTable)");
@@ -143,9 +149,8 @@ if ($locking == '1') //1 means nobody is on the website
echo '<div id="sidebar">';
echo "<a class='pChart' href='networkResult.php?S=$SIP&RZ1=$GSMRZ1&RZ2=$GSMRZ2&RZ3=$GSMRZ3&US=$UNISIP&LL=$LANDLINE&LS=$LSFKS&EE=$GSMEE&EV=$GSMEV&ET=$GSMET&EO=$GSMEO&SP=$SIPP&SGP=$LANDLINEP&USP=$UNISIPP&NBP1=$NANOBTS1P&NBP2=$NANOBTS2P&TASKID=$taskNo' data-pchart-alt='Picture3'>Picture 3</a></div>";
echo '<div id="footer"><font size ="3" face="Century Gothic" color="black"> Number of tasks: '.$taskAmount.'<br> Number of tasks tried to add to the DB but had an error: '. $errorAdding .'<br> TEST SUCCESSFULLY FINISHED!</font></div>';
- echo str_repeat("\n",7024);
- flush();
- usleep(100);
+ ob_implicit_flush(1);
+ usleep(100);
fwrite($fp, 'DISCONNECT'); //tell the testing software it may close
break;
}
@@ -157,6 +162,7 @@ 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')
{
@@ -259,7 +265,7 @@ if ($locking == '1') //1 means nobody is on the website
}
elseif($testStatus == '998' || $testStatus == '802')
{
- $GSMRZ1 = 0;
+ $GSMRZ1 = 0; //where is nanoBTS1
}
}
elseif ($callTo == 'GSMRZ1')
@@ -273,7 +279,7 @@ if ($locking == '1') //1 means nobody is on the website
}
elseif($testStatus == '999' || $testStatus == '801')
{
- $GSMRZ1 = 0;
+ $GSMRZ1 = 0; //where is nanoBTS1
}
}
}
@@ -321,7 +327,7 @@ if ($locking == '1') //1 means nobody is on the website
}
elseif($testStatus == '998' || $testStatus == '802')
{
- $GSMRZ2 = 0;
+ $GSMRZ2 = 0; //where is nanoBTS1
$NANOBTS1P= 1;
}
}
@@ -352,7 +358,7 @@ if ($locking == '1') //1 means nobody is on the website
}
elseif($testStatus == '999' || $testStatus == '801')
{
- $GSMRZ2 = 0;
+ $GSMRZ2 = 0; //where is nanoBTS1
if ($NANOBTS1P != 1)
{
$NANOBTS1P= 2;
@@ -407,7 +413,7 @@ if ($locking == '1') //1 means nobody is on the website
}
elseif($testStatus == '998' || $testStatus == '802')
{
- $GSMRZ3 = 0;
+ $GSMRZ3 = 0; //where is nanoBTS1
$NANOBTS2P= 1;
}
}
@@ -438,7 +444,7 @@ if ($locking == '1') //1 means nobody is on the website
}
elseif($testStatus == '999' || $testStatus == '801')
{
- $GSMRZ3 = 0;
+ $GSMRZ3 = 0; //where is nanoBTS1
if ($NANOBTS1P != 1)
{
$NANOBTS2P= 2;
@@ -903,9 +909,8 @@ if ($locking == '1') //1 means nobody is on the website
<td> ' . $dataForTable[4] . ' </td>
<td>' . $dataForTable[3] . '</td>
</tr>';
-
- echo str_repeat("\n",7024);
- flush();
+ //echo $received . '<br>';
+ ob_implicit_flush(1);
usleep(100);
fwrite($fp, "CONTINUE"); //tell the software to proceed with the test and confirm receiving data
}
@@ -935,6 +940,8 @@ 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
{