Skip to content

Commit

Permalink
update showsIf conditions for conditional surveys
Browse files Browse the repository at this point in the history
Finally!

First, the coordinates change from NREL Building 16 (which we were using for the purpose of testing) to DFC Building 40 (which is the actual location of the Fermata chargers).

Second, instead of using the 'sensed_mode_str' (which we were also doing for the purpose of testing), we can actually use the vehicle detected by bluetooth to show surveys conditionally.

These "showsIf" expressions work with the changes in e-mission/e-mission-phone#1145.
It will not work in Python yet; I am planning a way to do that later.

"confirmedMode" is either a vehicle detected by bluetooth, or the label chosen by the user. In this instance it is the former; it is one of the vehicles defined under "vehicle_identities" (or, for a trip where there was no vehicle detected, detected it is undefined).

Updating config version to 3 so we can receive these updates using the in-app config refresh feature!
  • Loading branch information
JGreenlee committed Apr 15, 2024
1 parent 07dcdf7 commit 725c2d6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions configs/dfc-fermata.nrel-op.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"url_abbreviation": "dfc-fermata",
"version": 2,
"version": 3,
"ts": 1707714796485,
"server": {
"connectUrl": "https://dfc-fermata-openpath.nrel.gov/api/",
Expand Down Expand Up @@ -69,17 +69,17 @@
{
"surveyName": "DfcGasTrip",
"not-filled-in-label": { "en": "Gas Car Survey" },
"showsIf": "sections[0]['sensed_mode_str'] == 'CAR'"
"showsIf": "confirmedMode?.baseMode == 'CAR'"
},
{
"surveyName": "DfcEvRoamingTrip",
"not-filled-in-label": { "en": "EV Survey" },
"showsIf": "sections[0]['sensed_mode_str'] != 'CAR' && !pointIsWithinBounds(end_loc['coordinates'], [[-105.153, 39.745], [-105.150, 39.743]])"
"showsIf": "confirmedMode?.baseMode == 'E_CAR' && !pointIsWithinBounds(end_loc['coordinates'], [[-105.118, 39.719], [-105.115, 39.717]])"
},
{
"surveyName": "DfcEvReturnTrip",
"not-filled-in-label": { "en": "EV Survey" },
"showsIf": "sections[0]['sensed_mode_str'] != 'CAR' && pointIsWithinBounds(end_loc['coordinates'], [[-105.153, 39.745], [-105.150, 39.743]])"
"showsIf": "confirmedMode?.baseMode == 'E_CAR' && pointIsWithinBounds(end_loc['coordinates'], [[-105.118, 39.719], [-105.115, 39.717]])"
}
]
},
Expand Down

0 comments on commit 725c2d6

Please sign in to comment.