Commit 9f67734a authored by Christopher Reis's avatar Christopher Reis

trackerThread update

parent 70eccf31
package satellite; package satellite;
import java.util.ArrayList;
import java.util.List;
public class TrackerThread{
public class trackerThread implements Runnable{ //trackerThread.setSatellite(curSat);
//(new Thread(new trackerThread())).start();
static SatelliteTrack sat; private static List<thread> threadList = new ArrayList<thread>();
int seconds = 0;
public void run(){
while(true){ public void startTrack(String sat, String gs){
System.out.println("Tracking " + sat.getTLE().getName() + " for: "+ seconds +" seconds"); int satNum = SatelliteDB.getSatIndex(sat);
seconds++; SatelliteTrack satellite = SatelliteDB.sat(satNum);
threadList.add(new thread(satellite));
try { threadList.get(threadList.size()-1).run();
Thread.sleep(1000); }
} catch (InterruptedException e) {
e.printStackTrace(); public void stopTrack(String sat){
}
private void searchThread(String sat){
for(int i = 0;i<threadList.size();i++){
if(sat.trim().equals(threadList.get(i).name)){
//threadList.get(i).stopTrack(sat);;
} }
} }
} }
private class thread implements Runnable{
public static void setSatellite(SatelliteTrack satellite){
sat = satellite; public thread(SatelliteTrack satellite){
sat = satellite;
name = satellite.getTLE().getName();
}
String name;
SatelliteTrack sat;
int seconds = 0;
public void run(){
while(true){
System.out.println("Tracking " + sat.getTLE().getName() + " for: "+ seconds +" seconds");
seconds++;
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
} }
} }
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