feat: Added Net control
This commit is contained in:
Vendored
+33
@@ -16,6 +16,7 @@ import {audio} from '../models';
|
||||
import {operating} from '../models';
|
||||
import {udp} from '../models';
|
||||
import {lookup} from '../models';
|
||||
import {netctl} from '../models';
|
||||
|
||||
export function ADIFFields():Promise<Array<adif.FieldDef>>;
|
||||
|
||||
@@ -371,6 +372,38 @@ export function LookupCallsign(arg1:string):Promise<lookup.Result>;
|
||||
|
||||
export function MoveDatabase(arg1:string):Promise<void>;
|
||||
|
||||
export function NetActivate(arg1:string):Promise<main.netActiveEntry>;
|
||||
|
||||
export function NetActiveList():Promise<Array<main.netActiveEntry>>;
|
||||
|
||||
export function NetClose():Promise<void>;
|
||||
|
||||
export function NetCreate(arg1:string):Promise<netctl.Net>;
|
||||
|
||||
export function NetDeactivate(arg1:string):Promise<number>;
|
||||
|
||||
export function NetDelete(arg1:string):Promise<void>;
|
||||
|
||||
export function NetList():Promise<Array<netctl.Net>>;
|
||||
|
||||
export function NetLookup(arg1:string):Promise<netctl.Station>;
|
||||
|
||||
export function NetOpen(arg1:string):Promise<void>;
|
||||
|
||||
export function NetOpenID():Promise<string>;
|
||||
|
||||
export function NetRename(arg1:string,arg2:string):Promise<void>;
|
||||
|
||||
export function NetRoster(arg1:string):Promise<Array<netctl.Station>>;
|
||||
|
||||
export function NetRosterRemove(arg1:string,arg2:string):Promise<void>;
|
||||
|
||||
export function NetRosterUpsert(arg1:string,arg2:netctl.Station):Promise<void>;
|
||||
|
||||
export function NetSetDefaults(arg1:string,arg2:string,arg3:string,arg4:string):Promise<void>;
|
||||
|
||||
export function NetUpdateActive(arg1:main.netActiveEntry):Promise<void>;
|
||||
|
||||
export function OpenADIFFile():Promise<string>;
|
||||
|
||||
export function OpenDatabase(arg1:string):Promise<void>;
|
||||
|
||||
@@ -710,6 +710,70 @@ export function MoveDatabase(arg1) {
|
||||
return window['go']['main']['App']['MoveDatabase'](arg1);
|
||||
}
|
||||
|
||||
export function NetActivate(arg1) {
|
||||
return window['go']['main']['App']['NetActivate'](arg1);
|
||||
}
|
||||
|
||||
export function NetActiveList() {
|
||||
return window['go']['main']['App']['NetActiveList']();
|
||||
}
|
||||
|
||||
export function NetClose() {
|
||||
return window['go']['main']['App']['NetClose']();
|
||||
}
|
||||
|
||||
export function NetCreate(arg1) {
|
||||
return window['go']['main']['App']['NetCreate'](arg1);
|
||||
}
|
||||
|
||||
export function NetDeactivate(arg1) {
|
||||
return window['go']['main']['App']['NetDeactivate'](arg1);
|
||||
}
|
||||
|
||||
export function NetDelete(arg1) {
|
||||
return window['go']['main']['App']['NetDelete'](arg1);
|
||||
}
|
||||
|
||||
export function NetList() {
|
||||
return window['go']['main']['App']['NetList']();
|
||||
}
|
||||
|
||||
export function NetLookup(arg1) {
|
||||
return window['go']['main']['App']['NetLookup'](arg1);
|
||||
}
|
||||
|
||||
export function NetOpen(arg1) {
|
||||
return window['go']['main']['App']['NetOpen'](arg1);
|
||||
}
|
||||
|
||||
export function NetOpenID() {
|
||||
return window['go']['main']['App']['NetOpenID']();
|
||||
}
|
||||
|
||||
export function NetRename(arg1, arg2) {
|
||||
return window['go']['main']['App']['NetRename'](arg1, arg2);
|
||||
}
|
||||
|
||||
export function NetRoster(arg1) {
|
||||
return window['go']['main']['App']['NetRoster'](arg1);
|
||||
}
|
||||
|
||||
export function NetRosterRemove(arg1, arg2) {
|
||||
return window['go']['main']['App']['NetRosterRemove'](arg1, arg2);
|
||||
}
|
||||
|
||||
export function NetRosterUpsert(arg1, arg2) {
|
||||
return window['go']['main']['App']['NetRosterUpsert'](arg1, arg2);
|
||||
}
|
||||
|
||||
export function NetSetDefaults(arg1, arg2, arg3, arg4) {
|
||||
return window['go']['main']['App']['NetSetDefaults'](arg1, arg2, arg3, arg4);
|
||||
}
|
||||
|
||||
export function NetUpdateActive(arg1) {
|
||||
return window['go']['main']['App']['NetUpdateActive'](arg1);
|
||||
}
|
||||
|
||||
export function OpenADIFFile() {
|
||||
return window['go']['main']['App']['OpenADIFFile']();
|
||||
}
|
||||
|
||||
@@ -2004,6 +2004,126 @@ export namespace main {
|
||||
return a;
|
||||
}
|
||||
}
|
||||
export class netActiveEntry {
|
||||
callsign: string;
|
||||
name: string;
|
||||
qth: string;
|
||||
country: string;
|
||||
rst_sent: string;
|
||||
rst_rcvd: string;
|
||||
comment: string;
|
||||
// Go type: time
|
||||
time_on: any;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new netActiveEntry(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) source = JSON.parse(source);
|
||||
this.callsign = source["callsign"];
|
||||
this.name = source["name"];
|
||||
this.qth = source["qth"];
|
||||
this.country = source["country"];
|
||||
this.rst_sent = source["rst_sent"];
|
||||
this.rst_rcvd = source["rst_rcvd"];
|
||||
this.comment = source["comment"];
|
||||
this.time_on = this.convertValues(source["time_on"], 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 namespace netctl {
|
||||
|
||||
export class Station {
|
||||
callsign: string;
|
||||
name?: string;
|
||||
qth?: string;
|
||||
country?: string;
|
||||
dxcc?: number;
|
||||
itu?: number;
|
||||
cq?: number;
|
||||
groups?: string;
|
||||
sig?: string;
|
||||
sig_info?: string;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new Station(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) source = JSON.parse(source);
|
||||
this.callsign = source["callsign"];
|
||||
this.name = source["name"];
|
||||
this.qth = source["qth"];
|
||||
this.country = source["country"];
|
||||
this.dxcc = source["dxcc"];
|
||||
this.itu = source["itu"];
|
||||
this.cq = source["cq"];
|
||||
this.groups = source["groups"];
|
||||
this.sig = source["sig"];
|
||||
this.sig_info = source["sig_info"];
|
||||
}
|
||||
}
|
||||
export class Net {
|
||||
id: string;
|
||||
name: string;
|
||||
default_rst_sent?: string;
|
||||
default_rst_rcvd?: string;
|
||||
default_comment?: string;
|
||||
stations?: Station[];
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new Net(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) source = JSON.parse(source);
|
||||
this.id = source["id"];
|
||||
this.name = source["name"];
|
||||
this.default_rst_sent = source["default_rst_sent"];
|
||||
this.default_rst_rcvd = source["default_rst_rcvd"];
|
||||
this.default_comment = source["default_comment"];
|
||||
this.stations = this.convertValues(source["stations"], Station);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user