Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a666749d85 | |||
| a00170b37a | |||
| 00836e0695 | |||
| c822538fb7 | |||
| 9072dc3780 | |||
| a9ed233d77 | |||
| 0635302dac | |||
| 60784d2588 | |||
| 4c4356dac7 |
@@ -614,6 +614,10 @@ Public Class GeomEntity_MenuItem
|
||||
Map.refManagePartPanelVM.ImportedEntityList.Remove(m_OrigEntity)
|
||||
End If
|
||||
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
|
||||
Return
|
||||
ElseIf m_Type = ManagePart_Layer.LayerType.NEWPART Then
|
||||
@@ -708,6 +712,8 @@ Public Class GeomEntity_MenuItem
|
||||
Map.refManagePartPanelVM.ManagerPartList.Add(ManagePart_Part)
|
||||
' aggiorno riferimenti nel context menu item
|
||||
Map.refManagePartPanelVM.UpdateAllEntityContextMenu()
|
||||
' Imposto flag di ricalcolo slice
|
||||
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
|
||||
End Select
|
||||
Return
|
||||
End If
|
||||
@@ -809,6 +815,8 @@ Public Class GeomEntity_MenuItem
|
||||
m_OrigEntity.UpdateContextMenu()
|
||||
End If
|
||||
End If
|
||||
' Imposto flag di ricalcolo slice
|
||||
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
@@ -856,7 +864,7 @@ Public Class ManagerPart_MenuItem
|
||||
m_Type = Type
|
||||
End Sub
|
||||
|
||||
#Region "Cancel"
|
||||
#Region "Command"
|
||||
|
||||
Public ReadOnly Property MenuItem_Command As ICommand
|
||||
Get
|
||||
@@ -899,9 +907,11 @@ Public Class ManagerPart_MenuItem
|
||||
End Select
|
||||
' aggiorno riferimenti nel context menu item
|
||||
Map.refManagePartPanelVM.UpdateAllEntityContextMenu()
|
||||
' Imposto flag di ricalcolo slice
|
||||
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
#End Region ' Command
|
||||
|
||||
End Class
|
||||
@@ -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
|
||||
|
||||
@@ -101,16 +101,15 @@
|
||||
<TextBlock Text="{Binding sName}"/>
|
||||
<TextBox Grid.Column="1"
|
||||
Text="{Binding sValue}"
|
||||
IsReadOnly="{Binding bIsReadOnly}"/>
|
||||
<!--<Button Grid.Column="2"
|
||||
Content="R"
|
||||
Command="{Binding ResetParam_Command}"
|
||||
CommandParameter="dCurrStrandH"
|
||||
IsEnabled="{Binding bCurrStrandH_IsModified}"
|
||||
IsReadOnly="True"/>
|
||||
<Button Grid.Column="2"
|
||||
Content="O"
|
||||
Command="{Binding Original_Command}"
|
||||
VerticalContentAlignment="Center"
|
||||
HorizontalContentAlignment="Center"
|
||||
Margin="5,0,0,0"
|
||||
Style="{StaticResource ToolBar_SmallButton}"/>-->
|
||||
Visibility="{Binding OrigButton_Visibility}"
|
||||
Style="{StaticResource ToolBar_SmallButton}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type PrintApp:ComboMaterialParam}">
|
||||
|
||||
@@ -48,6 +48,9 @@ Public Class MaterialDbVM
|
||||
m_SelMaterial.CathegoryList(Index).Cathegory_IsExpanded = IsExpandedList(Index)
|
||||
Next
|
||||
End If
|
||||
' verifico abilitazione delete
|
||||
SetDeleteIsEnabled(Not SelMaterialIsOriginal())
|
||||
NotifyPropertyChanged(NameOf(Delete_IsEnabled))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -73,6 +76,21 @@ 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
|
||||
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
|
||||
Private m_cmdOk As ICommand
|
||||
Private m_cmdCopy As ICommand
|
||||
@@ -104,9 +122,32 @@ Public Class MaterialDbVM
|
||||
Dim sCurrMaterial As String = ""
|
||||
GetMainPrivateProfileString(S_PRINTING3D, K_CURRMATERIAL, "", 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))
|
||||
' verifico abilitazione delete
|
||||
If Not IsNothing(m_SelMaterial) Then
|
||||
SetDeleteIsEnabled(Not SelMaterialIsOriginal())
|
||||
NotifyPropertyChanged(NameOf(Delete_IsEnabled))
|
||||
End If
|
||||
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
|
||||
|
||||
#Region "COMMANDS"
|
||||
@@ -248,8 +289,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
|
||||
|
||||
@@ -60,5 +60,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.4.11.1")>
|
||||
<Assembly: AssemblyFileVersion("2.4.11.1")>
|
||||
<Assembly: AssemblyVersion("2.4.11.4")>
|
||||
<Assembly: AssemblyFileVersion("2.4.11.4")>
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -896,7 +896,8 @@ Public Class MySceneHostVM
|
||||
ProjectMaterial = Map.refTopPanelVM.MaterialList.FirstOrDefault(Function(x) x.sGUID = sMaterialGuid)
|
||||
End If
|
||||
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)
|
||||
End If
|
||||
If Not IsNothing(ProjectMaterial) Then
|
||||
|
||||
@@ -276,12 +276,19 @@ Public Class TopPanelVM
|
||||
' e la rimuovo
|
||||
m_MachiningList.Remove(MachiningIndex.Empty())
|
||||
End If
|
||||
' se nuova lavorazione e' none
|
||||
If SelMachining.sGUID = Guid.Empty AndAlso Not MachiningList.Any(Function(x) x.sGUID = MachiningIndex.Empty.sGUID) Then
|
||||
' aggiungo lavorazione vuota
|
||||
' se nuova lavorazione e' none o non è presente in lista
|
||||
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 e la seleziono
|
||||
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
|
||||
m_SelMachining = SelMachining
|
||||
NotifyPropertyChanged(NameOf(SelMachining))
|
||||
End Sub
|
||||
|
||||
|
||||
Reference in New Issue
Block a user