Merge branch 'feature/NewGraphicsProgram' of https://gitlab.steamware.net/egalware-cadcam/interfacce/egtbeamwall into feature/NewGraphicsProgram

This commit is contained in:
Demetrio Cassarino
2025-07-09 13:08:00 +02:00
15 changed files with 245 additions and 257 deletions
+28 -1
View File
@@ -229,7 +229,6 @@ Public Class BTLFeatureVM
' funzione che seleziona la feature nella geometria
Public Sub SelGeomFeature()
EgtDeselectAll()
SelGeomFeature(nFeatureId)
End Sub
@@ -256,6 +255,34 @@ Public Class BTLFeatureVM
End If
End Sub
' funzione che seleziona la feature nella geometria
Public Sub DeselGeomFeature()
DeselGeomFeature(nFeatureId)
End Sub
Private Sub DeselGeomFeature(nMyFeatureId As Integer)
EgtDeselectObj(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
DeselGeomFeature(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
EgtDeselectObj(nMyFeatureId + nAuxId)
End If
Next
End If
End Sub
Public Overridable Sub RefreshFeature()
End Sub
@@ -29,7 +29,7 @@ Public Class BTLPartManagerVM
Public ReadOnly Property CopyPart_IsEnabled As Boolean
Get
Return m_BTLPartManager_IsEnabled AndAlso Not IsNothing(Map.refShowBeamPanelVM) AndAlso Not Map.refShowBeamPanelVM.bShowAll AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Not Map.refProjectVM.BTLStructureVM.SelBTLPartsCnt > 1
Return m_BTLPartManager_IsEnabled AndAlso Not IsNothing(Map.refShowBeamPanelVM) AndAlso Not Map.refShowBeamPanelVM.bShowAll AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Not Map.refProjectVM.BTLStructureVM.SelBTLParts.Count > 1
End Get
End Property
@@ -362,6 +362,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)
+15 -12
View File
@@ -1525,32 +1525,37 @@ Public Class BTLPartVM
End Get
End Property
Private m_PrevSelBTLFeatureVM As BTLFeatureVM
Public m_SelBTLFeatureVM As BTLFeatureVM
Public Property SelBTLFeatureVM As BTLFeatureVM
Get
Return m_SelBTLFeatureVM
End Get
Set(value As BTLFeatureVM)
If Not IsNothing(m_PrevSelBTLFeatureVM) Then m_PrevSelBTLFeatureVM.DeselGeomFeature()
m_SelBTLFeatureVM = value
If Not IsNothing(m_SelBTLFeatureVM) Then
DirectCast(m_SelBTLFeatureVM, BTLFeatureVM).SelGeomFeature()
m_SelBTLFeatureVM.SelGeomFeature()
m_PrevSelBTLFeatureVM = value
' deseleziono i parametri
If Not IsNothing(SelBTLFeatureVM.SelPBTLParam) Then SelBTLFeatureVM.SelPBTLParam = Nothing
' rinfresco bottoni freecontour
m_SelBTLFeatureVM.RefreshFCMBtnVisibility()
' Forzo strategia
Map.refForcedStrategyBTLVM.Init(m_SelBTLFeatureVM.BTLFeatureM)
Else
EgtDeselectAll()
'Else
' EgtDeselectAll()
End If
If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.FeatureSelectionChanged()
'End If
If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
EgtResetCurrMachGroup()
ResetSearchFound()
Map.refStatisticsTimePanelVM.SetViewPage_Visibility(Visibility.Visible)
Map.refStatisticsTimePanelVM.SetMachiningPage_Visibility(Visibility.Collapsed)
End If
'If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
' If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then
' EgtResetCurrMachGroup()
' ResetSearchFound()
' Map.refStatisticsTimePanelVM.SetViewPage_Visibility(Visibility.Visible)
' Map.refStatisticsTimePanelVM.SetMachiningPage_Visibility(Visibility.Collapsed)
' End If
'End If
EgtDraw()
NotifyPropertyChanged(NameOf(SelBTLFeatureVM))
' se modalità building, la tolgo
@@ -1567,11 +1572,9 @@ Public Class BTLPartVM
Set(value As BTLFeatureVM)
m_SelBTLFeatureVM = value
If Not IsNothing(m_SelBTLFeatureVM) Then
DirectCast(m_SelBTLFeatureVM, BTLFeatureVM).SelGeomFeature()
m_SelBTLFeatureVM.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
@@ -53,64 +53,64 @@ Public Class BTLStructureVM
m_bOnlySelectItem = value
End Set
End Property
Private m_PrevSelectionType As SelectionTypes = SelectionTypes.NULL
Friend ReadOnly Property PrevSelectionType As SelectionTypes
Get
Return m_PrevSelectionType
End Get
End Property
Private m_SelectionType As SelectionTypes = SelectionTypes.NULL
Friend ReadOnly Property SelectionType As SelectionTypes
Get
Return m_SelectionType
End Get
End Property
Friend Sub SetSelectionType(value As SelectionTypes)
If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE And Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then
' resetto gruppo di lavorazione corrente
EgtResetCurrMachGroup()
End If
If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
' rimuovo selezione da pezzo in MachGroup
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) AndAlso Not IsNothing(Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup) Then
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.SelPart) Then
Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.SelPart = Nothing
End If
End If
End If
m_PrevSelectionType = m_SelectionType
If value = m_SelectionType And (Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART Or Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PARTLIST) Then
For Each BTLPart In m_BTLPartVMList
BTLPart.SetOpenFeatureList(False)
Next
Return
End If
m_SelectionType = value
Select Case m_SelectionType
Case SelectionTypes.SELECT_
' verifico reset mark su tutti i pezzi
For Each BTLPart In m_BTLPartVMList
EgtResetMark(BTLPart.nPartId)
Next
Case SelectionTypes.HIGHLIGHT
If m_PrevSelectionType = SelectionTypes.SELECT_ Then
EgtBeamShowFacesName(False)
EgtBeamShowLoadingSide(False, False)
End If
If Not IsNothing(m_SelBTLPart) Then
m_SelBTLPart = Nothing
NotifyPropertyChanged(NameOf(SelBTLPart))
End If
' mostro pezzi selezionati
Map.refProjectVM.BTLStructureVM.ShowAll(False)
' se attivata opzione, li assemblo
'Map.refProjectVM.BTLStructureVM.ShowBuilding(If(Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, Map.refShowBeamPanelVM.ShowBuilding_IsChecked, False), False)
End Select
' aggiornamento grafica
If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.PartShowAllChanged()
If Not IsNothing(Map.refBTLPartManagerVM) Then Map.refBTLPartManagerVM.PartShowAllChanged()
If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.FeatureSelectionChanged()
End Sub
'Private m_PrevSelectionType As SelectionTypes = SelectionTypes.NULL
'Friend ReadOnly Property PrevSelectionType As SelectionTypes
' Get
' Return m_PrevSelectionType
' End Get
'End Property
'Private m_SelectionType As SelectionTypes = SelectionTypes.NULL
'Friend ReadOnly Property SelectionType As SelectionTypes
' Get
' Return m_SelectionType
' End Get
'End Property
'Friend Sub SetSelectionType(value As SelectionTypes)
' If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE And Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then
' ' resetto gruppo di lavorazione corrente
' EgtResetCurrMachGroup()
' End If
' If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
' ' rimuovo selezione da pezzo in MachGroup
' If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) AndAlso Not IsNothing(Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup) Then
' If Not IsNothing(Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.SelPart) Then
' Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.SelPart = Nothing
' End If
' End If
' End If
' m_PrevSelectionType = m_SelectionType
' If value = m_SelectionType And (Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART Or Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PARTLIST) Then
' For Each BTLPart In m_BTLPartVMList
' BTLPart.SetOpenFeatureList(False)
' Next
' Return
' End If
' m_SelectionType = value
' Select Case m_SelectionType
' Case SelectionTypes.SELECT_
' ' verifico reset mark su tutti i pezzi
' For Each BTLPart In m_BTLPartVMList
' EgtResetMark(BTLPart.nPartId)
' Next
' Case SelectionTypes.HIGHLIGHT
' If m_PrevSelectionType = SelectionTypes.SELECT_ Then
' EgtBeamShowFacesName(False)
' EgtBeamShowLoadingSide(False, False)
' End If
' If Not IsNothing(m_SelBTLPart) Then
' m_SelBTLPart = Nothing
' NotifyPropertyChanged(NameOf(SelBTLPart))
' End If
' ' mostro pezzi selezionati
' Map.refProjectVM.BTLStructureVM.ShowAll(False)
' ' se attivata opzione, li assemblo
' 'Map.refProjectVM.BTLStructureVM.ShowBuilding(If(Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, Map.refShowBeamPanelVM.ShowBuilding_IsChecked, False), False)
' End Select
' ' aggiornamento grafica
' If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.PartShowAllChanged()
' If Not IsNothing(Map.refBTLPartManagerVM) Then Map.refBTLPartManagerVM.PartShowAllChanged()
' If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.FeatureSelectionChanged()
'End Sub
Private m_SelBTLParts As New PartsObservableCollection(Of BTLPartVM)
Public ReadOnly Property SelBTLParts As PartsObservableCollection(Of BTLPartVM)
@@ -119,13 +119,6 @@ Public Class BTLStructureVM
End Get
End Property
Private m_SelBTLPartsCnt As Integer = Nothing
Public ReadOnly Property SelBTLPartsCnt As Integer
Get
Return m_SelBTLPartsCnt
End Get
End Property
Private Sub SelBTLParts_CollectionChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
If m_bOnlySelectItem Then Return
Select Case e.Action
@@ -147,65 +140,7 @@ Public Class BTLStructureVM
If Not IsNothing(Map.refBTLPartManagerVM) Then Map.refBTLPartManagerVM.PartShowAllChanged()
End Sub
Public Sub SelectBTLPart(BtlPart As BTLPartVM)
m_SelBTLPart = BtlPart
If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then
' resetto gruppo di lavorazione corrente
EgtResetCurrMachGroup()
End If
If Not IsNothing(BtlPart) Then
' gestisco selezione pezzo
EgtBeamShowFacesName(False)
EgtBeamShowLoadingSide(False, False)
Map.refProjectVM.MacroFeature_IsEnabled = True
' se modalità building, la tolgo
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then
ShowBuilding(False, False)
Map.refShowBeamPanelVM.SetShowBuilding(False)
End If
SceneSelPartSelection()
' seleziono pezzo in Db geometrico
EgtBeamSetPart(BtlPart.nPartId)
EgtBeamShowFacesName(True)
Dim bLoadingSideShow As Boolean = (nPROJTYPE = BWType.BEAM)
Dim bLeftToRight As Boolean = Not (CurrentMachine.ViewDir = VT.ISO_NW OrElse CurrentMachine.ViewDir = VT.ISO_NE)
EgtBeamShowLoadingSide(bLoadingSideShow, bLeftToRight)
' trovo ed evidenzio MachGroup e Duplo di questo pezzo
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
Dim MachGroupList As New List(Of MyMachGroupVM)
For Each Machgroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
Dim bFound As Boolean = False
For Each Part As PartVM In Machgroup.PartVMList
If EgtDuploGetOriginal(Part.nPartId) = BtlPart.nPartId Then
Part.SetSearchFound()
bFound = True
Else
Part.ResetSearchFound()
End If
Next
If bFound Then
Machgroup.SetSearchFound()
Else
Machgroup.ResetSearchFound()
End If
Next
End If
End If
' 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
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
BtlPart.SetOpenFeatureList(True)
End If
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then
Map.refShowBeamPanelVM.SetShowBuilding(False)
End If
End Sub
Public Sub ReSelectBTLPart(BtlPart As BTLPartVM)
Public Sub SelectBTLPart(BtlPart As BTLPartVM, Optional bIsReselect As Boolean = False)
m_SelBTLPart = BtlPart
If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then
' resetto gruppo di lavorazione corrente
@@ -228,6 +163,8 @@ Public Class BTLStructureVM
Dim bLoadingSideShow As Boolean = (nPROJTYPE = BWType.BEAM)
Dim bLeftToRight As Boolean = Not (CurrentMachine.ViewDir = VT.ISO_NW OrElse CurrentMachine.ViewDir = VT.ISO_NE)
EgtBeamShowLoadingSide(bLoadingSideShow, bLeftToRight)
' imposto tipo di grid selezionata
Map.refProjectVM.SetLastSelGridType(ProjectVM.GridSelTypes.PART)
' trovo ed evidenzio MachGroup e Duplo di questo pezzo
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
Dim MachGroupList As New List(Of MyMachGroupVM)
@@ -256,6 +193,9 @@ Public Class BTLStructureVM
Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False)
EgtZoom(ZM.ALL)
NotifyPropertyChanged(NameOf(SelBTLPart))
If Not bIsReselect AndAlso m_SelBTLParts.Count = 1 Then
BtlPart.SetOpenFeatureList(True)
End If
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then
Map.refShowBeamPanelVM.SetShowBuilding(False)
End If
@@ -283,14 +223,10 @@ Public Class BTLStructureVM
End Sub
Private m_SelBTLPart As BTLPartVM = Nothing
Public Property SelBTLPart As BTLPartVM
Public ReadOnly Property SelBTLPart As BTLPartVM
Get
Return m_SelBTLPart
End Get
Set(value As BTLPartVM)
m_SelBTLPart = value
NotifyPropertyChanged(NameOf(SelBTLPart))
End Set
End Property
Friend Sub SetSelBTLPart(SelBTLPart As BTLPartVM, Optional bByOptim As Boolean = False, Optional bSingleHighlight As Boolean = False)
@@ -305,7 +241,6 @@ Public Class BTLStructureVM
Next
End If
End If
SetSelectionType(SelectionTypes.HIGHLIGHT)
If bByOptim Then
m_bOnlySelectItem = True
End If
@@ -40,7 +40,7 @@ Public Class FeatureListManagerVM
Public ReadOnly Property AddFeature_IsEnabled As Boolean
Get
Return PartIsSelected AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Not Map.refProjectVM.BTLStructureVM.SelBTLPartsCnt > 1
Return PartIsSelected AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Not Map.refProjectVM.BTLStructureVM.SelBTLParts.Count > 1
End Get
End Property
@@ -3,6 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
DataContext="{StaticResource FeatureListManagerVM}"
HorizontalAlignment="Left"
Orientation="Vertical"
Style="{StaticResource OnlyProdFeatureListManager_StackPanel}">
<Button Command="{Binding CopyFeature_Command}"
@@ -372,73 +372,94 @@
</DataGrid.Resources>
<DataGrid.RowDetailsTemplate>
<DataTemplate>
<ListBox ItemsSource="{Binding BTLFeatureVMList}"
SelectedItem="{Binding SelBTLFeatureVMOnlyGraph, UpdateSourceTrigger=PropertyChanged}"
PreviewMouseWheel="ListBox_PreviewMouseWheel"
Width="860" Margin="20,0,0,0"
Style="{StaticResource BTL_ListBox}">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50"/>
<ColumnDefinition Width="40"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding nPRID}"
Style="{StaticResource OnlyProd_TextBlock}"/>
<Grid Grid.Column="1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!--<EgtBEAMWALL:OnlyProdFeatureListManagerV Grid.Row="1" Grid.ColumnSpan="2"/>-->
<StackPanel Orientation="Vertical">
<Button Height="30" Width="30"/>
<Button Height="30" Width="30"/>
<Button Height="30" Width="30"/>
</StackPanel>
<ListBox Grid.Column="1"
ItemsSource="{Binding BTLFeatureVMList}"
SelectedItem="{Binding SelBTLFeatureVM, UpdateSourceTrigger=PropertyChanged}"
PreviewMouseWheel="ListBox_PreviewMouseWheel"
Width="860" Margin="20,0,0,0"
Grid.IsSharedSizeScope="True"
Style="{StaticResource BTL_ListBox}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Vertical" MaxHeight="150"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Margin="0,0,50,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="50"/>
<ColumnDefinition Width="40"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto" SharedSizeGroup="Feature_Grp"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto" SharedSizeGroup="Feature_Prc"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto" SharedSizeGroup="Feature_Name"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Border Width="{Binding ActualHeight, RelativeSource={RelativeSource self}}"
Background="{Binding Calc_Background}"/>
<TextBlock Text="{Binding nPRID}"
Style="{StaticResource OnlyProd_TextBlock}"/>
<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Ellipse Visibility="{Binding CALC_ROT_Visibility}"
Style="{StaticResource OnlyProdFeatureInPartInRawPartList_Ellipse}"/>
<TextBlock Grid.Row="1"
Text="{Binding CALC_ERR_Letter}"
Style="{StaticResource OnlyProdFeatureInPartInRawPartList_TextBlock}"/>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="10"/>
</Grid.ColumnDefinitions>
<Border Width="{Binding ActualHeight, RelativeSource={RelativeSource self}}"
Background="{Binding Calc_Background}"/>
<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Ellipse Visibility="{Binding CALC_ROT_Visibility}"
Style="{StaticResource OnlyProdFeatureInPartInRawPartList_Ellipse}"/>
<TextBlock Grid.Row="1"
Text="{Binding CALC_ERR_Letter}"
Style="{StaticResource OnlyProdFeatureInPartInRawPartList_TextBlock}"/>
</Grid>
</Grid>
<CheckBox Grid.Column="2"
IsChecked="{Binding bDO, UpdateSourceTrigger=PropertyChanged}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Margin="0,0,5,0"/>
<TextBlock Grid.Column="3"
Text="["
Style="{StaticResource OnlyProd_TextBlock}"/>
<TextBlock Grid.Column="4"
Text="{Binding nSelGRP}"
Style="{StaticResource OnlyProd_TextBlock}"/>
<TextBlock Grid.Column="5"
Text="-"
Style="{StaticResource OnlyProd_TextBlock}"/>
<TextBlock Grid.Column="6"
Text="{Binding nPRC, StringFormat={}{0:000}}"
Style="{StaticResource OnlyProd_TextBlock}"/>
<TextBlock Grid.Column="7"
Text="] "
Style="{StaticResource OnlyProd_TextBlock}"/>
<TextBlock Grid.Column="8"
Text="{Binding sName}" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource OnlyProd_TextBlock}"/>
<Button Grid.Column="9" Height="15" Width="15" Margin="20,0,0,0"/>
</Grid>
<CheckBox Grid.Column="2"
IsChecked="{Binding bDO, UpdateSourceTrigger=PropertyChanged}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Margin="0,0,5,0"/>
<TextBlock Grid.Column="3"
Text="["
Style="{StaticResource OnlyProd_TextBlock}"/>
<TextBlock Grid.Column="4"
Text="{Binding nSelGRP}"
Style="{StaticResource OnlyProd_TextBlock}"/>
<TextBlock Grid.Column="5"
Text="-"
Style="{StaticResource OnlyProd_TextBlock}"/>
<TextBlock Grid.Column="6"
Text="{Binding nPRC, StringFormat={}{0:000}}"
Style="{StaticResource OnlyProd_TextBlock}"/>
<TextBlock Grid.Column="7"
Text="] "
Style="{StaticResource OnlyProd_TextBlock}"/>
<TextBlock Grid.Column="8"
Text="{Binding sName}" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource OnlyProd_TextBlock}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</DataTemplate>
</DataGrid.RowDetailsTemplate>
@@ -5,28 +5,24 @@ Public Class OnlyProdBTLPartListV
Private m_BTLPartListVM As BTLPartListVM
Private m_SelectBtn As MouseButton = MouseButton.Left
Private m_HighlightBtn As MouseButton = MouseButton.Right
Private m_NameDataGridType As Type
Private s_isDraggingSelectionField As FieldInfo
Private s_endDraggingMethod As MethodInfo
Private m_DataGridType As Type = GetType(DataGrid)
Private m_isDraggingSelectionField As FieldInfo
Private m_endDraggingMethod As MethodInfo
Sub New()
' This call is required by the designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
m_BTLPartListVM = DataContext
m_NameDataGridType = BTLPart_DataGrid.GetType()
' Evita il drag sulla selezione multipla
s_isDraggingSelectionField = m_NameDataGridType.GetField("_isDraggingSelection", BindingFlags.Instance Or BindingFlags.NonPublic)
s_endDraggingMethod = m_NameDataGridType.GetMethod("EndDragging", BindingFlags.Instance Or BindingFlags.NonPublic)
m_isDraggingSelectionField = m_DataGridType.GetField("_isDraggingSelection", BindingFlags.Instance Or BindingFlags.NonPublic)
m_endDraggingMethod = m_DataGridType.GetMethod("EndDragging", BindingFlags.Instance Or BindingFlags.NonPublic)
End Sub
Public Sub DataGrid_PreviewMouseMove(sender As Object, e As MouseEventArgs)
' Evita il drag sulla selezione multipla
If m_SelectBtn = MouseButton.Left AndAlso e.LeftButton = MouseButtonState.Pressed Then
If CBool(If(s_isDraggingSelectionField?.GetValue(BTLPart_DataGrid), False)) Then s_endDraggingMethod.Invoke(BTLPart_DataGrid, New Object(-1) {})
If e.LeftButton = MouseButtonState.Pressed Then
If CBool(If(m_isDraggingSelectionField?.GetValue(BTLPart_DataGrid), False)) Then m_endDraggingMethod.Invoke(BTLPart_DataGrid, New Object(-1) {})
End If
End Sub
@@ -43,7 +39,7 @@ Public Class OnlyProdBTLPartListV
BTLPartVM.SetOpenFeatureList(Not BTLPartVM.bOpenFeatureList)
End If
If Not IsNothing(Row) AndAlso Row.IsSelected AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) AndAlso Map.refProjectVM.BTLStructureVM.SelBTLPart.Equals(BTLPartVM) Then
Map.refProjectVM.BTLStructureVM.ReSelectBTLPart(BTLPartVM)
Map.refProjectVM.BTLStructureVM.SelectBTLPart(BTLPartVM, True)
End If
End If
End If
@@ -33,6 +33,8 @@ Public Class MyMachGroupPanelVM
OnPreSetCurrMachGroup()
EgtSetCurrMachGroup(value.Id)
OnPostSetCurrMachGroup()
' imposto tipo di grid selezionata
Map.refProjectVM.SetLastSelGridType(ProjectVM.GridSelTypes.MACHGROUP)
Map.refStatisticsTimePanelVM.SetMachiningPage_Visibility(Visibility.Visible)
Map.refStatisticsTimePanelVM.SetViewPage_Visibility(Visibility.Collapsed)
End If
@@ -194,6 +194,7 @@ Public Class ProjectVM
PART = 2
MACHGROUP = 3
End Enum
Private m_LastSelGridType As GridSelTypes
Public ReadOnly Property LastSelGridType As GridSelTypes
Get
@@ -1104,8 +1104,8 @@ Public Class MySceneHostVM
If e.Button = Forms.MouseButtons.Left Then
' imposto tipo ultima Grid selezionata
Map.refProjectVM.SetLastSelGridType(ProjectVM.GridSelTypes.PARTLIST)
' imposto highlight
Map.refProjectVM.BTLStructureVM.SetSelectionType(BTLStructureVM.SelectionTypes.HIGHLIGHT)
'' imposto highlight
'Map.refProjectVM.BTLStructureVM.SetSelectionType(BTLStructureVM.SelectionTypes.HIGHLIGHT)
' gestisco evidenziazione pezzo
If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift OrElse (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control Then
If IsNothing(CurrPart) Then Return
@@ -1133,8 +1133,8 @@ Public Class MySceneHostVM
ElseIf e.Button = Forms.MouseButtons.Right Then
' imposto tipo ultima Grid selezionata
Map.refProjectVM.SetLastSelGridType(ProjectVM.GridSelTypes.PART)
' imposto selezione
Map.refProjectVM.BTLStructureVM.SetSelectionType(BTLStructureVM.SelectionTypes.SELECT_)
'' imposto selezione
'Map.refProjectVM.BTLStructureVM.SetSelectionType(BTLStructureVM.SelectionTypes.SELECT_)
' seleziono il pezzo
If Map.refProjectVM.BTLStructureVM.SelBTLParts.Count > 0 Then
Map.refProjectVM.BTLStructureVM.SelBTLParts.Clear()
@@ -183,8 +183,8 @@ Public Class ShowBeamPanelVM
Map.refShowBeamPanelVM.SetShowSolid(False)
Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, False, False)
End If
' nascondo barra del pezzo
Map.refProjectVM.BTLStructureVM.SetSelectionType(BTLStructureVM.SelectionTypes.NULL)
'' nascondo barra del pezzo
'Map.refProjectVM.BTLStructureVM.SetSelectionType(BTLStructureVM.SelectionTypes.NULL)
' mostro tutti i pezzi
Map.refProjectVM.BTLStructureVM.ShowAll(False)
' deseleziono tutto
@@ -52,14 +52,22 @@
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type Optimizer:StrategyFeature}"
ItemsSource="{Binding TopologyList}">
<StackPanel Style="{StaticResource OnlyProdPartManager_StackPanel}">
<TextBlock Text="[" Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBlock Text="{Binding nGrp}" Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBlock Text="-" Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBlock Text="{Binding nPrcDesc}" Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBlock Text="]" Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBlock Text="{Binding sName}" Style="{StaticResource DialogWindow_TextBlock}" Margin="5,0,0,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="[" Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBlock Text="{Binding nGrp}" Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBlock Text="-" Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBlock Text="{Binding nPrcDesc}" Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBlock Text="]" Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBlock Text="{Binding sName}" Style="{StaticResource DialogWindow_TextBlock}" Margin="5,0,0,0"/>
</StackPanel>
</Border>
</ControlTemplate>
</CheckBox.Template>
</CheckBox>
</HierarchicalDataTemplate>
<DataTemplate DataType="{x:Type Optimizer:Topology}">
<TextBlock Text="{Binding sName}" Style="{StaticResource DialogWindow_TextBlock}"/>
@@ -68,7 +76,7 @@
<TreeView.ItemContainerStyle>
<Style TargetType="{x:Type TreeViewItem}">
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"/>
<EventSetter Event="PreviewMouseDown" Handler="TreeViewItem_PreviewMouseDown"/>
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}"/>
<Setter Property="Focusable" Value="{Binding RelativeSource={RelativeSource Self}, Converter={StaticResource StrategyTypeToFocusableConverter}}"/>
</Style>
</TreeView.ItemContainerStyle>
@@ -26,29 +26,6 @@
Topology.AvailableStrategyList_View.Refresh()
Next
End If
' Controlla se il clic è avvenuto sulla HEADER o sul TOGGLEBUTTON
Dim clickedElement As DependencyObject = e.OriginalSource
While Not IsNothing(clickedElement) AndAlso TypeOf clickedElement IsNot TreeViewItem
If TypeOf clickedElement Is Primitives.ToggleButton Then
' Se il ToggleButton è stato cliccato, espandi o chiudi
treeViewItem.IsExpanded = Not treeViewItem.IsExpanded
' Se il nodo è chiuso, togli la selezione
If Not treeViewItem.IsExpanded Then
treeViewItem.IsSelected = False
End If
e.Handled = True
Return
End If
clickedElement = VisualTreeHelper.GetParent(clickedElement)
End While
' Se il clic è sul nodo principale, espandi/chiudi
If clickedElement Is treeViewItem AndAlso Not treeViewItem.IsSelected Then
treeViewItem.IsExpanded = Not treeViewItem.IsExpanded
' Se il nodo è chiuso, togli la selezione
If Not treeViewItem.IsExpanded Then
treeViewItem.IsSelected = False
End If
End If
End Sub
End Class
@@ -578,6 +578,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"