Compare commits

...

1 Commits

Author SHA1 Message Date
Emmanuele Sassi 649a1d6a46 - correzioni e emigliorie 2025-06-05 15:04:57 +02:00
6 changed files with 45 additions and 15 deletions
@@ -1245,6 +1245,9 @@ Public Class BTLPartManagerVM
''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary>
Friend Sub Edit()
If Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM) Then
Map.refForcedStrategyBTLVM.Init(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM.BTLFeatureM)
End If
Map.refProjectVM.SetRawPartManagerVisibility(Visibility.Collapsed)
Map.refProjectVM.SetStrategyManagerVisibility(Visibility.Visible)
Map.refProjectVM.SetSelManagerTab(ProjectVM.StrategyManagerTab.FEATUREMANAGER)
@@ -1581,8 +1581,6 @@ Public Class BTLPartVM
DirectCast(m_SelBTLFeatureVM, BTLFeatureVM).SelGeomFeature()
' deseleziono i parametri
If Not IsNothing(SelBTLFeatureVM.SelPBTLParam) Then SelBTLFeatureVM.SelPBTLParam = Nothing
Else
EgtDeselectAll()
End If
If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.FeatureSelectionChanged()
'End If
@@ -147,6 +147,11 @@ Public Class BTLStructureVM
Configuration.UpdateGraphics()
End Sub
Private m_SelWithoutOpenFeatureList As Boolean
Friend Sub SetSelWithoutOpenFeatureList(bValue As Boolean)
m_SelWithoutOpenFeatureList = bValue
End Sub
Public Sub SelectBTLPart(BtlPart As BTLPartVM)
m_SelBTLPart = BtlPart
'm_SelBTLPart.SetIsSettingBtnOpen(False)
@@ -208,11 +213,11 @@ Public Class BTLStructureVM
' seleziono la prima feature
If Not IsNothing(BtlPart) AndAlso Not IsNothing(BtlPart.BTLFeatureVMList) AndAlso BtlPart.BTLFeatureVMList.Count > 0 Then SelBTLPart.SelBTLFeatureVMOnlyGraph = BtlPart.BTLFeatureVMList(0)
' aggiorno stato selezionato tutto
Map.refShowBeamPanelVM.bShowAll = False
'Map.refShowBeamPanelVM.bShowAll = False
Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False)
EgtZoom(ZM.ALL)
NotifyPropertyChanged(NameOf(SelBTLPart))
If m_SelBTLParts.Count = 1 Then
If Not m_SelWithoutOpenFeatureList AndAlso m_SelBTLParts.Count = 1 Then
BtlPart.SetOpenFeatureList(True)
End If
End Sub
@@ -260,9 +265,9 @@ Public Class BTLStructureVM
End If
End If
' seleziono la prima feature
If Not IsNothing(BtlPart) AndAlso Not IsNothing(BtlPart.BTLFeatureVMList) AndAlso BtlPart.BTLFeatureVMList.Count > 0 Then SelBTLPart.SelBTLFeatureVM = BtlPart.BTLFeatureVMList(0)
If Not IsNothing(BtlPart) AndAlso Not IsNothing(BtlPart.BTLFeatureVMList) AndAlso BtlPart.BTLFeatureVMList.Count > 0 Then SelBTLPart.SelBTLFeatureVMOnlyGraph = BtlPart.BTLFeatureVMList(0)
' aggiorno stato selezionato tutto
Map.refShowBeamPanelVM.bShowAll = False
'Map.refShowBeamPanelVM.bShowAll = False
Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False)
EgtZoom(ZM.ALL)
NotifyPropertyChanged(NameOf(SelBTLPart))
@@ -278,10 +283,10 @@ Public Class BTLStructureVM
End If
' disabilito eventuale feature selezionata
If Not IsNothing(BtlPart.m_SelBTLFeatureVM) Then
BtlPart.SelBTLFeatureVM = Nothing
BtlPart.SelBTLFeatureVMOnlyGraph = Nothing
End If
EgtDraw()
If m_SelBTLParts.Count = 1 Then
If Not m_SelWithoutOpenFeatureList AndAlso m_SelBTLParts.Count = 1 Then
m_SelBTLParts(0).SetOpenFeatureList(True)
End If
If BtlPart.bOpenFeatureList Then
@@ -38,8 +38,9 @@ Public Class OnlyProdBTLPartListV
If TypeOf Row.DataContext IsNot BTLPartVM Then Return
Dim BTLPartVM As BTLPartVM = DirectCast(Row.DataContext, BTLPartVM)
Dim DataGridDetailsPresenter As Object = TreeHelperManager.FindVisualParents(Of Button, CheckBox, Primitives.DataGridDetailsPresenter)(e.OriginalSource)
If Not IsNothing(DataGridDetailsPresenter) Then Return
Dim bSelWithoutOpenFeatureList As Boolean = Not IsNothing(DataGridDetailsPresenter)
Map.refProjectVM.BTLStructureVM.SetSelWithoutOpenFeatureList(bSelWithoutOpenFeatureList)
If bSelWithoutOpenFeatureList Then Return
If Map.refProjectVM.BTLStructureVM.SelBTLParts.Contains(BTLPartVM) Then
BTLPartVM.SetOpenFeatureList(Not BTLPartVM.bOpenFeatureList)
End If
@@ -52,11 +52,19 @@
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type Optimizer:StrategyFeature}"
ItemsSource="{Binding TopologyList}">
<StackPanel Style="{StaticResource OnlyProdPartManager_StackPanel}">
<TextBlock Text="{Binding sName}" Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBlock Text="{Binding nGRP}" Style="{StaticResource DialogWindow_TextBlock}" Margin="5,0,0,0"/>
<TextBlock Text="{Binding nPRC}" Style="{StaticResource DialogWindow_TextBlock}" Margin="0,0,5,0"/>
</StackPanel>
<CheckBox IsChecked="{Binding RelativeSource={RelativeSource AncestorType=TreeViewItem}, Path=IsExpanded}">
<CheckBox.Template>
<ControlTemplate>
<Border Background="{Binding Background, RelativeSource={RelativeSource AncestorType={x:Type TreeView}}}">
<StackPanel Style="{StaticResource OnlyProdPartManager_StackPanel}">
<TextBlock Text="{Binding sName}" Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBlock Text="{Binding nGRP}" Style="{StaticResource DialogWindow_TextBlock}" Margin="5,0,0,0"/>
<TextBlock Text="{Binding nPRC}" Style="{StaticResource DialogWindow_TextBlock}" Margin="0,0,5,0"/>
</StackPanel>
</Border>
</ControlTemplate>
</CheckBox.Template>
</CheckBox>
</HierarchicalDataTemplate>
<DataTemplate DataType="{x:Type Optimizer:Topology}">
<TextBlock Text="{Binding sName}" Style="{StaticResource DialogWindow_TextBlock}"/>
@@ -65,6 +73,7 @@
<TreeView.ItemContainerStyle>
<Style TargetType="{x:Type TreeViewItem}">
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"/>
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}"/>
<Setter Property="Focusable" Value="{Binding RelativeSource={RelativeSource Self}, Converter={StaticResource StrategyTypeToFocusableConverter}}"/>
</Style>
</TreeView.ItemContainerStyle>
@@ -590,6 +590,20 @@ Public Class StrategyFeature
End Set
End Property
Private m_bIsExpanded As Boolean
Public Property IsExpanded As Boolean
Get
Return m_bIsExpanded
End Get
Set(value As Boolean)
If Not value AndAlso m_TopologyList.Any(Function(x) x.IsSelected) Then
' NotifyPropertyChanged(IsExpanded)
Else
m_bIsExpanded = value
End If
End Set
End Property
#End Region ' Fields & Propeties
#Region "CONSTRUCTOR"