Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FrontPanelWebAppBase

This class encapsulates the basic functionality of a web application using FrontPanel API via web socket interface.

Hierarchy

  • FrontPanelWebAppBase

Index

Properties

Optional onAddDevice

onAddDevice: undefined | function

Optional onConfigure

onConfigure: undefined | function

Optional onConnect

onConnect: undefined | function

Optional onDisconnect

onDisconnect: undefined | function

Optional onRemoveDevice

onRemoveDevice: undefined | function

Accessors

configuredDevice

  • get configuredDevice(): string | undefined

devices

  • get devices(): string[]

fp

isConnected

  • get isConnected(): boolean

server

  • get server(): string | undefined

Methods

Protected Abstract _processError

  • _processError(e: any): void

Protected Abstract _updateConnectionStatus

  • _updateConnectionStatus(): Promise<void>

callAndCheckErrors

  • callAndCheckErrors(func: function): Promise<void>

configure

  • configure(device: string, file: Blob): Promise<void>

connectAndLogin

  • connectAndLogin(server: string, user: string, password: string): Promise<void>
  • Connects to the server and login with the given credentials.

    Parameters

    • server: string
    • user: string
    • password: string

    Returns Promise<void>

disconnect

  • disconnect(): Promise<void>

httpBinaryRequest

  • httpBinaryRequest(path: string): Promise<Uint8Array>
  • Asynchronously sends the GET request and returns the [[Promise]] which will be resolved with the response as an array buffer when the request is complete.

    Parameters

    • path: string

    Returns Promise<Uint8Array>

httpTextRequest

  • httpTextRequest(path: string): Promise<string>
  • Asynchronously sends the GET request and returns the [[Promise]] which will be resolved with the response text when the request is complete.

    Parameters

    • path: string

    Returns Promise<string>

processServerNotifications

  • processServerNotifications(): Promise<void>
  • Waits for an unsolicited server reply and treats it as a server notification (throw an error on any other kind of replies). Processes device connection and disconnection notifications to update the list of devices and call onAddDevice and onRemoveDevice handlers. If the current configured device was disconnected, call disconnect.

    Returns Promise<void>

repeatWhile

  • repeatWhile(condition: function, func: function, ms: number): Promise<void>
  • Executes func using setTimeout while condition returns true with ms timeout.

    Parameters

    • condition: function
        • (): boolean
        • Returns boolean

    • func: function
        • (): void
        • Returns void

    • ms: number

    Returns Promise<void>

Generated using TypeDoc