f1136da8f5
- aggiunto VeinMatching.
80 lines
2.8 KiB
VB.net
80 lines
2.8 KiB
VB.net
Imports System.Collections.ObjectModel
|
|
Imports System.IO
|
|
Imports EgtUILib
|
|
Imports EgtWPFLib5
|
|
|
|
Public Class MachGroupPanelVM
|
|
Inherits EgtWPFLib5.EgtMachGroupPanelVM
|
|
|
|
#Region "CONSTRUCTOR"
|
|
|
|
Sub New()
|
|
MyBase.New()
|
|
' Recupero la macchina di default
|
|
Dim sDefaultMachine As String = String.Empty
|
|
GetMainPrivateProfileString(S_MACH, K_CURRMACH, "", sDefaultMachine)
|
|
' Creo riferimento a questa classe in OmagOFFICEMap
|
|
OmagOFFICEMap.SetRefMachGroupPanelVM(Me)
|
|
InitMachGroups(True, OmagOFFICEMap.refMachinePanelVM.MachineList.ToList(),
|
|
sDefaultMachine, BASE_MACH_GROUP & "1")
|
|
End Sub
|
|
|
|
#End Region ' CONSTRUCTOR
|
|
|
|
#Region "METHODS"
|
|
|
|
Public Overrides Function OnPreNewMachGroup() As Boolean
|
|
EgtSetCurrentContext(OmagOFFICEMap.refSceneHostV.OmagOFFICEScene.GetCtx())
|
|
Return True
|
|
End Function
|
|
|
|
Public Overrides Function OnPostNewMachGroup() As Boolean
|
|
' !!! GESTIRE MACCHINE CON DUE TAVOLE !!!
|
|
EgtSetTable("MainTab")
|
|
' Aggiorno grezzo iniziale
|
|
EstCalc.UpdateRawPart()
|
|
' Salvo macchina del gruppo come nuovo default
|
|
WriteMainPrivateProfileString(S_MACH, K_CURRMACH, DefaultMachine)
|
|
Return True
|
|
End Function
|
|
|
|
Public Overrides Function OnPreSetCurrMachGroup() As Boolean
|
|
EgtSetCurrentContext(OmagOFFICEMap.refSceneHostV.OmagOFFICEScene.GetCtx())
|
|
Return True
|
|
End Function
|
|
|
|
Public Overrides Function OnPostSetCurrMachGroup() As Boolean
|
|
' Imposto vista solo tavola
|
|
EgtSetMachineLook(MCH_LOOK.TAB)
|
|
' Ricarico la macchina corrente
|
|
InitCurrentMachine(OmagOFFICEMap.refMachinePanelVM.sMachinesRoot, SelectedMachGroup.Machine,
|
|
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.PROCUCTION_LINE),
|
|
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.ENABLE_MILL))
|
|
' Imposto tab Disposizione
|
|
OmagOFFICEMap.refOptionPanelVM.SelItem = OptionPanelVM.Tabs.NESTING
|
|
' Aggiorno grezzo iniziale
|
|
EstCalc.UpdateRawPart()
|
|
Return True
|
|
End Function
|
|
|
|
Public Overrides Function OnPreRemoveCurrMachGroup() As Boolean
|
|
EgtSetCurrentContext(OmagOFFICEMap.refSceneHostV.OmagOFFICEScene.GetCtx())
|
|
' Seleziono tutti i pezzi in tavola
|
|
Dim nPartId As Integer = EgtGetFirstPartInRawPart(GetRawId())
|
|
While nPartId <> GDB_ID.NULL
|
|
' Recupero identificativo del successivo
|
|
Dim nNextPartId As Integer = EgtGetNextPartInRawPart(nPartId)
|
|
' Metto in parcheggio
|
|
StoreOnePart(nPartId)
|
|
' Eventuale notifica al VeinMatching
|
|
VeinMatching.OnRemovePartFromRaw(nPartId)
|
|
' Passo al successivo
|
|
nPartId = nNextPartId
|
|
End While
|
|
|
|
Return True
|
|
End Function
|
|
|
|
#End Region ' METHODS
|
|
|
|
End Class |