import { Observable } from 'rxjs'; import { DevicewiseApiService } from './devicewise-api.service'; import { DwSubscribeVariable } from './models/dwcommon'; import * as i0 from "@angular/core"; export interface MultiSubscribeResponse { success: boolean; params: MultiSubscribeResponseParams; errorCodes?: number[]; errorMessages?: string[]; } export interface MultiSubscribeResponseParams { device: string; variable: string; status: string; data: any[]; } export declare class DevicewiseMultisubscribeService { private apiService; multiSubscribeShared: Observable; private url; requestVariables: DwSubscribeVariable[]; constructor(apiService: DevicewiseApiService); /** * Subscribe to multiple `requestVariables`. emits inital value and then on change of value. * Observable, and emits the resulting values as an Observable. * * ## Example * Subscribe to a variable 'OEE' from device 'Machine1' and then unsubscribe a second later. * ```ts * import { DevicewiseMultisubscribeNewService } from './devicewise-multisubscribe-new.service'; * import { DwSubscription } from './models/dwsubscription'; * import { DwType } from './models/dwcommon'; * * const variables = [{ device: 'System Monitor', variable: 'CPU.CPU Usage', type: DwType.INT4, count: 1, length: -1 }]; * const multiSubscribe$ = service.multiSubscribe(variables); * const subscription = multiSubscribe$.subscribe({ * next: (data) => console.log('next', data), * error: (err) => console.log('error', err), * complete: () => console.log('complete') * }); * * setTimeout(() => { * subscription.unsubscribe(); * }, 1000); * ``` * * @param requestVariables requestVariables Variables to subscribe to. * @method map * @owner Observable */ multiSubscribe(requestVariables: DwSubscribeVariable[]): Observable; /** updateDigits(obj, subString): any { var variable=this.requestVariables?.find(variable => variable?.device === obj?.params?.device && variable?.variable ===obj?.params?.variable); if ((obj?.params?.data?.length == 1) && (variable?.typeString == "FLOAT8" || variable?.typeString == "INT8" || variable?.typeString == "UINT8")) { var startIndex = subString.indexOf("["); var endIndex = subString.indexOf("]"); if (startIndex != -1 && endIndex != -1) { var decimal = subString.substring(startIndex + 1, endIndex); //let numberValue: number = +decimal; let models: Array = []; models[0] = decimal; obj.params.data = models; } } return obj; } */ updateDigits(obj: any, jsonString: any): any; private fetchObservable; private concatUint8Arrays; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; }