ancora update simulazione slow TCiclo

This commit is contained in:
Samuele E. Locatelli
2020-09-30 23:28:50 +02:00
parent cca660a92e
commit 988ac4e7bd
3 changed files with 41 additions and 23 deletions
+38 -20
View File
@@ -675,24 +675,42 @@ namespace IOB_WIN
IOBConf = new IobConfiguration
{
pingMsTimeout = fIni.ReadInteger("IOB", "PING_MS_TIMEOUT", 500)
,vendor = curVendor
,model = curModel
,tipoIob = tipoScelto
,optPar = optParRead
,versIOB = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString()
,codIOB = CurrIOB
,cncIpAddr = 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", "/"), fIni.ReadString("SERVER", "CMDBASE", "/"), fIni.ReadString("SERVER", "CMDFLOG", "/"), fIni.ReadString("SERVER", "CMDALIVE", "/"), fIni.ReadString("SERVER", "CMDENABLED", "/"), fIni.ReadString("SERVER", "CMDREBO", "/"), fIni.ReadString("SERVER", "CMD_ODL_STARTED", "/IOB/getCurrOdlStart/"))
,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(".", ","))
,
vendor = curVendor
,
model = curModel
,
tipoIob = tipoScelto
,
optPar = optParRead
,
versIOB = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString()
,
codIOB = CurrIOB
,
cncIpAddr = 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", "/"), fIni.ReadString("SERVER", "CMDBASE", "/"), fIni.ReadString("SERVER", "CMDFLOG", "/"), fIni.ReadString("SERVER", "CMDALIVE", "/"), fIni.ReadString("SERVER", "CMDENABLED", "/"), fIni.ReadString("SERVER", "CMDREBO", "/"), fIni.ReadString("SERVER", "CMD_ODL_STARTED", "/IOB/getCurrOdlStart/"))
,
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(".", ","))
};
lgInfo($"Creato IOBConf!");
@@ -725,8 +743,8 @@ namespace IOB_WIN
alQueueLen = iobObj.QueueAlarm.Count;
msQueueLen = iobObj.QueueMessages.Count;
// aggiorno labels counters...
counterIob = $"contapezziIOB {iobObj.contapezziIOB}";
counterMac = $"contapezziPLC {iobObj.contapezziPLC}";
counterIob = $"pz IOB {iobObj.contapezziIOB}";
counterMac = $"pz PLC {iobObj.contapezziPLC}";
// verifico IOB status
IobWinStatus currIobStatus = new IobWinStatus()
{
+1 -1
View File
@@ -61,7 +61,7 @@ ENABLE_DYN_DATA=TRUE
FORCE_DYN_DATA=TRUE
NEW_DYN_DATA=TRUE
; indica parametri gestione TcMan
TC_MAX_TC_FACTOR=3.5
TC_MAX_TC_FACTOR=3.9
TC_LAMBDA=0.4
TC_MAX_INCR=5
+2 -2
View File
@@ -354,10 +354,10 @@ namespace IOB_WIN
}
else if (bit2.wait <= 0)
{
// salvo nuovo contapezziPLC (incremento RAND 0..4)
// salvo nuovo contapezziPLC (incremento RAND 0..3)
var rand = new Random();
// se online vero delta altrimenti solo 0..1 50% probabilità
int delta = IobOnline ? rand.Next(1, 5) : rand.Next(0, 2);
int delta = IobOnline ? rand.Next(1, 4) : rand.Next(0, 2);
if (!isMulti)
{
// solo se MP online...