diff --git a/IOB-UT/baseUtils.cs b/IOB-UT/baseUtils.cs
index 9cdd0859..097de556 100644
--- a/IOB-UT/baseUtils.cs
+++ b/IOB-UT/baseUtils.cs
@@ -46,6 +46,14 @@ namespace IOB_UT
public class baseUtils
{
+ ///
+ /// Variabile in cui viene salvato lo stato del server MP-IO
+ ///
+ public static bool MPIO_Online = false;
+ ///
+ /// Indicazione VETO PING a server sino alla data-ora indicata
+ ///
+ public static DateTime dtVetoPing = DateTime.Now;
///
/// Indicazione VETO invio a server sino alla data-ora indicata
///
diff --git a/IOB-WIN/AdapterForm.cs b/IOB-WIN/AdapterForm.cs
index 011fae7c..bd35b0b5 100644
--- a/IOB-WIN/AdapterForm.cs
+++ b/IOB-WIN/AdapterForm.cs
@@ -55,11 +55,11 @@ namespace IOB_WIN
///
/// Oggetto x gestione dell'adapter GENERICO (x poter usare metodi di ognuno...)
///
- IobGeneric iobObj;
+ public IobGeneric iobObj;
///
/// configurazione caricata
///
- IobConfiguration IOBConf;
+ public IobConfiguration IOBConf;
///
/// tipo di adapter prescelto...
///
diff --git a/IOB-WIN/DATA/CONF/MAIN.ini b/IOB-WIN/DATA/CONF/MAIN.ini
index 5327409f..58d9bc02 100644
--- a/IOB-WIN/DATA/CONF/MAIN.ini
+++ b/IOB-WIN/DATA/CONF/MAIN.ini
@@ -9,7 +9,6 @@ NAME=master
;MPIP=192.168.214.4
; Server Steamware
MPIP=10.74.82.218
-
MPURL=/MP/IO
CMDREBO=/IOB/sendRebootGateway?GWIP=
CMDIOB2CALL=/IOB/getIob2call?GWIP=
diff --git a/IOB-WIN/IobGeneric.cs b/IOB-WIN/IobGeneric.cs
index 937bd013..4bcc5872 100644
--- a/IOB-WIN/IobGeneric.cs
+++ b/IOB-WIN/IobGeneric.cs
@@ -34,7 +34,17 @@ namespace IOB_WIN
///
/// Indicazione VETO invio a server sino alla data-ora indicata
///
- public static DateTime dtVetoPing = DateTime.Now;
+ public static DateTime dtVetoPing
+ {
+ get
+ {
+ return utils.dtVetoPing;
+ }
+ set
+ {
+ utils.dtVetoPing = value;
+ }
+ }
///
/// Indicazione VETO check status IOB x evitare loop troppo stretti...
///
@@ -350,9 +360,19 @@ namespace IOB_WIN
///
public bool IobOnline;
///
- /// stato Online/Offline del server MP IO
+ /// stato Online/Offline del server MP IO (su utils condiviso)
///
- public bool MPOnline;
+ public bool MPOnline
+ {
+ get
+ {
+ return utils.MPIO_Online;
+ }
+ set
+ {
+ utils.MPIO_Online = value;
+ }
+ }
///
/// Dizionario di VC da trattare come TimeSeries (con conf decodificata + processing successivo...)
///
@@ -2143,8 +2163,7 @@ namespace IOB_WIN
{
lgInfo("SERVER ONLINE");
parentForm.commSrvActive = 1;
- dtVetoPing = DateTime.Now.AddMinutes(-5);
- utils.dtVetoSend = DateTime.Now.AddMinutes(-5);
+ dtVetoPing = DateTime.Now.AddMilliseconds(baseUtils.nextPauseSendMSec);
}
else
{
@@ -2154,6 +2173,11 @@ namespace IOB_WIN
// salvo nuovo status...
MPOnline = answ;
}
+ else
+ {
+ // allungo periodo controllo...
+ dtVetoPing = DateTime.Now.AddMilliseconds(baseUtils.nextPauseSendMSec * 2);
+ }
}
else
{
@@ -2193,7 +2217,8 @@ namespace IOB_WIN
try
{
// chiamo URL, se restituisce "OK" è enabled!
- answ = (callUrl(urlIobEnabled, true) == "OK");
+ string callResp = callUrl(urlIobEnabled, false);
+ answ = (callResp == "OK");
// salvo status...
IobOnline = answ;
// se offline imposto veto check a 5 x tempo reinvio...
@@ -2201,6 +2226,11 @@ namespace IOB_WIN
{
dtVetoCheckIOB = DateTime.Now.AddMilliseconds(baseUtils.nextPauseSendMSec * 5);
}
+ else
+ {
+ // non controllo x meno...
+ dtVetoCheckIOB = DateTime.Now.AddMilliseconds(baseUtils.nextPauseSendMSec * 1);
+ }
}
catch
{ }
diff --git a/IOB-WIN/MainForm.cs b/IOB-WIN/MainForm.cs
index 3a37439f..4cc7de20 100644
--- a/IOB-WIN/MainForm.cs
+++ b/IOB-WIN/MainForm.cs
@@ -78,11 +78,12 @@ namespace IOB_WIN
/// Mostra update delle statistiche di comunicazione (num plc connessi, indirizzo server) con colore ad indicare anomalie...
///
///
+ ///
///
- public void updateComStats(int numPLC, bool serverOk)
+ public void updateComStats(int numPLC, int numAttivi, bool serverOk)
{
// testo
- lblComStats.Text = string.Format("{0} PLC --> {1} (MP/IO)", numPLC, MPIP);
+ lblComStats.Text = $"{numAttivi}/{numPLC} PLC --> {MPIP} (MP/IO)";
// colore secondo valori... server !="ND" è ok, PLC > 0 è OK
int score = 0;
if (serverOk)
@@ -345,7 +346,7 @@ namespace IOB_WIN
IPAddress.TryParse(ipAdrr, out address);
try
{
- reply = pingSender.Send(address, 100);
+ reply = pingSender.Send(address, 200);
answ = reply.Status;
}
catch (Exception exc)
@@ -424,33 +425,99 @@ namespace IOB_WIN
lastComCheck = DateTime.Now;
// conta quanti child form di adapter verso PLC siano aperti !!!FARE!!! chiedere con un metodo che siano ATTIVI e contare quello...
int numPLC = this.MdiChildren.Count