Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Starlink Tracker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Humaid Mustajab
Starlink Tracker
Commits
f9074bcb
Commit
f9074bcb
authored
Aug 24, 2020
by
Humaid Mustajab
Browse files
Options
Downloads
Patches
Plain Diff
feature parity with master
parent
c0cdad9b
No related branches found
No related tags found
1 merge request
!1
WIP: Starlink tracker react
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
back-end/data.json
+3
-2
3 additions, 2 deletions
back-end/data.json
back-end/server.js
+28
-34
28 additions, 34 deletions
back-end/server.js
with
31 additions
and
36 deletions
back-end/data.json
+
3
−
2
View file @
f9074bcb
{
"groups"
:
[
"test1"
,
"test2"
,
"test5"
,
"test10"
,
"2020.06.13"
,
"2020.06.04"
,
"2020.05.24"
,
"2020.04.22"
,
"2020.03.18"
,
"2020.02.17"
,
"2020.01.29"
,
"2020.01.07"
,
"2019.11.11"
],
"groups"
:
[
"test1"
,
"test2"
,
"test5"
,
"test10"
,
"2020.06.13"
,
"2020.06.04"
,
"2020.05.24"
,
"2020.04.22"
,
"2020.03.18"
,
"2020.02.17"
,
"2020.01.29"
,
"2020.01.07"
,
"2019.11.11"
,
"all"
],
"test1"
:
[
45730
],
"test2"
:
[
45730
,
45731
],
"test5"
:
[
45730
,
45731
,
45732
,
45733
,
45734
],
...
...
@@ -12,6 +12,7 @@
"2020.02.17"
:
[
45178
,
45179
,
45180
,
45181
,
45182
,
45183
,
45184
,
45185
,
45186
,
45187
,
45188
,
45189
,
45190
,
45191
,
45192
,
45193
,
45194
,
45195
,
45196
,
45197
,
45198
,
45199
,
45200
,
45201
,
45202
,
45203
,
45204
,
45205
,
45206
,
45207
,
45208
,
45209
,
45210
,
45212
,
45213
,
45214
,
45215
,
45216
,
45217
,
45218
,
45219
,
45220
,
45221
,
45222
,
45223
,
45224
,
45225
,
45226
,
45227
,
45228
,
45229
,
45230
,
45231
,
45232
,
45233
,
45234
,
45235
,
45236
,
45237
],
"2020.01.29"
:
[
45044
,
45045
,
45046
,
45047
,
45048
,
45049
,
45050
,
45051
,
45052
,
45053
,
45054
,
45055
,
45056
,
45057
,
45058
,
45059
,
45060
,
45061
,
45062
,
45063
,
45064
,
45065
,
45066
,
45067
,
45068
,
45069
,
45070
,
45071
,
45072
,
45073
,
45074
,
45075
,
45076
,
45077
,
45078
,
45079
,
45080
,
45081
,
45082
,
45083
,
45084
,
45085
,
45086
,
45087
,
45088
,
45089
,
45090
,
45091
,
45092
,
45093
,
45094
,
45095
,
45096
,
45097
,
45098
,
45099
,
45100
,
45101
,
45102
,
45103
],
"2020.01.07"
:
[
44914
,
44915
,
44916
,
44917
,
44918
,
44919
,
44920
,
44921
,
44922
,
44923
,
44924
,
44925
,
44926
,
44927
,
44928
,
44929
,
44930
,
44931
,
44932
,
44933
,
44934
,
44935
,
44936
,
44937
,
44938
,
44939
,
44940
,
44941
,
44942
,
44943
,
44944
,
44945
,
44946
,
44947
,
44949
,
44950
,
44951
,
44952
,
44953
,
44954
,
44955
,
44956
,
44957
,
44958
,
44959
,
44960
,
44961
,
44962
,
44963
,
44964
,
44966
,
44967
,
44968
,
44969
,
44970
,
44971
,
44972
,
44973
],
"2019.11.11"
:
[
44713
,
44714
,
44715
,
44716
,
44717
,
44718
,
44719
,
44720
,
44721
,
44722
,
44723
,
44724
,
44725
,
44726
,
44727
,
44728
,
44729
,
44730
,
44731
,
44732
,
44733
,
44734
,
44735
,
44736
,
44737
,
44738
,
44739
,
44740
,
44741
,
44742
,
44743
,
44744
,
44745
,
44746
,
44747
,
44748
,
44749
,
44750
,
44751
,
44752
,
44753
,
44754
,
44755
,
44756
,
44757
,
44758
,
44759
,
44760
,
44761
,
44762
,
44763
,
44764
,
44765
,
44766
,
44767
,
44768
,
44769
,
44770
,
44771
,
44772
]
"2019.11.11"
:
[
44713
,
44714
,
44715
,
44716
,
44717
,
44718
,
44719
,
44720
,
44721
,
44722
,
44723
,
44724
,
44725
,
44726
,
44727
,
44728
,
44729
,
44730
,
44731
,
44732
,
44733
,
44734
,
44735
,
44736
,
44737
,
44738
,
44739
,
44740
,
44741
,
44742
,
44743
,
44744
,
44745
,
44746
,
44747
,
44748
,
44749
,
44750
,
44751
,
44752
,
44753
,
44754
,
44755
,
44756
,
44757
,
44758
,
44759
,
44760
,
44761
,
44762
,
44763
,
44764
,
44765
,
44766
,
44767
,
44768
,
44769
,
44770
,
44771
,
44772
],
"all"
:
[
45730
,
45731
,
45732
,
45733
,
45734
,
45735
,
45736
,
45737
,
45738
,
45739
,
45740
,
45741
,
45742
,
45743
,
45744
,
45745
,
45746
,
45747
,
45748
,
45749
,
45750
,
45751
,
45752
,
45753
,
45754
,
45755
,
45756
,
45757
,
45758
,
45759
,
45760
,
45761
,
45762
,
45763
,
45764
,
45765
,
45766
,
45767
,
45768
,
45769
,
45770
,
45771
,
45772
,
45773
,
45774
,
45775
,
45776
,
45777
,
45778
,
45779
,
45780
,
45781
,
45782
,
45783
,
45784
,
45785
,
45786
,
45787
,
45658
,
45659
,
45660
,
45661
,
45662
,
45663
,
45664
,
45665
,
45666
,
45667
,
45668
,
45669
,
45670
,
45671
,
45672
,
45673
,
45674
,
45675
,
45676
,
45677
,
45678
,
45679
,
45680
,
45681
,
45682
,
45683
,
45684
,
45685
,
45686
,
45687
,
45688
,
45689
,
45690
,
45691
,
45692
,
45693
,
45694
,
45695
,
45696
,
45697
,
45698
,
45699
,
45700
,
45701
,
45702
,
45703
,
45704
,
45705
,
45706
,
45707
,
45708
,
45709
,
45710
,
45711
,
45712
,
45713
,
45714
,
45715
,
45716
,
44235
,
44237
,
44238
,
44239
,
44240
,
44241
,
44242
,
44243
,
44244
,
44245
,
44247
,
44248
,
44249
,
44250
,
44251
,
44252
,
44253
,
44254
,
44255
,
44256
,
44257
,
44258
,
44259
,
44260
,
44261
,
44262
,
44263
,
44264
,
44265
,
44266
,
44267
,
44268
,
44269
,
44270
,
44271
,
44272
,
44273
,
44274
,
44275
,
44276
,
44279
,
44280
,
44281
,
44282
,
44283
,
44284
,
44285
,
44286
,
44287
,
44288
,
44289
,
44290
,
44291
,
44292
,
44293
,
44294
,
45540
,
45541
,
45542
,
45543
,
45544
,
45545
,
45546
,
45547
,
45548
,
45549
,
45550
,
45551
,
45552
,
45553
,
45554
,
45555
,
45556
,
45557
,
45558
,
45559
,
45560
,
45561
,
45562
,
45563
,
45564
,
45565
,
45566
,
45567
,
45568
,
45569
,
45570
,
45571
,
45572
,
45573
,
45574
,
45575
,
45576
,
45577
,
45578
,
45579
,
45580
,
45581
,
45582
,
45583
,
45584
,
45585
,
45586
,
45587
,
45588
,
45589
,
45590
]
}
This diff is collapsed.
Click to expand it.
back-end/server.js
+
28
−
34
View file @
f9074bcb
...
...
@@ -37,8 +37,23 @@ app.listen(port, hostname, () => {
app
.
get
(
"
/serverRefresh
"
,
function
(
req
,
res
)
{
globalSatTrackCallCounter
=
0
;
res
.
sendStatus
(
200
)
})
res
.
sendStatus
(
200
);
});
// route handler for exporting sateliite positioning data to maps.js for SceneView mapping
app
.
get
(
"
/mapData
"
,
function
(
req
,
res
)
{
if
(
globalSatTrackCallCounter
==
0
)
{
mapJson
=
{
sat
:
[]
};
res
.
status
(
200
);
res
.
header
(
"
Content-Type: application/json
"
);
res
.
send
(
mapJson
);
}
else
{
mapJson
=
satJson
;
res
.
status
(
200
);
res
.
header
(
"
Content-Type: application/json
"
);
res
.
send
(
mapJson
);
}
});
// route handler for 'Track satellties on a 2D/3D Map' button
app
.
get
(
"
/satdata/tle
"
,
function
(
req
,
res
)
{
...
...
@@ -98,7 +113,7 @@ app.get("/satdata/tle", function (req, res) {
// console.log(julianSatEpochMilliSecond)
// console.log(new Date(julianSatEpochMilliSecond))
// console.log(satAttributes);
console
.
log
(
satrec
);
//
console.log(satrec);
// console.log(satRecList);
// console.log(response.data.tle); console.log(tleArray); console.log(satrec); console.log(positionAndVelocity); console.log("Done");
...
...
@@ -146,17 +161,9 @@ app.get("/satdata/pos", function (req, res) {
let
satName
=
response
.
data
.
info
[
"
satname
"
];
let
transactionCount
=
response
.
data
.
info
[
"
transactionscount
"
];
// if (rawOrbitTrackList.length !== orbitTime) {
// res.sendStatus(402).send("rawOrbitTrackList.length !== orbitTime");
// } else if (rawOrbitTrackList.length == orbitTime) {
// let orbitTrackJson = { dataPoints: []};
let
orbitTrackArray
=
[];
let
rawOrbitTrackList
=
response
.
data
[
"
positions
"
]
// console.log("Hi");
// console.log(rawOrbitTrackList);
for
(
let
orbitTimeCounter
=
0
;
orbitTimeCounter
<
orbitTime
;
orbitTimeCounter
++
)
{
let
orbitTrackAttributes
=
{}
...
...
@@ -206,33 +213,20 @@ app.get("/satdata/pos", function (req, res) {
});
// route handler for exporting sateliite positioning data to maps.js for SceneView mapping
app
.
get
(
"
/mapData
"
,
function
(
req
,
res
)
{
if
(
globalSatTrackCallCounter
==
0
)
{
mapJson
=
{
sat
:
[]
};
res
.
status
(
200
);
res
.
header
(
"
Content-Type: application/json
"
);
res
.
send
(
mapJson
);
}
else
{
mapJson
=
satJson
;
res
.
status
(
200
);
res
.
header
(
"
Content-Type: application/json
"
);
res
.
send
(
mapJson
);
}
})
app
.
get
(
"
/mapData/satrec
"
,
function
(
req
,
res
)
{
// let time = Date.now();
let
trackResponse
=
{};
let
workTime
=
time
;
for
(
let
sat
of
satRecList
)
{
let
tleTime
=
sat
.
time
;
for
(
let
i
=
0
;
i
<
60
;
i
++
)
{
tleTime
.
setSeconds
(
tleTime
.
getSeconds
()
+
i
);
for
(
let
sat
of
Object
.
keys
(
satRecList
))
{
trackResponse
[
sat
]
=
[];
for
(
let
i
=
0
;
i
<
24
*
60
;
i
++
)
{
workTime
=
workTime
+
i
*
100
;
let
date
=
new
Date
(
workTime
);
let
satRec
=
satRecList
[
sat
]
let
dateRecList
=
new
Date
(
tleTime
);
let
satLocation
=
getSatelliteLocation
(
dateRecList
,
sat
);
trackResponse
[
i
]
=
satLocation
;
let
satLocation
=
getSatelliteLocation
(
date
,
satRec
);
trackResponse
[
sat
].
push
(
satLocation
);
}
}
...
...
@@ -240,7 +234,7 @@ app.get("/mapData/satrec", function(req, res) {
res
.
header
(
"
Content-Type: application/json
"
);
// console.log(trackResponse);
res
.
send
(
trackResponse
);
})
})
;
// Function taken from ArcGis website (for now) (testing)
function
getSatelliteLocation
(
date
,
satrec
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment