Merge branch 'main' into feature/ExportForMachine

This commit is contained in:
Emmanuele Sassi
2023-09-26 11:41:08 +02:00
6 changed files with 74 additions and 59 deletions
+1
View File
@@ -3,6 +3,7 @@
Public Const TABLE = "Table"
Public Const TABLE_OUTLINE = "TableOutline"
Public Const EXTRUSION_AREA = "ExtrusionArea"
Public Const EXTRUSION_RECT = "ExtrusionRect"
Public Const PART = "Part"
Public Const PRINT_SOLID = "PrintSolid"
Public Const LAY_MACH_START = "MachStart"
+2 -2
View File
@@ -191,8 +191,8 @@ Public Class MainWindowM
EgtSetLockId( sLockId)
End If
' Recupero livello e opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(5583, 2507, 1, m_nKeyLevel) And
EgtGetKeyOptions(5583, 2507, 1, m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(5583, 2508, 1, m_nKeyLevel) And
EgtGetKeyOptions(5583, 2508, 1, m_nKeyOptions)
' Inizializzazione generale di EgtInterface
m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
m_sLogFile = m_sTempDir & "\" & GENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
+2 -2
View File
@@ -70,5 +70,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.5.7.1")>
<Assembly: AssemblyFileVersion("2.5.7.1")>
<Assembly: AssemblyVersion("2.5.8.1")>
<Assembly: AssemblyFileVersion("2.5.8.1")>
+47 -45
View File
@@ -20,23 +20,22 @@ Public Class SliderManagerVM
End Get
Set(value As Integer)
If IsNothing(Map.refTopPanelVM.SelPart) Then Return
Dim DisableMgr As New DisableModifiedMgr
Select Case m_nSelViewSlider
Case ViewSliderType.ONLY_SELECTED
' se diverso da nullo nascondo precedente
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
' nascondo precedente
' 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
m_nLayerIndex = value
' se diverso da nullo visualizzo corrente
If Not IsNothing(Map.refTopPanelVM.SelPart) AndAlso m_nLayerIndex > 0 Then EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(m_nLayerIndex - 1).nLayerId, GDB_ST.ON_)
If 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
@@ -64,6 +63,7 @@ Public Class SliderManagerVM
End If
m_nLayerIndex = value
End Select
DisableMgr.ReEnable()
NotifyPropertyChanged(NameOf(ghShowValue))
NotifyPropertyChanged(NameOf(ghValueIndex))
NotifyPropertyChanged(NameOf(ghValueHeight))
@@ -71,47 +71,44 @@ Public Class SliderManagerVM
End Set
End Property
Private Sub SetLayerIndex(value As Integer)
If IsNothing(Map.refTopPanelVM.SelPart) Then Return
Dim DisableMgr As New DisableModifiedMgr
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 AndAlso m_nLayerIndex < Map.refTopPanelVM.SelPart.LayerList.Count 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
' riporto vecchio strato a visualizzazione di tutti i solidi
If m_nLayerIndex > 0 AndAlso m_nLayerIndex < Map.refTopPanelVM.SelPart.LayerList.Count 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
m_nLayerIndex = value
Case ViewSliderType.UNTIL_SELECTED
If Not IsNothing(Map.refTopPanelVM.SelPart) Then
' riporto vecchio strato a visualizzazione di tutti i solidi
If m_nLayerIndex > 0 AndAlso m_nLayerIndex < Map.refTopPanelVM.SelPart.LayerList.Count 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
' riporto vecchio strato a visualizzazione di tutti i solidi
If m_nLayerIndex > 0 AndAlso m_nLayerIndex < Map.refTopPanelVM.SelPart.LayerList.Count 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
m_nLayerIndex = value
Case ViewSliderType.FROM_SELECTED
If Not IsNothing(Map.refTopPanelVM.SelPart) Then
' riporto vecchio strato a visualizzazione di tutti i solidi
If m_nLayerIndex > 0 AndAlso m_nLayerIndex < Map.refTopPanelVM.SelPart.LayerList.Count 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
' riporto vecchio strato a visualizzazione di tutti i solidi
If m_nLayerIndex > 0 AndAlso m_nLayerIndex < Map.refTopPanelVM.SelPart.LayerList.Count 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
m_nLayerIndex = value
End Select
DisableMgr.ReEnable()
NotifyPropertyChanged(NameOf(nLayerIndex))
NotifyPropertyChanged(NameOf(ghShowValue))
NotifyPropertyChanged(NameOf(ghValueIndex))
@@ -201,6 +198,8 @@ Public Class SliderManagerVM
Return m_dLayerAdvancement
End Get
Set(value As Double)
If IsNothing(Map.refTopPanelVM.SelPart) Then Return
Dim DisableMgr As New DisableModifiedMgr
Select Case m_nSelViewSlider
Case ViewSliderType.ONLY_SELECTED
Dim nTotSolid As Integer = 0
@@ -247,6 +246,7 @@ Public Class SliderManagerVM
End If
m_dLayerAdvancement = value
End Select
DisableMgr.ReEnable()
EgtDraw()
End Set
End Property
@@ -335,6 +335,7 @@ Public Class SliderManagerVM
WriteMainPrivateProfileString(S_PRINTING3D, K_VIEWSLIDER, m_nSelViewSlider)
' ciclo tutti i layer per nasconderli/mostrarli
If IsNothing(Map.refTopPanelVM.SelPart) OrElse IsNothing(Map.refTopPanelVM.SelPart.LayerList) Then Return
Dim DisableMgr As New DisableModifiedMgr
Select Case m_nSelViewSlider
Case ViewSliderType.ONLY_SELECTED
For Each Layer In Map.refTopPanelVM.SelPart.LayerList
@@ -361,6 +362,7 @@ Public Class SliderManagerVM
End If
Next
End Select
DisableMgr.ReEnable()
' mostro/nascondo slider orizzontale
m_LayerAdvancement_Visibility = If(m_nSelViewSlider = ViewSliderType.ONLY_SELECTED, Visibility.Visible, Visibility.Hidden)
NotifyPropertyChanged(NameOf(LayerAdvancement_Visibility))
+20 -7
View File
@@ -162,18 +162,24 @@ Public Module CurrentMachine
End Sub
Public Sub UpdateExtrusionArea()
Dim DisableMgr As New DisableModifiedMgr
' recupero eventuale vecchia area di estrusione
Dim nTabPartId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, TABLE)
Dim nTabLayerId As Integer = EgtGetFirstNameInGroup(nTabPartId, TABLE)
Dim nExtrusionAreaId As Integer = EgtGetFirstNameInGroup(nTabLayerId, EXTRUSION_AREA)
If nExtrusionAreaId <> GDB_ID.NULL Then
' e la cancello
EgtErase(nExtrusionAreaId)
End If
If nExtrusionAreaId <> GDB_ID.NULL Then EgtErase(nExtrusionAreaId)
Dim nExtrusionRectId As Integer = EgtGetFirstNameInGroup(nTabLayerId, EXTRUSION_RECT)
If nExtrusionRectId <> GDB_ID.NULL Then EgtErase(nExtrusionRectId)
' se lavorazione corrente nulla, esco
If IsNothing(Map.refTopPanelVM.CurrMachining) Then Return
If IsNothing(Map.refTopPanelVM.CurrMachining) Then
DisableMgr.ReEnable()
Return
End If
' se non esiste file dati macchina, esco
If String.IsNullOrWhiteSpace(m_sMachDataIniFile) Then Return
If String.IsNullOrWhiteSpace(m_sMachDataIniFile) Then
DisableMgr.ReEnable()
Return
End If
' recupero tipo di slice
Dim sExtrusionType As String = S_VERTICAL
Dim GeneralCathegory As MachiningCathegory = Map.refTopPanelVM.CurrMachining.CathegoryList.FirstOrDefault(Function(x) x.Type = MachiningCathegory.Cathegories.GENERAL)
@@ -193,12 +199,19 @@ Public Module CurrentMachine
Dim dExtrXMin = GetPrivateProfileDouble(sExtrusionType, K_MINX, 0, m_sMachDataIniFile)
Dim dExtrYMax = GetPrivateProfileDouble(sExtrusionType, K_MAXY, 0, m_sMachDataIniFile)
Dim dExtrYMin = GetPrivateProfileDouble(sExtrusionType, K_MINY, 0, m_sMachDataIniFile)
nExtrusionAreaId = EgtCreateRectangle2P(nTabLayerId, New Point3d(dExtrXMin, dExtrYMin, 0), New Point3d(dExtrXMax, dExtrYMax, 0))
Const AREA_WIDTH As Double = 10
Dim nAuxRectId As Integer = EgtCreateRectangle2P(nTabLayerId, New Point3d(dExtrXMin - AREA_WIDTH, dExtrYMin - AREA_WIDTH, 0), New Point3d(dExtrXMax + AREA_WIDTH, dExtrYMax + AREA_WIDTH, 0))
nExtrusionRectId = EgtCreateRectangle2P(nTabLayerId, New Point3d(dExtrXMin, dExtrYMin, 0), New Point3d(dExtrXMax, dExtrYMax, 0))
nExtrusionAreaId = EgtCreateSurfTmByRegion( nTabLayerId, { nAuxRectId, nExtrusionRectId}, EPS_STM)
EgtErase( nAuxRectId)
Dim c3Temp As New Color3d
c3Temp.FromColor(System.Drawing.Color.Lime)
EgtSetColor(nExtrusionAreaId, c3Temp)
EgtSetName(nExtrusionAreaId, EXTRUSION_AREA)
EgtSetColor(nExtrusionRectId, c3Temp)
EgtSetName(nExtrusionRectId, EXTRUSION_RECT)
m_b3ExtrusionArea = New BBox3d(New Point3d(dExtrXMin, dExtrYMin, 0), New Point3d(dExtrXMax, dExtrYMax, 0))
DisableMgr.ReEnable()
EgtDraw()
End Sub
@@ -150,8 +150,8 @@ Public Class ViewLayer
End Sub
Friend Sub UpdateVisibility(bIsVisible As Boolean)
' Disabilito segnalazione modificato
Dim DisableMgr As New DisableModifiedMgr ' se solidi
Dim DisableMgr As New DisableModifiedMgr
' se solidi
If m_Type = ViewLayerType.SOLID_SLICE Then
If Map.refSceneHostVM.MainController.GetStep() = 0 Then
' aggiorno parametro di calcolo solidi sui pezzi
@@ -242,7 +242,6 @@ Public Class ViewLayer
Next
Next
End If
' Ripristino stato segnalazione modifica
DisableMgr.ReEnable()
End Sub