d04dde4264
- gestita apertura di un singolo dettaglio su nuovi GridControl - migliorata nuova tabella RawPart - sistemato popup del RawPart
404 lines
12 KiB
VB.net
404 lines
12 KiB
VB.net
Imports System.Collections.ObjectModel
|
|
Imports System.Globalization
|
|
Imports EgtBEAMWALL.Core
|
|
Imports EgtUILib
|
|
Imports EgtWPFLib5
|
|
|
|
Public Class BTLPartListVM
|
|
Inherits VMBase
|
|
|
|
#Region "FIELDS & PROPERTIES"
|
|
|
|
Friend refSaveBTLPartGridControlLayout As Action
|
|
|
|
Private m_colPart_Do As EgwWPFBaseLib.ColumnLayout
|
|
Public ReadOnly Property colPart_Do As EgwWPFBaseLib.ColumnLayout
|
|
Get
|
|
Return m_colPart_Do
|
|
End Get
|
|
End Property
|
|
|
|
Private m_PartColumns As New ObservableCollection(Of EgwWPFBaseLib.ColumnLayout)
|
|
Public Property PartColumns As ObservableCollection(Of EgwWPFBaseLib.ColumnLayout)
|
|
Get
|
|
Return m_PartColumns
|
|
End Get
|
|
Set(value As ObservableCollection(Of EgwWPFBaseLib.ColumnLayout))
|
|
m_PartColumns = value
|
|
End Set
|
|
End Property
|
|
|
|
Private m_PartList_IsEnabled As Boolean = True
|
|
Public Property PartList_IsEnabled As Boolean
|
|
Get
|
|
Return m_PartList_IsEnabled
|
|
End Get
|
|
Set(value As Boolean)
|
|
m_PartList_IsEnabled = value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property bDOALLFeature As Boolean?
|
|
Get
|
|
If Map.refProjectVM.BTLStructureVM.SelBTLParts.Count = 0 Then Return False
|
|
Dim bTemp As Boolean = Map.refProjectVM.BTLStructureVM.SelBTLParts(0).BTLFeatureVMList(0).bDO
|
|
For FeatureIndex = 1 To Map.refProjectVM.BTLStructureVM.SelBTLParts(0).BTLFeatureVMList.Count - 1
|
|
If Map.refProjectVM.BTLStructureVM.SelBTLParts(0).BTLFeatureVMList(FeatureIndex).bDO <> bTemp Then Return Nothing
|
|
Next
|
|
Return bTemp
|
|
End Get
|
|
Set(value As Boolean?)
|
|
If Map.refProjectVM.BTLStructureVM.SelBTLParts.Count = 0 Then
|
|
NotifyPropertyChanged(NameOf(bDOALLFeature))
|
|
Return
|
|
End If
|
|
' imposto modalita' update multiplo
|
|
BTLFeatureVM.bDO_MultipleUpdate = True
|
|
For FeatureIndex = 0 To Map.refProjectVM.BTLStructureVM.SelBTLParts(0).BTLFeatureVMList.Count - 1
|
|
If FeatureIndex = Map.refProjectVM.BTLStructureVM.SelBTLParts(0).BTLFeatureVMList.Count - 1 Then
|
|
' reset modalita' update multiplo
|
|
BTLFeatureVM.bDO_MultipleUpdate = False
|
|
End If
|
|
Dim Feature As BTLFeatureVM = Map.refProjectVM.BTLStructureVM.SelBTLParts(0).BTLFeatureVMList(FeatureIndex)
|
|
Feature.bDO = value
|
|
Next
|
|
End Set
|
|
End Property
|
|
|
|
Private m_CALCPanel_IsEnabled As Boolean = True
|
|
Public ReadOnly Property CALCPanel_IsEnabled As Boolean
|
|
Get
|
|
Return m_CALCPanel_IsEnabled
|
|
End Get
|
|
End Property
|
|
Friend Sub SetCALCPanel_IsEnabled(value As Boolean)
|
|
m_CALCPanel_IsEnabled = value
|
|
NotifyPropertyChanged(NameOf(CALCPanel_IsEnabled))
|
|
End Sub
|
|
|
|
#Region "Messages"
|
|
|
|
Public ReadOnly Property PDN_Msg As String
|
|
Get
|
|
Return EgtMsg(61809)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property DO_Msg As String
|
|
Get
|
|
Return EgtMsg(61810)
|
|
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 L_Msg As String
|
|
Get
|
|
Return EgtMsg(61604)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property NAM_Msg As String
|
|
Get
|
|
Return EgtMsg(61603)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property MAT_Msg As String
|
|
Get
|
|
Return EgtMsg(61607)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property CNT_Msg As String
|
|
Get
|
|
Return EgtMsg(61608)
|
|
End Get
|
|
End Property
|
|
Public ReadOnly Property ShortCNT_Msg As String
|
|
Get
|
|
Return EgtMsg(61952)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property ADDED_Msg As String
|
|
Get
|
|
Return EgtMsg(61813)
|
|
End Get
|
|
End Property
|
|
Public ReadOnly Property ShortADDED_Msg As String
|
|
Get
|
|
Return EgtMsg(61953)
|
|
End Get
|
|
End Property
|
|
Public ReadOnly Property INPROD_Msg As String
|
|
Get
|
|
Return EgtMsg(61609)
|
|
End Get
|
|
End Property
|
|
Public ReadOnly Property ShortINPROD_Msg As String
|
|
Get
|
|
Return EgtMsg(61954)
|
|
End Get
|
|
End Property
|
|
Public ReadOnly Property DONE_Msg As String
|
|
Get
|
|
Return EgtMsg(61814)
|
|
End Get
|
|
End Property
|
|
Public ReadOnly Property ShortDONE_Msg As String
|
|
Get
|
|
Return EgtMsg(61955)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property GRP_Msg As String
|
|
Get
|
|
Return EgtMsg(61624)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property STOREY_Msg As String
|
|
Get
|
|
Return EgtMsg(61623)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property Description_Msg As String
|
|
Get
|
|
Return EgtMsg(61603)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property ROTATION_Msg As String
|
|
Get
|
|
Return EgtMsg(61737)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property INVERSION_Msg As String
|
|
Get
|
|
Return EgtMsg(61738)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property AddToRawPart_Msg As String
|
|
Get
|
|
Return EgtMsg(61904)
|
|
End Get
|
|
End Property
|
|
|
|
#End Region ' Messages
|
|
|
|
' Definizione comandi
|
|
Private m_cmdVerifyAll As ICommand
|
|
Private m_cmdVerifyFlipRotAll As ICommand
|
|
Private m_cmdResetCalc As ICommand
|
|
|
|
#End Region ' Fields & Properties
|
|
|
|
#Region "CONSTRUCTOR"
|
|
|
|
Sub New()
|
|
' creo riferimento in Map
|
|
Map.SetRefPartListVM(Me)
|
|
|
|
' carico le colonne della datagrid
|
|
EgwWPFBaseLib.EgwDataGrid.ReadColumnLayout(DataGridColumnsIniFile.m_sDataGridColumnsIniFile, S_PARTLIST, PartColumns)
|
|
m_colPart_Do = PartColumns.FirstOrDefault(Function(x) x.Key = COL_DO)
|
|
End Sub
|
|
|
|
Friend Sub SetBTLPartListIsEnabled(bIsEnabled As Boolean)
|
|
m_PartList_IsEnabled = bIsEnabled
|
|
NotifyPropertyChanged(NameOf(PartList_IsEnabled))
|
|
End Sub
|
|
|
|
#End Region ' Constructor
|
|
|
|
Friend Sub Close()
|
|
If Not IsNothing(refSaveBTLPartGridControlLayout) Then
|
|
refSaveBTLPartGridControlLayout()
|
|
End If
|
|
End Sub
|
|
|
|
#Region "COMMANDS"
|
|
|
|
#Region "VerifyAll"
|
|
|
|
Public ReadOnly Property VerifyAll_Command As ICommand
|
|
Get
|
|
If m_cmdVerifyAll Is Nothing Then
|
|
m_cmdVerifyAll = New Command(AddressOf VerifyAll)
|
|
End If
|
|
Return m_cmdVerifyAll
|
|
End Get
|
|
End Property
|
|
|
|
Friend Sub VerifyAll()
|
|
If (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)) Then Return
|
|
' imposto flag per calcolo
|
|
Map.refCALCPanelVM.SetCalculating(True)
|
|
For Each BTLPartItem As BTLPartVM In Map.refProjectVM.BTLStructureVM.BTLPartVMList
|
|
BTLPartItem.SetIsRowEnabled(False)
|
|
Next
|
|
Map.refCALCPanelVM.VerifyAll(ProjectType.PROJ, CalcIntegration.CmdTypes.CHECKNOSIM)
|
|
Return
|
|
End Sub
|
|
|
|
#End Region ' VerifyAll
|
|
|
|
#Region "VerifyAllFlipRot"
|
|
|
|
Public ReadOnly Property VerifyAllFlipRot_Command As ICommand
|
|
Get
|
|
If m_cmdVerifyFlipRotAll Is Nothing Then
|
|
m_cmdVerifyFlipRotAll = New Command(AddressOf VerifyAllFlipRot)
|
|
End If
|
|
Return m_cmdVerifyFlipRotAll
|
|
End Get
|
|
End Property
|
|
|
|
Friend Sub VerifyAllFlipRot()
|
|
If (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)) Then Return
|
|
' imposto flag per calcolo
|
|
Map.refCALCPanelVM.SetCalculating(True)
|
|
For Each BTLPartItem As BTLPartVM In Map.refProjectVM.BTLStructureVM.BTLPartVMList
|
|
BTLPartItem.SetIsRowEnabled(False)
|
|
Next
|
|
Map.refCALCPanelVM.VerifyAll(ProjectType.PROJ, CalcIntegration.CmdTypes.FLIP_ROT)
|
|
Return
|
|
End Sub
|
|
|
|
#End Region ' VerifyAllRotate
|
|
|
|
#Region "ResetCalc"
|
|
|
|
Public ReadOnly Property ResetCalc_Command As ICommand
|
|
Get
|
|
If m_cmdResetCalc Is Nothing Then
|
|
m_cmdResetCalc = New Command(AddressOf ResetCalc)
|
|
End If
|
|
Return m_cmdResetCalc
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub ResetCalc()
|
|
If (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)) Then Return
|
|
Map.refShowBeamPanelVM.ShowBuilding_IsEnabled = True
|
|
Map.refCALCPanelVM.SetCalculating(False)
|
|
For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList
|
|
If Part.nGlobalState <> CalcStates.NOTCALCULATED Then
|
|
' resetto stato dei calcoli
|
|
Part.ResetCalcTotalPart()
|
|
End If
|
|
If Not Part.IsRowEnabled Then Part.SetIsRowEnabled(True)
|
|
Next
|
|
End Sub
|
|
|
|
#End Region ' ResetCalc
|
|
|
|
#End Region ' COMMANDS
|
|
|
|
End Class
|
|
|
|
Class DataGridCellBorderThicknessConverter
|
|
Implements IMultiValueConverter
|
|
|
|
Public Function Convert(values() As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IMultiValueConverter.Convert
|
|
Dim ColumnList As ObservableCollection(Of EgwWPFBaseLib.ColumnLayout) = Map.refPartListVM.PartColumns
|
|
Dim ColumnIndex As Integer = CInt(values(0))
|
|
Dim bLeft As Boolean = False
|
|
Dim bRight As Boolean = False
|
|
Dim dThickness As Double = CDbl(parameter)
|
|
If Not IsNothing(ColumnList) AndAlso Not IsNothing(ColumnIndex) Then
|
|
If ColumnIndex = 0 Then
|
|
bLeft = True
|
|
ElseIf ColumnIndex = ColumnList.Count - 1 Then
|
|
bRight = True
|
|
End If
|
|
Else
|
|
Return New Thickness(0, dThickness, 0, dThickness)
|
|
End If
|
|
Return New Thickness(If(bLeft, dThickness, 0), dThickness, If(bRight, dThickness, 0), dThickness)
|
|
End Function
|
|
|
|
Public Function ConvertBack(value As Object, targetTypes() As Type, parameter As Object, culture As CultureInfo) As Object() Implements IMultiValueConverter.ConvertBack
|
|
Throw New NotImplementedException()
|
|
End Function
|
|
|
|
End Class
|
|
|
|
Class ProjIdToBtlFileName
|
|
Implements IValueConverter
|
|
|
|
Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.Convert
|
|
If TypeOf value IsNot String Then Return ""
|
|
Dim nProjId As Integer = CInt(value)
|
|
Dim ProjModel As EgtBEAMWALL.DataLayer.DatabaseModels.ProjModel = DbControllers.m_ProjController.FindByProjId(nProjId)
|
|
If IsNothing(ProjModel) Then Return ""
|
|
Return ProjModel.BTLFileName
|
|
End Function
|
|
|
|
Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.ConvertBack
|
|
Throw New NotImplementedException()
|
|
End Function
|
|
|
|
End Class
|
|
|
|
Public Class BooleanToVisibilityConverter
|
|
Implements IValueConverter
|
|
|
|
Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.Convert
|
|
If Not TypeOf value Is Boolean Then Return Visibility.Collapsed
|
|
Dim bValue As Boolean = value
|
|
Return If(bValue, Visibility.Visible, Visibility.Collapsed)
|
|
End Function
|
|
|
|
Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.ConvertBack
|
|
Throw New NotImplementedException()
|
|
End Function
|
|
|
|
End Class
|
|
|
|
Class FractionHeightConverter
|
|
Implements IValueConverter
|
|
|
|
Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.Convert
|
|
If TypeOf value IsNot Double Then Return ""
|
|
If TypeOf parameter IsNot Double Then Return ""
|
|
Dim dListBoxHeight As Double = CDbl(value)
|
|
Dim dWrapPanelHeight As Double = CDbl(parameter)
|
|
Return Math.Floor((dListBoxHeight - 40) * dWrapPanelHeight)
|
|
End Function
|
|
|
|
Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.ConvertBack
|
|
Throw New NotImplementedException()
|
|
End Function
|
|
|
|
End Class
|
|
|
|
Class ExpanderWidthConverter
|
|
Implements IValueConverter
|
|
|
|
Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.Convert
|
|
If TypeOf value IsNot Double Then Return ""
|
|
Dim dListBoxHeight As Double = CDbl(value)
|
|
Return Math.Floor(dListBoxHeight - 10)
|
|
End Function
|
|
|
|
Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.ConvertBack
|
|
Throw New NotImplementedException()
|
|
End Function
|
|
|
|
End Class
|