Compare commits

...

9 Commits

Author SHA1 Message Date
Emmanuele Sassi a666749d85 - Material none all'apertura se non definito o non riconosciuto 2022-11-23 10:36:31 +01:00
Emmanuele Sassi a00170b37a Icarus 2.4k4 :
- cambio di versione
2022-11-22 18:06:24 +01:00
Emmanuele Sassi 00836e0695 - correzione errore su creazione copia materiale
- migliorata gestione cancellazione materiale su con chiave di alto livello
2022-11-22 18:03:35 +01:00
Emmanuele Sassi c822538fb7 Icarus 2.4k3 :
- cambio versione
2022-11-14 21:14:17 +01:00
Emmanuele Sassi 9072dc3780 - correzioni apertura file con materiale o lavorazione non presenti 2022-11-14 21:11:53 +01:00
Emmanuele Sassi a9ed233d77 Merge branch 'NewImportModifyPart' 2022-11-14 20:14:00 +01:00
Emmanuele Sassi 0635302dac Merge branch 'develop' 2022-11-14 20:13:49 +01:00
Emmanuele Sassi 60784d2588 - Cambiato modo di dichiarare materiali da costruttore
- Disabilitato bottone cancella su materiali costruttore
2022-11-14 13:27:58 +01:00
Emmanuele Sassi 4c4356dac7 - correzione spostamento aggiuntivo riferimento su stampa a 45 gradi 2022-11-14 09:17:23 +01:00
8 changed files with 117 additions and 24 deletions
+12 -2
View File
@@ -614,6 +614,10 @@ Public Class GeomEntity_MenuItem
Map.refManagePartPanelVM.ImportedEntityList.Remove(m_OrigEntity) Map.refManagePartPanelVM.ImportedEntityList.Remove(m_OrigEntity)
End If End If
EgtDraw() EgtDraw()
' aggiorno riferimenti nel context menu item
Map.refManagePartPanelVM.UpdateAllEntityContextMenu()
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
End If End If
Return Return
ElseIf m_Type = ManagePart_Layer.LayerType.NEWPART Then ElseIf m_Type = ManagePart_Layer.LayerType.NEWPART Then
@@ -708,6 +712,8 @@ Public Class GeomEntity_MenuItem
Map.refManagePartPanelVM.ManagerPartList.Add(ManagePart_Part) Map.refManagePartPanelVM.ManagerPartList.Add(ManagePart_Part)
' aggiorno riferimenti nel context menu item ' aggiorno riferimenti nel context menu item
Map.refManagePartPanelVM.UpdateAllEntityContextMenu() Map.refManagePartPanelVM.UpdateAllEntityContextMenu()
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
End Select End Select
Return Return
End If End If
@@ -809,6 +815,8 @@ Public Class GeomEntity_MenuItem
m_OrigEntity.UpdateContextMenu() m_OrigEntity.UpdateContextMenu()
End If End If
End If End If
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
End Select End Select
End Sub End Sub
@@ -856,7 +864,7 @@ Public Class ManagerPart_MenuItem
m_Type = Type m_Type = Type
End Sub End Sub
#Region "Cancel" #Region "Command"
Public ReadOnly Property MenuItem_Command As ICommand Public ReadOnly Property MenuItem_Command As ICommand
Get Get
@@ -899,9 +907,11 @@ Public Class ManagerPart_MenuItem
End Select End Select
' aggiorno riferimenti nel context menu item ' aggiorno riferimenti nel context menu item
Map.refManagePartPanelVM.UpdateAllEntityContextMenu() Map.refManagePartPanelVM.UpdateAllEntityContextMenu()
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
End Select End Select
End Sub End Sub
#End Region ' Cancel #End Region ' Command
End Class End Class
+37 -7
View File
@@ -674,6 +674,8 @@ End Class
Public Class StringMaterialParam Public Class StringMaterialParam
Inherits MaterialParam Inherits MaterialParam
Public Const DEFAULT_MATERIAL As String = "***"
Private m_sGUID As String Private m_sGUID As String
Public Property sGUID As String Public Property sGUID As String
Get Get
@@ -715,10 +717,10 @@ Public Class StringMaterialParam
End Get End Get
End Property End Property
Private m_bIsReadOnly As Boolean = True Private m_OrigButton_Visibility As Visibility = Visibility.Collapsed
Public ReadOnly Property bIsReadOnly As Boolean Public ReadOnly Property OrigButton_Visibility As Visibility
Get Get
Return m_bIsReadOnly Return m_OrigButton_Visibility
End Get End Get
End Property End Property
@@ -729,15 +731,18 @@ Public Class StringMaterialParam
End Get End Get
End Property End Property
' Definizione comandi
Private m_cmdOriginal As ICommand
Sub New(Type As Params, nIndex As Integer) Sub New(Type As Params, nIndex As Integer)
MyBase.New(Type) MyBase.New(Type)
Select Case Type Select Case Type
Case Params.ORIG Case Params.ORIG
Dim sOrigGUID As String = "" Dim sOrigGUID As String = ""
ReadMaterialParamString(nIndex, MAT_ORIG, "", sOrigGUID) ReadMaterialParamString(nIndex, MAT_ORIG, "", sOrigGUID)
If sOrigGUID = "***" Then If sOrigGUID = DEFAULT_MATERIAL Then
m_sGUID = sOrigGUID m_sGUID = DEFAULT_MATERIAL
m_sValue = sOrigGUID m_sValue = DEFAULT_MATERIAL
' se livello alto, lo visualizzo comunque ' se livello alto, lo visualizzo comunque
If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 Then If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 Then
m_String_Visibility = Visibility.Visible m_String_Visibility = Visibility.Visible
@@ -757,7 +762,7 @@ Public Class StringMaterialParam
End Select End Select
' verifico chiave per assegnare readonly ' verifico chiave per assegnare readonly
If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 Then If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 Then
m_bIsReadOnly = False m_OrigButton_Visibility = Visibility.Visible
End If End If
m_sOrigValue = m_sValue m_sOrigValue = m_sValue
End Sub End Sub
@@ -777,6 +782,31 @@ Public Class StringMaterialParam
m_sValue = m_sOrigValue m_sValue = m_sOrigValue
End Sub 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 End Class
Public Class ComboMaterialParam Public Class ComboMaterialParam
+6 -7
View File
@@ -101,16 +101,15 @@
<TextBlock Text="{Binding sName}"/> <TextBlock Text="{Binding sName}"/>
<TextBox Grid.Column="1" <TextBox Grid.Column="1"
Text="{Binding sValue}" Text="{Binding sValue}"
IsReadOnly="{Binding bIsReadOnly}"/> IsReadOnly="True"/>
<!--<Button Grid.Column="2" <Button Grid.Column="2"
Content="R" Content="O"
Command="{Binding ResetParam_Command}" Command="{Binding Original_Command}"
CommandParameter="dCurrStrandH"
IsEnabled="{Binding bCurrStrandH_IsModified}"
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
HorizontalContentAlignment="Center" HorizontalContentAlignment="Center"
Margin="5,0,0,0" Margin="5,0,0,0"
Style="{StaticResource ToolBar_SmallButton}"/>--> Visibility="{Binding OrigButton_Visibility}"
Style="{StaticResource ToolBar_SmallButton}"/>
</Grid> </Grid>
</DataTemplate> </DataTemplate>
<DataTemplate DataType="{x:Type PrintApp:ComboMaterialParam}"> <DataTemplate DataType="{x:Type PrintApp:ComboMaterialParam}">
+44 -1
View File
@@ -48,6 +48,9 @@ Public Class MaterialDbVM
m_SelMaterial.CathegoryList(Index).Cathegory_IsExpanded = IsExpandedList(Index) m_SelMaterial.CathegoryList(Index).Cathegory_IsExpanded = IsExpandedList(Index)
Next Next
End If End If
' verifico abilitazione delete
SetDeleteIsEnabled(Not SelMaterialIsOriginal())
NotifyPropertyChanged(NameOf(Delete_IsEnabled))
End Set End Set
End Property End Property
@@ -73,6 +76,21 @@ Public Class MaterialDbVM
m_bIsModified = value m_bIsModified = value
End Sub 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
Friend Sub SetDeleteIsEnabled(value As Boolean)
If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 Then
m_Delete_IsEnabled = True
Else
m_Delete_IsEnabled = value
End If
NotifyPropertyChanged(NameOf(Delete_IsEnabled))
End Sub
' Definizione comandi ' Definizione comandi
Private m_cmdOk As ICommand Private m_cmdOk As ICommand
Private m_cmdCopy As ICommand Private m_cmdCopy As ICommand
@@ -104,9 +122,32 @@ Public Class MaterialDbVM
Dim sCurrMaterial As String = "" Dim sCurrMaterial As String = ""
GetMainPrivateProfileString(S_PRINTING3D, K_CURRMATERIAL, "", sCurrMaterial) GetMainPrivateProfileString(S_PRINTING3D, K_CURRMATERIAL, "", sCurrMaterial)
m_SelMaterial = MaterialList.FirstOrDefault(Function(x) x.sGUID = sCurrMaterial) m_SelMaterial = MaterialList.FirstOrDefault(Function(x) x.sGUID = sCurrMaterial)
If IsNothing(m_SelMaterial) AndAlso m_MaterialList.Count > 0 Then
m_SelMaterial = m_MaterialList(0)
End If
NotifyPropertyChanged(NameOf(SelMaterial)) NotifyPropertyChanged(NameOf(SelMaterial))
' verifico abilitazione delete
If Not IsNothing(m_SelMaterial) Then
SetDeleteIsEnabled(Not SelMaterialIsOriginal())
NotifyPropertyChanged(NameOf(Delete_IsEnabled))
End If
End Sub End Sub
Private Function SelMaterialIsOriginal() As Boolean
If IsNothing(m_SelMaterial) Then Return False
' 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 #End Region ' METHODS
#Region "COMMANDS" #Region "COMMANDS"
@@ -248,8 +289,10 @@ Public Class MaterialDbVM
End Property End Property
Public Sub Delete() Public Sub Delete()
' se materiale originale, esco
If SelMaterialIsOriginal() Then Return
' chiedo conferma ' 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 Case MessageBoxResult.Yes
m_MaterialList.Remove(m_SelMaterial) m_MaterialList.Remove(m_SelMaterial)
' segno Db come modificato ' segno Db come modificato
+2 -2
View File
@@ -60,5 +60,5 @@ Imports System.Windows
' by using the '*' as shown below: ' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.4.11.1")> <Assembly: AssemblyVersion("2.4.11.4")>
<Assembly: AssemblyFileVersion("2.4.11.1")> <Assembly: AssemblyFileVersion("2.4.11.4")>
@@ -103,6 +103,9 @@ Public Class ReferencePanelVM
Case ReferenceBtn.References.MC Case ReferenceBtn.References.MC
ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX + b3PrintSolid.DimX() / 2 * Vector3d.X_AX ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX + b3PrintSolid.DimX() / 2 * Vector3d.X_AX
End Select End Select
Dim vtMovedPart As Vector3d
EgtGetInfo(Map.refTopPanelVM.SelPart.nPrintSolidId, "MovedPart", vtMovedPart)
ptOrig = ptOrig - vtMovedPart
frPrintSolid = New Frame3d(ptOrig) frPrintSolid = New Frame3d(ptOrig)
End If End If
Dim nFrameId As Integer = EgtCreateGeoFrame(Map.refTopPanelVM.SelPart.nReferenceLayerId, frPrintSolid, GDB_RT.GLOB) Dim nFrameId As Integer = EgtCreateGeoFrame(Map.refTopPanelVM.SelPart.nReferenceLayerId, frPrintSolid, GDB_RT.GLOB)
+2 -1
View File
@@ -896,7 +896,8 @@ Public Class MySceneHostVM
ProjectMaterial = Map.refTopPanelVM.MaterialList.FirstOrDefault(Function(x) x.sGUID = sMaterialGuid) ProjectMaterial = Map.refTopPanelVM.MaterialList.FirstOrDefault(Function(x) x.sGUID = sMaterialGuid)
End If End If
If IsNothing(ProjectMaterial) Then If IsNothing(ProjectMaterial) Then
Dim sMaterialName As String = EgtSetInfo(nTabPartId, KEY_MATERIAL_GUID, Map.refTopPanelVM.SelMaterial.sName) Dim sMaterialName As String = ""
EgtGetInfo(nTabPartId, KEY_MATERIAL_NAME, Map.refTopPanelVM.SelMaterial.sName)
ProjectMaterial = Map.refTopPanelVM.MaterialList.FirstOrDefault(Function(x) x.sName = sMaterialName) ProjectMaterial = Map.refTopPanelVM.MaterialList.FirstOrDefault(Function(x) x.sName = sMaterialName)
End If End If
If Not IsNothing(ProjectMaterial) Then If Not IsNothing(ProjectMaterial) Then
+11 -4
View File
@@ -276,12 +276,19 @@ Public Class TopPanelVM
' e la rimuovo ' e la rimuovo
m_MachiningList.Remove(MachiningIndex.Empty()) m_MachiningList.Remove(MachiningIndex.Empty())
End If End If
' se nuova lavorazione e' none ' se nuova lavorazione e' none o non è presente in lista
If SelMachining.sGUID = Guid.Empty AndAlso Not MachiningList.Any(Function(x) x.sGUID = MachiningIndex.Empty.sGUID) Then If (IsNothing(SelMachining) OrElse SelMachining.sGUID = Guid.Empty OrElse Not MachiningList.Any(Function(x) x.sGUID = SelMachining.sGUID)) AndAlso Not MachiningList.Any(Function(x) x.sGUID = MachiningIndex.Empty.sGUID) Then
' aggiungo lavorazione vuota ' aggiungo lavorazione vuota e la seleziono
MachiningList.Insert(0, MachiningIndex.Empty()) MachiningList.Insert(0, MachiningIndex.Empty())
m_SelMachining = MachiningList(0)
' ' se lavorazione da selezionare non trovata
'ElseIf (SelMachining.sGUID = Guid.Empty OrElse Not MachiningList.Any(Function(x) x.sGUID = SelMachining.sGUID)) AndAlso Not MachiningList.Any(Function(x) x.sGUID = MachiningIndex.Empty.sGUID) Then
' ' aggiungo lavorazione vuota e la seleziono
' MachiningList.Insert(0, MachiningIndex.Empty())
' m_SelMachining = SelMachining
Else
m_SelMachining = SelMachining
End If End If
m_SelMachining = SelMachining
NotifyPropertyChanged(NameOf(SelMachining)) NotifyPropertyChanged(NameOf(SelMachining))
End Sub End Sub