Virtual Device

Top  Previous  Next

Virtual Device driver is a Device Driver used to create and manage virtual devices, i.e. ones that are not associated with any real hardware but are interpreted by AggreGate as such. Every virtual device is represented by a Device Context and provides a number of settings (the variables of this context), operations (the functions and actions of this context) and events. A virtual device is very useful during testing, debugging and learning about the system, as it behaves similarly to any real hardware device connected to the system.

Driver Information

Driver Plugin ID:

com.tibbo.linkserver.plugin.device.virtual

Global Settings

None defined.

User Level Settings

None defined.

Device Settings

The virtual device provides different types of settings to help with testing Alerts, Reports, Widgets and other system features. Here is a list of available settings (variables of Device Context):

Basic Properties

Setting (Variable) Name

Comments

normal

Standard string setting.

readonly

Read-only string setting.

selvals

String setting with selection values.

eselvals

String setting with extensible selection values.

nullable

Nullable string setting.

Settings Of Different Types

Setting (Variable) Name

Comments

string

String setting.

int

Integer setting

boolean

Boolean setting.

float

Floating point setting.

date

Date setting.

table

Tabular setting with two fields (Integer and String) and unlimited number of records.

Location

Setting (Variable) Name

Comments

track

GPS track in GPX format. This track will be "replayed" by the device, meaning that a new waypoint (taken from the first track found in the file) will be written into Location setting upon every synchronization.

location

Simulated location of the device (latitude and longitude). The location is undefined if GPS track was not loaded or its "replay" was ended.

Wave Settings

Read-write settings in these group define how different read-only values in Waves group are generated (period, amplitude, etc.).

Setting (Variable) Name

Comments

sawtoothSettings

Sawtooth wave generator settings.

triangleSettings

Triangle wave generator settings.

squareSettings

Square wave generator settings.

sineSettings

Sine wave generator settings.

randomSettings

Random value generator settings.

WaveS

Setting (Variable) Name

Comments

sawtooth

Sawtooth wave generator.

triangle

Triangle wave generator.

square

Square wave generator.

sine

Sine wave generator.

random

Random value generator.

Error Generators

Setting (Variable) Name

Comments

shouldGenerateError

Should Generate Error. This setting define whether errors occur while reading/writing the Error Generator setting.

errorGenerator

Error Generator. Read/write operations on this setting may fail depending to the value of Should Generate Error setting.

Here is what virtual device configuration (see Configure action in Device Context for details) looks like in AggreGate Client:

ls_virtual_device_settings

Device Operations

Generate Event

Virtual device context has generateEvent function and corresponding Generate Event Call Function action that calls this function. Format of this function has three fields: String type field, String str field, and Integer int field. This function just generates the event with name specified by type field (Event 1 or Event 2, see below). Values of fields in event data are taken from input parameters of function.

Calculate

calculate function and corresponding Calculate Call Function action provide a test environment for performing simple operations (addition, subtraction, multiplication or division) over two arguments. Format of this function has three fields: Float leftOperand field, Float rightOperand field, and String operation field. This function returns a Data Table with a single record and Float result field.

Device Events

The virtual device context has two events called event1 (its description is Device Event #1) and event2 (Device Event #2). Format of these event has two fields: String field str and Integer field int.

These events and generateEvent function may be used together to test Device operations and events.

Connection Handling

A virtual device is always deemed Online.