From wiki.ginstr.com
Jump to: navigation, search
(Calculate driving distance and store result into rows with callback action)
(Calculate driving distance and store result into rows with callback action)
Line 138: Line 138:
 
===Calculate driving distance and store result into [[Datatypes#rows|rows]] with callback action===
 
===Calculate driving distance and store result into [[Datatypes#rows|rows]] with callback action===
  
:;<code>[gn:act_calculateDrivingDistance]|[rowsTarget,source1,source2,searchColumnName,searchColumnValueId;targetColumnName;eventWidgetId,event]</code>
+
:;<code>[gn:act_calculateDrivingDistance]|[rowsTarget,source1,source2,searchColumnName,searchColumnValueId;numericTargetColumnName,stringTargetColumnName,stringSuffix;eventWidgetId,event]</code>
  
 
:{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
 
:{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
Line 170: Line 170:
 
:*<code>any source</code>
 
:*<code>any source</code>
 
|-
 
|-
| <code>[[source|targetColumnName]]</code>
+
| <code>[[source|numericTargetColumnName]]</code>
| [[Datatypes#rows|rows]] column name where the calculated driving distance will be stored
+
| [[Datatypes#rows|rows]] column name where the calculated driving distance will be stored as number
 
* Valid [[source|sources]]:
 
* Valid [[source|sources]]:
 
:*<code>hardcoded</code>
 
:*<code>hardcoded</code>
 +
|-
 +
| <code>[[source|stringTargetColumnName]]</code>
 +
| [[Datatypes#rows|rows]] column name where the calculated driving distance will be stored as text
 +
* Valid [[source|sources]]:
 +
:*<code>hardcoded</code>
 +
|-
 +
| <code>[[source|stringSuffix]]</code>
 +
| suffix value displayed in stringTargetColumnName
 +
* Valid [[source|sources]]:
 +
:*<code>[[Datatypes#text|text]]</code>
 
|-
 
|-
 
| <code>[[source|eventWidgetId]]</code>
 
| <code>[[source|eventWidgetId]]</code>
Line 196: Line 206:
 
:<code>@+id/onDistanceArrived</code> - callback widget<br>
 
:<code>@+id/onDistanceArrived</code> - callback widget<br>
 
:<code>gn:act_set</code> - callback action<br>
 
:<code>gn:act_set</code> - callback action<br>
:; ⤷ <code>[gn:act_calculateDrivingDistance]|[@variable/finalDeviceList,@+id/gpsInput,@+id/deviceGps,devices_inventoryNumber,@variable/deviceNumber;device_km;@+id/onDistanceArrived,gn:act_set]</code>
+
:; ⤷ <code>[gn:act_calculateDrivingDistance]|[variable/finalDeviceList,devices_gps,+id/gpsInput;devices_km,devices_kmText,variable/km;+id/onDistanceArrived,gn:act_set]</code>
 
<hr>
 
<hr>

Revision as of 10:39, 7 August 2019

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 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 from where gps coordinate will be used for calculation
source2 source from where gps coordinate will be used for calculation
eventWidgetId target on which defined event will be executed
event event which will be fired after action is executed
  • hardcoded

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]

Calculate driving distance and store result into rows

[gn:act_calculateDrivingDistance]|[rowsTarget,source1,source2,searchColumnName,searchColumnValueId;targetColumnName]
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 rows column name which will be searched for specific searchColumnValue
  • hardcoded
searchColumnValueId source from which the value will be used for matching correct row by checking searchColumnName column
  • any source
targetColumnName rows column name where the calculated driving distance will be stored
  • hardcoded

Example

@variable/finalDeviceList - target
@+id/gpsInput - source1
@+id/deviceGps - source2
devices_inventoryNumber - searchColumnName
@variable/deviceNumber - searchColumnValueId
device_km - targetColumnName
[gn:act_calculateDrivingDistance]|[@variable/finalDeviceList,@+id/gpsInput,@+id/deviceGps,devices_inventoryNumber;@variable/deviceNumber,device_km]

Calculate driving distance and store result into rows with callback action

[gn:act_calculateDrivingDistance]|[rowsTarget,source1,source2,searchColumnName,searchColumnValueId;numericTargetColumnName,stringTargetColumnName,stringSuffix;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 rows column name which will be searched for specific searchColumnValue
  • hardcoded
searchColumnValueId source from which the value will be used for matching correct row by checking searchColumnName column
  • any source
numericTargetColumnName rows column name where the calculated driving distance will be stored as number
  • hardcoded
stringTargetColumnName rows column name where the calculated driving distance will be stored as text
  • hardcoded
stringSuffix suffix value displayed in stringTargetColumnName
eventWidgetId target on which defined event will be executed
event event which will be fired after action is executed
  • hardcoded

Example

@variable/finalDeviceList - target
@+id/gpsInput - source1
@+id/deviceGps - source2
devices_inventoryNumber - searchColumnName
@variable/deviceNumber - searchColumnValueId
device_km - targetColumnName
@+id/onDistanceArrived - callback widget
gn:act_set - callback action
[gn:act_calculateDrivingDistance]|[variable/finalDeviceList,devices_gps,+id/gpsInput;devices_km,devices_kmText,variable/km;+id/onDistanceArrived,gn:act_set]