EgtDOORCreator 2.2e1:

-> gestione delle quote nell'assemblato,
-> correzione caricamento parametri Off dei Jamb,
-> correzione gestione riposizionamento (side) delle componenti sui telai
This commit is contained in:
Nicola Pievani
2020-05-07 17:38:09 +00:00
parent 596ba07699
commit 20e5c383a9
9 changed files with 112 additions and 54 deletions
+44 -41
View File
@@ -1844,28 +1844,19 @@ Public Class Assembly
' definisco la proprietà ReadOnly per i parametri inseriti
If Not LoadCompoParam(Door.CompoList(IndexCompo), Door.TypePart) Then Return
For IndexParam As Integer = 0 To Door.CompoList(IndexCompo).refJambCompo.CompoParamList.Count - 1
Dim CmpPar As CompoParam = Door.CompoList(IndexCompo).CompoParamList(IndexParam)
Dim CmpRefPar As CompoParam = Door.CompoList(IndexCompo).refJambCompo.CompoParamList(IndexParam)
If TypeOf CmpRefPar Is TextBoxOnOffParam Then
Dim TBoxPar As TextBoxOnOffParam = DirectCast(CmpPar, TextBoxOnOffParam)
Dim TBoxRefPar As TextBoxOnOffParam = DirectCast(CmpRefPar, TextBoxOnOffParam)
CalcCompoParamVisibility(TBoxPar.DDFName, TBoxRefPar.IsReadOnly)
TBoxPar.IsReadOnly = True
CalcCompoParamVisibility(TBoxRefPar.DDFName, TBoxRefPar.IsReadOnly)
ElseIf TypeOf CmpRefPar Is TextBoxParam Then
Dim TBoxPar As TextBoxParam = DirectCast(CmpPar, TextBoxParam)
Dim TBoxRefPar As TextBoxParam = DirectCast(CmpRefPar, TextBoxParam)
CalcCompoParamVisibility(TBoxPar.DDFName, TBoxRefPar.IsReadOnly)
TBoxPar.IsReadOnly = True
CalcCompoParamVisibility(TBoxRefPar.DDFName, TBoxRefPar.IsReadOnly)
ElseIf TypeOf CmpRefPar Is ComboBoxOnOffParam Then
Dim TBoxPar As ComboBoxOnOffParam = DirectCast(CmpPar, ComboBoxOnOffParam)
Dim TBoxRefPar As ComboBoxOnOffParam = DirectCast(CmpRefPar, ComboBoxOnOffParam)
CalcCompoParamVisibility(TBoxPar.DDFName, TBoxRefPar.IsReadOnly)
TBoxPar.IsReadOnly = True
CalcCompoParamVisibility(TBoxRefPar.DDFName, TBoxRefPar.IsReadOnly)
ElseIf TypeOf CmpRefPar Is ComboBoxParam Then
Dim TBoxPar As ComboBoxParam = DirectCast(CmpPar, ComboBoxParam)
Dim TBoxRefPar As ComboBoxParam = DirectCast(CmpRefPar, ComboBoxParam)
CalcCompoParamVisibility(TBoxPar.DDFName, TBoxRefPar.IsReadOnly)
TBoxPar.IsReadOnly = True
CalcCompoParamVisibility(TBoxRefPar.DDFName, TBoxRefPar.IsReadOnly)
End If
Next
ResetCompoParam()
@@ -1891,28 +1882,32 @@ Public Class Assembly
DoorActive.CompoList(IndexCompo).IsReadOnly = True
If Not LoadCompoParam(DoorActive.CompoList(IndexCompo), DoorActive.TypePart) Then Return
For IndexParam As Integer = 0 To DoorActive.CompoList(IndexCompo).refJambCompo.CompoParamList.Count - 1
Dim CmpPar As CompoParam = DoorActive.CompoList(IndexCompo).CompoParamList(IndexParam)
'Dim CmpPar As CompoParam = DoorActive.CompoList(IndexCompo).CompoParamList(IndexParam)
Dim CmpRefPar As CompoParam = DoorActive.CompoList(IndexCompo).refJambCompo.CompoParamList(IndexParam)
If TypeOf CmpRefPar Is TextBoxOnOffParam Then
Dim TBoxPar As TextBoxOnOffParam = DirectCast(CmpPar, TextBoxOnOffParam)
'Dim TBoxPar As TextBoxOnOffParam = DirectCast(CmpPar, TextBoxOnOffParam)
Dim TBoxRefPar As TextBoxOnOffParam = DirectCast(CmpRefPar, TextBoxOnOffParam)
CalcCompoParamVisibility(TBoxPar.DDFName, TBoxRefPar.IsReadOnly)
TBoxPar.IsReadOnly = True
'CalcCompoParamVisibility(TBoxPar.DDFName, TBoxRefPar.IsReadOnly)
'TBoxPar.IsReadOnly = True
CalcCompoParamVisibility(TBoxRefPar.DDFName, TBoxRefPar.IsReadOnly)
ElseIf TypeOf CmpRefPar Is TextBoxParam Then
Dim TBoxPar As TextBoxParam = DirectCast(CmpPar, TextBoxParam)
'Dim TBoxPar As TextBoxParam = DirectCast(CmpPar, TextBoxParam)
Dim TBoxRefPar As TextBoxParam = DirectCast(CmpRefPar, TextBoxParam)
CalcCompoParamVisibility(TBoxPar.DDFName, TBoxRefPar.IsReadOnly)
TBoxPar.IsReadOnly = True
'CalcCompoParamVisibility(TBoxPar.DDFName, TBoxRefPar.IsReadOnly)
'TBoxPar.IsReadOnly = True
CalcCompoParamVisibility(TBoxRefPar.DDFName, TBoxRefPar.IsReadOnly)
ElseIf TypeOf CmpRefPar Is ComboBoxOnOffParam Then
Dim TBoxPar As ComboBoxOnOffParam = DirectCast(CmpPar, ComboBoxOnOffParam)
'Dim TBoxPar As ComboBoxOnOffParam = DirectCast(CmpPar, ComboBoxOnOffParam)
Dim TBoxRefPar As ComboBoxOnOffParam = DirectCast(CmpRefPar, ComboBoxOnOffParam)
CalcCompoParamVisibility(TBoxPar.DDFName, TBoxRefPar.IsReadOnly)
TBoxPar.IsReadOnly = True
'CalcCompoParamVisibility(TBoxPar.DDFName, TBoxRefPar.IsReadOnly)
'TBoxPar.IsReadOnly = True
CalcCompoParamVisibility(TBoxRefPar.DDFName, TBoxRefPar.IsReadOnly)
ElseIf TypeOf CmpRefPar Is ComboBoxParam Then
Dim TBoxPar As ComboBoxParam = DirectCast(CmpPar, ComboBoxParam)
'Dim TBoxPar As ComboBoxParam = DirectCast(CmpPar, ComboBoxParam)
Dim TBoxRefPar As ComboBoxParam = DirectCast(CmpRefPar, ComboBoxParam)
CalcCompoParamVisibility(TBoxPar.DDFName, TBoxRefPar.IsReadOnly)
TBoxPar.IsReadOnly = True
'CalcCompoParamVisibility(TBoxPar.DDFName, TBoxRefPar.IsReadOnly)
'TBoxPar.IsReadOnly = True
CalcCompoParamVisibility(TBoxRefPar.DDFName, TBoxRefPar.IsReadOnly)
End If
Next
ResetCompoParam()
@@ -1941,21 +1936,22 @@ Public Class Assembly
Public Function CreateCompoOnJamb(ByRef CurrCompo As Compo, Optional sSide As String = "") As Boolean
' se è la configurazione è di songola porta allora interrompi la costruzione
If OptionModule.m_ConfigurationSoftware = ConfigType.Door Then Return False
' nome del file da caricare da tabella Matchting.ini
' nome del file Matchting.ini
Dim FrameFile As String = String.Empty
' percorso del file di configurazione del file caricato da tabella (da costruire)
' percorso del file di Config.ini del file frame
Dim FrameFileConfig As String = String.Empty
' numero di ante presenti nel progetto corrente
Dim nDoorNbr As Integer = 1
' cerco nella configurazione della componente sulla porta il parametro Side
Dim Side As String = String.Empty
If Not String.IsNullOrEmpty(sSide) Then Side = sSide
' se non è stato passato nessun termine che specfica il lato allora lo cerco nella configurazione
If String.IsNullOrEmpty(Side) Then GetPrivateProfileJambSide(S_POSITIONSIDE, K_SIDE, Side, CurrCompo.CompoType.Path & "\" & CONFIGINI_FILE_NAME)
' cerco nel file Config.ini il campo [PositionSide]
If String.IsNullOrEmpty(Side) Then
GetPrivateProfileJambSide(S_POSITIONSIDE, K_SIDE, Side, CurrCompo.CompoType.Path & "\" & CONFIGINI_FILE_NAME)
End If
' controllo nell'elenco dei parametri se esiste un parametro di tipo Side
If String.IsNullOrEmpty(Side) Then
' controllo nell'elenco dei parametri se esiste un parametro di tipo Side
For IndexParam As Integer = 0 To CurrCompo.CompoParamList.Count - 1
If CurrCompo.CompoParamList(IndexParam).DDFName.ToLower = K_SIDE.ToLower Then
Side = DirectCast(CurrCompo.CompoParamList(IndexParam), ComboBoxParam).SelItem
@@ -1963,6 +1959,7 @@ Public Class Assembly
End If
Next
End If
' a questo punto ricerco nella lista delle associazioni se esite il frame sul quale costruire il riferimento
' converto la posizione letta in valore numerico
' queste associazioni funzionano sulle ante, per i Jamb non ho studiato una conversione
@@ -1988,9 +1985,8 @@ Public Class Assembly
nSide = 400
End Select
' ricerco il PartDoor Corrente
' ricerco il PartDoor associato al side
Dim refPartDoor As PartDoor = Nothing
' ricerco il PartDoor Corrente
For Each ItemPartDoor In ListPartDoor
If ItemPartDoor.Type = Map.refPartPageVM.CurrPart.TypePart Then
For Each ItemAssociation In ItemPartDoor.ListAssociation
@@ -2005,15 +2001,15 @@ Public Class Assembly
' se non è stata trovata nessuna associazione esco
If IsNothing(refPartDoor) Then Return False
' verifico che il nome non sia scritto direttamente nel file lua
' cerco il nome della componente da associare FrameFile
Dim CurrDoorHArdwareFile As String = CurrCompo.CompoType.Path & "\" & CurrCompo.TemplateSelItem
If Path.GetExtension(CurrDoorHArdwareFile) <> NGE_EXTENSION Then
CurrDoorHArdwareFile &= LUA_EXTENSION
End If
' cerco il campo [Match file] nel file lua della componente
If File.Exists(CurrDoorHArdwareFile) Then
Dim ReadCurrCompo() As String = File.ReadAllLines(CurrDoorHArdwareFile)
For LineIndex = 0 To ReadCurrCompo.Count - 1
' cerco il titolo [Match File]: se lo trovo
If RegexFunction.IsMatchingParameterTitle(ReadCurrCompo(LineIndex)) Then
' mi preparo per leggere la prima riga dopo il titolo
Dim ParamIndex As Integer = 1
@@ -2022,7 +2018,6 @@ Public Class Assembly
ParamIndex += 1
FrameFile = Trim(RegexFunction.ParamLine(ReadCurrCompo(LineIndex + ParamIndex), K_MATCHING_FILE))
End While
' quando termino il ciclo while posso uscire anche dal for
Exit For
End If
Next
@@ -2071,7 +2066,8 @@ Public Class Assembly
GetPrivateProfileJambSide(S_POSITIONSIDE, K_SIDE, FrameSide, FrameFileConfig)
GetPrivateProfileFolderName(S_TEMPLATE, K_FOLDER_NAME, FrameFolderName, FrameFileConfig)
' se non esiste una componente di riferiento, allora deve essere creata per la prima volta
'Ogni volta che creo una componente elimino i precedenti riferimenti
If Not IsNothing(CurrCompo.refJambCompo) Then Map.refPartPageVM.CurrPart.RemoveCompo(CurrCompo, True)
If IsNothing(CurrCompo.refJambCompo) Then
' costruisco sul riferiento la nuova componente inserita
Dim refCompoType As New CompoType(FrameName, FrameNameDDF, Path.GetDirectoryName(FrameFileConfig), FrameSide, FrameFolderName)
@@ -2403,10 +2399,17 @@ Public Class Assembly
StringToDouble(ThicknessBottom, dThicknessBottm)
StringToDouble(OverlapBottom, dOverlapBottom)
If IsNothing(Map.refPartPageVM.CurrPart) OrElse Not Map.refPartPageVM.CurrPart.TypePart.Contains("DO_") Then
StringToDouble(m_Door1.Height, dHeight)
Else
'If IsNothing(Map.refPartPageVM.CurrPart) OrElse Not Map.refPartPageVM.CurrPart.TypePart.Contains("DO_") Then
' StringToDouble(m_Door1.Height, dHeight)
'Else
' StringToDouble(Map.refPartPageVM.CurrPart.Height, dHeight)
'End If
If Not IsNothing(Map.refPartPageVM.CurrPart) AndAlso Map.refPartPageVM.CurrPart.TypePart.Contains("DO_") AndAlso
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nDDFPage Then
StringToDouble(Map.refPartPageVM.CurrPart.Height, dHeight)
Else
StringToDouble(m_Door1.Height, dHeight)
End If
StringToDouble(OverlapTop, dOverlapTop)
+3 -1
View File
@@ -245,8 +245,10 @@ Public Class AssemblyPageVM
Case Else
LoadSelectedPartDoor(SelectPart, Visibility.Visible, False)
End Select
Map.refDimensioningPanelVM.LoadHardwareDimList()
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nDDFPage
' aggiorno elenco quotature
Map.refDimensioningPanelVM.LoadHardwareDimList()
Map.refSceneManagerVM.RefreshBtn()
Map.refProjectManagerVM.NotifyPropertyChanged("VisibilityCreateAssembly")
End Sub
+2 -2
View File
@@ -92,9 +92,9 @@ Public Class AssemblyManagerVM
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nDDFPage
Else
DdfFile.WriteDDFAssembly(NewAssName.SelAssembly, sTempFile, False)
ExecDoors(Map.refSceneManagerVM.ProjectScene, sTempFile, False)
' aggiorno elenco quotature
Map.refDimensioningPanelVM.LoadHardwareDimList()
ExecDoors(Map.refSceneManagerVM.ProjectScene, sTempFile, False)
EgtZoom(ZM.ALL)
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nAssemblyPage
End If
@@ -969,8 +969,8 @@ Public Class AssemblyManagerVM
Return False
End If
' aggiorno elenco quotature
Map.refDimensioningPanelVM.LoadHardwareDimList()
ExecDoors(Map.refSceneManagerVM.ProjectScene, sTempFile, False)
Map.refDimensioningPanelVM.LoadHardwareDimList()
Map.refSceneManagerVM.ShowGraphicError()
EgtZoom(ZM.ALL)
m_CurrProject.SelAssemblyName.SelAssembly.MatchCompo()
+3 -1
View File
@@ -104,7 +104,7 @@ Public Class CompoPanelVM
End Property
Public Sub CompoBtn(param As Object)
' distinguo il modo di caricare il i valori a secondo della pagina aperta
' distinguo il modo di caricare i valori a secondo della pagina aperta
If Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nHardwarePage Then
' devo controllare se devo salvare le modifiche fatte
If Not IsNothing(Map.refHardwarePageVM) Then ' se la pagina è aperta
@@ -161,6 +161,8 @@ Public Class CompoPanelVM
Public Sub GoToAssemblyBtn(param As Object)
If OptionModule.m_ConfigurationSoftware = ConfigType.Assembly Then
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nAssemblyPage
' aggiorno lista hardware di quotatura
Map.refDimensioningPanelVM.LoadHardwareDimList()
Map.refSceneManagerVM.RefreshBtn()
Else
Map.refCompoPanelVM.GoBackVisibility = Visibility.Collapsed
+2 -1
View File
@@ -246,7 +246,8 @@ Friend Module DdfFile
' origheightdoor: solo per i Jamb anche la dimensione della porta
If OptionModule.m_ConfigurationSoftware = ConfigType.Assembly AndAlso
Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly) Then
Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly) AndAlso
Part.TypePart.Contains("F") Then
DdfFileContent.Add("")
DdfFileContent.Add(ConstCompo.S_ORIGHEIGHTDOOR & ": " & Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.OrigHeightDoor)
End If
+2 -2
View File
@@ -2256,7 +2256,7 @@ Public Class ComboBoxParam
Dim BLD As ObservableCollection(Of CompoBrandDir) = Map.refHardwarePageVM.CurrHardware.SelectMatching(Me, Me.CurrCompo)
Map.refHardwarePageVM.CurrHardware.SelectFileMatching(Me, BLD)
Case ConstCompo.BRAND_INI
Map.refHardwarePageVM.CurrHardware.SlectBrandMatching(Me)
Map.refHardwarePageVM.CurrHardware.SelectBrandMatching(Me)
End Select
End If
@@ -2280,7 +2280,7 @@ Public Class ComboBoxParam
Dim BrandListFrame As ObservableCollection(Of CompoBrandDir) = Map.refHardwarePageVM.CurrHardware.SelectMatching(Me, Me.CurrCompo)
Map.refHardwarePageVM.CurrHardware.SelectFileMatching(Me, BrandListFrame)
Case ConstCompo.BRAND_INI
Map.refHardwarePageVM.CurrHardware.SlectBrandMatching(Me)
Map.refHardwarePageVM.CurrHardware.SelectBrandMatching(Me)
End Select
End If
NotifyPropertyChanged("SelItem")
+8 -4
View File
@@ -371,7 +371,7 @@ Public Class Hardware
End Sub
' dalla scelta del brand restituisce la lista dei file corretta
Public Sub SlectBrandMatching(ComboBoxBrand As ComboBoxParam)
Public Sub SelectBrandMatching(ComboBoxBrand As ComboBoxParam)
' eseguo una copia della componente
Dim CurrCompo As Compo = ComboBoxBrand.CurrCompo
' se il parametro che sto caricando non Brand allora esco
@@ -1669,9 +1669,13 @@ Public Class Hardware
If m_HardwareGeneral.DDFName = Map.refCompoPanelVM.CompoTypeList(IndexHardw).DDFName Then
' entro nella cartella della componente selezionata e ricarico le liste dei Brand
Map.refCompoPanelVM.CompoTypeList(IndexHardw).LoadListTemplate()
If Map.refCompoPanelVM.CompoTypeList(IndexHardw).FrameFolderList.Count <> m_HardwareGeneral.FrameFolderList.Count Then
m_HardwareGeneral.FrameFolderList = Map.refCompoPanelVM.CompoTypeList(IndexHardw).FrameFolderList
End If
For Each ItemCompo In Map.refCompoPanelHardwareVM.CompoTypeList
If ItemCompo.DDFName = Map.refCompoPanelVM.CompoTypeList(IndexHardw).DDFName Then
ItemCompo.LoadListTemplate()
End If
Next
' carico l'elnco delle cartelle Frame
m_HardwareGeneral.FrameFolderList = Map.refCompoPanelVM.CompoTypeList(IndexHardw).FrameFolderList
' devo ricaricare tutte le liste!
m_HardwareGeneral.HardwareFolderList = Map.refCompoPanelVM.CompoTypeList(IndexHardw).HardwareFolderList
If m_HardwareGeneral.HardwareFolderList.Count = 0 Then
+5 -2
View File
@@ -102,8 +102,11 @@ Public Class PrintWndVM
Shared Function TurnDimensioningLayer(sLayerName As String, bSelect As Boolean) As Boolean
Dim nFirstPart As Integer = EgtGetFirstPart()
Dim nLayer As Integer = EgtGetFirstNameInGroup(nFirstPart, sLayerName)
If bSelect Then EgtSetStatus(nLayer, GDB_ST.ON_) Else EgtSetStatus(nLayer, GDB_ST.OFF)
While nFirstPart > 0
Dim nLayer As Integer = EgtGetFirstNameInGroup(nFirstPart, sLayerName)
If bSelect Then EgtSetStatus(nLayer, GDB_ST.ON_) Else EgtSetStatus(nLayer, GDB_ST.OFF)
nFirstPart = EgtGetNextPart(nFirstPart)
End While
Return True
End Function
@@ -71,6 +71,27 @@ Public Class DimensioningPanelVM
End If
Next
End If
' se sono nella pagina assembalto devo leggere tutti i part
If Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nAssemblyPage Then
For Each HardwareDimension In m_HardwareDimensionList
If HardwareDimension.NameLayer <> "DIM_DOOR" Then
HardwareDimension.IsActive = False
End If
Next
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject) AndAlso
Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso
Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly) AndAlso
Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor) Then
For Each CurrPart In Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor
If Not IsNothing(CurrPart.Door) Then
SetHardwareDimension(CurrPart.Door)
End If
Next
Return True
End If
End If
' Abilito solo i tipi di hardware presenti nella porta corrente
Dim CurrDoor As Part = Map.refPartPageVM.CurrPart
If IsNothing(CurrDoor) Then Return False
@@ -95,6 +116,28 @@ Public Class DimensioningPanelVM
End If
Next
Return True
End Function
Private Function SetHardwareDimension(ByRef CurrPart As Part) As Boolean
If IsNothing(CurrPart) Then Return False
' disattivo tutti gli hardware nella lista
If CurrPart.CompoList.Count < 1 Then Return False
' Ciclo sugli hardware presenti nella porta corrente
For DoorCompoIndex = 0 To CurrPart.CompoList.Count - 1
' verifico se il tipo di hardware è diverso dal precedente
If DoorCompoIndex = 0 OrElse (Not DoorCompoIndex = 0 AndAlso
CurrPart.CompoList(DoorCompoIndex).CompoType.Name <> CurrPart.CompoList(DoorCompoIndex - 1).CompoType.Name) Then
' lo cerco nella lista delle dimensioni dell'hardware
For Each HardwareDimension In m_HardwareDimensionList
If CurrPart.CompoList(DoorCompoIndex).CompoType.Name = HardwareDimension.NameHardware Then
HardwareDimension.IsActive = True
Exit For
End If
Next
End If
Next
Return True
End Function
Sub New()