package spectrumanalyzer; /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * SA_Display.java * * Created on Feb 6, 2015, 9:12:20 AM */ /** * * @author alex */ //package com.vipul; //import static com.sun.org.apache.xalan.internal.lib.ExsltDatetime.time; import java.applet.Applet; import java.awt.Checkbox; import java.awt.Choice; import java.awt.Font; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; import java.util.Set; import java.util.Arrays; import java.awt.Graphics; import java.awt.Color; import java.awt.Cursor; import java.awt.MouseInfo; import java.awt.Point; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JOptionPane; import java.io.*; import java.text.SimpleDateFormat; import java.util.Date; import javax.swing.SwingUtilities; import java.util.logging.Level; import java.net.URL; import org.apache.xmlrpc.client.XmlRpcClient; import org.apache.xmlrpc.client.XmlRpcClientConfigImpl; import org.apache.xmlrpc.client.XmlRpcCommonsTransportFactory; //import org.apache.commons.io.FileUtils; import java.io.FileInputStream; import java.io.InputStream; import java.io.OutputStream; import org.apache.commons.net.ftp.FTP; import org.apache.commons.net.ftp.FTPClient; import java.awt.AWTException; import java.awt.Dimension; import java.awt.Font; import java.awt.Rectangle; import java.awt.Robot; import java.awt.Toolkit; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import static java.lang.Thread.sleep; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; import java.nio.file.Files; import java.nio.file.Paths; import java.sql.Timestamp; import java.text.ParseException; import java.util.ArrayList; import java.util.Hashtable; import java.util.Vector; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.swing.text.StyledDocument; import javax.imageio.ImageIO; import javax.swing.JFrame; import javax.swing.JScrollBar; import javax.swing.text.MutableAttributeSet; import javax.swing.text.StyleConstants; import org.apache.xmlrpc.XmlRpcException; import org.apache.xmlrpc.client.XmlRpcClient; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.nio.file.Path; import java.nio.file.Paths; import static spectrumanalyzer.SeismoViewer.jComboBoxDataFileSelect; //import com.google.common.io.Files; //import org.apache.commons.io.FileUtils; public class SA_Display extends javax.swing.JFrame { //private static Object drawPanel; /** Creates new form SA_Display */ public SA_Display() { //JFrame.pack(); //setSize(675, 570); //super(parent); initComponents(); //JFrame frame = new JFrame("My Title"); try{ //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); SwingUtilities.updateComponentTreeUI(jPanel9); setTitle("RF-Seismograph & Linux Spectrum Analyzer V J1.7 (MDSR) by VE7DXW"); // NOI18N //SwingUtilities.updateComponentTreeUI(jPanel2); //frame.pack(); //loadCalibration(); } catch(Exception e){ System.out.println("UIManager Exception : "+e); } } static int countArr = 1; static double displayGain = 10; static int noiseFloor = 50; static int refreshTime = 0; static int yGrid = 0; static String type = new String("line"); static double dominantFrequency = 0; static double[] FFT_binsAverageFiltered = new double[430]; static double[] corrFactor = new double[430]; //mutiplies the FFT value to correct readout static int dominantBin = 0; //used for correction procedure static double[] FFT_peakHold = new double[430]; static int[] y_peakHold = new int[430]; static int[] y_decayCount = new int[430]; static double noiseLoading = 0; static double DF_noiseLoading = 0; int arrCount = 0; static double averagePeakLevel = 0; static double totalPeakLevel = 0; static int stats = 0; static int preY = 0; static int preYdec = 0; static int fiterSelector = 3; static double FFT_step = 10; //width of the FFT bins static int optionMode = 0; //0 normal, 1 peak hold, 2 decay static int optionGraph = 0; //0 normal, 1 corrected, 2 calibrated static int refreshRate = 0; static int refreshCount = 0; static int binEdit = 0; static double realIF_frequency = 0; //real received BFO center static int FFT_binBFO = 209; //bin containing the BFO centere frequnecy static int FFT_binHighpass; //bin containing highpass filer frequency static int FFT_binLowpass; //bin containing lowpass filer frequency static int CAT_Frequency = 0; static int preCAT_Frequency = 0; //CatFrequency -1 update static double markerLevel = -20.0; static double levelSN = 0.0; //signal to noise measurement static String MDSR_status = ("off"); //either on or off static String preMDSR_status = ("na"); //either on or off static int preOptionMode = 1; static boolean startEnable = true; static int selIndexDisplayValue = 0; // SA = 0, Prop = 1 static int dataCollectionEnable = 0; //data collection on static int carretPosition = 0; static double[] displaySSI_startup = new double[7000]; static double[] displaySSI_CH1 = new double[7000]; static double[] displaySSI_CH2 = new double[7000]; static double[] displaySSI_CH3 = new double[7000]; static double[] displaySSI_CH4 = new double[7000]; static double[] displaySSI_CH5 = new double[7000]; static double[] displaySSI_CH6 = new double[7000]; static String[] displayTimeMarker = new String[7000]; static String currentTime = new String("na"); static int propAmpValue = 0; //propagation amplifier static int propThresholdValue = 500; // for propagation tracker //static int tempPanState = 0; // for traking pan movent and triggering propagation measurement static int displayTime = 1; static int displayStart = 0; //begin of the displayed data static int displayPan = 0; static int jMax = 0; static int jCount = 0; //j variable static int mMax = 0; static int mCount = 1; //m variable for data collections static int reset = 0; //reset variable static int clearScreen = 0; // 0 = not static int mouseXpos = 0; static boolean mousePressed; static int RealtimeEnable = 0; ////0 not running, 1 running static int propagationActive = 0; //0 not running, 1 running static int delayTimeProp = 6; //6h == 52s per point / 6 channels static int newDay; static int newDayPre; static int exitLoop = 0; //0 is staty in loop static int scanCount = 0; //scanner counter static boolean incomplete; //ftp process static int sliderValue = 0; 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 static boolean delayImageSave; static boolean netIsAvailableFTP = true; //flrig implementation gloal data static String[] flrigInfo = new String[7]; //rig type,RX-TX status,frequncy(current vfo),mode,highpass,lowPass,notch static int corretionFreq_frig = 0; static double flrigSetFrequency = 5000000; //set to 5MHz for test static String[] tempArray = new String[100]; static String[] tempArray1 = new String[100]; static int[] arrayNumbers = new int[100]; /** 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() { jLabel21 = new javax.swing.JLabel(); startButton = new javax.swing.JButton(); jToolBar1 = new javax.swing.JToolBar(); jPanel9 = new javax.swing.JPanel(); jPanel2 = new javax.swing.JPanel(); jTabbedPane2 = new javax.swing.JTabbedPane(); jPanel18 = new javax.swing.JPanel(); jPanel19 = new javax.swing.JPanel(); SA_Frequency1 = new javax.swing.JComboBox(); SA_scan1 = new java.awt.TextField(); CheckBoxFreq1 = new javax.swing.JCheckBox(); jPanel20 = new javax.swing.JPanel(); SA_Frequency2 = new javax.swing.JComboBox(); SA_scan2 = new java.awt.TextField(); CheckBoxFreq2 = new javax.swing.JCheckBox(); jPanel21 = new javax.swing.JPanel(); SA_Frequency3 = new javax.swing.JComboBox(); SA_scan3 = new java.awt.TextField(); CheckBoxFreq3 = new javax.swing.JCheckBox(); jPanel22 = new javax.swing.JPanel(); SA_Frequency4 = new javax.swing.JComboBox(); SA_scan4 = new java.awt.TextField(); CheckBoxFreq4 = new javax.swing.JCheckBox(); jPanel23 = new javax.swing.JPanel(); SA_Frequency5 = new javax.swing.JComboBox(); SA_scan5 = new java.awt.TextField(); CheckBoxFreq5 = new javax.swing.JCheckBox(); jPanel24 = new javax.swing.JPanel(); SA_Frequency6 = new javax.swing.JComboBox(); SA_scan6 = new java.awt.TextField(); CheckBoxFreq6 = new javax.swing.JCheckBox(); jLabel27 = new javax.swing.JLabel(); jLabel28 = new javax.swing.JLabel(); saveFrequButton = new javax.swing.JButton(); recallFrequButton = new javax.swing.JButton(); JT65recallButton = new javax.swing.JButton(); SSBrecallButton = new javax.swing.JButton(); WWVrecallButton = new javax.swing.JButton(); jLabel29 = new javax.swing.JLabel(); CWrecallButton = new javax.swing.JButton(); WSPRrecallButton = new javax.swing.JButton(); recallButtonPSK31 = new javax.swing.JButton(); jPanel25 = new javax.swing.JPanel(); propTrackPane = new javax.swing.JScrollPane(); eventsTrackerPane2 = new javax.swing.JTextPane(); jPanel26 = new javax.swing.JPanel(); propThreshold = new javax.swing.JSpinner(); displaySD = new javax.swing.JCheckBox(); timeIncidentDuplicate = new javax.swing.JCheckBox(); jLabel34 = new javax.swing.JLabel(); jLabel33 = new javax.swing.JLabel(); jLabel20 = new javax.swing.JLabel(); jPanel28 = new javax.swing.JPanel(); numberOfEntries = new java.awt.TextField(); propAmp = new javax.swing.JSpinner(); propagationLisiting = new javax.swing.JButton(); jLabel19 = new javax.swing.JLabel(); jLabel35 = new javax.swing.JLabel(); jPanel30 = new javax.swing.JPanel(); jScrollPane3 = new javax.swing.JScrollPane(); NOAAalertsText = new javax.swing.JTextArea(); jPanel32 = new javax.swing.JPanel(); NOAAMessage = new java.awt.TextField(); SA_getNOAAalert = new javax.swing.JButton(); setAndClearAlerts = new javax.swing.JButton(); NOAAAlertBanner = new java.awt.TextField(); alertPresistance = new javax.swing.JComboBox(); alertTime = new java.awt.TextField(); alertTimeCleared = new java.awt.TextField(); uploadDataFTP = new javax.swing.JButton(); jPanel27 = new javax.swing.JPanel(); SA_saveUserParameters = new javax.swing.JButton(); clearFtpActivity = new javax.swing.JButton(); jPanel29 = new javax.swing.JPanel(); elevation = new java.awt.TextField(); antenna = new java.awt.TextField(); gridSquare = new java.awt.TextField(); callSign = new java.awt.TextField(); jLabel38 = new javax.swing.JLabel(); jLabel42 = new javax.swing.JLabel(); jLabel37 = new javax.swing.JLabel(); jLabel36 = new javax.swing.JLabel(); jPanel31 = new javax.swing.JPanel(); jLabel49 = new javax.swing.JLabel(); jLabel50 = new javax.swing.JLabel(); ftpPassWord = new javax.swing.JPasswordField(); jLabel47 = new javax.swing.JLabel(); ftpUserName = new java.awt.TextField(); jLabel48 = new javax.swing.JLabel(); ftpServer = new java.awt.TextField(); ftpDirectory = new java.awt.TextField(); jScrollPane1 = new javax.swing.JScrollPane(); ftpActivity = new javax.swing.JTextArea(); uploadEnabled = new javax.swing.JCheckBox(); jLabel43 = new javax.swing.JLabel(); jPanel1 = new javax.swing.JPanel(); jPanel5 = new javax.swing.JPanel(); SA_manButton = new javax.swing.JButton(); SA_BinSelector = new javax.swing.JSpinner(); jLabel10 = new javax.swing.JLabel(); SA_corrButton = new javax.swing.JButton(); SA_corrValue = new java.awt.TextField(); jPanel7 = new javax.swing.JPanel(); acceptButton = new javax.swing.JButton(); SA_equalizerMode = new javax.swing.JComboBox(); equalizeButton = new javax.swing.JButton(); jPanel8 = new javax.swing.JPanel(); SA_refreshTime = new javax.swing.JComboBox(); SA_time = new java.awt.TextField(); jPanel11 = new javax.swing.JPanel(); SA_inputSelector = new javax.swing.JComboBox(); jPanel12 = new javax.swing.JPanel(); SA_recallCorrectionCurve = new javax.swing.JComboBox(); SA_saveCorrectionCurve = new javax.swing.JButton(); SA_loadCorrectionCurve = new javax.swing.JButton(); SA_correctionCurveCurrent = new java.awt.TextField(); jPanel6 = new javax.swing.JPanel(); jLabel13 = new javax.swing.JLabel(); SA_Frequency = new javax.swing.JSpinner(); jPanel15 = new javax.swing.JPanel(); SA_yGrid = new javax.swing.JSpinner(); jPanel16 = new javax.swing.JPanel(); SA_optionMode = new javax.swing.JComboBox(); jPanel17 = new javax.swing.JPanel(); SA_graphFunction = new javax.swing.JComboBox(); dataCollectionSeviceON = new javax.swing.JPanel(); jDesktopPane1 = new javax.swing.JDesktopPane(); stopPropGraph = new javax.swing.JButton(); startPropGraph = new javax.swing.JButton(); graphServiceON = new javax.swing.JRadioButton(); SA_listServices = new javax.swing.JComboBox(); killProcessButton = new javax.swing.JButton(); CheckBoxShowAll = new javax.swing.JCheckBox(); jLabel44 = new javax.swing.JLabel(); jScrollPane4 = new javax.swing.JScrollPane(); threadRestartLog = new javax.swing.JTextArea(); jDesktopPane2 = new javax.swing.JDesktopPane(); propagRestart = new java.awt.TextField(); dataCollectionON = new javax.swing.JRadioButton(); reStrartDataColl = new javax.swing.JButton(); jPanel3 = new javax.swing.JPanel(); jLabel9 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); exitButton = new javax.swing.JButton(); SA_dominatFrequencyValue = new java.awt.TextField(); jLabel7 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); RST_button = new javax.swing.JButton(); SA_dominantFrequencyLevel = new java.awt.TextField(); jLabel14 = new javax.swing.JLabel(); SA_averageNoiseValue = new java.awt.TextField(); jLabel8 = new javax.swing.JLabel(); Start = new javax.swing.JButton(); jPanel4 = new javax.swing.JPanel(); frequencyMarquee = new javax.swing.JPanel(); jTabbedPane1 = new javax.swing.JTabbedPane(); jPanel10 = new javax.swing.JPanel(); SA_displayGain = new javax.swing.JSlider(); jLabel11 = new javax.swing.JLabel(); SA_bandwidthSelector = new javax.swing.JComboBox(); jLabel12 = new javax.swing.JLabel(); SA_displayLevel = new javax.swing.JSlider(); SA_videoFilterSelector = new javax.swing.JComboBox(); jPanel13 = new javax.swing.JPanel(); updateCalibration = new javax.swing.JComboBox(); RigFrequency = new java.awt.TextField(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); RigMode = new java.awt.TextField(); jLabel15 = new javax.swing.JLabel(); RigState = new java.awt.TextField(); jLabel16 = new javax.swing.JLabel(); filterpassLow = new java.awt.TextField(); filterpassHigh = new java.awt.TextField(); jLabel17 = new javax.swing.JLabel(); corretionFreq = new java.awt.TextField(); jLabel18 = new javax.swing.JLabel(); jLabel22 = new javax.swing.JLabel(); dataSelector = new javax.swing.JComboBox(); flrigConnected = new java.awt.TextField(); updateFequencyCenter = new javax.swing.JButton(); jPanel14 = new javax.swing.JPanel(); scanTime = new javax.swing.JComboBox(); jLabel24 = new javax.swing.JLabel(); timeIntPG = new java.awt.TextField(); jLabel25 = new javax.swing.JLabel(); lastDataPoint = new java.awt.TextField(); jLabel26 = new javax.swing.JLabel(); currentFrequency = new java.awt.TextField(); jLabel30 = new javax.swing.JLabel(); scanStartButton = new javax.swing.JButton(); pauseResumeToggleButton = new javax.swing.JToggleButton(); saveDataButton = new javax.swing.JButton(); jLabel31 = new javax.swing.JLabel(); autoSaveCheckBox = new javax.swing.JCheckBox(); savePNGButton = new javax.swing.JButton(); autoSaveCheckBoxImage = new javax.swing.JCheckBox(); jLabel32 = new javax.swing.JLabel(); refreshTimePG = new javax.swing.JComboBox(); jLabel23 = new javax.swing.JLabel(); screenSwitch = new javax.swing.JTabbedPane(); spectralDisplay = new javax.swing.JPanel(); spectrumInnerPane = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); propagationDisplayTab = new javax.swing.JPanel(); propagationDisplay = new javax.swing.JScrollPane(); propagationDisplayScoll = new javax.swing.JPanel(); propagationDisplay1 = new javax.swing.JPanel(); helpButton = new javax.swing.JButton(); jLabel40 = new javax.swing.JLabel(); jLabel41 = new javax.swing.JLabel(); WWVrecallButton1 = new javax.swing.JButton(); checkNet = new javax.swing.JButton(); NOAAAlertBanner1 = new java.awt.TextField(); netAvail = new java.awt.TextField(); jLabel39 = new javax.swing.JLabel(); test = new javax.swing.JButton(); jLabel21.setText("Correction Frequency"); startButton.setText("Start"); startButton.setToolTipText("press here to start the audio engine"); startButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { startButtonActionPerformed(evt); } }); jToolBar1.setRollover(true); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Spectrum Analyzer V J1.7 VE7DXW"); // NOI18N setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); setFont(new java.awt.Font("Dialog", 1, 12)); addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { formMousePressed(evt); } }); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { formWindowClosing(evt); } }); jPanel9.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jTabbedPane2.setBackground(new java.awt.Color(-4144960,true)); jTabbedPane2.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { jTabbedPane2StateChanged(evt); } }); jTabbedPane2.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { jTabbedPane2MouseEntered(evt); } }); jPanel19.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Frequency 1", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 1, 10))); // NOI18N jPanel19.setForeground(new java.awt.Color(-1,true)); jPanel19.setFont(new java.awt.Font("Dialog", 0, 10)); // NOI18N SA_Frequency1.setFont(new java.awt.Font("Dialog", 1, 10)); // NOI18N SA_Frequency1.setMaximumRowCount(10); SA_Frequency1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "3576", "7076", "10138", "14076", "18102", "21076", "24917", "28076" })); SA_Frequency1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { SA_Frequency1ActionPerformed(evt); } }); SA_scan1.setBackground(new java.awt.Color(-65536,true)); SA_scan1.setFont(new java.awt.Font("Dialog", 1, 10)); // NOI18N SA_scan1.setText("Scan1"); SA_scan1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { SA_scan1ActionPerformed(evt); } }); CheckBoxFreq1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { CheckBoxFreq1ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel19Layout = new javax.swing.GroupLayout(jPanel19); jPanel19.setLayout(jPanel19Layout); jPanel19Layout.setHorizontalGroup( jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel19Layout.createSequentialGroup() .addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(SA_scan1, 0, 75, Short.MAX_VALUE) .addComponent(SA_Frequency1, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel19Layout.createSequentialGroup() .addGap(19, 19, 19) .addComponent(CheckBoxFreq1))) .addContainerGap()) ); jPanel19Layout.setVerticalGroup( jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel19Layout.createSequentialGroup() .addComponent(SA_scan1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 11, Short.MAX_VALUE) .addComponent(CheckBoxFreq1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(SA_Frequency1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) ); jPanel20.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Frequency 2", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 1, 10))); // NOI18N jPanel20.setFont(new java.awt.Font("Dialog", 0, 10)); // NOI18N SA_Frequency2.setFont(new java.awt.Font("Dialog", 1, 10)); // NOI18N SA_Frequency2.setMaximumRowCount(10); SA_Frequency2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "3576", "7076", "10138", "14076", "18102", "21076", "24917", "28076" })); SA_Frequency2.setSelectedIndex(1); SA_Frequency2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { SA_Frequency2ActionPerformed(evt); } }); SA_scan2.setBackground(new java.awt.Color(-16711936,true)); SA_scan2.setFont(new java.awt.Font("Dialog", 1, 10)); // NOI18N SA_scan2.setText("Scan2"); javax.swing.GroupLayout jPanel20Layout = new javax.swing.GroupLayout(jPanel20); jPanel20.setLayout(jPanel20Layout); jPanel20Layout.setHorizontalGroup( jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel20Layout.createSequentialGroup() .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(SA_scan2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(SA_Frequency2, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(jPanel20Layout.createSequentialGroup() .addGap(21, 21, 21) .addComponent(CheckBoxFreq2))) .addContainerGap(28, Short.MAX_VALUE)) ); jPanel20Layout.setVerticalGroup( jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel20Layout.createSequentialGroup() .addComponent(SA_scan2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 11, Short.MAX_VALUE) .addComponent(CheckBoxFreq2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(SA_Frequency2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) ); jPanel21.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Frequency 3", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 1, 10))); // NOI18N jPanel21.setFont(new java.awt.Font("Dialog", 0, 10)); // NOI18N SA_Frequency3.setFont(new java.awt.Font("Dialog", 1, 10)); // NOI18N SA_Frequency3.setMaximumRowCount(10); SA_Frequency3.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "3576", "7076", "10138", "14076", "18102", "21076", "24917", "28076" })); SA_Frequency3.setSelectedIndex(2); SA_Frequency3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { SA_Frequency3ActionPerformed(evt); } }); SA_scan3.setBackground(new java.awt.Color(-256,true)); SA_scan3.setFont(new java.awt.Font("Dialog", 1, 10)); // NOI18N SA_scan3.setText("Scan3"); javax.swing.GroupLayout jPanel21Layout = new javax.swing.GroupLayout(jPanel21); jPanel21.setLayout(jPanel21Layout); jPanel21Layout.setHorizontalGroup( jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel21Layout.createSequentialGroup() .addGroup(jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(SA_Frequency3, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(SA_scan3, 0, 75, Short.MAX_VALUE) .addGroup(jPanel21Layout.createSequentialGroup() .addGap(20, 20, 20) .addComponent(CheckBoxFreq3))) .addContainerGap()) ); jPanel21Layout.setVerticalGroup( jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel21Layout.createSequentialGroup() .addComponent(SA_scan3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 11, Short.MAX_VALUE) .addComponent(CheckBoxFreq3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(SA_Frequency3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) ); jPanel22.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Frequency 4", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 1, 10))); // NOI18N jPanel22.setFont(new java.awt.Font("Dialog", 0, 10)); // NOI18N SA_Frequency4.setFont(new java.awt.Font("Dialog", 1, 10)); // NOI18N SA_Frequency4.setMaximumRowCount(10); SA_Frequency4.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "3576", "7076", "10138", "14076", "18102", "21076", "24917", "28076" })); SA_Frequency4.setSelectedIndex(3); SA_Frequency4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { SA_Frequency4ActionPerformed(evt); } }); SA_scan4.setBackground(new java.awt.Color(-65281,true)); SA_scan4.setFont(new java.awt.Font("Dialog", 1, 10)); // NOI18N SA_scan4.setText("Scan4"); javax.swing.GroupLayout jPanel22Layout = new javax.swing.GroupLayout(jPanel22); jPanel22.setLayout(jPanel22Layout); jPanel22Layout.setHorizontalGroup( jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel22Layout.createSequentialGroup() .addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(SA_Frequency4, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(SA_scan4, 0, 81, Short.MAX_VALUE) .addGroup(jPanel22Layout.createSequentialGroup() .addGap(22, 22, 22) .addComponent(CheckBoxFreq4))) .addContainerGap()) ); jPanel22Layout.setVerticalGroup( jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel22Layout.createSequentialGroup() .addComponent(SA_scan4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(CheckBoxFreq4) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 9, Short.MAX_VALUE) .addComponent(SA_Frequency4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) ); jPanel23.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Frequency 5", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 1, 10))); // NOI18N jPanel23.setFont(new java.awt.Font("Dialog", 0, 10)); // NOI18N SA_Frequency5.setFont(new java.awt.Font("Dialog", 1, 10)); // NOI18N SA_Frequency5.setMaximumRowCount(10); SA_Frequency5.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "3576", "7076", "10138", "14076", "18102", "21076", "24917", "28076" })); SA_Frequency5.setSelectedIndex(4); SA_Frequency5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { SA_Frequency5ActionPerformed(evt); } }); SA_scan5.setBackground(new java.awt.Color(-16711681,true)); SA_scan5.setFont(new java.awt.Font("Dialog", 1, 10)); // NOI18N SA_scan5.setText("Scan5"); javax.swing.GroupLayout jPanel23Layout = new javax.swing.GroupLayout(jPanel23); jPanel23.setLayout(jPanel23Layout); jPanel23Layout.setHorizontalGroup( jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel23Layout.createSequentialGroup() .addGroup(jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(SA_Frequency5, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(SA_scan5, 0, 85, Short.MAX_VALUE) .addGroup(jPanel23Layout.createSequentialGroup() .addGap(24, 24, 24) .addComponent(CheckBoxFreq5))) .addContainerGap()) ); jPanel23Layout.setVerticalGroup( jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel23Layout.createSequentialGroup() .addComponent(SA_scan5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(CheckBoxFreq5) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 9, Short.MAX_VALUE) .addComponent(SA_Frequency5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) ); jPanel24.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Frequency 6", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 1, 10))); // NOI18N jPanel24.setFont(new java.awt.Font("Dialog", 0, 10)); // NOI18N SA_Frequency6.setFont(new java.awt.Font("Dialog", 1, 10)); // NOI18N SA_Frequency6.setMaximumRowCount(10); SA_Frequency6.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "3576", "7076", "10138", "14076", "18102", "21076", "24917", "28076" })); SA_Frequency6.setSelectedIndex(5); SA_Frequency6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { SA_Frequency6ActionPerformed(evt); } }); SA_scan6.setBackground(new java.awt.Color(-20561,true)); SA_scan6.setFont(new java.awt.Font("Dialog", 1, 10)); // NOI18N SA_scan6.setText("Scan6"); javax.swing.GroupLayout jPanel24Layout = new javax.swing.GroupLayout(jPanel24); jPanel24.setLayout(jPanel24Layout); jPanel24Layout.setHorizontalGroup( jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel24Layout.createSequentialGroup() .addGroup(jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(SA_Frequency6, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(SA_scan6, 0, 93, Short.MAX_VALUE) .addGroup(jPanel24Layout.createSequentialGroup() .addGap(22, 22, 22) .addComponent(CheckBoxFreq6))) .addContainerGap()) ); jPanel24Layout.setVerticalGroup( jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel24Layout.createSequentialGroup() .addComponent(SA_scan6, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(CheckBoxFreq6) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 7, Short.MAX_VALUE) .addComponent(SA_Frequency6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) ); jLabel27.setText("Bands [Hz]"); jLabel27.setToolTipText("Select band according to colored trace"); jLabel28.setText("Preselect [kHz]"); jLabel28.setToolTipText("select preselect frequency - will only update if lock is deselected"); saveFrequButton.setText("Save"); saveFrequButton.setToolTipText("save the current frequencies"); saveFrequButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { saveFrequButtonActionPerformed(evt); } }); recallFrequButton.setText("Recall"); recallFrequButton.setToolTipText("load saved frequencies"); recallFrequButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { recallFrequButtonActionPerformed(evt); } }); JT65recallButton.setText("JT65"); JT65recallButton.setToolTipText("load JT65 frequencies"); JT65recallButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { JT65recallButtonActionPerformed(evt); } }); SSBrecallButton.setText("SSB"); SSBrecallButton.setToolTipText("load SSB frequencies"); SSBrecallButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { SSBrecallButtonActionPerformed(evt); } }); WWVrecallButton.setText("WWV"); WWVrecallButton.setToolTipText("load WWV frequencies"); WWVrecallButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { WWVrecallButtonActionPerformed(evt); } }); jLabel29.setText("lock/display"); jLabel29.setToolTipText("if selected; frequency is locked and will display in scan"); CWrecallButton.setText("CW"); CWrecallButton.setToolTipText("load CW frequencies"); CWrecallButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { CWrecallButtonActionPerformed(evt); } }); WSPRrecallButton.setText("WSPR"); WSPRrecallButton.setToolTipText("load WSPR frequencies"); WSPRrecallButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { WSPRrecallButtonActionPerformed(evt); } }); recallButtonPSK31.setText("PSK31"); recallButtonPSK31.setToolTipText("load PSK31 frequencies"); recallButtonPSK31.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { recallButtonPSK31ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel18Layout = new javax.swing.GroupLayout(jPanel18); jPanel18.setLayout(jPanel18Layout); jPanel18Layout.setHorizontalGroup( jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel18Layout.createSequentialGroup() .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel18Layout.createSequentialGroup() .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel18Layout.createSequentialGroup() .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel18Layout.createSequentialGroup() .addGap(22, 22, 22) .addComponent(jLabel29)) .addComponent(jLabel28, javax.swing.GroupLayout.Alignment.TRAILING)) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel18Layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addComponent(jLabel27))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jPanel19, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel20, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel21, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel22, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)) .addGroup(jPanel18Layout.createSequentialGroup() .addContainerGap() .addComponent(WWVrecallButton, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(CWrecallButton, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(SSBrecallButton, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(JT65recallButton, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(WSPRrecallButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(recallButtonPSK31, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(36, 36, 36))) .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel18Layout.createSequentialGroup() .addComponent(jPanel23, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel24, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel18Layout.createSequentialGroup() .addComponent(saveFrequButton, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(recallFrequButton, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(0, 0, Short.MAX_VALUE)) ); jPanel18Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {CWrecallButton, JT65recallButton, SSBrecallButton, WSPRrecallButton, WWVrecallButton}); jPanel18Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jPanel20, jPanel22}); jPanel18Layout.setVerticalGroup( jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel18Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel18Layout.createSequentialGroup() .addComponent(jLabel27) .addGap(18, 18, 18) .addComponent(jLabel29, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jLabel28) .addGap(7, 7, 7)) .addComponent(jPanel24, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jPanel23, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jPanel19, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jPanel20, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jPanel22, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel21, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 11, Short.MAX_VALUE) .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(CWrecallButton) .addComponent(SSBrecallButton) .addComponent(JT65recallButton) .addComponent(WSPRrecallButton) .addComponent(recallButtonPSK31) .addComponent(saveFrequButton) .addComponent(recallFrequButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(WWVrecallButton)) .addContainerGap()) ); jPanel18Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jPanel19, jPanel20, jPanel21, jPanel22, jPanel23, jPanel24}); jTabbedPane2.addTab("Scanner", jPanel18); eventsTrackerPane2.setFont(new java.awt.Font("Dialog", 0, 14)); eventsTrackerPane2.setAutoscrolls(false); eventsTrackerPane2.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR)); propTrackPane.setViewportView(eventsTrackerPane2); jPanel26.setBorder(javax.swing.BorderFactory.createEtchedBorder()); propThreshold.setToolTipText(""); propThreshold.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { propThresholdStateChanged(evt); } }); displaySD.setText("jCheckBox1"); displaySD.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { displaySDActionPerformed(evt); } }); timeIncidentDuplicate.setText("jCheckBox1"); timeIncidentDuplicate.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { timeIncidentDuplicateActionPerformed(evt); } }); jLabel34.setText("One Incident per Time"); jLabel34.setToolTipText("if selected only one band will be indicted per time incident"); // NOI18N jLabel33.setText("Rem Static Discharge"); jLabel33.setToolTipText("do not show static discharges in the list"); // NOI18N jLabel20.setText("Threshold"); jLabel20.setToolTipText("set the indicator level - higher values yield fewer openings"); // NOI18N javax.swing.GroupLayout jPanel26Layout = new javax.swing.GroupLayout(jPanel26); jPanel26.setLayout(jPanel26Layout); jPanel26Layout.setHorizontalGroup( jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel26Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel26Layout.createSequentialGroup() .addComponent(jLabel20) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(propThreshold, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel26Layout.createSequentialGroup() .addGroup(jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel33) .addComponent(jLabel34)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(displaySD, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(timeIncidentDuplicate, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addContainerGap(11, Short.MAX_VALUE)) ); jPanel26Layout.setVerticalGroup( jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel26Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(propThreshold, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel20)) .addGap(16, 16, 16) .addGroup(jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel33) .addComponent(displaySD)) .addGap(18, 18, 18) .addGroup(jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel34) .addComponent(timeIncidentDuplicate)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel28.setBorder(javax.swing.BorderFactory.createEtchedBorder()); numberOfEntries.setText("list Entries"); propAmp.setToolTipText("set the contrast of the propagation display "); propAmp.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { propAmpStateChanged(evt); } }); propagationLisiting.setText("Open List"); propagationLisiting.setToolTipText("open HTML propagation listing"); propagationLisiting.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { propagationLisitingActionPerformed(evt); } }); jLabel19.setText("Prop Amp"); jLabel19.setToolTipText("gray scale of the propagation time chart"); // NOI18N jLabel35.setText("Items"); jLabel35.setToolTipText("number of listed items in propagation list - not including SD events"); // NOI18N javax.swing.GroupLayout jPanel28Layout = new javax.swing.GroupLayout(jPanel28); jPanel28.setLayout(jPanel28Layout); jPanel28Layout.setHorizontalGroup( jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel28Layout.createSequentialGroup() .addContainerGap(17, Short.MAX_VALUE) .addGroup(jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel28Layout.createSequentialGroup() .addGroup(jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel19) .addComponent(jLabel35)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(propAmp, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(numberOfEntries, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap()) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel28Layout.createSequentialGroup() .addComponent(propagationLisiting) .addGap(24, 24, 24)))) ); jPanel28Layout.setVerticalGroup( jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel28Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(propAmp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel19)) .addGap(18, 18, 18) .addGroup(jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jLabel35, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(numberOfEntries, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addComponent(propagationLisiting) .addContainerGap()) ); jPanel28Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jLabel35, numberOfEntries}); jPanel28Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jLabel19, propAmp}); javax.swing.GroupLayout jPanel25Layout = new javax.swing.GroupLayout(jPanel25); jPanel25.setLayout(jPanel25Layout); jPanel25Layout.setHorizontalGroup( jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel25Layout.createSequentialGroup() .addContainerGap() .addComponent(propTrackPane, javax.swing.GroupLayout.PREFERRED_SIZE, 327, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jPanel26, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jPanel28, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); jPanel25Layout.setVerticalGroup( jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel25Layout.createSequentialGroup() .addGroup(jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel25Layout.createSequentialGroup() .addContainerGap() .addComponent(propTrackPane, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel25Layout.createSequentialGroup() .addGap(18, 18, 18) .addGroup(jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jPanel28, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel26, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jTabbedPane2.addTab("Prop Tracker", jPanel25); NOAAalertsText.setEditable(false); NOAAalertsText.setColumns(20); NOAAalertsText.setForeground(new java.awt.Color(-13421569,true)); NOAAalertsText.setLineWrap(true); NOAAalertsText.setRows(25); NOAAalertsText.setWrapStyleWord(true); NOAAalertsText.setMaximumSize(new java.awt.Dimension(500, 700)); NOAAalertsText.setMinimumSize(new java.awt.Dimension(500, 700)); jScrollPane3.setViewportView(NOAAalertsText); NOAAMessage.setEditable(false); NOAAMessage.setFont(new java.awt.Font("Dialog", 1, 12)); NOAAMessage.setText("Last NOAA Message"); SA_getNOAAalert.setText("Get Alert"); SA_getNOAAalert.setToolTipText("download latest NOAA alert manually - hover will clear the alert message"); // NOI18N SA_getNOAAalert.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { SA_getNOAAalertMouseEntered(evt); } }); SA_getNOAAalert.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { SA_getNOAAalertActionPerformed(evt); } }); setAndClearAlerts.setText("Set/Clr"); setAndClearAlerts.setToolTipText("set or clear Alert"); setAndClearAlerts.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { setAndClearAlertsActionPerformed(evt); } }); alertPresistance.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "1h", "2h", "3h" })); alertPresistance.setSelectedIndex(2); alertPresistance.setToolTipText("time for alert until it expires"); alertPresistance.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { alertPresistanceActionPerformed(evt); } }); alertTime.setEditable(false); alertTimeCleared.setEditable(false); uploadDataFTP.setText("Upload "); uploadDataFTP.setToolTipText("upload Data to MDSR server"); uploadDataFTP.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { uploadDataFTPActionPerformed(evt); } }); javax.swing.GroupLayout jPanel32Layout = new javax.swing.GroupLayout(jPanel32); jPanel32.setLayout(jPanel32Layout); jPanel32Layout.setHorizontalGroup( jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel32Layout.createSequentialGroup() .addGroup(jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel32Layout.createSequentialGroup() .addComponent(NOAAAlertBanner, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(121, 121, 121)) .addGroup(jPanel32Layout.createSequentialGroup() .addComponent(alertPresistance, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 14, Short.MAX_VALUE) .addComponent(alertTimeCleared, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(setAndClearAlerts))) .addContainerGap()) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel32Layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addComponent(SA_getNOAAalert) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(uploadDataFTP, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(27, 27, 27)) .addGroup(jPanel32Layout.createSequentialGroup() .addGroup(jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(alertTime, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(NOAAMessage, javax.swing.GroupLayout.PREFERRED_SIZE, 237, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(0, 0, Short.MAX_VALUE)) ); jPanel32Layout.setVerticalGroup( jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel32Layout.createSequentialGroup() .addComponent(NOAAMessage, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(13, 13, 13) .addGroup(jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(NOAAAlertBanner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(alertTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(alertPresistance, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(alertTimeCleared, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(setAndClearAlerts)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(uploadDataFTP) .addComponent(SA_getNOAAalert)) .addGap(15, 15, 15)) ); 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() .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 467, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jPanel32, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel30Layout.setVerticalGroup( jPanel30Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel30Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel30Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jPanel32, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)) .addContainerGap()) ); jTabbedPane2.addTab("NOAA", jPanel30); SA_saveUserParameters.setText("Save"); SA_saveUserParameters.setToolTipText("save current user profile"); SA_saveUserParameters.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { SA_saveUserParametersActionPerformed(evt); } }); clearFtpActivity.setText("Clear"); clearFtpActivity.setToolTipText("clear FTP messages"); clearFtpActivity.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { clearFtpActivityActionPerformed(evt); } }); jPanel29.setBorder(javax.swing.BorderFactory.createTitledBorder("Station")); elevation.setText("elevation"); antenna.setText("antenna"); gridSquare.setText("gridSquare"); callSign.setText("callSign"); jLabel38.setText("Elevation"); jLabel38.setToolTipText("elevation of your station in meters"); jLabel42.setText("Antenna"); jLabel42.setToolTipText("type or model number of used antenna"); jLabel37.setText("Grid Sqare"); jLabel37.setToolTipText("enter grid square"); jLabel36.setText("Call Sign"); jLabel36.setToolTipText("enter your call"); javax.swing.GroupLayout jPanel29Layout = new javax.swing.GroupLayout(jPanel29); jPanel29.setLayout(jPanel29Layout); jPanel29Layout.setHorizontalGroup( jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel29Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel36) .addComponent(jLabel38) .addComponent(jLabel37) .addComponent(jLabel42, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(antenna, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 81, Short.MAX_VALUE) .addComponent(elevation, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 81, Short.MAX_VALUE) .addComponent(gridSquare, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 81, Short.MAX_VALUE) .addComponent(callSign, javax.swing.GroupLayout.DEFAULT_SIZE, 81, Short.MAX_VALUE)) .addContainerGap()) ); jPanel29Layout.setVerticalGroup( jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel29Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(callSign, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel36)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel37) .addComponent(gridSquare, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel42, javax.swing.GroupLayout.Alignment.TRAILING, 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)) .addGroup(jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel29Layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(elevation, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(38, 38, 38)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel29Layout.createSequentialGroup() .addGap(12, 12, 12) .addComponent(jLabel38) .addGap(42, 42, 42))) .addContainerGap()) ); jPanel29Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {antenna, callSign, elevation, gridSquare}); jPanel31.setBorder(javax.swing.BorderFactory.createTitledBorder("FTP Upload")); jLabel49.setText("FTP Server"); jLabel49.setToolTipText("enter FTP servername (www.sever.com)"); jLabel50.setText("Directory"); jLabel50.setToolTipText("enter the directory of the remote file"); ftpPassWord.setText("jPasswordField1"); jLabel47.setText("Password"); jLabel47.setToolTipText("enter password"); ftpUserName.setText("userName"); jLabel48.setText("User Name"); jLabel48.setToolTipText("enter user name"); ftpServer.setText("FTP Server"); ftpDirectory.setText("directory"); javax.swing.GroupLayout jPanel31Layout = new javax.swing.GroupLayout(jPanel31); jPanel31.setLayout(jPanel31Layout); jPanel31Layout.setHorizontalGroup( jPanel31Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel31Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel31Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel31Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel49, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel47) .addComponent(jLabel48, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addComponent(jLabel50)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel31Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(ftpServer, javax.swing.GroupLayout.DEFAULT_SIZE, 147, Short.MAX_VALUE) .addComponent(ftpDirectory, javax.swing.GroupLayout.DEFAULT_SIZE, 147, Short.MAX_VALUE) .addComponent(ftpUserName, javax.swing.GroupLayout.DEFAULT_SIZE, 147, Short.MAX_VALUE) .addComponent(ftpPassWord, javax.swing.GroupLayout.DEFAULT_SIZE, 147, Short.MAX_VALUE)) .addContainerGap()) ); jPanel31Layout.setVerticalGroup( jPanel31Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel31Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel31Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel49) .addComponent(ftpServer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel31Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel50, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(ftpDirectory, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel31Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(ftpUserName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel48)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel31Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel47) .addComponent(ftpPassWord, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(11, 11, 11)) ); ftpActivity.setEditable(false); ftpActivity.setColumns(20); ftpActivity.setFont(new java.awt.Font("Dialog", 0, 10)); ftpActivity.setForeground(new java.awt.Color(-13421569,true)); ftpActivity.setLineWrap(true); ftpActivity.setRows(25); ftpActivity.setWrapStyleWord(true); ftpActivity.setMaximumSize(new java.awt.Dimension(500, 700)); ftpActivity.setMinimumSize(new java.awt.Dimension(500, 700)); jScrollPane1.setViewportView(ftpActivity); uploadEnabled.setText("jCheckBox1"); uploadEnabled.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { uploadEnabledActionPerformed(evt); } }); jLabel43.setText("Upload"); jLabel43.setToolTipText("check to upload files to FTP site"); // NOI18N javax.swing.GroupLayout jPanel27Layout = new javax.swing.GroupLayout(jPanel27); jPanel27.setLayout(jPanel27Layout); jPanel27Layout.setHorizontalGroup( jPanel27Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel27Layout.createSequentialGroup() .addContainerGap() .addComponent(jPanel29, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel31, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel27Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel27Layout.createSequentialGroup() .addGap(4, 4, 4) .addComponent(jLabel43) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(uploadEnabled, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(SA_saveUserParameters) .addGap(18, 18, 18) .addComponent(clearFtpActivity)) .addComponent(jScrollPane1)) .addContainerGap()) ); jPanel27Layout.setVerticalGroup( jPanel27Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel27Layout.createSequentialGroup() .addGroup(jPanel27Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel27Layout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel27Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(SA_saveUserParameters) .addComponent(clearFtpActivity) .addComponent(jLabel43) .addComponent(uploadEnabled))) .addComponent(jPanel29, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 156, Short.MAX_VALUE) .addComponent(jPanel31, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jTabbedPane2.addTab("User", jPanel27); jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Correction Editor", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 1, 10))); // NOI18N SA_manButton.setText("Man"); SA_manButton.setToolTipText("update manual entry"); SA_manButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { SA_manButtonActionPerformed(evt); } }); SA_BinSelector.setToolTipText("select bin number to view"); SA_BinSelector.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { SA_BinSelectorStateChanged(evt); } }); jLabel10.setText("Bin Eval"); jLabel10.setToolTipText("displays the correction value for each bin"); SA_corrButton.setText("Corr"); SA_corrButton.setToolTipText("correct error - average of adjacent numbers"); SA_corrButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { SA_corrButtonActionPerformed(evt); } }); SA_corrValue.setText("Bin 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() .addComponent(jLabel10) .addGap(3, 3, 3) .addComponent(SA_BinSelector, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(SA_corrValue, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(SA_corrButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(SA_manButton) .addContainerGap()) ); jPanel5Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {SA_corrButton, SA_manButton}); jPanel5Layout.setVerticalGroup( jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel5Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(SA_corrButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(SA_manButton)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel10) .addComponent(SA_BinSelector, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(SA_corrValue, javax.swing.GroupLayout.Alignment.TRAILING, 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[] {SA_corrButton, SA_manButton}); jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Correct Spectrum", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 1, 10))); // NOI18N acceptButton.setText("Correct"); acceptButton.setToolTipText("accept the normalizing curve and correct the spectrum"); acceptButton.setEnabled(false); acceptButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { acceptButtonActionPerformed(evt); } }); SA_equalizerMode.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "normal", "corrected", "calibrate" })); SA_equalizerMode.setToolTipText("choose if the spectrum is corrected or displayed normally"); SA_equalizerMode.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { SA_equalizerModeActionPerformed(evt); } }); equalizeButton.setText("Equalize"); equalizeButton.setToolTipText("measure the peak spectrum to normalize the spectrum"); equalizeButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { equalizeButtonActionPerformed(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() .addComponent(SA_equalizerMode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(equalizeButton) .addGap(18, 18, 18) .addComponent(acceptButton) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel7Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {acceptButton, equalizeButton}); jPanel7Layout.setVerticalGroup( jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel7Layout.createSequentialGroup() .addGap(1, 1, 1) .addComponent(SA_equalizerMode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(equalizeButton) .addComponent(acceptButton, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)) ); jPanel8.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Refresh Rate", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 1, 10))); // NOI18N SA_refreshTime.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0", "1", "2", "3", "4", "5" })); SA_refreshTime.setToolTipText("a higher value slows down the spectum display to save processor time"); SA_refreshTime.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { SA_refreshTimeActionPerformed(evt); } }); SA_time.setText("N/A"); javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8); jPanel8.setLayout(jPanel8Layout); jPanel8Layout.setHorizontalGroup( jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel8Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel8Layout.createSequentialGroup() .addComponent(SA_refreshTime, 0, 41, Short.MAX_VALUE) .addGap(20, 20, 20)) .addGroup(jPanel8Layout.createSequentialGroup() .addComponent(SA_time, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(34, Short.MAX_VALUE)))) ); jPanel8Layout.setVerticalGroup( jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup() .addComponent(SA_time, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(SA_refreshTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); jPanel11.setBorder(javax.swing.BorderFactory.createTitledBorder(null, " Select Input", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 1, 10))); // NOI18N jPanel11.setForeground(new java.awt.Color(-16776961,true)); SA_inputSelector.setMaximumRowCount(10); SA_inputSelector.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "both", "left", "right" })); SA_inputSelector.setToolTipText("select the input channel for FFT processing"); SA_inputSelector.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { SA_inputSelectorActionPerformed(evt); } }); javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11); jPanel11.setLayout(jPanel11Layout); jPanel11Layout.setHorizontalGroup( jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel11Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(SA_inputSelector, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); jPanel11Layout.setVerticalGroup( jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel11Layout.createSequentialGroup() .addComponent(SA_inputSelector, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel12.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Correction Curve", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 1, 10))); // NOI18N SA_recallCorrectionCurve.setMaximumRowCount(10); SA_recallCorrectionCurve.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "160", "80", "60", "40", "30", "20", "17", "15", "12", "10", "6" })); SA_recallCorrectionCurve.setToolTipText("select band to store correction curve"); SA_recallCorrectionCurve.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { SA_recallCorrectionCurveActionPerformed(evt); } }); SA_saveCorrectionCurve.setText("Save"); SA_saveCorrectionCurve.setToolTipText("save current correction curve"); SA_saveCorrectionCurve.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { SA_saveCorrectionCurveActionPerformed(evt); } }); SA_loadCorrectionCurve.setText("Load"); SA_loadCorrectionCurve.setToolTipText("load the selected correction curve"); SA_loadCorrectionCurve.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { SA_loadCorrectionCurveActionPerformed(evt); } }); SA_correctionCurveCurrent.setEditable(false); SA_correctionCurveCurrent.setName("CorrectionCurveApplied"); // NOI18N SA_correctionCurveCurrent.setText("160"); javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12); jPanel12.setLayout(jPanel12Layout); jPanel12Layout.setHorizontalGroup( jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel12Layout.createSequentialGroup() .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel12Layout.createSequentialGroup() .addGap(1, 1, 1) .addComponent(SA_saveCorrectionCurve)) .addGroup(jPanel12Layout.createSequentialGroup() .addContainerGap() .addComponent(SA_correctionCurveCurrent, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(SA_loadCorrectionCurve) .addComponent(SA_recallCorrectionCurve, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel12Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {SA_loadCorrectionCurve, SA_saveCorrectionCurve}); jPanel12Layout.setVerticalGroup( jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel12Layout.createSequentialGroup() .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(SA_recallCorrectionCurve, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(SA_correctionCurveCurrent, 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(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(SA_loadCorrectionCurve) .addComponent(SA_saveCorrectionCurve)) .addContainerGap()) ); jPanel12Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {SA_loadCorrectionCurve, SA_saveCorrectionCurve}); jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Calibration", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 1, 10))); // NOI18N jLabel13.setFont(new java.awt.Font("Dialog", 1, 10)); // NOI18N jLabel13.setText("Test Signal [kHz]"); jLabel13.setToolTipText("change to inject a noisy sine tone into the input of the analyzer, 0 is off "); SA_Frequency.setToolTipText("select tone frequency in 1kHz steps"); SA_Frequency.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { SA_FrequencyStateChanged(evt); } }); javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6); jPanel6.setLayout(jPanel6Layout); jPanel6Layout.setHorizontalGroup( jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout.createSequentialGroup() .addContainerGap() .addComponent(SA_Frequency, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(jPanel6Layout.createSequentialGroup() .addComponent(jLabel13) .addGap(0, 0, Short.MAX_VALUE)) ); jPanel6Layout.setVerticalGroup( jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout.createSequentialGroup() .addComponent(jLabel13) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(SA_Frequency, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel15.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "X-Marker", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 1, 10))); // NOI18N SA_yGrid.setToolTipText("move the displayed grid until it is matches the spectrum display"); SA_yGrid.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { SA_yGridStateChanged(evt); } }); javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15); jPanel15.setLayout(jPanel15Layout); jPanel15Layout.setHorizontalGroup( jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel15Layout.createSequentialGroup() .addComponent(SA_yGrid, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(18, Short.MAX_VALUE)) ); jPanel15Layout.setVerticalGroup( jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel15Layout.createSequentialGroup() .addComponent(SA_yGrid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel16.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Option", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 1, 10))); // NOI18N SA_optionMode.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Peakhold", "Normal", "Decay" })); SA_optionMode.setSelectedIndex(1); SA_optionMode.setToolTipText("select how the spectum is analyzed"); SA_optionMode.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { SA_optionModeActionPerformed(evt); } }); javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16); jPanel16.setLayout(jPanel16Layout); jPanel16Layout.setHorizontalGroup( jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel16Layout.createSequentialGroup() .addComponent(SA_optionMode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 1, Short.MAX_VALUE)) ); jPanel16Layout.setVerticalGroup( jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel16Layout.createSequentialGroup() .addComponent(SA_optionMode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 4, Short.MAX_VALUE)) ); jPanel17.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Graph", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 1, 10))); // NOI18N SA_graphFunction.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "line", "bar" })); SA_graphFunction.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { SA_graphFunctionActionPerformed(evt); } }); javax.swing.GroupLayout jPanel17Layout = new javax.swing.GroupLayout(jPanel17); jPanel17.setLayout(jPanel17Layout); jPanel17Layout.setHorizontalGroup( jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel17Layout.createSequentialGroup() .addContainerGap() .addComponent(SA_graphFunction, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel17Layout.setVerticalGroup( jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel17Layout.createSequentialGroup() .addComponent(SA_graphFunction, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jPanel17, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE) .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) .addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel8, 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) .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, 346, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel15, 0, 48, Short.MAX_VALUE) .addComponent(jPanel16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jPanel17, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel8, 0, 81, Short.MAX_VALUE) .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, 81, Short.MAX_VALUE)) .addContainerGap()) ); jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jPanel11, jPanel15, jPanel16, jPanel17, jPanel7}); jTabbedPane2.addTab("Setup", jPanel1); dataCollectionSeviceON.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Processes", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 1, 10))); // NOI18N jDesktopPane1.setBorder(javax.swing.BorderFactory.createTitledBorder("Graph")); stopPropGraph.setText("Stop"); stopPropGraph.setToolTipText("stop the Graph service"); stopPropGraph.setEnabled(false); stopPropGraph.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { stopPropGraphActionPerformed(evt); } }); startPropGraph.setText("Start."); startPropGraph.setToolTipText("start the Graph service"); startPropGraph.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { startPropGraphActionPerformed(evt); } }); graphServiceON.setText("started"); graphServiceON.setToolTipText("Graph service started"); graphServiceON.setFocusable(false); jDesktopPane1.setLayer(stopPropGraph, javax.swing.JLayeredPane.DEFAULT_LAYER); jDesktopPane1.setLayer(startPropGraph, javax.swing.JLayeredPane.DEFAULT_LAYER); jDesktopPane1.setLayer(graphServiceON, 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(javax.swing.GroupLayout.Alignment.TRAILING, jDesktopPane1Layout.createSequentialGroup() .addGap(4, 4, 4) .addComponent(stopPropGraph, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(startPropGraph) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(graphServiceON) .addContainerGap()) ); jDesktopPane1Layout.setVerticalGroup( jDesktopPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jDesktopPane1Layout.createSequentialGroup() .addGroup(jDesktopPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(stopPropGraph) .addComponent(startPropGraph) .addComponent(graphServiceON)) .addGap(0, 13, Short.MAX_VALUE)) ); SA_listServices.setMaximumRowCount(20); SA_listServices.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Running Processes" })); SA_listServices.setToolTipText("choose the process you want to change"); SA_listServices.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { SA_listServicesActionPerformed(evt); } }); killProcessButton.setText("ReFresh"); killProcessButton.setToolTipText("kill selected service"); killProcessButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { killProcessButtonActionPerformed(evt); } }); CheckBoxShowAll.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { CheckBoxShowAllStateChanged(evt); } }); CheckBoxShowAll.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { CheckBoxShowAllActionPerformed(evt); } }); jLabel44.setText("Show All"); jLabel44.setToolTipText("number of listed items in propagation list - not including SD events"); // NOI18N threadRestartLog.setEditable(false); threadRestartLog.setColumns(20); threadRestartLog.setForeground(new java.awt.Color(-13421569,true)); threadRestartLog.setLineWrap(true); threadRestartLog.setRows(25); threadRestartLog.setWrapStyleWord(true); threadRestartLog.setMaximumSize(new java.awt.Dimension(500, 700)); threadRestartLog.setMinimumSize(new java.awt.Dimension(500, 700)); jScrollPane4.setViewportView(threadRestartLog); jDesktopPane2.setBorder(javax.swing.BorderFactory.createTitledBorder("Data Collection")); propagRestart.setName(""); // NOI18N propagRestart.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { propagRestartActionPerformed(evt); } }); dataCollectionON.setText("started"); dataCollectionON.setToolTipText("Data service started"); reStrartDataColl.setText("ReStart Data."); reStrartDataColl.setToolTipText("data collection re-start"); reStrartDataColl.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { reStrartDataCollActionPerformed(evt); } }); jDesktopPane2.setLayer(propagRestart, javax.swing.JLayeredPane.DEFAULT_LAYER); jDesktopPane2.setLayer(dataCollectionON, javax.swing.JLayeredPane.DEFAULT_LAYER); jDesktopPane2.setLayer(reStrartDataColl, 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() .addComponent(reStrartDataColl) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(dataCollectionON) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(propagRestart, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)) ); jDesktopPane2Layout.setVerticalGroup( jDesktopPane2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(reStrartDataColl) .addComponent(dataCollectionON) .addComponent(propagRestart, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) ); javax.swing.GroupLayout dataCollectionSeviceONLayout = new javax.swing.GroupLayout(dataCollectionSeviceON); dataCollectionSeviceON.setLayout(dataCollectionSeviceONLayout); dataCollectionSeviceONLayout.setHorizontalGroup( dataCollectionSeviceONLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(dataCollectionSeviceONLayout.createSequentialGroup() .addComponent(killProcessButton) .addGap(26, 26, 26) .addComponent(CheckBoxShowAll) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel44) .addGap(36, 36, 36) .addComponent(SA_listServices, 0, 496, Short.MAX_VALUE)) .addGroup(dataCollectionSeviceONLayout.createSequentialGroup() .addGroup(dataCollectionSeviceONLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jDesktopPane1, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jDesktopPane2, javax.swing.GroupLayout.Alignment.LEADING)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(dataCollectionSeviceONLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, dataCollectionSeviceONLayout.createSequentialGroup() .addGap(0, 301, Short.MAX_VALUE) .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 433, javax.swing.GroupLayout.PREFERRED_SIZE))) ); dataCollectionSeviceONLayout.setVerticalGroup( dataCollectionSeviceONLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, dataCollectionSeviceONLayout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addComponent(jDesktopPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jDesktopPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(dataCollectionSeviceONLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(killProcessButton, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(SA_listServices, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(dataCollectionSeviceONLayout.createSequentialGroup() .addGap(6, 6, 6) .addGroup(dataCollectionSeviceONLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel44, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(CheckBoxShowAll, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) .addContainerGap()) .addGroup(dataCollectionSeviceONLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(dataCollectionSeviceONLayout.createSequentialGroup() .addGap(6, 6, 6) .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(44, Short.MAX_VALUE))) ); jTabbedPane2.addTab("Maintenance", dataCollectionSeviceON); jPanel3.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jLabel9.setText("dB"); jLabel9.setToolTipText("Change how the spectrum is displayed"); jLabel3.setText("dB"); jLabel3.setToolTipText("choose between line and bar grah display"); exitButton.setText("Exit"); exitButton.setToolTipText("close the program"); exitButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { exitButtonActionPerformed(evt); } }); SA_dominatFrequencyValue.setFont(new java.awt.Font("Dialog", 0, 10)); // NOI18N SA_dominatFrequencyValue.setText("Frequency"); jLabel7.setText("kHz"); jLabel6.setText("Dominant"); jLabel6.setToolTipText("displays the frequency of the highest peak"); RST_button.setText("RST"); RST_button.setToolTipText("resets the audio engine without closing the program"); RST_button.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { RST_buttonActionPerformed(evt); } }); SA_dominantFrequencyLevel.setFont(new java.awt.Font("Dialog", 0, 10)); // NOI18N SA_dominantFrequencyLevel.setText("Peak Level"); SA_dominantFrequencyLevel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { SA_dominantFrequencyLevelActionPerformed(evt); } }); jLabel14.setText("Peak"); jLabel14.setToolTipText("indicates the noise and the peak level of the displayed signal in dB"); SA_averageNoiseValue.setFont(new java.awt.Font("Dialog", 0, 10)); // NOI18N SA_averageNoiseValue.setText("noiseLevel"); jLabel8.setText("Noise"); jLabel8.setToolTipText("indicates the noise and the peak level of the displayed signal in dB"); Start.setText("Start"); Start.setToolTipText("start the audio engine to display the spectrum"); Start.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { StartActionPerformed(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() .addComponent(jLabel6) .addGap(2, 2, 2) .addComponent(SA_dominatFrequencyValue, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(1, 1, 1) .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabel8) .addGap(2, 2, 2) .addComponent(SA_averageNoiseValue, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(2, 2, 2) .addComponent(jLabel9) .addGap(38, 38, 38) .addComponent(jLabel14) .addGap(2, 2, 2) .addComponent(SA_dominantFrequencyLevel, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(2, 2, 2) .addComponent(jLabel3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 60, Short.MAX_VALUE) .addComponent(Start, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(RST_button, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(10, 10, 10) .addComponent(exitButton, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {RST_button, exitButton}); jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(SA_dominantFrequencyLevel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel14)) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(exitButton) .addComponent(Start, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(RST_button)) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jLabel9, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(SA_averageNoiseValue, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jLabel6, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel3Layout.createSequentialGroup() .addGap(2, 2, 2) .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addComponent(SA_dominatFrequencyValue, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap()) ); jPanel3Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {RST_button, exitButton}); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jTabbedPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 749, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jPanel3, 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() .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jTabbedPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 186, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel9.add(jPanel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 330, 770, 270)); jPanel4.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jPanel4.setMaximumSize(null); frequencyMarquee.setBackground(new java.awt.Color(-8355712,true)); frequencyMarquee.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); frequencyMarquee.setToolTipText("if blank please press the rest button or change frequency"); frequencyMarquee.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); frequencyMarquee.setFont(new java.awt.Font("Dialog", 0, 10)); // NOI18N javax.swing.GroupLayout frequencyMarqueeLayout = new javax.swing.GroupLayout(frequencyMarquee); frequencyMarquee.setLayout(frequencyMarqueeLayout); frequencyMarqueeLayout.setHorizontalGroup( frequencyMarqueeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 418, Short.MAX_VALUE) ); frequencyMarqueeLayout.setVerticalGroup( frequencyMarqueeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 0, Short.MAX_VALUE) ); jTabbedPane1.setFont(new java.awt.Font("Dialog", 1, 10)); // NOI18N SA_displayGain.setForeground(new java.awt.Color(-16777216,true)); SA_displayGain.setMajorTickSpacing(20); SA_displayGain.setMinorTickSpacing(10); SA_displayGain.setOrientation(javax.swing.JSlider.VERTICAL); SA_displayGain.setPaintLabels(true); SA_displayGain.setPaintTicks(true); SA_displayGain.setToolTipText("set for best amplification"); SA_displayGain.setValue(10); SA_displayGain.setBorder(javax.swing.BorderFactory.createTitledBorder("Y-Gain")); SA_displayGain.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { SA_displayGainStateChanged(evt); } }); jLabel11.setText("BW"); SA_bandwidthSelector.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "20kHz", "10kHz", "5kHz" })); SA_bandwidthSelector.setToolTipText("select displayed spectum from 0-5, 0-10, 0-20kHz"); SA_bandwidthSelector.setEnabled(false); SA_bandwidthSelector.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { SA_bandwidthSelectorActionPerformed(evt); } }); jLabel12.setText("V-filter"); SA_displayLevel.setForeground(new java.awt.Color(-16777216,true)); SA_displayLevel.setMajorTickSpacing(20); SA_displayLevel.setMinimum(20); SA_displayLevel.setMinorTickSpacing(10); SA_displayLevel.setOrientation(javax.swing.JSlider.VERTICAL); SA_displayLevel.setPaintLabels(true); SA_displayLevel.setPaintTicks(true); SA_displayLevel.setToolTipText("move reference level up and down"); SA_displayLevel.setValue(40); SA_displayLevel.setBorder(javax.swing.BorderFactory.createTitledBorder("Ref. Level")); SA_displayLevel.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { SA_displayLevelStateChanged(evt); } }); SA_videoFilterSelector.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "1", "2", "3", "4", "5" })); SA_videoFilterSelector.setSelectedIndex(2); SA_videoFilterSelector.setToolTipText("select the display filter option"); SA_videoFilterSelector.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { SA_videoFilterSelectorActionPerformed(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(jLabel11) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(SA_bandwidthSelector, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(8, 8, 8)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup() .addComponent(SA_displayGain, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))) .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(jPanel10Layout.createSequentialGroup() .addComponent(jLabel12) .addGap(4, 4, 4) .addComponent(SA_videoFilterSelector, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(SA_displayLevel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(32, Short.MAX_VALUE)) ); jPanel10Layout.setVerticalGroup( jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(SA_displayGain, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(SA_displayLevel, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(SA_bandwidthSelector, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel11) .addComponent(SA_videoFilterSelector, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel12)) .addContainerGap()) ); jTabbedPane1.addTab("Controls", jPanel10); updateCalibration.setMaximumRowCount(3); updateCalibration.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Auto", "Man" })); updateCalibration.setSelectedIndex(1); updateCalibration.setToolTipText("set to \"Auto\" to change calibration depending on frequency"); RigFrequency.setText("0"); jLabel4.setText("RIG Freq."); jLabel5.setText("RIG Mode"); RigMode.setEditable(false); RigMode.setText("N/A"); jLabel15.setText("RIG State"); RigState.setEditable(false); RigState.setText("RX"); jLabel16.setText("Filterpass [Hz]"); filterpassLow.setEditable(false); filterpassLow.setText("N/A"); filterpassHigh.setEditable(false); filterpassHigh.setText("N/A"); jLabel17.setText("Correction Freq. [Hz]"); corretionFreq.setEditable(false); corretionFreq.setText("0"); jLabel18.setText("kHz"); jLabel22.setText("Update corr. Curve"); dataSelector.setMaximumRowCount(3); dataSelector.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "MDSR", "flrig" })); dataSelector.setSelectedIndex(1); dataSelector.setToolTipText("select between MDSR and flrig CAT input"); dataSelector.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { dataSelectorActionPerformed(evt); } }); flrigConnected.setText("NA"); updateFequencyCenter.setText("Cal."); updateFequencyCenter.setToolTipText("to calibrate the SA center frequncy tune in a known carrier, set to frequency and press button"); updateFequencyCenter.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { updateFequencyCenterActionPerformed(evt); } }); javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13); jPanel13.setLayout(jPanel13Layout); jPanel13Layout.setHorizontalGroup( jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel13Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel13Layout.createSequentialGroup() .addGap(157, 157, 157) .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(48, Short.MAX_VALUE)) .addGroup(jPanel13Layout.createSequentialGroup() .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel13Layout.createSequentialGroup() .addComponent(flrigConnected, 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(dataSelector, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel13Layout.createSequentialGroup() .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel13Layout.createSequentialGroup() .addComponent(jLabel22) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(updateCalibration, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel13Layout.createSequentialGroup() .addComponent(jLabel4) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(RigFrequency, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(0, 9, Short.MAX_VALUE)) .addGroup(jPanel13Layout.createSequentialGroup() .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel13Layout.createSequentialGroup() .addComponent(jLabel15) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(RigState, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel13Layout.createSequentialGroup() .addComponent(jLabel5) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(RigMode, javax.swing.GroupLayout.DEFAULT_SIZE, 41, Short.MAX_VALUE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(updateFequencyCenter, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(jPanel13Layout.createSequentialGroup() .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel13Layout.createSequentialGroup() .addComponent(jLabel16) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(filterpassLow, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jLabel17)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(corretionFreq, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(filterpassHigh, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) .addContainerGap()))) ); jPanel13Layout.setVerticalGroup( jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel13Layout.createSequentialGroup() .addContainerGap(22, Short.MAX_VALUE) .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(dataSelector, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(flrigConnected, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(RigFrequency, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel18) .addComponent(jLabel4)) .addGap(16, 16, 16) .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel5) .addComponent(RigMode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(RigState, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel15) .addComponent(updateFequencyCenter, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel16) .addComponent(filterpassHigh, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(filterpassLow, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel17) .addComponent(corretionFreq, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel22) .addComponent(updateCalibration, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(71, 71, 71)) ); jTabbedPane1.addTab("RIG Data", jPanel13); scanTime.setMaximumRowCount(6); scanTime.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "6h" })); scanTime.setToolTipText("set to \"Auto\" to change calibration depending on frequency"); scanTime.setEnabled(false); scanTime.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { scanTimeActionPerformed(evt); } }); jLabel24.setText("Scan Display"); timeIntPG.setEditable(false); timeIntPG.setText("1s"); jLabel25.setText("Check every"); lastDataPoint.setText("none"); jLabel26.setText("Last Data Point"); currentFrequency.setText("ScanX"); jLabel30.setText("Current Freq. [Hz]"); scanStartButton.setText("Start Scan"); scanStartButton.setToolTipText("press here to start the measurement"); scanStartButton.setEnabled(false); scanStartButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { scanStartButtonActionPerformed(evt); } }); pauseResumeToggleButton.setFont(new java.awt.Font("Dialog", 1, 10)); // NOI18N pauseResumeToggleButton.setText("Pause/Res"); pauseResumeToggleButton.setToolTipText("pause and resume scanner/measurement "); pauseResumeToggleButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { pauseResumeToggleButtonActionPerformed(evt); } }); saveDataButton.setText("Save Data"); saveDataButton.setToolTipText("save collected data to CSV file"); saveDataButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { saveDataButtonActionPerformed(evt); } }); jLabel31.setText("Auto Save"); jLabel31.setToolTipText(""); autoSaveCheckBox.setToolTipText("save measurement data every 24h"); savePNGButton.setText("Save PNG"); savePNGButton.setToolTipText("save propagation display to png image file"); savePNGButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { savePNGButtonActionPerformed(evt); } }); autoSaveCheckBoxImage.setToolTipText("save/update image every 10 min"); jLabel32.setText("Auto Save"); jLabel32.setToolTipText(""); refreshTimePG.setMaximumRowCount(3); refreshTimePG.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "1s", "1m" })); refreshTimePG.setToolTipText("set the graph refesh rate - 1 m for long term monitoring"); refreshTimePG.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { refreshTimePGActionPerformed(evt); } }); javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14); jPanel14.setLayout(jPanel14Layout); jPanel14Layout.setHorizontalGroup( jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel14Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel14Layout.createSequentialGroup() .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel14Layout.createSequentialGroup() .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel25) .addComponent(jLabel24) .addComponent(jLabel26)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(scanTime, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(lastDataPoint, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel14Layout.createSequentialGroup() .addComponent(timeIntPG, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(refreshTimePG, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel14Layout.createSequentialGroup() .addComponent(jLabel30) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(currentFrequency, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(22, 22, 22)) .addGroup(jPanel14Layout.createSequentialGroup() .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel14Layout.createSequentialGroup() .addComponent(scanStartButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(pauseResumeToggleButton)) .addGroup(jPanel14Layout.createSequentialGroup() .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(savePNGButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(saveDataButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel14Layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabel31)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel14Layout.createSequentialGroup() .addGap(10, 10, 10) .addComponent(jLabel32))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(autoSaveCheckBoxImage) .addComponent(autoSaveCheckBox)))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) ); jPanel14Layout.setVerticalGroup( jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel14Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel26) .addComponent(lastDataPoint, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel25) .addComponent(timeIntPG, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(refreshTimePG, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(scanTime, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel24)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel30) .addComponent(currentFrequency, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(scanStartButton) .addComponent(pauseResumeToggleButton)) .addGap(18, 18, 18) .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(saveDataButton) .addComponent(jLabel31)) .addComponent(autoSaveCheckBox)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(savePNGButton) .addComponent(jLabel32)) .addComponent(autoSaveCheckBoxImage)) .addContainerGap()) ); jTabbedPane1.addTab("Propagation", jPanel14); jLabel23.setFont(new java.awt.Font("Dialog", 1, 14)); jLabel23.setText("MHz"); screenSwitch.setBackground(new java.awt.Color(-16777216,true)); screenSwitch.setForeground(new java.awt.Color(153, 153, 153)); screenSwitch.setTabPlacement(javax.swing.JTabbedPane.RIGHT); screenSwitch.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); screenSwitch.setFocusable(false); screenSwitch.setRequestFocusEnabled(false); screenSwitch.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { screenSwitchStateChanged(evt); } }); screenSwitch.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseMoved(java.awt.event.MouseEvent evt) { screenSwitchMouseMoved(evt); } }); screenSwitch.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { screenSwitchMousePressed(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { screenSwitchMouseReleased(evt); } public void mouseClicked(java.awt.event.MouseEvent evt) { screenSwitchMouseClicked(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { screenSwitchMouseExited(evt); } public void mouseEntered(java.awt.event.MouseEvent evt) { screenSwitchMouseEntered(evt); } }); spectralDisplay.setBackground(new java.awt.Color(-12566464,true)); spectralDisplay.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 3)); spectralDisplay.setCursor(new java.awt.Cursor(java.awt.Cursor.CROSSHAIR_CURSOR)); spectralDisplay.setFocusable(false); spectralDisplay.setFont(new java.awt.Font("Dialog", 0, 5)); // NOI18N spectrumInnerPane.setBackground(new java.awt.Color(-12566464,true)); spectrumInnerPane.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); spectrumInnerPane.setFont(new java.awt.Font("Dialog", 0, 10)); // NOI18N jLabel1.setFont(new java.awt.Font("Dialog", 0, 48)); jLabel1.setText("Press \"Start...\""); javax.swing.GroupLayout spectrumInnerPaneLayout = new javax.swing.GroupLayout(spectrumInnerPane); spectrumInnerPane.setLayout(spectrumInnerPaneLayout); spectrumInnerPaneLayout.setHorizontalGroup( spectrumInnerPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, spectrumInnerPaneLayout.createSequentialGroup() .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 388, Short.MAX_VALUE) .addContainerGap()) ); spectrumInnerPaneLayout.setVerticalGroup( spectrumInnerPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(spectrumInnerPaneLayout.createSequentialGroup() .addGap(69, 69, 69) .addComponent(jLabel1) .addContainerGap(105, Short.MAX_VALUE)) ); javax.swing.GroupLayout spectralDisplayLayout = new javax.swing.GroupLayout(spectralDisplay); spectralDisplay.setLayout(spectralDisplayLayout); spectralDisplayLayout.setHorizontalGroup( spectralDisplayLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(spectralDisplayLayout.createSequentialGroup() .addContainerGap() .addComponent(spectrumInnerPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) ); spectralDisplayLayout.setVerticalGroup( spectralDisplayLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(spectralDisplayLayout.createSequentialGroup() .addContainerGap() .addComponent(spectrumInnerPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(23, Short.MAX_VALUE)) ); screenSwitch.addTab("SA", spectralDisplay); propagationDisplayTab.setBackground(new java.awt.Color(-8355712,true)); propagationDisplayTab.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 3)); propagationDisplayTab.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); propagationDisplayTab.setEnabled(false); propagationDisplayTab.setFocusable(false); propagationDisplayTab.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { propagationDisplayTabMouseEntered(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { propagationDisplayTabMouseExited(evt); } }); propagationDisplay.setBackground(new java.awt.Color(-16777216,true)); propagationDisplay.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 3)); propagationDisplay.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); propagationDisplay.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); propagationDisplay.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { propagationDisplayMouseClicked(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { propagationDisplayMouseReleased(evt); } }); propagationDisplay.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseDragged(java.awt.event.MouseEvent evt) { propagationDisplayMouseDragged(evt); } public void mouseMoved(java.awt.event.MouseEvent evt) { propagationDisplayMouseMoved(evt); } }); propagationDisplayScoll.setBackground(new java.awt.Color(-16777216,true)); propagationDisplay1.setBackground(new java.awt.Color(-12566464,true)); propagationDisplay1.setFocusable(false); propagationDisplay1.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseMoved(java.awt.event.MouseEvent evt) { propagationDisplay1MouseMoved(evt); } }); propagationDisplay1.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { propagationDisplay1MousePressed(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { propagationDisplay1MouseExited(evt); } }); javax.swing.GroupLayout propagationDisplay1Layout = new javax.swing.GroupLayout(propagationDisplay1); propagationDisplay1.setLayout(propagationDisplay1Layout); propagationDisplay1Layout.setHorizontalGroup( propagationDisplay1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 1785, Short.MAX_VALUE) ); propagationDisplay1Layout.setVerticalGroup( propagationDisplay1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 242, Short.MAX_VALUE) ); javax.swing.GroupLayout propagationDisplayScollLayout = new javax.swing.GroupLayout(propagationDisplayScoll); propagationDisplayScoll.setLayout(propagationDisplayScollLayout); propagationDisplayScollLayout.setHorizontalGroup( propagationDisplayScollLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(propagationDisplayScollLayout.createSequentialGroup() .addComponent(propagationDisplay1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) ); propagationDisplayScollLayout.setVerticalGroup( propagationDisplayScollLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(propagationDisplay1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); propagationDisplay.setViewportView(propagationDisplayScoll); javax.swing.GroupLayout propagationDisplayTabLayout = new javax.swing.GroupLayout(propagationDisplayTab); propagationDisplayTab.setLayout(propagationDisplayTabLayout); propagationDisplayTabLayout.setHorizontalGroup( propagationDisplayTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(propagationDisplay, javax.swing.GroupLayout.DEFAULT_SIZE, 441, Short.MAX_VALUE) ); propagationDisplayTabLayout.setVerticalGroup( propagationDisplayTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(propagationDisplay, javax.swing.GroupLayout.DEFAULT_SIZE, 265, Short.MAX_VALUE) ); propagationDisplay.getAccessibleContext().setAccessibleDescription(""); screenSwitch.addTab("Prop", propagationDisplayTab); helpButton.setText("Help"); helpButton.setToolTipText("Open the PDF help file"); helpButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { helpButtonActionPerformed(evt); } }); javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup( jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup() .addContainerGap() .addComponent(screenSwitch, javax.swing.GroupLayout.PREFERRED_SIZE, 490, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel4Layout.createSequentialGroup() .addGap(24, 24, 24) .addComponent(frequencyMarquee, 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) .addComponent(jLabel23))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup() .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup() .addComponent(helpButton) .addGap(23, 23, 23)))) ); jPanel4Layout.setVerticalGroup( jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel4Layout.createSequentialGroup() .addComponent(frequencyMarquee, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(2, 2, 2)) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(helpButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel23))) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addGap(8, 8, 8) .addComponent(screenSwitch, javax.swing.GroupLayout.PREFERRED_SIZE, 276, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel4Layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))) .addContainerGap()) ); jPanel9.add(jPanel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 770, 330)); jLabel40.setText("Version J1.7"); jPanel9.add(jLabel40, new org.netbeans.lib.awtextra.AbsoluteConstraints(660, 600, -1, 20)); jLabel41.setFont(new java.awt.Font("Tahoma", 0, 18)); jLabel41.setText("VE7DXW"); jPanel9.add(jLabel41, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 600, -1, 30)); WWVrecallButton1.setForeground(new java.awt.Color(0, 153, 255)); WWVrecallButton1.setText("www.qsl.net/rf-seismograph/"); WWVrecallButton1.setToolTipText("MDSR Website"); WWVrecallButton1.setBorderPainted(false); WWVrecallButton1.setContentAreaFilled(false); WWVrecallButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { WWVrecallButton1ActionPerformed(evt); } }); jPanel9.add(WWVrecallButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 600, 260, -1)); checkNet.setText("Ck-NW"); checkNet.setToolTipText("open RF-Viewer"); checkNet.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { checkNetActionPerformed(evt); } }); jPanel9.add(checkNet, new org.netbeans.lib.awtextra.AbsoluteConstraints(470, 600, 90, -1)); jPanel9.add(NOAAAlertBanner1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, -1)); jPanel9.add(netAvail, new org.netbeans.lib.awtextra.AbsoluteConstraints(600, 600, 40, -1)); jLabel39.setText("NW"); jLabel39.setToolTipText("net work alive monitor"); jPanel9.add(jLabel39, new org.netbeans.lib.awtextra.AbsoluteConstraints(570, 600, 28, 20)); test.setText("Viewer"); test.setToolTipText("open RF-Viewer"); test.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { testActionPerformed(evt); } }); jPanel9.add(test, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 600, 90, -1)); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, 705, javax.swing.GroupLayout.PREFERRED_SIZE) ); setSize(new java.awt.Dimension(792, 658)); setLocationRelativeTo(null); }// //GEN-END:initComponents private void startButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_startButtonActionPerformed System.out.println(System.getProperty("user.home")); presetScanFrequencies(); loadUserParameters(); screenSwitch.setSelectedIndex(0); setCursor(Cursor.getDefaultCursor()); scanStartButton.setEnabled(false); pauseResumeToggleButton.setEnabled(false); //saveDataButton.setEnabled(false); for (int b = 1; b <= 421; b++) //set the correction varaiable to 1 { corrFactor[b] = 1; } SA_DSP.startup(); //starts audiio engine System.out.println("trying to start"); startButton.setEnabled(false); refreshRate(); loadCalibration(); optionGraph = 1; //corrected SA_equalizerMode.setSelectedItem("corrected"); //SA_optionMode.setSelectedItem("Normal"); acceptButton.setEnabled(false); //selIndexDisplayScreen = screenSwitch.setSelectedItem("SA"); if (selIndexDisplayValue == 0) { selIndexDisplayValue = 1; //end thread realTime(); } try { //SA_test.setText(Integer.toString (selIndexDisplayScreen)); Thread.sleep(500); } catch (InterruptedException ex) { ex.printStackTrace(); } selIndexDisplayValue = 0; realTime(); loadSettings(); resetAudioEngine(); netSpeed(); if(netIsAvailable()==(true)) netAvail.setText("Int"); else netAvail.setText("off"); //readTempData(); }//GEN-LAST:event_startButtonActionPerformed private void exitButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitButtonActionPerformed //Backup data file Path fromDF; Path destDF; fromDF = Paths.get((System.getProperty("user.home"))+ "/MDSR_SA/tempData.bak"); destDF= Paths.get((System.getProperty("user.home"))+ "/MDSR_SA/upLoad/tempData.bak"); try { Path copy = Files.copy(fromDF, destDF); } catch (IOException ex) { Logger.getLogger(SA_Display.class.getName()).log(Level.SEVERE, null, ex); } //Backup user file Path fromUF; Path destUF; fromUF = Paths.get((System.getProperty("user.home"))+ "/MDSR_SA/SA_User.cfg"); destUF = Paths.get((System.getProperty("user.home"))+ "/MDSR_SA/upLoad/SA_User.cfg"); try { Files.copy(fromUF, destUF); } catch (IOException ex) { Logger.getLogger(SA_Display.class.getName()).log(Level.SEVERE, null, ex); } //Backup configuration file Path fromCF; Path destCF; fromCF = Paths.get((System.getProperty("user.home"))+ "/MDSR_SA/SA_config.cfg"); destCF = Paths.get((System.getProperty("user.home"))+ "/MDSR_SA/upLoad/SA_config.cfg"); try { Files.copy(fromCF, destCF); } catch (IOException ex) { Logger.getLogger(SA_Display.class.getName()).log(Level.SEVERE, null, ex); } sliderValue = propagationDisplay.getHorizontalScrollBar().getValue(); //to write value to SAconfig file //saveUserParameters(); saveSettings(); saveDataToTemp(); //saves data to tempData.bak if (SA_DSP.synth != null) { SA_DSP.synth.stop(); } saveUserParameters(); //SA_DSP.exitSystem(); System.exit(0); dispose(); }//GEN-LAST:event_exitButtonActionPerformed private void SA_displayGainStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_SA_displayGainStateChanged displayGain = (SA_displayGain.getValue()) ; for (int b = 0; b <= 421; b++) { FFT_peakHold[b] = -100; //reset peakhold array } }//GEN-LAST:event_SA_displayGainStateChanged private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing //Backup data file Path fromDF; Path destDF; fromDF = Paths.get((System.getProperty("user.home"))+ "/MDSR_SA/tempData.bak"); destDF= Paths.get((System.getProperty("user.home"))+ "/MDSR_SA/upLoad/tempData.bak"); try { Path copy = Files.copy(fromDF, destDF); } catch (IOException ex) { Logger.getLogger(SA_Display.class.getName()).log(Level.SEVERE, null, ex); } //Backup user file Path fromUF; Path destUF; fromUF = Paths.get((System.getProperty("user.home"))+ "/MDSR_SA/SA_User.cfg"); destUF = Paths.get((System.getProperty("user.home"))+ "/MDSR_SA/upLoad/SA_User.cfg"); try { Files.copy(fromUF, destUF); } catch (IOException ex) { Logger.getLogger(SA_Display.class.getName()).log(Level.SEVERE, null, ex); } //Backup configuration file Path fromCF; Path destCF; fromCF = Paths.get((System.getProperty("user.home"))+ "/MDSR_SA/SA_config.cfg"); destCF = Paths.get((System.getProperty("user.home"))+ "/MDSR_SA/upLoad/SA_config.cfg"); try { Files.copy(fromCF, destCF); } catch (IOException ex) { Logger.getLogger(SA_Display.class.getName()).log(Level.SEVERE, null, ex); } sliderValue = propagationDisplay.getHorizontalScrollBar().getValue(); //to write value to SAconfig file //saveUserParameters(); saveSettings(); saveDataToTemp(); //saves data to tempData.bak if (SA_DSP.synth != null) { SA_DSP.synth.stop(); } saveUserParameters(); //SA_DSP.exitSystem(); System.exit(0); dispose(); }//GEN-LAST:event_formWindowClosing private void RST_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RST_buttonActionPerformed saveSettings(); refreshTimePG.setSelectedItem("1s"); resetAudioEngine(); //reset audio processor if (dataSelector.getSelectedItem().equals("flrig")) { connectFldigiRead(); //System.out.println(dataSelector.getSelectedItem()); } else readMDSR(); preCAT_Frequency = 0; //so that CAT and preCAT are not equal updateScrollingFrequency(); }//GEN-LAST:event_RST_buttonActionPerformed private void SA_bandwidthSelectorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SA_bandwidthSelectorActionPerformed SA_DSP.stopSystem(); try { Thread.sleep(20); // do nothing for 100 miliseconds } catch(InterruptedException e) { e.printStackTrace(); } if (SA_bandwidthSelector.getSelectedItem().equals("20kHz")) { SA_DSP.SIZE_LOG_2 = 10; SA_DSP.SIZE = 1 << SA_DSP.SIZE_LOG_2; } if (SA_bandwidthSelector.getSelectedItem().equals("10kHz")) { SA_DSP.SIZE_LOG_2 = 11; SA_DSP.SIZE = 1 << SA_DSP.SIZE_LOG_2; } if (SA_bandwidthSelector.getSelectedItem().equals("5kHz")) { SA_DSP.SIZE_LOG_2 = 12; SA_DSP.SIZE = 1 << SA_DSP.SIZE_LOG_2; } try { SA_DSP.start(); } catch (IOException ex) { Logger.getLogger(SA_Display.class.getName()).log(Level.SEVERE, null, ex); } //resetting the internal oscillator in case it is in use SA_DSP.center.input.set(Double.parseDouble (String.valueOf(SA_Frequency.getValue())) * 1000); if (String.valueOf(SA_Frequency.getValue()).equals("0")) { SA_DSP.osc.amplitude.set(0.0); SA_DSP.noise.amplitude.set(0.00); SA_time.setText(String.valueOf(SA_Frequency.getValue())); } else { SA_DSP.osc.amplitude.set(0.30); SA_DSP.noise.amplitude.set(0.10); //SA_test.setText(String.valueOf(SA_Frequency.getValue())); } if((SA_inputSelector.getSelectedItem()).equals ("both")) { SA_DSP.volumeControlLeft.inputA.set( 1.0 ); SA_DSP.volumeControlLeft.inputB.set( 1.0 ); SA_DSP.volumeControlRight.inputA.set( 1.0 ); SA_DSP.volumeControlRight.inputB.set( 1.0 ); } if((SA_inputSelector.getSelectedItem()).equals ("left")) { SA_DSP.volumeControlLeft.inputA.set( 1.0 ); SA_DSP.volumeControlLeft.inputB.set( 1.0 ); SA_DSP.volumeControlRight.inputA.set( 0.0 ); SA_DSP.volumeControlRight.inputB.set( 0.0 ); } if((SA_inputSelector.getSelectedItem()).equals ("right")) { SA_DSP.volumeControlLeft.inputA.set( 0.0 ); SA_DSP.volumeControlLeft.inputB.set( 0.0 ); SA_DSP.volumeControlRight.inputA.set( 1.0 ); SA_DSP.volumeControlRight.inputB.set( 1.0 ); } }//GEN-LAST:event_SA_bandwidthSelectorActionPerformed private void SA_videoFilterSelectorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SA_videoFilterSelectorActionPerformed if (SA_videoFilterSelector.getSelectedItem().equals("1")) { fiterSelector = 1; } if (SA_videoFilterSelector.getSelectedItem().equals("2")) { fiterSelector = 2; } if (SA_videoFilterSelector.getSelectedItem().equals("3")) { fiterSelector = 3; } if (SA_videoFilterSelector.getSelectedItem().equals("4")) { fiterSelector = 4; } if (SA_videoFilterSelector.getSelectedItem().equals("5")) { fiterSelector = 5; } }//GEN-LAST:event_SA_videoFilterSelectorActionPerformed private void SA_dominantFrequencyLevelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SA_dominantFrequencyLevelActionPerformed // TODO add your handling code here: }//GEN-LAST:event_SA_dominantFrequencyLevelActionPerformed private void SA_displayLevelStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_SA_displayLevelStateChanged noiseFloor = (SA_displayLevel.getValue()); for (int b = 0; b <= 421; b++) { FFT_peakHold[b] = -100; //reset peakhold array } }//GEN-LAST:event_SA_displayLevelStateChanged private void helpButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_helpButtonActionPerformed netSpeed(); if(netIsAvailable()==(true)) { netAvail.setText("Int"); Runtime rt = Runtime.getRuntime(); String url = "https://www.qsl.net/rf-seismograph/downloads/RF_SeismographCurrentManual.pdf"; //String url = "http://www3.telus.net/public/bc237/MDSR/RF_SeismographCurrentManual.pdf"; String[] browsers = { "chromium-browser" , "epiphany", "firefox", "mozilla", "konqueror", "netscape", "opera", "links", "lynx" }; StringBuffer cmd = new StringBuffer(); for (int i = 0; i < browsers.length; i++) if(i == 0) cmd.append(String.format( "%s \"%s\"", browsers[i], url)); else cmd.append(String.format(" || %s \"%s\"", browsers[i], url)); // If the first didn't work, try the next browser and so on try { rt.exec(new String[] { "sh", "-c", cmd.toString() }); } catch (IOException ex) { Logger.getLogger(SA_Display.class.getName()).log(Level.SEVERE, null, ex); } } else netAvail.setText("off"); }//GEN-LAST:event_helpButtonActionPerformed private void screenSwitchStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_screenSwitchStateChanged refreshTimePG.setSelectedItem("1s"); selIndexDisplayValue = screenSwitch.getSelectedIndex(); //0 = SA, 1 = Prop //RealtimeEnable = 0; //0 not running, 1 running //stopPropGraph.setEnabled(false); //RealtimeEnable = 1; //0 not running, 1 running //SA_test.setText(Integer.toString (setIndexDisplayScreen)); //System.out.println(sliderValue); //resetAudioEngine(); //reset audio processor //does not like this clearScreen = 1; preCAT_Frequency = 0; //so that CAT and preCAT are not equal updateScrollingFrequency(); if (selIndexDisplayValue == 0) //sa { if(graphServiceON.isSelected() == true) //aviod 0 poiter err { realTime(); stopPropGraph.setText("<>"); startPropGraph.setText("Start."); stopPropGraph.setEnabled(false); //startPropGraph.setEnabled(true); //resetAudioEngine(); } } if (selIndexDisplayValue == 1) //prop { //stopPropGraph.setEnabled(false); startPropGraph.setEnabled(true); //propagSliderValue.setText(Integer.toString (propagationDisplay.getHorizontalScrollBar().getValue())); propagationDisplay.getHorizontalScrollBar().setValue(0); //selIndexDisplayValue =1;//propagation display start enabled RFS_dataCollection(); //if( graphServiceON.isSelected() == (false)) //does not start with if propagationGraph(); //SA_yGrid.setValue(0); //reset marker to 0. //yGrid = 0; try { Thread.sleep(1000); } catch (InterruptedException e) { } //propagationDisplay.getHorizontalScrollBar().setValue(Integer.parseInt(propagSliderValue.getText())); //set scroll bar to the left propagationDisplay.getHorizontalScrollBar().setValue(sliderValue); //propagationDisplay.getHorizontalScrollBar().setValue(0); //set scroll bar to the left //SSI_dataCollection(); //SA_yGrid.setValue(0); //reset marker to 0. //yGrid = 0; } //scanStartButton.setEnabled(true); }//GEN-LAST:event_screenSwitchStateChanged private void scanTimeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_scanTimeActionPerformed //SSI_dataCollection(); mCount = 0; if (scanTime.getSelectedItem().equals("6h")) { timeIntPG.setText("52s"); delayTimeProp = 52; } if (scanTime.getSelectedItem().equals("12h")) { timeIntPG.setText("103s"); delayTimeProp = 52; } if (scanTime.getSelectedItem().equals("24h")) { timeIntPG.setText("206s"); delayTimeProp = 52; } if (scanTime.getSelectedItem().equals("48h")) { timeIntPG.setText("412s"); delayTimeProp = 52; } if (scanTime.getSelectedItem().equals("72h")) { timeIntPG.setText("618s"); delayTimeProp = 52; } }//GEN-LAST:event_scanTimeActionPerformed private void screenSwitchMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_screenSwitchMouseEntered }//GEN-LAST:event_screenSwitchMouseEntered private void screenSwitchMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_screenSwitchMouseExited setCursor(Cursor.getDefaultCursor()); //SA_yGrid.setValue(0); //reset marker to 0 mousePressed = false; }//GEN-LAST:event_screenSwitchMouseExited private void propagationDisplayTabMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_propagationDisplayTabMouseEntered setCursor(Cursor.CROSSHAIR_CURSOR); }//GEN-LAST:event_propagationDisplayTabMouseEntered private void propagationDisplayTabMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_propagationDisplayTabMouseExited setCursor(Cursor.getDefaultCursor()); //SA_yGrid.setValue(0); //reset marker to 0 }//GEN-LAST:event_propagationDisplayTabMouseExited private void screenSwitchMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_screenSwitchMouseClicked Point p = MouseInfo.getPointerInfo().getLocation(); //get mouse coordinates Point loc = screenSwitch.getLocationOnScreen(); Point offsetPoint = new Point(p.x- loc.x, p.y-loc.y); int x = offsetPoint.x; int y = offsetPoint.y; if (selIndexDisplayValue == 0) { if ( x < 420) if ( x > 0) { SA_yGrid.setValue( x - FFT_binBFO ); yGrid = x - FFT_binBFO; } } if (selIndexDisplayValue == 1) { SA_yGrid.setValue(0); //reset marker to 0 yGrid = 0; } }//GEN-LAST:event_screenSwitchMouseClicked private void propagationDisplayMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_propagationDisplayMouseMoved // TODO add your handling code here: }//GEN-LAST:event_propagationDisplayMouseMoved private void screenSwitchMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_screenSwitchMousePressed mousePressed = true; yGrid = 0; }//GEN-LAST:event_screenSwitchMousePressed private void propagationDisplay1MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_propagationDisplay1MouseExited mousePressed = false; }//GEN-LAST:event_propagationDisplay1MouseExited private void screenSwitchMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_screenSwitchMouseReleased mousePressed =false; get6hPropagation(); //refresh propagation list }//GEN-LAST:event_screenSwitchMouseReleased private void propagationDisplay1MouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_propagationDisplay1MouseMoved mousePressed =false; }//GEN-LAST:event_propagationDisplay1MouseMoved private void screenSwitchMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_screenSwitchMouseMoved mousePressed =false; SA_yGrid.setValue(0); //reset marker to 0 sliderValue = propagationDisplay.getHorizontalScrollBar().getValue(); //to write value to SAconfig file }//GEN-LAST:event_screenSwitchMouseMoved private void scanStartButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_scanStartButtonActionPerformed //Backup data file // checking for file size to prevent not loadoing data - will resore from backup File file = new File(System.getProperty("user.home") + "/MDSR_SA/tempData.bak"); double bytes = file.length(); if(bytes <= 1000.0) { JOptionPane.showMessageDialog(null,"File is restored from backup"); Path from; Path dest; Path delete; dest = Paths.get((System.getProperty("user.home"))+ "/MDSR_SA/tempData.bak"); from = Paths.get((System.getProperty("user.home"))+ "/MDSR_SA/upLoad/tempData.bak"); delete= Paths.get((System.getProperty("user.home"))+ "/MDSR_SA/tempData.bak"); try { if(Files.exists(delete)) Files.delete(delete); Files.copy(from, dest); } catch (IOException ex) { //System.out.println("could not copy file"); Logger.getLogger(SA_Display.class.getName()).log(Level.SEVERE, null, ex); } } SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String time = sdf.format(new Date()); threadRestartLog.append("Propagation Scan started at: "+time+ "\n"); propagationDisplay.getHorizontalScrollBar().setValue(0); refreshTimePG.setSelectedItem("1s"); mCount = 0; delayTimeProp = 52; timeIntPG.setText("52s"); currentFrequency.setText("waiting..."); CheckBoxFreq1.setSelected(true); CheckBoxFreq2.setSelected(true); CheckBoxFreq3.setSelected(true); CheckBoxFreq4.setSelected(true); CheckBoxFreq5.setSelected(true); CheckBoxFreq6.setSelected(true); savePNGButton.setSelected(true); //scannerUpdaqteFrequency(); scanStartButton.setEnabled(false); pauseResumeToggleButton.setEnabled(true); SA_recallCorrectionCurve.setEnabled(false); readTempData(); //load temp data try { Thread.sleep(1000); } catch (InterruptedException e) { } //propagationDisplay.getHorizontalScrollBar().setValue(Integer.parseInt(propagSliderValue.getText())); //set scroll bar to the left propagationDisplay.getHorizontalScrollBar().setValue(sliderValue); //readTempData(); //restore data from temp file }//GEN-LAST:event_scanStartButtonActionPerformed private void pauseResumeToggleButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pauseResumeToggleButtonActionPerformed currentFrequency.setText("updating status..."); /**if(delayTimeProp > 10) // code for 1s interval while paused { delayTimeProp = 6; timeInt.setText("1s"); } if(delayTimeProp < 10) { delayTimeProp = 52; timeInt.setText("52s"); } **/ }//GEN-LAST:event_pauseResumeToggleButtonActionPerformed private void saveDataButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveDataButtonActionPerformed saveDataToCSV(); if (autoSaveCheckBox.isSelected() == (true)) //save data only save when selected { saveDataToCSV(); //saves data when date changes (every 24h) FTPUploadBackup(); } }//GEN-LAST:event_saveDataButtonActionPerformed private void savePNGButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_savePNGButtonActionPerformed saveImage(); createPropagationHTM(); }//GEN-LAST:event_savePNGButtonActionPerformed private void propAmpStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_propAmpStateChanged propAmpValue = (Integer.parseInt(String.valueOf(propAmp.getValue()))); }//GEN-LAST:event_propAmpStateChanged private void SA_graphFunctionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SA_graphFunctionActionPerformed type = (String.valueOf(SA_graphFunction.getSelectedItem())); }//GEN-LAST:event_SA_graphFunctionActionPerformed private void SA_optionModeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SA_optionModeActionPerformed if (SA_optionMode.getSelectedItem().equals("Normal")) { optionMode = 0; //preOptionMode = 0; } if (SA_optionMode.getSelectedItem().equals("Peakhold")) { optionMode = 1; //preOptionMode = 1; } if (SA_optionMode.getSelectedItem().equals("Decay")) { optionMode = 2; //preOptionMode = 2; } if(SA_optionMode.getSelectedItem().equals("Normal")); { //SA_maxPeakValue.setText("no peak max"); } if(SA_optionMode.getSelectedItem().equals("Decay")); { //SA_maxPeakValue.setText("no peak max"); } SA_time.setText(Integer.toString(optionMode)); //SA_test.setText(String.valueOf(SA_peakHoldOnOff.getSelectedItem())); }//GEN-LAST:event_SA_optionModeActionPerformed private void SA_yGridStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_SA_yGridStateChanged yGrid = (Integer.parseInt(String.valueOf(SA_yGrid.getValue()))); /**if (selIndexDisplayValue == 1) * if (yGrid < 0 ) * { * yGrid = 0; * SA_yGrid.setValue(0); * } **/ }//GEN-LAST:event_SA_yGridStateChanged private void SA_FrequencyStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_SA_FrequencyStateChanged SA_DSP.center.input.set((Double.parseDouble(String.valueOf(SA_Frequency.getValue())) * 1000) + (Double.parseDouble(corretionFreq.getText()))); //correct the display for 12kHz if (String.valueOf(SA_Frequency.getValue()).equals("0")) { SA_DSP.osc.amplitude.set(0.0); SA_DSP.noise.amplitude.set(0.00); SA_time.setText(String.valueOf(SA_Frequency.getValue())); } else { SA_DSP.osc.amplitude.set(0.10); SA_DSP.noise.amplitude.set(0.0); //SA_test.setText(String.valueOf(SA_Frequency.getValue())); } }//GEN-LAST:event_SA_FrequencyStateChanged private void SA_loadCorrectionCurveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SA_loadCorrectionCurveActionPerformed loadCalibration(); optionGraph = 1; //corrected SA_equalizerMode.setSelectedItem("corrected"); //SA_optionMode.setSelectedItem("Normal"); acceptButton.setEnabled(false); }//GEN-LAST:event_SA_loadCorrectionCurveActionPerformed private void SA_saveCorrectionCurveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SA_saveCorrectionCurveActionPerformed SA_correctionCurveCurrent.setText(Integer.toString(Integer.parseInt(String.valueOf(SA_recallCorrectionCurve.getSelectedItem())))); try { BufferedWriter out = new BufferedWriter(new FileWriter((System.getProperty("user.home") + "/MDSR_SA/Spec" + (SA_recallCorrectionCurve.getSelectedItem() + ".cal")))); for (int b = 0; b <= 420; b++) { out.write(String.format("%.20f",corrFactor[b])); out.newLine(); } out.write("EOF"); out.close(); } catch (IOException e) { JOptionPane.showMessageDialog(null,"Calibration file write error"); } return ; }//GEN-LAST:event_SA_saveCorrectionCurveActionPerformed private void SA_recallCorrectionCurveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SA_recallCorrectionCurveActionPerformed SA_correctionCurveCurrent.setText(Integer.toString(Integer.parseInt(String.valueOf(SA_recallCorrectionCurve.getSelectedItem())))); }//GEN-LAST:event_SA_recallCorrectionCurveActionPerformed private void SA_inputSelectorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SA_inputSelectorActionPerformed if((SA_inputSelector.getSelectedItem()).equals("both")) { SA_DSP.volumeControlLeft.inputA.set( 1.0 ); SA_DSP.volumeControlLeft.inputB.set( 1.0 ); SA_DSP.volumeControlRight.inputA.set( 1.0 ); SA_DSP.volumeControlRight.inputB.set( 1.0 ); } if((SA_inputSelector.getSelectedItem()).equals("left")) { SA_DSP.volumeControlLeft.inputA.set( 1.0 ); SA_DSP.volumeControlLeft.inputB.set( 1.0 ); SA_DSP.volumeControlRight.inputA.set( 0.0 ); SA_DSP.volumeControlRight.inputB.set( 0.0 ); } if((SA_inputSelector.getSelectedItem()).equals("right")) { SA_DSP.volumeControlLeft.inputA.set( 0.0 ); SA_DSP.volumeControlLeft.inputB.set( 0.0 ); SA_DSP.volumeControlRight.inputA.set( 1.0 ); SA_DSP.volumeControlRight.inputB.set( 1.0 ); } }//GEN-LAST:event_SA_inputSelectorActionPerformed private void SA_refreshTimeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SA_refreshTimeActionPerformed refreshTime = (SA_refreshTime.getSelectedIndex()); //count.setText(Integer.toString(refreshTime)); }//GEN-LAST:event_SA_refreshTimeActionPerformed private void equalizeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_equalizeButtonActionPerformed for (int b = 1; b <= 421; b++) //update the correction array { corrFactor[b] = 1; } arrCount = 0; peakHoldtoCalibration(); SA_optionMode.setSelectedItem("Peakhold"); SA_equalizerMode.setSelectedItem("calibrate"); acceptButton.setEnabled(true); }//GEN-LAST:event_equalizeButtonActionPerformed private void SA_equalizerModeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SA_equalizerModeActionPerformed //optionGraph = 0; //0 normal, 1 corrected, 2 calibrate //normal, corrected, calibrate if (SA_equalizerMode.getSelectedItem().equals("normal")) { optionGraph = 0; SA_optionMode.setSelectedItem("Normal"); } if (SA_equalizerMode.getSelectedItem().equals("corrected")) { optionGraph = 1; } if (SA_equalizerMode.getSelectedItem().equals("calibrate")) { optionGraph = 2; } arrCount = 0; //peakHoldtoCalibration(); //if (SA_mode.getSelectedItem().equals("calibrate")) //SA_mode.setSelectedItem("corrected"); //SA_peakHoldOnOff.setSelectedItem("Peakhold"); }//GEN-LAST:event_SA_equalizerModeActionPerformed private void acceptButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_acceptButtonActionPerformed //for (int a = 1; a <= 5; a++) { for (int b = 1; b <= 421; b++) //smoth the peakHold array { //corrFactor[b] = (corrFactor[b] + corrFactor[b+1] + corrFactor[b+2] + corrFactor[b+3])/4; FFT_peakHold[b] = (FFT_peakHold[b] + FFT_peakHold[b+1] + FFT_peakHold[b+2] + FFT_peakHold[b+3])/4; FFT_peakHold[0] = FFT_peakHold[1]; // assign values to cornervalues FFT_peakHold[420] = FFT_peakHold[419]; FFT_peakHold[421] = FFT_peakHold[419]; } } for (int b = 1; b <= 421; b++) //update the correction array { corrFactor[b] = ( totalPeakLevel / FFT_peakHold[b]); } SA_equalizerMode.setSelectedItem("corrected"); SA_optionMode.setSelectedItem("Normal"); acceptButton.setEnabled(false); //SA_mode.setEnabled(false); //too slow for spectrum }//GEN-LAST:event_acceptButtonActionPerformed private void SA_corrButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SA_corrButtonActionPerformed int a = (Integer.parseInt(String.valueOf(SA_BinSelector.getValue()))); if (a == 0) a = 1; // avoid array error corrFactor[a] = (corrFactor[a-1] + corrFactor[a+1]) / 2; SA_corrValue.setText(String.format("%.8f",(corrFactor[a]))); //SA_dominantBin.setText(Integer.toString(a)); //SA_corrValue.setText(String.format("%.4f",1.123456)); }//GEN-LAST:event_SA_corrButtonActionPerformed private void SA_BinSelectorStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_SA_BinSelectorStateChanged SA_corrValue.setText(String.format("%.8f",(corrFactor[(Integer.parseInt(String.valueOf(SA_BinSelector.getValue())))]))); //(String.format("%.8f", binEdit = Integer.parseInt(String.valueOf(SA_BinSelector.getValue())); }//GEN-LAST:event_SA_BinSelectorStateChanged private void SA_manButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SA_manButtonActionPerformed int a = (Integer.parseInt(String.valueOf(SA_BinSelector.getValue()))); corrFactor[a] = (Double.parseDouble(SA_corrValue.getText())); //for manual entry }//GEN-LAST:event_SA_manButtonActionPerformed private void recallButtonPSK31ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_recallButtonPSK31ActionPerformed try { SA_Frequency1.removeAllItems(); //clear dropdown list SA_Frequency2.removeAllItems(); //clear dropdown list SA_Frequency3.removeAllItems(); //clear dropdown list SA_Frequency4.removeAllItems(); //clear dropdown list SA_Frequency5.removeAllItems(); //clear dropdown list SA_Frequency6.removeAllItems(); //clear dropdown list //SA_Frequency1.addItem("test"); FileReader fr = new FileReader(System.getProperty("user.home")+ "/MDSR_SA/PSK31.cfg"); BufferedReader textReader = new BufferedReader(fr); int numberOfLines = 10; int i; String[] textData = new String [numberOfLines]; for (i=0; i < numberOfLines; i++) { SA_Frequency1.addItem(textReader.readLine()); //make all drop down the same SA_Frequency2.addItem(SA_Frequency1.getItemAt(i)); SA_Frequency3.addItem(SA_Frequency1.getItemAt(i)); SA_Frequency4.addItem(SA_Frequency1.getItemAt(i)); SA_Frequency5.addItem(SA_Frequency1.getItemAt(i)); SA_Frequency6.addItem(SA_Frequency1.getItemAt(i)); } } catch (IOException e) { JOptionPane.showMessageDialog(null,"PSK31.cfg missing - recreate the PSK31 data file"); return ; } SA_Frequency2.setSelectedIndex(1); //put all items in proper order SA_Frequency3.setSelectedIndex(2); SA_Frequency4.setSelectedIndex(3); SA_Frequency5.setSelectedIndex(4); SA_Frequency6.setSelectedIndex(5); //Bad code for removing extra lines in drop down /**int i; * for (i=0; i < 20; i++) * { * if((String.valueOf (SA_Frequency1.getItemAt(i))).equals ("")) * currentFrequency.setText(String.valueOf(SA_Frequency1.getItemAt(i-1))); * SA_Frequency1.removeItemAt(i); * } * **/ }//GEN-LAST:event_recallButtonPSK31ActionPerformed private void WSPRrecallButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_WSPRrecallButtonActionPerformed try { SA_Frequency1.removeAllItems(); //clear dropdown list SA_Frequency2.removeAllItems(); //clear dropdown list SA_Frequency3.removeAllItems(); //clear dropdown list SA_Frequency4.removeAllItems(); //clear dropdown list SA_Frequency5.removeAllItems(); //clear dropdown list SA_Frequency6.removeAllItems(); //clear dropdown list //SA_Frequency1.addItem("test"); FileReader fr = new FileReader(System.getProperty("user.home")+ "/MDSR_SA/WSPR.cfg"); BufferedReader textReader = new BufferedReader(fr); int numberOfLines = 10; int i; String[] textData = new String [numberOfLines]; for (i=0; i < numberOfLines; i++) { SA_Frequency1.addItem(textReader.readLine()); //make all drop down the same SA_Frequency2.addItem(SA_Frequency1.getItemAt(i)); SA_Frequency3.addItem(SA_Frequency1.getItemAt(i)); SA_Frequency4.addItem(SA_Frequency1.getItemAt(i)); SA_Frequency5.addItem(SA_Frequency1.getItemAt(i)); SA_Frequency6.addItem(SA_Frequency1.getItemAt(i)); } } catch (IOException e) { JOptionPane.showMessageDialog(null,"WSPR.cfg missing - recreate the WSPR data file"); return ; } SA_Frequency2.setSelectedIndex(1); //put all items in proper order SA_Frequency3.setSelectedIndex(2); SA_Frequency4.setSelectedIndex(3); SA_Frequency5.setSelectedIndex(4); SA_Frequency6.setSelectedIndex(5); //Bad code for removing extra lines in drop down /**int i; * for (i=0; i < 20; i++) * { * if((String.valueOf (SA_Frequency1.getItemAt(i))).equals ("")) * currentFrequency.setText(String.valueOf(SA_Frequency1.getItemAt(i-1))); * SA_Frequency1.removeItemAt(i); * } * **/ }//GEN-LAST:event_WSPRrecallButtonActionPerformed private void CWrecallButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CWrecallButtonActionPerformed try { SA_Frequency1.removeAllItems(); //clear dropdown list SA_Frequency2.removeAllItems(); //clear dropdown list SA_Frequency3.removeAllItems(); //clear dropdown list SA_Frequency4.removeAllItems(); //clear dropdown list SA_Frequency5.removeAllItems(); //clear dropdown list SA_Frequency6.removeAllItems(); //clear dropdown list //SA_Frequency1.addItem("test"); FileReader fr = new FileReader(System.getProperty("user.home")+ "/MDSR_SA/CW.cfg"); BufferedReader textReader = new BufferedReader(fr); int numberOfLines = 10; int i; String[] textData = new String [numberOfLines]; for (i=0; i < numberOfLines; i++) { SA_Frequency1.addItem(textReader.readLine()); //make all drop down the same SA_Frequency2.addItem(SA_Frequency1.getItemAt(i)); SA_Frequency3.addItem(SA_Frequency1.getItemAt(i)); SA_Frequency4.addItem(SA_Frequency1.getItemAt(i)); SA_Frequency5.addItem(SA_Frequency1.getItemAt(i)); SA_Frequency6.addItem(SA_Frequency1.getItemAt(i)); } } catch (IOException e) { JOptionPane.showMessageDialog(null,"CW.cfg missing - recreate the CW data file"); return ; } SA_Frequency2.setSelectedIndex(1); //put all items in proper order SA_Frequency3.setSelectedIndex(2); SA_Frequency4.setSelectedIndex(3); SA_Frequency5.setSelectedIndex(4); SA_Frequency6.setSelectedIndex(5); //Bad code for removing extra lines in drop down /**int i; * for (i=0; i < 20; i++) * { * if((String.valueOf (SA_Frequency1.getItemAt(i))).equals ("")) * currentFrequency.setText(String.valueOf(SA_Frequency1.getItemAt(i-1))); * SA_Frequency1.removeItemAt(i); * } * **/ }//GEN-LAST:event_CWrecallButtonActionPerformed private void WWVrecallButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_WWVrecallButtonActionPerformed try { SA_Frequency1.removeAllItems(); //clear dropdown list SA_Frequency2.removeAllItems(); //clear dropdown list SA_Frequency3.removeAllItems(); //clear dropdown list SA_Frequency4.removeAllItems(); //clear dropdown list SA_Frequency5.removeAllItems(); //clear dropdown list SA_Frequency6.removeAllItems(); //clear dropdown list //SA_Frequency1.addItem("test"); FileReader fr = new FileReader(System.getProperty("user.home")+ "/MDSR_SA/WWV.cfg"); BufferedReader textReader = new BufferedReader(fr); int numberOfLines = 10; int i; String[] textData = new String [numberOfLines]; for (i=0; i < numberOfLines; i++) { SA_Frequency1.addItem(textReader.readLine()); //make all drop down the same SA_Frequency2.addItem(SA_Frequency1.getItemAt(i)); SA_Frequency3.addItem(SA_Frequency1.getItemAt(i)); SA_Frequency4.addItem(SA_Frequency1.getItemAt(i)); SA_Frequency5.addItem(SA_Frequency1.getItemAt(i)); SA_Frequency6.addItem(SA_Frequency1.getItemAt(i)); } } catch (IOException e) { JOptionPane.showMessageDialog(null,"WWV.cfg missing - recreate the WWV data file"); return ; } SA_Frequency2.setSelectedIndex(1); //put all items in proper order SA_Frequency3.setSelectedIndex(2); SA_Frequency4.setSelectedIndex(3); SA_Frequency5.setSelectedIndex(4); SA_Frequency6.setSelectedIndex(5); //Bad code for removing extra lines in drop down /**int i; * for (i=0; i < 20; i++) * { * if((String.valueOf (SA_Frequency1.getItemAt(i))).equals ("")) * currentFrequency.setText(String.valueOf(SA_Frequency1.getItemAt(i-1))); * SA_Frequency1.removeItemAt(i); * } * **/ }//GEN-LAST:event_WWVrecallButtonActionPerformed private void SSBrecallButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SSBrecallButtonActionPerformed try { SA_Frequency1.removeAllItems(); //clear dropdown list SA_Frequency2.removeAllItems(); //clear dropdown list SA_Frequency3.removeAllItems(); //clear dropdown list SA_Frequency4.removeAllItems(); //clear dropdown list SA_Frequency5.removeAllItems(); //clear dropdown list SA_Frequency6.removeAllItems(); //clear dropdown list //SA_Frequency1.addItem("test"); FileReader fr = new FileReader(System.getProperty("user.home")+ "/MDSR_SA/SSB.cfg"); BufferedReader textReader = new BufferedReader(fr); int numberOfLines = 10; int i; String[] textData = new String [numberOfLines]; for (i=0; i < numberOfLines; i++) { SA_Frequency1.addItem(textReader.readLine()); //make all drop down the same SA_Frequency2.addItem(SA_Frequency1.getItemAt(i)); SA_Frequency3.addItem(SA_Frequency1.getItemAt(i)); SA_Frequency4.addItem(SA_Frequency1.getItemAt(i)); SA_Frequency5.addItem(SA_Frequency1.getItemAt(i)); SA_Frequency6.addItem(SA_Frequency1.getItemAt(i)); } } catch (IOException e) { JOptionPane.showMessageDialog(null,"SSB.cfg missing - recreate the SSB data file"); return ; } SA_Frequency2.setSelectedIndex(1); //put all items in proper order SA_Frequency3.setSelectedIndex(2); SA_Frequency4.setSelectedIndex(3); SA_Frequency5.setSelectedIndex(4); SA_Frequency6.setSelectedIndex(5); //Bad code for removing extra lines in drop down /**int i; * for (i=0; i < 20; i++) * { * if((String.valueOf (SA_Frequency1.getItemAt(i))).equals ("")) * currentFrequency.setText(String.valueOf(SA_Frequency1.getItemAt(i-1))); * SA_Frequency1.removeItemAt(i); * } * **/ }//GEN-LAST:event_SSBrecallButtonActionPerformed private void JT65recallButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JT65recallButtonActionPerformed try { SA_Frequency1.removeAllItems(); //clear dropdown list SA_Frequency2.removeAllItems(); //clear dropdown list SA_Frequency3.removeAllItems(); //clear dropdown list SA_Frequency4.removeAllItems(); //clear dropdown list SA_Frequency5.removeAllItems(); //clear dropdown list SA_Frequency6.removeAllItems(); //clear dropdown list //SA_Frequency1.addItem("test"); FileReader fr = new FileReader(System.getProperty("user.home")+ "/MDSR_SA/JT65.cfg"); BufferedReader textReader = new BufferedReader(fr); int numberOfLines = 10; int i; String[] textData = new String [numberOfLines]; for (i=0; i < numberOfLines; i++) { SA_Frequency1.addItem(textReader.readLine()); //make all drop down the same SA_Frequency2.addItem(SA_Frequency1.getItemAt(i)); SA_Frequency3.addItem(SA_Frequency1.getItemAt(i)); SA_Frequency4.addItem(SA_Frequency1.getItemAt(i)); SA_Frequency5.addItem(SA_Frequency1.getItemAt(i)); SA_Frequency6.addItem(SA_Frequency1.getItemAt(i)); } } catch (IOException e) { JOptionPane.showMessageDialog(null,"JT65.cfg missing - recreate the JT65 data file"); return ; } SA_Frequency2.setSelectedIndex(1); //put all items in proper order SA_Frequency3.setSelectedIndex(2); SA_Frequency4.setSelectedIndex(3); SA_Frequency5.setSelectedIndex(4); SA_Frequency6.setSelectedIndex(5); //Bad code for removing extra lines in drop down /**int i; * for (i=0; i < 20; i++) * { * if((String.valueOf (SA_Frequency1.getItemAt(i))).equals ("")) * currentFrequency.setText(String.valueOf(SA_Frequency1.getItemAt(i-1))); * SA_Frequency1.removeItemAt(i); * } * **/ }//GEN-LAST:event_JT65recallButtonActionPerformed private void recallFrequButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_recallFrequButtonActionPerformed presetScanFrequencies(); }//GEN-LAST:event_recallFrequButtonActionPerformed private void saveFrequButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveFrequButtonActionPerformed try { BufferedWriter out = new BufferedWriter(new FileWriter((System.getProperty("user.home"))+ "/MDSR_SA/Scanner.cfg")); out.write(SA_scan1.getText()); out.newLine(); out.write(SA_scan2.getText()); out.newLine(); out.write(SA_scan3.getText()); out.newLine(); out.write(SA_scan4.getText()); out.newLine(); out.write(SA_scan5.getText()); out.newLine(); out.write(SA_scan6.getText()); out.newLine(); out.close(); } catch (IOException e) { JOptionPane.showMessageDialog(null,"Can not find the home directory MDSR_SA or its contents."); } return ; }//GEN-LAST:event_saveFrequButtonActionPerformed private void SA_Frequency6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SA_Frequency6ActionPerformed if (SA_Frequency6.getSelectedItem()!= null) //prevent execution if dropdown is empty if (CheckBoxFreq6.isSelected()== false) SA_scan6.setText(Integer.toString((Integer.parseInt(String.valueOf(SA_Frequency6.getSelectedItem())) * 1000))); }//GEN-LAST:event_SA_Frequency6ActionPerformed private void SA_Frequency5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SA_Frequency5ActionPerformed if (SA_Frequency5.getSelectedItem()!= null) //prevent execution if dropdown is empty if (CheckBoxFreq5.isSelected()== false) SA_scan5.setText(Integer.toString((Integer.parseInt(String.valueOf(SA_Frequency5.getSelectedItem())) * 1000))); }//GEN-LAST:event_SA_Frequency5ActionPerformed private void SA_Frequency4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SA_Frequency4ActionPerformed if (SA_Frequency4.getSelectedItem()!= null) //prevent execution if dropdown is empty if (CheckBoxFreq4.isSelected()== false) SA_scan4.setText(Integer.toString((Integer.parseInt(String.valueOf(SA_Frequency4.getSelectedItem())) * 1000))); }//GEN-LAST:event_SA_Frequency4ActionPerformed private void SA_Frequency3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SA_Frequency3ActionPerformed if (SA_Frequency3.getSelectedItem()!= null) //prevent execution if dropdown is empty if (CheckBoxFreq3.isSelected()== false) SA_scan3.setText(Integer.toString((Integer.parseInt(String.valueOf(SA_Frequency3.getSelectedItem())) * 1000))); }//GEN-LAST:event_SA_Frequency3ActionPerformed private void SA_Frequency2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SA_Frequency2ActionPerformed if (SA_Frequency2.getSelectedItem()!= null) //prevent execution if dropdown is empty if (CheckBoxFreq2.isSelected()== false) SA_scan2.setText(Integer.toString((Integer.parseInt(String.valueOf(SA_Frequency2.getSelectedItem())) * 1000))); //only update if frequency is not already selected //SA_scan2.setText(Integer.toString((Integer.parseInt(String.valueOf(SA_Frequency1.getSelectedItem())) * 1000))); }//GEN-LAST:event_SA_Frequency2ActionPerformed private void SA_Frequency1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SA_Frequency1ActionPerformed if (SA_Frequency1.getSelectedItem()!= null) //prevent execution if dropdown is empty if (CheckBoxFreq1.isSelected()== false) SA_scan1.setText(Integer.toString((Integer.parseInt(String.valueOf(SA_Frequency1.getSelectedItem())) * 1000))); //if (SA_scan1.getText()!= ("Scan1")) //only update if frequency is not already selected //SA_scan1.setText(Integer.toString((Integer.parseInt(String.valueOf(SA_Frequency1.getSelectedItem())) * 1000))); }//GEN-LAST:event_SA_Frequency1ActionPerformed private void propThresholdStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_propThresholdStateChanged propThresholdValue = (Integer.parseInt(String.valueOf(propThreshold.getValue()))); if(propThresholdValue < 100) //preventing the value to go below 100 { propThreshold.setValue(100); //propThresholdValue = 100; } eventsTrackerPane2.setText(""); //clear list //tempPanState = 0; //refresh propagation list //itemsPropagationList(); //counts the # of items in the propagation list get6hPropagation(); }//GEN-LAST:event_propThresholdStateChanged private void propagationDisplayMouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_propagationDisplayMouseDragged //tempPanState = 0; //refresh propagation list }//GEN-LAST:event_propagationDisplayMouseDragged private void propagationDisplayMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_propagationDisplayMouseReleased //tempPanState = 0; //refresh propagation list }//GEN-LAST:event_propagationDisplayMouseReleased private void propagationDisplayMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_propagationDisplayMouseClicked //tempPanState = 0; //refresh propagation list }//GEN-LAST:event_propagationDisplayMouseClicked private void propagationDisplay1MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_propagationDisplay1MousePressed mousePressed = true; }//GEN-LAST:event_propagationDisplay1MousePressed private void displaySDActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_displaySDActionPerformed propThresholdValue = (Integer.parseInt(String.valueOf(propThreshold.getValue()))); eventsTrackerPane2.setText(""); get6hPropagation(); //itemsPropagationList(); //counts the # of items in the propagation list }//GEN-LAST:event_displaySDActionPerformed private void propagationLisitingActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_propagationLisitingActionPerformed createPropagationHTM(); netSpeed(); if(netIsAvailable()==(true)) { netAvail.setText("Int"); Runtime rt = Runtime.getRuntime(); String url = (System.getProperty("user.home") + "/MDSR_SA/propList.htm"); //String url = "http://www3.telus.net/public/bc237/MDSR/RF_SeismographCurrentManual.pdf"; String[] browsers = { "chromium-browser" , "epiphany", "firefox", "mozilla", "konqueror", "netscape", "opera", "links", "lynx" }; StringBuffer cmd = new StringBuffer(); for (int i = 0; i < browsers.length; i++) if(i == 0) cmd.append(String.format( "%s \"%s\"", browsers[i], url)); else cmd.append(String.format(" || %s \"%s\"", browsers[i], url)); // If the first didn't work, try the next browser and so on try { rt.exec(new String[] { "sh", "-c", cmd.toString() }); } catch (IOException ex) { Logger.getLogger(SA_Display.class.getName()).log(Level.SEVERE, null, ex); JOptionPane.showMessageDialog(null,"HTML listing file not available or file not found!" + "\n" + (System.getProperty("user.home")+ "/MDSR_SA/propList.htm")); } } else netAvail.setText("off"); }//GEN-LAST:event_propagationLisitingActionPerformed private void jTabbedPane2StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jTabbedPane2StateChanged refreshTimePG.setSelectedItem("1s"); //tempPanState = 0; //itemsPropagationList(); //counts the # of items in the propagation list propThreshold.setValue(propThresholdValue); //update field on showing tab //saveUserParameters(); //FTPdownloadFiles(); //NOAAalertsText.setText(""); }//GEN-LAST:event_jTabbedPane2StateChanged private void timeIncidentDuplicateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_timeIncidentDuplicateActionPerformed propThresholdValue = (Integer.parseInt(String.valueOf(propThreshold.getValue()))); eventsTrackerPane2.setText(""); //clear list get6hPropagation(); //itemsPropagationList(); //counts the # of items in the propagation list }//GEN-LAST:event_timeIncidentDuplicateActionPerformed private void SA_saveUserParametersActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SA_saveUserParametersActionPerformed saveUserParameters(); }//GEN-LAST:event_SA_saveUserParametersActionPerformed private void clearFtpActivityActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clearFtpActivityActionPerformed ftpActivity.setText(""); }//GEN-LAST:event_clearFtpActivityActionPerformed private void uploadEnabledActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_uploadEnabledActionPerformed // TODO add your handling code here: }//GEN-LAST:event_uploadEnabledActionPerformed private void setAndClearAlertsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_setAndClearAlertsActionPerformed if(alertTime.getText().length() < 8) { SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); alertTime.setText("Set:" + sdf.format(new Date())); processAlarmOffTime(); } else { alertTime.setText("n/a"); alertTimeCleared.setText(""); NOAAAlertBanner.setText(""); } }//GEN-LAST:event_setAndClearAlertsActionPerformed private void SA_getNOAAalertActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SA_getNOAAalertActionPerformed if(netIsAvailable()==(false)) JOptionPane.showMessageDialog(null,"No Internet"); else { NOAAalertsText.setText(null); JOptionPane.showMessageDialog(null,"The NOAA information has now been purged. Press OK to reload... "); NOAAmessagCompl = false; //filters first line of file FTPdownloadFiles(); //download NOAA Messages } }//GEN-LAST:event_SA_getNOAAalertActionPerformed private void alertPresistanceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_alertPresistanceActionPerformed if (alertTime.getText().equals("n/a")) alertTime.setText(""); //do nothing if(alertTime.getText().length() != 0) //only process when field is not empty processAlarmOffTime(); }//GEN-LAST:event_alertPresistanceActionPerformed private void uploadDataFTPActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_uploadDataFTPActionPerformed uploadingTempData(); }//GEN-LAST:event_uploadDataFTPActionPerformed private void SA_getNOAAalertMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_SA_getNOAAalertMouseEntered //NOAAalertsText.setText(null); }//GEN-LAST:event_SA_getNOAAalertMouseEntered private void StartActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_StartActionPerformed //List loggers = Collections.list(LogManager.getCurrentLoggers()); //loggers.add(LogManager.getRootLogger()); //for ( Logger logger : loggers ) { //logger.setLevel(Level.OFF); ///} //System.setProperty("name.of.the.Logger.level", "100"); //LogManager.getLogManager().readConfiguration(); //LogManager.getLogManager().reset(); Logger logger = Logger.getLogger(SA_Display.class.getName()); logger.setLevel(Level.OFF); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String time = sdf.format(new Date()); //Date date= new Date(); threadRestartLog.append("RFS started at: "+time+ "\n"); if (startEnable == true) { RealtimeEnable = 1; //enable to run realTime //realTime(); //run SA presetScanFrequencies(); loadUserParameters(); //FTPdownloadFiles(); //does not work in Linux downloadNOAA_Message(); screenSwitch.setSelectedIndex(0); setCursor(Cursor.getDefaultCursor()); scanStartButton.setEnabled(false); pauseResumeToggleButton.setEnabled(false); saveDataButton.setEnabled(true); for (int b = 1; b <= 421; b++) //set the correction varaiable to 1 { corrFactor[b] = 1; } SA_DSP.startup(); //starts audio engine startButton.setEnabled(false); refreshRate(); loadCalibration(); optionGraph = 1; //corrected SA_equalizerMode.setSelectedItem("corrected"); //SA_optionMode.setSelectedItem("Normal"); acceptButton.setEnabled(false); if (selIndexDisplayValue == 0) { selIndexDisplayValue = 1; //end thread for propagViewer realTime(); //start SA } try { //SA_test.setText(Integer.toString (selIndexDisplayScreen)); Thread.sleep(500); } catch (InterruptedException ex) { ex.printStackTrace(); } selIndexDisplayValue = 0; //stop PropgD loadSettings(); resetAudioEngine(); Start.setEnabled(false); startButton.setEnabled(false); startEnable = false; } delayedTimer(); }//GEN-LAST:event_StartActionPerformed private void updateFequencyCenterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_updateFequencyCenterActionPerformed corretionFreq.setText(Integer.toString((int)(FFT_step * dominantBin - 12000 ))); //dominant bin frequency [Hz] referenced to 12kHz FFT_binBFO = (int)((dominantBin) -1); //bin number to BFO zero }//GEN-LAST:event_updateFequencyCenterActionPerformed private void flrigConnectedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_flrigConnectedActionPerformed // TODO add your handling code here: }//GEN-LAST:event_flrigConnectedActionPerformed private void dataSelectorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dataSelectorActionPerformed //loadSettings(); corretionFreq.setText( (Integer.toString(corretionFreq_frig))); FFT_binBFO = (int)((Integer.parseInt(corretionFreq.getText()) + 12000) / FFT_step ); saveSettings(); }//GEN-LAST:event_dataSelectorActionPerformed private void WWVrecallButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_WWVrecallButton1ActionPerformed Runtime rt = Runtime.getRuntime(); String url = "https://www.qsl.net/rf-seismograph/"; //https://www.qsl.net/rf-seismograph/ String[] browsers = { "chromium-browser" , "epiphany", "firefox", "mozilla", "konqueror", "netscape", "opera", "links", "lynx" }; StringBuffer cmd = new StringBuffer(); for (int i = 0; i < browsers.length; i++) if(i == 0) cmd.append(String.format( "%s \"%s\"", browsers[i], url)); else cmd.append(String.format(" || %s \"%s\"", browsers[i], url)); // If the first didn't work, try the next browser and so on try { rt.exec(new String[] { "sh", "-c", cmd.toString() }); } catch (IOException ex) { Logger.getLogger(SA_Display.class.getName()).log(Level.SEVERE, null, ex); } }//GEN-LAST:event_WWVrecallButton1ActionPerformed private void SA_scan1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SA_scan1ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_SA_scan1ActionPerformed private void checkNetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkNetActionPerformed //earthQuakeBackup(); //runProcess2(); //uploadingTempData(); //FTPUploadBackup(); realTime(); //netIsAvailable(); //superceeded by netSpeed netSpeed(); if(netIsAvailable()==(true)) netAvail.setText("Int"); else netAvail.setText("off"); //open flrig // 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_checkNetActionPerformed private void testActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_testActionPerformed processAlertExpires(); //Open Viewer //new SeismoViewer().setVisible(true); //new SeismoViewer().setTitle("RF-Seismograph & Linux Spectrum Analyzer V J1.7 (MDSR) by VE7DXW"); //open flrig // 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_testActionPerformed private void stopPropGraphActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_stopPropGraphActionPerformed refreshTimePG.setSelectedItem("1s"); sliderValue = propagationDisplay.getHorizontalScrollBar().getValue(); //stopping graphServiceON.setSelected(false); startPropGraph.setEnabled(true); //must be on stopPropGraph.setEnabled(false); stopPropGraph.setText("<>"); selIndexDisplayValue = 0; //stops Graph thread stopPropGraph.setEnabled(false); try { Thread.sleep(1000); } catch (InterruptedException e) { } //int sliderValue = propagationDisplay.getHorizontalScrollBar().getValue(); //propagRestart.setText(Integer.toString (propagationDisplay.getHorizontalScrollBar().getValue())); //propagationDisplay.getHorizontalScrollBar().setValue(0); }//GEN-LAST:event_stopPropGraphActionPerformed private void reStrartDataCollActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_reStrartDataCollActionPerformed //starting RFS_dataCollection(); //stopping //propagationActive = 0; //idicating that popagarion is not running //dataCollectionEnable = 1;//stop data collection set to 1 //dataCollectionEnable = 0; //selIndexDisplayValue = 0; //graphServiceON.setSelected(false); }//GEN-LAST:event_reStrartDataCollActionPerformed private void startPropGraphActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_startPropGraphActionPerformed refreshTimePG.setSelectedItem("1s"); screenSwitch.setSelectedIndex(1); //0 = SA, 1 = Prop stopPropGraph.setText("Stop"); startPropGraph.setText("Start."); propagationDisplay.getHorizontalScrollBar().setValue(0);//set slide to 0 and then start - bottom set to last loc //resetAudioEngine(); //reset audio processor //starting selIndexDisplayValue =1;//propagation display start enabled if(dataCollectionEnable == 0) // 0 means not running { RFS_dataCollection(); //only start once if( graphServiceON.isSelected() == (false)) //testing if service is running propagationGraph(); } //SA_yGrid.setValue(0); //reset marker to 0. //yGrid = 0; try { Thread.sleep(1000); } catch (InterruptedException e) { } //propagationDisplay.getHorizontalScrollBar().setValue(Integer.parseInt(propagRestart.getText())); //set scroll bar to the left //System.out.println(sliderValue); stopPropGraph.setEnabled(true); try { Thread.sleep(1000); } catch (InterruptedException e) { } propagationDisplay.getHorizontalScrollBar().setValue(sliderValue); //System.out.println(sliderValue); }//GEN-LAST:event_startPropGraphActionPerformed private void CheckBoxFreq1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CheckBoxFreq1ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_CheckBoxFreq1ActionPerformed private void SA_listServicesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SA_listServicesActionPerformed //SA_listServices.removeAllItems(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String time = sdf.format(new Date()); if((String.valueOf(SA_listServices.getSelectedItem()).startsWith("Select to load list"))) { SA_listServices.removeItemAt(0); SA_listServices.addItem("Running Sevices - updated list: "+time); //System.out.println("test1"); } if(CheckBoxShowAll.isSelected() == (true)) runProcess(); //shows all items else { SA_listServices.removeAllItems(); SA_listServices.addItem("Select to load list: "+time); } StringBuilder s = new StringBuilder(); for(int i = 0; i <= (SA_listServices.getItemCount()-1) ; i++) //( (SA_listServices.getMaximumRowCount())) { if(SA_listServices.getItemAt(i) != (null)) s.append(String.valueOf(SA_listServices.getItemAt(i) + "#")); //else //break; } //String[] tempArray; initialized at the beggining of the code String str = (String.valueOf(s)); tempArray = ( str.split("#")); //remove "#" and split for (int x = 1; x <= (tempArray.length - 2) ; x++) //start with 1 to not select running processes; length -2 for out of bounds { if (tempArray[x] != null) { //System.out.println(tempArray[x]); //System.out.println((tempArray[x].substring(0, 9))); arrayNumbers[x] = (Integer.parseInt(tempArray[x].substring(0, 9))); // max 10 digits for int } } Arrays.sort(arrayNumbers); //starting with the lowest one //System.out.println(Arrays.toString(arrayNumbers)); String threadNumb = new String(""); for (int x = 1; x < (arrayNumbers.length) ; x++) //compare laoded and new list { if(arrayNumbers[x]!= 0) //System.out.println(arrayNumbers[x]); for (int y = 1; y < (tempArray.length) ; y++) { if(tempArray[y].startsWith(Integer.toString(arrayNumbers[x]))) //if(tempArray[y]) threadNumb = threadNumb + "#" + tempArray[y].substring(38, 41); } } tempArray1 = threadNumb.split("#"); //remove "#" and split.split("#")); //remove "#" and split //SA_listServices.removeAllItems(); for (int x = 1; x < (tempArray.length) ; x++) //remove doubles { int y; for (y = 1; y < (tempArray.length -2 ); y++) { if (tempArray1[y].contains(tempArray[x])) { tempArray[y] = "NA"; SA_listServices.addItem("test"); //add("test"); System.out.println(tempArray[x]); } } } //System.out.println(Arrays.toString(tempArray)); }//GEN-LAST:event_SA_listServicesActionPerformed private void killProcessButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_killProcessButtonActionPerformed SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String time = sdf.format(new Date()); //long time = date.getTime(); //SA_listServices.removeItemAt(1); if(CheckBoxShowAll.isSelected() == (false)) { SA_listServices.removeAllItems(); //SA_listServices.addItem("Updated list: "+time); } runProcess(); if(CheckBoxShowAll.isSelected() == (false)) { SA_listServices.removeAllItems(); //SA_listServices.addItem("Updated list: "+time); } runProcess(); //propGraph.destroy(); }//GEN-LAST:event_killProcessButtonActionPerformed private void CheckBoxShowAllActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CheckBoxShowAllActionPerformed // TODO add your handling code here: }//GEN-LAST:event_CheckBoxShowAllActionPerformed private void CheckBoxShowAllStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_CheckBoxShowAllStateChanged //SA_listServices.removeAllItems(); //if(CheckBoxShowAll.isSelected() == (true)) //runProcess(); //shows all items if(CheckBoxShowAll.isSelected() == (false)) { SA_listServices.removeAllItems(); //SA_listServices.addItem("Updated list: "+time); } runProcess(); if(CheckBoxShowAll.isSelected() == (false)) { SA_listServices.removeAllItems(); //SA_listServices.addItem("Updated list: "+time); } runProcess(); }//GEN-LAST:event_CheckBoxShowAllStateChanged private void propagRestartActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_propagRestartActionPerformed // TODO add your handling code here: }//GEN-LAST:event_propagRestartActionPerformed private void refreshTimePGActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_refreshTimePGActionPerformed // TODO add your handling code here: }//GEN-LAST:event_refreshTimePGActionPerformed private void formMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMousePressed refreshTimePG.setSelectedItem("1s"); }//GEN-LAST:event_formMousePressed private void jTabbedPane2MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTabbedPane2MouseEntered refreshTimePG.setSelectedItem("1s"); }//GEN-LAST:event_jTabbedPane2MouseEntered /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new SA_Display().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton CWrecallButton; private static javax.swing.JCheckBox CheckBoxFreq1; private static javax.swing.JCheckBox CheckBoxFreq2; private static javax.swing.JCheckBox CheckBoxFreq3; private static javax.swing.JCheckBox CheckBoxFreq4; private static javax.swing.JCheckBox CheckBoxFreq5; private static javax.swing.JCheckBox CheckBoxFreq6; private static javax.swing.JCheckBox CheckBoxShowAll; private javax.swing.JButton JT65recallButton; private static java.awt.TextField NOAAAlertBanner; private static java.awt.TextField NOAAAlertBanner1; private static java.awt.TextField NOAAMessage; public static javax.swing.JTextArea NOAAalertsText; private javax.swing.JButton RST_button; public static java.awt.TextField RigFrequency; private static java.awt.TextField RigMode; private static java.awt.TextField RigState; public static javax.swing.JSpinner SA_BinSelector; public static javax.swing.JSpinner SA_Frequency; private static javax.swing.JComboBox SA_Frequency1; private static javax.swing.JComboBox SA_Frequency2; private static javax.swing.JComboBox SA_Frequency3; private static javax.swing.JComboBox SA_Frequency4; private static javax.swing.JComboBox SA_Frequency5; private static javax.swing.JComboBox SA_Frequency6; private static java.awt.TextField SA_averageNoiseValue; private static javax.swing.JComboBox SA_bandwidthSelector; public static javax.swing.JButton SA_corrButton; public static java.awt.TextField SA_corrValue; private static java.awt.TextField SA_correctionCurveCurrent; private static javax.swing.JSlider SA_displayGain; public static javax.swing.JSlider SA_displayLevel; private static java.awt.TextField SA_dominantFrequencyLevel; private static java.awt.TextField SA_dominatFrequencyValue; public static javax.swing.JComboBox SA_equalizerMode; public static javax.swing.JButton SA_getNOAAalert; public static javax.swing.JComboBox SA_graphFunction; public static javax.swing.JComboBox SA_inputSelector; public static javax.swing.JComboBox SA_listServices; public static javax.swing.JButton SA_loadCorrectionCurve; public static javax.swing.JButton SA_manButton; public static javax.swing.JComboBox SA_optionMode; public static javax.swing.JComboBox SA_recallCorrectionCurve; public static javax.swing.JComboBox SA_refreshTime; public static javax.swing.JButton SA_saveCorrectionCurve; public static javax.swing.JButton SA_saveUserParameters; public static java.awt.TextField SA_scan1; private static java.awt.TextField SA_scan2; private static java.awt.TextField SA_scan3; private static java.awt.TextField SA_scan4; private static java.awt.TextField SA_scan5; private static java.awt.TextField SA_scan6; public static java.awt.TextField SA_time; private static javax.swing.JComboBox SA_videoFilterSelector; public static javax.swing.JSpinner SA_yGrid; private javax.swing.JButton SSBrecallButton; private javax.swing.JButton Start; private javax.swing.JButton WSPRrecallButton; private javax.swing.JButton WWVrecallButton; private javax.swing.JButton WWVrecallButton1; public static javax.swing.JButton acceptButton; public static javax.swing.JComboBox alertPresistance; private static java.awt.TextField alertTime; private static java.awt.TextField alertTimeCleared; private static java.awt.TextField antenna; private static javax.swing.JCheckBox autoSaveCheckBox; private static javax.swing.JCheckBox autoSaveCheckBoxImage; private static java.awt.TextField callSign; private javax.swing.JButton checkNet; public static javax.swing.JButton clearFtpActivity; private static java.awt.TextField corretionFreq; public static java.awt.TextField currentFrequency; private javax.swing.JRadioButton dataCollectionON; private javax.swing.JPanel dataCollectionSeviceON; private static javax.swing.JComboBox dataSelector; private javax.swing.JCheckBox displaySD; private static java.awt.TextField elevation; public static javax.swing.JButton equalizeButton; public static javax.swing.JTextPane eventsTrackerPane2; private javax.swing.JButton exitButton; private static java.awt.TextField filterpassHigh; private static java.awt.TextField filterpassLow; public static java.awt.TextField flrigConnected; public static javax.swing.JPanel frequencyMarquee; public static javax.swing.JTextArea ftpActivity; private static java.awt.TextField ftpDirectory; private static javax.swing.JPasswordField ftpPassWord; private static java.awt.TextField ftpServer; private static java.awt.TextField ftpUserName; private static javax.swing.JRadioButton graphServiceON; private static java.awt.TextField gridSquare; private javax.swing.JButton helpButton; private javax.swing.JDesktopPane jDesktopPane1; private javax.swing.JDesktopPane jDesktopPane2; private javax.swing.JLabel jLabel1; 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 jLabel22; private javax.swing.JLabel jLabel23; private javax.swing.JLabel jLabel24; private javax.swing.JLabel jLabel25; private javax.swing.JLabel jLabel26; private javax.swing.JLabel jLabel27; private javax.swing.JLabel jLabel28; private javax.swing.JLabel jLabel29; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel30; private javax.swing.JLabel jLabel31; private javax.swing.JLabel jLabel32; private javax.swing.JLabel jLabel33; private javax.swing.JLabel jLabel34; private javax.swing.JLabel jLabel35; private javax.swing.JLabel jLabel36; private javax.swing.JLabel jLabel37; private javax.swing.JLabel jLabel38; private javax.swing.JLabel jLabel39; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel40; private javax.swing.JLabel jLabel41; private javax.swing.JLabel jLabel42; private javax.swing.JLabel jLabel43; private javax.swing.JLabel jLabel44; private javax.swing.JLabel jLabel47; private javax.swing.JLabel jLabel48; private javax.swing.JLabel jLabel49; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel50; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JLabel jLabel9; private static javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel10; private javax.swing.JPanel jPanel11; private javax.swing.JPanel jPanel12; private javax.swing.JPanel jPanel13; private javax.swing.JPanel jPanel14; private javax.swing.JPanel jPanel15; private javax.swing.JPanel jPanel16; public static javax.swing.JPanel jPanel17; private javax.swing.JPanel jPanel18; private javax.swing.JPanel jPanel19; private javax.swing.JPanel jPanel2; private javax.swing.JPanel jPanel20; private javax.swing.JPanel jPanel21; private javax.swing.JPanel jPanel22; private javax.swing.JPanel jPanel23; private javax.swing.JPanel jPanel24; private javax.swing.JPanel jPanel25; private javax.swing.JPanel jPanel26; private javax.swing.JPanel jPanel27; private javax.swing.JPanel jPanel28; private javax.swing.JPanel jPanel29; private javax.swing.JPanel jPanel3; private javax.swing.JPanel jPanel30; private javax.swing.JPanel jPanel31; private javax.swing.JPanel jPanel32; 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; private javax.swing.JScrollPane jScrollPane3; private javax.swing.JScrollPane jScrollPane4; private javax.swing.JTabbedPane jTabbedPane1; public static javax.swing.JTabbedPane jTabbedPane2; private javax.swing.JToolBar jToolBar1; public static javax.swing.JButton killProcessButton; private static java.awt.TextField lastDataPoint; private static java.awt.TextField netAvail; public static java.awt.TextField numberOfEntries; private javax.swing.JToggleButton pauseResumeToggleButton; public static javax.swing.JSpinner propAmp; public static javax.swing.JSpinner propThreshold; private javax.swing.JScrollPane propTrackPane; private static java.awt.TextField propagRestart; public static javax.swing.JScrollPane propagationDisplay; private static javax.swing.JPanel propagationDisplay1; private javax.swing.JPanel propagationDisplayScoll; public static javax.swing.JPanel propagationDisplayTab; private javax.swing.JButton propagationLisiting; public static javax.swing.JButton reStrartDataColl; private javax.swing.JButton recallButtonPSK31; private javax.swing.JButton recallFrequButton; private static javax.swing.JComboBox refreshTimePG; private static javax.swing.JButton saveDataButton; private javax.swing.JButton saveFrequButton; private static javax.swing.JButton savePNGButton; private javax.swing.JButton scanStartButton; private static javax.swing.JComboBox scanTime; public static javax.swing.JTabbedPane screenSwitch; public static javax.swing.JButton setAndClearAlerts; public static javax.swing.JPanel spectralDisplay; private javax.swing.JPanel spectrumInnerPane; private javax.swing.JButton startButton; public static javax.swing.JButton startPropGraph; public static javax.swing.JButton stopPropGraph; private javax.swing.JButton test; public static javax.swing.JTextArea threadRestartLog; private javax.swing.JCheckBox timeIncidentDuplicate; public static java.awt.TextField timeIntPG; private static javax.swing.JComboBox updateCalibration; private javax.swing.JButton updateFequencyCenter; public static javax.swing.JButton uploadDataFTP; private static javax.swing.JCheckBox uploadEnabled; // End of variables declaration//GEN-END:variables public static void scannerUpdaqteFrequency() { if(dataSelector.getSelectedItem().equals("MDSR")) { try { BufferedWriter out = new BufferedWriter(new FileWriter((System.getProperty("user.home"))+ "/MDSR_SA/transmitter.cfg")); //needs mod from SA out.write("off"); out.newLine(); out.write(currentFrequency.getText()); //getSelectedIndex());//.getSelectedItem()); // out.newLine(); out.close(); } catch (IOException e) { JOptionPane.showMessageDialog(null,"transmitter.cfg file write error. (MDSR_TXsetup line: 3059)"); //+ //"\nIf this is a Win Vista or Win7 environment\n, the error might be" + //"caused by Win security.\nThis progam can not run in the 'Program File' folder.\nPlease move MDSR directory directly to\n" + // "the C-drive root. "); } return ; } if(dataSelector.getSelectedItem().equals("flrig")) { flrigSetFrequency = Double.parseDouble(currentFrequency.getText()); connectFldigiWrite(); } } public static void propagationGraph() { boolean flagIfAlive; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String time = sdf.format(new Date()); if(startPropGraph.getText() == ("Start.")) { threadRestartLog.append("Graph started at: "+time+"\n"); startPropGraph.setText("Start"); } Thread propGraph; //thread end propGraph = new Thread() { int treadSleep; @Override public void run() { int d = 0; //propagationDisplay1.setPreferredSize(new Dimension(2500, 242)); //if(selIndexDisplayScreen == 1){ Graphics gfx = propagationDisplay1.getGraphics(); Font font=new Font("Sansserif",Font.BOLD | Font.PLAIN,22); graphServiceON.setSelected(true); do { d = d + 1; //System.out.println (d); //System.out.println(String.valueOf(SA_listServices.getSelectedItem())); for (int jCount = 0; jCount <= jMax - displayStart -1; jCount =jCount + displayTime ) { //test.setText((Integer.toString(jCount)) +","+ (Integer.toString(jMax))); //if (propagationActive == 0) //j = 0; Point loc_sS = screenSwitch.getLocationOnScreen(); Point offsetPoint_sS = new Point(loc_sS.x, loc_sS.y); Point loc_sB = propagationDisplay1.getLocationOnScreen(); Point offsetPoint1 = new Point(loc_sS.x-loc_sB.x + 8, loc_sB.y - loc_sS.y); int x1 = offsetPoint1.x; int y1 = offsetPoint1.y; if (jMax > x1) { displayStart = x1; } //if(mMax == jMax + 1) //needs work { // SA_test.setText((Integer.toString(jMax)) + "," + ((Integer.toString(mMax)) )); //System.out.println(j+ "," +jMax); //System.out.println(y1); //itemsPropagationList(); //displays the number of the listed items try { if (clearScreen==1) //clear screen { //repaint the frequency marque make the marquee flicker preCAT_Frequency = 0; //so that CAT and preCAT are not equal updateScrollingFrequency(); gfx.clearRect(0,0, 2500, 240); gfx.setColor(Color.darkGray); gfx.fillRect(0,0, 2500, 240); clearScreen = 0; // } if (jCount==0) //clear screen { //resetPropGraph.setEnabled(true); gfx.clearRect(0,0, 2500, 240); gfx.setColor(Color.DARK_GRAY); gfx.fillRect(0,0, 2500, 242); //gfx. // } if (jCount>0) { gfx.setColor(Color.LIGHT_GRAY); //grid horiz gfx.drawLine (2500, 24, 0, 24); gfx.drawLine (2500, 48, 0, 48); gfx.drawLine (2500, 72, 0, 72); gfx.drawLine (2500, 96, 0, 96); gfx.drawLine (2500, 120, 0, 120); gfx.drawLine (2500, 144, 0, 144); gfx.drawLine (2500, 168, 0, 168); gfx.drawLine (2500, 192, 0, 192); //gfx.drawLine (2500, 216, 0, 216); //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]; 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 (timeIntPG.getText().equals("1s")) { //interval = interval_6h; displayTime = 1; try { if (displayTimeMarker[jCount + displayStart]!= null) { // System.out.println (displayTimeMarker[(j -1)].substring(17, 18)); //for minutes (14, 16) if ((Integer.parseInt(displayTimeMarker[(jCount -1) + displayStart].substring(17, 18))) != (Integer.parseInt (displayTimeMarker[jCount + displayStart].substring(17, 18))))//new minute line { for (int val = 0; val < interval_1m.length; val++) //update the correction array { if ((displayTimeMarker[jCount + displayStart ].substring(17, 19)).contains((interval_1m[val]))) //new vertical line interval { gfx.setColor(Color.orange); gfx.drawLine(jCount, 0, jCount, 238); //vertical time line 1s interval gfx.setColor(Color.blue); //mask to aviod letters on top of each other gfx.fillRect(jCount + 1,2, 40, 20); gfx.setColor(Color.LIGHT_GRAY); gfx.drawString(displayTimeMarker[jCount + displayStart].substring(11,16), jCount + 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 3502"); //JOptionPane.showMessageDialog(null, "error 2151"); } } //SA_test.setText(scanTime.getSelectedItem()); try { if (displayTimeMarker[jCount + displayStart]!= null) { if ((Integer.parseInt(displayTimeMarker[(jCount -1) + displayStart].substring(11, 13))) != (Integer.parseInt (displayTimeMarker[jCount + displayStart].substring(11, 13))))//new hour line { for (int val = 0; val < interval.length; val++) //update the correction array { if ((displayTimeMarker[jCount + displayStart].substring(11, 13)).contains((interval[val]))) //new vertical line interval { gfx.setColor(Color.orange); gfx.drawLine(jCount, 0, jCount, 238); //vertical time line 52s interval gfx.setColor(Color.blue); //mask to aviod letters on top of each other gfx.fillRect(jCount + 1,2, 65, 20); gfx.setColor(Color.LIGHT_GRAY); gfx.drawString(displayTimeMarker[jCount + displayStart].substring(5, 16), jCount + 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 (StringIndexOutOfBoundsException r) { //System.out.println ("Error line 43700 - string "); //JOptionPane.showMessageDialog(null, "error 4339"); } //SA_test.setText(Double.toString(displaySSI[j])); //if(displaySSI[j]> 0) { try { boolean timeMakerProcessed =(false); //set true if propagation is alredy active on specific time marker //time propagation graph 1s interval stratup graph if (delayTimeProp == 6) { gfx.setColor(Color.red); gfx.drawLine(jCount / displayTime ,((int)displaySSI_startup[jCount-displayTime + displayStart + displayPan]* ((int)displayGain / 5 ) - (noiseFloor * 2 - 100)),jCount / displayTime,((int)displaySSI_startup[jCount + displayStart + displayPan]* ((int)displayGain / 5 )- (noiseFloor * 2 - 100)) ); //finding propagation bottom display for 1s interval stratup graph float a; a = (Float.parseFloat(String.valueOf(displaySSI_startup[jCount-displayTime + displayStart + displayPan] - displaySSI_startup[jCount-displayTime + displayStart + displayPan + 1]))); if(a < 0) a = a *-1; gfx.drawLine (2500, 239, 0, 239); gfx.setColor(Color.getHSBColor(TOP_ALIGNMENT, 0, a * propAmpValue/100 )); gfx.drawLine(jCount / displayTime ,239,jCount / displayTime,224 ); } //time propagation graph CH1 if (CheckBoxFreq1.isSelected()== true) { gfx.setColor(Color.red); gfx.drawLine(jCount / displayTime ,((int)displaySSI_CH1[jCount-displayTime + displayStart + displayPan] * ((int)displayGain / 5 ) - (noiseFloor * 2 - 100)),jCount / displayTime,((int)displaySSI_CH1[jCount + displayStart + displayPan]*((int)displayGain / 5 ) - (noiseFloor * 2 - 100)) ); //finding propagation bottom display for CH1 float a; a = (Float.parseFloat(String.valueOf(displaySSI_CH1[jCount-displayTime + displayStart + displayPan ] - displaySSI_CH1[jCount-displayTime + displayStart + displayPan - 1 ]))); if(a < 0) a = a *-1; gfx.drawLine (2500, 239, 0, 239); gfx.setColor(Color.getHSBColor(TOP_ALIGNMENT, 0, a * propAmpValue/100 )); gfx.drawLine(jCount / displayTime ,239,jCount / displayTime,234); } //time propagation graph CH2 if (CheckBoxFreq2.isSelected()== true) { gfx.setColor(Color.green); gfx.drawLine(jCount / displayTime ,((int)displaySSI_CH2[jCount-displayTime + displayStart + displayPan]* ((int)displayGain / 5 ) - (noiseFloor * 2 - 100)),jCount / displayTime,((int)displaySSI_CH2[jCount + displayStart + displayPan]*((int)displayGain / 5 ) - (noiseFloor * 2 - 100)) ); //finding propagation bottom display for CH2 float a; a = (Float.parseFloat(String.valueOf(displaySSI_CH2[jCount-displayTime + displayStart + displayPan ] - displaySSI_CH2[jCount-displayTime + displayStart + displayPan - 1 ]))); if(a < 0) a = a *-1; gfx.drawLine (2500, 232, 0, 232); gfx.setColor(Color.getHSBColor(TOP_ALIGNMENT, 0, a * propAmpValue/100 )); gfx.drawLine(jCount / displayTime ,231,jCount / displayTime,225); } //time propagation graph CH3 if (CheckBoxFreq3.isSelected()== true) { gfx.setColor(Color.yellow); gfx.drawLine(jCount / displayTime ,((int)displaySSI_CH3[jCount-displayTime + displayStart + displayPan]* ((int)displayGain / 5 ) - (noiseFloor * 2 - 100)),jCount / displayTime,((int)displaySSI_CH3[jCount + displayStart + displayPan]*((int)displayGain / 5 ) - (noiseFloor * 2 - 100)) ); //finding propagation bottom display for CH3 float a; a = (Float.parseFloat(String.valueOf(displaySSI_CH3[jCount-displayTime + displayStart + displayPan ] - displaySSI_CH3[jCount-displayTime + displayStart + displayPan - 1 ]))); if(a < 0) a = a *-1; gfx.drawLine (2500, 223, 0, 223); gfx.setColor(Color.getHSBColor(TOP_ALIGNMENT, 0, a * propAmpValue/100 )); gfx.drawLine(jCount / displayTime ,222,jCount / displayTime,217); } //time propagation graph CH4 if (CheckBoxFreq4.isSelected()== true) { gfx.setColor(Color.magenta); gfx.drawLine(jCount / displayTime ,((int)displaySSI_CH4[jCount-displayTime + displayStart + displayPan]* ((int)displayGain / 5 ) - (noiseFloor * 2 - 100)),jCount / displayTime,((int)displaySSI_CH4[jCount + displayStart + displayPan]*((int)displayGain / 5 ) - (noiseFloor * 2 - 100)) ); //finding propagation bottom display for CH4 float a; a = (Float.parseFloat(String.valueOf(displaySSI_CH4[jCount-displayTime + displayStart + displayPan ] - displaySSI_CH4[jCount-displayTime + displayStart + displayPan - 1 ]))); if(a < 0) a = a *-1; gfx.drawLine (2500, 215, 0, 215); //separation line gfx.setColor(Color.getHSBColor(TOP_ALIGNMENT, 0, a * propAmpValue/100 )); gfx.drawLine(jCount / displayTime ,214,jCount / displayTime,209); } //time propagation graph CH5 if (CheckBoxFreq5.isSelected()== true) { gfx.setColor(Color.cyan); gfx.drawLine(jCount / displayTime ,((int)displaySSI_CH5[jCount-displayTime + displayStart + displayPan]* ((int)displayGain / 5 ) - (noiseFloor * 2 - 100)),jCount / displayTime,((int)displaySSI_CH5[jCount + displayStart + displayPan]*((int)displayGain / 5 ) - (noiseFloor * 2 - 100)) ); //finding propagation bottom display for CH5 float a; a = (Float.parseFloat(String.valueOf(displaySSI_CH5[jCount-displayTime + displayStart + displayPan ] - displaySSI_CH5[jCount-displayTime + displayStart + displayPan - 1 ]))); if(a < 0) a = a *-1; gfx.drawLine (2500, 207, 0, 207); gfx.setColor(Color.getHSBColor(TOP_ALIGNMENT, 0, a * propAmpValue / 100 )); gfx.drawLine(jCount / displayTime ,206,jCount / displayTime,201); } //time propagation graph CH6 if (CheckBoxFreq6.isSelected()== true) { gfx.setColor(Color.PINK); gfx.drawLine(jCount / displayTime ,((int)displaySSI_CH6[jCount-displayTime + displayStart + displayPan]* ((int)displayGain / 5 ) - (noiseFloor * 2 - 100)),jCount / displayTime,((int)displaySSI_CH6[jCount + displayStart + displayPan]*((int)displayGain / 5 ) - (noiseFloor * 2 - 100)) ); //finding propagation bottom display for CH6 float a; a = (Float.parseFloat(String.valueOf(displaySSI_CH6[jCount-displayTime + displayStart + displayPan ] - displaySSI_CH6[jCount-displayTime + displayStart + displayPan - 1 ]))); if(a < 0) a = a *-1; gfx.drawLine (2500, 199, 0, 199); gfx.setColor(Color.getHSBColor(TOP_ALIGNMENT, 0, a * propAmpValue/100 )); gfx.drawLine(jCount / displayTime ,198,jCount / displayTime,193); } timeMakerProcessed =(false); //reset for next time marker //select last line of the box String s = eventsTrackerPane2.getText(); int pos = s.length(); eventsTrackerPane2.setCaretPosition(pos); } catch (ArrayIndexOutOfBoundsException e) { //System.out.println ("Error line 4995"); //JOptionPane.showMessageDialog(null, "Error line 2177"); } } //mouse pointer Point p = MouseInfo.getPointerInfo().getLocation(); //get mouse coordinates Point loc = screenSwitch.getLocationOnScreen(); Point offsetPoint = new Point(p.x- loc.x , p.y-loc.y); int x = 0; if(mousePressed == true) { x= offsetPoint.x; //mousePressed =false; } int y = offsetPoint.y; //SA_test.setText(Integer.toString(x)+ "," + Integer.toString(y)); if ( x < 0) x = 0; //restraint if ( x > 440) x = 440; //restraint gfx.setColor(Color.red); if (x > 0) { if (x < 440) { if (y > 0) { if (y < 243) { if(mousePressed == true) { //SA_test.setText("pressed"); if (displayTimeMarker[x * displayTime + displayStart]!= null) { //if (jMax < 10) gfx.drawString("Marker Time: " + displayTimeMarker[(x * displayTime + displayStart)], 30, 180);//set lower //gfx.drawString(("Marker Value: " + (String.format("%.1f",displaySSI_CH1[x * displayTime + displayStart] * -1))+ "dB"), 30, 143); } gfx.drawLine (x + 1, 0,x + 1, 235); //center line } } else { if( yGrid > 0) { if (displayTimeMarker[yGrid * displayTime + displayStart]!= null) { //if (jMax < 10) gfx.drawString("Marker Time: " + displayTimeMarker[(yGrid * displayTime + displayStart) ], 30, 209); //gfx.drawString(("Marker Value: " + (String.format("%.1f",displaySSI_CH1[yGrid * displayTime + displayStart] * -1))+ "dB"), 30, 143); } gfx.drawLine (yGrid + 1, 0,yGrid + 1, 235); //center line } } } } } //if(NOAAMessage.getText().startsWith ("NOAA Alert:")) //code for Special Message display if(alertTime.getText().length() > 8) { try { if(timeIntPG.getText().equals("1s")) //one second interval marker { //System.out.println(alertTime.getText() + ":59"); //aviod minute time lag //System.out.println(displayTimeMarker[jCount + displayStart].substring(11, 19)); if(displayTimeMarker[jCount + displayTime + displayStart + displayPan].substring(11, 19).equals (alertTime.getText().substring(4, 9) + ":59")) { gfx.setColor(Color.white); //NOAA Alert marker gfx.drawString(NOAAAlertBanner.getText(), jCount -displayTime + displayPan - 20, 183); } } if(timeIntPG.getText().equals("52s")) //long interval marker { //System.out.println(alertTime.getText().substring(4,9)); //System.out.println(displayTimeMarker[jCount + displayStart].substring(11, 16)); if(displayTimeMarker[jCount + displayTime + displayStart + displayPan].substring(11, 16).equals (alertTime.getText().substring(4, 9))) { if (jCount-displayTime + displayPan + 5 > 0) { gfx.setColor(Color.white); //NOAA Alert marker gfx.drawString(NOAAAlertBanner.getText(), jCount-displayTime + displayPan - 20, 183); } } } } catch (NullPointerException n) { //System.out.println ("Error line 4924 - null pointer issue, " + jCount +", "+ (jCount-displayTime + displayStart + displayPan)); //JOptionPane.showMessageDialog(null, "Error line 3689"); } } //SA_test.setText(( Integer.toString(SSI[j]))+","+(Integer.toString (j))); //setCursor(Cursor.CROSSHAIR_CURSOR); //Point p =(SwingUtilities.convertPointFromScreen(MouseInfo.getPointerInfo().getLocation(), propagationDisplay)); //SA_test.setText(MouseInfo.getPointerInfo()); } //SA_test.setText(Integer.toString (SSI[j])); } catch (StringIndexOutOfBoundsException r) { //System.out.println ("Error line 4314 - string issue, " + jCount +", "+ (jCount-displayTime + displayStart + displayPan)); //JOptionPane.showMessageDialog(null, "Error line 3689"); } } processAlertExpires(); } //code needs work - obsolete /** try { int delayDisplay = 2000; if(delayImageSave = false) //prevent unfinished redraw delayDisplay = 2000; else delayDisplay = 2500; Thread.sleep(delayDisplay); delayImageSave = true; //prevent unfinished redraw } catch (InterruptedException e) { } **/ if((String.valueOf(SA_listServices.getSelectedItem()).contains("Prop. Graph"))) if (killProcessButton.hasFocus()) { System.out.println("ending GraphProcess"); System.out.println(SA_listServices.getSelectedIndex()); int i; i = (SA_listServices.getSelectedIndex()); SA_listServices.setSelectedIndex(0); //removeItem.startsWith("OldItem"); SA_listServices.removeAll(); SA_listServices.removeItem(i); //SA_listServices.removeAllItems(); //propGraph.destroy(); selIndexDisplayValue = 0; SA_listServices.requestFocus(); } if (d == 1)propagRestart.setText("0"); if (d == 10000)propagRestart.setText("|"); if (d == 20000)propagRestart.setText("||"); if (d == 30000)propagRestart.setText("|||"); if (d == 40000)propagRestart.setText("||||"); if (d == 50000)propagRestart.setText("|||||"); if (d == 60000)propagRestart.setText("||||||"); if (d == 70000)propagRestart.setText("|||||||"); if (d == 80000)propagRestart.setText("||||||||"); if (d == 90000)propagRestart.setText("|||||||||"); if (d == 99998)propagRestart.setText("restart..."); if(refreshTimePG.getSelectedItem() == "1m") { treadSleep = 60000; //one minute } else { treadSleep = 1000; //1s } try { sleep(treadSleep); }catch (InterruptedException e) { } if(d == 99999) //make sure it never ends d = 1; if(stopPropGraph.getText() == "<>") d = 100001; //escape loop }//do end //while ( graphServiceON.isEnabled() == (true)) ; //escape condition every ~27 h while ( d < 100000) ; //escape condition every ~27 h try { Thread.sleep(1000); } catch (InterruptedException e) { } graphServiceON.setSelected(false); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String time = sdf.format(new Date()); if(stopPropGraph.getText().equals("<>")) { threadRestartLog.append("Graph stopped at: "+time+ "\n"); stopPropGraph.setText("Stop"); } } //pulic void run end }; int x = 0; Set threadSet = Thread.getAllStackTraces().keySet(); for ( Thread propGraph1 : threadSet){ x = x +1; if ( propGraph.getThreadGroup() == Thread.currentThread().getThreadGroup()){ Date date= new Date(); //propGraph[x] = propGraph[x]. ("Thread-12","Propagation Graph"); if (x == 1 ) //only show one instance SA_listServices.insertItemAt(date.getTime()+" Propag G: "+propGraph+":"+"state:"+propGraph.getState(),2); //SA_listServices.addItem(date.getTime()+ //System.out.println("Prop. Graph: "+propGraph+":"+"state:"+propGraph.getState()); } } //graphThreadStaus.setText(realTime2.getState()); //if( graphServiceON.isSelected() == (true)) //testing if service is running { //propGraph.isInterrupted(); } //if (exitLoop == 1) realTime2.destroy(); //else propGraph.start(); String GraphStatus; GraphStatus = ("" + propGraph.getState()); //System.out.println("GraphStat: " + GraphStatus ); if(GraphStatus.equals("RUNNABLE")) { graphServiceON.setSelected(true); startPropGraph.setEnabled(false); stopPropGraph.setEnabled(true); } else { graphServiceON.setSelected(false); startPropGraph.setEnabled(true); stopPropGraph.setEnabled(false); } //graphServiceON.setSelected(false); //startPropGraph.setEnabled(true); //stopPropGraph.setEnabled(false); } //end public void RFS_dataCollection() { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String time = sdf.format(new Date()); if(dataCollectionON.isSelected() == (false)) // stop from starting twice { scanStartButton.setEnabled(true); if(dataCollectionON.getText() == "ReStart Data.") { threadRestartLog.append("Data Colletion started at: "+time+ "\n"); dataCollectionON.setText("ReStart Data"); } } if (propagationActive == 0) // 0 means not running { propagationActive = 1; //set this it will only run once lastDataPoint.setText("...waiting..."); //dataCollectionON.setSelected(true); Thread dC; //thread end dC = new Thread() { //@Override public void run() { do { for ( mCount = 0; mCount <= 6720; mCount++) { //start of scanner code if (pauseResumeToggleButton.isSelected() == (false)) { if (delayTimeProp > 6) //do not scan in statup mode when updatetime 1s per point { scanCount = scanCount + 1; //increase scanner count each time measuerment occors if (scanCount == 7) //reset scan count to rescan from channel 1 scanCount = 1; if (scanCount == 1) currentFrequency.setText(SA_scan1.getText()); if (scanCount == 2) currentFrequency.setText(SA_scan2.getText()); if (scanCount == 3) currentFrequency.setText(SA_scan3.getText()); if (scanCount == 4) currentFrequency.setText(SA_scan4.getText()); if (scanCount == 5) currentFrequency.setText(SA_scan5.getText()); if (scanCount == 6) currentFrequency.setText(SA_scan6.getText()); scannerUpdaqteFrequency(); } } //pauseResumeToggleButton if (pauseResumeToggleButton.isSelected() == (true)) currentFrequency.setText("scanner off"); //currentFrequency.setText("Scanner"+Integer.toString(scanCount)); //return to datacollection code jMax = mCount; // used for pan limmits // if (m > 420 * displayTime) //when scrolling should start { //if(displayStart >= 830) //displayStart = 6300; // else // displayStart = (displayStart + 1); } if (mCount == 1661) //run bucket parade { propThresholdValue = (Integer.parseInt(String.valueOf(propThreshold.getValue()))); //update propagation value //tempPanState = 0; //AUTO refresh propagation list itemsPropagationList(); //counts the # of items in the propagation list try { for (int b = 0; b <= 1661; b++) //24 h of data has been collected and now the data is scrolled { displaySSI_startup[b] = displaySSI_startup[b+1]; displaySSI_CH1[b] = displaySSI_CH1[b+1]; //scrolling current display displaySSI_CH2[b] = displaySSI_CH2[b+1]; displaySSI_CH3[b] = displaySSI_CH3[b+1]; displaySSI_CH4[b] = displaySSI_CH4[b+1]; displaySSI_CH5[b] = displaySSI_CH5[b+1]; displaySSI_CH6[b] = displaySSI_CH6[b+1]; displayTimeMarker[b] = displayTimeMarker[b+1]; mCount = 1660; //52s per point for 24h scan time } } catch (ArrayIndexOutOfBoundsException e) { System.out.println ("Error line 2372"); JOptionPane.showMessageDialog(null, "Error line 2372"); } } try { Thread.sleep((1000 * delayTimeProp / 6));//delayTimeProp -2000 to compensate for the CAT delay in scannerUpdaqteFrequency() } catch (InterruptedException ex) { System.out.println ("Error line 2361"); JOptionPane.showMessageDialog(null, "Error line 2361"); } //SA_test.setText(Integer.toString(propagationActive)); { // //propagationActive = 1; //start collection only once try { mMax = mCount; //used to limit refresh rate int hours; int min; int hoursDifZulu; int minDifZulu; //hours = (Integer.parseInt(sdf.format(new Date()).substring(0, 2))); //hours //min = (Integer.parseInt(sdf.format(new Date()).substring(3, 5))); //min // hoursDifZulu = (Integer.parseInt(sdf.format(new Date()).substring(8, 11))); //difference in hours SimpleDateFormat ldf = new SimpleDateFormat("HH:mm:ssZ"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ssZ"); if (pauseResumeToggleButton.isSelected() == (false)) { if (delayTimeProp == 6) // that is the 1s startup interval { scanCount = 0; displaySSI_startup[mCount] = -1 * ((20.0 * Math.log10(DF_noiseLoading))); //getting data from DSP displayTimeMarker[mCount] = (sdf.format(new Date())); //long time format for array //mCount = mCount - 1; } if (scanCount == 1) { displaySSI_CH1[mCount] = -1 * ((20.0 * Math.log10(DF_noiseLoading))); //getting data from DSP displayTimeMarker[mCount] = (sdf.format(new Date())); //long time format for array if(mCount == 1) displaySSI_CH1[0]= displaySSI_CH1[1]; //avoiding statup bridge mCount = mCount - 1; } if (scanCount == 2) { displaySSI_CH2[mCount] = -1 * ((20.0 * Math.log10(DF_noiseLoading))); if(mCount == 1) displaySSI_CH2[0]= displaySSI_CH2[1]; //avoiding statup bridge mCount = mCount - 1; } if (scanCount == 3) { displaySSI_CH3[mCount] = -1 * ((20.0 * Math.log10(DF_noiseLoading))); if(mCount == 1) displaySSI_CH3[0]= displaySSI_CH3[1]; //avoiding statup bridge mCount = mCount - 1; } if (scanCount == 4) { displaySSI_CH4[mCount] = -1 * ((20.0 * Math.log10(DF_noiseLoading))); if(mCount == 1) displaySSI_CH4[0]= displaySSI_CH4[1]; //avoiding statup bridge mCount = mCount - 1; } if (scanCount == 5) { displaySSI_CH5[mCount] = -1 * ((20.0 * Math.log10(DF_noiseLoading))); if(mCount == 1) displaySSI_CH5[0]= displaySSI_CH5[1]; //avoiding statup bridge mCount = mCount - 1; } if (scanCount == 6) { displaySSI_CH6[mCount] = -1 * ((20.0 * Math.log10(DF_noiseLoading))); if(mCount == 1) displaySSI_CH6[0]= displaySSI_CH6[1]; //avoiding statup bridge if (autoSaveCheckBox.isSelected() == (true)) //save data only save when selected { if ((Integer.parseInt(displayTimeMarker[(mCount -1)].substring(8, 10))) != (Integer.parseInt (displayTimeMarker[mCount].substring(8, 10))))//new day line saveDataToCSV(); //saves data when date changes (every 24h) } if ((Integer.parseInt(displayTimeMarker[(mCount -1)].substring(11, 13))) != (Integer.parseInt (displayTimeMarker[mCount].substring(11, 13))))//every 10m { System.out.println("RST " + displayTimeMarker[(mCount -1)]); resetAudioEngine(); //reset audio processor } if ((Integer.parseInt(displayTimeMarker[(mCount -1)].substring(14, 15))) != (Integer.parseInt (displayTimeMarker[mCount].substring(14, 15))))//every 10m { saveDataToTemp(); //saves data to tempData.bak every 10min uploadingTempData(); //upload data to server FTPdownloadFiles(); //checks for updates on the NoAA site if (autoSaveCheckBoxImage.isSelected() == (true)) //save image only save when selected { saveImage(); //saves PNG image every 10min //System.out.println(displayTimeMarker[(mCount)].substring(14, 15)); } } } lastDataPoint.setText(ldf.format(new Date())); if(lastDataPoint.getText().substring(4,7).equals ("9:3")) //run Propviewer at x9m3x sec { eventsTrackerPane2.setText(""); get6hPropagation();//run update before creating report } if(lastDataPoint.getText().substring(0,7).equals ("00:00:3")) //run dataBackup at 00:05:3x sec { FTPUploadBackup(); System.out.println ("Backup at:"+lastDataPoint.getText().substring(0,7)); } } // pauseResumeToggleButton if (pauseResumeToggleButton.isSelected() == (true)) { mCount = mCount - 1; lastDataPoint.setText("paused"); } } catch (Exception e) { //System.out.println ("Error line 3638"); } //if (displaySSI[m] < 1) m=m-1; } //SSI[j] = (-1 * (Integer.parseInt((SA_averageNoiseValue.getText())))); //entering date into array //SA_test.setText(Integer.toString(j + displayStart + displayPan)); // } catch (NullPointerException b) { // j = 0; //exitLoop = 1; // } } try { Thread.sleep(10); } catch (InterruptedException e) { System.out.println ("Error line 2469"); JOptionPane.showMessageDialog(null, "restart Data Collection"); dataCollectionON.setSelected(false); reStrartDataColl.enable(true); } } //do end while ( dataCollectionEnable == 1) ; //escape condition } //pulic void run end }; //Date date1= new Date(); //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String time1 = sdf.format(new Date()); threadRestartLog.append("Data Colletion started at: "+time1+ "\n"); int x = 0; Set threadSet = Thread.getAllStackTraces().keySet(); for ( Thread propGraph1 : threadSet){ x = x +1; if ( dC.getThreadGroup() == Thread.currentThread().getThreadGroup()){ Date date= new Date(); if (x == 1 ) //only show one instance SA_listServices.insertItemAt(date.getTime()+" DataColl: "+dC+":"+"state:"+dC.getState(),2); //System.out.println(x+" Data Collection: "+dataCollection+":"+"state:"+dataCollection.getState()); } } dC.start(); String GraphDC; GraphDC = ("" + dC.getState()); System.out.println("GraphStat: " + GraphDC); if(GraphDC.equals ("RUNNABLE")) { dataCollectionON.setSelected(true); reStrartDataColl.enable(false); } else { dataCollectionON.setSelected(false); reStrartDataColl.enable(true); } } }; //end public void realTime() { //spectrum analyzer code countArr = 1; Thread rT = new Thread() { //@Override public void run() { //if(selIndexDisplayScreen == 0){ Graphics gfx = spectrumInnerPane.getGraphics(); int y = 0; int y1 = 0; int y2 = 0; int y3 = 0; int y4 = 0; int y5 = 0; int y6 = 0; do { for (int i = 0; i <= 420; i++) try { if (i == 420) { arrCount = arrCount + 1; SA_time.setText((Integer.toString(refreshCount))+ "mS"); refreshRate = refreshCount; refreshCount = 0; if (optionMode == 1) //option mode 1 is peakhold { peakHoldtoCalibration(); } } if (optionGraph == 0) //option mode 0 is normal //aviod array err { noiseLoading = 0.0; //bucket chain update y1 = y2; y2 = y3; y3 = y4; y4 = y5; y5 = y6; y6 = (int)((displayGain *((5 * noiseFloor) + (20.0 * Math.log10((SA_DSP.FFT_binsAverage[i+5]* (SA_DSP.FFT_binsAverage[i+5])))))) /10); } if (optionGraph == 1) //option mode 1 is corrected //bucket chain update { y1 = y2; y2 = y3; y3 = y4; y4 = y5; y5 = y6; y6 = (int)(( displayGain *((5 * noiseFloor) + (20.0 * Math.log10(corrFactor[i+5] *(SA_DSP.FFT_binsAverage[i+3]* (SA_DSP.FFT_binsAverage[i+5])))))) /10); } if (optionGraph == 2) //option mode 2 is calibrate //bucket chain update { y1 = y2; y2 = y3; y3 = y4; y4 = y5; y5 = y6; y6 = (int)( displayGain *((5 * noiseFloor) + (20.0 * Math.log10(corrFactor[i+5] ))) /10); //normalizing spectrum for (int b = 0; b <= 421; b++) { corrFactor[b] = ( totalPeakLevel / FFT_peakHold[b]); } } //video filter if(fiterSelector == 1) y = (y1 + y2)/2; if(fiterSelector == 2) y = (y1 + y2 + y3)/3; if(fiterSelector == 3) y = (y1 + y2 + y3 + y4)/4; if(fiterSelector == 4) y = (y1 + y2 + y3 + y4 + y5)/5; if(fiterSelector == 5) y = (y1 + y2 + y3 + y4 + y5 + y6)/6; if (FFT_peakHold[i] < SA_DSP.FFT_binsAverage[i]* SA_DSP.FFT_binsAverage[i]) //gettinmg peak reading { //if(corrFactor[i]== 0) //corrFactor[i] = 1; if (optionMode == 0) //option mode 0 is normal { y_decayCount[i] = 0; //FFT_peakHold[i] = SA_DSP.FFT_binsAverage[i]* SA_DSP.FFT_binsAverage[i]; //y_peakHold[i] = (int)(((displayGain *((5 * noiseFloor) + (20.0 * Math.log10(FFT_peakHold[i]))))) /10); } else { y_decayCount[i] = 0; FFT_peakHold[i] = (SA_DSP.FFT_binsAverage[i]* SA_DSP.FFT_binsAverage[i] + SA_DSP.FFT_binsAverage[i+1]* SA_DSP.FFT_binsAverage[i+1])/2; y_peakHold[i] = (int)(((displayGain *((5 * noiseFloor) + (20.0 * Math.log10(FFT_peakHold[i] * corrFactor[i]))))) /10); if (optionGraph != 2) //do not do this when calibrating y_peakHold[i] = (y_peakHold[i] + y_peakHold[i+1])/2; } } if (i < 420) { gfx.setColor(Color.BLUE); //shutter if (i >= FFT_binLowpass) gfx.setColor(Color.darkGray); //filterbox if(i >= FFT_binHighpass) gfx.setColor(Color.blue); //gfx.setColor(Color.BLUE); //shutter if (type.equals ("line")) gfx.drawLine (i+1,0,i+1, 235); if (type.equals ("bar")) gfx.drawLine (i+1,0,i+1, 235 - preY); } //Filterbox gfx.setColor(Color.orange); // gfx.fillRect(FFT_binLowpass, 1, FFT_binHighpass - FFT_binLowpass, 234); gfx.drawLine (FFT_binLowpass , 0,FFT_binLowpass, 235); //filter line gfx.drawLine (FFT_binHighpass , 0,FFT_binHighpass, 235); //filter line //Marker line // if (yGrid != 0) Point p = MouseInfo.getPointerInfo().getLocation(); //get mouse coordinates Point loc = screenSwitch.getLocationOnScreen(); Point offsetPoint = new Point(p.x- loc.x, p.y-loc.y); int x2 = offsetPoint.x; mouseXpos = x2; int yspot = offsetPoint.y; //SA_test.setText(Integer.toString(x)+ "," + Integer.toString(y)); if ( x2 < 0) x2 = 0; //restraint if ( x2 > 420) x2 = 420; //restraint gfx.setColor(Color.red); if (x2 > 0) { if (x2 < 420) { if (yspot > 0) { if (yspot < 243) { if(mousePressed == true) { gfx.setColor(Color.red); gfx.drawLine ( x2, 0, x2 , 235); //center line gfx.drawString("Marker at: "+ (String.format("%.3f",((( x2 ) * FFT_step)/1000))) +" kHz", 30, 35); gfx.drawString("Delta Freq.: "+ (String.format("%.3f",(((( x2 - FFT_binBFO) ) * FFT_step )/1000) )) +" kHz", 30, 46); gfx.drawString("RX Freq.: " + (String.format("%.3f",((CAT_Frequency + ( (x2 - FFT_binBFO) * FFT_step )) / 1000)))+ " kHz", 30, 59); gfx.drawString("Level: " + (String.format("%.1f", markerLevel)) + "dB S/N: " + (String.format("%.1f",levelSN)) + " dB", 30, 71); } } else { if( yGrid != 0) { gfx.setColor(Color.red); gfx.drawLine (FFT_binBFO + yGrid, 0, FFT_binBFO + yGrid, 235); //center line gfx.drawString("Marker at: "+ (String.format("%.3f",(((FFT_binBFO + yGrid) * FFT_step)/1000))) +" kHz", 30, 35); gfx.drawString("Delta Freq.: "+ (String.format("%.3f",((yGrid * FFT_step )/1000) )) +" kHz", 30, 46); gfx.drawString("RX Freq.: " + (String.format("%.3f",((CAT_Frequency + (yGrid * FFT_step )) / 1000)))+ " kHz", 30, 59); gfx.drawString("Level: " + (String.format("%.1f", markerLevel)) + "dB S/N: " + (String.format("%.1f",levelSN)) + " dB", 30, 71); } } } } } gfx.setColor(Color.black); //frame gfx.drawLine (0, 0, 0, 235); gfx.drawLine (0, 235, 418, 235); gfx.drawLine (418, 235, 418, 0); gfx.drawLine (418, 0, 0, 0); gfx.setColor(Color.LIGHT_GRAY); //grid horiz gfx.drawLine (418, 24, 0, 24); gfx.drawLine (418, 48, 0, 48); gfx.drawLine (418, 72, 0, 72); gfx.drawLine (418, 96, 0, 96); gfx.drawLine (418, 120, 0, 120); gfx.drawLine (418, 144, 0, 144); gfx.drawLine (418, 168, 0, 168); gfx.drawLine (418, 192, 0, 192); gfx.drawLine (418, 216, 0, 216); //BFO Line + Grid vertical gfx.setColor(Color.red); //BFo line gfx.drawLine (FFT_binBFO , 0,FFT_binBFO, 235); //center line gfx.setColor(Color.GRAY); gfx.drawLine (300 + FFT_binBFO, 0, 300 + FFT_binBFO, 235); //14k line gfx.drawLine (256 + FFT_binBFO, 0, 256 + FFT_binBFO, 235); //12k line gfx.drawLine (213 + FFT_binBFO, 0, 213 + FFT_binBFO, 235); //10k line gfx.drawLine (170 + FFT_binBFO, 0, 170 + FFT_binBFO, 235); //8k line gfx.drawLine (128 + FFT_binBFO, 0, 128 + FFT_binBFO, 235); //6k line gfx.drawLine (85 + FFT_binBFO, 0, 85 + FFT_binBFO, 235); //4k line gfx.drawLine (42 + FFT_binBFO, 0, 42 + FFT_binBFO, 235); //2k line gfx.drawLine (-43 + FFT_binBFO, 0, -43 + FFT_binBFO, 235); //-2k line gfx.drawLine (-86 + FFT_binBFO, 0, -86 + FFT_binBFO, 235); //-4k line gfx.drawLine (-128 + FFT_binBFO, 0, -128 + FFT_binBFO, 235); //-6k line gfx.drawLine (-171 + FFT_binBFO, 0, -171 + FFT_binBFO, 235); //-8k line gfx.drawLine (-214 + FFT_binBFO, 0, -214 + FFT_binBFO, 235); //-10k line gfx.drawLine (-257 + FFT_binBFO, 0, -257 + FFT_binBFO, 235); //-12k line gfx.drawLine (-300 + FFT_binBFO, 0, -300 + FFT_binBFO, 235); //-14k line gfx.setColor(Color.red); if(SA_DSP.SIZE_LOG_2 == 10) gfx.drawString("2kHz/div", 360, 230); if(SA_DSP.SIZE_LOG_2 == 11) gfx.drawString("1kHz/div", 360, 230); if(SA_DSP.SIZE_LOG_2 == 12) gfx.drawString("500Hz/div", 360, 230); try { gfx.drawString((String.format("%.1f", ((1 / displayGain) * 100)) + "dB/div"), 360, 214); } catch (Exception e) { } if (optionMode == 0) //option mode 0 is normal { FFT_peakHold[i] = 0; //reset peakhold y_decayCount[i] = 0; } if (optionMode == 1) //option mode 1 is peakhold { gfx.setColor(Color.white); gfx.fillRect((i) , 240 - y_peakHold[i], 6, 4); y_decayCount[i] = 0; } if (optionMode == 2) //option mode 2 is decay { if (type.equals ("line")) { //if ((y_peakHold[i] + y_decayCount[i] ) > displayGain) //move decay bar up { gfx.setColor(Color.YELLOW); gfx.drawLine ((i),240 - (preYdec), (i + 1) , 240 -(y_peakHold[i] + y_decayCount[i]) ); //gfx.fillRect((i) , 220 - (y_peakHold[i] + y_decayCount[i] ), 4, 2); y_decayCount[i] = (y_decayCount[i] - 1) / (refreshRate + 1); preYdec = y_peakHold[i] + y_decayCount[i]; } } if (type.equals ("bar")) { //draw spectrum - spectral bars gfx.setColor(Color.YELLOW); gfx.drawLine ((i),240, (i) , 240 - y_peakHold[i]); //y_decayCount[i] = y_decayCount[i] + 1; //preYdec = y_peakHold[i] + y_decayCount[i]; } if (y < y_peakHold[i]) { //[i] = FFT_peakHold[i] - 1; //y_peakHold[i] = y_peakHold[i] + 5; FFT_peakHold[i] = SA_DSP.FFT_binsAverage[i]* SA_DSP.FFT_binsAverage[i] * 50 / refreshRate; y_decayCount[i] = y_decayCount[i] + 1; } } if (type.equals ("bar")) { //draw spectrum - spectral bars //if (y > 5) if(binEdit == i) //set binEdit bar red gfx.setColor(Color.RED); else gfx.setColor(Color.green); gfx.drawLine ((i),240, (i) , 240 - y); preY = y; } if (type.equals ("line")) { //draw spectrum - spectral line if (i > 1) //aviod array err { gfx.setColor(Color.green); gfx.drawLine ((i),240 - (preY), (i + 1) , 240 - (y)); preY = y; } } try { Thread.sleep(refreshTime); } catch (InterruptedException e) { } } catch (NullPointerException e) { //System.out.println ("fault"); } try { Thread.sleep(0); } catch (InterruptedException e) { } } while ( selIndexDisplayValue == 0) ; //escape condition } //} //end if }; int x = 0; Set threadSet = Thread.getAllStackTraces().keySet(); for ( Thread propGraph1 : threadSet){ x = x +1; if ( rT.getThreadGroup() == Thread.currentThread().getThreadGroup()){ //A_listServices.setSelectedIndex(1); //if (SA_listServices.getSelectedItem() != ("")) //SA_listServices.remove(1); //SA_listServices.upDate("PHP",2); Date date= new Date(); if (x == 1 ) //only show one instance SA_listServices.insertItemAt(date.getTime()+" Realtime: "+rT+":"+"state:"+rT.getState(),1); //System.out.println(x+" Realtime: "+realTimeSA+":"+" state: "+realTimeSA.getState()); } } rT.start(); //spectrumDisplay(); }; public static void dominantFrequency() { Thread dominantFrequency = new Thread() { // @Override public void run() { double maxBin = 0; double[] maxBinAverage = new double[11]; do { for (int i = 0; i <= 420; i++) try { if(SA_DSP.SIZE_LOG_2 == 10) FFT_step =46.72897196; if(SA_DSP.SIZE_LOG_2 == 11) FFT_step =23.36448598; if(SA_DSP.SIZE_LOG_2 == 12) FFT_step =11.68224299; // if (SA_peakHoldOnOff.getSelectedItem().equals ("Peakhold")) { //SA_mode.setEnabled(true); //SA_mode.setSelectedItem("normal"); } // measure average noise level //if (DF_noiseLoading == 0.0 ) { for (int b = 0; b <= 420; b++) { DF_noiseLoading = DF_noiseLoading + ((SA_DSP.FFT_binsAverage[b])); } DF_noiseLoading = DF_noiseLoading / 420; if (i == 420) SA_averageNoiseValue.setText((String.format("%.1f",(20.0 * Math.log10(DF_noiseLoading))))); //b = 0; } //issue //binValue = SA_DSP.FFT_binsAverage[i] * SA_DSP.FFT_binsAverage[i]; //put current FTT value into maxBin if (DF_noiseLoading * 10 < (SA_DSP.FFT_bins[i] )) //compare maxBin with next value - if smaller replace { dominantBin = i; maxBin = (SA_DSP.FFT_bins[i]); } if (i == 420) //at the end of the array display findings { if (DF_noiseLoading <= maxBin ) { //for (int c = 0; c < 4; c++) //smooth out the values //{ //maxBinAverage[c] = maxBin; //maxBin = (maxBinAverage[c] + maxBinAverage[c+1] + maxBinAverage[c+2] + maxBinAverage[c+3]) / 4 ; //} //SA_dominantBin.setText((Integer.toString(dominantBin))); SA_dominantFrequencyLevel.setText((String.format("%.1f",(20.0 * Math.log10(maxBin))))); if (CAT_Frequency == 0) //true when MDSR is off - display audio bin frequency otherwise RX frequency SA_dominatFrequencyValue.setText((String.format("%.3f",FFT_step * dominantBin / 1000))); //bin into frequency [kHz] else SA_dominatFrequencyValue.setText((String.format("%.3f",(CAT_Frequency - (FFT_step * (FFT_binBFO - dominantBin))) / 1000 ))); //bin into frequency [kHz] //SA_dominantFrequencyLevel.setText(Double.toString((SA_DSP.FFT_binsAverage[214] * SA_DSP.FFT_binsAverage[214]))); } else { SA_dominatFrequencyValue.setText("na"); //SA_dominatFrequencyValue.setText("na"); } } try { Thread.sleep(2); } catch (InterruptedException e) { JOptionPane.showMessageDialog(null,"sleep error."); } } catch (NullPointerException e) { JOptionPane.showMessageDialog(null,"null error."); } try { //SA_Display d = new SA_Display(); //allows to call nonstatic connectFldigi if (dataSelector.getSelectedItem().equals("flrig")) { connectFldigiRead(); //System.out.println(dataSelector.getSelectedItem()); } else readMDSR(); } catch (Throwable t) { //JOptionPane.showMessageDialog(null,"read MDSR"); } try { updateCorrectionValues(); } catch (Throwable t) { JOptionPane.showMessageDialog(null,"update correction values"); } //calculate level for marker if (yGrid != 0) if(FFT_binBFO + yGrid < 420) //aviod arrey error if(FFT_binBFO + yGrid > 0) //aviod arrey error { markerLevel = 20.0 * (Math.log10(SA_DSP.FFT_binsAverage[FFT_binBFO + yGrid])); //corr needs morre work - (Math.log10(corrFactor[FFT_binBFO + yGrid])))); levelSN = markerLevel - (20.0 * Math.log10(DF_noiseLoading)); //calculating S/N if (levelSN < 0) levelSN = 0.0; } if (mousePressed == true) if(mouseXpos < 420) //aviod arrey error if(mouseXpos > 0) //aviod arrey error { markerLevel = 20.0 * (Math.log10(SA_DSP.FFT_binsAverage[mouseXpos])); //needs more work - (Math.log10(corrFactor[FFT_binBFO + yGrid])))); levelSN = markerLevel - (20.0 * Math.log10(DF_noiseLoading)); if (levelSN < 0) levelSN = 0.0; } //SA_test.setText (Integer.toString ( mouseXpos)); //( x2 - FFT_binBFO) ) try { Thread.sleep(100 + refreshRate); } catch (InterruptedException e) { } } while ( RealtimeEnable == 1) ; //escape condition } }; dominantFrequency.start(); //updateScrollingFrequency(); //spectrumDisplay(); }; public void peakHoldtoCalibration() { for (int b = 1; b <= 420; b++) { if (FFT_peakHold[b] > FFT_peakHold[b -1]) totalPeakLevel = FFT_peakHold[b]; } //averagePeakLevel = totalPeakLevel / 420; //SA_maxPeakValue.setText(Double.toString((int)(20.0 * Math.log10(totalPeakLevel)))); //if (FFT_peakHold[b] > SA_DSP.FFT_binsAverage[b]* SA_DSP.FFT_binsAverage[b]) //y_decayCount[b] = y_decayCount[b] + 1; } public static void refreshRate() { /**Future implementation of time measurement in nS * For example, to measure how long some code takes to execute: long startTime = System.nanoTime(); // ... the code being measured ... long estimatedTime = System.nanoTime() - startTime; To compare two nanoTime values long t0 = System.nanoTime(); ... long t1 = System.nanoTime(); one should use t1 - t0 < 0, not t1 < t0, because of the possibility of numerical overflow. **/ Thread refreshRate = new Thread() { // @Override public void run() { do { if (refreshCount <= 1000000) refreshCount++; { //SA_time.setText(Integer.toString(refreshRate)); //i = 0; } try { Thread.sleep(1); } catch (InterruptedException e) { } } while ( ( 1000) > 10) ; //escape condition } }; refreshRate.start(); //spectrumDisplay(); }; public static void saveSettings() { try { BufferedWriter out = new BufferedWriter(new FileWriter((System.getProperty("user.home"))+ "/MDSR_SA/SA_config.cfg")); out.write (Integer.toString (SA_displayGain.getValue ())); out.newLine(); out.write (Integer.toString (SA_displayLevel.getValue ())); //out.write ("test"); out.newLine(); if (SA_bandwidthSelector.getSelectedItem().equals ("20kHz")) out.write ( "20kHz"); if (SA_bandwidthSelector.getSelectedItem().equals ("10kHz")) out.write ( "10kHz"); if (SA_bandwidthSelector.getSelectedItem().equals ("5kHz")) out.write ( "5kHz"); out.newLine(); if (SA_videoFilterSelector.getSelectedItem().equals ("1")) out.write ( "1"); if (SA_videoFilterSelector.getSelectedItem().equals ("2")) out.write ( "2"); if (SA_videoFilterSelector.getSelectedItem().equals ("3")) out.write ( "3"); if (SA_videoFilterSelector.getSelectedItem().equals ("4")) out.write ( "4"); if (SA_videoFilterSelector.getSelectedItem().equals ("5")) out.write ( "5"); out.newLine(); if (SA_optionMode.getSelectedItem().equals ("Peakhold")) out.write ( "Peakhold"); if (SA_optionMode.getSelectedItem().equals ("Normal")) out.write ( "Normal"); if (SA_optionMode.getSelectedItem().equals ("Decay")) out.write ( "Decay"); out.newLine(); if (SA_graphFunction.getSelectedItem().equals ("line")) out.write ( "line"); if (SA_graphFunction.getSelectedItem().equals ("bar")) out.write ( "bar"); out.newLine(); out.write (String.valueOf(SA_yGrid.getValue())); out.newLine(); if (SA_refreshTime.getSelectedItem().equals ("0")) out.write ( "0"); if (SA_refreshTime.getSelectedItem().equals ("1")) out.write ( "1"); if (SA_refreshTime.getSelectedItem().equals ("2")) out.write ( "2"); if (SA_refreshTime.getSelectedItem().equals ("3")) out.write ( "3"); if (SA_refreshTime.getSelectedItem().equals ("4")) out.write ( "4"); if (SA_refreshTime.getSelectedItem().equals ("5")) out.write ( "5"); out.newLine(); if (SA_inputSelector.getSelectedItem().equals ("both")) out.write ( "both"); if (SA_inputSelector.getSelectedItem().equals ("left")) out.write ( "left"); if (SA_inputSelector.getSelectedItem().equals ("right")) out.write ( "right"); out.newLine(); if (SA_correctionCurveCurrent.getText().equals ("160")) out.write ( "160"); if (SA_correctionCurveCurrent.getText().equals ("80")) out.write ( "80"); if (SA_correctionCurveCurrent.getText().equals ("60")) out.write ( "60"); if (SA_correctionCurveCurrent.getText().equals ("40")) out.write ( "40"); if (SA_correctionCurveCurrent.getText().equals ("30")) out.write ( "30"); if (SA_correctionCurveCurrent.getText().equals ("20")) out.write ( "20"); if (SA_correctionCurveCurrent.getText().equals ("17")) out.write ( "17"); if (SA_correctionCurveCurrent.getText().equals ("15")) out.write ( "15"); if (SA_correctionCurveCurrent.getText().equals ("12")) out.write ( "12"); if (SA_correctionCurveCurrent.getText().equals ("10")) out.write ( "10"); if (SA_correctionCurveCurrent.getText().equals ("6")) out.write ( "6"); out.newLine(); if (updateCalibration.getSelectedItem().equals ("Auto")) out.write ( "Auto"); if (updateCalibration.getSelectedItem().equals ("Man")) out.write ( "Man"); out.newLine(); out.write (Integer.toString (propAmpValue)); out.newLine(); out.write (String.valueOf (propThreshold.getValue())); //out.write (String.valueOf ((int)propThreshold.getValue())); out.newLine(); if (dataSelector.getSelectedItem().equals ("MDSR")) out.write ( "MDSR"); if (dataSelector.getSelectedItem().equals ("flrig")) out.write ( "flrig"); out.newLine(); if (dataSelector.getSelectedItem().equals ("flrig")) out.write (corretionFreq.getText()); out.newLine(); out.write (Integer.toString(sliderValue)); out.close(); } catch (IOException e) { JOptionPane.showMessageDialog(null,"Can not find the home directory MDSR_SA or its contents."); } return ; } public static void loadSettings() { try { // checking for file size to prevent half images - part one Get size of current image File file = new File(System.getProperty("user.home") + "/MDSR_SA/SA_config.cfg"); double bytesPre = file.length(); if (file.length() == 0) // checking if file is empty { JOptionPane.showMessageDialog(null,"Configuration file empty or corrupt! " + "Restore from Backup! " + "" + System.getProperty("user.home") + "/MDSR_SA"); loadUserParametersBU(); } else { FileReader fr = new FileReader (System.getProperty("user.home")+ "/MDSR_SA/SA_config.cfg"); BufferedReader textReader = new BufferedReader(fr); int numberOfLines = 18; String[] textData = new String [numberOfLines]; int i; for (i=0; i < numberOfLines; i++) { if (i == 1) { SA_displayGain.setValue(Integer.parseInt(textReader.readLine())); } if (i == 2) { SA_displayLevel.setValue(Integer.parseInt(textReader.readLine())); } if (i == 3) { SA_bandwidthSelector.setSelectedItem(textReader.readLine()); } if (i == 4) { SA_videoFilterSelector.setSelectedItem(textReader.readLine()); } if (i == 5) { SA_optionMode.setSelectedItem(textReader.readLine()); } if (i == 6) { SA_graphFunction.setSelectedItem(textReader.readLine()); } if (i == 7) { SA_yGrid.setValue(Integer.parseInt(textReader.readLine())); } if (i == 8) { SA_refreshTime.setSelectedItem(textReader.readLine()); } if (i == 9) { SA_inputSelector.setSelectedItem(textReader.readLine()); } if (i == 10) { //SA_recallCorrectionCurve.setSelectedItem(textReader.readLine()); SA_correctionCurveCurrent.setText(textReader.readLine()); } if (i == 11) { updateCalibration.setSelectedItem(textReader.readLine()); } if (i == 12) { propAmp.setValue(Integer.parseInt(textReader.readLine())); } if (i == 13) { //propThreshold.setValue((int)(Integer.parseInt(textReader.readLine()))); propThreshold.setValue(Integer.parseInt(textReader.readLine())); } if (i == 14) { dataSelector.setSelectedItem(textReader.readLine()); } if (i == 15) { corretionFreq.setText(textReader.readLine()); //for fldigi only FFT_binBFO = (int)((Integer.parseInt(corretionFreq.getText()) + 12000) / FFT_step ); corretionFreq_frig = (Integer.parseInt(corretionFreq.getText())); } if (i == 16) { sliderValue = (Integer.parseInt(textReader.readLine())); System.out.println(sliderValue); } } }//close else } catch (IOException e) { JOptionPane.showMessageDialog(null,"No user file found! " + "Restore from Backup! " + "" + System.getProperty("user.home") + "/MDSR_SA"); loadSettingsBU(); return ; } loadCalibration(); } public static void loadSettingsBU() { try { FileReader fr = new FileReader (System.getProperty("user.home")+ "/MDSR_SA/upLoad/SA_config.cfg"); BufferedReader textReader = new BufferedReader(fr); int numberOfLines = 18; String[] textData = new String [numberOfLines]; int i; for (i=0; i < numberOfLines; i++) { if (i == 1) { SA_displayGain.setValue(Integer.parseInt(textReader.readLine())); } if (i == 2) { SA_displayLevel.setValue(Integer.parseInt(textReader.readLine())); } if (i == 3) { SA_bandwidthSelector.setSelectedItem(textReader.readLine()); } if (i == 4) { SA_videoFilterSelector.setSelectedItem(textReader.readLine()); } if (i == 5) { SA_optionMode.setSelectedItem(textReader.readLine()); } if (i == 6) { SA_graphFunction.setSelectedItem(textReader.readLine()); } if (i == 7) { SA_yGrid.setValue(Integer.parseInt(textReader.readLine())); } if (i == 8) { SA_refreshTime.setSelectedItem(textReader.readLine()); } if (i == 9) { SA_inputSelector.setSelectedItem(textReader.readLine()); } if (i == 10) { //SA_recallCorrectionCurve.setSelectedItem(textReader.readLine()); SA_correctionCurveCurrent.setText(textReader.readLine()); } if (i == 11) { updateCalibration.setSelectedItem(textReader.readLine()); } if (i == 12) { propAmp.setValue(Integer.parseInt(textReader.readLine())); } if (i == 13) { //propThreshold.setValue((int)(Integer.parseInt(textReader.readLine()))); propThreshold.setValue(Integer.parseInt(textReader.readLine())); } if (i == 14) { dataSelector.setSelectedItem(textReader.readLine()); } if (i == 15) { corretionFreq.setText(textReader.readLine()); //for fldigi only FFT_binBFO = (int)((Integer.parseInt(corretionFreq.getText()) + 12000) / FFT_step ); corretionFreq_frig = (Integer.parseInt(corretionFreq.getText())); } if (i == 16) { sliderValue = (Integer.parseInt(textReader.readLine())); System.out.println(sliderValue); } } } catch (IOException e) { JOptionPane.showMessageDialog(null,"No configuration file found! " + "The MDSR SA will start with default setting! " + "" + System.getProperty("user.home") + "/MDSR_SA"); return ; } loadCalibration(); } public static void loadCalibration() { try { FileReader fr = new FileReader (System.getProperty("user.home") + "/MDSR_SA/Spec"+ (SA_correctionCurveCurrent.getText() + ".cal")); BufferedReader textReader = new BufferedReader(fr); int numberOfLines = 421; String[] textData = new String [numberOfLines]; int i; for (i=0; i < numberOfLines; i++) { { //(String.format("%.20f",corrFactor[b]) corrFactor[i] = (Double.parseDouble (textReader.readLine())); } } } catch (IOException e) { JOptionPane.showMessageDialog(null,"No calibration file for " + (SA_correctionCurveCurrent.getText()) + "m available. Please create a calibration file first!"); return ; } } public static void readMDSR() { //reads the files that are created from MDSR preCAT_Frequency = CAT_Frequency; preMDSR_status = MDSR_status; int frequencyOffset = 0; int frequencyIF = 0; int displayOffset = 0; double lowpassFrequency = 0; double highpassFrequency = 0; try { FileReader fr = new FileReader (System.getProperty("user.home")+ "/MDSR/STATUSRX.cfg"); //file is updated by MDSR to update frequency and status BufferedReader textReader = new BufferedReader(fr); int numberOfLines = 4; String[] textData = new String [numberOfLines]; int i; for (i=0; i < numberOfLines; i++) { if (i == 1) { CAT_Frequency = Integer.parseInt(textReader.readLine()); } if (i == 2) { //RigState.setText(textReader.readLine()); } if (i == 3) { //SA_bandwidthSelector.setSelectedItem(textReader.readLine()); } } } catch (IOException e) { JOptionPane.showMessageDialog(null,System.getProperty("user.home") + "/MDSR/STATUSRX.cfg - file not found! "); return ; } String CAT_FrequencyStr = (Integer.toString(CAT_Frequency)); CAT_FrequencyStr = CAT_FrequencyStr.substring(0, CAT_FrequencyStr.length() - 3) + "." + CAT_FrequencyStr.substring((CAT_FrequencyStr.length() -3), CAT_FrequencyStr.length() ); RigFrequency.setText(CAT_FrequencyStr); try { FileReader fr = new FileReader (System.getProperty("user.home")+ "/MDSR/calibration.cfg"); BufferedReader textReader = new BufferedReader(fr); int numberOfLines = 5; String[] textData = new String [numberOfLines]; int i; for (i=0; i < numberOfLines; i++) { if (i == 1) { frequencyOffset = (Integer.parseInt(textReader.readLine())); } if (i == 2) { frequencyIF = (Integer.parseInt(textReader.readLine())); //placeholder overwitten in next line } if (i == 3) { frequencyIF = (Integer.parseInt(textReader.readLine())); //IF frequency in kHz without correction } if (i == 4) { displayOffset = (Integer.parseInt(textReader.readLine())); } } } catch (IOException e) { JOptionPane.showMessageDialog(null,System.getProperty("user.home") + "No MDSR calibration.cfg file found! "); return ; } corretionFreq.setText(Integer.toString( - frequencyOffset - displayOffset)); realIF_frequency = frequencyIF * 1000 - (frequencyOffset + displayOffset); FFT_binBFO = (int)(realIF_frequency / FFT_step); //bin number of the BFO center //corretionFreq.setText(Integer.toString((int)(realIF_frequency))); try { FileReader fr = new FileReader (System.getProperty("user.home")+ "/MDSR/status.cfg"); BufferedReader textReader = new BufferedReader(fr); int numberOfLines = 11; String[] textData = new String [numberOfLines]; int i; for (i=0; i < numberOfLines; i++) { if (i == 1) { RigMode.setText(textReader.readLine()); } if (i == 2) { //filterpassHigh.setText(textReader.readLine()); highpassFrequency = (Double.parseDouble(textReader.readLine())); } if (i == 3) { //filterpassLow.setText(textReader.readLine()); lowpassFrequency = (Double.parseDouble(textReader.readLine())); } } } catch (IOException f) { JOptionPane.showMessageDialog(null,System.getProperty("user.home") + "No MDSR status.cfg file found! "); return ; } FFT_binLowpass = (int)((lowpassFrequency -( frequencyOffset + displayOffset) )/ FFT_step); //bin number of the BFO center FFT_binHighpass = (int)((highpassFrequency - ( frequencyOffset + displayOffset))/ FFT_step); //bin number of the BFO center //RigState.setText(filterpassHigh.getText()); //filterpassLow.setText filterpassHigh.setText(Double.toString(highpassFrequency)); filterpassLow.setText(Double.toString(lowpassFrequency)); updateScrollingFrequency(); try { FileReader fr = new FileReader (System.getProperty("user.home")+ "/MDSR/transmitter.cfg"); BufferedReader textReader = new BufferedReader(fr); int numberOfLines = 11; String[] textData = new String [numberOfLines]; int i; for (i=0; i < numberOfLines; i++) { if (i == 1) { MDSR_status = (textReader.readLine()); } if (i == 2) { //filterpassHigh.setText(textReader.readLine()); //highpassFrequency = (Double.parseDouble(textReader.readLine())); } if (i == 3) { //filterpassLow.setText(textReader.readLine()); //lowpassFrequency = (Double.parseDouble(textReader.readLine())); } } } catch (IOException f) { JOptionPane.showMessageDialog(null,"No MDSR transmitter.cfg file found! "); return ; } if(!preMDSR_status.equals (MDSR_status)) { //System.out.println("NOW" + MDSR_status); if(MDSR_status.equals ("on")) { preOptionMode = optionMode; //System.out.println("PRE" + preOptionMode); RigState.setText("TX"); SA_equalizerMode.setSelectedItem("normal"); optionGraph = 0; resetAudioEngine(); //reset audio processor //spectrum not corrected //optionMode = 2; //option mode 1 is peakhold //SA_optionMode.setSelectedItem("Normal"); //loadCalibration(); } if(MDSR_status.equals ("off")) { RigState.setText("RX"); SA_equalizerMode.setSelectedItem("corrected"); //loadCalibration(); optionGraph = 1; //spectrum corrected optionMode = preOptionMode; //option mode 2 is decay if (optionMode == 0) SA_optionMode.setSelectedItem("Normal"); if (optionMode == 1) SA_optionMode.setSelectedItem("Peakhold"); if (optionMode == 2) SA_optionMode.setSelectedItem("Decay"); } } } public static void updateCorrectionValues() //set calibration curve automatically { if (CAT_Frequency > 1800000) //do not run when MDSR is below 1800 or not running { //System.out.println(CAT_Frequency); if (CAT_Frequency != preCAT_Frequency) //only run when frequency changes { if ((updateCalibration.getSelectedItem()).equals ("Auto")) //only run when "Auto" is selected { int[] bandedges = {3000,5000,6000,9000,12000,15000,20000,23000,27000,50000,54000}; //bandedges in kHz //int i = 0; lower bandeges disabled: 0,100,600,1800 to sync the display String[] bands = {"160","80","60","40","30","20","17","15","12","10","6"}; for(int i = 0; i < 13; i++) { if(bandedges[i] > (CAT_Frequency /1000)) { SA_correctionCurveCurrent.setText(bands[i]); //System.out.println(bandedges[i]+","+i); //System.out.println(Integer.toString(CAT_Frequency)+",Pre"+preCAT_Frequency); //if (i < 2) //i=2; //prevent neg index //SA_recallCorrectionCurve.setSelectedItem(bands[i]); i=14; //break; } } } } } } public static void updateScrollingFrequency() { if (CAT_Frequency != preCAT_Frequency) //only run when frequency changes { int tabDistance = 14; //to compensate for differnt number lenght if(CAT_Frequency > 1000000) tabDistance = 15; if(CAT_Frequency > 10000000) tabDistance = 17; if(CAT_Frequency > 100000000) tabDistance = 19; double frequencyMHz = CAT_Frequency; frequencyMHz = frequencyMHz/ 1000000; //MHz int differencCorrectionByFFT_step = 0; double differenceCorrection; //to correct the marquee value to center frequency double frequencykHz = CAT_Frequency; frequencykHz = frequencykHz/ 1000; //kHz differenceCorrection = CAT_Frequency - (((int)frequencykHz )* 1000); //calculate difference differencCorrectionByFFT_step = (int) (differenceCorrection / FFT_step); //calcualte difference in FFT steps (pixels) { if(differenceCorrection >= 500) frequencyMHz = (frequencyMHz - 0.001); //MHz } //System.out.println(frequencyMHz); Graphics gfx = frequencyMarquee.getGraphics(); gfx.setColor(Color.GRAY); //shutter gfx.fillRect(0,1,420,18); gfx.setColor(Color.red); // red center mark for BFO gfx.drawLine (FFT_binBFO, 1,FFT_binBFO, 18); //gfx.drawString((String.format("%.3f",((frequency1)))) +"MHz", FFT_binBFO - 25, 12); //gfx.drawString("test", 5, FFT_binBFO); for(int i = 0; i < 450; i = i+21) { gfx.setColor(Color.black); //frame gfx.drawLine (FFT_binBFO - differencCorrectionByFFT_step - i, 12,FFT_binBFO - differencCorrectionByFFT_step - i, 18); //frequency tabs every 1kHz gfx.drawLine (FFT_binBFO - differencCorrectionByFFT_step + i, 12,FFT_binBFO - differencCorrectionByFFT_step + i, 18); gfx.drawLine (FFT_binBFO - differencCorrectionByFFT_step - i/2, 16,FFT_binBFO - differencCorrectionByFFT_step - i/2, 18); //frequency tabs every 500Hz gfx.drawLine (FFT_binBFO - differencCorrectionByFFT_step + i/2, 16,FFT_binBFO - differencCorrectionByFFT_step + i/2, 18); gfx.setColor(Color.green); gfx.drawString((String.format("%.3f",((frequencyMHz + 0.002 * i/21)))), FFT_binBFO - differencCorrectionByFFT_step - tabDistance + 2*i, 10); gfx.drawString((String.format("%.3f",((frequencyMHz - 0.002 * i/21)))), FFT_binBFO - differencCorrectionByFFT_step - tabDistance - 2*i, 10); }//differnt resolutiond are adchived by changing the i divider i/21 is 2kHz, i/42 is 1kHz and i/84 is 500Hz } } public static void resetAudioEngine() { SA_DSP.stopSystem(); //SA_DSP.synth.stop(); try { Thread.sleep(20); // do nothing for 20 miliseconds } catch(InterruptedException e) { e.printStackTrace(); } try { SA_DSP.start(); //SA_DSP.synth.start( SA_DSP.SAMPLE_RATE, AudioDeviceManager.USE_DEFAULT_DEVICE, 2, AudioDeviceManager.USE_DEFAULT_DEVICE, 2 ); } catch (IOException ex) { JOptionPane.showMessageDialog(null,"Error in View file"); } saveSettings(); if((SA_inputSelector.getSelectedItem()).equals ("both")) { SA_DSP.volumeControlLeft.inputA.set( 1.0 ); SA_DSP.volumeControlLeft.inputB.set( 1.0 ); SA_DSP.volumeControlRight.inputA.set( 1.0 ); SA_DSP.volumeControlRight.inputB.set( 1.0 ); } if((SA_inputSelector.getSelectedItem()).equals ("left")) { SA_DSP.volumeControlLeft.inputA.set( 1.0 ); SA_DSP.volumeControlLeft.inputB.set( 1.0 ); SA_DSP.volumeControlRight.inputA.set( 0.0 ); SA_DSP.volumeControlRight.inputB.set( 0.0 ); } if((SA_inputSelector.getSelectedItem()).equals ("right")) { SA_DSP.volumeControlLeft.inputA.set( 0.0 ); SA_DSP.volumeControlLeft.inputB.set( 0.0 ); SA_DSP.volumeControlRight.inputA.set( 1.0 ); SA_DSP.volumeControlRight.inputB.set( 1.0 ); } for (int b = 0; b <= 421; b++) { FFT_peakHold[b] = -100; //reset peakhold array y_decayCount[b] = 0; //reset peakhold array } } public static void presetScanFrequencies(){ try { FileReader fr = new FileReader (System.getProperty("user.home")+ "/MDSR_SA/Scanner.cfg"); BufferedReader textReader = new BufferedReader(fr); int numberOfLines = 7; String[] textData = new String [numberOfLines]; int i; for (i=0; i < numberOfLines; i++) { if (i == 1) { if (CheckBoxFreq1.isSelected()== false) SA_scan1.setText(textReader.readLine()); } if (i == 2) { if (CheckBoxFreq2.isSelected()== false) SA_scan2.setText(textReader.readLine()); } if (i == 3) { if (CheckBoxFreq3.isSelected()== false) SA_scan3.setText(textReader.readLine()); } if (i == 4) { if (CheckBoxFreq4.isSelected()== false) SA_scan4.setText(textReader.readLine()); } if (i == 6) { if (CheckBoxFreq5.isSelected()== false) SA_scan5.setText(textReader.readLine()); } if (i == 6) { if (CheckBoxFreq6.isSelected()== false) SA_scan6.setText(textReader.readLine()); } } } catch (IOException e) { JOptionPane.showMessageDialog(null,"No Scanner frequencies were saved"); return ; } } public void saveDataToCSV(){ try { setCursor(Cursor.WAIT_CURSOR); String path = ""; //create upload folder if not exists File f = new File ((System.getProperty("user.home") + "/MDSR_SA/upLoad/")); if ((f.exists() && f.isDirectory())== (false)) { System.out.println("created missing Directory"); File dir = new File(System.getProperty("user.home") + "/MDSR_SA/upLoad/"); dir.mkdir(); } SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss"); if(netIsAvailableFTP==(true)) //save daily backup file in upload folder if network is down path = "/MDSR_SA/Prop"+ ((sdf.format(new Date())) + ".csv"); if(netIsAvailableFTP==(false)) path = "/MDSR_SA/upLoad/Prop"+ ((sdf.format(new Date())) + ".csv"); BufferedWriter out = new BufferedWriter(new FileWriter(System.getProperty("user.home") + path )); out.write("timestamp,"); //headers out.write(SA_scan1.getText() +","); out.write(SA_scan2.getText() +","); out.write(SA_scan3.getText() +","); out.write(SA_scan4.getText() +","); out.write(SA_scan5.getText() +","); out.write(SA_scan6.getText()); out.newLine(); for (int b = 1; b <= 7000; b++) { out.write((displayTimeMarker[b]) +","); //data out.write(String.format("%.2f",displaySSI_CH1[b] * -1) +","); //has to be negative value out.write(String.format("%.2f",displaySSI_CH2[b] * -1) +","); out.write(String.format("%.2f",displaySSI_CH3[b] * -1) +","); out.write(String.format("%.2f",displaySSI_CH4[b] * -1) +","); out.write(String.format("%.2f",displaySSI_CH5[b] * -1) +","); out.write(String.format("%.2f",displaySSI_CH6[b] * -1) ); out.newLine(); System.out.println("7514 "+displayTimeMarker[b]+","+b); if(displaySSI_CH1[b]== 0) b = 7001; //end data file } out.newLine(); out.write("EOF"); out.close(); //if network is not avilable save file locally into upload folder //put code here } catch (IOException e) { JOptionPane.showMessageDialog(null,"Propagation data file write error"); } setCursor(Cursor.DEFAULT_CURSOR); //resetAudioEngine(); //reset Audio Engine to avoid data overrun //System.out.println("system was Auto restared"); return ; } public void saveDataToTemp(){ try { setCursor(Cursor.WAIT_CURSOR); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss"); //+ ((sdf.format(new Date())) + ".csv")))); BufferedWriter out = new BufferedWriter(new FileWriter((System.getProperty("user.home") + "/MDSR_SA/tempData.bak"))); for (int b = 1; b <= 7000; b++) { out.write((displayTimeMarker[b]) +","); //data out.write(String.format("%.2f",displaySSI_CH1[b] * -1) +","); //has to be negative value out.write(String.format("%.2f",displaySSI_CH2[b] * -1) +","); out.write(String.format("%.2f",displaySSI_CH3[b] * -1) +","); out.write(String.format("%.2f",displaySSI_CH4[b] * -1) +","); out.write(String.format("%.2f",displaySSI_CH5[b] * -1) +","); out.write(String.format("%.2f",displaySSI_CH6[b] * -1) ); out.newLine(); //System.out.println(displayTimeMarker[b]+","+b); if(displaySSI_CH1[b]== 0) b = 7001; //end data file } out.newLine(); out.write("EOF"); out.close(); } catch (IOException e) { JOptionPane.showMessageDialog(null,"Propagation data file write error"); } setCursor(Cursor.DEFAULT_CURSOR); return ; } public void readTempData(){ try { FileReader fr = new FileReader (System.getProperty("user.home")+ "/MDSR_SA/tempData.bak"); BufferedReader textReader = new BufferedReader(fr); String line; int i = 0; int numberOfLines = 1651;//biggest number of lines is 1650 String[] hext_Str = new String [numberOfLines]; for (i=0; i < numberOfLines; i++) { line = textReader.readLine(); try { if ((line) != null) { hext_Str = (line.split(",")); //remove "," and split if (hext_Str[0].equals ("timestamp")) //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; } if (hext_Str[0] != null) { displayTimeMarker[i] = (hext_Str[0]); displaySSI_CH1[i] = -1 * Double.parseDouble (hext_Str[1]); displaySSI_CH2[i] = -1 * Double.parseDouble (hext_Str[2]); displaySSI_CH3[i] = -1 * Double.parseDouble (hext_Str[3]); displaySSI_CH4[i] = -1 * Double.parseDouble (hext_Str[4]); displaySSI_CH5[i] = -1 * Double.parseDouble (hext_Str[5]); displaySSI_CH6[i] = -1 * Double.parseDouble (hext_Str[6]); //System.out.println(hext_Str[0]); if (hext_Str[0].equals ("null")) i = i - 1; //to avoid overshooting the array if (hext_Str[0].equals ("EOF")) i = i - 1; //System.out.println(i +","+displayTimeMarker[i]+","+displaySSI_CH6[i]); //jCount = i;// //jMax = i; mMax = i; mCount = i; displayStart = 0; } } } catch (ArrayIndexOutOfBoundsException e) { } } } catch (IOException e) { //JOptionPane.showMessageDialog(null,"No temp data file available"); return ; } } public void saveImage(){ if (delayImageSave == true) //prevent unfinished redraw try { Thread.sleep(200); } catch (InterruptedException e) { } // checking for file size to prevent half images - part one Get size of current image File file = new File(System.getProperty("user.home") + "/MDSR_SA/RF_Seismo.png"); double bytesPre = file.length(); //if(bytes <= 8000.0) //not usable with a compressed image //saveImage(); //redo image and upload //System.out.println("Last screenshot saved as, kB :"+bytesPre / 1024); 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) { } //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 { Robot robot = new Robot(); String format = "png"; //String fileName = "PartialScreenshot." + format; Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Rectangle captureRect = new Rectangle(x1 + 5,y1 + 7, 423, 244 ); BufferedImage screenFullImage = robot.createScreenCapture(captureRect); try { ImageIO.write(screenFullImage, format, new File(System.getProperty("user.home") + "/MDSR_SA/RF_Seismo.png")); } catch (IOException ex) { ex.printStackTrace(); } } catch (AWTException ex) { JOptionPane.showMessageDialog(null,"Can not create image during monitor power down cycle. Please set monitor to be on at all times."); } // checking for file size to prevent half images - part 2 File filePost = new File(System.getProperty("user.home") + "/MDSR_SA/RF_Seismo.png"); double bytesPost = filePost.length(); //if(bytes <= 8000.0) //not usable with a compressed image //saveImage(); //redo image and upload //System.out.println("Current screenshot saved as, kB :"+bytesPost / 1024); createPropagationHTM(); if (uploadEnabled.isSelected()== true) FTPUploadFiles(); setCursor(Cursor.DEFAULT_CURSOR); /** // checking for file size to prevent half images -not used (used in SSI_dataCollection) File file = new File(System.getProperty("user.home") + "/MDSR_SA/RF_Seismo.png"); double bytes = file.length(); //get file size if(bytes <= 5000.0) saveImage(); System.out.println("A screenshot saved! in B :"+bytes ); /** 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"); } **/ } public static void earthQuakeBackup() { //backup current quake data to the upLoad folder SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); //System.out.println(System.getProperty("user.home") + "/MDSR_SA/upLoad/" + callSign.getText() + sdf.format(new Date())+ "-USGS2.5_day.csv"); File source = new File(System.getProperty("user.home") + "/MDSR_SA/USGS2.5_day.csv"); File target = new File(System.getProperty("user.home") + "/MDSR_SA/upLoad/" + callSign.getText() + sdf.format(new Date())+ "-USGS2.5_day.csv"); //quake BU boolean Rename = source.renameTo(target); File source1 = new File(System.getProperty("user.home") + "/MDSR_SA/tempData.bak"); File target1 = new File(System.getProperty("user.home")+ "/MDSR_SA/upLoad/" + callSign.getText() + sdf.format(new Date())+"tempData.bak"); boolean Rename1 = source1.renameTo(target1); } public static void FTPUploadBackup() { //runs only after midnight once per day netSpeed(); //check for network if(netIsAvailableFTP == (true)) { netAvail.setText("Int"); String server = ftpServer.getText(); String user = ftpUserName.getText(); String pass = ftpPassWord.getText(); int port = 21; int count = 1; 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(600); //ftpClient.setDataTimeout(500); //ftpClient.setConnectTimeout(500); try { if (ftpClient.isConnected()) { //checks if the link is active ftpClient.logout(); ftpClient.disconnect(); ftpActivity.append("forced logout " + sdf.format(new Date())+ "\n"); } ftpClient.connect(server, port); ftpActivity.append(ftpClient.getReplyString()); if (ftpClient.getReplyCode() != 220) //successful connection { ftpClient.disconnect(); //System.err.println("FTP server refused connection."); } if (ftpPassWord.getText().equals("propagation")) //password "propagation is translated to 9904313 pass = "RMXxqQL2"; else pass = (ftpPassWord.getText()); //System.err.println(pass); ftpClient.login(ftpUserName.getText(), pass); ftpActivity.append(ftpClient.getReplyString()); if (ftpClient.getReplyCode() != 230) //successful logon { ftpClient.disconnect(); //System.err.println("FTP server logon connection."); } // Changes working directory ftpClient.changeWorkingDirectory(ftpDirectory.getText()); //ftpActivity.append(ftpClient.printWorkingDirectory()+ "\n"); //ftpActivity.append(ftpClient.getReplyString()); if (ftpClient.getReplyCode() != 250) //directory exists not true { ftpClient.disconnect(); ftpActivity.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/tempData.bak"); String firstRemoteFile = ftpDirectory.getText() + "currentData/" + callSign.getText() + sdf.format(new Date())+"tempData.bak"; //daily backup data //System.out.println(ftpDirectory.getText() + "currentData/" + callSign.getText() + sdf.format(new Date())+"tempData.bak"); 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); ftpActivity.append( sdf.format(new Date()) + " " + callSign.getText() + "tempData BU uploaded" + "\n"); count = count + 1; } //else //FTPUploadBackup(); //System.out.println("RF-Seismo.png failed to upload"); //printJOptionPane.showMessageDialog(null,"RF-Seismo.png failed to upload"); //upload earthquake for the day SeismoViewer.getRemoteEarthQuakeData(); //get the latest data from USGS // APPROACH #2: uploads second file using an OutputStream File localFile = new File(System.getProperty("user.home") + "/MDSR_SA/USGS2.5_day.csv"); String remoteFile = ftpDirectory.getText() + "currentData/" + callSign.getText() + sdf.format(new Date())+ "-USGS2.5_day.csv"; //html file upload InputStream inputStream1 = new FileInputStream(localFile); //select last line of the box String s = ftpActivity.getText(); int pos = s.length(); ftpActivity.setCaretPosition(pos); OutputStream outputStream = ftpClient.storeFileStream(remoteFile); int fileSize = (int)(new File(System.getProperty("user.home") + "/MDSR_SA/USGS2.5_day.csv").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) { ftpActivity.append( sdf.format(new Date()) + " " + callSign.getText() + "USGS fail " + "\n"); incomplete = true; } else ftpActivity.append(sdf.format(new Date()) + " " + callSign.getText() + "USGS uploaded " + "\n"); incomplete = false; ftpActivity.append("211 Connection closed \n"); //ftpClient.logout(); //ftpClient.disconnect(); //System.out.println("logout and disconnect"); } } catch (IOException ex) { //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 failed to upload"); //FTPUploadBackup(); //try again int lines = ftpActivity.getLineCount(); int max = 200; if (lines > max) { ftpActivity.setText(""); //delete FTP textbox when lines reach max - not good code but works ftpActivity.append("auto cleared text...\n" + "\n"); } } else { netAvail.setText("off"); ftpActivity.append("No Server - Data was stored in upLoad \n"); } earthQuakeBackup(); //save file into upLoad folder } public static void FTPUploadFiles() { netSpeed(); //if(netIsAvailable()==(true)) //will check in code below { netAvail.setText("Int"); String server = ""; int port = 21; int count = 1; String user = ""; String pass = ""; SimpleDateFormat sdf = new SimpleDateFormat("HH-mm"); //+ ((sdf.format(new Date())) + ".csv")))); //setCursor(Cursor.WAIT_CURSOR); //can not be used in static void FTPClient ftpClient = new FTPClient(); ftpClient.setDefaultTimeout(700); //ftpClient.setDataTimeout(500); //ftpClient.setConnectTimeout(500); try { if (ftpClient.isConnected()) { //checks if the link is active ftpClient.logout(); ftpClient.disconnect(); ftpActivity.append("forced logout " + sdf.format(new Date())+ "\n"); } ftpClient.connect(ftpServer.getText(), port); ftpActivity.append(ftpClient.getReplyString()); if (ftpClient.getReplyCode() != 220) //successful connection { ftpClient.disconnect(); //System.err.println("FTP server refused connection."); } if (ftpPassWord.getText().equals("propagation")) //password "propagation is translated pass = "RMXxqQL2"; else pass = (ftpPassWord.getText()); //System.err.println(pass); ftpClient.login(ftpUserName.getText(), pass); ftpActivity.append(ftpClient.getReplyString()); if (ftpClient.getReplyCode() != 230) //successful logon { ftpClient.disconnect(); //System.err.println("FTP server logon connection."); } // Changes working directory ftpClient.changeWorkingDirectory(ftpDirectory.getText()); //ftpActivity.append(ftpClient.printWorkingDirectory()+ "\n"); //ftpActivity.append(ftpClient.getReplyString()); if (ftpClient.getReplyCode() != 250) //directory exists { ftpClient.disconnect(); ftpActivity.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_Seismo.png"); String firstRemoteFile = ftpDirectory.getText() + callSign.getText() + "_RF_Seismo.png"; //grafic file upload 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); ftpActivity.append( sdf.format(new Date()) + " " + callSign.getText() + "_RF_Seismo.png uploaded" + "\n"); count = count + 1; } else //if upload fails, store file in upLoads { //JOptionPane.showMessageDialog(null,"File is saved to UupLoads dir // disabled because no popups Path from; Path dest; Path delete; dest = Paths.get((System.getProperty("user.home"))+ "/MDSR_SA/upLoad/RF_Seismo.png"); from = Paths.get((System.getProperty("user.home"))+ "/MDSR_SA/RF_Seismo.png"); delete= Paths.get((System.getProperty("user.home"))+ "/MDSR_SA/upLoad/RF_Seismo.png"); try { if(Files.exists(delete)) Files.delete(delete); Files.copy(from, dest); } catch (IOException ex) { //System.out.println("could not copy file"); Logger.getLogger(SA_Display.class.getName()).log(Level.SEVERE, null, ex); } } //JOptionPane.showMessageDialog(null,"RF-Seismo.png failed to upload"); //FTPUploadFiles();//looping issue during bad connection // APPROACH #2: uploads second file using an OutputStream File localFile = new File(System.getProperty("user.home") + "/MDSR_SA/propList.htm"); String remoteFile = ftpDirectory.getText() + callSign.getText() + "_propList.htm"; //html file upload InputStream inputStream1 = new FileInputStream(localFile); //select last line of the box String s = ftpActivity.getText(); int pos = s.length(); ftpActivity.setCaretPosition(pos); OutputStream outputStream = ftpClient.storeFileStream(remoteFile); int fileSize = (int)(new File(System.getProperty("user.home") + "/MDSR_SA/propList.htm").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) { ftpActivity.append( sdf.format(new Date()) + " " + callSign.getText() + "_propList.htm fail " + "\n"); incomplete = true; } else ftpActivity.append(sdf.format(new Date()) + " " + callSign.getText() + "_propList.htm uploaded " + "\n"); incomplete = false; ftpActivity.append("211 Connection closed \n"); //ftpClient.logout(); //ftpClient.disconnect(); //System.out.println("logout and disconnect"); } } catch (IOException ex) { //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,"propList .htm failed to upload"); //FTPUploadFiles();//issue with looping during slow coneection int lines = ftpActivity.getLineCount(); int max = 200; if (lines > max) { ftpActivity.setText(""); //delete FTP textbox when lines reach max - not good code but works ftpActivity.append("auto cleared text...\n" + "\n"); } /** //code not working - it supposed to check for line length and then delete everything above 200 lines keeping the new entries //int lenghtOfFirstLine = 0; System.err.println(ftpActivity.getLineCount()); if (lines > max) //keep just a bit more than 24h { String[] singleLines = ftpActivity.getText().split("/n"); ftpActivity.setText(""); for (int b = 1; b < ftpActivity.getLineCount() ; b++) { ftpActivity.append(singleLines[b + 1]); } } **/ } //else //netAvail.setText("off"); } public static void FTPdownloadFiles() { //downloads NOAA alerts netSpeed(); if(netIsAvailable()==(true)) { netAvail.setText("Int"); NOAAmessagCompl = false; String server = "ftp.swpc.noaa.gov"; //ftp.swpc.noaa.gov/pub/alerts/current_month.html int port = 21; //int count = 1; String user = "anonymous"; String pass = ""; String remoteFile = "/pub/alerts/current_month.html"; //NOAAMessage.setText("File download started"); FTPClient ftpClient = new FTPClient(); //ftpClient.setDefaultTimeout(400); //usullay on //ftpClient.setDataTimeout(500); //ftpClient.setConnectTimeout(500); try { SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm"); SimpleDateFormat sdfShort = new SimpleDateFormat("HH:mm"); ftpClient.connect(server, port); ftpClient.login(user, pass); ftpClient.enterLocalPassiveMode(); ftpClient.setFileType(FTP.BINARY_FILE_TYPE); String filePath = "/pub/alerts/current_month.html"; //checking file size of the remote file ftpClient.sendCommand("SIZE", filePath); String reply = ftpClient.getReplyString(); reply = (new StringBuilder(reply).deleteCharAt(0).toString()); //remove server command on first 4 chars reply = (new StringBuilder(reply).deleteCharAt(0).toString()); reply = (new StringBuilder(reply).deleteCharAt(0).toString()); reply = (new StringBuilder(reply).deleteCharAt(0).toString()); reply = (new StringBuilder(reply).deleteCharAt(reply.length() - 1 ).toString()); //cleanup junk reply = reply.trim().replaceFirst("^&$ ", ""); //cleanup junk //System.out.println(reply); remoteFileSize = (Integer.parseInt(reply)); //remoteFileSize = (Integer.parseInt(NOAAMessage.getText())); //system.out.println(remoteFileSize); //NOAAMessage.setText("Checking remote file: " + remoteFileSize + "Bytes"); try { File file = new File(System.getProperty("user.home") + "/MDSR_SA/NOAA_Alert.txt"); //checking file size of the local file localFileSize = (int)(file.length()); } catch (Exception e) { JOptionPane.showMessageDialog(null,"Can not get or locate NOAA_Alert.txt - file missing"); } //NOAAMessage.setText(reply +(Integer.toString(localFileSize))); if (NOAAalertsText.getText().equals("")) //if message box is empty { downloadNOAA_Message(); // at startup } if(localFileSize == remoteFileSize) //when files are the same no update NOAAMessage.setText("No updates at:" + sdf.format(new Date())); if(localFileSize < remoteFileSize) //New Alert condition -check to make sure it does only downloads when new file is available (new != size of local and remote file { NOAAalertsText.setText(""); // clear main messge field NOAAMessage.setText("NOAA Alert at: "+ sdf.format(new Date())); alertTime.setText("Set:" + sdfShort.format(new Date())); processAlarmOffTime(); downloadNOAA_Message(); //getlastest report from NOAA //System.out.println(localFileSize +" " + reply); } else //in case there was no alert { if(NOAAAlertBanner.getText().equals ("")) { NOAAMessage.setText("No updates at:" + sdf.format(new Date())); alertTime.setText("n/a"); //negative message does not override manual alert } //else //NOAAMessage.setText("No updates at:" + sdf.format(new Date())); } /** if(localFileSize < remoteFileSize) //if new file issued is different than the old file alert and download { NOAAMessage.setText("NOAA Alert: "+ sdf.format(new Date())); downloadNOAA_Message(); //getlastest report from NOAA //downloadNOAA_Message(); alertTime.setText("Set:" + sdfShort.format(new Date())); processAlarmOffTime(); } else //in case there was no alert { if(NOAAAlertBanner.getText().equals ("")) { NOAAMessage.setText("No updates at:" + sdf.format(new Date())); alertTime.setText("n/ao"); //negative message does not override manual alert } // else // NOAAMessage.setText("No updates at:" + sdf.format(new Date())); } **/ } catch (IOException ex) { ex.printStackTrace(); } } else { netAvail.setText("off"); //JOptionPane.showMessageDialog(null,"No Internet"); } } public static void downloadNOAA_Message(){ netSpeed(); if(netIsAvailable()==(true)) { netAvail.setText("Int"); String server = "ftp.swpc.noaa.gov"; //ftp.swpc.noaa.gov/pub/alerts/current_month.html int port = 21; //int count = 1; String user = "anonymous"; String pass = ""; String remoteFile = "/pub/alerts/current_month.html"; String line = ""; //make sure old data is purged String messageFirstPart = ""; //NOAAmessagCompl =false;//starts the alert message trap //NOAAalertsText.setText(""); FTPClient ftpClient = new FTPClient(); ftpClient.setDefaultTimeout(1200); //ftpClient.setDataTimeout(500); //ftpClient.setConnectTimeout(500); try { ftpClient.connect(server, port); ftpClient.login(user, pass); ftpClient.enterLocalPassiveMode(); ftpClient.setFileType(FTP.BINARY_FILE_TYPE); Files.deleteIfExists(Paths.get(System.getProperty("user.home") +("/MDSR_SA/NOAA_Alert.txt"))); File downloadFile = new File(System.getProperty("user.home") + "/MDSR_SA/NOAA_Alert.txt"); OutputStream outputStream = new BufferedOutputStream(new FileOutputStream(downloadFile)); boolean success = ftpClient.retrieveFile(remoteFile, outputStream); //NOAAalertsText.setText(FileOutputStream); outputStream.close(); BufferedReader in = new BufferedReader(new FileReader(System.getProperty("user.home") + "/MDSR_SA/NOAA_Alert.txt")); //display in text area line = in.readLine(); while(line != null) { int deleteString = 0; int remainingString = line.length(); int i; if (remainingString > 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) { } if(alertTimeCleared.getText().equals ("")) NOAAAlertBanner.setText(messageFirstPart + "-" + line); //add the alert message and the time together if(NOAAAlertBanner.getText().startsWith(messageFirstPart)) NOAAAlertBanner.setText(messageFirstPart + "-" + line); //NOAAMessage.setText("test"); if(NOAAMessage.getText().startsWith("NOAA Alert: ")) // superseeds all other messages { NOAAAlertBanner.setText(messageFirstPart + "-" + line); //System.out.println(NOAAAlertBanner.getText()+"this"); } //System.out.println(localFileSize+"-"+ remoteFileSize); //System.out.println(NOAAAlertBanner.getText()+ NOAAmessagCompl +"that"); NOAAmessagCompl = true; //Files.deleteIfExists(Paths.get(System.getProperty("user.home") +("/MDSR_SA/NOAA_Alert.txt"))); } } 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 netAvail.setText("off"); } public static void processAlarmOffTime(){ int selectedTimeInterval = 0; SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); // if (alertPresistance.getSelectedItem()== "1h") selectedTimeInterval = 1; if (alertPresistance.getSelectedItem()== "2h") selectedTimeInterval = 2; if (alertPresistance.getSelectedItem()== "3h") selectedTimeInterval = 3; int clrTimeInterval = ((Integer.parseInt(sdf.format(new Date()).substring(0, 2)))+ selectedTimeInterval); //select the 1h digits and add delay time alertTimeCleared.setText(sdf.format(new Date())); //set the real time StringBuilder currentTimeNOAA = new StringBuilder(alertTimeCleared.getText()); currentTimeNOAA.replace(0,2,Integer.toString(clrTimeInterval)); if (currentTimeNOAA.substring(0,2).equals ("24")) //avoid scheduling bigger than 24 number hours currentTimeNOAA = currentTimeNOAA.replace(0, 2, "00"); if (currentTimeNOAA.substring(0,2).equals ("25")) currentTimeNOAA = currentTimeNOAA.replace(0, 2, "01"); if (currentTimeNOAA.substring(0,2).equals ("26")) currentTimeNOAA = currentTimeNOAA.replace(0, 2, "02"); if (currentTimeNOAA.substring(0,2).equals ("27")) currentTimeNOAA = currentTimeNOAA.replace(0, 2, "03"); alertTimeCleared.setText("Clr. at: " + currentTimeNOAA); } public static void processAlertExpires(){ String alertTimeClearedLocal; SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); alertTimeClearedLocal = alertTimeCleared.getText(); if (alertTimeClearedLocal.startsWith("Clr. at: ")) { //try { alertTimeClearedLocal = alertTimeClearedLocal.replace ("Clr. at: ",""); if (alertTimeClearedLocal.length() < 5) //aviod array error substring NEEDS 00:00 alertTimeClearedLocal = "0" + alertTimeClearedLocal; //String time = sdfShort.format(new Date()); //Date formatDate = sdf.parse(alertTimeClearedLocal); //System.out.println( alertTimeClearedLocal + " " + (sdf.format(new Date()))); if (alertTimeClearedLocal.equals (sdf.format(new Date()))) { //System.out.println( alertTimeClearedLocal + " " + (sdf.format(new Date()))); alertTime.setText("n/a"); alertTimeCleared.setText(""); NOAAAlertBanner.setText(""); NOAAalertsText.setText(""); } //} catch (ParseException ex) { // Logger.getLogger(SA_Display.class.getName()).log(Level.SEVERE, null, ex); // JOptionPane.showMessageDialog(null,"Parser error - alarm cleared"); //} } } public static void uploadingTempData(){ netSpeed(); if(netIsAvailable()==(true)) { if (uploadEnabled.isSelected()== true) { netAvail.setText("Int"); String server = ftpServer.getText(); String user = ftpUserName.getText(); String pass = ftpPassWord.getText(); int port = 21; int count = 1; SimpleDateFormat sdf = new SimpleDateFormat("HH-mm"); //+ ((sdf.format(new Date())) + ".csv")))); FTPClient ftpClient = new FTPClient(); ftpClient.setDefaultTimeout(600); //ftpClient.setDataTimeout(500); //ftpClient.setConnectTimeout(500); try { if (ftpClient.isConnected()) { //checks if the link is active ftpClient.logout(); ftpClient.disconnect(); ftpActivity.append("forced logout " + sdf.format(new Date())+ "\n"); } ftpClient.connect(server, port); ftpActivity.append(ftpClient.getReplyString()); if (ftpClient.getReplyCode() != 220) //successful connection { ftpClient.disconnect(); //System.err.println("FTP server refused connection."); } if (ftpPassWord.getText().equals("propagation")) //password "propagation" is translated pass = "RMXxqQL2"; //System.out.println(pass); ftpClient.login(ftpUserName.getText(), pass); ftpActivity.append(ftpClient.getReplyString()); if (ftpClient.getReplyCode() != 230) //successful logon { ftpClient.disconnect(); //System.err.println("FTP server logon connection."); } // Make sure target directory exists final boolean isTargetDirectoryExist = ftpClient.changeWorkingDirectory(ftpDirectory.getText()+ "/currentData/" ); if (!isTargetDirectoryExist) { ftpClient.makeDirectory(ftpDirectory.getText()+ "/currentData/" ); System.out.println("dir created"); } // Changes working directory ftpClient.changeWorkingDirectory(ftpDirectory.getText()); //ftpActivity.append(ftpClient.printWorkingDirectory()+ "\n"); //ftpActivity.append(ftpClient.getReplyString()); if (ftpClient.getReplyCode() != 250) //directory exists { ftpClient.disconnect(); ftpActivity.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/tempData.bak"); String firstRemoteFile = ftpDirectory.getText()+ "/currentData/" + callSign.getText() + "_tempData.bak"; //grafic file upload 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); ftpActivity.append( sdf.format(new Date()) + " " + callSign.getText() + "tempData.bak uploaded" + "\n"); count = count + 1; } //else //JOptionPane.showMessageDialog(null,"tempData.bak file upload failed"); //uploadingTempData();//loop issue } catch (IOException ex) { //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,"tempData.bak file upload failed"); //uploadingTempData(); //loopiung issue //ftpActivity.setText(""); }} //ene loop else netAvail.setText("off"); } public static void createPropagationHTM() { int numberOfLines = 0; String htmlCorrection = ""; String[] hext_Str = new String [numberOfLines]; //reverse order of display - newest first String arryToHTML = eventsTrackerPane2.getText(); //turn list into HTML arryToHTML = arryToHTML.replaceAll("dB",";dB"); //dB is the delimiter and is removed ; stays hext_Str = (arryToHTML.split("dB")); //split into arry using dB as delimiter //System.out.println("Lenght of array:" + hext_Str.length); int propCountCH1 = 0; int propCountCH2 = 0; int propCountCH3 = 0; int propCountCH4 = 0; int propCountCH5 = 0; int propCountCH6 = 0; int i; for (i =(hext_Str.length -1); i >= 0; i--) { htmlCorrection = htmlCorrection + hext_Str[i]; //assembling the text piece by piece backwards //System.out.println("Propagation:" + hext_Str[i]); if (hext_Str[i].startsWith (" CH1:")) propCountCH1 = propCountCH1 + 1; if (hext_Str[i].startsWith (" CH2:")) propCountCH2 = propCountCH2 + 1; if (hext_Str[i].startsWith (" CH3:")) propCountCH3 = propCountCH3 + 1; if (hext_Str[i].startsWith (" CH4:")) propCountCH4 = propCountCH4 + 1; if (hext_Str[i].startsWith (" CH5:")) propCountCH5 = propCountCH5 + 1; if (hext_Str[i].startsWith (" CH6:")) propCountCH6 = propCountCH6 + 1; } String intoKHZ1 = SA_scan1.getText(); //convert Hz to kHz int digits = intoKHZ1.length(); intoKHZ1 = intoKHZ1.substring (0,digits-3); double waveLengt1 = 300000 / (Integer.parseInt (intoKHZ1)); //convert frequency to wavelength in meters int meters1 = (int) (waveLengt1 + 0.5); String intoKHZ2 = SA_scan2.getText(); digits = intoKHZ2.length(); intoKHZ2 = intoKHZ2.substring (0,digits-3); double waveLengt2 = 300000 / (Integer.parseInt (intoKHZ2)); //convert frequency to wavelength in meters int meters2 = (int) (waveLengt2 + 0.5); String intoKHZ3 = SA_scan3.getText(); digits = intoKHZ3.length(); intoKHZ3 = intoKHZ3.substring (0,digits-3); double waveLengt3 = 300000 / (Integer.parseInt (intoKHZ3)); //convert frequency to wavelength in meters int meters3 = (int) (waveLengt3 + 0.5); String intoKHZ4 = SA_scan4.getText(); digits = intoKHZ4.length(); intoKHZ4 = intoKHZ4.substring (0,digits-3); double waveLengt4 = 300000 / (Integer.parseInt (intoKHZ4)); //convert frequency to wavelength in meters int meters4 = (int) (waveLengt4 + 0.5); String intoKHZ5 = SA_scan5.getText(); digits = intoKHZ5.length(); intoKHZ5 = intoKHZ5.substring (0,digits-3); double waveLengt5 = 300000 / (Integer.parseInt (intoKHZ5)); //convert frequency to wavelength in meters int meters5 = (int) (waveLengt5 + 0.5); String intoKHZ6 = SA_scan6.getText(); digits = intoKHZ6.length(); intoKHZ6 = intoKHZ6.substring (0,digits-3); double waveLengt6 = 300000 / (Integer.parseInt (intoKHZ6)); //convert frequency to wavelength in meters int meters6 = (int) (waveLengt6 + 0.5); try { BufferedWriter out = new BufferedWriter(new FileWriter((System.getProperty("user.home"))+ "/MDSR_SA/propList.htm")); out.write (" " + ""); out.newLine(); out.write (" "); out.newLine(); out.write(""); out.newLine(); out.write(" "); out.newLine(); out.write(" "); out.newLine(); out.write("RF-Seismograph "); out.newLine(); SimpleDateFormat ldf = new SimpleDateFormat("HH:mm:ssZ"); out.write("Created: " + (ldf.format(new Date())) + " ( last 6 h ) " + " Entries: " + (hext_Str.length - 1) + ""); out.newLine(); out.write(""); out.newLine(); out.write("

