This commit is contained in:
zaccaria.majid
2022-09-23 08:49:49 +02:00
6 changed files with 26 additions and 10 deletions
+21 -5
View File
@@ -285,8 +285,8 @@ void simAlarms()
// verifico situazione allarmi già presenti
foreach (var singleAlarm in CurrActiveAlarm)
{
// 1: seleziono allarmi se ce ne fossero e la loro durata è <= limite * rand (50-150) x rimetterli in elenco
if (adesso.Subtract(singleAlarm.Value).TotalSeconds < MaxDurationAllarmi * rand.Next(50, 150) / 100)
// 1: seleziono allarmi se ce ne fossero e la loro durata è <= limite * rand (50-200) x rimetterli in elenco
if (adesso.Subtract(singleAlarm.Value).TotalSeconds < MaxDurationAllarmi * ((double)rand.Next(50, 200) / 100))
{
NewActiveAlarm.Add(singleAlarm.Key, singleAlarm.Value);
}
@@ -294,7 +294,6 @@ void simAlarms()
// ciclo x numero banchi da config...
foreach (var alarmGroup in alarmsRawConf)
{
// simulo e limito insorgenza NUOVI allarmi al percAllarmi/100 dei casi
newAlarm = rand.Next(0, 100) <= percAllarmi;
if (newAlarm)
@@ -303,8 +302,25 @@ void simAlarms()
// ciclo x aggiungere il numero di allarmi indicato
for (int i = 0; i < numNew; i++)
{
// seleziono uno degli allarmi del banco
int alarmIndex = rand.Next(0, alarmGroup.messages.Count);
// seleziono uno degli allarmi del banco.. dando + peso agli "allarmi bassi"
int alarmIndex = 0;
int msgBlock = rand.Next(1, 5);
switch (msgBlock)
{
case 1:
alarmIndex = rand.Next(0, alarmGroup.messages.Count / 4);
break;
case 2:
alarmIndex = rand.Next(0, alarmGroup.messages.Count / 2);
break;
case 3:
alarmIndex = rand.Next(0, alarmGroup.messages.Count * 3 / 4);
break;
case 4:
default:
alarmIndex = rand.Next(0, alarmGroup.messages.Count);
break;
}
string rndNewAlarm = alarmGroup.messages[alarmIndex];
if (!NewActiveAlarm.ContainsKey(rndNewAlarm))
{
+1 -1
View File
@@ -44,7 +44,7 @@
"SimPar": {
"MinSaveIntSec": 5,
"PercAllarmi": 10,
"MaxAddAllarmi": 3,
"MaxAddAllarmi": 5,
"MaxDurationAllarmi": 10
}
}
+1 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Platforms>AnyCPU;x86;x64</Platforms>
<Version>1.2.2209.2308</Version>
<Version>1.2.2209.2216</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>MAPO-MONO</i>
<h4>Version: 1.2.2209.2308</h4>
<h4>Version: 1.2.2209.2216</h4>
<br /> Release Note:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
1.2.2209.2308
1.2.2209.2216
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.2.2209.2308</version>
<version>1.2.2209.2216</version>
<url>http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/MP.Mon.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>