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

lrgs.rtstat.NoaaportConfigPanel 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!
/**
 * $Id$
 * 
 * $Log$
 * Revision 1.7  2013/01/30 21:25:17  mmaloney
 * PDI Initialization
 *
 * Revision 1.6  2013/01/30 20:39:35  mmaloney
 * Added new PDI Noaaport Stuff.
 *
 * Revision 1.5  2011/05/11 14:03:20  mmaloney
 * NoaaportConfigPanel added.
 *
 */
package lrgs.rtstat;
import ilex.gui.JobDialog;

import java.awt.GridBagLayout;
import javax.swing.JPanel;
import java.awt.Dimension;
import javax.swing.BorderFactory;
import javax.swing.border.TitledBorder;
import java.awt.Font;
import java.awt.Color;
import java.awt.Point;

import javax.swing.JCheckBox;
import java.awt.GridBagConstraints;

import javax.swing.JComboBox;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JTextField;

import java.awt.Insets;
import java.io.IOException;
import java.util.ResourceBundle;

import javax.swing.JButton;

import decodes.gui.GuiDialog;
import decodes.gui.TopFrame;

import lrgs.lrgsmain.LrgsConfig;
import lrgs.noaaportrecv.NoaaportTestSvr;

public class NoaaportConfigPanel 
	extends JPanel
	implements LrgsConfigPanel
{
	private static final long serialVersionUID = 1L;
	private JCheckBox enableCheckBox = new JCheckBox();
	private JLabel portLabel = new JLabel();
	private JTextField portText = new JTextField();
	private JButton testButton = new JButton();
	private static final String recvTypes[] = { "Marta", "Unisys", "PDI" };
	private JComboBox recvTypeCombo = new JComboBox(recvTypes);
	private JTextField hostText = new JTextField();
	private JTextField captureFileField = new JTextField();
	
	private NoaaportTestSvr myServer=null;
	private TopFrame myParent = null;
	private GuiDialog myDialogParent = null;
	private JobDialog myDialog = null;
	
	public LrgsConfig myConfig = null;
	private static ResourceBundle genericLabels = 
		RtStat.getGenericLabels();
	private static ResourceBundle rtstatLabels =
		RtStat.getLabels();
	private int origRecvTypeIdx = 0;
	private String origHostText = null;
	String origCaptureFile = null;

	/**
	 * This is the default constructor
	 */
	public NoaaportConfigPanel(TopFrame parent) {
		super();
		myParent = parent;
		initialize();
	}
	
	public String getLabel()
	{
		return rtstatLabels.getString("LrgsConfigDialog.noaaportTab");
	}
	
	public NoaaportConfigPanel(GuiDialog parent) {
		super();
		myDialogParent=parent;
		initialize();
	}

	public void fillFields(LrgsConfig tmp)
	{
		enableCheckBox.setSelected(tmp.noaaportEnabled);
		portText.setText(String.valueOf(tmp.noaaportPort));
		if (tmp.noaaportReceiverType != null)
		{
			recvTypeCombo.setSelectedIndex(0); // default to Marta
			for (int i = 0; i




© 2015 - 2024 Weber Informatics LLC | Privacy Policy