Merge remote-tracking branch 'CMS/develop' into develop

This commit is contained in:
=
2020-07-15 10:28:37 +02:00
4 changed files with 17 additions and 4 deletions
@@ -73,7 +73,7 @@ namespace Thermo.Active.Database.Controllers
// Create database machine model
ProdInfoModel prodData = new ProdInfoModel()
{
DtEvent = DateTime.UtcNow,
DtEvent = DateTime.Now,
NumTarget = NumTarget,
NumDone = NumDone,
TimeWarm = TimeWarm,
+5 -1
View File
@@ -1390,6 +1390,7 @@ namespace Thermo.Active.NC
// creo una perturubazione...
var rand = new Random();
int slope = TS_TC.Count / 2;
Dictionary<int, double> origTcData = new Dictionary<int, double>();
foreach (var item2fix in TS_TC)
{
@@ -1397,7 +1398,8 @@ namespace Thermo.Active.NC
}
foreach (var origVal in origTcData)
{
TS_TC[origVal.Key] = Math.Round(origVal.Value + (rand.NextDouble() * 20 - 10), 2);
TS_TC[origVal.Key] = Math.Round(origVal.Value + (rand.NextDouble() * 20 - 10) + slope, 2);
slope--;
if (TS_Cad.ContainsKey(origVal.Key))
{
TS_Cad[origVal.Key] = Math.Round((double)3600 / TS_TC[origVal.Key], 2);
@@ -1513,6 +1515,8 @@ namespace Thermo.Active.NC
libraryError = numericalControl.PLC_WAckPzProdEnd();
if (libraryError.IsError())
return libraryError;
// salvo x sicurezza ultimo start...
lastProdStart = DateTime.Now;
}
return libraryError;
@@ -1,6 +1,7 @@
using CMS_CORE_Library.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;
using Thermo.Active.Model.DTOModels.ThProd;
using Thermo.Active.NC;
@@ -186,6 +187,7 @@ namespace Thermo.Active.Controllers.WebApi
[Route("history"), HttpGet]
public IHttpActionResult GetHistory(int indexStart, int numRecord)
{
List<DTOProdInfo> prodInfoDTO = new List<DTOProdInfo>();
// Try connection
CmsError libraryError = ncAdapter.Connect();
if (libraryError.IsError())
@@ -196,14 +198,21 @@ namespace Thermo.Active.Controllers.WebApi
// recupero da DB i record richiesti
libraryError = ncAdapter.GetHistProdInfoData(out List<ThermoModels.ProdInfoModel> prodInfoDataList, indexStart, numRecord);
if (libraryError.IsError())
{
ThermoActiveLogger.LogError($"GetHistory error | {libraryError.exception}");
return BadRequest(libraryError.localizationKey);
}
// converto da datiPLC a DTOProdInfo...
foreach (var item in prodInfoDataList)
{
prodInfoDTO.Add(new DTOProdInfo(item));
}
// ritorno solo fatto!
return Ok(prodInfoDataList);
return Ok(prodInfoDTO);
}
/// <summary>
/// Request Prod Panel data
+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("0.9.39")]
[assembly: AssemblyVersion("0.9.40")]