Skip to content

Commit

Permalink
feat: ✨ add geo satellite transponder info
Browse files Browse the repository at this point in the history
  • Loading branch information
thkruz committed Sep 19, 2024
1 parent 57ccc34 commit f2a3ddf
Show file tree
Hide file tree
Showing 10 changed files with 179 additions and 2 deletions.
File renamed without changes
1 change: 1 addition & 0 deletions public/settings/settingsOverride.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ const settingsOverride = {
polarPlot: true,
timeline: true,
timelineAlt: true,
transponderChannelData: true,
},
/*
* searchLimit: 150,
Expand Down
5 changes: 5 additions & 0 deletions src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@
"title": "Trümmer-Screening-Menü",
"helpBody": "Das Trümmer-Screening-Menü wird verwendet, um eine Liste von Trümmerobjekten zu generieren, die möglicherweise von einem Satelliten gesehen werden können. Die Liste wird durch Berechnung der Bahnparameter der Trümmerobjekte und Vergleich mit den Bahnparametern des Satelliten erstellt. Der Benutzer kann wählen, ob die Liste mit dem TLE oder dem SGP4-Propagator generiert werden soll. Der Benutzer kann auch die Liste nach der Größe des Trümmerobjekts und der Magnitude des Trümmerobjekts filtern. Der Benutzer kann auch die Liste nach der Größe des Trümmerobjekts und der Magnitude des Trümmerobjekts filtern. Der Benutzer kann auch wählen, ob die Liste mit dem TLE oder dem SGP4-Propagator generiert werden soll. Der Benutzer kann auch die Liste nach der Größe des Trümmerobjekts und der Magnitude des Trümmerobjekts filtern."
},
"TransponderChannelData": {
"bottomIconLabel": "Transponder- und Kanalinformationen",
"title": "Satelliten-Transponder- und Kanalinformationen",
"helpBody": "<p>Diese Tabelle enthält technische Details zu Satellitenkanälen, einschließlich TV-, Radio- und anderen Kommunikationsdiensten:</p><ul><li><strong>Satellit:</strong> Name des Satelliten, der den Kanal überträgt</li><li><strong>TV-Kanal:</strong> Name des TV-/Radiokanals oder Kommunikationsdienstes</li><li><strong>Ausleuchtzone:</strong> Richtung des Satellitenbeams (z.B. Westhemisphäre)</li><li><strong>Freq:</strong> Transponderfrequenz und Polarisation (z.B. 3840 V)</li><li><strong>System:</strong> Übertragungssystem (z.B. DVB-S2 8PSK)</li><li><strong>SRFEC:</strong> Symbolrate und FEC-Verhältnis (z.B. 30000 3/4)</li><li><strong>Video:</strong> Video-/Datenkompressionsformat (z.B. MPEG-4/HD)</li><li><strong>Sprache:</strong> Verfügbare Audio-/Kommunikationssprachen (z.B. Eng, Chi)</li><li><strong>Verschlüsselung:</strong> Verwendetes Verschlüsselungssystem (z.B. PowerVu)</li></ul><p>Diese Informationen sind nützlich für Satellitenkommunikationsfachleute, Techniker, Enthusiasten und jeden, der Satellitenempfangsgeräte einrichtet oder Probleme damit behebt.</p>"
},
"EditSat": {
"bottomIconLabel": "Satellit bearbeiten",
"title": "Satellit bearbeiten Menü",
Expand Down
5 changes: 5 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@
"title": "Debris Screening Menu",
"helpBody": "The Debris Screening menu is used to generate a list of debris objects that could potentially be seen by a satellite. The list is generated by calculating the orbital parameters of the debris objects and comparing them to the orbital parameters of the satellite. The user can choose to generate the list using either the TLE or the SGP4 propagator. The user can also choose to filter the list by the debris object's size and the debris object's magnitude. The user can also choose to filter the list by the debris object's size and the debris object's magnitude. The user can also choose to generate the list using either the TLE or the SGP4 propagator. The user can also choose to filter the list by the debris object's size and the debris object's magnitude."
},
"TransponderChannelData": {
"bottomIconLabel": "Transponder and Channel Info",
"title": "Satellite Transponder and Channel Info",
"helpBody": "<p>This table contains technical details for satellite channels, including TV, radio, and other communication services:</p><ul><li><strong>satellite:</strong> Name of the satellite broadcasting the channel</li><li><strong>tvchannel:</strong> Name of the TV/radio channel or communication service</li><li><strong>beam:</strong> Satellite beam direction (e.g., West hemi)</li><li><strong>freq:</strong> Transponder frequency and polarity (e.g., 3840 V)</li><li><strong>system:</strong> Broadcasting system (e.g., DVB-S2 8PSK)</li><li><strong>SRFEC:</strong> Symbol rate and FEC ratio (e.g., 30000 3/4)</li><li><strong>video:</strong> Video/data compression format (e.g., MPEG-4/HD)</li><li><strong>lang:</strong> Available audio/communication languages (e.g., Eng, Chi)</li><li><strong>encryption:</strong> Encryption system used (e.g., PowerVu)</li></ul><p>This information is useful for satellite communication professionals, technicians, enthusiasts, and anyone setting up or troubleshooting satellite reception equipment.</p>"
},
"EditSat": {
"bottomIconLabel": "Edit Satellite",
"title": "Edit Satellite Menu",
Expand Down
5 changes: 5 additions & 0 deletions src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@
"title": "Menú de Detección de Escombros",
"helpBody": "El menú de Detección de Escombros se usa para generar una lista de objetos de escombros que potencialmente podrían ser vistos por un satélite. La lista se genera calculando los parámetros orbitales de los objetos de escombros y comparándolos con los parámetros orbitales del satélite. El usuario puede elegir generar la lista usando el propagador TLE o SGP4. El usuario también puede elegir filtrar la lista por el tamaño del objeto de escombros y la magnitud del objeto de escombros. El usuario también puede elegir filtrar la lista por el tamaño del objeto de escombros y la magnitud del objeto de escombros. El usuario también puede elegir generar la lista usando el propagador TLE o SGP4. El usuario también puede elegir filtrar la lista por el tamaño del objeto de escombros y la magnitud del objeto de escombros."
},
"TransponderChannelData": {
"bottomIconLabel": "Información de Transpondedor y Canal",
"title": "Información de Transpondedor y Canal de Satélite",
"helpBody": "<p>Esta tabla contiene detalles técnicos de canales satelitales, incluyendo servicios de TV, radio y otras comunicaciones:</p><ul><li><strong>satélite:</strong> Nombre del satélite que transmite el canal</li><li><strong>tvcanal:</strong> Nombre del canal de TV/radio o servicio de comunicación</li><li><strong>haz:</strong> Dirección del haz del satélite (ej., Hemi oeste)</li><li><strong>freq:</strong> Frecuencia y polaridad del transpondedor (ej., 3840 V)</li><li><strong>sistema:</strong> Sistema de transmisión (ej., DVB-S2 8PSK)</li><li><strong>SRFEC:</strong> Tasa de símbolo y relación FEC (ej., 30000 3/4)</li><li><strong>video:</strong> Formato de compresión de video/datos (ej., MPEG-4/HD)</li><li><strong>idioma:</strong> Idiomas de audio/comunicación disponibles (ej., Ing, Chi)</li><li><strong>encriptación:</strong> Sistema de encriptación utilizado (ej., PowerVu)</li></ul><p>Esta información es útil para profesionales de comunicación satelital, técnicos, entusiastas y cualquier persona que configure o solucione problemas de equipos de recepción satelital.</p>"
},
"EditSat": {
"bottomIconLabel": "Editar Satélite",
"title": "Menú de Edición de Satélite",
Expand Down
5 changes: 5 additions & 0 deletions src/locales/locales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ export const loadLocalization = () => ({
title: i18next.t('plugins.DebrisScreening.title'),
helpBody: i18next.t('plugins.DebrisScreening.helpBody'),
},
TransponderChannelData: {
bottomIconLabel: i18next.t('plugins.TransponderChannelData.bottomIconLabel'),
title: i18next.t('plugins.TransponderChannelData.title'),
helpBody: i18next.t('plugins.TransponderChannelData.helpBody'),
},
EditSat: {
bottomIconLabel: i18next.t('plugins.EditSat.bottomIconLabel'),
title: i18next.t('plugins.EditSat.title'),
Expand Down
5 changes: 4 additions & 1 deletion src/plugins/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import { EditSat } from './edit-sat/edit-sat';
import { GamepadPlugin } from './gamepad/gamepad';
import { LaunchCalendar } from './launch-calendar/launch-calendar';
import { NewLaunch } from './new-launch/new-launch';
import { NextLaunchesPlugin } from './next-launches/next-launches';
import { NightToggle } from './night-toggle/night-toggle';
import { OrbitReferences } from './orbit-references/orbit-references';
import { Planetarium } from './planetarium/planetarium';
Expand All @@ -40,6 +39,7 @@ import { TrackingImpactPredict } from './tracking-impact-predict/tracking-impact
*/
import googleAnalytics from '@analytics/google-analytics';
import createAnalytics from 'analytics';
import { NextLaunchesPlugin } from './next-launches/next-launches';
import { PolarPlotPlugin } from './polar-plot/polar-plot';
import { ReportsPlugin } from './reports/reports';
import { SatConstellations } from './sat-constellations/sat-constellations';
Expand All @@ -64,11 +64,13 @@ import { StereoMap } from './stereo-map/stereo-map';
import { TimeMachine } from './time-machine/time-machine';
import { SatelliteTimeline } from './timeline-satellite/satellite-timeline';
import { SensorTimeline } from './timeline-sensor/sensor-timeline';
import { TransponderChannelData } from './transponder-channel-data/transponder-channel-data';
import { VideoDirectorPlugin } from './video-director/video-director';
import { WatchlistPlugin } from './watchlist/watchlist';
import { WatchlistOverlay } from './watchlist/watchlist-overlay';

