Video EWO

The video EWO is used for displaying video streams. Besides the video display, there are no further control elements for the video EWO. The displayed video will be scaled to the current size of the video EWO. If no video is displayed, a black background is displayed.

Methods

The EWO supports the following methods:

clear(int dialogIdx)

Deletes the stream on the given dialog. If you specify dialogIdx=0 all streams on all dialogs are deleted.

this.clear(1);

Deletes the stream on dialog 1.

clearAll()

Deletes all opened streams.

this.clearAll();

setGrid(int dialogCnt, bool clearUnusedDialogs)

Changes the current grid. Valid grid counts are 1, 4, 6, 12, 24. The clearUnusedDialogs Flag can delete invisible dialogs.

this.setGrid(4, 1);

Changes the grid to 4 (which means that there are 4 single images).

unsigned getGrid()

Determines the current set grid.

unsigned actGrid = this.getGrid();

setPlaybackPosition(string newPosition)

Sets the current timeline position in playback mode.

setPlayBreaks(bool playBreaks)

Defines if breaks in the playback shall be played in realtime or skipped.

showLive(string currentStreamInfo, int dialogIdx, [bool bUseOverrideColor=false])

Opens the live stream on the given dialog.

this.showLive(Camera_00001@server1:9375, 2);

Opens camera 1 on dialog 2. The available streaming information (currentStreamInfo) of the camera can be queried by the function VIDEO_OA_getStreamInfo(). Therefore the first element of the dyn_string that is returned by the function VIDEO_OA_getStreamInfo() must be used for the function showLive().

If the optional Parameter bUseOverrideColor is passed with value true the dialog is colored with the sequencer color. The parameter is used when opening sequences.

showPlayback(string PlaybackInfo, int dialogIdx);

Opens the given playback on the defined dialog. The available playback information of the camera can be queried by the function VIDEO_OA_getStreamInfo(). The first element of the returned dyn_string must be used for the function showPlayback.

playbackChangeSpeed(int speed)

Changes the current speed of a running playback.

playbackPause()

Pauses a running playback.

playbackPlay(int speed)

Starts a playback with the specified speed. The speed is given in % of the normal speed (e.g. 100 = normal speed forward, -200 is double speed backwards).

playbackStepBackward()

Moves one step backward.

playbackStepForward()

Moves one step forward.

selectDialogIdx(dialogIdx)

Opens the selection frame on the specified dialog.

setIpcEncryptionEnabled(bool enabled)

Enables/disables the IPC socket encryption for the EWO.

Properties

The EWO supports the following properties:

setLineWidth(uint newWidth)

Defines the width in pixels for the border of a image in the EWO. The value is the same for each image. The default value is 3.

this.lineWidth(5);

Sets the value to 5 pixel.

uint getLineWidth()

Gets the width in pixels for the border of a image in the EWO. The value is the same for each image. The default value is 3.

int width = this.getLineWidth(5);

Gets the width of the border.

setTitleText(int dialogIdx, string text)

Sets the streaming title. Initially the data point name is set when starting the stream.

this.setTitleText(1, “hello”);

Sets the streaming title to "hello".

string getTitleText(int dialogIdx)

Gets the streaming title.

string text = this.getTitleText(1);

Returns the streaming title of stream 1.

setOverlayText(int dialogIdx, string text)

Set the overlay text on a displayed video.

this.setOverlayText(1, “Hallo”);

setScalingMode(int mode)

Sets the scaling mode of all video dialogs in the EWO. Valid values for the parameter mode are:

  • 0 = FitToSize (image is adapted to the EWO with distortion)
  • 1 = KeepAspectRatio default value, the image is displayed in the EWO without distortion)
  • 2 = ZoomToFill (the image maintains its aspect ratio and is zoomed to the size of the EWO)
this.setScalingMode(1);

setDebugFlags (uint flags)

Sets the debug flags. The set flags affect all EWO instances globally. in the same WinCC OA process. The following flags are available (default value is 0x2) and can be combined bit by bit:

  • DF_WARNING_MSG = 0x2: Enables the output of warning messages after the stderr.
  • DF_DEBUG_MSG = 0x4: Enables the output of debug messages after stdout.
