diff --git a/src/components/CameraSettings/CameraSettingFields.tsx b/src/components/CameraSettings/CameraSettingFields.tsx index b9294c6..1f2d743 100644 --- a/src/components/CameraSettings/CameraSettingFields.tsx +++ b/src/components/CameraSettings/CameraSettingFields.tsx @@ -4,7 +4,7 @@ import { useEffect, useMemo, useState } from "react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faEye, faEyeSlash } from "@fortawesome/free-regular-svg-icons"; import CardHeader from "../UI/CardHeader"; -import { useCameraZoom } from "../../hooks/useCameraZoom"; +import { useCameraMode, useCameraZoom } from "../../hooks/useCameraZoom"; import { parseRTSPUrl, reverseZoomMapping, zoomMapping } from "../../utils/utils"; type CameraSettingsProps = { @@ -20,16 +20,21 @@ const CameraSettingFields = ({ updateCameraConfig, zoomLevel, onZoomLevelChange, - updateCameraConfigError, }: CameraSettingsProps) => { const [showPwd, setShowPwd] = useState(false); + const cameraControllerSide = initialData?.id === "CameraA" ? "CameraControllerA" : "CameraControllerB"; const { mutation, query } = useCameraZoom({ camera: cameraControllerSide }); + const { cameraModeQuery, cameraModeMutation } = useCameraMode({ camera: cameraControllerSide }); const zoomOptions = [1, 2, 4]; const magnification = query?.data?.propMagnification?.value; const apiZoom = reverseZoomMapping(magnification); const parsed = parseRTSPUrl(initialData?.propURI?.value); + const cameraMode = cameraModeQuery?.data?.propDayNightMode?.value; + const handleModeClick = async (mode: string) => { + await cameraModeMutation.mutate({ camera: cameraControllerSide, mode }); + }; useEffect(() => { if (!query?.data) return; onZoomLevelChange?.(apiZoom); @@ -194,7 +199,30 @@ const CameraSettingFields = ({ ))} -
+
+ +
+ + +
+
+ {/*
{updateCameraConfigError ? ( )} -
+
*/} )} diff --git a/src/components/CameraSettings/CameraSettings.tsx b/src/components/CameraSettings/CameraSettings.tsx index 2536374..29fa40a 100644 --- a/src/components/CameraSettings/CameraSettings.tsx +++ b/src/components/CameraSettings/CameraSettings.tsx @@ -18,7 +18,7 @@ const CameraSettings = ({ const { data, updateCameraConfig, updateCameraConfigError } = useFetchCameraConfig(side); return ( - +
diff --git a/src/components/SettingForms/Channel1-JSON/ChannelFields.tsx b/src/components/SettingForms/Channel1-JSON/ChannelFields.tsx index c4ab990..36b505f 100644 --- a/src/components/SettingForms/Channel1-JSON/ChannelFields.tsx +++ b/src/components/SettingForms/Channel1-JSON/ChannelFields.tsx @@ -115,7 +115,35 @@ const ChannelFields = ({ touched, isSubmitting, format }: ChannelFieldsProps) => } rounded-lg w-full md:w-60`} /> - + {/* Overview quality and scale */} + + + + + + + + + {/* propOverviewImageScaleFactor cropSizeFactor */} + + + + + + + + + {format?.toLowerCase() === "bof2" && ( <>
@@ -176,7 +204,7 @@ const ChannelFields = ({ touched, isSubmitting, format }: ChannelFieldsProps) =>

{values.format} Lane ID Config

- + /> - + { const qc = useQueryClient(); @@ -20,10 +21,14 @@ const SettingForms = () => { const { backOfficeMutation } = useUpdateBackOfficeConfig(); const { bof2ConstantsQuery } = useGetDispatcherConfig(); const { validateMutation } = useFormVaidate(); + const { sightingAmendQuery, sightingAmendMutation } = useSightingAmend(); const format = dispatcherQuery?.data?.propFormat?.value; const enabled = dispatcherQuery?.data?.propEnabled?.value; + const sightingQuality = sightingAmendQuery?.data?.propOverviewQuality?.value; + const cropSizeFactor = sightingAmendQuery?.data?.propOverviewImageScaleFactor?.value; + const LID1 = laneIdQuery?.data?.propLaneID1?.value; const LID2 = laneIdQuery?.data?.propLaneID2?.value; @@ -43,6 +48,8 @@ const SettingForms = () => { password: "", connectTimeoutSeconds: Number(5), readTimeoutSeconds: Number(15), + overviewQuality: sightingQuality ?? "HIGH", + cropSizeFactor: cropSizeFactor ?? "3/4", // Bof2 - optional constants FFID: FFID ?? "", @@ -91,6 +98,7 @@ const SettingForms = () => { if (validResponse?.reason === "OK") { await backOfficeMutation.mutateAsync(values); + await sightingAmendMutation.mutateAsync(values); if (values.format.toLowerCase() === "bof2") { const bof2ConstantsData: OptionalBOF2Constants = { diff --git a/src/components/SettingForms/System/SystemConfigFields.tsx b/src/components/SettingForms/System/SystemConfigFields.tsx index 93627e5..7d8951f 100644 --- a/src/components/SettingForms/System/SystemConfigFields.tsx +++ b/src/components/SettingForms/System/SystemConfigFields.tsx @@ -8,9 +8,8 @@ import { useDNSSettings, useSystemConfig } from "../../../hooks/useSystemConfig" const SystemConfigFields = () => { const { saveSystemSettings, systemSettingsData, saveSystemSettingsLoading } = useSystemConfig(); - const { softRebootMutation, hardRebootMutation } = useReboots(); + const { hardRebootMutation } = useReboots(); const { dnsQuery, dnsMutation } = useDNSSettings(); - console.log(dnsQuery?.data); const dnsPrimary = dnsQuery?.data?.propNameServerPrimary?.value; const dnsSecondary = dnsQuery?.data?.propNameServerSecondary?.value; @@ -39,9 +38,9 @@ const SystemConfigFields = () => { return errors; }; - const handleSoftReboot = async () => { - await softRebootMutation.mutate(); - }; + // const handleSoftReboot = async () => { + // await softRebootMutation.mutate(); + // }; const handleHardReboot = async () => { await hardRebootMutation.mutate(); @@ -111,34 +110,7 @@ const SystemConfigFields = () => { autoComplete="off" /> - - - - - - - - - + + + + + + + + + +
- + */}