diff --git a/IOB-UT-NEXT/Enums.cs b/IOB-UT-NEXT/Enums.cs
index 5001f313..c67b0ae7 100644
--- a/IOB-UT-NEXT/Enums.cs
+++ b/IOB-UT-NEXT/Enums.cs
@@ -1,7 +1,4 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
namespace IOB_UT_NEXT
{
@@ -11,7 +8,7 @@ namespace IOB_UT_NEXT
public enum boolCheckMode
{
///
- /// AND: tutte vere -> true
+ /// AND: tutte vere -> true
///
AND = 0,
@@ -21,17 +18,6 @@ namespace IOB_UT_NEXT
OR
}
- ///
- /// Modalità gestione setup macchina
- ///
- public enum MachineSetupMode
- {
- ND=0,
-
- // Modalità Mecolpress (3 parametri IN, se variati --> porto a 1 la variabile di controllo)
- MECOLPRESS = 1
- }
-
///
/// Elenco MODI CNC
///
@@ -182,6 +168,17 @@ namespace IOB_UT_NEXT
VLF
}
+ ///
+ /// Modalità gestione setup macchina
+ ///
+ public enum MachineSetupMode
+ {
+ ND = 0,
+
+ // Modalità Mecolpress (3 parametri IN, se variati --> porto a 1 la variabile di controllo)
+ MECOLPRESS = 1
+ }
+
///
/// StFlag32: set di 32 bit (4 word) contente semaforo di variabili
///
@@ -396,7 +393,7 @@ namespace IOB_UT_NEXT
SIEMENS_APROCHIM,
///
- /// Adapter SIEMENS, interfaccia versione VIPA @2001
+ /// Adapter SIEMENS, interfaccia versione VIPA @2001
///
SIEMENS_AT2001,
@@ -510,4 +507,20 @@ namespace IOB_UT_NEXT
///
ULog
}
+
+ ///
+ /// Tipologia dato RAW da trasmettere/ricevere (derivare da MapoSdk e togliere qui)
+ ///
+ public enum rawDataType
+ {
+ ND = 0,
+ ///
+ /// Icoel: Batch info
+ ///
+ IcoelBatch,
+ ///
+ /// Icoel: Variety + layout info relative
+ ///
+ IcoelVarInfo
+ }
}
\ No newline at end of file
diff --git a/IOB-WIN-NEXT/AdapterForm.cs b/IOB-WIN-NEXT/AdapterForm.cs
index 8a643b7a..580c2479 100644
--- a/IOB-WIN-NEXT/AdapterForm.cs
+++ b/IOB-WIN-NEXT/AdapterForm.cs
@@ -1132,7 +1132,7 @@ namespace IOB_WIN_NEXT
tipoIob = tipoScelto,
optPar = optParRead,
versIOB = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(),
- codIOB = CurrIOB,
+ codIOB = fIni.ReadString("IOB", "IOB_NAME", CurrIOB),
cncIpAddr = fIni.ReadString("CNC", "IP", "::1"),
cncPort = fIni.ReadString("CNC", "PORT", "0"),
iniFileName = iniConfFile,
@@ -1280,7 +1280,7 @@ namespace IOB_WIN_NEXT
iobObj = new IobOpcUaOmronIcoel(this, IOBConf);
start.Enabled = true;
break;
-
+
case tipoAdapter.PingWatchdog:
iobObj = new IobPing(this, IOBConf);
start.Enabled = true;
diff --git a/IOB-WIN-NEXT/DATA/CONF/GIACO_ICOEL_001.ini b/IOB-WIN-NEXT/DATA/CONF/GIACO_ICOEL_001.ini
index 1e80902f..7eee9efe 100644
--- a/IOB-WIN-NEXT/DATA/CONF/GIACO_ICOEL_001.ini
+++ b/IOB-WIN-NEXT/DATA/CONF/GIACO_ICOEL_001.ini
@@ -3,6 +3,7 @@
;Centro di lavoro OpcUa
CNCTYPE=OpcUaOmronIcoel
PING_MS_TIMEOUT=500
+IOB_NAME=GIACO_ICOEL
[MACHINE]
VENDOR=ICOEL
diff --git a/IOB-WIN-NEXT/DATA/CONF/GIACO_ICOEL_002.ini b/IOB-WIN-NEXT/DATA/CONF/GIACO_ICOEL_002.ini
new file mode 100644
index 00000000..d7f61e8a
--- /dev/null
+++ b/IOB-WIN-NEXT/DATA/CONF/GIACO_ICOEL_002.ini
@@ -0,0 +1,72 @@
+;Configurazione IOB-WIN
+[IOB]
+;WebService SOAP x sizer
+CNCTYPE=IcoelSoap
+PING_MS_TIMEOUT=500
+IOB_NAME=GIACO_ICOEL
+
+[MACHINE]
+VENDOR=ICOEL
+MODEL=Impianto Ciliegie Turi
+
+[CNC]
+IP=192.168.137.50
+PORT=8001
+GETPRGNAME=false
+
+[SERVER]
+MPIP=http://192.168.1.14
+MPURL=/MP/IO
+CMDBASE=/IOB/input/
+CMDFLOG=/IOB/flog/
+CMDALIVE=/IOB
+CMDENABLED=/IOB/enabled/
+CMDADV1=?valore=
+CMDREBO=/sendReboot.aspx?idxMacchina=
+
+[MEMORY]
+ADDR_READ=DB9999.DBB0
+ADDR_WRITE=DB9999.DBB0
+SIZE_READ=0
+SIZE_WRITE=0
+;BIT0=CONN
+;BIT1=DB60.DBB1
+;BIT2=PZCOUNT.STD.DB700.DBW22
+;BIT3=DB60.DBB3
+;BIT4=DB60.DBB4
+
+
+[BLINK]
+;MAX_COUNTER_BLINK = 30
+MAX_COUNTER_BLINK = 15
+;bit0 = 0
+;bit1 = 0
+;bit2 = 1
+;bit3 = 1
+;bit4 = 1
+;bit5 = 0
+;bit6 = 0
+;bit7 = 0
+BLINK_FILT=0
+;BLINK_FILT=28
+
+[OPTPAR]
+AUTO_CHANGE_ODL=false
+CHANGE_ODL_MODE=TIME
+CHANGE_ODL_HOURS=24
+CHANGE_ODL_IDLE_MIN=5
+PZCOUNT_MODE=Icoel
+DISABLE_PZCOUNT=FALSE
+ENABLE_SEND_PZC_BLOCK=TRUE
+MIN_SEND_PZC_BLOCK=0
+MAX_SEND_PZC_BLOCK=100
+ENABLE_DYN_DATA=FALSE
+FORCE_DYN_DATA=TRUE
+ENABLE_DATA_FILTER=TRUE
+ENABLE_CLI_RESTART=TRUE
+
+; conf parametri memoria READ/WRITE
+OPC_PARAM_CONF=GIACO_ICOEL_001.json
+
+[BRANCH]
+NAME=master
\ No newline at end of file
diff --git a/IOB-WIN-NEXT/IobGeneric.cs b/IOB-WIN-NEXT/IobGeneric.cs
index 74a0030e..af7d4afd 100644
--- a/IOB-WIN-NEXT/IobGeneric.cs
+++ b/IOB-WIN-NEXT/IobGeneric.cs
@@ -3426,6 +3426,58 @@ namespace IOB_WIN_NEXT
}
}
+ ///
+ /// Accumula in coda i valori RawData logga...
+ ///
+ /// Dictionary pronto x invio
+ public void accodaRawData(Dictionary sendObj)
+ {
+ //
+
+ /*--------------------------------
+ * nuova gestione coda dictionary
+ * fixme todo da fare !!!
+ *
+ * - conterrà tanti dictionary, con key data-ora accodamento
+ * - i dati vanno poi "scodati" dal + vecchio ed inviati a MP/IO
+ * - mostra un sunto delle info da inviare
+ * - accodamento vero e proprio
+ * - verifica (opzionale) coda massima x gestire roundRobin ultimi eventi
+ * - trace della coda
+ * - counter invio??? valutare se c'è dataora e poi sono da salvare su MongoDb / Redis
+ *
+ * */
+
+#if false
+ // mostro dati variati letti...
+ displayOtherData(val);
+ // --> accodo (valore già formattato)!
+ QueueFLog.Enqueue(encodedVal);
+ // se abilitato controllo coda FLog (superiore a 0...)
+ if (maxQueueFLog > 0)
+ {
+ // se ho una coda superiore a max ammesso
+ if (QueueFLog.Count > maxQueueFLog)
+ {
+ // elimino valori iniziali fino a tornare al max ammesso...
+ while (QueueFLog.Count > maxQueueFLog)
+ {
+ string currVal = "";
+ QueueFLog.TryDequeue(out currVal);
+ lgInfo($"Eliminazione da coda FLog per superamento maxLengh: {currVal}");
+ }
+ }
+ }
+ // loggo!
+ lgTrace(string.Format("[QUEUE-FLOG] {0}", encodedVal));
+ counterFLog++;
+ if (counterFLog > 9999)
+ {
+ counterFLog = 0;
+ }
+#endif
+ }
+
///
/// Accoda (visualizzando in cima allo stack) la nuova stringa di output per area OTHER DATA
///
@@ -3833,6 +3885,7 @@ namespace IOB_WIN_NEXT
}
else if (ciclo == gatherCycle.LF)
{
+ processCustomTaskLF();
processOtherCounters();
processProgram();
// verifico se devo gestire cambio ODL in modo automatico
@@ -3920,6 +3973,13 @@ namespace IOB_WIN_NEXT
raiseRefresh(currDispData);
}
+ ///
+ /// Effettua processing CUSTOM x l'IOB corrente (ed invia ad IO)
+ /// (task svolto tipicamente ogni 5 sec se base timer 10ms, vedere app.config)
+ ///
+ public virtual void processCustomTaskLF()
+ { }
+
///
/// Recupera eventuali allarmi CNC...
///
diff --git a/IOB-WIN-NEXT/IobIcoelSoap.cs b/IOB-WIN-NEXT/IobIcoelSoap.cs
index c1709aaa..44f32af6 100644
--- a/IOB-WIN-NEXT/IobIcoelSoap.cs
+++ b/IOB-WIN-NEXT/IobIcoelSoap.cs
@@ -3,6 +3,8 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using EgwProxy.Icoel;
+using Newtonsoft.Json;
namespace IOB_WIN_NEXT
{
@@ -11,6 +13,7 @@ namespace IOB_WIN_NEXT
///
public class IobIcoelSoap : IobGeneric
{
+ protected Connector IcoelSizer { get; set; } = null!;
///
/// Costruttore dell'IOB Icoel SOAP
///
@@ -18,6 +21,84 @@ namespace IOB_WIN_NEXT
/// Configurazione IOB per avvio
public IobIcoelSoap(AdapterForm caller, IobConfiguration IOBConf) : base(caller, IOBConf)
{
+ /* --------------------------------------
+ * todo's
+ * --------------------------------------
+ * - init obj comunicazione da conf e nuget
+ * - test comunicazione
+ * - estensione IOB come OPT_PAR di OVERRIDE (x inviare dati di un unico iOB da più IOB programs)
+ * - gestione processCustomTaskLF
+ * - x lettura dei 2 batch correnti (sx/dx)
+ * - calcolo abtch in corso/chiusi da date inizio/fine
+ * - trasmettere a MP/IO risultato valutazioni
+ * - gestione executeTasks
+ * - task di invio batch configurato in coda
+ * - task di recupero info anagrafiche (grower, variety, layout,...)
+ * - contapezzi (SE ha senso con sizer oppure saltare)
+ *
+ *
+ */
+
+
+ IcoelSizer = new Connector(IOBConf.cncIpAddr, IOBConf.cncPort);
}
+
+ ///
+ /// Effettua processing CUSTOM x Icoel:
+ /// - recupera elenco batch delle 2 linee
+ /// - invia al sistema
+ ///
+ public override void processCustomTaskLF()
+ {
+ var currBatch = IcoelSizer.GetCurrentBatch();
+ if (currBatch != null)
+ {
+ // serializzo ed invio al sistema il risultato
+ string rawData = JsonConvert.SerializeObject(currBatch);
+ // invio come tipo "IcoelBatch"
+ Dictionary sendObj = new Dictionary();
+ sendObj.Add(IOB_UT_NEXT.rawDataType.IcoelBatch, rawData);
+
+ //accodo per invio...
+ accodaRawData(sendObj);
+ }
+ }
+
+ ///
+ /// recupera le variety ed i rispettivi layout e li invia al sistema MP/IO
+ ///
+ protected void refreshVarietyData()
+ {
+ ///determina se recuperare SOLO varietà attive o tutte
+ bool soloAttive = false;
+ var varList = IcoelSizer.GetVarietyList(soloAttive);
+ var varietyData = IcoelSizer.GetLayoutForVarietyList(varList);
+ }
+
+ ///
+ /// Implementazione custom esecuzione task specifici
+ ///
+ ///
+ ///
+ public override Dictionary executeTasks(Dictionary task2exe)
+ {
+ /*---------------------------------------
+ * fixme todo fare !!!
+ * gestione execute task SPECIFICI x il sizer:
+ * - recupero anagrafice variety/layout (attivi)
+ * - recupero grower
+ * - invio batch da accodare
+ * - recupero dati da sizer (OVE disponibili)
+ * - recupero batch corrente (modalità force/resync?)
+ *
+ *---------------------------------------*/
+
+
+
+
+ return base.executeTasks(task2exe);
+ }
+
+
}
}