diff --git a/Icarus/CurrMachiningPanel/CurrMachining.vb b/Icarus/CurrMachiningPanel/CurrMachining.vb
index d740c98..d2cfeac 100644
--- a/Icarus/CurrMachiningPanel/CurrMachining.vb
+++ b/Icarus/CurrMachiningPanel/CurrMachining.vb
@@ -163,6 +163,21 @@ Public Class CurrMachining
End Select
End Sub
+ Friend Overrides Sub Save()
+ If bIsModified Then
+ ' salvo tutti i parametri su orig
+ SaveParams()
+ ' resetto stato di modificata
+ UpdateIsModified()
+ End If
+ End Sub
+
+ Protected Overrides Sub SaveParams()
+ For Each Cathegory In m_CathegoryList
+ Cathegory.SaveParams()
+ Next
+ End Sub
+
Friend Sub WriteCurrParamInPart(nPartId As Integer)
EgtSetInfo(nPartId, MAC_GUID, m_sCurrGUID.ToString())
For Each Cathegory As CurrMachiningCathegory In m_CathegoryList
@@ -253,12 +268,6 @@ Public Class CurrMachiningCathegory
End Select
End Sub
- Friend Sub SaveCurrParams()
- For Each Param In m_MachiningParamList
- Param.SaveParam()
- Next
- End Sub
-
Friend Sub ResetCurrParams()
For Each Param In m_MachiningParamList
Param.ResetParam()
diff --git a/Icarus/CurrMachiningPanel/CurrMachiningPanelV.xaml b/Icarus/CurrMachiningPanel/CurrMachiningPanelV.xaml
index b2875c4..4628a52 100644
--- a/Icarus/CurrMachiningPanel/CurrMachiningPanelV.xaml
+++ b/Icarus/CurrMachiningPanel/CurrMachiningPanelV.xaml
@@ -120,39 +120,39 @@
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
diff --git a/Icarus/CurrMachiningPanel/CurrMachiningPanelVM.vb b/Icarus/CurrMachiningPanel/CurrMachiningPanelVM.vb
index 4dd92b6..ed3ab3e 100644
--- a/Icarus/CurrMachiningPanel/CurrMachiningPanelVM.vb
+++ b/Icarus/CurrMachiningPanel/CurrMachiningPanelVM.vb
@@ -59,8 +59,23 @@ Public Class CurrMachiningPanelVM
End Property
Public Sub Ok()
+ ' verifico se modificata tipologia Ribs
+ Dim bIsModifiedRibsType As Boolean = False
+ Dim RibsCathegory As MachiningCathegory = CurrMachining.CathegoryList.FirstOrDefault(Function(x) x.Type = MachiningCathegory.Cathegories.RIBS)
+ If Not IsNothing(RibsCathegory) Then
+ Dim RibsTypeParam As MachiningParam = RibsCathegory.MachiningParamList.FirstOrDefault(Function(y) y.Type = MachiningParam.Params.RIBSTYPE)
+ If Not IsNothing(RibsTypeParam) Then
+ bIsModifiedRibsType = RibsTypeParam.bIsModified
+ End If
+ End If
' scrivo i parametri modificati
m_CurrMachining.WriteCurrParamInPart(Map.refTopPanelVM.SelPart.nPartId)
+ m_CurrMachining.Save()
+ ' se modificata tipologia Ribs, aggiorno posizione riferimento
+ If bIsModifiedRibsType Then
+ Map.refReferencePanelVM.UpdateFramePosition()
+ Map.refDispositionPanelVM.UpdateZPos()
+ End If
' ripristino modalita' standard
Map.refTopPanelVM.SelPage = Pages.MODIFY
End Sub
diff --git a/Icarus/DispositionPanel/DispositionPanelV.xaml b/Icarus/DispositionPanel/DispositionPanelV.xaml
index 7ad69dc..ca57e3e 100644
--- a/Icarus/DispositionPanel/DispositionPanelV.xaml
+++ b/Icarus/DispositionPanel/DispositionPanelV.xaml
@@ -28,12 +28,6 @@
Content="Move"
IsChecked="{Binding bMove_IsChecked}"
Style="{StaticResource ToolBar_TextToggleButton}"/>
-
-
-
-
diff --git a/Icarus/DispositionPanel/DispositionPanelVM.vb b/Icarus/DispositionPanel/DispositionPanelVM.vb
index 93028f6..b8f2dbe 100644
--- a/Icarus/DispositionPanel/DispositionPanelVM.vb
+++ b/Icarus/DispositionPanel/DispositionPanelVM.vb
@@ -20,25 +20,7 @@ Public Class DispositionPanelVM
EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference)
Dim dNewXPos As Double = ptReference.x
StringToLen(value, dNewXPos)
- Dim b3Print As New BBox3d
- EgtGetBBoxGlob(Map.refTopPanelVM.SelPart.nPrintSolidId, GDB_BB.EXACT, b3Print)
- If EgtGetGroupObjs(Map.refTopPanelVM.SelPart.nRibsLayerId) > 0 Then
- Dim b3Ribs As New BBox3d()
- Dim nRibId As Integer = EgtGetFirstInGroup(Map.refTopPanelVM.SelPart.nRibsLayerId)
- While nRibId <> GDB_ID.NULL
- Dim nRibType As Integer = Machining.MPAR_RIBSTYPE.INTERNAL
- EgtGetInfo(nRibId, MAC_RIBSTYPE, nRibType)
- If nRibType = Machining.MPAR_RIBSTYPE.EXTERNAL OrElse nRibType = Machining.MPAR_RIBSTYPE.UNBOUNDED Then
- Dim b3Rib As New BBox3d
- EgtGetBBoxGlob(nRibId, GDB_BB.EXACT, b3Rib)
- b3Ribs.Add(b3Rib)
- End If
- nRibId = EgtGetNext(nRibId)
- End While
- If b3Ribs.Min.x <> INFINITO Then
- b3Print.Add(b3Ribs)
- End If
- End If
+ Dim b3Print As BBox3d = GetSolidForReferenceBBox(Map.refTopPanelVM.SelPart)
Dim dMin As Double = 0
Dim dMax As Double = CurrentMachine.b3Tab.DimX
If b3Print.Max.x > ptReference.x Then
@@ -47,13 +29,16 @@ Public Class DispositionPanelVM
If b3Print.Min.x < ptReference.x Then
dMin += ptReference.x - b3Print.Min.x
End If
- If dNewXPos >= dMin AndAlso dNewXPos <= dMax Then
- EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(dNewXPos, ptReference.y, ptReference.z) - ptReference, GDB_RT.GLOB)
- Map.refReferencePanelVM.UpdateFramePosition()
- EgtDraw()
- Else
- NotifyPropertyChanged(NameOf(sXPos))
+ ' riduco a spostamento massimo
+ If dNewXPos < dMin Then
+ dNewXPos = dMin
+ ElseIf dNewXPos > dMax Then
+ dNewXPos = dMax
End If
+ EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(dNewXPos, ptReference.y, ptReference.z) - ptReference, GDB_RT.GLOB)
+ Map.refReferencePanelVM.UpdateFramePosition()
+ EgtDraw()
+ NotifyPropertyChanged(NameOf(sXPos))
End Set
End Property
@@ -72,25 +57,7 @@ Public Class DispositionPanelVM
EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference)
Dim dNewYPos As Double = ptReference.y
StringToLen(value, dNewYPos)
- Dim b3Print As New BBox3d
- EgtGetBBoxGlob(Map.refTopPanelVM.SelPart.nPrintSolidId, GDB_BB.EXACT, b3Print)
- If EgtGetGroupObjs(Map.refTopPanelVM.SelPart.nRibsLayerId) > 0 Then
- Dim b3Ribs As New BBox3d()
- Dim nRibId As Integer = EgtGetFirstInGroup(Map.refTopPanelVM.SelPart.nRibsLayerId)
- While nRibId <> GDB_ID.NULL
- Dim nRibType As Integer = Machining.MPAR_RIBSTYPE.INTERNAL
- EgtGetInfo(nRibId, MAC_RIBSTYPE, nRibType)
- If nRibType = Machining.MPAR_RIBSTYPE.EXTERNAL OrElse nRibType = Machining.MPAR_RIBSTYPE.UNBOUNDED Then
- Dim b3Rib As New BBox3d
- EgtGetBBoxGlob(nRibId, GDB_BB.EXACT, b3Rib)
- b3Ribs.Add(b3Rib)
- End If
- nRibId = EgtGetNext(nRibId)
- End While
- If b3Ribs.Min.x <> INFINITO Then
- b3Print.Add(b3Ribs)
- End If
- End If
+ Dim b3Print As BBox3d = GetSolidForReferenceBBox(Map.refTopPanelVM.SelPart)
Dim dMin As Double = 0
Dim dMax As Double = CurrentMachine.b3Tab.DimY
If b3Print.Max.y > ptReference.y Then
@@ -99,13 +66,16 @@ Public Class DispositionPanelVM
If b3Print.Min.y < ptReference.y Then
dMin += ptReference.y - b3Print.Min.y
End If
- If dNewYPos >= dMin AndAlso dNewYPos <= dMax Then
- EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(ptReference.x, dNewYPos, ptReference.z) - ptReference, GDB_RT.GLOB)
- Map.refReferencePanelVM.UpdateFramePosition()
- EgtDraw()
- Else
- NotifyPropertyChanged(NameOf(sYPos))
+ ' riduco a spostamento massimo
+ If dNewYPos < dMin Then
+ dNewYPos = dMin
+ ElseIf dNewyPos > dMax Then
+ dNewYPos = dMax
End If
+ EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(ptReference.x, dNewYPos, ptReference.z) - ptReference, GDB_RT.GLOB)
+ Map.refReferencePanelVM.UpdateFramePosition()
+ EgtDraw()
+ NotifyPropertyChanged(NameOf(sYPos))
End Set
End Property
@@ -124,16 +94,65 @@ Public Class DispositionPanelVM
EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference)
Dim dNewZPos As Double = ptReference.z
StringToLen(value, dNewZPos)
- If dNewZPos >= 0 Then
- EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(ptReference.x, ptReference.y, dNewZPos) - ptReference, GDB_RT.GLOB)
- Map.refReferencePanelVM.UpdateFramePosition()
- EgtDraw()
- Else
- NotifyPropertyChanged(NameOf(sZPos))
+ Dim b3Print As BBox3d = GetSolidForReferenceBBox(Map.refTopPanelVM.SelPart)
+ Dim dMin As Double = 0
+ If b3Print.Min.z < ptReference.z Then
+ dMin += ptReference.z - b3Print.Min.z
End If
+ ' riduco a spostamento massimo
+ If dNewZPos < dMin Then
+ dNewZPos = dMin
+ End If
+ EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(ptReference.x, ptReference.y, dNewZPos) - ptReference, GDB_RT.GLOB)
+ Map.refReferencePanelVM.UpdateFramePosition()
+ EgtDraw()
+ NotifyPropertyChanged(NameOf(sZPos))
End Set
End Property
+ Friend Sub UpdateZPos()
+ Dim ptReference As New Point3d
+ EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference)
+ Dim dNewZPos As Double = ptReference.z
+ Dim b3Print As BBox3d = GetSolidForReferenceBBox(Map.refTopPanelVM.SelPart)
+ Dim dMin As Double = 0
+ If b3Print.Min.z < ptReference.z Then
+ dMin += ptReference.z - b3Print.Min.z
+ End If
+ If ptReference.z < dMin Then
+ EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(ptReference.x, ptReference.y, dMin) - ptReference, GDB_RT.GLOB)
+ Map.refDispositionPanelVM.RefreshPos()
+ EgtDraw()
+ End If
+ NotifyPropertyChanged(NameOf(sZPos))
+ End Sub
+
+ ' funzione che calcola il box totale del solido da stampare piu' ribs esterne ed unbounded
+ Friend Function GetSolidForReferenceBBox(SelPart As Print3dPartVM) As BBox3d
+ Dim b3Print As New BBox3d
+ EgtGetBBoxGlob(SelPart.nPrintSolidId, GDB_BB.EXACT, b3Print)
+ If EgtGetGroupObjs(SelPart.nRibsLayerId) > 0 Then
+ Dim b3Ribs As New BBox3d()
+ Dim nRibId As Integer = EgtGetFirstInGroup(SelPart.nRibsLayerId)
+ While nRibId <> GDB_ID.NULL
+ Dim nRibType As Integer = Machining.MPAR_RIBSTYPE.INTERNAL
+ If Not EgtGetInfo(nRibId, MAC_RIBSTYPE, nRibType) Then
+ EgtGetInfo(SelPart.nPartId, MAC_RIBSTYPE, nRibType)
+ End If
+ If nRibType = Machining.MPAR_RIBSTYPE.EXTERNAL OrElse nRibType = Machining.MPAR_RIBSTYPE.UNBOUNDED Then
+ Dim b3Rib As New BBox3d
+ EgtGetBBoxGlob(nRibId, GDB_BB.EXACT, b3Rib)
+ b3Ribs.Add(b3Rib)
+ End If
+ nRibId = EgtGetNext(nRibId)
+ End While
+ If b3Ribs.Min.x <> INFINITO Then
+ b3Print.Add(b3Ribs)
+ End If
+ End If
+ Return b3Print
+ End Function
+
Private m_RotAxes As Boolean() = { False, False, False}
Public Property RotX As Boolean
Get
@@ -198,6 +217,7 @@ Public Class DispositionPanelVM
If EgtRotate(Map.refTopPanelVM.SelPart.nPartId, b3PrintSolid.Center, vtSelRotAxes, dNewAngle, GDB_RT.GLOB) Then
m_sRotAngle = 0
Map.refReferencePanelVM.UpdateFramePosition()
+ Map.refDispositionPanelVM.UpdateZPos()
RefreshPos()
EgtDraw()
NotifyPropertyChanged(NameOf(sRotAngle))
diff --git a/Icarus/MachiningDb/Machining.vb b/Icarus/MachiningDb/Machining.vb
index 4b52a02..88ed44b 100644
--- a/Icarus/MachiningDb/Machining.vb
+++ b/Icarus/MachiningDb/Machining.vb
@@ -169,7 +169,7 @@ Public Class Machining
NotifyPropertyChanged(NameOf(ghName))
End Sub
- Friend Sub Save()
+ Friend Overridable Sub Save()
If bIsModified Then
' salvo tutti i parametri su orig
SaveParams()
@@ -180,7 +180,7 @@ Public Class Machining
End If
End Sub
- Private Sub SaveParams()
+ Protected Overridable Sub SaveParams()
SaveName()
For Each Cathegory In m_CathegoryList
Cathegory.SaveParams()
diff --git a/Icarus/MachiningDb/MachiningDbV.xaml b/Icarus/MachiningDb/MachiningDbV.xaml
index 25f34ac..1e94ebf 100644
--- a/Icarus/MachiningDb/MachiningDbV.xaml
+++ b/Icarus/MachiningDb/MachiningDbV.xaml
@@ -11,7 +11,6 @@
-
@@ -72,7 +71,7 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -222,7 +223,7 @@
-
+