summaryrefslogtreecommitdiffstats
path: root/notFinishedCode/pChart2.1.2/examples/example.writeBounds.php
blob: cd4d29bbd7dd5947cc60f40a93de4c357050d38c (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
<?php   
 /* CAT:Misc */

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

 /* Create the pChart object */
 $myPicture = new pImage(800,700); //result image size
 $myPicture->drawGradientArea(0,0,800,700,DIRECTION_VERTICAL,array("StartR"=>100,"StartG"=>100,"StartB"=>100,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>100));//make gradient
 $myPicture->drawGradientArea(0,0,800,700,DIRECTION_HORIZONTAL,array("StartR"=>100,"StartG"=>100,"StartB"=>100,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>20));//make gradient
 $myPicture->drawGradientArea(0,0,60,700,DIRECTION_HORIZONTAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>100));//black gradient field on left

 /* Do some cosmetics, add the black outlining and the name of the picture on left side*/
 $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10));
 $myPicture->drawLine(60,0,60,230,array("R"=>70,"G"=>70,"B"=>70));
 $myPicture->drawRectangle(0,0,799,699,array("R"=>0,"G"=>0,"B"=>0));
 $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>11));
 $myPicture->drawText(30,500,"Network test results - UNIVERSITY OF FREIBURG",array("R"=>255,"G"=>255,"B"=>255,"FontSize"=>20,"Angle"=>90,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE));



 //Our university GSM system outlining!
 $RectangleSettings = array("R"=>137,"G"=>202,"B"=>230,"Alpha"=>20); 
 $myPicture->drawFilledRectangle(63,10,245,590,$RectangleSettings); 
 //                   x1, y1,  x2, y2

 //BTS1
 $myPicture->drawLine(220, 90,420,330,array("R"=>0,"G"=>255,"B"=>0,"Ticks"=>8,"Weight"=>1));  
 $myPicture->drawFromPNG(180,60,"BTSCont.png");
 $myPicture->drawFromPNG(60,12,"newIcons/BTSOK3.png"); 

 $myPicture->setFontProperties(array("FontName"=>"../fonts/verdana.ttf","FontSize"=>6)); 
 $TextSettings = array("DrawBox"=>FALSE,"R"=>255,"G"=>255,"B"=>255,"Angle"=>0,"FontSize"=>10); 
 $myPicture->drawText(70,140,"BTS1 STATUS: OK",$TextSettings);  


 //BTS2
 $myPicture->drawLine(220, 320, 420,320,array("R"=>0,"G"=>255,"B"=>0,"Ticks"=>8,"Weight"=>1));  
 $myPicture->drawFromPNG(180,280,"BTSCont.png"); 
 $myPicture->drawFromPNG(60,230,"newIcons/BTSNOK3.png"); 

 $myPicture->setFontProperties(array("FontName"=>"../fonts/verdana.ttf","FontSize"=>6)); 
 $TextSettings = array("DrawBox"=>FALSE,"R"=>255,"G"=>0,"B"=>0,"Angle"=>0,"FontSize"=>10); 
 $myPicture->drawText(70,360,"BTS2 STATUS: NOT OK",$TextSettings);  

 
 //BTS3
 $myPicture->drawLine(200, 550,420,380,array("R"=>0,"G"=>255,"B"=>0,"Ticks"=>8,"Weight"=>1));  
 $myPicture->drawFromPNG(180,500,"BTSCont.png");
 $myPicture->drawFromPNG(60,450,"newIcons/BTSOK3.png"); 

 $myPicture->setFontProperties(array("FontName"=>"../fonts/verdana.ttf","FontSize"=>6)); 
 $TextSettings = array("DrawBox"=>FALSE,"R"=>255,"G"=>255,"B"=>255,"Angle"=>0,"FontSize"=>10); 
 $myPicture->drawText(70,580,"BTS3 STATUS: OK",$TextSettings);  




 //landline system outlining!
 $RectangleSettings = array("R"=>238,"G"=>243,"B"=>90,"Alpha"=>20); 
 $myPicture->drawFilledRectangle(340,480,530,615,$RectangleSettings); 
 //line to landline
 $myPicture->drawLine(430, 390,430,520,array("R"=>0,"G"=>255,"B"=>0,"Ticks"=>8,"Weight"=>1));  
 $myPicture->drawFromPNG(370,480,"newIcons/landline.png"); 

 $myPicture->setFontProperties(array("FontName"=>"../fonts/verdana.ttf","FontSize"=>6)); 
 $TextSettings = array("DrawBox"=>FALSE,"R"=>255,"G"=>255,"B"=>255,"Angle"=>0,"FontSize"=>10); 
 $myPicture->drawText(340,611,"LANDLINE STATUS: OK",$TextSettings);  




 
 //external GSM system outlining!
 $RectangleSettings = array("R"=>124,"G"=>229,"B"=>129,"Alpha"=>20); 
 $myPicture->drawFilledRectangle(320,10,540,160,$RectangleSettings); 
 //external GSM network
 $myPicture->drawLine(430, 60,430,300,array("R"=>0,"G"=>255,"B"=>0,"Ticks"=>8,"Weight"=>1));  
 $myPicture->drawFromPNG(390,30,"newIcons/externalCells.png"); 

 
 $myPicture->setFontProperties(array("FontName"=>"../fonts/verdana.ttf","FontSize"=>6)); 
 $TextSettings = array("DrawBox"=>FALSE,"R"=>255,"G"=>255,"B"=>255,"Angle"=>0,"FontSize"=>10); 
 $myPicture->drawText(324,30,"EXTERNAL GSM NETWORK: OK",$TextSettings);  



 //external SIP system outlining!
 $RectangleSettings = array("R"=>124,"G"=>229,"B"=>129,"Alpha"=>20); 
 $myPicture->drawFilledRectangle(580,10,795,160,$RectangleSettings); 
 //external SIP network
 $myPicture->drawLine(695, 90,480,300,array("R"=>0,"G"=>255,"B"=>0,"Ticks"=>8,"Weight"=>1));  
 $myPicture->drawFromPNG(650,45,"newIcons/SIPEXT.png"); 

 $myPicture->setFontProperties(array("FontName"=>"../fonts/verdana.ttf","FontSize"=>6)); 
 $TextSettings = array("DrawBox"=>FALSE,"R"=>255,"G"=>255,"B"=>255,"Angle"=>0,"FontSize"=>10); 
 $myPicture->drawText(585,30,"SIP SYSTEM: OK",$TextSettings);  
 

 //local SIP system outlining!
 $RectangleSettings = array("R"=>137,"G"=>202,"B"=>230,"Alpha"=>20); 
 $myPicture->drawFilledRectangle(580,250,795,400,$RectangleSettings); 
 //local SIP network
 $myPicture->drawLine(695, 330,480,330,array("R"=>0,"G"=>255,"B"=>0,"Ticks"=>8,"Weight"=>1));  
 $myPicture->drawFromPNG(650,280,"newIcons/SIPLOC.png"); 
 
 $myPicture->setFontProperties(array("FontName"=>"../fonts/verdana.ttf","FontSize"=>6)); 
 $TextSettings = array("DrawBox"=>FALSE,"R"=>255,"G"=>255,"B"=>255,"Angle"=>0,"FontSize"=>10); 
 $myPicture->drawText(585,270,"UNI TELEPHONE SYSTEM: OK",$TextSettings);  

 // add server picture
 $myPicture->drawFromPNG(380,280,"server.png"); 

