- Introdotta ricerca layer di disegno

- Introdotta pagina di spostamento superfici tra i layer
- Introdotto funzionamento HorizontalSlider
This commit is contained in:
Emmanuele Sassi
2022-09-30 14:54:31 +02:00
parent 8713b7efef
commit 682c3d7756
13 changed files with 203 additions and 27 deletions
+1
View File
@@ -34,6 +34,7 @@ Public Module ConstGen
MATERIALDB = 5
MACHININGDB = 6
CURRMACHINING = 7
MODIFYPART = 8
End Enum
' MOdalita' di modifica
+1
View File
@@ -364,6 +364,7 @@ Public Class ImportPanelVM
EgtSetMode(nFrameId, GDB_MD.LOCKED)
End If
EgtSetInfo(nReferenceLayerId, KEY_REFERENCE, PrintSolidEntity.Reference)
EgtMove(nPartId, New Vector3d(0, 0, -b3PrintSolid.Min.z))
' lo aggiungo a lista pezzi
Dim sFilePath As String = ""
EgtGetInfo(m_nImportedPartId, FILE_PATH, sFilePath)
+3
View File
@@ -35,6 +35,9 @@
<TabItem Header="AUXSOLIDS">
<Button Height="100"/>
</TabItem>
<TabItem Header="MODIFYPART">
<PrintApp:ImportPanelV DataContext="{StaticResource ImportPanelVM}"/>
</TabItem>
</TabControl>
</UserControl>
+1
View File
@@ -14,6 +14,7 @@ Public Class LeftPanelVM
RIBS = 5
SHELLNUMBER = 6
AUXSOLIDS = 7
MODIFYPART = 8
End Enum
Private m_SelPanel As Panels
+1 -1
View File
@@ -61,4 +61,4 @@ Imports System.Windows
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.4.9.5")>
<Assembly: AssemblyFileVersion("2.4.9.4")>
<Assembly: AssemblyFileVersion("2.4.9.5")>
+2 -1
View File
@@ -681,7 +681,8 @@ Public Class RibPanelVM
''' </summary>
Public Sub Line2P(ByVal param As Object)
If Map.refSceneHostVM.MainController.GetStep <> 0 Then Return
Dim nNewRibLayerId As Integer = EgtCreateGroup(m_nPartId)
Dim nNewRibLayerId As Integer = EgtGetFirstNameInGroup(m_nPartId, LAY_NEWRIB)
If nNewRibLayerId = GDB_ID.NULL Then nNewRibLayerId = EgtCreateGroup(m_nPartId)
EgtSetName(nNewRibLayerId, LAY_NEWRIB)
EgtSetCurrPartLayer(m_nPartId, nNewRibLayerId)
Map.refSceneHostVM.MainController.SetContinue()
@@ -695,7 +695,8 @@ Public Class ShellNumberPanelVM
''' </summary>
Public Sub Line2P(ByVal param As Object)
If Map.refSceneHostVM.MainController.GetStep <> 0 Then Return
Dim nNewShellNumberLayerId As Integer = EgtCreateGroup(m_nPartId)
Dim nNewShellNumberLayerId As Integer = EgtGetFirstNameInGroup(m_nPartId, LAY_NEWRIB)
If nNewShellNumberLayerId = GDB_ID.NULL Then nNewShellNumberLayerId = EgtCreateGroup(m_nPartId)
EgtSetName(nNewShellNumberLayerId, LAY_NEWRIB)
EgtSetCurrPartLayer(m_nPartId, nNewShellNumberLayerId)
Map.refSceneHostVM.MainController.SetContinue()
@@ -3,5 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="400"
Value="{Binding dLayerAdvancement}"
Minimum="0"
Maximum="100"
Visibility="{Binding LayerAdvancement_Visibility}"/>
+119 -7
View File
@@ -22,10 +22,22 @@ Public Class SliderManagerVM
Select Case m_nSelViewSlider
Case ViewSliderType.ONLY_SELECTED
' se diverso da nullo nascondo precedente
If m_nLayerIndex > 0 Then EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(m_nLayerIndex - 1).nLayerId, GDB_ST.OFF)
If Not IsNothing(Map.refTopPanelVM.SelPart) Then
' riporto vecchio strato a visualizzazione di tutti i solidi
If m_nLayerIndex > 0 Then dLayerAdvancement = 100
If m_nLayerIndex = 0 Then
For Each Layer In Map.refTopPanelVM.SelPart.LayerList
EgtSetStatus(Layer.nLayerId, GDB_ST.OFF)
Next
ElseIf m_nLayerIndex > 0 Then
EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(m_nLayerIndex - 1).nLayerId, GDB_ST.OFF)
End If
End If
m_nLayerIndex = value
' se diverso da nullo visualizzo corrente
If m_nLayerIndex > 0 Then EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(m_nLayerIndex - 1).nLayerId, GDB_ST.ON_)
If Not IsNothing(Map.refTopPanelVM.SelPart) AndAlso m_nLayerIndex > 0 Then EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(m_nLayerIndex - 1).nLayerId, GDB_ST.ON_)
' porto barra nuovo strato a 100
If m_nLayerIndex > 0 Then SetLayerAdvancement(100)
Case ViewSliderType.UNTIL_SELECTED
Dim LayerIndex As Integer = If(m_nLayerIndex > 0, m_nLayerIndex, 1)
If value > m_nLayerIndex Then
@@ -55,6 +67,56 @@ Public Class SliderManagerVM
EgtDraw()
End Set
End Property
Private Sub SetLayerIndex(value As Integer)
Select Case m_nSelViewSlider
Case ViewSliderType.ONLY_SELECTED
If Not IsNothing(Map.refTopPanelVM.SelPart) Then
' riporto vecchio strato a visualizzazione di tutti i solidi
If m_nLayerIndex > 0 Then dLayerAdvancement = 100
For nLayerInd = 0 To Map.refTopPanelVM.SelPart.LayerList.Count - 1
If nLayerInd = value - 1 Then
EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.ON_)
Else
EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.OFF)
End If
Next
End If
m_nLayerIndex = value
NotifyPropertyChanged(NameOf(ghShowValue))
EgtDraw()
Case ViewSliderType.UNTIL_SELECTED
If Not IsNothing(Map.refTopPanelVM.SelPart) Then
' riporto vecchio strato a visualizzazione di tutti i solidi
If m_nLayerIndex > 0 Then dLayerAdvancement = 100
For nLayerInd = 0 To Map.refTopPanelVM.SelPart.LayerList.Count - 1
If nLayerInd <= value - 1 Then
EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.ON_)
Else
EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.OFF)
End If
Next
End If
m_nLayerIndex = value
NotifyPropertyChanged(NameOf(ghShowValue))
EgtDraw()
Case ViewSliderType.FROM_SELECTED
If Not IsNothing(Map.refTopPanelVM.SelPart) Then
' riporto vecchio strato a visualizzazione di tutti i solidi
If m_nLayerIndex > 0 Then dLayerAdvancement = 100
For nLayerInd = 0 To Map.refTopPanelVM.SelPart.LayerList.Count - 1
If nLayerInd >= value - 1 Then
EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.ON_)
Else
EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.OFF)
End If
Next
End If
m_nLayerIndex = value
NotifyPropertyChanged(NameOf(ghShowValue))
EgtDraw()
End Select
NotifyPropertyChanged(NameOf(nLayerIndex))
End Sub
Public ReadOnly Property ghShowValue As String
Get
@@ -92,9 +154,59 @@ Public Class SliderManagerVM
Return m_dLayerAdvancement
End Get
Set(value As Double)
m_dLayerAdvancement = value
Select Case m_nSelViewSlider
Case ViewSliderType.ONLY_SELECTED
Dim nTotSolid As Integer = 0
For Each nLayerId In Map.refTopPanelVM.SelPart.LayerList(m_nLayerIndex - 1).SolidLayerIdList
nTotSolid += EgtGetGroupObjs(nLayerId)
Next
Dim nTotToolPath As Integer = 0
For Each nLayerId In Map.refTopPanelVM.SelPart.LayerList(m_nLayerIndex - 1).ToolPathLayerIdList
nTotToolPath += EgtGetGroupObjs(nLayerId)
Next
Dim nOldSolidAdvancement As Integer = Math.Ceiling(nTotSolid * m_dLayerAdvancement / 100)
Dim nNewSolidAdvancement As Integer = Math.Ceiling(nTotSolid * value / 100)
If nNewSolidAdvancement <> nOldSolidAdvancement Then
Dim nIndex As Integer = 0
For nSolidLayerIndex = 0 To Map.refTopPanelVM.SelPart.LayerList(m_nLayerIndex - 1).SolidLayerIdList.Count - 1
Dim nId As Integer = EgtGetFirstInGroup(Map.refTopPanelVM.SelPart.LayerList(m_nLayerIndex - 1).SolidLayerIdList(nSolidLayerIndex))
While nId <> GDB_ID.NULL
nIndex += 1
If nIndex <= nNewSolidAdvancement Then
EgtSetStatus(nId, GDB_ST.ON_)
Else
EgtSetStatus(nId, GDB_ST.OFF)
End If
nId = EgtGetNext(nId)
End While
Next
End If
Dim nOldToolPathAdvancement As Integer = Math.Ceiling(nTotToolPath * m_dLayerAdvancement / 100)
Dim nNewToolPathAdvancement As Integer = Math.Ceiling(nTotToolPath * value / 100)
If nNewToolPathAdvancement <> nOldToolPathAdvancement Then
Dim nIndex As Integer = 0
For nToolPathLayerIndex = 0 To Map.refTopPanelVM.SelPart.LayerList(m_nLayerIndex - 1).ToolPathLayerIdList.Count - 1
Dim nId As Integer = EgtGetFirstInGroup(Map.refTopPanelVM.SelPart.LayerList(m_nLayerIndex - 1).ToolPathLayerIdList(nToolPathLayerIndex))
While nId <> GDB_ID.NULL
nIndex += 1
If nIndex <= nNewToolPathAdvancement Then
EgtSetStatus(nId, GDB_ST.ON_)
Else
EgtSetStatus(nId, GDB_ST.OFF)
End If
nId = EgtGetNext(nId)
End While
Next
End If
m_dLayerAdvancement = value
End Select
EgtDraw()
End Set
End Property
Friend Sub SetLayerAdvancement(value As Double)
m_dLayerAdvancement = value
NotifyPropertyChanged(NameOf(dLayerAdvancement))
End Sub
Private m_LayerIndex_Visibility As Visibility = Visibility.Collapsed
Public Property LayerIndex_Visibility As Visibility
@@ -217,21 +329,21 @@ Public Class SliderManagerVM
NotifyPropertyChanged(NameOf(nLayerIndex_Minimum))
NotifyPropertyChanged(NameOf(nLayerIndex_Maximum))
NotifyPropertyChanged(NameOf(ghShowMaximum))
nLayerIndex = m_nLayerIndex
SetLayerIndex(m_nLayerIndex)
End Sub
Friend Sub SetLayerIndexToMax()
nLayerIndex = m_nLayerIndex_Maximum
SetLayerIndex(m_nLayerIndex_Maximum)
NotifyPropertyChanged(NameOf(nLayerIndex))
End Sub
Friend Sub SetLayerIndexToMin()
nLayerIndex = m_nLayerIndex_Minimum
SetLayerIndex(m_nLayerIndex_Minimum)
NotifyPropertyChanged(NameOf(nLayerIndex))
End Sub
Friend Sub SetLayerIndexToZero()
nLayerIndex = 0
SetLayerIndex(0)
NotifyPropertyChanged(NameOf(nLayerIndex))
End Sub
+4 -2
View File
@@ -460,7 +460,8 @@ Public Class StartMachPanelVM
''' </summary>
Public Sub Point(ByVal param As Object)
If Map.refSceneHostVM.MainController.GetStep <> 0 Then Return
Dim nNewStartLayerId As Integer = EgtCreateGroup(m_nPartId)
Dim nNewStartLayerId As Integer = EgtGetFirstNameInGroup(m_nPartId, LAY_NEWSTART)
If nNewStartLayerId = GDB_ID.NULL Then nNewStartLayerId = EgtCreateGroup(m_nPartId)
EgtSetName(nNewStartLayerId, LAY_NEWSTART)
EgtSetCurrPartLayer(m_nPartId, nNewStartLayerId)
'InitCommand(True)
@@ -490,7 +491,8 @@ Public Class StartMachPanelVM
''' </summary>
Public Sub Line2P(ByVal param As Object)
If Map.refSceneHostVM.MainController.GetStep <> 0 Then Return
Dim nNewStartLayerId As Integer = EgtCreateGroup(m_nPartId)
Dim nNewStartLayerId As Integer = EgtGetFirstNameInGroup(m_nPartId, LAY_NEWSTART)
If nNewStartLayerId = GDB_ID.NULL Then nNewStartLayerId = EgtCreateGroup(m_nPartId)
EgtSetName(nNewStartLayerId, LAY_NEWSTART)
EgtSetCurrPartLayer(m_nPartId, nNewStartLayerId)
Map.refSceneHostVM.MainController.SetContinue()
+22 -10
View File
@@ -26,16 +26,28 @@
Text="PRINTING PARAMETERS"
Style="{StaticResource TopPanel_TextBlock}"/>
<ComboBox Grid.Column="0"
Grid.Row="1"
ItemsSource="{Binding PartList}"
SelectedItem="{Binding SelPart}"
FontSize="14"
FontFamily="/Resources/Fonts/#Roboto"
FontWeight="Light"
VerticalContentAlignment="Center"
DisplayMemberPath="sImportedFileName">
</ComboBox>
<Grid Grid.Column="0"
Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ComboBox Grid.Column="0"
Grid.Row="1"
ItemsSource="{Binding PartList}"
SelectedItem="{Binding SelPart}"
DisplayMemberPath="sImportedFileName"
FontSize="14"
FontFamily="/Resources/Fonts/#Roboto"
FontWeight="Light"
VerticalContentAlignment="Center">
</ComboBox>
<Button Grid.Column="1"
Command="{Binding PartModify_Command}"
Style="{StaticResource PrintParamDb_Button}">
<Image Source="/Resources/TopPanel/Edit.png"/>
</Button>
</Grid>
<ToggleButton x:Name="ModifyBtn"
Content="{Binding SelectedItem.sName, ElementName=ModifyModeListBox}"
IsChecked="{Binding bModify_IsChecked}"
+38
View File
@@ -40,6 +40,8 @@ Public Class TopPanelVM
bOk = ExitMACHININGDB()
Case Pages.CURRMACHINING
bOk = ExitCURRMACHINING()
Case Pages.MODIFYPART
bOk = ExitMODIFYPART()
End Select
If bOk Then
' Entro nel nuovo stato
@@ -59,6 +61,8 @@ Public Class TopPanelVM
InitMACHININGDB()
Case Pages.CURRMACHINING
InitCURRMACHINING()
Case Pages.MODIFYPART
InitMODIFYPART()
Case Else
InitNULL()
End Select
@@ -260,6 +264,7 @@ Public Class TopPanelVM
End Sub
' Definizione comandi
Private m_cmdPartModify As ICommand
Private m_cmdMachining As ICommand
Private m_cmdMaterialDb As ICommand
Private m_cmdPrintParamDb As ICommand
@@ -416,6 +421,15 @@ Public Class TopPanelVM
Return True
End Function
Private Sub InitMODIFYPART()
Map.refLeftPanelVM.SetSelPanel(LeftPanelVM.Panels.MODIFYPART)
End Sub
Private Function ExitMODIFYPART()
Return True
End Function
Private Sub InitNULL()
Map.refLeftPanelVM.SetSelPanel(LeftPanelVM.Panels.NULL)
End Sub
@@ -530,6 +544,30 @@ Public Class TopPanelVM
#Region "COMMANDS"
#Region "PartModify"
''' <summary>
''' Returns a command that do CPlaneTop.
''' </summary>
Public ReadOnly Property PartModify_Command As ICommand
Get
If m_cmdPartModify Is Nothing Then
m_cmdPartModify = New Command(AddressOf PartModify)
End If
Return m_cmdPartModify
End Get
End Property
''' <summary>
''' Execute the CPlaneTop. This method is invoked by the CPlaneTopCommand.
''' </summary>
Public Sub PartModify()
If IsNothing(m_SelPart) Then Return
SelPage = Pages.MODIFYPART
End Sub
#End Region ' PartModify
#Region "Machining"
''' <summary>
@@ -166,9 +166,11 @@ Public Class ViewLayer
Map.refTopPanelVM.SetTopPanelIsEnabled(True)
Map.refViewLayerManagerVM.SetViewLayerManagerIsEnabled(True)
End If
If Map.refTopPanelVM.SelPage = Pages.SLICE Then
Map.refSliderManagerVM.SetSliderVisibility(bIsVisible)
End If
End If
If Map.refTopPanelVM.SelPage = Pages.SLICE AndAlso (m_Type = ViewLayerType.SOLID_SLICE OrElse m_Type = ViewLayerType.SLICE_TOOLPATH) Then
'If Then
' Map.refSliderManagerVM.SetSliderVisibility(Map.refViewLayerManagerVM.LayerList.Any(Function(x) (x.Type = ViewLayerType.SOLID_SLICE OrElse x.Type = ViewLayerType.START_MACHINING) AndAlso x.bIsVisible))
'End If
End If
Dim Status As GDB_ST = If(bIsVisible, GDB_ST.ON_, GDB_ST.OFF)
For Each CurrPart In Map.refTopPanelVM.PartList
@@ -187,14 +189,14 @@ Public Class ViewLayer
EgtSetStatus(CurrPart.nAuxSolidsLayerId, Status)
Case ViewLayerType.SOLID_SLICE
For Each Layer In Map.refTopPanelVM.SelPart.LayerList
EgtSetStatus(Layer.nLayerId, GDB_ST.ON_)
'EgtSetStatus(Layer.nLayerId, GDB_ST.ON_)
For Each Entity In Layer.SolidLayerIdList
EgtSetStatus(Entity, Status)
Next
Next
Case ViewLayerType.SLICE_TOOLPATH
For Each Layer In Map.refTopPanelVM.SelPart.LayerList
EgtSetStatus(Layer.nLayerId, GDB_ST.ON_)
'EgtSetStatus(Layer.nLayerId, GDB_ST.ON_)
For Each Entity In Layer.ToolPathLayerIdList
EgtSetStatus(Entity, Status)
Next