Files
egtbeamwall/EgtBEAMWALL.Core/BTLParam.vb
T
Samuele E. Locatelli f812ff66c2 initial commit
2021-03-04 19:48:48 +01:00

188 lines
4.7 KiB
VB.net

Imports System.Collections.ObjectModel
Imports System.Windows
Imports System.Windows.Input
Imports System.Windows.Media
Imports EgtUILib
Imports EgtWPFLib5
Public Class BTLParam
Inherits VMBase
' parametro che dice se il parametro e' P o Q
Protected m_bIsP As Boolean = True
Public ReadOnly Property bIsP As Boolean
Get
Return m_bIsP
End Get
End Property
' parametri da struttura
Protected m_sName As String
Public Property sName As String
Get
Return m_sName
End Get
Set(value As String)
m_sName = value
End Set
End Property
Protected m_nId As Integer
Public ReadOnly Property nId As Integer
Get
Return m_nId
End Get
End Property
Protected m_sDescription As String
Public Property sDescription As String
Get
Return m_sDescription
End Get
Set(value As String)
m_sDescription = value
End Set
End Property
' parametri da struttura
Protected m_dMin As Double
Protected m_dMax As Double
Protected m_ValueList As List(Of String)
Public ReadOnly Property ValueList As List(Of String)
Get
Return m_ValueList
End Get
End Property
' parametri da geometria
Protected m_dValue As Double
Protected m_sValue As String
Public Overridable Property sValue As String
Get
Return m_sValue
End Get
Set(value As String)
m_sValue = value
End Set
End Property
Public Overridable Property dValue As Double
Get
Return m_dValue
End Get
Set(value As Double)
m_dValue = value
End Set
End Property
Protected m_nSelValue As Integer
Public Property nSelValue As Integer
Get
Return m_nSelValue
End Get
Set(value As Integer)
m_nSelValue = value
End Set
End Property
Protected m_dDefault As Double
Public ReadOnly Property dDefault As Double
Get
Return m_dDefault
End Get
End Property
Protected m_sDrawPath As String
' tipo della variabile
Protected m_nType As BTLParamType
Public ReadOnly Property nType As BTLParamType
Get
Return m_nType
End Get
End Property
' Feature a cui appartiene il parametro
Protected m_ParentFeature As BTLFeature
Public ReadOnly Property ParentFeature As BTLFeature
Get
Return m_ParentFeature
End Get
End Property
#Region "MESSAGES"
Public ReadOnly Property Name_Msg As String
Get
Return EgtMsg(61614)
End Get
End Property
Public ReadOnly Property Value_Msg As String
Get
Return EgtMsg(61615)
End Get
End Property
Public ReadOnly Property Min_Msg As String
Get
Return EgtMsg(61616)
End Get
End Property
Public ReadOnly Property Max_Msg As String
Get
Return EgtMsg(61617)
End Get
End Property
#End Region
Public Sub StdInit(ParentFeature As BTLFeature, IsP As Boolean, Type As BTLParamType, sName As String, sDescription As String)
m_ParentFeature = ParentFeature
m_bIsP = IsP
m_nType = Type
m_sName = sName
Dim nDescription As Integer
If IsNumeric(sDescription) AndAlso Integer.TryParse(sDescription, nDescription) Then
m_sDescription = EgtMsg(sDescription)
Else
m_sDescription = sDescription
End If
If Not String.IsNullOrWhiteSpace(sName) Then
Dim sId As String = sName.Trim({"P"c, "Q"c, "p"c, "q"c})
Integer.TryParse(sId, m_nId)
End If
End Sub
' new per double e length
Sub New(ParentFeature As BTLFeature, IsP As Boolean, nType As BTLParamType, sParamName As String, dMin As Double, dMax As Double, dDefault As Double, sDescription As String)
StdInit(ParentFeature, IsP, nType, sParamName, sDescription)
m_dMin = dMin
m_dMax = dMax
m_dDefault = dDefault
End Sub
' new per stringhe
Sub New(ParentFeature As BTLFeature, IsP As Boolean, nType As BTLParamType, sParamName As String, sDescription As String)
StdInit(ParentFeature, IsP, nType, sParamName, sDescription)
End Sub
' new per combobox
Sub New(ParentFeature As BTLFeature, IsP As Boolean, nType As BTLParamType, sParamName As String, nMin As Integer, nMax As Integer, nDefault As Integer, sDescription As String, ValueList As List(Of String))
StdInit(ParentFeature, IsP, nType, sParamName, sDescription)
m_dMin = nMin
m_dMax = nMax
m_dDefault = nDefault
m_ValueList = ValueList
End Sub
' new per parametro vuoto
Sub New(IsP As Boolean, nType As BTLParamType, sParamName As String)
StdInit(Nothing, IsP, nType, sParamName, "")
End Sub
End Class