Files
egtbeamwall/EgtBEAMWALL.Core/Utility/SectionXMaterial.vb
T
2024-03-15 12:33:25 +01:00

223 lines
6.1 KiB
VB.net

Imports System.Windows
Imports EgtUILib
Imports EgtWPFLib5
Public Class SectionXMaterial
Inherits VMBase
Private Shared m_nType As BWType
Public Shared ReadOnly Property nType As BWType
Get
Return m_nType
End Get
End Property
Public Shared Sub SetType(nType As BWType)
m_nType = nType
End Sub
Public ReadOnly Property sMaterial As String
Get
Return m_MaterialM.sMaterial
End Get
End Property
Public ReadOnly Property sWarehouseMaterial As String
Get
Return m_MaterialM.sWarehouseMaterial
End Get
End Property
Protected m_MaterialForSameSection_List As New List(Of String)
Public Property MaterialForSameSection_List As List(Of String)
Get
Return m_MaterialForSameSection_List
End Get
Set(value As List(Of String))
m_MaterialForSameSection_List = value
End Set
End Property
Protected m_SelMaterialForSameSection As String
Public Property SelMaterialForSameSection As String
Get
Return m_SelMaterialForSameSection
End Get
Set(value As String)
m_SelMaterialForSameSection = value
End Set
End Property
Protected m_MaterialM As MaterialM
Public ReadOnly Property MaterialM As MaterialM
Get
Return m_MaterialM
End Get
End Property
Public ReadOnly Property dW As Double
Get
Return m_MaterialM.dW
End Get
End Property
Public ReadOnly Property dH As Double
Get
Return m_MaterialM.dH
End Get
End Property
Public ReadOnly Property dL As Double
Get
Return m_MaterialM.dL
End Get
End Property
Public ReadOnly Property sSectionXMaterial As String
Get
If Me = Empty Then
Return ""
ElseIf m_nType = MachineType.BEAM Then
Return LenToString(m_MaterialM.dW, 3) & " x " & LenToString(m_MaterialM.dH, 3) & " " & If(GetMainPrivateProfileInt(S_WAREHOUSE, K_SHOWWAREHOUSEMATERIAL, 0) = 1, sWarehouseMaterial, sMaterial)
ElseIf m_nType = MachineType.WALL Then
Return LenToString(m_MaterialM.dH, 3) & " " & If(GetMainPrivateProfileInt(S_WAREHOUSE, K_SHOWWAREHOUSEMATERIAL, 0) = 1, sWarehouseMaterial, sMaterial)
Else Return ""
End If
End Get
End Property
Public ReadOnly Property sWarehouseSectionXMaterial As String
Get
If Me = Empty Then
Return ""
ElseIf m_nType = MachineType.BEAM Then
Return LenToString(m_MaterialM.dW, 3) & " x " & LenToString(m_MaterialM.dH, 3) & " " & sWarehouseMaterial
ElseIf m_nType = MachineType.WALL Then
Return LenToString(m_MaterialM.dH, 3) & " " & sWarehouseMaterial
Else Return ""
End If
End Get
End Property
Shared Operator =(ByVal S1 As SectionXMaterial, ByVal S2 As SectionXMaterial) As Boolean
Return S1.m_MaterialM = S2.m_MaterialM
End Operator
Shared Operator <>(ByVal S1 As SectionXMaterial, ByVal S2 As SectionXMaterial) As Boolean
Return Not S1 = S2
End Operator
Public Overrides Function Equals(ByVal obj As Object) As Boolean
If TypeOf obj Is SectionXMaterial Then
Return Me = DirectCast(obj, SectionXMaterial) '(m_dH = obj.dH AndAlso m_dW = obj.dW AndAlso m_dL = obj.dL AndAlso m_Material.Any(Function(x) DirectCast(obj.sMaterial, List(Of String)).Any(Function(y) y = x)))
End If
Return False
End Function
Sub New(dW As Double, dH As Double, dL As Double, sMaterial As String, sWarehouseMaterial As String)
If m_nType = BWType.BEAM Then
m_MaterialM = New MaterialM(dW, dH, 0, sMaterial, sWarehouseMaterial)
ElseIf m_nType = BWType.WALL Then
m_MaterialM = New MaterialM(0, dH, 0, sMaterial, sWarehouseMaterial)
Else
m_MaterialM = New MaterialM(dW, dH, dL, sMaterial, sWarehouseMaterial)
End If
End Sub
Sub New(MaterialM As MaterialM)
m_MaterialM = MaterialM
End Sub
Public Shared Empty As New SectionXMaterial(-1, -1, -1, "", "")
#Region "Import BTL <-> Warehouse"
Private m_dNewW As Double
Public Property dNewW As Double
Get
Return m_dNewW
End Get
Set(value As Double)
m_dNewW = value
End Set
End Property
Private m_dNewL As Double
Public Property dNewL As Double
Get
Return m_dNewL
End Get
Set(value As Double)
m_dNewL = value
End Set
End Property
Private m_nQuantity As Integer
Public Property nQuantity As Integer
Get
Return m_nQuantity
End Get
Set(value As Integer)
m_nQuantity = value
End Set
End Property
Private m_Alias_IsEnabled As Boolean
Public Property Alias_IsEnabled As Boolean
Get
Return m_Alias_IsEnabled
End Get
Set(value As Boolean)
m_Alias_IsEnabled = value
End Set
End Property
Private m_Alias_IsChecked As Boolean
Public Overridable Property Alias_IsChecked As Boolean
Get
Return m_Alias_IsChecked
End Get
Set(value As Boolean)
m_Alias_IsChecked = value
End Set
End Property
Public ReadOnly Property L_Msg As String
Get
Return EgtMsg(61604)
End Get
End Property
Public ReadOnly Property W_Msg As String
Get
Return EgtMsg(61605)
End Get
End Property
Public ReadOnly Property H_Msg As String
Get
Return EgtMsg(61606)
End Get
End Property
Public ReadOnly Property Quantity_Msg As String
Get
Return EgtMsg(61774)
End Get
End Property
Sub New(dW As Double, dH As Double, dL As Double, sMaterial As String, nQuantity As Integer, sWarehouseMaterial As String)
If m_nType = BWType.BEAM Then
m_MaterialM = New MaterialM(dW, dH, 0, sMaterial, sWarehouseMaterial)
ElseIf m_nType = BWType.WALL Then
m_MaterialM = New MaterialM(0, dH, 0, sMaterial, sWarehouseMaterial)
Else
m_MaterialM = New MaterialM(dW, dH, dL, sMaterial, sWarehouseMaterial)
End If
m_nQuantity = nQuantity
End Sub
#End Region ' Import BTL <-> Warehouse
End Class