rimesso metodo x set AUTO + metodo x start prod full
This commit is contained in:
@@ -45,7 +45,7 @@ namespace Thermo.Active.Controllers.WebApi
|
||||
// ritorno solo fatto!
|
||||
return Ok();
|
||||
}
|
||||
#if false
|
||||
#if true
|
||||
/// <summary>
|
||||
/// Request mode AUTO
|
||||
/// </summary>
|
||||
@@ -138,11 +138,10 @@ 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, int numCicliRisc)
|
||||
public IHttpActionResult StartProd(int requestQty, bool newWorkOrder)
|
||||
{
|
||||
// Try connection
|
||||
CmsError libraryError = ncAdapter.Connect();
|
||||
@@ -152,8 +151,51 @@ namespace Thermo.Active.Controllers.WebApi
|
||||
return BadRequest(libraryError.localizationKey);
|
||||
}
|
||||
|
||||
// FIXME TODO: cicli preriscaldo a 0!!!! attendere OK di Marco x usarli davvero
|
||||
numCicliRisc = 0;
|
||||
// legacy method
|
||||
short numCicliRisc = 0;
|
||||
|
||||
// scrivo sul PLC pezzi richiesti, cicli riscaldo + comando strobe reset se encessario!
|
||||
libraryError = ncAdapter.UpdateProdInfoData((short)requestQty, newWorkOrder, numCicliRisc);
|
||||
if (libraryError.IsError())
|
||||
{
|
||||
ThermoActiveLogger.LogError($"StartProd error | {libraryError.exception}");
|
||||
return BadRequest(libraryError.localizationKey);
|
||||
}
|
||||
// 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();
|
||||
}
|
||||
/// <summary>
|
||||
/// Request start production
|
||||
/// </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("startFull"), HttpPut]
|
||||
[WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.RECIPE_MANAGER, Action = ACTIONS.READ)]
|
||||
public IHttpActionResult StartProdFull(int requestQty, bool newWorkOrder, int numCicliRisc)
|
||||
{
|
||||
// Try connection
|
||||
CmsError libraryError = ncAdapter.Connect();
|
||||
if (libraryError.IsError())
|
||||
{
|
||||
ThermoActiveLogger.LogError($"NC Not connected! | StartProd | {libraryError.exception}");
|
||||
return BadRequest(libraryError.localizationKey);
|
||||
}
|
||||
|
||||
// scrivo sul PLC pezzi richiesti, cicli riscaldo + comando strobe reset se encessario!
|
||||
libraryError = ncAdapter.UpdateProdInfoData((short)requestQty, newWorkOrder, (short)numCicliRisc);
|
||||
|
||||
Reference in New Issue
Block a user