|
|
|
@@ -29,35 +29,35 @@ Public Class MainMenuVM
|
|
|
|
|
End Get
|
|
|
|
|
End Property
|
|
|
|
|
|
|
|
|
|
Public Property View_IsChecked As Boolean
|
|
|
|
|
Get
|
|
|
|
|
Return m_SelPage = Pages.VIEW
|
|
|
|
|
End Get
|
|
|
|
|
Set(value As Boolean)
|
|
|
|
|
If value Then
|
|
|
|
|
If Not IsNothing(ProjectManagerVM.CurrProj) AndAlso Not IsNothing(ProjectManagerVM.CurrProd) AndAlso
|
|
|
|
|
ProjectManagerVM.CurrProj.nProdId = ProjectManagerVM.CurrProd.nProdId Then
|
|
|
|
|
ProjectManagerVM.CurrProj.SetReloadProject(False)
|
|
|
|
|
End If
|
|
|
|
|
SelPage = Pages.VIEW
|
|
|
|
|
End If
|
|
|
|
|
End Set
|
|
|
|
|
End Property
|
|
|
|
|
'Public Property View_IsChecked As Boolean
|
|
|
|
|
' Get
|
|
|
|
|
' Return m_SelPage = Pages.VIEW
|
|
|
|
|
' End Get
|
|
|
|
|
' Set(value As Boolean)
|
|
|
|
|
' If value Then
|
|
|
|
|
' If Not IsNothing(ProjectManagerVM.CurrProj) AndAlso Not IsNothing(ProjectManagerVM.CurrProd) AndAlso
|
|
|
|
|
' ProjectManagerVM.CurrProj.nProdId = ProjectManagerVM.CurrProd.nProdId Then
|
|
|
|
|
' ProjectManagerVM.CurrProj.SetReloadProject(False)
|
|
|
|
|
' End If
|
|
|
|
|
' SelPage = Pages.VIEW
|
|
|
|
|
' End If
|
|
|
|
|
' End Set
|
|
|
|
|
'End Property
|
|
|
|
|
|
|
|
|
|
Public Property Machining_IsChecked As Boolean
|
|
|
|
|
Get
|
|
|
|
|
Return m_SelPage = Pages.MACHINING
|
|
|
|
|
End Get
|
|
|
|
|
Set(value As Boolean)
|
|
|
|
|
If value Then
|
|
|
|
|
If Not IsNothing(ProjectManagerVM.CurrProj) AndAlso Not IsNothing(ProjectManagerVM.CurrProd) AndAlso
|
|
|
|
|
ProjectManagerVM.CurrProj.nProdId = ProjectManagerVM.CurrProd.nProdId Then
|
|
|
|
|
ProjectManagerVM.CurrProd.SetReloadProject(False)
|
|
|
|
|
End If
|
|
|
|
|
SelPage = Pages.MACHINING
|
|
|
|
|
End If
|
|
|
|
|
End Set
|
|
|
|
|
End Property
|
|
|
|
|
'Public Property Machining_IsChecked As Boolean
|
|
|
|
|
' Get
|
|
|
|
|
' Return m_SelPage = Pages.MACHINING
|
|
|
|
|
' End Get
|
|
|
|
|
' Set(value As Boolean)
|
|
|
|
|
' If value Then
|
|
|
|
|
' If Not IsNothing(ProjectManagerVM.CurrProj) AndAlso Not IsNothing(ProjectManagerVM.CurrProd) AndAlso
|
|
|
|
|
' ProjectManagerVM.CurrProj.nProdId = ProjectManagerVM.CurrProd.nProdId Then
|
|
|
|
|
' ProjectManagerVM.CurrProd.SetReloadProject(False)
|
|
|
|
|
' End If
|
|
|
|
|
' SelPage = Pages.MACHINING
|
|
|
|
|
' End If
|
|
|
|
|
' End Set
|
|
|
|
|
'End Property
|
|
|
|
|
|
|
|
|
|
Public Property OnlyProdPage_IsChecked As Boolean
|
|
|
|
|
Get
|
|
|
|
@@ -115,6 +115,7 @@ Public Class MainMenuVM
|
|
|
|
|
' bOk = ExitMACHINING(bVerifyModification)
|
|
|
|
|
Case Pages.CONFIG
|
|
|
|
|
bOk = ExitCONFIG()
|
|
|
|
|
SetbOpenProject(True)
|
|
|
|
|
Case Pages.ONLYPRODPAGE
|
|
|
|
|
bOk = ExitONLYPRODPAGE(bVerifyModification)
|
|
|
|
|
End Select
|
|
|
|
@@ -266,6 +267,17 @@ Public Class MainMenuVM
|
|
|
|
|
NotifyPropertyChanged(NameOf(MainMenu_IsEnabled))
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Private m_bOpenProject As Boolean = False
|
|
|
|
|
Public ReadOnly Property bOpenProject As Boolean
|
|
|
|
|
Get
|
|
|
|
|
Return bOpenProject
|
|
|
|
|
End Get
|
|
|
|
|
End Property
|
|
|
|
|
Friend Sub SetbOpenProject(value As Boolean)
|
|
|
|
|
m_bOpenProject = value
|
|
|
|
|
NotifyPropertyChanged(NameOf(bOpenProject))
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
'Private Function InitVIEW() As Boolean
|
|
|
|
|
' Map.refProjectVM.SetBottomPanel_Visibility(True)
|
|
|
|
|
' Map.refProjectVM.SetLeftPanel_Visibility(True)
|
|
|
|
@@ -593,76 +605,78 @@ Public Class MainMenuVM
|
|
|
|
|
|
|
|
|
|
' inizializzo gruppi di lavorazione
|
|
|
|
|
If Not IsNothing(ProjectManagerVM.CurrProd) AndAlso Not IsNothing(ProjectManagerVM.CurrProd.nProdId) AndAlso ProjectManagerVM.CurrProd.nProdId > 0 Then
|
|
|
|
|
If File.Exists(ProjectManagerVM.CurrProd.sProdPath) Then
|
|
|
|
|
' apro progetto
|
|
|
|
|
If ProjectManagerVM.CurrProd.bReloadProject OrElse Map.refConfigurationPageVM.QParametersModified Then
|
|
|
|
|
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.GOTOPROD, 2, EgtMsg(63005), 10, 50) ' Loading parts
|
|
|
|
|
Map.refOnlyProdManagerVM.TempCurrProd = ProjectManagerVM.CurrProd
|
|
|
|
|
If Map.refSceneHostVM.MainController.OpenProject(ProjectManagerVM.CurrProd.sProdPath, False) Then
|
|
|
|
|
' aggiorno le colonne in base al tipo progetto
|
|
|
|
|
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
|
|
|
|
Map.refFeatureInPartInRawPartListVM.UpdateColumns(CurrentMachine.nType)
|
|
|
|
|
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
|
|
|
|
' resetto modifica parametri Q default
|
|
|
|
|
Map.refConfigurationPageVM.ResetQParametersModified()
|
|
|
|
|
DbControllers.m_ProdController.LockByProdId(ProjectManagerVM.CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
|
|
|
|
|
Map.refOnlyProdManagerVM.NotifyPropertyChanged(NameOf(Map.refOnlyProdManagerVM.MruFileNames))
|
|
|
|
|
End If
|
|
|
|
|
Else
|
|
|
|
|
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.GOTOPROD, 2, EgtMsg(63005), 10, 30) ' Loading parts
|
|
|
|
|
' mostro tutti i pezzi
|
|
|
|
|
Map.refShowBeamPanelVM.ShowAll(False)
|
|
|
|
|
' verifico se il prod ha piu' proj
|
|
|
|
|
If ProjectManagerVM.CurrProd.nProjIdList.Count > 1 Then
|
|
|
|
|
' se si rigenero BTLStructure
|
|
|
|
|
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(0))
|
|
|
|
|
' carico filtri di ricerca
|
|
|
|
|
Map.refProjectVM.BTLStructureVM.LoadFilters()
|
|
|
|
|
End If
|
|
|
|
|
' recupero indice di modifica progetto
|
|
|
|
|
Dim CommIndex As Integer = -1
|
|
|
|
|
Dim ActiveSessionList As List(Of StatusMapModel) = DbControllers.m_StatusMapController.GetProd(m_SupervisorId)
|
|
|
|
|
For Each ActiveSession In ActiveSessionList
|
|
|
|
|
If ActiveSession.ItemId = ProjectManagerVM.CurrProd.nProdId Then
|
|
|
|
|
CommIndex = ActiveSession.Index
|
|
|
|
|
If Not m_bOpenProject Then
|
|
|
|
|
If File.Exists(ProjectManagerVM.CurrProd.sProdPath) Then
|
|
|
|
|
' apro progetto
|
|
|
|
|
If ProjectManagerVM.CurrProd.bReloadProject OrElse Map.refConfigurationPageVM.QParametersModified Then
|
|
|
|
|
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.GOTOPROD, 2, EgtMsg(63005), 10, 50) ' Loading parts
|
|
|
|
|
Map.refOnlyProdManagerVM.TempCurrProd = ProjectManagerVM.CurrProd
|
|
|
|
|
If Map.refSceneHostVM.MainController.OpenProject(ProjectManagerVM.CurrProd.sProdPath, False) Then
|
|
|
|
|
' aggiorno le colonne in base al tipo progetto
|
|
|
|
|
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
|
|
|
|
Map.refFeatureInPartInRawPartListVM.UpdateColumns(CurrentMachine.nType)
|
|
|
|
|
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
|
|
|
|
' resetto modifica parametri Q default
|
|
|
|
|
Map.refConfigurationPageVM.ResetQParametersModified()
|
|
|
|
|
DbControllers.m_ProdController.LockByProdId(ProjectManagerVM.CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
|
|
|
|
|
Map.refOnlyProdManagerVM.NotifyPropertyChanged(NameOf(Map.refOnlyProdManagerVM.MruFileNames))
|
|
|
|
|
End If
|
|
|
|
|
Next
|
|
|
|
|
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.GOTOPROD, 3, EgtMsg(63002), 30, 100) ' Loading machining groups
|
|
|
|
|
' carico lista dei MachGroup
|
|
|
|
|
Map.refProjectVM.MachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList()))
|
|
|
|
|
' fisso indice sessione di comunicazione
|
|
|
|
|
If CommIndex > -1 Then
|
|
|
|
|
ProjectManagerVM.CurrProd.SetModificationIndex(CommIndex)
|
|
|
|
|
Else
|
|
|
|
|
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.GOTOPROD, 2, EgtMsg(63005), 10, 30) ' Loading parts
|
|
|
|
|
' mostro tutti i pezzi
|
|
|
|
|
Map.refShowBeamPanelVM.ShowAll(False)
|
|
|
|
|
' verifico se il prod ha piu' proj
|
|
|
|
|
If ProjectManagerVM.CurrProd.nProjIdList.Count > 1 Then
|
|
|
|
|
' se si rigenero BTLStructure
|
|
|
|
|
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(0))
|
|
|
|
|
' carico filtri di ricerca
|
|
|
|
|
Map.refProjectVM.BTLStructureVM.LoadFilters()
|
|
|
|
|
End If
|
|
|
|
|
' recupero indice di modifica progetto
|
|
|
|
|
Dim CommIndex As Integer = -1
|
|
|
|
|
Dim ActiveSessionList As List(Of StatusMapModel) = DbControllers.m_StatusMapController.GetProd(m_SupervisorId)
|
|
|
|
|
For Each ActiveSession In ActiveSessionList
|
|
|
|
|
If ActiveSession.ItemId = ProjectManagerVM.CurrProd.nProdId Then
|
|
|
|
|
CommIndex = ActiveSession.Index
|
|
|
|
|
End If
|
|
|
|
|
Next
|
|
|
|
|
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.GOTOPROD, 3, EgtMsg(63002), 30, 100) ' Loading machining groups
|
|
|
|
|
' carico lista dei MachGroup
|
|
|
|
|
Map.refProjectVM.MachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList()))
|
|
|
|
|
' fisso indice sessione di comunicazione
|
|
|
|
|
If CommIndex > -1 Then
|
|
|
|
|
ProjectManagerVM.CurrProd.SetModificationIndex(CommIndex)
|
|
|
|
|
End If
|
|
|
|
|
ProjectManagerVM.CurrProd.SetReloadProject(True)
|
|
|
|
|
End If
|
|
|
|
|
ProjectManagerVM.CurrProd.SetReloadProject(True)
|
|
|
|
|
End If
|
|
|
|
|
' se Warehouse di tipo Medium e piu' di un progetto collegato
|
|
|
|
|
Dim nDefault As Integer = 2
|
|
|
|
|
If GetMainPrivateProfileInt(S_WAREHOUSE, EgtBEAMWALL.Core.ConstIni.K_TYPE, nDefault) = WarehouseType.MEDIUM AndAlso ProjectManagerVM.CurrProd.nProjIdList.Count > 1 Then
|
|
|
|
|
' confronto le Sezioni del BTL importato con quelle in Warehouse
|
|
|
|
|
WarehouseWndVM.UpdateSectionXMaterial()
|
|
|
|
|
End If
|
|
|
|
|
' aggiorno titolo
|
|
|
|
|
Map.refMainWindowVM.UpdateTitle()
|
|
|
|
|
DbControllers.m_ProdController.LockByProdId(ProjectManagerVM.CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
|
|
|
|
|
' controllo se devo lanciare verifica perche' importato
|
|
|
|
|
Dim bGetVerifyResult As Boolean = False
|
|
|
|
|
Dim bVerifyMach As Boolean = False
|
|
|
|
|
Dim nBTLInfoLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
|
|
|
|
While nBTLInfoLayerId <> GDB_ID.NULL
|
|
|
|
|
If EgtGetInfo(nBTLInfoLayerId, IMP_VERIFYMACHGROUP, bGetVerifyResult) AndAlso bGetVerifyResult Then
|
|
|
|
|
If Not bVerifyMach Then bVerifyMach = True
|
|
|
|
|
EgtSetInfo(nBTLInfoLayerId, IMP_VERIFYMACHGROUP, False)
|
|
|
|
|
' se Warehouse di tipo Medium e piu' di un progetto collegato
|
|
|
|
|
Dim nDefault As Integer = 2
|
|
|
|
|
If GetMainPrivateProfileInt(S_WAREHOUSE, EgtBEAMWALL.Core.ConstIni.K_TYPE, nDefault) = WarehouseType.MEDIUM AndAlso ProjectManagerVM.CurrProd.nProjIdList.Count > 1 Then
|
|
|
|
|
' confronto le Sezioni del BTL importato con quelle in Warehouse
|
|
|
|
|
WarehouseWndVM.UpdateSectionXMaterial()
|
|
|
|
|
End If
|
|
|
|
|
nBTLInfoLayerId = EgtGetNextName(nBTLInfoLayerId, BTLINFO)
|
|
|
|
|
End While
|
|
|
|
|
If bVerifyMach Then
|
|
|
|
|
Map.refCALCPanelVM.VerifyAll()
|
|
|
|
|
' aggiorno titolo
|
|
|
|
|
Map.refMainWindowVM.UpdateTitle()
|
|
|
|
|
DbControllers.m_ProdController.LockByProdId(ProjectManagerVM.CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
|
|
|
|
|
' controllo se devo lanciare verifica perche' importato
|
|
|
|
|
Dim bGetVerifyResult As Boolean = False
|
|
|
|
|
Dim bVerifyMach As Boolean = False
|
|
|
|
|
Dim nBTLInfoLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
|
|
|
|
While nBTLInfoLayerId <> GDB_ID.NULL
|
|
|
|
|
If EgtGetInfo(nBTLInfoLayerId, IMP_VERIFYMACHGROUP, bGetVerifyResult) AndAlso bGetVerifyResult Then
|
|
|
|
|
If Not bVerifyMach Then bVerifyMach = True
|
|
|
|
|
EgtSetInfo(nBTLInfoLayerId, IMP_VERIFYMACHGROUP, False)
|
|
|
|
|
End If
|
|
|
|
|
nBTLInfoLayerId = EgtGetNextName(nBTLInfoLayerId, BTLINFO)
|
|
|
|
|
End While
|
|
|
|
|
If bVerifyMach Then
|
|
|
|
|
Map.refCALCPanelVM.VerifyAll()
|
|
|
|
|
End If
|
|
|
|
|
' seleziono prima barra
|
|
|
|
|
Map.refProjectVM.MachGroupPanelVM.SelFirstMachGroup()
|
|
|
|
|
Else
|
|
|
|
|
MessageBox.Show(EgtMsg(61871))
|
|
|
|
|
End If
|
|
|
|
|
' seleziono prima barra
|
|
|
|
|
Map.refProjectVM.MachGroupPanelVM.SelFirstMachGroup()
|
|
|
|
|
Else
|
|
|
|
|
MessageBox.Show(EgtMsg(61871))
|
|
|
|
|
End If
|
|
|
|
|
Else
|
|
|
|
|
Map.refSceneHostVM.MainController.NewProject()
|
|
|
|
|