fix primo caricamento dati (ma sovrascrive sempre tutto... salta!)
This commit is contained in:
@@ -721,6 +721,22 @@ namespace SCMA.AdapterCom
|
||||
protocollo = gwProtocol.SOURS;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fix KEY x standard redis ("_" --> ":")
|
||||
/// </summary>
|
||||
/// <param name="origKey"></param>
|
||||
/// <returns></returns>
|
||||
public string fixRedKey(string origKey)
|
||||
{
|
||||
string answ = origKey;
|
||||
try
|
||||
{
|
||||
answ = origKey.Replace("_", ":");
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Wrapper metodo Begin
|
||||
/// </summary>
|
||||
@@ -744,7 +760,7 @@ namespace SCMA.AdapterCom
|
||||
// percorro tutto l'albero nodi item ed allarmi e SCRIVO!!!!
|
||||
foreach (var item in itemNodes)
|
||||
{
|
||||
hashKey = redHash(item.Key);
|
||||
hashKey = redHash(fixRedKey(item.Key));
|
||||
hashVal = item.Value.cObject.ToString();
|
||||
setRSV(hashKey, hashVal);
|
||||
}
|
||||
@@ -782,10 +798,10 @@ namespace SCMA.AdapterCom
|
||||
#endregion
|
||||
|
||||
#region gestione nodi (dataItems, conditions)
|
||||
|
||||
|
||||
|
||||
public override void addItemNodeByType(string key, itemType tipo)
|
||||
{
|
||||
{
|
||||
if (!itemNodes.ContainsKey(key))
|
||||
{
|
||||
#if false
|
||||
@@ -809,7 +825,9 @@ namespace SCMA.AdapterCom
|
||||
currObj = new DataItem(key);
|
||||
break;
|
||||
}
|
||||
mAdapter.AddDataItem(currObj);
|
||||
mAdapter.AddDataItem(currObj);
|
||||
#endif
|
||||
string currObj = "";// availStatus.UNAVAILABLE.ToString();
|
||||
if (tipo == itemType.Condition)
|
||||
{
|
||||
addConditionNode(key, currObj);
|
||||
@@ -818,15 +836,14 @@ namespace SCMA.AdapterCom
|
||||
else
|
||||
{
|
||||
addItemNode(key, currObj);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
/// Effettua chiamata VERA su adapter MTConnect...
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
public override void addItemNode(string key, object value)
|
||||
{
|
||||
{
|
||||
if (!itemNodes.ContainsKey(key))
|
||||
{
|
||||
base.addItemNode(key, value);
|
||||
@@ -841,7 +858,7 @@ namespace SCMA.AdapterCom
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
public override void addItemNode(object value)
|
||||
{
|
||||
{
|
||||
#if false
|
||||
DataItem currObj = (DataItem)value;
|
||||
string key = value.ToString().Replace("|", "");
|
||||
@@ -879,7 +896,7 @@ namespace SCMA.AdapterCom
|
||||
/// </summary>
|
||||
/// <param name="anItem"></param>
|
||||
public override void removeItemNode(string key)
|
||||
{
|
||||
{
|
||||
#if false
|
||||
// rimuovo da MTC
|
||||
mAdapter.RemoveDataItem((DataItem)itemNodes[key].cObject);
|
||||
@@ -888,13 +905,13 @@ namespace SCMA.AdapterCom
|
||||
base.removeItemNode(key);
|
||||
}
|
||||
public override void updateItemNodeValue(string key, object value)
|
||||
{
|
||||
{
|
||||
#if false
|
||||
((DataItem)getItemNode(key)).Value = value;
|
||||
#endif
|
||||
}
|
||||
public override void updateItemNodeCodeValue(string key, string code, object value)
|
||||
{
|
||||
{
|
||||
#if false
|
||||
((Message)getItemNode(key)).Code = code;
|
||||
((Message)getItemNode(key)).Value = value;
|
||||
@@ -907,7 +924,7 @@ namespace SCMA.AdapterCom
|
||||
/// <param name="key"></param>
|
||||
/// <param name="value"></param>
|
||||
public override void addConditionNode(string key, object value)
|
||||
{
|
||||
{
|
||||
base.addConditionNode(key, value);
|
||||
#if false
|
||||
// aggiungo ad adapter
|
||||
@@ -926,7 +943,7 @@ namespace SCMA.AdapterCom
|
||||
base.removeAllConditionNodes();
|
||||
}
|
||||
public override void removeConditionNode(string key)
|
||||
{
|
||||
{
|
||||
#if false
|
||||
// rimuovo da MTC
|
||||
mAdapter.RemoveDataItem((Condition)conditionNodes[key].cObject);
|
||||
|
||||
Reference in New Issue
Block a user