From wiki.ginstr.com
Revision as of 17:28, 20 July 2017 by Dinko (talk | contribs) (Calculate driving distance and store result into rows)
Jump to: navigation, search

gn:act_calculateDrivingDistance

Description
Action is used to calculate driving distance between two GPS coordinates and store the result into target
Action returns
void

Action signatures

Calculate driving distance

[gn:act_calculateDrivingDistance]|[target,source1,source2]
Parameter Description
target target into which calculated driving distance will be stored
source1 source from where gps coordinate will be used for calculation
source2 source from where gps coordinate will be used for calculation

Example

@+id/deviceKm - target
@+id/gpsInput - source1
@+id/deviceGps - source2
[gn:act_calculateDrivingDistance]|[@+id/deviceKm,@+id/gpsInput,@+id/deviceGps]

Calculate driving distance and store result into rows

[gn:act_calculateDrivingDistance]|[rowsTarget,source1,source2,searchColumnName,searchColumnValueId,targetColumnName;eventWidgetId,event]
Parameter Description
target target into which calculated driving distance will be stored
source1 source from where gps coordinate will be used for calculation
source2 source from where gps coordinate will be used for calculation
searchColumnName target into which calculated driving distance will be stored
searchColumnValueId target into which calculated driving distance will be stored
targetColumnName target into which calculated driving distance will be stored
eventWidgetId target into which calculated driving distance will be stored
event target into which calculated driving distance will be stored

Example

@+id/deviceKm - target
@+id/gpsInput - source1
@+id/deviceGps - source2
@+id/onDistanceReceive - callback widget
gn:act_set - callback action
[gn:act_calculateDrivingDistance]|[@variable/finalDeviceList,@+id/gpsInput,@+id/deviceGps,devices_inventoryNumber,@variable/deviceNumber,device_km;@+id/onDistanceArrived,gn:act_set]

Calculate driving distance with callback action

[gn:act_calculateDrivingDistance]|[target,source1,source2;eventWidgetId,event]
Parameter Description
target target into which calculated driving distance will be stored
source1 source into which calculated driving distance will be stored
source2 source into which calculated driving distance will be stored

Example

@+id/deviceKm - target
@+id/gpsInput - source1
@+id/deviceGps - source2
@+id/onDistanceReceive - callback widget
gn:act_set - callback action
[gn:act_calculateDrivingDistance]|[@+id/deviceKm,@+id/gpsInput,@+id/deviceGps;@+id/onDistanceReceive,gn:act_set]