feat(ftmap): a layer for who hears me
The map drew one direction of every path on it: what this receiver decoded. The reverse — which stations are reporting our own transmissions — is the half an operator cannot see from their own radio, and on FT8 it is the half that decides whether calling is worth the cycle. It is the narrowest slice of the PSK Reporter feed there is. The v2 topic is pskr/filter/v2/<band>/<mode>/<tx call>/<rx call>/… so putting the operator's callsign in the TRANSMIT level makes the broker send nothing else. For scale, from internal/pskr's own measured numbers: four bands unfiltered is 83 messages a second, filtered on the receiver's square 0.2 to 1.2 a second — one callsign in the transmit level is a handful per FT8 cycle however open the band is. Both grids are in the payload, so the arc is arithmetic and there is no lookup. internal/pskrme, with its own connection, for the same reason internal/pskrtgt has its own: the three want slices of the feed that cannot be filtered out of one another. It also means this keeps working with the band-opening watch off — hanging it off that feed's lifecycle would have made it fail silently for anyone not chasing openings. Nothing is persisted. One entry per STATION inside a fifteen-minute window, carrying its freshest report: PSK Reporter's uploaders batch, many every five minutes, so a tighter window would show a fraction of who actually heard the last few calls. Stop clears the window, or switching the layer back on would redraw who heard us before it was on. On the map the layer is dashed and single-coloured. Solid is what we decoded, dashed is somebody decoding us; colour alone could not carry that distinction next to fourteen band colours. The receivers are rings rather than filled dots for the same reason. Per profile, since the callsign IS the subscription — a switch resubscribes rather than going on reporting who hears the previous station.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import L from 'leaflet';
|
||||
import 'leaflet/dist/leaflet.css';
|
||||
import { gridToLatLon, greatCirclePoints, splitAtAntimeridian } from '@/lib/maidenhead';
|
||||
@@ -8,6 +8,8 @@ import { useI18n } from '@/lib/i18n';
|
||||
import { loadMapView, saveMapView, MAP_VIEW_FT } from '@/lib/mapView';
|
||||
import { loadMapBase, saveMapBase, MAP_BASE_FT } from '@/lib/mapBase';
|
||||
import { writeUiPref } from '@/lib/uiPref';
|
||||
import { GetHearMe, SetHearMe, GetWhoHearsMe } from '../../wailsjs/go/main/App';
|
||||
import { Ear } from 'lucide-react';
|
||||
|
||||
// FT Map — the live decode feed as geography: every station decoded in the
|
||||
// last half hour, an arc from the operator's own square to theirs, coloured by
|
||||
@@ -56,6 +58,18 @@ const COL_KEY = 'opslog.ftMapColour';
|
||||
// treated as no choice at all rather than driving the swatch to black.
|
||||
const asHex = (v: string) => (/^#[0-9a-f]{6}$/i.test(v.trim()) ? v.trim() : '');
|
||||
|
||||
// One station reporting our own transmissions, from PSK Reporter.
|
||||
type Heard = { call: string; grid: string; band: string; mode: string; snr: number; at: string };
|
||||
|
||||
// The reverse layer is DASHED, and in one colour whatever the band.
|
||||
//
|
||||
// The two layers answer opposite questions and must not be readable as one
|
||||
// palette: solid is what this receiver heard, dashed is what someone else
|
||||
// heard of us. Colour alone would not do it — the decode arcs already use
|
||||
// fourteen of them, and a fifteenth would just look like another band.
|
||||
const HEARD_COLOUR = '#22d3ee';
|
||||
const HEARD_DASH = '5 4';
|
||||
|
||||
const MAX_ARCS = 300;
|
||||
const MAX_AGE_MS = 30 * 60_000;
|
||||
|
||||
@@ -69,6 +83,11 @@ export function FTMapPanel({ decodes, myGrid, onSelect, onCall }: {
|
||||
// Held in refs so the redraw below does not have to list them as dependencies
|
||||
// and rebuild every arc whenever the parent re-renders.
|
||||
const [colour, setColour] = useState(() => asHex(localStorage.getItem(COL_KEY) ?? ''));
|
||||
// Whether the reverse feed is wanted lives in the DB, not here: it is what
|
||||
// starts an MQTT subscription, so the backend has to be the one that knows.
|
||||
const [hearMe, setHearMe] = useState(false);
|
||||
const [heard, setHeard] = useState<Heard[]>([]);
|
||||
const [heardBusy, setHeardBusy] = useState(false);
|
||||
const selectRef = useRef(onSelect);
|
||||
const callRef = useRef(onCall);
|
||||
useEffect(() => { selectRef.current = onSelect; callRef.current = onCall; }, [onSelect, onCall]);
|
||||
@@ -84,6 +103,10 @@ export function FTMapPanel({ decodes, myGrid, onSelect, onCall }: {
|
||||
const divRef = useRef<HTMLDivElement>(null);
|
||||
const mapRef = useRef<L.Map | null>(null);
|
||||
const layerRef = useRef<L.LayerGroup | null>(null);
|
||||
// Its own group: the reverse layer refreshes on its own clock, and clearing
|
||||
// the decode arcs to redraw it would throw away three hundred polylines
|
||||
// every twenty seconds for nothing.
|
||||
const heardLayerRef = useRef<L.LayerGroup | null>(null);
|
||||
const baseRef = useRef<L.TileLayer | null>(null);
|
||||
const labelsRef = useRef<L.TileLayer | null>(null);
|
||||
const [basemap, setBasemap] = useState<BasemapKey>(() =>
|
||||
@@ -111,6 +134,7 @@ export function FTMapPanel({ decodes, myGrid, onSelect, onCall }: {
|
||||
});
|
||||
mapRef.current = m;
|
||||
layerRef.current = L.layerGroup().addTo(m);
|
||||
heardLayerRef.current = L.layerGroup().addTo(m);
|
||||
// Leaflet measures its container ONCE, when the map is created, and then
|
||||
// draws tiles for that size for ever. This panel is mounted the moment its
|
||||
// tab is selected — before the flex layout has settled — and the window can
|
||||
@@ -129,6 +153,7 @@ export function FTMapPanel({ decodes, myGrid, onSelect, onCall }: {
|
||||
m.remove();
|
||||
mapRef.current = null;
|
||||
layerRef.current = null;
|
||||
heardLayerRef.current = null;
|
||||
};
|
||||
}, []);
|
||||
|
||||
@@ -148,6 +173,34 @@ export function FTMapPanel({ decodes, myGrid, onSelect, onCall }: {
|
||||
saveMapBase(MAP_BASE_FT, basemap);
|
||||
}, [basemap]);
|
||||
|
||||
useEffect(() => { GetHearMe().then((v) => setHearMe(!!v)).catch(() => {}); }, []);
|
||||
|
||||
// Polled rather than pushed: the reports arrive from the broker in batches
|
||||
// whenever an uploader gets round to it, and a fifteen-minute window redrawn
|
||||
// every twenty seconds is as live as the data underneath it actually is.
|
||||
const loadHeard = useCallback(() => {
|
||||
GetWhoHearsMe().then((r: any) => setHeard((Array.isArray(r) ? r : []) as Heard[])).catch(() => {});
|
||||
}, []);
|
||||
useEffect(() => {
|
||||
if (!hearMe) { setHeard([]); return; }
|
||||
loadHeard();
|
||||
const id = window.setInterval(loadHeard, 20_000);
|
||||
return () => window.clearInterval(id);
|
||||
}, [hearMe, loadHeard]);
|
||||
|
||||
const toggleHearMe = async () => {
|
||||
setHeardBusy(true);
|
||||
const next = !hearMe;
|
||||
try {
|
||||
await SetHearMe(next);
|
||||
setHearMe(next);
|
||||
} catch {
|
||||
// The usual cause is no station callsign, which is what it subscribes
|
||||
// to. Read the state back rather than assuming either way.
|
||||
try { setHearMe(!!(await GetHearMe())); } catch { /* leave it */ }
|
||||
} finally { setHeardBusy(false); }
|
||||
};
|
||||
|
||||
// The arcs, redrawn when the decode list changes. Newest last so they paint
|
||||
// on top; opacity falls with age so the map reads as "now" with a memory.
|
||||
useEffect(() => {
|
||||
@@ -214,6 +267,37 @@ export function FTMapPanel({ decodes, myGrid, onSelect, onCall }: {
|
||||
}
|
||||
}, [decodes, myGrid, colour]);
|
||||
|
||||
// The reverse layer. Drawn from OUR square outwards to each station that
|
||||
// reported us, dashed, so the direction of the claim is legible: a solid arc
|
||||
// is something this receiver decoded, a dashed one is somebody else
|
||||
// decoding us.
|
||||
useEffect(() => {
|
||||
const layer = heardLayerRef.current;
|
||||
if (!layer) return;
|
||||
layer.clearLayers();
|
||||
const from = gridToLatLon(myGrid);
|
||||
if (!from || !hearMe) return;
|
||||
const now = Date.now();
|
||||
for (const h of heard) {
|
||||
const to = gridToLatLon(h.grid);
|
||||
if (!to) continue;
|
||||
const ageMin = Math.max(0, Math.round((now - Date.parse(h.at)) / 60_000));
|
||||
const label = `${h.call} · ${h.grid} · ${h.snr > 0 ? '+' : ''}${h.snr} dB · ${h.band}${ageMin > 0 ? ` · ${ageMin}'` : ''}`;
|
||||
const pts = splitAtAntimeridian(greatCirclePoints(from.lat, from.lon, to.lat, to.lon, 48));
|
||||
L.polyline(pts as L.LatLngExpression[][], {
|
||||
color: HEARD_COLOUR, weight: 1.2, opacity: 0.7, dashArray: HEARD_DASH, smoothFactor: 0,
|
||||
}).addTo(layer);
|
||||
// A ring, not a disc: the decode dots are filled, and a receiver of ours
|
||||
// is a different kind of thing in the same place on the map.
|
||||
L.circleMarker([to.lat, to.lon], {
|
||||
radius: 4, color: HEARD_COLOUR, weight: 1.6, fillOpacity: 0,
|
||||
}).bindTooltip(label, { direction: 'top' }).addTo(layer);
|
||||
L.circleMarker([to.lat, to.lon], {
|
||||
radius: 9, opacity: 0, fillOpacity: 0, interactive: true,
|
||||
}).bindTooltip(label, { direction: 'top' }).addTo(layer);
|
||||
}
|
||||
}, [heard, hearMe, myGrid]);
|
||||
|
||||
const bands = [...new Set(decodes.map((d) => (d.band ?? '').toLowerCase()).filter(Boolean))];
|
||||
return (
|
||||
// isolate: Leaflet stacks its panes and controls up to z-index 1000, which
|
||||
@@ -246,7 +330,28 @@ export function FTMapPanel({ decodes, myGrid, onSelect, onCall }: {
|
||||
onClick={() => { setColour(''); writeUiPref(COL_KEY, ''); }}
|
||||
className="px-1 text-[11px] text-muted-foreground hover:text-foreground">↺</button>
|
||||
)}
|
||||
<span className="mx-0.5 w-px self-stretch bg-border" />
|
||||
{/* The reverse layer. A switch, not a filter: it starts a subscription
|
||||
at the broker, so it is off until asked for. */}
|
||||
<button type="button" onClick={toggleHearMe} disabled={heardBusy}
|
||||
title={t('ftmap.hearMeTip')}
|
||||
className={cn('flex items-center gap-1 px-1.5 h-6 rounded text-[11px] disabled:opacity-50',
|
||||
hearMe ? 'font-semibold' : 'text-muted-foreground hover:bg-muted')}
|
||||
style={hearMe ? { color: HEARD_COLOUR } : undefined}>
|
||||
<Ear className="size-3" />
|
||||
{t('ftmap.hearMe')}
|
||||
{hearMe && <span className="tabular-nums opacity-80">{heard.length}</span>}
|
||||
</button>
|
||||
</div>
|
||||
{/* What the dashed arcs are. In the legend rather than a tooltip because
|
||||
it is the only thing on the map that is not a decode of ours, and an
|
||||
unexplained second style is worse than none. */}
|
||||
{hearMe && heard.length > 0 && (
|
||||
<div className="absolute bottom-2 right-2 z-[1000] flex items-center gap-1.5 rounded-md bg-background/85 backdrop-blur px-2 py-1.5 border border-border text-[11px]">
|
||||
<span className="inline-block w-4 border-t-2 border-dashed" style={{ borderColor: HEARD_COLOUR }} />
|
||||
{t('ftmap.hearMeLegend', { n: heard.length })}
|
||||
</div>
|
||||
)}
|
||||
{/* Band legend — only the bands actually on screen. With one colour
|
||||
forced it keeps the band NAMES and drops the swatches: which bands
|
||||
are up is still worth knowing, a colour key that no longer maps to
|
||||
|
||||
@@ -199,7 +199,7 @@ const en: Dict = {
|
||||
'wlc.title': 'Contest', 'wlc.pattern': 'Auto-add on', 'wlc.patternPh': 'WWA', 'wlc.patternHint': 'any spotted callsign CONTAINING this joins the watchlist as a contest entry (TM29WWA, HB9WWA, F4WWA/P)',
|
||||
'wlc.calls': 'And these callsigns, one per line', 'wlc.callsPh': 'R7W DL0ABC', 'wlc.callsHint': 'For the entries a pattern cannot catch: a station taking part under a callsign that says nothing about the event. Named here, it joins the contest watchlist the moment it is spotted. Commas and spaces work too.',
|
||||
// FTx decodes panel (Tools -> FT decodes)
|
||||
'ftmap.tab': 'FT Map', 'ftmap.noGrid': 'Set your station grid in Preferences to place the map.', 'ftmap.colour': 'One colour for every decode, whatever the band', 'ftmap.colourPerBand': 'Back to the colour per band', 'dec.tab': 'FT decodes', 'dec.title': 'Decodes', 'dec.bandDrift': '{app} says {dec}, the rig is on {rig}', 'dec.bandDriftApp': 'the decoder', 'dec.bandDriftTip': 'The decoding application is announcing a band the radio is not on — it has most likely lost its CAT link and is repeating the last frequency it knew. Every decode below carries that band, so the NEW / NEW BAND verdicts are judged against it.', 'dec.cqOnly': 'CQ only', 'dec.sortTip': 'Sort this slot by this column. Click again to reverse it, once more for the order the decoder heard them in.',
|
||||
'ftmap.tab': 'FT Map', 'ftmap.noGrid': 'Set your station grid in Preferences to place the map.', 'ftmap.colour': 'One colour for every decode, whatever the band', 'ftmap.colourPerBand': 'Back to the colour per band', 'ftmap.hearMe': 'Who hears me', 'ftmap.hearMeTip': 'Draw the stations reporting your own transmissions to PSK Reporter, dashed, alongside what you decode. Watches one topic — your callsign — so it costs almost nothing.', 'ftmap.hearMeLegend': 'reporting you ({n})', 'dec.tab': 'FT decodes', 'dec.title': 'Decodes', 'dec.bandDrift': '{app} says {dec}, the rig is on {rig}', 'dec.bandDriftApp': 'the decoder', 'dec.bandDriftTip': 'The decoding application is announcing a band the radio is not on — it has most likely lost its CAT link and is repeating the last frequency it knew. Every decode below carries that band, so the NEW / NEW BAND verdicts are judged against it.', 'dec.cqOnly': 'CQ only', 'dec.sortTip': 'Sort this slot by this column. Click again to reverse it, once more for the order the decoder heard them in.',
|
||||
'dec.allBands': 'All bands', 'dec.allModes': 'All modes', 'toast.qsoLogged': 'QSO logged', 'dec.contsHint': 'Continents: click to keep one or several', 'dec.allConts': 'All continents',
|
||||
'dec.minSnrTitle': 'Hide anything weaker than this SNR', 'dec.searchPh': 'Call, grid or message',
|
||||
'dec.clearFilters': 'Clear', 'dec.live': 'live', 'dec.tx': 'TX',
|
||||
@@ -840,7 +840,7 @@ const fr: Dict = {
|
||||
'wlc.title': 'Contest', 'wlc.pattern': 'Ajout auto sur', 'wlc.patternPh': 'WWA', 'wlc.patternHint': 'tout indicatif spotté CONTENANT ceci rejoint la watchlist comme entrée contest (TM29WWA, HB9WWA, F4WWA/P)',
|
||||
'wlc.calls': 'Et ces indicatifs, un par ligne', 'wlc.callsPh': 'R7W DL0ABC', 'wlc.callsHint': 'Pour les participants qu’aucun motif ne peut attraper : une station engagée sous un indicatif qui ne dit rien de l’événement. Nommée ici, elle rejoint la watchlist contest dès qu’elle est spottée. Les virgules et les espaces marchent aussi.',
|
||||
// Panneau des decodes FTx (Outils -> Decodes FT)
|
||||
'ftmap.tab': 'FT Map', 'ftmap.noGrid': 'Renseigne ton locator dans les Préférences pour placer la carte.', 'ftmap.colour': 'Une seule couleur pour tous les décodages, quelle que soit la bande', 'ftmap.colourPerBand': 'Revenir à la couleur par bande', 'dec.tab': 'Decodes FT', 'dec.title': 'Decodes', 'dec.bandDrift': '{app} annonce {dec}, le poste est sur {rig}', 'dec.bandDriftApp': 'le décodeur', 'dec.bandDriftTip': 'Le logiciel de décodage annonce une bande sur laquelle la radio n’est pas — il a très probablement perdu sa liaison CAT et répète la dernière fréquence connue. Tous les décodages ci-dessous portent cette bande, et les verdicts NOUVEAU / NOUVELLE BANDE sont jugés dessus.', 'dec.cqOnly': 'CQ seulement', 'dec.sortTip': 'Trier ce créneau sur cette colonne. Un second clic inverse, un troisième rend l’ordre dans lequel le décodeur les a entendus.',
|
||||
'ftmap.tab': 'FT Map', 'ftmap.noGrid': 'Renseigne ton locator dans les Préférences pour placer la carte.', 'ftmap.colour': 'Une seule couleur pour tous les décodages, quelle que soit la bande', 'ftmap.colourPerBand': 'Revenir à la couleur par bande', 'ftmap.hearMe': 'Qui m’entend', 'ftmap.hearMeTip': 'Trace en pointillés les stations qui rapportent vos émissions à PSK Reporter, à côté de ce que vous décodez. Un seul topic surveillé — votre indicatif — donc un coût quasi nul.', 'ftmap.hearMeLegend': 'vous rapportent ({n})', 'dec.tab': 'Decodes FT', 'dec.title': 'Decodes', 'dec.bandDrift': '{app} annonce {dec}, le poste est sur {rig}', 'dec.bandDriftApp': 'le décodeur', 'dec.bandDriftTip': 'Le logiciel de décodage annonce une bande sur laquelle la radio n’est pas — il a très probablement perdu sa liaison CAT et répète la dernière fréquence connue. Tous les décodages ci-dessous portent cette bande, et les verdicts NOUVEAU / NOUVELLE BANDE sont jugés dessus.', 'dec.cqOnly': 'CQ seulement', 'dec.sortTip': 'Trier ce créneau sur cette colonne. Un second clic inverse, un troisième rend l’ordre dans lequel le décodeur les a entendus.',
|
||||
'dec.allBands': 'Toutes bandes', 'dec.allModes': 'Tous modes', 'toast.qsoLogged': 'QSO enregistré', 'dec.contsHint': 'Continents : clique pour en garder un ou plusieurs', 'dec.allConts': 'Tous continents',
|
||||
'dec.minSnrTitle': 'Masquer tout ce qui est plus faible que ce rapport', 'dec.searchPh': 'Indicatif, locator ou message',
|
||||
'dec.clearFilters': 'Effacer', 'dec.live': 'en direct', 'dec.tx': 'TX',
|
||||
|
||||
Vendored
+9
@@ -14,6 +14,7 @@ import {bandopen} from '../models';
|
||||
import {cluster} from '../models';
|
||||
import {dxped} from '../models';
|
||||
import {extsvc} from '../models';
|
||||
import {pskrme} from '../models';
|
||||
import {powergenius} from '../models';
|
||||
import {pskrtgt} from '../models';
|
||||
import {pskr} from '../models';
|
||||
@@ -517,6 +518,10 @@ export function GetGridCacheStatus():Promise<main.GridCacheStatus>;
|
||||
|
||||
export function GetGridScopeSettings():Promise<main.GridScopeSettings>;
|
||||
|
||||
export function GetHearMe():Promise<boolean>;
|
||||
|
||||
export function GetHearMeStatus():Promise<pskrme.Status>;
|
||||
|
||||
export function GetIcomState():Promise<cat.IcomTXState>;
|
||||
|
||||
export function GetKenwoodState():Promise<cat.KenwoodTXState>;
|
||||
@@ -667,6 +672,8 @@ export function GetWebPublishStatus():Promise<main.WebPublishStatus>;
|
||||
|
||||
export function GetWhatsNew():Promise<Array<main.ChangelogEntry>>;
|
||||
|
||||
export function GetWhoHearsMe():Promise<Array<pskrme.Report>>;
|
||||
|
||||
export function GetWinkeyerSettings():Promise<main.WinkeyerSettings>;
|
||||
|
||||
export function GetWinkeyerStatus():Promise<winkeyer.Status>;
|
||||
@@ -1235,6 +1242,8 @@ export function SetDVKLabel(arg1:number,arg2:string):Promise<void>;
|
||||
|
||||
export function SetFlexRSTChaseEnabled(arg1:boolean):Promise<void>;
|
||||
|
||||
export function SetHearMe(arg1:boolean):Promise<void>;
|
||||
|
||||
export function SetKenwoodAFGain(arg1:number):Promise<void>;
|
||||
|
||||
export function SetKenwoodAGC(arg1:string):Promise<void>;
|
||||
|
||||
@@ -966,6 +966,14 @@ export function GetGridScopeSettings() {
|
||||
return window['go']['main']['App']['GetGridScopeSettings']();
|
||||
}
|
||||
|
||||
export function GetHearMe() {
|
||||
return window['go']['main']['App']['GetHearMe']();
|
||||
}
|
||||
|
||||
export function GetHearMeStatus() {
|
||||
return window['go']['main']['App']['GetHearMeStatus']();
|
||||
}
|
||||
|
||||
export function GetIcomState() {
|
||||
return window['go']['main']['App']['GetIcomState']();
|
||||
}
|
||||
@@ -1266,6 +1274,10 @@ export function GetWhatsNew() {
|
||||
return window['go']['main']['App']['GetWhatsNew']();
|
||||
}
|
||||
|
||||
export function GetWhoHearsMe() {
|
||||
return window['go']['main']['App']['GetWhoHearsMe']();
|
||||
}
|
||||
|
||||
export function GetWinkeyerSettings() {
|
||||
return window['go']['main']['App']['GetWinkeyerSettings']();
|
||||
}
|
||||
@@ -2402,6 +2414,10 @@ export function SetFlexRSTChaseEnabled(arg1) {
|
||||
return window['go']['main']['App']['SetFlexRSTChaseEnabled'](arg1);
|
||||
}
|
||||
|
||||
export function SetHearMe(arg1) {
|
||||
return window['go']['main']['App']['SetHearMe'](arg1);
|
||||
}
|
||||
|
||||
export function SetKenwoodAFGain(arg1) {
|
||||
return window['go']['main']['App']['SetKenwoodAFGain'](arg1);
|
||||
}
|
||||
|
||||
@@ -5451,6 +5451,74 @@ export namespace pskr {
|
||||
|
||||
}
|
||||
|
||||
export namespace pskrme {
|
||||
|
||||
export class Report {
|
||||
call: string;
|
||||
grid: string;
|
||||
band: string;
|
||||
mode: string;
|
||||
snr: number;
|
||||
freq_hz: number;
|
||||
// Go type: time
|
||||
at: any;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new Report(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) source = JSON.parse(source);
|
||||
this.call = source["call"];
|
||||
this.grid = source["grid"];
|
||||
this.band = source["band"];
|
||||
this.mode = source["mode"];
|
||||
this.snr = source["snr"];
|
||||
this.freq_hz = source["freq_hz"];
|
||||
this.at = this.convertValues(source["at"], null);
|
||||
}
|
||||
|
||||
convertValues(a: any, classs: any, asMap: boolean = false): any {
|
||||
if (!a) {
|
||||
return a;
|
||||
}
|
||||
if (a.slice && a.map) {
|
||||
return (a as any[]).map(elem => this.convertValues(elem, classs));
|
||||
} else if ("object" === typeof a) {
|
||||
if (asMap) {
|
||||
for (const key of Object.keys(a)) {
|
||||
a[key] = new classs(a[key]);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
return new classs(a);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
}
|
||||
export class Status {
|
||||
enabled: boolean;
|
||||
online: boolean;
|
||||
reports: number;
|
||||
watching: string;
|
||||
error: string;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new Status(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) source = JSON.parse(source);
|
||||
this.enabled = source["enabled"];
|
||||
this.online = source["online"];
|
||||
this.reports = source["reports"];
|
||||
this.watching = source["watching"];
|
||||
this.error = source["error"];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export namespace pskrtgt {
|
||||
|
||||
export class Bin {
|
||||
|
||||
Reference in New Issue
Block a user