diff --git a/IOB-WIN-NEXT/IobNet/Ftp.cs b/IOB-WIN-NEXT/IobNet/Ftp.cs index 70fad6f5..26c89a54 100644 --- a/IOB-WIN-NEXT/IobNet/Ftp.cs +++ b/IOB-WIN-NEXT/IobNet/Ftp.cs @@ -13,6 +13,7 @@ using System.Linq; using System.Net.NetworkInformation; using System.Text; using System.Threading.Tasks; +using System.Xml.Linq; using static System.Windows.Forms.VisualStyles.VisualStyleElement; namespace IOB_WIN_NEXT.IobNet @@ -93,6 +94,44 @@ namespace IOB_WIN_NEXT.IobNet } } } + // simulo setup mappa memoria in scrittura... + memMap = new plcMemMapExt(); + // area READ + Dictionary ftpMemRead = new Dictionary(); + ftpMemRead.Add("FtpSync", new dataConfTSVC() + { + description = "Last FTP sync", + name = "FtpSync", + tipoMem = plcDataType.String, + displOrdinal = 10 + }); + memMap.mMapRead = ftpMemRead; + // area WRITE + Dictionary ftpMemWrite = new Dictionary(); + ftpMemWrite.Add("setComm", new dataConf() + { + description = "Commessa", + name = "setComm", + tipoMem = plcDataType.String, + displOrdinal = 1 + }); + ftpMemWrite.Add("setArt", new dataConf() + { + description = "Articolo", + name = "setArt", + tipoMem = plcDataType.String, + displOrdinal = 2 + }); + ftpMemWrite.Add("setPzComm", new dataConf() + { + description = "Qta Richiesta", + name = "setPzComm", + tipoMem = plcDataType.Int, + displOrdinal = 3 + }); + memMap.mMapWrite = ftpMemWrite; + // eseguo setup + invio info configurazione... + setupMemMap(); // invio conf macchina all'inizio SendMachineConf(); } @@ -342,6 +381,7 @@ namespace IOB_WIN_NEXT.IobNet // salto se fosse attivo il veto controllo folder... if (lastCheckDir.AddSeconds(vetoCheckDirSec) < adesso) { + lastCheckDir = adesso; // verifico SE HO una folder da ODL in currProdData e se รจ disponibile... string reqFolder = getCurrProdData("setComm", ""); if (!string.IsNullOrEmpty(reqFolder)) @@ -710,12 +750,12 @@ namespace IOB_WIN_NEXT.IobNet // ciclo cercando eventuali info da emttere in DynData... foreach (var result in mirResult) { - string objSize = MeasureUtils.SizeSuffix(result.Size, 3); - actVal = $"Rem2Loc | {result.Name} | {objSize} | {result.RemotePath}"; - sVal = $"{actKey} | {actVal}"; - - if (result.IsDownload && result.IsSuccess && !result.IsSkipped) + // processo solo se size > 0... + if (result.Size > 0 && result.IsDownload && result.IsSuccess && !result.IsSkipped) { + string objSize = MeasureUtils.SizeSuffix(result.Size, 3); + actVal = $"Rem2Loc | {result.Name} | {objSize} | {result.RemotePath}"; + sVal = $"{actKey} | {actVal}"; accodaFLog(sVal, qEncodeFLog(actKey, actVal)); } else