Scanning RF - Seismograph

"); out.newLine(); out.write("provided by: " + callSign.getText() + " - Grid Location: " + gridSquare.getText() + "
"); out.newLine(); out.write("Antenna: " + antenna.getText()+ " - Elevation: " + elevation.getText() + ""); out.newLine(); out.write("

Band Propagation Count

"); out.newLine(); out.write(" "); out.newLine(); //Propagation count table out.write(""); out.newLine(); //Propagation count table frequency to meter display out.write(""); out.newLine(); //Propagation count table out.write(""); out.newLine(); out.write("
Ch.1 Ch.2 Ch.3 Ch.4 Ch.5 Ch.6
" + meters1 + " m" + meters2 + " m" + meters3 + " m" + meters4 + " m" + meters5 + " m" + meters6 + " m
" + propCountCH1 + "" + propCountCH2 + "" + propCountCH3 + "" + propCountCH4 + "" + propCountCH5 + "" + propCountCH6 + "
"); //propCountCH1 out.newLine(); out.write("

Propagation List (latest on top)

"); out.newLine(); //Propagation listing table out.write(" "); out.newLine(); out.write(""); out.newLine(); htmlCorrection = htmlCorrection.replaceAll("CH1:",""); //; is replaced with "dB" out.write(htmlCorrection ); out.newLine(); out.write("
FrequencyEvent Date/Time/ZoneS/N
" + intoKHZ1 + " kHz"); htmlCorrection = htmlCorrection.replaceAll("CH2:","
" + intoKHZ2 + " kHz"); htmlCorrection = htmlCorrection.replaceAll("CH3:","
" + intoKHZ3 + " kHz"); htmlCorrection = htmlCorrection.replaceAll("CH4:","
" + intoKHZ4 + " kHz"); htmlCorrection = htmlCorrection.replaceAll("CH5:","
" + intoKHZ5 + " kHz"); htmlCorrection = htmlCorrection.replaceAll("CH6:","
" + intoKHZ6 + " kHz"); htmlCorrection = htmlCorrection.replaceAll(",", ""); htmlCorrection = htmlCorrection.replaceAll(";", " dB
"); out.newLine(); out.write(" "); out.newLine(); out.write(""); out.close(); } catch (IOException e) { JOptionPane.showMessageDialog(null,"HTML file creation failed"); } return ; } public static void itemsPropagationList() { //calculates the # of entries without the count of SD //eventsTrackerPane2.setText(""); int numberOfLines = 0; String htmlCorrection = ""; String[] hext_Str = new String [numberOfLines]; //reverse order of display - newest first String arryToHTML = eventsTrackerPane2.getText(); //turn list into HTML arryToHTML = arryToHTML.replaceAll("dB",";dB"); //dB is the delimiter and is removed ; stays hext_Str = (arryToHTML.split("dB")); //split into arry using dB as delimiter numberOfEntries.setText(Integer.toString(hext_Str.length -1)); //System.out.println("Lenght of array:" + hext_Str.length); int i; for (i =(hext_Str.length -1); i >= 0; i--) { htmlCorrection = htmlCorrection + hext_Str[i]; //assembling the text piece by piece backwards } } public static void saveUserParameters() { try { BufferedWriter out = new BufferedWriter(new FileWriter((System.getProperty("user.home"))+ "/MDSR_SA/SA_User.cfg")); out.write (callSign.getText()); out.newLine(); out.write (gridSquare.getText()); out.newLine(); out.write (antenna.getText()); out.newLine(); out.write (elevation.getText()); out.newLine(); out.write (ftpServer.getText()); 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 ; } public static void loadUserParameters() { try { // checking for file size to prevent half images - part one Get size of current image File file = new File(System.getProperty("user.home") + "/MDSR_SA/SA_User.cfg"); double bytesPre = file.length(); if (file.length() == 0) // checking if file is empty { JOptionPane.showMessageDialog(null,"User file empty or corrupt! " + "Restore from Backup! " + "" + System.getProperty("user.home") + "/MDSR_SA"); loadUserParametersBU(); } else { FileReader fr = new FileReader (System.getProperty("user.home")+ "/MDSR_SA/SA_User.cfg"); BufferedReader textReader = new BufferedReader(fr); int numberOfLines = 9; String[] textData = new String [numberOfLines]; int i; for (i=0; i < numberOfLines; i++) { if (i == 1) { callSign.setText(textReader.readLine()); } if (i == 2) { gridSquare.setText(textReader.readLine()); } if (i == 3) { antenna.setText(textReader.readLine()); } if (i == 4) { elevation.setText(textReader.readLine()); } if (i == 5) { ftpServer.setText(textReader.readLine()); } if (i == 6) { ftpDirectory.setText(textReader.readLine()); } if (i == 7) { ftpUserName.setText(textReader.readLine()); } if (i == 8) { ftpPassWord.setText(textReader.readLine()); } } } //end else } catch (IOException e) { JOptionPane.showMessageDialog(null,"No user file found! " + "Restore from Backup! " + "" + System.getProperty("user.home") + "/MDSR_SA"); loadUserParametersBU(); return ; } } public static void loadUserParametersBU() { try { FileReader fr = new FileReader (System.getProperty("user.home")+ "/MDSR_SA/upLoad/SA_User.cfg"); BufferedReader textReader = new BufferedReader(fr); int numberOfLines = 9; String[] textData = new String [numberOfLines]; int i; for (i=0; i < numberOfLines; i++) { if (i == 1) { callSign.setText(textReader.readLine()); } if (i == 2) { gridSquare.setText(textReader.readLine()); } if (i == 3) { antenna.setText(textReader.readLine()); } if (i == 4) { elevation.setText(textReader.readLine()); } if (i == 5) { ftpServer.setText(textReader.readLine()); } if (i == 6) { ftpDirectory.setText(textReader.readLine()); } if (i == 7) { ftpUserName.setText(textReader.readLine()); } if (i == 8) { ftpPassWord.setText(textReader.readLine()); } } } catch (IOException e) { JOptionPane.showMessageDialog(null,"No user file found! " + "The MDSR SA will start with default setting! " + "" + System.getProperty("user.home") + "/MDSR_SA"); File dir = new File(System.getProperty("user.home") + "/MDSR_SA"); dir.mkdir(); return ; } } public static void connectFldigiRead() { preCAT_Frequency = CAT_Frequency; preMDSR_status = MDSR_status; // create configuration XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); try { //Set the URL to point to the XmlRpcWebservice portal component config.setServerURL( new URL("http://localhost:12345")); config.setEnabledForExtensions(true); config.setConnectionTimeout(60 * 1000); config.setReplyTimeout(60 * 1000); } catch (MalformedURLException ex) { Logger.getLogger(SA_Display.class.getName()).log(Level.SEVERE, null, ex); } XmlRpcClient client = new XmlRpcClient(); // use Commons HttpClient as transport client.setTransportFactory(new XmlRpcCommonsTransportFactory(client)); // set configuration client.setConfig(config); // make the a regular call Object[] params = new Object[3] ; //Here the my_handler is the name of the handler that we registered in class XmlRpcWebservice and getQuoteofTheDay is the method from MyQuotes class. String result; try { //result = (String)client.execute("rig.set_ptt" ,params); //updates the rig frequency //System.out.println(result2); result = ((client.execute("rig.get_info" ,params)).toString()); //queries multiple param //result = (String)client.execute("rig.get_info", params); //queries multiple param result = result.replaceAll("(\\r\\n|\\n|\\r)", ","); //make string csv delimided flrigInfo = ( result.split(",")); //remove "retn" and split String rigCurrentVFO = ""; if (flrigInfo[2].startsWith ("FB")) rigCurrentVFO = ("VFO B"); else rigCurrentVFO = ("VFO A"); flrigConnected.setText(flrigInfo[0] +" - "+ rigCurrentVFO); //setTitle("Linux Spectrum Analyzer V 1.7 ("+ flrigInfo[0] +") - "+rigCurrentVFO+" by VE7DXW"); // update heading to rig String flrigTX = flrigInfo[1]; //move data from array to varable flrigTX = flrigTX.substring(2, flrigTX.length()); //clean up data RigState.setText(flrigTX); //Display in GUI String flrigFrequency = flrigInfo[2]; //move data from array to varable flrigFrequency = flrigFrequency.substring(3, flrigFrequency.length()); //clean up data CAT_Frequency = Integer.parseInt(flrigFrequency); //ading a comma to make kHz flrigFrequency = flrigFrequency.substring(0, flrigFrequency.length() - 3) + "." + flrigFrequency.substring((flrigFrequency.length() -3), flrigFrequency.length() ); RigFrequency.setText(flrigFrequency); //Display in GUI String flrigMode = flrigInfo[3]; //move data from array to varable flrigMode = flrigMode.substring(2, flrigMode.length()); //clean up data RigMode.setText(flrigMode); //Display in GUI String flrigLowpass = flrigInfo[4]; //move data from array to varable flrigLowpass = flrigLowpass.substring(2, flrigLowpass.length()); //clean up data filterpassLow.setText(flrigLowpass); //Display in GUI String flrigHighpass = flrigInfo[5]; //move data from array to varable flrigHighpass = flrigHighpass.substring(2, flrigHighpass.length()); //clean up data filterpassHigh.setText(flrigHighpass); //Display in GUI FFT_binLowpass = (int) (FFT_binBFO + (Integer.parseInt(filterpassLow.getText())) / FFT_step); //set low and highpass FFT_binHighpass = (int) (FFT_binBFO + (Integer.parseInt(filterpassHigh.getText())) / FFT_step);//on spectral display updateScrollingFrequency(); //RigFrequency.setText(Integer.toString(CAT_Frequency)); //System.out.println(flrigInfo[1]); } catch (XmlRpcException ex) { Logger.getLogger(SA_Display.class.getName()).log(Level.SEVERE, null, ex); startFLRig(); } } public static void connectFldigiWrite() { preCAT_Frequency = CAT_Frequency; preMDSR_status = MDSR_status; //System.out.println("test"); // create configuration XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); try { //Set the URL to point to the XmlRpcWebservice portal component config.setServerURL(new URL("http://localhost:12345")); config.setEnabledForExceptions(true); config.setEnabledForExtensions(true); config.setConnectionTimeout(60 * 1000); config.setReplyTimeout(60 * 1000); } catch (MalformedURLException ex) { System.out.println("URL does not exist"); } XmlRpcClient client = new XmlRpcClient(); // use Commons HttpClient as transport client.setTransportFactory(new XmlRpcCommonsTransportFactory(client)); // set configuration client.setConfig(config); // make the a regular call Object[] paramsSet = new Object[] { (flrigSetFrequency)}; //String[] paramsSet = new String[7]; //paramsSet[0] = "1"; //Vector paramsSet = new Vector(8); //paramsSet.addElement(new Integer(0)); // Data String for set requests //ArrayList paramsSet = new ArrayList(); //paramsSet.add(1); //System.out.println("SETData:" + paramsSet[0]); //Here the my_handler is the name of the handler that we registered in class XmlRpcWebservice and getQuoteofTheDay is the method from MyQuotes class. String resultSet; try { //resultSet = ((client.execute("rig.set_AB" ,paramsSet)).toString()); //updates the rig set TX - paramsSet must be 1, 0 = RX) resultSet = (String)client.execute("main.set_frequency", paramsSet); //type error //resultSet = (String)client.execute("rig.set_frequency", paramsSet); //unknown methode name //resultSet = (String)client.execute("rig.set_vfo", paramsSet); //type error //resultSet = (String)client.execute("rig.set_vfoA", paramsSet); //unknown methode name //resultSet = (String)client.execute("rig.set_vfoB", paramsSet); //unknown methode name //resultSet = (String)client.execute("rig.swap", paramsSet); //unknown methode name //resultSet = (String)client.execute("rig.set_mode" ,paramsSet); // paramsSet = 1 - type error //resultSet = (String)client.execute("rig.set_AB" ,paramsSet); //type error - paramsSet = 1 //System.out.println("GETData:" + resultSet); } catch (XmlRpcException ex) { Logger.getLogger(SA_Display.class.getName()).log(Level.SEVERE, null, ex); startFLRig(); //System.out.println(exception.getMessage()); //Throwable cause = exception.getCause(); } } public static void startFLRig() { 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); } } public void get6hPropagation() { for (int b = 1239; b <= 1660; b++) //loop of last 6 h { MutableAttributeSet attrs = eventsTrackerPane2.getInputAttributes(); StyledDocument doc = eventsTrackerPane2.getStyledDocument(); //finding propagation bottom display for CH1 float a; if((Double.toString((displaySSI_CH1[b]))) == ("")) { b = 1661; //escape a = 0; //fix null } else a = (Float.parseFloat(String.valueOf(displaySSI_CH1[b] - displaySSI_CH1[b - 1 ]))); if (a > propThresholdValue /100) { boolean timeMakerProcessed =(false); //set true if propagation is alredy active on specific time marker eventsTrackerPane2.select(carretPosition, carretPosition + 31); if (timeMakerProcessed == false) { String digits = "%.1f"; //avoid color bleed if (a < 10) digits = "%.2f"; StyleConstants.setBackground(attrs, Color.red); //gfx.setColor(Color.red); if (displaySD.isSelected()== false) { if (a > 30) //static crahes eventsTrackerPane2.replaceSelection("CH1:" + ( displayTimeMarker[b]+ ",SD ")); else eventsTrackerPane2.replaceSelection("CH1:" + ( displayTimeMarker[b]+ "," +(String.format(digits,(a)))+ "dB ")); } if (displaySD.isSelected()== true) if (a < 30) if(displayTimeMarker[b] != null) eventsTrackerPane2.replaceSelection("CH1:" + ( displayTimeMarker[b]+ "," +(String.format(digits,(a)))+ "dB ")); carretPosition = carretPosition + 40; if (timeIncidentDuplicate.isSelected()== false) timeMakerProcessed =(false); else timeMakerProcessed =(true); //to only list one event per time marker } } //finding propagation bottom display for CH2 if((Double.toString((displaySSI_CH2[b]))) == ("")) { b = 1661; //escape a = 0; //fix null } else a = (Float.parseFloat(String.valueOf(displaySSI_CH2[b] - displaySSI_CH2[b - 1 ]))); if (a > propThresholdValue /100) { boolean timeMakerProcessed =(false); //set true if propagation is alredy active on specific time marker eventsTrackerPane2.select(carretPosition, carretPosition + 31); if (timeMakerProcessed == false) { String digits = "%.1f"; //avoid color bleed if (a < 10) digits = "%.2f"; StyleConstants.setBackground(attrs, Color.green); //gfx.setColor(Color.red); if (displaySD.isSelected()== false) { if (a > 30) //static crahes eventsTrackerPane2.replaceSelection("CH2:" + ( displayTimeMarker[b]+ ",SD ")); else eventsTrackerPane2.replaceSelection("CH2:" + ( displayTimeMarker[b]+ "," +(String.format(digits,(a)))+ "dB ")); } if (displaySD.isSelected()== true) if (a < 30) if(displayTimeMarker[b] != null) eventsTrackerPane2.replaceSelection("CH2:" + ( displayTimeMarker[b]+ "," +(String.format(digits,(a)))+ "dB ")); carretPosition = carretPosition + 40; if (timeIncidentDuplicate.isSelected()== false) timeMakerProcessed =(false); else timeMakerProcessed =(true); //to only list one event per time marker } } //finding propagation bottom display for CH3 if((Double.toString((displaySSI_CH3[b]))) == ("")) { b = 1661; //escape a = 0; //fix null } else a = (Float.parseFloat(String.valueOf(displaySSI_CH3[b] - displaySSI_CH3[b - 1 ]))); if (a > propThresholdValue /100) { boolean timeMakerProcessed =(false); //set true if propagation is alredy active on specific time marker eventsTrackerPane2.select(carretPosition, carretPosition + 31); if (timeMakerProcessed == false) { String digits = "%.1f"; //avoid color bleed if (a < 10) digits = "%.2f"; StyleConstants.setBackground(attrs, Color.YELLOW); //gfx.setColor(Color.red); if (displaySD.isSelected()== false) { if (a > 30) //static crahes eventsTrackerPane2.replaceSelection("CH3:" + ( displayTimeMarker[b]+ ",SD ")); else eventsTrackerPane2.replaceSelection("CH3:" + ( displayTimeMarker[b]+ "," +(String.format(digits,(a)))+ "dB ")); } if (displaySD.isSelected()== true) if (a < 30) if(displayTimeMarker[b] != null) eventsTrackerPane2.replaceSelection("CH3:" + ( displayTimeMarker[b]+ "," +(String.format(digits,(a)))+ "dB ")); carretPosition = carretPosition + 40; if (timeIncidentDuplicate.isSelected()== false) timeMakerProcessed =(false); else timeMakerProcessed =(true); //to only list one event per time marker } } //finding propagation bottom display for CH4 if((Double.toString((displaySSI_CH4[b]))) == ("")) { b = 1661; //escape a = 0; //fix null } else a = (Float.parseFloat(String.valueOf(displaySSI_CH4[b] - displaySSI_CH4[b - 1 ]))); if (a > propThresholdValue /100) { boolean timeMakerProcessed =(false); //set true if propagation is alredy active on specific time marker eventsTrackerPane2.select(carretPosition, carretPosition + 31); if (timeMakerProcessed == false) { String digits = "%.1f"; //avoid color bleed if (a < 10) digits = "%.2f"; StyleConstants.setBackground(attrs, Color.MAGENTA); //gfx.setColor(Color.red); if (displaySD.isSelected()== false) { if (a > 30) //static crahes eventsTrackerPane2.replaceSelection("CH4:" + ( displayTimeMarker[b]+ ",SD ")); else eventsTrackerPane2.replaceSelection("CH4:" + ( displayTimeMarker[b]+ "," +(String.format(digits,(a)))+ "dB ")); } if (displaySD.isSelected()== true) if (a < 30) if(displayTimeMarker[b] != null) eventsTrackerPane2.replaceSelection("CH4:" + ( displayTimeMarker[b]+ "," +(String.format(digits,(a)))+ "dB ")); carretPosition = carretPosition + 40; if (timeIncidentDuplicate.isSelected()== false) timeMakerProcessed =(false); else timeMakerProcessed =(true); //to only list one event per time marker } } //finding propagation bottom display for CH5 if((Double.toString((displaySSI_CH5[b]))) == ("")) { b = 1661; //escape a = 0; //fix null } else a = (Float.parseFloat(String.valueOf(displaySSI_CH5[b] - displaySSI_CH5[b - 1 ]))); if (a > propThresholdValue /100) { boolean timeMakerProcessed =(false); //set true if propagation is alredy active on specific time marker eventsTrackerPane2.select(carretPosition, carretPosition + 31); if (timeMakerProcessed == false) { String digits = "%.1f"; //avoid color bleed if (a < 10) digits = "%.2f"; StyleConstants.setBackground(attrs, Color.cyan); //gfx.setColor(Color.red); if (displaySD.isSelected()== false) { if (a > 30) //static crahes eventsTrackerPane2.replaceSelection("CH5:" + ( displayTimeMarker[b]+ ",SD ")); else eventsTrackerPane2.replaceSelection("CH5:" + ( displayTimeMarker[b]+ "," +(String.format(digits,(a)))+ "dB ")); } if (displaySD.isSelected()== true) if (a < 30) if(displayTimeMarker[b] != null) eventsTrackerPane2.replaceSelection("CH5:" + ( displayTimeMarker[b]+ "," +(String.format(digits,(a)))+ "dB ")); carretPosition = carretPosition + 40; if (timeIncidentDuplicate.isSelected()== false) timeMakerProcessed =(false); else timeMakerProcessed =(true); //to only list one event per time marker } } //finding propagation bottom display for CH6 if((Double.toString((displaySSI_CH6[b]))) == ("")) { b = 1661; //escape a = 0; //fix null } else a = (Float.parseFloat(String.valueOf(displaySSI_CH6[b] - displaySSI_CH6[b - 1 ]))); if (a > propThresholdValue /100) { boolean timeMakerProcessed =(false); //set true if propagation is alredy active on specific time marker eventsTrackerPane2.select(carretPosition, carretPosition + 31); if (timeMakerProcessed == false) { String digits = "%.1f"; //avoid color bleed if (a < 10) digits = "%.2f"; StyleConstants.setBackground(attrs, Color.PINK); //gfx.setColor(Color.red); if (displaySD.isSelected()== false) { if (a > 30) //static crahes eventsTrackerPane2.replaceSelection("CH6:" + ( displayTimeMarker[b]+ ",SD ")); else eventsTrackerPane2.replaceSelection("CH6:" + ( displayTimeMarker[b]+ "," +(String.format(digits,(a)))+ "dB ")); } if (displaySD.isSelected()== true) if (a < 30) if(displayTimeMarker[b] != null) eventsTrackerPane2.replaceSelection("CH6:" + ( displayTimeMarker[b]+ "," +(String.format(digits,(a)))+ "dB ")); carretPosition = carretPosition + 40; if (timeIncidentDuplicate.isSelected()== false) timeMakerProcessed =(false); else timeMakerProcessed =(true); //to only list one event per time marker } } } //end for loop itemsPropagationList(); } private static boolean netIsAvailable() { try { final URL url = new URL("http://www.google.com"); //"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 boolean serverUp() { try { final URL url = new URL("http://" +ftpServer.getText()); //"http://www.google.com") final URLConnection conn = url.openConnection(); conn.connect(); conn.getInputStream().close(); return true; } catch (MalformedURLException e) { JOptionPane.showMessageDialog(null,"Server name does not exist"); throw new RuntimeException(e); } catch (IOException e) { return false; } } public static void netSpeed() { if(netIsAvailable()==(true)) { //if (uploadEnabled.isSelected()== true) { netAvail.setText("Serv"); String ip = ftpServer.getText(); String pingResult = ""; SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); String time = sdf.format(new Date()); String pingCmd = "ping " + ip + " -c 1"; //ping once 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; //ftpActivity.append(sdf.format(new Date()) + "\n"); while ((inputLine = in.readLine()) != null) { //if(inputLine.startsWith("Name")) //ftpActivity.append(inputLine + "\n"); if(inputLine.startsWith("Name")) { ftpActivity.append("Name or service not known"+ "\n"); } if(inputLine.startsWith("64 bytes")) { ftpActivity.append("Network Speed: "+(inputLine.substring(67, 71))+" mS"+ "\n");//filter delay time b = 5; //end loop } pingResult = inputLine; } if (pingResult == "") { netIsAvailableFTP = false; ftpActivity.append(ftpServer.getText()+" timed out"+"false" +"\n"); } else { netIsAvailableFTP = true; ftpActivity.append(ftpServer.getText()+" server avail." +"\n"); } in.close(); } catch (IOException e) { System.out.println(e); ftpActivity.append("Server not avilable"+ "\n"); } } } // end for loops } else ftpActivity.append(ftpServer.getText()+" can not be reached - no Internet"+ "\n"); //JOptionPane.showMessageDialog(null,"Network or Server down"); } public static void runProcess() { //Timestamp tm = new Timestamp(2000); SA_listServices.removeAllItems(); Date date= new Date(); String threadSys = " Misc. "; //long time = date.getTime(); //System.out.println("Time in Milliseconds: " + time); //System.out.println("The Timestamp time is : "+ tm.toString()); //System.out.println("The Time in milliseconds is : "+ tm.getTime()); Set threadSet = Thread.getAllStackTraces().keySet(); for ( Thread t : threadSet){ if ( t.getThreadGroup() == Thread.currentThread().getThreadGroup()){ /**needs a way to define started threads if(screenSwitch.getSelectedIndex() == 0) //0 = SA, 1 = Prop threadSys = " Realtime: "; if(screenSwitch.getSelectedIndex() == 1) //0 = SA, 1 = Prop threadSys = " Propag G: "; **/ //System.out.println(setTime(long time) + "Thread :"+t+":"+"state:"+t.getState()); SA_listServices.addItem(date.getTime()+threadSys+t+":"+"state:"+t.getState()); } } } public void delayedTimer() { //boolean runThread = true; Thread dT; //thread end dT = new Thread() { @Override public void run() { do{ try { sleep(60000); }catch (InterruptedException e) { } refreshTimePG.setSelectedItem("1m"); //System.out.println("test"); } while ( 1 == 1) ; //escape condition } }; dT.start(); }; ; public static void runProcess1() { System.out.println("button pressed"); try { Runtime runtime = Runtime.getRuntime(); Process process = runtime.exec("java -jar /home/pi/MDSR_SA/SpectrumAnalyzerLG.jar"); //Process process = runtime.exec(System.getProperty("user.home")+ "/MDSR_SA/SpectrumAnalyzerLG.jar"); process.getOutputStream().close(); InputStream inputStream = process.getInputStream(); InputStreamReader inputstreamreader = new InputStreamReader( inputStream); BufferedReader bufferedrReader = new BufferedReader( inputstreamreader); BufferedReader bufferedrReader1 = new BufferedReader( inputstreamreader); String strLine = ""; String x[]=new String[100]; int i=0; int t=0; while ((strLine = bufferedrReader.readLine()) != null) { System.out.println(strLine); String[] a=strLine.split(","); x[i++]=a[0]; } System.out.println("Length : "+i); for(int j=2;j