From 9620337fba7f90eab9cfa7233704e9cc30c5f637 Mon Sep 17 00:00:00 2001 From: arch0345 Date: Fri, 27 Oct 2023 21:03:02 -0700 Subject: [PATCH 1/3] Add `crossing:whistle` field --- data/fields/crossing/whistle.json | 14 ++++++++++++++ data/presets/railway/crossing.json | 3 ++- data/presets/railway/level_crossing.json | 3 +++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 data/fields/crossing/whistle.json diff --git a/data/fields/crossing/whistle.json b/data/fields/crossing/whistle.json new file mode 100644 index 00000000..897c5754 --- /dev/null +++ b/data/fields/crossing/whistle.json @@ -0,0 +1,14 @@ +{ + "key": "crossing:whistle", + "type": "combo", + "label": "Train Horn", + "strings": { + "options": { + "yes": "Required", + "optional": "No Train Horn", + "wayside": "Wayside/Stationary Horn" + } + }, + "autoSuggestions": false, + "customValues": false +} diff --git a/data/presets/railway/crossing.json b/data/presets/railway/crossing.json index a258dc61..d5035b88 100644 --- a/data/presets/railway/crossing.json +++ b/data/presets/railway/crossing.json @@ -7,7 +7,8 @@ "crossing/light" ], "moreFields": [ - "crossing/markings" + "crossing/markings", + "crossing/whistle" ], "geometry": [ "vertex" diff --git a/data/presets/railway/level_crossing.json b/data/presets/railway/level_crossing.json index 1bfda0cd..66152407 100644 --- a/data/presets/railway/level_crossing.json +++ b/data/presets/railway/level_crossing.json @@ -5,6 +5,9 @@ "crossing/bell", "crossing/light" ], + "moreFields": [ + "crossing/whistle" + ], "geometry": [ "vertex" ], From 42d9dad5f3a61f20ec174199afafe2e0f2c904bb Mon Sep 17 00:00:00 2001 From: archpdx Date: Thu, 29 May 2025 21:42:30 -0700 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Mateusz Konieczny --- data/fields/crossing/whistle.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/fields/crossing/whistle.json b/data/fields/crossing/whistle.json index 897c5754..9bc1109a 100644 --- a/data/fields/crossing/whistle.json +++ b/data/fields/crossing/whistle.json @@ -4,8 +4,8 @@ "label": "Train Horn", "strings": { "options": { - "yes": "Required", - "optional": "No Train Horn", + "yes": "Mandatory", + "optional": "Only as Needed", "wayside": "Wayside/Stationary Horn" } }, From 352036651c6ee3c145b9fa84fbf425899b485b12 Mon Sep 17 00:00:00 2001 From: arch0345 Date: Fri, 30 May 2025 00:36:19 -0700 Subject: [PATCH 3/3] Try splitting into regional fields --- .../{whistle.json => whistle_optional.json} | 9 +++++++-- data/fields/crossing/whistle_yes.json | 20 +++++++++++++++++++ data/presets/railway/crossing.json | 3 ++- data/presets/railway/level_crossing.json | 3 ++- 4 files changed, 31 insertions(+), 4 deletions(-) rename data/fields/crossing/{whistle.json => whistle_optional.json} (64%) create mode 100644 data/fields/crossing/whistle_yes.json diff --git a/data/fields/crossing/whistle.json b/data/fields/crossing/whistle_optional.json similarity index 64% rename from data/fields/crossing/whistle.json rename to data/fields/crossing/whistle_optional.json index 9bc1109a..a9a397e4 100644 --- a/data/fields/crossing/whistle.json +++ b/data/fields/crossing/whistle_optional.json @@ -2,13 +2,18 @@ "key": "crossing:whistle", "type": "combo", "label": "Train Horn", + "placeholder": "Only as Needed", "strings": { "options": { "yes": "Mandatory", - "optional": "Only as Needed", "wayside": "Wayside/Stationary Horn" } }, "autoSuggestions": false, - "customValues": false + "customValues": false, + "locationSet": { + "include": [ + "150" + ] + } } diff --git a/data/fields/crossing/whistle_yes.json b/data/fields/crossing/whistle_yes.json new file mode 100644 index 00000000..614f6fab --- /dev/null +++ b/data/fields/crossing/whistle_yes.json @@ -0,0 +1,20 @@ +{ + "key": "crossing:whistle", + "type": "combo", + "label": "Train Horn", + "placeholder": "Mandatory", + "strings": { + "options": { + "optional": "Only as Needed", + "wayside": "Wayside/Stationary Horn" + } + }, + "autoSuggestions": false, + "customValues": false, + "locationSet": { + "include": [ + "ca", + "us" + ] + } +} diff --git a/data/presets/railway/crossing.json b/data/presets/railway/crossing.json index d5035b88..2055cc50 100644 --- a/data/presets/railway/crossing.json +++ b/data/presets/railway/crossing.json @@ -8,7 +8,8 @@ ], "moreFields": [ "crossing/markings", - "crossing/whistle" + "crossing/whistle_optional", + "crossing/whistle_yes" ], "geometry": [ "vertex" diff --git a/data/presets/railway/level_crossing.json b/data/presets/railway/level_crossing.json index 66152407..7cbf4476 100644 --- a/data/presets/railway/level_crossing.json +++ b/data/presets/railway/level_crossing.json @@ -6,7 +6,8 @@ "crossing/light" ], "moreFields": [ - "crossing/whistle" + "crossing/whistle_optional", + "crossing/whistle_yes" ], "geometry": [ "vertex"