Merge remote-tracking branch 'origin/Connect-UI' into Thermocamera

This commit is contained in:
Samuele E. Locatelli
2020-10-27 15:59:45 +01:00
3 changed files with 62 additions and 6 deletions
+14 -4
View File
@@ -2960,10 +2960,20 @@ namespace Thermo.Active.NC
if (libraryError.IsError())
return libraryError;
// FIXME TODO completare con altre aree conf thermoCam da recipe
// scrivo altre info della parte warmers da ricetta (resetto temperature actual, set riferimento, abilitazione canali, boolean...)
numericalControl.PLC_WTCamMode(false);
numericalControl.PLC_WTCamActiv(false);
Dictionary<int, bool> resetTCamEnab = new Dictionary<int, bool>();
Dictionary<int, double> resetTCamTemp = new Dictionary<int, double>();
foreach (var item in RecipeLiveData.ChannelTCamEnab)
{
resetTCamEnab.Add(item.Key, false);
resetTCamTemp.Add(item.Key, 0);
}
numericalControl.PLC_WWarmerChTCamEnab(resetTCamEnab);
numericalControl.PLC_WWarmerChTCamTempAct(resetTCamTemp);
numericalControl.PLC_WWarmerChTCamTempSet(resetTCamTemp);
// esce
return libraryError;
}
@@ -725,7 +725,7 @@ namespace Thermo.Active.Controllers.WebApi
newRisk.Add(item.Key, item.Value);
}
// write to PLC
// write to PLC SetPointHMI (%)
checkError = ncAdapter.WriteRecipeWarmChSetpHMI(newRisk);
if (checkError.IsError())
{
@@ -733,6 +733,52 @@ namespace Thermo.Active.Controllers.WebApi
return checkError;
}
// Disable Thermocam Mode + OnOff
checkError = ncAdapter.SetTCamMode(false);
if (checkError.IsError())
{
ThermoActiveLogger.LogError($"WriteCurrentRecipeToPlc | SetTCamMode error | {checkError.exception}");
return checkError;
}
checkError = ncAdapter.SetTCamActiv(false);
if (checkError.IsError())
{
ThermoActiveLogger.LogError($"WriteCurrentRecipeToPlc | SetTCamActiv error | {checkError.exception}");
return checkError;
}
// write to PLC TempRif (°C)
checkError = ncAdapter.WriteRecipeWarmChTCamTempSet(NcAdapter.RecipeLiveData.ChannelTCamTempReq);
if (checkError.IsError())
{
ThermoActiveLogger.LogError($"WriteCurrentRecipeToPlc | WriteRecipeWarmChTCamTempSet error | {checkError.exception}");
return checkError;
}
// write to PLC TCamChEnab
checkError = ncAdapter.WriteRecipeWarmChTCamEnab(NcAdapter.RecipeLiveData.ChannelTCamEnab);
if (checkError.IsError())
{
ThermoActiveLogger.LogError($"WriteCurrentRecipeToPlc | WriteRecipeWarmChTCamEnab error | {checkError.exception}");
return checkError;
}
// reset ActTemp
Dictionary<int, double> resetTCamTemp = new Dictionary<int, double>();
foreach (var item in NcAdapter.RecipeLiveData.ChannelTCamEnab)
{
resetTCamTemp.Add(item.Key, 0);
}
checkError = ncAdapter.WriteRecipeWarmChTCamTempAct(resetTCamTemp);
if (checkError.IsError())
{
ThermoActiveLogger.LogError($"WriteCurrentRecipeToPlc | WriteRecipeWarmChTCamTempAct error | {checkError.exception}");
return checkError;
}
// enable recipe! scrivo sul PLC il comando conferma!
libraryError = ncAdapter.ConfirmRecipeData(true);
if (libraryError.IsError())
+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.108.135")]
[assembly: AssemblyVersion("0.108.136")]