Pulizia codice trend analysis + fix wait udpate task
This commit is contained in:
@@ -112,7 +112,7 @@ namespace MP.Stats.Pages
|
||||
switch (value)
|
||||
{
|
||||
case ResolutionLevel.Low:
|
||||
MaxPoints = NumPoint(SelCount, numSel , 32 , 32);
|
||||
MaxPoints = NumPoint(SelCount, numSel, 32, 32);
|
||||
break;
|
||||
|
||||
case ResolutionLevel.Med:
|
||||
@@ -126,49 +126,11 @@ namespace MP.Stats.Pages
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#if false
|
||||
switch (value)
|
||||
{
|
||||
case ResolutionLevel.Low:
|
||||
MaxPoints = (int)Math.Round(SelCount / numSel / 32 / (double)scale) * scale;
|
||||
break;
|
||||
|
||||
case ResolutionLevel.Med:
|
||||
MaxPoints = (int)Math.Round(SelCount / numSel / 8 / (double)scale) * scale;
|
||||
break;
|
||||
|
||||
case ResolutionLevel.High:
|
||||
MaxPoints = (int)Math.Round(SelCount / numSel / (double)scale) * scale;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#if false
|
||||
// limite minimo 256...
|
||||
MaxPoints = MaxPoints < 256 ? 256 : MaxPoints;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calcola num punti dato
|
||||
/// </summary>
|
||||
/// <param name="selCount">Numero totale valori</param>
|
||||
/// <param name="numSel">Numero partizioni (oggetti da disegnare insieme)</param>
|
||||
/// <param name="factor">Fattore di scala richiesto</param>
|
||||
/// <param name="scale">Fattore di scala (=valore minimo garantito)</param>
|
||||
/// <returns></returns>
|
||||
private int NumPoint(int selCount, int numSel, int factor, double scale)
|
||||
{
|
||||
int calcVal = (int)Math.Round((double)(selCount * scale) / numSel / factor / (double)scale);
|
||||
|
||||
return calcVal > scale ? calcVal : (int)scale;
|
||||
}
|
||||
|
||||
[Inject]
|
||||
protected MpStatsService StatService { get; set; }
|
||||
|
||||
@@ -200,10 +162,6 @@ namespace MP.Stats.Pages
|
||||
|
||||
protected async Task ResetFilter(SelectData newFilter)
|
||||
{
|
||||
#if false
|
||||
SearchRecords = null;
|
||||
CalcFilt();
|
||||
#endif
|
||||
SearchRecords = null;
|
||||
PlotRecords = null;
|
||||
currFilter = SelectData.Init(5, 7);
|
||||
@@ -241,11 +199,15 @@ namespace MP.Stats.Pages
|
||||
#region Private Fields
|
||||
|
||||
private int _maxPoints = 256;
|
||||
|
||||
private ResolutionLevel _reqRes = ResolutionLevel.Med;
|
||||
|
||||
private List<ConfigModel> ConfigList;
|
||||
|
||||
private int MaxDisplay = 10;
|
||||
|
||||
private int NumMacc = 0;
|
||||
|
||||
private List<FLModel> PlotRecords = new List<FLModel>();
|
||||
|
||||
/// <summary>
|
||||
@@ -275,19 +237,6 @@ namespace MP.Stats.Pages
|
||||
|
||||
#region Private Methods
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Calcola il filtro alla data necessaria x arrivare al confronto x mese...
|
||||
/// </summary>
|
||||
private void CalcFilt()
|
||||
{
|
||||
DateTime oggi = DateTime.Now.Date;
|
||||
DateTime inizio = new DateTime(oggi.Year, oggi.Month, 1).AddMonths(-1);
|
||||
int numPrev = (int)oggi.Subtract(inizio).TotalDays;
|
||||
currFilter = SelectData.Init(5, numPrev);
|
||||
}
|
||||
#endif
|
||||
|
||||
private string confVal(string chiave)
|
||||
{
|
||||
string answ = "";
|
||||
@@ -346,6 +295,21 @@ namespace MP.Stats.Pages
|
||||
ListMacchine = await StatService.MachineList(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calcola num punti dato
|
||||
/// </summary>
|
||||
/// <param name="selCount">Numero totale valori</param>
|
||||
/// <param name="numSel">Numero partizioni (oggetti da disegnare insieme)</param>
|
||||
/// <param name="factor">Fattore di scala richiesto</param>
|
||||
/// <param name="scale">Fattore di scala (=valore minimo garantito)</param>
|
||||
/// <returns></returns>
|
||||
private int NumPoint(int selCount, int numSel, int factor, double scale)
|
||||
{
|
||||
int calcVal = (int)Math.Round((double)(selCount * scale) / numSel / factor / (double)scale);
|
||||
|
||||
return calcVal > scale ? calcVal : (int)scale;
|
||||
}
|
||||
|
||||
private async Task ReloadData()
|
||||
{
|
||||
isLoading = true;
|
||||
|
||||
@@ -328,6 +328,7 @@ namespace MP.TaskMan.Services
|
||||
public async Task<bool> TaskListReorder(int codGroup)
|
||||
{
|
||||
bool dbResult = MLController.TaskListReorder(codGroup);
|
||||
await Task.Delay(50);
|
||||
// svuoto cache!
|
||||
await FlushCacheAsync();
|
||||
return dbResult;
|
||||
|
||||
Reference in New Issue
Block a user