From 475e10d250ea5a1880a41fb0240aabb52a7c1c81 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 20 May 2022 09:36:26 +0200 Subject: [PATCH] =?UTF-8?q?Update=20modalit=C3=A0=20recupero=20variety?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EgwProxy.Icoel.Test/Program.cs | 11 ++++++++++- EgwProxy.Icoel/Compac/ComClient.cs | 8 ++++++++ EgwProxy.Icoel/Connector.cs | 16 ++++++++++++---- 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/EgwProxy.Icoel.Test/Program.cs b/EgwProxy.Icoel.Test/Program.cs index f815aa2d..374a0485 100644 --- a/EgwProxy.Icoel.Test/Program.cs +++ b/EgwProxy.Icoel.Test/Program.cs @@ -26,12 +26,21 @@ namespace EgwProxy.Icoel.Test try { - var varList = IcoelSizer.GetVarietyList(); + Console.WriteLine("---- TUTTE variety ----"); + var varList = IcoelSizer.GetVarietyList(false); var varietyData = IcoelSizer.GetLayoutForVarietyList(varList); if (varietyData != null) { DisplayVarietyLayout(varietyData); } + // solo attive + Console.WriteLine("---- solo attive ----"); + varList = IcoelSizer.GetVarietyList(); + varietyData = IcoelSizer.GetLayoutForVarietyList(varList); + if (varietyData != null) + { + DisplayVarietyLayout(varietyData); + } var currBatch=IcoelSizer.GetCurrentBatch(); foreach (var item in currBatch) diff --git a/EgwProxy.Icoel/Compac/ComClient.cs b/EgwProxy.Icoel/Compac/ComClient.cs index ac32c711..f4575962 100644 --- a/EgwProxy.Icoel/Compac/ComClient.cs +++ b/EgwProxy.Icoel/Compac/ComClient.cs @@ -96,6 +96,14 @@ namespace EgwProxy.Icoel.Compac { return SSClient.GetActiveVarieties(); } + /// + /// Elenco varietà (tutte) + /// + /// + internal Variety[] GetAllVarieties() + { + return SSClient.GetAllVarieties(); + } /// /// Recupera il batch corrente (se monolinea) diff --git a/EgwProxy.Icoel/Connector.cs b/EgwProxy.Icoel/Connector.cs index 9138f3a6..3c1b666c 100644 --- a/EgwProxy.Icoel/Connector.cs +++ b/EgwProxy.Icoel/Connector.cs @@ -76,10 +76,11 @@ namespace EgwProxy.Icoel } /// - /// Restituisce elenco delel Variety + /// Restituisce elenco delle Variety /// + /// Solo attive (true) o tutte (false) /// - public Variety[] GetVarietyList() + public Variety[] GetVarietyList(bool onlyActive = true) { #if false //Client = new CompacClient(Settaggi.IndirizzoIpSizer, Settaggi.SizerTcpPort); @@ -91,7 +92,14 @@ namespace EgwProxy.Icoel Variety[] varietiesList; using (var cClient = new ComClient(ipAddress, tcpPort)) { - varietiesList = Client.GetActiveVarieties(); + if (onlyActive) + { + varietiesList = cClient.GetActiveVarieties(); + } + else + { + varietiesList = cClient.GetAllVarieties(); + } } #if false Client.Close(); @@ -107,7 +115,7 @@ namespace EgwProxy.Icoel Client.VerificaEsistenzaGrower(Details.GrowerCode, Details.GrowerName); // recupero varietà x selezione - var varList = GetVarietyList(); + var varList = GetVarietyList(true); int idxVar = -1; int idxLay = -1;