Merge branch 'release/FixChiaviVuoteOpcUa'
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# Commenti con cancelletto, struttura un variabile per riga, tipo chiave|valore (occhio che il separatore è configurato da .cofig come "charSep"); spazi e tabulazioni dovrei trimmarli in acquisizione (qui inseriti per comodità di lettura)
|
||||
# Segnali BIT per gestione richeista lettura valori
|
||||
# Segnali BIT per gestione richiesta lettura valori
|
||||
0.0|SIG_STR |BIT
|
||||
0.1|SIG_ST_COM |BIT
|
||||
0.2|SIG_END_COM |BIT
|
||||
|
||||
@@ -280,7 +280,7 @@ namespace IOB_WIN_NEXT
|
||||
connectSession.Active = connectSession.Cycle;
|
||||
connectSession.Passed = true;
|
||||
}
|
||||
// verifico SE ci sia la richeista sennò la chiedo...
|
||||
// verifico SE ci sia la richiesta sennò la chiedo...
|
||||
else if (!checkRequest(connectSession))
|
||||
{
|
||||
copyRequestFiles(connectSession, adesso);
|
||||
|
||||
@@ -653,7 +653,7 @@ namespace IOB_WIN_NEXT
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Indica il counter della key richeista attiva
|
||||
/// Indica il counter della key richiesta attiva
|
||||
/// - gestito tramite Redis
|
||||
/// - a scadenza 25h
|
||||
/// - incrementato ogni invio di auto ODL
|
||||
|
||||
+42
-41
@@ -288,7 +288,7 @@ namespace IOB_WIN_NEXT
|
||||
}
|
||||
else
|
||||
{
|
||||
lgError($"checkAndSend ERROR | MonIt: {MonIt} | NotifyValue null !!!!");
|
||||
lgError($"checkAndSend ERROR | MonIt: {MonIt.DisplayName} | NotifyValue Null!!!");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -377,11 +377,6 @@ namespace IOB_WIN_NEXT
|
||||
{
|
||||
lgInfo($"subscribedItems non trovato: {currItem}");
|
||||
}
|
||||
|
||||
//if (nodeIdNameList.ContainsKey(currItem))
|
||||
//{
|
||||
// selectedItemList.Add(currItem, nodeIdNameList[currItem]);
|
||||
//}
|
||||
}
|
||||
lgInfo($"Aggiunti {selectedItemList.Count} items!");
|
||||
}
|
||||
@@ -903,65 +898,71 @@ namespace IOB_WIN_NEXT
|
||||
/// <returns></returns>
|
||||
public string getDataItemValue(string diKey)
|
||||
{
|
||||
DateTime adesso = DateTime.Now;
|
||||
string answ = "";
|
||||
if (dataItemMem.Count == 0)
|
||||
if (string.IsNullOrEmpty(diKey))
|
||||
{
|
||||
numErroriCheck++;
|
||||
if (vetoCheckStatus < adesso)
|
||||
{
|
||||
Logging.Instance.Error($"Errore in getDataItemValue per {diKey} | dataItemMem NON contiene valori");
|
||||
// imposto veto per vetoSeconds...
|
||||
vetoCheckStatus = adesso.AddSeconds(vetoSeconds * 2);
|
||||
}
|
||||
lgError("Attenzione: richiesta chaive vuota in getDataItemValue");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!dataItemMem.ContainsKey(diKey))
|
||||
DateTime adesso = DateTime.Now;
|
||||
if (dataItemMem.Count == 0)
|
||||
{
|
||||
numErroriCheck++;
|
||||
if (vetoCheckStatus < adesso)
|
||||
{
|
||||
Logging.Instance.Error($"Errore in getDataItemValue per {diKey} | dataItemMem non contiene la chiave richeista ma altri {dataItemMem.Count} valori");
|
||||
lgError($"Errore in getDataItemValue per {diKey} | dataItemMem NON contiene valori");
|
||||
// imposto veto per vetoSeconds...
|
||||
vetoCheckStatus = adesso.AddSeconds(vetoSeconds * 2);
|
||||
}
|
||||
numErroriCheck++;
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
if (!dataItemMem.ContainsKey(diKey))
|
||||
{
|
||||
var currDataItem = dataItemMem[diKey];
|
||||
answ = currDataItem.value;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Logging.Instance.Error($"Errore in getDataItemValue per {diKey} | dataItemMem contiene {dataItemMem.Count} valori {Environment.NewLine}{exc}");
|
||||
if (dataItemMem != null)
|
||||
if (vetoCheckStatus < adesso)
|
||||
{
|
||||
Logging.Instance.Error($"dataItemMem contiene {dataItemMem.Count} valori");
|
||||
int maxNum = 5;
|
||||
foreach (var item in dataItemMem)
|
||||
lgError($"Errore in getDataItemValue per {diKey} | dataItemMem non contiene la chiave richiesta ma altri {dataItemMem.Count} valori");
|
||||
// imposto veto per vetoSeconds...
|
||||
vetoCheckStatus = adesso.AddSeconds(vetoSeconds * 2);
|
||||
}
|
||||
numErroriCheck++;
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
var currDataItem = dataItemMem[diKey];
|
||||
answ = currDataItem.value;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
lgError($"Errore in getDataItemValue per {diKey} | dataItemMem contiene {dataItemMem.Count} valori {Environment.NewLine}{exc}");
|
||||
if (dataItemMem != null)
|
||||
{
|
||||
maxNum--;
|
||||
if (maxNum < 0)
|
||||
lgError($"dataItemMem contiene {dataItemMem.Count} valori");
|
||||
int maxNum = 5;
|
||||
foreach (var item in dataItemMem)
|
||||
{
|
||||
break;
|
||||
maxNum--;
|
||||
if (maxNum < 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
lgInfo($"{item.Key} --> {item.Value.DisplayName} = {item.Value.value}");
|
||||
}
|
||||
Logging.Instance.Info($"{item.Key} --> {item.Value.DisplayName} = {item.Value.value}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// se supero soglia errori lettura --> disconnetto e resetto
|
||||
if (numErroriCheck > 100)
|
||||
{
|
||||
lgInfo($"numErroriCheck: {numErroriCheck} --> richiesta disconnessione adapter con tryDisconnect");
|
||||
|
||||
// se supero soglia errori lettura --> disconnetto e resetto
|
||||
if (numErroriCheck > 100)
|
||||
{
|
||||
Logging.Instance.Info($"numErroriCheck: {numErroriCheck} --> richiesta disconnessione adapter con tryDisconnect");
|
||||
|
||||
numErroriCheck = 0;
|
||||
tryDisconnect();
|
||||
numErroriCheck = 0;
|
||||
tryDisconnect();
|
||||
}
|
||||
}
|
||||
|
||||
return answ;
|
||||
|
||||
Reference in New Issue
Block a user