Seleccion_Atenuedores_General.php 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953
  1. <?php
  2. /*
  3. Plantilla para generar PDF
  4. 2019. Servicios Corporativos y Soluciones en CFDI S de RL de CV
  5. Versi�n 1.0
  6. �ltima Actualizaci�n: 20/05/2019
  7. Developer: Fernando A. Jacobo
  8. Tester: Fernando A. Jacobo
  9. IT Leader: Jorge H. Fierro
  10. �ltima modificaci�n: Fernando A. Jacobo
  11. */
  12. include_once('shared/fpdf/fpdf.php');
  13. class crearPDF extends FPDF {
  14. public $tipoPDF;
  15. public $datosEntrada;
  16. public $conversiones;
  17. public $datosLw;
  18. public $datosKw;
  19. public $sonidoRegenerado;
  20. public $correcionArea;
  21. public $sonidoMasCorreccion;
  22. public $LwAVentilador;
  23. public $LwAVentiladorA;
  24. public $areaDeSalida;
  25. public $velocidadDeFluido;
  26. public $datosLwFinal;
  27. public $sumaLogLwFinal;
  28. public $datosLwA;
  29. public $sumaLogaritmicaLwA;
  30. public $presionSonora;
  31. public $presionSonoraA;
  32. public $DatosLwFinalVa;
  33. public $sumaLogaritmicaLwFinalVa;
  34. public $DatosLwAVa;
  35. public $sumaLogaritmicaLwAVa;
  36. public $presionSonoraVa;
  37. public $presionSonoraAVa;
  38. public $datosAtenuadores;
  39. public $p;
  40. public $narch;
  41. /*public function __construct(){
  42. $this->FPDF('P', 'mm', 'Letter');
  43. }*/
  44. function Header() {
  45. $this->SetFont('Arial','B',6);
  46. $bordes = 0;
  47. $areaDeTrabajo = 200;
  48. $arrXpos = array(30, 90, 13, 11);
  49. // Logo Corporativo Soler & Palau
  50. $this->SetY(30);
  51. $this->SetX(10);
  52. $rfcSoler = 'SPA861201DK4';
  53. if ( file_exists( 'shared/imagenes/' . $rfcSoler . '_PDF_LOGOCORPORATIVO.png' ) ) {
  54. $this->Image( 'shared/imagenes/' . $rfcSoler . '_PDF_LOGOCORPORATIVO.png', 10, 17, 50, 19 );
  55. }
  56. // Logo Soler & Palau Ventilation
  57. $this->SetY(30);
  58. $this->SetX(2);
  59. if ( file_exists( 'shared/imagenes/' . $rfcSoler . '_PDF.jpg' ) ) {
  60. $this->Image( 'shared/imagenes/' . $rfcSoler . '_PDF.jpg', 165, 10, 40, 20 );
  61. }
  62. //Texto Fijo
  63. $this->SetY(30);
  64. $this->SetX(165);
  65. $this->SetFont('Arial', '', 7);
  66. $strTexto = 'http://www.solerpalau.mx';
  67. $this->Cell( 40, 5, $strTexto, $bordes, 1, 'L');
  68. $this->SetX(165);
  69. $strTexto = 'comercialmx@solerpalau.com';
  70. $this->Cell( 40, 5, $strTexto, $bordes, 1, 'L');
  71. //Datos de columna A
  72. $this->SetFont('Arial', '', 7);
  73. $this->SetY(23);
  74. $this->SetX($arrXpos[0]);
  75. // Domicilio Fiscal
  76. $strTemporal = '';
  77. $strTemporal .= 'Boulevard A, 15';
  78. $strTemporal = trim($strTemporal);
  79. $strTemporal = trim($strTemporal, ',');
  80. $this->Cell(80, 3, $strTemporal, $bordes, 1, 'L');
  81. $this->SetX($arrXpos[0]);
  82. $strTemporal = 'Col. Parque Industrial Puebla 2000';
  83. $strTemporal = trim($strTemporal);
  84. $strTemporal = trim($strTemporal, ',');
  85. $this->Cell(80, 3, $strTemporal, $bordes, 1, 'L');
  86. $this->SetX($arrXpos[0]);
  87. $strTemporal = 'Puebla, Puebla, Mexico, C.P. 72225';
  88. $strTemporal = trim($strTemporal);
  89. $strTemporal = trim($strTemporal, ',');
  90. $this->SetX($arrXpos[0]);
  91. $this->Cell(80, 3, $strTemporal, $bordes, 1, 'L');
  92. // N�mero telef�nico
  93. $this->SetX($arrXpos[0]);
  94. $this->Cell(80, 3, 'Tel. (222) 223 3900, 223 3911', $bordes, 1, 'L');
  95. // R.F.C.
  96. $this->SetX($arrXpos[0]);
  97. $this->Cell(80, 3, 'R.F.C.: SPA861201DK4', $bordes, 1, 'L');
  98. // R�gimen Fiscal
  99. $this->SetX($arrXpos[0]);
  100. $strTemporal = utf8_decode('R�gimen Fiscal: 601 - General de Ley Personas Morales');
  101. $this->Cell(80, 3, $strTemporal, $bordes, 1, 'L');
  102. $this->Ln(3);
  103. if ( $this->PageNo() == "1" ) {
  104. // T�tulo del pdf
  105. $this->SetX(10);
  106. $this->SetFont('Arial', 'B', 14);
  107. $this->Cell( $areaDeTrabajo, 5, utf8_decode('SELECCI�N DE ATENUADOR'), $bordes, 1, 'C');
  108. $this->Ln(3);
  109. $y = $this->GetY();
  110. $bordes = 0;
  111. //Dibuja parte superior izquierda y derecha del cuadro
  112. $this->SetY($y);
  113. $this->SetX($arrXpos[3]);
  114. $this->Cell(2, 2, '', 'TL', 'C');
  115. $this->SetX($arrXpos[3] + 70);
  116. $this->Cell(2, 2, '', 'TR', 'C');
  117. $this->Ln(3);
  118. $this->SetFont('Arial', 'B', 10);
  119. $this->SetX($arrXpos[2]);
  120. $this->SetFillColor(255, 255, 255);
  121. $y3 = $this->GetY();//Sirve para posicionar la columna B
  122. $this->Cell(68, 4, 'Datos de Entrada', $bordes, 1, 'C');
  123. $arrDatosEntrada = $this->datosEntrada;
  124. foreach ( $arrDatosEntrada as $keyDatosEntrada => $valueDatosEntrada ) {
  125. $this->SetFont('Arial', 'B', 8);
  126. $this->SetX($arrXpos[2]);
  127. $this->SetFillColor(255, 255, 255);
  128. $strTexto = $keyDatosEntrada;
  129. $wStrTexto = $this->GetStringWidth($keyDatosEntrada) + 2;
  130. $this->Cell($wStrTexto, 4, $strTexto.":", $bordes, 0, 'L');
  131. $this->SetFont('Arial', '', 8);
  132. $this->SetFillColor(255, 255, 255);
  133. if ( $keyDatosEntrada == "CurvaNC" ) {
  134. $arrCurvaNC = explode( "##", $valueDatosEntrada );
  135. $curvaNC = $arrCurvaNC[0];
  136. $valoresCurvaNC = $arrCurvaNC[1];
  137. $this->Cell(34, 4, trim($curvaNC), $bordes, 1, 'L');
  138. } else {
  139. $this->Cell(34, 4, trim($valueDatosEntrada), $bordes, 1, 'L');
  140. }
  141. }
  142. $this->Ln(3);
  143. // Dibuja parte inferior izquierda y derecha del cuadro
  144. $this->SetX($arrXpos[3]);
  145. $this->Cell(2, 2, '', 'BL', 'C');
  146. $this->SetX($arrXpos[3] + 70);
  147. $this->Cell(2, 2, '', 'BR', 1, 'C');
  148. $this->Ln(2);
  149. $y1 = $this->GetY();
  150. $bordes = 0;
  151. $i = 0;
  152. $arrConversiones = $this->conversiones;
  153. foreach ( $arrConversiones as $valueConversiones ) { $i ++; }
  154. if ( ($i > 0) && ( $this->tipoPDF == "CALC" ) ) {
  155. $wAreaConversiones = 115;
  156. $this->SetY($y3);
  157. $this->SetX($arrXpos[1]);
  158. $this->SetFont('Arial', 'B', 10);
  159. $this->SetFillColor(255, 255, 255);
  160. $this->Cell( $wAreaConversiones, 4, "Conversiones de los Datos de Entrada", $bordes, 1, 'C');
  161. $y = $this->GetY();
  162. foreach ( $arrConversiones as $keyConversiones => $valueConversiones ) {
  163. $this->SetY($y);
  164. $this->SetX($arrXpos[1]);
  165. $this->SetFont('Arial', 'B', 8);
  166. $this->SetFillColor(255, 255, 255);
  167. $this->Cell( 30, 4, $keyConversiones, $bordes, 0, 'L');
  168. $this->SetFont('Arial', '', 8);
  169. $this->SetFillColor(255, 255, 255);
  170. $this->MultiCell( 85, 4, $valueConversiones, $bordes, 'L');
  171. $y = $this->GetY();
  172. }
  173. }
  174. $y2 = $this->GetY();
  175. //Para saber cual posici�n de "y" es mayor
  176. if ($y1 >= $y2) {
  177. $this->SetY($y1);
  178. } else {
  179. $this->SetY($y2);
  180. }
  181. }
  182. }
  183. //Funci�n parta dibujar el cuadro de los conceptos
  184. function DibujaCuadro($posy,$largo) {
  185. //N�mero
  186. $this->Rect(10, $posy, 7, $largo);
  187. // Conceptos -> Art�culo
  188. $this->Rect(17, $posy, 36, $largo);
  189. //Conceptos -> ClaveProdServ
  190. $this->Rect(53, $posy, 19, $largo);
  191. //Conceptos -> Cantidad
  192. $this->Rect(72, $posy, 17, $largo);
  193. // Conceptos -> Unidad
  194. $this->Rect(89, $posy, 11, $largo);
  195. //Descripcion
  196. $this->Rect(100, $posy, 65, $largo);
  197. // Conceptos -> Valor unitario
  198. $this->Rect(165, $posy, 20, $largo);
  199. // Conceptos -> Importe
  200. $this->Rect(185, $posy, 20, $largo);
  201. }
  202. //Funci�n para el footer de la p�gina
  203. function Footer(){
  204. $this->SetY(-12);
  205. $this->SetFont('Arial','B',8);
  206. $this->SetX(10);
  207. $this->SetY(-13);
  208. $this->SetFont('Arial','B',8);
  209. $this->SetTextColor(0);
  210. $this->Cell(200,10,utf8_decode('P�gina ').$this->PageNo().' de {nb}',0,0,'R');
  211. }
  212. // Creaci�n del objeto de la clase heredada
  213. function genera_PDF() {
  214. $this->AliasNbPages();
  215. $this->AddPage();
  216. // Configuraciones Globales
  217. $bordes = 1;
  218. $areaDeTrabajo = 195;
  219. $tamanoCelda = 4;
  220. $bolSaltoPagina = false;
  221. $y = $this->GetY();
  222. $arrDatosLwFinal = $this->datosLwFinal;
  223. $arrDatosLwA = $this->datosLwA;
  224. $arrLw = $this->datosLw;
  225. $arrKw = $this->datosKw;
  226. $arrDatosLwFinalVa = $this->DatosLwFinalVa;
  227. $arrDatosLwAVa = $this->DatosLwAVa;
  228. $arrFrecuencias = array( "63Hz", "125Hz", "250Hz", "500Hz", "1000Hz", "2000Hz", "4000Hz", "8000Hz" );
  229. $wColFrecuencias = $areaDeTrabajo / (count($arrFrecuencias)+1);
  230. $arrPonderanciaA = array( "-26.2", "-16.1", "-8.6", "-3.2", "0.0", "1.2", "1.0", "-1.1" );
  231. $this->SetY($y);
  232. $this->SetX(10);
  233. $this->SetFont('Arial','B',11);
  234. $this->SetFillColor(255, 255, 255);
  235. $this->Ln(5);
  236. if ( $this->tipoPDF == "CALC" ) {
  237. $this->Cell( $areaDeTrabajo, 4, utf8_decode("C�LCULOS GENERALES"), 0, 1, 'C');
  238. $this->Ln(5);
  239. $x = 10;
  240. $w = $x;
  241. $w1 = $x + $wColFrecuencias;
  242. $w2 = $x + $wColFrecuencias + $wColFrecuencias;
  243. $w3 = $x + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias;
  244. $w4 = $x + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias;
  245. $w5 = $x + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias;
  246. $w6 = $x + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias;
  247. $w7 = $x + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias;
  248. $w8 = $x + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias;
  249. $wCol = array( $w, $w1, $w2, $w3, $w4, $w5, $w6, $w7, $w8 );
  250. $this->SetFont('Arial','B',8);
  251. $this->SetFillColor(255, 255, 255);
  252. $wColAV = $areaDeTrabajo / 4;
  253. $tmpX = 10;
  254. $y = $this->GetY();
  255. $wx = $tmpX;
  256. $wx1 = $tmpX + $wColAV;
  257. $wx2 = $tmpX + $wColAV + $wColAV;
  258. $wx3 = $tmpX + $wColAV + $wColAV + $wColAV;
  259. $wColx = array( $wx, $wx1, $wx2, $wx3 );
  260. $this->SetY($y);
  261. $this->SetX($wColx[0]);
  262. $this->SetFont('Arial','B',8);
  263. $this->SetFillColor(255, 255, 255);
  264. $this->MultiCell( $wColAV, 10, utf8_decode("�rea de Salida"), $bordes, 'C');
  265. $this->SetY($y);
  266. $this->SetX($wColx[1]);
  267. $this->SetFont('Arial','',8);
  268. $this->SetFillColor(255, 255, 255);
  269. $this->MultiCell( $wColAV, 10, $this->areaDeSalida, $bordes, 'C');
  270. $this->SetY($y);
  271. $this->SetX($wColx[2]);
  272. $this->SetFont('Arial','B',8);
  273. $this->SetFillColor(255, 255, 255);
  274. $this->MultiCell( $wColAV, 10, "Velocidad del Fluido", $bordes, 'C');
  275. $this->SetY($y);
  276. $this->SetX($wColx[3]);
  277. $this->SetFont('Arial','',8);
  278. $this->SetFillColor(255, 255, 255);
  279. $this->MultiCell( $wColAV, 10, $this->velocidadDeFluido, $bordes, 'C');
  280. $this->Ln(5);
  281. $this->SetFont('Arial','B',8);
  282. $this->SetFillColor(255, 255, 255);
  283. $i = 1;
  284. $this->Cell($wColFrecuencias, $tamanoCelda, "Frecuencias Hz", $bordes, 0, 'C');
  285. foreach ( $arrFrecuencias as $frecuencias ) {
  286. $this->SetFont('Arial','',8);
  287. $this->SetFillColor(255, 255, 255);
  288. $this->SetX($wCol[$i]);
  289. $this->Cell($wColFrecuencias, $tamanoCelda, $frecuencias, $bordes, 0, 'C');
  290. $i ++;
  291. }
  292. $this->Ln(4);
  293. $i = 1;
  294. $this->SetFont('Arial','B',8);
  295. $this->SetFillColor(255, 255, 255);
  296. $this->Cell($wColFrecuencias, $tamanoCelda, "Lw", $bordes, 0, 'C');
  297. foreach ( $arrLw as $keyLw => $valueLw ) {
  298. $this->SetFont('Arial','',8);
  299. $this->SetFillColor(255, 255, 255);
  300. $this->SetX($wCol[$i]);
  301. $this->Cell($wColFrecuencias, $tamanoCelda, $valueLw, $bordes, 0, 'C');
  302. $i ++;
  303. }
  304. $this->Ln(4);
  305. $i = 1;
  306. $this->SetFont('Arial','B',8);
  307. $this->SetFillColor(255, 255, 255);
  308. $this->Cell($wColFrecuencias, $tamanoCelda, "Kw", $bordes, 0, 'C');
  309. foreach ( $arrKw as $keyKw => $valueKw ) {
  310. $this->SetFont('Arial','',8);
  311. $this->SetFillColor(255, 255, 255);
  312. $this->SetX($wCol[$i]);
  313. $this->Cell($wColFrecuencias, $tamanoCelda, $valueKw, $bordes, 0, 'C');
  314. $i ++;
  315. }
  316. $this->Ln(4);
  317. $i = 1;
  318. $this->SetFont('Arial','B',8);
  319. $this->SetFillColor(255, 255, 255);
  320. $this->Cell($wColFrecuencias, $tamanoCelda, "Lw Final", $bordes, 0, 'C');
  321. foreach ( $arrDatosLwA as $keyLwA => $valueLwA ) {
  322. $this->SetFont('Arial','',8);
  323. $this->SetFillColor(255, 255, 255);
  324. $this->SetX($wCol[$i]);
  325. $this->Cell($wColFrecuencias, $tamanoCelda, $valueLwA, $bordes, 0, 'C');
  326. $i ++;
  327. }
  328. $this->Ln(4);
  329. $this->SetFont('Arial','B',8);
  330. $this->SetFillColor(255, 255, 255);
  331. $i = 1;
  332. $this->Cell($wColFrecuencias, $tamanoCelda, "Ponderancia A", $bordes, 0, 'C');
  333. foreach ( $arrPonderanciaA as $ponderancia ) {
  334. $this->SetFont('Arial','',8);
  335. $this->SetFillColor(255, 255, 255);
  336. $this->SetX($wCol[$i]);
  337. $this->Cell($wColFrecuencias, $tamanoCelda, $ponderancia, $bordes, 0, 'C');
  338. $i ++;
  339. }
  340. $this->Ln(4);
  341. $this->SetFont('Arial','B',8);
  342. $this->SetFillColor(255, 255, 255);
  343. $i = 1;
  344. $this->Cell($wColFrecuencias, $tamanoCelda, "LwA", $bordes, 0, 'C');
  345. foreach ( $arrDatosLwA as $keyLwA => $valueLwA ) {
  346. $this->SetFont('Arial','',8);
  347. $this->SetFillColor(255, 255, 255);
  348. $this->SetX($wCol[$i]);
  349. $this->Cell($wColFrecuencias, $tamanoCelda, $valueLwA, $bordes, 0, 'C');
  350. $i ++;
  351. }
  352. $arrDatosEntrada = $this->datosEntrada;
  353. foreach ( $arrDatosEntrada as $keyDatosEntrada => $valueDatosEntrada ) {
  354. if ( $keyDatosEntrada == "CurvaNC" ) {
  355. $arrCurvaNC = explode( "##", $valueDatosEntrada );
  356. $curvaNC = $arrCurvaNC[0];
  357. $valoresCurvaNC = $arrCurvaNC[1];
  358. }
  359. }
  360. switch( $curvaNC ) {
  361. case 'NC15':
  362. $arrCurvaNC = array( 47, 36, 29, 22, 17, 14, 12, 11 );
  363. break;
  364. case 'NC20':
  365. $arrCurvaNC = array( 51, 40, 33, 26, 22, 19, 17, 16 );
  366. break;
  367. case 'NC25':
  368. $arrCurvaNC = array( 54, 44, 37, 31, 27, 24, 22, 21 );
  369. break;
  370. case 'NC30':
  371. $arrCurvaNC = array( 57, 48, 41, 35, 31, 29, 28, 27 );
  372. break;
  373. case 'NC35':
  374. $arrCurvaNC = array( 60, 52, 45, 40, 36, 34, 33, 32 );
  375. break;
  376. case 'NC40':
  377. $arrCurvaNC = array( 64, 56, 50, 45, 41, 39, 38, 37 );
  378. break;
  379. case 'NC45':
  380. $arrCurvaNC = array( 67, 60, 54, 49, 46, 44, 43, 42 );
  381. break;
  382. case 'NC50':
  383. $arrCurvaNC = array( 71, 64, 58, 54, 51, 49, 48, 47 );
  384. break;
  385. case 'NC55':
  386. $arrCurvaNC = array( 74, 67, 62, 58, 56, 54, 53, 52 );
  387. break;
  388. case 'NC60':
  389. $arrCurvaNC = array( 77, 71, 67, 63, 61, 59, 58, 57 );
  390. break;
  391. case 'NC65':
  392. $arrCurvaNC = array( 80, 75, 71, 68, 66, 64, 63, 62 );
  393. break;
  394. case 'NC70':
  395. $arrCurvaNC = array( 84, 79, 75, 72, 71, 70, 68, 68 );
  396. break;
  397. }
  398. $this->Ln(4);
  399. $this->SetFont('Arial','B',8);
  400. $this->SetFillColor(255, 255, 255);
  401. $i = 1;
  402. $this->Cell($wColFrecuencias, $tamanoCelda, "Curva ".$curvaNC, $bordes, 0, 'C');
  403. foreach ( $arrCurvaNC as $valoresCurvaNC ) {
  404. $this->SetFont('Arial','',8);
  405. $this->SetFillColor(255, 255, 255);
  406. $this->SetX($wCol[$i]);
  407. $this->Cell($wColFrecuencias, $tamanoCelda, $valoresCurvaNC, $bordes, 0, 'C');
  408. $i ++;
  409. }
  410. $y = $this->GetY();
  411. if ( $y >= 243 ) {
  412. $this->AddPage();
  413. $y = $this->GetY();
  414. }
  415. $this->Ln(4);
  416. $arrLwAV = $this->LwAVentilador;
  417. $i = 1;
  418. $y1 = $this->GetY();
  419. $this->SetFont('Arial','B',8);
  420. $this->SetFillColor(255, 255, 255);
  421. $this->MultiCell($wColFrecuencias, $tamanoCelda, "LwA Ventilador - ".$curvaNC, $bordes, 'C');
  422. $y2 = $this->GetY();
  423. $sCol = $y1 - $y2;
  424. foreach ( $arrLwAV as $valueLwAV ) {
  425. $this->SetFont('Arial','',8);
  426. $this->SetFillColor(255, 255, 255);
  427. $this->SetX($wCol[$i]);
  428. $this->Cell($wColFrecuencias, $sCol, $valueLwAV, $bordes, 0, 'C');
  429. $i ++;
  430. }
  431. $y = $this->GetY();
  432. if ( $y >= 243 ) {
  433. $this->AddPage();
  434. $y = $this->GetY();
  435. }
  436. $arrDatosAtenuador = $this->datosAtenuadores;
  437. $i = 1;
  438. $y1 = $this->GetY();
  439. $this->SetY($y1);
  440. $this->SetFont('Arial','B',8);
  441. $this->SetFillColor(255, 255, 255);
  442. $this->MultiCell($wColFrecuencias, $tamanoCelda, utf8_decode("Atenuaci�n Seleccionada"), $bordes, 'C');
  443. $y2 = $this->GetY();
  444. $sCol = $y1 - $y2;
  445. foreach ( $arrFrecuencias as $frecuencias ) {
  446. $this->SetFont('Arial','',8);
  447. $this->SetFillColor(255, 255, 255);
  448. $this->SetX($wCol[$i]);
  449. $this->Cell($wColFrecuencias, $sCol, $arrDatosAtenuador[$frecuencias], $bordes, 0, 'C');
  450. $i ++;
  451. }
  452. $y = $this->GetY();
  453. if ( $y >= 243 ) {
  454. $this->AddPage();
  455. $y = $this->GetY();
  456. }
  457. $arrVentiladorA = $this->LwAVentiladorA;
  458. $i = 1;
  459. $y1 = $this->GetY();
  460. $this->SetY($y1);
  461. $this->SetFont('Arial','B',8);
  462. $this->SetFillColor(255, 255, 255);
  463. $this->MultiCell($wColFrecuencias, $tamanoCelda, utf8_decode("LwA Ventilador - Atenuaci�n"), $bordes, 'C');
  464. $y2 = $this->GetY();
  465. $sCol = $y1 - $y2;
  466. foreach ( $arrVentiladorA as $VentiladorA ) {
  467. $this->SetFont('Arial','',8);
  468. $this->SetFillColor(255, 255, 255);
  469. $this->SetX($wCol[$i]);
  470. $this->Cell($wColFrecuencias, $sCol, $VentiladorA, $bordes, 0, 'C');
  471. $i ++;
  472. }
  473. $y = $this->GetY();
  474. if ( $y >= 243 ) {
  475. $this->AddPage();
  476. $y = $this->GetY();
  477. }
  478. $arrSonidoR = $this->sonidoRegenerado;
  479. $i = 1;
  480. $y1 = $this->GetY();
  481. $this->SetY($y1);
  482. $this->SetFont('Arial','B',8);
  483. $this->SetFillColor(255, 255, 255);
  484. $this->MultiCell($wColFrecuencias, $tamanoCelda, "Sonido Regenerado", $bordes, 'C');
  485. $y2 = $this->GetY();
  486. $sCol = $y1 - $y2;
  487. foreach ( $arrSonidoR as $sonidoRegenerado ) {
  488. $this->SetFont('Arial','',8);
  489. $this->SetFillColor(255, 255, 255);
  490. $this->SetX($wCol[$i]);
  491. $this->Cell($wColFrecuencias, $sCol, $sonidoRegenerado, $bordes, 0, 'C');
  492. $i ++;
  493. }
  494. $y = $this->GetY();
  495. if ( $y >= 243 ) {
  496. $this->AddPage();
  497. $y = $this->GetY();
  498. }
  499. $arrCorrecion = $this->correcionArea;
  500. $i = 1;
  501. $y1 = $this->GetY();
  502. $this->SetY($y1);
  503. $this->SetFont('Arial','B',8);
  504. $this->SetFillColor(255, 255, 255);
  505. $this->MultiCell($wColFrecuencias, $tamanoCelda, utf8_decode("Correci�n para la �rea"), $bordes, 'C');
  506. $y2 = $this->GetY();
  507. $sCol = $y1 - $y2;
  508. foreach ( $arrCorrecion as $correcion ) {
  509. $this->SetFont('Arial','',8);
  510. $this->SetFillColor(255, 255, 255);
  511. $this->SetX($wCol[$i]);
  512. $this->Cell($wColFrecuencias, $sCol, $correcion, $bordes, 0, 'C');
  513. $i ++;
  514. }
  515. $y = $this->GetY();
  516. if ( $y >= 243 ) {
  517. $this->AddPage();
  518. $y = $this->GetY();
  519. }
  520. $arrSonidoMasCorrecion = $this->sonidoMasCorreccion;
  521. $i = 1;
  522. $y1 = $this->GetY();
  523. $this->SetY($y1);
  524. $this->SetFont('Arial','B',8);
  525. $this->SetFillColor(255, 255, 255);
  526. $this->MultiCell($wColFrecuencias, $tamanoCelda, utf8_decode("Sonido Regenerado m�s Correci�n del �rea"), $bordes, 'C');
  527. $y2 = $this->GetY();
  528. $sCol = $y1 - $y2;
  529. foreach ( $arrSonidoMasCorrecion as $sonidoMasCorrecion ) {
  530. $this->SetFont('Arial','',8);
  531. $this->SetFillColor(255, 255, 255);
  532. $this->SetX($wCol[$i]);
  533. $this->Cell($wColFrecuencias, $sCol, $sonidoMasCorrecion, $bordes, 0, 'C');
  534. $i ++;
  535. }
  536. $y = $this->GetY();
  537. if ( $y >= 243 ) {
  538. $this->AddPage();
  539. $y = $this->GetY();
  540. }
  541. $i = 1;
  542. $y1 = $this->GetY();
  543. $this->SetY($y1);
  544. $this->SetFont('Arial','B',8);
  545. $this->SetFillColor(255, 255, 255);
  546. $this->MultiCell($wColFrecuencias, $tamanoCelda, "(A- weighting (dB))", $bordes, 'C');
  547. $y2 = $this->GetY();
  548. $sCol = $y1 - $y2;
  549. foreach ( $arrPonderanciaA as $ponderancia ) {
  550. $this->SetFont('Arial','',8);
  551. $this->SetFillColor(255, 255, 255);
  552. $this->SetX($wCol[$i]);
  553. $this->Cell($wColFrecuencias, $sCol, $ponderancia, $bordes, 0, 'C');
  554. $i ++;
  555. }
  556. $y = $this->GetY();
  557. if ( $y >= 243 ) {
  558. $this->AddPage();
  559. $y = $this->GetY();
  560. }
  561. $i = 1;
  562. $y1 = $this->GetY();
  563. $this->SetY($y1);
  564. $this->SetFont('Arial','B',8);
  565. $this->SetFillColor(255, 255, 255);
  566. $this->MultiCell($wColFrecuencias, $tamanoCelda, utf8_decode("Espectro resultante ponderaci�n A ( dBA )"), $bordes, 'C');
  567. $y2 = $this->GetY();
  568. $sCol = $y1 - $y2;
  569. foreach ( $arrDatosLwAVa as $valueLwAVa ) {
  570. $this->SetFont('Arial','',8);
  571. $this->SetFillColor(255, 255, 255);
  572. $this->SetX($wCol[$i]);
  573. $this->Cell($wColFrecuencias, $sCol, $valueLwAVa, $bordes, 0, 'C');
  574. $i ++;
  575. }
  576. }
  577. $y = $this->GetY();
  578. if ( $y >= 243 ) {
  579. $this->AddPage();
  580. $y = $this->GetY();
  581. }
  582. $this->SetFont('Arial','B',12);
  583. $this->SetFillColor(255, 255, 255);
  584. $this->SetY($y);
  585. $this->Cell( $areaDeTrabajo, 4, "RESULTADOS", 0, 1, 'C');
  586. $this->Ln(8);
  587. $this->SetFont('Arial','B',8);
  588. $this->SetFillColor(255, 255, 255);
  589. $this->Cell($areaDeTrabajo, $tamanoCelda, "Espectro de Potencia Sonora Ventilador Lw",$bordes, 1, 'C');
  590. $x = 10;
  591. $w = $x;
  592. $w1 = $x + $wColFrecuencias;
  593. $w2 = $x + $wColFrecuencias + $wColFrecuencias;
  594. $w3 = $x + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias;
  595. $w4 = $x + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias;
  596. $w5 = $x + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias;
  597. $w6 = $x + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias;
  598. $w7 = $x + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias;
  599. $w8 = $x + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias;
  600. $wCol = array( $w, $w1, $w2, $w3, $w4, $w5, $w6, $w7, $w8 );
  601. $i = 0;
  602. foreach ( $arrFrecuencias as $frecuencias ) {
  603. $this->SetX($wCol[$i]);
  604. $this->Cell($wColFrecuencias, $tamanoCelda, $frecuencias, $bordes, 0, 'C');
  605. $i ++;
  606. }
  607. $this->SetX($wCol[8]);
  608. $this->Cell($wColFrecuencias, $tamanoCelda, "Lw (dB)", $bordes, 0, 'C');
  609. $this->Ln(4);
  610. $this->SetFont('Arial','',8);
  611. $this->SetFillColor(255, 255, 255);
  612. $i = 0;
  613. foreach ( $arrDatosLwFinal as $keyLwFinal => $valueLwFinal ) {
  614. $this->SetX($wCol[$i]);
  615. $this->Cell($wColFrecuencias, $tamanoCelda, $valueLwFinal, $bordes, 0, 'C');
  616. $i ++;
  617. }
  618. $this->SetX($wCol[8]);
  619. $this->Cell($wColFrecuencias, $tamanoCelda, $this->sumaLogLwFinal, $bordes, 0, 'C');
  620. $this->Ln(8);
  621. $this->SetFont('Arial','B',8);
  622. $this->SetFillColor(255, 255, 255);
  623. $this->Cell($areaDeTrabajo, $tamanoCelda, utf8_decode("Espectro de Potencia Sonora Ventilador Ponderaci�n A Lw (A)"),$bordes, 1, 'C');
  624. $i = 0;
  625. foreach ( $arrFrecuencias as $frecuencias ) {
  626. $this->SetX($wCol[$i]);
  627. $this->Cell($wColFrecuencias, $tamanoCelda, $frecuencias, $bordes, 0, 'C');
  628. $i ++;
  629. }
  630. $this->SetX($wCol[8]);
  631. $this->Cell($wColFrecuencias, $tamanoCelda, "Lw (dBA)", $bordes, 0, 'C');
  632. $this->Ln(4);
  633. $this->SetFont('Arial','',8);
  634. $this->SetFillColor(255, 255, 255);
  635. $i = 0;
  636. foreach ( $arrDatosLwA as $keyLwA => $valueLwA ) {
  637. $this->SetX($wCol[$i]);
  638. $this->Cell($wColFrecuencias, $tamanoCelda, $valueLwA, $bordes, 0, 'C');
  639. $i ++;
  640. }
  641. $this->SetX($wCol[8]);
  642. $this->Cell($wColFrecuencias, $tamanoCelda, $this->sumaLogaritmicaLwA, $bordes, 0, 'C');
  643. $this->Ln(8);
  644. $wColPotencias = $areaDeTrabajo / 2;
  645. $x = 10;
  646. $y = $this->GetY();
  647. $w = $x;
  648. $w1 = $x + $wColPotencias;
  649. $w2 = $x + $wColPotencias + $wColPotencias;
  650. $w3 = $x + $wColPotencias + $wColPotencias + $wColPotencias;
  651. $wCol = array( $w, $w1, $w2, $w3 );
  652. $this->SetY($y);
  653. $this->SetX($wCol[0]);
  654. $this->SetFont('Arial','B',8);
  655. $this->SetFillColor(255, 255, 255);
  656. $this->MultiCell( $wColPotencias, 10, utf8_decode("Presi�n Sonora"), $bordes, 'C');
  657. $this->SetY($y);
  658. $this->SetX($wCol[1]);
  659. $this->SetFont('Arial','',8);
  660. $this->SetFillColor(255, 255, 255);
  661. $this->MultiCell( $wColPotencias, 10, $this->presionSonora, $bordes, 'C');
  662. $this->Ln(8);
  663. // Con Atenaudor
  664. $x = 10;
  665. $w = $x;
  666. $w1 = $x + $wColFrecuencias;
  667. $w2 = $x + $wColFrecuencias + $wColFrecuencias;
  668. $w3 = $x + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias;
  669. $w4 = $x + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias;
  670. $w5 = $x + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias;
  671. $w6 = $x + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias;
  672. $w7 = $x + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias;
  673. $w8 = $x + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias + $wColFrecuencias;
  674. $wCol = array( $w, $w1, $w2, $w3, $w4, $w5, $w6, $w7, $w8 );
  675. $this->SetFont('Arial','B',8);
  676. $this->SetFillColor(255, 255, 255);
  677. $this->Cell($areaDeTrabajo, $tamanoCelda, "Espectro de Potencia Sonora Ventilador con Atenuador Lw",$bordes, 1, 'C');
  678. $i = 0;
  679. foreach ( $arrFrecuencias as $frecuencias ) {
  680. $this->SetX($wCol[$i]);
  681. $this->Cell($wColFrecuencias, $tamanoCelda, $frecuencias, $bordes, 0, 'C');
  682. $i ++;
  683. }
  684. $this->SetX($wCol[8]);
  685. $this->Cell($wColFrecuencias, $tamanoCelda, "Lw (dBA)", $bordes, 0, 'C');
  686. $this->Ln(4);
  687. $this->SetFont('Arial','',8);
  688. $this->SetFillColor(255, 255, 255);
  689. $i = 0;
  690. foreach ( $arrDatosLwFinalVa as $keyLwFinalVa => $valueLwFinalVa ) {
  691. $this->SetX($wCol[$i]);
  692. $this->Cell($wColFrecuencias, $tamanoCelda, $valueLwFinalVa, $bordes, 0, 'C');
  693. $i ++;
  694. }
  695. $this->SetX($wCol[8]);
  696. $this->Cell($wColFrecuencias, $tamanoCelda, $this->sumaLogaritmicaLwFinalVa, $bordes, 0, 'C');
  697. $this->Ln(8);
  698. $this->SetFont('Arial','B',8);
  699. $this->SetFillColor(255, 255, 255);
  700. $this->Cell($areaDeTrabajo, $tamanoCelda, "Espectro de Potencia Sonora Ventilador con Atenuador Lw (A)",$bordes, 1, 'C');
  701. $i = 0;
  702. foreach ( $arrFrecuencias as $frecuencias ) {
  703. $this->SetX($wCol[$i]);
  704. $this->Cell($wColFrecuencias, $tamanoCelda, $frecuencias, $bordes, 0, 'C');
  705. $i ++;
  706. }
  707. $this->SetX($wCol[8]);
  708. $this->Cell($wColFrecuencias, $tamanoCelda, "Lw (dBA)", $bordes, 0, 'C');
  709. $this->Ln(4);
  710. $this->SetFont('Arial','',8);
  711. $this->SetFillColor(255, 255, 255);
  712. $i = 0;
  713. foreach ( $arrDatosLwAVa as $keyLwAVa => $valueLwAVa ) {
  714. $this->SetX($wCol[$i]);
  715. $this->Cell($wColFrecuencias, $tamanoCelda, $valueLwAVa, $bordes, 0, 'C');
  716. $i ++;
  717. }
  718. $this->SetX($wCol[8]);
  719. $this->Cell($wColFrecuencias, $tamanoCelda, $this->sumaLogaritmicaLwAVa, $bordes, 0, 'C');
  720. $this->Ln(8);
  721. $wColPotencias = $areaDeTrabajo / 2;
  722. $x = 10;
  723. $y = $this->GetY();
  724. $w = $x;
  725. $w1 = $x + $wColPotencias;
  726. $w2 = $x + $wColPotencias + $wColPotencias;
  727. $w3 = $x + $wColPotencias + $wColPotencias + $wColPotencias;
  728. $wCol = array( $w, $w1, $w2, $w3 );
  729. $this->SetY($y);
  730. $this->SetX($wCol[0]);
  731. $this->SetFont('Arial','B',8);
  732. $this->SetFillColor(255, 255, 255);
  733. $this->MultiCell( $wColPotencias, 10, utf8_decode("Presi�n Sonora"), $bordes, 'C');
  734. $this->SetY($y);
  735. $this->SetX($wCol[1]);
  736. $this->SetFont('Arial','',8);
  737. $this->SetFillColor(255, 255, 255);
  738. $this->MultiCell( $wColPotencias, 10, $this->presionSonoraVa, $bordes, 'C');
  739. $arrXpos = array(30, 90, 13, 11);
  740. $y = $this->GetY();
  741. //Dibuja parte superior izquierda y derecha del cuadro
  742. $this->SetY($y + 8);
  743. $this->SetX($arrXpos[3]);
  744. $this->Cell(2, 2, '', 'TL', 'C');
  745. $this->SetX($arrXpos[3] + 192);
  746. $this->Cell(2, 2, '', 'TR', 'C');
  747. $this->Ln(3);
  748. $this->SetFont('Arial', 'B', 12);
  749. $this->SetX($arrXpos[2]);
  750. $this->SetFillColor(255, 255, 255);
  751. $y3 = $this->GetY();//Sirve para posicionar la columna B
  752. $this->Cell(190, 12, 'Datos del Atenuador Seleccionado', $bordes, 1, 'C');
  753. $areaDeTrabajo = 190;
  754. $wColPotencias = $areaDeTrabajo / 4;
  755. $x = 13;
  756. $y = $this->GetY();
  757. $w = $x;
  758. $w1 = $x + $wColPotencias;
  759. $w2 = $x + $wColPotencias + $wColPotencias;
  760. $w3 = $x + $wColPotencias + $wColPotencias + $wColPotencias;
  761. $wCol = array( $w, $w1, $w2, $w3 );
  762. $arrDatosAtenuador = $this->datosAtenuadores;
  763. $this->SetY($y);
  764. $this->SetX($wCol[0]);
  765. $this->SetFont('Arial','B',11);
  766. $this->SetFillColor(255, 255, 255);
  767. $this->MultiCell( $wColPotencias, 11, "Modelo", $bordes, 'C');
  768. $this->SetY($y);
  769. $this->SetX($wCol[1]);
  770. $this->SetFont('Arial','',11);
  771. $this->SetFillColor(255, 255, 255);
  772. $this->MultiCell( $wColPotencias, 11, $arrDatosAtenuador['MODELO'], $bordes, 'C');
  773. $this->SetY($y);
  774. $this->SetX($wCol[2]);
  775. $this->SetFont('Arial','B',11);
  776. $this->SetFillColor(255, 255, 255);
  777. $this->MultiCell( $wColPotencias, 11, "Longitud", $bordes, 'C');
  778. $this->SetY($y);
  779. $this->SetX($wCol[3]);
  780. $this->SetFont('Arial','',11);
  781. $this->SetFillColor(255, 255, 255);
  782. $this->MultiCell( $wColPotencias, 11, $arrDatosAtenuador['LONGITUD']."", $bordes, 'C');
  783. $this->Ln(3);
  784. // Dibuja parte inferior izquierda y derecha del cuadro
  785. $this->SetX($arrXpos[3]);
  786. $this->Cell(2, 2, '', 'BL', 'C');
  787. $this->SetX($arrXpos[3] + 192);
  788. $this->Cell(2, 2, '', 'BR', 1, 'C');
  789. $this->Ln(2);
  790. if ( $this->narch == "" ) {
  791. $this->Output();
  792. } else {
  793. if ( $this->p == "" ) {
  794. $this->Output( $this->narch );
  795. } else {
  796. $this->Output( $this->narch, $this->p );
  797. }
  798. }
  799. }
  800. }
  801. ?>