Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#403 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
csharp, sqlite
领域
backend

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
C#
星标
1
派生
3
平均合并
4 小时 34 分钟
30 天内合并 PR
182

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

CodeForFire/lagebuch 的其他 Issue

查看 CodeForFire/lagebuch 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。