EgtDOORCreator 2.1b1:
-> correzione funzionamento TextBobOnOff e ComboBoxOnOff, -> gestione errori in fase di apertura assemblato, -> nuovi controlli sul tipo di ddf (assemblato/porta singola) in lettura.
This commit is contained in:
+252
-29
@@ -916,6 +916,14 @@ Public Class Assembly
|
||||
|
||||
#Region "Lettura Assemblato"
|
||||
|
||||
Public Enum ResultReadingAssembInfo
|
||||
MissingAssembInfo
|
||||
ErrorInAssembInfo
|
||||
CorrectAssembInfo
|
||||
End Enum
|
||||
|
||||
Public bOk As ResultReadingAssembInfo = ResultReadingAssembInfo.CorrectAssembInfo
|
||||
|
||||
Private FileContent() As String
|
||||
Shared Sub ReadDDFAssembly(sPathDDF As String, ByRef ReadAssembly As Assembly)
|
||||
BuiltReffCompo = False
|
||||
@@ -934,9 +942,9 @@ Public Class Assembly
|
||||
' leggo riga per riga
|
||||
Dim IndexLine As Integer = 0
|
||||
Map.refAssemblyManagerVM.LoadAssemblyInformation(ReadAssembly)
|
||||
Dim bOk As Boolean = ReadAssembly.GetGeneralAssembly(IndexLine, sErrorInfo)
|
||||
ReadAssembly.bOk = ReadAssembly.GetGeneralAssembly(IndexLine, sErrorInfo)
|
||||
'---------------------------------------------------------------------------------------------------------------------------------
|
||||
If bOk Then
|
||||
If ReadAssembly.bOk <> ResultReadingAssembInfo.ErrorInAssembInfo Then
|
||||
If IndexLine = -1 Then
|
||||
' 50163= Error in reading General Assembly in DDF
|
||||
sErrorInfo += String.Format(EgtMsg(50102), EgtMsg(50163) + vbCrLf)
|
||||
@@ -945,12 +953,15 @@ Public Class Assembly
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
|
||||
Else
|
||||
If ReadAssembly.GetDDFDoor(IndexLine, sErrorInfo) = -1 Then
|
||||
' errore nella lettura di un part: blocco tutto
|
||||
ReadAssembly = Nothing
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = False
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
' 50163= Error in reading General Assembly in DDF
|
||||
sErrorInfo += String.Format(EgtMsg(50102), EgtMsg(50163) + vbCrLf)
|
||||
ReadAssembly = Nothing
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = False
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
|
||||
@@ -962,7 +973,7 @@ Public Class Assembly
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function GetGeneralAssembly(ByRef IndexLine As Integer, sErrorInfo As String) As Boolean
|
||||
Private Function GetGeneralAssembly(ByRef IndexLine As Integer, sErrorInfo As String) As ResultReadingAssembInfo
|
||||
IndexLine = SkipWhiteSpace(IndexLine)
|
||||
' Size
|
||||
If IndexLine < FileContent.Count - 1 Then
|
||||
@@ -970,11 +981,11 @@ Public Class Assembly
|
||||
IndexLine = GetSize(IndexLine + 1)
|
||||
If IndexLine = -1 Then
|
||||
sErrorInfo += String.Format(EgtMsg(50102), ConstIni.S_SIZE_INI + vbCrLf)
|
||||
Return False
|
||||
Return ResultReadingAssembInfo.ErrorInAssembInfo
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
If IndexLine = 0 Then Return True
|
||||
If IndexLine = 0 Then Return ResultReadingAssembInfo.MissingAssembInfo
|
||||
IndexLine = SkipWhiteSpace(IndexLine)
|
||||
' Light
|
||||
If IndexLine < FileContent.Count - 1 Then
|
||||
@@ -982,7 +993,7 @@ Public Class Assembly
|
||||
IndexLine = GetLight(IndexLine + 1)
|
||||
If IndexLine = -1 Then
|
||||
sErrorInfo += String.Format(EgtMsg(50102), ConstIni.S_LIGHT + vbCrLf)
|
||||
Return False
|
||||
Return ResultReadingAssembInfo.ErrorInAssembInfo
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -993,7 +1004,7 @@ Public Class Assembly
|
||||
IndexLine = GetOverlap(IndexLine + 1)
|
||||
If IndexLine = -1 Then
|
||||
sErrorInfo += String.Format(EgtMsg(50102), ConstIni.S_OVERLAP + vbCrLf)
|
||||
Return False
|
||||
Return ResultReadingAssembInfo.ErrorInAssembInfo
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -1004,7 +1015,7 @@ Public Class Assembly
|
||||
IndexLine = GetExterior(IndexLine + 1)
|
||||
If IndexLine = -1 Then
|
||||
sErrorInfo += String.Format(EgtMsg(50102), ConstIni.K_EXTERIOR + vbCrLf)
|
||||
Return False
|
||||
Return ResultReadingAssembInfo.ErrorInAssembInfo
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -1015,7 +1026,7 @@ Public Class Assembly
|
||||
IndexLine = GetProfiles(IndexLine + 1)
|
||||
If IndexLine = -1 Then
|
||||
sErrorInfo += String.Format(EgtMsg(50102), ConstIni.S_PROFILES + vbCrLf)
|
||||
Return False
|
||||
Return ResultReadingAssembInfo.ErrorInAssembInfo
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -1028,7 +1039,7 @@ Public Class Assembly
|
||||
SetDoorNumber(m_DoorNumber)
|
||||
If IndexLine = -1 Then
|
||||
sErrorInfo += String.Format(EgtMsg(50102), ConstIni.S_DOORS_ASSEMBY + vbCrLf)
|
||||
Return False
|
||||
Return ResultReadingAssembInfo.ErrorInAssembInfo
|
||||
End If
|
||||
' se sono arrivato fino a qui significa che ormai è terminata la pagina
|
||||
If IsNothing(m_Exterior) OrElse Not m_Exterior Then
|
||||
@@ -1037,7 +1048,7 @@ Public Class Assembly
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Return True
|
||||
Return ResultReadingAssembInfo.CorrectAssembInfo
|
||||
End Function
|
||||
|
||||
' salta le righe che non contengono un metadata
|
||||
@@ -1270,17 +1281,17 @@ Public Class Assembly
|
||||
Local_PartDoor.Door.SwingTypeList = m_SwingTypeListSinlgeDoor
|
||||
Local_PartDoor.SetIsChecked(Local_Door.IsActive)
|
||||
ListPartDoor.Add(Local_PartDoor)
|
||||
'SetArrayPartDoor(Local_PartDoor, 0)
|
||||
Case ConstGen.PART_DO_ & "2"
|
||||
Local_PartDoor.Door = Local_Door
|
||||
Local_PartDoor.Door.SwingTypeList = m_SwingTypeListRightDoor
|
||||
If Not IsNothing(Map.refAssemblyManagerVM.ReserchPartDoor("DO_1")) Then
|
||||
'GetArrayPartDoor(0).Door.SwingTypeList = m_SwingTypeListLeftDoor
|
||||
Local_PartDoor.Door.SwingTypeList = m_SwingTypeListRightDoor
|
||||
Map.refAssemblyManagerVM.ReserchPartDoor("DO_1").Door.SwingTypeList = m_SwingTypeListLeftDoor
|
||||
Else
|
||||
Local_PartDoor.Door.SwingTypeList = m_SwingTypeListSinlgeDoor
|
||||
End If
|
||||
Local_PartDoor.SetIsChecked(Local_Door.IsActive)
|
||||
ListPartDoor.Add(Local_PartDoor)
|
||||
'SetArrayPartDoor(Local_PartDoor, 1)
|
||||
|
||||
Case ConstGen.PART_DO_ & "3"
|
||||
Local_PartDoor.Door = Local_Door
|
||||
Local_PartDoor.SetIsChecked(Local_Door.IsActive)
|
||||
@@ -1325,23 +1336,208 @@ Public Class Assembly
|
||||
End Select
|
||||
End While
|
||||
|
||||
If ListPartDoorOfDoor.Count < 1 Then
|
||||
Map.refSceneManagerVM.RefreshBtn()
|
||||
EgtZoom(ZM.ALL)
|
||||
sErrorInfo = "The current ddf does not contain a door!"
|
||||
' controllo che gli oggetti che sono stati caricati
|
||||
If Not ControlAssemblyInformation() Then
|
||||
Return -1
|
||||
Else
|
||||
If Not String.IsNullOrEmpty(sErrorInfo) Then
|
||||
Part.FirstReadingEdge = True
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = False
|
||||
End If
|
||||
' scrivo in locale un a copia dei riferiemti ai part
|
||||
SetPartDoorCurrAssembly()
|
||||
If Not OptionModule.m_ConfigurationSoftware = ConfigType.Door Then
|
||||
If Not ControlListDoor() Then
|
||||
Return -1
|
||||
End If
|
||||
If Not ControlSwing() Then
|
||||
Return -1
|
||||
End If
|
||||
End If
|
||||
BuiltReffCompo = True
|
||||
SetPartDoorCurrAssembly()
|
||||
Map.refAssemblyManagerVM.CreateAssociation(Me)
|
||||
MatchCompo()
|
||||
Return 1
|
||||
End Function
|
||||
|
||||
' verifico che la dicitaura delle porte sia coerente
|
||||
Private Function ControlListDoor() As Boolean
|
||||
Dim WritingError As String = String.Empty
|
||||
Select Case ListPartDoorOfDoor.Count
|
||||
Case 1
|
||||
' se ho una porta soltanto deve essere la prima
|
||||
If IsNothing(m_Door1) Then
|
||||
WritingError = EgtMsg(50506)
|
||||
MessageBox.Show(WritingError, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return False
|
||||
Else
|
||||
Return True
|
||||
End If
|
||||
Case 2
|
||||
If ListPartDoorOfDoor.Count < 2 Then Return False
|
||||
If IsNothing(m_Door1) OrElse IsNothing(m_Door2) Then
|
||||
' 50513=Impossible to find the first door (DO_1) or the second door (DO_2)!
|
||||
WritingError = EgtMsg(50513)
|
||||
MessageBox.Show(WritingError, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return False
|
||||
End If
|
||||
If Not ListPartDoorOfDoor(0).Door.TypePart = "DO_1" Then
|
||||
' 50515=The first door is not realy the first, check the ddf.
|
||||
WritingError = EgtMsg(50515)
|
||||
MessageBox.Show(WritingError, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return False
|
||||
End If
|
||||
Return True
|
||||
End Select
|
||||
Return False
|
||||
End Function
|
||||
|
||||
' controllo che gli swing siano coerenti:
|
||||
Private Function ControlSwing() As Boolean
|
||||
Dim ErrorSwingMessages As String = String.Empty
|
||||
Select Case ListPartDoorOfDoor.Count
|
||||
Case 1
|
||||
Dim Local_Door1 As Part = ListPartDoorOfDoor(0).Door
|
||||
Dim Local_Swing As String = Local_Door1.Swing
|
||||
Local_Door1.SwingTypeList = OptionModule.m_SwingTypeListSinlgeDoor
|
||||
If String.IsNullOrEmpty(Local_Swing) Then Return False
|
||||
Dim Index As Integer = Local_Door1.SwingTypeList.FindIndex(Function(sValue) Trim(sValue) = Trim(Local_Swing))
|
||||
' se Index = -1 significa che non è stata trovata nessuna corrispondenza
|
||||
If Index < 0 Then
|
||||
' 50507=The swing is not a member of the swing list of single door.
|
||||
ErrorSwingMessages = EgtMsg(50507)
|
||||
MessageBox.Show(ErrorSwingMessages, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return False
|
||||
End If
|
||||
Local_Door1.Swing = Local_Door1.SwingTypeList(Index)
|
||||
Return True
|
||||
Case 2
|
||||
Dim Index_1 As Integer = -1
|
||||
Dim Index_2 As Integer = -1
|
||||
If Not IsNothing(m_Door1) Then
|
||||
Index_1 = OptionModule.m_SwingTypeListLeftDoor.FindIndex(Function(sValue) Trim(sValue) = Trim(m_Door1.Swing))
|
||||
End If
|
||||
If Not IsNothing(m_Door2) Then
|
||||
Index_2 = OptionModule.m_SwingTypeListRightDoor.FindIndex(Function(sValue) Trim(sValue) = Trim(m_Door2.Swing))
|
||||
End If
|
||||
' Se uno swing è corretto e l'altro è sbagliato
|
||||
If (Index_1 < 0 AndAlso Index_2 > -1) Then
|
||||
' 50508=The swing of left door is not a member of the swing list of left door.
|
||||
ErrorSwingMessages = EgtMsg(50508)
|
||||
MessageBox.Show(ErrorSwingMessages, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return False
|
||||
ElseIf (Index_1 > -1 AndAlso Index_2 < 0) Then
|
||||
' 50509=The swing of right door is not a member of the swing list of right door.
|
||||
ErrorSwingMessages = EgtMsg(50509)
|
||||
MessageBox.Show(ErrorSwingMessages, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return False
|
||||
End If
|
||||
' se sono entrambi sbagliati provo a verificare che non siano invertite le ante
|
||||
If Index_1 < 0 OrElse Index_2 < 0 Then
|
||||
If Not IsNothing(m_Door2) Then
|
||||
Index_1 = OptionModule.m_SwingTypeListLeftDoor.FindIndex(Function(sValue) Trim(sValue) = Trim(m_Door2.Swing))
|
||||
End If
|
||||
If Not IsNothing(m_Door1) Then
|
||||
Index_2 = OptionModule.m_SwingTypeListRightDoor.FindIndex(Function(sValue) Trim(sValue) = Trim(m_Door1.Swing))
|
||||
End If
|
||||
' verifico i risultati ottenuti
|
||||
If (Index_1 > -1 AndAlso Index_2 > -1) Then
|
||||
' 50510=The swing of left door is on the right door and viceverse.
|
||||
ErrorSwingMessages = EgtMsg(50510)
|
||||
MessageBox.Show(ErrorSwingMessages, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return False
|
||||
ElseIf (Index_1 < 0 AndAlso Index_2 > -1) Then
|
||||
' 50511=The swing of left door is not a member of the swing list of left door.
|
||||
ErrorSwingMessages = EgtMsg(50511)
|
||||
MessageBox.Show(ErrorSwingMessages, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return False
|
||||
ElseIf (Index_1 > -1 AndAlso Index_2 < 0) Then
|
||||
' 50512=The swing of right door is not a member of the swing list of right door.
|
||||
ErrorSwingMessages = EgtMsg(50512)
|
||||
MessageBox.Show(ErrorSwingMessages, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return False
|
||||
Else
|
||||
' 50514=The swing are absolutly wrong!
|
||||
ErrorSwingMessages = EgtMsg(50514)
|
||||
MessageBox.Show(ErrorSwingMessages, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return False
|
||||
End If
|
||||
End If
|
||||
Return True
|
||||
End Select
|
||||
Return False
|
||||
End Function
|
||||
|
||||
' controllo degli oggetti caricati nell'assemblato
|
||||
Private Function ControlAssemblyInformation() As Boolean
|
||||
Dim ErrorMessages As String = String.Empty
|
||||
Select Case bOk
|
||||
Case ResultReadingAssembInfo.CorrectAssembInfo
|
||||
If OptionModule.m_ConfigurationSoftware = ConfigType.Door Then
|
||||
' 50520=The current ddf is an assembly
|
||||
ErrorMessages = EgtMsg(50520)
|
||||
MessageBox.Show(ErrorMessages, EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning)
|
||||
Return True
|
||||
End If
|
||||
' verifico se è un assemblato
|
||||
If ListPartDoor.Count < 4 And ListPartDoorOfDoor.Count > 0 Then
|
||||
' 50516=The ddf does not contains jambs!
|
||||
ErrorMessages = EgtMsg(50516)
|
||||
Dim sVal As String = Utility.DoubleToString(ListPartDoor.Count, 0)
|
||||
MessageBox.Show(String.Format(ErrorMessages, sVal), EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning)
|
||||
Return True
|
||||
End If
|
||||
If ListPartDoor.Count < 4 And ListPartDoorOfDoor.Count = 0 Then
|
||||
' 50517=The current ddf does not contains doors!
|
||||
ErrorMessages = EgtMsg(50517)
|
||||
MessageBox.Show(ErrorMessages, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return False
|
||||
End If
|
||||
Case ResultReadingAssembInfo.MissingAssembInfo
|
||||
' verifico se è un assemblato
|
||||
If ListPartDoor.Count < 4 And ListPartDoorOfDoor.Count > 0 Then
|
||||
If OptionModule.m_ConfigurationSoftware = ConfigType.Door Then Return True
|
||||
' 50518=The current ddf is not an assembly.
|
||||
ErrorMessages = EgtMsg(50518)
|
||||
MessageBox.Show(ErrorMessages, EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning)
|
||||
Return True
|
||||
End If
|
||||
' verifico che se è una porta singola oppure un assemblato vecchio
|
||||
If ListPartDoor.Count < 4 And ListPartDoorOfDoor.Count = 0 Then
|
||||
' 50519=Impossible to open a ddf with no doors.
|
||||
ErrorMessages = EgtMsg(50519)
|
||||
MessageBox.Show(ErrorMessages, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return False
|
||||
End If
|
||||
If OptionModule.m_ConfigurationSoftware = ConfigType.Door AndAlso ListPartDoor.Count > 4 Then
|
||||
' 50520=The current ddf is an assembly
|
||||
ErrorMessages = EgtMsg(50520)
|
||||
MessageBox.Show(ErrorMessages, EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning)
|
||||
Return True
|
||||
End If
|
||||
Case Else
|
||||
Return False
|
||||
End Select
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function ControlAssembly(Optional ByVal bSaving As Boolean = False) As String
|
||||
' se è una porta singola oppure le info generali non sono state caricate correttamente non controllo l'assemblato
|
||||
If bSaving Then
|
||||
If bOk <> ResultReadingAssembInfo.MissingAssembInfo Then Return String.Empty
|
||||
Else
|
||||
If bOk = ResultReadingAssembInfo.ErrorInAssembInfo OrElse bOk = ResultReadingAssembInfo.MissingAssembInfo Then Return String.Empty
|
||||
End If
|
||||
Dim WritingError As String = String.Empty
|
||||
Dim DoorTypeList As String = String.Empty
|
||||
If ListPartDoor.Count < 3 Then
|
||||
For Each ItemPart In ListPartDoor
|
||||
DoorTypeList &= " ," & ItemPart.Door.TypePart
|
||||
Next
|
||||
DoorTypeList = DoorTypeList.Remove(1, 1)
|
||||
WritingError = String.Format(EgtMsg(50505), DoorTypeList)
|
||||
End If
|
||||
Return WritingError
|
||||
End Function
|
||||
|
||||
#Region "Associazione delle compo lette da ddf"
|
||||
|
||||
Public Sub MatchCompo()
|
||||
@@ -1654,8 +1850,18 @@ Public Class Assembly
|
||||
m_Door2 = ListPartDoor(IndexPartDoor).Door
|
||||
End If
|
||||
Next
|
||||
NotifyPropertyChanged("JambExists")
|
||||
End Sub
|
||||
|
||||
Public ReadOnly Property JambExists As Boolean
|
||||
Get
|
||||
If Not IsNothing(m_JambL) AndAlso Not IsNothing(m_JambR) AndAlso Not IsNothing(m_JambT) Then
|
||||
Return True
|
||||
End If
|
||||
Return False
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' gestisce la chimata delle funzioni a seconda della modifica eseguita
|
||||
#Region "DIMENSIONING"
|
||||
|
||||
@@ -1743,6 +1949,23 @@ Public Class Assembly
|
||||
|
||||
#Region "UpDateRefCompo"
|
||||
|
||||
Public Sub CreateAssembly()
|
||||
If ListPartDoorOfDoor.Count < 1 Then Return
|
||||
'If Not JambExists Then SetDimension("JambIsCheked")
|
||||
Select Case ListPartDoorOfDoor.Count
|
||||
Case 1
|
||||
Dim IndexCompo As Integer = 0
|
||||
Dim EndIndex As Integer = m_Door1.CompoList.Count
|
||||
For IndexCompo = 0 To EndIndex - 1
|
||||
CreateCompoOnJamb(m_Door1.CompoList(IndexCompo))
|
||||
Next
|
||||
Case 2
|
||||
|
||||
Case Else
|
||||
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
' è chiamata ogni volta che viene modificato un parametro del general dell'assemblato
|
||||
Public Sub UpDateAllCompo()
|
||||
Dim IdexDoorNumber As Integer = 0
|
||||
@@ -2212,9 +2435,9 @@ Public Class Assembly
|
||||
|
||||
If Exterior Then
|
||||
' se di tipo LeftHand
|
||||
If m_JambL.SwingAlias.Name.Contains("LH") Then
|
||||
If Not IsNothing(m_JambL) Then m_JambL.TypePart = ConstGen.PART_FRAME_LEFT & ConstGen.HINGE & ConstGen.EXTERIOR
|
||||
If Not IsNothing(m_JambR) Then m_JambR.TypePart = ConstGen.PART_FRAME_RIGHT & ConstGen.LOCK & ConstGen.EXTERIOR
|
||||
If Not IsNothing(m_JambL) AndAlso Not IsNothing(m_JambR) AndAlso m_JambL.SwingAlias.Name.Contains("LH") Then
|
||||
m_JambL.TypePart = ConstGen.PART_FRAME_LEFT & ConstGen.HINGE & ConstGen.EXTERIOR
|
||||
m_JambR.TypePart = ConstGen.PART_FRAME_RIGHT & ConstGen.LOCK & ConstGen.EXTERIOR
|
||||
Else
|
||||
If Not IsNothing(m_JambL) Then m_JambL.TypePart = ConstGen.PART_FRAME_LEFT & ConstGen.LOCK & ConstGen.EXTERIOR
|
||||
If Not IsNothing(m_JambR) Then m_JambR.TypePart = ConstGen.PART_FRAME_RIGHT & ConstGen.HINGE & ConstGen.EXTERIOR
|
||||
@@ -2222,9 +2445,9 @@ Public Class Assembly
|
||||
If Not IsNothing(m_JambB) Then m_JambB.TypePart = ConstGen.PART_FRAME_BOTTOM & ConstGen.BOTTOM & ConstGen.EXTERIOR
|
||||
If Not IsNothing(m_JambT) Then m_JambT.TypePart = ConstGen.PART_FRAME_TOP & ConstGen.TOP & ConstGen.EXTERIOR
|
||||
Else
|
||||
If m_JambL.SwingAlias.Name.Contains("LH") Then
|
||||
If Not IsNothing(m_JambL) Then m_JambL.TypePart = ConstGen.PART_FRAME_LEFT & ConstGen.HINGE
|
||||
If Not IsNothing(m_JambR) Then m_JambR.TypePart = ConstGen.PART_FRAME_RIGHT & ConstGen.LOCK
|
||||
If Not IsNothing(m_JambL) AndAlso Not IsNothing(m_JambR) AndAlso m_JambL.SwingAlias.Name.Contains("LH") Then
|
||||
m_JambL.TypePart = ConstGen.PART_FRAME_LEFT & ConstGen.HINGE
|
||||
m_JambR.TypePart = ConstGen.PART_FRAME_RIGHT & ConstGen.LOCK
|
||||
Else
|
||||
If Not IsNothing(m_JambL) Then m_JambL.TypePart = ConstGen.PART_FRAME_LEFT & ConstGen.LOCK
|
||||
If Not IsNothing(m_JambR) Then m_JambR.TypePart = ConstGen.PART_FRAME_RIGHT & ConstGen.HINGE
|
||||
@@ -2309,7 +2532,7 @@ Public Class Assembly
|
||||
Next
|
||||
End Sub
|
||||
|
||||
' iverte la prima anta con la seconda anta
|
||||
' inverte la prima anta con la seconda anta
|
||||
Public Sub ReverseDoor()
|
||||
If IsNothing(m_Door1) OrElse IsNothing(m_Door2) Then Return
|
||||
If Not m_Door1.SwingAlias.Name.Contains("I") Then Return
|
||||
|
||||
@@ -34,7 +34,8 @@
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--Jamb-->
|
||||
<GroupBox Header="{Binding JambPageMsg}" Margin="2,0,2,0" Grid.ColumnSpan="2">
|
||||
<GroupBox Header="{Binding JambPageMsg}" Margin="2,0,2,0" Grid.ColumnSpan="2"
|
||||
IsEnabled="{Binding CurrAssembly.JambExists}">
|
||||
<Grid Margin="0,0,0,2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
@@ -140,7 +141,8 @@
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<!--JAmb Definition Machining and Bevel-->
|
||||
<GroupBox Header="{Binding JambPageMsg}" Grid.Row="0" Grid.Column="2" Grid.ColumnSpan="4" Margin="2,0,2,0">
|
||||
<GroupBox Header="{Binding JambPageMsg}" Grid.Row="0" Grid.Column="2" Grid.ColumnSpan="4"
|
||||
Margin="2,0,2,0" IsEnabled="{Binding CurrAssembly.JambExists}">
|
||||
|
||||
<Grid Margin="0,0,0,2" >
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -249,7 +251,8 @@
|
||||
</GroupBox>
|
||||
|
||||
<!--Exterior-->
|
||||
<GroupBox Grid.Row="1" Grid.ColumnSpan="2" Margin="2,0,2,0">
|
||||
<GroupBox Grid.Row="1" Grid.ColumnSpan="2" Margin="2,0,2,0"
|
||||
IsEnabled="{Binding CurrAssembly.JambExists}">
|
||||
<GroupBox.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<CheckBox Grid.Row="0" Grid.Column="5"
|
||||
@@ -281,7 +284,8 @@
|
||||
</GroupBox>
|
||||
|
||||
<!--TotalDimension-->
|
||||
<GroupBox Grid.Row="2" Grid.ColumnSpan="6" Margin="2,0,2,0">
|
||||
<GroupBox Grid.Row="2" Grid.ColumnSpan="6" Margin="2,0,2,0"
|
||||
IsEnabled="{Binding CurrAssembly.JambExists}">
|
||||
<GroupBox.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<CheckBox Grid.Row="0" Grid.Column="5"
|
||||
@@ -334,7 +338,8 @@
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Text="{Binding CurrAssembly.DeltaThickness, UpdateSourceTrigger=PropertyChanged}"
|
||||
Padding="3"
|
||||
Margin="4" VerticalAlignment="Stretch"/>
|
||||
Margin="4" VerticalAlignment="Stretch"
|
||||
IsEnabled="{Binding CurrAssembly.JambExists}"/>
|
||||
<Button Grid.Column="4" Grid.ColumnSpan="2" Grid.Row="1"
|
||||
Padding="3"
|
||||
Margin="12" VerticalAlignment="Stretch"
|
||||
|
||||
@@ -222,6 +222,7 @@ Public Class AssemblyPageVM
|
||||
LoadSelectedPartDoor(SelectPart, Visibility.Visible, False)
|
||||
End Select
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nDDFPage
|
||||
Map.refProjectManagerVM.NotifyPropertyChanged("VisibilityCreateAssembly")
|
||||
End Sub
|
||||
|
||||
#End Region ' PartBtn
|
||||
|
||||
@@ -100,13 +100,13 @@ Public Class AssemblyManagerVM
|
||||
' verifico se il ddf presenta degli errori, se ignoro gli errori salvo
|
||||
bConfirmSavin = ConfirmSaving(DdfFile.ErrorInWriting)
|
||||
If Not bConfirmSavin Then Return False
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = False
|
||||
'Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = False
|
||||
TrimFileName(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name)
|
||||
' Salvo
|
||||
If OptionModule.m_ConfigurationSoftware = ConfigType.Door Then
|
||||
' questa condizione non DOVREBBE mai accadere, perchè viene interrotto prima il caricamento
|
||||
If SavedAssName.SelAssembly.ListPartDoorOfDoor.Count < 1 Then
|
||||
If MessageBox.Show("The current ddf is a part of a frame, do you want to save?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.No) = MessageBoxResult.Yes Then
|
||||
If MessageBox.Show("The current ddf is a part of a frame, do you want to save?", EgtMsg(50144), MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.No) = MessageBoxResult.Yes Then
|
||||
DdfFile.SaveErrorCompo = True
|
||||
DdfFile.WriteDDFPart(SavedAssName.SelAssembly.ListPartDoor(0).Door, SavedAssName.Name, True, False)
|
||||
DdfFile.SaveErrorCompo = False
|
||||
@@ -119,6 +119,18 @@ Public Class AssemblyManagerVM
|
||||
DdfFile.SaveErrorCompo = False
|
||||
End If
|
||||
Else
|
||||
' se il ddf che sto leggendo è composto dal al massimo due parti significa che c'è un errore
|
||||
If SavedAssName.SelAssembly.bOk = Assembly.ResultReadingAssembInfo.CorrectAssembInfo AndAlso
|
||||
SavedAssName.SelAssembly.ListPartDoor.Count < 3 Then
|
||||
' se sto salvando meno di tre componenti significa che mancano qualche pezzo per essere un assemblato
|
||||
SavedAssName.SelAssembly.bOk = Assembly.ResultReadingAssembInfo.MissingAssembInfo
|
||||
End If
|
||||
Dim ErrorMessage As String = SavedAssName.SelAssembly.ControlAssembly(True)
|
||||
If Not String.IsNullOrEmpty(ErrorMessage) Then
|
||||
If Not MessageBox.Show(ErrorMessage, EgtMsg(50144), MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.No) = MessageBoxResult.Yes Then
|
||||
Return False
|
||||
End If
|
||||
End If
|
||||
DdfFile.SaveErrorCompo = True
|
||||
DdfFile.WriteDDFAssembly(SavedAssName.SelAssembly, SavedAssName.Name, True)
|
||||
DdfFile.SaveErrorCompo = False
|
||||
|
||||
@@ -167,7 +167,7 @@ Public Class CompoPanelVM
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nDDFPage
|
||||
Map.refSceneManagerVM.RefreshBtn()
|
||||
End If
|
||||
|
||||
Map.refProjectManagerVM.NotifyPropertyChanged("VisibilityCreateAssembly")
|
||||
End Sub
|
||||
|
||||
#End Region ' GoToAssemblyBtnCommand
|
||||
|
||||
+12
-4
@@ -2187,10 +2187,19 @@ Public Class Part
|
||||
CurrCompoParam.MissingParameterInReading = True
|
||||
Else
|
||||
' significa che la TextBoxOnOff è stata disattivata
|
||||
If TypeOf CurrCompoParam Is TextBoxOnOffParam Then DirectCast(CurrCompoParam, TextBoxOnOffParam).SetIsActive(False)
|
||||
If TypeOf CurrCompoParam Is ComboBoxOnOffParam Then DirectCast(CurrCompoParam, ComboBoxOnOffParam).SetIsActive(False)
|
||||
If TypeOf CurrCompoParam Is TextBoxOnOffParam Then
|
||||
DirectCast(CurrCompoParam, TextBoxOnOffParam).SetIsActive(False)
|
||||
IndexParam += 1
|
||||
Continue While
|
||||
End If
|
||||
If TypeOf CurrCompoParam Is ComboBoxOnOffParam Then
|
||||
DirectCast(CurrCompoParam, ComboBoxOnOffParam).SetIsActive(False)
|
||||
IndexParam += 1
|
||||
Continue While
|
||||
End If
|
||||
End If
|
||||
Exit While
|
||||
' Exit While
|
||||
' Continue While
|
||||
End If
|
||||
' Se è di tipo obbligatorio (non è OnOff)
|
||||
If Not (TypeOf CurrCompoParam Is TextBoxOnOffParam OrElse TypeOf CurrCompoParam Is ComboBoxOnOffParam) Then
|
||||
@@ -2502,7 +2511,6 @@ Public Class Part
|
||||
Me.TypePart = ConstGen.PART_DO_ & "1"
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region ' Costruttore
|
||||
|
||||
Public Function ShallowCopy() As Part
|
||||
|
||||
@@ -562,6 +562,9 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\Refresh\RefreshDir.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\TopCommandBar\Create Assembly.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtDOORCreator\EgtDOORCreatorR32.exe
|
||||
|
||||
@@ -59,7 +59,7 @@ Imports System.Windows
|
||||
|
||||
|
||||
'The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
<Assembly: Guid("46e08d62-e763-405a-92ee-4a4cba211843")>
|
||||
<Assembly: Guid("46e08d62-e763-405a-92ee-4a4cba211843")>
|
||||
|
||||
' Version information for an assembly consists of the following four values:
|
||||
'
|
||||
@@ -72,5 +72,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.9.12.3")>
|
||||
<Assembly: AssemblyFileVersion("1.9.12.3")>
|
||||
<Assembly: AssemblyVersion("2.1.2.1")>
|
||||
<Assembly: AssemblyFileVersion("2.1.2.1")>
|
||||
|
||||
@@ -71,16 +71,22 @@
|
||||
<Image Source="/Resources/InstrumentPanel/Hardware.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
<Button Command="{Binding CreateAssemblyCommand}" ToolTip="{Binding CreateAssemblyToolTip}" Focusable="False"
|
||||
Visibility="{Binding VisibilityCreateAssembly}">
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/TopCommandBar/Create Assembly.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
<Button Command="{Binding OptionsCommand}" ToolTip="{Binding OptionsToolTip}" Focusable="False">
|
||||
<Image Source="/Resources/TopCommandBar/Options.png" Height="22" />
|
||||
</Button>
|
||||
<Button Command="{Binding SendFeedbackCommand}" ToolTip="{Binding SendFeedbackToolTip}" Focusable="False">
|
||||
<Image Source="/Resources/TopCommandBar/Send.png" Height="22" Margin="3,0,3,0" />
|
||||
</Button>
|
||||
<Button Command="{Binding GuideCommand}" ToolTip="{Binding GuideToolTip}" Focusable="False">
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/TopCommandBar/Help.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<Button Command="{Binding GuideCommand}" ToolTip="{Binding GuideToolTip}" Focusable="False">
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/TopCommandBar/Help.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
|
||||
@@ -72,6 +72,7 @@ Public Class ProjectManagerVM
|
||||
Private m_cmdDuplica As ICommand
|
||||
Private m_cmdHardware As ICommand
|
||||
Private m_cmdRefreshDir As ICommand
|
||||
Private m_cmdCreateAssembly As ICommand
|
||||
|
||||
#Region "ToolTip"
|
||||
|
||||
@@ -170,6 +171,14 @@ Public Class ProjectManagerVM
|
||||
Return EgtMsg(50413)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CreateAssemblyToolTip As String
|
||||
Get
|
||||
' Create Assembly
|
||||
Return EgtMsg(50420)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' ToolTip
|
||||
|
||||
#End Region ' Fields & Properties
|
||||
@@ -1117,6 +1126,45 @@ Public Class ProjectManagerVM
|
||||
|
||||
#End Region ' PrintCommand
|
||||
|
||||
#Region "CreateAssemblyCommand"
|
||||
|
||||
Private m_VisibilityCreateAssembly As Visibility = Visibility.Collapsed
|
||||
Public ReadOnly Property VisibilityCreateAssembly As Visibility
|
||||
Get
|
||||
If OptionModule.m_ConfigurationSoftware = ConfigType.Door Then Return Visibility.Collapsed
|
||||
If Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nDDFPage AndAlso
|
||||
Not IsNothing(Map.refAssemblyManagerVM) AndAlso
|
||||
Not IsNothing(Map.refAssemblyManagerVM.CurrProject) AndAlso
|
||||
Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso
|
||||
Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly) AndAlso
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.JambExists AndAlso
|
||||
Not IsNothing(Map.refPartPageVM) AndAlso Not IsNothing(Map.refPartPageVM.CurrPart) AndAlso
|
||||
Not IsNothing(Map.refPartPageVM.CurrPart.refPartDoor) AndAlso
|
||||
Not IsNothing(Map.refPartPageVM.CurrPart.refPartDoor.Door) AndAlso
|
||||
Map.refPartPageVM.CurrPart.refPartDoor.Door.TypePart.Contains("DO_") Then
|
||||
m_VisibilityCreateAssembly = Visibility.Visible
|
||||
Else
|
||||
m_VisibilityCreateAssembly = Visibility.Collapsed
|
||||
End If
|
||||
Return m_VisibilityCreateAssembly
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CreateAssemblyCommand As ICommand
|
||||
Get
|
||||
If m_cmdCreateAssembly Is Nothing Then
|
||||
m_cmdCreateAssembly = New Command(AddressOf CreateAssembly)
|
||||
End If
|
||||
Return m_cmdCreateAssembly
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub CreateAssembly()
|
||||
Map.refAssemblyPageVM.CurrAssembly.CreateAssembly()
|
||||
End Sub
|
||||
|
||||
#End Region ' CreateAssemblyCommand
|
||||
|
||||
#End Region ' Commands
|
||||
|
||||
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
|
||||
|
||||
Reference in New Issue
Block a user