Merge branch 'develop' into feature/prodMgmt
This commit is contained in:
@@ -1615,17 +1615,18 @@ namespace Thermo.Active.NC
|
||||
/// <summary>
|
||||
/// Update requested prod quantity
|
||||
/// </summary>
|
||||
/// <param name="numTarget"></param>
|
||||
/// <param name="newWorkOrder"></param>
|
||||
/// <param name="numTarget">Total qty requested</param>
|
||||
/// <param name="newWorkOrder">Reset counter = new order</param>
|
||||
/// <param name="preWarmCycle">Number of pre-warm cycle requested</param>
|
||||
/// <returns></returns>
|
||||
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;
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ namespace Thermo.Active.Controllers.WebApi
|
||||
// ritorno solo fatto!
|
||||
return Ok();
|
||||
}
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Request mode AUTO
|
||||
/// </summary>
|
||||
@@ -71,7 +72,8 @@ namespace Thermo.Active.Controllers.WebApi
|
||||
|
||||
// ritorno solo fatto!
|
||||
return Ok();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/// <summary>
|
||||
/// Request mode SETUP
|
||||
/// </summary>
|
||||
@@ -136,10 +138,11 @@ namespace Thermo.Active.Controllers.WebApi
|
||||
/// </summary>
|
||||
/// <param name="requestQty">item NUM</param>
|
||||
/// <param name="newWorkOrder">scrap flag (true/false)</param>
|
||||
/// <param name="numCicliRisc">warmup cycle requested (0=none)</param>
|
||||
/// <returns></returns>
|
||||
[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();
|
||||
}
|
||||
|
||||
@@ -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")]
|
||||
[assembly: AssemblyVersion("0.12.67")]
|
||||
Reference in New Issue
Block a user