Fix Filesystem IO 4 recipe

This commit is contained in:
Samuele Locatelli
2020-06-08 21:22:14 +02:00
parent 04f9a8155e
commit 0cfbbe069a
2 changed files with 9 additions and 22 deletions
@@ -185,7 +185,7 @@
<ItemGroup />
<ItemGroup>
<Content Include="Config\Recipes\template.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="packages.config" />
</ItemGroup>
@@ -211,11 +211,6 @@ namespace Thermo.Active.Controllers.WebApi
{
using (NcFileAdapter ncAdapter = new NcFileAdapter())
{
// Try connection
CmsError libraryError = ncAdapter.Connect();
if (libraryError.errorCode != 0)
return NotFound();
// chiamo metodo di lettura...
bool fatto = ServerConfigController.LoadTemplate();
@@ -226,9 +221,9 @@ namespace Thermo.Active.Controllers.WebApi
if (cmsError.IsError())
return BadRequest(cmsError.localizationKey);
// ritorno solo fatto!
return Ok();
}
// ritorno solo fatto!
return Ok();
}
/// <summary>
@@ -240,10 +235,6 @@ namespace Thermo.Active.Controllers.WebApi
{
using (NcFileAdapter ncAdapter = new NcFileAdapter())
{
// Try connection
CmsError libraryError = ncAdapter.Connect();
if (libraryError.errorCode != 0)
return NotFound();
// recupero i dati LIVE dei parametri HMI della ricetta...
CmsError cmsError = ncAdapter.ReadFullRecipe(out Dictionary<string, DTORecipeParam> currRecipe);
@@ -272,11 +263,6 @@ namespace Thermo.Active.Controllers.WebApi
{
using (NcFileAdapter ncAdapter = new NcFileAdapter())
{
// Try connection
CmsError libraryError = ncAdapter.Connect();
if (libraryError.errorCode != 0)
return NotFound();
// recupero i dati LIVE dei parametri HMI della ricetta...
CmsError cmsError = ncAdapter.ReadFullRecipe(out Dictionary<string, DTORecipeParam> currRecipe);
if (cmsError.IsError())
@@ -306,11 +292,6 @@ namespace Thermo.Active.Controllers.WebApi
{
using (NcFileAdapter ncAdapter = new NcFileAdapter())
{
// Try connection
CmsError libraryError = ncAdapter.Connect();
if (libraryError.errorCode != 0)
return NotFound();
// recupero i dati LIVE dei parametri HMI della ricetta...
CmsError cmsError = ncAdapter.ReadFullRecipe(out Dictionary<string, DTORecipeParam> currRecipe);
if (cmsError.IsError())
@@ -368,6 +349,12 @@ namespace Thermo.Active.Controllers.WebApi
using (NcAdapter ncAdapter = new NcAdapter())
{
// Try connection
CmsError libraryError = ncAdapter.Connect();
if (libraryError.errorCode != 0)
return libraryError;
// copy data to PLC
checkError = ncAdapter.ReadFullRecipe(out Dictionary<string, DTORecipeParam> prevRecipe);
if (checkError.IsError())