/**** Funcion Redondeo(valor,ndecs). Limitacion del numero de decimales ****/ function Redondeo(valor,ndecs) { // args: valor = valor numerico, ndecs=decimales a mostrar var pEntera="", pDecimal=""; var car, aTexto = "" + valor; var z, i = 0; if (aTexto.indexOf(".") != -1) { // Si es un valor con punto decimal... car = aTexto.charAt(i); while(car != ".") { pEntera += car; car = aTexto.charAt(++i); } if (ndecs > (aTexto.length - pEntera.length + 1)) { ndecs = aTexto.length - pEntera.length + 1; } for(z=i+1; z ptfotos ) { control_ALMACENAMIENTO = 0; ALMACENAMIENTO ="La tarjeta NO PERMITE almacenar el número de imágenes necesarias" + "\n"; ALMACENAMIENTO += "<<<<<<<<< 2 SOLUCIONES >>>>>>>>>>" + "\n"; ALMACENAMIENTO += "-> Reducir la duración de la película (DP)" + "\n"; ALMACENAMIENTO += "-> Reducir la velocidad de reproducción (IPS)"; } if ( ptexposicion > INTERVALO ) { control_TIEMPOEXPOSICION = 0; TIEMPOEXPOSICION = "El tiempo de exposición ES MAYOR que el de los intérvalos" + "\n"; TIEMPOEXPOSICION += "<<<<<<<<< 3 SOLUCIONES >>>>>>>>>>" + "\n"; TIEMPOEXPOSICION += " -> Extender la duración del evento a filmar (DE)" + "\n"; TIEMPOEXPOSICION += "-> Aumentar la sensibilidad ISO y reducir el tiempo de exposición" + "\n"; TIEMPOEXPOSICION += "-> Reducir la velocidad de reproducción (IPS)"; } if ( control_ALMACENAMIENTO && control_TIEMPOEXPOSICION ) { NUMFOTOS = FRAMES; EXPOSICIONFINAL = ptexposicion; TUMISMO = "¡tú mismo! "; VELOCIDADFINAL = IPS; FINALHORAS = parseInt( INTERVALO / 3600 ); FINALMIN = parseInt( (INTERVALO - FINALHORAS * 3600) / 60 ); FINALSEG = parseInt( INTERVALO - (FINALHORAS * 3600 + FINALMIN * 60) - ptexposicion ); } else { POSIBILIDAD = "¡ El Time-Lapse NO PUEDE EJECUTARSE con esos valores !" + "\n"; POSIBILIDAD += "No se proporcionará ningún parámetro"; } /* Muestra los resultados de los calculos en el formulario */ document.CalculadoraTL.DP_TOTAL.value = DP; document.CalculadoraTL.DP_FRAMES.value = FRAMES; document.CalculadoraTL.DE_TOTAL.value = DE; document.CalculadoraTL.DE_INTERVALO.value = Redondeo(INTERVALO,2); document.CalculadoraTL.FACTORV.value = Redondeo(FACTOR,2); document.CalculadoraTL.TREAL.value = Redondeo(FACTORTIEMPO,2); document.CalculadoraTL.ALMACENAMIENTO.value = ALMACENAMIENTO; document.CalculadoraTL.TIEMPOEXPOSICION.value = TIEMPOEXPOSICION; document.CalculadoraTL.POSIBILIDAD.value = POSIBILIDAD; document.CalculadoraTL.NUMFOTOS.value = NUMFOTOS; if (TExp_entrado == "") { document.CalculadoraTL.EXPOSICIONFINAL.value = EXPOSICIONFINAL; } else { document.CalculadoraTL.EXPOSICIONFINAL.value = TExp_entrado; } document.CalculadoraTL.TUMISMO.value = TUMISMO; document.CalculadoraTL.FINALHORAS.value = FINALHORAS; document.CalculadoraTL.FINALMIN.value = FINALMIN; document.CalculadoraTL.FINALSEG.value = FINALSEG; document.CalculadoraTL.VELOCIDADFINAL.value = VELOCIDADFINAL; return true; }