// SeisGram2K version 2, SeisGram2K/LiveSeis N-comp script, A.Lomax 26JUL2000 // 26JUL2000 AJL ver _02 - event parameters added // 19AUG2000 AJL ver _03 - JDK1.0 removed, support for additional program arguments added // 19JAN2005 AJL ver _04 - JDK1.1 check removed // 26FEB2009 AJL ver _04 - check that navigatior supports Java removed // NOTE: lines that may need to be changed during installation // are indicated by "// !!CHANGE HERE" ... // !!END CHANGE HERE // declare SeisGram2K parameters object function SeisGram2KParams(java_version, mode, locale, wild_chars) { this.java_version = java_version; this.set_java_version = set_java_version this.mode = mode; this.set_mode = set_mode this.locale = locale; this.set_locale = set_locale; this.wild_chars = wild_chars; this.set_wild_chars = set_wild_chars; this.replaceWildChars = replaceWildChars; } function set_java_version(java_version) { this.java_version = java_version; } function set_mode(mode) { this.mode = mode; } function set_locale(locale) { this.locale = locale; } function set_wild_chars(wild_chars) { this.wild_chars = wild_chars; } function replaceWildChars(name, nwild) { var newString = ""; var replaceChrs = ""; var n, ndx = 0; if (this.wild_chars.length < 1) return(null); for (n = 0; n < nwild; n++) { ndx = this.wild_chars.indexOf(":", ndx); if (ndx < 0) return(null); ndx++; } replaceChrs = this.wild_chars.substring(ndx, ndx + 1); ndx = name.indexOf("*", 0); if (ndx < 0) return(null); newString = name.substring(0, ndx) + replaceChrs + name.substring(ndx + 1, name.length); return(newString); } // !!CHANGE HERE // default values of applet parameters: //var seisGram2KParams = new SeisGram2KParams("AUTO", "STANDARD", "en_US", "Z:N:E"); var seisGram2KParams = new SeisGram2KParams("JDK11", "STANDARD", "en_US", "Z:N:E"); // sismo des ecoles: //var seisGram2KParams = new SeisGram2KParams("JDK11", "STANDARD", "fr_FR", "Z:N:E", "Z:N:E"); // !!END CHANGE HERE // function to launch SeisGram2K in LiveSeis mode with N channels function seis_view_n(windowName, titleString, liveseis, seischannel, locale, mode, channelformat, binarytype, pickformat, pickfile, addlArguments) { /* Arguments: windowName - arbitrary name for browser window conaining SeisGram2K titleString - String to be displayed in title bar of browser window liveseis - String with '#' separator contianing: total number of segments, number of segments to display, update time interval in seconds, minimum peak amplitude of initial display amplitude (optional, allows supression of display of background noise at large amplitude. seischannel - array of Strings giving relative path and filename template for each channel. Filename template must contain a set of '%' or '&' characters as place holders for the segment index in the filnemae. Thus for filenames ./data/seg000.sac, ./data/seg001.sac, etc, the template would be './data/seg%%%.sac' or './data/seg&&&.sac'. NOTE! - The last channel template in the list must be also be the channel that has the last updated "liveseis.last" index file, this index file is used to control the updating of all the channels in the array. locale - language locale String (see SeisGram2K help) mode - SeisGram2K mode String (see SeisGram2K help) channelformat - channel format String (see SeisGram2K help) binarytype - binary type String (see SeisGram2K help) pickformat - pick file format String (see SeisGram2K help) pickfile - pick file name String (see SeisGram2K help) addlArguments - additional SeisGram2K program arguments (see SeisGram2K help) array of parameter/value String pairs Example (SeisGram2K): javascript:seis_view_n('seisview', '1999.12.22-17.37', null, ['./lomax/1999_data/19991222/1999.12.22-17.37.01.CIV.LH-Z.SAC', './lomax/1999_data/19991222/1999.12.22-17.37.04.MNTF.LH-Z.SAC', './lomax/1999_data/19991222/1999.12.22-17.37.04.SETF.LH-Z.SAC'], null, null, 'SAC_BINARY', 'PC_INTEL', 'SAC_STD_OFFSET', ' ', [['event.id', 1234], ['event.info', '22 December 1999\\nM=4.7 Vintimiglia\\n(France-Italy Border)'], ['event.url', 'http://hostname/cgi-bin/getpicks'], ['event.protocol', 'NON_LIN_LOC_XML']) Example (LiveSeis): javascript:seis_view_n('liveseis_tgrs', 'LiveSeis: ReNaSS-NICE - TOUF/AUTN/REVF - SP - SH', '60#5#60.0#1500.0', ['./data/NICE/TOUF/SH/sac/NICE%%%.TOUF.Z.sac.gz', './data/NICE/AUTN/SH/sac/NICE%%%.AUTN.Z.sac.gz', './data/NICE/REVF/SH/sac/NICE%%%.REVF.Z.sac.gz'], null, null, 'SAC_BINARY', 'SUN_UNIX', 'NON_LIN_LOC', ' ', [['liveseis.contig', 'YES']]) */ // display browser //alert("Your browser is:" + navigator.appName + " | " + navigator.appVersion); // check that navigatior supports Java //if (!navigator.javaEnabled()) { // alert("WARNING - Java is not enabled on your browser!"); //} // check that at least one channel is selected if (seischannel[0] == null) { alert("SeisGram2K: Error - must specify at least one channel file!"); return; } // expand any wildcard characters in seischannel[0] var ndx = -1; if (seischannel.length <= 3 && (ndx = seischannel[0].indexOf("*", 0)) >= 0) { seischannel[2] = seisGram2KParams.replaceWildChars(seischannel[0], 2); seischannel[1] = seisGram2KParams.replaceWildChars(seischannel[0], 1); seischannel[0] = seisGram2KParams.replaceWildChars(seischannel[0], 0); } // open new window for HTML and applet // !!CHANGE HERE var applet_frame_number = 1; // use -1 to disable frame mode // !!END CHANGE HERE var viewer_doc = null; // use frames, puts applet in frame // check if not in frames if (applet_frame_number < 0 || parent.frames[applet_frame_number] == null) { nwin = window.open("", "seisView"+windowName, "menubar=yes,toolbar=no,scrollbars=no,resizable=yes,status=no,width=400,height=100"); viewer_doc = nwin.document; } else { viewer_doc = parent.frames[applet_frame_number].document; } // write html for new applet viewer_doc.open(); // destroy any existing applet // !!CHANGE HERE // !! UNCOMMENT FOLLOWING TO DESTROY EXISTING APPLETS WHEN NEW APPLET LAUNCHED // !! RECOMMENDED NOT TO DESTROY EXISTING APPLETS IN LIVE-SEIS MODE /* var napplets = viewer_doc.applets.length; if (napplets > 0) { var n; for (n = 0; n < napplets; n++) viewer_doc.applets[n].destroy(); } viewer_doc.writeln(""); */ // !!END CHANGE HERE viewer_doc.writeln(""); viewer_doc.writeln("
"); viewer_doc.writeln("