Merge branch 'develop'
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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
|
||||
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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user