This commit is contained in:
zaccaria.majid
2023-05-18 11:55:54 +02:00
12 changed files with 140 additions and 103 deletions
+2 -2
View File
@@ -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] <del>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)</del>
- [x] <del>delete singola porta da ordine</del>
- [x] <del>navigazione in ritorno come da FIGMA in HwNewInst</del>
- [x] <del>refresh conteggi su approvazione</del>
@@ -63,7 +64,6 @@ Sistemare:
- [x] <del>Va inserita una lista dei componenti + elenco quote.</del>
- [ ] Va pensato esportabile in pdf, comprensivo di "check pdf fatto da tizio alle ..."
## Componenti
### Top
Binary file not shown.
+46 -25
View File
@@ -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
@@ -8,11 +8,11 @@ else
{
<div class="row">
<div class="col-4">
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExeFunct="@(()=> backToList())" ObjId="@HwCode" ItemName="Back to List" ItemCount="0" ShowPlus="false" ImagePath=""></HwSvgObj>
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExeFunct="exeFun" ObjId="RETURN" ItemName="Back to List" ItemCount="0" ShowPlus="false" ImagePath="images/icons/ExitWhite.svg"></HwSvgObj>
</div>
<div class="col-4"></div>
<div class="col-4">
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExePlus="@(()=> hwToAdd(""))" ObjId="@HwCode" ItemName="@(translate(HwLabel))" ItemCount="@HwInst" ShowPlus="true" ImagePath=""></HwSvgObj>
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExeFunct="exeFun" ObjId="@HwCode" ItemName="@(translate(HwLabel))" ItemCount="@HwInst" ShowPlus="true" ImagePath="images/icons/PlusWhite.svg"></HwSvgObj>
</div>
</div>
@@ -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();
@@ -1,7 +1,7 @@
<svg viewBox="0 0 @ObjW @ObjH" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
<g transform="translate(0,@LineDist)">
<foreignObject width="@TextAreaWidth" height="100%">
<div class="d-flex justify-content-between rectangle p-3 @cardClass" style="@TextStyle" @onclick="()=>execFunc(false)">
<div class="d-flex justify-content-between rectangle p-3 @cardClass" style="@TextStyle;" @onclick="() => doExecFunc(ActionReq.Select, false)">
<div>
@ItemName
</div>
@@ -29,16 +29,16 @@
<image x="@(CircleImg.rad/2)" y="0" href="@ImagePath" width="@CircleImg.rad" height="100%"></image>
@if (ShowPlus)
{
<rect x="0" y="0" width="100%" height="100%" fill="@PlusColor" style="opacity: 20%;" />
<rect x="0" y="0" width="100%" height="100%" fill="@PlusColor" style="opacity: 30%;" />
}
</pattern>
</defs>
@if (ShowPlus)
{
<circle id="circleCont" cx="@CircleImg.cx" cy="@CircleImg.cy" r="@CircleImg.rad" fill="url(#@($"contImg_{ObjId}"))" style="cursor: pointer;" @onclick="()=>execPlus()" />
<circle id="circleCont" cx="@CircleImg.cx" cy="@CircleImg.cy" r="@CircleImg.rad" fill="url(#@($"contImg_{ObjId}"))" style="cursor: pointer;" @onclick="() => doExecFunc(ActionReq.Plus, true)" />
}
else
{
<circle id="circleCont" cx="@CircleImg.cx" cy="@CircleImg.cy" r="@CircleImg.rad" fill="url(#@($"contImg_{ObjId}"))" style="cursor: pointer;" @onclick="()=>execFunc(true)" />
<circle id="circleCont" cx="@CircleImg.cx" cy="@CircleImg.cy" r="@CircleImg.rad" fill="url(#@($"contImg_{ObjId}"))" style="cursor: pointer;" @onclick="() => doExecFunc(ActionReq.Select, true)" />
}
</svg>
@@ -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
/// <summary>
/// Enum delle azioni associate al controllo
/// </summary>
public enum ActionReq
{
Minus,
Plus,
Select
}
#endregion Public Enums
#region Public Properties
[Parameter]
public EventCallback<bool> EC_ExeFunct { get; set; }
public EventCallback<ActionReq> EC_ExeFunct { get; set; }
/// <summary>
/// Path img da mostrare
/// </summary>
[Parameter]
public string ImagePath { get; set; } = "";
[Parameter]
public EventCallback<bool> 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
/// <summary>
/// Invia evento principale
/// </summary>
/// <param name="forceSend">se true manda sempre EC_ExeFunct, altrimenti NON invia se showPlus attivo...</param>
protected void execFunc(bool forceSend)
/// <param name="action">Azione richiesta</param>
/// <param name="forceSend">
/// se true manda sempre EC_ExeFunct, altrimenti NON invia se showPlus attivo...
/// </param>
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();
+16 -13
View File
@@ -21,23 +21,27 @@
<div class="col-3">
</div>
<div class="col-3">
<DoorSvgObj LineColor="#8E44AD" LineWidth="8" ObjH="200" ObjW="900" LeftTextClass="col-10 fs-1 fw-bold" RightTextClass="col-2" EC_ExeFunct="@(()=> exeFun())" ObjId="1" TextData="@msgList" Message1="messaggio 1" Message2="messaggio 2" ImagePath="@svgUrl(196)"></DoorSvgObj>
<DoorSvgObj LineColor="#8E44AD" LineWidth="8" ObjH="200" ObjW="900" LeftTextClass="col-10 fs-1 fw-bold" RightTextClass="col-2" EC_ExeFunct="@(()=> exeDoor())" ObjId="1" TextData="@msgList" Message1="messaggio 1" Message2="messaggio 2" ImagePath="@svgUrl(196)"></DoorSvgObj>
</div>
<div class="col-3">
<DoorSvgObj LineColor="#8E44AD" LineWidth="8" ObjH="200" ObjW="900" LeftTextClass="col-10 fs-1 fw-bold" RightTextClass="col-2" EC_ExeFunct="@(()=> exeFun())" ObjId="2" TextData="@msgList" Message1="messaggio 1" Message2="messaggio 2" ShowPlusMinus="true" ImagePath="@svgUrl(186)"></DoorSvgObj>
<DoorSvgObj LineColor="#8E44AD" LineWidth="8" ObjH="200" ObjW="900" LeftTextClass="col-10 fs-1 fw-bold" RightTextClass="col-2" EC_ExeFunct="@(()=> exeDoor())" ObjId="2" TextData="@msgList" Message1="messaggio 1" Message2="messaggio 2" ShowPlusMinus="true" ImagePath="@svgUrl(186)"></DoorSvgObj>
</div>
<div class="col-3">
</div>
</div>
<div class="row my-2">
<div class="col-4">
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExeFunct="@(()=> exeFun())" ObjId="21" ItemName="Flush Pull" ItemCount="2" ImagePath="@svgUrl(196)"></HwSvgObj>
<div class="col-3">
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExeFunct="@exeFun" ObjId="21" ItemName="Flush Pull" ItemCount="2" ImagePath="@svgUrl(196)"></HwSvgObj>
</div>
<div class="col-4">
<div class="col-3">
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExeFunct="@exeFun" ObjId="22" ItemName="Hinge" ItemCount="0" ImagePath="images/icons/ExitWhite.svg"></HwSvgObj>
</div>
<div class="col-4">
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExeFunct="@(()=> exeFun())" ObjId="22" ItemName="Hinge" ItemCount="0" ShowPlus="true" ImagePath="@svgUrl(186)"></HwSvgObj>
<div class="col-3">
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExeFunct="@exeFun" ObjId="23" ItemName="Hinge" ItemCount="0" ImagePath="images/icons/PlusWhite.svg" ShowPlus="true"></HwSvgObj>
</div>
<div class="col-3">
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExeFunct="@exeFun" ObjId="24" ItemName="Hinge" ItemCount="0" ShowPlus="true" ImagePath="@svgUrl(186)"></HwSvgObj>
</div>
</div>
@@ -96,11 +100,6 @@
protected override async Task OnInitializedAsync()
{
//return base.OnInitializedAsync();
//}
//protected override void OnInitialized()
//{
msgList = new Dictionary<string, string>();
msgList.Add("T1", "Titolo");
msgList.Add("M1", "Messaggio 1");
@@ -110,7 +109,11 @@
protected List<DoorModel>? 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);
}
@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<!--! Font Awesome Pro 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. -->
<path d="M377.9 105.9L500.7 228.7c7.2 7.2 11.3 17.1 11.3 27.3s-4.1 20.1-11.3 27.3L377.9 406.1c-6.4 6.4-15 9.9-24 9.9c-18.7 0-33.9-15.2-33.9-33.9l0-62.1-128 0c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l128 0 0-62.1c0-18.7 15.2-33.9 33.9-33.9c9 0 17.6 3.6 24 9.9zM160 96L96 96c-17.7 0-32 14.3-32 32l0 256c0 17.7 14.3 32 32 32l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c-53 0-96-43-96-96L0 128C0 75 43 32 96 32l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32z"/>
</svg>
@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<!--! Font Awesome Pro 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. -->
<path fill="white" d="M377.9 105.9L500.7 228.7c7.2 7.2 11.3 17.1 11.3 27.3s-4.1 20.1-11.3 27.3L377.9 406.1c-6.4 6.4-15 9.9-24 9.9c-18.7 0-33.9-15.2-33.9-33.9l0-62.1-128 0c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l128 0 0-62.1c0-18.7 15.2-33.9 33.9-33.9c9 0 17.6 3.6 24 9.9zM160 96L96 96c-17.7 0-32 14.3-32 32l0 256c0 17.7 14.3 32 32 32l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c-53 0-96-43-96-96L0 128C0 75 43 32 96 32l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32z"/>
</svg>
@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
<!--! Font Awesome Pro 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. -->
<path d="M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32V224H48c-17.7 0-32 14.3-32 32s14.3 32 32 32H192V432c0 17.7 14.3 32 32 32s32-14.3 32-32V288H400c17.7 0 32-14.3 32-32s-14.3-32-32-32H256V80z"/>
</svg>
@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
<!--! Font Awesome Pro 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. -->
<path fill="white" d="M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32V224H48c-17.7 0-32 14.3-32 32s14.3 32 32 32H192V432c0 17.7 14.3 32 32 32s32-14.3 32-32V288H400c17.7 0 32-14.3 32-32s-14.3-32-32-32H256V80z" />
</svg>