-gestito visualizzazione lista utensili

This commit is contained in:
Demetrio Cassarino
2025-09-23 09:59:17 +02:00
parent 888aa76c36
commit 207778d595
12 changed files with 253 additions and 88 deletions
@@ -123,7 +123,7 @@ Public Class BTLStructureVM
Private Sub SelBTLParts_CollectionChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
' Setto contesto finestra principale
if Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx())
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx())
If m_bOnlySelectItem Then Return
Select Case e.Action
Case NotifyCollectionChangedAction.Add
@@ -139,6 +139,12 @@ Public Class BTLStructureVM
DeselectBTLPart(m_SelBTLPart)
End If
End Select
' gestione pulsanti ruota, inverti tutti e modifica multipla
If m_SelBTLParts.Count > 1 Then
Map.refLeftPanelVM.SetRotateAll_IsEnabled(True)
Else
Map.refLeftPanelVM.SetRotateAll_IsEnabled(False)
End If
' aggiornamento grafica
If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.PartShowAllChanged()
If Not IsNothing(Map.refBTLPartManagerVM) Then Map.refBTLPartManagerVM.PartShowAllChanged()
@@ -1105,6 +1105,12 @@
<ItemGroup>
<Resource Include="Resources\NewPage\Inversion.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\deselectall.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\selectall.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\EgtBEAMWALL.OptimizerR32.exe
@@ -28,13 +28,13 @@ Public Class FeatureListManagerVM
Public ReadOnly Property CopyFeature_IsEnabled As Boolean
Get
Return PartIsSelected AndAlso FeatureIsSelected
Return Map.refBTLPartManagerVM.BTLPartManager_IsEnabled AndAlso PartIsSelected AndAlso FeatureIsSelected
End Get
End Property
Public ReadOnly Property MacroFeature_IsEnabled As Boolean
Get
Return PartIsSelected AndAlso FeatureIsSelected
Return Map.refBTLPartManagerVM.BTLPartManager_IsEnabled AndAlso PartIsSelected AndAlso FeatureIsSelected
End Get
End Property
@@ -46,11 +46,10 @@ Public Class FeatureListManagerVM
Public ReadOnly Property RemoveFeature_IsEnabled As Boolean
Get
Return PartIsSelected AndAlso FeatureIsSelected
Return Map.refBTLPartManagerVM.BTLPartManager_IsEnabled AndAlso PartIsSelected AndAlso FeatureIsSelected
End Get
End Property
Private m_cmdCopyFeature As ICommand
Private m_cmdAddFeature As ICommand
Private m_cmdRemoveFeature As ICommand
@@ -390,8 +390,8 @@
<ItemsPanelTemplate>
<WrapPanel Orientation="Vertical"
MaxHeight="{Binding ActualHeight, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALLCORE:EgtDataGrid}},
Converter={StaticResource FractionHeightConverter},
ConverterParameter={StaticResource FeatureWrapPanelHeight}}"
Converter={StaticResource FractionHeightConverter},
ConverterParameter={StaticResource FeatureWrapPanelHeight}}"
MinHeight="{Binding Parent.Children[0].ActualHeight, RelativeSource={RelativeSource AncestorType={x:Type Grid}}}"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
+45 -28
View File
@@ -57,11 +57,22 @@ Public Class LeftPanelVM
NotifyPropertyChanged(NameOf(IsFilterBtnOpen))
End Sub
Private m_RotateAll_IsEnabled As Boolean = False
Public ReadOnly Property RotateAll_IsEnabled As Boolean
Get
Return m_RotateAll_IsEnabled
End Get
End Property
Friend Sub SetRotateAll_IsEnabled(value As Boolean)
m_RotateAll_IsEnabled = value
NotifyPropertyChanged(NameOf(RotateAll_IsEnabled))
End Sub
' Definizione comandi
Private m_cmdVerifyAll As ICommand
Private m_cmdShowPopUpFilterBtnCmd As ICommand
Private m_cmdBackRotation As ICommand
Private m_cmdInvert As ICommand
Private m_cmdRotateAll As ICommand
Private m_cmdInvertAll As ICommand
Private m_cmdResetCalc As ICommand
#Region "Messages"
@@ -131,6 +142,24 @@ Public Class LeftPanelVM
End Get
End Property
Public ReadOnly Property RotateAll_ToolTip As String
Get
Return EgtMsg(63029)
End Get
End Property
Public ReadOnly Property InvertAll_ToolTip As String
Get
Return EgtMsg(63030)
End Get
End Property
Public ReadOnly Property MultipleModify_ToolTip As String
Get
Return EgtMsg(63031)
End Get
End Property
#End Region ' Messages
#End Region 'FIELDS & PROPERTIES
@@ -224,24 +253,18 @@ Public Class LeftPanelVM
#End Region ' ShowPopUpFilterBtnCommand
#Region "BackRotation"
#Region "RotateAll"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property BackRotation_Command As ICommand
Public ReadOnly Property RotateAll_Command As ICommand
Get
If m_cmdBackRotation Is Nothing Then
m_cmdBackRotation = New Command(AddressOf BackRotation)
If m_cmdRotateAll Is Nothing Then
m_cmdRotateAll = New Command(AddressOf RotateAll)
End If
Return m_cmdBackRotation
Return m_cmdRotateAll
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub BackRotation()
Public Sub RotateAll()
If IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return
' salvo sezione impostata
Dim CurrSection As SectionXMaterial = Map.refProjectVM.BTLStructureVM.SelSection
@@ -266,26 +289,20 @@ Public Class LeftPanelVM
EgtDraw()
End Sub
#End Region ' BackRotation
#End Region ' RotateAll
#Region "Invert"
#Region "InvertAll"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property Invert_Command As ICommand
Public ReadOnly Property InvertAll_Command As ICommand
Get
If m_cmdInvert Is Nothing Then
m_cmdInvert = New Command(AddressOf Invert)
If m_cmdInvertAll Is Nothing Then
m_cmdInvertAll = New Command(AddressOf InvertAll)
End If
Return m_cmdInvert
Return m_cmdInvertAll
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub Invert()
Public Sub InvertAll()
If IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return
' se modalita' assemblato
Dim bShowBuilding As Boolean = Map.refShowBeamPanelVM.ShowBuilding_IsChecked
@@ -301,7 +318,7 @@ Public Class LeftPanelVM
If bShowBuilding Then Map.refProjectVM.BTLStructureVM.ShowBuilding(True, False)
End Sub
#End Region ' Invert
#End Region ' InvertAll
#Region "ResetCalc"
@@ -116,26 +116,23 @@
Margin="0,6,4,0"
Style="{StaticResource SearchText_TextBox}"/>
<Button Grid.Column="5"
Command="{Binding BackRotation_Command}"
Visibility="{Binding ViewPage_Visibility}"
ToolTip="Ruota Tutti"
IsEnabled="{Binding RotatePart_IsEnabled}"
Command="{Binding RotateAll_Command}"
ToolTip="{Binding RotateAll_ToolTip}"
IsEnabled="{Binding RotateAll_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/NewPage/Rotate.png" Stretch="Uniform"/>
</Button>
<Button Grid.Column="6"
Command="{Binding Invert_Command}"
Visibility="{Binding ViewPage_Visibility}"
ToolTip="Inverti Tutti"
IsEnabled="{Binding RotatePart_IsEnabled}"
Command="{Binding InvertAll_Command}"
ToolTip="{Binding InvertAll_ToolTip}"
IsEnabled="{Binding RotateAll_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/NewPage/Inversion.png" Stretch="Uniform"/>
</Button>
<Button Grid.Column="7"
ToolTip="Modifica Multipla"
Command="{Binding Edit_Command}"
IsEnabled="{Binding Edit_IsEnabled}"
Visibility="{Binding Edit_Visibility}"
ToolTip="{Binding MultipleModify_ToolTip}"
IsEnabled="{Binding RotateAll_IsEnabled}"
HorizontalAlignment="Right"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/CALCPanel/Edit.png" Stretch="Uniform"/>
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