//are the subsystems completely OK
 //GSM External modem 
 $myPicture->drawFromPNG(300,135,"newIcons/OK.png");
 //landline system
 $myPicture->drawFromPNG(505,580,"newIcons/OK.png");
 //GSM Local network
 $myPicture->drawFromPNG(220,560,"newIcons/NOK.png");
 //SIP external network
 $myPicture->drawFromPNG(558,135,"newIcons/OK.png");
 //SIP local network
 $myPicture->drawFromPNG(558,375,"newIcons/OK.png");
 
 /* Write a legend box */  
 $RectangleSettings = array("R"=>255,"G"=>255,"B"=>255,"Ticks"=>2, "Alpha"=>99); 
 $myPicture->drawRectangle(61,630,799,698,$RectangleSettings); 
 //make the legend title
 $myPicture->setFontProperties(array("FontName"=>"../fonts/verdana.ttf","FontSize"=>10));
 $TextSettings = array("DrawBox"=>FALSE,"R"=>255,"G"=>255,"B"=>255,"Angle"=>0,"FontSize"=>12);
 $myPicture->drawText(65,645,"LEGEND:",$TextSettings);
// $myPicture->drawFromPNG(65,637,"newIcons/Help1.png");
 $myPicture->drawLine(70,660,90,660,array("R"=>0,"G"=>255,"B"=>0,"Ticks"=>8,"Weight"=>1)); 
 $myPicture->setFontProperties(array("FontName"=>"../fonts/verdana.ttf","FontSize"=>8));
 $TextSettings = array("DrawBox"=>FALSE,"R"=>255,"G"=>255,"B"=>255,"Angle"=>0,"FontSize"=>10);
 $myPicture->drawText(97,668,"Physical connection OK",$TextSettings);


 $myPicture->drawLine(70,680,90,680,array("R"=>255,"G"=>0,"B"=>0,"Ticks"=>8,"Weight"=>1)); 
 $myPicture->setFontProperties(array("FontName"=>"../fonts/verdana.ttf","FontSize"=>8));
 $TextSettings = array("DrawBox"=>FALSE,"R"=>255,"G"=>255,"B"=>255,"Angle"=>0,"FontSize"=>10);
 $myPicture->drawText(97,688,"Physical connection NOT OK",$TextSettings);


 $myPicture->drawFromPNG(310,642,"newIcons/OKlittle.png");
 $myPicture->setFontProperties(array("FontName"=>"../fonts/verdana.ttf","FontSize"=>8));
 $TextSettings = array("DrawBox"=>FALSE,"R"=>255,"G"=>255,"B"=>255,"Angle"=>0,"FontSize"=>10);
 $myPicture->drawText(337,661,"Subsytem is OK",$TextSettings);

 $myPicture->drawFromPNG(310,670,"newIcons/NOKlittle.png");
 $myPicture->setFontProperties(array("FontName"=>"../fonts/verdana.ttf","FontSize"=>8));
 $TextSettings = array("DrawBox"=>FALSE,"R"=>255,"G"=>255,"B"=>255,"Angle"=>0,"FontSize"=>10);
 $myPicture->drawText(337,689,"Subsytem is NOT OK",$TextSettings);


 $myPicture->drawFromPNG(490,642,"newIcons/BTSOK3little.png");
 $myPicture->setFontProperties(array("FontName"=>"../fonts/verdana.ttf","FontSize"=>8));
 $TextSettings = array("DrawBox"=>FALSE,"R"=>255,"G"=>255,"B"=>255,"Angle"=>0,"FontSize"=>10);
 $myPicture->drawText(517,661,"BTS is OK",$TextSettings);

 $myPicture->drawFromPNG(490,670,"newIcons/BTSNOK3little.png");
 $myPicture->setFontProperties(array("FontName"=>"../fonts/verdana.ttf","FontSize"=>8));
 $TextSettings = array("DrawBox"=>FALSE,"R"=>255,"G"=>255,"B"=>255,"Angle"=>0,"FontSize"=>10);
 $myPicture->drawText(517,689,"BTS is NOT OK",$TextSettings);


 $myPicture->setFontProperties(array("FontName"=>"../fonts/verdana.ttf","FontSize"=>8));
 $TextSettings = array("DrawBox"=>FALSE,"R"=>255,"G"=>255,"B"=>255,"Angle"=>0,"FontSize"=>10);
 $myPicture->drawText(637,661,"White labels are OK",$TextSettings);

 $myPicture->setFontProperties(array("FontName"=>"../fonts/verdana.ttf","FontSize"=>8));
 $TextSettings = array("DrawBox"=>FALSE,"R"=>255,"G"=>0,"B"=>0,"Angle"=>0,"FontSize"=>10);
 $myPicture->drawText(637,689,"Red labels are NOT OK",$TextSettings);

 /* Render the picture (choose the best way) */
 $myPicture->autoOutput("pictures/example.writeBounds.png");
?>