From 42970892ba818d640dea6af5ff2523389be1476d Mon Sep 17 00:00:00 2001 From: Emmanuele Sassi Date: Mon, 7 Nov 2022 16:31:02 +0100 Subject: [PATCH 1/3] - Aggiunto Others a lista di layer da visualizzare/nascondere --- Icarus/Constants/ConstIni.vb | 2 ++ Icarus/ViewLayerManager/ViewLayerManagerVM.vb | 14 +++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Icarus/Constants/ConstIni.vb b/Icarus/Constants/ConstIni.vb index 1aed02d..c0cd3a9 100644 --- a/Icarus/Constants/ConstIni.vb +++ b/Icarus/Constants/ConstIni.vb @@ -42,6 +42,7 @@ Public Module ConstIni Public Const K_MOD_AUXSOLIDS As String = "ModAuxSolids" Public Const K_MOD_SOLIDSLICE As String = "ModSolidSlice" Public Const K_MOD_SLICETOOLPATH As String = "ModSliceToolPath" + Public Const K_MOD_OTHERS As String = "ModOthers" Public Const K_SLC_PRINTSOLID As String = "SlcPrintSolid" Public Const K_SLC_REFERENCE As String = "SlcReference" Public Const K_SLC_STARTMACHINING As String = "SlcStartMAchining" @@ -50,6 +51,7 @@ Public Module ConstIni Public Const K_SLC_AUXSOLIDS As String = "SlcAuxSolids" Public Const K_SLC_SOLIDSLICE As String = "SlcSolidSlice" Public Const K_SLC_SLICETOOLPATH As String = "SlcSliceToolPath" + Public Const K_SLC_OTHERS As String = "SlcOthers" 'Public Const S_LUA As String = "Lua" 'Public Const K_LIBSDIR As String = "LibsDir" diff --git a/Icarus/ViewLayerManager/ViewLayerManagerVM.vb b/Icarus/ViewLayerManager/ViewLayerManagerVM.vb index edde313..bdda5f6 100644 --- a/Icarus/ViewLayerManager/ViewLayerManagerVM.vb +++ b/Icarus/ViewLayerManager/ViewLayerManagerVM.vb @@ -44,7 +44,8 @@ Public Class ViewLayerManagerVM New ViewLayer(ViewLayer.ViewLayerType.SHELL_NUMBER, "Reduce Shell Number", True), New ViewLayer(ViewLayer.ViewLayerType.AUX_SOLIDS, "Filled Solids", True), New ViewLayer(ViewLayer.ViewLayerType.SOLID_SLICE, "Solid Slice", True), - New ViewLayer(ViewLayer.ViewLayerType.SLICE_TOOLPATH, "Slice Toolpath", True)}) + New ViewLayer(ViewLayer.ViewLayerType.SLICE_TOOLPATH, "Slice Toolpath", True), + New ViewLayer(ViewLayer.ViewLayerType.OTHERS, "Others", True)}) End Sub Friend Sub ResetSolid() @@ -96,6 +97,7 @@ Public Class ViewLayer AUX_SOLIDS = 6 SOLID_SLICE = 7 SLICE_TOOLPATH = 8 + OTHERS = 9 End Enum Private m_Type As ViewLayerType @@ -223,6 +225,8 @@ Public Class ViewLayer EgtSetStatus(Entity, Status) Next Next + Case ViewLayerType.OTHERS + EgtSetStatus(CurrPart.nOthersLayerId, Status) End Select Next ' Ripristino stato segnalazione modifica @@ -273,6 +277,8 @@ Public Class ViewLayer nStatus = If(bSolid, GetMainPrivateProfileInt(S_VIEWLAYER, K_MOD_SOLIDSLICE, 1), 0) Case ViewLayerType.SLICE_TOOLPATH nStatus = GetMainPrivateProfileInt(S_VIEWLAYER, K_MOD_SLICETOOLPATH, 1) + Case ViewLayerType.OTHERS + nStatus = GetMainPrivateProfileInt(S_VIEWLAYER, K_MOD_OTHERS, 1) End Select Case Pages.SLICE Select Case m_Type @@ -292,6 +298,8 @@ Public Class ViewLayer nStatus = GetMainPrivateProfileInt(S_VIEWLAYER, K_SLC_SOLIDSLICE, 1) Case ViewLayerType.SLICE_TOOLPATH nStatus = GetMainPrivateProfileInt(S_VIEWLAYER, K_SLC_SLICETOOLPATH, 1) + Case ViewLayerType.OTHERS + nStatus = GetMainPrivateProfileInt(S_VIEWLAYER, K_SLC_OTHERS, 1) End Select End Select m_IsVisible = nStatus @@ -320,6 +328,8 @@ Public Class ViewLayer WriteMainPrivateProfileString(S_VIEWLAYER, K_MOD_SOLIDSLICE, nStatus) Case ViewLayerType.SLICE_TOOLPATH WriteMainPrivateProfileString(S_VIEWLAYER, K_MOD_SLICETOOLPATH, nStatus) + Case ViewLayerType.OTHERS + WriteMainPrivateProfileString(S_VIEWLAYER, K_MOD_OTHERS, nStatus) End Select Case Pages.SLICE Select Case m_Type @@ -339,6 +349,8 @@ Public Class ViewLayer WriteMainPrivateProfileString(S_VIEWLAYER, K_SLC_SOLIDSLICE, nStatus) Case ViewLayerType.SLICE_TOOLPATH WriteMainPrivateProfileString(S_VIEWLAYER, K_SLC_SLICETOOLPATH, nStatus) + Case ViewLayerType.OTHERS + WriteMainPrivateProfileString(S_VIEWLAYER, K_SLC_OTHERS, nStatus) End Select End Select End Sub From 4c4356dac7f3006c062f980414ba74aca0bb5777 Mon Sep 17 00:00:00 2001 From: Emmanuele Sassi Date: Mon, 14 Nov 2022 09:17:23 +0100 Subject: [PATCH 2/3] - correzione spostamento aggiuntivo riferimento su stampa a 45 gradi --- Icarus/ReferencePanel/ReferencePanelVM.vb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Icarus/ReferencePanel/ReferencePanelVM.vb b/Icarus/ReferencePanel/ReferencePanelVM.vb index cdc280d..b4e0a83 100644 --- a/Icarus/ReferencePanel/ReferencePanelVM.vb +++ b/Icarus/ReferencePanel/ReferencePanelVM.vb @@ -103,6 +103,9 @@ Public Class ReferencePanelVM Case ReferenceBtn.References.MC ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX + b3PrintSolid.DimX() / 2 * Vector3d.X_AX End Select + Dim vtMovedPart As Vector3d + EgtGetInfo(Map.refTopPanelVM.SelPart.nPrintSolidId, "MovedPart", vtMovedPart) + ptOrig = ptOrig - vtMovedPart frPrintSolid = New Frame3d(ptOrig) End If Dim nFrameId As Integer = EgtCreateGeoFrame(Map.refTopPanelVM.SelPart.nReferenceLayerId, frPrintSolid, GDB_RT.GLOB) From 60784d25888523599a868bb64ee1db1463985659 Mon Sep 17 00:00:00 2001 From: Emmanuele Sassi Date: Mon, 14 Nov 2022 13:27:58 +0100 Subject: [PATCH 3/3] - Cambiato modo di dichiarare materiali da costruttore - Disabilitato bottone cancella su materiali costruttore --- Icarus/MaterialDb/Material.vb | 44 +++++++++++++++++++++++++----- Icarus/MaterialDb/MaterialDbV.xaml | 13 ++++----- Icarus/MaterialDb/MaterialDbVM.vb | 31 ++++++++++++++++++++- 3 files changed, 73 insertions(+), 15 deletions(-) diff --git a/Icarus/MaterialDb/Material.vb b/Icarus/MaterialDb/Material.vb index 471bd98..074df78 100644 --- a/Icarus/MaterialDb/Material.vb +++ b/Icarus/MaterialDb/Material.vb @@ -674,6 +674,8 @@ End Class Public Class StringMaterialParam Inherits MaterialParam + Public Const DEFAULT_MATERIAL As String = "***" + Private m_sGUID As String Public Property sGUID As String Get @@ -715,10 +717,10 @@ Public Class StringMaterialParam End Get End Property - Private m_bIsReadOnly As Boolean = True - Public ReadOnly Property bIsReadOnly As Boolean + Private m_OrigButton_Visibility As Visibility = Visibility.Collapsed + Public ReadOnly Property OrigButton_Visibility As Visibility Get - Return m_bIsReadOnly + Return m_OrigButton_Visibility End Get End Property @@ -729,15 +731,18 @@ Public Class StringMaterialParam End Get End Property + ' Definizione comandi + Private m_cmdOriginal As ICommand + Sub New(Type As Params, nIndex As Integer) MyBase.New(Type) Select Case Type Case Params.ORIG Dim sOrigGUID As String = "" ReadMaterialParamString(nIndex, MAT_ORIG, "", sOrigGUID) - If sOrigGUID = "***" Then - m_sGUID = sOrigGUID - m_sValue = sOrigGUID + If sOrigGUID = DEFAULT_MATERIAL Then + m_sGUID = DEFAULT_MATERIAL + m_sValue = DEFAULT_MATERIAL ' se livello alto, lo visualizzo comunque If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 Then m_String_Visibility = Visibility.Visible @@ -757,7 +762,7 @@ Public Class StringMaterialParam End Select ' verifico chiave per assegnare readonly If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 Then - m_bIsReadOnly = False + m_OrigButton_Visibility = Visibility.Visible End If m_sOrigValue = m_sValue End Sub @@ -777,6 +782,31 @@ Public Class StringMaterialParam m_sValue = m_sOrigValue End Sub +#Region "COMMANDS" + +#Region "Original" + + Public ReadOnly Property Original_Command As ICommand + Get + If m_cmdOriginal Is Nothing Then + m_cmdOriginal = New Command(AddressOf Original) + End If + Return m_cmdOriginal + End Get + End Property + + Public Sub Original() + If MessageBox.Show("Are you sure you want to set this material as original?", "Original material confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then + m_sGUID = DEFAULT_MATERIAL + m_sValue = DEFAULT_MATERIAL + NotifyPropertyChanged(NameOf(sValue)) + End If + End Sub + +#End Region ' Original + +#End Region ' COMMANDS + End Class Public Class ComboMaterialParam diff --git a/Icarus/MaterialDb/MaterialDbV.xaml b/Icarus/MaterialDb/MaterialDbV.xaml index 830b587..38706de 100644 --- a/Icarus/MaterialDb/MaterialDbV.xaml +++ b/Icarus/MaterialDb/MaterialDbV.xaml @@ -101,16 +101,15 @@ - + Visibility="{Binding OrigButton_Visibility}" + Style="{StaticResource ToolBar_SmallButton}"/> diff --git a/Icarus/MaterialDb/MaterialDbVM.vb b/Icarus/MaterialDb/MaterialDbVM.vb index 71618e6..9a4b9dc 100644 --- a/Icarus/MaterialDb/MaterialDbVM.vb +++ b/Icarus/MaterialDb/MaterialDbVM.vb @@ -48,6 +48,9 @@ Public Class MaterialDbVM m_SelMaterial.CathegoryList(Index).Cathegory_IsExpanded = IsExpandedList(Index) Next End If + ' verifico abilitazione delete + m_Delete_IsEnabled = Not SelMaterialIsOriginal() + NotifyPropertyChanged(NameOf(Delete_IsEnabled)) End Set End Property @@ -73,6 +76,13 @@ Public Class MaterialDbVM m_bIsModified = value End Sub + Private m_Delete_IsEnabled As Boolean = True + Public ReadOnly Property Delete_IsEnabled As Boolean + Get + Return m_Delete_IsEnabled + End Get + End Property + ' Definizione comandi Private m_cmdOk As ICommand Private m_cmdCopy As ICommand @@ -105,8 +115,25 @@ Public Class MaterialDbVM GetMainPrivateProfileString(S_PRINTING3D, K_CURRMATERIAL, "", sCurrMaterial) m_SelMaterial = MaterialList.FirstOrDefault(Function(x) x.sGUID = sCurrMaterial) NotifyPropertyChanged(NameOf(SelMaterial)) + ' verifico abilitazione delete + m_Delete_IsEnabled = Not SelMaterialIsOriginal() + NotifyPropertyChanged(NameOf(Delete_IsEnabled)) End Sub + Private Function SelMaterialIsOriginal() As Boolean + ' verifico abilitazione delete + Dim General As MaterialCathegory = m_SelMaterial.CathegoryList.FirstOrDefault(Function(x) x.Type = MaterialCathegory.Cathegories.GENERAL) + If Not IsNothing(General) Then + Dim Original As MaterialParam = General.MaterialParamList.FirstOrDefault(Function(x) x.Type = MaterialParam.Params.ORIG) + If Not IsNothing(Original) Then + If DirectCast(Original, StringMaterialParam).sValue = StringMaterialParam.DEFAULT_MATERIAL Then + Return True + End If + End If + End If + Return False + End Function + #End Region ' METHODS #Region "COMMANDS" @@ -248,8 +275,10 @@ Public Class MaterialDbVM End Property Public Sub Delete() + ' se materiale originale, esco + If SelMaterialIsOriginal() Then Return ' chiedo conferma - Select Case MessageBox.Show("Sei sicuro di voler cancellare la lavorazione selezionata?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning) + Select Case MessageBox.Show("Are you sure you want to delete selected material?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning) Case MessageBoxResult.Yes m_MaterialList.Remove(m_SelMaterial) ' segno Db come modificato