diff --git a/Docs/ActualToDo.md b/Docs/ActualToDo.md index edab8a4..0f72171 100644 --- a/Docs/ActualToDo.md +++ b/Docs/ActualToDo.md @@ -2,7 +2,7 @@ ## Framework -Traduzione OVUNQUE x ogni termine/etichetta/button +Traduzione OVUNQUE x ogni termine/etichetta/button.. ## Pagine @@ -45,6 +45,7 @@ Per completare: - [x] sostituire il salva generale con 2 buttons: - salva, o meglio RECALC PNG = update PNG, potrebbe andare in automatico DOPO i vari SALVA nella pagina (opzione x auto-recalc?!?) - get 3D obj (in new window/tab) + - [x] delete singola porta da ordine - [x] navigazione in ritorno come da FIGMA in HwNewInst - [x] refresh conteggi su approvazione @@ -63,7 +64,6 @@ Sistemare: - [x] Va inserita una lista dei componenti + elenco quote. - [ ] Va pensato esportabile in pdf, comprensivo di "check pdf fatto da tizio alle ..." - ## Componenti ### Top diff --git a/Docs/ActualToDo.pdf b/Docs/ActualToDo.pdf index 514bf9b..d82b8a7 100644 Binary files a/Docs/ActualToDo.pdf and b/Docs/ActualToDo.pdf differ diff --git a/WebDoorCreator.CamSrv/ProcMan.vb b/WebDoorCreator.CamSrv/ProcMan.vb index 4051830..bed064b 100644 --- a/WebDoorCreator.CamSrv/ProcMan.vb +++ b/WebDoorCreator.CamSrv/ProcMan.vb @@ -181,16 +181,18 @@ Public Class ProcMan bStopMainProcess = m_bStopProcess Dim bOk As Boolean = False While Not bOk - ' ogni 30 secondi - If n30SecCounter = 30 OrElse n30SecCounter = 0 Then - ' verifica connessione - Dim risultatoPing As PingReply = currWDC.testPing - bOk = risultatoPing.Status = IPStatus.Success - If bOk Then - bOk = currWDC.testAlive + If Not bStopMainProcess AndAlso Not m_bStopProcess Then + ' ogni 30 secondi + If n30SecCounter = 30 OrElse n30SecCounter = 0 Then + ' verifica connessione + Dim risultatoPing As PingReply = currWDC.testPing + bOk = risultatoPing.Status = IPStatus.Success + If bOk Then + bOk = currWDC.testAlive + End If + Else + bOk = True End If - Else - bOk = True End If ' se connessione non ok o processo fermato, fermo i thread If Not bOk OrElse bStopMainProcess Then @@ -239,13 +241,19 @@ Public Class ProcMan ' se qualche processo in stop, lo faccio ripartire For ThreadIndex = 0 To ThreadList.Count - 1 Dim Thread = ThreadList(ThreadIndex) - If Thread.ThreadState = ThreadState.Stopped OrElse Thread.ThreadState = ThreadState.Aborted OrElse + If Not IsNothing(Thread) Then + If Thread.ThreadState = ThreadState.Stopped OrElse Thread.ThreadState = ThreadState.Aborted OrElse Thread.ThreadState = ThreadState.Suspended Then - Thread.Abort() - Dim ThreadId As Integer = ThreadIndex - Thread = New Thread(Sub() - ThreadFunction(ThreadId) - End Sub) + Thread.Abort() + Thread.Sleep(1000) + While Not Thread.ThreadState = ThreadState.Aborted + Thread.Sleep(1000) + End While + Dim ThreadId As Integer = ThreadIndex + Thread = New Thread(Sub() + ThreadFunction(ThreadId) + End Sub) + End If End If Next If n30SecCounter <= 30 Then @@ -291,9 +299,9 @@ Public Class ProcMan Sub(o) 'verifico thread attivi e se calano --> riavvia.. If ThreadCount() <> m_MaxCamInstances And Not m_bStopProcess Then - stopAllThreads() - Thread.Sleep(100) - startAllThreads() + 'stopAllThreads() + 'Thread.Sleep(100) + 'startAllThreads() End If lblRunning.Text = $"threads: {ThreadCount()}/{m_MaxCamInstances}" @@ -324,6 +332,7 @@ Public Class ProcMan Private Sub startAllThreads() m_bStopProcess = False + m_bExecutionThreadStoped = False m_ExecutionThread = New Thread(Sub() ExecutionProcess() End Sub) @@ -579,7 +588,11 @@ Public Class ProcMan m_bStopProcess = True While Not m_bExecutionThreadStoped - Thread.Sleep(20) + Thread.Sleep(100) + End While + m_ExecutionThread.Abort() + While Not m_ExecutionThread.ThreadState = ThreadState.Aborted + Thread.Sleep(100) End While m_ExecutionThread = Nothing ' fix timer @@ -918,12 +931,14 @@ Public Class ProcMan Private Sub CheckStartAutoRestart() TimerCheck.Enabled = chkAutoRestart.Checked If chkAutoRestart.Checked Then - If m_ExecutionThread.ThreadState = ThreadState.Aborted OrElse m_ExecutionThread.ThreadState = ThreadState.Stopped OrElse - m_ExecutionThread.ThreadState = ThreadState.Suspended Then + If Not IsNothing(m_ExecutionThread) AndAlso (m_ExecutionThread.ThreadState = ThreadState.Aborted OrElse m_ExecutionThread.ThreadState = ThreadState.Stopped OrElse + m_ExecutionThread.ThreadState = ThreadState.Suspended) Then stopAllThreads() Thread.Sleep(200) - m_ExecutionThread.Abort() - Thread.Sleep(200) + While Not IsNothing(m_ExecutionThread) + Thread.Sleep(100) + End While + Thread.Sleep(100) startAllThreads() End If TimerCheck.Start() @@ -938,8 +953,14 @@ Public Class ProcMan Private Sub restartAll() ' eseguo riavvio forzato ogni 30 sec! - stopAllThreads() - Task.Delay(500) + If Not IsNothing(m_ExecutionThread) Then + stopAllThreads() + Thread.Sleep(200) + While Not IsNothing(m_ExecutionThread) + Thread.Sleep(100) + End While + Thread.Sleep(100) + End If startAllThreads() End Sub diff --git a/WebDoorCreator.UI/Components/Hardware/HardwareNewPanel.razor b/WebDoorCreator.UI/Components/Hardware/HardwareNewPanel.razor index 45b4548..313dd5a 100644 --- a/WebDoorCreator.UI/Components/Hardware/HardwareNewPanel.razor +++ b/WebDoorCreator.UI/Components/Hardware/HardwareNewPanel.razor @@ -8,11 +8,11 @@ else {
- +
- +
diff --git a/WebDoorCreator.UI/Components/Hardware/HardwareNewPanel.razor.cs b/WebDoorCreator.UI/Components/Hardware/HardwareNewPanel.razor.cs index ceecfea..8fcc296 100644 --- a/WebDoorCreator.UI/Components/Hardware/HardwareNewPanel.razor.cs +++ b/WebDoorCreator.UI/Components/Hardware/HardwareNewPanel.razor.cs @@ -1,6 +1,7 @@ using Microsoft.AspNetCore.Components; using Newtonsoft.Json; using WebDoorCreator.Data.DbModels; +using WebDoorCreator.UI.Components.SvgComp; using WebDoorCreator.UI.Data; using static WebDoorCreator.UI.Data.WDCRefreshService; @@ -100,10 +101,24 @@ namespace WebDoorCreator.UI.Components.Hardware #region Protected Methods - protected async Task backToList() + protected async Task exeFun(HwSvgObj.ActionReq action) { await Task.Delay(1); - await E_act2Rel.InvokeAsync(true); + switch (action) + { + case HwSvgObj.ActionReq.Minus: + // nulla (x ora) + break; + + case HwSvgObj.ActionReq.Plus: + await hwToAdd(""); + break; + + case HwSvgObj.ActionReq.Select: + default: + await E_act2Rel.InvokeAsync(true); + break; + } } protected int getDoorOpInstNum(int doorOpId) @@ -285,7 +300,6 @@ namespace WebDoorCreator.UI.Components.Hardware DoorOpList = null; await Task.Delay(1); ListRecord = await WDCService.DoorOpGetByDoorId(DoorId); - var tempListVal = await WDCService.ListValuesGetAll(HwCode, "Folder"); if (ListRecord != null) { DoorOpList = ListRecord.Where(x => (x.DoorId == DoorId) && (x.ObjectId == HwCode)).ToList(); diff --git a/WebDoorCreator.UI/Components/SvgComp/HwSvgObj.razor b/WebDoorCreator.UI/Components/SvgComp/HwSvgObj.razor index bcdd3f8..38ebac5 100644 --- a/WebDoorCreator.UI/Components/SvgComp/HwSvgObj.razor +++ b/WebDoorCreator.UI/Components/SvgComp/HwSvgObj.razor @@ -1,7 +1,7 @@  -
+
@ItemName
@@ -29,16 +29,16 @@ @if (ShowPlus) { - + } @if (ShowPlus) { - + } else { - + } \ No newline at end of file diff --git a/WebDoorCreator.UI/Components/SvgComp/HwSvgObj.razor.cs b/WebDoorCreator.UI/Components/SvgComp/HwSvgObj.razor.cs index 40ad5ef..f974d42 100644 --- a/WebDoorCreator.UI/Components/SvgComp/HwSvgObj.razor.cs +++ b/WebDoorCreator.UI/Components/SvgComp/HwSvgObj.razor.cs @@ -1,47 +1,39 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using Microsoft.AspNetCore.Components; -using System.Net.Http; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Components.Authorization; -using Microsoft.AspNetCore.Components.Forms; -using Microsoft.AspNetCore.Components.Routing; -using Microsoft.AspNetCore.Components.Web; -using Microsoft.AspNetCore.Components.Web.Virtualization; -using Microsoft.JSInterop; -using WebDoorCreator.UI; -using WebDoorCreator.UI.Components; -using WebDoorCreator.UI.Components.Buttons; -using WebDoorCreator.UI.Components.CompMan; -using WebDoorCreator.UI.Components.DoorMan; -using WebDoorCreator.UI.Components.DoorDef; -using WebDoorCreator.UI.Components.Gen; -using WebDoorCreator.UI.Components.Order; -using WebDoorCreator.UI.Components.Users; -using WebDoorCreator.UI.Components.Hardware; -using WebDoorCreator.UI.Components.SvgComp; -using WebDoorCreator.UI.Components.Filters; -using WebDoorCreator.UI.Components.Report; -using WebDoorCreator.UI.Shared; -using WebDoorCreator.Data.DbModels; -using EgwCoreLib.Razor; namespace WebDoorCreator.UI.Components.SvgComp { public partial class HwSvgObj { + #region Public Enums + + /// + /// Enum delle azioni associate al controllo + /// + public enum ActionReq + { + Minus, + Plus, + Select + } + + #endregion Public Enums + #region Public Properties [Parameter] - public EventCallback EC_ExeFunct { get; set; } + public EventCallback EC_ExeFunct { get; set; } + + /// + /// Path img da mostrare + /// + [Parameter] + public string ImagePath { get; set; } = ""; [Parameter] - public EventCallback EC_ExePlus { get; set; } + public int ItemCount { get; set; } = 0; [Parameter] - public string ImagePath { get; set; } = "images/LogoEgw.png"; + public string ItemName { get; set; } = ""; [Parameter] public string LineColor { get; set; } = "#00838F"; @@ -49,16 +41,6 @@ namespace WebDoorCreator.UI.Components.SvgComp [Parameter] public int LineWidth { get; set; } = 8; - [Parameter] - public string ItemName { get; set; } = ""; - - [Parameter] - public int ItemCount { get; set; } = 0; - - - [Parameter] - public string PlusColor { get; set; } = "green"; - [Parameter] public int ObjH { get; set; } = 204; @@ -68,6 +50,9 @@ namespace WebDoorCreator.UI.Components.SvgComp [Parameter] public int ObjW { get; set; } = 450; + [Parameter] + public string PlusColor { get; set; } = "#69FF69"; + [Parameter] public bool ShowPlus { get; set; } = false; @@ -78,6 +63,10 @@ namespace WebDoorCreator.UI.Components.SvgComp #region Protected Properties + protected string cardClass + { + get => ItemCount > 0 ? "bg-primary text-light" : "bg-inactive text-dark"; + } protected CircleData CircleImg { get; set; } = null!; @@ -95,11 +84,6 @@ namespace WebDoorCreator.UI.Components.SvgComp get => ObjW - (ObjH * 90 / 100); } - protected string cardClass - { - get => ItemCount > 0 ? "bg-primary text-light" : "bg-inactive text-dark"; - } - #endregion Protected Properties #region Protected Methods @@ -107,20 +91,19 @@ namespace WebDoorCreator.UI.Components.SvgComp /// /// Invia evento principale /// - /// se true manda sempre EC_ExeFunct, altrimenti NON invia se showPlus attivo... - protected void execFunc(bool forceSend) + /// Azione richiesta + /// + /// se true manda sempre EC_ExeFunct, altrimenti NON invia se showPlus attivo... + /// + protected void doExecFunc(ActionReq action, bool forceSend) { + // invia la chiamata richiesta secondo configurazione... if (forceSend || !ShowPlus) { - EC_ExeFunct.InvokeAsync(true); + EC_ExeFunct.InvokeAsync(action); } } - protected void execPlus() - { - EC_ExePlus.InvokeAsync(true); - } - protected override void OnParametersSet() { setupGraphParams(); diff --git a/WebDoorCreator.UI/Pages/TestPage.razor b/WebDoorCreator.UI/Pages/TestPage.razor index 0541e63..963a443 100644 --- a/WebDoorCreator.UI/Pages/TestPage.razor +++ b/WebDoorCreator.UI/Pages/TestPage.razor @@ -21,23 +21,27 @@
- +
- +
-
- +
+
-
+
+
-
- +
+ +
+
+
@@ -96,11 +100,6 @@ protected override async Task OnInitializedAsync() { - //return base.OnInitializedAsync(); - //} - - //protected override void OnInitialized() - //{ msgList = new Dictionary(); msgList.Add("T1", "Titolo"); msgList.Add("M1", "Messaggio 1"); @@ -110,7 +109,11 @@ protected List? DoorsList { get; set; } = null; - protected async Task exeFun() + protected async Task exeDoor() + { + await Task.Delay(1); + } + protected async Task exeFun(HwSvgObj.ActionReq action) { await Task.Delay(1); } diff --git a/WebDoorCreator.UI/wwwroot/images/icons/Exit.svg b/WebDoorCreator.UI/wwwroot/images/icons/Exit.svg new file mode 100644 index 0000000..229ea09 --- /dev/null +++ b/WebDoorCreator.UI/wwwroot/images/icons/Exit.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/WebDoorCreator.UI/wwwroot/images/icons/ExitWhite.svg b/WebDoorCreator.UI/wwwroot/images/icons/ExitWhite.svg new file mode 100644 index 0000000..00771c0 --- /dev/null +++ b/WebDoorCreator.UI/wwwroot/images/icons/ExitWhite.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/WebDoorCreator.UI/wwwroot/images/icons/Plus.svg b/WebDoorCreator.UI/wwwroot/images/icons/Plus.svg new file mode 100644 index 0000000..958c8c1 --- /dev/null +++ b/WebDoorCreator.UI/wwwroot/images/icons/Plus.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/WebDoorCreator.UI/wwwroot/images/icons/PlusWhite.svg b/WebDoorCreator.UI/wwwroot/images/icons/PlusWhite.svg new file mode 100644 index 0000000..add741d --- /dev/null +++ b/WebDoorCreator.UI/wwwroot/images/icons/PlusWhite.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file