Update decoder
- gestione nuovo tipo di allarmi - db doppia registrazione
This commit is contained in:
@@ -95,11 +95,59 @@ namespace MP.MONO.UI.Data
|
||||
|
||||
#region Public Methods
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Elenco records anagrafica allarmi
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<AlarmListModel>> AlarmListGetAll()
|
||||
{
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
var dbResult = dbController.AlarmListGetAll();
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB AlarmListGetAll: {ts.TotalMilliseconds} ms");
|
||||
return await Task.FromResult(dbResult);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inserisce nuovo record in anagrafica allarmi dato testo (o restituisce se esistente)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<AlarmListModel?> AlarmListInsert(string AlarmText)
|
||||
{
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
var dbResult = dbController.AlarmListInsert(AlarmText);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB AlarmListInsert: {ts.TotalMilliseconds} ms");
|
||||
return await Task.FromResult(dbResult);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Chiude ultimo record dato Id (se fossero + di 1 chiude tutti...)
|
||||
/// </summary>
|
||||
/// <param name="AlarmId">Id Allarme</param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> AlarmRecCloseActive(int AlarmId)
|
||||
{
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
var dbResult = await dbController.AlarmRecCloseActive(AlarmId);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB AlarmRecCloseActive: {ts.TotalMilliseconds} ms");
|
||||
return await Task.FromResult(dbResult);
|
||||
}
|
||||
|
||||
public async Task<List<AlarmLogModel>> AlarmLogGetFilt(int machineId, int skipRec, int numRec)
|
||||
{
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
List<AlarmLogModel>? dbResult = dbController.AlarmLogGetFilt(machineId, skipRec, numRec);
|
||||
var dbResult = dbController.AlarmLogGetFilt(machineId, skipRec, numRec);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB AlarmLogGetFilt: {ts.TotalMilliseconds} ms");
|
||||
@@ -110,7 +158,7 @@ namespace MP.MONO.UI.Data
|
||||
{
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
List<DataLogModel>? dbResult = dbController.DataLogGetFilt(machineId, fluxType, inizio, fine);
|
||||
var dbResult = dbController.DataLogGetFilt(machineId, fluxType, inizio, fine);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB ParamLogGetFilt: {ts.TotalMilliseconds} ms");
|
||||
|
||||
Reference in New Issue
Block a user