refresh methods signal-r & dobug S7Net
This commit is contained in:
@@ -113,14 +113,39 @@ namespace Thermo.Active.Controllers.WebApi
|
||||
SubCategory_1 = x.SubCategory_1,
|
||||
SubCategory_2 = x.SubCategory_2,
|
||||
Name = x.Name,
|
||||
Description=x.Description,
|
||||
Format=x.Format,
|
||||
Label= $"{x.Category}_{x.SubCategory_1}_{x.SubCategory_2}_{x.Name}".Replace("__", "_").Replace("__", "_").ToLower()
|
||||
Description = x.Description,
|
||||
Format = x.Format,
|
||||
Label = $"{x.Category}_{x.SubCategory_1}_{x.SubCategory_2}_{x.Name}".Replace("__", "_").Replace("__", "_").ToLower()
|
||||
}).ToList();
|
||||
|
||||
return Ok(recipeConfig);
|
||||
}
|
||||
|
||||
#if false
|
||||
[Route("ThermoParams"), HttpGet]
|
||||
public IHttpActionResult GetThermoParamsConfig()
|
||||
{
|
||||
// TODO FIXME
|
||||
|
||||
// passa i parametri di configurazione es min/max dei gauge...
|
||||
|
||||
|
||||
List<DTORecipeConfigModel> recipeConfig = RecipeConfig.Select(x => new DTORecipeConfigModel()
|
||||
{
|
||||
Id = x.Id,
|
||||
Category = x.Category.ToString(),
|
||||
SubCategory_1 = x.SubCategory_1,
|
||||
SubCategory_2 = x.SubCategory_2,
|
||||
Name = x.Name,
|
||||
Description = x.Description,
|
||||
Format = x.Format,
|
||||
Label = $"{x.Category}_{x.SubCategory_1}_{x.SubCategory_2}_{x.Name}".Replace("__", "_").Replace("__", "_").ToLower()
|
||||
}).ToList();
|
||||
|
||||
return Ok(recipeConfig);
|
||||
}
|
||||
#endif
|
||||
|
||||
[Route("alarms"), HttpGet]
|
||||
public IHttpActionResult GetAlarmsConfig()
|
||||
{
|
||||
|
||||
@@ -260,21 +260,42 @@ namespace Thermo.Active.Listeners.SignalR
|
||||
Dictionary<string, DTORecipeParam> diffData = new Dictionary<string, DTORecipeParam>();
|
||||
|
||||
// calcola ed invia SOLO le differenze...
|
||||
Parallel.ForEach(currRecipeFull, item =>
|
||||
if (false)
|
||||
{
|
||||
if (!LastRecipeFullData.ContainsKey(item.Key))
|
||||
Parallel.ForEach(currRecipeFull, item =>
|
||||
{
|
||||
diffData.Add(item.Key, item.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
// comparazione
|
||||
if (!item.Value.Equals(LastRecipeFullData[item.Key]))
|
||||
if (!LastRecipeFullData.ContainsKey(item.Key))
|
||||
{
|
||||
diffData.Add(item.Key, item.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
// comparazione
|
||||
if (!item.Value.Equals(LastRecipeFullData[item.Key]))
|
||||
{
|
||||
diffData[item.Key] = item.Value;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var item in currRecipeFull)
|
||||
{
|
||||
if (!LastRecipeFullData.ContainsKey(item.Key))
|
||||
{
|
||||
diffData.Add(item.Key, item.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
// comparazione
|
||||
if (!item.Value.Equals(LastRecipeFullData[item.Key]))
|
||||
{
|
||||
diffData[item.Key] = item.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (diffData.Count > 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user