Ok modifica modalità invio pezzi e eventi

This commit is contained in:
Samuele E. Locatelli
2019-12-20 11:28:03 +01:00
parent b9d1d372a7
commit 389092cbb8
3 changed files with 36 additions and 11 deletions
+29 -8
View File
@@ -13,6 +13,7 @@ using System.Linq;
using System.Net;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
@@ -1296,6 +1297,7 @@ namespace IOB_WIN
// verifico SE posso inviare dati
if (checkIobEnabled)
{
currDispData.semOut = Semaforo.SV;
// verificare come gestire il task secondario senza interferenza (chiamate update su FORM da thread secondari danno errori)
if (utils.CRB("sendDataByThread"))
{
@@ -1306,9 +1308,16 @@ namespace IOB_WIN
else
{
// gestione queue SignalIN (invio, display)
svuotaCodaSignIN();
svuotaCodaSignIN();
currDispData.counter = contapezzi;
raiseRefresh(currDispData);
// provo a svuotare coda contapezzi
svuotaCodaContapezzi();
currDispData.counter = contapezzi;
raiseRefresh(currDispData);
// gestione queue FluxLog (invio, display)
svuotaCodaFLog();
svuotaCodaFLog();
raiseRefresh(currDispData);
}
}
else
@@ -1333,11 +1342,27 @@ namespace IOB_WIN
}
catch (Exception exc)
{
lgError($"Errore in fase trySendValues{Environment.NewLine}{exc}");
currDispData.semOut = Semaforo.SR;
}
raiseRefresh(currDispData);
}
}
private void svuotaCodaContapezzi()
{
pzCntReload(true);
// se ho contapezzi OLTRE limite...
while (lastCountCNC > contapezzi + maxSendPzCountBlock)
{
// provo invio
trySendPzCountBlock();
// aspetto x dare tempo calcolo
Thread.Sleep(300);
// rileggo
pzCntReload(true);
}
}
/// <summary>
/// Effettua ciclo controllo richieste server
/// </summary>
@@ -3182,10 +3207,6 @@ namespace IOB_WIN
{
// rileggo qta da server...
pzCntReload(true);
#if false
// incremento il contapezzi della quantità restituita e confermata
contapezzi += qtyAdded;
#endif
lgInfo($"Inviato incremento contapezzi: send {numIncr} | resp {qtyAdded}");
// invio conferma contapezzi..
string retVal = utils.callUrl($"{urlSetPzCount}{contapezzi}");
+6 -2
View File
@@ -285,7 +285,6 @@ namespace IOB_WIN
if ((lastCountCNC - contapezzi) > minSendPzCountBlock)
{
trySendPzCountBlock();
lgInfo($"Valori contatori: contapezzi macchina lastCountCNC: {lastCountCNC} | contapezzi: {contapezzi}");
sigPzCount = false;
}
// altrimenti invio 1 segnale
@@ -298,13 +297,18 @@ namespace IOB_WIN
B_input += (1 << 2);
sigPzCount = true;
contapezzi++;
// invio conferma contapezzi..
string retVal = utils.callUrl($"{urlSetPzCount}{contapezzi}");
}
else
{
// rileggo qta da server...
pzCntReload(true);
string retVal = utils.callUrl($"{urlSetPzCount}{contapezzi}");
sigPzCount = false;
}
}
lgInfo($"Valori contatori: contapezzi macchina lastCountCNC: {lastCountCNC} | contapezzi: {contapezzi}");
}
}
}
Vendored
+1 -1
View File
@@ -16,7 +16,7 @@ pipeline {
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
script {
withEnv(['NEXT_BUILD_NUMBER=610']) {
withEnv(['NEXT_BUILD_NUMBER=611']) {
// env.versionNumber = VersionNumber(versionNumberString : '2.7.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true)
env.versionNumber = VersionNumber(versionNumberString : '2.7.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
env.APP_NAME = 'MAPO-IOB-WIN'