export type KeepTrackPlugins = {
transponderChannelData?: boolean;
videoDirector?: boolean;
debrisScreening?: boolean;
satInfoboxCore?: boolean;
Expand Down Expand Up @@ -157,6 +159,7 @@ export const loadPlugins = (keepTrackApi: KeepTrackApi, plugins: KeepTrackPlugin
{ init: () => new TrackingImpactPredict().init(), enabled: plugins.trackingImpactPredict },
{ init: () => new Breakup().init(), enabled: plugins.breakup },
{ init: () => new DebrisScreening().init(), enabled: plugins.debrisScreening },
{ init: () => new TransponderChannelData().init(), enabled: plugins.transponderChannelData },
{ init: () => new EditSat().init(), enabled: plugins.editSat },
{ init: () => new NewLaunch().init(), enabled: plugins.newLaunch },
{ init: () => missile.init(), enabled: plugins.missile },
Expand Down
150 changes: 150 additions & 0 deletions src/plugins/transponder-channel-data/transponder-channel-data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
import { KeepTrackApiEvents } from '@app/interfaces';
import { keepTrackApi } from '@app/keepTrackApi';
import { getEl } from '@app/lib/get-el';
import { errorManagerInstance } from '@app/singletons/errorManager';
import transponderChannelDataPng from '@public/img/icons/sat-channel-freq.png';
import { BaseObject, DetailedSatellite } from 'ootk';
import { clickDragOptions, KeepTrackPlugin } from '../KeepTrackPlugin';
import { SelectSatManager } from '../select-sat-manager/select-sat-manager';

interface ChannelInfo {
satellite: string;
tvchannel: string;
beam: string;
freq: string;
system: string;
SRFEC: string;
video: string;
lang: string;
encryption: string;
}

export class TransponderChannelData extends KeepTrackPlugin {
readonly id = 'TransponderChannelData';
dependencies_ = [];
// eslint-disable-next-line max-len
private readonly satsWithChannels_: string[] = ['39508', '41588', '40424', '25924', '37393', '43039', '35942', '39078', '42934', '44479', '32794', '39237', '28868', '31102', '39127', '43450', '38107', '40982', '36745', '37810', '44186', '40272', '40941', '35696', '37933', '42942', '29055', '31306', '33436', '37775', '39285', '38778', '40364', '36581', '32299', '39079', '43632', '36592', '41029', '56757', '43463', '41238', '32019', '28943', '37677', '39157', '39017', '44067', '52255', '33051', '49125', '42907', '28935', '42967', '33207', '36499', '39008', '39233', '43700', '54259', '40425', '41589', '42741', '38992', '39773', '41382', '39020', '44334', '40875', '41310', '45985', '45986', '41191', '39612', '39613', '29236', '32951', '33376', '46114', '54243', '54244', '54026', '54741', '54742', '27445', '42814', '37264', '43228', '43633', '54048', '54225', '28358', '36097', '37238', '37834', '38356', '38740', '38749', '38098', '38867', '40271', '41581', '41748', '40874', '42818', '41747', '42950', '44476', '26824', '41903', '41471', '29272', '38331', '37749', '39728', '29349', '42984', '37265', '42691', '41034', '35362', '40147', '52904', '38014', '36830', '52817', '33373', '35873', '38342', '28526', '36032', '33749', '44048', '40146', '32252', '35756', '37779', '37826', '36831', '36516', '42432', '43488', '43175', '42709', '55970', '55971', '37809', '53961', '52933', '37748', '38087', '38652', '39172', '34941', '39460', '41380', '28945', '37606', '32768', '38991', '40733', '41904', '49055', '33274', '14787', '41944', '34111', '41036', '37602', '43611', '28786', '39500', '41552', '32487', '36033', '40613', '39481', '33056', '39522', '47306', '50212', '32767', '38332', '40345', '39022', '44307'];
bottomIconCallback: () => void = () => {
const selectedSat = keepTrackApi.getPlugin(SelectSatManager)?.primarySatObj;

// Show error if satellite is not a Payload in GEO
if (
!selectedSat ||
!selectedSat.isSatellite() ||
!this.satsWithChannels_.includes((selectedSat as DetailedSatellite).sccNum)
) {
errorManagerInstance.warn('Satellite does not have channel information');

return;
}

if (!this.isMenuButtonActive) {
return;
}


this.showTable();
this.lastLoadedSat_ = selectedSat.id;
};

private lastLoadedSat_ = -1;

addJs(): void {
super.addJs();

keepTrackApi.register({
event: KeepTrackApiEvents.selectSatData,
cbName: this.id,
cb: (obj: BaseObject) => {
if (
!obj ||
!obj.isSatellite() ||
!this.satsWithChannels_.includes((obj as DetailedSatellite).sccNum)
) {
if (this.isMenuButtonActive) {
this.closeSideMenu();
}
this.setBottomIconToDisabled();
} else {
// It is a satellite with channel information
this.setBottomIconToEnabled();

// If it is open, update the table
if (this.isMenuButtonActive && this.lastLoadedSat_ !== obj.id) {
this.showTable();
this.lastLoadedSat_ = obj.id;
}
}
},
});
}

bottomIconElementName: string = 'menu-transponderChannelData';
bottomIconImg = transponderChannelDataPng;

dragOptions: clickDragOptions = {
isDraggable: false,
maxWidth: 1000,
minWidth: 1000,
};

sideMenuElementName: string = 'transponderChannelData-menu';
sideMenuElementHtml: string = keepTrackApi.html`
<div id="transponderChannelData-menu" class="side-menu-parent start-hidden text-select">
<div id="transponderChannelData-content" class="side-menu">
<div class="row">
<h5 class="center-align">Satellite Frequencies</h5>
<table id="transponderChannelData-table" class="center-align striped-light centered"></table>
</div>
<div class="row">
<center>
<button id="export-launch-info" class="btn btn-ui waves-effect waves-light">Export Launch Info &#9658;</button>
</center>
</div>
</div>
</div>`;

isRequireSatelliteSelected: boolean = true;

showTable() {
const selectedSat = keepTrackApi.getPlugin(SelectSatManager)?.primarySatObj;

fetch(`https://api.keeptrack.space/v1/channel/${selectedSat.name}`)
.then(async (resp) => {
const data = await resp.json() as ChannelInfo[];

const tbl: HTMLTableElement = <HTMLTableElement>getEl('transponderChannelData-table');

if (!tbl) {
return;
}

tbl.innerHTML = '';
// Add a header row
const header = tbl.createTHead();
const headerRow = header.insertRow();

Object.keys(data[0]).forEach((key) => {
const th = document.createElement('th');
const h3 = document.createElement('h3');

h3.textContent = key.charAt(0).toUpperCase() + key.slice(1);
h3.style.textAlign = 'left';
th.appendChild(h3);
headerRow.appendChild(th);
});
// Loop through the data and create a table row for each item
data.forEach((info) => {
const row = tbl.insertRow();

Object.values(info).forEach((val) => {
const cell = row.insertCell();

cell.textContent = val;

});
});
})
.catch(() => errorManagerInstance.warn(`Failed to fetch channel info for ${selectedSat.name}`));
}
}
3 changes: 3 additions & 0 deletions src/settings/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export class SettingsManager {
polarPlot: true,
timeline: true,
timelineAlt: true,
transponderChannelData: true,
};

colors: ColorSchemeColorMap;
Expand Down Expand Up @@ -1026,6 +1027,8 @@ export class SettingsManager {
* When set to `false`, the system may use internal or other sources of TLE data.
*/
externalTLEsOnly = false;
positionCruncher: Worker = null;
orbitCruncher: Worker = null;

loadPersistedSettings() {
const isShowNotionalSatsString = PersistenceManager.getInstance().getItem(StorageKey.SETTINGS_NOTIONAL_SATS);
Expand Down
2 changes: 1 addition & 1 deletion src/settings/versionDate.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
export const VERSION_DATE = 'September 14, 2024';
export const VERSION_DATE = 'September 18, 2024';

0 comments on commit f2a3ddf

Please sign in to comment.