diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ff2cb6ce..27e71ab9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,7 +20,7 @@ variables: C:\Tools\nuget.exe sources Update -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"$NEXUS_PASSWD`"" } echo $hasSource - + # helper x fix version number .version-fix: &version-fix - | @@ -100,15 +100,15 @@ variables: $FileName = Split-Path $File -leaf mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File https://nexus.steamware.net/repository/utility/MAPO/$env:APP_NAME/$version/$FileName } - # mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "Resources\manifest.xml" https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/manifest.xml # mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "Resources\ChangeLog.html" https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/ChangeLog.html - # mCurl -v -u $env:NEXUS_USER:$env:NEXUS_PASSWD --upload-file bin/release/$env:APP_NAME.zip $env:NEXUS_SERVER/utility/$env:NEXUS_PATH/$version/$env:APP_NAME-$version.zip + stages: - build - deploy + - pages IOB-MAN:build: stage: build @@ -206,3 +206,14 @@ IOB-WIN-NEXT:deploy: - *nexusUpload needs: ["IOB-WIN-NEXT:build"] +pages: + script: + - docfx Icoel.Soap/docfx.json + - mv Icoel.Soap/_site public + artifacts: + paths: + - public + only: + - master + - develop + needs: ["IOB-WIN-NEXT:build"] \ No newline at end of file diff --git a/Icoel.Soap/Compac/CompacClient.cs b/Icoel.Soap/Compac/ComClient.cs similarity index 68% rename from Icoel.Soap/Compac/CompacClient.cs rename to Icoel.Soap/Compac/ComClient.cs index 86644d70..20b4ad29 100644 --- a/Icoel.Soap/Compac/CompacClient.cs +++ b/Icoel.Soap/Compac/ComClient.cs @@ -5,20 +5,21 @@ using System.ServiceModel; namespace Icoel.Soap.Compac { - public class CompacClient + public class ComClient { #region Public Constructors /// - /// Oggetto client comunicazione con sizer + /// Oggetto client comunicazione con sizer ICOEL per invio/recupero informazioni di + /// produzione (batch) /// - /// - /// - public CompacClient(string Sizerip, string port) + /// Indirizzo IP del server SIZER + /// Porta di connessione del sizer (def: 8001) + public ComClient(string sizerIp, string port) { - var url = "http://" + Sizerip + ":" + port + "/SizerService/"; + var url = "http://" + sizerIp + ":" + port + "/SizerService/"; var epa = new EndpointAddress(new Uri(url)); - Client = new SizerServiceClient("WSHttpBinding_ISizerService", epa); + SSClient = new SizerServiceClient("WSHttpBinding_ISizerService", epa); } #endregion Public Constructors @@ -33,9 +34,9 @@ namespace Icoel.Soap.Compac get { bool answ = false; - if (Client != null) + if (SSClient != null) { - answ = Client.State == CommunicationState.Opened; + answ = SSClient.State == CommunicationState.Opened; } return answ; } @@ -43,27 +44,31 @@ namespace Icoel.Soap.Compac #endregion Public Properties - #region Internal Methods + #region Public Methods /// /// Effettua chiusura del proxy di comunicazione /// - internal void Close() + public void Close() { - if (Client.State != CommunicationState.Closed) + if (SSClient.State != CommunicationState.Closed) { - Client.Close(); + SSClient.Close(); } } + #endregion Public Methods + + #region Internal Methods + /// /// Elenco dei layout attivi della varietà /// - /// + /// Guid della varietà /// internal Layout GetActiveLayout(Guid VarietyId) { - return Client.GetActiveLayout(VarietyId); + return SSClient.GetActiveLayout(VarietyId); } /// @@ -72,7 +77,7 @@ namespace Icoel.Soap.Compac /// internal Variety[] GetActiveVarieties() { - return Client.GetActiveVarieties(); + return SSClient.GetActiveVarieties(); } /// @@ -81,7 +86,7 @@ namespace Icoel.Soap.Compac /// internal Batch GetCurrentBatch() { - return Client.GetCurrentBatch(); + return SSClient.GetCurrentBatch(); } /// @@ -91,42 +96,42 @@ namespace Icoel.Soap.Compac /// internal Batch GetCurrentBatchByLane(int lineNum) { - return Client.GetCurrentBatchByLane(lineNum); + return SSClient.GetCurrentBatchByLane(lineNum); } /// /// Elenco dei layout della varietà /// - /// + /// Guid della varietà /// internal Layout[] GetLayouts(Guid VarietyId) { - return Client.GetLayouts(VarietyId); + return SSClient.GetLayouts(VarietyId); } /// /// Effettua chiamata per mettere in coda il lotto richiesto /// - /// + /// Oggetto Batch completamente popolato da accodare in richiesta internal void MettiLottoInCoda(Batch batch) { - Client.AddBatch(batch); + SSClient.AddBatch(batch); } /// /// Verifica del grower da codice/nome /// - /// - /// + /// Codice del produttore + /// Denominazione del produttore internal void VerificaEsistenzaGrower(string growerCode, string growerName) { - var grower = Client.GetGrower(growerCode); + var grower = SSClient.GetGrower(growerCode); if (grower == null) { var nuovo = new Grower() { Code = growerCode, Name = growerName }; - Client.AddGrower(nuovo); + SSClient.AddGrower(nuovo); } } @@ -137,7 +142,7 @@ namespace Icoel.Soap.Compac /// /// Client che inoltra le richieste al Sizer /// - private SizerServiceClient Client { get; set; } + private SizerServiceClient SSClient { get; set; } #endregion Private Properties } diff --git a/Icoel.Soap/Connector.cs b/Icoel.Soap/Connector.cs index 408ffed8..23279c61 100644 --- a/Icoel.Soap/Connector.cs +++ b/Icoel.Soap/Connector.cs @@ -14,7 +14,7 @@ namespace Icoel.Soap { if (Client == null || !Client.connected) { - Client = new CompacClient(Settaggi.IndirizzoIpSizer, Settaggi.SizerTcpPort); + Client = new ComClient(Settaggi.IndirizzoIpSizer, Settaggi.SizerTcpPort); } foreach (var item in varietiesList) { @@ -72,7 +72,7 @@ namespace Icoel.Soap public static void MettiLottoInCoda() { - Client = new CompacClient(Settaggi.IndirizzoIpSizer, Settaggi.SizerTcpPort); + Client = new ComClient(Settaggi.IndirizzoIpSizer, Settaggi.SizerTcpPort); Client.VerificaEsistenzaGrower(Details.GrowerCode, Details.GrowerName); @@ -111,7 +111,7 @@ namespace Icoel.Soap } if (Client == null || !Client.connected) { - Client = new CompacClient(Settaggi.IndirizzoIpSizer, Settaggi.SizerTcpPort); + Client = new ComClient(Settaggi.IndirizzoIpSizer, Settaggi.SizerTcpPort); } // recupero layout della varietà var layoutList = Client.GetLayouts(varGuid); // recupero layout x varietà @@ -145,7 +145,7 @@ namespace Icoel.Soap public static void MettiLottoInCodaDefault() { - Client = new CompacClient(Settaggi.IndirizzoIpSizer, Settaggi.SizerTcpPort); + Client = new ComClient(Settaggi.IndirizzoIpSizer, Settaggi.SizerTcpPort); Client.VerificaEsistenzaGrower(Details.GrowerCode, Details.GrowerName); @@ -159,7 +159,7 @@ namespace Icoel.Soap //Client = new CompacClient(Settaggi.IndirizzoIpSizer, Settaggi.SizerTcpPort); if (Client == null || !Client.connected) { - Client = new CompacClient(Settaggi.IndirizzoIpSizer, Settaggi.SizerTcpPort); + Client = new ComClient(Settaggi.IndirizzoIpSizer, Settaggi.SizerTcpPort); } Variety[] varietiesList; varietiesList = Client.GetActiveVarieties(); @@ -211,7 +211,7 @@ namespace Icoel.Soap public static void VerificaLottoCorrente() { - Client = new CompacClient(Settaggi.IndirizzoIpSizer, Settaggi.SizerTcpPort); + Client = new ComClient(Settaggi.IndirizzoIpSizer, Settaggi.SizerTcpPort); //Client.GetCurrentBatch(); var batch = Client.GetCurrentBatchByLane(1); @@ -227,8 +227,17 @@ namespace Icoel.Soap #region Internal Properties - internal static CompacClient Client { get; set; } + /// + /// Oggetto di connessione client + /// + internal static ComClient Client { get; set; } + /// + /// Dettaglio dei batch + /// internal static BatchDetails Details { get; set; } + /// + /// Parametri di setup + /// internal static Settaggi Settaggi { get; set; } #endregion Internal Properties diff --git a/Icoel.Soap/Icoel.Soap.csproj b/Icoel.Soap/Icoel.Soap.csproj index 0cc632c5..2ceeff4d 100644 --- a/Icoel.Soap/Icoel.Soap.csproj +++ b/Icoel.Soap/Icoel.Soap.csproj @@ -13,6 +13,8 @@ true true + + AnyCPU @@ -49,7 +51,7 @@ - + True True @@ -62,7 +64,10 @@ + + + PreserveNewest @@ -134,6 +139,10 @@ Designer + + + + diff --git a/Icoel.Soap/api/index.md b/Icoel.Soap/api/index.md new file mode 100644 index 00000000..5d4cc63d --- /dev/null +++ b/Icoel.Soap/api/index.md @@ -0,0 +1,4 @@ + +# Icoel.Soap + +Impiegare il menù laterale per navigare nel codice del progetto. \ No newline at end of file diff --git a/Icoel.Soap/articles/intro.md b/Icoel.Soap/articles/intro.md new file mode 100644 index 00000000..8d3f4fca --- /dev/null +++ b/Icoel.Soap/articles/intro.md @@ -0,0 +1,22 @@ + +# Logica di funzionamento impianto ICOEL: + +L'impianto Icoel prevede di comunicare in 3 modalità: +1. OPC-UA per dati RealTime di processo/automazione +2. SOAP API per informazioni scambiate riguardo al setup dei batch da produrre (messa in coda) ed in produzione +3. DB per dati produttivita "nrear-realtime" e tracciatura + +La presente libreria si occupa della modalità SOAP. + + +## Modalità impiego libreria + +La libreria va chiamata inizializzando un oggetto Connector, e poi invocando i suoi metodi messi a disposizione che si occupano di + - aprire canale di comunicazione + - effettuare chiamate + - chiudere canale + + +## Demo funzionamento + +Per un esempio di funzionamento si rimanda all'applicativo console Icoel.Test diff --git a/Icoel.Soap/articles/toc.md b/Icoel.Soap/articles/toc.md new file mode 100644 index 00000000..89dec33f --- /dev/null +++ b/Icoel.Soap/articles/toc.md @@ -0,0 +1 @@ +#[Introduction](intro.md) diff --git a/Icoel.Soap/docfx.json b/Icoel.Soap/docfx.json new file mode 100644 index 00000000..bacb80c9 --- /dev/null +++ b/Icoel.Soap/docfx.json @@ -0,0 +1,68 @@ +{ + "metadata": [ + { + "src": [ + { + "files": [ + "*.csproj" + ], + "cwd": ".", + "exclude": [ + "**/obj/**", + "**/bin/**", + "_site/**" + ] + } + ], + "dest": "obj/api" + } + ], + "build": { + "content": [ + { + "files": [ + "api/**.yml" + ], + "cwd": "obj" + }, + { + "files": [ + "api/*.md", + "articles/**.md", + "toc.yml", + "*.md" + ], + "exclude": [ + "obj/**", + "_site/**" + ] + } + ], + "resource": [ + { + "files": [ + "images/**" + ], + "exclude": [ + "obj/**", + "_site/**" + ] + } + ], + "overwrite": [ + { + "files": [ + "apidoc/**.md" + ], + "exclude": [ + "obj/**", + "_site/**" + ] + } + ], + "dest": "_site", + "template": [ + "default" + ] + } +} \ No newline at end of file diff --git a/Icoel.Soap/index.md b/Icoel.Soap/index.md new file mode 100644 index 00000000..806364fb --- /dev/null +++ b/Icoel.Soap/index.md @@ -0,0 +1,15 @@ + +# Icoel.Soap Library + +Documentazione relativa alla libreria di interfaccia con il Sizer di ICOEL per le operazioni di R/W dei dati di batch di produzione. + +Vedere la sezione Articles per maggiori informazioni sulle definizioni, l'impiego ed esempi. + +## Articles + +Per maggiori dettagli, definizioni e demo funzionamento si rimanda alla sezione Articles +@intro + +## Api + +Per ogni dettaglio e riferimento alla libreria si rimanda alla sezione Api Documentation \ No newline at end of file diff --git a/Icoel.Soap/toc.yml b/Icoel.Soap/toc.yml new file mode 100644 index 00000000..7eee9ffb --- /dev/null +++ b/Icoel.Soap/toc.yml @@ -0,0 +1,6 @@ + +- name: Articles + href: articles/ +- name: API Documentation + href: obj/api/ + homepage: api/index.md