Merge branch 'develop'

This commit is contained in:
Samuele E. Locatelli
2020-10-21 17:23:18 +02:00
3 changed files with 51 additions and 18 deletions
+7 -6
View File
@@ -8,10 +8,9 @@ PING_MS_TIMEOUT=500
VENDOR=PlasticMetal
MODEL=MPW280SP
[CNC]
;IP=192.168.1.55
[CNC]
IP=10.74.82.253
;IP=10.82.74.1
;IP=192.168.1.151
[SERVER]
MPIP=http://10.74.82.218
@@ -58,9 +57,11 @@ PZCOUNT_MODE=NONE
DISABLE_PZCOUNT=TRUE
ENABLE_DYN_DATA=TRUE
FORCE_DYN_DATA=TRUE
;ENABLE_SEND_PZC_BLOCK=TRUE
;MIN_SEND_PZC_BLOCK=0
;MAX_SEND_PZC_BLOCK=100
ENABLE_SEND_PZC_BLOCK=TRUE
MIN_SEND_PZC_BLOCK=0
MAX_SEND_PZC_BLOCK=1200
MAX_DELAY_SEC=30
CACHE_MULT=6
; CONF variabili da recuperare in WebPage (stato macchina, contatori, variabili, ...)
LUT_CONF=EM63.json
timerIntMs=10
+43 -11
View File
@@ -27,11 +27,21 @@ namespace IOB_WIN
/// </summary>
protected string appPath = Directory.GetCurrentDirectory();
/// <summary>
/// Moltiplicatore durata cache
/// </summary>
protected int cacheMult = 4;
/// <summary>
/// Oggetti decodificati da pagina
/// </summary>
protected Eurom63.ProtoConf confE63;
/// <summary>
/// Valore currStatus validato (per gestione "disconnessioni")
/// </summary>
protected CachedInt Last_B_Input = new CachedInt() { Value = 0 };
/// <summary>
/// Valore currStatus validato (per gestione "disconnessioni")
/// </summary>
@@ -40,7 +50,7 @@ namespace IOB_WIN
/// <summary>
/// Massimo delay lettura dati prima di considerarli scaduti (30 sec, ma x test 1 gg)
/// </summary>
protected int maxDelaySec = 60;
protected int maxDelaySec = 30;
#endregion Protected Fields
@@ -55,6 +65,12 @@ namespace IOB_WIN
{
lgInfo("INIT IobFileEurom63");
appPath = Path.GetDirectoryName(Application.ExecutablePath);
string MAX_DELAY_SEC = getOptPar("MAX_DELAY_SEC");
string CACHE_MULT = getOptPar("CACHE_MULT");
int.TryParse(MAX_DELAY_SEC, out maxDelaySec);
int.TryParse(CACHE_MULT, out cacheMult);
#if DEBUG
maxDelaySec = 60 * 60 * 24;
#endif
@@ -79,8 +95,10 @@ namespace IOB_WIN
{
// elimino TUTTE le risposte...
cleanupResp(currSession.SessionName);
// imposto livello...
actLevel = Eurom63.ComLevel.HasInfo;
// imposto livellotornando indietro di 1 alla volta... senza andare in negativoS
actLevel = actLevel - 1;
actLevel = actLevel > 0 ? actLevel : 0;
lgInfo($"Sessione inattiva, {actLevel + 1} --> {actLevel}");
}
}
}
@@ -691,10 +709,9 @@ namespace IOB_WIN
{
currDispData.semIn = Semaforo.SV;
}
readDone = true;
// salvo in cache!
Last_CurrStatus.Value = currStatus;
Last_CurrStatus.ValidUntil = DateTime.Now.AddSeconds(15);
Last_CurrStatus.ValidUntil = DateTime.Now.AddSeconds(maxDelaySec * cacheMult);
// ora verifico SE siano validi anche le dataora dei valori letti (< 20 sec ritardo da ora...)
string data = statusData[0].Trim();
@@ -713,10 +730,11 @@ namespace IOB_WIN
// elimino file RSP...
cleanupResp(sessStatus.SessionName);
}
readDone = true;
}
else
{
lgError($"decodifica StatusData in errore: trovati {statusData.Length} campi in {rawLines}");
lgError($"Decodifica StatusData in errore: trovati {statusData.Length} campi in {rawLines}");
}
}
else
@@ -728,12 +746,15 @@ namespace IOB_WIN
}
else
{
actLevel = Eurom63.ComLevel.ChannelOk;
// se valido RILEGGO ultimo curr status
if (Last_CurrStatus.ValidUntil > adesso)
{
currStatus = Last_CurrStatus.Value;
}
else
{
actLevel = Eurom63.ComLevel.ChannelOk;
}
}
}
@@ -764,8 +785,18 @@ namespace IOB_WIN
{
B_input += (1 << 3);
}
// salvo B_Input in cache!
Last_B_Input.Value = B_input;
Last_B_Input.ValidUntil = DateTime.Now.AddSeconds(maxDelaySec * cacheMult);
}
// se disponibile riporto B_Input precedente
else
{
if (Last_B_Input.ValidUntil > adesso)
{
B_input = Last_B_Input.Value;
}
}
// riporto bitmap...
reportRawInput(ref currDispData);
}
@@ -776,12 +807,13 @@ namespace IOB_WIN
currDispData.semIn = Semaforo.SR;
}
// ultimo controllo...
if (!readDone)
{
// se valido RILEGGO ultimo curr status
if (Last_CurrStatus.ValidUntil > adesso)
// se valido RILEGGO ultimo B_INPUT
if (Last_B_Input.ValidUntil > adesso)
{
currStatus = Last_CurrStatus.Value;
B_input = Last_B_Input.Value;
}
}
}
Vendored
+1 -1
View File
@@ -9,7 +9,7 @@ pipeline {
steps {
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
script {
withEnv(['NEXT_BUILD_NUMBER=733']) {
withEnv(['NEXT_BUILD_NUMBER=734']) {
// env.versionNumber = VersionNumber(versionNumberString : '3.3.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true)
env.versionNumber = VersionNumber(versionNumberString : '3.3.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
env.APP_NAME = 'MAPO-IOB-WIN'