Skip to main content
12-Amethyst
March 6, 2023
Solved

Is it possible to modify the VTQ configurations and add a new sub-property?

  • March 6, 2023
  • 1 reply
  • 814 views

Is it possible to change the VTQ config and add a new field definition there, for example: for a certain property I want to ingest Value, Timestamp, Quality, and Unit (of measure)?

Rishabh345_0-1678087917885.png

For example we are currently setting only the Lat, Long, Altitude and date time, and I want to add 2 new field to store GPS accuracy and GSM strength in the same value stream.

Is it doable? Any lead is greatly appreciated.  

  

 

 

Best answer by Constantine

Hello,

 

The VTQ structure is fixed, i.e. you can't add unit of measure to value, timestamp and quality. You'd need to create Properties for those extra parameters, i.e. "gpsPosition" of type LOCATION, "gpsAccuracy" and "gsmStrength", both of type NUMBER.

 

You can set all three of them at the same time, like this:

 

var props = Resources["InfoTableFunctions"].CreateInfoTable();
props.AddField({ name: 'gpsLocation', baseType: 'LOCATION' });
props.AddField({ name: 'gpsAccuracy', baseType: 'NUMBER' });
props.AddField({ name: 'gsmStrength', baseType: 'NUMBER' });
props.AddRow({
 gpsLocation: { latitude: 1, longitude: 1, elevation: 0, units: 'WGS84' },
 gpsAccuracy: 10.0,
 gsmStrength: 0.5
});
me.SetPropertyValues({ values: props });

 

In this case all three will get recorded in the ValueStream simultaneously, in the same DB row.

 

/ Constantine

1 reply

18-Opal
March 6, 2023

Hello,

 

The VTQ structure is fixed, i.e. you can't add unit of measure to value, timestamp and quality. You'd need to create Properties for those extra parameters, i.e. "gpsPosition" of type LOCATION, "gpsAccuracy" and "gsmStrength", both of type NUMBER.

 

You can set all three of them at the same time, like this:

 

var props = Resources["InfoTableFunctions"].CreateInfoTable();
props.AddField({ name: 'gpsLocation', baseType: 'LOCATION' });
props.AddField({ name: 'gpsAccuracy', baseType: 'NUMBER' });
props.AddField({ name: 'gsmStrength', baseType: 'NUMBER' });
props.AddRow({
 gpsLocation: { latitude: 1, longitude: 1, elevation: 0, units: 'WGS84' },
 gpsAccuracy: 10.0,
 gsmStrength: 0.5
});
me.SetPropertyValues({ values: props });

 

In this case all three will get recorded in the ValueStream simultaneously, in the same DB row.

 

/ Constantine