b87d27230c
-piccole modifiche
163 lines
5.8 KiB
VB.net
163 lines
5.8 KiB
VB.net
Imports System.Collections.ObjectModel
|
|
Imports EgtUILib
|
|
Imports EgtWPFLib5
|
|
Imports EgtBEAMWALL.Core
|
|
|
|
Public Class MyInstrumentPanelVM
|
|
Inherits InstrumentPanelVM
|
|
|
|
#Region "FIELDS & PROPERTIES"
|
|
|
|
Public ReadOnly Property ChangeParam_Visibility As Visibility
|
|
Get
|
|
Return If(Map.refMainMenuVM.SelPage = Pages.VIEW, Visibility.Visible, Visibility.Collapsed)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property ChangeMaterial_Visibility As Visibility
|
|
Get
|
|
Return If(Map.refMainWindowVM.MainWindowM.nUserLevel > 5, Visibility.Visible, Visibility.Collapsed)
|
|
End Get
|
|
End Property
|
|
|
|
Private m_InstrumentPanel_IsEnabled As Boolean = True
|
|
Public Property InstrumentPanel_IsEnabled As Boolean
|
|
Get
|
|
Return m_InstrumentPanel_IsEnabled
|
|
End Get
|
|
Set(value As Boolean)
|
|
m_InstrumentPanel_IsEnabled = value
|
|
End Set
|
|
End Property
|
|
|
|
' Definizione comandi
|
|
Private m_cmdChangeParameter As ICommand
|
|
Private m_cmdChangeMaterial As ICommand
|
|
|
|
#Region "Messages"
|
|
|
|
Public ReadOnly Property ChangeParam_ToolTip As String
|
|
Get
|
|
Return EgtMsg(61900)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property ChangeMaterial_ToolTip As String
|
|
Get
|
|
Return EgtMsg(61961)
|
|
End Get
|
|
End Property
|
|
|
|
#End Region ' Messages
|
|
|
|
#End Region ' FIELDS & PROPERTIES
|
|
|
|
#Region "CONSTRUCTORS"
|
|
|
|
Sub New()
|
|
' imposto riferimento in Map
|
|
Map.SetRefInstrumentPanelVM(Me)
|
|
End Sub
|
|
|
|
#End Region ' CONSTRUCTORS
|
|
|
|
#Region "METHODS"
|
|
|
|
Public Overrides Function OnPostGetDistIsChecked() As Boolean
|
|
If Not Map.refFreeContourManagerVM.bIsActive Then Map.refSceneHostVM.MainScene.SetStatusNull()
|
|
Return True
|
|
End Function
|
|
|
|
Friend Sub SetGetDistance_IsChecked(bIsChecked As Boolean)
|
|
GetDistIsChecked = bIsChecked
|
|
End Sub
|
|
|
|
Friend Sub SetInstrumentPanelIsEnabled(bIsEnabled As Boolean)
|
|
m_InstrumentPanel_IsEnabled = bIsEnabled
|
|
NotifyPropertyChanged(NameOf(InstrumentPanel_IsEnabled))
|
|
End Sub
|
|
|
|
#End Region ' METHODS
|
|
|
|
#Region "COMMANDS"
|
|
|
|
#Region "ChangeParameter"
|
|
|
|
Public ReadOnly Property ChangeParameter_Command As ICommand
|
|
Get
|
|
If m_cmdChangeParameter Is Nothing Then
|
|
m_cmdChangeParameter = New Command(AddressOf ChangeParameter)
|
|
End If
|
|
Return m_cmdChangeParameter
|
|
End Get
|
|
End Property
|
|
|
|
Friend Sub ChangeParameter()
|
|
If (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)) Then Return
|
|
Dim ChangeParameterWndVM As New ChangeParameterWndVM
|
|
Dim ChangeParameterWnd As New ChangeParameterWndV(Application.Current.MainWindow, ChangeParameterWndVM)
|
|
If ChangeParameterWnd.ShowDialog() Then
|
|
LoadingWndHelper.OpenLoadingWnd(ActiveIds.CHANGEPARAM, 1, EgtMsg(63014), "", 100) ' Modifying parameters
|
|
' faccio passare pezzi
|
|
If Not IsNothing(ChangeParameterWndVM.SelParam) Then
|
|
For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList
|
|
For Each Feature In Part.BTLFeatureVMList.Where(Function(x) x.nPRC = ChangeParameterWndVM.SelPRC.nPRC AndAlso CalcBeamPrivateProfileGRP(x.nSelGRP) = ChangeParameterWndVM.SelPRC.nGRP)
|
|
If ChangeParameterWndVM.SelParam.BTLParamM.nType = BTLParamType.CHECKBOX AndAlso Feature.bDO = ChangeParameterWndVM.SelParam.bActualValue Then
|
|
Feature.bDO = ChangeParameterWndVM.SelParam.bNewValue
|
|
Else
|
|
Dim ParamList As ObservableCollection(Of BTLParamVM) = Feature.PBTLParamVMList
|
|
For Each Param In ParamList.Where(Function(x) x.sName = ChangeParameterWndVM.SelParam.sName)
|
|
Select Case Param.nType
|
|
Case BTLParamType.DOUBLE_, BTLParamType.LENGTH
|
|
If Math.Abs(Param.dValue - ChangeParameterWndVM.SelParam.dActualValue) < EPS_SMALL Then
|
|
Param.UpdateParamValue(ChangeParameterWndVM.SelParam.dNewValue, "")
|
|
End If
|
|
Case BTLParamType.STRING_
|
|
If Param.sValue = ChangeParameterWndVM.SelParam.sActualValue Then
|
|
Param.UpdateParamValue(0, ChangeParameterWndVM.SelParam.sNewValue)
|
|
End If
|
|
End Select
|
|
Next
|
|
End If
|
|
Next
|
|
Next
|
|
End If
|
|
LoadingWndHelper.CloseLoadingWnd(ActiveIds.CHANGEPARAM)
|
|
End If
|
|
End Sub
|
|
|
|
#End Region ' ChangeParameter
|
|
|
|
#Region "ChangeMaterial"
|
|
|
|
Public ReadOnly Property ChangeMaterial_Command As ICommand
|
|
Get
|
|
If m_cmdChangeMaterial Is Nothing Then
|
|
m_cmdChangeMaterial = New Command(AddressOf ChangeMaterial)
|
|
End If
|
|
Return m_cmdChangeMaterial
|
|
End Get
|
|
End Property
|
|
|
|
Friend Sub ChangeMaterial()
|
|
If (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)) Then Return
|
|
Dim ChangeMaterialWndVM As New ChangeMaterialWndVM
|
|
Dim ChangeMaterialWnd As New ChangeMaterialWndV(Application.Current.MainWindow, ChangeMaterialWndVM)
|
|
If ChangeMaterialWnd.ShowDialog() Then
|
|
LoadingWndHelper.OpenLoadingWnd(ActiveIds.CHANGEMATERIAL, 1, EgtMsg(63021), "", 100) ' Modifying materials
|
|
' faccio passare pezzi
|
|
If Not IsNothing(ChangeMaterialWndVM.SelProjMaterial) AndAlso Not IsNothing(ChangeMaterialWndVM.SelWhMaterial) Then
|
|
For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList.Where(Function(x) x.sMATERIAL = ChangeMaterialWndVM.SelProjMaterial)
|
|
Part.sMATERIAL = ChangeMaterialWndVM.SelWhMaterial
|
|
Next
|
|
End If
|
|
LoadingWndHelper.CloseLoadingWnd(ActiveIds.CHANGEMATERIAL)
|
|
End If
|
|
End Sub
|
|
|
|
#End Region ' ChangeMaterial
|
|
|
|
#End Region ' COMMANDS
|
|
|
|
End Class
|