Merge branch 'develop' into ContapezziAssoluto
This commit is contained in:
+2
-11
@@ -72,17 +72,8 @@
|
||||
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NLog.4.6.8\lib\net40-client\NLog.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ServiceStack.Common, Version=4.0.62.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ServiceStack.Common.4.0.62\lib\net40\ServiceStack.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ServiceStack.Interfaces, Version=4.0.0.0, Culture=neutral, PublicKeyToken=e06fbc6124f57c43, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ServiceStack.Interfaces.4.0.62\lib\portable-wp80+sl5+net40+win8+wpa81+monotouch+monoandroid+xamarin.ios10\ServiceStack.Interfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ServiceStack.Redis, Version=4.0.62.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ServiceStack.Redis.4.0.62\lib\net40\ServiceStack.Redis.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ServiceStack.Text, Version=4.0.62.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ServiceStack.Text.4.0.62\lib\net40\ServiceStack.Text.dll</HintPath>
|
||||
<Reference Include="StackExchange.Redis, Version=1.2.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\StackExchange.Redis.1.2.0\lib\net40\StackExchange.Redis.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
|
||||
+21
-17
@@ -471,21 +471,17 @@ namespace IOB_UT
|
||||
public class ServerMpStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// ID univoco
|
||||
/// IP server
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
public string IP { get; set; }
|
||||
/// <summary>
|
||||
/// Status del server
|
||||
/// </summary>
|
||||
public bool online { get; set; } = false;
|
||||
/// <summary>
|
||||
/// DataOra veto invio chaimate a server
|
||||
/// DataOra ultima comunicazione OUT (con MP Server)
|
||||
/// </summary>
|
||||
public DateTime dtVetoPing { get; set; } = DateTime.Now.AddDays(-1);
|
||||
/// <summary>
|
||||
/// DataOra veto invio chaimate a server
|
||||
/// </summary>
|
||||
public DateTime dtVetoCall { get; set; } = DateTime.Now.AddDays(-1);
|
||||
public DateTime lastUpdate { get; set; } = DateTime.Now.AddDays(-1);
|
||||
}
|
||||
/// <summary>
|
||||
/// Rappresentazione dello stato corrente dell'IOB
|
||||
@@ -495,15 +491,16 @@ namespace IOB_UT
|
||||
/// <summary>
|
||||
/// ID univoco
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
/// ID univoco
|
||||
/// </summary>
|
||||
public string IdxMacchina { get; set; } = "000";
|
||||
public string CodIob { get; set; } = "0";
|
||||
/// <summary>
|
||||
/// Status del SINGOLO IOB
|
||||
/// </summary>
|
||||
public bool online { get; set; } = false;
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Indica se sia correntemente in setup
|
||||
/// </summary>
|
||||
public bool inSetup { get; set; } = false;
|
||||
/// <summary>
|
||||
/// Semaforo IN (IOB-PLC)
|
||||
/// </summary>
|
||||
@@ -511,7 +508,8 @@ namespace IOB_UT
|
||||
/// <summary>
|
||||
/// Semaforo OUT (IOB-MPserver)
|
||||
/// </summary>
|
||||
public Semaforo SemOut { get; set; } = Semaforo.ND;
|
||||
public Semaforo SemOut { get; set; } = Semaforo.ND;
|
||||
#endif
|
||||
/// <summary>
|
||||
/// Contatore IOB
|
||||
/// </summary>
|
||||
@@ -527,7 +525,7 @@ namespace IOB_UT
|
||||
/// <summary>
|
||||
/// Lunghezza coda FluxLog in uscita
|
||||
/// </summary>
|
||||
public int queueFLogLen { get; set; } = 0;
|
||||
public int queueFlLen { get; set; } = 0;
|
||||
/// <summary>
|
||||
/// Lungh coda ALLARMI in uscita
|
||||
/// </summary>
|
||||
@@ -535,7 +533,8 @@ namespace IOB_UT
|
||||
/// <summary>
|
||||
/// Lungh coda MESSAGGI in uscita
|
||||
/// </summary>
|
||||
public int queueMsgLen { get; set; } = 0;
|
||||
public int queueMsLen { get; set; } = 0;
|
||||
#if false
|
||||
/// <summary>
|
||||
/// DataOra ultima comunicazione IN (con PLC)
|
||||
/// </summary>
|
||||
@@ -547,7 +546,12 @@ namespace IOB_UT
|
||||
/// <summary>
|
||||
/// Ultimo stato noto dei parametri in memoria letti da PLC
|
||||
/// </summary>
|
||||
public Dictionary<string, string> currParams { get; set; } = null;
|
||||
public Dictionary<string, string> currParams { get; set; } = null;
|
||||
#endif
|
||||
/// <summary>
|
||||
/// DataOra ultima comunicazione OUT (con MP Server)
|
||||
/// </summary>
|
||||
public DateTime lastUpdate { get; set; } = DateTime.Now.AddDays(-1);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+982
-49
File diff suppressed because it is too large
Load Diff
+35
-22
@@ -47,33 +47,50 @@ namespace IOB_UT
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto gestione persistenza su REDIS (statico)
|
||||
/// Oggetto connessione REDIS
|
||||
/// </summary>
|
||||
public static RedisCache redManager = new RedisCache();
|
||||
/// <summary>
|
||||
/// Variabile in cui viene salvato lo stato del server MP-IO
|
||||
/// </summary>
|
||||
public static bool MPIO_Online
|
||||
{
|
||||
get
|
||||
{
|
||||
return redManager.servStatus.online;
|
||||
}
|
||||
set
|
||||
{
|
||||
var currData = redManager.servStatus;
|
||||
currData.online = value;
|
||||
redManager.servStatus = currData;
|
||||
}
|
||||
}
|
||||
public static RedisIobCache redisMan = new RedisIobCache();
|
||||
/// <summary>
|
||||
/// Indicazione VETO PING a server sino alla data-ora indicata
|
||||
/// </summary>
|
||||
public static DateTime dtVetoPing = DateTime.Now;
|
||||
#if false
|
||||
{
|
||||
get
|
||||
{
|
||||
return redisMan.servStatus.dtVetoPing;
|
||||
}
|
||||
set
|
||||
{
|
||||
var currData = redisMan.servStatus;
|
||||
currData.dtVetoPing = value;
|
||||
redisMan.servStatus = currData;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/// <summary>
|
||||
/// Indicazione VETO invio a server sino alla data-ora indicata
|
||||
/// </summary>
|
||||
public static DateTime dtVetoSend = DateTime.Now;
|
||||
#if false
|
||||
{
|
||||
get
|
||||
{
|
||||
return redisMan.servStatus.dtVetoSend;
|
||||
}
|
||||
set
|
||||
{
|
||||
var currData = redisMan.servStatus;
|
||||
currData.dtVetoSend = value;
|
||||
redisMan.servStatus = currData;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/// <summary>
|
||||
/// Status MP_IO
|
||||
/// </summary>
|
||||
public static bool MPIO_Online = false;
|
||||
|
||||
/// <summary>
|
||||
/// Calcola una pausa con errore casuale x il prossimo send programmato verso SERVER
|
||||
/// </summary>
|
||||
@@ -91,10 +108,6 @@ namespace IOB_UT
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// oggetto static x gestione baseUtils
|
||||
/// </summary>
|
||||
public static baseUtils mgr = new baseUtils();
|
||||
/// <summary>
|
||||
/// Classe logger
|
||||
/// </summary>
|
||||
public static Logger lg = LogManager.GetCurrentClassLogger();
|
||||
|
||||
@@ -6,9 +6,6 @@
|
||||
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="net40-client" />
|
||||
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net40-client" />
|
||||
<package id="NLog" version="4.6.8" targetFramework="net40-client" />
|
||||
<package id="ServiceStack.Common" version="4.0.62" targetFramework="net40-client" />
|
||||
<package id="ServiceStack.Interfaces" version="4.0.62" targetFramework="net40-client" />
|
||||
<package id="ServiceStack.Redis" version="4.0.62" targetFramework="net40-client" />
|
||||
<package id="ServiceStack.Text" version="4.0.62" targetFramework="net40-client" />
|
||||
<package id="SharpZipLib" version="0.86.0" targetFramework="net40-client" />
|
||||
<package id="StackExchange.Redis" version="1.2.0" targetFramework="net40-client" />
|
||||
</packages>
|
||||
@@ -464,6 +464,16 @@ namespace IOB_WIN
|
||||
// aggiorno labels counters...
|
||||
counterIob = $"pz iob {iobObj.contapezzi}";
|
||||
counterMac = $"pz mac {iobObj.lastCountCNC}";
|
||||
// salvo ANCHE in redis...
|
||||
var currIobStatus = iobObj.redisMan.iobStatus;
|
||||
currIobStatus.queueEvLen = evQueueLen;
|
||||
currIobStatus.queueFlLen = flQueueLen;
|
||||
currIobStatus.queueAlLen = alQueueLen;
|
||||
currIobStatus.queueMsLen = msQueueLen;
|
||||
currIobStatus.counterIOB = iobObj.contapezzi;
|
||||
currIobStatus.counterMAC = iobObj.lastCountCNC;
|
||||
currIobStatus.lastUpdate = DateTime.Now;
|
||||
iobObj.redisMan.iobStatus = currIobStatus;
|
||||
}
|
||||
private void gather_Tick(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
+5
-2
@@ -38,13 +38,16 @@
|
||||
<!--gestione coda-->
|
||||
<add key="maxQueueFLog" value="16384" />
|
||||
<!--parametri SIM-->
|
||||
<add key="waitSimPar" value="2" />
|
||||
<add key="waitSimPar" value="20" />
|
||||
<!--gestione REDIS-->
|
||||
<add key="redisConf" value="redis://localhost:6379?db=10" />
|
||||
<add key="RedisConn" value="localhost,abortConnect=false,ssl=false" />
|
||||
<add key="RedisConnAdmin" value="localhost,abortConnect=false,ssl=false" />
|
||||
<add key="redisDb" value="10" />
|
||||
<!--gestione invio dati in blocchi Json-->
|
||||
<add key="minJsonData" value="2" />
|
||||
<add key="maxJsonData" value="100" />
|
||||
<add key="maxJsonDataEv" value="25" />
|
||||
<!--gestione multithread-->
|
||||
<add key="sendDataByThread" value="false" />
|
||||
<!--Modalità DEMO: DemoOUT indica che NON invia davvero al server e DemoIN che simula e NON legge da PLC-->
|
||||
<add key="DemoIn" value="false" />
|
||||
|
||||
@@ -7,12 +7,13 @@ NAME=master
|
||||
;MPIP=192.168.1.7
|
||||
; server VALVITAL
|
||||
;MPIP=192.168.214.4
|
||||
; Server Steamware
|
||||
;MPIP=10.74.82.218
|
||||
; server interclays
|
||||
MPIP=10.0.0.233
|
||||
;MPIP=10.0.0.233
|
||||
; server REMOSA
|
||||
MPIP=192.168.0.110
|
||||
;MPIP=192.168.0.110
|
||||
|
||||
; Server Steamware
|
||||
MPIP=10.74.82.218
|
||||
MPURL=/MP/IO
|
||||
CMDREBO=/IOB/sendRebootGateway?GWIP=
|
||||
CMDIOB2CALL=/IOB/getIob2call?GWIP=
|
||||
|
||||
+17
-13
@@ -203,13 +203,13 @@ namespace IOB_WIN
|
||||
|
||||
// aggiungo referenza obj FANUC
|
||||
FANUC_ref = (FANUC)Runtime.NC;
|
||||
if (isVerboseLog)
|
||||
if (isVerboseLog)
|
||||
{
|
||||
lgInfo("FANUC_ref da CncLib");
|
||||
}
|
||||
|
||||
// disconnetto e connetto...
|
||||
if (isVerboseLog)
|
||||
if (isVerboseLog)
|
||||
{
|
||||
lgInfo("FANUC: tryDisconnect");
|
||||
}
|
||||
@@ -361,7 +361,7 @@ namespace IOB_WIN
|
||||
{
|
||||
memAddressFanuc areaCounter = new memAddressFanuc(memAddr);
|
||||
|
||||
if (isVerboseLog)
|
||||
if (isVerboseLog)
|
||||
{
|
||||
lgInfo("[0] area memoria: {0}.{1}.{2}", areaCounter.mType, areaCounter.mPos, areaCounter.vType);
|
||||
}
|
||||
@@ -936,14 +936,16 @@ namespace IOB_WIN
|
||||
}
|
||||
|
||||
// salvo ultimo conteggio rilevato
|
||||
Int32.TryParse(outputVal.ToString(), out lastCountCNC);
|
||||
int newVal = -1;
|
||||
Int32.TryParse(outputVal.ToString(), out newVal);
|
||||
lastCountCNC = newVal > -1 ? newVal : lastCountCNC;
|
||||
}
|
||||
// altrimenti se legge da area memoria specifica leggo da li... formto tipo STD.D.1604.DW
|
||||
else
|
||||
{
|
||||
memAddressFanuc areaCounter = new memAddressFanuc(memAddr);
|
||||
|
||||
if (isVerboseLog)
|
||||
if (isVerboseLog)
|
||||
{
|
||||
lgInfo("[0] area memoria: {0}.{1}.{2}", areaCounter.mType, areaCounter.mPos, areaCounter.vType);
|
||||
}
|
||||
@@ -966,13 +968,13 @@ namespace IOB_WIN
|
||||
case "DW":
|
||||
uint valDW = 0;
|
||||
FANUC_ref.F_RW_DWord(false, areaCounter.mType, areaCounter.mPos, ref valDW);
|
||||
if (isVerboseLog)
|
||||
if (isVerboseLog)
|
||||
{
|
||||
lgInfo("[1] valDW contapezzi: {0}", valDW);
|
||||
}
|
||||
|
||||
outputVal = valDW;
|
||||
if (isVerboseLog)
|
||||
if (isVerboseLog)
|
||||
{
|
||||
lgInfo("[2] outputVal contapezzi: {0}", outputVal);
|
||||
}
|
||||
@@ -987,8 +989,10 @@ namespace IOB_WIN
|
||||
}
|
||||
|
||||
// salvo...
|
||||
Int32.TryParse(outputVal.ToString(), out lastCountCNC);
|
||||
if (isVerboseLog)
|
||||
int newVal = -1;
|
||||
Int32.TryParse(outputVal.ToString(), out newVal);
|
||||
lastCountCNC = newVal > -1 ? newVal : lastCountCNC;
|
||||
if (isVerboseLog)
|
||||
{
|
||||
lgInfo("[3] lastCountCNC contapezzi: {0}", lastCountCNC);
|
||||
}
|
||||
@@ -1091,7 +1095,7 @@ namespace IOB_WIN
|
||||
{
|
||||
memAddressFanuc areaCounter = new memAddressFanuc(memAddr);
|
||||
|
||||
if (isVerboseLog)
|
||||
if (isVerboseLog)
|
||||
{
|
||||
lgInfo("[0] area memoria: {0}.{1}.{2}", areaCounter.mType, areaCounter.mPos, areaCounter.vType);
|
||||
}
|
||||
@@ -1114,13 +1118,13 @@ namespace IOB_WIN
|
||||
case "DW":
|
||||
uint valDW = 0;
|
||||
FANUC_ref.F_RW_DWord(false, areaCounter.mType, areaCounter.mPos, ref valDW);
|
||||
if (isVerboseLog)
|
||||
if (isVerboseLog)
|
||||
{
|
||||
lgInfo("[1] valDW PAR: {0}", valDW);
|
||||
}
|
||||
|
||||
outputVal = valDW;
|
||||
if (isVerboseLog)
|
||||
if (isVerboseLog)
|
||||
{
|
||||
lgInfo("[2] outputVal PAR: {0}", outputVal);
|
||||
}
|
||||
@@ -1136,7 +1140,7 @@ namespace IOB_WIN
|
||||
|
||||
// salvo...
|
||||
answ = outputVal.ToString();
|
||||
if (isVerboseLog)
|
||||
if (isVerboseLog)
|
||||
{
|
||||
lgInfo("[3] PAR letto: {0} | {1}", varName, answ);
|
||||
}
|
||||
|
||||
+102
-89
@@ -46,7 +46,44 @@ namespace IOB_WIN
|
||||
}
|
||||
|
||||
public class IobGeneric
|
||||
{
|
||||
{
|
||||
#region variabili serializzate in REDIS
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto connessione REDIS
|
||||
/// </summary>
|
||||
public RedisIobCache redisMan;
|
||||
|
||||
/// <summary>
|
||||
/// stato Online/Offline della IOB
|
||||
/// </summary>
|
||||
public bool IobOnline
|
||||
{
|
||||
get
|
||||
{
|
||||
return redisMan.IOB_Online;
|
||||
}
|
||||
set
|
||||
{
|
||||
redisMan.IOB_Online = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// stato Online/Offline del server MP IO (su REDIS)
|
||||
/// </summary>
|
||||
public bool MPOnline
|
||||
{
|
||||
get
|
||||
{
|
||||
return redisMan.MPIO_Online;
|
||||
}
|
||||
set
|
||||
{
|
||||
redisMan.MPIO_Online = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region variabili ed oggetti base
|
||||
|
||||
/// <summary>
|
||||
@@ -57,10 +94,6 @@ namespace IOB_WIN
|
||||
/// TImeout x ping al server
|
||||
/// </summary>
|
||||
protected int pingServerMsTimeout = utils.CRI("pingMsTimeout");
|
||||
/// <summary>
|
||||
/// Indica impianto IN SETUP (fino a quando SMETTE di esserlo...)
|
||||
/// </summary>
|
||||
protected bool inSetup = false;
|
||||
/// <summary>
|
||||
/// Log verboso da configurazione (SOLO CHAIVE "verbose"...
|
||||
/// </summary>
|
||||
@@ -68,33 +101,51 @@ namespace IOB_WIN
|
||||
/// <summary>
|
||||
/// Coda massima ammessa per FLog (se <=0 disattivata...)
|
||||
/// </summary>
|
||||
protected int maxQueueFLog { get; set; } = utils.CRI("maxQueueFLog");
|
||||
protected int maxQueueFLog { get; set; } = utils.CRI("maxQueueFLog");
|
||||
/// <summary>
|
||||
/// Indica impianto IN SETUP (fino a quando SMETTE di esserlo...)
|
||||
/// </summary>
|
||||
protected bool inSetup = false;
|
||||
/// <summary>
|
||||
/// Indicazione VETO PING a server sino alla data-ora indicata
|
||||
/// </summary>
|
||||
public DateTime dtVetoPing
|
||||
{
|
||||
get
|
||||
{
|
||||
return utils.dtVetoPing;
|
||||
}
|
||||
set
|
||||
{
|
||||
utils.dtVetoPing = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Indicazione VETO invio a server sino alla data-ora indicata
|
||||
/// </summary>
|
||||
public static DateTime dtVetoPing
|
||||
public DateTime dtVetoSend
|
||||
{
|
||||
get
|
||||
{
|
||||
return utils.dtVetoPing;
|
||||
{
|
||||
return utils.dtVetoSend;
|
||||
}
|
||||
set
|
||||
{
|
||||
utils.dtVetoPing = value;
|
||||
{
|
||||
utils.dtVetoSend = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Indicazione VETO check status IOB x evitare loop troppo stretti...
|
||||
/// </summary>
|
||||
public DateTime dtVetoCheckIOB = DateTime.Now;
|
||||
public DateTime dtVetoCheckIOB = DateTime.Now.AddDays(-1);
|
||||
/// <summary>
|
||||
/// Contapezzi attuale
|
||||
/// </summary>
|
||||
public Int32 contapezzi;
|
||||
public Int32 contapezzi = 0;
|
||||
/// <summary>
|
||||
/// Ultima lettura variabile contapezzi da CNC
|
||||
/// </summary>
|
||||
public Int32 lastCountCNC;
|
||||
public Int32 lastCountCNC = 0;
|
||||
/// <summary>
|
||||
/// ODL attualmente sulla macchina
|
||||
/// </summary>
|
||||
@@ -439,24 +490,7 @@ namespace IOB_WIN
|
||||
/// Conteggio ATTUALE ore macchina IN LAVORO
|
||||
/// </summary>
|
||||
public double contOreMaccLav;
|
||||
/// <summary>
|
||||
/// stato Online/Offline della IOB
|
||||
/// </summary>
|
||||
public bool IobOnline;
|
||||
/// <summary>
|
||||
/// stato Online/Offline del server MP IO (su utils condiviso)
|
||||
/// </summary>
|
||||
public bool MPOnline
|
||||
{
|
||||
get
|
||||
{
|
||||
return utils.MPIO_Online;
|
||||
}
|
||||
set
|
||||
{
|
||||
utils.MPIO_Online = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Data/ora ultima volta che IOB è stato dichairato online
|
||||
/// </summary>
|
||||
@@ -472,10 +506,11 @@ namespace IOB_WIN
|
||||
/// <summary>
|
||||
/// Dizionario di VARIABILI da trattare come eventi (da inviare quando cambiano oppure a scadenza periodo...)
|
||||
/// </summary>
|
||||
protected Dictionary<string, EVData> VarArray = new Dictionary<string, EVData>();
|
||||
|
||||
protected Dictionary<string, EVData> VarArray = new Dictionary<string, EVData>();
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Form chiamante
|
||||
/// </summary>
|
||||
@@ -519,6 +554,9 @@ namespace IOB_WIN
|
||||
/// <param name="adpConf"></param>
|
||||
public IobGeneric(AdapterForm caller, IobConfiguration IOBConf)
|
||||
{
|
||||
// init oggetto redis...
|
||||
redisMan = new RedisIobCache(IOBConf.serverData.MPIP, IOBConf.codIOB);
|
||||
|
||||
// salvo il form chiamante
|
||||
parentForm = caller;
|
||||
// configurazione...
|
||||
@@ -1003,8 +1041,10 @@ namespace IOB_WIN
|
||||
{
|
||||
// se "-1" resto a ultimo...
|
||||
if (currServerCount != "-1")
|
||||
{
|
||||
int.TryParse(currServerCount, out contapezzi);
|
||||
{
|
||||
int newVal = -1;
|
||||
Int32.TryParse(currServerCount, out newVal);
|
||||
contapezzi = newVal > -1 ? newVal : contapezzi;
|
||||
lgInfo("Ricevuta conferma da server di {0} pezzi registrati per ODL", currServerCount);
|
||||
}
|
||||
else
|
||||
@@ -1307,8 +1347,17 @@ namespace IOB_WIN
|
||||
// verifico se risponde il server...
|
||||
if (checkServerAlive)
|
||||
{
|
||||
// verifico SE posso inviare dati
|
||||
if (checkIobEnabled)
|
||||
bool iobOk = false;
|
||||
if (utils.CRB("sendDataByThread"))
|
||||
{
|
||||
Task taskCheck = TaskEx.Run(() => iobOk = checkIobEnabled);
|
||||
}
|
||||
else
|
||||
{
|
||||
iobOk = checkIobEnabled;
|
||||
}
|
||||
// verifico SE posso inviare dati
|
||||
if (iobOk)
|
||||
{
|
||||
currDispData.semOut = Semaforo.SV;
|
||||
// verificare come gestire il task secondario senza interferenza (chiamate update su FORM da thread secondari danno errori)
|
||||
@@ -2838,12 +2887,12 @@ namespace IOB_WIN
|
||||
answ = (callResp == "OK");
|
||||
// attesa casuale se necessario
|
||||
var rand = new Random();
|
||||
// primi 3 test
|
||||
int maxTry = 3;
|
||||
// primi 2 test
|
||||
int maxTry = 2;
|
||||
while (maxTry > 0 && !answ)
|
||||
{
|
||||
Thread.Sleep(rand.Next(150, 500));
|
||||
callResp = callUrl(urlIobEnabled, false);
|
||||
Thread.Sleep(rand.Next(250, 500));
|
||||
callResp = callUrl(urlIobEnabled, true);
|
||||
answ = (callResp == "OK");
|
||||
maxTry--;
|
||||
}
|
||||
@@ -2851,32 +2900,27 @@ namespace IOB_WIN
|
||||
if (!answ)
|
||||
{
|
||||
resetwebClients();
|
||||
Thread.Sleep(rand.Next(500, 1000));
|
||||
Thread.Sleep(rand.Next(250, 1000));
|
||||
callResp = callUrl(urlIobEnabled, false);
|
||||
answ = (callResp == "OK");
|
||||
}
|
||||
// altri 3
|
||||
maxTry = 3;
|
||||
}
|
||||
// altri 2
|
||||
maxTry = 2;
|
||||
while (maxTry > 0 && !answ)
|
||||
{
|
||||
Thread.Sleep(rand.Next(150, 500));
|
||||
Thread.Sleep(rand.Next(250, 500));
|
||||
callResp = callUrl(urlIobEnabled, false);
|
||||
answ = (callResp == "OK");
|
||||
maxTry--;
|
||||
}
|
||||
// salvo status...
|
||||
}
|
||||
// salvo status...
|
||||
IobOnline = answ;
|
||||
// se offline imposto veto check a 5 x tempo reinvio...
|
||||
if (!answ)
|
||||
// se online imposto veto check a 5 x tempo reinvio...
|
||||
if (answ)
|
||||
{
|
||||
dtVetoCheckIOB = DateTime.Now.AddMilliseconds(baseUtils.nextPauseSendMSec * 10);
|
||||
}
|
||||
else
|
||||
{
|
||||
// non controllo x meno...
|
||||
dtVetoCheckIOB = DateTime.Now.AddMilliseconds(baseUtils.nextPauseSendMSec * 5);
|
||||
lastIobOnline = DateTime.Now;
|
||||
}
|
||||
}
|
||||
dtVetoCheckIOB = DateTime.Now.AddMilliseconds(baseUtils.nextPauseSendMSec * 5);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
@@ -4265,15 +4309,6 @@ namespace IOB_WIN
|
||||
accodaSignaInlData(newString);
|
||||
#endif
|
||||
}
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Mostra cosa ha/avrebbe inviato
|
||||
/// </summary>
|
||||
public void displayOutData()
|
||||
{
|
||||
accodaUrlData(lastUrl);
|
||||
}
|
||||
#endif
|
||||
/// <summary>
|
||||
/// Mostra cosa ha/avrebbe inviato
|
||||
/// </summary>
|
||||
@@ -4283,28 +4318,6 @@ namespace IOB_WIN
|
||||
// mostro update...
|
||||
accodaOtherData(newData);
|
||||
}
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Accoda (visualizzando in cima allo stack) la nuova stringa di output per area OTHER DATA
|
||||
/// </summary>
|
||||
/// <param name="newLine"></param>
|
||||
public void accodaSignaInlData(string newLine)
|
||||
{
|
||||
// inserisco in cima allo stack, trimmo e aggiorno display
|
||||
parentForm.dataMonitor_1 = limitLine2show(string.Format("{0}{1}{2}", newLine, Environment.NewLine, parentForm.dataMonitor_1));
|
||||
}
|
||||
#endif
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Accoda (visualizzando in cima allo stack) la nuova stringa di output per area OTHER DATA
|
||||
/// </summary>
|
||||
/// <param name="newLine"></param>
|
||||
public void accodaUrlData(string newLine)
|
||||
{
|
||||
// inserisco in cima allo stack, trimmo e aggiorno display
|
||||
parentForm.dataMonitor_2 = limitLine2show(string.Format("{0}{1}{2}", newLine, Environment.NewLine, parentForm.dataMonitor_2));
|
||||
}
|
||||
#endif
|
||||
/// <summary>
|
||||
/// Accoda (visualizzando in cima allo stack) la nuova stringa di output per area OTHER DATA
|
||||
/// </summary>
|
||||
|
||||
+3
-1
@@ -912,7 +912,9 @@ namespace IOB_WIN
|
||||
// se ho un contapezzi... processo...
|
||||
if (!string.IsNullOrEmpty(currPzCount))
|
||||
{
|
||||
int.TryParse(currPzCount, out lastCountCNC);
|
||||
int newVal = -1;
|
||||
Int32.TryParse(currPzCount, out newVal);
|
||||
lastCountCNC = newVal > -1 ? newVal : lastCountCNC;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1106,7 +1106,9 @@ namespace IOB_WIN
|
||||
break;
|
||||
}
|
||||
// salvo...
|
||||
Int32.TryParse(outputVal.ToString(), out lastCountCNC);
|
||||
int newVal = -1;
|
||||
Int32.TryParse(outputVal.ToString(), out newVal);
|
||||
lastCountCNC = newVal > -1 ? newVal : lastCountCNC;
|
||||
if (isVerboseLog)
|
||||
{
|
||||
lgInfo("[2] outputVal contapezzi: {0}", outputVal);
|
||||
|
||||
+18
-4
@@ -22,6 +22,10 @@ namespace IOB_WIN
|
||||
{
|
||||
#region variabili globali, utils ed helpers
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto connessioen REDIS
|
||||
/// </summary>
|
||||
public RedisIobCache redisMan;
|
||||
/// <summary>
|
||||
/// Parametri (opzionali) di avvio
|
||||
/// </summary>
|
||||
@@ -362,6 +366,7 @@ namespace IOB_WIN
|
||||
|
||||
protected void myInit()
|
||||
{
|
||||
|
||||
DateTime adesso = DateTime.Now;
|
||||
resetProgBar = 0;
|
||||
formStartTime = adesso;
|
||||
@@ -541,6 +546,15 @@ namespace IOB_WIN
|
||||
IOB2START.Add("NONE");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// init redis...
|
||||
string firstIob = "00";
|
||||
if (IOB2START.Count > 0)
|
||||
{
|
||||
firstIob = IOB2START[0];
|
||||
}
|
||||
redisMan = new RedisIobCache(MPIP, firstIob);
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -624,7 +638,7 @@ namespace IOB_WIN
|
||||
lgError($"Errore in checkServerAlive:{Environment.NewLine}{exc}");
|
||||
}
|
||||
// verifico SE è variato stato online/offline...
|
||||
if (utils.MPIO_Online != answ)
|
||||
if (redisMan.MPIO_Online != answ)
|
||||
{
|
||||
// se ORA sono online riporto...
|
||||
if (answ)
|
||||
@@ -637,7 +651,7 @@ namespace IOB_WIN
|
||||
lgInfo("SERVER OFFLINE in MainForm:testServer");
|
||||
}
|
||||
// salvo nuovo status...
|
||||
utils.MPIO_Online = answ;
|
||||
redisMan.MPIO_Online = answ;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -648,7 +662,7 @@ namespace IOB_WIN
|
||||
else
|
||||
{
|
||||
lgInfo($"SERVER NOT RESPONDING (PING at {MPIP})");
|
||||
utils.MPIO_Online = false;
|
||||
redisMan.MPIO_Online = false;
|
||||
updateComStats(0, 0, false);
|
||||
// imposto veto a 10 volte reinvio dati standard...
|
||||
utils.dtVetoPing = DateTime.Now.AddMilliseconds(baseUtils.nextPauseSendMSec * 10);
|
||||
@@ -658,7 +672,7 @@ namespace IOB_WIN
|
||||
else
|
||||
{
|
||||
// altrimenti passo ultimo valore noto...
|
||||
answ = utils.MPIO_Online;
|
||||
answ = redisMan.MPIO_Online;
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
|
||||
Vendored
+1
-1
@@ -16,7 +16,7 @@ pipeline {
|
||||
|
||||
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
|
||||
script {
|
||||
withEnv(['NEXT_BUILD_NUMBER=638']) {
|
||||
withEnv(['NEXT_BUILD_NUMBER=641']) {
|
||||
// env.versionNumber = VersionNumber(versionNumberString : '3.0.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true)
|
||||
env.versionNumber = VersionNumber(versionNumberString : '3.0.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
|
||||
env.APP_NAME = 'MAPO-IOB-WIN'
|
||||
|
||||
Reference in New Issue
Block a user