diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f674cd4d..72f22c5b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -6,7 +6,7 @@ variables:
NUM_REL: '0.1.2.3'
NUM_DEB: '0.1.2-beta.3'
CONFIG: ''
- VERS_MAIN: '3.8'
+ VERS_MAIN: '3.9'
NEW_REL: ''
OUTPUT_DIR: ''
NET_SHARE_X: '\\codedoc.egalware.com\library'
diff --git a/IOB-UT-NEXT/Config/Base/DeviceDto.cs b/IOB-UT-NEXT/Config/Base/DeviceDto.cs
index 91c13aed..2cd9736c 100644
--- a/IOB-UT-NEXT/Config/Base/DeviceDto.cs
+++ b/IOB-UT-NEXT/Config/Base/DeviceDto.cs
@@ -30,27 +30,49 @@ namespace IOB_UT_NEXT.Config.Base
///
/// Indica se si voglia recuperare il PROG NAME dal CNC
///
- public bool GetProgName { get; set; } = false;
+ public bool EnabProgName { get; set; } = false;
///
/// Dati configurazione CNC
///
- public ConnectionDto ConnectConf { get; set; } = new ConnectionDto();
+ public ConnectionDto Connect { get; set; } = new ConnectionDto();
///
- /// Configurazione SignalLUT con regole decodifica valori (es FANUC/Siemens con BIT0...BIT7...)
+ /// Indica che sono disabilitati i Task2Exe (tipicamente gestione scrittura verso PLC)
///
- public Dictionary SignalLUT { get; set; } = new Dictionary();
+ public bool DisabExeTask { get; set; } = false;
///
- /// Configurazione specifica FANUC (se applicabile)
+ /// Indica che sono disabilitate le fasi controllo stato/semafori (tipicamente x impianti
+ /// con PLC "suddivisi", PLC + HMI)
///
- public MemoryDto MemoryConf { get; set; }
+ public bool DisabStateCh { get; set; } = false;
///
- /// Configurazione specifica Siemens (se applicabile)
+ /// Abilitazione gestione contatori
///
- public SiemensDto SiemensConf { get; set; }
+ public bool EnabPzCount { get; set; } = true;
+
+ ///
+ /// Indica se usare la parte numerica di un articolo come codice INT
+ ///
+ public bool NumArtCharTrim { get; set; } = false;
+
+ ///
+ /// Delay prima di iniziare a gestire il contapezzi, per evitare falsi zeri in inizializzazione sw
+ ///
+ public int PzCountDelay { get; set; } = 2000;
+
+ ///
+ /// Modalità gestione contapezzi
+ ///
+ public string PzCountMode { get; set; } = "";
+
+ ///
+ /// Configurazione SigLUT con regole decodifica valori (es FANUC/Siemens con BIT0...BIT7...)
+ ///
+ public Dictionary SigLUT { get; set; } = new Dictionary();
+
}
}
diff --git a/IOB-UT-NEXT/Config/Base/IobDto.cs b/IOB-UT-NEXT/Config/Base/IobDto.cs
index a2398ba3..e2ca448e 100644
--- a/IOB-UT-NEXT/Config/Base/IobDto.cs
+++ b/IOB-UT-NEXT/Config/Base/IobDto.cs
@@ -15,14 +15,14 @@ namespace IOB_UT_NEXT.Config.Base
///
/// Nome file di configurazione
///
- public string ConfFileName { get; set; } = "";
+ public string FileName { get; set; } = "";
///
/// Filename senza desinenza del tipo di file
///
public string FilenameIOB
{
- get => baseUtils.StringBeforeLastChar(ConfFileName, '.');
+ get => baseUtils.StringBeforeLastChar(FileName, '.');
}
///
@@ -45,26 +45,20 @@ namespace IOB_UT_NEXT.Config.Base
///
public int MinDeltaSec { get; set; } = 5;
+ ///
+ /// Disabilitazione invio DynData di WDST (WatchDogStateTransfer)
+ ///
+ public bool DisabWDST { get; set; } = true;
+
///
/// Abilita salvataggio coda eventi su redis (ritentiva)
///
- public bool EnableRedisQueue { get; set; } = true;
+ public bool EnabRedisQue { get; set; } = true;
///
- /// Indica che sono disabilitati i Task2Exe (tipicamente gestione scrittura verso PLC)
+ /// Timer principale interfaccia in ms
///
- public bool DisableExeTask { get; set; } = false;
-
- ///
- /// Indica che sono disabilitate le fasi controllo stato/semafori (tipicamente x impianti
- /// con PLC "suddivisi", PLC + HMI)
- ///
- public bool DisableStateCh { get; set; } = false;
-
- ///
- /// Versione software IOB
- ///
- public string ReleaseVers { get; set; } = "0.0.0.0";
+ public int UiTimer { get; set; } = 90;
///
/// Tempo di attesa per tentativo reconnect in MSec, override da conf applicativo generale
@@ -72,8 +66,8 @@ namespace IOB_UT_NEXT.Config.Base
public int WaitRecMsec { get; set; } = 59000;
///
- /// Timer principale interfaccia
+ /// Versione software IOB
///
- public int TimerIntMs { get; set; } = 90;
+ public string RelVers { get; set; } = "0.0.0.0";
}
}
diff --git a/IOB-UT-NEXT/Config/IobConfTree.cs b/IOB-UT-NEXT/Config/IobConfTree.cs
index 593ad39b..56195a96 100644
--- a/IOB-UT-NEXT/Config/IobConfTree.cs
+++ b/IOB-UT-NEXT/Config/IobConfTree.cs
@@ -70,16 +70,16 @@ namespace IOB_UT_NEXT.Config
if (newConfObj != null)
{
// ora copio in oggetto corrente...
- GenConf = newConfObj.GenConf;
- DeviceConf = newConfObj.DeviceConf;
- ProcInputConf = newConfObj.ProcInputConf;
- OptParConf = newConfObj.OptParConf;
- MapoMesConf = newConfObj.MapoMesConf;
- SpecialConf = newConfObj.SpecialConf;
+ General = newConfObj.General;
+ Device = newConfObj.Device;
+ SignalProc = newConfObj.SignalProc;
+ OptPar = newConfObj.OptPar;
+ MapoMes = newConfObj.MapoMes;
+ Special = newConfObj.Special;
TCDataConf = newConfObj.TCDataConf;
- ActionConf = newConfObj.ActionConf;
+ Actions = newConfObj.Actions;
// sovrascrivo filename
- GenConf.ConfFileName = fileName;
+ General.FileName = fileName;
}
}
}
@@ -103,16 +103,14 @@ namespace IOB_UT_NEXT.Config
List exclOptPar = new List();
// Dati generali (vendor, modello...)
- newConfObj.GenConf = new IobDto()
+ newConfObj.General = new IobDto()
{
CodIOB = fIni.ReadString("IOB", "IOB_NAME", codIob),
- ConfFileName = Path.GetFileName(iniFilePath),
+ FileName = 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")),
+ EnabRedisQue = bool.Parse(fIni.ReadString("IOB", "EnableRedisQueue", "true")),
MinDeltaSec = fIni.ReadInteger("IOB", "MinDeltaSec", 6),
- ReleaseVers = $"{System.Reflection.Assembly.GetExecutingAssembly().GetName().Version}",
+ RelVers = $"{System.Reflection.Assembly.GetExecutingAssembly().GetName().Version}",
WaitRecMsec = Convert.ToInt32(fIni.ReadString("OPTPAR", "WAIT_REC_MSEC", "90000"))
};
int iTimerIntMSec = utils.CRI("timerIntMs");
@@ -120,7 +118,7 @@ namespace IOB_UT_NEXT.Config
if (!string.IsNullOrEmpty(rawTimer))
{
int.TryParse(rawTimer, out iTimerIntMSec);
- newConfObj.GenConf.TimerIntMs = iTimerIntMSec;
+ newConfObj.General.UiTimer = iTimerIntMSec;
}
exclOptPar.Add("WAIT_REC_MSEC");
exclOptPar.Add("timerIntMs");
@@ -128,21 +126,26 @@ namespace IOB_UT_NEXT.Config
// tipo adapter// verifico tipo adapter
try
{
- newConfObj.GenConf.IobType = (tipoAdapter)Enum.Parse(typeof(tipoAdapter), fIni.ReadString("IOB", "CNCTYPE", "ND"));
+ newConfObj.General.IobType = (tipoAdapter)Enum.Parse(typeof(tipoAdapter), fIni.ReadString("IOB", "CNCTYPE", "ND"));
}
catch (Exception exc)
{
- newConfObj.GenConf.IobType = tipoAdapter.ND;
+ newConfObj.General.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()
+ newConfObj.Device = new DeviceDto()
{
+ DisabExeTask = bool.Parse(fIni.ReadString("IOB", "DIS_EXE_TASK", "false")),
+ DisabStateCh = bool.Parse(fIni.ReadString("IOB", "DIS_STATE_CH", "false")),
+ EnabPzCount = utils.CRB("enableContapezzi"),
+ PzCountDelay = utils.CRI("pzCountDelay"),
+ PzCountMode = fIni.ReadString("OPTPAR", "PZCOUNT_MODE", ""),
Vendor = fIni.ReadString("MACHINE", "VENDOR", "STEAMWARE"),
Model = fIni.ReadString("MACHINE", "MODEL", "ND"),
- GetProgName = fIni.ReadBoolean("CNC", "GETPRGNAME", true),
- ConnectConf = new ConnectionDto()
+ EnabProgName = bool.Parse(fIni.ReadString("CNC", "GETPRGNAME", "true")),
+ Connect = new ConnectionDto()
{
IpAddr = fIni.ReadString("CNC", "IP", "::1"),
PingIpAddr = fIni.ReadString("CNC", "PING_IP", fIni.ReadString("CNC", "IP", "::1")),
@@ -150,118 +153,15 @@ namespace IOB_UT_NEXT.Config
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 memDict = new Dictionary();
- foreach (var item in memSection)
- {
- // verifica preliminare NON sia commento (inizia per ";")
- if (!item.StartsWith(";") && item.Contains("="))
- {
- 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 Memoria (Fanuc/Mitsubischi/...)
- if (memDict.Where(x => x.Key.StartsWith("AREA") || x.Key.StartsWith("PAR") || x.Key.StartsWith("SIGN")).Count() > 0)
- {
- // init fanuc...
- newConfObj.DeviceConf.MemoryConf = new MemoryDto();
- // 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()
- {
- Start = addrStart,
- Size = addrSize
- };
- if (newConfObj.DeviceConf.MemoryConf.AreaConf.ContainsKey(mId))
- {
- newConfObj.DeviceConf.MemoryConf.AreaConf[mId] = memArea;
- }
- else
- {
- newConfObj.DeviceConf.MemoryConf.AreaConf.Add(mId, memArea);
- }
- }
- }
- }
- }
- }
- }
- // salvo eventuale memTrace...
- if (!string.IsNullOrEmpty(fIni.ReadString("OPTPAR", "MEM_2_TRACE", "")))
- {
- newConfObj.DeviceConf.MemoryConf.Mem2Trace = fIni.ReadString("OPTPAR", "MEM_2_TRACE", "");
- exclOptPar.Add("MEM_2_TRACE");
- }
-
- // parametri opzionali Siemens
- if (!string.IsNullOrEmpty(fIni.ReadString("CNC", "CPUTYPE", "")))
- {
- newConfObj.DeviceConf.SiemensConf = new SiemensDto();
- // CPU Siemens
- 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);
- // memoria Siemens!
- newConfObj.DeviceConf.SiemensConf.MemAddrRead = fIni.ReadString("MEMORY", "ADDR_READ", "");
- newConfObj.DeviceConf.SiemensConf.MemAddrWrite = fIni.ReadString("MEMORY", "ADDR_WRITE", "");
- newConfObj.DeviceConf.SiemensConf.MemSizeRead = fIni.ReadInteger("MEMORY", "SIZE_READ", 0);
- newConfObj.DeviceConf.SiemensConf.MemSizeWrite = fIni.ReadInteger("MEMORY", "SIZE_WRITE", 0);
- }
-
-#if false
- // parametri opzionali Fanuc
- if ($"{newConfObj.GenConf.IobType}".StartsWith("FANUC"))
- {
- newConfObj.DeviceConf.FanucConf = new FanucDto();
- // memoria Fanuc!
- newConfObj.DeviceConf.FanucConf.SizeAreaG = fIni.ReadInteger("MEMORY", "AREAG_SIZE", 8);
- newConfObj.DeviceConf.FanucConf.SizeAreaR = fIni.ReadInteger("MEMORY", "AREAR_SIZE", 8);
- newConfObj.DeviceConf.FanucConf.SizeAreaX = fIni.ReadInteger("MEMORY", "AREAX_SIZE", 8);
- newConfObj.DeviceConf.FanucConf.SizeAreaY = fIni.ReadInteger("MEMORY", "AREAY_SIZE", 8);
- }
-#endif
-
+ exclOptPar.Add("PZCOUNT_MODE");
+
// multi...
- newConfObj.DeviceConf.IsMulti = Convert.ToBoolean(fIni.ReadString("OPTPAR", "IS_MULTI", "false")) || fIni.ReadString("OPTPAR", "IS_MULTI", "0") == "1";
+ newConfObj.Device.IsMulti = Convert.ToBoolean(fIni.ReadString("OPTPAR", "IS_MULTI", "false")) || fIni.ReadString("OPTPAR", "IS_MULTI", "0") == "1";
exclOptPar.Add("IS_MULTI");
// 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.SignalProc.BlinkMaxCounter = Convert.ToInt32(fIni.ReadString("BLINK", "MAX_COUNTER_BLINK", "1"));
+ newConfObj.SignalProc.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(".", ","));
@@ -274,21 +174,21 @@ namespace IOB_UT_NEXT.Config
string MpIp = fIni.ReadString("SERVER", "MPIP", "::1");
if (!string.IsNullOrEmpty(MpIp))
{
- newConfObj.MapoMesConf.Transport = MpIp.StartsWith("https://") ? "https" : "http";
- newConfObj.MapoMesConf.IpAddr = MpIp.Replace($"{newConfObj.MapoMesConf.Transport}://", ""); // tolgo http/https...
- newConfObj.MapoMesConf.ClientInstall = "SteamWare";
+ newConfObj.MapoMes.Transport = MpIp.StartsWith("https://") ? "https" : "http";
+ newConfObj.MapoMes.IpAddr = MpIp.Replace($"{newConfObj.MapoMes.Transport}://", ""); // tolgo http/https...
+ newConfObj.MapoMes.ClientInstall = "SteamWare";
}
string MpUrl = fIni.ReadString("SERVER", "MPURL", "");
if (!string.IsNullOrEmpty(MpUrl))
{
- newConfObj.MapoMesConf.BaseAppUrl = $"{MpUrl}/".Replace("//", "/");
+ newConfObj.MapoMes.BaseAppUrl = $"{MpUrl}/".Replace("//", "/");
}
// Altro
- newConfObj.IobManConf.MinDeltaSec = fIni.ReadInteger("IOB", "MinDeltaSec", 6);
+ newConfObj.IobMan.MinDeltaSec = fIni.ReadInteger("IOB", "MinDeltaSec", 6);
- // OptParConf
+ // OptPar
Dictionary optParRead = new Dictionary();
string[] optParRows = fIni.ReadSection("OPTPAR");
if (optParRows.Length > 0)
@@ -314,9 +214,9 @@ namespace IOB_UT_NEXT.Config
}
// riordino alfabeticamente
optParRead = optParRead.OrderBy(x => x.Key).ToDictionary(x => x.Key, x => x.Value);
- newConfObj.OptParConf = optParRead;
+ newConfObj.OptPar = optParRead;
- newConfObj.SpecialConf = new SpecializedDto();
+ newConfObj.Special = new SpecializedDto();
// verifico se ho conf json speciali: LUT decodifica PARAMETRI
if (optParRead.ContainsKey("PARAM_CONF"))
{
@@ -332,10 +232,13 @@ namespace IOB_UT_NEXT.Config
string jsonData = reader.ReadToEnd();
if (!string.IsNullOrEmpty(jsonData))
{
- newConfObj.SpecialConf.MemMap = new plcMemMapExt();
+ if (newConfObj.Memory == null)
+ {
+ newConfObj.Memory = new plcMemMapExt();
+ }
try
{
- newConfObj.SpecialConf.MemMap = JsonConvert.DeserializeObject(jsonData);
+ newConfObj.Memory = JsonConvert.DeserializeObject(jsonData);
}
catch (Exception exc)
{
@@ -355,10 +258,104 @@ namespace IOB_UT_NEXT.Config
}
}
- // controllo altre conf speciali...
+ // salvo eventuale memTrace...
+ if (!string.IsNullOrEmpty(fIni.ReadString("OPTPAR", "MEM_2_TRACE", "")))
+ {
+ newConfObj.Special.BankConf.Mem2Trace = fIni.ReadString("OPTPAR", "MEM_2_TRACE", "");
+ exclOptPar.Add("MEM_2_TRACE");
+ }
+
+ // parametri opzionali Siemens
+ if (!string.IsNullOrEmpty(fIni.ReadString("CNC", "CPUTYPE", "")))
+ {
+ newConfObj.Special.SiemensConf = new SiemensDto();
+ // CPU Siemens
+ newConfObj.Special.SiemensConf.CpuType = fIni.ReadString("CNC", "CPUTYPE", "");
+ newConfObj.Special.SiemensConf.Rack = (short)fIni.ReadInteger("CNC", "RACK", 0);
+ newConfObj.Special.SiemensConf.Slot = (short)fIni.ReadInteger("CNC", "SLOT", 0);
+ // memoria Siemens!
+ newConfObj.Special.SiemensConf.MemAddrRead = fIni.ReadString("MEMORY", "ADDR_READ", "");
+ newConfObj.Special.SiemensConf.MemAddrWrite = fIni.ReadString("MEMORY", "ADDR_WRITE", "");
+ newConfObj.Special.SiemensConf.MemSizeRead = fIni.ReadInteger("MEMORY", "SIZE_READ", 0);
+ newConfObj.Special.SiemensConf.MemSizeWrite = fIni.ReadInteger("MEMORY", "SIZE_WRITE", 0);
+ }
+
+ // parametri opzionali BankConf
+ string[] memSection = fIni.ReadSection("MEMORY");
+ // in primis SE ho qualcosa...
+ if (memSection != null && memSection.Count() > 0)
+ {
+ // trasformo in array...
+ Dictionary memDict = new Dictionary();
+ foreach (var item in memSection)
+ {
+ // verifica preliminare NON sia commento (inizia per ";")
+ if (!item.StartsWith(";") && item.Contains("="))
+ {
+ var KVP = item.Split('=');
+ memDict.Add(KVP[0], KVP[1]);
+ }
+ }
+ // ora se ho qualcosa proseguo...
+ if (memDict.Count() > 0)
+ {
+ // cerco dati x popolare SigLUT
+ foreach (var item in memDict.Where(x => x.Key.StartsWith("BIT")))
+ {
+ if (newConfObj.Device.SigLUT.ContainsKey(item.Key))
+ {
+ newConfObj.Device.SigLUT[item.Key] = item.Value;
+ }
+ else
+ {
+ newConfObj.Device.SigLUT.Add(item.Key, item.Value);
+ }
+ }
+ // cerco dati specifici x popolare l'area Memoria (Fanuc/Mitsubischi/...)
+ if (memDict.Where(x => x.Key.StartsWith("AREA") || x.Key.StartsWith("PAR") || x.Key.StartsWith("SIGN")).Count() > 0)
+ {
+ // init info bank memoria...
+ if (newConfObj.Special.BankConf == null)
+ {
+ newConfObj.Special.BankConf = new MemBankDto();
+ }
+ // 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()
+ {
+ Start = addrStart,
+ Size = addrSize
+ };
+ if (newConfObj.Special.BankConf.AreaConf.ContainsKey(mId))
+ {
+ newConfObj.Special.BankConf.AreaConf[mId] = memArea;
+ }
+ else
+ {
+ newConfObj.Special.BankConf.AreaConf.Add(mId, memArea);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
// gestione speciale x type MBus
- if ($"{newConfObj.GenConf.IobType}".StartsWith("MODBUS_TCP"))
+ if ($"{newConfObj.General.IobType}".StartsWith("MODBUS_TCP"))
{
ModBusTcpParamConf newMBusPar = new ModBusTcpParamConf()
{
@@ -374,7 +371,26 @@ namespace IOB_UT_NEXT.Config
// verifico eventuale parametro memoria estesa (non 0...10'000 ma 0...xFFFF=65536)
modbusExtReg = fIni.ReadBoolean("MEMORY", "MODBUS_EXT_REG")
};
- newConfObj.SpecialConf.ModbusConf = newMBusPar;
+ newConfObj.Special.ModbusConf = newMBusPar;
+ }
+
+ // alla fine verifico eventuali eccezioni alla gestione pzCount con abilitazione esplicita
+ if (!string.IsNullOrEmpty(newConfObj.OptParGet("ENABLE_PZCOUNT")))
+ {
+ newConfObj.Device.EnabPzCount = newConfObj.OptParGet("ENABLE_PZCOUNT") == "TRUE";
+ }
+ // o al contrario con disabilitazione esplicita
+ if (!string.IsNullOrEmpty(newConfObj.OptParGet("DISABLE_PZCOUNT")))
+ {
+ newConfObj.Device.EnabPzCount = !(newConfObj.OptParGet("DISABLE_PZCOUNT") == "TRUE");
+ }
+
+ // gestione override idx articoli...
+ if (!string.IsNullOrEmpty(newConfObj.OptParGet("NUM_ART_CHR_TRIM")))
+ {
+ string NUM_ART_CHR_TRIM = newConfObj.OptParGet("NUM_ART_CHR_TRIM");
+ bool.TryParse(NUM_ART_CHR_TRIM, out var numArtCharTrim);
+ newConfObj.Device.NumArtCharTrim = numArtCharTrim;
}
}
@@ -388,27 +404,32 @@ namespace IOB_UT_NEXT.Config
///
/// Info generali delative all'IOB impiegato
///
- public IobDto GenConf { get; set; } = new IobDto();
-
- ///
- /// Info relative al device interconnesso
- ///
- public DeviceDto DeviceConf { get; set; } = new DeviceDto();
+ public IobDto General { get; set; } = new IobDto();
///
/// Parametri server Mapo MES
///
- public ServerMapoDto MapoMesConf { get; set; } = new ServerMapoDto();
+ public ServerMapoDto MapoMes { get; set; } = new ServerMapoDto();
///
/// Setup info verso IOB-MAN
///
- public IobManDto IobManConf { get; set; } = new IobManDto();
+ public IobManDto IobMan { get; set; } = new IobManDto();
+
+ ///
+ /// Info relative al device interconnesso
+ ///
+ public DeviceDto Device { get; set; } = new DeviceDto();
+
+ ///
+ /// Struttura memoria PLC x lettura/scrittura
+ ///
+ public plcMemMapExt Memory { get; set; }
///
/// Setup processing dati in ingresso (es: blink segnali)
///
- public InputSignalDto ProcInputConf { get; set; } = new InputSignalDto();
+ public InputSignalDto SignalProc { get; set; } = new InputSignalDto();
///
/// Dati relativi ai parametri gestione tempo ciclo
@@ -416,39 +437,14 @@ namespace IOB_UT_NEXT.Config
public TCDataDto TCDataConf { get; set; } = new TCDataDto();
///
- /// Configurazione speciale/opzionale per tipo IOB
+ /// Configurazione Allarmi
///
- public SpecializedDto SpecialConf { get; set; }
+ public AlarmDto Alarms { get; set; }
///
/// Configurazione speciale comportamenti IOB (es setup)
///
- public ActionDto ActionConf { get; set; }
-
- ///
- /// Dizionario dei parametri opzionali
- ///
- public Dictionary OptParConf { get; set; } = new Dictionary();
-
- ///
- /// Recupera valore della chiave specifica richiesta
- ///
- ///
- ///
- public string OptParConfGet(string key)
- {
- string answ = "";
- if (OptParConf != null && OptParConf.Count > 0 && OptParConf.ContainsKey(key))
- {
- answ = OptParConf[key];
- }
- return answ;
- }
-
- ///
- /// Dizionario delle chiavi opz da dizionario
- ///
- public Dictionary OptKVP { get; set; } = new Dictionary();
+ public ActionDto Actions { get; set; }
///
/// Dizionario delle traduzioni termini chiave/valore
@@ -470,6 +466,30 @@ namespace IOB_UT_NEXT.Config
return answ;
}
+ ///
+ /// Dizionario dei parametri opzionali
+ ///
+ public Dictionary OptPar { get; set; } = new Dictionary();
+
+ ///
+ /// Recupera valore della chiave specifica richiesta
+ ///
+ ///
+ ///
+ public string OptParGet(string key)
+ {
+ string answ = "";
+ if (OptPar != null && OptPar.Count > 0 && OptPar.ContainsKey(key))
+ {
+ answ = OptPar[key];
+ }
+ return answ;
+ }
+
+ ///
+ /// Configurazione speciale/opzionale per tipo IOB
+ ///
+ public SpecializedDto Special { get; set; }
#region Metodi Serializzazione
@@ -554,7 +574,7 @@ namespace IOB_UT_NEXT.Config
///
protected void lgDebug(string txt2log)
{
- Log.Factory.Configuration.Variables["codIOB"] = GenConf.CodIOB;
+ Log.Factory.Configuration.Variables["codIOB"] = General.CodIOB;
Log.Debug(txt2log);
}
@@ -566,7 +586,7 @@ namespace IOB_UT_NEXT.Config
{
if (!string.IsNullOrEmpty(txt2log))
{
- Log.Factory.Configuration.Variables["codIOB"] = GenConf.CodIOB;
+ Log.Factory.Configuration.Variables["codIOB"] = General.CodIOB;
Log.Error(txt2log);
}
}
@@ -577,7 +597,7 @@ namespace IOB_UT_NEXT.Config
///
protected void lgInfo(string txt2log)
{
- Log.Factory.Configuration.Variables["codIOB"] = GenConf.CodIOB;
+ Log.Factory.Configuration.Variables["codIOB"] = General.CodIOB;
Log.Info(txt2log);
}
@@ -587,7 +607,7 @@ namespace IOB_UT_NEXT.Config
///
protected void lgTrace(string txt2log)
{
- Log.Factory.Configuration.Variables["codIOB"] = GenConf.CodIOB;
+ Log.Factory.Configuration.Variables["codIOB"] = General.CodIOB;
Log.Trace(txt2log);
}
diff --git a/IOB-UT-NEXT/Config/Special/FanucDto.cs b/IOB-UT-NEXT/Config/Special/FanucDto_old.cs
similarity index 96%
rename from IOB-UT-NEXT/Config/Special/FanucDto.cs
rename to IOB-UT-NEXT/Config/Special/FanucDto_old.cs
index 55db1008..3d26403c 100644
--- a/IOB-UT-NEXT/Config/Special/FanucDto.cs
+++ b/IOB-UT-NEXT/Config/Special/FanucDto_old.cs
@@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace IOB_UT_NEXT.Config.Special
{
- public class FanucDto
+ public class FanucDto_old
{
#region Public Properties
diff --git a/IOB-UT-NEXT/Config/Special/MemoryDto.cs b/IOB-UT-NEXT/Config/Special/MemBankDto.cs
similarity index 86%
rename from IOB-UT-NEXT/Config/Special/MemoryDto.cs
rename to IOB-UT-NEXT/Config/Special/MemBankDto.cs
index 14a41b14..1fab6c80 100644
--- a/IOB-UT-NEXT/Config/Special/MemoryDto.cs
+++ b/IOB-UT-NEXT/Config/Special/MemBankDto.cs
@@ -8,9 +8,9 @@ using System.Threading.Tasks;
namespace IOB_UT_NEXT.Config.Special
{
///
- /// Configurazione memoria a banchi (es: Fanuc, Mitsubishi, ...)
+ /// Configurazione memoria a banchi (es: Fanuc, Mitsubishi)
///
- public class MemoryDto
+ public class MemBankDto
{
///
/// Conf aree di memoria da gestire
diff --git a/IOB-UT-NEXT/Config/Special/SpecializedDto.cs b/IOB-UT-NEXT/Config/Special/SpecializedDto.cs
index e9c6b188..3ad1d52a 100644
--- a/IOB-UT-NEXT/Config/Special/SpecializedDto.cs
+++ b/IOB-UT-NEXT/Config/Special/SpecializedDto.cs
@@ -13,9 +13,14 @@ namespace IOB_UT_NEXT.Config.Special
public class SpecializedDto
{
///
- /// Struttura memoria PLC x lettura/scrittura
+ /// Configurazione specifica FANUC/Mitsubishi (ove applicabile)
///
- public plcMemMapExt MemMap { get; set; }
+ public MemBankDto BankConf { get; set; }
+
+ ///
+ /// Parametri speciali per Modbus
+ ///
+ public ModBusTcpParamConf ModbusConf { get; set; }
///
/// Configurazione specifica MTC
@@ -27,20 +32,15 @@ namespace IOB_UT_NEXT.Config.Special
///
public OpcUaParamConf OpcUaConf { get; set; }
- ///
- /// Parametri speciali per Modbus
- ///
- public ModBusTcpParamConf ModbusConf { get; set; }
-
///
/// Configurazione specifica REST
///
public RestParamConf RestConf { get; set; }
///
- /// Configurazione allarmi
+ /// Configurazione specifica Siemens (se applicabile)
///
- public AlarmDto AlarmConf { get; set; }
+ public SiemensDto SiemensConf { get; set; }
}
}
diff --git a/IOB-UT-NEXT/IOB-UT-NEXT.csproj b/IOB-UT-NEXT/IOB-UT-NEXT.csproj
index 30f7216e..c25aab50 100644
--- a/IOB-UT-NEXT/IOB-UT-NEXT.csproj
+++ b/IOB-UT-NEXT/IOB-UT-NEXT.csproj
@@ -169,8 +169,7 @@
-
-
+
diff --git a/IOB-UT-NEXT/plcMemMapExt.cs b/IOB-UT-NEXT/plcMemMapExt.cs
index 6101c67c..e93bab12 100644
--- a/IOB-UT-NEXT/plcMemMapExt.cs
+++ b/IOB-UT-NEXT/plcMemMapExt.cs
@@ -1,4 +1,5 @@
-using MapoSDK;
+using IOB_UT_NEXT.Config.Special;
+using MapoSDK;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -12,18 +13,32 @@ namespace IOB_UT_NEXT
///
/// Dizionario parametri opzionali
///
- public Dictionary optMemPar { get; set; } = new Dictionary();
+ public Dictionary OptMemPar { get; set; } = new Dictionary();
///
/// Dizionario x decodifica file
///
- public Dictionary fileDecod { get; set; } = new Dictionary();
+ public Dictionary FileDecod { get; set; } = new Dictionary();
///
/// Lista ulteriori configurazioni KeyValuePair
///
- public Dictionary optKVP { get; set; } = new Dictionary();
+ public Dictionary OptKVP { get; set; } = new Dictionary();
+ ///
+ /// Recupera valore della chiave specifica richiesta x OptKVP
+ ///
+ ///
+ ///
+ public string OptKVPGet(string key)
+ {
+ string answ = "";
+ if (OptKVP != null && OptKVP.Count > 0 && OptKVP.ContainsKey(key))
+ {
+ answ = OptKVP[key];
+ }
+ return answ;
+ }
///
/// Dizionario opzionale di configurazione memorie WRITE con "alias",
diff --git a/IOB-WIN-BECKHOFF/IobBeckhoff/Beckhoff.cs b/IOB-WIN-BECKHOFF/IobBeckhoff/Beckhoff.cs
index 04c6ef75..3a6af917 100644
--- a/IOB-WIN-BECKHOFF/IobBeckhoff/Beckhoff.cs
+++ b/IOB-WIN-BECKHOFF/IobBeckhoff/Beckhoff.cs
@@ -24,7 +24,7 @@ namespace IOB_WIN_BECKHOFF.IobBeckhoff
{
lgInfo("NEW IobBeckhoff Adapter");
// gestione invio ritardato contapezzi
- pzCountDelay = utils.CRI("pzCountDelay");
+
// init datetime counters
DateTime adesso = DateTime.Now;
lastPzCountSend = adesso;
diff --git a/IOB-WIN-FANUC/DATA/CONF/3004.ini b/IOB-WIN-FANUC/DATA/CONF/3004.ini
index 7342aaac..24c2dfb6 100644
--- a/IOB-WIN-FANUC/DATA/CONF/3004.ini
+++ b/IOB-WIN-FANUC/DATA/CONF/3004.ini
@@ -38,7 +38,7 @@ AREAD_SIZE=0
AREAG_START=0
AREAG_SIZE=48
AREAR_START=0
-AREAR_SIZE=64
+AREAR_SIZE=0
AREAX_START=0
AREAX_SIZE=64
AREAY_START=0
diff --git a/IOB-WIN-FANUC/DATA/CONF/3021.ini b/IOB-WIN-FANUC/DATA/CONF/3021.ini
index 5b34555a..a40f525b 100644
--- a/IOB-WIN-FANUC/DATA/CONF/3021.ini
+++ b/IOB-WIN-FANUC/DATA/CONF/3021.ini
@@ -1,6 +1,7 @@
;Configurazione IOB-WIN
[IOB]
CNCTYPE=FANUC
+EnableRedisQueue=true
[MACHINE]
VENDOR=CITIZEN
@@ -33,11 +34,12 @@ BIT4=Y1.7
BIT5=currPrgName|O5000
AREAD_START=0
AREAD_SIZE=0
+AREAG_START=0
AREAG_SIZE=48
AREAR_START=0
-AREAR_SIZE=0
+AREAR_SIZE=32
AREAX_START=0
-AREAX_SIZE=0
+AREAX_SIZE=8
AREAY_START=0
AREAY_SIZE=8
PAR_START=6711
diff --git a/IOB-WIN-FANUC/DATA/CONF/MAIN.ini b/IOB-WIN-FANUC/DATA/CONF/MAIN.ini
index 4d3a9a76..2e3567f0 100644
--- a/IOB-WIN-FANUC/DATA/CONF/MAIN.ini
+++ b/IOB-WIN-FANUC/DATA/CONF/MAIN.ini
@@ -23,6 +23,7 @@ CLI_INST=SteamWareSim
;STARTLIST=VL27
;STARTLIST=3027
;STARTLIST=EV112
+;STARTLIST=3021
STARTLIST=3004
diff --git a/IOB-WIN-FANUC/IOB-WIN-FANUC.csproj b/IOB-WIN-FANUC/IOB-WIN-FANUC.csproj
index 15c361cf..5dce1496 100644
--- a/IOB-WIN-FANUC/IOB-WIN-FANUC.csproj
+++ b/IOB-WIN-FANUC/IOB-WIN-FANUC.csproj
@@ -163,7 +163,9 @@
-
+
+ Always
+
diff --git a/IOB-WIN-FANUC/Iob/Fanuc.cs b/IOB-WIN-FANUC/Iob/Fanuc.cs
index 2c501577..3bc16145 100644
--- a/IOB-WIN-FANUC/Iob/Fanuc.cs
+++ b/IOB-WIN-FANUC/Iob/Fanuc.cs
@@ -26,91 +26,37 @@ namespace IOB_WIN_FANUC.Iob
RawInput = new byte[6];
// gestione invio ritardato contapezzi
- pzCountDelay = utils.CRI("pzCountDelay");
+
lastPzCountSend = DateTime.Now;
lastWarnODL = DateTime.Now;
-
-#if false
- // inizializzo correttamente aree memoria secondo CONF - iniFileName
- IniFile fIni = new IniFile(IOBConf.iniFileName);
- // inizializzo aree di memoria correnti...
- MemBlockG = new byte[fIni.ReadInteger("MEMORY", "AREAG_SIZE", 8)];
- MemBlockR = new byte[fIni.ReadInteger("MEMORY", "AREAR_SIZE", 8)];
- MemBlockX = new byte[fIni.ReadInteger("MEMORY", "AREAX_SIZE", 8)];
- MemBlockY = new byte[fIni.ReadInteger("MEMORY", "AREAY_SIZE", 8)];
-#endif
int gSize = 8;
int rSize = 8;
int xSize = 8;
int ySize = 8;
- if (IOBConfFull.DeviceConf.MemoryConf.AreaConf.ContainsKey("AREAG"))
+ if (IOBConfFull.Special.BankConf.AreaConf.ContainsKey("AREAG"))
{
- gSize = IOBConfFull.DeviceConf.MemoryConf.AreaConf["AREAG"].Size;
+ gSize = IOBConfFull.Special.BankConf.AreaConf["AREAG"].Size;
}
- if (IOBConfFull.DeviceConf.MemoryConf.AreaConf.ContainsKey("AREAR"))
+ if (IOBConfFull.Special.BankConf.AreaConf.ContainsKey("AREAR"))
{
- rSize = IOBConfFull.DeviceConf.MemoryConf.AreaConf["AREAR"].Size;
+ rSize = IOBConfFull.Special.BankConf.AreaConf["AREAR"].Size;
}
- if (IOBConfFull.DeviceConf.MemoryConf.AreaConf.ContainsKey("AREAX"))
+ if (IOBConfFull.Special.BankConf.AreaConf.ContainsKey("AREAX"))
{
- xSize = IOBConfFull.DeviceConf.MemoryConf.AreaConf["AREAX"].Size;
+ xSize = IOBConfFull.Special.BankConf.AreaConf["AREAX"].Size;
}
- if (IOBConfFull.DeviceConf.MemoryConf.AreaConf.ContainsKey("AREAY"))
+ if (IOBConfFull.Special.BankConf.AreaConf.ContainsKey("AREAY"))
{
- ySize = IOBConfFull.DeviceConf.MemoryConf.AreaConf["AREAY"].Size;
+ ySize = IOBConfFull.Special.BankConf.AreaConf["AREAY"].Size;
}
MemBlockG = new byte[gSize];
MemBlockR = new byte[rSize];
MemBlockX = new byte[xSize];
MemBlockY = new byte[ySize];
-#if false
- MemBlockG = new byte[IOBConfFull.DeviceConf.FanucConf.SizeAreaG];
- MemBlockR = new byte[IOBConfFull.DeviceConf.FanucConf.SizeAreaR];
- MemBlockX = new byte[IOBConfFull.DeviceConf.FanucConf.SizeAreaX];
- MemBlockY = new byte[IOBConfFull.DeviceConf.FanucConf.SizeAreaY];
-#endif
// loggo aree di memoria avviate...
lgInfo($"Init area di memoria | MemBlockG: {gSize}b | MemBlockR: {rSize}b | MemBlockX: {xSize}b | MemBlockY: {ySize}b ");
-#if false
- // fix enable prgName
- enablePrgName = fIni.ReadBoolean("CNC", "GETPRGNAME", true);
-#endif
-
- // salvo le aree X-Y-D (per dump/sample/ottimizzazione lettura)
-#if false
- areaD = new memAreaFanuc
- {
- areaName = "AreaD",
- startIdx = fIni.ReadInteger("MEMORY", "AREAD_START", 0),
- arraySize = fIni.ReadInteger("MEMORY", "AREAD_SIZE", 0)
- };
- areaPAR = new memAreaFanuc
- {
- areaName = "AreaPARR",
- startIdx = fIni.ReadInteger("MEMORY", "PAR_START", 0),
- arraySize = fIni.ReadInteger("MEMORY", "PAR_SIZE", 0)
- };
- areaR = new memAreaFanuc
- {
- areaName = "AreaR",
- startIdx = fIni.ReadInteger("MEMORY", "AREAR_START", 0),
- arraySize = fIni.ReadInteger("MEMORY", "AREAR_SIZE", 0)
- };
- areaX = new memAreaFanuc
- {
- areaName = "AreaX",
- startIdx = fIni.ReadInteger("MEMORY", "AREAX_START", 0),
- arraySize = fIni.ReadInteger("MEMORY", "AREAX_SIZE", 0)
- };
- areaY = new memAreaFanuc
- {
- areaName = "AreaY",
- startIdx = fIni.ReadInteger("MEMORY", "AREAY_START", 0),
- arraySize = fIni.ReadInteger("MEMORY", "AREAY_SIZE", 0)
- };
-#endif
areaD = FormatAreaFanuc("AreaD", "AREAD");
areaPAR = FormatAreaFanuc("AreaPARR", "PAR");
areaR = FormatAreaFanuc("AreaR", "AREAR");
@@ -118,53 +64,13 @@ namespace IOB_WIN_FANUC.Iob
areaY = FormatAreaFanuc("AreaY", "AREAY");
- lgInfo($"Set Mem: {areaD.areaName} | {areaD.startIdx} | {areaD.arraySize} byte");
- lgInfo($"Set Mem: {areaR.areaName} | {areaR.startIdx} | {areaR.arraySize} byte");
- lgInfo($"Set Mem: {areaX.areaName} | {areaX.startIdx} | {areaX.arraySize} byte");
- lgInfo($"Set Mem: {areaY.areaName} | {areaY.startIdx} | {areaY.arraySize} byte");
+ lgInfo($"Set Mem | {areaD.areaName}: {areaD.startIdx} +{areaD.arraySize} | {areaR.areaName}: {areaR.startIdx} +{areaR.arraySize} | {areaX.areaName}: {areaX.startIdx} +{areaX.arraySize} | {areaY.areaName}: {areaY.startIdx} +{areaY.arraySize}");
- // effettuo lettura della conf sigLUT... cercando 1:1 i bit...
-#if false
- string currBit = "";
- string memArea = "";
- for (int i = 0; i < 8; i++)
- {
- currBit = $"BIT{i}";
- memArea = fIni.ReadString("MEMORY", currBit, "");
- // se trovo un valore...
- if (!string.IsNullOrEmpty(memArea))
- {
- signLUT.Add(currBit, memArea);
- }
- }
-#endif
- signLUT = IOBConfFull.DeviceConf.SignalLUT;
-
- // gestione override contapezzi
- enablePzCountByApp = utils.CRB("enableContapezzi");
- enablePzCountByIob = (getOptPar("ENABLE_PZCOUNT") == "TRUE");
- disablePzCountByIob = (getOptPar("DISABLE_PZCOUNT") == "TRUE");
-
- // gestione override idx articoli...
- if (!string.IsNullOrEmpty(getOptPar("NUM_ART_CHR_TRIM")))
- {
- string NUM_ART_CHR_TRIM = getOptPar("NUM_ART_CHR_TRIM");
- bool.TryParse(NUM_ART_CHR_TRIM, out numArtCharTrim);
- }
-
-#if false
- // leggo conf x ricerca valori memoria da tracciare in log di continuo...
- mem2trace = fIni.ReadString("OPTPAR", "MEM_2_TRACE", "");
-#endif
- mem2trace = IOBConfFull.DeviceConf.MemoryConf.Mem2Trace;
-
- // è little endian (NON serve conversione)
- hasBigEndian = false;
- lgInfoStartup($"Start init Adapter FANUC all'IP {IOBConfFull.DeviceConf.ConnectConf.IpAddr}:{IOBConfFull.DeviceConf.ConnectConf.Port} per IOB {IOBConfFull.GenConf.CodIOB}");
+ lgInfoStartup($"Start init Adapter FANUC all'IP {IOBConfFull.Device.Connect.IpAddr}:{IOBConfFull.Device.Connect.Port} per IOB {IOBConfFull.General.CodIOB}");
// Creo oggetto connessione NC
parentForm.commPlcActive = true;
- Runtime.CreateNC(CNC.NcType.FANUC, IOBConfFull.DeviceConf.ConnectConf.IpAddr, IOBConfFull.DeviceConf.ConnectConf.Port);
+ Runtime.CreateNC(CNC.NcType.FANUC, IOBConfFull.Device.Connect.IpAddr, IOBConfFull.Device.Connect.Port);
parentForm.commPlcActive = false;
// aggiungo referenza obj FANUC
@@ -183,16 +89,16 @@ namespace IOB_WIN_FANUC.Iob
tryDisconnect();
lgInfo("FANUC: tryConnect");
tryConnect();
- if ((enablePzCountByApp || enablePzCountByIob) && !(disablePzCountByIob))
+ if (enablePzCountByApp)
{
lgInfo("FANUC: inizio gestione contapezzi");
try
{
// verifico quale modalità sia richiesta: STD (6711) oppure BIT (Custom, con
// indicazione area)
- if (IOBConfFull.OptParConf.Count > 0 && !string.IsNullOrEmpty(getOptPar("PZCOUNT_MODE")))
+ if (!string.IsNullOrEmpty(IOBConfFull.Device.PzCountMode))
{
- if (getOptPar("PZCOUNT_MODE").StartsWith("STD"))
+ if (IOBConfFull.Device.PzCountMode.StartsWith("STD"))
{
lgInfo("Init contapezzi FANUC: pzCntReload(true)");
pzCntReload(true);
@@ -206,13 +112,13 @@ namespace IOB_WIN_FANUC.Iob
else
{
contapezziIOB = 0;
- lgInfo("Contapezzi STD disabilitato: modalità {0}", getOptPar("PZCOUNT_MODE"));
+ lgInfo($"Contapezzi STD disabilitato: modalità {IOBConfFull.Device.PzCountMode}");
}
}
else
{
contapezziIOB = 0;
- lgInfo("Parametro mancante PZCOUNT_MODE");
+ lgInfo("Parametro mancante PzCountMode");
}
}
catch (Exception exc)
@@ -233,9 +139,9 @@ namespace IOB_WIN_FANUC.Iob
private memAreaFanuc FormatAreaFanuc(string aName, string mKey)
{
var newArea = new memAreaFanuc() { areaName = aName };
- if (IOBConfFull.DeviceConf.MemoryConf.AreaConf.ContainsKey(mKey))
+ if (IOBConfFull.Special.BankConf.AreaConf.ContainsKey(mKey))
{
- var thisConf = IOBConfFull.DeviceConf.MemoryConf.AreaConf[mKey];
+ var thisConf = IOBConfFull.Special.BankConf.AreaConf[mKey];
newArea.startIdx = thisConf.Start;
newArea.arraySize = thisConf.Size;
@@ -294,7 +200,7 @@ namespace IOB_WIN_FANUC.Iob
}
else
{
- taskVal = $"NO MemMap found, SET task: {item.Key} --> {newVal} ({item.Value})";
+ taskVal = $"NO BankConf found, SET task: {item.Key} --> {newVal} ({item.Value})";
}
upsertKey(item.Key, item.Value);
break;
@@ -345,7 +251,7 @@ namespace IOB_WIN_FANUC.Iob
}
else
{
- taskVal = $"NO MemMap found, SET task: {item.Key} --> {newVal} ({item.Value})";
+ taskVal = $"NO BankConf found, SET task: {item.Key} --> {newVal} ({item.Value})";
}
// invio a controller...
@@ -401,7 +307,7 @@ namespace IOB_WIN_FANUC.Iob
}
else
{
- taskVal = $"NO MemMap found, SET task: {item.Key} --> {newVal} ({item.Value})";
+ taskVal = $"NO BankConf found, SET task: {item.Key} --> {newVal} ({item.Value})";
}
// invio a controller...
@@ -465,7 +371,7 @@ namespace IOB_WIN_FANUC.Iob
case taskType.stopSetup:
// reset contapezzi fine setup SE ESPLICITAMENTE IMPOSTATO
- if (IOBConfFull.OptParConf.Count > 0 && getOptPar("ENABLE_PZ_RESET_stopSetup") == "TRUE")
+ if (IOBConfFull.OptPar.Count > 0 && getOptPar("ENABLE_PZ_RESET_stopSetup") == "TRUE")
{
taskOk = resetContapezziPLC();
}
@@ -628,7 +534,7 @@ namespace IOB_WIN_FANUC.Iob
EgwProxy.MultiCncLib.Focas1.ODBDY2_1 answ = FANUC_ref.getAllDynData();
if (utils.CRB("recTime"))
{
- TimingData.addResult(IOBConfFull.GenConf.CodIOB, string.Format("PROC-DYN-DATA"), sw.ElapsedTicks);
+ TimingData.addResult(IOBConfFull.General.CodIOB, string.Format("PROC-DYN-DATA"), sw.ElapsedTicks);
}
try
@@ -727,7 +633,7 @@ namespace IOB_WIN_FANUC.Iob
EgwProxy.MultiCncLib.Focas1.ODBSYS answ = FANUC_ref.getSysInfo();
if (utils.CRB("recTime"))
{
- TimingData.addResult(IOBConfFull.GenConf.CodIOB, string.Format("SYS-INFO"), sw.ElapsedTicks);
+ TimingData.addResult(IOBConfFull.General.CodIOB, string.Format("SYS-INFO"), sw.ElapsedTicks);
}
try
@@ -763,7 +669,7 @@ namespace IOB_WIN_FANUC.Iob
///
public override void processContapezzi()
{
- if ((enablePzCountByApp || enablePzCountByIob) && !(disablePzCountByIob))
+ if (enablePzCountByApp)
{
// procedo SOLO SE ho connessione...
if (connectionOk)
@@ -771,14 +677,14 @@ namespace IOB_WIN_FANUC.Iob
try
{
// controllo di AVERE parametri opzionali x conteggi vari
- if (IOBConfFull.OptParConf.Count > 0)
+ if (IOBConfFull.OptPar.Count > 0)
{
// contapezzi ATTUALE
- if (!string.IsNullOrEmpty(getOptPar("PZCOUNT_MODE")))
+ if (!string.IsNullOrEmpty(IOBConfFull.Device.PzCountMode))
{
// verifico quale modalità sia richiesta: STD (6711) oppure BIT
// (Custom, con indicazione area)
- string memAddr = getOptPar("PZCOUNT_MODE");
+ string memAddr = IOBConfFull.Device.PzCountMode;
if (memAddr.StartsWith("STD"))
{
// inizio verifica area memoria/parametro levando prima parte codice
@@ -801,7 +707,7 @@ namespace IOB_WIN_FANUC.Iob
FANUC_ref.F_RW_Param_Integer(false, cntAddr, 3, ref outputVal);
if (utils.CRB("recTime"))
{
- TimingData.addResult(IOBConfFull.GenConf.CodIOB, string.Format("R{0}-PAR", 4), sw.ElapsedTicks);
+ TimingData.addResult(IOBConfFull.General.CodIOB, string.Format("R{0}-PAR", 4), sw.ElapsedTicks);
}
// salvo ultimo conteggio rilevato
int newVal = -1;
@@ -820,7 +726,7 @@ namespace IOB_WIN_FANUC.Iob
FANUC_ref.F_Read_macro(cntAddr, ref macroVal);
if (utils.CRB("recTime"))
{
- TimingData.addResult(IOBConfFull.GenConf.CodIOB, string.Format("R{0}-MACRO", 5), sw.ElapsedTicks);
+ TimingData.addResult(IOBConfFull.General.CodIOB, string.Format("R{0}-MACRO", 5), sw.ElapsedTicks);
}
// salvo ultimo conteggio rilevato
int newVal = -1;
@@ -875,7 +781,7 @@ namespace IOB_WIN_FANUC.Iob
}
if (utils.CRB("recTime"))
{
- TimingData.addResult(IOBConfFull.GenConf.CodIOB, string.Format("R-{0}.{1}.{2}", areaCounter.mType, areaCounter.mPos, areaCounter.vType), sw.ElapsedTicks);
+ TimingData.addResult(IOBConfFull.General.CodIOB, string.Format("R-{0}.{1}.{2}", areaCounter.mType, areaCounter.mPos, areaCounter.vType), sw.ElapsedTicks);
}
// salvo...
int newVal = -1;
@@ -924,7 +830,7 @@ namespace IOB_WIN_FANUC.Iob
FanucMemRW(R, FANUC.MemType.G, memIndex, ref MemBlockG);
if (utils.CRB("recTime"))
{
- TimingData.addResult(IOBConfFull.GenConf.CodIOB, string.Format("R{0}-G-AREA", MemBlockG.Length), sw.ElapsedTicks);
+ TimingData.addResult(IOBConfFull.General.CodIOB, string.Format("R{0}-G-AREA", MemBlockG.Length), sw.ElapsedTicks);
}
sw.Stop();
@@ -961,7 +867,7 @@ namespace IOB_WIN_FANUC.Iob
try
{
// controllo di AVERE parametri opzionali x conteggi vari
- if (IOBConfFull.OptParConf.Count > 0)
+ if (IOBConfFull.OptPar.Count > 0)
{
// gestione con ricerca in memoria Write / optPar...
if (string.IsNullOrEmpty(memAddrPzReq))
@@ -1055,7 +961,7 @@ namespace IOB_WIN_FANUC.Iob
FanucMemRW(R, FANUC.MemType.R, areaR.startIdx, ref MemBlockR);
if (utils.CRB("recTime"))
{
- TimingData.addResult(IOBConfFull.GenConf.CodIOB, string.Format("R{0}-R", MemBlockR.Length), sw.ElapsedTicks);
+ TimingData.addResult(IOBConfFull.General.CodIOB, string.Format("R{0}-R", MemBlockR.Length), sw.ElapsedTicks);
}
// log
if (verboseLog)
@@ -1073,7 +979,7 @@ namespace IOB_WIN_FANUC.Iob
FanucMemRW(R, FANUC.MemType.X, areaX.startIdx, ref MemBlockX);
if (utils.CRB("recTime"))
{
- TimingData.addResult(IOBConfFull.GenConf.CodIOB, string.Format("R{0}-X", MemBlockX.Length), sw.ElapsedTicks);
+ TimingData.addResult(IOBConfFull.General.CodIOB, string.Format("R{0}-X", MemBlockX.Length), sw.ElapsedTicks);
}
// log
if (verboseLog)
@@ -1091,7 +997,7 @@ namespace IOB_WIN_FANUC.Iob
FanucMemRW(R, FANUC.MemType.Y, areaY.startIdx, ref MemBlockY);
if (utils.CRB("recTime"))
{
- TimingData.addResult(IOBConfFull.GenConf.CodIOB, string.Format("R{0}-Y", MemBlockY.Length), sw.ElapsedTicks);
+ TimingData.addResult(IOBConfFull.General.CodIOB, string.Format("R{0}-Y", MemBlockY.Length), sw.ElapsedTicks);
}
// log
if (verboseLog)
@@ -1129,17 +1035,17 @@ namespace IOB_WIN_FANUC.Iob
{
bool answ = false;
// ...SE abilitato da conf IOB
- if (IOBConfFull.OptParConf.Count > 0 && getOptPar("ENABLE_PZ_RESET") == "TRUE")
+ if (IOBConfFull.OptPar.Count > 0 && getOptPar("ENABLE_PZ_RESET") == "TRUE")
{
// scrivo valore 0 x il contapezzi
try
{
// contapezzi ATTUALE
- if (!string.IsNullOrEmpty(getOptPar("PZCOUNT_MODE")))
+ if (!string.IsNullOrEmpty(IOBConfFull.Device.PzCountMode))
{
// verifico quale modalità sia richiesta: STD (6711) oppure BIT (Custom, con
// indicazione area)
- string memAddr = getOptPar("PZCOUNT_MODE");
+ string memAddr = IOBConfFull.Device.PzCountMode;
if (memAddr.StartsWith("STD"))
{
// inizio verifica area memoria/parametro levando prima parte codice
@@ -1165,7 +1071,7 @@ namespace IOB_WIN_FANUC.Iob
FANUC_ref.F_RW_Param_Integer(true, cntAddr, 3, ref newVal);
if (utils.CRB("recTime"))
{
- TimingData.addResult(IOBConfFull.GenConf.CodIOB, string.Format("W{0}-PAR", 4), sw.ElapsedTicks);
+ TimingData.addResult(IOBConfFull.General.CodIOB, string.Format("W{0}-PAR", 4), sw.ElapsedTicks);
}
}
else if (memAddr.StartsWith("MACRO."))
@@ -1182,7 +1088,7 @@ namespace IOB_WIN_FANUC.Iob
answ = FanucMemMacroRW(true, cntAddr, ref vTransf);
if (utils.CRB("recTime"))
{
- TimingData.addResult(IOBConfFull.GenConf.CodIOB, "MACRO-SHORT", sw.ElapsedTicks);
+ TimingData.addResult(IOBConfFull.General.CodIOB, "MACRO-SHORT", sw.ElapsedTicks);
}
}
// altrimenti se legge da area memoria specifica leggo da li... formto tipo STD.D.1604.DW
@@ -1221,7 +1127,7 @@ namespace IOB_WIN_FANUC.Iob
}
if (utils.CRB("recTime"))
{
- TimingData.addResult(IOBConfFull.GenConf.CodIOB, string.Format("W-{0}.{1}.{2}", areaCounter.mType, areaCounter.mPos, areaCounter.vType), sw.ElapsedTicks);
+ TimingData.addResult(IOBConfFull.General.CodIOB, string.Format("W-{0}.{1}.{2}", areaCounter.mType, areaCounter.mPos, areaCounter.vType), sw.ElapsedTicks);
}
}
sw.Stop();
@@ -1279,7 +1185,7 @@ namespace IOB_WIN_FANUC.Iob
bool answ = false;
string memAddr = memAddrArt;
lgTrace($"INIT setNumArt | memAddr: {memAddr}");
- if (IOBConfFull.OptParConf.Count > 0 && !string.IsNullOrEmpty(memAddr))
+ if (IOBConfFull.OptPar.Count > 0 && !string.IsNullOrEmpty(memAddr))
{
// scrivo valore richiesto in area configurata
try
@@ -1305,7 +1211,7 @@ namespace IOB_WIN_FANUC.Iob
lgTrace($"MACRO | ART Write 02 | memAddr: {memAddr} | valReq: {valReq} | vTransf: {vTransf}");
if (utils.CRB("recTime"))
{
- TimingData.addResult(IOBConfFull.GenConf.CodIOB, "MACRO-SHORT", sw.ElapsedTicks);
+ TimingData.addResult(IOBConfFull.General.CodIOB, "MACRO-SHORT", sw.ElapsedTicks);
}
}
sw.Stop();
@@ -1329,7 +1235,7 @@ namespace IOB_WIN_FANUC.Iob
// verifico quale modalità sia richiesta
string memAddr = memAddrCom;
lgTrace($"INIT setNumCom | memAddr: {memAddr}");
- if (IOBConfFull.OptParConf.Count > 0 && !string.IsNullOrEmpty(memAddr))
+ if (IOBConfFull.OptPar.Count > 0 && !string.IsNullOrEmpty(memAddr))
{
lgTrace($"setNumCom | memAddr: {memAddr} | valReq: {valReq}");
// scrivo valore richiesto in area configurata
@@ -1354,7 +1260,7 @@ namespace IOB_WIN_FANUC.Iob
lgTrace($"MACRO | Com Write 02 | memAddr: {memAddr} | valReq: {valReq} | vTransf: {vTransf}");
if (utils.CRB("recTime"))
{
- TimingData.addResult(IOBConfFull.GenConf.CodIOB, "MACRO-SHORT", sw.ElapsedTicks);
+ TimingData.addResult(IOBConfFull.General.CodIOB, "MACRO-SHORT", sw.ElapsedTicks);
}
}
sw.Stop();
@@ -1373,7 +1279,7 @@ namespace IOB_WIN_FANUC.Iob
{
bool answ = false;
// ...SE abilitato da conf IOB
- if (IOBConfFull.OptParConf.Count > 0 && getOptPar("ENABLE_PZ_CNT") == "TRUE")
+ if (IOBConfFull.OptPar.Count > 0 && getOptPar("ENABLE_PZ_CNT") == "TRUE")
{
// scrivo valore del contapezzi
try
@@ -1410,7 +1316,7 @@ namespace IOB_WIN_FANUC.Iob
FANUC_ref.F_RW_Param_Integer(true, cntAddr, 3, ref newVal);
if (utils.CRB("recTime"))
{
- TimingData.addResult(IOBConfFull.GenConf.CodIOB, string.Format("W{0}-PAR", 4), sw.ElapsedTicks);
+ TimingData.addResult(IOBConfFull.General.CodIOB, string.Format("W{0}-PAR", 4), sw.ElapsedTicks);
}
}
else if (memAddr.StartsWith("MACRO."))
@@ -1444,7 +1350,7 @@ namespace IOB_WIN_FANUC.Iob
}
if (utils.CRB("recTime"))
{
- TimingData.addResult(IOBConfFull.GenConf.CodIOB, "MACRO-SHORT", sw.ElapsedTicks);
+ TimingData.addResult(IOBConfFull.General.CodIOB, "MACRO-SHORT", sw.ElapsedTicks);
}
}
// altrimenti se legge da area memoria specifica leggo da li... formto tipo STD.D.1604.DW
@@ -1483,7 +1389,7 @@ namespace IOB_WIN_FANUC.Iob
}
if (utils.CRB("recTime"))
{
- TimingData.addResult(IOBConfFull.GenConf.CodIOB, string.Format("W-{0}.{1}.{2}", areaCounter.mType, areaCounter.mPos, areaCounter.vType), sw.ElapsedTicks);
+ TimingData.addResult(IOBConfFull.General.CodIOB, string.Format("W-{0}.{1}.{2}", areaCounter.mType, areaCounter.mPos, areaCounter.vType), sw.ElapsedTicks);
}
}
sw.Stop();
@@ -1507,7 +1413,7 @@ namespace IOB_WIN_FANUC.Iob
{
bool answ = false;
// ...SE abilitato da conf IOB
- if (IOBConfFull.OptParConf.Count > 0 && getOptPar("ENABLE_PZ_REQ") == "TRUE")
+ if (IOBConfFull.OptPar.Count > 0 && getOptPar("ENABLE_PZ_REQ") == "TRUE")
{
// scrivo valore 0 x il contapezzi
try
@@ -1544,7 +1450,7 @@ namespace IOB_WIN_FANUC.Iob
FANUC_ref.F_RW_Param_Integer(true, cntAddr, 3, ref newVal);
if (utils.CRB("recTime"))
{
- TimingData.addResult(IOBConfFull.GenConf.CodIOB, string.Format("W{0}-PAR", 4), sw.ElapsedTicks);
+ TimingData.addResult(IOBConfFull.General.CodIOB, string.Format("W{0}-PAR", 4), sw.ElapsedTicks);
}
}
else if (memAddr.StartsWith("MACRO."))
@@ -1578,7 +1484,7 @@ namespace IOB_WIN_FANUC.Iob
}
if (utils.CRB("recTime"))
{
- TimingData.addResult(IOBConfFull.GenConf.CodIOB, "MACRO-SHORT", sw.ElapsedTicks);
+ TimingData.addResult(IOBConfFull.General.CodIOB, "MACRO-SHORT", sw.ElapsedTicks);
}
}
// altrimenti se legge da area memoria specifica leggo da li... formto tipo STD.D.1604.DW
@@ -1617,7 +1523,7 @@ namespace IOB_WIN_FANUC.Iob
}
if (utils.CRB("recTime"))
{
- TimingData.addResult(IOBConfFull.GenConf.CodIOB, string.Format("W-{0}.{1}.{2}", areaCounter.mType, areaCounter.mPos, areaCounter.vType), sw.ElapsedTicks);
+ TimingData.addResult(IOBConfFull.General.CodIOB, string.Format("W-{0}.{1}.{2}", areaCounter.mType, areaCounter.mPos, areaCounter.vType), sw.ElapsedTicks);
}
}
sw.Stop();
@@ -1652,7 +1558,7 @@ namespace IOB_WIN_FANUC.Iob
// ora PING!!!
Ping pingSender = new Ping();
IPAddress address = IPAddress.Loopback;
- IPAddress.TryParse(IOBConfFull.DeviceConf.ConnectConf.IpAddr, out address);
+ IPAddress.TryParse(IOBConfFull.Device.Connect.IpAddr, out address);
PingReply reply;
try
{
@@ -1663,7 +1569,7 @@ namespace IOB_WIN_FANUC.Iob
}
else
{
- reply = pingSender.Send(IOBConfFull.DeviceConf.ConnectConf.IpAddr, 100);
+ reply = pingSender.Send(IOBConfFull.Device.Connect.IpAddr, 100);
}
}
catch
@@ -1710,7 +1616,7 @@ namespace IOB_WIN_FANUC.Iob
connectionOk = false;
if (verboseLog || periodicLog)
{
- lgInfo($"Attenzione: controllo PING fallito per IP {IOBConfFull.DeviceConf.ConnectConf.PingIpAddr} - {reply.Status}");
+ lgInfo($"Attenzione: controllo PING fallito per IP {IOBConfFull.Device.Connect.PingIpAddr} - {reply.Status}");
}
}
}
@@ -1759,7 +1665,10 @@ namespace IOB_WIN_FANUC.Iob
///
/// LookUpTable di decodifica da CNC a segnali tipo bitmap MAPO
///
- internal Dictionary signLUT = new Dictionary();
+ internal Dictionary signLUT
+ {
+ get => IOBConfFull.Device.SigLUT;
+ }
#endregion Internal Fields
@@ -2005,7 +1914,7 @@ namespace IOB_WIN_FANUC.Iob
// se non trovato... leggo da OPT_PAR
if (string.IsNullOrEmpty(memAddr))
{
- memAddr = getOptPar("PZCOUNT_MODE");
+ memAddr = IOBConfFull.Device.PzCountMode;
}
// bonifica variabile da definizione STD iniziale...
if (memAddr.StartsWith("STD"))
@@ -2344,7 +2253,7 @@ namespace IOB_WIN_FANUC.Iob
lgInfo($"Differenza Contapezzi: contapezziPLC: {contapezziPLC} | contapezziIOB {contapezziIOB}");
}
- if ((enablePzCountByApp || enablePzCountByIob) && !(disablePzCountByIob))
+ if (enablePzCountByApp)
{
// verifico se variato contapezzi...
if (contapezziPLC > contapezziIOB)
@@ -2605,7 +2514,7 @@ namespace IOB_WIN_FANUC.Iob
FanucMemRW(R, tipoMem, memIndex, ref MemBlockCurr);
if (utils.CRB("recTime"))
{
- TimingData.addResult(IOBConfFull.GenConf.CodIOB, string.Format("R{0}-{1}", MemBlockCurr.Length, tipoMem), sw.ElapsedTicks);
+ TimingData.addResult(IOBConfFull.General.CodIOB, string.Format("R{0}-{1}", MemBlockCurr.Length, tipoMem), sw.ElapsedTicks);
}
if (verboseLog)
@@ -2616,16 +2525,16 @@ namespace IOB_WIN_FANUC.Iob
// seconda del tipo di lettura definisco i nomi delle variabili...
if (tipo == dumpType.SAMPLE)
{
- nomeFileB = string.Format(@"{0}\SAMPLES\{1}_{2}_Byte_{3:yyyyMMdd_HHmmss}.dat", utils.dataDatDir, IOBConfFull.GenConf.CodIOB, tipoMem, adesso);
- nomeFileW = string.Format(@"{0}\SAMPLES\{1}_{2}_W_{3:yyyyMMdd_HHmmss}.dat", utils.dataDatDir, IOBConfFull.GenConf.CodIOB, tipoMem, adesso);
- nomeFileDW = string.Format(@"{0}\SAMPLES\{1}_{2}_DW_{3:yyyyMMdd_HHmmss}.dat", utils.dataDatDir, IOBConfFull.GenConf.CodIOB, tipoMem, adesso);
+ nomeFileB = string.Format(@"{0}\SAMPLES\{1}_{2}_Byte_{3:yyyyMMdd_HHmmss}.dat", utils.dataDatDir, IOBConfFull.General.CodIOB, tipoMem, adesso);
+ nomeFileW = string.Format(@"{0}\SAMPLES\{1}_{2}_W_{3:yyyyMMdd_HHmmss}.dat", utils.dataDatDir, IOBConfFull.General.CodIOB, tipoMem, adesso);
+ nomeFileDW = string.Format(@"{0}\SAMPLES\{1}_{2}_DW_{3:yyyyMMdd_HHmmss}.dat", utils.dataDatDir, IOBConfFull.General.CodIOB, tipoMem, adesso);
}
else
{
// salvo in file i dati letti come BYTE
- nomeFileB = string.Format(@"{0}\{1}_{2}_Byte.dat", utils.dataDatDir, IOBConfFull.GenConf.CodIOB, tipoMem);
- nomeFileW = string.Format(@"{0}\{1}_{2}_W.dat", utils.dataDatDir, IOBConfFull.GenConf.CodIOB, tipoMem);
- nomeFileDW = string.Format(@"{0}\{1}_{2}_DW.dat", utils.dataDatDir, IOBConfFull.GenConf.CodIOB, tipoMem);
+ nomeFileB = string.Format(@"{0}\{1}_{2}_Byte.dat", utils.dataDatDir, IOBConfFull.General.CodIOB, tipoMem);
+ nomeFileW = string.Format(@"{0}\{1}_{2}_W.dat", utils.dataDatDir, IOBConfFull.General.CodIOB, tipoMem);
+ nomeFileDW = string.Format(@"{0}\{1}_{2}_DW.dat", utils.dataDatDir, IOBConfFull.General.CodIOB, tipoMem);
}
// salvo in file i dati letti come BYTE
@@ -2688,7 +2597,7 @@ namespace IOB_WIN_FANUC.Iob
if (utils.CRB("recTime"))
{
- TimingData.addResult(IOBConfFull.GenConf.CodIOB, string.Format("R{0}-PAR", 4 * numPar), sw.ElapsedTicks);
+ TimingData.addResult(IOBConfFull.General.CodIOB, string.Format("R{0}-PAR", 4 * numPar), sw.ElapsedTicks);
}
if (verboseLog)
@@ -2699,11 +2608,11 @@ namespace IOB_WIN_FANUC.Iob
// seconda del tipo di lettura definisco i nomi delle variabili...
if (tipo == dumpType.SAMPLE)
{
- nomeFile = string.Format(@"{0}\SAMPLES\{1}_{2}_{3:yyyyMMdd_HHmmss}.dat", utils.dataDatDir, IOBConfFull.GenConf.CodIOB, "PAR", adesso);
+ nomeFile = string.Format(@"{0}\SAMPLES\{1}_{2}_{3:yyyyMMdd_HHmmss}.dat", utils.dataDatDir, IOBConfFull.General.CodIOB, "PAR", adesso);
}
else
{
- nomeFile = string.Format(@"{0}\{1}_{2}.dat", utils.dataDatDir, IOBConfFull.GenConf.CodIOB, "PAR");
+ nomeFile = string.Format(@"{0}\{1}_{2}.dat", utils.dataDatDir, IOBConfFull.General.CodIOB, "PAR");
}
// salvo in file i dati letti
@@ -2743,7 +2652,7 @@ namespace IOB_WIN_FANUC.Iob
FANUC_ref.F_RW_Param_Integer(false, cntAddr, 3, ref outputVal);
if (utils.CRB("recTime"))
{
- TimingData.addResult(IOBConfFull.GenConf.CodIOB, string.Format("R{0}-PAR", 4), sw.ElapsedTicks);
+ TimingData.addResult(IOBConfFull.General.CodIOB, string.Format("R{0}-PAR", 4), sw.ElapsedTicks);
}
// salvo valore
answ = outputVal.ToString();
@@ -2760,7 +2669,7 @@ namespace IOB_WIN_FANUC.Iob
FANUC_ref.F_Read_macro(cntAddr, ref macroVal);
if (utils.CRB("recTime"))
{
- TimingData.addResult(IOBConfFull.GenConf.CodIOB, "R-MACRO", sw.ElapsedTicks);
+ TimingData.addResult(IOBConfFull.General.CodIOB, "R-MACRO", sw.ElapsedTicks);
}
// salvo valore
answ = macroVal.ToString();
@@ -2814,7 +2723,7 @@ namespace IOB_WIN_FANUC.Iob
}
if (utils.CRB("recTime"))
{
- TimingData.addResult(IOBConfFull.GenConf.CodIOB, string.Format("R-{0}.{1}.{2}", areaCounter.mType, areaCounter.mPos, areaCounter.vType), sw.ElapsedTicks);
+ TimingData.addResult(IOBConfFull.General.CodIOB, string.Format("R-{0}.{1}.{2}", areaCounter.mType, areaCounter.mPos, areaCounter.vType), sw.ElapsedTicks);
}
// salvo...
diff --git a/IOB-WIN-FORM/AdapterForm.cs b/IOB-WIN-FORM/AdapterForm.cs
index ad826456..d6027ae4 100644
--- a/IOB-WIN-FORM/AdapterForm.cs
+++ b/IOB-WIN-FORM/AdapterForm.cs
@@ -31,20 +31,18 @@ namespace IOB_WIN_FORM
///
/// Modello macchina
///
- public string curModel = "";
+ public string curModel
+ {
+ get => IOBConfFull != null ? IOBConfFull.Device.Model : "";
+ }
///
/// Vendor macchina
///
- public string curVendor = "";
-
-#if false
- ///
- /// configurazione caricata
- ///
- public IobConfiguration IOBConf;
-#endif
-
+ public string curVendor
+ {
+ get => IOBConfFull != null ? IOBConfFull.Device.Vendor : "";
+ }
///
/// Configurazione gerarchica completa (v 4.x.x.x)
///
@@ -58,7 +56,10 @@ namespace IOB_WIN_FORM
///
/// tipo di adapter prescelto...
///
- public tipoAdapter tipoScelto = tipoAdapter.SIMULA;
+ public tipoAdapter tipoScelto
+ {
+ get => IOBConfFull != null ? IOBConfFull.General.IobType : tipoAdapter.ND;
+ }
#endregion Public Fields
@@ -113,32 +114,13 @@ namespace IOB_WIN_FORM
if (IOBConfFull == null || !utils.CRB("autoLoadConf"))
{
- // definisco e avvio tipo adapter generico
- tipoScelto = tipoAdapter.ND;
- curVendor = "ACME";
- curModel = "NONE";
-#if false
- IOBConf = new IobConfiguration();
-#endif
IOBConfFull = new IobConfTree();
loadIobType();
displayTaskAndLog("Waiting for config file selection");
}
-#if false
- // cerco tra i parametri opzionali se ho il parametro di
- int timerIntMs = utils.CRI("timerIntMs");
- string rawTimer = IOBConfFull.OptParConfGet("timerIntMs");
- if (!string.IsNullOrEmpty(rawTimer))
- {
- int.TryParse(rawTimer, out timerIntMs);
- lgInfo($"Impostato timerIntMs da IOBConfFull: {timerIntMs}");
- }
// Start timer periodico comunicazione
- gather.Interval = timerIntMs;
-#endif
- // Start timer periodico comunicazione
- gather.Interval = IOBConfFull.GenConf.TimerIntMs;
+ gather.Interval = IOBConfFull.General.UiTimer;
gather.Enabled = true;
displayTaskAndLog($"Main timer set: {gather.Interval}ms", true);
@@ -867,40 +849,6 @@ namespace IOB_WIN_FORM
fermaTutto(false, tryRestart, forceDequeue, updateForm);
}
-#if false
- ///
- /// Salva su file l'oggetto di persistenza dati
- ///
- ///
- public void savePersistLayer(string filePath)
- {
- // in primis check semaforo salvataggio...
- if (!iobObj.adpSaving)
- {
- // alzo semaforo salvataggio
- iobObj.adpSaving = true;
- // se HO dei dati...
- if (iobObj.persistenceLayer != null)
- {
- try
- {
- utils.WritePlain(iobObj.persistenceLayer, filePath);
- }
- catch (Exception exc)
- {
- lgError(string.Format("Errore salvataggio file{0}{1}", Environment.NewLine, exc));
- }
- }
- else
- {
- lgDebug("persistenceLayer null, non salvato...");
- }
- // abbasso semaforo salvataggio
- iobObj.adpSaving = false;
- }
- }
-#endif
-
///
/// Mostra update delle statistiche di comunicazione (numero chiamate, tempo medio...)
///
@@ -1264,8 +1212,8 @@ namespace IOB_WIN_FORM
///
protected void UpdateDisplTypeIobSel()
{
- lblCNC.Text = $"CNC: {IOBConfFull.GenConf.IobType} [{IOBConfFull.DeviceConf.ConnectConf.IpAddr}:{IOBConfFull.DeviceConf.ConnectConf.Port}]";
- lblSrvUrl.Text = $"SRV: {IOBConfFull.MapoMesConf.IpAddr} | BaseURL: {IOBConfFull.MapoMesConf.ApiUrl("")}";
+ lblCNC.Text = $"CNC: {IOBConfFull.General.IobType} [{IOBConfFull.Device.Connect.IpAddr}:{IOBConfFull.Device.Connect.Port}]";
+ lblSrvUrl.Text = $"SRV: {IOBConfFull.MapoMes.IpAddr} | BaseURL: {IOBConfFull.MapoMes.ApiUrl("")}";
// aggancio evento refresh
iobObj.eh_refreshed += IobObj_eh_refreshed;
@@ -1511,11 +1459,6 @@ namespace IOB_WIN_FORM
try
{
iobObj.stopAdapter(tryRestart, forceDequeue);
-#if false
- // salvo!
- savePersistLayer(utils.defPersLayerFile);
- savePersistLayer(utils.histPersLayerFile);
-#endif
stop.Enabled = false;
start.Enabled = true;
@@ -1670,98 +1613,19 @@ namespace IOB_WIN_FORM
private void loadIniFile(string iniConfFile)
{
// out di cosa faccio...
- displayTaskAndLog($"[STARTUP] Loading yamlConfFile: {iniConfFile}");
- // leggo file
- IniFile fIni = new IniFile(iniConfFile);
-
- // 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 optParRead = new Dictionary();
- 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));
- }
- }
+ displayTaskAndLog($"[STARTUP] Loading ConfFile: {iniConfFile}");
var appVers = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
-#if false
- // 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 = iniConfFile,
- 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);
-#endif
string path = fileMover.GetExecutingDirectoryName(); // Directory.GetCurrentDirectory();
string fileName = Path.GetFileName(iniConfFile).Replace(".ini", ".iob");
- //string dirPath = Path.Combine(path, "DATA", IOBConf.serverData.ClientInstall);
string dirPath = Path.Combine(path, "DATA", "CONF_RUN");
// verifica directory
baseUtils.checkDir(dirPath);
string fullPath = Path.Combine(dirPath, fileName);
-#if false
- // salvataggio
- File.WriteAllText(fullPath, confJson);
-
-#endif
// preparazione file conf con nuovo formato e salvataggio...
IOBConfFull = IobConfTree.LoadFromINI(iniConfFile);
- if (IOBConfFull.GenConf.ConfFileName.EndsWith("ini"))
+ if (IOBConfFull.General.FileName.EndsWith("ini"))
{
- IOBConfFull.GenConf.ConfFileName = IOBConfFull.GenConf.ConfFileName.Replace("ini", "yaml");
+ IOBConfFull.General.FileName = IOBConfFull.General.FileName.Replace("ini", "yaml");
}
// salvo anche yaml...
IOBConfFull.SaveYaml(fullPath.Replace("iob", "yaml"));
@@ -1788,20 +1652,6 @@ namespace IOB_WIN_FORM
// 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 optParRead = new Dictionary();
string[] optParRows = fIni.ReadSection("OPTPAR");
@@ -1823,51 +1673,6 @@ namespace IOB_WIN_FORM
}
}
var appVers = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
-#if false
- // 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();
- string fileName = Path.GetFileName(yamlConfFile).Replace(".ini", ".iob");
- string dirPath = $"{path}\\DATA\\{IOBConfFull.MapoMesConf.ClientInstall}";
- string fullPath = $"{dirPath}\\{fileName}";
- // verifica directory
- baseUtils.checkDir(dirPath);
- // salvataggio
- File.WriteAllText(fullPath, confJson);
-#endif
loadIobType();
// avvio macchina con adapter specificato...
@@ -1975,15 +1780,15 @@ namespace IOB_WIN_FORM
counterIob = $"pz IOB {iobObj.contapezziIOB}";
counterMac = $"pz PLC {iobObj.contapezziPLC}";
Dictionary setPar = new Dictionary();
- setPar.Add("IP", iobObj.IOBConfFull.DeviceConf.ConnectConf.IpAddr);
- setPar.Add("PORT", iobObj.IOBConfFull.DeviceConf.ConnectConf.Port);
- string note = $"{iobObj.IOBConfFull.GenConf.CodIOB} | DT ultimo avvio: {iobObj.dtAvvioAdp}";
+ setPar.Add("IP", iobObj.IOBConfFull.Device.Connect.IpAddr);
+ setPar.Add("PORT", iobObj.IOBConfFull.Device.Connect.Port);
+ string note = $"{iobObj.IOBConfFull.General.CodIOB} | DT ultimo avvio: {iobObj.dtAvvioAdp}";
// verifico IOB status
IobWinStatus currIobStatus = new IobWinStatus()
{
//CodIob = iobObj.cIobConf.filenameIOB,
- CodIob = iobObj.IOBConfFull.GenConf.FilenameIOB,
- IobType = $"{iobObj.IOBConfFull.GenConf.IobType}",//iobObj.cIobConf.tipoIob.ToString(),
+ CodIob = iobObj.IOBConfFull.General.FilenameIOB,
+ IobType = $"{iobObj.IOBConfFull.General.IobType}",//iobObj.cIobConf.tipoIob.ToString(),
queueAlLen = alQueueLen,
queueEvLen = evQueueLen,
queueFlLen = flQueueLen,
diff --git a/IOB-WIN-FORM/Iob/BaseObj.cs b/IOB-WIN-FORM/Iob/BaseObj.cs
index c4b17408..da14b342 100644
--- a/IOB-WIN-FORM/Iob/BaseObj.cs
+++ b/IOB-WIN-FORM/Iob/BaseObj.cs
@@ -37,7 +37,7 @@ namespace IOB_WIN_FORM.Iob
// se non ho veto --> loggo
if (!doVeto)
{
- lg.Factory.Configuration.Variables["codIOB"] = IOBConfFull.GenConf.FilenameIOB;
+ lg.Factory.Configuration.Variables["codIOB"] = IOBConfFull.General.FilenameIOB;
lg.Error(message, args);
sendToLogWatch("ERROR", message, args);
}
@@ -80,7 +80,7 @@ namespace IOB_WIN_FORM.Iob
// se non ho veto --> loggo
if (!doVeto)
{
- lg.Factory.Configuration.Variables["codIOB"] = IOBConfFull.GenConf.FilenameIOB;
+ lg.Factory.Configuration.Variables["codIOB"] = IOBConfFull.General.FilenameIOB;
lg.Debug(message);
if (sendToForm)
{
@@ -100,7 +100,7 @@ namespace IOB_WIN_FORM.Iob
// se non ho veto --> loggo
if (!doVeto)
{
- lg.Factory.Configuration.Variables["codIOB"] = IOBConfFull.GenConf.FilenameIOB;
+ lg.Factory.Configuration.Variables["codIOB"] = IOBConfFull.General.FilenameIOB;
lg.Debug(message, args);
sendToLogWatch("DEBUG", message, args);
}
@@ -116,7 +116,7 @@ namespace IOB_WIN_FORM.Iob
// se non ho veto --> loggo
if (!doVeto)
{
- lg.Factory.Configuration.Variables["codIOB"] = IOBConfFull.GenConf.FilenameIOB;
+ lg.Factory.Configuration.Variables["codIOB"] = IOBConfFull.General.FilenameIOB;
lg.Error(message);
if (sendToForm)
{
@@ -137,7 +137,7 @@ namespace IOB_WIN_FORM.Iob
// se non ho veto --> loggo
if (!doVeto)
{
- lg.Factory.Configuration.Variables["codIOB"] = IOBConfFull.GenConf.FilenameIOB;
+ lg.Factory.Configuration.Variables["codIOB"] = IOBConfFull.General.FilenameIOB;
lg.Error(exception, message, args);
sendToLogWatch("ERROR", message, exception, args);
}
@@ -153,7 +153,7 @@ namespace IOB_WIN_FORM.Iob
// se non ho veto --> loggo
if (!doVeto)
{
- lg.Factory.Configuration.Variables["codIOB"] = IOBConfFull.GenConf.FilenameIOB;
+ lg.Factory.Configuration.Variables["codIOB"] = IOBConfFull.General.FilenameIOB;
lg.Fatal(message);
if (sendToForm)
{
@@ -173,7 +173,7 @@ namespace IOB_WIN_FORM.Iob
// se non ho veto --> loggo
if (!doVeto)
{
- lg.Factory.Configuration.Variables["codIOB"] = IOBConfFull.GenConf.FilenameIOB;
+ lg.Factory.Configuration.Variables["codIOB"] = IOBConfFull.General.FilenameIOB;
lg.Fatal(message, args);
sendToLogWatch("FATAL", message, args);
}
@@ -191,7 +191,7 @@ namespace IOB_WIN_FORM.Iob
// se non ho veto --> loggo
if (!doVeto)
{
- lg.Factory.Configuration.Variables["codIOB"] = IOBConfFull.GenConf.FilenameIOB;
+ lg.Factory.Configuration.Variables["codIOB"] = IOBConfFull.General.FilenameIOB;
lg.Fatal(exception, message, args);
sendToLogWatch("FATAL", message, exception, args);
}
@@ -207,7 +207,7 @@ namespace IOB_WIN_FORM.Iob
// se non ho veto --> loggo
if (!doVeto)
{
- lg.Factory.Configuration.Variables["codIOB"] = IOBConfFull.GenConf.FilenameIOB;
+ lg.Factory.Configuration.Variables["codIOB"] = IOBConfFull.General.FilenameIOB;
lg.Info(message);
if (sendToForm)
{
@@ -227,7 +227,7 @@ namespace IOB_WIN_FORM.Iob
// se non ho veto --> loggo
if (!doVeto)
{
- lg.Factory.Configuration.Variables["codIOB"] = IOBConfFull.GenConf.FilenameIOB;
+ lg.Factory.Configuration.Variables["codIOB"] = IOBConfFull.General.FilenameIOB;
lg.Info(message, args);
sendToLogWatch("INFO", message, args);
}
@@ -244,7 +244,7 @@ namespace IOB_WIN_FORM.Iob
// se non ho veto --> loggo
if (!doVeto)
{
- lg.Factory.Configuration.Variables["codIOB"] = IOBConfFull.GenConf.FilenameIOB;
+ lg.Factory.Configuration.Variables["codIOB"] = IOBConfFull.General.FilenameIOB;
DateTime adesso = DateTime.Now;
if (adesso.Subtract(lastLogStartup).TotalMinutes > vetoLogStartupDuration)
{
@@ -273,7 +273,7 @@ namespace IOB_WIN_FORM.Iob
// se non ho veto --> loggo
if (!doVeto)
{
- lg.Factory.Configuration.Variables["codIOB"] = IOBConfFull.GenConf.FilenameIOB;
+ lg.Factory.Configuration.Variables["codIOB"] = IOBConfFull.General.FilenameIOB;
DateTime adesso = DateTime.Now;
if (adesso.Subtract(lastLogStartup).TotalMinutes > vetoLogStartupDuration)
{
@@ -298,7 +298,7 @@ namespace IOB_WIN_FORM.Iob
// se non ho veto --> loggo
if (!doVeto)
{
- lg.Factory.Configuration.Variables["codIOB"] = IOBConfFull.GenConf.FilenameIOB;
+ lg.Factory.Configuration.Variables["codIOB"] = IOBConfFull.General.FilenameIOB;
lg.Trace(message);
if (sendToForm)
{
@@ -318,7 +318,7 @@ namespace IOB_WIN_FORM.Iob
// se non ho veto --> loggo
if (!doVeto)
{
- lg.Factory.Configuration.Variables["codIOB"] = IOBConfFull.GenConf.FilenameIOB;
+ lg.Factory.Configuration.Variables["codIOB"] = IOBConfFull.General.FilenameIOB;
lg.Trace(message, args);
sendToLogWatch("TRACE", message, args);
}
diff --git a/IOB-WIN-FORM/Iob/Generic.cs b/IOB-WIN-FORM/Iob/Generic.cs
index 615d1253..e26ecee6 100644
--- a/IOB-WIN-FORM/Iob/Generic.cs
+++ b/IOB-WIN-FORM/Iob/Generic.cs
@@ -49,7 +49,7 @@ namespace IOB_WIN_FORM.Iob
IOBConfFull = IobConfNew;
// init oggetto redis...
- redisMan = new RedisIobCache(IobConfNew.MapoMesConf.IpAddr, IobConfNew.GenConf.FilenameIOB, $"{IobConfNew.GenConf.IobType}", IobConfNew.GenConf.MinDeltaSec);
+ redisMan = new RedisIobCache(IobConfNew.MapoMes.IpAddr, IobConfNew.General.FilenameIOB, $"{IobConfNew.General.IobType}", IobConfNew.General.MinDeltaSec);
//redisMan = new RedisIobCache(IOBConf.serverData.MPIP, IOBConf.codIOB, $"{IOBConf.tipoIob}", IOBConf.minDeltaSec);
// initi oggetto TCMan
@@ -59,7 +59,7 @@ namespace IOB_WIN_FORM.Iob
parentForm = caller;
// imposto le code!
- QueueIN = new DataQueue(IOBConfFull.GenConf.CodIOB, "QueueIN", IOBConfFull.GenConf.EnableRedisQueue);
+ QueueIN = new DataQueue(IOBConfFull.General.CodIOB, "QueueIN", IOBConfFull.General.EnabRedisQue);
lastConnectTry = DateTime.Now;
@@ -212,7 +212,7 @@ namespace IOB_WIN_FORM.Iob
}
else
{
- lgError($"SERVER NOT RESPONDING (PING at {IOBConfFull.MapoMesConf.IpAddr})");
+ lgError($"SERVER NOT RESPONDING (PING at {IOBConfFull.MapoMes.IpAddr})");
MPOnline = false;
// imposto veto a 10 volte reinvio dati standard...
dtVetoPing = DateTime.Now.AddMilliseconds(baseUtils.nextPauseSendMSec * 10);
@@ -306,7 +306,7 @@ namespace IOB_WIN_FORM.Iob
///
public bool DemoIn
{
- get => IOBConfFull.GenConf.IobType == tipoAdapter.SIMULA;
+ get => IOBConfFull.General.IobType == tipoAdapter.SIMULA;
}
///
@@ -334,29 +334,7 @@ namespace IOB_WIN_FORM.Iob
///
public bool isMulti
{
- get => IOBConfFull.DeviceConf.IsMulti;
-#if false
- {
- bool answ = false;
- if (cIobConf.optPar.Count > 0)
- {
- // cerco con chiave reale IS_MULTI
- string keyName = "IS_MULTI";
- if (!cIobConf.optPar.ContainsKey(keyName))
- {
- // legacy: accetto anche SIM_MULTI...
- keyName = "SIM_MULTI";
- }
- // vera verifica su chiave...
- if (cIobConf.optPar.ContainsKey(keyName))
- {
- string SIM_MULTI = getOptPar(keyName);
- answ = SIM_MULTI == "1";
- }
- }
- return answ;
- }
-#endif
+ get => IOBConfFull.Device.IsMulti;
}
///
@@ -496,21 +474,6 @@ namespace IOB_WIN_FORM.Iob
public string urlReboot
{
get => $@"{urlCommandIob("sendReboot")}?mac={GetMACAddress()}";
-#if false
- get
- {
- string answ = "";
- try
- {
- answ = $@"{urlMesServer}{IOBConfFull.MapoMesConf.BaseAppUrl}{cIobConf.serverData.CMDREBO}{IOBConfFull.GenConf.CodIOB}&mac={GetMACAddress()}";
- }
- catch
- {
- answ = $@"{urlMesServer}{IOBConfFull.MapoMesConf.BaseAppUrl}{cIobConf.serverData.CMDREBO}{IOBConfFull.GenConf.CodIOB}";
- }
- return answ;
- }
-#endif
}
///
@@ -812,7 +775,7 @@ namespace IOB_WIN_FORM.Iob
}
else
{
- taskVal = $"NO MemMap found, SET task: {item.Key} --> {item.Value}";
+ taskVal = $"NO BankConf found, SET task: {item.Key} --> {item.Value}";
}
// salvo in currProd..
upsertKey(item.Key, item.Value);
@@ -846,7 +809,7 @@ namespace IOB_WIN_FORM.Iob
}
else
{
- taskVal = $"NO MemMap found, SET task: {item.Key} --> {item.Value}";
+ taskVal = $"NO BankConf found, SET task: {item.Key} --> {item.Value}";
}
break;
@@ -879,7 +842,7 @@ namespace IOB_WIN_FORM.Iob
}
else
{
- taskVal = $"NO MemMap found, SET task: {item.Key} --> {newVal} ({item.Value})";
+ taskVal = $"NO BankConf found, SET task: {item.Key} --> {newVal} ({item.Value})";
}
// salvo in currProd..
@@ -908,7 +871,7 @@ namespace IOB_WIN_FORM.Iob
}
else
{
- taskVal = $"NO MemMap found, SET task: {item.Key} --> {newVal} ({item.Value})";
+ taskVal = $"NO BankConf found, SET task: {item.Key} --> {newVal} ({item.Value})";
}
// salvo in currProd..
@@ -987,7 +950,7 @@ namespace IOB_WIN_FORM.Iob
// converto richiesta in enum...
taskType tName = taskType.nihil;
Enum.TryParse(item.Key, out tName);
- string taskVal = $"taskReq: {tName} | key: {item.Key} | val: {item.Value} | SKIPPED (no MemMap) | NO EXEC";
+ string taskVal = $"taskReq: {tName} | key: {item.Key} | val: {item.Value} | SKIPPED (no BankConf) | NO EXEC";
// aggiungo task!
taskDone.Add(item.Key, taskVal);
}
@@ -1010,10 +973,10 @@ namespace IOB_WIN_FORM.Iob
// controllo SE keySearch !=""
if (!string.IsNullOrWhiteSpace(keyStartSearch))
{
- if (IOBConfFull.OptParConf.Count > 0)
+ if (IOBConfFull.OptPar.Count > 0)
{
// ciclo su tutti e cerco occorrenze che INIZINO...
- foreach (var item in IOBConfFull.OptParConf)
+ foreach (var item in IOBConfFull.OptPar)
{
if (item.Key.StartsWith(keyStartSearch))
{
@@ -1405,9 +1368,9 @@ namespace IOB_WIN_FORM.Iob
// controllo se sia scaduto periodi di veto al tryConnect...
int waitRecMSec = utils.CRI("waitRecMSec") * 2;
// cerco se ci sia un valore in ovverride x il singolo IOB...
- if (IOBConfFull.GenConf.WaitRecMsec > 0)
+ if (IOBConfFull.General.WaitRecMsec > 0)
{
- waitRecMSec = IOBConfFull.GenConf.WaitRecMsec;
+ waitRecMSec = IOBConfFull.General.WaitRecMsec;
}
DateTime dtVeto = lastConnectTry.AddMilliseconds(waitRecMSec);
if (DateTime.Now > dtVeto)
@@ -1481,11 +1444,11 @@ namespace IOB_WIN_FORM.Iob
{
string answ = "";
// controllo SE HO il parametro
- if (memMap != null && memMap.optKVP != null && memMap.optKVP.Count > 0)
+ if (memMap != null && memMap.OptKVP != null && memMap.OptKVP.Count > 0)
{
- if (memMap.optKVP.ContainsKey(key))
+ if (memMap.OptKVP.ContainsKey(key))
{
- answ = memMap.optKVP[key];
+ answ = memMap.OptKVP[key];
}
}
return answ;
@@ -1498,19 +1461,7 @@ namespace IOB_WIN_FORM.Iob
///
public string getOptPar(string key)
{
- return IOBConfFull.OptParConfGet(key);
-#if false
- string answ = "";
- if (cIobConf.optPar.Count > 0)
- {
- // controllo SE HO il parametro
- if (cIobConf.optPar.ContainsKey(key))
- {
- answ = cIobConf.optPar[key];
- }
- }
- return answ;
-#endif
+ return IOBConfFull.OptParGet(key);
}
///
@@ -1839,15 +1790,15 @@ namespace IOB_WIN_FORM.Iob
foreach (TimeRec item in TimingData.results)
{
// loggo SOLO se del mio IOB corrente...
- if (item.classCall == IOBConfFull.GenConf.CodIOB)
+ if (item.classCall == IOBConfFull.General.CodIOB)
{
- lgInfo("{4}|Chiamate {0}: effettuate {1}, tempo medio {2:N2} msec | impegno canale {3:P3}", item.codCall, item.numCall, item.avgMsec, item.totMsec.TotalSeconds / DateTime.Now.Subtract(dtAvvioAdp).TotalSeconds, IOBConfFull.GenConf.CodIOB);
+ lgInfo("{4}|Chiamate {0}: effettuate {1}, tempo medio {2:N2} msec | impegno canale {3:P3}", item.codCall, item.numCall, item.avgMsec, item.totMsec.TotalSeconds / DateTime.Now.Subtract(dtAvvioAdp).TotalSeconds, IOBConfFull.General.CodIOB);
globNumCall += item.numCall;
globAvgMsec += item.totMsec;
}
}
// riporto conteggio medio al secondo...
- lgInfo("{4}|Chiamate GLOBALI: {0}, periodo: {1:N2} minuti.cent, tempo medio {2:N2} msec | impegno canale {3:P3}", globNumCall, DateTime.Now.Subtract(dtAvvioAdp).TotalMinutes, globAvgMsec.TotalMilliseconds / globNumCall, globAvgMsec.TotalSeconds / DateTime.Now.Subtract(dtAvvioAdp).TotalSeconds, IOBConfFull.GenConf.CodIOB);
+ lgInfo("{4}|Chiamate GLOBALI: {0}, periodo: {1:N2} minuti.cent, tempo medio {2:N2} msec | impegno canale {3:P3}", globNumCall, DateTime.Now.Subtract(dtAvvioAdp).TotalMinutes, globAvgMsec.TotalMilliseconds / globNumCall, globAvgMsec.TotalSeconds / DateTime.Now.Subtract(dtAvvioAdp).TotalSeconds, IOBConfFull.General.CodIOB);
lgInfo("{0}--------------- STOP TIMING DATA ---------------{0}", Environment.NewLine);
// mostro in form statistiche globali!
parentForm.updateComStats(string.Format("Periodo: {0:N2}min | {1} x {2:N2}ms | canale {3:P3}", DateTime.Now.Subtract(dtAvvioAdp).TotalMinutes, globNumCall, globAvgMsec.TotalMilliseconds / globNumCall, globAvgMsec.TotalSeconds / DateTime.Now.Subtract(dtAvvioAdp).TotalSeconds));
@@ -2427,7 +2378,7 @@ namespace IOB_WIN_FORM.Iob
Dictionary taskDone = new Dictionary();
Dictionary task2Add = new Dictionary();
// eseguo realmente solo se NON disabilitata questa gestione (caso doppio PLC/HMI)...
- if (!IOBConfFull.GenConf.DisableExeTask)
+ if (!IOBConfFull.Device.DisabExeTask)
{
if (task2exe != null)
{
@@ -2501,21 +2452,21 @@ namespace IOB_WIN_FORM.Iob
if (checkServerAlive)
{
// leggo PRIMA ODL ....
- calcUrl = string.IsNullOrEmpty(forceMach) ? urlGetCurrODL : urlGetCurrODL.Replace(IOBConfFull.GenConf.CodIOB, forceMach);
+ calcUrl = string.IsNullOrEmpty(forceMach) ? urlGetCurrODL : urlGetCurrODL.Replace(IOBConfFull.General.CodIOB, forceMach);
lastIdxODL = utils.callUrl(calcUrl);
lgTrace($"Lettura ODL dall'url {calcUrl} --> {lastIdxODL}");
// se ho valori in coda da trasmettere uso dati REDIS
if (forceCountRec)
{
// uso dati da TCiclo registrati...
- calcUrl = string.IsNullOrEmpty(forceMach) ? urlGetPzCountRec : urlGetPzCountRec.Replace(IOBConfFull.GenConf.CodIOB, forceMach);
+ calcUrl = string.IsNullOrEmpty(forceMach) ? urlGetPzCountRec : urlGetPzCountRec.Replace(IOBConfFull.General.CodIOB, forceMach);
currServerCount = utils.callUrl(calcUrl);
lgInfo($"Lettura contapezzi da TCiclo registrati dall'url {calcUrl} --> num pz: {currServerCount}");
}
else
{
// uso il contapezzi dichiarato dall'IOB stesso
- calcUrl = string.IsNullOrEmpty(forceMach) ? urlGetPzCount : urlGetPzCount.Replace(IOBConfFull.GenConf.CodIOB, forceMach);
+ calcUrl = string.IsNullOrEmpty(forceMach) ? urlGetPzCount : urlGetPzCount.Replace(IOBConfFull.General.CodIOB, forceMach);
currServerCount = utils.callUrl(calcUrl);
lgInfo($"Lettura contapezzi dall'url {calcUrl} --> {currServerCount}");
}
@@ -2648,7 +2599,7 @@ namespace IOB_WIN_FORM.Iob
}
if (connectionOk)
{
- if (!IOBConfFull.GenConf.DisableStateCh)
+ if (!IOBConfFull.Device.DisabStateCh)
{
readSemafori(ref currDispData);
}
@@ -2700,7 +2651,7 @@ namespace IOB_WIN_FORM.Iob
sb.Append($"B_input --> {(short)B_input}{Environment.NewLine}");
sb.Append($"{baseUtils.binaryForm(B_input)}{Environment.NewLine}");
sb.Append($"{Environment.NewLine}");
- sb.Append($"----------- RAW Data Memory -----------{Environment.NewLine}");
+ sb.Append($"----------- RAW Data BankConf -----------{Environment.NewLine}");
// Do x scontato siano VALIDI i valori di RawDataInputStart / size --> filtro...
var filtRawData = new byte[RawDataInputSize];
Array.Copy(RawInput, RawDataInputStart, filtRawData, 0, RawDataInputSize);
@@ -3206,7 +3157,7 @@ namespace IOB_WIN_FORM.Iob
public virtual void stopAdapter(bool tryRestart, bool forceDequeue)
{
// controllo che non ci sia redis queue altrimenti NON forza svuotamento...
- if (forceDequeue && !IOBConfFull.GenConf.EnableRedisQueue)
+ if (forceDequeue && !IOBConfFull.General.EnabRedisQue)
{
// svuoto le code dei valori letti e non ancora trasmessi...
parentForm.displayTaskAndLog("[CLOSING] Svuotamento FORZATO coda segnali...", true);
@@ -3243,7 +3194,7 @@ namespace IOB_WIN_FORM.Iob
// invio
sendDataBlock(urlType.FLog, listaValori);
// svuoto!
- QueueFLog = new DataQueue(IOBConfFull.GenConf.CodIOB, "QueueFLog", IOBConfFull.GenConf.EnableRedisQueue);
+ QueueFLog = new DataQueue(IOBConfFull.General.CodIOB, "QueueFLog", IOBConfFull.General.EnabRedisQue);
//QueueFLog = new ConcurrentQueue();
}
}
@@ -3283,7 +3234,7 @@ namespace IOB_WIN_FORM.Iob
// invio
sendDataBlock(urlType.ULog, listaValori);
// svuoto!
- QueueULog = new DataQueue(IOBConfFull.GenConf.CodIOB, "QueueULog", IOBConfFull.GenConf.EnableRedisQueue);
+ QueueULog = new DataQueue(IOBConfFull.General.CodIOB, "QueueULog", IOBConfFull.General.EnabRedisQue);
}
}
}
@@ -3346,7 +3297,7 @@ namespace IOB_WIN_FORM.Iob
// invio
sendDataBlock(urlType.SignIN, listaValori);
// svuoto!
- QueueIN = new DataQueue(IOBConfFull.GenConf.CodIOB, "QueueIN", IOBConfFull.GenConf.EnableRedisQueue);
+ QueueIN = new DataQueue(IOBConfFull.General.CodIOB, "QueueIN", IOBConfFull.General.EnabRedisQue);
//QueueIN = new ConcurrentQueue();
}
}
@@ -3463,29 +3414,6 @@ namespace IOB_WIN_FORM.Iob
{
// verifico la parte di link "tipoComando"
string tipoComando = "";
-#if false
- switch (tipoUrl)
- {
- case urlType.FLog:
- tipoComando = cIobConf.serverData.CMDFLOG_JSON;
- break;
-
- case urlType.SignIN:
- tipoComando = cIobConf.serverData.CMDBASE_JSON;
- break;
-
- case urlType.RawTransf:
- tipoComando = cIobConf.serverData.CMDRAWTRANSF_JSON;
- break;
-
- case urlType.ULog:
- tipoComando = cIobConf.serverData.CMDULOG_JSON;
- break;
-
- default:
- break;
- }
-#endif
switch (tipoUrl)
{
case urlType.FLog:
@@ -3509,9 +3437,6 @@ namespace IOB_WIN_FORM.Iob
}
// URL base x input
string answ = $@"{urlCommandIob(tipoComando)}";
-#if false
- string answ = $@"{urlMesServer}{IOBConfFull.MapoMesConf.BaseAppUrl}{tipoComando}{IOBConfFull.GenConf.CodIOB}";
-#endif
return answ;
}
@@ -3524,22 +3449,12 @@ namespace IOB_WIN_FORM.Iob
{
// URL base x input
string answ = $@"{urlCommandIob("flog")}";
-#if false
- string answ = $@"{urlMesServer}{IOBConfFull.MapoMesConf.BaseAppUrl}{cIobConf.serverData.CMDFLOG}";
-#endif
// decodifica valore!
string[] valori = qDecodeIN(queueVal);
// aggiungo flux e valore...
answ += $@"?flux={valori[1]}&&valore={valori[2]}";
-#if false
- // aggiungo macchina e valore...
- answ += string.Format(@"{0}?flux={1}&&valore={2}", IOBConfFull.GenConf.CodIOB, valori[1], valori[2]);
-#endif
// aggiondo dataOra evento e corrente + contatore...
answ += $@"&&dtEve={valori[0]}&&dtCurr={DateTime.Now:yyyyMMddHHmmssfff}&&cnt={valori[3]}";
-#if false
- answ += string.Format(@"&&dtEve={0}&&dtCurr={1:yyyyMMddHHmmssfff}&&cnt={2}", valori[0], DateTime.Now, valori[3]);
-#endif
return answ;
}
@@ -3560,22 +3475,13 @@ namespace IOB_WIN_FORM.Iob
public string urlInput(string queueVal)
{
// URL base x input
-#if false
- string answ = $@"{urlMesServer}{IOBConfFull.MapoMesConf.BaseAppUrl}{cIobConf.serverData.CMDBASE}";
-#endif
string answ = $@"{urlCommandIob("input")}";
// decodifica valore!
string[] valori = qDecodeIN(queueVal);
// aggiungo macchina e valore...
answ += $@"?valore={valori[1]}";
-#if false
- answ += string.Format(@"{0}?valore={1}", IOBConfFull.GenConf.CodIOB, valori[1]);
-#endif
// aggiondo dataOra evento e corrente + contatore...
answ += $@"&&dtEve={valori[0]}&&dtCurr={DateTime.Now:yyyyMMddHHmmssfff}&&cnt={valori[2]}";
-#if false
- answ += string.Format(@"&&dtEve={0}&&dtCurr={1:yyyyMMddHHmmssfff}&&cnt={2}", valori[0], DateTime.Now, valori[2]);
-#endif
return answ;
}
@@ -3587,22 +3493,13 @@ namespace IOB_WIN_FORM.Iob
public string urlULog(string queueVal)
{
// URL base x input
-#if false
- string answ = $@"{urlMesServer}{IOBConfFull.MapoMesConf.BaseAppUrl}{cIobConf.serverData.CMDULOG}";
-#endif
string answ = $@"{urlCommandIob("ulog")}";
// decodifica valore!
string[] valori = qDecodeIN(queueVal);
// aggiungo macchina e valore...
answ += $@"?flux={valori[1]}&&valore={valori[2]}";
-#if false
- answ += string.Format(@"{0}?flux={1}&&valore={2}", IOBConfFull.GenConf.CodIOB, valori[1], valori[2]);
-#endif
// aggiondo dataOra evento e corrente + contatore...
answ += $@"&&dtEve={valori[0]}&&dtCurr={DateTime.Now:yyyyMMddHHmmssfff}&&cnt={valori[3]}";
-#if false
- answ += string.Format(@"&&dtEve={0}&&dtCurr={1:yyyyMMddHHmmssfff}&&cnt={2}", valori[0], DateTime.Now, valori[3]);
-#endif
return answ;
}
@@ -3678,7 +3575,7 @@ namespace IOB_WIN_FORM.Iob
protected int currSendErrors = 0;
///
- /// Tempo di attesa in minuti x lettura contapezzi standard (da .ini / OptParConf)
+ /// Tempo di attesa in minuti x lettura contapezzi standard (da .ini / OptPar)
///
protected double delayMinReadPzCount = 0;
@@ -3717,10 +3614,12 @@ namespace IOB_WIN_FORM.Iob
///
protected bool enablePzCountByApp = true;
+#if false
///
/// Boolean x indicare contapezzi abilitato forzatamente da IOB
///
- protected bool enablePzCountByIob = true;
+ protected bool enablePzCountByIob = true;
+#endif
///
/// Abilitazione gestione slow data
@@ -3902,7 +3801,7 @@ namespace IOB_WIN_FORM.Iob
///
/// Ritardo minimo x invio contapezzi
///
- protected int pzCountDelay;
+ protected int pzCountDelay = 2500;
///
/// Periodo di campionamento x refresh info
@@ -4033,7 +3932,7 @@ namespace IOB_WIN_FORM.Iob
get
{
List answ = new List();
- string redKeyFLog = redisMan.redHash($"IOB:CurrData:{IOBConfFull.GenConf.CodIOB}:LogFile:FluxLog");
+ string redKeyFLog = redisMan.redHash($"IOB:CurrData:{IOBConfFull.General.CodIOB}:LogFile:FluxLog");
var rawData = redisMan.getRSV(redKeyFLog);
if (!string.IsNullOrEmpty(rawData))
{
@@ -4043,7 +3942,7 @@ namespace IOB_WIN_FORM.Iob
}
set
{
- string redKeyFLog = redisMan.redHash($"IOB:CurrData:{IOBConfFull.GenConf.CodIOB}:LogFile:FluxLog");
+ string redKeyFLog = redisMan.redHash($"IOB:CurrData:{IOBConfFull.General.CodIOB}:LogFile:FluxLog");
string fluxLogRaw = JsonConvert.SerializeObject(value);
redisMan.setRSV(redKeyFLog, fluxLogRaw);
}
@@ -4186,7 +4085,7 @@ namespace IOB_WIN_FORM.Iob
get
{
Dictionary answ = new Dictionary();
- string redKey = redisMan.redHash($"IOB:Status:{IOBConfFull.GenConf.CodIOB}:POdlSent");
+ string redKey = redisMan.redHash($"IOB:Status:{IOBConfFull.General.CodIOB}:POdlSent");
string rawData = redisMan.getRSV(redKey);
if (!string.IsNullOrEmpty(rawData))
{
@@ -4205,7 +4104,7 @@ namespace IOB_WIN_FORM.Iob
set
{
string rawVal = JsonConvert.SerializeObject(value);
- string redKey = redisMan.redHash($"IOB:Status:{IOBConfFull.GenConf.CodIOB}:POdlSent");
+ string redKey = redisMan.redHash($"IOB:Status:{IOBConfFull.General.CodIOB}:POdlSent");
redisMan.setRSV(redKey, rawVal);
lgDebug($"Salvataggio status POdlSentFileArch | {value.Count} record");
}
@@ -4258,22 +4157,22 @@ namespace IOB_WIN_FORM.Iob
protected string redKeyLogfileAct
{
- get => redisMan.redHash($"IOB:CurrData:{IOBConfFull.GenConf.CodIOB}:LogFile:Act");
+ get => redisMan.redHash($"IOB:CurrData:{IOBConfFull.General.CodIOB}:LogFile:Act");
}
protected string redKeyLogfileLast
{
- get => redisMan.redHash($"IOB:CurrData:{IOBConfFull.GenConf.CodIOB}:LogFile:Last");
+ get => redisMan.redHash($"IOB:CurrData:{IOBConfFull.General.CodIOB}:LogFile:Last");
}
protected string redKeyProdLastArt
{
- get => redisMan.redHash($"IOB:CurrData:{IOBConfFull.GenConf.CodIOB}:prodDecod:lastArtDesc");
+ get => redisMan.redHash($"IOB:CurrData:{IOBConfFull.General.CodIOB}:prodDecod:lastArtDesc");
}
protected string redKeyProdRunState
{
- get => redisMan.redHash($"IOB:CurrData:{IOBConfFull.GenConf.CodIOB}:prodDecod:isRunningState");
+ get => redisMan.redHash($"IOB:CurrData:{IOBConfFull.General.CodIOB}:prodDecod:isRunningState");
}
protected Random rndGen { get; set; } = new Random();
@@ -4304,8 +4203,8 @@ namespace IOB_WIN_FORM.Iob
using (Ping pingSender = new Ping())
{
address = IPAddress.Loopback;
- int pingMsTimeout = IOBConfFull.DeviceConf.ConnectConf.PingMsTimeout;
- IPAddress.TryParse(IOBConfFull.DeviceConf.ConnectConf.PingIpAddr, out address);
+ int pingMsTimeout = IOBConfFull.Device.Connect.PingMsTimeout;
+ IPAddress.TryParse(IOBConfFull.Device.Connect.PingIpAddr, out address);
try
{
// se != null --> uso address...
@@ -4315,7 +4214,7 @@ namespace IOB_WIN_FORM.Iob
}
else
{
- reply = pingSender.Send(IOBConfFull.DeviceConf.ConnectConf.IpAddr, pingMsTimeout);
+ reply = pingSender.Send(IOBConfFull.Device.Connect.IpAddr, pingMsTimeout);
}
}
catch
@@ -4524,12 +4423,6 @@ namespace IOB_WIN_FORM.Iob
protected string urlIdleTime
{
get => $@"{urlCommandIob("getIdlePeriod")}";
-#if false
- get
- {
- return $@"{urlMesServer}{IOBConfFull.MapoMesConf.BaseAppUrl}{cIobConf.serverData.CMD_IDLE_TIME}{IOBConfFull.GenConf.CodIOB}";
- }
-#endif
}
///
@@ -4538,12 +4431,6 @@ namespace IOB_WIN_FORM.Iob
protected string urlInizioOdlIob
{
get => $@"{urlCommandIob("getCurrOdlStart")}";
-#if false
- get
- {
- return $@"{urlMesServer}{IOBConfFull.MapoMesConf.BaseAppUrl}{cIobConf.serverData.CMD_ODL_STARTED}{IOBConfFull.GenConf.CodIOB}";
- }
-#endif
}
///
@@ -4552,12 +4439,6 @@ namespace IOB_WIN_FORM.Iob
protected string urlIobEnabled
{
get => $@"{urlCommandIob("enabled")}";
-#if false
- get
- {
- return $@"{urlMesServer}{IOBConfFull.MapoMesConf.BaseAppUrl}{cIobConf.serverData.CMDENABLED}{IOBConfFull.GenConf.CodIOB}";
- }
-#endif
}
///
@@ -4654,22 +4535,6 @@ namespace IOB_WIN_FORM.Iob
protected string urlSetM2IOB
{
get => $@"{urlCommandIob("setM2IOB")}?IOB_name={Environment.MachineName}";
-#if false
- get
- {
- string answ = "";
- try
- {
- string machineName = Environment.MachineName;
- answ = $@"{urlCommand("alive")}/setM2IOB/{IOBConfFull.GenConf.CodIOB}?IOB_name={machineName}";
- }
- catch (Exception exc)
- {
- lgError(exc, "Errore in composizione urlSetM2IOB");
- }
- return answ;
- }
-#endif
}
///
@@ -4677,7 +4542,7 @@ namespace IOB_WIN_FORM.Iob
///
protected string urlSetOptVal
{
- get => $@"{urlCommandIob("addOptPar")}";
+ get => $@"{urlCommandIob("addOptPar")}?";
}
///
@@ -4693,22 +4558,7 @@ namespace IOB_WIN_FORM.Iob
///
protected string urlSetPzCountMAC
{
- get => $@"{urlCommand("setCounter")}MAC_{IOBConfFull.GenConf.CodIOB}?counter=";
-#if false
- get
- {
- string answ = "";
- try
- {
- answ = $@"{urlCommand("alive")}/setCounter/MAC_{IOBConfFull.GenConf.CodIOB}?counter=";
- }
- catch (Exception exc)
- {
- lgError(exc, "Errore in composizione urlSetPzCountMAC");
- }
- return answ;
- }
-#endif
+ get => $@"{urlCommand("setCounter")}MAC_{IOBConfFull.General.CodIOB}?counter=";
}
///
@@ -4725,21 +4575,6 @@ namespace IOB_WIN_FORM.Iob
protected string urlUpdateWriteParams
{
get => $@"{urlCommandIob("upsertObjItems")}";
-#if false
- get
- {
- string answ = "";
- try
- {
- answ = $@"{urlCommand("alive")}/upsertObjItems/{IOBConfFull.GenConf.CodIOB}";
- }
- catch (Exception exc)
- {
- lgError(exc, "Errore in composizione urlUpdateWriteParams");
- }
- return answ;
- }
-#endif
}
///
@@ -5345,7 +5180,7 @@ namespace IOB_WIN_FORM.Iob
// se inviato --> salvo stato da current...
item.updStatusVal(i, (uint)(item.alarmsMask[i] & currStatus));
// salvo in redis...
- string alarmHash = redisMan.redHash($"IOB:ALARM_STATUS:{IOBConfFull.GenConf.CodIOB}:{item.memAddr}");
+ string alarmHash = redisMan.redHash($"IOB:ALARM_STATUS:{IOBConfFull.General.CodIOB}:{item.memAddr}");
string rawAlarms = JsonConvert.SerializeObject(item.alarmsState);
redisMan.setRSV(alarmHash, rawAlarms);
}
@@ -6278,7 +6113,7 @@ namespace IOB_WIN_FORM.Iob
redHashWeek.Add(cWeek, rawWeek);
}
// salvo in redis...
- string fullKey = redisMan.redHash($"IOB:Status:{IOBConfFull.GenConf.CodIOB}:WeekStats");
+ string fullKey = redisMan.redHash($"IOB:Status:{IOBConfFull.General.CodIOB}:WeekStats");
var okHashDict = redisMan.redSaveHashDict(fullKey, redHashWeek);
// invio ANCHE in MP-IO l'update delle info...
@@ -6307,7 +6142,7 @@ namespace IOB_WIN_FORM.Iob
// verifico se ci sia la settimana indicata in elenco...
string currWeek = $"{adesso:yyyy}-{week:00}";
// recupero elenco delle settimane da processare da redis/WeekStats
- string fullKey = redisMan.redHash($"IOB:Status:{IOBConfFull.GenConf.CodIOB}:WeekStats");
+ string fullKey = redisMan.redHash($"IOB:Status:{IOBConfFull.General.CodIOB}:WeekStats");
Dictionary currStats = redisMan.redGetHashDict(fullKey);
if (currStats != null && currStats.Count > 0)
{
@@ -6338,7 +6173,7 @@ namespace IOB_WIN_FORM.Iob
string recLocalArchPath = Path.Combine(pathList["path-locBase"], pathList["path-00-Arch"]);
string recRemArchPath = pathList["path-06-remRec"];
// leggo da redis (se disponibile) elenco hast file/MD5....
- string fullKey = redisMan.redHash($"IOB:Remote:{IOBConfFull.GenConf.CodIOB}:FileCheck");
+ string fullKey = redisMan.redHash($"IOB:Remote:{IOBConfFull.General.CodIOB}:FileCheck");
Dictionary dictRecMd5 = redisMan.redGetHashDict(fullKey);
// leggo la directory remota...
var remoteList = Directory.GetFiles(recRemArchPath);
@@ -6769,18 +6604,18 @@ namespace IOB_WIN_FORM.Iob
Dictionary currDict = new Dictionary();
if (IOBConfFull != null)
{
- bool hasPzCount = (enablePzCountByApp || enablePzCountByIob) && !disablePzCountByIob;
+ bool hasPzCount = enablePzCountByApp && !disablePzCountByIob;
// creo obj dati necessari...
- currDict.Add("IobName", IOBConfFull.GenConf.CodIOB);
- currDict.Add("IobType", $"{IOBConfFull.GenConf.IobType}");
- currDict.Add("MachIp", IOBConfFull.DeviceConf.ConnectConf.IpAddr);
- currDict.Add("MachPort", IOBConfFull.DeviceConf.ConnectConf.Port);
- currDict.Add("Vendor", IOBConfFull.DeviceConf.Vendor);
- currDict.Add("Model", IOBConfFull.DeviceConf.Model);
- currDict.Add("IobVersion", IOBConfFull.GenConf.ReleaseVers);
- if (IOBConfFull.OptParConf != null)
+ currDict.Add("IobName", IOBConfFull.General.CodIOB);
+ currDict.Add("IobType", $"{IOBConfFull.General.IobType}");
+ currDict.Add("MachIp", IOBConfFull.Device.Connect.IpAddr);
+ currDict.Add("MachPort", IOBConfFull.Device.Connect.Port);
+ currDict.Add("Vendor", IOBConfFull.Device.Vendor);
+ currDict.Add("Model", IOBConfFull.Device.Model);
+ currDict.Add("IobVersion", IOBConfFull.General.RelVers);
+ if (IOBConfFull.OptPar != null)
{
- var ordPar = IOBConfFull.OptParConf.OrderBy(x => x.Key).ToList();
+ var ordPar = IOBConfFull.OptPar.OrderBy(x => x.Key).ToList();
foreach (var item in ordPar)
{
currDict.Add($"OP_{item.Key}", item.Value);
@@ -6886,7 +6721,7 @@ namespace IOB_WIN_FORM.Iob
{
item.setupData();
// se ho in redis una tab di allarmi precedenti la carico...
- string alarmHash = redisMan.redHash($"IOB:ALARM_STATUS:{IOBConfFull.GenConf.CodIOB}:{item.memAddr}");
+ string alarmHash = redisMan.redHash($"IOB:ALARM_STATUS:{IOBConfFull.General.CodIOB}:{item.memAddr}");
string rawVal = redisMan.getRSV(alarmHash);
if (!string.IsNullOrEmpty(rawVal))
{
@@ -6918,9 +6753,9 @@ namespace IOB_WIN_FORM.Iob
{
// verifica se siano necessari configuraizoni speciali dalla excDecod:
// es: lettura/invio file excel
- if (memMap.fileDecod != null && memMap.fileDecod.Count > 0)
+ if (memMap.FileDecod != null && memMap.FileDecod.Count > 0)
{
- FileDecod = memMap.fileDecod;
+ FileDecod = memMap.FileDecod;
}
}
@@ -7045,7 +6880,7 @@ namespace IOB_WIN_FORM.Iob
if (serverOk)
{
// verifica se sia un IOB "parziale")
- if (IOBConfFull.GenConf.DisableExeTask || IOBConfFull.GenConf.DisableStateCh)
+ if (IOBConfFull.Device.DisabExeTask || IOBConfFull.Device.DisabStateCh)
{
// versione upsert
tipoCall = urlUpdateWriteParams;
@@ -7066,12 +6901,12 @@ namespace IOB_WIN_FORM.Iob
///
protected virtual void setupOptMemPar()
{
- // verifica se siano necessari configurazioni speciali dalla optMemPar:
+ // verifica se siano necessari configurazioni speciali dalla OptMemPar:
// es: per ricerca condizioni status booleane come ModbusTCP...
- if (memMap.optMemPar != null && memMap.optMemPar.Count > 0)
+ if (memMap.OptMemPar != null && memMap.OptMemPar.Count > 0)
{
// cerco condizioni BIT speciali x Auto, Estop, Work.. devono essere *BitCond
- var listPar2add = memMap.optMemPar.Where(x => x.Key.EndsWith("BitCond")).ToList();
+ var listPar2add = memMap.OptMemPar.Where(x => x.Key.EndsWith("BitCond")).ToList();
if (listPar2add != null && listPar2add.Count > 0)
{
foreach (var item in listPar2add)
@@ -7080,7 +6915,7 @@ namespace IOB_WIN_FORM.Iob
}
}
// cerco condizioni INT speciali x Auto, Estop, Work.. devono essere *IntCond
- var listParInt2add = memMap.optMemPar.Where(x => x.Key.EndsWith("IntCond")).ToList();
+ var listParInt2add = memMap.OptMemPar.Where(x => x.Key.EndsWith("IntCond")).ToList();
if (listParInt2add != null && listParInt2add.Count > 0)
{
foreach (var item in listParInt2add)
@@ -7089,7 +6924,7 @@ namespace IOB_WIN_FORM.Iob
}
}
// cerco valori *2Translate
- var listVal2Translate = memMap.optMemPar.Where(x => x.Key.Contains("2Translate")).ToList();
+ var listVal2Translate = memMap.OptMemPar.Where(x => x.Key.Contains("2Translate")).ToList();
if (listVal2Translate != null && listVal2Translate.Count > 0)
{
// cerco solo valori BIT...
@@ -7143,14 +6978,14 @@ namespace IOB_WIN_FORM.Iob
// recupero le folder specifiche x IN/OUT ricette filtrando direttamente l'area di memoria...
sCond = "path";
- var dirList = memMap.optKVP
+ var dirList = memMap.OptKVP
.Where(x => x.Key.StartsWith(sCond))
.ToList();
pathList = dirList.ToDictionary(x => x.Key, x => x.Value);
// gestione replace in file ricette...
sCond = "replace-";
- var ruleList = memMap.optKVP
+ var ruleList = memMap.OptKVP
.Where(x => x.Key.StartsWith(sCond))
.ToList();
RecipeReplRules = ruleList.ToDictionary(x => x.Key.Replace(sCond, ""), x => x.Value);
@@ -7319,7 +7154,7 @@ namespace IOB_WIN_FORM.Iob
lastUrl = $"{urlAddPzCount}{numIncr}";
if (!string.IsNullOrEmpty(forceMachName))
{
- lastUrl = lastUrl.Replace(IOBConfFull.GenConf.CodIOB, forceMachName);
+ lastUrl = lastUrl.Replace(IOBConfFull.General.CodIOB, forceMachName);
}
string resp = utils.callUrlNow(lastUrl);
if (!string.IsNullOrEmpty(resp))
@@ -7335,7 +7170,7 @@ namespace IOB_WIN_FORM.Iob
string fullUrl = $"{urlSetPzCount}{contapezziIOB}";
if (!string.IsNullOrEmpty(forceMachName))
{
- fullUrl = fullUrl.Replace(IOBConfFull.GenConf.CodIOB, forceMachName);
+ fullUrl = fullUrl.Replace(IOBConfFull.General.CodIOB, forceMachName);
}
string retVal = utils.callUrl(fullUrl);
// verifica se tutto OK
@@ -7503,7 +7338,7 @@ namespace IOB_WIN_FORM.Iob
///
protected string urlCommand(string cmqReq)
{
- return $@"{urlMesServer}{IOBConfFull.MapoMesConf.ApiUrl(cmqReq)}";
+ return $@"{urlMesServer}{IOBConfFull.MapoMes.ApiUrl(cmqReq)}";
}
///
@@ -7511,7 +7346,7 @@ namespace IOB_WIN_FORM.Iob
///
protected string urlCommandIob(string cmqReq)
{
- return $@"{urlMesServer}{IOBConfFull.MapoMesConf.ApiUrl(cmqReq)}{IOBConfFull.GenConf.CodIOB}";
+ return $@"{urlMesServer}{IOBConfFull.MapoMes.ApiUrl(cmqReq)}{IOBConfFull.General.CodIOB}";
}
///
@@ -7701,7 +7536,7 @@ namespace IOB_WIN_FORM.Iob
///
private string rKeyCurrProdData
{
- get => redisMan.redHash($"IOB:Status:{IOBConfFull.GenConf.CodIOB}:CurrProdData");
+ get => redisMan.redHash($"IOB:Status:{IOBConfFull.General.CodIOB}:CurrProdData");
}
///
@@ -7729,7 +7564,7 @@ namespace IOB_WIN_FORM.Iob
address = IPAddress.Loopback;
int maxRetry = maxPingRetry + 1;
int numRetry = 1;
- string ipAddr = IOBConfFull.MapoMesConf.IpAddr.Replace($"{IOBConfFull.MapoMesConf.Transport}://", "");
+ string ipAddr = IOBConfFull.MapoMes.IpAddr.Replace($"{IOBConfFull.MapoMes.Transport}://", "");
// fix se fosse ip + porta...
if (ipAddr.IndexOf(":") >= 0)
{
@@ -7796,7 +7631,7 @@ namespace IOB_WIN_FORM.Iob
///
private string urlMesServer
{
- get => $@"{IOBConfFull.MapoMesConf.Transport}://{IOBConfFull.MapoMesConf.IpAddr}";
+ get => $@"{IOBConfFull.MapoMes.Transport}://{IOBConfFull.MapoMes.IpAddr}";
}
#endregion Private Properties
@@ -7883,7 +7718,7 @@ namespace IOB_WIN_FORM.Iob
private void checkShrinkDir()
{
// comprimo x prima cosa la folder dell'IOB corrente
- string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "logs", IOBConfFull.GenConf.CodIOB);
+ string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "logs", IOBConfFull.General.CodIOB);
try
{
baseUtils.shrinkDir(path);
@@ -7948,7 +7783,7 @@ namespace IOB_WIN_FORM.Iob
// effettuo filtraggio dei valori letti... inizializzo OUT!
B_output = 0;
// in primis verifico SE ci siano bit blinkng... se non ci sono OUT=IN...
- if (IOBConfFull.ProcInputConf.BlinkFilterMask == 0)
+ if (IOBConfFull.SignalProc.BlinkFilterMask == 0)
{
B_output = B_input;
}
@@ -7956,9 +7791,9 @@ namespace IOB_WIN_FORM.Iob
{
// incomincio con i valori NON blinking: questi "passano invariati", inizio a
// sommare nel valore OUT...
- B_output = B_input & ~IOBConfFull.ProcInputConf.BlinkFilterMask;
+ B_output = B_input & ~IOBConfFull.SignalProc.BlinkFilterMask;
// calcolo il valore dei BIT che "passano la maschera"
- int iBlink = B_input & IOBConfFull.ProcInputConf.BlinkFilterMask;
+ int iBlink = B_input & IOBConfFull.SignalProc.BlinkFilterMask;
// ...aggiungo i "bit che passano"
B_output += iBlink;
@@ -7976,12 +7811,12 @@ namespace IOB_WIN_FORM.Iob
lgTrace("START BLINK: B{0}", i);
}
// imposto comunque contatore al cambio fronte...
- i_counters[i] = IOBConfFull.ProcInputConf.BlinkMaxCounter;
+ i_counters[i] = IOBConfFull.SignalProc.BlinkMaxCounter;
}
}
// quelli che sono zero... LI RECUPERO E LI PROCESSO...
- int iZero = ~B_input & IOBConfFull.ProcInputConf.BlinkFilterMask;
+ int iZero = ~B_input & IOBConfFull.SignalProc.BlinkFilterMask;
BitArray bBlinkEnd = new BitArray(new byte[] { Convert.ToByte(iZero) });
int[] bitsDown = bBlinkEnd.Cast().Select(bit => bit ? 1 : 0).ToArray();
for (int i = 0; i < bitsDown.Length; i++)
@@ -8025,93 +7860,6 @@ namespace IOB_WIN_FORM.Iob
}
}
-#if false
- ///
- /// recupera valore salvato in persistence layer (se non c'è crea...)
- ///
- ///
- ///
- private string getStoredVal(string keyVal)
- {
- string value = "";
- try
- {
- if (persistenceLayer != null)
- {
- if (!persistenceLayer.TryGetValue(keyVal, out value))
- {
- persistenceLayer.Add(keyVal, "0");
- }
- }
- }
- catch (Exception exc)
- {
- lgError(string.Format("Eccezione in getStoredVal: {0}{1}", Environment.NewLine, exc));
- }
- return value;
- }
-
- ///
- /// recupera valore salvato in persistence layer (se non c'è crea...) come double
- ///
- ///
- ///
- private double getStoredValDouble(string keyVal)
- {
- double answ = 0;
- try
- {
- answ = Convert.ToDouble(getStoredVal(keyVal));
- }
- catch (Exception exc)
- {
- lgError(string.Format("Eccezione in getStoredValDouble: {0}{1}", Environment.NewLine, exc));
- }
- answ = (answ < (double.MaxValue / 10 * 9)) ? answ : 0;
- return answ;
- }
-
- ///
- /// recupera valore salvato in persistence layer (se non c'è crea...) come INT
- ///
- ///
- ///
- private long getStoredValLong(string keyVal)
- {
- long answ = 0;
- try
- {
- answ = Convert.ToInt64(getStoredVal(keyVal));
- }
- catch
- { }
- // verifico che il valore sia minore di 9/10 del valore massimo...
- answ = (answ < (long.MaxValue / 10 * 9)) ? answ : 0;
- return answ;
- }
-
- ///
- /// recupera valore salvato in persistence layer (se non c'è crea...) come UINT
- ///
- ///
- ///
- private uint getStoredValUInt(string keyVal)
- {
- uint answ = 0;
- try
- {
- answ = Convert.ToUInt32(getStoredVal(keyVal));
- }
- catch (Exception exc)
- {
- lgError(string.Format("Eccezione in getStoredValUInt: {0}{1}", Environment.NewLine, exc));
- }
- // verifico che il valore sia minore di 9/10 del valore massimo...
- answ = (answ < (uint.MaxValue / 10 * 9)) ? answ : 0;
- return answ;
- }
-#endif
-
///
/// Verifica se il log di un dato errore sia permesso
///
@@ -8483,7 +8231,7 @@ namespace IOB_WIN_FORM.Iob
///
private void RecipeRemoveWeekStatus(string keyReq)
{
- string fullKey = redisMan.redHash($"IOB:Status:{IOBConfFull.GenConf.CodIOB}:WeekStats");
+ string fullKey = redisMan.redHash($"IOB:Status:{IOBConfFull.General.CodIOB}:WeekStats");
var okHashDict = redisMan.redRemoveHashField(fullKey, keyReq);
// rileggo status hash
Dictionary currDict = redisMan.redGetHashDict(fullKey);
@@ -8522,24 +8270,30 @@ namespace IOB_WIN_FORM.Iob
// svuoto code se richiesto
if (resetQueue)
{
- QueueAlarm = new DataQueue(IOBConfFull.GenConf.CodIOB, "QueueAlarm", IOBConfFull.GenConf.EnableRedisQueue);
+ QueueAlarm = new DataQueue(IOBConfFull.General.CodIOB, "QueueAlarm", IOBConfFull.General.EnabRedisQue);
//QueueAlarm = new ConcurrentQueue();
- QueueIN = new DataQueue(IOBConfFull.GenConf.CodIOB, "QueueIN", IOBConfFull.GenConf.EnableRedisQueue);
+ QueueIN = new DataQueue(IOBConfFull.General.CodIOB, "QueueIN", IOBConfFull.General.EnabRedisQue);
//QueueIN = new ConcurrentQueue();
- QueueFLog = new DataQueue(IOBConfFull.GenConf.CodIOB, "QueueFLog", IOBConfFull.GenConf.EnableRedisQueue);
+ QueueFLog = new DataQueue(IOBConfFull.General.CodIOB, "QueueFLog", IOBConfFull.General.EnabRedisQue);
//QueueFLog = new ConcurrentQueue();
- QueueMessages = new DataQueue(IOBConfFull.GenConf.CodIOB, "QueueMessages", IOBConfFull.GenConf.EnableRedisQueue);
+ QueueMessages = new DataQueue(IOBConfFull.General.CodIOB, "QueueMessages", IOBConfFull.General.EnabRedisQue);
//QueueMessages = new ConcurrentQueue();
- QueueRawTransf = new DataQueue(IOBConfFull.GenConf.CodIOB, "QueueRawTransf", IOBConfFull.GenConf.EnableRedisQueue);
+ QueueRawTransf = new DataQueue(IOBConfFull.General.CodIOB, "QueueRawTransf", IOBConfFull.General.EnabRedisQue);
//QueueRawTransf = new ConcurrentQueue();
- QueueULog = new DataQueue(IOBConfFull.GenConf.CodIOB, "QueueULog", IOBConfFull.GenConf.EnableRedisQueue);
+ QueueULog = new DataQueue(IOBConfFull.General.CodIOB, "QueueULog", IOBConfFull.General.EnabRedisQue);
//QueueULog = new ConcurrentQueue();
}
// imposto contatori blink a zero...
i_counters = new int[32];
lastPeriodicLog = DateTime.Now;
+
// fix parametri generali...
- enablePrgName = IOBConfFull.DeviceConf.GetProgName;
+ pzCountDelay =IOBConfFull.Device.PzCountDelay;
+ enablePrgName = IOBConfFull.Device.EnabProgName;
+ enablePzCountByApp = IOBConfFull.Device.EnabPzCount;
+ mem2trace = IOBConfFull.Special.BankConf.Mem2Trace;
+ numArtCharTrim = IOBConfFull.Device.NumArtCharTrim;
+
// valore standard divieto accodamento segnali IN
string VETO_QUEUE_IN = getOptPar("VETO_QUEUE_IN");
if (!string.IsNullOrEmpty(VETO_QUEUE_IN))
@@ -8675,7 +8429,7 @@ namespace IOB_WIN_FORM.Iob
// invio
sendDataBlock(urlType.FLog, listaValori);
// svuoto!
- QueueFLog = new DataQueue(IOBConfFull.GenConf.CodIOB, "QueueFLog", IOBConfFull.GenConf.EnableRedisQueue);
+ QueueFLog = new DataQueue(IOBConfFull.General.CodIOB, "QueueFLog", IOBConfFull.General.EnabRedisQue);
//QueueFLog = new ConcurrentQueue();
lastWatchDog = DateTime.Now;
}
@@ -8747,7 +8501,7 @@ namespace IOB_WIN_FORM.Iob
if (fatto)
{
// svuoto se ha okReport!
- QueueRawTransf = new DataQueue(IOBConfFull.GenConf.CodIOB, "QueueRawTransf", IOBConfFull.GenConf.EnableRedisQueue);
+ QueueRawTransf = new DataQueue(IOBConfFull.General.CodIOB, "QueueRawTransf", IOBConfFull.General.EnabRedisQue);
//QueueRawTransf = new ConcurrentQueue();
}
}
@@ -8809,7 +8563,7 @@ namespace IOB_WIN_FORM.Iob
// invio
sendDataBlock(urlType.ULog, listaValori);
// svuoto!
- QueueULog = new DataQueue(IOBConfFull.GenConf.CodIOB, "QueueULog", IOBConfFull.GenConf.EnableRedisQueue);
+ QueueULog = new DataQueue(IOBConfFull.General.CodIOB, "QueueULog", IOBConfFull.General.EnabRedisQue);
}
}
else
@@ -8830,101 +8584,6 @@ namespace IOB_WIN_FORM.Iob
}
}
-#if false
- ///
- /// Aggiorna un valore del dizionario in INCREMENTO e lo restituisce
- ///
- ///
- ///
- ///
- /// Nuovo valore incrementato
- private double updateValDoubleByIncr(int i, double delta, string searchString)
- {
- // stringa da cercare..
- string keyVal = string.Format(searchString, i + 1);
- // recupero valore precedente...
- double contAct = getStoredValDouble(keyVal);
- // nuovo valore...
- contAct += delta;
- // salvo in ram!
- persistenceLayer[keyVal] = contAct.ToString();
- // rendo il valore!
- return contAct;
- }
-
- ///
- /// Aggiorna un valore del dizionario in INCREMENTO e lo restituisce
- ///
- ///
- ///
- ///
- /// Nuovo valore incrementato
- private long updateValLongByIncr(int i, long delta, string searchString)
- {
- // stringa da cercare..
- string keyVal = string.Format(searchString, i + 1);
- // recupero valore precedente...
- long contAct = getStoredValLong(keyVal);
- // nuovo valore...
- contAct += delta;
- // salvo in ram!
- persistenceLayer[keyVal] = contAct.ToString();
- // rendo il valore!
- return contAct;
- }
-
- ///
- /// Aggiorna un valore del dizionario in SOSTITUZIONE
- ///
- ///
- ///
- ///
- /// Nuovo valore incrementato
- private void updateValString(int i, string newVal, string searchString)
- {
- // stringa da cercare..
- string keyVal = string.Format(searchString, i + 1);
- // salvo in ram!
- persistenceLayer[keyVal] = newVal;
- }
-
- ///
- /// Aggiorna un valore del dizionario in SOSTITUZIONE e lo restituisce
- ///
- ///
- ///
- ///
- /// Nuovo valore incrementato
- private void updateValUInt(int i, uint newVal, string searchString)
- {
- // stringa da cercare..
- string keyVal = string.Format(searchString, i + 1);
- // salvo in ram!
- persistenceLayer[keyVal] = newVal.ToString();
- }
-
- ///
- /// Aggiorna un valore del dizionario in INCREMENTO e lo restituisce
- ///
- ///
- ///
- ///
- /// Nuovo valore incrementato
- private uint updateValUIntByIncr(int i, uint delta, string searchString)
- {
- // stringa da cercare..
- string keyVal = string.Format(searchString, i + 1);
- // recupero valore precedente...
- uint contAct = getStoredValUInt(keyVal);
- // nuovo valore...
- contAct += delta;
- // salvo in ram!
- persistenceLayer[keyVal] = contAct.ToString();
- // rendo il valore!
- return contAct;
- }
-#endif
-
#endregion Private Methods
}
diff --git a/IOB-WIN-FORM/Iob/PingWatchDog.cs b/IOB-WIN-FORM/Iob/PingWatchDog.cs
index a9fe71a9..10ed2074 100644
--- a/IOB-WIN-FORM/Iob/PingWatchDog.cs
+++ b/IOB-WIN-FORM/Iob/PingWatchDog.cs
@@ -37,7 +37,7 @@ namespace IOB_WIN_FORM.Iob
}
// fix coda ping
PingQueue = new DataQueue("000", "PingQueue", false);
- lgDebug($"L'adapter effettuera' PING di controllo all'indirizzo {IOBConfFull.DeviceConf.ConnectConf.IpAddr} per forzare stato poweroff dopo {PoweroffTimeoutSec} sec");
+ lgDebug($"L'adapter effettuera' PING di controllo all'indirizzo {IOBConfFull.Device.Connect.IpAddr} per forzare stato poweroff dopo {PoweroffTimeoutSec} sec");
}
#endregion Public Constructors
diff --git a/IOB-WIN-FORM/Iob/Simula.cs b/IOB-WIN-FORM/Iob/Simula.cs
index af9e24d5..dcd60f11 100644
--- a/IOB-WIN-FORM/Iob/Simula.cs
+++ b/IOB-WIN-FORM/Iob/Simula.cs
@@ -62,7 +62,6 @@ namespace IOB_WIN_FORM.Iob
public Simula(AdapterForm caller, IobConfTree IobConfFull) : base(caller, IobConfFull)
{
// gestione invio ritardato contapezzi
- pzCountDelay = utils.CRI("pzCountDelay");
DateTime adesso = DateTime.Now;
lastPzCountSend = adesso;
lastWarnODL = adesso;
@@ -77,28 +76,28 @@ namespace IOB_WIN_FORM.Iob
alarmMessages.Add($"Allarme {i:000}");
}
// sistemo parametri x simulazione...
- if (IobConfFull.OptParConf.Count > 0)
+ if (IobConfFull.OptPar.Count > 0)
{
- if (!string.IsNullOrEmpty(IOBConfFull.OptParConfGet("PER_BASE")))
+ if (!string.IsNullOrEmpty(IOBConfFull.OptParGet("PER_BASE")))
{
- int.TryParse(IOBConfFull.OptParConfGet("PER_BASE"), out periodoMSec);
+ int.TryParse(IOBConfFull.OptParGet("PER_BASE"), out periodoMSec);
// aggiungo NOISE... +/- 10%
Random rnd = new Random();
int noise = rnd.Next(1, periodoMSec / 5);
periodoMSec += noise - (periodoMSec / 10);
}
simPowerOnOff = false;
- bool.TryParse(IOBConfFull.OptParConfGet("SIM_POW_ON_OFF"), out simPowerOnOff);
- int.TryParse(IOBConfFull.OptParConfGet("T_ON"), out tOn);
- int.TryParse(IOBConfFull.OptParConfGet("T_OFF"), out tOff);
+ bool.TryParse(IOBConfFull.OptParGet("SIM_POW_ON_OFF"), out simPowerOnOff);
+ int.TryParse(IOBConfFull.OptParGet("T_ON"), out tOn);
+ int.TryParse(IOBConfFull.OptParGet("T_OFF"), out tOff);
bit2 = setupSimPar("SIM_PZCNT");
bit3 = setupSimPar("SIM_ALARM");
bit4 = setupSimPar("SIM_MANU");
bit5 = setupSimPar("SIM_SLOW");
bit6 = setupSimPar("SIM_WUCD");
bit7 = setupSimPar("SIM_EMRG");
- int.TryParse(IOBConfFull.OptParConfGet("MIN_DURATA_ODL"), out minDurataODL);
- var strDisableSim = IOBConfFull.OptParConfGet("DISABLE_SIM_STATUS");
+ int.TryParse(IOBConfFull.OptParGet("MIN_DURATA_ODL"), out minDurataODL);
+ var strDisableSim = IOBConfFull.OptParGet("DISABLE_SIM_STATUS");
if (!string.IsNullOrEmpty(strDisableSim))
{
bool.TryParse(strDisableSim, out disableSimStatus);
@@ -107,22 +106,15 @@ namespace IOB_WIN_FORM.Iob
simRC = setupSimPar("SIM_RC");
simRS = setupSimPar("SIM_RS");
simDich = setupSimPar("SIM_DICH");
- int.TryParse(IOBConfFull.OptParConfGet("SIM_MATR_OPR"), out matrOpr);
+ int.TryParse(IOBConfFull.OptParGet("SIM_MATR_OPR"), out matrOpr);
}
- string sFluxOnRead = IOBConfFull.OptParConfGet("sendFluxOnRead");
+ string sFluxOnRead = IOBConfFull.OptParGet("sendFluxOnRead");
if (!string.IsNullOrEmpty("sendFluxOnRead"))
{
bool.TryParse(sFluxOnRead, out sendFluxOnRead);
}
- // gestione override contatore articoli...
- if (!string.IsNullOrEmpty(IOBConfFull.OptParConfGet("NUM_ART_CHR_TRIM")))
- {
- string NUM_ART_CHR_TRIM = IOBConfFull.OptParConfGet("NUM_ART_CHR_TRIM");
- bool.TryParse(NUM_ART_CHR_TRIM, out numArtCharTrim);
- }
-
// riesegue setup PLC
setParamPlc();
// ricarico da server i dati dei pezzi fatti...
@@ -138,7 +130,7 @@ namespace IOB_WIN_FORM.Iob
// parto processando dynData
processDynData();
- if (!string.IsNullOrEmpty(IOBConfFull.OptParConfGet("FTP_AT_START")) || !string.IsNullOrEmpty(IOBConfFull.OptParConfGet("DATA_SYNC_AT_START")))
+ if (!string.IsNullOrEmpty(IOBConfFull.OptParGet("FTP_AT_START")) || !string.IsNullOrEmpty(IOBConfFull.OptParGet("DATA_SYNC_AT_START")))
{
// simulazione processo FTP (Cimolai) - FIXME TODO DeleteME
processDataSync();
@@ -266,7 +258,7 @@ namespace IOB_WIN_FORM.Iob
}
else
{
- taskVal = $"NO MemMap found, SET task: {item.Key} --> {item.Value}";
+ taskVal = $"NO BankConf found, SET task: {item.Key} --> {item.Value}";
}
// salvo in currProd..
upsertKey(item.Key, item.Value);
@@ -328,7 +320,7 @@ namespace IOB_WIN_FORM.Iob
}
else
{
- taskVal = $"NO MemMap found, SET task: {item.Key} --> {newVal} ({item.Value})";
+ taskVal = $"NO BankConf found, SET task: {item.Key} --> {newVal} ({item.Value})";
}
// salvo in currProd..
@@ -357,7 +349,7 @@ namespace IOB_WIN_FORM.Iob
}
else
{
- taskVal = $"NO MemMap found, SET task: {item.Key} --> {newVal} ({item.Value})";
+ taskVal = $"NO BankConf found, SET task: {item.Key} --> {newVal} ({item.Value})";
}
// salvo in currProd..
@@ -519,7 +511,7 @@ namespace IOB_WIN_FORM.Iob
public override string getPrgName()
{
// NOME DEL SIM!
- string prgName = $"PROG_{IOBConfFull.GenConf.CodIOB}";
+ string prgName = $"PROG_{IOBConfFull.General.CodIOB}";
return prgName;
}
@@ -809,7 +801,7 @@ namespace IOB_WIN_FORM.Iob
if (!string.IsNullOrEmpty(rawVal))
{
// salvo in redis
- string redKey = redisMan.redHash($"IOB:CurrData:{IOBConfFull.GenConf.CodIOB}:LogFile:Act");
+ string redKey = redisMan.redHash($"IOB:CurrData:{IOBConfFull.General.CodIOB}:LogFile:Act");
redisMan.setRSV(redKey, rawVal);
answ = true;
}
@@ -1080,7 +1072,7 @@ namespace IOB_WIN_FORM.Iob
string machName = "";
if (isMulti)
{
- machName = $"{IOBConfFull.GenConf.CodIOB}|TAV_{nP}";
+ machName = $"{IOBConfFull.General.CodIOB}|TAV_{nP}";
}
// invio SOLO SE sono OLTRE i numSim pz e li invio TUTTI in blocco
if ((contapezziPLC - contapezziIOB) > minSendPzCountBlock)
@@ -1105,7 +1097,7 @@ namespace IOB_WIN_FORM.Iob
string fullUrl = $"{urlSetPzCount}{contapezziIOB}";
if (isMulti)
{
- fullUrl = $"{urlSetPzCount.Replace(IOBConfFull.GenConf.CodIOB, $"{IOBConfFull.GenConf.CodIOB}|TAV_{nP}")}{contapezziPLC}";
+ fullUrl = $"{urlSetPzCount.Replace(IOBConfFull.General.CodIOB, $"{IOBConfFull.General.CodIOB}|TAV_{nP}")}{contapezziPLC}";
}
string retVal = utils.callUrl(fullUrl);
// verifica salvataggio
@@ -1276,7 +1268,7 @@ namespace IOB_WIN_FORM.Iob
// invio a server contapezzi (aggiornato)
if (isMulti)
{
- fullUrl = $"{urlSetPzCount.Replace(IOBConfFull.GenConf.CodIOB, $"{IOBConfFull.GenConf.CodIOB}|TAV_{nP}")}{contapezziIOB}";
+ fullUrl = $"{urlSetPzCount.Replace(IOBConfFull.General.CodIOB, $"{IOBConfFull.General.CodIOB}|TAV_{nP}")}{contapezziIOB}";
}
string retVal = utils.callUrl(fullUrl);
// verifica se tutto OK
@@ -1331,7 +1323,7 @@ namespace IOB_WIN_FORM.Iob
cP = nP;
contapezziPLC++;
// invio contapezzi...
- string fullUrl = $"{urlSetPzCount.Replace(IOBConfFull.GenConf.CodIOB, $"{IOBConfFull.GenConf.CodIOB}|TAV_{nP}")}{contapezziIOB}";
+ string fullUrl = $"{urlSetPzCount.Replace(IOBConfFull.General.CodIOB, $"{IOBConfFull.General.CodIOB}|TAV_{nP}")}{contapezziIOB}";
string retVal = utils.callUrl(fullUrl);
}
// se cP > 0 --> segnalo bit tavola...
@@ -1935,9 +1927,9 @@ namespace IOB_WIN_FORM.Iob
private simPar setupSimPar(string keyName)
{
simPar answ = new simPar();
- if (IOBConfFull.OptParConf.Count > 0)
+ if (IOBConfFull.OptPar.Count > 0)
{
- if (IOBConfFull.OptParConf.ContainsKey(keyName))
+ if (IOBConfFull.OptPar.ContainsKey(keyName))
{
string fullVal = getOptPar(keyName);
if (!string.IsNullOrEmpty(fullVal) && fullVal.IndexOf("|") > 0)
diff --git a/IOB-WIN-FORM/Properties/AssemblyInfo.cs b/IOB-WIN-FORM/Properties/AssemblyInfo.cs
index be621cda..f6072281 100644
--- a/IOB-WIN-FORM/Properties/AssemblyInfo.cs
+++ b/IOB-WIN-FORM/Properties/AssemblyInfo.cs
@@ -2,7 +2,7 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-// GenConf Information about an assembly is controlled through the following
+// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("IOB-WIN-FORM")]
diff --git a/IOB-WIN-KAWASAKI/Iob/Kawasaki.cs b/IOB-WIN-KAWASAKI/Iob/Kawasaki.cs
index 10e5fcba..4becb86f 100644
--- a/IOB-WIN-KAWASAKI/Iob/Kawasaki.cs
+++ b/IOB-WIN-KAWASAKI/Iob/Kawasaki.cs
@@ -19,7 +19,7 @@ namespace IOB_WIN_KAWASAKI.Iob
public Kawasaki(AdapterFormNext caller, IobConfTree IobConfFull) : base(caller, IobConfFull)
{
// gestione invio ritardato contapezzi
- pzCountDelay = utils.CRI("pzCountDelay");
+
lastPzCountSend = DateTime.Now;
lastWarnODL = DateTime.Now;
// init connessione
@@ -211,10 +211,10 @@ namespace IOB_WIN_KAWASAKI.Iob
contapezziPLC = pzCounter;
// verifico quale modalità sia richiesta: STD (6711) oppure BIT (Custom, con
// indicazione area)
- if (!string.IsNullOrEmpty(getOptPar("PZCOUNT_MODE")))
+ if (!string.IsNullOrEmpty(IOBConfFull.Device.PzCountMode))
{
#if false
- string memAddr = getOptPar("PZCOUNT_MODE");
+ string memAddr = IOBConfFull.Device.PzCountMode;
if (memAddr.StartsWith("STD"))
{
// inizio verifica area memoria/parametro levando prima parte codice
@@ -759,9 +759,9 @@ namespace IOB_WIN_KAWASAKI.Iob
{
// verifico quale modalità sia richiesta: STD (6711) oppure BIT (Custom, con
// indicazione area)
- if (!string.IsNullOrEmpty(getOptPar("PZCOUNT_MODE")))
+ if (!string.IsNullOrEmpty(IOBConfFull.Device.PzCountMode))
{
- if (getOptPar("PZCOUNT_MODE").StartsWith("STD"))
+ if (IOBConfFull.Device.PzCountMode.StartsWith("STD"))
{
lgInfo("Init contapezzi KAWASAKI: pzCntReload(true)");
pzCntReload(true);
@@ -775,7 +775,7 @@ namespace IOB_WIN_KAWASAKI.Iob
else
{
contapezziIOB = 0;
- lgInfo("Contapezzi STD disabilitato: modalità {0}", getOptPar("PZCOUNT_MODE"));
+ lgInfo("Contapezzi STD disabilitato: modalità {0}", IOBConfFull.Device.PzCountMode);
}
}
else
diff --git a/IOB-WIN-MBUS/IobModbustTCP/ModbusTCP.cs b/IOB-WIN-MBUS/IobModbustTCP/ModbusTCP.cs
index 342d603a..fa86403b 100644
--- a/IOB-WIN-MBUS/IobModbustTCP/ModbusTCP.cs
+++ b/IOB-WIN-MBUS/IobModbustTCP/ModbusTCP.cs
@@ -40,7 +40,7 @@ namespace IOB_WIN_MBUS.IobModbusTCP
if (IOBConfFull != null)
{
// gestione invio ritardato contapezzi
- pzCountDelay = utils.CRI("pzCountDelay");
+
lastPzCountSend = adesso;
lastWarnODL = adesso;
// inizializzo parametri...
@@ -309,12 +309,12 @@ namespace IOB_WIN_MBUS.IobModbusTCP
///
public override void processContapezzi()
{
- if ((enablePzCountByApp || enablePzCountByIob) && !(disablePzCountByIob))
+ if (enablePzCountByApp)
{
- if (IOBConfFull.OptParConf.Count > 0 && !string.IsNullOrWhiteSpace(getOptPar("PZCOUNT_MODE")))
+ if (IOBConfFull.OptParConf.Count > 0 && !string.IsNullOrWhiteSpace(IOBConfFull.Device.PzCountMode))
{
// cerco in lastDynData...
- string pzCountKey = getOptPar("PZCOUNT_MODE").Replace("STD.", "");
+ string pzCountKey = IOBConfFull.Device.PzCountMode.Replace("STD.", "");
if (lastDynData.ContainsKey(pzCountKey))
{
string rawVal = lastDynData[pzCountKey];
@@ -1109,9 +1109,9 @@ namespace IOB_WIN_MBUS.IobModbusTCP
{
// verifico quale modalità sia richiesta: STD (6711) oppure BIT (Custom,
// con indicazione area)
- if (IOBConfFull.OptParConf.Count > 0 && !string.IsNullOrWhiteSpace(getOptPar("PZCOUNT_MODE")))
+ if (IOBConfFull.OptParConf.Count > 0 && !string.IsNullOrWhiteSpace(IOBConfFull.Device.PzCountMode))
{
- if (getOptPar("PZCOUNT_MODE").StartsWith("STD"))
+ if (IOBConfFull.Device.PzCountMode.StartsWith("STD"))
{
lgInfoStartup("Init contapezzi ModBusTCP: pzCntReload(true)");
pzCntReload(true);
@@ -1130,7 +1130,7 @@ namespace IOB_WIN_MBUS.IobModbusTCP
else
{
contapezziIOB = 0;
- lgDebug("Contapezzi STD disabilitato: modalità {0}", getOptPar("PZCOUNT_MODE"));
+ lgDebug("Contapezzi STD disabilitato: modalità {0}", IOBConfFull.Device.PzCountMode);
}
}
else
diff --git a/IOB-WIN-MITSUBISHI/Iob/Mitsubishi.cs b/IOB-WIN-MITSUBISHI/Iob/Mitsubishi.cs
index d256bc0a..d220b970 100644
--- a/IOB-WIN-MITSUBISHI/Iob/Mitsubishi.cs
+++ b/IOB-WIN-MITSUBISHI/Iob/Mitsubishi.cs
@@ -22,7 +22,7 @@ namespace IOB_WIN_MITSUBISHI.Iob
{
lgInfo("Start init Mitsubishi");
// gestione invio ritardato contapezzi
- pzCountDelay = utils.CRI("pzCountDelay");
+
lastPzCountSend = DateTime.Now;
lastWarnODL = DateTime.Now;
@@ -97,28 +97,15 @@ namespace IOB_WIN_MITSUBISHI.Iob
lgInfo($"Start init Mitsubishi | SysType: {sysType}");
// gestione override contapezzi
- enablePzCountByApp = utils.CRB("enableContapezzi");
- enablePzCountByIob = (getOptPar("ENABLE_PZCOUNT") == "TRUE");
disablePzCountByIob = (getOptPar("DISABLE_PZCOUNT") == "FALSE");
- // gestione override idx articoli...
- if (!string.IsNullOrEmpty(getOptPar("NUM_ART_CHR_TRIM")))
- {
- string NUM_ART_CHR_TRIM = getOptPar("NUM_ART_CHR_TRIM");
- bool.TryParse(NUM_ART_CHR_TRIM, out numArtCharTrim);
- }
+
if (!string.IsNullOrEmpty(getOptPar("MAX_CHAR_DESC")))
{
string MAX_CHAR_DESC = getOptPar("MAX_CHAR_DESC");
int.TryParse(MAX_CHAR_DESC, out maxVarStrLen);
}
- // leggo conf x ricerca valori memoria da tracciare in log di continuo...
-#if false
- mem2trace = fIni.ReadString("OPTPAR", "MEM_2_TRACE", "");
-#endif
- mem2trace = IOBConfFull.DeviceConf.MemoryConf.Mem2Trace;
-
// è little endian (NON serve conversione)
hasBigEndian = false;
lgInfoStartup($"Start init Adapter MITSUBISHI | IP {IOBConfFull.DeviceConf.ConnectConf.IpAddr}:{IOBConfFull.DeviceConf.ConnectConf.Port} per IOB {IOBConfFull.GenConf.CodIOB}");
@@ -140,16 +127,16 @@ namespace IOB_WIN_MITSUBISHI.Iob
// effettuo tryConnect...
lgInfo("MITSUBISHI startup: tryConnect");
tryConnect();
- if ((enablePzCountByApp || enablePzCountByIob) && !(disablePzCountByIob))
+ if (enablePzCountByApp)
{
lgInfo("MITSUBISHI: inizio gestione contapezzi");
try
{
// verifico quale modalità sia richiesta: STD (6711) oppure BIT (Custom, con
// indicazione area)
- if (!string.IsNullOrEmpty(getOptPar("PZCOUNT_MODE")))
+ if (!string.IsNullOrEmpty(IOBConfFull.Device.PzCountMode))
{
- if (getOptPar("PZCOUNT_MODE").StartsWith("STD"))
+ if (IOBConfFull.Device.PzCountMode.StartsWith("STD"))
{
lgInfo("Init contapezzi MITSUBISHI: pzCntReload(true)");
pzCntReload(true);
@@ -163,7 +150,7 @@ namespace IOB_WIN_MITSUBISHI.Iob
else
{
contapezziIOB = 0;
- lgInfo("Contapezzi STD disabilitato: modalità {0}", getOptPar("PZCOUNT_MODE"));
+ lgInfo("Contapezzi STD disabilitato: modalità {0}", IOBConfFull.Device.PzCountMode);
}
}
else
@@ -617,7 +604,7 @@ namespace IOB_WIN_MITSUBISHI.Iob
///
public override void processContapezzi()
{
- if ((enablePzCountByApp || enablePzCountByIob) && !(disablePzCountByIob))
+ if (enablePzCountByApp)
{
// procedo SOLO SE ho connessione...
if (connectionOk)
@@ -630,7 +617,7 @@ namespace IOB_WIN_MITSUBISHI.Iob
if (IOBConfFull.OptParConf.Count > 0)
{
// contapezzi ATTUALE
- string memAddr = getOptPar("PZCOUNT_MODE");
+ string memAddr = IOBConfFull.Device.PzCountMode;
if (!string.IsNullOrEmpty(memAddr))
{
// verifico quale modalità sia richiesta: STD oppure CST (Custom, TBD)
@@ -795,7 +782,7 @@ namespace IOB_WIN_MITSUBISHI.Iob
try
{
// contapezzi ATTUALE
- if (!string.IsNullOrEmpty(getOptPar("PZCOUNT_MODE")))
+ if (!string.IsNullOrEmpty(IOBConfFull.Device.PzCountMode))
{
int valReq = 0;
// scrivo valore 0 x il contapezzi
@@ -1330,7 +1317,7 @@ namespace IOB_WIN_MITSUBISHI.Iob
// se non trovato... leggo da OPT_PAR
if (string.IsNullOrEmpty(memAddr))
{
- memAddr = getOptPar("PZCOUNT_MODE");
+ memAddr = IOBConfFull.Device.PzCountMode;
}
// bonifica variabile da definizione STD iniziale...
if (memAddr.StartsWith("STD"))
@@ -1688,7 +1675,7 @@ namespace IOB_WIN_MITSUBISHI.Iob
lgInfo($"Differenza Contapezzi: contapezziPLC: {contapezziPLC} | contapezziIOB {contapezziIOB}");
}
- if ((enablePzCountByApp || enablePzCountByIob) && !(disablePzCountByIob))
+ if (enablePzCountByApp)
{
// verifico se variato contapezzi...
if (contapezziPLC > contapezziIOB)
diff --git a/IOB-WIN-MTC/Iob/MTConn.cs b/IOB-WIN-MTC/Iob/MTConn.cs
index f38b7290..2b1343eb 100644
--- a/IOB-WIN-MTC/Iob/MTConn.cs
+++ b/IOB-WIN-MTC/Iob/MTConn.cs
@@ -31,7 +31,7 @@ namespace IOB_WIN_MTC.Iob
public MTConn(AdapterFormNext caller, IobConfTree IobConfFull) : base(caller, IobConfFull)
{
// gestione invio ritardato contapezzi
- pzCountDelay = utils.CRI("pzCountDelay");
+
// gestione data filtering...
if (!string.IsNullOrEmpty(getOptPar("ENABLE_DATA_FILTER")))
{
@@ -49,9 +49,9 @@ namespace IOB_WIN_MTC.Iob
}
// gestione override contapezzi
- enablePzCountByApp = utils.CRB("enableContapezzi");
- enablePzCountByIob = (getOptPar("ENABLE_PZCOUNT") == "TRUE");
- disablePzCountByIob = (getOptPar("DISABLE_PZCOUNT") == "TRUE");
+
+
+
// gestione restart OpcUa client...
if (!string.IsNullOrEmpty(getOptPar("ENABLE_CLI_RESTART")))
@@ -151,7 +151,7 @@ namespace IOB_WIN_MTC.Iob
///
public override void processContapezzi()
{
- if ((enablePzCountByApp || enablePzCountByIob) && !(disablePzCountByIob))
+ if (enablePzCountByApp)
{
if (queueInEnabCurr)
{
diff --git a/IOB-WIN-OMRON/Iob/Omron.cs b/IOB-WIN-OMRON/Iob/Omron.cs
index d88d4468..1f46b629 100644
--- a/IOB-WIN-OMRON/Iob/Omron.cs
+++ b/IOB-WIN-OMRON/Iob/Omron.cs
@@ -21,7 +21,7 @@ namespace IOB_WIN_OMRON.Iob
public Omron(AdapterFormNext caller, IobConfTree IobConfFull) : base(caller, IobConfFull)
{
// gestione invio ritardato contapezzi
- pzCountDelay = utils.CRI("pzCountDelay");
+
lastPzCountSend = DateTime.Now;
lastWarnODL = DateTime.Now;
@@ -68,7 +68,7 @@ namespace IOB_WIN_OMRON.Iob
// hard coded... !!!FARE!!! rivedere megio conf
contapezziPLC = pzCounter;
// verifico quale modalità sia richiesta: STD (6711) oppure BIT (Custom, con indicazione area)
- if (cIobConf.optPar.Count > 0 && getOptPar("PZCOUNT_MODE") != "")
+ if (cIobConf.optPar.Count > 0 && IOBConfFull.Device.PzCountMode != "")
{
}
}
diff --git a/IOB-WIN-OPC-UA/DATA/CONF/MAIN.ini b/IOB-WIN-OPC-UA/DATA/CONF/MAIN.ini
index c89d344d..4b534655 100644
--- a/IOB-WIN-OPC-UA/DATA/CONF/MAIN.ini
+++ b/IOB-WIN-OPC-UA/DATA/CONF/MAIN.ini
@@ -25,6 +25,7 @@ CLI_INST=SteamWareSim
;STARTLIST=3026
;STARTLIST=2015
;STARTLIST=TEND_250_53
-STARTLIST=Tend_RAMA_10_47
+;STARTLIST=Tend_RAMA_10_47
+STARTLIST=3026
MAXCNC=10
\ No newline at end of file
diff --git a/IOB-WIN-OPC-UA/DATA/HIST/.placeholder b/IOB-WIN-OPC-UA/DATA/HIST/.placeholder
deleted file mode 100644
index 5f282702..00000000
--- a/IOB-WIN-OPC-UA/DATA/HIST/.placeholder
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/IOB-WIN-OPC-UA/IOB-WIN-OPC-UA.csproj b/IOB-WIN-OPC-UA/IOB-WIN-OPC-UA.csproj
index ea1dd9f4..4d0e12ee 100644
--- a/IOB-WIN-OPC-UA/IOB-WIN-OPC-UA.csproj
+++ b/IOB-WIN-OPC-UA/IOB-WIN-OPC-UA.csproj
@@ -203,8 +203,12 @@
-
-
+
+ Always
+
+
+ Always
+
@@ -264,9 +268,6 @@
-
- Always
-
diff --git a/IOB-WIN-OPC-UA/IobOpc/OpcUa.cs b/IOB-WIN-OPC-UA/IobOpc/OpcUa.cs
index 6596ab96..42f011ba 100644
--- a/IOB-WIN-OPC-UA/IobOpc/OpcUa.cs
+++ b/IOB-WIN-OPC-UA/IobOpc/OpcUa.cs
@@ -37,7 +37,7 @@ namespace IOB_WIN_OPC_UA.IobOpc
{
lgInfo("Init OpcUa");
// gestione invio ritardato contapezzi
- pzCountDelay = utils.CRI("pzCountDelay");
+
// inizializzo...
subscribedItems = new List();
@@ -48,9 +48,9 @@ namespace IOB_WIN_OPC_UA.IobOpc
int.TryParse(getOptPar("MAX_TRY_PING"), out maxTryPing);
}
- enablePzCountByApp = utils.CRB("enableContapezzi");
- enablePzCountByIob = (getOptPar("ENABLE_PZCOUNT") == "TRUE");
- disablePzCountByIob = (getOptPar("DISABLE_PZCOUNT") == "TRUE");
+
+
+
// gestione data filtering...
if (!string.IsNullOrEmpty(getOptPar("ENABLE_DATA_FILTER")))
@@ -470,7 +470,7 @@ namespace IOB_WIN_OPC_UA.IobOpc
///
public override void processContapezzi()
{
- if ((enablePzCountByApp || enablePzCountByIob) && !(disablePzCountByIob))
+ if (enablePzCountByApp)
{
if (string.IsNullOrEmpty(opcUaParams.keyPartCount))
{
diff --git a/IOB-WIN-OPC-UA/IobOpc/OpcUaImas.cs b/IOB-WIN-OPC-UA/IobOpc/OpcUaImas.cs
index d5041609..e4ee2740 100644
--- a/IOB-WIN-OPC-UA/IobOpc/OpcUaImas.cs
+++ b/IOB-WIN-OPC-UA/IobOpc/OpcUaImas.cs
@@ -51,7 +51,7 @@ namespace IOB_WIN_OPC_UA.IobOpc
///
public override void processContapezzi()
{
- if ((enablePzCountByApp || enablePzCountByIob) && !(disablePzCountByIob))
+ if (enablePzCountByApp)
{
// check condizione validazione
if (checkMultiCondition(opcUaParams.condCountEnabled) || opcUaParams.condCountEnabled.checkList.Count == 0)
diff --git a/IOB-WIN-OPC-UA/IobOpc/OpcUaKpw.cs b/IOB-WIN-OPC-UA/IobOpc/OpcUaKpw.cs
index 46ef9a1c..b367d4a8 100644
--- a/IOB-WIN-OPC-UA/IobOpc/OpcUaKpw.cs
+++ b/IOB-WIN-OPC-UA/IobOpc/OpcUaKpw.cs
@@ -53,7 +53,7 @@ namespace IOB_WIN_OPC_UA.IobOpc
///
public override void processContapezzi()
{
- if ((enablePzCountByApp || enablePzCountByIob) && !(disablePzCountByIob))
+ if (enablePzCountByApp)
{
// check condizione validazione
if (checkMultiCondition(opcUaParams.condCountEnabled) || opcUaParams.condCountEnabled.checkList.Count == 0)
diff --git a/IOB-WIN-OPC-UA/IobOpc/OpcUaMBH.cs b/IOB-WIN-OPC-UA/IobOpc/OpcUaMBH.cs
index 82f3a044..f3b0b27d 100644
--- a/IOB-WIN-OPC-UA/IobOpc/OpcUaMBH.cs
+++ b/IOB-WIN-OPC-UA/IobOpc/OpcUaMBH.cs
@@ -61,7 +61,7 @@ namespace IOB_WIN_OPC_UA.IobOpc
///
public override void processContapezzi()
{
- if ((enablePzCountByApp || enablePzCountByIob) && !(disablePzCountByIob))
+ if (enablePzCountByApp)
{
// check condizione validazione
if (checkMultiCondition(opcUaParams.condCountEnabled) || opcUaParams.condCountEnabled.checkList.Count == 0)
diff --git a/IOB-WIN-OPC-UA/IobOpc/OpcUaUlma.cs b/IOB-WIN-OPC-UA/IobOpc/OpcUaUlma.cs
index 05b5cdac..a11f1305 100644
--- a/IOB-WIN-OPC-UA/IobOpc/OpcUaUlma.cs
+++ b/IOB-WIN-OPC-UA/IobOpc/OpcUaUlma.cs
@@ -51,7 +51,7 @@ namespace IOB_WIN_OPC_UA.IobOpc
///
public override void processContapezzi()
{
- if ((enablePzCountByApp || enablePzCountByIob) && !(disablePzCountByIob))
+ if (enablePzCountByApp)
{
// check condizione validazione
if (checkMultiCondition(opcUaParams.condCountEnabled) || opcUaParams.condCountEnabled.checkList.Count == 0)
diff --git a/IOB-WIN-OPC-UA/postBuildTgt.bat b/IOB-WIN-OPC-UA/postBuildTgt.bat
index eaa5a82f..4b94843d 100644
--- a/IOB-WIN-OPC-UA/postBuildTgt.bat
+++ b/IOB-WIN-OPC-UA/postBuildTgt.bat
@@ -40,11 +40,11 @@ REM IOB-WIN-SIM
REM ROBOCOPY %2 \\IOB-WIN-SIMULA\Steamware\IOB-WIN-OPC-UA-DEB /MIR
REM IOBVPN4MACHINE
-ROBOCOPY %2 \\10.51.90.5\Steamware\IOB-WIN-OPC-UA-DEB /MIR
+REM ROBOCOPY %2 \\10.51.90.5\Steamware\IOB-WIN-OPC-UA-DEB /MIR
REM ROBOCOPY %2 \\10.51.90.5\Steamware\IOB-WIN-OPC-UA-DEB /MIR /log:RobocopyTransfer.log
REM ROBOCOPY %2 Z:\IOB-WIN-OPC-UA-DEB /MIR
+ROBOCOPY %2 \\10.51.90.9\Steamware\IOB-WIN-OPC-UA-DEB /MIR
REM ROBOCOPY %2 \\10.51.90.10\Steamware\IOB-WIN-OPC-UA-DEB /MIR
-REM ROBOCOPY %2 \\10.51.90.9\Steamware\IOB-WIN-OPC-UA-DEB /MIR
goto END
diff --git a/IOB-WIN-OSAI/Iob/OSAI.cs b/IOB-WIN-OSAI/Iob/OSAI.cs
index 4b1cfab6..8e7aa539 100644
--- a/IOB-WIN-OSAI/Iob/OSAI.cs
+++ b/IOB-WIN-OSAI/Iob/OSAI.cs
@@ -36,7 +36,7 @@ namespace IOB_WIN_OSAI.Iob
public OSAI(AdapterFormNext caller, IobConfTree IobConfNew) : base(caller, IobConfNew)
{
// gestione invio ritardato contapezzi
- pzCountDelay = utils.CRI("pzCountDelay");
+
lastPzCountSend = DateTime.Now;
lastWarnODL = DateTime.Now;
if (IOBConfFull != null)
@@ -128,9 +128,9 @@ namespace IOB_WIN_OSAI.Iob
{
// verifico quale modalità sia richiesta: STD (6711) oppure BIT (Custom, con
// indicazione area)
- if (IobConfNew.OptParConf.Count > 0 && !string.IsNullOrEmpty(getOptPar("PZCOUNT_MODE")))
+ if (IobConfNew.OptParConf.Count > 0 && !string.IsNullOrEmpty(IOBConfFull.Device.PzCountMode))
{
- if (getOptPar("PZCOUNT_MODE").StartsWith("OVAR"))
+ if (IOBConfFull.Device.PzCountMode.StartsWith("OVAR"))
{
lgInfo("Init contapezzi OSAI: pzCntReload(true)");
pzCntReload(true);
@@ -144,7 +144,7 @@ namespace IOB_WIN_OSAI.Iob
else
{
contapezziIOB = 0;
- lgInfo("Contapezzi STD disabilitato: modalità {0}", getOptPar("PZCOUNT_MODE"));
+ lgInfo("Contapezzi STD disabilitato: modalità {0}", IOBConfFull.Device.PzCountMode);
}
}
else
@@ -269,9 +269,9 @@ namespace IOB_WIN_OSAI.Iob
{
// verifico quale modalità sia richiesta: STD (6711) oppure BIT (Custom, con
// indicazione area)
- if (IOBConfFull.OptParConf.Count > 0 && !string.IsNullOrEmpty(getOptPar("PZCOUNT_MODE")))
+ if (IOBConfFull.OptParConf.Count > 0 && !string.IsNullOrEmpty(IOBConfFull.Device.PzCountMode))
{
- string memAddr = getOptPar("PZCOUNT_MODE");
+ string memAddr = IOBConfFull.Device.PzCountMode;
if (memAddr.StartsWith("STD"))
{
// inizio verifica area memoria/parametro levando prima parte codice
diff --git a/IOB-WIN-SIEMENS/IobSiemens/IobSiemensTorri_legacy.cs b/IOB-WIN-SIEMENS/IobSiemens/IobSiemensTorri_legacy.cs
index faaf961e..720c6045 100644
--- a/IOB-WIN-SIEMENS/IobSiemens/IobSiemensTorri_legacy.cs
+++ b/IOB-WIN-SIEMENS/IobSiemens/IobSiemensTorri_legacy.cs
@@ -174,7 +174,7 @@ namespace IOB_WIN
public IobSiemensTorri(AdapterForm caller, IobConfiguration IOBConf) : base(caller, IOBConf)
{
// gestione invio ritardato contapezzi
- pzCountDelay = utils.CRI("pzCountDelay");
+
lastPzCountSend = DateTime.Now;
lastWarnODL = DateTime.Now;
// init conf
diff --git a/IOB-WIN-SIEMENS/IobSiemens/Siemens.cs b/IOB-WIN-SIEMENS/IobSiemens/Siemens.cs
index fe782c86..9e38608c 100644
--- a/IOB-WIN-SIEMENS/IobSiemens/Siemens.cs
+++ b/IOB-WIN-SIEMENS/IobSiemens/Siemens.cs
@@ -52,7 +52,7 @@ namespace IOB_WIN_SIEMENS.IobSiemens
if (IOBConfFull != null)
{
// gestione invio ritardato contapezzi
- pzCountDelay = utils.CRI("pzCountDelay");
+
lastPzCountSend = DateTime.Now;
lastWarnODL = DateTime.Now;
// inizializzo parametri...
@@ -71,7 +71,7 @@ namespace IOB_WIN_SIEMENS.IobSiemens
setParamPlc();
// sistemo variabili varie (es contapezzi)
- memAddrPzCount = getOptPar("PZCOUNT_MODE");
+ memAddrPzCount = IOBConfFull.Device.PzCountMode;
memAddrPzQCtrl = getOptPar("PZQCTRL_MODE");
disableByIob = (getOptPar("DISABLE_PZCOUNT") == "TRUE");
enableContapezzi = utils.CRB("enableContapezzi");
@@ -1538,9 +1538,9 @@ namespace IOB_WIN_SIEMENS.IobSiemens
{
// verifico quale modalità sia richiesta: STD (6711) oppure BIT (Custom,
// con indicazione area)
- if (IOBConfFull.OptParConf.Count > 0 && !string.IsNullOrWhiteSpace(getOptPar("PZCOUNT_MODE")))
+ if (IOBConfFull.OptParConf.Count > 0 && !string.IsNullOrWhiteSpace(IOBConfFull.Device.PzCountMode))
{
- if (getOptPar("PZCOUNT_MODE").StartsWith("STD"))
+ if (IOBConfFull.Device.PzCountMode.StartsWith("STD"))
{
lgDebug("Init contapezzi SIEMENS: pzCntReload(true)");
pzCntReload(true);
@@ -1554,7 +1554,7 @@ namespace IOB_WIN_SIEMENS.IobSiemens
else
{
contapezziIOB = 0;
- lgDebug("Contapezzi STD disabilitato: modalità {0}", getOptPar("PZCOUNT_MODE"));
+ lgDebug("Contapezzi STD disabilitato: modalità {0}", IOBConfFull.Device.PzCountMode);
}
}
else
diff --git a/IOB-WIN/IobFanuc.cs b/IOB-WIN/IobFanuc.cs
index 5c7de7cd..1ba84635 100644
--- a/IOB-WIN/IobFanuc.cs
+++ b/IOB-WIN/IobFanuc.cs
@@ -86,7 +86,7 @@ namespace IOB_WIN
RawInput = new byte[6];
// gestione invio ritardato contapezzi
- pzCountDelay = utils.CRI("pzCountDelay");
+
lastPzCountSend = DateTime.Now;
lastWarnODL = DateTime.Now;
@@ -187,9 +187,9 @@ namespace IOB_WIN
try
{
// verifico quale modalità sia richiesta: STD (6711) oppure BIT (Custom, con indicazione area)
- if (cIobConf.optPar.Count > 0 && !string.IsNullOrEmpty(getOptPar("PZCOUNT_MODE")))
+ if (cIobConf.optPar.Count > 0 && !string.IsNullOrEmpty(IOBConfFull.Device.PzCountMode))
{
- if (getOptPar("PZCOUNT_MODE").StartsWith("STD"))
+ if (IOBConfFull.Device.PzCountMode.StartsWith("STD"))
{
lgInfo("Init contapezzi FANUC: pzCntReload(true)");
pzCntReload(true);
@@ -201,7 +201,7 @@ namespace IOB_WIN
else
{
contapezziIOB = 0;
- lgInfo("Contapezzi STD disabilitato: modalità {0}", getOptPar("PZCOUNT_MODE"));
+ lgInfo("Contapezzi STD disabilitato: modalità {0}", IOBConfFull.Device.PzCountMode);
}
}
else
@@ -992,10 +992,10 @@ namespace IOB_WIN
if (cIobConf.optPar.Count > 0)
{
// contapezzi ATTUALE
- if (!string.IsNullOrEmpty(getOptPar("PZCOUNT_MODE")))
+ if (!string.IsNullOrEmpty(IOBConfFull.Device.PzCountMode))
{
// verifico quale modalità sia richiesta: STD (6711) oppure BIT (Custom, con indicazione area)
- string memAddr = getOptPar("PZCOUNT_MODE");
+ string memAddr = IOBConfFull.Device.PzCountMode;
if (memAddr.StartsWith("STD"))
{
// inizio verifica area memoria/parametro levando prima parte codice
@@ -1167,7 +1167,7 @@ namespace IOB_WIN
string newVal = "";
#if false
// controllo SE salvare contapezzo
- if (getOptPar("PZCOUNT_MODE") != "")
+ if (IOBConfFull.Device.PzCountMode != "")
{
sendOptVal("PZ_COUNT", contapezziPLC);
}
@@ -1296,10 +1296,10 @@ namespace IOB_WIN
try
{
// contapezzi ATTUALE
- if (!string.IsNullOrEmpty(getOptPar("PZCOUNT_MODE")))
+ if (!string.IsNullOrEmpty(IOBConfFull.Device.PzCountMode))
{
// verifico quale modalità sia richiesta: STD (6711) oppure BIT (Custom, con indicazione area)
- string memAddr = getOptPar("PZCOUNT_MODE");
+ string memAddr = IOBConfFull.Device.PzCountMode;
if (memAddr.StartsWith("STD"))
{
// inizio verifica area memoria/parametro levando prima parte codice
diff --git a/IOB-WIN/IobKawasaki.cs b/IOB-WIN/IobKawasaki.cs
index 2f2b934a..c00a0284 100644
--- a/IOB-WIN/IobKawasaki.cs
+++ b/IOB-WIN/IobKawasaki.cs
@@ -87,7 +87,7 @@ namespace IOB_WIN
public IobKawasaki(AdapterForm caller, IobConfiguration IOBConf) : base(caller, IOBConf)
{
// gestione invio ritardato contapezzi
- pzCountDelay = utils.CRI("pzCountDelay");
+
lastPzCountSend = DateTime.Now;
lastWarnODL = DateTime.Now;
// init connessione
@@ -667,9 +667,9 @@ namespace IOB_WIN
try
{
// verifico quale modalità sia richiesta: STD (6711) oppure BIT (Custom, con indicazione area)
- if (cIobConf.optPar.Count > 0 && !string.IsNullOrEmpty(getOptPar("PZCOUNT_MODE")))
+ if (cIobConf.optPar.Count > 0 && !string.IsNullOrEmpty(IOBConfFull.Device.PzCountMode))
{
- if (getOptPar("PZCOUNT_MODE").StartsWith("STD"))
+ if (IOBConfFull.Device.PzCountMode.StartsWith("STD"))
{
lgInfo("Init contapezzi KAWASAKI: pzCntReload(true)");
pzCntReload(true);
@@ -681,7 +681,7 @@ namespace IOB_WIN
else
{
contapezziIOB = 0;
- lgInfo("Contapezzi STD disabilitato: modalità {0}", getOptPar("PZCOUNT_MODE"));
+ lgInfo("Contapezzi STD disabilitato: modalità {0}", IOBConfFull.Device.PzCountMode);
}
}
else
@@ -828,10 +828,10 @@ namespace IOB_WIN
// hard coded... !!!FARE!!! rivedere megio conf
contapezziPLC = pzCounter;
// verifico quale modalità sia richiesta: STD (6711) oppure BIT (Custom, con indicazione area)
- if (cIobConf.optPar.Count > 0 && !string.IsNullOrEmpty(getOptPar("PZCOUNT_MODE")))
+ if (cIobConf.optPar.Count > 0 && !string.IsNullOrEmpty(IOBConfFull.Device.PzCountMode))
{
#if false
- string memAddr = getOptPar("PZCOUNT_MODE");
+ string memAddr = IOBConfFull.Device.PzCountMode;
if (memAddr.StartsWith("STD"))
{
// inizio verifica area memoria/parametro levando prima parte codice
diff --git a/IOB-WIN/IobOSAI.cs b/IOB-WIN/IobOSAI.cs
index fb7cd067..2982f319 100644
--- a/IOB-WIN/IobOSAI.cs
+++ b/IOB-WIN/IobOSAI.cs
@@ -58,7 +58,7 @@ namespace IOB_WIN
public IobOSAI(AdapterForm caller, IobConfiguration IOBConf) : base(caller, IOBConf)
{
// gestione invio ritardato contapezzi
- pzCountDelay = utils.CRI("pzCountDelay");
+
lastPzCountSend = DateTime.Now;
lastWarnODL = DateTime.Now;
if (IOBConf != null)
@@ -146,9 +146,9 @@ namespace IOB_WIN
try
{
// verifico quale modalità sia richiesta: STD (6711) oppure BIT (Custom, con indicazione area)
- if (cIobConf.optPar.Count > 0 && !string.IsNullOrEmpty(getOptPar("PZCOUNT_MODE")))
+ if (cIobConf.optPar.Count > 0 && !string.IsNullOrEmpty(IOBConfFull.Device.PzCountMode))
{
- if (getOptPar("PZCOUNT_MODE").StartsWith("OVAR"))
+ if (IOBConfFull.Device.PzCountMode.StartsWith("OVAR"))
{
lgInfo("Init contapezzi OSAI: pzCntReload(true)");
pzCntReload(true);
@@ -160,7 +160,7 @@ namespace IOB_WIN
else
{
contapezziIOB = 0;
- lgInfo("Contapezzi STD disabilitato: modalità {0}", getOptPar("PZCOUNT_MODE"));
+ lgInfo("Contapezzi STD disabilitato: modalità {0}", IOBConfFull.Device.PzCountMode);
}
}
else
@@ -482,9 +482,9 @@ namespace IOB_WIN
try
{
// verifico quale modalità sia richiesta: STD (6711) oppure BIT (Custom, con indicazione area)
- if (cIobConf.optPar.Count > 0 && !string.IsNullOrEmpty(getOptPar("PZCOUNT_MODE")))
+ if (cIobConf.optPar.Count > 0 && !string.IsNullOrEmpty(IOBConfFull.Device.PzCountMode))
{
- string memAddr = getOptPar("PZCOUNT_MODE");
+ string memAddr = IOBConfFull.Device.PzCountMode;
if (memAddr.StartsWith("STD"))
{
// inizio verifica area memoria/parametro levando prima parte codice
diff --git a/IOB-WIN/IobOmron.cs b/IOB-WIN/IobOmron.cs
index ec7dfff2..9f3ebda2 100644
--- a/IOB-WIN/IobOmron.cs
+++ b/IOB-WIN/IobOmron.cs
@@ -78,7 +78,7 @@ namespace IOB_WIN
public IobOmron(AdapterForm caller, IobConfiguration IOBConf) : base(caller, IOBConf)
{
// gestione invio ritardato contapezzi
- pzCountDelay = utils.CRI("pzCountDelay");
+
lastPzCountSend = DateTime.Now;
lastWarnODL = DateTime.Now;
@@ -608,7 +608,7 @@ namespace IOB_WIN
// hard coded... !!!FARE!!! rivedere megio conf
contapezziPLC = pzCounter;
// verifico quale modalità sia richiesta: STD (6711) oppure BIT (Custom, con indicazione area)
- if (cIobConf.optPar.Count > 0 && getOptPar("PZCOUNT_MODE") != "")
+ if (cIobConf.optPar.Count > 0 && IOBConfFull.Device.PzCountMode != "")
{
}
}
diff --git a/IOB-WIN/IobSiemens.cs b/IOB-WIN/IobSiemens.cs
index 5e11843c..15a6a4e4 100644
--- a/IOB-WIN/IobSiemens.cs
+++ b/IOB-WIN/IobSiemens.cs
@@ -73,7 +73,7 @@ namespace IOB_WIN
if (IOBConf != null)
{
// gestione invio ritardato contapezzi
- pzCountDelay = utils.CRI("pzCountDelay");
+
lastPzCountSend = DateTime.Now;
lastWarnODL = DateTime.Now;
// inizializzo parametri...
@@ -602,9 +602,9 @@ namespace IOB_WIN
try
{
// verifico quale modalità sia richiesta: STD (6711) oppure BIT (Custom, con indicazione area)
- if (cIobConf.optPar.Count > 0 && !string.IsNullOrWhiteSpace(getOptPar("PZCOUNT_MODE")))
+ if (cIobConf.optPar.Count > 0 && !string.IsNullOrWhiteSpace(IOBConfFull.Device.PzCountMode))
{
- if (getOptPar("PZCOUNT_MODE").StartsWith("STD"))
+ if (IOBConfFull.Device.PzCountMode.StartsWith("STD"))
{
lgInfo("Init contapezzi SIEMENS: pzCntReload(true)");
pzCntReload(true);
@@ -616,7 +616,7 @@ namespace IOB_WIN
else
{
contapezziIOB = 0;
- lgInfo("Contapezzi STD disabilitato: modalità {0}", getOptPar("PZCOUNT_MODE"));
+ lgInfo("Contapezzi STD disabilitato: modalità {0}", IOBConfFull.Device.PzCountMode);
}
}
else
@@ -897,9 +897,9 @@ namespace IOB_WIN
string memAddrPzQCtrl = "";
string strOutValPzQCtrl = "";
- if (!string.IsNullOrEmpty(getOptPar("PZCOUNT_MODE")))
+ if (!string.IsNullOrEmpty(IOBConfFull.Device.PzCountMode))
{
- memAddrPzCount = getOptPar("PZCOUNT_MODE");
+ memAddrPzCount = IOBConfFull.Device.PzCountMode;
strOutValPzBuoni = readCountVal(ref memAddrPzCount);
// verifico valori letti
diff --git a/IOB-WIN/IobSiemensTorri_legacy.cs b/IOB-WIN/IobSiemensTorri_legacy.cs
index faaf961e..720c6045 100644
--- a/IOB-WIN/IobSiemensTorri_legacy.cs
+++ b/IOB-WIN/IobSiemensTorri_legacy.cs
@@ -174,7 +174,7 @@ namespace IOB_WIN
public IobSiemensTorri(AdapterForm caller, IobConfiguration IOBConf) : base(caller, IOBConf)
{
// gestione invio ritardato contapezzi
- pzCountDelay = utils.CRI("pzCountDelay");
+
lastPzCountSend = DateTime.Now;
lastWarnODL = DateTime.Now;
// init conf
diff --git a/IOB-WIN/IobSimula.cs b/IOB-WIN/IobSimula.cs
index 26bc9f66..367acd34 100644
--- a/IOB-WIN/IobSimula.cs
+++ b/IOB-WIN/IobSimula.cs
@@ -110,7 +110,7 @@ namespace IOB_WIN
public IobSimula(AdapterForm caller, IobConfiguration IOBConf) : base(caller, IOBConf)
{
// gestione invio ritardato contapezzi
- pzCountDelay = utils.CRI("pzCountDelay");
+
DateTime adesso = DateTime.Now;
lastPzCountSend = adesso;
lastWarnODL = adesso;