feat: New Station Control, allow to control Webswitch 1216H or KMTronic

This commit is contained in:
2026-07-16 22:01:07 +02:00
parent c9fd1379e1
commit 829c236d6c
13 changed files with 1344 additions and 48 deletions
+85
View File
@@ -2333,9 +2333,11 @@ export namespace main {
}
export class RotatorSettings {
enabled: boolean;
type: string;
host: string;
port: number;
has_elevation: boolean;
rotator_num: number;
static createFrom(source: any = {}) {
return new RotatorSettings(source);
@@ -2344,9 +2346,11 @@ export namespace main {
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.enabled = source["enabled"];
this.type = source["type"];
this.host = source["host"];
this.port = source["port"];
this.has_elevation = source["has_elevation"];
this.rotator_num = source["rotator_num"];
}
}
export class SecretStatus {
@@ -2419,6 +2423,86 @@ export namespace main {
this.db_path = source["db_path"];
}
}
export class StationDevice {
id: string;
type: string;
name: string;
host: string;
user?: string;
pass?: string;
labels: string[];
static createFrom(source: any = {}) {
return new StationDevice(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.id = source["id"];
this.type = source["type"];
this.name = source["name"];
this.host = source["host"];
this.user = source["user"];
this.pass = source["pass"];
this.labels = source["labels"];
}
}
export class StationRelay {
number: number;
label: string;
on: boolean;
static createFrom(source: any = {}) {
return new StationRelay(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.number = source["number"];
this.label = source["label"];
this.on = source["on"];
}
}
export class StationDeviceStatus {
id: string;
name: string;
type: string;
connected: boolean;
error?: string;
relays: StationRelay[];
static createFrom(source: any = {}) {
return new StationDeviceStatus(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.id = source["id"];
this.name = source["name"];
this.type = source["type"];
this.connected = source["connected"];
this.error = source["error"];
this.relays = this.convertValues(source["relays"], StationRelay);
}
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 StationInfoComputed {
country: string;
dxcc: number;
@@ -2441,6 +2525,7 @@ export namespace main {
this.lon = source["lon"];
}
}
export class StationSettings {
callsign: string;
operator: string;