From c4922c3c23dcb9a3163828c8d02af6bb42b24c06 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 19 May 2023 10:53:07 +0200 Subject: [PATCH 1/2] update pagina test blocchi --- .../Pages/OrdersHomePage.razor.css | 17 ++- .../Pages/OrdersHomePage.razor.less | 16 +++ WebDoorCreator.UI/Pages/TestAnim.razor | 129 ++++++++++++++++++ WebDoorCreator.UI/Pages/TestAnim.razor.css | 73 ++++++++++ WebDoorCreator.UI/Pages/TestAnim.razor.less | 55 ++++++++ .../Pages/TestAnim.razor.min.css | 1 + WebDoorCreator.UI/compilerconfig.json | 4 + 7 files changed, 294 insertions(+), 1 deletion(-) create mode 100644 WebDoorCreator.UI/Pages/TestAnim.razor create mode 100644 WebDoorCreator.UI/Pages/TestAnim.razor.css create mode 100644 WebDoorCreator.UI/Pages/TestAnim.razor.less create mode 100644 WebDoorCreator.UI/Pages/TestAnim.razor.min.css diff --git a/WebDoorCreator.UI/Pages/OrdersHomePage.razor.css b/WebDoorCreator.UI/Pages/OrdersHomePage.razor.css index 06db017..ceb5ef1 100644 --- a/WebDoorCreator.UI/Pages/OrdersHomePage.razor.css +++ b/WebDoorCreator.UI/Pages/OrdersHomePage.razor.css @@ -6,4 +6,19 @@ /*box-shadow: rgba(0, 0, 0, 0.45) 0px 20px 22px -9px;*/ margin-top: 0.5rem; margin-bottom: 1rem; -} \ No newline at end of file +} +/*div { + background-color: red; + animation-name: example; + animation-duration: 4s; +} + +@keyframes example { + from { + background-color: transparent; + } + + to { + background-color: yellow; + } +}*/ \ No newline at end of file diff --git a/WebDoorCreator.UI/Pages/OrdersHomePage.razor.less b/WebDoorCreator.UI/Pages/OrdersHomePage.razor.less index e2da35d..223f52c 100644 --- a/WebDoorCreator.UI/Pages/OrdersHomePage.razor.less +++ b/WebDoorCreator.UI/Pages/OrdersHomePage.razor.less @@ -7,3 +7,19 @@ margin-top: 0.5rem; margin-bottom: 1rem; } + +/*div { + background-color: red; + animation-name: example; + animation-duration: 4s; +} + +@keyframes example { + from { + background-color: transparent; + } + + to { + background-color: yellow; + } +}*/ \ No newline at end of file diff --git a/WebDoorCreator.UI/Pages/TestAnim.razor b/WebDoorCreator.UI/Pages/TestAnim.razor new file mode 100644 index 0000000..19f1cb3 --- /dev/null +++ b/WebDoorCreator.UI/Pages/TestAnim.razor @@ -0,0 +1,129 @@ +@using WebDoorCreator.UI.Components.SvgComp +@using WebDoorCreator.UI.Data +@page "/TestAnim" + +@inject WebDoorCreatorService WDCService + + +
+ @if (CurrLevel == 1) + { +
+
+
+ LEVEL 01 +
+
+ @* *@ +
+
+
+ Elenco ordini +
+ +
+ +
+ pager +
+
+ } + else if (CurrLevel == 2) + { +
+
+
+ LEVEL 01 +
+
+ +
+
+
+
+
+
+ LEVEL 02 +
+
+ @**@ +
+
+
+ Elenco Porte +
+ +
+ +
+ pager +
+
+ } + else + { +
+
+
+ LEVEL 01 +
+
+ +
+
+
+
+
+
+ LEVEL 02 +
+
+ +
+
+
+
+
+
+ LEVEL 03 +
+
+ @* *@ +
+
+
+ Elenco HW +
+ +
+ pager +
+
+ } +
+ +@code { + protected int CurrLevel { get; set; } = 1; + + protected async Task changeLevel(int newLevel) + { + CurrLevel = newLevel; + } + +} diff --git a/WebDoorCreator.UI/Pages/TestAnim.razor.css b/WebDoorCreator.UI/Pages/TestAnim.razor.css new file mode 100644 index 0000000..7e1fe50 --- /dev/null +++ b/WebDoorCreator.UI/Pages/TestAnim.razor.css @@ -0,0 +1,73 @@ +.cardOrders { + width: 100%; + border-radius: 18px; + padding: 1rem 4rem 0.5rem 4rem; + box-shadow: rgba(0, 0, 0, 0.45) 0px 20px 22px 3px; + margin-top: 0.5rem; + margin-bottom: 1rem; +} +.cardOrders01 { + width: 100%; + border-radius: 18px; + padding: 1rem 4rem 0.5rem 4rem; + box-shadow: rgba(0, 0, 0, 0.45) 0px 20px 22px 3px; + margin-top: 0.5rem; + margin-bottom: 1rem; + background-image: linear-gradient(to right, rgba(15, 15, 15, 0.5), #91d737); +} +.cardOrders01Red { + width: 100%; + border-radius: 18px; + padding: 1rem 4rem 0.5rem 4rem; + box-shadow: rgba(0, 0, 0, 0.45) 0px 20px 22px 3px; + margin-top: 0.5rem; + margin-bottom: 1rem; + background-image: linear-gradient(to right, rgba(15, 15, 15, 0.5), #91d737); + width: 90%; +} +.cardOrders02 { + width: 100%; + border-radius: 18px; + padding: 1rem 4rem 0.5rem 4rem; + box-shadow: rgba(0, 0, 0, 0.45) 0px 20px 22px 3px; + margin-top: 0.5rem; + margin-bottom: 1rem; + background-image: linear-gradient(to right, rgba(15, 15, 15, 0.5), #f5730f); +} +.cardOrders02Red { + width: 100%; + border-radius: 18px; + padding: 1rem 4rem 0.5rem 4rem; + box-shadow: rgba(0, 0, 0, 0.45) 0px 20px 22px 3px; + margin-top: 0.5rem; + margin-bottom: 1rem; + background-image: linear-gradient(to right, rgba(15, 15, 15, 0.5), #f5730f); + width: 95%; +} +.cardOrders03 { + width: 100%; + border-radius: 18px; + padding: 1rem 4rem 0.5rem 4rem; + box-shadow: rgba(0, 0, 0, 0.45) 0px 20px 22px 3px; + margin-top: 0.5rem; + margin-bottom: 1rem; + background-image: linear-gradient(to right, rgba(15, 15, 15, 0.3), #23f587); +} +.btn01:after { + animation-name: example; + animation-duration: 2s; +} +@keyframes example { + from { + background-color: white; + } + to { + background-color: black; + } +} +/*div { + background-color: red; + animation-name: example; + animation-duration: 4s; +} +*/ \ No newline at end of file diff --git a/WebDoorCreator.UI/Pages/TestAnim.razor.less b/WebDoorCreator.UI/Pages/TestAnim.razor.less new file mode 100644 index 0000000..2a59451 --- /dev/null +++ b/WebDoorCreator.UI/Pages/TestAnim.razor.less @@ -0,0 +1,55 @@ +.cardOrders { + width: 100%; + border-radius: 18px; + padding: 1rem 4rem 0.5rem 4rem; + box-shadow: rgba(0, 0, 0, 0.45) 0px 20px 22px 3px; + margin-top: 0.5rem; + margin-bottom: 1rem; +} + +.cardOrders01 { + .cardOrders; + background-image: linear-gradient(to right, rgba(15,15,15,50%), rgba(145,215,55,1)); +} + +.cardOrders01Red { + .cardOrders01; + width: 90%; +} + +.cardOrders02 { + .cardOrders; + background-image: linear-gradient(to right, rgba(15,15,15,50%), rgba(245,115,15,1)); +} + +.cardOrders02Red { + .cardOrders02; + width: 95%; +} +.cardOrders03 { + .cardOrders; + background-image: linear-gradient(to right, rgba(15,15,15,30%), rgba(35,245,135,1)); +} + + + +.btn01:after { + animation-name: example; + animation-duration: 2s; +} + +@keyframes example { + from { + background-color: white; + } + + to { + background-color: black; + } +} +/*div { + background-color: red; + animation-name: example; + animation-duration: 4s; +} +*/ diff --git a/WebDoorCreator.UI/Pages/TestAnim.razor.min.css b/WebDoorCreator.UI/Pages/TestAnim.razor.min.css new file mode 100644 index 0000000..4939970 --- /dev/null +++ b/WebDoorCreator.UI/Pages/TestAnim.razor.min.css @@ -0,0 +1 @@ +.cardOrders{width:100%;border-radius:18px;padding:1rem 4rem .5rem 4rem;box-shadow:rgba(0,0,0,.45) 0 20px 22px 3px;margin-top:.5rem;margin-bottom:1rem;}.cardOrders01{width:100%;border-radius:18px;padding:1rem 4rem .5rem 4rem;box-shadow:rgba(0,0,0,.45) 0 20px 22px 3px;margin-top:.5rem;margin-bottom:1rem;background-image:linear-gradient(to right,rgba(15,15,15,.5),#91d737);}.cardOrders01Red{width:100%;border-radius:18px;padding:1rem 4rem .5rem 4rem;box-shadow:rgba(0,0,0,.45) 0 20px 22px 3px;margin-top:.5rem;margin-bottom:1rem;background-image:linear-gradient(to right,rgba(15,15,15,.5),#91d737);width:90%;}.cardOrders02{width:100%;border-radius:18px;padding:1rem 4rem .5rem 4rem;box-shadow:rgba(0,0,0,.45) 0 20px 22px 3px;margin-top:.5rem;margin-bottom:1rem;background-image:linear-gradient(to right,rgba(15,15,15,.5),#f5730f);}.cardOrders02Red{width:100%;border-radius:18px;padding:1rem 4rem .5rem 4rem;box-shadow:rgba(0,0,0,.45) 0 20px 22px 3px;margin-top:.5rem;margin-bottom:1rem;background-image:linear-gradient(to right,rgba(15,15,15,.5),#f5730f);width:95%;}.cardOrders03{width:100%;border-radius:18px;padding:1rem 4rem .5rem 4rem;box-shadow:rgba(0,0,0,.45) 0 20px 22px 3px;margin-top:.5rem;margin-bottom:1rem;background-image:linear-gradient(to right,rgba(15,15,15,.3),#23f587);}.btn01:after{animation-name:example;animation-duration:2s;}@keyframes example{from{background-color:#fff;}to{background-color:#000;}} \ No newline at end of file diff --git a/WebDoorCreator.UI/compilerconfig.json b/WebDoorCreator.UI/compilerconfig.json index 04c30b1..0b219d9 100644 --- a/WebDoorCreator.UI/compilerconfig.json +++ b/WebDoorCreator.UI/compilerconfig.json @@ -86,5 +86,9 @@ { "outputFile": "Components/Order/OrderDets.razor.css", "inputFile": "Components/Order/OrderDets.razor.less" + }, + { + "outputFile": "Pages/TestAnim.razor.css", + "inputFile": "Pages/TestAnim.razor.less" } ] \ No newline at end of file From f5e44de50c5e0c9613be49fb9c912e99a801a176 Mon Sep 17 00:00:00 2001 From: Emmanuele Sassi Date: Fri, 19 May 2023 11:06:43 +0200 Subject: [PATCH 2/2] - migliorie gestione processi --- WebDoorCreator.CamSrv/ProcMan.vb | 36 ++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/WebDoorCreator.CamSrv/ProcMan.vb b/WebDoorCreator.CamSrv/ProcMan.vb index bed064b..47b39e7 100644 --- a/WebDoorCreator.CamSrv/ProcMan.vb +++ b/WebDoorCreator.CamSrv/ProcMan.vb @@ -207,6 +207,7 @@ Public Class ProcMan If Not IsNothing(Thread) Then If Thread.IsAlive Then bOneNotEnded = True + Exit For End If End If Next @@ -224,7 +225,7 @@ Public Class ProcMan If Not bOk Then Thread.Sleep(10) End While - If bOk AndAlso (IsNothing(ThreadList) OrElse ThreadList.Count = 0 OrElse IsNothing(ThreadList(0))) Then + If bOk AndAlso (IsNothing(ThreadList) OrElse ThreadList.Count = 0) Then ThreadList = New Thread(m_MaxCamInstances - 1) {} ThreadDataList = New ThreadData(m_MaxCamInstances - 1) {} For nThreadIndex = 0 To m_MaxCamInstances - 1 @@ -235,7 +236,7 @@ Public Class ProcMan ThreadList(nThreadIndex).SetApartmentState(ApartmentState.STA) ' avvio thread di gestione della macchina che avvia la connessione ThreadList(nThreadIndex).Start() - Thread.Sleep(10) + Thread.Sleep(100) Next End If ' se qualche processo in stop, lo faccio ripartire @@ -245,15 +246,21 @@ Public Class ProcMan If Thread.ThreadState = ThreadState.Stopped OrElse Thread.ThreadState = ThreadState.Aborted OrElse Thread.ThreadState = ThreadState.Suspended Then Thread.Abort() - Thread.Sleep(1000) + Thread.Sleep(500) While Not Thread.ThreadState = ThreadState.Aborted - Thread.Sleep(1000) + Thread.Sleep(100) End While + Thread = Nothing Dim ThreadId As Integer = ThreadIndex Thread = New Thread(Sub() ThreadFunction(ThreadId) End Sub) End If + Else + Dim ThreadId As Integer = ThreadIndex + Thread = New Thread(Sub() + ThreadFunction(ThreadId) + End Sub) End If Next If n30SecCounter <= 30 Then @@ -586,15 +593,17 @@ Public Class ProcMan Private Sub stopAllThreads() m_bStopProcess = True - While Not m_bExecutionThreadStoped Thread.Sleep(100) End While - m_ExecutionThread.Abort() - While Not m_ExecutionThread.ThreadState = ThreadState.Aborted - Thread.Sleep(100) - End While - m_ExecutionThread = Nothing + If Not IsNothing(m_ExecutionThread) Then + m_ExecutionThread.Abort() + While Not m_ExecutionThread.ThreadState = ThreadState.Aborted + Thread.Sleep(100) + End While + m_ExecutionThread = Nothing + End If + ThreadList = Nothing ' fix timer TimerProgBar.Enabled = False TimerProgBar.Stop() @@ -931,8 +940,10 @@ Public Class ProcMan Private Sub CheckStartAutoRestart() TimerCheck.Enabled = chkAutoRestart.Checked If chkAutoRestart.Checked 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 + If IsNothing(m_ExecutionThread) Then + startAllThreads() + ElseIf m_ExecutionThread.ThreadState = ThreadState.Aborted OrElse m_ExecutionThread.ThreadState = ThreadState.Stopped OrElse + m_ExecutionThread.ThreadState = ThreadState.Suspended Then stopAllThreads() Thread.Sleep(200) While Not IsNothing(m_ExecutionThread) @@ -952,7 +963,6 @@ Public Class ProcMan End Sub Private Sub restartAll() - ' eseguo riavvio forzato ogni 30 sec! If Not IsNothing(m_ExecutionThread) Then stopAllThreads() Thread.Sleep(200)