Modifica x fornire dati JSON x pagina MSE

This commit is contained in:
Samuele E. Locatelli
2019-04-03 18:39:37 +02:00
parent 9f610aa90d
commit 59a6b10091
+21 -3
View File
@@ -19,6 +19,23 @@ namespace MP_MON.Controllers
return SingleStatus(baseCss, "***ALL***");
}
/// <summary>
/// Output MSE in formato string/json
/// </summary>
public string getData(string id)
{
int dataRefresh = 2000;
string answ = "";
answ = dataSer;
if (answ == null || answ == "")
{
var dati = db.stp_MSE_getData(dataRefresh).ToList();
// serializzo
answ = JsonConvert.SerializeObject(dati);
dataSer = answ;
}
return answ;
}
// GET: StatusMap
public ActionResult SingleStatus(string baseCss, string IdxMacchina)
{
@@ -37,7 +54,7 @@ namespace MP_MON.Controllers
dataRefresh = Convert.ToInt32(System.Web.Configuration.WebConfigurationManager.AppSettings["dataRefreshMs"]);
}
catch
{ }
{ }
List<MappaStatoExpl> dati = new List<MappaStatoExpl>();
if (dataSer != "" && dataSer != null)
{
@@ -46,7 +63,7 @@ namespace MP_MON.Controllers
dati = JsonConvert.DeserializeObject<List<MappaStatoExpl>>(dataSer);
}
catch (Exception exc)
{
{
getDbSaveRedis(dataRefresh, hMSE, out dati);
logger.lg.scriviLog(string.Format("Recuperata MSE da DB{0}{1}", Environment.NewLine, exc));
}
@@ -110,7 +127,7 @@ namespace MP_MON.Controllers
return memLayer.ML.getRSV(hMSE);
}
set
{
{
memLayer.ML.setRSV(hMSE, value, memLayer.ML.CRI("MSE_cacheDuration"));
}
}
@@ -123,5 +140,6 @@ namespace MP_MON.Controllers
}
base.Dispose(disposing);
}
}
}