32d9f4fd7a
- aggiunta gestione angoli di fianco con tallone (bisello) - ora angolo verso esterno mantiene dimensione totale del pezzo - gestione ventose con asse rotante a step (STEPS=Val1,Val2,... in GEO di asse) - aggiunta gestione accorciamento fresate negli angoli - sistemazione dati TRF da compo e aggiunta codice pezzo - in DB utensili con nuova lama creazione/aggiornamento note speciali Hofmann - abilitazione bottoni UnderCut e DripDrill sempre da chiave - aggiunto secondo offset nei tagli da sotto - modifiche a componenti per import DXF e nome su linea separata - dati TRF non più richiesti per default sui componenti
307 lines
8.8 KiB
VB.net
307 lines
8.8 KiB
VB.net
Imports EgtUILib
|
|
|
|
Public Class CompoManagerVM
|
|
Inherits VMBase
|
|
|
|
#Region "FIELDS & PROPERTIES"
|
|
|
|
Private Const LUA_CMP_VARS As String = "CMP"
|
|
Friend Const LUA_CMP_WITHTOP As String = LUA_CMP_VARS & ".WithTop"
|
|
|
|
Private m_TopIsChecked As Boolean
|
|
Public Property TopIsChecked As Boolean
|
|
Get
|
|
Return m_TopIsChecked
|
|
End Get
|
|
Set(value As Boolean)
|
|
m_TopIsChecked = value
|
|
End Set
|
|
End Property
|
|
|
|
Private m_Top_Visibility As Visibility
|
|
Public Property Top_Visibility As Visibility
|
|
Get
|
|
Return m_Top_Visibility
|
|
End Get
|
|
Set(value As Visibility)
|
|
m_Top_Visibility = value
|
|
NotifyPropertyChanged("Top_Visibility")
|
|
End Set
|
|
End Property
|
|
|
|
Private m_PartName As String
|
|
Public Property PartName As String
|
|
Get
|
|
Return m_PartName
|
|
End Get
|
|
Set(value As String)
|
|
m_PartName = value
|
|
NotifyPropertyChanged("PartName")
|
|
End Set
|
|
End Property
|
|
|
|
Private m_PartName_Visibility As Visibility
|
|
Public Property PartName_Visibility As Visibility
|
|
Get
|
|
Return m_PartName_Visibility
|
|
End Get
|
|
Set(value As Visibility)
|
|
m_PartName_Visibility = value
|
|
NotifyPropertyChanged("PartName_Visibility")
|
|
End Set
|
|
End Property
|
|
|
|
Private m_PartNum As String
|
|
Public Property PartNum As String
|
|
Get
|
|
Return m_PartNum
|
|
End Get
|
|
Set(value As String)
|
|
m_PartNum = value
|
|
NotifyPropertyChanged("PartNum")
|
|
End Set
|
|
End Property
|
|
|
|
Private m_PartNum_Visibility As Visibility
|
|
Public Property PartNum_Visibility As Visibility
|
|
Get
|
|
Return m_PartNum_Visibility
|
|
End Get
|
|
Set(value As Visibility)
|
|
m_PartNum_Visibility = value
|
|
NotifyPropertyChanged("PartNum_Visibility")
|
|
End Set
|
|
End Property
|
|
|
|
Private m_OkIsEnabled As Boolean
|
|
Public Property OkIsEnabled As Boolean
|
|
Get
|
|
Return m_OkIsEnabled
|
|
End Get
|
|
Set(value As Boolean)
|
|
m_OkIsEnabled = value
|
|
NotifyPropertyChanged("OkIsEnabled")
|
|
End Set
|
|
End Property
|
|
|
|
Private m_OkExit_Visibility As Visibility
|
|
Public Property OkExit_Visibility As Visibility
|
|
Get
|
|
Return m_OkExit_Visibility
|
|
End Get
|
|
Set(value As Visibility)
|
|
m_OkExit_Visibility = value
|
|
NotifyPropertyChanged("OkExit_Visibility")
|
|
End Set
|
|
End Property
|
|
|
|
Private m_TrfData_Visibility As Visibility
|
|
Public Property TrfData_Visibility As Visibility
|
|
Get
|
|
Return m_TrfData_Visibility
|
|
End Get
|
|
Set(value As Visibility)
|
|
m_TrfData_Visibility = value
|
|
NotifyPropertyChanged("TrfData_Visibility")
|
|
End Set
|
|
End Property
|
|
|
|
' Trf Data
|
|
Private m_bTrfData As Boolean = False
|
|
Public ReadOnly Property bTrfData As Boolean
|
|
Get
|
|
Return m_bTrfData
|
|
End Get
|
|
End Property
|
|
Private m_bTrfOrderCode As String = ""
|
|
Public ReadOnly Property bTrfOrderCode As Boolean
|
|
Get
|
|
Return m_bTrfOrderCode
|
|
End Get
|
|
End Property
|
|
Private m_bTrfOrderDesc As String = ""
|
|
Public ReadOnly Property bTrfOrderDesc As Boolean
|
|
Get
|
|
Return m_bTrfOrderDesc
|
|
End Get
|
|
End Property
|
|
Private m_bTrfPartCode As String = ""
|
|
Public ReadOnly Property bTrfPartCode As Boolean
|
|
Get
|
|
Return m_bTrfPartCode
|
|
End Get
|
|
End Property
|
|
Private m_bTrfMatCode As String = ""
|
|
Public ReadOnly Property bTrfMatCode As Boolean
|
|
Get
|
|
Return m_bTrfMatCode
|
|
End Get
|
|
End Property
|
|
Private m_bTrfSurfCode As String = ""
|
|
Public ReadOnly Property bTrfSurfCode As Boolean
|
|
Get
|
|
Return m_bTrfSurfCode
|
|
End Get
|
|
End Property
|
|
Private m_bTrfThickness As Double = 0
|
|
Public ReadOnly Property bTrfThickness As Boolean
|
|
Get
|
|
Return m_bTrfThickness
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Messages"
|
|
|
|
Public ReadOnly Property TopMsg As String
|
|
Get
|
|
Return EgtMsg(MSG_DRAWPAGEUC + 4)
|
|
End Get
|
|
End Property
|
|
Public ReadOnly Property PartNameMsg As String
|
|
Get
|
|
Return "Nome"
|
|
End Get
|
|
End Property
|
|
Public ReadOnly Property PartNumMsg As String
|
|
Get
|
|
Return EgtMsg(MSG_DRAWPAGEUC + 1)
|
|
End Get
|
|
End Property
|
|
Public ReadOnly Property OkMsg As String
|
|
Get
|
|
Return "Ok"
|
|
End Get
|
|
End Property
|
|
Public ReadOnly Property ExitMsg As String
|
|
Get
|
|
Return "Exit"
|
|
End Get
|
|
End Property
|
|
|
|
#End Region ' Messages
|
|
|
|
' definizione comandi
|
|
Private m_cmdOk As ICommand
|
|
Private m_cmdTrfData As ICommand
|
|
|
|
#End Region ' FIELDS & PROPERTIES
|
|
|
|
#Region "CONSTRUCTOR"
|
|
|
|
Sub New()
|
|
' Creo riferimento a questa classe in CompoWindowMap
|
|
CompoWindowMap.SetRefCompoManagerVM(Me)
|
|
End Sub
|
|
|
|
#End Region ' CONSTRUCTOR
|
|
|
|
#Region "METHODS"
|
|
|
|
Friend Sub InitCompoManager()
|
|
If IsNothing(CompoWindowMap.refCompoWindowVM.m_SelInternalCompo) Then
|
|
PartName_Visibility = Visibility.Visible
|
|
PartNum_Visibility = Visibility.Visible
|
|
OkExit_Visibility = Visibility.Visible
|
|
' Verifico se il compo selezionato ha la segnalazione del Top abilitata
|
|
Dim bHasTop As Boolean = False
|
|
EgtLuaGetGlobBoolVar(LUA_CMP_WITHTOP, bHasTop)
|
|
Top_Visibility = If(bHasTop, Visibility.Visible, Visibility.Collapsed)
|
|
Else
|
|
Top_Visibility = Visibility.Collapsed
|
|
PartName_Visibility = Visibility.Collapsed
|
|
PartNum_Visibility = Visibility.Collapsed
|
|
OkExit_Visibility = Visibility.Collapsed
|
|
End If
|
|
' assegno valori di default numero e nome pezzi
|
|
PartNum = 1.ToString
|
|
PartName = String.Empty
|
|
' Reset dati TRF
|
|
m_bTrfOrderCode = ""
|
|
m_bTrfOrderDesc = ""
|
|
m_bTrfPartCode = ""
|
|
m_bTrfMatCode = ""
|
|
m_bTrfSurfCode = ""
|
|
m_bTrfThickness = 0
|
|
|
|
If Not CompoWindowMap.refCompoWindowVM.bTrfData Then
|
|
TrfData_Visibility = Windows.Visibility.Collapsed
|
|
Else
|
|
PartName_Visibility = Windows.Visibility.Collapsed
|
|
TrfData_Visibility = Windows.Visibility.Visible
|
|
End If
|
|
|
|
End Sub
|
|
|
|
#End Region ' METHODS
|
|
|
|
#Region "COMMANDS"
|
|
|
|
#Region "OkCommand"
|
|
|
|
' Returns a command that manage the MainWindow_Unloaded command
|
|
Public ReadOnly Property OkCommand() As ICommand
|
|
Get
|
|
If m_cmdOk Is Nothing Then
|
|
m_cmdOk = New Command(AddressOf Ok)
|
|
End If
|
|
Return m_cmdOk
|
|
End Get
|
|
End Property
|
|
|
|
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
|
Public Sub Ok(ByVal param As Object)
|
|
' se errore esco
|
|
If Not CompoWindowMap.refCompoWindowVM.m_bDrawOk Then
|
|
Return
|
|
End If
|
|
' Leggo numero di pezzi da inserire
|
|
Dim InsNbr As Integer
|
|
StringToInt(m_PartNum, InsNbr)
|
|
' Verifico se ci sono componenti interni
|
|
Dim bHasIntCompo As Boolean = False
|
|
EgtSetCurrentContext(CompoWindowMap.refCompoSceneHostV.CompoScene.GetCtx())
|
|
If EgtGetFirstNameInGroup(EgtGetFirstGroupInGroup(GDB_ID.ROOT), "InLoop") <> GDB_ID.NULL Then
|
|
bHasIntCompo = True
|
|
End If
|
|
' Passo al contesto principale
|
|
EgtSetCurrentContext(OmagOFFICEMap.refSceneHostVM.MainScene.GetCtx())
|
|
' Inserisco il componente nel DB geometrico principale
|
|
CompoWindowMap.refCompoWindowVM.MakeInsert(InsNbr, m_PartName)
|
|
' Aggiorno ambiente principale
|
|
EgtZoom(ZM.ALL)
|
|
' Elimino riferimento con delegato
|
|
CompoParamItem.m_refUpdateView = Nothing
|
|
' Chiudo la finestra Compo
|
|
CompoWindowMap.refCompoWindowVM.Close(True)
|
|
End Sub
|
|
|
|
#End Region ' OkCommand
|
|
|
|
#Region "TrfDataCommand"
|
|
|
|
' Returns a command that manage the MainWindow_Unloaded command
|
|
Public ReadOnly Property TrfDataCommand() As ICommand
|
|
Get
|
|
If m_cmdOk Is Nothing Then
|
|
m_cmdOk = New Command(AddressOf Ok)
|
|
End If
|
|
Return m_cmdOk
|
|
End Get
|
|
End Property
|
|
|
|
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
|
Public Sub TrfData(ByVal param As Object)
|
|
Dim DlgTrfDataVM As New CompoTrfDataWindowVM()
|
|
Dim DlgTrfDataV As New CompoTrfDataWindowV(Application.Current.MainWindow, DlgTrfDataVM)
|
|
DlgTrfDataVM.SetData(m_bTrfOrderCode, m_bTrfOrderDesc, m_bTrfPartCode, m_bTrfMatCode, m_bTrfSurfCode, m_bTrfThickness)
|
|
If DlgTrfDataV.ShowDialog() Then
|
|
DlgTrfDataVM.GetData(m_bTrfOrderCode, m_bTrfOrderDesc, m_bTrfPartCode, m_bTrfMatCode, m_bTrfSurfCode, m_bTrfThickness)
|
|
End If
|
|
End Sub
|
|
|
|
#End Region ' TrfDataCommand
|
|
|
|
#End Region ' COMMANDS
|
|
|
|
End Class
|