Commit 70eccf31 authored by Christopher Reis's avatar Christopher Reis

Added threading to Tracker Thread

Need to fix issues with GUI Freezing
parent 9423872e
/satellite/
/GUI/ /GUI/
/satellite/
...@@ -145,7 +145,7 @@ public class Application { ...@@ -145,7 +145,7 @@ public class Application {
mntmSelectSatellite.addMouseListener(new MouseAdapter() { mntmSelectSatellite.addMouseListener(new MouseAdapter() {
@Override @Override
public void mousePressed(MouseEvent arg0) { public void mousePressed(MouseEvent arg0) {
(new Thread(new trackerThread())).start(); //(new Thread(new trackerThread())).start();
} }
}); });
mnView.add(mntmSelectSatellite); mnView.add(mntmSelectSatellite);
......
...@@ -11,9 +11,7 @@ import com.jgoodies.forms.layout.FormLayout; ...@@ -11,9 +11,7 @@ import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.ColumnSpec; import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.RowSpec; import com.jgoodies.forms.layout.RowSpec;
import satellite.SatelliteDB; import satellite.*;
import satellite.SatelliteTrack;
import satellite.trackerThread;
import com.jgoodies.forms.layout.FormSpecs; import com.jgoodies.forms.layout.FormSpecs;
import javax.swing.JLabel; import javax.swing.JLabel;
...@@ -29,6 +27,7 @@ import java.awt.GridLayout; ...@@ -29,6 +27,7 @@ import java.awt.GridLayout;
public class satelliteStatus extends JInternalFrame { public class satelliteStatus extends JInternalFrame {
TrackerThread tracker = new TrackerThread();
SatelliteTrack curSat = null; SatelliteTrack curSat = null;
DefaultMutableTreeNode root = new DefaultMutableTreeNode("Database"); DefaultMutableTreeNode root = new DefaultMutableTreeNode("Database");
JTree tree = new JTree(root); JTree tree = new JTree(root);
...@@ -55,8 +54,9 @@ public class satelliteStatus extends JInternalFrame { ...@@ -55,8 +54,9 @@ public class satelliteStatus extends JInternalFrame {
btnStartTracking.addMouseListener(new MouseAdapter() { btnStartTracking.addMouseListener(new MouseAdapter() {
@Override @Override
public void mousePressed(MouseEvent arg0) { public void mousePressed(MouseEvent arg0) {
trackerThread.setSatellite(curSat); tracker.startTrack(curSat.getTLE().getName(), "Albuquerque");
(new Thread(new trackerThread())).start(); //thread.setSatellite(curSat);
//(new Thread(new thread())).start();
} }
}); });
panel.setLayout(null); panel.setLayout(null);
...@@ -108,7 +108,7 @@ public class satelliteStatus extends JInternalFrame { ...@@ -108,7 +108,7 @@ public class satelliteStatus extends JInternalFrame {
/* React to the node selection. */ /* React to the node selection. */
if (node.isLeaf()) { if (node.isLeaf()) {
curSat = SatelliteDB.sat(SatelliteDB.getSatIndex((String) nodeInfo)); curSat = SatelliteDB.sat(SatelliteDB.getSatIndex((String) nodeInfo));
trackerThread.setSatellite(curSat); //trackerThread track = new trackerThread(curSat);
System.out.println(curSat.getTLE().getName()); System.out.println(curSat.getTLE().getName());
} else { } else {
System.out.println("Not Leaf"); System.out.println("Not Leaf");
......
...@@ -94,7 +94,7 @@ public class satelliteTree extends JInternalFrame { ...@@ -94,7 +94,7 @@ public class satelliteTree extends JInternalFrame {
BufferedImage img = null; BufferedImage img = null;
try { try {
img = ImageIO.read(new File("C:\\Users\\Christopher\\Documents\\GitHub\\Satellite\\satellite.png")); img = ImageIO.read(new File("D:\\MyDocuments\\GitHub\\Satellite\\satellite.png"));
//D:\\MyDocuments\\GitHub\\Satellite\\satellite.png //D:\\MyDocuments\\GitHub\\Satellite\\satellite.png
//C:\\Users\\Christopher\\Documents\\GitHub\\Satellite\\satellite.png //C:\\Users\\Christopher\\Documents\\GitHub\\Satellite\\satellite.png
} catch (IOException e) { } catch (IOException e) {
......
...@@ -39,11 +39,14 @@ public class SatelliteDB { ...@@ -39,11 +39,14 @@ public class SatelliteDB {
static boolean databaseSet = false; static boolean databaseSet = false;
static String name = "SatelliteDB"; static String name = "SatelliteDB";
static GroundStationPosition groundstation; static GroundStationPosition groundstation;
static ArrayList<GroundStationPosition> GROUNDSTATIONS = new ArrayList<GroundStationPosition>();
final static GroundStationPosition ALBUQUERQUE = new GroundStationPosition(35.0873191, -106.6376107, 5500, "Albuquerque"); final static GroundStationPosition ALBUQUERQUE = new GroundStationPosition(35.0873191, -106.6376107, 5500, "Albuquerque");
final static GroundStationPosition STORMLAKE = new GroundStationPosition(42.6436, 95.2019, 1440,"Storm Lake"); final static GroundStationPosition STORMLAKE = new GroundStationPosition(42.6436, 95.2019, 1440,"Storm Lake");
public SatelliteDB(String name){ public SatelliteDB(String name){
this.name = name; this.name = name;
GROUNDSTATIONS.add(ALBUQUERQUE);
GROUNDSTATIONS.add(STORMLAKE);
} }
public static boolean downloadTLE(String in_url, String file){ public static boolean downloadTLE(String in_url, String file){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment