diff --git a/Cis.Application/Cis.Application.xml b/Cis.Application/Cis.Application.xml
index 58bc696..43f65b3 100644
--- a/Cis.Application/Cis.Application.xml
+++ b/Cis.Application/Cis.Application.xml
@@ -506,6 +506,11 @@
FocusY
+
+
+ ZoomVaryExpr
+
+
视频宽度
diff --git a/Cis.Application/Core/Component/MarkSeacher/Entity/CameraCalcParams.cs b/Cis.Application/Core/Component/MarkSeacher/Entity/CameraCalcParams.cs
index 0f2515c..c837568 100644
--- a/Cis.Application/Core/Component/MarkSeacher/Entity/CameraCalcParams.cs
+++ b/Cis.Application/Core/Component/MarkSeacher/Entity/CameraCalcParams.cs
@@ -1,4 +1,5 @@
using EC.Helper.CameraSDK;
+using EC.Helper.RabbitFunc.Expressions;
namespace Cis.Application.Core.Component.MarkSeacher;
@@ -27,6 +28,11 @@ public class CameraCalcParams
///
public double FocusY { get; set; }
+ ///
+ /// ZoomVaryExpr
+ ///
+ public LambdaExpression ZoomVaryExpr { get; set; }
+
///
/// 视频宽度
///
@@ -37,7 +43,7 @@ public class CameraCalcParams
///
public int VideoHeight { get; set; }
- public static CameraCalcParams New(long id, PtzInfo ptzInfo, double focusX, double focusY, int videoWidth = 1920, int videoHeight = 1080)
+ public static CameraCalcParams New(long id, PtzInfo ptzInfo, double focusX, double focusY, LambdaExpression ZoomVaryExpr, int videoWidth = 1920, int videoHeight = 1080)
{
return new()
{
@@ -45,6 +51,7 @@ public class CameraCalcParams
PtzInfo = ptzInfo,
FocusX = focusX,
FocusY = focusY,
+ ZoomVaryExpr = ZoomVaryExpr,
VideoWidth = videoWidth,
VideoHeight = videoHeight,
};
diff --git a/Cis.Application/Core/Component/MarkSeacher/MarkSearcherServer.cs b/Cis.Application/Core/Component/MarkSeacher/MarkSearcherServer.cs
index 61823c9..7fc9c53 100644
--- a/Cis.Application/Core/Component/MarkSeacher/MarkSearcherServer.cs
+++ b/Cis.Application/Core/Component/MarkSeacher/MarkSearcherServer.cs
@@ -2,6 +2,8 @@
using Cis.Application.Cm;
using Cis.Application.Core.Component.PtzServer;
using EC.Helper.CameraSDK;
+using EC.Helper.RabbitFunc;
+using EC.Helper.RabbitFunc.Expressions;
using FreeRedis;
using System.Collections.Concurrent;
@@ -97,8 +99,11 @@ public class MarkSearcherServer : IMarkSearcherServer, ISingleton
ret = _cameraSdkServer.TryGetPtzInfoByIp(cbCamera.Ip, out PtzInfo ptzInfo);
if (!ret) return false;
+ // 解析 ZoomVaryFunc
+ LambdaExpression zoomVaryExpr = RabbitFuncUtil.CompileFromSource(cbCameraParams.ZoomVaryFunc);
+
// 创建相机计算参数
- CameraCalcParams cameraCalcParams = CameraCalcParams.New(cbCamera.Id, ptzInfo, cbCameraParams.FocusX, cbCameraParams.FocusY);
+ CameraCalcParams cameraCalcParams = CameraCalcParams.New(cbCamera.Id, ptzInfo, cbCameraParams.FocusX, cbCameraParams.FocusY, zoomVaryExpr);
// 创建 markSearcher
MarkSearcherBase markSearcher = ((CameraType)cbCameraParams.CameraType).CreateMarkSearcher(cameraCalcParams);
if (markSearcher == null) return false;
diff --git a/Cis.Application/Core/Component/MarkSeacher/Seacher/DaHuaMarkSearcher.cs b/Cis.Application/Core/Component/MarkSeacher/Seacher/DaHuaMarkSearcher.cs
index 4937e19..4c656c8 100644
--- a/Cis.Application/Core/Component/MarkSeacher/Seacher/DaHuaMarkSearcher.cs
+++ b/Cis.Application/Core/Component/MarkSeacher/Seacher/DaHuaMarkSearcher.cs
@@ -22,7 +22,10 @@ public class DaHuaMarkSearcher : MarkSearcherBase
protected override double GetZoomTag(double zoomPos)
{
- double ret = zoomPos / (128.0 / 42.0) + 1;
+ double ret = (double)CameraCalcParams.ZoomVaryExpr.Eval(new()
+ {
+ ["x"] = zoomPos,
+ });
return ret;
}
diff --git a/Cis.Application/Core/Component/MarkSeacher/Seacher/HiKMarkSeacher.cs b/Cis.Application/Core/Component/MarkSeacher/Seacher/HiKMarkSeacher.cs
index 7b3c164..0fd1cee 100644
--- a/Cis.Application/Core/Component/MarkSeacher/Seacher/HiKMarkSeacher.cs
+++ b/Cis.Application/Core/Component/MarkSeacher/Seacher/HiKMarkSeacher.cs
@@ -29,8 +29,10 @@ public class HiKMarkSearcher : MarkSearcherBase
protected override double GetZoomTag(double zoomPos)
{
- double ret = HexToDecMa(zoomPos) * 0.1;
- ret = (ret - 1) * 0.65 + 1;
+ double ret = (double)CameraCalcParams.ZoomVaryExpr.Eval(new()
+ {
+ ["x"] = HexToDecMa(zoomPos),
+ });
return ret;
}
@@ -38,7 +40,7 @@ public class HiKMarkSearcher : MarkSearcherBase
#region Util
- protected int HexToDecMa(double wHex)
+ protected static int HexToDecMa(double wHex)
{
int wHexInt = wHex.ToInt();
int ret = (wHexInt / 4096) * 1000 + ((wHexInt % 4096) / 256) * 100 + ((wHexInt % 256) / 16) * 10 + (wHexInt % 16);
diff --git a/Cis.Web.Entry/Properties/launchSettings.json b/Cis.Web.Entry/Properties/launchSettings.json
index 7a9aa32..8a8d345 100644
--- a/Cis.Web.Entry/Properties/launchSettings.json
+++ b/Cis.Web.Entry/Properties/launchSettings.json
@@ -1,29 +1,29 @@
{
- "profiles": {
- "IIS Express": {
- "commandName": "IISExpress",
- "launchBrowser": true,
- "environmentVariables": {
- "ASPNETCORE_ENVIRONMENT": "Development"
- }
- },
- "Cis.Web.Entry": {
- "commandName": "Project",
- "launchBrowser": true,
- "environmentVariables": {
- "ASPNETCORE_ENVIRONMENT": "Development"
- },
- "dotnetRunMessages": true,
- "applicationUrl": "http://localhost:5000;http://*:5000;"
- //"applicationUrl": "https://localhost:5001;https://*:5001;"
- }
- },
- "iisSettings": {
- "windowsAuthentication": false,
- "anonymousAuthentication": true,
- "iisExpress": {
- "applicationUrl": "http://localhost:58595",
- "sslPort": 44326
- }
- }
+ "profiles": {
+ "IIS Express": {
+ "commandName": "IISExpress",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ "Cis.Web.Entry": {
+ "commandName": "Project",
+ "launchBrowser": false,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "dotnetRunMessages": true,
+ "applicationUrl": "http://localhost:5000;http://*:5000;"
+ //"applicationUrl": "https://localhost:5001;https://*:5001;"
+ }
+ },
+ "iisSettings": {
+ "windowsAuthentication": false,
+ "anonymousAuthentication": true,
+ "iisExpress": {
+ "applicationUrl": "http://localhost:58595",
+ "sslPort": 44326
+ }
+ }
}
\ No newline at end of file