Aggiunta gestione status camera connessa o meno (lettura)
This commit is contained in:
@@ -51,6 +51,14 @@
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Flir.Atlas.Image, Version=2.0.14266.1000, Culture=neutral, PublicKeyToken=caa391fd8e07c76b, processorArchitecture=x86">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\Program Files (x86)\FLIR Systems\FLIR Atlas SDK 6\bin\x86\Flir.Atlas.Image.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Flir.Atlas.Live, Version=2.0.14266.1000, Culture=neutral, PublicKeyToken=caa391fd8e07c76b, processorArchitecture=x86">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\Program Files (x86)\FLIR Systems\FLIR Atlas SDK 6\bin\x86\Flir.Atlas.Live.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Flir.Atlas.Live.Device;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@@ -26,6 +27,11 @@ namespace Thermo.Active.Thermocamera
|
||||
|
||||
public static readonly string BASE_PATH = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
|
||||
|
||||
/// <summary>
|
||||
/// Indica se la camera sia connessa
|
||||
/// </summary>
|
||||
public bool CameraIsConnected = false;
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
#region Public Constructors
|
||||
@@ -39,6 +45,9 @@ namespace Thermo.Active.Thermocamera
|
||||
// init classe controllo camera
|
||||
TCamLive = new TCContr($"{Constants.WEBSITE_DIRECTORY}\\{Constants.THERMO_DATA_FOLDER}", $"{BASE_PATH}\\{Constants.CONFIG_DIRECTORY}");
|
||||
|
||||
// aggancio evento connesisone/disconnessione
|
||||
TCamLive.eh_CameraConnStatusChanged += TCamLive_eh_CameraConnStatusChanged;
|
||||
|
||||
// avvio classe gestione thermocamera...
|
||||
TCamLive.tryReloadConf();
|
||||
|
||||
@@ -49,6 +58,12 @@ namespace Thermo.Active.Thermocamera
|
||||
}
|
||||
}
|
||||
|
||||
private void TCamLive_eh_CameraConnStatusChanged(object sender, Flir.Atlas.Live.ConnectionStatusChangedEventArgs e)
|
||||
{
|
||||
// salvo stato connessione
|
||||
CameraIsConnected = e.Status == ConnectionStatus.Connected;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
@@ -394,6 +394,9 @@ public static class ThreadsFunctions
|
||||
ncAdapter.SendTCamImageReadyStrb();
|
||||
}
|
||||
}
|
||||
|
||||
// salvo status thermocam...
|
||||
NcAdapter.cameraIsConnected = TCCom.CameraIsConnected;
|
||||
}
|
||||
else
|
||||
RestoreConnection();
|
||||
|
||||
@@ -135,6 +135,11 @@ namespace Thermo.Active.NC
|
||||
/// </summary>
|
||||
public NcThermo numericalControl;
|
||||
|
||||
/// <summary>
|
||||
/// Indica se la FLIR camera è connessa
|
||||
/// </summary>
|
||||
public static bool cameraIsConnected = false;
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
Reference in New Issue
Block a user