From wiki.ginstr.com
Jump to: navigation, search
(Action signatures)
(Action signatures)
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 and store resuklt into [[Datatypes#rows|rows]]===
 +
 +
:;<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>
 +
| [[target]] into which calculated driving distance will be stored
 +
* Valid [[source|sources]]:
 +
:*<code>[[Datatypes#gps|gps]]</code>
 +
|-
 +
| <code>[[source|source2]]</code>
 +
| [[target]] into which calculated driving distance will be stored
 +
* 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>
  

Revision as of 17:23, 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 target into which calculated driving distance will be stored
source2 target into which calculated driving distance will be stored

Example

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

Calculate driving distance and store resuklt into rows

[gn:act_calculateDrivingDistance]|[target,source1,source2;eventWidgetId,event]
Parameter Description
target target into which calculated driving distance will be stored
source1 target into which calculated driving distance will be stored
source2 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]|[@+id/deviceKm,@+id/gpsInput,@+id/deviceGps;@+id/onDistanceReceive,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 target into which calculated driving distance will be stored
source2 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]|[@+id/deviceKm,@+id/gpsInput,@+id/deviceGps;@+id/onDistanceReceive,gn:act_set]