- correzioni per gestione selezione in OnlyProd
- gestione comune del CurrProj e CurrProd
This commit is contained in:
@@ -95,7 +95,7 @@ Public Class BTLPartVM
|
||||
Dim nMachgroupId As Integer = EgtGetParent(EgtGetParent(EgtGetParent(nSwapItem)))
|
||||
Dim MachGroupModel = Nothing
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjManagerVM) Then
|
||||
MachGroupModel = DbControllers.m_MachGroupController.FindByMachGroupId(Map.refProjManagerVM.CurrProj.nProdId, nMachgroupId)
|
||||
MachGroupModel = DbControllers.m_MachGroupController.FindByMachGroupId(ProjectManagerVM.CurrProj.nProdId, nMachgroupId)
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Not IsNothing(Map.refOnlyProdManagerVM) Then
|
||||
MachGroupModel = DbControllers.m_MachGroupController.FindByMachGroupId(Map.refOnlyProdManagerVM.CurrProd.nProdId, nMachgroupId)
|
||||
End If
|
||||
@@ -1522,15 +1522,15 @@ Public Class BTLPartVM
|
||||
End Get
|
||||
Set(value As BTLFeatureVM)
|
||||
m_SelBTLFeatureVM = value
|
||||
If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
|
||||
Map.refProjectVM.CopyFeature_IsEnabled = True
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART) Then
|
||||
If Not IsNothing(m_SelBTLFeatureVM) Then
|
||||
DirectCast(m_SelBTLFeatureVM, BTLFeatureVM).SelGeomFeature()
|
||||
' imposto path disegno da mostrare in BottomPanel
|
||||
Map.refBottomPanelVM.SetCurrDraw(DirectCast(m_SelBTLFeatureVM, BTLFeatureVM).sDrawPath)
|
||||
' seleziono pagina BottomPanel
|
||||
Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.FEATURE)
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
||||
' imposto path disegno da mostrare in BottomPanel
|
||||
Map.refBottomPanelVM.SetCurrDraw(DirectCast(m_SelBTLFeatureVM, BTLFeatureVM).sDrawPath)
|
||||
' seleziono pagina BottomPanel
|
||||
Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.FEATURE)
|
||||
End If
|
||||
' deseleziono i parametri
|
||||
If Not IsNothing(SelBTLFeatureVM.SelPBTLParam) Then SelBTLFeatureVM.SelPBTLParam = Nothing
|
||||
' rinfresco bottoni freecontour
|
||||
@@ -1772,7 +1772,7 @@ Public Class BTLPartVM
|
||||
If nNewPartId = GDB_ID.NULL Then Return Nothing
|
||||
' scrivo info proj
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjManagerVM) Then
|
||||
EgtSetInfo(nNewPartId, BTL_PRT_PROJ, Map.refProjManagerVM.CurrProj.nProjId)
|
||||
EgtSetInfo(nNewPartId, BTL_PRT_PROJ, ProjectManagerVM.CurrProj.nProjId)
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refOnlyProdManagerVM) Then
|
||||
EgtSetInfo(nNewPartId, BTL_PRT_PROJ, Map.refOnlyProdManagerVM.CurrProd.nProdId)
|
||||
End If
|
||||
|
||||
@@ -70,11 +70,20 @@ Public Class BTLStructureVM
|
||||
' resetto gruppo di lavorazione corrente
|
||||
EgtResetCurrMachGroup()
|
||||
End If
|
||||
If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
|
||||
' rimuovo selezione da pezzo in MachGroup
|
||||
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup) Then
|
||||
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.SelPart) Then
|
||||
Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.SelPart = Nothing
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
m_PrevSelectionType = m_SelectionType
|
||||
If value = m_SelectionType And (Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART Or Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PARTLIST) Then Return
|
||||
m_SelectionType = value
|
||||
Select Case m_SelectionType
|
||||
Case SelectionTypes.SELECT_
|
||||
' imposto modalita' proj su vista feature
|
||||
Map.refProjectVM.SelProdProj = ProdProj.PROJ
|
||||
' verifico reset mark su tutti i pezzi
|
||||
For Each BTLPart In m_BTLPartVMList
|
||||
@@ -83,7 +92,8 @@ Public Class BTLStructureVM
|
||||
' mostro barra di gestione pezzo
|
||||
Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProjectVM.PartManager_Visibility))
|
||||
Case SelectionTypes.HIGHLIGHT
|
||||
Map.refProjectVM.SelProdProj = ProdProj.PROD
|
||||
' imposto modalita' nulla su vista feature
|
||||
Map.refProjectVM.SelProdProj = ProdProj.NULL
|
||||
If m_PrevSelectionType = SelectionTypes.SELECT_ Then
|
||||
EgtBeamShowFacesName(False)
|
||||
EgtBeamShowLoadingSide(False, False)
|
||||
@@ -153,13 +163,13 @@ Public Class BTLStructureVM
|
||||
End Sub
|
||||
|
||||
Private Sub SelBTLParts_CollectionChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
|
||||
If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE And Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then
|
||||
' resetto gruppo di lavorazione corrente
|
||||
EgtResetCurrMachGroup()
|
||||
End If
|
||||
If m_bOnlySelectItem Then Return
|
||||
Select Case e.Action
|
||||
Case NotifyCollectionChangedAction.Add
|
||||
If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE And Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then
|
||||
' resetto gruppo di lavorazione corrente
|
||||
EgtResetCurrMachGroup()
|
||||
End If
|
||||
If e.NewItems.Count > 0 AndAlso Not IsNothing(e.NewItems(0)) Then
|
||||
If ((Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE) AndAlso m_SelectionType = SelectionTypes.SELECT_) OrElse Map.refMainMenuVM.SelPage = Pages.MACHINING Then
|
||||
SelectBTLPart(e.NewItems(0))
|
||||
@@ -370,7 +380,8 @@ Public Class BTLStructureVM
|
||||
Return m_SelBTLPart
|
||||
End Get
|
||||
Set(value As BTLPartVM)
|
||||
If Map.refMainMenuVM.SelPage = Pages.MACHINING Or (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE And Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP) Then
|
||||
If Map.refMainMenuVM.SelPage = Pages.MACHINING Or (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE And Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP) AndAlso
|
||||
Not IsNothing(value) Then
|
||||
' resetto gruppo di lavorazione corrente
|
||||
EgtResetCurrMachGroup()
|
||||
End If
|
||||
@@ -742,7 +753,7 @@ Public Class BTLStructureVM
|
||||
End Get
|
||||
Set(value As String)
|
||||
If EgtSetInfo(m_BTLStructureM.nBTLInfoId, BTL_GEN_LISTNAME, value) Then
|
||||
DbControllers.m_ProjController.UpdateListName(Map.refProjManagerVM.CurrProj.nProjId, value)
|
||||
DbControllers.m_ProjController.UpdateListName(ProjectManagerVM.CurrProj.nProjId, value)
|
||||
m_BTLStructureM.m_sLISTNAME = value
|
||||
Else
|
||||
NotifyPropertyChanged("sLISTNAME")
|
||||
|
||||
@@ -100,7 +100,7 @@ Public Class BlockedWndVM
|
||||
NotifyPropertyChanged(NameOf(Buttons_Visibility))
|
||||
NotifyPropertyChanged(NameOf(Msg_Text))
|
||||
' mando messaggio di blocco avvenuto
|
||||
DbControllers.m_StatusMapController.UpdateAction("", Map.refProdManagerVM.CurrProd.nProdId, Map.refProdManagerVM.CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.ViewOptimStoped, "")
|
||||
DbControllers.m_StatusMapController.UpdateAction("", ProjectManagerVM.CurrProd.nProdId, ProjectManagerVM.CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.ViewOptimStoped, "")
|
||||
'ElseIf m_nIndex > 17 Then
|
||||
' 'If m_Waiting_Timer.IsEnabled Then m_Waiting_Timer.Stop()
|
||||
' If Not SupervisorCommThread.bViewerOptimizerBlocked Then
|
||||
@@ -136,7 +136,7 @@ Public Class BlockedWndVM
|
||||
' salvo progetto
|
||||
Map.refProdManagerVM.Save()
|
||||
' mando messaggio di blocco avvenuto
|
||||
DbControllers.m_StatusMapController.UpdateAction("", Map.refProdManagerVM.CurrProd.nProdId, Map.refProdManagerVM.CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.ViewOptimStoped, "")
|
||||
DbControllers.m_StatusMapController.UpdateAction("", ProjectManagerVM.CurrProd.nProdId, ProjectManagerVM.CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.ViewOptimStoped, "")
|
||||
End Sub
|
||||
|
||||
#End Region ' Save
|
||||
@@ -160,7 +160,7 @@ Public Class BlockedWndVM
|
||||
''' </summary>
|
||||
Public Sub DoNotSave()
|
||||
' mando messaggio di blocco avvenuto
|
||||
DbControllers.m_StatusMapController.UpdateAction("", Map.refProdManagerVM.CurrProd.nProdId, Map.refProdManagerVM.CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.ViewOptimStoped, "")
|
||||
DbControllers.m_StatusMapController.UpdateAction("", ProjectManagerVM.CurrProd.nProdId, ProjectManagerVM.CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.ViewOptimStoped, "")
|
||||
End Sub
|
||||
|
||||
#End Region ' DoNotSave
|
||||
|
||||
@@ -4,6 +4,7 @@ Imports EgtWPFLib5
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Windows.Threading
|
||||
Imports System.Data.Entity.Core.Metadata.Edm
|
||||
|
||||
Public Class CALCPanelVM
|
||||
Inherits VMBase
|
||||
@@ -276,7 +277,7 @@ Public Class CALCPanelVM
|
||||
End Sub
|
||||
|
||||
Friend Shared Sub ProcessResults(MachGroupId As MyMachGroupVM)
|
||||
ProcessResults(Map.refProdManagerVM.CurrProd.sProdDirPath & "/" & MachGroupId.nName & ".txt", ProjectType.PROD, MachGroupId.Id)
|
||||
ProcessResults(ProjectManagerVM.CurrProd.sProdDirPath & "/" & MachGroupId.nName & ".txt", ProjectType.PROD, MachGroupId.Id)
|
||||
End Sub
|
||||
|
||||
Private Shared Sub ProcessResults(Bar As Bar)
|
||||
@@ -574,14 +575,14 @@ Public Class CALCPanelVM
|
||||
Dim sMachineName As String = ""
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
||||
nProjType = Map.refProjManagerVM.nProjType
|
||||
sMachineName = If(Not IsNothing(Map.refProjManagerVM.CurrProj), Map.refProjManagerVM.CurrProj.sMachine, "")
|
||||
sMachineName = If(Not IsNothing(ProjectManagerVM.CurrProj), ProjectManagerVM.CurrProj.sMachine, "")
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
|
||||
nProjType = Map.refProdManagerVM.nProdType
|
||||
sMachineName = If(Not IsNothing(Map.refProdManagerVM.CurrProd), Map.refProdManagerVM.CurrProd.sMachine, "")
|
||||
sMachineName = If(Not IsNothing(ProjectManagerVM.CurrProd), ProjectManagerVM.CurrProd.sMachine, "")
|
||||
End If
|
||||
If nMachType = nProjType OrElse
|
||||
(nMachType = 3 And Map.refMainMenuVM.SelPage = Pages.VIEW And Not IsNothing(Map.refProjManagerVM) AndAlso Not IsNothing(Map.refProjManagerVM.CurrProj)) OrElse
|
||||
(nMachType = 3 And Map.refMainMenuVM.SelPage = Pages.MACHINING And Not IsNothing(Map.refProdManagerVM) AndAlso Not IsNothing(Map.refProdManagerVM.CurrProd)) OrElse
|
||||
(nMachType = 3 And Map.refMainMenuVM.SelPage = Pages.VIEW And Not IsNothing(Map.refProjManagerVM) AndAlso Not IsNothing(ProjectManagerVM.CurrProj)) OrElse
|
||||
(nMachType = 3 And Map.refMainMenuVM.SelPage = Pages.MACHINING And Not IsNothing(Map.refProdManagerVM) AndAlso Not IsNothing(ProjectManagerVM.CurrProd)) OrElse
|
||||
(nMachType = 3 And Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE And Not IsNothing(Map.refOnlyProdManagerVM) AndAlso Not IsNothing(Map.refOnlyProdManagerVM.CurrProd)) Then
|
||||
MachineList.Add(Machine)
|
||||
' Se il nome Macchina coincide setto la macchina selezionata con la macchina associata al progetto
|
||||
@@ -646,19 +647,40 @@ Public Class CALCPanelVM
|
||||
''' Execute the Open. This method is invoked by the OpenCommand.
|
||||
''' </summary>
|
||||
Friend Sub Verify()
|
||||
If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(Map.refProjManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) OrElse
|
||||
(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(Map.refProdManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)))) Then Return
|
||||
If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM))) OrElse
|
||||
(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) OrElse
|
||||
(Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso (IsNothing(Map.refOnlyProdManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) Then Return
|
||||
Dim ProjType As BWType
|
||||
Dim BarList() As EgtBEAMWALL.Core.Bar = Nothing
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
||||
ProjType = Map.refProjManagerVM.CurrProj.nType
|
||||
Else
|
||||
ProjType = Map.refProdManagerVM.CurrProd.nType
|
||||
ProjType = ProjectManagerVM.CurrProj.nType
|
||||
If Not CreateBarToVerify(Pages.VIEW, ProjType, BarList) Then Return
|
||||
' lancio calcolo
|
||||
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
|
||||
ProjType = ProjectManagerVM.CurrProd.nType
|
||||
If Not CreateBarToVerify(Pages.MACHINING, ProjType, BarList) Then Return
|
||||
' lancio calcolo
|
||||
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
|
||||
ProjType = Map.refOnlyProdManagerVM.CurrProd.nType
|
||||
If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART Then
|
||||
If Not CreateBarToVerify(Pages.VIEW, ProjType, BarList) Then Return
|
||||
' lancio calcolo
|
||||
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, Map.refOnlyProdManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
|
||||
ElseIf Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then
|
||||
If Not CreateBarToVerify(Pages.MACHINING, ProjType, BarList) Then Return
|
||||
' lancio calcolo
|
||||
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, Map.refOnlyProdManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
|
||||
End If
|
||||
End If
|
||||
Dim BarList() As EgtBEAMWALL.Core.Bar
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
||||
End Sub
|
||||
|
||||
Private Function CreateBarToVerify(SelPage As Pages, ProjType As BWType, ByRef BarList As Bar()) As Boolean
|
||||
If SelPage = Pages.VIEW Then
|
||||
If Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then
|
||||
Dim TempBarList(0) As EgtBEAMWALL.Core.Bar
|
||||
If Not Map.refProjectVM.BTLStructureVM.SelBTLPart.bDO Then Return
|
||||
If Not Map.refProjectVM.BTLStructureVM.SelBTLPart.bDO Then Return False
|
||||
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId,
|
||||
.nProgramPage = ProjectType.PROJ,
|
||||
.nProjType = ProjType,
|
||||
@@ -670,7 +692,7 @@ Public Class CALCPanelVM
|
||||
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
|
||||
Case Else
|
||||
If Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState = CalcStates.NOTCALCULATED OrElse Map.refProjectVM.BTLStructureVM.SelBTLPart.nFeaturesGlobalState > CalcStates.INFO Then
|
||||
Dim sBTLPartFilePath As String = Map.refProjManagerVM.CurrProj.sProjDirPath & "\" & Map.refProjectVM.BTLStructureVM.SelBTLPart.nPDN.ToString() & ".ori.bwe"
|
||||
Dim sBTLPartFilePath As String = ProjectManagerVM.CurrProj.sProjDirPath & "\" & Map.refProjectVM.BTLStructureVM.SelBTLPart.nPDN.ToString() & ".ori.bwe"
|
||||
If File.Exists(sBTLPartFilePath) Then File.Delete(sBTLPartFilePath)
|
||||
End If
|
||||
Bar.nCmdType = CalcIntegration.CmdTypes.CHECKGEN
|
||||
@@ -678,18 +700,15 @@ Public Class CALCPanelVM
|
||||
TempBarList(0) = Bar
|
||||
BarList = TempBarList
|
||||
Else
|
||||
Return
|
||||
Return False
|
||||
End If
|
||||
' disabilito interfaccia
|
||||
Map.refProjectVM.SetCalcRunning(True)
|
||||
' lancio calcolo
|
||||
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, Map.refProjManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
|
||||
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
|
||||
ElseIf SelPage = Pages.MACHINING Then
|
||||
If Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
|
||||
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
|
||||
' se barra gia' assegnata a supervisore, esco
|
||||
If SelMachGroup.nProduction_State >= ItemState.Assigned Then Return
|
||||
If SelMachGroup.nProduction_State >= ItemState.Assigned Then Return False
|
||||
Dim TempBarList(0) As EgtBEAMWALL.Core.Bar
|
||||
Dim MachineName As String = ""
|
||||
EgtGetMachGroupMachineName(SelMachGroup.Id, MachineName)
|
||||
@@ -704,7 +723,7 @@ Public Class CALCPanelVM
|
||||
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
|
||||
Case Else
|
||||
If SelMachGroup.nGlobalState = CalcStates.NOTCALCULATED OrElse (SelMachGroup.nPartsGlobalState > CalcStates.INFO) Then
|
||||
Dim sMachGroupFilePath As String = Map.refProdManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe"
|
||||
Dim sMachGroupFilePath As String = ProjectManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe"
|
||||
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
|
||||
End If
|
||||
Bar.nCmdType = CalcIntegration.CmdTypes.CHECKGEN
|
||||
@@ -712,14 +731,13 @@ Public Class CALCPanelVM
|
||||
TempBarList(0) = Bar
|
||||
BarList = TempBarList
|
||||
Else
|
||||
Return
|
||||
Return False
|
||||
End If
|
||||
' disabilito interfaccia
|
||||
Map.refProjectVM.SetCalcRunning(True)
|
||||
' lancio calcolo
|
||||
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, Map.refProdManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
|
||||
End If
|
||||
End Sub
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' funzione che gestisce risposta da thread di verifica, aggiorna progress e segnala comando di interruzione
|
||||
Private Sub ManageCalc(dProgress As Double, sProgress As String, ByRef bCancel As Boolean)
|
||||
@@ -761,21 +779,42 @@ Public Class CALCPanelVM
|
||||
''' Execute the Open. This method is invoked by the OpenCommand.
|
||||
''' </summary>
|
||||
Friend Sub VerifyAll()
|
||||
If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(Map.refProjManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) OrElse
|
||||
(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(Map.refProdManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)))) Then Return
|
||||
If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM))) OrElse
|
||||
(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) OrElse
|
||||
(Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) Then Return
|
||||
' se modalita' assemblato
|
||||
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked AndAlso Map.refShowBeamPanelVM.bShowAll Then
|
||||
' devo smontarlo prima di calcolare le travi, altrimenti non trova i pezzi
|
||||
Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
|
||||
End If
|
||||
Dim BarList() As EgtBEAMWALL.Core.Bar = Nothing
|
||||
Dim ProjType As BWType
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
||||
ProjType = Map.refProjManagerVM.CurrProj.nType
|
||||
Else
|
||||
ProjType = Map.refProdManagerVM.CurrProd.nType
|
||||
ProjType = ProjectManagerVM.CurrProj.nType
|
||||
If Not CreateBarListToVerify(Pages.VIEW, ProjType, BarList) Then Return
|
||||
' lancio calcolo
|
||||
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
|
||||
ProjType = ProjectManagerVM.CurrProd.nType
|
||||
If Not CreateBarListToVerify(Pages.MACHINING, ProjType, BarList) Then Return
|
||||
' lancio calcolo
|
||||
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
|
||||
ProjType = ProjectManagerVM.CurrProd.nType
|
||||
If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART OrElse Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PARTLIST Then
|
||||
If Not CreateBarListToVerify(Pages.VIEW, ProjType, BarList) Then Return
|
||||
' lancio calcolo
|
||||
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
|
||||
ElseIf Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then
|
||||
If Not CreateBarListToVerify(Pages.MACHINING, ProjType, BarList) Then Return
|
||||
' lancio calcolo
|
||||
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
|
||||
End If
|
||||
End If
|
||||
Dim BarList() As EgtBEAMWALL.Core.Bar
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
||||
End Sub
|
||||
|
||||
Private Function CreateBarListToVerify(SelPage As Pages, ProjType As BWType, ByRef BarList As Bar()) As Boolean
|
||||
If SelPage = Pages.VIEW Then
|
||||
Dim TempBarList As New List(Of EgtBEAMWALL.Core.Bar)
|
||||
For PartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1
|
||||
Dim CurrPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList(PartIndex)
|
||||
@@ -791,7 +830,7 @@ Public Class CALCPanelVM
|
||||
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
|
||||
Case Else
|
||||
If CurrPart.nGlobalState = CalcStates.NOTCALCULATED OrElse CurrPart.nFeaturesGlobalState > CalcStates.INFO Then
|
||||
Dim sBTLPartFilePath As String = Map.refProjManagerVM.CurrProj.sProjDirPath & "\" & CurrPart.nPDN.ToString() & ".ori.bwe"
|
||||
Dim sBTLPartFilePath As String = ProjectManagerVM.CurrProj.sProjDirPath & "\" & CurrPart.nPDN.ToString() & ".ori.bwe"
|
||||
If File.Exists(sBTLPartFilePath) Then File.Delete(sBTLPartFilePath)
|
||||
End If
|
||||
Bar.nCmdType = CalcIntegration.CmdTypes.CHECKGEN
|
||||
@@ -801,9 +840,7 @@ Public Class CALCPanelVM
|
||||
BarList = TempBarList.ToArray()
|
||||
' disabilito interfaccia
|
||||
Map.refProjectVM.SetCalcRunning(True)
|
||||
' lancio calcolo
|
||||
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, Map.refProjManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
|
||||
ElseIf SelPage = Pages.MACHINING Then
|
||||
Dim TempBarList As New List(Of EgtBEAMWALL.Core.Bar)
|
||||
For PartIndex = 0 To Map.refMachGroupPanelVM.MachGroupVMList.Count - 1
|
||||
Dim CurrMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.MachGroupVMList(PartIndex)
|
||||
@@ -822,21 +859,20 @@ Public Class CALCPanelVM
|
||||
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
|
||||
Case Else
|
||||
If CurrMachGroup.nGlobalState = CalcStates.NOTCALCULATED OrElse (CurrMachGroup.nPartsGlobalState > CalcStates.INFO) Then
|
||||
Dim sMachGroupFilePath As String = Map.refProdManagerVM.CurrProd.sProdDirPath & "\" & CurrMachGroup.Name.ToString() & ".ori.bwe"
|
||||
Dim sMachGroupFilePath As String = ProjectManagerVM.CurrProd.sProdDirPath & "\" & CurrMachGroup.Name.ToString() & ".ori.bwe"
|
||||
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
|
||||
End If
|
||||
Bar.nCmdType = CalcIntegration.CmdTypes.CHECKGEN
|
||||
End Select
|
||||
TempBarList.Add(Bar)
|
||||
Next
|
||||
If TempBarList.Count = 0 Then Return
|
||||
If TempBarList.Count = 0 Then Return False
|
||||
BarList = TempBarList.ToArray()
|
||||
' disabilito interfaccia
|
||||
Map.refProjectVM.SetCalcRunning(True)
|
||||
' lancio calcolo
|
||||
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, Map.refProdManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
|
||||
End If
|
||||
End Sub
|
||||
Return True
|
||||
End Function
|
||||
|
||||
#End Region ' VerifyAll
|
||||
|
||||
@@ -858,9 +894,10 @@ Public Class CALCPanelVM
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub ResetCalc()
|
||||
If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(Map.refProjManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) OrElse
|
||||
(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(Map.refProdManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)))) Then Return
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
||||
If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM))) OrElse
|
||||
(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) OrElse
|
||||
(Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) Then Return
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso (Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART OrElse Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PARTLIST)) Then
|
||||
If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
|
||||
For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList
|
||||
If Part.nGlobalState <> CalcStates.NOTCALCULATED Then
|
||||
@@ -881,7 +918,7 @@ Public Class CALCPanelVM
|
||||
SelPart.ResetCalcTotalPart()
|
||||
End If
|
||||
End If
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP) Then
|
||||
If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
|
||||
For Each MachGroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
|
||||
If MachGroup.nProduction_State >= ItemState.Assigned Then Continue For
|
||||
@@ -921,16 +958,37 @@ Public Class CALCPanelVM
|
||||
''' Execute the Open. This method is invoked by the OpenCommand.
|
||||
''' </summary>
|
||||
Friend Sub Simulate()
|
||||
If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(Map.refProjManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) OrElse
|
||||
(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(Map.refProdManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)))) Then Return
|
||||
If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM))) OrElse
|
||||
(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) OrElse
|
||||
(Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) Then Return
|
||||
Dim ProjType As BWType
|
||||
Dim BarList() As EgtBEAMWALL.Core.Bar = Nothing
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
||||
ProjType = Map.refProjManagerVM.CurrProj.nType
|
||||
Else
|
||||
ProjType = Map.refProdManagerVM.CurrProd.nType
|
||||
ProjType = ProjectManagerVM.CurrProj.nType
|
||||
If Not CreateBarToSimulate(Pages.VIEW, ProjType, BarList) Then Return
|
||||
' lancio simulazione
|
||||
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
|
||||
ProjType = ProjectManagerVM.CurrProd.nType
|
||||
If Not CreateBarToSimulate(Pages.MACHINING, ProjType, BarList) Then Return
|
||||
' lancio simulazione
|
||||
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
|
||||
ProjType = Map.refOnlyProdManagerVM.CurrProd.nType
|
||||
If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART Then
|
||||
If Not CreateBarToSimulate(Pages.VIEW, ProjType, BarList) Then Return
|
||||
' lancio simulazione
|
||||
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
|
||||
ElseIf Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then
|
||||
If Not CreateBarToSimulate(Pages.MACHINING, ProjType, BarList) Then Return
|
||||
' lancio simulazione
|
||||
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
|
||||
End If
|
||||
End If
|
||||
Dim BarList() As EgtBEAMWALL.Core.Bar
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
||||
End Sub
|
||||
|
||||
Private Function CreateBarToSimulate(SelPage As Pages, ProjType As BWType, ByRef BarList As Bar()) As Boolean
|
||||
If SelPage = Pages.VIEW Then
|
||||
If Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then
|
||||
Dim TempBarList(0) As EgtBEAMWALL.Core.Bar
|
||||
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId,
|
||||
@@ -941,19 +999,17 @@ Public Class CALCPanelVM
|
||||
.nCmdType = CalcIntegration.CmdTypes.SIMULATE,
|
||||
.nGlobState = Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState}
|
||||
If Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState = CalcStates.NOTCALCULATED Then
|
||||
Dim sBTLPartFilePath As String = Map.refProjManagerVM.CurrProj.sProjDirPath & "\" & Map.refProjectVM.BTLStructureVM.SelBTLPart.nPDN.ToString() & ".ori.bwe"
|
||||
Dim sBTLPartFilePath As String = ProjectManagerVM.CurrProj.sProjDirPath & "\" & Map.refProjectVM.BTLStructureVM.SelBTLPart.nPDN.ToString() & ".ori.bwe"
|
||||
If File.Exists(sBTLPartFilePath) Then File.Delete(sBTLPartFilePath)
|
||||
End If
|
||||
TempBarList(0) = Bar
|
||||
BarList = TempBarList
|
||||
Else
|
||||
Return
|
||||
Return False
|
||||
End If
|
||||
' disabilito interfaccia
|
||||
Map.refProjectVM.SetCalcRunning(True)
|
||||
' lancio simulazione
|
||||
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, Map.refProjManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
|
||||
ElseIf SelPage = Pages.MACHINING Then
|
||||
If Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
|
||||
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
|
||||
Dim TempBarList(0) As EgtBEAMWALL.Core.Bar
|
||||
@@ -967,20 +1023,19 @@ Public Class CALCPanelVM
|
||||
.nCmdType = CalcIntegration.CmdTypes.SIMULATE,
|
||||
.nGlobState = SelMachGroup.nGlobalState}
|
||||
If SelMachGroup.nGlobalState = CalcStates.NOTCALCULATED Then
|
||||
Dim sMachGroupFilePath As String = Map.refProdManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe"
|
||||
Dim sMachGroupFilePath As String = ProjectManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe"
|
||||
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
|
||||
End If
|
||||
TempBarList(0) = Bar
|
||||
BarList = TempBarList
|
||||
Else
|
||||
Return
|
||||
Return False
|
||||
End If
|
||||
' disabilito interfaccia
|
||||
Map.refProjectVM.SetCalcRunning(True)
|
||||
' lancio simulazione
|
||||
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, Map.refProdManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
|
||||
End If
|
||||
End Sub
|
||||
Return True
|
||||
End Function
|
||||
|
||||
#End Region ' Simulate
|
||||
|
||||
@@ -1002,12 +1057,12 @@ Public Class CALCPanelVM
|
||||
''' Execute the Open. This method is invoked by the OpenCommand.
|
||||
''' </summary>
|
||||
Friend Sub Edit()
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(Map.refProjManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) Then Return
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) Then Return
|
||||
Dim ProjType As BWType
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
||||
ProjType = Map.refProjManagerVM.CurrProj.nType
|
||||
ProjType = ProjectManagerVM.CurrProj.nType
|
||||
Else
|
||||
ProjType = Map.refProdManagerVM.CurrProd.nType
|
||||
ProjType = ProjectManagerVM.CurrProd.nType
|
||||
End If
|
||||
Dim BarList() As EgtBEAMWALL.Core.Bar
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
||||
@@ -1030,7 +1085,7 @@ Public Class CALCPanelVM
|
||||
' disabilito interfaccia
|
||||
Map.refProjectVM.SetCalcRunning(True)
|
||||
' lancio edit
|
||||
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, Map.refProjManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
|
||||
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -1055,7 +1110,7 @@ Public Class CALCPanelVM
|
||||
''' </summary>
|
||||
Friend Sub ChooseMachine()
|
||||
' rendo visibile la CmBx per la scelta e il pulsante di conferma solo se il Proj corrente non ha associato alcun Prod
|
||||
If Map.refProjManagerVM.CurrProj.nProdId > 0 Then
|
||||
If ProjectManagerVM.CurrProj.nProdId > 0 Then
|
||||
MessageBox.Show(EgtMsg(61929), EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Exclamation)
|
||||
Else
|
||||
SetChooseMachine_Visibility(True)
|
||||
@@ -1087,7 +1142,7 @@ Public Class CALCPanelVM
|
||||
m_IsMachineApplied = True
|
||||
SetChooseMachine_Visibility(False)
|
||||
' resetto i parametri errori integration ciclando su ogni Part e per ogni Part ogni Feature
|
||||
Dim ProjId = Map.refProjManagerVM.CurrProj.nProjId
|
||||
Dim ProjId = ProjectManagerVM.CurrProj.nProjId
|
||||
Dim TempList As New List(Of BTLPartM)
|
||||
Dim nPartId As Integer = EgtGetFirstPart()
|
||||
While nPartId <> GDB_ID.NULL
|
||||
|
||||
@@ -350,6 +350,7 @@
|
||||
<Compile Include="OptimizePanel\OnlyProdOptimizePanelV.xaml.vb">
|
||||
<DependentUpon>OnlyProdOptimizePanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ProjectManager\ProjectManagerVM.vb" />
|
||||
<Compile Include="ProjectTypeWnd\ProjectTypeWndV.xaml.vb">
|
||||
<DependentUpon>ProjectTypeWndV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
|
||||
@@ -82,7 +82,7 @@ Public Class MyInstrumentPanelVM
|
||||
' aggiorno valori totali
|
||||
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then Map.refProjectVM.MachGroupPanelVM.CalcGlobalUpdate()
|
||||
' aggiorno conto materiali usati
|
||||
If Not IsNothing(Map.refProdManagerVM.CurrProd) Then Map.refStatisticsVM.LoadRawPart()
|
||||
If Not IsNothing(ProjectManagerVM.CurrProd) Then Map.refStatisticsVM.LoadRawPart()
|
||||
' seleziono pagina Statistics
|
||||
Map.refTopPanelVM.SetSelTab(TopPanelVM.Tabs.STATISTICS)
|
||||
Else
|
||||
@@ -158,7 +158,7 @@ Public Class MyInstrumentPanelVM
|
||||
' aggiorno valori totali
|
||||
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then Map.refProjectVM.MachGroupPanelVM.CalcGlobalUpdate()
|
||||
' aggiorno conto materiali usati
|
||||
If Not IsNothing(Map.refProdManagerVM.CurrProd) Then Map.refStatisticsVM.LoadRawPart()
|
||||
If Not IsNothing(ProjectManagerVM.CurrProd) Then Map.refStatisticsVM.LoadRawPart()
|
||||
' seleziono pagina Statistics
|
||||
Map.refTopPanelVM.SetSelTab(TopPanelVM.Tabs.STATISTICS)
|
||||
Else
|
||||
@@ -291,8 +291,8 @@ Public Class MyInstrumentPanelVM
|
||||
''' Execute the Open. This method is invoked by the OpenCommand.
|
||||
''' </summary>
|
||||
Friend Sub ChangeParameter()
|
||||
If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(Map.refProjManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) OrElse
|
||||
(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(Map.refProdManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)))) Then Return
|
||||
If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) OrElse
|
||||
(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)))) Then Return
|
||||
Dim ChangeParameterWndVM As New ChangeParameterWndVM
|
||||
Dim ChangeParameterWnd As New ChangeParameterWndV(Application.Current.MainWindow, ChangeParameterWndVM)
|
||||
If ChangeParameterWnd.ShowDialog() Then
|
||||
@@ -350,8 +350,8 @@ Public Class MyInstrumentPanelVM
|
||||
''' Execute the Open. This method is invoked by the OpenCommand.
|
||||
''' </summary>
|
||||
Friend Sub ChangeMaterial()
|
||||
If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(Map.refProjManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) OrElse
|
||||
(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(Map.refProdManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)))) Then Return
|
||||
If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) OrElse
|
||||
(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)))) Then Return
|
||||
Dim ChangeMaterialWndVM As New ChangeMaterialWndVM
|
||||
Dim ChangeMaterialWnd As New ChangeMaterialWndV(Application.Current.MainWindow, ChangeMaterialWndVM)
|
||||
If ChangeMaterialWnd.ShowDialog() Then
|
||||
|
||||
@@ -303,7 +303,7 @@ Public Class LeftPanelVM
|
||||
End Sub
|
||||
|
||||
Public Sub NewRawPart(bLast As Boolean)
|
||||
'If IsNothing(Map.refProdManagerVM) OrElse IsNothing(Map.refProdManagerVM.CurrProd) Then Return
|
||||
'If IsNothing(Map.refProdManagerVM) OrElse IsNothing(ProjectManagerVM.CurrProd) Then Return
|
||||
If Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso IsNothing(Map.refProdManagerVM) Then
|
||||
Return
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(Map.refOnlyProdManagerVM) Then
|
||||
@@ -449,7 +449,7 @@ Public Class LeftPanelVM
|
||||
Dim sLogPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\RawPartLog.txt"
|
||||
' scrivo dati per variabili P di comunicazione con la macchina in gruppo di lavorazione
|
||||
If Map.refMainMenuVM.SelPage = Pages.MACHINING Then
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_PRODID, Map.refProdManagerVM.CurrProd.nProdId)
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_PRODID, ProjectManagerVM.CurrProd.nProdId)
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_PRODID, Map.refOnlyProdManagerVM.CurrProd.nProdId)
|
||||
End If
|
||||
@@ -729,7 +729,7 @@ Public Class LeftPanelVM
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub AddToRawPart()
|
||||
'If IsNothing(Map.refProdManagerVM.CurrProd) Then Return
|
||||
'If IsNothing(ProjectManagerVM.CurrProd) Then Return
|
||||
If Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso IsNothing(Map.refProdManagerVM) Then
|
||||
Return
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(Map.refOnlyProdManagerVM) Then
|
||||
@@ -1002,7 +1002,7 @@ Public Class LeftPanelVM
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub CopyPart()
|
||||
'If IsNothing(Map.refProjManagerVM.CurrProj) Then Return
|
||||
'If IsNothing(ProjectManagerVM.CurrProj) Then Return
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso IsNothing(Map.refProjManagerVM) Then
|
||||
Return
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(Map.refOnlyProdManagerVM) Then
|
||||
@@ -1038,7 +1038,7 @@ Public Class LeftPanelVM
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub AddPart(ByVal param As Object)
|
||||
'If IsNothing(Map.refProjManagerVM.CurrProj) Then Return
|
||||
'If IsNothing(ProjectManagerVM.CurrProj) Then Return
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso IsNothing(Map.refProjManagerVM) Then
|
||||
Return
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(Map.refOnlyProdManagerVM) Then
|
||||
@@ -1051,9 +1051,9 @@ Public Class LeftPanelVM
|
||||
' creo nuovo part
|
||||
Dim nNewPartId As Integer = EgtBeamCreatePart()
|
||||
' scrivo info proj
|
||||
'EgtSetInfo(nNewPartId, BTL_PRT_PROJ, Map.refProjManagerVM.CurrProj.nProjId)
|
||||
'EgtSetInfo(nNewPartId, BTL_PRT_PROJ, ProjectManagerVM.CurrProj.nProjId)
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso IsNothing(Map.refProjManagerVM) Then
|
||||
EgtSetInfo(nNewPartId, BTL_PRT_PROJ, Map.refProjManagerVM.CurrProj.nProjId)
|
||||
EgtSetInfo(nNewPartId, BTL_PRT_PROJ, ProjectManagerVM.CurrProj.nProjId)
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(Map.refOnlyProdManagerVM) Then
|
||||
EgtSetInfo(nNewPartId, BTL_PRT_PROJ, Map.refOnlyProdManagerVM.CurrProd.nProdId)
|
||||
End If
|
||||
@@ -1111,7 +1111,7 @@ Public Class LeftPanelVM
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub RemovePartCmd()
|
||||
'If IsNothing(Map.refProjManagerVM.CurrProj) Then Return
|
||||
'If IsNothing(ProjectManagerVM.CurrProj) Then Return
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso IsNothing(Map.refProjManagerVM) Then
|
||||
Return
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(Map.refOnlyProdManagerVM) Then
|
||||
@@ -1189,7 +1189,7 @@ Public Class LeftPanelVM
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub Invert()
|
||||
'If IsNothing(Map.refProjManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return
|
||||
'If IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso IsNothing(Map.refProjManagerVM) Then
|
||||
Return
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(Map.refOnlyProdManagerVM) Then
|
||||
@@ -1231,7 +1231,7 @@ Public Class LeftPanelVM
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub BackRotation()
|
||||
'If IsNothing(Map.refProjManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return
|
||||
'If IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso IsNothing(Map.refProjManagerVM) Then
|
||||
Return
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(Map.refOnlyProdManagerVM) Then
|
||||
@@ -1282,7 +1282,7 @@ Public Class LeftPanelVM
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub ForwardRotation()
|
||||
'If IsNothing(Map.refProjManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return
|
||||
'If IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso IsNothing(Map.refProjManagerVM) Then
|
||||
Return
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(Map.refOnlyProdManagerVM) Then
|
||||
@@ -1333,7 +1333,7 @@ Public Class LeftPanelVM
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub CopyFeature()
|
||||
If IsNothing(Map.refProjManagerVM.CurrProj) Then Return
|
||||
If IsNothing(ProjectManagerVM.CurrProj) Then Return
|
||||
Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart
|
||||
If IsNothing(SelPart) Then Return
|
||||
Dim SelFeature As BTLFeatureVM = SelPart.SelBTLFeatureVM
|
||||
@@ -1367,7 +1367,7 @@ Public Class LeftPanelVM
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub MacroFeature()
|
||||
If IsNothing(Map.refProjManagerVM.CurrProj) Then Return
|
||||
If IsNothing(ProjectManagerVM.CurrProj) Then Return
|
||||
If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then Return
|
||||
' apro finestra di creazione macro
|
||||
Dim MacroFeatureWndVM As New MacroFeatureWndVM()
|
||||
@@ -1397,7 +1397,7 @@ Public Class LeftPanelVM
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub AddFeature(ByVal param As Object)
|
||||
If IsNothing(Map.refProjManagerVM.CurrProj) Then Return
|
||||
If IsNothing(ProjectManagerVM.CurrProj) Then Return
|
||||
If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then Return
|
||||
' apro finestra di definizione nuova feature
|
||||
Dim AddFeatureWndVM As New AddFeatureWndVM()
|
||||
@@ -1473,7 +1473,7 @@ Public Class LeftPanelVM
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub RemoveFeature()
|
||||
If IsNothing(Map.refProjManagerVM.CurrProj) Then Return
|
||||
If IsNothing(ProjectManagerVM.CurrProj) Then Return
|
||||
If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then Return
|
||||
If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM) Then Return
|
||||
If EgtBeamEraseProcess(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM.nFeatureId) Then
|
||||
|
||||
@@ -26,8 +26,16 @@ Public Class MyMachGroupVM
|
||||
' seleziono pezzo
|
||||
EgtDeselectAll()
|
||||
If Not IsNothing(value) Then
|
||||
If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
|
||||
' imposto modalita' prod su vista feature
|
||||
Map.refProjectVM.SelProdProj = ProdProj.PROD
|
||||
' deseleziono pezzo in lista BTLPart
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLParts.Clear()
|
||||
End If
|
||||
EgtSelectObj(SelPart.nPartId)
|
||||
DirectCast(m_SelPart, PartVM).SelectBTLPart()
|
||||
If Map.refMainMenuVM.SelPage = Pages.MACHINING Then
|
||||
DirectCast(m_SelPart, PartVM).SelectBTLPart()
|
||||
End If
|
||||
End If
|
||||
EgtDraw()
|
||||
NotifyPropertyChanged(NameOf(SelPart))
|
||||
@@ -370,7 +378,7 @@ Public Class MyMachGroupVM
|
||||
EgtGetMachGroupName(nCurrMachGroup, sCurrMachGroupName)
|
||||
' scrivo dati per variabili P di comunicazione con la macchina in gruppo di lavorazione
|
||||
If Not IsNothing(Map.refProdManagerVM) Then
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_PRODID, Map.refProdManagerVM.CurrProd.nProdId)
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_PRODID, ProjectManagerVM.CurrProd.nProdId)
|
||||
ElseIf Not IsNothing(Map.refOnlyProdManagerVM) Then
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_PRODID, Map.refOnlyProdManagerVM.CurrProd.nProdId)
|
||||
End If
|
||||
@@ -443,7 +451,7 @@ Public Class MyMachGroupVM
|
||||
Dim sCurrMachGroupName As String = ""
|
||||
EgtGetMachGroupName(nCurrMachGroup, sCurrMachGroupName)
|
||||
' scrivo dati per variabili P di comunicazione con la macchina in gruppo di lavorazione
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_PRODID, Map.refProdManagerVM.CurrProd.nProdId)
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_PRODID, ProjectManagerVM.CurrProd.nProdId)
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_MATERIAL, sMATERIAL)
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_PATTID, nCurrMachGroup)
|
||||
' scrivo dati costruzione grezzo in gruppo di lavorazione
|
||||
@@ -530,7 +538,7 @@ Public Class MyMachGroupVM
|
||||
nRawId = EgtGetFirstRawPart()
|
||||
End While
|
||||
Dim sLogPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\RawPartLog.txt"
|
||||
Return ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False)
|
||||
Return ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False)
|
||||
End Function
|
||||
|
||||
Friend Sub MoveBeam(Beam As PartVM, MoveDirection As MoveDirections)
|
||||
@@ -599,8 +607,8 @@ Public Class MyMachGroupVM
|
||||
End Function
|
||||
|
||||
Private Sub ReadProductionState()
|
||||
If IsNothing(Map.refProdManagerVM) OrElse IsNothing(Map.refProdManagerVM.CurrProd) OrElse IsNothing(Map.refProdManagerVM.CurrProd.nProdId) Then Return
|
||||
Dim MachGroupModel As MachGroupModel = DbControllers.m_MachGroupController.FindByMachGroupId(Map.refProdManagerVM.CurrProd.nProdId, Id)
|
||||
If IsNothing(Map.refProdManagerVM) OrElse IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(ProjectManagerVM.CurrProd.nProdId) Then Return
|
||||
Dim MachGroupModel As MachGroupModel = DbControllers.m_MachGroupController.FindByMachGroupId(ProjectManagerVM.CurrProd.nProdId, Id)
|
||||
If Not IsNothing(MachGroupModel) Then
|
||||
If Not String.IsNullOrEmpty(MachGroupModel.SupervisorId) Then
|
||||
SetSupervisorId(MachGroupModel.SupervisorId)
|
||||
|
||||
@@ -279,7 +279,7 @@ Public Class PartVM
|
||||
ParentMachGroupVM.PartVMList.Remove(Me)
|
||||
' aggiorno Db
|
||||
If Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso Not IsNothing(Map.refProdManagerVM) Then
|
||||
DbControllers.m_PartController.Delete(Map.refProdManagerVM.CurrProd.nProdId, ParentMachGroupVM.Id, nPartId)
|
||||
DbControllers.m_PartController.Delete(ProjectManagerVM.CurrProd.nProdId, ParentMachGroupVM.Id, nPartId)
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Not IsNothing(Map.refOnlyProdManagerVM) Then
|
||||
DbControllers.m_PartController.Delete(Map.refOnlyProdManagerVM.CurrProd.nProdId, ParentMachGroupVM.Id, nPartId)
|
||||
End If
|
||||
@@ -369,8 +369,8 @@ Public Class PartVM
|
||||
End Sub
|
||||
|
||||
Private Sub ReadProductionData()
|
||||
If IsNothing(Map.refProdManagerVM) OrElse IsNothing(Map.refProdManagerVM.CurrProd) OrElse IsNothing(Map.refProdManagerVM.CurrProd.nProdId) Then Return
|
||||
Dim PartModel As PartModel = DbControllers.m_PartController.FindByPartId(Map.refProdManagerVM.CurrProd.nProdId, nPartId)
|
||||
If IsNothing(Map.refProdManagerVM) OrElse IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(ProjectManagerVM.CurrProd.nProdId) Then Return
|
||||
Dim PartModel As PartModel = DbControllers.m_PartController.FindByPartId(ProjectManagerVM.CurrProd.nProdId, nPartId)
|
||||
If Not IsNothing(PartModel) Then
|
||||
PartM.SetProductionState(PartModel.State)
|
||||
PartM.dtStartTime = PartModel.DtStart
|
||||
|
||||
@@ -35,9 +35,9 @@ Public Class MainMenuVM
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If value Then
|
||||
If Not IsNothing(Map.refProjManagerVM.CurrProj) AndAlso Not IsNothing(Map.refProdManagerVM.CurrProd) AndAlso
|
||||
Map.refProjManagerVM.CurrProj.nProdId = Map.refProdManagerVM.CurrProd.nProdId Then
|
||||
Map.refProjManagerVM.CurrProj.SetReloadProject(False)
|
||||
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
|
||||
@@ -50,9 +50,9 @@ Public Class MainMenuVM
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If value Then
|
||||
If Not IsNothing(Map.refProjManagerVM.CurrProj) AndAlso Not IsNothing(Map.refProdManagerVM.CurrProd) AndAlso
|
||||
Map.refProjManagerVM.CurrProj.nProdId = Map.refProdManagerVM.CurrProd.nProdId Then
|
||||
Map.refProdManagerVM.CurrProd.SetReloadProject(False)
|
||||
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
|
||||
@@ -275,10 +275,10 @@ Public Class MainMenuVM
|
||||
DimensionsIniFile.ReadGridDimensions(ConstDims.PROJECT_VIEW, Map.refProjectVM.GridDims)
|
||||
DimensionsIniFile.ReadGridDimensions(ConstDims.LEFTPANEL_VIEW, Map.refLeftPanelVM.GridDims)
|
||||
' apro progetto proj
|
||||
If Not IsNothing(Map.refProjManagerVM.CurrProj) Then
|
||||
If Map.refProjManagerVM.CurrProj.bReloadProject OrElse Map.refConfigurationPageVM.QParametersModified Then
|
||||
If Not IsNothing(ProjectManagerVM.CurrProj) Then
|
||||
If ProjectManagerVM.CurrProj.bReloadProject OrElse Map.refConfigurationPageVM.QParametersModified Then
|
||||
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.GOTOPROJ, 2, EgtMsg(63005), 10, 100) ' Loading parts
|
||||
Map.refProjManagerVM.OpenProject(Map.refProjManagerVM.CurrProj)
|
||||
Map.refProjManagerVM.OpenProject(ProjectManagerVM.CurrProj)
|
||||
' aggiorno le colonne in base al tipo progetto
|
||||
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
|
||||
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
@@ -293,7 +293,7 @@ Public Class MainMenuVM
|
||||
End If
|
||||
' resetto modifica parametri Q default
|
||||
Map.refConfigurationPageVM.ResetQParametersModified()
|
||||
DbControllers.m_ProjController.LockByProjId(Map.refProjManagerVM.CurrProj.nProjId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
|
||||
DbControllers.m_ProjController.LockByProjId(ProjectManagerVM.CurrProj.nProjId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
|
||||
Map.refProjManagerVM.NotifyPropertyChanged(NameOf(Map.refProjManagerVM.MruFileNames))
|
||||
Else
|
||||
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.GOTOPROJ, 2, EgtMsg(63005), 10, 100) ' Loading parts
|
||||
@@ -301,29 +301,29 @@ Public Class MainMenuVM
|
||||
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 = Map.refProjManagerVM.CurrProj.nProdId Then
|
||||
If ActiveSession.ItemId = ProjectManagerVM.CurrProj.nProdId Then
|
||||
CommIndex = ActiveSession.Index
|
||||
End If
|
||||
Next
|
||||
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.GOTOPROD, 3, EgtMsg(63002), 30, 100) ' Loading machining groups
|
||||
' verifico se il prod di provenienza ha piu' proj
|
||||
If Not IsNothing(Map.refProdManagerVM.CurrProd) AndAlso Map.refProdManagerVM.CurrProd.nProjIdList.Count > 1 Then
|
||||
If Not IsNothing(ProjectManagerVM.CurrProd) AndAlso ProjectManagerVM.CurrProd.nProjIdList.Count > 1 Then
|
||||
' se si rigenero BTLStructure
|
||||
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(Map.refProjManagerVM.CurrProj.nProjId))
|
||||
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(ProjectManagerVM.CurrProj.nProjId))
|
||||
' carico filtri di ricerca
|
||||
Map.refProjectVM.BTLStructureVM.LoadFilters()
|
||||
End If
|
||||
' fisso indice sessione di comunicazione
|
||||
If CommIndex > -1 Then
|
||||
Map.refProjManagerVM.CurrProj.SetModificationIndex(CommIndex)
|
||||
ProjectManagerVM.CurrProj.SetModificationIndex(CommIndex)
|
||||
End If
|
||||
' mostro tutti i pezzi
|
||||
Map.refShowBeamPanelVM.ShowAll(True)
|
||||
Map.refProjManagerVM.CurrProj.SetReloadProject(True)
|
||||
ProjectManagerVM.CurrProj.SetReloadProject(True)
|
||||
End If
|
||||
' aggiorno titolo
|
||||
Map.refMainWindowVM.UpdateTitle()
|
||||
DbControllers.m_ProjController.LockByProjId(Map.refProjManagerVM.CurrProj.nProjId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
|
||||
DbControllers.m_ProjController.LockByProjId(ProjectManagerVM.CurrProj.nProjId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
|
||||
Else
|
||||
Map.refSceneHostVM.MainController.NewProject()
|
||||
Map.refProjectVM.BTLStructureVM = Nothing
|
||||
@@ -342,7 +342,7 @@ Public Class MainMenuVM
|
||||
Private Function ExitVIEW(bVerifyModification As Boolean) As Boolean
|
||||
' verifico se progetto modificato, e chiedo se salvare
|
||||
If bVerifyModification Then
|
||||
If Not ProjFileVM.VerifyProjectModification(Map.refProjManagerVM.CurrProj, ProjectType.PROJ) Then
|
||||
If Not ProjFileVM.VerifyProjectModification(ProjectManagerVM.CurrProj, ProjectType.PROJ) Then
|
||||
Return False
|
||||
End If
|
||||
End If
|
||||
@@ -368,13 +368,13 @@ Public Class MainMenuVM
|
||||
DimensionsIniFile.ReadGridDimensions(ConstDims.PROJECT_OPTIMIZER, Map.refProjectVM.GridDims)
|
||||
DimensionsIniFile.ReadGridDimensions(ConstDims.LEFTPANEL_OPTIMIZER, Map.refLeftPanelVM.GridDims)
|
||||
' inizializzo gruppi di lavorazione
|
||||
If Not IsNothing(Map.refProdManagerVM.CurrProd) AndAlso Not IsNothing(Map.refProdManagerVM.CurrProd.nProdId) AndAlso Map.refProdManagerVM.CurrProd.nProdId > 0 Then
|
||||
If File.Exists(Map.refProdManagerVM.CurrProd.sProdPath) Then
|
||||
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 Map.refProdManagerVM.CurrProd.bReloadProject OrElse Map.refConfigurationPageVM.QParametersModified Then
|
||||
If ProjectManagerVM.CurrProd.bReloadProject OrElse Map.refConfigurationPageVM.QParametersModified Then
|
||||
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.GOTOPROD, 2, EgtMsg(63005), 10, 50) ' Loading parts
|
||||
Map.refProdManagerVM.TempCurrProd = Map.refProdManagerVM.CurrProd
|
||||
If Map.refSceneHostVM.MainController.OpenProject(Map.refProdManagerVM.CurrProd.sProdPath, False) Then
|
||||
Map.refProdManagerVM.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)
|
||||
@@ -382,7 +382,7 @@ Public Class MainMenuVM
|
||||
Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
' resetto modifica parametri Q default
|
||||
Map.refConfigurationPageVM.ResetQParametersModified()
|
||||
DbControllers.m_ProdController.LockByProdId(Map.refProdManagerVM.CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
|
||||
DbControllers.m_ProdController.LockByProdId(ProjectManagerVM.CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
|
||||
Map.refProdManagerVM.NotifyPropertyChanged(NameOf(Map.refProdManagerVM.MruFileNames))
|
||||
End If
|
||||
Else
|
||||
@@ -390,7 +390,7 @@ Public Class MainMenuVM
|
||||
' mostro tutti i pezzi
|
||||
Map.refShowBeamPanelVM.ShowAll(False)
|
||||
' verifico se il prod ha piu' proj
|
||||
If Map.refProdManagerVM.CurrProd.nProjIdList.Count > 1 Then
|
||||
If ProjectManagerVM.CurrProd.nProjIdList.Count > 1 Then
|
||||
' se si rigenero BTLStructure
|
||||
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(0))
|
||||
' carico filtri di ricerca
|
||||
@@ -400,7 +400,7 @@ Public Class MainMenuVM
|
||||
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 = Map.refProdManagerVM.CurrProd.nProdId Then
|
||||
If ActiveSession.ItemId = ProjectManagerVM.CurrProd.nProdId Then
|
||||
CommIndex = ActiveSession.Index
|
||||
End If
|
||||
Next
|
||||
@@ -409,20 +409,20 @@ Public Class MainMenuVM
|
||||
Map.refProjectVM.MachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList()))
|
||||
' fisso indice sessione di comunicazione
|
||||
If CommIndex > -1 Then
|
||||
Map.refProdManagerVM.CurrProd.SetModificationIndex(CommIndex)
|
||||
ProjectManagerVM.CurrProd.SetModificationIndex(CommIndex)
|
||||
End If
|
||||
Map.refProdManagerVM.CurrProd.SetReloadProject(True)
|
||||
ProjectManagerVM.CurrProd.SetReloadProject(True)
|
||||
End If
|
||||
'DbControllers.m_ProdController.ResetController()
|
||||
' 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 Map.refProdManagerVM.CurrProd.nProjIdList.Count > 1 Then
|
||||
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(Map.refProdManagerVM.CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
|
||||
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
|
||||
@@ -500,7 +500,7 @@ Public Class MainMenuVM
|
||||
Private Function ExitMACHINING(bVerifyModification As Boolean) As Boolean
|
||||
' verifico se progetto modificato, e chiedo se salvare
|
||||
If bVerifyModification Then
|
||||
If ProdFileVM.VerifyProjectModification(Map.refProdManagerVM.CurrProd) = MessageBoxResult.Cancel Then
|
||||
If ProdFileVM.VerifyProjectModification(ProjectManagerVM.CurrProd) = MessageBoxResult.Cancel Then
|
||||
Return False
|
||||
End If
|
||||
End If
|
||||
@@ -781,7 +781,7 @@ Public Class MainMenuVM
|
||||
''' Execute the SendFeedback. This method is invoked by the SendFeedbackCommand.
|
||||
''' </summary>
|
||||
Public Sub SendFeedback(ByVal param As Object)
|
||||
If SelPage = Pages.MACHINING AndAlso IsNothing(Map.refProdManagerVM.CurrProd) Then
|
||||
If SelPage = Pages.MACHINING AndAlso IsNothing(ProjectManagerVM.CurrProd) Then
|
||||
MessageBox.Show(EgtMsg(61891), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
@@ -815,11 +815,11 @@ Public Class MainMenuVM
|
||||
'End If
|
||||
' Esporto il progetto
|
||||
Dim ProjFileMList As List(Of ProjFileM)
|
||||
If SelPage = Pages.MACHINING And Not IsNothing(Map.refProdManagerVM.CurrProd) Then
|
||||
ProjFileMList = DbControllers.m_ProjController.GetByProdAsc(Map.refProdManagerVM.CurrProd.nProdId)
|
||||
If SelPage = Pages.MACHINING And Not IsNothing(ProjectManagerVM.CurrProd) Then
|
||||
ProjFileMList = DbControllers.m_ProjController.GetByProdAsc(ProjectManagerVM.CurrProd.nProdId)
|
||||
Map.refProjManagerVM.SetCurrProj(ProjFileMList(0).nProjId)
|
||||
End If
|
||||
Dim sExportFileName = Map.refProjManagerVM.CurrProj.nProjId.ToString("0000") & " - " & Map.refProjManagerVM.CurrProj.sBTLFileName & " - ProjectExport"
|
||||
Dim sExportFileName = ProjectManagerVM.CurrProj.nProjId.ToString("0000") & " - " & ProjectManagerVM.CurrProj.sBTLFileName & " - ProjectExport"
|
||||
Dim sExpZipToCreate = Map.refProjManagerVM.ExportProject(sExportFileName)
|
||||
' Creo zip file da allegare
|
||||
Dim sZipToCreate As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\Feedback.zip"
|
||||
@@ -836,12 +836,12 @@ Public Class MainMenuVM
|
||||
Dim ProdId As Integer
|
||||
Select Case Map.refMainMenuVM.SelPage
|
||||
Case Pages.VIEW
|
||||
ProdId = Map.refProjManagerVM.CurrProj.nProdId
|
||||
ProdId = ProjectManagerVM.CurrProj.nProdId
|
||||
Case Pages.MACHINING
|
||||
ProdId = Map.refProdManagerVM.CurrProd.nProdId
|
||||
ProdId = ProjectManagerVM.CurrProd.nProdId
|
||||
End Select
|
||||
If ProdId = 0 Then
|
||||
zip.AddItem(Map.refProjManagerVM.CurrProj.sProjDirPath, "Projs\" & Map.refProjManagerVM.CurrProj.nProjId.ToString("0000"))
|
||||
zip.AddItem(ProjectManagerVM.CurrProj.sProjDirPath, "Projs\" & ProjectManagerVM.CurrProj.nProjId.ToString("0000"))
|
||||
Else
|
||||
ProjFileMList = DbControllers.m_ProjController.GetByProdAsc(ProdId)
|
||||
' se piu' di uno
|
||||
|
||||
@@ -99,29 +99,29 @@ Public Class MainWindowVM
|
||||
Select Case Map.refMainMenuVM.SelPage
|
||||
Case Pages.VIEW
|
||||
If GetMainPrivateProfileInt(S_GENERAL, K_PROJECTMODE, 0) = 1 Then
|
||||
If Not IsNothing(Map.refProjManagerVM.CurrProj) Then
|
||||
If Map.refProjManagerVM.CurrProj.bIsNew Then m_Title = "New - "
|
||||
If Not IsNothing(Map.refProjManagerVM.CurrProj.nProdId) AndAlso Map.refProjManagerVM.CurrProj.nProdId > 0 Then
|
||||
m_Title &= Map.refProjManagerVM.CurrProj.nProdId.ToString("0000") & " - "
|
||||
If Not IsNothing(ProjectManagerVM.CurrProj) Then
|
||||
If ProjectManagerVM.CurrProj.bIsNew Then m_Title = "New - "
|
||||
If Not IsNothing(ProjectManagerVM.CurrProj.nProdId) AndAlso ProjectManagerVM.CurrProj.nProdId > 0 Then
|
||||
m_Title &= ProjectManagerVM.CurrProj.nProdId.ToString("0000") & " - "
|
||||
End If
|
||||
m_Title &= Map.refProjManagerVM.CurrProj.sBTLFileName
|
||||
m_Title &= ProjectManagerVM.CurrProj.sBTLFileName
|
||||
End If
|
||||
Else
|
||||
If Not IsNothing(Map.refProjManagerVM.CurrProj) Then
|
||||
If Map.refProjManagerVM.CurrProj.bIsNew Then m_Title = "New - "
|
||||
m_Title &= Map.refProjManagerVM.CurrProj.nProjId.ToString("0000") & " - " & Map.refProjManagerVM.CurrProj.sBTLFileName
|
||||
If Not IsNothing(ProjectManagerVM.CurrProj) Then
|
||||
If ProjectManagerVM.CurrProj.bIsNew Then m_Title = "New - "
|
||||
m_Title &= ProjectManagerVM.CurrProj.nProjId.ToString("0000") & " - " & ProjectManagerVM.CurrProj.sBTLFileName
|
||||
End If
|
||||
End If
|
||||
Case Pages.MACHINING
|
||||
If GetMainPrivateProfileInt(S_GENERAL, K_PROJECTMODE, 0) = 1 Then
|
||||
If Not IsNothing(Map.refProdManagerVM.CurrProd) Then
|
||||
If Map.refProdManagerVM.CurrProd.bIsNew Then m_Title = "New - "
|
||||
m_Title &= Map.refProdManagerVM.CurrProd.nProdId.ToString("0000") & " - " & Map.refProdManagerVM.CurrProd.sName
|
||||
If Not IsNothing(ProjectManagerVM.CurrProd) Then
|
||||
If ProjectManagerVM.CurrProd.bIsNew Then m_Title = "New - "
|
||||
m_Title &= ProjectManagerVM.CurrProd.nProdId.ToString("0000") & " - " & ProjectManagerVM.CurrProd.sName
|
||||
End If
|
||||
Else
|
||||
If Not IsNothing(Map.refProdManagerVM.CurrProd) Then
|
||||
If Map.refProdManagerVM.CurrProd.bIsNew Then m_Title = "New - "
|
||||
m_Title &= Map.refProdManagerVM.CurrProd.nProdId.ToString("0000") & " - " & Map.refProdManagerVM.CurrProd.sBTLFileName
|
||||
If Not IsNothing(ProjectManagerVM.CurrProd) Then
|
||||
If ProjectManagerVM.CurrProd.bIsNew Then m_Title = "New - "
|
||||
m_Title &= ProjectManagerVM.CurrProd.nProdId.ToString("0000") & " - " & ProjectManagerVM.CurrProd.sBTLFileName
|
||||
End If
|
||||
End If
|
||||
Case Pages.CONFIG
|
||||
@@ -172,6 +172,7 @@ Public Class MainWindowVM
|
||||
Case 1
|
||||
If Map.refMainWindowVM.MainWindowM.bOnlyProd Then
|
||||
Map.refOnlyProdManagerVM.SetCurrProd(nProdId)
|
||||
Map.refOnlyProdManagerVM.SetCurrProj(Map.refOnlyProdManagerVM.CurrProd.nProjId)
|
||||
Else
|
||||
Map.refProdManagerVM.SetCurrProd(nProdId)
|
||||
End If
|
||||
@@ -189,6 +190,7 @@ Public Class MainWindowVM
|
||||
Integer.TryParse(sPjId, PjId)
|
||||
If Map.refMainWindowVM.MainWindowM.bOnlyProd Then
|
||||
Map.refOnlyProdManagerVM.SetCurrProd(PjId)
|
||||
Map.refOnlyProdManagerVM.SetCurrProj(Map.refOnlyProdManagerVM.CurrProd.nProjIdList(0))
|
||||
Else
|
||||
Map.refProjManagerVM.SetCurrProj(PjId)
|
||||
End If
|
||||
@@ -384,9 +386,9 @@ Public Class MainWindowVM
|
||||
Dim bOk As Boolean = True
|
||||
Select Case Map.refMainMenuVM.SelPage
|
||||
Case Pages.VIEW
|
||||
bOk = ProjFileVM.VerifyProjectModification(Map.refProjManagerVM.CurrProj, ProjectType.PROJ)
|
||||
bOk = ProjFileVM.VerifyProjectModification(ProjectManagerVM.CurrProj, ProjectType.PROJ)
|
||||
Case Pages.MACHINING
|
||||
bOk = ProdFileVM.VerifyProjectModification(Map.refProdManagerVM.CurrProd) <> MessageBoxResult.Cancel
|
||||
bOk = ProdFileVM.VerifyProjectModification(ProjectManagerVM.CurrProd) <> MessageBoxResult.Cancel
|
||||
Case Pages.CONFIG
|
||||
' Verifica modifica parametri Macchina e chiedo il salvataggio
|
||||
Map.refConfigurationPageVM.VerifyConfigPageModification()
|
||||
@@ -410,10 +412,10 @@ Public Class MainWindowVM
|
||||
Dim sFilePath As String = String.Empty
|
||||
If EgtGetCurrFilePath(sFilePath) Then WriteMainPrivateProfileString(S_GENERAL, K_LASTPROJ, sFilePath)
|
||||
' tolgo lock da file aperto
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW And Not IsNothing(Map.refProjManagerVM) AndAlso Not IsNothing(Map.refProjManagerVM.CurrProj) Then
|
||||
DbControllers.m_ProjController.LockByProjId(Map.refProjManagerVM.CurrProj.nProjId, False, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING And Not IsNothing(Map.refProdManagerVM) AndAlso Not IsNothing(Map.refProdManagerVM.CurrProd) Then
|
||||
DbControllers.m_ProdController.LockByProdId(Map.refProdManagerVM.CurrProd.nProdId, False, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW And Not IsNothing(Map.refProjManagerVM) AndAlso Not IsNothing(ProjectManagerVM.CurrProj) Then
|
||||
DbControllers.m_ProjController.LockByProjId(ProjectManagerVM.CurrProj.nProjId, False, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING And Not IsNothing(Map.refProdManagerVM) AndAlso Not IsNothing(ProjectManagerVM.CurrProd) Then
|
||||
DbControllers.m_ProdController.LockByProdId(ProjectManagerVM.CurrProd.nProdId, False, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE And Not IsNothing(Map.refOnlyProdManagerVM) AndAlso Not IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then
|
||||
DbControllers.m_ProdController.LockByProdId(Map.refOnlyProdManagerVM.CurrProd.nProdId, False, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
|
||||
End If
|
||||
|
||||
@@ -412,7 +412,7 @@ Public Class NestingRunningWndVM
|
||||
' creo Machgroup
|
||||
Dim nCurrMachGroup As Integer = EgtAddMachGroup(NewMachGroupName(), CurrentMachine.sMachineName)
|
||||
' scrivo dati per variabili P di comunicazione con la macchina in gruppo di lavorazione
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_PRODID, Map.refProdManagerVM.CurrProd.nProdId)
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_PRODID, ProjectManagerVM.CurrProd.nProdId)
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_PATTID, nCurrMachGroup)
|
||||
' aggiungo le info
|
||||
If bOutlineFound Then
|
||||
|
||||
@@ -103,8 +103,8 @@ Public Class NewOpenProjectFileDialogVM
|
||||
' recupero path per verificare esista
|
||||
If IsNothing(Project.nProdId) OrElse Project.nProdId = 0 Then Continue For
|
||||
Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProdsDir & "\" & Project.nProdId.ToString("0000") & "\" & Project.nProdId.ToString("0000") & ".nge"
|
||||
If Project.sMachine = Map.refProjManagerVM.CurrProj.sMachine AndAlso
|
||||
Project.nType = Map.refProjManagerVM.CurrProj.nType Then
|
||||
If Project.sMachine = ProjectManagerVM.CurrProj.sMachine AndAlso
|
||||
Project.nType = ProjectManagerVM.CurrProj.nType Then
|
||||
If File.Exists(sPath) Then
|
||||
' m_ProjectList.Add(New ProdItem(New ProdFileVM(Project)))
|
||||
'Else
|
||||
@@ -151,7 +151,7 @@ Public Class NewOpenProjectFileDialogVM
|
||||
' recupero indice per riselezionare
|
||||
Dim ProjListIndex As Integer = m_ProjectList.IndexOf(SelProject)
|
||||
' verifico se proj selezionato e' il corrente
|
||||
If Not IsNothing(Map.refProjManagerVM.CurrProj) AndAlso SelProject.ProjFileList.Any(Function(x) x.nProjId = Map.refProjManagerVM.CurrProj.nProjId) Then
|
||||
If Not IsNothing(ProjectManagerVM.CurrProj) AndAlso SelProject.ProjFileList.Any(Function(x) x.nProjId = ProjectManagerVM.CurrProj.nProjId) Then
|
||||
If m_ProjectType = ProjectType.PROJ AndAlso MessageBox.Show(EgtMsg(61872), EgtMsg(30009), MessageBoxButton.OKCancel, MessageBoxImage.Warning) = MessageBoxResult.Cancel Then
|
||||
Return
|
||||
Else
|
||||
@@ -159,7 +159,7 @@ Public Class NewOpenProjectFileDialogVM
|
||||
End If
|
||||
End If
|
||||
' verifico se prod selezionato e' il corrente
|
||||
If Not IsNothing(Map.refProdManagerVM.CurrProd) AndAlso SelProject.ProdFileVM.nProdId = Map.refProdManagerVM.CurrProd.nProdId Then
|
||||
If Not IsNothing(ProjectManagerVM.CurrProd) AndAlso SelProject.ProdFileVM.nProdId = ProjectManagerVM.CurrProd.nProdId Then
|
||||
If m_ProjectType = ProjectType.PROD AndAlso MessageBox.Show(EgtMsg(61872), EgtMsg(30009), MessageBoxButton.OKCancel, MessageBoxImage.Warning) = MessageBoxResult.Cancel Then
|
||||
Return
|
||||
Else
|
||||
|
||||
@@ -29,23 +29,21 @@ Public Class OnlyProdManagerVM
|
||||
NotifyPropertyChanged(NameOf(OnlyProdManager_IsEnabled))
|
||||
End Sub
|
||||
|
||||
Private m_CurrProj As ProjFileVM
|
||||
Friend Property CurrProj As ProjFileVM
|
||||
Get
|
||||
Return m_CurrProj
|
||||
Return ProjectManagerVM.CurrProj
|
||||
End Get
|
||||
Set(value As ProjFileVM)
|
||||
m_CurrProj = value
|
||||
ProjectManagerVM.CurrProj = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_CurrProd As ProdFileVM
|
||||
Friend Property CurrProd As ProdFileVM
|
||||
Get
|
||||
Return m_CurrProd
|
||||
Return ProjectManagerVM.CurrProd
|
||||
End Get
|
||||
Set(value As ProdFileVM)
|
||||
m_CurrProd = value
|
||||
ProjectManagerVM.CurrProd = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -233,10 +231,7 @@ Public Class OnlyProdManagerVM
|
||||
#Region "METHODS"
|
||||
|
||||
Public Function SetCurrProj(nProjId As Integer) As Boolean
|
||||
Dim Currproj As ProjFileM = DbControllers.m_ProjController.FindByProjIdConv(nProjId)
|
||||
If IsNothing(Currproj) Then Return False
|
||||
m_CurrProj = New ProjFileVM(Currproj)
|
||||
Return True
|
||||
Return ProjectManagerVM.SetCurrProj(nProjId)
|
||||
End Function
|
||||
|
||||
Public Function UpdateCurrProj() As Boolean
|
||||
@@ -308,10 +303,7 @@ Public Class OnlyProdManagerVM
|
||||
End Sub
|
||||
|
||||
Public Function SetCurrProd(nProdId As Integer) As Boolean
|
||||
Dim CurrProdM As ProdFileM = DbControllers.m_ProdController.FindCoreByProdId(nProdId)
|
||||
If IsNothing(CurrProdM) Then Return False
|
||||
m_CurrProd = New ProdFileVM(CurrProdM)
|
||||
Return True
|
||||
Return ProjectManagerVM.SetCurrProd(nProdId)
|
||||
End Function
|
||||
|
||||
Public Sub OpenProject_Tick()
|
||||
@@ -324,13 +316,13 @@ Public Class OnlyProdManagerVM
|
||||
DbProject = DbControllers.m_ProdController.FindCoreByProdId(m_nProjIdToOpen)
|
||||
Dim ProjectVM As New ProdFileVM(DbProject)
|
||||
' verifico se progetto modificato, e chiedo se salvare
|
||||
If Not ProjFileVM.VerifyProjectModification(Map.refProjManagerVM.CurrProj, ProjectType.PROJ) Then Return
|
||||
If Not ProjFileVM.VerifyProjectModification(ProjectManagerVM.CurrProj, ProjectType.PROJ) Then Return
|
||||
OpenProject(ProjectVM)
|
||||
Case Pages.VIEW
|
||||
' verifico se progetto modificato, e chiedo se salvare
|
||||
If Not ProjFileVM.VerifyProjectModification(Map.refProjManagerVM.CurrProj, ProjectType.PROJ) Then Return
|
||||
If Not ProjFileVM.VerifyProjectModification(ProjectManagerVM.CurrProj, ProjectType.PROJ) Then Return
|
||||
LoadingWndHelper.OpenLoadingWnd(ActiveIds.GOTOPROD, 3, EgtMsg(63004), EgtMsg(63011), 10) ' Optimization opening ' Loading environment
|
||||
If Not IsNothing(Map.refProjManagerVM.CurrProj) AndAlso (m_nProjIdToOpen <> Map.refProjManagerVM.CurrProj.nProdId OrElse IsNothing(CurrProd)) Then
|
||||
If Not IsNothing(ProjectManagerVM.CurrProj) AndAlso (m_nProjIdToOpen <> ProjectManagerVM.CurrProj.nProdId OrElse IsNothing(CurrProd)) Then
|
||||
SetCurrProd(m_nProjIdToOpen)
|
||||
CurrProd.SetReloadProject(True)
|
||||
Else
|
||||
@@ -352,7 +344,7 @@ Public Class OnlyProdManagerVM
|
||||
End Sub
|
||||
|
||||
Public Sub OpenProjectFromSupervisor(ProjIdToOpen As Integer)
|
||||
If (Not IsNothing(m_CurrProd) AndAlso ProjIdToOpen <> m_CurrProd.nProdId) OrElse Map.refMainMenuVM.SelPage <> Pages.ONLYPRODPAGE Then
|
||||
If (Not IsNothing(CurrProd) AndAlso ProjIdToOpen <> CurrProd.nProdId) OrElse Map.refMainMenuVM.SelPage <> Pages.ONLYPRODPAGE Then
|
||||
m_nProjIdToOpen = ProjIdToOpen
|
||||
m_bOpenProj = True
|
||||
End If
|
||||
@@ -362,7 +354,7 @@ Public Class OnlyProdManagerVM
|
||||
' inizializzo nuovo progetto PROD
|
||||
Dim nProdId As Integer = 0
|
||||
Dim sProdDir As String = ""
|
||||
InitNewProd(m_CurrProj.nProjId, nProdId, sProdDir)
|
||||
InitNewProd(CurrProj.nProjId, nProdId, sProdDir)
|
||||
' setto il PType del Prod
|
||||
DbControllers.m_ProdController.UpdatePType(nProdId, CurrProj.nType)
|
||||
' setto la Macchina associata al Prod
|
||||
@@ -708,10 +700,10 @@ Public Class OnlyProdManagerVM
|
||||
Map.refCALCPanelVM.ResetMachineModified()
|
||||
End If
|
||||
' se nuovo progetto
|
||||
If m_CurrProd.bIsNew Then
|
||||
If CurrProd.bIsNew Then
|
||||
' resetto stato new
|
||||
' DbControllers.m_ProdController.Reset(CurrProd.nProjId)
|
||||
m_CurrProd.bIsNew = False
|
||||
CurrProd.bIsNew = False
|
||||
End If
|
||||
Map.refMainWindowVM.UpdateTitle()
|
||||
NotifyPropertyChanged(NameOf(MruFileNames))
|
||||
@@ -1332,7 +1324,7 @@ Public Class OnlyProdManagerVM
|
||||
Dim SameAsseBaseProjId As Integer
|
||||
EgtGetInfo(FindAsseBaseId, BTL_PRT_PROJ, SameAsseBaseProjId)
|
||||
' se l'ho trovato esco dal While (FindAsseBaseId è l'id dell'AsseBase in cui vogliamo rilocare i sottonodi)
|
||||
'If SameAsseBaseProjId = Map.refProjManagerVM.CurrProj.nProjId Then Exit While
|
||||
'If SameAsseBaseProjId = ProjectManagerVM.CurrProj.nProjId Then Exit While
|
||||
If SameAsseBaseProjId = CurrProd.nProdId Then Exit While
|
||||
FindAsseBaseId = EgtGetNextName(FindAsseBaseId, ASSEBASE)
|
||||
End While
|
||||
@@ -1392,7 +1384,7 @@ Public Class OnlyProdManagerVM
|
||||
End If
|
||||
' copio il file originale scelto nel dialog per l'Update nella cartella Proj del progetto corrente
|
||||
If File.Exists(sFile) Then
|
||||
'Dim sDestPath As String = Map.refProjManagerVM.CurrProj.sProjDirPath & "\" & Path.GetFileNameWithoutExtension(sFile)
|
||||
'Dim sDestPath As String = ProjectManagerVM.CurrProj.sProjDirPath & "\" & Path.GetFileNameWithoutExtension(sFile)
|
||||
Dim sDestPath As String = CurrProd.sProdDirPath & "\" & Path.GetFileNameWithoutExtension(sFile)
|
||||
While File.Exists(sDestPath & ".btl")
|
||||
sDestPath &= "_1"
|
||||
@@ -1538,7 +1530,7 @@ Public Class OnlyProdManagerVM
|
||||
''' Execute the Export. This method is invoked by the ExportCommand.
|
||||
''' </summary>
|
||||
Public Sub ImportProject()
|
||||
Dim TempCurrProd As ProjectFileVM = m_CurrProd
|
||||
Dim TempCurrProd As ProjectFileVM = CurrProd
|
||||
' lista di tutti gli errori riscontrati
|
||||
Dim ErrorList As New List(Of String)
|
||||
'If Not ProjFileVM.VerifyProjectModification(CurrProj, ProjectType.PROJ) Then Return
|
||||
|
||||
@@ -86,8 +86,8 @@ Public Class OpenProjectFileDialogVM
|
||||
' recupero path per verificare esista
|
||||
If IsNothing(Project.nProdId) OrElse Project.nProdId = 0 Then Continue For
|
||||
Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProdsDir & "\" & Project.nProdId.ToString("0000") & "\" & Project.nProdId.ToString("0000") & ".nge"
|
||||
If Project.sMachine = Map.refProjManagerVM.CurrProj.sMachine AndAlso
|
||||
Project.nType = Map.refProjManagerVM.CurrProj.nType Then
|
||||
If Project.sMachine = ProjectManagerVM.CurrProj.sMachine AndAlso
|
||||
Project.nType = ProjectManagerVM.CurrProj.nType Then
|
||||
If File.Exists(sPath) Then
|
||||
m_ProjectList.Add(New ProdFileVM(Project))
|
||||
Else
|
||||
@@ -118,7 +118,7 @@ Public Class OpenProjectFileDialogVM
|
||||
Dim ProjListIndex As Integer = m_ProjectList.IndexOf(SelProject)
|
||||
If m_ProjectType = ProjectType.PROJ Then
|
||||
' verifico se proj selezionato e' il corrente
|
||||
If Not IsNothing(Map.refProjManagerVM.CurrProj) AndAlso SelProject.nProjId = Map.refProjManagerVM.CurrProj.nProjId Then
|
||||
If Not IsNothing(ProjectManagerVM.CurrProj) AndAlso SelProject.nProjId = ProjectManagerVM.CurrProj.nProjId Then
|
||||
MessageBox.Show(EgtMsg(61872), EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Warning)
|
||||
Return
|
||||
End If
|
||||
@@ -147,7 +147,7 @@ Public Class OpenProjectFileDialogVM
|
||||
Next
|
||||
ElseIf m_ProjectType = ProjectType.PROD Then
|
||||
' verifico se prod selezionato e' il corrente
|
||||
If Not IsNothing(Map.refProdManagerVM.CurrProd) AndAlso SelProject.nProdId = Map.refProdManagerVM.CurrProd.nProdId Then
|
||||
If Not IsNothing(ProjectManagerVM.CurrProd) AndAlso SelProject.nProdId = ProjectManagerVM.CurrProd.nProdId Then
|
||||
MessageBox.Show(EgtMsg(61872), EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Warning)
|
||||
Return
|
||||
End If
|
||||
@@ -207,7 +207,7 @@ Public Class OpenProjectFileDialogVM
|
||||
EgtDeleteContext(nTempCtx)
|
||||
End If
|
||||
' se proj corrente era il prod cancellato, aggiorno proj corrente
|
||||
If Not IsNothing(Map.refProjManagerVM.CurrProj) AndAlso Map.refProjManagerVM.CurrProj.nProdId = SelProject.nProdId Then
|
||||
If Not IsNothing(ProjectManagerVM.CurrProj) AndAlso ProjectManagerVM.CurrProj.nProdId = SelProject.nProdId Then
|
||||
Map.refProjManagerVM.UpdateCurrProj()
|
||||
End If
|
||||
' cancello cartella del Prod
|
||||
|
||||
@@ -493,7 +493,7 @@ Public Class OptimizePanelVM
|
||||
''' Execute the Open. This method is invoked by the OpenCommand.
|
||||
''' </summary>
|
||||
Friend Sub Warehouse()
|
||||
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then 'If Not IsNothing(Map.refProdManagerVM.CurrProd) Then
|
||||
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then 'If Not IsNothing(ProjectManagerVM.CurrProd) Then
|
||||
Dim WarehouseWnd As New WarehouseWndV(Application.Current.MainWindow, New WarehouseWndVM())
|
||||
WarehouseWnd.ShowDialog()
|
||||
End If
|
||||
|
||||
@@ -23,13 +23,12 @@ Public Class ProdManagerVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_CurrProd As ProdFileVM
|
||||
Friend Property CurrProd As ProdFileVM
|
||||
Get
|
||||
Return m_CurrProd
|
||||
Return ProjectManagerVM.CurrProd
|
||||
End Get
|
||||
Set(value As ProdFileVM)
|
||||
m_CurrProd = value
|
||||
ProjectManagerVM.CurrProd = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -191,10 +190,7 @@ Public Class ProdManagerVM
|
||||
End Function
|
||||
|
||||
Public Function SetCurrProd(nProdId As Integer) As Boolean
|
||||
Dim CurrProdM As ProdFileM = DbControllers.m_ProdController.FindCoreByProdId(nProdId)
|
||||
If IsNothing(CurrProdM) Then Return False
|
||||
Map.refProdManagerVM.CurrProd = New ProdFileVM(CurrProdM)
|
||||
Return True
|
||||
Return ProjectManagerVM.SetCurrProd(nProdId)
|
||||
End Function
|
||||
|
||||
Public Sub ResetCurrProd()
|
||||
@@ -207,7 +203,7 @@ Public Class ProdManagerVM
|
||||
End Sub
|
||||
|
||||
Public Sub OpenProjectFromSupervisor(ProjIdToOpen As Integer)
|
||||
If (Not IsNothing(Map.refProdManagerVM.m_CurrProd) AndAlso ProjIdToOpen <> Map.refProdManagerVM.m_CurrProd.nProdId) OrElse Map.refMainMenuVM.SelPage <> Pages.MACHINING Then
|
||||
If (Not IsNothing(ProjectManagerVM.CurrProd) AndAlso ProjIdToOpen <> ProjectManagerVM.CurrProd.nProdId) OrElse Map.refMainMenuVM.SelPage <> Pages.MACHINING Then
|
||||
m_nProjIdToOpen = ProjIdToOpen
|
||||
m_bOpenProj = True
|
||||
End If
|
||||
@@ -223,17 +219,17 @@ Public Class ProdManagerVM
|
||||
DbProject = DbControllers.m_ProdController.FindCoreByProdId(m_nProjIdToOpen)
|
||||
Dim ProjectVM As New ProdFileVM(DbProject)
|
||||
' verifico se progetto modificato, e chiedo se salvare
|
||||
If Not ProjFileVM.VerifyProjectModification(Map.refProjManagerVM.CurrProj, ProjectType.PROJ) Then Return
|
||||
If Not ProjFileVM.VerifyProjectModification(ProjectManagerVM.CurrProj, ProjectType.PROJ) Then Return
|
||||
OpenProject(ProjectVM)
|
||||
Case Pages.VIEW
|
||||
' verifico se progetto modificato, e chiedo se salvare
|
||||
If Not ProjFileVM.VerifyProjectModification(Map.refProjManagerVM.CurrProj, ProjectType.PROJ) Then Return
|
||||
If Not ProjFileVM.VerifyProjectModification(ProjectManagerVM.CurrProj, ProjectType.PROJ) Then Return
|
||||
LoadingWndHelper.OpenLoadingWnd(ActiveIds.GOTOPROD, 3, EgtMsg(63004), EgtMsg(63011), 10) ' Optimization opening ' Loading environment
|
||||
If Not IsNothing(Map.refProjManagerVM.CurrProj) AndAlso (m_nProjIdToOpen <> Map.refProjManagerVM.CurrProj.nProdId OrElse IsNothing(Map.refProdManagerVM.CurrProd)) Then
|
||||
If Not IsNothing(ProjectManagerVM.CurrProj) AndAlso (m_nProjIdToOpen <> ProjectManagerVM.CurrProj.nProdId OrElse IsNothing(ProjectManagerVM.CurrProd)) Then
|
||||
Map.refProdManagerVM.SetCurrProd(m_nProjIdToOpen)
|
||||
Map.refProdManagerVM.CurrProd.SetReloadProject(True)
|
||||
ProjectManagerVM.CurrProd.SetReloadProject(True)
|
||||
Else
|
||||
Map.refProdManagerVM.CurrProd.SetReloadProject(False)
|
||||
ProjectManagerVM.CurrProd.SetReloadProject(False)
|
||||
End If
|
||||
' Ricavo il tipo di Warehouse settato nell'INI
|
||||
Dim nDefault As Integer = 2
|
||||
@@ -405,7 +401,7 @@ Public Class ProdManagerVM
|
||||
End Sub
|
||||
|
||||
Public Function Save(Optional bShowLoading As Boolean = False) As Boolean
|
||||
If IsNothing(m_CurrProd) Then Return False
|
||||
If IsNothing(CurrProd) Then Return False
|
||||
If bShowLoading Then LoadingWndHelper.OpenLoadingWnd(ActiveIds.SAVEPROD, 2, EgtMsg(63007), EgtMsg(63012), 70) ' Project saving ' Saving geometry
|
||||
Dim bOk As Boolean = Map.refSceneHostVM.SaveProject()
|
||||
If bShowLoading Then LoadingWndHelper.UpdateLoadingWnd(ActiveIds.SAVEPROD, 2, EgtMsg(63013), 70, 100) ' Saving data on Db
|
||||
@@ -422,23 +418,23 @@ Public Class ProdManagerVM
|
||||
End If
|
||||
' verifico se Reset Macchina modificato e nel caso aggiorno DB e CurrProj
|
||||
If Map.refCALCPanelVM.IsMachineModified() Then
|
||||
DbControllers.m_ProdController.UpdateMachine(Map.refProdManagerVM.CurrProd.nProdId, Map.refCALCPanelVM.SelectedMachine.Name)
|
||||
Map.refProdManagerVM.CurrProd.SetMachine(Map.refCALCPanelVM.SelectedMachine.Name)
|
||||
DbControllers.m_ProdController.UpdateMachine(ProjectManagerVM.CurrProd.nProdId, Map.refCALCPanelVM.SelectedMachine.Name)
|
||||
ProjectManagerVM.CurrProd.SetMachine(Map.refCALCPanelVM.SelectedMachine.Name)
|
||||
' ciclo sulla lista di ProjId associati
|
||||
For Each ProjId In Map.refProdManagerVM.CurrProd.nProjIdList
|
||||
For Each ProjId In ProjectManagerVM.CurrProd.nProjIdList
|
||||
' aggiorno la Macchina per i ProjId associati sul DB
|
||||
DbControllers.m_ProjController.UpdateMachine(ProjId, Map.refCALCPanelVM.SelectedMachine.Name)
|
||||
' se uno dei Proj interessati equivale al Proj correntemente aperto setto la Macchina dello stesso
|
||||
' (poichè il progetto corrente non viene riaperto e riletto dal DB)
|
||||
If ProjId = Map.refProjManagerVM.CurrProj.nProjId Then Map.refProjManagerVM.CurrProj.SetMachine(Map.refCALCPanelVM.SelectedMachine.Name)
|
||||
If ProjId = ProjectManagerVM.CurrProj.nProjId Then ProjectManagerVM.CurrProj.SetMachine(Map.refCALCPanelVM.SelectedMachine.Name)
|
||||
Next
|
||||
Map.refCALCPanelVM.ResetMachineModified()
|
||||
End If
|
||||
' se nuovo progetto
|
||||
If m_CurrProd.bIsNew Then
|
||||
If CurrProd.bIsNew Then
|
||||
' resetto stato new
|
||||
' DbControllers.m_ProdController.Reset(CurrProd.nProjId)
|
||||
m_CurrProd.bIsNew = False
|
||||
CurrProd.bIsNew = False
|
||||
End If
|
||||
Map.refMainWindowVM.UpdateTitle()
|
||||
NotifyPropertyChanged(NameOf(MruFileNames))
|
||||
@@ -558,12 +554,12 @@ Public Class ProdManagerVM
|
||||
''' Execute the Open. This method is invoked by the OpenCommand.
|
||||
''' </summary>
|
||||
Friend Sub GoToProj()
|
||||
If IsNothing(m_CurrProd) Then Return
|
||||
If IsNothing(CurrProd) Then Return
|
||||
' recupero Proj associati da Db
|
||||
Dim ProjFileMList As List(Of ProjFileM) = DbControllers.m_ProjController.GetByProdAsc(m_CurrProd.nProdId)
|
||||
Dim ProjFileMList As List(Of ProjFileM) = DbControllers.m_ProjController.GetByProdAsc(CurrProd.nProdId)
|
||||
Dim nProjId As Integer = 0
|
||||
' verifico se salvare progetto corrente
|
||||
Dim VerifyResult As MessageBoxResult = ProdFileVM.VerifyProjectModification(Map.refProdManagerVM.CurrProd)
|
||||
Dim VerifyResult As MessageBoxResult = ProdFileVM.VerifyProjectModification(ProjectManagerVM.CurrProd)
|
||||
If VerifyResult = MessageBoxResult.Cancel Then Return
|
||||
' se piu' di uno
|
||||
If IsNothing(ProjFileMList) Then
|
||||
@@ -591,7 +587,7 @@ Public Class ProdManagerVM
|
||||
' apro progetto proj
|
||||
Map.refProjManagerVM.SetCurrProj(nProjId)
|
||||
' ricarico progetto se il prod e' nullo (quindi e' stato cancellato)
|
||||
Map.refProjManagerVM.CurrProj.SetReloadProject(IsNothing(CurrProd) OrElse VerifyResult = MessageBoxResult.No)
|
||||
ProjectManagerVM.CurrProj.SetReloadProject(IsNothing(CurrProd) OrElse VerifyResult = MessageBoxResult.No)
|
||||
' vado in pagina proj
|
||||
Map.refMainMenuVM.SetSelPage(Pages.VIEW, False)
|
||||
LoadingWndHelper.CloseLoadingWnd(ActiveIds.GOTOPROJ)
|
||||
@@ -617,7 +613,7 @@ Public Class ProdManagerVM
|
||||
''' Execute the Open. This method is invoked by the OpenCommand.
|
||||
''' </summary>
|
||||
Friend Sub GoToSupervisor()
|
||||
If IsNothing(m_CurrProd) Then Return
|
||||
If IsNothing(CurrProd) Then Return
|
||||
' apro supervisore
|
||||
Dim sSupervisorName As String = "EgtBEAMWALL.SupervisorR32"
|
||||
' recupero processo del supervisore
|
||||
@@ -638,7 +634,7 @@ Public Class ProdManagerVM
|
||||
End If
|
||||
' mando richiesta di apertura progetto in supervisore
|
||||
'Dim x = DbControllers.m_StatusMapController.GetProd
|
||||
DbControllers.m_StatusMapController.UpdateAction(DbControllers.m_SupervisorId, Map.refProdManagerVM.CurrProd.nProdId, Map.refProdManagerVM.CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.ChangeProdInSupervisorRequest, "")
|
||||
DbControllers.m_StatusMapController.UpdateAction(DbControllers.m_SupervisorId, ProjectManagerVM.CurrProd.nProdId, ProjectManagerVM.CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.ChangeProdInSupervisorRequest, "")
|
||||
End Sub
|
||||
|
||||
#End Region ' GoToSupervisor
|
||||
|
||||
@@ -20,13 +20,12 @@ Public Class ProjManagerVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_CurrProj As ProjFileVM
|
||||
Friend Property CurrProj As ProjFileVM
|
||||
Get
|
||||
Return m_CurrProj
|
||||
Return ProjectManagerVM.CurrProj
|
||||
End Get
|
||||
Set(value As ProjFileVM)
|
||||
m_CurrProj = value
|
||||
ProjectManagerVM.CurrProj = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -206,7 +205,7 @@ Public Class ProjManagerVM
|
||||
' inizializzo nuovo progetto
|
||||
Dim nProdId As Integer = 0
|
||||
Dim sProdDir As String = ""
|
||||
Map.refProdManagerVM.InitNewProject(m_CurrProj.nProjId, nProdId, sProdDir)
|
||||
Map.refProdManagerVM.InitNewProject(CurrProj.nProjId, nProdId, sProdDir)
|
||||
' setto il PType del Prod
|
||||
DbControllers.m_ProdController.UpdatePType(nProdId, CurrProj.nType)
|
||||
' setto la Macchina associata al Prod
|
||||
@@ -231,9 +230,9 @@ Public Class ProjManagerVM
|
||||
' imposto currprod
|
||||
Map.refProdManagerVM.SetCurrProd(nProdId)
|
||||
' imposto TempCurrProd
|
||||
Map.refProdManagerVM.TempCurrProd = Map.refProdManagerVM.CurrProd
|
||||
Map.refProdManagerVM.TempCurrProd = ProjectManagerVM.CurrProd
|
||||
' setto flag nuovo progetto in prod
|
||||
Map.refProdManagerVM.CurrProd.bIsNew = True
|
||||
ProjectManagerVM.CurrProd.bIsNew = True
|
||||
Else
|
||||
' elimino da DB
|
||||
DbControllers.m_ProdController.DeleteProd(nProdId, True)
|
||||
@@ -291,10 +290,7 @@ Public Class ProjManagerVM
|
||||
End Function
|
||||
|
||||
Public Function SetCurrProj(nProjId As Integer) As Boolean
|
||||
Dim Currproj As ProjFileM = DbControllers.m_ProjController.FindByProjIdConv(nProjId)
|
||||
If IsNothing(Currproj) Then Return False
|
||||
m_CurrProj = New ProjFileVM(Currproj)
|
||||
Return True
|
||||
Return ProjectManagerVM.SetCurrProj(nProjId)
|
||||
End Function
|
||||
|
||||
Public Function UpdateCurrProj() As Boolean
|
||||
@@ -311,7 +307,7 @@ Public Class ProjManagerVM
|
||||
End Sub
|
||||
|
||||
Private Sub ReloadBTLStructure()
|
||||
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(Map.refProjManagerVM.CurrProj.nProjId))
|
||||
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(ProjectManagerVM.CurrProj.nProjId))
|
||||
' verifico se volume pezzi calcolato
|
||||
Dim bIsCalculated As Boolean = False
|
||||
For Each BTLPart In Map.refProjectVM.BTLStructureVM.BTLPartVMList
|
||||
@@ -582,20 +578,20 @@ Public Class ProjManagerVM
|
||||
' aggiorno BTLParts su DB
|
||||
DbControllers.m_ProjController.UpdateBtlParts(CurrProj.nProjId, Map.refProjectVM.BTLStructureVM.BTLStructureM.BTLPartMList)
|
||||
' se nuovo progetto
|
||||
If m_CurrProj.bIsNew Then
|
||||
If CurrProj.bIsNew Then
|
||||
' resetto stato new
|
||||
DbControllers.m_ProjController.ResetNew(CurrProj.nProjId)
|
||||
m_CurrProj.bIsNew = False
|
||||
CurrProj.bIsNew = False
|
||||
End If
|
||||
' se assemblato lo ripristino
|
||||
If bShowBuilding Then Map.refProjectVM.BTLStructureVM.ShowBuilding(True, False)
|
||||
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, True, False)
|
||||
' verifico se Reset Macchina modificato e nel caso aggiorno DB e CurrProj
|
||||
If Map.refCALCPanelVM.IsMachineModified() Then
|
||||
DbControllers.m_ProjController.UpdateMachine(Map.refProjManagerVM.CurrProj.nProjId, Map.refCALCPanelVM.SelectedMachine.Name)
|
||||
Map.refProjManagerVM.CurrProj.SetMachine(Map.refCALCPanelVM.SelectedMachine.Name)
|
||||
DbControllers.m_ProjController.UpdateMachine(ProjectManagerVM.CurrProj.nProjId, Map.refCALCPanelVM.SelectedMachine.Name)
|
||||
ProjectManagerVM.CurrProj.SetMachine(Map.refCALCPanelVM.SelectedMachine.Name)
|
||||
' se esiste un Prod associato al Proj corrente aggiorno anche questo Prod nel DB
|
||||
If Map.refProjManagerVM.CurrProj.nProdId > 0 Then DbControllers.m_ProdController.UpdateMachine(Map.refProjManagerVM.CurrProj.nProdId,
|
||||
If ProjectManagerVM.CurrProj.nProdId > 0 Then DbControllers.m_ProdController.UpdateMachine(ProjectManagerVM.CurrProj.nProdId,
|
||||
Map.refCALCPanelVM.SelectedMachine.Name)
|
||||
Map.refCALCPanelVM.ResetMachineModified()
|
||||
End If
|
||||
@@ -1253,7 +1249,7 @@ Public Class ProjManagerVM
|
||||
Dim nAsseBaseToEraseId As Integer = 0
|
||||
EgtGetInfo(nAsseBaseId, BTL_PRT_PROJ, nAsseBaseProjId)
|
||||
' se AsseBase di questo step del ciclo è nuovo e suo ProjId uguale a quello del progetto corrente
|
||||
If Not AsseBaseIdList.Contains(nAsseBaseId) AndAlso nAsseBaseProjId = Map.refProjManagerVM.CurrProj.nProjId Then
|
||||
If Not AsseBaseIdList.Contains(nAsseBaseId) AndAlso nAsseBaseProjId = ProjectManagerVM.CurrProj.nProjId Then
|
||||
' riloco i sottonodi del nuovo AsseBase nell'AsseBase del progetto aperto col medesimo ProjId
|
||||
Dim AsseBaseSubNodeId As Integer = EgtGetFirstInGroup(nAsseBaseId)
|
||||
While AsseBaseSubNodeId <> GDB_ID.NULL
|
||||
@@ -1263,7 +1259,7 @@ Public Class ProjManagerVM
|
||||
Dim SameAsseBaseProjId As Integer
|
||||
EgtGetInfo(FindAsseBaseId, BTL_PRT_PROJ, SameAsseBaseProjId)
|
||||
' se l'ho trovato esco dal While (FindAsseBaseId è l'id dell'AsseBase in cui vogliamo rilocare i sottonodi)
|
||||
If SameAsseBaseProjId = Map.refProjManagerVM.CurrProj.nProjId Then Exit While
|
||||
If SameAsseBaseProjId = ProjectManagerVM.CurrProj.nProjId Then Exit While
|
||||
FindAsseBaseId = EgtGetNextName(FindAsseBaseId, ASSEBASE)
|
||||
End While
|
||||
' salvo id dell'AsseBase corrente per ottenere il seguente prima di rilocarlo
|
||||
@@ -1322,7 +1318,7 @@ Public Class ProjManagerVM
|
||||
End If
|
||||
' copio il file originale scelto nel dialog per l'Update nella cartella Proj del progetto corrente
|
||||
If File.Exists(sFile) Then
|
||||
Dim sDestPath As String = Map.refProjManagerVM.CurrProj.sProjDirPath & "\" & Path.GetFileNameWithoutExtension(sFile)
|
||||
Dim sDestPath As String = ProjectManagerVM.CurrProj.sProjDirPath & "\" & Path.GetFileNameWithoutExtension(sFile)
|
||||
While File.Exists(sDestPath & ".btl")
|
||||
sDestPath = sDestPath & "_1"
|
||||
End While
|
||||
@@ -1366,8 +1362,8 @@ Public Class ProjManagerVM
|
||||
If Not ProjFileVM.VerifyProjectModification(CurrProj, ProjectType.PROJ) Then Return Nothing
|
||||
If IsNothing(CurrProj) Then Return Nothing
|
||||
Case Pages.MACHINING
|
||||
If ProdFileVM.VerifyProjectModification(Map.refProdManagerVM.CurrProd) = MessageBoxResult.Cancel Then Return Nothing
|
||||
If IsNothing(Map.refProdManagerVM.CurrProd) Then Return Nothing
|
||||
If ProdFileVM.VerifyProjectModification(ProjectManagerVM.CurrProd) = MessageBoxResult.Cancel Then Return Nothing
|
||||
If IsNothing(ProjectManagerVM.CurrProd) Then Return Nothing
|
||||
Case Else
|
||||
Return Nothing
|
||||
End Select
|
||||
@@ -1413,15 +1409,15 @@ Public Class ProjManagerVM
|
||||
EgtSetInfo(nImpExpPartId, EXP_MACHINE, CurrProj.sMachine)
|
||||
EgtSetInfo(nImpExpPartId, BTL_GEN_PROJTYPE, CurrProj.nType)
|
||||
'' se c'e' un prod collegato
|
||||
'If Map.refProjManagerVM.CurrProj.nProdId > 0 Then
|
||||
'If ProjectManagerVM.CurrProj.nProdId > 0 Then
|
||||
' ' scrivo quali sono i proj e prod in questo file
|
||||
' Dim Prod As ProdFileM = DbControllers.m_ProdController.FindCoreByProdId(Map.refProjManagerVM.CurrProj.nProdId)
|
||||
' EgtSetInfo(Map.refProjectVM.BTLStructureVM.BTLStructureM.nBTLInfoId, EXP_PROD, Map.refProjManagerVM.CurrProj.nProdId)
|
||||
' Dim Prod As ProdFileM = DbControllers.m_ProdController.FindCoreByProdId(ProjectManagerVM.CurrProj.nProdId)
|
||||
' EgtSetInfo(Map.refProjectVM.BTLStructureVM.BTLStructureM.nBTLInfoId, EXP_PROD, ProjectManagerVM.CurrProj.nProdId)
|
||||
' For ProjIndex = 0 To Prod.nProjIdList.Count - 1
|
||||
' EgtSetInfo(Map.refProjectVM.BTLStructureVM.BTLStructureM.nBTLInfoId, EXP_PROJ & ProjIndex + 1, Prod.nProjIdList(ProjIndex))
|
||||
' Next
|
||||
'Else
|
||||
' EgtSetInfo(Map.refProjectVM.BTLStructureVM.BTLStructureM.nBTLInfoId, EXP_PROJ & 1, Map.refProjManagerVM.CurrProj.nProjId)
|
||||
' EgtSetInfo(Map.refProjectVM.BTLStructureVM.BTLStructureM.nBTLInfoId, EXP_PROJ & 1, ProjectManagerVM.CurrProj.nProjId)
|
||||
'End If
|
||||
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.EXPORTPROJECT, 2, EgtMsg(63017), 30, 100) ' Exporting...
|
||||
' salvo info inserite
|
||||
@@ -1474,7 +1470,7 @@ Public Class ProjManagerVM
|
||||
''' Execute the Export. This method is invoked by the ExportCommand.
|
||||
''' </summary>
|
||||
Public Sub ImportProject()
|
||||
Dim CurrProd As ProjectFileVM = Map.refProdManagerVM.CurrProd
|
||||
Dim CurrProd As ProjectFileVM = ProjectManagerVM.CurrProd
|
||||
' lista di tutti gli errori riscontrati
|
||||
Dim ErrorList As New List(Of String)
|
||||
If Not ProjFileVM.VerifyProjectModification(CurrProj, ProjectType.PROJ) Then Return
|
||||
@@ -1647,7 +1643,7 @@ Public Class ProjManagerVM
|
||||
nDuploId = EgtGetNext(nDuploId)
|
||||
End While
|
||||
' resetto CurrProd per evitare di leggere valori produzione dal Db di quel progetto
|
||||
Map.refProdManagerVM.CurrProd = Nothing
|
||||
ProjectManagerVM.CurrProd = Nothing
|
||||
' carico Machgroup che non verrebbero altrimenti importati
|
||||
Map.refProjectVM.MachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList()))
|
||||
If Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.Count > 0 Then
|
||||
@@ -1726,7 +1722,7 @@ Public Class ProjManagerVM
|
||||
OpenProject(CurrProj)
|
||||
End If
|
||||
' ripristino eventuale CurrProd precedente
|
||||
Map.refProdManagerVM.CurrProd = CurrProd
|
||||
ProjectManagerVM.CurrProd = CurrProd
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_LASTNGEXPDIR, Path.GetDirectoryName(ImportDlg.FileName))
|
||||
LoadingWndHelper.CloseLoadingWnd(ActiveIds.IMPORTPROJECT)
|
||||
' imposto progetto corrente
|
||||
@@ -1743,7 +1739,7 @@ Public Class ProjManagerVM
|
||||
' aggiorno le colonne in base al tipo progetto
|
||||
'Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
'Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
'DbControllers.m_ProjController.LockByProjId(Map.refProjManagerVM.CurrProj.nProjId, True)
|
||||
'DbControllers.m_ProjController.LockByProjId(ProjectManagerVM.CurrProj.nProjId, True)
|
||||
' carico lista macchine e macchina del progetto per il pulsante Reset Macchina del CALCPanel
|
||||
'Map.refCALCPanelVM.LoadMachineList()
|
||||
'SectionXMaterial.SetType(nType)
|
||||
@@ -1788,7 +1784,7 @@ Public Class ProjManagerVM
|
||||
Case MessageBoxResult.Cancel
|
||||
Return
|
||||
Case Else ' No
|
||||
If Map.refProjManagerVM.CurrProj.bIsNew Then
|
||||
If ProjectManagerVM.CurrProj.bIsNew Then
|
||||
MessageBox.Show(EgtMsg(61878), "", MessageBoxButton.OK, MessageBoxImage.Exclamation)
|
||||
Return
|
||||
End If
|
||||
@@ -1800,10 +1796,10 @@ Public Class ProjManagerVM
|
||||
|
||||
LoadingWndHelper.OpenLoadingWnd(ActiveIds.GOTOPROD, 3, EgtMsg(63004), EgtMsg(63011), 10) ' Optimization opening ' Loading environment
|
||||
|
||||
Dim nProdId As Integer = Map.refProjManagerVM.CurrProj.nProdId
|
||||
Dim nProdId As Integer = ProjectManagerVM.CurrProj.nProdId
|
||||
If nProdId > 0 Then
|
||||
Map.refProdManagerVM.SetCurrProd(nProdId)
|
||||
Map.refProdManagerVM.CurrProd.SetReloadProject(Not bSaved)
|
||||
ProjectManagerVM.CurrProd.SetReloadProject(Not bSaved)
|
||||
Else
|
||||
'creo nuova ottimizzazione da progetto corrente
|
||||
NewProdFromProj()
|
||||
@@ -1839,7 +1835,7 @@ Public Class ProjManagerVM
|
||||
' ''' nProdPartId = EgtGetNextPart(nProdPartId)
|
||||
' '''End While
|
||||
' ' inserisco proj nel prod selezionato
|
||||
' bOk = bOk AndAlso EgtInsertFile(Map.refProjManagerVM.CurrProj.sProjPath)
|
||||
' bOk = bOk AndAlso EgtInsertFile(ProjectManagerVM.CurrProj.sProjPath)
|
||||
' ' DA METTERE IN MERGE BTL, NON QUI!!!
|
||||
' '''' deseleziono tutto
|
||||
' '''EgtDeselectAll()
|
||||
@@ -1849,7 +1845,7 @@ Public Class ProjManagerVM
|
||||
' ''' ' se arrivano dal nuovo progetto
|
||||
' ''' Dim nCurrProjId As Integer
|
||||
' ''' EgtGetInfo(nPartId, PROJ, nCurrProjId)
|
||||
' ''' If nCurrProjId = Map.refProjManagerVM.CurrProj.nProjId Then
|
||||
' ''' If nCurrProjId = ProjectManagerVM.CurrProj.nProjId Then
|
||||
' ''' ' sposto i pezzi per non averli sovrapposti
|
||||
' ''' EgtMove(nCurrProjId, New Vector3d(0, b3Parts.DimY() + 500, 0))
|
||||
' ''' End If
|
||||
@@ -1861,7 +1857,7 @@ Public Class ProjManagerVM
|
||||
' End If
|
||||
' If bOk Then
|
||||
' ' riporto aggiunta proj a prod su Db
|
||||
' DbControllers.m_ProdController.AddProj(OpenProjectFileDialogVM.SelProject.nProdId, Map.refProjManagerVM.CurrProj.nProjId)
|
||||
' DbControllers.m_ProdController.AddProj(OpenProjectFileDialogVM.SelProject.nProdId, ProjectManagerVM.CurrProj.nProjId)
|
||||
' ' imposto currprod
|
||||
' Map.refProdManagerVM.SetCurrProd(OpenProjectFileDialogVM.SelProject.nProdId)
|
||||
' End If
|
||||
|
||||
@@ -13,15 +13,15 @@ Public Class ProdFileVM
|
||||
MyBase.New(ProdFileM)
|
||||
' aggiungo nome btl
|
||||
Dim sBTLFileName As String = ""
|
||||
For Each CurrProj In nProjIdList
|
||||
Dim TempProj As ProjFileM = DbControllers.m_ProjController.FindByProjIdConv(CurrProj)
|
||||
For Each TempCurrProj In nProjIdList
|
||||
Dim TempProj As ProjFileM = DbControllers.m_ProjController.FindByProjIdConv(TempCurrProj)
|
||||
If Not IsNothing(TempProj) Then sBTLFileName &= TempProj.sListName
|
||||
Next
|
||||
SetBTLFileName(sBTLFileName)
|
||||
' verifico valore description
|
||||
If Not IsNothing(ProdFileM) AndAlso String.IsNullOrWhiteSpace(ProdFileM.sName) Then
|
||||
For Each CurrProj In nProjIdList
|
||||
Dim TempProj As ProjFileM = DbControllers.m_ProjController.FindByProjIdConv(CurrProj)
|
||||
For Each TempCurrProj In nProjIdList
|
||||
Dim TempProj As ProjFileM = DbControllers.m_ProjController.FindByProjIdConv(TempCurrProj)
|
||||
If Not IsNothing(TempProj) AndAlso Not String.IsNullOrWhiteSpace(TempProj.sBTLFileName) Then
|
||||
DbControllers.m_ProdController.UpdateDescription(ProdFileM.nProdId, TempProj.sBTLFileName)
|
||||
ProdFileM.sName = TempProj.sBTLFileName
|
||||
@@ -167,7 +167,7 @@ Public Class ProdFileVM
|
||||
Map.refOnlyProdManagerVM.NotifyPropertyChanged(NameOf(Map.refProdManagerVM.MruFileNames))
|
||||
End If
|
||||
DbControllers.m_ProdController.DeleteProd(CurrProject.nProdId, False)
|
||||
If Not IsNothing(Map.refProjManagerVM) AndAlso CurrProject.nProdId = Map.refProjManagerVM.CurrProj.nProdId Then
|
||||
If Not IsNothing(Map.refProjManagerVM) AndAlso CurrProject.nProdId = ProjectManagerVM.CurrProj.nProdId Then
|
||||
' reset prod in path proj
|
||||
Map.refProjManagerVM.UpdateCurrProj()
|
||||
ElseIf Not IsNothing(Map.refOnlyProdManagerVM) AndAlso CurrProject.nProdId = Map.refOnlyProdManagerVM.CurrProj.nProdId Then
|
||||
@@ -175,7 +175,7 @@ Public Class ProdFileVM
|
||||
Map.refOnlyProdManagerVM.UpdateCurrProj()
|
||||
End If
|
||||
If Not IsNothing(Map.refProdManagerVM) Then
|
||||
Map.refProdManagerVM.CurrProd = Nothing
|
||||
ProjectManagerVM.CurrProd = Nothing
|
||||
'ElseIf Not IsNothing(Map.refOnlyProdManagerVM) Then
|
||||
' Map.refOnlyProdManagerVM.CurrProd = Nothing
|
||||
End If
|
||||
|
||||
@@ -156,7 +156,7 @@ Public Class ProjFileVM
|
||||
' CheckMe impostata come cancellazione FISICA dal DB...
|
||||
DbControllers.m_ProjController.DeleteProj(CurrProject.nProjId, False)
|
||||
If Not IsNothing(Map.refProjManagerVM) Then
|
||||
Map.refProjManagerVM.CurrProj = Nothing
|
||||
ProjectManagerVM.CurrProj = Nothing
|
||||
ElseIf Not IsNothing(Map.refOnlyProdManagerVM) Then
|
||||
Map.refOnlyProdManagerVM.CurrProj = Nothing
|
||||
End If
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Module ProjectManagerVM
|
||||
|
||||
Private m_CurrProj As ProjFileVM
|
||||
Friend Property CurrProj As ProjFileVM
|
||||
Get
|
||||
Return m_CurrProj
|
||||
End Get
|
||||
Set(value As ProjFileVM)
|
||||
m_CurrProj = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_CurrProd As ProdFileVM
|
||||
Friend Property CurrProd As ProdFileVM
|
||||
Get
|
||||
Return m_CurrProd
|
||||
End Get
|
||||
Set(value As ProdFileVM)
|
||||
m_CurrProd = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Function SetCurrProj(nProjId As Integer) As Boolean
|
||||
Dim CurrProjM As ProjFileM = DbControllers.m_ProjController.FindByProjIdConv(nProjId)
|
||||
If IsNothing(CurrProjM) Then Return False
|
||||
m_CurrProj = New ProjFileVM(CurrProjM)
|
||||
If Map.refMainWindowVM.MainWindowM.bOnlyProd AndAlso CurrProjM.nProdId > 0 AndAlso IsNothing(CurrProd) Then
|
||||
SetCurrProd(m_CurrProj.nProdId)
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function SetCurrProd(nProdId As Integer) As Boolean
|
||||
Dim CurrProdM As ProdFileM = DbControllers.m_ProdController.FindCoreByProdId(nProdId)
|
||||
If IsNothing(CurrProdM) Then Return False
|
||||
m_CurrProd = New ProdFileVM(CurrProdM)
|
||||
If Map.refMainWindowVM.MainWindowM.bOnlyProd AndAlso CurrProdM.nProjIdList.Count > 0 AndAlso IsNothing(CurrProj) Then
|
||||
SetCurrProj(m_CurrProd.nProjIdList(0))
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
|
||||
End Module
|
||||
@@ -35,9 +35,9 @@ Public Class ProjectTypeWndVM
|
||||
End Property
|
||||
|
||||
' Se la Macchina selezionata è di tipo BOTH verrà mostrata anche la selezione del Tipo
|
||||
'Private m_IsBoth_Visibility As Visibility = If (Not IsNothing(Map.refProjManagerVM.CurrProj) AndAlso
|
||||
'Private m_IsBoth_Visibility As Visibility = If (Not IsNothing(ProjectManagerVM.CurrProj) AndAlso
|
||||
' DirectCast(SelMachine, MyMachine).nType = MachineType.BOTH, Visibility.Visible, Visibility.Collapsed)
|
||||
Private m_IsBoth_Visibility As Visibility = If(Not IsNothing(Map.refProjManagerVM) AndAlso Not IsNothing(Map.refProjManagerVM.CurrProj) AndAlso
|
||||
Private m_IsBoth_Visibility As Visibility = If(Not IsNothing(Map.refProjManagerVM) AndAlso Not IsNothing(ProjectManagerVM.CurrProj) AndAlso
|
||||
DirectCast(SelMachine, MyMachine).nType = MachineType.BOTH OrElse Not IsNothing(Map.refOnlyProdManagerVM) AndAlso Not IsNothing(Map.refOnlyProdManagerVM.CurrProd), Visibility.Visible, Visibility.Collapsed)
|
||||
Public Property IsBoth_Visibility As Visibility
|
||||
Get
|
||||
@@ -59,8 +59,8 @@ Public Class ProjectTypeWndVM
|
||||
End Property
|
||||
|
||||
' Se la Macchina selezionata è di tipo BOTH verrà selezionato di default il Tipo del progetto corrente
|
||||
Private m_nSelType As BWType = If(Not IsNothing(Map.refProjManagerVM) AndAlso Not IsNothing(Map.refProjManagerVM.CurrProj) AndAlso Not IsNothing(Map.refOnlyProdManagerVM) AndAlso Not IsNothing(Map.refOnlyProdManagerVM.CurrProj) AndAlso
|
||||
DirectCast(SelMachine, MyMachine).nType = MachineType.BOTH, Map.refProjManagerVM.CurrProj.nType, Nothing)
|
||||
Private m_nSelType As BWType = If(Not IsNothing(Map.refProjManagerVM) AndAlso Not IsNothing(ProjectManagerVM.CurrProj) AndAlso Not IsNothing(Map.refOnlyProdManagerVM) AndAlso Not IsNothing(Map.refOnlyProdManagerVM.CurrProj) AndAlso
|
||||
DirectCast(SelMachine, MyMachine).nType = MachineType.BOTH, ProjectManagerVM.CurrProj.nType, Nothing)
|
||||
Public Property nSelType As BWType
|
||||
Get
|
||||
Return m_nSelType
|
||||
|
||||
@@ -265,21 +265,21 @@ Public Class MySceneHostVM
|
||||
Private Sub OnMouseSetObjFilterForSelect(sender As Object, bZeroDim As Boolean, bCurve As Boolean,
|
||||
bSurf As Boolean, bVolume As Boolean, bExtra As Boolean)
|
||||
' Se in modalità edit L250
|
||||
If (Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
If (Map.refMainMenuVM.SelPage = Pages.VIEW OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART)) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
MainController.MouseSetObjFilterForSelect(bZeroDim, bCurve, bSurf, bVolume, bExtra)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseSelectedAll(ByVal sender As Object, bOnlyVisble As Boolean)
|
||||
' Se in modalità edit L250
|
||||
If (Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
If (Map.refMainMenuVM.SelPage = Pages.VIEW OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART)) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
MainController.MouseSelectedAll(bOnlyVisble)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseDeselectedAll(ByVal sender As Object)
|
||||
' Se in modalità edit L250
|
||||
If (Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
If (Map.refMainMenuVM.SelPage = Pages.VIEW OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART)) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
MainController.MouseDeselectedAll()
|
||||
End If
|
||||
End Sub
|
||||
@@ -287,89 +287,86 @@ Public Class MySceneHostVM
|
||||
Private Sub OnMouseDownScene(sender As Object, e As Forms.MouseEventArgs)
|
||||
If e.Button = Forms.MouseButtons.Middle Then Return
|
||||
If Map.refInstrumentPanelVM.GetDistIsChecked Then Return
|
||||
Select Case Map.refMainMenuVM.SelPage
|
||||
Case Pages.VIEW
|
||||
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
|
||||
If Map.refFreeContourManagerVM.bIsActive AndAlso
|
||||
(Map.refFreeContourManagerVM.SelType = FreeContourManagerVM.FreeContourTypes.ONEWITHANGLES Or
|
||||
Map.refFreeContourManagerVM.bIsOpeningCurveCompo) Then
|
||||
' passo entità selezionata
|
||||
Map.refFreeContourManagerVM.OnMouseSelectedObj(EgtGetFirstSelectedObj(), True)
|
||||
ElseIf Map.refShowBeamPanelVM.bShowAll Then
|
||||
View_Part_OnMouseDownScene(sender, e)
|
||||
Else
|
||||
View_Feature_OnMouseDownScene(sender, e)
|
||||
End If
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW OrElse (Pages.ONLYPRODPAGE And (Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART OrElse Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PARTLIST)) Then
|
||||
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
|
||||
If Map.refFreeContourManagerVM.bIsActive AndAlso
|
||||
(Map.refFreeContourManagerVM.SelType = FreeContourManagerVM.FreeContourTypes.ONEWITHANGLES Or
|
||||
Map.refFreeContourManagerVM.bIsOpeningCurveCompo) Then
|
||||
' passo entità selezionata
|
||||
Map.refFreeContourManagerVM.OnMouseSelectedObj(EgtGetFirstSelectedObj(), True)
|
||||
ElseIf Map.refShowBeamPanelVM.bShowAll Then
|
||||
View_Part_OnMouseDownScene(sender, e)
|
||||
Else
|
||||
View_Feature_OnMouseDownScene(sender, e)
|
||||
End If
|
||||
Case Pages.MACHINING OrElse Pages.ONLYPRODPAGE
|
||||
If Not IsNothing(Map.refMachGroupPanelVM) AndAlso Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
|
||||
Dim SelectedMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
|
||||
If EgtGetCurrMachGroup() = GDB_ID.NULL Then Return
|
||||
If SelectedMachGroup.nType = BWType.BEAM Then
|
||||
Beam_OnMouseDownScene(sender, e)
|
||||
ElseIf SelectedMachGroup.nType = BWType.WALL Then
|
||||
Wall_OnMouseDownScene(sender, e)
|
||||
End If
|
||||
End If
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING OrElse (Pages.ONLYPRODPAGE And Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP) Then
|
||||
If Not IsNothing(Map.refMachGroupPanelVM) AndAlso Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
|
||||
Dim SelectedMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
|
||||
If EgtGetCurrMachGroup() = GDB_ID.NULL Then Return
|
||||
If SelectedMachGroup.nType = BWType.BEAM Then
|
||||
Beam_OnMouseDownScene(sender, e)
|
||||
ElseIf SelectedMachGroup.nType = BWType.WALL Then
|
||||
Wall_OnMouseDownScene(sender, e)
|
||||
End If
|
||||
End Select
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseMoveScene(sender As Object, e As Forms.MouseEventArgs)
|
||||
If e.Button = Forms.MouseButtons.Middle Then Return
|
||||
If Map.refInstrumentPanelVM.GetDistIsChecked Then Return
|
||||
Select Case Map.refMainMenuVM.SelPage
|
||||
Case Pages.VIEW
|
||||
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
|
||||
If Map.refFreeContourManagerVM.bIsActive Then Return
|
||||
If Map.refShowBeamPanelVM.bShowAll Then
|
||||
View_Part_OnMouseMoveScene(sender, e)
|
||||
Else
|
||||
View_Feature_OnMouseMoveScene(sender, e)
|
||||
End If
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW OrElse (Pages.ONLYPRODPAGE And (Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART OrElse Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PARTLIST)) Then
|
||||
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
|
||||
If Map.refFreeContourManagerVM.bIsActive Then Return
|
||||
If Map.refShowBeamPanelVM.bShowAll Then
|
||||
View_Part_OnMouseMoveScene(sender, e)
|
||||
Else
|
||||
View_Feature_OnMouseMoveScene(sender, e)
|
||||
End If
|
||||
Case Pages.MACHINING OrElse Pages.ONLYPRODPAGE
|
||||
If Not IsNothing(Map.refMachGroupPanelVM) AndAlso Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
|
||||
Dim SelectedMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
|
||||
If EgtGetCurrMachGroup() = GDB_ID.NULL Then Return
|
||||
If SelectedMachGroup.nType = BWType.BEAM Then
|
||||
Beam_OnMouseMoveScene(sender, e)
|
||||
ElseIf SelectedMachGroup.nType = BWType.WALL Then
|
||||
Wall_OnMouseMoveScene(sender, e)
|
||||
End If
|
||||
End If
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING OrElse (Pages.ONLYPRODPAGE And Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP) Then
|
||||
If Not IsNothing(Map.refMachGroupPanelVM) AndAlso Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
|
||||
Dim SelectedMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
|
||||
If EgtGetCurrMachGroup() = GDB_ID.NULL Then Return
|
||||
If SelectedMachGroup.nType = BWType.BEAM Then
|
||||
Beam_OnMouseMoveScene(sender, e)
|
||||
ElseIf SelectedMachGroup.nType = BWType.WALL Then
|
||||
Wall_OnMouseMoveScene(sender, e)
|
||||
End If
|
||||
End Select
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseUpScene(sender As Object, e As Forms.MouseEventArgs)
|
||||
If e.Button = Forms.MouseButtons.Middle Then Return
|
||||
If Map.refInstrumentPanelVM.GetDistIsChecked Then Return
|
||||
Select Case Map.refMainMenuVM.SelPage
|
||||
Case Pages.VIEW
|
||||
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
|
||||
If Map.refFreeContourManagerVM.bIsActive AndAlso Map.refFreeContourManagerVM.SelType = FreeContourManagerVM.FreeContourTypes.ONEWITHANGLES Then
|
||||
Return
|
||||
ElseIf Map.refShowBeamPanelVM.bShowAll Then
|
||||
View_Part_OnMouseUpScene(sender, e)
|
||||
Else
|
||||
View_Feature_OnMouseUpScene(sender, e)
|
||||
End If
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW OrElse (Pages.ONLYPRODPAGE And (Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART OrElse Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PARTLIST)) Then
|
||||
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
|
||||
If Map.refFreeContourManagerVM.bIsActive AndAlso Map.refFreeContourManagerVM.SelType = FreeContourManagerVM.FreeContourTypes.ONEWITHANGLES Then
|
||||
Return
|
||||
ElseIf Map.refShowBeamPanelVM.bShowAll Then
|
||||
View_Part_OnMouseUpScene(sender, e)
|
||||
Else
|
||||
View_Feature_OnMouseUpScene(sender, e)
|
||||
End If
|
||||
Case Pages.MACHINING OrElse Pages.ONLYPRODPAGE
|
||||
If Not IsNothing(Map.refMachGroupPanelVM) AndAlso Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
|
||||
Dim SelectedMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
|
||||
If EgtGetCurrMachGroup() = GDB_ID.NULL Then Return
|
||||
If SelectedMachGroup.nType = BWType.BEAM Then
|
||||
Beam_OnMouseUpScene(sender, e)
|
||||
ElseIf SelectedMachGroup.nType = BWType.WALL Then
|
||||
Wall_OnMouseUpScene(sender, e)
|
||||
End If
|
||||
End If
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING OrElse (Pages.ONLYPRODPAGE And Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP) Then
|
||||
If Not IsNothing(Map.refMachGroupPanelVM) AndAlso Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
|
||||
Dim SelectedMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
|
||||
If EgtGetCurrMachGroup() = GDB_ID.NULL Then Return
|
||||
If SelectedMachGroup.nType = BWType.BEAM Then
|
||||
Beam_OnMouseUpScene(sender, e)
|
||||
ElseIf SelectedMachGroup.nType = BWType.WALL Then
|
||||
Wall_OnMouseUpScene(sender, e)
|
||||
End If
|
||||
End Select
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseSelectingObj(ByVal sender As Object, ByVal nId As Integer, ByRef bOk As Boolean)
|
||||
' Se in modalità edit L250
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
If (Map.refMainMenuVM.SelPage = Pages.VIEW OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART)) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
bOk = Map.refFreeContourManagerVM.OnMouseSelectingObj(nId)
|
||||
End If
|
||||
End Sub
|
||||
@@ -380,42 +377,42 @@ Public Class MySceneHostVM
|
||||
|
||||
Private Sub OnMouseSelectedPart(ByVal sender As Object, ByVal nId As Integer)
|
||||
' Se in modalità edit L250
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
If (Map.refMainMenuVM.SelPage = Pages.VIEW OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART)) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
MainController.MouseSelectedPart(nId)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseSelectedLayer(ByVal sender As Object, ByVal nId As Integer)
|
||||
' Se in modalità edit L250
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
If (Map.refMainMenuVM.SelPage = Pages.VIEW OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART)) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
MainController.MouseSelectedLayer(nId)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseSelectedPath(ByVal sender As Object, ByVal nId As Integer, ByVal bHaltOnFork As Boolean)
|
||||
' Se in modalità edit L250
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
If (Map.refMainMenuVM.SelPage = Pages.VIEW OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART)) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
MainController.MouseSelectedPath(nId, bHaltOnFork)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMousePointFromSelection(ByVal sender As Object, ByVal nId As Integer, ByVal PtP As Point3d, ByVal nAux As Integer)
|
||||
' Se in modalità edit L250
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
If (Map.refMainMenuVM.SelPage = Pages.VIEW OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART)) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
MainController.SetPointFromSelection(nId, PtP, nAux)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseDone(ByVal sender As Object)
|
||||
' Se in modalità edit L250
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
If (Map.refMainMenuVM.SelPage = Pages.VIEW OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART)) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
MainController.Done(Map.refFreeContourInputVM.Text)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseSelectedPoint(ByVal sender As Object, ByVal PtP As Point3d, ByVal nSep As SEP, ByVal nId As Integer)
|
||||
' Se in modalità edit L250
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
If (Map.refMainMenuVM.SelPage = Pages.VIEW OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART)) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
Dim bDone As Boolean = (Keyboard.Modifiers And ModifierKeys.Control) <> ModifierKeys.Control
|
||||
MainController.MouseSelectedPoint(PtP, nSep, nId, bDone)
|
||||
End If
|
||||
@@ -423,14 +420,14 @@ Public Class MySceneHostVM
|
||||
|
||||
Private Sub OnMouseSelectedDir(ByVal sender As Object, ByVal VtDir As Vector3d)
|
||||
' Se in modalità edit L250
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
If (Map.refMainMenuVM.SelPage = Pages.VIEW OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART)) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
MainController.SetLastVector3d(VtDir)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseMoveSelPoint(ByVal sender As Object, ByVal PtP As Point3d)
|
||||
' Se in modalità edit L250
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
If (Map.refMainMenuVM.SelPage = Pages.VIEW OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART)) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
MainController.MouseMoveInSelectionPoint(PtP)
|
||||
End If
|
||||
End Sub
|
||||
@@ -441,7 +438,7 @@ Public Class MySceneHostVM
|
||||
|
||||
Private Sub OnKeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs)
|
||||
' Se in modalità edit L250
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
If (Map.refMainMenuVM.SelPage = Pages.VIEW OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART)) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
' Con DEL eseguo cancellazione delle entità selezionate
|
||||
If e.KeyData = System.Windows.Forms.Keys.Delete Then
|
||||
MainController.SetLastInteger(GDB_ID.SEL)
|
||||
@@ -552,8 +549,8 @@ Public Class MySceneHostVM
|
||||
Map.refFeatureInPartInRawPartListVM.UpdateColumns(CurrentMachine.nType)
|
||||
Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE <> BWType.BEAM)
|
||||
Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
Map.refProjManagerVM.CurrProj = Map.refProjManagerVM.TempCurrProj
|
||||
DbControllers.m_ProjController.LockByProjId(Map.refProjManagerVM.CurrProj.nProjId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
|
||||
ProjectManagerVM.CurrProj = Map.refProjManagerVM.TempCurrProj
|
||||
DbControllers.m_ProjController.LockByProjId(ProjectManagerVM.CurrProj.nProjId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
|
||||
' carico lista macchine e macchina del progetto per il pulsante Reset Macchina del CALCPanel
|
||||
Map.refCALCPanelVM.LoadMachineList()
|
||||
ElseIf ProjectType = ProjectType.PROD Then
|
||||
@@ -566,11 +563,11 @@ Public Class MySceneHostVM
|
||||
' imposto macchina del progetto
|
||||
'Map.refMachinePanelVM.SelectedMachine = If(Not IsNothing(Map.refProdManagerVM.TempCurrProd),
|
||||
'Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refProdManagerVM.TempCurrProd.sMachine),
|
||||
'Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refProjManagerVM.CurrProj.sMachine))
|
||||
'Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = ProjectManagerVM.CurrProj.sMachine))
|
||||
If Map.refMainMenuVM.SelPage = Pages.MACHINING Then
|
||||
Map.refMachinePanelVM.SelectedMachine = If(Not IsNothing(Map.refProdManagerVM.TempCurrProd),
|
||||
Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refProdManagerVM.TempCurrProd.sMachine),
|
||||
Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refProjManagerVM.CurrProj.sMachine))
|
||||
Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = ProjectManagerVM.CurrProj.sMachine))
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
|
||||
Map.refMachinePanelVM.SelectedMachine = If(Not IsNothing(Map.refOnlyProdManagerVM.TempCurrProd),
|
||||
Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refOnlyProdManagerVM.TempCurrProd.sMachine),
|
||||
@@ -589,12 +586,12 @@ Public Class MySceneHostVM
|
||||
Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
If Not IsNothing(Map.refProdManagerVM) AndAlso Not IsNothing(Map.refProdManagerVM.TempCurrProd) Then
|
||||
CurrProd = Map.refProdManagerVM.TempCurrProd
|
||||
Map.refProdManagerVM.CurrProd = CurrProd
|
||||
ProjectManagerVM.CurrProd = CurrProd
|
||||
ElseIf Not IsNothing(Map.refOnlyProdManagerVM) AndAlso Not IsNothing(Map.refOnlyProdManagerVM.TempCurrProd) Then
|
||||
CurrProd = Map.refOnlyProdManagerVM.TempCurrProd
|
||||
Map.refOnlyProdManagerVM.CurrProd = CurrProd
|
||||
End If
|
||||
'DbControllers.m_ProdController.LockByProdId(Map.refProdManagerVM.CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
|
||||
'DbControllers.m_ProdController.LockByProdId(ProjectManagerVM.CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
|
||||
DbControllers.m_ProdController.LockByProdId(CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
|
||||
' carico lista macchine e macchina del progetto per il pulsante Reset Macchina del CALCPanel
|
||||
Map.refCALCPanelVM.LoadMachineList()
|
||||
@@ -608,7 +605,7 @@ Public Class MySceneHostVM
|
||||
Dim CommIndex As Integer = -1
|
||||
Dim ActiveSessionList As List(Of StatusMapModel) = DbControllers.m_StatusMapController.GetProd(m_SupervisorId)
|
||||
For Each ActiveSession In ActiveSessionList
|
||||
'If Not IsNothing(Map.refProdManagerVM.CurrProd) AndAlso ActiveSession.ItemId = Map.refProdManagerVM.CurrProd.nProdId Then
|
||||
'If Not IsNothing(ProjectManagerVM.CurrProd) AndAlso ActiveSession.ItemId = ProjectManagerVM.CurrProd.nProdId Then
|
||||
If Not IsNothing(CurrProd) AndAlso ActiveSession.ItemId = CurrProd.nProdId Then
|
||||
CommIndex = ActiveSession.Index
|
||||
End If
|
||||
@@ -619,11 +616,11 @@ Public Class MySceneHostVM
|
||||
Map.refProjectVM.MachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList()))
|
||||
' fisso indice sessione di comunicazione
|
||||
'If CommIndex > -1 Then
|
||||
' Map.refProdManagerVM.CurrProd.SetModificationIndex(CommIndex)
|
||||
' ProjectManagerVM.CurrProd.SetModificationIndex(CommIndex)
|
||||
'End If
|
||||
If CommIndex > -1 Then
|
||||
If Not IsNothing(Map.refProdManagerVM) AndAlso Not IsNothing(Map.refProdManagerVM.CurrProd) Then
|
||||
Map.refProdManagerVM.CurrProd.SetModificationIndex(CommIndex)
|
||||
If Not IsNothing(Map.refProdManagerVM) AndAlso Not IsNothing(ProjectManagerVM.CurrProd) Then
|
||||
ProjectManagerVM.CurrProd.SetModificationIndex(CommIndex)
|
||||
ElseIf Not IsNothing(Map.refOnlyProdManagerVM) AndAlso Not IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then
|
||||
Map.refOnlyProdManagerVM.CurrProd.SetModificationIndex(CommIndex)
|
||||
End If
|
||||
@@ -747,16 +744,16 @@ Public Class MySceneHostVM
|
||||
End While
|
||||
' scrivo info proj e type su layer BtlInfo
|
||||
Dim nBTLInfoLayer As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
||||
If Not IsNothing(Map.refProjManagerVM) AndAlso Not IsNothing(Map.refProjManagerVM.CurrProj) Then
|
||||
If Not IsNothing(Map.refProjManagerVM) AndAlso Not IsNothing(ProjectManagerVM.CurrProj) Then
|
||||
EgtSetInfo(nBTLInfoLayer, BTL_PRT_PROJ, Map.refProjManagerVM.nLoadingProjId)
|
||||
EgtSetInfo(nBTLInfoLayer, BTL_GEN_PROJTYPE, Map.refProjManagerVM.CurrProj.nType)
|
||||
EgtSetInfo(nBTLInfoLayer, BTL_GEN_PROJTYPE, ProjectManagerVM.CurrProj.nType)
|
||||
ElseIf Not IsNothing(Map.refOnlyProdManagerVM) AndAlso Not IsNothing(Map.refOnlyProdManagerVM.CurrProj) Then
|
||||
EgtSetInfo(nBTLInfoLayer, BTL_PRT_PROJ, Map.refOnlyProdManagerVM.nLoadingProjId)
|
||||
EgtSetInfo(nBTLInfoLayer, BTL_GEN_PROJTYPE, Map.refOnlyProdManagerVM.CurrProd.nType)
|
||||
End If
|
||||
' scrivo info proj su layer AsseBase
|
||||
Dim nAsseBaseLayer As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, ASSEBASE)
|
||||
If Not IsNothing(Map.refProjManagerVM) AndAlso Not IsNothing(Map.refProjManagerVM.CurrProj) Then
|
||||
If Not IsNothing(Map.refProjManagerVM) AndAlso Not IsNothing(ProjectManagerVM.CurrProj) Then
|
||||
EgtSetInfo(nAsseBaseLayer, BTL_PRT_PROJ, Map.refProjManagerVM.nLoadingProjId)
|
||||
ElseIf Not IsNothing(Map.refOnlyProdManagerVM) AndAlso Not IsNothing(Map.refOnlyProdManagerVM.CurrProj) Then
|
||||
EgtSetInfo(nAsseBaseLayer, BTL_PRT_PROJ, Map.refOnlyProdManagerVM.nLoadingProjId)
|
||||
@@ -1153,6 +1150,8 @@ Public Class MySceneHostVM
|
||||
ElseIf m_nIdToSel <> GDB_ID.NULL Then
|
||||
Dim CurrPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.nPartId = m_nIdToSel)
|
||||
If e.Button = Forms.MouseButtons.Left Then
|
||||
' imposto tipo ultima Grid selezionata
|
||||
Map.refProjectVM.SetLastSelGridType(ProjectVM.GridSelTypes.PARTLIST)
|
||||
' imposto highlight
|
||||
Map.refProjectVM.BTLStructureVM.SetSelectionType(BTLStructureVM.SelectionTypes.HIGHLIGHT)
|
||||
' gestisco evidenziazione pezzo
|
||||
@@ -1183,6 +1182,8 @@ Public Class MySceneHostVM
|
||||
End If
|
||||
End If
|
||||
ElseIf e.Button = Forms.MouseButtons.Right Then
|
||||
' imposto tipo ultima Grid selezionata
|
||||
Map.refProjectVM.SetLastSelGridType(ProjectVM.GridSelTypes.PART)
|
||||
' imposto selezione
|
||||
Map.refProjectVM.BTLStructureVM.SetSelectionType(BTLStructureVM.SelectionTypes.SELECT_)
|
||||
' seleziono il pezzo
|
||||
|
||||
@@ -39,13 +39,13 @@ Module PDFHelper
|
||||
Public Function CreateStatReport(ActivePage As Pages) As Document
|
||||
' creo nuovo documento MigraDoc
|
||||
Dim document As Document = New Document()
|
||||
Dim Project As ProjectFileVM = Map.refProdManagerVM.CurrProd
|
||||
Dim Project As ProjectFileVM = ProjectManagerVM.CurrProd
|
||||
Select Case ActivePage
|
||||
Case Pages.VIEW
|
||||
Project = Map.refProjManagerVM.CurrProj
|
||||
Project = ProjectManagerVM.CurrProj
|
||||
document.Info.Title = Project.sProjId & " - " & Project.BTLFileName_Msg & " - Statistics"
|
||||
Case Pages.MACHINING
|
||||
Project = Map.refProdManagerVM.CurrProd
|
||||
Project = ProjectManagerVM.CurrProd
|
||||
document.Info.Title = Project.sProdId & " - " & Project.ListName_Msg & " - Statistics"
|
||||
End Select
|
||||
document.Info.Subject = "Production statistics of the project"
|
||||
|
||||
@@ -295,7 +295,7 @@ Public Class StatisticsVM
|
||||
|
||||
Friend Sub LoadRawPart()
|
||||
m_RawPartList.Clear()
|
||||
Select Case Map.refProdManagerVM.CurrProd.nType
|
||||
Select Case ProjectManagerVM.CurrProd.nType
|
||||
Case BWType.BEAM
|
||||
For Each MachGroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
|
||||
Dim RawPart As SParam = m_RawPartList.FirstOrDefault(Function(x) x.SectXMat.dW = MachGroup.dW AndAlso x.SectXMat.dH = MachGroup.dH AndAlso x.dL = MachGroup.dL AndAlso x.SectXMat.sMaterial.Any(Function(y) MachGroup.Section.sMaterial.Any(Function(z) z = y)))
|
||||
@@ -346,9 +346,9 @@ Public Class StatisticsVM
|
||||
Dim sFileName As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\Statistics.pdf"
|
||||
Select Case Map.refMainMenuVM.SelPage
|
||||
Case Pages.VIEW
|
||||
sFileName = Map.refProjManagerVM.CurrProj.sProjDirPath & "\" & "Statistics.pdf"
|
||||
sFileName = ProjectManagerVM.CurrProj.sProjDirPath & "\" & "Statistics.pdf"
|
||||
Case Pages.MACHINING
|
||||
sFileName = Map.refProdManagerVM.CurrProd.sProdDirPath & "\" & Map.refProdManagerVM.CurrProd.sProdId & " - " & "Statistics.pdf"
|
||||
sFileName = ProjectManagerVM.CurrProd.sProdDirPath & "\" & ProjectManagerVM.CurrProd.sProdId & " - " & "Statistics.pdf"
|
||||
' ripristino selezione precedente
|
||||
Dim nCurrMachGroupId As Integer = EgtGetCurrMachGroup()
|
||||
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup) AndAlso nCurrMachGroupId <> Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.Id Then
|
||||
|
||||
@@ -48,17 +48,17 @@ Public Class SupervisorComm
|
||||
' se sono in pagina vista
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
||||
' se non c'e' un progetto attivo, esco
|
||||
If IsNothing(Map.refProjManagerVM.CurrProj) Then
|
||||
If IsNothing(ProjectManagerVM.CurrProj) Then
|
||||
m_bTickInExecution = False
|
||||
Return
|
||||
End If
|
||||
' verifico se c'e' un progetto aperto o in caricamento
|
||||
'If IsNothing(Map.refProjManagerVM.CurrProj) OrElse Map.refProjManagerVM.bLoadingProj Then Return
|
||||
'If IsNothing(ProjectManagerVM.CurrProj) OrElse Map.refProjManagerVM.bLoadingProj Then Return
|
||||
' verifico se c'e' una sessione aperta sul progetto corrente
|
||||
Dim nModificationIndex As Integer = -1
|
||||
ActiveSessionList = DbControllers.m_StatusMapController.GetProd(m_SupervisorId)
|
||||
For Each ActiveSession In ActiveSessionList
|
||||
If ActiveSession.ItemId = Map.refProjManagerVM.CurrProj.nProdId Then
|
||||
If ActiveSession.ItemId = ProjectManagerVM.CurrProj.nProdId Then
|
||||
nModificationIndex = ActiveSession.Index
|
||||
End If
|
||||
Next
|
||||
@@ -67,9 +67,9 @@ Public Class SupervisorComm
|
||||
Return
|
||||
End If
|
||||
' verifico se ci sono modifiche
|
||||
If nModificationIndex <> Map.refProjManagerVM.CurrProj.nModificationIndex Then
|
||||
If nModificationIndex <> ProjectManagerVM.CurrProj.nModificationIndex Then
|
||||
' recupero elementi modificati
|
||||
Dim MachGroupList As List(Of StatusMapModel) = DbControllers.m_StatusMapController.GetFrom(m_SupervisorId, Map.refProjManagerVM.CurrProj.nModificationIndex + 1)
|
||||
Dim MachGroupList As List(Of StatusMapModel) = DbControllers.m_StatusMapController.GetFrom(m_SupervisorId, ProjectManagerVM.CurrProj.nModificationIndex + 1)
|
||||
Dim bReloadFile As Boolean = False
|
||||
If Not IsNothing(MachGroupList) Then
|
||||
For Each MachGroupModification In MachGroupList
|
||||
@@ -98,22 +98,22 @@ Public Class SupervisorComm
|
||||
Next
|
||||
End If
|
||||
' aggiorno indice del proj
|
||||
Map.refProjManagerVM.CurrProj.SetModificationIndex(nModificationIndex)
|
||||
ProjectManagerVM.CurrProj.SetModificationIndex(nModificationIndex)
|
||||
End If
|
||||
' se sono in pagina ottimizzatore
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
|
||||
' se non c'e' un progetto attivo, esco
|
||||
If IsNothing(Map.refProdManagerVM.CurrProd) Then
|
||||
If IsNothing(ProjectManagerVM.CurrProd) Then
|
||||
m_bTickInExecution = False
|
||||
Return
|
||||
End If
|
||||
' verifico se c'e' un progetto aperto o in caricamento
|
||||
'If IsNothing(Map.refProdManagerVM.CurrProd) OrElse Map.refProdManagerVM.bLoadingProd Then Return
|
||||
'If IsNothing(ProjectManagerVM.CurrProd) OrElse Map.refProdManagerVM.bLoadingProd Then Return
|
||||
' verifico se c'e' una sessione aperta sul progetto corrente
|
||||
Dim nModificationIndex As Integer = -1
|
||||
ActiveSessionList = DbControllers.m_StatusMapController.GetProd(m_SupervisorId)
|
||||
For Each ActiveSession In ActiveSessionList
|
||||
If Not IsNothing(Map.refProdManagerVM.CurrProd) AndAlso ActiveSession.ItemId = Map.refProdManagerVM.CurrProd.nProdId Then
|
||||
If Not IsNothing(ProjectManagerVM.CurrProd) AndAlso ActiveSession.ItemId = ProjectManagerVM.CurrProd.nProdId Then
|
||||
nModificationIndex = ActiveSession.Index
|
||||
End If
|
||||
Next
|
||||
@@ -122,9 +122,9 @@ Public Class SupervisorComm
|
||||
Return
|
||||
End If
|
||||
' verifico se ci sono modifiche
|
||||
If nModificationIndex <> Map.refProdManagerVM.CurrProd.nModificationIndex Then
|
||||
If nModificationIndex <> ProjectManagerVM.CurrProd.nModificationIndex Then
|
||||
' recupero elementi modificati
|
||||
Dim MachGroupList As List(Of StatusMapModel) = DbControllers.m_StatusMapController.GetFrom(m_SupervisorId, Map.refProdManagerVM.CurrProd.nModificationIndex + 1)
|
||||
Dim MachGroupList As List(Of StatusMapModel) = DbControllers.m_StatusMapController.GetFrom(m_SupervisorId, ProjectManagerVM.CurrProd.nModificationIndex + 1)
|
||||
If Not IsNothing(MachGroupList) Then
|
||||
Dim bReloadFile As Boolean = False
|
||||
For Each MachGroupModification In MachGroupList
|
||||
@@ -218,11 +218,11 @@ Public Class SupervisorComm
|
||||
Next
|
||||
End If
|
||||
' aggiorno indice del prod
|
||||
Map.refProdManagerVM.CurrProd.SetModificationIndex(nModificationIndex)
|
||||
ProjectManagerVM.CurrProd.SetModificationIndex(nModificationIndex)
|
||||
End If
|
||||
End If
|
||||
' se c'e' un progetto aperto o in caricamento
|
||||
'If IsNothing(Map.refProdManagerVM.CurrProd) OrElse Map.refProdManagerVM.bLoadingProd Then Return
|
||||
'If IsNothing(ProjectManagerVM.CurrProd) OrElse Map.refProdManagerVM.bLoadingProd Then Return
|
||||
'' recupero indice modifica del prod
|
||||
'Dim nModificationIndex As Integer = 0
|
||||
'Dim ActiveSessionList As List(Of StatusMapModel) = DbControllers.m_StatusMapController.GetProd()
|
||||
|
||||
@@ -205,8 +205,8 @@ Public Class TopPanelVM
|
||||
End Sub
|
||||
|
||||
Friend Sub UpdateMovePartInRawPartVisibility()
|
||||
m_MovePartInRawPart_Visibility = If(Map.refMainWindowVM.MainWindowM.nUserLevel > 5 AndAlso Not IsNothing(Map.refProdManagerVM.CurrProd) AndAlso
|
||||
Map.refProdManagerVM.CurrProd.nType = BWType.WALL, Visibility.Visible, Visibility.Collapsed)
|
||||
m_MovePartInRawPart_Visibility = If(Map.refMainWindowVM.MainWindowM.nUserLevel > 5 AndAlso Not IsNothing(ProjectManagerVM.CurrProd) AndAlso
|
||||
ProjectManagerVM.CurrProd.nType = BWType.WALL, Visibility.Visible, Visibility.Collapsed)
|
||||
NotifyPropertyChanged(NameOf(MovePartInRawPart_Visibility))
|
||||
End Sub
|
||||
|
||||
@@ -232,7 +232,7 @@ Public Class TopPanelVM
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub ProduceRawPart()
|
||||
If IsNothing(Map.refProdManagerVM.CurrProd) Then Return
|
||||
If IsNothing(ProjectManagerVM.CurrProd) Then Return
|
||||
Dim ErrorMsg As String = ""
|
||||
' se attiva opzione e non ancora calcolato
|
||||
If GetMainPrivateProfileInt(S_GENERAL, K_FASTPRODUCE, 0) = 1 And Map.refMachGroupPanelVM.SelectedMachGroup.nGlobalState = CalcStates.NOTCALCULATED Then
|
||||
@@ -255,11 +255,11 @@ Public Class TopPanelVM
|
||||
Map.refProdManagerVM.Save()
|
||||
End If
|
||||
' mando al supervisore
|
||||
DbControllers.m_MachGroupController.UpdateOrder(Map.refProdManagerVM.CurrProd.nProdId, MachGroup.Id, DbControllers.m_MachGroupController.GetMinIndex(Map.refProdManagerVM.CurrProd.nProdId) + 1)
|
||||
DbControllers.m_MachGroupController.UpdateSupervisor(Map.refProdManagerVM.CurrProd.nProdId, MachGroup.Id, DbControllers.m_SupervisorId)
|
||||
DbControllers.m_MachGroupController.UpdateOrder(ProjectManagerVM.CurrProd.nProdId, MachGroup.Id, DbControllers.m_MachGroupController.GetMinIndex(ProjectManagerVM.CurrProd.nProdId) + 1)
|
||||
DbControllers.m_MachGroupController.UpdateSupervisor(ProjectManagerVM.CurrProd.nProdId, MachGroup.Id, DbControllers.m_SupervisorId)
|
||||
MachGroup.SentToSupervisor()
|
||||
For Each Part As PartVM In MachGroup.PartVMList
|
||||
DbControllers.m_PartController.UpdateStatus(Map.refProdManagerVM.CurrProd.nProdId, MachGroup.Id, Part.nPartId, ItemState.Assigned)
|
||||
DbControllers.m_PartController.UpdateStatus(ProjectManagerVM.CurrProd.nProdId, MachGroup.Id, Part.nPartId, ItemState.Assigned)
|
||||
Part.nProduction_State = ItemState.Assigned
|
||||
Part.NotifyPropertyChanged(NameOf(Part.Background))
|
||||
' disabilito impostazione modificato
|
||||
@@ -297,7 +297,7 @@ Public Class TopPanelVM
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub ProduceAllRawPart()
|
||||
If IsNothing(Map.refProdManagerVM.CurrProd) Then Return
|
||||
If IsNothing(ProjectManagerVM.CurrProd) Then Return
|
||||
' se attiva opzione e non ancora calcolato
|
||||
If GetMainPrivateProfileInt(S_GENERAL, K_FASTPRODUCE, 0) = 1 And Map.refMachGroupPanelVM.MachGroupVMList.Any(Function(x As MyMachGroupVM) x.nProduction_State = ItemState.ND AndAlso x.nGlobalState = CalcStates.NOTCALCULATED) Then
|
||||
Map.refCALCPanelVM.SetFromProduce(CALCPanelVM.ProduceType.PRODUCEALL)
|
||||
@@ -343,7 +343,7 @@ Public Class TopPanelVM
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub CopyRawPart()
|
||||
If IsNothing(Map.refProdManagerVM.CurrProd) Then Return
|
||||
If IsNothing(ProjectManagerVM.CurrProd) Then Return
|
||||
Dim nQty As Integer = 1
|
||||
' se premuto shift
|
||||
If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
|
||||
@@ -386,7 +386,7 @@ Public Class TopPanelVM
|
||||
End Sub
|
||||
|
||||
Public Sub RemoveRawPart(Optional bAll As Boolean = False)
|
||||
If IsNothing(Map.refProdManagerVM.CurrProd) Then Return
|
||||
If IsNothing(ProjectManagerVM.CurrProd) Then Return
|
||||
' se tutti
|
||||
If bAll Then
|
||||
' cancello tutti
|
||||
@@ -453,7 +453,7 @@ Public Class TopPanelVM
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub RemovePart()
|
||||
If IsNothing(Map.refProdManagerVM.CurrProd) Then Return
|
||||
If IsNothing(ProjectManagerVM.CurrProd) Then Return
|
||||
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
|
||||
If IsNothing(SelMachGroup) Then Return
|
||||
' se barra gia' assegnata a supervisore, esco
|
||||
@@ -485,7 +485,7 @@ Public Class TopPanelVM
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub MoveUpPart()
|
||||
If IsNothing(Map.refProdManagerVM.CurrProd) Then Return
|
||||
If IsNothing(ProjectManagerVM.CurrProd) Then Return
|
||||
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
|
||||
If IsNothing(SelMachGroup) Then Return
|
||||
' se barra gia' assegnata a supervisore, esco
|
||||
@@ -521,7 +521,7 @@ Public Class TopPanelVM
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub MoveDownPart()
|
||||
If IsNothing(Map.refProdManagerVM.CurrProd) Then Return
|
||||
If IsNothing(ProjectManagerVM.CurrProd) Then Return
|
||||
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
|
||||
If IsNothing(SelMachGroup) Then Return
|
||||
' se barra gia' assegnata a supervisore, esco
|
||||
@@ -557,7 +557,7 @@ Public Class TopPanelVM
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub ReOrderPart()
|
||||
If IsNothing(Map.refProdManagerVM.CurrProd) Then Return
|
||||
If IsNothing(ProjectManagerVM.CurrProd) Then Return
|
||||
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
|
||||
If IsNothing(SelMachGroup) Then Return
|
||||
' se barra gia' assegnata a supervisore, esco
|
||||
@@ -595,7 +595,7 @@ Public Class TopPanelVM
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub MovePartInRawPart()
|
||||
If IsNothing(Map.refProdManagerVM.CurrProd) Then Return
|
||||
If IsNothing(ProjectManagerVM.CurrProd) Then Return
|
||||
Dim MovePartInRawPartWndVM As New MovePartInRawPartWndVM()
|
||||
Dim MovePartInRawPartWnd As New MovePartInRawPartWndV(Application.Current.MainWindow, MovePartInRawPartWndVM)
|
||||
If Not MovePartInRawPartWnd.ShowDialog() Then Return
|
||||
|
||||
@@ -118,8 +118,8 @@ Module LuaExec
|
||||
EgtLuaSetGlobNumVar("NEST.CORNER", nNestCorner)
|
||||
EgtLuaSetGlobStringVar("NEST.MATERIAL", PartList(0).sMATERIAL)
|
||||
EgtLuaSetGlobNumVar("NEST.TIME", nNestTime)
|
||||
If Not IsNothing(Map.refProdManagerVM) AndAlso Not IsNothing(Map.refProdManagerVM.CurrProd) Then
|
||||
EgtLuaSetGlobNumVar("NEST.PRODID", Map.refProdManagerVM.CurrProd.nProdId)
|
||||
If Not IsNothing(Map.refProdManagerVM) AndAlso Not IsNothing(ProjectManagerVM.CurrProd) Then
|
||||
EgtLuaSetGlobNumVar("NEST.PRODID", ProjectManagerVM.CurrProd.nProdId)
|
||||
ElseIf Not IsNothing(Map.refOnlyProdManagerVM) AndAlso Not IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then
|
||||
EgtLuaSetGlobNumVar("NEST.PRODID", Map.refOnlyProdManagerVM.CurrProd.nProdId)
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user