@using WebDoorCreator.Data.Services;
@using WebDoorCreator.UI.Components.SvgComp
@using WebDoorCreator.UI.Data
@page "/TestPage"
@inject WebDoorCreatorService WDCService
TestPage
@**@
@for (int i = 0; i < 8; i++)
{
stepText = $"Block_{idxObj:00}";
idxObj++;
}
@if(tempDOT != null)
{
@foreach (var item in tempDOT)
{
@($"{Path.GetFileName(item.OpCode)} {item.status} {item.FileMD5}")
}
}
@**@
@if (DoorsList == null)
{
}
else
{
foreach (var door in DoorsList)
{
@door.DoorId
}
}
@code {
protected string lastMessage { get; set; } = "";
protected string svgUrl(int doorId)
{
return $"api/DoorImage/GetImage.svg?DoorId={doorId}";
}
protected int idxObj { get; set; } = 1;
protected string stepText { get; set; } = "---";
protected string blockStyle(int idx)
{
string answ = "";
int resto = idx % 3;
switch (resto)
{
case 1:
answ = "fill:rgb(0,255,0);";
break;
case 2:
answ = "fill:rgb(0,0,255);";
break;
case 0:
default:
answ = "fill:rgb(255,0,0)";
break;
}
return answ;
}
protected Dictionary msgList = new Dictionary();
protected List tempDOT = new List();
protected override async Task OnInitializedAsync()
{
msgList = new Dictionary();
msgList.Add("T1", "Titolo");
msgList.Add("M1", "Messaggio 1");
msgList.Add("M2", "MEssaggio 2");
DoorsList = await WDCService.DoorGetLast(100);
}
protected List? DoorsList { get; set; } = null;
protected async Task ExecDoor(DoorSvgObj.DoorAct currAct)
{
lastMessage = $"DoorId: {currAct.DoorId} | Actio req: {currAct.Action}";
await Task.Delay(1);
}
protected async Task exeFun(HwSvgObj.ActionReq action)
{
await Task.Delay(1);
}
protected async Task scanB()
{
await Task.Delay(1);
tempDOT.Clear();
//tempDOT = await WDCService.scanAndCompare();
}
protected async Task save()
{
await WDCService.DoorOpTypeAddRange(tempDOT);
}
protected async Task populateHws()
{
await WDCService.populateHws();
}
}