Vettore conversione inversa traduzioni e altra modalità check...
This commit is contained in:
@@ -53,6 +53,10 @@ namespace OPC_UA_REDIS
|
||||
/// </summary>
|
||||
public Dictionary<string, string> nameReplaced = new Dictionary<string, string>();
|
||||
/// <summary>
|
||||
/// Dizionario di TUTTE le conversioni variabili (OPC-UA-->MTC) applicate
|
||||
/// </summary>
|
||||
public Dictionary<string, string> nameReplacedInvert = new Dictionary<string, string>();
|
||||
/// <summary>
|
||||
/// Dizionario di TUTTE le variabili ESCLUSE (filtrate)
|
||||
/// </summary>
|
||||
public Dictionary<string, string> nameExcluded = new Dictionary<string, string>();
|
||||
@@ -334,7 +338,7 @@ namespace OPC_UA_REDIS
|
||||
|
||||
// SOLO se richiesto FULL RESET...
|
||||
if (baseUtils.CRB("fullReset"))
|
||||
{
|
||||
{
|
||||
// ora il valore delle chaivi diventa unavailable...
|
||||
hashVal = availStatus.NULL.ToString();
|
||||
// percorro tutto l'albero nodi item ed allarmi e SCRIVO!!!!
|
||||
@@ -563,6 +567,16 @@ namespace OPC_UA_REDIS
|
||||
|
||||
#region helper gestione REDIS
|
||||
|
||||
public string getOrigKey(string redKey)
|
||||
{
|
||||
string answ = redKey;
|
||||
if (nameReplacedInvert.ContainsKey(redKey))
|
||||
{
|
||||
answ = nameReplacedInvert[redKey];
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fix KEY x standard redis ("_" --> ":")
|
||||
/// </summary>
|
||||
@@ -654,6 +668,8 @@ namespace OPC_UA_REDIS
|
||||
}
|
||||
// salvo in dizionario
|
||||
nameReplaced.Add(origKey, answ);
|
||||
// salvo in dizionario INVERSO
|
||||
nameReplacedInvert.Add(answ, origKey);
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
|
||||
@@ -4119,24 +4119,19 @@ namespace SCMA
|
||||
// da gestire su ogni adapter... legge tutto array STROBE!!!
|
||||
}
|
||||
/// <summary>
|
||||
/// Effettua check nome variabile direttamente o tramite decodifica key SOUR
|
||||
/// Effettua decodifica a ritroso della key SOUR
|
||||
/// </summary>
|
||||
/// <param name="varName"></param>
|
||||
/// <param name="tgtName"></param>
|
||||
/// <returns></returns>
|
||||
protected bool checkName(string varName, string tgtName)
|
||||
protected string getOrigName(string varName)
|
||||
{
|
||||
bool answ = false;
|
||||
string answ = varName;
|
||||
// se il gateway è sour DEVO FARE CONTROLLO con fix...
|
||||
if (utils.CRS("adpProto") == "SOURS")
|
||||
{
|
||||
GatewaySOURS gSour = (GatewaySOURS)currGateway;
|
||||
answ = (varName == gSour.mAdapter.fixRedKey(tgtName));
|
||||
}
|
||||
// altrimenti checkDiretto...
|
||||
else
|
||||
{
|
||||
answ = (varName == tgtName);
|
||||
answ = gSour.mAdapter.getOrigKey(varName);
|
||||
}
|
||||
// return!
|
||||
return answ;
|
||||
@@ -4159,15 +4154,15 @@ namespace SCMA
|
||||
numero = 0;
|
||||
valRead = 0;
|
||||
// decodifico...
|
||||
if (checkName(maintData[i].varName, "ACC_TIME"))
|
||||
if (getOrigName(maintData[i].varName) == "ACC_TIME")
|
||||
{
|
||||
istOreMaccOn.addValue(DateTime.Now, Convert.ToInt32(tabDatiMtz[i]));
|
||||
}
|
||||
else if (checkName(maintData[i].varName , "ACC_TIME_WORK"))
|
||||
else if (getOrigName(maintData[i].varName) == "ACC_TIME_WORK")
|
||||
{
|
||||
istOreMaccLav.addValue(DateTime.Now, Convert.ToInt32(tabDatiMtz[i]));
|
||||
}
|
||||
else if (checkName(maintData[i].varName , "SlittaTastatore_Count"))
|
||||
else if (getOrigName(maintData[i].varName) == "SlittaTastatore_Count")
|
||||
{
|
||||
istSlittaTast.addValue(DateTime.Now, Convert.ToInt32(tabDatiMtz[i]));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user