new rel + cleanup

This commit is contained in:
Samuele E. Locatelli
2021-02-26 16:09:15 +01:00
parent 5091401096
commit 5122bb5b79
2 changed files with 1 additions and 63 deletions
@@ -461,68 +461,6 @@ namespace Thermo.Active.Controllers.WebApi
return Ok();
}
#if false
/// <summary>
/// Simulate Flir image req from PLC
/// </summary>
/// <param name="enableTCam"></param>
/// <returns></returns>
[Route("simReqFlirImg"), HttpPut]
[WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.RECIPE_MANAGER, Action = ACTIONS.READ)]
public IHttpActionResult SimReqFlirImg()
{
// Try connection
CmsError libraryError = ncAdapter.Connect();
if (libraryError.IsError())
{
ThermoActiveLogger.LogError($"NC Not connected! | SimReqFlirImg | {libraryError.exception}");
return BadRequest(libraryError.localizationKey);
}
// recupero valori attuali
libraryError = ncAdapter.ReadWarmers(false, out Dictionary<int, DTOWarmers> currWarmers);
if (libraryError.IsError())
{
ThermoActiveLogger.LogError($"SimReqFlirImg | GetRecipeOverview error | {libraryError.exception}");
return BadRequest(libraryError.localizationKey);
}
// scrivo sul PLC i dati SIMULATI di una lettura Flir
Dictionary<int, double> chSimTemp = new Dictionary<int, double>();
Random rnd = new Random();
double simVal = 0;
foreach (var item in currWarmers)
{
if (item.Value.TCamTempSet > 100)
{
simVal = item.Value.TCamTempSet + (rnd.NextDouble() * 10 - 5);
}
else
{
simVal = rnd.NextDouble() * 200 + 100;
}
// accodo!
chSimTemp.Add(item.Key, simVal);
}
libraryError = ncAdapter.WriteRecipeWarmChTCamTempAct(chSimTemp);
if (libraryError.IsError())
{
ThermoActiveLogger.LogError($"SimReqFlirImg error | {libraryError.exception}");
return BadRequest(libraryError.localizationKey);
}
// recupero valori attuali post update
libraryError = ncAdapter.ReadWarmers(false, out Dictionary<int, DTOWarmers> newWarmers);
// pubblico
MessageServices.Current.Publish(SEND_THERMO_WARMERS_DATA, null, newWarmers);
// ritorno solo fatto!
return Ok();
}
#endif
/// <summary>
/// Force take photo
/// </summary>
+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.169")]
[assembly: AssemblyVersion("1.1.170")]