140 lines
3.9 KiB
VB.net
140 lines
3.9 KiB
VB.net
Imports EgtUILib
|
|
Imports EgtWPFLib5
|
|
Public Class FinalMoveRawModeVM
|
|
|
|
#Region "CONSTRUCTOR"
|
|
Private m_nAuxTabId As Integer = GDB_ID.NULL
|
|
Public ReadOnly Property nAuxTabId As Integer
|
|
Get
|
|
Return m_nAuxTabId
|
|
End Get
|
|
End Property
|
|
Sub New()
|
|
' Creo riferimento a questa classe in OmagOFFICEMap
|
|
OmagOFFICEMap.SetRefFinalMoveRawModeVM(Me)
|
|
End Sub
|
|
|
|
' Definizione comandi
|
|
Private m_cmdTopLeft As ICommand
|
|
Private m_cmdTopRight As ICommand
|
|
Private m_cmdBottomLeft As ICommand
|
|
Private m_cmdBottomRight As ICommand
|
|
Private m_cmdReset As ICommand
|
|
|
|
#End Region ' CONSTRUCTOR
|
|
|
|
Public Function Init() As Boolean
|
|
|
|
Dim bOk As Boolean = False
|
|
' OmagOFFICEMap.refMoveRawModeVM.InitMoveRaw()
|
|
m_nAuxTabId = EgtGetTableId(AUX_TAB)
|
|
' Visualizzo tavolo ausiliario
|
|
Dim bOldEnMod As Boolean = EgtGetEnableModified()
|
|
If bOldEnMod Then EgtDisableModified()
|
|
EgtSetStatus(m_nAuxTabId, GDB_ST.ON_)
|
|
If bOldEnMod Then EgtEnableModified()
|
|
' Area tavolo ausiliario
|
|
Dim b3AuxTab As New BBox3d
|
|
EgtGetBBoxGlob(EgtGetFirstNameInGroup(m_nAuxTabId, "A1"), GDB_BB.STANDARD, b3AuxTab)
|
|
' Area tavolo principale
|
|
Dim b3Tab As New BBox3d
|
|
EgtGetTableArea(1, b3Tab)
|
|
' Imposto offset su tavolo principale per includere anche il secondario
|
|
Dim dOffsXP As Double = Math.Max(b3AuxTab.Max().x - b3Tab.Max().x, 0)
|
|
Dim dOffsYP As Double = Math.Max(b3AuxTab.Max().y - b3Tab.Max().y, 0)
|
|
Dim dOffsXM As Double = Math.Max(b3Tab.Min().x - b3AuxTab.Min().x, 0)
|
|
Dim dOffsYM As Double = Math.Max(b3Tab.Min().y - b3AuxTab.Min().y, 0)
|
|
bOk = EgtSetTableAreaOffset(dOffsXP, dOffsYP, dOffsXM, dOffsYM)
|
|
EgtZoom(ZM.ALL)
|
|
Return bOk
|
|
End Function
|
|
|
|
#Region "TopLeft"
|
|
|
|
Public ReadOnly Property TopLeftCommand As ICommand
|
|
Get
|
|
If m_cmdTopLeft Is Nothing Then
|
|
m_cmdTopLeft = New Command(AddressOf TopLeft)
|
|
End If
|
|
Return m_cmdTopLeft
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub TopLeft(ByVal param As Object)
|
|
OmagOFFICEMap.refMoveRawModeVM.MoveOnRef("REF4", MCH_CR.TL)
|
|
End Sub
|
|
|
|
#End Region ' TopLeft
|
|
|
|
#Region "TopRight"
|
|
|
|
Public ReadOnly Property TopRightCommand As ICommand
|
|
Get
|
|
If m_cmdTopRight Is Nothing Then
|
|
m_cmdTopRight = New Command(AddressOf TopRight)
|
|
End If
|
|
Return m_cmdTopRight
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub TopRight(ByVal param As Object)
|
|
OmagOFFICEMap.refMoveRawModeVM.MoveOnRef("REF3", MCH_CR.TR)
|
|
'' salvo il file per verifica che siano stati salvati i dati di movimentazione del pezzo
|
|
'EgtSaveFile("c:\EgtData\OmagOFFICE\Temp\FINALRAWMOVE_02.nge", NGE.TEXT)
|
|
End Sub
|
|
|
|
#End Region ' TopRight
|
|
|
|
#Region "BottomLeft"
|
|
|
|
Public ReadOnly Property BottomLeftCommand As ICommand
|
|
Get
|
|
If m_cmdBottomLeft Is Nothing Then
|
|
m_cmdBottomLeft = New Command(AddressOf BottomLeft)
|
|
End If
|
|
Return m_cmdBottomLeft
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub BottomLeft(ByVal param As Object)
|
|
OmagOFFICEMap.refMoveRawModeVM.MoveOnRef("REF1", MCH_CR.BL)
|
|
End Sub
|
|
|
|
#End Region ' Bottomleft
|
|
|
|
#Region "BottomRight"
|
|
|
|
Public ReadOnly Property BottomRightCommand As ICommand
|
|
Get
|
|
If m_cmdBottomRight Is Nothing Then
|
|
m_cmdBottomRight = New Command(AddressOf BottomRight)
|
|
End If
|
|
Return m_cmdBottomRight
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub BottomRight(ByVal param As Object)
|
|
OmagOFFICEMap.refMoveRawModeVM.MoveOnRef("REF2", MCH_CR.BR)
|
|
End Sub
|
|
|
|
#End Region ' BottomRight
|
|
|
|
#Region "Reset"
|
|
|
|
Public ReadOnly Property ResetCommand As ICommand
|
|
Get
|
|
If m_cmdReset Is Nothing Then
|
|
m_cmdReset = New Command(AddressOf Reset)
|
|
End If
|
|
Return m_cmdReset
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub Reset(ByVal param As Object)
|
|
OmagOFFICEMap.refMoveRawModeVM.ResetFinaleMove()
|
|
End Sub
|
|
|
|
#End Region ' Reset
|
|
|
|
End Class
|