Files
EgtCAM5/OptionPanel/MachiningOptionPanel/OperationExpander/DispositionParameterExpander/RawPartOption/RawPartOptionVM.vb
T
Emmanuele Sassi 6dd2abf95d EgtCAM5 :
- Altri nomi modificati.
- Eliminato namespace.
2018-04-11 10:43:14 +00:00

125 lines
3.8 KiB
VB.net

Imports EgtUILib
Public Class RawPartOptionVM
Inherits ViewModelBase
Private m_MoveWithFixture As Boolean = False
Public Property MoveWithFixture As Boolean
Get
Return m_MoveWithFixture
End Get
Set(value As Boolean)
If value <> m_MoveWithFixture Then
If value Then
' Abilito la selezione di RawPart con autoselezione delle sue ventose
Application.Msn.NotifyColleagues(Application.SETSCENESELTYPE, SceneSelTypeOpt.RAWPARTWITHFIXTURE)
' Seleziono le ventose associate ad uno dei grezzi selezionati
' ciclo sui grezzi selezionati
Dim nSelRawPartId As Integer = EgtGetFirstSelectedObj()
While nSelRawPartId <> GDB_ID.NULL
' seleziono i sottopezzi del grezzo
DispositionUtility.SelectRawPartFixture(nSelRawPartId)
nSelRawPartId = EgtGetNextSelectedObj()
End While
Else
' Abilito la selezione di RawPart
Application.Msn.NotifyColleagues(Application.SETSCENESELTYPE, SceneSelTypeOpt.RAWPART)
' ciclo sui grezzi selezionati
Dim nSelRawPartId As Integer = EgtGetFirstSelectedObj()
While nSelRawPartId <> GDB_ID.NULL
' deseleziono i sottopezzi del grezzo
DispositionUtility.DeselectRawPartFixture(nSelRawPartId)
nSelRawPartId = EgtGetNextSelectedObj()
End While
End If
EgtDraw()
m_MoveWithFixture = value
OnPropertyChanged("MoveWithFixture")
End If
End Set
End Property
Private m_bRawPartParamVisibility As Visibility
Public ReadOnly Property RawPartParamVisibility As Visibility
Get
Return m_bRawPartParamVisibility
End Get
End Property
#Region "Messages"
Public ReadOnly Property NewMsg As String
Get
Return EgtMsg(MSG_DISPOSITION + 3)
End Get
End Property
Public ReadOnly Property RemoveMsg As String
Get
Return EgtMsg(MSG_DISPOSITION + 4)
End Get
End Property
Public ReadOnly Property LenghtMsg As String
Get
Return EgtMsg(MSG_DISPOSITION + 5)
End Get
End Property
Public ReadOnly Property WidthMsg As String
Get
Return EgtMsg(MSG_DISPOSITION + 6)
End Get
End Property
Public ReadOnly Property HeightMsg As String
Get
Return EgtMsg(MSG_DISPOSITION + 7)
End Get
End Property
Public ReadOnly Property PositionMsg As String
Get
Return EgtMsg(MSG_DISPOSITION + 8)
End Get
End Property
#End Region ' Messages
' Definizione comandi
Private m_cmdNewRawPart As ICommand
Private m_cmdRemoveRawPart As ICommand
Sub New()
If EgtGetFirstSelectedObj() <> GDB_ID.NULL Then
m_bRawPartParamVisibility = Visibility.Visible
Else
m_bRawPartParamVisibility = Visibility.Collapsed
End If
End Sub
#Region "COMMANDS"
#Region "NewRawPartCommand"
''' <summary>
''' Returns a command that do Done.
''' </summary>
Public ReadOnly Property NewRawPartCommand As ICommand
Get
If m_cmdNewRawPart Is Nothing Then
m_cmdNewRawPart = New RelayCommand(AddressOf NewRawPart)
End If
Return m_cmdNewRawPart
End Get
End Property
''' <summary>
''' Execute the Point. This method is invoked by the DoneCommand.
''' </summary>
Public Sub NewRawPart()
DispositionUtility.ShowParts()
m_bRawPartParamVisibility = Visibility.Visible
OnPropertyChanged("RawPartParamVisibility")
End Sub
#End Region ' NewRawPartCommand
#End Region ' Commands
End Class