|
|
@@ -0,0 +1,1936 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+ /*
|
|
|
+ 2019. Servicios Corporativos y Soluciones en CFDI S de RL de CV
|
|
|
+ Versión 1.0
|
|
|
+ Última Actualización: 27/05/2019
|
|
|
+
|
|
|
+ Developer: Fernando A. Jacobo
|
|
|
+ Tester: Fernando A. Jacobo
|
|
|
+ IT Leader: Jorge H. Fierro
|
|
|
+
|
|
|
+ Última modificación: Fernando A. Jacobo
|
|
|
+ */
|
|
|
+
|
|
|
+ require_once('shared/conexionBD.php');
|
|
|
+
|
|
|
+ $idModulo = "CALC.ATEN";
|
|
|
+ $arrErroresSistemaServ = array();
|
|
|
+ $strMensaje = "";
|
|
|
+ $mensajeError = 0;
|
|
|
+
|
|
|
+ $arrVentiladores = array(); // Contiene Todos los modelos de ventiladores existentes
|
|
|
+ $qryModelos = ' SELECT * FROM ITT_ASW_MODE ';
|
|
|
+ $qryModelos = utf8_encode($qryModelos);
|
|
|
+ $qrsModelos = mysqli_query($conexion, $qryModelos);
|
|
|
+ if ( ( $qrsModelos !== false ) ) {
|
|
|
+ if ( ( mysqli_num_rows( $qrsModelos ) > 0 ) ) {
|
|
|
+ while ( $rowModelos = mysqli_fetch_assoc( $qrsModelos ) ) {
|
|
|
+ $IDModelo = $rowModelos['IDMODELO'];
|
|
|
+ $arrVentiladores[$IDModelo] = $rowModelos;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $strMensaje = 'SPSERV.( ' . $idModulo . ' ).0002 - Ha ocurrido un error al consultar el Catálogo de Ventiladores del sistema. ';
|
|
|
+ $strMensaje.= 'El catálago de Ventiladores debe de contener al menos un ventilador disponible.';
|
|
|
+ $arrErroresSistemaServ[base64_encode('ITT_ASW_MODE-DATA')] = $strMensaje;
|
|
|
+ $mensajeError ++;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $strMensaje = 'SPSERV.( ' . $idModulo . ' ).0001 - Ha ocurrido un error al consultar El Catálogo de Ventiladores del Sistema. ';
|
|
|
+ $strMensaje.= 'Notifique al Departamento de Sistemas con la siguiente descripción: ';
|
|
|
+ $strMensaje.= base64_encode( ' Error: ' . base64_encode(mysqli_error($conBaseDatos)) . ' para la Consulta: ' . base64_encode(utf8_decode($qryModelos) ) );
|
|
|
+ $arrErroresSistemaServ[base64_encode('ITT_ASW_MODE')] = $strMensaje;
|
|
|
+ $mensajeError ++ ;
|
|
|
+ }
|
|
|
+
|
|
|
+ if ( !empty($arrVentiladores) ) {
|
|
|
+ $arrVentiladoresJs = json_encode($arrVentiladores);
|
|
|
+
|
|
|
+ $arrModelos = array();
|
|
|
+ $arrTipos = array();
|
|
|
+ foreach ( $arrVentiladores as $ventilador ) {
|
|
|
+ $arrTipos[$ventilador['TIPO']] = $ventilador['TIPO'];
|
|
|
+ if ( ( !empty($ventilador['PULGADAS']) ) && ( empty($ventilador['PRESION']) ) && ( !empty($ventilador['DESC']) ) ) {
|
|
|
+ $arrModelos[$ventilador['TIPO']][$ventilador['IDMODELO']] = $ventilador['DESC'];
|
|
|
+ } elseif ( ( empty($ventilador['PULGADAS']) ) && ( empty($ventilador['PRESION']) ) && ( !empty($ventilador['DESC']) ) ) {
|
|
|
+ $arrModelos[$ventilador['TIPO']][$ventilador['IDMODELO']] = $ventilador['DESC'];
|
|
|
+ } elseif ( ( empty($ventilador['PULGADAS']) ) && ( !empty($ventilador['PRESION']) ) && ( empty($ventilador['DESC']) ) ) {
|
|
|
+ $arrModelos[$ventilador['TIPO']][$ventilador['IDMODELO']] = $ventilador['MODELO']." - Presión ".$ventilador['PRESION'];
|
|
|
+ } elseif ( ( empty($ventilador['PULGADAS']) ) && ( !empty($ventilador['PRESION']) ) && ( !empty($ventilador['DESC']) ) ) {
|
|
|
+ $arrModelos[$ventilador['TIPO']][$ventilador['IDMODELO']] = $ventilador['DESC']." - Presión ".$ventilador['PRESION'];
|
|
|
+ } elseif ( ( empty($ventilador['PULGADAS']) ) && ( empty($ventilador['PRESION']) ) && ( empty($ventilador['DESC']) ) ) {
|
|
|
+ $arrModelos[$ventilador['TIPO']][$ventilador['IDMODELO']] = $ventilador['MODELO'];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $arrTipoVentiladorJs = json_encode($arrTipos);
|
|
|
+ $arrModeloVentiladorJs = json_encode($arrModelos);
|
|
|
+
|
|
|
+ } else {
|
|
|
+ $strMensaje = 'SPSERV.( ' . $idModulo . ' ).0003 - Ha ocurrido un error al consultar el Catálogo de Ventiladores del sistema. ';
|
|
|
+ $strMensaje.= 'La búsqueda de los Tipos y Modelos de los Ventiladores no se genero correctamente.';
|
|
|
+ $arrErroresSistemaServ[base64_encode('ITT_ASW_MODE-SEARCH')] = $strMensaje;
|
|
|
+ $mensajeError ++;
|
|
|
+ }
|
|
|
+
|
|
|
+ $arrAtenuacion = array(); // Contiene todos Los Atenuadores Existentes
|
|
|
+ $qryAtenuacion = ' SELECT * FROM ITT_ASW_ATEN ';
|
|
|
+ $qryAtenuacion = utf8_encode($qryAtenuacion);
|
|
|
+ $qrsAtenuacion = mysqli_query($conexion, $qryAtenuacion);
|
|
|
+ if ( ( $qrsAtenuacion !== false ) ) {
|
|
|
+ if ( ( mysqli_num_rows( $qrsAtenuacion ) > 0 ) ) {
|
|
|
+ while ( $rowAtenuacion = mysqli_fetch_assoc( $qrsAtenuacion ) ) {
|
|
|
+ $IDAtenuacion = $rowAtenuacion['IDATENUACION'];
|
|
|
+ $arrAtenuacion[$IDAtenuacion] = $rowAtenuacion;
|
|
|
+ }
|
|
|
+ $arrAtenuacionJs = json_encode($arrAtenuacion);
|
|
|
+ } else {
|
|
|
+ $strMensaje = 'SPSERV.( ' . $idModulo . ' ).0005 - Ha ocurrido un error al consultar el Catálogo de Atenuadores del sistema. ';
|
|
|
+ $strMensaje.= 'El catálago de atenuadores debe de contener al menos un atenuador disponible.';
|
|
|
+ $arrErroresSistemaServ[base64_encode('ITT_ASW_ATEN-DATA')] = $strMensaje;
|
|
|
+ $mensajeError ++;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $strMensaje = 'SPSERV.( ' . $idModulo . ' ).0004 - Ha ocurrido un error al consultar el Catálogo de Atenuadores del sistema. ';
|
|
|
+ $strMensaje.= 'Notifique al Departamento de Sistemas con la siguiente descripción: ';
|
|
|
+ $strMensaje.= base64_encode( ' Error: ' . base64_encode(mysqli_error($conBaseDatos)) . ' para la Consulta: ' . base64_encode(utf8_decode($qryAtenuacion) ) );
|
|
|
+ $arrErroresSistemaServ[base64_encode('ITT_ASW_ATEN')] = $strMensaje;
|
|
|
+ $mensajeError ++;
|
|
|
+ }
|
|
|
+
|
|
|
+ $arrPotenciaSonora = array(); // Contiene todos Las Potencias Sonoras Existentes
|
|
|
+ $qryPotenciaS = ' SELECT * FROM ITT_ASW_POSO ';
|
|
|
+ $qryPotenciaS = utf8_encode($qryPotenciaS);
|
|
|
+ $qrsPotenciaS = mysqli_query($conexion, $qryPotenciaS);
|
|
|
+ if ( ( $qrsPotenciaS !== false ) ) {
|
|
|
+ if ( ( mysqli_num_rows( $qrsPotenciaS ) > 0 ) ) {
|
|
|
+ while ( $rowPotenciaS = mysqli_fetch_assoc( $qrsPotenciaS ) ) {
|
|
|
+ $IDAtenuacion = $rowPotenciaS['IDPOTSON'];
|
|
|
+ $arrPotenciaSonora[$IDAtenuacion] = $rowPotenciaS;
|
|
|
+ }
|
|
|
+ $arrPotenciaSonoraJs = json_encode($arrPotenciaSonora);
|
|
|
+ } else {
|
|
|
+ $strMensaje = 'SPSERV.( ' . $idModulo . ' ).0007 - Ha ocurrido un error al consultar el Catálogo de Potencias Sonoras del sistema. ';
|
|
|
+ $strMensaje.= 'El catálago de Potencias Sonoras debe de contener al menos un registro disponible.';
|
|
|
+ $arrErroresSistemaServ[base64_encode('ITT_ASW_POSO-DATA')] = $strMensaje;
|
|
|
+ $mensajeError ++;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $strMensaje = 'SPSERV.( ' . $idModulo . ' ).0006 - Ha ocurrido un error al consultar el Catálogo de Potencias Sonoras del sistema. ';
|
|
|
+ $strMensaje.= 'Notifique al Departamento de Sistemas con la siguiente descripción: ';
|
|
|
+ $strMensaje.= base64_encode( ' Error: ' . base64_encode(mysqli_error($conBaseDatos)) . ' para la Consulta: ' . base64_encode(utf8_decode($qryPotenciaS) ) );
|
|
|
+ $arrErroresSistemaServ[base64_encode('ITT_ASW_POSO')] = $strMensaje;
|
|
|
+ $mensajeError ++;
|
|
|
+ }
|
|
|
+
|
|
|
+ if ( $mensajeError != 0 ) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ $arrUnidadMedidaCaudal = array( "M3/S"=>"M3/S", "M3/MIN"=>"M3/MIN", "M3/H"=>"M3/H", "L/S"=>"L/S", "L/MIN"=>"L/MIN", "L/H"=>"L/H", "CM3/S"=>"CM3/S", "CM3/MIN"=>"CM3/MIN", "CM3/H"=>"CM3/H", "GALON/S"=>"GALON/S", "GALON/MIN"=>"GALON/MIN", "GALON/H"=>"GALON/H", "CFM"=>"CFM" );
|
|
|
+ $arrUnidadMedidaCaudalJs = json_encode($arrUnidadMedidaCaudal);
|
|
|
+
|
|
|
+ $arrUnidadMedidaPresionE = array( "MPA"=>"MPA", "KPA"=>"KPA", "PA"=>"PA", "BAR"=>"BAR", "M CA"=>"M CA", "CM A"=>"CM A", "MM CA"=>"MM CA", "IN HG"=>"IN HG", "CM HG"=>"CM HG", "MM HG"=>"MM HG", "TORR"=>"TORR", "INWG"=>"INWG" );
|
|
|
+ $arrUnidadMedidaPresionEJs = json_encode($arrUnidadMedidaPresionE);
|
|
|
+
|
|
|
+ $arrUnidadMedidaPotenciaA = array( "HP"=>"HP", "J/S"=>"J/S", "KCAL/H"=>"KCAL/H", "KW"=>"KW", "WATT"=>"WATT", "PIE-LIBRA(S)"=>"PIE-LIBRA(S)", "PIE-LIBRA(M)"=>"PIE-LIBRA(M)", "BHP"=>"BHP" );
|
|
|
+ $arrUnidadMedidaPotenciaAJs = json_encode($arrUnidadMedidaPotenciaA);
|
|
|
+
|
|
|
+ $arrUnidadMedidaDiametro = array( "MM"=>"MM", "CM"=>"CM", "DM"=>"DM", "M"=>"M", "MI"=>"MI", "YARDA"=>"YARDA", "INCH"=>"INCH", "FT"=>"FT" );
|
|
|
+ $arrUnidadMedidaDiametroJs = json_encode($arrUnidadMedidaDiametro);
|
|
|
+
|
|
|
+ $arrCurvaNCS = array( "NC15"=>"NC15", "NC20"=>"NC20", "NC25"=>"NC25", "NC30"=>"NC30", "NC35"=>"NC35", "NC40"=>"NC40", "NC45"=>"NC45", "NC50"=>"NC50", "NC55"=>"NC55", "NC60"=>"NC60", "NC65"=>"NC65", "NC70"=>"NC70" );
|
|
|
+ $arrCurvaNCSJs = json_encode($arrCurvaNCS);
|
|
|
+
|
|
|
+ $arrFrecuencias = array( "63Hz", "125Hz", "250Hz", "500Hz", "1000Hz", "2000Hz", "4000Hz", "8000Hz");
|
|
|
+
|
|
|
+ $strTablaResultados = "";
|
|
|
+
|
|
|
+ if( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
|
|
|
+
|
|
|
+ $transaccionPDF = $_POST["TRANSPDF"];
|
|
|
+
|
|
|
+ $arrDatosEntrada = json_decode($_POST["DATOSENTRADA"]);
|
|
|
+ $arrConversiones = json_decode($_POST["CONVERSIONES"]);
|
|
|
+
|
|
|
+ $arrLw = json_decode($_POST["LW"]);
|
|
|
+ $arrKw = json_decode($_POST["KW"]);
|
|
|
+
|
|
|
+
|
|
|
+ $arrLwAVentiladorS = json_decode($_POST["LWAV"]);
|
|
|
+ $arrLwAVentilador = json_decode($_POST["LWAVA"]);
|
|
|
+
|
|
|
+ $arrSonidoR = json_decode($_POST["SONIDOR"]);
|
|
|
+ $arrCorreccion = json_decode($_POST["CORRECCION"]);
|
|
|
+ $arrSonidoMasCorrecion = json_decode($_POST["SONMASCORR"]);
|
|
|
+
|
|
|
+ $areaDeSalida = $_POST["AREASALIDA"];
|
|
|
+ $velocidadDeFluido = $_POST["VFLUIDO"];
|
|
|
+
|
|
|
+ $arrDatosLwFinal = json_decode($_POST["LWFINALDATOS"]);
|
|
|
+ $sumaLogaritmicaLwFinal = $_POST["SUMALWFINAL"];
|
|
|
+ $arrDatosLwA = json_decode($_POST["LWADATOS"]);
|
|
|
+ $sumaLogaritmicaLwA = $_POST["SUMALWA"];
|
|
|
+ $presionSonora = $_POST["PRESON"];
|
|
|
+ $presionSonoraA = $_POST["PRESONA"];
|
|
|
+
|
|
|
+ $arrDatosLwFinalVa = json_decode($_POST["LWFINALDATOSVA"]);
|
|
|
+ $sumaLogaritmicaLwFinalVa = $_POST["SUMALWFINALVA"];
|
|
|
+ $arrDatosLwAVa = json_decode($_POST["LWADATOSVA"]);
|
|
|
+ $sumaLogaritmicaLwAVa = $_POST["SUMALWAVA"];
|
|
|
+ $presionSonoraVa = $_POST["PRESONVA"];
|
|
|
+ $presionSonoraAVa = $_POST["PRESONAVA"];
|
|
|
+
|
|
|
+ $arrDatosAtenuador = json_decode($_POST["ATENUADOR"], true);
|
|
|
+
|
|
|
+
|
|
|
+ require_once('shared/plantillasPDF/Seleccion_Atenuedores_General.php');
|
|
|
+
|
|
|
+ $formatoPDF = new crearPDF('P', 'mm', 'Letter');
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ $formatoPDF->tipoPDF = $transaccionPDF;
|
|
|
+
|
|
|
+ $formatoPDF->datosEntrada = $arrDatosEntrada;
|
|
|
+ $formatoPDF->conversiones = $arrConversiones;
|
|
|
+
|
|
|
+ $formatoPDF->datosLw = $arrLw;
|
|
|
+ $formatoPDF->datosKw = $arrKw;
|
|
|
+
|
|
|
+ $formatoPDF->sonidoRegenerado = $arrSonidoR;
|
|
|
+ $formatoPDF->correcionArea = $arrCorreccion;
|
|
|
+ $formatoPDF->sonidoMasCorreccion = $arrSonidoMasCorrecion;
|
|
|
+
|
|
|
+ $formatoPDF->LwAVentilador = $arrLwAVentiladorS;
|
|
|
+ $formatoPDF->LwAVentiladorA = $arrLwAVentilador;
|
|
|
+
|
|
|
+ $formatoPDF->areaDeSalida = $areaDeSalida;
|
|
|
+ $formatoPDF->velocidadDeFluido = $velocidadDeFluido;
|
|
|
+
|
|
|
+ $formatoPDF->datosLwFinal = $arrDatosLwFinal;
|
|
|
+ $formatoPDF->sumaLogLwFinal = $sumaLogaritmicaLwFinal;
|
|
|
+ $formatoPDF->datosLwA = $arrDatosLwA;
|
|
|
+ $formatoPDF->sumaLogaritmicaLwA = $sumaLogaritmicaLwA;
|
|
|
+ $formatoPDF->presionSonora = $presionSonora;
|
|
|
+ $formatoPDF->presionSonoraA = $presionSonoraA;
|
|
|
+
|
|
|
+ $formatoPDF->DatosLwFinalVa = $arrDatosLwFinalVa;
|
|
|
+ $formatoPDF->sumaLogaritmicaLwFinalVa = $sumaLogaritmicaLwFinalVa;
|
|
|
+ $formatoPDF->DatosLwAVa = $arrDatosLwAVa;
|
|
|
+ $formatoPDF->sumaLogaritmicaLwAVa = $sumaLogaritmicaLwAVa;
|
|
|
+ $formatoPDF->presionSonoraVa = $presionSonoraVa;
|
|
|
+ $formatoPDF->presionSonoraAVa = $presionSonoraAVa;
|
|
|
+
|
|
|
+ $formatoPDF->datosAtenuadores = $arrDatosAtenuador;
|
|
|
+
|
|
|
+ $formatoPDF->p = 'I'; // I = Presenta en el navegador sin guardar; D = presenta opcion Guardar como; F = Guarda el documento sin abrirlo en el navegador
|
|
|
+ $formatoPDF->narch = 'CalculosDeAtenuacion_'.$arrDatosAtenuador['MODELO'].'.pdf';
|
|
|
+
|
|
|
+ $formatoPDF->genera_PDF();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+?>
|
|
|
+<!doctype html>
|
|
|
+<html lang="en">
|
|
|
+ <head>
|
|
|
+ <!-- Global site tag (gtag.js) - Google Analytics -->
|
|
|
+
|
|
|
+ <!--Pruebas-->
|
|
|
+ <!-- <script async src="https://www.googletagmanager.com/gtag/js?id=UA-125019062-1"></script> -->
|
|
|
+ <!--Producción-->
|
|
|
+ <script async src="https://www.googletagmanager.com/gtag/js?id=UA-125019062-2"></script>
|
|
|
+ <!--Pruebas-->
|
|
|
+ <!-- <script>
|
|
|
+
|
|
|
+ window.dataLayer = window.dataLayer || [];
|
|
|
+
|
|
|
+ function gtag(){dataLayer.push(arguments);}
|
|
|
+
|
|
|
+ gtag('js', new Date());
|
|
|
+
|
|
|
+ gtag('config', 'UA-125019062-1');
|
|
|
+
|
|
|
+ </script> -->
|
|
|
+ <!--Producción-->
|
|
|
+ <script>
|
|
|
+
|
|
|
+ window.dataLayer = window.dataLayer || [];
|
|
|
+
|
|
|
+ function gtag(){dataLayer.push(arguments);}
|
|
|
+
|
|
|
+ gtag('js', new Date());
|
|
|
+
|
|
|
+ gtag('config', 'UA-125019062-2');
|
|
|
+
|
|
|
+ </script>
|
|
|
+
|
|
|
+ <!-- End Global site tag (gtag.js) - Google Analytics -->
|
|
|
+ <!-- Required meta tags -->
|
|
|
+ <meta charset="utf-8">
|
|
|
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
|
+ <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
|
|
|
+ <link rel="stylesheet" type="text/css" href="css/style-table.css" media="all" />
|
|
|
+ <link rel="stylesheet" type="text/css" href="css/style-css01.css" media="all" />
|
|
|
+ <link rel="shortcut icon" href="https://statics.solerpalau.com/skin/frontend/solerpalau/default/favicon.ico" type="image/x-icon" />
|
|
|
+ <script src="https://cdn.jsdelivr.net/npm/alertifyjs@1.11.1/build/alertify.min.js"></script>
|
|
|
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/alertifyjs@1.11.1/build/css/alertify.min.css" />
|
|
|
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/alertifyjs@1.11.1/build/css/themes/default.min.css" />
|
|
|
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/alertifyjs@1.11.1/build/css/themes/semantic.min.css" />
|
|
|
+ <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/alertifyjs@1.11.1/build/css/themes/bootstrap.min.css" />
|
|
|
+ <link rel="stylesheet" type="text/css" href="css/style-table.css" media="all" />
|
|
|
+ <title> Selector de Atenuador S&P </title>
|
|
|
+ <script type="text/javascript" src="js/events.js"></script>
|
|
|
+ <style type="text/css">
|
|
|
+
|
|
|
+ .table thead td {
|
|
|
+ font-size: 15px;
|
|
|
+ font-weight: bold;
|
|
|
+ text-align: center;
|
|
|
+ color: #343434;
|
|
|
+ }
|
|
|
+
|
|
|
+ .table thead th {
|
|
|
+ font-size: 15px;
|
|
|
+ font-weight: bold;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .table tbody td {
|
|
|
+ font-size: 12px;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .table tfoot td {
|
|
|
+ font-size: 12px;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ </style>
|
|
|
+ </head>
|
|
|
+
|
|
|
+ <body>
|
|
|
+ <?php include 'header.php' ?>
|
|
|
+ <script type="text/javascript">
|
|
|
+ var $j = jQuery.noConflict();
|
|
|
+ //<![CDATA[
|
|
|
+ if (typeof HIB.menu == 'object' && typeof HIB.menu.init == 'function') {
|
|
|
+ HIB.menu.init();
|
|
|
+ }
|
|
|
+ //]]>
|
|
|
+ </script>
|
|
|
+ <div class="main-container col1-layout">
|
|
|
+ <div class="main">
|
|
|
+ <div class="col-main">
|
|
|
+ <main>
|
|
|
+ <div id="overlaySearch" class="overlay">
|
|
|
+ <div id="searchResults" class="overlay-content grid"></div>
|
|
|
+ </div>
|
|
|
+ <div class="page-title dark">
|
|
|
+ <img alt="Producción,distribución y logística" src="media/home/categories_home/recursos/hojas-tecnicas.jpg" style="width: 100%"/>
|
|
|
+ <div class="page-title-container">
|
|
|
+ <div class="page-title-content container">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="clearfix"> </div>
|
|
|
+ </div>
|
|
|
+ <form id="frm">
|
|
|
+ <input type="hidden" name="recaptcha_response" id="recaptchaResponse">
|
|
|
+ <div class="bar-title">
|
|
|
+ <h2 class="h2">Cálculo de atenuadores</h2>
|
|
|
+ <p class="container">
|
|
|
+ Esta Herramienta te servirá para calcular la atenuación del ruido emitido por los equipos de
|
|
|
+ <strong style="color: red; font-weight: bold;"> S&P</strong>, tomando como referencia las curvas NC.
|
|
|
+ </p>
|
|
|
+ <br/>
|
|
|
+ <!-- Inicion Inputs -->
|
|
|
+ <div class="container grid hcol-6-12">
|
|
|
+ <div class="container hcol-12-12">
|
|
|
+ <div class="form-group hcol-6-12">
|
|
|
+ <label for="TIPOV"> Tipo de Ventilador *</label>
|
|
|
+ <select class=" input-text validate-no-html-tags form-control" name="TIPOV" id="TIPOV" onchange="buscaModelo(this.value)" required="true" > </select>
|
|
|
+ </div>
|
|
|
+ <div class="form-group hcol-6-12">
|
|
|
+ <label for="MODELOV"> Modelo de Ventilador *</label>
|
|
|
+ <select class=" input-text validate-no-html-tags form-control" name="MODELOV" id="MODELOV" required="true"> </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="container hcol-12-12">
|
|
|
+ <div class="form-group hcol-6-12">
|
|
|
+ <label for="VCAUDAL"> Caudal (Q) *</label>
|
|
|
+ <input type="text" class=" input-text validate-no-html-tags form-control" name="VCAUDAL" id="VCAUDAL" onblur="agregarDecimales(this.id)" required="true">
|
|
|
+ </div>
|
|
|
+ <div class="form-group hcol-6-12">
|
|
|
+ <label for="#"> </label>
|
|
|
+ <select class=" validate-no-html-tags form-control" name="UMCAU" id="UMCAU"> </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="container hcol-12-12">
|
|
|
+ <div class="form-group hcol-6-12">
|
|
|
+ <label for="VPREE"> Presión Estatíca (P) *</label>
|
|
|
+ <input type="text" class=" input-text validate-no-html-tags form-control" name="VPREE" id="VPREE" onblur="agregarDecimales(this.id)" required="true">
|
|
|
+ </div>
|
|
|
+ <div class="form-group hcol-6-12">
|
|
|
+ <label for="#"> </label>
|
|
|
+ <select class=" input-text validate-no-html-tags form-control" name="UMPRE" id="UMPRE"> </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="container hcol-12-12">
|
|
|
+ <div class="form-group hcol-6-12">
|
|
|
+ <label for="VPOTE"> Potencias Absorbida (Bhp) *</label>
|
|
|
+ <input type="text" class=" input-text validate-no-html-tags form-control" name="VPOTE" id="VPOTE" onblur="agregarDecimales(this.id)" required="true">
|
|
|
+ </div>
|
|
|
+ <div class="form-group hcol-6-12">
|
|
|
+ <label for="#"> </label>
|
|
|
+ <select class=" input-text validate-no-html-tags form-control" name="UMPOT" id="UMPOT"> </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="container hcol-12-12">
|
|
|
+ <div class="form-group hcol-6-12">
|
|
|
+ <label for="DIAME"> Diamtero del Ventilador *</label>
|
|
|
+ <input type="text" class=" input-text validate-no-html-tags form-control" name="DIAME" id="DIAME" onblur="agregarDecimales(this.id)" required="true">
|
|
|
+ </div>
|
|
|
+ <div class="form-group hcol-6-12">
|
|
|
+ <label for="#"> </label>
|
|
|
+ <select class=" input-text validate-no-html-tags form-control" name="UMDIA" id="UMDIA"> </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="container hcol-12-12">
|
|
|
+ <div class="form-group hcol-12-12">
|
|
|
+ <label for="CURNC"> Curva NC *</label>
|
|
|
+ <select class=" input-text validate-no-html-tags form-control" name="CURNC" id="CURNC"> </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="container hcol-12-12">
|
|
|
+ <div class="form-group hcol-4-12">
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <div class="form-group hcol-4-12">
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <div class="form-group hcol-4-12" align="left">
|
|
|
+ <button type="button" id="CALCULAR" name="CALCULAR" onclick="validaCampos()" class="btn small"> Calcular </button>
|
|
|
+ <!-- <input type="button" id="CALCULAR" name="CALCULAR" onclick="validaCampos()" class="btn small" value="Calcular" > -->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="container grid hcol-6-12">
|
|
|
+ <div class="hcol-9-12" id="loading" style="display: none;">
|
|
|
+ <img src="media/img/loader2.gif" width="41px" >
|
|
|
+ </div>
|
|
|
+ <!-- Tabla de Resultados -->
|
|
|
+ <div id="tablaR" class="form-group hcol-12-12">
|
|
|
+ <div id="tablaResultados" class="table-responsive">
|
|
|
+ <?php echo $strTablaResultados; ?>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="container grid">
|
|
|
+ <div class="container">
|
|
|
+ <div class="form-group hcol-6-6">
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <form id="frmPDFGeneral" method="POST" action="<?php echo($_SERVER['PHP_SELF']);?>" target="_blank">
|
|
|
+
|
|
|
+ <input type="hidden" name="TRANSPDF" id="TRANSPDF" >
|
|
|
+ <input type="hidden" name="DATOSENTRADA" id="DATOSENTRADA" >
|
|
|
+ <input type="hidden" name="CONVERSIONES" id="CONVERSIONES" >
|
|
|
+
|
|
|
+ <input type="hidden" name="AREASALIDA" id="AREASALIDA" >
|
|
|
+ <input type="hidden" name="VFLUIDO" id="VFLUIDO" >
|
|
|
+
|
|
|
+ <input type="hidden" name="LW" id="LW" >
|
|
|
+ <input type="hidden" name="KW" id="KW" >
|
|
|
+
|
|
|
+ <input type="hidden" name="LWAV" id="LWAV" >
|
|
|
+ <input type="hidden" name="LWAVA" id="LWAVA" >
|
|
|
+
|
|
|
+ <input type="hidden" name="SONIDOR" id="SONIDOR" >
|
|
|
+ <input type="hidden" name="CORRECCION" id="CORRECCION" >
|
|
|
+ <input type="hidden" name="SONMASCORR" id="SONMASCORR" >
|
|
|
+
|
|
|
+
|
|
|
+ <input type="hidden" name="LWFINALDATOS" id="LWFINALDATOS" >
|
|
|
+ <input type="hidden" name="SUMALWFINAL" id="SUMALWFINAL" >
|
|
|
+ <input type="hidden" name="LWADATOS" id="LWADATOS" >
|
|
|
+ <input type="hidden" name="SUMALWA" id="SUMALWA" >
|
|
|
+ <input type="hidden" name="PRESON" id="PRESON" >
|
|
|
+ <input type="hidden" name="PRESONA" id="PRESONA" >
|
|
|
+
|
|
|
+ <input type="hidden" name="LWFINALDATOSVA" id="LWFINALDATOSVA" >
|
|
|
+ <input type="hidden" name="SUMALWFINALVA" id="SUMALWFINALVA" >
|
|
|
+ <input type="hidden" name="LWADATOSVA" id="LWADATOSVA" >
|
|
|
+ <input type="hidden" name="SUMALWAVA" id="SUMALWAVA" >
|
|
|
+ <input type="hidden" name="PRESONVA" id="PRESONVA" >
|
|
|
+ <input type="hidden" name="PRESONAVA" id="PRESONAVA" >
|
|
|
+
|
|
|
+ <input type="hidden" name="PRUEBA" id="PRUEBA" >
|
|
|
+
|
|
|
+ <input type="hidden" name="ATENUADOR" id="ATENUADOR" >
|
|
|
+
|
|
|
+ <input type="hidden" name="TRANS" id="TRANS" >
|
|
|
+
|
|
|
+ </form>
|
|
|
+
|
|
|
+
|
|
|
+ <div class="container-fluid">
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-sm-12" id="tabla"></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </main>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <?php include 'footer.php' ?>
|
|
|
+ </body>
|
|
|
+ <script src="https://ajax.googleapis.com/ajax/libs/dojo/1.10.0/dojo/dojo.js" data-dojo-config='parseOnLoad: true'></script>
|
|
|
+ <script type="text/javascript">
|
|
|
+
|
|
|
+ var idModulo = "CALC.ATEN"
|
|
|
+ var mensajeError = 0;
|
|
|
+ var arrErroresSistemaJs = new Array();
|
|
|
+ var arrErroresSistemaCalc = new Array();
|
|
|
+
|
|
|
+ <?php if ( isset($arrVentiladoresJs) ) { ?>
|
|
|
+ var arrVentiladores = <?php echo $arrVentiladoresJs; ?>
|
|
|
+ <?php } else { ?>
|
|
|
+ document.getElementById("TIPOV").disabled = true;
|
|
|
+ document.getElementById("MODELOV").disabled = true;
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.( ' + idModulo + ' ).0001 - Ocurrio un error al cargar el <b> Catálogo de Ventiladores </b> de S&P </b>';
|
|
|
+ arrErroresSistemaJs['0001'] = strMensaje;
|
|
|
+ mensajeError ++ ;
|
|
|
+ <?php } ?>
|
|
|
+
|
|
|
+ var newOptionI = document.createElement("option");
|
|
|
+ newOptionI.value = "";
|
|
|
+ newOptionI.text = "Seleccione un Tipo de Ventilador...";
|
|
|
+ document.getElementById("TIPOV").appendChild(newOptionI);
|
|
|
+ <?php if ( isset($arrTipoVentiladorJs) ) { ?>
|
|
|
+ var arrTiposVentiladores = <?php echo $arrTipoVentiladorJs; ?>;
|
|
|
+ Object.keys(arrTiposVentiladores).forEach( function( key ) {
|
|
|
+ var newOption = document.createElement("option");
|
|
|
+ newOption.value = key;
|
|
|
+ newOption.text = arrTiposVentiladores[key];
|
|
|
+ document.getElementById("TIPOV").appendChild(newOption);
|
|
|
+ });
|
|
|
+ <?php } else { ?>
|
|
|
+ document.getElementById("TIPOV").disabled = true;
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.( ' + idModulo + ' ).0002 - Ocurrio un error al cargar los <b> Tipos de Ventiladores </b> de S&P';
|
|
|
+ arrErroresSistemaJs['0002'] = strMensaje;
|
|
|
+ mensajeError ++ ;
|
|
|
+ <?php } ?>
|
|
|
+
|
|
|
+ <?php if ( isset($arrModeloVentiladorJs) ) { ?>
|
|
|
+ var arrModelosVentiladores = <?php echo $arrModeloVentiladorJs; ?>;
|
|
|
+ <?php } else { ?>
|
|
|
+ document.getElementById("MODELOV").disabled = true;
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.( ' + idModulo + ' ).0003 - Ocurrio un error al cargar los <b> Modelos de los Ventiladores </b> de S&P';
|
|
|
+ arrErroresSistemaJs['0003'] = strMensaje;
|
|
|
+ mensajeError ++ ;
|
|
|
+ <?php } ?>
|
|
|
+
|
|
|
+ var arrModelosSeleccionados = {};
|
|
|
+
|
|
|
+ var selectModelosVentiladores = document.getElementById("MODELOV");
|
|
|
+ var newOptionII = document.createElement("option");
|
|
|
+ newOptionII.value = "";
|
|
|
+ newOptionII.text = "Seleccione un Modelo de Ventilador...";
|
|
|
+ selectModelosVentiladores.appendChild(newOptionII);
|
|
|
+
|
|
|
+ function buscaModelo( tipoVentilador ) {
|
|
|
+ if ( selectModelosVentiladores.length > 0 ) {
|
|
|
+ while (selectModelosVentiladores.firstChild) {
|
|
|
+ selectModelosVentiladores.removeChild(selectModelosVentiladores.firstChild);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Object.keys(arrModelosVentiladores).forEach( function( arrModelos ) {
|
|
|
+ if ( arrModelos == tipoVentilador ) {
|
|
|
+ Object.keys(arrModelosVentiladores[arrModelos]).forEach( function( key ) {
|
|
|
+ var newOption = document.createElement("option");
|
|
|
+ newOption.value = key;
|
|
|
+ newOption.text = arrModelosVentiladores[arrModelos][key];
|
|
|
+ selectModelosVentiladores.appendChild(newOption);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ // Contiene las Unidades de Medida de la Caudal para Posibles conversiones
|
|
|
+ var arrUnidadesCaudal = <?php echo $arrUnidadMedidaCaudalJs; ?>;
|
|
|
+ Object.keys(arrUnidadesCaudal).forEach( function( key ) {
|
|
|
+ var newOption = document.createElement("option");
|
|
|
+ if ( key == "CFM" ) {
|
|
|
+ newOption.selected = true;
|
|
|
+ }
|
|
|
+ newOption.value = key;
|
|
|
+ newOption.text = arrUnidadesCaudal[key];
|
|
|
+ document.getElementById("UMCAU").appendChild(newOption);
|
|
|
+ });
|
|
|
+
|
|
|
+ // Contiene las Unidades de Medida de la de la Presión Estatíca para Posibles conversiones
|
|
|
+ var arrUnidadMedidaPresionE = <?php echo $arrUnidadMedidaPresionEJs; ?>;
|
|
|
+ Object.keys(arrUnidadMedidaPresionE).forEach( function( key ) {
|
|
|
+ var newOption = document.createElement("option");
|
|
|
+ if ( key == "INWG" ) {
|
|
|
+ newOption.selected = true;
|
|
|
+ }
|
|
|
+ newOption.value = key;
|
|
|
+ newOption.text = arrUnidadMedidaPresionE[key];
|
|
|
+ document.getElementById("UMPRE").appendChild(newOption);
|
|
|
+ });
|
|
|
+
|
|
|
+ // Contiene las Unidades de Medida de la de la Potencia Absorbida para Posibles conversiones
|
|
|
+ var arrUnidadMedidaPotenciaA = <?php echo $arrUnidadMedidaPotenciaAJs; ?>;
|
|
|
+ Object.keys(arrUnidadMedidaPotenciaA).forEach( function( key ) {
|
|
|
+ var newOption = document.createElement("option");
|
|
|
+ if ( key == "BHP" ) {
|
|
|
+ newOption.selected = true;
|
|
|
+ }
|
|
|
+ newOption.value = key;
|
|
|
+ newOption.text = arrUnidadMedidaPotenciaA[key];
|
|
|
+ document.getElementById("UMPOT").appendChild(newOption);
|
|
|
+ });
|
|
|
+
|
|
|
+ // Contiene las Unidades de Medida del Diametro para Posibles conversiones
|
|
|
+ var arrUnidadMedidaDiametro = <?php echo $arrUnidadMedidaDiametroJs; ?>;
|
|
|
+ Object.keys(arrUnidadMedidaDiametro).forEach( function( key ) {
|
|
|
+ var newOption = document.createElement("option");
|
|
|
+ if ( key == "FT" ) {
|
|
|
+ newOption.selected = true;
|
|
|
+ }
|
|
|
+ newOption.value = key;
|
|
|
+ newOption.text = arrUnidadMedidaDiametro[key];
|
|
|
+ document.getElementById("UMDIA").appendChild(newOption);
|
|
|
+ });
|
|
|
+
|
|
|
+ // Contiene las CurvasNC posibles
|
|
|
+ var arrCurvaNC = <?php echo $arrCurvaNCSJs; ?>;
|
|
|
+ Object.keys(arrCurvaNC).forEach( function( key ) {
|
|
|
+ var newOption = document.createElement("option");
|
|
|
+ newOption.value = key;
|
|
|
+ newOption.text = arrCurvaNC[key];
|
|
|
+ document.getElementById("CURNC").appendChild(newOption);
|
|
|
+ });
|
|
|
+
|
|
|
+ // Función para Precisar los decimales de cada Valor
|
|
|
+ function agregarDecimales( idInput ) {
|
|
|
+ var presicionDecimales = parseInt(8);
|
|
|
+ var valorInput = document.getElementById(idInput).value;
|
|
|
+ if ( valorInput.length > 0 ) {
|
|
|
+ if ( /^\d*\.?\d*$/.test(valorInput) ) {
|
|
|
+ var valorInput = parseFloat(valorInput);
|
|
|
+ var valorInput = valorInput.toFixed(presicionDecimales);
|
|
|
+ document.getElementById(idInput).value = valorInput;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function validaCampos() {
|
|
|
+
|
|
|
+ var boolValido = "";
|
|
|
+ var presicionDecimales = parseInt(8);
|
|
|
+ var arrDatosCalculos = new Array();
|
|
|
+ var tipoVentilador = document.getElementById('TIPOV').value;
|
|
|
+ var modeloVentilador = document.getElementById('MODELOV').value;
|
|
|
+ if ( tipoVentilador.length == 0 ) {
|
|
|
+ alertify.confirm( 'Datos de Entrada Incompletos', 'Debe seleccionar un <b> Tipo de Ventilador </b> de la lista de Opciones.', function() { },
|
|
|
+ function() { } ).set('labels', { ok: 'Continuar', cancel: 'Cancelar' } );
|
|
|
+ document.getElementById('TIPOV').focus();
|
|
|
+ boolValido = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if ( modeloVentilador.length == 0 ) {
|
|
|
+ alertify.confirm( 'Datos de Entrada Incompletos', 'Debe seleccionar un <b> Modelo de Ventilador </b> de la lista de Opciones.', function() { },
|
|
|
+ function() { } ).set('labels', { ok: 'Continuar', cancel: 'Cancelar' } );
|
|
|
+ document.getElementById('MODELOV').focus();
|
|
|
+ boolValido = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var inputsValores = document.querySelectorAll('#frm input[type="text"]');
|
|
|
+ for ( index = 0; index < inputsValores.length; ++index ) {
|
|
|
+ var idInput = inputsValores[index].getAttribute("name");
|
|
|
+ if( idInput != null ) {
|
|
|
+ var valorInput = document.getElementById(idInput).value;
|
|
|
+ if ( valorInput.length > 0 ) {
|
|
|
+ var vInput = parseFloat(valorInput);
|
|
|
+ vInput = vInput.toFixed(presicionDecimales);
|
|
|
+ if ( /^\d*\.?\d*$/.test(vInput) ) {
|
|
|
+ if ( idInput == "VCAUDAL" ) {
|
|
|
+ arrDatosCalculos[idInput] = vInput + "||" + document.getElementById('UMCAU').value + "||" + "CAUDAL";
|
|
|
+ }
|
|
|
+ if ( idInput == "VPREE" ) {
|
|
|
+ arrDatosCalculos[idInput] = vInput + "||" + document.getElementById('UMPRE').value + "||" + "PRE";
|
|
|
+ }
|
|
|
+ if ( idInput == "VPOTE" ) {
|
|
|
+ arrDatosCalculos[idInput] = vInput + "||" + document.getElementById('UMPOT').value + "||" + "POTE";
|
|
|
+ }
|
|
|
+ if ( idInput == "DIAME" ) {
|
|
|
+ arrDatosCalculos[idInput] = vInput + "||" + document.getElementById('UMDIA').value + "||" + "DIAME";
|
|
|
+ }
|
|
|
+ boolValido = true;
|
|
|
+ } else {
|
|
|
+ var campo = "";
|
|
|
+ if ( idInput == "VCAUDAL" ) {
|
|
|
+ campo = "Caudal (Q)";
|
|
|
+ }
|
|
|
+ if ( idInput == "VPREE" ) {
|
|
|
+ campo = "Presión Estatíca (P)";
|
|
|
+ }
|
|
|
+ if ( idInput == "VPOTE" ) {
|
|
|
+ campo = "Potencia Absorbida (Bhp)";
|
|
|
+ }
|
|
|
+ if ( idInput == "DIAME" ) {
|
|
|
+ campo = "Diametro del Ventilador";
|
|
|
+ }
|
|
|
+ alertify.confirm( 'Datos de Entrada Incompletos', 'El campo <b>' + campo + '</b> debe de contener solo números (enteros ó decimales). ', function() { },
|
|
|
+ function() { } ).set('labels', { ok: 'Continuar', cancel: 'Cancelar' } );
|
|
|
+ document.getElementById(idInput).focus();
|
|
|
+ boolValido = false;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ var campo = "";
|
|
|
+ if ( idInput == "VCAUDAL" ) {
|
|
|
+ campo = "Caudal (Q)";
|
|
|
+ }
|
|
|
+ if ( idInput == "VPREE" ) {
|
|
|
+ campo = "Presión Estatíca (P)";
|
|
|
+ }
|
|
|
+ if ( idInput == "VPOTE" ) {
|
|
|
+ campo = "Potencia Absorbida (Bhp)";
|
|
|
+ }
|
|
|
+ if ( idInput == "DIAME" ) {
|
|
|
+ campo = "Diametro del Ventilador";
|
|
|
+ }
|
|
|
+ boolValido = false;
|
|
|
+ alertify.confirm( 'Datos de Entrada Incompletos', 'El campo <b>' + campo + '</b> es un dato Requerido. ', function() { },
|
|
|
+ function() { } ).set('labels', { ok: 'Continuar', cancel: 'Cancelar' } );
|
|
|
+ document.getElementById(idInput).focus();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var curvaNC = document.getElementById('CURNC').value;
|
|
|
+ if ( curvaNC.length == 0 ) {
|
|
|
+ alertify.confirm( 'Datos de Entrada Incompletos', 'Debe seleccionar una <b> Caudal </b> de la lista de Opciones', function() { },
|
|
|
+ function() { } ).set('labels', { ok: 'Continuar', cancel: 'Cancelar' } );
|
|
|
+ document.getElementById('CURNC').focus();
|
|
|
+ boolValido = false;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if ( boolValido == true ) {
|
|
|
+ realizaCalculos( tipoVentilador, modeloVentilador, arrDatosCalculos, curvaNC );
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ function precisarDecimales ( presicion, numero ) {
|
|
|
+ valor = parseFloat(numero);
|
|
|
+ valorD = valor.toFixed(presicion);
|
|
|
+ return valorD;
|
|
|
+ }
|
|
|
+
|
|
|
+ <?php if ( isset($arrAtenuacionJs) ) { ?>
|
|
|
+ var arrAtenuacion = <?php echo $arrAtenuacionJs; ?>
|
|
|
+ <?php } else { ?>
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.( ' + idModulo + ' ).0004 - Ocurrio un error al cargar el <b> Catálogo de Atenuadores </b> de S&P, ';
|
|
|
+ arrErroresSistemaJs['0004'] = strMensaje;
|
|
|
+ mensajeError ++ ;
|
|
|
+ <?php } ?>
|
|
|
+
|
|
|
+ <?php if ( isset($arrPotenciaSonoraJs) ) { ?>
|
|
|
+ var arrPotenciaSonora = <?php echo $arrPotenciaSonoraJs; ?>
|
|
|
+ <?php } else { ?>
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.( ' + idModulo + ' ).0005 - Ocurrio un error al cargar las <b> Potencias Sonoras </b> requeridas para el calcúlo de atenuadores de S&P, ';
|
|
|
+ arrErroresSistemaJs['0005'] = strMensaje;
|
|
|
+ mensajeError ++ ;
|
|
|
+ <?php } ?>
|
|
|
+
|
|
|
+ if ( mensajeError > 0 ) {
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.( ' + idModulo + ' ) - La calculadora de atenuadores no se encuentra funcionando correctamente en estos momentos, favor de intentarlo más tarde.';
|
|
|
+ alertify.confirm( 'Error...', strMensaje, function() { location.reload(true); },
|
|
|
+ function() { location.href = "atenuadores.php"; } ).set('labels', { ok: 'Continuar', cancel: 'Cancelar' } );
|
|
|
+ function onKeyDownHandler(event) {
|
|
|
+ var t1 = 1;
|
|
|
+ var accion = "";
|
|
|
+ var codigo = event.which || event.keyCode;
|
|
|
+ if ( ( t1 == 1) && ( codigo == 76 ) ){
|
|
|
+ var error = "";
|
|
|
+ Object.keys(arrErroresSistemaJs).forEach( function( indice ) {
|
|
|
+ error += arrErroresSistemaJs[indice] + "<br>";
|
|
|
+ });
|
|
|
+ alertify.confirm( 'Errores...', error, function() { },
|
|
|
+ function() { } ).set('labels', { ok: 'Continuar', cancel: 'Cancelar' } );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ window.onkeydown = onKeyDownHandler;
|
|
|
+ }
|
|
|
+
|
|
|
+ function realizaCalculos ( tipo, modelo, datos, curva ) {
|
|
|
+
|
|
|
+ var vCaudal = "";
|
|
|
+ var vPresionE = "";
|
|
|
+ var vPotenciaA = "";
|
|
|
+ var vDiametro = "";
|
|
|
+ var boolValido = true;
|
|
|
+ var presicionDecimales = parseInt(8);
|
|
|
+
|
|
|
+ var strMensaje = "";
|
|
|
+ var mensajeErrorCalc = 0;
|
|
|
+
|
|
|
+ var arrDatosDeEntrada = new Array();
|
|
|
+ var arrConversiones = new Array();
|
|
|
+ var arrCalculos = new Array();
|
|
|
+
|
|
|
+ // Contiene los parametros de las Octavas de Banda Frecuencia - Hz
|
|
|
+ var arrFrecuencias = [ "63Hz", "125Hz", "250Hz", "500Hz", "1000Hz", "2000Hz", "4000Hz", "8000Hz"];
|
|
|
+ // Contiene los parametros de la Ponderancia A
|
|
|
+ var arrPonderanciaA = [ -26.2, -16.1, -8.6, -3.2, 0.0, 1.2, 1.0, -1.1 ];
|
|
|
+
|
|
|
+ arrDatosDeEntrada['TipoVentilador'] = tipo ;
|
|
|
+ arrDatosDeEntrada['ModeloVentilador'] = modelo;
|
|
|
+
|
|
|
+ Object.keys(arrVentiladores).forEach( function( key ) {
|
|
|
+ Object.keys(arrVentiladores[key]).forEach( function( keyVentilador ) {
|
|
|
+ if ( arrVentiladores[key]['IDMODELO'] == modelo ){
|
|
|
+ arrDatosDeEntrada['ModeloVentilador'] = arrVentiladores[key]['MODELO'];
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ Object.keys(datos).forEach( function( key ) {
|
|
|
+
|
|
|
+ var splitDatos = datos[key].split( "||" );
|
|
|
+ var valorCampo = splitDatos[0];
|
|
|
+ var unidadDeMedida = splitDatos[1];
|
|
|
+ var campoDato = splitDatos[2];
|
|
|
+
|
|
|
+ if ( campoDato == "CAUDAL" ) {
|
|
|
+ arrDatosDeEntrada['Caudal'] = "" + valorCampo + " " + unidadDeMedida;
|
|
|
+ switch ( unidadDeMedida ) { // Conversiones para la Caudal
|
|
|
+ case 'M3/S':
|
|
|
+ vCaudal = valorCampo / 0.0004719;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vCaudal );
|
|
|
+ arrConversiones['Caudal'] = "( " + valorCampo + " " + unidadDeMedida + " / " + "0.028314 M3/S ) X 1 CFM = " + presicion + " CFM";
|
|
|
+ break;
|
|
|
+ case 'M3/MIN':
|
|
|
+ vCaudal = valorCampo / 0.028314;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vCaudal );
|
|
|
+ arrConversiones['Caudal'] = "( " + valorCampo + " " + unidadDeMedida + " / " + "0.028314 M3/MIN ) X 1 CFM = " + presicion + " CFM";
|
|
|
+ break;
|
|
|
+ case 'M3/H':
|
|
|
+ vCaudal = valorCampo / 1.699011;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vCaudal );
|
|
|
+ arrConversiones['Caudal'] = "( " + valorCampo + " " + unidadDeMedida + " / " + "0.699011 M3/H ) X 1 CFM = " + presicion + " CFM";
|
|
|
+ break;
|
|
|
+ case 'L/S':
|
|
|
+ vCaudal = valorCampo * 2.119;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vCaudal );
|
|
|
+ arrConversiones['Caudal'] = "( " + valorCampo + " " + unidadDeMedida + " X " + "2.119 L/S ) X 1 CFM = " + presicion + " CFM";
|
|
|
+ break;
|
|
|
+ case 'L/MIN':
|
|
|
+ vCaudal = valorCampo / 28.32;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vCaudal );
|
|
|
+ arrConversiones['Caudal'] = "( " + valorCampo + " " + unidadDeMedida + " / " + "28.32 L/MIN ) X 1 CFM = " + presicion + " CFM";
|
|
|
+ break;
|
|
|
+ case 'L/H':
|
|
|
+ vCaudal = valorCampo / 1699;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vCaudal );
|
|
|
+ arrConversiones['Caudal'] = "( " + valorCampo + " " + unidadDeMedida + " / " + "1699 L/H ) X 1 CFM = " + presicion + " CFM";
|
|
|
+ break;
|
|
|
+ case 'CM3/S':
|
|
|
+ vCaudal = valorCampo / 471.9;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vCaudal );
|
|
|
+ arrConversiones['Caudal'] = "( " + valorCampo + " " + unidadDeMedida + " / " + "471.9 CM3/S ) X 1 CFM = " + presicion + " CFM";
|
|
|
+ arrConversiones[unidadDeMedida] = "" + valorCampo + " / " + "471.9 = " + vCaudal + "";
|
|
|
+ break;
|
|
|
+ case 'CM3/MIN':
|
|
|
+ vCaudal = valorCampo / 28314;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vCaudal );
|
|
|
+ arrConversiones['Caudal'] = "( " + valorCampo + " " + unidadDeMedida + " / " + "278314 CM3/MIN ) X 1 CFM = " + presicion + " CFM";
|
|
|
+ break;
|
|
|
+ case 'CM3/H':
|
|
|
+ vCaudal = valorCampo / 1698840;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vCaudal );
|
|
|
+ arrConversiones['Caudal'] = "( " + valorCampo + " " + unidadDeMedida + " / " + "1698840 CM3/H ) X 1 CFM = " + presicion + " CFM";
|
|
|
+ break;
|
|
|
+ case 'GALON/S':
|
|
|
+ vCaudal = valorCampo / 0.12467532;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vCaudal );
|
|
|
+ arrConversiones['Caudal'] = "( " + valorCampo + " " + unidadDeMedida + " / " + "0.12467532 GALON/S) X 1 CFM = " + presicion + " CFM";
|
|
|
+ break;
|
|
|
+ case 'GALON/MIN':
|
|
|
+ vCaudal = valorCampo / 7.4805195566834;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vCaudal );
|
|
|
+ arrConversiones['Caudal'] = "( " + valorCampo + " " + unidadDeMedida + " / " + "7.4805195566834 GALON/MIN ) X 1 CFM = " + presicion + " CFM";
|
|
|
+ break;
|
|
|
+ case 'GALON/H':
|
|
|
+ vCaudal = valorCampo / 448.8311734;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vCaudal );
|
|
|
+ arrConversiones['Caudal'] = "( " + valorCampo + " " + unidadDeMedida + " / " + "448.8311734 GALON/H ) X 1 CFM = " + presicion + " CFM";
|
|
|
+ break;
|
|
|
+ case 'CFM':
|
|
|
+ vCaudal = valorCampo;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ vCaudal = parseFloat(vCaudal);
|
|
|
+ vCaudal = vCaudal.toFixed(presicionDecimales);
|
|
|
+ }
|
|
|
+
|
|
|
+ if ( campoDato == "PRE" ) {
|
|
|
+ arrDatosDeEntrada['PresionEstatica'] = "" + valorCampo + " " + unidadDeMedida;
|
|
|
+ switch ( unidadDeMedida ) { // Conversiones para la Presión Estatíca
|
|
|
+ case 'MPA':
|
|
|
+ vPresionE = valorCampo * 401.47;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vPresionE );
|
|
|
+ arrConversiones['Presion Estatica'] = "(" + valorCampo + " " + unidadDeMedida + " X " + "401.47 MPA ) X 1 INWG = " + presicion + " INWG";
|
|
|
+ break;
|
|
|
+ case 'KPA':
|
|
|
+ vPresionE = valorCampo * 4.0147;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vPresionE );
|
|
|
+ arrConversiones['Presion Estatica'] = "(" + valorCampo + " " + unidadDeMedida + " X " + "4.0147 KPA ) X 1 INWG = " + presicion + " INWG";
|
|
|
+ break;
|
|
|
+ case 'PA':
|
|
|
+ vPresionE = valorCampo * 0.0040147;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vPresionE );
|
|
|
+ arrConversiones['Presion Estatica'] = "(" + valorCampo + " " + unidadDeMedida + " X " + "0.0040147 PA ) X 1 INWG = " + presicion + " INWG";
|
|
|
+ break;
|
|
|
+ case 'BAR':
|
|
|
+ vPresionE = valorCampo * 401.865;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vPresionE );
|
|
|
+ arrConversiones['Presion Estatica'] = "(" + valorCampo + " " + unidadDeMedida + " X " + "401.865 BAR ) X 1 INWG = " + presicion + " INWG";
|
|
|
+ break;
|
|
|
+ case 'M CA':
|
|
|
+ vPresionE = valorCampo * 39.166667;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vPresionE );
|
|
|
+ arrConversiones['Presion Estatica'] = "(" + valorCampo + " " + unidadDeMedida + " X " + "39.166667 ) X 1 INWG = " + presicion + " INWG";
|
|
|
+ break;
|
|
|
+ case 'CM CA':
|
|
|
+ vPresionE = valorCampo * 0.39166667;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vPresionE );
|
|
|
+ arrConversiones['Presion Estatica'] = "(" + valorCampo + " " + unidadDeMedida + " X " + "0.39166667 CM CA ) X 1 INWG = " + presicion + " INWG";
|
|
|
+ break;
|
|
|
+ case 'MM CA':
|
|
|
+ vPresionE = valorCampo * 0.039166667;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vPresionE );
|
|
|
+ arrConversiones['Presion Estatica'] = "(" + valorCampo + " " + unidadDeMedida + " X " + "0.039166667 MM CA ) X 1 INWG = " + presicion + " INWG";
|
|
|
+ break;
|
|
|
+ case 'IN HG':
|
|
|
+ vPresionE = valorCampo / 0.0735541043;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vPresionE );
|
|
|
+ arrConversiones['Presion Estatica'] = "(" + valorCampo + " " + unidadDeMedida + " X " + "0.0735541043 ) X 1 INWG = " + presicion + " INWG";
|
|
|
+ break;
|
|
|
+ case 'CM HG':
|
|
|
+ vPresionE = valorCampo / 0.18682743044;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vPresionE );
|
|
|
+ arrConversiones['Presion Estatica'] = "(" + valorCampo + " " + unidadDeMedida + " X " + "0.18682743044 CM HG ) X 1 INWG = " + presicion + " INWG";
|
|
|
+ break;
|
|
|
+ case 'MM HG':
|
|
|
+ vPresionE = valorCampo / 0.018682743044;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vPresionE );
|
|
|
+ arrConversiones['Presion Estatica'] = "(" + valorCampo + " " + unidadDeMedida + " X " + "0.018682743044 MM HG ) X 1 INWG = " + presicion + " INWG";
|
|
|
+ break;
|
|
|
+ case 'TORR':
|
|
|
+ vPresionE = valorCampo * 0.5352533071;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vPresionE );
|
|
|
+ arrConversiones['Presion Estatica'] = "(" + valorCampo + " " + unidadDeMedida + " X " + "0.5352533071 TORR ) X 1 INWG = " + presicion + " INWG";
|
|
|
+ break;
|
|
|
+ case 'INWG':
|
|
|
+ vPresionE = valorCampo;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ vPresionE = parseFloat(vPresionE);
|
|
|
+ vPresionE = vPresionE.toFixed(presicionDecimales);
|
|
|
+ }
|
|
|
+
|
|
|
+ if ( campoDato == "POTE" ) {
|
|
|
+ arrDatosDeEntrada['PotenciaAbsorbida'] = " " + valorCampo + " " + unidadDeMedida;
|
|
|
+ switch ( unidadDeMedida ) { // Conversiones para la Potencia Absorbida
|
|
|
+ case 'HP':
|
|
|
+ vPotenciaA = valorCampo / 13.1549;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vPotenciaA );
|
|
|
+ arrConversiones['Potencia Absorbida'] = "(" + valorCampo + " " + unidadDeMedida + " / " + "13.1549 HP ) X 1 BHP = " + presicion + " BHP";
|
|
|
+ break;
|
|
|
+ case 'J/S':
|
|
|
+ vPotenciaA = valorCampo / 9809.5;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vPotenciaA );
|
|
|
+ arrConversiones['Potencia Absorbida'] = "(" + valorCampo + " " + unidadDeMedida + " / " + "9809.5 J/S ) X 1 BHP = " + presicion + " BHP";
|
|
|
+ break;
|
|
|
+ case 'KCAL/H':
|
|
|
+ vPotenciaA = valorCampo / 8434.65;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vPotenciaA );
|
|
|
+ arrConversiones['Potencia Absorbida'] = "(" + valorCampo + " " + unidadDeMedida + " / " + "8434.65 KCAL ) X 1 BHP = " + presicion + " BHP";
|
|
|
+ break;
|
|
|
+ case 'KW':
|
|
|
+ vPotenciaA = valorCampo / 9.8095;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vPotenciaA );
|
|
|
+ arrConversiones['Potencia Absorbida'] = "(" + valorCampo + " " + unidadDeMedida + " / " + "8434.65 KW ) X 1 BHP = " + presicion + " BHP";
|
|
|
+ break;
|
|
|
+ case 'WATT':
|
|
|
+ vPotenciaA = valorCampo / 9809.5;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vPotenciaA );
|
|
|
+ arrConversiones['Potencia Absorbida'] = "(" + valorCampo + " " + unidadDeMedida + " / " + "8434.65 WATT ) X 1 BHP = " + presicion + " BHP";
|
|
|
+ break;
|
|
|
+ case 'PIE-LIBRA(S)':
|
|
|
+ vPotenciaA = valorCampo / 7235.12;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vPotenciaA );
|
|
|
+ arrConversiones['Potencia Absorbida'] = "(" + valorCampo + " " + unidadDeMedida + " / " + "8434.65 PIE-LIBRA(S) ) X 1 BHP = " + presicion + " BHP";
|
|
|
+ break;
|
|
|
+ case 'PIE-LIBRA(M)':
|
|
|
+ vPotenciaA = valorCampo / 434106.95;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vPotenciaA );
|
|
|
+ arrConversiones['Potencia Absorbida'] = "(" + valorCampo + " " + unidadDeMedida + " / " + "8434.65 PIE-LIBRA(M) ) X 1 BHP = " + presicion + " BHP";
|
|
|
+ break;
|
|
|
+ case 'BHP':
|
|
|
+ vPotenciaA = valorCampo;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ vPotenciaA = parseFloat(vPotenciaA);
|
|
|
+ vPotenciaA = vPotenciaA.toFixed(presicionDecimales);
|
|
|
+ }
|
|
|
+
|
|
|
+ if ( campoDato == "DIAME" ) {
|
|
|
+ arrDatosDeEntrada['Diametro'] = " " + valorCampo + " " + unidadDeMedida;
|
|
|
+ switch ( unidadDeMedida ) { // Conversiones para el Diametro
|
|
|
+ case 'MM':
|
|
|
+ vDiametro = (valorCampo * 3.291) / 1000;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vDiametro );
|
|
|
+ arrConversiones['Diametro'] = "() (" + valorCampo + " " + unidadDeMedida + " X " + "3.291 MM ) / 1000 ) X 1 FT = " + presicion + " FT";
|
|
|
+ break;
|
|
|
+ case 'CM':
|
|
|
+ vDiametro = (valorCampo * 3.291) / 100;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vDiametro );
|
|
|
+ arrConversiones['Diametro'] = "( (" + valorCampo + " " + unidadDeMedida + " X " + "3.291 CM ) / 100 ) X 1 FT = " + presicion + " FT";
|
|
|
+ break;
|
|
|
+ case 'DM':
|
|
|
+ vDiametro = (valorCampo * 3.291) / 10;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vDiametro );
|
|
|
+ arrConversiones['Diametro'] = "( (" + valorCampo + " " + unidadDeMedida + " X " + "13.1549 DM ) / 10 ) X 1 FT = " + presicion + " FT";
|
|
|
+ break;
|
|
|
+ case 'M':
|
|
|
+ vDiametro = valorCampo * 3.291;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vDiametro );
|
|
|
+ arrConversiones['Diametro'] = "(" + valorCampo + " " + unidadDeMedida + " X " + "13.1549 M ) X 1 FT = " + presicion + " FT";
|
|
|
+ arrConversiones[unidadDeMedida] = "" + valorCampo + " X " + "13.1549 = " + vDiametro + "";
|
|
|
+ break;
|
|
|
+ case 'MI':
|
|
|
+ vDiametro = valorCampo * 5280;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vDiametro );
|
|
|
+ arrConversiones['Diametro'] = "(" + valorCampo + " " + unidadDeMedida + " X " + "5280 MI ) X 1 FT = " + presicion + " FT";
|
|
|
+ break;
|
|
|
+ case 'YARDA':
|
|
|
+ vDiametro = valorCampo / 3;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vDiametro );
|
|
|
+ arrConversiones['Diametro'] = "(" + valorCampo + " " + unidadDeMedida + " / " + "3 YARDA ) X 1 FT = " + presicion + " FT";
|
|
|
+ break;
|
|
|
+ case 'INCH':
|
|
|
+ vDiametro = valorCampo * 0.083333;
|
|
|
+ var presicion = precisarDecimales( presicionDecimales, vDiametro );
|
|
|
+ arrConversiones['Diametro'] = "(" + valorCampo + " " + unidadDeMedida + " X " + "0.083333 MM ) X 1 FT = " + presicion + " FT";
|
|
|
+ break;
|
|
|
+ case 'FT':
|
|
|
+ vDiametro = valorCampo;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ vDiametro = parseFloat(vDiametro);
|
|
|
+ vDiametro = vDiametro.toFixed(presicionDecimales);
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ var arrDatosVentilador = new Array(); // Contiene los Datos del Ventilador Seleccionado
|
|
|
+ Object.keys(arrVentiladores).forEach( function( keyVentiladores ) {
|
|
|
+ var arrVentilador = arrVentiladores[keyVentiladores];
|
|
|
+ Object.keys(arrVentilador).forEach( function( keyVentilador ) {
|
|
|
+ if ( arrVentilador['TIPO'] == tipo ) {
|
|
|
+ if ( (arrVentilador['DESC'] == modelo) || (arrVentilador['IDMODELO'] == modelo) ) {
|
|
|
+ arrDatosVentilador[keyVentilador] = arrVentilador[keyVentilador];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ var arrCurvaNC = new Array(); // Contiene el valor de cada frecuencia dependiendo de la CurvaNC seleccionada
|
|
|
+ switch( curva ) {
|
|
|
+ case 'NC15':
|
|
|
+ arrDatosDeEntrada['CurvaNC'] = "" + curva + "##" + "[ 47, 36, 29, 22, 17, 14, 12, 11 ]";
|
|
|
+ arrCurvaNC = [ 47, 36, 29, 22, 17, 14, 12, 11 ];
|
|
|
+ break;
|
|
|
+ case 'NC20':
|
|
|
+ arrDatosDeEntrada['CurvaNC'] = "" + curva + "##" + "[ 51, 40, 33, 26, 22, 19, 17, 16 ]";
|
|
|
+ arrCurvaNC = [ 51, 40, 33, 26, 22, 19, 17, 16 ];
|
|
|
+ break;
|
|
|
+ case 'NC25':
|
|
|
+ arrDatosDeEntrada['CurvaNC'] = "" + curva + "##" + "[ 54, 44, 37, 31, 27, 24, 22, 21 ]";
|
|
|
+ arrCurvaNC = [ 54, 44, 37, 31, 27, 24, 22, 21 ];
|
|
|
+ break;
|
|
|
+ case 'NC30':
|
|
|
+ arrDatosDeEntrada['CurvaNC'] = "" + curva + "##" + "[ 57, 48, 41, 35, 31, 29, 28, 27 ]";
|
|
|
+ arrCurvaNC = [ 57, 48, 41, 35, 31, 29, 28, 27 ];
|
|
|
+ break;
|
|
|
+ case 'NC35':
|
|
|
+ arrDatosDeEntrada['CurvaNC'] = "" + curva + "##" + "[ 60, 52, 45, 40, 36, 34, 33, 32 ]";
|
|
|
+ arrCurvaNC = [ 60, 52, 45, 40, 36, 34, 33, 32 ];
|
|
|
+ break;
|
|
|
+ case 'NC40':
|
|
|
+ arrDatosDeEntrada['CurvaNC'] = "" + curva + "##" + "[ 64, 56, 50, 45, 41, 39, 38, 37 ]";
|
|
|
+ arrCurvaNC = [ 64, 56, 50, 45, 41, 39, 38, 37 ];
|
|
|
+ break;
|
|
|
+ case 'NC45':
|
|
|
+ arrDatosDeEntrada['CurvaNC'] = "" + curva + "##" + "[ 67, 60, 54, 49, 46, 44, 43, 42 ]";
|
|
|
+ arrCurvaNC = [ 67, 60, 54, 49, 46, 44, 43, 42 ];
|
|
|
+ break;
|
|
|
+ case 'NC50':
|
|
|
+ arrDatosDeEntrada['CurvaNC'] = "" + curva + "##" + "[ 71, 64, 58, 54, 51, 49, 48, 47 ]";
|
|
|
+ arrCurvaNC = [ 71, 64, 58, 54, 51, 49, 48, 47 ];
|
|
|
+ break;
|
|
|
+ case 'NC55':
|
|
|
+ arrDatosDeEntrada['CurvaNC'] = "" + curva + "##" + "[ 74, 67, 62, 58, 56, 54, 53, 52 ]";
|
|
|
+ arrCurvaNC = [ 74, 67, 62, 58, 56, 54, 53, 52 ];
|
|
|
+ break;
|
|
|
+ case 'NC60':
|
|
|
+ arrDatosDeEntrada['CurvaNC'] = "" + curva + "##" + "[ 77, 71, 67, 63, 61, 59, 58, 57 ]";
|
|
|
+ arrCurvaNC = [ 77, 71, 67, 63, 61, 59, 58, 57 ];
|
|
|
+ break;
|
|
|
+ case 'NC65':
|
|
|
+ arrDatosDeEntrada['CurvaNC'] = "" + curva + "##" + "[ 80, 75, 71, 68, 66, 64, 63, 62 ]";
|
|
|
+ arrCurvaNC = [ 80, 75, 71, 68, 66, 64, 63, 62 ];
|
|
|
+ break;
|
|
|
+ case 'NC70':
|
|
|
+ arrDatosDeEntrada['CurvaNC'] = "" + curva + "##" + "[ 84, 79, 75, 72, 71, 70, 68, 68 ]";
|
|
|
+ arrCurvaNC = [ 84, 79, 75, 72, 71, 70, 68, 68 ];
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ var valorPi = Math.PI;
|
|
|
+ var A = ( ( valorPi ) * ( Math.pow( vDiametro, 2 ) ) ) / 4 ;
|
|
|
+ A = parseFloat(A);
|
|
|
+ A = A.toFixed(presicionDecimales);
|
|
|
+
|
|
|
+ var V = vCaudal / A;
|
|
|
+ V = parseFloat(V);
|
|
|
+ V = V.toFixed(presicionDecimales);
|
|
|
+
|
|
|
+ var arrLw = new Array(); // Contiene los valores de Lw
|
|
|
+ var arrKw = new Array(); // Contiene los valores de Kw
|
|
|
+
|
|
|
+ if ( (typeof vCaudal != 'undefined') || (typeof vPresionE != 'undefined') ) {
|
|
|
+ if ( Object.keys(arrFrecuencias).length != 0 ) {
|
|
|
+ Object.keys(arrFrecuencias).forEach( function( indice ) {
|
|
|
+ var frecuencia = arrFrecuencias[indice];
|
|
|
+ var kw = ( 10 * Math.log10(vCaudal) ) + ( 20 * Math.log10(vPresionE) );
|
|
|
+ var cadenaOperacion = "(10 x " + Math.log10(vCaudal) + ") + ( 20 x " + Math.log10(vPresionE) + ") = / " + kw +" /";
|
|
|
+ kw = parseFloat(kw);
|
|
|
+ kw = kw.toFixed(presicionDecimales);
|
|
|
+ arrLw[frecuencia] = arrDatosVentilador[frecuencia];
|
|
|
+ arrKw[frecuencia] = kw;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.CALC.( ' + idModulo + ' ).0002 - Ocurrio un error al cargar los valores de las Frecuencias Hz.';
|
|
|
+ arrErroresSistemaCalc['0002'] = strMensaje;
|
|
|
+ mensajeErrorCalc ++ ;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.CALC.( ' + idModulo + ' ).0001 - Los valores de la Cudal o de la Presión Estatíca no se definieron correctamente.';
|
|
|
+ arrErroresSistemaCalc['0001'] = strMensaje;
|
|
|
+ mensajeErrorCalc ++ ;
|
|
|
+ }
|
|
|
+
|
|
|
+ var arrLwFinal = new Array(); // Contiene los valores de LwFinal
|
|
|
+ if ( Object.keys(arrLw).length != 0 ) {
|
|
|
+ Object.keys(arrLw).forEach( function( indice ) {
|
|
|
+ var valorLw = arrLw[indice];
|
|
|
+ var valorKw = arrKw[indice];
|
|
|
+ var lwFinal = parseFloat(valorKw) + parseFloat(valorLw);
|
|
|
+ var cadenaOperacion = "" + valorKw + " + " + valorLw + " = / " + lwFinal +" /";
|
|
|
+ lwFinal = parseFloat(lwFinal);
|
|
|
+ lwFinal = lwFinal.toFixed(presicionDecimales);
|
|
|
+ arrLwFinal[indice] = lwFinal;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.CALC.( ' + idModulo + ' ).0003 - Se Presento un Error a la hora de calcular los valores de LwFinal.';
|
|
|
+ arrErroresSistemaCalc['0003'] = strMensaje;
|
|
|
+ mensajeErrorCalc ++ ;
|
|
|
+ }
|
|
|
+
|
|
|
+ var arrLwA = new Array(); // Contiene los valores de LwA
|
|
|
+ if ( Object.keys(arrPonderanciaA).length != 0 ) {
|
|
|
+ Object.keys(arrPonderanciaA).forEach( function( indice ) {
|
|
|
+ var valorLwFinal = arrLwFinal[arrFrecuencias[indice]];
|
|
|
+ var valorPonderancia = arrPonderanciaA[indice];
|
|
|
+ if ( (typeof valorLwFinal != 'undefined') || (typeof valorPonderancia != 'undefined') ) {
|
|
|
+ var lwA = parseFloat(valorLwFinal) + (parseFloat(valorPonderancia));
|
|
|
+ var cadenaOperacion = "" + parseFloat(valorLwFinal) + " + " + (parseFloat(valorPonderancia)) + " = / " + lwA +" /";
|
|
|
+ lwA = parseFloat(lwA);
|
|
|
+ lwA = lwA.toFixed(presicionDecimales);
|
|
|
+ arrLwA[arrFrecuencias[indice]] = lwA;
|
|
|
+ } else {
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.CALC.( ' + idModulo + ' ).0005 - Los valores de LwFinal o de la Ponderancia A no se definieron correctamente.';
|
|
|
+ arrErroresSistemaCalc['0005'] = strMensaje;
|
|
|
+ mensajeErrorCalc ++ ;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.CALC.( ' + idModulo + ' ).0004 - Se Presento un Error a la hora de cargar los valores de la Ponderancia A.';
|
|
|
+ arrErroresSistemaCalc['0004'] = strMensaje;
|
|
|
+ mensajeErrorCalc ++ ;
|
|
|
+ }
|
|
|
+
|
|
|
+ var arrLwAVentiladorSeleccionado = new Array(); // Contiene los valores de LwA del Ventilador Seleccionado
|
|
|
+ if ( Object.keys(arrCurvaNC).length != 0 ) {
|
|
|
+ Object.keys(arrCurvaNC).forEach( function( indice ) {
|
|
|
+ var valorLwFinal = arrLwFinal[arrFrecuencias[indice]];
|
|
|
+ var valorCurvaNC = arrCurvaNC[indice];
|
|
|
+ if ( (typeof valorLwFinal != 'undefined') || (typeof valorCurvaNC != 'undefined') ) {
|
|
|
+ var LwAVentilador = parseFloat(valorLwFinal) - parseFloat(valorCurvaNC);
|
|
|
+ var cadenaOperacion = "" + valorLwFinal + " - " + valorCurvaNC + " = / " + LwAVentilador +" /";
|
|
|
+ LwAVentilador = parseFloat(LwAVentilador);
|
|
|
+ LwAVentilador = LwAVentilador.toFixed(presicionDecimales);
|
|
|
+ arrLwAVentiladorSeleccionado[arrFrecuencias[indice]] = LwAVentilador;
|
|
|
+ } else {
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.CALC.( ' + idModulo + ' ).0007 - Los valores de LwFinal o de la curvaNC no se definieron correctamente.';
|
|
|
+ arrErroresSistemaCalc['0007'] = strMensaje;
|
|
|
+ mensajeErrorCalc ++ ;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.CALC.( ' + idModulo + ' ).0006 - Se Presento un Error a la hora de cargar los valores de la Curva NC seleccionada.';
|
|
|
+ arrErroresSistemaCalc['0006'] = strMensaje;
|
|
|
+ mensajeErrorCalc ++ ;
|
|
|
+ }
|
|
|
+
|
|
|
+ if ( Object.keys(arrLwAVentiladorSeleccionado).length > 0 ) {
|
|
|
+ var vAtenuador100Hz = arrLwAVentiladorSeleccionado["1000Hz"]; // Valor 1000Hz para seleccionar el Atenuador Correcto
|
|
|
+ } else {
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.CALC.( ' + idModulo + ' ).0024 - Se Presento un Error a la hora de cargar los valores de LwA del Ventilador.';
|
|
|
+ arrErroresSistemaCalc['0024'] = strMensaje;
|
|
|
+ mensajeErrorCalc ++ ;
|
|
|
+ }
|
|
|
+
|
|
|
+ var diametroTmp = vDiametro * 304.8; // Se convierte el diametro a mm de Ft para Buscar el Atenuador Correcto
|
|
|
+ diametroTmp = parseFloat(diametroTmp);
|
|
|
+ diametroTmp = diametroTmp.toFixed(presicionDecimales);
|
|
|
+
|
|
|
+ if ( diametroTmp <= 425 ) {
|
|
|
+ diametroTmp = 400;
|
|
|
+ } else if ( (diametroTmp > 425) && (diametroTmp <= 475) ) {
|
|
|
+ diametroTmp = 450;
|
|
|
+ } else if ( (diametroTmp > 475) && (diametroTmp <= 525) ) {
|
|
|
+ diametroTmp = 500;
|
|
|
+ } else if ( (diametroTmp > 525) && (diametroTmp <= 575) ) {
|
|
|
+ diametroTmp = 560;
|
|
|
+ } else if ( (diametroTmp > 580) && (diametroTmp <= 615) ) {
|
|
|
+ diametroTmp = 600;
|
|
|
+ } else if ( (diametroTmp > 615) && (diametroTmp <= 655) ) {
|
|
|
+ diametroTmp = 630;
|
|
|
+ } else if ( (diametroTmp > 655) && (diametroTmp <= 695) ) {
|
|
|
+ diametroTmp = 675;
|
|
|
+ } else if ( (diametroTmp > 695) && (diametroTmp <= 730) ) {
|
|
|
+ diametroTmp = 710;
|
|
|
+ } else if ( (diametroTmp > 730) && (diametroTmp <= 775) ) {
|
|
|
+ diametroTmp = 750;
|
|
|
+ } else if ( (diametroTmp > 775) && (diametroTmp <= 820) ) {
|
|
|
+ diametroTmp = 800;
|
|
|
+ } else if ( (diametroTmp > 820) && (diametroTmp <= 870) ) {
|
|
|
+ diametroTmp = 840;
|
|
|
+ } else if ( (diametroTmp > 870) && (diametroTmp <= 920) ) {
|
|
|
+ diametroTmp = 900;
|
|
|
+ } else if ( (diametroTmp > 920) && (diametroTmp <= 970) ) {
|
|
|
+ diametroTmp = 945;
|
|
|
+ } else if ( (diametroTmp > 970) && (diametroTmp <= 1030) ) {
|
|
|
+ diametroTmp = 1000;
|
|
|
+ } else if ( (diametroTmp > 1030) && (diametroTmp <= 1090) ) {
|
|
|
+ diametroTmp = 1065;
|
|
|
+ } else if ( (diametroTmp > 1090) && (diametroTmp <= 1160) ) {
|
|
|
+ diametroTmp = 1120;
|
|
|
+ } else if ( (diametroTmp > 1160) && (diametroTmp <= 1225) ) {
|
|
|
+ diametroTmp = 1200;
|
|
|
+ } else if ( (diametroTmp > 1225) && (diametroTmp <= 1255) ) {
|
|
|
+ diametroTmp = 1250;
|
|
|
+ } else if ( (diametroTmp > 1255) && (diametroTmp <= 1305) ) {
|
|
|
+ diametroTmp = 1260;
|
|
|
+ } else if ( (diametroTmp > 1305) && (diametroTmp <= 1375) ) {
|
|
|
+ diametroTmp = 1350;
|
|
|
+ } else if ( (diametroTmp > 1375) && (diametroTmp <= 1410) ) {
|
|
|
+ diametroTmp = 1400;
|
|
|
+ } else if ( (diametroTmp > 1410) && (diametroTmp <= 1460) ) {
|
|
|
+ diametroTmp = 1420;
|
|
|
+ } else if ( (diametroTmp > 1460) && (diametroTmp <= 1550) ) {
|
|
|
+ diametroTmp = 1500;
|
|
|
+ } else if ( (diametroTmp > 1550) && (diametroTmp <= 1640) ) {
|
|
|
+ diametroTmp = 1600;
|
|
|
+ } else if ( (diametroTmp > 1640) && (diametroTmp <= 1740) ) {
|
|
|
+ diametroTmp = 1680;
|
|
|
+ } else if ( (diametroTmp > 1740) && (diametroTmp <= 1840) ) {
|
|
|
+ diametroTmp = 1800;
|
|
|
+ } else if ( (diametroTmp > 1840) && (diametroTmp <= 1885) ) {
|
|
|
+ diametroTmp = 1875;
|
|
|
+ } else if ( (diametroTmp > 1885) && (diametroTmp <= 2050) ) {
|
|
|
+ diametroTmp = 2000;
|
|
|
+ } else if ( (diametroTmp > 2050) && (diametroTmp <= 2170) ) {
|
|
|
+ diametroTmp = 2100;
|
|
|
+ } else if ( (diametroTmp > 2170) && (diametroTmp <= 2370) ) {
|
|
|
+ diametroTmp = 2240;
|
|
|
+ } else if ( (diametroTmp > 2370) && (diametroTmp <= 2750) ) {
|
|
|
+ diametroTmp = 2500;
|
|
|
+ } else if ( (diametroTmp > 2501) && (diametroTmp <= 3000) ) {
|
|
|
+ diametroTmp = 2800;
|
|
|
+ }
|
|
|
+
|
|
|
+ var arrAtenuador1000Hz = new Array(); // Contiene el valor de 1000Hz de los Posibles Atenuadores
|
|
|
+ Object.keys(arrAtenuacion).forEach( function( array ) {
|
|
|
+ var idAtenuador = arrAtenuacion[array]['IDATENUACION'];
|
|
|
+ var vDiametroAte = arrAtenuacion[array]['DIAMETRO'];
|
|
|
+ var vLongitudAte = arrAtenuacion[array]['LONGITUD'];
|
|
|
+ var v1000Hz = arrAtenuacion[array]['1000Hz'];
|
|
|
+ if ( (vDiametroAte == diametroTmp) ) {
|
|
|
+ arrAtenuador1000Hz[idAtenuador] = v1000Hz;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ var arrDiferencia = new Array();
|
|
|
+ var arrDiferenciaSort = new Array();
|
|
|
+ if ( Object.keys(arrAtenuador1000Hz).length > 0 ) {
|
|
|
+ Object.keys(arrAtenuador1000Hz).forEach( function( indice ) {
|
|
|
+ var vAtenuadorSelect = arrAtenuador1000Hz[indice];
|
|
|
+ var diferencia = "";
|
|
|
+ if ( vAtenuador100Hz > vAtenuadorSelect ) {
|
|
|
+ diferencia = vAtenuador100Hz - vAtenuadorSelect;
|
|
|
+ } else {
|
|
|
+ diferencia = vAtenuadorSelect - vAtenuador100Hz;
|
|
|
+ }
|
|
|
+ diferencia = parseFloat(diferencia);
|
|
|
+ diferencia = diferencia.toFixed(presicionDecimales);
|
|
|
+ arrDiferencia[indice] = diferencia;
|
|
|
+ arrDiferenciaSort[indice] = diferencia;
|
|
|
+ });
|
|
|
+ arrDiferenciaSort.sort(deMenorAMayor);
|
|
|
+ function deMenorAMayor(elem1, elem2) {return elem1-elem2;}
|
|
|
+ var valMenorDif = arrDiferenciaSort[0];
|
|
|
+ var idAtenuadorSelect = arrDiferencia.indexOf(valMenorDif);
|
|
|
+ } else {
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.CALC.( ' + idModulo + ' ).0007 - Se Presento un Error a la hora de cargar los valores de los posibles atenuadores seleccionados.';
|
|
|
+ arrErroresSistemaCalc['0007'] = strMensaje;
|
|
|
+ mensajeErrorCalc ++ ;
|
|
|
+ }
|
|
|
+
|
|
|
+ var arrAtenuador = new Array(); // Contiene los Datos del Atenuador Seleccionado
|
|
|
+ Object.keys(arrAtenuacion).forEach( function( array ) {
|
|
|
+ var idAtenuador = arrAtenuacion[array]['IDATENUACION'];
|
|
|
+ if ( (typeof idAtenuadorSelect != 'undefined') ) {
|
|
|
+ if ( idAtenuador == idAtenuadorSelect ) {
|
|
|
+ arrAtenuador = arrAtenuacion[array];
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.CALC.( ' + idModulo + ' ).0008 - El valor del Atenuador Seleccionado no se definio correctamente.';
|
|
|
+ arrErroresSistemaCalc['0008'] = strMensaje;
|
|
|
+ mensajeErrorCalc ++ ;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ var arrLwAVentilador = new Array(); // Contiene los valores de LwA Ventilador - Atenuacion
|
|
|
+ Object.keys(arrFrecuencias).forEach( function( indice ) {
|
|
|
+ var frecuencia = arrFrecuencias[indice];
|
|
|
+ var vlwFinal = arrLwFinal[frecuencia];
|
|
|
+ var vAtenuador = arrAtenuador[frecuencia];
|
|
|
+ if ( (typeof vlwFinal != 'undefined') || (typeof vAtenuador != 'undefined') ) {
|
|
|
+ var LwAVentilador = parseFloat(vlwFinal) - parseFloat(vAtenuador);
|
|
|
+ var cadenaOperacion = " " + vlwFinal + " - " + vAtenuador + " = " + LwAVentilador + " ";
|
|
|
+ LwAVentilador = parseFloat(LwAVentilador);
|
|
|
+ LwAVentilador = LwAVentilador.toFixed(presicionDecimales);
|
|
|
+ arrLwAVentilador[frecuencia] = LwAVentilador;
|
|
|
+ } else {
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.CALC.( ' + idModulo + ' ).0009 - Los valores de LwFinal o deL Atenuador no se definieron correctamente.';
|
|
|
+ arrErroresSistemaCalc['0009'] = strMensaje;
|
|
|
+ mensajeErrorCalc ++ ;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ // Determina el Rango de la Potencia Sonora para seleccionar la correcta
|
|
|
+ if ( (typeof V != 'undefined') ) {
|
|
|
+ if ( !isNaN(V) ) {
|
|
|
+ var tmpPotenciaSonora = V;
|
|
|
+ if ( tmpPotenciaSonora <= 1000 ) {
|
|
|
+ searchPotenciaSonora = "<1000";
|
|
|
+ } else if ( (tmpPotenciaSonora > 1000) && (tmpPotenciaSonora <= 1500) ) {
|
|
|
+ searchPotenciaSonora = ">1000";
|
|
|
+ } else if ( (tmpPotenciaSonora > 1500) && (tmpPotenciaSonora <= 2000) ) {
|
|
|
+ searchPotenciaSonora = "<2000";
|
|
|
+ } else if ( (tmpPotenciaSonora > 2000) && (tmpPotenciaSonora <= 2500) ) {
|
|
|
+ searchPotenciaSonora = ">2000";
|
|
|
+ } else if ( (tmpPotenciaSonora > 2500) && (tmpPotenciaSonora <= 3000) ) {
|
|
|
+ searchPotenciaSonora = "<3000";
|
|
|
+ } else if ( tmpPotenciaSonora > 3000 ) {
|
|
|
+ searchPotenciaSonora = ">3000";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.CALC.( ' + idModulo + ' ).0010 - El valor de la Velocidad de Flujo no se definio correctamente.';
|
|
|
+ arrErroresSistemaCalc['0010'] = strMensaje;
|
|
|
+ mensajeErrorCalc ++ ;
|
|
|
+ }
|
|
|
+
|
|
|
+ var arrPotenciaSonoraSelect = new Array(); // Contiene los datos de la potencia sonora del atenuador seleccionado
|
|
|
+ Object.keys(arrPotenciaSonora).forEach( function( array ) {
|
|
|
+ var arrTmpPotencia = arrPotenciaSonora[array];
|
|
|
+ var idPotenciaSonora = arrPotenciaSonora[array]['IDPOTSON'];
|
|
|
+ var vFtMin = arrPotenciaSonora[array]['FTMIN'];
|
|
|
+ if ( (typeof searchPotenciaSonora != 'undefined') ) {
|
|
|
+ if ( vFtMin == searchPotenciaSonora ) {
|
|
|
+ Object.keys(arrTmpPotencia).forEach( function( indice ) {
|
|
|
+ var valPotSonora = arrTmpPotencia[indice];
|
|
|
+ arrPotenciaSonoraSelect[indice] = valPotSonora;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.CALC.( ' + idModulo + ' ).0011 - El valor para la Busqueda de la Potencia Sonora no se definio correctamente.';
|
|
|
+ arrErroresSistemaCalc['0011'] = strMensaje;
|
|
|
+ mensajeErrorCalc ++ ;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ var arrSonidoRegenerado = new Array(); // Contiene los parametros de las frecuencias del atenuador
|
|
|
+ if ( Object.keys(arrAtenuador1000Hz).length > 0 ) {
|
|
|
+ Object.keys(arrFrecuencias).forEach( function( indice ) {
|
|
|
+ var frecuencia = arrFrecuencias[indice];
|
|
|
+ arrSonidoRegenerado[frecuencia] = arrPotenciaSonoraSelect[frecuencia];
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.CALC.( ' + idModulo + ' ).0012 - Los valores de las Frecuencias Hz del atenudor seleccionado, se no se cargaron correctamente.';
|
|
|
+ arrErroresSistemaCalc['0012'] = strMensaje;
|
|
|
+ mensajeErrorCalc ++ ;
|
|
|
+ }
|
|
|
+
|
|
|
+ var arrCorreccionArea = new Array(); // Contiene los datos de la correción del área
|
|
|
+ for ( var i = 0; i < arrFrecuencias.length; i ++ ) {
|
|
|
+ var frecuencia = arrFrecuencias[i];
|
|
|
+ if ( (typeof A != 'undefined') ) {
|
|
|
+ var correcionArea = ( 10 * Math.log10(A) ) - 4.8;
|
|
|
+ var cadenaOperacion = "(10 x " + Math.log10(A) + ") - 4.8 ";
|
|
|
+ correcionArea = parseFloat(correcionArea);
|
|
|
+ correcionArea = correcionArea.toFixed(presicionDecimales);
|
|
|
+ arrCorreccionArea[frecuencia] = correcionArea;
|
|
|
+ } else {
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.CALC.( ' + idModulo + ' ).0013 - El valor de la Área de Salida no se definio correctamente.';
|
|
|
+ arrErroresSistemaCalc['0013'] = strMensaje;
|
|
|
+ mensajeErrorCalc ++ ;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ var arrSonidoMasCorrecion = new Array(); // Contiene los datos del Sonido más la correción del área
|
|
|
+ for ( var i = 0; i < arrFrecuencias.length; i ++ ) {
|
|
|
+ var frecuencia = arrFrecuencias[i];
|
|
|
+ var valPotencioSonora = arrPotenciaSonoraSelect[frecuencia];
|
|
|
+ var valCorrecionArea = arrCorreccionArea[frecuencia];
|
|
|
+ if ( (typeof valPotencioSonora != 'undefined') || (typeof valCorrecionArea != 'undefined') ) {
|
|
|
+ sonidoMasCorrecion = parseFloat(valPotencioSonora) + parseFloat(valCorrecionArea);
|
|
|
+ var cadenaOperacion = " " + valPotencioSonora + " + " + valCorrecionArea + " = " + sonidoMasCorrecion + " ";
|
|
|
+ sonidoMasCorrecion = parseFloat(sonidoMasCorrecion);
|
|
|
+ sonidoMasCorrecion = sonidoMasCorrecion.toFixed(presicionDecimales);
|
|
|
+ arrSonidoMasCorrecion[frecuencia] = sonidoMasCorrecion;
|
|
|
+ } else {
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.CALC.( ' + idModulo + ' ).0014 - El valor de la Potencia Sonora o de la Correción no se definieron correctamente.';
|
|
|
+ arrErroresSistemaCalc['0014'] = strMensaje;
|
|
|
+ mensajeErrorCalc ++ ;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ var arrSumaLog = new Array(); // Contiene la suma logaritmica de los datos de LwA del ventilador y la Potencia Sonora del atenuador
|
|
|
+ for ( var i = 0; i < arrFrecuencias.length; i ++ ) {
|
|
|
+ if ( (Object.keys(arrLwAVentilador).length > 0) && (Object.keys(arrPotenciaSonoraSelect).length > 0) ) {
|
|
|
+ var frecuencia = arrFrecuencias[i];
|
|
|
+ var sumaLog = 10 * ( Math.log10( ( Math.pow( 10, (arrLwAVentilador[frecuencia]/10) ) ) + ( Math.pow( 10, (arrPotenciaSonoraSelect[frecuencia]/10) ) ) ) );
|
|
|
+ sumaLog = parseFloat(sumaLog);
|
|
|
+ sumaLog = sumaLog.toFixed(presicionDecimales);
|
|
|
+ arrSumaLog[frecuencia] = sumaLog;
|
|
|
+ } else {
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.CALC.( ' + idModulo + ' ).0015 - Los valores LwAVentilador y de la Potencia Sonora no se definieron correctamente.';
|
|
|
+ arrErroresSistemaCalc['0015'] = strMensaje;
|
|
|
+ mensajeErrorCalc ++ ;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ var arrEspectroResultante = new Array(); // Contiene los valor del Espectro Resultante
|
|
|
+ for ( var i = 0; i < arrFrecuencias.length; i ++ ) {
|
|
|
+ var frecuencia = arrFrecuencias[i];
|
|
|
+ if ( (Object.keys(arrSumaLog).length > 0) && (Object.keys(arrPonderanciaA).length > 0) ) {
|
|
|
+ var espectroResultante = parseFloat(arrSumaLog[frecuencia]) + parseFloat(arrPonderanciaA[i]);
|
|
|
+ espectroResultante = parseFloat(espectroResultante);
|
|
|
+ espectroResultante = espectroResultante.toFixed(presicionDecimales);
|
|
|
+ arrEspectroResultante[frecuencia] = espectroResultante;
|
|
|
+ } else {
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.CALC.( ' + idModulo + ' ).0016 - Los valores de la Suma Logaritmica y los de la Ponderancia A no se definieron correctamente.';
|
|
|
+ arrErroresSistemaCalc['0016'] = strMensaje;
|
|
|
+ mensajeErrorCalc ++ ;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if ( (Object.keys(arrEspectroResultante).length > 0) ) {
|
|
|
+ var sumaLogaritmica = 10 * ( Math.log10( Math.pow( 10, (arrEspectroResultante["63Hz"]/10) ) + Math.pow( 10, (arrEspectroResultante["125Hz"]/10) ) + Math.pow( 10, (arrEspectroResultante["250Hz"]/10) ) + Math.pow( 10, (arrEspectroResultante["500Hz"]/10) ) + Math.pow( 10, (arrEspectroResultante["1000Hz"]/10) ) + Math.pow( 10, (arrEspectroResultante["2000Hz"]/10) ) + Math.pow( 10, (arrEspectroResultante["4000Hz"]/10) ) + Math.pow( 10, (arrEspectroResultante["8000Hz"]/10) ) ) );
|
|
|
+ sumaLogaritmica = parseFloat(sumaLogaritmica);
|
|
|
+ sumaLogaritmica = sumaLogaritmica.toFixed(presicionDecimales);
|
|
|
+ } else {
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.CALC.( ' + idModulo + ' ).0017 - A ocurrido un error al realizar el calcúlo del Espectro Resultante.';
|
|
|
+ arrErroresSistemaCalc['0017'] = strMensaje;
|
|
|
+ mensajeErrorCalc ++ ;
|
|
|
+ }
|
|
|
+
|
|
|
+ // Resultados
|
|
|
+ if ( (Object.keys(arrLwFinal).length > 0) ) {
|
|
|
+ var sumaLogaritmicaLwFinal = 10 * ( Math.log10( Math.pow( 10, (arrLwFinal["63Hz"]/10) ) + Math.pow( 10, (arrLwFinal["125Hz"]/10) ) + Math.pow( 10, (arrLwFinal["250Hz"]/10) ) + Math.pow( 10, (arrLwFinal["500Hz"]/10) ) + Math.pow( 10, (arrLwFinal["1000Hz"]/10) ) + Math.pow( 10, (arrLwFinal["2000Hz"]/10) ) + Math.pow( 10, (arrLwFinal["4000Hz"]/10) ) + Math.pow( 10, (arrLwFinal["8000Hz"]/10) ) ) );
|
|
|
+ sumaLogaritmicaLwFinal = parseFloat(sumaLogaritmicaLwFinal);
|
|
|
+ sumaLogaritmicaLwFinal = sumaLogaritmicaLwFinal.toFixed(presicionDecimales);
|
|
|
+ } else {
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.CALC.( ' + idModulo + ' ).0018 - Los valores de LwFinal no se cargaron de manera correcta.';
|
|
|
+ arrErroresSistemaCalc['0018'] = strMensaje;
|
|
|
+ mensajeErrorCalc ++ ;
|
|
|
+ }
|
|
|
+
|
|
|
+ if ( (Object.keys(arrLwA).length > 0) ) {
|
|
|
+ var sumaLogaritmicaLwA = 10 * ( Math.log10( Math.pow( 10, (arrLwA["63Hz"]/10) ) + Math.pow( 10, (arrLwA["125Hz"]/10) ) + Math.pow( 10, (arrLwA["250Hz"]/10) ) + Math.pow( 10, (arrLwA["500Hz"]/10) ) + Math.pow( 10, (arrLwA["1000Hz"]/10) ) + Math.pow( 10, (arrLwA["2000Hz"]/10) ) + Math.pow( 10, (arrLwA["4000Hz"]/10) ) + Math.pow( 10, (arrLwA["8000Hz"]/10) ) ) );
|
|
|
+ sumaLogaritmicaLwA = parseFloat(sumaLogaritmicaLwA);
|
|
|
+ sumaLogaritmicaLwA = sumaLogaritmicaLwA.toFixed(presicionDecimales);
|
|
|
+ } else {
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.CALC.( ' + idModulo + ' ).0019 - Los valores de LwA no se cargaron de manera correcta.';
|
|
|
+ arrErroresSistemaCalc['0019'] = strMensaje;
|
|
|
+ mensajeErrorCalc ++ ;
|
|
|
+ }
|
|
|
+
|
|
|
+ if ( (typeof sumaLogaritmicaLwFinal != 'undefined') && (typeof valorPi != 'undefined') ) {
|
|
|
+ var resultadoPresionSonora = sumaLogaritmicaLwFinal - ( 10 * Math.log10( (4 * valorPi) * ( Math.pow(1.5, 2) / 2 ) ) );
|
|
|
+ resultadoPresionSonora = parseFloat(resultadoPresionSonora);
|
|
|
+ resultadoPresionSonora = resultadoPresionSonora.toFixed(presicionDecimales);
|
|
|
+ } else {
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.CALC.( ' + idModulo + ' ).0020 - El valor de la sumaLogaritmicaLwFinal no se ddefinió correctamente.';
|
|
|
+ arrErroresSistemaCalc['0020'] = strMensaje;
|
|
|
+ mensajeErrorCalc ++ ;
|
|
|
+ }
|
|
|
+
|
|
|
+ if ( (typeof sumaLogaritmicaLwA != 'undefined') && (typeof valorPi != 'undefined') ) {
|
|
|
+ var resultadoPresionSonoraA = sumaLogaritmicaLwA - ( 10 * Math.log10( (4 * valorPi) * ( Math.pow(1.5, 2) / 2 ) ) );
|
|
|
+ resultadoPresionSonoraA = parseFloat(resultadoPresionSonoraA);
|
|
|
+ resultadoPresionSonoraA = resultadoPresionSonoraA.toFixed(presicionDecimales);
|
|
|
+ } else {
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.CALC.( ' + idModulo + ' ).0021 - El valor de la sumaLogaritmicaLwA no se definió correctamente.';
|
|
|
+ arrErroresSistemaCalc['0021'] = strMensaje;
|
|
|
+ mensajeErrorCalc ++ ;
|
|
|
+ }
|
|
|
+
|
|
|
+ if ( (Object.keys(arrSumaLog).length > 0) ) {
|
|
|
+ var sumaLogaritmicaLwAtenuado = 10 * ( Math.log10( Math.pow( 10, (arrSumaLog["63Hz"]/10) ) + Math.pow( 10, (arrSumaLog["125Hz"]/10) ) + Math.pow( 10, (arrSumaLog["250Hz"]/10) ) + Math.pow( 10, (arrSumaLog["500Hz"]/10) ) + Math.pow( 10, (arrSumaLog["1000Hz"]/10) ) + Math.pow( 10, (arrSumaLog["2000Hz"]/10) ) + Math.pow( 10, (arrSumaLog["4000Hz"]/10) ) + Math.pow( 10, (arrSumaLog["8000Hz"]/10) ) ) );
|
|
|
+ sumaLogaritmicaLwAtenuado = parseFloat(sumaLogaritmicaLwAtenuado);
|
|
|
+ sumaLogaritmicaLwAtenuado = sumaLogaritmicaLwAtenuado.toFixed(presicionDecimales);
|
|
|
+ } else {
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.CALC.( ' + idModulo + ' ).0022 - El valor de la suma logaritmica no se definió correctamente.';
|
|
|
+ arrErroresSistemaCalc['0022'] = strMensaje;
|
|
|
+ mensajeErrorCalc ++ ;
|
|
|
+ }
|
|
|
+
|
|
|
+ if ( (Object.keys(arrEspectroResultante).length > 0) ) {
|
|
|
+ var sumaLogaritmicaEspectroResultante= 10 * ( Math.log10( Math.pow( 10, (arrEspectroResultante["63Hz"]/10) ) + Math.pow( 10, (arrEspectroResultante["125Hz"]/10) ) + Math.pow( 10, (arrEspectroResultante["250Hz"]/10) ) + Math.pow( 10, (arrEspectroResultante["500Hz"]/10) ) + Math.pow( 10, (arrEspectroResultante["1000Hz"]/10) ) + Math.pow( 10, (arrEspectroResultante["2000Hz"]/10) ) + Math.pow( 10, (arrEspectroResultante["4000Hz"]/10) ) + Math.pow( 10, (arrEspectroResultante["8000Hz"]/10) ) ) );
|
|
|
+ sumaLogaritmicaEspectroResultante = parseFloat(sumaLogaritmicaEspectroResultante);
|
|
|
+ sumaLogaritmicaEspectroResultante = sumaLogaritmicaEspectroResultante.toFixed(presicionDecimales);
|
|
|
+ } else {
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.CALC.( ' + idModulo + ' ).0022 - Los valores del Espectro Resultante no se cargaron de manera correcta.';
|
|
|
+ arrErroresSistemaCalc['0022'] = strMensaje;
|
|
|
+ mensajeErrorCalc ++ ;
|
|
|
+ }
|
|
|
+
|
|
|
+ if ( (typeof sumaLogaritmicaLwAtenuado != 'undefined') && (typeof valorPi != 'undefined') ) {
|
|
|
+ var resultadoPresionSonoraAA = sumaLogaritmicaLwAtenuado - ( 10 * Math.log10( (4 * valorPi) * ( Math.pow(1.5, 2) / 2 ) ) ); // DATOS USUARIOS
|
|
|
+ resultadoPresionSonoraAA = parseFloat(resultadoPresionSonoraAA);
|
|
|
+ resultadoPresionSonoraAA = resultadoPresionSonoraAA.toFixed(presicionDecimales);
|
|
|
+ } else {
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.CALC.( ' + idModulo + ' ).0023 - El valor de la sumaLogaritmicaLwAtenuado no se definió correctamente.';
|
|
|
+ arrErroresSistemaCalc['0023'] = strMensaje;
|
|
|
+ mensajeErrorCalc ++ ;
|
|
|
+ }
|
|
|
+
|
|
|
+ if ( (typeof sumaLogaritmicaEspectroResultante != 'undefined') && (typeof valorPi != 'undefined') ) {
|
|
|
+ var resultadoPresionSonoraBB = sumaLogaritmicaEspectroResultante - ( 10 * Math.log10( (4 * valorPi) * ( Math.pow(1.5, 2) / 2 ) ) );
|
|
|
+ resultadoPresionSonoraBB = parseFloat(resultadoPresionSonoraBB);
|
|
|
+ resultadoPresionSonoraBB = resultadoPresionSonoraBB.toFixed(presicionDecimales);
|
|
|
+ } else {
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'SPJS.CALC.( ' + idModulo + ' ).0023 - El valor de la sumaLogaritmicaEspectroResultante no se definió correctamente.';
|
|
|
+ arrErroresSistemaCalc['0023'] = strMensaje;
|
|
|
+ mensajeErrorCalc ++ ;
|
|
|
+ }
|
|
|
+
|
|
|
+ if ( (boolValido == true) && (mensajeErrorCalc == 0) ) {
|
|
|
+
|
|
|
+ inputJson( arrDatosDeEntrada, "DATOSENTRADA" );
|
|
|
+ inputJson( arrConversiones, "CONVERSIONES" );
|
|
|
+
|
|
|
+ document.getElementById('AREASALIDA').value = A;
|
|
|
+ document.getElementById('VFLUIDO').value = V;
|
|
|
+
|
|
|
+ inputJson( arrLw, "LW" );
|
|
|
+ inputJson( arrKw, "KW" );
|
|
|
+
|
|
|
+ inputJson( arrSonidoRegenerado, "SONIDOR" );
|
|
|
+ inputJson( arrCorreccionArea, "CORRECCION" );
|
|
|
+ inputJson( arrSonidoMasCorrecion, "SONMASCORR" );
|
|
|
+
|
|
|
+ inputJson( arrLwAVentiladorSeleccionado, "LWAV" );
|
|
|
+ inputJson( arrLwAVentilador, "LWAVA" );
|
|
|
+
|
|
|
+ inputJson( arrLwFinal, "LWFINALDATOS" );
|
|
|
+ document.getElementById('SUMALWFINAL').value = sumaLogaritmicaLwFinal;
|
|
|
+ inputJson( arrLwA, "LWADATOS" );
|
|
|
+ document.getElementById('SUMALWA').value = sumaLogaritmicaLwA;
|
|
|
+ document.getElementById('PRESON').value = resultadoPresionSonora;
|
|
|
+ document.getElementById('PRESONA').value = resultadoPresionSonoraA;
|
|
|
+
|
|
|
+ inputJson( arrSumaLog, "LWFINALDATOSVA" );
|
|
|
+ document.getElementById('SUMALWFINALVA').value = sumaLogaritmicaLwAtenuado;
|
|
|
+ inputJson( arrEspectroResultante, "LWADATOSVA" );
|
|
|
+ document.getElementById('SUMALWAVA').value = sumaLogaritmicaEspectroResultante;
|
|
|
+ document.getElementById('PRESONVA').value = resultadoPresionSonoraAA;
|
|
|
+ document.getElementById('PRESONAVA').value = resultadoPresionSonoraBB;
|
|
|
+ inputJson( arrAtenuador, "ATENUADOR" );
|
|
|
+
|
|
|
+ document.getElementById("tablaResultados").innerHTML = " ";
|
|
|
+
|
|
|
+ document.getElementById("loading").style.display = 'block';
|
|
|
+
|
|
|
+ var strTablaResultados = '';
|
|
|
+
|
|
|
+ var decimales = parseInt(2);
|
|
|
+
|
|
|
+ strTablaResultados += '<table class="table table-bordered" >';
|
|
|
+ strTablaResultados += '<thead>';
|
|
|
+ strTablaResultados += '<tr>';
|
|
|
+ strTablaResultados += '<th scope="col" colspan="9">';
|
|
|
+ strTablaResultados += '<center> <label> Espectro de Potencia Sonora Ventilador Lw </label> </center>';
|
|
|
+ strTablaResultados += '</th>';
|
|
|
+ strTablaResultados += '</tr>';
|
|
|
+ strTablaResultados += '<tr>';
|
|
|
+ Object.keys(arrFrecuencias).forEach( function( indice ) {
|
|
|
+ strTablaResultados += '<td scope="col">';
|
|
|
+ strTablaResultados += '<center>'+arrFrecuencias[indice]+'</center>';
|
|
|
+ strTablaResultados += '</td>';
|
|
|
+ });
|
|
|
+ strTablaResultados += '<td scope="col" colspan="8">';
|
|
|
+ strTablaResultados += '<center> <label> Lw (dB) </label> </center>';
|
|
|
+ strTablaResultados += '</td>';
|
|
|
+ strTablaResultados += '</tr>';
|
|
|
+ strTablaResultados += '</thead>';
|
|
|
+ strTablaResultados += '<tbody>';
|
|
|
+ strTablaResultados += '<tr>';
|
|
|
+ Object.keys(arrLwFinal).forEach( function( indice ) {
|
|
|
+ strTablaResultados += '<td scope="col">';
|
|
|
+ var lwFinal = arrLwFinal[indice];
|
|
|
+ lwFinal = parseFloat(lwFinal);
|
|
|
+ lwFinal = lwFinal.toFixed(decimales);
|
|
|
+ if ( isNaN(lwFinal) ) {
|
|
|
+ lwFinal = "0";
|
|
|
+ }
|
|
|
+ strTablaResultados += '<center>'+lwFinal+'</center>';
|
|
|
+ strTablaResultados += '</td>';
|
|
|
+ });
|
|
|
+ strTablaResultados += '<td scope="col">';
|
|
|
+ var sumaLogaritmicaLwFinal = sumaLogaritmicaLwFinal;
|
|
|
+ sumaLogaritmicaLwFinal = parseFloat(sumaLogaritmicaLwFinal);
|
|
|
+ sumaLogaritmicaLwFinal = sumaLogaritmicaLwFinal.toFixed(decimales);
|
|
|
+ if ( sumaLogaritmicaLwFinal == "NaN" ) {
|
|
|
+ sumaLogaritmicaLwFinal = "0";
|
|
|
+ }
|
|
|
+ strTablaResultados += '<center>'+sumaLogaritmicaLwFinal+'</center>';
|
|
|
+ strTablaResultados += '</td>';
|
|
|
+ strTablaResultados += '</tr>';
|
|
|
+ strTablaResultados += '</tbody>';
|
|
|
+
|
|
|
+ strTablaResultados += '<thead>';
|
|
|
+ strTablaResultados += '<tr>';
|
|
|
+ strTablaResultados += '<td scope="col" colspan="9">';
|
|
|
+ strTablaResultados += '<center> <label> Espectro de Potencia Sonora Ventilador Ponderación A Lw(A) </label> </center>';
|
|
|
+ strTablaResultados += '</td>';
|
|
|
+ strTablaResultados += '</tr>';
|
|
|
+ strTablaResultados += '<tr>';
|
|
|
+ Object.keys(arrFrecuencias).forEach( function( indice ) {
|
|
|
+ strTablaResultados += '<td scope="col">';
|
|
|
+ strTablaResultados += '<center>'+arrFrecuencias[indice]+'</center>';
|
|
|
+ strTablaResultados += '</td>';
|
|
|
+ });
|
|
|
+ strTablaResultados += '<td scope="col" colspan="8">';
|
|
|
+ strTablaResultados += '<center> <label> Lw (dBA) </label> </center>';
|
|
|
+ strTablaResultados += '</td>';
|
|
|
+ strTablaResultados += '</tr>';
|
|
|
+ strTablaResultados += '</thead>';
|
|
|
+ strTablaResultados += '<tbody>';
|
|
|
+ strTablaResultados += '<tr>';
|
|
|
+ Object.keys(arrLwA).forEach( function( indice ) {
|
|
|
+ strTablaResultados += '<td scope="col">';
|
|
|
+ var LwA = arrLwA[indice];
|
|
|
+ LwA = parseFloat(LwA);
|
|
|
+ LwA = LwA.toFixed(decimales);
|
|
|
+ if ( isNaN(LwA) ) {
|
|
|
+ LwA = "0";
|
|
|
+ }
|
|
|
+ strTablaResultados += '<center>'+LwA+'</center>';
|
|
|
+ strTablaResultados += '</td>';
|
|
|
+ });
|
|
|
+ strTablaResultados += '<td scope="col">';
|
|
|
+ var sumaLogaritmicaLwA = sumaLogaritmicaLwA;
|
|
|
+ sumaLogaritmicaLwA = parseFloat(sumaLogaritmicaLwA);
|
|
|
+ sumaLogaritmicaLwA = sumaLogaritmicaLwA.toFixed(decimales);
|
|
|
+ if ( isNaN(sumaLogaritmicaLwA) ) {
|
|
|
+ sumaLogaritmicaLwA = "0";
|
|
|
+ }
|
|
|
+ strTablaResultados += '<center>'+sumaLogaritmicaLwA+'</center>';
|
|
|
+ strTablaResultados += '</td>';
|
|
|
+ strTablaResultados += '</tr>';
|
|
|
+ strTablaResultados += '</tbody>';
|
|
|
+
|
|
|
+ strTablaResultados += '<thead>';
|
|
|
+ strTablaResultados += '<tr>';
|
|
|
+ strTablaResultados += '<td scope="col" colspan="3">';
|
|
|
+ strTablaResultados += '<center> Presión Sonora </center>';
|
|
|
+ strTablaResultados += '</td>';
|
|
|
+ strTablaResultados += '<td scope="col" colspan="6">';
|
|
|
+ var presionSonora = resultadoPresionSonora;
|
|
|
+ presionSonora = parseFloat(presionSonora);
|
|
|
+ presionSonora = presionSonora.toFixed(decimales);
|
|
|
+ if ( isNaN(presionSonora) ) {
|
|
|
+ presionSonora = "0";
|
|
|
+ }
|
|
|
+ strTablaResultados += '<center>'+presionSonora+'</center>';
|
|
|
+ strTablaResultados += '</td>';
|
|
|
+ strTablaResultados += '</tr>';
|
|
|
+ strTablaResultados += '</thead>';
|
|
|
+ strTablaResultados += '<thead>';
|
|
|
+ strTablaResultados += '<tr>';
|
|
|
+ strTablaResultados += '<td scope="col" colspan="9">';
|
|
|
+ strTablaResultados += '<center> <label> Espectro de Potencia Sonora Ventilador con Atenuador Lw </label> </center>';
|
|
|
+ strTablaResultados += '</td>';
|
|
|
+ strTablaResultados += '</tr>';
|
|
|
+ strTablaResultados += '<tr>';
|
|
|
+ Object.keys(arrFrecuencias).forEach( function( indice ) {
|
|
|
+ strTablaResultados += '<td scope="col">';
|
|
|
+ strTablaResultados += '<center>'+arrFrecuencias[indice]+'</center>';
|
|
|
+ strTablaResultados += '</td>';
|
|
|
+ });
|
|
|
+ strTablaResultados += '<td scope="col" colspan="8">';
|
|
|
+ strTablaResultados += '<center> <label> Lw (dBA) </label> </center>';
|
|
|
+ strTablaResultados += '</td>';
|
|
|
+ strTablaResultados += '</tr>';
|
|
|
+ strTablaResultados += '</thead>';
|
|
|
+ strTablaResultados += '<tbody>';
|
|
|
+ strTablaResultados += '<tr>';
|
|
|
+ Object.keys(arrSumaLog).forEach( function( indice ) {
|
|
|
+ strTablaResultados += '<td scope="col">';
|
|
|
+ var LwFinalVa = arrSumaLog[indice];
|
|
|
+ LwFinalVa = parseFloat(LwFinalVa);
|
|
|
+ LwFinalVa = LwFinalVa.toFixed(decimales);
|
|
|
+ if ( isNaN(LwFinalVa) ) {
|
|
|
+ LwFinalVa = "0";
|
|
|
+ }
|
|
|
+ strTablaResultados += '<center>'+LwFinalVa+'</center>';
|
|
|
+ strTablaResultados += '</td>';
|
|
|
+ });
|
|
|
+ strTablaResultados += '<td scope="col">';
|
|
|
+ var sumaLogaritmicaLwFinalVa = sumaLogaritmicaLwAtenuado;
|
|
|
+ sumaLogaritmicaLwFinalVa = parseFloat(sumaLogaritmicaLwFinalVa);
|
|
|
+ sumaLogaritmicaLwFinalVa = sumaLogaritmicaLwFinalVa.toFixed(decimales);
|
|
|
+ if ( sumaLogaritmicaLwFinalVa == "NaN" ) {
|
|
|
+ sumaLogaritmicaLwFinalVa = "0";
|
|
|
+ }
|
|
|
+ strTablaResultados += '<center>'+sumaLogaritmicaLwFinalVa+'</center>';
|
|
|
+ strTablaResultados += '</td>';
|
|
|
+ strTablaResultados += '</tr>';
|
|
|
+ strTablaResultados += '</tbody>';
|
|
|
+
|
|
|
+ strTablaResultados += '<thead>';
|
|
|
+ strTablaResultados += '<tr>';
|
|
|
+ strTablaResultados += '<td scope="col" colspan="9">';
|
|
|
+ strTablaResultados += '<center> <label> Espectro de Potencia Sonora Ventilador con Atenuador Lw(A) </label> </center>';
|
|
|
+ strTablaResultados += '</td>';
|
|
|
+ strTablaResultados += '</tr>';
|
|
|
+ strTablaResultados += '<tr>';
|
|
|
+ Object.keys(arrFrecuencias).forEach( function( indice ) {
|
|
|
+ strTablaResultados += '<td scope="col">';
|
|
|
+ strTablaResultados += '<center>'+arrFrecuencias[indice]+'</center>';
|
|
|
+ strTablaResultados += '</td>';
|
|
|
+ });
|
|
|
+ strTablaResultados += '<td scope="col" colspan="8">';
|
|
|
+ strTablaResultados += '<center> <label> Lw (dBA) </label> </center>';
|
|
|
+ strTablaResultados += '</td>';
|
|
|
+ strTablaResultados += '</tr>';
|
|
|
+ strTablaResultados += '</thead>';
|
|
|
+ strTablaResultados += '<tbody>';
|
|
|
+ strTablaResultados += '<tr>';
|
|
|
+ Object.keys(arrEspectroResultante).forEach( function( indice ) {
|
|
|
+ strTablaResultados += '<td scope="col">';
|
|
|
+ var LwAVa = arrEspectroResultante[indice];
|
|
|
+ LwAVa = parseFloat(LwAVa);
|
|
|
+ LwAVa = LwAVa.toFixed(decimales);
|
|
|
+ if ( isNaN(LwAVa) ) {
|
|
|
+ LwAVa = "0";
|
|
|
+ }
|
|
|
+ strTablaResultados += '<center>'+LwAVa+'</center>';
|
|
|
+ strTablaResultados += '</td>';
|
|
|
+ });
|
|
|
+ strTablaResultados += '<td scope="col">';
|
|
|
+ var sumaLogaritmicaLwAVa = sumaLogaritmicaEspectroResultante;
|
|
|
+ sumaLogaritmicaLwAVa = parseFloat(sumaLogaritmicaLwAVa);
|
|
|
+ sumaLogaritmicaLwAVa = sumaLogaritmicaLwAVa.toFixed(decimales);
|
|
|
+ if ( isNaN(sumaLogaritmicaLwAVa) ) {
|
|
|
+ sumaLogaritmicaLwAVa = "0";
|
|
|
+ }
|
|
|
+ strTablaResultados += '<center>'+sumaLogaritmicaLwAVa+'</center>';
|
|
|
+ strTablaResultados += '</td>';
|
|
|
+ strTablaResultados += '</tr>';
|
|
|
+ strTablaResultados += '</tbody>';
|
|
|
+
|
|
|
+ strTablaResultados += '<thead>';
|
|
|
+ strTablaResultados += '<tr>';
|
|
|
+ strTablaResultados += '<td scope="col" colspan="3">';
|
|
|
+ strTablaResultados += '<center> Presión Sonora </center>';
|
|
|
+ strTablaResultados += '</td>';
|
|
|
+ strTablaResultados += '<td scope="col" colspan="6">';
|
|
|
+ var presionSonoraVa = resultadoPresionSonoraAA;
|
|
|
+ presionSonoraVa = parseFloat(presionSonoraVa);
|
|
|
+ presionSonoraVa = presionSonoraVa.toFixed(decimales);
|
|
|
+ if ( isNaN(presionSonoraVa) ) {
|
|
|
+ presionSonoraVa = "0";
|
|
|
+ }
|
|
|
+ strTablaResultados += '<center>'+presionSonoraVa+'</center>';
|
|
|
+ strTablaResultados += '</td>';
|
|
|
+ strTablaResultados += '</tr>';
|
|
|
+ strTablaResultados += '</thead>';
|
|
|
+
|
|
|
+ strTablaResultados += '<tfoot>';
|
|
|
+ strTablaResultados += '<tr>';
|
|
|
+ strTablaResultados += '<td colspan="9">';
|
|
|
+ strTablaResultados += '<center> <label> Datos del Atenuador Seleccionado </label> </center>';
|
|
|
+ strTablaResultados += '</td>';
|
|
|
+ strTablaResultados += '</tr>';
|
|
|
+ strTablaResultados += '<tr>';
|
|
|
+ strTablaResultados += '<td scope="col" colspan="3">';
|
|
|
+ strTablaResultados += '<center> Modelo </center>';
|
|
|
+ strTablaResultados += '</td>';
|
|
|
+ strTablaResultados += '<td scope="col" colspan="2" >';
|
|
|
+ var modeloAtenuador = arrAtenuador['MODELO'];
|
|
|
+ strTablaResultados += '<center>'+modeloAtenuador+'</center>';
|
|
|
+ strTablaResultados += '</td>';
|
|
|
+ strTablaResultados += '<td scope="col" colspan="3">';
|
|
|
+ strTablaResultados += '<center> Longitud del Atenuador </center>';
|
|
|
+ strTablaResultados += '</td>';
|
|
|
+ strTablaResultados += '<td scope="col" >';
|
|
|
+ var longitudAtenuador = arrAtenuador['LONGITUD'];
|
|
|
+ strTablaResultados += '<center>'+longitudAtenuador+' </center>';
|
|
|
+ strTablaResultados += '</td>';
|
|
|
+ strTablaResultados += '</tr>';
|
|
|
+ strTablaResultados += '<tr>';
|
|
|
+ strTablaResultados += '<td colspan="9" style="text-align: right;">';
|
|
|
+ strTablaResultados += '<button type="button" id="generaPDF" name="generaPDF" class="btn small validation-passed" onclick="transaccionPDF(\'GRAL\')" /> Generar PDF </button>';
|
|
|
+ strTablaResultados += '</td>';
|
|
|
+ strTablaResultados += '</tr>';
|
|
|
+ strTablaResultados += '</tfoot>';
|
|
|
+
|
|
|
+ strTablaResultados += '</table>';
|
|
|
+
|
|
|
+ require(["dojo/dom-construct", "dojo/dom", "dojo/on", "dojo/domReady!"],
|
|
|
+ function(domConstruct, dom, on){
|
|
|
+ var row = domConstruct.toDom(strTablaResultados);
|
|
|
+ domConstruct.place(row, "tablaResultados");
|
|
|
+ document.getElementById("loading").style.display = 'none';
|
|
|
+ });
|
|
|
+
|
|
|
+ document.getElementById("TIPOV").focus();
|
|
|
+
|
|
|
+ function onKeyDownHandler(event) {
|
|
|
+ var t1 = 1;
|
|
|
+ var accion = "";
|
|
|
+ var codigo = event.which || event.keyCode;
|
|
|
+ if ( ( t1 == 1) && ( codigo == 68 ) ){
|
|
|
+ transaccionPDF( 'CALC' );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ window.onkeydown = onKeyDownHandler;
|
|
|
+
|
|
|
+ } else {
|
|
|
+ var inputsValores = document.querySelectorAll('#frmPDFGeneral input[type="text"]');
|
|
|
+ for ( index = 0; index < inputsValores.length; ++index ) {
|
|
|
+ var idInput = inputsValores[index].getAttribute("name");
|
|
|
+ document.getElementById(idInput).value = "";
|
|
|
+ }
|
|
|
+ var strMensaje = "";
|
|
|
+ strMensaje += 'Los datos de entrada son incorrectos. En caso de dudas, contacte al Departamento Comercial de S&P.';
|
|
|
+ alertify.confirm( 'Error...', strMensaje, function() { },
|
|
|
+ function() { } ).set('labels', { ok: 'Continuar', cancel: 'Cancelar' } );
|
|
|
+ function onKeyDownHandler(event) {
|
|
|
+ var t1 = 1;
|
|
|
+ var accion = "";
|
|
|
+ var codigo = event.which || event.keyCode;
|
|
|
+ if ( ( t1 == 1) && ( codigo == 76 ) ){
|
|
|
+ var error = "";
|
|
|
+ Object.keys(arrErroresSistemaCalc).forEach( function( indice ) {
|
|
|
+ error += arrErroresSistemaCalc[indice] + "<br>";
|
|
|
+ });
|
|
|
+ alertify.confirm( 'Errores...', error, function() { },
|
|
|
+ function() { } ).set('labels', { ok: 'Continuar', cancel: 'Cancelar' } );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ window.onkeydown = onKeyDownHandler;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function inputJson ( array, input ) { // Función para agregar JSON a los Input
|
|
|
+ var jObject = {};
|
|
|
+ for( i in array ){
|
|
|
+ jObject[i] = array[i];
|
|
|
+ }
|
|
|
+ jObject = JSON.stringify(jObject);
|
|
|
+ document.getElementById(input).value = jObject;
|
|
|
+ }
|
|
|
+
|
|
|
+ function transaccionPDF( tipoPDF ){ // Se Determina que PDF se va a descargar
|
|
|
+ document.getElementById('TRANSPDF').value = tipoPDF;
|
|
|
+ document.getElementById("frmPDFGeneral").submit();
|
|
|
+ }
|
|
|
+
|
|
|
+ </script>
|
|
|
+</html>
|