Service: App
Interacting with the local application instance
Functions in this service are always executed in the context of the user and station currently active that the module is connected to.
Functions
| Result | Name / Params | Comment | ||
|---|---|---|---|---|
| bool | app.Command | Execute a menu command. | ||
| name | string | Command name like 'view.panel.video', 'system.files' etc. | ||
| bool | app.ExecuteScript | Executes a script. | ||
| file | string | Name of the .wgt or .js file relative to scripts folder. | ||
| params | value{} | (Optional) Parameters for the script. | ||
| bool | app.CancelScript | Stops execution of a script. | ||
| file | string | Name of the .js file relative to scripts folder. | ||
| bool | app.CancelActions | Stops execution of pending actions by their Id. | ||
| file | string | Id of the pending actions. | ||
| bool | app.Login <wg 0.6.0 | Performs user login. | ||
| user | string | User login or code. | ||
| password | string | User password. | ||
| forced | bool | (Optional) Login without queries, unsaved content may be lost. | ||
| bool | app.Logout | Performs user logout. | ||
| forced | bool | (Optional) Logout without queries, unsaved content may be lost. | ||
| string | app.GetLanguage | Get current language. | ||
| bool | app.SetLanguage | Set current language. | ||
| id | string | Language Id (de, en, ...). | ||
| forced | bool | (Optional) Set language without queries, unsaved content may be lost. | ||
| string | app.GetTheme | Get current theme. | ||
| bool | app.SetTheme | Set current theme. | ||
| id | string | Theme Id (arctic, light_grey, ...). | ||
| forced | bool | (Optional) Set theme without queries, unsaved content may be lost. | ||
| bool | app.SelectSegment | Selects a segment in the explorer. | ||
| id | guid | Id of the segment for remove of selection. | ||
| doubleclick | bool | (Optional) Double click on selection. | ||
| guid | app.GetSelectedSegment | Get Id of currently selected segment. | ||
| bool | app.SelectLocation | Selects a location in the explorer. | ||
| id | guid | Id of the location or null for remove of selection. | ||
| doubleclick | bool | (Optional) Double click on selection. | ||
| guid | app.GetSelectedLocation | Get Id of currently selected location. | ||
| bool | app.SelectDatapoint | Selects a Datapoint in the explorer. | ||
| id | guid | Id of the Datapoint or null for remove of selection. | ||
| doubleclick | bool | (Optional) Double click on selection. | ||
| guid | app.GetSelectedDatapoint | Get Id of currently selected Datapoint. | ||
| bool | app.SelectEvent | Selects an Event in the event list. | ||
| id | guid | Id of the Event or null for remove of selection. | ||
| doubleclick | bool | (Optional) Double click on selection. | ||
| guid | app.GetSelectedEvent | Get Id of currently selected Event. | ||
| bool | app.SelectIncident ≥wg.app 0.1.0 | Selects an Incident in the event list. | ||
| id | string | Incident URL. | ||
| doubleclick | bool | (Optional) Double click on selection. | ||
| bool | app.FetchEvent | Fetch the Event with the given id | ||
| id | guid | Id of the Event | ||
| bool | app.PlaySound | Plays a sound file. | ||
| sound | string | Name of the sound file relative to sounds folder. | ||
| loop | bool | (Optional) Play sound in a loop. | ||
| bool | app.StopSound | Stops a looped sound. | ||
| all | bool | Stop looped sound from every source, not only from scripts. | ||
| int | app.GetLocalStation | Retrieves the local station number. | ||
| void | app.ConnectAudio ≥wg.app 0.4.0 | Connects audio inputs to outputs. | ||
| id | string | (Optional) An optional id for the audio connection, used as name by the audio control panel for the corresponding connection, can also be used as reference to end the connection. | ||
| sources | guid[] | Ids of the audio input Datapoints. | ||
| destinations | guid[] | Ids of the audio output Datapoints. | ||
| priority | int | The priority of the connect audio activity. | ||
| delay | int | Delay before the audio connects. | ||
| connectavailableonly | bool | If true, audio inputs are connected to free audio outputs, otherwise this audio connect activity gets discarded if there are no available audio outputs. | ||
| repeat | bool | Audio shall be played cyclically. | ||
| parameters | string | (Optional) Additional extension-specific parameters. | ||
| eventid | guid | (Optional) The audio connect activity should be executed under the context of this event. | ||
| bool | app.ShowVideo ≥wg 0.4.0 | Shows the video source on the given target. | ||
| sourceid | guid | ID of the camera datatpoint. If the ID is the null GUID, the command will remove the camera on the target. | ||
| targeturl | string | (Optional) Only necessary if the target is the Video Manager, a display or the camera control panel. Only the following types of URLs are allowed: "VideoManager[1..4]", "VideoDisplay[1..4]/Window[1..4]" and "VideoPanel" | ||
| targetid | guid | (Optional) ID of the target Datapoint. Only necessary when targeturl is empty. | ||
| targetpane | string | (Optional) The area of the target, which should show the camera. | ||
| stream | string | (Optional) The video stream, which should be shown. | ||
| mode | string | (Optional) Sets live or archive mode. Only the following values are allowed: "live" and "archive". | ||
| speed | string | (Optional) Only valid when mode="archive". The desired speed of the video. The sign indicates the direction. Only the following values are allowed: "0", "0.125", "0.25", "0.5", "1", "2", "4", "8" and all of their negative counterparts. | ||
| time | time | (Optional) Only valid when mode="archive". The time on which the video should start. | ||
| markeroffset | int | (Optional) Only valid when mode="archive". An offset in seconds to define the time of the start marker in respect to the current time. | ||
| markerduration | int | (Optional) Only valid when mode="archive". A duration in seconds. It defines the position of the end marker by defining the time range between start and end marker. If set to 0, the start and end marker are removed. | ||
| loop | bool | (Optional) Only valid when mode="archive". Loop video between markers. | ||
Notifications
| Name / Params | Comment | ||
|---|---|---|---|
| app.LanguageChanged | Notifies change of current language. | ||
| id | string | Language Id (de, en, ...). | |
| app.ThemeChanged | Notifies change of current theme. | ||
| id | string | Theme Id (arctic, light_grey, ...). | |
| app.SettingsChanged | Notifies change of current settings. | ||
| settings | value{} | Changed settings. | |
| app.SegmentSelected | Notifies selection of a segment in the explorer. | ||
| id | guid | Id of the segment or null for no selection. | |
| app.LocationSelected | Notifies selection of a location in the explorer. | ||
| id | guid | Id of the selected location or null for no selection. | |
| app.DatapointSelected | Notifies selection of a Datapoint in the explorer. | ||
| id | guid | Id of the selected Datapoint or null for no selection. | |
| app.EventSelected | Notifies selection of an Event in the event list. | ||
| id | guid | Id of the selected Event or null for no selection. | |
Last modified September 25, 2026