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/
/satellite/
......@@ -145,7 +145,7 @@ public class Application {
mntmSelectSatellite.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent arg0) {
(new Thread(new trackerThread())).start();
//(new Thread(new trackerThread())).start();
}
});
mnView.add(mntmSelectSatellite);
......
......@@ -11,9 +11,7 @@ import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.RowSpec;
import satellite.SatelliteDB;
import satellite.SatelliteTrack;
import satellite.trackerThread;
import satellite.*;
import com.jgoodies.forms.layout.FormSpecs;
import javax.swing.JLabel;
......@@ -29,6 +27,7 @@ import java.awt.GridLayout;
public class satelliteStatus extends JInternalFrame {
TrackerThread tracker = new TrackerThread();
SatelliteTrack curSat = null;
DefaultMutableTreeNode root = new DefaultMutableTreeNode("Database");
JTree tree = new JTree(root);
......@@ -55,8 +54,9 @@ public class satelliteStatus extends JInternalFrame {
btnStartTracking.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent arg0) {
trackerThread.setSatellite(curSat);
(new Thread(new trackerThread())).start();
tracker.startTrack(curSat.getTLE().getName(), "Albuquerque");
//thread.setSatellite(curSat);
//(new Thread(new thread())).start();
}
});
panel.setLayout(null);
......@@ -108,7 +108,7 @@ public class satelliteStatus extends JInternalFrame {
/* React to the node selection. */
if (node.isLeaf()) {
curSat = SatelliteDB.sat(SatelliteDB.getSatIndex((String) nodeInfo));
trackerThread.setSatellite(curSat);
//trackerThread track = new trackerThread(curSat);
System.out.println(curSat.getTLE().getName());
} else {
System.out.println("Not Leaf");
......
......@@ -94,7 +94,7 @@ public class satelliteTree extends JInternalFrame {
BufferedImage img = null;
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
//C:\\Users\\Christopher\\Documents\\GitHub\\Satellite\\satellite.png
} catch (IOException e) {
......
......@@ -39,11 +39,14 @@ public class SatelliteDB {
static boolean databaseSet = false;
static String name = "SatelliteDB";
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 STORMLAKE = new GroundStationPosition(42.6436, 95.2019, 1440,"Storm Lake");
public SatelliteDB(String name){
this.name = name;
GROUNDSTATIONS.add(ALBUQUERQUE);
GROUNDSTATIONS.add(STORMLAKE);
}
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