Gestione Configurazione gerarchica: modifiche preliminari are IOB-UT

This commit is contained in:
Samuele Locatelli
2025-02-13 12:07:26 +01:00
parent faca458b57
commit d730a6dec6
35 changed files with 1679 additions and 502 deletions
+29
View File
@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static IOB_UT_NEXT.BaseAlarmConf;
namespace IOB_UT_NEXT.Config.Base
{
public class AlarmDto
{
/// <summary>
/// Livello minimo allarmi da considerare x invio
/// </summary>
public AlarmLevel alarmLevelMin = AlarmLevel.Alarm;
/// <summary>
/// Struttura allarmi mappati
/// </summary>
public List<BaseAlarmConf> AlarmMaps = new List<BaseAlarmConf>();
/// <summary>
/// Tipo di allarmi gestiti
/// rif: BaseAlarmConf.AlarmBlockType.[Bitmap/ActiveList]
/// </summary>
public AlarmBlockType alarmType = AlarmBlockType.Bitmap;
}
}
+85
View File
@@ -0,0 +1,85 @@
using System.Collections.Generic;
using System.Linq;
namespace IOB_UT_NEXT.Config.Base
{
/// <summary>
/// Set comandi URI x chiamate server
/// </summary>
public class CmdUriDto
{
#region Public Constructors
/// <summary>
/// Init classe gestione comandi
/// </summary>
/// <param name="baseURI"></param>
public CmdUriDto(string baseURI)
{
BaseUri = baseURI;
}
#endregion Public Constructors
#region Public Properties
/// <summary>
/// comando base x USER LOG - salvataggio parametri extra sistema MAPO
/// </summary>
public string ULog { get; set; } = "IOB/ulog/";
/// <summary>
/// comando base x USER LOG - salvataggio parametri extra sistema MAPO in modalità JSON
/// payload come lista
/// </summary>
public string ULogJson { get; set; } = "IOB/ulogJson/";
#endregion Public Properties
#region Public Methods
/// <summary>
/// Recupera path/URI comando richiesto (SE disponibile) senno default
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public string GetCommand(string key)
{
// default ad implicito...
string answ = $"{BaseUri}/{key}/";
if (CurrSetup.ContainsKey(key))
{
answ = CurrSetup[key];
}
return answ;
}
public Dictionary<string, string> StdCommands()
{
CurrSetup = new Dictionary<string, string>();
CurrSetup.Add("Alive", "IOB");
CurrSetup.Add("Base", "IOB/input/");
CurrSetup.Add("BaseJson", "IOB/evListJson/");
CurrSetup.Add("RawTransfJson", "IOB/rawTransfJson/");
CurrSetup.Add("Enabled", "IOB/enabled/");
CurrSetup.Add("Flog", "IOB/flog/");
CurrSetup.Add("FlogJson", "IOB/flogJson/");
CurrSetup.Add("ForcleSplitOdl", "IOB/forceSplitOdlFull/");
CurrSetup.Add("IdleTime", "IOB/getIdlePeriod/");
CurrSetup.Add("OdlStarted", "IOB/getCurrOdlStart/");
CurrSetup.Add("Reboot", "IOB/sendReboot.aspx?idxMacchina=/");
// riordino
CurrSetup = CurrSetup.OrderBy(x => x.Key).ToDictionary(x => x.Key, x => x.Value);
return CurrSetup;
}
#endregion Public Methods
#region Protected Properties
protected string BaseUri { get; set; } = "IOB";
protected Dictionary<string, string> CurrSetup { get; set; } = new Dictionary<string, string>();
#endregion Protected Properties
}
}
+30
View File
@@ -0,0 +1,30 @@
using IOB_UT_NEXT.Config.Special;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IOB_UT_NEXT.Config.Base
{
/// <summary>
/// Definizione parametri Macchina / CN / PLC
/// </summary>
public class ConnectionDto
{
/// <summary>
/// Indirizzo Ip del CNC Controllato
/// </summary>
public string IpAddr { get; set; } = "127.0.0.1";
/// <summary>
/// Porta del CNC Controllato
/// </summary>
public string Port { get; set; } = "0";
/// <summary>
/// Timeout test PING
/// </summary>
public int pingMsTimeout { get; set; } = 500;
}
}
+15
View File
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IOB_UT_NEXT.Config.Base
{
/// <summary>
/// Dati relativi al cliente
/// </summary>
public class CustomerDto
{
}
}
+45
View File
@@ -0,0 +1,45 @@
using IOB_UT_NEXT.Config.Special;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IOB_UT_NEXT.Config.Base
{
/// <summary>
/// Dati espliciti relativi al device di riferimento
/// </summary>
public class DeviceDto
{
/// <summary>
/// Costruttore
/// </summary>
public string Vendor { get; set; } = "ACME";
/// <summary>
/// Codice modello
/// </summary>
public string Model { get; set; } = "NONE";
/// <summary>
/// Dati configurazione CNC
/// </summary>
public ConnectionDto ConnectConf { get; set; } = new ConnectionDto();
/// <summary>
/// Configurazione SignalLUT con regole decodifica valori (es FANUC/Siemens con BIT0...BIT7...)
/// </summary>
public Dictionary<string, string> SignalLUT { get; set; } = new Dictionary<string, string>();
/// <summary>
/// Configurazione specifica FANUC (se applicabile)
/// </summary>
public FanucDto FanucConf { get; set; }
/// <summary>
/// Configurazione specifica Siemens (se applicabile)
/// </summary>
public SiemensDto SiemensConf { get; set; }
}
}
+16
View File
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IOB_UT_NEXT.Config.Base
{
/// <summary>
/// Configurazione specifica per gestione Dossiers
/// (es Baglietto - TravelLift Cimolai)
/// </summary>
public class DossiersDto
{
}
}
+28
View File
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IOB_UT_NEXT.Config.Base
{
/// <summary>
/// Configurazioni specifiche per segnali ingresso (tipicamente gestione blink)
/// </summary>
public class InputSignalDto
{
/// <summary>
/// Maschera di filtro blink, INT corrispondente ai BIT da filtrare, ad es
/// 11111111 = 255
/// 00010110 = 22
/// 00000111 = 7
/// </summary>
public int BlinkFilterMask { get; set; } = 0;
/// <summary>
/// Numero di cicli per cui effettuare il mascheramento dei valori (sul fronte di discesa)
/// </summary>
public int BlinkMaxCounter { get; set; } = 10;
}
}
+61
View File
@@ -0,0 +1,61 @@
using IOB_UT_NEXT.Config.Special;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IOB_UT_NEXT.Config.Base
{
/// <summary>
/// Info specifice all'IOB
/// </summary>
public class IobDto
{
/// <summary>
/// Nome file di configurazione
/// </summary>
public string ConfFileName { get; set; } = "";
/// <summary>
/// Tipo Adapter specifico (implementazione)
/// </summary>
public tipoAdapter IobType { get; set; } = tipoAdapter.ND;
/// <summary>
/// Codice Cliente/Installazione
/// </summary>
public string Customer { get; set; } = "SteamWare";
/// <summary>
/// Codice univoco IOB
/// </summary>
public string CodIOB { get; set; } = "ND";
/// <summary>
/// Valore minimo (delta) in sec x considerare variazioni info
/// </summary>
public int MinDeltaSec { get; set; } = 5;
/// <summary>
/// Abilita salvataggio coda eventi su redis (ritentiva)
/// </summary>
public bool EnableRedisQueue { get; set; } = true;
/// <summary>
/// Indica che sono disabilitati i Task2Exe (tipicamente gestione scrittura verso PLC)
/// </summary>
public bool DisableExeTask { get; set; } = false;
/// <summary>
/// Indica che sono disabilitate le fasi controllo stato/semafori (tipicamente x impianti
/// con PLC "suddivisi", PLC + HMI)
/// </summary>
public bool DisableStateCh { get; set; } = false;
/// <summary>
/// Versione software IOB
/// </summary>
public string ReleaseVers { get; set; } = "0.0.0.0";
}
}
+20
View File
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IOB_UT_NEXT.Config.Base
{
/// <summary>
/// Setup comunicazione con IOB-MAN tramite REDIS
/// </summary>
public class IobManDto
{
/// <summary>
/// Minimo delta in sec x considerare variazioni informazioni inviate ad IOB-MAN via redis
/// </summary>
public int MinDeltaSec { get; set; } = 2;
}
}
+41
View File
@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IOB_UT_NEXT.Config.Base
{
/// <summary>
/// Parametri specifici gestione ODL:
/// - AutoOdl
/// - Split
/// </summary>
public class OdlDto
{
/// <summary>
/// Gestione automatica del cambio ODL
/// </summary>
public bool AutoChangeOdl { get; set; } = false;
/// <summary>
/// Modalità di esecuzione del cambio ODL automatico:
/// - SIMUL
/// - DAILY
/// - ...
/// </summary>
public string ChangeOdlMode { get; set; } = "";
/// <summary>
/// Numero di ore di durata minima (ODL corrente) prima di eseguire una richiesta di cambio ODL automatico
/// </summary>
public int ChangeOdlHours { get; set; } = 24;
/// <summary>
/// Durata minima in minuti dello stato idle prima di eseguire una richiesta di cambio ODL
/// Serve ad evitare un cambio ODL mentre la amcchina è in RUN
/// </summary>
public int ChangeOdlIdleMin { get; set; } = 0;
}
}
+37
View File
@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IOB_UT_NEXT.Config.Base
{
public class ServerMapoDto
{
/// <summary>
/// Indica il metodo di trasporto http/https
/// </summary>
public string Transport { get; set; } = "http";
/// <summary>
/// Indirizzo IP server
/// </summary>
public string IpAddr { get; set; } = "127.0.0.1";
/// <summary>
/// URL Base del server applicativo
/// </summary>
public string BaseAppUrl { get; set; } = "/MP/IO/";
/// <summary>
/// Dizionario comandi configurati
/// </summary>
public Dictionary<string, string> Commands { get; set; } = new CmdUriDto("IOB").StdCommands();
/// <summary>
/// Installazione di riferimento
/// </summary>
public string ClientInstall { get; set; } = "SW";
}
}
+30
View File
@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IOB_UT_NEXT.Config.Base
{
/// <summary>
/// Classe gestione parametri legati a gestioen TCDataConf
/// </summary>
public class TCDataDto
{
/// <summary>
/// Fattore Lambda (innovazione) per calcolo EWMA valore TCiclo corrente
/// </summary>
public double Lambda { get; set; } = 0.4;
/// <summary>
/// Fattore massimo ammesso di delay x il TCiclo
/// </summary>
public double MaxDelayFactor { get; set; } = 1.2;
/// <summary>
/// Incremento massimo pezzi per cui fare calcolo del tempociclo attuale
/// </summary>
public double MaxIncrPz { get; set; } = 2;
}
}
+398
View File
@@ -0,0 +1,398 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IOB_UT_NEXT.Config
{
public class EnumConf
{
/// <summary>
/// Macro tipologia sistema di comunicazione (macro-adapter)
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum ComLayer
{
ND = 0,
Db,
Dll,
File,
ModBus,
Network,
Serial
}
#if false
/// <summary>
/// Tipologia di adapters ammessi
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum AdapterType
{
/// <summary>
/// Adapter SIMULAZIONE
/// </summary>
SIMULA,
/// <summary>
/// Adapter Beckhoff
/// </summary>
BECKHOFF,
/// <summary>
/// Adapter Beckhoff x CPA (selezionatrici ex Jetco)
/// </summary>
BECKHOFF_CPA,
/// <summary>
/// adapter FANUC
/// </summary>
FANUC,
/// <summary>
/// File Based exchange generic adapter
/// </summary>
FILE_GEN,
/// <summary>
/// File Based exchange Euromap63
/// </summary>
FILE_EUROM63,
///// <summary>
///// File Based exchange SCM Xylog
///// </summary>
//FILE_XYLOG,
/// <summary>
/// File Based Log file analisys per Soitaab
/// </summary>
FILE_SOITAAB,
/// <summary>
/// Gestione sync FTP
/// </summary>
FTP,
/// <summary>
/// Adapter KAWASAKI e-controller
/// </summary>
KAWASAKI,
/// <summary>
/// Adapter Icoel per DB (barcode, tracciatura, produzione,...)
/// </summary>
IcoelDb,
/// <summary>
/// Adapter Icoel per WS SOAP (sizer)
/// </summary>
IcoelSoap,
/// <summary>
/// Adapter non specificato
/// </summary>
ND,
/// <summary>
/// Adapter MITSUBISHI con EZCnc lib
/// </summary>
MITSUBISHI,
/// <summary>
/// Adapter ModBus TCP generico
/// </summary>
MODBUS_TCP,
/// <summary>
/// Adapter ModBus TCP versione Cedax (Giacovelli)
/// </summary>
MODBUS_TCP_CEDAX,
/// <summary>
/// Adapter ModBus TCP versione Centerfrigo (Giacovelli)
/// </summary>
MODBUS_TCP_CENTERFRIGO,
/// <summary>
/// Adapter modbus (+ file) x FIMAT (Tenditalia)
/// </summary>
MODBUS_TCP_FIMAT,
/// <summary>
/// Adapter ModBus TCP versione HAM (Pizzaferri)
/// </summary>
MODBUS_TCP_HAM,
/// <summary>
/// Adapter ModBus TCP versione HELPI (Cererie Finassi)
/// </summary>
MODBUS_TCP_HELPI,
/// <summary>
/// Adapter Modubus TCP versione IMAX Aeromacchine (Jetco)
/// </summary>
MODBUS_TCP_IMAS_AEROMEC,
/// <summary>
/// Adapter Modubus TCP versione Rimor (IMI Remosa)
/// </summary>
MODBUS_TCP_RIMOR,
/// <summary>
/// Adapter Modubus TCP versione Saim (Giacovelli)
/// </summary>
MODBUS_TCP_SAIM,
/// <summary>
/// Adapter Modubus TCP versione Zetapack (Giacovelli)
/// </summary>
MODBUS_TCP_ZETAPACK,
/// <summary>
/// Adapter MTConnect
/// </summary>
MTConnect,
/// <summary>
/// Adapter OMRON
/// </summary>
OMRON,
/// <summary>
/// Adapter OPC-UA
/// </summary>
OpcUa,
/// <summary>
/// Adapter OPC-UA CMS
/// </summary>
OpcUaCMS,
/// <summary>
/// Adapter OPC-UA per Ewon
/// </summary>
OpcUaEwon,
/// <summary>
/// Adapter OPC-UA per Ewon x Adige (BLM) / STIL
/// </summary>
OpcUaEwonAdige,
/// <summary>
/// Adapter OPC-UA per Ewon x BLM / Mecart
/// </summary>
OpcUaEwonBLM,
/// <summary>
/// Adapter OPC-UA per Ewon x Monti / Tenditalia
/// </summary>
OpcUaEwonMonti,
/// <summary>
/// Adapter OPC-UA per Ewon x Mecolpress (BLM) / STIL
/// </summary>
OpcUaEwonMecolpress,
/// <summary>
/// Adapter OPC-UA per KeepWare
/// </summary>
OpcUaKwp,
/// <summary>
/// Adapter OPC-UA per KeepWare, UnitechRama
/// </summary>
OpcUaKwpRama,
/// <summary>
/// Adapter OPC-UA per IMAS Aeromec / Jetco
/// </summary>
OpcUaImasAeromec,
/// <summary>
/// Adapter MBH (es Cimolai)
/// </summary>
OpcUaMBH,
/// <summary>
/// Adapter MBH implementazione Cimolai x travel lift
/// </summary>
OpcUaMBHCimolai,
/// <summary>
/// Adapter OMRON (es ICOEL)
/// </summary>
OpcUaOmron,
/// <summary>
/// Implementaizone OMRON specifica x ICOEL
/// </summary>
OpcUaOmronIcoel,
/// <summary>
/// Adapter OPC-UA SCM
/// </summary>
OpcUaSCM,
/// <summary>
/// Adapter OPC-UA Siemens generico
/// </summary>
OpcUaSiemens,
/// <summary>
/// Adapter OPC-UA Siemens OMP
/// </summary>
OpcUaSiemensOMP,
/// <summary>
/// Adapter OPC-UA Siemens Rama
/// </summary>
OpcUaSiemensRama,
/// <summary>
/// Adapter OPC-UA Ulma (packaging, Giacovelli)
/// </summary>
OpcUaUlma,
/// <summary>
/// Adapter OSAI CNDEX (Cndex)
/// </summary>
OSAI_CNDEX,
/// <summary>
/// Adapter OSAI OPEN (ws)
/// </summary>
OSAI_OPEN,
/// <summary>
/// Adapter OSAI VB6
/// </summary>
OSAI_VB6,
/// <summary>
/// Adapter tipo watchdog via ping (per impianti spenti e non rilevati)
/// </summary>
PingWatchdog,
/// <summary>
/// Adapter REST (base)
/// </summary>
REST,
/// <summary>
/// Adapter REST Citizen
/// </summary>
REST_CITIZEN,
/// <summary>
/// Shelly's Device (tipicamente PM series)
/// </summary>
Shelly,
/// <summary>
/// Adapter SIEMENS
/// </summary>
SIEMENS,
/// <summary>
/// Adapter SIEMENS, interfaccia versione APROCHIM (filtro liquidi rettifiche)
/// </summary>
SIEMENS_APROCHIM,
/// <summary>
/// Adapter SIEMENS, interfaccia versione VIPA @2001
/// </summary>
SIEMENS_AT2001,
/// <summary>
/// Adapter SIEMENS, interfaccia versione FAPE (punzonatrici) vers 2018
/// </summary>
SIEMENS_FAPE,
/// <summary>
/// Adapter SIEMENS, interfaccia versione FAPE (punzonatrici) vers 2024
/// </summary>
SIEMENS_FAPE_2,
/// <summary>
/// Adapter SIEMENS, interfaccia versione COMECA (impianti gestione GNL)
/// </summary>
SIEMENS_COMECA,
/// <summary>
/// Adapter SIEMENS, interfaccia versione COMUR (dentatrice)
/// </summary>
SIEMENS_COMUR,
/// <summary>
/// Adapter SIEMENS, interfaccia versione COSMAP (transfer smerigliatrice donati)
/// </summary>
SIEMENS_COSMAP,
/// <summary>
/// Adapter SIEMENS, interfaccia versione INGENIA (Valvital, Automazione)
/// </summary>
SIEMENS_INGENIA,
/// <summary>
/// Adapter SIEMENS, interfaccia versione LASCO (Valvital, Pressa Bilancere)
/// </summary>
SIEMENS_LASCO,
/// <summary>
/// Adapter SIEMENS, interfaccia versione NWSE (Giacovelli, impianto filtrazione NWS)
/// </summary>
SIEMENS_NWSE,
/// <summary>
/// Adapter SIEMENS, interfaccia versione PRESSOIL + CEI (Valvital, Pressa Idraulica)
/// </summary>
SIEMENS_PRESSOIL_CEI,
/// <summary>
/// Adapter SIEMENS, interfaccia verisone RobotService (Donati, smerigliatrici)
/// </summary>
SIEMENS_ROBOTSERVICE,
/// <summary>
/// Adapter SIEMENS, interfaccia versione SAET (Valvital, forni / tempra)
/// </summary>
SIEMENS_SAET,
/// <summary>
/// Adapter SIEMENS, interfaccia versione SIMEC (Valvital, taglio)
/// </summary>
SIEMENS_SIMEC,
/// <summary>
/// Adapter SIEMENS, interfaccia versione Torri
/// </summary>
SIEMENS_TORRI,
/// <summary>
/// Adapter SOAP x bilance Gomba
/// </summary>
SOAP_GOMBA,
/// <summary>
/// Adapter basato su DB scambio Microsoft SqlServer, macchine LANTEK
/// </summary>
SQLSERVER_LANTEK,
/// <summary>
/// Adapter basato su DB scambio Microsoft SqlServer, macchine PAMA
/// </summary>
SQLSERVER_PAMA,
/// <summary>
/// Metodi di WPS WebPageScraping (es x compressori Atlas Copco)
/// </summary>
WPS
}
#endif
}
}
+445
View File
@@ -0,0 +1,445 @@
using Newtonsoft.Json;
using YamlDotNet.Serialization.NamingConventions;
using YamlDotNet.Serialization;
using NLog;
using System.IO;
using System;
using static IOB_UT_NEXT.Config.EnumConf;
using System.Collections.Generic;
using System.Linq;
using IOB_UT_NEXT.Config;
using IOB_UT_NEXT.Config.Base;
using IOB_UT_NEXT.Config.Special;
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace IOB_UT_NEXT.Config
{
/// <summary>
/// Albero configurazione globale IOB in formato serializable
/// </summary>
[Serializable]
public class IobConfTree
{
/// <summary>
/// Init classe configurazione
/// </summary>
public IobConfTree()
{
Log = LogManager.GetCurrentClassLogger();
}
/// <summary>
/// Init classe configurazione da file
/// </summary>
public IobConfTree(string confFilePath)
{
Log = LogManager.GetCurrentClassLogger();
if (File.Exists(confFilePath))
{
IobConfTree newConfObj = new IobConfTree();
// verifico TIPO file...
string fileExt = Path.GetExtension(confFilePath);
string fileName = Path.GetFileName(confFilePath);
string rawData = File.ReadAllText(confFilePath);
if (!string.IsNullOrEmpty(rawData))
{
// leggo in base al tipo...
switch (fileExt)
{
case "yaml":
case "yml":
var deserializer = new DeserializerBuilder()
.WithNamingConvention(CamelCaseNamingConvention.Instance)
.Build();
try
{
newConfObj = deserializer.Deserialize<IobConfTree>(rawData);
}
catch (Exception exc)
{
//lgError($"Eccezione in LoadFromYaml{Environment.NewLine}{exc}");
}
break;
default:
break;
}
if (newConfObj != null)
{
// ora copio in oggetto corrente...
IobConf = newConfObj.IobConf;
DeviceConf = newConfObj.DeviceConf;
ProcInputConf = newConfObj.ProcInputConf;
OptParConf = newConfObj.OptParConf;
MapoMesConf = newConfObj.MapoMesConf;
SpecialConf = newConfObj.SpecialConf;
TCDataConf = newConfObj.TCDataConf;
ActionConf = newConfObj.ActionConf;
// sovrascrivo filename
IobConf.ConfFileName = fileName;
}
}
}
}
/// <summary>
/// Restituisce un oggetto di conf leggendo INI ed effettuando conversione
/// </summary>
/// <param name="iniFilePath"></param>
/// <returns></returns>
public static IobConfTree LoadFromINI(string iniFilePath)
{
IobConfTree newConfObj = new IobConfTree();
try
{
// leggo file INI
IniFile fIni = new IniFile(iniFilePath);
string codIob = Path.GetFileNameWithoutExtension(iniFilePath);
// Dati generali (vendor, modello...)
newConfObj.IobConf = new IobDto()
{
CodIOB = fIni.ReadString("IOB", "IOB_NAME", codIob),
ConfFileName = Path.GetFileName(iniFilePath),
Customer = fIni.ReadString("TAGS", "Customer", "EgalWare"),
DisableExeTask = bool.Parse(fIni.ReadString("IOB", "DIS_EXE_TASK", "false")),
DisableStateCh = bool.Parse(fIni.ReadString("IOB", "DIS_STATE_CH", "false")),
EnableRedisQueue = bool.Parse(fIni.ReadString("IOB", "EnableRedisQueue", "false")),
MinDeltaSec = fIni.ReadInteger("IOB", "MinDeltaSec", 6),
ReleaseVers = $"{System.Reflection.Assembly.GetExecutingAssembly().GetName().Version}"
};
// tipo adapter// verifico tipo adapter
try
{
newConfObj.IobConf.IobType = (tipoAdapter)Enum.Parse(typeof(tipoAdapter), fIni.ReadString("IOB", "CNCTYPE", "ND"));
}
catch (Exception exc)
{
newConfObj.IobConf.IobType = tipoAdapter.ND;
string rawVal = fIni.ReadString("IOB", "CNCTYPE", "DEMO");
newConfObj.lgError($"Eccezione in conversione tipo adapter: richiesto {rawVal} | tipo non codificato...{Environment.NewLine}{exc}");
}
newConfObj.DeviceConf = new DeviceDto()
{
Vendor = fIni.ReadString("MACHINE", "VENDOR", "STEAMWARE"),
Model = fIni.ReadString("MACHINE", "MODEL", "ND"),
ConnectConf = new ConnectionDto()
{
pingMsTimeout = fIni.ReadInteger("IOB", "PING_MS_TIMEOUT", 500),
IpAddr = fIni.ReadString("CNC", "IP", "::1"),
Port = fIni.ReadString("CNC", "PORT", "0")
}
};
// parametri opzionali Memory
string[] memSection = fIni.ReadSection("MEMORY");
// in primis SE ho qualcosa...
if (memSection != null && memSection.Count() > 0)
{
// trasformo in array...
Dictionary<string, string> memDict = new Dictionary<string, string>();
foreach (var item in memSection)
{
// verifica preliminare NON sia commento (inizia per ";")
if (!item.StartsWith(";"))
{
var KVP = item.Split('=');
memDict.Add(KVP[0], KVP[1]);
}
}
// ora se ho qualcosa proseguo...
if (memDict.Count() > 0)
{
// cerco dati x popolare SignalLUT
foreach (var item in memDict.Where(x => x.Key.StartsWith("BIT")))
{
if (newConfObj.DeviceConf.SignalLUT.ContainsKey(item.Key))
{
newConfObj.DeviceConf.SignalLUT[item.Key] = item.Value;
}
else
{
newConfObj.DeviceConf.SignalLUT.Add(item.Key, item.Value);
}
}
// cerco dati specifici x popolare l'area Fanuc
if (memDict.Where(x => x.Key.StartsWith("AREA") || x.Key.StartsWith("PAR")).Count() > 0)
{
// init fanuc...
newConfObj.DeviceConf.FanucConf = new FanucDto();
// inizio setup prendendo quelli con valori addrSize
foreach (var item in memDict.Where(x => x.Key.EndsWith("SIZE")))
{
int addrSize = 0;
int.TryParse(item.Value, out addrSize);
// salvo solo quelli con valori addrSize > 0
if (addrSize > 0)
{
string mId = item.Key.Replace("_SIZE", "");
// cerco record inizio
var valStart = memDict.Where(x => x.Key == item.Key.Replace("_SIZE", "_START")).Select(x => x.Value).FirstOrDefault();
if (!string.IsNullOrEmpty(valStart))
{
int addrStart = 0;
int.TryParse(valStart, out addrStart);
var memArea = new Mem.MemAreaDto() {
AddressStart = addrStart,
AddressSize = addrSize };
newConfObj.DeviceConf.FanucConf.MemConf.Add(mId, memArea);
}
}
}
}
}
}
// parametri opzionali Siemens
if (!string.IsNullOrEmpty(fIni.ReadString("CNC", "CPUTYPE", "")))
{
newConfObj.DeviceConf.SiemensConf = new SiemensDto();
newConfObj.DeviceConf.SiemensConf.CpuType = fIni.ReadString("CNC", "CPUTYPE", "");
newConfObj.DeviceConf.SiemensConf.Rack = (short)fIni.ReadInteger("CNC", "RACK", 0);
newConfObj.DeviceConf.SiemensConf.Slot = (short)fIni.ReadInteger("CNC", "SLOT", 0);
}
// BLINK
newConfObj.ProcInputConf.BlinkMaxCounter = Convert.ToInt32(fIni.ReadString("BLINK", "MAX_COUNTER_BLINK", "1"));
newConfObj.ProcInputConf.BlinkFilterMask = Convert.ToInt32(fIni.ReadString("BLINK", "BLINK_FILT", "0"));
newConfObj.TCDataConf.MaxDelayFactor = Convert.ToDouble(fIni.ReadString("OPTPAR", "TC_MAX_TC_FACTOR", "1.2").Replace(".", ","));
newConfObj.TCDataConf.Lambda = Convert.ToDouble(fIni.ReadString("OPTPAR", "TC_LAMBDA", "0.5").Replace(".", ","));
newConfObj.TCDataConf.MaxIncrPz = Convert.ToDouble(fIni.ReadString("OPTPAR", "TC_MAX_INCR", "5").Replace(".", ","));
// Server
string[] serverSection = fIni.ReadSection("SERVER");
// trasformo in array...
Dictionary<string, string> servDict = new Dictionary<string, string>();
foreach (var item in serverSection)
{
var KVP = item.Split('=');
servDict.Add(KVP[0], KVP[1]);
}
// processo array appena acquisito
if (servDict.ContainsKey("MPIP"))
{
#if false
string MpIp = fIni.ReadString("SERVER", "MPIP", "::1");
#endif
string MpIp = servDict["MPIP"];
if (!string.IsNullOrEmpty(MpIp))
{
newConfObj.MapoMesConf.Transport = MpIp.StartsWith("https://") ? "https" : "http";
newConfObj.MapoMesConf.IpAddr = MpIp.Replace($"{newConfObj.MapoMesConf.Transport}://", ""); // tolgo http/https...
}
}
// Altro
newConfObj.IobManConf.MinDeltaSec = fIni.ReadInteger("IOB", "MinDeltaSec", 6);
// OptParConf
Dictionary<string, string> optParRead = new Dictionary<string, string>();
string[] optParRows = fIni.ReadSection("OPTPAR");
if (optParRows.Length > 0)
{
try
{
string[] kvp;
foreach (var item in optParRows)
{
kvp = item.Split('=');
optParRead.Add(kvp[0], kvp[1]);
}
newConfObj.lgDebug($"Caricati {optParRead.Count} parametri opzionali da OPTPAR");
}
catch (Exception exc)
{
newConfObj.lgError(string.Format("EXCEPTION in fase di lettura OPTPAR: {0}{1}", Environment.NewLine, exc));
}
}
// riordino alfabeticamente
optParRead = optParRead.OrderBy(x => x.Key).ToDictionary(x => x.Key, x => x.Value);
newConfObj.OptParConf = optParRead;
}
catch
{ }
return newConfObj;
}
#region Logging
/// <summary>
/// oggetto logging
/// </summary>
protected Logger Log;// = LogManager.GetCurrentClassLogger();
/// <summary>
/// Effettua logging DEBUG corretto impostanto anche la variabile IOB prima di scrivere...
/// </summary>
/// <param name="txt2log"></param>
protected void lgDebug(string txt2log)
{
Log.Factory.Configuration.Variables["codIOB"] = IobConf.CodIOB;
Log.Debug(txt2log);
}
/// <summary>
/// Effettua logging ERROR corretto impostanto anche la variabile IOB prima di scrivere...
/// </summary>
/// <param name="txt2log"></param>
protected void lgError(string txt2log)
{
if (!string.IsNullOrEmpty(txt2log))
{
Log.Factory.Configuration.Variables["codIOB"] = IobConf.CodIOB;
Log.Error(txt2log);
}
}
/// <summary>
/// Effettua logging INFO corretto impostanto anche la variabile IOB prima di scrivere...
/// </summary>
/// <param name="txt2log"></param>
protected void lgInfo(string txt2log)
{
Log.Factory.Configuration.Variables["codIOB"] = IobConf.CodIOB;
Log.Info(txt2log);
}
/// <summary>
/// Effettua logging TRACE corretto impostanto anche la variabile IOB prima di scrivere...
/// </summary>
/// <param name="txt2log"></param>
protected void lgTrace(string txt2log)
{
Log.Factory.Configuration.Variables["codIOB"] = IobConf.CodIOB;
Log.Trace(txt2log);
}
#endregion
/// <summary>
/// Info specifiche del programma IOB
/// </summary>
public IobDto IobConf { get; set; } = new IobDto();
/// <summary>
/// Info relative al device interconnesso
/// </summary>
public DeviceDto DeviceConf { get; set; } = new DeviceDto();
/// <summary>
/// Parametri server Mapo MES
/// </summary>
public ServerMapoDto MapoMesConf { get; set; } = new ServerMapoDto();
/// <summary>
/// Setup info verso IOB-MAN
/// </summary>
public IobManDto IobManConf { get; set; } = new IobManDto();
/// <summary>
/// Setup processing dati in ingresso (es: blink segnali)
/// </summary>
public InputSignalDto ProcInputConf { get; set; } = new InputSignalDto();
/// <summary>
/// Dati relativi ai parametri gestione tempo ciclo
/// </summary>
public TCDataDto TCDataConf { get; set; } = new TCDataDto();
/// <summary>
/// Configurazione speciale/opzionale per tipo IOB
/// </summary>
public SpecializedDto SpecialConf { get; set; }
/// <summary>
/// Configurazione speciale comportamenti IOB (es setup)
/// </summary>
public ActionDto ActionConf { get; set; }
/// <summary>
/// Dizionario dei parametri opzionali
/// </summary>
public Dictionary<string, string> OptParConf { get; set; } = new Dictionary<string, string>();
/// <summary>
/// Dizionario delle chiavi opz da dizionario
/// </summary>
public Dictionary<string, string> OptKVP { get; set; } = new Dictionary<string, string>();
#region Metodi Serializzazione
/// <summary>
/// Restituisce conf serializzata in formato JSON
/// </summary>
/// <param name="filePath"></param>
/// <returns></returns>
public string GetJson()
{
string rawdata = JsonConvert.SerializeObject(this, Formatting.Indented);
return rawdata;
}
/// <summary>
/// Restituisce conf serializzata in formato YAML
/// </summary>
/// <param name="filePath"></param>
/// <returns></returns>
public string GetYaml()
{
// opzioni alternative: PascalCaseNamingConvention (iniziale masiucola) o lowerCaseNamingConvention
var serializer = new SerializerBuilder()
.WithNamingConvention(CamelCaseNamingConvention.Instance)
.Build();
var rawdata = serializer.Serialize(this);
return rawdata;
}
#endregion
#region Metodi Load/Save
/// <summary>
/// Scrive conf serializzata in formato JSON
/// </summary>
/// <param name="filePath"></param>
/// <returns></returns>
public bool SaveJson(string filePath)
{
bool answ = false;
try
{
string rawdata = GetJson();
File.WriteAllText(filePath, rawdata);
answ = true;
}
catch
{ }
return answ;
}
/// <summary>
/// Scrive conf serializzata in formato YAML
/// </summary>
/// <param name="filePath"></param>
/// <returns></returns>
public bool SaveYaml(string filePath)
{
bool answ = false;
try
{
var rawdata = GetYaml();
File.WriteAllText(filePath, rawdata);
answ = true;
}
catch
{ }
return answ;
}
#endregion
}
}
+22
View File
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IOB_UT_NEXT.Config.Mem
{
public class MemAreaDto
{
/// <summary>
/// Indirizzo inizio area da acquisire
/// </summary>
public int AddressStart { get; set; } = 0;
/// <summary>
/// Dimensione del set di indirizzi da recuperare
/// </summary>
public int AddressSize { get; set; } = 0;
}
}
+19
View File
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IOB_UT_NEXT.Config.Special
{
/// <summary>
/// Configurazione speciale comportamento IOB
/// </summary>
public class ActionDto
{
/// <summary>
/// Configurazione speciale azioni in fase di setup
/// </summary>
public MachineSetupConf SetupConf { get; set; }
}
}
+20
View File
@@ -0,0 +1,20 @@
using IOB_UT_NEXT.Config.Mem;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IOB_UT_NEXT.Config.Special
{
/// <summary>
/// Configurazione specifica memoria per FANUC
/// </summary>
public class FanucDto
{
/// <summary>
/// Conf aree di memoria da gestire
/// </summary>
public Dictionary<string, MemAreaDto> MemConf { get; set; } = new Dictionary<string, MemAreaDto>();
}
}
+26
View File
@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IOB_UT_NEXT.Config.Special
{
public class SiemensDto
{
/// <summary>
/// TipoCPU (es: 1500, 1200, 300)
/// </summary>
public string CpuType { get; set; } = "ND";
/// <summary>
/// Rack (Siemens S7)
/// </summary>
public short Rack { get; set; } = 0;
/// <summary>
/// Slot (Siemens S7)
/// </summary>
public short Slot { get; set; } = 0;
}
}
@@ -0,0 +1,41 @@
using IOB_UT_NEXT.Config.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IOB_UT_NEXT.Config.Special
{
/// <summary>
/// Area setup speciale/specializzato per singola tipologia IOB, opzionale
/// </summary>
public class SpecializedDto
{
/// <summary>
/// Struttura memoria PLC x lettura/scrittura
/// </summary>
public plcMemMapExt MemMap { get; set; }
/// <summary>
/// Configurazione specifica OPC-UA
/// </summary>
public MtcParamConf MtcConf { get; set; }
/// <summary>
/// Configurazione specifica OPC-UA
/// </summary>
public OpcUaParamConf OpcUaConf { get; set; }
/// <summary>
/// Configurazione specifica OPC-UA
/// </summary>
public RestParamConf RestConf { get; set; }
/// <summary>
/// Configurazione allarmi
/// </summary>
public AlarmDto AlarmConf { get; set; }
}
}
+5
View File
@@ -574,6 +574,11 @@ namespace IOB_UT_NEXT
/// </summary>
REST_CITIZEN,
/// <summary>
/// Shelly's Device (tipicamente PM series)
/// </summary>
Shelly,
/// <summary>
/// Adapter SIEMENS
/// </summary>
+22 -1
View File
@@ -146,14 +146,35 @@
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="YamlDotNet, Version=16.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL">
<HintPath>..\packages\YamlDotNet.16.3.0\lib\netstandard2.0\YamlDotNet.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="BitUtils.cs" />
<Compile Include="ByteDataConverter.cs" />
<Compile Include="Config\Base\AlarmDto.cs" />
<Compile Include="Config\Base\CmdUriDto.cs" />
<Compile Include="Config\Base\ConnectionDto.cs" />
<Compile Include="Config\Base\DeviceDto.cs" />
<Compile Include="Config\Base\CustomerDto.cs" />
<Compile Include="Config\Base\InputSignalDto.cs" />
<Compile Include="Config\Base\IobDto.cs" />
<Compile Include="Config\Base\IobManDto.cs" />
<Compile Include="Config\Base\ServerMapoDto.cs" />
<Compile Include="Config\Base\TCDataDto.cs" />
<Compile Include="Config\EnumConf.cs" />
<Compile Include="Config\IobConfTree.cs" />
<Compile Include="Config\Mem\MemArea.cs" />
<Compile Include="Config\Special\ActionDto.cs" />
<Compile Include="Config\Special\FanucDto.cs" />
<Compile Include="Config\Special\SpecializedDto.cs" />
<Compile Include="Config\Special\SiemensDto.cs" />
<Compile Include="DataModel\Fimat.cs" />
<Compile Include="DataQueue.cs" />
<Compile Include="FileProcMan.cs" />
<Compile Include="FtpActConf.cs" />
<Compile Include="IniFile.cs" />
<Compile Include="IntConditionCheck.cs" />
<Compile Include="BitConditionCheck.cs" />
<Compile Include="CustomObj.cs" />
@@ -172,7 +193,6 @@
<Compile Include="BinaryFormatter.cs" />
<Compile Include="Enums.cs" />
<Compile Include="fileMover.cs" />
<Compile Include="IniFile.cs" />
<Compile Include="Logging.cs" />
<Compile Include="Objects.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
@@ -189,5 +209,6 @@
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
+1
View File
@@ -24,4 +24,5 @@
<package id="System.Threading.Channels" version="9.0.0" targetFramework="net462" />
<package id="System.Threading.Tasks.Extensions" version="4.6.0" targetFramework="net462" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net462" />
<package id="YamlDotNet" version="16.3.0" targetFramework="net462" />
</packages>
+142 -3
View File
@@ -1,4 +1,5 @@
using IOB_UT_NEXT;
using IOB_UT_NEXT.Config;
using MapoSDK;
using Newtonsoft.Json;
using NLog;
@@ -11,6 +12,9 @@ using System.IO;
using System.Linq;
using System.Threading;
using System.Windows.Forms;
using YamlDotNet.Core;
using YamlDotNet.Serialization;
using YamlDotNet.Serialization.NamingConventions;
namespace IOB_WIN_FORM
{
@@ -83,7 +87,14 @@ namespace IOB_WIN_FORM
{
try
{
loadIniFile(defConfFilePath);
if (File.Exists(defConfFilePathYaml))
{
loadYamlFile(defConfFilePathYaml);
}
else
{
loadIniFile(defConfFilePath);
}
lgInfo("INI LOADED");
}
catch (Exception exc)
@@ -415,7 +426,28 @@ namespace IOB_WIN_FORM
{
get
{
return string.Format(@"{0}\{1}.ini", utils.confDir, CurrIOB);
return Path.Combine(utils.confDir, $"{CurrIOB}.ini");
}
}
/// <summary>
/// File configurazione yaml (completo) se presente
/// </summary>
public string defConfFilePathYaml
{
get
{
return Path.Combine(utils.confDir, $"{CurrIOB}.yaml");
}
}
/// <summary>
/// File configurazione json (completo) se presente
/// </summary>
public string defConfFilePathJson
{
get
{
return Path.Combine(utils.confDir, $"{CurrIOB}.json");
}
}
@@ -1615,7 +1647,7 @@ namespace IOB_WIN_FORM
private void loadIniFile(string iniConfFile)
{
// out di cosa faccio...
displayTaskAndLog($"[STARTUP] Loading iniConfFile: {iniConfFile}");
displayTaskAndLog($"[STARTUP] Loading yamlConfFile: {iniConfFile}");
// leggo file
IniFile fIni = new IniFile(iniConfFile);
@@ -1690,6 +1722,112 @@ namespace IOB_WIN_FORM
string confJson = JsonConvert.SerializeObject(IOBConf, Formatting.Indented);
string path = fileMover.GetExecutingDirectoryName(); // Directory.GetCurrentDirectory();
string fileName = Path.GetFileName(iniConfFile).Replace(".ini", ".iob");
string dirPath = Path.Combine(path, "DATA", IOBConf.serverData.ClientInstall);
string fullPath = Path.Combine(dirPath, fileName);
// verifica directory
baseUtils.checkDir(dirPath);
// salvataggio
File.WriteAllText(fullPath, confJson);
// preparazione file conf con nuovo formato e salvataggio...
IobConfTree newConf = IobConfTree.LoadFromINI(iniConfFile);
newConf.IobConf.ConfFileName = newConf.IobConf.ConfFileName.Replace("iob", "yaml");
// salvo anche yaml...
newConf.SaveYaml(fullPath.Replace("iob", "yaml"));
loadIobType();
// avvio macchina con adapter specificato...
if (utils.CRB("autoStartOnLoad"))
{
displayTaskAndLog("Auto Starting...", true);
// avvio!
avviaAdapter(chkForceDequeue.Checked);
displayTaskAndLog("Auto Started!", true);
}
}
/// <summary>
/// Carica file yaml della configurazione richiesta
/// </summary>
/// <param name="yamlConfFile"></param>
private void loadYamlFile(string yamlConfFile)
{
// out di cosa faccio...
displayTaskAndLog($"[STARTUP] Loading yamlConfFile: {yamlConfFile}");
// leggo file
IniFile fIni = new IniFile(yamlConfFile);
// leggo vendor e modello...
curVendor = fIni.ReadString("MACHINE", "VENDOR", "ACME");
curModel = fIni.ReadString("MACHINE", "MODEL", "NONE");
// verifico tipo adapter
try
{
tipoScelto = (tipoAdapter)Enum.Parse(typeof(tipoAdapter), fIni.ReadString("IOB", "CNCTYPE", "DEMO"));
}
catch (Exception exc)
{
string rawVal = fIni.ReadString("IOB", "CNCTYPE", "DEMO");
lgError($"Eccezione in conversione tipo adapter: richiesto {rawVal} | tipo non codificato...{Environment.NewLine}{exc}");
tipoScelto = tipoAdapter.ND;
}
// carivo vettore parametri opzionai
Dictionary<string, string> optParRead = new Dictionary<string, string>();
string[] optParRows = fIni.ReadSection("OPTPAR");
if (optParRows.Length > 0)
{
try
{
string[] kvp;
foreach (var item in optParRows)
{
kvp = item.Split('=');
optParRead.Add(kvp[0], kvp[1]);
}
lgDebug($"Caricati {optParRead.Count} parametri opzionali da OPTPAR");
}
catch (Exception exc)
{
lgError(string.Format("EXCEPTION in fase di lettura OPTPAR: {0}{1}", Environment.NewLine, exc));
}
}
var appVers = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
// inizializzio conf IOB
IOBConf = new IobConfiguration
{
pingMsTimeout = fIni.ReadInteger("IOB", "PING_MS_TIMEOUT", 500),
vendor = curVendor,
model = curModel,
tipoIob = tipoScelto,
optPar = optParRead,
versIOB = $"{appVers}",
codIOB = fIni.ReadString("IOB", "IOB_NAME", CurrIOB),
EnableRedisQueue = bool.Parse(fIni.ReadString("IOB", "EnableRedisQueue", "false")),
disableExeTask = bool.Parse(fIni.ReadString("IOB", "DIS_EXE_TASK", "false")),
disableStateCh = bool.Parse(fIni.ReadString("IOB", "DIS_STATE_CH", "false")),
filenameIOB = CurrIOB,
minDeltaSec = fIni.ReadInteger("IOB", "MinDeltaSec", 6),
cncIpAddr = fIni.ReadString("CNC", "IP", "::1"),
cncPingAddr = fIni.ReadString("CNC", "PING_IP", fIni.ReadString("CNC", "IP", "::1")),
cncPort = fIni.ReadString("CNC", "PORT", "0"),
iniFileName = yamlConfFile,
cpuType = fIni.ReadString("CNC", "CPUTYPE", ""),
rack = (short)fIni.ReadInteger("CNC", "RACK", 0),
slot = (short)fIni.ReadInteger("CNC", "SLOT", 0),
serverData = new serverMapo(fIni.ReadString("SERVER", "MPIP", "::1"), fIni.ReadString("SERVER", "MPURL", "/MP/IO"), fIni.ReadString("SERVER", "CMDBASE", "/IOB/input/"), fIni.ReadString("SERVER", "CMDFLOG", "/IOB/flog/"), fIni.ReadString("SERVER", "CMDULOG", "/IOB/ulog/"), fIni.ReadString("SERVER", "CMDALIVE", "/"), fIni.ReadString("SERVER", "CMDENABLED", "/"), fIni.ReadString("SERVER", "CMDREBO", "/"), fIni.ReadString("SERVER", "CMD_ODL_STARTED", "/IOB/getCurrOdlStart/"), fIni.ReadString("SERVER", "CLI_INST", "SW_CLI"), fIni.ReadString("SERVER", "CMD_FORCLE_SPLIT_ODL", "/IOB/forceSplitOdlFull/"), fIni.ReadString("SERVER", "CMD_IDLE_TIME", "/IOB/getIdlePeriod/"), fIni.ReadString("SERVER", "CMDRAWTRANSF", "/IOB/rawTransfJson/")),
MAX_COUNTER_BLINK = Convert.ToInt32(fIni.ReadString("BLINK", "MAX_COUNTER_BLINK", "1")),
BLINK_FILT = Convert.ToInt32(fIni.ReadString("BLINK", "BLINK_FILT", "0")),
TCMaxDelayFactor = Convert.ToDouble(fIni.ReadString("OPTPAR", "TC_MAX_TC_FACTOR", "1.2").Replace(".", ",")),
TCLambda = Convert.ToDouble(fIni.ReadString("OPTPAR", "TC_LAMBDA", "0.5").Replace(".", ",")),
TCMaxIncrPz = Convert.ToDouble(fIni.ReadString("OPTPAR", "TC_MAX_INCR", "5").Replace(".", ",")),
waitRecMSec = Convert.ToInt32(fIni.ReadString("OPTPAR", "WAIT_REC_MSEC", "90000"))
};
lgDebug($"Creato IOBConf!");
// salvo serializzando json... nella folder x Cliente oppure Vendor_Model
string confJson = JsonConvert.SerializeObject(IOBConf, Formatting.Indented);
string path = fileMover.GetExecutingDirectoryName(); // Directory.GetCurrentDirectory();
string fileName = Path.GetFileName(yamlConfFile).Replace(".ini", ".iob");
string dirPath = $"{path}\\DATA\\{IOBConf.serverData.ClientInstall}";
string fullPath = $"{dirPath}\\{fileName}";
// verifica directory
@@ -1708,6 +1846,7 @@ namespace IOB_WIN_FORM
}
}
/// <summary>
/// Verifica se il log di un dato errore sia permesso
/// </summary>
+3
View File
@@ -69,6 +69,9 @@
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
<Reference Include="YamlDotNet, Version=16.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL">
<HintPath>..\packages\YamlDotNet.16.3.0\lib\netstandard2.0\YamlDotNet.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\VersGen\VersGen.cs">
+1 -1
View File
@@ -4407,7 +4407,7 @@ namespace IOB_WIN_FORM.Iob
protected int currSendErrors = 0;
/// <summary>
/// Tempo di attesa in minuti x lettura contapezzi standard (da .ini / OptPar)
/// Tempo di attesa in minuti x lettura contapezzi standard (da .ini / OptParConf)
/// </summary>
protected double delayMinReadPzCount = 0;
+1 -1
View File
@@ -6,7 +6,7 @@
<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" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Web.WebView2.WinForms" publicKeyToken="2a8ab48044d2601e" culture="neutral" />
+1
View File
@@ -7,4 +7,5 @@
<package id="System.IO" version="4.3.0" targetFramework="net462" />
<package id="System.IO.Compression" version="4.3.0" targetFramework="net462" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net462" />
<package id="YamlDotNet" version="16.3.0" targetFramework="net462" />
</packages>
-14
View File
@@ -14,8 +14,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IOB-UT-NEXT", "IOB-UT-NEXT\
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IOB-WIN-FORM", "IOB-WIN-FORM\IOB-WIN-FORM.csproj", "{9BA331BB-9BF1-40E0-AC03-74B43D73A097}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IOB-WIN-PING", "IOB-WIN-PING\IOB-WIN-PING.csproj", "{6ADF1E82-124C-489C-99EF-A857C933D362}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IOB-WIN-SHELLY", "IOB-WIN-SHELLY\IOB-WIN-SHELLY.csproj", "{7642AEAD-7A35-45A6-8761-81D97CD8905C}"
EndProject
Global
@@ -63,18 +61,6 @@ Global
{9BA331BB-9BF1-40E0-AC03-74B43D73A097}.Remote_DEBUG|Any CPU.Build.0 = Debug|Any CPU
{9BA331BB-9BF1-40E0-AC03-74B43D73A097}.Remote_DEBUG|x86.ActiveCfg = Release|Any CPU
{9BA331BB-9BF1-40E0-AC03-74B43D73A097}.Remote_DEBUG|x86.Build.0 = Release|Any CPU
{6ADF1E82-124C-489C-99EF-A857C933D362}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6ADF1E82-124C-489C-99EF-A857C933D362}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6ADF1E82-124C-489C-99EF-A857C933D362}.Debug|x86.ActiveCfg = Debug|Any CPU
{6ADF1E82-124C-489C-99EF-A857C933D362}.Debug|x86.Build.0 = Debug|Any CPU
{6ADF1E82-124C-489C-99EF-A857C933D362}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6ADF1E82-124C-489C-99EF-A857C933D362}.Release|Any CPU.Build.0 = Release|Any CPU
{6ADF1E82-124C-489C-99EF-A857C933D362}.Release|x86.ActiveCfg = Release|Any CPU
{6ADF1E82-124C-489C-99EF-A857C933D362}.Release|x86.Build.0 = Release|Any CPU
{6ADF1E82-124C-489C-99EF-A857C933D362}.Remote_DEBUG|Any CPU.ActiveCfg = Release|Any CPU
{6ADF1E82-124C-489C-99EF-A857C933D362}.Remote_DEBUG|Any CPU.Build.0 = Release|Any CPU
{6ADF1E82-124C-489C-99EF-A857C933D362}.Remote_DEBUG|x86.ActiveCfg = Release|Any CPU
{6ADF1E82-124C-489C-99EF-A857C933D362}.Remote_DEBUG|x86.Build.0 = Release|Any CPU
{7642AEAD-7A35-45A6-8761-81D97CD8905C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7642AEAD-7A35-45A6-8761-81D97CD8905C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7642AEAD-7A35-45A6-8761-81D97CD8905C}.Debug|x86.ActiveCfg = Debug|Any CPU
+2 -2
View File
@@ -28,8 +28,8 @@ namespace IOB_WIN_SHELLY
switch (tipoScelto)
{
case tipoAdapter.PingWatchdog:
iobObj = new IOB_WIN_FORM.Iob.PingWatchDog(this, IOBConf);
case tipoAdapter.Shelly:
iobObj = new IOB_WIN_SHELLY.Iob.ShellyClient(this, IOBConf);
btnStart.Enabled = true;
break;
+26 -37
View File
@@ -108,15 +108,20 @@
</appSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="lib;libs" xmlns="urn:schemas-microsoft-com:asm.v1" />
<probing privatePath="lib;libs" xmlns="urn:schemas-microsoft-com:asm.v1" />
<dependentAssembly>
<assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.4.0" newVersion="4.0.4.0" />
@@ -125,38 +130,6 @@
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.1.0" newVersion="6.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Web.WebView2.WinForms" publicKeyToken="2a8ab48044d2601e" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.0.2903.40" newVersion="1.0.2903.40" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Web.WebView2.Core" publicKeyToken="2a8ab48044d2601e" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.0.2903.40" newVersion="1.0.2903.40" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.5.0" newVersion="4.1.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Channels" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
@@ -166,8 +139,24 @@
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
<assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.1.0" newVersion="6.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.5.0" newVersion="4.1.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
+6 -43
View File
@@ -1,17 +1,17 @@
;Configurazione IOB-WIN
[IOB]
CNCTYPE=SIMULA
CNCTYPE=Shelly
PING_MS_TIMEOUT=500
MinDeltaSec=5
EnableRedisQueue=true
;IOB_NAME=TFT_RAMA_001
[MACHINE]
VENDOR=STEAMWARE
MODEL=DEMO_SIMULATOR
VENDOR=Shelly
MODEL=Shelly1PM
[CNC]
IP=127.0.0.1
IP=10.74.81.71
PORT=0000
[SERVER]
@@ -27,7 +27,7 @@ CMD_ODL_STARTED=/IOB/getCurrOdlStart/
CMD_FORCLE_SPLIT_ODL=/IOB/forceSplitOdlFull/
CMD_IDLE_TIME=/IOB/getIdlePeriod/
[MEMORY]
[MEMORY]
[BLINK]
MAX_COUNTER_BLINK = 15
@@ -51,34 +51,9 @@ MIN_SEND_PZC_BLOCK=0
MAX_SEND_PZC_BLOCK=100
; gestione cambio ODL automatico (minuti minimi durata)
MIN_DURATA_ODL=960
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 10 secondi)
PER_BASE=10100
SIM_PZCNT=5|1
SIM_ALARM=100|10
SIM_MANU=50|6
; indica gestione e simulazione bit 5 --> slow
SIM_SLOW=3600|20
; indica gestione e simulazione bit 6 --> warmup/cooldown
SIM_WUCD=8000|20
; indica gestione e simulazione bit 7 --> emergenza
SIM_EMRG=4000|10
; indica simulazione delle funzionalità power ON/ OFF
SIM_POW_ON_OFF=true
T_ON=7
T_OFF=22
; indica simulazione controlli utente
SIM_RC=81|1
; indica simulazione registro scarti
SIM_RS=161|1
; indica simulazione dichiarazioni (note) utente
SIM_DICH=261|1
; indica matricola opr simulata
SIM_MATR_OPR=1
; test x datasync...
DATA_SYNC_AT_START=true
; test sim dossiers tipo Kepware
SIM_KWP=true
; gestione DynData simulati
ENABLE_DYN_DATA=TRUE
@@ -90,25 +65,13 @@ TC_LAMBDA=0.4
TC_MAX_INCR=5
MAX_PZ_INCR_PERC=1000
; conf parametri memoria READ/WRITE
PARAM_CONF=SIMUL_01.json
ALARM_CONF=SIMUL_01_alarm.json
SHELLY_PARAM=SIMUL_01.json
;test gestione logfile (eg: soitaab)
EnabelPodlManFull=true
CodGruppoIob=STEAMWARE-SIM-FASE-01
; invio flux alla lettura file
sendFluxOnRead=true
;conf test FTP
FTP_SERVER=ftp.steamware.net
FTP_USER=testftpuser
FTP_PWD=we4reFromB3rghem!
FTP_CERT=
FTP_SKIP=TRUE
FTP_LOC_DIR=temp\csv
FTP_REM_DIR=
CSV_ADD_HEADER=true
[BRANCH]
NAME=master
+34 -397
View File
@@ -1,410 +1,47 @@
{
"mMapWrite": {
"setArt": {
"name": "setArt",
"description": "Articolo",
"memAddr": "DB150.DBB12",
"tipoMem": "String",
"index": 12,
"size": 20,
"displOrdinal": 1
},
"setArtNum": {
"name": "setArtNum",
"description": "# Num Articolo",
"memAddr": "DB150.DBB112",
"tipoMem": "Int",
"index": 112,
"size": 4,
"displOrdinal": 1
},
"setComm": {
"name": "setComm",
"description": "Commessa",
"memAddr": "DB150.DBB32",
"tipoMem": "String",
"index": 32,
"size": 20,
"displOrdinal": 2
},
"setCommNum": {
"name": "setCommNum",
"description": "# NumCommessa",
"memAddr": "DB150.DBB132",
"tipoMem": "Int",
"index": 132,
"size": 4,
"displOrdinal": 2
},
"setPzComm": {
"name": "setPzComm",
"description": "Qta Richiesta",
"memAddr": "DB150.DBB8",
"tipoMem": "Int",
"index": 8,
"size": 4,
"displOrdinal": 3
},
"forceSetPzCount": {
"name": "forceSetPzCount",
"description": "Imposta Qta",
"memAddr": "DB150.DBB8",
"tipoMem": "Int",
"index": 8,
"size": 4,
"displOrdinal": 11
},
//"OPC_Set Point.Chain Spped": {
// "name": "OPC_Set Point.Chain Spped",
// "description": "Chain Spped",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Chain Spped",
// "index": 0,
// "size": 0
//},
//"OPC_Set Point.Top Overfeeding": {
// "name": "OPC_Set Point.Top Overfeeding",
// "description": "Top Overfeeding",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Top Overfeeding",
// "index": 0,
// "size": 0
//},
//"OPC_Set Point.Bottom Overfeeding": {
// "name": "OPC_Set Point.Bottom Overfeeding",
// "description": "Bottom Overfeeding",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Bottom Overfeeding",
// "index": 0,
// "size": 0
//},
//"OPC_Set Point.Width Master": {
// "name": "OPC_Set Point.Width Master",
// "description": "Width Master",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Width Master",
// "index": 0,
// "size": 0
//},
//"OPC_Set Point.Thermoset Time": {
// "name": "OPC_Set Point.Thermoset Time",
// "description": "Thermoset Time",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Thermoset Time",
// "index": 0,
// "size": 0
//},
//"OPC_Set Point.Thermoset Temperature": {
// "name": "OPC_Set Point.Thermoset Temperature",
// "description": "Thermoset Temperature",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Thermoset Temperature",
// "index": 0,
// "size": 0
//},
//"OPC_Set Point.Take Off Overfeeding": {
// "name": "OPC_Set Point.Take Off Overfeeding",
// "description": "Take Off Overfeeding",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Take Off Overfeeding",
// "index": 0,
// "size": 0
//},
//"OPC_Set Point.Small Roller Overfeeding": {
// "name": "OPC_Set Point.Small Roller Overfeeding",
// "description": "Small Roller Overfeeding",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Small Roller Overfeeding",
// "index": 0,
// "size": 0
//},
//"OPC_Set Point.Scroll Roller Overfeeding": {
// "name": "OPC_Set Point.Scroll Roller Overfeeding",
// "description": "Scroll Roller Overfeeding",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Scroll Roller Overfeeding",
// "index": 0,
// "size": 0
//},
//"OPC_Set Point.Right Whell Overfeeding": {
// "name": "OPC_Set Point.Right Whell Overfeeding",
// "description": "Right Whell Overfeeding",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Right Whell Overfeeding",
// "index": 0,
// "size": 0
//},
//"OPC_Set Point.Plaiter Overfeeding": {
// "name": "OPC_Set Point.Plaiter Overfeeding",
// "description": "Plaiter Overfeeding",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Plaiter Overfeeding",
// "index": 0,
// "size": 0
//},
//"OPC_Set Point.Load cell Weight": {
// "name": "OPC_Set Point.Load cell Weight",
// "description": "Load cell Weight",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Load cell Weight",
// "index": 0,
// "size": 0
//},
//"OPC_Set Point.Left Wheel Overfeeding": {
// "name": "OPC_Set Point.Left Wheel Overfeeding",
// "description": "Left Wheel Overfeeding",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Left Wheel Overfeeding",
// "index": 0,
// "size": 0
//},
//"OPC_Set Point.Fan 105A Speed": {
// "name": "OPC_Set Point.Fan 105A Speed",
// "description": "Fan 105A Speed",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Fan 105A Speed",
// "index": 0,
// "size": 0
//},
//"OPC_Set Point.Fan 105 Speed": {
// "name": "OPC_Set Point.Fan 105 Speed",
// "description": "Fan 105 Speed",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Fan 105 Speed",
// "index": 0,
// "size": 0
//},
//"OPC_Set Point.Fan 103A Speed": {
// "name": "OPC_Set Point.Fan 103A Speed",
// "description": "Fan 103A Speed",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Fan 103A Speed",
// "index": 0,
// "size": 0
//},
//"OPC_Set Point.Fan 103 Speed": {
// "name": "OPC_Set Point.Fan 103 Speed",
// "description": "Fan 103 Speed",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Fan 103 Speed",
// "index": 0,
// "size": 0
//},
//"OPC_Set Point.Fan 101A Speed": {
// "name": "OPC_Set Point.Fan 101A Speed",
// "description": "Fan 101A Speed",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Fan 101A Speed",
// "index": 0,
// "size": 0
//},
//"OPC_Set Point.Fan 101 Speed": {
// "name": "OPC_Set Point.Fan 101 Speed",
// "description": "Fan 101 Speed",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Fan 101 Speed",
// "index": 0,
// "size": 0
//},
//"OPC_Set Point.Exhaust Fan 1 Speed": {
// "name": "OPC_Set Point.Exhaust Fan 1 Speed",
// "description": "Exhaust Fan 1 Speed",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Exhaust Fan 1 Speed",
// "index": 0,
// "size": 0
//},
//"OPC_Set Point.Differentiation Spindle 5": {
// "name": "OPC_Set Point.Differentiation Spindle 5",
// "description": "Differentiation Spindle 5",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Differentiation Spindle 5",
// "index": 0,
// "size": 0
//},
//"OPC_Set Point.Differentiation Spindle 4": {
// "name": "OPC_Set Point.Differentiation Spindle 4",
// "description": "Differentiation Spindle 4",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Differentiation Spindle 4",
// "index": 0,
// "size": 0
//},
//"OPC_Set Point.Differentiation Spindle 3": {
// "name": "OPC_Set Point.Differentiation Spindle 3",
// "description": "Differentiation Spindle 3",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Differentiation Spindle 3",
// "index": 0,
// "size": 0
//},
//"OPC_Set Point.Differentiation Spindle 2": {
// "name": "OPC_Set Point.Differentiation Spindle 2",
// "description": "Differentiation Spindle 2",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Differentiation Spindle 2",
// "index": 0,
// "size": 0
//},
//"OPC_Set Point.Differentiation Spindle 1": {
// "name": "OPC_Set Point.Differentiation Spindle 1",
// "description": "Differentiation Spindle 1",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Differentiation Spindle 1",
// "index": 0,
// "size": 0
//},
//"OPC_Set Point.Cooling Cell 1 Speed": {
// "name": "OPC_Set Point.Cooling Cell 1 Speed",
// "description": "Cooling Cell 1 Speed",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Cooling Cell 1 Speed",
// "index": 0,
// "size": 0
//},
//"OPC_Set Point.Burner 6 Temperature": {
// "name": "OPC_Set Point.Burner 6 Temperature",
// "description": "Burner 6 Temperature",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Burner 6 Temperature",
// "index": 0,
// "size": 0
//},
//"OPC_Set Point.Burner 5 Temperature": {
// "name": "OPC_Set Point.Burner 5 Temperature",
// "description": "Burner 5 Temperature",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Burner 5 Temperature",
// "index": 0,
// "size": 0
//},
//"OPC_Set Point.Burner 4 Temperature": {
// "name": "OPC_Set Point.Burner 4 Temperature",
// "description": "Burner 4 Temperature",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Burner 4 Temperature",
// "index": 0,
// "size": 0
//},
//"OPC_Set Point.Burner 3 Temperature": {
// "name": "OPC_Set Point.Burner 3 Temperature",
// "description": "Burner 3 Temperature",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Burner 3 Temperature",
// "index": 0,
// "size": 0
//},
//"OPC_Set Point.Burner 2 Temperature": {
// "name": "OPC_Set Point.Burner 2 Temperature",
// "description": "Burner 2 Temperature",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Burner 2 Temperature",
// "index": 0,
// "size": 0
//},
//"OPC_Set Point.Burner 1 Temperature": {
// "name": "OPC_Set Point.Burner 1 Temperature",
// "description": "Burner 1 Temperature",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Burner 1 Temperature",
// "index": 0,
// "size": 0
//},
//"OPC_Set Point.Air Humidity Preset Esa 1": {
// "name": "OPC_Set Point.Air Humidity Preset Esa 1",
// "description": "Air Humidity Preset Esa 1",
// "tipoMem": "String",
// "memAddr": "ns=2;s=RamosaETN21.RamosaCJ2.Recipe.Air Humidity Preset Esa 1",
// "index": 0,
// "size": 0
//}
},
"mMapRead": {
"TEMP_01": {
"name": "TEMP_01",
"description": "Temperatura 01",
"Tot_Energy": {
"name": "Tot_Energy",
"description": "Energya totale impiegata",
"tipoMem": "Real",
"minVal": 18,
"maxVal": 24,
"minVal": 0,
"maxVal": 999999999,
"unit": "KWh",
"displOrdinal": 1
},
"RT_Power": {
"name": "RT_Power",
"description": "Potenza Istantanea",
"tipoMem": "Real",
"minVal": 0,
"maxVal": 999999,
"unit": "W",
"displOrdinal": 2
},
"RT_Voltage": {
"name": "RT_Voltage",
"description": "Tensione Istantanea",
"tipoMem": "Real",
"minVal": 0,
"maxVal": 1000,
"unit": "V",
"displOrdinal": 3
},
"RT_Current": {
"name": "RT_Current",
"description": "Corrente Istantanea",
"tipoMem": "Real",
"minVal": 0,
"maxVal": 200,
"unit": "A",
"displOrdinal": 4
},
"POWER_01": {
"name": "POWER_01",
"description": "Potenza impianto",
"tipoMem": "Int",
"minVal": 40,
"maxVal": 80,
"displOrdinal": 5
},
"FEED_OVER": {
"name": "FEED_OVER",
"description": "FEED override",
"tipoMem": "Int",
"minVal": 0,
"maxVal": 100,
"displOrdinal": 6
},
"RAPID_OVER": {
"name": "RAPID_OVER",
"description": "RAPID override",
"tipoMem": "Int",
"minVal": 50,
"maxVal": 120,
"displOrdinal": 7
},
"POS_X": {
"name": "POS_X",
"description": "Asse X",
"tipoMem": "Int",
"minVal": -2000,
"maxVal": 2000,
"displOrdinal": 8
},
"POS_Y": {
"name": "POS_Y",
"description": "Asse Y",
"tipoMem": "Int",
"minVal": 0,
"maxVal": 2000,
"displOrdinal": 9
},
"POS_Z": {
"name": "POS_Z",
"description": "Asse Z",
"tipoMem": "Int",
"minVal": 0,
"maxVal": 1500,
"displOrdinal": 10
}
},
"optKVP": {
"fluxLogReduce": true,
"fluxLogRedDeadBand": 1.5,
"fluxLogResendPeriod": 15,
"hasRecipe": true,
"maxPodlQty": 530,
"useLocalRecipe": true,
"path-locBase": "C:\\MesData\\",
"path-00-Arch": "ArchivioRicette\\FIMAT",
"path-01-Temp": "01-Temp\\FIMAT",
"path-02-Sent": "02-Inviate\\FIMAT",
"path-03-Recv": "03-Ricevute\\FIMAT",
"path-04-remReq": "Y:\\",
"path-05-remExe": "C:\\MesData\\Remote\\Dosed",
"path-06-remRec": "R:\\",
"path-outReport": "C:\\MesData\\Report",
"path-confSetup": "C:\\MesData\\Setup\\setupConsumi.json",
"replace-<Variant>": "<Variant>{{PODL}}",
"replace-<Info1>": "<Info1>Kg{{Qty}} | {{Note}}"
}, //,
//"BaseKeyTranslate": "ns=2;s=RamosaETN21.RamosaCJ2",
//"RecipeKeyTranslate": {
// "Present Value.General Fan": "Recipe.Chain Spped",
// "Present Value.Bottom Overfeeding": "Recipe.Bottom Overfeeding",
// "Present Value.Top Overfeeding": "Recipe.Top Overfeeding"
//}
"mMapWriteLink": {
"setArt": "setArtNum",
"setComm": "setCommNum"
"fluxLogResendPeriod": 15
}
}
+23
View File
@@ -113,6 +113,9 @@
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="YamlDotNet, Version=16.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL">
<HintPath>..\packages\YamlDotNet.16.3.0\lib\netstandard2.0\YamlDotNet.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\VersGen\VersGen.cs">
@@ -192,6 +195,7 @@
<ItemGroup>
<None Include="App.config">
<SubType>Designer</SubType>
<TransformOnBuild>true</TransformOnBuild>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
@@ -223,4 +227,23 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Microsoft.VisualStudio.SlowCheetah.4.0.50\build\Microsoft.VisualStudio.SlowCheetah.targets" Condition="Exists('..\packages\Microsoft.VisualStudio.SlowCheetah.4.0.50\build\Microsoft.VisualStudio.SlowCheetah.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.VisualStudio.SlowCheetah.4.0.50\build\Microsoft.VisualStudio.SlowCheetah.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VisualStudio.SlowCheetah.4.0.50\build\Microsoft.VisualStudio.SlowCheetah.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.Extensions.Logging.Abstractions.6.0.0\build\Microsoft.Extensions.Logging.Abstractions.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Extensions.Logging.Abstractions.6.0.0\build\Microsoft.Extensions.Logging.Abstractions.targets'))" />
</Target>
<Target Name="AfterBuild">
<ItemGroup>
<MoveToLibFolder Include="$(OutputPath)*.dll ; $(OutputPath)*.pdb ; $(OutputPath)*.xml; $(OutputPath)*.so; $(OutputPath)*.dylib" />
</ItemGroup>
<Move SourceFiles="@(MoveToLibFolder)" DestinationFolder="$(OutputPath)lib" OverwriteReadOnlyFiles="true" />
</Target>
<Target Name="FinalBuild" AfterTargets="AfterBuild">
<Exec Command="$(ProjectDir)postBuildTgt.bat $(ConfigurationName) $(TargetDir)">
</Exec>
</Target>
<Import Project="..\packages\Microsoft.Extensions.Logging.Abstractions.6.0.0\build\Microsoft.Extensions.Logging.Abstractions.targets" Condition="Exists('..\packages\Microsoft.Extensions.Logging.Abstractions.6.0.0\build\Microsoft.Extensions.Logging.Abstractions.targets')" />
</Project>
+3 -3
View File
@@ -56,10 +56,10 @@ namespace IOB_WIN_SHELLY.Iob
// fix coda ping
PingQueue = new DataQueue("000", "PingQueue", false);
// carico conf specifica steps FTP
string ftpConfFile = getOptPar("FTP_PARAM");
if (!string.IsNullOrEmpty(ftpConfFile))
string shellyConfFile = getOptPar("SHELLY_PARAM");
if (!string.IsNullOrEmpty(shellyConfFile))
{
loadFtpConfFile(ftpConfFile);
loadFtpConfFile(shellyConfFile);
#if false
// mi calcolo ed imposto la ftpClientMan + Remote BaseDir...
string actKey = "RemoteDir";
+1
View File
@@ -26,4 +26,5 @@
<package id="System.Threading.Channels" version="9.0.0" targetFramework="net462" />
<package id="System.Threading.Tasks.Extensions" version="4.6.0" targetFramework="net462" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net462" />
<package id="YamlDotNet" version="16.3.0" targetFramework="net462" />
</packages>