2 include_spip(
'hyd_inc/form_section.abstract.class');
10 $this->saisies[
'c_hyd'] = array(
13 'rQ' =>array(
'debit', 1.2,
'op'),
14 'rY' =>array(
'tirant_eau', 0.8,
'op')
18 $this->saisies[
'param_calcul'] = array(
21 'rPrec' => array(
'precision',0.001,
'fop')
25 $this->saisies[
'val_a_cal'] = array(
28 'val_a_cal' => array(
'choix_donnee_calc',
'form_calcul_section_valacal',
's')
32 parent::__construct();
40 $valeurs = parent::charger($bFix);
41 $valeurs = array_merge($valeurs,
43 'choix_section' =>
'FT',
45 'choix_champs_select' => $this->champs_select_calc
55 extract($this->data, EXTR_OVERWRITE|EXTR_REFS);
57 if(isset($ValVar) && $ValVar !=
''){
60 $this->oSn->{$ValVar} = &$i;
63 $this->oP->{$ValVar} = &$i;
66 $tVarCal = array($val_a_cal);
67 $this->data[
'ValCal'] = $val_a_cal;
70 $tVarCal = array(
'Hs',
'Hsc',
'B',
'P',
'S',
'R',
'V',
'Fr',
'Yc',
'Yn',
'Yf',
'Yt',
'Yco',
'J',
'I-J',
'Imp',
'Tau0');
75 if(self::DBG) spip_log($tVarCal,
'hydraulic',_LOG_DEBUG);
76 if(self::DBG) spip_log(
"min=$min max=$max pas=$pas",
'hydraulic',_LOG_DEBUG);
78 for($i = $min; $i <= $max; $i+= $pas){
79 $this->oSn->Reset(
true);
81 foreach($tVarCal as $sCalc){
83 if(self::DBG) spip_log(
"i=$i Y=$rY Calc=$sCalc",
'hydraulic',_LOG_DEBUG);
84 if(!in_array($sCalc,array(
'Yn',
'Yc',
'Hsc'))){
85 $tRes[] = $this->oSn->Calc($sCalc);
88 $tRes[] = $this->oSn->CalcGeo($sCalc);
92 if(self::DBG & $bF) spip_log(
"i=$i Y=$rY",
'hydraulic',_LOG_DEBUG);
95 return array(
'abs'=>$tAbs,
'res'=>$tRes,
'tVarCal'=>$tVarCal);
104 if(isset($this->data[
'ValVar']) && $this->data[
'ValVar'] !=
''){
106 return parent::afficher_result();
110 $tRes = $this->result[
'res'];
114 foreach($this->result[
'tVarCal'] as $champ){
115 $tC[$c][] = _T(
'hydraulic:'.$this->champs_select_calc[$champ]);
119 $echo =
'<div style="display:inline-block;">';
124 $lib_datas = array();
126 foreach($this->result[
'tVarCal'] as $champ){
127 if(substr($this->champs_select_calc[$champ], 0, 6) ==
'tirant' || $champ ==
'Hs' || $champ ==
'Hsc'){
128 $lib_datas[$champ] = $tRes[$par];
133 $lib_datas[
'rYB'] = $this->oP->rYB;
134 include_spip(
'hyd_inc/dessinSection.class');
135 $dessinSection =
new dessinSection(250, 400, 100, $this->oSn, $lib_datas);
136 $echo.= $dessinSection->GetDessinSection();
142 $lib = parent::get_champs_libelles();
143 foreach($this->champs_select_calc as $cle=>$champ) {
144 $lib[$cle] = _T(
'hydraulic:'.$champ);
Classe pour l'affichage du dessin des sections.
format_nombre($nombre, $dec)