From faa6bd2b8cd29e95884b4a3ebe665117c79d24f9 Mon Sep 17 00:00:00 2001 From: Nicola Pievani Date: Tue, 19 Nov 2024 16:37:20 +0100 Subject: [PATCH 1/7] Migliorata gestione seleziona da scena --- DoorParameters/Compo.vb | 6 +-- SceneManager/SceneManagerVM.vb | 69 +++++++++++++++++++++++----------- 2 files changed, 48 insertions(+), 27 deletions(-) diff --git a/DoorParameters/Compo.vb b/DoorParameters/Compo.vb index dd47a7e..e8906d5 100644 --- a/DoorParameters/Compo.vb +++ b/DoorParameters/Compo.vb @@ -10,11 +10,7 @@ Module Modified Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True If Not IsNothing(Map.refPartPageVM) AndAlso Not IsNothing(Map.refPartPageVM.CurrPart) Then For Each Compo In Map.refPartPageVM.CurrPart.CompoList - Compo.BorderColor = DirectCast(New BrushConverter().ConvertFrom("#DCDCDC"), SolidColorBrush) - Compo.BackGroundColor = DirectCast(New BrushConverter().ConvertFrom("#FFFFFF"), SolidColorBrush) - Compo.Foreground = DirectCast(New BrushConverter().ConvertFrom("#000000"), SolidColorBrush) - Compo.BorderThickness = 1 - Compo.FontBold = FontWeights.Normal + Compo.ResetMark() Next End If Else diff --git a/SceneManager/SceneManagerVM.vb b/SceneManager/SceneManagerVM.vb index 75b4688..7d99be7 100644 --- a/SceneManager/SceneManagerVM.vb +++ b/SceneManager/SceneManagerVM.vb @@ -172,7 +172,7 @@ Public Class SceneManagerVM ' Chiudo il programma End End If - Return m_ProjectSceneHost + Return m_ProjectSceneHost End Get End Property @@ -346,7 +346,7 @@ Public Class SceneManagerVM ElseIf Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nAssemblyPage Then If Not EnableRefresh Then Return ' Verifico esista elemento selezionato - If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) orelse IsNothing(Map.refAssemblyPageVM.CurrAssembly) Then Return + If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) OrElse IsNothing(Map.refAssemblyPageVM.CurrAssembly) Then Return DdfFile.WriteDDFAssembly(Map.refAssemblyPageVM.CurrAssembly, sTempFile, True) ExecDoors(m_ProjectScene, sTempFile, False) ' mantengo i layer accesi @@ -445,6 +445,7 @@ Public Class SceneManagerVM Return End If Dim LocalCompoList As ObservableCollection(Of Compo) = Map.refPartPageVM.CurrPart.CompoList + ' Ripulisco la scena da i Mark Map.refPartPageVM.CurrPart.ResetAllMark() ' Se la lista dei componenti è vuota allora esco If Map.refPartPageVM.CurrPart.CompoList.Count < 1 Then Return @@ -464,7 +465,7 @@ Public Class SceneManagerVM If Not sNameLayer.StartsWith("AUX") Or Not sNameLayer.StartsWith("SOLID") Or Not sNameLayer.StartsWith("DIM") Then ' scorro l'elenco dei componenti fino a trovare un riscontro tra i nomi e i parametri For Each ItemCompo As Compo In LocalCompoList - MatchCompoFromScena(nIdParent, ItemCompo, LocalCompoList) + If MatchCompoFromScena(nIdParent, ItemCompo, LocalCompoList) Then Exit While Next End If End If @@ -473,36 +474,60 @@ Public Class SceneManagerVM End While End Sub - Private Sub MatchCompoFromScena(nIdLay As Integer, CurrCompo As Compo, CompoList As ObservableCollection(Of Compo)) - If IsNothing(CurrCompo) Then Return - 'ResetAllMark() + Private Function MatchCompoFromScena(nIdLay As Integer, CurrCompo As Compo, CompoList As ObservableCollection(Of Compo)) As Boolean + If IsNothing(CurrCompo) Then Return True ' recupero la lista dei compo dello stesso tipo Dim TempList As ObservableCollection(Of Compo) = DdfFile.GetCurrentListSameCompoType(CompoList, CurrCompo.CompoType.DDFName) ' recupero la lista dei compo con lo stesso nome TempList = DdfFile.GetCurrentListSameCompoDDFName(TempList, CurrCompo.SelFile, CurrCompo.SelBrandPart) ' riordino la lista appena trovata secondo le regole di stampa DDF DdfFile.GetOrderedListSameCompo(TempList) - ' ontengo la posizione prevista nella grafica + ' ottengo la posizione prevista nella grafica Dim IndexInList As Integer = DdfFile.GetIndexInList(TempList, CurrCompo) ' recupero la lista ordinata Dim sCompoName As String = CurrCompo.SelFile - ' recupero il primo part disponibile - Dim IndexLay As Integer = 0 - If nIdLay <> GDB_ID.NULL Then - 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 - EgtSetMark(nIdLay) - ' evidenzio la compo corrente - CurrCompo.SetMark() - ElseIf sNamePath = sCompoName And IndexLay < IndexInList Then - IndexLay = IndexLay + 1 + ' 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 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 + nCounter += 1 + End If End If - End If + End While + IndexLay = TempList.Count - nCounter End If - EgtDraw() - End Sub + ' la compo passata non ha lo stesso nome, quindi mi aspetto un'altra compo + If IndexLay = -1 Then Return False + + While IndexInList < TempList.Count And nIdLay <> GDB_ID.NULL + ' recupero l'ordinamento del layer + If sNamePath = sCompoName And IndexLay = IndexInList Then + EgtSetMark(nIdLay) + ' evidenzio la compo corrente + TempList(IndexInList).SetMark() + EgtDraw() + ' ricerca terminata correttamente + Return True + Exit While + ElseIf sNamePath = sCompoName And IndexInList < IndexLay Then + IndexInList += 1 + Else + Return False + End If + End While + ' prova con un'altra compo + Return False + End Function #End Region ' Event scene From 5d32bb9ddf90367b9858bc2d8cdacf7e72cc4cc1 Mon Sep 17 00:00:00 2001 From: Nicola Pievani Date: Mon, 25 Nov 2024 15:39:26 +0100 Subject: [PATCH 2/7] 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 From a53f9ff3522e86411b3a7dd607da4156415b5749 Mon Sep 17 00:00:00 2001 From: Nicola Pievani Date: Mon, 25 Nov 2024 17:58:35 +0100 Subject: [PATCH 3/7] Correzione stringa costanti --- Constants/ConstIni.vb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Constants/ConstIni.vb b/Constants/ConstIni.vb index 4b307a2..54790a6 100644 --- a/Constants/ConstIni.vb +++ b/Constants/ConstIni.vb @@ -90,7 +90,8 @@ Module ConstIni Public Const K_DDFFUNCTION As String = "DdfFun" Public Const K_MYPROJECTDIR As String = "ProjectDirectory" Public Const K_TEMPLATEDIR As String = "TemplateDirectory" - Public Const K_MACHINDIR As String = "MachinDirectory" + ' Correzione nome Chiave valore ver 2.6k2 "MachineDirectory" + Public Const K_MACHINDIR As String = "MachineDirectory" Public Const K_MTABLE As String = "MTable" Public Const S_REPORT As String = "Report" From 316374761d8e89b96ae1a0d6cd5ebc94138a99ff Mon Sep 17 00:00:00 2001 From: Nicola Pievani Date: Mon, 2 Dec 2024 12:00:26 +0100 Subject: [PATCH 4/7] Gestione Swing e miglioramenti avvio in cieco --- DoorParameters/Part.vb | 4 ++ MainWindow/MainWindowModel.vb | 4 +- MainWindow/MainWindowV.xaml.vb | 96 ++++++++++++++-------------------- My Project/AssemblyInfo.vb | 4 +- OptionsWindow/OptionModule.vb | 2 + Utility.vb | 6 +++ 6 files changed, 56 insertions(+), 60 deletions(-) diff --git a/DoorParameters/Part.vb b/DoorParameters/Part.vb index 9d9b681..d55f47a 100644 --- a/DoorParameters/Part.vb +++ b/DoorParameters/Part.vb @@ -2172,6 +2172,10 @@ Public Class Part MessageBox.Show(String.Format(EgtMsg(50141), ConstIni.K_SWING_INI) & EgtMsg(50159), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error) Else ' carico il valore nella porta corrente + If m_refPartDoor.IsTemplate And OptionModule.AdjustDDT AndAlso Not String.IsNullOrEmpty(OptionModule.ForcesSideSwing) Then + Swing = Swing.Remove(0, 1) + Swing = OptionModule.ForcesSideSwing & Swing + End If m_Swing = Swing OptionModule.SetCurrSwing(m_SwingAlias, m_Swing) If IsNothing(m_SwingAlias) Then Return -1 diff --git a/MainWindow/MainWindowModel.vb b/MainWindow/MainWindowModel.vb index 13b1df2..0dec354 100644 --- a/MainWindow/MainWindowModel.vb +++ b/MainWindow/MainWindowModel.vb @@ -76,8 +76,8 @@ Friend Class MainWindowModel m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey) ' Recupero livello e opzioni della chiave - Dim bKey As Boolean = EgtGetKeyLevel(3279, 2611, 1, IniFile.m_nKeyLevel) And - EgtGetKeyOptions(3279, 2611, 1, IniFile.m_nKeyOptions) + Dim bKey As Boolean = EgtGetKeyLevel(3279, 2612, 1, IniFile.m_nKeyLevel) And + EgtGetKeyOptions(3279, 2612, 1, IniFile.m_nKeyOptions) 'Inizializzazione generale di EgtInterface m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0) Dim sLogFile As String = IniFile.m_sTempDir & "\" & GENLOG_FILE_NAME.Replace("#", m_nInstance.ToString()) diff --git a/MainWindow/MainWindowV.xaml.vb b/MainWindow/MainWindowV.xaml.vb index 4de87cd..2d5b1cd 100644 --- a/MainWindow/MainWindowV.xaml.vb +++ b/MainWindow/MainWindowV.xaml.vb @@ -27,33 +27,7 @@ Class MainWindowV Private Sub MainWindowV_ContentRendered(sender As Object, e As EventArgs) Handles Me.ContentRendered ' se è assente la chiave di protezione non mostro la finestra Launcher - If Map.refSceneManagerVM.bProtectKey Then - If Not IsNothing(m_args) Then - ' leggo gli argomenti: Il programma si chiude appena termina la scrittura del file DDF - Dim Items() As String = m_args(0).Split(";"c) - If Items.Length = 5 Then - ' Avvio progetto - LauncherOpt.Open_last_project (1) - OptionModule.m_bLauncherOpenOnce = True - ' Indico il percorso del file - OptionModule.FileNameFromArgs = Items(0) - ' Assegno i valore Width, Height, Thickness - OptionModule.m_Width = Items(1) - OptionModule.m_Height = Items(2) - OptionModule.m_Thickness = Items(3) - ' Indico il percoso di salvataggio file DDF - OptionModule.SaveFileNameFromArgs = Items(4) - ' abilito lettura dati - OptionModule.AdjustDDT = True - Else - ' blocco lettura dati - OptionModule.AdjustDDT = False - ' TERMINO TUTTO SUBITO! - End - End If - End If - Map.refMainWindowVM.SetLauncher() - Map.refMainWindowVM.ShowErrorCompoLoad() - End If + RunBlindCode() End Sub Private Sub MainWindowV_Unloaded(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles Me.Closing @@ -67,38 +41,48 @@ Class MainWindowV Private Sub RunBlindCode() If Map.refSceneManagerVM.bProtectKey Then - If Not IsNothing(m_args) Then - StartBlinProgdLog(IniFile.m_sTempDir & "\BlindProgLog.txt") - ' leggo gli argomenti: Il programma si chiude appena termina la scrittura del file DDF - Dim Items() As String = m_args(0).Split(";"c) - If Items.Length = 5 Then - ' Avvio progetto - LauncherOpt.Open_last_project (1) - OptionModule.m_bLauncherOpenOnce = True - ' Indico il percorso del file - OptionModule.FileNameFromArgs = Items(0) - BlindProgLog(" File '.ddt' input : " & OptionModule.FileNameFromArgs) - ' Assegno i valore Width, Height, Thickness - OptionModule.m_Width = Items(1) - BlindProgLog(" width : " & OptionModule.m_Width) - OptionModule.m_Height = Items(2) - BlindProgLog(" height : " & OptionModule.m_Height) - OptionModule.m_Thickness = Items(3) - BlindProgLog(" thickness : " & OptionModule.m_Thickness) - ' Indico il percoso di salvataggio file DDF - OptionModule.SaveFileNameFromArgs = Items(4) - BlindProgLog(" File '.ddf' output : " & OptionModule.SaveFileNameFromArgs) - ' abilito lettura dati - OptionModule.AdjustDDT = True - Else - ' blocco lettura dati - OptionModule.AdjustDDT = False - ' TERMINO TUTTO SUBITO! - End - End If - End If + ReadArgs() Map.refMainWindowVM.SetLauncher() Map.refMainWindowVM.ShowErrorCompoLoad() End If End Sub + ' Lettura degli argomenti e scrittura di un file di Log con i parametri caricati + Private Sub ReadArgs() + If Not IsNothing(m_args) Then + StartBlinProgdLog(IniFile.m_sTempDir & "\BlindProgLog.txt") + ' leggo gli argomenti: Il programma si chiude appena termina la scrittura del file DDF + Dim Items() As String = m_args(0).Split(";"c) + If Items.Length >= 5 Then + ' Avvio progetto - LauncherOpt.Open_last_project (1) + OptionModule.m_bLauncherOpenOnce = True + ' Indico il percorso del file + OptionModule.FileNameFromArgs = Items(0) + BlindProgLog(" File '.ddt' input : " & OptionModule.FileNameFromArgs) + ' Assegno i valore Width, Height, Thickness + OptionModule.m_Width = Items(1) + BlindProgLog(" width : " & OptionModule.m_Width) + OptionModule.m_Height = Items(2) + BlindProgLog(" height : " & OptionModule.m_Height) + OptionModule.m_Thickness = Items(3) + BlindProgLog(" thickness : " & OptionModule.m_Thickness) + ' Indico il percoso di salvataggio file DDF + OptionModule.SaveFileNameFromArgs = Items(4) + BlindProgLog(" File '.ddf' output : " & OptionModule.SaveFileNameFromArgs) + ' Nuovo parametro da laggere per gestione Swing + If Items.Length = 6 Then + OptionModule.ForcesSideSwing = Items(5) + BlindProgLog(" swing : " & OptionModule.ForcesSideSwing) + End If + ' abilito lettura dati + OptionModule.AdjustDDT = True + Else + ' blocco lettura dati + OptionModule.AdjustDDT = False + ' TERMINO TUTTO SUBITO! + End + End If + End If + End Sub + End Class diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index eaf15f6..c6e85c3 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -72,5 +72,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/OptionsWindow/OptionModule.vb b/OptionsWindow/OptionModule.vb index d29a8ab..ed8e84d 100644 --- a/OptionsWindow/OptionModule.vb +++ b/OptionsWindow/OptionModule.vb @@ -11,6 +11,8 @@ Friend Module OptionModule Friend AdjustDDT As Boolean = False Friend FileNameFromArgs As String = String.Empty Friend SaveFileNameFromArgs As String = String.Empty + ' Forza la scrittura dello swing Left(L..) oppure Right(R..) + Friend ForcesSideSwing As String = String.Empty ' Parametri che contengono lista delle lingue disponibili e lingua selezionata Friend m_LanguageList As New ObservableCollection(Of Language) diff --git a/Utility.vb b/Utility.vb index bb1ef4f..8b44c73 100644 --- a/Utility.vb +++ b/Utility.vb @@ -22,6 +22,10 @@ Public Module Utility ' CurrFile deve arrivare già senza estensione! Private Function GenerateLockFileName(ByVal CurrDirectory As String, Optional ByVal CurrFile As String = "") As String + ' Se in modalità Modifica file DDT allora non bloccare il file + If OptionModule.AdjustDDT Then + Return String.Empty + End If If OptionModule.ReadOnlyDDF Then Return String.Empty End If @@ -711,6 +715,8 @@ Public Module Utility sFilePath = sPath sFileBlindProgLog = New System.IO.StreamWriter(sPath, True) Dim sInfoStart As String = Date.Now.ToString & " Avvio programma in cieco" + sInfoStart &= vbCrLf & My.Application.Info.Version.Major.ToString() & "." & My.Application.Info.Version.Minor.ToString() & + (ChrW(97 - 1 + My.Application.Info.Version.Build)).ToString() & My.Application.Info.Version.Revision.ToString() sFileBlindProgLog.WriteLine(sInfoStart) sFileBlindProgLog.Close() End Sub From a814b83e87b79bbdcae68710aedea2f6effac377 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Mon, 9 Dec 2024 11:32:29 +0100 Subject: [PATCH 5/7] -migliorata gestion customer --- Order/OrderVM.vb | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/Order/OrderVM.vb b/Order/OrderVM.vb index 8a1ed35..8d46136 100644 --- a/Order/OrderVM.vb +++ b/Order/OrderVM.vb @@ -66,10 +66,18 @@ Public Class OrderVM End Get End Property + Private Function VerifyNotIsNothing() As Boolean + If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) OrElse + IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly) OrElse + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor.Count > 0 Then + Return False + End If + Return True + End Function + Public Property Customer As String Get - If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso - Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor.Count > 0 Then Return Nothing + If Not VerifyNotIsNothing() Then Return Nothing Return Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor(0).Door.Customer End Get Set(value As String) @@ -83,8 +91,7 @@ Public Class OrderVM Public Property Elevation As String Get - If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso - Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor.Count > 0 Then Return Nothing + If Not VerifyNotIsNothing() Then Return Nothing Return Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor(0).Door.Elevation End Get Set(value As String) @@ -98,8 +105,7 @@ Public Class OrderVM Public Property Project As String Get - If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso - Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor.Count > 0 Then Return Nothing + If Not VerifyNotIsNothing() Then Return Nothing Return Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor(0).Door.Project End Get Set(value As String) @@ -113,8 +119,7 @@ Public Class OrderVM Public Property PO As String Get - If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso - Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor.Count > 0 Then Return Nothing + If Not VerifyNotIsNothing() Then Return Nothing Return Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor(0).Door.PO End Get Set(value As String) @@ -128,8 +133,7 @@ Public Class OrderVM Public Property Line As String Get - If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso - Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor.Count > 0 Then Return Nothing + If Not VerifyNotIsNothing() Then Return Nothing Return Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor(0).Door.Line End Get Set(value As String) From 4525c6d780265fb3669c90cd0c9d4d5efe124c09 Mon Sep 17 00:00:00 2001 From: Nicola Pievani Date: Mon, 9 Dec 2024 15:30:30 +0100 Subject: [PATCH 6/7] Selezione anta in HardwareManager --- DoorParameters/Part.vb | 6 ++++-- My Project/AssemblyInfo.vb | 4 ++-- ProjectManager/SelectPartV.xaml | 5 +++-- ProjectManager/SelectPartVM.vb | 22 +++++++++++++++++++--- 4 files changed, 28 insertions(+), 9 deletions(-) diff --git a/DoorParameters/Part.vb b/DoorParameters/Part.vb index d55f47a..d3d5a99 100644 --- a/DoorParameters/Part.vb +++ b/DoorParameters/Part.vb @@ -1873,6 +1873,7 @@ Public Class Part ' Messaggi di errore generici, se la stringa dei messaggi contiene delle informazioni allora visualizzo If Not String.IsNullOrWhiteSpace(sErrorInfo) Then Dim sTitle As String = EgtMsg(50101) + If Not IsNothing(ReadDoor.TypePart) Then sTitle &= ReadDoor.TypePart.ToString ' 50541 = {0} in reading {1}. If Not IsNothing(ReadDoor) Then String.Format(EgtMsg(50541), sTitle, ReadDoor.TypePart) MessageBox.Show(sErrorInfo, sTitle, MessageBoxButton.OK, MessageBoxImage.Error) @@ -3497,10 +3498,11 @@ Public Class Part ElseIf nPartDoor > 1 Then ' Assemblati Dim WdSelPartV As New SelectPartV() - Dim WdSelPartVM As New SelectPartVM("Selezione della porta", "Selezione anta", nPartDoor, 1) + ' 50233=Selezione della porta, 50234=Selezione anta + Dim WdSelPartVM As New SelectPartVM(EgtMsg(50233), EgtMsg(50234), nPartDoor, 1) WdSelPartV.DataContext = WdSelPartVM WdSelPartV.ShowDialog() - Dim nSelection As Integer = CInt(WdSelPartVM.Selection.Split(" "c)(1)) - 1 + Dim nSelection As Integer = WdSelPartVM.nSelectedIndex ' Apro una finestra per chiedere quale anta usare come riferimento Dim LocalPartDoor As PartDoor = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor(nSelection) Me.m_Width = LocalPartDoor.Door.m_Width diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index c6e85c3..03f5bed 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -72,5 +72,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/ProjectManager/SelectPartV.xaml b/ProjectManager/SelectPartV.xaml index b818329..2123829 100644 --- a/ProjectManager/SelectPartV.xaml +++ b/ProjectManager/SelectPartV.xaml @@ -6,7 +6,7 @@ Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}" WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False" IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False" - Height="100" Width="300" Topmost="True" + Height="110" Width="300" Topmost="True" DataContext="{Binding RelativeSource={RelativeSource Self}}">