77 lines
2.5 KiB
Plaintext
77 lines
2.5 KiB
Plaintext
@using GWMS.UI.Data
|
|
@using GWMS.UI.Components
|
|
|
|
@inject GWMSDataService DataService
|
|
@inject MessageService AppMService
|
|
@inject IJSRuntime JSRuntime
|
|
|
|
<div class="row">
|
|
<div class="col-3 text-right">
|
|
<h3>Simulazione</h3>
|
|
</div>
|
|
<div class="col-9">
|
|
<div class="d-flex justify-content-between">
|
|
<div class="p-2">
|
|
<div class="input-group">
|
|
<div class="input-group-prepend">
|
|
<span class="input-group-text">giorni</span>
|
|
</div>
|
|
<input @bind-value="@numDays" @bind-value:event="oninput" type="number" class="form-control" title="Giorni" />
|
|
</div>
|
|
</div>
|
|
<div class="p-2">
|
|
<div class="input-group">
|
|
<div class="input-group-prepend">
|
|
<span class="input-group-text">step</span>
|
|
</div>
|
|
<input @bind-value="@stepMin" @bind-value:event="oninput" type="number" class="form-control" title="Step sim (minuti)" />
|
|
</div>
|
|
</div>
|
|
<div class="p-2">
|
|
<div class="input-group">
|
|
<div class="input-group-prepend">
|
|
<span class="input-group-text">cons orario max</span>
|
|
</div>
|
|
<input @bind-value="@maxHourRate" @bind-value:event="oninput" type="number" class="form-control" title="Consumo massimo orario" />
|
|
</div>
|
|
</div>
|
|
<div class="p-2">
|
|
<Button id="btnReset" class="btn btn-danger btn-block" Clicked="resetDB">
|
|
<span class="oi oi-reload"></span> Regen DB Data
|
|
</Button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@code {
|
|
|
|
[Parameter]
|
|
public EventCallback<int> evRefresh { get; set; }
|
|
[Parameter]
|
|
public EventCallback<int> evProcessing { get; set; }
|
|
|
|
protected int numDays { get; set; } = 7;
|
|
protected int stepMin { get; set; } = 30;
|
|
protected int maxHourRate { get; set; } = 800;
|
|
|
|
protected async Task resetDB()
|
|
{
|
|
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Sicuro di voler risimulare il set di dati di Log?"))
|
|
return;
|
|
|
|
reportProcess();
|
|
//await DataService.RegenDB(numDays, stepMin, maxHourRate);
|
|
reportChange();
|
|
}
|
|
|
|
private void reportChange()
|
|
{
|
|
evRefresh.InvokeAsync(1);
|
|
}
|
|
|
|
private void reportProcess()
|
|
{
|
|
evProcessing.InvokeAsync(1);
|
|
}
|
|
} |