Merge branch 'release/AddFLSnapshotFunct'
This commit is contained in:
+296
-250
@@ -13,15 +13,11 @@ namespace MP_IO.Controllers
|
||||
{
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// SALVA x macchina KVP parametro/valore:
|
||||
/// <summary> SALVA x macchina KVP parametro/valore:
|
||||
///
|
||||
/// GET: IOB/addOptPar/SIMUL_03?pName=PZREQ&pValue=1000
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="pName"></param>
|
||||
/// <param name="pValue"></param>
|
||||
/// </summary> <param name="id"></param> <param name="pName"></param> <param name="pValue"></param>
|
||||
public string addOptPar(string id, string pName, string pValue)
|
||||
{
|
||||
string answ = "";
|
||||
@@ -39,8 +35,7 @@ namespace MP_IO.Controllers
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// AGGIUNGE TASK richiesto x macchina:
|
||||
/// <summary> AGGIUNGE TASK richiesto x macchina:
|
||||
///
|
||||
/// GET: IOB/addTask2Exe/3010?taskName=startSetup&taskVal=T190406101512
|
||||
/// GET: IOB/addTask2Exe/3010?taskName=stopSetup&taskVal=T190406101512
|
||||
@@ -48,10 +43,7 @@ namespace MP_IO.Controllers
|
||||
/// GET: IOB/addTask2Exe/SIMUL_03?taskName=setComm&taskVal=ODL_0000123
|
||||
/// GET: IOB/addTask2Exe/SIMUL_03?taskName=setArt&taskVal=ART_0000321
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="taskName"></param>
|
||||
/// <param name="taskVal"></param>
|
||||
/// </summary> <param name="id"></param> <param name="taskName"></param> <param name="taskVal"></param>
|
||||
public string addTask2Exe(string id, string taskName, string taskVal)
|
||||
{
|
||||
string answ = "";
|
||||
@@ -79,7 +71,6 @@ namespace MP_IO.Controllers
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
// GET: IOB/enabled/SIMUL_03
|
||||
public string enabled(string id)
|
||||
{
|
||||
@@ -106,90 +97,6 @@ namespace MP_IO.Controllers
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processa una chiamata POST per l'invio di un array Json di oggetti rawTransfer (generiche info da deserializzare)
|
||||
/// POST: IOB/rawTransfJson/SIMUL_03
|
||||
/// </summary>
|
||||
/// <param name="id">ID dell'IOB</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public string rawTransfJson(string id)
|
||||
{
|
||||
int insDone = 0;
|
||||
string answ = "";
|
||||
// questa classe è derivata da Controller.Response... x cui recupero lo stream in altro modo...
|
||||
string content = "";
|
||||
System.Web.HttpContext.Current.Request.InputStream.Position = 0;
|
||||
using (var reader = new StreamReader(
|
||||
Request.InputStream, System.Text.Encoding.UTF8, true, 4096, true))
|
||||
{
|
||||
content = reader.ReadToEnd();
|
||||
}
|
||||
//Rest
|
||||
System.Web.HttpContext.Current.Request.InputStream.Position = 0;
|
||||
// se ho dati...
|
||||
if (content != "")
|
||||
{
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
// deserializzo come un dictionary generico di oggetti rawDataType/string
|
||||
List<BaseRawTransf> receivedData = new List<BaseRawTransf>();
|
||||
// procedo a deserializzare in blocco l'oggetto...
|
||||
try
|
||||
{
|
||||
// deserializzo.
|
||||
receivedData = JsonConvert.DeserializeObject<List<BaseRawTransf>>(content);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog($"Errore in fase deserializzazione rawTransfJson{Environment.NewLine}{exc}");
|
||||
answ = "NO";
|
||||
}
|
||||
// se ho qualcosa da processare...
|
||||
if (receivedData != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach (var item in receivedData)
|
||||
{
|
||||
|
||||
// per ora salvo su REDIS ultimo x tipo
|
||||
DataLayerObj.lastRawTrasfData = JsonConvert.SerializeObject(item.mesContent);
|
||||
//DataLayerObj.lastRawTrasfData = item.mesContent;
|
||||
|
||||
// !!! FixMe ToDo fare
|
||||
// deserializzazione e salvataggio su MongoDB
|
||||
// salvataggio su tab RawTrasf su DB IS
|
||||
|
||||
// in base al tipo processo...
|
||||
switch (item.mesType)
|
||||
{
|
||||
case rawTransfType.ND:
|
||||
break;
|
||||
case rawTransfType.IcoelBatch:
|
||||
break;
|
||||
case rawTransfType.IcoelVarInfo:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
insDone++;
|
||||
}
|
||||
// se vuoto --> OK!
|
||||
if (string.IsNullOrEmpty(answ))
|
||||
{
|
||||
answ = $"OK {insDone} processed";
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog($"Errore in fase invio valori rawTransfJson{Environment.NewLine}{exc}");
|
||||
answ = "NO";
|
||||
}
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processa una chiamata POST per l'invio di un array Json di oggetti input (EVENTI)
|
||||
/// POST: IOB/evListJson/SIMUL_03
|
||||
@@ -353,7 +260,8 @@ namespace MP_IO.Controllers
|
||||
try
|
||||
{
|
||||
List<objItem> currParams = DataLayerObj.getCurrObjItems(id);
|
||||
// ora per ogni valore RICEVUTO costruisco un oggetto in innovazioni da inviare...x salvare in stato parametri...
|
||||
// ora per ogni valore RICEVUTO costruisco un oggetto in innovazioni da
|
||||
// inviare...x salvare in stato parametri...
|
||||
List<objItem> innovazioni = new List<objItem>();
|
||||
foreach (var item in receivedData.fluxData)
|
||||
{
|
||||
@@ -365,7 +273,8 @@ namespace MP_IO.Controllers
|
||||
// aggiorno valore e data
|
||||
trovato.value = item.valore;
|
||||
trovato.lastRead = DateTime.Now;
|
||||
// se fosse un valore WRITE e mi ha dato un valore vuoto --> mando un fix x riscrittura
|
||||
// se fosse un valore WRITE e mi ha dato un valore vuoto --> mando
|
||||
// un fix x riscrittura
|
||||
if (trovato.writable && string.IsNullOrEmpty(item.valore))
|
||||
{
|
||||
logger.lg.scriviLog($"flogJson | verifica parametri | {trovato.uid} | reqVal: {trovato.reqValue}");
|
||||
@@ -401,136 +310,36 @@ namespace MP_IO.Controllers
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
// GET: IOB/ulog/SIMUL_03?flux=PROG&valore=P0001&dtEve=20161223180600000&dtCurr=20161223180600000&cnt=999&matrOpr=0=0&label=&valNum
|
||||
public string ulog(string id, string flux, string valore, string dtEve, string dtCurr, string cnt, string matrOpr, string label, string valNum)
|
||||
{
|
||||
string answ = "";
|
||||
// formato yyyymmddHHMMSSnnn ovvero da anno a millisecondi
|
||||
if (cnt == null)
|
||||
{
|
||||
cnt = "0";
|
||||
}
|
||||
|
||||
DateTime dataOraEvento = DateTime.Now;
|
||||
if (memLayer.ML.CRI("_logLevel") > 6)
|
||||
{
|
||||
logger.lg.scriviLog($"ulog | Valori letti: idxMacchina: {id} | flux: {flux} valore: {valore} | matrOpr: {matrOpr} | label: {label} | valNum: {valNum}", tipoLog.INFO);
|
||||
}
|
||||
try
|
||||
{
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
int count = 0;
|
||||
int nMatrOpr = 0;
|
||||
int nValNum = 0;
|
||||
Int32.TryParse(cnt, out count);
|
||||
Int32.TryParse(matrOpr, out nMatrOpr);
|
||||
Int32.TryParse(valNum, out nValNum);
|
||||
answ = DataLayerObj.processUserLog(id, flux, valore, dtEve, dtCurr, count, nMatrOpr, label, nValNum);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog($"Errore in ulog{Environment.NewLine}{exc}");
|
||||
answ = "NO";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Processa una chiamata POST per l'invio di una List Json 1+ UserAction (contiene controlli, scarti, dichiarazioni)
|
||||
/// POST: IOB/ulogJson/SIMUL_03
|
||||
/// </summary>
|
||||
/// <param name="id">ID dell'IOB</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public string ulogJson(string id)
|
||||
{
|
||||
int insDone = 0;
|
||||
string answ = "-";
|
||||
// questa classe è derivata da Controller.Response... x cui recupero lo stream in altro modo...
|
||||
string content = "";
|
||||
System.Web.HttpContext.Current.Request.InputStream.Position = 0;
|
||||
using (var reader = new StreamReader(
|
||||
Request.InputStream, System.Text.Encoding.UTF8, true, 4096, true))
|
||||
{
|
||||
content = reader.ReadToEnd();
|
||||
}
|
||||
//Rest
|
||||
System.Web.HttpContext.Current.Request.InputStream.Position = 0;
|
||||
// se ho dati...
|
||||
if (content != "")
|
||||
{
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
// procedo a deserializzare in blocco l'oggetto...
|
||||
ulogJsonPayload receivedData = new ulogJsonPayload();
|
||||
try
|
||||
{
|
||||
// deserializzo.
|
||||
receivedData = JsonConvert.DeserializeObject<ulogJsonPayload>(content);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog($"Errore in fase deserializzazione ulogJson{Environment.NewLine}{exc}");
|
||||
answ = "NO";
|
||||
}
|
||||
// se ho qualcosa da processare...
|
||||
if (receivedData != null)
|
||||
{
|
||||
// per ogni valore --> salvo!
|
||||
try
|
||||
{
|
||||
foreach (var item in receivedData.fluxData)
|
||||
{
|
||||
// formato datetime come yyyyMMddHHmmssfff -->es: 20181223180600000
|
||||
answ = DataLayerObj.processUserLog(id, item.flux, item.valore, item.dtEve.ToString("yyyyMMddHHmmssfff"), item.dtCurr.ToString("yyyyMMddHHmmssfff"), item.cnt, item.matrOpr, item.label, item.valNum);
|
||||
}
|
||||
// se vuoto --> OK!
|
||||
if (string.IsNullOrEmpty(answ))
|
||||
{
|
||||
answ = $"OK {insDone} processed";
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog($"Errore in fase invio valori ulogJson{Environment.NewLine}{exc}");
|
||||
answ = "NO";
|
||||
}
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Chiude ODL precedente ed avvia uno nuovo (duplicandolo e sitemando quantità RIMANENTE), e CONFERMA produzione...
|
||||
/// Chiude ODL precedente ed avvia uno nuovo (duplicandolo e sitemando quantità RIMANENTE),
|
||||
/// e CONFERMA produzione...
|
||||
///
|
||||
/// GET: IOB/forceSplitOdl/SIMUL_03
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns>Esito chiamata (OK/vuoto)</returns>
|
||||
public string forceSplitOdl(string id)
|
||||
{
|
||||
// attenzione! poiché nell'URL il carattere "#" fiene filtrato ci aspettiamo il carattere "|" che poi trasformiamo ora in "#"
|
||||
// attenzione! poiché nell'URL il carattere "#" fiene filtrato ci aspettiamo il
|
||||
// carattere "|" che poi trasformiamo ora in "#"
|
||||
id = id.Replace("|", "#");
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
return DataLayerObj.AutoStartOdl(id, true, true, 100, "");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Chiude ODL precedente ed avvia uno nuovo (duplicandolo e sitemando quantità RIMANENTE), e CONFERMA produzione...
|
||||
/// <summary> Chiude ODL precedente ed avvia uno nuovo (duplicandolo e sitemando quantità
|
||||
/// RIMANENTE), e CONFERMA produzione...
|
||||
///
|
||||
/// GET: IOB/forceSplitOdl/SIMUL_03?doConfirm=true&qtyFromLast=true&roundStep=150&extOrderCode=ABCDE1234
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="id">id impianto</param>
|
||||
/// <param name="doConfirm"></param>
|
||||
/// <param name="qtyFromLast"></param>
|
||||
/// <param name="roundStep"></param>
|
||||
/// <param name="keyRichiesta">Cod esterno da legare all'ODL x tracciare lotti prod</param>
|
||||
/// </summary> <param name="id">id impianto</param> <param name="doConfirm"></param> <param
|
||||
/// name="qtyFromLast"></param> <param name="roundStep"></param> <param
|
||||
/// name="keyRichiesta">Cod esterno da legare all'ODL x tracciare lotti prod</param>
|
||||
/// <returns>Esito chiamata (OK/vuoto)</returns>
|
||||
public string forceSplitOdlFull(string id, bool doConfirm, bool qtyFromLast, int? roundStep, string keyRichiesta = "")
|
||||
{
|
||||
// attenzione! poiché nell'URL il carattere "#" fiene filtrato ci aspettiamo il carattere "|" che poi trasformiamo ora in "#"
|
||||
// attenzione! poiché nell'URL il carattere "#" fiene filtrato ci aspettiamo il
|
||||
// carattere "|" che poi trasformiamo ora in "#"
|
||||
id = id.Replace("|", "#");
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
if (roundStep == null)
|
||||
@@ -544,7 +353,6 @@ namespace MP_IO.Controllers
|
||||
/// Recupera COUNTER x macchina:
|
||||
///
|
||||
/// GET: IOB/getCounter/5
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
@@ -568,7 +376,6 @@ namespace MP_IO.Controllers
|
||||
/// Recupera COUNTER x macchina dal CONTEGGIO dei TCRecorded:
|
||||
///
|
||||
/// GET: IOB/getCounterTCRec/5
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
@@ -592,13 +399,13 @@ namespace MP_IO.Controllers
|
||||
/// Recupera DATI correnti x macchina:
|
||||
///
|
||||
/// GET: IOB/getCurrData/SIMUL_03
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns>Json contenente la riga di stato macchina</returns>
|
||||
public string getCurrData(string id)
|
||||
{
|
||||
// attenzione! poiché nell'URL il carattere "#" fiene filtrato ci aspettiamo il carattere "|" che poi trasformiamo ora in "#"
|
||||
// attenzione! poiché nell'URL il carattere "#" fiene filtrato ci aspettiamo il
|
||||
// carattere "|" che poi trasformiamo ora in "#"
|
||||
id = id.Replace("|", "#");
|
||||
string answ = "";
|
||||
// scrivo keep alive!!! (se necessario, altrimenti è in cache...)
|
||||
@@ -620,13 +427,13 @@ namespace MP_IO.Controllers
|
||||
/// Recupera ODL corrente x macchina:
|
||||
///
|
||||
/// GET: IOB/getCurrODL/SIMUL_03
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public string getCurrODL(string id)
|
||||
{
|
||||
// attenzione! poiché nell'URL il carattere "#" viene filtrato ci aspettiamo il carattere "|" che poi trasformiamo ora in "#"
|
||||
// attenzione! poiché nell'URL il carattere "#" viene filtrato ci aspettiamo il
|
||||
// carattere "|" che poi trasformiamo ora in "#"
|
||||
id = id.Replace("|", "#");
|
||||
string answ = "";
|
||||
try
|
||||
@@ -650,7 +457,8 @@ namespace MP_IO.Controllers
|
||||
/// <returns></returns>
|
||||
public string getCurrOdlRow(string id)
|
||||
{
|
||||
// attenzione! poiché nell'URL il carattere "#" fiene filtrato ci aspettiamo il carattere "|" che poi trasformiamo ora in "#"
|
||||
// attenzione! poiché nell'URL il carattere "#" fiene filtrato ci aspettiamo il
|
||||
// carattere "|" che poi trasformiamo ora in "#"
|
||||
id = id.Replace("|", "#");
|
||||
string answ = "";
|
||||
DS_ProdTempi.ODLDataTable currData = null;
|
||||
@@ -676,7 +484,8 @@ namespace MP_IO.Controllers
|
||||
/// <returns></returns>
|
||||
public string getCurrOdlStart(string id)
|
||||
{
|
||||
// attenzione! poiché nell'URL il carattere "#" fiene filtrato ci aspettiamo il carattere "|" che poi trasformiamo ora in "#"
|
||||
// attenzione! poiché nell'URL il carattere "#" fiene filtrato ci aspettiamo il
|
||||
// carattere "|" che poi trasformiamo ora in "#"
|
||||
id = id.Replace("|", "#");
|
||||
DateTime answ = new DateTime(DateTime.Now.Year - 1, 12, 31);
|
||||
// chiamo metodo redis/db...
|
||||
@@ -705,7 +514,8 @@ namespace MP_IO.Controllers
|
||||
/// <returns></returns>
|
||||
public string getCurrStatoRow(string id)
|
||||
{
|
||||
// attenzione! poiché nell'URL il carattere "#" fiene filtrato ci aspettiamo il carattere "|" che poi trasformiamo ora in "#"
|
||||
// attenzione! poiché nell'URL il carattere "#" fiene filtrato ci aspettiamo il
|
||||
// carattere "|" che poi trasformiamo ora in "#"
|
||||
id = id.Replace("|", "#");
|
||||
string answ = "";
|
||||
DS_applicazione.StatoMacchineDataTable currData = null;
|
||||
@@ -764,14 +574,16 @@ namespace MP_IO.Controllers
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restituisce il valore dello stato di IDLE della macchina, quindi SOLO SE NON é in lavoro e già convertito in minuti...
|
||||
/// Restituisce il valore dello stato di IDLE della macchina, quindi SOLO SE NON é in lavoro
|
||||
/// e già convertito in minuti...
|
||||
/// GET: IOB/getIdlePeriod/SIMUL_01
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public int getIdlePeriod(string id)
|
||||
{
|
||||
// attenzione! poiché nell'URL il carattere "#" fiene filtrato ci aspettiamo il carattere "|" che poi trasformiamo ora in "#"
|
||||
// attenzione! poiché nell'URL il carattere "#" fiene filtrato ci aspettiamo il
|
||||
// carattere "|" che poi trasformiamo ora in "#"
|
||||
id = id.Replace("|", "#");
|
||||
int answ = 0;
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
@@ -801,7 +613,8 @@ namespace MP_IO.Controllers
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restituisce il (primo) codice IOB da dover gestire (se un IOBMAN chiede di gestirne uno in +...)
|
||||
/// Restituisce il (primo) codice IOB da dover gestire (se un IOBMAN chiede di gestirne uno
|
||||
/// in +...)
|
||||
/// </summary>
|
||||
/// <param name="GWIP">IP del Gateway</param>
|
||||
/// <returns></returns>
|
||||
@@ -809,7 +622,8 @@ namespace MP_IO.Controllers
|
||||
{
|
||||
string answ = "";
|
||||
|
||||
// !!!FARE!!! temporanemanete genera a caso vuoto o 3000 x permettere test... altrimenti gestisce VERA coda... secondi pari...
|
||||
// !!!FARE!!! temporanemanete genera a caso vuoto o 3000 x permettere test... altrimenti
|
||||
// gestisce VERA coda... secondi pari...
|
||||
int resto = 0;
|
||||
Math.DivRem(DateTime.Now.Second, 2, out resto);
|
||||
if (resto == 0)
|
||||
@@ -888,7 +702,8 @@ namespace MP_IO.Controllers
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// restituisce elenco parametri CHE RICHIEDONO scrittura su PLC come una List Json di oggetti objItem
|
||||
/// restituisce elenco parametri CHE RICHIEDONO scrittura su PLC come una List Json di
|
||||
/// oggetti objItem
|
||||
/// GET: IOB/getObjItems2Write/SIMUL_03
|
||||
/// </summary>
|
||||
/// <param name="id">ID dell'IOB</param>
|
||||
@@ -928,7 +743,6 @@ namespace MP_IO.Controllers
|
||||
/// Recupera TASK richiesto x macchina:
|
||||
///
|
||||
/// GET: IOB/getOptPar/SIMUL_03
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns>Json contenente 1..n task da eseguire</returns>
|
||||
@@ -954,7 +768,6 @@ namespace MP_IO.Controllers
|
||||
/// Recupera TASK richiesto x macchina:
|
||||
///
|
||||
/// GET: IOB/getTask2Exe/SIMUL_03
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns>Json contenente 1..n task da eseguire</returns>
|
||||
@@ -1087,11 +900,96 @@ namespace MP_IO.Controllers
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processa una chiamata POST per l'invio di un array Json di oggetti rawTransfer
|
||||
/// (generiche info da deserializzare)
|
||||
/// POST: IOB/rawTransfJson/SIMUL_03
|
||||
/// </summary>
|
||||
/// <param name="id">ID dell'IOB</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public string rawTransfJson(string id)
|
||||
{
|
||||
int insDone = 0;
|
||||
string answ = "";
|
||||
// questa classe è derivata da Controller.Response... x cui recupero lo stream in altro modo...
|
||||
string content = "";
|
||||
System.Web.HttpContext.Current.Request.InputStream.Position = 0;
|
||||
using (var reader = new StreamReader(
|
||||
Request.InputStream, System.Text.Encoding.UTF8, true, 4096, true))
|
||||
{
|
||||
content = reader.ReadToEnd();
|
||||
}
|
||||
//Rest
|
||||
System.Web.HttpContext.Current.Request.InputStream.Position = 0;
|
||||
// se ho dati...
|
||||
if (content != "")
|
||||
{
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
// deserializzo come un dictionary generico di oggetti rawDataType/string
|
||||
List<BaseRawTransf> receivedData = new List<BaseRawTransf>();
|
||||
// procedo a deserializzare in blocco l'oggetto...
|
||||
try
|
||||
{
|
||||
// deserializzo.
|
||||
receivedData = JsonConvert.DeserializeObject<List<BaseRawTransf>>(content);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog($"Errore in fase deserializzazione rawTransfJson{Environment.NewLine}{exc}");
|
||||
answ = "NO";
|
||||
}
|
||||
// se ho qualcosa da processare...
|
||||
if (receivedData != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach (var item in receivedData)
|
||||
{
|
||||
// per ora salvo su REDIS ultimo x tipo
|
||||
DataLayerObj.lastRawTrasfData = JsonConvert.SerializeObject(item.mesContent);
|
||||
//DataLayerObj.lastRawTrasfData = item.mesContent;
|
||||
|
||||
// !!! FixMe ToDo fare deserializzazione e salvataggio su MongoDB
|
||||
// salvataggio su tab RawTrasf su DB IS
|
||||
|
||||
// in base al tipo processo...
|
||||
switch (item.mesType)
|
||||
{
|
||||
case rawTransfType.ND:
|
||||
break;
|
||||
|
||||
case rawTransfType.IcoelBatch:
|
||||
break;
|
||||
|
||||
case rawTransfType.IcoelVarInfo:
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
insDone++;
|
||||
}
|
||||
// se vuoto --> OK!
|
||||
if (string.IsNullOrEmpty(answ))
|
||||
{
|
||||
answ = $"OK {insDone} processed";
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog($"Errore in fase invio valori rawTransfJson{Environment.NewLine}{exc}");
|
||||
answ = "NO";
|
||||
}
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ELIMINA TASK richiesto x macchina:
|
||||
///
|
||||
/// GET: IOB/remOptPar/SIMUL_03?pName=PZREQ
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="pName"></param>
|
||||
@@ -1116,7 +1014,6 @@ namespace MP_IO.Controllers
|
||||
/// ELIMINA TASK richiesto x macchina:
|
||||
///
|
||||
/// GET: IOB/remTask2Exe/SIMUL_03?taskName=T180326160502
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="taskName"></param>
|
||||
@@ -1151,7 +1048,6 @@ namespace MP_IO.Controllers
|
||||
/// Effettua RESET dell'ODL corrente x macchina:
|
||||
///
|
||||
/// GET: IOB/resetCurrODL/5
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
@@ -1177,7 +1073,8 @@ namespace MP_IO.Controllers
|
||||
}
|
||||
else
|
||||
{
|
||||
// questa classe è derivata da Controller.Response... x cui recupero lo stream in altro modo...
|
||||
// questa classe è derivata da Controller.Response... x cui recupero lo stream in
|
||||
// altro modo...
|
||||
string content = "";
|
||||
System.Web.HttpContext.Current.Request.InputStream.Position = 0;
|
||||
using (var reader = new StreamReader(Request.InputStream, System.Text.Encoding.UTF8, true, 4096, true))
|
||||
@@ -1207,7 +1104,8 @@ namespace MP_IO.Controllers
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processa una chiamata POST per l'invio di un array Json di oggetti di conf DataItems (es per MTC)
|
||||
/// Processa una chiamata POST per l'invio di un array Json di oggetti di conf DataItems (es
|
||||
/// per MTC)
|
||||
/// PUT: IOB/saveDataItems/SIMUL_03
|
||||
/// </summary>
|
||||
/// <param name="id">ID dell'IOB</param>
|
||||
@@ -1223,7 +1121,8 @@ namespace MP_IO.Controllers
|
||||
}
|
||||
else
|
||||
{
|
||||
// questa classe è derivata da Controller.Response... x cui recupero lo stream in altro modo...
|
||||
// questa classe è derivata da Controller.Response... x cui recupero lo stream in
|
||||
// altro modo...
|
||||
string content = "";
|
||||
System.Web.HttpContext.Current.Request.InputStream.Position = 0;
|
||||
using (var reader = new StreamReader(Request.InputStream, System.Text.Encoding.UTF8, true, 4096, true))
|
||||
@@ -1256,10 +1155,10 @@ namespace MP_IO.Controllers
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// SALVA in blocco un incremento pezzi x macchina restituendo il valore appena inviato o, se mancasse chaive redis, del valore da DB
|
||||
/// SALVA in blocco un incremento pezzi x macchina restituendo il valore appena inviato o,
|
||||
/// se mancasse chaive redis, del valore da DB
|
||||
///
|
||||
/// GET: IOB/savePzCountInc/5?qty=10
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="id">codice macchina</param>
|
||||
/// <param name="qty">num peziz da salvare in blocco</param>
|
||||
@@ -1291,10 +1190,8 @@ namespace MP_IO.Controllers
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
//public string sendAlarmBankUpdate(string id)
|
||||
public string sendAlarmBankUpdate(string id, string memAddr, int index, int currStatus)
|
||||
{
|
||||
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
// esempio valido x MAPO
|
||||
string answ = "";
|
||||
@@ -1305,7 +1202,8 @@ namespace MP_IO.Controllers
|
||||
}
|
||||
else
|
||||
{
|
||||
// questa classe è derivata da Controller.Response... x cui recupero lo stream in altro modo...
|
||||
// questa classe è derivata da Controller.Response... x cui recupero lo stream in
|
||||
// altro modo...
|
||||
string content = "";
|
||||
System.Web.HttpContext.Current.Request.InputStream.Position = 0;
|
||||
using (var reader = new StreamReader(Request.InputStream, System.Text.Encoding.UTF8, true, 4096, true))
|
||||
@@ -1340,16 +1238,11 @@ namespace MP_IO.Controllers
|
||||
return answ;
|
||||
|
||||
// esempio GWMS
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Salva MAC adress + IP dopo il reboot
|
||||
/// GET: IOB/sendReboot?idxMacchina=5&mac=18:C0:4D:37:3C:8C
|
||||
/// </summary>
|
||||
/// <param name="GWIP">IP del Gateway</param>
|
||||
/// <returns></returns>
|
||||
/// <summary> Salva MAC adress + IP dopo il reboot
|
||||
/// GET: IOB/sendReboot?idxMacchina=5&mac=18:C0:4D:37:3C:8C </summary> <param name="GWIP">IP
|
||||
/// del Gateway</param> <returns></returns>
|
||||
public string sendReboot(string idxMacchina, string mac)
|
||||
{
|
||||
string answ = "NO";
|
||||
@@ -1396,10 +1289,10 @@ namespace MP_IO.Controllers
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// SALVA Counter x macchina restituendo il valore appena inviato o, se mancasse chiave redis, del valore da DB
|
||||
/// SALVA Counter x macchina restituendo il valore appena inviato o, se mancasse chiave
|
||||
/// redis, del valore da DB
|
||||
///
|
||||
/// GET: IOB/setCounter/5?counter=10
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="id">cod macchina</param>
|
||||
/// <param name="counter">contapezzi da salvare</param>
|
||||
@@ -1490,7 +1383,8 @@ namespace MP_IO.Controllers
|
||||
}
|
||||
else
|
||||
{
|
||||
// questa classe è derivata da Controller.Response... x cui recupero lo stream in altro modo...
|
||||
// questa classe è derivata da Controller.Response... x cui recupero lo stream in
|
||||
// altro modo...
|
||||
string content = "";
|
||||
System.Web.HttpContext.Current.Request.InputStream.Position = 0;
|
||||
using (var reader = new StreamReader(Request.InputStream, System.Text.Encoding.UTF8, true, 4096, true))
|
||||
@@ -1548,6 +1442,125 @@ namespace MP_IO.Controllers
|
||||
return answ;
|
||||
}
|
||||
|
||||
//[HttpPost]
|
||||
//public string takeFlogSnapshot(string id, int maxSec)
|
||||
//{
|
||||
// string answ = "";
|
||||
// string caller = "takeFlogSnapshot(id)";
|
||||
|
||||
// answ = doSaveFLSnapshot(id, maxSec, caller);
|
||||
// return answ;
|
||||
//}
|
||||
|
||||
[HttpPost]
|
||||
public string takeFlogSnapshot(string id)
|
||||
{
|
||||
string answ = "";
|
||||
string caller = "takeFlogSnapshot(id)";
|
||||
|
||||
answ = doSaveFLSnapshot(id, 10, caller);
|
||||
return answ;
|
||||
}
|
||||
|
||||
// GET: IOB/ulog/SIMUL_03?flux=PROG&valore=P0001&dtEve=20161223180600000&dtCurr=20161223180600000&cnt=999&matrOpr=0=0&label=&valNum
|
||||
public string ulog(string id, string flux, string valore, string dtEve, string dtCurr, string cnt, string matrOpr, string label, string valNum)
|
||||
{
|
||||
string answ = "";
|
||||
// formato yyyymmddHHMMSSnnn ovvero da anno a millisecondi
|
||||
if (cnt == null)
|
||||
{
|
||||
cnt = "0";
|
||||
}
|
||||
|
||||
DateTime dataOraEvento = DateTime.Now;
|
||||
if (memLayer.ML.CRI("_logLevel") > 6)
|
||||
{
|
||||
logger.lg.scriviLog($"ulog | Valori letti: idxMacchina: {id} | flux: {flux} valore: {valore} | matrOpr: {matrOpr} | label: {label} | valNum: {valNum}", tipoLog.INFO);
|
||||
}
|
||||
try
|
||||
{
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
int count = 0;
|
||||
int nMatrOpr = 0;
|
||||
int nValNum = 0;
|
||||
Int32.TryParse(cnt, out count);
|
||||
Int32.TryParse(matrOpr, out nMatrOpr);
|
||||
Int32.TryParse(valNum, out nValNum);
|
||||
answ = DataLayerObj.processUserLog(id, flux, valore, dtEve, dtCurr, count, nMatrOpr, label, nValNum);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog($"Errore in ulog{Environment.NewLine}{exc}");
|
||||
answ = "NO";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processa una chiamata POST per l'invio di una List Json 1+ UserAction (contiene
|
||||
/// controlli, scarti, dichiarazioni)
|
||||
/// POST: IOB/ulogJson/SIMUL_03
|
||||
/// </summary>
|
||||
/// <param name="id">ID dell'IOB</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public string ulogJson(string id)
|
||||
{
|
||||
int insDone = 0;
|
||||
string answ = "-";
|
||||
// questa classe è derivata da Controller.Response... x cui recupero lo stream in altro modo...
|
||||
string content = "";
|
||||
System.Web.HttpContext.Current.Request.InputStream.Position = 0;
|
||||
using (var reader = new StreamReader(
|
||||
Request.InputStream, System.Text.Encoding.UTF8, true, 4096, true))
|
||||
{
|
||||
content = reader.ReadToEnd();
|
||||
}
|
||||
//Rest
|
||||
System.Web.HttpContext.Current.Request.InputStream.Position = 0;
|
||||
// se ho dati...
|
||||
if (content != "")
|
||||
{
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
// procedo a deserializzare in blocco l'oggetto...
|
||||
ulogJsonPayload receivedData = new ulogJsonPayload();
|
||||
try
|
||||
{
|
||||
// deserializzo.
|
||||
receivedData = JsonConvert.DeserializeObject<ulogJsonPayload>(content);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog($"Errore in fase deserializzazione ulogJson{Environment.NewLine}{exc}");
|
||||
answ = "NO";
|
||||
}
|
||||
// se ho qualcosa da processare...
|
||||
if (receivedData != null)
|
||||
{
|
||||
// per ogni valore --> salvo!
|
||||
try
|
||||
{
|
||||
foreach (var item in receivedData.fluxData)
|
||||
{
|
||||
// formato datetime come yyyyMMddHHmmssfff -->es: 20181223180600000
|
||||
answ = DataLayerObj.processUserLog(id, item.flux, item.valore, item.dtEve.ToString("yyyyMMddHHmmssfff"), item.dtCurr.ToString("yyyyMMddHHmmssfff"), item.cnt, item.matrOpr, item.label, item.valNum);
|
||||
}
|
||||
// se vuoto --> OK!
|
||||
if (string.IsNullOrEmpty(answ))
|
||||
{
|
||||
answ = $"OK {insDone} processed";
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog($"Errore in fase invio valori ulogJson{Environment.NewLine}{exc}");
|
||||
answ = "NO";
|
||||
}
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processa una chiamata POST per l'invio di un SET di file "a nome" di un IOB, formato MapoSDK.fileEmbed
|
||||
/// PUT: IOB/uploadFile/SIMUL_03
|
||||
@@ -1608,7 +1621,8 @@ namespace MP_IO.Controllers
|
||||
}
|
||||
else
|
||||
{
|
||||
// questa classe è derivata da Controller.Response... x cui recupero lo stream in altro modo...
|
||||
// questa classe è derivata da Controller.Response... x cui recupero lo stream in
|
||||
// altro modo...
|
||||
string content = "";
|
||||
System.Web.HttpContext.Current.Request.InputStream.Position = 0;
|
||||
using (var reader = new StreamReader(Request.InputStream, System.Text.Encoding.UTF8, true, 4096, true))
|
||||
@@ -1641,7 +1655,39 @@ namespace MP_IO.Controllers
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Effettua vera chiamata x salvataggio snapshot dati FluxLog
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="maxSec"></param>
|
||||
/// <param name="caller"></param>
|
||||
/// <returns></returns>
|
||||
private static string doSaveFLSnapshot(string id, int maxSec, string caller)
|
||||
{
|
||||
string answ;
|
||||
DateTime dataOraEvento = DateTime.Now;
|
||||
if (memLayer.ML.CRI("_logLevel") > 6)
|
||||
{
|
||||
logger.lg.scriviLog($"{caller} | Richiesta snapshot dati FluxLog macchina: idxMacchina: {id} ", tipoLog.INFO);
|
||||
}
|
||||
try
|
||||
{
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
answ = DataLayerObj.takeFlogSnapshot(id, maxSec);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog($"Errore in {caller}{Environment.NewLine}{exc}");
|
||||
answ = "NO";
|
||||
}
|
||||
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
+13
-11
@@ -1,32 +1,34 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <generato automaticamente>
|
||||
// Codice generato da uno strumento.
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se
|
||||
// il codice viene rigenerato.
|
||||
// </generato automaticamente>
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace MP_SITE
|
||||
{
|
||||
|
||||
|
||||
public partial class excelExportEventi
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Controllo gvEventi.
|
||||
/// gvEventi control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.GridView gvEventi;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo ods_EventList.
|
||||
/// ods_EventList control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ods_EventList;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<asp:Label ID="lblMacchina" runat="server" Text='<%# macchinaDaIdx(Eval("IdxMacchina")) %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="InizioStato" DataFormatString="{0:d}" HeaderText="Inizio Stato"
|
||||
<asp:BoundField DataField="InizioStato" DataFormatString="{0:yyyy-MM-dd HH:mm:ss}" HeaderText="Inizio Stato"
|
||||
ReadOnly="True" />
|
||||
<asp:TemplateField HeaderText="Stato">
|
||||
<ItemTemplate>
|
||||
|
||||
+11
-11
@@ -1,10 +1,10 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <generato automaticamente>
|
||||
// Codice generato da uno strumento.
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se
|
||||
// il codice viene rigenerato.
|
||||
// </generato automaticamente>
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace MP_SITE
|
||||
@@ -15,20 +15,20 @@ namespace MP_SITE
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Controllo gvStati.
|
||||
/// gvStati control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.GridView gvStati;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo ods_DiarioDiBordo.
|
||||
/// ods_DiarioDiBordo control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ods_DiarioDiBordo;
|
||||
}
|
||||
|
||||
+8
-8
@@ -30,16 +30,16 @@
|
||||
<add key="AutoCleanUpInterval" value="10" />
|
||||
<add key="ChartImageHandler" value="storage=file;timeout=30;" />
|
||||
<!--DB 2016-->
|
||||
<add key="DbConfConnectionString" value="Data Source=SQL2016PROD;Initial Catalog=Jetco_MoonPro_Prod;Persist Security Info=True;User ID=sa;Password=keyhammer16;" />
|
||||
<add key="MoonProConnectionString" value="Data Source=SQL2016PROD;Initial Catalog=Jetco_MoonPro_Prod;Persist Security Info=True;User ID=sa;Password=keyhammer16;" />
|
||||
<add key="PermessiConnectionString" value="Data Source=SQL2016PROD;Initial Catalog=Jetco_MoonPro_Prod;Persist Security Info=True;User ID=sa;Password=keyhammer16;" />
|
||||
<add key="UtenteCdcConnectionString" value="Data Source=SQL2016PROD;Initial Catalog=Jetco_Anagrafica_prod;Persist Security Info=True;User ID=sa;Password=keyhammer16;" />
|
||||
<add key="VocabolarioConnectionString" value="Data Source=SQL2016PROD;Initial Catalog=Jetco_MoonPro_Prod;Persist Security Info=True;User ID=sa;Password=keyhammer16;" />
|
||||
<add key="DbConfConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=MoonPro;Persist Security Info=True;User ID=sa;Password=keyhammer16;" />
|
||||
<add key="MoonProConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=MoonPro;Persist Security Info=True;User ID=sa;Password=keyhammer16;" />
|
||||
<add key="PermessiConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=MoonPro;Persist Security Info=True;User ID=sa;Password=keyhammer16;" />
|
||||
<add key="UtenteCdcConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=Jetco_Anagrafica_prod;Persist Security Info=True;User ID=sa;Password=keyhammer16;" />
|
||||
<add key="VocabolarioConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=MoonPro;Persist Security Info=True;User ID=sa;Password=keyhammer16;" />
|
||||
</appSettings>
|
||||
<connectionStrings>
|
||||
<add name="MoonProConnectionString" connectionString="Data Source=SQL2016PROD;Initial Catalog=Jetco_MoonPro_Prod;Persist Security Info=True;User ID=sa;Password=keyhammer16;" providerName="System.Data.SqlClient" />
|
||||
<add name="MapoDb.Properties.Settings.MoonProConnectionString" connectionString="Data Source=SQL2016PROD;Initial Catalog=Jetco_MoonPro_Prod;Persist Security Info=True;User ID=sa;Password=keyhammer16;" providerName="System.Data.SqlClient" />
|
||||
<add name="ErrorLog" connectionString="Data Source=SQL2016PROD;Initial Catalog=Elmah;Persist Security Info=True;User ID=sa;Password=keyhammer16;" providerName="System.Data.SqlClient" />
|
||||
<add name="MoonProConnectionString" connectionString="Data Source=SQL2016DEV;Initial Catalog=MoonPro;Persist Security Info=True;User ID=sa;Password=keyhammer16;" providerName="System.Data.SqlClient" />
|
||||
<add name="MapoDb.Properties.Settings.MoonProConnectionString" connectionString="Data Source=SQL2016DEV;Initial Catalog=MoonPro;Persist Security Info=True;User ID=sa;Password=keyhammer16;" providerName="System.Data.SqlClient" />
|
||||
<add name="ErrorLog" connectionString="Data Source=SQL2016DEV;Initial Catalog=Elmah;Persist Security Info=True;User ID=sa;Password=keyhammer16;" providerName="System.Data.SqlClient" />
|
||||
</connectionStrings>
|
||||
<system.web>
|
||||
<httpHandlers>
|
||||
|
||||
Generated
+42
-1
@@ -28802,7 +28802,7 @@ SELECT IdxMacchina, dtEvento, CodFlux, Valore, Cnt FROM FluxLog WHERE (CodFlux =
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||
private void InitCommandCollection() {
|
||||
this._commandCollection = new global::System.Data.SqlClient.SqlCommand[6];
|
||||
this._commandCollection = new global::System.Data.SqlClient.SqlCommand[7];
|
||||
this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
|
||||
this._commandCollection[0].Connection = this.Connection;
|
||||
this._commandCollection[0].CommandText = "SELECT * FROM dbo.FluxLog";
|
||||
@@ -28858,6 +28858,13 @@ SELECT IdxMacchina, dtEvento, CodFlux, Valore, Cnt FROM FluxLog WHERE (CodFlux =
|
||||
this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodFlux", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
|
||||
this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Valore", global::System.Data.SqlDbType.NVarChar, 250, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
|
||||
this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Count", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
|
||||
this._commandCollection[6] = new global::System.Data.SqlClient.SqlCommand();
|
||||
this._commandCollection[6].Connection = this.Connection;
|
||||
this._commandCollection[6].CommandText = "dbo.stp_FL_TakeSnapshot";
|
||||
this._commandCollection[6].CommandType = global::System.Data.CommandType.StoredProcedure;
|
||||
this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
|
||||
this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IdxMacchina", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
|
||||
this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MaxSec", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
@@ -29302,6 +29309,40 @@ SELECT IdxMacchina, dtEvento, CodFlux, Valore, Cnt FROM FluxLog WHERE (CodFlux =
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
|
||||
public virtual int takeSnapshot(string IdxMacchina, global::System.Nullable<int> MaxSec) {
|
||||
global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[6];
|
||||
if ((IdxMacchina == null)) {
|
||||
command.Parameters[1].Value = global::System.DBNull.Value;
|
||||
}
|
||||
else {
|
||||
command.Parameters[1].Value = ((string)(IdxMacchina));
|
||||
}
|
||||
if ((MaxSec.HasValue == true)) {
|
||||
command.Parameters[2].Value = ((int)(MaxSec.Value));
|
||||
}
|
||||
else {
|
||||
command.Parameters[2].Value = global::System.DBNull.Value;
|
||||
}
|
||||
global::System.Data.ConnectionState previousConnectionState = command.Connection.State;
|
||||
if (((command.Connection.State & global::System.Data.ConnectionState.Open)
|
||||
!= global::System.Data.ConnectionState.Open)) {
|
||||
command.Connection.Open();
|
||||
}
|
||||
int returnValue;
|
||||
try {
|
||||
returnValue = command.ExecuteNonQuery();
|
||||
}
|
||||
finally {
|
||||
if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
|
||||
command.Connection.Close();
|
||||
}
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
+224
-212
File diff suppressed because it is too large
Load Diff
@@ -4,7 +4,7 @@
|
||||
Changes to this file may cause incorrect behavior and will be lost if
|
||||
the code is regenerated.
|
||||
</autogenerated>-->
|
||||
<DiagramLayout xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ex:showrelationlabel="False" ViewPortX="-10" ViewPortY="820" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
|
||||
<DiagramLayout xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ex:showrelationlabel="False" ViewPortX="-10" ViewPortY="869" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
|
||||
<Shapes>
|
||||
<Shape ID="DesignTable:Macchine2FamiglieMacchine" ZOrder="30" X="553" Y="715" Height="115" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="64" />
|
||||
<Shape ID="DesignTable:FamiglieMacchine" ZOrder="32" X="519" Y="1007" Height="115" Width="249" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="64" />
|
||||
|
||||
+741
-628
File diff suppressed because it is too large
Load Diff
+64
-35
@@ -20,27 +20,6 @@ namespace MapoSDK
|
||||
error
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tipologia dato Raw Transfer
|
||||
/// </summary>
|
||||
/// serializzazione Native
|
||||
/// [JsonConverter(typeof(JsonStringEnumConverter))]
|
||||
/// serializzazione Newtonsoft json
|
||||
/// [JsonConverter(typeof(StringEnumConverter))]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum rawTransfType
|
||||
{
|
||||
ND = 0,
|
||||
/// <summary>
|
||||
/// Icoel: Batch info
|
||||
/// </summary>
|
||||
IcoelBatch,
|
||||
/// <summary>
|
||||
/// Icoel: Variety + layout info relative
|
||||
/// </summary>
|
||||
IcoelVarInfo
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tipo di IOB
|
||||
/// </summary>
|
||||
@@ -80,7 +59,7 @@ namespace MapoSDK
|
||||
InputRegister = 3,
|
||||
|
||||
/// <summary>
|
||||
/// ModBus Holding Register 4xxxxx (int[] convertibile a vari int/real) - OUT R/W
|
||||
/// ModBus Holding Register 4xxxxx (int[] convertibile a vari int/real) - OUT R/W
|
||||
/// </summary>
|
||||
HoldingRegister = 4
|
||||
}
|
||||
@@ -100,11 +79,21 @@ namespace MapoSDK
|
||||
/// </summary>
|
||||
Int,
|
||||
|
||||
/// <summary>
|
||||
/// Tipo UInt16 reversed LowHigh
|
||||
/// </summary>
|
||||
IntLH,
|
||||
|
||||
/// <summary>
|
||||
/// Tipo Int32 intero 32bit
|
||||
/// </summary>
|
||||
DInt,
|
||||
|
||||
/// <summary>
|
||||
/// Tipo UInt32 reversed LowHigh
|
||||
/// </summary>
|
||||
DIntLH,
|
||||
|
||||
/// <summary>
|
||||
/// Tipo UInt16, intero 16bit
|
||||
/// </summary>
|
||||
@@ -142,36 +131,73 @@ namespace MapoSDK
|
||||
|
||||
/// <summary>
|
||||
/// Tipo FLOAT 32 bit con endiannes standard (es modbus)
|
||||
/// https://www.scadacore.com/tools/programming-calculators/online-hex-converter/
|
||||
/// Float - Big Endian (ABCD)
|
||||
/// https://www.scadacore.com/tools/programming-calculators/online-hex-converter/ Float -
|
||||
/// Big Endian (ABCD)
|
||||
/// </summary>
|
||||
FloatABCD,
|
||||
|
||||
/// <summary>
|
||||
/// Tipo FLOAT 32 bit con endiannes NON standard (es modbus)
|
||||
/// https://www.scadacore.com/tools/programming-calculators/online-hex-converter/
|
||||
/// Float - Mid-Big Endian (BADC)
|
||||
/// https://www.scadacore.com/tools/programming-calculators/online-hex-converter/ Float -
|
||||
/// Mid-Big Endian (BADC)
|
||||
/// </summary>
|
||||
FloatBADC,
|
||||
|
||||
/// <summary>
|
||||
/// Tipo FLOAT 32 bit con endiannes NON standard (es modbus)
|
||||
/// https://www.scadacore.com/tools/programming-calculators/online-hex-converter/
|
||||
/// Float - Mid-Little Endian (CDAB)
|
||||
/// https://www.scadacore.com/tools/programming-calculators/online-hex-converter/ Float -
|
||||
/// Mid-Little Endian (CDAB)
|
||||
/// </summary>
|
||||
FloatCDAB,
|
||||
|
||||
/// <summary>
|
||||
/// Tipo FLOAT 32 bit con endiannes NON standard (es modbus)
|
||||
/// https://www.scadacore.com/tools/programming-calculators/online-hex-converter/
|
||||
/// Float - Little Endian (DCBA)
|
||||
/// https://www.scadacore.com/tools/programming-calculators/online-hex-converter/ Float -
|
||||
/// Little Endian (DCBA)
|
||||
/// </summary>
|
||||
FloatDCBA,
|
||||
|
||||
/// <summary>
|
||||
/// Valore bitmap, inteso come array di bit ognuno da trattare come uno stato on/off indipendente e sommabile (es allarmi)
|
||||
/// Valore bitmap, inteso come array di bit ognuno da trattare come uno stato on/off
|
||||
/// indipendente e sommabile (es allarmi)
|
||||
/// </summary>
|
||||
BitMap
|
||||
BitMap,
|
||||
|
||||
/// <summary>
|
||||
/// Tipo Byte 8 bit equivalente a BitMap
|
||||
/// </summary>
|
||||
Byte,
|
||||
|
||||
/// <summary>
|
||||
/// Tipo UInt16 intero senza segno 16bit
|
||||
/// </summary>
|
||||
UInt,
|
||||
|
||||
/// <summary>
|
||||
/// Tipo UInt32 intero senza segno 32bit
|
||||
/// </summary>
|
||||
UDInt
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tipologia dato Raw Transfer
|
||||
/// </summary>
|
||||
/// serializzazione Native [JsonConverter(typeof(JsonStringEnumConverter))] serializzazione
|
||||
/// Newtonsoft json [JsonConverter(typeof(StringEnumConverter))]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum rawTransfType
|
||||
{
|
||||
ND = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Icoel: Batch info
|
||||
/// </summary>
|
||||
IcoelBatch,
|
||||
|
||||
/// <summary>
|
||||
/// Icoel: Variety + layout info relative
|
||||
/// </summary>
|
||||
IcoelVarInfo
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -251,7 +277,8 @@ namespace MapoSDK
|
||||
setProg,
|
||||
|
||||
/// <summary>
|
||||
/// Indica al PLC di impostare il numero di pezzi da produrre per la commessa (impostato come value)
|
||||
/// Indica al PLC di impostare il numero di pezzi da produrre per la commessa (impostato
|
||||
/// come value)
|
||||
/// </summary>
|
||||
setPzComm,
|
||||
|
||||
@@ -306,7 +333,8 @@ namespace MapoSDK
|
||||
nd,
|
||||
|
||||
/// <summary>
|
||||
/// identifica una matricola operatore nel formato OPxxxxx (xxxxx è un intero che rappresenta la matricola, std fino a 8 cifre)
|
||||
/// identifica una matricola operatore nel formato OPxxxxx (xxxxx è un intero che
|
||||
/// rappresenta la matricola, std fino a 8 cifre)
|
||||
/// </summary>
|
||||
matrOperatore,
|
||||
|
||||
@@ -326,7 +354,8 @@ namespace MapoSDK
|
||||
confermaProduzione,
|
||||
|
||||
/// <summary>
|
||||
/// identifica un cartellino di dichiarazione fermata nel formato FExxxx dove xxxx è idxEvento dichiarato...
|
||||
/// identifica un cartellino di dichiarazione fermata nel formato FExxxx dove xxxx è
|
||||
/// idxEvento dichiarato...
|
||||
/// </summary>
|
||||
dichiaraFermata,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user