- aggiunta selezione BtlPart quando selezionato pezzo in grezzo

- correzione verifica modifiche progetto su ImportBTL
This commit is contained in:
Emmanuele Sassi
2023-11-14 17:32:44 +01:00
parent df46f3b5a5
commit 97957e0365
7 changed files with 87 additions and 3 deletions
@@ -1555,6 +1555,27 @@ Public Class BTLPartVM
End Get
End Property
Private m_bSearchFound As Boolean
Public ReadOnly Property bSearchFound As Boolean
Get
Return m_bSearchFound
End Get
End Property
Friend Sub SetSearchFound()
m_bSearchFound = True
NotifyPropertyChanged(NameOf(Search_Background))
End Sub
Friend Sub ResetSearchFound()
m_bSearchFound = False
NotifyPropertyChanged(NameOf(Search_Background))
End Sub
Public ReadOnly Property Search_Background As SolidColorBrush
Get
Return If(m_bSearchFound, Brushes.Purple, Brushes.Transparent)
End Get
End Property
' Definizione comandi
Private m_cmdInvert As ICommand
Private m_cmdBackRotation As ICommand
@@ -325,6 +325,22 @@ Public Class BTLStructureVM
End If
' disabilito eventuale feature selezionata
If Not IsNothing(BtlPart.m_SelBTLFeatureVM) Then BtlPart.SelBTLFeatureVM = Nothing
' deevidenzio 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.ResetSearchFound()
bFound = True
End If
Next
If bFound Then
Machgroup.ResetSearchFound()
End If
Next
End If
EgtDraw()
End Sub
Private Sub HighlightBTLPart(BtlPart As BTLPartVM)
@@ -34,6 +34,17 @@
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.PDN_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"/>
</DataGridTextColumn.Header>
<DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}">
<Setter Property="BorderBrush" Value="{Binding Search_Background}"/>
<Setter Property="BorderThickness" Value="2,2,0,2"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Foreground" Value="Blue" />
</Trigger>
</Style.Triggers>
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<!--Validità pezzo-->
<DataGridTemplateColumn x:Key="colCALC" CanUserResize="False"
@@ -29,7 +29,7 @@
<DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}">
<Setter Property="BorderBrush" Value="{Binding Search_Background}"/>
<Setter Property="BorderThickness" Value="2"/>
<Setter Property="BorderThickness" Value="2,2,0,2"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Foreground" Value="Blue" />
@@ -15,6 +15,19 @@ Public Class MyMachGroupPanelVM
Return m_SelectedMachGroup
End Get
Set(value As MyMachGroupVM)
' deevidenzio BTLPart di questo pezzo
If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Not IsNothing(SelectedMachGroup) AndAlso Not IsNothing(SelectedMachGroup.SelPart) Then
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
For BTLPartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1
Dim nDuploOriginalId As Integer = 0
If EgtGetInfo(SelectedMachGroup.SelPart.nPartId, GDB_SI_DUPSOU, nDuploOriginalId) AndAlso nDuploOriginalId > 0 AndAlso nDuploOriginalId = Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).nPartId Then
Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).ResetSearchFound()
Exit For
End If
Next
End If
End If
If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART Then
EgtBeamShowFacesName(False)
EgtBeamShowLoadingSide(False, False)
@@ -22,6 +22,18 @@ Public Class MyMachGroupVM
Return m_SelPart
End Get
Set(value As Core.PartVM)
If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Not IsNothing(m_SelPart) Then
' deevidenzio BTLPart di questo pezzo
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
For BTLPartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1
Dim nDuploOriginalId As Integer = 0
If EgtGetInfo(m_SelPart.nPartId, GDB_SI_DUPSOU, nDuploOriginalId) AndAlso nDuploOriginalId > 0 AndAlso nDuploOriginalId = Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).nPartId Then
Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).ResetSearchFound()
Exit For
End If
Next
End If
End If
m_SelPart = value
' seleziono pezzo
EgtDeselectAll()
@@ -36,6 +48,18 @@ Public Class MyMachGroupVM
If Map.refMainMenuVM.SelPage = Pages.MACHINING Then
DirectCast(m_SelPart, PartVM).SelectBTLPart()
End If
' trovo ed evidenzio BTLPart di questo pezzo
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
Dim MachGroupList As New List(Of MyMachGroupVM)
For BTLPartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1
Dim nDuploOriginalId As Integer = 0
If EgtGetInfo(m_SelPart.nPartId, GDB_SI_DUPSOU, nDuploOriginalId) AndAlso nDuploOriginalId > 0 AndAlso nDuploOriginalId = Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).nPartId Then
Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).SetSearchFound()
Exit For
End If
Next
End If
End If
EgtDraw()
NotifyPropertyChanged(NameOf(SelPart))
@@ -731,8 +731,7 @@ Public Class OnlyProdManagerVM
''' Execute the ImportBTL. This method is invoked by the ImportBTLCommand.
''' </summary>
Public Sub ImportBTL(Optional sFile As String = "", Optional bWithDlg As Boolean = True)
'If Not ProjFileVM.VerifyProjectModification(CurrProj, ProjectType.PROJ) Then Return
If Not ProdFileVM.VerifyProjectModification(CurrProd) Then Return
If ProdFileVM.VerifyProjectModification(CurrProd) = MessageBoxResult.Cancel Then Return
Dim sDir As String = String.Empty
GetMainPrivateProfileString(S_GENERAL, K_LASTIMPDIR, "", sDir)
If bWithDlg Then