cfefeaa4c5
- modifiche per gestione parametri Q tramite gestore Travi di libreria - correzioni per segnalazione pezzo con scarico a caduta.
650 lines
21 KiB
VB.net
650 lines
21 KiB
VB.net
Imports System.Collections.ObjectModel
|
|
Imports System.Collections.Specialized
|
|
Imports System.ComponentModel
|
|
Imports EgtBEAMWALL.Core
|
|
Imports EgtUILib
|
|
Imports EgtWPFLib5
|
|
|
|
Public Class BTLFeatureVM
|
|
Inherits VMBase
|
|
|
|
Private WithEvents m_BTLFeatureM As BTLFeatureM
|
|
Public ReadOnly Property BTLFeatureM As BTLFeatureM
|
|
Get
|
|
Return m_BTLFeatureM
|
|
End Get
|
|
End Property
|
|
Private m_BTLPartM As BTLPartM
|
|
|
|
Public ReadOnly Property nFeatureId As Integer
|
|
Get
|
|
Return m_BTLFeatureM.nFeatureId
|
|
End Get
|
|
End Property
|
|
|
|
Public Property GRPList As ObservableCollection(Of Integer)
|
|
Get
|
|
Return m_BTLFeatureM.GRPList
|
|
End Get
|
|
Set(value As ObservableCollection(Of Integer))
|
|
m_BTLFeatureM.GRPList = value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property nSelGRP As Integer
|
|
Get
|
|
Return m_BTLFeatureM.nSelGRP
|
|
End Get
|
|
Set(value As Integer)
|
|
If value <> -1 Then
|
|
' aggiorno la feature con nuovo valore
|
|
Dim vPar() As Double = Nothing
|
|
Dim sPar As String = String.Empty
|
|
Dim vParQ() As String = Nothing
|
|
m_BTLFeatureM.CalcParamArray(vPar, sPar, vParQ)
|
|
Dim bOK As Boolean = m_BTLFeatureM.UpdateParams(value, m_BTLFeatureM.nPRC, nSelSIDE, m_BTLFeatureM.sDES, m_BTLFeatureM.nPRID,
|
|
m_BTLFeatureM.frFRAME, vPar, sPar, vParQ)
|
|
If bOK Then
|
|
m_BTLFeatureM.nSelGRP = value
|
|
' seleziono feature in disegno
|
|
SelGeomFeature()
|
|
' rendo non calcolata questa feature
|
|
ResetCalcFeature()
|
|
Else
|
|
NotifyPropertyChanged("nSelGRP")
|
|
End If
|
|
NotifyPropertyChanged(NameOf(nSelGRP))
|
|
EgtDraw()
|
|
End If
|
|
End Set
|
|
End Property
|
|
Friend ReadOnly Property sDescGRP As String
|
|
Get
|
|
Dim sDescConstruction As String = String.Empty
|
|
If CalcBeamPrivateProfileGRP(m_BTLFeatureM.nSelGRP) = 0 Then
|
|
sDescConstruction = "L"
|
|
Else
|
|
sDescConstruction = "T"
|
|
End If
|
|
sDescConstruction &= m_BTLFeatureM.nPRC.ToString("000")
|
|
Return sDescConstruction
|
|
End Get
|
|
End Property
|
|
|
|
Public Property nPRC As Integer
|
|
Get
|
|
Return m_BTLFeatureM.nPRC
|
|
End Get
|
|
Set(value As Integer)
|
|
m_BTLFeatureM.nPRC = value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property SIDEList As ObservableCollection(Of Integer)
|
|
Get
|
|
Return m_BTLFeatureM.SIDEList
|
|
End Get
|
|
Set(value As ObservableCollection(Of Integer))
|
|
m_BTLFeatureM.SIDEList = value
|
|
End Set
|
|
End Property
|
|
|
|
' Lato
|
|
Public Property nSelSIDE As Integer
|
|
Get
|
|
Return m_BTLFeatureM.nSelSIDE
|
|
End Get
|
|
Set(value As Integer)
|
|
If value <> -1 Then
|
|
' aggiorno la feature con nuovo valore
|
|
Dim vPar() As Double = Nothing
|
|
Dim sPar As String = String.Empty
|
|
Dim vParQ() As String = Nothing
|
|
m_BTLFeatureM.CalcParamArray(vPar, sPar, vParQ)
|
|
Dim bOK As Boolean = m_BTLFeatureM.UpdateParams(nSelGRP, m_BTLFeatureM.nPRC, value, m_BTLFeatureM.sDES, m_BTLFeatureM.nPRID,
|
|
m_BTLFeatureM.frFRAME, vPar, sPar, vParQ)
|
|
If bOK Then
|
|
m_BTLFeatureM.nSelSIDE = value
|
|
SelGeomFeature()
|
|
' rendo non calcolata questa feature
|
|
ResetCalcFeature()
|
|
Else
|
|
NotifyPropertyChanged("nSelGRP")
|
|
End If
|
|
EgtDraw()
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public ReadOnly Property sName As String
|
|
Get
|
|
Return m_BTLFeatureM.sName
|
|
End Get
|
|
End Property
|
|
|
|
Public Property bDO As Boolean
|
|
Get
|
|
Return m_BTLFeatureM.bDO
|
|
End Get
|
|
Set(value As Boolean)
|
|
If EgtBeamEnableProcess(nFeatureId, value) Then
|
|
m_BTLFeatureM.bDO = value
|
|
EgtDraw()
|
|
' setto feature da ricalcolare
|
|
ResetCalcFeature()
|
|
' imposto modificato per copie
|
|
EgtDuploSetModified(m_BTLPartM.nPartId)
|
|
NotifyPropertyChanged("bDO")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Property nPRID As Integer
|
|
Get
|
|
Return m_BTLFeatureM.nPRID
|
|
End Get
|
|
Set(value As Integer)
|
|
m_BTLFeatureM.nPRID = value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property sDES As String
|
|
Get
|
|
Return m_BTLFeatureM.sDES
|
|
End Get
|
|
Set(value As String)
|
|
m_BTLFeatureM.sDES = value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property frFRAME As Frame3d
|
|
Get
|
|
Return m_BTLFeatureM.frFRAME
|
|
End Get
|
|
Set(value As Frame3d)
|
|
m_BTLFeatureM.frFRAME = value
|
|
End Set
|
|
End Property
|
|
|
|
' proprieta' che mostra la descrizione in interfaccia
|
|
Public ReadOnly Property sDesc As String
|
|
Get
|
|
Return sDescGRP & " " & sName
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property sDrawPath As String
|
|
Get
|
|
Return Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & sDescGRP & ".png"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property nState As CalcStates
|
|
Get
|
|
Return m_BTLFeatureM.nState
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property nCALC_ERR As Integer
|
|
Get
|
|
Return m_BTLFeatureM.nCALC_ERR
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property nCALC_ROT As Integer
|
|
Get
|
|
Return m_BTLFeatureM.nCALC_ROT
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property sCALC_MSG As String
|
|
Get
|
|
Return m_BTLFeatureM.sCALC_MSG
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property Calc_Background As SolidColorBrush
|
|
Get
|
|
If Not m_BTLFeatureM.bDO Then
|
|
Return Brushes.Aqua
|
|
ElseIf m_BTLFeatureM.nState = CalcStates.OK Then
|
|
Return Brushes.Green
|
|
ElseIf m_BTLFeatureM.nState = CalcStates.NOTCALCULATED Then
|
|
Return Brushes.LightGray
|
|
ElseIf m_BTLFeatureM.nState = CalcStates.INFO Then
|
|
Return Brushes.Green
|
|
ElseIf m_BTLFeatureM.nState = CalcStates.WARNING Then
|
|
Return Brushes.Orange
|
|
ElseIf m_BTLFeatureM.nState = CalcStates.ERROR_ Then
|
|
Return Brushes.Red
|
|
Else
|
|
Return Brushes.Red
|
|
End If
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property CALC_ROT_Visibility As Visibility
|
|
Get
|
|
Return If(m_BTLFeatureM.nCALC_ROT <> 0, Visibility.Visible, Visibility.Collapsed)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property CALC_ERR_Letter As String
|
|
Get
|
|
Select Case m_BTLFeatureM.nCALC_ERR
|
|
Case 22
|
|
Return "c"
|
|
Case 19, 23, 24, 25
|
|
Return "e"
|
|
Case 17
|
|
Return "w"
|
|
Case < 0
|
|
Return "i"
|
|
Case Else
|
|
Return ""
|
|
End Select
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property CALC_ERR_Foreground As SolidColorBrush
|
|
Get
|
|
Select Case m_BTLFeatureM.nState
|
|
Case CalcStates.ERROR_
|
|
Return Brushes.Red
|
|
Case CalcStates.WARNING
|
|
Return Brushes.Orange
|
|
Case CalcStates.INFO
|
|
Return Brushes.Green
|
|
Case Else
|
|
Return Brushes.Red
|
|
End Select
|
|
End Get
|
|
End Property
|
|
|
|
Private m_PBTLParamVMList As ObservableCollection(Of BTLParamVM)
|
|
Public Property PBTLParamVMList As ObservableCollection(Of BTLParamVM)
|
|
Get
|
|
Return m_PBTLParamVMList
|
|
End Get
|
|
Set(value As ObservableCollection(Of BTLParamVM))
|
|
m_PBTLParamVMList = value
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_SelPBTLParam As BTLParamVM
|
|
Public Property SelPBTLParam As BTLParamVM
|
|
Get
|
|
Return m_SelPBTLParam
|
|
End Get
|
|
Set(value As BTLParamVM)
|
|
m_SelPBTLParam = value
|
|
If Not IsNothing(m_SelPBTLParam) Then
|
|
' imposto path disegno da mostrare in BottomPanel
|
|
Map.refBottomPanelVM.SetCurrDraw(m_SelPBTLParam.sDrawPath)
|
|
End If
|
|
NotifyPropertyChanged(NameOf(SelPBTLParam))
|
|
End Set
|
|
End Property
|
|
|
|
Private m_QBTLParamVMList As ObservableCollection(Of BTLParamVM)
|
|
Public Property QBTLParamVMList As ObservableCollection(Of BTLParamVM)
|
|
Get
|
|
Return m_QBTLParamVMList
|
|
End Get
|
|
Set(value As ObservableCollection(Of BTLParamVM))
|
|
m_QBTLParamVMList = value
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_SelQParam As BTLParamVM
|
|
Public Property SelQBTLParam As BTLParamVM
|
|
Get
|
|
Return m_SelQParam
|
|
End Get
|
|
Set(value As BTLParamVM)
|
|
m_SelQParam = value
|
|
If Not IsNothing(m_SelQParam) Then
|
|
' imposto path disegno da mostrare in BottomPanel
|
|
Map.refBottomPanelVM.SetCurrDraw(sDrawPath)
|
|
End If
|
|
NotifyPropertyChanged(NameOf(SelQBTLParam))
|
|
End Set
|
|
End Property
|
|
|
|
Public ReadOnly Property Edit_Visibility As Visibility
|
|
Get
|
|
Return If(BTLFeatureM.IsFreeContour AndAlso Not Map.refFreeContourManagerVM.bIsActive, Visibility.Visible, Visibility.Collapsed)
|
|
End Get
|
|
End Property
|
|
Public ReadOnly Property SaveCancel_Visibility As Visibility
|
|
Get
|
|
Return If(BTLFeatureM.IsFreeContour AndAlso Map.refFreeContourManagerVM.bIsActive, Visibility.Visible, Visibility.Collapsed)
|
|
End Get
|
|
End Property
|
|
Friend Sub RefreshFCMBtnVisibility()
|
|
NotifyPropertyChanged(NameOf(Edit_Visibility))
|
|
NotifyPropertyChanged(NameOf(SaveCancel_Visibility))
|
|
End Sub
|
|
|
|
' Definizione comandi
|
|
Private m_cmdEdit As ICommand
|
|
Private m_cmdSave As ICommand
|
|
Private m_cmdCancel As ICommand
|
|
Private m_cmdDeleteFeature As ICommand
|
|
|
|
#Region "CONSTRUCTOR"
|
|
|
|
'Sub New(ParentPart As BTLPartVM, nFeatureId As Integer)
|
|
' MyBase.New(ParentPart, nFeatureId)
|
|
' ' leggo gruppo, numero feature e lato
|
|
' EgtGetInfo(nFeatureId, BTL_FTR_GRP, m_nSelGRP)
|
|
' EgtGetInfo(nFeatureId, BTL_FTR_PRC, m_nPRC)
|
|
' EgtGetInfo(nFeatureId, BTL_FTR_SIDE, m_nSelSIDE)
|
|
' Dim nDO As Integer = 1
|
|
' If EgtGetInfo(nFeatureId, BTL_FTR_DO, nDO) Then
|
|
' m_bDO = (nDO <> 0)
|
|
' Else
|
|
' m_bDO = True
|
|
' End If
|
|
' ' leggo des,prid e frame
|
|
' EgtGetInfo(nFeatureId, BTL_FTR_DES, m_sDES)
|
|
' EgtGetInfo(nFeatureId, BTL_FTR_PRID, m_nPRID)
|
|
' EgtGetInfo(nFeatureId, BTL_FTR_FRAME, m_frFRAME)
|
|
' ' leggo calc error
|
|
' Dim nErr As Integer = 0
|
|
' Dim nRot As Integer = 0
|
|
' Dim nFall As Integer = 0
|
|
' Dim sMsg As String = ""
|
|
' Dim bCalc As Boolean = False
|
|
' bCalc = EgtGetInfo(m_nFeatureId, ITG_PROJ_ERR, nErr)
|
|
' EgtGetInfo(m_nFeatureId, ITG_PROJ_ROT, nRot)
|
|
' EgtGetInfo(m_nFeatureId, ITG_PROJ_FALL, nFall)
|
|
' EgtGetInfo(m_nFeatureId, ITG_PROJ_MSG, sMsg)
|
|
' CalcFeatureUpdate(bCalc, nErr, nRot, nFall, sMsg)
|
|
' ' leggo parametri della feature
|
|
' GetBeamPrivateProfileGRPList(CalcBeamPrivateProfileGRP(nSelGRP), m_nPRC, m_GRPList)
|
|
' GetBeamPrivateProfileName(m_nSelGRP, m_nPRC, Me)
|
|
' ' crea parametri per questa feature da file ini
|
|
' CreateFeatureParams()
|
|
' ReadFeatureParams()
|
|
'End Sub
|
|
|
|
Sub New(BTLFeatureM As BTLFeatureM, BTLPartM As BTLPartM)
|
|
m_BTLFeatureM = BTLFeatureM
|
|
AddHandler m_BTLFeatureM.PBTLParamAdded, AddressOf OnPBTLParamAdded
|
|
AddHandler m_BTLFeatureM.QBTLParamAdded, AddressOf OnQBTLParamAdded
|
|
m_BTLPartM = BTLPartM
|
|
CreatePBTLParamVMList()
|
|
CreateQBTLParamVMList()
|
|
NotifyPropertyChanged(NameOf(Calc_Background))
|
|
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
|
|
NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
|
|
NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
|
|
End Sub
|
|
|
|
Sub New(BTLFeatureM As BTLFeatureM)
|
|
m_BTLFeatureM = BTLFeatureM
|
|
'AddHandler m_BTLFeatureM.PBTLParamAdded, AddressOf OnPBTLParamAdded
|
|
'AddHandler m_BTLFeatureM.QBTLParamAdded, AddressOf OnQBTLParamAdded
|
|
m_BTLPartM = Nothing
|
|
'CreatePBTLParamVMList()
|
|
'CreateQBTLParamVMList()
|
|
NotifyPropertyChanged(NameOf(Calc_Background))
|
|
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
|
|
NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
|
|
NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
|
|
End Sub
|
|
|
|
#End Region ' CONSTRUCTOR
|
|
|
|
#Region "METHODS"
|
|
|
|
Private Sub CreatePBTLParamVMList()
|
|
Dim all As List(Of BTLParamVM) = (From BTLParamM In m_BTLFeatureM.GetPBTLParams()
|
|
Select New BTLParamVM(BTLParamM, m_BTLFeatureM)).ToList()
|
|
|
|
For Each BTLParamVM As BTLParamVM In all
|
|
AddHandler BTLParamVM.PropertyChanged, AddressOf OnPBTLParamVMPropertyChanged
|
|
Next
|
|
|
|
m_PBTLParamVMList = New ObservableCollection(Of BTLParamVM)(all)
|
|
AddHandler m_PBTLParamVMList.CollectionChanged, AddressOf OnPBTLParamVMListChanged
|
|
|
|
End Sub
|
|
|
|
Private Sub CreateQBTLParamVMList()
|
|
Dim all As List(Of BTLParamVM) = (From BTLParamM In m_BTLFeatureM.GetQBTLParams()
|
|
Select New BTLParamVM(BTLParamM, m_BTLFeatureM)).ToList()
|
|
For Each BTLParamVM As BTLParamVM In all
|
|
AddHandler BTLParamVM.PropertyChanged, AddressOf OnQBTLParamVMPropertyChanged
|
|
Next
|
|
|
|
m_QBTLParamVMList = New ObservableCollection(Of BTLParamVM)(all)
|
|
AddHandler m_QBTLParamVMList.CollectionChanged, AddressOf OnQBTLParamVMListChanged
|
|
End Sub
|
|
|
|
' funzione che aggiorna lo stato e gli errori dopo calcolo
|
|
Friend Sub CalcFeatureUpdate(ERR As Integer, ROT As Integer, MSG As String)
|
|
EgtSetInfo(nFeatureId, If(Map.refMainMenuVM.SelPage = Pages.VIEW, ITG_PROJ_ERR, ITG_PROD_ERR), ERR, True)
|
|
EgtSetInfo(nFeatureId, If(Map.refMainMenuVM.SelPage = Pages.VIEW, ITG_PROJ_MSG, ITG_PROD_MSG), MSG, True)
|
|
EgtSetInfo(nFeatureId, If(Map.refMainMenuVM.SelPage = Pages.VIEW, ITG_PROJ_ROT, ITG_PROD_ROT), ROT, True)
|
|
m_BTLFeatureM.nCALC_ERR = ERR
|
|
m_BTLFeatureM.nCALC_ROT = ROT
|
|
m_BTLFeatureM.sCALC_MSG = MSG
|
|
If ERR = 0 Then
|
|
m_BTLFeatureM.nState = CalcStates.OK
|
|
ElseIf ERR = 17 Then
|
|
m_BTLFeatureM.nState = CalcStates.WARNING
|
|
ElseIf ERR > 0 Then
|
|
m_BTLFeatureM.nState = CalcStates.ERROR_
|
|
ElseIf ERR < 0 Then
|
|
m_BTLFeatureM.nState = CalcStates.INFO
|
|
End If
|
|
NotifyPropertyChanged(NameOf(Calc_Background))
|
|
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
|
|
NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
|
|
NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
|
|
End Sub
|
|
|
|
Friend Sub ResetCalcFeature()
|
|
EgtRemoveInfo(nFeatureId, If(Map.refMainMenuVM.SelPage = Pages.VIEW, ITG_PROJ_ERR, ITG_PROD_ERR))
|
|
EgtRemoveInfo(nFeatureId, If(Map.refMainMenuVM.SelPage = Pages.VIEW, ITG_PROJ_MSG, ITG_PROD_MSG))
|
|
EgtRemoveInfo(nFeatureId, If(Map.refMainMenuVM.SelPage = Pages.VIEW, ITG_PROJ_ROT, ITG_PROD_ROT))
|
|
m_BTLFeatureM.nState = CalcStates.NOTCALCULATED
|
|
m_BTLFeatureM.nCALC_ERR = 0
|
|
m_BTLFeatureM.nCALC_ROT = 0
|
|
m_BTLFeatureM.sCALC_MSG = ""
|
|
NotifyPropertyChanged(NameOf(Calc_Background))
|
|
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
|
|
NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
|
|
NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
|
|
End Sub
|
|
|
|
' funzione che seleziona la feature nella geometria
|
|
Friend Sub SelGeomFeature()
|
|
EgtDeselectAll()
|
|
SelGeomFeature(nFeatureId)
|
|
End Sub
|
|
Private Sub SelGeomFeature(nMyFeatureId As Integer)
|
|
EgtSelectObj(nMyFeatureId)
|
|
Dim sVal As String = ""
|
|
If EgtGetInfo(nMyFeatureId, BTL_FTR_ADJID, sVal) Then
|
|
Dim vAdjId() As String = sVal.Split(","c)
|
|
For Each sAdjId In vAdjId
|
|
Dim nAdjId As Integer
|
|
If Integer.TryParse(sAdjId, nAdjId) Then
|
|
SelGeomFeature(nMyFeatureId + nAdjId)
|
|
End If
|
|
Next
|
|
End If
|
|
If EgtGetInfo(nMyFeatureId, BTL_FTR_AUXID, sVal) Then
|
|
Dim vAuxId() As String = sVal.Split(","c)
|
|
For Each sAuxId In vAuxId
|
|
Dim nAuxId As Integer
|
|
If Integer.TryParse(sAuxId, nAuxId) Then
|
|
EgtSelectObj(nMyFeatureId + nAuxId)
|
|
End If
|
|
Next
|
|
End If
|
|
End Sub
|
|
|
|
Public Function Copy() As BTLFeatureM
|
|
Return Copy( m_BTLPartM)
|
|
End Function
|
|
|
|
Public Function Copy(DestBTLPart As BTLPartM) As BTLFeatureM
|
|
' creo nuova feature
|
|
Dim vPar() As Double = Nothing
|
|
Dim sPar As String = String.Empty
|
|
Dim vParQ() As String = Nothing
|
|
m_BTLFeatureM.CalcParamArray(vPar, sPar, vParQ)
|
|
' aggiorno la feature con nuovo valore
|
|
EgtBeamSetPart(DestBTLPart.nPartId)
|
|
Dim nNewFeatureId As Integer = EgtBeamAddProcess(m_BTLFeatureM.nSelGRP, m_BTLFeatureM.nPRC, m_BTLFeatureM.nSelSIDE, m_BTLFeatureM.sDES,
|
|
DestBTLPart.NewProcId(), m_BTLFeatureM.frFRAME, vPar, sPar, vParQ)
|
|
' se è stata creata
|
|
If nNewFeatureId <> GDB_ID.NULL Then
|
|
' Riporto eventuali indicazioni di parametri Q custom
|
|
For Each QPar In QBTLParamVMList
|
|
If QPar.bCustom Then EgtSetInfo( nNewFeatureId, QPar.sName & "A", 1)
|
|
Next
|
|
Dim NewFeat As BTLFeatureM = BTLFeatureM.CreateBTLFeature(m_BTLPartM, nNewFeatureId)
|
|
' la aggiungo a struttura BTL pezzo di destinazione
|
|
DestBTLPart.AddBTLFeature(NewFeat)
|
|
Return NewFeat
|
|
End If
|
|
Return Nothing
|
|
End Function
|
|
|
|
#End Region ' METHODS
|
|
|
|
#Region "COMMANDS"
|
|
|
|
#Region "DeleteFeature"
|
|
|
|
Public ReadOnly Property DeleteFeature_Command As ICommand
|
|
Get
|
|
If m_cmdDeleteFeature Is Nothing Then
|
|
m_cmdDeleteFeature = New Command(AddressOf DeleteFeature)
|
|
End If
|
|
Return m_cmdDeleteFeature
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub DeleteFeature()
|
|
If Map.refMainMenuVM.SelPage = Pages.VIEW Then Map.refLeftPanelVM.RemoveFeature()
|
|
End Sub
|
|
|
|
#End Region ' DeleteFeature
|
|
|
|
#Region "Edit"
|
|
|
|
Public ReadOnly Property Edit_Command As ICommand
|
|
Get
|
|
If m_cmdEdit Is Nothing Then
|
|
m_cmdEdit = New Command(AddressOf Edit)
|
|
End If
|
|
Return m_cmdEdit
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub Edit()
|
|
' attivo modalita' contorno libero
|
|
Map.refFreeContourManagerVM.Open()
|
|
End Sub
|
|
|
|
#End Region ' Edit
|
|
|
|
#Region "Save"
|
|
|
|
Public ReadOnly Property Save_Command As ICommand
|
|
Get
|
|
If m_cmdSave Is Nothing Then
|
|
m_cmdSave = New Command(AddressOf Save)
|
|
End If
|
|
Return m_cmdSave
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub Save()
|
|
' disattivo modalita' contorno libero
|
|
Map.refFreeContourManagerVM.Close(True)
|
|
End Sub
|
|
|
|
#End Region ' Save
|
|
|
|
#Region "Cancel"
|
|
|
|
Public ReadOnly Property Cancel_Command As ICommand
|
|
Get
|
|
If m_cmdCancel Is Nothing Then
|
|
m_cmdCancel = New Command(AddressOf Cancel)
|
|
End If
|
|
Return m_cmdCancel
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub Cancel()
|
|
' disattivo modalita' contorno libero
|
|
Map.refFreeContourManagerVM.Close(False)
|
|
End Sub
|
|
|
|
#End Region ' Cancel
|
|
|
|
#End Region ' COMMANDS
|
|
|
|
#Region "EVENTS"
|
|
|
|
Private Sub OnPBTLParamAdded(sender As Object, e As BTLParamAddedEventArgs) Handles m_BTLFeatureM.PBTLParamAdded
|
|
Dim BTLParamVM As BTLParamVM = New BTLParamVM(e.NewBTLParam, m_BTLFeatureM)
|
|
PBTLParamVMList.Add(BTLParamVM)
|
|
End Sub
|
|
Private Sub OnQBTLParamAdded(sender As Object, e As BTLParamAddedEventArgs) Handles m_BTLFeatureM.QBTLParamAdded
|
|
Dim BTLParamVM As BTLParamVM = New BTLParamVM(e.NewBTLParam, m_BTLFeatureM)
|
|
QBTLParamVMList.Add(BTLParamVM)
|
|
End Sub
|
|
|
|
Private Sub OnPBTLParamVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
|
|
If Not IsNothing(e.NewItems) AndAlso e.NewItems.Count > 0 Then
|
|
For Each BTLParamVM As BTLParamVM In e.NewItems
|
|
AddHandler BTLParamVM.PropertyChanged, AddressOf OnPBTLParamVMPropertyChanged
|
|
Next
|
|
End If
|
|
If Not IsNothing(e.OldItems) AndAlso e.OldItems.Count > 0 Then
|
|
For Each BTLParamVM As BTLParamVM In e.OldItems
|
|
RemoveHandler BTLParamVM.PropertyChanged, AddressOf OnPBTLParamVMPropertyChanged
|
|
Next
|
|
End If
|
|
End Sub
|
|
Private Sub OnQBTLParamVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
|
|
If Not IsNothing(e.NewItems) AndAlso e.NewItems.Count > 0 Then
|
|
For Each BTLParamVM As BTLParamVM In e.NewItems
|
|
AddHandler BTLParamVM.PropertyChanged, AddressOf OnQBTLParamVMPropertyChanged
|
|
Next
|
|
End If
|
|
If Not IsNothing(e.OldItems) AndAlso e.OldItems.Count > 0 Then
|
|
For Each BTLParamVM As BTLParamVM In e.OldItems
|
|
RemoveHandler BTLParamVM.PropertyChanged, AddressOf OnQBTLParamVMPropertyChanged
|
|
Next
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub OnPBTLParamVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
|
Select Case e.PropertyName
|
|
Case "dValue", "sValue"
|
|
' riseleziono questa feature
|
|
SelGeomFeature()
|
|
' rendo non calcolata questa feature
|
|
ResetCalcFeature()
|
|
End Select
|
|
End Sub
|
|
Private Sub OnQBTLParamVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
|
Select Case e.PropertyName
|
|
'Case "sMATERIAL"
|
|
End Select
|
|
End Sub
|
|
|
|
#End Region ' EVENTS
|
|
|
|
End Class
|