Files
egtbeamwall/EgtBEAMWALL.Optimizer/LeftPanel/LeftPanelVM.vb
T
Demetrio Cassarino 227f289b5a -gestito visibilità pannello optmizer
-gestito assemblato
2026-07-27 11:32:57 +02:00

299 lines
8.6 KiB
VB.net

Imports System.Collections.ObjectModel
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Public Class LeftPanelVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Private Property m_GridDims As New ObservableCollection(Of GridDimension)
Public Property GridDims As ObservableCollection(Of GridDimension)
Get
Return m_GridDims
End Get
Set
m_GridDims = Value
NotifyPropertyChanged(NameOf(GridDims))
End Set
End Property
Private m_LeftPanel_IsEnabled As Boolean = True
Public ReadOnly Property LeftPanel_IsEnabled As Boolean
Get
Return m_LeftPanel_IsEnabled
End Get
End Property
Public ReadOnly Property SearchFilter_IsEnabled As Boolean
Get
Return Not Map.refFreeContourManagerVM.bIsActive
End Get
End Property
Private m_IsFilterBtnOpen As Boolean = False
Public Property IsFilterBtnOpen As Boolean
Get
Return m_IsFilterBtnOpen
End Get
Set(value As Boolean)
m_IsFilterBtnOpen = value
End Set
End Property
Friend Sub SetIsFilterBtnOpen(bIsFilterBtnOpen As Boolean)
m_IsFilterBtnOpen = bIsFilterBtnOpen
NotifyPropertyChanged(NameOf(IsFilterBtnOpen))
End Sub
Private m_RotateAll_IsEnabled As Boolean = False
Public ReadOnly Property RotateAll_IsEnabled As Boolean
Get
Return m_RotateAll_IsEnabled
End Get
End Property
Friend Sub SetRotateAll_IsEnabled(value As Boolean)
m_RotateAll_IsEnabled = value
NotifyPropertyChanged(NameOf(RotateAll_IsEnabled))
End Sub
Private m_IsProjectParametersBtnOpen As Boolean = False
Public Property IsProjectParametersBtnOpen As Boolean
Get
Return m_IsProjectParametersBtnOpen
End Get
Set(value As Boolean)
m_IsProjectParametersBtnOpen = value
End Set
End Property
Friend Sub SetIsProjectParametersBtnOpen(bIsProjectParametersBtnOpen As Boolean)
m_IsProjectParametersBtnOpen = bIsProjectParametersBtnOpen
NotifyPropertyChanged(NameOf(IsProjectParametersBtnOpen))
End Sub
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
' Definizione comandi
Private m_cmdShowPopUpFilterBtnCmd As ICommand
Private m_cmdRotateAll As ICommand
Private m_cmdInvertAll As ICommand
#Region "Messages"
Public ReadOnly Property SearchFilter_Msg As String
Get
Return EgtMsg(61949)
End Get
End Property
Public ReadOnly Property Section_Msg As String
Get
Return EgtMsg(61771)
End Get
End Property
Public ReadOnly Property Group_Msg As String
Get
Return EgtMsg(61624)
End Get
End Property
Public ReadOnly Property SubGroup_Msg As String
Get
Return EgtMsg(61623)
End Get
End Property
Public ReadOnly Property ParType_Msg As String
Get
Return EgtMsg(61950)
End Get
End Property
Public ReadOnly Property ParValue_Msg As String
Get
Return EgtMsg(61951)
End Get
End Property
Public ReadOnly Property Pdn_Msg As String
Get
Return EgtMsg(61809)
End Get
End Property
Public ReadOnly Property Description_Msg As String
Get
Return EgtMsg(62511)
End Get
End Property
Public ReadOnly Property VerifyAll_ToolTip As String
Get
Return EgtMsg(61928)
End Get
End Property
Public ReadOnly Property VerifyAllFlipRot_ToolTip As String
Get
Return EgtMsg(62000)
End Get
End Property
Public ReadOnly Property FilterAll_ToolTip As String
Get
Return EgtMsg(62570)
End Get
End Property
Public ReadOnly Property ResetCalc_ToolTip As String
Get
Return EgtMsg(61940)
End Get
End Property
Public ReadOnly Property RotateAll_ToolTip As String
Get
Return EgtMsg(63029)
End Get
End Property
Public ReadOnly Property InvertAll_ToolTip As String
Get
Return EgtMsg(63030)
End Get
End Property
Public ReadOnly Property MultipleModify_ToolTip As String
Get
Return EgtMsg(63031)
End Get
End Property
#End Region ' Messages
#End Region 'FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Sub New()
' imposto riferimento su mappa
Map.SetRefLeftPanelVM(Me)
' imposto dimensioni colonne/righe della Grid
DimensionsIniFile.ReadGridDimensions(ConstDims.LEFTPANEL_VIEW, GridDims)
End Sub
#End Region ' Constructor
#Region "METHODS"
Friend Sub SetLeftPanelIsEnabled(bIsEnabled As Boolean)
m_LeftPanel_IsEnabled = bIsEnabled
NotifyPropertyChanged(NameOf(LeftPanel_IsEnabled))
NotifyPropertyChanged(NameOf(SearchFilter_IsEnabled))
End Sub
#End Region ' METHODS
#Region "COMMANDS"
#Region "ShowPopUpFilterBtnCommand"
Public ReadOnly Property ShowPopUpFilterBtnCommand As ICommand
Get
If m_cmdShowPopUpFilterBtnCmd Is Nothing Then
m_cmdShowPopUpFilterBtnCmd = New Command(AddressOf ShowPopUpFilterBtn)
End If
Return m_cmdShowPopUpFilterBtnCmd
End Get
End Property
Public Sub ShowPopUpFilterBtn(ByVal param As Object)
If m_IsFilterBtnOpen Then
SetIsFilterBtnOpen(False)
Else
SetIsFilterBtnOpen(True)
End If
End Sub
#End Region ' ShowPopUpFilterBtnCommand
'#Region "RotateAll"
' Public ReadOnly Property RotateAll_Command As ICommand
' Get
' If m_cmdRotateAll Is Nothing Then
' m_cmdRotateAll = New Command(AddressOf RotateAll)
' End If
' Return m_cmdRotateAll
' End Get
' End Property
' Public Sub RotateAll()
' If IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return
' ' salvo sezione impostata
' Dim CurrSection As SectionXMaterial = Map.refProjectVM.BTLStructureVM.SelSection
' ' se modalita' assemblato
' Dim bShowBuilding As Boolean = Map.refShowBeamPanelVM.ShowBuilding_IsChecked
' If bShowBuilding AndAlso Map.refShowBeamPanelVM.bShowAll Then
' ' devo smontarlo prima di calcolare le travi, altrimenti non trova i pezzi
' Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
' End If
' ' ruoto i pezzi selezionati
' For Each Part In Map.refProjectVM.BTLStructureVM.SelBTLParts
' Part.BackRotation(False, False)
' Next
' ' se assemblato lo ripristino
' If bShowBuilding Then Map.refProjectVM.BTLStructureVM.ShowBuilding(True, False)
' ' se progetto travi e sezione precedente diversa da vuota (tutti i pezzi)
' If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM AndAlso CurrSection <> SectionXMaterial.Empty Then
' ' se esiste, imposto sezione inversa
' Dim InverseSection As SectionXMaterial = Map.refProjectVM.BTLStructureVM.SectionList.FirstOrDefault(Function(x) x.dH = CurrSection.dW AndAlso x.dW = CurrSection.dH AndAlso x.sMaterial(0) = CurrSection.sMaterial(0))
' If Not IsNothing(InverseSection) Then Map.refProjectVM.BTLStructureVM.SetSelSection(InverseSection)
' End If
' EgtDraw()
' End Sub
'#End Region ' RotateAll
'#Region "InvertAll"
' Public ReadOnly Property InvertAll_Command As ICommand
' Get
' If m_cmdInvertAll Is Nothing Then
' m_cmdInvertAll = New Command(AddressOf InvertAll)
' End If
' Return m_cmdInvertAll
' End Get
' End Property
' Public Sub InvertAll()
' If IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return
' ' se modalita' assemblato
' Dim bShowBuilding As Boolean = Map.refShowBeamPanelVM.ShowBuilding_IsChecked
' If bShowBuilding AndAlso Map.refShowBeamPanelVM.bShowAll Then
' ' devo smontarlo prima di calcolare le travi, altrimenti non trova i pezzi
' Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
' End If
' ' inverto i pezzi selezionati
' For Each Part In Map.refProjectVM.BTLStructureVM.SelBTLParts
' Part.Invert()
' Next
' ' se assemblato lo ripristino
' If bShowBuilding Then Map.refProjectVM.BTLStructureVM.ShowBuilding(True, False)
' End Sub
'#End Region ' InvertAll
#End Region ' COMMANDS
End Class