5527a7e316
- aggiornata finestra BtlDataWnd per gestione multiprogetto - fix aggiunta progetto
338 lines
10 KiB
VB.net
338 lines
10 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_OnlyProdPartManagerVisibility As Visibility = Visibility.Collapsed
|
|
Public ReadOnly Property OnlyProdPartManagerVisibility As Visibility
|
|
Get
|
|
Return m_OnlyProdPartManagerVisibility
|
|
End Get
|
|
End Property
|
|
Friend Sub SetOnlyProdPartManager_Visibility(value As Visibility)
|
|
m_OnlyProdPartManagerVisibility = value
|
|
NotifyPropertyChanged(NameOf(OnlyProdPartManagerVisibility))
|
|
End Sub
|
|
|
|
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
|
|
|
|
' Definizione comandi
|
|
Private m_cmdVerifyAll As ICommand
|
|
Private m_cmdShowPopUpFilterBtnCmd As ICommand
|
|
Private m_cmdBackRotation As ICommand
|
|
Private m_cmdInvert As ICommand
|
|
Private m_cmdResetCalc 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 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
|
|
|
|
#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
|
|
|
|
' funzione che gestisce risposta da thread di verifica, aggiorna progress e segnala comando di interruzione
|
|
Private Sub ManageCalc(dProgress As Double, sProgress As String, ByRef bCancel As Boolean)
|
|
If dProgress = 0 Then
|
|
Map.refMyStatusBarVM.SetLoadingProgress_Visibility(True)
|
|
Map.refMyStatusBarVM.SetStopProgress_IsActive(True)
|
|
Map.refMyStatusBarVM.SetStopProgress_IsEnabled(True)
|
|
Map.refMyStatusBarVM.SetOutputMessage(sProgress)
|
|
Map.refMyStatusBarVM.SetStopProgress_IsActive(True)
|
|
Map.refMyStatusBarVM.SetStopProgress_IsEnabled(True)
|
|
ElseIf dProgress = 1 Then
|
|
Map.refMyStatusBarVM.SetLoadingProgress_Visibility(False)
|
|
Map.refMyStatusBarVM.SetStopProgress_IsActive(False)
|
|
Map.refMyStatusBarVM.SetStopProgress_IsEnabled(False)
|
|
Map.refMyStatusBarVM.SetOutputMessage(sProgress, 3)
|
|
End If
|
|
bCancel = Map.refMyStatusBarVM.bStopProgress
|
|
Map.refMyStatusBarVM.SetLoadingProgress(dProgress * 100)
|
|
Map.refMyStatusBarVM.SetOutputMessage(sProgress)
|
|
End Sub
|
|
|
|
#End Region ' METHODS
|
|
|
|
#Region "COMMANDS"
|
|
|
|
#Region "VerifyAll"
|
|
|
|
''' <summary>
|
|
''' Returns a command that do Open.
|
|
''' </summary>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Execute the Open. This method is invoked by the OpenCommand.
|
|
''' </summary>
|
|
Friend Sub VerifyAll()
|
|
If (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)) Then Return
|
|
Map.refCALCPanelVM.VerifyAll(ProjectType.PROJ)
|
|
Return
|
|
End Sub
|
|
|
|
#End Region ' VerifyAll
|
|
|
|
#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 "BackRotation"
|
|
|
|
''' <summary>
|
|
''' Returns a command that do Exec.
|
|
''' </summary>
|
|
Public ReadOnly Property BackRotation_Command As ICommand
|
|
Get
|
|
If m_cmdBackRotation Is Nothing Then
|
|
m_cmdBackRotation = New Command(AddressOf BackRotation)
|
|
End If
|
|
Return m_cmdBackRotation
|
|
End Get
|
|
End Property
|
|
|
|
''' <summary>
|
|
''' Execute the Exec. This method is invoked by the ExecCommand.
|
|
''' </summary>
|
|
Public Sub BackRotation()
|
|
If IsNothing(ProjectManagerVM.CurrProj) 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 ' BackRotation
|
|
|
|
#Region "Invert"
|
|
|
|
''' <summary>
|
|
''' Returns a command that do Exec.
|
|
''' </summary>
|
|
Public ReadOnly Property Invert_Command As ICommand
|
|
Get
|
|
If m_cmdInvert Is Nothing Then
|
|
m_cmdInvert = New Command(AddressOf Invert)
|
|
End If
|
|
Return m_cmdInvert
|
|
End Get
|
|
End Property
|
|
|
|
''' <summary>
|
|
''' Execute the Exec. This method is invoked by the ExecCommand.
|
|
''' </summary>
|
|
Public Sub Invert()
|
|
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 ' Invert
|
|
|
|
#Region "ResetCalc"
|
|
|
|
''' <summary>
|
|
''' Returns a command that do Exec.
|
|
''' </summary>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Execute the Exec. This method is invoked by the ExecCommand.
|
|
''' </summary>
|
|
Public Sub ResetCalc()
|
|
If (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)) Then Return
|
|
For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList
|
|
If Part.nGlobalState <> CalcStates.NOTCALCULATED Then
|
|
' resetto stato dei calcoli
|
|
Part.ResetCalcTotalPart()
|
|
End If
|
|
Next
|
|
End Sub
|
|
|
|
#End Region ' ResetCalc
|
|
|
|
#End Region ' COMMANDS
|
|
|
|
End Class
|