feat: added FlexRadio support (meters & basic functions)

This commit is contained in:
2026-06-17 18:29:35 +02:00
parent abdab22010
commit bde1195b34
9 changed files with 1808 additions and 13 deletions
+114
View File
@@ -385,6 +385,30 @@ export namespace awardref {
export namespace cat {
export class FlexMeter {
id: number;
src?: string;
name?: string;
unit?: string;
value: number;
lo: number;
hi: number;
static createFrom(source: any = {}) {
return new FlexMeter(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.id = source["id"];
this.src = source["src"];
this.name = source["name"];
this.unit = source["unit"];
this.value = source["value"];
this.lo = source["lo"];
this.hi = source["hi"];
}
}
export class FlexRadio {
ip: string;
port: number;
@@ -407,6 +431,96 @@ export namespace cat {
this.callsign = source["callsign"];
}
}
export class FlexTXState {
available: boolean;
model?: string;
rf_power: number;
tune_power: number;
tune: boolean;
transmitting: boolean;
vox_enable: boolean;
vox_level: number;
vox_delay: number;
proc_enable: boolean;
proc_level: number;
mon: boolean;
mon_level: number;
mic_level: number;
atu_status?: string;
atu_memories: boolean;
rx_avail: boolean;
agc_mode?: string;
agc_threshold: number;
audio_level: number;
nb: boolean;
nb_level: number;
nr: boolean;
nr_level: number;
anf: boolean;
anf_level: number;
amp_available: boolean;
amp_model?: string;
amp_operate: boolean;
amp_fault?: string;
meters?: FlexMeter[];
static createFrom(source: any = {}) {
return new FlexTXState(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.available = source["available"];
this.model = source["model"];
this.rf_power = source["rf_power"];
this.tune_power = source["tune_power"];
this.tune = source["tune"];
this.transmitting = source["transmitting"];
this.vox_enable = source["vox_enable"];
this.vox_level = source["vox_level"];
this.vox_delay = source["vox_delay"];
this.proc_enable = source["proc_enable"];
this.proc_level = source["proc_level"];
this.mon = source["mon"];
this.mon_level = source["mon_level"];
this.mic_level = source["mic_level"];
this.atu_status = source["atu_status"];
this.atu_memories = source["atu_memories"];
this.rx_avail = source["rx_avail"];
this.agc_mode = source["agc_mode"];
this.agc_threshold = source["agc_threshold"];
this.audio_level = source["audio_level"];
this.nb = source["nb"];
this.nb_level = source["nb_level"];
this.nr = source["nr"];
this.nr_level = source["nr_level"];
this.anf = source["anf"];
this.anf_level = source["anf_level"];
this.amp_available = source["amp_available"];
this.amp_model = source["amp_model"];
this.amp_operate = source["amp_operate"];
this.amp_fault = source["amp_fault"];
this.meters = this.convertValues(source["meters"], FlexMeter);
}
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 RigState {
enabled: boolean;
connected: boolean;