262 lines
7.5 KiB
VB.net
262 lines
7.5 KiB
VB.net
Imports EgtUILib
|
|
|
|
Public Class TopPanelVM
|
|
|
|
#Region "FIELDS & PROPERTIES"
|
|
|
|
' Definizione comandi
|
|
Private m_cmdProduceAllRawPart As ICommand
|
|
Private m_cmdProduceRawPart As ICommand
|
|
Private m_cmdCopyRawPart As ICommand
|
|
Private m_cmdRemoveRawPart As ICommand
|
|
Private m_cmdRemovePart As ICommand
|
|
Private m_cmdMoveUpPart As ICommand
|
|
Private m_cmdMoveDownPart As ICommand
|
|
Private m_cmdReOrderPart As ICommand
|
|
|
|
#End Region 'FIELDS & PROPERTIES
|
|
|
|
Sub New()
|
|
' imposto riferimento su mappa
|
|
'Map.SetRefLeftPanelVM(Me)
|
|
End Sub
|
|
|
|
#Region "METHODS"
|
|
|
|
#End Region ' METHODS
|
|
|
|
#Region "COMMANDS"
|
|
|
|
#Region "ProduceRawPart"
|
|
|
|
''' <summary>
|
|
''' Returns a command that do Exec.
|
|
''' </summary>
|
|
Public ReadOnly Property ProduceRawPart_Command As ICommand
|
|
Get
|
|
If m_cmdProduceRawPart Is Nothing Then
|
|
m_cmdProduceRawPart = New Command(AddressOf ProduceRawPart)
|
|
End If
|
|
Return m_cmdProduceRawPart
|
|
End Get
|
|
End Property
|
|
|
|
''' <summary>
|
|
''' Execute the Exec. This method is invoked by the ExecCommand.
|
|
''' </summary>
|
|
Public Sub ProduceRawPart()
|
|
Dim SelMachGroup As Core.MyMachGroup = Map.refMachGroupPanelVM.SelectedMachGroup
|
|
If IsNothing(SelMachGroup) Then Return
|
|
DbControllers.m_MachGroupController.UpdateAssign(SelMachGroup.Id, DbControllers.m_SupervisorId)
|
|
End Sub
|
|
|
|
#End Region ' ProduceRawPart
|
|
|
|
#Region "ProduceAllRawPart"
|
|
|
|
''' <summary>
|
|
''' Returns a command that do Exec.
|
|
''' </summary>
|
|
Public ReadOnly Property ProduceAllRawPart_Command As ICommand
|
|
Get
|
|
If m_cmdProduceAllRawPart Is Nothing Then
|
|
m_cmdProduceAllRawPart = New Command(AddressOf ProduceAllRawPart)
|
|
End If
|
|
Return m_cmdProduceAllRawPart
|
|
End Get
|
|
End Property
|
|
|
|
''' <summary>
|
|
''' Execute the Exec. This method is invoked by the ExecCommand.
|
|
''' </summary>
|
|
Public Sub ProduceAllRawPart()
|
|
Dim SelMachGroup As Core.MyMachGroup = Map.refMachGroupPanelVM.SelectedMachGroup
|
|
If IsNothing(SelMachGroup) Then Return
|
|
|
|
|
|
End Sub
|
|
|
|
#End Region ' ProduceAllRawPart
|
|
|
|
#Region "CopyRawPart"
|
|
|
|
''' <summary>
|
|
''' Returns a command that do Exec.
|
|
''' </summary>
|
|
Public ReadOnly Property CopyRawPart_Command As ICommand
|
|
Get
|
|
If m_cmdCopyRawPart Is Nothing Then
|
|
m_cmdCopyRawPart = New Command(AddressOf CopyRawPart)
|
|
End If
|
|
Return m_cmdCopyRawPart
|
|
End Get
|
|
End Property
|
|
|
|
''' <summary>
|
|
''' Execute the Exec. This method is invoked by the ExecCommand.
|
|
''' </summary>
|
|
Public Sub CopyRawPart()
|
|
Dim SelMachGroup As Core.MyMachGroup = Map.refMachGroupPanelVM.SelectedMachGroup
|
|
If IsNothing(SelMachGroup) Then Return
|
|
|
|
|
|
End Sub
|
|
|
|
#End Region ' CopyRawPart
|
|
|
|
#Region "RemoveRawPart"
|
|
|
|
''' <summary>
|
|
''' Returns a command that do Exec.
|
|
''' </summary>
|
|
Public ReadOnly Property RemoveRawPart_Command As ICommand
|
|
Get
|
|
If m_cmdRemoveRawPart Is Nothing Then
|
|
m_cmdRemoveRawPart = New Command(AddressOf RemoveRawPart)
|
|
End If
|
|
Return m_cmdRemoveRawPart
|
|
End Get
|
|
End Property
|
|
|
|
''' <summary>
|
|
''' Execute the Exec. This method is invoked by the ExecCommand.
|
|
''' </summary>
|
|
Public Sub RemoveRawPart()
|
|
Dim SelMachGroup As Core.MyMachGroup = Map.refMachGroupPanelVM.SelectedMachGroup
|
|
If IsNothing(SelMachGroup) Then Return
|
|
SelMachGroup.DeleteMachGroup()
|
|
End Sub
|
|
|
|
#End Region ' RemoveRawPart
|
|
|
|
#Region "RemovePart"
|
|
|
|
''' <summary>
|
|
''' Returns a command that do Exec.
|
|
''' </summary>
|
|
Public ReadOnly Property RemovePart_Command As ICommand
|
|
Get
|
|
If m_cmdRemovePart Is Nothing Then
|
|
m_cmdRemovePart = New Command(AddressOf RemovePart)
|
|
End If
|
|
Return m_cmdRemovePart
|
|
End Get
|
|
End Property
|
|
|
|
''' <summary>
|
|
''' Execute the Exec. This method is invoked by the ExecCommand.
|
|
''' </summary>
|
|
Public Sub RemovePart()
|
|
Dim SelMachGroup As Core.MyMachGroup = Map.refMachGroupPanelVM.SelectedMachGroup
|
|
If IsNothing(SelMachGroup) Then Return
|
|
Dim SelPart As Core.Part = SelMachGroup.SelPart
|
|
If IsNothing(SelPart) Then Return
|
|
SelPart.DeletePart()
|
|
End Sub
|
|
|
|
#End Region ' RemovePart
|
|
|
|
#Region "MoveUpPart"
|
|
|
|
''' <summary>
|
|
''' Returns a command that do Exec.
|
|
''' </summary>
|
|
Public ReadOnly Property MoveUpPart_Command As ICommand
|
|
Get
|
|
If m_cmdMoveUpPart Is Nothing Then
|
|
m_cmdMoveUpPart = New Command(AddressOf MoveUpPart)
|
|
End If
|
|
Return m_cmdMoveUpPart
|
|
End Get
|
|
End Property
|
|
|
|
''' <summary>
|
|
''' Execute the Exec. This method is invoked by the ExecCommand.
|
|
''' </summary>
|
|
Public Sub MoveUpPart()
|
|
Dim SelMachGroup As Core.MyMachGroup = Map.refMachGroupPanelVM.SelectedMachGroup
|
|
If IsNothing(SelMachGroup) Then Return
|
|
Dim SelPart As Core.Part = SelMachGroup.SelPart
|
|
If IsNothing(SelPart) Then Return
|
|
If SelMachGroup.nMachineType = MachineType.BEAM Then
|
|
Dim BeamMachGroup As BeamMachGroup = DirectCast(SelMachGroup, BeamMachGroup)
|
|
BeamMachGroup.MoveBeam(SelPart, MoveDirections.UP)
|
|
EgtDraw()
|
|
' riseleziono trave
|
|
SelMachGroup.SelPart = SelPart
|
|
End If
|
|
End Sub
|
|
|
|
#End Region ' MoveUpPart
|
|
|
|
#Region "MoveDownPart"
|
|
|
|
''' <summary>
|
|
''' Returns a command that do Exec.
|
|
''' </summary>
|
|
Public ReadOnly Property MoveDownPart_Command As ICommand
|
|
Get
|
|
If m_cmdMoveDownPart Is Nothing Then
|
|
m_cmdMoveDownPart = New Command(AddressOf MoveDownPart)
|
|
End If
|
|
Return m_cmdMoveDownPart
|
|
End Get
|
|
End Property
|
|
|
|
''' <summary>
|
|
''' Execute the Exec. This method is invoked by the ExecCommand.
|
|
''' </summary>
|
|
Public Sub MoveDownPart()
|
|
Dim SelMachGroup As Core.MyMachGroup = Map.refMachGroupPanelVM.SelectedMachGroup
|
|
If IsNothing(SelMachGroup) Then Return
|
|
Dim SelPart As Core.Part = SelMachGroup.SelPart
|
|
If IsNothing(SelPart) Then Return
|
|
If SelMachGroup.nMachineType = MachineType.BEAM Then
|
|
Dim BeamMachGroup As BeamMachGroup = DirectCast(SelMachGroup, BeamMachGroup)
|
|
BeamMachGroup.MoveBeam(SelPart, MoveDirections.DOWN)
|
|
EgtDraw()
|
|
' riseleziono trave
|
|
SelMachGroup.SelPart = SelPart
|
|
End If
|
|
End Sub
|
|
|
|
#End Region ' MoveDownPart
|
|
|
|
#Region "ReOrderPart"
|
|
|
|
''' <summary>
|
|
''' Returns a command that do Exec.
|
|
''' </summary>
|
|
Public ReadOnly Property ReOrderPart_Command As ICommand
|
|
Get
|
|
If m_cmdReOrderPart Is Nothing Then
|
|
m_cmdReOrderPart = New Command(AddressOf ReOrderPart)
|
|
End If
|
|
Return m_cmdReOrderPart
|
|
End Get
|
|
End Property
|
|
|
|
''' <summary>
|
|
''' Execute the Exec. This method is invoked by the ExecCommand.
|
|
''' </summary>
|
|
Public Sub ReOrderPart()
|
|
Dim SelMachGroup As Core.MyMachGroup = Map.refMachGroupPanelVM.SelectedMachGroup
|
|
If IsNothing(SelMachGroup) Then Return
|
|
Dim SelPart As Core.Part = SelMachGroup.SelPart
|
|
If IsNothing(SelPart) Then Return
|
|
If SelMachGroup.nMachineType = MachineType.BEAM Then
|
|
Dim BeamMachGroup As BeamMachGroup = DirectCast(SelMachGroup, BeamMachGroup)
|
|
BeamMachGroup.ReorderBeam()
|
|
' riseleziono trave
|
|
If Not IsNothing(SelPart) AndAlso (IsNothing(SelMachGroup.SelPart) OrElse SelPart.nPartId <> SelMachGroup.SelPart.nPartId) Then
|
|
SelMachGroup.SelPart = SelPart
|
|
End If
|
|
End If
|
|
End Sub
|
|
|
|
#End Region ' ReOrderPart
|
|
|
|
#End Region ' COMMANDS
|
|
|
|
End Class
|