From ee31322dda8316f7538d56e9dbeca33ed326afc4 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Sat, 23 May 2026 21:11:39 +0200 Subject: [PATCH] Spostamento aree protected da Generic a BaseObj --- IOB-WIN-FORM/Iob/BaseObj.cs | 4 +--- IOB-WIN-FORM/Iob/Simula.cs | 29 ++++------------------------- 2 files changed, 5 insertions(+), 28 deletions(-) diff --git a/IOB-WIN-FORM/Iob/BaseObj.cs b/IOB-WIN-FORM/Iob/BaseObj.cs index b91449d2..1a3bdc6e 100644 --- a/IOB-WIN-FORM/Iob/BaseObj.cs +++ b/IOB-WIN-FORM/Iob/BaseObj.cs @@ -1,6 +1,4 @@ -using IOB_UT_NEXT; -using IOB_UT_NEXT.Objects; -using IOB_UT_NEXT.Services.Data; +using IOB_UT_NEXT.Objects; using NLog; using System; diff --git a/IOB-WIN-FORM/Iob/Simula.cs b/IOB-WIN-FORM/Iob/Simula.cs index f075c8c2..e8414a21 100644 --- a/IOB-WIN-FORM/Iob/Simula.cs +++ b/IOB-WIN-FORM/Iob/Simula.cs @@ -66,7 +66,7 @@ namespace IOB_WIN_FORM.Iob { // jitter di avvio per disallineare le istanze nella VM Random startRnd = new Random(); - int startDelay = startRnd.Next(0, 5000); + int startDelay = startRnd.Next(0, 200); Thread.Sleep(startDelay); // gestione invio ritardato contapezzi @@ -149,30 +149,9 @@ namespace IOB_WIN_FORM.Iob // simulazione processo FTP (Cimolai) - FIXME TODO DeleteME ProcessDataSync(); } - // carica conf - try - { - // Invece di bloccare il costruttore con .GetAwaiter().GetResult(), - // avviamo il carico in modo "fire-and-forget" controllato. - // Questo evita il context switch pesante durante l'inizializzazione. - _ = Task.Run(async () => - { - try - { - await Simula_Load(adesso); - } - catch (Exception ex) - { - lgError($"Errore in Simula_Load (background): {ex.Message}"); - } - }); - } - catch (Exception ex) - { - lgError($"Errore nel lancio del task Simula_Load: {ex.Message}"); - } } + #endregion Public Constructors #region Public Methods @@ -516,8 +495,8 @@ namespace IOB_WIN_FORM.Iob public override async Task InitializeAsync() { await Simula_Load(DateTime.Now); - // attendo altri 50ms - await Task.Delay(50); + // attendo altri 10ms + await Task.Delay(10); } ///