- Migliorie Calc pezzi
- Correzione flip e rot dei duplo - Cambiata gestione ricalcolo in supervisore - Aggiunti controlli su comunicazione tra programmi - Gestione apertura progetto con s/blocco duplo - Gestione errore ricalcolo in supervisore - Aggiunti controlli su cicli di comunicazione tra programmi
This commit is contained in:
@@ -31,28 +31,30 @@ Public Class SupervisorComm
|
||||
' recupero elementi modificati
|
||||
Dim MachGroupList As List(Of StatusMapModel) = DbControllers.m_StatusMapController.GetFrom(Map.refProjManagerVM.CurrProj.nModificationIndex + 1)
|
||||
Dim bReloadFile As Boolean = False
|
||||
For Each MachGroupModification In MachGroupList
|
||||
If MachGroupModification.ItemType = StatusMapItemType.Part Then
|
||||
Dim BTLPart As BTLPartVM = CALCPanelVM.GetBTLPartVMFromPartId(MachGroupModification.ItemId)
|
||||
Select Case MachGroupModification.Operation
|
||||
Case Core.StatusMapOpType.PartStart
|
||||
If Not IsNothing(MachGroupList) Then
|
||||
For Each MachGroupModification In MachGroupList
|
||||
If MachGroupModification.ItemType = StatusMapItemType.Part Then
|
||||
Dim BTLPart As BTLPartVM = CALCPanelVM.GetBTLPartVMFromPartId(MachGroupModification.ItemId)
|
||||
Select Case MachGroupModification.Operation
|
||||
Case Core.StatusMapOpType.PartStart
|
||||
' non faccio nulla
|
||||
Case Core.StatusMapOpType.PartEnd, StatusMapOpType.ResetPartStart, StatusMapOpType.ResetPartEnd
|
||||
BTLPart.NotifyPropertyChanged(NameOf(BTLPart.nDONE))
|
||||
BTLPart.NotifyPropertyChanged(NameOf(BTLPart.Background))
|
||||
End Select
|
||||
ElseIf MachGroupModification.ItemType = StatusMapItemType.Comm Then
|
||||
' se arriva richiesta da supervisore di blocco e salvataggio
|
||||
Select Case MachGroupModification.Operation
|
||||
Case StatusMapOpType.SupervisorStopRequest
|
||||
' blocco interfaccia fino a notifica di sblocco
|
||||
SupervisorCommThread.SetViewerOptimizerBlocked(True)
|
||||
Case Core.StatusMapOpType.PartEnd, StatusMapOpType.ResetPartStart, StatusMapOpType.ResetPartEnd
|
||||
BTLPart.NotifyPropertyChanged(NameOf(BTLPart.nDONE))
|
||||
BTLPart.NotifyPropertyChanged(NameOf(BTLPart.Background))
|
||||
End Select
|
||||
ElseIf MachGroupModification.ItemType = StatusMapItemType.Comm Then
|
||||
' se arriva richiesta da supervisore di blocco e salvataggio
|
||||
Select Case MachGroupModification.Operation
|
||||
Case StatusMapOpType.SupervisorStopRequest
|
||||
' blocco interfaccia fino a notifica di sblocco
|
||||
SupervisorCommThread.SetViewerOptimizerBlocked(True)
|
||||
'' chiedo se salvare
|
||||
Case StatusMapOpType.SupervisorReleaseStop
|
||||
SupervisorCommThread.SetViewerOptimizerBlocked(False)
|
||||
End Select
|
||||
End If
|
||||
Next
|
||||
Case StatusMapOpType.SupervisorReleaseStop
|
||||
SupervisorCommThread.SetViewerOptimizerBlocked(False)
|
||||
End Select
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
' aggiorno indice del proj
|
||||
Map.refProjManagerVM.CurrProj.SetModificationIndex(nModificationIndex)
|
||||
End If
|
||||
@@ -75,75 +77,91 @@ Public Class SupervisorComm
|
||||
If nModificationIndex <> Map.refProdManagerVM.CurrProd.nModificationIndex Then
|
||||
' recupero elementi modificati
|
||||
Dim MachGroupList As List(Of StatusMapModel) = DbControllers.m_StatusMapController.GetFrom(Map.refProdManagerVM.CurrProd.nModificationIndex + 1)
|
||||
Dim bReloadFile As Boolean = False
|
||||
For Each MachGroupModification In MachGroupList
|
||||
If Not SupervisorCommThread.bViewerOptimizerBlocked AndAlso MachGroupModification.ItemType = StatusMapItemType.MachGroup Then
|
||||
Dim MachGroup As MyMachGroupVM = Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = MachGroupModification.ItemId)
|
||||
Select Case MachGroupModification.Operation
|
||||
Case Core.StatusMapOpType.PartStart
|
||||
MachGroup.dtStartTime = MachGroupModification.DtEvent
|
||||
MachGroup.nProduction_State = ItemState.WIP
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.nProduction_State))
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.Background))
|
||||
Case Core.StatusMapOpType.PartEnd
|
||||
MachGroup.dtEndTime = MachGroupModification.DtEvent
|
||||
MachGroup.nProduction_State = ItemState.Produced
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.Background))
|
||||
Case Core.StatusMapOpType.ResetPartStart
|
||||
MachGroup.dtStartTime = DateTime.MinValue
|
||||
MachGroup.nProduction_State = ItemState.Assigned
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.nProduction_State))
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.Background))
|
||||
Case Core.StatusMapOpType.ResetPartEnd
|
||||
MachGroup.dtEndTime = DateTime.MinValue
|
||||
MachGroup.nProduction_State = ItemState.WIP
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.nProduction_State))
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.Background))
|
||||
Case Core.StatusMapOpType.MachGroupRemovedFromSupervisor
|
||||
MachGroup.ResetSupervisorId()
|
||||
End Select
|
||||
ElseIf MachGroupModification.ItemType = StatusMapItemType.Part Then
|
||||
Dim BTLPart As BTLPartVM = CALCPanelVM.GetBTLPartVMFromPartId(MachGroupModification.ItemId)
|
||||
Dim Part As PartVM = CALCPanelVM.GetPartVMFromPartId(MachGroupModification.ItemId)
|
||||
Select Case MachGroupModification.Operation
|
||||
Case Core.StatusMapOpType.PartStart
|
||||
Part.dtStartTime = MachGroupModification.DtEvent
|
||||
Part.nProduction_State = ItemState.WIP
|
||||
Part.NotifyPropertyChanged(NameOf(Part.Background))
|
||||
Case Core.StatusMapOpType.PartEnd
|
||||
Part.dtEndTime = MachGroupModification.DtEvent
|
||||
Part.nProduction_State = ItemState.Produced
|
||||
Part.NotifyPropertyChanged(NameOf(Part.Background))
|
||||
BTLPart.NotifyPropertyChanged(NameOf(BTLPart.nDONE))
|
||||
BTLPart.NotifyPropertyChanged(NameOf(BTLPart.Background))
|
||||
Case Core.StatusMapOpType.ResetPartStart
|
||||
Part.dtStartTime = DateTime.MinValue
|
||||
Part.nProduction_State = ItemState.Assigned
|
||||
Part.NotifyPropertyChanged(NameOf(Part.Background))
|
||||
Case Core.StatusMapOpType.ResetPartEnd
|
||||
Part.dtEndTime = DateTime.MinValue
|
||||
Part.nProduction_State = ItemState.WIP
|
||||
Part.NotifyPropertyChanged(NameOf(Part.Background))
|
||||
BTLPart.NotifyPropertyChanged(NameOf(BTLPart.nDONE))
|
||||
BTLPart.NotifyPropertyChanged(NameOf(BTLPart.Background))
|
||||
End Select
|
||||
ElseIf MachGroupModification.ItemType = StatusMapItemType.Comm Then
|
||||
' se arriva richiesta da supervisore di blocco e salvataggio
|
||||
Select Case MachGroupModification.Operation
|
||||
Case StatusMapOpType.SupervisorStopRequest
|
||||
' blocco interfaccia fino a notifica di sblocco
|
||||
SupervisorCommThread.SetViewerOptimizerBlocked(True)
|
||||
If Not IsNothing(MachGroupList) Then
|
||||
Dim bReloadFile As Boolean = False
|
||||
For Each MachGroupModification In MachGroupList
|
||||
If Not SupervisorCommThread.bViewerOptimizerBlocked AndAlso MachGroupModification.ItemType = StatusMapItemType.MachGroup Then
|
||||
Dim MachGroup As MyMachGroupVM = Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = MachGroupModification.ItemId)
|
||||
If Not IsNothing(MachGroup) Then
|
||||
Select Case MachGroupModification.Operation
|
||||
Case Core.StatusMapOpType.PartStart
|
||||
MachGroup.dtStartTime = MachGroupModification.DtEvent
|
||||
MachGroup.nProduction_State = ItemState.WIP
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.nProduction_State))
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.Background))
|
||||
Case Core.StatusMapOpType.PartEnd
|
||||
MachGroup.dtEndTime = MachGroupModification.DtEvent
|
||||
MachGroup.nProduction_State = ItemState.Produced
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.Background))
|
||||
Case Core.StatusMapOpType.ResetPartStart
|
||||
MachGroup.dtStartTime = DateTime.MinValue
|
||||
MachGroup.nProduction_State = ItemState.Assigned
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.nProduction_State))
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.Background))
|
||||
Case Core.StatusMapOpType.ResetPartEnd
|
||||
MachGroup.dtEndTime = DateTime.MinValue
|
||||
MachGroup.nProduction_State = ItemState.WIP
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.nProduction_State))
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.Background))
|
||||
Case Core.StatusMapOpType.MachGroupRemovedFromSupervisor
|
||||
MachGroup.ResetSupervisorId()
|
||||
End Select
|
||||
End If
|
||||
ElseIf MachGroupModification.ItemType = StatusMapItemType.Part Then
|
||||
Dim BTLPart As BTLPartVM = CALCPanelVM.GetBTLPartVMFromPartId(MachGroupModification.ItemId)
|
||||
Dim Part As PartVM = CALCPanelVM.GetPartVMFromPartId(MachGroupModification.ItemId)
|
||||
Select Case MachGroupModification.Operation
|
||||
Case Core.StatusMapOpType.PartStart
|
||||
If Not IsNothing(Part) Then
|
||||
Part.dtStartTime = MachGroupModification.DtEvent
|
||||
Part.nProduction_State = ItemState.WIP
|
||||
Part.NotifyPropertyChanged(NameOf(Part.Background))
|
||||
End If
|
||||
Case Core.StatusMapOpType.PartEnd
|
||||
If Not IsNothing(Part) Then
|
||||
Part.dtEndTime = MachGroupModification.DtEvent
|
||||
Part.nProduction_State = ItemState.Produced
|
||||
Part.NotifyPropertyChanged(NameOf(Part.Background))
|
||||
End If
|
||||
If Not IsNothing(BTLPart) Then
|
||||
BTLPart.NotifyPropertyChanged(NameOf(BTLPart.nDONE))
|
||||
BTLPart.NotifyPropertyChanged(NameOf(BTLPart.Background))
|
||||
End If
|
||||
Case Core.StatusMapOpType.ResetPartStart
|
||||
If Not IsNothing(Part) Then
|
||||
Part.dtStartTime = DateTime.MinValue
|
||||
Part.nProduction_State = ItemState.Assigned
|
||||
Part.NotifyPropertyChanged(NameOf(Part.Background))
|
||||
End If
|
||||
Case Core.StatusMapOpType.ResetPartEnd
|
||||
If Not IsNothing(Part) Then
|
||||
Part.dtEndTime = DateTime.MinValue
|
||||
Part.nProduction_State = ItemState.WIP
|
||||
Part.NotifyPropertyChanged(NameOf(Part.Background))
|
||||
End If
|
||||
If Not IsNothing(BTLPart) Then
|
||||
BTLPart.NotifyPropertyChanged(NameOf(BTLPart.nDONE))
|
||||
BTLPart.NotifyPropertyChanged(NameOf(BTLPart.Background))
|
||||
End If
|
||||
End Select
|
||||
ElseIf MachGroupModification.ItemType = StatusMapItemType.Comm Then
|
||||
' se arriva richiesta da supervisore di blocco e salvataggio
|
||||
Select Case MachGroupModification.Operation
|
||||
Case StatusMapOpType.SupervisorStopRequest
|
||||
' blocco interfaccia fino a notifica di sblocco
|
||||
SupervisorCommThread.SetViewerOptimizerBlocked(True)
|
||||
'' chiedo se salvare
|
||||
'Map.refMainWindowVM.m_SupervisorStop = True
|
||||
Case StatusMapOpType.SupervisorReleaseStop
|
||||
Dim MachGroupId As Integer = -1
|
||||
If Not String.IsNullOrWhiteSpace(MachGroupModification.Val) Then Integer.TryParse(MachGroupModification.Val, MachGroupId)
|
||||
If IsNothing(MachGroupId) Then MachGroupId = -1
|
||||
SupervisorCommThread.SetViewerOptimizerBlocked(False, MachGroupId)
|
||||
'Map.refMainWindowVM.m_SupervisorStop = False
|
||||
End Select
|
||||
End If
|
||||
Next
|
||||
Case StatusMapOpType.SupervisorReleaseStop
|
||||
Dim MachGroupId As Integer = -1
|
||||
If Not String.IsNullOrWhiteSpace(MachGroupModification.Val) Then Integer.TryParse(MachGroupModification.Val, MachGroupId)
|
||||
If IsNothing(MachGroupId) Then MachGroupId = -1
|
||||
SupervisorCommThread.SetViewerOptimizerBlocked(False, MachGroupId)
|
||||
'Map.refMainWindowVM.m_SupervisorStop = False
|
||||
End Select
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
' aggiorno indice del prod
|
||||
Map.refProdManagerVM.CurrProd.SetModificationIndex(nModificationIndex)
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user