summaryrefslogtreecommitdiffstats
path: root/notFinishedCode/web/example.drawFilledCircle.php
blob: e3735dc89400b33e07d4792bc6c9fef335593cff (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<?php   
 /* CAT:Drawing */

 /* pChart library inclusions */
 include("class/pDraw.class.php");
 include("class/pImage.class.php");

 //test case php defined for defining the colors and what's OK and what's wrong!
 include 'testCase.php';

 //Triangle function used for defining a triangle, used later to draw a triangle polygon!
 function Triangle($x,$y)
 {
    $Bx = $x - 7;
    $By = $y + 18;
    $Cx = $x + 7;
    $Cy = $y + 18;
    return array($x,$y,$Bx,$By,$Cx,$Cy);
 }

 /* Create the pChart object */
 $myPicture = new pImage(700,430);

 /* Draw the background */
 $Settings = array("R"=>170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107);
// $myPicture->drawFilledRectangle(0,0,700,230,$Settings);

 /* 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,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,429,array("R"=>0,"G"=>0,"B"=>0));
 
 /* Write the picture title */ 
 $myPicture->setFontProperties(array("FontName"=>"fonts/Silkscreen.ttf","FontSize"=>6));
 $myPicture->drawText(10,13,"Network Test Results - UNI FREIBURG",array("R"=>255,"G"=>255,"B"=>255));



 //CONNECTIONS
 /* BTS PICTURE INTERNAL CONNECTIONS */ 
 $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,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,218,"IAX",$TextSettings);
 //######################################

 //BTS1
 $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,169,"nanoBTS0",$TextSettings);
 //##################################

 //BTS2
 $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,229,"nanoBTS1",$TextSettings);
 //###################################

 //BTS3
 $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,289,"nanoBTS3",$TextSettings);
 //###################################



 //LsfKs-Asterisk 
 /* 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,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,257," LsfKs-Asterisk",$TextSettings);
 //###############################

 
 //Open BSC 
 /* 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,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(218,40,"Vodafone",$TextSettings);
 //###############################


 //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");
?>