From 5c6de3cb2757e3e3e1d3c491db1b1395d710fffd Mon Sep 17 00:00:00 2001
From: fajiao <1519100073@qq.com>
Date: Tue, 29 Nov 2022 16:23:52 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A1=A5=E5=85=85=E5=AE=9E=E4=BD=93?=
=?UTF-8?q?=E7=B1=BB=E6=B3=A8=E9=87=8A=EF=BC=8C=E8=B0=83=E6=95=B4=E5=8F=98?=
=?UTF-8?q?=E9=87=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Cis.Application/Cis.Application.xml | 20 +++++++++++++++++++
Cis.Application/Cm/Entity/CmMarkLabel.cs | 12 +++++++++++
.../Cm/Service/CmMarkLabelService.cs | 5 +++--
.../Core/Center/CameraDataCenter.cs | 2 +-
.../Component/CameraSDK/CameraSdkServer.cs | 2 +-
.../MarkSeacher/MarkSearcherServer.cs | 2 +-
6 files changed, 38 insertions(+), 5 deletions(-)
diff --git a/Cis.Application/Cis.Application.xml b/Cis.Application/Cis.Application.xml
index 288411d..aaa8694 100644
--- a/Cis.Application/Cis.Application.xml
+++ b/Cis.Application/Cis.Application.xml
@@ -209,6 +209,26 @@
Zoom 坐标
+
+
+ 视频宽度
+
+
+
+
+ 视频高度
+
+
+
+
+ 画布 left 距离比例
+
+
+
+
+ 画布 top 距离比例
+
+
备注
diff --git a/Cis.Application/Cm/Entity/CmMarkLabel.cs b/Cis.Application/Cm/Entity/CmMarkLabel.cs
index 3f4a646..5dc870d 100644
--- a/Cis.Application/Cm/Entity/CmMarkLabel.cs
+++ b/Cis.Application/Cm/Entity/CmMarkLabel.cs
@@ -43,15 +43,27 @@ public class CmMarkLabel : EntityBase
[SugarColumn(ColumnDescription = "Zoom坐标")]
public double ZoomPosition { get; set; }
+ ///
+ /// 视频宽度
+ ///
[SugarColumn(ColumnDescription = "视频宽度")]
public double VideoWidth { get; set; }
+ ///
+ /// 视频高度
+ ///
[SugarColumn(ColumnDescription = "视频高度")]
public double VideoHeight { get; set; }
+ ///
+ /// 画布 left 距离比例
+ ///
[SugarColumn(ColumnDescription = "画布 left 距离比例")]
public double CanvasLeftRatio { get; set; }
+ ///
+ /// 画布 top 距离比例
+ ///
[SugarColumn(ColumnDescription = "画布 top 距离比例")]
public double CanvasTopRatio { get; set; }
diff --git a/Cis.Application/Cm/Service/CmMarkLabelService.cs b/Cis.Application/Cm/Service/CmMarkLabelService.cs
index 7a1bed5..109591c 100644
--- a/Cis.Application/Cm/Service/CmMarkLabelService.cs
+++ b/Cis.Application/Cm/Service/CmMarkLabelService.cs
@@ -1,5 +1,6 @@
using Cis.Application.Core;
using Cis.Application.Core.Component.CameraSDK;
+using Cis.Application.Core.Component.PtzServer;
using EC.Helper.CameraSDK;
using Newtonsoft.Json.Linq;
@@ -13,11 +14,11 @@ public class CmMarkLabelService : IDynamicApiController, ITransient
{
private readonly SqlSugarRepository _baseRep;
- private CameraSdkServer _cameraSdk { get; set; }
+ private ICameraSdkServer _cameraSdk { get; set; }
public CmMarkLabelService(
SqlSugarRepository baseRep,
- CameraSdkServer cameraSdk
+ ICameraSdkServer cameraSdk
)
{
_baseRep = baseRep;
diff --git a/Cis.Application/Core/Center/CameraDataCenter.cs b/Cis.Application/Core/Center/CameraDataCenter.cs
index 0dbbeeb..ab46d0f 100644
--- a/Cis.Application/Core/Center/CameraDataCenter.cs
+++ b/Cis.Application/Core/Center/CameraDataCenter.cs
@@ -141,7 +141,7 @@ public class CameraDataCenter : ISingleton
if (markSearcher == null) return;
string cameraIp = _cache.HashGet(CacheInfo.CameraId2Ip, cameraId);
RedisValue value = _cache.HashGet(CacheInfo.CameraPtzInfos, cameraIp);
- if (value.IsNull) return;
+ if (!value.HasValue) return;
PtzInfo ptzInfo = value.ToString().FromJson();
markSearcher.UpdateCameraCalcParams(ptzInfo);
List resultList = await markSearcher.SearchAsync();
diff --git a/Cis.Application/Core/Component/CameraSDK/CameraSdkServer.cs b/Cis.Application/Core/Component/CameraSDK/CameraSdkServer.cs
index 05586c0..10b3fd0 100644
--- a/Cis.Application/Core/Component/CameraSDK/CameraSdkServer.cs
+++ b/Cis.Application/Core/Component/CameraSDK/CameraSdkServer.cs
@@ -57,7 +57,7 @@ public class CameraSdkServer : ICameraSdkServer, ISingleton
public bool GetPtzInfoById(string cameraId, out PtzInfo ptzInfo)
{
RedisValue value = _cache.HashGet(CacheInfo.CameraId2Ip, cameraId);
- if (value.IsNull) { ptzInfo = PtzInfo.Default; return false; }
+ if (!value.HasValue) { ptzInfo = PtzInfo.Default; return false; }
string ip = value.ToString();
return GetPtzInfoByIp(ip, out ptzInfo);
}
diff --git a/Cis.Application/Core/Component/MarkSeacher/MarkSearcherServer.cs b/Cis.Application/Core/Component/MarkSeacher/MarkSearcherServer.cs
index 1b0fa7a..cb497e3 100644
--- a/Cis.Application/Core/Component/MarkSeacher/MarkSearcherServer.cs
+++ b/Cis.Application/Core/Component/MarkSeacher/MarkSearcherServer.cs
@@ -145,7 +145,7 @@ public class MarkSearcherServer : IMarkSearcherServer, ISingleton
bool ret = MarkSearcherDict.TryRemove(cameraId, out _);
if (!ret) return false;
RedisValue value = _cache.HashGet(CacheInfo.CameraId2Ip, cameraId);
- if (value.IsNull) return false;
+ if (!value.HasValue) return false;
string cameraIp = (string)value;
_cache.HashDelete(CacheInfo.CameraId2Ip, cameraId);
_cache.HashDecrement(CacheInfo.CameraIpCounts, cameraIp);