Merge branch 'release/UpdateMpIoParamUntrack'

This commit is contained in:
Samuele Locatelli
2022-07-14 11:23:30 +02:00
4 changed files with 33 additions and 11 deletions
+4 -3
View File
@@ -154,6 +154,7 @@ namespace MP_IO.Controllers
// 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
@@ -1508,14 +1509,14 @@ namespace MP_IO.Controllers
if (currParams != null)
{
DataLayer DataLayerObj = new DataLayer();
DataLayerObj.setCurrObjItems(id, currParams);
answ = "OK";
bool fatto = DataLayerObj.setCurrObjItems(id, currParams);
answ = fatto ? "OK" : "KO";
}
}
catch (Exception exc)
{
logger.lg.scriviLog($"Errore in setCurrParams{Environment.NewLine}{exc}");
answ = "NO";
answ = "EXC";
}
}
return answ;
+15 -5
View File
@@ -3622,7 +3622,7 @@ namespace MapoDb
gestEmail.geAuth.mandaEmail(mittente, destinatario, oggetto, corpo);
fatto = true;
}
catch(Exception exc)
catch (Exception exc)
{
logger.lg.scriviLog($"Eccezione in sendEmail{Environment.NewLine}{exc}", tipoLog.ERROR);
}
@@ -3679,13 +3679,23 @@ namespace MapoDb
foreach (var item in currValues)
{
// se fosse un valore WRITE e mi ha dato un valore vuoto --> mando un fix x riscrittura
if (item.writable && string.IsNullOrEmpty(item.value))
if (item.writable && (string.IsNullOrEmpty(item.value) || string.IsNullOrEmpty(item.reqValue)))
{
logger.lg.scriviLog($"setCurrObjItems | parametro empty | {item.uid} | reqVal: {item.reqValue}");
taskType currTask = (taskType)Enum.Parse(typeof(taskType), item.uid);
addCheckTask4Machine(idxMacchina, currTask, item.value);
logger.lg.scriviLog($"setCurrObjItems | parametro empty | {item.uid} | Value: {item.value} | reqVal: {item.reqValue}");
// se è un parametro dei "task principali...
try
{
taskType currTask = (taskType)Enum.Parse(typeof(taskType), item.uid);
string newVal = !string.IsNullOrEmpty(item.reqValue) ? item.reqValue : $"{item.value}";
addCheckTask4Machine(idxMacchina, currTask, newVal);
}
catch (Exception exc)
{
logger.lg.scriviLog($"Eccezione in setCurrObjItems in fase di riaccodamento{Environment.NewLine}{exc}");
}
}
}
answ = true;
}
return answ;
}
+10
View File
@@ -120,6 +120,16 @@ namespace MapoSDK
/// </summary>
Real,
/// <summary>
/// Tipo REAL 32 bit standard (HighLow) - sinonimo di Real, creato x simmetria con caso LH
/// </summary>
RealHL,
/// <summary>
/// Tipo REAL 32 bit con swap byte (LowHigh) al posto del normale caso HL (HighLow)
/// </summary>
RealLH,
/// <summary>
/// Tipo stringa
/// </summary>
+4 -3
View File
@@ -1,5 +1,6 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
@@ -160,7 +161,7 @@ namespace MapoSDK
/// <summary>
/// Messaggio in modalità raw/stringa
/// </summary>
public object mesContent { get; set; } = null;
public JObject mesContent { get; set; } = new JObject();
/// <summary>
/// Tipo di messaggio trasmesso
@@ -173,7 +174,7 @@ namespace MapoSDK
public BaseRawTransf()
{
this.dataRif = DateTime.Now;
this.mesContent = "";
this.mesContent = new JObject();
this.mesType = rawTransfType.ND;
}
@@ -183,7 +184,7 @@ namespace MapoSDK
/// <param name="dataRif"></param>
/// <param name="mesContent"></param>
/// <param name="mesType"></param>
public BaseRawTransf(DateTime dataRif, object mesContent, rawTransfType mesType)
public BaseRawTransf(DateTime dataRif, JObject mesContent, rawTransfType mesType)
{
this.dataRif = dataRif;
this.mesContent = mesContent;