From wiki.ginstr.com
Jump to: navigation, search
(Calculate driving distance and store result into rows)
Line 38: Line 38:
 
:<code>@+id/deviceGps</code> - source2<br>
 
:<code>@+id/deviceGps</code> - source2<br>
 
:; ⤷ <code>[gn:act_calculateDrivingDistance]|[@+id/deviceKm,@+id/gpsInput,@+id/deviceGps]</code>
 
:; ⤷ <code>[gn:act_calculateDrivingDistance]|[@+id/deviceKm,@+id/gpsInput,@+id/deviceGps]</code>
 +
<hr>
 +
 +
===Calculate driving distance with callback action===
 +
 +
:;<code>[gn:act_calculateDrivingDistance]|[target,source1,source2;eventWidgetId,event]</code>
 +
 +
:{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
 +
|-
 +
! scope="col" | Parameter
 +
! scope="col" | Description
 +
|-
 +
| <code>[[target]]</code>
 +
| [[target]] into which calculated driving distance will be stored
 +
* Valid [[target|targets]]:
 +
:*<code>[[Datatypes#number|number]]</code>
 +
|-
 +
| <code>[[source|source1]]</code>
 +
| [[source]] from where [[Datatypes#gps|gps]] coordinate will be used for calculation
 +
* Valid [[source|sources]]:
 +
:*<code>[[Datatypes#gps|gps]]</code>
 +
|-
 +
| <code>[[source|source2]]</code>
 +
| [[source]] from where [[Datatypes#gps|gps]] coordinate will be used for calculation
 +
* Valid [[source|sources]]:
 +
:*<code>[[Datatypes#gps|gps]]</code>
 +
|-
 +
|}
 +
 +
====Example====
 +
:<code>@+id/deviceKm</code> - target<br>
 +
:<code>@+id/gpsInput</code> - source1<br>
 +
:<code>@+id/deviceGps</code> - source2<br>
 +
:<code>@+id/onDistanceReceive</code> - callback widget<br>
 +
:<code>gn:act_set</code> - callback action<br>
 +
:; ⤷ <code>[gn:act_calculateDrivingDistance]|[@+id/deviceKm,@+id/gpsInput,@+id/deviceGps;@+id/onDistanceReceive,gn:act_set]</code>
 
<hr>
 
<hr>
  
Line 76: Line 111:
 
| <code>[[source|targetColumnName]]</code>
 
| <code>[[source|targetColumnName]]</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
* Valid [[source|sources]]:
 
:*<code>hardcoded</code>
 
|-
 
| <code>[[source|eventWidgetId]]</code>
 
| [[target]] on which defined <code>event</code> will be executed
 
* Valid [[source|sources]]:
 
:*<code>[[Datatypes#number|number]]</code>
 
|-
 
| <code>[[:Category:Events|event]]</code>
 
| [[:Category:Events|event]] which will be fired after action is executed
 
 
* Valid [[source|sources]]:
 
* Valid [[source|sources]]:
 
:*<code>hardcoded</code>
 
:*<code>hardcoded</code>
Line 97: Line 122:
 
:<code>@+id/onDistanceReceive</code> - callback widget<br>
 
:<code>@+id/onDistanceReceive</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,@+id/gpsInput,@+id/deviceGps,devices_inventoryNumber,@variable/deviceNumber,device_km]</code>
 
<hr>
 
<hr>
  
===Calculate driving distance with callback action===
+
===Calculate driving distance and store result into [[Datatypes#rows|rows]] with callback action===
  
:;<code>[gn:act_calculateDrivingDistance]|[target,source1,source2;eventWidgetId,event]</code>
+
:;<code>[gn:act_calculateDrivingDistance]|[rowsTarget,source1,source2,searchColumnName,searchColumnValueId,targetColumnName;eventWidgetId,event]</code>
  
 
:{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
 
:{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
Line 123: Line 148:
 
* Valid [[source|sources]]:
 
* Valid [[source|sources]]:
 
:*<code>[[Datatypes#gps|gps]]</code>
 
:*<code>[[Datatypes#gps|gps]]</code>
 +
|-
 +
| <code>[[source|searchColumnName]]</code>
 +
| [[Datatypes#rows|rows]] column name which will be searched for specific searchColumnValue
 +
* Valid [[source|sources]]:
 +
:*<code>hardcoded</code>
 +
|-
 +
| <code>[[source|searchColumnValueId]]</code>
 +
| [[source]] from which the value will be used for matching correct row by checking <code>searchColumnName</code> column
 +
* Valid [[source|sources]]:
 +
:*<code>any source</code>
 +
|-
 +
| <code>[[source|targetColumnName]]</code>
 +
| [[Datatypes#rows|rows]] column name where the calculated driving distance will be stored
 +
* Valid [[source|sources]]:
 +
:*<code>hardcoded</code>
 +
|-
 +
| <code>[[source|eventWidgetId]]</code>
 +
| [[target]] on which defined <code>event</code> will be executed
 +
* Valid [[source|sources]]:
 +
:*<code>[[Datatypes#number|number]]</code>
 +
|-
 +
| <code>[[:Category:Events|event]]</code>
 +
| [[:Category:Events|event]] which will be fired after action is executed
 +
* Valid [[source|sources]]:
 +
:*<code>hardcoded</code>
 
|-
 
|-
 
|}
 
|}
Line 132: Line 182:
 
:<code>@+id/onDistanceReceive</code> - callback widget<br>
 
:<code>@+id/onDistanceReceive</code> - callback widget<br>
 
:<code>gn:act_set</code> - callback action<br>
 
:<code>gn:act_set</code> - callback action<br>
:; ⤷ <code>[gn:act_calculateDrivingDistance]|[@+id/deviceKm,@+id/gpsInput,@+id/deviceGps;@+id/onDistanceReceive,gn:act_set]</code>
+
:; ⤷ <code>[gn:act_calculateDrivingDistance]|[@variable/finalDeviceList,@+id/gpsInput,@+id/deviceGps,devices_inventoryNumber,@variable/deviceNumber,device_km;@+id/onDistanceArrived,gn:act_set]</code>
 
<hr>
 
<hr>

Revision as of 17:57, 20 July 2017

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

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;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
targetColumnName rows column name where the calculated driving distance will be stored
  • hardcoded

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]

Calculate driving distance and store result into rows with callback action

[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 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
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]|[@variable/finalDeviceList,@+id/gpsInput,@+id/deviceGps,devices_inventoryNumber,@variable/deviceNumber,device_km;@+id/onDistanceArrived,gn:act_set]