Nuova vers con display date-time ultima lettura plc

This commit is contained in:
Samuele E. Locatelli
2020-03-06 17:20:43 +01:00
parent 446797a1c6
commit b288a030ae
3 changed files with 43 additions and 18 deletions
+17 -4
View File
@@ -980,16 +980,29 @@ namespace IOB_MAN
}
}
}
else if (this.dgvManagedItems.Columns[e.ColumnIndex].Name == "plcOk")
else if (this.dgvManagedItems.Columns[e.ColumnIndex].Name == "lastPlcRead")
{
if (e.Value != null)
{
bool isOk = false;
bool.TryParse(e.Value.ToString(), out isOk);
if (!isOk)
DateTime adesso = DateTime.Now;
DateTime lastRead = adesso.AddMinutes(-60);
DateTime.TryParse(e.Value.ToString(), out lastRead);
if (Math.Abs(adesso.Subtract(lastRead).TotalSeconds) > 180)
{
e.CellStyle.BackColor = Color.Red;
}
else if (Math.Abs(adesso.Subtract(lastRead).TotalSeconds) > 120)
{
e.CellStyle.BackColor = Color.OrangeRed;
}
else if (Math.Abs(adesso.Subtract(lastRead).TotalSeconds) > 60)
{
e.CellStyle.BackColor = Color.Yellow;
}
else if (Math.Abs(adesso.Subtract(lastRead).TotalSeconds) > 15)
{
e.CellStyle.BackColor = Color.YellowGreen;
}
else
{
e.CellStyle.BackColor = Color.White;
+25 -13
View File
@@ -88,19 +88,6 @@ namespace IOB_MAN
}
}
/// <summary>
/// Determina se sia OK la comunicazione con il PLC, cioè non sia FERMO nella comunicazione per > 5 minuti
/// </summary>
[DisplayName("PlcOk")]
public bool plcOk
{
get
{
DateTime adesso = DateTime.Now;
bool plcOnline = Math.Abs(adesso.Subtract(currIobStatus.lastDataIn).TotalSeconds) < 300;
return plcOnline;
}
}
/// <summary>
/// Counter dell'IOB
/// </summary>
[DisplayName("pz.IOB")]
@@ -144,6 +131,31 @@ namespace IOB_MAN
return currIobStatus.queueFlLen;
}
}
/// <summary>
/// Ultima data-ora di comunicazione calida con PLC
/// </summary>
[DisplayName("Last PLC read")]
public DateTime lastPlcRead
{
get
{
return currIobStatus.lastDataIn;
}
}
/// <summary>
/// Determina se sia OK la comunicazione con il PLC, cioè non sia FERMO nella comunicazione per > 5 minuti
/// </summary>
[DisplayName("PlcOk")]
public bool plcOk
{
get
{
DateTime adesso = DateTime.Now;
bool plcOnline = Math.Abs(adesso.Subtract(currIobStatus.lastDataIn).TotalSeconds) < 300;
return plcOnline;
}
}
}
}
Vendored
+1 -1
View File
@@ -9,7 +9,7 @@ pipeline {
steps {
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
script {
withEnv(['NEXT_BUILD_NUMBER=686']) {
withEnv(['NEXT_BUILD_NUMBER=687']) {
// 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'