diff --git a/WebDoorCreator.CamSrv/ProcMan.vb b/WebDoorCreator.CamSrv/ProcMan.vb index 61a0dd5..357c0de 100644 --- a/WebDoorCreator.CamSrv/ProcMan.vb +++ b/WebDoorCreator.CamSrv/ProcMan.vb @@ -175,96 +175,102 @@ Public Class ProcMan Dim sCurrDdfDir As String = "" Dim nDdfId As Integer = 1 - Dim bStopMainProcess As Boolean = False - Dim n30SecCounter As Integer = 0 - While Not bStopMainProcess - bStopMainProcess = m_bStopProcess - Dim bOk As Boolean = False - While Not bOk - 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 + Dim bStopMainProcess As Boolean = False + Dim n30SecCounter As Integer = 0 + While Not bStopMainProcess + bStopMainProcess = m_bStopProcess + Dim bOk As Boolean = False + While Not bOk + 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 - ' test boolean diretto - bOk = currWDC.testPingOk - If bOk Then - bOk = currWDC.testAlive + ' test boolean diretto + bOk = currWDC.testPingOk + If bOk Then + bOk = currWDC.testAlive + End If + Else + bOk = True + End If + End If + ' se connessione non ok o processo fermato, fermo i thread + If Not bOk OrElse bStopMainProcess Then + If Not IsNothing(ThreadList) AndAlso ThreadList.Count > 0 AndAlso Not IsNothing(ThreadList(0)) Then + ' li fermo + m_bStopProcess = True + ' verifico siano terminati + Dim bOneNotEnded As Boolean = True + While bOneNotEnded + bOneNotEnded = False + For Each Thread In ThreadList + If Not IsNothing(Thread) Then + If Thread.IsAlive Then + bOneNotEnded = True + End If End If - Else - bOk = True - End If - End If - ' se connessione non ok o processo fermato, fermo i thread - If Not bOk OrElse bStopMainProcess Then - If Not IsNothing(ThreadList) AndAlso ThreadList.Count > 0 AndAlso Not IsNothing(ThreadList(0)) Then - ' li fermo - m_bStopProcess = True - ' verifico siano terminati - Dim bOneNotEnded As Boolean = True - While bOneNotEnded - bOneNotEnded = False - For Each Thread In ThreadList - If Not IsNothing(Thread) Then - If Thread.IsAlive Then - bOneNotEnded = True - End If - End If - Next - End While - ' pulisco la lista - For ThreadIndex = 0 To ThreadList.Count - 1 - ThreadList(ThreadIndex) = Nothing - Next - End If - If bStopMainProcess Then - m_bExecutionThreadStoped = True - Return - End If - End If - If Not bOk Then Thread.Sleep(10) - End While + Next + End While + ' pulisco la lista + For ThreadIndex = 0 To ThreadList.Count - 1 + ThreadList(ThreadIndex) = Nothing + Next + End If + If bStopMainProcess Then + m_bExecutionThreadStoped = True + Return + End If + End If + If Not bOk Then Thread.Sleep(10) + End While - If bOk AndAlso (IsNothing(ThreadList) OrElse ThreadList.Count = 0 OrElse IsNothing(ThreadList(0))) Then - ThreadList = New Thread(m_MaxCamInstances - 1) {} - ThreadDataList = New ThreadData(m_MaxCamInstances - 1) {} - For nThreadIndex = 0 To m_MaxCamInstances - 1 - Dim ThreadId As Integer = nThreadIndex - ThreadList(nThreadIndex) = New Thread(Sub() - ThreadFunction(ThreadId) - End Sub) - ThreadList(nThreadIndex).SetApartmentState(ApartmentState.STA) - ' avvio thread di gestione della macchina che avvia la connessione - ThreadList(nThreadIndex).Start() - Thread.Sleep(10) - Next - End If - ' se qualche processo in stop, lo faccio ripartire - For ThreadIndex = 0 To ThreadList.Count - 1 - Dim Thread = ThreadList(ThreadIndex) - If Not IsNothing(Thread) Then - If Thread.ThreadState = ThreadState.Stopped OrElse Thread.ThreadState = ThreadState.Aborted OrElse - Thread.ThreadState = ThreadState.Suspended Then - 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 + 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 + Dim ThreadId As Integer = nThreadIndex + ThreadList(nThreadIndex) = New Thread(Sub() + ThreadFunction(ThreadId) + End Sub) + ThreadList(nThreadIndex).SetApartmentState(ApartmentState.STA) + ' avvio thread di gestione della macchina che avvia la connessione + ThreadList(nThreadIndex).Start() + Thread.Sleep(100) Next - If n30SecCounter <= 30 Then - n30SecCounter += 1 + End If + ' se qualche processo in stop, lo faccio ripartire + For ThreadIndex = 0 To ThreadList.Count - 1 + Dim Thread = ThreadList(ThreadIndex) + If Not IsNothing(Thread) Then + If Thread.ThreadState = ThreadState.Stopped OrElse Thread.ThreadState = ThreadState.Aborted OrElse + Thread.ThreadState = ThreadState.Suspended Then + Thread.Abort() + Thread.Sleep(500) + While Not Thread.ThreadState = ThreadState.Aborted + Thread.Sleep(100) + End While + Thread = Nothing + Dim ThreadId As Integer = ThreadIndex + Thread = New Thread(Sub() + ThreadFunction(ThreadId) + End Sub) + End If Else - n30SecCounter = 1 + Dim ThreadId As Integer = ThreadIndex + Thread = New Thread(Sub() + ThreadFunction(ThreadId) + End Sub) End If - Thread.Sleep(1000) + Next + If n30SecCounter <= 30 Then + n30SecCounter += 1 + Else + n30SecCounter = 1 + End If + Thread.Sleep(1000) End While @@ -587,21 +593,23 @@ Public Class ProcMan TimerProgBar.Start() End Sub - Private Sub stopAllThreads() - m_bStopProcess = True - - While Not m_bExecutionThreadStoped + Private Sub stopAllThreads() + m_bStopProcess = True + While Not m_bExecutionThreadStoped + Thread.Sleep(100) + End While + If Not IsNothing(m_ExecutionThread) Then + m_ExecutionThread.Abort() + While Not m_ExecutionThread.ThreadState = ThreadState.Aborted 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 - TimerProgBar.Enabled = False - TimerProgBar.Stop() - End Sub + End While + m_ExecutionThread = Nothing + End If + ThreadList = Nothing + ' fix timer + TimerProgBar.Enabled = False + TimerProgBar.Stop() + End Sub Private Sub StopProcess_Click(sender As Object, e As EventArgs) Handles StopProcess.Click stopAllThreads() @@ -931,41 +939,42 @@ Public Class ProcMan CheckStartAutoRestart() End Sub - 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 - stopAllThreads() - Thread.Sleep(200) - While Not IsNothing(m_ExecutionThread) - Thread.Sleep(100) - End While - Thread.Sleep(100) - startAllThreads() - End If - TimerCheck.Start() - Else - TimerCheck.Stop() - End If - End Sub + Private Sub CheckStartAutoRestart() + TimerCheck.Enabled = chkAutoRestart.Checked + If chkAutoRestart.Checked 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) + Thread.Sleep(100) + End While + Thread.Sleep(100) + startAllThreads() + End If + TimerCheck.Start() + Else + TimerCheck.Stop() + End If + End Sub Private Sub TimerCheck_Tick(sender As Object, e As EventArgs) Handles TimerCheck.Tick restartAll() End Sub - Private Sub restartAll() - ' eseguo riavvio forzato ogni 30 sec! - If Not IsNothing(m_ExecutionThread) Then - stopAllThreads() - Thread.Sleep(200) - While Not IsNothing(m_ExecutionThread) - Thread.Sleep(100) - End While + Private Sub restartAll() + If Not IsNothing(m_ExecutionThread) Then + stopAllThreads() + Thread.Sleep(200) + While Not IsNothing(m_ExecutionThread) Thread.Sleep(100) - End If - startAllThreads() - End Sub + End While + Thread.Sleep(100) + End If + startAllThreads() + End Sub #End Region 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 d769aee..19c85a5 100644 --- a/WebDoorCreator.UI/compilerconfig.json +++ b/WebDoorCreator.UI/compilerconfig.json @@ -87,6 +87,10 @@ "outputFile": "Components/Order/OrderDets.razor.css", "inputFile": "Components/Order/OrderDets.razor.less" }, + { + "outputFile": "Pages/TestAnim.razor.css", + "inputFile": "Pages/TestAnim.razor.less" + }, { "outputFile": "Pages/TestModal.razor.css", "inputFile": "Pages/TestModal.razor.less"