diff --git a/EgtBEAMWALL.Core/BTL Model/BTLStructureM.vb b/EgtBEAMWALL.Core/BTL Model/BTLStructureM.vb
index 4ff27ef5..8e5a2992 100644
--- a/EgtBEAMWALL.Core/BTL Model/BTLStructureM.vb
+++ b/EgtBEAMWALL.Core/BTL Model/BTLStructureM.vb
@@ -67,13 +67,13 @@ Public Class BTLStructureM
End Set
End Property
- Public m_sPROJTYPE As String
- Public Property sPROJTYPE As String
+ Public m_nPROJTYPE As Integer
+ Public Property nPROJTYPE As Integer
Get
- Return m_sPROJTYPE
+ Return m_nPROJTYPE
End Get
- Set(value As String)
- m_sPROJTYPE = value
+ Set(value As Integer)
+ m_nPROJTYPE = value
End Set
End Property
@@ -391,7 +391,7 @@ Public Class BTLStructureM
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_PROJNAME, NewBTLStructure.m_sPROJNAME)
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_PROJPART, NewBTLStructure.m_sPROJPART)
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_PROJGUID, NewBTLStructure.m_sPROJGUID)
- EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_PROJTYPE, NewBTLStructure.m_sPROJTYPE)
+ EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_PROJTYPE, NewBTLStructure.m_nPROJTYPE)
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_LISTNAME, NewBTLStructure.m_sLISTNAME)
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_CUSTOMER, NewBTLStructure.m_sCUSTOMER)
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_ARCHITECT, NewBTLStructure.m_sARCHITECT)
diff --git a/EgtBEAMWALL.Core/MachGroup Model/BeamMachGroupM.vb b/EgtBEAMWALL.Core/MachGroup Model/BeamMachGroupM.vb
index df0c95d6..2b6298f8 100644
--- a/EgtBEAMWALL.Core/MachGroup Model/BeamMachGroupM.vb
+++ b/EgtBEAMWALL.Core/MachGroup Model/BeamMachGroupM.vb
@@ -127,6 +127,7 @@ Public Class BeamMachGroupM
EgtGetInfo(Id, MGR_RPT_BARLEN, dL)
EgtGetInfo(Id, MGR_RPT_BARHEIGHT, dH)
EgtGetInfo(Id, MGR_RPT_BARWIDTH, dW)
+ EgtGetInfo(Id, MGR_RPT_MATERIAL, sMATERIAL)
End Sub
End Class
diff --git a/EgtBEAMWALL.Core/MachGroup Model/MyMachGroupM.vb b/EgtBEAMWALL.Core/MachGroup Model/MyMachGroupM.vb
index ae61cbec..545d54fb 100644
--- a/EgtBEAMWALL.Core/MachGroup Model/MyMachGroupM.vb
+++ b/EgtBEAMWALL.Core/MachGroup Model/MyMachGroupM.vb
@@ -275,6 +275,8 @@ Public MustInherit Class MyMachGroupM
End Function
Public Shared Sub ReadMachGroupData(NewMachgroup As MyMachGroupM)
+ ' leggo materiale
+ EgtGetInfo(NewMachgroup.Id, MGR_RPT_MATERIAL, NewMachgroup.sMATERIAL)
' leggo calc error
Dim nErr As Integer = 0
Dim nRot As Integer = 0
diff --git a/EgtBEAMWALL.Core/MachGroup Model/MyMachGroupPanelM.vb b/EgtBEAMWALL.Core/MachGroup Model/MyMachGroupPanelM.vb
index 0b547838..5ed4b2cc 100644
--- a/EgtBEAMWALL.Core/MachGroup Model/MyMachGroupPanelM.vb
+++ b/EgtBEAMWALL.Core/MachGroup Model/MyMachGroupPanelM.vb
@@ -145,7 +145,8 @@ Public Class MyMachGroupPanelM
End Function
Public Function NewMachGroupID() As Integer
- If Not IsNothing(MachGroupMList) AndAlso MachGroupMList.Count > 0 Then Return MachGroupMList.Max(Function(x) x.Name) + 1
+ Dim nTemp As Integer = 0
+ If Not IsNothing(MachGroupMList) AndAlso MachGroupMList.Count > 0 Then Return MachGroupMList.Select(Of Integer)(Function(x) If(Integer.TryParse(x.Name, nTemp), nTemp, 0)).Max() + 1
Return 1
End Function
diff --git a/EgtBEAMWALL.Core/SectionXMaterial.vb b/EgtBEAMWALL.Core/SectionXMaterial.vb
index e3006a95..bde8275c 100644
--- a/EgtBEAMWALL.Core/SectionXMaterial.vb
+++ b/EgtBEAMWALL.Core/SectionXMaterial.vb
@@ -77,16 +77,22 @@ Public Class SectionXMaterial
End Property
Shared Operator =(ByVal S1 As SectionXMaterial, ByVal S2 As SectionXMaterial) As Boolean
- Return (S1.m_dH = S2.m_dH AndAlso S1.m_dW = S2.m_dW AndAlso S1.m_dL = S2.m_dL AndAlso S1.m_Material.Any(Function(x) S2.m_Material.Any(Function(y) y = x)))
+ Return (S1.m_dH < S2.m_dH + EPS_SMALL * 100 AndAlso S1.m_dH > S2.m_dH - EPS_SMALL * 100 AndAlso
+ S1.m_dW < S2.m_dW + EPS_SMALL * 100 AndAlso S1.m_dW > S2.m_dW - EPS_SMALL * 100 AndAlso
+ S1.m_dL < S2.m_dL + EPS_SMALL * 100 AndAlso S1.m_dL > S2.m_dL - EPS_SMALL * 100 AndAlso
+ S1.m_Material.Any(Function(x) S2.m_Material.Any(Function(y) y = x)))
End Operator
Shared Operator <>(ByVal S1 As SectionXMaterial, ByVal S2 As SectionXMaterial) As Boolean
- Return (S1.m_dH <> S2.m_dH OrElse S1.m_dW <> S2.m_dW OrElse S1.m_dL <> S2.m_dL) OrElse Not S1.m_Material.Any(Function(x) S2.m_Material.Any(Function(y) y = x))
+ Return S1.m_dH > S2.m_dH + EPS_SMALL * 100 OrElse S1.m_dH < S2.m_dH - EPS_SMALL * 100 OrElse
+ S1.m_dW > S2.m_dW + EPS_SMALL * 100 OrElse S1.m_dW < S2.m_dW - EPS_SMALL * 100 OrElse
+ S1.m_dL > S2.m_dL + EPS_SMALL * 100 OrElse S1.m_dL < S2.m_dL - EPS_SMALL * 100 OrElse
+ Not S1.m_Material.Any(Function(x) S2.m_Material.Any(Function(y) y = x))
End Operator
Public Overrides Function Equals(ByVal obj As Object) As Boolean
If TypeOf obj Is SectionXMaterial Then
- Return (m_dH = obj.dH AndAlso m_dW = obj.dW AndAlso m_dL = obj.dL AndAlso m_Material.Any(Function(x) DirectCast(obj.sMaterial, List(Of String)).Any(Function(y) y = x)))
+ Return Me = DirectCast(obj, SectionXMaterial) '(m_dH = obj.dH AndAlso m_dW = obj.dW AndAlso m_dL = obj.dL AndAlso m_Material.Any(Function(x) DirectCast(obj.sMaterial, List(Of String)).Any(Function(y) y = x)))
End If
Return False
End Function
diff --git a/EgtBEAMWALL.Core/WallMachGroupM.vb b/EgtBEAMWALL.Core/WallMachGroupM.vb
index 208f6dff..a05f3512 100644
--- a/EgtBEAMWALL.Core/WallMachGroupM.vb
+++ b/EgtBEAMWALL.Core/WallMachGroupM.vb
@@ -97,6 +97,7 @@ Public Class WallMachGroupM
EgtGetInfo(Id, MGR_RPT_PANELLEN, dL)
EgtGetInfo(Id, MGR_RPT_PANELWIDTH, dW)
EgtGetInfo(Id, MGR_RPT_PANELHEIGHT, dH)
+ EgtGetInfo(Id, MGR_RPT_MATERIAL, sMATERIAL)
End Sub
End Class
diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLParam/BTLPartVM.vb b/EgtBEAMWALL.ViewerOptimizer/BTLParam/BTLPartVM.vb
index 9968b864..49762cb9 100644
--- a/EgtBEAMWALL.ViewerOptimizer/BTLParam/BTLPartVM.vb
+++ b/EgtBEAMWALL.ViewerOptimizer/BTLParam/BTLPartVM.vb
@@ -62,8 +62,8 @@ Public Class BTLPartVM
Dim nDuploCount As Integer = 0
If EgtDuploCount(m_BTLPartM.nPartId, nDuploCount) AndAlso nDuploCount > 0 Then
' se modalità travi e trave
- If CurrentMachine.nType = MachineType.BEAM OrElse
- CurrentMachine.nType = MachineType.WALL Then
+ If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM OrElse
+ Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL Then
If dBtlW <> m_BTLPartM.dBtlW OrElse dBtlH <> m_BTLPartM.dBtlH OrElse dBtlL <> m_BTLPartM.dBtlL Then
' avviso che tutti i pezzi verranno tolti dai grezzi e chiedo di confermare
If MessageBox.Show(String.Format(EgtMsg(61851), nDuploCount), EgtMsg(15003), MessageBoxButton.YesNo, MessageBoxImage.Information) = MessageBoxResult.Yes Then
@@ -1584,8 +1584,8 @@ Public Class BTLPartVM
Dim nDuploCount As Integer = 0
If EgtDuploCount(m_BTLPartM.nPartId, nDuploCount) AndAlso nDuploCount > 0 Then
' se modalità travi e trave
- If CurrentMachine.nType = MachineType.BEAM OrElse
- CurrentMachine.nType = MachineType.WALL Then
+ If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM OrElse
+ Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
' avviso che tutti i pezzi verranno tolti dai grezzi e chiedo di confermare
If MessageBox.Show(String.Format(EgtMsg(61851), nDuploCount), EgtMsg(15003), MessageBoxButton.YesNo, MessageBoxImage.Information) = MessageBoxResult.Yes Then
MyMachGroupPanelM.DuploSetToDelete(m_BTLPartM.nPartId)
@@ -1767,7 +1767,7 @@ Public Class BTLPartVM
Public Sub Invert()
' eseguo inversione
- m_BTLPartM.Inversion(CurrentMachine.nType)
+ m_BTLPartM.Inversion(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
' setto part e tutte le feature da ricalcolare
ResetCalcTotalPart()
EgtDraw()
@@ -1788,7 +1788,7 @@ Public Class BTLPartVM
End Property
Public Sub BackRotation()
- Rotation(False, CurrentMachine.nType)
+ Rotation(False, Map.refProjectVM.BTLStructureVM.nPROJTYPE)
End Sub
#End Region ' BackRotation
@@ -1805,7 +1805,7 @@ Public Class BTLPartVM
End Property
Public Sub ForwardRotation()
- Rotation(True, CurrentMachine.nType)
+ Rotation(True, Map.refProjectVM.BTLStructureVM.nPROJTYPE)
End Sub
#End Region ' ForwardRotation
diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLParam/BTLStructureVM.vb b/EgtBEAMWALL.ViewerOptimizer/BTLParam/BTLStructureVM.vb
index 23802717..abecd5cb 100644
--- a/EgtBEAMWALL.ViewerOptimizer/BTLParam/BTLStructureVM.vb
+++ b/EgtBEAMWALL.ViewerOptimizer/BTLParam/BTLStructureVM.vb
@@ -68,7 +68,7 @@ Public Class BTLStructureVM
Map.refShowBeamPanelVM.bShowAll = False
' aggiorno vista
Dim view As VT = VT.ISO_SW
- If CurrentMachine.nType = Core.ConstBeam.MachineType.WALL Then view = VT.TOP
+ If Map.refProjectVM.BTLStructureVM.nPROJTYPE = Core.ConstBeam.MachineType.WALL Then view = VT.TOP
EgtSetView(view, False)
EgtZoom(ZM.ALL)
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
@@ -76,11 +76,9 @@ Public Class BTLStructureVM
EgtResetCurrMachGroup()
' seleziono pezzo nella scena
SceneSelPartSelection()
- ' resetto selezione machgroup
- Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup = Nothing
' aggiorno vista
Dim view As VT = VT.ISO_SW
- If CurrentMachine.nType = Core.ConstBeam.MachineType.WALL Then view = VT.TOP
+ If Map.refProjectVM.BTLStructureVM.nPROJTYPE = Core.ConstBeam.MachineType.WALL Then view = VT.TOP
EgtSetView(view, False)
EgtZoom(ZM.ALL)
End If
@@ -226,15 +224,15 @@ Public Class BTLStructureVM
End Set
End Property
- Public Property sPROJTYPE As String
+ Public Property nPROJTYPE As BWType
Get
- Return m_BTLStructureM.m_sPROJTYPE
+ Return m_BTLStructureM.m_nPROJTYPE
End Get
- Set(value As String)
+ Set(value As BWType)
If EgtSetInfo(m_BTLStructureM.nBTLInfoId, BTL_GEN_PROJTYPE, value) Then
- m_BTLStructureM.m_sPROJTYPE = value
+ m_BTLStructureM.m_nPROJTYPE = value
Else
- NotifyPropertyChanged("sPROJTYPE")
+ NotifyPropertyChanged(NameOf(nPROJTYPE))
End If
End Set
End Property
@@ -836,7 +834,7 @@ Public Class BTLStructureVM
Friend Sub UpdateSection(NewPartSection As SectionXMaterial, OldPartSection As SectionXMaterial)
If IsNothing(BTLPartVMList) Then Return
- If CurrentMachine.nType = MachineType.BEAM Then
+ If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then
' verifico se era unico con vecchia sezione
If Not m_BTLPartVMList.Any(Function(x) x.Section = OldPartSection) Then
' nel caso seleziono filtro generico
@@ -849,7 +847,7 @@ Public Class BTLStructureVM
If Not m_SectionList.Any(Function(x) x = NewPartSection) Then
m_SectionList.Add(NewPartSection)
End If
- ElseIf CurrentMachine.nType = MachineType.WALL Then
+ ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
' se ruoto o inverto parete, la sezione non cambia
End If
End Sub
diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLParam/PartInRawPartListV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/BTLParam/PartInRawPartListV.xaml.vb
index fcb57d59..6cb15ba4 100644
--- a/EgtBEAMWALL.ViewerOptimizer/BTLParam/PartInRawPartListV.xaml.vb
+++ b/EgtBEAMWALL.ViewerOptimizer/BTLParam/PartInRawPartListV.xaml.vb
@@ -1,4 +1,5 @@
-Imports EgtBEAMWALL.Core
+Imports EgtUILib
+Imports EgtBEAMWALL.Core
Public Class PartInRawPartListV
@@ -6,8 +7,15 @@ Public Class PartInRawPartListV
If TypeOf sender Is DataGridRow Then
Dim Row As DataGridRow = DirectCast(sender, DataGridRow)
If Not IsNothing(Row) AndAlso Row.IsSelected Then
- Dim MyMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
- MyMachGroup.SelPart = MyMachGroup.SelPart
+ If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
+ Dim BeamMachGroup As BeamMachGroupVM = Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup
+ If EgtGetCurrMachGroup() = GDB_ID.NULL Then Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup = BeamMachGroup
+ BeamMachGroup.SelPart = BeamMachGroup.SelPart
+ ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL Then
+ Dim WallMachGroup As WallMachGroupVM = Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup
+ If EgtGetCurrMachGroup() = GDB_ID.NULL Then Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup = WallMachGroup
+ WallMachGroup.SelPart = WallMachGroup.SelPart
+ End If
End If
End If
End Sub
diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLParam/RawPartListV.xaml b/EgtBEAMWALL.ViewerOptimizer/BTLParam/RawPartListV.xaml
index d1b0663c..0c1d0bf8 100644
--- a/EgtBEAMWALL.ViewerOptimizer/BTLParam/RawPartListV.xaml
+++ b/EgtBEAMWALL.ViewerOptimizer/BTLParam/RawPartListV.xaml
@@ -140,6 +140,11 @@
+
+
+
diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLParam/RawPartListV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/BTLParam/RawPartListV.xaml.vb
index 372afa72..3d854ee9 100644
--- a/EgtBEAMWALL.ViewerOptimizer/BTLParam/RawPartListV.xaml.vb
+++ b/EgtBEAMWALL.ViewerOptimizer/BTLParam/RawPartListV.xaml.vb
@@ -1,3 +1,12 @@
Public Class RawPartListV
+ Private Sub RawPartList_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
+ If TypeOf sender Is DataGridRow Then
+ Dim Row As DataGridRow = DirectCast(sender, DataGridRow)
+ If Not IsNothing(Row) AndAlso Row.IsSelected Then
+ Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup = Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup
+ End If
+ End If
+ End Sub
+
End Class
diff --git a/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/InstrumentPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/InstrumentPanelV.xaml
index 6f7f68e3..98269b01 100644
--- a/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/InstrumentPanelV.xaml
+++ b/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/InstrumentPanelV.xaml
@@ -26,7 +26,8 @@
ToolTip="{Binding ChangeParam_ToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding ChangeParameter_Command}"
- Visibility="{Binding ChangeParam_Visibility}">
+ Visibility="{Binding ChangeParam_Visibility}"
+ IsEnabled="{Binding InstrumentPanel_IsEnabled}">
@@ -36,7 +37,7 @@
ToolTip="{Binding Verify_ToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding Verify_Command}"
- IsEnabled="{Binding Verify_IsEnabled}">
+ IsEnabled="{Binding InstrumentPanel_IsEnabled}">
diff --git a/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/MyInstrumentPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/MyInstrumentPanelVM.vb
index 8d8b90d5..cf5e7a0c 100644
--- a/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/MyInstrumentPanelVM.vb
+++ b/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/MyInstrumentPanelVM.vb
@@ -13,6 +13,16 @@ Public Class MyInstrumentPanelVM
End Get
End Property
+ Private m_InstrumentPanel_IsEnabled As Boolean = True
+ Public Property InstrumentPanel_IsEnabled As Boolean
+ Get
+ Return m_InstrumentPanel_IsEnabled
+ End Get
+ Set(value As Boolean)
+ m_InstrumentPanel_IsEnabled = value
+ End Set
+ End Property
+
Dim m_PrevBottomPanelPage As BottomPanelVM.PartFeatureTab = BottomPanelVM.PartFeatureTab.STRUCTURE_
Private m_Statistics_IsChecked As Boolean = False
Public Property Statistics_IsChecked As Boolean
@@ -109,6 +119,11 @@ Public Class MyInstrumentPanelVM
End If
End Sub
+ Friend Sub SetInstrumentPanelIsEnabled(bIsEnabled As Boolean)
+ m_InstrumentPanel_IsEnabled = bIsEnabled
+ NotifyPropertyChanged(NameOf(InstrumentPanel_IsEnabled))
+ End Sub
+
#End Region ' METHODS
#Region "COMMANDS"
@@ -155,6 +170,8 @@ Public Class MyInstrumentPanelVM
''' Execute the Open. This method is invoked by the OpenCommand.
'''
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
Dim ChangeParameterWndVM As New ChangeParameterWndVM
Dim ChangeParameterWnd As New ChangeParameterWndV(Application.Current.MainWindow, ChangeParameterWndVM)
If ChangeParameterWnd.ShowDialog() Then
@@ -242,11 +259,13 @@ Public Class MyInstrumentPanelVM
''' Execute the Open. This method is invoked by the OpenCommand.
'''
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
Dim Calc As New CalcIntegration
Dim BarList() As CalcIntegration.Bar
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
If ((Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift) Then
- Dim TempBarList As New List(of CalcIntegration.Bar)
+ Dim TempBarList As New List(Of CalcIntegration.Bar)
For PartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1
Dim CurrPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList(PartIndex)
If Not CurrPart.bDO Then Continue For
@@ -283,6 +302,9 @@ Public Class MyInstrumentPanelVM
Else
Return
End If
+ ' disabilito interfaccia
+ Map.refProjectVM.ManageIsEnabled(False)
+ ' lancio calcolo
Calc.Run(BarList, Map.refProjManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
@@ -315,7 +337,7 @@ Public Class MyInstrumentPanelVM
Bar.nCmdType = CalcIntegration.CmdType.GENERATE
Case Else
Dim sMachGroupFilePath As String = Map.refProdManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe"
- If File.Exists( sMachGroupFilePath) Then File.Delete( sMachGroupFilePath)
+ If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
Bar.nCmdType = CalcIntegration.CmdType.CHECKGEN
End Select
TempBarList(0) = Bar
@@ -323,6 +345,9 @@ Public Class MyInstrumentPanelVM
Else
Return
End If
+ ' disabilito interfaccia
+ Map.refProjectVM.ManageIsEnabled(False)
+ ' lancio calcolo
Calc.Run(BarList, Map.refProdManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
End If
End Sub
@@ -384,6 +409,9 @@ Public Class MyInstrumentPanelVM
Else
Return
End If
+ ' disabilito interfaccia
+ Map.refProjectVM.ManageIsEnabled(False)
+ ' lancio simulazione
Calc.Run(BarList, Map.refProjManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
If Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
@@ -402,6 +430,9 @@ Public Class MyInstrumentPanelVM
Else
Return
End If
+ ' disabilito interfaccia
+ Map.refProjectVM.ManageIsEnabled(False)
+ ' lancio simulazione
Calc.Run(BarList, Map.refProdManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
End If
End Sub
diff --git a/EgtBEAMWALL.ViewerOptimizer/Integration/CalcIntegration.vb b/EgtBEAMWALL.ViewerOptimizer/Integration/CalcIntegration.vb
index 870f01f4..c49a9168 100644
--- a/EgtBEAMWALL.ViewerOptimizer/Integration/CalcIntegration.vb
+++ b/EgtBEAMWALL.ViewerOptimizer/Integration/CalcIntegration.vb
@@ -61,7 +61,14 @@ Public Class CalcIntegration
End If
Next
- callback(0.1, "", bCancel)
+ Dim bIsSimulation As Boolean = False
+ ' se sono in simulazione
+ If vBar.Count > 0 AndAlso vBar(0).nCmdType = CmdType.SIMULATE Then
+ bIsSimulation = True
+ callback(0, "Simulation opened", bCancel)
+ Else
+ callback(0.1, "", bCancel)
+ End If
Dim ExePath As String = String.Empty
GetMainPrivateProfileString(S_BEAM, K_CALCPATH, "", ExePath)
@@ -106,7 +113,7 @@ Public Class CalcIntegration
vProc(j).Proc = New Process()
vProc(j).Proc.StartInfo.FileName = ExePath
vProc(j).Proc.StartInfo.Arguments = """" & vBar(nCurrBar).sBarPath & """ " &
- """" & CurrentMachine.nType & """ " &
+ """" & Map.refProjectVM.BTLStructureVM.nPROJTYPE & """ " &
"""" & CurrentMachine.sMachineName & """ " & vBar(nCurrBar).nCmdType
vProc(j).Proc.StartInfo.UseShellExecute = False
@@ -156,27 +163,37 @@ Public Class CalcIntegration
End If
If bDone Then
- ' Dialog con Progress Bar
- nDoneBar += 1
- dProgress = 1 / numBars * nDoneBar
- Dim sProg As String = (dProgress * 100).ToString("F1", CultureInfo.InvariantCulture)
- callback(dProgress, " Progress: " & sProg & "% Count: " & nDoneBar & " / " & numBars, bCancel)
-
+ ' se non sono in simulazione
+ If bIsSimulation Then
+ callback(0, "Simulation closing", bCancel)
+ Else
+ ' Dialog con Progress Bar
+ nDoneBar += 1
+ dProgress = 1 / numBars * nDoneBar
+ Dim sProg As String = (dProgress * 100).ToString("F1", CultureInfo.InvariantCulture)
+ callback(dProgress, " Progress: " & sProg & "% Count: " & nDoneBar & " / " & numBars, bCancel)
+ End If
If bCancel Then
' fine
callback(1, "", bCancel)
+ ' riabilito interfaccia
+ Map.refProjectVM.ManageIsEnabled(True)
Map.refMyStatusBarVM.ResetStopProgress()
Return
End If
nPgsCurrBar = 0
nPgsClock = 0
Else
- If nPgsClock >= 100 AndAlso nPgsCurrBar < 149 Then
- nPgsCurrBar += 1
- dProgress = 1 / numBars * nDoneBar + 1 / numBars / 150 * nPgsCurrBar
- Dim sProg As String = (dProgress * 100).ToString("F1", CultureInfo.InvariantCulture)
- callback(dProgress, " Progress: " & sProg & "% Count: " & nDoneBar & " / " & numBars, bCancel)
- nPgsClock = 0
+ ' se non sono in simulazione
+ If Not bIsSimulation Then
+ ' aggiorno conteggio
+ If nPgsClock >= 100 AndAlso nPgsCurrBar < 149 Then
+ nPgsCurrBar += 1
+ dProgress = 1 / numBars * nDoneBar + 1 / numBars / 150 * nPgsCurrBar
+ Dim sProg As String = (dProgress * 100).ToString("F1", CultureInfo.InvariantCulture)
+ callback(dProgress, " Progress: " & sProg & "% Count: " & nDoneBar & " / " & numBars, bCancel)
+ nPgsClock = 0
+ End If
End If
End If
nPgsClock += 1
@@ -200,8 +217,14 @@ Public Class CalcIntegration
Thread.Sleep(300)
- ' fine
- callback(1, "Done", bCancel)
+ ' se sono in simulazione
+ If bIsSimulation Then
+ callback(1, "Simulation closed", bCancel)
+ Else
+ callback(1, "Done", bCancel)
+ End If
+ ' riabilito interfaccia
+ Map.refProjectVM.ManageIsEnabled(True)
Map.refMyStatusBarVM.ResetStopProgress()
End Sub
diff --git a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelV.xaml
index aab4e24e..b745dab5 100644
--- a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelV.xaml
+++ b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelV.xaml
@@ -51,26 +51,31 @@
Command="{Binding NewRawPart_Command}"
Visibility="{Binding MachiningPage_Visibility}"
ToolTip="{Binding NewRawPart_ToopTip}"
+ IsEnabled="{Binding LeftPanel_IsEnabled}"
Style="{StaticResource LeftPanel_SmallButton}"/>
= 2 AndAlso Not IsNothing(LogFile(1)) Then
- MessageBox.Show(LogFile(1), EgtMsg(30007), MessageBoxButton.OK, MessageBoxImage.Error)
+ If File.Exists(sLogPath) Then
+ Dim LogFile As String() = File.ReadAllLines(sLogPath)
+ If LogFile.Count >= 2 AndAlso Not IsNothing(LogFile(1)) Then
+ MessageBox.Show(LogFile(1), EgtMsg(30007), MessageBoxButton.OK, MessageBoxImage.Error)
+ End If
+ Else
+ MessageBox.Show("Impossible creating rawpart", EgtMsg(30007), MessageBoxButton.OK, MessageBoxImage.Error)
End If
Return
End If
@@ -208,6 +224,8 @@ Public Class LeftPanelVM
EgtSetInfo(nPartDuploId, MGR_PRT_POSY, dPosY)
EgtSetInfo(nPartDuploId, MGR_PRT_ROT, 0)
EgtSetInfo(nPartDuploId, MGR_PRT_FLIP, False)
+ ' aggiorno contatore pezzi usati in Prod
+ SelPart.RefreshPartInProd()
' aggiorno lista pezzi
WallMachGroup.m_WallMachGroupM.RefreshPartList()
WallMachGroup.m_WallMachGroupM.RefreshGroupData()
@@ -263,11 +281,19 @@ Public Class LeftPanelVM
If IsNothing(SelMachGroup) Then Return
' verifico se sono gia' stati messi tutti i pezzi richiesti
If Not VerifyPartCount(SelPart) Then Return
- If CurrentMachine.nType = MachineType.BEAM Then
+ ' verifico se impostato gruppo di lavorazione
+ Dim nCurrMachgroupId As Integer = EgtGetCurrMachGroup()
+ ' se nullo o diverso da quello selezionato in lista
+ If nCurrMachgroupId = GDB_ID.NULL OrElse nCurrMachgroupId <> SelMachGroup.Id Then
+ ' lo imposto
+ EgtSetCurrMachGroup(SelMachGroup.Id)
+ End If
+ If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then
Dim BeamMachGroup As BeamMachGroupVM = DirectCast(SelMachGroup, BeamMachGroupVM)
- ' verifico sezione
+ ' verifico sezione e materiale
If SelPart.dW < BeamMachGroup.dW - EPS_SMALL OrElse SelPart.dW > BeamMachGroup.dW + EPS_SMALL OrElse
- SelPart.dH < BeamMachGroup.dH - EPS_SMALL OrElse SelPart.dH > BeamMachGroup.dH + EPS_SMALL Then
+ SelPart.dH < BeamMachGroup.dH - EPS_SMALL OrElse SelPart.dH > BeamMachGroup.dH + EPS_SMALL OrElse
+ SelPart.Section <> BeamMachGroup.Section Then
MessageBox.Show(EgtMsg(61866), EgtMsg(30007))
Return
End If
@@ -283,7 +309,7 @@ Public Class LeftPanelVM
' aggiorno dati ultilizzo barra
BeamMachGroup.UpdateUsage()
EgtSetView(VT.ISO_SW, False)
- ElseIf CurrentMachine.nType = MachineType.WALL Then
+ ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
Dim WallMachGroup As WallMachGroupVM = DirectCast(SelMachGroup, WallMachGroupVM)
' verifico spessore
If SelPart.dH < WallMachGroup.dH - EPS_SMALL OrElse SelPart.dH > WallMachGroup.dH + EPS_SMALL Then
diff --git a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupPanelVM.vb
index ee7efd92..5b98278d 100644
--- a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupPanelVM.vb
+++ b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupPanelVM.vb
@@ -24,14 +24,14 @@ Public Class MyMachGroupPanelVM
Public ReadOnly Property sTotVolume As String
Get
- Dim dMMTotVolume As Double = Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.Sum(CType(Function(x As MyMachGroupVM) x.dUnitVolume, Func(Of MachGroupVM, Integer)))
+ Dim dMMTotVolume As Double = Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.Sum(CType(Function(x As MyMachGroupVM) x.dUnitVolume, Func(Of MachGroupVM, Double)))
Return If(EgtUiUnitsAreMM(), DoubleToString(dMMTotVolume / 1000000000, 3), DoubleToString(dMMTotVolume * (12 / ONEINCH), 3))
End Get
End Property
Public ReadOnly Property sTotTime As String
Get
- Return TimeSpan.FromSeconds(Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.Sum(CType(Function(x As MyMachGroupVM) x.nCALC_TIME, Func(Of MachGroupVM, Integer)))).ToString()
+ Return TimeSpan.FromSeconds(Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.Sum(CType(Function(x As MyMachGroupVM) x.nCALC_TIME, Func(Of MachGroupVM, Double)))).ToString()
End Get
End Property
@@ -180,20 +180,7 @@ Public Class MyMachGroupPanelVM
End Sub
Public Overrides Sub AddMachGroup()
- Dim MyMachGroupM As MyMachGroupM = m_MyMachGroupPanelM.NewMyMachGroup(CurrentMachine.sMachineName, CurrentMachine.nType)
- '' creo oggetto gruppo creato
- 'Dim sNewMachGroupName As String = String.Empty
- 'Dim sNewMachGroupMachineName As String = String.Empty
- 'EgtGetMachGroupName(nNewMachGroupID, sNewMachGroupName)
- 'EgtGetMachGroupMachineName(nNewMachGroupID, sNewMachGroupMachineName)
- 'Dim MyMachGroup As MyMachGroupM
- 'If Map.refMachinePanelVM.SelectedMachine.nType = MachineType.BEAM Then
- ' MyMachGroup = New BeamMachGroupVM(nNewMachGroupID, sNewMachGroupName, sNewMachGroupMachineName)
- 'Else
- ' MyMachGroup = New WallMachGroup(nNewMachGroupID, sNewMachGroupName, sNewMachGroupMachineName)
- 'End If
- '' lo aggiungo alla lista
- 'MachGroupList.Add(MyMachGroup)
+ Dim MyMachGroupM As MyMachGroupM = m_MyMachGroupPanelM.NewMyMachGroup(CurrentMachine.sMachineName, Map.refProjectVM.BTLStructureVM.nPROJTYPE)
' e lo seleziono
SelectedMachGroup = MachGroupVMList.FirstOrDefault(Function(x) x.MachGroupM Is MyMachGroupM)
End Sub
diff --git a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupVM.vb b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupVM.vb
index cdd60b82..bf9e404f 100644
--- a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupVM.vb
+++ b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/MyMachGroupVM.vb
@@ -259,15 +259,25 @@ Public MustInherit Class MyMachGroupVM
End Get
End Property
+ Public ReadOnly Property Section As SectionXMaterial
+ Get
+ Return New SectionXMaterial(dW, dH, dL, MyMachGroupM.sMATERIAL)
+ End Get
+ End Property
+
' definizione comandi
Private m_cmdDeleteMachGroup As ICommand
+#Region "CONSTRUCTORS"
+
Sub New(MyMachGroupM As MyMachGroupM)
MyBase.New(MyMachGroupM)
'aggiorno lista pezzi
RefreshPartList()
End Sub
+#End Region ' CONSTRUCTORS
+
#Region "METHODS"
Friend MustOverride Function Copy() As MyMachGroupVM
diff --git a/EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuV.xaml b/EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuV.xaml
index 5646b343..58146d44 100644
--- a/EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuV.xaml
+++ b/EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuV.xaml
@@ -1,7 +1,8 @@
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ Orientation="Horizontal"
+ IsEnabled="{Binding MainMenu_IsEnabled}">
diff --git a/EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuVM.vb b/EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuVM.vb
index 59f1b78e..d391dd4d 100644
--- a/EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuVM.vb
+++ b/EgtBEAMWALL.ViewerOptimizer/MainMenu/MainMenuVM.vb
@@ -1,5 +1,6 @@
Imports System.Collections.ObjectModel
Imports System.IO
+Imports EgtBEAMWALL.Core
Imports EgtBEAMWALL.Core.ConstBeam
Imports EgtUILib
Imports EgtWPFLib5
@@ -9,6 +10,13 @@ Public Class MainMenuVM
#Region "FIELDS & PROPERTIES"
+ Private m_MainMenu_IsEnabled As Boolean = True
+ Public ReadOnly Property MainMenu_IsEnabled As Boolean
+ Get
+ Return m_MainMenu_IsEnabled
+ End Get
+ End Property
+
Public Property View_IsChecked As Boolean
Get
Return m_SelPage = Pages.VIEW
@@ -130,6 +138,11 @@ Public Class MainMenuVM
#Region "METHODS"
+ Friend Sub SetMainMenuIsEnabled(bIsEnabled As Boolean)
+ m_MainMenu_IsEnabled = bIsEnabled
+ NotifyPropertyChanged(NameOf(MainMenu_IsEnabled))
+ End Sub
+
Private Function InitVIEW() As Boolean
Map.refProjectVM.SetBottomPanel_Visibility(True)
Map.refProjectVM.SetLeftPanel_Visibility(True)
@@ -143,14 +156,25 @@ Public Class MainMenuVM
Map.refProjectVM.NotifyAllPanelVisibility()
' apro progetto proj
If Not IsNothing(Map.refProjManagerVM.CurrProj) Then
- Map.refProjManagerVM.OpenProject(Map.refProjManagerVM.CurrProj)
+ If IsNothing(Map.refProjManagerVM.CurrProj) OrElse Map.refProjManagerVM.CurrProj.bReloadProject Then
+ Map.refProjManagerVM.OpenProject(Map.refProjManagerVM.CurrProj)
+ Else
+ ' verifico se il prod di provenienza ha piu' proj
+ If Not IsNothing(Map.refProdManagerVM.CurrProd) AndAlso Map.refProdManagerVM.CurrProd.nProjIdList.Count > 1 Then
+ ' se si rigenero BTLStructure
+ Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(Map.refProjManagerVM.CurrProj.nProjId))
+ End If
+ ' mostro tutti i pezzi
+ Map.refShowBeamPanelVM.ShowAll()
+ Map.refProjManagerVM.CurrProj.SetReloadProject(True)
+ End If
DbControllers.m_ProjController.LockByProjId(Map.refProjManagerVM.CurrProj.nProjId, True)
Else
Map.refSceneHostVM.MainController.NewProject()
Map.refProjectVM.BTLStructureVM = Nothing
Map.refProjectVM.MachGroupPanelVM = Nothing
End If
- Map.refMainWindowVM.NotifyPropertyChanged("nSelTabPage")
+ Map.refMainWindowVM.NotifyPropertyChanged(NameOf(Map.refMainWindowVM.nSelTabPage))
Map.refInstrumentPanelVM.NotifyPropertyChanged(NameOf(Map.refInstrumentPanelVM.ChangeParam_Visibility))
Return True
End Function
@@ -190,7 +214,17 @@ Public Class MainMenuVM
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
' apro progetto
- Map.refSceneHostVM.MainController.OpenProject(Map.refProdManagerVM.CurrProd.sProdPath, False)
+ If IsNothing(Map.refProdManagerVM.CurrProd) OrElse Map.refProdManagerVM.CurrProd.bReloadProject Then
+ Map.refSceneHostVM.MainController.OpenProject(Map.refProdManagerVM.CurrProd.sProdPath, False)
+ Else
+ ' verifico se il prod ha piu' proj
+ If Not IsNothing(Map.refProdManagerVM.CurrProd) AndAlso Map.refProdManagerVM.CurrProd.nProjIdList.Count > 1 Then
+ ' se si rigenero BTLStructure
+ Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(0))
+ End If
+ Map.refProjectVM.MachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList()))
+ Map.refProjManagerVM.CurrProj.SetReloadProject(True)
+ End If
'DbControllers.m_ProdController.ResetController()
DbControllers.m_ProdController.LockByProdId(Map.refProdManagerVM.CurrProd.nProdId, True)
' seleziono prima barra
@@ -225,7 +259,6 @@ Public Class MainMenuVM
Map.refProjectVM.SetShowBeamPanel_Visibility(True)
Map.refProjectVM.SetProjManager_Visibility(True)
Map.refProjectVM.SetProdManager_Visibility(False)
- Dim x = EgtGetEnableModified()
EgtResetCurrMachGroup()
Return True
End Function
diff --git a/EgtBEAMWALL.ViewerOptimizer/OpenProjectFileDialog/OpenProjectFileDialogV.xaml b/EgtBEAMWALL.ViewerOptimizer/OpenProjectFileDialog/OpenProjectFileDialogV.xaml
index aafe3394..42c42a0a 100644
--- a/EgtBEAMWALL.ViewerOptimizer/OpenProjectFileDialog/OpenProjectFileDialogV.xaml
+++ b/EgtBEAMWALL.ViewerOptimizer/OpenProjectFileDialog/OpenProjectFileDialogV.xaml
@@ -102,7 +102,8 @@
-
+
diff --git a/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OptimizePanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OptimizePanelVM.vb
index e4cf4f17..537790b5 100644
--- a/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OptimizePanelVM.vb
+++ b/EgtBEAMWALL.ViewerOptimizer/OptimizePanel/OptimizePanelVM.vb
@@ -6,6 +6,8 @@ Imports EgtWPFLib5
Public Class OptimizePanelVM
Inherits VMBase
+#Region "FIELDS & PROPERTIES"
+
Friend Enum PartType As Integer
MATERIAL = 0
ALL = 1
@@ -52,16 +54,13 @@ Public Class OptimizePanelVM
End Set
End Property
+ Private m_OptimizePanel_IsEnabled As Boolean = True
+ Public ReadOnly Property OptimizePanel_IsEnabled As Boolean
+ Get
+ Return m_OptimizePanel_IsEnabled
+ End Get
+ End Property
- ' Definizione comandi
- Private m_cmdOptimize As ICommand
- Private m_cmdWarehouse As ICommand
-
- Sub New()
- m_SelPartType = PartTypeList(0)
- m_SelOriginType = OriginTypeList(0)
- NotifyPropertyChanged(NameOf(SelPartType))
- End Sub
#Region "Messages"
@@ -79,6 +78,33 @@ Public Class OptimizePanelVM
#End Region ' Messages
+ ' Definizione comandi
+ Private m_cmdOptimize As ICommand
+ Private m_cmdWarehouse As ICommand
+
+#End Region ' FIELDS & PROPERTIES
+
+#Region "CONSTRUCTOR"
+
+ Sub New()
+ ' aggiungo riferimento a Map
+ Map.SetRefOptimizePanelVM(Me)
+ m_SelPartType = PartTypeList(0)
+ m_SelOriginType = OriginTypeList(0)
+ NotifyPropertyChanged(NameOf(SelPartType))
+ End Sub
+
+#End Region ' CONSTRUCTOR
+
+#Region "METHODS"
+
+ Friend Sub SetOptimizePanelIsEnabled(bIsEnabled As Boolean)
+ m_OptimizePanel_IsEnabled = bIsEnabled
+ NotifyPropertyChanged(NameOf(OptimizePanel_IsEnabled))
+ End Sub
+
+#End Region ' METHODS
+
#Region "COMMANDS"
#Region "Optimize"
@@ -105,6 +131,8 @@ Public Class OptimizePanelVM
Dim dSectionTime As Double = GetMainPrivateProfileDouble(S_NEST, K_SECTIONTIME, 1)
Dim dPartTime As Double = GetMainPrivateProfileDouble(S_NEST, K_PARTTIME, 1)
Dim SectionList As New List(Of SParam)
+ ' disabilito interfaccia
+ Map.refProjectVM.ManageIsEnabled(False)
' se ho selezionato nest per materiale e c'è una sezione selezionata diversa da sezione nulla
If m_SelPartType.Id = PartType.MATERIAL AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelSection) AndAlso Map.refProjectVM.BTLStructureVM.SelSection.dH <> -1 Then
SectionList.Add(New SParam(Map.refProjectVM.BTLStructureVM.SelSection, 0, 0))
@@ -126,7 +154,7 @@ Public Class OptimizePanelVM
Case WarehouseType.BASIC
Dim nQuantity As Integer = 0
sWarehouseIniPath = Map.refMainWindowVM.MainWindowM.sWarehouseDir & "\" & WH_BASIC_INI_FILE_NAME
- If CurrentMachine.nType = MachineType.BEAM Then
+ If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then
' leggo lunghezza barra
Dim nCurrentL As Integer = EgtUILib.GenInterface.GetPrivateProfileInt(WRH_BEAM, WRH_CURRENT & WRH_L, 1, sWarehouseIniPath)
dRawL = EgtUILib.GenInterface.GetPrivateProfileInt(WRH_BEAM, WRH_L & nCurrentL, 0, sWarehouseIniPath)
@@ -139,13 +167,17 @@ Public Class OptimizePanelVM
Section.dL = dRawL
Section.nQuantity = nQuantity
Next
- ElseIf CurrentMachine.nType = MachineType.WALL Then
+ ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
Dim nCurrentS As Integer = EgtUILib.GenInterface.GetPrivateProfileInt(WRH_WALL, WRH_CURRENT & WRH_S, nCurrentS, sWarehouseIniPath)
Dim sPanelDim As String = ""
Dim sPanelDims() As String
EgtUILib.GenInterface.GetPrivateProfileString(WRH_WALL, WRH_S & nCurrentS, "", sPanelDim, sWarehouseIniPath)
If Not String.IsNullOrWhiteSpace(sPanelDim) Then sPanelDims = sPanelDim.Split(","c)
- If Not sPanelDims.Count = 2 OrElse Not StringToDouble(sPanelDims(0), dRawL) OrElse Not StringToDouble(sPanelDims(1), dRawW) Then Return
+ If Not sPanelDims.Count = 2 OrElse Not StringToDouble(sPanelDims(0), dRawL) OrElse Not StringToDouble(sPanelDims(1), dRawW) Then
+ ' riabilito interfaccia
+ Map.refProjectVM.ManageIsEnabled(True)
+ Return
+ End If
' leggo start offset, offset e quantity
dOffset = EgtUILib.GenInterface.GetPrivateProfileDouble(WRH_WALL, WRH_OFFSET, 0, sWarehouseIniPath)
dKerf = EgtUILib.GenInterface.GetPrivateProfileDouble(WRH_WALL, WRH_KERF, 0, sWarehouseIniPath)
@@ -162,7 +194,7 @@ Public Class OptimizePanelVM
Dim nIndex As Integer = 1
sWarehouseIniPath = Map.refMainWindowVM.MainWindowM.sWarehouseDir & "\" & WH_MEDIUM_INI_FILE_NAME
' aggiungo le sezioni con diverse lunghezze in base al warehouse
- If CurrentMachine.nType = MachineType.BEAM Then
+ If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then
' leggo start offset ed offset
dStartOffset = EgtUILib.GenInterface.GetPrivateProfileDouble(WRH_BEAM, WRH_STARTOFFSET, 0, sWarehouseIniPath)
dOffset = EgtUILib.GenInterface.GetPrivateProfileDouble(WRH_BEAM, WRH_OFFSET, 0, sWarehouseIniPath)
@@ -177,13 +209,17 @@ Public Class OptimizePanelVM
Next
nIndex += 1
End While
- ElseIf CurrentMachine.nType = MachineType.WALL Then
+ ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
Dim nCurrentS As Integer = EgtUILib.GenInterface.GetPrivateProfileInt(WRH_WALL, WRH_CURRENT & WRH_S, nCurrentS, sWarehouseIniPath)
Dim sPanelDim As String = ""
Dim sPanelDims() As String
EgtUILib.GenInterface.GetPrivateProfileString(WRH_WALL, WRH_S & nCurrentS, "", sPanelDim, sWarehouseIniPath)
If Not String.IsNullOrWhiteSpace(sPanelDim) Then sPanelDims = sPanelDim.Split(","c)
- If Not sPanelDims.Count = 2 OrElse Not StringToDouble(sPanelDims(0), dRawL) OrElse Not StringToDouble(sPanelDims(1), dRawW) Then Return
+ If Not sPanelDims.Count = 2 OrElse Not StringToDouble(sPanelDims(0), dRawL) OrElse Not StringToDouble(sPanelDims(1), dRawW) Then
+ ' riabilito interfaccia
+ Map.refProjectVM.ManageIsEnabled(True)
+ Return
+ End If
dOffset = EgtUILib.GenInterface.GetPrivateProfileDouble(WRH_WALL, WRH_OFFSET, 0, sWarehouseIniPath)
dKerf = EgtUILib.GenInterface.GetPrivateProfileDouble(WRH_WALL, WRH_KERF, 0, sWarehouseIniPath)
' leggo lunghezza barra e quantity
@@ -217,6 +253,8 @@ Public Class OptimizePanelVM
Map.refMyStatusBarVM.EndLoading("Nesting completed")
' seleziono ultimo gruppo
Map.refProjectVM.MachGroupPanelVM.SelLastMachGroup()
+ ' riabilito interfaccia
+ Map.refProjectVM.ManageIsEnabled(True)
End Sub
#End Region ' Optimize
diff --git a/EgtBEAMWALL.ViewerOptimizer/PartManager/PartManagerV.xaml b/EgtBEAMWALL.ViewerOptimizer/PartManager/PartManagerV.xaml
index 71f37edd..b875633f 100644
--- a/EgtBEAMWALL.ViewerOptimizer/PartManager/PartManagerV.xaml
+++ b/EgtBEAMWALL.ViewerOptimizer/PartManager/PartManagerV.xaml
@@ -2,58 +2,77 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
+ xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"
Orientation="Horizontal"
- Height="28">
+ Height="28"
+ IsEnabled="{Binding PartManager_IsEnabled}">
-
-
-
+
-
+
-
+
-
-
-
diff --git a/EgtBEAMWALL.ViewerOptimizer/PartManager/PartManagerVM.vb b/EgtBEAMWALL.ViewerOptimizer/PartManager/PartManagerVM.vb
index 8081bddb..60f778a2 100644
--- a/EgtBEAMWALL.ViewerOptimizer/PartManager/PartManagerVM.vb
+++ b/EgtBEAMWALL.ViewerOptimizer/PartManager/PartManagerVM.vb
@@ -1,3 +1,22 @@
Public Class PartManagerVM
+ Inherits VMBase
+
+ Private m_PartManager_IsEnabled As Boolean = True
+ Public ReadOnly Property PartManager_IsEnabled As Boolean
+ Get
+ Return m_PartManager_IsEnabled
+ End Get
+ End Property
+
+ Sub New()
+ ' salvo riferimento in Map
+ Map.SetRefPartManagerVM(Me)
+ End Sub
+
+
+ Friend Sub SetPartManagerIsEnabled(bIsEnabled As Boolean)
+ m_PartManager_IsEnabled = bIsEnabled
+ NotifyPropertyChanged(NameOf(PartManager_IsEnabled))
+ End Sub
End Class
diff --git a/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerV.xaml b/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerV.xaml
index 600271a4..8e17bfa2 100644
--- a/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerV.xaml
+++ b/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerV.xaml
@@ -4,6 +4,7 @@
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
IsTopDockable="True" IsBottomDockable="False" IsLeftDockable="False"
IsRightDockable="False"
+ IsEnabled="{Binding ProdManager_IsEnabled}"
Style="{StaticResource ToolBar_EgtFloatingPanel}">
diff --git a/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerVM.vb b/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerVM.vb
index 978600d1..acd166d3 100644
--- a/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerVM.vb
+++ b/EgtBEAMWALL.ViewerOptimizer/ProdManager/ProdManagerVM.vb
@@ -11,6 +11,13 @@ Public Class ProdManagerVM
#Region "FIELDS & PROPERTIES"
+ Private m_ProdManager_IsEnabled As Boolean = True
+ Public ReadOnly Property ProdManager_IsEnabled As Boolean
+ Get
+ Return m_ProdManager_IsEnabled
+ End Get
+ End Property
+
Private m_CurrProd As ProdFileVM
Friend Property CurrProd As ProdFileVM
Get
@@ -102,6 +109,11 @@ Public Class ProdManagerVM
Return True
End Function
+ Friend Sub SetProdManagerIsEnabled(bIsEnabled As Boolean)
+ m_ProdManager_IsEnabled = bIsEnabled
+ NotifyPropertyChanged(NameOf(ProdManager_IsEnabled))
+ End Sub
+
#End Region ' METHODS
#Region "COMMANDS"
@@ -244,6 +256,8 @@ Public Class ProdManagerVM
End If
' apro progetto proj
Map.refProjManagerVM.SetCurrProj(nProjId)
+ ' ricarico progetto se il prod e' nullo (quindi e' stato cancellato)
+ Map.refProjManagerVM.CurrProj.SetReloadProject(IsNothing(CurrProd))
' vado in pagina proj
Map.refMainMenuVM.SetSelPage(Pages.VIEW, False)
End Sub
diff --git a/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerV.xaml b/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerV.xaml
index df83ba3e..ff8f60bc 100644
--- a/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerV.xaml
+++ b/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerV.xaml
@@ -4,6 +4,7 @@
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
IsTopDockable="True" IsBottomDockable="False" IsLeftDockable="False"
IsRightDockable="False"
+ IsEnabled="{Binding ProjManager_IsEnabled}"
Style="{StaticResource ToolBar_EgtFloatingPanel}">
diff --git a/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerVM.vb b/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerVM.vb
index 3a1275cf..ac931409 100644
--- a/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerVM.vb
+++ b/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerVM.vb
@@ -10,6 +10,13 @@ Public Class ProjManagerVM
#Region "FIELDS & PROPERTIES"
+ Private m_ProjManager_IsEnabled As Boolean = True
+ Public ReadOnly Property ProjManager_IsEnabled As Boolean
+ Get
+ Return m_ProjManager_IsEnabled
+ End Get
+ End Property
+
Private m_CurrProj As ProjFileVM
Friend Property CurrProj As ProjFileVM
Get
@@ -220,6 +227,11 @@ Public Class ProjManagerVM
Return SetCurrProj(CurrProj.nProjId)
End Function
+ Friend Sub SetProjManagerIsEnabled(bIsEnabled As Boolean)
+ m_ProjManager_IsEnabled = bIsEnabled
+ NotifyPropertyChanged(NameOf(ProjManager_IsEnabled))
+ End Sub
+
#End Region ' METHODS
#Region "COMMANDS"
@@ -337,6 +349,9 @@ Public Class ProjManagerVM
'''
Public Sub Save()
If IsNothing(CurrProj) Then Return
+ ' verifico se assemblato e lo annullo per salvataggio
+ Dim bShowBuilding As Boolean = Map.refShowBeamPanelVM.ShowBuilding_IsChecked
+ If bShowBuilding Then Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
Map.refSceneHostVM.SaveProject()
Map.refMainWindowVM.SetTitle(CurrProj.nProjId.ToString("0000") & " - " & CurrProj.sBTLFileName & " - EgtBEAMWALL")
' aggiorno BTLParts su DB
@@ -347,6 +362,8 @@ Public Class ProjManagerVM
DbControllers.m_ProjController.ResetNew(CurrProj.nProjId)
m_CurrProj.bIsNew = False
End If
+ ' se assemplato lo ripristino
+ If bShowBuilding Then Map.refProjectVM.BTLStructureVM.ShowBuilding(True, False)
' aggiorno titolo
Map.refMainWindowVM.UpdateTitle()
End Sub
@@ -425,15 +442,6 @@ Public Class ProjManagerVM
End If
Dim sProjFileName As String = sProjDir & "\" & nProjId.ToString("0000") & ".nge"
If bOk Then
- ' scrivo info proj su tutti i pezzi
- Dim nPartId = EgtGetFirstPart()
- While nPartId <> GDB_ID.NULL
- EgtSetInfo(nPartId, BTL_PRT_PROJ, nProjId)
- nPartId = EgtGetNextPart(nPartId)
- End While
- ' scrivo info proj su layer BtlInfo
- Dim nBTLInfoLayer As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
- EgtSetInfo(nBTLInfoLayer, BTL_PRT_PROJ, nProjId)
' salvo il progetto
bOk = EgtSaveFile(sProjFileName, NGE.CMPTEXT)
Else
@@ -780,6 +788,7 @@ Public Class ProjManagerVM
Dim nProdId As Integer = Map.refProjManagerVM.CurrProj.nProdId
If nProdId > 0 Then
Map.refProdManagerVM.SetCurrProd(nProdId)
+ Map.refProdManagerVM.CurrProd.SetReloadProject(False)
Else
'creo nuova ottimizzazione da progetto corrente
NewProdFromProj()
@@ -842,6 +851,7 @@ Public Class ProjManagerVM
'' End If
'' End If
'' Case MessageBoxResult.Cancel
+ '' m_bReloadProject = True
'' Return
''End Select
End If
diff --git a/EgtBEAMWALL.ViewerOptimizer/Project/ProjectV.xaml b/EgtBEAMWALL.ViewerOptimizer/Project/ProjectV.xaml
index f03f4b10..861b609c 100644
--- a/EgtBEAMWALL.ViewerOptimizer/Project/ProjectV.xaml
+++ b/EgtBEAMWALL.ViewerOptimizer/Project/ProjectV.xaml
@@ -42,7 +42,8 @@
DataContext="{Binding BTLStructure.SelPart}"
Visibility="{Binding DataContext.FeatureManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>-->
GDB_ID.NULL
- ' guardo se esiste info numero progetto a cui appartiene
- If Not EgtGetInfo(nPartId, PROJ, Map.refProjManagerVM.nLastProjId) Then
- EgtSetInfo(nPartId, PROJ, Map.refProjManagerVM.nLastProjId)
- End If
+ EgtSetInfo(nPartId, BTL_PRT_PROJ, Map.refProjManagerVM.nLoadingProjId)
nPartId = EgtGetNextPart(nPartId)
End While
+ ' scrivo info proj su layer BtlInfo
+ Dim nBTLInfoLayer As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
+ EgtSetInfo(nBTLInfoLayer, BTL_PRT_PROJ, Map.refProjManagerVM.nLoadingProjId)
' mostro tutti i pezzi
Map.refShowBeamPanelVM.ShowAll()
Else
@@ -751,13 +751,21 @@ Public Class MySceneHostVM
While nId <> GDB_ID.NULL
' Recupero l'identificativo del pezzo cui appartiene
Dim nPartId As Integer = EgtGetParent(EgtGetParent(nId))
+ Dim bFound As Boolean = False
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then
Dim nLayerId As Integer = EgtGetParent(nPartId)
Dim sLayerName As String = ""
EgtGetName(nLayerId, sLayerName)
- If sLayerName <> ASSEBASE Then Continue While
- Else
- If Not EgtIsPart(nPartId) Then Continue While
+ If sLayerName <> ASSEBASE Then
+ bFound = True
+ End If
+ End If
+ If Not EgtIsPart(nPartId) Then
+ bFound = True
+ End If
+ If Not bFound Then
+ nId = EgtGetNextObjInSelWin()
+ Continue While
End If
Dim nStat As Integer = GDB_ST.ON_
EgtGetStatus(nPartId, nStat)
diff --git a/EgtBEAMWALL.ViewerOptimizer/ShowBeamPanel/ShowBeamPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/ShowBeamPanel/ShowBeamPanelVM.vb
index dcce7e77..f80917f2 100644
--- a/EgtBEAMWALL.ViewerOptimizer/ShowBeamPanel/ShowBeamPanelVM.vb
+++ b/EgtBEAMWALL.ViewerOptimizer/ShowBeamPanel/ShowBeamPanelVM.vb
@@ -142,9 +142,10 @@ Public Class ShowBeamPanelVM
' mostro in parte bassa dati BTL
Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.STRUCTURE_)
' mostro tutti i pezzi
- Map.refProjectVM.BTLStructureVM.ShowAll()
+ Map.refProjectVM.BTLStructureVM.ShowAll(False)
' se attivata opzione, li assemblo
- Map.refProjectVM.BTLStructureVM.ShowBuilding(ShowBuilding_IsChecked)
+ Map.refProjectVM.BTLStructureVM.ShowBuilding(ShowBuilding_IsChecked, False)
+ EgtDraw()
End Sub
#End Region ' ShowAll
diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/OptimizerStatisticsV.xaml b/EgtBEAMWALL.ViewerOptimizer/Statistics/OptimizerStatisticsV.xaml
index 0b7635f2..fbbc4212 100644
--- a/EgtBEAMWALL.ViewerOptimizer/Statistics/OptimizerStatisticsV.xaml
+++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/OptimizerStatisticsV.xaml
@@ -15,10 +15,11 @@
CanUserResizeColumns="False"
CanUserResizeRows="False"
CanUserReorderColumns="False"
- SelectionMode="Single"
+ SelectionMode="Extended"
ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
+ x:Name="dgDisplay"
Margin="0,0,0,5">
@@ -32,12 +33,13 @@
-
+
+
diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/OptimizerStatisticsV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/Statistics/OptimizerStatisticsV.xaml.vb
index 0ad9a1e3..7e389bd7 100644
--- a/EgtBEAMWALL.ViewerOptimizer/Statistics/OptimizerStatisticsV.xaml.vb
+++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/OptimizerStatisticsV.xaml.vb
@@ -1,3 +1,20 @@
Public Class OptimizerStatisticsV
+ Private Sub cc() Handles PrintBtn.Click
+ ExportToExcelAndCsv()
+ End Sub
+
+ Private Sub ExportToExcelAndCsv()
+ dgDisplay.SelectAllCells()
+ dgDisplay.ClipboardCopyMode = DataGridClipboardCopyMode.IncludeHeader
+ ApplicationCommands.Copy.Execute(Nothing, dgDisplay)
+ Dim resultat As String = CType(Clipboard.GetData(DataFormats.CommaSeparatedValue), String)
+ Dim result As String = CType(Clipboard.GetData(DataFormats.Text), String)
+ dgDisplay.UnselectAllCells()
+ Dim file1 As System.IO.StreamWriter = New System.IO.StreamWriter("C:\Temp\test.csv")
+ file1.WriteLine(result.Replace(","c, " "c))
+ file1.Close()
+ MessageBox.Show(" Exporting DataGrid data to Excel file created.xls")
+ End Sub
+
End Class
diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/StatisticsVM.vb b/EgtBEAMWALL.ViewerOptimizer/Statistics/StatisticsVM.vb
index cf0a0fb7..958fcf38 100644
--- a/EgtBEAMWALL.ViewerOptimizer/Statistics/StatisticsVM.vb
+++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/StatisticsVM.vb
@@ -137,4 +137,29 @@ Public Class StatisticsVM
#End Region ' Messages
+ ' Definizione comandi
+ Private m_cmdPrint As ICommand
+
+#Region "COMMANDS"
+
+#Region "Invert"
+
+ Public ReadOnly Property Print_Command As ICommand
+ Get
+ If m_cmdPrint Is Nothing Then
+ m_cmdPrint = New Command(AddressOf Print)
+ End If
+ Return m_cmdPrint
+ End Get
+ End Property
+
+ Public Sub Print()
+
+ End Sub
+
+
+#End Region ' Invert
+
+#End Region ' COMMANDS
+
End Class
diff --git a/EgtBEAMWALL.ViewerOptimizer/TopPanel/TopPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/TopPanel/TopPanelV.xaml
index 65c073bf..3e892c40 100644
--- a/EgtBEAMWALL.ViewerOptimizer/TopPanel/TopPanelV.xaml
+++ b/EgtBEAMWALL.ViewerOptimizer/TopPanel/TopPanelV.xaml
@@ -2,7 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"
- Height="300">
+ Height="350">
@@ -56,20 +60,24 @@
Command="{Binding ReOrderPart_Command}"
Visibility="{Binding MovePart_Visibility}"
ToolTip="{Binding ReOrderPart_ToolTip}"
+ IsEnabled="{Binding TopPanel_IsEnabled}"
Style="{StaticResource LeftPanel_SmallButton}"/>
+