Merge remote-tracking branch 'origin/new/ThermoCamManager' into develop

This commit is contained in:
Thermo_SIM
2021-03-09 12:07:10 +01:00
6 changed files with 102 additions and 11 deletions
+53 -7
View File
@@ -582,31 +582,31 @@ namespace Thermo.Active.NC
break;
case AxisCommand.MoveAbsolute:
doWrite = true;
biteCommand = 0;
biteCommand = 1;
break;
case AxisCommand.JogIncPlus:
doWrite = true;
biteCommand = 1;
biteCommand = 2;
break;
case AxisCommand.JogIncMinus:
doWrite = true;
biteCommand = 2;
biteCommand = 3;
break;
case AxisCommand.Align:
doWrite = true;
biteCommand = 3;
biteCommand = 4;
break;
case AxisCommand.Probe:
doWrite = true;
biteCommand = 4;
biteCommand = 5;
break;
case AxisCommand.SetSlavePosition:
doWrite = true;
biteCommand = 5;
biteCommand = 6;
break;
case AxisCommand.Reset:
doWrite = true;
biteCommand = 6;
biteCommand = 7;
break;
case AxisCommand.Num07:
break;
@@ -3480,6 +3480,52 @@ namespace Thermo.Active.NC
return NO_ERROR;
}
/// <summary>
/// Set AdvMode for AXES
/// </summary>
/// <param name="advMode">Boolean for advmode true/false</param>
/// <returns></returns>
public CmsError SetAxesAdvMode(bool advMode)
{
// solo x S7...
if (NcConfig.NcVendor == NC_VENDOR.S7NET)
{
// scrivo!
CmsError libraryError = numericalControl.PLC_WAxisGeneralControl(advMode);
if (libraryError.IsError())
return libraryError;
}
else
{
return FUNCTION_NOT_ALLOWED_ERROR;
}
return NO_ERROR;
}
/// <summary>
/// Get AdvMode for AXES
/// </summary>
/// <param name="advMode">Boolean for advmode true/false</param>
/// <returns></returns>
public CmsError GetAxesAdvMode(out bool advMode)
{
advMode = false;
// solo x S7...
if (NcConfig.NcVendor == NC_VENDOR.S7NET)
{
// scrivo!
CmsError libraryError = numericalControl.PLC_RAxisGeneralStatus(ref advMode);
if (libraryError.IsError())
return libraryError;
}
else
{
return FUNCTION_NOT_ALLOWED_ERROR;
}
return NO_ERROR;
}
public void WriteCandy(DateTime value, int machNumber)
{
long nDays;
@@ -71,7 +71,6 @@ namespace Thermo.Active.Controllers.WebApi
// recupero dati paginati
libraryError = ncAdapter.GetCycleLog(from, to, out currCycleLog);
if (libraryError.IsError())
{
ThermoActiveLogger.LogError($"GetCycleLog error | {libraryError.exception}");
@@ -81,7 +80,34 @@ namespace Thermo.Active.Controllers.WebApi
return Ok(currCycleLog);
}
[ResponseType(typeof(DTOChannelsIO))]
[ResponseType(typeof(bool))]
[Route("GetAxesAdvMode"), HttpGet]
[WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.MAINTENANCE, Action = ACTIONS.WRITE)]
public IHttpActionResult GetAxesAdvMode()
{
// Try connection
CmsError libraryError = ncAdapter.Connect();
if (libraryError.IsError())
{
ThermoActiveLogger.LogError($"NC Not connected! | ForceChAO | {libraryError.exception}");
return InternalServerError();
}
// chiamo scrittura
bool advMode = false;
libraryError = ncAdapter.GetAxesAdvMode(out advMode);
if (libraryError.IsError())
{
ThermoActiveLogger.LogError($"GetCycleLog error | {libraryError.exception}");
return BadRequest(libraryError.localizationKey);
}
// ritorno solo fatto!
return Ok(advMode);
}
[ResponseType(typeof(DTOChannelsIO))]
[Route("channels_io"), HttpGet]
public IHttpActionResult GetChannelsIO()
{
@@ -309,6 +335,25 @@ namespace Thermo.Active.Controllers.WebApi
}
}
[Route("SetAxesAdvMode"), HttpPut]
[WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.MAINTENANCE, Action = ACTIONS.WRITE)]
public IHttpActionResult SetAxesAdvMode(bool value)
{
// Try connection
CmsError libraryError = ncAdapter.Connect();
if (libraryError.IsError())
{
ThermoActiveLogger.LogError($"NC Not connected! | ForceChAO | {libraryError.exception}");
return InternalServerError();
}
// chiamo scrittura
ncAdapter.SetAxesAdvMode(value);
// ritorno solo fatto!
return Ok();
}
[Route("io_sample_fast"), HttpPut]
[WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.MAINTENANCE, Action = ACTIONS.WRITE)]
public IHttpActionResult SetFastSample(bool value)
+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.175")]
[assembly: AssemblyVersion("1.1.176")]
Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 23 KiB

File diff suppressed because one or more lines are too long
Binary file not shown.

Before

Width:  |  Height:  |  Size: 682 KiB

After

Width:  |  Height:  |  Size: 684 KiB