diff --git a/IOB-WIN-NEXT/DATA/CONF/IMI_GOMBA.json b/IOB-WIN-NEXT/DATA/CONF/IMI_GOMBA.json
index d3065b70..668e5a18 100644
--- a/IOB-WIN-NEXT/DATA/CONF/IMI_GOMBA.json
+++ b/IOB-WIN-NEXT/DATA/CONF/IMI_GOMBA.json
@@ -1,23 +1,14 @@
{
"mMapWrite": {
- "reqIN": {
- "name": "reqIN",
- "description": "Registra Peso IN",
+ "reqPesata": {
+ "name": "reqPesata",
+ "description": "Registra Peso IN/OUT",
"memAddr": "000",
"tipoMem": "String",
"index": 0,
"size": 1,
"displOrdinal": 5
- },
- "reqOUT": {
- "name": "reqOUT",
- "description": "Registra Peso OUT",
- "memAddr": "000",
- "tipoMem": "String",
- "index": 0,
- "size": 1,
- "displOrdinal": 6
- },
+ },
"RM": {
"name": "RM",
"description": "Codice Pesata",
@@ -83,6 +74,15 @@
}
},
"mMapRead": {
+ "logReq": {
+ "name": "logReq",
+ "description": "Esito Comando Pesata",
+ "memAddr": "000",
+ "tipoMem": "String",
+ "index": 0,
+ "size": 1,
+ "displOrdinal": 6
+ },
"lastWeightIn": {
"name": "lastWeightIn",
"description": "Ultima Pesata IN (kg)",
diff --git a/IOB-WIN-NEXT/DATA/CONF/MAIN.ini b/IOB-WIN-NEXT/DATA/CONF/MAIN.ini
index 419b72e8..24c869da 100644
--- a/IOB-WIN-NEXT/DATA/CONF/MAIN.ini
+++ b/IOB-WIN-NEXT/DATA/CONF/MAIN.ini
@@ -59,6 +59,6 @@ CLI_INST=SteamWareSim
;STARTLIST=SIMUL_02
;NB: mettere copy always ai file di conf x fare test...
-STARTLIST=SIMUL_01
+STARTLIST=IMI_GOMBA
MAXCNC=10
\ No newline at end of file
diff --git a/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj b/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj
index 16546474..384d2f35 100644
--- a/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj
+++ b/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj
@@ -489,10 +489,14 @@
-
+
+ Always
+
-
+
+ Always
+
diff --git a/IOB-WIN-NEXT/Iob/Generic.cs b/IOB-WIN-NEXT/Iob/Generic.cs
index 298e3eef..afa8f992 100644
--- a/IOB-WIN-NEXT/Iob/Generic.cs
+++ b/IOB-WIN-NEXT/Iob/Generic.cs
@@ -6106,7 +6106,7 @@ namespace IOB_WIN_NEXT.Iob
if (trovato == null)
{
currValore = "";
- //se ho valori current li impiego...
+ // se ho valori current li impiego...
if (currProdData.ContainsKey(item.Value.name))
{
currValore = currProdData[item.Value.name];
diff --git a/IOB-WIN-NEXT/IobSoap/Gomba.cs b/IOB-WIN-NEXT/IobSoap/Gomba.cs
index 0ff70286..d7a8a435 100644
--- a/IOB-WIN-NEXT/IobSoap/Gomba.cs
+++ b/IOB-WIN-NEXT/IobSoap/Gomba.cs
@@ -114,11 +114,6 @@ namespace IOB_WIN_NEXT.IobSoap
{
// valore non presente in vers default... se gestito fare override
Dictionary outVal = new Dictionary();
-
- // FIXME TODO FARE !!!
- // recuperare elenco pesate e inserire in param list elenco nuove pesate (eventualmente ripetendo ultima?)
- // usare redis x salvare ultima pesata registrata in locale...
-
Stopwatch sw = new Stopwatch();
sw.Start();
// test lettura elenco pesate... se NON nullo --> OK!
@@ -128,7 +123,7 @@ namespace IOB_WIN_NEXT.IobSoap
sw.Stop();
lgInfo($"getDynData | SOAP: effettuata chiamata reqWeightList in {sw.Elapsed.TotalMilliseconds}ms | {dataFrom} --> {dataTo} | {listPesateCurr.Count} rec");
- // verifico se siano pesate nuove o meno...
+ // verifico se ci siano pesate nuove o meno...
if (listPesateCurr.Count != listPesateArch.Count)
{
// elenco indici
@@ -172,10 +167,22 @@ namespace IOB_WIN_NEXT.IobSoap
listPesateArch = tmpPesate;
}
}
+
+ // processo comunque le aree memoria READ...
+ if (memMap.mMapRead.Count > 0)
+ {
+ foreach (var item in memMap.mMapRead)
+ {
+ var currVal = getCurrProdData(item.Key, "");
+ outVal.Add(item.Key, $"{currVal}");
+ }
+ }
+
lastReadPLC = DateTime.Now;
return outVal;
}
+
///
/// Effettua lettura semafori principale Parametri da
/// aggiornare x display in form
@@ -187,10 +194,7 @@ namespace IOB_WIN_NEXT.IobSoap
B_input = 1;
currDispData.semIn = Semaforo.SV;
- // refresh pesate...
-
// se ho pesate in memoria nel periodo richiesto --> RUN
-
if (listPesateCurr != null && listPesateCurr.Count > 0)
{
B_input += (1 << 1);
@@ -334,6 +338,7 @@ namespace IOB_WIN_NEXT.IobSoap
protected override void plcWriteParams(ref List updatedPar)
{
lgTrace($"plcWriteParams: richiesta per {updatedPar.Count} params");
+ List extraPar = new List();
foreach (var item in updatedPar)
{
lgInfo($"ITEM | {item.uid} | {item.value}");
@@ -341,17 +346,14 @@ namespace IOB_WIN_NEXT.IobSoap
upsertKey(item.uid, item.value);
bool fatto = false;
bool isPesata = false;
+ bool isIN = false;
gestWeightOut answ = new gestWeightOut();
// se è richiesta pesata IN/OUT --> mando chiamata
- if (item.uid == "reqIN")
+ if (item.uid == "reqPesata")
{
isPesata = true;
- answ = reqWeight(true);
- }
- else if (item.uid == "reqOUT")
- {
- isPesata = true;
- answ = reqWeight(false);
+ isIN = item.value.ToUpper() == "IN";
+ answ = reqWeight(isIN);
}
else if (item.uid == "RM" || item.uid.StartsWith("Cod"))
{
@@ -365,19 +367,33 @@ namespace IOB_WIN_NEXT.IobSoap
// se è OK
if (answ.feedback == "C")
{
- item.value = $"{answ.feedback} | {answ.notes}";
- item.reqValue = "";
- item.lastRead = DateTime.Now;
- item.UM = "";
string recPesata = formatPesata(answ, item.uid == "reqIN");
lgInfo($"reqWeight | OK effettuato pesata | {recPesata}");
+ // aggiorno dati pesate IN/OUT...
+ if(isIN)
+ {
+ upsertKey("lastWeightIn", answ.weightIn);
+ upsertKey("lastRecIn", recPesata);
+ }
+ else
+ {
+ upsertKey("lastWeightOut", answ.weightOut);
+ upsertKey("lastRecOut", recPesata);
+ }
}
else
{
- item.value = $"{answ.feedback} | {answ.notes}";
- item.reqValue = "";
lgError($"reqWeight | Errore in richiesta peso GOMBA | {answ.feedback} | {answ.notes}");
}
+ item.value = "";
+ //item.value = $"{answ.feedback} | {answ.notes}";
+ item.reqValue = "";
+ item.lastRead = DateTime.Now;
+ item.UM = "";
+ // salvo esito richiesta comunque
+ upsertKey("logReq", $"{answ.feedback} | {answ.notes}");
+ // faccio in modo di eseguire subito getDynData
+ demFactDynData = 1;
}
else
{