Merge branch 'new/ThermoCamManager' into develop

This commit is contained in:
Samuele E. Locatelli
2021-02-23 17:11:57 +01:00
9 changed files with 31 additions and 18 deletions
@@ -91,10 +91,9 @@ namespace Thermo.Active.Thermocamera
/// <param name="points">Dictionary id richiesta + punto (es canali + relativi punti medi come centro calcolato della resistenza di riferimento del canale)</param>
/// <param name="temp">Dizionario temperature come id + valore double in °C</param>
/// <returns></returns>
public bool readMultiTemperatures(string setName, Dictionary<int, ThermoPoint> points, out Dictionary<int, double> temp)
public bool readMultiTemperatures(string setName, Dictionary<int, ThermoPoint> points, out List<MeasurePoint> temp)
{
temp = new Dictionary<int, double>();
List<MeasurePoint> measData = new List<MeasurePoint>();
temp = new List<MeasurePoint>();
// converto la richiesta in una lista di punti di misura...
List<MeasurePoint> reqData = points.Select(item => new MeasurePoint()
{
@@ -112,12 +111,12 @@ namespace Thermo.Active.Thermocamera
// carico file vari...
done = TCamLive.fileLoad(setName);
}
measData = TCamLive.getPointsTemperature(false, reqData);
// converto valori nel formato finale
foreach (var item in measData)
try
{
temp.Add(item.Id, item.Temperature);
temp = TCamLive.getPointsTemperature(false, reqData);
}
catch
{ }
// fatto!
return true;
}
@@ -110,6 +110,10 @@
<Project>{cbeb631b-abfa-4042-9779-c0060b0dfefe}</Project>
<Name>Thermo.Active.Utils</Name>
</ProjectReference>
<ProjectReference Include="..\Thermo.Cam.Utils\Thermo.Cam.Utils.csproj">
<Project>{E4587942-498B-4AA7-9CC9-9304EB2D05C8}</Project>
<Name>Thermo.Cam.Utils</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx">
+9 -3
View File
@@ -352,17 +352,23 @@ public static class ThreadsFunctions
// if requested --> give ack!
ncAdapter.ManageFlirStrobe();
// requesto photo from library
ncAdapter.lastThermoImage = TCCom.takePicture();
done = !string.IsNullOrEmpty(ncAdapter.lastThermoImage);
NcAdapter.lastThermoImage = TCCom.takePicture();
done = !string.IsNullOrEmpty(NcAdapter.lastThermoImage);
if (done)
{
// init
List<Thermo.Cam.Utils.MeasurePoint> measuredpoints = new List<Thermo.Cam.Utils.MeasurePoint>();
Dictionary<int, double> actualTemp = new Dictionary<int, double>();
Dictionary<int, ThermoPoint> chPoints = new Dictionary<int, ThermoPoint>();
// recupero punti centrali resistenze
ncAdapter.GetWarmersChannelCenterPoints(out chPoints);
// richiesta temperature per i punti
done = TCCom.readMultiTemperatures("", chPoints, out actualTemp);
done = TCCom.readMultiTemperatures("", chPoints, out measuredpoints);
// converto in actualTemp
foreach (var item in measuredpoints)
{
actualTemp.Add(item.Id, item.Temperature);
}
// salvo dati temp sul PLC
ncAdapter.WriteRecipeWarmChTCamTempAct(actualTemp);
// give PLC strobe for uploaded Actual TEMP from image
+1 -1
View File
@@ -117,7 +117,7 @@ namespace Thermo.Active.NC
/// <summary>
/// ultima immagine scattata dalla thermocam x salvataggio in PROD
/// </summary>
public string lastThermoImage = "_last";
public static string lastThermoImage = "_last";
/// <summary>
/// Avvio prod lotto
@@ -350,12 +350,12 @@ namespace Thermo.Active.Controllers.WebApi
return Ok(currWarmers);
}
[ResponseType(typeof(Dictionary<int, double>))]
[ResponseType(typeof(List<Thermo.Cam.Utils.MeasurePoint>))]
[Route("getMeasurePoints"), HttpGet]
public IHttpActionResult GetMeasurePoints(string setName)
{
// init punti...
Dictionary<int, double> resultPoints = new Dictionary<int, double>();
List<Thermo.Cam.Utils.MeasurePoint> resultPoints = new List<Cam.Utils.MeasurePoint>();
// Chiamo l'oggetto thermocam x il set richiesto...
TCCom.readMultiTemperatures(setName, MeasurePoints, out resultPoints);
// ritorno!
+1 -1
View File
@@ -30,4 +30,4 @@ using System.Runtime.InteropServices;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.1.165")]
[assembly: AssemblyVersion("1.1.167")]
+4
View File
@@ -16213,6 +16213,10 @@
<Project>{cbeb631b-abfa-4042-9779-c0060b0dfefe}</Project>
<Name>Thermo.Active.Utils</Name>
</ProjectReference>
<ProjectReference Include="..\Thermo.Cam.Utils\Thermo.Cam.Utils.csproj">
<Project>{e4587942-498b-4aa7-9cc9-9304eb2d05c8}</Project>
<Name>Thermo.Cam.Utils</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Service Include="{4A0DDDB5-7A95-4FBF-97CC-616D07737A77}" />
+1 -1
View File
@@ -24,7 +24,7 @@ namespace Thermo.Cam.Setup
/// <summary>
/// Classe gestione ThermoCam (oggetti Image, metodi processing...) x FlirCam
/// </summary>
protected TCContr TCamCtrl = new TCContr(BASE_PATH, BASE_PATH);
protected TCContr TCamCtrl = new TCContr($"{BASE_PATH}images\\", BASE_PATH);
#endregion Protected Fields
+3 -3
View File
@@ -20,13 +20,13 @@ namespace Thermo.Cam.Utils
{
#region Protected Fields
protected const string colorPath = "images\\colored";
protected const string colorPath = "colored";
protected const string confFileName = "ThermoConf.json";
protected const string currName = "_last";
protected const string dataFormat = "dat";
protected const string dataPath = "images\\data";
protected const string dataPath = "data";
protected const string imgFormat = "jpg";
protected const string thermPath = "images\\original";
protected const string thermPath = "original";
protected string _confBasePath = "";
protected string _imgBasePath = "";