Aggiunta View per onlyprod
This commit is contained in:
@@ -46,6 +46,12 @@ Public Module ConstGen
|
||||
ANY_DB = 32
|
||||
End Enum
|
||||
|
||||
' Selezione Tab Prod / Proj
|
||||
Public Enum ProdProj As Integer
|
||||
PROJ = 0
|
||||
PROD = 1
|
||||
End Enum
|
||||
|
||||
' File di log generale
|
||||
Public Const VWOPTGENLOG_FILE_NAME As String = "EgtBEAMWALL.ViewerOptimizerLog#.txt"
|
||||
Public Const SUPGENLOG_FILE_NAME As String = "EgtBEAMWALL.SupervisorLog#.txt"
|
||||
|
||||
@@ -209,7 +209,9 @@ Public Class BTLFeatureVM
|
||||
m_SelPBTLParam = value
|
||||
If Not IsNothing(m_SelPBTLParam) Then
|
||||
' imposto path disegno da mostrare in BottomPanel
|
||||
If Not IsNothing(Map.refBottomPanelVM) Then Map.refBottomPanelVM.SetCurrDraw(m_SelPBTLParam.sDrawPath)
|
||||
If Not IsNothing(Map.refBottomPanelVM) Then
|
||||
Map.refBottomPanelVM.SetCurrDraw(m_SelPBTLParam.sDrawPath)
|
||||
End If
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(SelPBTLParam))
|
||||
End Set
|
||||
|
||||
@@ -93,12 +93,17 @@ Public Class BTLPartVM
|
||||
Dim LSTValues() As String = sSwapItem.Split(","c)
|
||||
If Not IsNothing(LSTValues(LSTValues.Count - 1)) AndAlso Integer.TryParse(LSTValues(LSTValues.Count - 1), nSwapItem) AndAlso nSwapItem > 0 Then
|
||||
Dim nMachgroupId As Integer = EgtGetParent(EgtGetParent(EgtGetParent(nSwapItem)))
|
||||
Dim MachGroupModel = DbControllers.m_MachGroupController.FindByMachGroupId(Map.refProjManagerVM.CurrProj.nProdId, nMachgroupId)
|
||||
If MachGroupModel.State > ItemState.ND Then
|
||||
bDuploInProduction = True
|
||||
Exit For
|
||||
Dim MachGroupModel = Nothing
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjManagerVM) Then
|
||||
MachGroupModel = DbControllers.m_MachGroupController.FindByMachGroupId(Map.refProjManagerVM.CurrProj.nProdId, nMachgroupId)
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Not IsNothing(Map.refOnlyProdManagerVM) Then
|
||||
MachGroupModel = DbControllers.m_MachGroupController.FindByMachGroupId(Map.refOnlyProdManagerVM.CurrProd.nProdId, nMachgroupId)
|
||||
End If
|
||||
If MachGroupModel.State > ItemState.ND Then
|
||||
bDuploInProduction = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
If bDuploInProduction Then
|
||||
MessageBox.Show("Impossible change dimension because already in production!", "", MessageBoxButton.OK, MessageBoxImage.Exclamation)
|
||||
@@ -1517,7 +1522,9 @@ Public Class BTLPartVM
|
||||
End Get
|
||||
Set(value As BTLFeatureVM)
|
||||
m_SelBTLFeatureVM = value
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
||||
If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
|
||||
Map.refProjectVM.CopyFeature_IsEnabled = True
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
||||
If Not IsNothing(m_SelBTLFeatureVM) Then
|
||||
DirectCast(m_SelBTLFeatureVM, BTLFeatureVM).SelGeomFeature()
|
||||
' imposto path disegno da mostrare in BottomPanel
|
||||
@@ -1764,7 +1771,11 @@ Public Class BTLPartVM
|
||||
Dim nNewPartId As Integer = EgtBeamCreatePart()
|
||||
If nNewPartId = GDB_ID.NULL Then Return Nothing
|
||||
' scrivo info proj
|
||||
EgtSetInfo(nNewPartId, BTL_PRT_PROJ, Map.refProjManagerVM.CurrProj.nProjId)
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjManagerVM) Then
|
||||
EgtSetInfo(nNewPartId, BTL_PRT_PROJ, Map.refProjManagerVM.CurrProj.nProjId)
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refOnlyProdManagerVM) Then
|
||||
EgtSetInfo(nNewPartId, BTL_PRT_PROJ, Map.refOnlyProdManagerVM.CurrProd.nProdId)
|
||||
End If
|
||||
EgtBeamSetPartProdNbr(m_BTLStructureM.NewPDN())
|
||||
EgtBeamSetPartName(m_BTLPartM.sNAM)
|
||||
EgtBeamSetPartCount(m_BTLPartM.nCNT)
|
||||
|
||||
@@ -71,6 +71,7 @@ Public Class BTLStructureVM
|
||||
m_SelectionType = value
|
||||
Select Case m_SelectionType
|
||||
Case SelectionTypes.SELECT_
|
||||
Map.refProjectVM.SelProdProj = ProdProj.PROJ
|
||||
' verifico reset mark su tutti i pezzi
|
||||
For Each BTLPart In m_BTLPartVMList
|
||||
EgtResetMark(BTLPart.nPartId)
|
||||
@@ -78,9 +79,10 @@ Public Class BTLStructureVM
|
||||
' mostro barra di gestione pezzo
|
||||
Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProjectVM.PartManager_Visibility))
|
||||
Case SelectionTypes.HIGHLIGHT
|
||||
Map.refProjectVM.SelProdProj = ProdProj.PROD
|
||||
If m_PrevSelectionType = SelectionTypes.SELECT_ Then
|
||||
EgtBeamShowFacesName( False)
|
||||
EgtBeamShowLoadingSide( False, False)
|
||||
EgtBeamShowFacesName(False)
|
||||
EgtBeamShowLoadingSide(False, False)
|
||||
End If
|
||||
If Not IsNothing(m_SelBTLPart) Then
|
||||
m_SelBTLPart = Nothing
|
||||
@@ -103,6 +105,7 @@ Public Class BTLStructureVM
|
||||
Private m_SelBTLParts As New PartsObservableCollection(Of BTLPartVM)
|
||||
Public ReadOnly Property SelBTLParts As PartsObservableCollection(Of BTLPartVM)
|
||||
Get
|
||||
'If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then Map.refProjectVM.MacroFeature_IsEnabled = True
|
||||
Return m_SelBTLParts
|
||||
End Get
|
||||
End Property
|
||||
@@ -185,7 +188,8 @@ Public Class BTLStructureVM
|
||||
EgtBeamShowFacesName(False)
|
||||
EgtBeamShowLoadingSide(False, False)
|
||||
m_SelBTLPart = BtlPart
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
|
||||
Map.refProjectVM.MacroFeature_IsEnabled = True
|
||||
' se modalità building, la tolgo
|
||||
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then
|
||||
ShowBuilding(False, False)
|
||||
@@ -199,18 +203,20 @@ Public Class BTLStructureVM
|
||||
Dim bLeftToRight As Boolean = Not (CurrentMachine.ViewDir = VT.ISO_NW OrElse CurrentMachine.ViewDir = VT.ISO_NE)
|
||||
EgtBeamShowLoadingSide(bLoadingSideShow, bLeftToRight)
|
||||
' seleziono pagina BottomPanel
|
||||
Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.PART)
|
||||
If Not IsNothing(Map.refBottomPanelVM) Then
|
||||
Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.PART)
|
||||
End If
|
||||
'' mostro barra di gestione pezzo
|
||||
'Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProjectVM.PartManager_Visibility))
|
||||
' deseleziono le feature
|
||||
If Not IsNothing(BtlPart.SelBTLFeatureVM) Then SelBTLPart.SelBTLFeatureVM = Nothing
|
||||
' 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)
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
|
||||
' resetto gruppo di lavorazione corrente
|
||||
EgtResetCurrMachGroup()
|
||||
' 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)
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
|
||||
' resetto gruppo di lavorazione corrente
|
||||
EgtResetCurrMachGroup()
|
||||
' trovo ed evidenzio MachGroup e Duplo di questo pezzo
|
||||
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
|
||||
Dim MachGroupList As New List(Of MyMachGroupVM)
|
||||
@@ -618,7 +624,7 @@ Public Class BTLStructureVM
|
||||
Case Pages.MACHINING
|
||||
Return Map.refProdManagerVM.nProdType
|
||||
Case Pages.ONLYPRODPAGE
|
||||
Return Map.refProdManagerVM.nProdType
|
||||
Return Map.refOnlyProdManagerVM.nProdType
|
||||
Case Else
|
||||
Return BWType.NULL
|
||||
End Select
|
||||
|
||||
@@ -580,8 +580,9 @@ Public Class CALCPanelVM
|
||||
sMachineName = If(Not IsNothing(Map.refProdManagerVM.CurrProd), Map.refProdManagerVM.CurrProd.sMachine, "")
|
||||
End If
|
||||
If nMachType = nProjType OrElse
|
||||
(nMachType = 3 And Map.refMainMenuVM.SelPage = Pages.VIEW And Not IsNothing(Map.refProjManagerVM.CurrProj)) OrElse
|
||||
(nMachType = 3 And Map.refMainMenuVM.SelPage = Pages.MACHINING And Not IsNothing(Map.refProdManagerVM.CurrProd)) Then
|
||||
(nMachType = 3 And Map.refMainMenuVM.SelPage = Pages.VIEW And Not IsNothing(Map.refProjManagerVM) AndAlso Not IsNothing(Map.refProjManagerVM.CurrProj)) OrElse
|
||||
(nMachType = 3 And Map.refMainMenuVM.SelPage = Pages.MACHINING And Not IsNothing(Map.refProdManagerVM) AndAlso Not IsNothing(Map.refProdManagerVM.CurrProd)) OrElse
|
||||
(nMachType = 3 And Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE And Not IsNothing(Map.refOnlyProdManagerVM) AndAlso Not IsNothing(Map.refOnlyProdManagerVM.CurrProd)) Then
|
||||
MachineList.Add(Machine)
|
||||
' Se il nome Macchina coincide setto la macchina selezionata con la macchina associata al progetto
|
||||
If Machine.Name = sMachineName Then
|
||||
|
||||
@@ -263,6 +263,15 @@
|
||||
<Compile Include="DataGridMultiselectManaging\IListItemConverter.vb" />
|
||||
<Compile Include="DataGridMultiselectManaging\MultiSelectorBehaviours.vb" />
|
||||
<Compile Include="DataGridMultiselectManaging\TwoListSynchronizer.vb" />
|
||||
<Compile Include="ItemParamList\OnlyProdFeatureListV.xaml.vb">
|
||||
<DependentUpon>OnlyProdFeatureListV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ItemParamList\OnlyProdPParameterListV.xaml.vb">
|
||||
<DependentUpon>OnlyProdPParameterListV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ItemParamList\OnlyProdQParameterListV.xaml.vb">
|
||||
<DependentUpon>OnlyProdQParameterListV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="LeftPanel\OnlyProdLeftPanelV.xaml.vb">
|
||||
<DependentUpon>OnlyProdLeftPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -338,6 +347,9 @@
|
||||
<Compile Include="OnlyProdProject\OnlyProdProjectV.xaml.vb">
|
||||
<DependentUpon>OnlyProdProjectV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="OptimizePanel\OnlyProdOptimizePanelV.xaml.vb">
|
||||
<DependentUpon>OnlyProdOptimizePanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ProjectTypeWnd\ProjectTypeWndV.xaml.vb">
|
||||
<DependentUpon>ProjectTypeWndV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -482,6 +494,18 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="ItemParamList\OnlyProdFeatureListV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="ItemParamList\OnlyProdPParameterListV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="ItemParamList\OnlyProdQParameterListV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="LeftPanel\OnlyProdLeftPanelV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -558,6 +582,10 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="OptimizePanel\OnlyProdOptimizePanelV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="ProjectTypeWnd\ProjectTypeWndV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
<UserControl x:Class="OnlyProdFeatureListV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"
|
||||
xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core">
|
||||
|
||||
<EgtBEAMWALLCORE:EgtDataGrid ItemsSource="{Binding Tag.BTLFeatureVMList,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureListV}}}"
|
||||
SelectedItem="{Binding Tag.SelBTLFeatureVM,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureListV}}}"
|
||||
CanUserAddRows="False"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserResizeRows="False"
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="0,0,0,5"
|
||||
IsEnabled="{Binding FeatureList_IsEnabled}"
|
||||
BindingColumns="{Binding FeatureColumns}"
|
||||
Style="{StaticResource DataGrid_CustomHighLight}">
|
||||
<DataGrid.Resources>
|
||||
<!--DO - Abilitazione-->
|
||||
<DataGridCheckBoxColumn x:Key="colDO" Binding="{Binding bDO, UpdateSourceTrigger=PropertyChanged}"
|
||||
MinWidth="28">
|
||||
<DataGridCheckBoxColumn.Header>
|
||||
<CheckBox IsChecked="{Binding Path=Tag.bDOALL, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureListV}}}"/>
|
||||
</DataGridCheckBoxColumn.Header>
|
||||
</DataGridCheckBoxColumn>
|
||||
<!--Validità feature-->
|
||||
<DataGridTemplateColumn x:Key="colCALC">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="10"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border Width="{Binding ActualHeight, RelativeSource={RelativeSource self}}"
|
||||
Background="{Binding Calc_Background}"/>
|
||||
<!--Width="{Binding ActualHeigth, Source=Self}"/>-->
|
||||
<Grid Grid.Column="1"
|
||||
HorizontalAlignment="Center">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Ellipse Width="5"
|
||||
Height="5"
|
||||
Fill="Red"
|
||||
Visibility="{Binding CALC_ROT_Visibility}"
|
||||
HorizontalAlignment="Center"/>
|
||||
<TextBlock Grid.Row="1"
|
||||
Text="{Binding CALC_ERR_Letter}"
|
||||
Foreground="{Binding CALC_ERR_Foreground}"
|
||||
TextAlignment="Center"
|
||||
FontWeight="Bold"
|
||||
FontSize="12"
|
||||
Margin="0,-6,0,-2"/>
|
||||
<!--<Ellipse Width="5"
|
||||
Height="5"
|
||||
Fill="Red"
|
||||
Visibility="{Binding CALC_ROT_Visibility}"/>
|
||||
<TextBlock Text="{Binding CALC_ERR_Letter}"
|
||||
Foreground="{Binding CALC_ERR_Foreground}"
|
||||
FontWeight="Bold"
|
||||
FontSize="10"/>-->
|
||||
<!--<TextBlock Text="➔"
|
||||
Visibility="{Binding CALC_FALL_Visibility}"/>-->
|
||||
</Grid>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<!--Descrizione-->
|
||||
<DataGridTextColumn x:Key="colDESC" Binding="{Binding sDesc}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.Description_Msg, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="{x:Type DataGridCell}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type DataGridCell}">
|
||||
<TextBlock Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content.Text}"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
Margin="4,0,0,0">
|
||||
<TextBlock.ToolTip>
|
||||
<!--<ToolTip Visibility="{Binding RelativeSource={RelativeSource Self}, Path=PlacementTarget, Converter={StaticResource TrimToVisConverter}}">-->
|
||||
<ToolTip>
|
||||
<ToolTip.Content>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content.Text}"/>
|
||||
<Image Source="{Binding sDrawPath}"
|
||||
Stretch="Uniform"
|
||||
Margin="2.5"/>
|
||||
</StackPanel>
|
||||
</ToolTip.Content>
|
||||
</ToolTip>
|
||||
</TextBlock.ToolTip>
|
||||
</TextBlock>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter Property="Foreground" Value="Blue"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
<!-- Menu' tasto destro -->
|
||||
<ContextMenu x:Key="RowMenu" ItemsSource="{Binding MenuList}" >
|
||||
<ContextMenu.ItemContainerStyle>
|
||||
<Style TargetType="MenuItem">
|
||||
<Setter Property="Command" Value="{Binding MenuItem_Command}"/>
|
||||
<Setter Property="Header" Value="{Binding sMsg}"/>
|
||||
</Style>
|
||||
</ContextMenu.ItemContainerStyle>
|
||||
</ContextMenu>
|
||||
</DataGrid.Resources>
|
||||
<DataGrid.InputBindings>
|
||||
<KeyBinding Key="Delete" Command="{Binding Tag.SelBTLFeatureVM.DeleteFeature_Command,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureListV}}}" />
|
||||
</DataGrid.InputBindings>
|
||||
<DataGrid.RowStyle>
|
||||
<Style TargetType="DataGridRow" BasedOn="{StaticResource RowDataGrid_CustomHighLight}">
|
||||
<Setter Property="ContextMenu" Value="{StaticResource RowMenu}" />
|
||||
<EventSetter Event="PreviewMouseDown" Handler="FeatureList_PreviewMouseDown"/>
|
||||
</Style>
|
||||
</DataGrid.RowStyle>
|
||||
|
||||
</EgtBEAMWALLCORE:EgtDataGrid>
|
||||
|
||||
</UserControl>
|
||||
@@ -0,0 +1,12 @@
|
||||
Public Class OnlyProdFeatureListV
|
||||
|
||||
Private Sub FeatureList_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
|
||||
If TypeOf sender Is DataGridRow Then
|
||||
Dim Row As DataGridRow = DirectCast(sender, DataGridRow)
|
||||
If Not IsNothing(Row) AndAlso Row.IsSelected AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,138 @@
|
||||
<UserControl x:Class="OnlyProdPParameterListV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"
|
||||
xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core">
|
||||
|
||||
<EgtBEAMWALLCORE:EgtDataGrid AutoGenerateColumns="False"
|
||||
CanUserDeleteRows="False"
|
||||
CanUserResizeRows="False"
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="0,0,0,5"
|
||||
ItemsSource="{Binding Tag.PBTLParamVMList, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdPParameterListV}}}"
|
||||
SelectedItem="{Binding Tag.SelPBTLParam, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdPParameterListV}}}"
|
||||
IsEnabled="{Binding PParameterList_IsEnabled}"
|
||||
BindingColumns="{Binding PParameterListColumns}"
|
||||
Style="{StaticResource DataGrid_CustomHighLight}">
|
||||
<DataGrid.RowStyle>
|
||||
<Style TargetType="DataGridRow" BasedOn="{StaticResource RowDataGrid_CustomHighLight}">
|
||||
<EventSetter Event="PreviewMouseDown" Handler="PParameterList_PreviewMouseDown"/>
|
||||
</Style>
|
||||
</DataGrid.RowStyle>
|
||||
<DataGrid.Resources>
|
||||
<EgtBEAMWALL:TrimmedTextBlockVisibilityConverter x:Key="TrimToVisConverter" />
|
||||
<!--Custom-->
|
||||
<DataGridTemplateColumn x:Key="colCUSTOM">
|
||||
<DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.Custom_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox IsChecked="{Binding bCustom, UpdateSourceTrigger=PropertyChanged}"
|
||||
Visibility="{Binding Tag, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"
|
||||
HorizontalAlignment="Center"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<!--Nome-->
|
||||
<DataGridTextColumn x:Key="colNAME" Binding="{Binding sName}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=DataContext.NAM_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</DataGridTextColumn>
|
||||
<!--Descrizione-->
|
||||
<DataGridTextColumn x:Key="colDESC" Binding="{Binding sDescription}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=DataContext.Description_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="{x:Type DataGridCell}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type DataGridCell}">
|
||||
<TextBlock Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content.Text}"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
Margin="4,0,0,0">
|
||||
<TextBlock.ToolTip>
|
||||
<!--<ToolTip Visibility="{Binding RelativeSource={RelativeSource Self}, Path=PlacementTarget, Converter={StaticResource TrimToVisConverter}}">-->
|
||||
<ToolTip>
|
||||
<ToolTip.Content>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content.Text}"/>
|
||||
<Image Source="{Binding sDrawPath}"
|
||||
Stretch="Uniform"
|
||||
Margin="2.5"/>
|
||||
</StackPanel>
|
||||
</ToolTip.Content>
|
||||
</ToolTip>
|
||||
</TextBlock.ToolTip>
|
||||
</TextBlock>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter Property="Foreground" Value="Blue"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
<DataGridTextColumn.EditingElementStyle>
|
||||
<Style TargetType="{x:Type TextBox}">
|
||||
<Setter Property="Foreground" Value="Blue" />
|
||||
</Style>
|
||||
</DataGridTextColumn.EditingElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<!--Valore-->
|
||||
<DataGridTextColumn x:Key="colVALUE" Binding="{Binding sValue}" SortMemberPath="dValue">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=DataContext.Value_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.EditingElementStyle>
|
||||
<Style TargetType="{x:Type TextBox}">
|
||||
<Setter Property="Foreground" Value="Blue" />
|
||||
</Style>
|
||||
</DataGridTextColumn.EditingElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<!--Minimo-->
|
||||
<DataGridTextColumn x:Key="colMIN" Binding="{Binding sMin}" SortMemberPath="dMin">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=DataContext.Min_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</DataGridTextColumn>
|
||||
<!--Massimo-->
|
||||
<DataGridTextColumn x:Key="colMAX" Binding="{Binding sMax}" SortMemberPath="dMax">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=DataContext.Max_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</DataGridTextColumn>
|
||||
<!--Default-->
|
||||
<!--
|
||||
<DataGridTextColumn Binding="{Binding dDefault}"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="Name"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>-->
|
||||
</DataGrid.Resources>
|
||||
|
||||
<!--</DataGrid>-->
|
||||
|
||||
</EgtBEAMWALLCORE:EgtDataGrid>
|
||||
|
||||
</UserControl>
|
||||
@@ -0,0 +1,12 @@
|
||||
Public Class OnlyProdPParameterListV
|
||||
|
||||
Private Sub PParameterList_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
|
||||
If TypeOf sender Is DataGridRow Then
|
||||
Dim Row As DataGridRow = DirectCast(sender, DataGridRow)
|
||||
If Not IsNothing(Row) AndAlso Row.IsSelected AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM) Then
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM.SelPBTLParam = Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM.SelPBTLParam
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,134 @@
|
||||
<UserControl x:Class="OnlyProdQParameterListV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"
|
||||
xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core">
|
||||
|
||||
<EgtBEAMWALLCORE:EgtDataGrid AutoGenerateColumns="False"
|
||||
CanUserDeleteRows="False"
|
||||
CanUserResizeRows="False"
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="0,0,0,5"
|
||||
ItemsSource="{Binding Tag.QBTLParamVMList, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdQParameterListV}}}"
|
||||
SelectedItem="{Binding Tag.SelQBTLParam, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdQParameterListV}}}"
|
||||
BeginningEdit="QParameterList_BeginningEdit"
|
||||
IsEnabled="{Binding QParameterList_IsEnabled}"
|
||||
BindingColumns="{Binding QParameterListColumns}"
|
||||
Style="{StaticResource DataGrid_CustomHighLight}">
|
||||
|
||||
<DataGrid.RowStyle>
|
||||
<Style TargetType="DataGridRow" BasedOn="{StaticResource RowDataGrid_CustomHighLight}">
|
||||
<EventSetter Event="PreviewMouseDown" Handler="QParameterList_PreviewMouseDown"/>
|
||||
</Style>
|
||||
</DataGrid.RowStyle>
|
||||
<DataGrid.Resources>
|
||||
<EgtBEAMWALL:TrimmedTextBlockVisibilityConverter x:Key="TrimToVisConverter" />
|
||||
<!--Custom-->
|
||||
<DataGridTemplateColumn x:Key="colCUSTOM">
|
||||
<DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.Custom_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox IsChecked="{Binding bCustom, UpdateSourceTrigger=PropertyChanged}"
|
||||
Visibility="{Binding Tag, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"
|
||||
HorizontalAlignment="Center"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<!--Nome-->
|
||||
<DataGridTextColumn x:Key="colNAME" Binding="{Binding sName}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=DataContext.NAM_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</DataGridTextColumn>
|
||||
<!--Descrizione-->
|
||||
<DataGridTextColumn x:Key="colDESC" Binding="{Binding sDescription}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=DataContext.Description_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="{x:Type DataGridCell}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type DataGridCell}">
|
||||
<TextBlock Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content.Text}"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
Margin="4,0,0,0">
|
||||
<TextBlock.ToolTip>
|
||||
<!--<ToolTip Visibility="{Binding RelativeSource={RelativeSource Self}, Path=PlacementTarget, Converter={StaticResource TrimToVisConverter}}">-->
|
||||
<ToolTip>
|
||||
<ToolTip.Content>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content.Text}"/>
|
||||
<Image Source="{Binding sDrawPath}"
|
||||
Stretch="Uniform"
|
||||
Margin="2.5"/>
|
||||
</StackPanel>
|
||||
</ToolTip.Content>
|
||||
</ToolTip>
|
||||
</TextBlock.ToolTip>
|
||||
</TextBlock>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter Property="Foreground" Value="Blue"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
<!--Valore-->
|
||||
<DataGridTextColumn x:Key="colVALUE" Binding="{Binding sValue}" SortMemberPath="dValue">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=DataContext.Value_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.EditingElementStyle>
|
||||
<Style TargetType="{x:Type TextBox}">
|
||||
<Setter Property="Foreground" Value="Blue" />
|
||||
</Style>
|
||||
</DataGridTextColumn.EditingElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<!--Minimo-->
|
||||
<DataGridTextColumn x:Key="colMIN" Binding="{Binding sMin}" SortMemberPath="dMin">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=DataContext.Min_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</DataGridTextColumn>
|
||||
<!--Massimo-->
|
||||
<DataGridTextColumn x:Key="colMAX" Binding="{Binding sMax}" SortMemberPath="dMax">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=DataContext.Max_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</DataGridTextColumn>
|
||||
<!--Default-->
|
||||
<!--
|
||||
<DataGridTextColumn Binding="{Binding dDefault}"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="Name"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>-->
|
||||
</DataGrid.Resources>
|
||||
|
||||
<!--</DataGrid>-->
|
||||
|
||||
</EgtBEAMWALLCORE:EgtDataGrid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,27 @@
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtBEAMWALL.Core.ConstGen
|
||||
|
||||
Public Class OnlyProdQParameterListV
|
||||
|
||||
Private Sub QParameterList_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
|
||||
If TypeOf sender Is DataGridRow Then
|
||||
Dim Row As DataGridRow = DirectCast(sender, DataGridRow)
|
||||
If Not IsNothing(Row) AndAlso Row.IsSelected AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM) Then
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM.SelPBTLParam = Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM.SelPBTLParam
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' funzione che impedisce di editare le righe che sono gia' in produzione
|
||||
Private Sub QParameterList_BeginningEdit(sender As Object, e As DataGridBeginningEditEventArgs)
|
||||
If IsNothing(e.Row) Then Return
|
||||
If Map.refMainMenuVM.SelPage <> Pages.MACHINING Then Return
|
||||
Dim RowVM As BTLParamVM = DirectCast(e.Row.DataContext, BTLParamVM)
|
||||
' se in produzione impedisco modifica dei parametri
|
||||
If DirectCast(RowVM.BTLParamM.ParentFeature.ParentPart, PartM).nProductionState > ItemState.ND Then
|
||||
'For Each cell In Row.Item
|
||||
e.Cancel = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -127,14 +127,14 @@
|
||||
</Button>
|
||||
<Button Command="{Binding Invert_Command}"
|
||||
Visibility="{Binding ViewPage_Visibility}"
|
||||
ToolTip="{Binding Invert_ToolTip}"
|
||||
ToolTip="{Binding InvertSx_ToolTip}"
|
||||
IsEnabled="{Binding RotatePart_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Image Source="/Resources/PartManager/LeftInvert.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding Invert_Command}"
|
||||
Visibility="{Binding ViewPage_Visibility}"
|
||||
ToolTip="{Binding Invert_ToolTip}"
|
||||
ToolTip="{Binding InvertDx_ToolTip}"
|
||||
IsEnabled="{Binding RotatePart_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Image Source="/Resources/PartManager/RightInvert.png" Stretch="Uniform"/>
|
||||
|
||||
@@ -22,12 +22,12 @@ Public Class LeftPanelVM
|
||||
|
||||
Public ReadOnly Property ViewPage_Visibility As Visibility
|
||||
Get
|
||||
Return If(Map.refMainMenuVM.SelPage = Pages.VIEW Or Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, Visibility.Visible, Visibility.Collapsed)
|
||||
Return If(Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property MachiningPage_Visibility As Visibility
|
||||
Get
|
||||
Return If(Map.refMainMenuVM.SelPage = Pages.MACHINING Or Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, Visibility.Visible, Visibility.Collapsed)
|
||||
Return If(Map.refMainMenuVM.SelPage = Pages.MACHINING OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -210,6 +210,30 @@ Public Class LeftPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property BackRotation_ToolTip As String
|
||||
Get
|
||||
Return EgtMsg(61996)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ForwardRotation_ToolTip As String
|
||||
Get
|
||||
Return EgtMsg(61997)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property InvertSx_ToolTip As String
|
||||
Get
|
||||
Return EgtMsg(61998)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property InvertDx_ToolTip As String
|
||||
Get
|
||||
Return EgtMsg(61999)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#End Region 'FIELDS & PROPERTIES
|
||||
@@ -279,7 +303,12 @@ Public Class LeftPanelVM
|
||||
End Sub
|
||||
|
||||
Public Sub NewRawPart(bLast As Boolean)
|
||||
If IsNothing(Map.refProdManagerVM.CurrProd) Then Return
|
||||
'If IsNothing(Map.refProdManagerVM) OrElse IsNothing(Map.refProdManagerVM.CurrProd) Then Return
|
||||
If Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso IsNothing(Map.refProdManagerVM) Then
|
||||
Return
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(Map.refOnlyProdManagerVM) Then
|
||||
Return
|
||||
End If
|
||||
'Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart
|
||||
Dim SelParts As List(Of BTLPartVM) = Map.refProjectVM.BTLStructureVM.SelBTLParts.ToList()
|
||||
If IsNothing(SelParts) OrElse SelParts.Count <= 0 Then Return
|
||||
@@ -419,7 +448,11 @@ Public Class LeftPanelVM
|
||||
EgtGetMachGroupName(nCurrMachGroup, sCurrMachGroupName)
|
||||
Dim sLogPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\RawPartLog.txt"
|
||||
' scrivo dati per variabili P di comunicazione con la macchina in gruppo di lavorazione
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_PRODID, Map.refProdManagerVM.CurrProd.nProdId)
|
||||
If Map.refMainMenuVM.SelPage = Pages.MACHINING Then
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_PRODID, Map.refProdManagerVM.CurrProd.nProdId)
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_PRODID, Map.refOnlyProdManagerVM.CurrProd.nProdId)
|
||||
End If
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_PATTID, nCurrMachGroup)
|
||||
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then
|
||||
' ordino i pezzi per lunghezza
|
||||
@@ -696,7 +729,12 @@ Public Class LeftPanelVM
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub AddToRawPart()
|
||||
If IsNothing(Map.refProdManagerVM.CurrProd) Then Return
|
||||
'If IsNothing(Map.refProdManagerVM.CurrProd) Then Return
|
||||
If Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso IsNothing(Map.refProdManagerVM) Then
|
||||
Return
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(Map.refOnlyProdManagerVM) Then
|
||||
Return
|
||||
End If
|
||||
Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart
|
||||
Dim SelParts As List(Of BTLPartVM) = Map.refProjectVM.BTLStructureVM.SelBTLParts.ToList()
|
||||
For Index = 0 To SelParts.Count() - 1
|
||||
@@ -964,7 +1002,12 @@ Public Class LeftPanelVM
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub CopyPart()
|
||||
If IsNothing(Map.refProjManagerVM.CurrProj) Then Return
|
||||
'If IsNothing(Map.refProjManagerVM.CurrProj) Then Return
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso IsNothing(Map.refProjManagerVM) Then
|
||||
Return
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(Map.refOnlyProdManagerVM) Then
|
||||
Return
|
||||
End If
|
||||
Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart
|
||||
If IsNothing(SelPart) Then Return
|
||||
' creo copia
|
||||
@@ -995,7 +1038,12 @@ Public Class LeftPanelVM
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub AddPart(ByVal param As Object)
|
||||
If IsNothing(Map.refProjManagerVM.CurrProj) Then Return
|
||||
'If IsNothing(Map.refProjManagerVM.CurrProj) Then Return
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso IsNothing(Map.refProjManagerVM) Then
|
||||
Return
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(Map.refOnlyProdManagerVM) Then
|
||||
Return
|
||||
End If
|
||||
' apro finestra di definizione nuovo part
|
||||
Dim AddPartWndVM As New AddPartWndVM()
|
||||
Dim AddPartWnd As New AddPartWndV(Application.Current.MainWindow, AddPartWndVM)
|
||||
@@ -1003,7 +1051,12 @@ Public Class LeftPanelVM
|
||||
' creo nuovo part
|
||||
Dim nNewPartId As Integer = EgtBeamCreatePart()
|
||||
' scrivo info proj
|
||||
EgtSetInfo(nNewPartId, BTL_PRT_PROJ, Map.refProjManagerVM.CurrProj.nProjId)
|
||||
'EgtSetInfo(nNewPartId, BTL_PRT_PROJ, Map.refProjManagerVM.CurrProj.nProjId)
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso IsNothing(Map.refProjManagerVM) Then
|
||||
EgtSetInfo(nNewPartId, BTL_PRT_PROJ, Map.refProjManagerVM.CurrProj.nProjId)
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(Map.refOnlyProdManagerVM) Then
|
||||
EgtSetInfo(nNewPartId, BTL_PRT_PROJ, Map.refOnlyProdManagerVM.CurrProd.nProdId)
|
||||
End If
|
||||
EgtBeamSetPartProdNbr(AddPartWndVM.nPDN)
|
||||
If Not IsNothing(AddPartWndVM.sNAM) Then EgtBeamSetPartName(AddPartWndVM.sNAM)
|
||||
EgtBeamSetPartCount(AddPartWndVM.nCNT)
|
||||
@@ -1058,7 +1111,12 @@ Public Class LeftPanelVM
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub RemovePartCmd()
|
||||
If IsNothing(Map.refProjManagerVM.CurrProj) Then Return
|
||||
'If IsNothing(Map.refProjManagerVM.CurrProj) Then Return
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso IsNothing(Map.refProjManagerVM) Then
|
||||
Return
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(Map.refOnlyProdManagerVM) Then
|
||||
Return
|
||||
End If
|
||||
If Map.refProjectVM.BTLStructureVM.SelBTLParts.Count > 0 Then
|
||||
Dim CurrSelBTLParts As List(Of BTLPartVM) = Map.refProjectVM.BTLStructureVM.SelBTLParts.ToList()
|
||||
For RemoveIndex = CurrSelBTLParts.Count - 1 To 0 Step -1
|
||||
@@ -1131,7 +1189,14 @@ Public Class LeftPanelVM
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub Invert()
|
||||
If IsNothing(Map.refProjManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return
|
||||
'If IsNothing(Map.refProjManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso IsNothing(Map.refProjManagerVM) Then
|
||||
Return
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(Map.refOnlyProdManagerVM) Then
|
||||
Return
|
||||
ElseIf IsNothing(Map.refProjectVM.BTLStructureVM) Then
|
||||
Return
|
||||
End If
|
||||
' se modalita' assemblato
|
||||
Dim bShowBuilding As Boolean = Map.refShowBeamPanelVM.ShowBuilding_IsChecked
|
||||
If bShowBuilding AndAlso Map.refShowBeamPanelVM.bShowAll Then
|
||||
@@ -1166,7 +1231,14 @@ Public Class LeftPanelVM
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub BackRotation()
|
||||
If IsNothing(Map.refProjManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return
|
||||
'If IsNothing(Map.refProjManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso IsNothing(Map.refProjManagerVM) Then
|
||||
Return
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(Map.refOnlyProdManagerVM) Then
|
||||
Return
|
||||
ElseIf IsNothing(Map.refProjectVM.BTLStructureVM) Then
|
||||
Return
|
||||
End If
|
||||
' salvo sezione impostata
|
||||
Dim CurrSection As SectionXMaterial = Map.refProjectVM.BTLStructureVM.SelSection
|
||||
' se modalita' assemblato
|
||||
@@ -1210,7 +1282,14 @@ Public Class LeftPanelVM
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub ForwardRotation()
|
||||
If IsNothing(Map.refProjManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return
|
||||
'If IsNothing(Map.refProjManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso IsNothing(Map.refProjManagerVM) Then
|
||||
Return
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(Map.refOnlyProdManagerVM) Then
|
||||
Return
|
||||
ElseIf IsNothing(Map.refProjectVM.BTLStructureVM) Then
|
||||
Return
|
||||
End If
|
||||
' salvo sezione impostata
|
||||
Dim CurrSection As SectionXMaterial = Map.refProjectVM.BTLStructureVM.SelSection
|
||||
' se modalita' assemblato
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Image Source="/Resources/LeftPanel/NewRawPart.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding NewRawPartLast_Command}"
|
||||
<Button Command="{Binding NewRawPartLast_Command}"
|
||||
Visibility="{Binding MachiningPage_Visibility}"
|
||||
ToolTip="{Binding NewRawPartLast_ToolTip}"
|
||||
IsEnabled="{Binding LeftPanel_IsEnabled}"
|
||||
@@ -125,14 +125,14 @@
|
||||
</Button>
|
||||
<Button Command="{Binding Invert_Command}"
|
||||
Visibility="{Binding ViewPage_Visibility}"
|
||||
ToolTip="{Binding Invert_ToolTip}"
|
||||
ToolTip="{Binding InvertSx_ToolTip}"
|
||||
IsEnabled="{Binding RotatePart_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Image Source="/Resources/PartManager/LeftInvert.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding Invert_Command}"
|
||||
Visibility="{Binding ViewPage_Visibility}"
|
||||
ToolTip="{Binding Invert_ToolTip}"
|
||||
ToolTip="{Binding InvertDx_ToolTip}"
|
||||
IsEnabled="{Binding RotatePart_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Image Source="/Resources/PartManager/RightInvert.png" Stretch="Uniform"/>
|
||||
|
||||
@@ -595,7 +595,7 @@ Public Class MyMachGroupVM
|
||||
End Function
|
||||
|
||||
Private Sub ReadProductionState()
|
||||
If IsNothing(Map.refProdManagerVM.CurrProd) OrElse IsNothing(Map.refProdManagerVM.CurrProd.nProdId) Then Return
|
||||
If IsNothing(Map.refProdManagerVM) OrElse IsNothing(Map.refProdManagerVM.CurrProd) OrElse IsNothing(Map.refProdManagerVM.CurrProd.nProdId) Then Return
|
||||
Dim MachGroupModel As MachGroupModel = DbControllers.m_MachGroupController.FindByMachGroupId(Map.refProdManagerVM.CurrProd.nProdId, Id)
|
||||
If Not IsNothing(MachGroupModel) Then
|
||||
If Not String.IsNullOrEmpty(MachGroupModel.SupervisorId) Then
|
||||
|
||||
@@ -278,7 +278,11 @@ Public Class PartVM
|
||||
End If
|
||||
ParentMachGroupVM.PartVMList.Remove(Me)
|
||||
' aggiorno Db
|
||||
DbControllers.m_PartController.Delete(Map.refProdManagerVM.CurrProd.nProdId, ParentMachGroupVM.Id, nPartId)
|
||||
If Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso Not IsNothing(Map.refProdManagerVM) Then
|
||||
DbControllers.m_PartController.Delete(Map.refProdManagerVM.CurrProd.nProdId, ParentMachGroupVM.Id, nPartId)
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Not IsNothing(Map.refOnlyProdManagerVM) Then
|
||||
DbControllers.m_PartController.Delete(Map.refOnlyProdManagerVM.CurrProd.nProdId, ParentMachGroupVM.Id, nPartId)
|
||||
End If
|
||||
If nType = MachineType.BEAM Then
|
||||
Dim BeamParentMachGroup As MyMachGroupVM = DirectCast(ParentMachGroupVM, MyMachGroupVM)
|
||||
If Not IsNothing(BeamParentMachGroup) Then BeamParentMachGroup.ReDrawBeamMachgroup()
|
||||
@@ -365,7 +369,7 @@ Public Class PartVM
|
||||
End Sub
|
||||
|
||||
Private Sub ReadProductionData()
|
||||
If IsNothing(Map.refProdManagerVM.CurrProd) OrElse IsNothing(Map.refProdManagerVM.CurrProd.nProdId) Then Return
|
||||
If IsNothing(Map.refProdManagerVM) OrElse IsNothing(Map.refProdManagerVM.CurrProd) OrElse IsNothing(Map.refProdManagerVM.CurrProd.nProdId) Then Return
|
||||
Dim PartModel As PartModel = DbControllers.m_PartController.FindByPartId(Map.refProdManagerVM.CurrProd.nProdId, nPartId)
|
||||
If Not IsNothing(PartModel) Then
|
||||
PartM.SetProductionState(PartModel.State)
|
||||
|
||||
@@ -21,7 +21,7 @@ Public Class MachinePanelVM
|
||||
Set(value As Machine)
|
||||
If value IsNot m_SelectedMachine Then
|
||||
' imposto macchina in DbGeometrico
|
||||
If EgtSetCurrMachine(value.Name) Then
|
||||
If Not IsNothing(value) AndAlso EgtSetCurrMachine(value.Name) Then
|
||||
m_SelectedMachine = value
|
||||
End If
|
||||
' Salvo impostazione macchina corrente
|
||||
@@ -30,7 +30,11 @@ Public Class MachinePanelVM
|
||||
' inizializzo la macchina selezionata come macchina corrente
|
||||
Dim nMachType As MachineType = DirectCast(m_SelectedMachine, MyMachine).nType
|
||||
SectionXMaterial.SetType(nMachType)
|
||||
InitCurrentMachine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, value.Name, nMachType)
|
||||
If Not IsNothing(value) Then
|
||||
InitCurrentMachine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, value.Name, nMachType)
|
||||
Else
|
||||
InitCurrentMachine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, m_SelectedMachine.Name, nMachType)
|
||||
End If
|
||||
' mostro bottone tabella beam o wall a seconda del tipo
|
||||
m_BeamTable_Visibility = If(nMachType = MachineType.BEAM OrElse nMachType = MachineType.BOTH, Visibility.Visible, Visibility.Collapsed)
|
||||
m_WallTable_Visibility = If(nMachType = MachineType.WALL OrElse nMachType = MachineType.BOTH, Visibility.Visible, Visibility.Collapsed)
|
||||
|
||||
@@ -252,6 +252,8 @@ Public Class MainMenuVM
|
||||
Map.refProjectVM.SetProjManager_Visibility(True)
|
||||
Map.refProjectVM.SetProdManager_Visibility(False)
|
||||
Map.refProjectVM.SetOnlyProdManager_Visibility(False)
|
||||
Map.refProjectVM.SetOnlyProdLeftPanel_Visibility(False)
|
||||
Map.refProjectVM.SetOnlyProdOptimizePanel_Visibility(False)
|
||||
Map.refProjectVM.SetOptimizePanel_Visibility(Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NESTING_AUTO))
|
||||
Map.refProjectVM.NotifyAllPanelVisibility()
|
||||
Map.refCALCPanelVM.SetChooseMachineBtn_Visibility(Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Map.refMachinePanelVM.MachineList.Count > 1 AndAlso GetMainPrivateProfileInt(S_MACH, K_CHANGEMACH, 0) = 1)
|
||||
@@ -359,6 +361,8 @@ Public Class MainMenuVM
|
||||
Map.refProjectVM.SetShowBeamPanel_Visibility(False)
|
||||
Map.refProjectVM.SetProjManager_Visibility(False)
|
||||
Map.refProjectVM.SetOnlyProdManager_Visibility(True)
|
||||
Map.refProjectVM.SetOnlyProdLeftPanel_Visibility(True)
|
||||
Map.refProjectVM.SetOnlyProdOptimizePanel_Visibility(True)
|
||||
Map.refProjectVM.SetProdManager_Visibility(True)
|
||||
Map.refProjectVM.SetOptimizePanel_Visibility(True)
|
||||
Map.refCALCPanelVM.SetChooseMachine_Visibility(False)
|
||||
@@ -469,6 +473,8 @@ Public Class MainMenuVM
|
||||
Map.refProjectVM.SetProjManager_Visibility(False)
|
||||
Map.refProjectVM.SetProdManager_Visibility(True)
|
||||
Map.refProjectVM.SetOnlyProdManager_Visibility(False)
|
||||
Map.refProjectVM.SetOnlyProdLeftPanel_Visibility(False)
|
||||
Map.refProjectVM.SetOnlyProdOptimizePanel_Visibility(False)
|
||||
Map.refProjectVM.NotifyAllPanelVisibility()
|
||||
Map.refCALCPanelVM.SetChooseMachineBtn_Visibility(False)
|
||||
Map.refTopPanelVM.UpdateQParameterVisibility()
|
||||
@@ -514,6 +520,8 @@ Public Class MainMenuVM
|
||||
Map.refProjectVM.SetProjManager_Visibility(True)
|
||||
Map.refProjectVM.SetProdManager_Visibility(False)
|
||||
Map.refProjectVM.SetOnlyProdManager_Visibility(False)
|
||||
Map.refProjectVM.SetOnlyProdLeftPanel_Visibility(False)
|
||||
Map.refProjectVM.SetOnlyProdOptimizePanel_Visibility(False)
|
||||
Map.refProjectVM.SetOptimizePanel_Visibility(Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NESTING_AUTO))
|
||||
Map.refCALCPanelVM.SetChooseMachine_Visibility(False)
|
||||
EgtResetCurrMachGroup()
|
||||
@@ -549,14 +557,16 @@ Public Class MainMenuVM
|
||||
Map.refOptimizePanelVM.UpdateOriginTypeList(EgtGetFirstNameInGroup(GDB_ID.ROOT, "RawParts") <> GDB_ID.NULL)
|
||||
' aggiorno visibilita' degli elementi grafici
|
||||
Map.refProjectVM.SetBottomPanel_Visibility(True)
|
||||
Map.refProjectVM.SetLeftPanel_Visibility(True)
|
||||
Map.refProjectVM.SetLeftPanel_Visibility(False)
|
||||
Map.refLeftPanelVM.UpdateView()
|
||||
Map.refProjectVM.SetFeatureManager_Visibility(True)
|
||||
Map.refProjectVM.SetTopPanel_Visibility(True)
|
||||
Map.refProjectVM.SetShowBeamPanel_Visibility(True)
|
||||
Map.refProjectVM.SetProjManager_Visibility(False)
|
||||
Map.refProjectVM.SetProdManager_Visibility(False)
|
||||
'Map.refProjectVM.SetProjManager_Visibility(False)
|
||||
'Map.refProjectVM.SetProdManager_Visibility(False)
|
||||
Map.refProjectVM.SetOnlyProdManager_Visibility(True)
|
||||
Map.refProjectVM.SetOnlyProdLeftPanel_Visibility(True)
|
||||
Map.refProjectVM.SetOnlyProdOptimizePanel_Visibility(True)
|
||||
'Map.refProjectVM.SetOptimizePanel_Visibility(Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NESTING_AUTO))
|
||||
Map.refProjectVM.SetOptimizePanel_Visibility(True)
|
||||
Map.refProjectVM.NotifyAllPanelVisibility()
|
||||
@@ -602,8 +612,8 @@ Public Class MainMenuVM
|
||||
Map.refFeatureInPartInRawPartListVM.UpdateColumns(CurrentMachine.nType)
|
||||
If Not IsNothing(Map.refTopPanelVM) Then
|
||||
Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE <> BWType.BEAM)
|
||||
Else
|
||||
Map.refProjectVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE <> BWType.BEAM)
|
||||
'Else
|
||||
' Map.refProjectVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE <> BWType.BEAM)
|
||||
End If
|
||||
Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
' resetto modifica parametri Q default
|
||||
@@ -699,6 +709,8 @@ Public Class MainMenuVM
|
||||
Map.refProjectVM.SetProjManager_Visibility(False)
|
||||
Map.refProjectVM.SetProdManager_Visibility(False)
|
||||
Map.refProjectVM.SetOnlyProdManager_Visibility(False)
|
||||
Map.refProjectVM.SetOnlyProdLeftPanel_Visibility(False)
|
||||
Map.refProjectVM.SetOnlyProdOptimizePanel_Visibility(False)
|
||||
Map.refProjectVM.SetOptimizePanel_Visibility(True)
|
||||
Map.refCALCPanelVM.SetChooseMachine_Visibility(False)
|
||||
EgtResetCurrMachGroup()
|
||||
|
||||
@@ -387,7 +387,7 @@ Public Class MainWindowVM
|
||||
' Verifica modifica parametri Macchina e chiedo il salvataggio
|
||||
Map.refConfigurationPageVM.VerifyConfigPageModification()
|
||||
Case Pages.ONLYPRODPAGE
|
||||
bOk = ProdFileVM.VerifyProjectModification(Map.refProdManagerVM.CurrProd) <> MessageBoxResult.Cancel
|
||||
bOk = ProdFileVM.VerifyProjectModification(Map.refOnlyProdManagerVM.CurrProd) <> MessageBoxResult.Cancel
|
||||
End Select
|
||||
' se salvataggio annullato, rimango
|
||||
If Not bOk Then Return
|
||||
@@ -406,12 +406,12 @@ Public Class MainWindowVM
|
||||
Dim sFilePath As String = String.Empty
|
||||
If EgtGetCurrFilePath(sFilePath) Then WriteMainPrivateProfileString(S_GENERAL, K_LASTPROJ, sFilePath)
|
||||
' tolgo lock da file aperto
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW And Not IsNothing(Map.refProjManagerVM.CurrProj) Then
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW And Not IsNothing(Map.refProjManagerVM) AndAlso Not IsNothing(Map.refProjManagerVM.CurrProj) Then
|
||||
DbControllers.m_ProjController.LockByProjId(Map.refProjManagerVM.CurrProj.nProjId, False, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING And Not IsNothing(Map.refProdManagerVM.CurrProd) Then
|
||||
DbControllers.m_ProdController.LockByProdId(Map.refProdManagerVM.CurrProd.nProdId, False, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE And Not IsNothing(Map.refProdManagerVM.CurrProd) Then
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING And Not IsNothing(Map.refProdManagerVM) AndAlso Not IsNothing(Map.refProdManagerVM.CurrProd) Then
|
||||
DbControllers.m_ProdController.LockByProdId(Map.refProdManagerVM.CurrProd.nProdId, False, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE And Not IsNothing(Map.refOnlyProdManagerVM) AndAlso Not IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then
|
||||
DbControllers.m_ProdController.LockByProdId(Map.refOnlyProdManagerVM.CurrProd.nProdId, False, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
|
||||
End If
|
||||
' Termino il Model
|
||||
m_MainWindowM.Close()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
|
||||
IsTopDockable="True" IsBottomDockable="False" IsLeftDockable="False"
|
||||
IsRightDockable="False"
|
||||
IsEnabled="{Binding FullCompleteManager_IsEnabled}"
|
||||
IsEnabled="{Binding OnlyProdManager_IsEnabled}"
|
||||
Style="{StaticResource ToolBar_EgtFloatingPanel}">
|
||||
|
||||
<!--Barra superiore dei comandi-->
|
||||
|
||||
@@ -18,15 +18,15 @@ Public Class OnlyProdManagerVM
|
||||
Private m_bOpenProj As Boolean = False
|
||||
Private m_nProjIdToOpen As Integer = GDB_ID.NULL
|
||||
|
||||
Private m_FullCompleteManager_IsEnabled As Boolean = True
|
||||
Public ReadOnly Property FullCompleteManager_IsEnabled As Boolean
|
||||
Private m_OnlyProdManager_IsEnabled As Boolean = True
|
||||
Public ReadOnly Property OnlyProdManager_IsEnabled As Boolean
|
||||
Get
|
||||
Return m_FullCompleteManager_IsEnabled
|
||||
Return m_OnlyProdManager_IsEnabled
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetProdManagerIsEnabled(bIsEnabled As Boolean)
|
||||
m_FullCompleteManager_IsEnabled = bIsEnabled
|
||||
NotifyPropertyChanged(NameOf(FullCompleteManager_IsEnabled))
|
||||
Friend Sub SetOnlyProdManagerIsEnabled(bIsEnabled As Boolean)
|
||||
m_OnlyProdManager_IsEnabled = bIsEnabled
|
||||
NotifyPropertyChanged(NameOf(OnlyProdManager_IsEnabled))
|
||||
End Sub
|
||||
|
||||
Private m_CurrProj As ProjFileVM
|
||||
@@ -118,6 +118,18 @@ Public Class OnlyProdManagerVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nProjType As BWType
|
||||
Get
|
||||
Return If(Not IsNothing(CurrProj), CurrProj.nType, BWType.NULL)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nProdType As BWType
|
||||
Get
|
||||
Return If(Not IsNothing(CurrProd), CurrProd.nType, BWType.NULL)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdNew As ICommand
|
||||
Private m_cmdOpen As ICommand
|
||||
@@ -126,6 +138,7 @@ Public Class OnlyProdManagerVM
|
||||
Private m_cmdUpdateBTL As ICommand
|
||||
Private m_cmdExportProject As ICommand
|
||||
Private m_cmdImportProject As ICommand
|
||||
Private m_cmdAddProj As ICommand
|
||||
Private m_cmdGoToSupervisor As ICommand
|
||||
|
||||
#Region "ToolTip"
|
||||
@@ -166,9 +179,9 @@ Public Class OnlyProdManagerVM
|
||||
Return EgtMsg(61839)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property GoToProd_ToolTip As String
|
||||
Public ReadOnly Property ExportProject_ToolTip As String
|
||||
Get
|
||||
Return EgtMsg(61835)
|
||||
Return EgtMsg(61838)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property GoToSupervisor_ToolTip As String
|
||||
@@ -224,6 +237,10 @@ Public Class OnlyProdManagerVM
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function UpdateCurrProj() As Boolean
|
||||
Return SetCurrProj(CurrProj.nProjId)
|
||||
End Function
|
||||
|
||||
Private Function InitNewProject(ByRef nProjId As Integer, ByRef sProjectDir As String, nType As BWType, Machine As Machine) As Boolean
|
||||
' se non ho ricevuto numero progetto da sovrascrivere
|
||||
If nProjId = 0 Then
|
||||
@@ -252,8 +269,28 @@ Public Class OnlyProdManagerVM
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function InitNewProjectPROD(ByRef nProjId As Integer, ByRef nProdId As Integer, ByRef sProjectDir As String) As Boolean
|
||||
' richiedo indice nuovo progetto
|
||||
nProdId = DbControllers.m_ProdController.GetNextIndex(nProjId, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
|
||||
If nProdId <= 0 Then Return False
|
||||
sProjectDir = refMainWindowVM.MainWindowM.sProdsDir & "\" & nProdId.ToString("0000")
|
||||
' creo cartella nuovo progetto
|
||||
If Not Directory.Exists(sProjectDir) Then
|
||||
Directory.CreateDirectory(sProjectDir)
|
||||
Else
|
||||
Dim di As System.IO.DirectoryInfo = New DirectoryInfo(sProjectDir)
|
||||
For Each file As FileInfo In di.EnumerateFiles()
|
||||
file.Delete()
|
||||
Next
|
||||
For Each dir As DirectoryInfo In di.EnumerateDirectories()
|
||||
dir.Delete(True)
|
||||
Next
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Sub ReloadBTLStructure()
|
||||
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(Map.refProjManagerVM.CurrProj.nProjId))
|
||||
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(Map.refOnlyProdManagerVM.CurrProd.nProdId))
|
||||
' verifico se volume pezzi calcolato
|
||||
Dim bIsCalculated As Boolean = False
|
||||
For Each BTLPart In Map.refProjectVM.BTLStructureVM.BTLPartVMList
|
||||
@@ -355,7 +392,7 @@ Public Class OnlyProdManagerVM
|
||||
End If
|
||||
' creo nuovo progetto
|
||||
If Map.refSceneHostVM.MainController.NewProject() Then
|
||||
' inizializzo nuovo progetto
|
||||
' inizializzo nuovo progetto PROJ
|
||||
Dim nProjId As Integer = 0
|
||||
Dim sProjDir As String = ""
|
||||
InitNewProject(nProjId, sProjDir, nType, Machine)
|
||||
@@ -386,6 +423,42 @@ Public Class OnlyProdManagerVM
|
||||
SetCurrProj(nProjId)
|
||||
End If
|
||||
Map.refProjectVM.SetOptimizePanel_Visibility(Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NESTING_AUTO))
|
||||
|
||||
' inizializzo nuovo progetto PROD
|
||||
Dim nProdId As Integer = 0
|
||||
Dim sProdDir As String = ""
|
||||
InitNewProjectPROD(m_CurrProj.nProjId, nProdId, sProdDir)
|
||||
' setto il PType del Prod
|
||||
DbControllers.m_ProdController.UpdatePType(nProdId, CurrProj.nType)
|
||||
' setto la Macchina associata al Prod
|
||||
DbControllers.m_ProdController.UpdateMachine(nProdId, CurrProj.sMachine)
|
||||
' copio file progetto
|
||||
Dim sProjPath As String = String.Empty
|
||||
Dim bOk = False
|
||||
Dim sProdPath As String = sProdDir & "\" & nProdId.ToString("0000") & ".nge"
|
||||
If EgtGetCurrFilePath(sProjPath) AndAlso Not String.IsNullOrEmpty(sProjPath) Then
|
||||
Try
|
||||
File.Copy(sProjPath, sProdPath)
|
||||
'Map.refSceneHostVM.MainController.OpenProject(sProdPath)
|
||||
bOk = True
|
||||
Catch ex As Exception
|
||||
EgtOutLog("Impossibile copiare il file")
|
||||
bOk = False
|
||||
End Try
|
||||
End If
|
||||
If bOk Then
|
||||
' aggiorno path proj
|
||||
Map.refOnlyProdManagerVM.UpdateCurrProj()
|
||||
' imposto currprod
|
||||
Map.refOnlyProdManagerVM.SetCurrProd(nProdId)
|
||||
' imposto TempCurrProd
|
||||
Map.refOnlyProdManagerVM.TempCurrProd = Map.refOnlyProdManagerVM.CurrProd
|
||||
' setto flag nuovo progetto in prod
|
||||
Map.refOnlyProdManagerVM.CurrProd.bIsNew = True
|
||||
Else
|
||||
' elimino da DB
|
||||
DbControllers.m_ProdController.DeleteProd(nProdId, True)
|
||||
End If
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(61876))
|
||||
End If
|
||||
@@ -457,7 +530,7 @@ Public Class OnlyProdManagerVM
|
||||
Else
|
||||
If Map.refSceneHostVM.MainController.OpenProject(sFilePath, False) Then
|
||||
Map.refProjectVM.SetOptimizePanel_Visibility(True)
|
||||
Map.refTopPanelVM.UpdateQParameterVisibility()
|
||||
If Not IsNothing(Map.refTopPanelVM) Then Map.refTopPanelVM.UpdateQParameterVisibility()
|
||||
End If
|
||||
End If
|
||||
' imposto flag secondo tipo di progetto (travi o pareti)
|
||||
@@ -472,7 +545,7 @@ Public Class OnlyProdManagerVM
|
||||
' aggiorno lista possibili nesting
|
||||
Map.refOptimizePanelVM.UpdateOriginTypeList(EgtGetFirstNameInGroup(GDB_ID.ROOT, "RawParts") <> GDB_ID.NULL)
|
||||
' aggiorno visibilità bottone Muovi pezzi
|
||||
Map.refTopPanelVM.UpdateMovePartInRawPartVisibility()
|
||||
If Not IsNothing(Map.refTopPanelVM) Then Map.refTopPanelVM.UpdateMovePartInRawPartVisibility()
|
||||
' resetto eventuale visualizzazione statistiche
|
||||
Map.refInstrumentPanelVM.ResetStatisticsIsChecked()
|
||||
' aggiorno titolo
|
||||
@@ -566,7 +639,8 @@ 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 ProdFileVM.VerifyProjectModification(CurrProd) Then Return
|
||||
If Not ProjFileVM.VerifyProjectModification(CurrProj, ProjectType.PROJ) Then Return
|
||||
'If Not ProdFileVM.VerifyProjectModification(CurrProd) Then Return
|
||||
Dim sDir As String = String.Empty
|
||||
GetMainPrivateProfileString(S_GENERAL, K_LASTIMPDIR, "", sDir)
|
||||
If bWithDlg Then
|
||||
@@ -786,9 +860,9 @@ Public Class OnlyProdManagerVM
|
||||
''' Execute the UpdateBTL. This method is invoked by the UpdateBTLCommand.
|
||||
''' </summary>
|
||||
Public Sub UpdateBTL(Optional sFile As String = "", Optional bWithDlg As Boolean = True)
|
||||
If IsNothing(CurrProj) Then Return
|
||||
If IsNothing(CurrProd) Then Return
|
||||
' verifico se progetto modificato, e chiedo se salvare
|
||||
If CurrProj.bIsNew Or EgtGetModified() OrElse Map.refCALCPanelVM.IsMachineModified() Then
|
||||
If CurrProd.bIsNew Or EgtGetModified() OrElse Map.refCALCPanelVM.IsMachineModified() Then
|
||||
Select Case MessageBox.Show(EgtMsg(61877), "", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
|
||||
Case MessageBoxResult.Yes
|
||||
Save()
|
||||
@@ -853,7 +927,7 @@ Public Class OnlyProdManagerVM
|
||||
' setto il flag per inizializzazione gestore travi e pareti per importare progetto
|
||||
Dim nFlag As Integer
|
||||
Dim sBTLFlag As String
|
||||
If Map.refProjManagerVM.nProjType = Core.ConstBeam.BWType.BEAM Then
|
||||
If Map.refOnlyProdManagerVM.nProdType = Core.ConstBeam.BWType.BEAM Then
|
||||
sBTLFlag = K_BTLFLAG
|
||||
Else
|
||||
sBTLFlag = K_WALLBTLFLAG
|
||||
@@ -1194,7 +1268,7 @@ Public Class OnlyProdManagerVM
|
||||
Dim nAsseBaseToEraseId As Integer = 0
|
||||
EgtGetInfo(nAsseBaseId, BTL_PRT_PROJ, nAsseBaseProjId)
|
||||
' se AsseBase di questo step del ciclo è nuovo e suo ProjId uguale a quello del progetto corrente
|
||||
If Not AsseBaseIdList.Contains(nAsseBaseId) AndAlso nAsseBaseProjId = Map.refProjManagerVM.CurrProj.nProjId Then
|
||||
If Not AsseBaseIdList.Contains(nAsseBaseId) AndAlso nAsseBaseProjId = Map.refOnlyProdManagerVM.CurrProd.nProdId Then
|
||||
' riloco i sottonodi del nuovo AsseBase nell'AsseBase del progetto aperto col medesimo ProjId
|
||||
Dim AsseBaseSubNodeId As Integer = EgtGetFirstInGroup(nAsseBaseId)
|
||||
While AsseBaseSubNodeId <> GDB_ID.NULL
|
||||
@@ -1204,7 +1278,8 @@ Public Class OnlyProdManagerVM
|
||||
Dim SameAsseBaseProjId As Integer
|
||||
EgtGetInfo(FindAsseBaseId, BTL_PRT_PROJ, SameAsseBaseProjId)
|
||||
' se l'ho trovato esco dal While (FindAsseBaseId è l'id dell'AsseBase in cui vogliamo rilocare i sottonodi)
|
||||
If SameAsseBaseProjId = Map.refProjManagerVM.CurrProj.nProjId Then Exit While
|
||||
'If SameAsseBaseProjId = Map.refProjManagerVM.CurrProj.nProjId Then Exit While
|
||||
If SameAsseBaseProjId = Map.refOnlyProdManagerVM.CurrProd.nProdId Then Exit While
|
||||
FindAsseBaseId = EgtGetNextName(FindAsseBaseId, ASSEBASE)
|
||||
End While
|
||||
' salvo id dell'AsseBase corrente per ottenere il seguente prima di rilocarlo
|
||||
@@ -1263,9 +1338,10 @@ Public Class OnlyProdManagerVM
|
||||
End If
|
||||
' copio il file originale scelto nel dialog per l'Update nella cartella Proj del progetto corrente
|
||||
If File.Exists(sFile) Then
|
||||
Dim sDestPath As String = Map.refProjManagerVM.CurrProj.sProjDirPath & "\" & Path.GetFileNameWithoutExtension(sFile)
|
||||
'Dim sDestPath As String = Map.refProjManagerVM.CurrProj.sProjDirPath & "\" & Path.GetFileNameWithoutExtension(sFile)
|
||||
Dim sDestPath As String = Map.refOnlyProdManagerVM.CurrProd.sProdDirPath & "\" & Path.GetFileNameWithoutExtension(sFile)
|
||||
While File.Exists(sDestPath & ".btl")
|
||||
sDestPath = sDestPath & "_1"
|
||||
sDestPath &= "_1"
|
||||
End While
|
||||
File.Copy(sFile, sDestPath & ".btl", False)
|
||||
End If
|
||||
@@ -1309,14 +1385,17 @@ Public Class OnlyProdManagerVM
|
||||
Case Pages.MACHINING
|
||||
If ProdFileVM.VerifyProjectModification(Map.refProdManagerVM.CurrProd) = MessageBoxResult.Cancel Then Return Nothing
|
||||
If IsNothing(Map.refProdManagerVM.CurrProd) Then Return Nothing
|
||||
Case Pages.ONLYPRODPAGE
|
||||
If ProdFileVM.VerifyProjectModification(Map.refOnlyProdManagerVM.CurrProd) = MessageBoxResult.Cancel Then Return Nothing
|
||||
If IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then Return Nothing
|
||||
Case Else
|
||||
Return Nothing
|
||||
End Select
|
||||
|
||||
' apro finestra di salvataggio progetto
|
||||
Dim ExportDlg As New Microsoft.Win32.SaveFileDialog() With {.DefaultExt = ".ngexp",
|
||||
.Filter = "ProjectExport (*.ngexp)|*.ngexp",
|
||||
.FileName = CurrProj.nProjId.ToString("0000") & " - " & CurrProj.sBTLFileName & " - ProjectExport"}
|
||||
.Filter = "ProjectExport (*.ngexp)|*.ngexp",
|
||||
.FileName = CurrProd.nProdId.ToString("0000") & " - " & CurrProd.sBTLFileName & " - ProjectExport"}
|
||||
If IsNothing(sExportFileName) Then
|
||||
If ExportDlg.ShowDialog() <> True Then Return Nothing
|
||||
End If
|
||||
@@ -1351,8 +1430,8 @@ Public Class OnlyProdManagerVM
|
||||
Dim nImpExpPartId As Integer = EgtCreateGroup(GDB_ID.ROOT)
|
||||
EgtSetName(nImpExpPartId, EXP_PART)
|
||||
' ci scrivo nome macchina e tipo progetto
|
||||
EgtSetInfo(nImpExpPartId, EXP_MACHINE, CurrProj.sMachine)
|
||||
EgtSetInfo(nImpExpPartId, BTL_GEN_PROJTYPE, CurrProj.nType)
|
||||
EgtSetInfo(nImpExpPartId, EXP_MACHINE, CurrProd.sMachine)
|
||||
EgtSetInfo(nImpExpPartId, BTL_GEN_PROJTYPE, CurrProd.nType)
|
||||
|
||||
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.EXPORTPROJECT, 2, EgtMsg(63017), 30, 100) ' Exporting...
|
||||
' salvo info inserite
|
||||
@@ -1365,7 +1444,7 @@ Public Class OnlyProdManagerVM
|
||||
Try
|
||||
Using zip As New Ionic.Zip.ZipFile(sZipToCreate, Console.Out)
|
||||
' impacchetto tutta la cartella del progetto
|
||||
Dim sProjectDirPath As String = If(CurrProj.nProdId > 0, CurrProj.sProdDirPath, CurrProj.sProjDirPath)
|
||||
Dim sProjectDirPath As String = If(CurrProd.nProdId > 0, CurrProd.sProdDirPath, CurrProj.sProjDirPath)
|
||||
For Each sFile As String In Directory.GetFiles(sProjectDirPath)
|
||||
zip.AddItem(sFile, "")
|
||||
Next
|
||||
@@ -1405,10 +1484,11 @@ Public Class OnlyProdManagerVM
|
||||
''' Execute the Export. This method is invoked by the ExportCommand.
|
||||
''' </summary>
|
||||
Public Sub ImportProject()
|
||||
Dim CurrProd As ProjectFileVM = Map.refProdManagerVM.CurrProd
|
||||
Dim CurrProd As ProjectFileVM = Map.refOnlyProdManagerVM.CurrProd
|
||||
' lista di tutti gli errori riscontrati
|
||||
Dim ErrorList As New List(Of String)
|
||||
If Not ProjFileVM.VerifyProjectModification(CurrProj, ProjectType.PROJ) Then Return
|
||||
'If Not ProjFileVM.VerifyProjectModification(CurrProj, ProjectType.PROJ) Then Return
|
||||
If ProdFileVM.VerifyProjectModification(CurrProd) Then Return
|
||||
Dim sDir As String = String.Empty
|
||||
GetMainPrivateProfileString(S_GENERAL, K_LASTNGEXPDIR, "", sDir)
|
||||
' apro finestra scelta file
|
||||
@@ -1664,6 +1744,97 @@ Public Class OnlyProdManagerVM
|
||||
|
||||
#End Region ' ImportProject
|
||||
|
||||
#Region "AddProj"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Save.
|
||||
''' </summary>
|
||||
Public ReadOnly Property AddProj_Command As ICommand
|
||||
Get
|
||||
If m_cmdAddProj Is Nothing Then
|
||||
m_cmdAddProj = New Command(AddressOf AddProj)
|
||||
End If
|
||||
Return m_cmdAddProj
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Save. This method is invoked by the SaveCommand.
|
||||
''' </summary>
|
||||
Public Sub AddProj()
|
||||
' verifico se progetto modificato, e chiedo se salvare
|
||||
If IsNothing(CurrProd) Then Return
|
||||
Dim bNewProject As Boolean = False
|
||||
Dim sProjectDirPath As String = ""
|
||||
sProjectDirPath = CurrProd.sProdDirPath
|
||||
Dim VerifyResult As MessageBoxResult = MessageBoxResult.None
|
||||
' verifico se progetto modificato, e chiedo se salvare
|
||||
If EgtGetModified() OrElse CurrProd.bIsNew OrElse Map.refCALCPanelVM.IsMachineModified() Then
|
||||
VerifyResult = MessageBox.Show(EgtMsg(61875), "", If(CurrProd.bIsNew, MessageBoxButton.OKCancel, MessageBoxButton.YesNoCancel), MessageBoxImage.Question)
|
||||
Select Case VerifyResult
|
||||
Case MessageBoxResult.Yes, MessageBoxResult.OK
|
||||
' salvo proj
|
||||
Map.refOnlyProdManagerVM.Save()
|
||||
Case MessageBoxResult.Cancel
|
||||
Return
|
||||
Case Else ' No
|
||||
EgtResetModified()
|
||||
OpenProject(CurrProd)
|
||||
End Select
|
||||
Else
|
||||
EgtResetModified()
|
||||
End If
|
||||
' faccio scegliere proj da aggiungere
|
||||
Dim OpenProjectFileDialogVM As New OpenProjectFileDialogVM
|
||||
Dim ChooseProdFileDialog As New OpenProjectFileDialogV(Application.Current.MainWindow, OpenProjectFileDialogVM)
|
||||
Dim DialogResult As Boolean? = ChooseProdFileDialog.EgtShowDialog(ProjectType.PROJ, True)
|
||||
If IsNothing(DialogResult) OrElse Not DialogResult Then Return
|
||||
If IsNothing(OpenProjectFileDialogVM.SelProject.nProjId) OrElse OpenProjectFileDialogVM.SelProject.nProjId <= 0 Then Return
|
||||
' verifico che il proj selezionato non abbia prod
|
||||
If Not IsNothing(OpenProjectFileDialogVM.SelProject.nProdId) AndAlso OpenProjectFileDialogVM.SelProject.nProdId > 0 Then
|
||||
' verifico che non sia uno di quelli gia' collegati a questo Prod
|
||||
Dim bFound As Boolean = False
|
||||
For Each nProjId As Integer In CurrProd.nProjIdList
|
||||
If nProjId = OpenProjectFileDialogVM.SelProject.nProjId Then
|
||||
bFound = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If bFound Then
|
||||
MessageBox.Show("Selezionato progetto che fa gia' parte di questa produzione!", "Errore", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Else
|
||||
MessageBox.Show("Progetto gia' collegato ad una produzione!", "Errore", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
End If
|
||||
Return
|
||||
End If
|
||||
' verifico che sia associato alla stessa macchina
|
||||
If OpenProjectFileDialogVM.SelProject.sMachine <> CurrProd.sMachine Then
|
||||
MessageBox.Show("Progetto per una macchina diversa da quella del progetto corrente!", "Errore", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
' inserisco proj nel prod corrente
|
||||
Dim bOk As Boolean = EgtInsertFile(OpenProjectFileDialogVM.SelProject.sProjPath)
|
||||
' lo salvo
|
||||
bOk = bOk AndAlso Save(False)
|
||||
If bOk Then
|
||||
' riporto aggiunta proj a prod su Db
|
||||
DbControllers.m_ProdController.AddProj(CurrProd.nProdId, OpenProjectFileDialogVM.SelProject.nProjId)
|
||||
End If
|
||||
' Ricavo il tipo di Warehouse settato nell'INI
|
||||
Dim nDefault As Integer = 2
|
||||
If GetMainPrivateProfileInt(S_WAREHOUSE, EgtBEAMWALL.Core.ConstIni.K_TYPE, nDefault) = WarehouseType.MEDIUM Then
|
||||
' Se di tipo Medium confronto le Sezioni del BTL importato con quelle in Warehouse
|
||||
WarehouseWndVM.UpdateSectionXMaterial()
|
||||
End If
|
||||
' aggiorno CurrProd
|
||||
Dim PdFileM = DbControllers.m_ProdController.FindCoreByProdId(CurrProd.nProdId)
|
||||
CurrProd.ProdFileM.SetProjIdList(PdFileM.nProjIdList)
|
||||
' ricarico BTLPartList
|
||||
OpenProject(CurrProd)
|
||||
End Sub
|
||||
|
||||
#End Region ' AddProj
|
||||
|
||||
#Region "GoToSupervisor"
|
||||
|
||||
''' <summary>
|
||||
@@ -1682,7 +1853,7 @@ Public Class OnlyProdManagerVM
|
||||
''' Execute the Open. This method is invoked by the OpenCommand.
|
||||
''' </summary>
|
||||
Friend Sub GoToSupervisor()
|
||||
If IsNothing(m_CurrProd) Then Return
|
||||
If IsNothing(CurrProd) Then Return
|
||||
' apro supervisore
|
||||
Dim sSupervisorName As String = "EgtBEAMWALL.SupervisorR32"
|
||||
' recupero processo del supervisore
|
||||
|
||||
@@ -9,12 +9,8 @@
|
||||
<EgtFloating:EgtFloatingTray x:Name="PROJECTTOPTRAY" DockPanel.Dock="Top">
|
||||
<EgtBEAMWALL:OnlyProdManagerV DataContext="{StaticResource OnlyProdManagerVM}"
|
||||
Visibility="{Binding DataContext.OnlyProdManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
|
||||
<EgtBEAMWALL:ProjManagerV DataContext="{StaticResource ProjManagerVM}"
|
||||
Visibility="{Binding DataContext.ProjManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
|
||||
<EgtBEAMWALL:ProdManagerV DataContext="{StaticResource ProdManagerVM}"
|
||||
Visibility="{Binding DataContext.ProdManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
|
||||
<EgtBEAMWALL:OptimizePanelV DataContext="{StaticResource OptimizePanelVM}"
|
||||
Visibility="{Binding DataContext.OptimizePanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
|
||||
<EgtBEAMWALL:OnlyProdOptimizePanelV DataContext="{StaticResource OptimizePanelVM}"
|
||||
Visibility="{Binding DataContext.OnlyProdOptimizePanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
|
||||
<EgtBEAMWALL:StatisticsTimePanelV DataContext="{StaticResource StatisticsTimePanelVM}"
|
||||
Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
|
||||
</EgtFloating:EgtFloatingTray>
|
||||
@@ -38,7 +34,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<EgtBEAMWALL:OnlyProdLeftPanelV DataContext="{StaticResource LeftPanelVM}"
|
||||
Tag="{Binding DataContext.BTLStructureVM, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"
|
||||
Visibility="{Binding DataContext.LeftPanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
|
||||
Visibility="{Binding DataContext.OnlyProdLeftPanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
|
||||
<GridSplitter Grid.Column="1"
|
||||
Width="3"
|
||||
HorizontalAlignment="Center"
|
||||
@@ -74,7 +70,12 @@
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="{Binding GridDims[5].GridLen, Mode=TwoWay}"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TabControl Grid.Row="1">
|
||||
<TabControl SelectedIndex="{Binding SelProdProj}">
|
||||
<TabControl.ItemContainerStyle>
|
||||
<Style TargetType="{x:Type TabItem}">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
</Style>
|
||||
</TabControl.ItemContainerStyle>
|
||||
<TabItem Header="PROJ">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
@@ -89,6 +90,7 @@
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid>
|
||||
@@ -115,23 +117,29 @@
|
||||
<Button Command="{Binding AddFeature_Command}"
|
||||
Visibility="{Binding ViewPage_Visibility}"
|
||||
ToolTip="{Binding AddFeature_ToolTip}"
|
||||
IsEnabled="{Binding AddFeature_IsEnabled}"
|
||||
IsEnabled="{Binding CopyFeature_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Image Source="/Resources/LeftPanel/AddFeature.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding RemoveFeature_Command}"
|
||||
Visibility="{Binding ViewPage_Visibility}"
|
||||
ToolTip="{Binding RemoveFeature_ToolTip}"
|
||||
IsEnabled="{Binding RemoveFeature_IsEnabled}"
|
||||
IsEnabled="{Binding CopyFeature_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Image Source="/Resources/LeftPanel/RemoveFeature.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<EgtBEAMWALL:FeatureListV DataContext="{StaticResource FeatureListVM}"
|
||||
Tag="{Binding DataContext.BTLStructureVM.SelBTLPart, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"
|
||||
Grid.Row="1"/>
|
||||
<EgtBEAMWALL:OnlyProdFeatureListV DataContext="{StaticResource FeatureListVM}"
|
||||
Tag="{Binding DataContext.BTLStructureVM.SelBTLPart, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"
|
||||
Grid.Row="1"/>
|
||||
</Grid>
|
||||
<Grid Grid.Column="1">
|
||||
|
||||
<GridSplitter Grid.Column="1"
|
||||
Width="3"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Stretch"/>
|
||||
|
||||
<Grid Grid.Column="2">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
@@ -143,16 +151,16 @@
|
||||
Margin="5,5,2.5,5">
|
||||
<TabItem Header="P">
|
||||
<TabItem.Content>
|
||||
<EgtBEAMWALL:PParameterListV DataContext="{StaticResource PParameterListVM}"
|
||||
Tag="{Binding DataContext.BTLStructureVM.SelBTLPart.SelBTLFeatureVM, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"
|
||||
Margin="5"/>
|
||||
<EgtBEAMWALL:OnlyProdPParameterListV DataContext="{StaticResource PParameterListVM}"
|
||||
Tag="{Binding DataContext.BTLStructureVM.SelBTLPart.SelBTLFeatureVM, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"
|
||||
Margin="5"/>
|
||||
</TabItem.Content>
|
||||
</TabItem>
|
||||
<TabItem Header="Q">
|
||||
<TabItem.Content>
|
||||
<EgtBEAMWALL:QParameterListV DataContext="{StaticResource QParameterListVM}"
|
||||
Tag="{Binding DataContext.BTLStructureVM.SelBTLPart.SelBTLFeatureVM, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"
|
||||
Margin="5"/>
|
||||
<EgtBEAMWALL:OnlyProdQParameterListV DataContext="{StaticResource QParameterListVM}"
|
||||
Tag="{Binding DataContext.BTLStructureVM.SelBTLPart.SelBTLFeatureVM, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"
|
||||
Margin="5"/>
|
||||
</TabItem.Content>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
@@ -169,7 +177,7 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.Resources>
|
||||
<!--<Grid.Resources>
|
||||
<Style TargetType="TextBlock">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="Text" Value="">
|
||||
@@ -177,7 +185,7 @@
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Grid.Resources>
|
||||
</Grid.Resources>-->
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="{Binding GridDims[8].GridLen, Mode=TwoWay}"/>
|
||||
@@ -185,27 +193,27 @@
|
||||
<ColumnDefinition Width="{Binding GridDims[9].GridLen, Mode=TwoWay}"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<EgtBEAMWALL:FeatureInPartInRawPartListV DataContext="{StaticResource FeatureInPartInRawPartListVM}"
|
||||
Tag="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.SelPart, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
|
||||
Tag="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.SelPart, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
|
||||
<GridSplitter Grid.Column="1"
|
||||
Height="3"
|
||||
HorizontalAlignment="Stretch"
|
||||
Visibility="{Binding QParSplitter_Visibility}"/>
|
||||
Height="3"
|
||||
HorizontalAlignment="Stretch"
|
||||
Visibility="{Binding QParSplitter_Visibility}"/>
|
||||
<EgtBEAMWALL:QParameterListV Grid.Column="2"
|
||||
DataContext="{StaticResource DuploQParameterListVM}"
|
||||
Tag="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.SelPart.SelFeatureVM, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
|
||||
DataContext="{StaticResource DuploQParameterListVM}"
|
||||
Tag="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.SelPart.SelFeatureVM, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
|
||||
</Grid>
|
||||
<TextBlock Grid.Row="1"
|
||||
Text="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.sCALC_MSG, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"
|
||||
Margin="5,0,5,0"
|
||||
Foreground="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.Calc_Background, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
|
||||
Text="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.sCALC_MSG, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"
|
||||
Margin="5,0,5,0"
|
||||
Foreground="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.Calc_Background, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
|
||||
<TextBlock Grid.Row="2"
|
||||
Text="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.SelPart.sCALC_MSG, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"
|
||||
Margin="5,0,5,0"
|
||||
Foreground="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.SelPart.Calc_Background, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
|
||||
Text="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.SelPart.sCALC_MSG, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"
|
||||
Margin="5,0,5,0"
|
||||
Foreground="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.SelPart.Calc_Background, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
|
||||
<TextBlock Grid.Row="3"
|
||||
Text="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.SelPart.SelFeatureVM.sCALC_MSG, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"
|
||||
Margin="5,0,5,0"
|
||||
Foreground="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.SelPart.SelFeatureVM.Calc_Background, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
|
||||
Text="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.SelPart.SelFeatureVM.sCALC_MSG, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"
|
||||
Margin="5,0,5,0"
|
||||
Foreground="{Binding DataContext.MachGroupPanelVM.SelectedMachGroup.SelPart.SelFeatureVM.Calc_Background, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
<EgtFloating:EgtFloatingPanel x:Class="OnlyProdOptimizePanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
|
||||
IsTopDockable="True" IsBottomDockable="False" IsLeftDockable="False"
|
||||
IsRightDockable="False"
|
||||
Style="{StaticResource ToolBar_EgtFloatingPanel}">
|
||||
|
||||
<ComboBox ItemsSource="{Binding PartTypeList}"
|
||||
SelectedItem="{Binding SelPartType}"
|
||||
Height="22"
|
||||
Width="85"
|
||||
Margin="5,0,2.5,0"/>
|
||||
|
||||
<Button Content="{Binding Optimize_Msg}"
|
||||
Width="70"
|
||||
FontWeight="Light"
|
||||
Style="{StaticResource ToolBar_Button}"
|
||||
Command="{Binding Optimize_Command}"
|
||||
IsEnabled="{Binding Optimize_IsEnabled}">
|
||||
</Button>
|
||||
|
||||
<Button ToolTip="{Binding Warehouse_ToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}"
|
||||
Command="{Binding Warehouse_Command}">
|
||||
<Image Source="/Resources/OptimizePanel/Warehouse.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
@@ -0,0 +1,11 @@
|
||||
Public Class OnlyProdOptimizePanelV
|
||||
|
||||
Private Sub OptimizeBtn_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
|
||||
Dim OptimizeBtn = TryCast(sender, FrameworkElement)
|
||||
|
||||
If OptimizeBtn IsNot Nothing Then
|
||||
OptimizeBtn.ContextMenu.IsOpen = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -113,18 +113,18 @@ Public Class OptimizePanelVM
|
||||
End Property
|
||||
Public ReadOnly Property Optimize_Visibility As Visibility
|
||||
Get
|
||||
'Return If(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso
|
||||
' (Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM OrElse
|
||||
' (Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NESTING_AUTO))), Visibility.Visible, Visibility.Collapsed)
|
||||
Return If(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso
|
||||
(Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM OrElse
|
||||
(Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NESTING_AUTO))), Visibility.Visible, Visibility.Collapsed)
|
||||
|
||||
If Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso (Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM OrElse
|
||||
(Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NESTING_AUTO))) Then
|
||||
Return Visibility.Visible
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
|
||||
Return Visibility.Visible
|
||||
End If
|
||||
'If Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso (Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM OrElse
|
||||
' (Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NESTING_AUTO))) Then
|
||||
' Return Visibility.Visible
|
||||
'ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
|
||||
' Return Visibility.Visible
|
||||
'End If
|
||||
|
||||
Return Visibility.Collapsed
|
||||
'Return Visibility.Collapsed
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
@@ -11,6 +11,18 @@ Public Class ProjectVM
|
||||
|
||||
Private m_Calc_Timer As New DispatcherTimer
|
||||
|
||||
' Selezione Tab Prod / Proj
|
||||
Private m_SelProdProj As ProdProj
|
||||
Public Property SelProdProj As Integer
|
||||
Get
|
||||
Return m_SelProdProj
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_SelProdProj = value
|
||||
NotifyPropertyChanged(NameOf(SelProdProj))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property m_GridDims As New ObservableCollection(Of GridDimension)
|
||||
Public Property GridDims As ObservableCollection(Of GridDimension)
|
||||
Get
|
||||
@@ -142,7 +154,7 @@ Public Class ProjectVM
|
||||
End Property
|
||||
Friend Sub SetProjManager_Visibility(IsVisible As Boolean)
|
||||
m_ProjManager_Visibility = IsVisible
|
||||
Map.refProjManagerVM.NotifyPropertyChanged(NameOf(Map.refProjManagerVM.GoToProd_Visibility))
|
||||
If Not IsNothing(Map.refProjManagerVM) Then Map.refProjManagerVM.NotifyPropertyChanged(NameOf(Map.refProjManagerVM.GoToProd_Visibility))
|
||||
End Sub
|
||||
|
||||
Private m_ProdManager_Visibility As Boolean = True
|
||||
@@ -156,21 +168,7 @@ Public Class ProjectVM
|
||||
End Property
|
||||
Friend Sub SetProdManager_Visibility(IsVisible As Boolean)
|
||||
m_ProdManager_Visibility = IsVisible
|
||||
Map.refProdManagerVM.NotifyPropertyChanged(NameOf(Map.refProdManagerVM.GoToProj_Visibility))
|
||||
End Sub
|
||||
|
||||
Private m_OnlyProdManager_Visibility As Boolean = True
|
||||
Public Property OnlyProdManager_Visibility As Visibility
|
||||
Get
|
||||
Return If(m_OnlyProdManager_Visibility, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
m_OnlyProdManager_Visibility = (value = Visibility.Visible)
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetOnlyProdManager_Visibility(IsVisible As Boolean)
|
||||
m_OnlyProdManager_Visibility = IsVisible
|
||||
Map.refProjManagerVM.NotifyPropertyChanged(NameOf(Map.refProjManagerVM.GoToProd_Visibility))
|
||||
If Not IsNothing(Map.refProdManagerVM) Then Map.refProdManagerVM.NotifyPropertyChanged(NameOf(Map.refProdManagerVM.GoToProj_Visibility))
|
||||
End Sub
|
||||
|
||||
Private m_OptimizePanel_Visibility As Boolean = True
|
||||
@@ -212,7 +210,93 @@ Public Class ProjectVM
|
||||
NotifyPropertyChanged("FreeContourManager_Visibility")
|
||||
End Sub
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
' OnlyProdProject
|
||||
|
||||
Private m_OnlyProdManager_Visibility As Boolean = True
|
||||
Public Property OnlyProdManager_Visibility As Visibility
|
||||
Get
|
||||
Return If(m_OnlyProdManager_Visibility, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
m_OnlyProdManager_Visibility = (value = Visibility.Visible)
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetOnlyProdManager_Visibility(IsVisible As Boolean)
|
||||
m_OnlyProdManager_Visibility = IsVisible
|
||||
End Sub
|
||||
|
||||
Private m_OnlyProdLeftPanel_Visibility As Boolean = True
|
||||
Public Property OnlyProdLeftPanel_Visibility As Visibility
|
||||
Get
|
||||
Return If(m_OnlyProdLeftPanel_Visibility, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
m_OnlyProdLeftPanel_Visibility = (value = Visibility.Visible)
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetOnlyProdLeftPanel_Visibility(IsVisible As Boolean)
|
||||
m_OnlyProdLeftPanel_Visibility = IsVisible
|
||||
End Sub
|
||||
|
||||
Private m_OnlyProdOptimizePanel_Visibility As Boolean = True
|
||||
Public Property OnlyProdOptimizePanel_Visibility As Visibility
|
||||
Get
|
||||
Return If(m_OnlyProdOptimizePanel_Visibility, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
m_OnlyProdOptimizePanel_Visibility = (value = Visibility.Visible)
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetOnlyProdOptimizePanel_Visibility(IsVisible As Boolean)
|
||||
m_OnlyProdOptimizePanel_Visibility = IsVisible
|
||||
NotifyPropertyChanged(NameOf(OnlyProdOptimizePanel_Visibility))
|
||||
Map.refOptimizePanelVM.NotifyPropertyChanged(NameOf(Map.refOptimizePanelVM.CalcRotFlip_Visibility))
|
||||
Map.refOptimizePanelVM.NotifyPropertyChanged(NameOf(Map.refOptimizePanelVM.Optimize_Visibility))
|
||||
Map.refOptimizePanelVM.NotifyPropertyChanged(NameOf(Map.refOptimizePanelVM.OriginType_Visibility))
|
||||
Map.refOptimizePanelVM.NotifyPropertyChanged(NameOf(Map.refOptimizePanelVM.ViewPage_Visibility))
|
||||
Map.refOptimizePanelVM.NotifyPropertyChanged(NameOf(Map.refOptimizePanelVM.MachiningPage_Visibility))
|
||||
Map.refOptimizePanelVM.NotifyPropertyChanged(NameOf(Map.refOptimizePanelVM.NestingOption_Visibility))
|
||||
End Sub
|
||||
|
||||
Private m_CopyFeature_IsEnabled As Boolean = False
|
||||
Public Property CopyFeature_IsEnabled As Boolean
|
||||
Get
|
||||
Return m_CopyFeature_IsEnabled
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_CopyFeature_IsEnabled = value
|
||||
NotifyPropertyChanged(NameOf(CopyFeature_IsEnabled))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_MacroFeature_IsEnabled As Boolean = False
|
||||
Public Property MacroFeature_IsEnabled As Boolean
|
||||
Get
|
||||
Return m_MacroFeature_IsEnabled
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_MacroFeature_IsEnabled = value
|
||||
NotifyPropertyChanged(NameOf(MacroFeature_IsEnabled))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Definizione Comandi
|
||||
Private m_cmdCopyFeature As ICommand
|
||||
Private m_cmdMacroFeature As ICommand
|
||||
Private m_cmdAddFeature As ICommand
|
||||
Private m_cmdRemoveFeature As ICommand
|
||||
Private m_cmdProduceAllRawPart As ICommand
|
||||
Private m_cmdProduceRawPart As ICommand
|
||||
Private m_cmdCopyRawPart As ICommand
|
||||
Private m_cmdRemoveRawPart As ICommand
|
||||
Private m_cmdRemoveAllRawPart As ICommand
|
||||
Private m_cmdRemovePart As ICommand
|
||||
Private m_cmdMoveUpPart As ICommand
|
||||
Private m_cmdMoveDownPart As ICommand
|
||||
Private m_cmdReOrderPart As ICommand
|
||||
Private m_cmdMovePartInRawPart As ICommand
|
||||
|
||||
#End Region ' Fields & Properties
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
@@ -282,6 +366,31 @@ Public Class ProjectVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CopyFeature_ToolTip As String
|
||||
Get
|
||||
Return EgtMsg(61908)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property MacroFeature_ToolTip As String
|
||||
Get
|
||||
Return EgtMsg(61909)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property AddFeature_ToolTip As String
|
||||
Get
|
||||
Return EgtMsg(61910)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property RemoveFeature_ToolTip As String
|
||||
Get
|
||||
Return EgtMsg(61911)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
@@ -297,7 +406,7 @@ Public Class ProjectVM
|
||||
DimensionsIniFile.ReadGridDimensions(ProjectGridDim, GridDims)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
#End Region ' Constructor
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
@@ -458,7 +567,589 @@ Public Class ProjectVM
|
||||
NotifyCalcPanel_Visibility()
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
#End Region ' Methods
|
||||
|
||||
#Region "COMMAND"
|
||||
|
||||
#Region "CopyFeature"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property CopyFeature_Command As ICommand
|
||||
Get
|
||||
If m_cmdCopyFeature Is Nothing Then
|
||||
m_cmdCopyFeature = New Command(AddressOf CopyFeature)
|
||||
End If
|
||||
Return m_cmdCopyFeature
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub CopyFeature()
|
||||
If IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then Return
|
||||
Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart
|
||||
If IsNothing(SelPart) Then Return
|
||||
Dim SelFeature As BTLFeatureVM = SelPart.SelBTLFeatureVM
|
||||
If IsNothing(SelFeature) Then Return
|
||||
' creo copia
|
||||
Dim NewFeature = SelFeature.Copy()
|
||||
If Not IsNothing(NewFeature) Then
|
||||
SelPart.SelBTLFeatureVM = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.FirstOrDefault(Function(x) x.BTLFeatureM Is NewFeature)
|
||||
EgtDuploSetModified(SelPart.nPartId)
|
||||
End If
|
||||
SelPart.ResetCalcPart()
|
||||
End Sub
|
||||
|
||||
#End Region ' CopyFeature
|
||||
|
||||
#Region "MacroFeature"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property MacroFeature_Command As ICommand
|
||||
Get
|
||||
If m_cmdMacroFeature Is Nothing Then
|
||||
m_cmdMacroFeature = New Command(AddressOf MacroFeature)
|
||||
End If
|
||||
Return m_cmdMacroFeature
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub MacroFeature()
|
||||
If IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then Return
|
||||
If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then Return
|
||||
' apro finestra di creazione macro
|
||||
Dim MacroFeatureWndVM As New MacroFeatureWndVM()
|
||||
Dim MacroFeatureWnd As New MacroFeatureWndV(Application.Current.MainWindow, MacroFeatureWndVM)
|
||||
If MacroFeatureWnd.ShowDialog() Then
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' MacroFeature
|
||||
|
||||
#Region "AddFeature"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property AddFeature_Command As ICommand
|
||||
Get
|
||||
If m_cmdAddFeature Is Nothing Then
|
||||
m_cmdAddFeature = New Command(AddressOf AddFeature)
|
||||
End If
|
||||
Return m_cmdAddFeature
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub AddFeature(ByVal param As Object)
|
||||
If IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then Return
|
||||
If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then Return
|
||||
' apro finestra di definizione nuova feature
|
||||
Dim AddFeatureWndVM As New AddFeatureWndVM()
|
||||
Dim AddFeatureWnd As New AddFeatureWndV(Application.Current.MainWindow, AddFeatureWndVM)
|
||||
If AddFeatureWnd.ShowDialog() Then
|
||||
Dim NewFeat As BTLFeatureM
|
||||
Dim nNewFeatureId As Integer = 0
|
||||
Dim bMacroFlag As Boolean = False
|
||||
' verifico se una Macro è selezionata
|
||||
If AddFeatureWndVM.MacroList.Count > 0 AndAlso AddFeatureWndVM.nSelMacro >= 0 Then
|
||||
' Creo nuova feature sulla base della Macro selezionata
|
||||
' Creo table e setto variabili
|
||||
EgtLuaCreateGlobTable("MACRO")
|
||||
EgtLuaSetGlobNumVar("MACRO.L", Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlL)
|
||||
EgtLuaSetGlobNumVar("MACRO.W", Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlW)
|
||||
EgtLuaSetGlobNumVar("MACRO.H", Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlH)
|
||||
EgtLuaSetGlobIntVar("MACRO.PROCID", Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.NewProcId())
|
||||
Dim bOk = EgtLuaExecFile(AddFeatureWndVM.m_MacroFilePathList(AddFeatureWndVM.nSelMacro))
|
||||
' Leggo variabili
|
||||
EgtLuaGetGlobIntVar("MACRO.FEATUREID", nNewFeatureId)
|
||||
' Reset lua
|
||||
EgtLuaResetGlobVar("MACRO")
|
||||
If Not bOk Then
|
||||
MessageBox.Show(EgtMsg(61869), EgtMsg(30007))
|
||||
Return
|
||||
End If
|
||||
bMacroFlag = True
|
||||
Else
|
||||
' Creo nuova feature (Macro non selezionata)
|
||||
NewFeat = BTLFeatureM.CreateBTLFeature(AddFeatureWndVM.nSelPRC.nPRC, AddFeatureWndVM.nSelPRC.nGRP, AddFeatureWndVM.nSelPRC.nSIDE)
|
||||
NewFeat.SetDefaultValues()
|
||||
Dim vPar() As Double = Nothing
|
||||
Dim sPar As String = String.Empty
|
||||
Dim vParQ() As String = Nothing
|
||||
NewFeat.CalcParamArray(vPar, sPar, vParQ)
|
||||
' aggiorno la feature con nuovo valore
|
||||
EgtBeamSetPart(Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId)
|
||||
nNewFeatureId = EgtBeamAddProcess(NewFeat.nSelGRP, NewFeat.nPRC, NewFeat.nSelSIDE, "",
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.NewProcId(),
|
||||
New Frame3d(), vPar, sPar, vParQ, GDB_ID.NULL, GDB_ID.NULL)
|
||||
bMacroFlag = False
|
||||
End If
|
||||
' se è stata creata
|
||||
If nNewFeatureId <> GDB_ID.NULL Then
|
||||
EgtDuploSetModified(Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId)
|
||||
' la aggiungo a struttura BTL corrente
|
||||
NewFeat = BTLFeatureM.CreateBTLFeature(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM, nNewFeatureId)
|
||||
If Not bMacroFlag Then NewFeat.SetDefaultValues()
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.AddBTLFeature(NewFeat)
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.FirstOrDefault(Function(x) x.BTLFeatureM Is NewFeat)
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLPart.ResetCalcPart()
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' AddFeature
|
||||
|
||||
#Region "RemoveFeature"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property RemoveFeature_Command As ICommand
|
||||
Get
|
||||
If m_cmdRemoveFeature Is Nothing Then
|
||||
m_cmdRemoveFeature = New Command(AddressOf RemoveFeature)
|
||||
End If
|
||||
Return m_cmdRemoveFeature
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub RemoveFeature()
|
||||
If IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then Return
|
||||
If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then Return
|
||||
If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM) Then Return
|
||||
If EgtBeamEraseProcess(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM.nFeatureId) Then
|
||||
EgtDuploSetModified(Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId)
|
||||
' rimuovo dalla lista feature
|
||||
Dim Index As Integer = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.IndexOf(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM)
|
||||
If Index = 0 Then
|
||||
If Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.Count > 0 Then
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList(0)
|
||||
Else
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Nothing
|
||||
End If
|
||||
ElseIf Index = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.Count - 1 Then
|
||||
If Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.Count > 1 Then
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.Count - 2)
|
||||
Else
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Nothing
|
||||
End If
|
||||
Else
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList(Index - 1)
|
||||
End If
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.RemoveAt(Index)
|
||||
EgtDraw()
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLPart.ResetCalcPart()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' RemoveFeature
|
||||
|
||||
#Region "ProduceRawPart"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property ProduceRawPart_Command As ICommand
|
||||
Get
|
||||
If m_cmdProduceRawPart Is Nothing Then
|
||||
m_cmdProduceRawPart = New Command(AddressOf ProduceRawPart)
|
||||
End If
|
||||
Return m_cmdProduceRawPart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub ProduceRawPart()
|
||||
If IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then Return
|
||||
Dim ErrorMsg As String = ""
|
||||
' se attiva opzione e non ancora calcolato
|
||||
If GetMainPrivateProfileInt(S_GENERAL, K_FASTPRODUCE, 0) = 1 And Map.refMachGroupPanelVM.SelectedMachGroup.nGlobalState = CalcStates.NOTCALCULATED Then
|
||||
Map.refCALCPanelVM.SetFromProduce(CALCPanelVM.ProduceType.PRODUCE)
|
||||
Map.refCALCPanelVM.Verify()
|
||||
Return
|
||||
End If
|
||||
If Not Produce(Map.refMachGroupPanelVM.SelectedMachGroup, ErrorMsg) AndAlso Not String.IsNullOrWhiteSpace(ErrorMsg) Then
|
||||
MessageBox.Show(ErrorMsg)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function Produce(MachGroup As MyMachGroupVM, ByRef ErrorMsg As String) As Boolean
|
||||
If IsNothing(MachGroup) Then Return False
|
||||
' se barra gia' assegnata a supervisore, esco
|
||||
If MachGroup.nProduction_State >= ItemState.Assigned Then Return False
|
||||
If MachGroup.nGlobalState = CalcStates.OK Or MachGroup.nGlobalState = CalcStates.INFO Then
|
||||
' se ci sono modifiche, salvo il pogetto
|
||||
If EgtGetModified() Then
|
||||
Map.refOnlyProdManagerVM.Save()
|
||||
End If
|
||||
' mando al supervisore
|
||||
DbControllers.m_MachGroupController.UpdateOrder(Map.refOnlyProdManagerVM.CurrProd.nProdId, MachGroup.Id, DbControllers.m_MachGroupController.GetMinIndex(Map.refOnlyProdManagerVM.CurrProd.nProdId) + 1)
|
||||
DbControllers.m_MachGroupController.UpdateSupervisor(Map.refOnlyProdManagerVM.CurrProd.nProdId, MachGroup.Id, DbControllers.m_SupervisorId)
|
||||
MachGroup.SentToSupervisor()
|
||||
For Each Part As PartVM In MachGroup.PartVMList
|
||||
DbControllers.m_PartController.UpdateStatus(Map.refOnlyProdManagerVM.CurrProd.nProdId, MachGroup.Id, Part.nPartId, ItemState.Assigned)
|
||||
Part.nProduction_State = ItemState.Assigned
|
||||
Part.NotifyPropertyChanged(NameOf(Part.Background))
|
||||
' disabilito impostazione modificato
|
||||
Dim DisableMgr As New DisableModifiedMgr
|
||||
' blocco modifica del pezzo
|
||||
EgtDuploSetLocked(Part.nPartId)
|
||||
' ripristino precedente impostazione modificato
|
||||
DisableMgr.ReEnable()
|
||||
Next
|
||||
Return True
|
||||
Else
|
||||
ErrorMsg = String.Format("Impossible sending {0} to supervisor because not machinable!", MachGroup.Name)
|
||||
'MessageBox.Show(String.Format("Impossible sending {0} to supervisor because it is not machinable!", MachGroup.Name))
|
||||
Return False
|
||||
End If
|
||||
End Function
|
||||
|
||||
#End Region ' ProduceRawPart
|
||||
|
||||
#Region "ProduceAllRawPart"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property ProduceAllRawPart_Command As ICommand
|
||||
Get
|
||||
If m_cmdProduceAllRawPart Is Nothing Then
|
||||
m_cmdProduceAllRawPart = New Command(AddressOf ProduceAllRawPart)
|
||||
End If
|
||||
Return m_cmdProduceAllRawPart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub ProduceAllRawPart()
|
||||
If IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then Return
|
||||
' se attiva opzione e non ancora calcolato
|
||||
If GetMainPrivateProfileInt(S_GENERAL, K_FASTPRODUCE, 0) = 1 And Map.refMachGroupPanelVM.MachGroupVMList.Any(Function(x As MyMachGroupVM) x.nProduction_State = ItemState.ND AndAlso x.nGlobalState = CalcStates.NOTCALCULATED) Then
|
||||
Map.refCALCPanelVM.SetFromProduce(CALCPanelVM.ProduceType.PRODUCEALL)
|
||||
Map.refCALCPanelVM.VerifyAll()
|
||||
Return
|
||||
End If
|
||||
If Map.refMachGroupPanelVM.MachGroupVMList.Count > 0 Then
|
||||
Dim MachgroupErrorList As New List(Of MachGroupVM)
|
||||
For Each Machgroup In Map.refMachGroupPanelVM.MachGroupVMList
|
||||
Dim ErrorMsg As String = ""
|
||||
If Not Produce(Machgroup, ErrorMsg) AndAlso Not String.IsNullOrWhiteSpace(ErrorMsg) Then
|
||||
MachgroupErrorList.Add(Machgroup)
|
||||
End If
|
||||
Next
|
||||
If MachgroupErrorList.Count > 0 Then
|
||||
Dim sMachGroups As String = ""
|
||||
For Each MachGroup In MachgroupErrorList
|
||||
sMachGroups &= " " & MachGroup.Name & ","
|
||||
Next
|
||||
sMachGroups = sMachGroups.Trim({" "c, ","c})
|
||||
MessageBox.Show(String.Format("Impossible sending {0} to supervisor because not machinable!", sMachGroups))
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' ProduceAllRawPart
|
||||
|
||||
#Region "CopyRawPart"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property CopyRawPart_Command As ICommand
|
||||
Get
|
||||
If m_cmdCopyRawPart Is Nothing Then
|
||||
m_cmdCopyRawPart = New Command(AddressOf CopyRawPart)
|
||||
End If
|
||||
Return m_cmdCopyRawPart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub CopyRawPart()
|
||||
If IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then Return
|
||||
Dim nQty As Integer = 1
|
||||
' se premuto shift
|
||||
If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
|
||||
Dim MultiCopyRawPartWndVM As New MultiCopyRawPartWndVM()
|
||||
Dim MultiCopyRawPartWnd As New MultiCopyRawPartWndV(Application.Current.MainWindow, MultiCopyRawPartWndVM)
|
||||
If Not MultiCopyRawPartWnd.ShowDialog() Then Return
|
||||
nQty = MultiCopyRawPartWndVM.nQuantity
|
||||
End If
|
||||
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
|
||||
If IsNothing(SelMachGroup) Then Return
|
||||
' creo copia
|
||||
Dim NewMachGroup As MyMachGroupVM = SelMachGroup.Copy(nQty)
|
||||
If Not IsNothing(NewMachGroup) Then
|
||||
' lo seleziono
|
||||
Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup = NewMachGroup
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' CopyRawPart
|
||||
|
||||
#Region "RemoveRawPart"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property RemoveRawPart_Command As ICommand
|
||||
Get
|
||||
If m_cmdRemoveRawPart Is Nothing Then
|
||||
m_cmdRemoveRawPart = New Command(AddressOf RemoveRawPartCmd)
|
||||
End If
|
||||
Return m_cmdRemoveRawPart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub RemoveRawPartCmd()
|
||||
RemoveRawPart()
|
||||
End Sub
|
||||
|
||||
Public Sub RemoveRawPart(Optional bAll As Boolean = False)
|
||||
If IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then Return
|
||||
' se tutti
|
||||
If bAll Then
|
||||
' cancello tutti
|
||||
For Index = Map.refMachGroupPanelVM.MachGroupVMList.Count - 1 To 0 Step -1
|
||||
Dim CurrMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.MachGroupVMList(Index)
|
||||
' se barra gia' assegnata a supervisore, esco
|
||||
If CurrMachGroup.nProduction_State >= ItemState.Assigned Then Continue For
|
||||
CurrMachGroup.DeleteMachGroup(True)
|
||||
Next
|
||||
Else
|
||||
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
|
||||
If IsNothing(SelMachGroup) Then Return
|
||||
' se barra gia' assegnata a supervisore, esco
|
||||
If SelMachGroup.nProduction_State >= ItemState.Assigned Then Return
|
||||
SelMachGroup.DeleteMachGroup()
|
||||
End If
|
||||
EgtDraw()
|
||||
' se nessun grezzo, rimetto tutti i pezzi invisibili
|
||||
If Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.Count = 0 Then
|
||||
Map.refProjectVM.BTLStructureVM.HideAll(True)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' RemoveRawPart
|
||||
|
||||
#Region "RemoveAllRawPart"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property RemoveAllRawPart_Command As ICommand
|
||||
Get
|
||||
If m_cmdRemoveAllRawPart Is Nothing Then
|
||||
m_cmdRemoveAllRawPart = New Command(AddressOf RemoveAllRawPart)
|
||||
End If
|
||||
Return m_cmdRemoveAllRawPart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub RemoveAllRawPart()
|
||||
RemoveRawPart(True)
|
||||
End Sub
|
||||
|
||||
#End Region ' RemoveRawPart
|
||||
|
||||
#Region "RemovePart"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property RemovePart_Command As ICommand
|
||||
Get
|
||||
If m_cmdRemovePart Is Nothing Then
|
||||
m_cmdRemovePart = New Command(AddressOf RemovePart)
|
||||
End If
|
||||
Return m_cmdRemovePart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub RemovePart()
|
||||
If IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then Return
|
||||
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
|
||||
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
|
||||
SelPart.DeletePart()
|
||||
SelMachGroup.UpdateUsage()
|
||||
SelMachGroup.ResetCalcMachGroup()
|
||||
End Sub
|
||||
|
||||
#End Region ' RemovePart
|
||||
|
||||
#Region "MoveUpPart"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property MoveUpPart_Command As ICommand
|
||||
Get
|
||||
If m_cmdMoveUpPart Is Nothing Then
|
||||
m_cmdMoveUpPart = New Command(AddressOf MoveUpPart)
|
||||
End If
|
||||
Return m_cmdMoveUpPart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub MoveUpPart()
|
||||
If IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then Return
|
||||
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
|
||||
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
|
||||
If SelMachGroup.nType = MachineType.BEAM Then
|
||||
SelMachGroup.MoveBeam(SelPart, MoveDirections.UP)
|
||||
EgtDraw()
|
||||
' riseleziono trave
|
||||
SelMachGroup.SelPart = SelPart
|
||||
End If
|
||||
SelMachGroup.ResetCalcMachGroup()
|
||||
End Sub
|
||||
|
||||
#End Region ' MoveUpPart
|
||||
|
||||
#Region "MoveDownPart"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property MoveDownPart_Command As ICommand
|
||||
Get
|
||||
If m_cmdMoveDownPart Is Nothing Then
|
||||
m_cmdMoveDownPart = New Command(AddressOf MoveDownPart)
|
||||
End If
|
||||
Return m_cmdMoveDownPart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub MoveDownPart()
|
||||
If IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then Return
|
||||
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
|
||||
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
|
||||
If SelMachGroup.nType = MachineType.BEAM Then
|
||||
SelMachGroup.MoveBeam(SelPart, MoveDirections.DOWN)
|
||||
EgtDraw()
|
||||
' riseleziono trave
|
||||
SelMachGroup.SelPart = SelPart
|
||||
End If
|
||||
SelMachGroup.ResetCalcMachGroup()
|
||||
End Sub
|
||||
|
||||
#End Region ' MoveDownPart
|
||||
|
||||
#Region "ReOrderPart"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property ReOrderPart_Command As ICommand
|
||||
Get
|
||||
If m_cmdReOrderPart Is Nothing Then
|
||||
m_cmdReOrderPart = New Command(AddressOf ReOrderPart)
|
||||
End If
|
||||
Return m_cmdReOrderPart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub ReOrderPart()
|
||||
If IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then Return
|
||||
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
|
||||
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
|
||||
If SelMachGroup.nType = MachineType.BEAM Then
|
||||
SelMachGroup.ReorderBeam()
|
||||
EgtDraw()
|
||||
' riseleziono trave
|
||||
If Not IsNothing(SelPart) Then
|
||||
SelMachGroup.SelPart = SelPart
|
||||
End If
|
||||
End If
|
||||
SelMachGroup.ResetCalcMachGroup()
|
||||
End Sub
|
||||
|
||||
#End Region ' ReOrderPart
|
||||
|
||||
#Region "MovePartInRawPart"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property MovePartInRawPart_Command As ICommand
|
||||
Get
|
||||
If m_cmdMovePartInRawPart Is Nothing Then
|
||||
m_cmdMovePartInRawPart = New Command(AddressOf MovePartInRawPart)
|
||||
End If
|
||||
Return m_cmdMovePartInRawPart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub MovePartInRawPart()
|
||||
If IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then Return
|
||||
Dim MovePartInRawPartWndVM As New MovePartInRawPartWndVM()
|
||||
Dim MovePartInRawPartWnd As New MovePartInRawPartWndV(Application.Current.MainWindow, MovePartInRawPartWndVM)
|
||||
If Not MovePartInRawPartWnd.ShowDialog() Then Return
|
||||
End Sub
|
||||
|
||||
#End Region ' MovePartInRawPart
|
||||
|
||||
|
||||
#End Region ' Command
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
@@ -154,17 +154,22 @@ Public Class ProdFileVM
|
||||
Directory.Delete(sProjectDirPath, True)
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
Map.refProdManagerVM.m_MruFiles.Remove(CurrProject.sProdPath)
|
||||
Map.refProdManagerVM.NotifyPropertyChanged(NameOf(Map.refProdManagerVM.MruFileNames))
|
||||
If Not IsNothing(Map.refProdManagerVM) Then
|
||||
Map.refProdManagerVM.m_MruFiles.Remove(CurrProject.sProdPath)
|
||||
Map.refProdManagerVM.NotifyPropertyChanged(NameOf(Map.refProdManagerVM.MruFileNames))
|
||||
ElseIf Not IsNothing(Map.refOnlyProdManagerVM) Then
|
||||
Map.refOnlyProdManagerVM.m_MruFiles.Remove(CurrProject.sProdPath)
|
||||
Map.refOnlyProdManagerVM.NotifyPropertyChanged(NameOf(Map.refProdManagerVM.MruFileNames))
|
||||
End If
|
||||
DbControllers.m_ProdController.DeleteProd(CurrProject.nProdId, False)
|
||||
If CurrProject.nProdId = Map.refProjManagerVM.CurrProj.nProdId Then
|
||||
If CurrProject.nProdId = Map.refProjManagerVM.CurrProj.nProdId OrElse CurrProject.nProdId = Map.refOnlyProdManagerVM.CurrProj.nProdId Then
|
||||
' reset prod in path proj
|
||||
Map.refProjManagerVM.UpdateCurrProj()
|
||||
End If
|
||||
Map.refProdManagerVM.CurrProd = Nothing
|
||||
EgtResetModified()
|
||||
Return MessageBoxResult.No
|
||||
End If
|
||||
EgtResetModified()
|
||||
Return MessageBoxResult.No
|
||||
End If
|
||||
End Select
|
||||
Else
|
||||
EgtResetModified()
|
||||
|
||||
@@ -35,8 +35,10 @@ Public Class ProjectTypeWndVM
|
||||
End Property
|
||||
|
||||
' Se la Macchina selezionata è di tipo BOTH verrà mostrata anche la selezione del Tipo
|
||||
Private m_IsBoth_Visibility As Visibility = If(Not IsNothing(Map.refProjManagerVM.CurrProj) AndAlso
|
||||
DirectCast(SelMachine, MyMachine).nType = MachineType.BOTH, Visibility.Visible, Visibility.Collapsed)
|
||||
'Private m_IsBoth_Visibility As Visibility = If (Not IsNothing(Map.refProjManagerVM.CurrProj) AndAlso
|
||||
' DirectCast(SelMachine, MyMachine).nType = MachineType.BOTH, Visibility.Visible, Visibility.Collapsed)
|
||||
Private m_IsBoth_Visibility As Visibility = If(Not IsNothing(Map.refProjManagerVM) AndAlso Not IsNothing(Map.refProjManagerVM.CurrProj) AndAlso
|
||||
DirectCast(SelMachine, MyMachine).nType = MachineType.BOTH OrElse Not IsNothing(Map.refOnlyProdManagerVM) AndAlso Not IsNothing(Map.refOnlyProdManagerVM.CurrProd), Visibility.Visible, Visibility.Collapsed)
|
||||
Public Property IsBoth_Visibility As Visibility
|
||||
Get
|
||||
Return m_IsBoth_Visibility
|
||||
@@ -57,7 +59,7 @@ Public Class ProjectTypeWndVM
|
||||
End Property
|
||||
|
||||
' Se la Macchina selezionata è di tipo BOTH verrà selezionato di default il Tipo del progetto corrente
|
||||
Private m_nSelType As BWType = If(Not IsNothing(Map.refProjManagerVM.CurrProj) AndAlso
|
||||
Private m_nSelType As BWType = If(Not IsNothing(Map.refProjManagerVM) AndAlso Not IsNothing(Map.refProjManagerVM.CurrProj) AndAlso Not IsNothing(Map.refOnlyProdManagerVM) AndAlso Not IsNothing(Map.refOnlyProdManagerVM.CurrProj) AndAlso
|
||||
DirectCast(SelMachine, MyMachine).nType = MachineType.BOTH, Map.refProjManagerVM.CurrProj.nType, Nothing)
|
||||
Public Property nSelType As BWType
|
||||
Get
|
||||
|
||||
@@ -557,9 +557,9 @@ Public Class MySceneHostVM
|
||||
Map.refCALCPanelVM.LoadMachineList()
|
||||
ElseIf ProjectType = ProjectType.PROD Then
|
||||
' se salvato, carico progetto in lista mru
|
||||
If Not IsNothing(Map.refProdManagerVM.TempCurrProd) AndAlso Not Map.refProdManagerVM.TempCurrProd.bIsNew Then
|
||||
If Not IsNothing(Map.refProdManagerVM) AndAlso Not IsNothing(Map.refProdManagerVM.TempCurrProd) AndAlso Not Map.refProdManagerVM.TempCurrProd.bIsNew Then
|
||||
Map.refProdManagerVM.m_MruFiles.Add(sFile)
|
||||
ElseIf Not IsNothing(Map.refOnlyProdManagerVM.TempCurrProd) AndAlso Not Map.refOnlyProdManagerVM.TempCurrProd.bIsNew Then
|
||||
ElseIf Not IsNothing(Map.refOnlyProdManagerVM) AndAlso Not IsNothing(Map.refOnlyProdManagerVM.TempCurrProd) AndAlso Not Map.refOnlyProdManagerVM.TempCurrProd.bIsNew Then
|
||||
Map.refOnlyProdManagerVM.m_MruFiles.Add(sFile)
|
||||
End If
|
||||
' imposto macchina del progetto
|
||||
@@ -571,9 +571,9 @@ Public Class MySceneHostVM
|
||||
Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refProdManagerVM.TempCurrProd.sMachine),
|
||||
Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refProjManagerVM.CurrProj.sMachine))
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
|
||||
Map.refMachinePanelVM.SelectedMachine = If(Not IsNothing(Map.refProdManagerVM.TempCurrProd),
|
||||
Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refProdManagerVM.TempCurrProd.sMachine),
|
||||
Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refOnlyProdManagerVM.CurrProd.sMachine))
|
||||
Map.refMachinePanelVM.SelectedMachine = If(Not IsNothing(Map.refOnlyProdManagerVM.TempCurrProd),
|
||||
Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refOnlyProdManagerVM.CurrProd.sMachine),
|
||||
Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refProdManagerVM.TempCurrProd.sMachine))
|
||||
End If
|
||||
SectionXMaterial.SetType(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
Core.ViewPanelVM.UpdateBWType(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
@@ -582,16 +582,16 @@ Public Class MySceneHostVM
|
||||
Map.refFeatureInPartInRawPartListVM.UpdateColumns(CurrentMachine.nType)
|
||||
If Not IsNothing(Map.refTopPanelVM) Then
|
||||
Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE <> BWType.BEAM)
|
||||
Else
|
||||
Map.refProjectVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE <> BWType.BEAM)
|
||||
'Else
|
||||
' Map.refProjectVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE <> BWType.BEAM)
|
||||
End If
|
||||
Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
If Not IsNothing(Map.refProdManagerVM.TempCurrProd) Then
|
||||
'Map.refProdManagerVM.CurrProd = Map.refProdManagerVM.TempCurrProd
|
||||
CurrProd = Map.refProdManagerVM.TempCurrProd
|
||||
ElseIf Not IsNothing(Map.refOnlyProdManagerVM.TempCurrProd) Then
|
||||
'Map.refFullCompleteManagerVM.CurrProd = Map.refFullCompleteManagerVM.TempCurrProd
|
||||
CurrProd = Map.refOnlyProdManagerVM.TempCurrProd
|
||||
If Not IsNothing(Map.refProdManagerVM) AndAlso Not IsNothing(Map.refProdManagerVM.TempCurrProd) Then
|
||||
'Map.refProdManagerVM.CurrProd = Map.refProdManagerVM.TempCurrProd
|
||||
CurrProd = Map.refProdManagerVM.TempCurrProd
|
||||
ElseIf Not IsNothing(Map.refOnlyProdManagerVM) AndAlso Not IsNothing(Map.refOnlyProdManagerVM.TempCurrProd) Then
|
||||
'Map.refFullCompleteManagerVM.CurrProd = Map.refFullCompleteManagerVM.TempCurrProd
|
||||
CurrProd = Map.refOnlyProdManagerVM.TempCurrProd
|
||||
End If
|
||||
'DbControllers.m_ProdController.LockByProdId(Map.refProdManagerVM.CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
|
||||
DbControllers.m_ProdController.LockByProdId(CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
|
||||
@@ -689,7 +689,13 @@ Public Class MySceneHostVM
|
||||
If Not IsNothing(PjFileVM.ProjFileM) AndAlso Not IsNothing(PjFileVM.sProjPath) Then Map.refProjManagerVM.m_MruFiles.Add(PjFileVM.sProjPath)
|
||||
End If
|
||||
End If
|
||||
If ProjectType = ProjectType.PROD Then Map.refProdManagerVM.m_MruFiles.Add(sFile)
|
||||
If ProjectType = ProjectType.PROD Then
|
||||
If Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso Not IsNothing(Map.refProdManagerVM) Then
|
||||
Map.refProdManagerVM.m_MruFiles.Add(sFile)
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Not IsNothing(Map.refOnlyProdManagerVM) Then
|
||||
Map.refOnlyProdManagerVM.m_MruFiles.Add(sFile)
|
||||
End If
|
||||
End If
|
||||
' Salvo nome ultimo file
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_LASTPROJ, sFile)
|
||||
End Sub
|
||||
@@ -737,12 +743,16 @@ Public Class MySceneHostVM
|
||||
' scrivo info proj e type su layer BtlInfo
|
||||
Dim nBTLInfoLayer As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
||||
EgtSetInfo(nBTLInfoLayer, BTL_PRT_PROJ, Map.refProjManagerVM.nLoadingProjId)
|
||||
EgtSetInfo(nBTLInfoLayer, BTL_GEN_PROJTYPE, Map.refProjManagerVM.CurrProj.nType)
|
||||
If Not IsNothing(Map.refProjManagerVM.CurrProj) Then
|
||||
EgtSetInfo(nBTLInfoLayer, BTL_GEN_PROJTYPE, Map.refProjManagerVM.CurrProj.nType)
|
||||
Else
|
||||
EgtSetInfo(nBTLInfoLayer, BTL_GEN_PROJTYPE, Map.refOnlyProdManagerVM.CurrProd.nType)
|
||||
End If
|
||||
' scrivo info proj su layer AsseBase
|
||||
Dim nAsseBaseLayer As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, ASSEBASE)
|
||||
EgtSetInfo(nAsseBaseLayer, BTL_PRT_PROJ, Map.refProjManagerVM.nLoadingProjId)
|
||||
Else
|
||||
Dim sMsg As String = EgtMsg(10006) & " '" & sFile & "'" 'Error importing file
|
||||
EgtSetInfo(nAsseBaseLayer, BTL_PRT_PROJ, Map.refProjManagerVM.nLoadingProjId)
|
||||
Else
|
||||
Dim sMsg As String = EgtMsg(10006) & " '" & sFile & "'" 'Error importing file
|
||||
MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error
|
||||
Map.refProjManagerVM.NewProject()
|
||||
End If
|
||||
|
||||
@@ -170,7 +170,7 @@ Public Class ShowBeamPanelVM
|
||||
Map.refProjectVM.BTLStructureVM.SetSelectionType(BTLStructureVM.SelectionTypes.NULL)
|
||||
Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProjectVM.PartManager_Visibility))
|
||||
' mostro in parte bassa dati BTL
|
||||
Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.STRUCTURE_)
|
||||
If Not IsNothing(Map.refBottomPanelVM) Then Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.STRUCTURE_)
|
||||
' mostro tutti i pezzi
|
||||
Map.refProjectVM.BTLStructureVM.ShowAll(False)
|
||||
' deseleziono tutto
|
||||
|
||||
Reference in New Issue
Block a user