From 704a4becb4818cdfe638d0e04ed5d74e0011012d Mon Sep 17 00:00:00 2001 From: DarioS Date: Thu, 2 Feb 2023 11:50:57 +0100 Subject: [PATCH 1/7] Icarus : - merge develop in main. From 5db3c25d779d9a96184394d2967e6abf65f8f03d Mon Sep 17 00:00:00 2001 From: DarioS Date: Mon, 6 Feb 2023 12:32:14 +0100 Subject: [PATCH 2/7] Icarus : - piccole modifiche sugli spostamenti nella Disposizione. --- Icarus/DispositionPanel/DispositionPanelVM.vb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Icarus/DispositionPanel/DispositionPanelVM.vb b/Icarus/DispositionPanel/DispositionPanelVM.vb index b8f2dbe..e4d3dd7 100644 --- a/Icarus/DispositionPanel/DispositionPanelVM.vb +++ b/Icarus/DispositionPanel/DispositionPanelVM.vb @@ -39,6 +39,8 @@ Public Class DispositionPanelVM Map.refReferencePanelVM.UpdateFramePosition() EgtDraw() NotifyPropertyChanged(NameOf(sXPos)) + ' Imposto flag di ricalcolo part-program + EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_GENERATE, True) End Set End Property @@ -76,6 +78,8 @@ Public Class DispositionPanelVM Map.refReferencePanelVM.UpdateFramePosition() EgtDraw() NotifyPropertyChanged(NameOf(sYPos)) + ' Imposto flag di ricalcolo part-program + EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_GENERATE, True) End Set End Property @@ -107,6 +111,8 @@ Public Class DispositionPanelVM Map.refReferencePanelVM.UpdateFramePosition() EgtDraw() NotifyPropertyChanged(NameOf(sZPos)) + ' Imposto flag di ricalcolo part-program + EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_GENERATE, True) End Set End Property @@ -146,7 +152,7 @@ Public Class DispositionPanelVM End If nRibId = EgtGetNext(nRibId) End While - If b3Ribs.Min.x <> INFINITO Then + If Not b3Ribs.IsEmpty() Then b3Print.Add(b3Ribs) End If End If From 7934ad8fd5edbf938a3a18226e0fcd6300f40f1c Mon Sep 17 00:00:00 2001 From: DarioS Date: Wed, 8 Feb 2023 16:33:28 +0100 Subject: [PATCH 3/7] Icarus 2.5b2 : - correzione gestione assegnazione Ribs. --- Icarus/ManagePartPanel/ManagePartPanelVM.vb | 4 +++- Icarus/My Project/AssemblyInfo.vb | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Icarus/ManagePartPanel/ManagePartPanelVM.vb b/Icarus/ManagePartPanel/ManagePartPanelVM.vb index a294b78..d0f0cc2 100644 --- a/Icarus/ManagePartPanel/ManagePartPanelVM.vb +++ b/Icarus/ManagePartPanel/ManagePartPanelVM.vb @@ -359,15 +359,17 @@ Public Class ManagePartPanelVM nRibsLayerId = EgtCreateGroup(nPartId) EgtSetName(nRibsLayerId, LAY_RIBS) EgtSetColor(nRibsLayerId, GeomEntityColors.c3Rib) + Dim nRibsIndex As Integer = 1 For Each PartManager_GeomEntity In ManagePart_Layer.EntityList EgtSetInfo(PartManager_GeomEntity.nId, KEY_RIB_TYPE, RibEntity.RibTypes.FROMIMPORT) - EgtSetInfo(PartManager_GeomEntity.nId, RIB_ID, RibPanelVM.GetNextRibIndex()) + EgtSetInfo(PartManager_GeomEntity.nId, RIB_ID, nRibsIndex) EgtRelocateGlob(PartManager_GeomEntity.nId, nRibsLayerId, GDB_POS.LAST_SON) ' elimino colore entita' EgtResetColor(PartManager_GeomEntity.nId) If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName) End If + nRibsIndex += 1 Next Case ManagePart_Layer.LayerType.SHELL_NUMBER nShellNumberLayerId = EgtCreateGroup(nPartId) diff --git a/Icarus/My Project/AssemblyInfo.vb b/Icarus/My Project/AssemblyInfo.vb index 70eac1f..d97e750 100644 --- a/Icarus/My Project/AssemblyInfo.vb +++ b/Icarus/My Project/AssemblyInfo.vb @@ -70,5 +70,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + From 84863dc5d5e6856d2e4973f08140a36b0b0a7876 Mon Sep 17 00:00:00 2001 From: Emmanuele Sassi Date: Fri, 10 Feb 2023 11:01:46 +0100 Subject: [PATCH 4/7] - gestione colori in importazione - gestione visibilita' entita' in importazione - eliminazione marcatura pezzo selezionato - correzione su cancellazione pezzo --- Icarus/ManagePartPanel/ManagePartUtility.vb | 34 ++++++++++----- Icarus/OptionsWindow/OptionWindowVM.vb | 11 ++--- Icarus/RibParamPanel/CopyFromWndV.xaml | 1 + Icarus/TopPanel/TopPanelVM.vb | 22 +++++----- Icarus/Utility/GeomEntityColors.vb | 41 +++++++++++++++---- Icarus/ViewLayerManager/ViewLayerManagerVM.vb | 40 +++++++++--------- 6 files changed, 96 insertions(+), 53 deletions(-) diff --git a/Icarus/ManagePartPanel/ManagePartUtility.vb b/Icarus/ManagePartPanel/ManagePartUtility.vb index 75af836..d633638 100644 --- a/Icarus/ManagePartPanel/ManagePartUtility.vb +++ b/Icarus/ManagePartPanel/ManagePartUtility.vb @@ -1,4 +1,5 @@ Imports System.Collections.ObjectModel +Imports System.Windows.Forms.VisualStyles.VisualStyleElement Imports EgtUILib Imports EgtWPFLib5 @@ -375,10 +376,11 @@ Public Class ManagePart_Layer Public Enum LayerType As Integer PRINT_SOLID = 1 - MACH_START = 2 - RIBS = 3 - SHELL_NUMBER = 4 - AUX_SOLIDS = 5 + 'REFERENCE = 2 + MACH_START = 3 + RIBS = 4 + SHELL_NUMBER = 5 + AUX_SOLIDS = 6 OTHERS = 7 CHANGENAME = 15 DELETE = 16 @@ -666,6 +668,8 @@ Public Class GeomEntity_MenuItem NewLayer.EntityList.Add(m_OrigEntity) ' aggiorno riferimenti nell'entita' m_OrigEntity.UpdateOrigLayer(NewLayer) + ' aggiorno colore + EgtSetColor(m_OrigEntity.nId, GetColor(LayerType.PRINTPART)) End If End If ' aggiorno i contextmenu di tutti gli entity @@ -737,9 +741,10 @@ Public Class GeomEntity_MenuItem ' Imposto flag di ricalcolo slice EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True) End Select - '' aggiorno visibilita' da check di categoria - 'Dim PrintLayer As ViewLayer = Map.refViewLayerManagerVM.LayerList.FirstOrDefault(Function(x) x.Type = ViewLayer.ViewLayerType.PRINT_SOLID) - 'EgtSetStatus(m_OrigEntity.nId, If(IsNothing(PrintLayer.bIsVisible) OrElse PrintLayer.bIsVisible, GDB_ST.ON_, GDB_ST.OFF)) + ' aggiorno visibilita' da check di categoria + Dim PrintViewlayer As ViewLayer = Map.refViewLayerManagerVM.LayerList.FirstOrDefault(Function(x) x.Type = ViewLayer.ViewLayerType.PRINT_SOLID) + EgtSetStatus(m_OrigEntity.nId, If(IsNothing(PrintViewlayer.bIsVisible) OrElse PrintViewlayer.bIsVisible, GDB_ST.ON_, GDB_ST.OFF)) + EgtDraw() Return End If Select Case Map.refManagePartPanelVM.Type @@ -759,6 +764,12 @@ Public Class GeomEntity_MenuItem NewLayer.EntityList.Add(m_OrigEntity) ' aggiorno riferimenti nell'entita' m_OrigEntity.UpdateOrigLayer(NewLayer) + ' aggiorno colore + EgtSetColor(m_OrigEntity.nId, GetColor(m_Type)) + ' aggiorno visibilita' da check di categoria + Dim PrintViewlayer As ViewLayer = Map.refViewLayerManagerVM.LayerList.FirstOrDefault(Function(x) x.Type = m_Type) + EgtSetStatus(m_OrigEntity.nId, If(IsNothing(PrintViewlayer.bIsVisible) OrElse PrintViewlayer.bIsVisible, GDB_ST.ON_, GDB_ST.OFF)) + EgtDraw() End If End If ' aggiorno riferimenti nel context menu item @@ -786,7 +797,7 @@ Public Class GeomEntity_MenuItem ' elimino info vecchio layer Select Case m_OrigEntity.OrigLayer.Type Case ManagePart_Layer.LayerType.PRINT_SOLID - EgtResetMark(m_OrigEntity.nId) + 'EgtResetMark(m_OrigEntity.nId) ' se e' presente flag di spostamento a 45 gradi Dim nPartId As Integer = EgtGetParent(EgtGetParent(m_OrigEntity.nId)) Dim vtMoved As Vector3d @@ -930,7 +941,8 @@ Public Class ManagerPart_MenuItem Select Case Map.refManagePartPanelVM.Type Case ManagePartPanelVM.ManagePartType.IMPORT For Each Layer In m_OrigPart.LayerList - For Each Entity In Layer.EntityList + For EntityIndex = Layer.EntityList.Count - 1 To 0 Step -1 + Dim Entity As PartManager_GeomEntity = Layer.EntityList(EntityIndex) ' le rimuovo da lista entita' pezzo Layer.EntityList.Remove(Entity) ' la rimetto in lista importati @@ -953,7 +965,9 @@ Public Class ManagerPart_MenuItem ' aggiorno riferimenti nel context menu item Map.refManagePartPanelVM.UpdateAllEntityContextMenu() ' Imposto flag di ricalcolo slice - EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True) + If Not IsNothing(Map.refTopPanelVM.SelPart) Then ' in prima importazione non c'e' alcun pezzo selezionato + EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True) + End If End Select End Sub diff --git a/Icarus/OptionsWindow/OptionWindowVM.vb b/Icarus/OptionsWindow/OptionWindowVM.vb index 915fea8..655e310 100644 --- a/Icarus/OptionsWindow/OptionWindowVM.vb +++ b/Icarus/OptionsWindow/OptionWindowVM.vb @@ -1162,11 +1162,12 @@ Public Class LayerColor Public Enum LayerType As Integer PRINTPART = 1 - RIBS = 2 - SHELLNUMBERS = 3 - AUXSOLIDS = 4 - MACHSTART = 5 - OTHERS = 6 + 'REFERENCE = 2 + MACHSTART = 3 + RIBS = 4 + SHELLNUMBERS = 5 + AUXSOLIDS = 6 + OTHERS = 7 End Enum Private m_Type As LayerType diff --git a/Icarus/RibParamPanel/CopyFromWndV.xaml b/Icarus/RibParamPanel/CopyFromWndV.xaml index 5ab9d8f..6dc8457 100644 --- a/Icarus/RibParamPanel/CopyFromWndV.xaml +++ b/Icarus/RibParamPanel/CopyFromWndV.xaml @@ -5,6 +5,7 @@ Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}" Title="{Binding sTitle}" Icon="/Resources/Icarus.ico" WindowStyle="None" ResizeMode="NoResize" IsClosable="False" + WindowStartupLocation="CenterOwner" SizeToContent="WidthAndHeight"> diff --git a/Icarus/TopPanel/TopPanelVM.vb b/Icarus/TopPanel/TopPanelVM.vb index f3f876f..352caab 100644 --- a/Icarus/TopPanel/TopPanelVM.vb +++ b/Icarus/TopPanel/TopPanelVM.vb @@ -166,14 +166,14 @@ Public Class TopPanelVM End Get Set(value As Print3dPartVM) If Not IsNothing(m_SelPart) Then - ' deseleziono eventuale pezzo precedente - EgtResetMark(m_SelPart.nPrintSolidId) + '' deseleziono eventuale pezzo precedente + 'EgtResetMark(m_SelPart.nPrintSolidId) End If m_SelPart = value If Not IsNothing(value) Then ' Eseguo la selezione EgtDeselectAll() - EgtSetMark(m_SelPart.nPrintSolidId) + ' EgtSetMark(m_SelPart.nPrintSolidId) EgtDraw() ' imposto lavorazione e materiale del pezzo selezionato Map.refCurrMachiningPanelVM.ReadMachParamFromSelPart() @@ -553,10 +553,10 @@ Public Class TopPanelVM Map.refSliderManagerVM.SetLayerIndexIsEnabled(False) Map.refSliderManagerVM.SetLayerAdvancementIsEnabled(False) Map.refInstrumentPanelVM.SetEdgeAnalysisIsEnabled(False) - ' tolgo mark da pezzo selezionato - If Not IsNothing(SelPart) Then - EgtResetMark(SelPart.nPrintSolidId) - End If + '' tolgo mark da pezzo selezionato + 'If Not IsNothing(SelPart) Then + ' EgtResetMark(SelPart.nPrintSolidId) + 'End If ' imposto pagina Map.refLeftPanelVM.SetSelPanel(LeftPanelVM.Panels.MODIFYPART) End Sub @@ -569,10 +569,10 @@ Public Class TopPanelVM Map.refSliderManagerVM.SetLayerIndexIsEnabled(True) Map.refSliderManagerVM.SetLayerAdvancementIsEnabled(True) Map.refInstrumentPanelVM.SetEdgeAnalysisIsEnabled(True) - ' ripristino mark su pezzo selezionato - If Not IsNothing(SelPart) Then - EgtSetMark(SelPart.nPrintSolidId) - End If + '' ripristino mark su pezzo selezionato + 'If Not IsNothing(SelPart) Then + ' EgtSetMark(SelPart.nPrintSolidId) + 'End If Return True End Function diff --git a/Icarus/Utility/GeomEntityColors.vb b/Icarus/Utility/GeomEntityColors.vb index d1e807a..adc4022 100644 --- a/Icarus/Utility/GeomEntityColors.vb +++ b/Icarus/Utility/GeomEntityColors.vb @@ -5,11 +5,12 @@ Module GeomEntityColors Public Enum LayerType As Integer PRINTPART = 1 - RIBS = 2 - SHELLNUMBERS = 3 - AUXSOLIDS = 4 - MACHSTART = 5 - OTHERS = 6 + 'REFERENCE = 2 + MACHSTART = 3 + RIBS = 4 + SHELLNUMBERS = 5 + AUXSOLIDS = 6 + OTHERS = 7 ALL = 10 End Enum @@ -124,6 +125,23 @@ Module GeomEntityColors WritePrivateProfileColor(S_COLORS, sIniKey, c3Temp) UpdateColors(Type) End Sub + Friend Function GetColor(Type As LayerType) As Color3d + Dim sIniKey As String = "" + Select Case Type + Case LayerType.PRINTPART + Return c3Print + Case LayerType.RIBS + Return c3Rib + Case LayerType.SHELLNUMBERS + Return c3ShellNumber + Case LayerType.AUXSOLIDS + Return c3AuxSolids + Case LayerType.MACHSTART + Return c3MachStart + Case LayerType.OTHERS + Return c3Others + End Select + End Function Friend Sub SetAlpha(Type As LayerType, dAlpha As Double) Dim c3Temp As Color3d = c3Print Dim sIniKey As String = "" @@ -222,12 +240,21 @@ Module GeomEntityColors End While EgtSetColor(nOthersLayerId, GeomEntityColors.c3Others) End If - ' Ripristino stato segnalazione modifica DisableMgr.ReEnable() - nPartId = EgtGetNextPart(nPartId) End While + ' se in import, aggiorno anche i pezzi di import + If Map.refTopPanelVM.SelPage = Pages.IMPORT Then + For Each ImportPart In Map.refManagePartPanelVM.ManagerPartList + Dim Layer As ManagePart_Layer = ImportPart.LayerList.FirstOrDefault(Function(x) x.Type = Type) + If Not IsNothing(Layer) Then + For Each Entity In Layer.EntityList + EgtSetColor(Entity.nId, GetColor(Type)) + Next + End If + Next + End If EgtDraw() End Sub diff --git a/Icarus/ViewLayerManager/ViewLayerManagerVM.vb b/Icarus/ViewLayerManager/ViewLayerManagerVM.vb index 16e3386..5a25d3f 100644 --- a/Icarus/ViewLayerManager/ViewLayerManagerVM.vb +++ b/Icarus/ViewLayerManager/ViewLayerManagerVM.vb @@ -95,9 +95,9 @@ Public Class ViewLayer RIBS = 4 SHELL_NUMBER = 5 AUX_SOLIDS = 6 - SOLID_SLICE = 7 - SLICE_TOOLPATH = 8 - OTHERS = 9 + OTHERS = 7 + SOLID_SLICE = 8 + SLICE_TOOLPATH = 9 End Enum Private m_Type As ViewLayerType @@ -229,23 +229,23 @@ Public Class ViewLayer EgtSetStatus(CurrPart.nOthersLayerId, Status) End Select Next - '' se sono in importazione, dis/attivo anche queste superfici - 'If Map.refTopPanelVM.SelPage = Pages.IMPORT Then - ' For Each CurrPart In Map.refManagePartPanelVM.ManagerPartList - ' For Each Layer In CurrPart.LayerList - ' If (Layer.Type = ManagePart_Layer.LayerType.PRINT_SOLID AndAlso m_Type = ViewLayerType.PRINT_SOLID) OrElse - ' (Layer.Type = ManagePart_Layer.LayerType.MACH_START AndAlso m_Type = ViewLayerType.START_MACHINING) OrElse - ' (Layer.Type = ManagePart_Layer.LayerType.RIBS AndAlso m_Type = ViewLayerType.RIBS) OrElse - ' (Layer.Type = ManagePart_Layer.LayerType.SHELL_NUMBER AndAlso m_Type = ViewLayerType.SHELL_NUMBER) OrElse - ' (Layer.Type = ManagePart_Layer.LayerType.AUX_SOLIDS AndAlso m_Type = ViewLayerType.AUX_SOLIDS) OrElse - ' (Layer.Type = ManagePart_Layer.LayerType.OTHERS AndAlso m_Type = ViewLayerType.OTHERS) Then - ' For Each Entity In Layer.EntityList - ' EgtSetStatus(Entity.nId, Status) - ' Next - ' End If - ' Next - ' Next - 'End If + ' se sono in importazione, dis/attivo anche queste superfici + If Map.refTopPanelVM.SelPage = Pages.IMPORT Then + For Each CurrPart In Map.refManagePartPanelVM.ManagerPartList + For Each Layer In CurrPart.LayerList + If (Layer.Type = ManagePart_Layer.LayerType.PRINT_SOLID AndAlso m_Type = ViewLayerType.PRINT_SOLID) OrElse + (Layer.Type = ManagePart_Layer.LayerType.MACH_START AndAlso m_Type = ViewLayerType.START_MACHINING) OrElse + (Layer.Type = ManagePart_Layer.LayerType.RIBS AndAlso m_Type = ViewLayerType.RIBS) OrElse + (Layer.Type = ManagePart_Layer.LayerType.SHELL_NUMBER AndAlso m_Type = ViewLayerType.SHELL_NUMBER) OrElse + (Layer.Type = ManagePart_Layer.LayerType.AUX_SOLIDS AndAlso m_Type = ViewLayerType.AUX_SOLIDS) OrElse + (Layer.Type = ManagePart_Layer.LayerType.OTHERS AndAlso m_Type = ViewLayerType.OTHERS) Then + For Each Entity In Layer.EntityList + EgtSetStatus(Entity.nId, Status) + Next + End If + Next + Next + End If ' Ripristino stato segnalazione modifica DisableMgr.ReEnable() End Sub From 503616820b25a0204debe6ecdde6fc9df53521f9 Mon Sep 17 00:00:00 2001 From: Emmanuele Sassi Date: Fri, 10 Feb 2023 16:23:33 +0100 Subject: [PATCH 5/7] - modifica spostamento pezzo per stampa a 45 gradi --- Icarus/Constants/Const3dPrint.vb | 5 +++++ Icarus/DispositionPanel/DispositionPanelVM.vb | 13 +++++++++---- Icarus/ManagePartPanel/ManagePartUtility.vb | 8 ++++---- Icarus/ReferencePanel/ReferencePanelVM.vb | 7 +++++-- Icarus/SceneHost/MySceneHostVM.vb | 2 +- 5 files changed, 24 insertions(+), 11 deletions(-) diff --git a/Icarus/Constants/Const3dPrint.vb b/Icarus/Constants/Const3dPrint.vb index 9b85311..e72f458 100644 --- a/Icarus/Constants/Const3dPrint.vb +++ b/Icarus/Constants/Const3dPrint.vb @@ -154,9 +154,14 @@ ' materiale in progetto Public Const KEY_MATERIAL_GUID = "MaterialGuid" Public Const KEY_MATERIAL_NAME = "MaterialName" + ' nome file cn in progetto Public Const KEY_ISOFILE_PATH = "IsoFilePath" + ' info di spostamento pezzo per 45 gradi + Public Const KEY_MOVEDPART = "MovedPart" + Public Const KEY_MOVEDPART2 = "MovedPart2" + Public Const FILE_PATH = "FilePath" Public Const PART_NAME = "PartName" Public Const ENTITY_NAME = "EntityName" diff --git a/Icarus/DispositionPanel/DispositionPanelVM.vb b/Icarus/DispositionPanel/DispositionPanelVM.vb index e4d3dd7..cc4e4f0 100644 --- a/Icarus/DispositionPanel/DispositionPanelVM.vb +++ b/Icarus/DispositionPanel/DispositionPanelVM.vb @@ -210,13 +210,18 @@ Public Class DispositionPanelVM Return End If Dim vtMovedPart As Vector3d - if EgtGetInfo(Map.refTopPanelVM.SelPart.nPartId, "MovedPart", vtMovedPart) Then - Dim nEntId = EgtGetFirstInGroup( Map.refTopPanelVM.SelPart.nPrintSolidLayerId) + If EgtGetInfo(Map.refTopPanelVM.SelPart.nPartId, KEY_MOVEDPART, vtMovedPart) Then + Dim nEntId = EgtGetFirstInGroup(Map.refTopPanelVM.SelPart.nPrintSolidLayerId) While nEntId <> GDB_ID.NULL EgtMove(nEntId, -vtMovedPart, GDB_RT.GLOB) - nEntId = EgtGetNext( nEntId) + nEntId = EgtGetNext(nEntId) End While - EgtRemoveInfo(Map.refTopPanelVM.SelPart.nPartId, "MovedPart") + EgtRemoveInfo(Map.refTopPanelVM.SelPart.nPartId, KEY_MOVEDPART) + End If + If EgtGetInfo(Map.refTopPanelVM.SelPart.nPartId, KEY_MOVEDPART2, vtMovedPart) Then + EgtMove(Map.refTopPanelVM.SelPart.nPartId, -vtMovedPart, GDB_RT.GLOB) + EgtMove(Map.refTopPanelVM.SelPart.nReferenceId, vtMovedPart, GDB_RT.GLOB) + EgtRemoveInfo(Map.refTopPanelVM.SelPart.nPartId, KEY_MOVEDPART2) End If Dim b3PrintSolid As New BBox3d EgtGetBBoxGlob(Map.refTopPanelVM.SelPart.nPartId, GDB_BB.STANDARD, b3PrintSolid) diff --git a/Icarus/ManagePartPanel/ManagePartUtility.vb b/Icarus/ManagePartPanel/ManagePartUtility.vb index d633638..efeb459 100644 --- a/Icarus/ManagePartPanel/ManagePartUtility.vb +++ b/Icarus/ManagePartPanel/ManagePartUtility.vb @@ -641,7 +641,7 @@ Public Class GeomEntity_MenuItem End If ' se e' presente elimino flag di spostamento a 45 gradi Dim nPartId As Integer = EgtGetParent(EgtGetParent(m_OrigEntity.nId)) - EgtRemoveInfo(nPartId, "MovedPart") + EgtRemoveInfo(nPartId, KEY_MOVEDPART) EgtDraw() ' aggiorno riferimenti nel context menu item Map.refManagePartPanelVM.UpdateAllEntityContextMenu() @@ -801,10 +801,10 @@ Public Class GeomEntity_MenuItem ' se e' presente flag di spostamento a 45 gradi Dim nPartId As Integer = EgtGetParent(EgtGetParent(m_OrigEntity.nId)) Dim vtMoved As Vector3d - If EgtGetInfo(nPartId, "MovedPart", vtMoved) Then + If EgtGetInfo(nPartId, KEY_MOVEDPART, vtMoved) Then ' lo sposto e rimuovo info EgtMove(m_OrigEntity.nId, -vtMoved, GDB_RT.GLOB) - EgtRemoveInfo(nPartId, "MovedPart") + EgtRemoveInfo(nPartId, KEY_MOVEDPART) End If Case ManagePart_Layer.LayerType.MACH_START Case ManagePart_Layer.LayerType.RIBS @@ -836,7 +836,7 @@ Public Class GeomEntity_MenuItem EgtSetName(m_OrigEntity.nId, PRINT_SOLID) EgtSetColor(m_OrigEntity.nId, c3Print) ' rimuovo eventuale nota spostamento per 45 gradi - EgtRemoveInfo(m_OrigEntity.OrigLayer.OrigPart.nId, "MovedPart") + EgtRemoveInfo(m_OrigEntity.OrigLayer.OrigPart.nId, KEY_MOVEDPART) Case ManagePart_Layer.LayerType.MACH_START EgtSetName(m_OrigEntity.nId, LAY_MACH_START) EgtSetColor(m_OrigEntity.nId, c3MachStart) diff --git a/Icarus/ReferencePanel/ReferencePanelVM.vb b/Icarus/ReferencePanel/ReferencePanelVM.vb index 44efd03..a6cd4de 100644 --- a/Icarus/ReferencePanel/ReferencePanelVM.vb +++ b/Icarus/ReferencePanel/ReferencePanelVM.vb @@ -110,8 +110,11 @@ Public Class ReferencePanelVM ptOrig += b3ToBePrintSolid.DimY() / 2 * Vector3d.Y_AX + b3ToBePrintSolid.DimX() / 2 * Vector3d.X_AX End Select Dim vtMovedPart As Vector3d - EgtGetInfo(SelPart.nPartId, "MovedPart", vtMovedPart) - ptOrig = ptOrig - vtMovedPart + If EgtGetInfo(SelPart.nPartId, KEY_MOVEDPART, vtMovedPart) Then + ptOrig = ptOrig - vtMovedPart + ElseIf EgtGetInfo(SelPart.nPartId, KEY_MOVEDPART2, vtMovedPart) Then + ptOrig = ptOrig - vtMovedPart + End If frPrintSolid = New Frame3d(ptOrig) End If Dim nFrameId As Integer = EgtCreateGeoFrame(SelPart.nReferenceLayerId, frPrintSolid, GDB_RT.GLOB) diff --git a/Icarus/SceneHost/MySceneHostVM.vb b/Icarus/SceneHost/MySceneHostVM.vb index 28036c8..2b8a866 100644 --- a/Icarus/SceneHost/MySceneHostVM.vb +++ b/Icarus/SceneHost/MySceneHostVM.vb @@ -454,7 +454,7 @@ Public Class MySceneHostVM Map.refReferencePanelVM.UpdateFramePosition() Map.refDispositionPanelVM.UpdateZPos() ' elimino eventuale flag di spostamento a 45 gradi - EgtRemoveInfo(MenuItem.OrigLayer.OrigPart.PrintPart.nPartId, "MovedPart") + EgtRemoveInfo(MenuItem.OrigLayer.OrigPart.PrintPart.nPartId, KEY_MOVEDPART) ' elimino vecchio elemento ed aggiungo nuovo MenuItem.OrigLayer.EntityList.Clear() MenuItem.OrigLayer.EntityList.Add(New PartManager_GeomEntity(MenuItem.OrigLayer, nNewEntityId)) From daabc36730b6c071c1f829a5ddc18f7d820398f5 Mon Sep 17 00:00:00 2001 From: Emmanuele Sassi Date: Wed, 15 Feb 2023 12:14:32 +0100 Subject: [PATCH 6/7] - introduzione tipologie rib in ordinamento percorsi --- Icarus/MachiningDb/Machining.vb | 112 +++++++++++++++++++++----------- 1 file changed, 73 insertions(+), 39 deletions(-) diff --git a/Icarus/MachiningDb/Machining.vb b/Icarus/MachiningDb/Machining.vb index f3a135c..f678a37 100644 --- a/Icarus/MachiningDb/Machining.vb +++ b/Icarus/MachiningDb/Machining.vb @@ -59,7 +59,10 @@ Public Class Machining EXTRA_SHELL = 2 INFILL = 3 AUX_SOLID = 4 - RIB = 5 + RIB_UNBOUNDED = 5 + RIB_EXTERNAL = 6 + RIB_INTERNAL = 7 + RIB_SUPPORT = 8 End Enum Protected m_CathegoryList As New ObservableCollection(Of MachiningCathegory) @@ -1277,6 +1280,8 @@ End Class Public Class OrderedMachiningParam Inherits MachiningParam + Dim m_StandardValueOrderList As List(Of Integer) + Protected m_ValueList As ObservableCollection(Of IdNameStruct) Public ReadOnly Property ValueList As ObservableCollection(Of IdNameStruct) Get @@ -1312,48 +1317,44 @@ Public Class OrderedMachiningParam Set(value As String) Select Case Type Case Params.PRINT_ORDER - Dim StandardValueList() As String = {Machining.MPAR_PRINT_ORDER.SHELL, - Machining.MPAR_PRINT_ORDER.EXTRA_SHELL, - Machining.MPAR_PRINT_ORDER.INFILL, - Machining.MPAR_PRINT_ORDER.AUX_SOLID, - Machining.MPAR_PRINT_ORDER.RIB} - Dim StringValueList() As String = StandardValueList - If value.Length = 9 Then + Dim StringValueList() As String + Dim IntegerValueList As New List(Of Integer) + If value.Length = 15 Then StringValueList = value.Split(","c) + For Each StringValue In StringValueList + Dim IntegerValue As Integer = 0 + If Integer.TryParse(StringValue, IntegerValue) Then + IntegerValueList.Add(IntegerValue) + End If + Next End If - If StringValueList.Count <> 5 Then - StringValueList = StandardValueList + If IntegerValueList.Count <> 8 Then + IntegerValueList = m_StandardValueOrderList End If - If Not StringValueList.Contains(Machining.MPAR_PRINT_ORDER.SHELL) OrElse - Not StringValueList.Contains(Machining.MPAR_PRINT_ORDER.EXTRA_SHELL) OrElse - Not StringValueList.Contains(Machining.MPAR_PRINT_ORDER.INFILL) OrElse - Not StringValueList.Contains(Machining.MPAR_PRINT_ORDER.AUX_SOLID) OrElse - Not StringValueList.Contains(Machining.MPAR_PRINT_ORDER.RIB) Then - StringValueList = StandardValueList + If Not IntegerValueList.Contains(Machining.MPAR_PRINT_ORDER.SHELL) OrElse + Not IntegerValueList.Contains(Machining.MPAR_PRINT_ORDER.EXTRA_SHELL) OrElse + Not IntegerValueList.Contains(Machining.MPAR_PRINT_ORDER.INFILL) OrElse + Not IntegerValueList.Contains(Machining.MPAR_PRINT_ORDER.AUX_SOLID) OrElse + Not IntegerValueList.Contains(Machining.MPAR_PRINT_ORDER.RIB_UNBOUNDED) OrElse + Not IntegerValueList.Contains(Machining.MPAR_PRINT_ORDER.RIB_EXTERNAL) OrElse + Not IntegerValueList.Contains(Machining.MPAR_PRINT_ORDER.RIB_INTERNAL) OrElse + Not IntegerValueList.Contains(Machining.MPAR_PRINT_ORDER.RIB_SUPPORT) Then + IntegerValueList = m_StandardValueOrderList End If - m_ValueList.Clear() - For Each StringValue In StringValueList - Dim nValue As Integer = -1 - Integer.TryParse(StringValue, nValue) - Dim ItemList As IdNameStruct - Select Case nValue - Case Machining.MPAR_PRINT_ORDER.SHELL - ItemList = New IdNameStruct(Machining.MPAR_PRINT_ORDER.SHELL, "Shell") - Case Machining.MPAR_PRINT_ORDER.EXTRA_SHELL - ItemList = New IdNameStruct(Machining.MPAR_PRINT_ORDER.EXTRA_SHELL, "Extra Shell") - Case Machining.MPAR_PRINT_ORDER.INFILL - ItemList = New IdNameStruct(Machining.MPAR_PRINT_ORDER.INFILL, "Infill") - Case Machining.MPAR_PRINT_ORDER.AUX_SOLID - ItemList = New IdNameStruct(Machining.MPAR_PRINT_ORDER.AUX_SOLID, "Filled Solids") - Case Machining.MPAR_PRINT_ORDER.RIB - ItemList = New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB, "Ribs") - End Select - m_ValueList.Add(ItemList) - Next + OrderByReference(m_ValueList, IntegerValueList) End Select End Set End Property + Public Shared Sub OrderByReference(collection As ObservableCollection(Of IdNameStruct), comparison As List(Of Integer)) + For i As Integer = 0 To comparison.Count - 1 + Dim Index As Integer = i + If Not comparison.ElementAt(i).Equals(collection.ElementAt(i)) Then + collection.Move(collection.IndexOf(collection.FirstOrDefault(Function(x) x.Id = comparison(Index))), i) + End If + Next + End Sub + Public Overrides ReadOnly Property bIsModified As Boolean Get Return Value <> m_OrigValue @@ -1372,12 +1373,45 @@ Public Class OrderedMachiningParam Sub New(Type As Params, nIndex As Integer) MyBase.New(Type) If nIndex = 0 Then - m_ValueList = New ObservableCollection(Of IdNameStruct) - m_SelValue = Nothing + Select Case Type + Case Params.PRINT_ORDER + m_StandardValueOrderList = New List(Of Integer)({Machining.MPAR_PRINT_ORDER.SHELL, + Machining.MPAR_PRINT_ORDER.EXTRA_SHELL, + Machining.MPAR_PRINT_ORDER.INFILL, + Machining.MPAR_PRINT_ORDER.AUX_SOLID, + Machining.MPAR_PRINT_ORDER.RIB_UNBOUNDED, + Machining.MPAR_PRINT_ORDER.RIB_EXTERNAL, + Machining.MPAR_PRINT_ORDER.RIB_INTERNAL, + Machining.MPAR_PRINT_ORDER.RIB_SUPPORT}) + m_ValueList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_PRINT_ORDER.SHELL, "Shell"), + New IdNameStruct(Machining.MPAR_PRINT_ORDER.EXTRA_SHELL, "Extra Shells"), + New IdNameStruct(Machining.MPAR_PRINT_ORDER.INFILL, "Infills"), + New IdNameStruct(Machining.MPAR_PRINT_ORDER.AUX_SOLID, "Filled Solids"), + New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_UNBOUNDED, "Unbounded Ribs"), + New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_EXTERNAL, "External Ribs"), + New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_INTERNAL, "Internal Ribs"), + New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_SUPPORT, "Support Ribs")}) + m_SelValue = Nothing + End Select Else Select Case Type Case Params.PRINT_ORDER - m_ValueList = New ObservableCollection(Of IdNameStruct) + m_StandardValueOrderList = New List(Of Integer)({Machining.MPAR_PRINT_ORDER.SHELL, + Machining.MPAR_PRINT_ORDER.EXTRA_SHELL, + Machining.MPAR_PRINT_ORDER.INFILL, + Machining.MPAR_PRINT_ORDER.AUX_SOLID, + Machining.MPAR_PRINT_ORDER.RIB_UNBOUNDED, + Machining.MPAR_PRINT_ORDER.RIB_EXTERNAL, + Machining.MPAR_PRINT_ORDER.RIB_INTERNAL, + Machining.MPAR_PRINT_ORDER.RIB_SUPPORT}) + m_ValueList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_PRINT_ORDER.SHELL, "Shell"), + New IdNameStruct(Machining.MPAR_PRINT_ORDER.EXTRA_SHELL, "Extra Shells"), + New IdNameStruct(Machining.MPAR_PRINT_ORDER.INFILL, "Infills"), + New IdNameStruct(Machining.MPAR_PRINT_ORDER.AUX_SOLID, "Filled Solids"), + New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_UNBOUNDED, "Unbounded Ribs"), + New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_EXTERNAL, "External Ribs"), + New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_INTERNAL, "Internal Ribs"), + New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_SUPPORT, "Support Ribs")}) ReadMachiningParamString(nIndex, MAC_PRINTORDER, "", Value) End Select End If @@ -1465,9 +1499,9 @@ Public Class OrderedMachiningParam Public Sub ResetOrder() Dim CurrValue As String = Value + OrderByReference(m_ValueList, m_StandardValueOrderList) m_ValueList = New ObservableCollection(Of IdNameStruct)(m_ValueList.OrderBy(Function(x) x.Id)) If Value <> CurrValue Then - SelValue = Nothing NotifyPropertyChanged(NameOf(ValueList)) NotifyPropertyChanged(NameOf(Value)) NotifyPropertyChanged(NameOf(SelValue)) From a2574122940a23d1c44eb1575832840af10c69e6 Mon Sep 17 00:00:00 2001 From: Emmanuele Sassi Date: Wed, 15 Feb 2023 12:35:20 +0100 Subject: [PATCH 7/7] - introdotta gestione ordine ribs anche in CurrMachining --- Icarus/CurrMachiningPanel/CurrMachining.vb | 18 ++++++++++++++++-- Icarus/MachiningDb/Machining.vb | 2 +- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Icarus/CurrMachiningPanel/CurrMachining.vb b/Icarus/CurrMachiningPanel/CurrMachining.vb index 658dbf2..d79d33d 100644 --- a/Icarus/CurrMachiningPanel/CurrMachining.vb +++ b/Icarus/CurrMachiningPanel/CurrMachining.vb @@ -1016,7 +1016,22 @@ Public Class CurrOrderedMachiningParam Dim bReadFromPart As Boolean = False Select Case Type Case Params.PRINT_ORDER - m_ValueList = New ObservableCollection(Of IdNameStruct) + m_StandardValueOrderList = New List(Of Integer)({Machining.MPAR_PRINT_ORDER.SHELL, + Machining.MPAR_PRINT_ORDER.EXTRA_SHELL, + Machining.MPAR_PRINT_ORDER.INFILL, + Machining.MPAR_PRINT_ORDER.AUX_SOLID, + Machining.MPAR_PRINT_ORDER.RIB_UNBOUNDED, + Machining.MPAR_PRINT_ORDER.RIB_EXTERNAL, + Machining.MPAR_PRINT_ORDER.RIB_INTERNAL, + Machining.MPAR_PRINT_ORDER.RIB_SUPPORT}) + m_ValueList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_PRINT_ORDER.SHELL, "Shell"), + New IdNameStruct(Machining.MPAR_PRINT_ORDER.EXTRA_SHELL, "Extra Shells"), + New IdNameStruct(Machining.MPAR_PRINT_ORDER.INFILL, "Infills"), + New IdNameStruct(Machining.MPAR_PRINT_ORDER.AUX_SOLID, "Filled Solids"), + New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_UNBOUNDED, "Unbounded Ribs"), + New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_EXTERNAL, "External Ribs"), + New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_INTERNAL, "Internal Ribs"), + New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_SUPPORT, "Support Ribs")}) Dim sValue As String = "" bReadFromPart = EgtGetInfo(nPartId, MAC_PRINTORDER, sValue) Value = sValue @@ -1070,7 +1085,6 @@ Public Class CurrOrderedMachiningParam End Property Public Sub ResetParamCmd() - m_SelValue = Nothing Value = DbParam.OrigValue NotifyPropertyChanged(NameOf(Value)) NotifyPropertyChanged(NameOf(SelValue)) diff --git a/Icarus/MachiningDb/Machining.vb b/Icarus/MachiningDb/Machining.vb index f678a37..4aee8a2 100644 --- a/Icarus/MachiningDb/Machining.vb +++ b/Icarus/MachiningDb/Machining.vb @@ -1280,7 +1280,7 @@ End Class Public Class OrderedMachiningParam Inherits MachiningParam - Dim m_StandardValueOrderList As List(Of Integer) + Protected m_StandardValueOrderList As List(Of Integer) Protected m_ValueList As ObservableCollection(Of IdNameStruct) Public ReadOnly Property ValueList As ObservableCollection(Of IdNameStruct)