diff --git a/EgwProxy.Icoel.Test/Program.cs b/EgwProxy.Icoel.Test/Program.cs
index 68936465..9f6bd3b5 100644
--- a/EgwProxy.Icoel.Test/Program.cs
+++ b/EgwProxy.Icoel.Test/Program.cs
@@ -162,7 +162,7 @@ namespace EgwProxy.Icoel.Test
///
///
///
- private static void DisplayLayout(Layout[] layoutList)
+ internal static void DisplayLayout(Layout[] layoutList)
{
foreach (var layout in layoutList)
{
@@ -187,7 +187,7 @@ namespace EgwProxy.Icoel.Test
setup.Load();
string userInput = "";
// oggetto x connessione
- Connector IcoelSizer = new Connector(setup.IndirizzoIpSizer, setup.TcpPortSizerClient);
+ Connector IcoelSizer = new Connector(setup.IndirizzoIpSizer, setup.SizerTcpPort);
// ora effettua un pò di letture/scritture
try
@@ -234,8 +234,12 @@ namespace EgwProxy.Icoel.Test
GrowerInfo GrowerData = new GrowerInfo();
IcoelSizer.EnqueueBatch(GrowerData, varGuid, layGuid);
- IcoelSizer.GetCurrentBatch();
-
+ currBatch = IcoelSizer.GetCurrentBatch();
+ foreach (var item in currBatch)
+ {
+ string lato = item.Key == 1 ? "SX" : "DX";
+ Console.WriteLine($"[{item.Key}-{lato}] Grower code: {item.Value.GrowerCode} | Layout Name: {item.Value.LayoutName} | Totalling: [{item.Value.TotallingVarietyCode}] {item.Value.TotallingVariety} | Sizing: {item.Value.SizingProfileName} | Start {item.Value.StartTime} | End {item.Value.EndTime}");
+ }
Console.WriteLine("Test completato");
Console.WriteLine("Premere un tasto x chiudere");
Console.ReadKey();
diff --git a/EgwProxy.Icoel/Connector.cs b/EgwProxy.Icoel/Connector.cs
index a9ca98ca..30bb284e 100644
--- a/EgwProxy.Icoel/Connector.cs
+++ b/EgwProxy.Icoel/Connector.cs
@@ -47,7 +47,10 @@ namespace EgwProxy.Icoel
{
using (var Client = new ComClient(ipAddress, tcpPort))
{
+ // va bene anche se vuoto! come lo torna ora...
string sizingProfile = Client.GetCurrentBatch().SizingProfileName;
+ //var rawData = Client.GetCurrentBatchByLane(1);
+ //var rawData2 = Client.GetCurrentBatchByLane(2);
Batch newBatch = CreateBatch(GrowerData, varGuid, layGuid, sizingProfile);
Client.MettiLottoInCoda(newBatch);
}
diff --git a/EgwProxy.MultiCncLib/CNC/CNC.FANUC/CNC.FANUC.vb b/EgwProxy.MultiCncLib/CNC/CNC.FANUC/CNC.FANUC.vb
index 81736c0e..c6e92a67 100644
--- a/EgwProxy.MultiCncLib/CNC/CNC.FANUC/CNC.FANUC.vb
+++ b/EgwProxy.MultiCncLib/CNC/CNC.FANUC/CNC.FANUC.vb
@@ -1078,14 +1078,80 @@ Namespace CNC
- '''
- ''' Legge o scrive le variabile Custom Macro
- '''
- ''' Se True SCRIVE, se False LEGGE
- ''' Indice di memoria
- ''' Matrice di valori da scrivere su scrittura o letti su lettura
- ''' True se andata a buon fine
- Public Overloads Function F_RW_Macro_Short(ByVal bWrite As Boolean, ByVal MacroIndex As Integer, ByRef Value() As Short) As Boolean
+ '''
+ ''' Legge una variabile macro (#)
+ '''
+ ''' Indirizzo da leggere
+ ''' Valore letto (restituito per riferimento)
+ ''' Boolean di eseguito/errore
+ Public Function F_Read_macro(ByVal nVar As Integer, ByRef dValue As Double) As Boolean
+
+ Const ONE_DATA_ONLY As Integer = 1
+
+ Const CUSTOM_MACRO_SIZE As Integer = 10
+
+ Dim ODBM As Focas1.ODBM
+ Dim MacroInfo3 As Focas1.IODBMRN3 = Nothing
+
+ Dim n_ret_code As Short
+
+ Dim sz_routine As String = "-", sz_temp As String = "", d As Double = 0.0
+
+ Try
+ If nVar >= &H8000 Then ' if var like 98xxx then use the other read routine .... ( :(( no comment )
+
+ n_ret_code = Focas1.cnc_rdmacror3(nLibHandle(1), nVar, ONE_DATA_ONLY, MacroInfo3)
+
+ If (n_ret_code = Focas1.EW_OK) Then ' no Fanuc error
+
+ dValue = MacroInfo3.mcr_val
+
+ Else
+ 'Error reading parameter :
+
+ dValue = 0.0
+ Return False
+
+ End If ' no Fanuc error
+
+ Else ' good ole boys
+
+ ' cnc_rdmacro : read custom macro variable
+
+ n_ret_code = Focas1.cnc_rdmacro(nLibHandle(1), nVar, CUSTOM_MACRO_SIZE, ODBM)
+
+ If (n_ret_code = Focas1.EW_OK) Then ' no Fanuc error
+
+ If ODBM.mcr_val = 0 And ODBM.dec_val = -1 Then ' variabile non definita
+ dValue = 0 '"Null"
+ Else
+ dValue = ODBM.mcr_val * (10 ^ -(ODBM.dec_val))
+ End If
+ Else
+ 'Error reading parameter :
+
+ dValue = 0.0
+ Return False
+ End If ' no Fanuc error
+
+ End If ' var > 8000h
+
+ Catch ex As Exception
+
+ dValue = 0.0
+ Return False
+ End Try
+
+ End Function
+
+ '''
+ ''' Legge o scrive le variabile Custom Macro
+ '''
+ ''' Se True SCRIVE, se False LEGGE
+ ''' Indice di memoria
+ ''' Matrice di valori da scrivere su scrittura o letti su lettura
+ ''' True se andata a buon fine
+ Public Overloads Function F_RW_Macro_Short(ByVal bWrite As Boolean, ByVal MacroIndex As Integer, ByRef Value() As Short) As Boolean
Dim iodbmr As Focas1.IODBMR
Dim nlength As Integer
Dim nReturn As Integer
diff --git a/EgwProxy.MultiCncLib/CNC/CNC.FANUC/_/fwlib32.vb b/EgwProxy.MultiCncLib/CNC/CNC.FANUC/_/fwlib32.vb
index 94e6d90a..5546971f 100644
--- a/EgwProxy.MultiCncLib/CNC/CNC.FANUC/_/fwlib32.vb
+++ b/EgwProxy.MultiCncLib/CNC/CNC.FANUC/_/fwlib32.vb
@@ -10949,4 +10949,21 @@ Public Class Focas1
Declare Function cnc_rdetherinfo Lib "FWLIB32.DLL" _
(ByVal FlibHndl As Integer, ByRef a As Short, ByRef b As Short) As Short
+ '
+ '-------------------------------------------------------- 28 - VI - 2019 cv ------------------------------
+ '
+
+ ' cnc_rdmacror3 :read Custom macro names(area specified)
+
+ Public Structure IODBMRN3
+ Public mcr_val As Double
+
+ Public name As String ' var name
+ End Structure
+
+
+ ' read custom macro variables:read Custom macro names(area specified)
+ Declare Function cnc_rdmacror3 Lib "FWLIB32.DLL" _
+ (ByVal FlibHndl As Integer, ByVal a As Integer, ByRef b As Integer, ByRef c As IODBMRN3) As Short
+
End Class 'Focas1
diff --git a/IOB-UT-NEXT/Enums.cs b/IOB-UT-NEXT/Enums.cs
index 5001f313..92572e53 100644
--- a/IOB-UT-NEXT/Enums.cs
+++ b/IOB-UT-NEXT/Enums.cs
@@ -1,7 +1,6 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
+using System;
namespace IOB_UT_NEXT
{
@@ -11,7 +10,7 @@ namespace IOB_UT_NEXT
public enum boolCheckMode
{
///
- /// AND: tutte vere -> true
+ /// AND: tutte vere -> true
///
AND = 0,
@@ -21,17 +20,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 +170,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
///
@@ -281,10 +280,20 @@ namespace IOB_UT_NEXT
//FILE_XYLOG,
///
- /// adapter KAWASAKI e-controller
+ /// Adapter KAWASAKI e-controller
///
KAWASAKI,
+ ///
+ /// Adapter Icoel per DB (barcode, tracciatura, produzione,...)
+ ///
+ IcoelDb,
+
+ ///
+ /// Adapter Icoel per WS SOAP (sizer)
+ ///
+ IcoelSoap,
+
///
/// Adapter non specificato
///
@@ -396,7 +405,7 @@ namespace IOB_UT_NEXT
SIEMENS_APROCHIM,
///
- /// Adapter SIEMENS, interfaccia versione VIPA @2001
+ /// Adapter SIEMENS, interfaccia versione VIPA @2001
///
SIEMENS_AT2001,
@@ -510,4 +519,25 @@ namespace IOB_UT_NEXT
///
ULog
}
+
+ ///
+ /// Tipologia dato Raw Transfer (derivare da MapoSdk e togliere qui)
+ ///
+ /// serializzazione Native
+ /// [JsonConverter(typeof(JsonStringEnumConverter))]
+ /// serializzazione Newtonsoft json
+ /// [JsonConverter(typeof(StringEnumConverter))]
+ [JsonConverter(typeof(StringEnumConverter))]
+ public enum rawTransfType
+ {
+ ND = 0,
+ ///
+ /// Icoel: Batch info
+ ///
+ IcoelBatch,
+ ///
+ /// Icoel: Variety + layout info relative
+ ///
+ IcoelVarInfo
+ }
}
\ No newline at end of file
diff --git a/IOB-UT-NEXT/IOB-UT-NEXT.csproj b/IOB-UT-NEXT/IOB-UT-NEXT.csproj
index 0f5de88d..8dbe51fe 100644
--- a/IOB-UT-NEXT/IOB-UT-NEXT.csproj
+++ b/IOB-UT-NEXT/IOB-UT-NEXT.csproj
@@ -59,8 +59,8 @@
..\packages\SharpZipLib.1.3.1\lib\net45\ICSharpCode.SharpZipLib.dll
-
- ..\packages\MapoSDK.6.14.2204.2115\lib\net40\MapoSDK.dll
+
+ ..\packages\MapoSDK.6.14.2204.2616\lib\MapoSDK.dll
..\packages\Microsoft.Bcl.AsyncInterfaces.6.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll
diff --git a/IOB-UT-NEXT/Objects.cs b/IOB-UT-NEXT/Objects.cs
index 1685b504..dbe3a6f0 100644
--- a/IOB-UT-NEXT/Objects.cs
+++ b/IOB-UT-NEXT/Objects.cs
@@ -2,7 +2,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Text;
namespace IOB_UT_NEXT
{
@@ -118,6 +117,32 @@ namespace IOB_UT_NEXT
#endregion Public Methods
}
+ ///
+ /// Classe di base per trasferimento informazioni di tipo RawTransfer FixMe Todo Fare !!!
+ /// elimnare usando SDK MAPO
+ ///
+ public class BaseRawTransf
+ {
+ #region Public Properties
+
+ ///
+ /// Data-Ora riferimento (x ordinamento fifo)
+ ///
+ public DateTime dataRif { get; set; } = DateTime.Now;
+
+ ///
+ /// Messaggio in modalità raw/stringa
+ ///
+ public object mesContent { get; set; } = null;
+
+ ///
+ /// Tipo di messaggio trasmesso
+ ///
+ public rawTransfType mesType { get; set; } = rawTransfType.ND;
+
+ #endregion Public Properties
+ }
+
///
/// Cache a tempo valori INT
///
@@ -268,8 +293,56 @@ namespace IOB_UT_NEXT
///
public int queueMsLen { get; set; } = 0;
+ ///
+ /// Lungh coda UserLog in uscita
+ ///
+ public int queueRawTransfLen { get; set; } = 0;
+
+ ///
+ /// Lungh coda UserLog in uscita
+ ///
+ public int queueUlLen { get; set; } = 0;
+
#endregion Public Properties
+ ///
+ /// Override metodo di equality
+ ///
+ ///
+ ///
+ public override bool Equals(object obj)
+ {
+ if (!(obj is IobWinStatus item))
+ return false;
+
+ if (online != item.online)
+ return false;
+ if (lastDataIn != item.lastDataIn)
+ return false;
+ if (counterIOB != item.counterIOB)
+ return false;
+ if (counterMAC != item.counterMAC)
+ return false;
+ if (queueAlLen != item.queueAlLen)
+ return false;
+ if (queueEvLen != item.queueEvLen)
+ return false;
+ if (queueFlLen != item.queueFlLen)
+ return false;
+ if (queueMsLen != item.queueMsLen)
+ return false;
+ if (queueRawTransfLen != item.queueRawTransfLen)
+ return false;
+ if (queueUlLen!= item.queueUlLen)
+ return false;
+
+ return true;
+ }
+
+ public override int GetHashCode()
+ {
+ return base.GetHashCode();
+ }
}
///
@@ -398,6 +471,97 @@ namespace IOB_UT_NEXT
///
public class sampleVect
{
+ #region Public Constructors
+
+ ///
+ /// Inizializzo l'oggetto
+ ///
+ public sampleVect()
+ {
+ // init valori default...
+ windSize = baseUtils.CRI("countWindSize") > 0 ? baseUtils.CRI("countWindSize") : 60;
+ lTime = new List();
+ lVal = new List();
+ }
+
+ #endregion Public Constructors
+
+ #region Public Properties
+
+ ///
+ /// Calcola il valore mediano...
+ ///
+ public double vcMedian
+ {
+ get
+ {
+ double answ = 0;
+ // restituisce la mediana SE valida, altrimenti null...
+ if (numElem > 2 && flWindSize > windSize)
+ {
+ try
+ {
+ // calcolo mediana!
+ //answ = Statistics.Median(lVal.ToArray());
+
+ // rif: https://blogs.msmvps.com/deborahk/linq-mean-median-and-mode/
+ var sortedNumbers = lVal.OrderBy(n => n);
+ int numCount = lVal.Count;
+ int indice50 = lVal.Count / 2;
+ if ((numCount % 2) == 0)
+ {
+ answ = ((sortedNumbers.ElementAt(indice50) + sortedNumbers.ElementAt(indice50 - 1)) / 2);
+ }
+ else
+ {
+ answ = sortedNumbers.ElementAt(indice50);
+ }
+ }
+ catch
+ { }
+ }
+ return answ;
+ }
+ }
+
+ ///
+ /// Verifica se la vc sia valida (ovvero almeno 2 valori e intervallo > window richiesta)
+ ///
+ public bool vcValid
+ {
+ get
+ {
+ return (flWindSize > windSize && numElem > 1);
+ }
+ }
+
+ #endregion Public Properties
+
+ #region Public Methods
+
+ ///
+ /// Aggiunge un valore alla serie ed eventualmente elimina i valori superflui a garantirne
+ /// una finestra temporale valida
+ ///
+ ///
+ ///
+ public void addValue(DateTime tempo, int valore)
+ {
+ lTime.Add(tempo);
+ lVal.Add(valore);
+ // verifico se siano da accorciare le serie... ovvero i 2 intervalli ENTRAMBI sono
+ // superiori al periodo minimo (in tal caso riduco..
+ while (flWindSize > windSize && slWindSize > windSize)
+ {
+ // elimino i 2 valori + vecchi
+ lTime.RemoveAt(0);
+ lVal.RemoveAt(0);
+ // ora ricontrollo...
+ }
+ }
+
+ #endregion Public Methods
+
#region Protected Fields
///
@@ -417,21 +581,6 @@ namespace IOB_UT_NEXT
#endregion Protected Fields
- #region Public Constructors
-
- ///
- /// Inizializzo l'oggetto
- ///
- public sampleVect()
- {
- // init valori default...
- windSize = baseUtils.CRI("countWindSize") > 0 ? baseUtils.CRI("countWindSize") : 60;
- lTime = new List();
- lVal = new List();
- }
-
- #endregion Public Constructors
-
#region Protected Properties
///
@@ -485,80 +634,6 @@ namespace IOB_UT_NEXT
}
#endregion Protected Properties
-
- #region Public Properties
-
- ///
- /// Calcola il valore mediano...
- ///
- public double vcMedian
- {
- get
- {
- double answ = 0;
- // restituisce la mediana SE valida, altrimenti null...
- if (numElem > 2 && flWindSize > windSize)
- {
- try
- {
- // calcolo mediana!
- //answ = Statistics.Median(lVal.ToArray());
-
- // rif: https://blogs.msmvps.com/deborahk/linq-mean-median-and-mode/
- var sortedNumbers = lVal.OrderBy(n => n);
- int numCount = lVal.Count;
- int indice50 = lVal.Count / 2;
- if ((numCount % 2) == 0)
- {
- answ = ((sortedNumbers.ElementAt(indice50) + sortedNumbers.ElementAt(indice50 - 1)) / 2);
- }
- else
- {
- answ = sortedNumbers.ElementAt(indice50);
- }
- }
- catch
- { }
- }
- return answ;
- }
- }
-
- ///
- /// Verifica se la vc sia valida (ovvero almeno 2 valori e intervallo > window richiesta)
- ///
- public bool vcValid
- {
- get
- {
- return (flWindSize > windSize && numElem > 1);
- }
- }
-
- #endregion Public Properties
-
- #region Public Methods
-
- ///
- /// Aggiunge un valore alla serie ed eventualmente elimina i valori superflui a garantirne una finestra temporale valida
- ///
- ///
- ///
- public void addValue(DateTime tempo, int valore)
- {
- lTime.Add(tempo);
- lVal.Add(valore);
- // verifico se siano da accorciare le serie... ovvero i 2 intervalli ENTRAMBI sono superiori al periodo minimo (in tal caso riduco..
- while (flWindSize > windSize && slWindSize > windSize)
- {
- // elimino i 2 valori + vecchi
- lTime.RemoveAt(0);
- lVal.RemoveAt(0);
- // ora ricontrollo...
- }
- }
-
- #endregion Public Methods
}
///
@@ -625,7 +700,7 @@ namespace IOB_UT_NEXT
///
/// Codice univoco chiamata: tipo R4 (read 4 byte), W2 (write 2 Byte)
- ///
+ ///
public string codCall;
///
diff --git a/IOB-UT-NEXT/app.config b/IOB-UT-NEXT/app.config
index 2206d0a3..1b1d33ee 100644
--- a/IOB-UT-NEXT/app.config
+++ b/IOB-UT-NEXT/app.config
@@ -1,39 +1,39 @@
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
diff --git a/IOB-UT-NEXT/packages.config b/IOB-UT-NEXT/packages.config
index ebcbf207..70e045e6 100644
--- a/IOB-UT-NEXT/packages.config
+++ b/IOB-UT-NEXT/packages.config
@@ -1,6 +1,6 @@
-
+
diff --git a/IOB-WIN-NEXT/AdapterForm.Designer.cs b/IOB-WIN-NEXT/AdapterForm.Designer.cs
index d5a4057c..a541e906 100644
--- a/IOB-WIN-NEXT/AdapterForm.Designer.cs
+++ b/IOB-WIN-NEXT/AdapterForm.Designer.cs
@@ -51,6 +51,8 @@
this.tabMes = new System.Windows.Forms.TabPage();
this.btnForceAutoOdl = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
+ this.label24 = new System.Windows.Forms.Label();
+ this.lblQueueULog = new System.Windows.Forms.Label();
this.label19 = new System.Windows.Forms.Label();
this.lblQueueAlarmLen = new System.Windows.Forms.Label();
this.label13 = new System.Windows.Forms.Label();
@@ -107,8 +109,8 @@
this.lblOutMessage3 = new System.Windows.Forms.Label();
this.lblOutMessage2 = new System.Windows.Forms.Label();
this.tabData = new System.Windows.Forms.TabControl();
- this.label24 = new System.Windows.Forms.Label();
- this.lblQueueULog = new System.Windows.Forms.Label();
+ this.label25 = new System.Windows.Forms.Label();
+ this.lblQueueRwTrLog = new System.Windows.Forms.Label();
this.statusStrip1.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.tabMes.SuspendLayout();
@@ -364,6 +366,8 @@
// panel1
//
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+ this.panel1.Controls.Add(this.label25);
+ this.panel1.Controls.Add(this.lblQueueRwTrLog);
this.panel1.Controls.Add(this.label24);
this.panel1.Controls.Add(this.lblQueueULog);
this.panel1.Controls.Add(this.label19);
@@ -384,9 +388,28 @@
this.panel1.Location = new System.Drawing.Point(4, 6);
this.panel1.Margin = new System.Windows.Forms.Padding(2);
this.panel1.Name = "panel1";
- this.panel1.Size = new System.Drawing.Size(343, 248);
+ this.panel1.Size = new System.Drawing.Size(343, 306);
this.panel1.TabIndex = 88;
//
+ // label24
+ //
+ this.label24.AutoSize = true;
+ this.label24.Location = new System.Drawing.Point(10, 236);
+ this.label24.Name = "label24";
+ this.label24.Size = new System.Drawing.Size(85, 13);
+ this.label24.TabIndex = 94;
+ this.label24.Text = "ULog Queue len";
+ //
+ // lblQueueULog
+ //
+ this.lblQueueULog.AutoSize = true;
+ this.lblQueueULog.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lblQueueULog.Location = new System.Drawing.Point(104, 236);
+ this.lblQueueULog.Name = "lblQueueULog";
+ this.lblQueueULog.Size = new System.Drawing.Size(31, 13);
+ this.lblQueueULog.TabIndex = 95;
+ this.lblQueueULog.Text = "###";
+ //
// label19
//
this.label19.AutoSize = true;
@@ -1024,24 +1047,24 @@
this.tabData.TabIndex = 71;
this.tabData.Selected += new System.Windows.Forms.TabControlEventHandler(this.TabData_Selected);
//
- // label24
+ // label25
//
- this.label24.AutoSize = true;
- this.label24.Location = new System.Drawing.Point(15, 214);
- this.label24.Name = "label24";
- this.label24.Size = new System.Drawing.Size(85, 13);
- this.label24.TabIndex = 94;
- this.label24.Text = "ULog Queue len";
+ this.label25.AutoSize = true;
+ this.label25.Location = new System.Drawing.Point(10, 213);
+ this.label25.Name = "label25";
+ this.label25.Size = new System.Drawing.Size(85, 13);
+ this.label25.TabIndex = 96;
+ this.label25.Text = "RwTr Queue len";
//
- // lblQueueULog
+ // lblQueueRwTrLog
//
- this.lblQueueULog.AutoSize = true;
- this.lblQueueULog.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.lblQueueULog.Location = new System.Drawing.Point(105, 214);
- this.lblQueueULog.Name = "lblQueueULog";
- this.lblQueueULog.Size = new System.Drawing.Size(31, 13);
- this.lblQueueULog.TabIndex = 95;
- this.lblQueueULog.Text = "###";
+ this.lblQueueRwTrLog.AutoSize = true;
+ this.lblQueueRwTrLog.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lblQueueRwTrLog.Location = new System.Drawing.Point(104, 213);
+ this.lblQueueRwTrLog.Name = "lblQueueRwTrLog";
+ this.lblQueueRwTrLog.Size = new System.Drawing.Size(31, 13);
+ this.lblQueueRwTrLog.TabIndex = 97;
+ this.lblQueueRwTrLog.Text = "###";
//
// AdapterForm
//
@@ -1168,5 +1191,7 @@
private System.Windows.Forms.TabControl tabData;
private System.Windows.Forms.Label label24;
private System.Windows.Forms.Label lblQueueULog;
+ private System.Windows.Forms.Label label25;
+ private System.Windows.Forms.Label lblQueueRwTrLog;
}
}
\ No newline at end of file
diff --git a/IOB-WIN-NEXT/AdapterForm.cs b/IOB-WIN-NEXT/AdapterForm.cs
index 8a643b7a..728abef3 100644
--- a/IOB-WIN-NEXT/AdapterForm.cs
+++ b/IOB-WIN-NEXT/AdapterForm.cs
@@ -274,6 +274,8 @@ namespace IOB_WIN_NEXT
protected int maxFlQueue { get; set; }
protected int maxMsQueue { get; set; }
+
+ protected int maxRwTrQueue { get; set; }
protected int maxUlQueue { get; set; }
@@ -284,6 +286,8 @@ namespace IOB_WIN_NEXT
protected int qFlLen { get; set; }
protected int qMsLen { get; set; }
+
+ protected int qRTrLen { get; set; }
protected int qUlLen { get; set; }
@@ -643,6 +647,31 @@ namespace IOB_WIN_NEXT
}
}
+ public int rtrQueueLen
+ {
+ set
+ {
+ qRTrLen = value;
+ lblQueueRwTrLog.Text = qRTrLen.ToString();
+ showQueueData();
+ // se supero max precedente, ed è > 10... loggo!
+ if (qRTrLen > maxRwTrQueue && qRTrLen > 10)
+ {
+ maxRwTrQueue = qRTrLen;
+ lgInfo($"[WARN] Coda RawTransf di {value} record");
+ }
+ else
+ {
+ maxRwTrQueue--;
+ maxRwTrQueue = maxRwTrQueue < qRTrLen ? qRTrLen : maxRwTrQueue;
+ }
+ }
+ get
+ {
+ return qRTrLen;
+ }
+ }
+
public int ulQueueLen
{
set
@@ -1132,7 +1161,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,
@@ -1210,6 +1239,15 @@ namespace IOB_WIN_NEXT
start.Enabled = true;
break;
+ case tipoAdapter.IcoelDb:
+ iobObj = new IobIcoelDb(this, IOBConf);
+ start.Enabled = true;
+ break;
+ case tipoAdapter.IcoelSoap:
+ iobObj = new IobIcoelSoap(this, IOBConf);
+ start.Enabled = true;
+ break;
+
case tipoAdapter.MODBUS_TCP:
iobObj = new IobModbusTCP(this, IOBConf);
start.Enabled = true;
@@ -1280,7 +1318,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;
@@ -1445,11 +1483,12 @@ namespace IOB_WIN_NEXT
private void refreshFormData()
{
// aggiorno visualizzazioni varie in form...
+ alQueueLen = iobObj.QueueAlarm.Count;
evQueueLen = iobObj.QueueIN.Count;
flQueueLen = iobObj.QueueFLog.Count;
- alQueueLen = iobObj.QueueAlarm.Count;
msQueueLen = iobObj.QueueMessages.Count;
- ulQueueLen = iobObj.QueueMessages.Count;
+ rtrQueueLen = iobObj.QueueRawTransf.Count;
+ ulQueueLen = iobObj.QueueULog.Count;
// aggiorno labels counters...
counterIob = $"pz IOB {iobObj.contapezziIOB}";
counterMac = $"pz PLC {iobObj.contapezziPLC}";
@@ -1458,10 +1497,12 @@ namespace IOB_WIN_NEXT
{
CodIob = iobObj.cIobConf.codIOB,
IobType = iobObj.cIobConf.tipoIob.ToString(),
+ queueAlLen = alQueueLen,
queueEvLen = evQueueLen,
queueFlLen = flQueueLen,
- queueAlLen = alQueueLen,
queueMsLen = msQueueLen,
+ queueRawTransfLen = rtrQueueLen,
+ queueUlLen = ulQueueLen,
counterIOB = iobObj.contapezziIOB,
counterMAC = iobObj.contapezziPLC,
lastUpdate = lastIobStatus.lastUpdate,
@@ -1469,7 +1510,7 @@ namespace IOB_WIN_NEXT
lastDataIn = iobObj.lastReadPLC
};
// se diverso SALVO!
- if (lastIobStatus.online != currIobStatus.online || lastIobStatus.lastDataIn != currIobStatus.lastDataIn || lastIobStatus.counterIOB != currIobStatus.counterIOB || lastIobStatus.counterMAC != currIobStatus.counterMAC || lastIobStatus.queueEvLen != currIobStatus.queueEvLen || lastIobStatus.queueFlLen != currIobStatus.queueFlLen || lastIobStatus.queueAlLen != currIobStatus.queueAlLen || lastIobStatus.queueMsLen != currIobStatus.queueMsLen)
+ if (!lastIobStatus.Equals(currIobStatus))
{
// aggiorno data
currIobStatus.lastUpdate = DateTime.Now;
@@ -1531,8 +1572,11 @@ namespace IOB_WIN_NEXT
{
stop.Enabled = false;
- evQueueLen = 0;
+ alQueueLen = 0;
flQueueLen = 0;
+ msQueueLen = 0;
+ rtrQueueLen = 0;
+ ulQueueLen = 0;
nLine2show = utils.CRI("numRowConsole");
}
diff --git a/IOB-WIN-NEXT/App.config b/IOB-WIN-NEXT/App.config
index caccef85..063a79cf 100644
--- a/IOB-WIN-NEXT/App.config
+++ b/IOB-WIN-NEXT/App.config
@@ -144,9 +144,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/IOB-WIN-NEXT/DATA/CONF/3025.ini b/IOB-WIN-NEXT/DATA/CONF/3025.ini
index 008d6846..59840aed 100644
--- a/IOB-WIN-NEXT/DATA/CONF/3025.ini
+++ b/IOB-WIN-NEXT/DATA/CONF/3025.ini
@@ -26,7 +26,7 @@ CMDREBO=/sendReboot.aspx?idxMacchina=
; Red: Y31.4 | Yellow: Y31.5 | Green Y31.6 | riscaldamento Y7.4 ???
;BIT0=CONN
BIT1=Y31.6
-BIT2=PZCOUNT.PAR.6711
+BIT2=STD.MACRO.10100
BIT3=Y31.4
BIT4=Y31.5
BIT5=Y7.4
@@ -59,7 +59,10 @@ BLINK_FILT=0
[OPTPAR]
;PZCOUNT_MODE=STD|BIT
-PZCOUNT_MODE=STD.PAR.6711
+;PZCOUNT_MODE=STD.PAR.6711
+;PZREQ_MODE=STD.PAR.6713
+PZCOUNT_MODE=STD.MACRO.10100
+PZREQ_MODE=STD.MACRO.10000
PZGTOT_MODE=STD.PAR.6712
PZREQ_MODE=STD.PAR.6713
;PZCAD_MODE=STD.D.6408.DW
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..16caef0b
--- /dev/null
+++ b/IOB-WIN-NEXT/DATA/CONF/GIACO_ICOEL_002.ini
@@ -0,0 +1,73 @@
+;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
+VETO_SIG_IN=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/DATA/CONF/MAIN.ini b/IOB-WIN-NEXT/DATA/CONF/MAIN.ini
index 67e800b7..cb0aa7c3 100644
--- a/IOB-WIN-NEXT/DATA/CONF/MAIN.ini
+++ b/IOB-WIN-NEXT/DATA/CONF/MAIN.ini
@@ -79,6 +79,6 @@ CLI_INST=SteamWareSim
;STARTLIST=VL25
;STARTLIST=SIMUL_03
;STARTLIST=GIACO_CEDAX_01
-STARTLIST=GIACO_ICOEL_001
+STARTLIST=GIACO_ICOEL_002
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 de03bf72..d3e66756 100644
--- a/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj
+++ b/IOB-WIN-NEXT/IOB-WIN-NEXT.csproj
@@ -87,16 +87,16 @@
..\packages\EasyModbusTCP.5.6.0\lib\net40\EasyModbus.dll
- ..\packages\EgwProxy.Icoel.3.6.2205.2012\lib\EgwProxy.Icoel.dll
+ ..\packages\EgwProxy.Icoel.3.6.2205.2018\lib\EgwProxy.Icoel.dll
- ..\packages\EgwProxy.MultiCncLib.3.6.2205.2012\lib\EgwProxy.MultiCncLib.dll
+ ..\packages\EgwProxy.MultiCncLib.3.6.2205.2319\lib\EgwProxy.MultiCncLib.dll
- ..\packages\EgwProxy.OsaiCncLib.3.6.2205.2012\lib\EgwProxy.OsaiCncLib.dll
+ ..\packages\EgwProxy.OsaiCncLib.3.6.2205.2015\lib\EgwProxy.OsaiCncLib.dll
- ..\packages\EgwProxy.OsaiCncLib.3.6.2205.2012\lib\EgwProxy.OsaiCncLib.XmlSerializers.dll
+ ..\packages\EgwProxy.OsaiCncLib.3.6.2205.2015\lib\EgwProxy.OsaiCncLib.XmlSerializers.dll
False
@@ -194,6 +194,8 @@
VersGen.cs
+
+
@@ -305,6 +307,9 @@
Always
+
+ PreserveNewest
+
Always
diff --git a/IOB-WIN-NEXT/IobFanuc.cs b/IOB-WIN-NEXT/IobFanuc.cs
index 8a171a92..c3aef2d6 100644
--- a/IOB-WIN-NEXT/IobFanuc.cs
+++ b/IOB-WIN-NEXT/IobFanuc.cs
@@ -587,6 +587,22 @@ namespace IOB_WIN_NEXT
// salvo valore
answ = outputVal.ToString();
}
+ // 2022.05.23 gestione MACRO da testare (Jetco)
+ else if (memAddr.StartsWith("MACRO."))
+ {
+ // recupero parametro...
+ int.TryParse(memAddr.Replace("MACRO.", ""), out cntAddr);
+ // processo parametro
+ stopwatch.Restart();
+ double macroVal = 0;
+ FANUC_ref.F_Read_macro(cntAddr, ref macroVal);
+ if (utils.CRB("recTime"))
+ {
+ TimingData.addResult(cIobConf.codIOB, string.Format("R{0}-MACRO", 5), stopwatch.ElapsedTicks);
+ }
+ // salvo valore
+ answ = macroVal.ToString();
+ }
// altrimenti se legge da area memoria specifica leggo da li... formto tipo STD.D.1604.DW
else
{
diff --git a/IOB-WIN-NEXT/IobGeneric.cs b/IOB-WIN-NEXT/IobGeneric.cs
index 74a0030e..743edaa8 100644
--- a/IOB-WIN-NEXT/IobGeneric.cs
+++ b/IOB-WIN-NEXT/IobGeneric.cs
@@ -386,6 +386,12 @@ namespace IOB_WIN_NEXT
///
public ConcurrentQueue QueueMessages = new ConcurrentQueue();
+ ///
+ /// Oggetto della coda degli elementi di tipo RawTransf (e non ancora trasmessi)
+ /// NB: sono salvati serializzati come stringhe
+ ///
+ public ConcurrentQueue QueueRawTransf = new ConcurrentQueue();
+
///
/// Coda valori LOG UTENTE (da non sottocampionare come samples)...
///
@@ -2083,10 +2089,11 @@ namespace IOB_WIN_NEXT
// svuoto code se richiesto
if (resetQueue)
{
+ QueueAlarm = new ConcurrentQueue();
QueueIN = new ConcurrentQueue();
QueueFLog = new ConcurrentQueue();
- QueueAlarm = new ConcurrentQueue();
QueueMessages = new ConcurrentQueue();
+ QueueRawTransf = new ConcurrentQueue();
QueueULog = new ConcurrentQueue();
}
// imposto contatori blink a zero...
@@ -3426,6 +3433,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à una lista di oggetti baseRawTransf
+ * - 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
///
@@ -3446,10 +3505,19 @@ namespace IOB_WIN_NEXT
{
// mostro dati variati letti...
displayInData(ref currDispData);
- // --> accodo (valore già formattato)!
- QueueIN.Enqueue(qEncodeIN);
- // loggo!
- lgTrace(string.Format("[QUEUE-IN] {0}", qEncodeIN));
+ // verifico veto a invio status macchina
+ string keyName = "VETO_SIG_IN";
+ if (getOptPar(keyName).ToUpper() == "TRUE")
+ {
+ lgTrace($"Filtrato accodamento valore da conf IOB | {keyName} | [QUEUE-IN] {qEncodeIN}");
+ }
+ else
+ {
+ // --> accodo (valore già formattato)!
+ QueueIN.Enqueue(qEncodeIN);
+ // loggo!
+ lgTrace(string.Format("[QUEUE-IN] {0}", qEncodeIN));
+ }
// aggiorno counters ed eventuale reset
nReadFilt++;
if (nReadFilt > int.MaxValue - 1)
@@ -3833,6 +3901,7 @@ namespace IOB_WIN_NEXT
}
else if (ciclo == gatherCycle.LF)
{
+ processCustomTaskLF();
processOtherCounters();
processProgram();
// verifico se devo gestire cambio ODL in modo automatico
@@ -3920,6 +3989,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/IobIcoelDb.cs b/IOB-WIN-NEXT/IobIcoelDb.cs
new file mode 100644
index 00000000..f7c969b2
--- /dev/null
+++ b/IOB-WIN-NEXT/IobIcoelDb.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace IOB_WIN_NEXT
+{ ///
+ /// Adapter specializzato per ICOEL e le chiamate tramite DB per i dati
+ /// - accettazione lotti prodotto (frontiera / entrata ciliegie)
+ /// - export (totale per prodotti)
+ /// - tracciabilità (confezioni
+ ///
+
+ public class IobIcoelDb : IobGeneric
+ {
+ ///
+ /// Costruttore dell'IOB Icoel DB
+ ///
+ /// AdapterForm chiamante
+ /// Configurazione IOB per avvio
+ public IobIcoelDb(AdapterForm caller, IobConfiguration IOBConf) : base(caller, IOBConf)
+ {
+ }
+
+ public override Dictionary executeTasks(Dictionary task2exe)
+ {
+ return base.executeTasks(task2exe);
+ }
+ }
+}
diff --git a/IOB-WIN-NEXT/IobIcoelSoap.cs b/IOB-WIN-NEXT/IobIcoelSoap.cs
new file mode 100644
index 00000000..d14ae42e
--- /dev/null
+++ b/IOB-WIN-NEXT/IobIcoelSoap.cs
@@ -0,0 +1,242 @@
+using EgwProxy.Icoel;
+using EgwProxy.Icoel.SizerService;
+using IOB_UT_NEXT;
+using MapoSDK;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Net.NetworkInformation;
+
+namespace IOB_WIN_NEXT
+{
+ ///
+ /// Adapter specializzato per ICOEL e le chiamate tramite WS Soap al Sizer, con libreria EgwProxy.Icoel
+ ///
+ public class IobIcoelSoap : IobGeneric
+ {
+ #region Public Constructors
+
+ ///
+ /// Costruttore dell'IOB Icoel SOAP
+ ///
+ /// AdapterForm chiamante
+ /// 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 batch 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 lettura semafori principale
+ /// Parametri da aggiornare x display in form
+ ///
+ public override void readSemafori(ref newDisplayData currDispData)
+ {
+ if (connectionOk)
+ {
+ B_input = 1;
+ currDispData.semIn = Semaforo.SV;
+ if (currBatchList != null)
+ {
+ // se ho batch NON chiusi (data = minValue) allora lavora
+ if (currBatchList[1].EndTime == DateTime.MinValue || currBatchList[1].EndTime == DateTime.MinValue)
+ {
+ B_input = 3;
+ }
+ }
+ }
+ else
+ {
+ B_input = 0;
+ currDispData.semIn = Semaforo.SR;
+ }
+ }
+
+ #endregion Public Constructors
+
+ #region Public Methods
+
+ ///
+ /// 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);
+ }
+
+ ///
+ /// Effettua processing CUSTOM x Icoel:
+ /// - recupera elenco batch delle 2 linee
+ /// - invia al sistema
+ ///
+ public override void processCustomTaskLF()
+ {
+ lgInfo($"Richiesto processCustomTaskLF");
+ var currBatch = IcoelSizer.GetCurrentBatch();
+ if (currBatch != null)
+ {
+ // verifico se i batch siano variati... e quindi da inviare...
+ bool doSend = (currBatchList == null || currBatchList.Count == 0);
+ if (currBatch.Count > 0 && !doSend)
+ {
+ foreach (var item in currBatch)
+ {
+ // se variato ID è cambiato
+ doSend = (currBatchList[item.Key].Id != item.Value.Id);
+ }
+ }
+ // se devo inviare impacchetto dati
+ if (doSend)
+ {
+ // 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.rawTransfType.IcoelBatch, rawData);
+
+ // accodo per invio...
+ accodaRawData(sendObj);
+ currBatchList = currBatch;
+ }
+ }
+ }
+
+ ///
+ /// Override connessione
+ ///
+ public override void tryConnect()
+ {
+ if (!connectionOk)
+ {
+ // controllo che il ping sia stato tentato almeno pingTestSec fa...
+ if (DateTime.Now.Subtract(lastPING).TotalSeconds > utils.CRI("pingTestSec"))
+ {
+ if (verboseLog || periodicLog)
+ {
+ lgInfo("IcoelSoap: ConnKO - tryConnect");
+ }
+ // in primis salvo data ping...
+ lastPING = DateTime.Now;
+ // se passa il ping faccio il resto...
+ if (testPingMachine == IPStatus.Success)
+ {
+ string szStatusConnection = "";
+ try
+ {
+ // ora provo connessione...
+ parentForm.commPlcActive = true;
+ // recupero elenco batch... se != vuoto -_> connesso!
+ var batchList = IcoelSizer.GetCurrentBatch();
+ if (batchList != null && batchList.Count > 0)
+ {
+ lgInfo($"szStatusConnection IcoelSoap, recuperato elenco di {batchList.Count} batch");
+ parentForm.commPlcActive = false;
+ connectionOk = true;
+ }
+ // refresh stato connessione!!!
+ if (connectionOk)
+ {
+ if (adpRunning)
+ {
+ lgInfo("Connessione OK");
+ }
+ }
+ else
+ {
+ lgError("Impossibile procedere, connessione mancante...");
+ }
+ }
+ catch (Exception exc)
+ {
+ lgFatal($"Errore nella connessione all'adapter IcoelSoap: {szStatusConnection}{Environment.NewLine}{exc}");
+ connectionOk = false;
+ lgInfo($"Eccezione in TryConnect, Adapter IcoelSoap NON running, pausa di {utils.CRI("waitRecMSec")} msec prima di ulteriori tentativi di riconnessione");
+ }
+ }
+ else
+ {
+ // loggo no risposta ping ...
+ connectionOk = false;
+ if (verboseLog || periodicLog)
+ {
+ lgInfo($"Attenzione: IcoelSoap controllo PING fallito per IP {cIobConf.cncIpAddr}");
+ }
+ }
+ }
+ }
+ else
+ {
+ needRefresh = true;
+ }
+ }
+
+ public override void tryDisconnect()
+ {
+ // registro solo che è disconnesso
+ connectionOk = false;
+ }
+
+ #endregion Public Methods
+
+ #region Protected Properties
+
+ ///
+ /// elenco dei BAtch correntemente caricati x testing variazione
+ ///
+ protected Dictionary currBatchList { get; set; }
+
+ protected Connector IcoelSizer { get; set; }
+
+ #endregion Protected Properties
+
+ #region Protected Methods
+
+ ///
+ /// 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);
+ if (varList != null && varList.Length > 0)
+ {
+ var varietyData = IcoelSizer.GetLayoutForVarietyList(varList);
+ // invio dai al server IO
+
+ }
+
+ }
+
+ #endregion Protected Methods
+ }
+}
\ No newline at end of file
diff --git a/IOB-WIN-NEXT/IobOpcUa.cs b/IOB-WIN-NEXT/IobOpcUa.cs
index bb08b5f8..e3049e89 100644
--- a/IOB-WIN-NEXT/IobOpcUa.cs
+++ b/IOB-WIN-NEXT/IobOpcUa.cs
@@ -164,8 +164,8 @@ namespace IOB_WIN_NEXT
}
///
- /// Effettua lettura semafori principale Parametri da
- /// aggiornare x display in form
+ /// Effettua lettura semafori principale
+ /// Parametri da aggiornare x display in form
///
public override void readSemafori(ref newDisplayData currDispData)
{
diff --git a/IOB-WIN-NEXT/IobOpcUaOmronIcoel.cs b/IOB-WIN-NEXT/IobOpcUaOmronIcoel.cs
index b5ef7978..91803e95 100644
--- a/IOB-WIN-NEXT/IobOpcUaOmronIcoel.cs
+++ b/IOB-WIN-NEXT/IobOpcUaOmronIcoel.cs
@@ -460,7 +460,7 @@ namespace IOB_WIN_NEXT
}
///
- /// effettua verifica del datablock icoel invianod eventualmente i dati variati
+ /// effettua verifica del datablock icoel inviando eventualmente i dati variati
///
///
///
diff --git a/IOB-WIN-NEXT/packages.config b/IOB-WIN-NEXT/packages.config
index 7f91f314..37b775c1 100644
--- a/IOB-WIN-NEXT/packages.config
+++ b/IOB-WIN-NEXT/packages.config
@@ -2,9 +2,9 @@
-
-
-
+
+
+