EgtDOORCreator 1.8l1 :
- I general dell'assemblato sono salvati come metadata (##) all'inizio del file, - modifica relazioni hardware Jamb-Door
This commit is contained in:
+130
-85
@@ -7,6 +7,7 @@ Imports System.Text.RegularExpressions
|
||||
Public Class Assembly
|
||||
Implements INotifyPropertyChanged
|
||||
|
||||
Friend Shared BuiltReffCompo As Boolean = True
|
||||
Private m_OneDoorProperty As Boolean
|
||||
Public Property OneDoorProperty As Boolean
|
||||
Get
|
||||
@@ -669,6 +670,7 @@ Public Class Assembly
|
||||
|
||||
Private FileContent() As String
|
||||
Shared Sub ReadDDFAssembly(sPathDDF As String, ByRef ReadAssembly As Assembly)
|
||||
BuiltReffCompo = False
|
||||
' restituisce un problema nella lettura di un valore della compo
|
||||
Dim InvalidValue As String = String.Empty
|
||||
InvalidValue += "In General Assembly:" + vbCrLf
|
||||
@@ -682,92 +684,21 @@ Public Class Assembly
|
||||
MessageBox.Show(EgtMsg(50107), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
End If
|
||||
Dim bSecure As Boolean = False
|
||||
'---------------------------------------------------------------------------------------------------------------------------------
|
||||
' leggo riga per riga
|
||||
'--------------------------------------------------------------------------------------------------------------------------------------
|
||||
' cerco la fine del file (DA CAMBIARE)
|
||||
Dim LineIndexDots As Integer = 0
|
||||
While (Not Search3Dots(ReadAssembly.FileContent(LineIndexDots)) And LineIndexDots < ReadAssembly.FileContent.Count - 1)
|
||||
LineIndexDots += 1
|
||||
End While
|
||||
'--------------------------------------------------------------------------------------------------------------------------------------
|
||||
For IndexLine As Integer = LineIndexDots To ReadAssembly.FileContent.Count - 1
|
||||
' Size
|
||||
If IndexLine < ReadAssembly.FileContent.Count - 1 Then
|
||||
If SearchKey(ReadAssembly.FileContent(IndexLine), "Size") Then
|
||||
IndexLine = ReadAssembly.GetSize(IndexLine + 1)
|
||||
If IndexLine = -1 Then
|
||||
InvalidValue += String.Format(EgtMsg(50102), "Size" + vbCrLf)
|
||||
ReadAssembly = Nothing
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
' Light
|
||||
If IndexLine < ReadAssembly.FileContent.Count - 1 Then
|
||||
If SearchKey(ReadAssembly.FileContent(IndexLine), "Light") Then
|
||||
IndexLine = ReadAssembly.GetLight(IndexLine + 1)
|
||||
If IndexLine = -1 Then
|
||||
InvalidValue += String.Format(EgtMsg(50102), "Light" + vbCrLf)
|
||||
ReadAssembly = Nothing
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
' Overlap
|
||||
If IndexLine < ReadAssembly.FileContent.Count - 1 Then
|
||||
If SearchKey(ReadAssembly.FileContent(IndexLine), "Overlap") Then
|
||||
IndexLine = ReadAssembly.GetOverlap(IndexLine + 1)
|
||||
If IndexLine = -1 Then
|
||||
InvalidValue += String.Format(EgtMsg(50102), "Overlap" + vbCrLf)
|
||||
ReadAssembly = Nothing
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
' Exterior
|
||||
If IndexLine < ReadAssembly.FileContent.Count - 1 Then
|
||||
If SearchKey(ReadAssembly.FileContent(IndexLine), "Exterior") Then
|
||||
IndexLine = ReadAssembly.GetExterior(IndexLine + 1)
|
||||
If IndexLine = -1 Then
|
||||
InvalidValue += String.Format(EgtMsg(50102), "Exterior" + vbCrLf)
|
||||
ReadAssembly = Nothing
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
' Profiles
|
||||
If IndexLine < ReadAssembly.FileContent.Count - 1 Then
|
||||
If SearchKey(ReadAssembly.FileContent(IndexLine), "profiles") Then
|
||||
IndexLine = ReadAssembly.GetProfiles(IndexLine + 1)
|
||||
If IndexLine = -1 Then
|
||||
InvalidValue += String.Format(EgtMsg(50102), "profiles" + vbCrLf)
|
||||
ReadAssembly = Nothing
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
' Doors
|
||||
If IndexLine < ReadAssembly.FileContent.Count Then
|
||||
If SearchKey(ReadAssembly.FileContent(IndexLine), "doors") Then
|
||||
' in questo modo non passo dalla proprietà ( in breve quello che accadrebbe usando il metodo Set)
|
||||
IndexLine = ReadAssembly.GetValue(IndexLine, "doors", ReadAssembly.m_DoorNumber)
|
||||
If IndexLine = -1 Then
|
||||
InvalidValue += String.Format(EgtMsg(50102), "doors" + vbCrLf)
|
||||
ReadAssembly = Nothing
|
||||
Exit For
|
||||
End If
|
||||
' se sono arrivato fino a qui significa che ormai è terminata la pagina
|
||||
If IsNothing(ReadAssembly.m_Exterior) Or Not ReadAssembly.m_Exterior Then
|
||||
ReadAssembly.m_Exterior = False
|
||||
ReadAssembly.m_OverlapTop = OptionModule.m_OverlapTop
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Dim IndexLine As Integer = LineIndexDots
|
||||
ReadAssembly.GetGeneralAssembly(ReadAssembly, IndexLine, InvalidValue)
|
||||
'---------------------------------------------------------------------------------------------------------------------------------
|
||||
If Not IsNothing(ReadAssembly) Then
|
||||
If ReadAssembly.GetDDFDoor() = -1 Then
|
||||
InvalidValue += String.Format(EgtMsg(50102), "Door has not been founded in Assembly DDF" + vbCrLf)
|
||||
If IndexLine = -1 Then
|
||||
InvalidValue += String.Format(EgtMsg(50102), "Error in reading General Assembly in DDF" + vbCrLf)
|
||||
ReadAssembly = Nothing
|
||||
Else
|
||||
If ReadAssembly.GetDDFDoor(IndexLine) = -1 Then
|
||||
InvalidValue += String.Format(EgtMsg(50102), "Door has not been founded in Assembly DDF" + vbCrLf)
|
||||
ReadAssembly = Nothing
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
If Not InvalidValue = "In General Assembly:" + vbCrLf Then
|
||||
@@ -775,6 +706,117 @@ Public Class Assembly
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Function GetGeneralAssembly(ReadAssembly As Assembly, ByRef IndexLine As Integer, InvalidValue As String) As Boolean
|
||||
IndexLine = ReadAssembly.SkipWhiteSpace(IndexLine)
|
||||
' Size
|
||||
If IndexLine < ReadAssembly.FileContent.Count - 1 Then
|
||||
If SearchKey(ReadAssembly.FileContent(IndexLine), "Size") Then
|
||||
IndexLine = ReadAssembly.GetSize(IndexLine + 1)
|
||||
If IndexLine = -1 Then
|
||||
InvalidValue += String.Format(EgtMsg(50102), "Size" + vbCrLf)
|
||||
ReadAssembly = Nothing
|
||||
'Exit For
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
If IndexLine = 0 Then Return False
|
||||
IndexLine = ReadAssembly.SkipWhiteSpace(IndexLine)
|
||||
' Light
|
||||
If IndexLine < ReadAssembly.FileContent.Count - 1 Then
|
||||
If SearchKey(ReadAssembly.FileContent(IndexLine), "Light") Then
|
||||
IndexLine = ReadAssembly.GetLight(IndexLine + 1)
|
||||
If IndexLine = -1 Then
|
||||
InvalidValue += String.Format(EgtMsg(50102), "Light" + vbCrLf)
|
||||
ReadAssembly = Nothing
|
||||
''Exit For
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
If IndexLine = 0 Then Return False
|
||||
IndexLine = ReadAssembly.SkipWhiteSpace(IndexLine)
|
||||
' Overlap
|
||||
If IndexLine < ReadAssembly.FileContent.Count - 1 Then
|
||||
If SearchKey(ReadAssembly.FileContent(IndexLine), "Overlap") Then
|
||||
IndexLine = ReadAssembly.GetOverlap(IndexLine + 1)
|
||||
If IndexLine = -1 Then
|
||||
InvalidValue += String.Format(EgtMsg(50102), "Overlap" + vbCrLf)
|
||||
ReadAssembly = Nothing
|
||||
'Exit For
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
IndexLine = ReadAssembly.SkipWhiteSpace(IndexLine)
|
||||
' Exterior
|
||||
If IndexLine < ReadAssembly.FileContent.Count - 1 Then
|
||||
If SearchKey(ReadAssembly.FileContent(IndexLine), "Exterior") Then
|
||||
IndexLine = ReadAssembly.GetExterior(IndexLine + 1)
|
||||
If IndexLine = -1 Then
|
||||
InvalidValue += String.Format(EgtMsg(50102), "Exterior" + vbCrLf)
|
||||
ReadAssembly = Nothing
|
||||
'Exit For
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
IndexLine = ReadAssembly.SkipWhiteSpace(IndexLine)
|
||||
' Profiles
|
||||
If IndexLine < ReadAssembly.FileContent.Count - 1 Then
|
||||
If SearchKey(ReadAssembly.FileContent(IndexLine), "profiles") Then
|
||||
IndexLine = ReadAssembly.GetProfiles(IndexLine + 1)
|
||||
If IndexLine = -1 Then
|
||||
InvalidValue += String.Format(EgtMsg(50102), "profiles" + vbCrLf)
|
||||
ReadAssembly = Nothing
|
||||
'Exit For
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
IndexLine = ReadAssembly.SkipWhiteSpace(IndexLine)
|
||||
' Doors
|
||||
If IndexLine < ReadAssembly.FileContent.Count Then
|
||||
If SearchKey(ReadAssembly.FileContent(IndexLine), "doors") Then
|
||||
' in questo modo non passo dalla proprietà ( in breve quello che accadrebbe usando il metodo Set)
|
||||
IndexLine = ReadAssembly.GetValue(IndexLine, "doors", ReadAssembly.m_DoorNumber)
|
||||
If IndexLine = -1 Then
|
||||
InvalidValue += String.Format(EgtMsg(50102), "doors" + vbCrLf)
|
||||
ReadAssembly = Nothing
|
||||
'Exit For
|
||||
End If
|
||||
' se sono arrivato fino a qui significa che ormai è terminata la pagina
|
||||
If IsNothing(ReadAssembly.m_Exterior) Or Not ReadAssembly.m_Exterior Then
|
||||
ReadAssembly.m_Exterior = False
|
||||
ReadAssembly.m_OverlapTop = OptionModule.m_OverlapTop
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' salta le righe che non contengono un metadata
|
||||
Public Function SkipWhiteSpace(Index As Integer) As Integer
|
||||
Dim ExitLoop As Boolean = False
|
||||
While Not ExitLoop And Index < FileContent.Count - 1
|
||||
If FileContent(Index).Contains("##") Then
|
||||
Dim x = Regex.Match(FileContent(Index), "\s*##\s*(.*?\b)\s*:\s*$").Groups(1).Value
|
||||
Dim y = Regex.Match(FileContent(Index), "\s*##\s*(.*?\b)\s*:\s*(.*?\b)$").Groups(1).Value
|
||||
If Not String.IsNullOrWhiteSpace(Regex.Match(FileContent(Index), "\s*##\s*(.*?\b)\s*:\s*$").Groups(1).Value) Then
|
||||
ExitLoop = True
|
||||
ElseIf Not String.IsNullOrWhiteSpace(Regex.Match(FileContent(Index), "\s*##\s*(.*?\b)\s*:\s*(.*?\b)$").Groups(1).Value) Then
|
||||
ExitLoop = True
|
||||
ElseIf Not String.IsNullOrWhiteSpace(Regex.Match(FileContent(Index), "\s*(measures)\s*:\s*(.*?\b)$").Groups(1).Value) Then
|
||||
ExitLoop = True
|
||||
Else
|
||||
Index += 1
|
||||
End If
|
||||
ElseIf Not String.IsNullOrWhiteSpace(Regex.Match(FileContent(Index), "\s*(measures)\s*:\s*(.*?\b)$").Groups(1).Value) Or
|
||||
Not String.IsNullOrWhiteSpace(Regex.Match(FileContent(Index), "\s*(prodce)\s*:\s*(.*?\b)$").Groups(1).Value) Then
|
||||
Index = 0
|
||||
ExitLoop = True
|
||||
Else
|
||||
Index += 1
|
||||
End If
|
||||
End While
|
||||
Return Index
|
||||
End Function
|
||||
|
||||
' funzione per la ricerca dei valori, restituice la riga successiva
|
||||
Private Function GetValue(Index As Integer, Name As String, ByRef Var As String) As Integer
|
||||
If Index = -1 Then
|
||||
@@ -794,6 +836,7 @@ Public Class Assembly
|
||||
End If
|
||||
End If
|
||||
End Function
|
||||
|
||||
' funzione per la ricerca dei profili, restituisce la riga successiva
|
||||
Private Function GetValueProfiles(Index As Integer, Name As String, ByRef Var As EdgeType, ByRef VarMachining As Boolean, ByVal VarOverMaterial As String) As Integer
|
||||
' Creo una stringa per scrivere gli errori
|
||||
@@ -865,7 +908,6 @@ Public Class Assembly
|
||||
Return Index
|
||||
End Function
|
||||
|
||||
|
||||
Private Sub MsgBevel(bFound As Boolean, Edge As String)
|
||||
If bFound And Not Part.FirstReadingEdge Then
|
||||
Dim CautionBevel As String = String.Format(EgtMsg(50151), Edge)
|
||||
@@ -931,8 +973,8 @@ Public Class Assembly
|
||||
Return Index
|
||||
End Function
|
||||
|
||||
Public Function GetDDFDoor() As Integer
|
||||
Dim Line As Integer = 0
|
||||
Public Function GetDDFDoor(IndexLine As Integer) As Integer
|
||||
Dim Line As Integer = IndexLine
|
||||
While Line < FileContent.Count - 1 AndAlso Not Search3Dots(FileContent(Line))
|
||||
Dim Local_Door As New Part
|
||||
Dim Local_PartDoor As New PartDoor
|
||||
@@ -940,7 +982,9 @@ Public Class Assembly
|
||||
' per saltare la riga che è stata appena restituita che contiene "---"
|
||||
Line += 1
|
||||
End If
|
||||
' se la lettura di un oggetto fallisce allora restituisce nothing
|
||||
Part.ReadDDFPartDoor(FileContent, Line, Local_Door)
|
||||
If IsNothing(Local_Door) Then Return -1
|
||||
If String.IsNullOrEmpty(Local_Door.TypePart) Then Local_Door.TypePart = "DO_1"
|
||||
Dim sDoorPiece As String = Local_Door.TypePart
|
||||
' per eliminare lo swing associato al jamb FL_L --> FL_
|
||||
@@ -1007,6 +1051,7 @@ Public Class Assembly
|
||||
End While
|
||||
DoorVisibility()
|
||||
MatchCompo()
|
||||
BuiltReffCompo = True
|
||||
Return 1
|
||||
End Function
|
||||
|
||||
|
||||
@@ -56,6 +56,9 @@ Module ConstCompo
|
||||
Public Const K_BOTTOM As String = "bottom"
|
||||
Public Const K_SCORE As String = " - "
|
||||
Public Const K_SPACE3 As String = " "
|
||||
|
||||
Public Const K_METADATA As String = "##"
|
||||
|
||||
Public Const K_SPACE5 As String = " "
|
||||
Public Const K_PARTIALEND As String = " --- "
|
||||
Public Const K_END As String = " ... "
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
Public Class TemplateListConverter
|
||||
Implements IValueConverter
|
||||
|
||||
Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.Convert
|
||||
Dim TemplateList As List(Of String) = DirectCast(value, List(Of String))
|
||||
For Index = TemplateList.Count - 1 To 0 Step -1
|
||||
Dim Template As String = TemplateList(Index)
|
||||
If Not Map.refPartPageVM.CurrPart.TypePart.Contains("F") Then
|
||||
If Template.ToLower.Contains(".frame") Then
|
||||
TemplateList.Remove(Template)
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Return TemplateList
|
||||
End Function
|
||||
|
||||
Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack
|
||||
Throw New NotImplementedException
|
||||
End Function
|
||||
|
||||
End Class
|
||||
+173
-42
@@ -84,7 +84,7 @@ Friend Module DdfFile
|
||||
' è specificato il tipo significa che abbiamo un assemblato
|
||||
DdfFileContent.Add("piece: " & Part.TypePart)
|
||||
DdfFileContent.Add("")
|
||||
|
||||
' posizionamento porte
|
||||
If OptionModule.m_ConfigurationSoftware = ConfigType.Assembly Then
|
||||
If Not IsNothing(Part.TypePart) Then
|
||||
' il posizionamento della prima porta sta nell'origine
|
||||
@@ -496,9 +496,16 @@ Friend Module DdfFile
|
||||
Dim EndAssebly As New List(Of String)
|
||||
EndAssebly.Add("")
|
||||
EndAssebly.Add("...")
|
||||
Dim FirstPart As Boolean = False
|
||||
|
||||
Dim GeneralAssembly As New List(Of String)
|
||||
If OptionModule.m_ConfigurationSoftware = ConfigType.Assembly Then
|
||||
WriteGeneralAssembly(GeneralAssembly, CurrAssembly)
|
||||
File.WriteAllLines(sPath, GeneralAssembly, Text.Encoding.UTF8)
|
||||
FirstPart = True
|
||||
End If
|
||||
|
||||
' inizio stampando l'elenco delle porte
|
||||
Dim FirstPart As Boolean = False
|
||||
Select Case CurrAssembly.DoorNumber
|
||||
Case "1"
|
||||
WriteDDFPart(CurrAssembly.GetArrayPartDoor(0).Door, sPath, bIsTemplate, FirstPart)
|
||||
@@ -523,6 +530,7 @@ Friend Module DdfFile
|
||||
File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
|
||||
WriteDDFPart(CurrAssembly.RightJamb, sPath, bIsTemplate, FirstPart)
|
||||
File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
|
||||
' il sill è stampato solo se è nella selezione
|
||||
If CurrAssembly.Exterior Then
|
||||
WriteDDFPart(CurrAssembly.TopJamb, sPath, bIsTemplate, FirstPart)
|
||||
File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
|
||||
@@ -533,126 +541,249 @@ Friend Module DdfFile
|
||||
File.AppendAllLines(sPath, EndAssebly, Text.Encoding.UTF8)
|
||||
End If
|
||||
'------------------------------------------------------------------------------------------------------------------
|
||||
' inizio ora a stampare le caratteristiche generali della finestra JambPageVM
|
||||
'' inizio ora a stampare le caratteristiche generali della finestra JambPageVM
|
||||
'Dim dVal As Double = 0
|
||||
'Dim GeneralAssembly As New List(Of String)
|
||||
'GeneralAssembly.Add("")
|
||||
'GeneralAssembly.Add("#GENERAL ASSEMBLY")
|
||||
'GeneralAssembly.Add("")
|
||||
'GeneralAssembly.Add(" " & "Size : ")
|
||||
'If StringToDouble(CurrAssembly.Thickness, dVal) Then
|
||||
' GeneralAssembly.Add(ConstCompo.K_SPACE3 & "thickness : " & DoubleToString(dVal, 5))
|
||||
'Else
|
||||
' MessageBox.Show(ConstCompo.K_SPACE3 & EgtMsg(50106) & "thickness", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' Return False
|
||||
'End If
|
||||
'If StringToDouble(CurrAssembly.Width, dVal) Then
|
||||
' GeneralAssembly.Add(ConstCompo.K_SPACE3 & "width : " & DoubleToString(dVal, 5))
|
||||
'Else
|
||||
' MessageBox.Show(ConstCompo.K_SPACE3 & EgtMsg(50106) & "width", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' Return False
|
||||
'End If
|
||||
'GeneralAssembly.Add("")
|
||||
'GeneralAssembly.Add(" " & "Light : ")
|
||||
'If StringToDouble(CurrAssembly.LightUp, dVal) Then
|
||||
' GeneralAssembly.Add(ConstCompo.K_SPACE3 & "up : " & DoubleToString(dVal, 5))
|
||||
'Else
|
||||
' MessageBox.Show(ConstCompo.K_SPACE3 & EgtMsg(50106) & "LightUp", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' Return False
|
||||
'End If
|
||||
'If StringToDouble(CurrAssembly.LightLock, dVal) Then
|
||||
' GeneralAssembly.Add(ConstCompo.K_SPACE3 & "lock : " & DoubleToString(dVal, 5))
|
||||
'Else
|
||||
' MessageBox.Show(EgtMsg(50106) & "LightLock", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' Return False
|
||||
'End If
|
||||
'If StringToDouble(CurrAssembly.LightHinge, dVal) Then
|
||||
' GeneralAssembly.Add(ConstCompo.K_SPACE3 & "hinge : " & DoubleToString(dVal, 5))
|
||||
'Else
|
||||
' MessageBox.Show(EgtMsg(50106) & "LightHinge", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' Return False
|
||||
'End If
|
||||
'If StringToDouble(CurrAssembly.LightBottom, dVal) Then
|
||||
' GeneralAssembly.Add(ConstCompo.K_SPACE3 & "bottom : " & DoubleToString(dVal, 5))
|
||||
'Else
|
||||
' MessageBox.Show(EgtMsg(50106) & "LightBottom", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' Return False
|
||||
'End If
|
||||
'GeneralAssembly.Add("")
|
||||
'GeneralAssembly.Add(" " & "Overlap : ")
|
||||
'If StringToDouble(CurrAssembly.ThicknessHead, dVal) Then
|
||||
' GeneralAssembly.Add(ConstCompo.K_SPACE3 & "thickness : " & DoubleToString(dVal, 5))
|
||||
'Else
|
||||
' MessageBox.Show(EgtMsg(50106) & "ThicknessHead", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' Return False
|
||||
'End If
|
||||
'If StringToDouble(CurrAssembly.OverlapHinge, dVal) Then
|
||||
' GeneralAssembly.Add(ConstCompo.K_SPACE3 & "hinge : " & DoubleToString(dVal, 5))
|
||||
'Else
|
||||
' MessageBox.Show(EgtMsg(50106) & "Overlap Hinge", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' Return False
|
||||
'End If
|
||||
'If StringToDouble(CurrAssembly.OverlapLock, dVal) Then
|
||||
' GeneralAssembly.Add(ConstCompo.K_SPACE3 & "lock : " & DoubleToString(dVal, 5))
|
||||
'Else
|
||||
' MessageBox.Show(EgtMsg(50106) & "Overlap Lock", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' Return False
|
||||
'End If
|
||||
'If StringToDouble(CurrAssembly.DeltaThickness, dVal) Then
|
||||
' GeneralAssembly.Add(ConstCompo.K_SPACE3 & "deltaT : " & DoubleToString(dVal, 5))
|
||||
'Else
|
||||
' MessageBox.Show(EgtMsg(50106) & "Delta Thickness", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' Return False
|
||||
'End If
|
||||
'' i parametri associatia alla condizione di Exterior sono stampati solo se Exterior è true
|
||||
'If CurrAssembly.Exterior Then
|
||||
' GeneralAssembly.Add(" " & "Exterior :")
|
||||
' If StringToDouble(CurrAssembly.OverlapTop, dVal) Then
|
||||
' GeneralAssembly.Add(ConstCompo.K_SPACE3 & "top : " & DoubleToString(dVal, 5))
|
||||
' Else
|
||||
' MessageBox.Show(EgtMsg(50106) & "Overlap Top", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' Return False
|
||||
' End If
|
||||
'End If
|
||||
'GeneralAssembly.Add("")
|
||||
'GeneralAssembly.Add(" " & ConstCompo.K_PROFILES & ":")
|
||||
'GeneralAssembly.Add(ConstCompo.K_SPACE3 & ConstCompo.K_LOCKEDGE & ": " & CurrAssembly.LockEdgeType.Name)
|
||||
'GeneralAssembly.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(CurrAssembly.LockEdgeMachining))
|
||||
'If Not StringToDouble(CurrAssembly.LockEdgeOverMaterial, dVal) Then
|
||||
' MessageBox.Show(EgtMsg(50106) & K_LOCKEDGEOVERMATERIAL_INI, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' Return False
|
||||
'End If
|
||||
'GeneralAssembly.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
|
||||
'GeneralAssembly.Add(ConstCompo.K_SPACE3 & ConstCompo.K_HINGEEDGE & ": " & CurrAssembly.HingeEdgeType.Name)
|
||||
'GeneralAssembly.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(CurrAssembly.HingeEdgeMachining))
|
||||
'If Not StringToDouble(CurrAssembly.HingeEdgeOverMaterial, dVal) Then
|
||||
' MessageBox.Show(EgtMsg(50106) & K_HINGEDGEOVERMATERIAL_INI, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' Return False
|
||||
'End If
|
||||
'GeneralAssembly.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
|
||||
'GeneralAssembly.Add(ConstCompo.K_SPACE3 & ConstCompo.K_TOP & ": " & CurrAssembly.TopType.Name)
|
||||
'GeneralAssembly.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(CurrAssembly.TopMachining))
|
||||
'If Not StringToDouble(CurrAssembly.TopOverMaterial, dVal) Then
|
||||
' MessageBox.Show(EgtMsg(50106) & K_TOPOVERMATERIAL_INI, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' Return False
|
||||
'End If
|
||||
'GeneralAssembly.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
|
||||
'GeneralAssembly.Add(ConstCompo.K_SPACE3 & ConstCompo.K_BOTTOM & ": " & CurrAssembly.BottomType.Name)
|
||||
'GeneralAssembly.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(CurrAssembly.BottomMachining))
|
||||
'If Not StringToDouble(CurrAssembly.BottomOverMaterial, dVal) Then
|
||||
' MessageBox.Show(EgtMsg(50106) & K_BOTTOMOVERMATERIAL_INI, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' Return False
|
||||
'End If
|
||||
'GeneralAssembly.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
|
||||
|
||||
'GeneralAssembly.Add("")
|
||||
'If Not IsNothing(CurrAssembly.DoorNumber) Then
|
||||
' GeneralAssembly.Add(" " & "doors : " & CurrAssembly.DoorNumber)
|
||||
'Else
|
||||
' MessageBox.Show(EgtMsg(50106) & "Number of Doors", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' Return False
|
||||
'End If
|
||||
'File.AppendAllLines(sPath, GeneralAssembly, Text.Encoding.UTF8)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function WriteGeneralAssembly(ByRef GeneralAssembly As List(Of String), CurrAssembly As Assembly) As Boolean
|
||||
Dim dVal As Double = 0
|
||||
Dim GeneralAssembly As New List(Of String)
|
||||
GeneralAssembly.Add("")
|
||||
GeneralAssembly.Add("#EGTDOORCREATOR")
|
||||
GeneralAssembly.Add("#GENERAL ASSEMBLY")
|
||||
GeneralAssembly.Add("")
|
||||
GeneralAssembly.Add(" " & "Size : ")
|
||||
GeneralAssembly.Add("#")
|
||||
GeneralAssembly.Add(ConstCompo.K_METADATA & "Size : ")
|
||||
If StringToDouble(CurrAssembly.Thickness, dVal) Then
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "thickness : " & DoubleToString(dVal, 5))
|
||||
GeneralAssembly.Add(ConstCompo.K_METADATA & "thickness : " & DoubleToString(dVal, 5))
|
||||
Else
|
||||
MessageBox.Show(ConstCompo.K_SPACE3 & EgtMsg(50106) & "thickness", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
MessageBox.Show(ConstCompo.K_METADATA & EgtMsg(50106) & "thickness", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return False
|
||||
End If
|
||||
If StringToDouble(CurrAssembly.Width, dVal) Then
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "width : " & DoubleToString(dVal, 5))
|
||||
GeneralAssembly.Add(ConstCompo.K_METADATA & "width : " & DoubleToString(dVal, 5))
|
||||
Else
|
||||
MessageBox.Show(ConstCompo.K_SPACE3 & EgtMsg(50106) & "width", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
MessageBox.Show(ConstCompo.K_METADATA & EgtMsg(50106) & "width", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return False
|
||||
End If
|
||||
GeneralAssembly.Add("")
|
||||
GeneralAssembly.Add(" " & "Light : ")
|
||||
GeneralAssembly.Add(ConstCompo.K_METADATA & "Light : ")
|
||||
If StringToDouble(CurrAssembly.LightUp, dVal) Then
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "up : " & DoubleToString(dVal, 5))
|
||||
GeneralAssembly.Add(ConstCompo.K_METADATA & "up : " & DoubleToString(dVal, 5))
|
||||
Else
|
||||
MessageBox.Show(ConstCompo.K_SPACE3 & EgtMsg(50106) & "LightUp", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
MessageBox.Show(ConstCompo.K_METADATA & EgtMsg(50106) & "LightUp", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return False
|
||||
End If
|
||||
If StringToDouble(CurrAssembly.LightLock, dVal) Then
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "lock : " & DoubleToString(dVal, 5))
|
||||
GeneralAssembly.Add(ConstCompo.K_METADATA & "lock : " & DoubleToString(dVal, 5))
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(50106) & "LightLock", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return False
|
||||
End If
|
||||
If StringToDouble(CurrAssembly.LightHinge, dVal) Then
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "hinge : " & DoubleToString(dVal, 5))
|
||||
GeneralAssembly.Add(ConstCompo.K_METADATA & "hinge : " & DoubleToString(dVal, 5))
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(50106) & "LightHinge", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return False
|
||||
End If
|
||||
If StringToDouble(CurrAssembly.LightBottom, dVal) Then
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "bottom : " & DoubleToString(dVal, 5))
|
||||
GeneralAssembly.Add(ConstCompo.K_METADATA & "bottom : " & DoubleToString(dVal, 5))
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(50106) & "LightBottom", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return False
|
||||
End If
|
||||
GeneralAssembly.Add("")
|
||||
GeneralAssembly.Add(" " & "Overlap : ")
|
||||
GeneralAssembly.Add(ConstCompo.K_METADATA)
|
||||
GeneralAssembly.Add(ConstCompo.K_METADATA & "Overlap : ")
|
||||
If StringToDouble(CurrAssembly.ThicknessHead, dVal) Then
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "thickness : " & DoubleToString(dVal, 5))
|
||||
GeneralAssembly.Add(ConstCompo.K_METADATA & "thickness : " & DoubleToString(dVal, 5))
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(50106) & "ThicknessHead", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return False
|
||||
End If
|
||||
If StringToDouble(CurrAssembly.OverlapHinge, dVal) Then
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "hinge : " & DoubleToString(dVal, 5))
|
||||
GeneralAssembly.Add(ConstCompo.K_METADATA & "hinge : " & DoubleToString(dVal, 5))
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(50106) & "Overlap Hinge", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return False
|
||||
End If
|
||||
If StringToDouble(CurrAssembly.OverlapLock, dVal) Then
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "lock : " & DoubleToString(dVal, 5))
|
||||
GeneralAssembly.Add(ConstCompo.K_METADATA & "lock : " & DoubleToString(dVal, 5))
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(50106) & "Overlap Lock", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return False
|
||||
End If
|
||||
If StringToDouble(CurrAssembly.DeltaThickness, dVal) Then
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "deltaT : " & DoubleToString(dVal, 5))
|
||||
GeneralAssembly.Add(ConstCompo.K_METADATA & "deltaT : " & DoubleToString(dVal, 5))
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(50106) & "Delta Thickness", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return False
|
||||
End If
|
||||
' i parametri associatia alla condizione di Exterior sono stampati solo se Exterior è true
|
||||
If CurrAssembly.Exterior Then
|
||||
GeneralAssembly.Add(" " & "Exterior :")
|
||||
GeneralAssembly.Add(ConstCompo.K_METADATA & "Exterior :")
|
||||
If StringToDouble(CurrAssembly.OverlapTop, dVal) Then
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "top : " & DoubleToString(dVal, 5))
|
||||
GeneralAssembly.Add(ConstCompo.K_METADATA & "top : " & DoubleToString(dVal, 5))
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(50106) & "Overlap Top", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return False
|
||||
End If
|
||||
End If
|
||||
GeneralAssembly.Add("")
|
||||
GeneralAssembly.Add(" " & ConstCompo.K_PROFILES & ":")
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE3 & ConstCompo.K_LOCKEDGE & ": " & CurrAssembly.LockEdgeType.Name)
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(CurrAssembly.LockEdgeMachining))
|
||||
GeneralAssembly.Add(ConstCompo.K_METADATA)
|
||||
GeneralAssembly.Add(ConstCompo.K_METADATA & ConstCompo.K_PROFILES & ":")
|
||||
GeneralAssembly.Add(ConstCompo.K_METADATA & ConstCompo.K_LOCKEDGE & ": " & CurrAssembly.LockEdgeType.Name)
|
||||
GeneralAssembly.Add(ConstCompo.K_METADATA & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(CurrAssembly.LockEdgeMachining))
|
||||
If Not StringToDouble(CurrAssembly.LockEdgeOverMaterial, dVal) Then
|
||||
MessageBox.Show(EgtMsg(50106) & K_LOCKEDGEOVERMATERIAL_INI, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return False
|
||||
End If
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE3 & ConstCompo.K_HINGEEDGE & ": " & CurrAssembly.HingeEdgeType.Name)
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(CurrAssembly.HingeEdgeMachining))
|
||||
GeneralAssembly.Add(ConstCompo.K_METADATA & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
|
||||
GeneralAssembly.Add(ConstCompo.K_METADATA & ConstCompo.K_HINGEEDGE & ": " & CurrAssembly.HingeEdgeType.Name)
|
||||
GeneralAssembly.Add(ConstCompo.K_METADATA & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(CurrAssembly.HingeEdgeMachining))
|
||||
If Not StringToDouble(CurrAssembly.HingeEdgeOverMaterial, dVal) Then
|
||||
MessageBox.Show(EgtMsg(50106) & K_HINGEDGEOVERMATERIAL_INI, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return False
|
||||
End If
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE3 & ConstCompo.K_TOP & ": " & CurrAssembly.TopType.Name)
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(CurrAssembly.TopMachining))
|
||||
GeneralAssembly.Add(ConstCompo.K_METADATA & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
|
||||
GeneralAssembly.Add(ConstCompo.K_METADATA & ConstCompo.K_TOP & ": " & CurrAssembly.TopType.Name)
|
||||
GeneralAssembly.Add(ConstCompo.K_METADATA & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(CurrAssembly.TopMachining))
|
||||
If Not StringToDouble(CurrAssembly.TopOverMaterial, dVal) Then
|
||||
MessageBox.Show(EgtMsg(50106) & K_TOPOVERMATERIAL_INI, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return False
|
||||
End If
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE3 & ConstCompo.K_BOTTOM & ": " & CurrAssembly.BottomType.Name)
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(CurrAssembly.BottomMachining))
|
||||
GeneralAssembly.Add(ConstCompo.K_METADATA & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
|
||||
GeneralAssembly.Add(ConstCompo.K_METADATA & ConstCompo.K_BOTTOM & ": " & CurrAssembly.BottomType.Name)
|
||||
GeneralAssembly.Add(ConstCompo.K_METADATA & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(CurrAssembly.BottomMachining))
|
||||
If Not StringToDouble(CurrAssembly.BottomOverMaterial, dVal) Then
|
||||
MessageBox.Show(EgtMsg(50106) & K_BOTTOMOVERMATERIAL_INI, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return False
|
||||
End If
|
||||
GeneralAssembly.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
|
||||
GeneralAssembly.Add(ConstCompo.K_METADATA & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
|
||||
|
||||
GeneralAssembly.Add("")
|
||||
GeneralAssembly.Add(K_METADATA)
|
||||
If Not IsNothing(CurrAssembly.DoorNumber) Then
|
||||
GeneralAssembly.Add(" " & "doors : " & CurrAssembly.DoorNumber)
|
||||
GeneralAssembly.Add(K_METADATA & "doors : " & CurrAssembly.DoorNumber)
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(50106) & "Number of Doors", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return False
|
||||
End If
|
||||
File.AppendAllLines(sPath, GeneralAssembly, Text.Encoding.UTF8)
|
||||
GeneralAssembly.Add(" ")
|
||||
'File.AppendAllLines(sPath, GeneralAssembly, Text.Encoding.UTF8)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
|
||||
+25
-4
@@ -202,7 +202,8 @@ Public Class Compo
|
||||
Next
|
||||
End If
|
||||
'----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
If Not IsNothing(Me.refJambCompo) Then
|
||||
' Not IsNothing(Me.refJambCompo) And
|
||||
If Assembly.BuiltReffCompo Then
|
||||
Dim FrameCompoFile As String = String.Empty
|
||||
Dim FrameCompoFileConfig As String = String.Empty
|
||||
Dim nDoorNbr As Integer = 1
|
||||
@@ -211,6 +212,11 @@ Public Class Compo
|
||||
Not String.IsNullOrEmpty(FrameCompoFile) Then
|
||||
If Not SearchFileConfig(FrameCompoFile, FrameCompoFileConfig) Then
|
||||
MessageBox.Show("Compo does not exist", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
If Not IsNothing(Me.refJambCompo) Then
|
||||
Map.refPartPageVM.CurrPart.RemoveRefCompo(Me.refJambCompo)
|
||||
Me.refJambCompo = Nothing
|
||||
return
|
||||
End If
|
||||
Else
|
||||
Dim FrameCompoNameDDF As String = String.Empty
|
||||
Dim FrameCompoName As String = String.Empty
|
||||
@@ -221,6 +227,13 @@ Public Class Compo
|
||||
GetPrivateProfileCompoName(ConstCompo.S_COMPO, ConstCompo.K_NAME, FrameCompoNameDDF, FrameCompoName, CurrCompoPath)
|
||||
GetPrivateProfileJambSide("PositionSide", "Side", Side, CurrCompoPath)
|
||||
If String.IsNullOrEmpty(Side) Then Side = Me.CompoType.JambSide
|
||||
'-------------------------------------------------------------------------------------------------------------------------------
|
||||
If IsNothing(Me.refJambCompo) Then
|
||||
Part.CreateRefCompo(Me.CompoType, Me, Map.refAssemblyPageVM.CurrAssembly, FrameCompoFileConfig, FrameCompoFile, Map.refPartPageVM.CurrPart)
|
||||
If CompoMatch.LoadCompoParam(Me) Then Map.refAssemblyPageVM.CurrAssembly.UpDateCurrCompoJamb(Me)
|
||||
Return
|
||||
End If
|
||||
'-------------------------------------------------------------------------------------------------------------------------------
|
||||
Me.refJambCompo.CompoType.SetDDFName(FrameCompoNameDDF)
|
||||
Me.refJambCompo.CompoType.SetName(FrameCompoName)
|
||||
Dim FrameCompoDirectory As String
|
||||
@@ -290,7 +303,13 @@ Public Class Compo
|
||||
#Region "SettemplateREFCOMPO"
|
||||
Friend Sub SetTemplateSelItemRefCompo(value As String, CurrRefCompo As Compo)
|
||||
Dim CurrConfig As String = CurrRefCompo.CompoType.Path & "\" & CONFIGINI_FILE_NAME
|
||||
Dim CurrItemPath As String = CurrRefCompo.CompoType.Path & "\" & value
|
||||
Dim CurrItemPath As String = CurrRefCompo.CompoType.Path
|
||||
If value.Contains(CurrItemPath) Then
|
||||
value = value.Substring(CurrItemPath.Count + 1)
|
||||
CurrItemPath &= "\" & value
|
||||
Else
|
||||
CurrItemPath &= "\" & value
|
||||
End If
|
||||
Dim ErrorList As String = String.Empty
|
||||
' se il file ha estensione nge
|
||||
If Path.HasExtension(CurrItemPath) AndAlso Path.GetExtension(CurrItemPath).ToLower = K_NGEEXTENSION Then
|
||||
@@ -311,7 +330,9 @@ Public Class Compo
|
||||
If Not File.Exists(CurrItemPath) Then Return
|
||||
CurrRefCompo.TemplateSelItem = value
|
||||
' carico un vettore con le stringhe del file corrente
|
||||
Assembly.BuiltReffCompo = False
|
||||
Dim ReadCurrCompo() As String = File.ReadAllLines(CurrItemPath)
|
||||
Assembly.BuiltReffCompo = True
|
||||
Dim EndOfFile As Boolean = False
|
||||
' leggo il vettore di stringhe del file corrente
|
||||
For LineIndex = 0 To ReadCurrCompo.Count - 1
|
||||
@@ -568,7 +589,7 @@ Public Class Compo
|
||||
ElseIf sItems.Count = 3 Then
|
||||
' se la text contiente solo 4 parametri
|
||||
If sItems(1).Split("/"c).Count = 1 Then
|
||||
NewCompoParam = New TextBoxOnOffParam(Trim(sItems(1)), MsgControl(Trim(sItems(1)), "-1", sErrorList), Me, sDefaultValue, Nothing, Nothing)
|
||||
NewCompoParam = New TextBoxOnOffParam(Trim(sItems(1)), MsgControl(Trim(sItems(1)), "-1", sErrorList), Me, sDefaultValue, Nothing, Nothing)
|
||||
Else
|
||||
NewCompoParam = New TextBoxOnOffParam(Trim(sItems(1).Split("/"c)(0)), Trim(MsgControl(sItems(1).Split("/"c)(0), sItems(1).Split("/"c)(1), sErrorList)), Me, sDefaultValue, Nothing, Nothing)
|
||||
End If
|
||||
@@ -967,7 +988,7 @@ End Class
|
||||
Public Class TextBoxOnOffParam
|
||||
Inherits TextBoxParam
|
||||
|
||||
Private m_IsActive As Boolean
|
||||
Private m_IsActive As Boolean = True
|
||||
Public Property IsActive As Boolean
|
||||
Get
|
||||
Return m_IsActive
|
||||
|
||||
+136
-344
@@ -7,29 +7,8 @@ Imports System.Text.RegularExpressions
|
||||
Public Class Part
|
||||
Implements INotifyPropertyChanged
|
||||
|
||||
Friend m_IsModifyDoor As Boolean = False
|
||||
|
||||
Friend Shared m_rfModifyTitle As Action(Of Boolean)
|
||||
|
||||
' '' restituisce vero/falso valutando se le componenti o le generals della porta sono state modificate
|
||||
''Private Function IsModify() As Boolean
|
||||
'' If m_IsModifyDoor Then Return True
|
||||
'' ' se esiste almeno un elemento nella lista dei componenti
|
||||
'' If Not IsNothing(Me.CompoList) Then
|
||||
'' ' assegno ad una variabile locale il vallore della componente, e ripeto per tutte le componenti della lista
|
||||
'' For IndexCompoList = 0 To Me.CompoList.Count - 1
|
||||
'' Dim rCompo As Compo = Me.CompoList(IndexCompoList)
|
||||
'' If Me.CompoList(IndexCompoList).IsModify Then
|
||||
'' Return True
|
||||
'' End If
|
||||
'' Next
|
||||
'' End If
|
||||
'' Return False
|
||||
''End Function
|
||||
|
||||
'Friend Sub SetTitle()
|
||||
' m_rfModifyTitle(IsModify)
|
||||
'End Sub
|
||||
' questa variabile è stata definita condovisa per permettere di essere inizializzata alla prima lettura del DDF
|
||||
Public Shared FirstReadingEdge As Boolean = False
|
||||
|
||||
#Region "GENERAL"
|
||||
|
||||
@@ -247,7 +226,6 @@ Public Class Part
|
||||
Get
|
||||
If String.IsNullOrEmpty(m_Weight) Then
|
||||
m_Weight = OptionModule.m_Weight
|
||||
m_IsModifyDoor = True
|
||||
End If
|
||||
Return m_Weight
|
||||
End Get
|
||||
@@ -432,8 +410,6 @@ Public Class Part
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_BottomMachining = value
|
||||
'm_IsModifyDoor = True
|
||||
'SetTitle()
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
|
||||
End Set
|
||||
End Property
|
||||
@@ -454,8 +430,6 @@ Public Class Part
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(50148), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Asterisk)
|
||||
End If
|
||||
'm_IsModifyDoor = True
|
||||
'SetTitle()
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
|
||||
End Set
|
||||
End Property
|
||||
@@ -472,8 +446,6 @@ Public Class Part
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(50148), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Asterisk)
|
||||
End If
|
||||
'm_IsModifyDoor = True
|
||||
'SetTitle()
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
|
||||
End Set
|
||||
End Property
|
||||
@@ -490,8 +462,6 @@ Public Class Part
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(50148), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Asterisk)
|
||||
End If
|
||||
'm_IsModifyDoor = True
|
||||
'SetTitle()
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
|
||||
End Set
|
||||
End Property
|
||||
@@ -508,8 +478,6 @@ Public Class Part
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(50148), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Asterisk)
|
||||
End If
|
||||
'm_IsModifyDoor = True
|
||||
'SetTitle()
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
|
||||
End Set
|
||||
End Property
|
||||
@@ -547,6 +515,8 @@ Public Class Part
|
||||
|
||||
'Gestione ComboBox e TextBox di ogni compo della pulsantiera letta da Compo.ini
|
||||
Friend Function AddNewCompo(CurrCompoType As CompoType) As Compo
|
||||
' disabilito la costruzione del riferimento
|
||||
Assembly.BuiltReffCompo = False
|
||||
' creo la stringa che contiene la lista degli errori
|
||||
Dim ErrorList As String = String.Empty
|
||||
' creo il nuovo compo
|
||||
@@ -601,8 +571,8 @@ Public Class Part
|
||||
If Not IsNothing(Me.m_TypePart) AndAlso Not Me.m_TypePart.Contains("F") Then
|
||||
|
||||
If Not IsNothing(Map.refAssemblyPageVM.CurrAssembly.LeftJamb) Then
|
||||
' definisco un riferimento ad una variabile che sarà usata nel jamb
|
||||
Dim CompoTypeJamb As CompoType
|
||||
'' definisco un riferimento ad una variabile che sarà usata nel jamb
|
||||
'Dim CompoTypeJamb As CompoType
|
||||
' costruisco un riferimnto in locale dell'assemblato
|
||||
Dim CurrAssembly As Assembly = Map.refAssemblyPageVM.CurrAssembly
|
||||
' il nome del file associato alla componente
|
||||
@@ -610,96 +580,16 @@ Public Class Part
|
||||
Dim FrameCompoFileConfig As String = String.Empty
|
||||
Dim nDoorNbr As Integer = 1
|
||||
Int32.TryParse(Map.refAssemblyPageVM.CurrAssembly.DoorNumber, nDoorNbr)
|
||||
' se il file Matching.lua manca nel direttorio allora esco
|
||||
If CalcCompoMatching(NewCompo.CompoType.Path, nDoorNbr, NewCompo.TemplateSelItem, FrameCompoFile) AndAlso
|
||||
Not String.IsNullOrEmpty(FrameCompoFile) Then
|
||||
'------------------------------------------------------------------------------------------------------------------------------------------
|
||||
If Not SearchFileConfig(FrameCompoFile, FrameCompoFileConfig) Then
|
||||
MessageBox.Show("Compo does not exist", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Else
|
||||
' dato il direttorio dove si trova la componente devo ora cercare il file Config.ini per la lettura dei parametri della componente
|
||||
Dim FrameCompoNameDDF As String = String.Empty
|
||||
Dim FrameCompoName As String = String.Empty
|
||||
Dim Side As String = String.Empty
|
||||
Dim CurrCompoPath As String = FrameCompoFileConfig
|
||||
If File.Exists(CurrCompoPath) Then
|
||||
GetPrivateProfileCompoName(ConstCompo.S_COMPO, ConstCompo.K_NAME, FrameCompoNameDDF, FrameCompoName, CurrCompoPath)
|
||||
GetPrivateProfileJambSide("PositionSide", "Side", Side, CurrCompoPath)
|
||||
If String.IsNullOrEmpty(Side) Then Side = CurrCompoType.JambSide
|
||||
Dim FrameCompoDirectory As String
|
||||
FrameCompoDirectory = FrameCompoFileConfig.Remove(FrameCompoFileConfig.LastIndexOf("\"))
|
||||
CompoTypeJamb = New CompoType(FrameCompoName, FrameCompoNameDDF, FrameCompoDirectory, Side)
|
||||
Else
|
||||
' se non trovo nulla nel direttorio indicato carico il direttorio della componente corrente
|
||||
CompoTypeJamb = New CompoType(CurrCompoType.Name, CurrCompoType.DDFName, CurrCompoType.Path, CurrCompoType.JambSide)
|
||||
End If
|
||||
'------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Select Case CurrAssembly.DoorNumber
|
||||
Case "1"
|
||||
' questo select case serve per gestire la posizione degli hardware sui Jamb
|
||||
Select Case CurrCompoType.JambSide
|
||||
Case "Hinge"
|
||||
If CurrAssembly.LeftJamb.Swing.Contains("L") Then
|
||||
NewCompo.refJambCompo = CurrAssembly.LeftJamb.AddRefCompo(CompoTypeJamb)
|
||||
NewCompo.refJambCompo.SetTemplateSelItem(FrameCompoFile)
|
||||
NewCompo.refJambCompo.IsReadOnly = True
|
||||
Else
|
||||
NewCompo.refJambCompo = CurrAssembly.RightJamb.AddRefCompo(CompoTypeJamb)
|
||||
NewCompo.refJambCompo.SetTemplateSelItem(FrameCompoFile)
|
||||
NewCompo.refJambCompo.IsReadOnly = True
|
||||
End If
|
||||
Case "Lock"
|
||||
If CurrAssembly.LeftJamb.Swing.Contains("L") Then
|
||||
NewCompo.refJambCompo = CurrAssembly.RightJamb.AddRefCompo(CompoTypeJamb)
|
||||
NewCompo.refJambCompo.SetTemplateSelItem(FrameCompoFile)
|
||||
NewCompo.refJambCompo.IsReadOnly = True
|
||||
Else
|
||||
NewCompo.refJambCompo = CurrAssembly.LeftJamb.AddRefCompo(CompoTypeJamb)
|
||||
NewCompo.refJambCompo.SetTemplateSelItem(FrameCompoFile)
|
||||
NewCompo.refJambCompo.IsReadOnly = True
|
||||
End If
|
||||
Case "Top"
|
||||
NewCompo.refJambCompo = CurrAssembly.TopJamb.AddRefCompo(CompoTypeJamb)
|
||||
NewCompo.refJambCompo.SetTemplateSelItem(FrameCompoFile)
|
||||
NewCompo.refJambCompo.IsReadOnly = True
|
||||
Case "Bottom"
|
||||
NewCompo.refJambCompo = CurrAssembly.BottomJamb.AddRefCompo(CompoTypeJamb)
|
||||
NewCompo.refJambCompo.SetTemplateSelItem(FrameCompoFile)
|
||||
NewCompo.refJambCompo.IsReadOnly = True
|
||||
End Select
|
||||
Case "2"
|
||||
Select Case CurrCompoType.JambSide
|
||||
Case "Hinge"
|
||||
If Me.TypePart = "DO_1" Then
|
||||
NewCompo.refJambCompo = CurrAssembly.LeftJamb.AddRefCompo(CompoTypeJamb)
|
||||
NewCompo.refJambCompo.SetTemplateSelItem(FrameCompoFile)
|
||||
NewCompo.refJambCompo.IsReadOnly = True
|
||||
Else
|
||||
NewCompo.refJambCompo = CurrAssembly.RightJamb.AddRefCompo(CompoTypeJamb)
|
||||
NewCompo.refJambCompo.SetTemplateSelItem(FrameCompoFile)
|
||||
NewCompo.refJambCompo.IsReadOnly = True
|
||||
End If
|
||||
Case "Lock"
|
||||
' significa che le componenrti stanno solo sulle porte
|
||||
If Me.TypePart = "DO_1" And Not Me.Swing.Contains("I") Then
|
||||
NewCompo.refJambCompo = CurrAssembly.GetArrayPartDoor(1).Door.AddRefCompo(CurrCompoType)
|
||||
NewCompo.refJambCompo.SetTemplateSelItem(FrameCompoFile)
|
||||
NewCompo.refJambCompo.IsReadOnly = True
|
||||
ElseIf Me.TypePart = "DO_2" And Not Me.Swing.Contains("I") Then
|
||||
NewCompo.refJambCompo = CurrAssembly.GetArrayPartDoor(0).Door.AddRefCompo(CurrCompoType)
|
||||
NewCompo.refJambCompo.SetTemplateSelItem(FrameCompoFile)
|
||||
NewCompo.refJambCompo.IsReadOnly = True
|
||||
End If
|
||||
Case "Top"
|
||||
NewCompo.refJambCompo = CurrAssembly.TopJamb.AddRefCompo(CompoTypeJamb)
|
||||
NewCompo.refJambCompo.SetTemplateSelItem(FrameCompoFile)
|
||||
NewCompo.refJambCompo.IsReadOnly = True
|
||||
Case "Bottom"
|
||||
NewCompo.refJambCompo = CurrAssembly.BottomJamb.AddRefCompo(CompoTypeJamb)
|
||||
NewCompo.refJambCompo.SetTemplateSelItem(FrameCompoFile)
|
||||
NewCompo.refJambCompo.IsReadOnly = True
|
||||
End Select
|
||||
End Select
|
||||
CreateRefCompo(CurrCompoType, NewCompo, CurrAssembly, FrameCompoFileConfig, FrameCompoFile, Me)
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -724,12 +614,104 @@ Public Class Part
|
||||
CompoList.Add(NewCompo)
|
||||
End If
|
||||
End If
|
||||
'm_IsModifyDoor = True
|
||||
'SetTitle()
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
|
||||
' riabilito la costruzion del riferimnto
|
||||
Assembly.BuiltReffCompo = True
|
||||
Return NewCompo
|
||||
End Function
|
||||
|
||||
Friend Shared Sub CreateRefCompo(ByRef CurrCompoType As CompoType, ByRef NewCompo As Compo, ByRef CurrAssembly As Assembly, FrameCompoFileConfig As String, FrameCompoFile As String, CurrDoor As Part)
|
||||
' disabilito la costruzione del riferimento
|
||||
Assembly.BuiltReffCompo = False
|
||||
' definisco un riferimento ad una variabile che sarà usata nel jamb
|
||||
Dim CompoTypeJamb As CompoType
|
||||
' dato il direttorio dove si trova la componente devo ora cercare il file Config.ini per la lettura dei parametri della componente
|
||||
Dim FrameCompoNameDDF As String = String.Empty
|
||||
Dim FrameCompoName As String = String.Empty
|
||||
Dim Side As String = String.Empty
|
||||
Dim CurrCompoPath As String = FrameCompoFileConfig
|
||||
If File.Exists(CurrCompoPath) Then
|
||||
GetPrivateProfileCompoName(ConstCompo.S_COMPO, ConstCompo.K_NAME, FrameCompoNameDDF, FrameCompoName, CurrCompoPath)
|
||||
GetPrivateProfileJambSide("PositionSide", "Side", Side, CurrCompoPath)
|
||||
If String.IsNullOrEmpty(Side) Then Side = CurrCompoType.JambSide
|
||||
Dim FrameCompoDirectory As String
|
||||
FrameCompoDirectory = FrameCompoFileConfig.Remove(FrameCompoFileConfig.LastIndexOf("\"))
|
||||
CompoTypeJamb = New CompoType(FrameCompoName, FrameCompoNameDDF, FrameCompoDirectory, Side)
|
||||
Else
|
||||
' se non trovo nulla nel direttorio indicato carico il direttorio della componente corrente
|
||||
CompoTypeJamb = New CompoType(CurrCompoType.Name, CurrCompoType.DDFName, CurrCompoType.Path, CurrCompoType.JambSide)
|
||||
End If
|
||||
'------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Select Case CurrAssembly.DoorNumber
|
||||
Case "1"
|
||||
' questo select case serve per gestire la posizione degli hardware sui Jamb
|
||||
Select Case CurrCompoType.JambSide
|
||||
Case "Hinge"
|
||||
If CurrAssembly.LeftJamb.Swing.Contains("L") Then
|
||||
NewCompo.refJambCompo = CurrAssembly.LeftJamb.AddRefCompo(CompoTypeJamb)
|
||||
NewCompo.refJambCompo.SetTemplateSelItemRefCompo(FrameCompoFile, NewCompo.refJambCompo)
|
||||
NewCompo.refJambCompo.IsReadOnly = True
|
||||
Else
|
||||
NewCompo.refJambCompo = CurrAssembly.RightJamb.AddRefCompo(CompoTypeJamb)
|
||||
NewCompo.refJambCompo.SetTemplateSelItemRefCompo(FrameCompoFile, NewCompo.refJambCompo)
|
||||
NewCompo.refJambCompo.IsReadOnly = True
|
||||
End If
|
||||
Case "Lock"
|
||||
If CurrAssembly.LeftJamb.Swing.Contains("L") Then
|
||||
NewCompo.refJambCompo = CurrAssembly.RightJamb.AddRefCompo(CompoTypeJamb)
|
||||
NewCompo.refJambCompo.SetTemplateSelItemRefCompo(FrameCompoFile, NewCompo.refJambCompo)
|
||||
NewCompo.refJambCompo.IsReadOnly = True
|
||||
Else
|
||||
NewCompo.refJambCompo = CurrAssembly.LeftJamb.AddRefCompo(CompoTypeJamb)
|
||||
NewCompo.refJambCompo.SetTemplateSelItemRefCompo(FrameCompoFile, NewCompo.refJambCompo)
|
||||
NewCompo.refJambCompo.IsReadOnly = True
|
||||
End If
|
||||
Case "Top"
|
||||
NewCompo.refJambCompo = CurrAssembly.TopJamb.AddRefCompo(CompoTypeJamb)
|
||||
NewCompo.refJambCompo.SetTemplateSelItemRefCompo(FrameCompoFile, NewCompo.refJambCompo)
|
||||
NewCompo.refJambCompo.IsReadOnly = True
|
||||
Case "Bottom"
|
||||
NewCompo.refJambCompo = CurrAssembly.BottomJamb.AddRefCompo(CompoTypeJamb)
|
||||
NewCompo.refJambCompo.SetTemplateSelItemRefCompo(FrameCompoFile, NewCompo.refJambCompo)
|
||||
NewCompo.refJambCompo.IsReadOnly = True
|
||||
End Select
|
||||
Case "2"
|
||||
Select Case CurrCompoType.JambSide
|
||||
Case "Hinge"
|
||||
If CurrDoor.TypePart = "DO_1" Then
|
||||
NewCompo.refJambCompo = CurrAssembly.LeftJamb.AddRefCompo(CompoTypeJamb)
|
||||
NewCompo.refJambCompo.SetTemplateSelItemRefCompo(FrameCompoFile, NewCompo.refJambCompo)
|
||||
NewCompo.refJambCompo.IsReadOnly = True
|
||||
Else
|
||||
NewCompo.refJambCompo = CurrAssembly.RightJamb.AddRefCompo(CompoTypeJamb)
|
||||
NewCompo.refJambCompo.SetTemplateSelItemRefCompo(FrameCompoFile, NewCompo.refJambCompo)
|
||||
NewCompo.refJambCompo.IsReadOnly = True
|
||||
End If
|
||||
Case "Lock"
|
||||
' significa che le componenrti stanno solo sulle porte
|
||||
If CurrDoor.TypePart = "DO_1" And Not CurrDoor.Swing.Contains("I") Then
|
||||
NewCompo.refJambCompo = CurrAssembly.GetArrayPartDoor(1).Door.AddRefCompo(CurrCompoType)
|
||||
NewCompo.refJambCompo.SetTemplateSelItemRefCompo(FrameCompoFile, NewCompo.refJambCompo)
|
||||
NewCompo.refJambCompo.IsReadOnly = True
|
||||
ElseIf CurrDoor.TypePart = "DO_2" And Not CurrDoor.Swing.Contains("I") Then
|
||||
NewCompo.refJambCompo = CurrAssembly.GetArrayPartDoor(0).Door.AddRefCompo(CurrCompoType)
|
||||
NewCompo.refJambCompo.SetTemplateSelItemRefCompo(FrameCompoFile, NewCompo.refJambCompo)
|
||||
NewCompo.refJambCompo.IsReadOnly = True
|
||||
End If
|
||||
Case "Top"
|
||||
NewCompo.refJambCompo = CurrAssembly.TopJamb.AddRefCompo(CompoTypeJamb)
|
||||
NewCompo.refJambCompo.SetTemplateSelItemRefCompo(FrameCompoFile, NewCompo.refJambCompo)
|
||||
NewCompo.refJambCompo.IsReadOnly = True
|
||||
Case "Bottom"
|
||||
NewCompo.refJambCompo = CurrAssembly.BottomJamb.AddRefCompo(CompoTypeJamb)
|
||||
NewCompo.refJambCompo.SetTemplateSelItemRefCompo(FrameCompoFile, NewCompo.refJambCompo)
|
||||
NewCompo.refJambCompo.IsReadOnly = True
|
||||
End Select
|
||||
End Select
|
||||
' riabilito la costruzion del riferimnto
|
||||
Assembly.BuiltReffCompo = True
|
||||
End Sub
|
||||
|
||||
'Gestione ComboBox e TextBox di ogni compo della pulsantiera letta da Compo.ini
|
||||
Public Function AddRefCompo(CurrCompoType As CompoType) As Compo
|
||||
' creo la stringa che contiene la lista degli errori
|
||||
@@ -749,7 +731,7 @@ Public Class Part
|
||||
NewCompo.TemplateName = Name
|
||||
NewCompo.TemplateItemList = TemplateList
|
||||
If Not SetItemTemplate(NewCompo.CompoType.DDFName) = String.Empty Then
|
||||
NewCompo.SetTemplateSelItem(SetItemTemplate(NewCompo.CompoType.DDFName))
|
||||
NewCompo.SetTemplateSelItemRefCompo(NewCompo.CompoType.DDFName, NewCompo)
|
||||
Else
|
||||
' se esiste un lista di template
|
||||
If NewCompo.TemplateItemList.Count > 0 Then
|
||||
@@ -759,7 +741,7 @@ Public Class Part
|
||||
SelItemindex += 1
|
||||
End While
|
||||
' inizializzo la combobox template
|
||||
NewCompo.SetTemplateSelItem(NewCompo.TemplateItemList(SelItemindex))
|
||||
NewCompo.SetTemplateSelItemRefCompo(NewCompo.TemplateItemList(SelItemindex), NewCompo)
|
||||
|
||||
End If
|
||||
End If
|
||||
@@ -802,8 +784,6 @@ Public Class Part
|
||||
CompoList.Add(NewCompo)
|
||||
End If
|
||||
End If
|
||||
'm_IsModifyDoor = True
|
||||
'SetTitle()
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
|
||||
Return NewCompo
|
||||
End Function
|
||||
@@ -839,6 +819,24 @@ Public Class Part
|
||||
CompoList.Remove(CompoToRemove)
|
||||
End Sub
|
||||
|
||||
Friend Sub RemoveRefCompo(CompoToRemove As Compo)
|
||||
If Not IsNothing(CompoToRemove) Then
|
||||
If Map.refAssemblyPageVM.CurrAssembly.LeftJamb.CompoList.IndexOf(CompoToRemove) > -1 Then
|
||||
Map.refAssemblyPageVM.CurrAssembly.LeftJamb.RemoveCompo(CompoToRemove)
|
||||
ElseIf Map.refAssemblyPageVM.CurrAssembly.RightJamb.CompoList.IndexOf(CompoToRemove) > -1 Then
|
||||
Map.refAssemblyPageVM.CurrAssembly.RightJamb.RemoveCompo(CompoToRemove)
|
||||
ElseIf Map.refAssemblyPageVM.CurrAssembly.TopJamb.CompoList.IndexOf(CompoToRemove) > -1 Then
|
||||
Map.refAssemblyPageVM.CurrAssembly.TopJamb.RemoveCompo(CompoToRemove)
|
||||
ElseIf Map.refAssemblyPageVM.CurrAssembly.BottomJamb.CompoList.IndexOf(CompoToRemove) > -1 Then
|
||||
Map.refAssemblyPageVM.CurrAssembly.BottomJamb.RemoveCompo(CompoToRemove)
|
||||
ElseIf Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(1).Door.CompoList.IndexOf(CompoToRemove) > -1 Then
|
||||
Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(1).Door.RemoveCompo(CompoToRemove)
|
||||
ElseIf Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.CompoList.IndexOf(CompoToRemove) > -1 Then
|
||||
Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.RemoveCompo(CompoToRemove)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' aggiorna il ToolTip delle TextBox
|
||||
Private Sub UpdateToolTip()
|
||||
For CompoIndex = 0 To m_CompoList.Count - 1
|
||||
@@ -854,211 +852,6 @@ Public Class Part
|
||||
#Region "LETTURA DDF"
|
||||
' Genero una nuova porta da usare nella lettura di un DDF
|
||||
Private FileContent As String()
|
||||
'Shared Sub ReadDDF(sPathDDF As String, ByRef ReadDoor As Part)
|
||||
' If Not Directory.Exists(IniFile.m_CompoDir) Then
|
||||
' EgtOutLog("CompoDir not found : " & IniFile.m_CompoDir)
|
||||
' MessageBox.Show("CompoDir not found : " & IniFile.m_CompoDir, "ERROR!", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' End
|
||||
' Return
|
||||
' End If
|
||||
' ReadDoor.m_IsModifyDoor = False
|
||||
' 'm_Door = ReadDoor
|
||||
' ' restituisce un problema nella lettura di un valore della compo
|
||||
' Dim InvalidValue As String = String.Empty
|
||||
' ' controllo se esite il file DDF
|
||||
' If Not File.Exists(sPathDDF) Then Return
|
||||
' ReadDoor.FileContent = File.ReadAllLines(sPathDDF)
|
||||
' ' se il file esiste ma è vuoto
|
||||
' If ReadDoor.FileContent.Count = 0 Then
|
||||
' MessageBox.Show(EgtMsg(50107), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' End If
|
||||
' Dim bSecure As Boolean = False
|
||||
' ' leggo riga per riga
|
||||
' For LineIndex As Integer = 0 To ReadDoor.FileContent.Count - 1
|
||||
|
||||
' ' pulisco dai commenti
|
||||
' ' FileContent(LineIndex) = FindComments(FileContent(LineIndex))
|
||||
|
||||
' ' Leggo le unità di misura
|
||||
' If LineIndex < ReadDoor.FileContent.Count - 1 Then
|
||||
' If SearchKey(ReadDoor.FileContent(LineIndex), K_MEASURES) Then
|
||||
' LineIndex = ReadDoor.GetMeasure(LineIndex)
|
||||
' ' se manca una parola chiave nel DDF
|
||||
' If LineIndex = -1 Then
|
||||
' ' carico il messaggio di errore
|
||||
' InvalidValue += String.Format(EgtMsg(50102), K_MEASURES + vbCrLf)
|
||||
' ' assegno una porta vuota ed esco dal ciclo
|
||||
' ReadDoor = Nothing
|
||||
' ' interrompo la lettura del file
|
||||
' Exit For
|
||||
' End If
|
||||
' End If
|
||||
' Else
|
||||
' Exit For
|
||||
' End If
|
||||
' ' Leggo il codice
|
||||
' If LineIndex < ReadDoor.FileContent.Count - 1 Then
|
||||
' If SearchKey(ReadDoor.FileContent(LineIndex), K_CODE) Then
|
||||
' LineIndex = ReadDoor.GetCode(LineIndex)
|
||||
' ' se manca una parola chiave nel DDF
|
||||
' If LineIndex = -1 Then
|
||||
' ' carico il messaggio di errore
|
||||
' InvalidValue += String.Format(EgtMsg(50102), K_CODE + vbCrLf)
|
||||
' ' assegno una porta vuota ed esco dal ciclo
|
||||
' ReadDoor = Nothing
|
||||
' ' interrompo la lettura del file
|
||||
' Exit For
|
||||
' End If
|
||||
' End If
|
||||
' Else
|
||||
' Exit For
|
||||
' End If
|
||||
' ' Leggo il ordine
|
||||
' If LineIndex < ReadDoor.FileContent.Count - 1 Then
|
||||
' If SearchKey(ReadDoor.FileContent(LineIndex), S_ORDER) Then
|
||||
' LineIndex = ReadDoor.GetOrder(LineIndex + 1)
|
||||
' ' se manca una parola chiave nel DDF
|
||||
' If LineIndex = -1 Then
|
||||
' ' carico il messaggio di errore
|
||||
' InvalidValue += String.Format(EgtMsg(50102), S_ORDER + vbCrLf)
|
||||
|
||||
' ' assegno una porta vuota ed esco dal ciclo
|
||||
' ReadDoor = Nothing
|
||||
' ' interrompo la lettura del file
|
||||
' Exit For
|
||||
' End If
|
||||
' End If
|
||||
' Else
|
||||
' Exit For
|
||||
' End If
|
||||
' ' Leggo la data
|
||||
' If LineIndex < ReadDoor.FileContent.Count - 1 Then
|
||||
' If SearchKey(ReadDoor.FileContent(LineIndex), K_DATE) Then
|
||||
' LineIndex = ReadDoor.GetDate(LineIndex)
|
||||
' ' se manca una parola chiave nel DDF
|
||||
' If LineIndex = -1 Then
|
||||
' ' carico il messaggio di errore
|
||||
' InvalidValue += String.Format(EgtMsg(50102), K_DATE + vbCrLf)
|
||||
' ' assegno una porta vuota ed esco dal ciclo
|
||||
' ReadDoor = Nothing
|
||||
' ' interrompo la lettura del file
|
||||
' Exit For
|
||||
' End If
|
||||
' End If
|
||||
' Else
|
||||
' Exit For
|
||||
' End If
|
||||
' ' size
|
||||
' If LineIndex < ReadDoor.FileContent.Count - 1 Then
|
||||
' If SearchKey(ReadDoor.FileContent(LineIndex), K_SIZE) Then
|
||||
' LineIndex = ReadDoor.GetSize(LineIndex + 1)
|
||||
' ' se manca una parola chiave nel DDF
|
||||
' If LineIndex = -1 Then
|
||||
' ' carico il messaggio di errore
|
||||
' InvalidValue += String.Format(EgtMsg(50102), K_SIZE + vbCrLf)
|
||||
' ' assegno una porta vuota ed esco dal ciclo
|
||||
' ReadDoor = Nothing
|
||||
' ' interrompo la lettura del file
|
||||
' Exit For
|
||||
' End If
|
||||
' End If
|
||||
' Else
|
||||
' Exit For
|
||||
' End If
|
||||
|
||||
' ' leggo il peso della porta
|
||||
' If LineIndex < ReadDoor.FileContent.Count - 1 Then
|
||||
' If SearchKey(ReadDoor.FileContent(LineIndex), K_WEIGHT) Then
|
||||
' LineIndex = ReadDoor.GetWeight(LineIndex)
|
||||
' If LineIndex = -1 Then
|
||||
' InvalidValue += String.Format(EgtMsg(50102), K_WEIGHT + vbCrLf)
|
||||
' ' assegno una porta vuota ed esco dal ciclo
|
||||
' ReadDoor = Nothing
|
||||
' Exit For
|
||||
' End If
|
||||
' End If
|
||||
' Else
|
||||
' Exit For
|
||||
' End If
|
||||
|
||||
' ' swing
|
||||
' If LineIndex < ReadDoor.FileContent.Count - 1 Then
|
||||
' If SearchKey(ReadDoor.FileContent(LineIndex), K_SWING) Then
|
||||
' LineIndex = ReadDoor.GetSwing(LineIndex)
|
||||
' If LineIndex = -1 Then
|
||||
' InvalidValue += String.Format(EgtMsg(50102), K_SWING + vbCrLf)
|
||||
' ' assegno una porta vuota ed esco dal ciclo
|
||||
' ReadDoor = Nothing
|
||||
' Exit For
|
||||
' End If
|
||||
' End If
|
||||
' Else
|
||||
' Exit For
|
||||
' End If
|
||||
' ' secure
|
||||
' If LineIndex < ReadDoor.FileContent.Count - 1 Then
|
||||
' If SearchKey(ReadDoor.FileContent(LineIndex), K_SECURE) Then
|
||||
' bSecure = True
|
||||
' LineIndex += 1
|
||||
' End If
|
||||
' End If
|
||||
' ' profiles
|
||||
' If LineIndex < ReadDoor.FileContent.Count - 1 Then
|
||||
' If SearchKey(ReadDoor.FileContent(LineIndex), K_PROFILES) Then
|
||||
' LineIndex = ReadDoor.GetProfiles(LineIndex + 1, "")
|
||||
' If LineIndex = -1 Then
|
||||
' InvalidValue += String.Format(EgtMsg(50102), K_PROFILES + vbCrLf)
|
||||
' ' assegno una porta vuota ed esco dal ciclo
|
||||
' ReadDoor = Nothing
|
||||
' Exit For
|
||||
' End If
|
||||
' End If
|
||||
' Else
|
||||
' Exit For
|
||||
' End If
|
||||
|
||||
' ' Compo
|
||||
' ' siccome dopo ogni lettura restituisco la riga successiva: controllo che veramente esiste nel file
|
||||
' If LineIndex < ReadDoor.FileContent.Count - 1 Then
|
||||
' ' se trovo un nome seguito dai due punti
|
||||
' If Not String.IsNullOrWhiteSpace(ReadDoor.SearchName(ReadDoor.FileContent(LineIndex))) Then
|
||||
' ' carivo la stringa letta come nome DDF
|
||||
' Dim CompoNameDDF = ReadDoor.SearchName(ReadDoor.FileContent(LineIndex))
|
||||
' ' passo la riga successiva e il nome DDF alla funzione che controlla se esiste la compo e restituisce la riga successiva
|
||||
' LineIndex = ReadDoor.GetNewCompo(LineIndex + 1, CompoNameDDF, InvalidValue)
|
||||
' ' se restituisco una riga scommentata ma non interpretabile
|
||||
' ElseIf Not String.IsNullOrWhiteSpace(Utility.FindComments(ReadDoor.FileContent(LineIndex))) Then
|
||||
' If Not String.IsNullOrEmpty(InvalidValue) Then InvalidValue &= Environment.NewLine
|
||||
' InvalidValue &= String.Format(EgtMsg(50130), LineIndex)
|
||||
' End If
|
||||
' Else
|
||||
' Exit For
|
||||
' End If
|
||||
' Next
|
||||
|
||||
' ' quando finisce la lettura di tutte le righe esci dal ciclo
|
||||
' If Not String.IsNullOrWhiteSpace(InvalidValue) Then
|
||||
' MessageBox.Show(InvalidValue, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' Else
|
||||
' If Not bSecure Then
|
||||
' DdfFile.WriteDDFPart(ReadDoor, sPathDDF, True, True)
|
||||
' End If
|
||||
' If String.IsNullOrEmpty(ReadDoor.m_Weight) Then
|
||||
' If m_IsCheckedWeight = Visibility.Visible Then
|
||||
' ' se il valore è acceso ma non è presente nel ddf chiedo se spegnere
|
||||
' If MessageBox.Show(EgtMsg(50149), EgtMsg(50110), MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes) = MessageBoxResult.Yes Then
|
||||
' ' decido di spegnere
|
||||
' OptionsVM.IsCheckedWeight = False
|
||||
' Else
|
||||
' ' decido di accendere
|
||||
' OptionsVM.IsCheckedWeight = True
|
||||
' ReadDoor.m_Weight = OptionModule.m_Weight
|
||||
' ReadDoor.VisibilityWeight = Visibility.Visible
|
||||
' End If
|
||||
' End If
|
||||
' 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 esiste il file DDF
|
||||
@@ -1266,7 +1059,7 @@ Public Class Part
|
||||
' quando finisce la lettura di tutte le righe esci dal ciclo
|
||||
' se la stringa dei messaggi contiene delle informazioni allora stampa
|
||||
If Not String.IsNullOrWhiteSpace(InvalidValue) Then
|
||||
MessageBox.Show(InvalidValue, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
MessageBox.Show(InvalidValue, EgtMsg(50101) & " in " & ReadDoor.TypePart, MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Else
|
||||
'' se non è stata trovata nessun Secure allora aggiorno subito il file
|
||||
'If Not bSecure Then
|
||||
@@ -1765,8 +1558,7 @@ Public Class Part
|
||||
End Function
|
||||
|
||||
#End Region ' Carica il General della porta
|
||||
' questa variabile è stata definita condovisa per permettere di essere inizializzata alla prima lettura del DDF
|
||||
Public Shared FirstReadingEdge As Boolean = False
|
||||
|
||||
' controllo che i valori passati come spigoli siano presenti nella lista corrente (lettura DDF)
|
||||
Public Function EdgeTypeControl(Edge As String) As Boolean
|
||||
Dim bFound As Boolean = False
|
||||
@@ -1801,7 +1593,6 @@ Public Class Part
|
||||
Return Index
|
||||
End If
|
||||
End If
|
||||
|
||||
For CompoListIndex = 0 To CompoPanelVM.CompoTypeList.Count() - 1
|
||||
' eseguo il confronto con il nome delle componenti che è stato acricato nel file Default.ini
|
||||
If CompoPanelVM.CompoTypeList(CompoListIndex).DDFName = CompoNameDDF Then
|
||||
@@ -1851,6 +1642,17 @@ Public Class Part
|
||||
' ed esci dal ciclo while
|
||||
Exit While
|
||||
End If
|
||||
' eseguo un confronto tra il nome del file scritto nel ddf e quello presente nel direttorio
|
||||
For CurrIndex = 0 To m_CurrCompo.TemplateItemList.Count - 1
|
||||
Dim FileNemaRead As String = Path.GetFullPath(CurrCompoTypePath & "\" & m_CurrCompo.TemplateSelItem & ".lua").ToLower
|
||||
Dim FileNameInDir As String = Path.GetFullPath(CurrCompoTypePath & "\" & m_CurrCompo.TemplateItemList(CurrIndex) & ".lua").ToLower
|
||||
If File.Exists(FileNemaRead) Then
|
||||
If FileNemaRead = FileNameInDir Then
|
||||
m_CurrCompo.SetTemplateSelItem(m_CurrCompo.TemplateItemList(CurrIndex))
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
'mi sposto nella riga successiva
|
||||
Index += 1
|
||||
' leggo i parametri della componente
|
||||
@@ -1906,7 +1708,6 @@ Public Class Part
|
||||
End If
|
||||
'------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
End If
|
||||
|
||||
' se la stringa non ha i due punti
|
||||
End While
|
||||
Exit For
|
||||
@@ -2087,15 +1888,6 @@ Public Class Part
|
||||
IndexLine += IndexParam
|
||||
End Sub
|
||||
|
||||
'' salto gli spazi vuoti finoa alla prima riga piena
|
||||
'Public Function SkipWhiteSpace(Array() As String, ByRef Index As Integer, LastIndex As Integer) As Integer
|
||||
' Array(Index) = FindComments(Array(Index))
|
||||
' While String.IsNullOrWhiteSpace(Array(Index)) And Index < LastIndex
|
||||
' Index += 1
|
||||
' Array(Index) = FindComments(Array(Index))
|
||||
' End While
|
||||
' Return Index
|
||||
'End Function
|
||||
#End Region ' Lettura ddf
|
||||
|
||||
' Genero una nuova porta da usare nella lettura di un DDF
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<UserControl.Resources>
|
||||
<local:SplitConverter x:Key="SplitConverter"/>
|
||||
<local:DoorVisibilityConverter x:Key="DoorVisibilityConverter"/>
|
||||
<local:TemplateListConverter x:Key="TemplateListConverter"/>
|
||||
<EgtDOORCreator:TrueToFalse x:Key="TrueToFalse"/>
|
||||
</UserControl.Resources>
|
||||
|
||||
@@ -245,10 +246,12 @@
|
||||
<UniformGrid Columns="2" Visibility="{Binding TemplateVisibility}">
|
||||
<TextBlock Text="{Binding TemplateName}"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<ComboBox ItemsSource="{Binding TemplateItemList}" Margin="0,0,0,2"
|
||||
SelectedItem="{Binding TemplateSelItem}"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
IsEnabled="{Binding IsReadOnly}"/>
|
||||
<ComboBox ItemsSource="{Binding TemplateItemList,
|
||||
Converter={StaticResource TemplateListConverter}}"
|
||||
Margin="0,0,0,2"
|
||||
SelectedItem="{Binding TemplateSelItem}"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
IsEnabled="{Binding IsReadOnly}"/>
|
||||
</UniformGrid>
|
||||
<!--Lista dei parametri-->
|
||||
<ItemsControl ItemsSource="{Binding CompoParamList}">
|
||||
|
||||
@@ -38,7 +38,6 @@ Public Class PartPageVM
|
||||
|
||||
Sub New()
|
||||
Map.SetRefDoorParametersVM(Me)
|
||||
Part.m_rfModifyTitle = AddressOf Map.refMainWindowVM.ModifyTitle
|
||||
End Sub
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
@@ -122,6 +122,7 @@
|
||||
<Compile Include="Converter\BooleanToVisibility.vb" />
|
||||
<Compile Include="Converter\Path.vb" />
|
||||
<Compile Include="Converter\ProjectVisibility.vb" />
|
||||
<Compile Include="Converter\TemplateListConverter.vb" />
|
||||
<Compile Include="Converter\TrueToFalse.vb" />
|
||||
<Compile Include="DdfFile.vb" />
|
||||
<Compile Include="AssemblyManager\AssemblyManagerV.xaml.vb">
|
||||
|
||||
@@ -72,5 +72,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.8.11.6")>
|
||||
<Assembly: AssemblyFileVersion("1.8.11.6")>
|
||||
<Assembly: AssemblyVersion("1.8.12.1")>
|
||||
<Assembly: AssemblyFileVersion("1.8.12.1")>
|
||||
|
||||
Reference in New Issue
Block a user