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
8839b482
Commit
8839b482
authored
Nov 13, 2015
by
Christopher Reis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tracker Thread to static
parent
1ed0153f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
10 deletions
+22
-10
satelliteStatus.java
src/GUI/satelliteStatus.java
+9
-2
trackerThread.java
src/satellite/trackerThread.java
+13
-8
No files found.
src/GUI/satelliteStatus.java
View file @
8839b482
...
...
@@ -27,7 +27,6 @@ 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
);
...
...
@@ -54,7 +53,7 @@ public class satelliteStatus extends JInternalFrame {
btnStartTracking
.
addMouseListener
(
new
MouseAdapter
()
{
@Override
public
void
mousePressed
(
MouseEvent
arg0
)
{
tracker
.
startTrack
(
curSat
.
getTLE
().
getName
(),
"Albuquerque"
);
TrackerThread
.
startTrack
(
curSat
.
getTLE
().
getName
(),
"Albuquerque"
);
//thread.setSatellite(curSat);
//(new Thread(new thread())).start();
}
...
...
@@ -64,6 +63,14 @@ public class satelliteStatus extends JInternalFrame {
JButton
btnStopTracking
=
new
JButton
(
"Stop Tracking"
);
btnStopTracking
.
setBounds
(
257
,
390
,
161
,
48
);
btnStopTracking
.
addMouseListener
(
new
MouseAdapter
()
{
@Override
public
void
mousePressed
(
MouseEvent
arg0
)
{
tracker
.
stopTrack
(
curSat
.
getTLE
().
getName
());
//thread.setSatellite(curSat);
//(new Thread(new thread())).start();
}
});
panel
.
add
(
btnStopTracking
);
JLabel
lblLatitude
=
new
JLabel
(
"Latitude"
);
...
...
src/satellite/trackerThread.java
View file @
8839b482
...
...
@@ -7,18 +7,22 @@ public class TrackerThread{
//trackerThread.setSatellite(curSat);
//(new Thread(new trackerThread())).start();
private
static
List
<
t
hread
>
threadList
=
new
ArrayList
<
thread
>();
private
static
List
<
t
racker
>
threadList
=
new
ArrayList
<
tracker
>();
public
void
startTrack
(
String
sat
,
String
gs
){
public
static
void
startTrack
(
String
sat
,
String
gs
){
int
satNum
=
SatelliteDB
.
getSatIndex
(
sat
);
SatelliteTrack
satellite
=
SatelliteDB
.
sat
(
satNum
);
threadList
.
add
(
new
t
hread
(
satellite
));
threadList
.
get
(
threadList
.
size
()-
1
).
run
();
threadList
.
add
(
new
t
racker
(
satellite
));
threadList
.
get
(
threadList
.
size
()-
1
).
start
();
}
public
void
stopTrack
(
String
sat
){
for
(
int
i
=
0
;
i
<
threadList
.
size
();
i
++){
if
(
threadList
.
get
(
i
).
name
.
equals
(
sat
)){
threadList
.
get
(
i
).
stop
();
}
}
}
private
void
searchThread
(
String
sat
){
...
...
@@ -28,13 +32,14 @@ public class TrackerThread{
}
}
}
private
class
thread
implements
Runnable
{
private
class
tracker
extends
Thread
{
public
t
hread
(
SatelliteTrack
satellite
){
public
t
racker
(
SatelliteTrack
satellite
){
sat
=
satellite
;
name
=
satellite
.
getTLE
().
getName
();
}
String
name
;
public
String
name
;
SatelliteTrack
sat
;
int
seconds
=
0
;
public
void
run
(){
...
...
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