Decodifica conf XML (non ancora OK)

This commit is contained in:
Samuele E. Locatelli
2020-10-29 12:38:49 +01:00
parent 25eca0ef0d
commit 293c39e3dd
+14 -6
View File
@@ -141,7 +141,7 @@ namespace SOUR.Core.Services
setupMem(XmlConfigurationPath);
// ora salvo l'array delle chaivi REDIS da richiamare... compreso eventi (che leggo ed invio 1:1 scondando da REDIS)
int memSize = Properties.Count + Variables.Count + Conditions.Count + MConEvents.Count;
int memSize = Properties.Count + MConEvents.Count + Variables.Count + Conditions.Count;
allMemKeys = new RedisKey[memSize];
sentMemKeys = new RedisKey[memSize];
allMemSGrp = new int[memSize];
@@ -231,7 +231,7 @@ namespace SOUR.Core.Services
MemDataItem newItem = new MemDataItem
{
browseName = string.Format(baseNS + ":Events:" + currElement.Attributes["SymbolicName"].Value),
elType = "Event",
elType = "Variable",
dataType = currElement.Attributes["DataType"].Value,
lastVal = currElement.Attributes["Value"].Value,
currVal = currElement.Attributes["Value"].Value,
@@ -427,10 +427,18 @@ namespace SOUR.Core.Services
/// <returns></returns>
private NodeProperties getPropertyByName(ref RedisKey nomeVar)
{
// sistemo indice x cercare nell'array
string keyName = nomeVar.ToString().Replace(memLayer.man.confReadString("Module") + ":", "").Replace(":", "/");
// cerco oggetto
var currItem = _nodeNameAndBuiltInTypes[keyName];
NodeProperties currItem = null;
try
{
// sistemo indice x cercare nell'array
string keyName = $"{nomeVar}".Replace(memLayer.man.confReadString("Module") + ":", "").Replace(":", "/");
// cerco oggetto
currItem = _nodeNameAndBuiltInTypes[keyName];
}
catch (Exception exc)
{
_printer.Print($"EXC in getPropertyByName | nomeVar: {nomeVar}{Environment.NewLine}{exc}");
}
return currItem;
}