Page tree
Skip to end of metadata
Go to start of metadata




Introduced in

Version:3.8.1

Description

Description:IMPORTANT: This function only works when VBS is started with the -gateway switch.
Sends a sensor packet to IG to toggle sensor attributes.

Syntax

Syntax:[view_id, view_type, sensor_on, auto_gain_enable, polarity, track_polarity, gain, level, noise, bcm] call Gateway_ViewSetSensor
Parameters:
  • view_id: Number - The ID of the view to set the sensor on.
  • view_type: Number - The sensor type:
    • 0: OTW (No sensor)
    • 1: NV
    • 2: FLIR Green
    • 3: FLIR Black
    • 4: FLIR Red
    • 5: B/W
    • 6: Electro Optical
    • 7: View off
  • sensor_on: Boolean - If true, the sensor is enabled. False blacks out the screen. (Optional, default: false)
  • auto_gain_enable: Boolean - If true, the engine adjusts gain and level. False forces the user to set it themselves. (Optional, default: false)
  • polarity: Number - 0 = White Hot, 1 = Black Hot. (Optional, default: 0)
  • track_polarity: Number - 0 = Track White, 1 = Track Black. (Optional, default: 0)
  • gain: Number - Sensor gain (0.0 - 1.0). (Optional, default: 0.0)
  • level: Number - Sensor level (0.0 - 1.0). (Optional, default: 0.0)
  • noise: Number - Sensor noise (0.0 - 1.0). (Optional, default: 0.0)
  • bcm: Number - Brightness / Contrast mode. The value corresponds to the AutoContrast-AutoBrightness mode. When the brightness / contrast mode is specified, it overrides auto_gain_enable. (Optional) (V17.4.0+)
Return Value:Boolean - True if the operation is successful, false otherwise.

Warning

When using functions in VBS versions older than 3.4, certain limitations and requirements should be kept in mind - the main ones being that capitalization of the function name is crucial, and that #include "\vbs2\headers\function_library.hpp" has to be included in every script that utilizes it. More Category VBS Scripting Functions.

Examples

Examples:Result: true - Sensor configuration is applied:
sensor_set = [ 1, 3, 1, 0, 0, 0, 0.25, 0.8, 0 ] call Gateway_ViewSetSensor
Result: true - Sensor configuration is applied:
sensor_set = [ 1, 1 ] call Gateway_ViewSetSensor
Result: true - Sensor configuration is applied, with the extended brightness / contrast mode of MANUAL_CONTRAST_AUTO_BRIGHTNESS:
sensor_set = [ 1, 3, 1, 0, 0, 0, 0.25, 0.8, 0, 2 ] call Gateway_ViewSetSensor

Additional Information

See also: Gateway ViewAttachGroup, Gateway ViewGet, Gateway ViewModify, Gateway ViewClearGroup
Multiplayer:The function returns nil, if not used in multiplayer or when Gateway is not active (the -gateway start-up parameter is not used).
Problems: 

Notes