Merge branch 'develop' into IobMan

This commit is contained in:
Samuele E. Locatelli
2020-02-28 10:45:13 +01:00
8 changed files with 31 additions and 72 deletions
+2 -53
View File
@@ -589,40 +589,6 @@ namespace IOB_WIN
currDispData.semIn = Semaforo.SR;
}
}
#if false
/// <summary>
/// Riporta alla parentForm i valori di RawInput rilevati
/// </summary>
public override void reportRawInput()
{
try
{
newDisplayData currDispData = new newDisplayData();
StringBuilder sb = new StringBuilder($"----------- Read Data Memory -----------");
int i = 0;
foreach (var item in MemBlockR)
{
sb.Append($"R{i:00} --> {baseUtils.binaryForm(item)} = {(short)item}");
i++;
}
foreach (var item in MemBlockX)
{
sb.Append($"X{i:00} --> {baseUtils.binaryForm(item)} = {(short)item}");
i++;
}
foreach (var item in MemBlockY)
{
sb.Append($"Y{i:00} --> {baseUtils.binaryForm(item)} = {(short)item}");
i++;
}
sb.Append("-------------------------------");
currDispData.currBitmap = sb.ToString();
parentForm.updateFormDisplay(currDispData);
}
catch
{ }
}
#endif
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
@@ -706,15 +672,14 @@ namespace IOB_WIN
// verifico se variato contapezzi...
if (lastCountCNC > contapezzi)
{
// salvo nuovo contapezzi (incremento di 1...)
// salvo nuovo contapezzi (incremento di 1...) + richiesta refresh conteggio
contapezzi++;
needRefreshPzCount = true;
// salvo in semaforo!
B_input += 1 << 2;
// registro contapezzi
lgInfo(string.Format("Contapezzi FANUC: {0} | Contapezzi interno {1}", lastCountCNC, contapezzi));
}
// invio a server contapezzi (aggiornato)
string retVal = utils.callUrl(urlSetPzCount + contapezzi.ToString());
// verifica se tutto OK
@@ -793,23 +758,7 @@ namespace IOB_WIN
B_input += 1 << i;
}
}
#if false
// da rivedere x gestione contapezzi a bit...
// verifico se si tratta di un segnale contapezzo... nel qual caso conteggio ed invio...
if (currIobConf.optPar["PZCOUNT_MODE"].StartsWith("BIT"))
{
// salvo nuovo contapezzi (incremento di 1...)
contapezzi++;
// invio a server contapezzi (aggiornato)
utils.callUrl(urlSetPzCount + contapezzi.ToString());
lgInfo("Aggiornato contapezzi: {0}", contapezzi);
// resetto timer...
lastPzCountSend = DateTime.Now;
}
#endif
}
}
}
}
+16 -13
View File
@@ -107,6 +107,10 @@ namespace IOB_WIN
/// Indica impianto IN SETUP (fino a quando SMETTE di esserlo...)
/// </summary>
protected bool inSetup = false;
/// <summary>
/// Variabile booleana che indica se sia necessario fare refresh del contapezzi
/// </summary>
public bool needRefreshPzCount = true;
/// <summary>
/// Indicazione VETO PING a server sino alla data-ora indicata
/// </summary>
@@ -514,7 +518,6 @@ namespace IOB_WIN
protected Dictionary<string, EVData> VarArray = new Dictionary<string, EVData>();
#endregion
/// <summary>
/// Form chiamante
@@ -1215,10 +1218,6 @@ namespace IOB_WIN
catch (Exception exc)
{
string errore = $"Adapter NOT STARTED!!!{Environment.NewLine}{exc}";
// !!!FARE !!!FIXME aggiungere metodo x status update...
#if false
parentForm.displayTaskAndLog(errore);
#endif
adpCommAct = false;
adpStartRun = DateTime.Now;
currDispData.newLiveLogData = errore;
@@ -1259,9 +1258,9 @@ namespace IOB_WIN
{
if (utils.CRB("enableContapezzi"))
{
// rilettura contapezzi da server... SE ABILITATA
lgInfo("Ciclo VLF: pzCntReload(false)");
pzCntReload(false);
// rilettura contapezzi da server...
lgInfo("Ciclo VLF: pzCntReload(true)");
pzCntReload(true);
// refresh associazione Macchina - IOB
sendM2IOB();
}
@@ -1428,7 +1427,7 @@ namespace IOB_WIN
// se ho contapezzi OLTRE limite...
while ((MPOnline) && (lastCountCNC > contapezzi + minSendPzCountBlock))
{
lgInfo($"Inizio svuotaCodaContapezzi --> lastCountCNC: {lastCountCNC} | contapezzi: {contapezzi}");
lgInfo($"Ciclo svuotaCodaContapezzi --> lastCountCNC: {lastCountCNC} | contapezzi: {contapezzi}");
pzCntReload(true);
// provo invio
trySendPzCountBlock();
@@ -1448,7 +1447,7 @@ namespace IOB_WIN
return;
}
// aspetto x dare tempo calcolo
Thread.Sleep(300);
Thread.Sleep(400);
}
}
@@ -3269,6 +3268,12 @@ namespace IOB_WIN
if (connectionOk)
{
readSemafori(ref currDispData);
// se richiesto effettuo refresh contapezzi
if (needRefreshPzCount)
{
pzCntReload(true);
needRefreshPzCount = false;
}
}
else
{
@@ -3364,8 +3369,6 @@ namespace IOB_WIN
{
// errore salvataggio contapezzi
lgInfo($"trySendPzCountBlock: errore salvataggio contapezzi: contapezzi {contapezzi} | risposta: {retVal}");
// rileggo il counter pezzi da server
pzCntReload(true);
}
}
else
@@ -4214,7 +4217,7 @@ namespace IOB_WIN
// se oltre 1 min NON era online --> check pezzi!
if (DateTime.Now.Subtract(lastIobOnline).TotalMinutes > 1)
{
lgInfo($"sendDataBlock --> offline timeaout ({lastIobOnline}) --> pzCntReload(true)");
lgInfo($"sendDataBlock --> offline timeout ({lastIobOnline}) --> pzCntReload(true)");
pzCntReload(true);
}
lastIobOnline = DateTime.Now;
+2 -1
View File
@@ -912,8 +912,9 @@ namespace IOB_WIN
// verifico se variato contapezzi... e se passato ritardo minimo...
if (lastCountCNC > contapezzi)
{
// salvo nuovo contapezzi (incremento di 1...)
// salvo nuovo contapezzi (incremento di 1...) + richiesta refresh conteggio
contapezzi++;
needRefreshPzCount = true;
// salvo in semaforo!
B_input += (1 << 2);
// registro contapezzi
+2 -1
View File
@@ -381,8 +381,9 @@ namespace IOB_WIN
// verifico se variato contapezzi in area STD PAR6711... e se passato ritardo minimo...
if (lastCountCNC > contapezzi)
{
// salvo nuovo contapezzi (incremento di 1...)
// salvo nuovo contapezzi (incremento di 1...) + richiesta refresh conteggio
contapezzi++;
needRefreshPzCount = true;
// salvo in semaforo!
B_input += 1 << 2;
// registro contapezzi
+2 -1
View File
@@ -222,8 +222,9 @@ namespace IOB_WIN
// verifico se variato contapezzi... e se passato ritardo minimo...
if (lastCountCNC > contapezzi)
{
// salvo nuovo contapezzi (incremento di 1...)
// salvo nuovo contapezzi (incremento di 1...) + richiesta refresh conteggio
contapezzi++;
needRefreshPzCount = true;
// salvo in semaforo!
B_input += (1 << 2);
// registro contapezzi
+2 -1
View File
@@ -209,8 +209,9 @@ namespace IOB_WIN
}
if ((lastCountCNC > contapezzi))
{
// salvo nuovo contapezzi (incremento di 1...)
// salvo nuovo contapezzi (incremento di 1...) + richiesta refresh conteggio
contapezzi++;
needRefreshPzCount = true;
// salvo in semaforo!
B_input += 1 << 2;
// registro contapezzi
+4 -1
View File
@@ -310,7 +310,9 @@ namespace IOB_WIN
// segnalo BIT (1 pz)
B_input += (1 << 2);
sigPzCount = true;
// salvo nuovo contapezzi (incremento di 1...) + richiesta refresh conteggio
contapezzi++;
needRefreshPzCount = true;
// invio conferma contapezzi..
string retVal = utils.callUrl($"{urlSetPzCount}{contapezzi}");
// verifica salvataggio
@@ -422,8 +424,9 @@ namespace IOB_WIN
{
bit2 = setupSimPar("SIM_PZCNT");
sendContapezzi = true;
// registro contapezzi
// salvo nuovo contapezzi (incremento di 1...) + richiesta refresh conteggio
contapezzi++;
needRefreshPzCount = true;
lgInfo($"S01: Valori contatori: contapezzi macchina lastCountCNC: {lastCountCNC} | contapezzi: {contapezzi} - incremento contapezzi per bit2.duration <= 0");
}
if (sendContapezzi)
Vendored
+1 -1
View File
@@ -9,7 +9,7 @@ pipeline {
steps {
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
script {
withEnv(['NEXT_BUILD_NUMBER=681']) {
withEnv(['NEXT_BUILD_NUMBER=682']) {
// 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'