Inizio add gestione invio eventi in blocco
This commit is contained in:
@@ -170,7 +170,7 @@ namespace IOB_WIN
|
||||
MPURL = MPURL_;
|
||||
CMDBASE = CMDBASE_;
|
||||
CMDFLOG = CMDFLOG_;
|
||||
CMDBASE_JSON = CMDBASE_.Replace("input", "inputJson");
|
||||
CMDBASE_JSON = CMDBASE_.Replace("input", "evListJson");
|
||||
CMDFLOG_JSON = CMDFLOG_.Replace("flog", "flogJson");
|
||||
CMDALIVE = CMDALIVE_;
|
||||
CMDENABLED = CMDENABLED_;
|
||||
|
||||
+35
-4
@@ -2493,7 +2493,7 @@ namespace IOB_WIN
|
||||
/// <summary>
|
||||
/// Restituisce un payload in formato json della lista di valori ricevuta
|
||||
/// </summary>
|
||||
/// <param name="tipoUrl">Tipo di URL (eventi / FLog</param>
|
||||
/// <param name="tipoUrl">Tipo di URL (eventi / FLog)</param>
|
||||
/// <param name="elencoValori">elenco di valori da coda string salvata</param>
|
||||
/// <returns></returns>
|
||||
public string jsonPayload(urlType tipoUrl, List<string> elencoValori)
|
||||
@@ -2502,7 +2502,7 @@ namespace IOB_WIN
|
||||
if (tipoUrl == urlType.FLog)
|
||||
{
|
||||
flogData currData = new flogData();
|
||||
flogJson fullObj = new flogJson();
|
||||
flogJsonPayload fullObj = new flogJsonPayload();
|
||||
fullObj.fluxData = new List<flogData>();
|
||||
string[] valori;
|
||||
int counter = 0;
|
||||
@@ -2536,8 +2536,39 @@ namespace IOB_WIN
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// !!!FIXME!!! fare x invio dati normali...
|
||||
{
|
||||
evData currData = new evData();
|
||||
evJsonPayload fullObj = new evJsonPayload();
|
||||
fullObj.eventList = new List<evData>();
|
||||
string[] valori;
|
||||
int counter = 0;
|
||||
DateTime dtEve = DateTime.Now;
|
||||
// inizio processando ogni valore
|
||||
foreach (var item in elencoValori)
|
||||
{
|
||||
valori = qDecodeIN(item);
|
||||
//DateTime.TryParse(valori[0], out dtEve);
|
||||
CultureInfo provider = CultureInfo.InvariantCulture;
|
||||
DateTime.TryParseExact(valori[0], "yyyyMMddHHmmssfff", provider, DateTimeStyles.AssumeLocal, out dtEve);
|
||||
int.TryParse(valori[2], out counter);
|
||||
currData = new evData()
|
||||
{
|
||||
valore = valori[1],
|
||||
dtEve = dtEve,
|
||||
dtCurr = DateTime.Now,
|
||||
cnt = counter
|
||||
};
|
||||
fullObj.eventList.Add(currData);
|
||||
}
|
||||
// conversione finale
|
||||
try
|
||||
{
|
||||
answ = JsonConvert.SerializeObject(fullObj);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
lgError($"Errore in costruzione jsonPayload:{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user