fix: enforce SCADA chart device coverage

This commit is contained in:
2026-11-12 10:38:55 +08:00
parent b853b61a0b
commit 2e8fe86f3f
17 changed files with 1220 additions and 13 deletions
+174
View File
@@ -4032,6 +4032,23 @@
"title": "Recommendations",
"type": "array"
},
"scada_device_ids": {
"anyOf": [
{
"items": {
"maxLength": 128,
"minLength": 1,
"type": "string"
},
"maxItems": 1000,
"type": "array"
},
{
"type": "null"
}
],
"title": "Scada Device Ids"
},
"stage": {
"anyOf": [
{
@@ -4144,6 +4161,23 @@
"title": "Recommendations",
"type": "array"
},
"scada_device_ids": {
"anyOf": [
{
"items": {
"maxLength": 128,
"minLength": 1,
"type": "string"
},
"maxItems": 1000,
"type": "array"
},
{
"type": "null"
}
],
"title": "Scada Device Ids"
},
"stage": {
"enum": [
"interim",
@@ -7383,6 +7417,110 @@
"title": "RunSimulationManuallyByDateRest",
"type": "object"
},
"ScadaChartContext": {
"additionalProperties": false,
"properties": {
"gaps": {
"items": {
"$ref": "#/components/schemas/ScadaChartGap"
},
"maxItems": 8,
"title": "Gaps",
"type": "array"
},
"metric": {
"enum": [
"pressure",
"flow"
],
"title": "Metric",
"type": "string"
},
"role": {
"enum": [
"current",
"comparison"
],
"title": "Role",
"type": "string"
},
"unit": {
"maxLength": 128,
"minLength": 1,
"title": "Unit",
"type": "string"
},
"value_field": {
"default": "monitored_value",
"enum": [
"monitored_value",
"cleaned_value"
],
"title": "Value Field",
"type": "string"
},
"window_end": {
"format": "date-time",
"title": "Window End",
"type": "string"
},
"window_start": {
"format": "date-time",
"title": "Window Start",
"type": "string"
}
},
"required": [
"role",
"metric",
"unit",
"window_start",
"window_end"
],
"title": "ScadaChartContext",
"type": "object"
},
"ScadaChartGap": {
"additionalProperties": false,
"properties": {
"day_offset": {
"maximum": 7.0,
"minimum": 0.0,
"title": "Day Offset",
"type": "integer"
},
"device_id": {
"maxLength": 128,
"minLength": 1,
"title": "Device Id",
"type": "string"
},
"missing_count": {
"maximum": 100.0,
"minimum": 1.0,
"title": "Missing Count",
"type": "integer"
},
"reason": {
"enum": [
"no_readings",
"outside_frozen_scope",
"outside_frozen_window",
"no_scheduled_samples"
],
"title": "Reason",
"type": "string"
}
},
"required": [
"device_id",
"day_offset",
"missing_count",
"reason"
],
"title": "ScadaChartGap",
"type": "object"
},
"ScadaDeviceResponse": {
"description": "Project SCADA metadata keyed by the canonical device identifier.",
"properties": {
@@ -10450,6 +10588,16 @@
"title": "Chart Type",
"type": "string"
},
"scada": {
"anyOf": [
{
"$ref": "#/components/schemas/ScadaChartContext"
},
{
"type": "null"
}
]
},
"series": {
"items": {
"$ref": "#/components/schemas/TaskSafeChartSeries"
@@ -10527,6 +10675,32 @@
"title": "Data",
"type": "array"
},
"day_offset": {
"anyOf": [
{
"maximum": 7.0,
"minimum": 0.0,
"type": "integer"
},
{
"type": "null"
}
],
"title": "Day Offset"
},
"device_id": {
"anyOf": [
{
"maxLength": 128,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"title": "Device Id"
},
"name": {
"maxLength": 128,
"title": "Name",