feat(scada): add calibrated monitoring and incident recovery

This commit is contained in:
2026-11-07 19:44:58 +08:00
parent 26fa5d1909
commit ff8aba4964
109 changed files with 9165 additions and 629 deletions
+11
View File
@@ -40,6 +40,17 @@ def test_report_ui_round_trips_with_a_version_and_keeps_legacy_reports_readable(
assert InvestigationReportRevision.model_validate(old).report.ui_blocks == []
def test_report_ui_preserves_sparse_scada_series_and_sample_times():
data = rich_report()
chart = data["ui_blocks"][0]["block"]["spec"]["elements"]["chart"]["props"]
chart["y_axis_name"] = "压力 MPa"
chart["series"].append({"name": "前一天", "type": "scatter", "data": [None, 0.28],
"sample_times": [None, "2026-10-19T09:00:00+08:00"]})
restored = InvestigationReportInput.model_validate_json(
InvestigationReportInput.model_validate(data).model_dump_json())
assert restored.ui_blocks[0].block.spec.elements["chart"].props == chart
@pytest.mark.parametrize("phase", [None, "final"])
def test_report_ui_accepts_final_and_legacy_phases(phase):
data = rich_report()