From 3492b5d40326bb404fbeeeba6f63608d0aaad113 Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Mon, 13 Sep 2021 01:21:25 +0200 Subject: [PATCH] More improvements to the charging station theme --- .../charging_station/charging_station.json | 1353 ++++++++++++++++- .../charging_station.protojson | 61 +- assets/layers/charging_station/csvToJson.ts | 275 +++- assets/layers/charging_station/types.csv | 20 +- 4 files changed, 1611 insertions(+), 98 deletions(-) diff --git a/assets/layers/charging_station/charging_station.json b/assets/layers/charging_station/charging_station.json index c8c55450e0..e69f0259db 100644 --- a/assets/layers/charging_station/charging_station.json +++ b/assets/layers/charging_station/charging_station.json @@ -129,10 +129,12 @@ { "#": "capacity", "render": { - "en": "{capacity} vehicles can be charged here at the same time" + "en": "{capacity} vehicles can be charged here at the same time", + "nl": "{capacity} voertuigen kunnen hier op hetzelfde moment opgeladen worden" }, "question": { - "en": "How much vehicles can be charged here at the same time?" + "en": "How much vehicles can be charged here at the same time?", + "nl": "Hoeveel voertuigen kunnen hier opgeladen worden?" }, "freeform": { "key": "capacity", @@ -148,11 +150,9 @@ { "if": "socket:schuko=1", "ifnot": "socket:schuko=", - "then": " Schuko wall plug without ground pin (CEE7/4 type F)", - "hideInAnswer": { - "or": [ - "_country!=be" - ] + "then": { + "en": " Schuko wall plug without ground pin (CEE7/4 type F)", + "nl": " Schuko stekker zonder aardingspin (CEE7/4 type F)" } }, { @@ -162,13 +162,19 @@ "socket:schuko!=1" ] }, - "then": " Schuko wall plug without ground pin (CEE7/4 type F)", + "then": { + "en": " Schuko wall plug without ground pin (CEE7/4 type F)", + "nl": " Schuko stekker zonder aardingspin (CEE7/4 type F)" + }, "hideInAnswer": true }, { "if": "socket:typee=1", "ifnot": "socket:typee=", - "then": " European wall plug with ground pin (CEE7/4 type E)" + "then": { + "en": " European wall plug with ground pin (CEE7/4 type E)", + "nl": " Europese stekker met aardingspin (CEE7/4 type E)" + } }, { "if": { @@ -177,13 +183,19 @@ "socket:typee!=1" ] }, - "then": " European wall plug with ground pin (CEE7/4 type E)", + "then": { + "en": " European wall plug with ground pin (CEE7/4 type E)", + "nl": " Europese stekker met aardingspin (CEE7/4 type E)" + }, "hideInAnswer": true }, { "if": "socket:chademo=1", "ifnot": "socket:chademo=", - "then": " Chademo" + "then": { + "en": " Chademo", + "nl": " " + } }, { "if": { @@ -192,13 +204,19 @@ "socket:chademo!=1" ] }, - "then": " Chademo", + "then": { + "en": " Chademo", + "nl": " " + }, "hideInAnswer": true }, { "if": "socket:type1_cable=1", "ifnot": "socket:type1_cable=", - "then": " Type 1 with cable (J1772)" + "then": { + "en": " Type 1 with cable (J1772)", + "nl": " Type 1 met kabel (J1772)" + } }, { "if": { @@ -207,13 +225,19 @@ "socket:type1_cable!=1" ] }, - "then": " Type 1 with cable (J1772)", + "then": { + "en": " Type 1 with cable (J1772)", + "nl": " Type 1 met kabel (J1772)" + }, "hideInAnswer": true }, { "if": "socket:type1=1", "ifnot": "socket:type1=", - "then": " Type 1 without cable (J1772)" + "then": { + "en": " Type 1 without cable (J1772)", + "nl": " Type 1 zonder kabel (J1772)" + } }, { "if": { @@ -222,13 +246,19 @@ "socket:type1!=1" ] }, - "then": " Type 1 without cable (J1772)", + "then": { + "en": " Type 1 without cable (J1772)", + "nl": " Type 1 zonder kabel (J1772)" + }, "hideInAnswer": true }, { "if": "socket:type1_combo=1", "ifnot": "socket:type1_combo=", - "then": " Type 1 CCS (aka Type 1 Combo)" + "then": { + "en": " Type 1 CCS (aka Type 1 Combo)", + "nl": " " + } }, { "if": { @@ -237,13 +267,19 @@ "socket:type1_combo!=1" ] }, - "then": " Type 1 CCS (aka Type 1 Combo)", + "then": { + "en": " Type 1 CCS (aka Type 1 Combo)", + "nl": " " + }, "hideInAnswer": true }, { "if": "socket:tesla_supercharger=1", "ifnot": "socket:tesla_supercharger=", - "then": " Tesla Supercharger" + "then": { + "en": " Tesla Supercharger", + "nl": " " + } }, { "if": { @@ -252,13 +288,19 @@ "socket:tesla_supercharger!=1" ] }, - "then": " Tesla Supercharger", + "then": { + "en": " Tesla Supercharger", + "nl": " " + }, "hideInAnswer": true }, { "if": "socket:type2=1", "ifnot": "socket:type2=", - "then": " Type 2 (mennekes)" + "then": { + "en": " Type 2 (mennekes)", + "nl": " " + } }, { "if": { @@ -267,13 +309,19 @@ "socket:type2!=1" ] }, - "then": " Type 2 (mennekes)", + "then": { + "en": " Type 2 (mennekes)", + "nl": " " + }, "hideInAnswer": true }, { "if": "socket:type2_combo=1", "ifnot": "socket:type2_combo=", - "then": " Type 2 CCS (mennekes)" + "then": { + "en": " Type 2 CCS (mennekes)", + "nl": " " + } }, { "if": { @@ -282,109 +330,1162 @@ "socket:type2_combo!=1" ] }, - "then": " Type 2 CCS (mennekes)", + "then": { + "en": " Type 2 CCS (mennekes)", + "nl": " " + }, "hideInAnswer": true } ] }, { "question": { - "en": "How much plugs of type Schuko wall plug without ground pin (CEE7/4 type F) are available here?" + "en": "How much plugs of type Schuko wall plug without ground pin (CEE7/4 type F) are available here?", + "nl": "Hoeveel stekkers van type Schuko stekker zonder aardingspin (CEE7/4 type F) heeft dit oplaadpunt?" + }, + "render": { + "en": "There are Schuko wall plug without ground pin (CEE7/4 type F) plugs of type [object Map] available here", + "nl": "Hier zijn Schuko stekker zonder aardingspin (CEE7/4 type F) stekkers van het type [object Map]" }, - "render": "There are {socket:schuko} plugs of type Schuko wall plug without ground pin (CEE7/4 type F) available here", "freeform": { "key": "socket:schuko", "type": "pnat" }, - "condition": "socket:schuko~*" + "condition": { + "and": [ + "socket:schuko~*", + "socket:schuko!=0" + ] + } }, { "question": { - "en": "How much plugs of type European wall plug with ground pin (CEE7/4 type E) are available here?" + "en": "What voltage do the plugs with Schuko wall plug without ground pin (CEE7/4 type F) offer?", + "nl": "Welke spanning levert de stekker van type Schuko stekker zonder aardingspin (CEE7/4 type F) " + }, + "render": { + "en": "Schuko wall plug without ground pin (CEE7/4 type F) outputs {socket:schuko:voltage} volt", + "nl": "Schuko stekker zonder aardingspin (CEE7/4 type F) heeft een spanning van {socket:schuko:voltage} volt" + }, + "freeform": { + "key": "socket:schuko:voltage", + "type": "pfloat" + }, + "mappings": [ + { + "if": "socket:socket:schuko:voltage=230 V", + "then": { + "en": "Schuko wall plug without ground pin (CEE7/4 type F) outputs 230 volt", + "nl": "Schuko stekker zonder aardingspin (CEE7/4 type F) heeft een spanning van 230 volt" + } + } + ], + "condition": { + "and": [ + "socket:schuko~*", + "socket:schuko!=0" + ] + } + }, + { + "question": { + "en": "What current do the plugs with Schuko wall plug without ground pin (CEE7/4 type F) offer?", + "nl": "Welke stroom levert de stekker van type Schuko stekker zonder aardingspin (CEE7/4 type F) ?" + }, + "render": { + "en": "Schuko wall plug without ground pin (CEE7/4 type F) outputs at most {socket:schuko:current}A", + "nl": "Schuko stekker zonder aardingspin (CEE7/4 type F) levert een stroom van maximaal {socket:schuko:current}A" + }, + "freeform": { + "key": "socket:schuko:current", + "type": "pfloat" + }, + "mappings": [ + { + "if": "socket:socket:schuko:current=16 A", + "then": { + "en": "Schuko wall plug without ground pin (CEE7/4 type F) outputs at most 16 A", + "nl": "Schuko stekker zonder aardingspin (CEE7/4 type F) levert een stroom van maximaal 16 A" + } + } + ], + "condition": { + "and": [ + "socket:schuko~*", + "socket:schuko!=0" + ] + } + }, + { + "question": { + "en": "What power output does a single plug of type Schuko wall plug without ground pin (CEE7/4 type F) offer?", + "nl": "Welk vermogen levert een enkele stekker van type Schuko stekker zonder aardingspin (CEE7/4 type F) ?" + }, + "render": { + "en": "Schuko wall plug without ground pin (CEE7/4 type F) outputs at most {socket:schuko:output}", + "nl": "Schuko stekker zonder aardingspin (CEE7/4 type F) levert een vermogen van maximaal {socket:schuko:output}" + }, + "freeform": { + "key": "socket:schuko:output", + "type": "pfloat" + }, + "mappings": [ + { + "if": "socket:socket:schuko:output=3.6 kw", + "then": { + "en": "Schuko wall plug without ground pin (CEE7/4 type F) outputs at most 3.6 kw", + "nl": "Schuko stekker zonder aardingspin (CEE7/4 type F) levert een vermogen van maximaal 3.6 kw" + } + } + ], + "condition": { + "and": [ + "socket:schuko~*", + "socket:schuko!=0" + ] + } + }, + { + "question": { + "en": "How much plugs of type European wall plug with ground pin (CEE7/4 type E) are available here?", + "nl": "Hoeveel stekkers van type Europese stekker met aardingspin (CEE7/4 type E) heeft dit oplaadpunt?" + }, + "render": { + "en": "There are European wall plug with ground pin (CEE7/4 type E) plugs of type [object Map] available here", + "nl": "Hier zijn Europese stekker met aardingspin (CEE7/4 type E) stekkers van het type [object Map]" }, - "render": "There are {socket:typee} plugs of type European wall plug with ground pin (CEE7/4 type E) available here", "freeform": { "key": "socket:typee", "type": "pnat" }, - "condition": "socket:typee~*" + "condition": { + "and": [ + "socket:typee~*", + "socket:typee!=0" + ] + } }, { "question": { - "en": "How much plugs of type Chademo are available here?" + "en": "What voltage do the plugs with European wall plug with ground pin (CEE7/4 type E) offer?", + "nl": "Welke spanning levert de stekker van type Europese stekker met aardingspin (CEE7/4 type E) " + }, + "render": { + "en": "European wall plug with ground pin (CEE7/4 type E) outputs {socket:typee:voltage} volt", + "nl": "Europese stekker met aardingspin (CEE7/4 type E) heeft een spanning van {socket:typee:voltage} volt" + }, + "freeform": { + "key": "socket:typee:voltage", + "type": "pfloat" + }, + "mappings": [ + { + "if": "socket:socket:typee:voltage=230 V", + "then": { + "en": "European wall plug with ground pin (CEE7/4 type E) outputs 230 volt", + "nl": "Europese stekker met aardingspin (CEE7/4 type E) heeft een spanning van 230 volt" + } + } + ], + "condition": { + "and": [ + "socket:typee~*", + "socket:typee!=0" + ] + } + }, + { + "question": { + "en": "What current do the plugs with European wall plug with ground pin (CEE7/4 type E) offer?", + "nl": "Welke stroom levert de stekker van type Europese stekker met aardingspin (CEE7/4 type E) ?" + }, + "render": { + "en": "European wall plug with ground pin (CEE7/4 type E) outputs at most {socket:typee:current}A", + "nl": "Europese stekker met aardingspin (CEE7/4 type E) levert een stroom van maximaal {socket:typee:current}A" + }, + "freeform": { + "key": "socket:typee:current", + "type": "pfloat" + }, + "mappings": [ + { + "if": "socket:socket:typee:current=16 A", + "then": { + "en": "European wall plug with ground pin (CEE7/4 type E) outputs at most 16 A", + "nl": "Europese stekker met aardingspin (CEE7/4 type E) levert een stroom van maximaal 16 A" + } + } + ], + "condition": { + "and": [ + "socket:typee~*", + "socket:typee!=0" + ] + } + }, + { + "question": { + "en": "What power output does a single plug of type European wall plug with ground pin (CEE7/4 type E) offer?", + "nl": "Welk vermogen levert een enkele stekker van type Europese stekker met aardingspin (CEE7/4 type E) ?" + }, + "render": { + "en": "European wall plug with ground pin (CEE7/4 type E) outputs at most {socket:typee:output}", + "nl": "Europese stekker met aardingspin (CEE7/4 type E) levert een vermogen van maximaal {socket:typee:output}" + }, + "freeform": { + "key": "socket:typee:output", + "type": "pfloat" + }, + "mappings": [ + { + "if": "socket:socket:typee:output=3 kw", + "then": { + "en": "European wall plug with ground pin (CEE7/4 type E) outputs at most 3 kw", + "nl": "Europese stekker met aardingspin (CEE7/4 type E) levert een vermogen van maximaal 3 kw" + } + }, + { + "if": "socket:socket:typee:output=22 kw", + "then": { + "en": "European wall plug with ground pin (CEE7/4 type E) outputs at most 22 kw", + "nl": "Europese stekker met aardingspin (CEE7/4 type E) levert een vermogen van maximaal 22 kw" + } + } + ], + "condition": { + "and": [ + "socket:typee~*", + "socket:typee!=0" + ] + } + }, + { + "question": { + "en": "How much plugs of type Chademo are available here?", + "nl": "Hoeveel stekkers van type heeft dit oplaadpunt?" + }, + "render": { + "en": "There are Chademo plugs of type [object Map] available here", + "nl": "Hier zijn stekkers van het type [object Map]" }, - "render": "There are {socket:chademo} plugs of type Chademo available here", "freeform": { "key": "socket:chademo", "type": "pnat" }, - "condition": "socket:chademo~*" + "condition": { + "and": [ + "socket:chademo~*", + "socket:chademo!=0" + ] + } }, { "question": { - "en": "How much plugs of type Type 1 with cable (J1772) are available here?" + "en": "What voltage do the plugs with Chademo offer?", + "nl": "Welke spanning levert de stekker van type " + }, + "render": { + "en": "Chademo outputs {socket:chademo:voltage} volt", + "nl": " heeft een spanning van {socket:chademo:voltage} volt" + }, + "freeform": { + "key": "socket:chademo:voltage", + "type": "pfloat" + }, + "mappings": [ + { + "if": "socket:socket:chademo:voltage=500 V", + "then": { + "en": "Chademo outputs 500 volt", + "nl": " heeft een spanning van 500 volt" + } + } + ], + "condition": { + "and": [ + "socket:chademo~*", + "socket:chademo!=0" + ] + } + }, + { + "question": { + "en": "What current do the plugs with Chademo offer?", + "nl": "Welke stroom levert de stekker van type ?" + }, + "render": { + "en": "Chademo outputs at most {socket:chademo:current}A", + "nl": " levert een stroom van maximaal {socket:chademo:current}A" + }, + "freeform": { + "key": "socket:chademo:current", + "type": "pfloat" + }, + "mappings": [ + { + "if": "socket:socket:chademo:current=120 A", + "then": { + "en": "Chademo outputs at most 120 A", + "nl": " levert een stroom van maximaal 120 A" + } + } + ], + "condition": { + "and": [ + "socket:chademo~*", + "socket:chademo!=0" + ] + } + }, + { + "question": { + "en": "What power output does a single plug of type Chademo offer?", + "nl": "Welk vermogen levert een enkele stekker van type ?" + }, + "render": { + "en": "Chademo outputs at most {socket:chademo:output}", + "nl": " levert een vermogen van maximaal {socket:chademo:output}" + }, + "freeform": { + "key": "socket:chademo:output", + "type": "pfloat" + }, + "mappings": [ + { + "if": "socket:socket:chademo:output=50 kw", + "then": { + "en": "Chademo outputs at most 50 kw", + "nl": " levert een vermogen van maximaal 50 kw" + } + } + ], + "condition": { + "and": [ + "socket:chademo~*", + "socket:chademo!=0" + ] + } + }, + { + "question": { + "en": "How much plugs of type Type 1 with cable (J1772) are available here?", + "nl": "Hoeveel stekkers van type Type 1 met kabel (J1772) heeft dit oplaadpunt?" + }, + "render": { + "en": "There are Type 1 with cable (J1772) plugs of type [object Map] available here", + "nl": "Hier zijn Type 1 met kabel (J1772) stekkers van het type [object Map]" }, - "render": "There are {socket:type1_cable} plugs of type Type 1 with cable (J1772) available here", "freeform": { "key": "socket:type1_cable", "type": "pnat" }, - "condition": "socket:type1_cable~*" + "condition": { + "and": [ + "socket:type1_cable~*", + "socket:type1_cable!=0" + ] + } }, { "question": { - "en": "How much plugs of type Type 1 without cable (J1772) are available here?" + "en": "What voltage do the plugs with Type 1 with cable (J1772) offer?", + "nl": "Welke spanning levert de stekker van type Type 1 met kabel (J1772) " + }, + "render": { + "en": "Type 1 with cable (J1772) outputs {socket:type1_cable:voltage} volt", + "nl": "Type 1 met kabel (J1772) heeft een spanning van {socket:type1_cable:voltage} volt" + }, + "freeform": { + "key": "socket:type1_cable:voltage", + "type": "pfloat" + }, + "mappings": [ + { + "if": "socket:socket:type1_cable:voltage=200 V", + "then": { + "en": "Type 1 with cable (J1772) outputs 200 volt", + "nl": "Type 1 met kabel (J1772) heeft een spanning van 200 volt" + } + }, + { + "if": "socket:socket:type1_cable:voltage=240 V", + "then": { + "en": "Type 1 with cable (J1772) outputs 240 volt", + "nl": "Type 1 met kabel (J1772) heeft een spanning van 240 volt" + } + } + ], + "condition": { + "and": [ + "socket:type1_cable~*", + "socket:type1_cable!=0" + ] + } + }, + { + "question": { + "en": "What current do the plugs with Type 1 with cable (J1772) offer?", + "nl": "Welke stroom levert de stekker van type Type 1 met kabel (J1772) ?" + }, + "render": { + "en": "Type 1 with cable (J1772) outputs at most {socket:type1_cable:current}A", + "nl": "Type 1 met kabel (J1772) levert een stroom van maximaal {socket:type1_cable:current}A" + }, + "freeform": { + "key": "socket:type1_cable:current", + "type": "pfloat" + }, + "mappings": [ + { + "if": "socket:socket:type1_cable:current=32 A", + "then": { + "en": "Type 1 with cable (J1772) outputs at most 32 A", + "nl": "Type 1 met kabel (J1772) levert een stroom van maximaal 32 A" + } + } + ], + "condition": { + "and": [ + "socket:type1_cable~*", + "socket:type1_cable!=0" + ] + } + }, + { + "question": { + "en": "What power output does a single plug of type Type 1 with cable (J1772) offer?", + "nl": "Welk vermogen levert een enkele stekker van type Type 1 met kabel (J1772) ?" + }, + "render": { + "en": "Type 1 with cable (J1772) outputs at most {socket:type1_cable:output}", + "nl": "Type 1 met kabel (J1772) levert een vermogen van maximaal {socket:type1_cable:output}" + }, + "freeform": { + "key": "socket:type1_cable:output", + "type": "pfloat" + }, + "mappings": [ + { + "if": "socket:socket:type1_cable:output=3.7 kw", + "then": { + "en": "Type 1 with cable (J1772) outputs at most 3.7 kw", + "nl": "Type 1 met kabel (J1772) levert een vermogen van maximaal 3.7 kw" + } + }, + { + "if": "socket:socket:type1_cable:output=7 kw", + "then": { + "en": "Type 1 with cable (J1772) outputs at most 7 kw", + "nl": "Type 1 met kabel (J1772) levert een vermogen van maximaal 7 kw" + } + } + ], + "condition": { + "and": [ + "socket:type1_cable~*", + "socket:type1_cable!=0" + ] + } + }, + { + "question": { + "en": "How much plugs of type Type 1 without cable (J1772) are available here?", + "nl": "Hoeveel stekkers van type Type 1 zonder kabel (J1772) heeft dit oplaadpunt?" + }, + "render": { + "en": "There are Type 1 without cable (J1772) plugs of type [object Map] available here", + "nl": "Hier zijn Type 1 zonder kabel (J1772) stekkers van het type [object Map]" }, - "render": "There are {socket:type1} plugs of type Type 1 without cable (J1772) available here", "freeform": { "key": "socket:type1", "type": "pnat" }, - "condition": "socket:type1~*" + "condition": { + "and": [ + "socket:type1~*", + "socket:type1!=0" + ] + } }, { "question": { - "en": "How much plugs of type Type 1 CCS (aka Type 1 Combo) are available here?" + "en": "What voltage do the plugs with Type 1 without cable (J1772) offer?", + "nl": "Welke spanning levert de stekker van type Type 1 zonder kabel (J1772) " + }, + "render": { + "en": "Type 1 without cable (J1772) outputs {socket:type1:voltage} volt", + "nl": "Type 1 zonder kabel (J1772) heeft een spanning van {socket:type1:voltage} volt" + }, + "freeform": { + "key": "socket:type1:voltage", + "type": "pfloat" + }, + "mappings": [ + { + "if": "socket:socket:type1:voltage=200 V", + "then": { + "en": "Type 1 without cable (J1772) outputs 200 volt", + "nl": "Type 1 zonder kabel (J1772) heeft een spanning van 200 volt" + } + }, + { + "if": "socket:socket:type1:voltage=240 V", + "then": { + "en": "Type 1 without cable (J1772) outputs 240 volt", + "nl": "Type 1 zonder kabel (J1772) heeft een spanning van 240 volt" + } + } + ], + "condition": { + "and": [ + "socket:type1~*", + "socket:type1!=0" + ] + } + }, + { + "question": { + "en": "What current do the plugs with Type 1 without cable (J1772) offer?", + "nl": "Welke stroom levert de stekker van type Type 1 zonder kabel (J1772) ?" + }, + "render": { + "en": "Type 1 without cable (J1772) outputs at most {socket:type1:current}A", + "nl": "Type 1 zonder kabel (J1772) levert een stroom van maximaal {socket:type1:current}A" + }, + "freeform": { + "key": "socket:type1:current", + "type": "pfloat" + }, + "mappings": [ + { + "if": "socket:socket:type1:current=32 A", + "then": { + "en": "Type 1 without cable (J1772) outputs at most 32 A", + "nl": "Type 1 zonder kabel (J1772) levert een stroom van maximaal 32 A" + } + } + ], + "condition": { + "and": [ + "socket:type1~*", + "socket:type1!=0" + ] + } + }, + { + "question": { + "en": "What power output does a single plug of type Type 1 without cable (J1772) offer?", + "nl": "Welk vermogen levert een enkele stekker van type Type 1 zonder kabel (J1772) ?" + }, + "render": { + "en": "Type 1 without cable (J1772) outputs at most {socket:type1:output}", + "nl": "Type 1 zonder kabel (J1772) levert een vermogen van maximaal {socket:type1:output}" + }, + "freeform": { + "key": "socket:type1:output", + "type": "pfloat" + }, + "mappings": [ + { + "if": "socket:socket:type1:output=3.7 kw", + "then": { + "en": "Type 1 without cable (J1772) outputs at most 3.7 kw", + "nl": "Type 1 zonder kabel (J1772) levert een vermogen van maximaal 3.7 kw" + } + }, + { + "if": "socket:socket:type1:output=6.6 kw", + "then": { + "en": "Type 1 without cable (J1772) outputs at most 6.6 kw", + "nl": "Type 1 zonder kabel (J1772) levert een vermogen van maximaal 6.6 kw" + } + }, + { + "if": "socket:socket:type1:output=7 kw", + "then": { + "en": "Type 1 without cable (J1772) outputs at most 7 kw", + "nl": "Type 1 zonder kabel (J1772) levert een vermogen van maximaal 7 kw" + } + }, + { + "if": "socket:socket:type1:output=7.2 kw", + "then": { + "en": "Type 1 without cable (J1772) outputs at most 7.2 kw", + "nl": "Type 1 zonder kabel (J1772) levert een vermogen van maximaal 7.2 kw" + } + } + ], + "condition": { + "and": [ + "socket:type1~*", + "socket:type1!=0" + ] + } + }, + { + "question": { + "en": "How much plugs of type Type 1 CCS (aka Type 1 Combo) are available here?", + "nl": "Hoeveel stekkers van type heeft dit oplaadpunt?" + }, + "render": { + "en": "There are Type 1 CCS (aka Type 1 Combo) plugs of type [object Map] available here", + "nl": "Hier zijn stekkers van het type [object Map]" }, - "render": "There are {socket:type1_combo} plugs of type Type 1 CCS (aka Type 1 Combo) available here", "freeform": { "key": "socket:type1_combo", "type": "pnat" }, - "condition": "socket:type1_combo~*" + "condition": { + "and": [ + "socket:type1_combo~*", + "socket:type1_combo!=0" + ] + } }, { "question": { - "en": "How much plugs of type Tesla Supercharger are available here?" + "en": "What voltage do the plugs with Type 1 CCS (aka Type 1 Combo) offer?", + "nl": "Welke spanning levert de stekker van type " + }, + "render": { + "en": "Type 1 CCS (aka Type 1 Combo) outputs {socket:type1_combo:voltage} volt", + "nl": " heeft een spanning van {socket:type1_combo:voltage} volt" + }, + "freeform": { + "key": "socket:type1_combo:voltage", + "type": "pfloat" + }, + "mappings": [ + { + "if": "socket:socket:type1_combo:voltage=400 V", + "then": { + "en": "Type 1 CCS (aka Type 1 Combo) outputs 400 volt", + "nl": " heeft een spanning van 400 volt" + } + }, + { + "if": "socket:socket:type1_combo:voltage=1000 V", + "then": { + "en": "Type 1 CCS (aka Type 1 Combo) outputs 1000 volt", + "nl": " heeft een spanning van 1000 volt" + } + } + ], + "condition": { + "and": [ + "socket:type1_combo~*", + "socket:type1_combo!=0" + ] + } + }, + { + "question": { + "en": "What current do the plugs with Type 1 CCS (aka Type 1 Combo) offer?", + "nl": "Welke stroom levert de stekker van type ?" + }, + "render": { + "en": "Type 1 CCS (aka Type 1 Combo) outputs at most {socket:type1_combo:current}A", + "nl": " levert een stroom van maximaal {socket:type1_combo:current}A" + }, + "freeform": { + "key": "socket:type1_combo:current", + "type": "pfloat" + }, + "mappings": [ + { + "if": "socket:socket:type1_combo:current=50 A", + "then": { + "en": "Type 1 CCS (aka Type 1 Combo) outputs at most 50 A", + "nl": " levert een stroom van maximaal 50 A" + } + }, + { + "if": "socket:socket:type1_combo:current=125 A", + "then": { + "en": "Type 1 CCS (aka Type 1 Combo) outputs at most 125 A", + "nl": " levert een stroom van maximaal 125 A" + } + } + ], + "condition": { + "and": [ + "socket:type1_combo~*", + "socket:type1_combo!=0" + ] + } + }, + { + "question": { + "en": "What power output does a single plug of type Type 1 CCS (aka Type 1 Combo) offer?", + "nl": "Welk vermogen levert een enkele stekker van type ?" + }, + "render": { + "en": "Type 1 CCS (aka Type 1 Combo) outputs at most {socket:type1_combo:output}", + "nl": " levert een vermogen van maximaal {socket:type1_combo:output}" + }, + "freeform": { + "key": "socket:type1_combo:output", + "type": "pfloat" + }, + "mappings": [ + { + "if": "socket:socket:type1_combo:output=50 kw", + "then": { + "en": "Type 1 CCS (aka Type 1 Combo) outputs at most 50 kw", + "nl": " levert een vermogen van maximaal 50 kw" + } + }, + { + "if": "socket:socket:type1_combo:output=62.5 kw", + "then": { + "en": "Type 1 CCS (aka Type 1 Combo) outputs at most 62.5 kw", + "nl": " levert een vermogen van maximaal 62.5 kw" + } + }, + { + "if": "socket:socket:type1_combo:output=150 kw", + "then": { + "en": "Type 1 CCS (aka Type 1 Combo) outputs at most 150 kw", + "nl": " levert een vermogen van maximaal 150 kw" + } + }, + { + "if": "socket:socket:type1_combo:output=350 kw", + "then": { + "en": "Type 1 CCS (aka Type 1 Combo) outputs at most 350 kw", + "nl": " levert een vermogen van maximaal 350 kw" + } + } + ], + "condition": { + "and": [ + "socket:type1_combo~*", + "socket:type1_combo!=0" + ] + } + }, + { + "question": { + "en": "How much plugs of type Tesla Supercharger are available here?", + "nl": "Hoeveel stekkers van type heeft dit oplaadpunt?" + }, + "render": { + "en": "There are Tesla Supercharger plugs of type [object Map] available here", + "nl": "Hier zijn stekkers van het type [object Map]" }, - "render": "There are {socket:tesla_supercharger} plugs of type Tesla Supercharger available here", "freeform": { "key": "socket:tesla_supercharger", "type": "pnat" }, - "condition": "socket:tesla_supercharger~*" + "condition": { + "and": [ + "socket:tesla_supercharger~*", + "socket:tesla_supercharger!=0" + ] + } }, { "question": { - "en": "How much plugs of type Type 2 (mennekes) are available here?" + "en": "What voltage do the plugs with Tesla Supercharger offer?", + "nl": "Welke spanning levert de stekker van type " + }, + "render": { + "en": "Tesla Supercharger outputs {socket:tesla_supercharger:voltage} volt", + "nl": " heeft een spanning van {socket:tesla_supercharger:voltage} volt" + }, + "freeform": { + "key": "socket:tesla_supercharger:voltage", + "type": "pfloat" + }, + "mappings": [ + { + "if": "socket:socket:tesla_supercharger:voltage=480 V", + "then": { + "en": "Tesla Supercharger outputs 480 volt", + "nl": " heeft een spanning van 480 volt" + } + } + ], + "condition": { + "and": [ + "socket:tesla_supercharger~*", + "socket:tesla_supercharger!=0" + ] + } + }, + { + "question": { + "en": "What current do the plugs with Tesla Supercharger offer?", + "nl": "Welke stroom levert de stekker van type ?" + }, + "render": { + "en": "Tesla Supercharger outputs at most {socket:tesla_supercharger:current}A", + "nl": " levert een stroom van maximaal {socket:tesla_supercharger:current}A" + }, + "freeform": { + "key": "socket:tesla_supercharger:current", + "type": "pfloat" + }, + "mappings": [ + { + "if": "socket:socket:tesla_supercharger:current=125 A", + "then": { + "en": "Tesla Supercharger outputs at most 125 A", + "nl": " levert een stroom van maximaal 125 A" + } + }, + { + "if": "socket:socket:tesla_supercharger:current=350 A", + "then": { + "en": "Tesla Supercharger outputs at most 350 A", + "nl": " levert een stroom van maximaal 350 A" + } + } + ], + "condition": { + "and": [ + "socket:tesla_supercharger~*", + "socket:tesla_supercharger!=0" + ] + } + }, + { + "question": { + "en": "What power output does a single plug of type Tesla Supercharger offer?", + "nl": "Welk vermogen levert een enkele stekker van type ?" + }, + "render": { + "en": "Tesla Supercharger outputs at most {socket:tesla_supercharger:output}", + "nl": " levert een vermogen van maximaal {socket:tesla_supercharger:output}" + }, + "freeform": { + "key": "socket:tesla_supercharger:output", + "type": "pfloat" + }, + "mappings": [ + { + "if": "socket:socket:tesla_supercharger:output=120 kw", + "then": { + "en": "Tesla Supercharger outputs at most 120 kw", + "nl": " levert een vermogen van maximaal 120 kw" + } + }, + { + "if": "socket:socket:tesla_supercharger:output=150 kw", + "then": { + "en": "Tesla Supercharger outputs at most 150 kw", + "nl": " levert een vermogen van maximaal 150 kw" + } + }, + { + "if": "socket:socket:tesla_supercharger:output=250 kw", + "then": { + "en": "Tesla Supercharger outputs at most 250 kw", + "nl": " levert een vermogen van maximaal 250 kw" + } + } + ], + "condition": { + "and": [ + "socket:tesla_supercharger~*", + "socket:tesla_supercharger!=0" + ] + } + }, + { + "question": { + "en": "How much plugs of type Type 2 (mennekes) are available here?", + "nl": "Hoeveel stekkers van type heeft dit oplaadpunt?" + }, + "render": { + "en": "There are Type 2 (mennekes) plugs of type [object Map] available here", + "nl": "Hier zijn stekkers van het type [object Map]" }, - "render": "There are {socket:type2} plugs of type Type 2 (mennekes) available here", "freeform": { "key": "socket:type2", "type": "pnat" }, - "condition": "socket:type2~*" + "condition": { + "and": [ + "socket:type2~*", + "socket:type2!=0" + ] + } }, { "question": { - "en": "How much plugs of type Type 2 CCS (mennekes) are available here?" + "en": "What voltage do the plugs with Type 2 (mennekes) offer?", + "nl": "Welke spanning levert de stekker van type " + }, + "render": { + "en": "Type 2 (mennekes) outputs {socket:type2:voltage} volt", + "nl": " heeft een spanning van {socket:type2:voltage} volt" + }, + "freeform": { + "key": "socket:type2:voltage", + "type": "pfloat" + }, + "mappings": [ + { + "if": "socket:socket:type2:voltage=230 V", + "then": { + "en": "Type 2 (mennekes) outputs 230 volt", + "nl": " heeft een spanning van 230 volt" + } + }, + { + "if": "socket:socket:type2:voltage=400 V", + "then": { + "en": "Type 2 (mennekes) outputs 400 volt", + "nl": " heeft een spanning van 400 volt" + } + } + ], + "condition": { + "and": [ + "socket:type2~*", + "socket:type2!=0" + ] + } + }, + { + "question": { + "en": "What current do the plugs with Type 2 (mennekes) offer?", + "nl": "Welke stroom levert de stekker van type ?" + }, + "render": { + "en": "Type 2 (mennekes) outputs at most {socket:type2:current}A", + "nl": " levert een stroom van maximaal {socket:type2:current}A" + }, + "freeform": { + "key": "socket:type2:current", + "type": "pfloat" + }, + "mappings": [ + { + "if": "socket:socket:type2:current=16 A", + "then": { + "en": "Type 2 (mennekes) outputs at most 16 A", + "nl": " levert een stroom van maximaal 16 A" + } + }, + { + "if": "socket:socket:type2:current=32 A", + "then": { + "en": "Type 2 (mennekes) outputs at most 32 A", + "nl": " levert een stroom van maximaal 32 A" + } + } + ], + "condition": { + "and": [ + "socket:type2~*", + "socket:type2!=0" + ] + } + }, + { + "question": { + "en": "What power output does a single plug of type Type 2 (mennekes) offer?", + "nl": "Welk vermogen levert een enkele stekker van type ?" + }, + "render": { + "en": "Type 2 (mennekes) outputs at most {socket:type2:output}", + "nl": " levert een vermogen van maximaal {socket:type2:output}" + }, + "freeform": { + "key": "socket:type2:output", + "type": "pfloat" + }, + "mappings": [ + { + "if": "socket:socket:type2:output=11 kw", + "then": { + "en": "Type 2 (mennekes) outputs at most 11 kw", + "nl": " levert een vermogen van maximaal 11 kw" + } + }, + { + "if": "socket:socket:type2:output=22 kw", + "then": { + "en": "Type 2 (mennekes) outputs at most 22 kw", + "nl": " levert een vermogen van maximaal 22 kw" + } + } + ], + "condition": { + "and": [ + "socket:type2~*", + "socket:type2!=0" + ] + } + }, + { + "question": { + "en": "How much plugs of type Type 2 CCS (mennekes) are available here?", + "nl": "Hoeveel stekkers van type heeft dit oplaadpunt?" + }, + "render": { + "en": "There are Type 2 CCS (mennekes) plugs of type [object Map] available here", + "nl": "Hier zijn stekkers van het type [object Map]" }, - "render": "There are {socket:type2_combo} plugs of type Type 2 CCS (mennekes) available here", "freeform": { "key": "socket:type2_combo", "type": "pnat" }, - "condition": "socket:type2_combo~*" + "condition": { + "and": [ + "socket:type2_combo~*", + "socket:type2_combo!=0" + ] + } + }, + { + "question": { + "en": "What voltage do the plugs with Type 2 CCS (mennekes) offer?", + "nl": "Welke spanning levert de stekker van type " + }, + "render": { + "en": "Type 2 CCS (mennekes) outputs {socket:type2_combo:voltage} volt", + "nl": " heeft een spanning van {socket:type2_combo:voltage} volt" + }, + "freeform": { + "key": "socket:type2_combo:voltage", + "type": "pfloat" + }, + "mappings": [ + { + "if": "socket:socket:type2_combo:voltage=500 V", + "then": { + "en": "Type 2 CCS (mennekes) outputs 500 volt", + "nl": " heeft een spanning van 500 volt" + } + }, + { + "if": "socket:socket:type2_combo:voltage=920 V", + "then": { + "en": "Type 2 CCS (mennekes) outputs 920 volt", + "nl": " heeft een spanning van 920 volt" + } + } + ], + "condition": { + "and": [ + "socket:type2_combo~*", + "socket:type2_combo!=0" + ] + } + }, + { + "question": { + "en": "What current do the plugs with Type 2 CCS (mennekes) offer?", + "nl": "Welke stroom levert de stekker van type ?" + }, + "render": { + "en": "Type 2 CCS (mennekes) outputs at most {socket:type2_combo:current}A", + "nl": " levert een stroom van maximaal {socket:type2_combo:current}A" + }, + "freeform": { + "key": "socket:type2_combo:current", + "type": "pfloat" + }, + "mappings": [ + { + "if": "socket:socket:type2_combo:current=125 A", + "then": { + "en": "Type 2 CCS (mennekes) outputs at most 125 A", + "nl": " levert een stroom van maximaal 125 A" + } + }, + { + "if": "socket:socket:type2_combo:current=350 A", + "then": { + "en": "Type 2 CCS (mennekes) outputs at most 350 A", + "nl": " levert een stroom van maximaal 350 A" + } + } + ], + "condition": { + "and": [ + "socket:type2_combo~*", + "socket:type2_combo!=0" + ] + } + }, + { + "question": { + "en": "What power output does a single plug of type Type 2 CCS (mennekes) offer?", + "nl": "Welk vermogen levert een enkele stekker van type ?" + }, + "render": { + "en": "Type 2 CCS (mennekes) outputs at most {socket:type2_combo:output}", + "nl": " levert een vermogen van maximaal {socket:type2_combo:output}" + }, + "freeform": { + "key": "socket:type2_combo:output", + "type": "pfloat" + }, + "mappings": [ + { + "if": "socket:socket:type2_combo:output=50 kw", + "then": { + "en": "Type 2 CCS (mennekes) outputs at most 50 kw", + "nl": " levert een vermogen van maximaal 50 kw" + } + } + ], + "condition": { + "and": [ + "socket:type2_combo~*", + "socket:type2_combo!=0" + ] + } + }, + { + "#": "fee/charge", + "question": { + "en": "How much does one have to pay to use this charging station?", + "nl": "Hoeveel kost het gebruik van dit oplaadpunt?" + }, + "freeform": { + "key": "charge", + "addExtraTags": [ + "fee=yes" + ] + }, + "render": { + "en": "Using this charging station costs {charge}", + "nl": "Dit oplaadpunt gebruiken kost {charge}" + }, + "mappings": [ + { + "if": { + "and": [ + "fee=no", + "charge=" + ] + }, + "then": { + "nl": "Gratis te gebruiken", + "en": "Free to use" + } + } + ] + }, + { + "builtin": "payment-options", + "override": { + "mappings+": [ + { + "if": "payment:app=yes", + "ifnot": "payment:app=no", + "then": { + "en": "Payment is done using a dedicated app", + "nl": "Betalen via een app van het netwerk" + } + } + ] + } }, { "#": "Authentication", @@ -764,6 +1865,9 @@ ], "title": { "en": "Charging station" + }, + "preciseInput": { + "preferredBackground": "map" } } ], @@ -816,45 +1920,172 @@ { "options": [ { - "question": "All connectors" + "question": { + "en": "All connectors", + "nl": "Alle types" + } }, { - "question": "Has a Schuko wall plug without ground pin (CEE7/4 type F) connector", + "question": { + "en": "Has a Schuko wall plug without ground pin (CEE7/4 type F) connector", + "nl": "Heeft een Schuko stekker zonder aardingspin (CEE7/4 type F) " + }, "osmTags": "socket:schuko~*" }, { - "question": "Has a European wall plug with ground pin (CEE7/4 type E) connector", + "question": { + "en": "Has a European wall plug with ground pin (CEE7/4 type E) connector", + "nl": "Heeft een Europese stekker met aardingspin (CEE7/4 type E) " + }, "osmTags": "socket:typee~*" }, { - "question": "Has a Chademo connector", + "question": { + "en": "Has a Chademo connector", + "nl": "Heeft een " + }, "osmTags": "socket:chademo~*" }, { - "question": "Has a Type 1 with cable (J1772) connector", + "question": { + "en": "Has a Type 1 with cable (J1772) connector", + "nl": "Heeft een Type 1 met kabel (J1772) " + }, "osmTags": "socket:type1_cable~*" }, { - "question": "Has a Type 1 without cable (J1772) connector", + "question": { + "en": "Has a Type 1 without cable (J1772) connector", + "nl": "Heeft een Type 1 zonder kabel (J1772) " + }, "osmTags": "socket:type1~*" }, { - "question": "Has a Type 1 CCS (aka Type 1 Combo) connector", + "question": { + "en": "Has a Type 1 CCS (aka Type 1 Combo) connector", + "nl": "Heeft een " + }, "osmTags": "socket:type1_combo~*" }, { - "question": "Has a Tesla Supercharger connector", + "question": { + "en": "Has a Tesla Supercharger connector", + "nl": "Heeft een " + }, "osmTags": "socket:tesla_supercharger~*" }, { - "question": "Has a Type 2 (mennekes) connector", + "question": { + "en": "Has a Type 2 (mennekes) connector", + "nl": "Heeft een " + }, "osmTags": "socket:type2~*" }, { - "question": "Has a Type 2 CCS (mennekes) connector", + "question": { + "en": "Has a Type 2 CCS (mennekes) connector", + "nl": "Heeft een " + }, "osmTags": "socket:type2_combo~*" } ] } + ], + "units": [ + { + "appliesToKey": [ + "socket:schuko:voltage", + "socket:typee:voltage", + "socket:chademo:voltage", + "socket:type1_cable:voltage", + "socket:type1:voltage", + "socket:type1_combo:voltage", + "socket:tesla_supercharger:voltage", + "socket:type2:voltage", + "socket:type2_combo:voltage" + ], + "applicableUnits": [ + { + "canonicalDenomination": "V", + "alternativeDenomination": [ + "v", + "volt", + "voltage", + "V", + "Volt" + ], + "human": { + "en": "Volts", + "nl": "volt" + } + } + ], + "eraseInvalidValues": true + }, + { + "appliesToKey": [ + "socket:schuko:current", + "socket:typee:current", + "socket:chademo:current", + "socket:type1_cable:current", + "socket:type1:current", + "socket:type1_combo:current", + "socket:tesla_supercharger:current", + "socket:type2:current", + "socket:type2_combo:current" + ], + "applicableUnits": [ + { + "canonicalDenomination": "A", + "alternativeDenomination": [ + "a", + "amp", + "amperage", + "A" + ], + "human": { + "en": "A", + "nl": "A" + } + } + ], + "eraseInvalidValues": true + }, + { + "appliesToKey": [ + "socket:schuko:output", + "socket:typee:output", + "socket:chademo:output", + "socket:type1_cable:output", + "socket:type1:output", + "socket:type1_combo:output", + "socket:tesla_supercharger:output", + "socket:type2:output", + "socket:type2_combo:output" + ], + "applicableUnits": [ + { + "canonicalDenomination": "kW", + "alternativeDenomination": [ + "kilowatt" + ], + "human": { + "en": "kilowatt", + "nl": "kilowatt" + } + }, + { + "canonicalDenomination": "mW", + "alternativeDenomination": [ + "megawatt" + ], + "human": { + "en": "megawatt", + "nl": "megawatt" + } + } + ], + "eraseInvalidValues": true + } ] } \ No newline at end of file diff --git a/assets/layers/charging_station/charging_station.protojson b/assets/layers/charging_station/charging_station.protojson index 8ab275f794..d6fd2c06e8 100644 --- a/assets/layers/charging_station/charging_station.protojson +++ b/assets/layers/charging_station/charging_station.protojson @@ -129,10 +129,12 @@ { "#": "capacity", "render": { - "en": "{capacity} vehicles can be charged here at the same time" + "en": "{capacity} vehicles can be charged here at the same time", + "nl": "{capacity} voertuigen kunnen hier op hetzelfde moment opgeladen worden" }, "question": { - "en": "How much vehicles can be charged here at the same time?" + "en": "How much vehicles can be charged here at the same time?", + "nl": "Hoeveel voertuigen kunnen hier opgeladen worden?" }, "freeform": { "key": "capacity", @@ -277,6 +279,58 @@ } ] }, + { + "#": "fee/charge", + "question": { + "en": "How much does one have to pay to use this charging station?", + "nl": "Hoeveel kost het gebruik van dit oplaadpunt?" + }, + "freeform": { + "key": "charge", + "addExtraTags": [ + "fee=yes" + ] + }, + "render": { + "en": "Using this charging station costs {charge}", + "nl": "Dit oplaadpunt gebruiken kost {charge}" + }, + "mappings": [ + { + "if": { + "and": [ + "fee=no", + "charge=" + ] + }, + "then": { + "nl": "Gratis te gebruiken", + "en": "Free to use" + } + } + ] + }, + { + "builtin": "payment-options", + "override": { + "condition": { + "or": [ + "fee=yes", + "charge~*" + ] + }, + "mappings+": [ + { + "if": "payment:app=yes", + "ifnot": "payment:app=no", + "then": { + "en": "Payment is done using a dedicated app", + "nl": "Betalen via een app van het netwerk" + } + } + ] + } + }, { "#": "Network", "render": { @@ -518,6 +572,9 @@ ], "title": { "en": "Charging station" + }, + "preciseInput": { + "preferredBackground": "map" } } ], diff --git a/assets/layers/charging_station/csvToJson.ts b/assets/layers/charging_station/csvToJson.ts index 78de8dd132..eca25e1ba1 100644 --- a/assets/layers/charging_station/csvToJson.ts +++ b/assets/layers/charging_station/csvToJson.ts @@ -1,34 +1,80 @@ import {readFileSync, writeFileSync} from "fs"; import {Utils} from "../../../Utils"; +import {TagRenderingConfigJson} from "../../../Models/ThemeConfig/Json/TagRenderingConfigJson"; +import ScriptUtils from "../../../scripts/ScriptUtils"; + + +function colonSplit(value: string): string[] { + return value.split(";").map(v => v.replace(/"/g, '').trim().toLowerCase()).filter(s => s !== ""); +} + +function loadCsv(file): { + key: string, + image: string, + description: Map, + countryWhiteList?: string[], + commonVoltages?: number[], + commonCurrents?: number[], + commonOutputs?: string[] +}[] { + const entries: string[] = Utils.NoNull(readFileSync(file, "utf8").split("\n").map(str => str.trim())) + const header = entries.shift().split(",") + + return Utils.NoNull(entries.map(entry => { + const values = entry.split(",").map(str => str.trim()) + if (values[0] === undefined || values[0] === "") { + return undefined; + } + + const v = {} + const colonSeperated = ["commonVoltages", "commonOutputs", "commonCurrents", "countryWhiteList"] + const descriptionTranslations = new Map() + for (let j = 0; j < header.length; j++) { + const key = header[j]; + if (key.startsWith("description")) { + const language = key.substring("description:".length) + descriptionTranslations.set(language, values[j]) + } + + if (colonSeperated.indexOf(key) >= 0) { + v[key] = colonSplit(values[j]) + } else { + v[key] = values[j] + } + } + v["description"] = descriptionTranslations + return v; + })) +} // SMall script to output the properties of the types.csv as json to add in the tagRenderingGroup. Should be copied manually function run(file, protojson) { - const entries: string[] = Utils.NoNull(readFileSync(file, "utf8").split("\n").map(str => str.trim())) - entries.shift() const overview_question_answers = [] - const questions = [] - const filterOptions: { question: string, osmTags?: string } [] = [ + const questions: TagRenderingConfigJson[] = [] + const filterOptions: { question: any, osmTags?: string } [] = [ { - question: "All connectors" + question: { + en: "All connectors", + nl: "Alle types" + } } ] - for (const entry of entries) { - const [key, image, description, whitelist] = entry.split(",").map(str => str.trim()) - if (key === "") { - continue; + const entries = loadCsv(file) + for (const e of entries) { + const txt = { + en: ` ${e.description.get("en")}`, + nl: ` ${e.description.get("nl")}` } - - const txt = ` ${description}` const json = { - if: `${key}=1`, - ifnot: `${key}=`, + if: `${e.key}=1`, + ifnot: `${e.key}=`, then: txt, } - if (whitelist) { - const countries = whitelist.replace(/"/g, '').split(",").map(country => "_country!=" + country) //HideInAnswer if it is in the wrong country + if (e.countryWhiteList !== undefined && e.countryWhiteList.length > 0) { + const countries = e.countryWhiteList.map(country => "_country!=" + country) //HideInAnswer if it is in the wrong country json["hideInAnswer"] = {or: countries} } @@ -37,32 +83,123 @@ function run(file, protojson) { // We add a second time for any amount to trigger a visualisation; but this is not an answer option const no_ask_json = { if: { - and: [`${key}~*`, `${key}!=1`] + and: [`${e.key}~*`, `${e.key}!=1`] }, then: txt, hideInAnswer: true } overview_question_answers.push(no_ask_json) - const indivQ = { + const descrWithImage_en = `${e.description.get("en")} ` + const descrWithImage_nl = `${e.description.get("nl")} ` + questions.push({ question: { - en: `How much plugs of type ${description} are available here?` + en: `How much plugs of type ${descrWithImage_en} are available here?`, + nl: `Hoeveel stekkers van type ${descrWithImage_nl} heeft dit oplaadpunt?`, + }, + render: { + en: `There are ${descrWithImage_en} plugs of type ${e.description.get("en")} available here`, + nl: `Hier zijn ${descrWithImage_nl} stekkers van het type ${e.description.get("nl")}` }, - render: `There are {${key}} plugs of type ${description} available here`, freeform: { - key: key, + key: e.key, type: "pnat" }, - condition: `${key}~*` + condition: { + and: [`${e.key}~*`, `${e.key}!=0`] + } + }) - } + questions.push({ + question: { + en: `What voltage do the plugs with ${descrWithImage_en} offer?`, + nl: `Welke spanning levert de stekker van type ${descrWithImage_nl}` + }, + render: { + en: `${descrWithImage_en} outputs {${e.key}:voltage} volt`, + nl: `${descrWithImage_nl} heeft een spanning van {${e.key}:voltage} volt` + }, + freeform: { + key: `${e.key}:voltage`, + type: "pfloat" + }, + mappings: e.commonVoltages.map(voltage => { + return { + if: `socket:${e.key}:voltage=${voltage} V`, + then: { + en: `${descrWithImage_en} outputs ${voltage} volt`, + nl: `${descrWithImage_nl} heeft een spanning van ${voltage} volt` + } + } + }), + condition: { + and: [`${e.key}~*`, `${e.key}!=0`] + } + }) - questions.push(indivQ) + + questions.push({ + question: { + en: `What current do the plugs with ${descrWithImage_en} offer?`, + nl: `Welke stroom levert de stekker van type ${descrWithImage_nl}?`, + }, + render: { + en: `${descrWithImage_en} outputs at most {${e.key}:current}A`, + nl: `${descrWithImage_nl} levert een stroom van maximaal {${e.key}:current}A` + }, + freeform: { + key: `${e.key}:current`, + type: "pfloat" + }, + mappings: e.commonCurrents.map(current => { + return { + if: `socket:${e.key}:current=${current} A`, + then: { + en: `${descrWithImage_en} outputs at most ${current} A`, + nl: `${descrWithImage_nl} levert een stroom van maximaal ${current} A` + } + } + }), + condition: { + and: [`${e.key}~*`, `${e.key}!=0`] + } + }) + + + questions.push({ + question: { + en: `What power output does a single plug of type ${descrWithImage_en} offer?`, + nl: `Welk vermogen levert een enkele stekker van type ${descrWithImage_nl}?`, + }, + render: { + en: `${descrWithImage_en} outputs at most {${e.key}:output}`, + nl: `${descrWithImage_nl} levert een vermogen van maximaal {${e.key}:output}` + }, + freeform: { + key: `${e.key}:output`, + type: "pfloat" + }, + mappings: e.commonOutputs.map(output => { + return { + if: `socket:${e.key}:output=${output}`, + then: { + en: `${descrWithImage_en} outputs at most ${output}`, + nl: `${descrWithImage_nl} levert een vermogen van maximaal ${output}` + } + } + }), + condition: { + and: [`${e.key}~*`, `${e.key}!=0`] + } + }) filterOptions.push({ - question: `Has a ${description} connector`, - osmTags: `${key}~*` + question: { + en: `Has a ${descrWithImage_en} connector`, + nl: `Heeft een ${descrWithImage_nl}` + }, + osmTags: `${e.key}~*` }) } @@ -82,11 +219,99 @@ function run(file, protojson) { proto["filter"].push({ options: filterOptions }) + + proto["units"] = [ + { + appliesToKey: entries.map(e => e.key + ":voltage"), + applicableUnits: [{ + canonicalDenomination: 'V', + alternativeDenomination: ["v", "volt", "voltage",'V','Volt'], + human: { + en: "Volts", + nl: "volt" + } + }], + eraseInvalidValues: true + }, + { + appliesToKey: entries.map(e => e.key + ":current"), + applicableUnits: [{ + canonicalDenomination: 'A', + alternativeDenomination: ["a", "amp", "amperage",'A'], + human: { + en: "A", + nl: "A" + } + }], + eraseInvalidValues: true + }, + { + appliesToKey: entries.map(e => e.key + ":output"), + applicableUnits: [{ + canonicalDenomination: 'kW', + alternativeDenomination: ["kilowatt"], + human: { + en: "kilowatt", + nl: "kilowatt" + } + }, + { + canonicalDenomination: 'mW', + alternativeDenomination: ["megawatt"], + human: { + en: "megawatt", + nl: "megawatt" + } + }], + eraseInvalidValues: true + }, + ]; + writeFileSync("charging_station.json", JSON.stringify(proto, undefined, " ")) } + +async function queryTagInfo(file, type, clean: ((s: string) => string)) { + for (const e of loadCsv(file)) { + const value = await ScriptUtils.TagInfoHistogram(e.key + ":" + type) + const result = value.data + const counts = new Map() + // console.log(result) + for (const r of result) { + let key = r.value; + key = clean(key) + key.trim(); + if (key.indexOf('-') >= 0) { + continue + } + if (r.fraction < 0.05) { + continue + } + if (counts.has(key)) { + counts.set(key, counts.get(key) + r.count) + } else { + counts.set(key, r.count) + } + } + const countsArray = Array.from(counts.keys()) + countsArray.sort() + // console.log(`${e.key}:${type} = ${countsArray.join(";")}`) + console.log(`${countsArray.join(";")}`) + } +} + try { run("types.csv", "charging_station.protojson") + // queryTagInfo("types.csv","voltage", true) + // queryTagInfo("types.csv", "current", true) + /* queryTagInfo("types.csv", "output", s => { + if(s.endsWith("kW")){ + s = s.substring(0, s.length - 2) + } + s = s.trim() + return s + " kW" + })*/ + } catch (e) { console.error(e) } diff --git a/assets/layers/charging_station/types.csv b/assets/layers/charging_station/types.csv index fd303181d0..5cf989085c 100644 --- a/assets/layers/charging_station/types.csv +++ b/assets/layers/charging_station/types.csv @@ -1,10 +1,10 @@ -Key in OSM,image,Description,Country-whitelist,,,,,,, -socket:schuko,CEE7_4F.svg,Schuko wall plug without ground pin (CEE7/4 type F),"be,fr,ma,tn,pl,cs,sk,mo" -socket:typee,TypeE.svg,European wall plug with ground pin (CEE7/4 type E),,,,,,,, -socket:chademo,Chademo_type4.svg,Chademo,,,,,,,, -socket:type1_cable,Type1_J1772.svg,Type 1 with cable (J1772),,,,,,,, -socket:type1,Type1_J1772.svg,Type 1 without cable (J1772),,,,,,,, -socket:type1_combo,Type1-ccs.svg,Type 1 CCS (aka Type 1 Combo),,,,,,,, -socket:tesla_supercharger,Tesla-hpwc-model-s.svg,Tesla Supercharger,,,,,,,, -socket:type2,Type2_socket.svg,Type 2 (mennekes),,,,,,,, -socket:type2_combo,Type2_CCS.svg,Type 2 CCS (mennekes),,,,,,,, +key,image,description:en,countryWhitelist,commonVoltages,commonCurrents,commonOutputs,description:nl +socket:schuko,CEE7_4F.svg,Schuko wall plug without ground pin (CEE7/4 type F),be;fr;ma;tn;pl;cs;sk;mo,230,16,3.6 kW,Schuko stekker zonder aardingspin (CEE7/4 type F) +socket:typee,TypeE.svg,European wall plug with ground pin (CEE7/4 type E),,230,16,3 kW;22 kW;,Europese stekker met aardingspin (CEE7/4 type E) +socket:chademo,Chademo_type4.svg,Chademo,,500,120,50 kW, +socket:type1_cable,Type1_J1772.svg,Type 1 with cable (J1772),,200;240,32,3.7 kW;7 kW,Type 1 met kabel (J1772) +socket:type1,Type1_J1772.svg,Type 1 without cable (J1772),,200;240,32,3.7 kW;6.6 kW;7 kW;7.2 kW,Type 1 zonder kabel (J1772) +socket:type1_combo,Type1-ccs.svg,Type 1 CCS (aka Type 1 Combo),,400;1000,50;125,50 kW;62.5 kW;150 kW;350 kW;, +socket:tesla_supercharger,Tesla-hpwc-model-s.svg,Tesla Supercharger,,480,125;350,120 kW;150 kW;250 kW, +socket:type2,Type2_socket.svg,Type 2 (mennekes),,230;400,16;32,11 kW;22 kW, +socket:type2_combo,Type2_CCS.svg,Type 2 CCS (mennekes),,500;920,125;350,50 kW,