mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-06 11:24:00 +00:00
This commit is contained in:
1 parent
8b8ccc9a81
commit
003b92f64a
3 files changed
+32
-7
No files matched your search
+4
-3
@@ -95,9 +95,10 @@
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
- Keep later satellites when a TLE catalog entry is missing an orbital line.
|
- Keep later satellites when a TLE catalog entry is missing an orbital line or
|
||||||
The parser skips the incomplete set and resumes at the next complete named
|
pairs lines with mismatched NORAD catalog numbers. The parser skips corrupt sets
|
||||||
set, instead of losing the rest of the group (#906).
|
and resumes at the next complete named set, instead of losing the rest of the
|
||||||
|
group (#906, #936).
|
||||||
|
|
||||||
- Add an experimental ChatGPT/Codex OAuth option for cloud voice in Provider
|
- Add an experimental ChatGPT/Codex OAuth option for cloud voice in Provider
|
||||||
Settings. API-key voice remains the default. Local sign-in can start from
|
Settings. API-key voice remains the default. Local sign-in can start from
|
||||||
|
|||||||
+11
-4
@@ -13,7 +13,14 @@ export function parseTleText(text) {
|
|||||||
const name = lines[i];
|
const name = lines[i];
|
||||||
const line1 = lines[i + 1];
|
const line1 = lines[i + 1];
|
||||||
const line2 = lines[i + 2];
|
const line2 = lines[i + 2];
|
||||||
if (line1.startsWith('1 ') && line2.startsWith('2 ')) {
|
const cat1 = tleCatalogNumber(line1);
|
||||||
|
const cat2 = tleCatalogNumber(line2);
|
||||||
|
if (
|
||||||
|
line1.startsWith('1 ') &&
|
||||||
|
line2.startsWith('2 ') &&
|
||||||
|
cat1 !== null &&
|
||||||
|
cat1 === cat2
|
||||||
|
) {
|
||||||
result.push({ name, line1, line2 });
|
result.push({ name, line1, line2 });
|
||||||
i += 2;
|
i += 2;
|
||||||
}
|
}
|
||||||
@@ -21,8 +28,8 @@ export function parseTleText(text) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The NORAD catalog number from TLE line 1, or null. */
|
/** The NORAD catalog number from a TLE line, or null. */
|
||||||
export function tleCatalogNumber(line1) {
|
export function tleCatalogNumber(line) {
|
||||||
const number = Number.parseInt(String(line1).slice(2, 7), 10);
|
const number = Number.parseInt(String(line).slice(2, 7), 10);
|
||||||
return Number.isInteger(number) ? number : null;
|
return Number.isInteger(number) ? number : null;
|
||||||
}
|
}
|
||||||
@@ -51,6 +51,23 @@ for (const missingLine of [1, 2]) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test('TLE parsing rejects pairs with mismatched catalog numbers and resumes', () => {
|
||||||
|
const text = `SAT A
|
||||||
|
1 25544U 98067A 24001.50000000 .00016717 00000-0 30270-3 0 9994
|
||||||
|
2 48274 41.4697 175.8913 0005643 312.8370 141.6893 15.61287398150000
|
||||||
|
SAT B
|
||||||
|
1 48274U 21035A 24001.50000000 .00020137 00000-0 24481-3 0 9993
|
||||||
|
2 48274 41.4697 175.8913 0005643 312.8370 141.6893 15.61287398150000
|
||||||
|
`;
|
||||||
|
const entries = parseTleText(text);
|
||||||
|
assert.deepEqual(
|
||||||
|
entries.map((entry) => entry.name),
|
||||||
|
['SAT B'],
|
||||||
|
);
|
||||||
|
assert.equal(tleCatalogNumber(entries[0].line1), 48274);
|
||||||
|
assert.equal(tleCatalogNumber(entries[0].line2), 48274);
|
||||||
|
});
|
||||||
|
|
||||||
test('the next pass defaults to the ISS and reports times, peak and direction', async () => {
|
test('the next pass defaults to the ISS and reports times, peak and direction', async () => {
|
||||||
const catalog = composeCatalog({
|
const catalog = composeCatalog({
|
||||||
tools: coreTools,
|
tools: coreTools,
|
||||||
|
|||||||
Reference in new issue
Block a user