From 3e8df4844349f82398cd52ffa7ccf75adf567e37 Mon Sep 17 00:00:00 2001 From: tanglong <842690096@qq.com> Date: Tue, 20 Jan 2026 15:23:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A5=B9=E5=A5=B9=E5=A5=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/Setting/LongSetting.xaml.cs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/Wpf_AiSportsMicrospace/Views/Setting/LongSetting.xaml.cs b/Wpf_AiSportsMicrospace/Views/Setting/LongSetting.xaml.cs index 80c3ca3..1965960 100644 --- a/Wpf_AiSportsMicrospace/Views/Setting/LongSetting.xaml.cs +++ b/Wpf_AiSportsMicrospace/Views/Setting/LongSetting.xaml.cs @@ -35,7 +35,7 @@ namespace Wpf_AiSportsMicrospace.Views { private bool _isDragging = false; private Ellipse _draggedEllipse; - private System.Windows.Point _dragStartPoint; + private System.Windows.Point _dragStartPoint; private IHumanPredictor _humanPredictor; private IObjectDetector _objectDetector; private HumanGraphicsRenderer _humanGraphicsRenderer; @@ -62,17 +62,14 @@ namespace Wpf_AiSportsMicrospace.Views var app = (App)Application.Current; using var scope = App.AppHost.Services.CreateScope(); var db = scope.ServiceProvider.GetRequiredService(); - var BaseData = await db.BasicConfig.FirstOrDefaultAsync(); - var host = "172.17.30.64"; - var name = "admin"; - var password = "yd708090"; - if (BaseData != null) { - host = BaseData.Host; - name = BaseData.UserName; - password = BaseData.Password; + var BaseData = await db.BasicConfig.FirstOrDefaultAsync(x => x.Code == AppSettings.Code); + if (BaseData==null) + { + this.ShowError("相机主机地址/IP不能为空。"); + return; } - var _webcamClient = WebcamClient.CreateRTSP( host, name, password, 554u); + var _webcamClient = WebcamClient.CreateRTSP(BaseData.Host, BaseData.UserName, BaseData.Password); //处理抽帧回调 _webcamClient.OnExtractFrame += this.OnFrameExtracted; @@ -390,7 +387,7 @@ namespace Wpf_AiSportsMicrospace.Views BottomPoint3 = new AiSportsMicrospaceDB.Entities.Point { X = 1722, Y = 909 }, }); } - + await db.SaveChangesAsync(); }