Rimozione metodo saveProdData che è sinonimo di upsertKey
- fix generic - fix fanuc - fix simula - fix FTP - fix OPC-UA CMP/Cimolai - fix Siemens (At2001, Comur, Cosma, Ingenia, Lasco, Pressoil, Saet, Simec, Robotservice)
This commit is contained in:
@@ -232,10 +232,6 @@ namespace IOB_WIN_NEXT.Iob
|
||||
{
|
||||
taskVal = $"NO MemMap found, SET task: {item.Key} --> {newVal} ({item.Value})";
|
||||
}
|
||||
// salvo in currProd..
|
||||
#if false
|
||||
saveProdData(new KeyValuePair<string, string>(item.Key, item.Value));
|
||||
#endif
|
||||
upsertKey(item.Key, item.Value);
|
||||
break;
|
||||
|
||||
@@ -312,9 +308,6 @@ namespace IOB_WIN_NEXT.Iob
|
||||
lgError("Errore in scrittura SetNumArt");
|
||||
}
|
||||
// salvo in currProd..
|
||||
#if false
|
||||
saveProdData(new KeyValuePair<string, string>(item.Key, newVal));
|
||||
#endif
|
||||
upsertKey(item.Key, item.Value);
|
||||
break;
|
||||
|
||||
@@ -371,9 +364,6 @@ namespace IOB_WIN_NEXT.Iob
|
||||
lgError("Errore in scrittura SetNumCom");
|
||||
}
|
||||
// salvo in currProd..
|
||||
#if false
|
||||
saveProdData(new KeyValuePair<string, string>(item.Key, newVal));
|
||||
#endif
|
||||
upsertKey(item.Key, item.Value);
|
||||
break;
|
||||
|
||||
@@ -386,9 +376,6 @@ namespace IOB_WIN_NEXT.Iob
|
||||
lgInfo($"Chiamata startSetup: taskOk: {taskOk} | taskVal: {taskVal}");
|
||||
|
||||
// salvo in currProd..
|
||||
#if false
|
||||
saveProdData(new KeyValuePair<string, string>(item.Key, newVal));
|
||||
#endif
|
||||
upsertKey(item.Key, item.Value);
|
||||
break;
|
||||
|
||||
|
||||
@@ -1546,7 +1546,7 @@ namespace IOB_WIN_NEXT.Iob
|
||||
taskVal = $"NO MemMap found, SET task: {item.Key} --> {item.Value}";
|
||||
}
|
||||
// salvo in currProd..
|
||||
saveProdData(new KeyValuePair<string, string>(item.Key, item.Value));
|
||||
upsertKey(item.Key, item.Value);
|
||||
|
||||
break;
|
||||
|
||||
@@ -1582,7 +1582,7 @@ namespace IOB_WIN_NEXT.Iob
|
||||
}
|
||||
|
||||
// salvo in currProd..
|
||||
saveProdData(new KeyValuePair<string, string>(item.Key, newVal));
|
||||
upsertKey(item.Key, newVal);
|
||||
break;
|
||||
|
||||
case taskType.setCommNum:
|
||||
@@ -1611,7 +1611,7 @@ namespace IOB_WIN_NEXT.Iob
|
||||
}
|
||||
|
||||
// salvo in currProd..
|
||||
saveProdData(new KeyValuePair<string, string>(item.Key, newVal));
|
||||
upsertKey(item.Key, newVal);
|
||||
break;
|
||||
|
||||
case taskType.forceResetPzCount:
|
||||
@@ -3404,16 +3404,6 @@ namespace IOB_WIN_NEXT.Iob
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Salva valori indicati in prod data
|
||||
/// </summary>
|
||||
/// <param name="item">Item KVP di cui salvare i dati in currProdData come chiave/valore</param>
|
||||
/// <returns></returns>
|
||||
public void saveProdData(KeyValuePair<string, string> item)
|
||||
{
|
||||
upsertKey(item.Key, item.Value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua salvataggio in LUT del valore ricevuto (valori numerici)
|
||||
/// </summary>
|
||||
@@ -4106,7 +4096,7 @@ namespace IOB_WIN_NEXT.Iob
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inserimento/aggiornamento chiavi/valore in currProdData
|
||||
/// Inserimento/aggiornamento chiavi/valore in currProdData + cache REDIS
|
||||
/// </summary>
|
||||
/// <param name="chiave"></param>
|
||||
/// <param name="valore"></param>
|
||||
@@ -5027,8 +5017,8 @@ namespace IOB_WIN_NEXT.Iob
|
||||
GenLogRow answ = new GenLogRow();
|
||||
if (!string.IsNullOrEmpty(dailyLog))
|
||||
{
|
||||
// preventivamente: doppio ";;" --> ";"
|
||||
dailyLog = dailyLog.Replace(";;", ";");
|
||||
// preventivamente: doppio ";" --> ";"
|
||||
dailyLog = dailyLog.Replace(";", ";");
|
||||
var sSplit = dailyLog.Split(';');
|
||||
answ.dtRif = DateTime.ParseExact($"{sSplit[0]} {sSplit[1]}", "yyyy-M-d HH:mm:ss", null);
|
||||
answ.valString = $"{sSplit[2]};{sSplit[3]}";
|
||||
|
||||
@@ -268,7 +268,7 @@ namespace IOB_WIN_NEXT.Iob
|
||||
taskVal = $"NO MemMap found, SET task: {item.Key} --> {item.Value}";
|
||||
}
|
||||
// salvo in currProd..
|
||||
saveProdData(new KeyValuePair<string, string>(item.Key, item.Value));
|
||||
upsertKey(item.Key, item.Value);
|
||||
//taskVal = processMemWriteRequests();
|
||||
break;
|
||||
|
||||
@@ -291,8 +291,10 @@ namespace IOB_WIN_NEXT.Iob
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case taskType.setArtNum:
|
||||
// in primis faccio una chiamata per tutta la tab SE fosse vuoto il dict di traduzione
|
||||
// in primis faccio una chiamata per tutta la tab SE fosse vuoto il
|
||||
// dict di traduzione
|
||||
if (DictNumArt == null || DictNumArt.Count == 0)
|
||||
{
|
||||
getNumArt("");
|
||||
@@ -329,7 +331,7 @@ namespace IOB_WIN_NEXT.Iob
|
||||
}
|
||||
|
||||
// salvo in currProd..
|
||||
saveProdData(new KeyValuePair<string, string>(item.Key, newVal));
|
||||
upsertKey(item.Key, newVal);
|
||||
break;
|
||||
|
||||
case taskType.setCommNum:
|
||||
@@ -358,7 +360,7 @@ namespace IOB_WIN_NEXT.Iob
|
||||
}
|
||||
|
||||
// salvo in currProd..
|
||||
saveProdData(new KeyValuePair<string, string>(item.Key, newVal));
|
||||
upsertKey(item.Key, newVal);
|
||||
break;
|
||||
|
||||
case taskType.nihil:
|
||||
|
||||
@@ -142,11 +142,13 @@ namespace IOB_WIN_NEXT.IobNet
|
||||
{
|
||||
case taskType.setArt:
|
||||
case taskType.setPzComm:
|
||||
// L'articolo ed il numPz li salva nei dati di produzione... SE disponibili li indicherà nel file ODL ATTIVA...
|
||||
saveProdData(new KeyValuePair<string, string>(item.Key, item.Value));
|
||||
// L'articolo ed il numPz li salva nei dati di produzione... SE disponibili
|
||||
// li indicherà nel file ODL ATTIVA...
|
||||
upsertKey(item.Key, item.Value);
|
||||
// salvo nei taskVal il valore acquisito...
|
||||
taskVal = $"Saved {item.Key} = {item.Value} on ProdData";
|
||||
break;
|
||||
|
||||
case taskType.setComm:
|
||||
/*------------------------------------------------------------------
|
||||
* La commessa è la cartella DI BASE per poter poi procedere con acquisizione dati...
|
||||
@@ -207,7 +209,7 @@ namespace IOB_WIN_NEXT.IobNet
|
||||
lgError($"Error in startSetup | fileUpload | locFile: {locFile} | remFile: {remFile}");
|
||||
}
|
||||
// salvo in currProd..
|
||||
saveProdData(new KeyValuePair<string, string>(item.Key, item.Value));
|
||||
upsertKey(item.Key, item.Value);
|
||||
break;
|
||||
|
||||
case taskType.startSetup:
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace IOB_WIN_NEXT.IobOpc
|
||||
taskVal = $"NO MemMap found, SET task: {item.Key} --> {item.Value}";
|
||||
}
|
||||
// salvo in currProd..
|
||||
saveProdData(new KeyValuePair<string, string>(item.Key, item.Value));
|
||||
upsertKey(item.Key, item.Value);
|
||||
|
||||
break;
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace IOB_WIN_NEXT.IobOpc
|
||||
taskVal = $"NO MemMap found, SET task: {item.Key} --> {item.Value}";
|
||||
}
|
||||
// salvo in currProd..
|
||||
saveProdData(new KeyValuePair<string, string>(item.Key, item.Value));
|
||||
upsertKey(item.Key, item.Value);
|
||||
|
||||
break;
|
||||
|
||||
|
||||
@@ -80,20 +80,9 @@ namespace IOB_WIN_NEXT.IobSiemens
|
||||
case taskType.setArt:
|
||||
case taskType.setComm:
|
||||
case taskType.setProg:
|
||||
#if false
|
||||
// imposto i valori...
|
||||
if (currProdData.ContainsKey(item.Key))
|
||||
{
|
||||
currProdData[item.Key] = item.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
currProdData.Add(item.Key, item.Value);
|
||||
}
|
||||
taskVal = item.Value;
|
||||
#endif
|
||||
saveProdData(item);
|
||||
|
||||
int byteSize = 0;
|
||||
upsertKey(item.Key, item.Value);
|
||||
// recupero dati da memMap... altrimenti NULLA
|
||||
if (memMap.mMapWrite.ContainsKey(item.Key))
|
||||
{
|
||||
@@ -125,24 +114,6 @@ namespace IOB_WIN_NEXT.IobSiemens
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#if false
|
||||
if (currMem.tipoMem == plcDataType.String)
|
||||
{
|
||||
saveStringOnMemBlock(ref MemBlock, item.Key, 0, byteSize);
|
||||
}
|
||||
else if (currMem.tipoMem == plcDataType.DInt)
|
||||
{
|
||||
int valDInt = 0;
|
||||
int.TryParse(item.Value, out valDInt);
|
||||
MemBlock = S7.Net.Types.DInt.ToByteArray(valDInt);
|
||||
}
|
||||
else if (currMem.tipoMem == plcDataType.Int)
|
||||
{
|
||||
short valDInt = 0;
|
||||
short.TryParse(item.Value, out valDInt);
|
||||
MemBlock = S7.Net.Types.Int.ToByteArray(valDInt);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
taskVal = item.Value;
|
||||
break;
|
||||
@@ -202,42 +173,6 @@ namespace IOB_WIN_NEXT.IobSiemens
|
||||
}
|
||||
}
|
||||
|
||||
#if false
|
||||
// controllo SE HO da scrivere articolo/commessa/programma
|
||||
saveStringOnMemBlock(ref MemBlock, "setArt", 0, 20, true);
|
||||
saveStringOnMemBlock(ref MemBlock, "setComm", 22, 20, true);
|
||||
saveStringOnMemBlock(ref MemBlock, "setProg", 44, 20, true);
|
||||
|
||||
// !!!FIXME!!! rendere parametrico
|
||||
// SE HO un valore ART scrivo...
|
||||
if (currProdData.ContainsKey("setArt"))
|
||||
{
|
||||
if (currProdData["setArt"] != "")
|
||||
{
|
||||
// imposto i valori...
|
||||
upsertKey("kgParz", "1234");
|
||||
saveIntOnMemBlock(ref MemBlock, "kgParz", 66);
|
||||
upsertKey("set_th", "601");
|
||||
saveIntOnMemBlock(ref MemBlock, "set_th", 72);
|
||||
upsertKey("set_c", "101");
|
||||
saveRealOnMemBlock(ref MemBlock, "set_c", 74);
|
||||
upsertKey("aria_1", "1801");
|
||||
saveIntOnMemBlock(ref MemBlock, "aria_1", 78);
|
||||
upsertKey("aria_2", "1851");
|
||||
saveIntOnMemBlock(ref MemBlock, "aria_2", 80);
|
||||
upsertKey("setMmH20", "9");
|
||||
saveRealOnMemBlock(ref MemBlock, "setMmH20", 82);
|
||||
upsertKey("rpmci", "101");
|
||||
saveIntOnMemBlock(ref MemBlock, "rpmci", 86);
|
||||
}
|
||||
}
|
||||
|
||||
// fare un controllo x forzare update...
|
||||
|
||||
// scrivo comunque!
|
||||
taskOk = S7WriteBB(ref MemBlock);
|
||||
#endif
|
||||
|
||||
return taskDone;
|
||||
}
|
||||
|
||||
|
||||
@@ -108,8 +108,7 @@ namespace IOB_WIN_NEXT.IobSiemens
|
||||
case taskType.setArt:
|
||||
case taskType.setComm:
|
||||
case taskType.setPzComm:
|
||||
//saveProdData(item);
|
||||
saveProdData(new KeyValuePair<string, string>(item.Key, item.Value));
|
||||
upsertKey(item.Key, item.Value);
|
||||
// recupero dati da memMap... altrimenti NULLA
|
||||
if (memMap.mMapWrite.ContainsKey(item.Key))
|
||||
{
|
||||
|
||||
@@ -89,8 +89,7 @@ namespace IOB_WIN_NEXT.IobSiemens
|
||||
case taskType.setPzComm:
|
||||
case taskType.setArt:
|
||||
case taskType.setComm:
|
||||
//saveProdData(item);
|
||||
saveProdData(new KeyValuePair<string, string>(item.Key, item.Value));
|
||||
upsertKey(item.Key, item.Value);
|
||||
int byteSize = 0;
|
||||
// recupero dati da memMap... altrimenti NULLA
|
||||
if (memMap.mMapWrite.ContainsKey(item.Key))
|
||||
|
||||
@@ -114,8 +114,7 @@ namespace IOB_WIN_NEXT.IobSiemens
|
||||
|
||||
case taskType.sendWatchDogMes2Plc:
|
||||
memAddrWrite = "DB701.DBB12";
|
||||
//saveProdData(item);
|
||||
saveProdData(new KeyValuePair<string, string>(item.Key, item.Value));
|
||||
upsertKey(item.Key, item.Value);
|
||||
MemBlock = dwordToByte(counterMes2Plc.ToString());
|
||||
taskVal = $"VALUE DB701.DBB12 --> {counterMes2Plc} ({MemBlock})";
|
||||
if (verboseLog)
|
||||
@@ -128,8 +127,7 @@ namespace IOB_WIN_NEXT.IobSiemens
|
||||
case taskType.setComm:
|
||||
case taskType.setPzComm:
|
||||
case taskType.setParameter:
|
||||
//saveProdData(item);
|
||||
saveProdData(new KeyValuePair<string, string>(item.Key, item.Value));
|
||||
upsertKey(item.Key, item.Value);
|
||||
// verifico se posso aggiornare valori in memoria...
|
||||
if (memMap != null && memMap.mMapWrite != null)
|
||||
{
|
||||
|
||||
@@ -129,8 +129,7 @@ namespace IOB_WIN_NEXT.IobSiemens
|
||||
case taskType.setComm:
|
||||
case taskType.setPzComm:
|
||||
case taskType.setProg:
|
||||
//saveProdData(item);
|
||||
saveProdData(new KeyValuePair<string, string>(item.Key, item.Value));
|
||||
upsertKey(item.Key, item.Value);
|
||||
// verifico se posso aggiornare valori in memoria...
|
||||
if (memMap != null && memMap.mMapWrite != null)
|
||||
{
|
||||
@@ -290,7 +289,7 @@ namespace IOB_WIN_NEXT.IobSiemens
|
||||
case taskType.setPzComm:
|
||||
case taskType.setProg:
|
||||
//saveProdData(item);
|
||||
saveProdData(new KeyValuePair<string, string>(item.Key, item.Value));
|
||||
upsertKey(item.Key, item.Value);
|
||||
taskVal = item.Value;
|
||||
break;
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace IOB_WIN_NEXT.IobSiemens
|
||||
case taskType.setArt:
|
||||
case taskType.setComm:
|
||||
case taskType.setPzComm:
|
||||
saveProdData(item);
|
||||
upsertKey(item.Key, item.Value);
|
||||
// verifico se posso aggiornare valori in memoria...
|
||||
if (memMap != null && memMap.mMapWrite != null)
|
||||
{
|
||||
|
||||
@@ -111,7 +111,7 @@ namespace IOB_WIN_NEXT.IobSiemens
|
||||
break;
|
||||
|
||||
case taskType.setArt:
|
||||
saveProdData(item);
|
||||
upsertKey(item.Key, item.Value);
|
||||
MemBlock = new byte[34];
|
||||
saveStringOnMemBlock(ref MemBlock, "setArt", 0, 32);
|
||||
memAddrWrite = "DB1275.DBB96";
|
||||
@@ -119,7 +119,7 @@ namespace IOB_WIN_NEXT.IobSiemens
|
||||
break;
|
||||
|
||||
case taskType.setComm:
|
||||
saveProdData(item);
|
||||
upsertKey(item.Key, item.Value);
|
||||
MemBlock = new byte[14];
|
||||
saveStringOnMemBlock(ref MemBlock, "setComm", 0, 12);
|
||||
memAddrWrite = "DB1275.DBB130";
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace IOB_WIN_NEXT.IobSiemens
|
||||
case taskType.setPzComm:
|
||||
case taskType.setArt:
|
||||
case taskType.setComm:
|
||||
saveProdData(item);
|
||||
upsertKey(item.Key, item.Value);
|
||||
int byteSize = 0;
|
||||
// verifico se posso aggiornare valori in memoria...
|
||||
if (memMap != null && memMap.mMapWrite != null)
|
||||
|
||||
Reference in New Issue
Block a user