Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
Satellite
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Christopher Reis
Satellite
Commits
b91373b5
Commit
b91373b5
authored
Nov 13, 2015
by
Christopher Reis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made TrackerList global static like satelliteDB
parent
8839b482
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
78 additions
and
3 deletions
+78
-3
SatelliteTrack.class
bin/satellite/SatelliteTrack.class
+0
-0
Application.java
src/GUI/Application.java
+1
-1
satelliteStatus.java
src/GUI/satelliteStatus.java
+2
-2
SatelliteTrack.java
src/satellite/SatelliteTrack.java
+9
-0
TrackerList.java
src/satellite/TrackerList.java
+39
-0
tracker.java
src/satellite/tracker.java
+27
-0
No files found.
bin/satellite/SatelliteTrack.class
View file @
b91373b5
No preview for this file type
src/GUI/Application.java
View file @
b91373b5
...
...
@@ -38,7 +38,7 @@ public class Application {
private
JFrame
frmSatelliteTracker
;
private
final
Action
action
=
new
SwingAction
();
Tracker
Thread
tracker
=
new
TrackerThread
();
Tracker
List
trackList
=
new
TrackerList
();
SatelliteDB
satellites
=
new
SatelliteDB
(
"SatelliteDB"
);
/**
...
...
src/GUI/satelliteStatus.java
View file @
b91373b5
...
...
@@ -53,7 +53,7 @@ public class satelliteStatus extends JInternalFrame {
btnStartTracking
.
addMouseListener
(
new
MouseAdapter
()
{
@Override
public
void
mousePressed
(
MouseEvent
arg0
)
{
Tracker
Thread
.
startTrack
(
curSat
.
getTLE
().
getName
(),
"Albuquerque"
);
Tracker
List
.
startTrack
(
curSat
.
getTLE
().
getName
(),
"Albuquerque"
);
//thread.setSatellite(curSat);
//(new Thread(new thread())).start();
}
...
...
@@ -66,7 +66,7 @@ public class satelliteStatus extends JInternalFrame {
btnStopTracking
.
addMouseListener
(
new
MouseAdapter
()
{
@Override
public
void
mousePressed
(
MouseEvent
arg0
)
{
tracker
.
stopTrack
(
curSat
.
getTLE
().
getName
());
TrackerList
.
stopTrack
(
curSat
.
getTLE
().
getName
());
//thread.setSatellite(curSat);
//(new Thread(new thread())).start();
}
...
...
src/satellite/SatelliteTrack.java
View file @
b91373b5
...
...
@@ -160,6 +160,15 @@ public class SatelliteTrack {
tripleOrbit
=
getTripleOrbit
(
this
.
satellite
);
}
public
satPosition
getPosition
(){
satellite
.
calculateSatelliteVectors
(
new
Date
());
satPosition
pos
=
new
satPosition
(
satellite
.
calculateSatelliteGroundTrack
().
getLatitude
(),
satellite
.
calculateSatelliteGroundTrack
().
getLongitude
(),
satellite
.
calculateSatelliteGroundTrack
().
getAltitude
(),
satellite
.
calculateSatelliteGroundTrack
().
getTime
());
return
pos
;
}
public
List
<
SatPassTime
>
get24hrPasses
(
GroundStationPosition
gpos
)
{
updateSatPassPredictor
(
gpos
);
...
...
src/satellite/
trackerThread
.java
→
src/satellite/
TrackerList
.java
View file @
b91373b5
...
...
@@ -3,13 +3,10 @@ package satellite;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
Tracker
Thread
{
public
class
Tracker
List
{
//trackerThread.setSatellite(curSat);
//(new Thread(new trackerThread())).start();
private
static
List
<
tracker
>
threadList
=
new
ArrayList
<
tracker
>();
public
static
void
startTrack
(
String
sat
,
String
gs
){
int
satNum
=
SatelliteDB
.
getSatIndex
(
sat
);
SatelliteTrack
satellite
=
SatelliteDB
.
sat
(
satNum
);
...
...
@@ -17,7 +14,7 @@ public class TrackerThread{
threadList
.
get
(
threadList
.
size
()-
1
).
start
();
}
public
void
stopTrack
(
String
sat
){
public
static
void
stopTrack
(
String
sat
){
for
(
int
i
=
0
;
i
<
threadList
.
size
();
i
++){
if
(
threadList
.
get
(
i
).
name
.
equals
(
sat
)){
threadList
.
get
(
i
).
stop
();
...
...
@@ -25,35 +22,18 @@ public class TrackerThread{
}
}
private
void
searchThread
(
String
sat
){
public
static
satPosition
getSatPos
(
String
sat
){
int
satNum
=
searchThread
(
sat
);
return
threadList
.
get
(
satNum
).
sat
.
getPosition
();
}
private
static
int
searchThread
(
String
sat
){
for
(
int
i
=
0
;
i
<
threadList
.
size
();
i
++){
if
(
sat
.
trim
().
equals
(
threadList
.
get
(
i
).
name
)){
//threadList.get(i).stopTrack(sat);
;
return
i
;
}
}
return
-
1
;
}
private
class
tracker
extends
Thread
{
public
tracker
(
SatelliteTrack
satellite
){
sat
=
satellite
;
name
=
satellite
.
getTLE
().
getName
();
}
public
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
();
}
}
}
}
}
src/satellite/tracker.java
0 → 100644
View file @
b91373b5
package
satellite
;
public
class
tracker
extends
Thread
{
public
tracker
(
SatelliteTrack
satellite
){
sat
=
satellite
;
name
=
satellite
.
getTLE
().
getName
();
}
public
String
name
;
public
SatelliteTrack
sat
;
int
seconds
=
0
;
public
void
run
(){
while
(
true
){
System
.
out
.
println
(
"Tracking "
+
sat
.
getTLE
().
getName
()
+
" for: "
+
seconds
+
" seconds"
);
System
.
out
.
println
(
sat
.
getPosition
().
getLat
()
+
" "
+
sat
.
getPosition
().
getLon
());
seconds
++;
try
{
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment