Merge branch 'develop' into IobMan

This commit is contained in:
Samuele E. Locatelli
2020-02-21 18:46:09 +01:00
17 changed files with 152 additions and 143 deletions
+4
View File
@@ -0,0 +1,4 @@
[*.cs]
# CA1051: Non dichiarare campi di istanza visibili
dotnet_diagnostic.CA1051.severity = none
+48
View File
@@ -0,0 +1,48 @@
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.IOBManPanel.btnMaximixeAll_Click(System.Object,System.EventArgs)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.IOBManPanel.btnMinimizeAll_Click(System.Object,System.EventArgs)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.IOBManPanel.checkIstance(IOB_MAN.iobAdapt,System.Collections.Generic.List{IOB_MAN.iobAdapt},System.Diagnostics.Process[])~System.Boolean")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.IOBManPanel.chiudiChildSel")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.IOBManPanel.closeAllChild(System.Boolean)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.IOBManPanel.dgvManagedItems_CellDoubleClick(System.Object,System.Windows.Forms.DataGridViewCellEventArgs)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.IOBManPanel.forceCheckTimer_Tick(System.Object,System.EventArgs)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.IOBManPanel.MainTimer_Tick(System.Object,System.EventArgs)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.RedisIobCache.deserializeVal(System.String)~System.Object")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.RedisIobCache.getRCnt(System.String)~System.Int32")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.RedisIobCache.getRedisInfoData~System.String")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.RedisIobCache.getRKeys(StackExchange.Redis.RedisKey[])~StackExchange.Redis.RedisValue[]")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.RedisIobCache.getRSV(System.String)~System.String")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.RedisIobCache.redCountKey(System.String)~System.Int32")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.RedisIobCache.redDelKey(System.String)~System.Boolean")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.RedisIobCache.redFlushKey(System.String)~System.Boolean")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.RedisIobCache.redGetCounterByKey(System.String,IOB_MAN.RedisIobCache.kvpOrderBy)~System.Collections.Generic.List{System.Collections.Generic.KeyValuePair{System.String,System.Int32}}")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.RedisIobCache.redGetHash(System.String)~System.Collections.Generic.KeyValuePair{System.String,System.String}[]")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.RedisIobCache.redGetHashDict(System.String)~System.Collections.Generic.Dictionary{System.String,System.String}")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.RedisIobCache.redGetHashField(System.String,System.String)~System.String")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.RedisIobCache.redHash(System.String)~System.String")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.RedisIobCache.redHashPresent(StackExchange.Redis.RedisKey)~System.Boolean")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.RedisIobCache.redHashPresentSz(System.String)~System.Boolean")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.RedisIobCache.redKeyPresent(StackExchange.Redis.RedisKey)~System.Boolean")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.RedisIobCache.redKeyPresentSz(System.String)~System.Boolean")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.RedisIobCache.redSaveHash(System.String,System.Collections.Generic.KeyValuePair{System.String,System.String}[])~System.Boolean")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.RedisIobCache.redSaveHash(System.String,System.Collections.Generic.KeyValuePair{System.String,System.String}[],System.Double)~System.Boolean")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.RedisIobCache.redSaveHashDict(System.String,System.Collections.Generic.Dictionary{System.String,System.String})~System.Boolean")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.RedisIobCache.redSaveHashDict(System.String,System.Collections.Generic.Dictionary{System.String,System.String},System.Double)~System.Boolean")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.RedisIobCache.redSaveHashList(System.String,System.Collections.Generic.List{System.Collections.Generic.KeyValuePair{System.String,System.String}})~System.Boolean")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.RedisIobCache.redServInfo~StackExchange.Redis.IServer[]")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.RedisIobCache.resetRCnt(System.String)~System.Boolean")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.RedisIobCache.serializeVal(System.Object)~System.String")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.RedisIobCache.setRCntD(System.String)~System.Int64")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.RedisIobCache.setRCntI(System.String)~System.Int64")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.RedisIobCache.setRKeys(System.Collections.Generic.KeyValuePair{StackExchange.Redis.RedisKey,StackExchange.Redis.RedisValue}[])~System.Boolean")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.RedisIobCache.setRSV(System.String,System.String)~System.Boolean")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.RedisIobCache.setRSV(System.String,System.String,System.Int32)~System.Boolean")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.utils.CRB(System.String)~System.Boolean")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.utils.CRC(System.String)~System.Char")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.utils.CRI(System.String)~System.Int32")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~M:IOB_MAN.utils.CRS(System.String)~System.String")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<In sospeso>", Scope = "member", Target = "~P:IOB_MAN.RedisIobCache.numRecRedis")]
+1
View File
@@ -148,6 +148,7 @@
<Compile Include="..\VersGen\VersGen.cs">
<Link>VersGen.cs</Link>
</Compile>
<Compile Include="GlobalSuppressions.cs" />
<Compile Include="iobAdapt.cs" />
<Compile Include="IOBManPanel.cs">
<SubType>Form</SubType>
+4 -8
View File
@@ -28,10 +28,6 @@ namespace IOB_MAN
#endregion
/// <summary>
/// Token x cancellazione thread
/// </summary>
private CancellationTokenSource _cts;
/// <summary>
/// Context x sync thread
/// </summary>
@@ -245,7 +241,7 @@ namespace IOB_MAN
if (!chkAutoRestart.Checked)
{
tOutAutocheck--;
txtTOutAutoCheck.Text = (tOutAutocheck / (1000 / (utils.CRI("checkPeriod")))).ToString();
txtTOutAutoCheck.Text = $"{(tOutAutocheck / (1000 / (utils.CRI("checkPeriod"))))}";
}
}
else
@@ -352,7 +348,7 @@ namespace IOB_MAN
foreach (DataGridViewRow riga in dgvManagedItems.SelectedRows)
{
// chiudo!
int.TryParse(riga.Cells["pID"].Value.ToString(), out pid);
_ = int.TryParse(riga.Cells["pID"].Value.ToString(), out pid);
if (pid >= 0)
{
@@ -380,7 +376,7 @@ namespace IOB_MAN
/// <param name="processlist"></param>
/// <param name="id"></param>
/// <returns></returns>
public Process myGetProcByID(Process[] processlist, int id)
public static Process myGetProcByID(Process[] processlist, int id)
{
return processlist.FirstOrDefault(pr => pr.Id == id);
}
@@ -602,7 +598,7 @@ namespace IOB_MAN
closeAllChild(true);
closeTimers();
}
private void closeTimers()
{
MainTimer.Dispose();
+1 -1
View File
@@ -68,7 +68,7 @@ namespace IOB_MAN
/// <summary>
/// Nome della variabile HASH da utilizzare (dato CodModulo / Server / DB impiegato da funzionalita' DbConfig) + keyName richiesto...
/// </summary>
public string redHash(string keyName)
public static string redHash(string keyName)
{
keyName = keyName.Replace("\\", "_");
string answ = keyName;
+5
View File
@@ -18,6 +18,11 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "CVCncLib", "CVCncLib\CVCncL
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IOB-MAN", "IOB-MAN\IOB-MAN.csproj", "{8DFE2AC9-611D-44D5-8E8F-204DCF01EDF8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B52E3E86-1B82-4F4D-982C-0C8909CD2A28}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
CMS-FANUC|Any CPU = CMS-FANUC|Any CPU
-2
View File
@@ -1177,8 +1177,6 @@ namespace IOB_WIN
// init max queue
maxEvQueue = 1;
maxFlQueue = 1;
// forzo check allarmi..
iobObj.forceAlarmCheck();
try
{
-7
View File
@@ -472,13 +472,6 @@ namespace IOB_WIN
{
dtAvvioAdp = DateTime.Now;
if (adpRunning)
{
// carico status allarmi (completo)
lgInfo("Inizio refresh completo stato allarmi...");
forceAlarmCheck();
lgInfo("Completato refresh completo stato allarmi!");
}
else
{
lgInfo("Connessione OK");
}
+10 -17
View File
@@ -265,7 +265,7 @@ namespace IOB_WIN
/// <summary>
/// Verifica se sia in modalità DEMO avanzata (campionamento da set di valori ammessi...)
/// </summary>
public bool DemoInSample
public static bool DemoInSample
{
get
{
@@ -291,7 +291,7 @@ namespace IOB_WIN
/// <summary>
/// Verifica se sia in modalità DEMO x dati OUTPUT
/// </summary>
public bool DemoOut
public static bool DemoOut
{
get
{
@@ -1712,10 +1712,10 @@ namespace IOB_WIN
/// <summary>
/// processa dataLayer e se necessario salva/mostra
/// </summary>
public void checkSavePersDataLayer()
public static void checkSavePersDataLayer()
{
}
public void resetDebugConsole()
public static void resetDebugConsole()
{
}
@@ -2090,7 +2090,7 @@ namespace IOB_WIN
/// <param name="memSize">dimensione singolo slot in byte</param>
/// <param name="BitNum">indirizzo bit: numero riga x calcolo indice bit</param>
/// <returns></returns>
protected otherData decodeBitData(string linea, char separator, int ByteNum, int memSize, int BitNum)
protected static otherData decodeBitData(string linea, char separator, int ByteNum, int memSize, int BitNum)
{
string[] valori = linea.Split(separator);
int shift = 0;
@@ -2153,19 +2153,12 @@ namespace IOB_WIN
#endregion
/// <summary>
/// effettua ogni log period una rilettura di TUTTI gli allarmi...
/// </summary>
public virtual void forceAlarmCheck()
{
}
#region IOB METHODS
/// <summary>
/// Valore del num max invii consecutivi da coda...
/// </summary>
protected int nMaxSend
protected static int nMaxSend
{
get
{
@@ -2675,7 +2668,7 @@ namespace IOB_WIN
/// <summary>
/// Reset dei webclients
/// </summary>
public void resetwebClients()
public static void resetWebClients()
{
utils.resetWebClients();
}
@@ -2811,7 +2804,7 @@ namespace IOB_WIN
// se NON OK riprovo ANCORA 1 volta...
if (!answ)
{
resetwebClients();
resetWebClients();
Thread.Sleep(rand.Next(500, 1000));
callResp = callUrl(urlAlive, false);
answ = (callResp == "OK");
@@ -2908,7 +2901,7 @@ namespace IOB_WIN
// se NON OK riprovo ANCORA 1 volta...
if (!answ)
{
resetwebClients();
resetWebClients();
Thread.Sleep(rand.Next(250, 1000));
callResp = callUrl(urlIobEnabled, false);
answ = (callResp == "OK");
@@ -3787,7 +3780,7 @@ namespace IOB_WIN
}
/// <summary>
/// Effettua processing del recupero delle speed (RPM, feedrate) degli assi
/// Effettua processing degli allarmi CNC SE disponibili
/// </summary>
public void processCncAlarms()
{
+42 -38
View File
@@ -317,7 +317,7 @@ namespace IOB_WIN
KAWASAKI_ref = new KRcc.Commu(connPar);
//KAWASAKI_ref = new KRcc.Commu("TCP 192.168.0.92");
// disconnetto e connetto...
if (isVerboseLog)
if (isVerboseLog)
{
lgInfo("KAWASAKI: tryDisconnect");
}
@@ -326,7 +326,7 @@ namespace IOB_WIN
//lgInfo("KAWASAKI: tryConnect");
//tryConnect();
lgInfo("End init Adapter KAWASAKI");
if (isVerboseLog)
if (isVerboseLog)
{
lgInfo("KAWASAKI CONNESSIONE AVVENUTA");
}
@@ -433,13 +433,6 @@ namespace IOB_WIN
if (connectionOk)
{
if (adpRunning)
{
// carico status allarmi (completo)
lgInfo("Inizio refresh completo stato allarmi...");
forceAlarmCheck();
lgInfo("Completato refresh completo stato allarmi!");
}
else
{
lgInfo("Connessione OK");
}
@@ -902,46 +895,57 @@ namespace IOB_WIN
lastWarnODL = DateTime.Now;
}
}
if (currODL != null && currODL != "" && currODL != "0")
if (!string.IsNullOrEmpty(currODL))
{
// ora processo il contapezzi...
// controllo se è passato intervallo minimo tra 2 controlli/elaborazioni x distanziare invio e ridurre letture
if (DateTime.Now >= lastPzCountSend.AddMilliseconds(pzCountDelay))
if (currODL != "0")
{
// se sono differenti MOSTRO...
if (lastCountCNC != contapezzi)
// ora processo il contapezzi...
// controllo se è passato intervallo minimo tra 2 controlli/elaborazioni x distanziare invio e ridurre letture
if (DateTime.Now >= lastPzCountSend.AddMilliseconds(pzCountDelay))
{
// registro contapezzi
lgInfo(string.Format("Differenza Contapezzi: READ: {0} | Interno {1}", lastCountCNC, contapezzi));
}
// verifico se variato contapezzi... e se passato ritardo minimo...
if (lastCountCNC > contapezzi)
{
// salvo nuovo contapezzi (incremento di 1...)
contapezzi++;
// salvo in semaforo!
B_input += (1 << 2);
// registro contapezzi
lgInfo(string.Format("Contapezzi KAWASAKI: {0} | Contapezzi interno {1}", lastCountCNC, contapezzi));
}
// se sono differenti MOSTRO...
if (lastCountCNC != contapezzi)
{
// registro contapezzi
lgInfo($"Differenza Contapezzi CNC/IOB: lastCountCNC: {lastCountCNC} | contapezzi: {contapezzi}");
}
// verifico se variato contapezzi... e se passato ritardo minimo...
if (lastCountCNC > contapezzi)
{
// salvo nuovo contapezzi (incremento di 1...)
contapezzi++;
// salvo in semaforo!
B_input += (1 << 2);
// registro contapezzi
lgInfo(string.Format("Contapezzi KAWASAKI: {0} | Contapezzi interno {1}", lastCountCNC, contapezzi));
}
else if (contapezzi > lastCountCNC)
{
lgInfo($"Contapezzi IOB > CNC --> NON INVIO (CNC: {lastCountCNC} < IOB: {contapezzi})");
}
// invio a server contapezzi (aggiornato)
string retVal = utils.callUrl(urlSetPzCount + contapezzi.ToString());
// verifica se tutto OK
if (retVal != "OK")
{
// errore salvataggio contapezzi
lgInfo(string.Format("Errore salvataggio Contapezzi KAWASAKI {0} | Contapezzi interno {1} | Errore salvataggio: {2}", lastCountCNC, contapezzi, retVal));
// invio a server contapezzi (aggiornato)
string retVal = utils.callUrl(urlSetPzCount + contapezzi.ToString());
// verifica se tutto OK
if (retVal != "OK")
{
// errore salvataggio contapezzi
lgInfo(string.Format("Errore salvataggio Contapezzi KAWASAKI {0} | Contapezzi interno {1} | Errore salvataggio: {2}", lastCountCNC, contapezzi, retVal));
}
// resetto timer...
lastPzCountSend = DateTime.Now;
}
// resetto timer...
lastPzCountSend = DateTime.Now;
}
else
{
lgError("Attenzione non trovato ODL --> currODL = 0");
}
}
else
{
if (DateTime.Now >= lastPzCountSend.AddMilliseconds(pzCountDelay))
{
lgInfo(string.Format("Attenzione: mancanza ODL non procedo con gestione contapezzi. Contapezzi KAWASAKI {0} | Contapezzi interno {1}", lastCountCNC, contapezzi));
lgError(string.Format("Attenzione: mancanza ODL non procedo con gestione contapezzi. Contapezzi KAWASAKI {0} | Contapezzi interno {1}", lastCountCNC, contapezzi));
// resetto timer...
lastPzCountSend = DateTime.Now;
}
-15
View File
@@ -820,13 +820,6 @@ namespace IOB_WIN
if (connectionOk)
{
if (adpRunning)
{
// carico status allarmi (completo)
lgInfo("Inizio refresh completo stato allarmi...");
forceAlarmCheck();
lgInfo("Completato refresh completo stato allarmi!");
}
else
{
lgInfo("Connessione OK");
}
@@ -868,14 +861,6 @@ namespace IOB_WIN
#region Metodi specifici (da verificare/completare in implementazione)
/// <summary>
/// controllo allarmi
/// </summary>
public override void forceAlarmCheck()
{
// controllo tutta la memoria allarmi SE richiesto
}
/// <summary>
/// Effettua vero processing contapezzi
/// </summary>
+27 -29
View File
@@ -43,24 +43,29 @@ namespace IOB_WIN
pzCountDelay = utils.CRI("pzCountDelay");
lastPzCountSend = DateTime.Now;
lastWarnODL = DateTime.Now;
// inizializzo correttamente aree memoria secondo CONF - iniFileName
IniFile fIni = new IniFile(IOBConf.iniFileName);
// fix enable prgName
enablePrgName = fIni.ReadBoolean("CNC", "GETPRGNAME", true);
// effettuo lettura della conf sigLUT... cercando 1:1 i bit...
string currBit = "";
string memArea = "";
for (int i = 0; i < 8; i++)
if (IOBConf != null)
{
currBit = string.Format("BIT{0}", i);
memArea = fIni.ReadString("MEMORY", currBit, "");
// se trovo un valore...
if (memArea != "")
// inizializzo correttamente aree memoria secondo CONF - iniFileName
if (!string.IsNullOrEmpty(IOBConf.iniFileName))
{
signLUT.Add(currBit, memArea);
IniFile fIni = new IniFile(IOBConf.iniFileName);
// fix enable prgName
enablePrgName = fIni.ReadBoolean("CNC", "GETPRGNAME", true);
// effettuo lettura della conf sigLUT... cercando 1:1 i bit...
string currBit = "";
string memArea = "";
for (int i = 0; i < 8; i++)
{
currBit = string.Format("BIT{0}", i);
memArea = fIni.ReadString("MEMORY", currBit, "");
// se trovo un valore...
if (!string.IsNullOrEmpty(memArea))
{
signLUT.Add(currBit, memArea);
}
}
}
}
@@ -84,13 +89,13 @@ namespace IOB_WIN
}
parentForm.commPlcActive = false;
if (isVerboseLog)
if (isVerboseLog)
{
lgInfo(string.Format("INIT OSAI_ref da CncLib come {0}", IOBConf.tipoIob));
}
// disconnetto e connetto...
if (isVerboseLog)
if (isVerboseLog)
{
lgInfo("OSAI: tryDisconnect");
}
@@ -124,7 +129,7 @@ namespace IOB_WIN
try
{
// verifico quale modalità sia richiesta: STD (6711) oppure BIT (Custom, con indicazione area)
if (cIobConf.optPar.Count > 0 && getOptPar("PZCOUNT_MODE") != "")
if (cIobConf.optPar.Count > 0 && !string.IsNullOrEmpty(getOptPar("PZCOUNT_MODE")))
{
if (getOptPar("PZCOUNT_MODE").StartsWith("OVAR"))
{
@@ -234,13 +239,6 @@ namespace IOB_WIN
{
dtAvvioAdp = DateTime.Now;
if (adpRunning)
{
// carico status allarmi (completo)
lgInfo("Inizio refresh completo stato allarmi...");
forceAlarmCheck();
lgInfo("Completato refresh completo stato allarmi!");
}
else
{
lgInfo("Connessione OK");
}
@@ -346,7 +344,7 @@ namespace IOB_WIN
{
currODL = utils.callUrl(urlGetCurrODL);
// solo SE HO un ODL...
if (currODL == "" || currODL == "0")
if (string.IsNullOrEmpty(currODL) || currODL == "0")
{
if (periodicLog)
{
@@ -368,7 +366,7 @@ namespace IOB_WIN
lastWarnODL = DateTime.Now;
}
}
if (currODL != null && currODL != "" && currODL != "0")
if (!string.IsNullOrEmpty(currODL) && currODL != "0")
{
// controllo se è passato intervallo minimo tra 2 controlli/elaborazioni x distanziare invio e ridurre letture
if (DateTime.Now >= lastPzCountSend.AddMilliseconds(pzCountDelay))
@@ -474,7 +472,7 @@ namespace IOB_WIN
try
{
// verifico quale modalità sia richiesta: STD (6711) oppure BIT (Custom, con indicazione area)
if (cIobConf.optPar.Count > 0 && getOptPar("PZCOUNT_MODE") != "")
if (cIobConf.optPar.Count > 0 && !string.IsNullOrEmpty(getOptPar("PZCOUNT_MODE")))
{
string memAddr = getOptPar("PZCOUNT_MODE");
if (memAddr.StartsWith("STD"))
+1 -15
View File
@@ -271,17 +271,10 @@ namespace IOB_WIN
// imposto i parametri...
setParamPlc();
connectionOk = true;
// refresh stato allarmi!!!
// refresh stato connessione!!!
if (connectionOk)
{
if (adpRunning)
{
// carico status allarmi (completo)
lgInfo("Inizio refresh completo stato allarmi...");
forceAlarmCheck();
lgInfo("Completato refresh completo stato allarmi!");
}
else
{
lgInfo("Connessione OK");
}
@@ -323,13 +316,6 @@ namespace IOB_WIN
#region Metodi specifici (da verificare/completare in implementazione)
/// <summary>
/// controllo allarmi
/// </summary>
public override void forceAlarmCheck()
{
// controllo tutta la memoria allarmi SE richiesto
}
/// <summary>
/// Oggetto per lettura PESO rilevato (DM20-21)
/// </summary>
-7
View File
@@ -993,13 +993,6 @@ namespace IOB_WIN
if (connectionOk)
{
if (adpRunning)
{
// carico status allarmi (completo)
lgInfo("Inizio refresh completo stato allarmi...");
forceAlarmCheck();
lgInfo("Completato refresh completo stato allarmi!");
}
else
{
lgInfo("Connessione OK");
}
+3 -3
View File
@@ -72,11 +72,11 @@ namespace IOB_WIN
lgInfo("BEGIN reloadAdapterConf");
// inizializzo LUT decodifica
string jsonConf = getOptPar("LUT_CONF");
if (jsonConf != "")
if (!string.IsNullOrEmpty(jsonConf))
{
StreamReader reader = new StreamReader($"DATA/CONF/{jsonConf}");
string jsonData = reader.ReadToEnd();
if (jsonData != "")
if (!string.IsNullOrEmpty(jsonData))
{
try
{
@@ -246,7 +246,7 @@ namespace IOB_WIN
element = driver.FindElement(By.Id(item.val));
cVal = element.Text;
// verifico nome o key...
if (item.name != "")
if (!string.IsNullOrEmpty(item.name))
{
cKey = item.name;
}
+5
View File
@@ -401,6 +401,11 @@ namespace IOB_WIN
lg = LogManager.GetCurrentClassLogger();
displayTaskAndLog("MainForm Starting");
// salvo versione SW!
lgInfo("------------------------------------- STARTUP DATA -----------------------------------------------");
lgInfo($"APP Mode : {lblApp.Text}");
lgInfo($"Versione : {lblVers.Text}");
lgInfo("--------------------------------------------------------------------------------------------------");
// se abilitato autoload conf leggo file corretto...
if (utils.CRB("autoLoadConf"))
Vendored
+1 -1
View File
@@ -9,7 +9,7 @@ pipeline {
steps {
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
script {
withEnv(['NEXT_BUILD_NUMBER=671']) {
withEnv(['NEXT_BUILD_NUMBER=672']) {
// 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'