|
|
@ -1,6 +1,8 @@
|
|
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
|
|
using CommunityToolkit.Mvvm.Input;
|
|
|
|
using CommunityToolkit.Mvvm.Input;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
|
|
|
|
using NVelocity.Util.Introspection;
|
|
|
|
using SlnMesnac.Business;
|
|
|
|
using SlnMesnac.Business;
|
|
|
|
using SlnMesnac.Business.@base;
|
|
|
|
using SlnMesnac.Business.@base;
|
|
|
|
using SlnMesnac.Config;
|
|
|
|
using SlnMesnac.Config;
|
|
|
@ -46,6 +48,9 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
private AutoModeBusiness autoModeBusiness;
|
|
|
|
private AutoModeBusiness autoModeBusiness;
|
|
|
|
private InspModeBusiness inspModeBusiness;
|
|
|
|
private InspModeBusiness inspModeBusiness;
|
|
|
|
private FixedPointBusiness fixedPointBusiness;
|
|
|
|
private FixedPointBusiness fixedPointBusiness;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private WebSocketBusiness webSocketBusiness;
|
|
|
|
|
|
|
|
|
|
|
|
private AppConfig _appConfig;
|
|
|
|
private AppConfig _appConfig;
|
|
|
|
|
|
|
|
|
|
|
|
private CHCNetSDK.RemoteConfigCallback _callback;
|
|
|
|
private CHCNetSDK.RemoteConfigCallback _callback;
|
|
|
@ -71,6 +76,7 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
autoModeBusiness = App.ServiceProvider.GetService<AutoModeBusiness>();
|
|
|
|
autoModeBusiness = App.ServiceProvider.GetService<AutoModeBusiness>();
|
|
|
|
inspModeBusiness = App.ServiceProvider.GetService<InspModeBusiness>();
|
|
|
|
inspModeBusiness = App.ServiceProvider.GetService<InspModeBusiness>();
|
|
|
|
fixedPointBusiness = App.ServiceProvider.GetService<FixedPointBusiness>();
|
|
|
|
fixedPointBusiness = App.ServiceProvider.GetService<FixedPointBusiness>();
|
|
|
|
|
|
|
|
webSocketBusiness = App.ServiceProvider.GetService<WebSocketBusiness>();
|
|
|
|
|
|
|
|
|
|
|
|
autoModeBusiness.CaptureAlarmPictureEvent += CapturePicture;
|
|
|
|
autoModeBusiness.CaptureAlarmPictureEvent += CapturePicture;
|
|
|
|
autoModeBusiness.GimbaRotationControlEvent += GimbaRotationControl;
|
|
|
|
autoModeBusiness.GimbaRotationControlEvent += GimbaRotationControl;
|
|
|
@ -205,24 +211,6 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
public void GetThermInfoCallback(uint dwType, IntPtr lpBuffer, uint dwBufLen, IntPtr pUserData)
|
|
|
|
public void GetThermInfoCallback(uint dwType, IntPtr lpBuffer, uint dwBufLen, IntPtr pUserData)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var ret = Marshal.PtrToStructure<CHCNetSDK.NET_DVR_THERMOMETRY_UPLOAD>(lpBuffer);
|
|
|
|
var ret = Marshal.PtrToStructure<CHCNetSDK.NET_DVR_THERMOMETRY_UPLOAD>(lpBuffer);
|
|
|
|
if (autoModeBusiness != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
autoModeBusiness._realTemperatureInfo.fMaxTemperature = (float)Math.Round(ret.struLinePolygonThermCfg.fMaxTemperature, 1);
|
|
|
|
|
|
|
|
autoModeBusiness._realTemperatureInfo.fMinTemperature = (float)Math.Round(ret.struLinePolygonThermCfg.fMinTemperature);
|
|
|
|
|
|
|
|
autoModeBusiness._realTemperatureInfo.fAverageTemperature = (float)Math.Round(ret.struLinePolygonThermCfg.fAverageTemperature, 1);
|
|
|
|
|
|
|
|
autoModeBusiness._realTemperatureInfo.fTemperatureDiff = (float)Math.Round(ret.struLinePolygonThermCfg.fTemperatureDiff, 1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fixedPointBusiness._realTemperatureInfo.fMaxTemperature = autoModeBusiness._realTemperatureInfo.fMaxTemperature;
|
|
|
|
|
|
|
|
fixedPointBusiness._realTemperatureInfo.fMinTemperature = autoModeBusiness._realTemperatureInfo.fMinTemperature;
|
|
|
|
|
|
|
|
fixedPointBusiness._realTemperatureInfo.fAverageTemperature = autoModeBusiness._realTemperatureInfo.fAverageTemperature;
|
|
|
|
|
|
|
|
fixedPointBusiness._realTemperatureInfo.fTemperatureDiff = autoModeBusiness._realTemperatureInfo.fTemperatureDiff;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inspModeBusiness._realTemperatureInfo.fMaxTemperature = autoModeBusiness._realTemperatureInfo.fMaxTemperature;
|
|
|
|
|
|
|
|
inspModeBusiness._realTemperatureInfo.fMinTemperature = autoModeBusiness._realTemperatureInfo.fMinTemperature;
|
|
|
|
|
|
|
|
inspModeBusiness._realTemperatureInfo.fAverageTemperature = autoModeBusiness._realTemperatureInfo.fAverageTemperature;
|
|
|
|
|
|
|
|
inspModeBusiness._realTemperatureInfo.fTemperatureDiff = autoModeBusiness._realTemperatureInfo.fTemperatureDiff;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.RealTemperature = new RealTemperatureInfo()
|
|
|
|
this.RealTemperature = new RealTemperatureInfo()
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -231,6 +219,17 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
fAverageTemperature = (float)Math.Round(ret.struLinePolygonThermCfg.fAverageTemperature, 1),
|
|
|
|
fAverageTemperature = (float)Math.Round(ret.struLinePolygonThermCfg.fAverageTemperature, 1),
|
|
|
|
fTemperatureDiff = (float)Math.Round(ret.struLinePolygonThermCfg.fTemperatureDiff, 1),
|
|
|
|
fTemperatureDiff = (float)Math.Round(ret.struLinePolygonThermCfg.fTemperatureDiff, 1),
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
using (var scope = App.ServiceProvider.CreateScope())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var info = scope.ServiceProvider.GetRequiredService<RealTemperatureInfo>();
|
|
|
|
|
|
|
|
info.fMaxTemperature = _realTemperature.fMaxTemperature;
|
|
|
|
|
|
|
|
info.fMinTemperature = _realTemperature.fMinTemperature;
|
|
|
|
|
|
|
|
info.fAverageTemperature = _realTemperature.fAverageTemperature;
|
|
|
|
|
|
|
|
info.fTemperatureDiff = _realTemperature.fTemperatureDiff;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
webSocketBusiness.Encapsulation(false, null, null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
@ -660,5 +659,6 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|