使用Flir A310红外热成像仪做环境监控
使用厂家提供的C# SDK开发基于Flir A310的环境监控软件
实时显示温度的代码段:
// 温度监控
private void timerIr1_Tick(object sender, EventArgs e)
{
if (!IsConnected(camera))
return;
try
{
if (camera.Image != null)
{
camera.Image.EnterLock();
if (m_compareIr1)
{
ThresholdInfo irThre = thresholdSetForm.dictThreshold["IR1"];
int res = CompareTemp(ref camera, irThre);
if (!camera.IsWarning)
{
if (1 == res) // 1级告警
{
string str = string.Format("1级告警:[红外1_{0}] 温度超过{1:F01}!", camera.Ip, irThre.max1);
addWarnLog(str);
camera.ShowWarn();
camera.IsWarning = true;
}
else if (2 == res) // 2级告警
{
string str = string.Format("2级告警:[红外1_{0}] 温度超过{1:F01}!", camera.Ip, irThre.max2);
addWarnLog(str);
camera.ShowWarn();
camera.IsWarning = true;
}
}
else 若处于报警状态,CompareTemp判断正常,则将报警状态变回正常
{
if (0 == res)
camera.IsWarning = false;
}
}
camera.ClearAllMeasurments();
camera.ShowWarnRect();
this.pictureBoxIr1.Image = camera.GetMeasurementsImage();
}
}
catch (Exception ex)
{
string msg = ex.Message;
}
finally
{
if (camera.Image != null)
{
camera.Image.ExitLock();
}
}
}