diff --git a/Assembly/Assembly.vb b/Assembly/Assembly.vb index 2982d4f..c5aaa46 100644 --- a/Assembly/Assembly.vb +++ b/Assembly/Assembly.vb @@ -1618,46 +1618,47 @@ Public Class Assembly Select Case DoorNumber Case "1" ' aggiorno l'elenco dello swing della porta - GetArrayPartDoor(0).Door.SwingTypeList = OptionModule.m_SwingTypeListSinlgeDoor - GetArrayPartDoor(0).Door.SetSwing(GetArrayPartDoor(0).Door.SwingTypeList(GetArrayPartDoor(0).Door.SwingTypeList.IndexOf(sSwing))) - ' aggiorno gli swing sui Jamb (tutti hanno lo stesso swing) - If m_LeftJamb.Swing.Contains("L") AndAlso Not sSwing.Contains("L") Then - Dim JambAppo As Part - JambAppo = m_LeftJamb - m_LeftJamb = m_RightJamb - m_RightJamb = JambAppo - ElseIf Not m_LeftJamb.Swing.Contains("L") AndAlso sSwing.Contains("L") Then - Dim JambAppo As Part - JambAppo = m_LeftJamb - m_LeftJamb = m_RightJamb - m_RightJamb = JambAppo - End If - LeftJamb.SetSwing(GetArrayPartDoor(0).Door.Swing) - TopJamb.SetSwing(GetArrayPartDoor(0).Door.Swing) - RightJamb.SetSwing(GetArrayPartDoor(0).Door.Swing) - BottomJamb.SetSwing(GetArrayPartDoor(0).Door.Swing) - If Map.refAssemblyPageVM.CurrAssembly.Exterior Then - If LeftJamb.Swing.Contains("L") Then - LeftJamb.TypePart = "FL_HE" - RightJamb.TypePart = "FR_LE" - Else - LeftJamb.TypePart = "FL_LE" - RightJamb.TypePart = "FR_HE" + If Not GetArrayPartDoor(0).Door.IsNotAssembly Then + GetArrayPartDoor(0).Door.SwingTypeList = OptionModule.m_SwingTypeListSinlgeDoor + GetArrayPartDoor(0).Door.SetSwing(GetArrayPartDoor(0).Door.SwingTypeList(GetArrayPartDoor(0).Door.SwingTypeList.IndexOf(sSwing))) + ' aggiorno gli swing sui Jamb (tutti hanno lo stesso swing) + If m_LeftJamb.Swing.Contains("L") AndAlso Not sSwing.Contains("L") Then + Dim JambAppo As Part + JambAppo = m_LeftJamb + m_LeftJamb = m_RightJamb + m_RightJamb = JambAppo + ElseIf Not m_LeftJamb.Swing.Contains("L") AndAlso sSwing.Contains("L") Then + Dim JambAppo As Part + JambAppo = m_LeftJamb + m_LeftJamb = m_RightJamb + m_RightJamb = JambAppo End If - BottomJamb.TypePart = "FB_BE" - TopJamb.TypePart = "FT_TE" - Else - If LeftJamb.Swing.Contains("L") Then - LeftJamb.TypePart = "FL_H" - RightJamb.TypePart = "FR_L" + LeftJamb.SetSwing(GetArrayPartDoor(0).Door.Swing) + TopJamb.SetSwing(GetArrayPartDoor(0).Door.Swing) + RightJamb.SetSwing(GetArrayPartDoor(0).Door.Swing) + BottomJamb.SetSwing(GetArrayPartDoor(0).Door.Swing) + If Map.refAssemblyPageVM.CurrAssembly.Exterior Then + If LeftJamb.Swing.Contains("L") Then + LeftJamb.TypePart = "FL_HE" + RightJamb.TypePart = "FR_LE" + Else + LeftJamb.TypePart = "FL_LE" + RightJamb.TypePart = "FR_HE" + End If + BottomJamb.TypePart = "FB_BE" + TopJamb.TypePart = "FT_TE" Else - LeftJamb.TypePart = "FL_L" - RightJamb.TypePart = "FR_H" + If LeftJamb.Swing.Contains("L") Then + LeftJamb.TypePart = "FL_H" + RightJamb.TypePart = "FR_L" + Else + LeftJamb.TypePart = "FL_L" + RightJamb.TypePart = "FR_H" + End If + BottomJamb.TypePart = "FB_B" + TopJamb.TypePart = "FT_T" End If - BottomJamb.TypePart = "FB_B" - TopJamb.TypePart = "FT_T" End If - NotifyPropertyChanged("CurrAssembly") Case "2" diff --git a/Assembly/AssemblyPageVM.vb b/Assembly/AssemblyPageVM.vb index a6f7e9d..e442c46 100644 --- a/Assembly/AssemblyPageVM.vb +++ b/Assembly/AssemblyPageVM.vb @@ -253,6 +253,7 @@ Public Class AssemblyPageVM End Property Public Sub ShowOrder() + Map.refAssemblyManagerVM.NewAssembly = True Map.refAssemblyManagerVM.OpenSelectedAssembly(Map.refAssemblyManagerVM.SelectedAssembly) End Sub #End Region ' Comand diff --git a/Constants/ConstGen.vb b/Constants/ConstGen.vb index 4fee8c6..dabd22e 100644 --- a/Constants/ConstGen.vb +++ b/Constants/ConstGen.vb @@ -46,4 +46,6 @@ Module ConstGen ' File ddf utilizzato per mostrare tutto l'assemblato corrente Public Const TEMP_ASSEMBLY As String = "CurrAssembly.ddf" Public Const TEMP_FILE_TXT As String = "CurrDoor.txt" + Public Const TEMP_PART_TXT As String = "CurrPart.txt" End Module + diff --git a/DoorManager/AssemblyManagerVM.vb b/DoorManager/AssemblyManagerVM.vb index d81af10..d5b2d0f 100644 --- a/DoorManager/AssemblyManagerVM.vb +++ b/DoorManager/AssemblyManagerVM.vb @@ -8,7 +8,7 @@ Public Class AssemblyManagerVM ' percorso della porta corrente (creata o già esistente nella cartella) - Private NewAssembly As Boolean = False + Friend NewAssembly As Boolean = False Friend DeleteNewPart As Integer = 1 Private SelAssembly As New Assembly @@ -62,6 +62,7 @@ Public Class AssemblyManagerVM Private CreateRabbet As Boolean = False #Region "Apertura e salvataggio" Public Sub RemoveFromAssemblyList() + NewAssembly = False Dim SelIndex As Integer = m_CurrProject.AssemblyList.IndexOf(m_SelectedAssembly) m_CurrProject.AssemblyList.Remove(m_SelectedAssembly) CurrProject.NotifyPropertyChanged("AssemblyList") @@ -74,6 +75,7 @@ Public Class AssemblyManagerVM m_SelectedAssembly = m_CurrProject.AssemblyList(SelIndex) OpenSelectedAssembly(SelectedAssembly) End If + CurrProject.NotifyPropertyChanged("AssemblyList") ' se non ci sono altre porte nella lista allora Else ' elimino qualsiasi resto di porta @@ -141,13 +143,15 @@ Public Class AssemblyManagerVM If Not IsNothing(SelectedAssembly) Then If Not IsNothing(m_SelectedAssembly.Name) AndAlso m_SelectedAssembly.Name = value.Name Then Dim OredrWindow As New OrderV(Application.Current.MainWindow, Map.refOrderVM) - bSaveCurrent = False - OredrWindow.ShowDialog() + bSaveCurrent = True + If NewAssembly Then + OredrWindow.ShowDialog() + NewAssembly = False + End If Else bSaveCurrent = SaveCurrentAssembly() SelectedAssembly = value - End If - 'bSaveCurrent = False + End If Else bSaveCurrent = SaveCurrentAssembly() SelectedAssembly = value @@ -160,7 +164,12 @@ Public Class AssemblyManagerVM If IsNothing(Map.refAssemblyPageVM.CurrAssembly) Then Return False End If - DdfFile.WriteDDFAssembly(Map.refAssemblyPageVM.CurrAssembly, IniFile.m_sTempDir & "\" & TEMP_ASSEMBLY, True) + If OptionModule.m_ConfigurationSoftware = "Door" Then + DdfFile.WriteDDFPart(Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door, m_SelectedAssembly.Name, True, False) + Else + DdfFile.WriteDDFAssembly(Map.refAssemblyPageVM.CurrAssembly, m_SelectedAssembly.Name, True) + End If + 'DdfFile.WriteDDFAssembly(Map.refAssemblyPageVM.CurrAssembly, IniFile.m_sTempDir & "\" & TEMP_ASSEMBLY, True) 'Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nAssemblyPage NotifyPropertyChanged("SelectedAssembly") ' se è avvenuta la modifica dei valori dei bevel devo avvisare che vi è stata una modifica @@ -190,6 +199,7 @@ Public Class AssemblyManagerVM NotifyPropertyChanged("SelectedAssembly") Return True End If + NewAssembly = False 'NotifyPropertyChanged("SelectedAssembly") Else Return False @@ -406,18 +416,19 @@ Public Class AssemblyManagerVM Dim ImportTemplate As String = String.Empty '--------------------------------------------------------------------------------------------------------------------------------------------------- ' CHIEDO SE SI VUOLE IMPOTRTARE UN TEMPLATE - - ''Prima di tutto chiedo se vuole aprire un template - 'If MessageBox.Show(EgtMsg(50146), EgtMsg(50110), MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes) = MessageBoxResult.Yes Then - ' ' Apro la finestra di dailogo aperta direttamente sulla cartella cercata - ' Dim OpenFileDialog As New System.Windows.Forms.OpenFileDialog - ' OpenFileDialog.InitialDirectory = IniFile.m_TemplateDir - ' If OpenFileDialog.ShowDialog <> Forms.DialogResult.OK Then - ' ' se la risposta è diversa da OK esce - ' Return + 'If OptionModule.m_ConfigurationSoftware = "Door" Then + ' 'Prima di tutto chiedo se vuole aprire un template + ' If MessageBox.Show(EgtMsg(50146), EgtMsg(50110), MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes) = MessageBoxResult.Yes Then + ' ' Apro la finestra di dailogo aperta direttamente sulla cartella cercata + ' Dim OpenFileDialog As New System.Windows.Forms.OpenFileDialog + ' OpenFileDialog.InitialDirectory = IniFile.m_TemplateDir + ' If OpenFileDialog.ShowDialog <> Forms.DialogResult.OK Then + ' ' se la risposta è diversa da OK esce + ' Return + ' End If + ' ' carico l'indirizzo del template che voglio aprire + ' ImportTemplate = OpenFileDialog.FileName ' End If - ' ' carico l'indirizzo del template che voglio aprire - ' ImportTemplate = OpenFileDialog.FileName 'End If '---------------------------------------------------------------------------------------------------------------------------------------------------- ' lancio la finestra per la creazione di una nuova porta @@ -467,22 +478,24 @@ Public Class AssemblyManagerVM CurrProject.NotifyPropertyChanged("AssemblyList") '------------------------------------------------------------------------------------------------------------------------------------------------ ' LETTURA DI UN FILE DI TIPO TEMPLATE - - 'If String.IsNullOrEmpty(ImportTemplate) Then - ' NewAssembly = True - 'Else - ' ' !!!!se sto aprendo un template significa che devo leggere un file già esistente!!!! - ' NewAssembly = False - ' ' creo il file ddf associato al template - ' Dim TemplateDoor As New Part - ' Part.ReadDDF(ImportTemplate, TemplateDoor) - ' WriteDDF(TemplateDoor, SaveFileDialog.FileName, False) + 'If OptionModule.m_ConfigurationSoftware = "Door" Then + ' If String.IsNullOrEmpty(ImportTemplate) Then + ' NewAssembly = True + ' Else + ' ' !!!!se sto aprendo un template significa che devo leggere un file già esistente!!!! + ' NewAssembly = False + ' ' creo il file ddf associato al template + ' Map.refAssemblyPageVM.CurrAssembly = CreateNewAssembly(ImportTemplate) + ' Assembly.ReadDDFAssembly(ImportTemplate, Map.refAssemblyPageVM.CurrAssembly) + ' DdfFile.WriteDDFPart(Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door, Local_AssemblyName.Name, True, False) + ' End If 'End If '------------------------------------------------------------------------------------------------------------------------------------------------ ' carico il nome ceme Assemblato selezionato Dim OredrWindow As New OrderV(Application.Current.MainWindow, New OrderVM()) 'OredrWindow.Show() OredrWindow.ShowDialog() + NewAssembly = True OpenSelectedAssembly(Local_AssemblyName) End Sub diff --git a/DoorParameters/Part.vb b/DoorParameters/Part.vb index 4733e79..62b3293 100644 --- a/DoorParameters/Part.vb +++ b/DoorParameters/Part.vb @@ -849,16 +849,6 @@ Public Class Part ElseIf Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.CompoList.IndexOf(CompoToRemove.refJambCompo) > -1 Then Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.RemoveCompo(CompoToRemove.refJambCompo) End If - 'ElseIf Not IsNothing(CompoToRemove.refCompoDoor) Then - ' If Me.TypePart = "DO_1" Then - ' If Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(1).Door.CompoList.IndexOf(CompoToRemove.refCompoDoor) > -1 Then - ' Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(1).Door.RemoveCompo(CompoToRemove.refCompoDoor) - ' End If - ' ElseIf Me.TypePart = "DO_2" Then - ' If Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.CompoList.IndexOf(CompoToRemove.refCompoDoor) > -1 Then - ' Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.RemoveCompo(CompoToRemove.refCompoDoor) - ' End If - ' End If End If CompoList.Remove(CompoToRemove) End Sub @@ -1083,7 +1073,6 @@ Public Class Part ' End If ' End If 'End Sub - Shared Sub ReadDDFPartDoor(ArrayFile() As String, ByRef LineIndex As Integer, ByRef ReadDoor As Part) Dim InvalidValue As String = String.Empty ' controllo se esite il file DDF @@ -2076,10 +2065,14 @@ Public Class Part End If End If Else - ' se cè una riga vuota passo alla succesiva - IndexLine += 1 - ' e continua a cercare lo stesso parametro - IndexParam -= 1 + ' '' se cè una riga vuota passo alla succesiva + ''IndexLine += 1 + ' '' e continua a cercare lo stesso parametro + ''IndexParam -= 1 + ' significa che la TextBoxOnOff è stata disattivata + DirectCast(CurrCompoParam, TextBoxOnOffParam).IsActive = False + 'IndexLine = IndexLine - 1 + Exit For End If Else ' se la textBoxOnOff è l'ultima della lista (quindi seguita da uno psazio vuoto) allora considero che sia disattivata diff --git a/DoorParameters/PartPageV.xaml b/DoorParameters/PartPageV.xaml index 9e009ba..c888df9 100644 --- a/DoorParameters/PartPageV.xaml +++ b/DoorParameters/PartPageV.xaml @@ -305,8 +305,7 @@ Style="{StaticResource DoorParamsTxBx}" IsEnabled="{Binding IsChecked, ElementName=ChBx}" Margin="0,0,0,2" - ToolTip="{Binding ToolTipValue,UpdateSourceTrigger=PropertyChanged}" - IsReadOnly="{Binding IsReadOnly}"/> + ToolTip="{Binding ToolTipValue,UpdateSourceTrigger=PropertyChanged}"/> diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index f7ecf2c..1a5a106 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 1867f02..19a3e3d 100644 --- a/OptionsWindow/OptionModule.vb +++ b/OptionsWindow/OptionModule.vb @@ -119,6 +119,16 @@ Friend Module OptionModule If Not EgtLoadMessages(sMsgFilePath) Then EgtOutLog(EgtMsg(50127)) End If + + 'i valori della pagina dell'assemblato + Dim Config As String = String.Empty + GetPrivateProfileString(S_GENERAL, S_RUNAS, "1", Config) + If Config = "0" Then + m_ConfigurationSoftware = "Door" + Else + m_ConfigurationSoftware = "Assembly" + End If + ' imposto unità di misura per interfaccia utente m_bIsMmUnit = (GetPrivateProfileInt(S_SCENE, K_MMUNITS, 1) <> 0) EgtSetUiUnits(m_bIsMmUnit) @@ -267,10 +277,7 @@ Friend Module OptionModule ' carico l'ordinamento dei bottoni DefaultGetPrivateProfileList(S_COMPOORDER, K_COMPOORDER_INI, m_CompoPaneOrder) '----------------------------------------------------------------------------------------------------------------- - 'i valori della pagina dell'assemblato - Dim Config As String = String.Empty - GetPrivateProfileString(K_CONFIGURATION, S_RUNAS, "Assembly", Config) - m_ConfigurationSoftware = Config + Dim ThicknessJamb As String = String.Empty DefaultGetPrivateProfileString(S_SIZEJAMB, K_THICKNESS, "25", ThicknessJamb) m_ThicknessJamb = ThicknessJamb diff --git a/SceneManager/Refresh/RefreshPanelVM.vb b/SceneManager/Refresh/RefreshPanelVM.vb index f021e6e..2ff5dc1 100644 --- a/SceneManager/Refresh/RefreshPanelVM.vb +++ b/SceneManager/Refresh/RefreshPanelVM.vb @@ -175,7 +175,6 @@ Public Class RefreshPanelVM #End Region ' AssemblyBtnCommand Friend m_MsgGraphic As String - Public ReadOnly Property ShowErrorBtnCommand As ICommand Get If m_CmdShowErrorBtn Is Nothing Then diff --git a/SceneManager/SceneManagerV.xaml b/SceneManager/SceneManagerV.xaml index 2015b26..b46df3b 100644 --- a/SceneManager/SceneManagerV.xaml +++ b/SceneManager/SceneManagerV.xaml @@ -17,17 +17,13 @@ - - + + - - diff --git a/SceneManager/SceneManagerVM.vb b/SceneManager/SceneManagerVM.vb index 96943b2..e7643ac 100644 --- a/SceneManager/SceneManagerVM.vb +++ b/SceneManager/SceneManagerVM.vb @@ -173,8 +173,8 @@ Public Class SceneManagerVM Friend Sub ShowGraphicError() Dim FileContent() As String ' controllo se esite il file CurrDoor.txt - If Not File.Exists(IniFile.m_sTempDir & "\" & TEMP_FILE_TXT) Then Return - FileContent = File.ReadAllLines(IniFile.m_sTempDir & "\" & TEMP_FILE_TXT) + If Not File.Exists(IniFile.m_sTempDir & "\" & TEMP_PART_TXT) Then Return + FileContent = File.ReadAllLines(IniFile.m_sTempDir & "\" & TEMP_PART_TXT) ' se il file esiste ma è vuoto If FileContent.Count = 0 Then MessageBox.Show(EgtMsg(50107), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)