|
|
|
@ -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}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|