Compare commits

...

3 Commits

Author SHA1 Message Date
Samuele Locatelli 98119d4818 Merge branch 'Release/CloneDossResValueEdit' 2022-11-07 10:16:44 +01:00
Samuele Locatelli ed2c694abd Fix duplicazione x valori edit 2022-11-07 09:34:30 +01:00
Samuele Locatelli c70ce33f26 Merge tag 'FIxArtInsertDelete' into develop
Update reset cache x edit articoli...
2022-11-04 18:11:07 +01:00
8 changed files with 51 additions and 46 deletions
+3 -2
View File
@@ -128,7 +128,7 @@ namespace MP.SPEC.Components
IdxMacchina = selRec.IdxMacchina,
CodArticolo = selRec.CodArticolo,
IdxODL = 0,
Valore = selRec.Valore,
Valore = selRec.Valore
};
currRecordClone = newRec;
await Task.Delay(1);
@@ -160,7 +160,7 @@ namespace MP.SPEC.Components
protected async Task newDossier(DossierModel selRec)
{
var alert = await JSRuntime.InvokeAsync<bool>("confirm", "Confermi di voler creare un nuovo Dossier per l'impianto/articolo selezioanto?");
var alert = await JSRuntime.InvokeAsync<bool>("confirm", "Confermi di voler creare un nuovo Dossier per l'impianto/articolo selezionato?");
if (alert)
{
@@ -184,6 +184,7 @@ namespace MP.SPEC.Components
{
item.IdxMacchina = selRec.IdxMacchina;
item.Valore = "0";
item.ValoreEdit = "0";
item.dtEvento = DateTime.Now;
}
}
-25
View File
@@ -163,7 +163,6 @@ namespace MP.SPEC.Components
protected async Task resetSel()
{
currRecord = null;
setDtMax();
await RecordSel.InvokeAsync(null);
}
@@ -246,31 +245,7 @@ namespace MP.SPEC.Components
get => SelFilter.dtMax;
set => SelFilter.dtMax = value;
}
protected void setDtMax()
{
// copio il filtro
var currFilt = SelFilter;
// fermo update
//currFilt.LiveUpdate = true;
currFilt.CurrPage = 0;
currFilt.lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
currFilt.dtMax = RoundDatetime(5);
currFilt.dtMin = RoundDatetime(5).AddHours(-25);
SelFilter = currFilt;
}
/// <summary>
/// Inizializzazione con periodo e arrotondamento
/// </summary>
/// <param name="minRound"></param>
/// <returns></returns>
public static DateTime RoundDatetime(int minRound)
{
TimeSpan DayElapsed = DateTime.Now.Subtract(DateTime.Today);
int minDay = (int)Math.Ceiling((double)(DayElapsed.TotalMinutes / minRound)) * minRound;
DateTime endRounded = DateTime.Today.AddMinutes(minDay);
return endRounded;
}
private int totalCount
{
get => _totalCount;
+21 -10
View File
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Components;
using MP.Data;
using MP.SPEC.Data;
namespace MP.SPEC.Components
@@ -24,10 +25,7 @@ namespace MP.SPEC.Components
/// <returns></returns>
public static DateTime RoundDatetime(int minRound)
{
TimeSpan DayElapsed = DateTime.Now.Subtract(DateTime.Today);
int minDay = (int)Math.Ceiling((double)(DayElapsed.TotalMinutes / minRound)) * minRound;
DateTime endRounded = DateTime.Today.AddMinutes(minDay);
return endRounded;
return Utils.InitDatetime(DateTime.Now, minRound);
}
public void Dispose()
@@ -172,9 +170,9 @@ namespace MP.SPEC.Components
protected override async Task OnInitializedAsync()
{
SelFilter = new SelectFluxParams();
setDtMax();
DateTime dtStart = SelFilter.dtMin != null ? (DateTime)SelFilter.dtMin : DateTime.Now.AddDays(-7);
DateTime dtEnd = SelFilter.dtMax != null ? (DateTime)SelFilter.dtMax : DateTime.Now;
setDtSnap();
DateTime dtStart = SelFilter.dtMin != null ? (DateTime)SelFilter.dtMin : DateTime.Now.AddMonths(-1);
DateTime dtEnd = SelFilter.dtMax != null ? (DateTime)SelFilter.dtMax : DateTime.Today.AddDays(1);
ListMacchine = await MDService.MacchineWithFlux(dtStart, dtEnd);
ListFlux = await MDService.ParametriGetFilt(selMacchina);
@@ -190,7 +188,7 @@ namespace MP.SPEC.Components
await FilterChanged.InvokeAsync(SelFilter);
}
protected void setDtMax()
protected void setDtSnap()
{
// copio il filtro
var currFilt = SelFilter;
@@ -199,7 +197,7 @@ namespace MP.SPEC.Components
currFilt.CurrPage = 0;
currFilt.lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
currFilt.dtMax = RoundDatetime(5);
currFilt.dtMin = RoundDatetime(5).AddHours(-numOreAnticipoSnapshot);
currFilt.dtSnapMin = RoundDatetime(5).AddHours(-numOreAnticipoSnapshot);
SelFilter = currFilt;
}
@@ -226,7 +224,7 @@ namespace MP.SPEC.Components
liveUpdate = false;
// se non ho data rif uso adesso...
DateTime dtMax = selDtMax == null ? RoundDatetime(5) : (DateTime)selDtMax;
DateTime dtMin = selDtMin == null ? RoundDatetime(5).AddHours(-numOreAnticipoSnapshot) : (DateTime)selDtMin;
DateTime dtMin = selDtSnapMin == null ? RoundDatetime(5).AddHours(-numOreAnticipoSnapshot) : (DateTime)selDtSnapMin;
// aggiungo 15 sec
dtMax = dtMax.AddSeconds(15);
await MDService.DossiersTakeParamsSnapshotLast(selMacchina, dtMin, dtMax);
@@ -314,6 +312,19 @@ namespace MP.SPEC.Components
}
}
private DateTime? selDtSnapMin
{
get => SelFilter.dtSnapMin;
set
{
if (SelFilter.dtSnapMin != value)
{
SelFilter.dtSnapMin = value;
reportChange();
}
}
}
private bool showEditPar { get; set; } = false;
private string snapMode
+23 -5
View File
@@ -5,7 +5,11 @@
#region Public Constructors
public SelectFluxParams()
{ }
{
dtMin = DateTime.Today.AddMonths(-1);
dtMax = DateTime.Today.AddDays(1);
dtSnapMin = DateTime.Today.AddDays(-2);
}
#endregion Public Constructors
@@ -16,6 +20,7 @@
public DateTime? dtRif { get; set; } = null;
public DateTime? dtMax { get; set; } = null;
public DateTime? dtMin { get; set; } = null;
public DateTime? dtSnapMin { get; set; } = null;
public string IdxMacchina { get; set; } = "*";
public string lastUpdate { get; set; } = "-";
public bool LiveUpdate { get; set; } = true;
@@ -36,6 +41,7 @@
dtRif = this.dtRif,
dtMax = this.dtMax,
dtMin = this.dtMin,
dtSnapMin = this.dtSnapMin,
IdxMacchina = this.IdxMacchina,
lastUpdate = this.lastUpdate,
LiveUpdate = this.LiveUpdate,
@@ -54,6 +60,18 @@
if (IdxMacchina != item.IdxMacchina)
return false;
if (dtMax != item.dtMax)
return false;
if (dtMin != item.dtMin)
return false;
if (dtRif != item.dtRif)
return false;
if (dtSnapMin != item.dtSnapMin)
return false;
if (CodFlux != item.CodFlux)
return false;
@@ -65,11 +83,11 @@
if (TempoAgg != item.TempoAgg)
return false;
if (NumRec!= item.NumRec)
if (NumRec != item.NumRec)
return false;
if (TotCount!= item.TotCount)
if (TotCount != item.TotCount)
return false;
if (CurrPage != item.CurrPage)
+1 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP.SPEC</RootNamespace>
<Version>6.16.2211.417</Version>
<Version>6.16.2211.709</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2211.417</h4>
<h4>Versione: 6.16.2211.709</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2211.417
6.16.2211.709
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2211.417</version>
<version>6.16.2211.709</version>
<url>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>