This commit is contained in:
zaccaria.majid
2023-05-19 11:29:59 +02:00
8 changed files with 430 additions and 128 deletions
+136 -127
View File
@@ -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
@@ -6,4 +6,19 @@
/*box-shadow: rgba(0, 0, 0, 0.45) 0px 20px 22px -9px;*/
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;
}
}*/
@@ -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;
}
}*/
+129
View File
@@ -0,0 +1,129 @@
@using WebDoorCreator.UI.Components.SvgComp
@using WebDoorCreator.UI.Data
@page "/TestAnim"
@inject WebDoorCreatorService WDCService
<div class="w-100 text-center">
@if (CurrLevel == 1)
{
<div class="cardOrders01">
<div class="d-flex justify-content-between mb-3">
<div class="fw-bold fs-2 text-start">
LEVEL 01
</div>
<div class="d-flex justify-content-between">
@* <button class="btn btn-sm btn-warning btn01" @onclick="() => changeLevel(1)">
<i class="fa-solid fa-plus"></i> Return To L01
</button>*@
</div>
</div>
<div style="min-height: 20rem;">
Elenco ordini
<hr />
<button class="btn btn-sm btn-warning btn01" @onclick="() => changeLevel(2)">
<i class="fa-solid fa-plus"></i> GoTo L02
</button>
</div>
<div class="mt-2">
pager
</div>
</div>
}
else if (CurrLevel == 2)
{
<div class="cardOrders01Red">
<div class="d-flex justify-content-between mb-3">
<div class="fw-bold fs-2 text-start">
LEVEL 01
</div>
<div class="d-flex justify-content-between">
<button class="btn btn-sm btn-warning btn01" @onclick="() => changeLevel(1)">
<i class="fa-solid fa-plus"></i> Return To L01
</button>
</div>
</div>
</div>
<div class="cardOrders02">
<div class="d-flex justify-content-between mb-3">
<div class="fw-bold fs-2 text-start">
LEVEL 02
</div>
<div class="d-flex justify-content-between">
@*<button class="btn btn-sm btn-warning btn01" @onclick="() => changeLevel(2)">
<i class="fa-solid fa-plus"></i> Return To L02
</button>*@
</div>
</div>
<div style="min-height: 20rem;">
Elenco Porte
<hr />
<button class="btn btn-sm btn-warning btn01" @onclick="() => changeLevel(3)">
<i class="fa-solid fa-plus"></i> GoTo L03
</button>
</div>
<div class="mt-2">
pager
</div>
</div>
}
else
{
<div class="cardOrders01Red">
<div class="d-flex justify-content-between mb-3">
<div class="fw-bold fs-2 text-start">
LEVEL 01
</div>
<div class="d-flex justify-content-between">
<button class="btn btn-sm btn-warning btn01" @onclick="() => changeLevel(1)">
<i class="fa-solid fa-plus"></i> Return To L01
</button>
</div>
</div>
</div>
<div class="cardOrders02Red">
<div class="d-flex justify-content-between mb-3">
<div class="fw-bold fs-2 text-start">
LEVEL 02
</div>
<div class="d-flex justify-content-between">
<button class="btn btn-sm btn-warning btn01" @onclick="() => changeLevel(2)">
<i class="fa-solid fa-plus"></i> Return To L02
</button>
</div>
</div>
</div>
<div class="cardOrders03">
<div class="d-flex justify-content-between mb-3">
<div class="fw-bold fs-2 text-start">
LEVEL 03
</div>
<div class="d-flex justify-content-between">
@* <button class="btn btn-sm btn-success" @onclick="() => changeLevel(1)">
<i class="fa-solid fa-plus"></i> GoTo L01
</button>*@
</div>
</div>
<div style="min-height: 20rem;">
Elenco HW
</div>
<div class="mt-2">
pager
</div>
</div>
}
</div>
@code {
protected int CurrLevel { get; set; } = 1;
protected async Task changeLevel(int newLevel)
{
CurrLevel = newLevel;
}
}
@@ -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;
}
*/
@@ -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;
}
*/
+1
View File
@@ -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;}}
+4
View File
@@ -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"