From 6aac67c638d41d632e66cab9ee17a29f8546be52 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 10 Oct 2016 06:58:31 +0000 Subject: [PATCH] TestEIn 1.6v4 : - aggiornamento. --- Controller.vb | 3 +-- EgtInterface.vb | 24 +++++++++++++++++++++++ My Project/AssemblyInfo.vb | 4 ++-- Scene.vb | 39 ++++++++++++++++++++++++++++++++++---- 4 files changed, 62 insertions(+), 8 deletions(-) diff --git a/Controller.vb b/Controller.vb index 3545d02..2f1e597 100644 --- a/Controller.vb +++ b/Controller.vb @@ -710,7 +710,7 @@ Public Class Controller Dim sFormat As String = "F" + nNumDec.ToString() Dim sVal As String = dVal.ToString(sFormat, CultureInfo.InvariantCulture) If nNumDec > 0 Then - Return sVal.TrimEnd("0".ToCharArray()) + Return sVal.TrimEnd("0".ToCharArray()).TrimEnd(".".ToCharArray()) Else Return sVal End If @@ -4364,7 +4364,6 @@ Public Class Controller ' abilito dialogo "MOVE", "Insert Base Point", "Copy" RaiseEvent PrepareInputBox(EgtMsg(2402), EgtMsg(2403), EgtMsg(2001), False, False) m_nInpType = IBT.TY_POINT3D - SetInputBoxPoint3d(Point3d.ORIG()) RaiseEvent SetInputBoxCheck(m_bLastTransfCheck) Case 1 m_ptP1 = m_ptLast diff --git a/EgtInterface.vb b/EgtInterface.vb index 9638df4..c79833f 100644 --- a/EgtInterface.vb +++ b/EgtInterface.vb @@ -6439,6 +6439,29 @@ Public Function EgtGetNextMachGroup(nMGroupId As Integer) As Integer End If End Function + +Private Function EgtGetMachGroupNewName_32(sName As String, ByRef psNewName As IntPtr) As Boolean +End Function + +Private Function EgtGetMachGroupNewName_64(sName As String, ByRef psNewName As IntPtr) As Boolean +End Function +Public Function EgtGetMachGroupNewName(ByRef sName As String) As Boolean + Dim psNewName As IntPtr + Dim bOk As Boolean + If IntPtr.Size = 4 Then + bOk = EgtGetMachGroupNewName_32(sName, psNewName) + Else + bOk = EgtGetMachGroupNewName_64(sName, psNewName) + End If + If bOk Then + sName = Marshal.PtrToStringUni(psNewName) + EgtFreeMemory(psNewName) + Else + sName = String.Empty + End If + Return bOk +End Function + Private Function EgtAddMachGroup_32(sName As String, sMachineName As String) As Integer End Function @@ -10538,6 +10561,7 @@ Public Enum MCH_MP As Integer SIDESTEP = 16418 VERTFEED = 16419 STEPSIDEANG = 16420 + OVERL = 16421 NAME = 32768 TOOL = 32769 DEPTH_STR = 32770 diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 1d75fa9..9d8c31d 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -46,5 +46,5 @@ Imports System.Runtime.InteropServices ' utilizzando l'asterisco (*) come descritto di seguito: ' - - + + diff --git a/Scene.vb b/Scene.vb index 11440f0..47a33e8 100644 --- a/Scene.vb +++ b/Scene.vb @@ -274,7 +274,7 @@ Public Class Scene ElseIf m_nStatus = ST.SELPATH Or m_nStatus = ST.SELPATHAUTO Or (m_nStatus = ST.SEL And (ModifierKeys And Keys.Control) = Keys.Control) Then EgtSetObjFilterForSelWin(False, m_bCurveForSel, False, False, False) ' abilito solo le curve - Dim nId As Integer = ChooseOneSelectedObj(e.Location) + Dim nId As Integer = ChooseOneSelectedObj(e.Location, m_nStatus) If nId <> GDB_ID.NULL Then RaiseEvent OnMouseSelectedPath(Me, nId, (m_nStatus <> ST.SELPATHAUTO)) Dim PtTemp As Point3d @@ -287,7 +287,7 @@ Public Class Scene ' se stato SEL, SELPART, SELLAYER ElseIf m_nStatus = ST.SEL Or m_nStatus = ST.SELPART Or m_nStatus = ST.SELLAYER Then EgtSetObjFilterForSelWin(m_bZeroDimForSel, m_bCurveForSel, m_bSurfForSel, m_bVolumeForSel, m_bExtraForSel) - Dim nId As Integer = ChooseOneSelectedObj(e.Location) + Dim nId As Integer = ChooseOneSelectedObj(e.Location, m_nStatus) If nId <> GDB_ID.NULL Then ' evento per entità selezionate Select Case m_nStatus @@ -324,7 +324,7 @@ Public Class Scene ' se stato ANALYZE ElseIf m_nStatus = ST.ANALYZE Then EgtSetObjFilterForSelWin(m_bZeroDimForSel, m_bCurveForSel, m_bSurfForSel, m_bVolumeForSel, m_bExtraForSel) - Dim nId As Integer = ChooseOneSelectedObj(e.Location) + Dim nId As Integer = ChooseOneSelectedObj(e.Location, m_nStatus) If nId <> GDB_ID.NULL Then RaiseEvent OnMouseAnalyzed(Me, nId) End If @@ -652,7 +652,7 @@ Public Class Scene End If End Sub - Private Function ChooseOneSelectedObj(ByVal WinXY As Point) As Integer + Private Function ChooseOneSelectedObj(WinXY As Point, Status As ST) As Integer ' Fotografo entità nel mirino Dim nSel As Integer EgtSelect(WinXY, DIM_SEL, DIM_SEL, nSel) @@ -665,6 +665,37 @@ Public Class Scene If bOk Then vId.Add(nId) nId = EgtGetNextObjInSelWin() End While + ' Se selezione layer, tengo un solo oggetto per layer + If Status = ST.SELLAYER Then + Dim nI As Integer = 0 + While nI < vId.Count() + Dim nLayI As Integer = EgtGetParent(vId(nI)) + Dim nJ As Integer = nI + 1 + While nJ < vId.Count() + If nLayI <> GDB_ID.NULL And EgtGetParent(vId(nJ)) = nLayI Then + vId.RemoveAt(nJ) + Else + nJ += 1 + End If + End While + nI += 1 + End While + ' se altrimenti selezione pezzo, tengo un solo oggetto per pezzo + ElseIf Status = ST.SELPART Then + Dim nI As Integer = 0 + While nI < vId.Count() + Dim nPartI As Integer = EgtGetParent(EgtGetParent(vId(nI))) + Dim nJ As Integer = nI + 1 + While nJ < vId.Count() + If nPartI <> GDB_ID.NULL And EgtGetParent(EgtGetParent(vId(nJ))) = nPartI Then + vId.RemoveAt(nJ) + Else + nJ += 1 + End If + End While + nI += 1 + End While + End If ' Se una sola la ritorno If vId.Count() = 1 Then Return vId(0)