eb628e7dc4
- Gestione dei bevel.
1398 lines
48 KiB
VB.net
1398 lines
48 KiB
VB.net
Imports System.Collections.ObjectModel
|
|
Imports System.ComponentModel
|
|
Imports EgtUILib
|
|
Imports EgtWPFLib5
|
|
|
|
Public Class OptionsVM
|
|
Implements INotifyPropertyChanged
|
|
|
|
' serve per definire l'indirizzo per la guida (senza aggiungere l'estenzione!)
|
|
Dim m_Chapter As String
|
|
|
|
Public ReadOnly Property LanguageList As ObservableCollection(Of Language)
|
|
Get
|
|
Return OptionModule.m_LanguageList
|
|
End Get
|
|
End Property
|
|
|
|
Public Property SelectedLanguage As Language
|
|
Get
|
|
Return OptionModule.m_SelectedLanguage
|
|
End Get
|
|
Set(value As Language)
|
|
If value IsNot OptionModule.m_SelectedLanguage Then
|
|
OptionModule.m_SelectedLanguage = value
|
|
WriteMainPrivateProfileString(S_GENERAL, K_MESSAGES, m_SelectedLanguage.Name)
|
|
End If
|
|
m_Chapter = "language"
|
|
End Set
|
|
End Property
|
|
|
|
Public ReadOnly Property MeasureUnitList As List(Of String)
|
|
Get
|
|
Return OptionModule.m_MeasureUnitList
|
|
End Get
|
|
End Property
|
|
|
|
Public Property SelectedMeasureUnit As String
|
|
Get
|
|
Return OptionModule.m_SelectedMeasureUnit
|
|
End Get
|
|
Set(value As String)
|
|
If value IsNot OptionModule.m_SelectedMeasureUnit Then
|
|
OptionModule.m_bIsMmUnit = (value = OptionModule.m_MeasureUnitList(0))
|
|
EgtSetUiUnits(OptionModule.m_bIsMmUnit)
|
|
WriteMainPrivateProfileString(S_SCENE, K_MMUNITS, If(OptionModule.m_bIsMmUnit, "1", "0"))
|
|
OptionModule.m_SelectedMeasureUnit = value
|
|
End If
|
|
m_Chapter = "unit_measure"
|
|
End Set
|
|
End Property
|
|
|
|
Public ReadOnly Property OptionLauncher As List(Of String)
|
|
Get
|
|
Return OptionModule.m_OptionLauncherList
|
|
End Get
|
|
End Property
|
|
|
|
Public Property SelectedOptionLauncher As String
|
|
Get
|
|
Return OptionModule.m_SelectedOptionLauncher
|
|
End Get
|
|
Set(value As String)
|
|
If value IsNot OptionModule.m_SelectedOptionLauncher Then
|
|
OptionModule.m_SelectedOptionLauncher = Trim(value)
|
|
Select Case OptionModule.m_SelectedOptionLauncher
|
|
Case "Open Window"
|
|
WriteMainPrivateProfileString(S_LAUNCHERWINDOW, K_LAUNCHER, CStr(0))
|
|
Case "Last Project"
|
|
WriteMainPrivateProfileString(S_LAUNCHERWINDOW, K_LAUNCHER, CStr(1))
|
|
Case "Empty"
|
|
WriteMainPrivateProfileString(S_LAUNCHERWINDOW, K_LAUNCHER, CStr(2))
|
|
End Select
|
|
m_Chapter = "start_up"
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public ReadOnly Property DispositionIsEnable As Boolean
|
|
Get
|
|
Return OptionModule.DispositionBoolean
|
|
End Get
|
|
End Property
|
|
|
|
' Carico i parametri associati al Bevel Up
|
|
Public Property BevelUpIsChecked As Boolean
|
|
Get
|
|
If OptionModule.m_bBevelUp = Visibility.Visible Then
|
|
Return True
|
|
Else
|
|
Return False
|
|
End If
|
|
End Get
|
|
Set(value As Boolean)
|
|
' se sto accendendo o spegmemdo un bevel
|
|
If QuestionSetBevel(CheckBevel(OptionModule.m_bBevelUp, value), "BU") Then
|
|
If value Then
|
|
OptionModule.m_bBevelUp = Visibility.Visible
|
|
Else
|
|
OptionModule.m_bBevelUp = Visibility.Collapsed
|
|
End If
|
|
|
|
If value Then
|
|
DefaultWritePrivateProfileString(S_EDGE, K_BEVELU_INI, "1")
|
|
Else
|
|
DefaultWritePrivateProfileString(S_EDGE, K_BEVELU_INI, "0")
|
|
End If
|
|
RefreshEdgeTypeList()
|
|
Else
|
|
Return
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
' Carico i parametri associati al Bevel Down
|
|
Public Property BevelDownIsChecked As Boolean
|
|
Get
|
|
If OptionModule.m_bBevelDown = Visibility.Visible Then
|
|
Return True
|
|
Else
|
|
Return False
|
|
End If
|
|
End Get
|
|
Set(value As Boolean)
|
|
If QuestionSetBevel(CheckBevel(OptionModule.m_bBevelDown, value), "BD") Then
|
|
If value Then
|
|
OptionModule.m_bBevelDown = Visibility.Visible
|
|
Else
|
|
OptionModule.m_bBevelDown = Visibility.Collapsed
|
|
End If
|
|
If value Then
|
|
DefaultWritePrivateProfileString(S_EDGE, K_BEVELD_INI, "1")
|
|
Else
|
|
DefaultWritePrivateProfileString(S_EDGE, K_BEVELD_INI, "0")
|
|
End If
|
|
RefreshEdgeTypeList()
|
|
Else
|
|
Return
|
|
End If
|
|
m_Chapter = "bevel_down"
|
|
End Set
|
|
End Property
|
|
|
|
' Carico i valori di Default della porta
|
|
Public Property WidthValue As String
|
|
Get
|
|
Return OptionModule.m_Width
|
|
End Get
|
|
Set(value As String)
|
|
OptionModule.m_Width = value
|
|
DefaultWritePrivateProfileString(S_SIZE, K_WIDTH_INI, OptionModule.m_Width)
|
|
End Set
|
|
End Property
|
|
|
|
Public Property HeightValue As String
|
|
Get
|
|
Return OptionModule.m_Height
|
|
End Get
|
|
Set(value As String)
|
|
OptionModule.m_Height = value
|
|
DefaultWritePrivateProfileString(S_SIZE, K_HEIGHT_INI, OptionModule.m_Height)
|
|
End Set
|
|
End Property
|
|
|
|
Public Property ThicknessValue As String
|
|
Get
|
|
Return OptionModule.m_Thickness
|
|
End Get
|
|
Set(value As String)
|
|
OptionModule.m_Thickness = value
|
|
DefaultWritePrivateProfileString(S_SIZE, K_THICKNESS_INI, OptionModule.m_Thickness)
|
|
End Set
|
|
End Property
|
|
|
|
Public Property WeightValue As String
|
|
Get
|
|
Return OptionModule.m_Weight
|
|
End Get
|
|
Set(value As String)
|
|
OptionModule.m_Weight = value
|
|
DefaultWritePrivateProfileString(S_SIZE, K_WEIGHT_INI, OptionModule.m_Weight)
|
|
End Set
|
|
End Property
|
|
|
|
Public Shared Property IsCheckedWeight As Boolean
|
|
Get
|
|
If Part.IsCheckedWeight = Visibility.Visible Then
|
|
Return True
|
|
Else
|
|
Return False
|
|
End If
|
|
End Get
|
|
Set(value As Boolean)
|
|
If value Then
|
|
Part.IsCheckedWeight = Visibility.Visible
|
|
DefaultWritePrivateProfileString(S_SIZE, K_WEIGHTISCHECKED_INI, "1")
|
|
Else
|
|
If Part.IsCheckedWeight = Visibility.Visible Then
|
|
If MessageBox.Show(EgtMsg(50153), EgtMsg(50110), MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) = MessageBoxResult.Yes Then
|
|
Part.IsCheckedWeight = Visibility.Collapsed
|
|
DefaultWritePrivateProfileString(S_SIZE, K_WEIGHTISCHECKED_INI, "0")
|
|
Else
|
|
Return
|
|
End If
|
|
End If
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public ReadOnly Property SwingTypeList As List(Of String)
|
|
Get
|
|
Return OptionModule.m_SwingTypeList
|
|
End Get
|
|
End Property
|
|
|
|
Public Property SwingValue As String
|
|
Get
|
|
Return OptionModule.m_Swing
|
|
End Get
|
|
Set(value As String)
|
|
OptionModule.m_Swing = value
|
|
DefaultWritePrivateProfileString(S_SIZE, K_SWING_INI, OptionModule.m_Swing)
|
|
End Set
|
|
End Property
|
|
|
|
Public Shared ReadOnly Property EdgeTypeList As ObservableCollection(Of EdgeType)
|
|
Get
|
|
Return Part.m_EdgeTypeList
|
|
End Get
|
|
End Property
|
|
|
|
Public Shared ReadOnly Property TopEdgeTypeList As ObservableCollection(Of EdgeType)
|
|
Get
|
|
Return Part.m_TopEdgeTypeList
|
|
End Get
|
|
End Property
|
|
|
|
Public Shared ReadOnly Property FrameEdgeTypeList As ObservableCollection(Of EdgeType)
|
|
Get
|
|
Return Assembly.m_FrameEdgeTypeList
|
|
End Get
|
|
End Property
|
|
|
|
|
|
Public Property LockEdgeType As EdgeType
|
|
Get
|
|
If m_LockEdgeType.IsActive = Visibility.Collapsed Then
|
|
m_LockEdgeType = EdgeTypeList(0)
|
|
End If
|
|
Return m_LockEdgeType
|
|
End Get
|
|
Set(value As EdgeType)
|
|
OptionModule.m_LockEdgeType = value
|
|
DefaultWritePrivateProfileString(S_EDGE, K_LOCKEDGE_INI, OptionModule.m_LockEdgeType.Name)
|
|
End Set
|
|
End Property
|
|
|
|
Public Property HingeEdgeType As EdgeType
|
|
Get
|
|
If m_HingeEdgeType.IsActive = Visibility.Collapsed Then
|
|
m_HingeEdgeType = EdgeTypeList(0)
|
|
End If
|
|
Return m_HingeEdgeType
|
|
End Get
|
|
Set(value As EdgeType)
|
|
m_HingeEdgeType = value
|
|
DefaultWritePrivateProfileString(S_EDGE, K_HINGEDGE_INI, OptionModule.m_HingeEdgeType.Name)
|
|
End Set
|
|
End Property
|
|
|
|
Public Property TopType As EdgeType
|
|
Get
|
|
If m_TopType.IsActive = Visibility.Collapsed Then
|
|
m_TopType = TopEdgeTypeList(0)
|
|
Else
|
|
Try
|
|
m_TopType = TopEdgeTypeList.First(Function(x) x.Name = m_TopType.Name)
|
|
Catch ex As Exception
|
|
m_TopType = TopEdgeTypeList(0)
|
|
End Try
|
|
End If
|
|
Return m_TopType
|
|
End Get
|
|
Set(value As EdgeType)
|
|
OptionModule.m_TopType = value
|
|
DefaultWritePrivateProfileString(S_EDGE, K_TOPEDGE_INI, OptionModule.m_TopType.Name)
|
|
End Set
|
|
End Property
|
|
|
|
Public Property BottomType As EdgeType
|
|
Get
|
|
If m_BottomType.IsActive = Visibility.Collapsed Then
|
|
m_BottomType = TopEdgeTypeList(0)
|
|
Else
|
|
Try
|
|
m_BottomType = TopEdgeTypeList.First(Function(x) x.Name = m_BottomType.Name)
|
|
Catch ex As Exception
|
|
m_BottomType = TopEdgeTypeList(0)
|
|
End Try
|
|
End If
|
|
Return m_BottomType
|
|
End Get
|
|
Set(value As EdgeType)
|
|
OptionModule.m_BottomType = value
|
|
DefaultWritePrivateProfileString(S_EDGE, K_BOTTOMEDGE_INI, OptionModule.m_BottomType.Name)
|
|
End Set
|
|
End Property
|
|
|
|
' is Checked
|
|
Public Property LockEdgeIsChecked As Boolean
|
|
Get
|
|
Return OptionModule.m_LockEdgeMachining
|
|
End Get
|
|
Set(value As Boolean)
|
|
OptionModule.m_LockEdgeMachining = value
|
|
If value Then
|
|
DefaultWritePrivateProfileString(S_MACHINING, K_LOCKEDGEISCHECKED_INI, "1")
|
|
Else
|
|
DefaultWritePrivateProfileString(S_MACHINING, K_LOCKEDGEISCHECKED_INI, "0")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Property HingeEdgeIsChecked As Boolean
|
|
Get
|
|
Return OptionModule.m_HingeEdgeMachining
|
|
End Get
|
|
Set(value As Boolean)
|
|
OptionModule.m_HingeEdgeMachining = value
|
|
If value Then
|
|
DefaultWritePrivateProfileString(S_MACHINING, K_HINGEDGEEISCHECKED_INI, "1")
|
|
Else
|
|
DefaultWritePrivateProfileString(S_MACHINING, K_HINGEDGEEISCHECKED_INI, "0")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Property TopIsChecked As Boolean
|
|
Get
|
|
Return OptionModule.m_TopMachining
|
|
End Get
|
|
Set(value As Boolean)
|
|
OptionModule.m_TopMachining = value
|
|
If value Then
|
|
DefaultWritePrivateProfileString(S_MACHINING, K_TOPISCHECKED_INI, "1")
|
|
Else
|
|
DefaultWritePrivateProfileString(S_MACHINING, K_TOPISCHECKED_INI, "0")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Property BottomIsChecked As Boolean
|
|
Get
|
|
Return OptionModule.m_BottomMachining
|
|
End Get
|
|
Set(value As Boolean)
|
|
OptionModule.m_BottomMachining = value
|
|
If value Then
|
|
DefaultWritePrivateProfileString(S_MACHINING, K_BOTTOMISCHECKED_INI, "1")
|
|
Else
|
|
DefaultWritePrivateProfileString(S_MACHINING, K_BOTTOMISCHECKED_INI, "0")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
' OverMaterial
|
|
Public Property LockEdgeOverMaterialValue As String
|
|
Get
|
|
Return OptionModule.m_LockEdgeOverMaterial
|
|
End Get
|
|
Set(value As String)
|
|
OptionModule.m_LockEdgeOverMaterial = value
|
|
DefaultWritePrivateProfileString(S_OVERMATERIAL, K_LOCKEDGEOVERMATERIAL_INI, OptionModule.m_LockEdgeOverMaterial)
|
|
End Set
|
|
End Property
|
|
|
|
Public Property HingeEdgeOverMaterialValue As String
|
|
Get
|
|
Return OptionModule.m_HingeEdgeOverMaterial
|
|
End Get
|
|
Set(value As String)
|
|
OptionModule.m_HingeEdgeOverMaterial = value
|
|
DefaultWritePrivateProfileString(S_OVERMATERIAL, K_HINGEDGEOVERMATERIAL_INI, OptionModule.m_HingeEdgeOverMaterial)
|
|
End Set
|
|
End Property
|
|
|
|
Public Property TopOverMaterialValue As String
|
|
Get
|
|
Return OptionModule.m_TopOverMaterial
|
|
End Get
|
|
Set(value As String)
|
|
OptionModule.m_TopOverMaterial = value
|
|
DefaultWritePrivateProfileString(S_OVERMATERIAL, K_TOPOVERMATERIAL_INI, OptionModule.m_TopOverMaterial)
|
|
End Set
|
|
End Property
|
|
|
|
Public Property BottomOverMaterialValue As String
|
|
Get
|
|
Return OptionModule.m_BottomOverMaterial
|
|
End Get
|
|
Set(value As String)
|
|
OptionModule.m_BottomOverMaterial = value
|
|
DefaultWritePrivateProfileString(S_OVERMATERIAL, K_BOTTOMOVERMATERIAL_INI, OptionModule.m_BottomOverMaterial)
|
|
End Set
|
|
End Property
|
|
|
|
Public Property MyProjectDir As String
|
|
Get
|
|
Return IniFile.m_MyProjectDir
|
|
End Get
|
|
Set(value As String)
|
|
If value IsNot IniFile.m_MyProjectDir Then
|
|
IniFile.m_MyProjectDir = value
|
|
WriteMainPrivateProfileString(S_DOORS, K_MYPROJECTDIR, value)
|
|
End If
|
|
NotifyPropertyChanged("MyProjectDir")
|
|
End Set
|
|
End Property
|
|
|
|
Public Property MachinDir As String
|
|
Get
|
|
Return IniFile.m_MachinProject
|
|
End Get
|
|
Set(value As String)
|
|
If value IsNot IniFile.m_MachinProject Then
|
|
IniFile.m_MachinProject = value
|
|
WriteMainPrivateProfileString(S_DOORS, K_MACHINDIR, value)
|
|
End If
|
|
NotifyPropertyChanged("MachinDir")
|
|
End Set
|
|
End Property
|
|
|
|
'----------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
Public ReadOnly Property EnableAssembly As Boolean
|
|
Get
|
|
Return (OptionModule.m_ConfigurationSoftware = ConfigType.Assembly)
|
|
End Get
|
|
End Property
|
|
|
|
Public Property LightUp As String
|
|
Get
|
|
Return OptionModule.m_LightUp
|
|
End Get
|
|
Set(value As String)
|
|
OptionModule.m_LightUp = value
|
|
DefaultWritePrivateProfileString(S_LIGHT, K_LIGHTUP, OptionModule.m_LightUp)
|
|
End Set
|
|
End Property
|
|
|
|
Public Property LightBottom As String
|
|
Get
|
|
Return OptionModule.m_LightBottom
|
|
End Get
|
|
Set(value As String)
|
|
OptionModule.m_LightBottom = value
|
|
' modifico le dimensioni dei Jambs
|
|
DefaultWritePrivateProfileString(S_LIGHT, K_LIGHTBOTTOM, OptionModule.m_LightBottom)
|
|
End Set
|
|
End Property
|
|
|
|
Public Property LightHinge As String
|
|
Get
|
|
Return OptionModule.m_LightHinge
|
|
End Get
|
|
Set(value As String)
|
|
OptionModule.m_LightHinge = value
|
|
DefaultWritePrivateProfileString(S_LIGHT, K_LIGHTHINGE, OptionModule.m_LightHinge)
|
|
End Set
|
|
End Property
|
|
|
|
Public Property LightLock As String
|
|
Get
|
|
Return OptionModule.m_LightLock
|
|
End Get
|
|
Set(value As String)
|
|
OptionModule.m_LightLock = value
|
|
DefaultWritePrivateProfileString(S_LIGHT, K_LIGHTLOCK, OptionModule.m_LightLock)
|
|
End Set
|
|
End Property
|
|
|
|
' spessore del jamb della testa
|
|
Public Property ThicknessHead As String
|
|
Get
|
|
Return OptionModule.m_ThicknessHead
|
|
End Get
|
|
Set(value As String)
|
|
OptionModule.m_ThicknessHead = value
|
|
DefaultWritePrivateProfileString(S_OVERLAP, K_THICKNESSHEAD, OptionModule.m_ThicknessHead)
|
|
End Set
|
|
End Property
|
|
|
|
Public Property OverlapHinge As String
|
|
Get
|
|
Return OptionModule.m_OverlapHinge
|
|
End Get
|
|
Set(value As String)
|
|
OptionModule.m_OverlapHinge = value
|
|
DefaultWritePrivateProfileString(S_OVERLAP, K_OVERLAPHINGE, OptionModule.m_OverlapHinge)
|
|
End Set
|
|
End Property
|
|
|
|
Public Property OverlapLock As String
|
|
Get
|
|
Return OptionModule.m_OverlapLock
|
|
End Get
|
|
Set(value As String)
|
|
OptionModule.m_OverlapLock = value
|
|
DefaultWritePrivateProfileString(S_OVERLAP, K_OVERLAPLOCK, OptionModule.m_OverlapLock)
|
|
End Set
|
|
End Property
|
|
|
|
Public Property OverlapTop As String
|
|
Get
|
|
Return OptionModule.m_OverlapTop
|
|
End Get
|
|
Set(value As String)
|
|
OptionModule.m_OverlapTop = value
|
|
DefaultWritePrivateProfileString(S_OVERLAP, K_OVERLAPTOP, OptionModule.m_OverlapTop)
|
|
End Set
|
|
End Property
|
|
|
|
Public Property DeltaThickness As String
|
|
Get
|
|
Return OptionModule.m_DeltaThickness
|
|
End Get
|
|
Set(value As String)
|
|
OptionModule.m_DeltaThickness = value
|
|
DefaultWritePrivateProfileString(S_OVERLAP, K_DELTAT, OptionModule.m_DeltaThickness)
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Exterior As Boolean
|
|
Get
|
|
Return OptionModule.m_Exterior
|
|
End Get
|
|
Set(value As Boolean)
|
|
OptionModule.m_Exterior = value
|
|
If OptionModule.m_Exterior Then
|
|
DefaultWritePrivateProfileString(S_OVERLAP, K_EXTERIOR, "1")
|
|
Else
|
|
DefaultWritePrivateProfileString(S_OVERLAP, K_EXTERIOR, "0")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Property ThicknessJamb As String
|
|
Get
|
|
Return OptionModule.m_ThicknessJamb
|
|
End Get
|
|
Set(value As String)
|
|
OptionModule.m_ThicknessJamb = value
|
|
DefaultWritePrivateProfileString(S_SIZEJAMB, K_THICKNESS, OptionModule.m_ThicknessJamb)
|
|
End Set
|
|
End Property
|
|
|
|
Public Property WidthJamb As String
|
|
Get
|
|
Return OptionModule.m_WidthJamb
|
|
End Get
|
|
Set(value As String)
|
|
OptionModule.m_WidthJamb = value
|
|
DefaultWritePrivateProfileString(S_SIZEJAMB, K_WIDTH, OptionModule.m_WidthJamb)
|
|
End Set
|
|
End Property
|
|
|
|
Public ReadOnly Property DoorListNumber As List(Of String)
|
|
Get
|
|
Return OptionModule.m_DoorsListNumber
|
|
End Get
|
|
End Property
|
|
|
|
Public Property DoorNumber As String
|
|
Get
|
|
Return OptionModule.m_DoorsNumber
|
|
End Get
|
|
Set(value As String)
|
|
|
|
End Set
|
|
End Property
|
|
|
|
Public Property LockEdgeTypeAssembly As EdgeType
|
|
Get
|
|
If m_LockEdgeTypeAssembly.IsActive = Visibility.Collapsed Then
|
|
OptionModule.m_LockEdgeTypeAssembly = EdgeTypeList(0)
|
|
End If
|
|
Return OptionModule.m_LockEdgeTypeAssembly
|
|
End Get
|
|
Set(value As EdgeType)
|
|
OptionModule.m_LockEdgeTypeAssembly = value
|
|
DefaultWritePrivateProfileString(S_EDGEASSEMBLY, K_LOCKEDGE, OptionModule.m_LockEdgeTypeAssembly.Name)
|
|
End Set
|
|
End Property
|
|
|
|
Public Property HingeEdgeTypeAssembly As EdgeType
|
|
Get
|
|
If m_HingeEdgeTypeAssembly.IsActive = Visibility.Collapsed Then
|
|
OptionModule.m_HingeEdgeTypeAssembly = EdgeTypeList(0)
|
|
End If
|
|
Return OptionModule.m_HingeEdgeTypeAssembly
|
|
End Get
|
|
Set(value As EdgeType)
|
|
OptionModule.m_HingeEdgeTypeAssembly = value
|
|
DefaultWritePrivateProfileString(S_EDGEASSEMBLY, K_HINGEDGE_INI, OptionModule.m_HingeEdgeTypeAssembly.Name)
|
|
End Set
|
|
End Property
|
|
|
|
Public Property TopTypeAssembly As EdgeType
|
|
Get
|
|
If m_TopTypeAssembly.IsActive = Visibility.Collapsed Then
|
|
OptionModule.m_TopTypeAssembly = EdgeTypeList(0)
|
|
End If
|
|
Return OptionModule.m_TopTypeAssembly
|
|
End Get
|
|
Set(value As EdgeType)
|
|
OptionModule.m_TopTypeAssembly = value
|
|
DefaultWritePrivateProfileString(S_EDGEASSEMBLY, K_TOPEDGE_INI, OptionModule.m_TopTypeAssembly.Name)
|
|
End Set
|
|
End Property
|
|
|
|
Public Property BottomTypeAssembly As EdgeType
|
|
Get
|
|
If m_BottomTypeAssembly.IsActive = Visibility.Collapsed Then
|
|
OptionModule.m_BottomTypeAssembly = EdgeTypeList(0)
|
|
End If
|
|
Return OptionModule.m_BottomTypeAssembly
|
|
End Get
|
|
Set(value As EdgeType)
|
|
OptionModule.m_BottomTypeAssembly = value
|
|
DefaultWritePrivateProfileString(S_EDGEASSEMBLY, K_BOTTOMEDGE_INI, OptionModule.m_BottomTypeAssembly.Name)
|
|
End Set
|
|
End Property
|
|
|
|
#Region "Machining Assembly"
|
|
Public Property LockEdgeMachiningAssembly As Boolean
|
|
Get
|
|
Return OptionModule.m_LockEdgeMachiningAssembly
|
|
End Get
|
|
Set(value As Boolean)
|
|
OptionModule.m_LockEdgeMachiningAssembly = value
|
|
If value Then
|
|
DefaultWritePrivateProfileString(S_MACHININGASSEMBLY, K_LOCKEDGEISCHECKED_INI, "1")
|
|
Else
|
|
DefaultWritePrivateProfileString(S_MACHININGASSEMBLY, K_LOCKEDGEISCHECKED_INI, "0")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Property LockEdgeOverMaterialAssembly As String
|
|
Get
|
|
Return OptionModule.m_LockEdgeOverMaterialAssembly
|
|
End Get
|
|
Set(value As String)
|
|
OptionModule.m_LockEdgeOverMaterialAssembly = value
|
|
DefaultWritePrivateProfileString(S_OVERMATERIALASSEMBLY, K_LOCKEDGEOVERMATERIAL_INI, OptionModule.m_LockEdgeOverMaterialAssembly)
|
|
End Set
|
|
End Property
|
|
|
|
Public Property HingeEdgeMachiningAssembly As Boolean
|
|
Get
|
|
Return OptionModule.m_HingeEdgeMachiningAssembly
|
|
End Get
|
|
Set(value As Boolean)
|
|
OptionModule.m_HingeEdgeMachiningAssembly = value
|
|
If value Then
|
|
DefaultWritePrivateProfileString(S_MACHININGASSEMBLY, K_HINGEDGEEISCHECKED_INI, "1")
|
|
Else
|
|
DefaultWritePrivateProfileString(S_MACHININGASSEMBLY, K_HINGEDGEEISCHECKED_INI, "0")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Property HingeEdgeOverMaterialAssembly As String
|
|
Get
|
|
Return OptionModule.m_HingeEdgeOverMaterialAssembly
|
|
End Get
|
|
Set(value As String)
|
|
OptionModule.m_HingeEdgeOverMaterialAssembly = value
|
|
DefaultWritePrivateProfileString(S_OVERMATERIALASSEMBLY, K_HINGEDGEOVERMATERIAL_INI, OptionModule.m_HingeEdgeOverMaterialAssembly)
|
|
End Set
|
|
End Property
|
|
|
|
Public Property TopMachiningAssembly As Boolean
|
|
Get
|
|
Return OptionModule.m_TopMachiningAssembly
|
|
End Get
|
|
Set(value As Boolean)
|
|
OptionModule.m_TopMachiningAssembly = value
|
|
If value Then
|
|
DefaultWritePrivateProfileString(S_MACHININGASSEMBLY, K_TOPISCHECKED_INI, "1")
|
|
Else
|
|
DefaultWritePrivateProfileString(S_MACHININGASSEMBLY, K_TOPISCHECKED_INI, "0")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Property TopOverMaterialAssembly As String
|
|
Get
|
|
Return OptionModule.m_TopOverMaterialAssembly
|
|
End Get
|
|
Set(value As String)
|
|
OptionModule.m_TopOverMaterialAssembly = value
|
|
DefaultWritePrivateProfileString(S_OVERMATERIALASSEMBLY, K_TOPOVERMATERIAL_INI, OptionModule.m_TopOverMaterialAssembly)
|
|
End Set
|
|
End Property
|
|
|
|
Public Property BottomMachiningAssembly As Boolean
|
|
Get
|
|
Return OptionModule.m_BottomMachiningAssembly
|
|
End Get
|
|
Set(value As Boolean)
|
|
OptionModule.m_BottomMachiningAssembly = value
|
|
If value Then
|
|
DefaultWritePrivateProfileString(S_MACHININGASSEMBLY, K_BOTTOMISCHECKED_INI, "1")
|
|
Else
|
|
DefaultWritePrivateProfileString(S_MACHININGASSEMBLY, K_BOTTOMISCHECKED_INI, "0")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Property BottomOverMaterialAssembly As String
|
|
Get
|
|
Return OptionModule.m_BottomOverMaterialAssembly
|
|
End Get
|
|
Set(value As String)
|
|
OptionModule.m_BottomOverMaterialAssembly = value
|
|
DefaultWritePrivateProfileString(S_OVERMATERIALASSEMBLY, K_BOTTOMOVERMATERIAL_INI, OptionModule.m_BottomOverMaterialAssembly)
|
|
End Set
|
|
End Property
|
|
#End Region ' Machining Assembly
|
|
|
|
'-------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
' Definizione comandi
|
|
Private m_cmdCloseOptions As ICommand
|
|
Private m_cmdBrowse As ICommand
|
|
Private m_F1GuideCmd As ICommand
|
|
|
|
#Region "Messages"
|
|
|
|
Public ReadOnly Property Title As String
|
|
Get
|
|
Return EgtMsg(MSG_MAINWINDOW + 209)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property StartUpMsg As String
|
|
Get
|
|
Return EgtMsg(MSG_MAINWINDOW + 210)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property CurrentLanguageMsg As String
|
|
Get
|
|
Return EgtMsg(MSG_OPTIONPAGE + 1)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property LanguageAdvertMsg As String
|
|
Get
|
|
Return EgtMsg(MSG_OPTIONPAGE + 2)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property MeasureUnit As String
|
|
Get
|
|
Return EgtMsg(50211)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property DirectoryMsg As String
|
|
Get
|
|
Return EgtMsg(50212)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property MachinDirectoryMsg As String
|
|
Get
|
|
Return "Directory Machine "
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property General As String
|
|
Get
|
|
Return EgtMsg(MSG_MAINWINDOW + 201)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property OptionStart As String
|
|
Get
|
|
Return EgtMsg(50213)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property CurrentUnitMeasure As String
|
|
Get
|
|
Return EgtMsg(50200)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property CurrentDirectiry As String
|
|
Get
|
|
Return EgtMsg(50214)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property CurrentMachinDirectiry As String
|
|
Get
|
|
Return "Machine"
|
|
End Get
|
|
End Property
|
|
|
|
|
|
Public ReadOnly Property DoorMsg As String
|
|
Get
|
|
Return "Door"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property WidthMsg As String
|
|
Get
|
|
Return EgtMsg(MSG_MAINWINDOW + 1)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property EdgeMsg As String
|
|
Get
|
|
Return EgtMsg(50215)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property OverMaterialMsg As String
|
|
Get
|
|
Return EgtMsg(50216)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property HeightMsg As String
|
|
Get
|
|
Return EgtMsg(MSG_MAINWINDOW + 2)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property ThicknessMsg As String
|
|
Get
|
|
Return EgtMsg(MSG_MAINWINDOW + 3)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property SwingMsg As String
|
|
Get
|
|
Return EgtMsg(MSG_MAINWINDOW + 4)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property LockEdgeMsg As String
|
|
Get
|
|
Return EgtMsg(MSG_MAINWINDOW + 5)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property HingeEdgeMsg As String
|
|
Get
|
|
Return EgtMsg(MSG_MAINWINDOW + 6)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property TopMsg As String
|
|
Get
|
|
Return EgtMsg(MSG_MAINWINDOW + 7)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property WeightMsg As String
|
|
Get
|
|
Return EgtMsg(MSG_MAINWINDOW + 47)
|
|
End Get
|
|
End Property
|
|
|
|
|
|
Public ReadOnly Property BottomMsg As String
|
|
Get
|
|
Return EgtMsg(MSG_MAINWINDOW + 8)
|
|
End Get
|
|
End Property
|
|
|
|
' Machinig
|
|
Public ReadOnly Property LockEdgeOverMaterial As String
|
|
Get
|
|
Return EgtMsg(MSG_MAINWINDOW + 202)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property HingeEdgeOverMaterial As String
|
|
Get
|
|
Return EgtMsg(MSG_MAINWINDOW + 203)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property TopOverMaterial As String
|
|
Get
|
|
Return EgtMsg(MSG_MAINWINDOW + 204)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property BottomOverMaterial As String
|
|
Get
|
|
Return EgtMsg(MSG_MAINWINDOW + 205)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property MsgBrowse As String
|
|
Get
|
|
Return EgtMsg(50217)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property MsgClose As String
|
|
Get
|
|
Return EgtMsg(50218)
|
|
End Get
|
|
End Property
|
|
|
|
' BevelMsg
|
|
Public ReadOnly Property BevelMsg As String
|
|
Get
|
|
Return EgtMsg(50219)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property BevelUpMsg As String
|
|
Get
|
|
Return EgtMsg(50220)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property BevelDownMsg As String
|
|
Get
|
|
Return EgtMsg(50221)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property MachinePositionMsg As String
|
|
Get
|
|
Return EgtMsg(50222)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property DispConfiguration As String
|
|
Get
|
|
Dim Msg As String = String.Empty
|
|
If OptionModule.m_sDisposition = "BU" Then
|
|
Msg = "Wide Side Down (BU)"
|
|
m_BevelConfiguration = Visibility.Visible
|
|
m_BySwingConfiguration = Visibility.Collapsed
|
|
ElseIf OptionModule.m_sDisposition = "BD" Then
|
|
Msg = "Wide Side Up (BD)"
|
|
m_BevelConfiguration = Visibility.Visible
|
|
m_BySwingConfiguration = Visibility.Collapsed
|
|
Else
|
|
m_BevelConfiguration = Visibility.Collapsed
|
|
m_BySwingConfiguration = Visibility.Visible
|
|
End If
|
|
Return Msg
|
|
End Get
|
|
End Property
|
|
|
|
Private m_BevelConfiguration As Visibility
|
|
Public ReadOnly Property BevelConfiguration As Visibility
|
|
Get
|
|
Return m_BevelConfiguration
|
|
End Get
|
|
End Property
|
|
|
|
Private m_BySwingConfiguration As Visibility
|
|
Public ReadOnly Property BySwingConfiguration As Visibility
|
|
Get
|
|
Return m_BySwingConfiguration
|
|
End Get
|
|
End Property
|
|
'---------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
'tab2
|
|
Public ReadOnly Property AssemblyMsg As String
|
|
Get
|
|
Return "Assembly"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property LightUpMsg As String
|
|
Get
|
|
Return "Light Up"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property LightLockMsg As String
|
|
Get
|
|
Return "Light Lock"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property LightBottomMsg As String
|
|
Get
|
|
Return "Light Bottom"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property LightHingeMsg As String
|
|
Get
|
|
Return "Light Hinge"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property ThicknessHeadMsg As String
|
|
Get
|
|
Return "Thickness Head"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property OverlapHingeMsg As String
|
|
Get
|
|
Return "Overlap Hinge"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property OverlapLockMsg As String
|
|
Get
|
|
Return "Overlap Lock"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property OverlapTopMsg As String
|
|
Get
|
|
Return "Overlap Top"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property DeltaTMsg As String
|
|
Get
|
|
Return "Delta T"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property ExteriorMsg As String
|
|
Get
|
|
Return "Exterior"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property DoorNumberMsg As String
|
|
Get
|
|
Return "Number Doors"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property JambsAndDoorsMsg As String
|
|
Get
|
|
Return "Jambs and Doors"
|
|
End Get
|
|
End Property
|
|
|
|
|
|
#End Region
|
|
|
|
' Controllo di eliminare un bevel dalla lista: 1 se accendo un bevel, 2 se spengo un bevel, -1 tutti i casi che non sono questi
|
|
' VisibilityBevel = il valore della optionPage
|
|
Private Function CheckBevel(VisibilityBevel As Visibility, bValue As Boolean) As Integer
|
|
Dim bAnser As Integer
|
|
Dim bBevel As Boolean
|
|
' converto il parametro di visibilità in un booleano
|
|
If VisibilityBevel = Visibility.Visible Then
|
|
bBevel = True
|
|
Else
|
|
bBevel = False
|
|
End If
|
|
If bBevel And Not bValue Then
|
|
' significa che sta togliendo dalla lista
|
|
bAnser = 1
|
|
ElseIf Not bBevel And bValue Then
|
|
' sto aggiungendo un bevel alla lista
|
|
bAnser = 2
|
|
Else
|
|
' non accade nulla
|
|
bAnser = -1
|
|
End If
|
|
Return bAnser
|
|
End Function
|
|
|
|
' chiedo se vuole continuare: vero se cambia li lista
|
|
Private Function QuestionSetBevel(bCheckBevel As Integer, sBevel As String) As Boolean
|
|
If Not IsNothing(Map.refPartPageVM.CurrPart) Or IsNothing(Map.refAssemblyPageVM.CurrAssembly) Then
|
|
' se la porta esiste
|
|
If bCheckBevel = 1 Then
|
|
' controllo se sto eliminando da uno degli elementi della lista: se si chiedo di continuare
|
|
If Map.refPartPageVM.CurrPart.DispositionItem.Name = sBevel Then
|
|
' Se blocco tutto non accade nulla -- It is the bevel of the current door. Do You want to proced?
|
|
If MessageBox.Show(EgtMsg(50154), EgtMsg(50115), MessageBoxButton.YesNo, MessageBoxImage.Asterisk, MessageBoxResult.No) = MessageBoxResult.No Then
|
|
Return False
|
|
Else
|
|
' se decido di continuare
|
|
Return True
|
|
End If
|
|
Else
|
|
' se non sono presenti elementi nella lista procedo nella eliminazione
|
|
Return True
|
|
End If
|
|
' se sto attivando un bevel nella lista
|
|
ElseIf bCheckBevel = 2 Then
|
|
Return True
|
|
Else
|
|
' per tutti gli altri casi (-1) non accade nulla
|
|
Return False
|
|
End If
|
|
|
|
Else
|
|
Return True
|
|
End If
|
|
End Function
|
|
|
|
' aggiorno la visibilità dei bevel Up e Down
|
|
Public Sub RefreshEdgeTypeList()
|
|
'---------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
' mantenendo la compatibilità con la precedente confinìgurazione
|
|
If OptionModule.m_sDisposition <> "BySwing" Then
|
|
' applico un ciclo for perchè non conosco a priori la posizione all'interno della lista dei bevel BU e BD
|
|
For IndexBevelEdgeTypeList As Integer = 0 To Part.m_EdgeTypeList.Count - 1
|
|
If Part.m_EdgeTypeList(IndexBevelEdgeTypeList).Name = "BU" Then Part.m_EdgeTypeList(IndexBevelEdgeTypeList).IsActive = m_bBevelUp
|
|
If Part.m_EdgeTypeList(IndexBevelEdgeTypeList).Name = "BD" Then Part.m_EdgeTypeList(IndexBevelEdgeTypeList).IsActive = m_bBevelDown
|
|
Next
|
|
For IndexTopBevelEdgeTypeList As Integer = 0 To Part.m_TopEdgeTypeList.Count - 1
|
|
If Part.m_TopEdgeTypeList(IndexTopBevelEdgeTypeList).Name = "BU" Then Part.m_TopEdgeTypeList(IndexTopBevelEdgeTypeList).IsActive = m_bBevelUp
|
|
If Part.m_TopEdgeTypeList(IndexTopBevelEdgeTypeList).Name = "BD" Then Part.m_TopEdgeTypeList(IndexTopBevelEdgeTypeList).IsActive = m_bBevelDown
|
|
Next
|
|
Else ' sono nella configurazione BySwing in cui devo sostituire i Bevel BU e BD con BV
|
|
' devo eliminare temporaneamente dalla lista i Bevel BU e i Bevel BD
|
|
Dim IndexBV As Integer = -1
|
|
' nascondo tutti i bevel della lista
|
|
For IndexBevelEdgeTypeList As Integer = 0 To Part.m_EdgeTypeList.Count - 1
|
|
If Part.m_EdgeTypeList(IndexBevelEdgeTypeList).Name = "BU" Then Part.m_EdgeTypeList(IndexBevelEdgeTypeList).IsActive = Visibility.Collapsed
|
|
If Part.m_EdgeTypeList(IndexBevelEdgeTypeList).Name = "BD" Then
|
|
Part.m_EdgeTypeList(IndexBevelEdgeTypeList).IsActive = Visibility.Collapsed
|
|
IndexBV = IndexBevelEdgeTypeList
|
|
End If
|
|
Next
|
|
Dim BVEdge As New EdgeType("BV", Visibility.Visible)
|
|
Dim ThereIsBV As Integer = -1
|
|
' cerco l'indice del bevel BV, se non lo trovo carico il valore dell'inidce a -1
|
|
For Index As Integer = 0 To Part.m_EdgeTypeList.Count - 1
|
|
If Part.m_EdgeTypeList(Index).Name = "BV" Then
|
|
ThereIsBV = Index
|
|
Exit For
|
|
End If
|
|
Next
|
|
' inserisco il bevel BV se sono nella vecchia configurazione
|
|
If IndexBV <> -1 AndAlso IndexBV < Part.m_EdgeTypeList.Count - 1 AndAlso ThereIsBV = -1 Then
|
|
Part.m_EdgeTypeList.Insert(IndexBV, BVEdge)
|
|
Part.m_TopEdgeTypeList.Insert(IndexBV, BVEdge)
|
|
End If
|
|
If ThereIsBV <> -1 Then IndexBV = ThereIsBV
|
|
' se sono nella vecchia configurazione sostutuisci BU/BD con BV
|
|
If IsNothing(Map.refPartPageVM.CurrPart) Then
|
|
If Map.refPartPageVM.CurrPart.LockEdgeType.Name = "BU" OrElse Map.refPartPageVM.CurrPart.LockEdgeType.Name = "BD" Then Map.refPartPageVM.CurrPart.SetLockEdgeType(Part.m_EdgeTypeList(IndexBV))
|
|
If Map.refPartPageVM.CurrPart.HingeEdgeType.Name = "BU" OrElse Map.refPartPageVM.CurrPart.HingeEdgeType.Name = "BD" Then Map.refPartPageVM.CurrPart.SetHingeEdgeType(Part.m_EdgeTypeList(IndexBV))
|
|
If Map.refPartPageVM.CurrPart.TopType.Name = "BU" OrElse Map.refPartPageVM.CurrPart.TopType.Name = "BD" Then Map.refPartPageVM.CurrPart.SetTopType(Part.m_EdgeTypeList(IndexBV))
|
|
If Map.refPartPageVM.CurrPart.BottomType.Name = "BU" OrElse Map.refPartPageVM.CurrPart.BottomType.Name = "BD" Then Map.refPartPageVM.CurrPart.SetBottomType(Part.m_EdgeTypeList(IndexBV))
|
|
Map.refPartPageVM.CurrPart.NotifyPropertyChanged("EdegTypeList")
|
|
End If
|
|
End If
|
|
|
|
'---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
' aggiorno la lista
|
|
For IndexBeveDisp As Integer = 0 To Part.m_DispositionList.Count - 1
|
|
If Part.m_DispositionList(IndexBeveDisp).Name = "BU" Then
|
|
Part.m_DispositionList(IndexBeveDisp).IsActive = OptionModule.m_bBevelUp
|
|
ElseIf Part.m_DispositionList(IndexBeveDisp).Name = "BD" Then
|
|
Part.m_DispositionList(IndexBeveDisp).IsActive = OptionModule.m_bBevelDown
|
|
End If
|
|
Next
|
|
' aggiorno la lista
|
|
Map.refPartPageVM.CurrPart.NotifyPropertyChanged("DispositionList")
|
|
' verifico che l'elemento selezionato nella option page non sia stato disattivato
|
|
If Not IsNothing(Map.refPartPageVM.CurrPart) Then
|
|
If Map.refPartPageVM.CurrPart.DispositionItem.IsActive = Visibility.Collapsed Then Map.refPartPageVM.CurrPart.DispositionItem = Part.m_DispositionList(2)
|
|
End If
|
|
If Not IsNothing(Map.refAssemblyPageVM.CurrAssembly) Then
|
|
Map.refAssemblyPageVM.CurrAssembly.NotifyPropertyChanged("EdgeTypeList")
|
|
End If
|
|
End Sub
|
|
|
|
' creo le liste dei bevel e delle siposizioni
|
|
Public Shared Sub CreateEdgeTypeList()
|
|
'----------------------------------------------------------------------------------------------------------
|
|
' carico la lista dei bevel da mostrare sugli spigoli Lock, Hinge
|
|
For Index = 0 To m_StaticEdgeTypeList.Count - 1
|
|
If m_StaticEdgeTypeList(Index) = "BU" AndAlso OptionModule.m_sDisposition = m_StaticEdgeTypeList(Index) Then
|
|
m_bBevelUp = Visibility.Visible
|
|
m_bBevelDown = Visibility.Collapsed
|
|
ElseIf m_StaticEdgeTypeList(Index) = "BD" AndAlso OptionModule.m_sDisposition = m_StaticEdgeTypeList(Index) Then
|
|
m_bBevelUp = Visibility.Collapsed
|
|
m_bBevelDown = Visibility.Visible
|
|
End If
|
|
Part.m_EdgeTypeList.Add(New EdgeType(m_StaticEdgeTypeList(Index), Visibility.Visible))
|
|
Next
|
|
'----------------------------------------------------------------------------------------------------------
|
|
' caricare gli spigoli top e bottom facendo attenzione al tipo di configurazione!
|
|
Part.m_TopEdgeTypeList.Add(New EdgeType("SQ", Visibility.Visible))
|
|
Try
|
|
' controllo che nella configurazione sia presente il Bevel BV
|
|
Part.m_TopEdgeTypeList.Add(Part.m_EdgeTypeList.First(Function(x) x.Name = "BV"))
|
|
Catch ex As Exception
|
|
Try
|
|
Part.m_TopEdgeTypeList.Add(Part.m_EdgeTypeList.First(Function(x) x.Name = "BU"))
|
|
Catch ex2 As Exception
|
|
End Try
|
|
Try
|
|
Part.m_TopEdgeTypeList.Add(Part.m_EdgeTypeList.First(Function(x) x.Name = "BD"))
|
|
Catch ex2 As Exception
|
|
End Try
|
|
End Try
|
|
'----------------------------------------------------------------------------------------------------------
|
|
' dopo la creazione delle liste modifico la visibilità dei bevel
|
|
For IndexBevelEdgeTypeList As Integer = 0 To Part.m_EdgeTypeList.Count - 1
|
|
If Part.m_EdgeTypeList(IndexBevelEdgeTypeList).Name = "BU" Then Part.m_EdgeTypeList(IndexBevelEdgeTypeList).IsActive = m_bBevelUp
|
|
If Part.m_EdgeTypeList(IndexBevelEdgeTypeList).Name = "BD" Then Part.m_EdgeTypeList(IndexBevelEdgeTypeList).IsActive = m_bBevelDown
|
|
Next
|
|
For IndexTopBevelEdgeTypeList As Integer = 0 To Part.m_TopEdgeTypeList.Count - 1
|
|
If Part.m_TopEdgeTypeList(IndexTopBevelEdgeTypeList).Name = "BU" Then Part.m_TopEdgeTypeList(IndexTopBevelEdgeTypeList).IsActive = m_bBevelUp
|
|
If Part.m_TopEdgeTypeList(IndexTopBevelEdgeTypeList).Name = "BD" Then Part.m_TopEdgeTypeList(IndexTopBevelEdgeTypeList).IsActive = m_bBevelDown
|
|
Next
|
|
'----------------------------------------------------------------------------------------------------------
|
|
' caricare gli spigoli dei frame
|
|
Assembly.m_FrameEdgeTypeList.Add(New EdgeType("SQ", Visibility.Visible))
|
|
Try
|
|
' controllo che nella configurazione sia presente il Bevel BV
|
|
Assembly.m_FrameEdgeTypeList.Add(Part.m_EdgeTypeList.First(Function(x) x.Name = "BV"))
|
|
Catch ex As Exception
|
|
Assembly.m_FrameEdgeTypeList.Add(New EdgeType("BV", Visibility.Visible))
|
|
End Try
|
|
'----------------------------------------------------------------------------------------------------------
|
|
' carico la lista che contiene la disposizione in macchina
|
|
Part.m_DispositionList.Add(New EdgeType("BU", OptionModule.m_bBevelUp))
|
|
Part.m_DispositionList.Add(New EdgeType("BD", OptionModule.m_bBevelDown))
|
|
Part.m_DispositionList.Add(New EdgeType("BySwing", Visibility.Visible))
|
|
' assegno il valore della disposizione letto dal file Config.ini
|
|
If IsNothing(OptionModule.m_Disposition) Then
|
|
OptionModule.m_Disposition = Part.m_DispositionList(2)
|
|
ElseIf OptionModule.m_Disposition.Name <> "BU" AndAlso OptionModule.m_Disposition.Name <> "BD" Then
|
|
OptionModule.m_Disposition = Part.m_DispositionList(2)
|
|
End If
|
|
End Sub
|
|
|
|
Sub New()
|
|
Map.SetRefOptionsVM(Me)
|
|
End Sub
|
|
|
|
#Region "COMMANDS"
|
|
|
|
#Region "CloseOptionsCommand"
|
|
|
|
''' <summary>
|
|
''' Returns a command that remove the current selected machining.
|
|
''' </summary>
|
|
Public ReadOnly Property CloseOptionsCommand() As ICommand
|
|
Get
|
|
If m_cmdCloseOptions Is Nothing Then
|
|
m_cmdCloseOptions = New Command(AddressOf CloseOptions)
|
|
End If
|
|
Return m_cmdCloseOptions
|
|
End Get
|
|
End Property
|
|
|
|
''' <summary>
|
|
''' Manage the MachiningDb closing. This method is invoked by the CloseMachiningDbCommand.
|
|
''' </summary>
|
|
Public Sub CloseOptions()
|
|
' Chiusura finestra
|
|
For Each Window In Application.Current.Windows
|
|
If TypeOf Window Is OptionsV Then
|
|
Dim OptionsWindow As OptionsV = DirectCast(Window, OptionsV)
|
|
' se eseguo una modifica prima di avere una porta...controllo bene!!
|
|
If Not IsNothing(Map.refPartPageVM.CurrPart) Then
|
|
Map.refPartPageVM.CurrPart.VisibilityWeight = Part.IsCheckedWeight
|
|
Map.refPartPageVM.CurrPart.NotifyPropertyChanged("Weight")
|
|
Map.refPartPageVM.CurrPart.NotifyPropertyChanged("VisibilityWeight")
|
|
End If
|
|
OptionsWindow.Close()
|
|
End If
|
|
Next
|
|
End Sub
|
|
|
|
#End Region ' CloseOptionsCommand
|
|
|
|
Public ReadOnly Property BrowseCommand() As ICommand
|
|
Get
|
|
If m_cmdBrowse Is Nothing Then
|
|
m_cmdBrowse = New Command(AddressOf Browse)
|
|
End If
|
|
Return m_cmdBrowse
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub Browse(param As Object)
|
|
Dim SelectButton As String = (CStr(param))
|
|
Select Case SelectButton
|
|
Case "MyProject"
|
|
Dim FolderBrowserDialog As New System.Windows.Forms.FolderBrowserDialog
|
|
FolderBrowserDialog.SelectedPath = IniFile.m_MyProjectDir
|
|
' mostriamo la finestra di dialogo aperta fino alla directory MyProjects
|
|
If FolderBrowserDialog.ShowDialog <> Forms.DialogResult.OK Then
|
|
' se la risposta è diversa da OK esce
|
|
Return
|
|
End If
|
|
MyProjectDir = FolderBrowserDialog.SelectedPath
|
|
Case "MachinDir"
|
|
Dim FolderBrowserDialog As New System.Windows.Forms.FolderBrowserDialog
|
|
FolderBrowserDialog.SelectedPath = IniFile.m_MachinProject
|
|
' mostriamo la finestra di dialogo aperta fino alla directory MyProjects
|
|
If FolderBrowserDialog.ShowDialog <> Forms.DialogResult.OK Then
|
|
' se la risposta è diversa da OK esce
|
|
Return
|
|
End If
|
|
MachinDir = FolderBrowserDialog.SelectedPath
|
|
End Select
|
|
|
|
End Sub
|
|
|
|
Public ReadOnly Property OptionGuideCmd As ICommand
|
|
Get
|
|
If m_F1GuideCmd Is Nothing Then
|
|
m_F1GuideCmd = New Command(AddressOf F1Guide)
|
|
End If
|
|
Return m_F1GuideCmd
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub F1Guide()
|
|
Dim rfGuideVM As New GuideVM
|
|
'If String.IsNullOrEmpty(m_Chapter) Then
|
|
' GuideVM.m_AddressGuide = "option_page"
|
|
'Else
|
|
' GuideVM.m_AddressGuide = "OptionPage\" & m_Chapter
|
|
'End If
|
|
'm_rfMainWindowVM.ProjectManagerVM.Guide()
|
|
End Sub
|
|
|
|
#End Region ' COMMANDS
|
|
|
|
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
|
|
|
|
Public Sub NotifyPropertyChanged(propName As String)
|
|
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
|
|
End Sub
|
|
|
|
End Class
|
|
|
|
Public Class EdgeType
|
|
Implements INotifyPropertyChanged
|
|
|
|
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_IsActive As Visibility
|
|
Public Property IsActive As Visibility
|
|
Get
|
|
Return m_IsActive
|
|
End Get
|
|
Set(value As Visibility)
|
|
m_IsActive = value
|
|
NotifyPropertyChanged("IsActive")
|
|
End Set
|
|
End Property
|
|
|
|
Private m_BevelDDF As String = String.Empty
|
|
Public Property BevelDDF As String
|
|
Get
|
|
Return m_BevelDDF
|
|
End Get
|
|
Set(value As String)
|
|
m_BevelDDF = value
|
|
End Set
|
|
End Property
|
|
|
|
Sub New(sName As String, bIsActive As Visibility)
|
|
m_Name = sName
|
|
m_IsActive = bIsActive
|
|
End Sub
|
|
|
|
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
|
|
|
|
Public Sub NotifyPropertyChanged(propName As String)
|
|
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
|
|
End Sub
|
|
End Class |