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
7e3dd6df
Commit
7e3dd6df
authored
Nov 16, 2015
by
Christopher Reis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed LatLon coordination....still freezes with multiple sats
parent
32f98c7a
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
28 additions
and
71 deletions
+28
-71
SatelliteTrack.class
bin/satellite/SatelliteTrack.class
+0
-0
satPosition.class
bin/satellite/satPosition.class
+0
-0
Application.java
src/GUI/Application.java
+0
-8
view3D.java
src/GUI/view3D.java
+10
-18
SatelliteTrack.java
src/satellite/SatelliteTrack.java
+2
-1
TrackerList.java
src/satellite/TrackerList.java
+7
-8
satPosition.java
src/satellite/satPosition.java
+9
-0
tracker.java
src/satellite/tracker.java
+0
-36
No files found.
bin/satellite/SatelliteTrack.class
View file @
7e3dd6df
No preview for this file type
bin/satellite/satPosition.class
View file @
7e3dd6df
No preview for this file type
src/GUI/Application.java
View file @
7e3dd6df
...
...
@@ -48,17 +48,9 @@ public class Application {
static
SatelliteDB
satellites
=
new
SatelliteDB
(
"SatelliteDB"
);
static
view3D
threeDview
=
new
view3D
();
static
ActionListener
updateTracks
=
new
ActionListener
()
{
public
void
actionPerformed
(
ActionEvent
evt
)
{
List
<
satPosition
>
pos
=
TrackerList
.
getTracks
();
threeDview
.
updateTracks
(
pos
);
}
};
static
ActionListener
addtrack
=
new
ActionListener
()
{
public
void
actionPerformed
(
ActionEvent
evt
)
{
threeDview
.
addSatellite
(
TrackerList
.
getTracks
());
//System.out.println(TrackerList.getTracks().get(0).getLat());
}
};
...
...
src/GUI/view3D.java
View file @
7e3dd6df
...
...
@@ -87,34 +87,24 @@ public class view3D extends JInternalFrame{
Iterable
<
Renderable
>
iter
=
layer
.
getRenderables
();
while
(
iter
.
iterator
().
hasNext
()){
System
.
out
.
println
(
"Iterator "
);
Renderable
rend
=
iter
.
iterator
().
next
();
if
(
rend
instanceof
PointPlacemark
){
PointPlacemark
delp
=
(
PointPlacemark
)
rend
;
System
.
out
.
println
(
delp
.
getLabelText
());
if
(
delp
.
getLabelText
().
equals
(
name
)){
delp
.
setPosition
(
Position
.
fromDegrees
(
lat
,
lon
,
alt
*
1000
));
System
.
out
.
println
(
lat
+
" "
+
lon
+
" "
+
alt
*
1000
);
wwd
.
redraw
();
return
;
}
else
{
return
;
}
}
else
{
System
.
out
.
println
(
"Not a PP"
);
}
}
PointPlacemark
pp
=
new
PointPlacemark
(
Position
.
fromDegrees
(
lat
,
lon
,
alt
*
1000
));
// pp.setValue(AVKey.DISPLAY_NAME, "Clamp to ground, Audio icon, Heading -45, Globe relative");
// pp.setLabelText(name);
// pp.setLineEnabled(false);
// pp.setAltitudeMode(WorldWind.RELATIVE_TO_GROUND);
// PointPlacemarkAttributes attrs = new PointPlacemarkAttributes();
// attrs.setImageAddress("D:\\MyDocuments\\GitHub\\Satellite\\satellite.png");
// attrs.setHeading(-45d);
// attrs.setHeadingReference(AVKey.RELATIVE_TO_GLOBE);
// attrs.setScale(0.05);
// attrs.setImageOffset(new Offset(0.5, 0.5, AVKey.FRACTION, AVKey.FRACTION));
// attrs.setImageOffset(new Offset(19d, 8d, AVKey.PIXELS, AVKey.PIXELS));
// attrs.setLabelColor("ffffffff");
// attrs.setLabelOffset(new Offset(0.9d, 0.6d, AVKey.FRACTION, AVKey.FRACTION));
// pp.setAttributes(attrs);
// layer.addRenderable(pp);
pp
.
setLabelText
(
name
);
pp
.
setValue
(
AVKey
.
DISPLAY_NAME
,
"Label, Semi-transparent, Audio icon"
);
pp
.
setLineEnabled
(
false
);
...
...
@@ -134,8 +124,10 @@ public class view3D extends JInternalFrame{
}
public
void
addSatellite
(
List
<
satPosition
>
positions
){
System
.
out
.
println
(
"Size "
+
positions
.
size
());
for
(
int
i
=
0
;
i
<
positions
.
size
();
i
++){
addTrack
(
positions
.
get
(
i
).
getName
(),
positions
.
get
(
i
).
getLat
(),
positions
.
get
(
i
).
getLon
(),
positions
.
get
(
i
).
getAlt
());
System
.
out
.
println
(
positions
.
get
(
i
).
getName
()+
" Added!"
);
}
}
}
src/satellite/SatelliteTrack.java
View file @
7e3dd6df
...
...
@@ -165,7 +165,8 @@ public class SatelliteTrack {
satPosition
pos
=
new
satPosition
(
satellite
.
calculateSatelliteGroundTrack
().
getLatitude
(),
satellite
.
calculateSatelliteGroundTrack
().
getLongitude
(),
satellite
.
calculateSatelliteGroundTrack
().
getAltitude
(),
satellite
.
calculateSatelliteGroundTrack
().
getTime
());
satellite
.
calculateSatelliteGroundTrack
().
getTime
(),
satellite
.
getTLE
().
getName
());
return
pos
;
}
...
...
src/satellite/TrackerList.java
View file @
7e3dd6df
...
...
@@ -5,39 +5,38 @@ import java.util.List;
public
class
TrackerList
{
private
static
List
<
tracker
>
threadList
=
new
ArrayList
<
tracker
>();
private
static
List
<
SatelliteTrack
>
threadList
=
new
ArrayList
<
SatelliteTrack
>();
public
static
void
startTrack
(
String
sat
,
String
gs
){
int
satNum
=
SatelliteDB
.
getSatIndex
(
sat
);
SatelliteTrack
satellite
=
SatelliteDB
.
sat
(
satNum
);
threadList
.
add
(
new
tracker
(
satellite
));
threadList
.
get
(
threadList
.
size
()-
1
).
start
();
threadList
.
add
(
satellite
);
}
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
(
);
if
(
threadList
.
get
(
i
).
getTLE
().
getName
()
.
equals
(
sat
)){
threadList
.
remove
(
i
);
}
}
}
public
static
satPosition
getSatPos
(
String
sat
){
int
satNum
=
searchThread
(
sat
);
return
threadList
.
get
(
satNum
).
sat
.
getPosition
();
return
threadList
.
get
(
satNum
).
getPosition
();
}
public
static
List
<
satPosition
>
getTracks
(){
List
<
satPosition
>
positions
=
new
ArrayList
<
satPosition
>();
for
(
int
i
=
0
;
i
<
threadList
.
size
();
i
++){
positions
.
add
(
threadList
.
get
(
i
).
getPos
());
positions
.
add
(
threadList
.
get
(
i
).
getPos
ition
());
}
return
positions
;
}
private
static
int
searchThread
(
String
sat
){
for
(
int
i
=
0
;
i
<
threadList
.
size
();
i
++){
if
(
sat
.
trim
().
equals
(
threadList
.
get
(
i
).
name
)){
if
(
sat
.
trim
().
equals
(
threadList
.
get
(
i
).
getTLE
().
getName
()
)){
return
i
;
}
}
...
...
src/satellite/satPosition.java
View file @
7e3dd6df
...
...
@@ -28,6 +28,15 @@ public class satPosition{
this
.
time
=
new
Date
();
}
public
satPosition
(
double
lat
,
double
lon
,
double
alt
,
Date
time
,
String
name
)
{
super
();
this
.
lat
=
lat
;
this
.
lon
=
lon
;
this
.
alt
=
alt
;
this
.
name
=
name
;
this
.
time
=
time
;
}
public
String
getName
(){
return
name
;
}
...
...
src/satellite/tracker.java
deleted
100644 → 0
View file @
32f98c7a
package
satellite
;
public
class
tracker
extends
Thread
{
public
tracker
(
SatelliteTrack
satellite
){
this
.
sat
=
satellite
;
this
.
name
=
satellite
.
getTLE
().
getName
();
this
.
image
=
satellite
.
getImage
();
this
.
color
=
satellite
.
getTrackColor
();
}
public
String
name
;
public
SatelliteTrack
sat
;
String
image
;
String
color
;
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
();
}
}
}
public
satPosition
getPos
(){
satPosition
satPos
=
new
satPosition
(
sat
.
getPosition
().
getLat
(),
sat
.
getPosition
().
getLon
(),
sat
.
getPosition
().
getAlt
(),
sat
.
getTLE
().
getName
());
return
satPos
;
}
}
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