setDebugFlags(6)

uint getDebugFlags()

Queries the current debug flags.

unsigned flags = getDebugFlags();

string getCurrentStreamInfo(int dialogIdx)

Determines the current stream information of a dialog.

setPlaybackZoomRange(string startPosition, string endPosition)

Sets the available zoom range for a playback.

setDialogBackgroundColor(string backColor)

Sets the background color for dialogs.

setDialogSelectedBackgroundColor(string backColor)

Sets the background color for the currently selected dialog.

setDialogFrameColor(string frameColor)

Sets the frame color for the dialogs.

setDialogSelectedFrameColor(string frameColor)

Sets the frame color for the currently selected dialog.

setDialogBackgroundImage(string filePath)

Defines a background image for empty dialogs.

setDialogStatusLineVisible(bool bVisible)

Defines if the status line of the video dialogs is displayed.

setDialogBackgroundColor("red");
setDialogSelectedBackgroundColor("green");
setDialogFrameColor("blue");
setDialogSelectedFrameColor("#FFD700");
setDialogBackgroundImage("D:/pictures/background.png");

scaleMode()

Sets the scaling mode of all video dialogs in the EWO.

  • 0 = FitToSize (image is adapted to the EWO with distortion)
  • 1 = KeepAspectRatio default value, the image is displayed in the EWO without distortion)
  • 2 = ZoomToFill (the image maintains its aspect ratio and is zoomed to the size of the EWO)

transportOption()

Sets the transmission type for video streams.

  • 0 = UDP unicast from interface
  • 1 = UDP multicast from interface
  • 2 = TCP unicast from interface
  • 5 = Multicast from device

playBreaks()

Defines if breaks in the playback shall be played in realtime or skipped.

errorTexts()

Overlay text which is shown in case of an error.

dialogBackgroundColor()

Defines the dialog background color.

dialogFrameColor()

Defines the dialog frame color.

dialogSelectedBackgroundColor()

Defines the background color of the selected dialog.

dialogSelectedFrameColor()

Defines the frame color of the selected dialog.

dialogStatusLineVisible()

Defines whether the dialog status line shall be visible or not.

encryptIpcSockets()

Enables/disables the IPC socket encryption for the EWO.

Events

The following events are supported:

onContentChanged (int dialogIdx, int mode, string streamId, string interfaceInfo)

Is triggered when the content of a video dialog is changed.

  • dialogIdx = Number of the dialog which content is changed.
  • mode = Playback mode (currently only live streams).
  • streamId = Stream information of the new content.

onGridChanged (int dialogCnt)

Is triggered when the grid of the EWO is changed.

onDrop (string droppedText, int dragType, int dialogIdx)

Is triggered when a (text) object is dropped on the EWO per drag & drop and passes the number of the display which was clicked.

onClicked(int dialogIdx)

Is triggered when you click the EWO with the left mouse button and passes the number of the clicked display.

onRightClicked(int dialogIdx)

Is triggered when you click the EWO with the right mouse button and passes the number of the clicked display.

onStreamStateChanged(int dialogIdx, uint mode, uint state)

Is triggered when the state of the current stream is changed.

Possible values for mode:

  • MODE_NONE = 0x00
  • MODE_LIVE = 0x01
  • MODE_PLAYBACK = 0x10
  • MODE_SEQUENCE = 0x20

Possible values for state:

  • CONST_ERROR_BASE = 0x1000;
  • STATE_STOPPED = 0x00;
  • STATE_STREAMING = 0x01;
  • STATE_ERROR = CONST:ERROR_BASE+0x01;
  • STATE_ERROR_UNKNOWN_CHANNEL = CONST_ERROR_BASE+0x02;

onTimelineUpdateEvent(string timelineStartTS, string timelineEndTS, string currentPosTS)

Is triggered when the timeline information is changed.

  • timelineStartTS = earliest time of a recording for the displayed cameras
  • timelineEndTS = last time of a recording for the displayed cameras
  • currentPosTS = current position on timeline