Merge branch 'develop' into SDK/Icoel
This commit is contained in:
@@ -2,8 +2,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
/*------------------------------------------------
|
||||
* Aggiunto fix come da link seguente:
|
||||
@@ -14,6 +12,7 @@ using System.Threading.Tasks;
|
||||
* using SqlProviderServices= System.Data.Entity.SqlServer.SqlProviderServices;
|
||||
*
|
||||
*/
|
||||
|
||||
namespace EgwProxy.Icoel.DataLayer.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
@@ -26,29 +25,9 @@ namespace EgwProxy.Icoel.DataLayer.Controllers
|
||||
private static ExportDbContext dbExportCtx;
|
||||
private static TrackerDbContext dbTrackerCtx;
|
||||
#endif
|
||||
private static SyncStateDbContext dbSyncStateCtx;
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Avvio dell'oggetto gestione DB con le 3 stringhe di connessione specifiche
|
||||
/// </summary>
|
||||
/// <param name="connEntrata">Connesisone Db frontiera Entrata Merce</param>
|
||||
/// <param name="connTracker">Connessione DB Tracker</param>
|
||||
/// <param name="connExport">Connessione DB IcoelExport</param>
|
||||
/// <param name="connSyncState">Connessione DB locale di SYNC</param>
|
||||
public DbController(string connEntrata, string connTracker, string connExport, string connSyncState)
|
||||
{
|
||||
dbEntrataCtx = new EntrataDbContext(connEntrata);
|
||||
Log.Info("Avviata classe EntrataDbContext");
|
||||
dbExportCtx = new ExportDbContext(connExport);
|
||||
Log.Info("Avviata classe ExportDbContext");
|
||||
dbTrackerCtx = new TrackerDbContext(connTracker);
|
||||
Log.Info("Avviata classe dbTrackerCtx");
|
||||
dbSyncStateCtx = new SyncStateDbContext(connSyncState);
|
||||
Log.Info("Avviata classe dbSyncStateCtx");
|
||||
}
|
||||
#endif
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Avvio dell'oggetto gestione DB con stringa di connessione specifica
|
||||
/// </summary>
|
||||
@@ -59,6 +38,25 @@ namespace EgwProxy.Icoel.DataLayer.Controllers
|
||||
Log.Info("Avviata classe dbSyncStateCtx");
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Recupera la tab di CurrData corrente
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.CurrDataModel> CurrDataGetAll()
|
||||
{
|
||||
List<DatabaseModels.CurrDataModel> dbResult = new List<DatabaseModels.CurrDataModel>();
|
||||
|
||||
dbResult = dbSyncStateCtx
|
||||
.DbSetCurrData
|
||||
.ToList();
|
||||
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dispose classe
|
||||
/// </summary>
|
||||
@@ -73,94 +71,6 @@ namespace EgwProxy.Icoel.DataLayer.Controllers
|
||||
dbSyncStateCtx.Dispose();
|
||||
}
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Elenco record Entrata Merce (Frontiera)
|
||||
/// </summary>
|
||||
/// <param name="minIdx">idx da cui partire a recuperare</param>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.EntrataModel> EntrateGetFromIdx(int minIdx = 0)
|
||||
{
|
||||
List<DatabaseModels.EntrataModel> dbResult = new List<DatabaseModels.EntrataModel>();
|
||||
dbResult = dbEntrataCtx
|
||||
.DbSetEntrataMerce
|
||||
.Where(x => (x.ID_CHIAVE >= minIdx))
|
||||
.OrderBy(x => x.ID_CHIAVE)
|
||||
.ToList();
|
||||
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco ultimi record Entrata Merce (Frontiera)
|
||||
/// </summary>
|
||||
/// <param name="numRec">numero records da recuperare</param>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.EntrataModel> EntrateGetLast(int numRec = 100)
|
||||
{
|
||||
List<DatabaseModels.EntrataModel> dbResult = new List<DatabaseModels.EntrataModel>();
|
||||
dbResult = dbEntrataCtx
|
||||
.DbSetEntrataMerce
|
||||
.OrderByDescending(x => x.ID_CHIAVE)
|
||||
.Take(numRec)
|
||||
.ToList();
|
||||
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco record ProductsTotal (da Icoel Export Products)
|
||||
/// </summary>
|
||||
/// <param name="minIdx">idx da cui partire a recuperare</param>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.ProductsTotalsModel> ExportProductsGetFromIdx(int minIdx = 0)
|
||||
{
|
||||
List<DatabaseModels.ProductsTotalsModel> dbResult = new List<DatabaseModels.ProductsTotalsModel>();
|
||||
dbResult = dbExportCtx
|
||||
.DbSetProductsTotals
|
||||
.Where(x => (x.SizerBatchId >= minIdx))
|
||||
.OrderBy(x => x.SizerBatchId)
|
||||
.ToList();
|
||||
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco ultimi record ProductsTotal (da Icoel Export Products)
|
||||
/// </summary>
|
||||
/// <param name="numRec">numero records da recuperare</param>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.ProductsTotalsModel> ExportProductsGetLast(int numRec = 0)
|
||||
{
|
||||
List<DatabaseModels.ProductsTotalsModel> dbResult = new List<DatabaseModels.ProductsTotalsModel>();
|
||||
dbResult = dbExportCtx
|
||||
.DbSetProductsTotals
|
||||
.OrderByDescending(x => x.SizerBatchId)
|
||||
.ThenByDescending(x => x.Index)
|
||||
.Take(numRec)
|
||||
.ToList();
|
||||
|
||||
return dbResult;
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Esegue una volta la stored di ImportAll (x recupero dati da DB esterni) e poi
|
||||
/// restitusice in output la tab di SyncState x verificare lo stato
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.SyncStateModel> SyncStateDoImportAll()
|
||||
{
|
||||
List<DatabaseModels.SyncStateModel> dbResult = new List<DatabaseModels.SyncStateModel>();
|
||||
|
||||
dbResult = dbSyncStateCtx
|
||||
.Database
|
||||
.SqlQuery<DatabaseModels.SyncStateModel>("EXEC stp_ImportAll")
|
||||
.ToList();
|
||||
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Esegue una volta la stored di ImportAll (x recupero dati da DB esterni) e poi
|
||||
/// restitusice in output la tab di SyncState x verificare lo stato
|
||||
@@ -178,6 +88,23 @@ namespace EgwProxy.Icoel.DataLayer.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Esegue una volta la stored di ImportAll (x recupero dati da DB esterni) e poi
|
||||
/// restitusice in output la tab di SyncState x verificare lo stato
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.SyncStateModel> SyncStateDoImportAll()
|
||||
{
|
||||
List<DatabaseModels.SyncStateModel> dbResult = new List<DatabaseModels.SyncStateModel>();
|
||||
|
||||
dbResult = dbSyncStateCtx
|
||||
.Database
|
||||
.SqlQuery<DatabaseModels.SyncStateModel>("EXEC stp_ImportAll")
|
||||
.ToList();
|
||||
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// recupera la tab di SyncState corrente
|
||||
/// </summary>
|
||||
@@ -193,60 +120,13 @@ namespace EgwProxy.Icoel.DataLayer.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Elenco record DettConfezioni (da Icoel TrackerLotti)
|
||||
/// </summary>
|
||||
/// <param name="minIdx">idx da cui partire a recuperare</param>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.DettConfezioniModel> TrackConfezioniGetFromIdx(int minIdx = 0)
|
||||
{
|
||||
List<DatabaseModels.DettConfezioniModel> dbResult = new List<DatabaseModels.DettConfezioniModel>();
|
||||
dbResult = dbTrackerCtx
|
||||
.DbSetConfezioni
|
||||
.Where(x => (x.Pack_Id >= minIdx))
|
||||
.OrderBy(x => x.Pack_Id)
|
||||
.ToList();
|
||||
#endregion Public Methods
|
||||
|
||||
return dbResult;
|
||||
}
|
||||
#region Private Fields
|
||||
|
||||
/// <summary>
|
||||
/// Elenco ultimi record DettaglioConfezioni (da Icoel TrackerLotti)
|
||||
/// </summary>
|
||||
/// <param name="numRec">numero records da recuperare</param>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.DettConfezioniModel> TrackConfezioniGetLast(int numRec = 0)
|
||||
{
|
||||
List<DatabaseModels.DettConfezioniModel> dbResult = new List<DatabaseModels.DettConfezioniModel>();
|
||||
dbResult = dbTrackerCtx
|
||||
.DbSetConfezioni
|
||||
.OrderByDescending(x => x.Pack_Id)
|
||||
.Take(numRec)
|
||||
.ToList();
|
||||
private static SyncStateDbContext dbSyncStateCtx;
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco dettaglio conferimento x PackId (da Icoel TrackerLotti)
|
||||
/// ATTENZIONE: in caso di mancata associazione lotto ingresso con lavorazione corrente la
|
||||
/// vista restituisce nuovo (possibile lavorare senza lotto ingresso e senza tracking)
|
||||
/// </summary>
|
||||
/// <param name="packId">idx da cui partire a recuperare</param>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.DettConferimentoModel> TrackPackConfDetailByIdx(long packId = 0)
|
||||
{
|
||||
List<DatabaseModels.DettConferimentoModel> dbResult = new List<DatabaseModels.DettConferimentoModel>();
|
||||
dbResult = dbTrackerCtx
|
||||
.DbSetConferimento
|
||||
.Where(x => (x.PackId == packId))
|
||||
.OrderBy(x => x.NUMERO_LOTTO)
|
||||
.ThenByDescending(x => x.QUANTITA_ENTRATA)
|
||||
.ToList();
|
||||
|
||||
return dbResult;
|
||||
}
|
||||
#endif
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Data.Entity.Spatial;
|
||||
|
||||
namespace EgwProxy.Icoel.DataLayer.DatabaseModels
|
||||
{
|
||||
|
||||
[Table("CurrData")]
|
||||
public partial class CurrDataModel
|
||||
{
|
||||
[Key]
|
||||
[StringLength(50)]
|
||||
public string Topic { get; set; }
|
||||
|
||||
public decimal CurrVal { get; set; } = 0;
|
||||
}
|
||||
}
|
||||
@@ -25,5 +25,7 @@ namespace EgwProxy.Icoel.DataLayer.DatabaseModels
|
||||
public long NumRecIn { get; set; }
|
||||
|
||||
public long NumRecOut { get; set; }
|
||||
|
||||
public DateTime LastUpdate { get; set; } = DateTime.Today;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
<Compile Include="DatabaseModels\EntrataModel.cs" />
|
||||
<Compile Include="DatabaseModels\DettConferimentoModel.cs" />
|
||||
<Compile Include="DatabaseModels\DettConfezioniModel.cs" />
|
||||
<Compile Include="DatabaseModels\CurrDataModel.cs" />
|
||||
<Compile Include="EntrataDbContext.cs" />
|
||||
<Compile Include="ExportDbContext.cs" />
|
||||
<Compile Include="DatabaseModels\ProductsTotalsModel.cs" />
|
||||
|
||||
@@ -32,10 +32,15 @@ namespace EgwProxy.Icoel.DataLayer
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// DbSet dai dati stato sync DB esterni <--> locale
|
||||
/// DbSet dei dati stato sync DB esterni <--> locale
|
||||
/// </summary>
|
||||
public virtual DbSet<SyncStateModel> DbSetSyncState { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// DbSet CurrData
|
||||
/// </summary>
|
||||
public virtual DbSet<CurrDataModel> DbSetCurrData { get; set; }
|
||||
|
||||
protected override void OnModelCreating(DbModelBuilder modelBuilder)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -182,18 +182,20 @@ namespace EgwProxy.Icoel.Compac
|
||||
internal Dictionary<string, double> GetPerfMeters()
|
||||
{
|
||||
Dictionary<string, double> answ = new Dictionary<string, double>();
|
||||
// indicata in tonnOra
|
||||
// velocità processo indicata in tonnellate /oOra
|
||||
double velTonnOra = SSClient.GetMachineTonnesPH();
|
||||
// velocità espressa in frutti/minuto
|
||||
double velFruttiMinuto = SSClient.GetMachineTotalFPM();
|
||||
// percentuale riempimento carrellini
|
||||
double percRiemp = SSClient.GetMachineCupfill();
|
||||
//// indicata in carrelli/minuto
|
||||
//int[] velCarrMinuto = SSClient.GetMachineRodsPM();
|
||||
// Numero confezioni/ora
|
||||
double numPackOra = SSClient.GetMachinePacksPH();
|
||||
|
||||
// accodo i valori ricavati
|
||||
answ.Add("VelTonnOra", velTonnOra);
|
||||
answ.Add("VelFruttiMinuto", velFruttiMinuto);
|
||||
answ.Add("NumPacksOra", numPackOra);
|
||||
answ.Add("PercRiemp", percRiemp);
|
||||
answ.Add("VelFruttiMinuto", velFruttiMinuto);
|
||||
answ.Add("VelTonnOra", velTonnOra);
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,20 +6,6 @@ namespace IOB_UT_NEXT
|
||||
{
|
||||
public class BinaryUtils : IFormatProvider, ICustomFormatter
|
||||
{
|
||||
#region Private Methods
|
||||
|
||||
private string HandleOtherFormats(string format, object arg)
|
||||
{
|
||||
if (arg is IFormattable)
|
||||
return ((IFormattable)arg).ToString(format, CultureInfo.CurrentCulture);
|
||||
else if (arg != null)
|
||||
return arg.ToString();
|
||||
else
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
#region Public Methods
|
||||
|
||||
// Format number in binary (B), octal (O), or hexadecimal (H).
|
||||
@@ -29,8 +15,7 @@ namespace IOB_UT_NEXT
|
||||
int baseNumber;
|
||||
// Handle null or empty format string, string with precision specifier.
|
||||
string thisFmt = String.Empty;
|
||||
// Extract first character of format string (precision specifiers
|
||||
// are not supported).
|
||||
// Extract first character of format string (precision specifiers are not supported).
|
||||
if (!String.IsNullOrEmpty(format))
|
||||
thisFmt = format.Length > 1 ? format.Substring(0, 1) : format;
|
||||
|
||||
@@ -140,5 +125,19 @@ namespace IOB_UT_NEXT
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private string HandleOtherFormats(string format, object arg)
|
||||
{
|
||||
if (arg is IFormattable)
|
||||
return ((IFormattable)arg).ToString(format, CultureInfo.CurrentCulture);
|
||||
else if (arg != null)
|
||||
return arg.ToString();
|
||||
else
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
+1
-55
@@ -1,6 +1,4 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using System;
|
||||
using System;
|
||||
|
||||
namespace IOB_UT_NEXT
|
||||
{
|
||||
@@ -470,35 +468,6 @@ namespace IOB_UT_NEXT
|
||||
WPS
|
||||
}
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Enumerazione tipi di semaforo
|
||||
/// </summary>
|
||||
public enum Semaforo
|
||||
{
|
||||
/// <summary>
|
||||
/// Stato non definito
|
||||
/// </summary>
|
||||
ND,
|
||||
/// <summary>
|
||||
/// Verde
|
||||
/// </summary>
|
||||
SV,
|
||||
/// <summary>
|
||||
/// Giallo
|
||||
/// </summary>
|
||||
SG,
|
||||
/// <summary>
|
||||
/// Rosso
|
||||
/// </summary>
|
||||
SR,
|
||||
/// <summary>
|
||||
/// Grigio/Spento
|
||||
/// </summary>
|
||||
SS
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Enumerazione tipi di tipi di URL x invio
|
||||
/// </summary>
|
||||
@@ -524,27 +493,4 @@ namespace IOB_UT_NEXT
|
||||
/// </summary>
|
||||
ULog
|
||||
}
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Tipologia dato Raw Transfer (derivare da MapoSdk e togliere qui)
|
||||
/// </summary>
|
||||
/// serializzazione Native
|
||||
/// [JsonConverter(typeof(JsonStringEnumConverter))]
|
||||
/// serializzazione Newtonsoft json
|
||||
/// [JsonConverter(typeof(StringEnumConverter))]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum rawTransfType
|
||||
{
|
||||
ND = 0,
|
||||
/// <summary>
|
||||
/// Icoel: Batch info
|
||||
/// </summary>
|
||||
IcoelBatch,
|
||||
/// <summary>
|
||||
/// Icoel: Variety + layout info relative
|
||||
/// </summary>
|
||||
IcoelVarInfo
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -1,8 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace IOB_UT_NEXT
|
||||
{
|
||||
@@ -39,7 +36,8 @@ namespace IOB_UT_NEXT
|
||||
TimeSet,
|
||||
|
||||
/// <summary>
|
||||
/// Verificato il canale di comunicazione è OK, fatta pulizia con AbortAll, NON ci sono report attivi
|
||||
/// Verificato il canale di comunicazione è OK, fatta pulizia con AbortAll, NON ci sono
|
||||
/// report attivi
|
||||
/// </summary>
|
||||
ChannelOk,
|
||||
|
||||
@@ -135,7 +133,8 @@ namespace IOB_UT_NEXT
|
||||
public int PzPallet { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// Indica se sia possibile impostare i pezzi pallet dal server, ed in tal caso moltiplica i pezzi letti dalla macchina per il valore pzPallet (vedi sopra)
|
||||
/// Indica se sia possibile impostare i pezzi pallet dal server, ed in tal caso
|
||||
/// moltiplica i pezzi letti dalla macchina per il valore pzPallet (vedi sopra)
|
||||
/// </summary>
|
||||
public bool SetPzPalletFromSrv { get; set; } = false;
|
||||
|
||||
@@ -170,7 +169,8 @@ namespace IOB_UT_NEXT
|
||||
public List<FileTask> FileList { get; set; } = new List<FileTask>();
|
||||
|
||||
/// <summary>
|
||||
/// Numero MAX di esecuzioni da mantenere in HIST prima di eliminare i + vecchi (fare folder HIST\SESSnnnn)
|
||||
/// Numero MAX di esecuzioni da mantenere in HIST prima di eliminare i + vecchi (fare
|
||||
/// folder HIST\SESSnnnn)
|
||||
/// </summary>
|
||||
public int Max2Keep { get; set; } = 50;
|
||||
|
||||
@@ -190,7 +190,7 @@ namespace IOB_UT_NEXT
|
||||
public string RespOk { get; set; } = "PROCESSED";
|
||||
|
||||
/// <summary>
|
||||
/// Seconds before do a new retry (default = 0 --> no veto)
|
||||
/// Seconds before do a new retry (default = 0 --> no veto)
|
||||
/// </summary>
|
||||
public double RetrySec { get; set; } = 0;
|
||||
|
||||
|
||||
@@ -59,8 +59,8 @@
|
||||
<Reference Include="ICSharpCode.SharpZipLib, Version=1.3.1.9, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SharpZipLib.1.3.1\lib\net45\ICSharpCode.SharpZipLib.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MapoSDK, Version=6.14.2204.2616, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MapoSDK.6.14.2204.2616\lib\MapoSDK.dll</HintPath>
|
||||
<Reference Include="MapoSDK, Version=6.14.2205.2808, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MapoSDK.6.14.2205.2808\lib\MapoSDK.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.6.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||
@@ -134,7 +134,6 @@
|
||||
<Compile Include="Objects.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="RedisMan.cs" />
|
||||
<Compile Include="val.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="ExtLib\krcc.dll" />
|
||||
|
||||
+67
-24
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Globalization;
|
||||
|
||||
namespace IOB_UT_NEXT
|
||||
{
|
||||
@@ -16,9 +16,6 @@ namespace IOB_UT_NEXT
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
// INI filename
|
||||
|
||||
// import windows dll functions
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
@@ -33,25 +30,6 @@ namespace IOB_UT_NEXT
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Private Methods
|
||||
|
||||
[DllImport("kernel32")]
|
||||
private static extern int GetPrivateProfileInt(string section, string key, int def, string filePath);
|
||||
|
||||
[DllImport("kernel32")]
|
||||
private static extern int GetPrivateProfileSection(string section, IntPtr retVal, uint size, string filePath);
|
||||
|
||||
[DllImport("kernel32")]
|
||||
private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
|
||||
|
||||
[DllImport("kernel32")]
|
||||
private static extern bool WritePrivateProfileSection(string section, string value, string filePath);
|
||||
|
||||
[DllImport("kernel32", CharSet = CharSet.Auto, BestFitMapping = false)]
|
||||
private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
@@ -149,7 +127,9 @@ namespace IOB_UT_NEXT
|
||||
/// </summary>
|
||||
/// <param name="Section"></param>
|
||||
/// Section name
|
||||
/// <returns>restituisce delle stringhe keys=values da suddividere appunto come key/val successivamente</returns>
|
||||
/// <returns>
|
||||
/// restituisce delle stringhe keys=values da suddividere appunto come key/val successivamente
|
||||
/// </returns>
|
||||
public string[] ReadSection(string Section)
|
||||
{
|
||||
const int bufferSize = 2048; // max is 32767
|
||||
@@ -270,5 +250,68 @@ namespace IOB_UT_NEXT
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Methods
|
||||
|
||||
|
||||
// INI filename
|
||||
|
||||
/// <summary>
|
||||
/// GetPrivateProfileInt: import windows dll functions
|
||||
/// </summary>
|
||||
/// <param name="section"></param>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="def"></param>
|
||||
/// <param name="filePath"></param>
|
||||
/// <returns></returns>
|
||||
[DllImport("kernel32")]
|
||||
private static extern int GetPrivateProfileInt(string section, string key, int def, string filePath);
|
||||
|
||||
/// <summary>
|
||||
/// GetPrivateProfileSection: import windows dll functions
|
||||
/// </summary>
|
||||
/// <param name="section"></param>
|
||||
/// <param name="retVal"></param>
|
||||
/// <param name="size"></param>
|
||||
/// <param name="filePath"></param>
|
||||
/// <returns></returns>
|
||||
[DllImport("kernel32")]
|
||||
private static extern int GetPrivateProfileSection(string section, IntPtr retVal, uint size, string filePath);
|
||||
|
||||
/// <summary>
|
||||
/// GetPrivateProfileString: import windows dll functions
|
||||
/// </summary>
|
||||
/// <param name="section"></param>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="def"></param>
|
||||
/// <param name="retVal"></param>
|
||||
/// <param name="size"></param>
|
||||
/// <param name="filePath"></param>
|
||||
/// <returns></returns>
|
||||
[DllImport("kernel32")]
|
||||
private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
|
||||
|
||||
/// <summary>
|
||||
/// WritePrivateProfileSection: import windows dll functions
|
||||
/// </summary>
|
||||
/// <param name="section"></param>
|
||||
/// <param name="value"></param>
|
||||
/// <param name="filePath"></param>
|
||||
/// <returns></returns>
|
||||
[DllImport("kernel32")]
|
||||
private static extern bool WritePrivateProfileSection(string section, string value, string filePath);
|
||||
|
||||
/// <summary>
|
||||
/// WritePrivateProfileString: import windows dll functions
|
||||
/// </summary>
|
||||
/// <param name="section"></param>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="val"></param>
|
||||
/// <param name="filePath"></param>
|
||||
/// <returns></returns>
|
||||
[DllImport("kernel32", CharSet = CharSet.Auto, BestFitMapping = false)]
|
||||
private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,10 @@
|
||||
using NLog;
|
||||
using NLog.Config;
|
||||
using NLog.Targets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace IOB_UT_NEXT
|
||||
{/// <summary>
|
||||
/// Classe helper x LOG basata su NLog
|
||||
/// </summary>
|
||||
/// Classe helper x LOG basata su NLog </summary>
|
||||
public static class Logging
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
+5
-65
@@ -117,70 +117,6 @@ namespace IOB_UT_NEXT
|
||||
#endregion Public Methods
|
||||
}
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Classe di base per trasferimento informazioni di tipo RawTransfer
|
||||
/// FixMe Todo Fare !!!: elimnare usando SDK MAPO
|
||||
/// </summary>
|
||||
public class BaseRawTransf
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Data-Ora riferimento (x ordinamento fifo)
|
||||
/// </summary>
|
||||
public DateTime dataRif { get; set; } = DateTime.Now;
|
||||
|
||||
/// <summary>
|
||||
/// Messaggio in modalità raw/stringa
|
||||
/// </summary>
|
||||
public object mesContent { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Tipo di messaggio trasmesso
|
||||
/// </summary>
|
||||
public rawTransfType mesType { get; set; } = rawTransfType.ND;
|
||||
|
||||
/// <summary>
|
||||
/// Costruttore senza parametri
|
||||
/// </summary>
|
||||
public BaseRawTransf()
|
||||
{
|
||||
this.dataRif = DateTime.Now;
|
||||
this.mesContent = "";
|
||||
this.mesType = rawTransfType.ND;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Costruttore oggetto
|
||||
/// </summary>
|
||||
/// <param name="dataRif"></param>
|
||||
/// <param name="mesContent"></param>
|
||||
/// <param name="mesType"></param>
|
||||
public BaseRawTransf(DateTime dataRif, object mesContent, rawTransfType mesType)
|
||||
{
|
||||
this.dataRif = dataRif;
|
||||
this.mesContent = mesContent;
|
||||
this.mesType = mesType;
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Array valori tipo BaseRawTransf inviati come JSon
|
||||
/// FixMe Todo Fare !!!: elimnare usando SDK MAPO
|
||||
/// </summary>
|
||||
public class rawTransfJsonPayload
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public List<BaseRawTransf> rawTransfData { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Cache a tempo valori INT
|
||||
/// </summary>
|
||||
@@ -343,6 +279,8 @@ namespace IOB_UT_NEXT
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Override metodo di equality
|
||||
/// </summary>
|
||||
@@ -371,7 +309,7 @@ namespace IOB_UT_NEXT
|
||||
return false;
|
||||
if (queueRawTransfLen != item.queueRawTransfLen)
|
||||
return false;
|
||||
if (queueUlLen!= item.queueUlLen)
|
||||
if (queueUlLen != item.queueUlLen)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -381,6 +319,8 @@ namespace IOB_UT_NEXT
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
+111
-108
@@ -2,68 +2,12 @@
|
||||
using StackExchange.Redis;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace IOB_UT_NEXT
|
||||
{
|
||||
public class RedisIobCache
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
/// <summary>
|
||||
/// Connessione lazy a redis...
|
||||
/// </summary>
|
||||
private Lazy<ConnectionMultiplexer> lazyConnection = new Lazy<ConnectionMultiplexer>(() =>
|
||||
{
|
||||
string RedisConn = baseUtils.CRS("RedisConn");
|
||||
if (string.IsNullOrEmpty(RedisConn))
|
||||
{
|
||||
RedisConn = "localhost,abortConnect=false,ssl=false";
|
||||
}
|
||||
|
||||
return ConnectionMultiplexer.Connect(RedisConn);
|
||||
});
|
||||
|
||||
/// <summary>
|
||||
/// Connessione lazy a redis...
|
||||
/// </summary>
|
||||
private Lazy<ConnectionMultiplexer> lazyConnectionAdmin = new Lazy<ConnectionMultiplexer>(() =>
|
||||
{
|
||||
string RedisConnAdmin = baseUtils.CRS("RedisConnAdmin");
|
||||
if (string.IsNullOrEmpty(RedisConnAdmin))
|
||||
{
|
||||
RedisConnAdmin = "localhost,abortConnect=false,ssl=false,allowAdmin=true";
|
||||
}
|
||||
|
||||
return ConnectionMultiplexer.Connect(RedisConnAdmin);
|
||||
});
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
/// <summary>
|
||||
/// Cod IOB
|
||||
/// </summary>
|
||||
protected string currCodIob = "000";
|
||||
/// <summary>
|
||||
/// Tipo IOB
|
||||
/// </summary>
|
||||
protected string currIobType = "ND";
|
||||
|
||||
/// <summary>
|
||||
/// Hash redis x dati IOB
|
||||
/// </summary>
|
||||
protected string redIobKey = "";
|
||||
|
||||
/// <summary>
|
||||
/// Hash redis x dati server
|
||||
/// </summary>
|
||||
protected string redServKey = "";
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
@@ -97,7 +41,7 @@ namespace IOB_UT_NEXT
|
||||
IobWinStatus newIobStatus = new IobWinStatus()
|
||||
{
|
||||
CodIob = currCodIob,
|
||||
IobType= currIobType,
|
||||
IobType = currIobType,
|
||||
online = false
|
||||
};
|
||||
// salvo in area REDIS
|
||||
@@ -137,15 +81,6 @@ namespace IOB_UT_NEXT
|
||||
|
||||
#endregion Public Enums
|
||||
|
||||
#region Private Properties
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto currentDb locale
|
||||
/// </summary>
|
||||
private IDatabase _currDB { get; set; }
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
@@ -216,7 +151,7 @@ namespace IOB_UT_NEXT
|
||||
answ = new IobWinStatus()
|
||||
{
|
||||
CodIob = currCodIob,
|
||||
IobType=currIobType,
|
||||
IobType = currIobType,
|
||||
online = false
|
||||
};
|
||||
// salvo serializzando...
|
||||
@@ -298,39 +233,6 @@ namespace IOB_UT_NEXT
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Effettua comaprazione x CHIAVE in KVP ASC
|
||||
/// </summary>
|
||||
/// <param name="x"></param>
|
||||
/// <param name="y"></param>
|
||||
/// <returns></returns>
|
||||
private int CompareKey(KeyValuePair<string, int> x, KeyValuePair<string, int> y)
|
||||
{
|
||||
return x.Key.CompareTo(y.Key);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua comaprazione x CHIAVE in KVP DESC
|
||||
/// </summary>
|
||||
/// <param name="x"></param>
|
||||
/// <param name="y"></param>
|
||||
/// <returns></returns>
|
||||
private int CompareKeyDesc(KeyValuePair<string, int> x, KeyValuePair<string, int> y)
|
||||
{
|
||||
return y.Key.CompareTo(x.Key);
|
||||
}
|
||||
|
||||
private void initHashKeys()
|
||||
{
|
||||
// init dati di base...
|
||||
redServKey = redHash($"MP");
|
||||
redIobKey = redHash($"IOB:{currCodIob}");
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
@@ -477,8 +379,7 @@ namespace IOB_UT_NEXT
|
||||
public int redCountKey(string keyPattern)
|
||||
{
|
||||
int answ = 0;
|
||||
// cerco se ci sia valore in redis...
|
||||
// se vuoto = ALL...
|
||||
// cerco se ci sia valore in redis... se vuoto = ALL...
|
||||
keyPattern = string.IsNullOrEmpty(keyPattern) ? "**" : keyPattern;
|
||||
try
|
||||
{
|
||||
@@ -528,8 +429,7 @@ namespace IOB_UT_NEXT
|
||||
public bool redFlushKey(string keyPattern)
|
||||
{
|
||||
bool answ = false;
|
||||
// cerco se ci sia valore in redis...
|
||||
// se vuoto = ALL...
|
||||
// cerco se ci sia valore in redis... se vuoto = ALL...
|
||||
keyPattern = string.IsNullOrEmpty(keyPattern) ? "**" : keyPattern;
|
||||
try
|
||||
{
|
||||
@@ -702,7 +602,8 @@ namespace IOB_UT_NEXT
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Nome della variabile HASH da utilizzare (dato CodModulo / Server / DB impiegato da funzionalita' DbConfig) + keyName richiesto...
|
||||
/// Nome della variabile HASH da utilizzare (dato CodModulo / Server / DB impiegato da
|
||||
/// funzionalita' DbConfig) + keyName richiesto...
|
||||
/// </summary>
|
||||
public string redHash(string keyName)
|
||||
{
|
||||
@@ -834,7 +735,9 @@ namespace IOB_UT_NEXT
|
||||
/// </summary>
|
||||
/// <param name="hashKey">chiave</param>
|
||||
/// <param name="hashFields">valori</param>
|
||||
/// <param name="expireSeconds">scadenza preimpostata hash (secondi) | defaoult = -1 (non scade)</param>
|
||||
/// <param name="expireSeconds">
|
||||
/// scadenza preimpostata hash (secondi) | defaoult = -1 (non scade)
|
||||
/// </param>
|
||||
/// <returns></returns>
|
||||
public bool redSaveHash(string hashKey, KeyValuePair<string, string>[] hashFields, double expireSeconds = -1)
|
||||
{
|
||||
@@ -891,7 +794,9 @@ namespace IOB_UT_NEXT
|
||||
/// </summary>
|
||||
/// <param name="hashKey">chiave</param>
|
||||
/// <param name="hashFields">valori</param>
|
||||
/// <param name="expireSeconds">scadenza preimpostata hash (secondi) | defaoult = -1 (non scade)</param>
|
||||
/// <param name="expireSeconds">
|
||||
/// scadenza preimpostata hash (secondi) | defaoult = -1 (non scade)
|
||||
/// </param>
|
||||
/// <returns></returns>
|
||||
public bool redSaveHashDict(string hashKey, Dictionary<string, string> hashFields, double expireSeconds = -1)
|
||||
{
|
||||
@@ -1058,7 +963,7 @@ namespace IOB_UT_NEXT
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Salva un set KVP (Key Value Pair) in RedisCache
|
||||
/// Salva un set KVP (Key Value Pair) in RedisCache
|
||||
/// </summary>
|
||||
/// <param name="valori">Set KVP chiave-valore da salvare</param>
|
||||
/// <returns></returns>
|
||||
@@ -1123,5 +1028,103 @@ namespace IOB_UT_NEXT
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
/// <summary>
|
||||
/// Cod IOB
|
||||
/// </summary>
|
||||
protected string currCodIob = "000";
|
||||
|
||||
/// <summary>
|
||||
/// Tipo IOB
|
||||
/// </summary>
|
||||
protected string currIobType = "ND";
|
||||
|
||||
/// <summary>
|
||||
/// Hash redis x dati IOB
|
||||
/// </summary>
|
||||
protected string redIobKey = "";
|
||||
|
||||
/// <summary>
|
||||
/// Hash redis x dati server
|
||||
/// </summary>
|
||||
protected string redServKey = "";
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Private Fields
|
||||
|
||||
/// <summary>
|
||||
/// Connessione lazy a redis...
|
||||
/// </summary>
|
||||
private Lazy<ConnectionMultiplexer> lazyConnection = new Lazy<ConnectionMultiplexer>(() =>
|
||||
{
|
||||
string RedisConn = baseUtils.CRS("RedisConn");
|
||||
if (string.IsNullOrEmpty(RedisConn))
|
||||
{
|
||||
RedisConn = "localhost,abortConnect=false,ssl=false";
|
||||
}
|
||||
|
||||
return ConnectionMultiplexer.Connect(RedisConn);
|
||||
});
|
||||
|
||||
/// <summary>
|
||||
/// Connessione lazy a redis...
|
||||
/// </summary>
|
||||
private Lazy<ConnectionMultiplexer> lazyConnectionAdmin = new Lazy<ConnectionMultiplexer>(() =>
|
||||
{
|
||||
string RedisConnAdmin = baseUtils.CRS("RedisConnAdmin");
|
||||
if (string.IsNullOrEmpty(RedisConnAdmin))
|
||||
{
|
||||
RedisConnAdmin = "localhost,abortConnect=false,ssl=false,allowAdmin=true";
|
||||
}
|
||||
|
||||
return ConnectionMultiplexer.Connect(RedisConnAdmin);
|
||||
});
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto currentDb locale
|
||||
/// </summary>
|
||||
private IDatabase _currDB { get; set; }
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Effettua comaprazione x CHIAVE in KVP ASC
|
||||
/// </summary>
|
||||
/// <param name="x"></param>
|
||||
/// <param name="y"></param>
|
||||
/// <returns></returns>
|
||||
private int CompareKey(KeyValuePair<string, int> x, KeyValuePair<string, int> y)
|
||||
{
|
||||
return x.Key.CompareTo(y.Key);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua comaprazione x CHIAVE in KVP DESC
|
||||
/// </summary>
|
||||
/// <param name="x"></param>
|
||||
/// <param name="y"></param>
|
||||
/// <returns></returns>
|
||||
private int CompareKeyDesc(KeyValuePair<string, int> x, KeyValuePair<string, int> y)
|
||||
{
|
||||
return y.Key.CompareTo(x.Key);
|
||||
}
|
||||
|
||||
private void initHashKeys()
|
||||
{
|
||||
// init dati di base...
|
||||
redServKey = redHash($"MP");
|
||||
redIobKey = redHash($"IOB:{currCodIob}");
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
+44
-47
@@ -1,7 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace IOB_UT_NEXT
|
||||
{
|
||||
@@ -27,50 +24,6 @@ namespace IOB_UT_NEXT
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
/// <summary>
|
||||
/// Fattore lambda (innovazione) per calcolo EWMA valore TCiclo corrente
|
||||
/// </summary>
|
||||
protected double _lambda { get; set; } = 0.4;
|
||||
|
||||
/// <summary>
|
||||
/// Ultimo TCiclo osservato in SECONDI
|
||||
/// </summary>
|
||||
protected double _lastTC { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// ULTIMO Contapezzi IOB VALIDO
|
||||
/// </summary>
|
||||
protected int _lastValidPzCountIOB { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// ULTIMO Contapezzi PLC VALIDO
|
||||
/// </summary>
|
||||
protected int _lastValidPzCountPLC { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Fattore massimo ammesso di delay x il TCiclo
|
||||
/// </summary>
|
||||
protected double _maxDelayFactor { get; set; } = 1.2;
|
||||
|
||||
/// <summary>
|
||||
/// Incremento amssimo pezzi per cui fare calcolo del tempociclo attuale
|
||||
/// </summary>
|
||||
protected double _maxIncrPz { get; set; } = 2;
|
||||
|
||||
/// <summary>
|
||||
/// Contapezzi IOB
|
||||
/// </summary>
|
||||
protected int _pzCountIOB { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Contapezzi PLC
|
||||
/// </summary>
|
||||
protected int _pzCountPLC { get; set; } = 0;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
@@ -171,5 +124,49 @@ namespace IOB_UT_NEXT
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
/// <summary>
|
||||
/// Fattore lambda (innovazione) per calcolo EWMA valore TCiclo corrente
|
||||
/// </summary>
|
||||
protected double _lambda { get; set; } = 0.4;
|
||||
|
||||
/// <summary>
|
||||
/// Ultimo TCiclo osservato in SECONDI
|
||||
/// </summary>
|
||||
protected double _lastTC { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// ULTIMO Contapezzi IOB VALIDO
|
||||
/// </summary>
|
||||
protected int _lastValidPzCountIOB { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// ULTIMO Contapezzi PLC VALIDO
|
||||
/// </summary>
|
||||
protected int _lastValidPzCountPLC { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Fattore massimo ammesso di delay x il TCiclo
|
||||
/// </summary>
|
||||
protected double _maxDelayFactor { get; set; } = 1.2;
|
||||
|
||||
/// <summary>
|
||||
/// Incremento amssimo pezzi per cui fare calcolo del tempociclo attuale
|
||||
/// </summary>
|
||||
protected double _maxIncrPz { get; set; } = 2;
|
||||
|
||||
/// <summary>
|
||||
/// Contapezzi IOB
|
||||
/// </summary>
|
||||
protected int _pzCountIOB { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Contapezzi PLC
|
||||
/// </summary>
|
||||
protected int _pzCountPLC { get; set; } = 0;
|
||||
|
||||
#endregion Protected Properties
|
||||
}
|
||||
}
|
||||
+143
-130
@@ -1,11 +1,7 @@
|
||||
using MapoSDK;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace IOB_UT_NEXT
|
||||
{
|
||||
@@ -14,7 +10,23 @@ namespace IOB_UT_NEXT
|
||||
/// </summary>
|
||||
public class BaseAlarmConf
|
||||
{
|
||||
#region Public Fields
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Elenco dei contatori blink x gestione caso fronte salita/discesa segnale che blinka
|
||||
/// </summary>
|
||||
public int[] alarmsBlinkCounter { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// BitMask 16bit (1 = valido, 0 = filtro) degli allarmi silenziati/disabilitati (se
|
||||
/// iniziano per ##) come valore da sottrarre x check
|
||||
/// </summary>
|
||||
public uint[] alarmsMask { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Array dei valori allarme correnti
|
||||
/// </summary>
|
||||
public uint[] alarmsState { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// valore di partenza x un segnale di blink in caso di fine variazione (fronte discesa)
|
||||
@@ -26,25 +38,6 @@ namespace IOB_UT_NEXT
|
||||
/// </summary>
|
||||
public int blinkUpVal { get; set; } = 3;
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Elenco dei contatori blink x gestione caso fronte salita/discesa segnale che blinka
|
||||
/// </summary>
|
||||
public int[] alarmsBlinkCounter { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// BitMask 16bit (1 = valido, 0 = filtro) degli allarmi silenziati/disabilitati (se iniziano per ##) come valore da sottrarre x check
|
||||
/// </summary>
|
||||
public uint[] alarmsMask { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Array dei valori allarme correnti
|
||||
/// </summary>
|
||||
public uint[] alarmsState { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Descrizione area allarmi
|
||||
/// </summary>
|
||||
@@ -177,7 +170,8 @@ namespace IOB_UT_NEXT
|
||||
alarmsState = new uint[size / 2];
|
||||
alarmsMask = new uint[size / 2];
|
||||
|
||||
// una volta inizializzata la classe di base sistemo vettori allarmi disabilitati ed il contatore blink dei fronti di discesa
|
||||
// una volta inizializzata la classe di base sistemo vettori allarmi disabilitati ed il
|
||||
// contatore blink dei fronti di discesa
|
||||
alarmsBlinkCounter = new int[messages.Count];
|
||||
int idx = 0;
|
||||
int bank = 0;
|
||||
@@ -217,7 +211,8 @@ namespace IOB_UT_NEXT
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Classe gestione configurazione parametri di base x configuraizone estesa (es MTConnect, OPC-UA, ...)
|
||||
/// Classe gestione configurazione parametri di base x configuraizone estesa (es MTConnect,
|
||||
/// OPC-UA, ...)
|
||||
/// </summary>
|
||||
public class BaseParamConf
|
||||
{
|
||||
@@ -229,14 +224,13 @@ namespace IOB_UT_NEXT
|
||||
public List<diCheckCondition> condWork { get; set; } = new List<diCheckCondition>();
|
||||
|
||||
/// <summary>
|
||||
/// Indica se l'emergenza armata va riportata verso Mapo come bit a TRUE
|
||||
/// True --> armata = 1 / triggered = 0
|
||||
/// False --> triggered = 1 / armata = 0
|
||||
/// Indica se l'emergenza armata va riportata verso Mapo come bit a TRUE True --> armata
|
||||
/// = 1 / triggered = 0 False --> triggered = 1 / armata = 0
|
||||
/// </summary>
|
||||
public bool emergencyArmedTrue { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Elenco items FILTRATI da invio come dynData --> FluxLog (events o samples)
|
||||
/// Elenco items FILTRATI da invio come dynData --> FluxLog (events o samples)
|
||||
/// </summary>
|
||||
public List<string> fluxLogVeto { get; set; } = new List<string>();
|
||||
|
||||
@@ -309,7 +303,8 @@ namespace IOB_UT_NEXT
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Classe per rappresentare una lista di oggetti chiave/valore target x controlo condizioni multiple + indicazione modalità di controllo (AND/OR/...)
|
||||
/// Classe per rappresentare una lista di oggetti chiave/valore target x controlo condizioni
|
||||
/// multiple + indicazione modalità di controllo (AND/OR/...)
|
||||
/// </summary>
|
||||
public class diCheckCondSetup
|
||||
{
|
||||
@@ -326,13 +321,75 @@ namespace IOB_UT_NEXT
|
||||
public boolCheckMode checkMode { get; set; } = boolCheckMode.AND;
|
||||
|
||||
/// <summary>
|
||||
/// indica se il check vada NEGATO (esempio se cerco la condizione opposta, esempio num allarmi 0 --> se true NEGO la condizione HO ALLARMI)
|
||||
/// indica se il check vada NEGATO (esempio se cerco la condizione opposta, esempio num
|
||||
/// allarmi 0 --> se true NEGO la condizione HO ALLARMI)
|
||||
/// </summary>
|
||||
public bool negateValue { get; set; } = false;
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Classe x definizione delle azioni in fase di setup macchina
|
||||
/// </summary>
|
||||
public class MachineSetupAction
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Indica se vada disabilitato il contapezzi quando la condizione NotEqual sia soddisfatta
|
||||
/// </summary>
|
||||
public bool DisablePzCountNotEqual { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Parametro target dell'azione
|
||||
/// </summary>
|
||||
public string TargetParam { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// parametro da impostare SE il check da esito EQUAL
|
||||
/// </summary>
|
||||
public int TargetValEqual { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// parametro da impostare SE il check da esito NOT EQUAL
|
||||
/// </summary>
|
||||
public int TargetValNotEqual { get; set; } = 1;
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Definizione parametri di setup incrociato...
|
||||
/// </summary>
|
||||
public class MachineSetupConf
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Dizionario dei parametri di corrispondenza tra variabili MES e variabili Macchina MES =
|
||||
/// scritte dal MES Macchina = scritte da macchina
|
||||
/// </summary>
|
||||
public Dictionary<string, string> checkParList { get; set; } = new Dictionary<string, string>();
|
||||
|
||||
/// <summary>
|
||||
/// Abilitazione gestione Setup Avanzato (= scrittura)
|
||||
/// </summary>
|
||||
public bool EnableAdvSetup { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Modalità gestione setup
|
||||
/// </summary>
|
||||
public MachineSetupMode SetupMode { get; set; } = MachineSetupMode.ND;
|
||||
|
||||
/// <summary> Dizionario dei parametri da scrivere quando si rilevano differenze tra i
|
||||
/// parametri MES/Macchina string (key) --> memoria da scrivere tuple<int isEqual,int
|
||||
/// notEqual> --> valori da scrivere quando uguali o diversi </summary>
|
||||
public List<MachineSetupAction> writeParAction { get; set; } = new List<MachineSetupAction>();
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// COnfigurazione blocchi x accesso memoria ottimizzato
|
||||
/// </summary>
|
||||
@@ -360,84 +417,6 @@ namespace IOB_UT_NEXT
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Definizione parametri watchdog
|
||||
/// </summary>
|
||||
public class WatchDogConf
|
||||
{
|
||||
/// <summary>
|
||||
/// Abilitazione WatchDog
|
||||
/// </summary>
|
||||
public bool IsEnabled { get; set; } = false;
|
||||
/// <summary>
|
||||
/// Conf memoria x lettura WatchDog (ToMes), se !="" è gestito
|
||||
/// </summary>
|
||||
public string MemConfRead { get; set; } = "";
|
||||
/// <summary>
|
||||
/// Conf memoria x scrittura WatchDog (FromMes), se !="" è gestito
|
||||
/// </summary>
|
||||
public string MemConfWrite { get; set; } = "";
|
||||
/// <summary>
|
||||
/// Valore max contatore prima di resettare
|
||||
/// </summary>
|
||||
public int MaxVal { get; set; } = 9999;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Definizione parametri di setup incrociato...
|
||||
/// </summary>
|
||||
public class MachineSetupConf
|
||||
{
|
||||
/// <summary>
|
||||
/// Modalità gestione setup
|
||||
/// </summary>
|
||||
public MachineSetupMode SetupMode { get; set; } = MachineSetupMode.ND;
|
||||
|
||||
/// <summary>
|
||||
/// Abilitazione gestione Setup Avanzato (= scrittura)
|
||||
/// </summary>
|
||||
public bool EnableAdvSetup { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Dizionario dei parametri di corrispondenza tra variabili MES e variabili Macchina
|
||||
/// MES = scritte dal MES
|
||||
/// Macchina = scritte da macchina
|
||||
/// </summary>
|
||||
public Dictionary<string, string> checkParList { get; set; } = new Dictionary<string, string>();
|
||||
|
||||
/// <summary>
|
||||
/// Dizionario dei parametri da scrivere quando si rilevano differenze tra i parametri MES/Macchina
|
||||
/// string (key) --> memoria da scrivere
|
||||
/// tuple<int isEqual,int notEqual> --> valori da scrivere quando uguali o diversi
|
||||
/// </summary>
|
||||
public List<MachineSetupAction> writeParAction { get; set; } = new List<MachineSetupAction>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Classe x definizione delle azioni in fase di setup macchina
|
||||
/// </summary>
|
||||
public class MachineSetupAction
|
||||
{
|
||||
/// <summary>
|
||||
/// Parametro target dell'azione
|
||||
/// </summary>
|
||||
public string TargetParam { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// parametro da impostare SE il check da esito EQUAL
|
||||
/// </summary>
|
||||
public int TargetValEqual { get; set; } = 0;
|
||||
/// <summary>
|
||||
/// parametro da impostare SE il check da esito NOT EQUAL
|
||||
/// </summary>
|
||||
public int TargetValNotEqual { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// Indica se vada disabilitato il contapezzi quando la condizione NotEqual sia soddisfatta
|
||||
/// </summary>
|
||||
public bool DisablePzCountNotEqual { get; set; } = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Classe gestione configurazione parametri specifici OPC-UA da BaseParamConf
|
||||
/// </summary>
|
||||
@@ -470,12 +449,6 @@ namespace IOB_UT_NEXT
|
||||
/// </summary>
|
||||
public diCheckCondSetup condError { get; set; } = new diCheckCondSetup();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Struttura dati x check condizione Errore
|
||||
/// </summary>
|
||||
public diCheckCondSetup condWorkOpc { get; set; } = new diCheckCondSetup();
|
||||
|
||||
/// <summary>
|
||||
/// Struttura dati x check condizione Emergenza
|
||||
/// </summary>
|
||||
@@ -496,6 +469,11 @@ namespace IOB_UT_NEXT
|
||||
/// </summary>
|
||||
public diCheckCondSetup condReady { get; set; } = new diCheckCondSetup();
|
||||
|
||||
/// <summary>
|
||||
/// Struttura dati x check condizione Setup
|
||||
/// </summary>
|
||||
public diCheckCondSetup condSetup { get; set; } = new diCheckCondSetup();
|
||||
|
||||
/// <summary>
|
||||
/// Struttura dati x check condizione WarmUp - CoolDown
|
||||
/// </summary>
|
||||
@@ -505,16 +483,19 @@ namespace IOB_UT_NEXT
|
||||
/// Struttura dati x check condizione Warning
|
||||
/// </summary>
|
||||
public diCheckCondSetup condWarning { get; set; } = new diCheckCondSetup();
|
||||
|
||||
/// <summary>
|
||||
/// Struttura dati x check condizione Setup
|
||||
/// Struttura dati x check condizione Errore
|
||||
/// </summary>
|
||||
public diCheckCondSetup condSetup { get; set; } = new diCheckCondSetup();
|
||||
public diCheckCondSetup condWorkOpc { get; set; } = new diCheckCondSetup();
|
||||
|
||||
/// <summary>
|
||||
/// Elenco dei NodeId da ignorare intesi come interi rami (se vuoto NON filtro)
|
||||
/// </summary>
|
||||
public List<string> filterItemsNodeId { get; set; } = new List<string>();
|
||||
|
||||
public UserIdent Identity { get; set; } = new UserIdent();
|
||||
|
||||
/// <summary>
|
||||
/// Aree di memoria lettura
|
||||
/// </summary>
|
||||
@@ -525,34 +506,66 @@ namespace IOB_UT_NEXT
|
||||
/// </summary>
|
||||
public Dictionary<string, dataConf> mMapWrite { get; set; } = new Dictionary<string, dataConf>();
|
||||
|
||||
/// <summary>
|
||||
/// Elenco dei SOLI item sottoscritti (se vuoto TUTTI)
|
||||
/// </summary>
|
||||
public List<string> subscribedItems { get; set; } = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// Elenco item RAW sottoscritti e relative configurazioni di decodifica da byte[]
|
||||
/// </summary>
|
||||
public Dictionary<string, string> rawSubscribedItemsConf { get; set; } = new Dictionary<string, string>();
|
||||
|
||||
/// <summary>
|
||||
/// Conf Gestione WatchDog
|
||||
/// </summary>
|
||||
public WatchDogConf WatchDog { get; set; } = new WatchDogConf();
|
||||
|
||||
/// <summary>
|
||||
/// Conf gestione setup macchina
|
||||
/// </summary>
|
||||
public MachineSetupConf SetupConf { get; set; } = new MachineSetupConf();
|
||||
|
||||
public UserIdent Identity { get; set; } = new UserIdent();
|
||||
/// <summary>
|
||||
/// Elenco dei SOLI item sottoscritti (se vuoto TUTTI)
|
||||
/// </summary>
|
||||
public List<string> subscribedItems { get; set; } = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// Conf Gestione WatchDog
|
||||
/// </summary>
|
||||
public WatchDogConf WatchDog { get; set; } = new WatchDogConf();
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
public class UserIdent
|
||||
{
|
||||
public string UserName { get; set; } = "";
|
||||
#region Public Properties
|
||||
|
||||
public string Passwd { get; set; } = "";
|
||||
public string UserName { get; set; } = "";
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Definizione parametri watchdog
|
||||
/// </summary>
|
||||
public class WatchDogConf
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Abilitazione WatchDog
|
||||
/// </summary>
|
||||
public bool IsEnabled { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Valore max contatore prima di resettare
|
||||
/// </summary>
|
||||
public int MaxVal { get; set; } = 9999;
|
||||
|
||||
/// <summary>
|
||||
/// Conf memoria x lettura WatchDog (ToMes), se !="" è gestito
|
||||
/// </summary>
|
||||
public string MemConfRead { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Conf memoria x scrittura WatchDog (FromMes), se !="" è gestito
|
||||
/// </summary>
|
||||
public string MemConfWrite { get; set; } = "";
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
+28
-35
@@ -1,4 +1,3 @@
|
||||
using MapoSDK;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -49,35 +48,6 @@ namespace IOB_UT_NEXT
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
#if false
|
||||
{
|
||||
get
|
||||
{
|
||||
return redisMan.servStatus.dtVetoPing;
|
||||
}
|
||||
set
|
||||
{
|
||||
var currData = redisMan.servStatus;
|
||||
currData.dtVetoPing = value;
|
||||
redisMan.servStatus = currData;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto WebClient BASE da riutilizzare
|
||||
/// </summary>
|
||||
protected static WebClientWT client { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto WebClient con PAYLOAD da riutilizzare
|
||||
/// </summary>
|
||||
protected static WebClientWT clientPayload { get; set; }
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
@@ -117,6 +87,7 @@ namespace IOB_UT_NEXT
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// formatta un numero in forma binaria 0/1
|
||||
/// </summary>
|
||||
@@ -409,7 +380,9 @@ namespace IOB_UT_NEXT
|
||||
/// number will be formatted as a 32-character binary number in two's compliment.
|
||||
/// </summary>
|
||||
/// <param name="theNumber">self-explanatory</param>
|
||||
/// <param name="minimumDigits">if binary number contains fewer characters leading zeros are added</param>
|
||||
/// <param name="minimumDigits">
|
||||
/// if binary number contains fewer characters leading zeros are added
|
||||
/// </param>
|
||||
/// <returns>string as described above</returns>
|
||||
public static string IntToBinStr(int theNumber, int minimumDigits)
|
||||
{
|
||||
@@ -420,7 +393,9 @@ namespace IOB_UT_NEXT
|
||||
/// verifica se un dato bit sia alzato (come flag di strobe)
|
||||
/// </summary>
|
||||
/// <param name="value">valore da testare</param>
|
||||
/// <param name="flag">valore cercato, può essere un singolo valore o un insieme in modalità AND</param>
|
||||
/// <param name="flag">
|
||||
/// valore cercato, può essere un singolo valore o un insieme in modalità AND
|
||||
/// </param>
|
||||
/// <returns></returns>
|
||||
public static bool IsSetAll(StFlag32 value, StFlag32 flag)
|
||||
{
|
||||
@@ -431,7 +406,9 @@ namespace IOB_UT_NEXT
|
||||
/// verifica se un dato bit sia alzato (come flag di strobe)
|
||||
/// </summary>
|
||||
/// <param name="value">valore da testare</param>
|
||||
/// <param name="flag">valore cercato, può essere un singolo valore o un insieme in modalità OR</param>
|
||||
/// <param name="flag">
|
||||
/// valore cercato, può essere un singolo valore o un insieme in modalità OR
|
||||
/// </param>
|
||||
/// <returns></returns>
|
||||
public static bool IsSetAny(StFlag32 value, StFlag32 flag)
|
||||
{
|
||||
@@ -586,7 +563,8 @@ namespace IOB_UT_NEXT
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// provvede a verificare la dim della cartella dei log e cancella i + vecchi fino a restare a dim inferiori a _logMaxMb
|
||||
/// provvede a verificare la dim della cartella dei log e cancella i + vecchi fino a restare
|
||||
/// a dim inferiori a _logMaxMb
|
||||
/// </summary>
|
||||
public static void shrinkDir(string dirPath)
|
||||
{
|
||||
@@ -616,7 +594,8 @@ namespace IOB_UT_NEXT
|
||||
// inizio con eliminare file + vecchi della data indicata...
|
||||
int maxLogDays = CRI("maxLogDays");
|
||||
fileMover.obj.deleteOlderThan(maxLogDays);
|
||||
// ora controllo SE sia superata la dim max della directory --> in tal caso cancello dal + vecchio...
|
||||
// ora controllo SE sia superata la dim max della directory --> in tal caso cancello dal
|
||||
// + vecchio...
|
||||
dirSizeMb = fileMover.obj.totalMb();
|
||||
int maxLogDirSize = CRI("maxLogDirSize");
|
||||
int maxTry = 100;
|
||||
@@ -723,6 +702,20 @@ namespace IOB_UT_NEXT
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto WebClient BASE da riutilizzare
|
||||
/// </summary>
|
||||
protected static WebClientWT client { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto WebClient con PAYLOAD da riutilizzare
|
||||
/// </summary>
|
||||
protected static WebClientWT clientPayload { get; set; }
|
||||
|
||||
#endregion Protected Properties
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="MapoSDK" version="6.14.2204.2616" targetFramework="net462" />
|
||||
<package id="MapoSDK" version="6.14.2205.2808" targetFramework="net462" />
|
||||
<package id="Microsoft.Bcl.AsyncInterfaces" version="6.0.0" targetFramework="net462" />
|
||||
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net462" />
|
||||
<package id="NLog" version="4.7.13" targetFramework="net462" />
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace IOB_UT_NEXT
|
||||
{
|
||||
internal class val
|
||||
{
|
||||
}
|
||||
}
|
||||
+172
-163
@@ -1,165 +1,174 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
|
||||
</startup>
|
||||
<appSettings>
|
||||
<add key="appName" value="IOB-WIN-NEXT" />
|
||||
<!--<add key="appVers" value="develop" />-->
|
||||
<add key="enableTest" value="true" />
|
||||
<add key="enableContapezzi" value="true" />
|
||||
<add key="enableMode" value="true" />
|
||||
<add key="enableOverrides" value="false" />
|
||||
<add key="enableTSVC" value="true" />
|
||||
<add key="enableDynData" value="false" />
|
||||
<add key="enableSysInfo" value="false" />
|
||||
<add key="enableAlarms" value="true" />
|
||||
<add key="doStartMemDump" value="false" />
|
||||
<add key="doSampleMemory" value="false" />
|
||||
<add key="basePrgMemPath" value="CNCMEMUSER" />
|
||||
<add key="pingMsTimeout" value="1500" />
|
||||
<add key="serverPingDisabled" value="false" />
|
||||
<add key="urlCallTOut" value="9999" />
|
||||
<add key="urlRandWait" value="200" />
|
||||
<!-- ciclo corto x invio a server: ms -->
|
||||
<add key="timerIntMs" value="10" />
|
||||
<add key="fastCount" value="20" />
|
||||
<add key="normCount" value="200" />
|
||||
<add key="slowCount" value="500" />
|
||||
<add key="verySlowCount" value="3000" />
|
||||
<add key="sampleMemCount" value="6000" />
|
||||
<add key="waitEndCycle" value="0" />
|
||||
<add key="comCheckTOut" value="10" />
|
||||
<!-- watchdog, ping, check disconnesso -->
|
||||
<add key="nMaxSend" value="10" />
|
||||
<add key="pingTestSec" value="5" />
|
||||
<add key="watchdogMaxSec" value="90" />
|
||||
<add key="disconMaxSec" value="30" />
|
||||
<add key="defIOB" value="2999" />
|
||||
<add key="pauseSendMSec" value="1000" />
|
||||
<!--gestione coda-->
|
||||
<add key="maxQueueFLog" value="16384" />
|
||||
<add key="maxQueueRawTransf" value="1024" />
|
||||
<!--gestione max num errori-->
|
||||
<add key="maxAliveErrors" value="1000" />
|
||||
<add key="maxSendErrors" value="100" />
|
||||
<add key="maxReadErrors" value="20" />
|
||||
<!--parametri SIM-->
|
||||
<add key="waitSimPar" value="30" />
|
||||
<!--<add key="waitSimPar" value="45" />-->
|
||||
<!--gestione REDIS-->
|
||||
<add key="RedisConn" value="localhost,abortConnect=false,ssl=false" />
|
||||
<add key="RedisConnAdmin" value="localhost,abortConnect=false,ssl=false" />
|
||||
<add key="redisDb" value="10" />
|
||||
<!--gestione invio dati in blocchi Json-->
|
||||
<add key="minJsonData" value="2" />
|
||||
<add key="maxJsonData" value="100" />
|
||||
<add key="maxJsonDataEv" value="25" />
|
||||
<!--gestione multithread-->
|
||||
<add key="sendDataByThread" value="false" />
|
||||
<!--Modalità DEMO: DemoOUT indica che NON invia davvero al server e DemoIN che simula e NON legge da PLC-->
|
||||
<add key="DemoIn" value="false" />
|
||||
<add key="DemoInSample" value="false" />
|
||||
<add key="DemoOut" value="false" />
|
||||
<!--definizione invio dati molto variabili-->
|
||||
<add key="SendAxPos" value="false" />
|
||||
<add key="SendFeedSpeed" value="false" />
|
||||
<!--Definizione avvio Adapter-->
|
||||
<add key="autoLoadConf" value="true" />
|
||||
<add key="autoStartOnLoad" value="true" />
|
||||
<add key="startMinimized" value="false" />
|
||||
<add key="windowCanMax" value="true" />
|
||||
<add key="trayClose" value="true" />
|
||||
<add key="autoSaveSec" value="60" />
|
||||
<add key="waitRecMSec" value="60000" />
|
||||
<add key="testCharSep" value="|" />
|
||||
<add key="delayShowLogMs" value="500" />
|
||||
<add key="vetoSeconds" value="5" />
|
||||
<!--conf file-->
|
||||
<add key="dataPath" value="DATA" />
|
||||
<add key="dataConfPath" value="DATA\CONF" />
|
||||
<add key="dataDatPath" value="DATA\DAT" />
|
||||
<add key="resxPath" value="Resources" />
|
||||
<add key="mainConfFile" value="MAIN.ini" />
|
||||
<add key="defaultPersLayerFile" value="PersistData.dat" />
|
||||
<add key="simDataFile" value="SimData.dat" />
|
||||
<add key="memDumpFile" value="MemoryDump.dat" />
|
||||
<add key="numSim" value="1" />
|
||||
<add key="MMapR" value="MMapR.map" />
|
||||
<add key="MMapW" value="MMapW.map" />
|
||||
<add key="AUpdAsAdm" value="true" />
|
||||
<add key="ConfToCloud" value="true" />
|
||||
<!--logging-->
|
||||
<add key="recTime" value="true" />
|
||||
<add key="verbose" value="false" />
|
||||
<add key="logEvery" value="100" />
|
||||
<add key="zipLogOldDay" value="1" />
|
||||
<add key="maxLogDirSize" value="300" />
|
||||
<add key="maxLogDays" value="120" />
|
||||
<add key="numRowConsole" value="50" />
|
||||
<add key="verboseLogTOut" value="60" />
|
||||
<!--conf x FANUC-->
|
||||
<add key="ClientSettingsProvider.ServiceUri" value="" />
|
||||
<add key="pzCountDelay" value="2000" />
|
||||
</appSettings>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<probing privatePath="lib;libs" />
|
||||
<probing privatePath="lib;libs" xmlns="" />
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Channels" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<system.web>
|
||||
<membership defaultProvider="ClientAuthenticationMembershipProvider">
|
||||
<providers>
|
||||
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
|
||||
</providers>
|
||||
</membership>
|
||||
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
|
||||
<providers>
|
||||
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
|
||||
</providers>
|
||||
</roleManager>
|
||||
</system.web>
|
||||
<system.serviceModel>
|
||||
<bindings>
|
||||
<basicHttpBinding>
|
||||
<binding name="OPENcontrol" />
|
||||
</basicHttpBinding>
|
||||
<netNamedPipeBinding>
|
||||
<binding name="NetNamedPipeBinding_ISizerService">
|
||||
<security mode="None" />
|
||||
</binding>
|
||||
</netNamedPipeBinding>
|
||||
<wsHttpBinding>
|
||||
<binding name="WSHttpBinding_ISizerService" maxReceivedMessageSize="2147483647">
|
||||
<security mode="None" />
|
||||
</binding>
|
||||
</wsHttpBinding>
|
||||
</bindings>
|
||||
<client>
|
||||
<endpoint address="http://192.168.20.2:8080" binding="basicHttpBinding" bindingConfiguration="OPENcontrol" contract="OpenControl.OPENcontrolPortType" name="OPENcontrol" />
|
||||
<endpoint address="http://localhost:8001/SizerService/" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ISizerService" contract="SizerService.ISizerService" name="WSHttpBinding_ISizerService" />
|
||||
<endpoint address="net.pipe://localhost/Compac/8001/SizerService" binding="netNamedPipeBinding" bindingConfiguration="NetNamedPipeBinding_ISizerService" contract="SizerService.ISizerService" name="NetNamedPipeBinding_ISizerService" />
|
||||
</client>
|
||||
</system.serviceModel>
|
||||
</configuration>
|
||||
<configSections>
|
||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||
</configSections>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
|
||||
</startup>
|
||||
<appSettings>
|
||||
<add key="appName" value="IOB-WIN-NEXT" />
|
||||
<!--<add key="appVers" value="develop" />-->
|
||||
<add key="enableTest" value="true" />
|
||||
<add key="enableContapezzi" value="true" />
|
||||
<add key="enableMode" value="true" />
|
||||
<add key="enableOverrides" value="false" />
|
||||
<add key="enableTSVC" value="true" />
|
||||
<add key="enableDynData" value="false" />
|
||||
<add key="enableSysInfo" value="false" />
|
||||
<add key="enableAlarms" value="true" />
|
||||
<add key="doStartMemDump" value="false" />
|
||||
<add key="doSampleMemory" value="false" />
|
||||
<add key="basePrgMemPath" value="CNCMEMUSER" />
|
||||
<add key="pingMsTimeout" value="1500" />
|
||||
<add key="serverPingDisabled" value="false" />
|
||||
<add key="urlCallTOut" value="9999" />
|
||||
<add key="urlRandWait" value="200" />
|
||||
<!-- ciclo corto x invio a server: ms -->
|
||||
<add key="timerIntMs" value="10" />
|
||||
<add key="fastCount" value="20" />
|
||||
<add key="normCount" value="200" />
|
||||
<add key="slowCount" value="500" />
|
||||
<add key="verySlowCount" value="3000" />
|
||||
<add key="sampleMemCount" value="6000" />
|
||||
<add key="waitEndCycle" value="0" />
|
||||
<add key="comCheckTOut" value="10" />
|
||||
<!-- watchdog, ping, check disconnesso -->
|
||||
<add key="nMaxSend" value="10" />
|
||||
<add key="pingTestSec" value="5" />
|
||||
<add key="watchdogMaxSec" value="90" />
|
||||
<add key="disconMaxSec" value="30" />
|
||||
<add key="defIOB" value="2999" />
|
||||
<add key="pauseSendMSec" value="1000" />
|
||||
<!--gestione coda-->
|
||||
<add key="maxQueueFLog" value="16384" />
|
||||
<add key="maxQueueRawTransf" value="1024" />
|
||||
<!--gestione max num errori-->
|
||||
<add key="maxAliveErrors" value="1000" />
|
||||
<add key="maxSendErrors" value="100" />
|
||||
<add key="maxReadErrors" value="20" />
|
||||
<!--parametri SIM-->
|
||||
<add key="waitSimPar" value="30" />
|
||||
<!--<add key="waitSimPar" value="45" />-->
|
||||
<!--gestione REDIS-->
|
||||
<add key="RedisConn" value="localhost,abortConnect=false,ssl=false" />
|
||||
<add key="RedisConnAdmin" value="localhost,abortConnect=false,ssl=false" />
|
||||
<add key="redisDb" value="10" />
|
||||
<!--gestione invio dati in blocchi Json-->
|
||||
<add key="minJsonData" value="2" />
|
||||
<add key="maxJsonData" value="100" />
|
||||
<add key="maxJsonDataEv" value="25" />
|
||||
<!--gestione multithread-->
|
||||
<add key="sendDataByThread" value="false" />
|
||||
<!--Modalità DEMO: DemoOUT indica che NON invia davvero al server e DemoIN che simula e NON legge da PLC-->
|
||||
<add key="DemoIn" value="false" />
|
||||
<add key="DemoInSample" value="false" />
|
||||
<add key="DemoOut" value="false" />
|
||||
<!--definizione invio dati molto variabili-->
|
||||
<add key="SendAxPos" value="false" />
|
||||
<add key="SendFeedSpeed" value="false" />
|
||||
<!--Definizione avvio Adapter-->
|
||||
<add key="autoLoadConf" value="true" />
|
||||
<add key="autoStartOnLoad" value="true" />
|
||||
<add key="startMinimized" value="false" />
|
||||
<add key="windowCanMax" value="true" />
|
||||
<add key="trayClose" value="true" />
|
||||
<add key="autoSaveSec" value="60" />
|
||||
<add key="waitRecMSec" value="60000" />
|
||||
<add key="testCharSep" value="|" />
|
||||
<add key="delayShowLogMs" value="500" />
|
||||
<add key="vetoSeconds" value="5" />
|
||||
<!--conf file-->
|
||||
<add key="dataPath" value="DATA" />
|
||||
<add key="dataConfPath" value="DATA\CONF" />
|
||||
<add key="dataDatPath" value="DATA\DAT" />
|
||||
<add key="resxPath" value="Resources" />
|
||||
<add key="mainConfFile" value="MAIN.ini" />
|
||||
<add key="defaultPersLayerFile" value="PersistData.dat" />
|
||||
<add key="simDataFile" value="SimData.dat" />
|
||||
<add key="memDumpFile" value="MemoryDump.dat" />
|
||||
<add key="numSim" value="1" />
|
||||
<add key="MMapR" value="MMapR.map" />
|
||||
<add key="MMapW" value="MMapW.map" />
|
||||
<add key="AUpdAsAdm" value="true" />
|
||||
<add key="ConfToCloud" value="true" />
|
||||
<!--logging-->
|
||||
<add key="recTime" value="true" />
|
||||
<add key="verbose" value="false" />
|
||||
<add key="logEvery" value="100" />
|
||||
<add key="zipLogOldDay" value="1" />
|
||||
<add key="maxLogDirSize" value="300" />
|
||||
<add key="maxLogDays" value="120" />
|
||||
<add key="numRowConsole" value="50" />
|
||||
<add key="verboseLogTOut" value="60" />
|
||||
<!--conf x FANUC-->
|
||||
<add key="ClientSettingsProvider.ServiceUri" value="" />
|
||||
<add key="pzCountDelay" value="2000" />
|
||||
</appSettings>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<probing privatePath="lib;libs" />
|
||||
<probing privatePath="lib;libs" xmlns="" />
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Channels" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<system.web>
|
||||
<membership defaultProvider="ClientAuthenticationMembershipProvider">
|
||||
<providers>
|
||||
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
|
||||
</providers>
|
||||
</membership>
|
||||
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
|
||||
<providers>
|
||||
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
|
||||
</providers>
|
||||
</roleManager>
|
||||
</system.web>
|
||||
<system.serviceModel>
|
||||
<bindings>
|
||||
<basicHttpBinding>
|
||||
<binding name="OPENcontrol" />
|
||||
</basicHttpBinding>
|
||||
<netNamedPipeBinding>
|
||||
<binding name="NetNamedPipeBinding_ISizerService">
|
||||
<security mode="None" />
|
||||
</binding>
|
||||
</netNamedPipeBinding>
|
||||
<wsHttpBinding>
|
||||
<binding name="WSHttpBinding_ISizerService" maxReceivedMessageSize="2147483647">
|
||||
<security mode="None" />
|
||||
</binding>
|
||||
</wsHttpBinding>
|
||||
</bindings>
|
||||
<client>
|
||||
<endpoint address="http://192.168.20.2:8080" binding="basicHttpBinding" bindingConfiguration="OPENcontrol" contract="OpenControl.OPENcontrolPortType" name="OPENcontrol" />
|
||||
<endpoint address="http://localhost:8001/SizerService/" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ISizerService" contract="SizerService.ISizerService" name="WSHttpBinding_ISizerService" />
|
||||
<endpoint address="net.pipe://localhost/Compac/8001/SizerService" binding="netNamedPipeBinding" bindingConfiguration="NetNamedPipeBinding_ISizerService" contract="SizerService.ISizerService" name="NetNamedPipeBinding_ISizerService" />
|
||||
</client>
|
||||
</system.serviceModel>
|
||||
<entityFramework>
|
||||
<providers>
|
||||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
||||
</providers>
|
||||
</entityFramework>
|
||||
</configuration>
|
||||
@@ -63,10 +63,12 @@ MIN_SEND_PZC_BLOCK=0
|
||||
MAX_SEND_PZC_BLOCK=100
|
||||
ENABLE_DYN_DATA=TRUE
|
||||
FORCE_DYN_DATA=TRUE
|
||||
DEM_FACT_DYN_DATA=3
|
||||
ENABLE_DATA_FILTER=TRUE
|
||||
ENABLE_CLI_RESTART=TRUE
|
||||
VETO_SIG_IN=TRUE
|
||||
|
||||
; clock base (da 10ms)
|
||||
timerIntMs=50
|
||||
|
||||
; conf parametri memoria READ/WRITE
|
||||
PARAM_CONF=GIACO_ICOEL_002.json
|
||||
|
||||
@@ -10,8 +10,8 @@ VENDOR=ICOEL
|
||||
MODEL=Impianto Ciliegie Turi
|
||||
|
||||
[CNC]
|
||||
IP=192.168.137.50
|
||||
PORT=8001
|
||||
IP=192.168.137.11
|
||||
PORT=1443
|
||||
GETPRGNAME=false
|
||||
|
||||
[SERVER]
|
||||
@@ -63,9 +63,12 @@ MIN_SEND_PZC_BLOCK=0
|
||||
MAX_SEND_PZC_BLOCK=100
|
||||
ENABLE_DYN_DATA=TRUE
|
||||
FORCE_DYN_DATA=TRUE
|
||||
DEM_FACT_DYN_DATA=5
|
||||
ENABLE_DATA_FILTER=TRUE
|
||||
ENABLE_CLI_RESTART=TRUE
|
||||
VETO_SIG_IN=TRUE
|
||||
SyncStateDb=localhost\sqlexpress
|
||||
SyncStateUser=egalware
|
||||
SyncStatePwd=egalware2022
|
||||
|
||||
; clock base (da 10ms)
|
||||
timerIntMs=10
|
||||
|
||||
@@ -79,6 +79,7 @@ CLI_INST=SteamWareSim
|
||||
;STARTLIST=VL25
|
||||
;STARTLIST=SIMUL_03
|
||||
;STARTLIST=GIACO_CEDAX_01
|
||||
STARTLIST=GIACO_ICOEL_002
|
||||
;STARTLIST=GIACO_ICOEL_002
|
||||
STARTLIST=GIACO_ICOEL_003
|
||||
|
||||
MAXCNC=10
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.props" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" />
|
||||
<Import Project="..\packages\Microsoft.CodeAnalysis.NetAnalyzers.6.0.0\build\Microsoft.CodeAnalysis.NetAnalyzers.props" Condition="Exists('..\packages\Microsoft.CodeAnalysis.NetAnalyzers.6.0.0\build\Microsoft.CodeAnalysis.NetAnalyzers.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
@@ -87,10 +88,10 @@
|
||||
<HintPath>..\packages\EasyModbusTCP.5.6.0\lib\net40\EasyModbus.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EgwProxy.Icoel, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EgwProxy.Icoel.3.6.2205.2617\lib\EgwProxy.Icoel.dll</HintPath>
|
||||
<HintPath>..\packages\EgwProxy.Icoel.3.6.2205.2812\lib\EgwProxy.Icoel.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EgwProxy.Icoel.DataLayer, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EgwProxy.Icoel.3.6.2205.2617\lib\EgwProxy.Icoel.DataLayer.dll</HintPath>
|
||||
<HintPath>..\packages\EgwProxy.Icoel.3.6.2205.2812\lib\EgwProxy.Icoel.DataLayer.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EgwProxy.MultiCncLib, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EgwProxy.MultiCncLib.3.6.2205.2319\lib\EgwProxy.MultiCncLib.dll</HintPath>
|
||||
@@ -101,12 +102,18 @@
|
||||
<Reference Include="EgwProxy.OsaiCncLib.XmlSerializers, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EgwProxy.OsaiCncLib.3.6.2205.2015\lib\EgwProxy.OsaiCncLib.XmlSerializers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="krcc, Version=0.0.0.0, Culture=neutral, processorArchitecture=x86">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>ExtLib\krcc.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MapoSDK, Version=6.14.2205.2808, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MapoSDK.6.14.2205.2808\lib\MapoSDK.dll</HintPath>
|
||||
<Reference Include="MapoSDK, Version=6.14.2205.3011, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MapoSDK.6.14.2205.3011\lib\MapoSDK.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MathNet.Numerics, Version=4.15.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MathNet.Numerics.4.15.0\lib\net461\MathNet.Numerics.dll</HintPath>
|
||||
@@ -147,6 +154,7 @@
|
||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Formats.Asn1, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
@@ -316,6 +324,12 @@
|
||||
<None Include="DATA\CONF\GIACO_ICOEL_002.ini">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="DATA\CONF\GIACO_ICOEL_003.ini">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="DATA\CONF\GIACO_ICOEL_003.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="DATA\CONF\GT594.ini">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
@@ -917,9 +931,12 @@
|
||||
<Error Condition="!Exists('..\packages\Microsoft.CodeAnalysis.NetAnalyzers.6.0.0\build\Microsoft.CodeAnalysis.NetAnalyzers.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeAnalysis.NetAnalyzers.6.0.0\build\Microsoft.CodeAnalysis.NetAnalyzers.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\Microsoft.VisualStudio.SlowCheetah.4.0.8\build\Microsoft.VisualStudio.SlowCheetah.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VisualStudio.SlowCheetah.4.0.8\build\Microsoft.VisualStudio.SlowCheetah.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\Selenium.WebDriver.ChromeDriver.101.0.4951.4100\build\Selenium.WebDriver.ChromeDriver.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Selenium.WebDriver.ChromeDriver.101.0.4951.4100\build\Selenium.WebDriver.ChromeDriver.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.props'))" />
|
||||
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\Selenium.Firefox.WebDriver.0.27.0\build\Selenium.Firefox.WebDriver.targets" Condition="Exists('..\packages\Selenium.Firefox.WebDriver.0.27.0\build\Selenium.Firefox.WebDriver.targets')" />
|
||||
<Import Project="..\packages\Microsoft.CodeAnalysis.NetAnalyzers.6.0.0\build\Microsoft.CodeAnalysis.NetAnalyzers.targets" Condition="Exists('..\packages\Microsoft.CodeAnalysis.NetAnalyzers.6.0.0\build\Microsoft.CodeAnalysis.NetAnalyzers.targets')" />
|
||||
<Import Project="..\packages\Microsoft.VisualStudio.SlowCheetah.4.0.8\build\Microsoft.VisualStudio.SlowCheetah.targets" Condition="Exists('..\packages\Microsoft.VisualStudio.SlowCheetah.4.0.8\build\Microsoft.VisualStudio.SlowCheetah.targets')" />
|
||||
<Import Project="..\packages\Selenium.WebDriver.ChromeDriver.101.0.4951.4100\build\Selenium.WebDriver.ChromeDriver.targets" Condition="Exists('..\packages\Selenium.WebDriver.ChromeDriver.101.0.4951.4100\build\Selenium.WebDriver.ChromeDriver.targets')" />
|
||||
<Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.targets" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" />
|
||||
</Project>
|
||||
+3494
-3456
File diff suppressed because it is too large
Load Diff
+132
-194
@@ -3,21 +3,22 @@ using IOB_UT_NEXT;
|
||||
using MapoSDK;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Diagnostics;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IOB_WIN_NEXT
|
||||
{ /// <summary>
|
||||
/// Adapter specializzato per ICOEL e le chiamate tramite DB per i dati
|
||||
/// - accettazione lotti prodotto (frontiera / entrata ciliegie)
|
||||
/// - export (totale per prodotti)
|
||||
/// - tracciabilità (confezioni
|
||||
/// </summary>
|
||||
{
|
||||
/// <summary>
|
||||
/// Adapter specializzato per ICOEL e le chiamate tramite DB per i dati
|
||||
/// - accettazione lotti prodotto (frontiera / entrata ciliegie)
|
||||
/// - export (totale per prodotti)
|
||||
/// - tracciabilità (confezioni
|
||||
/// </summary>
|
||||
|
||||
public class IobIcoelDb : IobGeneric
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Costruttore dell'IOB Icoel DB
|
||||
/// </summary>
|
||||
@@ -31,82 +32,19 @@ namespace IOB_WIN_NEXT
|
||||
* - init obj comunicazione da conf e nuget
|
||||
* - lanciare sync e verifica stato sync
|
||||
*/
|
||||
string connEntrataFrontiera = utils.CRS("EntrataFrontiera");
|
||||
string connTrackerLotti = utils.CRS("TrackerLotti");
|
||||
string connExportIcoel = utils.CRS("ExportIcoel");
|
||||
string connSyncState = utils.CRS("SyncState");
|
||||
|
||||
dbProxy = new DbProxy(connEntrataFrontiera, connTrackerLotti, connExportIcoel, connSyncState);
|
||||
string SyncStateDb = getOptPar("SyncStateDb");
|
||||
string SyncStateUser = getOptPar("SyncStateUser");
|
||||
string SyncStatePwd = getOptPar("SyncStatePwd");
|
||||
|
||||
string connSyncState = $"data source={SyncStateDb};initial catalog=MoonPro_ISF;persist security info=True;user id={SyncStateUser};password={SyncStatePwd};MultipleActiveResultSets=True;App=IOB-WIN-NEXT";
|
||||
|
||||
// eccezione: NON TROVA EntityFramework 6.0.0 o successivo... why?!?
|
||||
dbProxy = new DbProxy(connSyncState);
|
||||
|
||||
lastPING = DateTime.Now.AddHours(-1);
|
||||
}
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Effettua lettura semafori principale
|
||||
/// <paramref name="currDispData">Parametri da aggiornare x display in form</paramref>
|
||||
/// </summary>
|
||||
public override void readSemafori(ref newDisplayData currDispData)
|
||||
{
|
||||
if (connectionOk)
|
||||
{
|
||||
B_input = 1;
|
||||
currDispData.semIn = Semaforo.SV;
|
||||
#if false
|
||||
if (currBatchList == null)
|
||||
{
|
||||
// se nullo --> provo a leggere!
|
||||
|
||||
var currBatch = IcoelSizer.GetCurrentBatch();
|
||||
if (currBatch != null)
|
||||
{
|
||||
currBatchList = currBatch;
|
||||
// accodo invio!
|
||||
string rawBatch = JsonConvert.SerializeObject(currBatch);
|
||||
accodaRawData(IOB_UT_NEXT.rawTransfType.IcoelBatch, currBatch);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// se ho batch NON chiusi (data = minValue) allora lavora
|
||||
if (currBatchList[1].EndTime == DateTime.MinValue || currBatchList[1].EndTime == DateTime.MinValue)
|
||||
{
|
||||
B_input = 3;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
B_input = 0;
|
||||
currDispData.semIn = Semaforo.SR;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupero dati dinamici...
|
||||
/// </summary>
|
||||
public override Dictionary<string, string> getDynData()
|
||||
{
|
||||
// valore non presente in vers default... se gestito fare override
|
||||
Dictionary<string, string> outVal = new Dictionary<string, string>();
|
||||
|
||||
// mettere conteggio dei record trasferiti?!?
|
||||
#if false
|
||||
// recupero da libreria il dizionario dei performance parameters...
|
||||
var perfParamDict = IcoelSizer.GetPerfMeters();
|
||||
foreach (var item in perfParamDict)
|
||||
{
|
||||
saveValue(ref outVal, item.Value, item.Key);
|
||||
}
|
||||
|
||||
#endif
|
||||
lastReadPLC = DateTime.Now;
|
||||
return outVal;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
@@ -118,18 +56,63 @@ namespace IOB_WIN_NEXT
|
||||
/// <returns></returns>
|
||||
public override Dictionary<string, string> executeTasks(Dictionary<string, string> 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?)
|
||||
*
|
||||
*---------------------------------------*/
|
||||
// unico task ammissibile: fare un SYNC forzato...
|
||||
Dictionary<string, string> taskDone = new Dictionary<string, string>();
|
||||
if (task2exe != null)
|
||||
{
|
||||
// controllo se memMap != null...
|
||||
if (memMap != null)
|
||||
{
|
||||
bool taskOk = false;
|
||||
string taskVal = "";
|
||||
// cerco task specifici: se ho startSetup --> imposto bit DBB701.DBB0.4
|
||||
foreach (var item in task2exe)
|
||||
{
|
||||
taskOk = false;
|
||||
taskVal = "";
|
||||
// converto richiesta in enum...
|
||||
taskType tName = taskType.nihil;
|
||||
Enum.TryParse(item.Key, out tName);
|
||||
// controllo sulla KEY...
|
||||
switch (tName)
|
||||
{
|
||||
case taskType.syncDbData:
|
||||
lgInfo($"executeTasks --> syncDbData");
|
||||
// effettua sync
|
||||
refreshElencoStati();
|
||||
|
||||
return base.executeTasks(task2exe);
|
||||
break;
|
||||
|
||||
default:
|
||||
taskVal = $"IobIcoelDb | taskReq: {tName} | key: {item.Key} | val: {item.Value} | SKIPPED | NO EXEC";
|
||||
lgInfo($"IobIcoelDb | chiamata senza processing: taskOk: {taskOk} | taskVal: {taskVal}");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
lastReadPLC = DateTime.Now;
|
||||
return taskDone;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupero dati dinamici...
|
||||
/// </summary>
|
||||
public override Dictionary<string, string> getDynData()
|
||||
{
|
||||
// valore non presente in vers default... se gestito fare override
|
||||
Dictionary<string, string> outVal = new Dictionary<string, string>();
|
||||
// recupero da DB locale stato sync attuale
|
||||
var elencoSyncStateCurr = dbProxy.DataController.SyncStateGetAll();
|
||||
foreach (var item in elencoSyncStateCurr)
|
||||
{
|
||||
saveValue(ref outVal, item.NumRec, $"{item.TableName}_NumRec");
|
||||
saveValue(ref outVal, item.NumRecIn, $"{item.TableName}_NumRecIn");
|
||||
saveValue(ref outVal, item.LastIdx, $"{item.TableName}_LastIdx");
|
||||
saveValue(ref outVal, item.LastIdxIn, $"{item.TableName}_LastIdxIn");
|
||||
}
|
||||
lastReadPLC = DateTime.Now;
|
||||
return outVal;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -140,76 +123,37 @@ namespace IOB_WIN_NEXT
|
||||
public override void processCustomTaskLF()
|
||||
{
|
||||
lgInfo($"Richiesto processCustomTaskLF");
|
||||
|
||||
// fare processing DB secondo il seguente scehma:
|
||||
|
||||
/*
|
||||
*
|
||||
EgwProxy.Icoel.DbProxy dbProxy = new DbProxy(ReadSetting("EntrataFrontiera"), ReadSetting("TrackerLotti"), ReadSetting("ExportIcoel"), ReadSetting("SyncState"));
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("--- SyncState ---");
|
||||
bool needRedo = true;
|
||||
var elencoSyncState = dbProxy.DataController.SyncStateGetAll();
|
||||
while (needRedo)
|
||||
{
|
||||
Console.WriteLine(" --- PRE --- ");
|
||||
if (elencoSyncState != null)
|
||||
{
|
||||
foreach (var item in elencoSyncState)
|
||||
{
|
||||
Console.WriteLine($"TAB: {item.TableName} | IdxIN / IdxLocal {item.LastIdxIn} / {item.LastIdx} | NumIn / NumLocal {item.NumRecIn} / {item.NumRec}");
|
||||
// verifico se serva redo..
|
||||
}
|
||||
}
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Premere un tasto x continuare...");
|
||||
Console.ReadKey();
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
elencoSyncState = dbProxy.DataController.SyncStateDoImportAll();
|
||||
sw.Stop();
|
||||
Console.WriteLine($" process time: {sw.ElapsedMilliseconds} ms ");
|
||||
Console.WriteLine(" --- POST --- ");
|
||||
if (elencoSyncState != null)
|
||||
{
|
||||
foreach (var item in elencoSyncState)
|
||||
{
|
||||
Console.WriteLine($"TAB: {item.TableName} | IdxIN / IdxLocal {item.LastIdxIn} / {item.LastIdx} | NumIn / NumLocal {item.NumRecIn} / {item.NumRec}");
|
||||
// verifico se serva redo..
|
||||
}
|
||||
}
|
||||
// processo
|
||||
needRedo = testNeedRedo(elencoSyncState);
|
||||
}
|
||||
*
|
||||
*
|
||||
* */
|
||||
|
||||
#if false
|
||||
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 = doSend || (currBatchList[item.Key].Id != item.Value.Id);
|
||||
}
|
||||
}
|
||||
// se devo inviare impacchetto dati
|
||||
if (doSend)
|
||||
{
|
||||
accodaRawData(IOB_UT_NEXT.rawTransfType.IcoelBatch, currBatch);
|
||||
currBatchList = currBatch;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// effettua sync
|
||||
refreshElencoStati();
|
||||
lastReadPLC = DateTime.Now;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua lettura semafori principale <paramref name="currDispData">Parametri da
|
||||
/// aggiornare x display in form</paramref>
|
||||
/// </summary>
|
||||
public override void readSemafori(ref newDisplayData currDispData)
|
||||
{
|
||||
if (connectionOk)
|
||||
{
|
||||
B_input = 1;
|
||||
currDispData.semIn = Semaforo.SV;
|
||||
|
||||
if (dbProxy != null && elencoSyncState != null && elencoSyncState.Count > 0)
|
||||
{
|
||||
B_input += (1 << 1);
|
||||
}
|
||||
|
||||
// accodo NON emergenza
|
||||
B_input += (1 << 7);
|
||||
}
|
||||
else
|
||||
{
|
||||
B_input = 0;
|
||||
currDispData.semIn = Semaforo.SR;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Override connessione
|
||||
/// </summary>
|
||||
@@ -234,16 +178,16 @@ namespace IOB_WIN_NEXT
|
||||
{
|
||||
// ora provo connessione...
|
||||
parentForm.commPlcActive = true;
|
||||
#if false
|
||||
// recupero elenco batch... se != vuoto -_> connesso!
|
||||
var batchList = IcoelSizer.GetCurrentBatch();
|
||||
if (batchList != null && batchList.Count > 0)
|
||||
if (dbProxy != null)
|
||||
{
|
||||
lgInfo($"szStatusConnection IcoelSoap, recuperato elenco di {batchList.Count} batch");
|
||||
parentForm.commPlcActive = false;
|
||||
connectionOk = true;
|
||||
}
|
||||
#endif
|
||||
elencoSyncState = dbProxy.DataController.SyncStateDoImportAll();
|
||||
|
||||
if (elencoSyncState != null && elencoSyncState.Count > 0)
|
||||
{
|
||||
parentForm.commPlcActive = false;
|
||||
connectionOk = true;
|
||||
}
|
||||
}
|
||||
// refresh stato connessione!!!
|
||||
if (connectionOk)
|
||||
{
|
||||
@@ -291,40 +235,34 @@ namespace IOB_WIN_NEXT
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// elenco dei BAtch correntemente caricati x testing variazione
|
||||
/// </summary>
|
||||
protected Dictionary<int, Batch> currBatchList { get; set; }
|
||||
#endif
|
||||
protected EgwProxy.Icoel.DbProxy dbProxy { get; set; } = null;
|
||||
|
||||
protected EgwProxy.Icoel.DbProxy dbProxy { get; set; }
|
||||
/// <summary>
|
||||
/// Stato di sync delle tab gestite
|
||||
/// </summary>
|
||||
protected List<EgwProxy.Icoel.DataLayer.DatabaseModels.SyncStateModel> elencoSyncState { get; set; } = new List<EgwProxy.Icoel.DataLayer.DatabaseModels.SyncStateModel>();
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// recupera le variety ed i rispettivi layout e li invia al sistema MP/IO
|
||||
/// </summary>
|
||||
protected void refreshVarietyData()
|
||||
private void refreshElencoStati()
|
||||
{
|
||||
#if false
|
||||
///determina se recuperare SOLO varietà attive o tutte
|
||||
bool soloAttive = false;
|
||||
var varList = IcoelSizer.GetVarietyList(soloAttive);
|
||||
if (varList != null && varList.Length > 0)
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
elencoSyncState = dbProxy.DataController.SyncStateDoImportAll();
|
||||
sw.Stop();
|
||||
lgInfo($"DB: esecuzione task dbProxy.DataController.SyncStateGetAll() in {sw.ElapsedMilliseconds} ms");
|
||||
|
||||
if (elencoSyncState != null)
|
||||
{
|
||||
var varietyData = IcoelSizer.GetLayoutForVarietyList(varList);
|
||||
// invio dai al server IO
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
lastReadPLC = DateTime.Now;
|
||||
foreach (var item in elencoSyncState)
|
||||
{
|
||||
lgTrace($"TAB: {item.TableName} | IdxIN / IdxLocal {item.LastIdxIn} / {item.LastIdx} | NumIn / NumLocal {item.NumRecIn} / {item.NumRec}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,8 @@
|
||||
using EgwProxy.Icoel.SizerService;
|
||||
using IOB_UT_NEXT;
|
||||
using MapoSDK;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.NetworkInformation;
|
||||
|
||||
namespace IOB_WIN_NEXT
|
||||
@@ -44,65 +42,6 @@ namespace IOB_WIN_NEXT
|
||||
lastPING = DateTime.Now.AddHours(-1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua lettura semafori principale
|
||||
/// <paramref name="currDispData">Parametri da aggiornare x display in form</paramref>
|
||||
/// </summary>
|
||||
public override void readSemafori(ref newDisplayData currDispData)
|
||||
{
|
||||
if (connectionOk)
|
||||
{
|
||||
B_input = 1;
|
||||
currDispData.semIn = Semaforo.SV;
|
||||
if (currBatchList == null)
|
||||
{
|
||||
// se nullo --> provo a leggere!
|
||||
|
||||
var currBatch = IcoelSizer.GetCurrentBatch();
|
||||
if (currBatch != null)
|
||||
{
|
||||
currBatchList = currBatch;
|
||||
#if false
|
||||
// accodo invio!
|
||||
string rawBatch = JsonConvert.SerializeObject(currBatch);
|
||||
#endif
|
||||
accodaRawData(IOB_UT_NEXT.rawTransfType.IcoelBatch, currBatch);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupero dati dinamici...
|
||||
/// </summary>
|
||||
public override Dictionary<string, string> getDynData()
|
||||
{
|
||||
// valore non presente in vers default... se gestito fare override
|
||||
Dictionary<string, string> outVal = new Dictionary<string, string>();
|
||||
// recupero da libreria il dizionario dei performance parameters...
|
||||
var perfParamDict = IcoelSizer.GetPerfMeters();
|
||||
foreach (var item in perfParamDict)
|
||||
{
|
||||
saveValue(ref outVal, item.Value, item.Key);
|
||||
}
|
||||
|
||||
lastReadPLC = DateTime.Now;
|
||||
return outVal;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
@@ -128,6 +67,30 @@ namespace IOB_WIN_NEXT
|
||||
return base.executeTasks(task2exe);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dizionario parametri correnti
|
||||
/// </summary>
|
||||
protected Dictionary<string, double> perfParamDict { get; set; } = new Dictionary<string, double>();
|
||||
|
||||
/// <summary>
|
||||
/// Recupero dati dinamici...
|
||||
/// </summary>
|
||||
public override Dictionary<string, string> getDynData()
|
||||
{
|
||||
// valore non presente in vers default... se gestito fare override
|
||||
Dictionary<string, string> outVal = new Dictionary<string, string>();
|
||||
// recupero da libreria il dizionario dei performance parameters...
|
||||
perfParamDict = IcoelSizer.GetPerfMeters();
|
||||
lgTrace("SOAP: effettuata chiamata IcoelSizer.GetPerfMeters()");
|
||||
foreach (var item in perfParamDict)
|
||||
{
|
||||
saveValue(ref outVal, item.Value, item.Key);
|
||||
}
|
||||
|
||||
lastReadPLC = DateTime.Now;
|
||||
return outVal;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua processing CUSTOM x Icoel:
|
||||
/// - recupera elenco batch delle 2 linee
|
||||
@@ -137,6 +100,7 @@ namespace IOB_WIN_NEXT
|
||||
{
|
||||
lgInfo($"Richiesto processCustomTaskLF");
|
||||
var currBatch = IcoelSizer.GetCurrentBatch();
|
||||
lgTrace("SOAP: effettuata chiamata IcoelSizer.GetCurrentBatch()");
|
||||
if (currBatch != null)
|
||||
{
|
||||
// verifico se i batch siano variati... e quindi da inviare...
|
||||
@@ -152,12 +116,7 @@ namespace IOB_WIN_NEXT
|
||||
// se devo inviare impacchetto dati
|
||||
if (doSend)
|
||||
{
|
||||
#if false
|
||||
// accodo per invio...
|
||||
string rawBatch = JsonConvert.SerializeObject(currBatch);
|
||||
accodaRawData(IOB_UT_NEXT.rawTransfType.IcoelBatch, rawBatch);
|
||||
#endif
|
||||
accodaRawData(IOB_UT_NEXT.rawTransfType.IcoelBatch, currBatch);
|
||||
accodaRawData(rawTransfType.IcoelBatch, currBatch);
|
||||
currBatchList = currBatch;
|
||||
}
|
||||
}
|
||||
@@ -165,6 +124,65 @@ namespace IOB_WIN_NEXT
|
||||
lastReadPLC = DateTime.Now;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua lettura semafori principale <paramref name="currDispData">Parametri da
|
||||
/// aggiornare x display in form</paramref>
|
||||
/// </summary>
|
||||
public override void readSemafori(ref newDisplayData currDispData)
|
||||
{
|
||||
if (connectionOk)
|
||||
{
|
||||
B_input = 1;
|
||||
currDispData.semIn = Semaforo.SV;
|
||||
if (currBatchList == null)
|
||||
{
|
||||
// se nullo --> provo a leggere!
|
||||
var currBatch = IcoelSizer.GetCurrentBatch();
|
||||
lgTrace("SOAP: effettuata chiamata IcoelSizer.GetCurrentBatch()");
|
||||
if (currBatch != null)
|
||||
{
|
||||
currBatchList = currBatch;
|
||||
accodaRawData(rawTransfType.IcoelBatch, currBatch);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//se i perf parameters mi danno valire > 0 x quantità frutta...
|
||||
if (perfParamDict != null && perfParamDict.Count > 0)
|
||||
{
|
||||
if (perfParamDict.ContainsKey("VelFruttiMinuto"))
|
||||
{
|
||||
if (perfParamDict["VelFruttiMinuto"] > 0)
|
||||
{
|
||||
B_input += (1 << 1);
|
||||
}
|
||||
// metto manuale
|
||||
else
|
||||
{
|
||||
B_input += (1 << 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//usato altro criterio x stato verde da vel frutti minuto
|
||||
#if false
|
||||
// se ho batch NON chiusi (data = minValue) allora lavora
|
||||
if (currBatchList[1].EndTime == DateTime.MinValue || currBatchList[1].EndTime == DateTime.MinValue)
|
||||
{
|
||||
B_input = 3;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
// accodo NON emergenza
|
||||
B_input += (1 << 7);
|
||||
}
|
||||
else
|
||||
{
|
||||
B_input = 0;
|
||||
currDispData.semIn = Semaforo.SR;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Override connessione
|
||||
/// </summary>
|
||||
@@ -191,6 +209,7 @@ namespace IOB_WIN_NEXT
|
||||
parentForm.commPlcActive = true;
|
||||
// recupero elenco batch... se != vuoto -_> connesso!
|
||||
var batchList = IcoelSizer.GetCurrentBatch();
|
||||
lgTrace("SOAP: effettuata chiamata IcoelSizer.GetCurrentBatch()");
|
||||
if (batchList != null && batchList.Count > 0)
|
||||
{
|
||||
lgInfo($"szStatusConnection IcoelSoap, recuperato elenco di {batchList.Count} batch");
|
||||
@@ -263,11 +282,11 @@ namespace IOB_WIN_NEXT
|
||||
///determina se recuperare SOLO varietà attive o tutte
|
||||
bool soloAttive = false;
|
||||
var varList = IcoelSizer.GetVarietyList(soloAttive);
|
||||
lgTrace("SOAP: effettuata chiamata IcoelSizer.GetVarietyList()");
|
||||
if (varList != null && varList.Length > 0)
|
||||
{
|
||||
var varietyData = IcoelSizer.GetLayoutForVarietyList(varList);
|
||||
// invio dai al server IO
|
||||
|
||||
lgTrace("SOAP: effettuata chiamata IcoelSizer.GetLayoutForVarietyList()");
|
||||
}
|
||||
|
||||
lastReadPLC = DateTime.Now;
|
||||
|
||||
@@ -415,7 +415,7 @@ namespace IOB_WIN_NEXT
|
||||
B_input = powerOnOk ? 1 : 0;
|
||||
|
||||
// decodifico da currData
|
||||
if (currData.Varie.InEmergenza)
|
||||
if (!currData.Varie.InEmergenza)
|
||||
{
|
||||
B_input += (1 << 7);
|
||||
}
|
||||
@@ -427,6 +427,7 @@ namespace IOB_WIN_NEXT
|
||||
{
|
||||
B_input += (1 << 3);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// controllo se sono poweroff e se non ho dati buoni da > 2 minuti --> disconnetto
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
<packages>
|
||||
<package id="Autoupdater.NET.Official" version="1.7.0" targetFramework="net462" />
|
||||
<package id="EasyModbusTCP" version="5.6.0" targetFramework="net462" />
|
||||
<package id="EgwProxy.Icoel" version="3.6.2205.2617" targetFramework="net462" />
|
||||
<package id="EgwProxy.Icoel" version="3.6.2205.2812" targetFramework="net462" />
|
||||
<package id="EgwProxy.MultiCncLib" version="3.6.2205.2319" targetFramework="net462" />
|
||||
<package id="EgwProxy.OsaiCncLib" version="3.6.2205.2015" targetFramework="net462" />
|
||||
<package id="MapoSDK" version="6.14.2204.2616" targetFramework="net462" />
|
||||
<package id="MapoSDK" version="6.14.2205.3011" targetFramework="net462" />
|
||||
<package id="EntityFramework" version="6.4.4" targetFramework="net462" />
|
||||
<package id="MathNet.Numerics" version="4.15.0" targetFramework="net462" />
|
||||
<package id="Microsoft.CodeAnalysis.NetAnalyzers" version="6.0.0" targetFramework="net462" developmentDependency="true" />
|
||||
<package id="Microsoft.VisualStudio.SlowCheetah" version="4.0.8" targetFramework="net462" developmentDependency="true" />
|
||||
|
||||
Reference in New Issue
Block a user