Poles.php source code
Contents of file
yurtparts/Poles.php
1
<?php
2 // Software released under the General Public License (version 2 or later), available at
3 // http://www.gnu.org/copyleft/gpl.html
4 //********************************************************************************
5 /**
6 Calcul de la longueur des perches
7
8 @version 1.0
9 @license GPL
10 @author Thierry Graff
11 @weblink http://www.tig12.net
12 @php PHP5
13 @history 2007.05.24, 0h40 : Creation
14 @history 2007.06.12 : transformation to a class
15 ****************************************************************************************/
16 require_once(dirname(dirname(__FILE__)) . '/YurtPart.php');
17
18 class Poles extends YurtPart{
19
20 public function toHtml($params=''){
21 $D = $this->yurt->getConfig('general', 'D'); // rayon de la yourte, en m
22 $dc = $this->yurt->getConfig('general', 'dc'); // rayon de la couronne, en m
23 $etas = $this->yurt->getConfig('walls', 'etas'); // epaisseur des tasseaux du treillis, en m
24
25 $alpha = $this->yurt->getConfig('general', 'alpha'); // angle du toit, en rad
26 $eiv = $this->yurt->getConfig('general', 'eiv'); // epaisseur de l'isolation verticale, en m
27 $lpc = $this->yurt->getConfig('crown', 'lpc'); // longueur de perche dans la couronne, en m
28 $dpc = $this->yurt->getConfig('crown', 'dpc'); // diametre de perche dans la couronne, en m --- inutile pour le calcul, juste pour affichage
29 $lpd = $this->yurt->getConfig('poles', 'lpd'); // longueur de perche qui dépasse, en m
30
31 // calculs, en m
32 //$alpha = $alpha * M_PI / 180; // radians
33 $R = $D / 2;
34 $rc = $dc / 2;
35 $lp1 = ($R - $rc) / cos($alpha);
36 $lpi = $eiv / cos($alpha);
37 $lpt = $etas / cos($alpha);
38 $lp = $lpc + $lp1 + $lpi + $lpd;
39 // Store $lp in $results because $lp can be used by LinenRoof
40 $this->yurt->setResults('poles', 'lp', $lp);
41
42 // Affichage des résultats
43 $res = '';
44 $res .= "<table>\n";
45 //
46 $res .= "<tr><th colspan='2'>Longueurs</th></tr>\n";
47 $res .= "<tr><td valign='top'><b>Longueur totale d'une perche</b></td><td valign='top'><b>lp = "
48 . round(self::m2cm($lp), 1) . " cm</b></td></tr>\n";
49 $res .= "<tr><td valign='top'>Longueur de perche dans la couronne</td><td valign='top'><b>lpc = "
50 . round(self::m2cm($lpc), 1) . " cm</b></td></tr>\n";
51 $res .= "<tr><td valign='top'>Diamètre d'une perche dans la couronne</td><td valign='top'><b>dpc = "
52 . round(self::m2cm($dpc), 1) . " cm</b></td></tr>\n";
53 $res .= "<tr><td valign='top'>Longueur entre couronne et treillis</td><td valign='top'><b>lp1 = "
54 . round(self::m2cm($lp1), 1) . " cm</b></td></tr>\n";
55 $res .= "<tr><td valign='top'>Longueur sur l'épaisseur du treillis</td><td valign='top'><b>lpt = "
56 . round(self::m2cm($lpt), 1) . " cm</b>"
57 . "<br/>2 * lpt = " . round(self::m2cm(2*$lpt), 1) . " cm</td></tr>\n";
58 $res .= "<tr><td valign='top'>Longueur sur isolant vertical</td><td valign='top'><b>lpi = "
59 . round(self::m2cm($lpi), 1) . " cm</b></td></tr>\n";
60 $res .= "<tr><td valign='top'>Longueur de dépassement</td><td valign='top'><b>lpd = "
61 . round(self::m2cm($lpd), 1) . " cm</b></td></tr>\n";
62 //
63 $res .= "<tr><th colspan='2'>Trous</th></tr>\n";
64 $res .= "<tr><td valign='top'>Trou en E</td><td valign='top'><b>"
65 . round(self::m2cm($lpd), 1) . " cm</b></td></tr>\n";
66 $res .= "<tr><td valign='top'>Trou en D</td><td valign='top'><b>"
67 . round(self::m2cm($lpd + $lpi), 1) . " cm</b></td></tr>\n";
68 $res .= "</table>\n";
69 return $res;
70 }// end toHtml
71
72 }// end class Poles
73
74
75 ?>