chane - 定点巡检添加数据记录

master
wenjy 2 months ago
parent 66922f3f30
commit f98f55c6cb

@ -144,9 +144,14 @@ namespace SlnMesnac.Business
}
}
public readonly RealTemperatureInfo _realTemperatureInfo = new RealTemperatureInfo();
public delegate void GimbaRotationControl(string wPanPos, string wTiltPos, string wZoomPos);
public event GimbaRotationControl GimbaRotationControlEvent;
public delegate void CaptureAlarmPicture(string sJpegPicFileName);
public event CaptureAlarmPicture CaptureAlarmPictureEvent;
private void SendLiftMotorDict(base_busbar_info busbar)
{
@ -164,6 +169,68 @@ namespace SlnMesnac.Business
{
GimbaRotationControlEvent?.Invoke(busbar.wPanPos, busbar.wTiltPos, busbar.wZoomPos);
}
_log.Info($"5S后开始测温");
Task.Delay(5000).Wait();
_log.Info($"温度测量完成,最高温度:{_realTemperatureInfo.fMaxTemperature};最低温度:{_realTemperatureInfo.fMinTemperature};平均温度:{_realTemperatureInfo.fAverageTemperature};温差:{_realTemperatureInfo.fTemperatureDiff}");
this.SaveBusbarTemp(busbar.busbarCode, busbar.cabinetCode, _realTemperatureInfo, busbar.isPictures);
Task.Delay(1000).Wait();
}
/// <summary>
/// 保存母排测温数据
/// </summary>
/// <param name="busbarCode"></param>
/// <param name="cabinetCode"></param>
/// <param name="realTemperatureInfo"></param>
private void SaveBusbarTemp(int? busbarCode, int? cabinetCode, RealTemperatureInfo realTemperatureInfo, int isPictures)
{
try
{
var record = new record_busbar_temp()
{
busbarCode = busbarCode,
cabinetCode = cabinetCode,
tempMax = (decimal)realTemperatureInfo.fMaxTemperature,
tempMin = (decimal)realTemperatureInfo.fMinTemperature,
tempAvg = (decimal)realTemperatureInfo.fAverageTemperature,
tempDiff = (decimal)realTemperatureInfo.fTemperatureDiff,
recordTime = DateTime.Now,
};
if (realTemperatureInfo.fMaxTemperature > 65)
{
record.isAlarm = 1;
string sJpegPicFileName = $"{cabinetCode}_{busbarCode}_{DateTime.Now.ToString("yyyyMMddHHmmssffff")}.jpg";
record.filePath = sJpegPicFileName;
CaptureAlarmPictureEvent?.Invoke(sJpegPicFileName);
}
else
{
if (isPictures == 1)
{
string sJpegPicFileName = $"{cabinetCode}_{busbarCode}_{DateTime.Now.ToString("yyyyMMddHHmmssffff")}.jpg";
record.filePath = sJpegPicFileName;
CaptureAlarmPictureEvent?.Invoke(sJpegPicFileName);
}
}
var res = _record_busbar_TempServices.Insert(record);
if (res)
{
_log.Info($"{cabinetCode}号电柜{busbarCode}排数据保存成功");
}
else
{
_log.Info($"{cabinetCode}号电柜{busbarCode}排数据保存失败");
}
}
catch (Exception e)
{
_log.Info($"{cabinetCode}号电柜{busbarCode}排数据保存异常:{e.Message}");
}
}
}

@ -207,6 +207,11 @@ namespace SlnMesnac.WPF.ViewModel
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;
}
this.RealTemperature = new RealTemperatureInfo()

Loading…
Cancel
Save