EgtDOORCreator 1.9g1 :

- ripristino della modalità assemblato
- aggiunta del campo properties nel ddf 
- semplificazione del codice in modalità porta singola/assemblato
This commit is contained in:
Nicola Pievani
2018-07-19 16:44:03 +00:00
parent 70c5223b97
commit eaee74096d
26 changed files with 3026 additions and 1833 deletions
+1347 -818
View File
File diff suppressed because it is too large Load Diff
+56 -8
View File
@@ -27,6 +27,7 @@
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
@@ -276,8 +277,52 @@
Style="{StaticResource DoorParamsTxBx}"
Text="{Binding CurrAssembly.OverlapTop, UpdateSourceTrigger=PropertyChanged}"
Margin="0.4,2,39.6,3.2" VerticalAlignment="Stretch" Height="Auto"/>
</Grid>
</GroupBox>
<!--TotalDimension-->
<GroupBox Grid.Row="2" Grid.ColumnSpan="6" Margin="2,0,2,0">
<GroupBox.Header>
<StackPanel Orientation="Horizontal">
<CheckBox Grid.Row="0" Grid.Column="5"
Name="TotalDimension"
Style="{StaticResource DoorParamsChBx}"
IsChecked="{Binding CurrAssembly.Dimension}"
Margin="0,0,2,0" VerticalAlignment="Stretch" Height="Auto"/>
<TextBlock Text="{Binding DimensionMsg}" Width="Auto"/>
</StackPanel>
</GroupBox.Header>
<Grid Margin="0,0,0,2" IsEnabled="{Binding IsChecked, ElementName=TotalDimension}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<!--Total Height-->
<TextBlock Text="{Binding TotalHeightMsg}"
Style="{StaticResource DoorParamsTxBl}"
Margin="2,0,0,2"
Grid.Column="1"/>
<TextBox Grid.Column="2"
Style="{StaticResource DoorParamsTxBx}"
Text="{Binding CurrAssembly.AssemblyHeight, UpdateSourceTrigger=PropertyChanged}"
Margin="0.4,2,39.6,3.2" VerticalAlignment="Stretch" Height="Auto"/>
<!--Total Width-->
<TextBlock Text="{Binding TotalWidthMsg}"
Style="{StaticResource DoorParamsTxBl}"
Margin="2,0,0,2"
Grid.Column="3"/>
<TextBox Grid.Column="4"
Style="{StaticResource DoorParamsTxBx}"
Text="{Binding CurrAssembly.AssemblyWidth, UpdateSourceTrigger=PropertyChanged}"
Margin="0.4,2,39.6,3.2" VerticalAlignment="Stretch" Height="Auto"/>
</Grid>
</GroupBox>
<!--DeltaThickness-->
<TextBlock Text="{Binding DeltaTMsg}"
Style="{StaticResource DoorParamsTxBl}"
@@ -294,8 +339,9 @@
Padding="3"
Margin="12" VerticalAlignment="Stretch"
Content="Order" Command="{Binding OrderCmd}"/>
<!--Parts-->
<GroupBox Margin="2,0,2,0" Grid.Column="0" Grid.ColumnSpan="6" Grid.Row="2">
<GroupBox Margin="2,0,2,0" Grid.Column="0" Grid.ColumnSpan="6" Grid.Row="3">
<GroupBox.Header >
<TextBlock Text="{Binding JambsAndDoorsMsg}" Style="{StaticResource DoorParamsTxBl}" Height="Auto" />
</GroupBox.Header>
@@ -355,7 +401,7 @@
Grid.Column="2"
Grid.Row="4"/>
<CheckBox Name="LeftJambChk" Style="{StaticResource DoorParamsChBx}"
IsChecked="{Binding CurrAssembly.LeftJamb.IsActive}"
IsChecked="{Binding CurrAssembly.JambLIsChecked}"
Grid.Column="1" Grid.ColumnSpan="2"
Grid.Row="4"/>
<!--Jamb Top-->
@@ -369,7 +415,7 @@
Grid.Row="1">
</Button>
<CheckBox Name="TopJambChk" Style="{StaticResource DoorParamsChBx}"
IsChecked="{Binding CurrAssembly.TopJamb.IsActive}"
IsChecked="{Binding CurrAssembly.JambTIsChecked}"
Grid.Column="5"
Grid.Row="1"/>
<!--Jamb Right-->
@@ -402,7 +448,7 @@
Grid.Row="4">
</Button>
<CheckBox Name="RightJambChk" Style="{StaticResource DoorParamsChBx}"
IsChecked="{Binding CurrAssembly.RightJamb.IsActive}"
IsChecked="{Binding CurrAssembly.JambRIsChecked}"
Grid.Column="8" Grid.ColumnSpan="2"
Grid.Row="4" />
@@ -423,19 +469,21 @@
Visibility="{Binding IsChecked,
ElementName=Exterior,
Converter={StaticResource BooleanToVisibilityConverter}}"
IsChecked="{Binding CurrAssembly.BottomJamb.IsActive}"
IsChecked="{Binding CurrAssembly.JambBIsChecked}"
Grid.Column="5"
Grid.Row="6"/>
<!--Door-->
<ItemsControl ItemsSource="{Binding CurrAssembly.ArrayPartDoor}"
<ItemsControl ItemsSource="{Binding CurrAssembly.ListPartDoorOfDoor}"
Grid.Column="5"
Grid.Row="4"
Focusable="True">
<ItemsControl.ItemContainerStyle>
<!--<ItemsControl.ItemContainerStyle>
<Style TargetType="{x:Type ContentPresenter}">
<Setter Property="Visibility" Value="{Binding IsVisible}"/>
</Style>
</ItemsControl.ItemContainerStyle>
</ItemsControl.ItemContainerStyle>-->
<ItemsControl.ItemsPanel >
<ItemsPanelTemplate >
<UniformGrid Rows="1" />
+54 -50
View File
@@ -6,6 +6,7 @@ Imports EgtUILib
Public Class AssemblyPageVM
Implements INotifyPropertyChanged
' copia del riferimento all'assemblato corrente
Public ReadOnly Property CurrAssembly As Assembly
Get
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
@@ -16,11 +17,12 @@ Public Class AssemblyPageVM
End Get
End Property
' Definizione comando
' Definizione comandi
Private m_CmdJambBtn As ICommand
Private m_EnterRefreshCmd As ICommand
Private m_CmdOrderBtn As ICommand
' Costruttore
Sub New()
Map.SetRefJambPageVM(Me)
End Sub
@@ -169,16 +171,30 @@ Public Class AssemblyPageVM
End Get
End Property
Public ReadOnly Property DimensionMsg As String
Get
Return "Dimension"
End Get
End Property
Public ReadOnly Property TotalHeightMsg As String
Get
Return "Height"
End Get
End Property
Public ReadOnly Property TotalWidthMsg As String
Get
Return "Width"
End Get
End Property
#End Region
#Region "COMMANDS"
#Region "PARTBtn"
#Region "JambBtnCommand"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property JambBtnCommand As ICommand
Get
If m_CmdJambBtn Is Nothing Then
@@ -188,10 +204,6 @@ Public Class AssemblyPageVM
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
'''
Private bLoadSwing As Boolean = False
Public Sub JambBtn(param As Object)
' il parametro param arriva direttamente dal Jamb del bottone, quindi è gia scritto nella forma FL_ (le porte no! sono passate da binding)
@@ -199,47 +211,23 @@ Public Class AssemblyPageVM
' In questa fase manca la gestione degli swing dei Jamb
Select Case SelectPart
Case ConstGen.PART_FRAME_LEFT
DdfFile.WriteDDFPart(CurrAssembly.LeftJamb, IniFile.m_sTempDir & "\" & TEMP_FILE, True, False)
ExecDoors(Map.refSceneManagerVM.ProjectScene, IniFile.m_sTempDir & "\" & TEMP_FILE)
Map.refPartPageVM.CurrPart = CurrAssembly.LeftJamb
Map.refCompoPanelVM.IsVisible = Visibility.Hidden
Map.refPartPageVM.IsRaedOnly = True
LoadSelectedPartDoor(ConstGen.PART_FRAME_LEFT, Visibility.Hidden, True)
Case ConstGen.PART_FRAME_RIGHT
DdfFile.WriteDDFPart(CurrAssembly.RightJamb, IniFile.m_sTempDir & "\" & TEMP_FILE, True, False)
ExecDoors(Map.refSceneManagerVM.ProjectScene, IniFile.m_sTempDir & "\" & TEMP_FILE)
Map.refPartPageVM.CurrPart = CurrAssembly.RightJamb
Map.refCompoPanelVM.IsVisible = Visibility.Hidden
Map.refPartPageVM.IsRaedOnly = True
LoadSelectedPartDoor(ConstGen.PART_FRAME_RIGHT, Visibility.Hidden, False)
Case ConstGen.PART_FRAME_TOP
DdfFile.WriteDDFPart(CurrAssembly.TopJamb, IniFile.m_sTempDir & "\" & TEMP_FILE, True, False)
ExecDoors(Map.refSceneManagerVM.ProjectScene, IniFile.m_sTempDir & "\" & TEMP_FILE)
Map.refPartPageVM.CurrPart = CurrAssembly.TopJamb
Map.refCompoPanelVM.IsVisible = Visibility.Hidden
Map.refPartPageVM.IsRaedOnly = True
LoadSelectedPartDoor(ConstGen.PART_FRAME_TOP, Visibility.Hidden, False)
Case ConstGen.PART_FRAME_BOTTOM
DdfFile.WriteDDFPart(CurrAssembly.BottomJamb, IniFile.m_sTempDir & "\" & TEMP_FILE, True, False)
ExecDoors(Map.refSceneManagerVM.ProjectScene, IniFile.m_sTempDir & "\" & TEMP_FILE)
Map.refPartPageVM.CurrPart = CurrAssembly.BottomJamb
Map.refCompoPanelVM.IsVisible = Visibility.Hidden
Map.refPartPageVM.IsRaedOnly = True
LoadSelectedPartDoor(ConstGen.PART_FRAME_TOP, Visibility.Hidden, False)
Case Else
' scelta della porta
DdfFile.WriteDDFPart(SelectDoor(SelectPart), IniFile.m_sTempDir & "\" & TEMP_FILE, True, False)
ExecDoors(Map.refSceneManagerVM.ProjectScene, IniFile.m_sTempDir & "\" & TEMP_FILE)
Map.refPartPageVM.CurrPart = SelectDoor(SelectPart)
bLoadSwing = False
Map.refCompoPanelVM.IsVisible = Visibility.Visible
Map.refPartPageVM.IsRaedOnly = False
LoadSelectedPartDoor(SelectPart, Visibility.Visible, False)
End Select
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nDDFPage
End Sub
#End Region ' CompoBtnCommand
#End Region ' PartBtn
#Region "REFRESH"
''' <summary>
''' Returns a command that do New.
''' </summary>
Public ReadOnly Property RefreshCmd As ICommand
Get
If m_EnterRefreshCmd Is Nothing Then
@@ -253,6 +241,10 @@ Public Class AssemblyPageVM
Map.refSceneManagerVM.RefreshBtn()
End Sub
#End Region ' Refresh
#Region "ORDER"
Public ReadOnly Property OrderCmd As ICommand
Get
If m_CmdOrderBtn Is Nothing Then
@@ -267,23 +259,35 @@ Public Class AssemblyPageVM
OrderWnd.ShowDialog()
End Sub
#End Region ' Order
#End Region ' Comand
#Region "METHODS"
' letto il nome della porta restituisce l'oggetto correttamente selezionato dal vettore delle porte
Private Function SelectDoor(NamePart As String) As Part
Dim Index As Integer
Dim ref_Part As Part = Nothing
For Index = 0 To CInt(CurrAssembly.DoorNumber) - 1
If CurrAssembly.GetArrayPartDoor(Index).Type = NamePart Then
ref_Part = CurrAssembly.GetArrayPartDoor(Index).Door
' ricevuto il nome dell'oggetto di tipo Part restituisce il PartDoor che lo contiene
Public Function ReserchPartDoor(TypePart As String) As PartDoor
Dim PD As PartDoor = Nothing
For IndexPartDoor As Integer = 0 To CurrAssembly.ListPartDoor.Count - 1
If CurrAssembly.ListPartDoor(IndexPartDoor).Door.TypePart.Contains(TypePart) Then
PD = CurrAssembly.ListPartDoor(IndexPartDoor)
Exit For
End If
Next
Return ref_Part
Return PD
End Function
' carica a video l'ogetto di cui è passato il nome (TypePart)
Private Sub LoadSelectedPartDoor(TypePart As String, CompoPanelVisibility As Visibility, PartPageIsReadOnly As Boolean)
Dim Local_PD As PartDoor = ReserchPartDoor(TypePart)
If IsNothing(Local_PD) Then Return
DdfFile.WriteDDFPart(Local_PD.Door, IniFile.m_sTempDir & "\" & TEMP_FILE, True, False)
ExecDoors(Map.refSceneManagerVM.ProjectScene, IniFile.m_sTempDir & "\" & TEMP_FILE)
Map.refPartPageVM.CurrPart = Local_PD.Door
Map.refCompoPanelVM.IsVisible = CompoPanelVisibility
Map.refPartPageVM.IsRaedOnly = PartPageIsReadOnly
End Sub
#End Region ' Methods
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
+34
View File
@@ -0,0 +1,34 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Public Class Association
Inherits VMBase
Private m_Side As Integer
Public Property Side As Integer
Get
Return m_Side
End Get
Set(value As Integer)
m_Side = value
End Set
End Property
'
Private m_refPartDoor As PartDoor
Public Property refPartDoor As PartDoor
Get
Return m_refPartDoor
End Get
Set(value As PartDoor)
m_refPartDoor = value
End Set
End Property
Sub New(ref_PartDoor As PartDoor, ref_nSide As Integer)
m_refPartDoor = ref_PartDoor
Side = ref_nSide
End Sub
End Class
+15 -7
View File
@@ -1,7 +1,11 @@
Imports System.ComponentModel
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Public Class PartDoor
Implements INotifyPropertyChanged
Inherits VMBase
Private m_Door As Part
Public Property Door As Part
@@ -13,6 +17,16 @@ Public Class PartDoor
End Set
End Property
Private m_ListAssociation As New ObservableCollection(Of Association)
Public Property ListAssociation As ObservableCollection(Of Association)
Get
Return m_ListAssociation
End Get
Set(value As ObservableCollection(Of Association))
m_ListAssociation = value
End Set
End Property
Private m_IsChecked As Boolean
Public Property IsChecked As Boolean
Get
@@ -46,10 +60,4 @@ Public Class PartDoor
End Get
End Property
Public Event PropertyChanged(sender As Object, e As PropertyChangedEventArgs) Implements INotifyPropertyChanged.PropertyChanged
Public Sub NotifyPropertyChanged(propName As String)
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
End Sub
End Class
+414 -123
View File
@@ -58,10 +58,11 @@ Public Class AssemblyManagerVM
m_CurrProject.SelAssemblyName.SelAssembly = CreateNewAssembly(CurrProject.SelAssemblyName.Name)
If OptionModule.m_ConfigurationSoftware = ConfigType.Door Then
' 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)
NewAssName.SelAssembly.ListPartDoor(0).Door.SwingTypeList = OptionModule.m_SwingTypeList
NewAssName.SelAssembly.ListPartDoor(0).Door.SetSwing(OptionModule.m_Swing)
DdfFile.WriteDDFPart(NewAssName.SelAssembly.ListPartDoor(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
Map.refPartPageVM.CurrPart = NewAssName.SelAssembly.ListPartDoor(0).Door
' aggiorno elenco quotature
Map.refDimensioningPanelVM.LoadHardwareDimList()
ExecDoors(Map.refSceneManagerVM.ProjectScene, sTempFile, False)
@@ -80,7 +81,7 @@ Public Class AssemblyManagerVM
If IsNothing(SavedAssName) Then Return False
' Salvo
If OptionModule.m_ConfigurationSoftware = ConfigType.Door Then
DdfFile.WriteDDFPart(SavedAssName.SelAssembly.GetArrayPartDoor(0).Door, SavedAssName.Name, True, False)
DdfFile.WriteDDFPart(SavedAssName.SelAssembly.ListPartDoorOfDoor(0).Door, SavedAssName.Name, True, False)
Else
DdfFile.WriteDDFAssembly(SavedAssName.SelAssembly, SavedAssName.Name, True)
End If
@@ -98,7 +99,7 @@ Public Class AssemblyManagerVM
' resetto errori sui bevel edge
Part.FirstReadingEdge = False
' leggo il ddf e creo relativo assemblato
OpenedAssName.SelAssembly = CreateNewAssembly(OpenedAssName.Name)
OpenedAssName.SelAssembly = New Assembly
Assembly.ReadDDFAssembly(OpenedAssName.Name, OpenedAssName.SelAssembly)
' definisco e rimuovo file temporaneo di assemblato
Dim sTempFile As String = IniFile.m_sTempDir & "\" & TEMP_FILE
@@ -110,7 +111,7 @@ Public Class AssemblyManagerVM
If IsNothing(OpenedAssName.SelAssembly) Then Return False
OpenedAssName.IsModified = Part.FirstReadingEdge
If OptionModule.m_ConfigurationSoftware = ConfigType.Door Then
DdfFile.WriteDDFPart(OpenedAssName.SelAssembly.GetArrayPartDoor(0).Door, sTempFile, True, False)
DdfFile.WriteDDFPart(OpenedAssName.SelAssembly.ListPartDoor(0).Door, sTempFile, True, False)
' aggiorno elenco quotature
Map.refDimensioningPanelVM.LoadHardwareDimList()
ExecDoors(Map.refSceneManagerVM.ProjectScene, sTempFile, False)
@@ -195,119 +196,229 @@ Public Class AssemblyManagerVM
#Region "Creazione e caricamento degli oggetti dell'assemblato"
' Caricamento dei dati della pagina generale degli assemblati
' creazione e di un nuovo assemblato
Friend Function CreateNewAssembly(value As String) As Assembly
' costruisco un nuvo assemblato e lo carico con i valori
Dim Local_SelAssembly As New Assembly
Local_SelAssembly.SetExterior(OptionModule.m_Exterior)
Local_SelAssembly.DoorListNumber = OptionModule.m_DoorsListNumber
' Carico tutti i vettori in sola lettura (i metodi set non contengono nessuna operazione)
Local_SelAssembly.SetThickness(OptionModule.m_ThicknessJamb)
Local_SelAssembly.SetWidth(OptionModule.m_WidthJamb)
Local_SelAssembly.SetLightUp(OptionModule.m_LightUp)
Local_SelAssembly.SetLightLock(OptionModule.m_LightLock)
Local_SelAssembly.SetLightBottom(OptionModule.m_LightBottom)
Local_SelAssembly.SetLightHinge(OptionModule.m_LightHinge)
Local_SelAssembly.SetThicknessHead(OptionModule.m_ThicknessHead)
Local_SelAssembly.SetOverlapHinge(OptionModule.m_OverlapHinge)
Local_SelAssembly.SetOverlapLock(OptionModule.m_OverlapLock)
Local_SelAssembly.SetOverlapTop(OptionModule.m_OverlapTop)
Local_SelAssembly.SetDeltaThickness(OptionModule.m_DeltaThickness)
Local_SelAssembly.SetLockEdgeType(OptionModule.m_LockEdgeTypeAssembly)
Local_SelAssembly.SetHingeEdgeType(OptionModule.m_HingeEdgeTypeAssembly)
Local_SelAssembly.SetTopType(OptionModule.m_TopTypeAssembly)
Local_SelAssembly.SetBottomType(OptionModule.m_BottomTypeAssembly)
Local_SelAssembly.SetLockEdgeMachining(OptionModule.m_LockEdgeMachiningAssembly)
Local_SelAssembly.SetHingeEdgeMachining(OptionModule.m_HingeEdgeMachiningAssembly)
Local_SelAssembly.SetTopMachining(OptionModule.m_TopMachiningAssembly)
Local_SelAssembly.SetBottomMachining(OptionModule.m_BottomMachiningAssembly)
Local_SelAssembly.SetLockEdgeOverMaterial(OptionModule.m_LockEdgeOverMaterialAssembly)
Local_SelAssembly.SetHingeEdgeOverMaterial(OptionModule.m_HingeEdgeOverMaterialAssembly)
Local_SelAssembly.SetTopOverMaterial(OptionModule.m_TopOverMaterialAssembly)
Local_SelAssembly.SetBottomOverMaterial(OptionModule.m_BottomOverMaterialAssembly)
Local_SelAssembly.SetDoorNumber(OptionModule.m_DoorsNumber)
Local_SelAssembly.SetDispositionItem(OptionModule.m_Disposition)
' riaggiorno la lista dei bevel con quello che è stato settato nel Confi.ini
'Part.RebuiltDispositionList()
' carico i valori di default dell'assemblato
LoadAssemblyInformation(Local_SelAssembly)
' costruisco e carico le parti (Jamb)
CreatePart(Local_SelAssembly)
CreateJamb(Local_SelAssembly)
' carico le info comuni a tutti i jamb
LoadOM_M_ET(Local_SelAssembly)
' carico il numero massimo di porte ammesse (e intanto dimesiono i jamb)
CreateDoor(Local_SelAssembly)
' carico come progetto corrente l'assemblato che sto creando in locale (così da poter gestire i Jamb), l'array delle porte è ancora vuoto!
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()
'Local_SelAssembly.SetNewDimensionAssembly()
' eseguo il rabbet sui jamb
'Local_SelAssembly.TopRabbetJamb()
'Local_SelAssembly.HingeRabbetJamb()
' costruisco le associazioni tra i pezzi
CreateAssociation(Local_SelAssembly)
' carico le dimensioni dell'assemblato
Local_SelAssembly.SetNewDimensionAssembly()
Return Local_SelAssembly
End Function
' creazione dei jamb
Private Sub CreatePart(ByRef CurrAssembly As Assembly)
CurrAssembly.LeftJamb = New Part
CurrAssembly.LeftJamb.TypePart = ConstGen.PART_FRAME_LEFT
CurrAssembly.LeftJamb.SetThickness(CurrAssembly.Thickness)
CurrAssembly.LeftJamb.SetWidth(CurrAssembly.Width)
CurrAssembly.LeftJamb.SwingTypeList = OptionModule.m_SwingTypeList
CurrAssembly.LeftJamb.IsActive = OptionModule.m_LeftJambChk
CurrAssembly.LeftJamb.SetDispositionItem(OptionModule.m_Disposition)
CurrAssembly.RightJamb = New Part
CurrAssembly.RightJamb.TypePart = ConstGen.PART_FRAME_RIGHT
CurrAssembly.RightJamb.SetThickness(CurrAssembly.Thickness)
CurrAssembly.RightJamb.SetWidth(CurrAssembly.Width)
CurrAssembly.RightJamb.SwingTypeList = OptionModule.m_SwingTypeList
CurrAssembly.RightJamb.IsActive = OptionModule.m_RightJambChk
CurrAssembly.RightJamb.SetDispositionItem(OptionModule.m_Disposition)
CurrAssembly.TopJamb = New Part
CurrAssembly.TopJamb.TypePart = ConstGen.PART_FRAME_TOP
CurrAssembly.TopJamb.SetThickness(CurrAssembly.Thickness)
CurrAssembly.TopJamb.SetHeight(CurrAssembly.ThicknessHead)
CurrAssembly.TopJamb.SwingTypeList = OptionModule.m_SwingTypeList
CurrAssembly.TopJamb.IsActive = OptionModule.m_TopJambChk
CurrAssembly.TopJamb.SetDispositionItem(OptionModule.m_Disposition)
CurrAssembly.BottomJamb = New Part
CurrAssembly.BottomJamb.TypePart = ConstGen.PART_FRAME_BOTTOM
CurrAssembly.BottomJamb.SetThickness(CurrAssembly.Thickness)
CurrAssembly.BottomJamb.SetHeight(CurrAssembly.Width)
CurrAssembly.BottomJamb.SwingTypeList = OptionModule.m_SwingTypeList
CurrAssembly.BottomJamb.IsActive = OptionModule.m_BottomJambChk
CurrAssembly.BottomJamb.SetDispositionItem(OptionModule.m_Disposition)
' Caricamento dei dati della pagina generale degli assemblati
Public Sub LoadAssemblyInformation(CurrAssembly As Assembly)
' carico tutti le proprietà della classe Assembly
CurrAssembly.SetExterior(OptionModule.m_Exterior)
CurrAssembly.DoorListNumber = OptionModule.m_DoorsListNumber
CurrAssembly.SetThickness(OptionModule.m_ThicknessJamb)
CurrAssembly.SetWidth(OptionModule.m_WidthJamb)
CurrAssembly.SetLightUp(OptionModule.m_LightUp)
CurrAssembly.SetLightLock(OptionModule.m_LightLock)
CurrAssembly.SetLightBottom(OptionModule.m_LightBottom)
CurrAssembly.SetLightHinge(OptionModule.m_LightHinge)
CurrAssembly.SetThicknessHead(OptionModule.m_ThicknessHead)
CurrAssembly.SetOverlapHinge(OptionModule.m_OverlapHinge)
CurrAssembly.SetOverlapLock(OptionModule.m_OverlapLock)
CurrAssembly.SetOverlapTop(OptionModule.m_OverlapTop)
CurrAssembly.SetDeltaThickness(OptionModule.m_DeltaThickness)
CurrAssembly.SetLockEdgeType(OptionModule.m_LockEdgeTypeAssembly)
CurrAssembly.SetHingeEdgeType(OptionModule.m_HingeEdgeTypeAssembly)
CurrAssembly.SetTopType(OptionModule.m_TopTypeAssembly)
CurrAssembly.SetBottomType(OptionModule.m_BottomTypeAssembly)
CurrAssembly.SetLockEdgeMachining(OptionModule.m_LockEdgeMachiningAssembly)
CurrAssembly.SetHingeEdgeMachining(OptionModule.m_HingeEdgeMachiningAssembly)
CurrAssembly.SetTopMachining(OptionModule.m_TopMachiningAssembly)
CurrAssembly.SetBottomMachining(OptionModule.m_BottomMachiningAssembly)
CurrAssembly.SetLockEdgeOverMaterial(OptionModule.m_LockEdgeOverMaterialAssembly)
CurrAssembly.SetHingeEdgeOverMaterial(OptionModule.m_HingeEdgeOverMaterialAssembly)
CurrAssembly.SetTopOverMaterial(OptionModule.m_TopOverMaterialAssembly)
CurrAssembly.SetBottomOverMaterial(OptionModule.m_BottomOverMaterialAssembly)
CurrAssembly.SetDoorNumber(OptionModule.m_DoorsNumber)
CurrAssembly.SetDispositionItem(OptionModule.m_Disposition)
CurrAssembly.SetDimension(OptionModule.m_TotalDimension)
CurrAssembly.SetAssemblyHeight(OptionModule.m_TotalHeight)
CurrAssembly.SetAssemblyWidth(OptionModule.m_TotalWidth)
End Sub
' Caricamento del vettore delle porte, se già ne esiste uno esso viene sovrascritto con nuovi oggetti
Private Sub CreateDoor(ByRef CurrAssembly As Assembly)
Dim ref_PartDoor As PartDoor
Dim ref_Door As Part
For IndexDoor As Integer = 0 To MAX_DOORNUMBER
ref_PartDoor = New PartDoor
ref_Door = New Part
ref_Door.TypePart = ConstGen.PART_DO_ & IndexDoor + 1
LoadDefaultPartOne(ref_Door)
ref_PartDoor.Door = ref_Door
ref_PartDoor.IsChecked = True
' aggiungo la port al vettore che contiene le porte
CurrAssembly.ArrayPartDoor.Add(ref_PartDoor)
' creazione dei jamb
Public Sub CreateJamb(ByRef CurrAssembly As Assembly)
If OptionModule.m_ConfigurationSoftware = ConfigType.Door Then Return
' in questa fase carico separatamete i valori di ogni jamb
' in particolare le differenze tra i jamb sono -> Type, -> le dimensioni (ThicknessHead = Door.Height)
' carico i valori del JambLeft ( solo se è selezionato nella pagina delle impostazioni)
If IsNothing(ReserchPartDoor("FL_")) Then
Dim LeftJamb As New PartDoor
LeftJamb.Door = New Part(LeftJamb)
LeftJamb.Door.TypePart = ConstGen.PART_FRAME_LEFT
LeftJamb.Door.SetThickness(CurrAssembly.Thickness)
LeftJamb.Door.SetWidth(CurrAssembly.Width)
' assegno la lista completa degli swing perchè la selezione dello swing corretto avviene nel programma
LeftJamb.Door.SwingTypeList = OptionModule.m_SwingTypeList
LeftJamb.Door.IsActive = OptionModule.m_LeftJambChk
' definisce la disposizione (da selezionare in una sola anta)
LeftJamb.Door.SetDispositionItem(OptionModule.m_Disposition)
LeftJamb.IsChecked = OptionModule.m_LeftJambChk
CreateNewPropertiesList(LeftJamb.Door.PropertiesList)
' aggiungo alla lista dei PartDoor
CurrAssembly.ListPartDoor.Add(LeftJamb)
End If
If IsNothing(ReserchPartDoor("FR_")) Then
' carico i valori del JambRight
Dim RightJamb As New PartDoor
RightJamb.Door = New Part(RightJamb)
RightJamb.Door.TypePart = ConstGen.PART_FRAME_RIGHT
RightJamb.Door.SetThickness(CurrAssembly.Thickness)
RightJamb.Door.SetWidth(CurrAssembly.Width)
' assegno la lista completa degli swing perchè la selezione dello swing corretto avviene nel programma
RightJamb.Door.SwingTypeList = OptionModule.m_SwingTypeList
RightJamb.Door.IsActive = OptionModule.m_RightJambChk
' definisce la disposizione (da selezionare in una sola anta)
RightJamb.Door.SetDispositionItem(OptionModule.m_Disposition)
RightJamb.IsChecked = OptionModule.m_RightJambChk
CreateNewPropertiesList(RightJamb.Door.PropertiesList)
' aggiungo alla lista dei PartDoor
CurrAssembly.ListPartDoor.Add(RightJamb)
End If
If IsNothing(ReserchPartDoor("FT_")) Then
' carico i valori del JambTop
Dim TopJamb As New PartDoor
TopJamb.Door = New Part(TopJamb)
TopJamb.Door.TypePart = ConstGen.PART_FRAME_TOP
TopJamb.Door.SetThickness(CurrAssembly.Thickness)
TopJamb.Door.SetHeight(CurrAssembly.ThicknessHead)
' assegno la lista completa degli swing perchè la selezione dello swing corretto avviene nel programma
TopJamb.Door.SwingTypeList = OptionModule.m_SwingTypeList
TopJamb.Door.IsActive = OptionModule.m_TopJambChk
' definisce la disposizione (da selezionare in una sola anta)
TopJamb.Door.SetDispositionItem(OptionModule.m_Disposition)
TopJamb.IsChecked = OptionModule.m_TopJambChk
CreateNewPropertiesList(TopJamb.Door.PropertiesList)
CurrAssembly.ListPartDoor.Add(TopJamb)
End If
If IsNothing(ReserchPartDoor("FB_")) AndAlso CurrAssembly.Exterior Then
Dim BottomJamb As New PartDoor
BottomJamb.Door = New Part(BottomJamb)
' carico i valori del JambBottom
BottomJamb.Door.TypePart = ConstGen.PART_FRAME_BOTTOM
BottomJamb.Door.SetThickness(CurrAssembly.Thickness)
BottomJamb.Door.SetHeight(CurrAssembly.Width)
' assegno la lista completa degli swing perchè la selezione dello swing corretto avviene nel programma
BottomJamb.Door.SwingTypeList = OptionModule.m_SwingTypeList
BottomJamb.Door.IsActive = OptionModule.m_BottomJambChk
' definisce la disposizione (da selezionare in una sola anta)
BottomJamb.Door.SetDispositionItem(OptionModule.m_Disposition)
BottomJamb.IsChecked = OptionModule.m_TopJambChk
CreateNewPropertiesList(BottomJamb.Door.PropertiesList)
BottomJamb.IsChecked = True
' aggiungo alla lista dei PartDoor
CurrAssembly.ListPartDoor.Add(BottomJamb)
ElseIf Not IsNothing(ReserchPartDoor("FB_")) AndAlso Not CurrAssembly.Exterior Then
Dim LocalJamb As PartDoor = ReserchPartDoor("FB_")
CurrAssembly.ListPartDoor.RemoveAt(CurrAssembly.ListPartDoor.IndexOf(ReserchPartDoor("FB_")))
LocalJamb = Nothing
End If
' i parametri che non sono ancora stati caricati sono:
' Swing -> dalla porta
' Size -> dalla porta
' OverMaterial -> LoadOM_M_ET
' Machining -> LoadOM_M_ET
' EdgeType -> LoadOM_M_ET
End Sub
' carica i valori di Overmaterial, Machining e EdgeType settati di Default
Public Sub LoadOM_M_ET(CurrAssembly As Assembly)
For IndexPartDoor As Integer = 0 To CurrAssembly.ListPartDoor.Count - 1
Dim Local_Part As Part = CurrAssembly.ListPartDoor(IndexPartDoor).Door
' se gli oggetti esistono gia vengono sempicemente ricaricati
If Local_Part.TypePart.Contains("F") Then
' OverMaterial
Local_Part.TopOverMaterial = CurrAssembly.TopOverMaterial
Local_Part.BottomOverMaterial = CurrAssembly.BottomOverMaterial
Local_Part.HingeEdgeOverMaterial = CurrAssembly.HingeEdgeOverMaterial
Local_Part.LockEdgeOverMaterial = CurrAssembly.LockEdgeOverMaterial
' Machining
Local_Part.TopMachining = CurrAssembly.TopMachining
Local_Part.BottomMachining = CurrAssembly.BottomMachining
Local_Part.HingeEdgeMachining = CurrAssembly.HingeEdgeMachining
Local_Part.LockEdgeMachining = CurrAssembly.LockEdgeMachining
' EdgeType
Local_Part.SetTopType(CurrAssembly.TopType)
Local_Part.SetBottomType(CurrAssembly.BottomType)
Local_Part.SetHingeEdgeType(CurrAssembly.HingeEdgeType)
Local_Part.SetLockEdgeType(CurrAssembly.LockEdgeType)
End If
Next
End Sub
' carica i valori di default negli oggetti appena creati
Public Sub LoadDefaultPartOne(ByRef ref_Part As Part)
'OptionModule.GeneralDoor.CompoList.Clear()
'---------------------------------------------------------------------------------------------------------------
' Date le dimensioni della porta calcoliamo la dimensione dei Jamb
ref_Part.Width = OptionModule.m_Width
ref_Part.Height = OptionModule.m_Height
ref_Part.Thickness = OptionModule.m_Thickness
'---------------------------------------------------------------------------------------------------------------
' i parametri che seguono non influenzano in alcun modo i jamb
ref_Part.SetSwing(OptionModule.m_Swing)
' creazione ante/eliminazione ante
Public Sub CreateDoor(ByRef CurrAssembly As Assembly)
Dim nDoorNumber As Integer
Dim sDN As String = "0"
Int32.TryParse(CurrAssembly.DoorNumber, nDoorNumber)
If nDoorNumber < 1 OrElse nDoorNumber > MAX_DOORNUMBER Then
nDoorNumber = 1
End If
If nDoorNumber > 0 Then sDN = "1"
For IndexDoor As Integer = 0 To nDoorNumber - 1
Dim Type As String = ConstGen.PART_DO_ & IndexDoor + 1
If IsNothing(ReserchPartDoor(Type)) Then
Dim Local_PartDoor As New PartDoor
Local_PartDoor.Door = New Part(Local_PartDoor)
Local_PartDoor.Door.TypePart = Type
' non viene caricato lo swing, che è carciato al termine del ciclo for
LoadDefaultSingleDoor(Local_PartDoor.Door, CStr(nDoorNumber))
Local_PartDoor.IsChecked = True
CreateNewPropertiesList(Local_PartDoor.Door.PropertiesList)
CurrAssembly.ListPartDoor.Add(Local_PartDoor)
End If
Next
' eliminazione porta
If nDoorNumber < CurrAssembly.ListPartDoorOfDoor.Count Then
If Not IsNothing(ReserchPartDoor("DO_2")) Then
Dim LocalPartDorr As PartDoor = ReserchPartDoor("DO_2")
For IndexPartDoor As Integer = 1 To CurrAssembly.ListPartDoor.Count - 1
If CurrAssembly.ListPartDoor(IndexPartDoor).Type = "DO_2" Then
CurrAssembly.ListPartDoor.RemoveAt(IndexPartDoor)
Exit For
End If
Next
LocalPartDorr.Door = Nothing
LocalPartDorr = Nothing
' aggiorno la lista delle ante
CurrAssembly.NotifyPropertyChanged("ListPartDoorOfDoor")
' devo eliminare tutti riferiemnti che possono esistere
CreateAssociation(CurrAssembly)
End If
End If
' carica la lista degli swing
For Each ItemPartDoor In CurrAssembly.ListPartDoorOfDoor
SetSwingOnDoor(CurrAssembly.DoorNumber, ItemPartDoor.Door)
Next
CurrAssembly.NotifyPropertyChanged("ListPartDoorOfDoor")
End Sub
' carica i valori di default (dell'option page) nella prima porta
Public Sub LoadDefaultSingleDoor(ByRef ref_Part As Part, Optional ByVal sDN As String = "0")
ref_Part.SetWidth(OptionModule.m_Width)
ref_Part.SetHeight(OptionModule.m_Height)
ref_Part.SetThickness(OptionModule.m_Thickness)
ref_Part.IsActive = False
ref_Part.Measure = ConvertMmUnitsToString(OptionModule.m_bIsMmUnit)
ref_Part.Weight = OptionModule.m_Weight
@@ -324,10 +435,185 @@ Public Class AssemblyManagerVM
ref_Part.TopOverMaterial = OptionModule.m_TopOverMaterial
ref_Part.BottomOverMaterial = OptionModule.m_BottomOverMaterial
ref_Part.SetDispositionItem(OptionModule.m_Disposition)
' riaggiorno la lista dei bevel con quello che è stato settato nel Confi.ini
'Part.RebuiltDispositionList()
End Sub
' carica la lista degli swing a seconda del numero di porte selezionato
Public Sub SetSwingOnDoor(sDN As String, ByRef CurrPart As Part)
Select Case sDN
Case "1"
CurrPart.SwingTypeList = OptionModule.m_SwingTypeListSinlgeDoor
CurrPart.SetSwing(OptionModule.m_Swing)
Case "2"
If CurrPart.TypePart.Contains("DO_1") Then
CurrPart.SwingTypeList = OptionModule.m_SwingTypeListLeftDoor
CurrPart.SetSwing(CurrPart.SwingTypeList(0))
End If
If CurrPart.TypePart.Contains("DO_2") Then
CurrPart.SwingTypeList = OptionModule.m_SwingTypeListRightDoor
CurrPart.SetSwing(CurrPart.SwingTypeList(0))
End If
Case Else
CurrPart.SwingTypeList = OptionModule.m_SwingTypeList
CurrPart.SetSwing(OptionModule.m_Swing)
End Select
End Sub
#Region "ASSOCIATION"
' questa è la funzione principale che esegue l'aggiunta/aggiornamento dei riferimenti
' per tutti gli oggetti presenti nell'assemblato viene costruito il riferimento
Public Function CreateAssociation(ByRef CurrAssembly As Assembly) As Boolean
Dim TypePart As String = String.Empty
Dim LocalPd As PartDoor = Nothing
Dim nDN As Integer
Int32.TryParse(CurrAssembly.DoorNumber, nDN)
' ripulisco elimino le assiciazioni che non esisto più ( se elimino un'anta ricostruisco le giuste associazioni)
CleanAssociation()
For Each ItemPartDoor In CurrAssembly.ListPartDoor
' se l'oggetto che ricevo è di tipo Frame ripulisco il nome del tipo per ottenre le forma "FL", "FR", "FB", FT
If ItemPartDoor.Type.Contains("F") Then
TypePart = ItemPartDoor.Type.Remove(ItemPartDoor.Type.LastIndexOf("_"c))
Else
TypePart = ItemPartDoor.Type
End If
Select Case TypePart
Case "FL"
LocalPd = ReserchPartDoor("DO_1")
BuildAssociation(ItemPartDoor, LocalPd, 100)
LocalPd = ReserchPartDoor("FT_")
BuildAssociation(ItemPartDoor, LocalPd, 200)
LocalPd = ReserchPartDoor("FB_")
BuildAssociation(ItemPartDoor, LocalPd, 400)
Case "FR"
If nDN = 1 Then
LocalPd = ReserchPartDoor("DO_1")
BuildAssociation(ItemPartDoor, LocalPd, 300)
Else
' se esiste elimino la precedente associazione
DeleteAssociation(ReserchPartDoor("DO_1"), ItemPartDoor)
LocalPd = ReserchPartDoor("DO_2")
BuildAssociation(ItemPartDoor, LocalPd, 300)
End If
LocalPd = ReserchPartDoor("FT_")
BuildAssociation(ItemPartDoor, LocalPd, 200)
LocalPd = ReserchPartDoor("FB_")
BuildAssociation(ItemPartDoor, LocalPd, 400)
Case "FT"
LocalPd = ReserchPartDoor("DO_1")
BuildAssociation(ItemPartDoor, LocalPd, 400)
LocalPd = ReserchPartDoor("DO_2")
BuildAssociation(ItemPartDoor, LocalPd, 400)
LocalPd = ReserchPartDoor("FL_")
BuildAssociation(ItemPartDoor, LocalPd, 400)
LocalPd = ReserchPartDoor("FR_")
BuildAssociation(ItemPartDoor, LocalPd, 400)
Case "FB"
LocalPd = ReserchPartDoor("DO_1")
BuildAssociation(ItemPartDoor, LocalPd, 200)
LocalPd = ReserchPartDoor("DO_2")
BuildAssociation(ItemPartDoor, LocalPd, 200)
LocalPd = ReserchPartDoor("FL_")
BuildAssociation(ItemPartDoor, LocalPd, 200)
LocalPd = ReserchPartDoor("FR_")
BuildAssociation(ItemPartDoor, LocalPd, 200)
Case "DO_1"
If nDN = 1 Then
LocalPd = ReserchPartDoor("FR_")
BuildAssociation(ItemPartDoor, LocalPd, 100)
Else
' se esiste elimino la precedente associazione
DeleteAssociation(ReserchPartDoor("FR_"), ItemPartDoor)
LocalPd = ReserchPartDoor("DO_2")
BuildAssociation(ItemPartDoor, LocalPd, 100)
End If
LocalPd = ReserchPartDoor("FL_")
BuildAssociation(ItemPartDoor, LocalPd, 300)
LocalPd = ReserchPartDoor("FT_")
BuildAssociation(ItemPartDoor, LocalPd, 200)
LocalPd = ReserchPartDoor("FB_")
BuildAssociation(ItemPartDoor, LocalPd, 400)
Case "DO_2"
LocalPd = ReserchPartDoor("DO_1")
BuildAssociation(ItemPartDoor, LocalPd, 300)
LocalPd = ReserchPartDoor("FL_")
BuildAssociation(ItemPartDoor, LocalPd, 300)
LocalPd = ReserchPartDoor("FR_")
BuildAssociation(ItemPartDoor, LocalPd, 100)
LocalPd = ReserchPartDoor("FT_")
BuildAssociation(ItemPartDoor, LocalPd, 200)
LocalPd = ReserchPartDoor("FB_")
BuildAssociation(ItemPartDoor, LocalPd, 400)
End Select
Next
Return True
End Function
' in base al tipo (Type) di Part restistuisce il PartDoor associato
Public Function ReserchPartDoor(TypePart As String) As PartDoor
Dim PD As PartDoor = Nothing
If Not IsNothing(Map.refAssemblyPageVM.CurrAssembly) Then
For Each ItemPartDoor In Map.refAssemblyPageVM.CurrAssembly.ListPartDoor
If ItemPartDoor.Type.Contains(TypePart) Then
PD = ItemPartDoor
Exit For
End If
Next
End If
Return PD
End Function
' costruisce (sull'oeggto ItemPD) il riferimento all'ogetto passato (ReserchPD)
Public Function BuildAssociation(ByRef ItemPD As PartDoor, ByRef ReserchPd As PartDoor, nSide As Integer) As Boolean
If IsNothing(ReserchPd) Then Return False
' conto il numero di associazioni presenti sullo stesso lato
Dim CountAssociation As Integer = 0
For Each ItemAssociation In ItemPD.ListAssociation
If ItemAssociation.Side > nSide AndAlso ItemAssociation.Side < nSide + 100 Then
' se l'associazione esiste già allora esco
If ItemAssociation.refPartDoor.Type = ReserchPd.Type Then Return True
CountAssociation = 1 + CountAssociation
End If
Next
' quindi sommo uno (perchè è la nuova associazione)
CountAssociation = 1 + CountAssociation
Dim NewAssociation1 As New Association(ReserchPd, nSide + CountAssociation)
ItemPD.ListAssociation.Add(NewAssociation1)
Return True
End Function
' elimina le associazioni che hanno riferimenti nulli
Public Sub CleanAssociation()
If IsNothing(Map.refAssemblyPageVM) AndAlso IsNothing(Map.refAssemblyPageVM.CurrAssembly) Then Return
For Each ItemPartDoor In Map.refAssemblyPageVM.CurrAssembly.ListPartDoor
Dim ListIndexToRemove As New List(Of Integer)
' raccolgo l'elenco degli indici da eliminare
For IndexAssociation As Integer = 0 To ItemPartDoor.ListAssociation.Count - 1
If IsNothing(ItemPartDoor.ListAssociation(IndexAssociation).refPartDoor.Door) Then
ListIndexToRemove.Add(IndexAssociation)
End If
Next
' rimuovo dalla lista precedentemente analizzata
For Each ItemIndex In ListIndexToRemove
ItemPartDoor.ListAssociation.RemoveAt(ItemIndex)
Next
Next
End Sub
' elimina il PartDoor (DeletingAssication) dalla lista delle associazioni di un altro PartDoor (CurrPartDoor)
Public Sub DeleteAssociation(DeletingAssication As PartDoor, CurrPartDoor As PartDoor)
If Not IsNothing(DeletingAssication) Then
For Each ItemAssociated In CurrPartDoor.ListAssociation
If DeletingAssication.Type = ItemAssociated.refPartDoor.Type Then
CurrPartDoor.ListAssociation.RemoveAt(CurrPartDoor.ListAssociation.IndexOf(ItemAssociated))
Return
End If
Next
End If
End Sub
#End Region ' Association
#End Region ' Creazione e caricamento degli oggetti dell'assemblato
#End Region ' METHODS
@@ -352,17 +638,19 @@ Public Class AssemblyManagerVM
' CHIEDO SE SI VUOLE IMPORTARE UN TEMPLATE
'Prima di tutto chiedo se vuole aprire un template
Dim ImportTemplate As String = String.Empty
If MessageBox.Show(EgtMsg(50146), EgtMsg(50110), MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes) = MessageBoxResult.Yes Then
' Apro la finestra di dialogo aperta direttamente sulla cartella cercata
Dim OpenFileDialog As New Microsoft.Win32.OpenFileDialog() With {
.InitialDirectory = IniFile.m_TemplateDir
}
If OpenFileDialog.ShowDialog() <> True Then
' se la risposta è diversa da OK esce
Return
If Not OptionModule.m_DisableTemplate Then
If MessageBox.Show(EgtMsg(50146), EgtMsg(50110), MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes) = MessageBoxResult.Yes Then
' Apro la finestra di dialogo aperta direttamente sulla cartella cercata
Dim OpenFileDialog As New Microsoft.Win32.OpenFileDialog() With {
.InitialDirectory = IniFile.m_TemplateDir
}
If OpenFileDialog.ShowDialog() <> True Then
' se la risposta è diversa da OK esce
Return
End If
' carico l'indirizzo del template che voglio aprire
ImportTemplate = OpenFileDialog.FileName
End If
' carico l'indirizzo del template che voglio aprire
ImportTemplate = OpenFileDialog.FileName
End If
'----------------------------------------------------------------------------------------------------------------------------------------------------
' Creo nuovo assembly
@@ -422,7 +710,8 @@ Public Class AssemblyManagerVM
' LETTURA DI UN FILE DI TIPO TEMPLATE
If Not String.IsNullOrEmpty(ImportTemplate) Then
' creo il file ddf associato al template
m_CurrProject.SelAssemblyName.SelAssembly = CreateNewAssembly(ImportTemplate)
'm_CurrProject.SelAssemblyName.SelAssembly = CreateNewAssembly(ImportTemplate)
m_CurrProject.SelAssemblyName.SelAssembly = New Assembly
Assembly.ReadDDFAssembly(ImportTemplate, m_CurrProject.SelAssemblyName.SelAssembly)
Dim sTempFile As String = IniFile.m_sTempDir & "\" & TEMP_FILE
Try
@@ -431,10 +720,10 @@ Public Class AssemblyManagerVM
End Try
If OptionModule.m_ConfigurationSoftware = ConfigType.Door Then
DdfFile.WriteDDFPart(m_CurrProject.SelAssemblyName.SelAssembly.GetArrayPartDoor(0).Door, m_CurrProject.SelAssemblyName.Name, False, False)
DdfFile.WriteDDFPart(m_CurrProject.SelAssemblyName.SelAssembly.GetArrayPartDoor(0).Door, m_CurrProject.SelAssemblyName.Name, True, False)
DdfFile.WriteDDFPart(m_CurrProject.SelAssemblyName.SelAssembly.ListPartDoorOfDoor(0).Door, m_CurrProject.SelAssemblyName.Name, False, False)
DdfFile.WriteDDFPart(m_CurrProject.SelAssemblyName.SelAssembly.ListPartDoorOfDoor(0).Door, m_CurrProject.SelAssemblyName.Name, True, False)
' Va salvato ancora con i parametri perchè sotto viene riletto e ci devono ancora essere i parametri
DdfFile.WriteDDFPart(m_CurrProject.SelAssemblyName.SelAssembly.GetArrayPartDoor(0).Door, m_CurrProject.SelAssemblyName.Name, False, False)
DdfFile.WriteDDFPart(m_CurrProject.SelAssemblyName.SelAssembly.ListPartDoorOfDoor(0).Door, m_CurrProject.SelAssemblyName.Name, False, False)
' aggiorno elenco quotature
Map.refDimensioningPanelVM.LoadHardwareDimList()
ExecDoors(Map.refSceneManagerVM.ProjectScene, m_CurrProject.SelAssemblyName.Name, False)
@@ -464,8 +753,10 @@ Public Class AssemblyManagerVM
' Creo nuovo assembly
NewCmd(Local_AssemblyName)
' carico il nome come Assemblato selezionato
Dim OrderWindow As New OrderV(Application.Current.MainWindow, New OrderVM())
OrderWindow.ShowDialog()
If Not OptionModule.m_DisableWindowOrder Then
Dim OrderWindow As New OrderV(Application.Current.MainWindow, New OrderVM())
OrderWindow.ShowDialog()
End If
End Sub
#End Region ' AddDoor
+13 -7
View File
@@ -23,7 +23,7 @@ Module CompoMatch
EgtOutLog("Matching error: STU.Matching")
Return False
End If
' Recupero il componente di telaio
' Recupero il componente di telaio, già nello script lua verifico che il nome del file esista, altrimenti restituisco una stringa vuota
EgtLuaGetGlobStringVar("STU.OutTemplate", sFrameTemplate)
EgtLuaResetGlobVar("STU")
Return True
@@ -85,15 +85,21 @@ Module CompoMatch
If Not IsNothing(Map.refPartPageVM.CurrPart) Then
EgtLuaSetGlobStringVar("STU.SelDoor", Map.refPartPageVM.CurrPart.TypePart)
StringToDouble(Map.refPartPageVM.CurrPart.Thickness, dThicknessDoor)
ElseIf CurrAssembly.ArrayPartDoor.Count > 0 Then
StringToDouble(CurrAssembly.GetArrayPartDoor(0).Door.Thickness, dThicknessDoor)
ElseIf CurrAssembly.ListPartDoorOfDoor.Count > 0 Then
StringToDouble(CurrAssembly.ListPartDoorOfDoor(0).Door.Thickness, dThicknessDoor)
End If
EgtLuaSetGlobNumVar("STU.ThicknessDoor", dThicknessDoor)
Dim dDoor1Width As Double
StringToDouble(CurrAssembly.GetArrayPartDoor(0).Door.Width, dDoor1Width)
Dim dDoor1Width As Double = 0.0
'StringToDouble(CurrAssembly.GetArrayPartDoor(0).Door.Width, dDoor1Width)
If Not IsNothing(Map.refAssemblyManagerVM.ReserchPartDoor("DO_1")) Then
StringToDouble(Map.refAssemblyManagerVM.ReserchPartDoor("DO_1").Door.Width, dDoor1Width)
End If
EgtLuaSetGlobNumVar("STU.Door1Width", dDoor1Width)
Dim dDoor2Width As Double
StringToDouble(CurrAssembly.GetArrayPartDoor(1).Door.Width, dDoor2Width)
Dim dDoor2Width As Double = 0.0
'StringToDouble(CurrAssembly.GetArrayPartDoor(1).Door.Width, dDoor2Width)
If Not IsNothing(Map.refAssemblyManagerVM.ReserchPartDoor("DO_2")) Then
StringToDouble(Map.refAssemblyManagerVM.ReserchPartDoor("DO_2").Door.Width, dDoor2Width)
End If
EgtLuaSetGlobNumVar("STU.Door2Width", dDoor2Width)
Return True
End Function
+8 -25
View File
@@ -94,9 +94,6 @@ Public Class CompoPanelVM
#Region "CompoBtnCommand"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property CompoBtnCommand As ICommand
Get
If m_CmdCompoBtn Is Nothing Then
@@ -106,11 +103,6 @@ Public Class CompoPanelVM
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
'''
Public Sub CompoBtn(param As Object)
' distinguo il modo di caricare il i valori a secondo della pagina aperta
If Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nHardwarePage Then
@@ -140,14 +132,16 @@ Public Class CompoPanelVM
m_CurrCompoType.LoadListTemplate()
If Not IsNothing(Map.refPartPageVM.CurrPart) Then
Dim NewCompo As Compo = Map.refPartPageVM.CurrPart.AddNewCompo(m_CurrCompoType)
' aggiorno lista hardware di quotatura
Map.refDimensioningPanelVM.LoadHardwareDimList()
' appena aggiungo una componente nuova calcolo le sue componenti correttamente modificate
If Not IsNothing(NewCompo.refJambCompo) Then
If Not LoadCompoParam(NewCompo, Map.refPartPageVM.CurrPart.TypePart) Then Return
Map.refAssemblyPageVM.CurrAssembly.UpDateCurrCompoJamb(NewCompo)
ResetCompoParam()
End If
'' appena aggiungo una componente nuova calcolo le sue componenti correttamente modificate
'If Not IsNothing(NewCompo.refJambCompo) Then
' If Not LoadCompoParam(NewCompo, Map.refPartPageVM.CurrPart.TypePart) Then Return
' Map.refAssemblyPageVM.CurrAssembly.UpDateCurrCompoJamb(NewCompo)
' ResetCompoParam()
'End If
Map.refAssemblyPageVM.CurrAssembly.CreateCompoOnJamb(NewCompo)
Map.refSceneManagerVM.RefreshBtn()
Else
MessageBox.Show(EgtMsg(50108), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Exclamation)
@@ -160,9 +154,6 @@ Public Class CompoPanelVM
#Region "GoToAssemblyBtnCommand"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property GoToAssemblyBtnCommand As ICommand
Get
If m_CmdGoToAssemblyBtn Is Nothing Then
@@ -172,11 +163,6 @@ Public Class CompoPanelVM
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
'''
Public Sub GoToAssemblyBtn(param As Object)
If OptionModule.m_ConfigurationSoftware = ConfigType.Assembly Then
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nAssemblyPage
@@ -193,9 +179,6 @@ Public Class CompoPanelVM
#Region "ENTERREFRESH"
''' <summary>
''' Returns a command that do Refresh.
''' </summary>
Public ReadOnly Property RefreshCmd As ICommand
Get
If m_EnterRefreshCmd Is Nothing Then
+3
View File
@@ -37,6 +37,7 @@ Module ConstCompo
Public Const S_WEIGHT As String = "pressure"
Public Const S_SWING As String = "swing"
Public Const S_SECURE As String = "secure"
Public Const S_PROPERTIES As String = "properties"
Public Const S_PROFILES As String = "profiles"
Public Const K_LOCKEDGE As String = "lockedge"
Public Const K_HINGEEDGE As String = "hingeedge"
@@ -45,6 +46,8 @@ Module ConstCompo
Public Const K_MACHINING As String = "machining"
Public Const K_OVERMATERIAL As String = "overmaterial"
Public Const K_IDCODECOMPONENT As String = "IdCodeComponent"
Public Const K_RADIUS As String = "radius"
Public Const K_POSX As String = "posx"
' Nome, sezioni e chiavi del file Config.ini
Public Const CONFIGINI_FILE_NAME As String = "Config.ini"
+8
View File
@@ -87,6 +87,9 @@ Module ConstIni
Public Const K_SWING_LIST_INI As String = "SwingList"
Public Const K_SWING_INI As String = "Swing"
Public Const S_PROPERTIES_INI As String = "Properties"
Public Const K_PROPRTIESLIST_INI As String = "PropertiesList"
Public Const S_EDGE As String = "Edge"
Public Const S_EDGEASSEMBLY = "EdgeAssembly"
Public Const K_EDGETYPE_LIST_INI As String = "EdgeTypeList"
@@ -140,6 +143,11 @@ Module ConstIni
Public Const K_DOORSLISTNUMBER As String = "DoorsNumberList"
Public Const K_DOORSELECTEDTNUMBER As String = "DoorsNumberSelected"
Public Const S_TOTALDIMENSION As String = "DimensionAssembly"
Public Const K_STATIC As String = "FixedDimension"
Public Const K_TOTALHEIGHT As String = "Height"
Public Const K_TOTALWIDTH As String = "Width"
Public Const S_PROFILES As String = "profiles"
Public Const S_DOORS_ASSEMBY As String = "doors"
+127 -214
View File
@@ -101,9 +101,12 @@ Friend Module DdfFile
DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "z: " & "0")
ElseIf Part.TypePart = ConstGen.PART_DO_ & "2" Then
' si trova traslata verso destra dello spessore DO_1 sommato a LightLock"
Dim x_DO_1 As Double
Dim x_DO_1 As Double = 0.0
Dim dLightLock As Double
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.Width, x_DO_1)
'StringToDouble(Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.Width, x_DO_1)
If Not IsNothing(Map.refAssemblyManagerVM.ReserchPartDoor("DO_1")) Then
StringToDouble(Map.refAssemblyManagerVM.ReserchPartDoor("DO_1").Door.Width, x_DO_1)
End If
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.LightLock, dLightLock)
Dim x As String = DoubleToString(x_DO_1 + dLightLock, 4)
DdfFileContent.Add("position: ")
@@ -141,6 +144,7 @@ Friend Module DdfFile
Dim dVal As Double = 0
DdfFileContent.Add(ConstCompo.S_SIZE & ":")
If Not StringToDouble(Part.Width, dVal) Then
MessageBox.Show(String.Format(EgtMsg(50141), K_WIDTH), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
Return
@@ -202,7 +206,22 @@ Friend Module DdfFile
Else
DdfFileContent.Add("" & ConstCompo.S_SECURE & ": " & ConstGen.SWING_DOWN)
End If
DdfFileContent.Add("")
'----------------------------------------------------------------------------------------------------------------------------------------------------
' aggiungo le Properties
If Part.PropertiesIsVisible = Visibility.Visible Then
Dim sProperties As String = String.Empty
Dim ItemIndex As Integer
For ItemIndex = 0 To Part.PropertiesList.Count - 1
If Part.PropertiesList(ItemIndex).IsChecked Then
sProperties &= Part.PropertiesList(ItemIndex).Name & ", "
End If
Next
If Not String.IsNullOrEmpty(sProperties) Then
sProperties = sProperties.Remove(sProperties.LastIndexOf(","c))
End If
DdfFileContent.Add("" & ConstCompo.S_PROPERTIES & ": " & sProperties)
End If
DdfFileContent.Add("")
'----------------------------------------------------------------------------------------------------------------------------------------------------
DdfFileContent.Add("" & ConstCompo.S_PROFILES & ":")
@@ -242,6 +261,31 @@ Friend Module DdfFile
DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & Part.TopOverMaterial)
End If
End If
If Part.TopArcIsChecked And (Not IsNothing(Part.Radius) AndAlso Not IsNothing(Part.Posx)) Then
If Not StringToDouble(Part.Radius, dVal) Then
MessageBox.Show(String.Format(EgtMsg(50141), K_RADIUS), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
Return
Else
If bIsDDF Then
DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_RADIUS & ": " & DoubleToString(dVal, 5))
Else
DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_RADIUS & ": " & Part.Radius)
End If
End If
If Not StringToDouble(Part.Posx, dVal) Then
MessageBox.Show(String.Format(EgtMsg(50141), K_POSX), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
Return
Else
If bIsDDF Then
DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_POSX & ": " & DoubleToString(dVal, 5))
Else
DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_POSX & ": " & Part.Posx)
End If
End If
End If
DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_BOTTOM & ": " & SetBevel(Part.TypePart, Part.BottomType.Name, Part.DispositionItem.Name, Part.Swing))
DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.BottomMachining))
If Not StringToDouble(Part.BottomOverMaterial, dVal) Then
@@ -340,58 +384,6 @@ Friend Module DdfFile
' è specificato il tipo significa che abbiamo un assemblato
DdfFileContent.Add("piece: " & Part.TypePart)
DdfFileContent.Add("")
''-------------------------------------------------------------------------------------------------------------------------
'' non ho considerato di fare componento da inserire sui jamb
'' posizionamento porte
'If OptionModule.m_ConfigurationSoftware = ConfigType.Assembly Then
' If Not IsNothing(Part.TypePart) Then
' ' il posizionamento della prima porta sta nell'origine
' If Part.TypePart = "DO_1" Then
' DdfFileContent.Add("position: ")
' DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "x: " & "0")
' DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "y: " & "0")
' DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "z: " & "0")
' ElseIf Part.TypePart = "DO_2" Then
' ' si trova traslata verso destra dello spessore DO_1 sommato a LightLock"
' Dim x_DO_1 As Double
' Dim dLightLock As Double
' StringToDouble(Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.Width, x_DO_1)
' StringToDouble(Map.refAssemblyPageVM.CurrAssembly.LightLock, dLightLock)
' Dim x As String = DoubleToString(x_DO_1 + dLightLock, 4)
' DdfFileContent.Add("position: ")
' DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "x: " & x)
' DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "y: " & "0")
' DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "z: " & "0")
' ' Jamb Sinistro serratura
' ElseIf Part.TypePart.Contains("FL_") Then
' Dim x As String = PositionJamb_X(Part)
' Dim y As String = PositionJamb_Y(Part)
' Dim z As String = PositionJamb_Z(Part)
' DdfFileContent.Add("position: ")
' DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "x: " & x)
' DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "y: " & y)
' DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "z: " & z)
' ElseIf Part.TypePart.Contains("FR_") Then
' DdfFileContent.Add("position: ")
' DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "x: " & PositionJamb_X(Part))
' DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "y: " & PositionJamb_Y(Part))
' DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "z: " & PositionJamb_Z(Part))
' ElseIf Part.TypePart.Contains("FT_") Then
' DdfFileContent.Add("position: ")
' DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "x: " & PositionJamb_X(Part))
' DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "y: " & PositionJamb_Y(Part))
' DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "z: " & PositionJamb_Z(Part))
' ElseIf Part.TypePart.Contains("FB_") Then
' DdfFileContent.Add("position: ")
' DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "x: " & PositionJamb_X(Part))
' DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "y: " & PositionJamb_Y(Part))
' DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "z: " & PositionJamb_Z(Part))
' End If
' DdfFileContent.Add("")
' End If
'End If
''-------------------------------------------------------------------------------------------------------------------------
Dim dVal As Double = 0
Dim sVal As String = String.Empty
@@ -544,6 +536,7 @@ Friend Module DdfFile
End Sub
#Region "Funzioni per il posizionamento"
Private Function PositionJamb_Y(CurrPart As Part) As String
Dim y As String
Dim dLightBottom As Double
@@ -555,7 +548,12 @@ Friend Module DdfFile
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.OverlapTop, dOverlapTop)
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.Width, dThicknessJamb)
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.LightBottom, dLightBottom)
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.Height, dHeightDoor)
'StringToDouble(Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.Height, dHeightDoor)
If Not IsNothing(Map.refAssemblyManagerVM.ReserchPartDoor("DO_1")) Then
StringToDouble(Map.refAssemblyManagerVM.ReserchPartDoor("DO_1").Door.Height, dHeightDoor)
Else
dHeightDoor = 0
End If
If CurrPart.TypePart.Contains(ConstGen.EXTERIOR) Then
If CurrPart.TypePart.Contains(ConstGen.PART_FRAME_TOP) Then
y = DoubleToString(dHeightDoor - dOverlapTop + dLightUp, 4)
@@ -586,8 +584,18 @@ Friend Module DdfFile
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.OverlapLock, dOverlapLock)
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.OverlapHinge, dOverlapHinge)
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.Width, dThicknessJamb)
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.Width, dWidthDoor_0)
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(1).Door.Width, dWidthDoor_1)
' StringToDouble(Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.Width, dWidthDoor_0)
If Not IsNothing(Map.refAssemblyManagerVM.ReserchPartDoor("DO_1")) Then
StringToDouble(Map.refAssemblyManagerVM.ReserchPartDoor("DO_1").Door.Width, dWidthDoor_0)
Else
dWidthDoor_0 = 0
End If
' StringToDouble(Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(1).Door.Width, dWidthDoor_1)
If Not IsNothing(Map.refAssemblyManagerVM.ReserchPartDoor("DO_2")) Then
StringToDouble(Map.refAssemblyManagerVM.ReserchPartDoor("DO_2").Door.Width, dWidthDoor_1)
Else
dWidthDoor_1 = 0
End If
If CurrPart.TypePart.Contains(ConstGen.EXTERIOR) Then
' posizione del Jamb sinistro
If CurrPart.TypePart.Contains("FL_L") Then
@@ -661,7 +669,12 @@ Friend Module DdfFile
If CurrPart.Swing.Contains(ConstGen.HAND_REVERSE) Then
Dim dThicknessDoor As Double
Dim dThicknessJamb As Double
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.Thickness, dThicknessDoor)
' StringToDouble(Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.Thickness, dThicknessDoor)
If Not IsNothing(Map.refAssemblyManagerVM.ReserchPartDoor("DO_1")) Then
StringToDouble(Map.refAssemblyManagerVM.ReserchPartDoor("DO_1").Door.Thickness, dThicknessDoor)
Else
dThicknessDoor = 0
End If
StringToDouble(Map.refAssemblyPageVM.CurrAssembly.Thickness, dThicknessJamb)
z = DoubleToString(-dThicknessJamb + dThicknessDoor + dDeltaThickness, 4)
Else
@@ -687,7 +700,12 @@ Friend Module DdfFile
Case ConstGen.PART_FRAME_BOTTOM
' eseguo un controllo per verifiacre che sia attivo
If Not Map.refAssemblyPageVM.CurrAssembly.Exterior Then
Map.refAssemblyPageVM.CurrAssembly.BottomJamb.SetIsActive(False)
Dim FB As PartDoor = Map.refAssemblyManagerVM.ReserchPartDoor("FB_")
If Not IsNothing(FB) Then
FB.Door.SetIsActive(False)
Else
FB.Door.SetIsActive(True)
End If
End If
Return "Frame Bottom"
Case Else
@@ -912,9 +930,14 @@ Friend Module DdfFile
Next
' inserisco qui il riferimento da stampare (il codice è scelto dalla porta)
If Not IsNothing(Compo.refJambCompo) Then
Compo.IdCode = CStr(IdIndex)
Compo.refJambCompo.IdCode = Compo.IdCode
CompoListDDF.Add(DDF_SPACE5 & "##IdCodeComponent : " & IdIndex)
' se il riferiento è stato stampato prima che si passi da questa pagina allora non posso modificare il valore del riferiento
If Not String.IsNullOrEmpty(Compo.IdCode) AndAlso Compo.refJambCompo.IdCode = Compo.IdCode Then
CompoListDDF.Add(DDF_SPACE5 & "##IdCodeComponent : " & Compo.IdCode)
Else
Compo.IdCode = CStr(IdIndex)
Compo.refJambCompo.IdCode = Compo.IdCode
CompoListDDF.Add(DDF_SPACE5 & "##IdCodeComponent : " & Compo.IdCode)
End If
IdIndex += 1
ElseIf Not String.IsNullOrEmpty(Compo.IdCode) Then
CompoListDDF.Add(DDF_SPACE5 & "##IdCodeComponent : " & Compo.IdCode)
@@ -993,167 +1016,57 @@ Friend Module DdfFile
Dim GeneralAssembly As New List(Of String)
If OptionModule.m_ConfigurationSoftware = ConfigType.Assembly Then
' scrive le informazioni relative all'assembalto
WriteGeneralAssembly(GeneralAssembly, CurrAssembly)
File.WriteAllLines(sPath, GeneralAssembly, Text.Encoding.UTF8)
FirstPart = True
End If
' inizio stampando l'elenco delle porte
Select Case CurrAssembly.DoorNumber
Case "1"
WriteDDFPart(CurrAssembly.GetArrayPartDoor(0).Door, sPath, bIsDDF, FirstPart)
FirstPart = True
If CurrAssembly.ListPartDoor.Count > 1 Then
For IndexPartDoor As Integer = 0 To CurrAssembly.ListPartDoor.Count - 2
WriteDDFPart(CurrAssembly.ListPartDoor(IndexPartDoor).Door, sPath, bIsDDF, FirstPart)
File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
Case "2"
'If Not CurrAssembly.GetArrayPartDoor(0).Door.Swing.Contains("I") Then
WriteDDFPart(CurrAssembly.GetArrayPartDoor(0).Door, sPath, bIsDDF, FirstPart)
FirstPart = True
File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
WriteDDFPart(CurrAssembly.GetArrayPartDoor(1).Door, sPath, bIsDDF, FirstPart)
File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
'Else
' WriteDDFPart(CurrAssembly.GetArrayPartDoor(1).Door, sPath, bIsDDF, FirstPart)
' FirstPart = True
' File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
' WriteDDFPart(CurrAssembly.GetArrayPartDoor(0).Door, sPath, bIsDDF, FirstPart)
' File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
'End If
End Select
WriteDDFPart(CurrAssembly.LeftJamb, sPath, bIsDDF, FirstPart)
File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
WriteDDFPart(CurrAssembly.RightJamb, sPath, bIsDDF, FirstPart)
File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
' il sill è stampato solo se è nella selezione
If CurrAssembly.Exterior Then
WriteDDFPart(CurrAssembly.TopJamb, sPath, bIsDDF, FirstPart)
File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
WriteDDFPart(CurrAssembly.BottomJamb, sPath, bIsDDF, FirstPart)
File.AppendAllLines(sPath, EndAssebly, Text.Encoding.UTF8)
Else
WriteDDFPart(CurrAssembly.TopJamb, sPath, bIsDDF, FirstPart)
File.AppendAllLines(sPath, EndAssebly, Text.Encoding.UTF8)
Next
End If
'------------------------------------------------------------------------------------------------------------------
'' 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))
WriteDDFPart(CurrAssembly.ListPartDoor(CurrAssembly.ListPartDoor.Count - 1).Door, sPath, bIsDDF, FirstPart)
File.AppendAllLines(sPath, EndAssebly, Text.Encoding.UTF8)
'GeneralAssembly.Add("")
'If Not IsNothing(CurrAssembly.DoorNumber) Then
' GeneralAssembly.Add(" " & "doors : " & CurrAssembly.DoorNumber)
'' inizio stampando l'elenco delle porte
'Select Case CurrAssembly.DoorNumber
' Case "1"
' WriteDDFPart(CurrAssembly.GetArrayPartDoor(0).Door, sPath, bIsDDF, FirstPart)
' FirstPart = True
' File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
' Case "2"
' 'If Not CurrAssembly.GetArrayPartDoor(0).Door.Swing.Contains("I") Then
' WriteDDFPart(CurrAssembly.GetArrayPartDoor(0).Door, sPath, bIsDDF, FirstPart)
' FirstPart = True
' File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
' WriteDDFPart(CurrAssembly.GetArrayPartDoor(1).Door, sPath, bIsDDF, FirstPart)
' File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
' 'Else
' ' WriteDDFPart(CurrAssembly.GetArrayPartDoor(1).Door, sPath, bIsDDF, FirstPart)
' ' FirstPart = True
' ' File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
' ' WriteDDFPart(CurrAssembly.GetArrayPartDoor(0).Door, sPath, bIsDDF, FirstPart)
' ' File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
' 'End If
'End Select
'WriteDDFPart(CurrAssembly.LeftJamb, sPath, bIsDDF, FirstPart)
'File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
'WriteDDFPart(CurrAssembly.RightJamb, sPath, bIsDDF, FirstPart)
'File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
'' il sill è stampato solo se è nella selezione
'If CurrAssembly.Exterior Then
' WriteDDFPart(CurrAssembly.TopJamb, sPath, bIsDDF, FirstPart)
' File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
' WriteDDFPart(CurrAssembly.BottomJamb, sPath, bIsDDF, FirstPart)
' File.AppendAllLines(sPath, EndAssebly, Text.Encoding.UTF8)
'Else
' MessageBox.Show(EgtMsg(50106) & "Number of Doors", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
' Return False
' WriteDDFPart(CurrAssembly.TopJamb, sPath, bIsDDF, FirstPart)
' File.AppendAllLines(sPath, EndAssebly, Text.Encoding.UTF8)
'End If
'File.AppendAllLines(sPath, GeneralAssembly, Text.Encoding.UTF8)
Return True
End Function
+91 -173
View File
@@ -30,6 +30,8 @@ Public Class Compo
Dim ErrorList As String = String.Empty
Dim SetCompo As Integer = 0
Private m_ConfigurationParameters As String
Private m_BorderColor As SolidColorBrush = New BrushConverter().ConvertFrom("#DCDCDC")
Public Property BorderColor As SolidColorBrush
Get
@@ -179,9 +181,10 @@ Public Class Compo
End Set
End Property
#Region "Template ComboBox"
#Region "Brand"
' lista dei marchi
Private m_BrandListPart As New ObservableCollection(Of String)
Public Property BrandListPart As ObservableCollection(Of String)
@@ -203,8 +206,13 @@ Public Class Compo
' questa procedura deve essere eseguita SOLO dopo il caricamento della pagina!
m_SelBrandPart = value
For IndexModelList As Integer = 0 To m_BrandListPart.Count - 1
' distinguo il caricamento della lista dei frame
If m_BrandListPart(IndexModelList) = m_SelBrandPart Then
m_FileList = CompoType.FolderList(IndexModelList).ModelFileList
If value.ToLower.Contains(".frame") Then
m_FileList = CompoType.FrameFolderList(IndexModelList).ModelFileList
Else
m_FileList = CompoType.FolderList(IndexModelList).ModelFileList
End If
Exit For
End If
Next
@@ -224,7 +232,11 @@ Public Class Compo
m_SelBrandPart = sSelBrand
For IndexModelList As Integer = 0 To m_BrandListPart.Count - 1
If m_BrandListPart(IndexModelList) = m_SelBrandPart Then
m_FileList = CompoType.FolderList(IndexModelList).ModelFileList
If sSelBrand.ToLower.Contains(".frame") Then
m_FileList = CompoType.FrameFolderList(IndexModelList).ModelFileList
Else
m_FileList = CompoType.FolderList(IndexModelList).ModelFileList
End If
Exit For
End If
Next
@@ -232,6 +244,10 @@ Public Class Compo
NotifyPropertyChanged("SelBrandPart")
End Sub
#End Region ' Brand
#Region "File"
' lista dei file
Private m_FileList As New ObservableCollection(Of String)
Public Property FileList As ObservableCollection(Of String)
@@ -258,6 +274,7 @@ Public Class Compo
Dim CurrItem As String = ModelDir & m_SelFile
' passo il nome
TemplateSelItem = CurrItem
Map.refAssemblyPageVM.CurrAssembly.SetDimension("CreateRefCompo", Me)
NotifyPropertyChanged("SelFile")
End Set
End Property
@@ -272,6 +289,18 @@ Public Class Compo
NotifyPropertyChanged("SelFile")
End Sub
#End Region ' File
Private m_TemplateVisibility As Visibility
Public Property TemplateVisibility As Visibility
Get
Return m_TemplateVisibility
End Get
Set(value As Visibility)
m_TemplateVisibility = value
End Set
End Property
' nome grafica (potrebbe essere shape o template)
Private m_TemplateName As String
Public Property TemplateName As String
@@ -301,17 +330,6 @@ Public Class Compo
End Get
End Property
' lista dei File Template --> usato nella funzione
Private m_TemplateItemList As New ObservableCollection(Of String)
Public Property TemplateItemList As ObservableCollection(Of String)
Get
Return m_TemplateItemList
End Get
Set(value As ObservableCollection(Of String))
m_TemplateItemList = value
End Set
End Property
' Template selezionato
Private m_TemplateSelItem As String
Public Property TemplateSelItem As String
@@ -330,23 +348,35 @@ Public Class Compo
SetModified()
End Sub
' ricevuto il nome scritto nel file ddf viene scomposto per asseganare una parte alla proprietà Brand e una a alla proprietà File
Public Sub SplitBrandFile(TemplateValue As String)
Dim ItemsTemplate() As String = TemplateValue.Split("\"c)
If ItemsTemplate.Count < 1 Then Return
SetSelBrand(Trim(ItemsTemplate(1)))
Dim sFile As String = String.Empty
sFile &= ItemsTemplate(2)
For IndexArray As Integer = 2 To ItemsTemplate.Count - 2
sFile &= "\" & ItemsTemplate(IndexArray)
IndexArray += 1
Next
SetSelFile(sFile)
End Sub
' setta il valore del template
Friend Sub SetTemplateSelItem(value As String)
Dim CurrConfig As String = m_CompoType.Path & "\" & CONFIGINI_FILE_NAME
Dim CurrItemPath As String = m_CompoType.Path & "\" & value
Dim ErrorList As String = String.Empty
Dim ConfigDefault As String = String.Empty
' se il file ha estensione nge
If Path.HasExtension(CurrItemPath) AndAlso Path.GetExtension(CurrItemPath).ToLower = NGE_EXTENSION Then
' controllo che esiste il file altrimenti esco
If Not File.Exists(CurrItemPath) Then Return
m_TemplateSelItem = value
' creo la stringa che contiene la lista degli errori
Dim ParamIndex As Integer = 1
Dim ConfigDefault As String = String.Empty
Dim NewCompoParam As CompoParam = Nothing
EgtUILib.GetPrivateProfileString(S_NGECONFIG, K_DEFAULT, "", ConfigDefault, CurrConfig)
' ricerco la parola chiave Param nella stringa nel file Config.ini
ReadParamConfig(NewCompoParam, ErrorList, ParamIndex, ConfigDefault)
ReadParamConfig(ErrorList, ConfigDefault)
Else
' se il file non ha estensione allora aggiungo l'estensione .lua
If Not Path.GetExtension(CurrItemPath).ToLower = LUA_EXTENSION Then
@@ -357,155 +387,42 @@ Public Class Compo
m_TemplateSelItem = value
' carico un vettore con le stringhe del file corrente
Dim ReadCurrCompo() As String = File.ReadAllLines(CurrItemPath)
Dim EndOfFile As Boolean = False
' leggo il vettore di stringhe del file corrente
For LineIndex = 0 To ReadCurrCompo.Count - 1
' copio il valore della riga
Dim CurrCompoFileLine As String = ReadCurrCompo(LineIndex)
' cerco il titolo [Graphic parameters]: se lo trovo
If RegexFunction.IsGraphicParametersTitle(CurrCompoFileLine) Then
If RegexFunction.IsGraphicParametersTitle(ReadCurrCompo(LineIndex)) Then
' mi preparo per leggere la prima riga dopo il titolo
Dim ParamIndex As Integer = 1
Dim NewCompoParam As CompoParam = Nothing
Dim bIsFinished As Boolean = False
' se la lettura del primo parametro "--Default=" restituisce un valore non nullo
If Not String.IsNullOrWhiteSpace(ParamLine(ReadCurrCompo(LineIndex + ParamIndex), K_DEFAULT)) Then
Dim ConfigDefault As String = Trim(ParamLine(ReadCurrCompo(LineIndex + ParamIndex), K_DEFAULT))
If Not IsNumeric(ConfigDefault) Then
' se il valore letto non è numerico allora esco dal cilo per la lettura dei parametri
Exit For
Else
ReadParamConfig(NewCompoParam, ErrorList, ParamIndex, ConfigDefault)
Exit For
End If
Else
' se il primo parametro non è "Dafault" allora mi aspetto di leggere i parametri
While Not bIsFinished
' attualizzo il componente a nulla
NewCompoParam = Nothing
' cerco nella riga successiva al titolo il primo parametro
If Not String.IsNullOrWhiteSpace(ReadCurrCompo(LineIndex + ParamIndex)) Then
Dim ReadLine As String
' carico i valori della stringa che seguono la chiave "--Param1="
ReadLine = ParamLine(ReadCurrCompo(LineIndex + ParamIndex), K_PARAM & ParamIndex)
' se uno dei paraemtri è completamente sbagliato allora restituisce falso e non riempo la NewCompoParam che rimane Nothing
bIsFinished = Not ReadParam(ReadLine, NewCompoParam, ErrorList)
Else
' altrimenti se la riga è vuota mi sposto alla successiva
LineIndex += 1
' e continuo il ciclo while
Continue While
End If
' insrisco la nuova componenenet: se la riga è vuota o la componente non è stata creata allora il componete è Nothing
InsertCompoParam(NewCompoParam, ParamIndex)
' se il parametro è stato creato passa alla riga successiva
If Not bIsFinished Then ParamIndex += 1
End While
NotifyPropertyChanged("TemplateSelItem")
End If
' esiste già una lista
For DeleteIndex = m_CompoParamList.Count - 1 To ParamIndex - 1 Step -1
m_CompoParamList.RemoveAt(DeleteIndex)
Next
Exit For
ElseIf LineIndex = ReadCurrCompo.Count - 1 Then
' se non trovo il capitoletto nel file leggo i parametri di default del file Config.ini
Dim ParamIndex As Integer = 1
Dim NewCompoParam As CompoParam = Nothing
ReadParamConfig(NewCompoParam, ErrorList, ParamIndex, "")
ConfigDefault = Trim(RegexFunction.ParamLine(ReadCurrCompo(LineIndex + ParamIndex), K_DEFAULT))
While String.IsNullOrEmpty(ConfigDefault) And LineIndex + ParamIndex < ReadCurrCompo(LineIndex + ParamIndex).Count
ParamIndex = +1
ConfigDefault = Trim(RegexFunction.ParamLine(ReadCurrCompo(LineIndex + ParamIndex), K_DEFAULT))
End While
' quando termino il ciclo while posso uscire anche dal for
Exit For
End If
Next
ReadParamConfig(ErrorList, ConfigDefault)
End If
If Not String.IsNullOrWhiteSpace(ErrorList) Then EgtOutLog(ErrorList)
'----------------------------------------------------------------------------------------------------------------------------------------------
If Assembly.BuiltReffCompo Then
Dim FrameCompoFile As String = String.Empty
Dim FrameCompoFileConfig As String = String.Empty
Dim nDoorNbr As Integer = 1
Int32.TryParse(Map.refAssemblyPageVM.CurrAssembly.DoorNumber, nDoorNbr)
If CalcCompoMatching(Me.CompoType.Path, nDoorNbr, Me.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)
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
Dim Side As String = String.Empty
Dim CurrCompoPath As String = FrameCompoFileConfig
' sostituisco il vecchio CompoType con quello corretto
If File.Exists(CurrCompoPath) Then
GetPrivateProfileCompoName(ConstCompo.S_COMPO, ConstCompo.K_NAME, FrameCompoNameDDF, FrameCompoName, CurrCompoPath)
GetPrivateProfileJambSide(S_POSITIONSIDE, K_SIDE, Side, Me.CompoType.Path & "\" & CONFIGINI_FILE_NAME)
If String.IsNullOrEmpty(Side) Then
' controllo nell'elenco dei parametri se esiste un parametro di tipo Side
For IndexParam As Integer = 0 To Me.CompoParamList.Count - 1
If Me.CompoParamList(IndexParam).DDFName.ToLower = K_SIDE.ToLower Then
Side = DirectCast(Me.CompoParamList(IndexParam), ComboBoxParam).SelItem
Exit For
End If
Next
End If
'-------------------------------------------------------------------------------------------------------------------------------
If IsNothing(Me.refJambCompo) Then
Part.CreateRefCompo(Me.CompoType, Me, Map.refAssemblyPageVM.CurrAssembly, FrameCompoFileConfig, FrameCompoFile, Map.refPartPageVM.CurrPart)
If CompoMatch.LoadCompoParam(Me, Map.refPartPageVM.CurrPart.TypePart) Then Map.refAssemblyPageVM.CurrAssembly.UpDateCurrCompoJamb(Me)
For IndexParam As Integer = 0 To Me.refJambCompo.CompoParamList.Count - 1
If Me.refJambCompo.CompoParamList(IndexParam).DDFName.ToLower = K_SIDE.ToLower Then
' assegno alla componente del frame la stessa posizione definita sull'anta
DirectCast(Me.refJambCompo.CompoParamList(IndexParam), ComboBoxParam).SetSelItem(Me.CompoType.JambSide)
Exit For
End If
Next
Return
End If
'-------------------------------------------------------------------------------------------------------------------------------
Me.refJambCompo.CompoType.SetDDFName(FrameCompoNameDDF)
Me.refJambCompo.CompoType.SetName(FrameCompoName)
Dim FrameCompoDirectory As String
FrameCompoDirectory = FrameCompoFileConfig.Remove(FrameCompoFileConfig.LastIndexOf("\"))
Me.refJambCompo.CompoType.SetPath(FrameCompoDirectory)
Me.refJambCompo.CompoType.SetJambSide(Side)
End If
End If
' Carico il nome
FrameCompoFile = FrameCompoFile.Substring(FrameCompoFileConfig.LastIndexOf("\") + 1)
Me.refJambCompo.SetTemplateSelItemRefCompo(FrameCompoFile, Me.refJambCompo)
LoadCompoParam(Me, Map.refPartPageVM.CurrPart.TypePart)
Map.refAssemblyPageVM.CurrAssembly.UpDateCurrCompoJamb(Me)
ResetCompoParam()
Else
If Not IsNothing(Me.refJambCompo) Then
Map.refPartPageVM.CurrPart.RemoveRefCompo(Me.refJambCompo)
Me.refJambCompo = Nothing
End If
End If
End If
End Sub
' setto la lista dei parametri da caricare
Private Sub ReadParamConfig(ByRef NewCompoParam As CompoParam, ByRef ErrorList As String, ParamIndex As Integer, DefaultConfig As String)
'Private Sub ReadParamConfig(ByRef NewCompoParam As CompoParam, ByRef ErrorList As String, ParamIndex As Integer, DefaultConfig As String)
Private Sub ReadParamConfig(ByRef ErrorList As String, DefaultConfig As String)
Dim NewCompoParam As CompoParam = Nothing
Dim ParamIndex As Integer = 1
Dim sParam As String = String.Empty
Dim CurrConfig As String = m_CompoType.Path & "\" & CONFIGINI_FILE_NAME
Dim S_CHAPTER As String
' ripulisco la lista dei parametri sempre!
m_CompoParamList.Clear()
If String.IsNullOrWhiteSpace(DefaultConfig) Then
S_CHAPTER = S_GR_PARAM_DEFAULT & "1"
Else
S_CHAPTER = S_GR_PARAM_DEFAULT & DefaultConfig
End If
' leggo il nome del parametro che serirà a riordinare le quote in fase di stampa
' ripulisco la lista dei parametri sempre!
If m_ConfigurationParameters <> S_CHAPTER Then m_CompoParamList.Clear()
m_ConfigurationParameters = S_CHAPTER
' leggo il nome del parametro che servirà a riordinare le quote in fase di stampa
GetPrivateProfileTidyLayer(S_CHAPTER, K_PARAM_LAYER, m_TidyParam, CurrConfig)
While EgtUILib.GetPrivateProfileString(S_CHAPTER, K_PARAM & ParamIndex, "", sParam, CurrConfig) > 0
If Not String.IsNullOrWhiteSpace(sParam) Then
@@ -538,28 +455,38 @@ Public Class Compo
End Sub
#Region "SettemplateREFCOMPO"
Friend Sub SetTemplateSelItemRefCompo(value As String, CurrRefCompo As Compo)
Dim CurrConfig As String = CurrRefCompo.CompoType.Path & "\" & CONFIGINI_FILE_NAME
Friend Sub SetTemplateSelItemRefCompo(sFrameFile As String, CurrRefCompo As Compo)
' salvo una copia del percorso del direttorio
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
' costruisco il percorso del file Config.ini
Dim CurrConfig As String = CurrItemPath & "\" & CONFIGINI_FILE_NAME
' stringa per gestire gli errori
Dim ErrorList As String = String.Empty
' se il nome del file contiente tutto il suo perscorso (cioè la path del direttorio)
If sFrameFile.Contains(CurrItemPath) Then
' sottraggo al nome del file il percorso del direttorio
sFrameFile = sFrameFile.Substring(CurrItemPath.Count + 1)
CurrItemPath &= "\" & sFrameFile
Else
CurrItemPath &= "\" & sFrameFile
End If
' CurrItemPath -> il nome del percorso completo del file
' sFrameFile -> il nome del file che deve essere stampato nel ddf
' se il file ha estensione nge
If Path.HasExtension(CurrItemPath) AndAlso Path.GetExtension(CurrItemPath).ToLower = NGE_EXTENSION Then
' controllo che esiste il file altrimenti esco
If Not File.Exists(CurrItemPath) Then Return
CurrRefCompo.TemplateSelItem = value
' Possibile errore! sFrame non è il riferiento alla lista m_TemplateItemList
CurrRefCompo.TemplateSelItem = sFrameFile
' creo la stringa che contiene la lista degli errori
Dim ParamIndex As Integer = 1
Dim ConfigDefault As String = String.Empty
Dim NewCompoParam As CompoParam = Nothing
EgtUILib.GetPrivateProfileString(S_NGECONFIG, K_DEFAULT, "", ConfigDefault, CurrConfig)
' ricerco la parola chiave Param nella stringa nel file Cinfig.ini
ReadParamConfig(NewCompoParam, ErrorList, ParamIndex, ConfigDefault)
ReadParamConfig(ErrorList, ConfigDefault)
Else
' se il file non ha estensione allora creo l'estensione .lua
If Not Path.GetExtension(CurrItemPath).ToLower = LUA_EXTENSION Then
@@ -568,7 +495,7 @@ Public Class Compo
' controllo che esiste il file altrimenti esco
If Not File.Exists(CurrItemPath) Then Return
Assembly.BuiltReffCompo = False
CurrRefCompo.TemplateSelItem = value
CurrRefCompo.TemplateSelItem = sFrameFile
' carico un vettore con le stringhe del file corrente
Dim ReadCurrCompo() As String = File.ReadAllLines(CurrItemPath)
Assembly.BuiltReffCompo = True
@@ -590,7 +517,7 @@ Public Class Compo
' se il valore letto non è numerico allora esco dal cilo per la lettura dei parametri
Exit For
Else
ReadParamConfig(NewCompoParam, ErrorList, ParamIndex, ConfigDefault)
ReadParamConfig(ErrorList, ConfigDefault)
Exit For
End If
Else
@@ -680,6 +607,7 @@ Public Class Compo
End If
End If
End Sub
#End Region ' SetTemplateREFCOMPO
' Utilizzo nome DDF e nome, restituisco il nome solo se esiste un messaggio associato
@@ -1397,16 +1325,6 @@ Public Class Compo
Return False
End Function
Private m_TemplateVisibility As Visibility
Public Property TemplateVisibility As Visibility
Get
Return m_TemplateVisibility
End Get
Set(value As Visibility)
m_TemplateVisibility = value
End Set
End Property
#End Region ' Template ComboBox
Private m_TidyParam As String
@@ -1731,10 +1649,10 @@ Public Class ComboBoxParam
Dim CmpPar As CompoParam = Me
Dim IndexP As Integer = CurrCompo.CompoParamList.IndexOf(Me)
' se il nome della combobox è side allora ed esiset un riferimento
If CmpPar.DDFName.ToLower = K_SIDE.ToLower And Not IsNothing(CurrCompo.refJambCompo) Then
' riposiziono la componente dopo averla eliminata dal jamb su cui si trova
Map.refPartPageVM.CurrPart.RemoveRefCompo(CurrCompo.refJambCompo)
If CmpPar.DDFName.ToLower = K_SIDE.ToLower Then
If Not IsNothing(CurrCompo.refJambCompo) Then Map.refPartPageVM.CurrPart.RemoveCompo(CurrCompo, True)
CurrCompo.SetTemplateSelItem(CurrCompo.TemplateSelItem)
Map.refAssemblyPageVM.CurrAssembly.CreateCompoOnJamb(CurrCompo, Trim(m_SelItem))
End If
Map.refSceneManagerVM.RefreshBtn()
End Set
+407 -283
View File
@@ -9,6 +9,16 @@ Public Class Part
' questa variabile è stata definita condovisa per permettere di essere inizializzata alla prima lettura del DDF
Public Shared FirstReadingEdge As Boolean = False
' costruisco il riferimento con l'oggetto PartDoor che ospita il Part
Private m_refPartDoor As PartDoor
Public Property refPartDoor As PartDoor
Get
Return m_refPartDoor
End Get
Set(value As PartDoor)
m_refPartDoor = value
End Set
End Property
#Region "GENERAL"
@@ -166,6 +176,26 @@ Public Class Part
#End Region ' Info generali del ddf
Private m_PropertiesList As New ObservableCollection(Of PropertyItem)
Public Property PropertiesList As ObservableCollection(Of PropertyItem)
Get
Return m_PropertiesList
End Get
Set(value As ObservableCollection(Of PropertyItem))
m_PropertiesList = value
End Set
End Property
Private m_PropertiesIsVisible As Visibility = OptionModule.m_DisableProperties
Public Property PropertiesIsVisible As Visibility
Get
Return m_PropertiesIsVisible
End Get
Set(value As Visibility)
m_PropertiesIsVisible = value
End Set
End Property
#Region "SIZE"
Private m_Height As String
@@ -185,6 +215,7 @@ Public Class Part
'SetVarSize()
UpdateToolTip()
NotifyPropertyChanged("Height")
Map.refAssemblyPageVM.CurrAssembly.SetDimension("Height")
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
@@ -220,6 +251,7 @@ Public Class Part
NotifyPropertyChanged("ToolTipEvaluatedHeight")
'SetVarSize()
UpdateToolTip()
Map.refAssemblyPageVM.CurrAssembly.SetDimension("Width")
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
@@ -255,6 +287,7 @@ Public Class Part
NotifyPropertyChanged("ToolTipEvaluatedHeight")
'SetVarSize()
UpdateToolTip()
Map.refAssemblyPageVM.CurrAssembly.SetDimension("Thickness")
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
@@ -336,7 +369,7 @@ Public Class Part
End Get
Set(value As List(Of String))
m_SwingTypeList = value
NotifyPropertyChanged("SwingTypeList")
'NotifyPropertyChanged("SwingTypeList")
End Set
End Property
@@ -347,13 +380,20 @@ Public Class Part
End Get
Set(value As String)
m_Swing = value
NotifyPropertyChanged("Swing")
Map.refAssemblyPageVM.CurrAssembly.SetDimension("Swing")
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
' aggiorno la grafica
Map.refSceneManagerVM.RefreshBtn()
End Set
End Property
Public Sub SetSwing(sSwing As String)
m_Swing = sSwing
For Each ItemsSwing In m_SwingTypeList
If Trim(ItemsSwing) = Trim(sSwing) Then
m_Swing = ItemsSwing
Exit For
End If
Next
NotifyPropertyChanged("Swing")
End Sub
@@ -525,7 +565,7 @@ Public Class Part
#End Region ' Machining
#Region "OVERLAPMATERIAL"
#Region "OVERMATERIAL"
Public ReadOnly Property ToolTipEvaluatedLockOverMaterial As String
Get
@@ -619,18 +659,49 @@ Public Class Part
End Set
End Property
#End Region ' OverlpaMaterial
#End Region ' OverMaterial
Private m_NewPart As Boolean = True
Public Property NewPart As Boolean
#Region "TOP ARC"
Private m_Radius As String = "W"
Public Property Radius As String
Get
Return m_NewPart
Return m_Radius
End Get
Set(value As Boolean)
m_NewPart = value
Set(value As String)
m_Radius = value
NotifyPropertyChanged("Radius")
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
Private m_Posx As String = "0"
Public Property Posx As String
Get
Return m_Posx
End Get
Set(value As String)
m_Posx = value
NotifyPropertyChanged("Posx")
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
Private m_TopArcIsChecked As Boolean
Public Property TopArcIsChecked As Boolean
Get
Return m_TopArcIsChecked
End Get
Set(value As Boolean)
m_TopArcIsChecked = value
NotifyPropertyChanged("TopArcIsChecked")
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
Map.refSceneManagerVM.RefreshBtn()
End Set
End Property
#End Region ' Top Arc
#End Region ' General
' lista delle componenti
@@ -644,7 +715,7 @@ Public Class Part
End Set
End Property
#Region "ADDCOMPO"
#Region "AddCompo"
' utilizzata nell'Hardware
Friend Function AddNewHardware(HardwareGeneral As CompoType, TempHardwFile As String) As Boolean
@@ -692,9 +763,9 @@ Public Class Part
End Function
'Gestione ComboBox e TextBox di ogni compo della pulsantiera letta da Compo.ini (Door)
Friend Function AddNewCompo(CurrCompoType As CompoType) As Compo
' disabilito la costruzione del riferimento
Assembly.BuiltReffCompo = False
Friend Function AddNewCompo(CurrCompoType As CompoType, Optional IsFrame As Boolean = False) As Compo
'' 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
@@ -714,8 +785,8 @@ Public Class Part
IniFile.GetPrivateProfileCompoName(S_TEMPLATE, K_NAME, DDFName, Name, CurrCompoType.Path & "\" & CONFIGINI_FILE_NAME)
NewCompo.TemplateDDFName = DDFName
NewCompo.TemplateName = Name
LoadBrandFileList(NewCompo)
' se non c'è il template
LoadBrandFileList(NewCompo, IsFrame)
' se il caricamneto fallisse allora NewCompo = Nothing
Else
' nascondo il template
NewCompo.TemplateVisibility = Visibility.Collapsed
@@ -747,10 +818,13 @@ Public Class Part
If NewCompo.CompoType.DDFName = m_CompoList(CompoIndex).CompoType.DDFName Then
' cerco l'ultima componente con lo stesso nome
Dim Lastindex As Integer = 0
Dim PrecCompo As Compo
While CompoIndex + Lastindex < m_CompoList.Count AndAlso NewCompo.CompoType.DDFName = m_CompoList(CompoIndex + Lastindex).CompoType.DDFName
PrecCompo = m_CompoList(CompoIndex + Lastindex)
Lastindex += 1
End While
CompoList.Insert(CompoIndex + Lastindex, NewCompo)
Map.refAssemblyPageVM.CurrAssembly.CopyParam(PrecCompo, NewCompo)
bInsert = True
Exit For
End If
@@ -765,287 +839,43 @@ Public Class Part
NewCompo.BackGroundColor = New BrushConverter().ConvertFrom("#DCDCDC")
NewCompo.BorderThickness = 1
'-----------------------------------------------------------------------------------------------------------------------------------------------
BuiltReferenceCompo(NewCompo)
'If Not IsFrame Then
' BuiltReferenceCompo(NewCompo)
'End If
'-----------------------------------------------------------------------------------------------------------------------------------------------
End If
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
' riabilito la costruzione del riferimnto
Assembly.BuiltReffCompo = True
'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
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 FrameFolderName As String = FOLDERDIR
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
If NewCompo.CompoParamList(IndexParam).DDFName.ToLower = K_SIDE.ToLower Then
Side = DirectCast(NewCompo.CompoParamList(IndexParam), ComboBoxParam).SelItem
Exit For
End If
Next
End If
' ricontrollo che la stringa non sia vuota
If Not String.IsNullOrEmpty(Side) Then
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"
' questo select case serve per gestire la posizione degli hardware sui Jamb
Select Case CurrCompoType.JambSide.ToLower
Case SIDE_HINGE
If CurrAssembly.LeftJamb.Swing.Contains(ConstGen.LOCK) Then
NewCompo.refJambCompo = CurrAssembly.LeftJamb.AddRefCompo(CompoTypeJamb, FrameCompoFile)
NewCompo.refJambCompo.IsReadOnly = True
Else
NewCompo.refJambCompo = CurrAssembly.RightJamb.AddRefCompo(CompoTypeJamb, FrameCompoFile)
NewCompo.refJambCompo.IsReadOnly = True
End If
Case SIDE_LOCK
If CurrAssembly.LeftJamb.Swing.Contains(ConstGen.LOCK) Then
NewCompo.refJambCompo = CurrAssembly.RightJamb.AddRefCompo(CompoTypeJamb, FrameCompoFile)
NewCompo.refJambCompo.IsReadOnly = True
Else
NewCompo.refJambCompo = CurrAssembly.LeftJamb.AddRefCompo(CompoTypeJamb, FrameCompoFile)
NewCompo.refJambCompo.IsReadOnly = True
End If
Case SIDE_TOP
NewCompo.refJambCompo = CurrAssembly.TopJamb.AddRefCompo(CompoTypeJamb, FrameCompoFile)
NewCompo.refJambCompo.IsReadOnly = True
Case SIDE_BOTTOM
NewCompo.refJambCompo = CurrAssembly.BottomJamb.AddRefCompo(CompoTypeJamb, FrameCompoFile)
NewCompo.refJambCompo.IsReadOnly = True
End Select
Case "2"
Select Case CurrCompoType.JambSide.ToLower
Case SIDE_HINGE
If CurrDoor.TypePart = ConstGen.PART_DO_ & "1" Then
NewCompo.refJambCompo = CurrAssembly.LeftJamb.AddRefCompo(CompoTypeJamb, FrameCompoFile)
NewCompo.refJambCompo.IsReadOnly = True
Else
NewCompo.refJambCompo = CurrAssembly.RightJamb.AddRefCompo(CompoTypeJamb, FrameCompoFile)
NewCompo.refJambCompo.IsReadOnly = True
End If
Case SIDE_LOCK
' significa che le componenrti stanno solo sulle porte
If CurrDoor.TypePart = ConstGen.PART_DO_ & "1" And Not CurrDoor.Swing.Contains(ConstGen.INACTIVE) Then
NewCompo.refJambCompo = CurrAssembly.GetArrayPartDoor(1).Door.AddRefCompo(CompoTypeJamb, FrameCompoFile)
NewCompo.refJambCompo.IsReadOnly = True
ElseIf CurrDoor.TypePart = ConstGen.PART_DO_ & "2" And Not CurrDoor.Swing.Contains(ConstGen.INACTIVE) Then
NewCompo.refJambCompo = CurrAssembly.GetArrayPartDoor(0).Door.AddRefCompo(CompoTypeJamb, FrameCompoFile)
NewCompo.refJambCompo.IsReadOnly = True
End If
Case SIDE_TOP
NewCompo.refJambCompo = CurrAssembly.TopJamb.AddRefCompo(CompoTypeJamb, FrameCompoFile)
NewCompo.refJambCompo.IsReadOnly = True
Case SIDE_BOTTOM
NewCompo.refJambCompo = CurrAssembly.BottomJamb.AddRefCompo(CompoTypeJamb, FrameCompoFile)
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 (Assembly)
Public Function AddRefCompo(CurrCompoType As CompoType, FrameCompoFile As String) As Compo
' creo la stringa che contiene la lista degli errori
Dim ErrorList As String = String.Empty
' creo il nuovo 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
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, True, FrameCompoFile)
'-----------------------------------------------------------------------------------------------------------------------------------
Else
' nascondo il template
NewCompo.TemplateVisibility = Visibility.Collapsed
' leggo il nome del compo dal file config.ini
Dim sTemplateName As String = String.Empty
EgtUILib.GetPrivateProfileString(S_TEMPLATE, K_COMPO, "", sTemplateName, CurrCompoType.Path & "\" & CONFIGINI_FILE_NAME)
If String.IsNullOrWhiteSpace(sTemplateName) Then
ErrorList &= String.Format(EgtMsg(50122), K_COMPO, NewCompo.TemplateName)
NewCompo = Nothing
ElseIf Not File.Exists(CurrCompoType.Path & "\" & sTemplateName & ".lua") Then
ErrorList &= String.Format(EgtMsg(50122), K_COMPO, NewCompo.TemplateName)
NewCompo = Nothing
Else
NewCompo.TemplateSelItem = sTemplateName
End If
End If
' raggruppo tutte le componenti che hanno lo stesso nome vicine
If Not IsNothing(NewCompo) Then
' se trova già una componente allora l'inserimento avvien nel ciclo for
Dim bInsert = False
Dim CompoIndex = 0
For CompoIndex = 0 To m_CompoList.Count - 1
' inserisco la nuova componente
If NewCompo.CompoType.DDFName = m_CompoList(CompoIndex).CompoType.DDFName Then
' cerco l'ultima componente con lo stesso nome
Dim Lastindex As Integer = 0
While CompoIndex + Lastindex < m_CompoList.Count AndAlso NewCompo.CompoType.DDFName = m_CompoList(CompoIndex + Lastindex).CompoType.DDFName
Lastindex += 1
End While
CompoList.Insert(CompoIndex + Lastindex, NewCompo)
bInsert = True
Exit For
End If
Next
If Not bInsert Then
CompoList.Add(NewCompo)
End If
End If
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
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
For IndexCompo = 0 To CompoList.Count - 1
If CompoList(IndexCompo).CompoType.DDFName = CompoName Then
Return CompoList(IndexCompo).TemplateSelItem
Exit For
End If
Next
Return String.Empty
End Function
Friend Sub RemoveCompo(CompoToRemove As Compo)
If Not IsNothing(CompoToRemove.refJambCompo) Then
If Map.refAssemblyPageVM.CurrAssembly.LeftJamb.CompoList.IndexOf(CompoToRemove.refJambCompo) > -1 Then
Map.refAssemblyPageVM.CurrAssembly.LeftJamb.RemoveCompo(CompoToRemove.refJambCompo)
ElseIf Map.refAssemblyPageVM.CurrAssembly.RightJamb.CompoList.IndexOf(CompoToRemove.refJambCompo) > -1 Then
Map.refAssemblyPageVM.CurrAssembly.RightJamb.RemoveCompo(CompoToRemove.refJambCompo)
ElseIf Map.refAssemblyPageVM.CurrAssembly.TopJamb.CompoList.IndexOf(CompoToRemove.refJambCompo) > -1 Then
Map.refAssemblyPageVM.CurrAssembly.TopJamb.RemoveCompo(CompoToRemove.refJambCompo)
ElseIf Map.refAssemblyPageVM.CurrAssembly.BottomJamb.CompoList.IndexOf(CompoToRemove.refJambCompo) > -1 Then
Map.refAssemblyPageVM.CurrAssembly.BottomJamb.RemoveCompo(CompoToRemove.refJambCompo)
ElseIf Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(1).Door.CompoList.IndexOf(CompoToRemove.refJambCompo) > -1 Then
Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(1).Door.RemoveCompo(CompoToRemove.refJambCompo)
ElseIf Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.CompoList.IndexOf(CompoToRemove.refJambCompo) > -1 Then
Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.RemoveCompo(CompoToRemove.refJambCompo)
End If
End If
CompoList.Remove(CompoToRemove)
End Sub
Friend Sub RemoveRefCompo(ByRef CompoToRemove As Compo)
If Not IsNothing(CompoToRemove) Then
If Map.refAssemblyPageVM.CurrAssembly.LeftJamb.CompoList.IndexOf(CompoToRemove) > -1 Then
Map.refAssemblyPageVM.CurrAssembly.LeftJamb.RemoveCompo(CompoToRemove)
CompoToRemove = Nothing
ElseIf Map.refAssemblyPageVM.CurrAssembly.RightJamb.CompoList.IndexOf(CompoToRemove) > -1 Then
Map.refAssemblyPageVM.CurrAssembly.RightJamb.RemoveCompo(CompoToRemove)
CompoToRemove = Nothing
ElseIf Map.refAssemblyPageVM.CurrAssembly.TopJamb.CompoList.IndexOf(CompoToRemove) > -1 Then
Map.refAssemblyPageVM.CurrAssembly.TopJamb.RemoveCompo(CompoToRemove)
CompoToRemove = Nothing
ElseIf Map.refAssemblyPageVM.CurrAssembly.BottomJamb.CompoList.IndexOf(CompoToRemove) > -1 Then
Map.refAssemblyPageVM.CurrAssembly.BottomJamb.RemoveCompo(CompoToRemove)
CompoToRemove = Nothing
ElseIf Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(1).Door.CompoList.IndexOf(CompoToRemove) > -1 Then
Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(1).Door.RemoveCompo(CompoToRemove)
CompoToRemove = Nothing
ElseIf Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.CompoList.IndexOf(CompoToRemove) > -1 Then
Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.RemoveCompo(CompoToRemove)
CompoToRemove = Nothing
End If
End If
End Sub
Private Function LoadBrandFileList(ByRef NewCompo As Compo, Optional IsFrame As Boolean = False, Optional FrameFile As String = Nothing) As Boolean
' carica la lista di Hardware da mostrare nella grafica ( distinguendo i l'elenco destinato ai Frame)
Private Function LoadBrandFileList(ByRef NewCompo As Compo, Optional IsFrame As Boolean = False) As Boolean
Dim CurrCompoType As CompoType = NewCompo.CompoType
Dim CurrFolderList As ObservableCollection(Of CompoBrandDir)
' carico l'elenco dei direttori
If IsFrame Then
CurrFolderList = CurrCompoType.FrameFolderList
' devo dividere il nome che arriva dal matching lua
NewCompo.SetTemplateSelItemRefCompo(FrameFile, NewCompo)
Return True
'' devo dividere il nome che arriva dal matching lua
'NewCompo.SetTemplateSelItemRefCompo(FrameFile, NewCompo)
'Return True
Else
CurrFolderList = CurrCompoType.FolderList
End If
If CurrFolderList.Count > 0 Then
' carico nella componente l'elenco dei nome da mostrare a video
For IndexModel As Integer = 0 To CurrFolderList.Count - 1
NewCompo.BrandListPart.Add(CurrFolderList(IndexModel).ModelDirGraphic)
Next
' partendo dal fondo della lista delle componenti cerco se esiste la stessa componente, in quel caso
For CompoIndex = m_CompoList.Count - 1 To 0 Step -1
If m_CompoList(CompoIndex).CompoType.Name = CurrCompoType.Name Then
NewCompo.SetSelBrand(m_CompoList(CompoIndex).SelBrandPart)
NewCompo.SelFile = m_CompoList(CompoIndex).SelFile
NewCompo.SetSelFile(m_CompoList(CompoIndex).SelFile)
Return True
End If
Next
@@ -1065,13 +895,17 @@ Public Class Part
NewCompo.SetSelFile(String.Empty)
End If
Else
NewCompo = Nothing
Return False
End If
Return True
End Function
' ricerca seleziona la prima hinge di tipo Mortise
Private Sub AdviceHinge(NewCompo As Compo)
' ricerca seleziona la prima hinge di tipo Mortise ( solo se l'elenco dei brand non è di tipo Frame)
Public Sub AdviceHinge(NewCompo As Compo)
' se l'elenco dei brand è di tipo Frame allora esci
If NewCompo.SelBrandPart.ToLower.Contains(".frame") Then Return
Dim SelBrand As String = String.Empty
Dim SelFile As String = String.Empty
DefaultGetPrivateProfileString("AdviceHinge", "Brand", "", SelBrand)
@@ -1120,7 +954,7 @@ Public Class Part
' prima di passare al file successivo
' se ho trovato il parametro Deafult= 2
If ChangeHardware Then
'termino la lettura del file
' termino la lettura del file
Exit For
Else
NewCompo.SetSelBrand(NewCompo.CompoType.FolderList(IndexFolder).ModelDirGraphic)
@@ -1136,7 +970,230 @@ Public Class Part
End Sub
' aggiorna il ToolTip delle TextBox
#Region "Questa sezione dovrà essere eliminta!"
''Gestione ComboBox e TextBox di ogni compo della pulsantiera letta da Compo.ini (Assembly)
'Public Function AddRefCompo(CurrCompoType As CompoType, FrameCompoFile As String) As Compo
' ' creo la stringa che contiene la lista degli errori
' Dim ErrorList As String = String.Empty
' ' creo il nuovo 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
' 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, True)
' '-----------------------------------------------------------------------------------------------------------------------------------
' Else
' ' nascondo il template
' NewCompo.TemplateVisibility = Visibility.Collapsed
' ' leggo il nome del compo dal file config.ini
' Dim sTemplateName As String = String.Empty
' EgtUILib.GetPrivateProfileString(S_TEMPLATE, K_COMPO, "", sTemplateName, CurrCompoType.Path & "\" & CONFIGINI_FILE_NAME)
' If String.IsNullOrWhiteSpace(sTemplateName) Then
' ErrorList &= String.Format(EgtMsg(50122), K_COMPO, NewCompo.TemplateName)
' NewCompo = Nothing
' ElseIf Not File.Exists(CurrCompoType.Path & "\" & sTemplateName & ".lua") Then
' ErrorList &= String.Format(EgtMsg(50122), K_COMPO, NewCompo.TemplateName)
' NewCompo = Nothing
' Else
' NewCompo.TemplateSelItem = sTemplateName
' End If
' End If
' ' raggruppo tutte le componenti che hanno lo stesso nome vicine
' If Not IsNothing(NewCompo) Then
' ' se trova già una componente allora l'inserimento avvien nel ciclo for
' Dim bInsert = False
' Dim CompoIndex = 0
' For CompoIndex = 0 To m_CompoList.Count - 1
' ' inserisco la nuova componente
' If NewCompo.CompoType.DDFName = m_CompoList(CompoIndex).CompoType.DDFName Then
' ' cerco l'ultima componente con lo stesso nome
' Dim Lastindex As Integer = 0
' While CompoIndex + Lastindex < m_CompoList.Count AndAlso NewCompo.CompoType.DDFName = m_CompoList(CompoIndex + Lastindex).CompoType.DDFName
' Lastindex += 1
' End While
' CompoList.Insert(CompoIndex + Lastindex, NewCompo)
' bInsert = True
' Exit For
' End If
' Next
' If Not bInsert Then
' CompoList.Add(NewCompo)
' End If
' End If
' Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = 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
' 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 FrameFolderName As String = FOLDERDIR
' 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
' If NewCompo.CompoParamList(IndexParam).DDFName.ToLower = K_SIDE.ToLower Then
' Side = DirectCast(NewCompo.CompoParamList(IndexParam), ComboBoxParam).SelItem
' Exit For
' End If
' Next
' End If
' ' ricontrollo che la stringa non sia vuota
' If Not String.IsNullOrEmpty(Side) Then
' 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
' Return
' End If
' '------------------------------------------------------------------------------------------------------------------------------------------
' Select Case CurrAssembly.DoorNumber
' Case "1"
' ' questo select case serve per gestire la posizione degli hardware sui Jamb
' Select Case CurrCompoType.JambSide.ToLower
' Case SIDE_HINGE
' If CurrAssembly.LeftJamb.Swing.Contains(ConstGen.LOCK) Then
' NewCompo.refJambCompo = CurrAssembly.LeftJamb.AddRefCompo(CompoTypeJamb, FrameCompoFile)
' NewCompo.refJambCompo.IsReadOnly = True
' Else
' NewCompo.refJambCompo = CurrAssembly.RightJamb.AddRefCompo(CompoTypeJamb, FrameCompoFile)
' NewCompo.refJambCompo.IsReadOnly = True
' End If
' Case SIDE_LOCK
' If CurrAssembly.LeftJamb.Swing.Contains(ConstGen.LOCK) Then
' NewCompo.refJambCompo = CurrAssembly.RightJamb.AddRefCompo(CompoTypeJamb, FrameCompoFile)
' NewCompo.refJambCompo.IsReadOnly = True
' Else
' NewCompo.refJambCompo = CurrAssembly.LeftJamb.AddRefCompo(CompoTypeJamb, FrameCompoFile)
' NewCompo.refJambCompo.IsReadOnly = True
' End If
' Case SIDE_TOP
' NewCompo.refJambCompo = CurrAssembly.TopJamb.AddRefCompo(CompoTypeJamb, FrameCompoFile)
' NewCompo.refJambCompo.IsReadOnly = True
' Case SIDE_BOTTOM
' NewCompo.refJambCompo = CurrAssembly.BottomJamb.AddRefCompo(CompoTypeJamb, FrameCompoFile)
' NewCompo.refJambCompo.IsReadOnly = True
' End Select
' Case "2"
' Select Case CurrCompoType.JambSide.ToLower
' Case SIDE_HINGE
' If CurrDoor.TypePart = ConstGen.PART_DO_ & "1" Then
' NewCompo.refJambCompo = CurrAssembly.LeftJamb.AddRefCompo(CompoTypeJamb, FrameCompoFile)
' NewCompo.refJambCompo.IsReadOnly = True
' Else
' NewCompo.refJambCompo = CurrAssembly.RightJamb.AddRefCompo(CompoTypeJamb, FrameCompoFile)
' NewCompo.refJambCompo.IsReadOnly = True
' End If
' Case SIDE_LOCK
' ' significa che le componenrti stanno solo sulle porte
' If CurrDoor.TypePart = ConstGen.PART_DO_ & "1" And Not CurrDoor.Swing.Contains(ConstGen.INACTIVE) Then
' NewCompo.refJambCompo = CurrAssembly.GetArrayPartDoor(1).Door.AddRefCompo(CompoTypeJamb, FrameCompoFile)
' NewCompo.refJambCompo.IsReadOnly = True
' ElseIf CurrDoor.TypePart = ConstGen.PART_DO_ & "2" And Not CurrDoor.Swing.Contains(ConstGen.INACTIVE) Then
' NewCompo.refJambCompo = CurrAssembly.GetArrayPartDoor(0).Door.AddRefCompo(CompoTypeJamb, FrameCompoFile)
' NewCompo.refJambCompo.IsReadOnly = True
' End If
' Case SIDE_TOP
' NewCompo.refJambCompo = CurrAssembly.TopJamb.AddRefCompo(CompoTypeJamb, FrameCompoFile)
' NewCompo.refJambCompo.IsReadOnly = True
' Case SIDE_BOTTOM
' NewCompo.refJambCompo = CurrAssembly.BottomJamb.AddRefCompo(CompoTypeJamb, FrameCompoFile)
' NewCompo.refJambCompo.IsReadOnly = True
' End Select
' End Select
' ' riabilito la costruzion del riferimnto
' Assembly.BuiltReffCompo = True
'End Sub
#End Region
#End Region 'AddCompo
#Region "RemoveCompo"
Friend Sub RemoveCompo(CompoToRemove As Compo, Optional OnlyOnJamb As Boolean = False)
If IsNothing(CompoToRemove) Then Return
If Not IsNothing(CompoToRemove.refJambCompo) Then
' elimino prima il riferimento
For IndexAssociation As Integer = 0 To m_refPartDoor.ListAssociation.Count - 1
If m_refPartDoor.ListAssociation(IndexAssociation).refPartDoor.Door.CompoList.IndexOf(CompoToRemove.refJambCompo) > -1 Then
m_refPartDoor.ListAssociation(IndexAssociation).refPartDoor.Door.RemoveCompo(CompoToRemove.refJambCompo)
CompoToRemove.refJambCompo = Nothing
If OnlyOnJamb Then Return
Exit For
End If
Next
End If
' elimino la componente
CompoList.Remove(CompoToRemove)
End Sub
#End Region ' RemoveCompo
' aggiorna il ToolTip delle TextBox di Height, Width, Thickness
Private Sub UpdateToolTip()
For CompoIndex = 0 To m_CompoList.Count - 1
For ParamIndex = 0 To m_CompoList(CompoIndex).CompoParamList.Count - 1
@@ -1149,11 +1206,14 @@ Public Class Part
End Sub
#Region "LETTURA DDF"
Private bModifyProperties As Boolean = False
Private bModifyBevel As Boolean = False
Private FileContent As String()
' Genero una nuova porta da usare nella lettura di un DDF
Shared Sub ReadDDFPartDoor(ArrayFile() As String, ByRef LineIndex As Integer, ByRef ReadDoor As Part)
Dim bPressure As Boolean = False
Dim bProperties As Boolean = False
' tutti i parametri fino a profiles devono essere caricati
Dim ReadDoorCompleted As Boolean = False
' passo alla pagina vuota in attesa del caricamneto della prossima
@@ -1246,6 +1306,9 @@ Public Class Part
End If
Case S_SECURE ' creo l'oggetto OptionPage nella Mappa
LineIndex = ReadDoor.GetSecure(LineIndex)
Case ConstCompo.S_PROPERTIES
bProperties = True
LineIndex = ReadDoor.GetProperties(LineIndex)
Case ConstCompo.S_PROFILES
LineIndex = ReadDoor.GetProfiles(ReadDoor.NextIndex(LineIndex), ReadDoor.TypePart)
If LineIndex = -1 Then
@@ -1289,7 +1352,18 @@ Public Class Part
If Not IsNothing(ReadDoor) And ReadDoorCompleted Then
' se la porta esiste allora mostro i suoi parametri
Map.refPartPageVM.CurrPart = ReadDoor
'Map.refOptionsVM.RefreshEdgeTypeList()
' se non passo dalla funzione che raccoglie queste informazioni
If Not bProperties AndAlso ReadDoor.PropertiesIsVisible = Visibility.Visible Then
For Each Item In ReadDoor.PropertiesList
Item.IsChecked = False
Next
End If
If ReadDoor.bModifyProperties Then
' 50194 = Properties has been deleted
MessageBox.Show(EgtMsg(50194), EgtMsg(50118), MessageBoxButton.OK, MessageBoxImage.Information)
FirstReadingEdge = True
End If
' Sarebbe buona norma inserire qui la stringa con i messaggi di errore e avvertimento (dopo aver caricato i bevel corretti)
If ReadDoor.bModifyBevel Then
' 50169 =Door dispositiopn has been modify.
@@ -1591,6 +1665,26 @@ Public Class Part
Return NextIndex(Index)
End Function
' leggo le proprietà
Private Function GetProperties(Index As Integer) As Integer
Dim sLine As String = RemoveComment(FileContent(Index))
If PropertiesIsVisible = Visibility.Collapsed Then bModifyProperties = True
Dim sProperties As String = GetValueWithKey(sLine, ConstCompo.S_PROPERTIES)
If Not String.IsNullOrWhiteSpace(sProperties) Then
' carico il valore nella porta corrente
Dim sItem() As String = sProperties.Split(","c)
For Each Item In m_PropertiesList
Item.IsChecked = False
For Each ItemRead In sItem
If Trim(Item.Name) = ItemRead Then
Item.IsChecked = True
End If
Next
Next
End If
Return NextIndex(Index)
End Function
' calcola la congruenza del posizionamento e del secure
Private Sub CalcBevelFromSecure()
' se sono nella configurazione assemblato e sto leggendo un frame
@@ -1842,6 +1936,24 @@ Public Class Part
m_TopOverMaterial = TopOverMaterial
End If
Index = NextIndex(Index)
If Index > FileContent.Count() - 1 Then Return -1
sLine = RemoveComment(FileContent(Index))
'-------------------------------------------------------------------------------
Dim Radius As String = GetValueWithKey(sLine, "radius")
If Not String.IsNullOrEmpty(Radius) Then
Index = NextIndex(Index)
If Index > FileContent.Count() - 1 Then Return -1
sLine = RemoveComment(FileContent(Index))
Dim Posx As String = GetValueWithKey(sLine, "posx")
' carico i valori
If Not String.IsNullOrEmpty(Radius) AndAlso Not String.IsNullOrEmpty(Posx) Then
Index = NextIndex(Index)
m_Radius = Radius
m_Posx = Posx
TopArcIsChecked = True
End If
End If
'-------------------------------------------------------------------------------
' Bottom
If Index > FileContent.Count() - 1 Then Return -1
sLine = RemoveComment(FileContent(Index))
@@ -1892,7 +2004,7 @@ Public Class Part
Return NextIndex(Index)
End Function
' Leggo i dati del componente
' Leggo i dati del componente ( da senllire riutilizzando funzioni che già esistono)
Private Function GetCompo(Index As Integer, CompoNameDDF As String, ByRef sErrorInfo As String) As Integer
' Controllo esistenza del componente
Dim CompoListIndex As Integer = -1
@@ -1946,7 +2058,11 @@ Public Class Part
'-----------------------------------------------------------------------------------------------------------------------------------
m_CurrCompo.TemplateDDFName = DDFName
m_CurrCompo.TemplateName = Name
LoadBrandFileList(m_CurrCompo)
If sLine.ToLower.Contains(".frame") Then
LoadBrandFileList(m_CurrCompo, True)
Else
LoadBrandFileList(m_CurrCompo)
End If
'-----------------------------------------------------------------------------------------------------------------------------------
' Se c'è "- " iniziale
If sKey.StartsWith("- ") Then
@@ -2361,8 +2477,10 @@ Public Class Part
#End Region ' Lettura ddf
' Genero una nuova porta da usare nella lettura di un DDF
Sub New()
#Region "COSTRUTTORE"
Sub New(ref_PartDoor As PartDoor)
m_refPartDoor = ref_PartDoor
'CompoParam.m_rfSetTitle = AddressOf SetTitle
End Sub
@@ -2391,6 +2509,12 @@ Public Class Part
Me.TypePart = ConstGen.PART_DO_ & "1"
End Sub
#End Region ' Costruttore
Public Function ShallowCopy() As Part
Return DirectCast(Me.MemberwiseClone(), Part)
End Function
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
Public Sub NotifyPropertyChanged(propName As String)
+93 -8
View File
@@ -64,15 +64,18 @@
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<!--<RowDefinition Height="Auto"/>-->
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Border BorderBrush="Gainsboro" BorderThickness="1" Grid.Column="2" Grid.ColumnSpan="4"
Grid.RowSpan="5" Margin="5,-2,2,0" CornerRadius="3"/>
<TextBlock Grid.Column="3" Grid.Row="0" Text="{Binding EdgeMsg}" VerticalAlignment="Center"
Style="{StaticResource DoorParamsTxBl}" Margin="2,0,5,0"/>
<TextBlock Grid.Column="4" Grid.Row="0" Grid.ColumnSpan="2" Text="{Binding OverMaterialMsg}" VerticalAlignment="Center"
Style="{StaticResource DoorParamsTxBl}" Margin="2,0,5,0"/>
<TextBlock Grid.Column="4" Grid.Row="0" Text="{Binding MachMsg}" VerticalAlignment="Center"
Style="{StaticResource DoorParamsTxBl}" />
<TextBlock Grid.Column="5" Grid.Row="0" Text="{Binding OverMaterialMsg}" VerticalAlignment="Center"
Style="{StaticResource DoorParamsTxBl}" Margin="10,0,5,0" />
<!--General-->
<TextBlock Text="{Binding WidthMsg}"
@@ -85,7 +88,7 @@
ToolTip="{Binding CurrPart.ToolTipEvaluatedWidth}"
Margin="0.4,2,39.6,3.2"
VerticalAlignment="Stretch"
Height="Auto" IsReadOnly="{Binding IsRaedOnly}"/>
Height="Auto" IsReadOnly="{Binding DisableWidth}"/>
<TextBlock Grid.Row="1" Text="{Binding HeightMsg}"
Style="{StaticResource DoorParamsTxBl}"
@@ -94,7 +97,7 @@
Text="{Binding CurrPart.Height, UpdateSourceTrigger=PropertyChanged}"
Margin="0.4,2,39.6,3.2" VerticalAlignment="Stretch" Height="Auto"
ToolTip="{Binding CurrPart.ToolTipEvaluatedHeight}"
IsReadOnly="{Binding IsRaedOnly}"/>
IsReadOnly="{Binding DisableHeight}"/>
<TextBlock Grid.Row="2" Text="{Binding ThicknessMsg}"
Style="{StaticResource DoorParamsTxBl}"
@@ -233,10 +236,92 @@
IsEnabled="{Binding IsChecked, ElementName=Bottom}"
ToolTip="{Binding CurrPart.ToolTipEvaluatedBottomOverMaterial}"
Margin="10,2,40,4" IsReadOnly="{Binding IsRaedOnly}"/>
</Grid>
</GroupBox>
<!--TopArc-->
<GroupBox Grid.Row="6" Grid.ColumnSpan="4" Margin="2,0,2,0">
<GroupBox.Header>
<StackPanel Orientation="Horizontal">
<CheckBox Grid.Row="0" Grid.Column="5"
Name="TopArc"
Style="{StaticResource DoorParamsChBx}"
IsChecked="{Binding CurrPart.TopArcIsChecked}"
Margin="0,0,2,0" VerticalAlignment="Stretch" Height="Auto"/>
<TextBlock Text="{Binding TopArcMsg}" Width="Auto"/>
</StackPanel>
</GroupBox.Header>
<Grid Margin="0,0,0,2" IsEnabled="{Binding IsChecked, ElementName=TopArc}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0"
Text="{Binding RadiusMsg}"
Style="{StaticResource DoorParamsTxBl}"
Margin="2,2,0,2"/>
<TextBox Grid.Column="1"
Style="{StaticResource DoorParamsTxBx}"
Text="{Binding CurrPart.Radius, UpdateSourceTrigger=PropertyChanged}"
Margin="0.4,2,39.6,3.2"
IsReadOnly="{Binding IsRaedOnly}"/>
<TextBlock Grid.Column="2"
Text="{Binding PosxMsg}"
Style="{StaticResource DoorParamsTxBl}"
Margin="20,2,0,2"/>
<TextBox Grid.Column="3"
Style="{StaticResource DoorParamsTxBx}"
Text="{Binding CurrPart.Posx, UpdateSourceTrigger=PropertyChanged}"
Margin="0.4,2,39.6,3.2"
IsReadOnly="{Binding IsRaedOnly}"/>
</Grid>
</GroupBox>
<ToggleButton x:Name="PropertiesBtn"
Grid.Column="4" Grid.ColumnSpan="2" Grid.Row="5"
Visibility="{Binding CurrPart.PropertiesIsVisible}"
Margin="0.4,2,40,4">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding PropertiesMsg}"/>
<Popup IsOpen="{Binding IsChecked, ElementName=PropertiesBtn}"
PlacementTarget="{Binding ElementName=PropertiesBtn}"
Placement="Bottom"
StaysOpen="False"
AllowsTransparency="True">
<Border BorderThickness="2"
BorderBrush="{StaticResource EgaltechBlue2}"
Background="{StaticResource EgaltechBlue2}"
CornerRadius="2"
Padding="1">
<Grid>
<ItemsControl ItemsSource="{Binding CurrPart.PropertiesList}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border BorderThickness="1"
BorderBrush="#FF707070"
Background="#FFDDDDDD"
CornerRadius="3"
Padding="2"
Margin="1">
<StackPanel Orientation="Horizontal">
<CheckBox IsChecked="{Binding IsChecked}"/>
<TextBlock Text="{Binding GraphicName}"
Margin="2,0,2,0"/>
</StackPanel>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</Border>
</Popup>
</StackPanel>
</ToggleButton>
</Grid>
</GroupBox>
<ItemsControl Name="DoorParamsItemsControl" Grid.Row="2" ItemsSource="{Binding CurrPart.CompoList}" Style="{StaticResource DoorParamsItemsControlStyle}">
<ItemsControl.InputBindings>
+52 -3
View File
@@ -61,6 +61,12 @@ Public Class PartPageVM
'General'
Public ReadOnly Property MachMsg As String
Get
Return "Mach."
End Get
End Property
Public ReadOnly Property EdgeMsg As String
Get
Return EgtMsg(50044)
@@ -152,9 +158,31 @@ Public Class PartPageVM
Set(value As Boolean)
m_IsReadOnly = value
NotifyPropertyChanged("IsRaedOnly")
NotifyPropertyChanged("DisableHeight")
NotifyPropertyChanged("DisableWidth")
End Set
End Property
Public ReadOnly Property DisableHeight As Boolean
Get
If Not IsNothing(Map.refAssemblyPageVM.CurrAssembly) AndAlso Map.refPartPageVM.CurrPart.TypePart.Contains("DO_") Then
Return Map.refAssemblyPageVM.CurrAssembly.Dimension
Else
Return m_IsReadOnly
End If
End Get
End Property
Public ReadOnly Property DisableWidth As Boolean
Get
If Not IsNothing(Map.refAssemblyPageVM.CurrAssembly) AndAlso Map.refPartPageVM.CurrPart.TypePart.Contains("DO_") Then
Return Map.refAssemblyPageVM.CurrAssembly.Dimension
Else
Return m_IsReadOnly
End If
End Get
End Property
Public ReadOnly Property OrderMsg As String
Get
' Order
@@ -162,6 +190,30 @@ Public Class PartPageVM
End Get
End Property
Public ReadOnly Property RadiusMsg As String
Get
Return "Radius"
End Get
End Property
Public ReadOnly Property PosxMsg As String
Get
Return "Pos_x"
End Get
End Property
Public ReadOnly Property TopArcMsg As String
Get
Return "Top Arc"
End Get
End Property
Public ReadOnly Property PropertiesMsg As String
Get
Return "Properties"
End Get
End Property
Private m_Image As String
Public Property Image As String
Get
@@ -179,9 +231,6 @@ Public Class PartPageVM
#Region "COMMANDS"
''' <summary>
''' Returns a command that do New.
''' </summary>
Public ReadOnly Property RefreshCmd As ICommand
Get
If m_EnterRefreshCmd Is Nothing Then
+44
View File
@@ -0,0 +1,44 @@
Imports EgtWPFLib5
Public Class PropertyItem
Inherits VMBase
Private m_GraphicName As String
Public Property GraphicName As String
Get
Return m_GraphicName
End Get
Set(value As String)
m_GraphicName = value
End Set
End Property
Private m_Name As String
Public Property Name As String
Get
Return m_Name
End Get
Set(value As String)
m_Name = value
End Set
End Property
Private m_IsChecked As Boolean = False
Public Property IsChecked As Boolean
Get
Return m_IsChecked
End Get
Set(value As Boolean)
m_IsChecked = value
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
NotifyPropertyChanged("IsChecked")
End Set
End Property
Sub New(sName As String, sGraphicName As String, bIsChecked As Boolean)
m_Name = sName
m_GraphicName = sGraphicName
m_IsChecked = bIsChecked
End Sub
End Class
+2
View File
@@ -112,6 +112,7 @@
</Compile>
<Compile Include="AssemblyManager\AssemblyName.vb" />
<Compile Include="Assembly\PartDoor.vb" />
<Compile Include="Assembly\Association.vb" />
<Compile Include="Command\Command.vb" />
<Compile Include="CompoMatch.vb" />
<Compile Include="CompoPanel\CompoPanelHardwareV.xaml.vb">
@@ -140,6 +141,7 @@
</Compile>
<Compile Include="CompoPanel\CompoPanelVM.vb" />
<Compile Include="Assembly\Assembly.vb" />
<Compile Include="DoorParameters\PropertyItem.vb" />
<Compile Include="Doors.vb" />
<Compile Include="Guide\GuideViewModel.vb" />
<Compile Include="Guide\GuideV.xaml.vb">
+1 -1
View File
@@ -20,8 +20,8 @@ Friend Module IniFile
Friend Enum KEY_OPT As UInteger
BASE = 1
DOORS = 2
GUNSTOCK = 4
DOORCREATOR = 8
JAMBS = 32
End Enum
' Path cartella Data
+3 -1
View File
@@ -77,8 +77,10 @@ Friend Class MainWindowModel
IniFile.m_CompoDir = IniFile.m_sDoorsDirPath & "\Compo"
' Assegno path file di Default
IniFile.m_DefaultIniFile = IniFile.m_CompoDir & "\" & DEFAULT_INI_FILE_NAME
'carico il file dei messaggi
OptionModule.ReadMessages()
If Not File.Exists(IniFile.m_DefaultIniFile) Then
MessageBox.Show(EgtMsg(50179), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
MessageBox.Show(EgtMsg(50179), "Error", MessageBoxButton.OK, MessageBoxImage.Error)
End
End If
'Inizializzo OptionModule
+2 -2
View File
@@ -72,5 +72,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.9.6.2")>
<Assembly: AssemblyFileVersion("1.9.6.2")>
<Assembly: AssemblyVersion("1.9.7.1")>
<Assembly: AssemblyFileVersion("1.9.7.1")>
+50 -9
View File
@@ -24,8 +24,8 @@
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="3.7*"/>
<RowDefinition Height="6.5*"/>
<RowDefinition Height="3.5*"/>
<RowDefinition Height="6.7*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="1*"/>
@@ -68,7 +68,9 @@
<TextBlock Grid.Column="3" Grid.Row="0" Text="{Binding EdgeMsg}" VerticalAlignment="Center"
Style="{StaticResource DoorParamsTxBl}" Margin="5,0,5,0"/>
<TextBlock Grid.Column="4" Grid.Row="0" Grid.ColumnSpan="2" Text="{Binding OverMaterialMsg}" VerticalAlignment="Center"
<TextBlock Grid.Column="4" Grid.Row="0" Text="{Binding MachMsg}" VerticalAlignment="Center"
Style="{StaticResource DoorParamsTxBl}" />
<TextBlock Grid.Column="5" Grid.Row="0" Text="{Binding OverMaterialMsg}" VerticalAlignment="Center"
Style="{StaticResource DoorParamsTxBl}" Margin="5,0,5,0"/>
<TextBlock Grid.Column="0" Grid.Row="0" Text="{Binding WidthMsg}" VerticalAlignment="Center"
@@ -106,15 +108,18 @@
<RowDefinition Height="44"/>
</Grid.RowDefinitions>
<TextBox Style="{StaticResource DoorParamsTxBx}"
Grid.Column="0"
Text="{Binding WeightValue, UpdateSourceTrigger=PropertyChanged}"
Margin="5,0,10,5"
IsEnabled="{Binding IsChecked, ElementName=Weight}" HorizontalAlignment="Left" Width="109"/>
<CheckBox Grid.Column="1"
IsChecked="{Binding IsCheckedWeight}"
Name="Weight"
Margin="0,0,5,5"
Style="{StaticResource DoorParamsChBx}" />
<TextBox Style="{StaticResource DoorParamsTxBx}"
Text="{Binding WeightValue, UpdateSourceTrigger=PropertyChanged}"
Margin="5,8,0,14"
IsEnabled="{Binding IsChecked, ElementName=Weight}" HorizontalAlignment="Left" Width="109"/>
Style="{StaticResource DoorParamsChBx}" />
</Grid>
<TextBlock Grid.Column="2" Grid.Row="1" Text="{Binding LockEdgeMsg}" VerticalAlignment="Center"
@@ -205,6 +210,7 @@
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1.2*"/>
</Grid.RowDefinitions>
<!--UP-->
<TextBlock Grid.Row="0" Text="{Binding LightUpMsg}"
@@ -403,8 +409,8 @@
<TextBlock Text="{Binding ExteriorMsg}" Width="Auto"/>
</StackPanel>
</GroupBox.Header>
</GroupBox>
<TextBlock Text="{Binding OverlapTopMsg}"
Style="{StaticResource DoorParamsTxBl}"
Margin="2,0,0,-5.5"
@@ -424,6 +430,41 @@
Style="{StaticResource DoorParamsTxBx}"
Text="{Binding DeltaThickness, UpdateSourceTrigger=PropertyChanged}"
Margin="5,2.5,10,-5.5" VerticalAlignment="Stretch"/>
<!--TotalDimension-->
<GroupBox Grid.Row="6" Grid.ColumnSpan="5" Margin="2,-0,2,-4">
<GroupBox.Header>
<StackPanel Orientation="Horizontal">
<CheckBox Name="TotalDimension"
Style="{StaticResource DoorParamsChBx}"
IsChecked="{Binding TotalDimension}"
Margin="0,0,2,0" VerticalAlignment="Stretch" Height="Auto"/>
<TextBlock Text="{Binding TotalDimensionMsg}" Width="Auto"/>
</StackPanel>
</GroupBox.Header>
</GroupBox>
<TextBlock Text="{Binding TotalHeightMsg}"
Style="{StaticResource DoorParamsTxBl}"
Margin="2,0,0,-5.5"
Grid.Row="6"
Grid.Column="1"/>
<TextBox Grid.Column="2" Grid.Row="6"
Style="{StaticResource DoorParamsTxBx}"
IsEnabled="{Binding IsChecked,ElementName=TotalDimension}"
Text="{Binding TotalHeight, UpdateSourceTrigger=PropertyChanged}"
Margin="5,2.5,10,-5.5" VerticalAlignment="Stretch" />
<TextBlock Text="{Binding TotalWidthMsg}"
Style="{StaticResource DoorParamsTxBl}"
Margin="2,0,0,-5.5"
Grid.Row="6"
Grid.Column="3"/>
<TextBox Grid.Column="4" Grid.Row="6"
Style="{StaticResource DoorParamsTxBx}"
IsEnabled="{Binding IsChecked,ElementName=TotalDimension}"
Text="{Binding TotalWidth, UpdateSourceTrigger=PropertyChanged}"
Margin="5,2.5,10,-5.5" VerticalAlignment="Stretch" />
</Grid>
</GroupBox>
</TabItem>
+103
View File
@@ -563,6 +563,85 @@ Public Class OptionsVM
End Set
End Property
Public Property TotalDimension As Boolean
Get
If OptionModule.m_TotalDimension Then
DefaultWritePrivateProfileString(S_TOTALDIMENSION, K_STATIC, "1")
Else
DefaultWritePrivateProfileString(S_TOTALDIMENSION, K_STATIC, "0")
End If
Return OptionModule.m_TotalDimension
End Get
Set(value As Boolean)
OptionModule.m_TotalDimension = value
NotifyPropertyChanged("TotalDimension")
' aggiorno la grafica
If Not IsNothing(Map.refAssemblyPageVM) AndAlso Not IsNothing(Map.refAssemblyPageVM.CurrAssembly) Then
Map.refAssemblyPageVM.CurrAssembly.Dimension = OptionModule.m_TotalDimension
End If
End Set
End Property
Public Property TotalHeight As String
Get
'If Not IsNothing(Map.refAssemblyPageVM) AndAlso Not IsNothing(Map.refAssemblyPageVM.CurrAssembly) Then
' If Not IsNothing(Map.refAssemblyManagerVM.ReserchPartDoor("FL_")) Then
' OptionModule.m_TotalHeight = Map.refAssemblyManagerVM.ReserchPartDoor("FL_").Door.Height
' Else
' TotalDimension = False
' End If
'End If
DefaultWritePrivateProfileString(S_TOTALDIMENSION, K_TOTALHEIGHT, OptionModule.m_TotalHeight)
Return OptionModule.m_TotalHeight
End Get
Set(value As String)
OptionModule.m_TotalHeight = value
NotifyPropertyChanged("TotalHeight")
'If Not IsNothing(Map.refAssemblyPageVM) AndAlso Not IsNothing(Map.refAssemblyPageVM.CurrAssembly) Then
' Map.refAssemblyPageVM.CurrAssembly.SetDimension("Height")
' Map.refSceneManagerVM.RefreshBtn()
'End If
End Set
End Property
Public Property TotalWidth As String
Get
'If Not IsNothing(Map.refAssemblyPageVM) AndAlso Not IsNothing(Map.refAssemblyPageVM.CurrAssembly) Then
' Dim DO_1 As PartDoor = Map.refAssemblyManagerVM.ReserchPartDoor("DO_1")
' Dim DO_2 As PartDoor = Map.refAssemblyManagerVM.ReserchPartDoor("DO_2")
' Dim LL As String = Map.refAssemblyPageVM.CurrAssembly.LightLock
' Dim LH As String = Map.refAssemblyPageVM.CurrAssembly.LightHinge
' Dim JW As String = Map.refAssemblyPageVM.CurrAssembly.Width
' If Not IsNothing(DO_1) Then
' Dim nDO_1Width As Double = 0
' Dim nDO_2Width As Double = 0
' StringToDouble(DO_1.Door.Width, nDO_1Width)
' Dim nJW As Double = 0
' StringToDouble(JW, nJW)
' Dim nLL As Double = 0
' StringToDouble(LL, nLL)
' Dim nLH As Double = 0
' StringToDouble(LH, nLH)
' If Not IsNothing(DO_2) Then
' StringToDouble(DO_2.Door.Width, nDO_2Width)
' OptionModule.m_TotalWidth = DoubleToString(nDO_1Width + nDO_2Width + nLL + nLH * 2 + 2 * nJW, 4)
' Else
' OptionModule.m_TotalWidth = DoubleToString(nDO_1Width + nLL + nLH + 2 * nJW, 4)
' End If
' Else
' TotalDimension = False
' End If
'End If
DefaultWritePrivateProfileString(S_TOTALDIMENSION, K_TOTALWIDTH, OptionModule.m_TotalWidth)
Return OptionModule.m_TotalWidth
End Get
Set(value As String)
OptionModule.m_TotalWidth = value
NotifyPropertyChanged("TotalWidth")
End Set
End Property
Public Property ThicknessJamb As String
Get
Return OptionModule.m_ThicknessJamb
@@ -746,6 +825,7 @@ Public Class OptionsVM
DefaultWritePrivateProfileString(S_OVERMATERIALASSEMBLY, K_BOTTOMOVERMATERIAL_INI, OptionModule.m_BottomOverMaterialAssembly)
End Set
End Property
#End Region ' Machining Assembly
'-------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -943,6 +1023,12 @@ Public Class OptionsVM
End Get
End Property
Public ReadOnly Property MachMsg As String
Get
Return "Mach."
End Get
End Property
' BevelMsg
Public ReadOnly Property BevelMsg As String
Get
@@ -1082,6 +1168,23 @@ Public Class OptionsVM
End Get
End Property
Public ReadOnly Property TotalDimesionMsg As String
Get
Return "Total Dimension"
End Get
End Property
Public ReadOnly Property TotalHeightMsg As String
Get
Return "Height"
End Get
End Property
Public ReadOnly Property TotalWidthMsg As String
Get
Return "Width"
End Get
End Property
#End Region
+30 -40
View File
@@ -62,85 +62,75 @@ Public Class OrderVM
Public Property Customer As String
Get
If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then Return Nothing
Return Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.GetArrayPartDoor(0).Door.Customer
If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor.Count > 0 Then Return Nothing
Return Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor(0).Door.Customer
End Get
Set(value As String)
Dim CurrAssembly As Assembly = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly
CurrAssembly.GetArrayPartDoor(0).Door.Customer = value
CurrAssembly.GetArrayPartDoor(1).Door.Customer = value
CurrAssembly.LeftJamb.Customer = value
CurrAssembly.RightJamb.Customer = value
CurrAssembly.TopJamb.Customer = value
CurrAssembly.BottomJamb.Customer = value
For Each ItemPartDoor In CurrAssembly.ListPartDoor
ItemPartDoor.Door.Customer = value
Next
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
Public Property Elevation As String
Get
If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then Return Nothing
Return Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.GetArrayPartDoor(0).Door.Elevation
If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor.Count > 0 Then Return Nothing
Return Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor(0).Door.Elevation
End Get
Set(value As String)
Dim CurrAssembly As Assembly = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly
CurrAssembly.GetArrayPartDoor(0).Door.Elevation = value
CurrAssembly.GetArrayPartDoor(1).Door.Elevation = value
CurrAssembly.LeftJamb.Elevation = value
CurrAssembly.RightJamb.Elevation = value
CurrAssembly.TopJamb.Elevation = value
CurrAssembly.BottomJamb.Elevation = value
For Each ItemPartDoor In CurrAssembly.ListPartDoor
ItemPartDoor.Door.Elevation = value
Next
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
Public Property Project As String
Get
If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then Return Nothing
Return Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.GetArrayPartDoor(0).Door.Project
If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor.Count > 0 Then Return Nothing
Return Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor(0).Door.Project
End Get
Set(value As String)
Dim CurrAssembly As Assembly = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly
CurrAssembly.GetArrayPartDoor(0).Door.Project = value
CurrAssembly.GetArrayPartDoor(1).Door.Project = value
CurrAssembly.LeftJamb.Project = value
CurrAssembly.RightJamb.Project = value
CurrAssembly.TopJamb.Project = value
CurrAssembly.BottomJamb.Project = value
For Each ItemPartDoor In CurrAssembly.ListPartDoor
ItemPartDoor.Door.Project = value
Next
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
Public Property PO As String
Get
If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then Return Nothing
Return Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.GetArrayPartDoor(0).Door.PO
If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor.Count > 0 Then Return Nothing
Return Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor(0).Door.PO
End Get
Set(value As String)
Dim CurrAssembly As Assembly = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly
CurrAssembly.GetArrayPartDoor(0).Door.PO = value
CurrAssembly.GetArrayPartDoor(1).Door.PO = value
CurrAssembly.LeftJamb.PO = value
CurrAssembly.RightJamb.PO = value
CurrAssembly.TopJamb.PO = value
CurrAssembly.BottomJamb.PO = value
For Each ItemPartDoor In CurrAssembly.ListPartDoor
ItemPartDoor.Door.PO = value
Next
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
Public Property Line As String
Get
If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then Return Nothing
Return Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.GetArrayPartDoor(0).Door.Line
If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor.Count > 0 Then Return Nothing
Return Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor(0).Door.Line
End Get
Set(value As String)
Dim CurrAssembly As Assembly = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly
CurrAssembly.GetArrayPartDoor(0).Door.Line = value
CurrAssembly.GetArrayPartDoor(1).Door.Line = value
CurrAssembly.LeftJamb.Line = value
CurrAssembly.RightJamb.Line = value
CurrAssembly.TopJamb.Line = value
CurrAssembly.BottomJamb.Line = value
For Each ItemPartDoor In CurrAssembly.ListPartDoor
ItemPartDoor.Door.Line = value
Next
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
+1 -7
View File
@@ -217,9 +217,6 @@ Public Class ProjectManagerHardwareVM
#Region "OptionsCommand"
''' <summary>
''' Returns a command that do Export.
''' </summary>
Public ReadOnly Property OptionsCommand As ICommand
Get
If m_cmdOptions Is Nothing Then
@@ -229,12 +226,9 @@ Public Class ProjectManagerHardwareVM
End Get
End Property
''' <summary>
''' Execute the Export. This method is invoked by the ExportCommand.
''' </summary>
Public Sub Options(ByVal param As Object)
Dim OptionsWindow As New OptionsV
OptionsWindow.Height = 550
OptionsWindow.Height = 750
OptionsWindow.Width = 650
OptionsWindow.DataContext = New OptionsVM()
OptionsWindow.Owner = Application.Current.MainWindow
+32 -30
View File
@@ -152,9 +152,6 @@ Public Class ProjectManagerVM
#Region "NewCommand"
''' <summary>
''' Returns a command that do New.
''' </summary>
Public ReadOnly Property NewCommand As ICommand
Get
If m_cmdNew Is Nothing Then
@@ -164,9 +161,6 @@ Public Class ProjectManagerVM
End Get
End Property
''' <summary>
''' Execute the New. This method is invoked by the NewCommand.
''' </summary>
Public Sub NewCmd()
' Gestisco porta corrente modificata
If Not Map.refAssemblyManagerVM.ManageModified() Then Return
@@ -179,6 +173,17 @@ Public Class ProjectManagerVM
Map.refAssemblyManagerVM.Open(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName)
Return
End If
' controllo che il direttorio non esista
Dim MsgResult As MessageBoxResult = MessageBoxResult.Yes
If Directory.Exists(SaveFileDialog.FileName) Then
MsgResult = MessageBox.Show("Directory " & SaveFileDialog.FileName & " already exists! Do you want to overwrite it?", "Caution", MessageBoxButton.YesNo, MessageBoxImage.Asterisk)
' cancello il direttorio
Directory.Delete(SaveFileDialog.FileName, True)
End If
If MsgResult = MessageBoxResult.No Then
Map.refAssemblyManagerVM.Open(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName)
Return
End If
' Creo nuovo progetto
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
Directory.CreateDirectory(SaveFileDialog.FileName)
@@ -200,9 +205,6 @@ Public Class ProjectManagerVM
#Region "OpenCommand"
''' <summary>
''' Returns a command that do Open.
''' </summary>
Public ReadOnly Property OpenCommand As ICommand
Get
If m_cmdOpen Is Nothing Then
@@ -293,9 +295,6 @@ Public Class ProjectManagerVM
#Region "OpenMruFileCommand"
''' <summary>
''' Returns a command that do Open.
''' </summary>
Public ReadOnly Property OpenMruFileCommand As ICommand
Get
If m_cmdOpenMruFile Is Nothing Then
@@ -305,9 +304,6 @@ Public Class ProjectManagerVM
End Get
End Property
''' <summary>
''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary>
Public Sub OpenMruFile(ByVal param As Object)
OpenProject(DirectCast(param, String).Replace("__", "_"))
End Sub
@@ -316,9 +312,6 @@ Public Class ProjectManagerVM
#Region "SaveCommand"
''' <summary>
''' Returns a command that do Save.
''' </summary>
Public ReadOnly Property SaveCommand As ICommand
Get
If m_cmdSave Is Nothing Then
@@ -328,9 +321,6 @@ Public Class ProjectManagerVM
End Get
End Property
''' <summary>
''' Execute the Save. This method is invoked by the SaveCommand.
''' </summary>
Public Sub Save()
' Verifico esista elemento selezionato
If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
@@ -347,9 +337,6 @@ Public Class ProjectManagerVM
#Region "OptionsCommand"
''' <summary>
''' Returns a command that do Export.
''' </summary>
Public ReadOnly Property OptionsCommand As ICommand
Get
If m_cmdOptions Is Nothing Then
@@ -359,12 +346,9 @@ Public Class ProjectManagerVM
End Get
End Property
''' <summary>
''' Execute the Export. This method is invoked by the ExportCommand.
''' </summary>
Public Sub Options(ByVal param As Object)
Dim OptionsWindow As New OptionsV
OptionsWindow.Height = 550
OptionsWindow.Height = 650
OptionsWindow.Width = 650
OptionsWindow.DataContext = New OptionsVM()
OptionsWindow.Owner = Application.Current.MainWindow
@@ -621,6 +605,12 @@ Public Class ProjectManagerVM
End Property
Public Sub CopyDDF()
If IsNothing(Map.refAssemblyManagerVM.CurrProject) OrElse
IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
' 50192 = Impossible to export to machine a door if there is not a door!
MessageBox.Show(EgtMsg(50192), EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning)
Return
End If
'Verifico che tutto sia salvato, altrimenti esco con messaggio
If Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified() Then
' Project must be saved before copying
@@ -681,7 +671,13 @@ Public Class ProjectManagerVM
End Property
Public Sub Duplica()
If IsNothing(Map.refAssemblyManagerVM.CurrProject) Then Return
' questo test potrebbe essere sostituito con il controllo : If IsNothing(Map.refPartPageVM.CurrPart) Then Return
If IsNothing(Map.refAssemblyManagerVM.CurrProject) OrElse
IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
' 50191 = Impossible to copy a door if there is not a door!
MessageBox.Show(EgtMsg(50191), EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning)
Return
End If
If Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified() Then
' Project must be saved before copying
MessageBox.Show(EgtMsg(50186), EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning)
@@ -800,7 +796,13 @@ Public Class ProjectManagerVM
End Property
Public Sub Print(ByVal param As Object)
If IsNothing(Map.refAssemblyManagerVM.CurrProject) Then Return
' questo test potrebbe essere sostituito con il controllo : If IsNothing(Map.refPartPageVM.CurrPart) Then Return
If IsNothing(Map.refAssemblyManagerVM.CurrProject) OrElse
IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
' 50193 = Impossible to print a door if there is not a door!
MessageBox.Show(EgtMsg(50193), EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning)
Return
End If
If Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified() Then
' Project must be saved before printing
MessageBox.Show(EgtMsg(50186), EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning)
+36 -24
View File
@@ -5,32 +5,43 @@ Imports System.Text.RegularExpressions
Imports System.IO
Public Module Utility
' dato il nome della componete ricerso il file di configurazione associato
' dato il nome della componete ricerco 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"
Dim CurrDir() As String = FrameCompoFile.Split("\"c)
' DirettorioCompo\NomeFile -> questa è la struttura minima che posso ricevere, altrimenti è un errore
If CurrDir.Count > 1 Then
FrameCompoFileConfig = CurrDir(0) & "\" & ConstCompo.CONFIGINI_FILE_NAME
' restituisco il percorso completo del file caricato
'FrameCompoFile = IniFile.m_CompoDir & "\" & FrameCompoFile
FrameCompoFileConfig = IniFile.m_CompoDir & "\" & FrameCompoFileConfig
Return True
End If
If File.Exists(FrameCompoFileConfig) Then
FrameCompoFileConfig = FrameCompoFileConfig.Remove(FrameCompoFileConfig.LastIndexOf("\"))
While Not bFileConfig And Not FrameCompoFileConfig.Count < 2
Dim CurrDirectory() As String = Directory.GetFiles(FrameCompoFileConfig)
Dim Index As Integer = 0
FrameCompoFileConfig &= "\" & ConstCompo.CONFIGINI_FILE_NAME
For Index = 0 To CurrDirectory.Count - 1
If CurrDirectory(Index) = FrameCompoFileConfig Then
bFileConfig = True
Exit While
End If
Next
FrameCompoFileConfig = FrameCompoFileConfig.Remove(FrameCompoFileConfig.LastIndexOf("\"))
FrameCompoFileConfig = FrameCompoFileConfig.Remove(FrameCompoFileConfig.LastIndexOf("\"))
End While
End If
Return bFileConfig
Return False
''--------------------------------------------------------------------------------------------------------------------
'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
'If File.Exists(FrameCompoFileConfig) Then
' FrameCompoFileConfig = FrameCompoFileConfig.Remove(FrameCompoFileConfig.LastIndexOf("\"))
' While Not bFileConfig And Not FrameCompoFileConfig.Count < 2
' Dim CurrDirectory() As String = Directory.GetFiles(FrameCompoFileConfig)
' Dim Index As Integer = 0
' FrameCompoFileConfig &= "\" & ConstCompo.CONFIGINI_FILE_NAME
' For Index = 0 To CurrDirectory.Count - 1
' If CurrDirectory(Index) = FrameCompoFileConfig Then
' bFileConfig = True
' Exit While
' End If
' Next
' FrameCompoFileConfig = FrameCompoFileConfig.Remove(FrameCompoFileConfig.LastIndexOf("\"))
' FrameCompoFileConfig = FrameCompoFileConfig.Remove(FrameCompoFileConfig.LastIndexOf("\"))
' End While
'End If
'Return bFileConfig
End Function
' aggiuge un asterisco al nome dell'assemblato da stampare nel bottone
@@ -341,6 +352,7 @@ Public Module Utility
CurrFolder = Nothing
Dim CurrFrameFolder As CompoBrandDir = Nothing
Dim CurrHardwareFolder As CompoBrandDir = Nothing
' bisogna correggere il caricamneto dei direttori, ho trovato u errore
For Each File In FileArray
File = File.Replace("/", "\")
If Not Path.GetExtension(File) = INI_EXTENSION And Not Path.GetExtension(File) = TEMPL_EXTENSION And