diff --git a/Thermo.Active.NC/NcAdapter.cs b/Thermo.Active.NC/NcAdapter.cs
index 2e1eb859..85756e65 100644
--- a/Thermo.Active.NC/NcAdapter.cs
+++ b/Thermo.Active.NC/NcAdapter.cs
@@ -1615,17 +1615,18 @@ namespace Thermo.Active.NC
///
/// Update requested prod quantity
///
- ///
- ///
+ /// Total qty requested
+ /// Reset counter = new order
+ /// Number of pre-warm cycle requested
///
- public CmsError UpdateProdInfoData(short numTarget, bool newWorkOrder)
+ public CmsError UpdateProdInfoData(short numTarget, bool newWorkOrder,short preWarmCycle)
{
CmsError libraryError = NO_ERROR;
using (ProdInfoController prodInfoController = new ProdInfoController())
{
// registro dati aggiornati sul PLC
- libraryError = numericalControl.PLC_WProdInfo(numTarget, newWorkOrder);
+ libraryError = numericalControl.PLC_WProdInfo(numTarget, newWorkOrder,preWarmCycle);
if (libraryError.IsError())
return libraryError;
diff --git a/Thermo.Active/Controllers/WebApi/ProdController.cs b/Thermo.Active/Controllers/WebApi/ProdController.cs
index 104f6894..c6241e8f 100644
--- a/Thermo.Active/Controllers/WebApi/ProdController.cs
+++ b/Thermo.Active/Controllers/WebApi/ProdController.cs
@@ -45,6 +45,7 @@ namespace Thermo.Active.Controllers.WebApi
// ritorno solo fatto!
return Ok();
}
+#if false
///
/// Request mode AUTO
///
@@ -71,7 +72,8 @@ namespace Thermo.Active.Controllers.WebApi
// ritorno solo fatto!
return Ok();
- }
+ }
+#endif
///
/// Request mode SETUP
///
@@ -136,10 +138,11 @@ namespace Thermo.Active.Controllers.WebApi
///
/// item NUM
/// scrap flag (true/false)
+ /// warmup cycle requested (0=none)
///
[Route("start"), HttpPut]
[WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.RECIPE_MANAGER, Action = ACTIONS.READ)]
- public IHttpActionResult StartProd(int requestQty, bool newWorkOrder)
+ public IHttpActionResult StartProd(int requestQty, bool newWorkOrder, int numCicliRisc)
{
// Try connection
CmsError libraryError = ncAdapter.Connect();
@@ -149,19 +152,27 @@ namespace Thermo.Active.Controllers.WebApi
return BadRequest(libraryError.localizationKey);
}
- // scrivo sul PLC il comando strobe richiesta AUTO!
- libraryError = ncAdapter.UpdateProdInfoData((short)requestQty, newWorkOrder);
+ // scrivo sul PLC pezzi richiesti, cicli riscaldo + comando strobe reset se encessario!
+ libraryError = ncAdapter.UpdateProdInfoData((short)requestQty, newWorkOrder, (short)numCicliRisc);
if (libraryError.IsError())
{
ThermoActiveLogger.LogError($"StartProd error | {libraryError.exception}");
return BadRequest(libraryError.localizationKey);
}
- // se new workorder --> registro nuova data lorro!
+ // se new workorder --> registro nuova data x start lotto!
if (newWorkOrder)
{
ncAdapter.lottoStart = DateTime.Now;
}
+ // scrivo sul PLC il comando strobe richiesta AUTO!
+ libraryError = ncAdapter.StrobeMode(Mode.AUTO);
+ if (libraryError.IsError())
+ {
+ ThermoActiveLogger.LogError($"RequestAuto error | {libraryError.exception}");
+ return BadRequest(libraryError.localizationKey);
+ }
+
// ritorno solo fatto!
return Ok();
}
diff --git a/Thermo.Active/Properties/AssemblyInfo.cs b/Thermo.Active/Properties/AssemblyInfo.cs
index e1a9bc55..73614f55 100644
--- a/Thermo.Active/Properties/AssemblyInfo.cs
+++ b/Thermo.Active/Properties/AssemblyInfo.cs
@@ -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.12.66")]
\ No newline at end of file
+[assembly: AssemblyVersion("0.12.67")]
\ No newline at end of file