All Downloads are FREE. Search and download functionalities are using the official Maven repository.

lrgs.multistat.MultiStatConfig Maven / Gradle / Ivy

Go to download

A collection of software for aggregatting and processing environmental data such as from NOAA GOES satellites.

The newest version!
package lrgs.multistat;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

import java.util.Properties;

import ilex.util.EnvExpander;
import ilex.util.Logger;
import ilex.util.PropertiesUtil;

import lritdcs.LritDcsConfig;

/**
* This class is a singleton that holds the configuration for the multi-status
* GUI. We use PropertiesUtil to read/write the values from a Java properties
* file.
*/
public class MultiStatConfig
{
	/** display name of the 1st LRGS */
	public String Lrgs1DisplayName = "";

	/** Hostname of the 1st LRGS */
	public String Lrgs1HostName = null;

	/** Port number for connecting to 1st LRGS */
	public int Lrgs1Port = 16003;

	/** user name for connecting to the 1st LRGS */
	public String Lrgs1UserName = null;

	/** password for connecting to the 1st LRGS */
	public String Lrgs1Password = "N";

	/** display name of 2nd LRGS */
	public String Lrgs2DisplayName = "";

	/** Hostname of the 2nd LRGS */
	public String Lrgs2HostName = null;

	/** Port number for connecting to 2nd LRGS */
	public int Lrgs2Port = 16003;

	/** user name for connecting to the 2nd LRGS */
	public String Lrgs2UserName = null;

	/** password for connecting to the 2nd LRGS */
	public String Lrgs2Password = "N";

	/** display name of the 3rd LRGS */
	public String Lrgs3DisplayName = "";

	/** Hostname of the 3rd LRGS */
	public String Lrgs3HostName = null;

	/** Port number for connecting to 3rd LRGS */
	public int Lrgs3Port = 16003;

	/** user name for connecting to the 3rd LRGS */
	public String Lrgs3UserName = null;

	/** password for connecting to the 3rd LRGS */
	public String Lrgs3Password = "N";

	public String Lrgs4DisplayName = "";
	public String Lrgs4HostName = null;
	public int Lrgs4Port = 16003;
	public String Lrgs4UserName = null;
	public String Lrgs4Password = "N";

	
	
	
//	/** The base URL of the help dir. */
//	public String HelpUrlBase;
//
	/** The sound file to play when an alarm happens. */
	public String soundFile = "alarm.wav";

	/** The base URL in which to find alarm info files. */
	public String alarmInfoBaseUrl;

	/** The local path to the base URL for constructing error files, etc. */
	public String alarmInfoBasePath;

	/** The initial 'Mute' checkbox setting. */	
	public boolean mute = false;

	/** The default operator name. */
	public String operator;

	/** The display name of the LRGS to be used for admin functions. */
	public String adminLrgs = null;

	/** The singleton instance. */
	private static MultiStatConfig _instance = null;

	/** Name of configuration file. */
	private String cfgName;

	/** File object for config file. */
	private File cfgFile;

	/** Last time configuration was loaded from file. */
	private long lastLoadTime;

	/** The public accessor method. */
	public static MultiStatConfig instance()
	{
		if (_instance == null)
			_instance = new MultiStatConfig();
		return _instance;
	}


    private MultiStatConfig()
    {
//		Lrgs1DisplayName = "CDADATA";
//		Lrgs1HostName = "192.168.101.174";
//		Lrgs1Port = 16003;
//		Lrgs1UserName = "wcdas";
//		Lrgs1Password = "Y";
//		Lrgs2DisplayName = "CDABACKUP";
//		Lrgs2HostName = "192.168.101.189";
//		Lrgs2Port = 16003;
//		Lrgs2UserName = "wcdas";
//		Lrgs2Password = "N";
//		Lrgs3DisplayName = "NLRGS1";
//		Lrgs3HostName = "nlrgs1.noaa.gov";
//		Lrgs3Port = 16003;
//		Lrgs3UserName = "wcdas";
//		Lrgs3Password = "N";
//		Lrgs4HostName = "nlrgs2.noaa.gov";
//		Lrgs4Port = 16003;
//		Lrgs4UserName = "wcdas";
//		Lrgs4Password = "N";
		
//		HelpUrlBase = "";
		adminLrgs = "CDADATA";

		StringBuffer sb = new StringBuffer(EnvExpander.expand("$DCSTOOL_HOME"));
		for(int i=0; i lastLoadTime)
		{
			try
			{
				loadConfig();
				return true;
			}
			catch(IOException ex)
			{
				Logger.instance().failure("Cannot load config file '" 
					+ cfgFile.getPath() + "': " + ex);
			}
		}
		return false;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy