d611f66d43
Correzioni e migliorie
87 lines
3.2 KiB
VB.net
87 lines
3.2 KiB
VB.net
Imports System.Collections.ObjectModel
|
|
Imports System.Collections.Specialized
|
|
Imports System.ComponentModel
|
|
Imports System.IO
|
|
Imports EgtBEAMWALL.Core
|
|
Imports EgtUILib
|
|
Imports EgtWPFLib5
|
|
|
|
Public Class BeamMachGroupVM
|
|
Inherits Core.BeamMachGroupVM
|
|
|
|
' definizione comandi
|
|
Private m_cmdDeleteMachGroup As ICommand
|
|
|
|
Sub New(BeamMachGroupM As BeamMachGroupM)
|
|
MyBase.New(BeamMachGroupM)
|
|
End Sub
|
|
|
|
#Region "METHODS"
|
|
|
|
Protected Overrides Sub CreateBeamVMList()
|
|
Dim all As List(Of BeamVM) = (From BeamM In m_BeamMachGroupM.GetParts()
|
|
Select New BeamVM(BeamM, Me)).ToList()
|
|
|
|
For Each BeamVM As BeamVM In all
|
|
AddHandler BeamVM.PropertyChanged, AddressOf OnBeamVMPropertyChanged
|
|
Next
|
|
|
|
m_PartVMList = New ObservableCollection(Of PartVM)(all)
|
|
AddHandler m_PartVMList.CollectionChanged, AddressOf OnBeamVMListChanged
|
|
End Sub
|
|
|
|
Protected Overrides Sub OnBeamAdded(sender As Object, e As PartAddedEventArgs)
|
|
Dim BeamVM As BeamVM = New BeamVM(e.NewPart, Me)
|
|
PartVMList.Add(BeamVM)
|
|
End Sub
|
|
|
|
Overrides Function CnFilePath() As String
|
|
Return Map.refSupervisorManagerVM.CurrProd.sProdDirPath & "\" & Name & ".cnc"
|
|
End Function
|
|
|
|
Public Overrides Sub CALCEnd()
|
|
' aggiorno stato per lancio in macchina
|
|
If MyMachGroupM.m_nCALC_GlobalState = Core.CalcStates.OK OrElse MyMachGroupM.m_nCALC_GlobalState = Core.CalcStates.INFO Then
|
|
m_bCNReCalculated = True
|
|
NotifyPropertyChanged(NameOf(Production_Background))
|
|
End If
|
|
End Sub
|
|
|
|
#End Region ' METHODS
|
|
|
|
#Region "COMMANDS"
|
|
|
|
#Region "ProduceMachGroup"
|
|
|
|
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
|
Public Overrides Sub ProduceMachGroup()
|
|
' se gia' in produzione, non devo fare nulla
|
|
If m_bToBeProduced Then Return
|
|
' se lavorazione interrotta da reset
|
|
If bResetWhileCutting Then
|
|
' chiedo se riprendere o rimandare i pezzi non fatti all'ottimizzatore
|
|
If MessageBox.Show("Riprendere lavorazione barra corrente?", "", MessageBoxButton.YesNo, MessageBoxImage.Information) = MessageBoxResult.Yes Then
|
|
' se ripresa, lancio finestra per definire da dove
|
|
|
|
End If
|
|
End If
|
|
' cerco primo indice di pezzo non in produzione
|
|
Dim NewIndex As Integer = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.IndexOf(Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) DirectCast(x, MyMachGroupVM).dtStartTime = DateTime.MinValue AndAlso DirectCast(x, MyMachGroupVM).bToBeProduced = False))
|
|
' segno pezzo da produrre
|
|
m_bToBeProduced = True
|
|
NotifyPropertyChanged(NameOf(Production_Background))
|
|
' lancio ricalcolo del CN
|
|
Map.refCALCPanelVM.VerifyMachGroup(Me)
|
|
|
|
' sposto MachGroup in lista come ultimo dei pronti da produrre
|
|
Dim OldIndex As Integer = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.IndexOf(Me)
|
|
DbControllers.m_MachGroupController.UpdateOrder(Map.refSupervisorManagerVM.CurrProd.nProdId, Id, NewIndex)
|
|
Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Move(OldIndex, NewIndex)
|
|
End Sub
|
|
|
|
#End Region ' ProduceMachGroup
|
|
|
|
#End Region ' COMMANDS
|
|
|
|
End Class
|