package spectrumanalyzer;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Alex Schwarz - VE7DXW
*
*/
//import static com.sun.xml.internal.ws.developer.JAXWSProperties.CONNECT_TIMEOUT;
import static com.sun.org.apache.xalan.internal.lib.ExsltDatetime.date;
import java.awt.AWTException;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import java.io.*;
import java.io.File;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.swing.JOptionPane;
import java.awt.event.*;
//import com.jcraft.jsch.*;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Font;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextPane;
import javax.swing.text.BadLocationException;
import javax.swing.text.SimpleAttributeSet;
import javax.swing.text.Style;
import javax.swing.text.StyleConstants;
import javax.swing.text.StyledDocument;
import org.apache.commons.net.PrintCommandListener;
import org.apache.commons.net.ftp.FTP;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPFile;
import org.apache.commons.net.ftp.FTPReply;
import java.util.Calendar;
import java.text.DecimalFormat;
//import static org.junit.Assert.assertTrue;
//import java.io.openStream;
import java.io.IOException;
import java.net.URL;
//import org.apache.commons.io.FileUtils;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import javax.imageio.ImageIO;
//import org.apache.commons.io.FileUtils;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.sql.Connection;
import java.sql.DriverManager;
import java.util.Calendar;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import org.apache.commons.httpclient.util.DateUtil;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Arrays;
import java.util.Scanner;
import javax.swing.text.MutableAttributeSet;
import javax.swing.text.StyleConstants;
import javax.swing.text.StyledDocument;
import static jdk.nashorn.internal.objects.NativeObject.keys;
import static spectrumanalyzer.SA_Display.carretPosition;
import static spectrumanalyzer.SA_Display.ftpActivity;
import static spectrumanalyzer.SA_Display.incomplete;
import static spectrumanalyzer.SA_Display.netSpeed;
public class SeismoViewer extends javax.swing.JFrame {
/**
* Creates new form SeismoViewer
*/
public SeismoViewer() {
initComponents();
setTitle("RF-Seismograph Earthquakes vs.Propagation -"
+ " V J1.7 (MDSR) by VE7DXW");
}
//RF-Seismogragph data .csv
static String[] displayTimeMarker = new String[2000];
static double[] displaySSI_CH1 = new double[2000];
static double[] displaySSI_CH2 = new double[2000];
static double[] displaySSI_CH3 = new double[2000];
static double[] displaySSI_CH4 = new double[2000];
static double[] displaySSI_CH5 = new double[2000];
static double[] displaySSI_CH6 = new double[2000];
static double[] displayQuakesMagnitude = new double[2000];
static String[] displayPlaceQuake = new String[2000];
static String[] displayPlaceLongLat = new String[2000];
//long time average RF-Seismogragph data .csv
static String[] LTAdisplayTimeMarker = new String[3500];
static double[] LTAdisplaySSI_CH1 = new double[3500];
static double[] LTAdisplaySSI_CH2 = new double[3500];
static double[] LTAdisplaySSI_CH3 = new double[3500];
static double[] LTAdisplaySSI_CH4 = new double[3500];
static double[] LTAdisplaySSI_CH5 = new double[3500];
static double[] LTAdisplaySSI_CH6 = new double[3500];
static double[] LTAdisplayQuakesMagnitude = new double[3500];
//EarthQuakeData from USGS .eqk
static String[] timeQuake = new String[2000];
static double[] latitudeQuake = new double[2000];
static double[] longitudeQuake = new double[2000];
static double[] depthQuake = new double[2000];
static double[] magQuake = new double[2000];
static String[] placeQuakeLocation = new String[2000];
static String[] placeQuakeState = new String[2000];
static String[] speedOfShockWave = new String[2000]; //calculated as [m/s] from RFS observations,manually edited and updated by the viewer
static double totalEng = 0;
static double totalEngAVG = 0;
static double quakeLat = 0; //used for distance calulation
static double quakeLon = 0;
static double distanceForActive = 0;
static int displayTime = 1;
static int tabPos = 0;//for display index
static int i = 0; //i vafrible does not work anyh other way
static int displayStart = 0; //begin of the displayed data
static double amplification = 4; //noise display amplication
static int Y_offset = 0;
static int Y_qu_offset = 0;
static String displayLastTime;
static String displayLastTimePre;
static int Y_offsetLTA;
static int itemCountLTA = 0;
static int cnt = 0; //start up condition is 0
static int cntTotalEnergy = 0; //start up condition is 0
static int totalFilesForAvr = 51; //for 50 day average
static String[] totalEngAVGArr = new String[150]; //array for daily AVG totals
static String varDir = ""; //directory of frilesDir
static int readDataInstance = 0;
static int shift = 0; // interval to shift time to match currentData
static boolean redrawImage = false; //stop redraw of image
static int realLenghtOneDay = 1635;//reallenght on one day data - 1635
static boolean fileDownloadGood = true;
static String passwordFTP = "propagation";
static String[] users = new String[250]; //contains data string Name,CallSign,Locator,Antenna,Elevation; one entry per user
static boolean drawOnce = false;
static boolean sortOnce = true;
static int lenghtPre;
static boolean preventRedraw = true;
static int sortingFor = 0; //0 is time, 1 is mag, 2 depth,l 3 location, 4 distance
//NOAA alert messages
static boolean NOAAmessagCompl;
static int jCountAlert; //jCount of the time istime alert
static int remoteFileSize = 0; //for NOAA alert
static int localFileSize = 0; //for NOAA alert
/**
Used fields for WSPR data:
Column Type Description
0 id UInt64 The unique spot id (same id as used by wsprnet.org)
1 time DateTime The time the spot was received and reported.
2 band Int16 The band the transmission took place. (First digit of Frequency) (-1: LF, 0: MF, 1: 160m, 3: 80m, 5: 60m, 7: 40m, 10: 30m, …)
3 rx_lat Float32 The receiver latitude in degrees
4 rx_lon Float32 The receiver longitude in degrees
5 tx_lat Float32 The sender latitude in degrees
6 tx_lon Float32 The sender longitude in degrees
7 distance UInt16 The distance in km
8 azimuth UInt16 The azimuth (as on wsprnet.org)
*/
static double[] id = new double[20000];
static String[] timeWSPR = new String[20000];
static String[] band = new String[20000]; //code as per designer
static String[] bandM = new String[20000]; //display in Metrers xxm
static String[] rx_id = new String[20000];
static String[] rx_grid = new String[20000];
static double[] rx_lat = new double[20000];
static double[] rx_lon = new double[20000];
static String[] tx_call = new String[20000];
static String[] tx_grid = new String[20000];
static double[] tx_lat = new double[20000];
static double[] tx_lon = new double[20000];
static int[] distance = new int[20000];
static int[] azimuth = new int[20000];
static int disableDownloadWSPR = -1; //needs to be -1 to disable download
static int linesOfData;
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// //GEN-BEGIN:initComponents
private void initComponents() {
jScrollPane3 = new javax.swing.JScrollPane();
jTextArea1 = new javax.swing.JTextArea();
jMenuBar1 = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
jMenu2 = new javax.swing.JMenu();
jMenu3 = new javax.swing.JMenu();
jMenuItem1 = new javax.swing.JMenuItem();
jMenu4 = new javax.swing.JMenu();
jPanel6 = new javax.swing.JPanel();
jPanel9 = new javax.swing.JPanel();
jScrollPane2 = new javax.swing.JScrollPane();
TopPanel = new javax.swing.JPanel();
jPanel1 = new javax.swing.JPanel();
jPanel5 = new javax.swing.JPanel();
jComboBoxEqkData = new javax.swing.JComboBox<>();
jPanel2 = new javax.swing.JPanel();
tagMagThresh = new javax.swing.JComboBox<>();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
listThresh = new javax.swing.JComboBox<>();
jLabel12 = new javax.swing.JLabel();
tagTextThresh = new javax.swing.JComboBox<>();
jButtonredrawGrafics = new javax.swing.JButton();
jComboBoxDataFileSelect = new javax.swing.JComboBox<>();
jPanel4 = new javax.swing.JPanel();
jButtonPrintSeceen = new javax.swing.JButton();
jButtonMatchQuakesNoise = new javax.swing.JButton();
jButtonLoadUSGS_data = new javax.swing.JButton();
jButtonOpenRemoteData = new javax.swing.JButton();
jButtonLoadWSPR_data = new javax.swing.JButton();
jButtonUploadQuakesLst = new javax.swing.JButton();
codePanelActivtesUpdate1 = new javax.swing.JPanel();
jPanel7 = new javax.swing.JPanel();
jLabel10 = new javax.swing.JLabel();
RF_ViewerOffsetYaxes = new javax.swing.JSpinner();
jLabel11 = new javax.swing.JLabel();
EarthQuakes_viewerOffsetYaxes = new javax.swing.JSpinner();
CheckBoxArchive = new javax.swing.JCheckBox();
jLabel13 = new javax.swing.JLabel();
jPanel8 = new javax.swing.JPanel();
jLabel39 = new javax.swing.JLabel();
totalEnergyQuakes = new java.awt.TextField();
jLabel40 = new javax.swing.JLabel();
totalPowerQuakes = new java.awt.TextField();
jButtonOpenGetArchivedData = new javax.swing.JButton();
callSignDatatoDisplay = new javax.swing.JComboBox<>();
LongTimeAverageCal = new javax.swing.JButton();
CheckBoxShowLTA = new javax.swing.JCheckBox();
jLabel17 = new javax.swing.JLabel();
jDesktopPane1 = new javax.swing.JDesktopPane();
durationMin = new javax.swing.JComboBox<>();
numberRec = new javax.swing.JComboBox<>();
jLabel16 = new javax.swing.JLabel();
jLabel15 = new javax.swing.JLabel();
jPanel3 = new javax.swing.JPanel();
jLabel14 = new javax.swing.JLabel();
jButtonCheckNW = new javax.swing.JButton();
jButtonClearSelected = new javax.swing.JButton();
loadNOAA = new javax.swing.JButton();
jButtonClearAll = new javax.swing.JButton();
startRFS = new javax.swing.JButton();
jButtonClearData = new javax.swing.JButton();
jButtonDeleteUser = new javax.swing.JButton();
CheckBoxoldDataMode = new javax.swing.JCheckBox();
jTabbedPaneGraphics = new javax.swing.JTabbedPane();
propagationViewer = new javax.swing.JPanel();
jPanel29 = new javax.swing.JPanel();
callSign = new java.awt.TextField();
elevation = new java.awt.TextField();
antenna = new java.awt.TextField();
locRFS_Lat = new java.awt.TextField();
jLabel38 = new javax.swing.JLabel();
jLabel42 = new javax.swing.JLabel();
jLabel36 = new javax.swing.JLabel();
jLabel37 = new javax.swing.JLabel();
jLabel46 = new javax.swing.JLabel();
locRFS_Lon = new java.awt.TextField();
datePlotNow = new javax.swing.JTextField();
TotalEnergy = new javax.swing.JTextField();
datePlot = new javax.swing.JTextField();
datePlotPre = new javax.swing.JTextField();
worldMap = new javax.swing.JPanel();
datePlotMatPost = new javax.swing.JTextField();
TotalEnergyMap = new javax.swing.JTextField();
datePlotMapCenter = new javax.swing.JTextField();
datePlotMatPre = new javax.swing.JTextField();
propagationViewerLT = new javax.swing.JPanel();
jPanel30 = new javax.swing.JPanel();
callSignLTA = new java.awt.TextField();
elevationLTA = new java.awt.TextField();
antennaLTA = new java.awt.TextField();
gridSquareLTA = new java.awt.TextField();
jLabel41 = new javax.swing.JLabel();
jLabel43 = new javax.swing.JLabel();
jLabel44 = new javax.swing.JLabel();
jLabel45 = new javax.swing.JLabel();
TotalEnergyAVG = new javax.swing.JTextField();
datePlotLT = new javax.swing.JTextField();
TotalEnergyAVGperDay = new javax.swing.JTextField();
jDesktopPane2 = new javax.swing.JDesktopPane();
jDesktopPane3 = new javax.swing.JDesktopPane();
RTC_depth = new javax.swing.JRadioButton();
RTC_mag = new javax.swing.JRadioButton();
RTC_distance = new javax.swing.JRadioButton();
reverseSearchOrder = new javax.swing.JCheckBox();
jLabel19 = new javax.swing.JLabel();
RTC_time = new javax.swing.JRadioButton();
selectedQuake = new java.awt.TextField();
jLabel21 = new javax.swing.JLabel();
jButtonredrawClearSelQuake = new javax.swing.JButton();
quakeSelector = new javax.swing.JComboBox<>();
codePanelActivtesUpdate = new javax.swing.JPanel();
jPanel10 = new javax.swing.JPanel();
jLabel18 = new javax.swing.JLabel();
shockWaveDel = new java.awt.TextField();
speedOfQuake = new java.awt.TextField();
jLabel20 = new javax.swing.JLabel();
runtimeInterval = new javax.swing.JSpinner();
events = new javax.swing.JTabbedPane();
jScrollPane1 = new javax.swing.JScrollPane();
listEarthquakes = new javax.swing.JTextArea();
jScrollPane5 = new javax.swing.JScrollPane();
AVG = new javax.swing.JTextArea();
jScrollPane4 = new javax.swing.JScrollPane();
NW_events = new javax.swing.JTextArea();
jScrollPane8 = new javax.swing.JScrollPane();
NOAAalertsText = new javax.swing.JTextArea();
propTrackPane = new javax.swing.JScrollPane();
WSPR = new javax.swing.JTextPane();
jScrollPane6 = new javax.swing.JScrollPane();
rawDataList = new javax.swing.JTextArea();
jMenuBar2 = new javax.swing.JMenuBar();
jMenuGetWSPR = new javax.swing.JMenu();
jMenuItemgetWSPR_Item = new javax.swing.JMenuItem();
jMenuRemData = new javax.swing.JMenu();
jMenuRemDataItem = new javax.swing.JMenuItem();
jMenuGetQuakes = new javax.swing.JMenu();
jMenuGetQuakesItem = new javax.swing.JMenuItem();
jMenuCompare = new javax.swing.JMenu();
jMenuCompareItem = new javax.swing.JMenuItem();
jMenuReDraw = new javax.swing.JMenu();
jMenuReDrawItem = new javax.swing.JMenuItem();
jMenuGetNOAA = new javax.swing.JMenu();
jMenuItem2 = new javax.swing.JMenuItem();
jTextArea1.setColumns(20);
jTextArea1.setRows(5);
jScrollPane3.setViewportView(jTextArea1);
jMenu1.setText("File");
jMenuBar1.add(jMenu1);
jMenu2.setText("Edit");
jMenuBar1.add(jMenu2);
jMenu3.setText("jMenu3");
jMenuItem1.setText("jMenuItem1");
jMenu4.setText("jMenu4");
javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
jPanel6.setLayout(jPanel6Layout);
jPanel6Layout.setHorizontalGroup(
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 100, Short.MAX_VALUE)
);
jPanel6Layout.setVerticalGroup(
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 100, Short.MAX_VALUE)
);
javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
jPanel9.setLayout(jPanel9Layout);
jPanel9Layout.setHorizontalGroup(
jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 100, Short.MAX_VALUE)
);
jPanel9Layout.setVerticalGroup(
jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 100, Short.MAX_VALUE)
);
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setMinimumSize(new java.awt.Dimension(981, 987));
addWindowFocusListener(new java.awt.event.WindowFocusListener() {
public void windowGainedFocus(java.awt.event.WindowEvent evt) {
formWindowGainedFocus(evt);
}
public void windowLostFocus(java.awt.event.WindowEvent evt) {
}
});
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowOpened(java.awt.event.WindowEvent evt) {
formWindowOpened(evt);
}
public void windowClosing(java.awt.event.WindowEvent evt) {
formWindowClosing(evt);
}
});
TopPanel.setMinimumSize(new java.awt.Dimension(400, 800));
TopPanel.setPreferredSize(new java.awt.Dimension(889, 1200));
jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jPanel5.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jComboBoxEqkData.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "File N/A", "File not found" }));
jComboBoxEqkData.setToolTipText("auto select file containing quakes");
jComboBoxEqkData.setMaximumSize(new java.awt.Dimension(230, 24));
jComboBoxEqkData.setMinimumSize(new java.awt.Dimension(230, 24));
jComboBoxEqkData.setPreferredSize(new java.awt.Dimension(230, 24));
jComboBoxEqkData.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseEntered(java.awt.event.MouseEvent evt) {
jComboBoxEqkDataMouseEntered(evt);
}
});
jComboBoxEqkData.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jComboBoxEqkDataActionPerformed(evt);
}
});
jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Display Setup"));
jPanel2.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseExited(java.awt.event.MouseEvent evt) {
jPanel2MouseExited(evt);
}
public void mouseEntered(java.awt.event.MouseEvent evt) {
jPanel2MouseEntered(evt);
}
});
tagMagThresh.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "5.0", "5.1", "5.2", "5.3", "5.4", "5.5", "5.6", "5.7", "5.8", "5.9", "6.0" }));
tagMagThresh.setToolTipText("select label Threshold");
tagMagThresh.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
tagMagThreshActionPerformed(evt);
}
});
jLabel8.setText("Label Mag.");
jLabel8.setToolTipText("select label theshold to be displaied");
jLabel9.setText("List Mag.");
jLabel9.setToolTipText("List quakes larger than in in quake list");
listThresh.setMaximumRowCount(4);
listThresh.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "2.0", "3.5", "4.5", "5.0" }));
listThresh.setToolTipText("select list Threshold");
listThresh.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseEntered(java.awt.event.MouseEvent evt) {
listThreshMouseEntered(evt);
}
});
listThresh.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
listThreshActionPerformed(evt);
}
});
jLabel12.setText("Text Mag.");
jLabel12.setToolTipText("select text theshold to be displaied");
tagTextThresh.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "5.0", "5.1", "5.2", "5.3", "5.4", "5.5", "5.6", "5.7", "5.8", "5.9", "6.0" }));
tagTextThresh.setToolTipText("select label Threshold");
tagTextThresh.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
tagTextThreshActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(1, 1, 1)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jLabel8)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(tagMagThresh, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jLabel12)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(tagTextThresh, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(18, 18, 18)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel9)
.addComponent(listThresh, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(tagMagThresh, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel8))
.addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(listThresh, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(tagTextThresh, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jButtonredrawGrafics.setText("View");
jButtonredrawGrafics.setToolTipText("click to toggle graph window and exit to redraw");
jButtonredrawGrafics.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButtonredrawGraficsMouseClicked(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
jButtonredrawGraficsMouseExited(evt);
}
public void mouseEntered(java.awt.event.MouseEvent evt) {
jButtonredrawGraficsMouseEntered(evt);
}
});
jButtonredrawGrafics.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonredrawGraficsActionPerformed(evt);
}
});
jComboBoxDataFileSelect.setEditable(true);
jComboBoxDataFileSelect.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Files", "Live", "dailyBackup.csv" }));
jComboBoxDataFileSelect.setToolTipText("select file containing data");
jComboBoxDataFileSelect.setMaximumSize(new java.awt.Dimension(230, 24));
jComboBoxDataFileSelect.setMinimumSize(new java.awt.Dimension(230, 24));
jComboBoxDataFileSelect.setPreferredSize(new java.awt.Dimension(230, 24));
jComboBoxDataFileSelect.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusLost(java.awt.event.FocusEvent evt) {
jComboBoxDataFileSelectFocusLost(evt);
}
});
jComboBoxDataFileSelect.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseEntered(java.awt.event.MouseEvent evt) {
jComboBoxDataFileSelectMouseEntered(evt);
}
});
jComboBoxDataFileSelect.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jComboBoxDataFileSelectActionPerformed(evt);
}
});
jPanel4.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jButtonPrintSeceen.setText("Print Screen");
jButtonPrintSeceen.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseEntered(java.awt.event.MouseEvent evt) {
jButtonPrintSeceenMouseEntered(evt);
}
});
jButtonPrintSeceen.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonPrintSeceenActionPerformed(evt);
}
});
jButtonMatchQuakesNoise.setText("Compare");
jButtonMatchQuakesNoise.setToolTipText("match noise time to quake time");
jButtonMatchQuakesNoise.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButtonMatchQuakesNoiseMouseClicked(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
jButtonMatchQuakesNoiseMouseExited(evt);
}
public void mouseEntered(java.awt.event.MouseEvent evt) {
jButtonMatchQuakesNoiseMouseEntered(evt);
}
});
jButtonLoadUSGS_data.setText("Load current >M2.5");
jButtonLoadUSGS_data.setToolTipText("data retrived from USGS database");
jButtonLoadUSGS_data.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseEntered(java.awt.event.MouseEvent evt) {
jButtonLoadUSGS_dataMouseEntered(evt);
}
});
jButtonLoadUSGS_data.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonLoadUSGS_dataActionPerformed(evt);
}
});
jButtonOpenRemoteData.setText("Get RemoteD.");
jButtonOpenRemoteData.setToolTipText("load current noise data as per selected source");
jButtonOpenRemoteData.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseExited(java.awt.event.MouseEvent evt) {
jButtonOpenRemoteDataMouseExited(evt);
}
public void mouseEntered(java.awt.event.MouseEvent evt) {
jButtonOpenRemoteDataMouseEntered(evt);
}
});
jButtonOpenRemoteData.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonOpenRemoteDataActionPerformed(evt);
}
});
jButtonLoadWSPR_data.setText("Load WSPR D.");
jButtonLoadWSPR_data.setToolTipText("load current propagation data");
jButtonLoadWSPR_data.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButtonLoadWSPR_dataMouseClicked(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
jButtonLoadWSPR_dataMouseExited(evt);
}
public void mouseEntered(java.awt.event.MouseEvent evt) {
jButtonLoadWSPR_dataMouseEntered(evt);
}
});
jButtonUploadQuakesLst.setText("Upload Quakes");
jButtonUploadQuakesLst.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonUploadQuakesLstActionPerformed(evt);
}
});
codePanelActivtesUpdate1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseEntered(java.awt.event.MouseEvent evt) {
codePanelActivtesUpdate1MouseEntered(evt);
}
});
javax.swing.GroupLayout codePanelActivtesUpdate1Layout = new javax.swing.GroupLayout(codePanelActivtesUpdate1);
codePanelActivtesUpdate1.setLayout(codePanelActivtesUpdate1Layout);
codePanelActivtesUpdate1Layout.setHorizontalGroup(
codePanelActivtesUpdate1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 0, Short.MAX_VALUE)
);
codePanelActivtesUpdate1Layout.setVerticalGroup(
codePanelActivtesUpdate1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 25, Short.MAX_VALUE)
);
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
jPanel4.setLayout(jPanel4Layout);
jPanel4Layout.setHorizontalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup()
.addComponent(jButtonUploadQuakesLst, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jButtonPrintSeceen, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButtonMatchQuakesNoise, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup()
.addComponent(jButtonLoadWSPR_data, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jButtonOpenRemoteData)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(codePanelActivtesUpdate1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButtonLoadUSGS_data)))
.addContainerGap())
);
jPanel4Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jButtonOpenRemoteData, jButtonPrintSeceen});
jPanel4Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jButtonLoadWSPR_data, jButtonUploadQuakesLst});
jPanel4Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jButtonLoadUSGS_data, jButtonMatchQuakesNoise});
jPanel4Layout.setVerticalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGap(12, 12, 12)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButtonLoadUSGS_data)
.addComponent(jButtonOpenRemoteData)
.addComponent(jButtonLoadWSPR_data)))
.addGroup(jPanel4Layout.createSequentialGroup()
.addContainerGap()
.addComponent(codePanelActivtesUpdate1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButtonMatchQuakesNoise)
.addComponent(jButtonPrintSeceen)
.addComponent(jButtonUploadQuakesLst))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel4Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jButtonLoadUSGS_data, jButtonMatchQuakesNoise});
jPanel4Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jButtonLoadWSPR_data, jButtonUploadQuakesLst});
jPanel4Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jButtonOpenRemoteData, jButtonPrintSeceen});
jPanel7.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jPanel7.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseExited(java.awt.event.MouseEvent evt) {
jPanel7MouseExited(evt);
}
});
jLabel10.setText("Y-off N.");
jLabel10.setToolTipText("Noise as measured by the RF-Seismograph");
RF_ViewerOffsetYaxes.setToolTipText("Y-Offset Noise Lines");
RF_ViewerOffsetYaxes.addChangeListener(new javax.swing.event.ChangeListener() {
public void stateChanged(javax.swing.event.ChangeEvent evt) {
RF_ViewerOffsetYaxesStateChanged(evt);
}
});
jLabel11.setText("Y-off Q.");
jLabel11.setToolTipText("Quake data from the USGS");
EarthQuakes_viewerOffsetYaxes.setToolTipText("Y-Offset Quake Line");
EarthQuakes_viewerOffsetYaxes.addChangeListener(new javax.swing.event.ChangeListener() {
public void stateChanged(javax.swing.event.ChangeEvent evt) {
EarthQuakes_viewerOffsetYaxesStateChanged(evt);
}
});
javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
jPanel7.setLayout(jPanel7Layout);
jPanel7Layout.setHorizontalGroup(
jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel7Layout.createSequentialGroup()
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jLabel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel10))
.addGap(2, 2, 2)
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(RF_ViewerOffsetYaxes, javax.swing.GroupLayout.DEFAULT_SIZE, 60, Short.MAX_VALUE)
.addComponent(EarthQuakes_viewerOffsetYaxes))
.addContainerGap())
);
jPanel7Layout.setVerticalGroup(
jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel7Layout.createSequentialGroup()
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(RF_ViewerOffsetYaxes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(12, 12, 12)
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(EarthQuakes_viewerOffsetYaxes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)))
);
CheckBoxArchive.setToolTipText("enter Archive mode");
CheckBoxArchive.setEnabled(false);
CheckBoxArchive.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseExited(java.awt.event.MouseEvent evt) {
CheckBoxArchiveMouseExited(evt);
}
});
CheckBoxArchive.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
CheckBoxArchiveActionPerformed(evt);
}
});
jLabel13.setText("Archive");
jLabel13.setToolTipText("Enter Archive mode");
jLabel13.setEnabled(false);
jPanel8.setBorder(javax.swing.BorderFactory.createTitledBorder("Daily Quake Statistic"));
jLabel39.setText("Total E.");
jLabel39.setToolTipText("total energy of all events of the last 24 h or date");
totalEnergyQuakes.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR));
totalEnergyQuakes.setEditable(false);
totalEnergyQuakes.setText("totalEnergy");
jLabel40.setText("24h Power equivalent");
jLabel40.setToolTipText("enter your call");
totalPowerQuakes.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR));
totalPowerQuakes.setEditable(false);
totalPowerQuakes.setText("totalPower");
javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
jPanel8.setLayout(jPanel8Layout);
jPanel8Layout.setHorizontalGroup(
jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel8Layout.createSequentialGroup()
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel40, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel8Layout.createSequentialGroup()
.addComponent(jLabel39)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(totalEnergyQuakes, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel8Layout.createSequentialGroup()
.addGap(34, 34, 34)
.addComponent(totalPowerQuakes, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(0, 0, Short.MAX_VALUE))
);
jPanel8Layout.setVerticalGroup(
jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel8Layout.createSequentialGroup()
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel39)
.addComponent(totalEnergyQuakes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(14, 14, 14)
.addComponent(jLabel40)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(totalPowerQuakes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 7, Short.MAX_VALUE))
);
jButtonOpenGetArchivedData.setText("Get Data");
jButtonOpenGetArchivedData.setToolTipText("Note: This is large remote file and it will take a while to download.");
jButtonOpenGetArchivedData.setEnabled(false);
jButtonOpenGetArchivedData.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonOpenGetArchivedDataActionPerformed(evt);
}
});
callSignDatatoDisplay.setMaximumRowCount(2);
callSignDatatoDisplay.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "VE7DXW", "NJ7OK" }));
callSignDatatoDisplay.setToolTipText("select Data source");
callSignDatatoDisplay.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
callSignDatatoDisplayActionPerformed(evt);
}
});
LongTimeAverageCal.setText("LTA");
LongTimeAverageCal.setToolTipText("long term avarage calculator");
LongTimeAverageCal.setAutoscrolls(true);
LongTimeAverageCal.setEnabled(false);
LongTimeAverageCal.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseEntered(java.awt.event.MouseEvent evt) {
LongTimeAverageCalMouseEntered(evt);
}
});
LongTimeAverageCal.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
LongTimeAverageCalActionPerformed(evt);
}
});
CheckBoxShowLTA.setToolTipText("include the AVG noise in LTA");
CheckBoxShowLTA.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseExited(java.awt.event.MouseEvent evt) {
CheckBoxShowLTAMouseExited(evt);
}
});
CheckBoxShowLTA.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
CheckBoxShowLTAActionPerformed(evt);
}
});
jLabel17.setText("Show Noise");
jLabel17.setToolTipText("display noise in LTA graph");
jDesktopPane1.setBorder(javax.swing.BorderFactory.createTitledBorder("WSPR Parameter"));
jDesktopPane1.setForeground(new java.awt.Color(204, 204, 204));
durationMin.setMaximumRowCount(4);
durationMin.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "4", "6", "8", "10", "20" }));
durationMin.setToolTipText("select list Threshold");
numberRec.setMaximumRowCount(4);
numberRec.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "1", "10", "100", "1k", "10k" }));
numberRec.setSelectedIndex(2);
numberRec.setToolTipText("select list Threshold");
jLabel16.setText("> t [m]");
jLabel16.setToolTipText("List data for time past current ");
jLabel15.setText("# rec");
jLabel15.setToolTipText("number of record listed");
jDesktopPane1.setLayer(durationMin, javax.swing.JLayeredPane.DEFAULT_LAYER);
jDesktopPane1.setLayer(numberRec, javax.swing.JLayeredPane.DEFAULT_LAYER);
jDesktopPane1.setLayer(jLabel16, javax.swing.JLayeredPane.DEFAULT_LAYER);
jDesktopPane1.setLayer(jLabel15, javax.swing.JLayeredPane.DEFAULT_LAYER);
javax.swing.GroupLayout jDesktopPane1Layout = new javax.swing.GroupLayout(jDesktopPane1);
jDesktopPane1.setLayout(jDesktopPane1Layout);
jDesktopPane1Layout.setHorizontalGroup(
jDesktopPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jDesktopPane1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jDesktopPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel15)
.addComponent(numberRec, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jDesktopPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(durationMin, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap())
);
jDesktopPane1Layout.setVerticalGroup(
jDesktopPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jDesktopPane1Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jDesktopPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel15, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel16, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jDesktopPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(numberRec, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(durationMin, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
);
jLabel14.setText("old Data mode");
jLabel14.setToolTipText("used for data tranfer from old data set");
jButtonCheckNW.setText("CNW");
jButtonCheckNW.setToolTipText("check network speed (only works in Linux)");
jButtonCheckNW.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonCheckNWActionPerformed(evt);
}
});
jButtonClearSelected.setText("ClearSel");
jButtonClearSelected.setToolTipText("delete and clear data from selected pane");
jButtonClearSelected.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonClearSelectedActionPerformed(evt);
}
});
loadNOAA.setText("Ld NOAA");
loadNOAA.setToolTipText("refresh NOAA alert listing");
loadNOAA.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
loadNOAAActionPerformed(evt);
}
});
jButtonClearAll.setText("ClearAll");
jButtonClearAll.setToolTipText("clear all panes but not data");
jButtonClearAll.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonClearAllActionPerformed(evt);
}
});
startRFS.setText("resetCnt");
startRFS.setToolTipText("open Seismograph (only works in Linux)");
startRFS.setAutoscrolls(true);
startRFS.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
startRFSActionPerformed(evt);
}
});
jButtonClearData.setText("ClearData");
jButtonClearData.setToolTipText("clear earthquake and noise data");
jButtonClearData.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonClearDataActionPerformed(evt);
}
});
jButtonDeleteUser.setText("Del Usr");
jButtonDeleteUser.setToolTipText("delete user file");
jButtonDeleteUser.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonDeleteUserActionPerformed(evt);
}
});
CheckBoxoldDataMode.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
CheckBoxoldDataModeActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(startRFS)
.addComponent(jButtonDeleteUser))
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButtonCheckNW, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
.addGap(6, 6, 6)
.addComponent(jButtonClearData, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(12, 12, 12)
.addComponent(CheckBoxoldDataMode)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel14)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButtonClearSelected)
.addComponent(loadNOAA)
.addComponent(jButtonClearAll))
.addGap(24, 24, 24))
);
jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jButtonClearAll, jButtonClearSelected, loadNOAA});
jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jButtonCheckNW, jButtonClearData});
jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jButtonDeleteUser, startRFS});
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(0, 0, 0)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(31, 31, 31)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButtonClearData)
.addComponent(jButtonDeleteUser)
.addComponent(jButtonClearSelected)))
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(startRFS)
.addComponent(jButtonCheckNW)
.addComponent(loadNOAA)))
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 9, Short.MAX_VALUE)
.addComponent(CheckBoxoldDataMode))
.addGroup(jPanel3Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(6, 6, 6)
.addComponent(jButtonClearAll)))
.addContainerGap(20, Short.MAX_VALUE))
);
javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
jPanel5.setLayout(jPanel5Layout);
jPanel5Layout.setHorizontalGroup(
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(21, 21, 21)
.addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel5Layout.createSequentialGroup()
.addComponent(jDesktopPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
.addComponent(jPanel4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel5Layout.createSequentialGroup()
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addContainerGap()
.addComponent(CheckBoxShowLTA)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel17))
.addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addComponent(CheckBoxArchive)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel13)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButtonOpenGetArchivedData))
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jComboBoxDataFileSelect, 0, 246, Short.MAX_VALUE)
.addComponent(jComboBoxEqkData, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addGap(17, 17, 17)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButtonredrawGrafics, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(LongTimeAverageCal, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addGroup(jPanel5Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(callSignDatatoDisplay, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)))))
.addGap(53, 53, 53))
);
jPanel5Layout.setVerticalGroup(
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addGap(6, 6, 6)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(CheckBoxArchive, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel13)
.addComponent(jButtonOpenGetArchivedData)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jComboBoxDataFileSelect, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jComboBoxEqkData, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel5Layout.createSequentialGroup()
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(CheckBoxShowLTA, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel17, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(jPanel5Layout.createSequentialGroup()
.addComponent(callSignDatatoDisplay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jButtonredrawGrafics)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 15, Short.MAX_VALUE)
.addComponent(LongTimeAverageCal)))
.addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanel5Layout.createSequentialGroup()
.addGap(3, 3, 3)
.addComponent(jDesktopPane1))
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap())
);
jPanel5Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jComboBoxDataFileSelect, jComboBoxEqkData});
jPanel5Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jPanel2, jPanel8});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, 499, javax.swing.GroupLayout.PREFERRED_SIZE)
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 24, Short.MAX_VALUE))
);
jTabbedPaneGraphics.setTabPlacement(javax.swing.JTabbedPane.BOTTOM);
jTabbedPaneGraphics.setToolTipText("click to toggle graph window and exit to redraw");
jTabbedPaneGraphics.addChangeListener(new javax.swing.event.ChangeListener() {
public void stateChanged(javax.swing.event.ChangeEvent evt) {
jTabbedPaneGraphicsStateChanged(evt);
}
});
jTabbedPaneGraphics.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jTabbedPaneGraphicsMouseClicked(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
jTabbedPaneGraphicsMouseExited(evt);
}
});
propagationViewer.setBackground(new java.awt.Color(-12566464,true));
propagationViewer.setFocusable(false);
propagationViewer.setMaximumSize(new java.awt.Dimension(825, 400));
propagationViewer.setMinimumSize(new java.awt.Dimension(825, 400));
propagationViewer.setPreferredSize(new java.awt.Dimension(825, 501));
jPanel29.setBackground(new java.awt.Color(204, 204, 204));
jPanel29.setBorder(javax.swing.BorderFactory.createTitledBorder("Station"));
jPanel29.setForeground(new java.awt.Color(204, 204, 204));
jPanel29.setRequestFocusEnabled(false);
callSign.setBackground(new java.awt.Color(153, 153, 153));
callSign.setFont(new java.awt.Font("Dialog", 1, 12)); // NOI18N
callSign.setForeground(new java.awt.Color(255, 0, 0));
callSign.setText("callSign");
elevation.setBackground(new java.awt.Color(153, 153, 153));
elevation.setFont(new java.awt.Font("Dialog", 1, 12)); // NOI18N
elevation.setForeground(new java.awt.Color(255, 0, 0));
elevation.setText("elevation");
elevation.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusLost(java.awt.event.FocusEvent evt) {
elevationFocusLost(evt);
}
});
antenna.setBackground(new java.awt.Color(153, 153, 153));
antenna.setFont(new java.awt.Font("Dialog", 1, 12)); // NOI18N
antenna.setForeground(new java.awt.Color(255, 0, 0));
antenna.setText("antenna");
locRFS_Lat.setBackground(new java.awt.Color(153, 153, 153));
locRFS_Lat.setFont(new java.awt.Font("Dialog", 1, 12)); // NOI18N
locRFS_Lat.setForeground(new java.awt.Color(255, 0, 0));
locRFS_Lat.setName("locRFS_Lat"); // NOI18N
locRFS_Lat.setText("locRFS_Lat");
jLabel38.setText("Elevation");
jLabel38.setToolTipText("elevation of your station in meters");
jLabel42.setText("Antenna");
jLabel42.setToolTipText("type or model number of used antenna");
jLabel36.setForeground(new java.awt.Color(204, 51, 0));
jLabel36.setText("Call Sign");
jLabel36.setToolTipText("enter your call");
jLabel37.setText("Loc Lat");
jLabel37.setToolTipText("enter grid square");
jLabel46.setText("Loc Lon");
jLabel46.setToolTipText("enter grid square");
locRFS_Lon.setBackground(new java.awt.Color(153, 153, 153));
locRFS_Lon.setFont(new java.awt.Font("Dialog", 1, 12)); // NOI18N
locRFS_Lon.setForeground(new java.awt.Color(255, 0, 0));
locRFS_Lon.setName("locRFS_Lat"); // NOI18N
locRFS_Lon.setText("locRFS_Lon");
javax.swing.GroupLayout jPanel29Layout = new javax.swing.GroupLayout(jPanel29);
jPanel29.setLayout(jPanel29Layout);
jPanel29Layout.setHorizontalGroup(
jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel29Layout.createSequentialGroup()
.addGroup(jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel29Layout.createSequentialGroup()
.addGroup(jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel36)
.addComponent(jLabel37)
.addComponent(jLabel46, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(jPanel29Layout.createSequentialGroup()
.addComponent(jLabel42, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(9, 9, 9)))
.addGroup(jPanel29Layout.createSequentialGroup()
.addComponent(jLabel38)
.addGap(4, 4, 4)))
.addGroup(jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(elevation, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(antenna, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(locRFS_Lon, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel29Layout.createSequentialGroup()
.addGroup(jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(locRFS_Lat, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(callSign, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
);
jPanel29Layout.setVerticalGroup(
jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel29Layout.createSequentialGroup()
.addGroup(jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel36)
.addComponent(callSign, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel37)
.addComponent(locRFS_Lat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(locRFS_Lon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel46))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(antenna, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel42))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(elevation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel38))
.addContainerGap())
);
datePlotNow.setBackground(java.awt.Color.gray);
datePlotNow.setFont(new java.awt.Font("Dialog", 0, 18)); // NOI18N
datePlotNow.setForeground(new java.awt.Color(255, 0, 51));
datePlotNow.setHorizontalAlignment(javax.swing.JTextField.CENTER);
datePlotNow.setText("dateOfPlot");
datePlotNow.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
TotalEnergy.setBackground(java.awt.Color.gray);
TotalEnergy.setFont(new java.awt.Font("Dialog", 0, 18)); // NOI18N
TotalEnergy.setForeground(new java.awt.Color(255, 255, 51));
TotalEnergy.setHorizontalAlignment(javax.swing.JTextField.LEFT);
TotalEnergy.setText("Total Energy:");
TotalEnergy.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
TotalEnergy.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
TotalEnergyActionPerformed(evt);
}
});
datePlot.setBackground(java.awt.Color.gray);
datePlot.setFont(new java.awt.Font("Dialog", 0, 18)); // NOI18N
datePlot.setForeground(new java.awt.Color(255, 0, 51));
datePlot.setHorizontalAlignment(javax.swing.JTextField.CENTER);
datePlot.setText("dateOfPlot");
datePlot.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
datePlotPre.setBackground(java.awt.Color.gray);
datePlotPre.setFont(new java.awt.Font("Dialog", 0, 18)); // NOI18N
datePlotPre.setForeground(new java.awt.Color(255, 0, 51));
datePlotPre.setHorizontalAlignment(javax.swing.JTextField.CENTER);
datePlotPre.setText("dateOfPlot");
datePlotPre.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
javax.swing.GroupLayout propagationViewerLayout = new javax.swing.GroupLayout(propagationViewer);
propagationViewer.setLayout(propagationViewerLayout);
propagationViewerLayout.setHorizontalGroup(
propagationViewerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(propagationViewerLayout.createSequentialGroup()
.addContainerGap()
.addGroup(propagationViewerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(propagationViewerLayout.createSequentialGroup()
.addComponent(TotalEnergy, javax.swing.GroupLayout.PREFERRED_SIZE, 224, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 397, Short.MAX_VALUE)
.addComponent(jPanel29, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, propagationViewerLayout.createSequentialGroup()
.addComponent(datePlotPre, javax.swing.GroupLayout.PREFERRED_SIZE, 228, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(51, 51, 51)
.addComponent(datePlot, javax.swing.GroupLayout.PREFERRED_SIZE, 228, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(datePlotNow, javax.swing.GroupLayout.PREFERRED_SIZE, 228, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())))
);
propagationViewerLayout.setVerticalGroup(
propagationViewerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(propagationViewerLayout.createSequentialGroup()
.addGap(34, 34, 34)
.addGroup(propagationViewerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(datePlot, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(datePlotNow, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(datePlotPre, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(propagationViewerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(propagationViewerLayout.createSequentialGroup()
.addGap(339, 339, 339)
.addComponent(TotalEnergy, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(57, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, propagationViewerLayout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel29, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE))))
);
jTabbedPaneGraphics.addTab("Graph", propagationViewer);
worldMap.setBackground(new java.awt.Color(-12566464,true));
worldMap.setFocusable(false);
worldMap.setMaximumSize(new java.awt.Dimension(825, 400));
worldMap.setMinimumSize(new java.awt.Dimension(825, 400));
worldMap.setPreferredSize(new java.awt.Dimension(825, 501));
datePlotMatPost.setBackground(java.awt.Color.gray);
datePlotMatPost.setFont(new java.awt.Font("Dialog", 0, 18)); // NOI18N
datePlotMatPost.setForeground(new java.awt.Color(255, 0, 51));
datePlotMatPost.setHorizontalAlignment(javax.swing.JTextField.CENTER);
datePlotMatPost.setText("dateOfPlot");
datePlotMatPost.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
datePlotMatPost.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
datePlotMatPostActionPerformed(evt);
}
});
TotalEnergyMap.setBackground(java.awt.Color.gray);
TotalEnergyMap.setFont(new java.awt.Font("Dialog", 0, 18)); // NOI18N
TotalEnergyMap.setForeground(new java.awt.Color(255, 255, 51));
TotalEnergyMap.setHorizontalAlignment(javax.swing.JTextField.LEFT);
TotalEnergyMap.setText("Total Energy:");
TotalEnergyMap.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
TotalEnergyMap.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
TotalEnergyMapActionPerformed(evt);
}
});
datePlotMapCenter.setBackground(java.awt.Color.gray);
datePlotMapCenter.setFont(new java.awt.Font("Dialog", 0, 18)); // NOI18N
datePlotMapCenter.setForeground(new java.awt.Color(255, 0, 51));
datePlotMapCenter.setHorizontalAlignment(javax.swing.JTextField.CENTER);
datePlotMapCenter.setText("dateOfPlot");
datePlotMapCenter.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
datePlotMapCenter.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
datePlotMapCenterActionPerformed(evt);
}
});
datePlotMatPre.setBackground(java.awt.Color.gray);
datePlotMatPre.setFont(new java.awt.Font("Dialog", 0, 18)); // NOI18N
datePlotMatPre.setForeground(new java.awt.Color(255, 0, 51));
datePlotMatPre.setHorizontalAlignment(javax.swing.JTextField.CENTER);
datePlotMatPre.setText("dateOfPlot");
datePlotMatPre.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
datePlotMatPre.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
datePlotMatPreActionPerformed(evt);
}
});
javax.swing.GroupLayout worldMapLayout = new javax.swing.GroupLayout(worldMap);
worldMap.setLayout(worldMapLayout);
worldMapLayout.setHorizontalGroup(
worldMapLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(worldMapLayout.createSequentialGroup()
.addContainerGap()
.addGroup(worldMapLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(worldMapLayout.createSequentialGroup()
.addComponent(TotalEnergyMap, javax.swing.GroupLayout.PREFERRED_SIZE, 224, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, worldMapLayout.createSequentialGroup()
.addComponent(datePlotMatPre, javax.swing.GroupLayout.PREFERRED_SIZE, 228, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(51, 51, 51)
.addComponent(datePlotMapCenter, javax.swing.GroupLayout.PREFERRED_SIZE, 228, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 66, Short.MAX_VALUE)
.addComponent(datePlotMatPost, javax.swing.GroupLayout.PREFERRED_SIZE, 228, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())))
);
worldMapLayout.setVerticalGroup(
worldMapLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(worldMapLayout.createSequentialGroup()
.addGap(34, 34, 34)
.addGroup(worldMapLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(datePlotMapCenter, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(datePlotMatPost, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(datePlotMatPre, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(339, 339, 339)
.addComponent(TotalEnergyMap, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jTabbedPaneGraphics.addTab("Map", worldMap);
propagationViewerLT.setBackground(new java.awt.Color(-12566464,true));
propagationViewerLT.setFocusable(false);
propagationViewerLT.setMaximumSize(new java.awt.Dimension(825, 400));
propagationViewerLT.setMinimumSize(new java.awt.Dimension(825, 400));
propagationViewerLT.setPreferredSize(new java.awt.Dimension(825, 501));
jPanel30.setBackground(new java.awt.Color(204, 204, 204));
jPanel30.setBorder(javax.swing.BorderFactory.createTitledBorder("Station"));
jPanel30.setForeground(new java.awt.Color(204, 204, 204));
callSignLTA.setBackground(new java.awt.Color(153, 153, 153));
callSignLTA.setFont(new java.awt.Font("Dialog", 1, 12)); // NOI18N
callSignLTA.setForeground(new java.awt.Color(255, 0, 0));
callSignLTA.setText("callSign");
callSignLTA.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
callSignLTAActionPerformed(evt);
}
});
elevationLTA.setBackground(new java.awt.Color(153, 153, 153));
elevationLTA.setFont(new java.awt.Font("Dialog", 1, 12)); // NOI18N
elevationLTA.setForeground(new java.awt.Color(255, 0, 0));
elevationLTA.setText("elevation");
elevationLTA.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusLost(java.awt.event.FocusEvent evt) {
elevationLTAFocusLost(evt);
}
});
antennaLTA.setBackground(new java.awt.Color(153, 153, 153));
antennaLTA.setFont(new java.awt.Font("Dialog", 1, 12)); // NOI18N
antennaLTA.setForeground(new java.awt.Color(255, 0, 0));
antennaLTA.setText("antenna");
gridSquareLTA.setBackground(new java.awt.Color(153, 153, 153));
gridSquareLTA.setFont(new java.awt.Font("Dialog", 1, 12)); // NOI18N
gridSquareLTA.setForeground(new java.awt.Color(255, 0, 0));
gridSquareLTA.setText("gridSquare");
gridSquareLTA.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
gridSquareLTAActionPerformed(evt);
}
});
jLabel41.setText("Elevation");
jLabel41.setToolTipText("elevation of your station in meters");
jLabel43.setText("Antenna");
jLabel43.setToolTipText("type or model number of used antenna");
jLabel44.setForeground(new java.awt.Color(204, 51, 0));
jLabel44.setText("Call Sign");
jLabel44.setToolTipText("enter your call");
jLabel45.setText("Coord.");
jLabel45.setToolTipText("enter grid square");
javax.swing.GroupLayout jPanel30Layout = new javax.swing.GroupLayout(jPanel30);
jPanel30.setLayout(jPanel30Layout);
jPanel30Layout.setHorizontalGroup(
jPanel30Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel30Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel30Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel30Layout.createSequentialGroup()
.addGroup(jPanel30Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel44)
.addComponent(jLabel43, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel30Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(callSignLTA, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(antennaLTA, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel30Layout.createSequentialGroup()
.addComponent(jLabel45)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(gridSquareLTA, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel30Layout.createSequentialGroup()
.addComponent(jLabel41)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(elevationLTA, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap())
);
jPanel30Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {antennaLTA, callSignLTA, elevationLTA, gridSquareLTA});
jPanel30Layout.setVerticalGroup(
jPanel30Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel30Layout.createSequentialGroup()
.addGroup(jPanel30Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(callSignLTA, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel44))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel30Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel45)
.addComponent(gridSquareLTA, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel30Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel43, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(antennaLTA, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel30Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(elevationLTA, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel30Layout.createSequentialGroup()
.addGap(2, 2, 2)
.addComponent(jLabel41)
.addGap(4, 4, 4)))
.addContainerGap())
);
TotalEnergyAVG.setBackground(java.awt.Color.gray);
TotalEnergyAVG.setFont(new java.awt.Font("Dialog", 0, 18)); // NOI18N
TotalEnergyAVG.setForeground(new java.awt.Color(255, 255, 51));
TotalEnergyAVG.setHorizontalAlignment(javax.swing.JTextField.LEFT);
TotalEnergyAVG.setText("Total Energy:");
TotalEnergyAVG.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
datePlotLT.setEditable(false);
datePlotLT.setBackground(java.awt.Color.gray);
datePlotLT.setFont(new java.awt.Font("Dialog", 0, 18)); // NOI18N
datePlotLT.setForeground(new java.awt.Color(255, 0, 51));
datePlotLT.setHorizontalAlignment(javax.swing.JTextField.LEFT);
datePlotLT.setText("durationOfPlot");
datePlotLT.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
TotalEnergyAVGperDay.setBackground(java.awt.Color.gray);
TotalEnergyAVGperDay.setFont(new java.awt.Font("Dialog", 0, 18)); // NOI18N
TotalEnergyAVGperDay.setForeground(new java.awt.Color(255, 255, 51));
TotalEnergyAVGperDay.setHorizontalAlignment(javax.swing.JTextField.LEFT);
TotalEnergyAVGperDay.setText("Avg. Energy per day:");
TotalEnergyAVGperDay.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
TotalEnergyAVGperDay.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
TotalEnergyAVGperDayActionPerformed(evt);
}
});
javax.swing.GroupLayout propagationViewerLTLayout = new javax.swing.GroupLayout(propagationViewerLT);
propagationViewerLT.setLayout(propagationViewerLTLayout);
propagationViewerLTLayout.setHorizontalGroup(
propagationViewerLTLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(propagationViewerLTLayout.createSequentialGroup()
.addContainerGap()
.addGroup(propagationViewerLTLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(TotalEnergyAVG, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 224, Short.MAX_VALUE)
.addComponent(TotalEnergyAVGperDay, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 224, Short.MAX_VALUE)
.addComponent(datePlotLT, javax.swing.GroupLayout.Alignment.TRAILING))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 403, Short.MAX_VALUE)
.addComponent(jPanel30, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
);
propagationViewerLTLayout.setVerticalGroup(
propagationViewerLTLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(propagationViewerLTLayout.createSequentialGroup()
.addContainerGap(305, Short.MAX_VALUE)
.addGroup(propagationViewerLTLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel30, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, propagationViewerLTLayout.createSequentialGroup()
.addComponent(datePlotLT, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(TotalEnergyAVG, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(TotalEnergyAVGperDay, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(76, 76, 76))))
);
jTabbedPaneGraphics.addTab("Moving AVG", propagationViewerLT);
jDesktopPane2.setBackground(new java.awt.Color(238, 238, 238));
jDesktopPane2.setBorder(javax.swing.BorderFactory.createTitledBorder("Quake Selector"));
jDesktopPane3.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseEntered(java.awt.event.MouseEvent evt) {
jDesktopPane3MouseEntered(evt);
}
});
RTC_depth.setText("depth");
RTC_depth.setToolTipText("sort by depth");
RTC_depth.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseExited(java.awt.event.MouseEvent evt) {
RTC_depthMouseExited(evt);
}
});
RTC_depth.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
RTC_depthActionPerformed(evt);
}
});
RTC_mag.setText("mag");
RTC_mag.setToolTipText("sort by magnitude");
RTC_mag.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseExited(java.awt.event.MouseEvent evt) {
RTC_magMouseExited(evt);
}
});
RTC_mag.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
RTC_magActionPerformed(evt);
}
});
RTC_distance.setText("distance");
RTC_distance.setToolTipText("sort by distance");
RTC_distance.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseExited(java.awt.event.MouseEvent evt) {
RTC_distanceMouseExited(evt);
}
});
RTC_distance.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
RTC_distanceActionPerformed(evt);
}
});
reverseSearchOrder.setToolTipText("reverse search order");
reverseSearchOrder.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseExited(java.awt.event.MouseEvent evt) {
reverseSearchOrderMouseExited(evt);
}
});
reverseSearchOrder.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
reverseSearchOrderActionPerformed(evt);
}
});
jLabel19.setText("rev");
jLabel19.setToolTipText("display noise in LTA graph");
RTC_time.setSelected(true);
RTC_time.setText("time");
RTC_time.setToolTipText("sort by time");
RTC_time.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseExited(java.awt.event.MouseEvent evt) {
RTC_timeMouseExited(evt);
}
});
RTC_time.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
RTC_timeActionPerformed(evt);
}
});
selectedQuake.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR));
selectedQuake.setMaximumSize(new java.awt.Dimension(87, 19));
selectedQuake.setText("select Quake");
jLabel21.setText("Sel:");
jLabel21.setToolTipText("Noise as measured by the RF-Seismograph");
jButtonredrawClearSelQuake.setText("Clear");
jButtonredrawClearSelQuake.setToolTipText("click to toggle graph window and exit to redraw");
jButtonredrawClearSelQuake.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButtonredrawClearSelQuakeMouseClicked(evt);
}
});
jButtonredrawClearSelQuake.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
ctionPerformed(evt);
}
});
quakeSelector.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "select Quake" }));
quakeSelector.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
quakeSelectorMouseClicked(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
quakeSelectorMouseExited(evt);
}
public void mouseEntered(java.awt.event.MouseEvent evt) {
quakeSelectorMouseEntered(evt);
}
});
codePanelActivtesUpdate.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseEntered(java.awt.event.MouseEvent evt) {
codePanelActivtesUpdateMouseEntered(evt);
}
});
javax.swing.GroupLayout codePanelActivtesUpdateLayout = new javax.swing.GroupLayout(codePanelActivtesUpdate);
codePanelActivtesUpdate.setLayout(codePanelActivtesUpdateLayout);
codePanelActivtesUpdateLayout.setHorizontalGroup(
codePanelActivtesUpdateLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 0, Short.MAX_VALUE)
);
codePanelActivtesUpdateLayout.setVerticalGroup(
codePanelActivtesUpdateLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 3, Short.MAX_VALUE)
);
jDesktopPane3.setLayer(RTC_depth, javax.swing.JLayeredPane.DEFAULT_LAYER);
jDesktopPane3.setLayer(RTC_mag, javax.swing.JLayeredPane.DEFAULT_LAYER);
jDesktopPane3.setLayer(RTC_distance, javax.swing.JLayeredPane.DEFAULT_LAYER);
jDesktopPane3.setLayer(reverseSearchOrder, javax.swing.JLayeredPane.DEFAULT_LAYER);
jDesktopPane3.setLayer(jLabel19, javax.swing.JLayeredPane.DEFAULT_LAYER);
jDesktopPane3.setLayer(RTC_time, javax.swing.JLayeredPane.DEFAULT_LAYER);
jDesktopPane3.setLayer(selectedQuake, javax.swing.JLayeredPane.DEFAULT_LAYER);
jDesktopPane3.setLayer(jLabel21, javax.swing.JLayeredPane.DEFAULT_LAYER);
jDesktopPane3.setLayer(jButtonredrawClearSelQuake, javax.swing.JLayeredPane.DEFAULT_LAYER);
jDesktopPane3.setLayer(quakeSelector, javax.swing.JLayeredPane.DEFAULT_LAYER);
jDesktopPane3.setLayer(codePanelActivtesUpdate, javax.swing.JLayeredPane.DEFAULT_LAYER);
javax.swing.GroupLayout jDesktopPane3Layout = new javax.swing.GroupLayout(jDesktopPane3);
jDesktopPane3.setLayout(jDesktopPane3Layout);
jDesktopPane3Layout.setHorizontalGroup(
jDesktopPane3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(quakeSelector, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jDesktopPane3Layout.createSequentialGroup()
.addGroup(jDesktopPane3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jDesktopPane3Layout.createSequentialGroup()
.addContainerGap()
.addComponent(RTC_time)
.addGap(8, 8, 8)
.addComponent(RTC_mag)
.addGap(18, 18, 18)
.addComponent(RTC_depth)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 4, Short.MAX_VALUE)
.addComponent(RTC_distance)
.addGap(18, 18, 18)
.addComponent(reverseSearchOrder)
.addGap(4, 4, 4)
.addComponent(jLabel19))
.addGroup(jDesktopPane3Layout.createSequentialGroup()
.addGroup(jDesktopPane3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jDesktopPane3Layout.createSequentialGroup()
.addComponent(jLabel21)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(selectedQuake, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addComponent(codePanelActivtesUpdate, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(121, 121, 121))
.addGroup(jDesktopPane3Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButtonredrawClearSelQuake, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(16, 16, 16)))
.addContainerGap())
);
jDesktopPane3Layout.setVerticalGroup(
jDesktopPane3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jDesktopPane3Layout.createSequentialGroup()
.addGroup(jDesktopPane3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jDesktopPane3Layout.createSequentialGroup()
.addGap(6, 6, 6)
.addGroup(jDesktopPane3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(selectedQuake, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel21, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(codePanelActivtesUpdate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jDesktopPane3Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jButtonredrawClearSelQuake)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(quakeSelector, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jDesktopPane3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jDesktopPane3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(RTC_mag)
.addComponent(RTC_depth)
.addComponent(RTC_distance)
.addComponent(RTC_time))
.addComponent(reverseSearchOrder)
.addComponent(jLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder("Shockwave Calculator"));
jPanel10.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseExited(java.awt.event.MouseEvent evt) {
jPanel10MouseExited(evt);
}
});
jLabel18.setText("[m/s]");
jLabel18.setToolTipText("Noise as measured by the RF-Seismograph");
shockWaveDel.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR));
shockWaveDel.setEditable(false);
shockWaveDel.setMaximumSize(new java.awt.Dimension(55, 19));
shockWaveDel.setText("timeDel");
speedOfQuake.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR));
speedOfQuake.setEditable(false);
speedOfQuake.setMaximumSize(new java.awt.Dimension(87, 19));
speedOfQuake.setText("speedQuake");
jLabel20.setText("[s]");
jLabel20.setToolTipText("Noise as measured by the RF-Seismograph");
runtimeInterval.setToolTipText("select delayed event");
runtimeInterval.addChangeListener(new javax.swing.event.ChangeListener() {
public void stateChanged(javax.swing.event.ChangeEvent evt) {
runtimeIntervalStateChanged(evt);
}
});
runtimeInterval.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseExited(java.awt.event.MouseEvent evt) {
runtimeIntervalMouseExited(evt);
}
});
javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
jPanel10.setLayout(jPanel10Layout);
jPanel10Layout.setHorizontalGroup(
jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel10Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel10Layout.createSequentialGroup()
.addComponent(shockWaveDel, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(4, 4, 4)
.addComponent(jLabel20)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(runtimeInterval, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel10Layout.createSequentialGroup()
.addComponent(speedOfQuake, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel18)
.addGap(0, 0, Short.MAX_VALUE))))
);
jPanel10Layout.setVerticalGroup(
jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel10Layout.createSequentialGroup()
.addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel10Layout.createSequentialGroup()
.addGap(1, 1, 1)
.addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(runtimeInterval, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(shockWaveDel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(speedOfQuake, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
events.setAutoscrolls(true);
events.setMaximumSize(new java.awt.Dimension(800, 800));
events.setMinimumSize(new java.awt.Dimension(400, 800));
events.setPreferredSize(new java.awt.Dimension(800, 800));
events.addChangeListener(new javax.swing.event.ChangeListener() {
public void stateChanged(javax.swing.event.ChangeEvent evt) {
eventsStateChanged(evt);
}
});
events.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseEntered(java.awt.event.MouseEvent evt) {
eventsMouseEntered(evt);
}
});
listEarthquakes.setEditable(false);
listEarthquakes.setColumns(20);
listEarthquakes.setFont(new java.awt.Font("Dialog", 0, 10));
listEarthquakes.setForeground(new java.awt.Color(-13421569,true));
listEarthquakes.setRows(200);
listEarthquakes.setToolTipText("click 2 times to update quakes and to compare");
listEarthquakes.setWrapStyleWord(true);
listEarthquakes.setMaximumSize(new java.awt.Dimension(800, 1000));
listEarthquakes.setMinimumSize(new java.awt.Dimension(500, 700));
listEarthquakes.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
listEarthquakesMouseClicked(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
listEarthquakesMouseExited(evt);
}
});
jScrollPane1.setViewportView(listEarthquakes);
events.addTab("Quakes", jScrollPane1);
AVG.setEditable(false);
AVG.setColumns(20);
AVG.setFont(new java.awt.Font("Dialog", 0, 10));
AVG.setForeground(new java.awt.Color(-13421569,true));
AVG.setLineWrap(true);
AVG.setRows(100);
AVG.setWrapStyleWord(true);
AVG.setMaximumSize(new java.awt.Dimension(800, 1000));
AVG.setMinimumSize(new java.awt.Dimension(500, 700));
jScrollPane5.setViewportView(AVG);
events.addTab("Avg", jScrollPane5);
NW_events.setEditable(false);
NW_events.setColumns(100);
NW_events.setFont(new java.awt.Font("Dialog", 0, 10));
NW_events.setForeground(new java.awt.Color(-13421569,true));
NW_events.setRows(100);
NW_events.setMaximumSize(new java.awt.Dimension(500, 500));
NW_events.setMinimumSize(new java.awt.Dimension(500, 700));
jScrollPane4.setViewportView(NW_events);
events.addTab("NW&Evt", jScrollPane4);
NOAAalertsText.setEditable(false);
NOAAalertsText.setColumns(20);
NOAAalertsText.setForeground(new java.awt.Color(-13421569,true));
NOAAalertsText.setRows(100);
NOAAalertsText.setWrapStyleWord(true);
NOAAalertsText.setMaximumSize(new java.awt.Dimension(500, 700));
NOAAalertsText.setMinimumSize(new java.awt.Dimension(500, 700));
NOAAalertsText.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
NOAAalertsTextMouseClicked(evt);
}
});
jScrollPane8.setViewportView(NOAAalertsText);
events.addTab("NOAA", jScrollPane8);
WSPR.setFont(new java.awt.Font("Dialog", 0, 14));
WSPR.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR));
WSPR.setMaximumSize(new java.awt.Dimension(1200, 400));
WSPR.setMinimumSize(new java.awt.Dimension(600, 400));
WSPR.setPreferredSize(new java.awt.Dimension(800, 400));
WSPR.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
WSPRMouseClicked(evt);
}
public void mouseEntered(java.awt.event.MouseEvent evt) {
WSPRMouseEntered(evt);
}
});
propTrackPane.setViewportView(WSPR);
events.addTab("WSPR", propTrackPane);
rawDataList.setEditable(false);
rawDataList.setColumns(20);
rawDataList.setFont(new java.awt.Font("Dialog", 0, 10));
rawDataList.setForeground(new java.awt.Color(-13421569,true));
rawDataList.setRows(1700);
rawDataList.setToolTipText("click four times to update and exit to redraw");
rawDataList.setAutoscrolls(false);
rawDataList.setMaximumSize(new java.awt.Dimension(800, 430));
rawDataList.setMinimumSize(new java.awt.Dimension(800, 430));
rawDataList.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
rawDataListMouseClicked(evt);
}
public void mouseEntered(java.awt.event.MouseEvent evt) {
rawDataListMouseEntered(evt);
}
});
jScrollPane6.setViewportView(rawDataList);
events.addTab("Raw Data", jScrollPane6);
events.setSelectedIndex(5);
jDesktopPane2.setLayer(jDesktopPane3, javax.swing.JLayeredPane.DEFAULT_LAYER);
jDesktopPane2.setLayer(jPanel10, javax.swing.JLayeredPane.DEFAULT_LAYER);
jDesktopPane2.setLayer(events, javax.swing.JLayeredPane.DEFAULT_LAYER);
javax.swing.GroupLayout jDesktopPane2Layout = new javax.swing.GroupLayout(jDesktopPane2);
jDesktopPane2.setLayout(jDesktopPane2Layout);
jDesktopPane2Layout.setHorizontalGroup(
jDesktopPane2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jDesktopPane2Layout.createSequentialGroup()
.addGap(1, 1, 1)
.addComponent(jDesktopPane3)
.addGap(9, 9, 9)
.addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
.addComponent(events, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
);
jDesktopPane2Layout.setVerticalGroup(
jDesktopPane2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jDesktopPane2Layout.createSequentialGroup()
.addGroup(jDesktopPane2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jDesktopPane3))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(events, javax.swing.GroupLayout.PREFERRED_SIZE, 835, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
javax.swing.GroupLayout TopPanelLayout = new javax.swing.GroupLayout(TopPanel);
TopPanel.setLayout(TopPanelLayout);
TopPanelLayout.setHorizontalGroup(
TopPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(TopPanelLayout.createSequentialGroup()
.addComponent(jTabbedPaneGraphics, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(TopPanelLayout.createSequentialGroup()
.addGap(1, 1, 1)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(1, 1, 1)
.addComponent(jDesktopPane2)
.addGap(1, 1, 1))
);
TopPanelLayout.setVerticalGroup(
TopPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(TopPanelLayout.createSequentialGroup()
.addComponent(jTabbedPaneGraphics, javax.swing.GroupLayout.PREFERRED_SIZE, 528, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(1, 1, 1)
.addGroup(TopPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jDesktopPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jScrollPane2.setViewportView(TopPanel);
jMenuGetWSPR.setText("Get WSPR");
jMenuItemgetWSPR_Item.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_W, 0));
jMenuItemgetWSPR_Item.setText("ShortCut");
jMenuItemgetWSPR_Item.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jMenuItemgetWSPR_ItemMouseClicked(evt);
}
public void mouseEntered(java.awt.event.MouseEvent evt) {
jMenuItemgetWSPR_ItemMouseEntered(evt);
}
});
jMenuItemgetWSPR_Item.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItemgetWSPR_ItemActionPerformed(evt);
}
});
jMenuGetWSPR.add(jMenuItemgetWSPR_Item);
jMenuBar2.add(jMenuGetWSPR);
jMenuRemData.setText("Get RemData");
jMenuRemData.addMenuKeyListener(new javax.swing.event.MenuKeyListener() {
public void menuKeyPressed(javax.swing.event.MenuKeyEvent evt) {
jMenuRemDataMenuKeyPressed(evt);
}
public void menuKeyReleased(javax.swing.event.MenuKeyEvent evt) {
}
public void menuKeyTyped(javax.swing.event.MenuKeyEvent evt) {
}
});
jMenuRemDataItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_D, 0));
jMenuRemDataItem.setText("ShortCut");
jMenuRemDataItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuRemDataItemActionPerformed(evt);
}
});
jMenuRemData.add(jMenuRemDataItem);
jMenuBar2.add(jMenuRemData);
jMenuGetQuakes.setText("Get M2.5 Quakes");
jMenuGetQuakesItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Q, 0));
jMenuGetQuakesItem.setText("ShortCut");
jMenuGetQuakesItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuGetQuakesItemActionPerformed(evt);
}
});
jMenuGetQuakes.add(jMenuGetQuakesItem);
jMenuBar2.add(jMenuGetQuakes);
jMenuCompare.setText("Compare");
jMenuCompareItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, 0));
jMenuCompareItem.setText("ShortCut");
jMenuCompareItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuCompareItemActionPerformed(evt);
}
});
jMenuCompare.add(jMenuCompareItem);
jMenuBar2.add(jMenuCompare);
jMenuReDraw.setText("ReDraw");
jMenuReDraw.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
jMenuReDrawKeyTyped(evt);
}
});
jMenuReDrawItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R, 0));
jMenuReDrawItem.setText("ShortCut");
jMenuReDrawItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuReDrawItemActionPerformed(evt);
}
});
jMenuReDraw.add(jMenuReDrawItem);
jMenuBar2.add(jMenuReDraw);
jMenuGetNOAA.setText("NOAA");
jMenuItem2.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, 0));
jMenuItem2.setText("shortCut");
jMenuGetNOAA.add(jMenuItem2);
jMenuBar2.add(jMenuGetNOAA);
setJMenuBar(jMenuBar2);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 1106, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 963, javax.swing.GroupLayout.PREFERRED_SIZE))
);
pack();
}// //GEN-END:initComponents
private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
saveUserParameters();
}//GEN-LAST:event_formWindowClosing
private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
//loadUserParameters();
}//GEN-LAST:event_formWindowOpened
private void formWindowGainedFocus(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowGainedFocus
// TODO add your handling code here:
}//GEN-LAST:event_formWindowGainedFocus
private void jTabbedPaneGraphicsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTabbedPaneGraphicsMouseClicked
int maxTabPos = 1;
//if(LongTimeAverageCal.isEnabled() == false)
if(LTAdisplaySSI_CH1[3] != 0)
maxTabPos = 2;
redrawImage = true;
//JOptionPane.showMessageDialog(null, "set redrawImage in to " + redrawImage);
//redrawGraphics();
//jButtonredrawGrafics.requestFocus();
//jTabbedPaneGraphics.requestFocus(); //tab through selections
//JOptionPane.showMessageDialog(null,"test");
drawOnce = true;//reset drawing mode
tabPos = jTabbedPaneGraphics.getSelectedIndex();
tabPos = tabPos + 1;
if (tabPos > maxTabPos)
tabPos = 0;
jTabbedPaneGraphics.setSelectedIndex(tabPos);
if ( tabPos == 0) //0 = graph, 1 = map, 2 = AVG
//redrawGraphics();
if ( tabPos == 1) //0 = graph, 1 = map, 2 = AVG
{
if(LongTimeAverageCal.isSelected() == true)
drawOnce = (false);
else
drawOnce = (true);
displayQuakes(); // in textBox
//redrawGraphics();
}
if ( tabPos == 2) //0 = graph, 1 = map, 2 = AVG
{
//if(LongTimeAverageCal.isEnabled()==(false))
{
tabPos = 2;
//loadDataHighForDisp();
propagationViewerLTA();
}
//else
{
//JOptionPane.showMessageDialog(null, "no LTA calulated - go to Archive and press LTA"); //diable for archive
tabPos = 0;
}
}
try {
Thread.sleep(200);//delayTimeProp -200
} catch (InterruptedException ex) {
Logger.getLogger(SeismoViewer.class.getName()).log(Level.SEVERE, null, ex);
}
//System.out.println ("Checking " +tabPos +" "+ LTAdisplaySSI_CH1[3]);
//redrawGraphics();
}//GEN-LAST:event_jTabbedPaneGraphicsMouseClicked
private void jTabbedPaneGraphicsStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jTabbedPaneGraphicsStateChanged
if(CheckBoxArchive.isSelected() == true)
{
if ((jTabbedPaneGraphics.getSelectedIndex()) == 1 ) //0 = graph, 1 = map 2 = avg
{
drawOnce = true;
//datePlotMapCenter.setText(datePlotMapCenter.getText());//refresh
}
}
//if ((jTabbedPaneGraphics.getSelectedIndex()) == 0 ) //0 = graph, 1 = map 2 = avg
//redrawGraphics(); //cant do this here without if
}//GEN-LAST:event_jTabbedPaneGraphicsStateChanged
private void TotalEnergyAVGperDayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TotalEnergyAVGperDayActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_TotalEnergyAVGperDayActionPerformed
private void elevationLTAFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_elevationLTAFocusLost
// TODO add your handling code here:
}//GEN-LAST:event_elevationLTAFocusLost
private void callSignLTAActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_callSignLTAActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_callSignLTAActionPerformed
private void datePlotMatPreActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_datePlotMatPreActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_datePlotMatPreActionPerformed
private void datePlotMapCenterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_datePlotMapCenterActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_datePlotMapCenterActionPerformed
private void TotalEnergyMapActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TotalEnergyMapActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_TotalEnergyMapActionPerformed
private void datePlotMatPostActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_datePlotMatPostActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_datePlotMatPostActionPerformed
private void TotalEnergyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TotalEnergyActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_TotalEnergyActionPerformed
private void elevationFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_elevationFocusLost
//saveUserParameters();
}//GEN-LAST:event_elevationFocusLost
private void startRFSActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_startRFSActionPerformed
clearRemData();
//new SA_Display().setVisible(true);
//new SA_Display().setTitle("RF-Seismograph & Linux Spectrum Analyzer V J1.7 (MDSR) by VE7DXW");
// String[] args = new String[] {"flrig"};
// try {
// Process proc = new ProcessBuilder(args).start();
// } catch (IOException ex) {
// Logger.getLogger(SA_Display.class.getName()).log(Level.SEVERE, null, ex);
// }
}//GEN-LAST:event_startRFSActionPerformed
private void loadNOAAActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loadNOAAActionPerformed
downloadNOAA_Message();
//quakeSummery();
//jComboBoxDataFileSelect.addItem("dailyBackup.csv");
//jComboBoxDataFileSelect.setSelectedItem("dailyBackup.csv");
//clearEarthquakeData();
//loadDataHighForDisp();
//sortCombobox();
//clearAVG_Data();
}//GEN-LAST:event_loadNOAAActionPerformed
private void jButtonClearAllActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonClearAllActionPerformed
//clear all
listEarthquakes.setText("");
AVG.setText("");
NW_events.setText("");
}//GEN-LAST:event_jButtonClearAllActionPerformed
private void jButtonClearSelectedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonClearSelectedActionPerformed
//clear higithed
//System.out.println("Pressed: " + events.getSelectedIndex()); //0 quakes,1 AVG, 2 events&NW,3 NoAA , 4 WSPR
if(events.getSelectedIndex() == 0)
listEarthquakes.setText("");
if(events.getSelectedIndex() == 1)
AVG.setText("");
if(events.getSelectedIndex() == 2)
NW_events.setText("");
if(events.getSelectedIndex() == 3)
{
NOAAalertsText.setText("");
try {
Files.deleteIfExists(Paths.get(System.getProperty("user.home") +("/MDSR_SA/NOAA_Alert.htm")));
} catch (IOException ex) {
Logger.getLogger(SeismoViewer.class.getName()).log(Level.SEVERE, null, ex);
}
}
if(events.getSelectedIndex() == 4)
{
clearWSPR_Data();
//worldMap.repaint();
jTabbedPaneGraphics.setSelectedIndex(1); //map
//propagationMap();
WSPR.setText("");
events.setSelectedIndex(4); //WSPR pane
getWSPRpropagationData();
}
if(events.getSelectedIndex() == 5)
rawDataList.setText("");
}//GEN-LAST:event_jButtonClearSelectedActionPerformed
private void CheckBoxoldDataModeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CheckBoxoldDataModeActionPerformed
jButtonOpenRemoteData.setSelected(false);
jComboBoxDataFileSelect.removeAllItems();
jComboBoxEqkData.removeAllItems();
jComboBoxEqkData.addItem("File N/A");
jComboBoxEqkData.addItem("File not found");
jComboBoxEqkData.setSelectedItem("File N/A");
if(LongTimeAverageCal.hasFocus()==(false)) //only delete if not AVG
listEarthquakes.setText(""); //clear earthquake list
if(CheckBoxoldDataMode.isSelected() == true)
{
//jButtonOpenGetArchivedData.setEnabled (true);
jButtonLoadUSGS_data.setEnabled(false);
jButtonOpenRemoteData.setEnabled(false);
jButtonMatchQuakesNoise.setEnabled (true);
}
else
{
jButtonLoadUSGS_data.setEnabled(true);
jButtonOpenRemoteData.setEnabled(true);
jButtonOpenGetArchivedData.setEnabled (false);
}
}//GEN-LAST:event_CheckBoxoldDataModeActionPerformed
private void jButtonCheckNWActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCheckNWActionPerformed
if(CheckBoxoldDataMode.isSelected() == true)
{
getRemoteFilePerDate();
}
else
netSpeed();
//saveUserParameters();
//readEarthquakeFiles();
}//GEN-LAST:event_jButtonCheckNWActionPerformed
private void eventsMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_eventsMouseEntered
try {
//deleteFile NOAA_Alert
Files.deleteIfExists(Paths.get(System.getProperty("user.home") +("/MDSR_SA/NOAA_Alert.htm")));
} catch (IOException ex) {
Logger.getLogger(SeismoViewer.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_eventsMouseEntered
private void eventsStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_eventsStateChanged
if(events.getSelectedIndex() == 3)
{
downloadNOAA_Message(); //loads automaically
}
dailyEnergyFromArrayAndDisplay();
}//GEN-LAST:event_eventsStateChanged
private void jButtonClearDataActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonClearDataActionPerformed
clearDatatable();
totalEng = 0;
propagationViewer.repaint();
clearEarthquakeData();
listEarthquakes.setText(""); //clear earthquake list
//displayQuakes();
//jButtonMatchQuakesNoise.setEnabled (false);
if(LTAdisplaySSI_CH1[3] != 0)
{
clearLTAData();
LongTimeAverageCal.setEnabled(true);
}
//fileSelectAction();
}//GEN-LAST:event_jButtonClearDataActionPerformed
private void WSPRMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_WSPRMouseClicked
MutableAttributeSet attrs = WSPR.getInputAttributes();
StyledDocument doc = WSPR.getStyledDocument();
if(WSPR.getText().equals(""))
{
JOptionPane.showMessageDialog(null,"Load WSPR first...");
}
else
{
//JOptionPane.showMessageDialog(null,"WSPR contains " + WSPR.getText());
readWSPR_Files();
DisplayWSPR_data();
//DisplayWSPR_data(); //fixes dispaly issue NOT
setCursor(Cursor.DEFAULT_CURSOR);
events.setSelectedIndex(4); //WSPR pane
redrawGraphics();
}
}//GEN-LAST:event_WSPRMouseClicked
private void jButtonDeleteUserActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonDeleteUserActionPerformed
try {
Files.deleteIfExists(Paths.get(System.getProperty("user.home") +("/MDSR_SA/RFV_User.cfg")));
} catch (IOException ex) {
Logger.getLogger(SeismoViewer.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jButtonDeleteUserActionPerformed
private void CheckBoxShowLTAActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CheckBoxShowLTAActionPerformed
jTabbedPaneGraphics.setSelectedIndex(2); //AVG
}//GEN-LAST:event_CheckBoxShowLTAActionPerformed
private void CheckBoxShowLTAMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_CheckBoxShowLTAMouseExited
if(LTAdisplaySSI_CH1[3] != 0)
{
redrawGraphics();
}
}//GEN-LAST:event_CheckBoxShowLTAMouseExited
private void LongTimeAverageCalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_LongTimeAverageCalActionPerformed
clearLTAData();
jTabbedPaneGraphics.setSelectedIndex(1); //view earthquake events
if(LTAdisplaySSI_CH1[3] != 0)
drawOnce = true;
else
drawOnce = false;//reset drawing mode
totalEng = 0; //start from scatch
if(LTAdisplaySSI_CH1[0] == 0) //prevent running again if data is already loaded
getLTA();
//else
//propagationViewerLTA();
LongTimeAverageCal.setEnabled(false);
dailyEnergyFromArrayAndDisplay(); //display in pane
//propagationViewerLTA();
}//GEN-LAST:event_LongTimeAverageCalActionPerformed
private void LongTimeAverageCalMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_LongTimeAverageCalMouseEntered
//if(LongTimeAverageCal.isEnabled() == true)
//clearLTAData();
//select day -50 for LTA calulation
// if(CheckBoxArchive.isSelected() == true)
// jComboBoxDataFileSelect.setSelectedIndex(jComboBoxDataFileSelect.getItemCount() - totalFilesForAvr ); //start condition
//fileSelectAction();
// cnt = 0; //reset count
}//GEN-LAST:event_LongTimeAverageCalMouseEntered
private void callSignDatatoDisplayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_callSignDatatoDisplayActionPerformed
ClearData();
jButtonredrawGrafics.setEnabled(false);
redrawGraphics();
}//GEN-LAST:event_callSignDatatoDisplayActionPerformed
private void jButtonOpenGetArchivedDataActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonOpenGetArchivedDataActionPerformed
events.setSelectedIndex(2);
setCursor(Cursor.WAIT_CURSOR);
getRemoteArchive();
UnzipFiles();
setCursor(Cursor.DEFAULT_CURSOR);
}//GEN-LAST:event_jButtonOpenGetArchivedDataActionPerformed
private void CheckBoxArchiveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CheckBoxArchiveActionPerformed
//clearAVG_Data();
totalEngAVGArr[0] = "test"; //to aviod outOfB
LongTimeAverageCal.setEnabled(true);
//fileSelectAction(); not needed
try {
Thread.sleep(500);//delayTimeProp -2000
} catch (InterruptedException ex) {
Logger.getLogger(SeismoViewer.class.getName()).log(Level.SEVERE, null, ex);
}
CheckBoxoldDataMode.setSelected(false);
jComboBoxDataFileSelect.removeAllItems();
jComboBoxEqkData.removeAllItems();
jComboBoxEqkData.addItem("File N/A");
jComboBoxEqkData.addItem("File not found");
jComboBoxEqkData.setSelectedItem("File N/A");
//)==(false)) //only delete if not AVG
listEarthquakes.setText(""); //clear earthquake list
if(CheckBoxArchive.isSelected() == true)
{
shift = 0; //return to 0 to 24 h display
readSavedDataFiles();
callSignDatatoDisplay.setEnabled (false);
jButtonOpenGetArchivedData.setEnabled (true);
jButtonLoadUSGS_data.setEnabled(false);
jButtonOpenRemoteData.setEnabled(false);
jButtonMatchQuakesNoise.setEnabled (true);
//get LTA if empty
jTabbedPaneGraphics.setSelectedIndex(1); //view earthquake events
//if(LTAdisplaySSI_CH1[0] == 0) //prevent running again if data is already loaded
//getLTA();
drawOnce = true;//reset drawing mode
}
else
{
jComboBoxDataFileSelect.removeAllItems();
callSignDatatoDisplay.setEnabled (true);
jComboBoxDataFileSelect.addItem("dailyBackup"+ readDataInstance +".csv");
jComboBoxDataFileSelect.setSelectedItem("dailyBackup"+ readDataInstance +".csv");
//readSavedDataFiles();
jButtonLoadUSGS_data.setEnabled(true);
jButtonOpenRemoteData.setEnabled(true);
jButtonOpenGetArchivedData.setEnabled (false);
//redrawGraphics();
drawOnce = false;//reset drawing mode
LongTimeAverageCal.setEnabled (false);
}
//var length = select.options.length;
//for (i = length-1; i >= 0; i--) {
//select.options[i] = null;
//}
fileSelectAction();
sortCombobox();
}//GEN-LAST:event_CheckBoxArchiveActionPerformed
private void CheckBoxArchiveMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_CheckBoxArchiveMouseExited
if(CheckBoxArchive.isSelected() == false)
if(jButtonLoadUSGS_data.isEnabled() == true)
{
readDataInstance = readDataInstance - 1; //strange needs to be inverstigated
//JOptionPane.showMessageDialog(null,"dailyBackup.csv to be renamed" + readDataInstance);
jComboBoxDataFileSelect.addItem("dailyBackup"+ readDataInstance +".csv");
jComboBoxDataFileSelect.setSelectedItem("dailyBackup"+ readDataInstance +".csv");
}
}//GEN-LAST:event_CheckBoxArchiveMouseExited
private void jPanel7MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel7MouseExited
redrawGraphics();
}//GEN-LAST:event_jPanel7MouseExited
private void EarthQuakes_viewerOffsetYaxesStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_EarthQuakes_viewerOffsetYaxesStateChanged
if ((jTabbedPaneGraphics.getSelectedIndex()) == 0 ) //0 = graph, 1 = map, 2 = AVG
{
amplification = 4;
Y_qu_offset = (Integer.parseInt(String.valueOf(EarthQuakes_viewerOffsetYaxes.getValue())));
readSavedDataFiles();
//propagationViewer();
listEarthquakes.setText(""); //clear earthquake list
displayQuakes();
}
//if ((jTabbedPaneGraphics.getSelectedIndex()) == 2 ) //0 = graph, 1 = map, 2 = AVG
//propagationViewerLTA();
loadUserParameters();
}//GEN-LAST:event_EarthQuakes_viewerOffsetYaxesStateChanged
private void RF_ViewerOffsetYaxesStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_RF_ViewerOffsetYaxesStateChanged
if ((jTabbedPaneGraphics.getSelectedIndex()) == 0 ) //0 = graph, 1 = map, 2 = AVG
{
amplification = 4;
Y_offset = (Integer.parseInt(String.valueOf(RF_ViewerOffsetYaxes.getValue())) - 20);
Y_offsetLTA = (Integer.parseInt(String.valueOf(RF_ViewerOffsetYaxes.getValue())) - 20);
readSavedDataFiles();
//propagationViewer();
listEarthquakes.setText(""); //clear earthquake list
displayQuakes();
}
//if ((jTabbedPaneGraphics.getSelectedIndex()) == 2 ) //0 = graph, 1 = map, 2 = AVG
//propagationViewerLTA();
loadUserParameters();
}//GEN-LAST:event_RF_ViewerOffsetYaxesStateChanged
private void jButtonUploadQuakesLstActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonUploadQuakesLstActionPerformed
quakesToFile();
NW_events.append("Quake data has been saved for upload" + "\n");
upLoadFiles();
}//GEN-LAST:event_jButtonUploadQuakesLstActionPerformed
private void jButtonLoadWSPR_dataMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonLoadWSPR_dataMouseEntered
clearWSPR_Data();
//worldMap.repaint();
jTabbedPaneGraphics.setSelectedIndex(1); //map
//propagationMap();
WSPR.setText("");
events.setSelectedIndex(4); //WSPR pane
getWSPRpropagationData();
//redrawGraphics();
}//GEN-LAST:event_jButtonLoadWSPR_dataMouseEntered
private void jButtonLoadWSPR_dataMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonLoadWSPR_dataMouseClicked
readWSPR_Files();
DisplayWSPR_data();
//DisplayWSPR_data(); //fixes dispaly issue NOT
setCursor(Cursor.DEFAULT_CURSOR);
redrawGraphics();
}//GEN-LAST:event_jButtonLoadWSPR_dataMouseClicked
private void jButtonOpenRemoteDataActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonOpenRemoteDataActionPerformed
jButtonLoadUSGS_data.setEnabled(true);
//ClearData();
//clearDatatable(); //causes error
amplification = 4;
//clearEarthquakeData(); //remove old earthquake matches
try {
Thread.sleep(100);//delayTimeProp -2000
} catch (InterruptedException ex) {
Logger.getLogger(SeismoViewer.class.getName()).log(Level.SEVERE, null, ex);
}
jButtonredrawGrafics.setEnabled(true);
CheckBoxArchive.setEnabled (true); //enable for achive
jLabel13.setEnabled (true); //enable for achive
try {
Thread.sleep(100);//delayTimeProp -2000
} catch (InterruptedException ex) {
Logger.getLogger(SeismoViewer.class.getName()).log(Level.SEVERE, null, ex);
}
getRemoteData();
try {
Thread.sleep(100);//delayTimeProp -2000
} catch (InterruptedException ex) {
Logger.getLogger(SeismoViewer.class.getName()).log(Level.SEVERE, null, ex);
}
//System.out.println ("LTA empty" + LTAdisplaySSI_CH1[1]);
if(LTAdisplaySSI_CH1[1] != 0)
propagationViewerMatchLTAwithCurrent();
events.setSelectedIndex(5);
jTabbedPaneGraphics.setSelectedIndex(0);
redrawGraphics();
//loadDataHighForDisp();
//propagationViewer();
//System.out.println("List starts with TButton: " + rawDataList.getLineCount());
}//GEN-LAST:event_jButtonOpenRemoteDataActionPerformed
private void jButtonOpenRemoteDataMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonOpenRemoteDataMouseEntered
if(jButtonMatchQuakesNoise.isEnabled() == (false))
{
rawDataList.setText("");
clearEarthquakeData(); //remove old earthquake matches
}
//jButtonMatchQuakesNoise.setEnabled(true);
try {
Thread.sleep(100);//delayTimeProp -2000
} catch (InterruptedException ex) {
Logger.getLogger(SeismoViewer.class.getName()).log(Level.SEVERE, null, ex);
}
if(CheckBoxArchive.isSelected() == false)
if(jComboBoxDataFileSelect.getSelectedItem() == "Files")
{
jComboBoxDataFileSelect.addItem("dailyBackup"+ readDataInstance +".csv");
jComboBoxDataFileSelect.setSelectedItem("dailyBackup"+ readDataInstance +".csv");
}
if(jButtonOpenRemoteData.isEnabled() == (true))
{
events.setSelectedIndex(5);
jTabbedPaneGraphics.setSelectedIndex(0);
}
}//GEN-LAST:event_jButtonOpenRemoteDataMouseEntered
private void jButtonOpenRemoteDataMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonOpenRemoteDataMouseExited
}//GEN-LAST:event_jButtonOpenRemoteDataMouseExited
private void jButtonLoadUSGS_dataActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonLoadUSGS_dataActionPerformed
jButtonLoadUSGS_data.setEnabled(false);
jTabbedPaneGraphics.setSelectedIndex(1); //set to mao screen
events.setSelectedIndex(0); //set to quakes list
setCursor(Cursor.WAIT_CURSOR);
listEarthquakes.setText(""); //clear earthquake list
//clearEarthquakeData(); //remove old earthquake matches
if(CheckBoxArchive.isSelected() == false) //do not run in archive mode
{
amplification = 1;
getRemoteEarthQuakeData(); //from USGS Server
readEarthquakeUSGSEvent();
drawOnce = false;//reset drawing mode
//if ((jTabbedPaneGraphics.getSelectedIndex()) == 0 ) //0 = graph, 1 = map
//propagationViewer();
//else
//loadUserParameters();
}
//JOptionPane.showMessageDialog(null,"test");
//saveImage();
jButtonMatchQuakesNoise.setEnabled (true);
try {
Thread.sleep(100);//delayTimeProp -2000
} catch (InterruptedException ex) {
Logger.getLogger(SeismoViewer.class.getName()).log(Level.SEVERE, null, ex);
}
displayQuakes();
redrawGraphics();
}//GEN-LAST:event_jButtonLoadUSGS_dataActionPerformed
private void jButtonLoadUSGS_dataMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonLoadUSGS_dataMouseEntered
if(jButtonLoadUSGS_data.isEnabled() == (true))
{
clearEarthquakeData(); //not here
listEarthquakes.setText(""); //clear field before
}
drawOnce = false;
if(jButtonLoadUSGS_data.isEnabled() == (true))
{
jTabbedPaneGraphics.setSelectedIndex(1);
}
}//GEN-LAST:event_jButtonLoadUSGS_dataMouseEntered
private void jButtonMatchQuakesNoiseMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonMatchQuakesNoiseMouseEntered
if(jButtonMatchQuakesNoise.isEnabled() == (true))
{
listEarthquakes.setText(""); //clear earthquake list
displayQuakes();
}
if(CheckBoxArchive.isSelected() == true)
{
jTabbedPaneGraphics.setSelectedIndex(0);
redrawGraphics();
}
}//GEN-LAST:event_jButtonMatchQuakesNoiseMouseEntered
private void jButtonMatchQuakesNoiseMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonMatchQuakesNoiseMouseExited
if(jButtonMatchQuakesNoise.isEnabled() == true)
{
//events.setSelectedIndex(0);
jTabbedPaneGraphics.setSelectedIndex(0);
redrawGraphics();
//jButtonMatchQuakesNoise.setEnabled (false);
if(listEarthquakes.getText() != "")
events.setSelectedIndex(0);
//redrawGraphics();
}
}//GEN-LAST:event_jButtonMatchQuakesNoiseMouseExited
private void jButtonMatchQuakesNoiseMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonMatchQuakesNoiseMouseClicked
jTabbedPaneGraphics.setSelectedIndex(0); //0 = graph, 1 = map
amplification = 4;
totalEng = 0;
//clearEarthquakeData();
matchQuakesAndNoise();
//if ((jTabbedPaneGraphics.getSelectedIndex()) == 0 ) //0 = graph, 1 = map
//propagationViewer();
//else
//propagationMap();
//if(LongTimeAverageCal.hasFocus()==(false)) //only delete if not AVG
//listEarthquakes.setText(""); //clear earthquake list
listEarthquakes.setText(""); //clear earthquake list
displayQuakes();
//jButtonMatchQuakesNoise.setEnabled (false);
setCursor(Cursor.DEFAULT_CURSOR);
try {
Thread.sleep(100);//delayTimeProp -2000
} catch (InterruptedException ex) {
Logger.getLogger(SeismoViewer.class.getName()).log(Level.SEVERE, null, ex);
}
//events.setSelectedIndex(0);
jTabbedPaneGraphics.setSelectedIndex(0);
//redrawGraphics();
}//GEN-LAST:event_jButtonMatchQuakesNoiseMouseClicked
private void jButtonPrintSeceenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonPrintSeceenActionPerformed
if ((jTabbedPaneGraphics.getSelectedIndex()) == 0 ) //0 = graph, 1 = map
{
}
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
TotalEnergy.setText(" Total E.: "+ (String.format ("%.2f",(totalEng)))+" GJ");
TotalEnergyMap.setText(" Total E.: "+ (String.format ("%.2f",(totalEng)))+" GJ");
amplification = 1;
//propagationViewer();
displayQuakes();
saveImage();
NW_events.append("Image has been saved!" + "\n");
}//GEN-LAST:event_jButtonPrintSeceenActionPerformed
private void jButtonPrintSeceenMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonPrintSeceenMouseEntered
//redrawGraphics();
}//GEN-LAST:event_jButtonPrintSeceenMouseEntered
private void jComboBoxDataFileSelectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxDataFileSelectActionPerformed
String currentFileSel;
clearEarthquakeData(); //remove old earthquake matches
listEarthquakes.setText("");
jTabbedPaneGraphics.setSelectedIndex(1);
events.setSelectedIndex(0);
//listEarthquakes.setText("");
if(jComboBoxDataFileSelect.getSelectedItem()== null)
fileSelectAction();
//match selected file with earthqaue file
if(CheckBoxArchive.isSelected()== true)
{
if(jComboBoxDataFileSelect.getSelectedItem()!= null) //prevent out of bounds
{
currentFileSel = String.valueOf(jComboBoxDataFileSelect.getSelectedItem()).substring(6,14);
//System.out.println (currentFileSel);
for (int x=0; x maxTabPos)
tabPos = 0;
jTabbedPaneGraphics.setSelectedIndex(tabPos);
if ( tabPos == 0) //0 = graph, 1 = map, 2 = AVG
//redrawGraphics();
if ( tabPos == 1) //0 = graph, 1 = map, 2 = AVG
{
if(LongTimeAverageCal.isSelected() == true)
drawOnce = (false);
else
drawOnce = (true);
displayQuakes(); // in textBox
//redrawGraphics();
}
if ( tabPos == 2) //0 = graph, 1 = map, 2 = AVG
{
//if(LongTimeAverageCal.isEnabled()==(false))
{
tabPos = 2;
//loadDataHighForDisp();
propagationViewerLTA();
}
//else
{
//JOptionPane.showMessageDialog(null, "no LTA calulated - go to Archive and press LTA"); //diable for archive
tabPos = 0;
}
}
//loadUserParameters();
//redrawGraphics();
}//GEN-LAST:event_jButtonredrawGraficsActionPerformed
private void jButtonredrawGraficsMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonredrawGraficsMouseEntered
drawOnce = true;
}//GEN-LAST:event_jButtonredrawGraficsMouseEntered
private void jButtonredrawGraficsMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonredrawGraficsMouseExited
//readEarthquakeUSGSEvent();
//if(jButtonredrawGrafics.isEnabled() == true)
{
drawOnce = (false);
listEarthquakes.setText(""); //clear earthquake list
displayQuakes();
//redrawGraphics();
}
if(redrawImage == true)
{
redrawGraphics();
//JOptionPane.showMessageDialog(null, "set redrawImage to false Line2726 ButtonExited");
redrawImage = false;
//System.out.println("state of button: " + redrawImage );
}
if(listEarthquakes.getText() != "")
events.setSelectedIndex(0);
}//GEN-LAST:event_jButtonredrawGraficsMouseExited
private void jPanel2MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel2MouseEntered
//listEarthquakes.setText(""); //clear earthquake list
}//GEN-LAST:event_jPanel2MouseEntered
private void jPanel2MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel2MouseExited
if(preventRedraw == false)
{
events.setSelectedIndex(0); //quake event
jTabbedPaneGraphics.setSelectedIndex(0); //0 = graph, 1 = map
redrawGraphics();
events.setSelectedIndex(0);
displayQuakes();
preventRedraw = true;
}
}//GEN-LAST:event_jPanel2MouseExited
private void tagTextThreshActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tagTextThreshActionPerformed
preventRedraw = false;
//amplification = 1;
propagationViewer(); //refresh after change
TotalEnergy.setText(" Total E.: "+ (String.format ("%.2f",(totalEng)))+" GJ");
TotalEnergyMap.setText(" Total E.: "+ (String.format ("%.2f",(totalEng)))+" GJ");
//redrawGraphics();
}//GEN-LAST:event_tagTextThreshActionPerformed
private void listThreshActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_listThreshActionPerformed
preventRedraw = false;
//if (listEarthquakes.getText().equals("")) //do not run this code without quakes
{
//JOptionPane.showMessageDialog(null,"Load quakes first");
}
//else
{
listEarthquakes.setText(""); //clear earthquake list
//clearEarthquakeData(); //remove old earthquake matches
//getRemoteFile(); //from USGS Server
readEarthquakeUSGSEvent();
displayQuakes();
TotalEnergy.setText(" Total E.: "+ (String.format ("%.2f",(totalEng)))+" GJ");
TotalEnergyMap.setText(" Total E.: "+ (String.format ("%.2f",(totalEng)))+" GJ");
//propagationViewer.repaint();
//redrawGraphics();
}
}//GEN-LAST:event_listThreshActionPerformed
private void listThreshMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_listThreshMouseEntered
//jTabbedPaneGraphics.setSelectedIndex(1);
//events.setSelectedIndex(0);
//if(LongTimeAverageCal.hasFocus()==(false)) //only delete if not AVG
{
listEarthquakes.setText(""); //clear earthquake list to avoid double lists
//displayQuakes();
}
}//GEN-LAST:event_listThreshMouseEntered
private void tagMagThreshActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tagMagThreshActionPerformed
preventRedraw = false;
//amplification = 1;
propagationViewer(); //refresh after change
TotalEnergy.setText(" Total E.: "+ (String.format ("%.2f",(totalEng)))+" GJ");
TotalEnergyMap.setText(" Total E.: "+ (String.format ("%.2f",(totalEng)))+" GJ");
//redrawGraphics();
}//GEN-LAST:event_tagMagThreshActionPerformed
private void jComboBoxEqkDataActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxEqkDataActionPerformed
jButtonMatchQuakesNoise.setEnabled (true);
varDir ="/MDSR_SA/";
//final String varType =".csv";
if(CheckBoxArchive.isSelected() == true)
{
String[] var = null;
varDir ="/MDSR_SA/archivedData/";
readEarthquakeUSGSEvent();
displayQuakes();
}
File dir = new File(System.getProperty("user.home") + varDir);
FilenameFilter filter;
filter = new FilenameFilter()
{
@Override
public boolean accept(File dir, String name)
{
return name.endsWith(".csv");
}
};
String[] var = dir.list(filter);
if (var == null)
{
JOptionPane.showMessageDialog(null,"Directory is INCORRECT or does not exist"
+ "");
}
else
{ //if (jComboBoxEqkData.getItemCount() < 1)
//System.out.println(jComboBoxEqkData.getItemCount());
{
for (String filename : var) {
if (jComboBoxEqkData.getItemCount() <= var.length)
{
jComboBoxEqkData.addItem(filename);
}
} //populate the combo
}}
TotalEnergy.setText(" Total E.: "+ (String.format ("%.2f",(totalEng)))+" GJ");
TotalEnergyMap.setText(" Total E.: "+ (String.format ("%.2f",(totalEng)))+" GJ");
//redrawGraphics();
displayQuakes();
}//GEN-LAST:event_jComboBoxEqkDataActionPerformed
private void jComboBoxEqkDataMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jComboBoxEqkDataMouseEntered
varDir ="/MDSR_SA/";
//final String varType =".csv";
if(CheckBoxArchive.isSelected() == true)
{
String[] var = null;
varDir ="/MDSR_SA/archivedData/";
}
File dir = new File(System.getProperty("user.home") + varDir);
FilenameFilter filter = new FilenameFilter()
{
@Override
public boolean accept(File dir, String name)
{
return name.endsWith(".csv");
}
};
String[] var = dir.list(filter);
if (var == null)
{
JOptionPane.showMessageDialog(null,"JCOMBO BOX Directory is INCORRECT or does not exist"
+ "");
}
else
{ //if (jComboBoxEqkData.getItemCount() < 1)
//System.out.println(jComboBoxEqkData.getItemCount());
{
for (int x=0; x 1)
{
try {
Thread.sleep(200);//delayTime 100
} catch (InterruptedException ex) {
Logger.getLogger(SeismoViewer.class.getName()).log(Level.SEVERE, null, ex);
}
redrawGraphics();
//println("List starts with T: " + rawDataList.getLineCount());
events.setSelectedIndex(0); //switches to quake pane one data has been downloaded
}
else
{
rawDataList.setText("");
//println("ListisEmpty: " + rawDataList.getLineCount());
jButtonLoadUSGS_data.setEnabled(true);
//ClearData();
//clearDatatable(); //causes error
amplification = 4;
//clearEarthquakeData(); //remove old earthquake matches
try {
Thread.sleep(100);//delayTimeProp -2000
} catch (InterruptedException ex) {
Logger.getLogger(SeismoViewer.class.getName()).log(Level.SEVERE, null, ex);
}
jButtonredrawGrafics.setEnabled(true);
CheckBoxArchive.setEnabled (true); //enable for achive
jLabel13.setEnabled (true); //enable for achive
try {
Thread.sleep(100);//delayTimeProp -2000
} catch (InterruptedException ex) {
Logger.getLogger(SeismoViewer.class.getName()).log(Level.SEVERE, null, ex);
}
getRemoteData();
try {
Thread.sleep(100);//delayTimeProp -2000
} catch (InterruptedException ex) {
Logger.getLogger(SeismoViewer.class.getName()).log(Level.SEVERE, null, ex);
}
//System.out.println ("LTA empty" + LTAdisplaySSI_CH1[1]);
if(LTAdisplaySSI_CH1[1] != 0)
propagationViewerMatchLTAwithCurrent();
events.setSelectedIndex(5);
jTabbedPaneGraphics.setSelectedIndex(0);
redrawGraphics();
//loadDataHighForDisp();
//propagationViewer();
//System.out.println("ListisEmpty: " + rawDataList.getText());
}
}//GEN-LAST:event_rawDataListMouseClicked
private void jMenuItemgetWSPR_ItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemgetWSPR_ItemActionPerformed
MutableAttributeSet attrs = WSPR.getInputAttributes();
StyledDocument doc = WSPR.getStyledDocument();
if(WSPR.getText().equals(""))
{
//JOptionPane.showMessageDialog(null,"Load WSPR first...");
clearWSPR_Data();
//worldMap.repaint();
jTabbedPaneGraphics.setSelectedIndex(1); //map
//propagationMap();
WSPR.setText("");
events.setSelectedIndex(4); //WSPR pane
getWSPRpropagationData();
//redrawGraphics();
}
else
{
//JOptionPane.showMessageDialog(null,"WSPR contains " + WSPR.getText());
readWSPR_Files();
DisplayWSPR_data();
//DisplayWSPR_data(); //fixes dispaly issue NOT
setCursor(Cursor.DEFAULT_CURSOR);
events.setSelectedIndex(4); //WSPR pane
redrawGraphics();
}
}//GEN-LAST:event_jMenuItemgetWSPR_ItemActionPerformed
private void NOAAalertsTextMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_NOAAalertsTextMouseClicked
downloadNOAA_Message();
}//GEN-LAST:event_NOAAalertsTextMouseClicked
private void listEarthquakesMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_listEarthquakesMouseExited
redrawGraphics();
events.setSelectedIndex(0); //set to quakes list
}//GEN-LAST:event_listEarthquakesMouseExited
private void quakeSelectorMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_quakeSelectorMouseClicked
redrawGraphics(); //does not work
}//GEN-LAST:event_quakeSelectorMouseClicked
private void rawDataListMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_rawDataListMouseEntered
try {
Thread.sleep(200);//delayTime 100
} catch (InterruptedException ex) {
Logger.getLogger(SeismoViewer.class.getName()).log(Level.SEVERE, null, ex);
}
rawDataList.setText("");
}//GEN-LAST:event_rawDataListMouseEntered
private void quakeSelectorMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_quakeSelectorMouseEntered
//quakeSelector.setSelectedIndex(quakeSelector.getItemCount() -1);//select last event
//redrawGraphics();
}//GEN-LAST:event_quakeSelectorMouseEntered
private void quakeSelectorMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_quakeSelectorMouseExited
//updateSelectedQuake();
//selectedQuake.setText(String.valueOf(quakeSelector.getSelectedItem()));
//redrawGraphics();
}//GEN-LAST:event_quakeSelectorMouseExited
private void runtimeIntervalStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_runtimeIntervalStateChanged
//redrawGraphics();
}//GEN-LAST:event_runtimeIntervalStateChanged
private void RTC_timeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RTC_timeActionPerformed
RTC_depth.setSelected(false);
RTC_distance.setSelected(false);
RTC_mag.setSelected(false);
sortComboboxRTC();
}//GEN-LAST:event_RTC_timeActionPerformed
private void RTC_depthActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RTC_depthActionPerformed
RTC_mag.setSelected(false);
RTC_distance.setSelected(false);
RTC_time.setSelected(false);
sortComboboxRTC();
}//GEN-LAST:event_RTC_depthActionPerformed
private void RTC_distanceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RTC_distanceActionPerformed
RTC_depth.setSelected(false);
RTC_mag.setSelected(false);
RTC_time.setSelected(false);
sortComboboxRTC();
}//GEN-LAST:event_RTC_distanceActionPerformed
private void RTC_magActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RTC_magActionPerformed
RTC_depth.setSelected(false);
RTC_distance.setSelected(false);
RTC_time.setSelected(false);
sortComboboxRTC();
}//GEN-LAST:event_RTC_magActionPerformed
private void reverseSearchOrderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_reverseSearchOrderActionPerformed
sortComboboxRTC();
}//GEN-LAST:event_reverseSearchOrderActionPerformed
private void reverseSearchOrderMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_reverseSearchOrderMouseExited
redrawGraphics();
}//GEN-LAST:event_reverseSearchOrderMouseExited
private void RTC_distanceMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_RTC_distanceMouseExited
redrawGraphics();
}//GEN-LAST:event_RTC_distanceMouseExited
private void RTC_depthMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_RTC_depthMouseExited
redrawGraphics();
}//GEN-LAST:event_RTC_depthMouseExited
private void RTC_magMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_RTC_magMouseExited
redrawGraphics();
}//GEN-LAST:event_RTC_magMouseExited
private void RTC_timeMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_RTC_timeMouseExited
redrawGraphics();
}//GEN-LAST:event_RTC_timeMouseExited
private void runtimeIntervalMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_runtimeIntervalMouseExited
redrawGraphics();
propagationViewer();
}//GEN-LAST:event_runtimeIntervalMouseExited
private void gridSquareLTAActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gridSquareLTAActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_gridSquareLTAActionPerformed
private void jPanel10MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel10MouseExited
redrawGraphics();
}//GEN-LAST:event_jPanel10MouseExited
private void jButtonredrawClearSelQuakeMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonredrawClearSelQuakeMouseClicked
selectedQuake.setText("select Quake");
}//GEN-LAST:event_jButtonredrawClearSelQuakeMouseClicked
private void ctionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ctionPerformed
//updateSelectedQuake();
}//GEN-LAST:event_ctionPerformed
private void jDesktopPane3MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jDesktopPane3MouseEntered
}//GEN-LAST:event_jDesktopPane3MouseEntered
private void codePanelActivtesUpdateMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_codePanelActivtesUpdateMouseEntered
if(selectedQuake.getText().equals("select Quake"))
{
selectedQuake.setText(String.valueOf(quakeSelector.getSelectedItem()));
redrawGraphics();
}
}//GEN-LAST:event_codePanelActivtesUpdateMouseEntered
private void codePanelActivtesUpdate1MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_codePanelActivtesUpdate1MouseEntered
loadDataHighForDisp();
jTabbedPaneGraphics.setSelectedIndex(0); //graph
redrawGraphics();
}//GEN-LAST:event_codePanelActivtesUpdate1MouseEntered
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(SeismoViewer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(SeismoViewer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(SeismoViewer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(SeismoViewer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//
//
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
new SeismoViewer().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
static javax.swing.JTextArea AVG;
private static javax.swing.JCheckBox CheckBoxArchive;
private static javax.swing.JCheckBox CheckBoxShowLTA;
private static javax.swing.JCheckBox CheckBoxoldDataMode;
public javax.swing.JSpinner EarthQuakes_viewerOffsetYaxes;
private javax.swing.JButton LongTimeAverageCal;
private static javax.swing.JTextArea NOAAalertsText;
static javax.swing.JTextArea NW_events;
public javax.swing.JSpinner RF_ViewerOffsetYaxes;
static javax.swing.JRadioButton RTC_depth;
static javax.swing.JRadioButton RTC_distance;
static javax.swing.JRadioButton RTC_mag;
static javax.swing.JRadioButton RTC_time;
private javax.swing.JPanel TopPanel;
private javax.swing.JTextField TotalEnergy;
private javax.swing.JTextField TotalEnergyAVG;
private javax.swing.JTextField TotalEnergyAVGperDay;
private javax.swing.JTextField TotalEnergyMap;
public static javax.swing.JTextPane WSPR;
private static java.awt.TextField antenna;
private static java.awt.TextField antennaLTA;
private static java.awt.TextField callSign;
private static javax.swing.JComboBox callSignDatatoDisplay;
private static java.awt.TextField callSignLTA;
private javax.swing.JPanel codePanelActivtesUpdate;
private javax.swing.JPanel codePanelActivtesUpdate1;
private javax.swing.JTextField datePlot;
private javax.swing.JTextField datePlotLT;
private javax.swing.JTextField datePlotMapCenter;
private javax.swing.JTextField datePlotMatPost;
private javax.swing.JTextField datePlotMatPre;
private javax.swing.JTextField datePlotNow;
private javax.swing.JTextField datePlotPre;
static javax.swing.JComboBox durationMin;
private static java.awt.TextField elevation;
private static java.awt.TextField elevationLTA;
static javax.swing.JTabbedPane events;
private static java.awt.TextField gridSquareLTA;
private javax.swing.JButton jButtonCheckNW;
private static javax.swing.JButton jButtonClearAll;
private javax.swing.JButton jButtonClearData;
private static javax.swing.JButton jButtonClearSelected;
private static javax.swing.JButton jButtonDeleteUser;
static javax.swing.JButton jButtonLoadUSGS_data;
private static javax.swing.JButton jButtonLoadWSPR_data;
static javax.swing.JButton jButtonMatchQuakesNoise;
private javax.swing.JButton jButtonOpenGetArchivedData;
static javax.swing.JButton jButtonOpenRemoteData;
private javax.swing.JButton jButtonPrintSeceen;
private static javax.swing.JButton jButtonUploadQuakesLst;
private javax.swing.JButton jButtonredrawClearSelQuake;
private javax.swing.JButton jButtonredrawGrafics;
static javax.swing.JComboBox jComboBoxDataFileSelect;
static javax.swing.JComboBox jComboBoxEqkData;
private javax.swing.JDesktopPane jDesktopPane1;
private javax.swing.JDesktopPane jDesktopPane2;
private javax.swing.JDesktopPane jDesktopPane3;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel14;
private javax.swing.JLabel jLabel15;
private javax.swing.JLabel jLabel16;
private javax.swing.JLabel jLabel17;
private javax.swing.JLabel jLabel18;
private javax.swing.JLabel jLabel19;
private javax.swing.JLabel jLabel20;
private javax.swing.JLabel jLabel21;
private javax.swing.JLabel jLabel36;
private javax.swing.JLabel jLabel37;
private javax.swing.JLabel jLabel38;
private javax.swing.JLabel jLabel39;
private javax.swing.JLabel jLabel40;
private javax.swing.JLabel jLabel41;
private javax.swing.JLabel jLabel42;
private javax.swing.JLabel jLabel43;
private static javax.swing.JLabel jLabel44;
private javax.swing.JLabel jLabel45;
private javax.swing.JLabel jLabel46;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JMenu jMenu1;
private javax.swing.JMenu jMenu2;
private javax.swing.JMenu jMenu3;
private javax.swing.JMenu jMenu4;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JMenuBar jMenuBar2;
private javax.swing.JMenu jMenuCompare;
private javax.swing.JMenuItem jMenuCompareItem;
private javax.swing.JMenu jMenuGetNOAA;
private javax.swing.JMenu jMenuGetQuakes;
private javax.swing.JMenuItem jMenuGetQuakesItem;
private javax.swing.JMenu jMenuGetWSPR;
private javax.swing.JMenuItem jMenuItem1;
private javax.swing.JMenuItem jMenuItem2;
private javax.swing.JMenuItem jMenuItemgetWSPR_Item;
private javax.swing.JMenu jMenuReDraw;
private javax.swing.JMenuItem jMenuReDrawItem;
private javax.swing.JMenu jMenuRemData;
private javax.swing.JMenuItem jMenuRemDataItem;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel10;
private javax.swing.JPanel jPanel2;
private static javax.swing.JPanel jPanel29;
private javax.swing.JPanel jPanel3;
private static javax.swing.JPanel jPanel30;
private javax.swing.JPanel jPanel4;
private javax.swing.JPanel jPanel5;
private javax.swing.JPanel jPanel6;
private javax.swing.JPanel jPanel7;
private javax.swing.JPanel jPanel8;
private javax.swing.JPanel jPanel9;
private javax.swing.JScrollPane jScrollPane1;
static javax.swing.JScrollPane jScrollPane2;
private javax.swing.JScrollPane jScrollPane3;
private javax.swing.JScrollPane jScrollPane4;
private javax.swing.JScrollPane jScrollPane5;
private javax.swing.JScrollPane jScrollPane6;
private javax.swing.JScrollPane jScrollPane8;
static javax.swing.JTabbedPane jTabbedPaneGraphics;
private javax.swing.JTextArea jTextArea1;
static javax.swing.JTextArea listEarthquakes;
private javax.swing.JComboBox listThresh;
private static javax.swing.JButton loadNOAA;
private static java.awt.TextField locRFS_Lat;
private static java.awt.TextField locRFS_Lon;
static javax.swing.JComboBox numberRec;
private javax.swing.JScrollPane propTrackPane;
private javax.swing.JPanel propagationViewer;
private javax.swing.JPanel propagationViewerLT;
static javax.swing.JComboBox quakeSelector;
static javax.swing.JTextArea rawDataList;
private static javax.swing.JCheckBox reverseSearchOrder;
public javax.swing.JSpinner runtimeInterval;
private static java.awt.TextField selectedQuake;
private static java.awt.TextField shockWaveDel;
private static java.awt.TextField speedOfQuake;
private javax.swing.JButton startRFS;
private javax.swing.JComboBox tagMagThresh;
private javax.swing.JComboBox tagTextThresh;
private static java.awt.TextField totalEnergyQuakes;
private static java.awt.TextField totalPowerQuakes;
private javax.swing.JPanel worldMap;
// End of variables declaration//GEN-END:variables
public void ClearData() {
totalEng = 0;
propagationViewer.repaint();
clearEarthquakeData();
listEarthquakes.setText(""); //clear earthquake list
displayQuakes();
jButtonMatchQuakesNoise.setEnabled (false);
}
public void redrawGraphics() {
try {
Thread.sleep(100);//delayTimeProp -2000
} catch (InterruptedException ex) {
Logger.getLogger(SeismoViewer.class.getName()).log(Level.SEVERE, null, ex);
}
if ((jTabbedPaneGraphics.getSelectedIndex()) == 0 ) //0 = graph, 1 = map 2 = avg
{
if((String.valueOf(jComboBoxEqkData.getSelectedItem())!= null))
{
amplification = 4;
readSavedDataFiles();
propagationViewer();
//if(LongTimeAverageCal.isEnabled()==(false)) //only delete if not AVG
//listEarthquakes.setText(""); //clear earthquake list
displayQuakes();
if((String.valueOf(jComboBoxEqkData.getSelectedItem()).startsWith ("File")))
jButtonMatchQuakesNoise.setEnabled (false);
else
jButtonMatchQuakesNoise.setEnabled (true);
}
}
if ((jTabbedPaneGraphics.getSelectedIndex()) == 1) //0 = graph, 1 = map 2 = AVG
{
propagationMap();
datePlotMapCenter.setText(datePlotMapCenter.getText());//refresh
}
if ((jTabbedPaneGraphics.getSelectedIndex()) == 2 ) //0 = graph, 1 = map 2 = avg
propagationViewerLTA();
//else
{
// propagationMap();
}
//dispaly current time
Calendar c = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String time = sdf.format(c.getTime());
if(CheckBoxArchive.isSelected()== false) //only do this an the daily mode
datePlotMapCenter.setText(time);
//
TotalEnergy.setText(" Total E.: "+ (String.format ("%.2f",(totalEng)))+" GJ");
TotalEnergyMap.setText(" Total E.: "+ (String.format ("%.2f",(totalEng)))+" GJ");
totalEnergyQuakes.setText(String.format("%.2f",(totalEng))+" GJ");
totalPowerQuakes.setText(String.format("%.2f",(totalEng/86400*1000))+" MW"); //chang energy usage into 24 h eqiv
//loadUserParameters();
if ((jTabbedPaneGraphics.getSelectedIndex()) == 0 ) //0 = graph, 1 = map
readUsers();
jButtonredrawGrafics.requestFocus();
/**
Robot robot = null;// w ww . j a v a2s .co m
try {
robot = new Robot();
} catch (AWTException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
for (int i=0; i < 2; i++) {
robot.keyPress(KeyEvent.VK_ENTER);
robot.delay(1000);
robot.keyRelease(KeyEvent.VK_ENTER);
System.out.println(i);
}
**/
}
public void readSavedDataFiles(){
{
//redrawGraphics();
clearDatatable();
String varDir ="/MDSR_SA/";
if (jComboBoxDataFileSelect.getSelectedItem() != (null))
{
try {
if(CheckBoxArchive.isSelected() == true)
{
String[] var = null;
varDir ="/MDSR_SA/archivedData/";
if (jComboBoxDataFileSelect.getSelectedItem() == (""))
{
System.out.println("empty");
//getRemoteFilePerDate();
}
}
if(CheckBoxoldDataMode.isSelected() == true)
{
String[] var = null;
varDir ="/MDSR_SA/archivedData/oldData/";
}
//File dir = new File(System.getProperty("user.home") + varDir);
//println(jComboBoxDataFileSelect.getSelectedItem() );
FileReader fr = new FileReader (System.getProperty("user.home")+ varDir+ jComboBoxDataFileSelect.getSelectedItem());
BufferedReader textReader = new BufferedReader(fr);
String line;
int x = 0;
int numberOfLines = 1651;//biggest number of lines is 1650
String[] hext_Str = new String [numberOfLines];
for (x=0; x < numberOfLines; x++) {
line = textReader.readLine();
try {
if ((line) != null)
{
hext_Str = (line.split(",")); //remove "," and split
//System.out.println(hext_Str[0]);
//if (hext_Str[0].equals ("EOF")) //removing EOF
//hext_Str[0] = null;
if (hext_Str[0].equals ("null")) //removing EOF
break;
if (hext_Str[0].equals ("timestamp")) //removing data header
{
//OptionPane.showMessageDialog(null,"Data error - removing Header Line! Please wait...");
hext_Str[0] = null; //hext_Str[1] = null; hext_Str[2] = null; hext_Str[3] = null;
//hext_Str[4] = null;hext_Str[5] = null;hext_Str[6] = null;
//i = i - 1;
}
if (hext_Str[0] != null)
{
displayTimeMarker[x] = (hext_Str[0]);
displaySSI_CH1[x] = -1 * Double.parseDouble (hext_Str[1]);
displaySSI_CH2[x] = -1 * Double.parseDouble (hext_Str[2]);
displaySSI_CH3[x] = -1 * Double.parseDouble (hext_Str[3]);
displaySSI_CH4[x] = -1 * Double.parseDouble (hext_Str[4]);
displaySSI_CH5[x] = -1 * Double.parseDouble (hext_Str[5]);
displaySSI_CH6[x] = -1 * Double.parseDouble (hext_Str[6]);
events.setSelectedIndex(5); //hightlight the Raw Data window amd display
rawDataList.append("Time: " + displayTimeMarker[x] + " CH1: " + displaySSI_CH1[x] + " CH2: " + displaySSI_CH2[x] + " CH3: " +
displaySSI_CH3[x] + " CH4: " + displaySSI_CH4[x] + " CH5: " + displaySSI_CH5[x]+ " CH6: " + displaySSI_CH6[x] + "\n");
displayLastTime = displayTimeMarker[x];
//System.out.println(hext_Str[0]);
//Convert DateTime STring to Simple date format
String dtEvent = displayTimeMarker[x]; //"2010-10-15T09:27:37Z";
SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd HH:mm:ssZ");
try {
Date date = format.parse(dtEvent);
//if(dtEvent.equals (format.parse("2018-12-24 12:41:19")))
//System.out.println(dtEvent);
} catch (ParseException e) {
e.printStackTrace();
}
//System.out.println(dtEvent);
if (hext_Str[0].equals ("null")) x = x - 1; //to avoid overshooting the array
if (hext_Str[0].equals ("EOF")) x = x - 1;
//System.out.println(i +","+displayTimeMarker[i]+","+displaySSI_CH6[i]);
//i = i;//
//jMax = i;
//mMax = i;
//mCount = i;
//displayStart = 0;
}
}
}
catch (ArrayIndexOutOfBoundsException e) {
}
}
}
catch (IOException e)
{
//JOptionPane.showMessageDialog(null,"No temp data or archive file available");
}
return ;
}
}}
public void propagationViewer() {
shift = 0; //reset count
Graphics gfx = propagationViewer.getGraphics();
//temp array for display to prevent data corruption
double[] tempDisplaySSI_CH1 = new double[2000];
double[] tempDisplaySSI_CH2 = new double[2000];
double[] tempDisplaySSI_CH3 = new double[2000];
double[] tempDisplaySSI_CH4 = new double[2000];
double[] tempDisplaySSI_CH5 = new double[2000];
double[] tempDisplaySSI_CH6 = new double[2000];
//try {
//code for avoiding date mismatch on display
//System.out.println( "error at 3118: " + displayTimeMarker[400]);
if(displayTimeMarker[400] == null)
return;
else
{
displayLastTimePre = displayTimeMarker[400].substring(0, 10);
displayLastTime = displayTimeMarker[1300].substring(0, 10);
//displayLastTime.substring(0, 10);
if ((jTabbedPaneGraphics.getSelectedIndex()) == 0 ) //0 = graph, 1 = map 2 = avr
{
if (displayLastTimePre.equals (displayLastTime))
{
displayLastTime = displayLastTime.substring(0, 10);
datePlot.setText("Date: " + displayLastTime.replaceAll("/","-") +" UTC");
}
else
{
datePlotPre.setText("Date: " +displayLastTimePre.replaceAll("/","-") +" UTC");
datePlotNow.setText("Date: " + displayLastTime.replaceAll("/","-") +" UTC");
//datePlot.setText(displayLastTime);
}
}
if ((jTabbedPaneGraphics.getSelectedIndex()) == 1 ) //0 = graph, 1 = map 2 = avr
{
//datePlotMapCenter.setText(String.valueOf(totalEngAVGArr[i]));
}
gfx.setColor(Color.DARK_GRAY); //mask to aviod letters on top of each other
gfx.fillRect(0,0, 825, 512);
gfx.setColor(Color.LIGHT_GRAY); //grid horiz
gfx.drawLine (825, 50, 0, 50);
gfx.drawLine (825, 100, 0, 100);
gfx.drawLine (825, 150, 0, 150);
gfx.drawLine (825, 200, 0, 200);
gfx.drawLine (825, 250, 0, 250);
gfx.drawLine (825, 300, 0, 300);
gfx.drawLine (825, 350, 0, 350);
gfx.drawLine (825, 400, 0, 400);
gfx.drawLine (825, 450, 0, 450);
//gfx.drawLine (2500, 216, 0, 216);
{
//Legend
//gfx.setColor(Color.lightGray);
//gfx.drawString("Time of last entry:",600, 448);
//gfx.setColor(Color.red);
//gfx.drawString(displayLastTime,600, 470);
gfx.setColor(Color.red);
gfx.fillOval(50, 470, 20, 20);
gfx.setColor(Color.lightGray);
gfx.drawString("80 m",50, 470);
gfx.setColor(Color.green);
gfx.fillOval(110, 470, 20, 20);
gfx.setColor(Color.lightGray);
gfx.drawString("40 m",110, 470);
gfx.setColor(Color.yellow);
gfx.fillOval(170, 470, 20, 20);
gfx.setColor(Color.lightGray);
gfx.drawString("30 m",170, 470);
gfx.setColor(Color.magenta);
gfx.fillOval(230, 470, 20, 20);
gfx.setColor(Color.lightGray);
gfx.drawString("20 m",230, 470);
gfx.setColor(Color.cyan);
gfx.fillOval(290, 470, 20, 20);
gfx.setColor(Color.lightGray);
gfx.drawString("15 m",290, 470);
gfx.setColor(Color.pink);
gfx.fillOval(350, 470, 20, 20);
gfx.setColor(Color.lightGray);
gfx.drawString("10 m",350, 470);
//gfx.setColor(Color.yellow);
//gfx.drawLine(170, 500, 170, 300);
gfx.setColor(Color.white);
gfx.drawString("> M4.5",400, 480);
gfx.setColor(Color.red);
gfx.drawString("> M5.9 to 6.5",450, 480);
gfx.setColor(Color.magenta);
gfx.drawString("> M6.5",540, 480);
//data for label display
//String[] interval = new String[30];
String[] interval_1h = new String[]{"00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24"}; //for 6h display
String[] interval_2h = new String[]{"00","02","04","06","08","10","12","14","16","18","20","22","24"}; //for 12h display
String[] interval_4h = new String[]{"00","04","08","12","16","20","24"}; //for 24h display
String[] interval_8h = new String[]{"00","08","16","24"}; //for 48h display
String[] interval_12h = new String[] {"00","12","24"}; //for 72h display
String[] interval_1m = new String[] {"00"}; //for minute display
String[] interval = new String[30];
interval = interval_2h;
//displayTime = 1;
/**
if (scanTime.getSelectedItem().equals("6h"))
{
interval = interval_1h;
displayTime = 1;
}
if (scanTime.getSelectedItem().equals("12h"))
{
interval = interval_2h;
displayTime = 2;
}
**/
//if (scanTime.getSelectedItem().equals("24h"))
{
//interval = interval_4h;
//displayTime = 4;
}
/**
if (scanTime.getSelectedItem().equals("48h"))
{
interval = interval_8h;
displayTime = 8;
}
if (scanTime.getSelectedItem().equals("72h"))
{
interval = interval_12h;
displayTime = 12;
}
if (timeInt.getText().equals("1s"))
{
//interval = interval_6h;
displayTime = 1;
**/
String line;
int qg = 0;
int numberOfLines = 1651;//biggest number of lines is 1650
String[] hext_Str = new String [numberOfLines];
gfx.setColor(Color.green);
for (qg=0; qg < numberOfLines; qg++) {
double dephtQuakeCurr = depthQuake[qg];
//System.out.println("Display current Quake " + qg +" " + depthQuake[qg]);
if(CheckBoxArchive.isSelected() == false)
{
if(shift == 0) //only find first match
{
if(LTAdisplaySSI_CH1[3] != 0) //out of bounds check
{
String LTAd = LTAdisplayTimeMarker[qg].substring(11,16); //comparing to find match
String dispMk = displayTimeMarker[1].substring(11,16); //fist record of data
if(dispMk.equals(LTAd)) //match the first data point to the AVG point
{
if(qg < 1651) //do not update if out of bounds
{
//shift = 0;
shift = qg; //the additional records that are off date
//System.out.println( "Shift equals: " + x);
}
}}}}
try {
//Earthquake Indicator
gfx.setColor(Color.green);
if(displayQuakesMagnitude[qg] >= 4.5) //change color for magnetudes
gfx.setColor(Color.white);
else if
(displayQuakesMagnitude[qg -1] >= 4.5)
gfx.setColor(Color.white);
if(displayQuakesMagnitude[qg] >= 5.9) //change color for magnetudes
gfx.setColor(Color.red);
else if
(displayQuakesMagnitude[qg -1] >= 5.9)
gfx.setColor(Color.red);
if(displayQuakesMagnitude[qg] >= 6.5) //change color for magnetudes
gfx.setColor(Color.MAGENTA);
else if
(displayQuakesMagnitude[qg -1] >= 6.5)
gfx.setColor(Color.MAGENTA);
// gfx.setColor(Color.green);
//gfx.setColor(Color.white);
gfx.drawLine(qg/2-1 ,((int)300 - (int)((displayQuakesMagnitude[qg-1]*3) + Y_qu_offset)),qg/2,((int)300 - ((int)displayQuakesMagnitude[qg]*5 + Y_qu_offset) ));
if(displayQuakesMagnitude[qg] > 0)
{
if(displayQuakesMagnitude[qg] >= (Double.parseDouble(String.valueOf(tagMagThresh.getSelectedItem()))))
{
//if ((i & 1) == 0) // check if even
gfx.setColor(Color.blue); //mask to aviod letters on top of each other
gfx.fillRect(qg/2 - 5,303 - Y_qu_offset, 30, 16);
gfx.setColor(Color.red);
gfx.drawString("M"+(Double.toString((displayQuakesMagnitude[qg]))), qg/2 - 5, 315 - Y_qu_offset); //stager text
if(displayQuakesMagnitude[qg] >= (Double.parseDouble(String.valueOf(tagTextThresh.getSelectedItem()))))
//else
{
//gfx.setColor(Color.blue); //mask to aviod letters on top of each other
//gfx.fillRect(i/2 -5,322 - Y_qu_offset, 30, 16);
gfx.setColor(Color.lightGray);
gfx.drawString((displayPlaceQuake[qg]).replaceAll("\"",""), qg/2 - 5, 333 - Y_qu_offset); //stager text
gfx.setColor(Color.white);
String[] LonLat = new String [2];
String LonLatCurr = displayPlaceLongLat[qg];
LonLat = LonLatCurr.split(",");
quakeLat = (Double.valueOf(LonLat[0]));
quakeLon = (Double.valueOf(LonLat[1]));
calcDistRFStoQuakeUsingDegDec();
gfx.drawString(displayPlaceLongLat[qg], qg/2 - 5, 345 - Y_qu_offset); //stager text by 5
gfx.drawString( " Dist: " + (String.format("%.1f",(distanceForActive))) + " km", qg/2 - 5, 357 - Y_qu_offset); //stager text by 10
} //"Depht " + String.format("%.1f",(dephtQuakeCurr )) + " km variable does not work???
}
}
if(displayTimeMarker[qg] == null)
break;
if (qg > 2) //avoid out of bounds
{
//System.out.println (displayTimeMarker[( i)].substring(11, 13)); //for minutes (14, 16)
if ((Integer.parseInt(displayTimeMarker[(qg-1) ].substring(11, 13))) != (Integer.parseInt (displayTimeMarker[qg].substring(11,13))))//hour line at interval
{
for (String interval1 : interval) //
{
if ((displayTimeMarker[qg].substring(11, 13)).contains(interval1)) {
//if ((i & 1) == 0) // check if even
{
gfx.setColor(Color.orange);
gfx.drawLine(qg/2, 0, qg/2, 500); //vertical time line interval
gfx.setColor(Color.blue); //mask to aviod letters on top of each other
gfx.fillRect(qg/2 + 1,2, 40, 20);
gfx.setColor(Color.LIGHT_GRAY);
gfx.drawString(displayTimeMarker[qg].substring(11,16), qg/2 + 5, 16); //only display date and short time
//SA_test.setText (Integer.toString (j));
//SA_test.setText (Integer.toString (timeMarker[j-1].indexOf('P')) +"," + (timeMarker[j].indexOf('P')));
}
}
}
}
}
} catch (ArrayIndexOutOfBoundsException r) {
System.out.println ("Error line 4067");
//JOptionPane.showMessageDialog(null, "USGS and RF-Seismograph Dates do not match");
}
if (qg > 2) //avoid out of bounds
{
//time propagation graph CH1
//if (CheckBoxFreq1.isSelected()== true)
{
gfx.setColor(Color.red);
tempDisplaySSI_CH1[qg] = (displaySSI_CH1[qg] * amplification);
gfx.drawLine(qg/2-1 ,((int)tempDisplaySSI_CH1 [qg-1] - Y_offset ),qg/2,((int)tempDisplaySSI_CH1[qg] - Y_offset ));
}
//time propagation graph CH2
//if (CheckBoxFreq2.isSelected()== true)
{
gfx.setColor(Color.green);
tempDisplaySSI_CH2[qg] = (displaySSI_CH2[qg] * amplification);
gfx.drawLine((qg/2)-1 ,((int)tempDisplaySSI_CH2 [qg-1] - Y_offset ),(qg/2),((int)tempDisplaySSI_CH2[qg] - Y_offset ));
}
//time propagation graph CH3
//if (CheckBoxFreq3.isSelected()== true)
{
gfx.setColor(Color.yellow);
tempDisplaySSI_CH3[qg] = (displaySSI_CH3[qg] * amplification);
gfx.drawLine(qg/2-1 ,((int)tempDisplaySSI_CH3 [qg-1] - Y_offset ),qg/2,((int)tempDisplaySSI_CH3[qg] - Y_offset ));
}
//time propagation graph CH4
//if (CheckBoxFreq4.isSelected()== true)
{
gfx.setColor(Color.magenta);
tempDisplaySSI_CH4[qg] = (displaySSI_CH4[qg] * amplification);
gfx.drawLine(qg/2-1 ,((int)tempDisplaySSI_CH4 [qg-1] - Y_offset ),qg/2,((int)tempDisplaySSI_CH4[qg] - Y_offset ));
}
//time propagation graph CH5
//if (CheckBoxFreq5.isSelected()== true)
{
gfx.setColor(Color.cyan);
//displaySSI_CH5[i] = (displaySSI_CH5[qg - 2] + displaySSI_CH5[qg - 1] + displaySSI_CH5[qg] + displaySSI_CH3[qg + 1]+ displaySSI_CH5[i + 2] )/5; //avearaging even amd odd lines
tempDisplaySSI_CH5[qg] = (displaySSI_CH5[qg] * amplification);
gfx.drawLine(qg/2-1 ,((int)tempDisplaySSI_CH5 [qg-1] - Y_offset ),qg/2,((int)tempDisplaySSI_CH5[qg] - Y_offset ));
}
//time propagation graph CH6
//if (CheckBoxFreq6.isSelected()== true)
{
gfx.setColor(Color.pink);
tempDisplaySSI_CH6[qg] = (displaySSI_CH6[qg] * amplification);
gfx.drawLine(qg/2-1 ,((int)tempDisplaySSI_CH6 [qg-1] - Y_offset ),qg/2,((int)tempDisplaySSI_CH6[qg] - Y_offset ));
}
//code for quake runtime display
gfx.setColor(Color.LIGHT_GRAY);
String[] quakeSel = new String [2];
//selectedQuake.setText(String.valueOf(quakeSelector.getSelectedItem()));
String selQuake = selectedQuake.getText();
//System.out.println("contents of: " + selQuake);
//if(selQuake != "highlightedQuake")
if(selQuake.equals("select Quake"))
{} //do the reverse != does not work for string
else
{
int runTimeInt = (Integer.parseInt(String.valueOf(runtimeInterval.getValue())));
quakeSel = (selQuake.split(" - ")); //remove "-" and split into X-Loc,magnetude, depth, locationAndState,distance
int xCoordofQuake = Integer.parseInt(quakeSel[0]);
quakeSel[2] = quakeSel[4].replaceAll("km","");
double distanceOfQuakeMeters = 1000 * (Double.parseDouble (quakeSel[2])); //changing from km to m
int runTime = (Integer.parseInt(String.valueOf(runtimeInterval.getValue()))) * 52 * 2; // 52 s per scan, 2 for scalling x axis to mach pixels
double speedOfShockWave = distanceOfQuakeMeters / runTime;
speedOfQuake.setText(String.format("%.1f",(speedOfShockWave)));
shockWaveDel.setText(Integer.toString(runTime));
if(qg == xCoordofQuake)
{
//selecting strongest signal
int[] list = new int[]
{(int)tempDisplaySSI_CH1[xCoordofQuake],(int)tempDisplaySSI_CH2[xCoordofQuake],(int)tempDisplaySSI_CH3[xCoordofQuake],
(int)tempDisplaySSI_CH4[xCoordofQuake],(int)tempDisplaySSI_CH5[xCoordofQuake],(int)tempDisplaySSI_CH6[xCoordofQuake]};
//System.out.println("unsorted List: " + list[0] + " " + list[1]+ " " + list[2] + " " + list[3] + " " + list[4] + " " + list[5]);
Arrays.sort(list); //list in order
//System.out.println("sorted List: " + list[0] + " " + list[1]+ " " + list[2] + " " + list[3] + " " + list[4] + " " + list[5]);
int strongSig = list[0];//select strongest signal from sorted list
gfx.drawLine (xCoordofQuake/2 + runTimeInt, (int)(strongSig - Y_offset), xCoordofQuake/2 , (int)300 - (int)(displayQuakesMagnitude[xCoordofQuake-1]*3) - Y_qu_offset); //x,y,x,y
gfx.drawLine (xCoordofQuake/2, (int)(strongSig - Y_offset), xCoordofQuake/2, (int)300 - (int)(displayQuakesMagnitude[xCoordofQuake-1]*3) - Y_qu_offset); //x,y,x,y
if(runTimeInt != 0)
{
gfx.setColor(Color.white);
gfx.drawLine (xCoordofQuake/2 + runTimeInt, (int)(strongSig - Y_offset), xCoordofQuake/2 + runTimeInt, 235 - Y_qu_offset); //x,y,x,y
gfx.drawString( "" + (String.format("%.1f",(speedOfShockWave))) + " m/s", xCoordofQuake/2 + runTimeInt - 20 - Y_offset, 248 - Y_qu_offset); //stager text by 10
}
}
}
} //end if
} //end Loop
}
}}
public void readEarthquakeFiles(){
try {
setCursor(Cursor.WAIT_CURSOR);
FileReader fr = new FileReader (System.getProperty("user.home")+ "/MDSR_SA/"+ jComboBoxEqkData.getSelectedItem());
BufferedReader textReader = new BufferedReader(fr);
String line;
int x = 0;
int numberOfLines = 1651;//biggest number of lines is 1650
String[] hext_Str = new String [numberOfLines];
for (x=0; x < numberOfLines; x++) {
line = textReader.readLine();
try {
if ((line) != null)
{
hext_Str = (line.split(",")); //remove "," and split
if (hext_Str[0].equals ("time")) //removing data header
{
//JOptionPane.showMessageDialog(null,"Data error - removing Header Line! Please wait...");
hext_Str[0] = null; hext_Str[1] = null; hext_Str[2] = null; hext_Str[3] = null;
hext_Str[4] = null;hext_Str[5] = null;hext_Str[6] = null;
i = i - 1;
}
hext_Str[0] = hext_Str[0].substring(0,16); //removing dec seconds
hext_Str[0] = hext_Str[0].replace("T"," "); //removing T seperator
//hext_Str[0] = hext_Str[0].replace("-","/"); //replacing - for /
hext_Str[0] = hext_Str[0] + ("-0000"); // everythim into Zulu time
//StringBuilder sb = new StringBuilder();
//hext_Str[0]=sb;
//hext_Str[0]=sb.append('a');
if (hext_Str[0] != null)
{
//move quakes that occur at the same minute one minute downdown
if(timeQuake[x].equals (timeQuake[x-1]))
{
System.out.println("dupl");
//timeQuake[i-1] = (hext_Str[0]);
}
if(hext_Str[4].equals(""))
hext_Str[4] = "0";
timeQuake[x] = (hext_Str[0]);
latitudeQuake[x] = Double.parseDouble (hext_Str[1]);
longitudeQuake[x] = Double.parseDouble (hext_Str[2]);
depthQuake[x] = Double.parseDouble (hext_Str[3]);
magQuake[x] = Double.parseDouble (hext_Str[4]);
placeQuakeLocation[x] = (hext_Str[5]);
placeQuakeState[x] = (hext_Str[6]);
if (placeQuakeState[x].equals ("")) //remove parser error
placeQuakeState[x] = "na";
String dtEvent = timeQuake[x]; //"2010-10-15T09:27:37Z";
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mmZZZZZ");
try {
Date date1 = format.parse(dtEvent);
//if(date1.after(format.parse("2018-07-24 12:41:19-0000")))
//System.out.println(date1);
//Date date = format.parse(dtEvent);
//System.out.println(date);
} catch (ParseException e) {
JOptionPane.showMessageDialog(null,"Parser Data error");
//e.printStackTrace();
}
//System.out.println(dtEvent);
if (hext_Str[0].equals ("null")) x = x - 1; //to avoid overshooting the array //to avoid overshooting the array
if (hext_Str[0].equals ("EOF")) x = x - 1;
//System.out.println(i +","+displayTimeMarker[i]+","+displaySSI_CH6[i]);
//jMax = i;
//mMax = i;
//mCount = i;
//displayStart = 0;
}
}
}
catch (ArrayIndexOutOfBoundsException e) {
JOptionPane.showMessageDialog(null,"File not found - readEarthsQuake files");
}
}
}
catch (IOException e)
{
//JOptionPane.showMessageDialog(null,"No temp data file available");
return ;
}
setCursor(Cursor.DEFAULT_CURSOR);
}
public void matchQuakesAndNoise() {
quakeSelector.removeAllItems();//clear quake list
setCursor(Cursor.WAIT_CURSOR);
//needs fixing
if (listEarthquakes.getText().equals("")) //do not run this code without quakes
{
JOptionPane.showMessageDialog(null,"Load quakes first");
return;
}
System.out.println("lines of Data: " + timeQuake.length);
//if (rawDataList.getLineCount() < 1) //do not run this code without data
{
if (listEarthquakes.getText().startsWith("0")) //do not run this code without quakes
{
JOptionPane.showMessageDialog(null,"Load quakes first");
return;
}
else
{
int numberOfLines = 1651;
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mmZZZZZ");
for (int q=1; q < numberOfLines; q++) { //
displayTimeMarker[q] = displayTimeMarker[q].replaceAll("/","-");
//removing Seconds
String timeZone = displayTimeMarker[q].substring(19,24); //extract time zone
displayTimeMarker[q] = displayTimeMarker[q].substring(0,16); //extract datetime witout sec.
displayTimeMarker[q] = displayTimeMarker[q] + timeZone;
System.out.println(displayTimeMarker[q]+" "+ displayPlaceQuake[q]);
String dtEventNoise = displayTimeMarker[q]; //"2018-07-24 12:41-0000";
//if(displayQuakesMagnitude[0] == 0)
//
try {
Date dateNoise = format.parse(dtEventNoise);
for (int t=0; t <= 2000; t++) { //at a maximum of 2000 quakes per day
if(timeQuake[t]== null)
break; //ending when all quakes are proccessed
// System.out.println(timeQuake[t]);
String dtEventQuake = timeQuake[t];
if (timeQuake[t] == null) //avoid Nullpointer error
{
//setCursor(Cursor.DEFAULT_CURSOR);
break;
}
Date dateQuake = format.parse(dtEventQuake);
if(dateQuake.equals(dateNoise))
{
//move quakes that occur at the same minute one minute downdown
//if(displayTimeMarker[i] == displayTimeMarker[i-1])
{
//System.out.println("dup ");
//displayQuakesMagnitude[i+1] = magQuake[t];
//isplayPlaceQuake[i+1] = placeQuakeLocation[t] +"," + placeQuakeState[t];
//displayPlaceLongLat[i+1] = latitudeQuake[t] +", " + longitudeQuake[t];
}
displayQuakesMagnitude[q] = magQuake[t];
displayPlaceQuake[q] = placeQuakeLocation[t] +"," + placeQuakeState[t];
displayPlaceLongLat[q] = latitudeQuake[t] +", " + longitudeQuake[t];
//System.out.println(displaySSI_CH1[i]);[t];
//if(displayPlaceQuake[t] != null)
quakeLat = latitudeQuake[t]; //pass varialbles to calculator
quakeLon = longitudeQuake[t]; //pass varialbles to calculator
calcDistRFStoQuakeUsingDegDec();
quakeSelector.addItem(q + " - M" + displayQuakesMagnitude[q] + " - " + (String.format("%.1f",depthQuake[t])) + " km - " + displayPlaceQuake[q]+ " - " + (String.format("%.1f",(distanceForActive)))+" km");
//if(quakeSelector.getSelectedItem().toString().substring(5,6) == ("M"))
{
}
//System.out.println("select Quake" + quakeSelector.getSelectedItem().toString().substring(5,6));
}
//Date date = format.parse(dtEvent);
}//end loop
int quakeCount = quakeSelector.getItemCount();
if( quakeCount < 1) //when
//if(quakeSelector.getSelectedItem().toString().substring(5,6) == ("M"))
{
//quakeSelector.setSelectedIndex(quakeCount - 1); //-1 to avoid out of bounds
//quakeSelector.setSelectedIndex(quakeSelector.getMaximumRowCount());//select last event
//System.out.println("select QuakeInside" + quakeCount);
}
//System.out.println(timeQuake.length);
//System.out.println(displayTimeMarker[q] +" - M"+ displayQuakesMagnitude[q]);
//System.out.println(date);
} catch (ParseException e) {
//JOptionPane.showMessageDialog(null,"Parser Data error 1588");
//e.printStackTrace();
}
}
setCursor(Cursor.DEFAULT_CURSOR);
events.setSelectedIndex(0);
}
updateSelectedQuake();
}
}
public static void getRemoteEarthQuakeData(){ //from USGS
//setCursor(Cursor.WAIT_CURSOR);
String fromFile = "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.csv"; //
String toFile = (System.getProperty("user.home"))+"/MDSR_SA/USGS2.5_day.csv";
try (BufferedInputStream inputStream = new BufferedInputStream(new URL(fromFile).openStream());
FileOutputStream fileOS = new FileOutputStream(toFile)) {
byte data[] = new byte[1024];
int byteContent;
while ((byteContent = inputStream.read(data, 0, 1024)) != -1) {
fileOS.write(data, 0, byteContent);
}
} catch (IOException e) {
NW_events.append("Remote EarthQuake data - File not found" + "\n");
}
//setCursor(Cursor.DEFAULT_CURSOR);
}
public static void getRemoteFilePerDate(){ //conversion worked until 2019-03-11
//setCursor(Cursor.WAIT_CURSOR);
//println(jComboBoxDataFileSelect.getItemCount());
if (jComboBoxDataFileSelect.getItemCount() > 0)
{
String selectedItem = (String.valueOf(jComboBoxDataFileSelect.getSelectedItem()));
//System.out.println(selectedItem);
String endTime = selectedItem.substring(4, 14);
//String month = selectedItem.substring(9, 11);
//String day = selectedItem.substring(12, 14);
//Convert DateTime String to Simple date format
String startTime = endTime; //"2010-10-15";
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
try {
Date date = format.parse(endTime);
//if(dtEvent.equals (format.parse("2018-12-24 12:41:19")))
//System.out.println(dtEvent);
} catch (ParseException e) {
e.printStackTrace();
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
try {
c.setTime(sdf.parse(startTime));
} catch (ParseException ex) {
Logger.getLogger(SeismoViewer.class.getName()).log(Level.SEVERE, null, ex);
}
c.add(Calendar.DATE, -1); // number of days to add
startTime = sdf.format(c.getTime()); // sdf is now the new date format
//System.out.println("https://earthquake.usgs.gov/fdsnws/event/1/query?format=csv&starttime="+startTime+"&endtime="+endTime);
String fromFile = "https://earthquake.usgs.gov/fdsnws/event/1/query?format=csv&starttime="+startTime+"&endtime="+endTime; //working day
endTime = endTime.replace("-", "");
//System.out.println(endTime);
String toFile = (System.getProperty("user.home"))+"/MDSR_SA/archivedData/"+callSign.getText()+endTime+"-USGS2.5_day.csv";
try (BufferedInputStream inputStream = new BufferedInputStream(new URL(fromFile).openStream());
FileOutputStream fileOS = new FileOutputStream(toFile)) {
byte data[] = new byte[1024];
int byteContent;
while ((byteContent = inputStream.read(data, 0, 1024)) != -1) {
fileOS.write(data, 0, byteContent);
}
} catch (IOException e) {
}
//println(jComboBoxDataFileSelect.getSelectedItem());
//println(endTime);
//JOptionPane.showMessageDialog(null,"Quake file has been saved");
//rename file to new convention and move to archived Folder
//System.out.println((System.getProperty(("user.home"))+"/MDSR_SA/archivedData/oldData/"+jComboBoxLoadData.getSelectedItem()));
File source = new File((System.getProperty("user.home"))+"/MDSR_SA/archivedData/oldData/"+jComboBoxDataFileSelect.getSelectedItem());
File target = new File((System.getProperty("user.home"))+"/MDSR_SA/archivedData/"+callSign.getText()+endTime+"tempData.bak");
boolean Rename = source.renameTo(target);
//System.out.println(callSign.getText()+endTime+"tempData.bak");
jComboBoxEqkData.addItem(String.valueOf(callSign.getText()+endTime+"-USGS2.5_day.csv"));
jComboBoxEqkData.setSelectedItem(String.valueOf(callSign.getText()+endTime+"-USGS2.5_day.csv"));
jButtonLoadUSGS_data.setEnabled (true);
jButtonMatchQuakesNoise.setEnabled (true);
jComboBoxDataFileSelect.removeItemAt(jComboBoxDataFileSelect.getSelectedIndex());
getRemoteFilePerDate(); //run again until empty
}
else
JOptionPane.showMessageDialog(null,"Data has been converted");
}
public void getRemoteData(){
String host = "ftp.qsl.net";
int port = 21;
String username = "rf-seismograph";
String encrPW = "RMXxqQL2";
String source = "/uploads/currentData/"+callSignDatatoDisplay.getSelectedItem() +"_tempData.bak";
//String sourceFile =
String destination = (System.getProperty("user.home"))+"/MDSR_SA/dailyBackup"+ readDataInstance +".csv";
//implement this code: use user.config
if (passwordFTP.equals("propagation")) //password "propagation is translated
passwordFTP = encrPW;
FTPClient ftp = null;
try {
//ftp.configure(config);
ftp = new FTPClient();
ftp.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out)));
int reply;
ftp.connect(host,port);
NW_events.append("FTP port is:"+ftp.getDefaultPort() + "\n");
reply = ftp.getReplyCode();
if (!FTPReply.isPositiveCompletion(reply)) {
ftp.disconnect();
//throw new Exception("Exception in connecting to FTP Server");
}
ftp.login(username, passwordFTP);
ftp.setFileType(FTP.BINARY_FILE_TYPE);
ftp.enterLocalPassiveMode();
} catch (IOException ex) {
NW_events.append("Data download error: " + ex.getMessage() + "\n");
//ex.printStackTrace();
}
// Download the FTP File from the FTP Server
try (FileOutputStream fos = new FileOutputStream(destination)) {
ftp.retrieveFile(source, fos);
} catch (IOException e) {
//e.printStackTrace();
NW_events.append("Data File download failed" + "\n");
}
// checking for file size to prevent half images of temp file and if bigger than 100000 bytes rename
File file = new File(System.getProperty("user.home") + "/MDSR_SA/dailyBackup"+ readDataInstance +".csv");
double bytes = file.length();
if(bytes < 100000) // min file size (100 kB,if file fails to download or is corrupted)
{
fileDownloadGood = false;
propagationViewer.repaint();
//println("Data file to small or empty, in kB :"+bytes / 1024);
JOptionPane.showMessageDialog(null,"Currently no remote data file avialabe, no data, or currupt data in file."+"\n"
+"Cannot update graph...file is updated every 10 min. "+"\n"+
"Try again in 10 min, if error persits contact the SysAdmin."+"\n"+
"Reloading old file..." +"\n"+"");
}
else
{
fileDownloadGood = true;
jComboBoxDataFileSelect.removeAllItems();
jComboBoxDataFileSelect.addItem("dailyBackup"+ readDataInstance +".csv");
//try {
//deleteFile dailyBU before moving - need to be done to work in Windows otherwise no update
//Files.delete(Paths.get(System.getProperty("user.home") + ("/MDSR_SA/dailyBackup.csv")));
//} catch (IOException ex) {
//Logger.getLogger(SeismoViewer.class.getName()).log(Level.SEVERE, null, ex);
//JOptionPane.showMessageDialog(null,"dailyBackup.csv deleted failed");
//}
//JOptionPane.showMessageDialog(null,"dailyBackup.csv to be renamed" + readDataInstance);
//copy tempFile if bigger than 100000 bytes
//File sourceNew = new File((System.getProperty("user.home"))+"/MDSR_SA/dailyBackupTemp"+ readDataInstance +".csv");
//File targetNew = new File((System.getProperty("user.home"))+"/MDSR_SA/dailyBackup"+ readDataInstance +".csv");
readDataInstance = readDataInstance +1;
//boolean Rename = sourceNew.renameTo(targetNew);
}
/**
String fromFile = "https://www.qsl.net/rf-seismograph/uploads1/VE7DXW_tempData.bak"; //
String toFile = (System.getProperty("user.home"))+"/MDSR_SA/dailyBackup.csv";
//
try (BufferedInputStream inputStream = new BufferedInputStream(new URL(fromFile).openStream());
FileOutputStream fileOS = new FileOutputStream(toFile)) {
byte data[] = new byte[1024];
int byteContent;
while ((byteContent = inputStream.read(data, 0, 1024)) != -1) {
fileOS.write(data, 0, byteContent);
}
} catch (IOException e) {
System.out.println("File N/A");
}
**/
if( encrPW.equals(passwordFTP))
passwordFTP = "propagation"; //hide PW
setCursor(Cursor.DEFAULT_CURSOR);
}
public void readEarthquakeUSGSEvent(){
setCursor(Cursor.WAIT_CURSOR);
try {
String varFile ="/MDSR_SA/USGS2.5_day.csv"; //current USGS data
if(CheckBoxArchive.isSelected() == true)
{
String[] var = null;
varFile ="/MDSR_SA/archivedData/" + jComboBoxEqkData.getSelectedItem();
System.out.println("/MDSR_SA/archivedData/" + jComboBoxEqkData.getSelectedItem()+ " selectedQuakeDay");
if(jComboBoxEqkData.getSelectedIndex()> 1 ) //outofB mot empty
{
//totalEngAVGArr[0] = "test"; //to aviod outOfB
//totalEngAVGArr[1] = "test"; //to aviod outOfB
totalEngAVGArr[cntTotalEnergy] = (String.valueOf(jComboBoxEqkData.getSelectedItem())//write line into array
+ " " + totalEnergyQuakes.getText());
//needs work to dispaly date
String datePlotProp;
datePlotProp = (datePlot.getText() ); //.replace("-", ""));
datePlotProp = datePlotProp.replace("-", "");
datePlotMapCenter.setText(datePlotProp);
if(CheckBoxArchive.isSelected() == true)
{
if(totalEngAVGArr[cntTotalEnergy].contains( "0.00")) // .length() > 14)
System.out.println("Date at 350 " + totalEngAVGArr[cntTotalEnergy] + cntTotalEnergy );
else
{
String displayDate = (totalEngAVGArr[cntTotalEnergy]).substring(6,14);
//System.out.println("Date at 3500 " + displayDate + cntTotalEnergy );
//subtrackting one day from the display
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
Calendar c = Calendar.getInstance();
try {
c.setTime(sdf.parse(displayDate));
} catch (ParseException ex) {
Logger.getLogger(SeismoViewer.class.getName()).log(Level.SEVERE, null, ex);
}
c.add(Calendar.DATE, -1);
displayDate = sdf.format(c.getTime()); // sdf is now the new date format
datePlotMapCenter.setText(displayDate);
} }
//else
//datePlotMapCenter.setText(datePlot.getText());
cntTotalEnergy = cntTotalEnergy + 1; //increase count for array
try {
Thread.sleep(200);
} catch (InterruptedException ex) {
Logger.getLogger(SeismoViewer.class.getName()).log(Level.SEVERE, null, ex);
}
if(totalEngAVGArr[50] == null)
//System.out.println("Length of Arrey " + cntTotalEnergy);
{
if((LTAdisplaySSI_CH1[3] != 0))
{
if(cntTotalEnergy == 1)
drawOnce = false;//reset drawing mode
else
drawOnce = true;//reset drawing mode
/**
//frame.setAlwaysOnTop(true);
//frame.setSize(500, 500);
//frame.setLocation(500, 500);
JOptionPane.showMessageDialog(null,"Checking data...ready to calculate!" ); //+ cnt );
//needs work
//JOptionPane.ABORT();
//JOptionPane.setAlwaysOnTop(true);
//jDesktopPane1.selectFrame(true);
Robot robot = null;// w ww . j a v a2s .co m
try {
robot = new Robot();
} catch (AWTException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
for (int i=0; i < 2; i++) {
robot.keyPress(KeyEvent.VK_ENTER);
robot.delay(10);
robot.keyRelease(KeyEvent.VK_ENTER); //always disable the enter.
//System.out.println(i);
}
**/
}}
}
}
if(CheckBoxoldDataMode.isSelected() == true)
{
String[] var = null;
varFile ="/MDSR_SA/archivedData/" + jComboBoxEqkData.getSelectedItem();
//println("/MDSR_SA/archivedData/" + jComboBoxEqkData.getSelectedItem() + "selectedQuakeDay");
}
//File dir = new File(System.getProperty("user.home") + varDir);
FileReader fr = new FileReader (System.getProperty("user.home") + varFile);
BufferedReader textReader = new BufferedReader(fr);
String line;
int x = 0;
String[] hext_Str = new String [1000];
for (x=0; x < 1000; x++) {
line = textReader.readLine();
try {
if ((line) != null)
{
hext_Str = (line.split(",")); //remove "," and split
if (hext_Str[0].equals ("time")) //removing data header
{
//JOptionPane.showMessageDialog(null,"Data error - removing Header Line! Please wait...");
hext_Str[0] = null; hext_Str[1] = null; hext_Str[2] = null; hext_Str[3] = null;
hext_Str[4] = null;hext_Str[5] = null;hext_Str[6] = null;(hext_Str[13])= null;
x = x - 1;
}
//else
//break;
if (hext_Str[0] != null)
{
timeQuake[x] = (hext_Str[0]);
if(hext_Str[4].equals(""))
hext_Str[4] = "0";
latitudeQuake[x] = Double.parseDouble (hext_Str[1]);
longitudeQuake[x] = Double.parseDouble (hext_Str[2]);
depthQuake[x] = Double.parseDouble (hext_Str[3]);
magQuake[x] = Double.parseDouble (hext_Str[4]);
placeQuakeLocation[x] = (hext_Str[13]);
placeQuakeState[x] = (hext_Str[14]);
placeQuakeState[x] = placeQuakeState[x] .replaceAll("earthquake","");// remove earthquake
//placeQuakeLocation[x] = placeQuakeLocation[x].replaceAll("km"," km"); //Iso fix
placeQuakeLocation[x] = placeQuakeLocation[x].replaceAll("\"",""); //remove quotes
placeQuakeState[x] = placeQuakeState[x].replaceAll("\"",""); //remove quotes
timeQuake[x] = timeQuake[x].replace("T"," "); //removing T seperator
timeQuake[x] = timeQuake[x].substring(0,16); //removing dec seconds
timeQuake[x] = timeQuake[x] + ("-0000"); // everything into Zulu time
//always make sure the stonger quake is displayed in case of two quakes at the same minute
if(timeQuake[x].substring(11,16).equals(timeQuake[x-1].substring(11,16))) //needs work
{
//int t;
//System.out.println(timeQuake[x-1].substring(14,16));
//System.out.println(x);
//if(magQuake[x] > magQuake[x-1]) //display stronger one
//{
//if(magQuake[x] < 4.5) //do not show small quakes double
//System.out.println(x);
//x = x-2; //overwrite quake
}
//else
// if(magQuake[x] > magQuake[x-1]) //display stronger one
{
//t = (Integer.parseInt(timeQuake[x].substring(14,16)))-1;//fix by moving quake - 1min
//String str;
// str = Integer.toString(t);
// if (t < 10) //if mimutes are below 10 still replace two digits
//str = "0"+str;
//timeQuake[x] = timeQuake[x].replace(14, 16, str));
//else
//str.replace(start, end, "foobar");
//timeQuake[x].replace(14,16, "00");
//System.out.println(str + "dupl"+timeQuake[x].substring(14,16));
}
}
// }
/**
String dtEvent = timeQuake[x]; //"2010-10-15T09:27:37Z";
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mmZZZZZ");
try {
Date date1 = format.parse(dtEvent);
//if(date1.after(format.parse("2018-07-24 12:41:19-0000")))
//System.out.println(date1);
//Date date = format.parse(dtEvent);
//System.out.println(date);
} catch (ParseException e) {
JOptionPane.showMessageDialog(null,"Parser Data error");
e.printStackTrace();
} **/
//System.out.println(dtEvent);
//if (hext_Str[0].equals ("null")) x = x - 1; //to avoid overshooting the array //to avoid overshooting the array
//if (hext_Str[0].equals ("EOF")) x = x - 1;
}
}
catch (ArrayIndexOutOfBoundsException e) {
}
}
}
catch (IOException e)
{
//JOptionPane.showMessageDialog(null,"No temp data file available");
setCursor(Cursor.DEFAULT_CURSOR);
return ;
}
setCursor(Cursor.DEFAULT_CURSOR);
}
public void displayQuakes(){ //in textbox
int tempComboCount = jComboBoxDataFileSelect.getItemCount();
if(cnt == 0)
cnt = tempComboCount - totalFilesForAvr; //select the last 50 files
cnt = cnt + 1; //go to next quake increase count
if (tempComboCount >= totalFilesForAvr) //protect out of bounds
{
if (cnt == tempComboCount) //high edge //use the last 50 records
cnt = tempComboCount - totalFilesForAvr; //low edge
//if (cnt >= 50)
//cnt = 0;
//if ((jTabbedPaneGraphics.getSelectedIndex()) != 2 ) //0 = graph, 1 = map, 2 = AVG
//readSavedDataFiles();
//if (cnt == totalFilesForAvr +1)//reset count when it reaches end
//cnt = 0;
//System.out.println("value of comboBox0: " + cnt + " total: " + jComboBoxDataFileSelect.getItemCount() + varDir);
if(CheckBoxArchive.isSelected() == true) //prevents code from running without being in Archive
{
if(varDir.endsWith("null")) //only run once needed for autouupdate
{
//if (jComboBoxDataFileSelect.getItemCount() > totalFilesForAvr) //prevent running again if data is already loaded
{
//if()
//if(LTAdisplaySSI_CH1[3] == 0) //prevent running again if data is already loaded /for preventing action if Archive is empty
{
//fileSelectAction();
jComboBoxDataFileSelect.setSelectedIndex(cnt);
//fileSelectAction(); //causes stack overflow
//System.out.println("value of comboBox1: " + cnt + " total: " + jComboBoxDataFileSelect.getItemCount());
//System.out.println("value of ekqBox: " + cnt + " total: " + jComboBoxEqkData.getItemCount());
redrawGraphics();
//CheckBoxArchive.setSelected(true);
readEarthquakeUSGSEvent();
readSavedDataFiles();
//fileSelectAction();
JOptionPane.showMessageDialog(null,"Calulate one day1:" + cnt );
//System.out.println("value of comboBox2: " + cnt + " total: " + jComboBoxDataFileSelect.getItemAt(cnt));
//matchQuakesAndNoise();
}//LTAdisplaySSI_CH1[0] == 0
}//jComboBoxDataFileSelect.getItemCount() > 50)
}//varDir.endsWith("null")
}//CheckBoxArchive.isSelected()
totalEngAVG = totalEngAVG + totalEng; //total fro AVG
//totalEngAVGArr[cnt] = ("Total Energy: test for 16 ");
//totalEngAVGArr[cnt] = ( "Total Energy: " + (String.valueOf(totalEngAVG + " GW" ))); //needs to be there outerwise archive file error
if(jComboBoxDataFileSelect.getSelectedIndex() < cnt)
cnt = 0; //reset count otherwise outofB
System.out.println(cnt +" Total Count " + jComboBoxDataFileSelect.getSelectedIndex() + varDir); // + totalEngAVGArr[cnt] + " GW test " + jComboBoxDataFileSelect.getSelectedItem());
if(CheckBoxArchive.isSelected() == true)
{
if (cnt > 0) //prevent out of Bounds and empty values
{
//System.out.println("offending array at " + cnt +" "+ totalEngAVGArr[cnt]);
if(LTAdisplaySSI_CH1[3] != 0) //
{
//if(totalEngAVGArr[cnt-1].length() > 16) //prevent out of bounds
{
if (jComboBoxDataFileSelect.getSelectedItem() != "null") // only dislay values above 0
{
//System.out.println(totalEng + "total energy not 0");
//System.out.println("offending array " + totalEngAVGArr[cnt]);
if ((String.valueOf(jComboBoxEqkData.getSelectedItem())).contains ("1")) //only run once (totalEngAVGArr[cnt-1]))
{
//cnt = cnt - 1;
System.out.println(cnt + " already in list " + jComboBoxEqkData.getSelectedItem());
}
else
{
DecimalFormat twoDForm = new DecimalFormat("#.##"); //reduce accuracy to 2 digits
totalEng = Double.valueOf(twoDForm.format(totalEng)); //limit to 2 dp
totalEngAVGArr[cnt] = (cnt + " " + String.valueOf(jComboBoxDataFileSelect.getSelectedItem())) + " " + totalEnergyQuakes.getText(); //(String.valueOf(totalEng + " GW" ));
//totalEngAVGArr[cnt] = Integer.toString(cnt) + jComboBoxDataFileSelect.getSelectedItem() + " Energy:" + totalEng; //total fro AVG
//System.out.println(cnt + totalEngAVGArr[cnt -1 ].substring(0,15) + " test3 " + jComboBoxDataFileSelect.getSelectedItem());
}
}}}}}}
totalEng = 0; //reset energy only for daily totals
//JOptionPane.showMessageDialog(null,"Calulate one day:" +totalEngAVG);
for (int x=0; x < 2000; x++) {
//calculate total Energy of Quakes
//add all quakes togeher and display in GJ
totalEng = totalEng + (Math.pow(10,1.5 * magQuake[x] + 4.4) / 1000000000); //sum and display in GW
if(magQuake[x] >= (Double.parseDouble(String.valueOf(listThresh.getSelectedItem()))))
{
if ((jTabbedPaneGraphics.getSelectedIndex()) == 2 ) //0 = graph, 1 = map, 2 = AVG
{
//listEarthquakes.setText("");
//listEarthquakes.append(totalEng +" GJ"+ "\n");
}
else
{
//add distance code here
if(locRFS_Lat.getText().equals("locRFS_Lat"))
{
events.setSelectedIndex(5); //selet data pane
JOptionPane.showMessageDialog(null,"Load Data first.");
break; //end process
}
else
{
quakeLat = latitudeQuake[x];
quakeLon = longitudeQuake[x];
calcDistRFStoQuakeUsingDegDec();
System.out.println(x +","+timeQuake[x]+","+(String.format("%.1f",(magQuake[x])))+" "+placeQuakeState[x]);
listEarthquakes.append("M"+String.format("%.1f",magQuake[x])+" "+placeQuakeLocation[x]+""
+ " "+placeQuakeState[x]+" "+timeQuake[x].substring(0,16) +" depth "+(String.format("%.1f",(depthQuake[x])))+" km"+
" dist "+(String.format("%.1f",(distanceForActive)))+" km"+"\n");
}
}
}
//if(x > 0) // only list at the end
if(timeQuake[x] == null) // avoid null pointer issue
{
//listEarthquakes.setText("");
quakeSummery();
x = 2000;
return; //end loop
}
if(cnt == 50)
{
return;
}
}
}
public void quakeSummery(){ //calculates energies on Joules
//determine the filled length of the array
int totalQuakes = 0;
//listEarthquakes.setText("");
for (int t=0; t < 2000; t++) {
if(timeQuake[t] == null) // avoid null pointer issue
{
totalQuakes = t;
break;
//return; //end loop - do not use here
}
}
if(listEarthquakes.getLineCount() - 1 > totalQuakes)
{
listEarthquakes.setText(""); //clear earthquake list
displayQuakes();
}
else
listEarthquakes.append( totalQuakes + " quakes with a total E of " + (String.format("%.2f",totalEng)
+ " GJ ; listing " + (listEarthquakes.getLineCount() - 1) + " quakes " + shift) + "\n");
totalEnergyQuakes.setText(String.format("%.2f",(totalEng))+" GJ");
TotalEnergy.setText(" Total E.: "+ (String.format ("%.2f",(totalEng)))+" GJ");
totalPowerQuakes.setText(String.format("%.2f",(totalEng/86400*1000))+" MW");
//listEarthquakes.select(i + 2, i); //does not work
//if ((jTabbedPaneGraphics.getSelectedIndex()) != 0 ) //0 = graph, 1 = map, 2 = AVG only display when enargy has been calulated
{ //i not reseting properly
//x = 0; //needed to refresh the display and the quake listing
}
//listEarthquakes.append(" - AVG E: " + (String.format("%.2f",totalEngAVG / 1000/totalFilesForAvr) + " TJ" + "\n"));
}
public void quakesToFile(){
try {
BufferedWriter out = new BufferedWriter(new FileWriter((System.getProperty("user.home"))+ "/MDSR_SA/RFV_CurrentQuakes.lst"));
out.write ("Mag. Location State Time Depth");
out.newLine();
for (int x=0; x < 1000; x++) {
if(timeQuake[x] == null) // avoid null pointer issue
{
out.close();
return ;
}
{
out.write ("M"+String.format("%.1f",magQuake[x])+" "+placeQuakeLocation[x]+""
+ " "+placeQuakeState[x]+" "+timeQuake[x].substring(0,16)+" "+" depth "+(String.format("%.1f",(depthQuake[x])))+" km"+
" dist "+(String.format("%.1f",(distanceForActive)))+" km"+ "\n");
//out.newLine();
}
}
}
catch (IOException e)
{
JOptionPane.showMessageDialog(null,"Can not write the quake file.");
}
}
public void upLoadFiles(){
String server = "ftp.qsl.net";
String user = "rf-seismograph";
String pass = "propagation";
String dir = "/uploads/";
int port = 21;
//netSpeed(); //check for network
if(netIsAvailable()==(true))
{
NW_events.append("Internet avilable" + "\n");
events.setSelectedIndex(2); //data event
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
//+ ((sdf.format(new Date())) + ".csv"))));
//setCursor(Cursor.WAIT_CURSOR); //can not be used in static void
FTPClient ftpClient = new FTPClient();
ftpClient.setDefaultTimeout(500); //leave at 500 for relaibale uploads
//ftpClient.setDataTimeout(500);
//ftpClient.setConnectTimeout(500);
try {
if (ftpClient.isConnected()) { //checks if the link is active
ftpClient.logout();
ftpClient.disconnect();
//jTabbedW_Event.append("forced logout " + sdf.format(new Date())+ "\n");
}
ftpClient.connect(server, port);
NW_events.append(ftpClient.getReplyString());
if (ftpClient.getReplyCode() != 220) //successful connection
{
ftpClient.disconnect();
//System.err.println("FTP server refused connection.");
}
//if (pass.equals("propagation")) //password "propagation is translated to
pass = "RMXxqQL2";
//System.err.println(pass);
ftpClient.login(user, pass);
NW_events.append(ftpClient.getReplyString());
if (ftpClient.getReplyCode() != 230) //successful logon
{
ftpClient.disconnect();
//System.err.println("FTP server logon connection.");
}
// Changes working directory
ftpClient.changeWorkingDirectory(dir);
//ftpActivity.append(ftpClient.printWorkingDirectory()+ "\n");
//ftpActivity.append(ftpClient.getReplyString());
if (ftpClient.getReplyCode() != 250) //directory exists not true
{
ftpClient.disconnect();
NW_events.append("250 directory not valid." + "\n");
//System.err.println("directory not valid");
}
ftpClient.changeWorkingDirectory("cd..\\..");
ftpClient.enterLocalPassiveMode();
ftpClient.setFileType(FTP.BINARY_FILE_TYPE);
// APPROACH #1: uploads first file using an InputStream
File firstLocalFile = new File(System.getProperty("user.home") + "/MDSR_SA/RF_Viewer.png");
String firstRemoteFile = dir + "RF_Viewer.png";
//String firstRemoteFile = dir + callSign.getText() + sdf.format(new Date())+"RF_Viewer.png"; //change file name to RF_Viewer.png only
InputStream inputStream = new FileInputStream(firstLocalFile);
//System.out.println("Start uploading first file");
boolean done = ftpClient.storeFile(firstRemoteFile, inputStream);
inputStream.close();
if (done) {
//setCursor(Cursor.DEFAULT_CURSOR);
NW_events.append( "RF_Viewer.png uploaded " + sdf.format(new Date()) + " form " + callSign.getText() + "\n");
}
else //FTPUploadBackup();
NW_events.append("RF_Viewer.png failed to upload"+ "\n");
//printJOptionPane.showMessageDialog(null,"RF-Seismo.png failed to upload");
//upload earthquake for the day
//getRemoteFile(); //get the latest data from USGS
// APPROACH #2: uploads second file using an OutputStream
File localFile = new File(System.getProperty("user.home") + "/MDSR_SA/RFV_CurrentQuakes.lst");
String remoteFile = dir + "dailyReport.txt"; //
InputStream inputStream1 = new FileInputStream(localFile);
//select last line of the box
String s = listEarthquakes.getText();
int pos = s.length();
listEarthquakes.setCaretPosition(pos);
OutputStream outputStream = ftpClient.storeFileStream(remoteFile);
int fileSize = (int)(new File(System.getProperty("user.home") + "/MDSR_SA/RFV_CurrentQuakes.lst").length()); //getting file size in bytes
byte[] bytesIn = new byte[fileSize];
int read = 0;
int bytesSent = 0;
//checking for bytes uploaded
while ((read = inputStream1.read(bytesIn)) != -1) {
outputStream.write(bytesIn, 0, read);
bytesSent = read;
}
inputStream1.close();
outputStream.close();
boolean completed = ftpClient.completePendingCommand();
if (completed) {
if (bytesSent != fileSize)
{
NW_events.append( sdf.format(new Date()) + " from " + callSign.getText() + "List failed " + "\n");
incomplete = true;
}
else
NW_events.append("List uploaded at " + sdf.format(new Date()) + " from " + callSign.getText() + "\n");
incomplete = false;
NW_events.append("211 Connection closed" + "\n");
//ftpClient.logout();
//ftpClient.disconnect();
NW_events.append("logout and disconnect");
}
} catch (IOException ex) {
//JOptionPane.showMessageDialog(null,"Website updates failed to upload - create files first!");
//System.out.println("Error: " + ex.getMessage());
//ex.printStackTrace();
} finally {
try {
if (ftpClient.isConnected()) {
ftpClient.logout();
ftpClient.disconnect();
}
} catch (IOException ex) {
ex.printStackTrace();
}
}
if (incomplete == true)
JOptionPane.showMessageDialog(null,"USGS Daily updates failed to upload ");
//FTPUploadBackup(); //try again
}
else
{
//NW_Event.append("off");
NW_events.append("No Server or Internet " + "\n");
}
}
public void saveImage(){
int y1;
int x1;
int selectedScreen = 0;
String saveFileName = "test.png";
String saFile = "";
//System.out.println("index is: "+jTabbedPaneGraphics.getSelectedIndex());
// needs work
//jTabbedPaneGraphics.setSelectedIndex(0); //0 = graph, 1 = map
//if ((jTabbedPaneGraphics.getSelectedIndex()) == 1 ) //0 = graph, 1 = map
{
//jTabbedPaneGraphics.setSelectedIndex(0);
//readSavedDataFiles();
//propagationViewer();
//try {
//Thread.sleep(200);
//} catch (InterruptedException e) {
//e.printStackTrace();
//}
}
//screenSwitch.setSelectedIndex(1); //always make sure the prop sreen is on top
//SA_Display.requestFocus(); //set image to foreground for snapshot - not working
setCursor(Cursor.WAIT_CURSOR);
try {
Thread.sleep(1000);
}
catch (InterruptedException e) {
}
if ((jTabbedPaneGraphics.getSelectedIndex()) == 0 ) //map
{
saveFileName = "RF_Viewer.png";
//System.out.println("ARCH index is: "+jTabbedPaneGraphics.getSelectedIndex());
//jTabbedPaneGraphics.setSelectedIndex(0); //take sceen shoot of graph
Point loc_sS = propagationViewer.getLocationOnScreen();
Point offsetPoint_sS = new Point(loc_sS.x, loc_sS.y);
x1 = loc_sS.x;
y1 = loc_sS.y;
}
if ((jTabbedPaneGraphics.getSelectedIndex()) == 1 ) //map
{
saveFileName = "mapQuakes.png";
//System.out.println("ARCH index is: "+jTabbedPaneGraphics.getSelectedIndex());
//jTabbedPaneGraphics.setSelectedIndex(1); //take sceen shoot of graph
Point loc_sS = worldMap.getLocationOnScreen();
Point offsetPoint_sS = new Point(loc_sS.x, loc_sS.y);
x1 = loc_sS.x;
y1 = loc_sS.y;
}
if ((jTabbedPaneGraphics.getSelectedIndex()) == 2 )
{//0 = graph, 1 = map 2 = avg
saveFileName = "RF_Avg.png";
//get location of window and select active window
Point loc_sS = propagationViewerLT.getLocationOnScreen();
Point offsetPoint_sS = new Point(loc_sS.x, loc_sS.y);
x1 = loc_sS.x;
y1 = loc_sS.y;
}
else
{
jTabbedPaneGraphics.setSelectedIndex(0);
Point loc_sS = propagationViewer.getLocationOnScreen();
Point offsetPoint_sS = new Point(loc_sS.x, loc_sS.y);
x1 = loc_sS.x;
y1 = loc_sS.y;
}
try {
Robot robot = new Robot();
String format = "png";
//String fileName = "PartialScreenshot." + format;
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Rectangle captureRect = new Rectangle(x1 - 2,y1 - 2, 826, 510 );
BufferedImage screenFullImage = robot.createScreenCapture(captureRect);
try {
if(CheckBoxArchive.isSelected() == true)
{
String destination = (System.getProperty("user.home"))+"/MDSR_SA/archivedImg/";
File dir = new File(destination); //check if directory exists, if not create
if(!dir.exists()) dir.mkdirs();
FileInputStream fis;
String selectedItem = (String.valueOf(jComboBoxDataFileSelect.getSelectedItem()));
selectedItem = (selectedItem.substring(0, 14));
ImageIO.write(screenFullImage, format, new File(System.getProperty("user.home") + "/MDSR_SA/archivedImg/"+ selectedItem + saveFileName));
}
else
{
ImageIO.write(screenFullImage, format, new File(System.getProperty("user.home") + "/MDSR_SA/"+ saveFileName));
}
} catch (IOException ex) {
JOptionPane.showMessageDialog(null,"Image was not saved");
}
//System.out.println("A partial screenshot saved!");
}
catch (AWTException ex) {
JOptionPane.showMessageDialog(null,"Can not create image during monitor power down cycle."+"\n"
+ "Please set monitor to be on at all times.");
}
setCursor(Cursor.DEFAULT_CURSOR);
//setCursor(Cursor.WAIT_CURSOR);
/**
screenSwitch.setSelectedIndex(1); //always make sure the prop screen is on top
try {
Thread.sleep(1000);
}
catch (InterruptedException e) {
}
//get location of window
Point loc_sS = screenSwitch.getLocationOnScreen();
Point offsetPoint_sS = new Point(loc_sS.x, loc_sS.y);
int x1 = loc_sS.x;
int y1 = loc_sS.y;
try
{
RenderedImage screencapture = new Robot().createScreenCapture(new Rectangle( x1 + 7,y1 + 7, x1 + 420 , y1 + 250 ));
System.out.println((Integer.toString(x1 + 7))+"vertical:"+(Integer.toString(y1 + 7)));
System.out.println((Integer.toString(x1 + 420))+"vertical:"+(Integer.toString(y1 + 250)));
File file = new File( System.getProperty("user.home") + "/MDSR_SA/RF_Seismo.png");
ImageIO.write(screencapture, "png", file);
} catch (Exception e) {
JOptionPane.showMessageDialog(null,"Propagation jpg file write error");
}
**/
//readSavedDataFiles();
//propagationViewer();
}
public void clearEarthquakeData(){
for (int t=0; t < 2000; t++) {
if(CheckBoxArchive.isSelected() == true)
{
if(LongTimeAverageCal.isEnabled()==(false)) //only delete if not AVG
listEarthquakes.setText(""); //clear earthquake list
}
//if (displayQuakesMagnitude[t] > 0) //avoid Nullpointer error
//displayTimeMarker[t] = "";
//displaySSI_CH1[t] = 0;
//displaySSI_CH2[t] = 0;
timeQuake[t] = null;
displayQuakesMagnitude[t] = 0;
displayPlaceQuake[t] = null;
displayPlaceLongLat[t] = null;
//System.out.println(displaySSI_CH1[i]);[t];
latitudeQuake[t] = 0;
longitudeQuake[t] = 0;
depthQuake[t] = 0;
magQuake[t] = 0;
placeQuakeLocation[t] = null;
placeQuakeState[t] = null;
}
//propagationViewer.repaint();
//datePlotNow.setText("No Data");
//TotalEnergy.setText("No Data");
//propagationViewer();
}
public static void loadUserParameters() {
try {
FileReader fr = new FileReader (System.getProperty("user.home")+ "/MDSR_SA/RFV_User.cfg");
BufferedReader textReader = new BufferedReader(fr);
int numberOfLines = 6;
String[] textData = new String [numberOfLines];
int x;
if ((jTabbedPaneGraphics.getSelectedIndex()) == 0 ) //0 = graph, 1 = map
{
for (x=0; x < numberOfLines; x++) {
if (x == 1)
{
callSign.setText(textReader.readLine());
//callSignLT.setText(textReader.readLine());
}
if (x == 2)
{
locRFS_Lat.setText(textReader.readLine());
//gridSquare1.setText(textReader.readLine());
}
if (x == 3)
{
antenna.setText(textReader.readLine());
//antenna1.setText(textReader.readLine());
}
if (x == 4)
{
elevation.setText(textReader.readLine());
//elevation1.setText(textReader.readLine());
}
if (x == 5)
{
//if (("propagation") !=passwordFTP)
passwordFTP = (textReader.readLine());
//else
}
}
} //end if
if ((jTabbedPaneGraphics.getSelectedIndex()) == 1 ) //0 = graph, 1 = map
{
for (x=0; x < numberOfLines; x++) {
if (x == 1)
{
//callSign1.setText(textReader.readLine());
//callSign1.setText(textReader.readLine());
}
if (x == 2)
{
//gridSquare1.setText(textReader.readLine());
//gridSquare1.setText(textReader.readLine());
}
if (x == 3)
{
///antenna1.setText(textReader.readLine());
//antenna1.setText(textReader.readLine());
}
if (x == 4)
{
//elevation1.setText(textReader.readLine());
//elevation1.setText(textReader.readLine());
}
if (x == 5)
{
//if (("propagation") !=passwordFTP)
passwordFTP = (textReader.readLine());
//else
}
}
}//end if
}
catch (IOException e)
{
JOptionPane.showMessageDialog(null,"No user file found! "+"\n"
+ "The RF-Viewer will start with default setting! "+"\n"
+ ""+"\n"
+ System.getProperty("user.home") + "/MDSR_SA");
File dir = new File(System.getProperty("user.home") + "/MDSR_SA");
dir.mkdir();
saveUserParameters();
return ;
}
if ((jTabbedPaneGraphics.getSelectedIndex()) == 2 ) //0 = graph, 1 = map 2 = LTA
{
//update legend data
DecimalFormat twoDForm = new DecimalFormat("#.##"); //reduce accuracy to 2 digits
callSignLTA.setText(callSign.getText());
gridSquareLTA.setText(twoDForm.format(Double.valueOf(locRFS_Lat.getText())) + " / " + (twoDForm.format(Double.valueOf(locRFS_Lon.getText()))));
antennaLTA.setText(antenna.getText());
elevationLTA.setText(elevation.getText());
}
//System.out.println("PW is " + passwordFTP);
}
public static void saveUserParameters() {
try {
BufferedWriter out = new BufferedWriter(new FileWriter((System.getProperty("user.home"))+ "/MDSR_SA/RFV_User.cfg"));
out.write (callSign.getText());
out.newLine();
out.write (locRFS_Lat.getText());
out.newLine();
out.write (antenna.getText());
out.newLine();
out.write (elevation.getText());
out.newLine();
out.write (passwordFTP);
out.newLine();
//out.write (ftpDirectory.getText());
//out.newLine();
//out.write (ftpUserName.getText());
//out.newLine();
//out.write (ftpPassWord.getText());
out.close();
}
catch (IOException e)
{
JOptionPane.showMessageDialog(null,"Can not find the user setup file.");
}
return ;
}
private static boolean netIsAvailable() {
try {
final URL url = new URL("http://www.google.com");
final URLConnection conn = url.openConnection();
conn.connect();
conn.getInputStream().close();
return true;
} catch (MalformedURLException e) {
throw new RuntimeException(e);
} catch (IOException e) {
return false;
}
}
private static void netSpeed() {
//events.setSelectedIndex(2); //data event
NW_events.setText(""); //clear last event
if(netIsAvailable()==(true))
{
//netAvail.setText("Serv");
String ip = "ftp.qsl.net"; //ftpServer.getText();
String pingResult = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String time = sdf.format(new Date());
String pingCmd = "ping " + ip + " -c 1"; //ping once
NW_events.append(sdf.format(new Date()) + "\n"); // display time
for (int b = 1; b <= 5; b++) //ckeck network 5 times for timeout
{
try {
Thread.sleep(100);
}
catch (InterruptedException e) {
}
try {
Runtime r = Runtime.getRuntime();
Process p = r.exec(pingCmd);
BufferedReader in = new BufferedReader(new
InputStreamReader(p.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null) {
NW_events.append(inputLine+ "\n");
//ftpActivity.append(inputLine + "\n");
//if(inputLine.startsWith("Name"))
//NW_Event.append("Name or service not known"+ "\n");
if(inputLine.startsWith("64 bytes"))
{
NW_events.append("Network Speed: "+(inputLine.substring(67, 71))+" mS"+ "\n");//filter delay time
//b = 5; //end loop
}
pingResult = inputLine;
}
if ("".equals(pingResult))
NW_events.append(ip +" timed out"+ "\n");
in.close();
} catch (IOException e) {
System.out.println(e);
NW_events.append("Server not avilable"+ "\n");
}
} // end for loop
}
else
NW_events.append("Server can not be reached - no Internet"+ "\n");
//JOptionPane.showMessageDialog(null,"Network or Server down");
}
public void getRemoteArchive(){
String host = "ftp.qsl.net";
int port = 21;
String filename = "VE7DXWArchiveData.zip";
String username = "rf-seismograph";
String encrPW = "RMXxqQL2";
String source = "/uploads/currentData/VE7DXWArchiveData.zip";
String destination = (System.getProperty("user.home"))+"/MDSR_SA/archivedData/";
//implement this code: use user.config part 1
if (passwordFTP.equals("propagation")) //password "propagation is translated
passwordFTP = encrPW;
NW_events.setText (""); //clear screen
NW_events.append("Downloading Archive file... "+ "\n");
File dir = new File(destination); //check if directory exists, if not create
if(!dir.exists()) dir.mkdirs();
FileInputStream fis;
FTPClient ftp = null;
try {
ftp = new FTPClient();
System.setProperty("org.apache.commons.logging.Log",
"org.apache.commons.logging.impl.NoOpLog");
//logging.level.org.apache.ftp=DEBUG;
ftp.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out)));
int reply;
ftp.connect(host,port); //reverse for W10
//println("FTP URL is:"+ftp.getRemoteAddress()+ "\n");
NW_events.append("FTP URL is:"+ftp.getRemoteAddress()+ "\n");
reply = ftp.getReplyCode();
//NW_Event.append(Integer.toString(reply)+ "\n");
if (!FTPReply.isPositiveCompletion(reply)) {
ftp.disconnect();
//throw new Exception("Exception in connecting to FTP Server");
}
ftp.login(username, passwordFTP);
ftp.setFileType(FTP.BINARY_FILE_TYPE);
ftp.enterLocalPassiveMode();
} catch (IOException ex) {
//System.out.println("Error: " + ex.getMessage());
NW_events.append("Error: " + ex.getMessage()+ "\n");
//ex.printStackTrace();
}
// Download the FTP File from the FTP Server
try (FileOutputStream fos = new FileOutputStream(destination + filename)) {
ftp.retrieveFile(source, fos);
} catch (IOException e) {
//e.printStackTrace();
JOptionPane.showMessageDialog(null,"File download failed");
}
if( encrPW.equals(passwordFTP))
passwordFTP = "propagation"; //hide PW
}
public void UnzipFiles(){
// checking for file size to prevent ZIP from running when file download failed
File filePost = new File(System.getProperty("user.home") + "/MDSR_SA//archivedData/VE7DXWArchiveData.zip");
double bytesZIP = filePost.length();
System.out.println("ZIP file size , kB :"+bytesZIP / 1024);
if(bytesZIP > 8000.0)
{
String zipFilePath = (System.getProperty("user.home"))+"/MDSR_SA/archivedData/VE7DXWArchiveData.zip";
String destDir = (System.getProperty("user.home"))+"/MDSR_SA/archivedData";
File dir = new File(destDir);
// create output directory if it doesn't exist
if(!dir.exists()) dir.mkdirs();
FileInputStream fis;
//buffer for read and write data to file
byte[] buffer = new byte[1024];
try {
fis = new FileInputStream(zipFilePath);
ZipInputStream zis = new ZipInputStream(fis);
ZipEntry ze = zis.getNextEntry();
while(ze != null){
String fileName = ze.getName();
File newFile = new File(destDir + File.separator + fileName);
//System.out.println("Unzipping to "+newFile.getAbsolutePath()+ "\n");
NW_events.append("Unzipping to "+newFile.getAbsolutePath()+ "\n");
//create directories for sub directories in zip
new File(newFile.getParent()).mkdirs();
FileOutputStream fos = new FileOutputStream(newFile);
int len;
while ((len = zis.read(buffer)) > 0) {
fos.write(buffer, 0, len);
}
fos.close();
//close this ZipEntry
zis.closeEntry();
ze = zis.getNextEntry();
}
//close last ZipEntry
zis.closeEntry();
zis.close();
fis.close();
} catch (IOException e) {
//e.printStackTrace();
}
NW_events.append("Unzipping completed sucessfully "+"\n");
} //end if filesize check
else
NW_events.append("Unzipping failed due to file error"+"\n");
}
public void readUsers(){
String currentLine;
try {
FileReader fr = new FileReader (System.getProperty("user.home")+ "/MDSR_SA/RFV_Users.csv");
BufferedReader textReader = new BufferedReader(fr);
int numberOfLines = 250;
//String[] textData = new String [numberOfLines];
int x;
//if ((jTabbedPaneGraphics.getSelectedIndex()) == 0 ) //0 = graph, 1 = map
{
for (x=0; x < numberOfLines; x++) {
String[] splitLines = new String [250];
currentLine = (textReader.readLine());
if(currentLine == (null))
break;
if(currentLine.contains(String.valueOf(callSignDatatoDisplay.getSelectedItem())))
{
splitLines = (currentLine.split(",")); //remove "," and split
//name.setText(splitLines[0]);
callSign.setText(splitLines[1]);
locRFS_Lat.setText(splitLines[2]);
locRFS_Lon.setText(splitLines[3]);
antenna.setText(splitLines[4]);
elevation.setText(splitLines[5]);
//localTime.setText(splitLines[6]);
}
//System.out.println (splitLines[1]);
}
}} catch (IOException e)
{
JOptionPane.showMessageDialog(null,"File(s) not found" + "\n"
+ "If you are just settting up RF-V, move the files that are in the" + "\n"
+ "Copy to MDSR_SA folder attached to the download "+ "\n"
+ "to the new "+ (System.getProperty("user.home")) + "/MDSR_SA folder on your computer");
File dir = new File(System.getProperty("user.home") + "/MDSR_SA");
dir.mkdir();
saveUserParameters();
return ;
}
}
public void propagationMap() {
double lonSpanCorrection = 2.36;
int lonOffsetCorrection =403;
double latSpanCorrection = 2.77;
int latOffsetCorrection = 257;
//not working yet idea to show all the quakes when in AVG
//if(LongTimeAverageCal.hasFocus()==(true))
Graphics gfx1 = worldMap.getGraphics();
String callsign = (String.valueOf(callSignDatatoDisplay.getSelectedItem()));
if(CheckBoxArchive.isSelected() == false)
drawOnce = (false);
try {
if(drawOnce == (false))
{
Image img = ImageIO.read(new File(System.getProperty("user.home")+ "/MDSR_SA/FlatEarthwithGrid.jpg"));
gfx1.drawImage(img, 0, 0, null);
Image img1 = ImageIO.read(new File(System.getProperty("user.home")+ "/MDSR_SA/USGSLogo.png"));
gfx1.drawImage(img1, 520, 400, null);
drawOnce = true;
}
if(CheckBoxArchive.isSelected()==(true))
drawOnce = true;
//gfx1.drawArc(105, 55, 80, 80, 34, -19);
} catch (IOException iOException) {
JOptionPane.showMessageDialog(null,"No background available or file not found" + "\n"
+ "If you are just settting up RFV move the files that are in the" + "\n"
+ "'Copy to thelocal /MDSR_SA/ folder attached to the download "+ "\n"
+ "to the local MDSR_SA folder on your computer");
}
for (int t=0; t <= timeQuake.length; t++) {
//System.out.println(timeQuake[t]);
String dtEventQuake = timeQuake[t];
if (timeQuake[t] == null) //avoid Nullpointer error
{
//setCursor(Cursor.DEFAULT_CURSOR);
break;
}
{
//move quakes that occur at the same minute one minute downdown
//if(displayTimeMarker[i] == displayTimeMarker[i-1])
{
//System.out.println("dup ");
//displayQuakesMagnitude[i+1] = magQuake[t];
//isplayPlaceQuake[i+1] = placeQuakeLocation[t] +"," + placeQuakeState[t];
//displayPlaceLongLat[i+1] = latitudeQuake[t] +", " + longitudeQuake[t];
}
if (magQuake[t] >= (Double.parseDouble(String.valueOf(listThresh.getSelectedItem()))))
{
displayQuakesMagnitude[i] = magQuake[t];
displayPlaceQuake[i] = placeQuakeLocation[t] +"," + placeQuakeState[t];
displayPlaceLongLat[i] = latitudeQuake[t] +", " + longitudeQuake[t];
//System.out.println(displaySSI_CH1[i]);[t];
gfx1.setColor(Color.magenta);
if (magQuake[t] < 6.5)
gfx1.setColor(Color.red);
if (magQuake[t] <= 4.5)
gfx1.setColor(Color.green);
gfx1.fillOval((int)(longitudeQuake[t]*lonSpanCorrection + lonOffsetCorrection),-(int)(latitudeQuake[t]* latSpanCorrection)+latOffsetCorrection, (int)(magQuake[t])*3, (int)(magQuake[t])*3); //x, y,
//System.out.println((int)latitudeQuake[t] +","+(int)longitudeQuake[t]);
}
TotalEnergy.setText(" Total E.: "+ (String.format ("%.2f",(totalEng)))+" GJ");
//Load path
//gfx1.drawString("80 m",50, 470);
}
//Date date = format.parse(dtEvent);
} //end loop t
drawOnce = true;
if(band[i] != "") // prevent ooB
{
for (int p=0; p < 10000 ; p++) { //timeWSPR.length
//System.out.println("Band " + band[p] + " count: " + p);
if(rx_lon[p] == 0) //aviod outofB
break;
//double inRadians = Math.toRadians(inDegrees);
//gfx1.setColor(Color.black);
//RX: -49.33,-123 to TX 0,0
int maxSplit = 2;
//int lonDiffSeg = (int)(rx_lon[p] - tx_lon[p] ) ;
//int latDiffSeg = (int)(rx_lat[p] - tx_lat[p] ) ;
//if(tx_lat[p] > rx_lat[p])
//azimuth[p] = azimuth[p] - 180; // when TX is east of RX to provide correct baring
//double sinCal = (Math.sin(azimuth[i]));
//double cosCal = (Math.cos(azimuth[i]));
//double lonCalValueSegPix = (longPathSeg * (Math.sin(Math.toRadians(azimuth[p]) * lonSpanCorrection + lonOffsetCorrection) / 48)); //pixels per km
//double latCalValueSegPix = (longPathSeg * (Math.cos(Math.toRadians(azimuth[p]) * latSpanCorrection + latOffsetCorrection) / 79)); //pixels per km
//double latCalValueSeg = (longPathSeg * latSpanCorrection + latOffsetCorrection) * (Math.cos(Math.toRadians(azimuth[p] )) / 79); //79
//int latPointSeg;
//(rx_lon[t] - tx_lon[t])/10
//(rx_lat[t] - tx_lat[t])/10
//for (int i=1; i <= maxSplit + 1; i++)
{}
//lonPointSeg = (int)rx_lon[p] - (lonDiffSeg *i);
//latPointSeg = (int)rx_lat[p] - (latDiffSeg *i);
//int lonPointSegPre = (int)rx_lon[p] - (lonDiffSeg * (i - 1 ));
//int latPointSegPre = (int)rx_lat[p] - (latDiffSeg * (i - 1 ));
//gfx1.setColor(Color.yellow);
//show azimuth angle for each station
//gfx1.drawLine ((int)(rx_lon[p] *lonSpanCorrection + lonOffsetCorrection), (-(int)(rx_lat[p] * latSpanCorrection)+latOffsetCorrection),
//(int)(azimuth[p]), -(int)(tx_lat[p]* latSpanCorrection)+latOffsetCorrection);
gfx1.setColor(Color.green); //location marker
gfx1.drawOval((int)(rx_lon[p] *lonSpanCorrection + lonOffsetCorrection), (-(int)(rx_lat[p] * latSpanCorrection)+latOffsetCorrection), 5, 5);
gfx1.setColor(Color.red);
gfx1.drawOval((int)(tx_lon[p] *lonSpanCorrection + lonOffsetCorrection), (-(int)(tx_lat[p] * latSpanCorrection)+latOffsetCorrection), 5, 5);
//band[p]= "20m"; //testing only
//System.out.println(band[p]);
//if(band[p]< 3))
//if (distance[p] < 2000) //straight pass only
{
//gfx1.drawLine ((int)(rx_lon[p] *lonSpanCorrection + lonOffsetCorrection), (-(int)(rx_lat[p] * latSpanCorrection)+latOffsetCorrection), //correct draw for short path
//(int)(tx_lon[p] * lonSpanCorrection + lonOffsetCorrection), -(int)(tx_lat[p] * latSpanCorrection) + latOffsetCorrection);
}
gfx1.setColor(Color.gray);
int lenghtOfPathPixel = (distance[p]/60) ; //average lentgh of path
int RX_locPixLon = (int)(rx_lon[p] *lonSpanCorrection + lonOffsetCorrection);
int RX_locPixLat = (-(int)(rx_lat[p] * latSpanCorrection)+latOffsetCorrection); // - is required
int TX_locPixLon = (int)(tx_lon[p] *lonSpanCorrection + lonOffsetCorrection);
int TX_locPixLat = (-(int)(tx_lat[p] * latSpanCorrection)+latOffsetCorrection);
int centerOfPathLonTX;
int centerOfPathLatTX;
int centerOfPathLonRX;
int centerOfPathLatRX;
int corrToPixelLon = (int)(lonSpanCorrection + lonOffsetCorrection);
int corrToPixelLat = (int)(latSpanCorrection + latOffsetCorrection);
if (distance[p] < 3000) //limmit for short pass if changing also change long pass to match
{
//System.out.println(p + bandM[p] + " shortpass " + distance[p]);
gfx1.setColor(Color.lightGray);
if(bandM[p].equals("80m"))
{
gfx1.setColor(Color.red);
gfx1.drawLine (RX_locPixLon, RX_locPixLat, TX_locPixLon, TX_locPixLat);
}
if(bandM[p].equals("60m"))
{
gfx1.setColor(Color.green);
gfx1.drawLine (RX_locPixLon, RX_locPixLat, TX_locPixLon, TX_locPixLat);
}
if(bandM[p].equals("40m"))
{
//System.out.println(bandM[p] + " selected 40m " + p);
gfx1.setColor(Color.green);
//gfx1.drawString("40m",RX_locPixLon, RX_locPixLat);
gfx1.drawLine (RX_locPixLon, RX_locPixLat, TX_locPixLon, TX_locPixLat);
}
if(bandM[p].equals("30m"))
{
gfx1.setColor(Color.yellow);
gfx1.drawLine (RX_locPixLon, RX_locPixLat, TX_locPixLon, TX_locPixLat);
}
if(bandM[p].equals("20m"))
{
gfx1.setColor(Color.magenta);
//gfx1.drawString("20m",RX_locPixLon, RX_locPixLat);
gfx1.drawLine (RX_locPixLon, RX_locPixLat, TX_locPixLon, TX_locPixLat);
}
if(bandM[p].equals("17m"))
{
gfx1.setColor(Color.magenta);
gfx1.drawLine (RX_locPixLon, RX_locPixLat, TX_locPixLon, TX_locPixLat);
}
if(bandM[p].equals("15m"))
{
gfx1.setColor(Color.cyan);
gfx1.drawLine (RX_locPixLon, RX_locPixLat, TX_locPixLon, TX_locPixLat);
}
if(bandM[p].equals("12m"))
{
gfx1.setColor(Color.cyan);
gfx1.drawLine (RX_locPixLon, RX_locPixLat, TX_locPixLon, TX_locPixLat);
}
if(bandM[p].equals("10m"))
{
gfx1.setColor(Color.pink);
gfx1.drawLine (RX_locPixLon, RX_locPixLat, TX_locPixLon, TX_locPixLat);
}
//else // does not work
{
// gfx1.setColor(Color.lightGray);//System.out.println(band[p] + " " + p);
//gfx1.drawLine (RX_locPixLon, RX_locPixLat, TX_locPixLon, TX_locPixLat);
}
} //end if
if (distance[p] >= 3000) //approximate cuved path disabled should state 2000
{ // ends at the bottom
centerOfPathLonTX = TX_locPixLon - ((RX_locPixLon + TX_locPixLon) / 2); //referenced from TX location
centerOfPathLatTX = TX_locPixLat - ((RX_locPixLat + TX_locPixLat) / 2);
centerOfPathLonRX = RX_locPixLon - ((RX_locPixLon + TX_locPixLon) / 2); //referenced from RX location
centerOfPathLatRX = RX_locPixLat - ((RX_locPixLat + TX_locPixLat) / 2);
int pathLonPix = (int)((distance[p] * Math.cos(Math.toRadians(azimuth[p]))) /24); /// 48; //avage of 48 km per pixel long
int pathLatPix = (int)((distance[p] * Math.sin(Math.toRadians(azimuth[p]))) / 40); // / 79;
// gfx1.drawArc (TX_locPixLon - centerOfPathlonRX, TX_locPixLat - centerOfPathlatRX,
//TX_locPixLon - centerOfPathlonTX * lenghtOfPathPixel, TX_locPixLat - centerOfPathlatTX * lenghtOfPathPixel
//, 0, 180);
System.out.println("Cos " + Math.cos(Math.toRadians(azimuth[p])) + " PathL " + lenghtOfPathPixel + "D in km " + distance[p]);
if(pathLatPix < 0)
System.out.println(p + " smaller than 0; Lat Pix " + pathLatPix + " RX Lat " + rx_lat[p] + " TX Lat " + tx_lat[p]);
if(pathLatPix < 0)
System.out.println(p + " smaller than 0; Lon Pix " + pathLonPix + " RX Lon " + rx_lon[p]+ " TX Lon " + tx_lon[p]);
else
{
System.out.println(p + " Lat Pix " + pathLatPix + " RX Lat " + rx_lat[p] + " TX Lat " + tx_lat[p]);
System.out.println(p + " Lon Pix " + pathLonPix + " RX Lon " + rx_lon[p]+ " TX Lon " + tx_lon[p]);
}
//xy location,Long,Lat
//if (tx_lat[p] > rx_lat[p]) //check for neg numbers
{
{
if (pathLonPix > 0) //check for neg numbers
//if (tx_lon[p] < rx_lon[p])
{
gfx1.setColor(Color.green);
//gfx1.drawRect(TX_locPixLon, TX_locPixLat, RX_locPixLon - TX_locPixLon, RX_locPixLat - TX_locPixLat);
//correc for RX in east
//gfx1.drawArc (RX_locPixLon, RX_locPixLat, TX_locPixLon - RX_locPixLon, TX_locPixLat - RX_locPixLat, 0, 90);
//drawArc(int x, int y, int width, int length, int startAngle, int arcAngle)
System.out.println("Location of Arc: " + TX_locPixLon + "TX Lon Pix " + TX_locPixLat + " TX Lat Pix " ); //, RX_locPixLon - TX_locPixLon, RX_locPixLat - TX_locPixLat);
if (tx_lon[p] < rx_lon[p]) //for RX in east no arc drawn TX in east arc works
{
//gfx1.drawArc (RX_locPixLon, RX_locPixLat, TX_locPixLon - RX_locPixLon, TX_locPixLat - RX_locPixLat, 0, 90);
gfx1.drawArc (TX_locPixLon, TX_locPixLat, TX_locPixLon - RX_locPixLon, RX_locPixLat - TX_locPixLat, 0, 90);
gfx1.drawOval(TX_locPixLon - centerOfPathLonTX, TX_locPixLat - centerOfPathLatTX,4,4);
System.out.println("W and L of Arc: " + (TX_locPixLon - RX_locPixLon) + "length" + (TX_locPixLat - RX_locPixLat));
//Main straight pass
gfx1.setColor(Color.blue);
gfx1.drawLine (RX_locPixLon, RX_locPixLat, TX_locPixLon, TX_locPixLat);//correct draw for short path
}
else
{
gfx1.drawArc (RX_locPixLon, RX_locPixLat, TX_locPixLon - RX_locPixLon, TX_locPixLat - RX_locPixLat, 0, 90);
gfx1.drawLine (TX_locPixLon, TX_locPixLat,TX_locPixLon,TX_locPixLat - centerOfPathLatTX);
gfx1.drawLine (RX_locPixLon, RX_locPixLat,RX_locPixLon - centerOfPathLonRX ,RX_locPixLat ); //is green
System.out.println("RX in West of TX");
}
}
}
/**
if(pathLonPix < 0)
{
//else
{
gfx1.setColor(Color.orange);
gfx1.drawLine (TX_locPixLon, TX_locPixLat,TX_locPixLon,TX_locPixLat - centerOfPathLatTX);
gfx1.drawLine (RX_locPixLon, RX_locPixLat,RX_locPixLon - centerOfPathLonRX,RX_locPixLat );
//gfx1.drawRect(RX_locPixLon, RX_locPixLat, TX_locPixLon - RX_locPixLon, TX_locPixLat - RX_locPixLat);
gfx1.drawArc (RX_locPixLon, RX_locPixLat, TX_locPixLon - RX_locPixLon, TX_locPixLat - RX_locPixLat, 180, 90);
//correct for RX west of TX - not correct for steep angles
//TX in east arc works if path is droppin but not when
//if (tx_lon[p] > rx_lon[p])
//gfx1.drawArc (RX_locPixLon, RX_locPixLat, TX_locPixLon - RX_locPixLon, TX_locPixLat - RX_locPixLat, 0, 90);
} **/
gfx1.setColor(Color.blue);
//draw circle in center of path
gfx1.drawOval(TX_locPixLon - centerOfPathLonTX, TX_locPixLat - centerOfPathLatTX,4,4);
//(x,y coordinates, width,heigth and start and end of arc
//gfx1.drawArc ((int)(tx_lon[p] * lonSpanCorrection + lonOffsetCorrection), (int)(centerOfPathlat - 2 * (latCalValueSeg)), (int)(centerOfPathlat - latCalValueSeg), (int)(centerOfPathlon + lonCalValueSeg), 0, 180);
//gfx1.drawOval((int)(tx_lon[p] * lonSpanCorrection + lonOffsetCorrection) , (int)(centerOfPathlat + latCalValueSeg ), 4, 4);
//gfx1.
//gfx1.setColor(Color.blue);
//(int)(tx_lon[p] * lonSpanCorrection + lonOffsetCorrection), -(int)(tx_lat[p] * latSpanCorrection) + latOffsetCorrection);
//gfx1.setColor(Color.orange);
//gfx1.drawLine (TX_locPixLon, TX_locPixLat,TX_locPixLon - centerOfPathlonTX, TX_locPixLat - centerOfPathlatTX);
System.out.println(p +" center lon: " + centerOfPathLonTX + " lat: " + centerOfPathLatTX);
//}
//JOptionPane.showMessageDialog(null,"Dist: " + distance[p] + " " + "Location of Arc: " + TX_locPixLon + "TX Lon Pix " + TX_locPixLat + " TX Lat Pix " );
} //end if
System.out.println(p +" TX loc lon: " + TX_locPixLon );//+ (int)(tx_lon[p] * lonSpanCorrection + lonOffsetCorrection));
System.out.println(p +" TX loc lat: " + TX_locPixLat);//(int)(tx_lat[p] * latSpanCorrection + latOffsetCorrection));
System.out.println(p +" RX loc lon: " + RX_locPixLon);//(int)(rx_lon[p] * lonSpanCorrection + lonOffsetCorrection));
System.out.println(p +" RX loc lat: " + RX_locPixLat);//(int)(rx_lat[p] * latSpanCorrection + latOffsetCorrection));
//Angle in Radians × 180°/π = Angle in Degrees
//System.out.println(p +" Cal Angle: " + (Math.tan(latCalValueSegPix / lonCalValueSegPix)) * 180 / 3.1415); //AK/
//println(p +" DataAzm: " + azimuth[p] );
//System.out.println(p + " Pixel Seg lon " + lonCalValueSegPix + "lat " + latCalValueSegPix);
//gfx1.setColor(Color.black);
} //end if
} //end loop
}}
public void getWSPRpropagationData() {
int timeDuration = 0;
int numberLines = 0; //limmit
if((numberRec.getSelectedIndex()) == 0) //0 = 1 1 = 10 2 = 100 3 1000 4 = 10000
numberLines = 1;
if((numberRec.getSelectedIndex()) == 1) //0 = 1 1 = 10 2 = 100 3 1000 4 = 10000
numberLines = 10;
if((numberRec.getSelectedIndex()) == 2) //0 = 1 1 = 10 2 = 100 3 1000 4 = 10000
numberLines = 100;
if((numberRec.getSelectedIndex()) == 3) //0 = 1 1 = 10 2 = 100 3 1000 4 = 10000
numberLines = 1000;
if((numberRec.getSelectedIndex()) == 4) //0 = 1 1 = 10 2 = 100 3 1000 4 = 10000
numberLines = 10000;
if((durationMin.getSelectedIndex()) == 0) //0 = 4 1 = 6 2 = 8 3 = 8 4 = 20
timeDuration = 4;
if((durationMin.getSelectedIndex()) == 1)
timeDuration = 6;
if((durationMin.getSelectedIndex()) == 2)
timeDuration = 8;
if((durationMin.getSelectedIndex()) == 3)
timeDuration = 10;
if((durationMin.getSelectedIndex()) == 4)
timeDuration = 20;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String queryTimeEnd = sdf.format(new Date());
String queryTimeStart = queryTimeEnd;
//add time to the date
Calendar c = Calendar.getInstance();
try {
c.setTime(sdf.parse(queryTimeEnd));
} catch (ParseException ex) {
Logger.getLogger(SeismoViewer.class.getName()).log(Level.SEVERE, null, ex);
}
c.add(Calendar.MINUTE, - timeDuration); // subtrackting duration in min
queryTimeStart = sdf.format(c.getTime()); // sdf is now the new date format
queryTimeStart = queryTimeStart.replace(" ","T"); //adding T seperator required
queryTimeEnd = queryTimeEnd.replace(" ","T"); //adding T seperator required
StyledDocument doc = WSPR.getStyledDocument();
SimpleAttributeSet attributeSet = new SimpleAttributeSet();
//Style style = WSPR.addStyle("MyHilite", null);
StyleConstants.setItalic(attributeSet, true);
MutableAttributeSet attrs = WSPR.getInputAttributes();
StyleConstants.setFontSize(attrs, 9);
StyleConstants.setBackground(attrs, Color.white);
StyleConstants.setForeground(attrs, Color.black);
//WSPR.setText("--------------------------------------------------------------------------------------------------------------------------------------");
//WSPR.setCaret(caret);
WSPR.setCaretPosition(0);
WSPR.replaceSelection("start at: " + queryTimeStart + "---- until : " + queryTimeEnd ); //disply current date and time - endtime of query
//queryTimeStart = "2022-09-16T00:00:00";
//queryTimeEnd = "2022-09-16T00:10:00";
//select count("SNR") from spots where band = '40' and rx_id = 'KPH' and
//tx_call = 'K4APC' and time > '2020-03-25T03:00:00Z' and time < '2020-03-25T15:00:00Z';
//http://db1.wspr.live/?query=SELECT%20*%20FROM%20wspr.rx%20LIMIT%2010;
//where%20time%20"2022-04-01%2000:00:00"<"2022-04-02 00:00:00" and time > '2020-03-25T03:00:00Z'
//working String
//String fromFile = "http://db1.wspr.live/?query=SELECT%20id,time,band,rx_lat,rx_lon,tx_lon,tx_lat,distance,azimuth%20"
String fromFile = "http://db1.wspr.live/?query=SELECT%20*%20"
+ "FROM%20wspr.rx%20where%20time%20>%20'" + queryTimeStart + "'%20and%20time%20<%20'" + queryTimeEnd + "'%20order%20by%20id%20desc%20limit%20" + numberLines + "%20FORMAT%20CSV";
//working string the %20 are neccessary
/**sample
timeWSPR[i] = (hext_Str[1]);
band[i] = (Integer.parseInt(hext_Str[2]));
rx_id[i] = hext_Str[3];
rx_lat[i] = Double.parseDouble (hext_Str[4]);
rx_lon[i] = Double.parseDouble (hext_Str[5]);
rx_grid[i] = hext_Str[6];
tx_lat[i] = Double.parseDouble (hext_Str[8]);
tx_lon[i] = Double.parseDouble (hext_Str[9]);
tx_call[i] = hext_Str[7];
distance[i] = (Integer.parseInt(hext_Str[11]));
azimuth[i] = (Integer.parseInt(hext_Str[12]));
**/
String toFile = (System.getProperty("user.home"))+"/MDSR_SA/"+"WSPR_pathData.csv";
try (BufferedInputStream inputStream = new BufferedInputStream(new URL(fromFile).openStream());
FileOutputStream fileOS = new FileOutputStream(toFile)) {
byte data[] = new byte[1024];
int byteContent;
while ((byteContent = inputStream.read(data, 0, 1024)) != -1) {
fileOS.write(data, 0, byteContent);
//else
if (disableDownloadWSPR != -1) //does not work
inputStream.close();
}
} catch (IOException e) { JOptionPane.showMessageDialog(null,"Error occured as " + e);
}
setCursor(Cursor.DEFAULT_CURSOR);
}
public void readWSPR_Files(){ //read data into table
WSPR.setText("");
//disableDownloadWSPR = -1; // for disable
try {
setCursor(Cursor.WAIT_CURSOR);
FileReader fr = new FileReader (System.getProperty("user.home")+ "/MDSR_SA/"+ "WSPR_pathData.csv");
BufferedReader textReader = new BufferedReader(fr);
String line;
int x = 0;
int numberOfLines = 20000;
String[] hext_Str = new String [numberOfLines];
for (x=0; x < numberOfLines; x++) {
line = textReader.readLine();
try {
if ((line) != null)
{
hext_Str = (line.split(",")); //remove "," and split
if (hext_Str[0] != null)
{
//writing values into fieldsw
id[x] = Double.parseDouble(hext_Str[0].replace("E","0")); //clenup string
timeWSPR[x] = (hext_Str[1]);
band[x] = hext_Str[2];
bandM[x] = "na";
rx_id[x] = hext_Str[3]; //rx callsign
rx_lat[x] = Double.parseDouble (hext_Str[4]);
rx_lon[x] = Double.parseDouble (hext_Str[5]);
rx_grid[x] = hext_Str[6];
tx_call[x] = hext_Str[7];
tx_lat[x] = Double.parseDouble (hext_Str[8]);
tx_lon[x] = Double.parseDouble (hext_Str[9]);
tx_grid[x] = hext_Str[10];
distance[x] = (Integer.parseInt(hext_Str[11]));
azimuth[x] = (Integer.parseInt(hext_Str[12]));
}
}
}
catch (ArrayIndexOutOfBoundsException e) {
System.out.println(x +" Array ot of bounds " );
Logger.getLogger(SeismoViewer.class.getName()).log(Level.SEVERE, null, e);
}
}
}
catch (IOException e)
{
//JOptionPane.showMessageDialog(null,"No temp data file available");
//return ;
}
}
public void DisplayWSPR_data(){
MutableAttributeSet attrs = WSPR.getInputAttributes();
StyledDocument doc = WSPR.getStyledDocument();
//convering band digits to band in M
///(First digit of Frequency) (-1: LF, 0: MF, 1: 160m, 3: 80m, 5: 60m, 7: 40m, 10: 30m, …)
for ( int s=0; s < 20000; s++) {
try
{
for (int t=0; t <= band.length; t++) { //finding highest used array //needs to happen after it is loaded
if(band[t].equals(""))
{
linesOfData = t; //t represent the used arreay lines - i (the count of the list
break;
}
}
//System.out.println("Length of array " + linesOfData);
if(band[s].equals("3"))
{
bandM[s] = "80m";
StyleConstants.setBackground(attrs, Color.red);
StyleConstants.setForeground(attrs, Color.black);
WSPR.replaceSelection("#" + (linesOfData -s )+ " Time" +timeWSPR[ s ] +"Bnd " + bandM[ s ] + " RX " + rx_id[ s ] + rx_grid[ s ] + "Loc " + rx_lat[ s ] + " " + rx_lon[ s ] + " TX " + tx_call[ s ] + tx_grid[ s ] + "Loc " + tx_lat[ s ] + " " + tx_lon[ s ] +"\n");
}
if(band[s].equals("5"))
{
bandM[s] = "60m";
StyleConstants.setBackground(attrs, Color.black);
StyleConstants.setForeground(attrs, Color.green);
WSPR.replaceSelection("#" + (linesOfData - i )+ " Time" +timeWSPR[ s ] +"Bnd " + bandM[ s ] + " RX " + rx_id[ s ] + rx_grid[ s ] + "Loc " + rx_lat[ s ] + " " + rx_lon[ s ] + " TX " + tx_call[ s ] + tx_grid[ s ] + "Loc " + tx_lat[ s ] + " " + tx_lon[ s ] +"\n");
}
if(band[s].equals("7"))
{
bandM[s] = "40m";
StyleConstants.setBackground(attrs, Color.green);
StyleConstants.setForeground(attrs, Color.black);
WSPR.replaceSelection("#" + (linesOfData -s )+ " Time" +timeWSPR[ s ] +"Bnd " + bandM[ s ] + " RX " + rx_id[ s ] + rx_grid[ s ] + "Loc " + rx_lat[ s ] + " "+ rx_lon[ s ] + " TX " + tx_call[ s ] + tx_grid[ s ] + "Loc " + tx_lat[ s ] + " " + tx_lon[ s ] +"\n");
}
if(band[s].equals("10")) //10 is the code for 30 m
{
bandM[ s ] = "30m";
StyleConstants.setForeground(attrs, Color.black);
StyleConstants.setBackground(attrs, Color.yellow);
WSPR.replaceSelection("#" + (linesOfData -s )+ " Time" +timeWSPR[ s ] +"Bnd " + bandM[ s ] + " RX " + rx_id[ s ] + rx_grid[ s ] + "RX-Loc " + rx_lat[ s ] + " "+ rx_lon[ s ] + " TX " + tx_call[ s ] + tx_grid[ s ] + "TX-Loc " + tx_lat[ s ] + " " + tx_lon[ s ] +"\n");
}
if(band[ s ].equals("14"))
{
bandM[ s ] = "20m";
StyleConstants.setForeground(attrs, Color.black);
StyleConstants.setBackground(attrs, Color.magenta);
WSPR.replaceSelection("#" + (linesOfData -s )+ " Time" +timeWSPR[ s ] +"Bnd " + bandM[ s ] + " RX " + rx_id[ s ] + rx_grid[ s ] + "Loc " + rx_lat[ s ] + " " + rx_lon[ s ] + " TX " + tx_call[ s ] + tx_grid[ s ] + "Loc " + tx_lat[ s ] + " " + tx_lon[ s ] +"\n");
}
if(band[ s ].equals("18"))
{
bandM[ s ] = "17m";
StyleConstants.setForeground(attrs, Color.magenta);
StyleConstants.setBackground(attrs, Color.black);
WSPR.replaceSelection("#" + (linesOfData -s )+ " Time" +timeWSPR[ s ] +"Bnd " + bandM[ s ] + " RX " + rx_id[ s ] + rx_grid[ s ] + "Loc " + rx_lat[ s ] + " " + rx_lon[ s ] + " TX " + tx_call[ s ] + tx_grid[ s ] + "Loc " + tx_lat[ s ] + " " + tx_lon[ s ] +"\n");
}
if(band[ s ].equals("21"))
{
bandM[ s ] = "15m";
StyleConstants.setForeground(attrs, Color.black);
StyleConstants.setBackground(attrs, Color.cyan);
WSPR.replaceSelection("#" +(linesOfData -s )+ " Time" +timeWSPR[ s ] +"Bnd " + bandM[ s ] + " RX " + rx_id[ s ] + rx_grid[ s ] + "Loc " + rx_lat[ s ] + " " + rx_lon[ s ] + " TX " + tx_call[ s ] + tx_grid[ s ] + "Loc " + tx_lat[ s ] + " " + tx_lon[ s ] +"\n");
}
if(band[ s ].equals("24"))
{
bandM[ s ] = "12m";
StyleConstants.setForeground(attrs, Color.cyan);
StyleConstants.setBackground(attrs, Color.black);
WSPR.replaceSelection("#" + (linesOfData -s )+ " Time" +timeWSPR[ s ] +"Bnd " + bandM[ s ] + " RX " + rx_id[ s ] + rx_grid[ s ] + "Loc " + rx_lat[ s ] + " " + rx_lon[ s ] + " TX " + tx_call[ s ] + tx_grid[ s ] + "Loc " + tx_lat[ s ] + " " + tx_lon[ s ] +"\n");
}
if(band[ s ].equals("28"))
{
bandM[ s ] = "10m";
StyleConstants.setForeground(attrs, Color.black);
StyleConstants.setBackground(attrs, Color.pink);
WSPR.replaceSelection("#" + (linesOfData -s )+ " Time" +timeWSPR[ s ] +"Bnd " + bandM[ s ] + " RX " + rx_id[ s ] + rx_grid[ s ] + "Loc " + rx_lat[ s ] + " "+ rx_lon[ s ] + " TX " + tx_call[ s ] + tx_grid[ s ] + "Loc " + tx_lat[ s ] + " " + tx_lon[ s ] +"\n");
}
if(band[ s ].equals("50"))
{
bandM[ s ] = "6m ";
StyleConstants.setForeground(attrs, Color.white);
StyleConstants.setBackground(attrs, Color.black);
WSPR.replaceSelection("#" + (linesOfData -s )+ " Time" +timeWSPR[ s ] +"Bnd " + bandM[ s ] + " RX " + rx_id[ s ] + rx_grid[ s ] + "RX-Loc " + rx_lat[ s ] + " "+ rx_lon[ s ] + " TX " + tx_call[ s ] + tx_grid[ s ] + "TX-Loc " + tx_lat[ s ] + " " + tx_lon[ s ] +"\n");
}
if (band[ s ].equals ("null"))
break; //to avoid overshooting the array //to avoid overshooting the array
//System.out.println(id[i] + timeWSPR[i] +"Bnd " + bandM[i] + " Call " + rx_id[i] + " Gd " + rx_grid[i] + " Loc" + rx_lat[i]+ rx_lon[i] +tx_call[i] + " Call " + tx_call[i] + " Gd " + tx_grid[i] + " Loc " + tx_lat[i]+ tx_lon[i] + " Dist. "+ distance[i] + "km Azm " + azimuth[i] +"\n");
//if not null
}
catch (ArrayIndexOutOfBoundsException e) {
System.out.println(i +" Array ot of bounds " );
Logger.getLogger(SeismoViewer.class.getName()).log(Level.SEVERE, null, e);
}
}
}
public void getLTA(){
//clearLTAData();
//println("empty:" + LTAdisplaySSI_CH1[3]);
//redrawGraphics();
varDir ="/MDSR_SA/";
if (jComboBoxDataFileSelect.getSelectedItem() != (null))
{
if (jComboBoxDataFileSelect.getSelectedItem() != "sorted by date")
{
try
{
if(CheckBoxArchive.isSelected() == true)
{
String[] var = null;
varDir ="/MDSR_SA/archivedData/";
if (jComboBoxDataFileSelect.getSelectedItem() == (""))
{
jComboBoxDataFileSelect.setSelectedIndex(0);
//System.out.println("empty");
//getRemoteFilePerDate();
}
}
if(CheckBoxoldDataMode.isSelected() == true)
{
String[] var = null;
varDir ="/MDSR_SA/archivedData/oldData/";
}
for (int l=0; l <= jComboBoxDataFileSelect.getItemCount() - 2; l++) // file selection loop - 2 is iffy
{
jComboBoxDataFileSelect.setSelectedIndex(l);
if (itemCountLTA < totalFilesForAvr)
{
JOptionPane.showMessageDialog(null,"only found " + itemCountLTA + " sets of data. Not enoungh data files in the DataArchive folder");
break; //exit loop fix error by disabling the buttton
}
//System.out.println("number of files: "+l);
if (l == totalFilesForAvr) //50 records for runing averge of 50 day
{
itemCountLTA = l;
break; //exit loop
}
redrawGraphics();
totalEng = totalEng + (Math.pow(10,1.5 * magQuake[l] + 4.4) / 1000000000); //display in GW
//System.out.println("Item Processed: "+jComboBoxDataFileSelect.getSelectedItem());
//System.out.println(jComboBoxLoadData.getItemCount());
//JOptionPane.showMessageDialog(null,"selected one day");
//File dir = new File(System.getProperty("user.home") + varDir);
//System.out.println(jComboBoxLoadData.getSelectedItem() );
FileReader fr = new FileReader (System.getProperty("user.home")+ varDir+ jComboBoxDataFileSelect.getSelectedItem());
BufferedReader textReader = new BufferedReader(fr);
String line;
int x = 0;
int numberOfLines = 1651;//biggest number of lines is 1650
String[] hext_Str = new String [numberOfLines];
for (x=0; x < numberOfLines; x++) {
line = textReader.readLine();
try {
if ((line) != null)
{
hext_Str = (line.split(",")); //remove "," and split
//System.out.println(hext_Str[0]);
//if (hext_Str[0].equals ("EOF")) //removing EOF
//hext_Str[0] = null;
if (hext_Str[0].equals ("null")) //removing EOF
break;
if (hext_Str[0].equals ("timestamp")) //removing data header
{
//OptionPane.showMessageDialog(null,"Data error - removing Header Line! Please wait...");
hext_Str[0] = null; //hext_Str[1] = null; hext_Str[2] = null; hext_Str[3] = null;
//hext_Str[4] = null;hext_Str[5] = null;hext_Str[6] = null;
//i = i - 1;
}
if (hext_Str[0] != null) // stop at the end of the string
{
//if (LTAdisplaySSI_CH1[1650] == 0) // only add this once does not work
{
LTAdisplayTimeMarker[x] = (hext_Str[0]);
LTAdisplaySSI_CH1[x] = (LTAdisplaySSI_CH1[x] + Double.parseDouble (hext_Str[1]) * -1); // * - 1 to creat a postive number for dispaly
LTAdisplaySSI_CH2[x] = (LTAdisplaySSI_CH2[x] + Double.parseDouble (hext_Str[2]) * -1);
LTAdisplaySSI_CH3[x] = (LTAdisplaySSI_CH3[x] + Double.parseDouble (hext_Str[3]) * -1);
LTAdisplaySSI_CH4[x] = (LTAdisplaySSI_CH4[x] + Double.parseDouble (hext_Str[4]) * -1);
LTAdisplaySSI_CH5[x] = (LTAdisplaySSI_CH5[x] + Double.parseDouble (hext_Str[5]) * -1);
LTAdisplaySSI_CH6[x] = (LTAdisplaySSI_CH6[x] + Double.parseDouble (hext_Str[6]) * -1);
}
//System.out.println(LTAdisplaySSI_CH1[i]);
//System.out.println(max);
displayLastTime = LTAdisplayTimeMarker[x];
//System.out.println(hext_Str[5]);
//Convert DateTime STring to Simple date format
String dtEvent = displayTimeMarker[x]; //"2010-10-15T09:27:37Z";
if(dtEvent.length() < 14)
System.out.println("Date at 5717: " + dtEvent );
else
{
SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd HH:mm:ssZ");
try {
Date date = format.parse(dtEvent);
//if(dtEvent.equals (format.parse("2018-12-24 12:41:19")))
//System.out.println(dtEvent);
} catch (ParseException e) {
e.printStackTrace();
}
//System.out.println(dtEvent);
if (hext_Str[0].equals ("null"))
x = x - 1; //to avoid overshooting the array
if (hext_Str[0].equals ("EOF"))
x = x - 1;
//System.out.println(i +","+displayTimeMarker[i]+","+displaySSI_CH6[i]);
//jMax = i;
//mMax = i;
//mCount = i;
//displayStart = 0;
}}
}
}
catch (ArrayIndexOutOfBoundsException e) {
}
}
} // end of file selection loop
DecimalFormat twoDForm = new DecimalFormat("#.##"); //reduce accuracy to 2 digits
//if(LTAdisplaySSI_CH1[0] == 0) //prevent running again if data is already loaded
{
int max = itemCountLTA; // = (jComboBoxLoadData.getItemCount());
for (int j=0; j < 1651; j++) {
//create average of all files in the archive directory added to previous proced.
LTAdisplaySSI_CH1[j] = Double.valueOf(twoDForm.format(LTAdisplaySSI_CH1[j] / max-1));
LTAdisplaySSI_CH2[j] = Double.valueOf(twoDForm.format(LTAdisplaySSI_CH2[j] / max-1));
LTAdisplaySSI_CH3[j] = Double.valueOf(twoDForm.format(LTAdisplaySSI_CH3[j] / max-1));
LTAdisplaySSI_CH4[j] = Double.valueOf(twoDForm.format(LTAdisplaySSI_CH4[j] / max-1));
LTAdisplaySSI_CH5[j] = Double.valueOf(twoDForm.format(LTAdisplaySSI_CH5[j] / max-1));
LTAdisplaySSI_CH6[j] = Double.valueOf(twoDForm.format(LTAdisplaySSI_CH6[j] / max-1));
}
} // end of IF
}
catch (IOException e)
{
JOptionPane.showMessageDialog(null,"No temp data or archive file available");
return;
}
//return;
}
}
}
public void propagationViewerMatchLTAwithCurrent() {
//compare displayTimeMarker with LTAdisplayTimeMarker
//shift = 0; ////reset shift
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ssZZZZZ"); // iso compliant
Date dateCurr = new Date();
String strDateTime= formatter.format(dateCurr);
//System.out.println(strDateTime);
for (int t=0; t <= 2000; t++) {
//displayTimeMarker[t] = displayTimeMarker[t].replaceAll("/","-"); //to make it ISO compliant
//displayTimeMarker[t] = displayTimeMarker[t].replaceAll(":","T"); //to make it ISO compliant
//LTAdisplayTimeMarker[t] = LTAdisplayTimeMarker[t].replaceAll("/","-"); //to make it ISO compliant
//LTAdisplayTimeMarker[t] = LTAdisplayTimeMarker[t].replaceAll(":","T"); //to make it ISO compliant
//match to current time
//System.out.println(LTAdisplayTimeMarker[t]);
//String LTAd;
if(LTAdisplayTimeMarker[t].length() < 16)
System.out.println("fault: " + LTAdisplayTimeMarker[t]);
else
{
String LTAd = LTAdisplayTimeMarker[t].substring(11,16); //comparing to find match
String dispMk = displayTimeMarker[1].substring(11,16); //fist record of data
//if(dispMk.equals(LTAd)) //match the first data point to the AVG point
{
//shift = t + 35;//avoid the duplicated data
//System.out.println( "equals: " + t);
}
}
}
}
public void clearLTAData() {
int x = 0;
int numberOfLines = 2302;//biggest number of lines is double of 1650
if(LTAdisplaySSI_CH1[3] == 0)
numberOfLines = 1650; //no upper values are loaded
for (x=0; x < numberOfLines; x++) {
LTAdisplayTimeMarker[x] = (null);
LTAdisplaySSI_CH1[x] = 0;
LTAdisplaySSI_CH2[x] = 0;
LTAdisplaySSI_CH3[x] = 0;
LTAdisplaySSI_CH4[x] = 0;
LTAdisplaySSI_CH5[x] = 0;
LTAdisplaySSI_CH6[x] = 0;
}
for (int y=0; y < totalFilesForAvr ; y++) { //
totalEngAVGArr[y] = "";
}
cnt = 0; //reset count
cntTotalEnergy = 0; //reset count
} // end of clearLTAData
public void clearDatatable() {
int x = 0;
int numberOfLines = 1652;//biggest number of lines is double of 1650
for (x=0; x < numberOfLines; x++) {
displayTimeMarker[x] = (null);
displaySSI_CH1[x] = 0;
displaySSI_CH2[x] = 0;
displaySSI_CH3[x] = 0;
displaySSI_CH4[x] = 0;
displaySSI_CH5[x] = 0;
displaySSI_CH6[x] = 0;
}
} // end of clearData
public void propagationViewerLTA() {
//DecimalFormat twoDForm = new DecimalFormat("#.##");
amplification = 4.0;
datePlotLT.setText("Days calculated: " + (itemCountLTA - 1));
TotalEnergyAVG.setText("PWR Quakes: " + (String.format("%.2f",totalEngAVG / 1000000) + " PJ"));
TotalEnergyAVGperDay.setText("AVG PWR: " + (String.format("%.2f",totalEngAVG / 1000/50) + " TJ"));
loadUserParameters();
Graphics gfxLT = propagationViewerLT.getGraphics();
jTabbedPaneGraphics.setSelectedIndex(2); // LTA screen
Y_offsetLTA = (Integer.parseInt(String.valueOf(RF_ViewerOffsetYaxes.getValue()))); //required for 2 h time line
//System.out.println(Integer.parseInt(String.valueOf(RF_ViewerOffsetYaxes.getValue())));
//displayLastTimePre = LTAdisplayTimeMarker[400].substring(0, 10);
//displayLastTime = LTAdisplayTimeMarker[1300].substring(0, 10);
//displayLastTime.substring(0, 10);
//if (displayLastTimePre.equals (displayLastTime)) //change date to avrage interval
{
//displayLastTime = displayLastTime.substring(0, 10);
//datePlotLT.setText("Total Number of Days calculated: " + itemCountLTA); //overcounts needs fix
}
//else
{
//datePlotPreLT.setText("Date: " +displayLastTimePre.replaceAll("/","-") +" UTC");
//datePlotNowLT.setText("Date: " + displayLastTime.replaceAll("/","-") +" UTC");
//datePlot.setText(displayLastTime);
}
//drawing graphic elemets of graphics
gfxLT.setColor(Color.DARK_GRAY); //mask to aviod letters on top of each other
gfxLT.fillRect(0,0, 825, 512);
gfxLT.setColor(Color.LIGHT_GRAY); //grid horiz
gfxLT.drawLine (825, 50, 0, 50);
gfxLT.drawLine (825, 100, 0, 100);
gfxLT.drawLine (825, 150, 0, 150);
gfxLT.drawLine (825, 200, 0, 200);
gfxLT.drawLine (825, 250, 0, 250);
gfxLT.drawLine (825, 300, 0, 300);
gfxLT.drawLine (825, 350, 0, 350);
gfxLT.drawLine (825, 400, 0, 400);
gfxLT.drawLine (825, 450, 0, 450);
//gfxLT.drawLine (2500, 216, 0, 216);
//Legend
//gfxLT.setColor(Color.lightGray);
//gfxLT.drawString("Time of last entry:",600, 448);
//gfxLT.setColor(Color.red);
//gfxLT.drawString(displayLastTime,600, 470);
gfxLT.setColor(Color.red);
gfxLT.fillOval(50, 470, 20, 20);
gfxLT.setColor(Color.lightGray);
gfxLT.drawString("80 m",50, 470);
gfxLT.setColor(Color.green);
gfxLT.fillOval(110, 470, 20, 20);
gfxLT.setColor(Color.lightGray);
gfxLT.drawString("40 m",110, 470);
gfxLT.setColor(Color.yellow);
gfxLT.fillOval(170, 470, 20, 20);
gfxLT.setColor(Color.lightGray);
gfxLT.drawString("30 m",170, 470);
gfxLT.setColor(Color.magenta);
gfxLT.fillOval(230, 470, 20, 20);
gfxLT.setColor(Color.lightGray);
gfxLT.drawString("20 m",230, 470);
gfxLT.setColor(Color.cyan);
gfxLT.fillOval(290, 470, 20, 20);
gfxLT.setColor(Color.lightGray);
gfxLT.drawString("15 m",290, 470);
gfxLT.setColor(Color.pink);
gfxLT.fillOval(350, 470, 20, 20);
gfxLT.setColor(Color.lightGray);
gfxLT.drawString("10 m",350, 470);
//gfxLT.setColor(Color.yellow);
//gfxLT.drawLine(170, 500, 170, 300);
gfxLT.setColor(Color.white);
gfxLT.drawString("> M4.5",400, 480);
gfxLT.setColor(Color.red);
gfxLT.drawString("> M5.9 to 6.5",450, 480);
gfxLT.setColor(Color.magenta);
gfxLT.drawString("> M6.5",540, 480);
String[] interval_1h = new String[]{"00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24"}; //for 6h display
String[] interval_2h = new String[]{"00","02","04","06","08","10","12","14","16","18","20","22","24"}; //for 12h display
String[] interval_4h = new String[]{"00","04","08","12","16","20","24"}; //for 24h display
String[] interval_8h = new String[]{"00","08","16","24"}; //for 48h display
String[] interval_12h = new String[] {"00","12","24"}; //for 72h display
String[] interval_1m = new String[] {"00"}; //for minute display
String[] interval = new String[30];
interval = interval_2h;
displayTime = 1;
String line;
//int i = 0;
//int numberOfLines = 3300;//biggest number of lines is 1650 it is doubled for display
//String[] hext_Str = new String [numberOfLines];
gfxLT.setColor(Color.green);
//temp array for display to prevent data corruption
double[] tempLTAdisplaySSI_CH1 = new double[3500];
double[] tempLTAdisplaySSI_CH2 = new double[3500];
double[] tempLTAdisplaySSI_CH3 = new double[3500];
double[] tempLTAdisplaySSI_CH4 = new double[3500];
double[] tempLTAdisplaySSI_CH5 = new double[3500];
double[] tempLTAdisplaySSI_CH6 = new double[3500];
//temp array for display to prevent data corruption
double[] tempDisplaySSI_CH1 = new double[2000];
double[] tempDisplaySSI_CH2 = new double[2000];
double[] tempDisplaySSI_CH3 = new double[2000];
double[] tempDisplaySSI_CH4 = new double[2000];
double[] tempDisplaySSI_CH5 = new double[2000];
double[] tempDisplaySSI_CH6 = new double[2000];
for (int x=1; x < 1651; x++) {
//if (x > 2) //avoid out of bounds
{
//System.out.println (displayTimeMarker[( i)].substring(11, 13)); //for minutes (14, 16)
if ((Integer.parseInt(displayTimeMarker[(x-1) ].substring(11, 13))) != (Integer.parseInt (displayTimeMarker[x ].substring(11,13))))//hour line at interval
{
for (String interval1 : interval) //
{
if ((displayTimeMarker[x].substring(11, 13)).contains(interval1)) {
//if ((i & 1) == 0) // check if even
{
gfxLT.setColor(Color.orange);
gfxLT.drawLine(x/2, 0, x/2, 500); //vertical time line interval
gfxLT.setColor(Color.blue); //mask to aviod letters on top of each other
gfxLT.fillRect(x/2 + 1,2, 40, 20);
gfxLT.setColor(Color.LIGHT_GRAY);
gfxLT.drawString(displayTimeMarker[x].substring(11,16), x/2 + 5, 16); //only display date and short time
//SA_test.setText (Integer.toString (j));
//SA_test.setText (Integer.toString (timeMarker[j-1].indexOf('P')) +"," + (timeMarker[j].indexOf('P')));
}
}
}
}
}
//}
// for (int x=1; x < 1651; x = x+2) {
if(CheckBoxShowLTA.isSelected())
{
if (x > 2) //avoid out of bounds
{
//time propagation graph CH1
//if (CheckBoxFreq1.isSelected()== true)
{
gfxLT.setColor(Color.red);
tempDisplaySSI_CH1[x] = (displaySSI_CH1[x] * amplification);
gfxLT.drawLine(x/2-1 ,((int)tempDisplaySSI_CH1 [x-1] - Y_offset ),x/2,((int)tempDisplaySSI_CH1[x] - Y_offset ));
}
//time propagation graph CH2
//if (CheckBoxFreq2.isSelected()== true)
{
gfxLT.setColor(Color.green);
tempDisplaySSI_CH2[x] = (displaySSI_CH2[x] * amplification);
gfxLT.drawLine((x/2)-1 ,((int)tempDisplaySSI_CH2 [x-1] - Y_offset ),(x/2),((int)tempDisplaySSI_CH2[x] - Y_offset ));
}
//time propagation graph CH3
//if (CheckBoxFreq3.isSelected()== true)
{
gfxLT.setColor(Color.yellow);
tempDisplaySSI_CH3[x] = (displaySSI_CH3[x] * amplification);
gfxLT.drawLine(x/2-1 ,((int)tempDisplaySSI_CH3 [x-1] - Y_offset ),x/2,((int)tempDisplaySSI_CH3[x] - Y_offset ));
}
//time propagation graph CH4
//if (CheckBoxFreq4.isSelected()== true)
{
gfxLT.setColor(Color.magenta);
tempDisplaySSI_CH4[x] = (displaySSI_CH4[x] * amplification);
gfxLT.drawLine(x/2-1 ,((int)tempDisplaySSI_CH4 [x-1] - Y_offset ),x/2,((int)tempDisplaySSI_CH4[x] - Y_offset ));
}
//time propagation graph CH5
//if (CheckBoxFreq5.isSelected()== true)
{
gfxLT.setColor(Color.cyan);
//displaySSI_CH5[x] = (displaySSI_CH5[x - 2] + displaySSI_CH5[x - 1] + displaySSI_CH5[x] + displaySSI_CH3[x + 1]+ displaySSI_CH5[x + 2] )/5; //avearaging even amd odd lines
tempDisplaySSI_CH5[x] = (displaySSI_CH5[x] * amplification);
gfxLT.drawLine(x/2-1 ,((int)tempDisplaySSI_CH5 [x-1] - Y_offset ),x/2,((int)tempDisplaySSI_CH5[x] - Y_offset ));
}
//time propagation graph CH6
//if (CheckBoxFreq6.isSelected()== true)
{
gfxLT.setColor(Color.pink);
tempDisplaySSI_CH6[x] = (displaySSI_CH6[x] * amplification);
gfxLT.drawLine(x/2-1 ,((int)tempDisplaySSI_CH6 [x-1] - Y_offset ),x/2,((int)tempDisplaySSI_CH6[x] - Y_offset ));
}
}
}
}
boolean runOnce = true;
for (int c = (1 + shift); c <= (1651 + shift ); c++) { //reallenght on one day data - 1635
//time propagation graph CH1
gfxLT.setColor(Color.red);
tempLTAdisplaySSI_CH1[c] = (LTAdisplaySSI_CH1[c] ) * amplification; //
gfxLT.drawLine((c/ 2) - shift / 2,((int)tempLTAdisplaySSI_CH1 [c-1] - Y_offsetLTA ),(c / 2) - shift / 2,((int)tempLTAdisplaySSI_CH1[c] - Y_offsetLTA ));
//gfxLT.drawString(Integer.toString(c/2 - shift / 2), (c/2 - shift / 2) + 5, 100);
//time propagation graph CH2
gfxLT.setColor(Color.green);
tempLTAdisplaySSI_CH2[c] = (LTAdisplaySSI_CH2[c] ) * amplification; //
gfxLT.drawLine((c/ 2) - shift / 2 ,((int)tempLTAdisplaySSI_CH2 [c-1] - Y_offsetLTA ),(c/ 2) - shift / 2,((int)tempLTAdisplaySSI_CH2[c] - Y_offsetLTA ));
//time propagation graph CH3
gfxLT.setColor(Color.yellow);
tempLTAdisplaySSI_CH3[c] = (LTAdisplaySSI_CH3[c] ) * amplification; //
gfxLT.drawLine((c/ 2) - shift / 2 ,((int)tempLTAdisplaySSI_CH3 [c-1] - Y_offsetLTA ),(c/ 2) - shift / 2 ,((int)tempLTAdisplaySSI_CH3[c] - Y_offsetLTA ));
//time propagation graph CH4
gfxLT.setColor(Color.magenta);
tempLTAdisplaySSI_CH4[c] = (LTAdisplaySSI_CH4[c] ) * amplification; //
gfxLT.drawLine((c/ 2) - shift / 2 ,((int)tempLTAdisplaySSI_CH4 [c-1] - Y_offsetLTA ),(c/ 2) - shift / 2,((int)tempLTAdisplaySSI_CH4[c] - Y_offsetLTA ));
//time propagation graph CH5
gfxLT.setColor(Color.cyan);
tempLTAdisplaySSI_CH5[c] = (LTAdisplaySSI_CH5[c] ) * amplification; //
gfxLT.drawLine((c/ 2) - shift / 2,((int)tempLTAdisplaySSI_CH5 [c-1] - Y_offsetLTA ),(c/ 2) - shift / 2,((int)tempLTAdisplaySSI_CH5[c] - Y_offsetLTA ));
//time propagation graph CH6
gfxLT.setColor(Color.pink);
tempLTAdisplaySSI_CH6[c] = (LTAdisplaySSI_CH6[c] ) * amplification; //
gfxLT.drawLine((c/ 2) - shift / 2 ,((int)tempLTAdisplaySSI_CH6 [c-1] - Y_offsetLTA ),(c/ 2) - shift / 2 ,((int)tempLTAdisplaySSI_CH6[c] - Y_offsetLTA ));
//System.out.println ( "Marker from " + c + " Shift is:" + shift + " CH1: " + LTAdisplaySSI_CH1[c]);
//if (LTAdisplaySSI_CH1[c] > 100) //prevent from adding too much amplification after the 1st run
//amplification = 1;
//if(LTAdisplaySSI_CH1[0]==0)
//amplification = 1.0;
//else
//itemCountLTA = (jComboBoxDataFileSelect.getItemCount());
//System.out.println ( c +" countshift "+ (1650 + shift) + " Amp: " + amplification + " " + LTAdisplayTimeMarker[c ] + " " + shift);
}}
public void fileSelectAction()
{
varDir ="/MDSR_SA/";
String varEnd ="";
//clearEarthquakeData();
jTabbedPaneGraphics.setSelectedIndex(1); //set to quake screen
if(CheckBoxArchive.isSelected() == true)
{
//String[] var = null;
varDir ="/MDSR_SA/archivedData/";
jComboBoxEqkData.setSelectedItem("File not found - file selectAction");
jComboBoxEqkData.setSelectedItem((String.valueOf(jComboBoxDataFileSelect.getSelectedItem()).replace("tempData.bak","-USGS2.5_day.csv")));
//varType = varType.replace("csv","bak");
//System.out.println(varType);
//varEnd ="bak";
if(LongTimeAverageCal.isEnabled()==(false)) //only delete if not AVG
listEarthquakes.setText(""); //clear earthquake list
displayQuakes();
if (jComboBoxEqkData.getSelectedItem().equals ("File not found - file SelectAction"))
{
if(LongTimeAverageCal.isEnabled()==(false)) //only delete if not AVG
{
listEarthquakes.setText(""); //clear earthquake list
clearEarthquakeData();
jTabbedPaneGraphics.setSelectedIndex(0);
}
}
}
if(CheckBoxoldDataMode.isSelected() == true)
{
String[] var = null;
varDir ="/MDSR_SA/archivedData/oldData/";
//readEarthquakeUSGSEvent();
//displayQuakes();
//varEnd =".csv";
//System.out.println(varDir);
}
File dir = new File(System.getProperty("user.home") + varDir);
FilenameFilter filter = new FilenameFilter()
{
public boolean accept(File dir, String name)
{
//System.out.println(name);
if(CheckBoxArchive.isSelected() == true)
{
return name.endsWith(".bak");
//return name.substring(0, 12);
}
if(CheckBoxoldDataMode.isSelected() == true)
{
return name.endsWith(".csv");
}
else
return name.endsWith(".csv");
}
};
String[] var = dir.list(filter);
if (var == null)
{
JOptionPane.showMessageDialog(null,"Directory is INCORRECT or does not exist");
}
else
{
if(CheckBoxArchive.isSelected() == true)
{
{
for (int x=0; x 0)
{
for (i = (remainingString ); i > 0 ; i-- )
{
if (line.substring(i-1,i).equals("<") ) // remove html tags
{
line = new StringBuilder(line).deleteCharAt(i -1).toString();
deleteString = 0;
remainingString = remainingString - 1;
}
if (line.substring(i-1,i).equals(">") ) // remove html tags stating at the right of string
{
deleteString = 1;
}
if (deleteString == 1) // remove html tags
{
if (i < remainingString )
{
line = new StringBuilder(line).deleteCharAt(i-1).toString();
remainingString = remainingString - 1;
}
if (line.substring(i-1,i).equals(">") ) // remove html tags stating at the right of string
{
line = new StringBuilder(line).deleteCharAt(i -1).toString();
remainingString = remainingString - 1;
deleteString = 1;
}
}
}
}
if (line.length() > 0)
line = new StringBuilder(line).deleteCharAt(line.length() -1 ).toString(); //remove last char
NOAAalertsText.append(line + "\n");
if(line.startsWith("Space Weather Message Code:"))
{
if (NOAAmessagCompl==(false))
{
messageFirstPart = line.replace("Space Weather Message Code:", "");
//NOAAmessagCompl = true;
}
}
if(line.startsWith("Issue Time: "))
{
if (NOAAmessagCompl==(false))
{
try {
line = line.substring(24, 32); // fe: Issue Time: 2017 Jun 18 0300 UTC
} catch (StringIndexOutOfBoundsException r) {
}
NOAAmessagCompl = true;
//Files.deleteIfExists(Paths.get(System.getProperty("user.home") +("/MDSR_SA/NOAA_Alert.htm")));
}
}
line = in.readLine();
NOAAalertsText.setCaretPosition(0); //display top of document
}
if (success)
{
messageFirstPart = "del";
//System.out.println("File has been downloaded successfully.");
}
else JOptionPane.showMessageDialog(null,"Download Error");
} catch (IOException ex) {
ex.printStackTrace();
}
}
else
NW_events.append("Download failed"+"\n");
}
public static void clearWSPR_Data(){
for (int x=0; x 0 ; x--) {
//jComboBoxDataFileSelect.addItem("sorted by date");
for (int x=1; x< lenthOfBox ; x++) {
//System.out.println (list[lenthOfBox - x - 1]);
jComboBoxDataFileSelect.addItem(list[lenthOfBox - x]);
}
}
public static void sortComboboxRTC(){
if(RTC_time.isSelected() == true)
sortingFor = 0;
if(RTC_mag.isSelected() == true)
sortingFor = 1;
if(RTC_depth.isSelected() == true)
sortingFor = 2;
if(RTC_distance.isSelected() == true)
sortingFor = 4;
int lenthOfBox = quakeSelector.getItemCount();
//System.out.println (" Lenght of array " + lenthOfBox);
double[] list = new double[lenthOfBox]; //cerate array for sorting
String selQuake;
String[] quakeStringArr = new String [1000];
String[] quakeSelStr = new String [5];
for (int x=0; x < lenthOfBox; x++) {
//System.out.println (list[x] + " Long " + lenthOfBox );
quakeStringArr[x] = (String.valueOf(quakeSelector.getItemAt(x)));//"12 - 34 km - 56 - 34 - 234"; //
//selQuake = quakeSel[x];
selQuake = (quakeStringArr[x]);
quakeSelStr = (selQuake.split(" - "));
//remove "-" and split into X-Loc,magnetude, depth, locationAndState,distance
selQuake = quakeSelStr[sortingFor]; //sorting distance
selQuake = selQuake.replaceAll("km","");
selQuake = selQuake.replaceAll("M","");
list[x] = Double.parseDouble(selQuake);
//System.out.println (x + " not sorted " + list[x]);
}
Arrays.sort(list); //list in order
for (int x = 0; x < 100 ; x++) { //loop for sorted list
int c = x;
if(reverseSearchOrder.isSelected())
c = lenthOfBox - x - 1;
//System.out.println (c + " sorted " + list[x] + " lenghtBox " + lenthOfBox);
for (int y = 0; y < lenthOfBox ; y++) {
String[] quakeSelStr2 = new String [5];
quakeSelStr2 = quakeSelector.getItemAt(y).split(" - ");
quakeSelStr2[sortingFor] = quakeSelStr2[sortingFor].replaceAll("km","");
quakeSelStr2[sortingFor] = quakeSelStr2[sortingFor].replaceAll("M","");
//quakeSelStr2[sortingFor] = quakeSelStr2[sortingFor].replaceAll("0.0","0.01");
//if(list[x] != 0)
{
//System.out.println (" compare to " + (quakeSelStr2[sortingFor]));
//System.out.println (" sorted " + list[x]);
}
if(c < lenthOfBox)
//if (c <= 0)
if(Double.parseDouble(quakeSelStr2[sortingFor]) == (list[c]))
{
if(list[c] != - 1) //escape value
{
quakeSelector.addItem(quakeSelector.getItemAt(y));
//quakeSelector.addItem(quakeSelector.getItemAt(lenthOfBox - y)); //reverse oder
//System.out.println ( (lenthOfBox - y) + list[c] + " sorted Item " + quakeSelector.getItemAt(y));
list[c] = -1; //escape value
quakeSelector.removeItemAt(y);
}
//break;
}
}
}
}
public static void loadDataHighForDisp(){
for (int t=0; t < 1651; t++) {
//double the data for display by loading the same data starting at 1650
LTAdisplayTimeMarker[t + 1635] = displayTimeMarker[t];
LTAdisplaySSI_CH1[t + 1635] = LTAdisplaySSI_CH1[t];
LTAdisplaySSI_CH2[t + 1635] = LTAdisplaySSI_CH2[t];
LTAdisplaySSI_CH3[t + 1635] = LTAdisplaySSI_CH3[t];
LTAdisplaySSI_CH4[t + 1635] = LTAdisplaySSI_CH4[t];
LTAdisplaySSI_CH5[t + 1635] = LTAdisplaySSI_CH5[t];
LTAdisplaySSI_CH6[t + 1635] = LTAdisplaySSI_CH6[t];
//System.out.println(t + "Time Mk: " +" "+ LTAdisplaySSI_CH1[t] + "highData" + LTAdisplaySSI_CH1[t + 1650]); // use if they are the same
}
}
public static void clearRemData(){
for (int t=1; t < 1000; t++) { //do not delete the first one
try {
//deleteFile dailyBU before moving - need to be done to work in Windows otherwise no update
Files.deleteIfExists(Paths.get(System.getProperty("user.home") + ("/MDSR_SA/dailyBackup"+ t +".csv")));
//System.out.println(t + "Time Mk: " +" "+ LTAdisplaySSI_CH1[t] + "highData" + LTAdisplaySSI_CH1[t + 1650]); // use if they are the same
}catch (IOException ex) {
Logger.getLogger(SeismoViewer.class.getName()).log(Level.SEVERE, null, ex);
}
}
JOptionPane.showMessageDialog(null,"the files have been deleted... resetting index");
readDataInstance = 1;
}
public static void calcDistRFStoQuakeUsingDegDec(){
//double d2r = (180 / Math.PI);
//double distance = 0;
double lat1 = (Double.valueOf(locRFS_Lat.getText()));
double lon1 = (Double.valueOf(locRFS_Lon.getText()));
double lat2 = quakeLat;
double lon2 = quakeLon;
//double startPointLat = 0;
//double startPointLon = 0;
//System.out.println("RFS Lat " + lat1 + "RFS Lon " + lon1 + "Quake Lat " + quakeLat + "Quake Lon " + quakeLon);
try{
double theta = lon1 - lon2;
double dist = Math.sin(Math.toRadians(lat1)) * Math.sin(Math.toRadians(lat2)) + Math.cos(Math.toRadians(lat1)) *
Math.cos(Math.toRadians(lat2)) * Math.cos(Math.toRadians(theta));
dist = Math.acos(dist);
dist = Math.toDegrees(dist);
dist = dist * 60 * 1.1515;
distanceForActive = dist * 1.609344; //correction for km units
} catch(Exception e){
e.printStackTrace();
}
}
public static void updateSelectedQuake(){ //new udates require the x offset updates
int lenthOfBox = quakeSelector.getItemCount();
for (int x=0; x < lenthOfBox; x++) {
String[] quakeSelStr = new String [4];
//quakeSelector.getSelectedItem().toString().substring(5,6));
String quakeSelectorItem = (String.valueOf(quakeSelector.getItemAt(x)));
quakeSelStr = quakeSelectorItem.split("-");
String quakeSelectorItemWO = quakeSelStr[1] + "-" + quakeSelStr[2] + "-" + quakeSelStr[3]+ "-" + quakeSelStr[4]; //without x-loc
//System.out.println (x + " Items in Box: " + quakeSelectorItemWO);
//System.out.println(selectedQuake.getText());
//selectedQuake.setText("select Quake");//if not found reset
if((selectedQuake.getText()).endsWith (quakeSelectorItemWO))
{
System.out.println (x + " updated to : " + (String.valueOf(quakeSelector.getItemAt(x))));
selectedQuake.setText(String.valueOf(quakeSelector.getItemAt(x)));
System.out.println (x + " Match found: " + quakeSelectorItemWO);
//break;
}
//else
//selectedQuake.setText("select Quake");//if not found reset
}
}
} //end locationRFS_Lat