2026-02-27 18:55:36 +03:00
|
|
|
import type { SectionConfigOverrides } from "./types";
|
|
|
|
|
|
|
|
|
|
const detect: SectionConfigOverrides = {
|
|
|
|
|
base: {
|
|
|
|
|
sectionDocs: "/configuration/camera_specific",
|
2026-05-07 21:23:02 +03:00
|
|
|
messages: [
|
|
|
|
|
{
|
|
|
|
|
key: "detect-disabled",
|
|
|
|
|
messageKey: "configMessages.detect.disabled",
|
|
|
|
|
severity: "info",
|
|
|
|
|
condition: (ctx) =>
|
|
|
|
|
ctx.level === "camera" && ctx.formData?.enabled === false,
|
|
|
|
|
},
|
|
|
|
|
],
|
2026-03-30 00:25:40 +03:00
|
|
|
fieldMessages: [
|
|
|
|
|
{
|
|
|
|
|
key: "fps-greater-than-five",
|
|
|
|
|
field: "fps",
|
|
|
|
|
messageKey: "configMessages.detect.fpsGreaterThanFive",
|
|
|
|
|
severity: "info",
|
|
|
|
|
position: "after",
|
|
|
|
|
condition: (ctx) => {
|
|
|
|
|
if (ctx.level !== "camera" || !ctx.fullCameraConfig) return false;
|
2026-05-06 19:01:50 +03:00
|
|
|
if (ctx.fullCameraConfig.type === "lpr") return false;
|
2026-03-30 00:25:40 +03:00
|
|
|
const detectFps = ctx.formData?.fps as number | undefined;
|
|
|
|
|
const streamFps = ctx.fullCameraConfig.detect?.fps;
|
|
|
|
|
return detectFps != null && streamFps != null && detectFps > 5;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
2026-02-27 18:55:36 +03:00
|
|
|
fieldOrder: [
|
|
|
|
|
"enabled",
|
|
|
|
|
"width",
|
|
|
|
|
"height",
|
|
|
|
|
"fps",
|
|
|
|
|
"min_initialized",
|
|
|
|
|
"max_disappeared",
|
|
|
|
|
"annotation_offset",
|
|
|
|
|
"stationary",
|
|
|
|
|
"interval",
|
|
|
|
|
"threshold",
|
|
|
|
|
"max_frames",
|
|
|
|
|
],
|
|
|
|
|
restartRequired: [],
|
|
|
|
|
fieldGroups: {
|
2026-03-20 16:24:34 +03:00
|
|
|
resolution: ["width", "height", "fps"],
|
2026-02-27 18:55:36 +03:00
|
|
|
tracking: ["min_initialized", "max_disappeared"],
|
|
|
|
|
},
|
|
|
|
|
hiddenFields: ["enabled_in_config"],
|
|
|
|
|
advancedFields: [
|
|
|
|
|
"min_initialized",
|
|
|
|
|
"max_disappeared",
|
|
|
|
|
"annotation_offset",
|
|
|
|
|
"stationary",
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
global: {
|
2026-03-08 20:27:53 +03:00
|
|
|
restartRequired: [
|
|
|
|
|
"fps",
|
|
|
|
|
"width",
|
|
|
|
|
"height",
|
|
|
|
|
"min_initialized",
|
|
|
|
|
"max_disappeared",
|
|
|
|
|
],
|
2026-02-27 18:55:36 +03:00
|
|
|
},
|
|
|
|
|
camera: {
|
2026-03-08 20:27:53 +03:00
|
|
|
restartRequired: [
|
|
|
|
|
"fps",
|
|
|
|
|
"width",
|
|
|
|
|
"height",
|
|
|
|
|
"min_initialized",
|
|
|
|
|
"max_disappeared",
|
|
|
|
|
],
|
2026-02-27 18:55:36 +03:00
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default detect;
|