(→Action signatures) |
|||
(21 intermediate revisions by 2 users not shown) | |||
Line 5: | Line 5: | ||
;Description: Action is used to calculate driving distance between two GPS coordinates and store the result into target | ;Description: Action is used to calculate driving distance between two GPS coordinates and store the result into target | ||
:In order for this action to work, an internet connection must be active because the calculations are done by OSRM server. | :In order for this action to work, an internet connection must be active because the calculations are done by OSRM server. | ||
+ | :In case there is no internet connection, <code>[[target|targetColumnNameOrWidgetIdNumber]]</code> and <code>[[target|targetColumnNameOrWidgetIdText]]</code> will not be updated. | ||
;Action returns: void | ;Action returns: void | ||
==Action signatures== | ==Action signatures== | ||
− | ===Full signature=== | + | ===Full signature (M103.8.0.5)=== |
− | :;<code>[gn:act_calculateDrivingDistance]|[targetRows,targetColumnNameOrWidgetIdNumber,targetColumnNameOrWidgetIdText,targetTextSuffix,callbackWidgetWhenDistanceReceived,callbackWidgetActionSet;gpsPointsDataBlock{n}]</code> | + | :;<code>[gn:act_calculateDrivingDistance]|[targetRows,targetColumnNameOrWidgetIdNumber,targetColumnNameOrWidgetIdText,targetTextSuffix,callbackWidgetWhenDistanceReceived,callbackWidgetActionSet,targetIdColumnNameOrWidgetIdTextNumberFormat,callbackWidgetWhenAllDone,callbackWidgetWhenAllDoneActionSet;gpsPointsDataBlock{n}]</code> |
:{| class="wikitable sortable" style="font-size: 85%; text-align: left;" | :{| class="wikitable sortable" style="font-size: 85%; text-align: left;" | ||
Line 48: | Line 49: | ||
* Valid [[source|sources]]: | * Valid [[source|sources]]: | ||
:*<code>hardcoded</code> | :*<code>hardcoded</code> | ||
+ | |- | ||
+ | | <code>targetIdColumnNameOrWidgetIdTextNumberFormat (optional)</code> | ||
+ | | number formatting for <code>targetColumnNameOrWidgetIdText</code> parameter. Default format <code>0.00</code> For valid formats see [https://docs.oracle.com/javase/7/docs/api/java/text/DecimalFormat.html Formats] | ||
+ | * Valid [[source|sources]]: | ||
+ | :*<code>[[Datatypes#text|text]]</code> | ||
|- | |- | ||
| <code>gpsPointsDataBlock{n}</code> | | <code>gpsPointsDataBlock{n}</code> | ||
Line 53: | Line 59: | ||
* Valid [[source|sources]]: | * Valid [[source|sources]]: | ||
:*<code>[[Datatypes#gps|gps]]</code> widgets and/or column id's in case <code>targetRows</code> is defined | :*<code>[[Datatypes#gps|gps]]</code> widgets and/or column id's in case <code>targetRows</code> is defined | ||
+ | |- | ||
+ | | <code>callbackWidgetWhenAllDone</code> | ||
+ | | [[target]] on which is defined <code>callbackWidgetWhenAllDoneActionSet</code> | ||
+ | * Valid [[source|sources]]: | ||
+ | :*<code>widgetId</code> | ||
+ | |- | ||
+ | | <code>callbackWidgetWhenAllDoneActionSet</code> | ||
+ | | [[:Category:Events|event]] action set name which will be fired after all distances are calculated and stored | ||
+ | * Valid [[source|sources]]: | ||
+ | :*<code>hardcoded</code> | ||
|} | |} | ||
− | ===Calculate driving distance=== | + | ===Calculate driving distance (M103.8.0.5)=== |
:;<code>[gn:act_calculateDrivingDistance]|[,targetColumnNameOrWidgetIdNumber;gpsPoint1,gpsPoint2]</code> | :;<code>[gn:act_calculateDrivingDistance]|[,targetColumnNameOrWidgetIdNumber;gpsPoint1,gpsPoint2]</code> | ||
Line 68: | Line 84: | ||
<hr> | <hr> | ||
− | ===Calculate driving distance with callback action=== | + | ===Calculate driving distance with callback action (M103.8.0.5)=== |
:;<code>[gn:act_calculateDrivingDistance]|[,targetColumnNameOrWidgetIdNumber,,,callbackWidgetWhenDistanceReceived,callbackWidgetActionSet;gpsPoint1,gpsPoint2]</code> | :;<code>[gn:act_calculateDrivingDistance]|[,targetColumnNameOrWidgetIdNumber,,,callbackWidgetWhenDistanceReceived,callbackWidgetActionSet;gpsPoint1,gpsPoint2]</code> | ||
Line 81: | Line 97: | ||
<hr> | <hr> | ||
− | ===Calculate driving distance and store result into [[Datatypes#rows|rows]]=== | + | ===Calculate driving distance and store result into [[Datatypes#rows|rows]] (M103.8.0.5)=== |
:;<code>[gn:act_calculateDrivingDistance]|[targetRows,targetColumnNameOrWidgetIdNumber,targetColumnNameOrWidgetIdText,targetTextSuffix;gpsPoint1,gpsPoint2]</code> | :;<code>[gn:act_calculateDrivingDistance]|[targetRows,targetColumnNameOrWidgetIdNumber,targetColumnNameOrWidgetIdText,targetTextSuffix;gpsPoint1,gpsPoint2]</code> | ||
Line 95: | Line 111: | ||
<hr> | <hr> | ||
− | ===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 (M103.8.0.5)=== |
:;<code>[gn:act_calculateDrivingDistance]|[targetRows,targetColumnNameOrWidgetIdNumber,targetColumnNameOrWidgetIdText,targetTextSuffix,callbackWidgetWhenDistanceReceived,callbackWidgetActionSet;gpsPoint1,gpsPoint2]</code> | :;<code>[gn:act_calculateDrivingDistance]|[targetRows,targetColumnNameOrWidgetIdNumber,targetColumnNameOrWidgetIdText,targetTextSuffix,callbackWidgetWhenDistanceReceived,callbackWidgetActionSet;gpsPoint1,gpsPoint2]</code> | ||
Line 118: | Line 134: | ||
:- store the distance (with suffix read from <code>@variable/calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_rowsResult_km</code>) into rows <code>calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_rowsResult</code> same row from where gpsPoints were taken in column <code>devices_kmText</code> with text DT | :- store the distance (with suffix read from <code>@variable/calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_rowsResult_km</code>) into rows <code>calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_rowsResult</code> same row from where gpsPoints were taken in column <code>devices_kmText</code> with text DT | ||
:- execute callback on widget <code>@+id/myCallbackBlock</code> for action <code>gn:act_set</code> | :- execute callback on widget <code>@+id/myCallbackBlock</code> for action <code>gn:act_set</code> | ||
+ | |||
+ | ===Calculate driving distance and store result into [[Datatypes#rows|rows]] with ALL DONE callback action (M103.8.0.5)=== | ||
+ | |||
+ | :;<code>[gn:act_calculateDrivingDistance]|[targetRows,targetColumnNameOrWidgetIdNumber,targetColumnNameOrWidgetIdText,targetTextSuffix,callbackWidgetWhenDistanceReceived,callbackWidgetActionSet,,callbackWidgetWhenAllDone,callbackWidgetWhenAllDoneActionSet;gpsPoint1,gpsPoint2]</code> | ||
+ | |||
+ | ====Example==== | ||
+ | :<code>@variable/calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_rowsResult</code> - targetRows<br> | ||
+ | :<code>devices_km</code> - targetColumnNameOrWidgetIdNumber<br> | ||
+ | :<code>devices_kmText</code> - targetColumnNameOrWidgetIdText<br> | ||
+ | :<code>@variable/calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_rowsResult_km</code> - targetTextSuffix<br> | ||
+ | :<code>@+id/myCallbackBlock</code> - callbackWidgetWhenDistanceReceived<br> | ||
+ | :<code>gn:act_set</code> - callbackWidgetActionSet<br> | ||
+ | :<code>devicesFullInfo_gps</code> - gpsPoint1<br> | ||
+ | :<code>@variable/calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_pointTwo</code> - gpsPoint2<br> | ||
+ | :<code>@variable/calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_pointThree</code> - gpsPoint3<br> | ||
+ | :<code>@+id/myCallbackBlockAllDone</code> - callbackWidgetWhenAllDone<br> | ||
+ | :<code>gn:act_set</code> - callbackWidgetActionSet<br> | ||
+ | :; ⤷ <code>[gn:act_calculateDrivingDistance]|[@variable/calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_rowsResult,devices_km,devices_kmText,@variable/calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_rowsResult_km,@+id/myCallbackBlock,gn:act_set,,@+id/myCallbackBlockAllDone,gn:act_set;devicesFullInfo_gps,@variable/calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_pointTwo,@variable/calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_pointThree]</code> | ||
+ | |||
+ | =====Explanation===== | ||
+ | For each row in <code>@variable/calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_rowsResult</code> | ||
+ | :- get the datatype GPS value of the column named <code>devicesFullInfo_gps</code>, <code>calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_pointTwo</code>,<code>calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_pointThree</code> | ||
+ | :- asynchronously connect to our osrm server, send gpsPoints and get the distance | ||
+ | :- store the distance into rows <code>calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_rowsResult</code> same row from where gpsPoints were taken in column <code>devices_km</code> with number DT | ||
+ | :- store the distance (with suffix read from <code>@variable/calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_rowsResult_km</code>) into rows <code>calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_rowsResult</code> same row from where gpsPoints were taken in column <code>devices_kmText</code> with text DT | ||
+ | :- execute callback on widget <code>@+id/myCallbackBlock</code> for action <code>gn:act_set</code> | ||
+ | |||
+ | :- after all rows are done, execute callback on widget <code>@+id/myCallbackBlockAllDone</code> for action <code>gn:act_set</code> | ||
<hr> | <hr> |
Latest revision as of 10:30, 23 October 2020
Contents
- 1 Action signatures
- 1.1 Full signature (M103.8.0.5)
- 1.2 Calculate driving distance (M103.8.0.5)
- 1.3 Calculate driving distance with callback action (M103.8.0.5)
- 1.4 Calculate driving distance and store result into rows (M103.8.0.5)
- 1.5 Calculate driving distance and store result into rows with callback action (M103.8.0.5)
- 1.6 Calculate driving distance and store result into rows with ALL DONE callback action (M103.8.0.5)
gn:act_calculateDrivingDistance
- Description
- Action is used to calculate driving distance between two GPS coordinates and store the result into target
- In order for this action to work, an internet connection must be active because the calculations are done by OSRM server.
- In case there is no internet connection,
targetColumnNameOrWidgetIdNumber
andtargetColumnNameOrWidgetIdText
will not be updated.
- Action returns
- void
Action signatures
Full signature (M103.8.0.5)
[gn:act_calculateDrivingDistance]|[targetRows,targetColumnNameOrWidgetIdNumber,targetColumnNameOrWidgetIdText,targetTextSuffix,callbackWidgetWhenDistanceReceived,callbackWidgetActionSet,targetIdColumnNameOrWidgetIdTextNumberFormat,callbackWidgetWhenAllDone,callbackWidgetWhenAllDoneActionSet;gpsPointsDataBlock{n}]
Parameter Description targetRows
target target rows which can be used as source for calculating distance and target for storing calculated distance - Valid targets:
targetColumnNameOrWidgetIdNumber
target column in row or widget into which calculated distance will be stored - Valid targets:
targetColumnNameOrWidgetIdText
target column in row or widget into which calculated distance will be stored as text. targetTextSuffix
will be appended as suffix to the value- Valid targets:
targetTextSuffix
source suffix which will be added to targetColumnNameOrWidgetIdText
- Valid sources:
callbackWidgetWhenDistanceReceived
target on which is defined callbackWidgetActionSet
- Valid sources:
widgetId
callbackWidgetActionSet
event action set name which will be fired after distance is calculated and stored - Valid sources:
hardcoded
targetIdColumnNameOrWidgetIdTextNumberFormat (optional)
number formatting for targetColumnNameOrWidgetIdText
parameter. Default format0.00
For valid formats see Formats- Valid sources:
gpsPointsDataBlock{n}
sources which will be included into calculation - Valid sources:
gps
widgets and/or column id's in casetargetRows
is defined
callbackWidgetWhenAllDone
target on which is defined callbackWidgetWhenAllDoneActionSet
- Valid sources:
widgetId
callbackWidgetWhenAllDoneActionSet
event action set name which will be fired after all distances are calculated and stored - Valid sources:
hardcoded
Calculate driving distance (M103.8.0.5)
[gn:act_calculateDrivingDistance]|[,targetColumnNameOrWidgetIdNumber;gpsPoint1,gpsPoint2]
Example
@+id/calculateDrivingDistance_calculateDrivingDistance_result
- targetColumnNameOrWidgetIdNumber@+id/calculateDrivingDistance_calculateDrivingDistance_pointOne
- gpsPoint1@+id/calculateDrivingDistance_calculateDrivingDistance_pointTwo
- gpsPoint2@+id/calculateDrivingDistance_calculateDrivingDistance_pointThree
- gpsPoint3@+id/calculateDrivingDistance_calculateDrivingDistance_pointFour
- gpsPoint4
- ⤷ [gn
- act_calculateDrivingDistance]|[,@+id/calculateDrivingDistance_calculateDrivingDistance_result;@variable/calculateDrivingDistance_calculateDrivingDistance_pointOne,@variable/calculateDrivingDistance_calculateDrivingDistance_pointTwo,@variable/calculateDrivingDistance_calculateDrivingDistance_pointThree,@variable/calculateDrivingDistance_calculateDrivingDistance_pointFour]
Calculate driving distance with callback action (M103.8.0.5)
[gn:act_calculateDrivingDistance]|[,targetColumnNameOrWidgetIdNumber,,,callbackWidgetWhenDistanceReceived,callbackWidgetActionSet;gpsPoint1,gpsPoint2]
Example
@+id/calculateDrivingDistance_withCallbackAction_result
- targetColumnNameOrWidgetIdNumber@+id/calculateDrivingDistance_withCallbackAction_pointOne
- gpsPoint1@+id/calculateDrivingDistance_withCallbackAction_pointTwo
- gpsPoint2@+id/myCallbackBlock
- callbackWidgetWhenDistanceReceivedgn:act_set
- callbackWidgetActionSet
- ⤷
[gn:act_calculateDrivingDistance]|[,@+id/calculateDrivingDistance_withCallbackAction_result,,,@+id/myCallbackBlock,gn:act_set;@variable/calculateDrivingDistance_withCallbackAction_pointOne,@variable/calculateDrivingDistance_withCallbackAction_pointTwo]
- ⤷
Calculate driving distance and store result into rows (M103.8.0.5)
[gn:act_calculateDrivingDistance]|[targetRows,targetColumnNameOrWidgetIdNumber,targetColumnNameOrWidgetIdText,targetTextSuffix;gpsPoint1,gpsPoint2]
Example
@variable/calculateDrivingDistance_storeResultIntoRows_rowsResult
- targetRowsdevices_km
- targetColumnNameOrWidgetIdNumberdevices_kmText
- targetColumnNameOrWidgetIdText@variable/calculateDrivingDistance_storeResultIntoRows_rowsResult_km
- targetTextSuffixdevicesFullInfo_gps
- gpsPoint1@variable/calculateDrivingDistance_storeResultIntoRows_pointOne
- gpsPoint2
- ⤷
[gn:act_calculateDrivingDistance]|[@variable/calculateDrivingDistance_storeResultIntoRows_rowsResult,devices_km,devices_kmText,@variable/calculateDrivingDistance_storeResultIntoRows_rowsResult_km;devicesFullInfo_gps,@variable/calculateDrivingDistance_storeResultIntoRows_pointOne]
- ⤷
Calculate driving distance and store result into rows with callback action (M103.8.0.5)
[gn:act_calculateDrivingDistance]|[targetRows,targetColumnNameOrWidgetIdNumber,targetColumnNameOrWidgetIdText,targetTextSuffix,callbackWidgetWhenDistanceReceived,callbackWidgetActionSet;gpsPoint1,gpsPoint2]
Example
@variable/calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_rowsResult
- targetRowsdevices_km
- targetColumnNameOrWidgetIdNumberdevices_kmText
- targetColumnNameOrWidgetIdText@variable/calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_rowsResult_km
- targetTextSuffix@+id/myCallbackBlock
- callbackWidgetWhenDistanceReceivedgn:act_set
- callbackWidgetActionSetdevicesFullInfo_gps
- gpsPoint1@variable/calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_pointTwo
- gpsPoint2@variable/calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_pointThree
- gpsPoint3
- ⤷
[gn:act_calculateDrivingDistance]|[@variable/calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_rowsResult,devices_km,devices_kmText,@variable/calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_rowsResult_km,@+id/myCallbackBlock,gn:act_set;devicesFullInfo_gps,@variable/calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_pointTwo,@variable/calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_pointThree]
- ⤷
Explanation
For each row in @variable/calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_rowsResult
- - get the datatype GPS value of the column named
devicesFullInfo_gps
,calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_pointTwo
,calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_pointThree
- - asynchronously connect to our osrm server, send gpsPoints and get the distance
- - store the distance into rows
calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_rowsResult
same row from where gpsPoints were taken in columndevices_km
with number DT - - store the distance (with suffix read from
@variable/calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_rowsResult_km
) into rowscalculateDrivingDistance_storeResultIntoRowsWithCallbackAction_rowsResult
same row from where gpsPoints were taken in columndevices_kmText
with text DT - - execute callback on widget
@+id/myCallbackBlock
for actiongn:act_set
Calculate driving distance and store result into rows with ALL DONE callback action (M103.8.0.5)
[gn:act_calculateDrivingDistance]|[targetRows,targetColumnNameOrWidgetIdNumber,targetColumnNameOrWidgetIdText,targetTextSuffix,callbackWidgetWhenDistanceReceived,callbackWidgetActionSet,,callbackWidgetWhenAllDone,callbackWidgetWhenAllDoneActionSet;gpsPoint1,gpsPoint2]
Example
@variable/calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_rowsResult
- targetRowsdevices_km
- targetColumnNameOrWidgetIdNumberdevices_kmText
- targetColumnNameOrWidgetIdText@variable/calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_rowsResult_km
- targetTextSuffix@+id/myCallbackBlock
- callbackWidgetWhenDistanceReceivedgn:act_set
- callbackWidgetActionSetdevicesFullInfo_gps
- gpsPoint1@variable/calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_pointTwo
- gpsPoint2@variable/calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_pointThree
- gpsPoint3@+id/myCallbackBlockAllDone
- callbackWidgetWhenAllDonegn:act_set
- callbackWidgetActionSet
- ⤷
[gn:act_calculateDrivingDistance]|[@variable/calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_rowsResult,devices_km,devices_kmText,@variable/calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_rowsResult_km,@+id/myCallbackBlock,gn:act_set,,@+id/myCallbackBlockAllDone,gn:act_set;devicesFullInfo_gps,@variable/calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_pointTwo,@variable/calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_pointThree]
- ⤷
Explanation
For each row in @variable/calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_rowsResult
- - get the datatype GPS value of the column named
devicesFullInfo_gps
,calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_pointTwo
,calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_pointThree
- - asynchronously connect to our osrm server, send gpsPoints and get the distance
- - store the distance into rows
calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_rowsResult
same row from where gpsPoints were taken in columndevices_km
with number DT - - store the distance (with suffix read from
@variable/calculateDrivingDistance_storeResultIntoRowsWithCallbackAction_rowsResult_km
) into rowscalculateDrivingDistance_storeResultIntoRowsWithCallbackAction_rowsResult
same row from where gpsPoints were taken in columndevices_kmText
with text DT - - execute callback on widget
@+id/myCallbackBlock
for actiongn:act_set
- - after all rows are done, execute callback on widget
@+id/myCallbackBlockAllDone
for actiongn:act_set