feat: Management of multiple slices on Flexradio

This commit is contained in:
2026-07-07 19:35:25 +02:00
parent 6b9307b427
commit 6db90abcad
8 changed files with 276 additions and 103 deletions
+4
View File
@@ -172,6 +172,8 @@ export function FlexSetAPFLevel(arg1:number):Promise<void>;
export function FlexSetATUMemories(arg1:boolean):Promise<void>;
export function FlexSetActiveSlice(arg1:number):Promise<void>;
export function FlexSetAudioLevel(arg1:number):Promise<void>;
export function FlexSetCWBreakInDelay(arg1:number):Promise<void>;
@@ -216,6 +218,8 @@ export function FlexSetSplit(arg1:boolean):Promise<void>;
export function FlexSetTXAntenna(arg1:string):Promise<void>;
export function FlexSetTXSlice(arg1:number):Promise<void>;
export function FlexSetTunePower(arg1:number):Promise<void>;
export function FlexSetVox(arg1:boolean):Promise<void>;
+8
View File
@@ -306,6 +306,10 @@ export function FlexSetATUMemories(arg1) {
return window['go']['main']['App']['FlexSetATUMemories'](arg1);
}
export function FlexSetActiveSlice(arg1) {
return window['go']['main']['App']['FlexSetActiveSlice'](arg1);
}
export function FlexSetAudioLevel(arg1) {
return window['go']['main']['App']['FlexSetAudioLevel'](arg1);
}
@@ -394,6 +398,10 @@ export function FlexSetTXAntenna(arg1) {
return window['go']['main']['App']['FlexSetTXAntenna'](arg1);
}
export function FlexSetTXSlice(arg1) {
return window['go']['main']['App']['FlexSetTXSlice'](arg1);
}
export function FlexSetTunePower(arg1) {
return window['go']['main']['App']['FlexSetTunePower'](arg1);
}
+26
View File
@@ -541,9 +541,34 @@ export namespace cat {
this.callsign = source["callsign"];
}
}
export class FlexSliceInfo {
index: number;
letter: string;
freq_hz: number;
mode?: string;
band?: string;
active: boolean;
tx: boolean;
static createFrom(source: any = {}) {
return new FlexSliceInfo(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.index = source["index"];
this.letter = source["letter"];
this.freq_hz = source["freq_hz"];
this.mode = source["mode"];
this.band = source["band"];
this.active = source["active"];
this.tx = source["tx"];
}
}
export class FlexTXState {
available: boolean;
model?: string;
slices?: FlexSliceInfo[];
rf_power: number;
tune_power: number;
tune: boolean;
@@ -600,6 +625,7 @@ export namespace cat {
if ('string' === typeof source) source = JSON.parse(source);
this.available = source["available"];
this.model = source["model"];
this.slices = this.convertValues(source["slices"], FlexSliceInfo);
this.rf_power = source["rf_power"];
this.tune_power = source["tune_power"];
this.tune = source["tune"];