From e015302fc3e8a69812abca2804cdd6b40768d06e Mon Sep 17 00:00:00 2001 From: Nicola Pievani Date: Thu, 15 Nov 2018 14:24:15 +0000 Subject: [PATCH] =?UTF-8?q?EgtDOORCreator=201.9k3=20:=20-=20nuovo=20parame?= =?UTF-8?q?tro=20nell'HardwareManager=20(ActiveBox);=20-=20nuovo=20valore?= =?UTF-8?q?=20per=20il=20capitolo=20nascosto=20(IsActive=20=3D=203);=20-?= =?UTF-8?q?=20non=20mostro=20a=20video=20il=20capitolo=20Matching=20File?= =?UTF-8?q?=20se=20sono=20in=20modalit=C3=A0=20Door;=20-=20apertura=20dell?= =?UTF-8?q?'ultimo=20file=20dall'elenco=20dei=20file=20aperti=20(=20modali?= =?UTF-8?q?t=C3=A0=20Single=20Door);=20-=20red=20cross=20migliorata;=20-?= =?UTF-8?q?=20correzione=20pulsante=20duplica=20nell'HardwareManager=20(?= =?UTF-8?q?=20gestione=20file=20nge);=20-=20possibilit=C3=A0=20di=20invert?= =?UTF-8?q?ire=20il=20bevel=20sulle=20porte=20inattive=20(=20lato=20LockEd?= =?UTF-8?q?ge)=20-=20new=20project=20=C3=A8=20stato=20corretto.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DdfFile.vb | 22 ++++++++++++++--- DoorParameters/Compo.vb | 1 + DoorParameters/Part.vb | 26 +++++++++++++++++++- DoorParameters/PartPageV.xaml | 12 +++++++++- DoorParameters/PartPageVM.vb | 17 +++++++++++++ HardwareManager/Hardware.vb | 38 +++++++++++++++++++++++++----- HardwareManager/HardwarePageV.xaml | 3 ++- OptionsWindow/OptionsV.xaml | 26 ++++++++++---------- ProjectManager/ProjectManagerVM.vb | 11 +++++---- 9 files changed, 127 insertions(+), 29 deletions(-) diff --git a/DdfFile.vb b/DdfFile.vb index 4aee84e..597588c 100644 --- a/DdfFile.vb +++ b/DdfFile.vb @@ -225,7 +225,7 @@ Friend Module DdfFile End If '---------------------------------------------------------------------------------------------------------------------------------------------------- DdfFileContent.Add("" & ConstCompo.S_PROFILES & ":") - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_LOCKEDGE & ": " & SetBevel(Part.TypePart, Part.LockEdgeType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name)) + DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_LOCKEDGE & ": " & SetBevel(Part.TypePart, Part.LockEdgeType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name, Part.InvertBevel)) DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.LockEdgeMachining)) If Not StringToDouble(Part.LockEdgeOverMaterial, dVal) Then MessageBox.Show(String.Format(EgtMsg(50141), K_LOCKEDGEOVERMATERIAL_INI), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error) @@ -453,7 +453,7 @@ Friend Module DdfFile DdfFileContent.Add("") '---------------------------------------------------------------------------------------------------------------------------------------------------- DdfFileContent.Add("" & ConstCompo.S_PROFILES & ":") - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_LOCKEDGE & ": " & SetBevel(Part.TypePart, Part.LockEdgeType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name)) + DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_LOCKEDGE & ": " & SetBevel(Part.TypePart, Part.LockEdgeType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name, Part.InvertBevel)) DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.LockEdgeMachining)) If Not StringToDouble(Part.LockEdgeOverMaterial, dVal) Then MessageBox.Show(String.Format(EgtMsg(50141), K_LOCKEDGEOVERMATERIAL_INI), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error) @@ -971,8 +971,24 @@ Friend Module DdfFile End Function ' calcola il bevel da stamapare nel ddf - Public Function SetBevel(sTypePart As String, sCurrBevel As String, DispositionItem As String, sSwing As String) As String + Public Function SetBevel(sTypePart As String, sCurrBevel As String, ByVal DispositionItem As String, sSwing As String, Optional ByVal InvertBevel As Boolean = False, Optional CurrSecure As String = "") As String If sTypePart.Contains(ConstGen.PART_DO_) Then + If InvertBevel Then + If sCurrBevel = ConstGen.BEVEL_GRAPHIC And DispositionItem = ConstGen.BEVEL_DOWN Then + Return ConstGen.BEVEL_UP + ElseIf sCurrBevel = ConstGen.BEVEL_GRAPHIC And DispositionItem = ConstGen.BEVEL_UP Then + Return ConstGen.BEVEL_DOWN + ElseIf sCurrBevel = ConstGen.BEVEL_GRAPHIC And DispositionItem <> ConstGen.BEVEL_UP And DispositionItem <> ConstGen.BEVEL_DOWN Then + If sSwing.Contains(ConstGen.HAND_REVERSE) Then + Return ConstGen.BEVEL_UP + Else + Return ConstGen.BEVEL_DOWN + End If + Else + Return sCurrBevel + End If + End If + If sCurrBevel = ConstGen.BEVEL_GRAPHIC And DispositionItem = ConstGen.BEVEL_DOWN Then Return ConstGen.BEVEL_DOWN ElseIf sCurrBevel = ConstGen.BEVEL_GRAPHIC And DispositionItem = ConstGen.BEVEL_UP Then diff --git a/DoorParameters/Compo.vb b/DoorParameters/Compo.vb index dbb9569..68605f2 100644 --- a/DoorParameters/Compo.vb +++ b/DoorParameters/Compo.vb @@ -183,6 +183,7 @@ Public Class Compo End Set End Property + ' utilizzato nel HardwareManager per nascondere un capitolo Private m_GroupVisibilityChapter As Visibility = Visibility.Visible Public Property GroupVisibilityChapter As Visibility Get diff --git a/DoorParameters/Part.vb b/DoorParameters/Part.vb index 07608f8..f265328 100644 --- a/DoorParameters/Part.vb +++ b/DoorParameters/Part.vb @@ -418,6 +418,12 @@ Public Class Part Private m_Swing As String = Nothing Public Property Swing As String Get + ' abilita il pulsante per invertire il bevel sulla lock + If m_Swing.Contains("I") Then + Map.refPartPageVM.IsInactive = True + Else + Map.refPartPageVM.IsInactive = False + End If Return m_Swing End Get Set(value As String) @@ -556,6 +562,18 @@ Public Class Part NotifyPropertyChanged("BottomType") End Sub + Private m_InvertBevel As Boolean = False + Public Property InvertBevel As Boolean + Get + Return m_InvertBevel + End Get + Set(value As Boolean) + m_InvertBevel = value + NotifyPropertyChanged("InvertBevel") + Map.refSceneManagerVM.RefreshBtn() + End Set + End Property + #End Region ' Edge #Region "MACHINING" @@ -1582,7 +1600,7 @@ Public Class Part If m_HingeEdgeType.Name = ConstGen.BEVEL_GRAPHIC Then sBevelHinge = m_HingeEdgeType.BevelDDF If m_TopType.Name = ConstGen.BEVEL_GRAPHIC Then sBevelTop = m_TopType.BevelDDF If m_BottomType.Name = ConstGen.BEVEL_GRAPHIC Then sBevelBottom = m_BottomType.BevelDDF - ' controllo che i bevel siano tutti uguali nello stesso Part + ' controllo che i bevel siano tutti uguali nello stesso Part ( tranne che nelle inattive) Bevel = ControlBevel(sBevelLock, sBevelHinge, sBevelTop, sBevelBottom) ' nel caso di nessuna disposizione fissata da Config.ini Select Case OptionModule.m_sDisposition @@ -2305,6 +2323,12 @@ Public Class Part If Not String.IsNullOrEmpty(ArrayProfile(Index1)) And Not String.IsNullOrEmpty(ArrayProfile(Index2)) Then ' eseguo il confronto If ArrayProfile(Index1) <> ArrayProfile(Index2) Then + If m_Swing.Contains("I") Then + If (Index1 = 0 OrElse Index2 = 0) Then + InvertBevel = True + Continue For + End If + End If ' 50101 =Error ' 50170 =Incongruity between the bevel, it has been resolved by default. MessageBox.Show(EgtMsg(50170), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error) diff --git a/DoorParameters/PartPageV.xaml b/DoorParameters/PartPageV.xaml index 0cf6431..8df30db 100644 --- a/DoorParameters/PartPageV.xaml +++ b/DoorParameters/PartPageV.xaml @@ -216,7 +216,17 @@ IsChecked="{Binding CurrPart.BottomMachining}" IsEnabled="{Binding IsRaedOnly, Converter={StaticResource TrueToFalse}}"/> - + + + 0 Then ' verifico se esisteva un file selzionato, e che quetso esista ancora @@ -148,6 +160,7 @@ Public Class Hardware End Get Set(value As ObservableCollection(Of String)) m_TemplateList = value + DoRefresh = False NotifyPropertyChanged("TemplateList") End Set End Property @@ -308,7 +321,7 @@ Public Class Hardware ' creo l'oggetto da mostrare a video , 50224=Matching 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 @@ -405,9 +418,15 @@ Public Class Hardware Public Function DeleteTempFile() As Boolean Dim CurrHardwareFile As String = String.Empty Dim ModelDir As String = String.Empty - If IsNothing(m_SelBrand) Then Return False - If m_SelBrand.ModelDir <> RegexFunction.ModelTemplate(m_HardwareGeneral.Path) Then ModelDir = m_SelBrand.ModelDirGraphic & "\" - CurrHardwareFile = m_HardwareGeneral.Path & "\" & ModelDir & ConstGen.TEMP_FILE_HARDWARE + If Not IsNothing(m_SelBrand) Then + If m_SelBrand.ModelDir <> RegexFunction.ModelTemplate(m_HardwareGeneral.Path) Then ModelDir = m_SelBrand.ModelDirGraphic & "\" + CurrHardwareFile = m_HardwareGeneral.Path & "\" & ModelDir & ConstGen.TEMP_FILE_HARDWARE + End If + If Not IsNothing(m_LastDirectory) Then + If m_LastDirectory.ModelDir <> RegexFunction.ModelTemplate(m_HardwareGeneral.Path) Then ModelDir = m_LastDirectory.ModelDirGraphic & "\" + CurrHardwareFile = m_HardwareGeneral.Path & "\" & ModelDir & ConstGen.TEMP_FILE_HARDWARE + End If + If String.IsNullOrWhiteSpace(CurrHardwareFile) Then Return False Try File.Delete(CurrHardwareFile) Catch ex As Exception @@ -624,7 +643,7 @@ Public Class Hardware ' legge se è attivo Dim nIsActive As Integer = StdTemplateGetPrivateProfileInt(S_CHAPTER & ChapterIndex, K_ISACTIVE, nIsActive) ' verifico che non stia leggendo un nuovo hardware - If Not bNewHardware And nIsActive <> 2 Then + If Not bNewHardware And nIsActive > 3 Then nIsActive = 0 End If Select Case nIsActive @@ -637,6 +656,10 @@ Public Class Hardware Case 2 Chapter.SetIsFixed(True) Chapter.SetIsActiveChapter(True) + Case 3 + Chapter.SetIsFixed(False) + Chapter.SetIsActiveChapter(False) + Chapter.GroupVisibilityChapter = Visibility.Collapsed End Select While EgtUILib.GetPrivateProfileString(S_CHAPTER & ChapterIndex, K_PARAM & ParamIndex, "", sParam, m_StdTemplate) > 0 ' Verifico che esista il parametro nuovo "Param-ParamIndex" @@ -654,9 +677,12 @@ Public Class Hardware ChapterIndex += 1 End While ' termina lettura della configurazione Dim LocalCompoMatch As Compo = CreateChapterMatching() - If Not IsNothing(LocalCompoMatch) Then + If Not IsNothing(LocalCompoMatch) AndAlso LocalCompoMatch.GroupVisibilityChapter = Visibility.Visible Then LocalCompoMatch.SetIsFixed(True) GroupChapters.Add(LocalCompoMatch) + Else + LocalCompoMatch.SetIsFixed(False) + GroupChapters.Add(LocalCompoMatch) End If End Sub diff --git a/HardwareManager/HardwarePageV.xaml b/HardwareManager/HardwarePageV.xaml index 250afb4..ab5e7d9 100644 --- a/HardwareManager/HardwarePageV.xaml +++ b/HardwareManager/HardwarePageV.xaml @@ -96,12 +96,13 @@ Name="HardwareParamsItemsControl" ItemsSource="{Binding CurrHardware.GroupChapters}" Style="{StaticResource DoorParamsItemsControlStyle}"> + - + - - + + - - - + Margin="6.8,12,7,17.8" + Style="{StaticResource DoorParamsChBx}" /> + + + - + - + diff --git a/ProjectManager/ProjectManagerVM.vb b/ProjectManager/ProjectManagerVM.vb index 9077521..6e2ca93 100644 --- a/ProjectManager/ProjectManagerVM.vb +++ b/ProjectManager/ProjectManagerVM.vb @@ -180,7 +180,7 @@ Public Class ProjectManagerVM Dim SaveFileDialog As New MySaveFileDialogVM Dim SaveFileDialogWnd As New EgtWPFLib5.SaveFileDialogV(Application.Current.MainWindow, SaveFileDialog) SaveFileDialog.Title = EgtMsg(50304) - SaveFileDialog.Directory = IniFile.m_MyProjectDir & "\" + SaveFileDialog.Directory = IniFile.m_MyProjectDir SaveFileDialog.Extension = "\" If Not SaveFileDialogWnd.ShowDialog Then Map.refAssemblyManagerVM.Open(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) @@ -204,6 +204,9 @@ Public Class ProjectManagerVM ' salvo il riferimento al progetto corrente m_CurrProject = CurrProject ' salvo path progetto + If SaveFileDialog.FileName.EndsWith("\") Then + SaveFileDialog.FileName = SaveFileDialog.FileName.Remove(SaveFileDialog.FileName.LastIndexOf("\")) + End If CurrProject.Name = SaveFileDialog.FileName ' Ripulisco lista porte CurrProject.AssemblyList.Clear() @@ -218,9 +221,9 @@ Public Class ProjectManagerVM ' dichiaro la finestra di dialogo Dim saveFileDialog1 As New System.Windows.Forms.SaveFileDialog() - saveFileDialog1.Filter = "ddf files (*.ddf)|*.ddf" + saveFileDialog1.Filter = "(*.ddf) |*.ddf" saveFileDialog1.FilterIndex = 2 - saveFileDialog1.RestoreDirectory = True + saveFileDialog1.InitialDirectory = Map.refOptionsVM.MyProjectDir ' apro la finestra di dialogo If saveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then Dim FilePathComplete As String = saveFileDialog1.FileName @@ -324,7 +327,7 @@ Public Class ProjectManagerVM fd.InitialDirectory = IniFile.m_MyProjectDir End If ' seleziono il filtro di apertura - fd.Filter = " (*.ddf)|*.ddf|(*.ddf)|*.ddf" + fd.Filter = "(*.ddf) |*.ddf|(*.ddt) |*.ddt" fd.FilterIndex = 2 fd.RestoreDirectory = True ' apro la finestra di dialogo