- disabilitato tutto quando sta importando progetto

- gestiti frame del pezzo e di stampa con z = 0
This commit is contained in:
Emmanuele Sassi
2023-03-13 16:20:28 +01:00
parent cbedfdc767
commit 0c2a5343ee
7 changed files with 59 additions and 8 deletions
+1
View File
@@ -5,6 +5,7 @@
Public Const PART = "Part"
Public Const PRINT_SOLID = "PrintSolid"
Public Const LAY_MACH_START = "MachStart"
Public Const LAY_PARTREFERENCE = "PartFrame"
Public Const LAY_REFERENCE = "Frame"
Public Const LAY_OTHERS = "Aux"
Public Const LAY_RIBS = "Ribs"
@@ -87,7 +87,7 @@ Public Class DispositionPanelVM
Get
If Not IsNothing(Map.refTopPanelVM.SelPart) Then
Dim ptReference As New Point3d
EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference)
EgtStartPoint(Map.refTopPanelVM.SelPart.nPartReferenceId, GDB_ID.ROOT, ptReference)
Return LenToString(ptReference.z, 1)
Else
Return ""
@@ -95,7 +95,7 @@ Public Class DispositionPanelVM
End Get
Set(value As String)
Dim ptReference As New Point3d
EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference)
EgtStartPoint(Map.refTopPanelVM.SelPart.nPartReferenceId, GDB_ID.ROOT, ptReference)
Dim dNewZPos As Double = ptReference.z
StringToLen(value, dNewZPos)
Dim b3Print As BBox3d = GetSolidForReferenceBBox(Map.refTopPanelVM.SelPart)
@@ -118,7 +118,7 @@ Public Class DispositionPanelVM
Friend Sub UpdateZPos()
Dim ptReference As New Point3d
EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference)
EgtStartPoint(Map.refTopPanelVM.SelPart.nPartReferenceId, GDB_ID.ROOT, ptReference)
Dim dNewZPos As Double = ptReference.z
Dim b3Print As BBox3d = GetSolidForReferenceBBox(Map.refTopPanelVM.SelPart)
Dim dMin As Double = 0
+3 -1
View File
@@ -451,6 +451,8 @@ Public Class ManagePartPanelVM
End Select
Next
' aggiungo layer riferimento
Dim nPartReferenceLayerId As Integer = EgtCreateGroup(nPartId)
EgtSetName(nPartReferenceLayerId, LAY_PARTREFERENCE)
Dim nReferenceLayerId As Integer = EgtCreateGroup(nPartId)
EgtSetName(nReferenceLayerId, LAY_REFERENCE)
EgtSetInfo(nReferenceLayerId, KEY_REFERENCE, ReferenceBtn.References.BL)
@@ -462,7 +464,7 @@ Public Class ManagePartPanelVM
EgtSetInfo(nPartId, FILE_PATH, sFilePath)
EgtSetInfo(nPartId, PART_NAME, ManagePart_Part.sName)
EgtSetInfo(nPartId, "PartOnTable", 1)
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nPartReferenceLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
Map.refTopPanelVM.PartList.Add(NewPart)
' aggiorno riferimento
Map.refReferencePanelVM.UpdateFramePosition(NewPart)
+3 -1
View File
@@ -718,6 +718,8 @@ Public Class GeomEntity_MenuItem
EgtSetName(nOthersLayerId, LAY_OTHERS)
EgtSetColor(nOthersLayerId, GeomEntityColors.c3Others)
' aggiungo riferimento
Dim nPartReferenceLayerId As Integer = EgtCreateGroup(nPartId)
EgtSetName(nPartReferenceLayerId, LAY_PARTREFERENCE)
Dim nReferenceLayerId As Integer = EgtCreateGroup(nPartId)
EgtSetName(nReferenceLayerId, LAY_REFERENCE)
EgtSetInfo(nReferenceLayerId, KEY_REFERENCE, ReferenceBtn.References.BL)
@@ -726,7 +728,7 @@ Public Class GeomEntity_MenuItem
' lo aggiungo a lista pezzi
EgtSetInfo(nPartId, FILE_PATH, sFilePath)
EgtSetInfo(nPartId, "PartOnTable", 1)
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nPartReferenceLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
Map.refTopPanelVM.PartList.Add(NewPart)
' aggiorno riferimento
Map.refReferencePanelVM.UpdateFramePosition(NewPart)
@@ -115,6 +115,10 @@ Public Class ReferencePanelVM
ElseIf EgtGetInfo(SelPart.nPartId, KEY_MOVEDPART2, vtMovedPart) Then
ptOrig = ptOrig - vtMovedPart
End If
Dim nPartFrameId As Integer = EgtCreateGeoFrame(SelPart.nPartReferenceLayerId, New Frame3d(ptOrig), GDB_RT.GLOB)
EgtSetStatus(nPartFrameId, GDB_ST.OFF)
' elimino componente Z
ptOrig = ptOrig + New Vector3d(0, 0, -ptOrig.z)
frPrintSolid = New Frame3d(ptOrig)
End If
Dim nFrameId As Integer = EgtCreateGeoFrame(SelPart.nReferenceLayerId, frPrintSolid, GDB_RT.GLOB)
+24 -1
View File
@@ -329,6 +329,15 @@ Public Class MySceneHostVM
WriteMainPrivateProfileString(S_PRINTING3D, K_IMPORTCURREXTENSION, OpenFileDialog.FilterIndex)
Dim sFile As String = String.Empty
sFile = OpenFileDialog.FileName
' disabilito ProjManager, TopPanel, TFS, Slider, bottoni e uscita dal programma
Map.refProjManagerVM.SetProjCmdIsEnabled(False)
Map.refTopPanelVM.SetTopPanelIsEnabled(False)
Map.refViewLayerManagerVM.SetViewLayerManagerIsEnabled(False)
Map.refTFSEditorVM.SetTFSEditorIsEnabled(False)
Map.refSliderManagerVM.SetLayerIndexIsEnabled(False)
Map.refSliderManagerVM.SetLayerAdvancementIsEnabled(False)
Map.refSliceManagerVM.SetButtonsIsEnabled(False)
Map.refInstrumentPanelVM.SetEdgeAnalysisIsEnabled(False)
' importo la nuova geometria
If MainController.InsertProject(sFile, False) Then
' la sposto in centro tavola
@@ -340,6 +349,15 @@ Public Class MySceneHostVM
Map.refTopPanelVM.SelPage = Pages.IMPORT
End If
EgtDraw()
' riabilito ProjManager, TopPanel e uscita dal programma
Map.refProjManagerVM.SetProjCmdIsEnabled(True)
Map.refTopPanelVM.SetTopPanelIsEnabled(True)
Map.refViewLayerManagerVM.SetViewLayerManagerIsEnabled(True)
Map.refTFSEditorVM.SetTFSEditorIsEnabled(True)
Map.refSliderManagerVM.SetLayerIndexIsEnabled(True)
Map.refSliderManagerVM.SetLayerAdvancementIsEnabled(True)
Map.refSliceManagerVM.SetButtonsIsEnabled(True)
Map.refInstrumentPanelVM.SetEdgeAnalysisIsEnabled(True)
End Sub
Public Sub InsertRib()
@@ -1075,9 +1093,14 @@ Public Class MySceneHostVM
Dim nOthersLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_OTHERS)
Dim sFilePath As String = ""
EgtGetInfo(nPartId, FILE_PATH, sFilePath)
Dim nPartReferenceLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_PARTREFERENCE)
If nPartReferenceLayerId = GDB_ID.NULL Then
nPartReferenceLayerId = EgtCreateGroup(nPartId)
EgtSetName(nPartReferenceLayerId, LAY_PARTREFERENCE)
End If
Dim nReferenceLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_REFERENCE)
Dim nFrameId As Integer = EgtGetFirstInGroup(nReferenceLayerId)
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nPartReferenceLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
Map.refTopPanelVM.PartList.Add(NewPart)
Dim bPartToRecalc As Boolean = False
EgtGetInfo(nPartId, MAC_TORECALC_SLICE, bPartToRecalc)
+21 -2
View File
@@ -25,7 +25,25 @@ Public Class Print3dPartVM
End Get
End Property
' riferimento del solido/superficie di stampa
' riferimento del pezzo solido/superficie da stampare
Private m_nPartReferenceLayerId As Integer = GDB_ID.NULL
Public ReadOnly Property nPartReferenceLayerId As Integer
Get
Return m_nPartReferenceLayerId
End Get
End Property
Private m_nPartReferenceId As Integer = GDB_ID.NULL
Public ReadOnly Property nPartReferenceId As Integer
Get
Dim nTemp As Integer = EgtGetFirstInGroup(nPartReferenceLayerId)
If nTemp <> GDB_ID.NULL Then
Return nTemp
Else
Return m_nReferenceId
End If
End Get
End Property
' riferimento di stampa del pezzo solido/superficie (sempre Z 0)
Private m_nReferenceLayerId As Integer = GDB_ID.NULL
Public ReadOnly Property nReferenceLayerId As Integer
Get
@@ -122,10 +140,11 @@ Public Class Print3dPartVM
m_sImportedFilePath = sImportedFilePath
End Sub
Sub New(nPartId As Integer, nPrintSolidLayerId As Integer, nReferenceLayerId As Integer, nReferenceId As Integer, nMachStartLayerId As Integer,
Sub New(nPartId As Integer, nPrintSolidLayerId As Integer, nPartReferenceLayerId As Integer, nReferenceLayerId As Integer, nReferenceId As Integer, nMachStartLayerId As Integer,
nRibsLayerId As Integer, nShellNumberLayerId As Integer, nAuxSolidsLayerId As Integer, nOthersLayerId As Integer, sImportedFilePath As String)
m_nPartId = nPartId
m_nPrintSolidLayerId = nPrintSolidLayerId
m_nPartReferenceLayerId = nPartReferenceLayerId
m_nReferenceLayerId = nReferenceLayerId
m_nReferenceId = nReferenceId
m_nMachStartLayerId = nMachStartLayerId