From 5d32bb9ddf90367b9858bc2d8cdacf7e72cc4cc1 Mon Sep 17 00:00:00 2001 From: Nicola Pievani Date: Mon, 25 Nov 2024 15:39:26 +0100 Subject: [PATCH] Migliorata gestione evidenziazione compo --- DoorParameters/Part.vb | 8 ++++---- SceneManager/SceneManagerVM.vb | 14 ++++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/DoorParameters/Part.vb b/DoorParameters/Part.vb index 3cd06c7..9d9b681 100644 --- a/DoorParameters/Part.vb +++ b/DoorParameters/Part.vb @@ -1535,7 +1535,7 @@ Public Class Part ' ontengo la posizione prevista nella grafica Dim IndexInList As Integer = DdfFile.GetIndexInList(TempList, m_SelCompo) ' recupero la lista ordinata - Dim sCompoName As String = m_SelCompo.SelFile + Dim sCompoName As String = m_SelCompo.TemplateSelItem ' recupero il primo part disponibile Dim nIdFirstPart As Integer = EgtGetFirstPart() Dim nIdLay As Integer = EgtGetFirstLayer(nIdFirstPart) @@ -1543,12 +1543,12 @@ Public Class Part While nIdLay <> GDB_ID.NULL Dim sInfoPath As String = String.Empty If EgtGetInfo(nIdLay, "Path", sInfoPath) Then - Dim sNamePath As String = Path.GetFileNameWithoutExtension(sInfoPath) - If sNamePath = sCompoName And IndexLay = IndexInList Then + Dim sNamePath As String = sInfoPath + If sNamePath.Contains(sCompoName) And IndexLay = IndexInList Then EgtSetMark(nIdLay) m_SelCompo.SetMark() Exit While - ElseIf sNamePath = sCompoName And IndexLay < IndexInList Then + ElseIf sNamePath.Contains(sCompoName) And IndexLay < IndexInList Then IndexLay = IndexLay + 1 End If End If diff --git a/SceneManager/SceneManagerVM.vb b/SceneManager/SceneManagerVM.vb index 7d99be7..152437b 100644 --- a/SceneManager/SceneManagerVM.vb +++ b/SceneManager/SceneManagerVM.vb @@ -485,21 +485,23 @@ Public Class SceneManagerVM ' ottengo la posizione prevista nella grafica Dim IndexInList As Integer = DdfFile.GetIndexInList(TempList, CurrCompo) ' recupero la lista ordinata - Dim sCompoName As String = CurrCompo.SelFile + Dim sCompoName As String = CurrCompo.TemplateSelItem ' oridnamento del layer Dim IndexLay As Integer = -1 ' recupero il nome della comaponente selezionata con MouseOver Dim sInfoPath As String = String.Empty If Not EgtGetInfo(nIdLay, "Path", sInfoPath) Then Return True - Dim sNamePath As String = Path.GetFileNameWithoutExtension(sInfoPath) - If sNamePath = sCompoName Then + ' Dim sNamePath As String = Path.GetFileNameWithoutExtension(sInfoPath) + Dim sNamePath As String = sInfoPath + 'If sNamePath = sCompoName Then + If sNamePath.Contains(sCompoName) Then Dim nCurrLayId As Integer = nIdLay Dim nCounter As Integer = 1 While nCurrLayId <> GDB_ID.NULL nCurrLayId = EgtGetNext(nCurrLayId) Dim LocalsPath As String = String.Empty If EgtGetInfo(nCurrLayId, "Path", LocalsPath) Then - If sNamePath = Path.GetFileNameWithoutExtension(LocalsPath) Then + If sNamePath.Trim = LocalsPath.Trim Then nCounter += 1 End If End If @@ -511,7 +513,7 @@ Public Class SceneManagerVM While IndexInList < TempList.Count And nIdLay <> GDB_ID.NULL ' recupero l'ordinamento del layer - If sNamePath = sCompoName And IndexLay = IndexInList Then + If sNamePath.Contains(sCompoName) And IndexLay = IndexInList Then EgtSetMark(nIdLay) ' evidenzio la compo corrente TempList(IndexInList).SetMark() @@ -519,7 +521,7 @@ Public Class SceneManagerVM ' ricerca terminata correttamente Return True Exit While - ElseIf sNamePath = sCompoName And IndexInList < IndexLay Then + ElseIf sNamePath.Contains(sCompoName) And IndexInList < IndexLay Then IndexInList += 1 Else Return False