Merge branch 'release/SprintToVers3.9_01'

This commit is contained in:
Samuele Locatelli
2025-02-28 08:39:31 +01:00
45 changed files with 622 additions and 1214 deletions
+1 -1
View File
@@ -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'
+30 -8
View File
@@ -30,27 +30,49 @@ namespace IOB_UT_NEXT.Config.Base
/// <summary>
/// Indica se si voglia recuperare il PROG NAME dal CNC
/// </summary>
public bool GetProgName { get; set; } = false;
public bool EnabProgName { get; set; } = false;
/// <summary>
/// Dati configurazione CNC
/// </summary>
public ConnectionDto ConnectConf { get; set; } = new ConnectionDto();
public ConnectionDto Connect { get; set; } = new ConnectionDto();
/// <summary>
/// Configurazione SignalLUT con regole decodifica valori (es FANUC/Siemens con BIT0...BIT7...)
/// Indica che sono disabilitati i Task2Exe (tipicamente gestione scrittura verso PLC)
/// </summary>
public Dictionary<string, string> SignalLUT { get; set; } = new Dictionary<string, string>();
public bool DisabExeTask { get; set; } = false;
/// <summary>
/// Configurazione specifica FANUC (se applicabile)
/// Indica che sono disabilitate le fasi controllo stato/semafori (tipicamente x impianti
/// con PLC "suddivisi", PLC + HMI)
/// </summary>
public MemoryDto MemoryConf { get; set; }
public bool DisabStateCh { get; set; } = false;
/// <summary>
/// Configurazione specifica Siemens (se applicabile)
/// Abilitazione gestione contatori
/// </summary>
public SiemensDto SiemensConf { get; set; }
public bool EnabPzCount { get; set; } = true;
/// <summary>
/// Indica se usare la parte numerica di un articolo come codice INT
/// </summary>
public bool NumArtCharTrim { get; set; } = false;
/// <summary>
/// Delay prima di iniziare a gestire il contapezzi, per evitare falsi zeri in inizializzazione sw
/// </summary>
public int PzCountDelay { get; set; } = 2000;
/// <summary>
/// Modalità gestione contapezzi
/// </summary>
public string PzCountMode { get; set; } = "";
/// <summary>
/// Configurazione SigLUT con regole decodifica valori (es FANUC/Siemens con BIT0...BIT7...)
/// </summary>
public Dictionary<string, string> SigLUT { get; set; } = new Dictionary<string, string>();
}
}
+12 -18
View File
@@ -15,14 +15,14 @@ namespace IOB_UT_NEXT.Config.Base
/// <summary>
/// Nome file di configurazione
/// </summary>
public string ConfFileName { get; set; } = "";
public string FileName { get; set; } = "";
/// <summary>
/// Filename senza desinenza del tipo di file
/// </summary>
public string FilenameIOB
{
get => baseUtils.StringBeforeLastChar(ConfFileName, '.');
get => baseUtils.StringBeforeLastChar(FileName, '.');
}
/// <summary>
@@ -45,26 +45,20 @@ namespace IOB_UT_NEXT.Config.Base
/// </summary>
public int MinDeltaSec { get; set; } = 5;
/// <summary>
/// Disabilitazione invio DynData di WDST (WatchDogStateTransfer)
/// </summary>
public bool DisabWDST { get; set; } = true;
/// <summary>
/// Abilita salvataggio coda eventi su redis (ritentiva)
/// </summary>
public bool EnableRedisQueue { get; set; } = true;
public bool EnabRedisQue { get; set; } = true;
/// <summary>
/// Indica che sono disabilitati i Task2Exe (tipicamente gestione scrittura verso PLC)
/// Timer principale interfaccia in ms
/// </summary>
public bool DisableExeTask { get; set; } = false;
/// <summary>
/// Indica che sono disabilitate le fasi controllo stato/semafori (tipicamente x impianti
/// con PLC "suddivisi", PLC + HMI)
/// </summary>
public bool DisableStateCh { get; set; } = false;
/// <summary>
/// Versione software IOB
/// </summary>
public string ReleaseVers { get; set; } = "0.0.0.0";
public int UiTimer { get; set; } = 90;
/// <summary>
/// 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;
/// <summary>
/// Timer principale interfaccia
/// Versione software IOB
/// </summary>
public int TimerIntMs { get; set; } = 90;
public string RelVers { get; set; } = "0.0.0.0";
}
}
+202 -182
View File
@@ -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<string> exclOptPar = new List<string>();
// 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<string, string> memDict = new Dictionary<string, string>();
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<string, string> optParRead = new Dictionary<string, string>();
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<plcMemMapExt>(jsonData);
newConfObj.Memory = JsonConvert.DeserializeObject<plcMemMapExt>(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<string, string> memDict = new Dictionary<string, string>();
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
/// <summary>
/// Info generali delative all'IOB impiegato
/// </summary>
public IobDto GenConf { get; set; } = new IobDto();
/// <summary>
/// Info relative al device interconnesso
/// </summary>
public DeviceDto DeviceConf { get; set; } = new DeviceDto();
public IobDto General { get; set; } = new IobDto();
/// <summary>
/// Parametri server Mapo MES
/// </summary>
public ServerMapoDto MapoMesConf { get; set; } = new ServerMapoDto();
public ServerMapoDto MapoMes { get; set; } = new ServerMapoDto();
/// <summary>
/// Setup info verso IOB-MAN
/// </summary>
public IobManDto IobManConf { get; set; } = new IobManDto();
public IobManDto IobMan { get; set; } = new IobManDto();
/// <summary>
/// Info relative al device interconnesso
/// </summary>
public DeviceDto Device { get; set; } = new DeviceDto();
/// <summary>
/// Struttura memoria PLC x lettura/scrittura
/// </summary>
public plcMemMapExt Memory { get; set; }
/// <summary>
/// Setup processing dati in ingresso (es: blink segnali)
/// </summary>
public InputSignalDto ProcInputConf { get; set; } = new InputSignalDto();
public InputSignalDto SignalProc { get; set; } = new InputSignalDto();
/// <summary>
/// Dati relativi ai parametri gestione tempo ciclo
@@ -416,39 +437,14 @@ namespace IOB_UT_NEXT.Config
public TCDataDto TCDataConf { get; set; } = new TCDataDto();
/// <summary>
/// Configurazione speciale/opzionale per tipo IOB
/// Configurazione Allarmi
/// </summary>
public SpecializedDto SpecialConf { get; set; }
public AlarmDto Alarms { get; set; }
/// <summary>
/// Configurazione speciale comportamenti IOB (es setup)
/// </summary>
public ActionDto ActionConf { get; set; }
/// <summary>
/// Dizionario dei parametri opzionali
/// </summary>
public Dictionary<string, string> OptParConf { get; set; } = new Dictionary<string, string>();
/// <summary>
/// Recupera valore della chiave specifica richiesta
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public string OptParConfGet(string key)
{
string answ = "";
if (OptParConf != null && OptParConf.Count > 0 && OptParConf.ContainsKey(key))
{
answ = OptParConf[key];
}
return answ;
}
/// <summary>
/// Dizionario delle chiavi opz da dizionario
/// </summary>
public Dictionary<string, string> OptKVP { get; set; } = new Dictionary<string, string>();
public ActionDto Actions { get; set; }
/// <summary>
/// Dizionario delle traduzioni termini chiave/valore
@@ -470,6 +466,30 @@ namespace IOB_UT_NEXT.Config
return answ;
}
/// <summary>
/// Dizionario dei parametri opzionali
/// </summary>
public Dictionary<string, string> OptPar { get; set; } = new Dictionary<string, string>();
/// <summary>
/// Recupera valore della chiave specifica richiesta
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public string OptParGet(string key)
{
string answ = "";
if (OptPar != null && OptPar.Count > 0 && OptPar.ContainsKey(key))
{
answ = OptPar[key];
}
return answ;
}
/// <summary>
/// Configurazione speciale/opzionale per tipo IOB
/// </summary>
public SpecializedDto Special { get; set; }
#region Metodi Serializzazione
@@ -554,7 +574,7 @@ namespace IOB_UT_NEXT.Config
/// <param name="txt2log"></param>
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
/// <param name="txt2log"></param>
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
/// <param name="txt2log"></param>
protected void lgTrace(string txt2log)
{
Log.Factory.Configuration.Variables["codIOB"] = GenConf.CodIOB;
Log.Factory.Configuration.Variables["codIOB"] = General.CodIOB;
Log.Trace(txt2log);
}
@@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace IOB_UT_NEXT.Config.Special
{
public class FanucDto
public class FanucDto_old
{
#region Public Properties
@@ -8,9 +8,9 @@ using System.Threading.Tasks;
namespace IOB_UT_NEXT.Config.Special
{
/// <summary>
/// Configurazione memoria a banchi (es: Fanuc, Mitsubishi, ...)
/// Configurazione memoria a banchi (es: Fanuc, Mitsubishi)
/// </summary>
public class MemoryDto
public class MemBankDto
{
/// <summary>
/// Conf aree di memoria da gestire
+9 -9
View File
@@ -13,9 +13,14 @@ namespace IOB_UT_NEXT.Config.Special
public class SpecializedDto
{
/// <summary>
/// Struttura memoria PLC x lettura/scrittura
/// Configurazione specifica FANUC/Mitsubishi (ove applicabile)
/// </summary>
public plcMemMapExt MemMap { get; set; }
public MemBankDto BankConf { get; set; }
/// <summary>
/// Parametri speciali per Modbus
/// </summary>
public ModBusTcpParamConf ModbusConf { get; set; }
/// <summary>
/// Configurazione specifica MTC
@@ -27,20 +32,15 @@ namespace IOB_UT_NEXT.Config.Special
/// </summary>
public OpcUaParamConf OpcUaConf { get; set; }
/// <summary>
/// Parametri speciali per Modbus
/// </summary>
public ModBusTcpParamConf ModbusConf { get; set; }
/// <summary>
/// Configurazione specifica REST
/// </summary>
public RestParamConf RestConf { get; set; }
/// <summary>
/// Configurazione allarmi
/// Configurazione specifica Siemens (se applicabile)
/// </summary>
public AlarmDto AlarmConf { get; set; }
public SiemensDto SiemensConf { get; set; }
}
}
+1 -2
View File
@@ -169,8 +169,7 @@
<Compile Include="Config\IobConfTree.cs" />
<Compile Include="Config\Mem\MemAreaDto.cs" />
<Compile Include="Config\Special\ActionDto.cs" />
<Compile Include="Config\Special\MemoryDto.cs" />
<Compile Include="Config\Special\FanucDto.cs" />
<Compile Include="Config\Special\MemBankDto.cs" />
<Compile Include="Config\Special\SpecializedDto.cs" />
<Compile Include="Config\Special\SiemensDto.cs" />
<Compile Include="DataModel\Fimat.cs" />
+19 -4
View File
@@ -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
/// <summary>
/// Dizionario parametri opzionali
/// </summary>
public Dictionary<string, string> optMemPar { get; set; } = new Dictionary<string, string>();
public Dictionary<string, string> OptMemPar { get; set; } = new Dictionary<string, string>();
/// <summary>
/// Dizionario x decodifica file
/// </summary>
public Dictionary<string, int> fileDecod { get; set; } = new Dictionary<string, int>();
public Dictionary<string, int> FileDecod { get; set; } = new Dictionary<string, int>();
/// <summary>
/// Lista ulteriori configurazioni KeyValuePair
/// </summary>
public Dictionary<string, string> optKVP { get; set; } = new Dictionary<string, string>();
public Dictionary<string, string> OptKVP { get; set; } = new Dictionary<string, string>();
/// <summary>
/// Recupera valore della chiave specifica richiesta x OptKVP
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public string OptKVPGet(string key)
{
string answ = "";
if (OptKVP != null && OptKVP.Count > 0 && OptKVP.ContainsKey(key))
{
answ = OptKVP[key];
}
return answ;
}
/// <summary>
/// Dizionario opzionale di configurazione memorie WRITE con "alias",
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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
+4 -2
View File
@@ -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
+1
View File
@@ -23,6 +23,7 @@ CLI_INST=SteamWareSim
;STARTLIST=VL27
;STARTLIST=3027
;STARTLIST=EV112
;STARTLIST=3021
STARTLIST=3004
+3 -1
View File
@@ -163,7 +163,9 @@
<None Include="DATA\CONF\3007.ini" />
<None Include="DATA\CONF\3012.ini" />
<None Include="DATA\CONF\3015.ini" />
<None Include="DATA\CONF\3021.ini" />
<None Include="DATA\CONF\3021.ini">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\3025.ini" />
<None Include="DATA\CONF\3027.ini" />
<None Include="DATA\CONF\3028.ini" />
+77 -168
View File
@@ -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
/// </summary>
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
/// <summary>
/// LookUpTable di decodifica da CNC a segnali tipo bitmap MAPO
/// </summary>
internal Dictionary<string, string> signLUT = new Dictionary<string, string>();
internal Dictionary<string, string> 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...
+23 -218
View File
@@ -31,20 +31,18 @@ namespace IOB_WIN_FORM
/// <summary>
/// Modello macchina
/// </summary>
public string curModel = "";
public string curModel
{
get => IOBConfFull != null ? IOBConfFull.Device.Model : "";
}
/// <summary>
/// Vendor macchina
/// </summary>
public string curVendor = "";
#if false
/// <summary>
/// configurazione caricata
/// </summary>
public IobConfiguration IOBConf;
#endif
public string curVendor
{
get => IOBConfFull != null ? IOBConfFull.Device.Vendor : "";
}
/// <summary>
/// Configurazione gerarchica completa (v 4.x.x.x)
/// </summary>
@@ -58,7 +56,10 @@ namespace IOB_WIN_FORM
/// <summary>
/// tipo di adapter prescelto...
/// </summary>
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
/// <summary>
/// Salva su file l'oggetto di persistenza dati
/// </summary>
/// <param name="filePath"></param>
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
/// <summary>
/// Mostra update delle statistiche di comunicazione (numero chiamate, tempo medio...)
/// </summary>
@@ -1264,8 +1212,8 @@ namespace IOB_WIN_FORM
/// </summary>
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<string, string> optParRead = new Dictionary<string, string>();
string[] optParRows = fIni.ReadSection("OPTPAR");
if (optParRows.Length > 0)
{
try
{
string[] kvp;
foreach (var item in optParRows)
{
kvp = item.Split('=');
optParRead.Add(kvp[0], kvp[1]);
}
lgDebug($"Caricati {optParRead.Count} parametri opzionali da OPTPAR");
}
catch (Exception exc)
{
lgError(string.Format("EXCEPTION in fase di lettura OPTPAR: {0}{1}", Environment.NewLine, exc));
}
}
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<string, string> optParRead = new Dictionary<string, string>();
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<string, string> setPar = new Dictionary<string, string>();
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,
+14 -14
View File
@@ -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);
}
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -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
+22 -30
View File
@@ -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)
+1 -1
View File
@@ -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")]
+6 -6
View File
@@ -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
+7 -7
View File
@@ -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
/// </summary>
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
+11 -24
View File
@@ -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
/// </summary>
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)
+5 -5
View File
@@ -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
/// </summary>
public override void processContapezzi()
{
if ((enablePzCountByApp || enablePzCountByIob) && !(disablePzCountByIob))
if (enablePzCountByApp)
{
if (queueInEnabCurr)
{
+2 -2
View File
@@ -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 != "")
{
}
}
+2 -1
View File
@@ -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
-1
View File
@@ -1 +0,0 @@

+6 -5
View File
@@ -203,8 +203,12 @@
<None Include="DATA\CONF\2014.json" />
<None Include="DATA\CONF\2015.ini" />
<None Include="DATA\CONF\2015.json" />
<None Include="DATA\CONF\3026.ini" />
<None Include="DATA\CONF\3026.json" />
<None Include="DATA\CONF\3026.ini">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\3026.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\BAGLIETTO_CIMOLAI_01.ini" />
<None Include="DATA\CONF\BAGLIETTO_CIMOLAI_01.json" />
<None Include="DATA\CONF\BAGLIETTO_CIMOLAI_01_alarm.json" />
@@ -264,9 +268,6 @@
<None Include="DATA\CONF\SIMUL_01.ini" />
<None Include="DATA\CONF\SIMUL_01.json" />
<None Include="DATA\CONF\SIMUL_01_alarm.json" />
<None Include="DATA\HIST\.placeholder">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="packages.config" />
<None Include="postBuildTgt.bat" />
<None Include="Properties\Settings.settings">
+5 -5
View File
@@ -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<Opc.Ua.Client.MonitoredItem>();
@@ -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
/// </summary>
public override void processContapezzi()
{
if ((enablePzCountByApp || enablePzCountByIob) && !(disablePzCountByIob))
if (enablePzCountByApp)
{
if (string.IsNullOrEmpty(opcUaParams.keyPartCount))
{
+1 -1
View File
@@ -51,7 +51,7 @@ namespace IOB_WIN_OPC_UA.IobOpc
/// </summary>
public override void processContapezzi()
{
if ((enablePzCountByApp || enablePzCountByIob) && !(disablePzCountByIob))
if (enablePzCountByApp)
{
// check condizione validazione
if (checkMultiCondition(opcUaParams.condCountEnabled) || opcUaParams.condCountEnabled.checkList.Count == 0)
+1 -1
View File
@@ -53,7 +53,7 @@ namespace IOB_WIN_OPC_UA.IobOpc
/// </summary>
public override void processContapezzi()
{
if ((enablePzCountByApp || enablePzCountByIob) && !(disablePzCountByIob))
if (enablePzCountByApp)
{
// check condizione validazione
if (checkMultiCondition(opcUaParams.condCountEnabled) || opcUaParams.condCountEnabled.checkList.Count == 0)
+1 -1
View File
@@ -61,7 +61,7 @@ namespace IOB_WIN_OPC_UA.IobOpc
/// </summary>
public override void processContapezzi()
{
if ((enablePzCountByApp || enablePzCountByIob) && !(disablePzCountByIob))
if (enablePzCountByApp)
{
// check condizione validazione
if (checkMultiCondition(opcUaParams.condCountEnabled) || opcUaParams.condCountEnabled.checkList.Count == 0)
+1 -1
View File
@@ -51,7 +51,7 @@ namespace IOB_WIN_OPC_UA.IobOpc
/// </summary>
public override void processContapezzi()
{
if ((enablePzCountByApp || enablePzCountByIob) && !(disablePzCountByIob))
if (enablePzCountByApp)
{
// check condizione validazione
if (checkMultiCondition(opcUaParams.condCountEnabled) || opcUaParams.condCountEnabled.checkList.Count == 0)
+2 -2
View File
@@ -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
+6 -6
View File
@@ -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
@@ -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
+5 -5
View File
@@ -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
+9 -9
View File
@@ -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
+6 -6
View File
@@ -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
+6 -6
View File
@@ -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
+2 -2
View File
@@ -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 != "")
{
}
}
+6 -6
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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;