-aggiunto pulsante per la modifica della feature

This commit is contained in:
Demetrio Cassarino
2025-04-15 15:51:28 +02:00
parent 2332eccef9
commit 0d38b47f24
9 changed files with 214 additions and 54 deletions
@@ -332,11 +332,22 @@ Public Class BTLFeatureVM
End Set
End Property
#Region "Messages"
Public ReadOnly Property Edit_ToolTip As String
Get
Return EgtMsg(61939)
End Get
End Property
#End Region ' Messages
' Definizione comandi
Private m_cmdEdit As ICommand
Private m_cmdSave As ICommand
Private m_cmdCancel As ICommand
Private m_cmdDeleteFeature As ICommand
Private m_cmdEditFeature As ICommand
#Region "CONSTRUCTOR"
@@ -599,6 +610,23 @@ Public Class BTLFeatureVM
#End Region ' Cancel
#Region "Edit"
Public ReadOnly Property EditFeature_Command As ICommand
Get
If m_cmdEditFeature Is Nothing Then
m_cmdEditFeature = New Command(AddressOf EditFeature)
End If
Return m_cmdEditFeature
End Get
End Property
Public Sub EditFeature()
Map.refProjectVM.SetSelManagerTab(ProjectVM.ManagerTab.FEATUREMANAGER)
End Sub
#End Region ' Edit
#End Region ' COMMANDS
#Region "EVENTS"
@@ -1509,12 +1509,6 @@ Public Class BTLPartVM
End Set
End Property
Public ReadOnly Property sROT As String
Get
Return m_BTLPartM.nROTATED & " °"
End Get
End Property
' lista delle feature del pezzo
Private m_BTLFeatureVMList_ViewSource As CollectionViewSource = Nothing
Private m_BTLFeatureVMList_View As ListCollectionView = Nothing
@@ -79,6 +79,7 @@ Public Class BTLStructureVM
End If
End If
m_PrevSelectionType = m_SelectionType
Map.refProjectVM.SetSelManagerTab(ProjectVM.ManagerTab.RAWPARTMANAGER)
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)
@@ -203,10 +204,6 @@ Public Class BTLStructureVM
Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False)
EgtZoom(ZM.ALL)
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
' deseleziono eventuale MachGroup selezionato
If Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
Map.refMachGroupPanelVM.SelectedMachGroup = Nothing
End If
If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then
' resetto gruppo di lavorazione corrente
EgtResetCurrMachGroup()
@@ -258,7 +258,7 @@
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sROT}"
<TextBlock Text="{Binding sROTATED}"
TextAlignment="Center"
Margin="2,0,2,0"/>
@@ -369,6 +369,7 @@
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<CheckBox IsChecked="{Binding bDO, UpdateSourceTrigger=PropertyChanged}"
VerticalAlignment="Center"
@@ -400,8 +401,16 @@
</Grid>
<TextBlock Grid.Column="3"
Text="{Binding sName}"
Margin="2.5,0,0,0"
Margin="2.5,0,10,0"
Style="{StaticResource OnlyProd_TextBlock}"/>
<Button Grid.Column="4"
ToolTip="{Binding Edit_ToolTip}"
Command="{Binding EditFeature_Command}"
Width="15" Height="15" Margin="0"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/CALCPanel/Edit.png" Stretch="Uniform"/>
</Button>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
@@ -499,7 +499,60 @@
<TextBlock Text="{Binding Path=DataContext.STOREY_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>
<!--MUP - MoveUp-->
<DataGridTemplateColumn x:Key="colMOVEUP">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="Move Up"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Command="{Binding MoveUpPart_Command}"
ToolTip="{Binding MoveUpPart_ToolTip}"
Width="15" Height="15" Margin="0"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/TopPanel/MoveUpPart.png" Stretch="Uniform"/>
</Button>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--MDW - MoveDown-->
<DataGridTemplateColumn x:Key="colMOVEDOWN">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="Move Down"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Command="{Binding MoveDownPart_Command}"
ToolTip="{Binding MoveDownPart_ToolTip}"
Width="15" Height="15" Margin="0"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/TopPanel/MoveDownPart.png" Stretch="Uniform"/>
</Button>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--RM - Remove-->
<DataGridTemplateColumn x:Key="colREMOVE">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="Remove"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Command="{Binding RemovePart_Command}"
ToolTip="{Binding RemovePart_ToolTip}"
Width="15" Height="15" Margin="0"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/TopPanel/RemovePart.png" Stretch="Uniform"/>
</Button>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Resources>
<DataGrid.InputBindings>
<KeyBinding Key="Delete" Command="{Binding Tag.SelPart.DeletePart_Command,
@@ -1398,15 +1398,15 @@ Public Class MyMachGroupVM
If IsNothing(SelMachGroup) Then Return
' se barra gia' assegnata a supervisore, esco
If SelMachGroup.nProduction_State >= ItemState.Assigned Then Return
Dim SelPart As PartVM = SelMachGroup.SelPart
If IsNothing(SelPart) Then Return
'Dim SelPart As PartVM = SelMachGroup.SelPart
'If IsNothing(SelPart) Then Return
If SelMachGroup.nType = MachineType.BEAM Then
SelMachGroup.ReorderBeam()
EgtDraw()
' riseleziono trave
If Not IsNothing(SelPart) Then
SelMachGroup.SelPart = SelPart
End If
'' riseleziono trave
'If Not IsNothing(SelPart) Then
' SelMachGroup.SelPart = SelPart
'End If
End If
SelMachGroup.ResetCalcMachGroup()
End Sub
+14 -2
View File
@@ -280,9 +280,21 @@ Public Class PartVM
End Set
End Property
Public ReadOnly Property sPOSY_Visibility As Visibility
Public ReadOnly Property MoveUpPart_ToolTip As String
Get
Return If(Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM, Visibility.Collapsed, Visibility.Visible)
Return EgtMsg(61917)
End Get
End Property
Public ReadOnly Property MoveDownPart_ToolTip As String
Get
Return EgtMsg(61918)
End Get
End Property
Public ReadOnly Property RemovePart_ToolTip As String
Get
Return EgtMsg(61919)
End Get
End Property
@@ -30,7 +30,7 @@
<EgtBEAMWALL:OnlyProdCalcPanelV Grid.Column="1"
DataContext="{StaticResource CALCPanelVM}"/>
<EgtBEAMWALL:OnlyProdSpecialPanelV Grid.Column="2"
DataContext="{StaticResource SpecialPanelVM}"
Visibility="{Binding DataContext.SpecialPanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
@@ -65,25 +65,74 @@
Grid.RowSpan="4"
Style="{StaticResource Width_GridSplitter}"/>
<Grid Grid.Row="1"
Grid.Column="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<WrapPanel Width="{Binding ActualWidth, ElementName=TOPTRAY}"
Style="{StaticResource OnlyProdProject_WrapPanel}">
<EgtBEAMWALL:OnlyProdOptimizePanelV DataContext="{StaticResource OptimizePanelVM}"
Visibility="{Binding DataContext.OnlyProdOptimizePanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
<TabControl Grid.Row="1"
Grid.Column="2"
BorderThickness="0"
Margin="0"
SelectedIndex="{Binding SelManagerTab}">
<TabControl.ItemContainerStyle>
<Style TargetType="{x:Type TabItem}">
<Setter Property="Visibility" Value="Collapsed"/>
</Style>
</TabControl.ItemContainerStyle>
<TabItem Header="RAWPARTMANAGER">
<TabItem.Content>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<WrapPanel Width="{Binding ActualWidth, ElementName=TOPTRAY}"
Style="{StaticResource OnlyProdProject_WrapPanel}">
<EgtBEAMWALL:OnlyProdFreeContourManagerV DataContext="{StaticResource FreeContourManagerVM}"
Visibility="{Binding DataContext.FreeContourManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
</WrapPanel>
<EgtBEAMWALL:RawPartManagerWndV Grid.Column="1" Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
</Grid>
<EgtBEAMWALL:OnlyProdOptimizePanelV DataContext="{StaticResource OptimizePanelVM}"
Visibility="{Binding DataContext.OnlyProdOptimizePanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
<EgtBEAMWALL:OnlyProdFreeContourManagerV DataContext="{StaticResource FreeContourManagerVM}"
Visibility="{Binding DataContext.FreeContourManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
</WrapPanel>
<EgtBEAMWALL:RawPartManagerWndV Grid.Column="1" Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
</Grid>
</TabItem.Content>
</TabItem>
<TabItem Header="FEATUREMANAGER">
<TabItem.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<EgtBEAMWALL:OnlyProdFeatureManagerV DataContext="{StaticResource FeatureManagerVM}"
Tag="{Binding DataContext.BTLStructureVM.SelBTLPart.SelBTLFeatureVM, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
<TabControl Grid.Row="1"
Style="{StaticResource OnlyProd_TabControl}">
<TabItem Header="Parametri Geometrici">
<TabItem.Content>
<Border Style="{StaticResource OnlyProdPage_Border}">
<EgtBEAMWALL:OnlyProdPParameterListV DataContext="{StaticResource PParameterListVM}"
Tag="{Binding DataContext.BTLStructureVM.SelBTLPart.SelBTLFeatureVM, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"
Margin="5"/>
</Border>
</TabItem.Content>
</TabItem>
<TabItem Header="Parametri di Lavorazione">
<TabItem.Content>
<Border Style="{StaticResource OnlyProdPage_Border}">
<EgtBEAMWALL:OnlyProdQParameterListV DataContext="{StaticResource QParameterListVM}"
Tag="{Binding DataContext.BTLStructureVM.SelBTLPart.SelBTLFeatureVM, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"
Margin="5"/>
</Border>
</TabItem.Content>
</TabItem>
</TabControl>
</Grid>
</TabItem.Content>
</TabItem>
</TabControl>
<GridSplitter Grid.Row="2"
Grid.ColumnSpan="3"
+32 -14
View File
@@ -289,6 +289,26 @@ Public Class ProjectVM
End Set
End Property
Friend Enum ManagerTab As Integer
NULL = -1
RAWPARTMANAGER = 0
FEATUREMANAGER = 1
End Enum
Private m_SelManagerTab As ManagerTab
Public Property SelManagerTab As Integer
Get
Return m_SelManagerTab
End Get
Set(value As Integer)
m_SelManagerTab = value
End Set
End Property
Friend Sub SetSelManagerTab(bSelManagerTab As ManagerTab)
m_SelManagerTab = bSelManagerTab
NotifyPropertyChanged(NameOf(SelManagerTab))
End Sub
#Region "Messages"
Public ReadOnly Property Statistics_Msg As String
@@ -334,12 +354,10 @@ Public Class ProjectVM
If Not IsNothing(Map.refPartManagerVM) Then Map.refPartManagerVM.SetPartManagerIsEnabled(bIsEnabled)
Map.refLeftPanelVM.SetLeftPanelIsEnabled(bIsEnabled)
Map.refBTLPartManagerVM.SetBTLPartManagerIsEnabled(bIsEnabled)
Map.refFeatureListManagerVM.SetLeftPanelIsEnabled(bIsEnabled)
If Not IsNothing(Map.refProjManagerVM) Then Map.refProjManagerVM.SetProjManagerIsEnabled(bIsEnabled)
If Not IsNothing(Map.refProdManagerVM) Then Map.refProdManagerVM.SetProdManagerIsEnabled(bIsEnabled)
If Not IsNothing(Map.refTopPanelVM) Then Map.refTopPanelVM.SetTopPanelIsEnabled(bIsEnabled)
Map.refRawPartManagerVM.SetRawPartManagerIsEnabled(bIsEnabled)
Map.refPartInRawPartManagerVM.SetPartInRawPartManagerIsEnabled(bIsEnabled)
Map.refOptimizePanelVM.SetOptimizePanelIsEnabled(bIsEnabled)
Map.refFeatureManagerVM.SetFeatureManagerIsEnabled(bIsEnabled)
End Sub
@@ -353,7 +371,7 @@ Public Class ProjectVM
If Not IsNothing(Map.refPartListVM.colPart_Do) Then
Map.refPartListVM.colPart_Do.IsReadOnly = True
End If
If Not IsNothing(Map.refFeatureListVM.colFeature_Do) Then
If Not IsNothing(Map.refFeatureListVM) AndAlso Not IsNothing(Map.refFeatureListVM.colFeature_Do) Then
Map.refFeatureListVM.colFeature_Do.IsReadOnly = True
End If
If Not IsNothing(Map.refPParameterListVM.colPParam_Value) Then
@@ -377,19 +395,19 @@ Public Class ProjectVM
If Not IsNothing(Map.refRawPartListVM.colRawPart_PosZ) Then
Map.refRawPartListVM.colRawPart_PosZ.IsReadOnly = True
End If
If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_Offset) Then
If Not IsNothing(Map.refPartInRawPartListVM) AndAlso Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_Offset) Then
Map.refPartInRawPartListVM.colPartInRawPart_Offset.IsReadOnly = True
End If
If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_Rot) Then
If Not IsNothing(Map.refPartInRawPartListVM) AndAlso Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_Rot) Then
Map.refPartInRawPartListVM.colPartInRawPart_Rot.IsReadOnly = True
End If
If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_Flip) Then
If Not IsNothing(Map.refPartInRawPartListVM) AndAlso Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_Flip) Then
Map.refPartInRawPartListVM.colPartInRawPart_Flip.IsReadOnly = True
End If
If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_PosX) Then
If Not IsNothing(Map.refPartInRawPartListVM) AndAlso Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_PosX) Then
Map.refPartInRawPartListVM.colPartInRawPart_PosX.IsReadOnly = True
End If
If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_PosY) Then
If Not IsNothing(Map.refPartInRawPartListVM) AndAlso Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_PosY) Then
Map.refPartInRawPartListVM.colPartInRawPart_PosY.IsReadOnly = True
End If
If Not IsNothing(Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Do) Then
@@ -403,7 +421,7 @@ Public Class ProjectVM
If Not IsNothing(Map.refPartListVM.colPart_Do) Then
Map.refPartListVM.colPart_Do.ResetToOrigIsReadOnly()
End If
If Not IsNothing(Map.refFeatureListVM.colFeature_Do) Then
If Not IsNothing(Map.refFeatureListVM) AndAlso Not IsNothing(Map.refFeatureListVM.colFeature_Do) Then
Map.refFeatureListVM.colFeature_Do.ResetToOrigIsReadOnly()
End If
If Not IsNothing(Map.refPParameterListVM.colPParam_Value) Then
@@ -427,19 +445,19 @@ Public Class ProjectVM
If Not IsNothing(Map.refRawPartListVM.colRawPart_PosZ) Then
Map.refRawPartListVM.colRawPart_PosZ.ResetToOrigIsReadOnly()
End If
If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_Offset) Then
If Not IsNothing(Map.refPartInRawPartListVM) AndAlso Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_Offset) Then
Map.refPartInRawPartListVM.colPartInRawPart_Offset.ResetToOrigIsReadOnly()
End If
If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_Rot) Then
If Not IsNothing(Map.refPartInRawPartListVM) AndAlso Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_Rot) Then
Map.refPartInRawPartListVM.colPartInRawPart_Rot.ResetToOrigIsReadOnly()
End If
If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_Flip) Then
If Not IsNothing(Map.refPartInRawPartListVM) AndAlso Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_Flip) Then
Map.refPartInRawPartListVM.colPartInRawPart_Flip.ResetToOrigIsReadOnly()
End If
If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_PosX) Then
If Not IsNothing(Map.refPartInRawPartListVM) AndAlso Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_PosX) Then
Map.refPartInRawPartListVM.colPartInRawPart_PosX.ResetToOrigIsReadOnly()
End If
If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_PosY) Then
If Not IsNothing(Map.refPartInRawPartListVM) AndAlso Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_PosY) Then
Map.refPartInRawPartListVM.colPartInRawPart_PosY.ResetToOrigIsReadOnly()
End If
If Not IsNothing(Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Do) Then