96 lines
2.8 KiB
Plaintext
96 lines
2.8 KiB
Plaintext
|
@page "/RTD8TM"
|
||
|
@using Blazored.Modal.Services
|
||
|
@using UI_SequentMicrosystems.Components
|
||
|
@using UI_SequentMicrosystems.Services
|
||
|
@using Blazored.Modal
|
||
|
|
||
|
@inject NavigationManager Navigator
|
||
|
@inject RTD8TMService _RTD8TMService
|
||
|
|
||
|
<PageTitle>Temperature</PageTitle>
|
||
|
|
||
|
|
||
|
<div class="row text-center">
|
||
|
<div class="col">Device Address: @_RTD8TMService.GetAddress() | DataUpdate: @_UpdateCounter | </div>
|
||
|
<div class="col text-start">
|
||
|
<div class="form-check form-switch">
|
||
|
@if (EditName)
|
||
|
{
|
||
|
<input class="form-check-input" type="checkbox" role="switch" id="flexSwitchCheckDefault" @onclick="(() =>
|
||
|
{
|
||
|
EditName = false;
|
||
|
Task.Run(() =>_RTD8TMService.SetChanelsNames());
|
||
|
Task.Run(() => _RTD8TMService.PostValueTypes());
|
||
|
})" checked>
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
<input class="form-check-input" type="checkbox" role="switch" id="flexSwitchCheckDefault" @onclick="(() => EditName = true)">
|
||
|
}
|
||
|
<label class="form-check-label" for="flexSwitchCheckDefault">Configure Inputs</label>
|
||
|
</div>
|
||
|
</div>
|
||
|
@if (EditName)
|
||
|
{
|
||
|
<div class="col text-start">
|
||
|
<button class="btn btn-dark text-white no-border" @onclick="(() => _RTD8TMService.ClearChanelNames())">Reset Names</button>
|
||
|
</div>
|
||
|
<div class="col text-start">
|
||
|
<button class="btn btn-dark text-white no-border" @onclick="(() => _RTD8TMService.ClearValueTypes())">Reset Value Types</button>
|
||
|
</div>
|
||
|
}
|
||
|
</div>
|
||
|
|
||
|
<div class="row">
|
||
|
<div class="col-lg-6 graybg">
|
||
|
<div class="well">
|
||
|
1 - Future Graph
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="col-lg-6">
|
||
|
<div class="row">
|
||
|
@foreach(byte StackID in _RTD8TMService.GetActualData().Keys)
|
||
|
{
|
||
|
<div class="col-sm-6 col-xxl-4">
|
||
|
<div class="text-center">Stack ID: @StackID</div>
|
||
|
@for (byte chanel = 0; chanel < 8; chanel++)
|
||
|
{
|
||
|
<RTD8TMChanelComponent StackID=@StackID ChanelID=@chanel Edit=@EditName RTD8tmService=@_RTD8TMService />
|
||
|
}
|
||
|
</div>
|
||
|
}
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
@code {
|
||
|
public int _UpdateCounter = 0;
|
||
|
private bool EditName = false;
|
||
|
|
||
|
[CascadingParameter] public IModalService Modal { get; set; } = default!;
|
||
|
|
||
|
protected override void OnInitialized()
|
||
|
{
|
||
|
_RTD8TMService.SetAddress("http://10.1.20.5/");//Navigator.BaseUri);
|
||
|
_RTD8TMService.EventUpdateValues += UpdateView;
|
||
|
}
|
||
|
|
||
|
public async Task UpdateView(object? o, bool b)
|
||
|
{
|
||
|
await InvokeAsync(() =>
|
||
|
{
|
||
|
StateHasChanged();
|
||
|
_UpdateCounter++;
|
||
|
});
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
}
|