[Enhancemant 585] Split out Distance, Temperature and Pressure in to three individually configurable settings#624
Conversation
… configurable settings.
There are some out there who like to mix up using imperial and metric for different things. This change is to help these folks out, by splitting distance, temperature and pressure in to three individually configurable settings.
The `.env` file now accepts the following variables (defaults listed)
```
# Seperated Units ('imperial' or 'metric')
# DISTUNITS - Distance units
DISTUNITS=imperial
# TEMPUNITS - Temperature Units
TEMPUNITS=imperial
# PRESSUNITS - Pressure Units
PRESSUNITS=imperial
```
Similarly config.json can use:
```
"allUnits": {
"dist": "imperial",
"temp": "imperial",
"press": "imperial"
},
```
The older `units` has been deprecated. The only place it will be used now is as a default (if set) for three new variables the first time a version of Open Ham Clock is run with them.
The `Settings` panel has had the old `UNITS` configuration replaced with buttons for each of the new units. Clicking the button toggles between 'metric' and 'imperial'.
|
Merging this — nice work splitting units into per-category settings. The architecture is clean and the migration path from the old units field is handled well. Coverage across all three layouts, weather consumers, and plugin layers is thorough.
== instead of === in CallsignWeatherOverlay and SettingsPanel (toggleUnitType, unitString) — rest of codebase uses strict equality Thanks for the contribution! 73 |
accius
left a comment
There was a problem hiding this comment.
I made some changes, hoping I am right.... pushing this to staging.
What does this PR do?
There are some out there who like to mix up using imperial and metric for different things. This change is to help these folks out, by splitting distance, temperature and pressure in to three individually configurable settings.
The
.envfile now accepts the following variables (defaults listed)Similarly config.json can use:
The older
unitshas been deprecated. The only place it will be used now is as a default (if set) for three new variables the first time a version of Open Ham Clock is run with them.The
Settingspanel has had the oldUNITSconfiguration replaced with buttons for each of the new units. Clicking the button toggles between 'metric' and 'imperial'.Type of change
How to test
Settingspanel and selectStationUNITSimperialvsmetricChecklist
server.js: caches have TTLs and size caps (we serve 2,000+ concurrent users) - not relevant for this changevar(--accent-cyan), etc.).bak,.old,console.logdebug lines, or test scripts includedScreenshots (if visual change)
Settings before


Settings After