From aa832eb2994df9b505f0703a3740ebf02c566b7e Mon Sep 17 00:00:00 2001 From: Refik Hadzialic Date: Wed, 7 Sep 2011 20:03:06 +0200 Subject: Added more devices to the result picture! --- notFinishedCode/web/example.drawFilledCircle.php | 111 ++++++++++++++++++----- notFinishedCode/web/testCase.php | 30 +++--- 2 files changed, 105 insertions(+), 36 deletions(-) diff --git a/notFinishedCode/web/example.drawFilledCircle.php b/notFinishedCode/web/example.drawFilledCircle.php index 558a0d8..e3735dc 100644 --- a/notFinishedCode/web/example.drawFilledCircle.php +++ b/notFinishedCode/web/example.drawFilledCircle.php @@ -19,7 +19,7 @@ } /* Create the pChart object */ - $myPicture = new pImage(700,230); + $myPicture = new pImage(700,430); /* Draw the background */ $Settings = array("R"=>170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107); @@ -27,11 +27,11 @@ /* Overlay with a gradient */ $Settings = array("StartR"=>219, "StartG"=>231, "StartB"=>139, "EndR"=>1, "EndG"=>138, "EndB"=>68, "Alpha"=>50); - $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,$Settings); + $myPicture->drawGradientArea(0,0,700,430,DIRECTION_VERTICAL,$Settings); $myPicture->drawGradientArea(0,0,700,20,DIRECTION_VERTICAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>80)); /* Add a border to the picture */ - $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); + $myPicture->drawRectangle(0,0,699,429,array("R"=>0,"G"=>0,"B"=>0)); /* Write the picture title */ $myPicture->setFontProperties(array("FontName"=>"fonts/Silkscreen.ttf","FontSize"=>6)); @@ -41,44 +41,53 @@ //CONNECTIONS /* BTS PICTURE INTERNAL CONNECTIONS */ - $myPicture->drawLine(80,70,185,130,$BTS1PING); //BTS1 PING - $myPicture->drawLine(75,125,185,125,$BTS2PING); //BTS2 PING - $myPicture->drawLine(75,188,185,120,$BTS2PING); //BTS3 PING + $myPicture->drawLine(80,170,185,230,$BTS1PING); //BTS1 PING + $myPicture->drawLine(75,225,185,225,$BTS2PING); //BTS2 PING + $myPicture->drawLine(75,288,185,220,$BTS2PING); //BTS3 PING + /*GSMBOX LINES */ + $myPicture->drawLine(181,65,299,150); //BTS3 PING + $myPicture->drawLine(250,65,308,150); //BTS3 PING + $myPicture->drawLine(347,65,309,150); //BTS3 PING + $myPicture->drawLine(410,70,316,150); //BTS3 PING + + $arrowSettings = array("FillR"=>2.5,"FillG"=>2.5,"FillB"=>2.5,"Ticks"=>1, "TwoHeads"=>TRUE); + $myPicture->drawArrow(303,209,303,161,$arrowSettings); + //IAX $arrowSettings = array("FillR"=>2.5,"FillG"=>2.5,"FillB"=>2.5,"Ticks"=>1, "TwoHeads"=>TRUE); - $myPicture->drawArrow(192,120,297,120,$arrowSettings); + $myPicture->drawArrow(192,220,297,220,$arrowSettings); /* Write some text */ $myPicture->setFontProperties(array("FontName"=>"fonts/verdana.ttf","FontSize"=>7)); $TextSettings = array("BoxRounded"=>TRUE,"R"=>0,"G"=>0,"B"=>0,"Angle"=>0,"FontSize"=>7); - $myPicture->drawText(235,118,"IAX",$TextSettings); + $myPicture->drawText(235,218,"IAX",$TextSettings); //###################################### //BTS1 - $Points = Triangle(74,55); + $Points = Triangle(74,155); $myPicture->drawPolygon($Points, $BTS1COL); /* Write some text */ $myPicture->setFontProperties(array("FontName"=>"fonts/verdana.ttf","FontSize"=>7)); $TextSettings = array("DrawBox"=>TRUE,"BoxRounded"=>TRUE,"R"=>0,"G"=>0,"B"=>0,"Angle"=>0,"FontSize"=>7); - $myPicture->drawText(10,69,"nanoBTS0",$TextSettings); + $myPicture->drawText(10,169,"nanoBTS0",$TextSettings); //################################## //BTS2 - $Points = Triangle(74,115); + $Points = Triangle(74,215); $myPicture->drawPolygon($Points, $BTS2COL); /* Write some text */ $myPicture->setFontProperties(array("FontName"=>"fonts/verdana.ttf","FontSize"=>7)); $TextSettings = array("DrawBox"=>TRUE,"BoxRounded"=>TRUE,"R"=>0,"G"=>0,"B"=>0,"Angle"=>0,"FontSize"=>7); - $myPicture->drawText(10,129,"nanoBTS1",$TextSettings); + $myPicture->drawText(10,229,"nanoBTS1",$TextSettings); //################################### //BTS3 - $Points = Triangle(74,175); + $Points = Triangle(74,275); $myPicture->drawPolygon($Points, $BTS3COL); /* Write some text */ $myPicture->setFontProperties(array("FontName"=>"fonts/verdana.ttf","FontSize"=>7)); $TextSettings = array("DrawBox"=>TRUE,"BoxRounded"=>TRUE,"R"=>0,"G"=>0,"B"=>0,"Angle"=>0,"FontSize"=>7); - $myPicture->drawText(10,189,"nanoBTS3",$TextSettings); + $myPicture->drawText(10,289,"nanoBTS3",$TextSettings); //################################### @@ -87,11 +96,11 @@ /* Turn on shadow computing */ $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); /* Draw a PNG object */ - $myPicture->drawFromPNG(295,110,$LSFKSCOL); + $myPicture->drawFromPNG(295,210,$LSFKSCOL); /* Write some text */ $myPicture->setFontProperties(array("FontName"=>"fonts/verdana.ttf","FontSize"=>7)); $TextSettings = array("DrawBox"=>TRUE,"BoxRounded"=>TRUE,"R"=>0,"G"=>0,"B"=>0,"Angle"=>0,"FontSize"=>7); - $myPicture->drawText(270,157," LsfKs-Asterisk",$TextSettings); + $myPicture->drawText(270,257," LsfKs-Asterisk",$TextSettings); //############################### @@ -99,15 +108,75 @@ /* Turn on shadow computing */ $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); /* Draw a PNG object */ - $myPicture->drawFromPNG(171,110,$GSMINTCOL); + $myPicture->drawFromPNG(171,210,$GSMINTCOL); + /* Write some text */ + $myPicture->setFontProperties(array("FontName"=>"fonts/verdana.ttf","FontSize"=>7)); + $TextSettings = array("DrawBox"=>TRUE,"BoxRounded"=>TRUE,"R"=>0,"G"=>0,"B"=>0,"Angle"=>0,"FontSize"=>7); + $myPicture->drawText(155,275," OpenBSC \r\n LCR \r\n Asterisk",$TextSettings); + //############################### + + + //E-plus + /* Turn on shadow computing */ + $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); + /* Draw a PNG object */ + $myPicture->drawFromPNG(171,50,$GSMEECOL); + /* Write some text */ + $myPicture->setFontProperties(array("FontName"=>"fonts/verdana.ttf","FontSize"=>7)); + $TextSettings = array("DrawBox"=>TRUE,"BoxRounded"=>TRUE,"R"=>0,"G"=>0,"B"=>0,"Angle"=>0,"FontSize"=>7); + $myPicture->drawText(171,40,"E-Plus",$TextSettings); + //############################### + + + //Vodaphone + /* Turn on shadow computing */ + $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); + /* Draw a PNG object */ + $myPicture->drawFromPNG(231,50,$GSMEVCOL); /* Write some text */ $myPicture->setFontProperties(array("FontName"=>"fonts/verdana.ttf","FontSize"=>7)); $TextSettings = array("DrawBox"=>TRUE,"BoxRounded"=>TRUE,"R"=>0,"G"=>0,"B"=>0,"Angle"=>0,"FontSize"=>7); - $myPicture->drawText(155,175," OpenBSC \r\n LCR \r\n Asterisk",$TextSettings); + $myPicture->drawText(218,40,"Vodafone",$TextSettings); //############################### -/* Draw a customized filled circles */ - $CircleSettings = array("R"=>209,"G"=>31,"B"=>27,"Alpha"=>100,"Surrounding"=>30); - $myPicture->drawFilledCircle(480,60,19,$CircleSettings); + + + //T-mobile + /* Turn on shadow computing */ + $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); + /* Draw a PNG object */ + $myPicture->drawFromPNG(336,50,$GSMETCOL); + /* Write some text */ + $myPicture->setFontProperties(array("FontName"=>"fonts/verdana.ttf","FontSize"=>7)); + $TextSettings = array("DrawBox"=>TRUE,"BoxRounded"=>TRUE,"R"=>0,"G"=>0,"B"=>0,"Angle"=>0,"FontSize"=>7); + $myPicture->drawText(330,40,"T-Mobile",$TextSettings); + //############################### + + + //O2 + /* Turn on shadow computing */ + $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); + /* Draw a PNG object */ + $myPicture->drawFromPNG(396,50,$GSMEOCOL); + /* Write some text */ + $myPicture->setFontProperties(array("FontName"=>"fonts/verdana.ttf","FontSize"=>7)); + $TextSettings = array("DrawBox"=>TRUE,"BoxRounded"=>TRUE,"R"=>0,"G"=>0,"B"=>0,"Angle"=>0,"FontSize"=>7); + $myPicture->drawText(404,40,"02",$TextSettings); + //############################### + + + //GSMBOX + /* Turn on shadow computing */ + $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); + /* Draw a PNG object */ + $myPicture->drawFromPNG(293,140,$GSMEXTCOL); + /* Write some text */ + $myPicture->setFontProperties(array("FontName"=>"fonts/verdana.ttf","FontSize"=>7)); + $TextSettings = array("DrawBox"=>TRUE,"BoxRounded"=>TRUE,"R"=>0,"G"=>0,"B"=>0,"Angle"=>0,"FontSize"=>7); + $myPicture->drawText(238,157,"GSM-Box",$TextSettings); + //############################### + + + /* Render the picture (choose the best way) */ $myPicture->autoOutput("example.drawFilledCircle.png"); diff --git a/notFinishedCode/web/testCase.php b/notFinishedCode/web/testCase.php index 4012c09..7b8f513 100644 --- a/notFinishedCode/web/testCase.php +++ b/notFinishedCode/web/testCase.php @@ -18,7 +18,7 @@ $GSMEV = 0; $GSMET = 0; $GSMEO = 0; -$GSMEXTCOL = $colorDunno; +$GSMEXTCOL = 'icons/box_dunno.png'; $GSMINTCOL = "icons/server_dunno.png"; $LSFKSCOL = "icons/server_dunno.png"; @@ -30,10 +30,10 @@ $BTS1COL = $colorDunno; $BTS2COL = $colorDunno; $BTS3COL = $colorDunno; -$GSMEECOL = $colorDunno; -$GSMEVCOL = $colorDunno; -$GSMETCOL = $colorDunno; -$GSMEOCOL = $colorDunno; +$GSMEECOL = 'icons/blackberry_dunno.png'; +$GSMEVCOL = 'icons/blackberry_dunno.png'; +$GSMETCOL = 'icons/blackberry_dunno.png'; +$GSMEOCOL = 'icons/blackberry_dunno.png'; $BTS1PING = array("R"=>255,"G"=>0,"B"=>0); //put here the color :) @@ -86,11 +86,11 @@ elseif($UNISIP < 0) if($GSMEE > 0 || $GSMEV > 0 || $GSMET > 0 || $GSMEO > 0) { - $GSMEXTCOL = $colorWork; + $GSMEXTCOL = 'icons/box_work.png'; } elseif($GSMEE < 0 || $GSMEV < 0 || $GSMET < 0 || $GSMEO < 0) { - $GSMEXTCOL = $colorFail; + $GSMEXTCOL = 'icons/box_fail.png'; } if($GSMRZ1 > 0) @@ -122,38 +122,38 @@ elseif($GSMRZ3 < 0) if($GSMEE > 0) { - $GSMEECOL = $colorWork; + $GSMEECOL = 'icons/blackberry_work.png'; } elseif($GSMEE < 0) { - $GSMEECOL = $colorFail; + $GSMEECOL = 'icons/blackberry_fail.png'; } if($GSMEV > 0) { - $GSMEVCOL = $colorWork; + $GSMEVCOL = 'icons/blackberry_work.png'; } elseif($GSMEV < 0) { - $GSMEVCOL = $colorFail; + $GSMEVCOL = 'icons/blackberry_fail.png'; } if($GSMET > 0) { - $GSMETCOL = $colorWork; + $GSMETCOL = 'icons/blackberry_work.png'; } elseif($GSMET < 0) { - $GSMETCOL = $colorFail; + $GSMETCOL = 'icons/blackberry_fail.png'; } if($GSMEO > 0) { - $GSMEOCOL = $colorWork; + $GSMEOCOL = 'icons/blackberry_work.png'; } elseif($GSMEO < 0) { - $GSMEOCOL = $colorFail; + $GSMEOCOL = 'icons/blackberry_fail.png'; } -- cgit v1.2.3-55-g7522