diff --git a/AboutBoxWindow/AboutBoxV.xaml.vb b/AboutBoxWindow/AboutBoxV.xaml.vb index 5ffce3c..e3e672e 100644 --- a/AboutBoxWindow/AboutBoxV.xaml.vb +++ b/AboutBoxWindow/AboutBoxV.xaml.vb @@ -16,7 +16,10 @@ Public Class AboutBoxV KeyLbl.Text = sKey & " - " & sKlev & " - " & sOpts CopyrightLbl.Text = My.Application.Info.Copyright.ToString() Dim sInfo As String = "DataRoot " & IniFile.m_sDataRoot & vbCrLf - sInfo &= "Doors " & IniFile.m_sDoorsDirPath + sInfo &= "Doors " & IniFile.m_sDoorsDirPath & vbCrLf + If OptionModule.m_MaterialList.Count = 1 Then + sInfo &= "Material " & OptionModule.m_MaterialList(0).Name + End If InfoLbl.Text = sInfo ExitBtn.Content = EgtMsg(MSG_MISSINGKEYWD + 4) 'Ok End Sub diff --git a/Assembly/Assembly.vb b/Assembly/Assembly.vb index 568ebb5..712296a 100644 --- a/Assembly/Assembly.vb +++ b/Assembly/Assembly.vb @@ -534,11 +534,12 @@ Public Class Assembly m_Exterior = value NotifyPropertyChanged("Exterior") SetDimension("JambIsCheked") - JambBIsChecked = value + 'JambBIsChecked = value + SetJambBTIsChecked(value) NotifyPropertyChanged("JambBIsChecked") Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True - HingeRabbetJamb() - BottomRabbetJamb() + 'HingeRabbetJamb() + 'BottomRabbetJamb() End Set End Property Public Sub SetExterior(bExterior As Boolean) @@ -798,6 +799,15 @@ Public Class Assembly End Set End Property + Public Sub SetJambBTIsChecked(value As Boolean) + OptionModule.m_BottomJambChk = value + If Not IsNothing(m_JambB) Then + m_JambB.IsActive = value + NotifyPropertyChanged("JambBIsChecked") + Map.refSceneManagerVM.RefreshBtn() + End If + End Sub + Public Property JambLIsChecked As Boolean Get If IsNothing(m_JambL) Then Return False @@ -828,7 +838,6 @@ Public Class Assembly m_JambR.IsActive = value NotifyPropertyChanged("JambRIsChecked") End If - ' se non esiste l'oggeto prima lo creo SetDimension("JambIsCheked") End Set @@ -957,6 +966,7 @@ Public Class Assembly Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = False Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected Else + Map.refSceneManagerVM.EnableRefresh = False If ReadAssembly.GetDDFDoor(IndexLine, sErrorInfo) = -1 Then ' errore nella lettura di un part: blocco tutto ReadAssembly = Nothing @@ -964,6 +974,7 @@ Public Class Assembly Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected End If End If + Map.refSceneManagerVM.EnableRefresh = True Else ' 50163= Error in reading General Assembly in DDF sErrorInfo += String.Format(EgtMsg(50102), EgtMsg(50163) + vbCrLf) @@ -1270,7 +1281,8 @@ Public Class Assembly Dim Local_PartDoor As New PartDoor Dim Local_Door As New Part(Local_PartDoor) ' carcio la liste delle propiretà - CreateNewPropertiesList(Local_Door.PropertiesList, Local_Door.SelectedMaterial) + 'CreateNewPropertiesList(Local_Door.PropertiesList, Local_Door.SelectedMaterial) + CreateNewPropertiesList(Local_Door) If Line > 0 Then ' per saltare la riga che è stata appena restituita che contiene "---" Line += 1 @@ -1314,7 +1326,8 @@ Public Class Assembly Case ConstGen.PART_DO_ & "1" Local_PartDoor.Door = Local_Door Local_PartDoor.Door.SwingTypeList = m_SwingTypeListSinlgeDoor - CreateNewPropertiesList(Local_Door.PropertiesList, Local_Door.SelectedMaterial) + 'CreateNewPropertiesList(Local_Door.PropertiesList, Local_Door.SelectedMaterial) + CreateNewPropertiesList(Local_Door) Local_PartDoor.SetIsChecked(Local_Door.IsActive) ListPartDoor.Add(Local_PartDoor) Case ConstGen.PART_DO_ & "2" @@ -1325,7 +1338,8 @@ Public Class Assembly Else Local_PartDoor.Door.SwingTypeList = m_SwingTypeListSinlgeDoor End If - CreateNewPropertiesList(Local_Door.PropertiesList, Local_Door.SelectedMaterial) + 'CreateNewPropertiesList(Local_Door.PropertiesList, Local_Door.SelectedMaterial) + CreateNewPropertiesList(Local_Door) Local_PartDoor.SetIsChecked(Local_Door.IsActive) ListPartDoor.Add(Local_PartDoor) @@ -1352,24 +1366,29 @@ Public Class Assembly Case ConstGen.PART_FRAME_LEFT Local_PartDoor.Door = Local_Door Local_Door.SwingTypeList = m_SwingTypeList - CreateNewPropertiesList(Local_Door.PropertiesList, Local_Door.SelectedMaterial) + 'CreateNewPropertiesList(Local_Door.PropertiesList, Local_Door.SelectedMaterial) + CreateNewPropertiesList(Local_Door) ListPartDoor.Add(Local_PartDoor) 'm_LeftJamb = Local_Door Case ConstGen.PART_FRAME_RIGHT Local_PartDoor.Door = Local_Door Local_Door.SwingTypeList = m_SwingTypeList + 'CreateNewPropertiesList(Local_Door.PropertiesList, Local_Door.SelectedMaterial) + CreateNewPropertiesList(Local_Door) ListPartDoor.Add(Local_PartDoor) 'm_RightJamb = Local_Door Case ConstGen.PART_FRAME_TOP Local_PartDoor.Door = Local_Door Local_Door.SwingTypeList = m_SwingTypeList - CreateNewPropertiesList(Local_Door.PropertiesList, Local_Door.SelectedMaterial) + 'CreateNewPropertiesList(Local_Door.PropertiesList, Local_Door.SelectedMaterial) + CreateNewPropertiesList(Local_Door) ListPartDoor.Add(Local_PartDoor) 'm_TopJamb = Local_Door Case ConstGen.PART_FRAME_BOTTOM Local_PartDoor.Door = Local_Door Local_Door.SwingTypeList = m_SwingTypeList - CreateNewPropertiesList(Local_Door.PropertiesList, Local_Door.SelectedMaterial) + 'CreateNewPropertiesList(Local_Door.PropertiesList, Local_Door.SelectedMaterial) + CreateNewPropertiesList(Local_Door) ListPartDoor.Add(Local_PartDoor) 'm_BottomJamb = Local_Door If Not m_Exterior Then Local_PartDoor.Door.IsActive = False @@ -1799,7 +1818,7 @@ Public Class Assembly CurrCompo.refJambCompo = Nothing End If ' 50144 =Warning, 50166 =Jamb compo does not exist - MessageBox.Show(EgtMsg(50166), EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning) + 'MessageBox.Show(EgtMsg(50166), EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning) Return False End If ' converto il numero di porte da string a int @@ -1940,7 +1959,6 @@ Public Class Assembly Map.refAssemblyManagerVM.CreateJamb(Me, False) Map.refAssemblyManagerVM.LoadOM_M_ET(Me) Map.refAssemblyManagerVM.CreateAssociation(Me) - SetPartDoorCurrAssembly() SetNewDimensionAssembly() ' UpDateAllCompo() Map.refSceneManagerVM.RefreshBtn() @@ -2479,19 +2497,23 @@ Public Class Assembly Public Sub MaterialJamb() If Not IsNothing(m_JambB) Then m_JambB.SetMaterial(OptionModule.m_CurrMaterial) - CreateNewPropertiesListJamb(m_JambB.PropertiesList, m_JambB.SelectedMaterial) + 'CreateNewPropertiesListJamb(m_JambB.PropertiesList, m_JambB.SelectedMaterial) + CreateNewPropertiesList(m_JambB) End If If Not IsNothing(m_JambT) Then m_JambT.SetMaterial(OptionModule.m_CurrMaterial) - CreateNewPropertiesListJamb(m_JambT.PropertiesList, m_JambT.SelectedMaterial) + 'CreateNewPropertiesListJamb(m_JambT.PropertiesList, m_JambT.SelectedMaterial) + CreateNewPropertiesList(m_JambT) End If If Not IsNothing(m_JambR) Then m_JambR.SetMaterial(OptionModule.m_CurrMaterial) - CreateNewPropertiesListJamb(m_JambR.PropertiesList, m_JambR.SelectedMaterial) + 'CreateNewPropertiesListJamb(m_JambR.PropertiesList, m_JambR.SelectedMaterial) + CreateNewPropertiesList(m_JambR) End If If Not IsNothing(m_JambR) Then m_JambL.SetMaterial(OptionModule.m_CurrMaterial) - CreateNewPropertiesListJamb(m_JambL.PropertiesList, m_JambL.SelectedMaterial) + 'CreateNewPropertiesListJamb(m_JambL.PropertiesList, m_JambL.SelectedMaterial) + CreateNewPropertiesList(m_JambL) End If End Sub @@ -2713,6 +2735,18 @@ Public Class Assembly #Region "RABBET" + ' restituisce l'indice della componente "rabbet" + Private Function nCompoRabbet() As Integer + Dim RabbetIndex As Integer = -1 + For Index As Integer = 0 To Map.refCompoPanelVM.CompoTypeList.Count - 1 + If Trim(Map.refCompoPanelVM.CompoTypeList(Index).DDFName) = "rabbet" Then + RabbetIndex = Index + Exit For + End If + Next + Return RabbetIndex + End Function + ' clacola il rabbet sul profilo top dei Jamb (quindi solo su quelli laterali) Public Sub TopRabbetJamb() Dim sThicknessHead As String = Map.refAssemblyPageVM.CurrAssembly.ThicknessHead @@ -2733,18 +2767,14 @@ Public Class Assembly SetTopRabbetJamb(m_JambR, sThicknessHead, sOverlapHinge, sLightUp) End Select End Sub + ' ricerca la componente Rabbet, se non esiete la aggiunge e poi la modifica, altrimenti la modifica Private Sub SetTopRabbetJamb(ByRef Jamb As Part, sThicknessHead As String, sOverlap As String, sLightUp As String) If IsNothing(Jamb) Then Return Dim CurrCompo As Compo = Nothing Dim IndexCompoPanel As Integer = -1 ' ricerco la posizione del rabbet nella lista dei componenti - For Index As Integer = 0 To Map.refCompoPanelVM.CompoTypeList.Count - 1 - If Trim(Map.refCompoPanelVM.CompoTypeList(Index).DDFName) = "rabbet" Then - IndexCompoPanel = Index - Exit For - End If - Next + IndexCompoPanel = nCompoRabbet() ' se la ricerca ha dato un esito positivo allora procedo If IndexCompoPanel = -1 Then Return Dim bRabbet As Boolean = False @@ -2773,6 +2803,7 @@ Public Class Assembly ' mofico la componete rabbet If Not IsNothing(CurrCompo) Then SetTopRabbetParam(sThicknessHead, sOverlap, CurrCompo, sLightUp) End Sub + ' setta i parametri della componente Rabbet sul top Private Sub SetTopRabbetParam(sThicknessHead As String, sOverlapTop As String, CurrCompo As Compo, sLightUp As String) Dim CurrCompoParam As CompoParam = CurrCompo.CompoParamList(1) @@ -2795,6 +2826,7 @@ Public Class Assembly TextParam.NotifyPropertyChanged("Value") End If End Sub + ' calcola il rabbet sul lato Bottom solo se è stata selezionata la proprietà exterior Public Sub BottomRabbetJamb() Dim sThicknessDoor As String @@ -2822,6 +2854,7 @@ Public Class Assembly RabbetExterior(m_JambR, sThicknessDoor, sWidthJamb, sOverLapHinge, IndexBottom) End Select End Sub + ' calcola il rabbet sul lato Hinge solo se è stata selezionata la proprietà exterior Public Sub HingeRabbetJamb() Dim sThicknessDoor As String @@ -2853,12 +2886,14 @@ Public Class Assembly RabbetExterior(m_JambT, sThicknessDoor, sDeltaT, sOverLapTop, IndexHinge) End Select End Sub + ' cerca la compo Rabbet sul lato indicato (Top o Bottom) Public Sub RabbetExterior(ByRef Jamb As Part, sThicknessDoor As String, sDeltaT As String, sOverLap As String, nIndexSide As Integer) If IsNothing(Jamb) Then Return 'Dim IndexHinge As Integer = 2 'Dim IndexBottom As Integer = 1 - Dim CompoListIndex As Integer = Map.refCompoPanelVM.CompoTypeList.Count - 1 + Dim CompoListIndex As Integer = nCompoRabbet() + If CompoListIndex = -1 Then Return Dim Local_Compo As Compo Dim bRabbet As Boolean = False Dim IndexCompo As Integer diff --git a/Assembly/AssemblyPageVM.vb b/Assembly/AssemblyPageVM.vb index 98666ee..b601ce8 100644 --- a/Assembly/AssemblyPageVM.vb +++ b/Assembly/AssemblyPageVM.vb @@ -211,7 +211,7 @@ Public Class AssemblyPageVM ' In questa fase manca la gestione degli swing dei Jamb Select Case SelectPart Case ConstGen.PART_FRAME_LEFT - LoadSelectedPartDoor(ConstGen.PART_FRAME_LEFT, Visibility.Collapsed, True) + LoadSelectedPartDoor(ConstGen.PART_FRAME_LEFT, Visibility.Hidden, True) Case ConstGen.PART_FRAME_RIGHT LoadSelectedPartDoor(ConstGen.PART_FRAME_RIGHT, Visibility.Hidden, True) Case ConstGen.PART_FRAME_TOP @@ -287,6 +287,7 @@ Public Class AssemblyPageVM ExecDoors(Map.refSceneManagerVM.ProjectScene, IniFile.m_sTempDir & "\" & TEMP_FILE) Map.refPartPageVM.CurrPart = Local_PD.Door Map.refCompoPanelVM.IsVisible = CompoPanelVisibility + Map.refPartPageVM.NotifyPropertyChanged("VisibilityTopShape") Map.refPartPageVM.IsRaedOnly = PartPageIsReadOnly End Sub diff --git a/AssemblyManager/AssemblyManagerVM.vb b/AssemblyManager/AssemblyManagerVM.vb index 92af68e..0640c4c 100644 --- a/AssemblyManager/AssemblyManagerVM.vb +++ b/AssemblyManager/AssemblyManagerVM.vb @@ -1201,15 +1201,14 @@ Public Class AssemblyManagerVM BottomJamb.Door.SetHeight(CurrAssembly.Width) ' assegno la lista completa degli swing perchè la selezione dello swing corretto avviene nel programma BottomJamb.Door.SwingTypeList = OptionModule.m_SwingTypeList - BottomJamb.Door.IsActive = OptionModule.m_BottomJambChk ' definisce la disposizione (da selezionare in una sola anta) BottomJamb.Door.SetDispositionItem(OptionModule.m_Disposition) If bNewAssembly Then - BottomJamb.IsChecked = True - BottomJamb.IsChecked = OptionModule.m_TopJambChk + BottomJamb.IsChecked = OptionModule.m_BottomJambChk + BottomJamb.Door.IsActive = OptionModule.m_BottomJambChk Else BottomJamb.IsChecked = False - BottomJamb.IsChecked = False + BottomJamb.Door.IsActive = False End If ' aggiungo alla lista dei PartDoor CurrAssembly.ListPartDoor.Add(BottomJamb) diff --git a/DoorParameters/Compo.vb b/DoorParameters/Compo.vb index d267385..ad2eaba 100644 --- a/DoorParameters/Compo.vb +++ b/DoorParameters/Compo.vb @@ -2272,11 +2272,12 @@ Public Class ComboBoxParam NotifyPropertyChanged("ErrorParameter") ' verifico di essere nella configurazione HardwareManager e che la Compo chiamata si chiama "Match File" If Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nHardwarePage And Me.CurrCompo.TemplateName = "Match File" Then + ' leggo quale è il nome del parametro che sto caricando Select Case Me.DDFName Case ConstCompo.MATCHING_INI - ' devo caricare la lista dei Brand da associare - Dim BLD As ObservableCollection(Of CompoBrandDir) = Map.refHardwarePageVM.CurrHardware.SelectMatching(Me, Me.CurrCompo) - Map.refHardwarePageVM.CurrHardware.SelectFileMatching(Me, BLD) + ' Sto selezionando un elemento dalla lista "Automatic, None, .." + Dim BrandListFrame As ObservableCollection(Of CompoBrandDir) = Map.refHardwarePageVM.CurrHardware.SelectMatching(Me, Me.CurrCompo) + Map.refHardwarePageVM.CurrHardware.SelectFileMatching(Me, BrandListFrame) Case ConstCompo.BRAND_INI Map.refHardwarePageVM.CurrHardware.SlectBrandMatching(Me) End Select diff --git a/DoorParameters/Part.vb b/DoorParameters/Part.vb index 9016700..404a393 100644 --- a/DoorParameters/Part.vb +++ b/DoorParameters/Part.vb @@ -227,7 +227,7 @@ Public Class Part ' ogni volta che cambio la selezione del materiale azzero tutte le selezioni delle proprietà If Not IsNothing(m_SelectedMaterial.PropertiesList) Then For Each ItemProperty In m_SelectedMaterial.PropertiesList - ItemProperty.IsChecked = False + 'ItemProperty.IsChecked = False Next m_PropertiesList = m_SelectedMaterial.PropertiesList m_SelectedProperty = m_PropertiesList(0) @@ -277,6 +277,19 @@ Public Class Part End Set End Property + ' seleziona la lista delle proprietà senza aggiornare il disegno della porta + Public Sub SetPropertiesList(ByVal List As ObservableCollection(Of PropertyItem)) + If Not IsNothing(m_PropertiesList) AndAlso m_PropertiesList.Count > 0 Then + Try + m_SelectedProperty = m_PropertiesList.First(Function(x) x.Name = NONE_DDF) + Catch ex As Exception + m_SelectedProperty = m_PropertiesList(0) + End Try + NotifyPropertyChanged("SelectedProperty") + End If + NotifyPropertyChanged("PropertiesList") + End Sub + Private m_SelectedProperty As PropertyItem Public Property SelectedProperty As PropertyItem Get @@ -290,6 +303,11 @@ Public Class Part End Set End Property + Public Sub SetProperty(ByVal SelProperty As PropertyItem) + m_SelectedProperty = SelProperty + NotifyPropertyChanged("SelectedProperty") + End Sub + Private m_PropertiesIsVisible As Visibility = OptionModule.m_DisableProperties Public Property PropertiesIsVisible As Visibility Get @@ -1235,7 +1253,7 @@ Public Class Part End While CompoList.Insert(CompoIndex + Lastindex, NewCompo) bInsert = True - If Not IsNothing(PrecCompo) Then + If Not IsNothing(PrecCompo) AndAlso (Not IsFrame And NewCompo.CompoType.DDFName = "rabbet") Then Map.refAssemblyPageVM.CurrAssembly.CopyParam(PrecCompo, NewCompo) Else AdviceHinge(NewCompo) @@ -1803,9 +1821,11 @@ Public Class Part If Not String.IsNullOrWhiteSpace(sType) Then m_TypePart = sType If sType.Contains("DO_") Then - OptionModule.CreateNewPropertiesList(m_PropertiesList, m_SelectedMaterial) + 'OptionModule.CreateNewPropertiesList(m_PropertiesList, m_SelectedMaterial) + OptionModule.CreateNewPropertiesList(Me) Else - OptionModule.CreateNewPropertiesListJamb(m_PropertiesList, m_SelectedMaterial) + 'OptionModule.CreateNewPropertiesListJamb(m_PropertiesList, m_SelectedMaterial) + OptionModule.CreateNewPropertiesListJamb(Me) End If End If ' passo alla riga successiva @@ -1994,12 +2014,15 @@ Public Class Part sNameDDFMaterial = sMaterial For Each MaterialItem In OptionModule.m_MaterialList ' se trovo il materiale allora carico la sua lista di proprietà ed esco - If Trim(MaterialItem.NameDDF) = Trim(sMaterial) then - m_SelectedMaterial = MaterialItem + If Trim(MaterialItem.NameDDF) = Trim(sMaterial) Then + 'm_SelectedMaterial = MaterialItem + SetMaterial(MaterialItem) OptionModule.m_CurrMaterial = m_SelectedMaterial - If Not IsNothing (MaterialItem.PropertiesList) then - PropertiesList = MaterialItem.PropertiesList - SelectedProperty = m_PropertiesList(0) + If Not IsNothing (MaterialItem.PropertiesList) Then + 'PropertiesList = MaterialItem.PropertiesList + SetPropertiesList(MaterialItem.PropertiesList) + 'SelectedProperty = m_PropertiesList(0) + SetProperty(m_PropertiesList(0)) Else PropertiesIsVisible = Visibility.Collapsed End if @@ -2019,8 +2042,10 @@ Public Class Part Private Function GetProperties(Index As Integer) As Integer ' se esiste l'elenco dei materiali (nuova configurazione) ma il ddf è senza: allora passo come materiale di default il primo della lista (wood) If IsNothing(m_SelectedMaterial) andalso OptionModule.m_MaterialList.Count > 0 Then - SelectedMaterial = OptionModule.m_MaterialList(0) - PropertiesList = OptionModule.m_MaterialList(0).PropertiesList + 'SelectedMaterial = OptionModule.m_MaterialList(0) + SetMaterial(OptionModule.m_MaterialList(0)) + 'PropertiesList = OptionModule.m_MaterialList(0).PropertiesList + SetPropertiesList(OptionModule.m_MaterialList(0).PropertiesList) End If ' devo verificare se esite la lista dei materiali Dim bPropertyExists = false diff --git a/DoorParameters/PartPageVM.vb b/DoorParameters/PartPageVM.vb index ac8af84..3e4c5d5 100644 --- a/DoorParameters/PartPageVM.vb +++ b/DoorParameters/PartPageVM.vb @@ -39,6 +39,10 @@ Public Class PartPageVM Public ReadOnly Property VisibilityTopShape As Visibility Get + ' se l'oggetto visualizzato esiste ed è un frame + If Not IsNothing(m_CurrPart) AndAlso m_CurrPart.TypePart.Contains("F") Then + Return Visibility.Collapsed + End If Return OptionModule.m_DisableArch End Get End Property diff --git a/HardwareManager/Hardware.vb b/HardwareManager/Hardware.vb index 408b4df..6194f03 100644 --- a/HardwareManager/Hardware.vb +++ b/HardwareManager/Hardware.vb @@ -287,23 +287,28 @@ Public Class Hardware ' creo le liste delle configurazioni Dim LocalHardwareListName As New ObservableCollection(Of String) Dim LocalHardwareListDDFName As New ObservableCollection(Of String) + ' se questo file non esiste dovrei interrompere il caricamento? If File.Exists(m_HardwareGeneral.Path & "\" & MATCHING_FILE_NAME) Then LocalHardwareListName.Add(MATCHING_FILE_AUTOMATIC) LocalHardwareListDDFName.Add(MATCHING_FILE_AUTOMATIC) - End If + End If + ' aggiungo alla lista il riferiemento "None" LocalHardwareListName.Add(MATCHING_FILE_NONE) LocalHardwareListDDFName.Add(MATCHING_FILE_NONE) - ' ricerco il capitolo nel file di configurazione della componente + ' ricerco il capitolo [Matching] nel file di configurazione della componente + ' carcio la lista "LocalHardwareListDDFName" l'elemco IniFile.GetPrivateProfileMatchHardware(ConstCompo.MATCHING_INI, "List", LocalHardwareListDDFName, LocalHardwareListName, m_HardwareGeneral.Path & "\" & CONFIGINI_FILE_NAME) - + ' verifico se esistano cartelle con estensione ".Frame" nel direttorio della componente If m_HardwareGeneral.FrameFolderList.Count > 0 Then + ' allora aggiungo alla lista il riferiento della compoenente stessa LocalHardwareListName.Add(m_HardwareGeneral.Name) LocalHardwareListDDFName.Add(m_HardwareGeneral.DDFName) End If - ' controllo che i nomi inseriti nella lista abbiano delle cartelle ".Frame" + ' rimuovo dall'elenco eventuali cartelle che non contengano cartelle con estensione ".Frame" For Each Item In Map.refCompoPanelHardwareVM.CompoTypeList For ElemntIndex As Integer = LocalHardwareListDDFName.Count - 1 To 0 Step -1 If Item.DDFName = LocalHardwareListDDFName(ElemntIndex) Then + ' se non esistono direttori ".Frame" nel cartella indicata allora rimuovo dalla lista If Item.FrameFolderList.Count < 1 Then Dim Index As Integer = LocalHardwareListName.IndexOf(Item.Name) LocalHardwareListName.RemoveAt(Index) @@ -313,18 +318,16 @@ Public Class Hardware End If Next Next - If LocalHardwareListDDFName.Count < 1 Then Return Nothing - ' creo l'oggetto da mostrare a video , 50224=Matching + ' aggiungo il primo parametro "Matching" (lista appena costruita) Dim ComboBoxMatch As New ComboBoxParam(ConstCompo.MATCHING_INI, EgtMsg(50224), CompoMatch, LocalHardwareListName, LocalHardwareListDDFName, LocalHardwareListName(0)) CompoMatch.CompoParamList.Add(ComboBoxMatch) If OptionModule.m_ConfigurationSoftware = ConfigType.Door Then CompoMatch.GroupVisibilityChapter = Visibility.Collapsed Return CompoMatch End Function - ' indica la selezione del tipo di Matching (in caso di associazione speciale restituisce l'elenco dei brand) - Public Function SelectMatching(ComboBoxMatch As ComboBoxParam, CompoMatch As Compo) As ObservableCollection(Of CompoBrandDir) - ' dalla lista che ho appena salvato devo recuperare l'elenco dei brand e dei file + ' Definita la componete che vogliamo associare restituice l'elenco di tutti i direttori con estensione ".Frame" + Public Function SelectMatching(ByRef ComboBoxMatch As ComboBoxParam, ByRef CompoMatch As Compo) As ObservableCollection(Of CompoBrandDir) Dim BrandList As New ObservableCollection(Of CompoBrandDir) For Each Item In Map.refCompoPanelHardwareVM.CompoTypeList If Item.Name = ComboBoxMatch.SelItem Then @@ -337,9 +340,10 @@ Public Class Hardware ' a seconda della scelta fatta nel passaggio precedente Aggiorna la grafica per mostrare l'elenco dei brand e dei file Public Sub SelectFileMatching(ComboBoxMatch As ComboBoxParam, BrandList As ObservableCollection(Of CompoBrandDir)) - ' dalla lista che ho appena salvato devo recuperare l'elenco dei brand e dei file - Dim BrandListGraphic As New ObservableCollection(Of String) + ' eseguo una copia locale della componente Matching Dim CompoMatch As Compo = ComboBoxMatch.CurrCompo + Dim BrandListGraphic As New ObservableCollection(Of String) + ' estrapolo dalla lista del BrandList For Each Item In Map.refCompoPanelHardwareVM.CompoTypeList If Item.Name = ComboBoxMatch.SelItem Then BrandList = Item.FrameFolderList @@ -350,7 +354,7 @@ Public Class Hardware End If Next ' prima di procedere ripulisco completamente l'elenco - If CompoMatch.CompoParamList.Count = 3 Then + If CompoMatch.CompoParamList.Count > 1 Then CompoMatch.CompoParamList.RemoveAt(2) CompoMatch.CompoParamList.RemoveAt(1) End If @@ -369,10 +373,16 @@ Public Class Hardware ' dalla scelta del brand restituisce la lista dei file corretta Public Sub SlectBrandMatching(ComboBoxBrand As ComboBoxParam) + ' eseguo una copia della componente Dim CurrCompo As Compo = ComboBoxBrand.CurrCompo + ' se il parametro che sto caricando non Brand allora esco + If CurrCompo.CompoParamList.Count < 2 Then Return + ' esguo una copia del parametro Matching Dim ComboBoxMatch As ComboBoxParam = DirectCast(CurrCompo.CompoParamList(0), ComboBoxParam) + ' definisco le liste dei brand (assegnata la componete di riferimento) Dim BrandListGraphic As New ObservableCollection(Of String) Dim BrandList As New ObservableCollection(Of CompoBrandDir) + ' ricavo l'elenco dei brand For Each Item In Map.refCompoPanelHardwareVM.CompoTypeList If Item.Name = ComboBoxMatch.SelItem Then BrandList = Item.FrameFolderList @@ -390,11 +400,13 @@ Public Class Hardware End If Next If Index = -1 Then Return - CurrCompo.CompoParamList.RemoveAt(2) + If CurrCompo.CompoParamList.Count > 1 Then + CurrCompo.CompoParamList.RemoveAt(2) + End If Dim FileList As New ObservableCollection(Of String) FileList = BrandList(Index).ModelFileList Dim ComboBoxTemplate As New ComboBoxParam(ConstCompo.BRAND_FILE_INI, EgtMsg(50226), CurrCompo, FileList, FileList, FileList(0)) - CurrCompo.CompoParamList.Add(ComboBoxTemplate) + CurrCompo.CompoParamList.Add(ComboBoxTemplate) End Sub #End Region ' Matching diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 55c04f3..680516c 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 296e1a8..4f0c0a3 100644 --- a/OptionsWindow/OptionModule.vb +++ b/OptionsWindow/OptionModule.vb @@ -236,7 +236,7 @@ Friend Module OptionModule IniFile.m_TemplateDir = sTemplateDir Else ' mantego l'accesso a quello di default - EgtOutLog(String.Format(EgtMsg(50180), sTemplateDir)) + EgtOutLog(String.Format(EgtMsg(50180), sTemplateDir & " (Directory Template)")) ' se il direttorio di default non esiste, lo creo If Not Directory.Exists(IniFile.m_TemplateDir) Then Directory.CreateDirectory(IniFile.m_TemplateDir) End If @@ -246,7 +246,7 @@ Friend Module OptionModule IniFile.m_MachinProject = sMachinDir Else ' mantengo l'accesso a quello di default - EgtOutLog(String.Format(EgtMsg(50180), sMachinDir)) + EgtOutLog(String.Format(EgtMsg(50180), sMachinDir & " (Directory Machine)")) End If Dim sListLabelDir As String = String.Empty @@ -254,7 +254,7 @@ Friend Module OptionModule IniFile.m_sListLabelDir = sListLabelDir Else ' mantengo l'accesso a quello di default - EgtOutLog(String.Format(EgtMsg(50180), sListLabelDir)) + EgtOutLog(String.Format(EgtMsg(50180), sListLabelDir & " (Directory Report)")) End If Dim sListLabelFile As String = String.Empty @@ -262,7 +262,7 @@ Friend Module OptionModule IniFile.m_sListLabelCurrent = sListLabelFile Else ' mantengo l'accesso a quello di default - EgtOutLog(String.Format(EgtMsg(50180), sListLabelFile)) + EgtOutLog(String.Format(EgtMsg(50180), sListLabelFile & " (File Report)")) End If Dim nHelpSelct As Integer = 0 @@ -709,31 +709,59 @@ Friend Module OptionModule End If End Sub - Friend Sub CreateNewPropertiesList(ByRef List As ObservableCollection(Of PropertyItem), ByRef SelectedMaterial As MaterialType) - If OptionModule.m_DisableProperties <> Visibility.Visible Then Return - If OptionModule.m_MaterialList.Count > 1 Then - SelectedMaterial = OptionModule.m_MaterialList(0) - List = OptionModule.m_MaterialList(0).PropertiesList - return - End if - ' configurazione senza materiali - If List.Count > 0 Then List.Clear() - For Each Item In OptionModule.m_PropertList - List.Add(New PropertyItem(Item.Name, Item.GraphicName, Item.IsChecked)) - Next - End Sub + 'Friend Sub CreateNewPropertiesList(ByRef List As ObservableCollection(Of PropertyItem), ByRef SelectedMaterial As MaterialType) + ' If OptionModule.m_DisableProperties <> Visibility.Visible Then Return + ' If OptionModule.m_MaterialList.Count > 1 Then + ' SelectedMaterial = OptionModule.m_MaterialList(0) + ' List = OptionModule.m_MaterialList(0).PropertiesList + ' Return + ' End If + ' ' configurazione senza materiali + ' If List.Count > 0 Then List.Clear() + ' For Each Item In OptionModule.m_PropertList + ' List.Add(New PropertyItem(Item.Name, Item.GraphicName, Item.IsChecked)) + ' Next + 'End Sub - Friend Sub CreateNewPropertiesListJamb(ByRef List As ObservableCollection(Of PropertyItem), ByRef SelectedMaterial As MaterialType) + 'Friend Sub CreateNewPropertiesListJamb(ByRef List As ObservableCollection(Of PropertyItem), ByRef SelectedMaterial As MaterialType) + ' If OptionModule.m_DisableProperties <> Visibility.Visible Then Return + ' If OptionModule.m_MaterialList.Count > 1 Then + ' SelectedMaterial = OptionModule.m_MaterialList(0) + ' List = OptionModule.m_MaterialList(0).PropertiesList + ' Return + ' End If + ' ' configurazione senza materiali + ' If List.Count > 0 Then List.Clear() + ' For Each Item In OptionModule.m_PropertList + ' List.Add(New PropertyItem(Item.Name, Item.GraphicName, Item.IsChecked)) + ' Next + 'End Sub + + Friend Sub CreateNewPropertiesList(ByRef LocalPart As Part) If OptionModule.m_DisableProperties <> Visibility.Visible Then Return If OptionModule.m_MaterialList.Count > 1 Then - SelectedMaterial = OptionModule.m_MaterialList(0) - List = OptionModule.m_MaterialList(0).PropertiesList + LocalPart.SetMaterial(OptionModule.m_MaterialList(0)) + LocalPart.SetPropertiesList(OptionModule.m_MaterialList(0).PropertiesList) Return End If ' configurazione senza materiali - If List.Count > 0 Then List.Clear() + If LocalPart.PropertiesList.Count > 0 Then LocalPart.PropertiesList.Clear() For Each Item In OptionModule.m_PropertList - List.Add(New PropertyItem(Item.Name, Item.GraphicName, Item.IsChecked)) + LocalPart.PropertiesList.Add(New PropertyItem(Item.Name, Item.GraphicName, Item.IsChecked)) + Next + End Sub + + Friend Sub CreateNewPropertiesListJamb(ByRef LocalPart As Part) + If OptionModule.m_DisableProperties <> Visibility.Visible Then Return + If OptionModule.m_MaterialList.Count > 1 Then + LocalPart.SetMaterial(OptionModule.m_MaterialList(0)) + LocalPart.SetPropertiesList(OptionModule.m_MaterialList(0).PropertiesList) + Return + End If + ' configurazione senza materiali + If LocalPart.PropertiesList.Count > 0 Then LocalPart.PropertiesList.Clear() + For Each Item In OptionModule.m_PropertList + LocalPart.PropertiesList.Add(New PropertyItem(Item.Name, Item.GraphicName, Item.IsChecked)) Next End Sub diff --git a/SceneManager/SceneManagerVM.vb b/SceneManager/SceneManagerVM.vb index 779e139..560725e 100644 --- a/SceneManager/SceneManagerVM.vb +++ b/SceneManager/SceneManagerVM.vb @@ -9,6 +9,8 @@ Public Class SceneManagerVM Implements INotifyPropertyChanged Friend bProtectKey As Boolean = True + Friend EnableRefresh As Boolean = True + Private m_ShowPanel As ShowPanelV Public ReadOnly Property ShowPanel As ShowPanelV Get @@ -314,7 +316,7 @@ Public Class SceneManagerVM ' eseguo If Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nDDFPage Then ' Verifico esista elemento selezionato - If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) orelse IsNothing(Map.refPartPageVM.CurrPart) Then Return + If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) OrElse IsNothing(Map.refPartPageVM.CurrPart) Then Return DdfFile.WriteDDFPart(Map.refPartPageVM.CurrPart, sTempFile, True, False) ExecDoors(m_ProjectScene, sTempFile, False) ' mantengo i layer accesi @@ -324,6 +326,7 @@ Public Class SceneManagerVM EgtDraw() ShowGraphicError() 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 DdfFile.WriteDDFAssembly(Map.refAssemblyPageVM.CurrAssembly, sTempFile, True)