diff --git a/.vs/config/applicationhost.config b/.vs/config/applicationhost.config
index 85dab631..6d982152 100644
--- a/.vs/config/applicationhost.config
+++ b/.vs/config/applicationhost.config
@@ -162,7 +162,7 @@
-
+
@@ -170,7 +170,7 @@
-
+
@@ -178,7 +178,7 @@
-
+
@@ -194,7 +194,7 @@
-
+
@@ -202,7 +202,7 @@
-
+
@@ -218,7 +218,7 @@
-
+
diff --git a/MP-IO/Controllers/BENCH.cs b/MP-IO/Controllers/BENCH.cs
index c6890d02..ee6a8e42 100644
--- a/MP-IO/Controllers/BENCH.cs
+++ b/MP-IO/Controllers/BENCH.cs
@@ -65,8 +65,8 @@ namespace MP_IO.Controllers
}
return answ;
}
- // GET BENCH/RSETUP/100
- public string RSETUP(int? id)
+ // GET BENCH/RCLEAN/100
+ public string RCLEAN(int? id)
{
string answ = "ND";
Stopwatch stopWatch = new Stopwatch();
@@ -88,6 +88,36 @@ namespace MP_IO.Controllers
chiave = string.Format("test:{0}", i);
memLayer.ML.redDelKey(chiave);
}
+ answ = "OK";
+ }
+ catch
+ { }
+ }
+ stopWatch.Stop();
+ // Get the elapsed time as a TimeSpan value.
+ TimeSpan ts = stopWatch.Elapsed;
+ // accodo tempo!
+ answ += string.Format("
Elapsed: {0}ms", ts.TotalMilliseconds);
+ // ritorno
+ return answ;
+ }
+ // GET BENCH/RSETUP/100
+ public string RSETUP(int? id)
+ {
+ string answ = "ND";
+ Stopwatch stopWatch = new Stopwatch();
+ stopWatch.Start();
+ // se id nullo --> KO!
+ if (id == null)
+ {
+ answ = "KO";
+ }
+ else
+ {
+ string chiave;
+ KeyValuePair[] valori = new KeyValuePair[2];
+ try
+ {
// recupero tutti i record della tabella
// salvo il datasetet come insieme di hash in redis...
@@ -107,7 +137,7 @@ namespace MP_IO.Controllers
// Get the elapsed time as a TimeSpan value.
TimeSpan ts = stopWatch.Elapsed;
// accodo tempo!
- answ = string.Format("Elapsed: {0}ms", ts.TotalMilliseconds);
+ answ += string.Format("
Elapsed: {0}ms", ts.TotalMilliseconds);
// ritorno
return answ;
}
@@ -129,22 +159,6 @@ namespace MP_IO.Controllers
KeyValuePair[] valori = new KeyValuePair[2];
try
{
- //// svuoto i precedenti hash... CICLO!
- //for (int i = 0; i < 1000; i++)
- //{
- // chiave = string.Format("test:{0}", i);
- // memLayer.ML.redDelKey(chiave);
- //}
- //// recupero tutti i record della tabella
-
- //// salvo il datasetet come insieme di hash in redis...
- //for (int i = 0; i < 1000; i++)
- //{
- // chiave = string.Format("test:{0}", i);
- // valori[0] = new KeyValuePair("numero", i.ToString());
- // valori[1] = new KeyValuePair("doppio", (i * 2).ToString());
- // memLayer.ML.redSaveHash(chiave, valori);
- //}
// ora restituisco record completo dell'hash con ID indicato
chiave = string.Format("test:{0}", id);
valori = memLayer.ML.redGetHash(chiave);
diff --git a/MP-IO/Web.config b/MP-IO/Web.config
index b5dd9c35..3db4c0da 100644
--- a/MP-IO/Web.config
+++ b/MP-IO/Web.config
@@ -5,6 +5,8 @@
-->
+
+
@@ -32,14 +34,6 @@
-
diff --git a/MP-Tablet/Web.config b/MP-Tablet/Web.config
index 8485f315..656e68ea 100644
--- a/MP-Tablet/Web.config
+++ b/MP-Tablet/Web.config
@@ -12,19 +12,10 @@
-
-
@@ -38,32 +29,8 @@
-
-
-
-
-
diff --git a/MapoDb/DataLayer.cs b/MapoDb/DataLayer.cs
index e944a4ab..49902a56 100644
--- a/MapoDb/DataLayer.cs
+++ b/MapoDb/DataLayer.cs
@@ -456,6 +456,8 @@ namespace MapoDb
// continuo col resto
try
{
+ // scrivo keep alive!!! (se encessario, altrimenti è in cache...)
+ MapoDb.obj.scriviKeepAlive(idxMacchina, DateTime.Now);
// ora processo e salvo il valore del microstato...
MapoDb.obj.checkMicroStato(idxMacchina, valore, dataOraEvento, contatore);
answ = "OK"; // registro in risposta che è andato tutto bene...
diff --git a/MapoDb/MapoDb.cs b/MapoDb/MapoDb.cs
index 41cdd9d9..8208720e 100644
--- a/MapoDb/MapoDb.cs
+++ b/MapoDb/MapoDb.cs
@@ -74,22 +74,23 @@ namespace MapoDb
///
private void AvviaTabAdapt()
{
- taEvList = new global::MapoDb.DS_applicazioneTableAdapters.EventListTableAdapter();
- taDiario = new global::MapoDb.DS_applicazioneTableAdapters.DiarioDiBordoTableAdapter();
- taAnagSt = new global::MapoDb.DS_applicazioneTableAdapters.AnagraficaStatiTableAdapter();
- taAnagEv = new global::MapoDb.DS_applicazioneTableAdapters.AnagraficaEventiTableAdapter();
- taMacchine = new global::MapoDb.DS_applicazioneTableAdapters.MacchineTableAdapter();
- taTranEv = new global::MapoDb.DS_applicazioneTableAdapters.TransizioneEventiTableAdapter();
- taTranSt = new global::MapoDb.DS_applicazioneTableAdapters.TransizioneStatiTableAdapter();
- taStatoMacchine = new global::MapoDb.DS_applicazioneTableAdapters.StatoMacchineTableAdapter();
- taKeepAlive = new global::MapoDb.DS_applicazioneTableAdapters.KeepAliveTableAdapter();
- taRRL = new global::MapoDb.DS_applicazioneTableAdapters.RemoteRebootLogTableAdapter();
- taTransIngr = new global::MapoDb.DS_applicazioneTableAdapters.TransizioneIngressiTableAdapter();
- taAnOpr = new global::MapoDb.DS_applicazioneTableAdapters.AnagraficaOperatoriTableAdapter();
- taDatiMacch = new global::MapoDb.DS_applicazioneTableAdapters.DatiMacchineTableAdapter();
- taMSM = new global::MapoDb.DS_applicazioneTableAdapters.MicroStatoMacchinaTableAdapter();
+ taEvList = new DS_applicazioneTableAdapters.EventListTableAdapter();
+ taDiario = new DS_applicazioneTableAdapters.DiarioDiBordoTableAdapter();
+ taAnagSt = new DS_applicazioneTableAdapters.AnagraficaStatiTableAdapter();
+ taAnagEv = new DS_applicazioneTableAdapters.AnagraficaEventiTableAdapter();
+ taMacchine = new DS_applicazioneTableAdapters.MacchineTableAdapter();
+ taTranEv = new DS_applicazioneTableAdapters.TransizioneEventiTableAdapter();
+ taTranSt = new DS_applicazioneTableAdapters.TransizioneStatiTableAdapter();
+ taStatoMacchine = new DS_applicazioneTableAdapters.StatoMacchineTableAdapter();
+ taKeepAlive = new DS_applicazioneTableAdapters.KeepAliveTableAdapter();
+ taRRL = new DS_applicazioneTableAdapters.RemoteRebootLogTableAdapter();
+ taTransIngr = new DS_applicazioneTableAdapters.TransizioneIngressiTableAdapter();
+ taAnOpr = new DS_applicazioneTableAdapters.AnagraficaOperatoriTableAdapter();
+ taDatiMacch = new DS_applicazioneTableAdapters.DatiMacchineTableAdapter();
+ taMSM = new DS_applicazioneTableAdapters.MicroStatoMacchinaTableAdapter();
- taTCRilevati = new global::MapoDb.DS_ProdTempiTableAdapters.TempiCicloRilevatiTableAdapter();
+ taDatiMacchine = new DS_ProdTempiTableAdapters.DatiMacchineTableAdapter();
+ taTCRilevati = new DS_ProdTempiTableAdapters.TempiCicloRilevatiTableAdapter();
}
///
/// forza la connString x i vari table adapters
@@ -112,6 +113,7 @@ namespace MapoDb
taDatiMacch.Connection.ConnectionString = _connectionString;
taMSM.Connection.ConnectionString = _connectionString;
+ taDatiMacchine.Connection.ConnectionString = _connectionString;
taTCRilevati.Connection.ConnectionString = _connectionString;
}
///
@@ -292,6 +294,7 @@ namespace MapoDb
public DS_applicazioneTableAdapters.MicroStatoMacchinaTableAdapter taMSM;
// area tempi ciclo
+ public DS_ProdTempiTableAdapters.DatiMacchineTableAdapter taDatiMacchine;
public DS_ProdTempiTableAdapters.TempiCicloRilevatiTableAdapter taTCRilevati;
#endregion
@@ -467,8 +470,6 @@ namespace MapoDb
{
logger.lg.scriviLog(string.Format("[ChkMiSt]{2}---------------------------{2}Richiesta verifica INPUT per Macchina {0}, seriale {1}", idxMacchina, valore, Environment.NewLine), tipoLog.INFO);
}
- // scrivo keep alive!
- scriviKeepAlive(idxMacchina, DateTime.Now);
// formatto output
inputComando answ = new inputComando();
DS_applicazione.TransizioneIngressiDataTable TabTransIn;
@@ -479,12 +480,13 @@ namespace MapoDb
// recupero CodArticolo corretto
try
{
- DataLayer.obj.taDatiConfermati = new DS_ProdTempiTableAdapters.DatiConfermatiTableAdapter();
- CodArticolo = DataLayer.obj.taDatiMacchine.getByIdx(Convert.ToInt32(idxMacchina))[0].CodArticolo_A;
+ // 2017.07.10 forzo init x errori "sovrapposizioni"
+ taDatiMacchine = new DS_ProdTempiTableAdapters.DatiMacchineTableAdapter();
+ CodArticolo = taDatiMacchine.getByIdx(Convert.ToInt32(idxMacchina))[0].CodArticolo_A;
}
catch (Exception exc)
{
- logger.lg.scriviLog(string.Format("[ChkMiSt_4] - Eccezione in recupero CodArticolo:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
+ logger.lg.scriviLog(string.Format("[ChkMiSt_4a] - Eccezione in recupero CodArticolo:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
}
// recupero next microstato
//int? valINT = Convert.ToInt32(valore);
@@ -502,7 +504,7 @@ namespace MapoDb
}
catch (Exception exc)
{
- logger.lg.scriviLog(string.Format("[ChkMiSt] - Eccezione in recupero riga Trans ingressi per idxMacchina {3} e valore {2}:{0}{1}", Environment.NewLine, exc, valINT, idxMacchina), tipoLog.EXCEPTION);
+ logger.lg.scriviLog(string.Format("[ChkMiSt_5a] - - Eccezione in recupero riga Trans ingressi per idxMacchina {3} e valore {2}:{0}{1}", Environment.NewLine, exc, valINT, idxMacchina), tipoLog.EXCEPTION);
}
int _logLevel = memLayer.ML.confReadInt("_logLevel");
// effettuo update vari
@@ -512,7 +514,7 @@ namespace MapoDb
{
if (_logLevel > 5)
{
- logger.lg.scriviLog(string.Format("[ChkMiSt] - Salvo Update Microstato:{0}macchina: {1} | valore seriale: {2} | next micro stato: {3}", Environment.NewLine, idxMacchina, valINT, rigaTransIn.next_IdxMicroStato), tipoLog.INFO);
+ logger.lg.scriviLog(string.Format("[ChkMiSt_6a] - Salvo Update Microstato:{0}macchina: {1} | valore seriale: {2} | next micro stato: {3}", Environment.NewLine, idxMacchina, valINT, rigaTransIn.next_IdxMicroStato), tipoLog.INFO);
}
// 2017.06.09 forzo init x errori "sovrapposizioni"
taMSM = new DS_applicazioneTableAdapters.MicroStatoMacchinaTableAdapter();
@@ -523,19 +525,19 @@ namespace MapoDb
{
if (_logLevel > 5)
{
- logger.lg.scriviLog(string.Format("[ChkMiSt] - Salvo evento:{0}macchina: {1} | tipoEvento: {2} | CodArticolo: {3} | contatore: {4} | valore: {5}", Environment.NewLine, idxMacchina, rigaTransIn.IdxTipoEvento, CodArticolo, contatore, valore), tipoLog.INFO);
+ logger.lg.scriviLog(string.Format("[ChkMiSt_7a] - Salvo evento:{0}macchina: {1} | tipoEvento: {2} | CodArticolo: {3} | contatore: {4} | valore: {5}", Environment.NewLine, idxMacchina, rigaTransIn.IdxTipoEvento, CodArticolo, contatore, valore), tipoLog.INFO);
}
string valEsteso = string.Format("[{0}] {1}", contatore.PadLeft(3, '0'), valore);
answ = scriviRigaEvento(idxMacchina, rigaTransIn.IdxTipoEvento, CodArticolo, valEsteso, 0, "-", dtEve, DateTime.Now); // aggiunto contatore!
if (_logLevel > 5)
{
- logger.lg.scriviLog(string.Format("[ChkMiSt] - Macchina {0} | seriale(INT) {1} | valEsteso {3} | answ {4}{2}---------------------------{2}", idxMacchina, valINT, Environment.NewLine, valEsteso, answ), tipoLog.INFO);
+ logger.lg.scriviLog(string.Format("[ChkMiSt_a] - Macchina {0} | seriale(INT) {1} | valEsteso {3} | answ {4}{2}---------------------------{2}", idxMacchina, valINT, Environment.NewLine, valEsteso, answ), tipoLog.INFO);
}
}
}
catch (Exception exc)
{
- logger.lg.scriviLog(string.Format("[ChkMiSt] - Eccezione:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
+ logger.lg.scriviLog(string.Format("[ChkMiSt_8a] - Eccezione:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
}
}
return answ;
@@ -553,8 +555,6 @@ namespace MapoDb
{
logger.lg.scriviLog(string.Format("{2}---------------------------{2}Richiesta verifica INPUT per Macchina {0}, seriale {1}", idxMacchina, valore, Environment.NewLine), tipoLog.INFO);
}
- // scrivo keep alive!
- scriviKeepAlive(idxMacchina, DateTime.Now);
// formatto output
inputComando answ = new inputComando();
DS_applicazione.TransizioneIngressiDataTable TabTransIn;
@@ -565,17 +565,21 @@ namespace MapoDb
// recupero CodArticolo corretto
try
{
- CodArticolo = DataLayer.obj.taDatiMacchine.getByIdx(Convert.ToInt32(idxMacchina))[0].CodArticolo_A;
+ // 2017.07.10 forzo init x errori "sovrapposizioni"
+ taDatiMacchine = new DS_ProdTempiTableAdapters.DatiMacchineTableAdapter();
+ CodArticolo = taDatiMacchine.getByIdx(Convert.ToInt32(idxMacchina))[0].CodArticolo_A;
}
catch (Exception exc)
{
- logger.lg.scriviLog(string.Format("[ChkMiSt_3] - Eccezione in recupero CodArticolo:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
+ logger.lg.scriviLog(string.Format("[ChkMiSt_4b] - Eccezione in recupero CodArticolo:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
}
// recupero next microstato
//int? valINT = Convert.ToInt32(valore);
int? valINT = 0;
try
{
+ // 2017.06.09 forzo init x errori "sovrapposizioni"
+ taTransIngr = new DS_applicazioneTableAdapters.TransizioneIngressiTableAdapter();
valINT = int.Parse(valore, System.Globalization.NumberStyles.HexNumber);
TabTransIn = taTransIngr.getByIdxMacchinaValore(idxMacchina, valINT);
if (TabTransIn.Rows.Count > 0)
@@ -585,7 +589,7 @@ namespace MapoDb
}
catch (Exception exc)
{
- logger.lg.scriviLog(string.Format("Eccezione in recupero riga Trans ingressi per idxMacchina {3} e valore {2}:{0}{1}", Environment.NewLine, exc, valINT, idxMacchina), tipoLog.EXCEPTION);
+ logger.lg.scriviLog(string.Format("[ChkMiSt_5b] - Eccezione in recupero riga Trans ingressi per idxMacchina {3} e valore {2}:{0}{1}", Environment.NewLine, exc, valINT, idxMacchina), tipoLog.EXCEPTION);
}
int _logLevel = memLayer.ML.confReadInt("_logLevel");
// effettuo update vari
@@ -595,7 +599,7 @@ namespace MapoDb
{
if (_logLevel > 5)
{
- logger.lg.scriviLog(string.Format("Salvo Update Microstato:{0}macchina: {1} | valore seriale: {2} | next micro stato: {3}", Environment.NewLine, idxMacchina, valINT, rigaTransIn.next_IdxMicroStato), tipoLog.INFO);
+ logger.lg.scriviLog(string.Format("[ChkMiSt_6b] - Salvo Update Microstato:{0}macchina: {1} | valore seriale: {2} | next micro stato: {3}", Environment.NewLine, idxMacchina, valINT, rigaTransIn.next_IdxMicroStato), tipoLog.INFO);
}
// salvo nuovo microstato...
taMSM.updateQuery(rigaTransIn.next_IdxMicroStato, dtEve, valore, idxMacchina);
@@ -604,18 +608,18 @@ namespace MapoDb
{
if (_logLevel > 5)
{
- logger.lg.scriviLog(string.Format("Salvo evento:{0}macchina: {1} | tipoEvento: {2} | CodArticolo: {3}", Environment.NewLine, idxMacchina, rigaTransIn.IdxTipoEvento, CodArticolo), tipoLog.INFO);
+ logger.lg.scriviLog(string.Format("[ChkMiSt_7b] - Salvo evento:{0}macchina: {1} | tipoEvento: {2} | CodArticolo: {3}", Environment.NewLine, idxMacchina, rigaTransIn.IdxTipoEvento, CodArticolo), tipoLog.INFO);
}
answ = scriviRigaEvento(idxMacchina, rigaTransIn.IdxTipoEvento, CodArticolo, valore, 0, "-", dtEve, DateTime.Now);
if (_logLevel > 5)
{
- logger.lg.scriviLog(string.Format("Macchina {0}, seriale(INT) {1}{2}---------------------------{2}", idxMacchina, valINT, Environment.NewLine), tipoLog.INFO);
+ logger.lg.scriviLog(string.Format("[ChkMiSt_b] -Macchina {0}, seriale(INT) {1}{2}---------------------------{2}", idxMacchina, valINT, Environment.NewLine), tipoLog.INFO);
}
}
}
catch (Exception exc)
{
- logger.lg.scriviLog(string.Format("Eccezione:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
+ logger.lg.scriviLog(string.Format("[ChkMiSt_8b] - Eccezione:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
}
}
return answ;