@using UI_SequentMicrosystems.Services @inject PointsService _PointsService @inject IJSRuntime _JSRuntime
@if (TimerEnabled) { } else { }
@if (RecalculateValues) { } else { }
@code { private bool RecalculateValues = false; private bool TimerEnabled = false; protected override void OnInitialized() { TimerEnabled = _PointsService.GetTImerStatus(); _PointsService.EventUpdateTopBar += UpdateView; } /// /// Start downloading CSV file with points /// private async void DownloadFile() { // Název souboru string fileName = "TESDevice1.csv"; // Vytvoření a spuštění odkazu ke stažení await _JSRuntime.InvokeVoidAsync("DownloadFile", fileName, await _PointsService.CreatePointsFileLines(RecalculateValues)); } /// /// Timer Time Change /// /// private void PointTimerChange(string? time) { if (time == null || time == "") { return; } time = time.Replace(".", ","); _PointsService.SetTimerInterval(int.Parse(time)); } public async Task UpdateView(object? o, bool b) { await InvokeAsync(() => { StateHasChanged(); }); } }