-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ivan Stanojevic
committed
Feb 27, 2021
1 parent
d43a892
commit 5d5a347
Showing
3 changed files
with
44 additions
and
46 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,123 +1,121 @@ | ||
import {LineNumber} from "./LineNumber"; | ||
import { LineNumber } from "./LineNumber" | ||
|
||
export class Tle { | ||
public satelliteId: number; | ||
public name: string; | ||
public line1: string; | ||
public line2: string; | ||
public satelliteId: number | ||
public name: string | ||
public line1: string | ||
public line2: string | ||
|
||
constructor(tleModel: any) { | ||
this.satelliteId = tleModel.satelliteId; | ||
this.name = tleModel.name; | ||
this.line1 = tleModel.line1; | ||
this.line2 = tleModel.line2; | ||
this.satelliteId = tleModel.satelliteId | ||
this.name = tleModel.name | ||
this.line1 = tleModel.line1 | ||
this.line2 = tleModel.line2 | ||
} | ||
|
||
getLine(lineNumber: LineNumber): string { | ||
if (lineNumber === LineNumber.LINE1) { | ||
return this.line1; | ||
return this.line1 | ||
} else if (lineNumber === LineNumber.LINE2) { | ||
return this.line2 | ||
} | ||
|
||
if (lineNumber === LineNumber.LINE2) { | ||
return this.line2; | ||
} | ||
|
||
return ''; | ||
return '' | ||
} | ||
|
||
getLineNumberRaw(lineNumber: LineNumber): string { | ||
const line = this.getLine(lineNumber); | ||
const line = this.getLine(lineNumber) | ||
|
||
return line.substring(0, 1); | ||
return line.substring(0, 1).trim() | ||
} | ||
|
||
getLineChecksumRaw(lineNumber: LineNumber): string { | ||
const line = this.getLine(lineNumber); | ||
const line = this.getLine(lineNumber) | ||
|
||
return line.substring(68, 69); | ||
return line.substring(68, 69).trim() | ||
} | ||
|
||
getSatelliteIdRaw(lineNumber: LineNumber): string { | ||
const line = this.getLine(lineNumber); | ||
const line = this.getLine(lineNumber) | ||
|
||
return line.substring(2, 7); | ||
return line.substring(2, 7).trim() | ||
} | ||
|
||
/** | ||
* Line 1 Data | ||
*/ | ||
getClassificationRaw(): string { | ||
return this.line1.substring(7, 8); | ||
return this.line1.substring(7, 8).trim() | ||
} | ||
|
||
getLaunchYearRaw(fourDigits: boolean = false): string { | ||
return this.line1.substring(9, 11); | ||
return this.line1.substring(9, 11).trim() | ||
} | ||
|
||
getLaunchNumberOfTheYearRaw(): string { | ||
return this.line1.substring(11, 14); | ||
return this.line1.substring(11, 14).trim() | ||
} | ||
|
||
getLaunchPieceRaw(): string { | ||
return this.line1.substring(14, 17); | ||
return this.line1.substring(14, 17).trim() | ||
} | ||
|
||
getEpochYearRaw(): string { | ||
return this.line1.substring(18, 20); | ||
return this.line1.substring(18, 20).trim() | ||
} | ||
|
||
getEpochDayRaw(): string { | ||
return this.line1.substring(20, 32); | ||
return this.line1.substring(20, 32).trim() | ||
} | ||
|
||
getFirstTimeDerivativeOfMeanMotionRaw(): string { | ||
return this.line1.substring(33, 43); | ||
return this.line1.substring(33, 43).trim() | ||
} | ||
|
||
getSecondTimeDerivativeOfMeanMotionRaw(): string { | ||
return this.line1.substring(44, 52); | ||
return this.line1.substring(44, 52).trim() | ||
} | ||
|
||
getBstarDragTermRaw(): string { | ||
return this.line1.substring(53, 61); | ||
return this.line1.substring(53, 61).trim() | ||
} | ||
|
||
getEphemerisTypeRaw(): string { | ||
return this.line1.substring(62, 63); | ||
return this.line1.substring(62, 63).trim() | ||
} | ||
|
||
getElementNumberRaw(): string { | ||
return this.line1.substring(64, 68); | ||
return this.line1.substring(64, 68).trim() | ||
} | ||
|
||
/** | ||
* Line 2 Data | ||
*/ | ||
getInclinationRaw(): string { | ||
return this.line2.substring(8, 16); | ||
return this.line2.substring(8, 16).trim() | ||
} | ||
|
||
getRightAscensionOfAscendingNodeRaw(): string { | ||
return this.line2.substring(17, 25); | ||
return this.line2.substring(17, 25).trim() | ||
} | ||
|
||
getEccentricityRaw(): string { | ||
return this.line2.substring(26, 33) | ||
return this.line2.substring(26, 33).trim() | ||
} | ||
|
||
getArgumentOfPerigeeRaw(): string { | ||
return this.line2.substring(34, 42); | ||
return this.line2.substring(34, 42).trim() | ||
} | ||
|
||
getMeanAnomalyRaw(): string { | ||
return this.line2.substring(43, 51); | ||
return this.line2.substring(43, 51).trim() | ||
} | ||
|
||
getMeanMotionRaw(): string { | ||
return this.line2.substring(52, 63); | ||
return this.line2.substring(52, 63).trim() | ||
} | ||
|
||
getRevolutionNumberRaw(): string { | ||
return this.line2.substring(63, 68); | ||
return this.line2.substring(63, 68).trim() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters