Skip to content

Commit

Permalink
add second location for testing DfcEvReturnTrip
Browse files Browse the repository at this point in the history
Now the DfcEvReturnTrip will show if the BLE mode is E_CAR and the end location is inside either of these two boxes.

Also, since these surveys are read in order and the matched survey is the first one whose condition matches, we can treat this like an if / else if block.
I reordered DfcEvReturnTrip before DfcEvRoamingTrip so we don't have to specifically say `!pointIsWithinBounds(...)` on DfcEvRoamingTrip, making these conditions slightly less verbose.
  • Loading branch information
JGreenlee committed May 15, 2024
1 parent 093928e commit caa91f4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 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": 6,
"version": 7,
"ts": 1707714796485,
"server": {
"connectUrl": "https://dfc-fermata-openpath.nrel.gov/api/",
Expand Down Expand Up @@ -72,14 +72,14 @@
"showsIf": "confirmedMode?.baseMode == 'CAR'"
},
{
"surveyName": "DfcEvRoamingTrip",
"surveyName": "DfcEvReturnTrip",
"not-filled-in-label": { "en": "EV Survey" },
"showsIf": "confirmedMode?.baseMode == 'E_CAR' && !pointIsWithinBounds(end_loc['coordinates'], [[-105.118, 39.719], [-105.115, 39.717]])"
"showsIf": "confirmedMode?.baseMode == 'E_CAR' && (pointIsWithinBounds(end_loc['coordinates'], [[-105.118, 39.719], [-105.115, 39.717]]) || pointIsWithinBounds(end_loc['coordinates'], [[-105.13, 39.853], [-105.11, 39.847]]))"
},
{
"surveyName": "DfcEvReturnTrip",
"surveyName": "DfcEvRoamingTrip",
"not-filled-in-label": { "en": "EV Survey" },
"showsIf": "confirmedMode?.baseMode == 'E_CAR' && pointIsWithinBounds(end_loc['coordinates'], [[-105.118, 39.719], [-105.115, 39.717]])"
"showsIf": "confirmedMode?.baseMode == 'E_CAR'"
}
]
},
Expand Down

0 comments on commit caa91f4

Please sign in to comment.