Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

feat(co-messung): the ppm bands are pegged to the German AGW and the floor labels to EG/OG/UG

Open
#403 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
csharp, sqlite
Domain
backend

Research direction

Read CoSeverityClassifier.cs, CoSeverity.cs, CoMeasurementLabels.cs, IncidentSettings, and CoMeasurementTests.cs to trace how thresholds, floor labels, and incident settings are connected. First review how incident settings are serialized into incident files and consumed by CoMessprotokollView; done means configurable threshold sets and floor-numbering schemes are used consistently, the selected threshold set is recorded, and tests assert the selected set's boundaries.

Written by the indexing model from the issue text.

Description

enhancement

From a portability review of main (ecb341b).

Two hardcoded local conventions in Domain/CoMeasurement

The ppm bands are a German regulatory limit, stated as such in the code.

// src/LageBuch.Domain/CoMeasurement/CoSeverityClassifier.cs
public const int ElevatedThresholdPpm  = 30;
public const int DangerousThresholdPpm = 200;
public const int LethalThresholdPpm    = 800;

and CoSeverity.cs says why: "Bands anchor on the German AGW (Arbeitsplatzgrenzwert, 30 ppm 8h-TWA) at the low end and the commonly-cited CO lethality range … at the high end."

The AGW is federal, so this is correct everywhere in Germany and fine for Austria. It is wrong elsewhere: the UK WEL is 20 ppm 8h-TWA, US OSHA PEL is 50 and NIOSH 35. A reading of 25 ppm shows as Normal here and would be over the limit in the UK — and the colour band in CoMessprotokollView is what an Einsatzleiter actually looks at.

Floor labels are continental.

// src/LageBuch.Domain/CoMeasurement/CoMeasurementLabels.cs
0 => "EG",
> 0 => $"{ordinal}. OG",
< 0 => $"{-ordinal}. UG",

EG-as-zero does not map onto UK/US numbering, where the ground floor is the first floor. This is not a translation — "EG" → "Ground" leaves 1. OG meaning something different from 1st floor. It is a numbering scheme, and it is baked into a switch.

Proposal

Both become settings rather than constants:

  • a named CO threshold set (AGW / WEL / NIOSH, defaulting to AGW) in IncidentSettings, with CoSeverityClassifier taking the set rather than reading its own constants. Worth storing the chosen set's name in the incident file, so a report read years later says which limits its colours meant.
  • a floor-numbering scheme (EG-OG-UG / ground-first / first-second), consumed by CoMeasurementLabels.FloorLabel.

Caveat

CoMeasurementTests.cs pins 29/30/199/200/799/800/2000/2001 exactly. Those assertions encode the AGW and must be rewritten as assertions about the selected set, not loosened.

Low priority — nobody is running this outside the German-speaking area today. Filed so the constants are not mistaken for universal ones later.

Dominant language
C#
Stars
1
Forks
3
Avg merge
4h 49m
Merged PRs (30d)
177

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from CodeForFire/lagebuch

All issues in CodeForFire/lagebuch

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.