This commit is contained in:
Emmanuele Sassi
2025-02-20 17:24:09 +01:00
3 changed files with 49 additions and 22 deletions
+6
View File
@@ -399,6 +399,12 @@ Public Class BTLFeatureM
TempList.Add(NewBTLParam)
ParamIndex += 1
End While
If TempList.Count <= 0 Then
While BTLIniFile.GetBeamPrivateProfileParam(m_nSelGRP, m_nPRC, 0, True, ParamIndex, Me, NewBTLParam)
TempList.Add(NewBTLParam)
ParamIndex += 1
End While
End If
NewBTLFeature.PBTLParamMList = TempList
' leggo tutti i Q della feature
ParamIndex = 1
@@ -135,23 +135,13 @@ Public Class BTLFeatureVM
Set(value As Integer)
If value <> m_BTLFeatureM.nSelVARIANT Then
m_BTLFeatureM.nSelVARIANT = value
' crea parametri per questa feature da file ini
m_BTLFeatureM.CreateFeatureParams(m_BTLFeatureM)
m_BTLFeatureM.SetDefaultValues()
CreatePBTLParamVMList()
CreateQBTLParamVMList()
' 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 vPar As Double() = Nothing
Dim sPar As String = Nothing
Dim vParQ As String() = Nothing
CreateFeatureVariant(value, vPar, sPar, vParQ)
If IsNothing(vPar) Then
m_BTLFeatureM.nSelVARIANT = 0
m_BTLFeatureM.CreateFeatureParams(m_BTLFeatureM)
m_BTLFeatureM.SetDefaultValues()
CreatePBTLParamVMList()
CreateQBTLParamVMList()
m_BTLFeatureM.CalcParamArray(vPar, sPar, vParQ)
CreateFeatureVariant(value, vPar, sPar, vParQ)
End If
m_BTLFeatureM.nSelVARIANT = value
Dim bOK As Boolean = m_BTLFeatureM.UpdateParams(nSelGRP, m_BTLFeatureM.nPRC, nSelSIDE, sDES, m_BTLFeatureM.nPRID,
@@ -171,6 +161,25 @@ Public Class BTLFeatureVM
End Set
End Property
Private Sub CreateFeatureVariant(value As Integer, ByRef vPar() As Double, ByRef sPar As String, ByRef vParQ() As String)
' crea parametri per questa feature da file ini
m_BTLFeatureM.CreateFeatureParams(m_BTLFeatureM)
m_BTLFeatureM.SetDefaultValues()
CreatePBTLParamVMList()
CreateQBTLParamVMList()
' aggiorno la feature con nuovo valore
vPar = Nothing
sPar = Nothing
vParQ = Nothing
m_BTLFeatureM.CalcParamArray(vPar, sPar, vParQ)
' imposto path disegno da mostrare in BottomPanel
If value > 0 AndAlso File.Exists(Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & sDescGRP & "." & sDES & ".png") Then
Map.refBottomPanelVM.SetCurrDraw(Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & sDescGRP & "." & sDES & ".png")
Else
Map.refBottomPanelVM.SetCurrDraw(Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & sDescGRP & ".png")
End If
End Sub
Public Property sPriority As String
Get
Return m_BTLFeatureM.nPriority.ToString()
@@ -243,7 +252,11 @@ Public Class BTLFeatureVM
Public ReadOnly Property sDrawPath As String
Get
Return Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & sDescGRP & ".png"
If nPRC = 900 AndAlso nSelVARIANT > 0 Then
Return Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & sDescGRP & "." & sDES & ".png"
Else
Return Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & sDescGRP & ".png"
End If
End Get
End Property
@@ -5,6 +5,7 @@ Imports EgtBEAMWALL.Core
Imports System.Collections.Specialized
Imports System.ComponentModel
Imports System.Windows.Threading
Imports System.Security.Cryptography
Public Class BTLPartVM
Inherits VMBase
@@ -1542,16 +1543,23 @@ Public Class BTLPartVM
If Integer.TryParse(m_SelBTLFeatureVM.sDES, nVariant) Then
m_SelBTLFeatureVM.nSelVARIANT = nVariant
End If
If m_SelBTLFeatureVM.nSelVARIANT > 0 AndAlso
System.IO.File.Exists(Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & m_SelBTLFeatureVM.sDescGRP & "." & m_SelBTLFeatureVM.sDES & ".png") Then
' imposto path disegno da mostrare in BottomPanel
Map.refBottomPanelVM.SetCurrDraw(Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & m_SelBTLFeatureVM.sDescGRP & "." & m_SelBTLFeatureVM.sDES & ".png")
Else
Map.refBottomPanelVM.SetCurrDraw(Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & m_SelBTLFeatureVM.sDescGRP & ".png")
End If
Else
Map.refFeatureManagerVM.SetVariant_Visibility(Visibility.Collapsed)
End If
Else
EgtDeselectAll()
Else
EgtDeselectAll()
End If
Map.refLeftPanelVM.FeatureSelectionChanged()
End If
Map.refLeftPanelVM.FeatureSelectionChanged()
End If
EgtDraw()
NotifyPropertyChanged(NameOf(SelBTLFeatureVM))
EgtDraw()
NotifyPropertyChanged(NameOf(SelBTLFeatureVM))
End Set
End Property