Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 221b8ae3a3 | |||
| bb2ec39f03 | |||
| 6837628ac1 | |||
| ba9905634a | |||
| deb0de22d5 |
@@ -18,6 +18,8 @@ Public Module LoadingWndHelper
|
||||
CHANGEMATERIAL = 12
|
||||
BACKUP = 13
|
||||
RESTORE = 14
|
||||
UPDATENETWAREHOUSE = 15
|
||||
UPLOADNESTING = 16
|
||||
End Enum
|
||||
|
||||
Dim m_MainWindow As Windows.Window
|
||||
|
||||
@@ -115,7 +115,7 @@ Public Class SectionXMaterial
|
||||
|
||||
Sub New(dW As Double, dH As Double, dL As Double, sMaterial As String, sWarehouseMaterial As String)
|
||||
If m_nType = BWType.BEAM Then
|
||||
m_MaterialM = New MaterialM(dW, dH, 0, sMaterial, sWarehouseMaterial)
|
||||
m_MaterialM = New MaterialM(Math.Min(dW, dH), Math.Max(dW, dH), 0, sMaterial, sWarehouseMaterial)
|
||||
ElseIf m_nType = BWType.WALL Then
|
||||
m_MaterialM = New MaterialM(0, dH, 0, sMaterial, sWarehouseMaterial)
|
||||
Else
|
||||
|
||||
@@ -13,6 +13,9 @@ Public Class MyMachGroupPanelVM
|
||||
' lista dei RawPart presenti su db
|
||||
Private m_RawPartDbList As New List(Of RawPartM)
|
||||
|
||||
' tolleranza di ricerca delle barre in magazzino
|
||||
Private m_DimensionRange As Double = 0.1
|
||||
|
||||
Public Shadows Property SelectedMachGroup As MachGroupVM
|
||||
Get
|
||||
Return m_SelectedMachGroup
|
||||
@@ -51,7 +54,7 @@ Public Class MyMachGroupPanelVM
|
||||
MachGroup.UpdateUsage()
|
||||
End If
|
||||
Next
|
||||
ReadAllRawPartFromDb()
|
||||
ReadAllRawPartFromDb(Map.refSupervisorManagerVM.nPROJTYPE)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
@@ -133,18 +136,18 @@ Public Class MyMachGroupPanelVM
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub ReadAllRawPartFromDb()
|
||||
Friend Sub ReadAllRawPartFromDb(nPROJTYPE As BWType)
|
||||
m_RawPartDbList.Clear()
|
||||
' aggiornamento materiale
|
||||
For Each MachGroup As MyMachGroupVM In Map.refMachGroupPanelVM.m_MachGroupVMList
|
||||
If IsNothing(MachGroup.MyMachGroupM.RawPartM) OrElse MachGroup.MyMachGroupM.RawPartM.nId = 0 OrElse MachGroup.MyMachGroupM.RawPartM.Material.nId = 0 OrElse String.IsNullOrWhiteSpace(MachGroup.MyMachGroupM.RawPartM.Material.sWarehouseMaterial) Then
|
||||
ReadRawPartFromDb(MachGroup, True)
|
||||
ReadRawPartFromDb(MachGroup, nPROJTYPE, True)
|
||||
End If
|
||||
Next
|
||||
m_RawPartDbList.Clear()
|
||||
End Sub
|
||||
|
||||
Friend Sub ReadRawPartFromDb(MachGroup As MyMachGroupVM, Optional bUseList As Boolean = False)
|
||||
Friend Sub ReadRawPartFromDb(MachGroup As MyMachGroupVM, nPROJTYPE As BWType, Optional bUseList As Boolean = False)
|
||||
If Not IsNothing(MachGroup.MyMachGroupM.RawPartM) AndAlso MachGroup.MyMachGroupM.RawPartM.nId > 0 AndAlso MachGroup.MyMachGroupM.RawPartM.Material.nId > 0 AndAlso Not String.IsNullOrWhiteSpace(MachGroup.MyMachGroupM.RawPartM.Material.sWarehouseMaterial) Then Return
|
||||
' aggiornamento materiale
|
||||
Dim RawPart As RawPartM = Nothing
|
||||
@@ -161,27 +164,36 @@ Public Class MyMachGroupPanelVM
|
||||
Next
|
||||
Else
|
||||
Dim Material As MaterialM = Nothing
|
||||
' verifico che il materiale non sia nullo
|
||||
If (String.IsNullOrWhiteSpace(MachGroup.RawPartM.Material.sMaterial) OrElse String.IsNullOrWhiteSpace(MachGroup.RawPartM.Material.sWarehouseMaterial)) AndAlso MachGroup.PartVMList.Count > 0 Then
|
||||
MachGroup.MyMachGroupM.sMATERIAL = MachGroup.PartVMList(0).sMATERIAL
|
||||
MachGroup.MyMachGroupM.sWAREHOUSEMATERIAL = MachGroup.PartVMList(0).sWAREHOUSEMATERIAL
|
||||
MachGroup.RawPartM.Material.SetMaterial(MachGroup.PartVMList(0).sMATERIAL)
|
||||
MachGroup.RawPartM.Material.SetWarehouseMaterial(MachGroup.PartVMList(0).sWAREHOUSEMATERIAL)
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.sMATERIAL))
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.sWAREHOUSEMATERIAL))
|
||||
End If
|
||||
Dim SearchMaterial As DataLayer.Controllers.MaterialsController.SearchResult = DbControllers.m_MaterialsController.SearchFilt(MachGroup.RawPartM.Material.sMaterial)
|
||||
Select Case SearchMaterial.Tipo
|
||||
Case DataLayer.Controllers.MaterialsController.SearchResult.TypeFound.ALIAS, DataLayer.Controllers.MaterialsController.SearchResult.TypeFound.MATERIAL
|
||||
If Map.refSupervisorManagerVM.CurrProd.nType = BWType.BEAM Then
|
||||
Material = SearchMaterial.Result.FirstOrDefault(Function(x) x.dW = MachGroup.dW AndAlso x.dH = MachGroup.dH)
|
||||
ElseIf Map.refSupervisorManagerVM.CurrProd.nType = BWType.WALL Then
|
||||
Material = SearchMaterial.Result.FirstOrDefault(Function(x) x.dH = MachGroup.dH)
|
||||
If nPROJTYPE = BWType.BEAM Then
|
||||
Material = SearchMaterial.Result.FirstOrDefault(Function(x) Math.Abs(x.dW - Math.Min(MachGroup.dW, MachGroup.dH)) < m_DimensionRange AndAlso Math.Abs(x.dH - Math.Max(MachGroup.dW, MachGroup.dH)) < m_DimensionRange)
|
||||
ElseIf nPROJTYPE = BWType.WALL Then
|
||||
Material = SearchMaterial.Result.FirstOrDefault(Function(x) Math.Abs(x.dH - MachGroup.dH) < m_DimensionRange)
|
||||
End If
|
||||
Case Else
|
||||
EgtOutLog("Error! MachGroup material not found!!")
|
||||
If Map.refSupervisorManagerVM.CurrProd.nType = BWType.BEAM Then
|
||||
Material = New MaterialM(MachGroup.dW, MachGroup.dH, 0, 0, MachGroup.sMATERIAL)
|
||||
ElseIf Map.refSupervisorManagerVM.CurrProd.nType = BWType.WALL Then
|
||||
Material = New MaterialM(0, MachGroup.dH, 0, 0, MachGroup.sMATERIAL)
|
||||
If nPROJTYPE = BWType.BEAM Then
|
||||
Material = New MaterialM(Math.Min(MachGroup.dW, MachGroup.dH), Math.Max(MachGroup.dW, MachGroup.dH), 0, 0, MachGroup.sWAREHOUSEMATERIAL)
|
||||
ElseIf nPROJTYPE = BWType.WALL Then
|
||||
Material = New MaterialM(0, MachGroup.dH, 0, 0, MachGroup.sWAREHOUSEMATERIAL)
|
||||
End If
|
||||
End Select
|
||||
Dim SearchRawPart As List(Of RawPartM) = DbControllers.m_RawItemsController.GetFilt(Material.nId)
|
||||
If Map.refSupervisorManagerVM.CurrProd.nType = BWType.BEAM Then
|
||||
RawPart = SearchRawPart.FirstOrDefault(Function(x) x.Material.dW = MachGroup.dW AndAlso x.Material.dH = MachGroup.dH AndAlso x.dL = MachGroup.dL)
|
||||
ElseIf Map.refSupervisorManagerVM.CurrProd.nType = BWType.WALL Then
|
||||
RawPart = SearchRawPart.FirstOrDefault(Function(x) x.dW = MachGroup.dW AndAlso x.Material.dH = MachGroup.dH AndAlso x.Material.dL = MachGroup.dL)
|
||||
If nPROJTYPE = BWType.BEAM Then
|
||||
RawPart = SearchRawPart.FirstOrDefault(Function(x) Math.Abs(x.Material.dW - Math.Min(MachGroup.dW, MachGroup.dH)) < m_DimensionRange AndAlso Math.Abs(x.Material.dH - Math.Max(MachGroup.dW, MachGroup.dH)) < m_DimensionRange AndAlso Math.Abs(x.dL - MachGroup.dL) < m_DimensionRange)
|
||||
ElseIf nPROJTYPE = BWType.WALL Then
|
||||
RawPart = SearchRawPart.FirstOrDefault(Function(x) Math.Abs(x.dW - MachGroup.dW) < m_DimensionRange AndAlso Math.Abs(x.Material.dH - MachGroup.dH) < m_DimensionRange AndAlso Math.Abs(x.dL - MachGroup.dL) < m_DimensionRange)
|
||||
End If
|
||||
If Not IsNothing(RawPart) Then
|
||||
MachGroup.MyMachGroupM.RawPartM.Material.SetId(RawPart.Material.nId)
|
||||
@@ -192,13 +204,18 @@ Public Class MyMachGroupPanelVM
|
||||
Part.MaterialM.SetWarehouseMaterial(RawPart.Material.sWarehouseMaterial)
|
||||
Next
|
||||
Else
|
||||
Dim nRawPartId As Integer = DbControllers.m_RawItemsController.Upsert(New RawPartM(Material, MachGroup.dW, MachGroup.dL, 0, False))
|
||||
Dim nRawPartId As Integer = 0
|
||||
If nPROJTYPE = BWType.BEAM Then
|
||||
nRawPartId = DbControllers.m_RawItemsController.Upsert(New RawPartM(Material, 0, MachGroup.dL, 0, False))
|
||||
ElseIf nPROJTYPE = BWType.WALL Then
|
||||
nRawPartId = DbControllers.m_RawItemsController.Upsert(New RawPartM(Material, MachGroup.dW, MachGroup.dL, 0, False))
|
||||
End If
|
||||
If nRawPartId > 0 Then
|
||||
SearchRawPart = DbControllers.m_RawItemsController.GetFilt(Material.nId)
|
||||
If Map.refSupervisorManagerVM.CurrProd.nType = BWType.BEAM Then
|
||||
RawPart = SearchRawPart.FirstOrDefault(Function(x) x.Material.dW = MachGroup.dW AndAlso x.Material.dH = MachGroup.dH AndAlso x.dL = MachGroup.dL)
|
||||
ElseIf Map.refSupervisorManagerVM.CurrProd.nType = BWType.WALL Then
|
||||
RawPart = SearchRawPart.FirstOrDefault(Function(x) x.dW = MachGroup.dW AndAlso x.Material.dH = MachGroup.dH AndAlso x.dL = MachGroup.dL)
|
||||
If nPROJTYPE = BWType.BEAM Then
|
||||
RawPart = SearchRawPart.FirstOrDefault(Function(x) Math.Abs(x.Material.dW - Math.Min(MachGroup.dW, MachGroup.dH)) < m_DimensionRange AndAlso Math.Abs(x.Material.dH - Math.Max(MachGroup.dW, MachGroup.dH)) < m_DimensionRange AndAlso Math.Abs(x.dL - MachGroup.dL) < m_DimensionRange)
|
||||
ElseIf nPROJTYPE = BWType.WALL Then
|
||||
RawPart = SearchRawPart.FirstOrDefault(Function(x) Math.Abs(x.dW - MachGroup.dW) < m_DimensionRange AndAlso Math.Abs(x.Material.dH - MachGroup.dH) < m_DimensionRange AndAlso Math.Abs(x.dL - MachGroup.dL) < m_DimensionRange)
|
||||
End If
|
||||
If IsNothing(RawPart) Then
|
||||
EgtOutLog("Error! MachGroup material not found!!")
|
||||
|
||||
@@ -86,7 +86,7 @@ Public Class MyMachGroupVM
|
||||
Sub New(MyMachGroupM As MyMachGroupM)
|
||||
MyBase.New(MyMachGroupM)
|
||||
' aggiungo RawPartM
|
||||
If Map.refSupervisorManagerVM.CurrProd.nType = BWType.BEAM Then
|
||||
If Map.refSupervisorManagerVM.nPROJTYPE = BWType.BEAM Then
|
||||
MyMachGroupM.RawPartM = New RawPartM(New MaterialM(Math.Min(MyMachGroupM.dW, MyMachGroupM.dH), Math.Max(MyMachGroupM.dW, MyMachGroupM.dH), 0, MyMachGroupM.sMATERIAL), 0, MyMachGroupM.dL)
|
||||
Else
|
||||
MyMachGroupM.RawPartM = New RawPartM(New MaterialM(0, MyMachGroupM.dH, 0, MyMachGroupM.sMATERIAL), MyMachGroupM.dW, MyMachGroupM.dL)
|
||||
|
||||
@@ -50,7 +50,7 @@ Public Class PartVM
|
||||
Sub New(PartM As PartM, ParentMachGroupVM As MyMachGroupVM)
|
||||
MyBase.New(PartM, ParentMachGroupVM)
|
||||
' aggiungo MaterialM
|
||||
If Map.refSupervisorManagerVM.CurrProd.nType = BWType.BEAM Then
|
||||
If Map.refSupervisorManagerVM.nPROJTYPE = BWType.BEAM Then
|
||||
PartM.MaterialM = New MaterialM(Math.Min(dW, dH), Math.Max(dW, dH), 0, PartM.sMATERIAL)
|
||||
Else
|
||||
PartM.MaterialM = New MaterialM(0, dH, 0, PartM.sMATERIAL)
|
||||
|
||||
@@ -687,16 +687,31 @@ Public Class MachManaging
|
||||
End If
|
||||
' aggiorno utilizzo barra da magazzino
|
||||
If GetMainPrivateProfileInt(S_WAREHOUSE, K_NETWAREHOUSE, 0) = 1 AndAlso MachGroup.PartVMList(0).nPartId = nP_Part AndAlso MachGroup.nProduction_State <> ItemState.Scrapped Then
|
||||
Dim nMaterialId As Integer
|
||||
If Map.refSupervisorManagerVM.CurrProd.nType = BWType.BEAM Then
|
||||
nMaterialId = DbControllers.m_MaterialsController.Insert(New MaterialM(MachGroup.dW, MachGroup.dH, 0, MachGroup.sMATERIAL, MachGroup.sWAREHOUSEMATERIAL))
|
||||
ElseIf Map.refSupervisorManagerVM.CurrProd.nType = BWType.WALL Then
|
||||
nMaterialId = DbControllers.m_MaterialsController.Insert(New MaterialM(0, MachGroup.dH, 0, MachGroup.sMATERIAL, MachGroup.sWAREHOUSEMATERIAL))
|
||||
Dim nRawPartId As Integer = MachGroup.RawPartM.nId
|
||||
If nRawPartId <= 0 Then
|
||||
Dim nMaterialId As Integer = MachGroup.RawPartM.Material.nId
|
||||
If nMaterialId <= 0 Then
|
||||
If Map.refSupervisorManagerVM.CurrProd.nType = BWType.BEAM Then
|
||||
nMaterialId = DbControllers.m_MaterialsController.Insert(New MaterialM(Math.Min(MachGroup.dW, MachGroup.dH), Math.Max(MachGroup.dW, MachGroup.dH), 0, MachGroup.sMATERIAL, MachGroup.sWAREHOUSEMATERIAL))
|
||||
ElseIf Map.refSupervisorManagerVM.CurrProd.nType = BWType.WALL Then
|
||||
nMaterialId = DbControllers.m_MaterialsController.Insert(New MaterialM(0, MachGroup.dH, 0, MachGroup.sMATERIAL, MachGroup.sWAREHOUSEMATERIAL))
|
||||
End If
|
||||
End If
|
||||
Dim RawPartList = DbControllers.m_RawItemsController.GetFilt(nMaterialId)
|
||||
Dim RawPart As RawPartM = Nothing
|
||||
If Not IsNothing(RawPartList) Then
|
||||
If Map.refSupervisorManagerVM.CurrProd.nType = BWType.BEAM Then
|
||||
RawPart = RawPartList.FirstOrDefault(Function(x) x.dL = MachGroup.dL AndAlso x.Material.dW = Math.Min(MachGroup.dW, MachGroup.dH) AndAlso x.Material.dH = Math.Max(MachGroup.dW, MachGroup.dH) AndAlso x.Material.sWarehouseMaterial = MachGroup.sWAREHOUSEMATERIAL)
|
||||
ElseIf Map.refSupervisorManagerVM.CurrProd.nType = BWType.WALL Then
|
||||
RawPart = RawPartList.FirstOrDefault(Function(x) x.dL = MachGroup.dL AndAlso x.dW = MachGroup.dW AndAlso x.Material.dH = MachGroup.dH AndAlso x.Material.sWarehouseMaterial = MachGroup.sWAREHOUSEMATERIAL)
|
||||
End If
|
||||
End If
|
||||
If Not IsNothing(RawPart) Then
|
||||
nRawPartId = RawPart.nId
|
||||
End If
|
||||
End If
|
||||
Dim RawPartList = DbControllers.m_RawItemsController.GetFilt(nMaterialId)
|
||||
Dim RawPart As RawPartM = RawPartList.FirstOrDefault(Function(x) x.dL = MachGroup.dL AndAlso x.Material.dW = MachGroup.dW AndAlso x.Material.dH = MachGroup.dH AndAlso x.Material.sWarehouseMaterial = MachGroup.sWAREHOUSEMATERIAL)
|
||||
Dim RawDictionary As New Dictionary(Of Integer, Integer)
|
||||
RawDictionary.Add(RawPart.nId, 1)
|
||||
RawDictionary.Add(nRawPartId, 1)
|
||||
' forzo aggiornamento eventuali dati non inviati su Db
|
||||
DbControllers.m_MagmanController.ForceSyncroSend()
|
||||
DbControllers.m_MagmanController.ResourceSendCons(Map.refSupervisorManagerVM.CurrProd.ProdFileM.nProjCloudId, RawDictionary)
|
||||
|
||||
@@ -244,15 +244,9 @@ Public Class MySceneHostVM
|
||||
Map.refProjectVM.ProdMachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList()))
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_LASTPROJ, sFile)
|
||||
Map.refSupervisorManagerVM.m_MruFiles.Add(sFile)
|
||||
' aggiorno le colonne in base al tipo progetto
|
||||
If Not IsNothing(Map.refSupervisorManagerVM) Then
|
||||
Dim DbSupervisorProd As ProdModel = DbControllers.m_ProdController.FindByProdId(Map.refSupervisorManagerVM.nLoadingProdId)
|
||||
If Not IsNothing(DbSupervisorProd) Then
|
||||
Map.refRawPartListVM.UpdateColumns(DbSupervisorProd.PType)
|
||||
Map.refPartInRawPartListVM.UpdateColumns(DbSupervisorProd.PType)
|
||||
End If
|
||||
End If
|
||||
|
||||
' aggiorno le colonne in base al tipo macchina
|
||||
Map.refRawPartListVM.UpdateColumns(CurrentMachine.nType)
|
||||
Map.refPartInRawPartListVM.UpdateColumns(CurrentMachine.nType)
|
||||
Else
|
||||
Map.refSupervisorManagerVM.m_MruFiles.Remove(sFile)
|
||||
EgtNewFile()
|
||||
|
||||
@@ -71,6 +71,16 @@ Public Class SupervisorManagerVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public m_nPROJTYPE As Integer
|
||||
Public Property nPROJTYPE As Integer
|
||||
Get
|
||||
Return m_nPROJTYPE
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nPROJTYPE = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdOpen As ICommand
|
||||
Private m_cmdOpenMruFile As ICommand
|
||||
@@ -95,7 +105,9 @@ Public Class SupervisorManagerVM
|
||||
|
||||
|
||||
#End Region ' ToolTip
|
||||
|
||||
#End Region ' Fields & Properties
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
@@ -205,6 +217,7 @@ Public Class SupervisorManagerVM
|
||||
End If
|
||||
Core.ViewPanelVM.UpdateBWType(TempCurrProd.nType)
|
||||
' imposto ProdId di caricamento
|
||||
m_nPROJTYPE = TempCurrProd.nType
|
||||
m_nLoadingProdId = TempCurrProd.nProdId
|
||||
m_bLoadingProd = True
|
||||
If File.Exists(sFilePath) Then
|
||||
@@ -243,6 +256,7 @@ Public Class SupervisorManagerVM
|
||||
Map.refSceneHostVM.MainController.NewProject()
|
||||
Map.refMainWindowVM.SetTitle("New - EgtBEAMWALL")
|
||||
m_bLoadingProd = False
|
||||
m_CurrProd = Nothing
|
||||
NotifyPropertyChanged(NameOf(MruFileNames))
|
||||
LoadingWndHelper.CloseLoadingWnd(ActiveIds.OPENPROD)
|
||||
Return
|
||||
@@ -252,6 +266,7 @@ Public Class SupervisorManagerVM
|
||||
Map.refSceneHostVM.MainController.NewProject()
|
||||
Map.refMainWindowVM.SetTitle("New - EgtBEAMWALL")
|
||||
m_bLoadingProd = False
|
||||
m_CurrProd = Nothing
|
||||
NotifyPropertyChanged(NameOf(MruFileNames))
|
||||
LoadingWndHelper.CloseLoadingWnd(ActiveIds.OPENPROD)
|
||||
Return
|
||||
|
||||
@@ -186,7 +186,7 @@ Public Class LogEvent
|
||||
End Sub
|
||||
|
||||
Public Shared Function CreateMachLog(EventType As MachLogTypes, EventDateTime As DateTime, Value As String, SupervisorID As String)
|
||||
Return MachLog.CreateMachLog(EventType, EventDateTime, Value, Map.refSupervisorManagerVM.CurrProd.nProdId, SupervisorID)
|
||||
Return MachLog.CreateMachLog(EventType, EventDateTime, Value, If(Not IsNothing(Map.refSupervisorManagerVM.CurrProd), Map.refSupervisorManagerVM.CurrProd.nProdId, 0), SupervisorID)
|
||||
End Function
|
||||
|
||||
Public Shared Function CreatePartStateLog(dtEvent As DateTime, Prod As Integer, MachGroup As Integer, Part As Integer, State As Integer, SupervisorID As String)
|
||||
|
||||
@@ -196,7 +196,8 @@ Public Class AddPartWndVM
|
||||
'verifico che tutti i campi contengano un valore valido
|
||||
If Not IsNothing(m_dL) AndAlso m_dL > 0 AndAlso
|
||||
Not IsNothing(m_dW) AndAlso m_dW >= 0 AndAlso
|
||||
Not IsNothing(m_dH) AndAlso m_dH >= 0 Then
|
||||
Not IsNothing(m_dH) AndAlso m_dH >= 0 AndAlso
|
||||
(Not String.IsNullOrWhiteSpace(m_sSelWarehouseMaterial) OrElse Not String.IsNullOrWhiteSpace(m_sNewMaterialName)) Then
|
||||
RaiseEvent m_CloseWindow(True)
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(61853), EgtMsg(30007))
|
||||
|
||||
@@ -444,12 +444,19 @@ Public Class BTLPartVM
|
||||
End Get
|
||||
Set(value As String)
|
||||
If value <> m_BTLPartM.MaterialM.sMaterial Then
|
||||
' se vuoto annullo modifica
|
||||
If String.IsNullOrWhiteSpace(value) Then
|
||||
NotifyPropertyChanged(NameOf(sMATERIAL))
|
||||
NotifyPropertyChanged(NameOf(sWAREHOUSEMATERIAL))
|
||||
Return
|
||||
End If
|
||||
' verifico se nuovo materiale
|
||||
Dim MaterialNameManagerVM As New MaterialNameManagerVM()
|
||||
If MaterialNameManagerVM.VerifyNewMaterialNames(New List(Of String)({value})) Then
|
||||
Dim MaterialNameManager As New MaterialNameManagerV(Application.Current.MainWindow, MaterialNameManagerVM)
|
||||
If MaterialNameManager.ShowDialog() = False Then
|
||||
NotifyPropertyChanged(NameOf(sMATERIAL))
|
||||
NotifyPropertyChanged(NameOf(sWAREHOUSEMATERIAL))
|
||||
Return
|
||||
End If
|
||||
End If
|
||||
@@ -468,16 +475,10 @@ Public Class BTLPartVM
|
||||
Else
|
||||
m_BTLPartM.MaterialM = New MaterialM(0, dH, 0, m_BTLPartM.sMATERIAL)
|
||||
End If
|
||||
Map.refProjectVM.BTLStructureVM.ReadMaterialFromDb(Me, False)
|
||||
Map.refProjectVM.BTLStructureVM.ReadMaterialFromDb(Me, Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE, False)
|
||||
' se sezione nuova non presente
|
||||
If Not Map.refProjectVM.BTLStructureVM.SectionList.Contains(Section) Then
|
||||
' creo nuova sezione
|
||||
Dim nMaterialId As Integer = DbControllers.m_MaterialsController.Insert(Section.MaterialM)
|
||||
Dim NewSection = Section
|
||||
Map.refProjectVM.BTLStructureVM.SectionList.Add(NewSection)
|
||||
If nMaterialId <> 0 Then
|
||||
NewSection.MaterialM.SetId(nMaterialId)
|
||||
End If
|
||||
Map.refProjectVM.BTLStructureVM.SectionList.Add(Section)
|
||||
End If
|
||||
' se sezione vecchia non utilizzata da altri pezzi
|
||||
If Not bOtherSection Then
|
||||
@@ -486,6 +487,7 @@ Public Class BTLPartVM
|
||||
End If
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(sMATERIAL))
|
||||
NotifyPropertyChanged(NameOf(sWAREHOUSEMATERIAL))
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -1001,8 +1001,8 @@ Public Class BTLStructureVM
|
||||
For Each BTLPartVM As BTLPartVM In m_BTLPartVMList
|
||||
' verifico sezione, gruppo e sottogruppo per inserirli nei filtri
|
||||
If Not SectionList.Contains(BTLPartVM.Section) Then
|
||||
Dim NewSection As SectionXMaterial = New SectionXMaterial(BTLPartVM.MaterialM)
|
||||
Map.refProjectVM.BTLStructureVM.SectionList.Add(NewSection)
|
||||
'Dim NewSection As SectionXMaterial = New SectionXMaterial(BTLPartVM.MaterialM)
|
||||
Map.refProjectVM.BTLStructureVM.SectionList.Add(BTLPartVM.Section)
|
||||
End If
|
||||
If Not GroupList.Contains(BTLPartVM.sGROUP) Then
|
||||
GroupList.Add(BTLPartVM.sGROUP)
|
||||
@@ -1319,27 +1319,27 @@ Public Class BTLStructureVM
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Friend Sub ReadAllMaterialFromDb()
|
||||
Friend Sub ReadAllMaterialFromDb(nPROJTYPE As BWType)
|
||||
m_MaterialDbList.Clear()
|
||||
' aggiornamento materiale
|
||||
For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList
|
||||
If IsNothing(Part.BTLPartM.MaterialM) OrElse Part.BTLPartM.MaterialM.nId = 0 OrElse String.IsNullOrWhiteSpace(Part.BTLPartM.MaterialM.sWarehouseMaterial) Then
|
||||
ReadMaterialFromDb(Part, True)
|
||||
ReadMaterialFromDb(Part, nPROJTYPE, True)
|
||||
End If
|
||||
Next
|
||||
m_MaterialDbList.Clear()
|
||||
End Sub
|
||||
|
||||
Friend Sub ReadMaterialFromDb(Part As BTLPartVM, Optional bUseList As Boolean = False)
|
||||
Friend Sub ReadMaterialFromDb(Part As BTLPartVM, nPROJTYPE As BWType, Optional bUseList As Boolean = False)
|
||||
If Not IsNothing(Part.BTLPartM.MaterialM) AndAlso Part.BTLPartM.MaterialM.nId > 0 AndAlso Not String.IsNullOrWhiteSpace(Part.BTLPartM.MaterialM.sWarehouseMaterial) Then Return
|
||||
' aggiornamento materiale
|
||||
Dim Material As MaterialM = Nothing
|
||||
If bUseList Then
|
||||
Dim SearchMaterialRes As SearchMaterialRes = m_MaterialDbList.FirstOrDefault(Function(x) x.sMaterialName = Part.MaterialM.sMaterial)
|
||||
If Not IsNothing(SearchMaterialRes) Then
|
||||
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
|
||||
Material = SearchMaterialRes.SearchRes.Result.FirstOrDefault(Function(x) x.dW = Part.dW AndAlso x.dH = Part.dH)
|
||||
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL Then
|
||||
If nPROJTYPE = BWType.BEAM Then
|
||||
Material = SearchMaterialRes.SearchRes.Result.FirstOrDefault(Function(x) x.dW = Math.Min(Part.dW, Part.dH) AndAlso x.dH = Math.Max(Part.dW, Part.dH))
|
||||
ElseIf nPROJTYPE = BWType.WALL Then
|
||||
Material = SearchMaterialRes.SearchRes.Result.FirstOrDefault(Function(x) x.dH = Part.dH)
|
||||
End If
|
||||
End If
|
||||
@@ -1351,9 +1351,9 @@ Public Class BTLStructureVM
|
||||
Dim SearchRes As DataLayer.Controllers.MaterialsController.SearchResult = DbControllers.m_MaterialsController.SearchFilt(Part.MaterialM.sMaterial)
|
||||
Select Case SearchRes.Tipo
|
||||
Case DataLayer.Controllers.MaterialsController.SearchResult.TypeFound.ALIAS, DataLayer.Controllers.MaterialsController.SearchResult.TypeFound.MATERIAL
|
||||
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
|
||||
Material = SearchRes.Result.FirstOrDefault(Function(x) x.dW = Part.dW AndAlso x.dH = Part.dH)
|
||||
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL Then
|
||||
If nPROJTYPE = BWType.BEAM Then
|
||||
Material = SearchRes.Result.FirstOrDefault(Function(x) x.dW = Math.Min(Part.dW, Part.dH) AndAlso x.dH = Math.Max(Part.dW, Part.dH))
|
||||
ElseIf nPROJTYPE = BWType.WALL Then
|
||||
Material = SearchRes.Result.FirstOrDefault(Function(x) x.dH = Part.dH)
|
||||
End If
|
||||
If IsNothing(Material) Then
|
||||
@@ -1377,9 +1377,9 @@ Public Class BTLStructureVM
|
||||
If IsNothing(Part.MaterialM.sWarehouseMaterial) Then
|
||||
Part.MaterialM.SetWarehouseMaterial(Part.MaterialM.sMaterial)
|
||||
End If
|
||||
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
|
||||
If nPROJTYPE = BWType.BEAM Then
|
||||
DbControllers.m_MaterialsController.Insert(New MaterialM(Math.Min(Part.dW, Part.dH), Math.Max(Part.dW, Part.dH), 0, 0, Part.MaterialM.sWarehouseMaterial))
|
||||
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL Then
|
||||
ElseIf nPROJTYPE = BWType.WALL Then
|
||||
DbControllers.m_MaterialsController.Insert(New MaterialM(0, Part.dH, 0, 0, Part.MaterialM.sWarehouseMaterial))
|
||||
End If
|
||||
SearchRes = DbControllers.m_MaterialsController.SearchFilt(Part.MaterialM.sWarehouseMaterial)
|
||||
@@ -1393,16 +1393,16 @@ Public Class BTLStructureVM
|
||||
End If
|
||||
Select Case SearchRes.Tipo
|
||||
Case DataLayer.Controllers.MaterialsController.SearchResult.TypeFound.MATERIAL, DataLayer.Controllers.MaterialsController.SearchResult.TypeFound.ALIAS
|
||||
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
|
||||
If nPROJTYPE = BWType.BEAM Then
|
||||
Material = SearchRes.Result.FirstOrDefault(Function(x) x.dW = Math.Min(Part.dW, Part.dH) AndAlso x.dH = Math.Max(Part.dW, Part.dH))
|
||||
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL Then
|
||||
ElseIf nPROJTYPE = BWType.WALL Then
|
||||
Material = SearchRes.Result.FirstOrDefault(Function(x) x.dH = Part.dH)
|
||||
End If
|
||||
If IsNothing(Material) Then
|
||||
EgtOutLog("Error! Impossible creating material on Db!")
|
||||
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
|
||||
Material = New MaterialM(Math.Min(Part.dW, Part.dH), Math.Max(Part.dW, Part.dH), 0, 0, Part.MaterialM.sMaterial)
|
||||
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL Then
|
||||
If nPROJTYPE = BWType.BEAM Then
|
||||
Material = New MaterialM(Math.Min(Part.dW, Part.dH), Math.Max(Part.dW, Part.dH), 0, 0, Part.MaterialM.sWarehouseMaterial)
|
||||
ElseIf nPROJTYPE = BWType.WALL Then
|
||||
Material = New MaterialM(0, Part.dH, 0, 0, Part.MaterialM.sMaterial)
|
||||
End If
|
||||
End If
|
||||
@@ -1410,9 +1410,9 @@ Public Class BTLStructureVM
|
||||
Part.MaterialM.SetWarehouseMaterial(Material.sWarehouseMaterial)
|
||||
Case Else
|
||||
EgtOutLog("Error! Impossible creating material on Db!")
|
||||
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
|
||||
If nPROJTYPE = BWType.BEAM Then
|
||||
Material = New MaterialM(Math.Min(Part.dW, Part.dH), Math.Max(Part.dW, Part.dH), 0, 0, Part.MaterialM.sMaterial)
|
||||
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL Then
|
||||
ElseIf nPROJTYPE = BWType.WALL Then
|
||||
Material = New MaterialM(0, Part.dH, 0, 0, Part.MaterialM.sMaterial)
|
||||
End If
|
||||
Part.MaterialM.SetId(Material.nId)
|
||||
|
||||
@@ -1135,7 +1135,7 @@ Public Class CALCPanelVM
|
||||
' rigenero struttura BTL
|
||||
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(ProjId))
|
||||
' aggiornamento materiale da Db
|
||||
Map.refProjectVM.BTLStructureVM.ReadAllMaterialFromDb()
|
||||
Map.refProjectVM.BTLStructureVM.ReadAllMaterialFromDb(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
End Sub
|
||||
|
||||
#End Region ' Ok
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
Module ConstWarehouseIni
|
||||
Public Module ConstWarehouseIni
|
||||
|
||||
Public Enum UploadOptimType As Integer
|
||||
NONE = 0
|
||||
UPLOAD = 1
|
||||
ASK = 2
|
||||
End Enum
|
||||
|
||||
Public Const WH_BASIC_INI_FILE_NAME As String = "Basic.ini"
|
||||
Public Const WH_MEDIUM_INI_FILE_NAME As String = "Medium.ini"
|
||||
|
||||
@@ -427,7 +427,7 @@ Public Class FreeContourManagerVM
|
||||
' posiziono la griglia sul riferimento del contorno libero
|
||||
Dim frFace As New Frame3d
|
||||
EgtBeamGetSideData(SelFeature.nSelSIDE, frFace)
|
||||
Dim frFrame As Frame3d = SelFeature.BTLFeatureM.frFRAME
|
||||
Dim frFrame As New Frame3d(SelFeature.BTLFeatureM.frFRAME)
|
||||
frFrame.ToGlob( frFace)
|
||||
EgtSetGridFrame(frFrame)
|
||||
EgtSetGridShow(True, True)
|
||||
|
||||
@@ -495,7 +495,7 @@ Public Class LeftPanelVM
|
||||
' aggiorno dati utilizzo barra
|
||||
BeamMachGroup.UpdateUsage()
|
||||
' aggiorno RawPartM da Db
|
||||
Map.refMachGroupPanelVM.ReadRawPartFromDb(BeamMachGroup)
|
||||
Map.refMachGroupPanelVM.ReadRawPartFromDb(BeamMachGroup, Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
' imposto il materiale selezionato come ultimo utilizzato
|
||||
SetLastMaterial(BeamMachGroup.RawPartM)
|
||||
Core.ViewPanelVM.BWSetView(VT.ISO_SW, False)
|
||||
@@ -545,7 +545,7 @@ Public Class LeftPanelVM
|
||||
' aggiorno dati ultilizzo barra
|
||||
WallMachGroup.UpdateUsage()
|
||||
' aggiorno RawPartM da Db
|
||||
Map.refMachGroupPanelVM.ReadRawPartFromDb(WallMachGroup)
|
||||
Map.refMachGroupPanelVM.ReadRawPartFromDb(WallMachGroup, Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
' imposto il materiale selezionato come ultimo utilizzato
|
||||
SetLastMaterial(WallMachGroup.RawPartM)
|
||||
Core.ViewPanelVM.BWSetView(VT.TOP, False)
|
||||
@@ -770,7 +770,7 @@ Public Class LeftPanelVM
|
||||
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
|
||||
Dim WallMachGroup As MyMachGroupVM = SelMachGroup
|
||||
' verifico spessore
|
||||
If SelPart.Section <> WallMachGroup.Section Then
|
||||
If SelPart.MaterialM <> WallMachGroup.RawPartM.Material Then
|
||||
MessageBox.Show(EgtMsg(61868), EgtMsg(30007))
|
||||
Return
|
||||
End If
|
||||
@@ -989,7 +989,7 @@ Public Class LeftPanelVM
|
||||
Dim NewPart As BTLPartM = SelPart.Copy()
|
||||
If Not IsNothing(NewPart) Then
|
||||
' aggiorno materiale da Db
|
||||
Map.refProjectVM.BTLStructureVM.ReadAllMaterialFromDb()
|
||||
Map.refProjectVM.BTLStructureVM.ReadAllMaterialFromDb(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
' selezione ultimo che e' quello appena creato
|
||||
Map.refProjectVM.BTLStructureVM.SetSelBTLPart(Map.refProjectVM.BTLStructureVM.BTLPartVMList(Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1), False, True)
|
||||
End If
|
||||
@@ -1028,6 +1028,11 @@ Public Class LeftPanelVM
|
||||
If Not IsNothing(AddPartWndVM.sNAM) Then EgtBeamSetPartName(AddPartWndVM.sNAM)
|
||||
EgtBeamSetPartCount(AddPartWndVM.nCNT)
|
||||
EgtBeamSetPartBox(AddPartWndVM.dL, AddPartWndVM.dH, AddPartWndVM.dW)
|
||||
If AddPartWndVM.bNewName_IsChecked Then
|
||||
EgtSetInfo(nNewPartId, BTL_PRT_MATERIAL, AddPartWndVM.sNewMaterialName)
|
||||
Else
|
||||
EgtSetInfo(nNewPartId, BTL_PRT_MATERIAL, AddPartWndVM.sSelWarehouseMaterial)
|
||||
End If
|
||||
' se progetto pareti e vista ruotata
|
||||
If nType = BWType.WALL AndAlso (CurrentMachine.ViewDir = VT.ISO_NW OrElse CurrentMachine.ViewDir = VT.ISO_NE) Then
|
||||
'' ruoto le pareti di 180 per raddrizzarle rispetto alla vista
|
||||
@@ -1041,41 +1046,34 @@ Public Class LeftPanelVM
|
||||
EgtSetInfo(nNewPartId, BTL_PRT_ROTATED, 180)
|
||||
End If
|
||||
End If
|
||||
' aggiungo dati pezzo
|
||||
' creo pezzo
|
||||
Dim NewPart As BTLPartM = BTLPartM.CreateBTLPart(nNewPartId)
|
||||
' aggiungo pezzo alla lista
|
||||
Map.refProjectVM.BTLStructureVM.BTLStructureM.AddBTLPart(NewPart)
|
||||
Dim NewPartVM As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.BTLPartM Is NewPart)
|
||||
' aggiungo dati materiale
|
||||
If AddPartWndVM.bNewName_IsChecked Then
|
||||
' verifico se il nome inserito non e' gia' esistente, lo aggiungo
|
||||
Dim Res As DataLayer.Controllers.MaterialsController.SearchResult = DbControllers.m_MaterialsController.SearchFilt(AddPartWndVM.sNewMaterialName)
|
||||
If Res.Tipo = DataLayer.Controllers.MaterialsController.SearchResult.TypeFound.MISSING_CODE Or Res.Tipo = DataLayer.Controllers.MaterialsController.SearchResult.TypeFound.NOT_FOUND Then
|
||||
' creo questo materiale e lo aggiungo al Db
|
||||
Dim NewMaterialM As MaterialM = New MaterialM(NewPartVM.Section.MaterialM.dW, NewPartVM.Section.MaterialM.dH, NewPartVM.Section.MaterialM.dL, AddPartWndVM.sNewMaterialName, AddPartWndVM.sNewMaterialName)
|
||||
Dim NewMaterialM As MaterialM = New MaterialM(NewPart.MaterialM.dW, NewPart.MaterialM.dH, NewPart.MaterialM.dL, AddPartWndVM.sNewMaterialName, AddPartWndVM.sNewMaterialName)
|
||||
DbControllers.m_MaterialsController.Insert(NewMaterialM)
|
||||
' NewPartVM.sWAREHOUSEMATERIAL = AddPartWndVM.sNewMaterialName
|
||||
Else
|
||||
' recupero WarehouseMaterial di questo materiale
|
||||
' NewPartVM.sWAREHOUSEMATERIAL = AddPartWndVM.sNewMaterialName
|
||||
End If
|
||||
NewPartVM.BTLPartM.sMATERIAL = AddPartWndVM.sNewMaterialName
|
||||
EgtSetInfo(nNewPartId, BTL_PRT_MATERIAL, AddPartWndVM.sNewMaterialName)
|
||||
NewPart.sMATERIAL = AddPartWndVM.sNewMaterialName
|
||||
Else
|
||||
' NewPartVM.sWAREHOUSEMATERIAL = AddPartWndVM.sSelWarehouseMaterial
|
||||
NewPartVM.BTLPartM.sMATERIAL = AddPartWndVM.sSelWarehouseMaterial
|
||||
NewPart.sMATERIAL = AddPartWndVM.sSelWarehouseMaterial
|
||||
End If
|
||||
' aggiungo pezzo alla lista
|
||||
Map.refProjectVM.BTLStructureVM.BTLStructureM.AddBTLPart(NewPart)
|
||||
Dim NewPartVM As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.BTLPartM Is NewPart)
|
||||
If Not IsNothing(NewPartVM) Then
|
||||
' aggiorno MaterialM da Db
|
||||
Map.refProjectVM.BTLStructureVM.ReadMaterialFromDb(NewPartVM)
|
||||
Map.refProjectVM.BTLStructureVM.ReadMaterialFromDb(NewPartVM, Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
EgtZoom(ZM.ALL)
|
||||
Map.refProjectVM.BTLStructureVM.SetSelBTLPart(NewPartVM, False, True)
|
||||
' verifico se aggiungere sezione alla lista
|
||||
If Not Map.refProjectVM.BTLStructureVM.SectionList.Contains(NewPartVM.Section) Then
|
||||
Dim nMaterialId As Integer = DbControllers.m_MaterialsController.Insert(NewPartVM.Section.MaterialM)
|
||||
Dim NewSection = NewPartVM.Section
|
||||
Map.refProjectVM.BTLStructureVM.SectionList.Add(NewSection)
|
||||
If nMaterialId <> 0 Then
|
||||
NewSection.MaterialM.SetId(nMaterialId)
|
||||
End If
|
||||
Map.refProjectVM.BTLStructureVM.SectionList.Add(NewPartVM.Section)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -52,7 +52,6 @@ Public Class MyMachGroupPanelVM
|
||||
MachGroup.UpdateUsage()
|
||||
End If
|
||||
Next
|
||||
ReadAllRawPartFromDb()
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
@@ -251,23 +250,23 @@ Public Class MyMachGroupPanelVM
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Sub ReadAllRawPartFromDb()
|
||||
Friend Sub ReadAllRawPartFromDb(nPROJTYPE As BWType)
|
||||
m_RawPartDbList.Clear()
|
||||
' aggiornamento materiale
|
||||
For Each MachGroup As MyMachGroupVM In Map.refMachGroupPanelVM.m_MachGroupVMList
|
||||
If IsNothing(MachGroup.MyMachGroupM.RawPartM) OrElse MachGroup.MyMachGroupM.RawPartM.nId = 0 OrElse MachGroup.MyMachGroupM.RawPartM.Material.nId = 0 OrElse String.IsNullOrWhiteSpace(MachGroup.MyMachGroupM.RawPartM.Material.sWarehouseMaterial) Then
|
||||
ReadRawPartFromDb(MachGroup, True)
|
||||
ReadRawPartFromDb(MachGroup, nPROJTYPE, True)
|
||||
End If
|
||||
Next
|
||||
m_RawPartDbList.Clear()
|
||||
End Sub
|
||||
|
||||
Friend Sub ReadRawPartFromDb(MachGroup As MyMachGroupVM, Optional bUseList As Boolean = False)
|
||||
Friend Sub ReadRawPartFromDb(MachGroup As MyMachGroupVM, nPROJTYPE As BWType, Optional bUseList As Boolean = False)
|
||||
If Not IsNothing(MachGroup.MyMachGroupM.RawPartM) AndAlso MachGroup.MyMachGroupM.RawPartM.nId > 0 AndAlso MachGroup.MyMachGroupM.RawPartM.Material.nId > 0 AndAlso Not String.IsNullOrWhiteSpace(MachGroup.MyMachGroupM.RawPartM.Material.sWarehouseMaterial) Then Return
|
||||
' aggiornamento materiale
|
||||
Dim RawPart As RawPartM = Nothing
|
||||
If bUseList Then
|
||||
RawPart = m_RawPartDbList.FirstOrDefault(Function(x) x.Material.sMaterial = MachGroup.RawPartM.Material.sMaterial AndAlso Math.Abs(x.Material.dW - MachGroup.dW) < m_DimensionRange AndAlso Math.Abs(x.Material.dH - MachGroup.dH) < m_DimensionRange AndAlso Math.Abs(x.Material.dL - MachGroup.dL) < m_DimensionRange)
|
||||
RawPart = m_RawPartDbList.FirstOrDefault(Function(x) x.Material.sWarehouseMaterial = MachGroup.RawPartM.Material.sMaterial AndAlso Math.Abs(x.Material.dW - MachGroup.dW) < m_DimensionRange AndAlso Math.Abs(x.Material.dH - MachGroup.dH) < m_DimensionRange AndAlso Math.Abs(x.Material.dL - MachGroup.dL) < m_DimensionRange)
|
||||
End If
|
||||
If Not IsNothing(RawPart) Then
|
||||
MachGroup.MyMachGroupM.RawPartM.Material.SetId(RawPart.Material.nId)
|
||||
@@ -282,31 +281,32 @@ Public Class MyMachGroupPanelVM
|
||||
' verifico che il materiale non sia nullo
|
||||
If (String.IsNullOrWhiteSpace(MachGroup.RawPartM.Material.sMaterial) OrElse String.IsNullOrWhiteSpace(MachGroup.RawPartM.Material.sWarehouseMaterial)) AndAlso MachGroup.PartVMList.Count > 0 Then
|
||||
MachGroup.MyMachGroupM.sMATERIAL = MachGroup.PartVMList(0).sMATERIAL
|
||||
MachGroup.MyMachGroupM.sWAREHOUSEMATERIAL = MachGroup.PartVMList(0).sWAREHOUSEMATERIAL
|
||||
MachGroup.RawPartM.Material.SetMaterial(MachGroup.PartVMList(0).sMATERIAL)
|
||||
MachGroup.RawPartM.Material.SetWarehouseMaterial(MachGroup.PartVMList(0).sWAREHOUSEMATERIAL)
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.sMATERIAL))
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.sWAREHOUSEMATERIAL))
|
||||
End If
|
||||
Dim SearchMaterial As DataLayer.Controllers.MaterialsController.SearchResult = DbControllers.m_MaterialsController.SearchFilt(MachGroup.RawPartM.Material.sMaterial)
|
||||
Dim SearchMaterial As DataLayer.Controllers.MaterialsController.SearchResult = DbControllers.m_MaterialsController.SearchFilt(MachGroup.RawPartM.Material.sWarehouseMaterial)
|
||||
Select Case SearchMaterial.Tipo
|
||||
Case DataLayer.Controllers.MaterialsController.SearchResult.TypeFound.ALIAS, DataLayer.Controllers.MaterialsController.SearchResult.TypeFound.MATERIAL
|
||||
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
|
||||
If nPROJTYPE = BWType.BEAM Then
|
||||
Material = SearchMaterial.Result.FirstOrDefault(Function(x) Math.Abs(x.dW - Math.Min(MachGroup.dW, MachGroup.dH)) < m_DimensionRange AndAlso Math.Abs(x.dH - Math.Max(MachGroup.dW, MachGroup.dH)) < m_DimensionRange)
|
||||
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL Then
|
||||
ElseIf nPROJTYPE = BWType.WALL Then
|
||||
Material = SearchMaterial.Result.FirstOrDefault(Function(x) Math.Abs(x.dH - MachGroup.dH) < m_DimensionRange)
|
||||
End If
|
||||
Case Else
|
||||
EgtOutLog("Error! MachGroup material not found!!")
|
||||
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
|
||||
Material = New MaterialM(MachGroup.dW, MachGroup.dH, 0, 0, MachGroup.sMATERIAL)
|
||||
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL Then
|
||||
Material = New MaterialM(0, MachGroup.dH, 0, 0, MachGroup.sMATERIAL)
|
||||
If nPROJTYPE = BWType.BEAM Then
|
||||
Material = New MaterialM(Math.Min(MachGroup.dW, MachGroup.dH), Math.Max(MachGroup.dW, MachGroup.dH), 0, 0, MachGroup.sWAREHOUSEMATERIAL)
|
||||
ElseIf nPROJTYPE = BWType.WALL Then
|
||||
Material = New MaterialM(0, MachGroup.dH, 0, 0, MachGroup.sWAREHOUSEMATERIAL)
|
||||
End If
|
||||
End Select
|
||||
Dim SearchRawPart As List(Of RawPartM) = DbControllers.m_RawItemsController.GetFilt(Material.nId)
|
||||
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
|
||||
If nPROJTYPE = BWType.BEAM Then
|
||||
RawPart = SearchRawPart.FirstOrDefault(Function(x) Math.Abs(x.Material.dW - Math.Min(MachGroup.dW, MachGroup.dH)) < m_DimensionRange AndAlso Math.Abs(x.Material.dH - Math.Max(MachGroup.dW, MachGroup.dH)) < m_DimensionRange AndAlso Math.Abs(x.dL - MachGroup.dL) < m_DimensionRange)
|
||||
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL Then
|
||||
ElseIf nPROJTYPE = BWType.WALL Then
|
||||
RawPart = SearchRawPart.FirstOrDefault(Function(x) Math.Abs(x.dW - MachGroup.dW) < m_DimensionRange AndAlso Math.Abs(x.Material.dH - MachGroup.dH) < m_DimensionRange AndAlso Math.Abs(x.dL - MachGroup.dL) < m_DimensionRange)
|
||||
End If
|
||||
If Not IsNothing(RawPart) Then
|
||||
@@ -319,16 +319,16 @@ Public Class MyMachGroupPanelVM
|
||||
Next
|
||||
Else
|
||||
Dim nRawPartId As Integer = 0
|
||||
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
|
||||
If nPROJTYPE = BWType.BEAM Then
|
||||
nRawPartId = DbControllers.m_RawItemsController.Upsert(New RawPartM(Material, 0, MachGroup.dL, 0, False))
|
||||
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL Then
|
||||
ElseIf nPROJTYPE = BWType.WALL Then
|
||||
nRawPartId = DbControllers.m_RawItemsController.Upsert(New RawPartM(Material, MachGroup.dW, MachGroup.dL, 0, False))
|
||||
End If
|
||||
If nRawPartId > 0 Then
|
||||
SearchRawPart = DbControllers.m_RawItemsController.GetFilt(Material.nId)
|
||||
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
|
||||
If nPROJTYPE = BWType.BEAM Then
|
||||
RawPart = SearchRawPart.FirstOrDefault(Function(x) Math.Abs(x.Material.dW - Math.Min(MachGroup.dW, MachGroup.dH)) < m_DimensionRange AndAlso Math.Abs(x.Material.dH - Math.Max(MachGroup.dW, MachGroup.dH)) < m_DimensionRange AndAlso Math.Abs(x.dL - MachGroup.dL) < m_DimensionRange)
|
||||
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL Then
|
||||
ElseIf nPROJTYPE = BWType.WALL Then
|
||||
RawPart = SearchRawPart.FirstOrDefault(Function(x) Math.Abs(x.dW - MachGroup.dW) < m_DimensionRange AndAlso Math.Abs(x.Material.dH - MachGroup.dH) < m_DimensionRange AndAlso Math.Abs(x.dL - MachGroup.dL) < m_DimensionRange)
|
||||
End If
|
||||
If IsNothing(RawPart) Then
|
||||
@@ -351,7 +351,6 @@ Public Class MyMachGroupPanelVM
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
End Class
|
||||
|
||||
@@ -279,7 +279,7 @@ Public Class MainMenuVM
|
||||
' se si rigenero BTLStructure
|
||||
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(Map.refProjManagerVM.CurrProj.nProjId))
|
||||
' aggiornamento materiale da Db
|
||||
Map.refProjectVM.BTLStructureVM.ReadAllMaterialFromDb()
|
||||
Map.refProjectVM.BTLStructureVM.ReadAllMaterialFromDb(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
' carico filtri di ricerca
|
||||
Map.refProjectVM.BTLStructureVM.LoadFilters()
|
||||
End If
|
||||
@@ -358,7 +358,7 @@ Public Class MainMenuVM
|
||||
' se si rigenero BTLStructure
|
||||
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(0))
|
||||
' aggiornamento materiale da Db
|
||||
Map.refProjectVM.BTLStructureVM.ReadAllMaterialFromDb()
|
||||
Map.refProjectVM.BTLStructureVM.ReadAllMaterialFromDb(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
' carico filtri di ricerca
|
||||
Map.refProjectVM.BTLStructureVM.LoadFilters()
|
||||
End If
|
||||
@@ -373,6 +373,8 @@ Public Class MainMenuVM
|
||||
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.GOTOPROD, 3, EgtMsg(63002), 30, 100) ' Loading machining groups
|
||||
' carico lista dei MachGroup
|
||||
Map.refProjectVM.MachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList()))
|
||||
' aggiornamento materiale da Db
|
||||
Map.refMachGroupPanelVM.ReadAllRawPartFromDb(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
' fisso indice sessione di comunicazione
|
||||
If CommIndex > -1 Then
|
||||
Map.refProdManagerVM.CurrProd.SetModificationIndex(CommIndex)
|
||||
@@ -498,10 +500,10 @@ Public Class MainMenuVM
|
||||
' resetto flag inserimento password
|
||||
Map.refConfigurationPageVM.bModifyMachParam = False
|
||||
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
|
||||
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
Map.refFeatureInPartInRawPartListVM.UpdateColumns(CurrentMachine.nType)
|
||||
Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.nPROJTYPE <> BWType.BEAM)
|
||||
Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE <> BWType.BEAM)
|
||||
Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
Else
|
||||
Map.refRawPartListVM.UpdateColumns(BWType.BEAM)
|
||||
Map.refFeatureInPartInRawPartListVM.UpdateColumns(CurrentMachine.nType)
|
||||
|
||||
@@ -139,8 +139,8 @@ Public Class MainWindowVM
|
||||
'Map.refStatusBarVM.SetMeasureUnit(If(EgtUiUnitsAreMM(), MeasureUnitOpt.MM, MeasureUnitOpt.INCH))
|
||||
' imposto MainWindow per finestra di Loading
|
||||
LoadingWndHelper.SetMainWindow(Application.Current.MainWindow)
|
||||
' verifico se convertire file magazzino su Db
|
||||
ReadWarehouseFile()
|
||||
'' verifico se convertire file magazzino su Db
|
||||
'ReadWarehouseFile()
|
||||
' leggo riga di comando
|
||||
Dim nCommandType As Integer = 0
|
||||
Dim nPage As Pages = Pages.VIEW
|
||||
|
||||
@@ -156,7 +156,7 @@ Public Class MaterialNameManagerVM
|
||||
If Material.bNewName_IsChecked Then
|
||||
' cerco un pezzo che usa questo materiale
|
||||
Dim PartVM As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.MaterialM.sMaterial = sMaterialName)
|
||||
Dim NewMaterialM As MaterialM = New MaterialM(PartVM.Section.MaterialM.dW, PartVM.Section.MaterialM.dH, PartVM.Section.MaterialM.dL, Material.sNewName, Material.sNewName)
|
||||
Dim NewMaterialM As MaterialM = New MaterialM(PartVM.MaterialM.dW, PartVM.MaterialM.dH, PartVM.MaterialM.dL, Material.sNewName, Material.sNewName)
|
||||
' lo aggiungo al Db
|
||||
DbControllers.m_MaterialsController.Insert(NewMaterialM)
|
||||
End If
|
||||
@@ -166,7 +166,7 @@ Public Class MaterialNameManagerVM
|
||||
If IsNothing(PartVM) Then
|
||||
PartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart
|
||||
End If
|
||||
Dim NewMaterialM As MaterialM = New MaterialM(PartVM.Section.MaterialM.dW, PartVM.Section.MaterialM.dH, PartVM.Section.MaterialM.dL, Material.sOrigMaterial, Material.sNewName)
|
||||
Dim NewMaterialM As MaterialM = New MaterialM(PartVM.MaterialM.dW, PartVM.MaterialM.dH, PartVM.MaterialM.dL, Material.sOrigMaterial, Material.sNewName)
|
||||
' lo aggiungo al Db
|
||||
DbControllers.m_MaterialsController.Insert(NewMaterialM)
|
||||
' se diverso dal nome originale, aggiungo anche l'alias
|
||||
|
||||
@@ -291,9 +291,17 @@ Public Class NestingRunningWndVM
|
||||
End Select
|
||||
' calcolo lista dei pezzi per ogni sezione
|
||||
For Each SectionProgress In m_SectionProgressList
|
||||
'Dim SectionPartList As New List(Of BTLPartM)(Map.refProjectVM.BTLStructureVM.BTLPartVMList.Where(Function(x) x.Section = Section.SectXMat).ToList())
|
||||
'Dim SectionPartList As List(Of BTLPartM) = (From x In Map.refProjectVM.BTLStructureVM.BTLPartVMList
|
||||
' Where x.MaterialM = SectionProgress.Section.MaterialM AndAlso x.bDO AndAlso x.nCNT + x.nADDED > x.nINPROD AndAlso
|
||||
' (m_SelPartType = OptimizePanelVM.PartType.ALL OrElse ((Map.refProjectVM.BTLStructureVM.SelGroup = "" OrElse x.sGROUP = Map.refProjectVM.BTLStructureVM.SelGroup) AndAlso
|
||||
' (Map.refProjectVM.BTLStructureVM.SelSubGroup = "" OrElse x.sSTOREY = Map.refProjectVM.BTLStructureVM.SelSubGroup) AndAlso
|
||||
' (Map.refProjectVM.BTLStructureVM.SelSearchParam.Id = BTLPartParam.NULL OrElse Map.refProjectVM.BTLStructureVM.SearchText = String.Empty OrElse (
|
||||
' (Map.refProjectVM.BTLStructureVM.SelSearchParam.Id = BTLPartParam.PDN AndAlso x.nPDN.ToString.IndexOf(Map.refProjectVM.BTLStructureVM.SearchText, StringComparison.InvariantCultureIgnoreCase) >= 0) OrElse
|
||||
' (Map.refProjectVM.BTLStructureVM.SelSearchParam.Id = BTLPartParam.NAM AndAlso x.sNAM.IndexOf(Map.refProjectVM.BTLStructureVM.SearchText, StringComparison.InvariantCultureIgnoreCase) >= 0)))))
|
||||
' Select x.BTLPartM).ToList()
|
||||
Dim SectionPartList As List(Of BTLPartM) = (From x In Map.refProjectVM.BTLStructureVM.BTLPartVMList
|
||||
Where x.MaterialM = SectionProgress.Section.MaterialM AndAlso x.bDO AndAlso x.nCNT + x.nADDED > x.nINPROD AndAlso
|
||||
Where x.Section.dH = SectionProgress.Section.dH AndAlso x.Section.dW = SectionProgress.Section.dW AndAlso x.Section.MaterialM.sWarehouseMaterial = SectionProgress.Section.MaterialM.sWarehouseMaterial AndAlso
|
||||
x.bDO AndAlso x.nCNT + x.nADDED > x.nINPROD AndAlso
|
||||
(m_SelPartType = OptimizePanelVM.PartType.ALL OrElse ((Map.refProjectVM.BTLStructureVM.SelGroup = "" OrElse x.sGROUP = Map.refProjectVM.BTLStructureVM.SelGroup) AndAlso
|
||||
(Map.refProjectVM.BTLStructureVM.SelSubGroup = "" OrElse x.sSTOREY = Map.refProjectVM.BTLStructureVM.SelSubGroup) AndAlso
|
||||
(Map.refProjectVM.BTLStructureVM.SelSearchParam.Id = BTLPartParam.NULL OrElse Map.refProjectVM.BTLStructureVM.SearchText = String.Empty OrElse (
|
||||
@@ -345,9 +353,16 @@ Public Class NestingRunningWndVM
|
||||
dOffset = WarehouseHelper.GetWallOffsetByWidth(SectionProgress.Section.dH)
|
||||
End If
|
||||
' passo a lua lista id pezzi da nestare
|
||||
If SectionProgress.SectionPartList.Count > 0 AndAlso SectionProgress.SParamList.Count > 0 AndAlso SectionProgress.SParamList.Sum(Function(x) Math.Max(0, x.RawPart.nQuantity)) > 0 AndAlso
|
||||
Not ExecNesting(sLogPath, CurrentMachine.sMachineName, SectionProgress.SectionPartList, SectionProgress.SParamList, dStartOffset, dOffset, dKerf, m_bLDIntersOther, m_nMinScore, SectionProgress.dCalcNestTime) Then
|
||||
Exit For
|
||||
If SectionProgress.SectionPartList.Count > 0 AndAlso SectionProgress.SParamList.Count > 0 AndAlso SectionProgress.SParamList.Sum(Function(x) Math.Max(0, x.RawPart.nQuantity)) > 0 Then
|
||||
If ExecNesting(sLogPath, CurrentMachine.sMachineName, SectionProgress.SectionPartList, SectionProgress.SParamList, dStartOffset, dOffset, dKerf, m_bLDIntersOther, m_nMinScore, SectionProgress.dCalcNestTime) Then
|
||||
' verifico se c'e' un altro nesting con stesso materiale
|
||||
Dim TwinSectionProgress As SectionProgress = m_SectionProgressList.FirstOrDefault(Function(x) x IsNot SectionProgress AndAlso x.Section.MaterialM.nId = SectionProgress.Section.MaterialM.nId)
|
||||
If Not IsNothing(TwinSectionProgress) Then
|
||||
TwinSectionProgress.SetSParamList(SectionProgress.SParamList)
|
||||
End If
|
||||
Else
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
@@ -356,7 +371,7 @@ Public Class NestingRunningWndVM
|
||||
' seleziono ultimo gruppo
|
||||
Map.refProjectVM.MachGroupPanelVM.SelLastMachGroup()
|
||||
' aggiorno barre con MaterialM da Db
|
||||
Map.refMachGroupPanelVM.ReadAllRawPartFromDb()
|
||||
Map.refMachGroupPanelVM.ReadAllRawPartFromDb(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
' riabilito interfaccia
|
||||
Map.refProjectVM.SetCalcRunning(False)
|
||||
' fermo timer e chiudo finestra
|
||||
@@ -838,6 +853,9 @@ Public Class SectionProgress
|
||||
Return m_SParamList
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetSParamList(SParamList As List(Of SParam))
|
||||
m_SParamList = SParamList
|
||||
End Sub
|
||||
|
||||
Private m_SectionPartList As New List(Of BTLPartM)
|
||||
Public ReadOnly Property SectionPartList As List(Of BTLPartM)
|
||||
|
||||
@@ -21,6 +21,11 @@ Public Class NewOpenProjectFileDialogVM
|
||||
#Region "METHODS"
|
||||
|
||||
Public Overrides Function Init(ProjectType As ProjectType, Optional CurrProjectList As List(Of ProjectFileVM) = Nothing, Optional GoToProd As Boolean = False) As Boolean?
|
||||
' se magazzino di rete attivo
|
||||
If GetMainPrivateProfileInt(S_WAREHOUSE, K_NETWAREHOUSE, 0) = 1 Then
|
||||
' aggiorno stato progetti archiviati
|
||||
DbControllers.m_MagmanController.ProjArchSync()
|
||||
End If
|
||||
m_ProjectType = ProjectType
|
||||
|
||||
NotifyPropertyChanged(NameOf(FilterTypeList))
|
||||
@@ -140,7 +145,12 @@ Public Class NewOpenProjectFileDialogVM
|
||||
If Not IsNothing(SelProject.ProdFileVM) Then
|
||||
' archivio il progetto
|
||||
DbControllers.m_ProdController.UpdateArchived(SelProject.ProdFileVM.nProdId, Not SelProject.bIsArchived)
|
||||
DbControllers.m_MagmanController.ProjSyncro(SelProject.ProdFileVM.nProdId)
|
||||
' se magazzino di rete attivo
|
||||
If GetMainPrivateProfileInt(S_WAREHOUSE, K_NETWAREHOUSE, 0) = 1 Then
|
||||
DbControllers.m_MagmanController.ProjSyncro(SelProject.ProdFileVM.nProdId)
|
||||
' aggiorno stato progetti archiviati
|
||||
DbControllers.m_MagmanController.ProjArchSync()
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(Archive_Msg))
|
||||
End If
|
||||
' aggiorno lista progetti
|
||||
|
||||
@@ -11,6 +11,11 @@ Public Class OpenProjectFileDialogVM
|
||||
#Region "METHODS"
|
||||
|
||||
Public Overrides Function Init(ProjectType As ProjectType, Optional CurrProjectList As List(Of ProjectFileVM) = Nothing, Optional GoToProd As Boolean = False) As Boolean?
|
||||
' se magazzino di rete attivo
|
||||
If GetMainPrivateProfileInt(S_WAREHOUSE, K_NETWAREHOUSE, 0) = 1 Then
|
||||
' aggiorno stato progetti archiviati
|
||||
DbControllers.m_MagmanController.ProjArchSync()
|
||||
End If
|
||||
m_ProjectType = ProjectType
|
||||
m_GoToProd = GoToProd
|
||||
' carico colonne
|
||||
|
||||
@@ -568,7 +568,7 @@ Public Class OptimizePanelVM
|
||||
Public ReadOnly Property UploadNesting_Command As ICommand
|
||||
Get
|
||||
If m_cmdUploadNesting Is Nothing Then
|
||||
m_cmdUploadNesting = New Command(AddressOf UploadNesting)
|
||||
m_cmdUploadNesting = New Command(AddressOf UploadNestingCmd)
|
||||
End If
|
||||
Return m_cmdUploadNesting
|
||||
End Get
|
||||
@@ -577,9 +577,23 @@ Public Class OptimizePanelVM
|
||||
''' <summary>
|
||||
''' Execute the Open. This method is invoked by the OpenCommand.
|
||||
''' </summary>
|
||||
Friend Sub UploadNesting(Optional bSave As Boolean = True)
|
||||
Friend Sub UploadNestingCmd()
|
||||
Map.refProdManagerVM.Save(True, UploadOptimType.UPLOAD)
|
||||
'LoadingWndHelper.OpenLoadingWnd(ActiveIds.UPLOADNESTING, 1, "Optimization Upload", "Uploading...", 99) ' Optimization Upload ' Uploading...
|
||||
|
||||
'' chiudo finestra di caricamento progetto
|
||||
'LoadingWndHelper.CloseLoadingWnd(ActiveIds.UPLOADNESTING)
|
||||
'Threading.Thread.Sleep(700)
|
||||
'If UploadNesting(True) Then
|
||||
' If bSave Then Map.refProdManagerVM.Save()
|
||||
' MessageBox.Show("Estimation sent to the server!", "Info", MessageBoxButton.OK, MessageBoxImage.Information)
|
||||
'Else
|
||||
' MessageBox.Show("Impossible sending the estimation to the server!", "Error!", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
Friend Function UploadNesting(Optional bSave As Boolean = False) As Boolean
|
||||
Dim nCurrProjectCloudId As Integer = Map.refProdManagerVM.CurrProd.ProdFileM.nProjCloudId
|
||||
'Dim MaterialList As New List(Of Integer)
|
||||
Dim RawPartList As New List(Of RawPartM)
|
||||
Dim RawMaterialList As New Dictionary(Of Integer, Integer)
|
||||
Select Case Map.refProdManagerVM.CurrProd.nType
|
||||
@@ -616,13 +630,8 @@ Public Class OptimizePanelVM
|
||||
' forzo aggiornamento eventuali dati non inviati su Db
|
||||
DbControllers.m_MagmanController.ForceSyncroSend()
|
||||
Dim SendEstimateResult As DataLayer.Controllers.MagmanController.SyncResult = DbControllers.m_MagmanController.ResourceSendEstimate(Map.refProdManagerVM.CurrProd.ProdFileM.nProjCloudId, RawMaterialList)
|
||||
If SendEstimateResult = DataLayer.Controllers.MagmanController.SyncResult.ALL_OK Then
|
||||
If bSave Then Map.refProdManagerVM.Save()
|
||||
MessageBox.Show("Estimation sent to the server!", "Info", MessageBoxButton.OK, MessageBoxImage.Information)
|
||||
Else
|
||||
MessageBox.Show("Impossible sending the estimation to the server!", "Error!", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
End If
|
||||
End Sub
|
||||
Return SendEstimateResult = DataLayer.Controllers.MagmanController.SyncResult.ALL_OK
|
||||
End Function
|
||||
|
||||
#End Region ' UploadNesting
|
||||
|
||||
|
||||
@@ -306,6 +306,8 @@ Public Class ProdManagerVM
|
||||
MessageBox.Show(EgtMsg(61885), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) 'Error
|
||||
Map.refProjManagerVM.NewProject()
|
||||
Map.refProjectVM.MachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList()))
|
||||
' aggiornamento materiale da Db
|
||||
Map.refMachGroupPanelVM.ReadAllRawPartFromDb(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
Else
|
||||
If Map.refSceneHostVM.MainController.OpenProject(sFilePath, False) Then
|
||||
Map.refProjectVM.SetOptimizePanel_Visibility(True)
|
||||
@@ -404,11 +406,11 @@ Public Class ProdManagerVM
|
||||
Save(True)
|
||||
End Sub
|
||||
|
||||
Public Function Save(Optional bShowLoading As Boolean = False, Optional bAskWarehouseUpload As Boolean = False) As Boolean
|
||||
Public Function Save(Optional bShowLoading As Boolean = False, Optional bAskWarehouseUpload As UploadOptimType = UploadOptimType.NONE) As Boolean
|
||||
If IsNothing(m_CurrProd) Then Return False
|
||||
If bShowLoading Then LoadingWndHelper.OpenLoadingWnd(ActiveIds.SAVEPROD, 2, EgtMsg(63007), EgtMsg(63012), 70) ' Project saving ' Saving geometry
|
||||
If bShowLoading Then LoadingWndHelper.OpenLoadingWnd(ActiveIds.SAVEPROD, 3, EgtMsg(63007), EgtMsg(63012), 60) ' 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
|
||||
If bShowLoading Then LoadingWndHelper.UpdateLoadingWnd(ActiveIds.SAVEPROD, 2, EgtMsg(63013), 60, 90) ' Saving data on Db
|
||||
Dim MyMachGroupList As New List(Of MyMachGroupM)
|
||||
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
|
||||
For Each MachGroup In Map.refProjectVM.MachGroupPanelVM.m_MyMachGroupPanelM.MachGroupMList
|
||||
@@ -443,13 +445,25 @@ Public Class ProdManagerVM
|
||||
Map.refMainWindowVM.UpdateTitle()
|
||||
NotifyPropertyChanged(NameOf(MruFileNames))
|
||||
' se magazzino di rete attivo e carica nesting su salvataggio attiva
|
||||
If bAskWarehouseUpload AndAlso GetMainPrivateProfileInt(S_WAREHOUSE, K_NETWAREHOUSE, 0) = 1 AndAlso
|
||||
(GetMainPrivateProfileInt(S_WAREHOUSE, K_SENDESTIMONSAVE, 0) = 1 OrElse (Map.refMachGroupPanelVM.MachGroupVMList.Count > 0 AndAlso
|
||||
MessageBox.Show("Optimization saved but not uploaded to Db. Would you like to upload it?", "Info", MessageBoxButton.YesNo, MessageBoxImage.Information) = MessageBoxResult.Yes)) Then
|
||||
If Map.refMachGroupPanelVM.MachGroupVMList.Count > 0 AndAlso GetMainPrivateProfileInt(S_WAREHOUSE, K_NETWAREHOUSE, 0) = 1 AndAlso
|
||||
(GetMainPrivateProfileInt(S_WAREHOUSE, K_SENDESTIMONSAVE, 0) = 1) OrElse
|
||||
bAskWarehouseUpload = UploadOptimType.UPLOAD OrElse
|
||||
(bAskWarehouseUpload = UploadOptimType.ASK AndAlso (MessageBox.Show("Optimization saved but not uploaded to Db. Would you like to upload it?", "Info", MessageBoxButton.YesNo, MessageBoxImage.Information) = MessageBoxResult.Yes)) Then
|
||||
If bShowLoading Then LoadingWndHelper.UpdateLoadingWnd(ActiveIds.SAVEPROD, 2, "Uploading Optimization...", 90, 100) ' Uploading Optimization...
|
||||
' forzo aggiornamento eventuali dati non inviati su Db
|
||||
DbControllers.m_MagmanController.ForceSyncroSend()
|
||||
' carico progetto su magazzino di rete
|
||||
Map.refOptimizePanelVM.UploadNesting(False)
|
||||
Dim bUploadRes As Boolean = Map.refOptimizePanelVM.UploadNesting(False)
|
||||
If bShowLoading Then
|
||||
Dim sUploadRes As String = ""
|
||||
If bUploadRes Then
|
||||
sUploadRes = "Estimation sent to the server!"
|
||||
Else
|
||||
sUploadRes = "Impossible sending the estimation to the server!"
|
||||
End If
|
||||
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.SAVEPROD, 3, sUploadRes, 99, 100) ' Uploading Optimization
|
||||
Threading.Thread.Sleep(2000)
|
||||
End If
|
||||
End If
|
||||
If bShowLoading Then LoadingWndHelper.CloseLoadingWnd(ActiveIds.SAVEPROD)
|
||||
Return bOk
|
||||
|
||||
@@ -308,7 +308,7 @@ Public Class ProjManagerVM
|
||||
Private Sub ReloadBTLStructure()
|
||||
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(Map.refProjManagerVM.CurrProj.nProjId))
|
||||
' aggiornamento materiale da Db
|
||||
Map.refProjectVM.BTLStructureVM.ReadAllMaterialFromDb()
|
||||
Map.refProjectVM.BTLStructureVM.ReadAllMaterialFromDb(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
' verifico se volume pezzi calcolato
|
||||
Dim bIsCalculated As Boolean = False
|
||||
For Each BTLPart In Map.refProjectVM.BTLStructureVM.BTLPartVMList
|
||||
@@ -384,8 +384,10 @@ Public Class ProjManagerVM
|
||||
' scrivo info proj e tipo su layer BtlInfo
|
||||
EgtSetInfo(nBTLInfoLayer, BTL_PRT_PROJ, nProjId)
|
||||
EgtSetInfo(nBTLInfoLayer, BTL_GEN_PROJTYPE, nType)
|
||||
Map.refProjectVM.BTLStructureVM.BTLStructureM.m_nPROJTYPE = nType
|
||||
' salvo il progetto
|
||||
If EgtSaveFile(sProjFileName, NGE.CMPTEXT) Then
|
||||
Dim n = Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE
|
||||
SectionXMaterial.SetType(nType)
|
||||
Core.ViewPanelVM.UpdateBWType(nType)
|
||||
Map.refPartManagerVM.LockVisibilityUpdate()
|
||||
@@ -719,6 +721,7 @@ Public Class ProjManagerVM
|
||||
' importo file
|
||||
If bOk Then
|
||||
bOk = Map.refSceneHostVM.MainController.ImportProject(sBtlCopyPath, False)
|
||||
Map.refProjectVM.BTLStructureVM.BTLStructureM.m_nPROJTYPE = nType
|
||||
End If
|
||||
Dim sProjFileName As String = sProjDir & "\" & nProjId.ToString("0000") & ".nge"
|
||||
Dim bFirstPart As Boolean = EgtGetFirstPart() <> GDB_ID.NULL
|
||||
@@ -924,8 +927,12 @@ Public Class ProjManagerVM
|
||||
|
||||
Dim bOk As Boolean = nTempCtx <> 0
|
||||
If bOk Then
|
||||
LoadingWndHelper.OpenLoadingWnd(ActiveIds.IMPORTBTL, 3, EgtMsg(63008), EgtMsg(63009), 50) ' BTL file importing ' Reading BTL file
|
||||
' importo il file BTL
|
||||
bOk = bOk AndAlso Map.refSceneHostVM.MainController.ImportProject(sFile, False)
|
||||
' chiudo finestra di caricamento progetto
|
||||
LoadingWndHelper.CloseLoadingWnd(ActiveIds.IMPORTBTL)
|
||||
|
||||
' carico la lista dei Part importati e rimuovo i parametri generali del BTL
|
||||
Dim AsseBaseId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, ASSEBASE)
|
||||
Dim BtlInfoId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
||||
@@ -1097,13 +1104,9 @@ Public Class ProjManagerVM
|
||||
Dim AddedBTLPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.BTLPartM Is NewPart)
|
||||
' verifico se aggiungere sezione alla lista
|
||||
If Not Map.refProjectVM.BTLStructureVM.SectionList.Contains(AddedBTLPart.Section) Then
|
||||
Dim nMaterialId As Integer = DbControllers.m_MaterialsController.Insert(AddedBTLPart.Section.MaterialM)
|
||||
Dim NewSection = AddedBTLPart.Section
|
||||
Map.refProjectVM.BTLStructureVM.SectionList.Add(NewSection)
|
||||
If nMaterialId <> 0 Then
|
||||
NewSection.MaterialM.SetId(nMaterialId)
|
||||
End If
|
||||
Map.refProjectVM.BTLStructureVM.SectionList.Add(AddedBTLPart.Section)
|
||||
End If
|
||||
Map.refProjectVM.BTLStructureVM.ReadMaterialFromDb(AddedBTLPart, Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
nNewPartId = EgtGetNextPart(nNewPartId)
|
||||
End While
|
||||
|
||||
@@ -1318,13 +1321,9 @@ Public Class ProjManagerVM
|
||||
End If
|
||||
' verifico se aggiungere sezione alla lista
|
||||
If Not Map.refProjectVM.BTLStructureVM.SectionList.Contains(AddedBTLPart.Section) Then
|
||||
Dim nMaterialId As Integer = DbControllers.m_MaterialsController.Insert(AddedBTLPart.Section.MaterialM)
|
||||
Dim NewSection = AddedBTLPart.Section
|
||||
Map.refProjectVM.BTLStructureVM.SectionList.Add(NewSection)
|
||||
If nMaterialId <> 0 Then
|
||||
NewSection.MaterialM.SetId(nMaterialId)
|
||||
End If
|
||||
Map.refProjectVM.BTLStructureVM.SectionList.Add(AddedBTLPart.Section)
|
||||
End If
|
||||
Map.refProjectVM.BTLStructureVM.ReadMaterialFromDb(AddedBTLPart, Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
nAddedPartId = EgtGetNextPart(nAddedPartId)
|
||||
End While
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_LASTUPDATEDIR, Path.GetDirectoryName(sFile))
|
||||
@@ -1599,7 +1598,7 @@ Public Class ProjManagerVM
|
||||
' costruisco BTLStructure del proj
|
||||
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(nImportProjId))
|
||||
' aggiornamento materiale da Db
|
||||
Map.refProjectVM.BTLStructureVM.ReadAllMaterialFromDb()
|
||||
Map.refProjectVM.BTLStructureVM.ReadAllMaterialFromDb(nType)
|
||||
' scrivo info proj su tutti i pezzi di questo progetto
|
||||
For Each BTLPart In Map.refProjectVM.BTLStructureVM.BTLPartVMList
|
||||
EgtSetInfo(BTLPart.nPartId, BTL_PRT_PROJ, nNewProjId)
|
||||
@@ -1682,6 +1681,8 @@ Public Class ProjManagerVM
|
||||
Map.refProdManagerVM.CurrProd = Nothing
|
||||
' carico Machgroup che non verrebbero altrimenti importati
|
||||
Map.refProjectVM.MachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList()))
|
||||
' aggiornamento materiale da Db
|
||||
Map.refMachGroupPanelVM.ReadAllRawPartFromDb(nType)
|
||||
If Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.Count > 0 Then
|
||||
' inizializzo nuovo progetto PROD
|
||||
Dim nProdId As Integer = 0
|
||||
|
||||
@@ -593,7 +593,7 @@ Public Class MySceneHostVM
|
||||
Map.refCALCPanelVM.LoadMachineList()
|
||||
End If
|
||||
' aggiornamento materiale da Db
|
||||
Map.refProjectVM.BTLStructureVM.ReadAllMaterialFromDb()
|
||||
Map.refProjectVM.BTLStructureVM.ReadAllMaterialFromDb(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
If bManageMaterial Then
|
||||
For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList
|
||||
Part.NotifyPropertyChanged(NameOf(Part.sWAREHOUSEMATERIAL))
|
||||
@@ -616,6 +616,8 @@ Public Class MySceneHostVM
|
||||
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.GOTOPROD, 3, EgtMsg(63002), 50, 100) ' Loading machining groups
|
||||
' carico gruppi di lavorazione
|
||||
Map.refProjectVM.MachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList()))
|
||||
' aggiornamento materiale da Db
|
||||
Map.refMachGroupPanelVM.ReadAllRawPartFromDb(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
' fisso indice sessione di comunicazione
|
||||
If CommIndex > -1 Then
|
||||
Map.refProdManagerVM.CurrProd.SetModificationIndex(CommIndex)
|
||||
@@ -642,6 +644,8 @@ Public Class MySceneHostVM
|
||||
Map.refProjManagerVM.NewProject()
|
||||
If Map.refMainMenuVM.SelPage = Pages.MACHINING Then
|
||||
Map.refProjectVM.MachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList()))
|
||||
' aggiornamento materiale da Db
|
||||
Map.refMachGroupPanelVM.ReadAllRawPartFromDb(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -714,7 +718,7 @@ Public Class MySceneHostVM
|
||||
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(0))
|
||||
' verifico se ci sono nuovi materiali
|
||||
Dim MaterialNameManagerVM As New MaterialNameManagerVM()
|
||||
Dim bManageMaterial As Boolean = MaterialNameManagerVM.VerifyNewMaterialNames
|
||||
Dim bManageMaterial As Boolean = MaterialNameManagerVM.VerifyNewMaterialNames()
|
||||
' se nuovi materiali
|
||||
If bManageMaterial Then
|
||||
' chiudo finestra di caricamento
|
||||
@@ -727,7 +731,7 @@ Public Class MySceneHostVM
|
||||
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.IMPORTBTL, 2, EgtMsg(63005), 50, 70) ' Loading parts
|
||||
End If
|
||||
' aggiornamento materiale da Db
|
||||
Map.refProjectVM.BTLStructureVM.ReadAllMaterialFromDb()
|
||||
Map.refProjectVM.BTLStructureVM.ReadAllMaterialFromDb(Map.refProjManagerVM.CurrProj.nType)
|
||||
If bManageMaterial Then
|
||||
For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList
|
||||
Part.NotifyPropertyChanged(NameOf(Part.sWAREHOUSEMATERIAL))
|
||||
|
||||
@@ -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(Map.refProdManagerVM.CurrProd) OrElse IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) 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
|
||||
@@ -301,7 +301,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(Map.refProdManagerVM.CurrProd) OrElse Map.refMachGroupPanelVM.MachGroupVMList.Count = 0 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)
|
||||
|
||||
@@ -125,6 +125,10 @@ Module LuaExec
|
||||
For PartIndex = 0 To PartList.Count - 1
|
||||
EgtLuaSetGlobIntVar("PART." & PartList(PartIndex).nPartId.ToString(), PartList(PartIndex).m_nCNT + PartList(PartIndex).m_nADDED - PartList(PartIndex).nINPROD)
|
||||
Next
|
||||
EgtLuaCreateGlobTable("RAWID")
|
||||
For SectionIndex = 0 To SectionList.Count - 1
|
||||
EgtLuaSetGlobNumVar("RAWID." & (SectionIndex + 1).ToString(), SectionList(SectionIndex).RawPart.nId)
|
||||
Next
|
||||
EgtLuaCreateGlobTable("LEN")
|
||||
For SectionIndex = 0 To SectionList.Count - 1
|
||||
EgtLuaSetGlobNumVar("LEN." & (SectionIndex + 1).ToString(), SectionList(SectionIndex).dL)
|
||||
@@ -148,7 +152,13 @@ Module LuaExec
|
||||
Dim nErr As Integer = 999
|
||||
EgtLuaGetGlobIntVar("NEST.ERR", nErr)
|
||||
bOk = (nErr <= 0)
|
||||
If Not bOk Then EgtOutLog("NestExec Err=" & nErr.ToString())
|
||||
If Not bOk Then
|
||||
EgtOutLog("NestExec Err=" & nErr.ToString())
|
||||
Else
|
||||
For SectionIndex = 0 To SectionList.Count - 1
|
||||
EgtLuaGetGlobIntVar("QTY." & (SectionIndex + 1).ToString(), SectionList(SectionIndex).nQuantity)
|
||||
Next
|
||||
End If
|
||||
Else
|
||||
bOk = False
|
||||
EgtOutLog("Error executing Nest Exec script " & sExecPath)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports System.Web.UI.WebControls.WebParts
|
||||
|
||||
Module WarehouseHelper
|
||||
|
||||
@@ -163,10 +164,21 @@ Module WarehouseHelper
|
||||
Dim nIndex As Integer = 1
|
||||
Dim sSection As String = ""
|
||||
For Each SectionProgress In SectionList
|
||||
Dim RawPartList As List(Of RawPartM) = DbControllers.m_RawItemsController.GetFilt(SectionProgress.Section.MaterialM.nId)
|
||||
For Each RawPart In RawPartList
|
||||
SectionProgress.SParamList.Add(New SParam(RawPart))
|
||||
Next
|
||||
Dim Material As MaterialM = Nothing
|
||||
Dim SearchRes As DataLayer.Controllers.MaterialsController.SearchResult = DbControllers.m_MaterialsController.SearchFilt(SectionProgress.Section.MaterialM.sWarehouseMaterial)
|
||||
If SearchRes.Tipo = DataLayer.Controllers.MaterialsController.SearchResult.TypeFound.ALIAS OrElse SearchRes.Tipo = DataLayer.Controllers.MaterialsController.SearchResult.TypeFound.MATERIAL Then
|
||||
If Type = BWType.BEAM Then
|
||||
Material = SearchRes.Result.FirstOrDefault(Function(x) x.dW = Math.Min(SectionProgress.Section.MaterialM.dW, SectionProgress.Section.MaterialM.dH) AndAlso x.dH = Math.Max(SectionProgress.Section.MaterialM.dW, SectionProgress.Section.MaterialM.dH))
|
||||
ElseIf Type = BWType.WALL Then
|
||||
Material = SearchRes.Result.FirstOrDefault(Function(x) x.dH = SectionProgress.Section.MaterialM.dH)
|
||||
End If
|
||||
End If
|
||||
If Not IsNothing(Material) Then
|
||||
Dim RawPartList As List(Of RawPartM) = DbControllers.m_RawItemsController.GetFilt(Material.nId)
|
||||
For Each RawPart In RawPartList
|
||||
SectionProgress.SParamList.Add(New SParam(RawPart))
|
||||
Next
|
||||
End If
|
||||
Next
|
||||
'While GenInterface.GetPrivateProfileString(If(Type = BWType.BEAM, WRH_BEAM, WRH_WALL), If(Type = BWType.BEAM, WRH_L, WRH_S) & nIndex, "", sSection, GetWarehouseIniPath()) > 0
|
||||
' If String.IsNullOrWhiteSpace(sSection) Then Continue While
|
||||
|
||||
@@ -677,6 +677,7 @@ Public Class WarehouseWndVM
|
||||
|
||||
Private Function SectionXMaterialFilter(SectionXMaterial As Object) As Boolean
|
||||
Dim CurrSectionXMaterial As SectionXMaterial = DirectCast(SectionXMaterial, SectionXMaterial)
|
||||
'Return Map.refProjectVM.BTLStructureVM.SectionList.Any(Function(x) x.MaterialM =)
|
||||
Return Map.refProjectVM.BTLStructureVM.SectionList.Contains(CurrSectionXMaterial)
|
||||
End Function
|
||||
|
||||
@@ -1208,12 +1209,18 @@ Public Class WarehouseWndVM
|
||||
End Property
|
||||
|
||||
Public Sub UpdateNetQuantity()
|
||||
If Not SaveOnDb() Then Return
|
||||
LoadingWndHelper.OpenLoadingWnd(ActiveIds.UPDATENETWAREHOUSE, 1, "Warehouse Synchronization", "Synchronization in progress...", 99) ' Warehouse Synchronization ' Synchronization in progress...
|
||||
If Not SaveOnDb() Then
|
||||
Return
|
||||
End If
|
||||
Dim SyncResult As DataLayer.Controllers.MagmanController.SyncResult = DbControllers.m_MagmanController.CloudSyncro(True, True, True)
|
||||
' chiudo finestra di caricamento progetto
|
||||
LoadingWndHelper.CloseLoadingWnd(ActiveIds.UPDATENETWAREHOUSE)
|
||||
Threading.Thread.Sleep(1000)
|
||||
If SyncResult = DataLayer.Controllers.MagmanController.SyncResult.ALL_OK OrElse
|
||||
SyncResult = DataLayer.Controllers.MagmanController.SyncResult.ERR_MergeMatEmpty OrElse
|
||||
SyncResult = DataLayer.Controllers.MagmanController.SyncResult.ERR_CloudMatEmpty OrElse
|
||||
SyncResult = DataLayer.Controllers.MagmanController.SyncResult.ERR_Res2SendEmpty Then
|
||||
SyncResult = DataLayer.Controllers.MagmanController.SyncResult.ERR_Res2SendEmpty Then
|
||||
WriteMainPrivateProfileString(S_WAREHOUSE, K_LASTSYNCHRONIZATION, DateTime.Now.ToString())
|
||||
Map.refOptimizePanelVM.NotifyPropertyChanged(NameOf(Map.refOptimizePanelVM.UseNetWarehouse_ToolTip))
|
||||
NotifyPropertyChanged(NameOf(UpdateNetQuantity_ToolTip))
|
||||
@@ -1226,9 +1233,6 @@ Public Class WarehouseWndVM
|
||||
' aggiorno elementi in lista
|
||||
RefreshSParamList()
|
||||
|
||||
'For Each SParam In m_SParamList
|
||||
' SParam.UpdateRawPart()
|
||||
'Next
|
||||
End Sub
|
||||
|
||||
#End Region ' RemoveWhWallParam
|
||||
@@ -1355,7 +1359,7 @@ Public Class WarehouseWndVM
|
||||
'WritePrivateProfileString(S_BEAM_LIST, sSectXMatIndex, LenToString(SectionXMaterial.dW, 3) & "," &
|
||||
' LenToString(SectionXMaterial.dH, 3) & "," &
|
||||
' SectionXMaterial.sMaterial, sWarehousePath)
|
||||
DbControllers.m_MaterialsController.Insert(SectionXMaterial.MaterialM)
|
||||
DbControllers.m_MaterialsController.Insert(New MaterialM(Math.Min(SectionXMaterial.MaterialM.dW, SectionXMaterial.MaterialM.dH), Math.Max(SectionXMaterial.MaterialM.dW, SectionXMaterial.MaterialM.dH), 0, SectionXMaterial.MaterialM.sMaterial, SectionXMaterial.MaterialM.sWarehouseMaterial))
|
||||
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
|
||||
'' ricavo SectionXMaterial tramite Wall_List
|
||||
'While EgtUILib.GetPrivateProfileString(S_WALL_LIST, sSectXMatIndex, String.Empty, sSxMValue, sWarehousePath)
|
||||
|
||||
Reference in New Issue
Block a user