ngx-kel-agent 1.2.17 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Subject, BehaviorSubject, ReplaySubject } from 'rxjs';
|
|
1
|
+
import { Subject, BehaviorSubject, ReplaySubject, timer } from 'rxjs';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { Injectable } from '@angular/core';
|
|
4
|
-
import {
|
|
4
|
+
import { toSignal } from '@angular/core/rxjs-interop';
|
|
5
|
+
import { filter, debounceTime, retry } from 'rxjs/operators';
|
|
5
6
|
import { webSocket } from 'rxjs/webSocket';
|
|
6
7
|
|
|
7
8
|
class AgentMessageService {
|
|
@@ -9,10 +10,10 @@ class AgentMessageService {
|
|
|
9
10
|
this.rxMessage$ = new Subject();
|
|
10
11
|
this.txMessage$ = new Subject();
|
|
11
12
|
}
|
|
12
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
13
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.
|
|
13
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: AgentMessageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
14
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: AgentMessageService, providedIn: 'root' }); }
|
|
14
15
|
}
|
|
15
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
16
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: AgentMessageService, decorators: [{
|
|
16
17
|
type: Injectable,
|
|
17
18
|
args: [{
|
|
18
19
|
providedIn: 'root',
|
|
@@ -41,13 +42,22 @@ class WsjtxService {
|
|
|
41
42
|
/** Subject for listening to WSJT-X "LoggedAdif" messages. */
|
|
42
43
|
this.loggedAdif$ = new Subject();
|
|
43
44
|
this.wsjtxId = 'WSJT-X';
|
|
45
|
+
this.connected = toSignal(this.connected$, { requireSync: true });
|
|
46
|
+
this.heartbeat = toSignal(this.heartbeat$, { initialValue: null });
|
|
47
|
+
this.status = toSignal(this.status$, { initialValue: null });
|
|
48
|
+
this.decode = toSignal(this.decode$, { initialValue: null });
|
|
49
|
+
this.clear = toSignal(this.clear$, { initialValue: null });
|
|
50
|
+
this.qsoLogged = toSignal(this.qsoLogged$, { initialValue: null });
|
|
51
|
+
this.close = toSignal(this.close$, { initialValue: null });
|
|
52
|
+
this.wsprDecode = toSignal(this.wsprDecode$, { initialValue: null });
|
|
53
|
+
this.loggedAdif = toSignal(this.loggedAdif$, { initialValue: null });
|
|
44
54
|
this.setupBehaviors();
|
|
45
55
|
}
|
|
46
56
|
setupBehaviors() {
|
|
47
57
|
this.messages.rxMessage$.subscribe((msg) => this.handleMessage(msg));
|
|
48
58
|
// if we haven't heard from WSJT-X in 15 seconds, consider it "down"
|
|
49
59
|
this.connected$
|
|
50
|
-
.pipe(debounceTime(15000))
|
|
60
|
+
.pipe(filter((isUp) => isUp), debounceTime(15000))
|
|
51
61
|
.subscribe(() => this.connected$.next(false));
|
|
52
62
|
// When WSJT-X announces it's closing, set it to "down" immediately
|
|
53
63
|
this.close$.subscribe(() => {
|
|
@@ -255,10 +265,10 @@ class WsjtxService {
|
|
|
255
265
|
.toString()
|
|
256
266
|
.padStart(2, '0')}${seconds.toString().padStart(2, '0')}`;
|
|
257
267
|
}
|
|
258
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
259
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.
|
|
268
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: WsjtxService, deps: [{ token: AgentMessageService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
269
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: WsjtxService, providedIn: 'root' }); }
|
|
260
270
|
}
|
|
261
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
271
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: WsjtxService, decorators: [{
|
|
262
272
|
type: Injectable,
|
|
263
273
|
args: [{
|
|
264
274
|
providedIn: 'root',
|
|
@@ -272,12 +282,16 @@ class HamlibService {
|
|
|
272
282
|
this.connected$ = new BehaviorSubject(false);
|
|
273
283
|
/** Subject for listening to Hamlib "RigState" messages. */
|
|
274
284
|
this.rigState$ = new BehaviorSubject(null);
|
|
285
|
+
this.connected = toSignal(this.connected$, { requireSync: true });
|
|
286
|
+
this.rigState = toSignal(this.rigState$, { requireSync: true });
|
|
275
287
|
this.setupBehaviors();
|
|
276
288
|
}
|
|
277
289
|
setupBehaviors() {
|
|
278
290
|
this.messages.rxMessage$.subscribe((msg) => this.handleMessage(msg));
|
|
279
291
|
// if we haven't heard from Hamlib in 15 seconds, consider it down
|
|
280
|
-
this.connected
|
|
292
|
+
this.connected$
|
|
293
|
+
.pipe(filter((isUp) => isUp), debounceTime(15000))
|
|
294
|
+
.subscribe(() => {
|
|
281
295
|
this.connected$.next(false);
|
|
282
296
|
});
|
|
283
297
|
// When Hamlib goes down, clear its persistent message subjects
|
|
@@ -298,10 +312,10 @@ class HamlibService {
|
|
|
298
312
|
return;
|
|
299
313
|
}
|
|
300
314
|
}
|
|
301
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
302
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.
|
|
315
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: HamlibService, deps: [{ token: AgentMessageService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
316
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: HamlibService, providedIn: 'root' }); }
|
|
303
317
|
}
|
|
304
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
318
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: HamlibService, decorators: [{
|
|
305
319
|
type: Injectable,
|
|
306
320
|
args: [{
|
|
307
321
|
providedIn: 'root',
|
|
@@ -323,6 +337,8 @@ class AgentService {
|
|
|
323
337
|
this.agentPort = this.defaultAgentPort;
|
|
324
338
|
this.agentWebSocketSubject = null;
|
|
325
339
|
this.agentWebsocketSubscription = null;
|
|
340
|
+
this.txMessageSubscription = null;
|
|
341
|
+
this.connected = toSignal(this.connectedState$, { requireSync: true });
|
|
326
342
|
this.hamlibState$ = this.hamlibService.connected$;
|
|
327
343
|
this.hamlibRigState$ = this.hamlibService.rigState$;
|
|
328
344
|
this.wsjtxState$ = this.wsjtxService.connected$;
|
|
@@ -336,7 +352,9 @@ class AgentService {
|
|
|
336
352
|
this.wsjtxLoggedAdif$ = this.wsjtxService.loggedAdif$;
|
|
337
353
|
}
|
|
338
354
|
init() {
|
|
339
|
-
this.
|
|
355
|
+
if (!this.txMessageSubscription) {
|
|
356
|
+
this.txMessageSubscription = this.messages.txMessage$.subscribe((msg) => this.send(msg));
|
|
357
|
+
}
|
|
340
358
|
this.agentHost = this.getHost();
|
|
341
359
|
this.agentPort = this.getPort();
|
|
342
360
|
this.connect();
|
|
@@ -351,15 +369,19 @@ class AgentService {
|
|
|
351
369
|
const protocol = this.agentHost === 'localhost' ? 'ws://' : 'wss://';
|
|
352
370
|
this.agentWebSocketSubject = webSocket({
|
|
353
371
|
url: protocol + this.agentHost + ':' + this.agentPort + '/websocket',
|
|
372
|
+
openObserver: {
|
|
373
|
+
next: () => this.connectedState$.next(true),
|
|
374
|
+
},
|
|
354
375
|
});
|
|
355
|
-
this.connectedState$.next(true);
|
|
356
376
|
this.agentWebsocketSubscription = this.agentWebSocketSubject
|
|
357
|
-
.pipe(
|
|
358
|
-
|
|
359
|
-
|
|
377
|
+
.pipe(retry({
|
|
378
|
+
delay: () => {
|
|
379
|
+
this.connectedState$.next(false);
|
|
380
|
+
return timer(10000);
|
|
381
|
+
},
|
|
382
|
+
}))
|
|
360
383
|
.subscribe({
|
|
361
384
|
next: (msg) => {
|
|
362
|
-
this.connectedState$.next(true);
|
|
363
385
|
this.messages.rxMessage$.next(msg);
|
|
364
386
|
},
|
|
365
387
|
error: () => this.connectedState$.next(false),
|
|
@@ -468,10 +490,10 @@ class AgentService {
|
|
|
468
490
|
static formatDecode(msg) {
|
|
469
491
|
return WsjtxService.formatDecode(msg);
|
|
470
492
|
}
|
|
471
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
472
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.
|
|
493
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: AgentService, deps: [{ token: AgentMessageService }, { token: HamlibService }, { token: WsjtxService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
494
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: AgentService, providedIn: 'root' }); }
|
|
473
495
|
}
|
|
474
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
496
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: AgentService, decorators: [{
|
|
475
497
|
type: Injectable,
|
|
476
498
|
args: [{
|
|
477
499
|
providedIn: 'root',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-kel-agent.mjs","sources":["../../../projects/ngx-kel-agent/src/lib/agent-message.service.ts","../../../projects/ngx-kel-agent/src/lib/wsjtx.service.ts","../../../projects/ngx-kel-agent/src/lib/hamlib.service.ts","../../../projects/ngx-kel-agent/src/lib/agent.service.ts","../../../projects/ngx-kel-agent/src/public-api.ts","../../../projects/ngx-kel-agent/src/ngx-kel-agent.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AgentMessageService {\n rxMessage$ = new Subject<any>();\n txMessage$ = new Subject<any>();\n\n constructor() {}\n}\n","import { Injectable } from '@angular/core';\nimport { BehaviorSubject, ReplaySubject, Subject } from 'rxjs';\nimport {\n WsjtxClear,\n WsjtxClose,\n WsjtxConfigure,\n WsjtxDecode,\n WsjtxFreeText,\n WsjtxHaltTx,\n WsjtxHeartbeat,\n WsjtxHighlightCallsign,\n WsjtxLocation,\n WsjtxLoggedAdif,\n WsjtxQsoLogged,\n WsjtxReplay,\n WsjtxReply,\n WsjtxStatus,\n WsjtxSwitchConfiguration,\n WsjtxWsprDecode,\n} from './wsjtx-messages';\nimport { debounceTime } from 'rxjs/operators';\nimport { AgentMessageService } from './agent-message.service';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class WsjtxService {\n /** Whether we're getting any messages from WSJT-X. */\n public readonly connected$ = new BehaviorSubject<boolean>(false);\n /** Subject for listening to WSJT-X \"Heartbeat\" messages. */\n public readonly heartbeat$ = new ReplaySubject<WsjtxHeartbeat | null>(1);\n /** Subject for listening to WSJT-X \"Status\" messages. */\n public readonly status$ = new ReplaySubject<WsjtxStatus | null>(1);\n /** Subject for listening to WSJT-X \"Decode\" messages. */\n public readonly decode$ = new Subject<WsjtxDecode>();\n /** Subject for listening to WSJT-X \"Clear\" messages. */\n public readonly clear$ = new Subject<WsjtxClear>();\n /** Subject for listening to WSJT-X \"QsoLogged\" messages. */\n public readonly qsoLogged$ = new Subject<WsjtxQsoLogged>();\n /** Subject for listening to WSJT-X \"Close\" messages. */\n public readonly close$ = new Subject<WsjtxClose>();\n /** Subject for listening to WSJT-X \"WsprDecode\" messages. */\n public readonly wsprDecode$ = new Subject<WsjtxWsprDecode>();\n /** Subject for listening to WSJT-X \"LoggedAdif\" messages. */\n public readonly loggedAdif$ = new Subject<WsjtxLoggedAdif>();\n\n private wsjtxId: string = 'WSJT-X';\n\n constructor(private messages: AgentMessageService) {\n this.setupBehaviors();\n }\n\n private setupBehaviors(): void {\n this.messages.rxMessage$.subscribe((msg) => this.handleMessage(msg));\n // if we haven't heard from WSJT-X in 15 seconds, consider it \"down\"\n this.connected$\n .pipe(debounceTime(15000))\n .subscribe(() => this.connected$.next(false));\n // When WSJT-X announces it's closing, set it to \"down\" immediately\n this.close$.subscribe(() => {\n this.connected$.next(false);\n });\n // When WSJT-X goes down, clear its persistent message subjects\n this.connected$.subscribe((isUp) => {\n if (!isUp) {\n this.heartbeat$.next(null);\n this.status$.next(null);\n }\n });\n }\n\n private handleMessage(msg: any): void {\n if (!msg.wsjtx || !msg.wsjtx.type) {\n return;\n }\n this.connected$.next(true);\n this.wsjtxId = msg.wsjtx.payload.id;\n switch (msg.wsjtx.type) {\n case 'HeartbeatMessage':\n this.heartbeat$.next(msg.wsjtx.payload as WsjtxHeartbeat);\n return;\n case 'StatusMessage':\n this.status$.next(msg.wsjtx.payload as WsjtxStatus);\n return;\n case 'DecodeMessage':\n this.decode$.next(msg.wsjtx.payload as WsjtxDecode);\n return;\n case 'ClearMessage':\n this.clear$.next(msg.wsjtx.payload as WsjtxClear);\n return;\n case 'QsoLoggedMessage':\n this.qsoLogged$.next(msg.wsjtx.payload as WsjtxQsoLogged);\n return;\n case 'CloseMessage':\n this.close$.next(msg.wsjtx.payload as WsjtxClose);\n return;\n case 'WSPRDecodeMessage':\n this.wsprDecode$.next(msg.wsjtx.payload as WsjtxWsprDecode);\n return;\n case 'LoggedAdifMessage':\n this.loggedAdif$.next(msg.wsjtx.payload as WsjtxLoggedAdif);\n return;\n }\n }\n\n /** Send a command to WSJT-X to clear the Band Activity window. */\n public clearBandActivity() {\n const wsMsg = {\n wsjtx: {\n type: 'ClearMessage',\n payload: <WsjtxClear>{ id: this.wsjtxId, window: 0 },\n },\n };\n this.messages.txMessage$.next(wsMsg);\n }\n\n /** Send a command to WSJT-X to clear the Rx Frequency window. */\n public clearRxFreqWindow() {\n const wsMsg = {\n wsjtx: {\n type: 'ClearMessage',\n payload: <WsjtxClear>{ id: this.wsjtxId, window: 1 },\n },\n };\n this.messages.txMessage$.next(wsMsg);\n }\n\n /** Send a command to WSJT-X to clear the Band Activity and Rx Frequency windows. */\n public clearAll() {\n const wsMsg = {\n wsjtx: {\n type: 'ClearMessage',\n payload: <WsjtxClear>{ id: this.wsjtxId, window: 2 },\n },\n };\n this.messages.txMessage$.next(wsMsg);\n }\n\n /** Send a command to WSJT-X to replay messages. Useful for a fresh client that wants to hear\n * previous WSJT-X decodes. */\n public replay() {\n const wsMsg = {\n wsjtx: {\n type: 'ReplayMessage',\n payload: <WsjtxReplay>{ id: this.wsjtxId },\n },\n };\n this.messages.txMessage$.next(wsMsg);\n }\n\n /** Send a command to WSJT-X to halt any transmissions immediately. */\n public haltTxNow() {\n const wsMsg = {\n wsjtx: {\n type: 'HaltTxMessage',\n payload: <WsjtxHaltTx>{ id: this.wsjtxId, autoTxOnly: false },\n },\n };\n this.messages.txMessage$.next(wsMsg);\n }\n\n /** Send a command to WSJT-X to stop auto-transmitting after finishing the current round. */\n public haltTxAfterCurrent() {\n const wsMsg = {\n wsjtx: {\n type: 'HaltTxMessage',\n payload: <WsjtxHaltTx>{ id: this.wsjtxId, autoTxOnly: true },\n },\n };\n this.messages.txMessage$.next(wsMsg);\n }\n\n /** Send a command to WSJT-X to reply to the given decode. The message must include CQ or QRZ. */\n public reply(decode: WsjtxDecode) {\n const wsMsg = {\n wsjtx: {\n type: 'ReplyMessage',\n payload: <WsjtxReply>{\n id: decode.id,\n time: decode.time,\n snr: decode.snr,\n deltaTime: decode.deltaTime,\n deltaFrequency: decode.deltaFrequency,\n mode: decode.mode,\n message: decode.message,\n lowConfidence: decode.lowConfidence,\n },\n },\n };\n this.messages.txMessage$.next(wsMsg);\n }\n\n /** Send a command to WSJT-X to reply to the given decode. The message must include CQ or QRZ. */\n public highlightCallsign(highlightMsg: WsjtxHighlightCallsign) {\n highlightMsg.id = this.wsjtxId;\n const wsMsg = {\n wsjtx: {\n type: 'HighlightCallsignMessage',\n payload: highlightMsg,\n },\n };\n this.messages.txMessage$.next(wsMsg);\n }\n\n /**\n * Send a command to WSJT-X to transmit the given free text. If the text is too long to be\n * encoded in a single message, it may be silently truncated. */\n public sendFreeText(freeText: WsjtxFreeText) {\n freeText.id = this.wsjtxId;\n const wsMsg = {\n wsjtx: {\n type: 'FreeTextMessage',\n payload: freeText,\n },\n };\n this.messages.txMessage$.next(wsMsg);\n }\n\n /** Send a command to WSJT-X to set the local station's Maidenhead grid. This is temporary,\n * lasting only as long as WSJT-X is running. */\n public setLocation(grid: string) {\n const wsMsg = {\n wsjtx: {\n type: 'LocationMessage',\n payload: <WsjtxLocation>{\n id: this.wsjtxId,\n location: grid,\n },\n },\n };\n this.messages.txMessage$.next(wsMsg);\n }\n\n /** Send a command to WSJT-X to switch to the named configuration. */\n public switchConfiguration(configName: string) {\n const wsMsg = {\n wsjtx: {\n type: 'SwitchConfigurationMessage',\n payload: <WsjtxSwitchConfiguration>{\n id: this.wsjtxId,\n configurationName: configName,\n },\n },\n };\n this.messages.txMessage$.next(wsMsg);\n }\n\n /** Send a command to WSJT-X to set the given configuration parameters. */\n public configure(config: WsjtxConfigure) {\n config.id = this.wsjtxId;\n const wsMsg = {\n wsjtx: {\n type: 'ConfigureMessage',\n payload: config,\n },\n };\n this.messages.txMessage$.next(wsMsg);\n }\n\n /** Given a decode message, format a string the same way as displayed in the WSJT-X Band\n * Activity/Rx Frequency windows. */\n public static formatDecode(msg: WsjtxDecode): string {\n const timeStr = this.formatTime(msg.time);\n return `${timeStr} ${msg.snr.toString().padStart(3)} ${msg.deltaTime\n .toFixed(1)\n .padStart(4)} ${msg.deltaFrequency.toString().padStart(4)} ~ ${\n msg.message\n }`;\n }\n\n /** Given a time in milliseconds since midnight UTC, format as HHMMSS. */\n public static formatTime(time: number) {\n const secondsSinceMidnight = Math.floor(time / 1000);\n const hours = Math.floor(secondsSinceMidnight / 3600);\n const secondsSinceHour = secondsSinceMidnight - hours * 3600;\n const minutes = Math.floor(secondsSinceHour / 60);\n const seconds = secondsSinceHour - minutes * 60;\n return `${hours.toString().padStart(2, '0')}${minutes\n .toString()\n .padStart(2, '0')}${seconds.toString().padStart(2, '0')}`;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\nimport { HamlibRigState } from './hamlib-messages';\nimport { debounceTime } from 'rxjs/operators';\nimport { AgentMessageService } from './agent-message.service';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class HamlibService {\n /** Whether we're getting any messages from Hamlib. */\n public readonly connected$ = new BehaviorSubject<boolean>(false);\n /** Subject for listening to Hamlib \"RigState\" messages. */\n public readonly rigState$ = new BehaviorSubject<HamlibRigState | null>(null);\n\n constructor(private messages: AgentMessageService) {\n this.setupBehaviors();\n }\n\n setupBehaviors(): void {\n this.messages.rxMessage$.subscribe((msg) => this.handleMessage(msg));\n // if we haven't heard from Hamlib in 15 seconds, consider it down\n this.connected$.pipe(debounceTime(15000)).subscribe(() => {\n this.connected$.next(false);\n });\n // When Hamlib goes down, clear its persistent message subjects\n this.connected$.subscribe((isUp) => {\n if (!isUp) {\n this.rigState$.next(null);\n }\n });\n }\n\n private handleMessage(msg: any): void {\n if (!msg.hamlib || !msg.hamlib.type) {\n return;\n }\n this.connected$.next(true);\n switch (msg.hamlib.type) {\n case 'RigState':\n this.rigState$.next(msg.hamlib.payload as HamlibRigState);\n return;\n }\n }\n}\n","import { AgentMessageService } from './agent-message.service';\nimport { BehaviorSubject, ReplaySubject, Subject, Subscription } from 'rxjs';\nimport { HamlibRigState } from './hamlib-messages';\nimport { HamlibService } from './hamlib.service';\nimport { Injectable } from '@angular/core';\nimport {\n WsjtxClear,\n WsjtxClose,\n WsjtxDecode,\n WsjtxHeartbeat,\n WsjtxHighlightCallsign,\n WsjtxLoggedAdif,\n WsjtxQsoLogged,\n WsjtxStatus,\n WsjtxWsprDecode,\n} from './wsjtx-messages';\nimport { WsjtxService } from './wsjtx.service';\nimport { delay, retryWhen, tap } from 'rxjs/operators';\nimport { webSocket, WebSocketSubject } from 'rxjs/webSocket';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AgentService {\n /** Whether we're connected to the agent. */\n public readonly connectedState$ = new BehaviorSubject<boolean>(false);\n\n /* WSJT-X */\n /**\n * Whether we're getting any messages from WSJT-X.\n *\n * @deprecated Use {@link WsjtxService.connected$} instead.\n */\n public readonly wsjtxState$: BehaviorSubject<boolean>;\n /**\n * Subject for listening to WSJT-X \"Heartbeat\" messages.\n *\n * @deprecated Use {@link WsjtxService.heartbeat$} instead.\n */\n public readonly wsjtxHeartbeat$: ReplaySubject<WsjtxHeartbeat | null>;\n /**\n * Subject for listening to WSJT-X \"Status\" messages.\n *\n * @deprecated Use {@link WsjtxService.status$} instead.\n */\n public readonly wsjtxStatus$: ReplaySubject<WsjtxStatus | null>;\n /**\n * Subject for listening to WSJT-X \"Decode\" messages.\n *\n * @deprecated Use {@link WsjtxService.decode$} instead.\n */\n public readonly wsjtxDecode$: Subject<WsjtxDecode>;\n /**\n * Subject for listening to WSJT-X \"Clear\" messages.\n *\n * @deprecated Use {@link WsjtxService.clear$} instead.\n */\n public readonly wsjtxClear$: Subject<WsjtxClear>;\n /**\n * Subject for listening to WSJT-X \"QsoLogged\" messages.\n *\n * @deprecated Use {@link WsjtxService.qsoLogged$} instead.\n */\n public readonly wsjtxQsoLogged$: Subject<WsjtxQsoLogged>;\n /**\n * Subject for listening to WSJT-X \"Close\" messages.\n *\n * @deprecated Use {@link WsjtxService.close$} instead.\n */\n public readonly wsjtxClose$: Subject<WsjtxClose>;\n /**\n * Subject for listening to WSJT-X \"WsprDecode\" messages.\n *\n * @deprecated Use {@link WsjtxService.wsprDecode$} instead.\n */\n public readonly wsjtxWsprDecode$: Subject<WsjtxWsprDecode>;\n /**\n * Subject for listening to WSJT-X \"LoggedAdif\" messages.\n *\n * @deprecated Use {@link WsjtxService.loggedAdif$} instead.\n */\n public readonly wsjtxLoggedAdif$: Subject<WsjtxLoggedAdif>;\n\n /* Hamlib */\n /**\n * Whether we're getting any messages from Hamlib.\n *\n * @deprecated Use {@link HamlibService.connected$} instead.\n */\n public readonly hamlibState$: BehaviorSubject<boolean>;\n /**\n * Subject for listening to Hamlib \"RigState\" messages.\n *\n * @deprecated Use {@link HamlibService.rigState$} instead.\n */\n public readonly hamlibRigState$: BehaviorSubject<HamlibRigState | null>;\n\n private readonly defaultAgentHost = 'localhost';\n private readonly defaultAgentPort = 8081;\n private readonly localStorageHostKey = 'agent-host';\n private readonly localStoragePortKey = 'agent-port';\n\n private agentHost: string = this.defaultAgentHost;\n private agentPort: number = this.defaultAgentPort;\n private agentWebSocketSubject: WebSocketSubject<object> | null = null;\n private agentWebsocketSubscription: Subscription | null = null;\n\n constructor(\n private messages: AgentMessageService,\n private hamlibService: HamlibService,\n private wsjtxService: WsjtxService,\n ) {\n this.hamlibState$ = this.hamlibService.connected$;\n this.hamlibRigState$ = this.hamlibService.rigState$;\n\n this.wsjtxState$ = this.wsjtxService.connected$;\n this.wsjtxHeartbeat$ = this.wsjtxService.heartbeat$;\n this.wsjtxStatus$ = this.wsjtxService.status$;\n this.wsjtxDecode$ = this.wsjtxService.decode$;\n this.wsjtxClear$ = this.wsjtxService.clear$;\n this.wsjtxQsoLogged$ = this.wsjtxService.qsoLogged$;\n this.wsjtxClose$ = this.wsjtxService.close$;\n this.wsjtxWsprDecode$ = this.wsjtxService.wsprDecode$;\n this.wsjtxLoggedAdif$ = this.wsjtxService.loggedAdif$;\n }\n\n public init(): void {\n this.messages.txMessage$.subscribe((msg) => this.send(msg));\n this.agentHost = this.getHost();\n this.agentPort = this.getPort();\n this.connect();\n }\n\n /** Connect (or reconnect) the websocket to the kel-agent server. */\n public connect(): void {\n if (this.agentWebsocketSubscription) {\n this.agentWebsocketSubscription.unsubscribe();\n }\n this.agentHost = this.getHost();\n this.agentPort = this.getPort();\n const protocol = this.agentHost === 'localhost' ? 'ws://' : 'wss://';\n this.agentWebSocketSubject = webSocket<object>({\n url: protocol + this.agentHost + ':' + this.agentPort + '/websocket',\n });\n this.connectedState$.next(true);\n this.agentWebsocketSubscription = this.agentWebSocketSubject\n .pipe(\n retryWhen((errors) =>\n // retry the websocket connection after 10 seconds\n errors.pipe(\n tap(() => this.connectedState$.next(false)),\n delay(10000),\n ),\n ),\n )\n .subscribe({\n next: (msg) => {\n this.connectedState$.next(true);\n this.messages.rxMessage$.next(msg);\n },\n error: () => this.connectedState$.next(false),\n complete: () => this.connectedState$.next(false),\n });\n }\n\n /** Get the currently configured kel-agent host. */\n public getHost(): string {\n return (\n localStorage.getItem(this.localStorageHostKey) || this.defaultAgentHost\n );\n }\n\n /** Get the currently configured kel-agent port. */\n public getPort(): number {\n let portStr = localStorage.getItem(this.localStoragePortKey);\n if (portStr == null) {\n return this.defaultAgentPort;\n }\n let portNum = parseInt(portStr, 10);\n if (isNaN(portNum)) {\n return this.defaultAgentPort;\n }\n return portNum;\n }\n\n /** Set the kel-agent host. */\n public setHost(host: string): void {\n localStorage.setItem(this.localStorageHostKey, host);\n this.connect();\n }\n\n /** Set the kel-agent port. */\n public setPort(port: number): void {\n localStorage.setItem(this.localStoragePortKey, String(port));\n this.connect();\n }\n\n private send(wsMsg: any) {\n this.agentWebSocketSubject?.next(wsMsg);\n }\n\n /**\n * Send a command to WSJT-X to clear the Band Activity window.\n *\n * @deprecated Use {@link WsjtxService.clearBandActivity} instead.\n */\n public sendWsjtxClearBandActivity() {\n this.wsjtxService.clearBandActivity();\n }\n\n /**\n * Send a command to WSJT-X to clear the Rx Frequency window.\n *\n * @deprecated Use {@link WsjtxService.clearRxFreqWindow} instead.\n */\n public sendWsjtxClearRxFreqWindow() {\n this.wsjtxService.clearRxFreqWindow();\n }\n\n /**\n * Send a command to WSJT-X to clear the Band Activity and Rx Frequency windows.\n *\n * @deprecated Use {@link WsjtxService.clearAll} instead.\n */\n public sendWsjtxClearAll() {\n this.wsjtxService.clearAll();\n }\n\n /**\n * Send a command to WSJT-X to replay messages. Useful for a fresh client that wants to hear\n * previous WSJT-X decodes.\n *\n * @deprecated Use {@link WsjtxService.replay} instead.\n */\n public sendWsjtxReplay() {\n this.wsjtxService.replay();\n }\n\n /**\n * Send a command to WSJT-X to halt any transmissions immediately.\n *\n * @deprecated Use {@link WsjtxService.haltTxNow} instead.\n */\n public sendWsjtxHaltTxNow() {\n this.wsjtxService.haltTxNow();\n }\n\n /** Send a command to WSJT-X to stop auto-transmitting after finishing the current round.\n *\n * @deprecated Use {@link WsjtxService.haltTxAfterCurrent} instead.\n */\n public sendWsjtxHaltTxAfterCurrent() {\n this.wsjtxService.haltTxAfterCurrent();\n }\n\n /**\n * Send a command to WSJT-X to reply to the given decode. The message must include CQ or QRZ.\n *\n * @deprecated Use {@link WsjtxService.reply} instead.\n */\n public sendWsjtxReply(decode: WsjtxDecode) {\n this.wsjtxService.reply(decode);\n }\n\n /**\n * Send a command to WSJT-X to reply to the given decode. The message must include CQ or QRZ.\n *\n * @deprecated Use {@link WsjtxService.highlightCallsign} instead.\n */\n public sendWsjtxHighlightCallsign(highlightMsg: WsjtxHighlightCallsign) {\n this.wsjtxService.highlightCallsign(highlightMsg);\n }\n\n /**\n * Given a decode message, format a string the same way as displayed in the WSJT-X Band\n * Activity/Rx Frequency windows.\n *\n * @deprecated Use {@link WsjtxService.formatDecode} instead.\n */\n public static formatDecode(msg: WsjtxDecode): string {\n return WsjtxService.formatDecode(msg);\n }\n}\n","/*\n * Public API Surface of ngx-kel-agent\n */\n\nexport * from './lib/agent.service';\nexport * from './lib/agent-message.service';\nexport * from './lib/hamlib-messages';\nexport * from './lib/hamlib.service';\nexport * from './lib/wsjtx-messages';\nexport * from './lib/wsjtx.service';\n// export * from './lib/ngx-kel-agent.component';\n// export * from './lib/ngx-kel-agent.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.AgentMessageService","i2.HamlibService","i3.WsjtxService"],"mappings":";;;;;;MAMa,mBAAmB,CAAA;AAI9B,IAAA,WAAA,GAAA;AAHA,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,OAAO,EAAO;AAC/B,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,OAAO,EAAO;IAEhB;8GAJJ,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAnB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,cAFlB,MAAM,EAAA,CAAA,CAAA;;2FAEP,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAH/B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;MCqBY,YAAY,CAAA;AAsBvB,IAAA,WAAA,CAAoB,QAA6B,EAAA;QAA7B,IAAA,CAAA,QAAQ,GAAR,QAAQ;;AApBZ,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,eAAe,CAAU,KAAK,CAAC;;AAEhD,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,aAAa,CAAwB,CAAC,CAAC;;AAExD,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,aAAa,CAAqB,CAAC,CAAC;;AAElD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;AAIG;AACI,IAAA,cAAc,CAAC,MAAmB,EAAA;AACvC,QAAA,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC;IACjC;AAEA;;;;AAIG;AACI,IAAA,0BAA0B,CAAC,YAAoC,EAAA;AACpE,QAAA,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,YAAY,CAAC;IACnD;AAEA;;;;;AAKG;IACI,OAAO,YAAY,CAAC,GAAgB,EAAA;AACzC,QAAA,OAAO,YAAY,CAAC,YAAY,CAAC,GAAG,CAAC;IACvC;8GAlQW,YAAY,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAAA,mBAAA,EAAA,EAAA,EAAA,KAAA,EAAAC,aAAA,EAAA,EAAA,EAAA,KAAA,EAAAC,YAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAZ,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,cAFX,MAAM,EAAA,CAAA,CAAA;;2FAEP,YAAY,EAAA,UAAA,EAAA,CAAA;kBAHxB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACtBD;;AAEG;AAQH;AACA;;ACXA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-kel-agent.mjs","sources":["../../../projects/ngx-kel-agent/src/lib/agent-message.service.ts","../../../projects/ngx-kel-agent/src/lib/wsjtx.service.ts","../../../projects/ngx-kel-agent/src/lib/hamlib.service.ts","../../../projects/ngx-kel-agent/src/lib/agent.service.ts","../../../projects/ngx-kel-agent/src/public-api.ts","../../../projects/ngx-kel-agent/src/ngx-kel-agent.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AgentMessageService {\n rxMessage$ = new Subject<any>();\n txMessage$ = new Subject<any>();\n\n constructor() {}\n}\n","import { Injectable, Signal } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { BehaviorSubject, ReplaySubject, Subject } from 'rxjs';\nimport {\n WsjtxClear,\n WsjtxClose,\n WsjtxConfigure,\n WsjtxDecode,\n WsjtxFreeText,\n WsjtxHaltTx,\n WsjtxHeartbeat,\n WsjtxHighlightCallsign,\n WsjtxLocation,\n WsjtxLoggedAdif,\n WsjtxQsoLogged,\n WsjtxReplay,\n WsjtxReply,\n WsjtxStatus,\n WsjtxSwitchConfiguration,\n WsjtxWsprDecode,\n} from './wsjtx-messages';\nimport { debounceTime, filter } from 'rxjs/operators';\nimport { AgentMessageService } from './agent-message.service';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class WsjtxService {\n /** Whether we're getting any messages from WSJT-X. */\n public readonly connected$ = new BehaviorSubject<boolean>(false);\n /** Signal indicating whether we're getting any messages from WSJT-X. */\n public readonly connected: Signal<boolean>;\n\n /** Subject for listening to WSJT-X \"Heartbeat\" messages. */\n public readonly heartbeat$ = new ReplaySubject<WsjtxHeartbeat | null>(1);\n /** Signal for the latest WSJT-X \"Heartbeat\" message. */\n public readonly heartbeat: Signal<WsjtxHeartbeat | null>;\n\n /** Subject for listening to WSJT-X \"Status\" messages. */\n public readonly status$ = new ReplaySubject<WsjtxStatus | null>(1);\n /** Signal for the latest WSJT-X \"Status\" message. */\n public readonly status: Signal<WsjtxStatus | null>;\n\n /** Subject for listening to WSJT-X \"Decode\" messages. */\n public readonly decode$ = new Subject<WsjtxDecode>();\n /** Signal for the latest WSJT-X \"Decode\" message. */\n public readonly decode: Signal<WsjtxDecode | null>;\n\n /** Subject for listening to WSJT-X \"Clear\" messages. */\n public readonly clear$ = new Subject<WsjtxClear>();\n /** Signal for the latest WSJT-X \"Clear\" message. */\n public readonly clear: Signal<WsjtxClear | null>;\n\n /** Subject for listening to WSJT-X \"QsoLogged\" messages. */\n public readonly qsoLogged$ = new Subject<WsjtxQsoLogged>();\n /** Signal for the latest WSJT-X \"QsoLogged\" message. */\n public readonly qsoLogged: Signal<WsjtxQsoLogged | null>;\n\n /** Subject for listening to WSJT-X \"Close\" messages. */\n public readonly close$ = new Subject<WsjtxClose>();\n /** Signal for the latest WSJT-X \"Close\" message. */\n public readonly close: Signal<WsjtxClose | null>;\n\n /** Subject for listening to WSJT-X \"WsprDecode\" messages. */\n public readonly wsprDecode$ = new Subject<WsjtxWsprDecode>();\n /** Signal for the latest WSJT-X \"WsprDecode\" message. */\n public readonly wsprDecode: Signal<WsjtxWsprDecode | null>;\n\n /** Subject for listening to WSJT-X \"LoggedAdif\" messages. */\n public readonly loggedAdif$ = new Subject<WsjtxLoggedAdif>();\n /** Signal for the latest WSJT-X \"LoggedAdif\" message. */\n public readonly loggedAdif: Signal<WsjtxLoggedAdif | null>;\n\n private wsjtxId: string = 'WSJT-X';\n\n constructor(private messages: AgentMessageService) {\n this.connected = toSignal(this.connected$, { requireSync: true });\n this.heartbeat = toSignal(this.heartbeat$, { initialValue: null });\n this.status = toSignal(this.status$, { initialValue: null });\n this.decode = toSignal(this.decode$, { initialValue: null });\n this.clear = toSignal(this.clear$, { initialValue: null });\n this.qsoLogged = toSignal(this.qsoLogged$, { initialValue: null });\n this.close = toSignal(this.close$, { initialValue: null });\n this.wsprDecode = toSignal(this.wsprDecode$, { initialValue: null });\n this.loggedAdif = toSignal(this.loggedAdif$, { initialValue: null });\n this.setupBehaviors();\n }\n\n private setupBehaviors(): void {\n this.messages.rxMessage$.subscribe((msg) => this.handleMessage(msg));\n // if we haven't heard from WSJT-X in 15 seconds, consider it \"down\"\n this.connected$\n .pipe(\n filter((isUp) => isUp),\n debounceTime(15000),\n )\n .subscribe(() => this.connected$.next(false));\n // When WSJT-X announces it's closing, set it to \"down\" immediately\n this.close$.subscribe(() => {\n this.connected$.next(false);\n });\n // When WSJT-X goes down, clear its persistent message subjects\n this.connected$.subscribe((isUp) => {\n if (!isUp) {\n this.heartbeat$.next(null);\n this.status$.next(null);\n }\n });\n }\n\n private handleMessage(msg: any): void {\n if (!msg.wsjtx || !msg.wsjtx.type) {\n return;\n }\n this.connected$.next(true);\n this.wsjtxId = msg.wsjtx.payload.id;\n switch (msg.wsjtx.type) {\n case 'HeartbeatMessage':\n this.heartbeat$.next(msg.wsjtx.payload as WsjtxHeartbeat);\n return;\n case 'StatusMessage':\n this.status$.next(msg.wsjtx.payload as WsjtxStatus);\n return;\n case 'DecodeMessage':\n this.decode$.next(msg.wsjtx.payload as WsjtxDecode);\n return;\n case 'ClearMessage':\n this.clear$.next(msg.wsjtx.payload as WsjtxClear);\n return;\n case 'QsoLoggedMessage':\n this.qsoLogged$.next(msg.wsjtx.payload as WsjtxQsoLogged);\n return;\n case 'CloseMessage':\n this.close$.next(msg.wsjtx.payload as WsjtxClose);\n return;\n case 'WSPRDecodeMessage':\n this.wsprDecode$.next(msg.wsjtx.payload as WsjtxWsprDecode);\n return;\n case 'LoggedAdifMessage':\n this.loggedAdif$.next(msg.wsjtx.payload as WsjtxLoggedAdif);\n return;\n }\n }\n\n /** Send a command to WSJT-X to clear the Band Activity window. */\n public clearBandActivity() {\n const wsMsg = {\n wsjtx: {\n type: 'ClearMessage',\n payload: <WsjtxClear>{ id: this.wsjtxId, window: 0 },\n },\n };\n this.messages.txMessage$.next(wsMsg);\n }\n\n /** Send a command to WSJT-X to clear the Rx Frequency window. */\n public clearRxFreqWindow() {\n const wsMsg = {\n wsjtx: {\n type: 'ClearMessage',\n payload: <WsjtxClear>{ id: this.wsjtxId, window: 1 },\n },\n };\n this.messages.txMessage$.next(wsMsg);\n }\n\n /** Send a command to WSJT-X to clear the Band Activity and Rx Frequency windows. */\n public clearAll() {\n const wsMsg = {\n wsjtx: {\n type: 'ClearMessage',\n payload: <WsjtxClear>{ id: this.wsjtxId, window: 2 },\n },\n };\n this.messages.txMessage$.next(wsMsg);\n }\n\n /** Send a command to WSJT-X to replay messages. Useful for a fresh client that wants to hear\n * previous WSJT-X decodes. */\n public replay() {\n const wsMsg = {\n wsjtx: {\n type: 'ReplayMessage',\n payload: <WsjtxReplay>{ id: this.wsjtxId },\n },\n };\n this.messages.txMessage$.next(wsMsg);\n }\n\n /** Send a command to WSJT-X to halt any transmissions immediately. */\n public haltTxNow() {\n const wsMsg = {\n wsjtx: {\n type: 'HaltTxMessage',\n payload: <WsjtxHaltTx>{ id: this.wsjtxId, autoTxOnly: false },\n },\n };\n this.messages.txMessage$.next(wsMsg);\n }\n\n /** Send a command to WSJT-X to stop auto-transmitting after finishing the current round. */\n public haltTxAfterCurrent() {\n const wsMsg = {\n wsjtx: {\n type: 'HaltTxMessage',\n payload: <WsjtxHaltTx>{ id: this.wsjtxId, autoTxOnly: true },\n },\n };\n this.messages.txMessage$.next(wsMsg);\n }\n\n /** Send a command to WSJT-X to reply to the given decode. The message must include CQ or QRZ. */\n public reply(decode: WsjtxDecode) {\n const wsMsg = {\n wsjtx: {\n type: 'ReplyMessage',\n payload: <WsjtxReply>{\n id: decode.id,\n time: decode.time,\n snr: decode.snr,\n deltaTime: decode.deltaTime,\n deltaFrequency: decode.deltaFrequency,\n mode: decode.mode,\n message: decode.message,\n lowConfidence: decode.lowConfidence,\n },\n },\n };\n this.messages.txMessage$.next(wsMsg);\n }\n\n /** Send a command to WSJT-X to reply to the given decode. The message must include CQ or QRZ. */\n public highlightCallsign(highlightMsg: WsjtxHighlightCallsign) {\n highlightMsg.id = this.wsjtxId;\n const wsMsg = {\n wsjtx: {\n type: 'HighlightCallsignMessage',\n payload: highlightMsg,\n },\n };\n this.messages.txMessage$.next(wsMsg);\n }\n\n /**\n * Send a command to WSJT-X to transmit the given free text. If the text is too long to be\n * encoded in a single message, it may be silently truncated. */\n public sendFreeText(freeText: WsjtxFreeText) {\n freeText.id = this.wsjtxId;\n const wsMsg = {\n wsjtx: {\n type: 'FreeTextMessage',\n payload: freeText,\n },\n };\n this.messages.txMessage$.next(wsMsg);\n }\n\n /** Send a command to WSJT-X to set the local station's Maidenhead grid. This is temporary,\n * lasting only as long as WSJT-X is running. */\n public setLocation(grid: string) {\n const wsMsg = {\n wsjtx: {\n type: 'LocationMessage',\n payload: <WsjtxLocation>{\n id: this.wsjtxId,\n location: grid,\n },\n },\n };\n this.messages.txMessage$.next(wsMsg);\n }\n\n /** Send a command to WSJT-X to switch to the named configuration. */\n public switchConfiguration(configName: string) {\n const wsMsg = {\n wsjtx: {\n type: 'SwitchConfigurationMessage',\n payload: <WsjtxSwitchConfiguration>{\n id: this.wsjtxId,\n configurationName: configName,\n },\n },\n };\n this.messages.txMessage$.next(wsMsg);\n }\n\n /** Send a command to WSJT-X to set the given configuration parameters. */\n public configure(config: WsjtxConfigure) {\n config.id = this.wsjtxId;\n const wsMsg = {\n wsjtx: {\n type: 'ConfigureMessage',\n payload: config,\n },\n };\n this.messages.txMessage$.next(wsMsg);\n }\n\n /** Given a decode message, format a string the same way as displayed in the WSJT-X Band\n * Activity/Rx Frequency windows. */\n public static formatDecode(msg: WsjtxDecode): string {\n const timeStr = this.formatTime(msg.time);\n return `${timeStr} ${msg.snr.toString().padStart(3)} ${msg.deltaTime\n .toFixed(1)\n .padStart(4)} ${msg.deltaFrequency.toString().padStart(4)} ~ ${\n msg.message\n }`;\n }\n\n /** Given a time in milliseconds since midnight UTC, format as HHMMSS. */\n public static formatTime(time: number) {\n const secondsSinceMidnight = Math.floor(time / 1000);\n const hours = Math.floor(secondsSinceMidnight / 3600);\n const secondsSinceHour = secondsSinceMidnight - hours * 3600;\n const minutes = Math.floor(secondsSinceHour / 60);\n const seconds = secondsSinceHour - minutes * 60;\n return `${hours.toString().padStart(2, '0')}${minutes\n .toString()\n .padStart(2, '0')}${seconds.toString().padStart(2, '0')}`;\n }\n}\n","import { Injectable, Signal } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { BehaviorSubject } from 'rxjs';\nimport { HamlibRigState } from './hamlib-messages';\nimport { debounceTime, filter } from 'rxjs/operators';\nimport { AgentMessageService } from './agent-message.service';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class HamlibService {\n /** Whether we're getting any messages from Hamlib. */\n public readonly connected$ = new BehaviorSubject<boolean>(false);\n /** Signal indicating whether we're getting any messages from Hamlib. */\n public readonly connected: Signal<boolean>;\n\n /** Subject for listening to Hamlib \"RigState\" messages. */\n public readonly rigState$ = new BehaviorSubject<HamlibRigState | null>(null);\n /** Signal for the latest Hamlib \"RigState\" message. */\n public readonly rigState: Signal<HamlibRigState | null>;\n\n constructor(private messages: AgentMessageService) {\n this.connected = toSignal(this.connected$, { requireSync: true });\n this.rigState = toSignal(this.rigState$, { requireSync: true });\n this.setupBehaviors();\n }\n\n setupBehaviors(): void {\n this.messages.rxMessage$.subscribe((msg) => this.handleMessage(msg));\n // if we haven't heard from Hamlib in 15 seconds, consider it down\n this.connected$\n .pipe(\n filter((isUp) => isUp),\n debounceTime(15000),\n )\n .subscribe(() => {\n this.connected$.next(false);\n });\n // When Hamlib goes down, clear its persistent message subjects\n this.connected$.subscribe((isUp) => {\n if (!isUp) {\n this.rigState$.next(null);\n }\n });\n }\n\n private handleMessage(msg: any): void {\n if (!msg.hamlib || !msg.hamlib.type) {\n return;\n }\n this.connected$.next(true);\n switch (msg.hamlib.type) {\n case 'RigState':\n this.rigState$.next(msg.hamlib.payload as HamlibRigState);\n return;\n }\n }\n}\n","import { AgentMessageService } from './agent-message.service';\nimport {\n BehaviorSubject,\n ReplaySubject,\n Subject,\n Subscription,\n timer,\n} from 'rxjs';\nimport { HamlibRigState } from './hamlib-messages';\nimport { HamlibService } from './hamlib.service';\nimport { Injectable, Signal } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport {\n WsjtxClear,\n WsjtxClose,\n WsjtxDecode,\n WsjtxHeartbeat,\n WsjtxHighlightCallsign,\n WsjtxLoggedAdif,\n WsjtxQsoLogged,\n WsjtxStatus,\n WsjtxWsprDecode,\n} from './wsjtx-messages';\nimport { WsjtxService } from './wsjtx.service';\nimport { retry } from 'rxjs/operators';\nimport { webSocket, WebSocketSubject } from 'rxjs/webSocket';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AgentService {\n /** Whether we're connected to the agent. */\n public readonly connectedState$ = new BehaviorSubject<boolean>(false);\n /** Signal indicating whether we're connected to the agent. */\n public readonly connected: Signal<boolean>;\n\n /* WSJT-X */\n /**\n * Whether we're getting any messages from WSJT-X.\n *\n * @deprecated Use {@link WsjtxService.connected$} instead.\n */\n public readonly wsjtxState$: BehaviorSubject<boolean>;\n /**\n * Subject for listening to WSJT-X \"Heartbeat\" messages.\n *\n * @deprecated Use {@link WsjtxService.heartbeat$} instead.\n */\n public readonly wsjtxHeartbeat$: ReplaySubject<WsjtxHeartbeat | null>;\n /**\n * Subject for listening to WSJT-X \"Status\" messages.\n *\n * @deprecated Use {@link WsjtxService.status$} instead.\n */\n public readonly wsjtxStatus$: ReplaySubject<WsjtxStatus | null>;\n /**\n * Subject for listening to WSJT-X \"Decode\" messages.\n *\n * @deprecated Use {@link WsjtxService.decode$} instead.\n */\n public readonly wsjtxDecode$: Subject<WsjtxDecode>;\n /**\n * Subject for listening to WSJT-X \"Clear\" messages.\n *\n * @deprecated Use {@link WsjtxService.clear$} instead.\n */\n public readonly wsjtxClear$: Subject<WsjtxClear>;\n /**\n * Subject for listening to WSJT-X \"QsoLogged\" messages.\n *\n * @deprecated Use {@link WsjtxService.qsoLogged$} instead.\n */\n public readonly wsjtxQsoLogged$: Subject<WsjtxQsoLogged>;\n /**\n * Subject for listening to WSJT-X \"Close\" messages.\n *\n * @deprecated Use {@link WsjtxService.close$} instead.\n */\n public readonly wsjtxClose$: Subject<WsjtxClose>;\n /**\n * Subject for listening to WSJT-X \"WsprDecode\" messages.\n *\n * @deprecated Use {@link WsjtxService.wsprDecode$} instead.\n */\n public readonly wsjtxWsprDecode$: Subject<WsjtxWsprDecode>;\n /**\n * Subject for listening to WSJT-X \"LoggedAdif\" messages.\n *\n * @deprecated Use {@link WsjtxService.loggedAdif$} instead.\n */\n public readonly wsjtxLoggedAdif$: Subject<WsjtxLoggedAdif>;\n\n /* Hamlib */\n /**\n * Whether we're getting any messages from Hamlib.\n *\n * @deprecated Use {@link HamlibService.connected$} instead.\n */\n public readonly hamlibState$: BehaviorSubject<boolean>;\n /**\n * Subject for listening to Hamlib \"RigState\" messages.\n *\n * @deprecated Use {@link HamlibService.rigState$} instead.\n */\n public readonly hamlibRigState$: BehaviorSubject<HamlibRigState | null>;\n\n private readonly defaultAgentHost = 'localhost';\n private readonly defaultAgentPort = 8081;\n private readonly localStorageHostKey = 'agent-host';\n private readonly localStoragePortKey = 'agent-port';\n\n private agentHost: string = this.defaultAgentHost;\n private agentPort: number = this.defaultAgentPort;\n private agentWebSocketSubject: WebSocketSubject<object> | null = null;\n private agentWebsocketSubscription: Subscription | null = null;\n private txMessageSubscription: Subscription | null = null;\n\n constructor(\n private messages: AgentMessageService,\n private hamlibService: HamlibService,\n private wsjtxService: WsjtxService,\n ) {\n this.connected = toSignal(this.connectedState$, { requireSync: true });\n\n this.hamlibState$ = this.hamlibService.connected$;\n this.hamlibRigState$ = this.hamlibService.rigState$;\n\n this.wsjtxState$ = this.wsjtxService.connected$;\n this.wsjtxHeartbeat$ = this.wsjtxService.heartbeat$;\n this.wsjtxStatus$ = this.wsjtxService.status$;\n this.wsjtxDecode$ = this.wsjtxService.decode$;\n this.wsjtxClear$ = this.wsjtxService.clear$;\n this.wsjtxQsoLogged$ = this.wsjtxService.qsoLogged$;\n this.wsjtxClose$ = this.wsjtxService.close$;\n this.wsjtxWsprDecode$ = this.wsjtxService.wsprDecode$;\n this.wsjtxLoggedAdif$ = this.wsjtxService.loggedAdif$;\n }\n\n public init(): void {\n if (!this.txMessageSubscription) {\n this.txMessageSubscription = this.messages.txMessage$.subscribe((msg) =>\n this.send(msg),\n );\n }\n this.agentHost = this.getHost();\n this.agentPort = this.getPort();\n this.connect();\n }\n\n /** Connect (or reconnect) the websocket to the kel-agent server. */\n public connect(): void {\n if (this.agentWebsocketSubscription) {\n this.agentWebsocketSubscription.unsubscribe();\n }\n this.agentHost = this.getHost();\n this.agentPort = this.getPort();\n const protocol = this.agentHost === 'localhost' ? 'ws://' : 'wss://';\n this.agentWebSocketSubject = webSocket<object>({\n url: protocol + this.agentHost + ':' + this.agentPort + '/websocket',\n openObserver: {\n next: () => this.connectedState$.next(true),\n },\n });\n this.agentWebsocketSubscription = this.agentWebSocketSubject\n .pipe(\n retry({\n delay: () => {\n this.connectedState$.next(false);\n return timer(10000);\n },\n }),\n )\n .subscribe({\n next: (msg) => {\n this.messages.rxMessage$.next(msg);\n },\n error: () => this.connectedState$.next(false),\n complete: () => this.connectedState$.next(false),\n });\n }\n\n /** Get the currently configured kel-agent host. */\n public getHost(): string {\n return (\n localStorage.getItem(this.localStorageHostKey) || this.defaultAgentHost\n );\n }\n\n /** Get the currently configured kel-agent port. */\n public getPort(): number {\n let portStr = localStorage.getItem(this.localStoragePortKey);\n if (portStr == null) {\n return this.defaultAgentPort;\n }\n let portNum = parseInt(portStr, 10);\n if (isNaN(portNum)) {\n return this.defaultAgentPort;\n }\n return portNum;\n }\n\n /** Set the kel-agent host. */\n public setHost(host: string): void {\n localStorage.setItem(this.localStorageHostKey, host);\n this.connect();\n }\n\n /** Set the kel-agent port. */\n public setPort(port: number): void {\n localStorage.setItem(this.localStoragePortKey, String(port));\n this.connect();\n }\n\n private send(wsMsg: any) {\n this.agentWebSocketSubject?.next(wsMsg);\n }\n\n /**\n * Send a command to WSJT-X to clear the Band Activity window.\n *\n * @deprecated Use {@link WsjtxService.clearBandActivity} instead.\n */\n public sendWsjtxClearBandActivity() {\n this.wsjtxService.clearBandActivity();\n }\n\n /**\n * Send a command to WSJT-X to clear the Rx Frequency window.\n *\n * @deprecated Use {@link WsjtxService.clearRxFreqWindow} instead.\n */\n public sendWsjtxClearRxFreqWindow() {\n this.wsjtxService.clearRxFreqWindow();\n }\n\n /**\n * Send a command to WSJT-X to clear the Band Activity and Rx Frequency windows.\n *\n * @deprecated Use {@link WsjtxService.clearAll} instead.\n */\n public sendWsjtxClearAll() {\n this.wsjtxService.clearAll();\n }\n\n /**\n * Send a command to WSJT-X to replay messages. Useful for a fresh client that wants to hear\n * previous WSJT-X decodes.\n *\n * @deprecated Use {@link WsjtxService.replay} instead.\n */\n public sendWsjtxReplay() {\n this.wsjtxService.replay();\n }\n\n /**\n * Send a command to WSJT-X to halt any transmissions immediately.\n *\n * @deprecated Use {@link WsjtxService.haltTxNow} instead.\n */\n public sendWsjtxHaltTxNow() {\n this.wsjtxService.haltTxNow();\n }\n\n /** Send a command to WSJT-X to stop auto-transmitting after finishing the current round.\n *\n * @deprecated Use {@link WsjtxService.haltTxAfterCurrent} instead.\n */\n public sendWsjtxHaltTxAfterCurrent() {\n this.wsjtxService.haltTxAfterCurrent();\n }\n\n /**\n * Send a command to WSJT-X to reply to the given decode. The message must include CQ or QRZ.\n *\n * @deprecated Use {@link WsjtxService.reply} instead.\n */\n public sendWsjtxReply(decode: WsjtxDecode) {\n this.wsjtxService.reply(decode);\n }\n\n /**\n * Send a command to WSJT-X to reply to the given decode. The message must include CQ or QRZ.\n *\n * @deprecated Use {@link WsjtxService.highlightCallsign} instead.\n */\n public sendWsjtxHighlightCallsign(highlightMsg: WsjtxHighlightCallsign) {\n this.wsjtxService.highlightCallsign(highlightMsg);\n }\n\n /**\n * Given a decode message, format a string the same way as displayed in the WSJT-X Band\n * Activity/Rx Frequency windows.\n *\n * @deprecated Use {@link WsjtxService.formatDecode} instead.\n */\n public static formatDecode(msg: WsjtxDecode): string {\n return WsjtxService.formatDecode(msg);\n }\n}\n","/*\n * Public API Surface of ngx-kel-agent\n */\n\nexport * from './lib/agent.service';\nexport * from './lib/agent-message.service';\nexport * from './lib/hamlib-messages';\nexport * from './lib/hamlib.service';\nexport * from './lib/wsjtx-messages';\nexport * from './lib/wsjtx.service';\n// export * from './lib/ngx-kel-agent.component';\n// export * from './lib/ngx-kel-agent.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.AgentMessageService","i2.HamlibService","i3.WsjtxService"],"mappings":";;;;;;;MAMa,mBAAmB,CAAA;AAI9B,IAAA,WAAA,GAAA;AAHA,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,OAAO,EAAO;AAC/B,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,OAAO,EAAO;IAEhB;+GAJJ,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAnB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,cAFlB,MAAM,EAAA,CAAA,CAAA;;4FAEP,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAH/B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;MCsBY,YAAY,CAAA;AAgDvB,IAAA,WAAA,CAAoB,QAA6B,EAAA;QAA7B,IAAA,CAAA,QAAQ,GAAR,QAAQ;;AA9CZ,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,eAAe,CAAU,KAAK,CAAC;;AAKhD,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,aAAa,CAAwB,CAAC,CAAC;;AAKxD,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,aAAa,CAAqB,CAAC,CAAC;;AAKlD,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,OAAO,EAAe;;AAKpC,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,OAAO,EAAc;;AAKlC,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,OAAO,EAAkB;;AAK1C,QAAA,IA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A;;;AAGG;IACI,2BAA2B,GAAA;AAChC,QAAA,IAAI,CAAC,YAAY,CAAC,kBAAkB,EAAE;IACxC;AAEA;;;;AAIG;AACI,IAAA,cAAc,CAAC,MAAmB,EAAA;AACvC,QAAA,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC;IACjC;AAEA;;;;AAIG;AACI,IAAA,0BAA0B,CAAC,YAAoC,EAAA;AACpE,QAAA,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,YAAY,CAAC;IACnD;AAEA;;;;;AAKG;IACI,OAAO,YAAY,CAAC,GAAgB,EAAA;AACzC,QAAA,OAAO,YAAY,CAAC,YAAY,CAAC,GAAG,CAAC;IACvC;+GA3QW,YAAY,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAAA,mBAAA,EAAA,EAAA,EAAA,KAAA,EAAAC,aAAA,EAAA,EAAA,EAAA,KAAA,EAAAC,YAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAZ,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,cAFX,MAAM,EAAA,CAAA,CAAA;;4FAEP,YAAY,EAAA,UAAA,EAAA,CAAA;kBAHxB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;AC7BD;;AAEG;AAQH;AACA;;ACXA;;AAEG;;;;"}
|
package/package.json
CHANGED
package/types/ngx-kel-agent.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Subject, BehaviorSubject, ReplaySubject } from 'rxjs';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
+
import { Signal } from '@angular/core';
|
|
3
4
|
|
|
4
5
|
declare class AgentMessageService {
|
|
5
6
|
rxMessage$: Subject<any>;
|
|
@@ -24,8 +25,12 @@ declare class HamlibService {
|
|
|
24
25
|
private messages;
|
|
25
26
|
/** Whether we're getting any messages from Hamlib. */
|
|
26
27
|
readonly connected$: BehaviorSubject<boolean>;
|
|
28
|
+
/** Signal indicating whether we're getting any messages from Hamlib. */
|
|
29
|
+
readonly connected: Signal<boolean>;
|
|
27
30
|
/** Subject for listening to Hamlib "RigState" messages. */
|
|
28
31
|
readonly rigState$: BehaviorSubject<HamlibRigState | null>;
|
|
32
|
+
/** Signal for the latest Hamlib "RigState" message. */
|
|
33
|
+
readonly rigState: Signal<HamlibRigState | null>;
|
|
29
34
|
constructor(messages: AgentMessageService);
|
|
30
35
|
setupBehaviors(): void;
|
|
31
36
|
private handleMessage;
|
|
@@ -425,22 +430,40 @@ declare class WsjtxService {
|
|
|
425
430
|
private messages;
|
|
426
431
|
/** Whether we're getting any messages from WSJT-X. */
|
|
427
432
|
readonly connected$: BehaviorSubject<boolean>;
|
|
433
|
+
/** Signal indicating whether we're getting any messages from WSJT-X. */
|
|
434
|
+
readonly connected: Signal<boolean>;
|
|
428
435
|
/** Subject for listening to WSJT-X "Heartbeat" messages. */
|
|
429
436
|
readonly heartbeat$: ReplaySubject<WsjtxHeartbeat | null>;
|
|
437
|
+
/** Signal for the latest WSJT-X "Heartbeat" message. */
|
|
438
|
+
readonly heartbeat: Signal<WsjtxHeartbeat | null>;
|
|
430
439
|
/** Subject for listening to WSJT-X "Status" messages. */
|
|
431
440
|
readonly status$: ReplaySubject<WsjtxStatus | null>;
|
|
441
|
+
/** Signal for the latest WSJT-X "Status" message. */
|
|
442
|
+
readonly status: Signal<WsjtxStatus | null>;
|
|
432
443
|
/** Subject for listening to WSJT-X "Decode" messages. */
|
|
433
444
|
readonly decode$: Subject<WsjtxDecode>;
|
|
445
|
+
/** Signal for the latest WSJT-X "Decode" message. */
|
|
446
|
+
readonly decode: Signal<WsjtxDecode | null>;
|
|
434
447
|
/** Subject for listening to WSJT-X "Clear" messages. */
|
|
435
448
|
readonly clear$: Subject<WsjtxClear>;
|
|
449
|
+
/** Signal for the latest WSJT-X "Clear" message. */
|
|
450
|
+
readonly clear: Signal<WsjtxClear | null>;
|
|
436
451
|
/** Subject for listening to WSJT-X "QsoLogged" messages. */
|
|
437
452
|
readonly qsoLogged$: Subject<WsjtxQsoLogged>;
|
|
453
|
+
/** Signal for the latest WSJT-X "QsoLogged" message. */
|
|
454
|
+
readonly qsoLogged: Signal<WsjtxQsoLogged | null>;
|
|
438
455
|
/** Subject for listening to WSJT-X "Close" messages. */
|
|
439
456
|
readonly close$: Subject<WsjtxClose>;
|
|
457
|
+
/** Signal for the latest WSJT-X "Close" message. */
|
|
458
|
+
readonly close: Signal<WsjtxClose | null>;
|
|
440
459
|
/** Subject for listening to WSJT-X "WsprDecode" messages. */
|
|
441
460
|
readonly wsprDecode$: Subject<WsjtxWsprDecode>;
|
|
461
|
+
/** Signal for the latest WSJT-X "WsprDecode" message. */
|
|
462
|
+
readonly wsprDecode: Signal<WsjtxWsprDecode | null>;
|
|
442
463
|
/** Subject for listening to WSJT-X "LoggedAdif" messages. */
|
|
443
464
|
readonly loggedAdif$: Subject<WsjtxLoggedAdif>;
|
|
465
|
+
/** Signal for the latest WSJT-X "LoggedAdif" message. */
|
|
466
|
+
readonly loggedAdif: Signal<WsjtxLoggedAdif | null>;
|
|
444
467
|
private wsjtxId;
|
|
445
468
|
constructor(messages: AgentMessageService);
|
|
446
469
|
private setupBehaviors;
|
|
@@ -488,6 +511,8 @@ declare class AgentService {
|
|
|
488
511
|
private wsjtxService;
|
|
489
512
|
/** Whether we're connected to the agent. */
|
|
490
513
|
readonly connectedState$: BehaviorSubject<boolean>;
|
|
514
|
+
/** Signal indicating whether we're connected to the agent. */
|
|
515
|
+
readonly connected: Signal<boolean>;
|
|
491
516
|
/**
|
|
492
517
|
* Whether we're getting any messages from WSJT-X.
|
|
493
518
|
*
|
|
@@ -562,6 +587,7 @@ declare class AgentService {
|
|
|
562
587
|
private agentPort;
|
|
563
588
|
private agentWebSocketSubject;
|
|
564
589
|
private agentWebsocketSubscription;
|
|
590
|
+
private txMessageSubscription;
|
|
565
591
|
constructor(messages: AgentMessageService, hamlibService: HamlibService, wsjtxService: WsjtxService);
|
|
566
592
|
init(): void;
|
|
567
593
|
/** Connect (or reconnect) the websocket to the kel-agent server. */
|