EgtDOORCreator 1.9f2:

- è salvato nel file ddf il nome della configurazione preceduto dall'intestazione Config: 
- nel caso di apertura di un direttorio vuoto (senza file ddf presenti) è visualizzata la pagina vuota
- sono state eseguite alcune modifiche al codice per iniziare a visualizzare nuovamente l'assemblato
This commit is contained in:
Nicola Pievani
2018-06-22 13:07:42 +00:00
parent 7d7e19b091
commit a30f32484e
9 changed files with 248 additions and 203 deletions
+73 -18
View File
@@ -21,10 +21,11 @@ Public Class Assembly
End Set
End Property
' tutte queste proprietà interagiscono direttamente con le dimensioni del TELAIO
' per questo motivo la funzione set può ospitare la chiamata ad una funzione che modifica le dimensioni della porta
#Region "Light Up/Bottom"
' tutte queste proprietà interagiscono direttamente con le dimensioni della porta e dell'assemblato
' per questo motivo la funzione set può ospitare la chiamata ad una funzione che modifica le dimensioni della porta
Private m_LightUp As String
Public Property LightUp As String
Get
@@ -32,12 +33,14 @@ Public Class Assembly
End Get
Set(value As String)
m_LightUp = value
' viene ricalcolata l'altezza della porta e dei jamb laterali
' viene ricalcolata l'altezza della porta e dei jamb laterali a partire dalla dimensione della porta
HeightJamb(GetArrayPartDoor(0).Door.Height)
' esegue il riposizionamento delle componeti sul telaio
UpDateAllCompo()
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
' questo metodo è utilizzato per caricare e aggiornare il valore m_lightUp senza eseguire le operazioni del Set
Public Sub SetLightUp(sLightUp As String)
m_LightUp = sLightUp
NotifyPropertyChanged("LightUp")
@@ -50,8 +53,9 @@ Public Class Assembly
End Get
Set(value As String)
m_LightBottom = value
' modifico le dimensioni dei Jambs
' viene ricalcolata l'altezza dei jamb laterali a partire dalla dimensione della porta
HeightJamb(GetArrayPartDoor(0).Door.Height)
' esegue il riposizionamento delle componeti sul telaio
UpDateAllCompo()
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
@@ -60,6 +64,7 @@ Public Class Assembly
m_LightBottom = sLightBottom
NotifyPropertyChanged("LightBottom")
End Sub
#End Region ' Light Up/Bottom
#Region "Light Hinge/Lock"
@@ -71,7 +76,9 @@ Public Class Assembly
End Get
Set(value As String)
m_LightHinge = value
' viene ricalcolata la larghezza dei jamb orizzonati (le dimensioni della porta devono esistere)
TopBottomWidth()
' esegue il riposizionamento delle componeti sul telaio
UpDateAllCompo()
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
@@ -88,8 +95,9 @@ Public Class Assembly
End Get
Set(value As String)
m_LightLock = value
' viene ricalcolata la larghezza dei jamb orizzonati (le dimensioni della porta devono esistere)
TopBottomWidth()
'SetWidthJamb()
' esegue il riposizionamento delle componeti sul telaio
UpDateAllCompo()
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
@@ -101,6 +109,8 @@ Public Class Assembly
#End Region ' Light Hinge/Lock
#Region "ThicknessHead"
Private m_ThicknessHead As String
Public Property ThicknessHead As String
Get
@@ -108,10 +118,14 @@ Public Class Assembly
End Get
Set(value As String)
m_ThicknessHead = value
' modifico le dimensioni dei Jambs
' riassegno la dimensioni Height del JambTop
m_TopJamb.SetHeight(m_ThicknessHead)
' viene ricalcolata l'altezza della porta e dei jamb laterali a partire dalla dimensione della porta
' per il fatto che anche i jamb lateriali devono allungarsi
HeightJamb(GetArrayPartDoor(0).Door.Height)
' viene ricalcolata la dimsione dei rabbet sui jamb laterali (per ospitare la nuova dimansione del JambTop)
TopRabbetJamb()
' esegue il riposizionamento delle componeti sul telaio
UpDateAllCompo()
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
@@ -121,7 +135,10 @@ Public Class Assembly
NotifyPropertyChanged("ThicknessHead")
End Sub
#End Region ' ThicknessHead
#Region "Overlap Hinge/Lock/Top/DeltaT"
Private m_OverlapHinge As String
Public Property OverlapHinge As String
Get
@@ -131,9 +148,11 @@ Public Class Assembly
m_OverlapHinge = value
' modifico le dimensioni dei Jambs
'DoorVisibilityNew()
' deve essere ricalcolata la dimensione del Top e del Bottom del telaio
TopBottomWidth()
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
'SetWidthJamb()
' viene ricalcolato il valore dei rabbet (sui Jamb laterali)
TopRabbetJamb()
HingeRabbetJamb()
BottomRabbetJamb()
@@ -1211,6 +1230,18 @@ Public Class Assembly
'---------------------------------------------------------------------------------------------------------------------------------------------
#Region "RULES ASSEMBLY"
' una volta creata la prima porta questa funzione calcola le dimensioni del telaio
Public Sub SetNewDimensionAssembly()
' calcolo l'altezza dei Jamb Laterali
HeightJamb(GetArrayPartDoor(0).Door.Height)
' calcolo la larghezza dei Jamb orizzontali in funzione del numero di porte selezionate
TopBottomWidth()
DoorVisibilityNew()
TopRabbetJamb()
HingeRabbetJamb()
BottomRabbetJamb()
End Sub
Public Sub SetVarAssembly()
Dim dHeight As Double
Dim dWidth As Double
@@ -1313,11 +1344,12 @@ Public Class Assembly
' definisco gli swing riferiti ai Jamb e quindi anche i nomi da associare alle porte durante la creazione di una nuova porta
Dim bInvertDoor As Boolean = False
Dim AppPartDoor As New PartDoor
Select Case DoorNumber
Case "1" ' passaggio da due porte ad una porta
OneDoorProperty = True
NotifyPropertyChanged("OneDoorProperty")
' inverto la posizioned delle porte
' inverto le porte
If GetArrayPartDoor(0).Door.Swing.Contains(ConstGen.INACTIVE) Then
AppPartDoor = GetArrayPartDoor(1)
SetArrayPartDoor(GetArrayPartDoor(0), 1)
@@ -1355,6 +1387,7 @@ Public Class Assembly
Map.refPartPageVM.CurrPart = GetArrayPartDoor(0).Door
SetTopWidth()
ReplaceHardware()
'--------------------------------------------------------------------------------------------------------------------------------------------------------------
' riassegno gli swing ai Jamb
LeftJamb.SetSwing(GetArrayPartDoor(0).Door.Swing)
@@ -1510,13 +1543,15 @@ Public Class Assembly
StringToDouble(HeighDoor, dHeight)
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.OverlapTop, dOverlapTop)
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.Width, dThichknessJamb)
Dim HJamb As Double = dLightBottom + dHeight + dLightUp + dThicknessHead - dOverlapTop
Dim HJambExterior As Double = HJamb + dThichknessJamb
' se è exterior
If Map.refAssemblyPageVM.CurrAssembly.Exterior Then
Map.refAssemblyPageVM.CurrAssembly.LeftJamb.SetHeight(DoubleToString(dLightBottom + dThicknessHead + dHeight - dOverlapTop + dLightUp + dThichknessJamb, 4))
Map.refAssemblyPageVM.CurrAssembly.RightJamb.SetHeight(DoubleToString(dLightBottom + dThicknessHead + dHeight - dOverlapTop + dLightUp + dThichknessJamb, 4))
Map.refAssemblyPageVM.CurrAssembly.LeftJamb.SetHeight(DoubleToString(HJambExterior, 4))
Map.refAssemblyPageVM.CurrAssembly.RightJamb.SetHeight(DoubleToString(HJambExterior, 4))
Else
Map.refAssemblyPageVM.CurrAssembly.LeftJamb.SetHeight(DoubleToString(dLightUp + dLightBottom + dThicknessHead + dHeight, 4))
Map.refAssemblyPageVM.CurrAssembly.RightJamb.SetHeight(DoubleToString(dLightUp + dLightBottom + dThicknessHead + dHeight, 4))
Map.refAssemblyPageVM.CurrAssembly.LeftJamb.SetHeight(DoubleToString(HJamb, 4))
Map.refAssemblyPageVM.CurrAssembly.RightJamb.SetHeight(DoubleToString(HJamb, 4))
End If
End Sub
@@ -1527,7 +1562,7 @@ Public Class Assembly
Next
End Sub
' questa funzione è chiamata durante la creazione di un nuovo assemblato, ogni volat che viene chiamta ricalcola la dimensione del TopJamb
' questa funzione è chiamata durante la creazione di un nuovo assemblato, ogni volta che viene chiamta ricalcola la dimensione del TopJamb
Public Sub SetTopWidth()
' azzero le dimensioni
m_BottomJamb.SetWidth("0")
@@ -1614,7 +1649,6 @@ Public Class Assembly
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.Width, dWidth0)
dActualWidth = dLightHinge + dLightLock + dOverlapLock + dOverlapHinge
Map.refAssemblyPageVM.CurrAssembly.TopJamb.SetWidth(DoubleToString(dWidth0 + dActualWidth, 4))
Map.refAssemblyPageVM.CurrAssembly.BottomJamb.SetWidth(DoubleToString(dWidth0 + dActualWidth, 4))
End If
Case "2"
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.Width, dWidth0)
@@ -1626,7 +1660,6 @@ Public Class Assembly
Else
dActualWidth = dLightHinge + dLightHinge + dLightLock + dOverlapHinge + dOverlapHinge + dWidth0
Map.refAssemblyPageVM.CurrAssembly.TopJamb.SetWidth(DoubleToString(dWidth1 + dActualWidth, 4))
Map.refAssemblyPageVM.CurrAssembly.BottomJamb.SetWidth(DoubleToString(dWidth1 + dActualWidth, 4))
End If
End Select
End Sub
@@ -1720,6 +1753,8 @@ Public Class Assembly
End Select
End Sub
#Region "RABBET SIDE TOP"
' clacola il rabbet sul profilo top dei Jamb (quindi solo su quelli laterali)
Public Sub TopRabbetJamb()
Dim sThicknessHead As String = Map.refAssemblyPageVM.CurrAssembly.ThicknessHead
@@ -1741,21 +1776,27 @@ Public Class Assembly
End Select
End Sub
' ricerca la componente Rabbet, se non esiete la aggiunge e poi la modifica, altrimenti la modifica
Private Sub SetRabbetJamb(ByRef Jamb As Part, sThicknessHead As String, sOverlap As String, sLightUp As String)
Dim CompoListIndex As Integer = DdfFile.CompoListOrder.Count - 1
Dim IndexCompoPanel As Integer = -1
' ricerco la posizione del rabbet nella lista dei componenti
For Index As Integer = 0 To Map.refCompoPanelVM.CompoTypeList.Count - 1
If Map.refCompoPanelVM.CompoTypeList(Index).DDFName = DdfFile.CompoListOrder(CompoListIndex) Then
IndexCompoPanel = Index
Exit For
End If
Next
' se la ricerca ha dato un esito positivo allora procedo
If IndexCompoPanel = -1 Then Return
Dim bRabbet As Boolean = False
Dim IndexCompo As Integer
' se il part che ho appena ricevuto (che deve essere necessariamente un Jamb) ha delle componenti
If Jamb.CompoList.Count > 0 Then
' inizio la ricerca della componente di tipo rabbet
For IndexCompo = 0 To Jamb.CompoList.Count - 1
If Jamb.CompoList(IndexCompo).CompoType.DDFName = OptionModule.m_CompoPaneOrder(IndexCompoPanel) Then
' controllo che il primo elemento selezionato nella ComboBox sia uguale al primo elemento della lista (questa cosa non mi convince)
If DirectCast(Jamb.CompoList(IndexCompo).CompoParamList(0), ComboBoxParam).SelItem = DirectCast(Jamb.CompoList(IndexCompo).CompoParamList(0), ComboBoxParam).ItemList(0) Then
bRabbet = True
Exit For
@@ -1767,18 +1808,21 @@ Public Class Assembly
SetTopRabbetParam(sThicknessHead, sOverlap, Jamb, IndexCompo, sLightUp)
Else
' lo aggiungo e lo modifico
If Not File.Exists(Map.refCompoPanelVM.CompoTypeList(IndexCompoPanel).Path & "\" & "Rabbet.frame") Then Return
If Not File.Exists(Map.refCompoPanelVM.CompoTypeList(IndexCompoPanel).Path & "\Rabbets.frame\Rabbet.lua") Then Return
Jamb.AddRefCompo(Map.refCompoPanelVM.CompoTypeList(IndexCompoPanel), "Rabbet.frame1")
SetTopRabbetParam(sThicknessHead, sOverlap, Jamb, Jamb.CompoList.Count - 1, sLightUp)
End If
Else
' lo aggiungo e lo modifico
If Not File.Exists(Map.refCompoPanelVM.CompoTypeList(IndexCompoPanel).Path & "\" & "Rabbet.frame") Then Return
Jamb.AddRefCompo(Map.refCompoPanelVM.CompoTypeList(IndexCompoPanel), "Rabbet.frame2")
Dim FileRabbet As String = "Rabbets.frame\Rabbet.lua"
Dim PathRabbet As String = Map.refCompoPanelVM.CompoTypeList(IndexCompoPanel).Path & "\" & FileRabbet
If Not File.Exists(PathRabbet) Then Return
Jamb.AddRefCompo(Map.refCompoPanelVM.CompoTypeList(IndexCompoPanel), FileRabbet)
SetTopRabbetParam(sThicknessHead, sOverlap, Jamb, 0, sLightUp)
End If
End Sub
' setta i parametri della componente Rabbet
Private Sub SetTopRabbetParam(sThicknessHead As String, sOverlapTop As String, ByRef Jamb As Part, IndexCompo As Integer, sLightUp As String)
Dim CurrCompoParam As CompoParam = Jamb.CompoList(IndexCompo).CompoParamList(1)
If TypeOf CurrCompoParam Is TextBoxParam Then
@@ -1801,6 +1845,8 @@ Public Class Assembly
End If
End Sub
#End Region ' Rabbet Side Top
' calcola il rabbet sul lato Hinge solo se è stata selezionata la proprietà exterior
' calcola il rabbet sul lato Bottom solo se è stata selezionata la proprietà exterior
Public Sub BottomRabbetJamb()
@@ -1824,6 +1870,7 @@ Public Class Assembly
RabbetExterior(Map.refAssemblyPageVM.CurrAssembly.RightJamb, sThicknessDoor, sWidthJamb, sOverLapHinge, IndexBottom)
End Select
End Sub
' il lato hinge è anche sul TopJamb con la profondità uguale a tutti gli altri
Public Sub HingeRabbetJamb()
Dim sThicknessDoor As String = GetArrayPartDoor(0).Door.Thickness
@@ -1831,6 +1878,7 @@ Public Class Assembly
Dim sOverLapHinge As String = Map.refAssemblyPageVM.CurrAssembly.OverlapHinge
Dim sOverLapLock As String = Map.refAssemblyPageVM.CurrAssembly.OverlapLock
Dim sOverLapTop As String = Map.refAssemblyPageVM.CurrAssembly.OverlapTop
' questo flag, che è poi passato alla funzione RabbetExterior, ha lo scopo di identificare chi sta esegunedo la chiamata
Dim IndexHinge As Integer = 2
Select Case DoorNumber
Case "1"
@@ -1849,12 +1897,14 @@ Public Class Assembly
RabbetExterior(Map.refAssemblyPageVM.CurrAssembly.TopJamb, sThicknessDoor, sDeltaT, sOverLapTop, IndexHinge)
End Select
End Sub
Private Sub SetHingeRabbetParam(sThicknessDoor As String, sDeltaT As String, sOverlap As String, ByRef Jamb As Part, CurrCompo As Compo, IndexSide As Integer)
Dim dThicknessDoor As Double
Dim dDeltaT As Double
StringToDouble(sThicknessDoor, dThicknessDoor)
StringToDouble(sDeltaT, dDeltaT)
Select Case IndexSide
' se è stata passata sul lato cerniera/serrattura
Case 2
Dim CurrCompoParam As CompoParam = CurrCompo.CompoParamList(0)
Dim Index As Integer = 0
@@ -1862,6 +1912,7 @@ Public Class Assembly
CurrCompoParam = CurrCompo.CompoParamList(1)
If TypeOf DirectCast(CurrCompoParam, CompoParam) Is TextBoxParam Then
Dim TextParam As TextBoxParam = DirectCast(CurrCompoParam, TextBoxParam)
' definisce l'affondamento della porta nel telaio
TextParam.m_Value = DoubleToString(dDeltaT + dThicknessDoor, 4)
TextParam.NotifyPropertyChanged("Value")
End If
@@ -1870,15 +1921,18 @@ Public Class Assembly
If TypeOf DirectCast(CurrCompoParam, CompoParam) Is TextBoxParam Then
Dim TextParam As TextBoxParam = DirectCast(CurrCompoParam, TextBoxParam)
Dim sRabbetDepth As String = sOverlap
' la profondità deve essere la stessa che è stata definita sul rabbet top
TextParam.m_Value = sRabbetDepth
TextParam.NotifyPropertyChanged("Value")
End If
CurrCompoParam = CurrCompo.CompoParamList(3)
If TypeOf DirectCast(CurrCompoParam, CompoParam) Is TextBoxOnOffParam Then
Dim TextOnOffParam As TextBoxOnOffParam = DirectCast(CurrCompoParam, TextBoxOnOffParam)
' disaativo il paramtro Angle
TextOnOffParam.IsActive = False
TextOnOffParam.NotifyPropertyChanged("Value")
End If
Case 1
' inseriamo i parametri per la creazione del rabbet sul fondo
Dim CurrCompoParam As CompoParam = CurrCompo.CompoParamList(0)
@@ -1909,10 +1963,10 @@ Public Class Assembly
End Select
End Sub
Public Sub RabbetExterior(ByRef Jamb As Part, sThicknessDoor As String, sDeltaT As String, sOverLap As String, nIndexSide As Integer)
'Dim IndexHinge As Integer = 2
'Dim IndexBottom As Integer = 1
Dim CompoListIndex As Integer = Map.refCompoPanelVM.CompoTypeList.Count - 1
Dim bRabbet As Boolean = False
Dim IndexCompo As Integer
@@ -1985,6 +2039,7 @@ Public Class Assembly
' Next
' Next
'End Sub
#End Region ' Rules Assembly
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
+1 -1
View File
@@ -37,7 +37,7 @@ Public Class AssemblyPageVM
Public ReadOnly Property LightUpMsg As String
Get
' Light Up
Return EgtMsg(50055)
Return EgtMsg(50056)
End Get
End Property
+6 -6
View File
@@ -60,6 +60,8 @@ Public Class AssemblyManagerVM
' ricarico la lista completa degli swing
NewAssName.SelAssembly.GetArrayPartDoor(0).Door.SwingTypeList = OptionModule.m_SwingTypeList
DdfFile.WriteDDFPart(NewAssName.SelAssembly.GetArrayPartDoor(0).Door, sTempFile, False, False)
' assegno la porte salvata nel CurrPart.ddf come porta corrente del progetto
Map.refPartPageVM.CurrPart = NewAssName.SelAssembly.GetArrayPartDoor(0).Door
' aggiorno elenco quotature
Map.refDimensioningPanelVM.LoadHardwareDimList()
ExecDoors(Map.refSceneManagerVM.ProjectScene, sTempFile, False)
@@ -195,9 +197,6 @@ Public Class AssemblyManagerVM
' Caricamento dei dati della pagina generale degli assemblati
Friend Function CreateNewAssembly(value As String) As Assembly
'' se non esisteva nessuna porta allora posso procedere
'CurrProject.SelAssemblyName.Name = value
'NotifyPropertyChanged("SelectedAssembly")
' costruisco un nuvo assemblato e lo carico con i valori
Dim Local_SelAssembly As New Assembly
Local_SelAssembly.SetExterior(OptionModule.m_Exterior)
@@ -238,10 +237,11 @@ Public Class AssemblyManagerVM
m_CurrProject.SelAssemblyName.SelAssembly = Local_SelAssembly
' carico il numero massimo di porte ammesse e intanto dimesiono i jamb
CreateDoor(Local_SelAssembly)
' calcolo la dimensione dei Jambs in funzione del numero di porte realmente visibili ed assegno gli swing
Local_SelAssembly.DoorVisibilityNew()
'' calcolo la dimensione dei Jambs in funzione del numero di porte realmente visibili ed assegno gli swing
'Local_SelAssembly.DoorVisibilityNew()
'Local_SelAssembly.SetNewDimensionAssembly()
' eseguo il rabbet sui jamb
Local_SelAssembly.TopRabbetJamb()
'Local_SelAssembly.TopRabbetJamb()
'Local_SelAssembly.HingeRabbetJamb()
Return Local_SelAssembly
End Function
+1
View File
@@ -134,6 +134,7 @@ Public Class CompoPanelVM
Map.refHardwareHelpSceneHostV.LoadHelpProject()
End If
'------------------------------------------------------------------------------------------------------------------------------
Else ' se non sono nella configurazione Hardware
Dim m_CurrCompoType As CompoType = DirectCast(param, CompoType)
m_CurrCompoType.LoadListTemplate()
+1 -1
View File
@@ -25,7 +25,7 @@ Friend Module DdfFile
' inserisco la configurazione usata
Dim Config As String = IniFile.m_sDoorsDirPath
Config = Path.GetFileName(Config)
DdfFileContent.Add("#" & Config)
DdfFileContent.Add("#Config: " & Config)
If Not IsNothing(Part.TypePart) Then
DdfFileContent.Add("#" & PrintTitleDDFPart(Part.TypePart))
End If
+146 -161
View File
@@ -25,6 +25,7 @@ Public Class Part
NotifyPropertyChanged("TypePart")
End Set
End Property
' per sapere se il check è attivo
Private m_IsActive As Boolean
Public Property IsActive As Boolean
@@ -41,7 +42,7 @@ Public Class Part
NotifyPropertyChanged("IsActive")
End Sub
' lista delle disposizioni da mostrare a video
' lista delle disposizioni da mostrare a video (bevel)
Friend Shared m_DispositionList As New ObservableCollection(Of EdgeType)
Public ReadOnly Property DispositionList As ObservableCollection(Of EdgeType)
Get
@@ -49,7 +50,7 @@ Public Class Part
End Get
End Property
' elemento selezionato dalla lista delle disposizinioni
' elemento selezionato dalla lista delle disposizinioni (bevel)
Private m_DispositionItem As EdgeType
Public Property DispositionItem As EdgeType
Get
@@ -71,16 +72,7 @@ Public Class Part
#End Region ' Nuove proprietà delle parti
Private m_SwingTypeList As List(Of String) = New List(Of String)
Public Property SwingTypeList As List(Of String)
Get
Return m_SwingTypeList
End Get
Set(value As List(Of String))
m_SwingTypeList = value
NotifyPropertyChanged("SwingTypeList")
End Set
End Property
#Region "Info Generali del ddf"
Private m_Measure As String
Public Property Measure As String
@@ -172,51 +164,9 @@ Public Class Part
End Set
End Property
#Region "Size"
#End Region ' Info generali del ddf
Public ReadOnly Property ToolTipEvaluatedHeight As String
Get
Dim dVal As Double
If StringToDouble(m_Height, dVal) Then
Return DoubleToString(dVal, 4)
Else
Return EgtMsg(50143)
End If
End Get
End Property
Public ReadOnly Property ToolTipEvaluatedWidth As String
Get
Dim dVal As Double
If StringToDouble(m_Width, dVal) Then
Return DoubleToString(dVal, 4)
Else
Return EgtMsg(50143)
End If
End Get
End Property
Public ReadOnly Property ToolTipEvaluatedThickness As String
Get
Dim dVal As Double
If StringToDouble(m_Thickness, dVal) Then
Return DoubleToString(dVal, 4)
Else
Return EgtMsg(50143)
End If
End Get
End Property
Public ReadOnly Property ToolTipEvaluatedWeight As String
Get
Dim dVal As Double
If StringToDouble(m_Weight, dVal) Then
Return DoubleToString(dVal, 4)
Else
Return EgtMsg(50143)
End If
End Get
End Property
#Region "SIZE"
Private m_Height As String
Public Property Height As String
@@ -224,17 +174,6 @@ Public Class Part
Return m_Height
End Get
Set(value As String)
'Dim dVal As Double
'If StringToDouble(value, dVal) Then
' m_Height = DoubleToString(dVal, 4)
'Else
' Dim x As String = EgtMsg(50143)
'End If
'If StringToDouble(value, dVal) Then
' m_Height = value
'Else
' MessageBox.Show(EgtMsg(50148), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Asterisk)
'End If
m_Height = value
Dim dHeight As Double
If StringToDouble(value, dHeight) Then
@@ -243,11 +182,6 @@ Public Class Part
NotifyPropertyChanged("ToolTipEvaluatedThickness")
NotifyPropertyChanged("ToolTipEvaluatedWidth")
NotifyPropertyChanged("ToolTipEvaluatedHeight")
'' ricalcola la dimensione altezza dei Jamb FL e FR
'Map.refAssemblyPageVM.CurrAssembly.HeightJamb(m_Height)
'Map.refAssemblyPageVM.CurrAssembly.HeightDoor(m_Height)
'Map.refAssemblyPageVM.CurrAssembly.UpDateAllCompo()
'Map.refAssemblyPageVM.CurrAssembly.SetVarAssembly()
'SetVarSize()
UpdateToolTip()
NotifyPropertyChanged("Height")
@@ -259,6 +193,16 @@ Public Class Part
NotifyPropertyChanged("Height")
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Sub
Public ReadOnly Property ToolTipEvaluatedHeight As String
Get
Dim dVal As Double
If StringToDouble(m_Height, dVal) Then
Return DoubleToString(dVal, 4)
Else
Return EgtMsg(50143)
End If
End Get
End Property
Private m_Width As String = String.Empty
Public Property Width As String
@@ -266,12 +210,6 @@ Public Class Part
Return m_Width
End Get
Set(value As String)
'Dim dVal As Double
'If StringToDouble(value, dVal) Then
' m_Width = value
'Else
' MessageBox.Show(EgtMsg(50148), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Asterisk)
'End If
m_Width = value
Dim dWidth As Double
If StringToDouble(value, dWidth) Then
@@ -280,10 +218,6 @@ Public Class Part
NotifyPropertyChanged("ToolTipEvaluatedThickness")
NotifyPropertyChanged("ToolTipEvaluatedWidth")
NotifyPropertyChanged("ToolTipEvaluatedHeight")
' ricalcola la dimensione larghezza dei Jamb FT e FB
'Map.refAssemblyPageVM.CurrAssembly.SetTopWidth()
'Map.refAssemblyPageVM.CurrAssembly.UpDateAllCompo()
'Map.refAssemblyPageVM.CurrAssembly.SetVarAssembly()
'SetVarSize()
UpdateToolTip()
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
@@ -294,6 +228,16 @@ Public Class Part
NotifyPropertyChanged("Width")
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Sub
Public ReadOnly Property ToolTipEvaluatedWidth As String
Get
Dim dVal As Double
If StringToDouble(m_Width, dVal) Then
Return DoubleToString(dVal, 4)
Else
Return EgtMsg(50143)
End If
End Get
End Property
Private m_Thickness As String
Public Property Thickness As String
@@ -301,12 +245,6 @@ Public Class Part
Return m_Thickness
End Get
Set(value As String)
'Dim dVal As Double
'If StringToDouble(value, dVal) Then
' m_Thickness = value
'Else
' MessageBox.Show(EgtMsg(50148), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Asterisk)
'End If
m_Thickness = value
Dim dThickness As Double
If StringToDouble(value, dThickness) Then
@@ -315,7 +253,6 @@ Public Class Part
NotifyPropertyChanged("ToolTipEvaluatedThickness")
NotifyPropertyChanged("ToolTipEvaluatedWidth")
NotifyPropertyChanged("ToolTipEvaluatedHeight")
'Map.refAssemblyPageVM.CurrAssembly.SetVarAssembly()
'SetVarSize()
UpdateToolTip()
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
@@ -325,6 +262,20 @@ Public Class Part
m_Thickness = sThickness
NotifyPropertyChanged("Thickness")
End Sub
Public ReadOnly Property ToolTipEvaluatedThickness As String
Get
Dim dVal As Double
If StringToDouble(m_Thickness, dVal) Then
Return DoubleToString(dVal, 4)
Else
Return EgtMsg(50143)
End If
End Get
End Property
#End Region ' Size
#Region "WEIGHT"
Private m_Weight As String
Public Property Weight As String
@@ -340,6 +291,16 @@ Public Class Part
NotifyPropertyChanged("ToolTipEvaluatedWeight")
End Set
End Property
Public ReadOnly Property ToolTipEvaluatedWeight As String
Get
Dim dVal As Double
If StringToDouble(m_Weight, dVal) Then
Return DoubleToString(dVal, 4)
Else
Return EgtMsg(50143)
End If
End Get
End Property
Private Shared m_IsCheckedWeight As Visibility
Public Shared Property IsCheckedWeight As Visibility
@@ -363,6 +324,22 @@ Public Class Part
End Set
End Property
#End Region ' Weight
#Region "SWING"
' lista degli Swing
Private m_SwingTypeList As List(Of String) = New List(Of String)
Public Property SwingTypeList As List(Of String)
Get
Return m_SwingTypeList
End Get
Set(value As List(Of String))
m_SwingTypeList = value
NotifyPropertyChanged("SwingTypeList")
End Set
End Property
Private m_Swing As String = Nothing
Public Property Swing As String
Get
@@ -371,8 +348,6 @@ Public Class Part
Set(value As String)
m_Swing = value
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
Map.refAssemblyPageVM.CurrAssembly.UpdateSwing(m_Swing)
Map.refAssemblyPageVM.CurrAssembly.TopRabbetJamb()
' aggiorno la grafica
Map.refSceneManagerVM.RefreshBtn()
End Set
@@ -382,19 +357,9 @@ Public Class Part
NotifyPropertyChanged("Swing")
End Sub
Private m_NewPart As Boolean = True
Public Property NewPart As Boolean
Get
Return m_NewPart
End Get
Set(value As Boolean)
m_NewPart = value
End Set
End Property
#End Region ' Swing
#End Region
#Region "TypeEdge"
#Region "EDGE"
Friend Shared m_LockEdgeTypeList As New ObservableCollection(Of EdgeType)
Friend Shared m_HingeEdgeTypeList As New ObservableCollection(Of EdgeType)
@@ -510,9 +475,9 @@ Public Class Part
NotifyPropertyChanged("BottomType")
End Sub
#End Region
#End Region ' Edge
#Region "Machining"
#Region "MACHINING"
Private m_TopMachining As Boolean
Public Property TopMachining As Boolean
@@ -558,9 +523,9 @@ Public Class Part
End Set
End Property
#End Region
#End Region ' Machining
#Region "OverMaterial"
#Region "OVERLAPMATERIAL"
Public ReadOnly Property ToolTipEvaluatedLockOverMaterial As String
Get
@@ -654,27 +619,21 @@ Public Class Part
End Set
End Property
#End Region
#End Region ' OverlpaMaterial
Public Sub SetVarSize()
Dim dHeight As Double
Dim dWidth As Double
Dim dThickness As Double
If Not IsNothing(m_Height) And Not IsNothing(m_Width) And Not IsNothing(m_Thickness) Then
If StringToDouble(m_Height, dHeight) Then
EgtLuaSetGlobNumVar("H", dHeight)
End If
If StringToDouble(m_Width, dWidth) Then
EgtLuaSetGlobNumVar("W", dWidth)
End If
If StringToDouble(m_Thickness, dThickness) Then
EgtLuaSetGlobNumVar("T", dThickness)
End If
End If
End Sub
Private m_NewPart As Boolean = True
Public Property NewPart As Boolean
Get
Return m_NewPart
End Get
Set(value As Boolean)
m_NewPart = value
End Set
End Property
#End Region ' General
' lista delle componenti
Friend m_CompoList As New ObservableCollection(Of Compo)
Public Property CompoList As ObservableCollection(Of Compo)
Get
@@ -685,6 +644,8 @@ Public Class Part
End Set
End Property
#Region "ADDCOMPO"
' utilizzata nell'Hardware
Friend Function AddNewHardware(HardwareGeneral As CompoType, TempHardwFile As String) As Boolean
' disabilito la costruzione del riferimento
@@ -732,75 +693,52 @@ Public Class Part
'Gestione ComboBox e TextBox di ogni compo della pulsantiera letta da Compo.ini (Door)
Friend Function AddNewCompo(CurrCompoType As CompoType) As Compo
' converto tutti gli sfondi in bianco
' disabilito la costruzione del riferimento
Assembly.BuiltReffCompo = False
' converto tutti gli sfondi in bianco dei nomi delle componenti
For Each Compo In Map.refPartPageVM.CurrPart.CompoList
Compo.BorderColor = New BrushConverter().ConvertFrom("#DCDCDC")
Compo.BackGroundColor = New BrushConverter().ConvertFrom("#FFFFFF")
Compo.BorderThickness = 1
Next
' 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
' creo il nuovo oggetto compo
Dim NewCompo As New Compo(CurrCompoType)
' Leggo il file ini del componente per vedere se c'è il template: se c'è
If EgtUILib.GetPrivateProfileInt(S_TEMPLATE, K_ISACTIVE, 1, CurrCompoType.Path & "\" & CONFIGINI_FILE_NAME) <> 0 Then
' leggo nomi
' leggo nomi della componente scritti nel file di configurazione
Dim Name As String = String.Empty
Dim DDFName As String = String.Empty
IniFile.GetPrivateProfileCompoName(S_TEMPLATE, K_NAME, DDFName, Name, CurrCompoType.Path & "\" & CONFIGINI_FILE_NAME)
'-----------------------------------------------------------------------------------------------------------------------------------
NewCompo.TemplateDDFName = DDFName
NewCompo.TemplateName = Name
LoadBrandFileList(NewCompo)
AdviceHinge(NewCompo)
'-----------------------------------------------------------------------------------------------------------------------------------
' se non c'è il template
Else
' nascondo il template
NewCompo.TemplateVisibility = Visibility.Collapsed
' leggo il nome del compo dal file config.ini
' leggo il nome del compo dal file config.ini ( il nome del file lua che deve essere caricato)
Dim sTemplateName As String = String.Empty
EgtUILib.GetPrivateProfileString(S_TEMPLATE, K_COMPO, "", sTemplateName, CurrCompoType.Path & "\" & CONFIGINI_FILE_NAME)
' se il nome non esiste oppure non è associato alcun file elimina l'oggetto
If String.IsNullOrWhiteSpace(sTemplateName) Then
' Errore nella lettura {0} nel parametro {1} della componente.
ErrorList &= String.Format(EgtMsg(50122), K_COMPO, NewCompo.TemplateName)
NewCompo = Nothing
ElseIf Not File.Exists(CurrCompoType.Path & "\" & sTemplateName & LUA_EXTENSION) Then
' Errore nella lettura {0} nel parametro {1} della componente.
ErrorList &= String.Format(EgtMsg(50122), K_COMPO, NewCompo.TemplateName)
NewCompo = Nothing
Else
' alrimenti seleziono il nome
NewCompo.TemplateSelItem = sTemplateName
End If
End If
' raggruppo tutte le componenti che hanno lo stesso nome vicine
' se è stata generata la componente
If Not IsNothing(NewCompo) Then
'-----------------------------------------------------------------------------------------------------------------------------------------------
' questa parte viene ignorata se l'oggetto chiamante è un Frame
If Not IsNothing(Me.m_TypePart) AndAlso Not Me.m_TypePart.Contains(ConstGen.PART_FRAME) Then
If Not IsNothing(Map.refAssemblyPageVM.CurrAssembly.LeftJamb) Then
' costruisco un riferimnto in locale dell'assemblato
Dim CurrAssembly As Assembly = Map.refAssemblyPageVM.CurrAssembly
' il nome del file associato alla componente
Dim FrameCompoFile As String = String.Empty
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
' 50144 =Warning
' 50166 =Jamb compo does not exist
MessageBox.Show(EgtMsg(50166), EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning)
Else
CreateRefCompo(CurrCompoType, NewCompo, CurrAssembly, FrameCompoFileConfig, FrameCompoFile, Me)
End If
End If
End If
End If
'-----------------------------------------------------------------------------------------------------------------------------------------------
' raggruppo tutte le componenti che hanno lo stesso nome vicine
' se trova già una componente allora l'inserimento avviene nel ciclo for
Dim bInsert = False
Dim CompoIndex = 0
@@ -818,22 +756,59 @@ Public Class Part
End If
Next
If Not bInsert Then
' se la componenteaggiunta è un a Hinge allora il nome del template da visualizzare è di una Mortise
AdviceHinge(NewCompo)
CompoList.Add(NewCompo)
End If
' evidenzio il nome della componente appena aggiunto
NewCompo.BorderColor = New BrushConverter().ConvertFrom("#DCDCDC")
NewCompo.BackGroundColor = New BrushConverter().ConvertFrom("#DCDCDC")
NewCompo.BorderThickness = 1
'-----------------------------------------------------------------------------------------------------------------------------------------------
BuiltReferenceCompo(NewCompo)
'-----------------------------------------------------------------------------------------------------------------------------------------------
End If
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
' riabilito la costruzione del riferimnto
Assembly.BuiltReffCompo = True
Return NewCompo
End Function
' ha lo scopo di generare una componente sul jamb
Private Sub BuiltReferenceCompo(NewCompo As Compo)
' questa parte viene ignorata se l'oggetto chiamante è un Frame
If Not IsNothing(Me.m_TypePart) AndAlso Not Me.m_TypePart.Contains(ConstGen.PART_FRAME) Then
If Not IsNothing(Map.refAssemblyPageVM.CurrAssembly.LeftJamb) Then
' costruisco un riferimnto in locale dell'assemblato
Dim CurrAssembly As Assembly = Map.refAssemblyPageVM.CurrAssembly
' il nome del file associato alla componente
Dim FrameCompoFile As String = String.Empty
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
' 50144 =Warning
' 50166 =Jamb compo does not exist
MessageBox.Show(EgtMsg(50166), EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning)
Else
CreateRefCompo(NewCompo.CompoType, NewCompo, CurrAssembly, FrameCompoFileConfig, FrameCompoFile, Me)
End If
End If
End If
End If
End Sub
' crea la componente di riferimento
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
' 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
@@ -842,9 +817,13 @@ Public Class Part
Dim Side As String = String.Empty
Dim CurrCompoPath As String = FrameCompoFileConfig
If File.Exists(CurrCompoPath) Then
' Name=hinges/50074
GetPrivateProfileCompoName(ConstCompo.S_COMPO, ConstCompo.K_NAME, FrameCompoNameDDF, FrameCompoName, CurrCompoPath)
' FolderName = 50052
GetPrivateProfileFolderName(S_TEMPLATE, K_FOLDER_NAME, FrameFolderName, CurrCompoPath)
' Side = Hinge
GetPrivateProfileJambSide(S_POSITIONSIDE, K_SIDE, Side, CurrCompoType.Path & "\" & CONFIGINI_FILE_NAME)
' se non è stata trovata nessuna voce nel file di configurazione ( riferita alla posizione side)
If String.IsNullOrEmpty(Side) Then
' controllo nell'elenco dei parametri se esiste un parametro di tipo Side
For IndexParam As Integer = 0 To NewCompo.CompoParamList.Count - 1
@@ -859,14 +838,17 @@ Public Class Part
Dim FrameCompoDirectory As String
FrameCompoDirectory = FrameCompoFileConfig.Remove(FrameCompoFileConfig.LastIndexOf("\"))
CompoTypeJamb = New CompoType(FrameCompoName, FrameCompoNameDDF, FrameCompoDirectory, Side, FrameFolderName)
' assegno alla componente sull'anta la sua posizione
NewCompo.CompoType.SetJambSide(Side)
Else
' se non trovo nessun riferimento per la posizione allora esco
Return
End If
Else
' se non trovo nulla nel direttorio indicato carico il direttorio della componente corrente
Return
End If
'------------------------------------------------------------------------------------------------------------------------------------------
Select Case CurrAssembly.DoorNumber
Case "1"
@@ -922,6 +904,7 @@ Public Class Part
NewCompo.refJambCompo.IsReadOnly = True
End Select
End Select
' riabilito la costruzion del riferimnto
Assembly.BuiltReffCompo = True
End Sub
@@ -987,6 +970,8 @@ Public Class Part
Return NewCompo
End Function
#End Region 'AddCompo
' ricerco la stessa componente all'interno della lista di comopnenti, se non trovo nulla restituisco una stringa vuota
Private Function SetItemTemplate(CompoName As String) As String
Dim IndexCompo As Integer = 0
+1
View File
@@ -280,6 +280,7 @@ Public Class ProjectManagerVM
'Map.refAssemblyManagerVM.Open(CurrProject.AssemblyList(0))
Else
Map.refPartPageVM.CurrPart = Nothing
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
EgtNewFile()
EgtZoom(ZM.ALL)
End If
@@ -61,6 +61,7 @@ Public Class DimensioningPanelVM
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
If CurrDoor.CompoList.Count < 1 Then Return False
' disattivo tutti gli hardware nella lista
For Each HardwareDimension In m_HardwareDimensionList
+18 -16
View File
@@ -5,10 +5,12 @@ Imports System.Text.RegularExpressions
Imports System.IO
Public Module Utility
' dato il nome della componete ricerso il file di configurazione associato
Public Function SearchFileConfig(ByRef FrameCompoFile As String, ByRef FrameCompoFileConfig As String) As Boolean
Dim bFileConfig As Boolean = False
FrameCompoFile = IniFile.m_CompoDir & "\" & FrameCompoFile
FrameCompoFileConfig = FrameCompoFile
' se il nome non esiste allora provo ad aggiungere anche l'estensione
If Not File.Exists(FrameCompoFileConfig) Then
FrameCompoFileConfig = FrameCompoFileConfig & ".lua"
End If
@@ -153,22 +155,22 @@ Public Module Utility
End Select
ElseIf sValue.Contains("(") And sValue.Contains(")") And Not sValue.Contains("inch") Then
'sValue = Regex.Match(sValue, "\s*\((.*?)\s*\)\s*\.*").Groups(1).Value
If String.IsNullOrEmpty(sValue) Then Return "0.0000"
' ricevo un valore in mm
Select Case OptionModule.m_SelectedMeasureUnit
Case ConstGen.VAL_INCHES ' se la configurazione è inches faccio conversioni
If MmToInches(sValue) Then
Return sValue
Else
Return "0.0000"
End If
Case ConstGen.MM ' se la configurazione è in mm non faccio la conevrsione
If StringToDouble(sValue, dVal) Then
Return sValue
Else
Return "0.0000"
End If
End Select
If String.IsNullOrEmpty(sValue) Then Return "0.0000"
' ricevo un valore in mm
Select Case OptionModule.m_SelectedMeasureUnit
Case ConstGen.VAL_INCHES ' se la configurazione è inches faccio conversioni
If MmToInches(sValue) Then
Return sValue
Else
Return "0.0000"
End If
Case ConstGen.MM ' se la configurazione è in mm non faccio la conevrsione
If StringToDouble(sValue, dVal) Then
Return sValue
Else
Return "0.0000"
End If
End Select
End If
' il valore che ricevo è in mm
Select Case OptionModule.m_SelectedMeasureUnit