diff --git a/Application.xaml.vb b/Application.xaml.vb
index 9e3f1a8..9d4aa15 100644
--- a/Application.xaml.vb
+++ b/Application.xaml.vb
@@ -1,4 +1,7 @@
-Class Application
+Imports EgtWPFLib5
+Imports EgtUILib
+
+Class Application
' Application-level events, such as Startup, Exit, and DispatcherUnhandledException
' can be handled in this file.
diff --git a/Assembly/Assembly.vb b/Assembly/Assembly.vb
index 9c6c9e0..568ebb5 100644
--- a/Assembly/Assembly.vb
+++ b/Assembly/Assembly.vb
@@ -916,18 +916,22 @@ Public Class Assembly
#Region "Lettura Assemblato"
+ ' messaggi che possono essere restituiti in fase di lettura dell'assemblato
Public Enum ResultReadingAssembInfo
MissingAssembInfo
ErrorInAssembInfo
CorrectAssembInfo
End Enum
- Public bOk As ResultReadingAssembInfo = ResultReadingAssembInfo.CorrectAssembInfo
+ ' carico il valore finale restituito dalla lettura dell'assembalto (di default errore)
+ Public bOk As ResultReadingAssembInfo = ResultReadingAssembInfo.ErrorInAssembInfo
+ ' vettore di righe del file ddf in lettura
Private FileContent() As String
+
Shared Sub ReadDDFAssembly(sPathDDF As String, ByRef ReadAssembly As Assembly)
+ ' durante la lettura del ddf disabilito la costruzione degli hardware sui jamb
BuiltReffCompo = False
- ' restituisce un problema nella lettura di un valore della compo
Dim sErrorInfo As String = String.Empty
' controllo se esiste il file DDF
If Not File.Exists(sPathDDF) Then
@@ -936,11 +940,12 @@ Public Class Assembly
ReadAssembly.FileContent = File.ReadAllLines(sPathDDF)
' se il file esiste ma è vuoto
If ReadAssembly.FileContent.Count = 0 Then
+ ' 50107: Emplyu file, 50101: Error
MessageBox.Show(EgtMsg(50107), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
End If
'---------------------------------------------------------------------------------------------------------------------------------
- ' leggo riga per riga
Dim IndexLine As Integer = 0
+ ' carico i valori di default dell'assemblato (dalla pagina delle opzioni)
Map.refAssemblyManagerVM.LoadAssemblyInformation(ReadAssembly)
ReadAssembly.bOk = ReadAssembly.GetGeneralAssembly(IndexLine, sErrorInfo)
'---------------------------------------------------------------------------------------------------------------------------------
@@ -973,71 +978,95 @@ Public Class Assembly
End If
End Sub
+ ' lettura dei parametri generali dell'assemblato
Private Function GetGeneralAssembly(ByRef IndexLine As Integer, sErrorInfo As String) As ResultReadingAssembInfo
+ ' salta le righe vuote e quelle che non contengono "##",
+ ' restituisce la prima riga successiva valida,
+ ' termina quando incontra la riga "measure" oppure "produce" restituiendo il valore 0
IndexLine = SkipWhiteSpace(IndexLine)
+ ' se non carico nessuna informazione allora non è un assemblato, esco
+ If IndexLine = 0 Then Return ResultReadingAssembInfo.MissingAssembInfo
+
' Size
If IndexLine < FileContent.Count - 1 Then
If SearchKey(FileContent(IndexLine), ConstIni.S_SIZE_INI) Then
+ ' leggo le dimemensioni dei Jamb e restituisco la riga successiva
IndexLine = GetSize(IndexLine + 1)
If IndexLine = -1 Then
+ ' 50102: Failed reading DDF file. Missing needed parameter {0}.
sErrorInfo += String.Format(EgtMsg(50102), ConstIni.S_SIZE_INI + vbCrLf)
Return ResultReadingAssembInfo.ErrorInAssembInfo
End If
End If
End If
- If IndexLine = 0 Then Return ResultReadingAssembInfo.MissingAssembInfo
+
IndexLine = SkipWhiteSpace(IndexLine)
+ If IndexLine = 0 Then Return ResultReadingAssembInfo.MissingAssembInfo
' Light
If IndexLine < FileContent.Count - 1 Then
If SearchKey(FileContent(IndexLine), ConstIni.S_LIGHT) Then
IndexLine = GetLight(IndexLine + 1)
If IndexLine = -1 Then
+ ' 50102: Failed reading DDF file. Missing needed parameter {0}.
sErrorInfo += String.Format(EgtMsg(50102), ConstIni.S_LIGHT + vbCrLf)
Return ResultReadingAssembInfo.ErrorInAssembInfo
End If
End If
End If
+
IndexLine = SkipWhiteSpace(IndexLine)
+ If IndexLine = 0 Then Return ResultReadingAssembInfo.MissingAssembInfo
' Overlap
If IndexLine < FileContent.Count - 1 Then
If SearchKey(FileContent(IndexLine), ConstIni.S_OVERLAP) Then
IndexLine = GetOverlap(IndexLine + 1)
If IndexLine = -1 Then
+ ' 50102: Failed reading DDF file. Missing needed parameter {0}.
sErrorInfo += String.Format(EgtMsg(50102), ConstIni.S_OVERLAP + vbCrLf)
Return ResultReadingAssembInfo.ErrorInAssembInfo
End If
End If
End If
+
IndexLine = SkipWhiteSpace(IndexLine)
+ If IndexLine = 0 Then Return ResultReadingAssembInfo.MissingAssembInfo
' Exterior
If IndexLine < FileContent.Count - 1 Then
If SearchKey(FileContent(IndexLine), ConstIni.K_EXTERIOR) Then
IndexLine = GetExterior(IndexLine + 1)
If IndexLine = -1 Then
+ ' 50102: Failed reading DDF file. Missing needed parameter {0}.
sErrorInfo += String.Format(EgtMsg(50102), ConstIni.K_EXTERIOR + vbCrLf)
Return ResultReadingAssembInfo.ErrorInAssembInfo
End If
End If
End If
+
IndexLine = SkipWhiteSpace(IndexLine)
+ If IndexLine = 0 Then Return ResultReadingAssembInfo.MissingAssembInfo
' Profiles
If IndexLine < FileContent.Count - 1 Then
If SearchKey(FileContent(IndexLine), ConstIni.S_PROFILES) Then
IndexLine = GetProfiles(IndexLine + 1)
If IndexLine = -1 Then
+ ' 50102: Failed reading DDF file. Missing needed parameter {0}.
sErrorInfo += String.Format(EgtMsg(50102), ConstIni.S_PROFILES + vbCrLf)
Return ResultReadingAssembInfo.ErrorInAssembInfo
End If
End If
End If
+
IndexLine = SkipWhiteSpace(IndexLine)
+ If IndexLine = 0 Then Return ResultReadingAssembInfo.MissingAssembInfo
' Doors
If IndexLine < FileContent.Count Then
If SearchKey(FileContent(IndexLine), ConstIni.S_DOORS_ASSEMBY) Then
- ' in questo modo non passo dalla proprietà ( in breve quello che accadrebbe usando il metodo Set)
+ ' assegno ad una variabile il valore in lettura
IndexLine = GetValue(IndexLine, ConstIni.S_DOORS_ASSEMBY, m_DoorNumber)
+ ' assegno il numero di ante
SetDoorNumber(m_DoorNumber)
If IndexLine = -1 Then
+ ' 50102: Failed reading DDF file. Missing needed parameter {0}.
sErrorInfo += String.Format(EgtMsg(50102), ConstIni.S_DOORS_ASSEMBY + vbCrLf)
Return ResultReadingAssembInfo.ErrorInAssembInfo
End If
@@ -1048,6 +1077,7 @@ Public Class Assembly
End If
End If
End If
+
Return ResultReadingAssembInfo.CorrectAssembInfo
End Function
@@ -1247,11 +1277,13 @@ Public Class Assembly
End If
' se la lettura di un oggetto fallisce allora restituisce nothing
Part.ReadDDFPartDoor(FileContent, Line, Local_Door)
+ ' se l'oggetto appena restituito non esiste allora esco
If IsNothing(Local_Door) Then Return -1
+ ' se l'getto appena caricato non specifica il tipo di pezzo allora di default è la prima anta
If String.IsNullOrEmpty(Local_Door.TypePart) Then Local_Door.TypePart = ConstGen.PART_DO_ & "1"
Dim sDoorPiece As String = Local_Door.TypePart
- ' per eliminare lo swing associato al jamb FL_L --> FL_
+ ' ricavo il tipo di pezzo eliminando la descrizione dello swing da "TypePart"
If OptionModule.m_ConfigurationSoftware = ConfigType.Assembly Then
If sDoorPiece.Count > 3 AndAlso sDoorPiece.Contains(ConstGen.PART_FRAME) Then
sDoorPiece = sDoorPiece.Remove(sDoorPiece.LastIndexOf("_"c) + 1)
@@ -1282,6 +1314,7 @@ 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)
Local_PartDoor.SetIsChecked(Local_Door.IsActive)
ListPartDoor.Add(Local_PartDoor)
Case ConstGen.PART_DO_ & "2"
@@ -1292,6 +1325,7 @@ Public Class Assembly
Else
Local_PartDoor.Door.SwingTypeList = m_SwingTypeListSinlgeDoor
End If
+ CreateNewPropertiesList(Local_Door.PropertiesList, Local_Door.SelectedMaterial)
Local_PartDoor.SetIsChecked(Local_Door.IsActive)
ListPartDoor.Add(Local_PartDoor)
@@ -1318,6 +1352,7 @@ 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)
ListPartDoor.Add(Local_PartDoor)
'm_LeftJamb = Local_Door
Case ConstGen.PART_FRAME_RIGHT
@@ -1328,11 +1363,13 @@ Public Class Assembly
Case ConstGen.PART_FRAME_TOP
Local_PartDoor.Door = Local_Door
Local_Door.SwingTypeList = m_SwingTypeList
+ CreateNewPropertiesList(Local_Door.PropertiesList, Local_Door.SelectedMaterial)
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)
ListPartDoor.Add(Local_PartDoor)
'm_BottomJamb = Local_Door
If Not m_Exterior Then Local_PartDoor.Door.IsActive = False
@@ -1482,9 +1519,10 @@ Public Class Assembly
End If
' verifico se è un assemblato
If ListPartDoor.Count < 4 And ListPartDoorOfDoor.Count > 0 Then
- ' 50516=The ddf does not contains jambs!
+ ' 50516=The current ddf contains {0} jambs.
ErrorMessages = EgtMsg(50516)
- Dim sVal As String = Utility.DoubleToString(ListPartDoor.Count, 0)
+ Dim sVal As String = Utility.DoubleToString(ListPartDoor.Count - ListPartDoorOfDoor.Count, 0)
+ ' 50144=Warning
MessageBox.Show(String.Format(ErrorMessages, sVal), EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning)
Return True
End If
@@ -1886,6 +1924,7 @@ Public Class Assembly
TopRabbetJamb()
HingeRabbetJamb()
BottomRabbetJamb()
+ MaterialJamb()
End Sub
' riceve il nome del parametro modificato ed associa la funzione per il ridimensionamento
@@ -1901,6 +1940,7 @@ Public Class Assembly
Map.refAssemblyManagerVM.CreateJamb(Me, False)
Map.refAssemblyManagerVM.LoadOM_M_ET(Me)
Map.refAssemblyManagerVM.CreateAssociation(Me)
+ SetPartDoorCurrAssembly()
SetNewDimensionAssembly()
' UpDateAllCompo()
Map.refSceneManagerVM.RefreshBtn()
@@ -1964,9 +2004,12 @@ Public Class Assembly
CreateCompoOnJamb(m_Door1.CompoList(IndexCompo))
Next
Case 2
-
+ Dim IndexCompo As Integer = 0
+ Dim EndIndex As Integer = m_Door2.CompoList.Count
+ For IndexCompo = 0 To EndIndex - 1
+ CreateCompoOnJamb(m_Door2.CompoList(IndexCompo))
+ Next
Case Else
-
End Select
End Sub
@@ -2013,7 +2056,15 @@ Public Class Assembly
CurrCompo.CompoParamList(IndexParam).DDFName = CurrCompo.refJambCompo.CompoParamList(IndexParam).DDFName Then
' ho controllato che i nome ddf del parametro sul jamb è lo stesso che sta sull'anta
' l'unica operazione che eseguo è di abilitare la combobox
- DirectCast(CurrCompo.refJambCompo.CompoParamList(IndexParam), ComboBoxParam).IsReadOnly = False
+ Dim CBoxRefPar As ComboBoxParam = DirectCast(CurrCompo.refJambCompo.CompoParamList(IndexParam), ComboBoxParam)
+ CBoxRefPar.IsReadOnly = False
+ Dim CBoxPar As ComboBoxParam = DirectCast(CurrCompo.CompoParamList(IndexParam), ComboBoxParam)
+ For Each ItemCombo In CBoxRefPar.ItemList
+ If ItemCombo = CBoxPar.SelItem Then
+ CBoxRefPar.SetSelItem(ItemCombo)
+ Exit For
+ End If
+ Next
ElseIf TypeOf CurrCompo.refJambCompo.CompoParamList(IndexParam) Is TextBoxOnOffParam AndAlso
CurrCompo.CompoParamList(IndexParam).DDFName = CurrCompo.refJambCompo.CompoParamList(IndexParam).DDFName Then
' ho controllato che i nome ddf del parametro sul jamb è lo stesso che sta sull'anta
@@ -2425,6 +2476,25 @@ Public Class Assembly
End Select
End Sub
+ Public Sub MaterialJamb()
+ If Not IsNothing(m_JambB) Then
+ m_JambB.SetMaterial(OptionModule.m_CurrMaterial)
+ CreateNewPropertiesListJamb(m_JambB.PropertiesList, m_JambB.SelectedMaterial)
+ End If
+ If Not IsNothing(m_JambT) Then
+ m_JambT.SetMaterial(OptionModule.m_CurrMaterial)
+ CreateNewPropertiesListJamb(m_JambT.PropertiesList, m_JambT.SelectedMaterial)
+ End If
+ If Not IsNothing(m_JambR) Then
+ m_JambR.SetMaterial(OptionModule.m_CurrMaterial)
+ CreateNewPropertiesListJamb(m_JambR.PropertiesList, m_JambR.SelectedMaterial)
+ End If
+ If Not IsNothing(m_JambR) Then
+ m_JambL.SetMaterial(OptionModule.m_CurrMaterial)
+ CreateNewPropertiesListJamb(m_JambL.PropertiesList, m_JambL.SelectedMaterial)
+ End If
+ End Sub
+
' assegna gli swing ai jamb
Public Sub SwingJamb()
' se la prima anta non esiste allora interrompo
diff --git a/AssemblyManager/AssemblyManagerV.xaml b/AssemblyManager/AssemblyManagerV.xaml
index 0f61dc7..2ad84b8 100644
--- a/AssemblyManager/AssemblyManagerV.xaml
+++ b/AssemblyManager/AssemblyManagerV.xaml
@@ -11,7 +11,7 @@
-
diff --git a/AssemblyManager/AssemblyManagerVM.vb b/AssemblyManager/AssemblyManagerVM.vb
index 0565e7a..92af68e 100644
--- a/AssemblyManager/AssemblyManagerVM.vb
+++ b/AssemblyManager/AssemblyManagerVM.vb
@@ -29,6 +29,16 @@ Public Class AssemblyManagerVM
End Set
End Property
+ Public ReadOnly Property EnableAssebmlyManager As Boolean
+ Get
+ If Not IsNothing(Map.refInstrumentPanelVM) Then
+ Return Map.refInstrumentPanelVM.EnablePage
+ Else
+ Return True
+ End If
+ End Get
+ End Property
+
#Region "MESSAGES"
Public ReadOnly Property AddNewDoorToolTip As String
@@ -1135,7 +1145,6 @@ Public Class AssemblyManagerVM
LeftJamb.IsChecked = False
LeftJamb.Door.IsActive = False
End If
- CreateNewPropertiesListJamb(LeftJamb.Door.PropertiesList)
' aggiungo alla lista dei PartDoor
CurrAssembly.ListPartDoor.Add(LeftJamb)
End If
@@ -1158,7 +1167,6 @@ Public Class AssemblyManagerVM
RightJamb.IsChecked = False
RightJamb.Door.IsActive = False
End If
- CreateNewPropertiesListJamb(RightJamb.Door.PropertiesList)
' aggiungo alla lista dei PartDoor
CurrAssembly.ListPartDoor.Add(RightJamb)
End If
@@ -1181,7 +1189,6 @@ Public Class AssemblyManagerVM
TopJamb.IsChecked = False
TopJamb.Door.IsActive = False
End If
- CreateNewPropertiesListJamb(TopJamb.Door.PropertiesList)
CurrAssembly.ListPartDoor.Add(TopJamb)
End If
@@ -1197,7 +1204,6 @@ Public Class AssemblyManagerVM
BottomJamb.Door.IsActive = OptionModule.m_BottomJambChk
' definisce la disposizione (da selezionare in una sola anta)
BottomJamb.Door.SetDispositionItem(OptionModule.m_Disposition)
- CreateNewPropertiesListJamb(BottomJamb.Door.PropertiesList)
If bNewAssembly Then
BottomJamb.IsChecked = True
BottomJamb.IsChecked = OptionModule.m_TopJambChk
@@ -1219,7 +1225,8 @@ Public Class AssemblyManagerVM
' OverMaterial -> LoadOM_M_ET
' Machining -> LoadOM_M_ET
' EdgeType -> LoadOM_M_ET
-
+ ' Material -> dalla porta
+ ' Properties -> dalla porta
End Sub
' carica i valori di Overmaterial, Machining e EdgeType settati di Default
@@ -1266,10 +1273,10 @@ Public Class AssemblyManagerVM
' non viene caricato lo swing, che è carciato al termine del ciclo for
LoadDefaultSingleDoor(Local_PartDoor.Door, CStr(nDoorNumber))
Local_PartDoor.IsChecked = True
- CreateNewPropertiesList(Local_PartDoor.Door.PropertiesList, Local_PartDoor.Door.SelectedMaterial)
+ 'CreateNewPropertiesList(Local_PartDoor.Door.PropertiesList, Local_PartDoor.Door.SelectedMaterial)
CurrAssembly.ListPartDoor.Add(Local_PartDoor)
Else
- CurrAssembly.ListPartDoor.Add(ReserchPartDoor(Type))
+ 'CurrAssembly.ListPartDoor.Add(ReserchPartDoor(Type))
End If
Next
@@ -1335,6 +1342,8 @@ Public Class AssemblyManagerVM
ref_Part.TopOverMaterial = OptionModule.m_TopOverMaterial
ref_Part.BottomOverMaterial = OptionModule.m_BottomOverMaterial
ref_Part.SetDispositionItem(OptionModule.m_Disposition)
+ ref_Part.SetMaterial(OptionModule.m_CurrMaterial)
+
End Sub
' carica la lista degli swing a seconda del numero di porte selezionato
diff --git a/Constants/ConstIni.vb b/Constants/ConstIni.vb
index a758414..0b9d096 100644
--- a/Constants/ConstIni.vb
+++ b/Constants/ConstIni.vb
@@ -35,6 +35,8 @@ Module ConstIni
Public Const K_DISABLEARCH As String = "DisableArch"
Public Const K_SINGLEDOOR As String = "SingleDoor"
Public Const K_DELETEPROJECT As String = "DeleteProject"
+ Public Const K_DOORDIMENSION As String = "DoorDimensions"
+ Public Const K_HARDWAREDIMENSION As String = "HardwareDimensions"
Public Const S_LANGUAGES As String = "Languages"
Public Const K_LANGUAGE As String = "Language"
diff --git a/DdfFile.vb b/DdfFile.vb
index cdf8aac..681592d 100644
--- a/DdfFile.vb
+++ b/DdfFile.vb
@@ -1430,15 +1430,18 @@ Friend Module DdfFile
FirstPart = True
End If
- If CurrAssembly.ListPartDoor.Count > 1 Then
- For IndexPartDoor As Integer = 0 To CurrAssembly.ListPartDoor.Count - 2
+ If CurrAssembly.ListPartDoor.Count > 0 Then
+ For IndexPartDoor As Integer = 0 To CurrAssembly.ListPartDoor.Count - 1
WriteDDFPart(CurrAssembly.ListPartDoor(IndexPartDoor).Door, sPath, bIsDDF, FirstPart)
- File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
+ If IndexPartDoor = CurrAssembly.ListPartDoor.Count - 1 Then
+ File.AppendAllLines(sPath, EndAssebly, Text.Encoding.UTF8)
+ Else
+ File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
+ End If
+
Next
End If
- WriteDDFPart(CurrAssembly.ListPartDoor(CurrAssembly.ListPartDoor.Count - 1).Door, sPath, bIsDDF, FirstPart)
- File.AppendAllLines(sPath, EndAssebly, Text.Encoding.UTF8)
-
+
Return True
End Function
@@ -1515,6 +1518,7 @@ Friend Module DdfFile
End If
' i parametri associatia alla condizione di Exterior sono stampati solo se Exterior è true
If CurrAssembly.Exterior Then
+ GeneralAssembly.Add(ConstCompo.DDF_METADATA)
GeneralAssembly.Add(ConstCompo.DDF_METADATA & "Exterior :")
If StringToDouble(CurrAssembly.OverlapTop, dVal) Then
GeneralAssembly.Add(ConstCompo.DDF_METADATA & "top : " & DoubleToString(dVal, 5))
diff --git a/DoorParameters/Compo.vb b/DoorParameters/Compo.vb
index bed7fd1..d267385 100644
--- a/DoorParameters/Compo.vb
+++ b/DoorParameters/Compo.vb
@@ -493,7 +493,9 @@ Public Class Compo
Dim CurrItem As String = ModelDir & m_SelFile
' passo il nome
TemplateSelItem = CurrItem
+ Assembly.BuiltReffCompo = True
Map.refAssemblyPageVM.CurrAssembly.SetDimension("CreateRefCompo", Me)
+ Assembly.BuiltReffCompo = False
NotifyPropertyChanged("SelFile")
End Set
End Property
diff --git a/DoorParameters/Part.vb b/DoorParameters/Part.vb
index 28377ff..9016700 100644
--- a/DoorParameters/Part.vb
+++ b/DoorParameters/Part.vb
@@ -221,14 +221,23 @@ Public Class Part
Public Sub SetMaterial(ItemMaterial As MaterialType)
For Each Item In m_MaterilaList
- If ItemMaterial.NameDDF = Item.NameDDF then
+ If ItemMaterial.NameDDF = Item.NameDDF Then
m_SelectedMaterial = Item
OptionModule.m_CurrMaterial = m_SelectedMaterial
- NotifyPropertyChanged("SelectedMaterial")
- Exit for
+ ' 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
+ Next
+ m_PropertiesList = m_SelectedMaterial.PropertiesList
+ m_SelectedProperty = m_PropertiesList(0)
+ PropertiesIsVisible = Visibility.Visible
+ Else
+ PropertiesIsVisible = Visibility.Collapsed
+ End If
+ Exit For
End If
Next
-
End Sub
Public ReadOnly Property MaterialIsVisible As Visibility
@@ -1438,17 +1447,18 @@ Public Class Part
' Genero una nuova porta da usare nella lettura di un DDF
Shared Sub ReadDDFPartDoor(ArrayFile() As String, ByRef LineIndex As Integer, ByRef ReadDoor As Part)
+ ' Inizializzazioni
Dim bPressure As Boolean = False
Dim bProperties As Boolean = False
' tutti i parametri fino a profiles devono essere caricati
Dim ReadDoorCompleted As Boolean = False
- ' passo alla pagina vuota in attesa del caricamneto della prossima
- ' Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
- ' Inizializzazioni
+ 'Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
ReadDoor.FileContent = ArrayFile
ReadDoor.m_TypePart = ConstGen.PART_DO_ & "1"
+
' Se il file DDF è vuoto
If ReadDoor.FileContent.Count = 0 Then
+ ' 50107 = Empty file.
MessageBox.Show(EgtMsg(50107), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
End If
' Leggo riga per riga
@@ -1460,7 +1470,7 @@ Public Class Part
LineIndex += 1
Continue While
End If
- ' Controllo fine pezzo o fine file
+ ' Controllo fine pezzo "---" o fine file "..."
If (Search3Hyphens(sLine) OrElse Search3Dots(sLine)) Then Exit While
' Modifica su vecchi file con "pressure:" indentato, per continuare a leggerli
If sLine.IndexOf(S_WEIGHT & ":") > 0 Then sLine = sLine.TrimStart()
@@ -1475,7 +1485,7 @@ Public Class Part
LineIndex = ReadDoor.GetCode(LineIndex)
' Se manca il codice, errore
If LineIndex = -1 Then
- ' carico il messaggio di errore
+ ' 50102=Failed reading DDF file. Missing needed parameter {0}.
sErrorInfo &= String.Format(EgtMsg(50102), S_CODE) & vbCrLf
' assegno una porta vuota ed esco dal ciclo
ReadDoor = Nothing
@@ -1486,7 +1496,7 @@ Public Class Part
LineIndex = ReadDoor.GetOrder(ReadDoor.NextIndex(LineIndex))
' Se mancano i dati dell'ordine, errore
If LineIndex = -1 Then
- ' carico il messaggio di errore
+ ' 50102=Failed reading DDF file. Missing needed parameter {0}.
sErrorInfo &= String.Format(EgtMsg(50102), S_ORDER) & vbCrLf
' assegno una porta vuota ed esco dal ciclo
ReadDoor = Nothing
@@ -1501,7 +1511,7 @@ Public Class Part
LineIndex = ReadDoor.GetPosition(ReadDoor.NextIndex(LineIndex))
' Se mancano i dati di posizione, errore
If LineIndex = -1 Then
- ' carico il messaggio di errore
+ ' 50102=Failed reading DDF file. Missing needed parameter {0}.
sErrorInfo &= String.Format(EgtMsg(50102), S_POSITION) & vbCrLf
' assegno una porta vuota ed esco dal ciclo
ReadDoor = Nothing
@@ -1512,7 +1522,7 @@ Public Class Part
LineIndex = ReadDoor.GetSize(ReadDoor.NextIndex(LineIndex))
' Se mancano i dati di size, errore
If LineIndex = -1 Then
- ' carico il messaggio di errore
+ ' 50102=Failed reading DDF file. Missing needed parameter {0}.
sErrorInfo &= String.Format(EgtMsg(50102), S_SIZE) & vbCrLf
' assegno una porta vuota ed esco dal ciclo
ReadDoor = Nothing
@@ -1525,6 +1535,7 @@ Public Class Part
Case S_SWING
LineIndex = ReadDoor.GetSwing(LineIndex)
If LineIndex = -1 Then
+ ' 50102=Failed reading DDF file. Missing needed parameter {0}.
sErrorInfo &= String.Format(EgtMsg(50102), S_SWING) & vbCrLf
' assegno una porta vuota ed esco dal ciclo
ReadDoor = Nothing
@@ -1532,14 +1543,14 @@ Public Class Part
End If
Case S_SECURE ' creo l'oggetto OptionPage nella Mappa
LineIndex = ReadDoor.GetSecure(LineIndex)
- Case S_MATERIAL
- LineIndex = ReadDoor.GetMaterial(LineIndex)
- If LineIndex = -1 then
+ Case S_MATERIAL
+ LineIndex = ReadDoor.GetMaterial(LineIndex)
+ If LineIndex = -1 Then
'50532=Missing list of material at file "../Compo/Default.ini".
sErrorInfo &= EgtMsg(50532) & vbCrLf
ReadDoor = Nothing
- Exit While
- ElseIf LineIndex = -2 then
+ Exit While
+ ElseIf LineIndex = -2 Then
'50531=The current material {0} does not exist in list of material. Look at file "../Compo/Default.ini".
sErrorInfo &= String.Format(EgtMsg(50531), ReadDoor.sNameDDFMaterial) & vbCrLf
ReadDoor = Nothing
@@ -1548,20 +1559,20 @@ Public Class Part
Case ConstCompo.S_PROPERTIES
bProperties = True
LineIndex = ReadDoor.GetProperties(LineIndex)
- If LineIndex = -1 then
+ If LineIndex = -1 Then
'50533=Impossible to load more than one property at time.
- sErrorInfo &= EgtMsg(50533) & vbCrLf
+ sErrorInfo &= EgtMsg(50533) & vbCrLf
ReadDoor = Nothing
Exit While
- ElseIf LineIndex = -2 then
- If Not IsNothing(ReadDoor.m_SelectedMaterial) then
- ' 50530=Property {0} does not exist in list of {1}. Look at file "../Compo/Default.ini"
+ ElseIf LineIndex = -2 Then
+ If Not IsNothing(ReadDoor.m_SelectedMaterial) Then
+ ' 50530=Property {0} does not exist in list of {1}. Look at file "../Compo/Default.ini"
sErrorInfo &= String.Format(EgtMsg(50530), ReadDoor.sNameDDFProperty, ReadDoor.m_SelectedMaterial.Name) & vbCrLf
Else
- ' 50534=Property {0} does not exist in the list. Look at file "../Compo/Default.ini".
+ ' 50534=Property {0} does not exist in the list. Look at file "../Compo/Default.ini".
sErrorInfo &= String.Format(EgtMsg(50534), ReadDoor.sNameDDFProperty) & vbCrLf
End If
-
+
ReadDoor = Nothing
Exit While
End If
@@ -1569,6 +1580,7 @@ Public Class Part
Dim LocalMsg As String = String.Empty
LineIndex = ReadDoor.GetProfiles(ReadDoor.NextIndex(LineIndex), ReadDoor.TypePart, LocalMsg)
If LineIndex = -1 Then
+ ' 50102=Failed reading DDF file. Missing needed parameter {0}.
sErrorInfo &= String.Format(EgtMsg(50102), ConstCompo.S_PROFILES) & vbCrLf
If Not String.IsNullOrEmpty(LocalMsg) Then
sErrorInfo &= LocalMsg
@@ -1584,6 +1596,7 @@ Public Class Part
Case Else 'COMPONENTS
' Se sezione senza nome o altro errore
If String.IsNullOrWhiteSpace(sSection) Then
+ ' 50130=Error in reading: line {0}.
sErrorInfo &= String.Format(EgtMsg(50130), LineIndex) & vbCrLf
' assegno una porta vuota ed esco dal ciclo
ReadDoor = Nothing
@@ -1609,6 +1622,7 @@ Public Class Part
' controllo che i parametri della porta siano stati caricati correttamente
If Not ReadDoorCompleted Then
+ ' 50156=Error in reading ddf: door is not completed or ddf has been slpitted by '---' bad.
If String.IsNullOrEmpty(sErrorInfo) Then sErrorInfo = EgtMsg(50156)
ReadDoor = Nothing
End If
@@ -1616,7 +1630,7 @@ Public Class Part
If Not IsNothing(ReadDoor) And ReadDoorCompleted Then
' se la porta esiste allora mostro i suoi parametri
Map.refPartPageVM.CurrPart = ReadDoor
-
+
' se non passo dalla funzione che raccoglie queste informazioni
If Not bProperties AndAlso ReadDoor.PropertiesIsVisible = Visibility.Visible Then
For Each Item In ReadDoor.PropertiesList
@@ -1625,7 +1639,7 @@ Public Class Part
End If
' se esiste un solo materiale nell'elenco dei materiali, ma non è inserito nella porta allora lo carico di default
- If IsNothing(ReadDoor.m_SelectedMaterial) and OptionModule.m_MaterialList.Count > 0 then
+ If IsNothing(ReadDoor.m_SelectedMaterial) And OptionModule.m_MaterialList.Count > 0 Then
ReadDoor.SelectedMaterial = OptionModule.m_MaterialList(0)
End If
@@ -1635,14 +1649,14 @@ Public Class Part
MessageBox.Show(EgtMsg(50194), EgtMsg(50118), MessageBoxButton.OK, MessageBoxImage.Information)
FirstReadingEdge = True
End If
-
+
' Messaggio di errore per il Top Arch
If ReadDoor.bDeleteTopShape Then
' 50197: Impossible to create a Top Arch because of configuration! Curr door will be modify.
MessageBox.Show(EgtMsg(50197), EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Asterisk)
FirstReadingEdge = True
End If
-
+
' Messaggio di errore per incongruenza bevel
If ReadDoor.bModifyBevel Then
If Not IsNothing(ReadDoor.LockEdgeType) AndAlso
@@ -1655,11 +1669,12 @@ Public Class Part
MessageBox.Show(EgtMsg(50169), EgtMsg(50115), MessageBoxButton.OK, MessageBoxImage.Asterisk, MessageBoxResult.No)
End If
End If
-
+
' Messaggio di errore per il Weight, quando non passa dalla funzione GetWeight (perchè il ddf non ha il peso)
If Not bPressure Then
If m_IsCheckedWeight = Visibility.Visible Then
' ACCESO e NON presenet nel ddf
+ ' 50149=Caution: Weight is setted in OptionPage. Do you want to remove?
If MessageBox.Show(EgtMsg(50149), EgtMsg(50110), MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes) = MessageBoxResult.Yes Then
' decido di spegnere
OptionsVM.SetIsCheckedWeight(False)
@@ -1790,7 +1805,7 @@ Public Class Part
If sType.Contains("DO_") Then
OptionModule.CreateNewPropertiesList(m_PropertiesList, m_SelectedMaterial)
Else
- OptionModule.CreateNewPropertiesListJamb(m_PropertiesList)
+ OptionModule.CreateNewPropertiesListJamb(m_PropertiesList, m_SelectedMaterial)
End If
End If
' passo alla riga successiva
diff --git a/DoorParameters/PartPageV.xaml b/DoorParameters/PartPageV.xaml
index f5ed263..29ede22 100644
--- a/DoorParameters/PartPageV.xaml
+++ b/DoorParameters/PartPageV.xaml
@@ -12,7 +12,7 @@
-
+
@@ -511,7 +511,8 @@
-
+
+
+
+
+