+9 -17
View File
@@ -26,19 +26,11 @@ Module PDFHelper
Public Function CreateStatReport(ActivePage As Pages, bPreview As Boolean) As Document
' creo nuovo documento MigraDoc
Dim document As New Document()
Dim Project As ProjectFileVM
If ActivePage = Pages.VIEW OrElse ActivePage = Pages.ONLYPRODPAGE Then
Project = ProjectManagerVM.CurrProj
document.Info.Title = Project.sProjId & " - " & Project.BTLFileName_Msg & " - Statistics"
ElseIf ActivePage = Pages.MACHINING OrElse ActivePage = Pages.ONLYPRODPAGE Then
If ActivePage = Pages.CONFIG Then
Project = ProjectManagerVM.CurrProj
document.Info.Title = Project.sProjId & " - " & Project.BTLFileName_Msg & " - Statistics"
ElseIf ActivePage = Pages.ONLYPRODPAGE Then
Project = ProjectManagerVM.CurrProd
document.Info.Title = Project.sProdId & " - " & Project.ListName_Msg & " - Statistics"
End If
If ActivePage = Pages.VIEW Then
document.Info.Title = ProjectManagerVM.CurrProd.sProdId & " - " & ProjectManagerVM.CurrProd.BTLFileName_Msg & " - Statistics"
ElseIf ActivePage = Pages.MACHINING Then
document.Info.Title = ProjectManagerVM.CurrProd.sProdId & " - " & ProjectManagerVM.CurrProd.ListName_Msg & " - Statistics"
End If
document.Info.Subject = "Production statistics of the project"
@@ -50,10 +42,10 @@ Module PDFHelper
Dim sImageLogo As String = Map.refMainWindowVM.MainWindowM.sTempDir & "/Image" & "Logo landscape" & ".png"
DefineLogo(section, sImageLogo)
If ActivePage = Pages.VIEW OrElse ActivePage = Pages.ONLYPRODPAGE Then
If ActivePage = Pages.VIEW Then
DefinePartTotals(document, section, bPreview)
DefineItemList(document, ListTypes.PART, bPreview)
ElseIf ActivePage = Pages.MACHINING OrElse ActivePage = Pages.ONLYPRODPAGE Then
ElseIf ActivePage = Pages.MACHINING Then
DefineMachGroupTotals(document, section, bPreview)
DefineItemList(document, ListTypes.MACHGROUP, bPreview)
DefineItemList(document, ListTypes.RAWPART, bPreview)
@@ -329,7 +321,7 @@ Module PDFHelper
ElseIf PartIndex = -1 Then
row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.NAM_Msg)
ElseIf bPreview Then
row.Cells(ColumnIndex).AddParagraph(If(nListType = ListTypes.PART, "Arc.in salita smussato", 1))
row.Cells(ColumnIndex).AddParagraph(If(nListType = ListTypes.PART, EgtMsg(63032), 1))
Else
row.Cells(ColumnIndex).AddParagraph(If(nListType = ListTypes.PART, BTLPartVM.sNAM, MachGroupVM.nName))
End If
@@ -343,7 +335,7 @@ Module PDFHelper
ElseIf PartIndex = -1 Then
row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.NAM_Msg)
ElseIf bPreview Then
row.Cells(ColumnIndex).AddParagraph(If(nListType = ListTypes.PART, "Arc.in salita smussato", 1))
row.Cells(ColumnIndex).AddParagraph(If(nListType = ListTypes.PART, EgtMsg(63032), 1))
Else
row.Cells(ColumnIndex).AddParagraph(If(nListType = ListTypes.PART, BTLPartVM.sNAM, MachGroupVM.nName))
End If
@@ -630,7 +622,7 @@ Module PDFHelper
ElseIf PartIndex = -1 Then
row.Cells(ColumnIndex).AddParagraph(Statistic_Messages.NAM_Msg)
Else
row.Cells(ColumnIndex).AddParagraph(If(IsNothing(RawPart), "Correntini", PartVM.sNAM))
row.Cells(ColumnIndex).AddParagraph(If(IsNothing(RawPart), EgtMsg(63033), PartVM.sNAM))
End If
ElseIf PartIndex = -2 Then
table.AddColumn(Unit.FromCentimeter(0))
@@ -62,30 +62,61 @@
HorizontalAlignment="Left"
VerticalAlignment="Top"
Style="{StaticResource DialogWindow_TextBlock}"/>
<Button Content="Deselect All"
VerticalAlignment="Top"
Width="100"
<Button VerticalAlignment="Top"
Width="50"
ToolTip="{Binding SelectAllToolTip}"
Command="{Binding SelectAllCommand}"
Style="{StaticResource MachineToolBar_ParameterMachineButton}">
<Image Source="/Resources/NewPage/selectall.png" Stretch="Uniform"/>
</Button>
<Button VerticalAlignment="Top"
Width="50"
ToolTip="{Binding DeselectAllToolTip}"
Command="{Binding DeselectAllCommand}"
Style="{StaticResource MachineToolBar_ParameterMachineButton}"/>
Style="{StaticResource MachineToolBar_ParameterMachineButton}">
<Image Source="/Resources/NewPage/deselectall.png" Stretch="Uniform"/>
</Button>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,0,5,0">
<ItemsControl ItemsSource="{Binding ActiveToolList_View}"
Visibility="{Binding ActiveToolList_Visibility}"
Margin="10,0,0,0"
BorderThickness="1"
BorderBrush="Black"
Height="Auto"
Width="180"
Foreground="Black">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Style="{StaticResource StackPanel_List}">
<CheckBox IsChecked="{Binding bIsActive, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource FreeContourInput_CheckBox}"/>
<TextBlock Text="{Binding sName}"
Style="{StaticResource DialogWindow_TextBlock}"/>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<ItemsControl ItemsSource="{Binding AvailableToolList_View}"
Visibility="{Binding AvailableToolList_Visibility}"
Margin="10,5,0,0"
BorderThickness="1"
BorderBrush="Black"
Height="Auto"
Width="180"
Foreground="Black">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Style="{StaticResource StackPanel_List}">
<CheckBox IsChecked="{Binding bIsActive, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource FreeContourInput_CheckBox}"/>
<TextBlock Text="{Binding sName}"
Style="{StaticResource DialogWindow_TextBlock}"/>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
<ListBox ItemsSource="{Binding ListValue}"
SelectedItem="{Binding SelValue}"
Margin="10,0,0,0"
BorderThickness="0.5"
Height="300"
Foreground="Black"
Style="{StaticResource MacroDefault_ListBox}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Style="{StaticResource StackPanel_List}">
<CheckBox IsChecked="{Binding bIsActive, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource FreeContourInput_CheckBox}"/>
<TextBlock Text="{Binding sName}"
Style="{StaticResource DialogWindow_TextBlock}"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</UniformGrid>
</DataTemplate>
</ItemsControl.Resources>
@@ -1,7 +1,8 @@
<Grid x:Class="StrategyManagerV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Optimizer="clr-namespace:EgtBEAMWALL.Optimizer">
xmlns:Optimizer="clr-namespace:EgtBEAMWALL.Optimizer"
Height="830">
<Grid.Resources>
<Optimizer:StrategyTypeToFocusableConverter x:Key="StrategyTypeToFocusableConverter"/>
</Grid.Resources>
@@ -958,6 +958,7 @@ Public Class Strategy
DirectCast(DefaultParameter, StringStrategyParameter).SetValue(Parameter.sValue)
Case GetType(ListStrategyParameter)
DirectCast(DefaultParameter, ListStrategyParameter).SetSelValue(Parameter.sValue)
DirectCast(DefaultParameter, ListStrategyParameter).CreateToolsViews()
End Select
End If
Next
@@ -1349,8 +1350,61 @@ Public Class ListStrategyParameter
Next
End Sub
Private m_AvailableToolList_View As ICollectionView = Nothing
Public ReadOnly Property AvailableToolList_View As ICollectionView
Get
Return m_AvailableToolList_View
End Get
End Property
Private m_AvailableToolList_Visibility As Visibility = If(Not IsNothing(m_AvailableToolList_View) AndAlso m_AvailableToolList_View.IsEmpty, Visibility.Collapsed, Visibility.Visible)
Public ReadOnly Property AvailableToolList_Visibility As Visibility
Get
Return m_AvailableToolList_Visibility
End Get
End Property
Friend Sub SetAvailableToolList_Visibility(value As Visibility)
m_AvailableToolList_Visibility = value
NotifyPropertyChanged(NameOf(AvailableToolList_Visibility))
End Sub
Private m_ActiveToolList_View As ICollectionView = Nothing
Public ReadOnly Property ActiveToolList_View As ICollectionView
Get
Return m_ActiveToolList_View
End Get
End Property
Private m_ActiveToolList_Visibility As Visibility = If(Not IsNothing(m_ActiveToolList_View) AndAlso m_ActiveToolList_View.IsEmpty, Visibility.Collapsed, Visibility.Visible)
Public ReadOnly Property ActiveToolList_Visibility As Visibility
Get
Return m_ActiveToolList_Visibility
End Get
End Property
Friend Sub SetActiveToolList_Visibility(value As Visibility)
m_ActiveToolList_Visibility = value
NotifyPropertyChanged(NameOf(ActiveToolList_Visibility))
End Sub
' Definizione comandi
Private m_cmdDeselectAll As ICommand
Private m_cmdSelectAll As ICommand
#Region "Messages"
Public ReadOnly Property SelectAllToolTip As String
Get
Return EgtMsg(63034)
End Get
End Property
Public ReadOnly Property DeselectAllToolTip As String
Get
Return EgtMsg(63035)
End Get
End Property
#End Region ' Messages
#End Region ' Fields & Properties
@@ -1369,7 +1423,7 @@ Public Class ListStrategyParameter
While bNext
EgtTdbSetCurrTool(sName)
EgtTdbGetCurrToolParam(MCH_TP.UUID, sUUID)
m_ListValue.Add(New ToolParameter(sUUID, sName))
m_ListValue.Add(New ToolParameter(sUUID, sName, Me))
bNext = EgtTdbGetNextTool(nSubType, sName, nType)
End While
End Sub
@@ -1391,10 +1445,63 @@ Public Class ListStrategyParameter
Return JsonStrategyParameter
End Function
Friend Function AvailableToolFilter(Strategy As Object) As Boolean
Return DirectCast(Strategy, ToolParameter).bIsActive = False
End Function
Friend Function ActiveToolFilter(Strategy As Object) As Boolean
Return DirectCast(Strategy, ToolParameter).bIsActive = True
End Function
Friend Sub CreateToolsViews()
m_AvailableToolList_View = New ListCollectionView(m_ListValue)
m_AvailableToolList_View.Filter = AddressOf AvailableToolFilter
m_ActiveToolList_View = New ListCollectionView(m_ListValue)
m_ActiveToolList_View.Filter = AddressOf ActiveToolFilter
End Sub
''' <summary>
''' Funzione per visualizzare le liste available e active tool
''' </summary>
Friend Sub ToolView()
If m_ActiveToolList_View.IsEmpty Then
SetActiveToolList_Visibility(Visibility.Collapsed)
Else
SetActiveToolList_Visibility(Visibility.Visible)
End If
If m_AvailableToolList_View.IsEmpty Then
SetAvailableToolList_Visibility(Visibility.Collapsed)
Else
SetAvailableToolList_Visibility(Visibility.Visible)
End If
End Sub
#End Region ' Methods
#Region "COMMANDS"
#Region "SelectAllCommand"
Public ReadOnly Property SelectAllCommand As ICommand
Get
If m_cmdSelectAll Is Nothing Then
m_cmdSelectAll = New Command(AddressOf SelectAll)
End If
Return m_cmdSelectAll
End Get
End Property
Friend Sub SelectAll()
If Not IsNothing(sSubType) Then
For Each ItemTool As ToolParameter In m_ListValue
ItemTool.bIsActive = True
Next
End If
ToolView()
End Sub
#End Region ' SelectAllCommand
#Region "DeselectAllCommand"
Public ReadOnly Property DeselectAllCommand As ICommand
@@ -1412,6 +1519,7 @@ Public Class ListStrategyParameter
ItemTool.bIsActive = False
Next
End If
ToolView()
End Sub
#End Region ' DeselectAllCommand
@@ -1496,6 +1604,8 @@ Public Class ToolParameter
#Region "FIELD & PROPERTIES"
Private m_ParentList As StrategyParameter
Private m_bIsActive As Boolean
Public Property bIsActive As Boolean
Get
@@ -1503,6 +1613,11 @@ Public Class ToolParameter
End Get
Set(value As Boolean)
m_bIsActive = value
If Not IsNothing(DirectCast(m_ParentList, ListStrategyParameter).AvailableToolList_View) AndAlso Not IsNothing(DirectCast(m_ParentList, ListStrategyParameter).ActiveToolList_View) Then
DirectCast(m_ParentList, ListStrategyParameter).AvailableToolList_View.Refresh()
DirectCast(m_ParentList, ListStrategyParameter).ActiveToolList_View.Refresh()
DirectCast(m_ParentList, ListStrategyParameter).ToolView()
End If
NotifyPropertyChanged(NameOf(bIsActive))
End Set
End Property
@@ -1533,9 +1648,10 @@ Public Class ToolParameter
#Region "CONSTRUCTOR"
Sub New(sUUID As String, sName As String)
Sub New(sUUID As String, sName As String, ParentList As StrategyParameter)
m_sUUID = sUUID
m_sName = sName
m_ParentList = ParentList
End Sub
#End Region ' Constructor