Compare commits

...

17 Commits

Author SHA1 Message Date
Demetrio Cassarino a6cd836e0d -aggiornato grafica visualizzazione colonne rotazione, inversione 2024-02-23 14:44:44 +01:00
Demetrio Cassarino fbb0e948b3 -aggiunto controllo su visualizzazione rotazione e inversione su nuova pagina 2024-02-23 11:10:41 +01:00
Demetrio Cassarino 9bb1b49883 -aggiornato nomi macro list 2024-02-23 09:38:34 +01:00
Demetrio Cassarino 5d4bd85f85 -aggiornato nomi variabili macro 2024-02-22 17:46:42 +01:00
Demetrio Cassarino 8169b5298a -pulizia codice
-aggornato lista maco custom
2024-02-22 16:58:17 +01:00
Demetrio Cassarino cfda9196be -aggiunto all'aggiunta di una nova macro, la macro custom
-aggiunta nuove finestre NewMacroFeatureWnd e NewAddFeatureWnd
-ripristinato SpecialPanel per OnlyProdPage
2024-02-20 17:16:51 +01:00
Demetrio Cassarino d5a2a25ade -aggiunto processo Variant 2024-02-13 09:58:35 +01:00
Demetrio Cassarino f6641c858e -cambio nome pagina nuova feature 2024-02-12 16:45:46 +01:00
Demetrio Cassarino 6fe32752e1 -Ottimizzato codice aggiunta nuova macro 2024-02-12 16:44:33 +01:00
Demetrio Cassarino 4fead794f3 - creato nuova pagina aggiungi nuova feature,
-creato macro con relativi template
2024-02-09 17:12:30 +01:00
Demetrio Cassarino 827c955d1d -modifica finestra feature con templete macro 2024-02-01 17:08:34 +01:00
Demetrio Cassarino 8b96a07386 - pulizia codice
- aggoirnato controllo su errore script aggiunta nuovo pezzo
2024-01-31 12:03:54 +01:00
Demetrio Cassarino 3d957138ee -aggiunto controllo su errore esecuzione execbeam
-aggiunto messaggio per rotazione e inversione
2024-01-24 17:22:54 +01:00
Demetrio Cassarino c38f9305c6 -aggiornata funzione addpart 2024-01-24 12:24:58 +01:00
Demetrio Cassarino f34b58a636 -aggiornato controllo newrawpart 2024-01-24 12:10:44 +01:00
Demetrio Cassarino 138499fdf4 -gestito controllo sul proj 2024-01-24 11:40:25 +01:00
Demetrio Cassarino edfe32daed -sistemato controlli funzioni 2024-01-24 10:47:36 +01:00
45 changed files with 970 additions and 643 deletions
+7 -6
View File
@@ -316,12 +316,13 @@ Public Class BTLFeatureM
End Function End Function
Public Shared Function CreateBTLFeature(nPRC As Integer, nGRP As Integer, nSIDE As Integer) As BTLFeatureM Public Shared Function CreateBTLFeature(nPRC As Integer, nGRP As Integer, nSIDE As Integer) As BTLFeatureM
Dim NewBTLFeature As New BTLFeatureM Dim NewBTLFeature As New BTLFeatureM With {
NewBTLFeature.m_nPRC = nPRC .m_nPRC = nPRC,
NewBTLFeature.m_nSelGRP = nGRP .m_nSelGRP = nGRP,
NewBTLFeature.m_nSelSIDE = nSIDE .m_nSelSIDE = nSIDE,
NewBTLFeature.m_nPriority = 0 .m_nPriority = 0,
NewBTLFeature.m_bDO = True .m_bDO = True
}
' crea parametri per questa feature da file ini ' crea parametri per questa feature da file ini
NewBTLFeature.CreateFeatureParams(NewBTLFeature) NewBTLFeature.CreateFeatureParams(NewBTLFeature)
Return NewBTLFeature Return NewBTLFeature
+3 -1
View File
@@ -68,7 +68,9 @@ Public Module ConstGen
' Sottodirettorio per Csv automatico ' Sottodirettorio per Csv automatico
Public Const PRODS_DIR As String = "Prods" Public Const PRODS_DIR As String = "Prods"
' Sottodirettorio per Macro ' Sottodirettorio per Macro
Public Const MACRO_DIR As String = "Macro" Public Const MACRODEFAULT_DIR As String = "MacroDefault"
' Sottodirettorio per MacroCustom
Public Const MACROCUSTOM_DIR As String = "MacroCustom"
' Sottodirettorio per Magazzino ' Sottodirettorio per Magazzino
Public Const WAREHOUSE_DIR As String = "Warehouse" Public Const WAREHOUSE_DIR As String = "Warehouse"
' Sottodirettorio per lavorazioni travi ' Sottodirettorio per lavorazioni travi
+2 -2
View File
@@ -482,6 +482,8 @@ Public Class PartM
EgtGetInfo(nPartId, BTL_PRT_GROUP, NewPartM.m_sGROUP) EgtGetInfo(nPartId, BTL_PRT_GROUP, NewPartM.m_sGROUP)
EgtGetInfo(nPartId, BTL_PRT_STOREY, NewPartM.m_sSTOREY) EgtGetInfo(nPartId, BTL_PRT_STOREY, NewPartM.m_sSTOREY)
EgtGetInfo(nPartId, BTL_PRT_MATERIAL, NewPartM.m_sMATERIAL) EgtGetInfo(nPartId, BTL_PRT_MATERIAL, NewPartM.m_sMATERIAL)
EgtGetInfo(nPartId, MGR_PRT_ROT, NewPartM.m_dROT)
EgtGetInfo(nPartId, MGR_PRT_FLIP, NewPartM.m_nFLIP)
Dim nTemp As Integer = 0 Dim nTemp As Integer = 0
If Not EgtGetInfo(nPartId, BTL_PRT_ROTATED, nTemp) Then If Not EgtGetInfo(nPartId, BTL_PRT_ROTATED, nTemp) Then
nTemp = 0 nTemp = 0
@@ -514,8 +516,6 @@ Public Class PartM
' leggo PosX, PosY, Rot e Flip ' leggo PosX, PosY, Rot e Flip
EgtGetInfo(nPartId, MGR_PRT_POSX, NewPartM.m_dPOSX) EgtGetInfo(nPartId, MGR_PRT_POSX, NewPartM.m_dPOSX)
EgtGetInfo(nPartId, MGR_PRT_POSY, NewPartM.m_dPOSY) EgtGetInfo(nPartId, MGR_PRT_POSY, NewPartM.m_dPOSY)
EgtGetInfo(nPartId, MGR_PRT_ROT, NewPartM.m_dROT)
EgtGetInfo(nPartId, MGR_PRT_FLIP, NewPartM.m_nFLIP)
End If End If
' leggo volume ' leggo volume
If Not EgtGetInfo(nPartId, BTL_PRT_VOLUME, NewPartM.dVolume) Then If Not EgtGetInfo(nPartId, BTL_PRT_VOLUME, NewPartM.dVolume) Then
@@ -1,11 +1,9 @@
Imports System.Collections.ObjectModel Imports System.Collections.ObjectModel
Imports System.Collections.Specialized Imports System.Collections.Specialized
Imports System.ComponentModel Imports System.ComponentModel
Imports System.IO
Imports System.Windows Imports System.Windows
Imports System.Windows.Input Imports System.Windows.Input
Imports System.Windows.Media Imports System.Windows.Media
Imports EgtBEAMWALL.Core
Imports EgtUILib Imports EgtUILib
Imports EgtWPFLib5 Imports EgtWPFLib5
@@ -27,7 +27,6 @@
<RowDefinition Height="1*"/> <RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid HorizontalAlignment="Center" <Grid HorizontalAlignment="Center"
Grid.Row="0" Grid.Row="0"
Margin="0,0,0,5"> Margin="0,0,0,5">
@@ -46,13 +45,14 @@
Grid.Column="1" Grid.Column="1"
DisplayMemberPath="ghDesc" DisplayMemberPath="ghDesc"
Width="200" Width="200"
HorizontalAlignment="Left"
Style="{StaticResource FeatureComboBox}"/> Style="{StaticResource FeatureComboBox}"/>
<TextBlock Text="Macro" <TextBlock Text="Macro"
Grid.Row="1" Grid.Row="1"
Margin="0,5,0,0" Margin="0,5,0,0"
Style="{StaticResource OptionTextBlock}"/> Style="{StaticResource OptionTextBlock}"/>
<ComboBox ItemsSource="{Binding MacroList}" <ComboBox ItemsSource="{Binding MacroCustomList}"
SelectedIndex="{Binding nSelMacro}" SelectedIndex="{Binding nSelMacroCustom}"
Grid.Row="1" Grid.Row="1"
Grid.Column="1" Grid.Column="1"
DisplayMemberPath="Name" DisplayMemberPath="Name"
@@ -66,7 +66,6 @@
Height="300" Height="300"
Width="300" Width="300"
Margin="5,0,5,5"/> Margin="5,0,5,5"/>
<!--<StackPanel Orientation="Horizontal" <!--<StackPanel Orientation="Horizontal"
HorizontalAlignment="Center" HorizontalAlignment="Center"
Grid.Row="2" Grid.Row="2"
@@ -84,7 +83,6 @@
<TextBlock Text="{Binding sName}" <TextBlock Text="{Binding sName}"
Style="{StaticResource OptionTextBlock}"/> Style="{StaticResource OptionTextBlock}"/>
</StackPanel>--> </StackPanel>-->
<Grid Grid.Row="2" Margin="0,0,0,5"> <Grid Grid.Row="2" Margin="0,0,0,5">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
@@ -94,18 +92,16 @@
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Button Content="Ok" <Button Content="Ok"
Command="{Binding Ok_Command}" Command="{Binding Ok_Command}"
IsDefault="True" IsDefault="True"
Grid.Column="1" Grid.Column="1"
Style="{StaticResource EgtWPFLib5_InputButton}"/> Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Button Content="Cancel" <Button Content="Cancel"
IsCancel="True" IsCancel="True"
Grid.Column="3" Grid.Column="3"
Style="{StaticResource EgtWPFLib5_InputButton}"/> Style="{StaticResource EgtWPFLib5_InputButton}"/>
</Grid> </Grid>
</Grid> </Grid>
</Border> </Border>
</StackPanel> </StackPanel>
</EgtWPFLib5:EgtCustomWindow> </EgtWPFLib5:EgtCustomWindow>
@@ -11,6 +11,7 @@ Public Class AddFeatureWndVM
Friend Event m_CloseWindow(bDialogResult As Boolean) Friend Event m_CloseWindow(bDialogResult As Boolean)
Friend m_MacroFilePathList As List(Of String) Friend m_MacroFilePathList As List(Of String)
Friend m_MacroCustomFilePathList As List(Of String)
Private m_PrevSelPRCIndex_L As Integer = 0 Private m_PrevSelPRCIndex_L As Integer = 0
Private m_PrevSelPRCIndex_T As Integer = 0 Private m_PrevSelPRCIndex_T As Integer = 0
@@ -37,8 +38,8 @@ Public Class AddFeatureWndVM
ElseIf m_SelGRPType = GRPType.T Then ElseIf m_SelGRPType = GRPType.T Then
nSelPRC = PRCList(m_PrevSelPRCIndex_T) nSelPRC = PRCList(m_PrevSelPRCIndex_T)
End If End If
NotifyPropertyChanged("PRCList") NotifyPropertyChanged(NameOf(PRCList))
NotifyPropertyChanged("nSelPRC") NotifyPropertyChanged(NameOf(nSelPRC))
End Set End Set
End Property End Property
@@ -49,6 +50,36 @@ Public Class AddFeatureWndVM
End Get End Get
End Property End Property
Private m_PRCListView As New List(Of PRC)
Public ReadOnly Property PRCListView As List(Of PRC)
Get
Return m_PRCListView
End Get
End Property
#Region "New Macro OnlyProdPage"
Private m_MacroDefaultList As New ObservableCollection(Of Object)
Public ReadOnly Property MacroDefaultList As ObservableCollection(Of Object)
Get
Return m_MacroDefaultList
End Get
End Property
Private m_nSelMacroDefault As Integer = -1
Public Property nSelMacroDefault As Integer
Get
Return m_nSelMacroDefault
End Get
Set(value As Integer)
If value <> m_nSelMacroDefault Then
m_nSelMacroDefault = value
End If
End Set
End Property
#End Region ' New Macro OnlyProdPage
Private m_nSelPRC As PRC = Nothing Private m_nSelPRC As PRC = Nothing
Public Property nSelPRC As PRC Public Property nSelPRC As PRC
Get Get
@@ -64,47 +95,31 @@ Public Class AddFeatureWndVM
m_PrevSelPRCIndex_T = PRCList.IndexOf(m_nSelPRC) m_PrevSelPRCIndex_T = PRCList.IndexOf(m_nSelPRC)
End If End If
End If End If
NotifyPropertyChanged("sDrawPath") NotifyPropertyChanged(NameOf(sDrawPath))
' carico eventuali file Macro ' carico eventuali file Macro
MacroList.Clear() MacroCustomList.Clear()
If Core.Configuration.bOnlyProd Then
MacroDefaultList.Clear()
End If
m_MacroFilePathList = New List(Of String) m_MacroFilePathList = New List(Of String)
m_MacroCustomFilePathList = New List(Of String)
If Not IsNothing(nSelPRC) Then If Not IsNothing(nSelPRC) Then
Dim nGRPFromFileName As Integer = 0 Dim nGRPFromFileName As Integer = 0
Dim nPRCFromFileName As Integer = 0 Dim nPRCFromFileName As Integer = 0
Dim sMacroNameFromFileName As String = String.Empty Dim sMacroNameFromFileName As String = String.Empty
Dim nIdMacroName As Integer = 0 Dim nIdMacroName As Integer = 0
' ricavo lista file Macro ' ricavo lista file Macro Default
Dim AllFilesInDir As IEnumerable(Of String) = IO.Directory.EnumerateFiles(Map.refMainWindowVM.MainWindowM.sMacroDir) GetMacroListDefault(nGRPFromFileName, nPRCFromFileName, sMacroNameFromFileName, nIdMacroName)
For Each File In AllFilesInDir ' ricavo lista file Macro Custom
If Path.GetExtension(File).ToLower() = ".lua" Then If Core.Configuration.bOnlyProd Then GetMacroListCustom(nGRPFromFileName, nPRCFromFileName, sMacroNameFromFileName, nIdMacroName)
If File.Contains(FILENAMESEPARATOR) Then If MacroCustomList.Count > 0 Then
Dim FileName As String = Path.GetFileNameWithoutExtension(File)
Dim DataFromFileName As String() = FileName.Split(FILENAMESEPARATOR)
If DataFromFileName.Count = 2 Then
If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
Dim NumbersFromFileName As String() = DataFromFileName(0).Split(".")
Integer.TryParse(NumbersFromFileName(0), nGRPFromFileName)
Integer.TryParse(NumbersFromFileName(1), nPRCFromFileName)
End If
If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
sMacroNameFromFileName = DataFromFileName(1)
End If
If nGRPFromFileName = CalcBeamPrivateProfileGRP(nSelPRC.nGRP) AndAlso nPRCFromFileName = nSelPRC.nPRC Then
MacroList.Add(New IdNameStruct(nIdMacroName, sMacroNameFromFileName))
m_MacroFilePathList.Add(File)
nIdMacroName = nIdMacroName + 1
End If
End If
End If
End If
Next
If MacroList.Count > 0 Then
MacroList_IsEnabled = True MacroList_IsEnabled = True
Else Else
MacroList_IsEnabled = False MacroList_IsEnabled = False
End If End If
End If End If
End If End If
NotifyPropertyChanged(NameOf(nSelPRC))
End Set End Set
End Property End Property
@@ -116,26 +131,26 @@ Public Class AddFeatureWndVM
Set(value As Boolean) Set(value As Boolean)
If value <> m_MacroList_IsEnabled Then If value <> m_MacroList_IsEnabled Then
m_MacroList_IsEnabled = value m_MacroList_IsEnabled = value
NotifyPropertyChanged("MacroList_IsEnabled") NotifyPropertyChanged(NameOf(MacroList_IsEnabled))
End If End If
End Set End Set
End Property End Property
Private m_MacroList As New ObservableCollection(Of Object) Private m_MacroCustomList As New ObservableCollection(Of Object)
Public ReadOnly Property MacroList As ObservableCollection(Of Object) Public ReadOnly Property MacroCustomList As ObservableCollection(Of Object)
Get Get
Return m_MacroList Return m_MacroCustomList
End Get End Get
End Property End Property
Private m_nSelMacro As Integer = -1 Private m_nSelMacroCustom As Integer = -1
Public Property nSelMacro As Integer Public Property nSelMacroCustom As Integer
Get Get
Return m_nSelMacro Return m_nSelMacroCustom
End Get End Get
Set(value As Integer) Set(value As Integer)
If value <> m_nSelMacro Then If value <> m_nSelMacroCustom Then
m_nSelMacro = value m_nSelMacroCustom = value
End If End If
End Set End Set
End Property End Property
@@ -157,17 +172,133 @@ Public Class AddFeatureWndVM
' Definizione comandi ' Definizione comandi
Private m_cmdOk As ICommand Private m_cmdOk As ICommand
#Region "Messages"
Public ReadOnly Property Process_Msg As String
Get
Return EgtMsg(61805).ToUpper()
End Get
End Property
Public ReadOnly Property Default_Msg As String
Get
Return EgtMsg(61899).ToUpper()
End Get
End Property
Public ReadOnly Property Custom_Msg As String
Get
Return EgtMsg(61801).ToUpper()
End Get
End Property
#End Region
#End Region ' FIELDS & PROPERTIES #End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR" #Region "CONSTRUCTOR"
Sub New() Sub New()
SelGRPType = 0 If Core.Configuration.bOnlyProd Then
nSelPRC = PRCList(0) ' carico lista process
Dim TempPRCList As New ObservableCollection(Of Integer)
Dim TempPRCLList As New ObservableCollection(Of Integer)
Dim TempPRCLTist As New ObservableCollection(Of Integer)
GetBeamPrivateProfileProcessList(0, TempPRCLList)
GetBeamPrivateProfileProcessList(1, TempPRCLTist)
' riporto le liste process in un unica lista
For Each PRCL In TempPRCLList
TempPRCList.Add(PRCL)
Next
For Each PRCT In TempPRCLTist
TempPRCList.Add(PRCT)
Next
m_PRCList.Clear()
' ciclo sulla lista process eliminado i doppi
For Each PRC In TempPRCList.Distinct()
' leggo gruppi
Dim GRPLList As New ObservableCollection(Of Integer)
Dim GRPTList As New ObservableCollection(Of Integer)
GetBeamPrivateProfileGRPList(0, PRC, GRPLList)
GetBeamPrivateProfileGRPList(1, PRC, GRPTList)
If GRPLList.Count > 0 Then m_PRCList.Add(New PRC(GRPLList(0), PRC, GetBeamPrivateProfileName(0, PRC)))
If GRPTList.Count > 0 Then m_PRCList.Add(New PRC(GRPTList(0), PRC, GetBeamPrivateProfileName(1, PRC)))
Next
m_PRCListView = m_PRCList.OrderBy(Function(x) x.nPRC).ToList()
nSelPRC = m_PRCList(0)
NotifyPropertyChanged(NameOf(PRCListView))
NotifyPropertyChanged(NameOf(PRCList))
Else
SelGRPType = 0
nSelPRC = PRCList(0)
End If
End Sub End Sub
#End Region ' CONSTRUCTOR #End Region ' CONSTRUCTOR
#Region "METHODS"
Private Sub GetMacroListDefault(ByRef nGRPFromFileName As Integer, ByRef nPRCFromFileName As Integer, ByRef sMacroNameFromFileName As String, ByRef nIdMacroName As Integer)
Dim AllFilesInDir As IEnumerable(Of String) = IO.Directory.EnumerateFiles(Map.refMainWindowVM.MainWindowM.sMacroCustomDir)
For Each File In AllFilesInDir
If Path.GetExtension(File).ToLower() = ".lua" Then
If File.Contains(FILENAMESEPARATOR) Then
Dim FileName As String = Path.GetFileNameWithoutExtension(File)
Dim DataFromFileName As String() = FileName.Split(FILENAMESEPARATOR)
If DataFromFileName.Count = 2 Then
If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
Dim NumbersFromFileName As String() = DataFromFileName(0).Split(".")
Integer.TryParse(NumbersFromFileName(0), nGRPFromFileName)
Integer.TryParse(NumbersFromFileName(1), nPRCFromFileName)
End If
If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
sMacroNameFromFileName = DataFromFileName(1)
End If
If nGRPFromFileName = CalcBeamPrivateProfileGRP(nSelPRC.nGRP) AndAlso nPRCFromFileName = nSelPRC.nPRC Then
If Core.Configuration.bOnlyProd Then
MacroCustomList.Add(New NewMacro(nIdMacroName, sMacroNameFromFileName, Map.refMainWindowVM.MainWindowM.sMacroCustomDir & "\Template\" & sMacroNameFromFileName & ".png"))
Else
MacroCustomList.Add(New IdNameStruct(nIdMacroName, sMacroNameFromFileName))
End If
m_MacroFilePathList.Add(File)
nIdMacroName += 1
End If
End If
End If
End If
Next
End Sub
Private Sub GetMacroListCustom(ByRef nGRPFromFileName As Integer, ByRef nPRCFromFileName As Integer, ByRef sMacroNameFromFileName As String, ByRef nIdMacroName As Integer)
nIdMacroName = 0
Dim AllFilesInDirCustom As IEnumerable(Of String) = IO.Directory.EnumerateFiles(Map.refMainWindowVM.MainWindowM.sMacroDefaultDir)
For Each File In AllFilesInDirCustom
If Path.GetExtension(File).ToLower() = ".lua" Then
If File.Contains(FILENAMESEPARATOR) Then
Dim FileName As String = Path.GetFileNameWithoutExtension(File)
Dim DataFromFileName As String() = FileName.Split(FILENAMESEPARATOR)
If DataFromFileName.Count = 2 Then
If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
Dim NumbersFromFileName As String() = DataFromFileName(0).Split(".")
Integer.TryParse(NumbersFromFileName(0), nGRPFromFileName)
Integer.TryParse(NumbersFromFileName(1), nPRCFromFileName)
End If
If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
sMacroNameFromFileName = DataFromFileName(1)
End If
If nGRPFromFileName = CalcBeamPrivateProfileGRP(nSelPRC.nGRP) AndAlso nPRCFromFileName = nSelPRC.nPRC Then
MacroDefaultList.Add(New NewMacro(nIdMacroName, sMacroNameFromFileName))
m_MacroCustomFilePathList.Add(File)
nIdMacroName += 1
End If
End If
End If
End If
Next
End Sub
#End Region ' METHODS
#Region "COMMANDS" #Region "COMMANDS"
#Region "Ok" #Region "Ok"
@@ -259,4 +390,43 @@ Public Class PRC
m_QBTLParamVMList = QBTLParamList m_QBTLParamVMList = QBTLParamList
End Sub End Sub
End Class
Public Class NewMacro
' Indice Macro
Private m_nIndexMacro As Integer
Public ReadOnly Property nIndexMacro As Integer
Get
Return m_nIndexMacro
End Get
End Property
' Nome Macro
Private m_sMacroName As String
Public ReadOnly Property sMacroName As String
Get
Return m_sMacroName.ToUpper()
End Get
End Property
' Cartella dove sono contenuti i templete delle macro
Private m_sMacroDrawPath As String
Public ReadOnly Property sMacroDrawPath As String
Get
Return m_sMacroDrawPath
End Get
End Property
Sub New(IndexMacro As Integer, MacroName As String)
m_nIndexMacro = IndexMacro
m_sMacroName = MacroName
End Sub
Sub New(IndexMacro As Integer, MacroName As String, MacroDrawPath As String)
m_nIndexMacro = IndexMacro
m_sMacroName = MacroName
m_sMacroDrawPath = MacroDrawPath
End Sub
End Class End Class
@@ -0,0 +1,159 @@
<EgtWPFLib5:EgtCustomWindow x:Class="NewAddFeatureWndV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
WindowStyle="None" ResizeMode="NoResize"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterOwner"
IsClosable="False"
IsMinimizable="False"
IsResizable="False"
Title="AddProcess">
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding Process_Msg}"
Style="{StaticResource ListTextBlock}"/>
<ListBox ItemsSource="{Binding PRCListView}"
SelectedItem="{Binding nSelPRC}"
Grid.Row="1"
BorderThickness="0"
Height="585"
Width="260"
HorizontalAlignment="Left"
Margin="5">
<ListBox.Resources>
<Style TargetType="ListBoxItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<Border Name="Border" Padding="2" SnapsToDevicePixels="True">
<ContentPresenter/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="Border" Property="Background" Value="{DynamicResource {x:Static SystemColors.HotTrackBrushKey}}"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontSize" Value="15"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.Resources>
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding ghDesc}"
ToolTip="{Binding ghDesc}"
HorizontalAlignment="Left"
Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType={x:Type ListBox}}}"
Style="{StaticResource OptionTextBlock}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<TextBlock Text="{Binding Custom_Msg}"
Grid.Column="1"
Style="{StaticResource ListTextBlock}"/>
<ListBox ItemsSource="{Binding MacroCustomList}"
SelectedIndex="{Binding nSelMacroCustom}"
Grid.Row="1"
Grid.Column="1"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
BorderThickness="0"
Width="980"
Height="610"
Margin="5">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel IsItemsHost="True" Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding sMacroName}"
Margin="5"
FontSize="14"
Style="{StaticResource OptionTextBlock}"/>
<Image Source="{Binding sMacroDrawPath}"
Grid.Row="1"
Width="300"
Margin="5,0,5,5"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<TextBlock Text="{Binding Default_Msg}"
Grid.Column="2"
Style="{StaticResource ListTextBlock}"/>
<ListBox ItemsSource="{Binding MacroDefaultList}"
SelectedIndex="{Binding nSelMacroDefault}"
Grid.Row="1"
Grid.Column="2"
BorderThickness="0"
Height="585"
Width="250"
HorizontalAlignment="Left"
Margin="5">
<ListBox.Resources>
<Style TargetType="ListBoxItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<Border Name="Border" Padding="2" SnapsToDevicePixels="True">
<ContentPresenter/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="Border" Property="Background" Value="{DynamicResource {x:Static SystemColors.HotTrackBrushKey}}"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.Resources>
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding sMacroName}"
Margin="2.5"
HorizontalAlignment="Left"
Width="239"
Style="{StaticResource OptionTextBlock}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<UniformGrid Columns="2"
Grid.Row="2"
Grid.ColumnSpan="3"
Margin="5">
<Button Content="Ok"
Command="{Binding Ok_Command}"
IsDefault="True"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Button Content="Cancel"
IsCancel="True"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
</UniformGrid>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
@@ -0,0 +1,17 @@
Public Class NewAddFeatureWndV
Private WithEvents m_AddFeatureWndVM As AddFeatureWndVM
Sub New(Owner As Window, AddFeatureWndVM As AddFeatureWndVM)
' La chiamata è richiesta dalla finestra di progettazione.
InitializeComponent()
Me.DataContext = AddFeatureWndVM
' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent().
m_AddFeatureWndVM = AddFeatureWndVM
End Sub
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_AddFeatureWndVM.m_CloseWindow
Me.DialogResult = bDialogResult
End Sub
End Class
@@ -189,12 +189,7 @@ Public Class BTLPartManagerVM
End Sub End Sub
Public Sub NewRawPart(bLast As Boolean) Public Sub NewRawPart(bLast As Boolean)
'If IsNothing(Map.refProdManagerVM) OrElse IsNothing(ProjectManagerVM.CurrProd) Then Return If IsNothing(ProjectManagerVM.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 SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart
Dim SelParts As List(Of BTLPartVM) = Map.refProjectVM.BTLStructureVM.SelBTLParts.ToList() Dim SelParts As List(Of BTLPartVM) = Map.refProjectVM.BTLStructureVM.SelBTLParts.ToList()
If IsNothing(SelParts) OrElse SelParts.Count <= 0 Then Return If IsNothing(SelParts) OrElse SelParts.Count <= 0 Then Return
@@ -616,12 +611,7 @@ Public Class BTLPartManagerVM
''' Execute the Exec. This method is invoked by the ExecCommand. ''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary> ''' </summary>
Public Sub AddToRawPart() Public Sub AddToRawPart()
'If IsNothing(ProjectManagerVM.CurrProd) Then Return If IsNothing(ProjectManagerVM.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.SelBTLParts(0) Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLParts(0)
Dim SelParts As List(Of BTLPartVM) = Map.refProjectVM.BTLStructureVM.SelBTLParts.ToList() Dim SelParts As List(Of BTLPartVM) = Map.refProjectVM.BTLStructureVM.SelBTLParts.ToList()
For Index = 0 To SelParts.Count() - 1 For Index = 0 To SelParts.Count() - 1
@@ -725,6 +715,7 @@ Public Class BTLPartManagerVM
Dim dPosX As Double = BeamMachGroup.dStartCut Dim dPosX As Double = BeamMachGroup.dStartCut
Dim nPartIndex As Integer = 0 Dim nPartIndex As Integer = 0
Dim nIndex As Integer Dim nIndex As Integer
Dim bDuploInfo As Boolean = False
' ciclo sui pezzi ' ciclo sui pezzi
For nIndex = 0 To BeamMachGroup.PartVMList.Count - 1 For nIndex = 0 To BeamMachGroup.PartVMList.Count - 1
For PartsToAddIndex = nPartIndex To PartsToAdd.Count - 1 For PartsToAddIndex = nPartIndex To PartsToAdd.Count - 1
@@ -777,7 +768,30 @@ Public Class BTLPartManagerVM
End While End While
Dim sLogPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\RawPartLog.txt" Dim sLogPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\RawPartLog.txt"
If Not ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then If Not ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then
Return False EgtOutLog("Fallito inserimento grezzo nella barra in AddPartToBeam")
' elimino duplo
For Each nDuploId In nPartDuploIdList
EgtErase(nDuploId)
Next
' aggiorno info grezzo
For nIndex = 0 To BeamMachGroup.PartVMList.Count - 1
EgtSetInfo(BeamMachGroup.Id, MGR_RPT_PART & nIndex + 1, BeamMachGroup.PartVMList(nIndex).nPartId & "," & DoubleToString(BeamMachGroup.PartVMList(nIndex).dPOSX, 3))
Next
' rimuovo info duplo
While EgtGetInfo(BeamMachGroup.Id, MGR_RPT_PART & nIndex + 1, nPartDuploIdList(0))
bDuploInfo = EgtGetInfo(BeamMachGroup.Id, MGR_RPT_PART & nIndex + 1, nPartDuploIdList(0))
EgtRemoveInfo(BeamMachGroup.Id, MGR_RPT_PART & nIndex + 1)
nIndex += 1
End While
' elimino vecchio grezzo ed eseguo script creazione nuovo
nRawId = EgtGetFirstRawPart()
While nRawId <> GDB_ID.NULL
EgtRemoveRawPart(nRawId)
nRawId = EgtGetFirstRawPart()
End While
If Not ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then
EgtOutLog("Fallita esecuzione ExecBeam. ERRORE")
End If
End If End If
For nDuploIndex = 0 To PartsToAdd.Count - 1 For nDuploIndex = 0 To PartsToAdd.Count - 1
EgtSetInfo(nPartDuploIdList(nDuploIndex), MGR_PRT_ROT, PartsToAdd(nDuploIndex).nROTATED) EgtSetInfo(nPartDuploIdList(nDuploIndex), MGR_PRT_ROT, PartsToAdd(nDuploIndex).nROTATED)
@@ -786,7 +800,11 @@ Public Class BTLPartManagerVM
' aggiorno lista pezzi ' aggiorno lista pezzi
BeamMachGroup.MyMachGroupM.RefreshPartList() BeamMachGroup.MyMachGroupM.RefreshPartList()
' seleziono pezzo aggiunto ' seleziono pezzo aggiunto
If BeamMachGroup.PartVMList.Count > nInsertIndex Then BeamMachGroup.SelPart = BeamMachGroup.PartVMList(nInsertIndex) If BeamMachGroup.PartVMList.Count > nInsertIndex Then
BeamMachGroup.SelPart = BeamMachGroup.PartVMList(nInsertIndex)
ElseIf bDuploInfo Then
BeamMachGroup.SelPart = BeamMachGroup.PartVMList(BeamMachGroup.PartVMList.Count - 1)
End If
Return True Return True
End Function End Function
@@ -889,12 +907,7 @@ Public Class BTLPartManagerVM
''' Execute the Exec. This method is invoked by the ExecCommand. ''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary> ''' </summary>
Public Sub CopyPart() Public Sub CopyPart()
'If IsNothing(ProjectManagerVM.CurrProj) Then Return If IsNothing(ProjectManagerVM.CurrProj) Then Return
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso IsNothing(Map.refProjManagerVM) AndAlso IsNothing(ProjectManagerVM.CurrProj) Then
Return
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(Map.refOnlyProdManagerVM) AndAlso IsNothing(ProjectManagerVM.CurrProj) Then
Return
End If
Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart
If IsNothing(SelPart) Then Return If IsNothing(SelPart) Then Return
' creo copia ' creo copia
@@ -925,12 +938,7 @@ Public Class BTLPartManagerVM
''' Execute the Exec. This method is invoked by the ExecCommand. ''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary> ''' </summary>
Public Sub AddPart(ByVal param As Object) Public Sub AddPart(ByVal param As Object)
'If IsNothing(ProjectManagerVM.CurrProj) Then Return If IsNothing(ProjectManagerVM.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 ' apro finestra di definizione nuovo part
Dim AddPartWndVM As New AddPartWndVM() Dim AddPartWndVM As New AddPartWndVM()
Dim AddPartWnd As New AddPartWndV(Application.Current.MainWindow, AddPartWndVM) Dim AddPartWnd As New AddPartWndV(Application.Current.MainWindow, AddPartWndVM)
@@ -938,12 +946,7 @@ Public Class BTLPartManagerVM
' creo nuovo part ' creo nuovo part
Dim nNewPartId As Integer = EgtBeamCreatePart() Dim nNewPartId As Integer = EgtBeamCreatePart()
' scrivo info proj ' scrivo info proj
'EgtSetInfo(nNewPartId, BTL_PRT_PROJ, ProjectManagerVM.CurrProj.nProjId) EgtSetInfo(nNewPartId, BTL_PRT_PROJ, ProjectManagerVM.CurrProj.nProjId)
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso IsNothing(Map.refProjManagerVM) Then
EgtSetInfo(nNewPartId, BTL_PRT_PROJ, ProjectManagerVM.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) EgtBeamSetPartProdNbr(AddPartWndVM.nPDN)
If Not IsNothing(AddPartWndVM.sNAM) Then EgtBeamSetPartName(AddPartWndVM.sNAM) If Not IsNothing(AddPartWndVM.sNAM) Then EgtBeamSetPartName(AddPartWndVM.sNAM)
EgtBeamSetPartCount(AddPartWndVM.nCNT) EgtBeamSetPartCount(AddPartWndVM.nCNT)
@@ -1076,18 +1079,14 @@ Public Class BTLPartManagerVM
''' Execute the Exec. This method is invoked by the ExecCommand. ''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary> ''' </summary>
Public Sub Invert() Public Sub Invert()
If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso IsNothing(Map.refProjManagerVM) AndAlso IsNothing(ProjectManagerVM.CurrProj)) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso IsNothing(ProjectManagerVM.CurrProj)) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then
Return Return
ElseIf (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(Map.refOnlyProdManagerVM) AndAlso IsNothing(ProjectManagerVM.CurrProj)) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then ElseIf (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(ProjectManagerVM.CurrProj)) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then
Return Return
End If End If
' se modalita' assemblato ' se modalita' assemblato
Dim bShowBuilding As Boolean = Map.refShowBeamPanelVM.ShowBuilding_IsChecked Dim bShowBuilding As Boolean = Map.refShowBeamPanelVM.ShowBuilding_IsChecked
Configuration.AssembledMode(bShowBuilding) Configuration.AssembledMode(bShowBuilding)
'If bShowBuilding AndAlso Map.refShowBeamPanelVM.bShowAll Then
' ' devo smontarlo prima di ruotare le travi
' Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
'End If
' inverto i pezzi selezionati ' inverto i pezzi selezionati
For Each Part In Map.refProjectVM.BTLStructureVM.SelBTLParts For Each Part In Map.refProjectVM.BTLStructureVM.SelBTLParts
Part.Invert() Part.Invert()
@@ -1116,20 +1115,12 @@ Public Class BTLPartManagerVM
''' Execute the Exec. This method is invoked by the ExecCommand. ''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary> ''' </summary>
Public Sub BackRotation() Public Sub BackRotation()
If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso IsNothing(Map.refProjManagerVM) AndAlso IsNothing(ProjectManagerVM.CurrProj)) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then If IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return
Return
ElseIf (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(Map.refOnlyProdManagerVM) AndAlso IsNothing(ProjectManagerVM.CurrProj)) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then
Return
End If
' salvo sezione impostata ' salvo sezione impostata
Dim CurrSection As SectionXMaterial = Map.refProjectVM.BTLStructureVM.SelSection Dim CurrSection As SectionXMaterial = Map.refProjectVM.BTLStructureVM.SelSection
' se modalita' assemblato ' se modalita' assemblato
Dim bShowBuilding As Boolean = Map.refShowBeamPanelVM.ShowBuilding_IsChecked Dim bShowBuilding As Boolean = Map.refShowBeamPanelVM.ShowBuilding_IsChecked
Configuration.AssembledMode(bShowBuilding) Configuration.AssembledMode(bShowBuilding)
'If bShowBuilding AndAlso Map.refShowBeamPanelVM.bShowAll Then
' ' devo smontarlo prima di ruotare le travi
' Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
'End If
' ruoto i pezzi selezionati ' ruoto i pezzi selezionati
For Each Part In Map.refProjectVM.BTLStructureVM.SelBTLParts For Each Part In Map.refProjectVM.BTLStructureVM.SelBTLParts
Part.BackRotation(False, False) Part.BackRotation(False, False)
@@ -1165,20 +1156,12 @@ Public Class BTLPartManagerVM
''' Execute the Exec. This method is invoked by the ExecCommand. ''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary> ''' </summary>
Public Sub ForwardRotation() Public Sub ForwardRotation()
If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso IsNothing(Map.refProjManagerVM) AndAlso IsNothing(ProjectManagerVM.CurrProj)) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then If IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return
Return
ElseIf (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(Map.refOnlyProdManagerVM) AndAlso IsNothing(ProjectManagerVM.CurrProj)) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then
Return
End If
' salvo sezione impostata ' salvo sezione impostata
Dim CurrSection As SectionXMaterial = Map.refProjectVM.BTLStructureVM.SelSection Dim CurrSection As SectionXMaterial = Map.refProjectVM.BTLStructureVM.SelSection
' se modalita' assemblato ' se modalita' assemblato
Dim bShowBuilding As Boolean = Map.refShowBeamPanelVM.ShowBuilding_IsChecked Dim bShowBuilding As Boolean = Map.refShowBeamPanelVM.ShowBuilding_IsChecked
Configuration.AssembledMode(bShowBuilding) Configuration.AssembledMode(bShowBuilding)
'If bShowBuilding AndAlso Map.refShowBeamPanelVM.bShowAll Then
' ' devo smontarlo prima di ruotare le travi
' Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
'End If
' ruoto i pezzi selezionati ' ruoto i pezzi selezionati
For Each Part In Map.refProjectVM.BTLStructureVM.SelBTLParts For Each Part In Map.refProjectVM.BTLStructureVM.SelBTLParts
Part.ForwardRotation(False, False) Part.ForwardRotation(False, False)
@@ -1198,5 +1181,4 @@ Public Class BTLPartManagerVM
#End Region ' COMMANDS #End Region ' COMMANDS
End Class End Class
@@ -165,7 +165,7 @@ Public Class BTLFeatureVM
' se in View ' se in View
If Map.refMainMenuVM.SelPage = Pages.VIEW OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Not IsNothing(m_BTLPartM)) Then If Map.refMainMenuVM.SelPage = Pages.VIEW OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Not IsNothing(m_BTLPartM)) Then
' imposto modificato per copie ' imposto modificato per copie
Dim cc = Map.refMachGroupPanelVM.MachGroupVMList 'Dim cc = Map.refMachGroupPanelVM.MachGroupVMList
MyMachGroupPanelM.SetDuploModified(m_BTLPartM.nPartId) MyMachGroupPanelM.SetDuploModified(m_BTLPartM.nPartId)
End If End If
NotifyPropertyChanged(NameOf(bDO)) NotifyPropertyChanged(NameOf(bDO))
@@ -135,6 +135,21 @@ Public Class BTLParamVM
NotifyPropertyChanged("sValue") NotifyPropertyChanged("sValue")
Return Return
End If End If
' recupero ParentPart
Dim ParentPart As BTLPartM = TryCast(m_BTLParamM.ParentFeature.ParentPart, BTLPartM)
' recupero PartId
Dim nPartId As Integer = ParentPart.nPartId
' numero di pezzi inseriti nelle barre
Dim INPROD As Integer = 0
EgtDuploInRawCount(nPartId, INPROD)
' recupero pezzi lavorati da Db
Dim nDoneCnt As Integer = DbControllers.m_ProjController.getCountItemState(ProjectManagerVM.CurrProj.nProjId, nPartId, ItemState.Assigned)
' controllo se i pezzi sono lavorati se si messaggio di warning altrimenti messaggio informativo
If nDoneCnt > 0 Then
MessageBox.Show("Pezzo " & nPartId & " non modificato in " & INPROD & " barra/e perche' settata/e come da produrre", EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Warning)
ElseIf INPROD > 0 Then
MessageBox.Show("Pezzo " & nPartId & " modificato in " & INPROD & " barra/e grezza/e", EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Information)
End If
UpdateParamValue(dNewValue, "") UpdateParamValue(dNewValue, "")
Case Else Case Else
UpdateParamValue(0, value) UpdateParamValue(0, value)
@@ -84,10 +84,10 @@ Public Class BTLStructureVM
Select Case m_SelectionType Select Case m_SelectionType
Case SelectionTypes.SELECT_ Case SelectionTypes.SELECT_
' imposto modalita' proj su vista feature ' imposto modalita' proj su vista feature
'Map.refProjectVM.SelProdProj = ProdProj.PROJ
If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then Map.refProdProjManagerVM.SelProdProj = ProdProj.PROJ If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then Map.refProdProjManagerVM.SelProdProj = ProdProj.PROJ
' rendo enable bottone parameters ' rendo enable bottone parameters
Map.refLeftPanelVM.SetParametersIsEnabled(True) Map.refLeftPanelVM.SetParametersIsEnabled(True)
Map.refLeftPanelVM.SetData_IsEnabled(False)
' verifico reset mark su tutti i pezzi ' verifico reset mark su tutti i pezzi
For Each BTLPart In m_BTLPartVMList For Each BTLPart In m_BTLPartVMList
EgtResetMark(BTLPart.nPartId) EgtResetMark(BTLPart.nPartId)
@@ -97,10 +97,10 @@ Public Class BTLStructureVM
Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProdProjManagerVM.PartManager_Visibility)) Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProdProjManagerVM.PartManager_Visibility))
Case SelectionTypes.HIGHLIGHT Case SelectionTypes.HIGHLIGHT
' imposto modalita' nulla su vista feature ' imposto modalita' nulla su vista feature
'Map.refProjectVM.SelProdProj = ProdProj.NULL
If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then Map.refProdProjManagerVM.SelProdProj = ProdProj.NULL If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then Map.refProdProjManagerVM.SelProdProj = ProdProj.NULL
' rendo disable bottone parameters ' rendo disable bottone parameters
Map.refLeftPanelVM.SetParametersIsEnabled(False) Map.refLeftPanelVM.SetParametersIsEnabled(False)
Map.refLeftPanelVM.SetData_IsEnabled(True)
If m_PrevSelectionType = SelectionTypes.SELECT_ Then If m_PrevSelectionType = SelectionTypes.SELECT_ Then
EgtBeamShowFacesName(False) EgtBeamShowFacesName(False)
EgtBeamShowLoadingSide(False, False) EgtBeamShowLoadingSide(False, False)
@@ -120,8 +120,6 @@ Public Class BTLStructureVM
' aggiornamento grafica ' aggiornamento grafica
'Map.refLeftPanelVM.PartShowAllChanged() 'Map.refLeftPanelVM.PartShowAllChanged()
Configuration.UpdateGraphics() Configuration.UpdateGraphics()
'If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.PartShowAllChanged()
'If Not IsNothing(Map.refBTLPartManagerVM) Then Map.refBTLPartManagerVM.PartShowAllChanged()
'Map.refLeftPanelVM.FeatureSelectionChanged() 'Map.refLeftPanelVM.FeatureSelectionChanged()
If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.FeatureSelectionChanged() If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.FeatureSelectionChanged()
Map.refCALCPanelVM.SetIsEnabledForSelPart() Map.refCALCPanelVM.SetIsEnabledForSelPart()
@@ -215,39 +213,19 @@ Public Class BTLStructureVM
SelBTLPart = Nothing SelBTLPart = Nothing
End Select End Select
' aggiornamento grafica ' aggiornamento grafica
'Map.refLeftPanelVM.PartShowAllChanged()
Configuration.UpdateGraphics() Configuration.UpdateGraphics()
'If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.PartShowAllChanged()
'If Not IsNothing(Map.refBTLPartManagerVM) Then Map.refBTLPartManagerVM.PartShowAllChanged()
End Sub End Sub
Private Sub SelectBTLPart(BtlPart As BTLPartVM) Private Sub SelectBTLPart(BtlPart As BTLPartVM)
m_SelBTLPart = BtlPart m_SelBTLPart = BtlPart
If Map.refMainMenuVM.SelPage = Pages.VIEW Then If Map.refMainMenuVM.SelPage = Pages.VIEW Then
Configuration.SelectedPieces(BtlPart.nPartId, Me) Configuration.SelectedPieces(BtlPart.nPartId, Me)
'EgtBeamShowFacesName(False)
'EgtBeamShowLoadingSide(False, False)
'Map.refProjectVM.MacroFeature_IsEnabled = True
'' se modalità building, la tolgo
'If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then
' ShowBuilding(False, False)
'End If
'' seleziono pezzo nella scena
'SceneSelPartSelection()
'' seleziono pezzo in Db geometrico
'EgtBeamSetPart(BtlPart.nPartId)
'EgtBeamShowFacesName(True)
'Dim bLoadingSideShow As Boolean = (nPROJTYPE = BWType.BEAM)
'Dim bLeftToRight As Boolean = Not (CurrentMachine.ViewDir = VT.ISO_NW OrElse CurrentMachine.ViewDir = VT.ISO_NE)
'EgtBeamShowLoadingSide(bLoadingSideShow, bLeftToRight)
' seleziono pagina BottomPanel ' seleziono pagina BottomPanel
If Not IsNothing(Map.refBottomPanelVM) Then If Not IsNothing(Map.refBottomPanelVM) Then
Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.PART) Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.PART)
End If End If
'' mostro barra di gestione pezzo ' mostro barra di gestione pezzo
'Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProjectVM.PartManager_Visibility)) If Not IsNothing(BtlPart.BTLFeatureVMList) AndAlso BtlPart.BTLFeatureVMList.Count > 0 Then SelBTLPart.SelBTLFeatureVM = BtlPart.BTLFeatureVMList(0)
' deseleziono le feature
If Not IsNothing(BtlPart.SelBTLFeatureVM) Then SelBTLPart.SelBTLFeatureVM = Nothing
' aggiorno stato selezionato tutto ' aggiorno stato selezionato tutto
Map.refShowBeamPanelVM.bShowAll = False Map.refShowBeamPanelVM.bShowAll = False
Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False) Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False)
@@ -259,25 +237,6 @@ Public Class BTLStructureVM
EgtBeamShowLoadingSide(False, False) EgtBeamShowLoadingSide(False, False)
' trovo ed evidenzio MachGroup e Duplo di questo pezzo ' trovo ed evidenzio MachGroup e Duplo di questo pezzo
Configuration.SetSearchPiece(BtlPart.nPartId) Configuration.SetSearchPiece(BtlPart.nPartId)
'If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
' Dim MachGroupList As New List(Of MyMachGroupVM)
' For Each Machgroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
' Dim bFound As Boolean = False
' For Each Part As PartVM In Machgroup.PartVMList
' If EgtDuploGetOriginal(Part.nPartId) = BtlPart.nPartId Then
' Part.SetSearchFound()
' bFound = True
' Else
' Part.ResetSearchFound()
' End If
' Next
' If bFound Then
' Machgroup.SetSearchFound()
' Else
' Machgroup.ResetSearchFound()
' End If
' Next
'End If
' seleziono pezzo nella scena ' seleziono pezzo nella scena
SceneSelPartSelection() SceneSelPartSelection()
Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False) Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False)
@@ -292,45 +251,10 @@ Public Class BTLStructureVM
EgtResetCurrMachGroup() EgtResetCurrMachGroup()
End If End If
Configuration.SelectedPieces(BtlPart.nPartId, Me) Configuration.SelectedPieces(BtlPart.nPartId, Me)
'EgtBeamShowFacesName(False)
'EgtBeamShowLoadingSide(False, False)
'Map.refProjectVM.MacroFeature_IsEnabled = True
'' se modalità building, la tolgo
'If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then
' ShowBuilding(False, False)
'End If
'' seleziono pezzo nella scena
'SceneSelPartSelection()
'' seleziono pezzo in Db geometrico
'EgtBeamSetPart(BtlPart.nPartId)
'EgtBeamShowFacesName(True)
'Dim bLoadingSideShow As Boolean = (nPROJTYPE = BWType.BEAM)
'Dim bLeftToRight As Boolean = Not (CurrentMachine.ViewDir = VT.ISO_NW OrElse CurrentMachine.ViewDir = VT.ISO_NE)
'EgtBeamShowLoadingSide(bLoadingSideShow, bLeftToRight)
' seleziono la prima feature ' seleziono la prima feature
If Not IsNothing(BtlPart.BTLFeatureVMList) AndAlso BtlPart.BTLFeatureVMList.Count > 0 Then SelBTLPart.SelBTLFeatureVM = BtlPart.BTLFeatureVMList(0) If Not IsNothing(BtlPart.BTLFeatureVMList) AndAlso BtlPart.BTLFeatureVMList.Count > 0 Then SelBTLPart.SelBTLFeatureVM = BtlPart.BTLFeatureVMList(0)
' aggiorno stato selezionato tutto ' aggiorno stato selezionato tutto
Map.refShowBeamPanelVM.bShowAll = False Map.refShowBeamPanelVM.bShowAll = False
'' trovo ed evidenzio MachGroup e Duplo di questo pezzo
'If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
' Dim MachGroupList As New List(Of MyMachGroupVM)
' For Each Machgroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
' Dim bFound As Boolean = False
' For Each Part As PartVM In Machgroup.PartVMList
' If EgtDuploGetOriginal(Part.nPartId) = BtlPart.nPartId Then
' Part.SetSearchFound()
' bFound = True
' Else
' Part.ResetSearchFound()
' End If
' Next
' If bFound Then
' Machgroup.SetSearchFound()
' Else
' Machgroup.ResetSearchFound()
' End If
' Next
'End If
Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False) Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False)
EgtZoom(ZM.ALL) EgtZoom(ZM.ALL)
End If End If
@@ -339,11 +263,6 @@ Public Class BTLStructureVM
Private Sub DeselectBTLPart(BtlPart As BTLPartVM) Private Sub DeselectBTLPart(BtlPart As BTLPartVM)
' se necessario tolgo solido dal precedentemente selezionato ' se necessario tolgo solido dal precedentemente selezionato
Configuration.DeselectSolid(BtlPart.nPartId, True) Configuration.DeselectSolid(BtlPart.nPartId, True)
'If Map.refShowBeamPanelVM.ShowSolid_IsChecked Then
' ' tolgo eventuale indicazione solido rimasta da pezzo precedente
' Map.refShowBeamPanelVM.SetShowSolid(False)
' Map.refProjectVM.BTLStructureVM.ShowSolid(BtlPart.nPartId, False, False)
'End If
If m_SelBTLPart Is BtlPart Then If m_SelBTLPart Is BtlPart Then
EgtBeamShowFacesName(False) EgtBeamShowFacesName(False)
EgtBeamShowLoadingSide(False, False) EgtBeamShowLoadingSide(False, False)
@@ -351,25 +270,7 @@ Public Class BTLStructureVM
NotifyPropertyChanged(NameOf(SelBTLPart)) NotifyPropertyChanged(NameOf(SelBTLPart))
End If End If
' disabilito eventuale feature selezionata ' disabilito eventuale feature selezionata
If Not IsNothing(BtlPart.m_SelBTLFeatureVM) Then BtlPart.SelBTLFeatureVM = Nothing If Not IsNothing(BtlPart.m_SelBTLFeatureVM) AndAlso (Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.MACHINING) Then BtlPart.SelBTLFeatureVM = Nothing
'' deevidenzio MachGroup e Duplo di questo pezzo
'If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
' Dim MachGroupList As New List(Of MyMachGroupVM)
' For Each Machgroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
' Dim bFound As Boolean = False
' For Each Part As PartVM In Machgroup.PartVMList
' Dim i = EgtDuploGetOriginal(Part.nPartId)
' If EgtDuploGetOriginal(Part.nPartId) = BtlPart.nPartId Then
' Part.ResetSearchFound()
' bFound = True
' End If
' Next
' If bFound Then
' Machgroup.ResetSearchFound()
' End If
' Next
'End If
EgtResetCurrMachGroup()
EgtDraw() EgtDraw()
End Sub End Sub
Private Sub HighlightBTLPart(BtlPart As BTLPartVM) Private Sub HighlightBTLPart(BtlPart As BTLPartVM)
@@ -391,25 +292,6 @@ Public Class BTLStructureVM
If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
' trovo ed evidenzio MachGroup e Duplo di questo pezzo ' trovo ed evidenzio MachGroup e Duplo di questo pezzo
Configuration.SetSearchPiece(BtlPart.nPartId) Configuration.SetSearchPiece(BtlPart.nPartId)
'If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
' Dim MachGroupList As New List(Of MyMachGroupVM)
' For Each Machgroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
' Dim bFound As Boolean = False
' For Each Part As PartVM In Machgroup.PartVMList
' If EgtDuploGetOriginal(Part.nPartId) = BtlPart.nPartId Then
' Part.SetSearchFound()
' bFound = True
' Else
' Part.ResetSearchFound()
' End If
' Next
' If bFound Then
' Machgroup.SetSearchFound()
' Else
' Machgroup.ResetSearchFound()
' End If
' Next
'End If
End If End If
' seleziono pagina BottomPanel ' seleziono pagina BottomPanel
If Not IsNothing(Map.refBottomPanelVM) Then Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.NULL) If Not IsNothing(Map.refBottomPanelVM) Then Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.NULL)
@@ -433,22 +315,6 @@ Public Class BTLStructureVM
End If End If
' deevidenzio MachGroup e Duplo di questo pezzo ' deevidenzio MachGroup e Duplo di questo pezzo
Configuration.ResetSearchPiece(BtlPart.nPartId) Configuration.ResetSearchPiece(BtlPart.nPartId)
'If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
' Dim MachGroupList As New List(Of MyMachGroupVM)
' For Each Machgroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
' Dim bFound As Boolean = False
' For Each Part As PartVM In Machgroup.PartVMList
' Dim i = EgtDuploGetOriginal(Part.nPartId)
' If EgtDuploGetOriginal(Part.nPartId) = BtlPart.nPartId Then
' Part.ResetSearchFound()
' bFound = True
' End If
' Next
' If bFound Then
' Machgroup.ResetSearchFound()
' End If
' Next
'End If
' seleziono pagina BottomPanel ' seleziono pagina BottomPanel
'Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.NULL) 'Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.NULL)
If bDraw Then EgtDraw() If bDraw Then EgtDraw()
@@ -474,16 +340,13 @@ Public Class BTLStructureVM
If Not IsNothing(m_SelBTLPart) Then If Not IsNothing(m_SelBTLPart) Then
' se necessario tolgo solido dal precedentemente selezionato ' se necessario tolgo solido dal precedentemente selezionato
Configuration.DeselectSolid() Configuration.DeselectSolid()
'If Map.refShowBeamPanelVM.ShowSolid_IsChecked Then
' Map.refShowBeamPanelVM.SetShowSolid(False)
'End If
' disabilito eventuale feature selezionata ' disabilito eventuale feature selezionata
If Not IsNothing(m_SelBTLPart.m_SelBTLFeatureVM) Then m_SelBTLPart.SelBTLFeatureVM = Nothing If Not IsNothing(m_SelBTLPart.m_SelBTLFeatureVM) Then m_SelBTLPart.SelBTLFeatureVM = Nothing
End If End If
m_SelBTLPart = value m_SelBTLPart = value
' se seleziono un pezzo ' se seleziono un pezzo
If Not IsNothing(m_SelBTLPart) Then If Not IsNothing(m_SelBTLPart) Then
If Map.refMainMenuVM.SelPage = Pages.VIEW Then If Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
' se modalità building, la tolgo ' se modalità building, la tolgo
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then
ShowBuilding(False, False) ShowBuilding(False, False)
@@ -495,7 +358,6 @@ Public Class BTLStructureVM
' seleziono pagina BottomPanel ' seleziono pagina BottomPanel
Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.PART) Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.PART)
' mostro barra di gestione pezzo ' mostro barra di gestione pezzo
'Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProjectVM.PartManager_Visibility))
Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProdProjManagerVM.PartManager_Visibility)) Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProdProjManagerVM.PartManager_Visibility))
' deseleziono le feature ' deseleziono le feature
If Not IsNothing(m_SelBTLPart.SelBTLFeatureVM) Then SelBTLPart.SelBTLFeatureVM = Nothing If Not IsNothing(m_SelBTLPart.SelBTLFeatureVM) Then SelBTLPart.SelBTLFeatureVM = Nothing
@@ -506,70 +368,10 @@ Public Class BTLStructureVM
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
' trovo ed evidenzio MachGroup e Duplo di questo pezzo ' trovo ed evidenzio MachGroup e Duplo di questo pezzo
Configuration.SetSearchPiece(m_SelBTLPart.nPartId) Configuration.SetSearchPiece(m_SelBTLPart.nPartId)
'If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
' Dim MachGroupList As New List(Of MyMachGroupVM)
' For Each Machgroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
' Dim bFound As Boolean = False
' For Each Part As PartVM In Machgroup.PartVMList
' If EgtDuploGetOriginal(Part.nPartId) = m_SelBTLPart.nPartId Then
' Part.SetSearchFound()
' bFound = True
' Else
' Part.ResetSearchFound()
' End If
' Next
' If bFound Then
' Machgroup.SetSearchFound()
' Else
' Machgroup.ResetSearchFound()
' End If
' Next
'End If
' seleziono pezzo nella scena ' seleziono pezzo nella scena
SceneSelPartSelection() SceneSelPartSelection()
Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False) Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False)
EgtZoom(ZM.ALL) EgtZoom(ZM.ALL)
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
' se modalità building, la tolgo
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then
ShowBuilding(False, False)
End If
' seleziono pezzo nella scena
SceneSelPartSelection()
' seleziono pezzo in Db geometrico
EgtBeamSetPart(m_SelBTLPart.nPartId)
' seleziono pagina BottomPanel
Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.PART)
' mostro barra di gestione pezzo
'Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProjectVM.PartManager_Visibility))
Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProdProjManagerVM.PartManager_Visibility))
' deseleziono le feature
If Not IsNothing(m_SelBTLPart.SelBTLFeatureVM) Then SelBTLPart.SelBTLFeatureVM = Nothing
' aggiorno stato selezionato tutto
Map.refShowBeamPanelVM.bShowAll = False
' trovo ed evidenzio MachGroup e Duplo di questo pezzo
Configuration.ResetSearchPiece(m_SelBTLPart.nPartId)
'If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
' Dim MachGroupList As New List(Of MyMachGroupVM)
' For Each Machgroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
' Dim bFound As Boolean = False
' For Each Part As PartVM In Machgroup.PartVMList
' If EgtDuploGetOriginal(Part.nPartId) = m_SelBTLPart.nPartId Then
' Part.SetSearchFound()
' bFound = True
' Else
' Part.ResetSearchFound()
' End If
' Next
' If bFound Then
' Machgroup.SetSearchFound()
' Else
' Machgroup.ResetSearchFound()
' End If
' Next
'End If
Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False)
EgtZoom(ZM.ALL)
End If End If
End If End If
NotifyPropertyChanged(NameOf(SelBTLPart)) NotifyPropertyChanged(NameOf(SelBTLPart))
@@ -256,6 +256,9 @@
<Compile Include="AboutBoxWindow\AboutBoxV.xaml.vb"> <Compile Include="AboutBoxWindow\AboutBoxV.xaml.vb">
<DependentUpon>AboutBoxV.xaml</DependentUpon> <DependentUpon>AboutBoxV.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="AddFeatureWnd\NewAddFeatureWndV.xaml.vb">
<DependentUpon>NewAddFeatureWndV.xaml</DependentUpon>
</Compile>
<Compile Include="BTLPartManager\BTLPartManagerV.xaml.vb"> <Compile Include="BTLPartManager\BTLPartManagerV.xaml.vb">
<DependentUpon>BTLPartManagerV.xaml</DependentUpon> <DependentUpon>BTLPartManagerV.xaml</DependentUpon>
</Compile> </Compile>
@@ -272,6 +275,9 @@
</Compile> </Compile>
<Compile Include="FeatureListManager\FeatureListManagerVM.vb" /> <Compile Include="FeatureListManager\FeatureListManagerVM.vb" />
<Compile Include="MachinePanel\MachinePanelVM.vb" /> <Compile Include="MachinePanel\MachinePanelVM.vb" />
<Compile Include="MacroFeatureWnd\NewMacroFeatureWnd.xaml.vb">
<DependentUpon>NewMacroFeatureWnd.xaml</DependentUpon>
</Compile>
<Compile Include="PartInRawPartManager\PartInRawPartManagerWndV.xaml.vb"> <Compile Include="PartInRawPartManager\PartInRawPartManagerWndV.xaml.vb">
<DependentUpon>PartInRawPartManagerWndV.xaml</DependentUpon> <DependentUpon>PartInRawPartManagerWndV.xaml</DependentUpon>
</Compile> </Compile>
@@ -532,6 +538,10 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="AddFeatureWnd\NewAddFeatureWndV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="BTLPartManager\BTLPartManagerV.xaml"> <Page Include="BTLPartManager\BTLPartManagerV.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
@@ -544,6 +554,10 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="MacroFeatureWnd\NewMacroFeatureWnd.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="PartInRawPartManager\PartInRawPartManagerWndV.xaml"> <Page Include="PartInRawPartManager\PartInRawPartManagerWndV.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
@@ -1136,6 +1150,12 @@
<ItemGroup> <ItemGroup>
<Resource Include="Resources\OpenProjectFileDialog\Archived.png" /> <Resource Include="Resources\OpenProjectFileDialog\Archived.png" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Resource Include="Resources\InstrumentPanel\Ott.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\InstrumentPanel\Vis.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup> <PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\EgtBEAMWALL.ViewerOptimizerR32.exe <PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\EgtBEAMWALL.ViewerOptimizerR32.exe
@@ -112,13 +112,88 @@ Public Class FeatureListManagerVM
NotifyPropertyChanged(NameOf(AddFeature_IsEnabled)) NotifyPropertyChanged(NameOf(AddFeature_IsEnabled))
End Sub End Sub
Friend Sub FeatureSelectionChanged() Friend Sub FeatureSelectionChanged()
NotifyPropertyChanged(NameOf(CopyFeature_IsEnabled)) NotifyPropertyChanged(NameOf(CopyFeature_IsEnabled))
NotifyPropertyChanged(NameOf(MacroFeature_IsEnabled)) NotifyPropertyChanged(NameOf(MacroFeature_IsEnabled))
NotifyPropertyChanged(NameOf(RemoveFeature_IsEnabled)) NotifyPropertyChanged(NameOf(RemoveFeature_IsEnabled))
End Sub End Sub
Private Sub CreateNewFeature(MacroListCount As Integer, nSelMacro As Integer, AddFeatureWndVM As AddFeatureWndVM, nNewFeatureId As Integer, bMacroFlag As Boolean, NewFeat As BTLFeatureM)
' verifico se una Macro è selezionata
If MacroListCount > 0 AndAlso nSelMacro >= 0 Then
' Creo nuova feature sulla base della Macro selezionata
' Creo table e setto variabili
CreateMacroTable()
Dim bOk As Boolean
If AddFeatureWndVM.nSelMacroDefault >= 0 Then
bOk = EgtLuaExecFile(AddFeatureWndVM.m_MacroCustomFilePathList(nSelMacro))
Else
bOk = EgtLuaExecFile(AddFeatureWndVM.m_MacroFilePathList(nSelMacro))
End If
' 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)
If NewFeat.nPRC = 900 Then NewFeat.sDES = "2"
' aggiorno la feature con nuovo valore
EgtBeamSetPart(Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId)
nNewFeatureId = EgtBeamAddProcess(NewFeat.nSelGRP, NewFeat.nPRC, NewFeat.nSelSIDE, NewFeat.sDES,
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
MyMachGroupPanelM.SetDuploModified(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 Sub
Private Sub CreateMacroTable()
Dim nMacroW, nMacroH As Integer
If Map.refProjectVM.BTLStructureVM.SelBTLPart.nROTATED = 0 OrElse Map.refProjectVM.BTLStructureVM.SelBTLPart.nROTATED = 180 Then
If Map.refProjectVM.BTLStructureVM.SelBTLPart.m_SelBTLFeatureVM.nSelSIDE = 1 OrElse Map.refProjectVM.BTLStructureVM.SelBTLPart.m_SelBTLFeatureVM.nSelSIDE = 3 Then
nMacroW = Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlW
nMacroH = Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlH
Else
nMacroW = Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlH
nMacroH = Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlW
End If
ElseIf Map.refProjectVM.BTLStructureVM.SelBTLPart.nROTATED = 90 OrElse Map.refProjectVM.BTLStructureVM.SelBTLPart.nROTATED = 270 Then
If Map.refProjectVM.BTLStructureVM.SelBTLPart.m_SelBTLFeatureVM.nSelSIDE = 1 OrElse Map.refProjectVM.BTLStructureVM.SelBTLPart.m_SelBTLFeatureVM.nSelSIDE = 3 Then
nMacroW = Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlH
nMacroH = Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlW
Else
nMacroW = Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlW
nMacroH = Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlH
End If
End If
EgtLuaCreateGlobTable("MACRO")
EgtLuaSetGlobNumVar("MACRO.L", Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlL)
EgtLuaSetGlobNumVar("MACRO.W", nMacroW)
EgtLuaSetGlobNumVar("MACRO.H", nMacroH)
EgtLuaSetGlobIntVar("MACRO.PROCID", Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.NewProcId())
End Sub
#End Region ' Methods #End Region ' Methods
#Region "COMMANDS" #Region "COMMANDS"
@@ -179,9 +254,14 @@ Public Class FeatureListManagerVM
If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then Return If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then Return
' apro finestra di creazione macro ' apro finestra di creazione macro
Dim MacroFeatureWndVM As New MacroFeatureWndVM() Dim MacroFeatureWndVM As New MacroFeatureWndVM()
Dim MacroFeatureWnd As New MacroFeatureWndV(Application.Current.MainWindow, MacroFeatureWndVM) If bOnlyProd Then
If MacroFeatureWnd.ShowDialog() Then Dim NewMacroFeatureWnd As New NewMacroFeatureWnd(Application.Current.MainWindow, MacroFeatureWndVM)
If NewMacroFeatureWnd.ShowDialog() Then
End If
Else
Dim MacroFeatureWnd As New MacroFeatureWndV(Application.Current.MainWindow, MacroFeatureWndVM)
If MacroFeatureWnd.ShowDialog() Then
End If
End If End If
End Sub End Sub
@@ -209,54 +289,24 @@ Public Class FeatureListManagerVM
If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then Return If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then Return
' apro finestra di definizione nuova feature ' apro finestra di definizione nuova feature
Dim AddFeatureWndVM As New AddFeatureWndVM() Dim AddFeatureWndVM As New AddFeatureWndVM()
Dim AddFeatureWnd As New AddFeatureWndV(Application.Current.MainWindow, AddFeatureWndVM) Dim NewFeat As BTLFeatureM = Nothing
If AddFeatureWnd.ShowDialog() Then Dim nNewFeatureId As Integer = 0
Dim NewFeat As BTLFeatureM Dim bMacroFlag As Boolean = False
Dim nNewFeatureId As Integer = 0 If bOnlyProd Then
Dim bMacroFlag As Boolean = False Dim AddNewFeatureWnd As New NewAddFeatureWndV(Application.Current.MainWindow, AddFeatureWndVM)
' verifico se una Macro è selezionata If AddNewFeatureWnd.ShowDialog() Then
If AddFeatureWndVM.MacroList.Count > 0 AndAlso AddFeatureWndVM.nSelMacro >= 0 Then ' verifico se una Macro è selezionata
' Creo nuova feature sulla base della Macro selezionata If AddFeatureWndVM.nSelMacroDefault >= 0 Then
' Creo table e setto variabili CreateNewFeature(AddFeatureWndVM.MacroDefaultList.Count, AddFeatureWndVM.nSelMacroDefault, AddFeatureWndVM, nNewFeatureId, bMacroFlag, NewFeat)
EgtLuaCreateGlobTable("MACRO") Else
EgtLuaSetGlobNumVar("MACRO.L", Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlL) CreateNewFeature(AddFeatureWndVM.MacroCustomList.Count, AddFeatureWndVM.nSelMacroCustom, AddFeatureWndVM, nNewFeatureId, bMacroFlag, NewFeat)
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 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 End If
' se è stata creata Else
If nNewFeatureId <> GDB_ID.NULL Then Dim AddFeatureWnd As New AddFeatureWndV(Application.Current.MainWindow, AddFeatureWndVM)
MyMachGroupPanelM.SetDuploModified(Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId) If AddFeatureWnd.ShowDialog() Then
' la aggiungo a struttura BTL corrente ' verifico se una Macro è selezionata
NewFeat = BTLFeatureM.CreateBTLFeature(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM, nNewFeatureId) CreateNewFeature(AddFeatureWndVM.MacroCustomList.Count, AddFeatureWndVM.nSelMacroCustom, AddFeatureWndVM, nNewFeatureId, bMacroFlag, NewFeat)
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 If End If
End Sub End Sub
@@ -15,7 +15,7 @@
</Style> </Style>
</StackPanel.Style> </StackPanel.Style>
<TextBlock Text="{Binding Message}" <TextBlock Text="{Binding Message}"
Visibility="{Binding Message_Visibility}" Visibility="{Binding Message_Visibility}"
Style="{StaticResource OptionTextBlock}"/> Style="{StaticResource OptionTextBlock}"/>
<TextBox Text="{Binding Text, UpdateSourceTrigger=PropertyChanged}" <TextBox Text="{Binding Text, UpdateSourceTrigger=PropertyChanged}"
Width="200" Width="200"
@@ -442,7 +442,6 @@ Public Class FreeContourManagerVM
Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProdProjManagerVM.PartManager_Visibility)) Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProdProjManagerVM.PartManager_Visibility))
' attivo pannello ' attivo pannello
Map.refProjectVM.SetFreeContourManager_Visibility(True) Map.refProjectVM.SetFreeContourManager_Visibility(True)
Map.refProjWndVM.SetFreeContourManager_Visibility(True)
EgtDraw() EgtDraw()
End Sub End Sub
@@ -531,7 +530,6 @@ Public Class FreeContourManagerVM
End If End If
' disattivo pannello ' disattivo pannello
Map.refProjectVM.SetFreeContourManager_Visibility(False) Map.refProjectVM.SetFreeContourManager_Visibility(False)
Map.refProjWndVM.SetFreeContourManager_Visibility(False)
' attivo bottone edit ' attivo bottone edit
SelFeature.RefreshFCMBtnVisibility() SelFeature.RefreshFCMBtnVisibility()
' resetto tutte le variabili correnti ' resetto tutte le variabili correnti
@@ -45,18 +45,20 @@
<Image Source="/Resources/InstrumentPanel/Statistics.png" Stretch="Uniform"/> <Image Source="/Resources/InstrumentPanel/Statistics.png" Stretch="Uniform"/>
</ToggleButton> </ToggleButton>
<Button Content="VIS" <Button Command="{Binding Visualization_Command}"
Command="{Binding Visualization_Command}"
ToolTip="{Binding Statistics_Msg}" ToolTip="{Binding Statistics_Msg}"
Style="{StaticResource ToolBar_Button}" Style="{StaticResource ToolBar_Button}"
Visibility="{Binding VisStatistic_Visibility}" Visibility="{Binding VisStatistic_Visibility}"
IsEnabled="{Binding VisStatistic_IsEnabled}"/> IsEnabled="{Binding VisStatistic_IsEnabled}">
<Image Source="/Resources/InstrumentPanel/Vis.png" Stretch="Uniform"/>
</Button>
<Button Content="OTT" <Button Command="{Binding Optimizer_Command}"
Command="{Binding Optimizer_Command}"
ToolTip="{Binding Statistics_Msg}" ToolTip="{Binding Statistics_Msg}"
Style="{StaticResource ToolBar_Button}" Style="{StaticResource ToolBar_Button}"
Visibility="{Binding OtStatistic_Visibility}" Visibility="{Binding OtStatistic_Visibility}"
IsEnabled="{Binding OtStatistic_IsEnabled}"/> IsEnabled="{Binding OtStatistic_IsEnabled}">
<Image Source="/Resources/InstrumentPanel/Ott.png" Stretch="Uniform"/>
</Button>
</EgtFloating:EgtFloatingPanel> </EgtFloating:EgtFloatingPanel>
@@ -24,7 +24,8 @@
<DataGridCheckBoxColumn x:Key="colDO" Binding="{Binding bDO, UpdateSourceTrigger=PropertyChanged}" <DataGridCheckBoxColumn x:Key="colDO" Binding="{Binding bDO, UpdateSourceTrigger=PropertyChanged}"
MinWidth="28"> MinWidth="28">
<DataGridCheckBoxColumn.Header> <DataGridCheckBoxColumn.Header>
<CheckBox IsChecked="{Binding Path=Tag.bDOALL, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureListV}}}"/> <CheckBox IsChecked="{Binding Path=Tag.bDOALL, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureListV}}}"
HorizontalAlignment="Center"/>
</DataGridCheckBoxColumn.Header> </DataGridCheckBoxColumn.Header>
</DataGridCheckBoxColumn> </DataGridCheckBoxColumn>
<!--Validità feature--> <!--Validità feature-->
@@ -19,13 +19,16 @@
Style="{StaticResource DataGrid_CustomHighLight}"> Style="{StaticResource DataGrid_CustomHighLight}">
<DataGrid.Resources> <DataGrid.Resources>
<!--DO - Abilitazione--> <!--DO - Abilitazione-->
<DataGridCheckBoxColumn x:Key="colDO" Binding="{Binding bDO,UpdateSourceTrigger=PropertyChanged}"> <DataGridCheckBoxColumn x:Key="colDO" Binding="{Binding bDO, UpdateSourceTrigger=PropertyChanged}"
MinWidth="28">
<!--<DataGridCheckBoxColumn.Header> <!--<DataGridCheckBoxColumn.Header>
<TextBlock Text="{Binding Path=DataContext.DO_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureInPartInRawPartListV}}}"/> <TextBlock Text="{Binding Path=DataContext.DO_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureInPartInRawPartListV}}}"/>
</DataGridCheckBoxColumn.Header>--> </DataGridCheckBoxColumn.Header>-->
<DataGridCheckBoxColumn.HeaderTemplate> <DataGridCheckBoxColumn.HeaderTemplate>
<DataTemplate> <DataTemplate>
<TextBlock Text="{Binding DataContext.DO_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/> <!--<TextBlock Text="{Binding DataContext.DO_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>-->
<CheckBox IsChecked="{Binding Path=Tag.bDOALL, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureListV}}}"
HorizontalAlignment="Center"/>
</DataTemplate> </DataTemplate>
</DataGridCheckBoxColumn.HeaderTemplate> </DataGridCheckBoxColumn.HeaderTemplate>
</DataGridCheckBoxColumn> </DataGridCheckBoxColumn>
@@ -34,8 +34,8 @@
<DataGridTemplateColumn.CellTemplate> <DataGridTemplateColumn.CellTemplate>
<DataTemplate> <DataTemplate>
<CheckBox IsChecked="{Binding bCustom, UpdateSourceTrigger=PropertyChanged}" <CheckBox IsChecked="{Binding bCustom, UpdateSourceTrigger=PropertyChanged}"
Visibility="{Binding Tag, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" Visibility="{Binding Tag, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"
HorizontalAlignment="Center"/> HorizontalAlignment="Center"/>
</DataTemplate> </DataTemplate>
</DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn> </DataGridTemplateColumn>
@@ -108,9 +108,11 @@
</DataGridTextColumn> </DataGridTextColumn>
<!--ROT - Rotazione--> <!--ROT - Rotazione-->
<DataGridTemplateColumn x:Key="colROT" SortMemberPath="dROT"> <DataGridTemplateColumn x:Key="colROT" SortMemberPath="dROT">
<DataGridTemplateColumn.Header> <DataGridTemplateColumn.HeaderTemplate>
<TextBlock Text="Rotazione"/> <DataTemplate>
</DataGridTemplateColumn.Header> <TextBlock Text="{Binding Path=DataContext.ROTATION_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartInRawPartListV}}}"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate> <DataGridTemplateColumn.CellTemplate>
<DataTemplate> <DataTemplate>
<Grid> <Grid>
@@ -143,9 +145,11 @@
</DataGridTemplateColumn> </DataGridTemplateColumn>
<!--INV - Inversione--> <!--INV - Inversione-->
<DataGridTemplateColumn x:Key="colFLIP"> <DataGridTemplateColumn x:Key="colFLIP">
<DataGridTemplateColumn.Header> <DataGridTemplateColumn.HeaderTemplate>
<TextBlock Text="Inversione"/> <DataTemplate>
</DataGridTemplateColumn.Header> <TextBlock Text="{Binding Path=DataContext.INVERSION_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartInRawPartListV}}}"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate> <DataGridTemplateColumn.CellTemplate>
<DataTemplate> <DataTemplate>
<CheckBox IsChecked="{Binding bFLIP, UpdateSourceTrigger=PropertyChanged}" <CheckBox IsChecked="{Binding bFLIP, UpdateSourceTrigger=PropertyChanged}"
@@ -114,6 +114,18 @@ Public Class PartInRawPartListVM
End Get End Get
End Property End Property
Public ReadOnly Property ROTATION_Msg As String
Get
Return EgtMsg(61737)
End Get
End Property
Public ReadOnly Property INVERSION_Msg As String
Get
Return EgtMsg(61738)
End Get
End Property
#End Region ' Messages #End Region ' Messages
#Region "CONSTRUCTOR" #Region "CONSTRUCTOR"
@@ -143,6 +155,11 @@ Public Class PartInRawPartListVM
m_colPartInRawPart_PosY = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_POSY) m_colPartInRawPart_PosY = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_POSY)
' aggiorno la visibilità delle colonne ' aggiorno la visibilità delle colonne
For Each col In PartInRawPartColumns For Each col In PartInRawPartColumns
If Not bOnlyProd AndAlso nMachType = MachineType.BEAM AndAlso (col.Name.Equals(COL_ROT) OrElse col.Name.Equals(COL_FLIP) OrElse col.Name.Equals(COL_POSX)) Then
col.Visible = False
Else
col.Visible = True
End If
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed) col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
Next Next
End Sub End Sub
@@ -133,10 +133,12 @@
</DataGridTextColumn> </DataGridTextColumn>
<!--PosZ - Posizione in Z--> <!--PosZ - Posizione in Z-->
<DataGridTextColumn x:Key="colPOSZ" Binding="{Binding sPosZ}"> <DataGridTextColumn x:Key="colPOSZ" Binding="{Binding sPosZ}">
<DataGridTextColumn.Header> <DataGridTextColumn.HeaderTemplate>
<TextBlock Text="{Binding Path=DataContext.PosZ_Msg, <DataTemplate>
<TextBlock Text="{Binding Path=DataContext.PosZ_Msg,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:RawPartListV}}}"/> RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:RawPartListV}}}"/>
</DataGridTextColumn.Header> </DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.EditingElementStyle> <DataGridTextColumn.EditingElementStyle>
<Style TargetType="{x:Type TextBox}"> <Style TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="Blue" /> <Setter Property="Foreground" Value="Blue" />
@@ -1,9 +1,7 @@
Imports System.Collections.ObjectModel Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtBEAMWALL.Core Imports EgtBEAMWALL.Core
Imports EgtUILib Imports EgtUILib
Imports EgtWPFLib5 Imports EgtWPFLib5
Imports Org.BouncyCastle.Crypto.Digests.SkeinEngine
Public Class LeftPanelVM Public Class LeftPanelVM
Inherits VMBase Inherits VMBase
@@ -45,6 +43,18 @@ Public Class LeftPanelVM
NotifyPropertyChanged(NameOf(Parameters_IsEnabled)) NotifyPropertyChanged(NameOf(Parameters_IsEnabled))
End Sub End Sub
Private m_Data_IsEnabled As Boolean = False
Public ReadOnly Property Data_IsEnabled As Boolean
Get
Return m_Data_IsEnabled
End Get
End Property
Friend Sub SetData_IsEnabled(bIsEnabled As Boolean)
m_Data_IsEnabled = bIsEnabled
NotifyPropertyChanged(NameOf(Data_IsEnabled))
End Sub
' Definizione comandi ' Definizione comandi
Private m_cmdData As ICommand Private m_cmdData As ICommand
Private m_cmdParameter As ICommand Private m_cmdParameter As ICommand
@@ -83,6 +83,7 @@
HorizontalAlignment="Left"> HorizontalAlignment="Left">
<Button Command="{Binding Data_Command}" <Button Command="{Binding Data_Command}"
ToolTip="{Binding Data_ToolTip}" ToolTip="{Binding Data_ToolTip}"
IsEnabled="{Binding Data_IsEnabled}"
Style="{StaticResource LeftPanel_Button}"> Style="{StaticResource LeftPanel_Button}">
<Image Source="/Resources/InstrumentPanel/Analyze.png" Stretch="Uniform"/> <Image Source="/Resources/InstrumentPanel/Analyze.png" Stretch="Uniform"/>
</Button> </Button>
@@ -24,39 +24,13 @@ Public Class MyMachGroupPanelVM
Dim nSelBTLPartId As Integer = Map.refProjectVM.BTLStructureVM.SelBTLParts(0).nPartId Dim nSelBTLPartId As Integer = Map.refProjectVM.BTLStructureVM.SelBTLParts(0).nPartId
' deevidenzio MachGroup e Duplo di questo pezzo ' deevidenzio MachGroup e Duplo di questo pezzo
Configuration.ResetSearchPiece(nSelBTLPartId) Configuration.ResetSearchPiece(nSelBTLPartId)
'If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
' Dim MachGroupList As New List(Of MyMachGroupVM)
' For Each Machgroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
' Dim bFound As Boolean = False
' For Each Part As PartVM In Machgroup.PartVMList
' If EgtDuploGetOriginal(Part.nPartId) = nSelBTLPartId Then
' Part.ResetSearchFound()
' bFound = True
' End If
' Next
' If bFound Then
' Machgroup.ResetSearchFound()
' End If
' Next
'End If
End If End If
End If End If
If Not IsNothing(SelectedMachGroup) AndAlso Not IsNothing(SelectedMachGroup.SelPart) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) Then If Not IsNothing(SelectedMachGroup) AndAlso Not IsNothing(SelectedMachGroup.SelPart) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
Configuration.ResetSearch(SelectedMachGroup.SelPart.nPartId) Configuration.ResetSearch(SelectedMachGroup.SelPart.nPartId)
'For BTLPartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1
' Dim nDuploOriginalId As Integer = 0
' If EgtGetInfo(SelectedMachGroup.SelPart.nPartId, GDB_SI_DUPSOU, nDuploOriginalId) AndAlso nDuploOriginalId > 0 AndAlso nDuploOriginalId = Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).nPartId Then
' Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).ResetSearchFound()
' Exit For
' End If
'Next
End If End If
' se modalita' assemblato ' se modalita' assemblato
Configuration.AssembledMode(Map.refShowBeamPanelVM.ShowBuilding_IsChecked) Configuration.AssembledMode(Map.refShowBeamPanelVM.ShowBuilding_IsChecked)
'If Map.refShowBeamPanelVM.ShowBuilding_IsChecked AndAlso Map.refShowBeamPanelVM.bShowAll Then
' ' devo smontarlo prima di calcolare le travi, altrimenti non trova i pezzi
' Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
'End If
' se precedente pezzo selezionato ' se precedente pezzo selezionato
If Not IsNothing(value) AndAlso Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART AndAlso Map.refProjectVM.BTLStructureVM.SelBTLParts.Count > 0 Then If Not IsNothing(value) AndAlso Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART AndAlso Map.refProjectVM.BTLStructureVM.SelBTLParts.Count > 0 Then
Dim SelBTLPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLParts(0) Dim SelBTLPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLParts(0)
@@ -1,6 +1,4 @@
Imports System.Collections.ObjectModel Imports System.Collections.ObjectModel
Imports System.Collections.Specialized
Imports System.ComponentModel
Imports System.IO Imports System.IO
Imports System.Windows.Threading Imports System.Windows.Threading
Imports EgtBEAMWALL.Core Imports EgtBEAMWALL.Core
@@ -30,47 +28,15 @@ Public Class MyMachGroupVM
Dim nSelBTLPartId As Integer = Map.refProjectVM.BTLStructureVM.SelBTLParts(0).nPartId Dim nSelBTLPartId As Integer = Map.refProjectVM.BTLStructureVM.SelBTLParts(0).nPartId
' deevidenzio MachGroup e Duplo di questo pezzo ' deevidenzio MachGroup e Duplo di questo pezzo
Configuration.ResetSearchPiece(nSelBTLPartId) Configuration.ResetSearchPiece(nSelBTLPartId)
'If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
' Dim MachGroupList As New List(Of MyMachGroupVM)
' For Each Machgroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
' Dim bFound As Boolean = False
' For Each Part As PartVM In Machgroup.PartVMList
' If EgtDuploGetOriginal(Part.nPartId) = nSelBTLPartId Then
' Part.ResetSearchFound()
' bFound = True
' End If
' Next
' If bFound Then
' Machgroup.ResetSearchFound()
' End If
' Next
'End If
End If End If
If Not IsNothing(m_SelPart) Then If Not IsNothing(m_SelPart) Then
' deevidenzio BTLPart di questo pezzo ' deevidenzio BTLPart di questo pezzo
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
Configuration.ResetSearch(m_SelPart.nPartId) Configuration.ResetSearch(m_SelPart.nPartId)
'For BTLPartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1
' Dim nDuploOriginalId As Integer = 0
' If EgtGetInfo(m_SelPart.nPartId, GDB_SI_DUPSOU, nDuploOriginalId) AndAlso nDuploOriginalId > 0 AndAlso nDuploOriginalId = Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).nPartId Then
' Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).ResetSearchFound()
' Exit For
' End If
'Next
End If End If
End If End If
' se modalita' assemblato ' se modalita' assemblato
Configuration.AssembledMode(Map.refShowBeamPanelVM.ShowBuilding_IsChecked) Configuration.AssembledMode(Map.refShowBeamPanelVM.ShowBuilding_IsChecked)
'If Map.refShowBeamPanelVM.ShowBuilding_IsChecked AndAlso Map.refShowBeamPanelVM.bShowAll Then
' ' devo smontarlo prima di calcolare le travi, altrimenti non trova i pezzi
' Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
'End If
'If Map.refProjectVM.BTLStructureVM.SelBTLParts.Count > 0 Then
' ' deseleziono pezzo in lista BTLPart
' For BTLPartIndex = Map.refProjectVM.BTLStructureVM.SelBTLParts.Count - 1 To 0 Step -1
' Map.refProjectVM.BTLStructureVM.SelBTLParts.Remove(Map.refProjectVM.BTLStructureVM.SelBTLParts(BTLPartIndex))
' Next
'End If
End If End If
m_SelPart = value m_SelPart = value
' seleziono pezzo ' seleziono pezzo
@@ -78,10 +44,11 @@ Public Class MyMachGroupVM
If Not IsNothing(value) Then If Not IsNothing(value) Then
If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
' imposto modalita' prod su vista feature ' imposto modalita' prod su vista feature
'Map.refProjectVM.SelProdProj = ProdProj.PROD
Map.refProdProjManagerVM.SelProdProj = ProdProj.PROD Map.refProdProjManagerVM.SelProdProj = ProdProj.PROD
'' deseleziono pezzo in lista BTLPart ' deseleziono pezzo in lista BTLPart
'Map.refProjectVM.BTLStructureVM.SelBTLParts.Clear() For BTLPartIndex = Map.refProjectVM.BTLStructureVM.SelBTLParts.Count - 1 To 0 Step -1
Map.refProjectVM.BTLStructureVM.SelBTLParts.RemoveFromList(Map.refProjectVM.BTLStructureVM.SelBTLParts(BTLPartIndex))
Next
End If End If
EgtSelectObj(SelPart.nPartId) EgtSelectObj(SelPart.nPartId)
If Map.refMainMenuVM.SelPage = Pages.MACHINING Then If Map.refMainMenuVM.SelPage = Pages.MACHINING Then
@@ -89,15 +56,7 @@ Public Class MyMachGroupVM
End If End If
' trovo ed evidenzio BTLPart di questo pezzo ' trovo ed evidenzio BTLPart di questo pezzo
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
'Dim MachGroupList As New List(Of MyMachGroupVM)
Configuration.SetSearch(m_SelPart.nPartId) Configuration.SetSearch(m_SelPart.nPartId)
'For BTLPartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1
' Dim nDuploOriginalId As Integer = 0
' If EgtGetInfo(m_SelPart.nPartId, GDB_SI_DUPSOU, nDuploOriginalId) AndAlso nDuploOriginalId > 0 AndAlso nDuploOriginalId = Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).nPartId Then
' Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).SetSearchFound()
' Exit For
' End If
'Next
End If End If
End If End If
@@ -150,14 +109,6 @@ Public Class MyMachGroupVM
' verifico se la dimensione e' maggiore del box minimo dei pezzi ' verifico se la dimensione e' maggiore del box minimo dei pezzi
Dim b3Parts As New BBox3d Dim b3Parts As New BBox3d
Configuration.VerifyMaxDimension(m_PartVMList, b3Parts) Configuration.VerifyMaxDimension(m_PartVMList, b3Parts)
'Dim nBoxLayerId As Integer = EgtGetFirstNameInGroup(m_PartVMList(0).nPartId, "Box")
'EgtGetBBoxGlob(nBoxLayerId, GDB_BB.EXACT, b3Parts)
'For PartIndex = 1 To m_PartVMList.Count - 1
' Dim b3Part As New BBox3d
' nBoxLayerId = EgtGetFirstNameInGroup(m_PartVMList(PartIndex).nPartId, "Box")
' EgtGetBBoxGlob(nBoxLayerId, GDB_BB.EXACT, b3Part)
' b3Parts.Add(b3Part)
'Next
Dim b3RawPart As New BBox3d Dim b3RawPart As New BBox3d
EgtGetRawPartBBox(nRawPartId, b3RawPart) EgtGetRawPartBBox(nRawPartId, b3RawPart)
Dim dMinValue As Double = 0 Dim dMinValue As Double = 0
@@ -175,19 +126,6 @@ Public Class MyMachGroupVM
' riporto il grezzo nell'angolo tavola di origine ' riporto il grezzo nell'angolo tavola di origine
Dim b3Tab As New BBox3d Dim b3Tab As New BBox3d
Configuration.SelectCorner(b3Tab, nRawPartId) Configuration.SelectCorner(b3Tab, nRawPartId)
'EgtGetTableArea(1, b3Tab)
'Dim p3OrigOnTab As Point3d
'Select Case CurrentMachine.OrigCorner
' Case MCH_CR.BL
' p3OrigOnTab = New Point3d(CurrentMachine.OrigOffsX, CurrentMachine.OrigOffsY, 0)
' Case MCH_CR.BR
' p3OrigOnTab = New Point3d(b3Tab.DimX() - CurrentMachine.OrigOffsX, CurrentMachine.OrigOffsY, 0)
' Case MCH_CR.TL
' p3OrigOnTab = New Point3d(CurrentMachine.OrigOffsX, b3Tab.DimY() - CurrentMachine.OrigOffsY, 0)
' Case MCH_CR.TR
' p3OrigOnTab = New Point3d(b3Tab.DimX() - CurrentMachine.OrigOffsX, b3Tab.DimY() - CurrentMachine.OrigOffsY, 0)
'End Select
'EgtMoveToCornerRawPart(nRawPartId, p3OrigOnTab, CurrentMachine.OrigCorner)
' sposto tutti i pezzi di quanto si e' accorciato il grezzo ' sposto tutti i pezzi di quanto si e' accorciato il grezzo
If CurrentMachine.NestingCorner = MCH_CR.TR OrElse CurrentMachine.NestingCorner = MCH_CR.BR Then If CurrentMachine.NestingCorner = MCH_CR.TR OrElse CurrentMachine.NestingCorner = MCH_CR.BR Then
For Each Part In m_PartVMList For Each Part In m_PartVMList
@@ -223,14 +161,6 @@ Public Class MyMachGroupVM
' verifico se la dimensione e' maggiore del box minimo dei pezzi ' verifico se la dimensione e' maggiore del box minimo dei pezzi
Dim b3Parts As New BBox3d Dim b3Parts As New BBox3d
Configuration.VerifyMaxDimension(m_PartVMList, b3Parts) Configuration.VerifyMaxDimension(m_PartVMList, b3Parts)
'Dim nBoxLayerId As Integer = EgtGetFirstNameInGroup(m_PartVMList(0).nPartId, "Box")
'EgtGetBBoxGlob(nBoxLayerId, GDB_BB.EXACT, b3Parts)
'For PartIndex = 1 To m_PartVMList.Count - 1
' Dim b3Part As New BBox3d
' nBoxLayerId = EgtGetFirstNameInGroup(m_PartVMList(PartIndex).nPartId, "Box")
' EgtGetBBoxGlob(nBoxLayerId, GDB_BB.EXACT, b3Part)
' b3Parts.Add(b3Part)
'Next
Dim b3RawPart As New BBox3d Dim b3RawPart As New BBox3d
EgtGetRawPartBBox(nRawPartId, b3RawPart) EgtGetRawPartBBox(nRawPartId, b3RawPart)
Dim dMinValue As Double = 0 Dim dMinValue As Double = 0
@@ -248,19 +178,6 @@ Public Class MyMachGroupVM
' riporto il grezzo nell'angolo tavola di origine ' riporto il grezzo nell'angolo tavola di origine
Dim b3Tab As New BBox3d Dim b3Tab As New BBox3d
Configuration.SelectCorner(b3Tab, nRawPartId) Configuration.SelectCorner(b3Tab, nRawPartId)
'EgtGetTableArea(1, b3Tab)
'Dim p3OrigOnTab As Point3d
'Select Case CurrentMachine.OrigCorner
' Case MCH_CR.BL
' p3OrigOnTab = New Point3d(CurrentMachine.OrigOffsX, CurrentMachine.OrigOffsY, 0)
' Case MCH_CR.BR
' p3OrigOnTab = New Point3d(b3Tab.DimX() - CurrentMachine.OrigOffsX, CurrentMachine.OrigOffsY, 0)
' Case MCH_CR.TL
' p3OrigOnTab = New Point3d(CurrentMachine.OrigOffsX, b3Tab.DimY() - CurrentMachine.OrigOffsY, 0)
' Case MCH_CR.TR
' p3OrigOnTab = New Point3d(b3Tab.DimX() - CurrentMachine.OrigOffsX, b3Tab.DimY() - CurrentMachine.OrigOffsY, 0)
'End Select
'EgtMoveToCornerRawPart(nRawPartId, p3OrigOnTab, CurrentMachine.OrigCorner)
' sposto tutti i pezzi di quanto si e' accorciato il grezzo ' sposto tutti i pezzi di quanto si e' accorciato il grezzo
If CurrentMachine.NestingCorner = MCH_CR.TR OrElse CurrentMachine.NestingCorner = MCH_CR.TL Then If CurrentMachine.NestingCorner = MCH_CR.TR OrElse CurrentMachine.NestingCorner = MCH_CR.TL Then
For Each Part In m_PartVMList For Each Part In m_PartVMList
@@ -1,7 +1,6 @@
Imports System.Collections.ObjectModel Imports System.Collections.ObjectModel
Imports System.Collections.Specialized Imports System.Collections.Specialized
Imports System.ComponentModel Imports System.ComponentModel
Imports System.IO
Imports EgtBEAMWALL.Core Imports EgtBEAMWALL.Core
Imports EgtBEAMWALL.DataLayer.DatabaseModels Imports EgtBEAMWALL.DataLayer.DatabaseModels
Imports EgtUILib Imports EgtUILib
@@ -201,19 +200,47 @@ Public Class PartVM
' recupero box del layer box ' recupero box del layer box
Dim b3Box As New BBox3d Dim b3Box As New BBox3d
EgtGetBBoxGlob(nBoxLayerId, GDB_BB.STANDARD, b3Box) EgtGetBBoxGlob(nBoxLayerId, GDB_BB.STANDARD, b3Box)
If EgtRotate(nPartId, b3Box.Center, Vector3d.X_AX, 180, GDB_RT.GLOB) Then Dim vtAxes As Vector3d
' se travi ruoto attorno all'asse Z
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then
vtAxes = Vector3d.Z_AX
' se pareti ruoto attorno all'asse X
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
vtAxes = Vector3d.X_AX
End If
If EgtRotate(nPartId, b3Box.Center, vtAxes, 180, GDB_RT.GLOB) Then
m_PartM.nFLIP = If(value, 180, 0) m_PartM.nFLIP = If(value, 180, 0)
EgtSetInfo(nPartId, MGR_PRT_FLIP, If(value, 180, 0)) EgtSetInfo(nPartId, MGR_PRT_FLIP, If(value, 180, 0))
Else Else
NotifyPropertyChanged(NameOf(bFLIP)) NotifyPropertyChanged(NameOf(bFLIP))
End If End If
' recupero box del pezzo If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL Then
Dim b3Part As New BBox3d ' recupero box del pezzo
EgtGetBBoxGlob(nPartId, GDB_BB.STANDARD, b3Part) Dim b3Part As New BBox3d
' calcolo distanza tra i box EgtGetBBoxGlob(nPartId, GDB_BB.STANDARD, b3Part)
Dim vtDeltaBox As Vector3d = b3Box.Min - b3Part.Min ' calcolo distanza tra i box
' reinserisco il pezzo nel grezzo Dim vtDeltaBox As Vector3d = b3Box.Min - b3Part.Min
EgtAddPartToRawPart(nPartId, New Point3d(dTempPosX - vtDeltaBox.x, dTempPosY - vtDeltaBox.y, 0), ParentMachGroupVM.MyMachGroupM.nRawPartId) ' reinserisco il pezzo nel grezzo
EgtAddPartToRawPart(nPartId, New Point3d(dTempPosX - vtDeltaBox.x, dTempPosY - vtDeltaBox.y, 0), ParentMachGroupVM.MyMachGroupM.nRawPartId)
ElseIf bOnlyProd AndAlso Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
' elimino vecchio grezzo ed eseguo script creazione nuovo
DeleteOldRaw()
Dim sLogPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\RawPartLog.txt"
If Not ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then
EgtOutLog("Fallita creazione barra nell'ExecBeam in bFlip")
' elimino vecchio grezzo ed eseguo script creazione nuovo
DeleteOldRaw()
If EgtRotate(nPartId, b3Box.Center, vtAxes, 180, GDB_RT.GLOB) Then
m_PartM.nFLIP = 180
EgtSetInfo(nPartId, MGR_PRT_FLIP, 180)
Else
NotifyPropertyChanged(NameOf(m_PartM.nFLIP))
End If
If Not ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then
EgtOutLog("Fallita esecuzione ExecBeam. ERRORE")
End If
End If
End If
' lo riseleziono ' lo riseleziono
EgtSelectObj(nPartId) EgtSelectObj(nPartId)
' resetto validazione del pezzo ' resetto validazione del pezzo
@@ -293,66 +320,122 @@ Public Class PartVM
End Sub End Sub
Private Sub Rotate(IsPositive As Boolean) Private Sub Rotate(IsPositive As Boolean)
' salvo posizione If bOnlyProd AndAlso Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
Dim dTempPosX As Double = m_PartM.dPOSX ' elimino vecchio grezzo ed eseguo script creazione nuovo
Dim dTempPosY As Double = m_PartM.dPOSY DeleteOldRaw()
' tolgo il pezzo dal grezzo ' recupero layer del box
EgtRemovePartFromRawPart(nPartId) Dim nBoxLayerId As Integer = EgtGetFirstNameInGroup(nPartId, "Box")
' recupero layer del box ' recupero box del layer box
Dim nBoxLayerId As Integer = EgtGetFirstNameInGroup(nPartId, "Box") Dim b3Box As New BBox3d
' recupero box del layer box EgtGetBBoxGlob(nBoxLayerId, GDB_BB.STANDARD, b3Box)
Dim b3Box As New BBox3d ' se invertito lo reinverto
EgtGetBBoxGlob(nBoxLayerId, GDB_BB.STANDARD, b3Box) If bFLIP Then EgtRotate(nPartId, b3Box.Center, Vector3d.Z_AX, 180, GDB_RT.GLOB)
' se invertito lo reinverto ' eseguo rotazione attorno asse X
Dim bFliped As Boolean = bFLIP Dim dRot As Integer = 0
If bFliped Then EgtRotate(nPartId, b3Box.Center, Vector3d.X_AX, 180, GDB_RT.GLOB) If dW <> dH Then
Dim dAng As Double = If(IsPositive, 90, -90) dRot = If(IsPositive, 180, -180)
' eseguo rotazione ElseIf dW = dH Then
Dim bOk As Boolean = EgtRotate(nPartId, b3Box.Center, -Vector3d.Z_AX, dAng, GDB_RT.GLOB) dRot = If(IsPositive, 90, -90)
If bOk Then
Dim TempRot = m_PartM.dROT
TempRot += dAng
If TempRot >= 360 Then
TempRot -= 360
ElseIf TempRot < 0 Then
TempRot += 360
End If End If
m_PartM.dROT = TempRot Dim bOk As Boolean = EgtRotate(nPartId, b3Box.Center, Vector3d.X_AX, dRot, GDB_RT.GLOB)
EgtSetInfo(nPartId, MGR_PRT_ROT, m_PartM.dROT) If bOk Then
End If Dim TempRot = m_PartM.dROT
' ripristino eventuale inversione TempRot += dRot
If bFliped Then EgtRotate(nPartId, b3Box.Center, Vector3d.X_AX, 180, GDB_RT.GLOB) If TempRot >= 360 Then
' recupero box del pezzo TempRot -= 360
Dim b3Part As New BBox3d ElseIf TempRot < 0 Then
EgtGetBBoxGlob(nPartId, GDB_BB.STANDARD, b3Part) TempRot += 360
'aggiorno box del box con rotazione End If
EgtGetBBoxGlob(nBoxLayerId, GDB_BB.STANDARD, b3Box) m_PartM.dROT = TempRot
' calcolo distanza tra i box EgtSetInfo(nPartId, MGR_PRT_ROT, m_PartM.dROT)
Dim vtDeltaBox As Vector3d = b3Box.Min - b3Part.Min ' Vector3d.NULL End If
' calcolo posizione rispetto al riferimento ' ripristino eventuale inversione
Select Case Map.refProjectVM.BTLStructureVM.nPROJTYPE If bFLIP Then EgtRotate(nPartId, b3Box.Center, Vector3d.Z_AX, 180, GDB_RT.GLOB)
Case BWType.WALL Dim sLogPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\RawPartLog.txt"
' se parete, valuto angolo di posizionamento If Not ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then
Select Case CurrentMachine.NestingCorner EgtOutLog("Fallita creazione barra nell'ExecBeam in Rotate")
Case MCH_CR.TL ' elimino vecchio grezzo ed eseguo script creazione nuovo
'vtDeltaBox = New Vector3d(b3Box.Min.x - b3Part.Min.x, b3Box.Max.y - b3Part.Max.y, 0) DeleteOldRaw()
dTempPosY = dTempPosY - dW + dL ' annullo Flip
Case MCH_CR.BL If bFLIP Then EgtRotate(nPartId, b3Box.Center, Vector3d.Z_AX, 180, GDB_RT.GLOB)
' ripristino rotazione
Dim TempRot = m_PartM.dROT
TempRot -= dRot
If TempRot >= 360 Then
TempRot -= 360
ElseIf TempRot < 0 Then
TempRot += 360
End If
m_PartM.dROT = TempRot
EgtSetInfo(nPartId, MGR_PRT_ROT, m_PartM.dROT)
EgtRotate(nPartId, b3Box.Center, Vector3d.X_AX, -dRot, GDB_RT.GLOB)
If bFLIP Then EgtRotate(nPartId, b3Box.Center, Vector3d.Z_AX, 180, GDB_RT.GLOB)
If Not ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then
EgtOutLog("Fallita esecuzione ExecBeam. ERRORE")
End If
NotifyPropertyChanged(NameOf(sROT))
End If
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL Then
' salvo posizione
Dim dTempPosX As Double = m_PartM.dPOSX
Dim dTempPosY As Double = m_PartM.dPOSY
' tolgo il pezzo dal grezzo
EgtRemovePartFromRawPart(nPartId)
' recupero layer del box
Dim nBoxLayerId As Integer = EgtGetFirstNameInGroup(nPartId, "Box")
' recupero box del layer box
Dim b3Box As New BBox3d
EgtGetBBoxGlob(nBoxLayerId, GDB_BB.STANDARD, b3Box)
' se invertito lo reinverto
If bFLIP Then EgtRotate(nPartId, b3Box.Center, Vector3d.X_AX, 180, GDB_RT.GLOB)
Dim dAng As Double = If(IsPositive, 90, -90)
' eseguo rotazione
Dim bOk As Boolean = EgtRotate(nPartId, b3Box.Center, -Vector3d.Z_AX, dAng, GDB_RT.GLOB)
If bOk Then
Dim TempRot = m_PartM.dROT
TempRot += dAng
If TempRot >= 360 Then
TempRot -= 360
ElseIf TempRot < 0 Then
TempRot += 360
End If
m_PartM.dROT = TempRot
EgtSetInfo(nPartId, MGR_PRT_ROT, m_PartM.dROT)
End If
' ripristino eventuale inversione
If bFLIP Then EgtRotate(nPartId, b3Box.Center, Vector3d.X_AX, 180, GDB_RT.GLOB)
' recupero box del pezzo
Dim b3Part As New BBox3d
EgtGetBBoxGlob(nPartId, GDB_BB.STANDARD, b3Part)
'aggiorno box del box con rotazione
EgtGetBBoxGlob(nBoxLayerId, GDB_BB.STANDARD, b3Box)
' calcolo distanza tra i box
Dim vtDeltaBox As Vector3d = b3Box.Min - b3Part.Min ' Vector3d.NULL
' calcolo posizione rispetto al riferimento
Select Case Map.refProjectVM.BTLStructureVM.nPROJTYPE
Case BWType.WALL
' se parete, valuto angolo di posizionamento
Select Case CurrentMachine.NestingCorner
Case MCH_CR.TL
'vtDeltaBox = New Vector3d(b3Box.Min.x - b3Part.Min.x, b3Box.Max.y - b3Part.Max.y, 0)
dTempPosY = dTempPosY - dW + dL
Case MCH_CR.BL
'vtDeltaBox = b3Box.Min - b3Part.Min 'vtDeltaBox = b3Box.Min - b3Part.Min
' non cambio posizioni ' non cambio posizioni
Case MCH_CR.TR Case MCH_CR.TR
'vtDeltaBox = b3Box.Max - b3Part.Max 'vtDeltaBox = b3Box.Max - b3Part.Max
dTempPosX = dTempPosX - dL + dW dTempPosX = dTempPosX - dL + dW
dTempPosY = dTempPosY - dW + dL dTempPosY = dTempPosY - dW + dL
Case MCH_CR.BR Case MCH_CR.BR
'vtDeltaBox = New Vector3d(b3Box.Max.x - b3Part.Max.x, b3Box.Min.y - b3Part.Min.y, 0) 'vtDeltaBox = New Vector3d(b3Box.Max.x - b3Part.Max.x, b3Box.Min.y - b3Part.Min.y, 0)
dTempPosX = dTempPosX - dL + dW dTempPosX = dTempPosX - dL + dW
End Select End Select
Case Else Case Else
' non cambio nulla ' non cambio nulla
End Select End Select
' reinserisco il pezzo nel grezzo ' reinserisco il pezzo nel grezzo
EgtAddPartToRawPart(nPartId, New Point3d(dTempPosX - vtDeltaBox.x, dTempPosY - vtDeltaBox.y, 0), ParentMachGroupVM.MyMachGroupM.nRawPartId) EgtAddPartToRawPart(nPartId, New Point3d(dTempPosX - vtDeltaBox.x, dTempPosY - vtDeltaBox.y, 0), ParentMachGroupVM.MyMachGroupM.nRawPartId)
End If
' lo riseleziono ' lo riseleziono
EgtSelectObj(nPartId) EgtSelectObj(nPartId)
' resetto validazione del pezzo ' resetto validazione del pezzo
@@ -360,6 +443,13 @@ Public Class PartVM
NotifyPropertyChanged(NameOf(sROT)) NotifyPropertyChanged(NameOf(sROT))
End Sub End Sub
Private Sub DeleteOldRaw()
Dim nRawId As Integer = EgtGetFirstRawPart()
While nRawId <> GDB_ID.NULL
EgtRemoveRawPart(nRawId)
nRawId = EgtGetFirstRawPart()
End While
End Sub
Friend Sub SelectBTLPart() Friend Sub SelectBTLPart()
' eseguo la selezione nella lista pezzi ' eseguo la selezione nella lista pezzi
Dim nBTLPartId As Integer = MyMachGroupPanelM.DuploGetOriginal(nPartId) Dim nBTLPartId As Integer = MyMachGroupPanelM.DuploGetOriginal(nPartId)
@@ -59,6 +59,44 @@ Public Class MacroFeatureWndVM
End Set End Set
End Property End Property
Private m_sDescBTLFeature As String
Public Property sDescBTLFeature As String
Get
Return m_sDescBTLFeature
End Get
Set(value As String)
If value <> m_sDescBTLFeature Then
m_sDescBTLFeature = value
End If
End Set
End Property
Private m_sMacroCustom As String
Public Property sMacroCustom As String
Get
Return m_sMacroCustom
End Get
Set(value As String)
m_sMacroCustom = value
End Set
End Property
Private m_bIsCustomChecked As Boolean
Public Property bIsCustomChecked As Boolean
Get
Return m_bIsCustomChecked
End Get
Set(value As Boolean)
m_bIsCustomChecked = value
End Set
End Property
Public ReadOnly Property bCustomVisibility As Visibility
Get
Return If(Map.refMainWindowVM.MainWindowM.nUserLevel >= 10, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
' Definizione comandi ' Definizione comandi
Private m_cmdOk As ICommand Private m_cmdOk As ICommand
@@ -70,6 +108,11 @@ Public Class MacroFeatureWndVM
For Each FeatureItem In Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList For Each FeatureItem In Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList
FeatureList.Add(FeatureItem) FeatureList.Add(FeatureItem)
Next Next
If bOnlyProd Then
nSelFeature = Map.refProjectVM.BTLStructureVM.SelBTLPart.m_SelBTLFeatureVM
sDescBTLFeature = nSelFeature.sDesc.ToUpper()
End If
End Sub End Sub
#End Region ' CONSTRUCTOR #End Region ' CONSTRUCTOR
@@ -107,7 +150,7 @@ Public Class MacroFeatureWndVM
Friend Sub WriteMacro(sMacroName As String) Friend Sub WriteMacro(sMacroName As String)
' inizio routine di scrittura ' inizio routine di scrittura
Dim FileContent As String() = File.ReadAllLines(Map.refMainWindowVM.MainWindowM.sMacroDir & "\" & MACROTEMPLATE_FILE) Dim FileContent As String() = File.ReadAllLines(Map.refMainWindowVM.MainWindowM.sConfigDir & "\" & MACROTEMPLATE_FILE)
Dim FileName As String = CalcBeamPrivateProfileGRP(nSelFeature.nSelGRP) & "." & nSelFeature.nPRC & FILENAMESEPARATOR & sMacroName Dim FileName As String = CalcBeamPrivateProfileGRP(nSelFeature.nSelGRP) & "." & nSelFeature.nPRC & FILENAMESEPARATOR & sMacroName
For LineIndex As Integer = 0 To FileContent.Count - 1 For LineIndex As Integer = 0 To FileContent.Count - 1
Dim sCurrLine As String = FileContent(LineIndex) Dim sCurrLine As String = FileContent(LineIndex)
@@ -153,7 +196,17 @@ Public Class MacroFeatureWndVM
"'" & nSelFeature.sDES & "', " & "'" & nSelFeature.sDES & "', " &
"MACRO.PROCID") 'nSelFeature.ParentPart.NewProcId() & "MACRO.PROCID") 'nSelFeature.ParentPart.NewProcId() &
Next Next
File.WriteAllLines(Map.refMainWindowVM.MainWindowM.sMacroDir & "\" & FileName & ".lua", FileContent, Text.Encoding.UTF8) If bOnlyProd Then
If m_bIsCustomChecked AndAlso Map.refMainWindowVM.MainWindowM.nUserLevel >= 10 Then
File.WriteAllLines(Map.refMainWindowVM.MainWindowM.sMacroDefaultDir & "\" & FileName & ".lua", FileContent, Text.Encoding.UTF8)
ElseIf Not bIsCustomChecked AndAlso Map.refMainWindowVM.MainWindowM.nUserLevel >= 10 Then
File.WriteAllLines(Map.refMainWindowVM.MainWindowM.sMacroCustomDir & "\" & FileName & ".lua", FileContent, Text.Encoding.UTF8)
Else
File.WriteAllLines(Map.refMainWindowVM.MainWindowM.sMacroDefaultDir & "\" & FileName & ".lua", FileContent, Text.Encoding.UTF8)
End If
Else
File.WriteAllLines(Map.refMainWindowVM.MainWindowM.sMacroCustomDir & "\" & FileName & ".lua", FileContent, Text.Encoding.UTF8)
End If
End Sub End Sub
#End Region ' Ok #End Region ' Ok
@@ -0,0 +1,59 @@
<EgtWPFLib5:EgtCustomWindow x:Class="NewMacroFeatureWnd"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
WindowStyle="None" ResizeMode="NoResize"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterOwner"
IsClosable="False"
IsMinimizable="False"
IsResizable="False"
Title="NewMacroFeature">
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Text="Feature"
Margin="5"
Style="{StaticResource OptionTextBlock}"/>
<TextBlock Text="{Binding sDescBTLFeature}"
Grid.Column="1"
HorizontalAlignment="Left"
Style="{StaticResource OptionTextBlock}"/>
<CheckBox Content="Default Macro"
IsChecked="{Binding bIsCustomChecked}"
Visibility="{Binding bCustomVisibility}"
Grid.Column="2"
Margin="0,6,5,0"/>
<TextBlock Text="Name"
Grid.Row="1"
Style="{StaticResource OptionTextBlock}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding sFeatureName}"
Grid.Row="1"
Grid.Column="1"
Grid.ColumnSpan="2"
Margin="5"
Width="200"/>
<UniformGrid Columns="2"
Grid.Row="2"
Grid.ColumnSpan="3"
Margin="5">
<Button Content="Ok"
Command="{Binding Ok_Command}"
IsDefault="True"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Button Content="Cancel"
IsCancel="True"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
</UniformGrid>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
@@ -0,0 +1,18 @@
Public Class NewMacroFeatureWnd
Private WithEvents m_MacroFeatureWndVM As MacroFeatureWndVM
Sub New(Owner As Window, MacroFeatureWndVM As MacroFeatureWndVM)
MyBase.New(Owner)
' This call is required by the designer.
InitializeComponent()
Me.DataContext = MacroFeatureWndVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_MacroFeatureWndVM = MacroFeatureWndVM
End Sub
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_MacroFeatureWndVM.m_CloseWindow
Me.DialogResult = bDialogResult
End Sub
End Class
@@ -144,9 +144,15 @@ Public Class MainWindowM
End Get End Get
End Property End Property
Friend ReadOnly Property sMacroDir As String Friend ReadOnly Property sMacroDefaultDir As String
Get Get
Return m_sDataDir & "\" & MACRO_DIR Return m_sDataDir & "\" & MACRODEFAULT_DIR
End Get
End Property
Friend ReadOnly Property sMacroCustomDir As String
Get
Return m_sDataDir & "\" & MACROCUSTOM_DIR
End Get End Get
End Property End Property
@@ -46,6 +46,8 @@
<EgtBEAMWALL:ViewPanelV DataContext="{StaticResource ViewPanelVM}"/> <EgtBEAMWALL:ViewPanelV DataContext="{StaticResource ViewPanelVM}"/>
<EgtBEAMWALL:InstrumentPanelV DataContext="{StaticResource InstrumentPanelVM}"/> <EgtBEAMWALL:InstrumentPanelV DataContext="{StaticResource InstrumentPanelVM}"/>
<EgtBEAMWALL:CalcPanelV DataContext="{StaticResource CALCPanelVM}"/> <EgtBEAMWALL:CalcPanelV DataContext="{StaticResource CALCPanelVM}"/>
<EgtBEAMWALL:SpecialPanelV DataContext="{StaticResource SpecialPanelVM}"
Visibility="{Binding DataContext.SpecialPanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>
<EgtBEAMWALL:FreeContourManagerV DataContext="{StaticResource FreeContourManagerVM}" <EgtBEAMWALL:FreeContourManagerV DataContext="{StaticResource FreeContourManagerVM}"
Visibility="{Binding DataContext.FreeContourManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/> Visibility="{Binding DataContext.FreeContourManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
</WrapPanel> </WrapPanel>
@@ -20,7 +20,7 @@ Public Class ProdProjManagerVM
Public ReadOnly Property PartManager_Visibility As Visibility Public ReadOnly Property PartManager_Visibility As Visibility
Get Get
Return If((Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refProjectVM.BTLStructureVM.SelectionType = BTLStructureVM.SelectionTypes.SELECT_ AndAlso Not Map.refFreeContourManagerVM.bIsActive, Visibility.Visible, Visibility.Collapsed) Return Map.refProjectVM.PartManager_Visibility
End Get End Get
End Property End Property
@@ -563,15 +563,6 @@ Public Class ProjManagerVM
If bShowLoading Then LoadingWndHelper.OpenLoadingWnd(ActiveIds.SAVEPROJ, 1, EgtMsg(63007), "", 100) ' Project saving If bShowLoading Then LoadingWndHelper.OpenLoadingWnd(ActiveIds.SAVEPROJ, 1, EgtMsg(63007), "", 100) ' Project saving
' se vista tutti i pezzi ' se vista tutti i pezzi
Configuration.ShowAllPieces(bShowBuilding, bShowSolid, True, False) Configuration.ShowAllPieces(bShowBuilding, bShowSolid, True, False)
'If Map.refShowBeamPanelVM.bShowAll Then
' ' verifico se assemblato e lo annullo per salvataggio
' bShowBuilding = Map.refShowBeamPanelVM.ShowBuilding_IsChecked
' If bShowBuilding Then Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
' ' se vista singolo pezzo
'Else
' bShowSolid = Map.refShowBeamPanelVM.ShowSolid_IsChecked
' If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, False, False)
'End If
' imposto ProjId di caricamento ' imposto ProjId di caricamento
m_nLoadingProjId = CurrProj.nProjId m_nLoadingProjId = CurrProj.nProjId
Map.refSceneHostVM.SaveProject() Map.refSceneHostVM.SaveProject()
@@ -861,18 +852,6 @@ Public Class ProjManagerVM
Dim bShowSolid As Boolean = False Dim bShowSolid As Boolean = False
Dim nSelPartId As Integer = GDB_ID.NULL Dim nSelPartId As Integer = GDB_ID.NULL
Configuration.ShowAllPieces(bShowBuilding, bShowSolid, nSelPartId, True) Configuration.ShowAllPieces(bShowBuilding, bShowSolid, nSelPartId, True)
'If Map.refShowBeamPanelVM.bShowAll Then
' ' verifico se assemblato e lo annullo per salvataggio
' bShowBuilding = Map.refShowBeamPanelVM.ShowBuilding_IsChecked
' If bShowBuilding Then Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
' ' se vista singolo pezzo
'Else
' bShowSolid = Map.refShowBeamPanelVM.ShowSolid_IsChecked
' If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, False, False)
' ' se pezzo selezionato lo segno e metto vista tutti
' nSelPartId = Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId
' Map.refProjectVM.BTLStructureVM.ShowAll(False)
'End If
Dim sDir As String = String.Empty Dim sDir As String = String.Empty
GetMainPrivateProfileString(S_GENERAL, K_LASTUPDATEDIR, "", sDir) GetMainPrivateProfileString(S_GENERAL, K_LASTUPDATEDIR, "", sDir)
@@ -1182,26 +1161,6 @@ Public Class ProjManagerVM
' elimino i pezzi da sovrascrivere nel progetto corrente ' elimino i pezzi da sovrascrivere nel progetto corrente
Configuration.DeletePieces(UpdateBTLWndVM.BTLPartList) Configuration.DeletePieces(UpdateBTLWndVM.BTLPartList)
'For Each BTLPartToOverwriteWith In UpdateBTLWndVM.BTLPartList
' If BTLPartToOverwriteWith.bInsert Then
' Dim BTLPartToUpdate As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.nPDN = BTLPartToOverwriteWith.nPDN)
' ' se BTLPartToUpdate è Nothing significa che il pezzo è nuovo e quindi basta accodarlo senza eliminare nulla
' If Not IsNothing(BTLPartToUpdate) Then
' Dim nPartToDeleteId As Integer = BTLPartToUpdate.nPartId
' Dim nCurrPartId = EgtGetCurrPart()
' EgtErase(nPartToDeleteId)
' nCurrPartId = EgtGetCurrPart()
' ' verifico se rimuovere sezione dalla lista
' If Not Map.refProjectVM.BTLStructureVM.BTLPartVMList.Any(Function(x) x IsNot BTLPartToUpdate AndAlso x.Section = BTLPartToUpdate.Section) Then
' Map.refProjectVM.BTLStructureVM.SectionList.Remove(BTLPartToUpdate.Section)
' End If
' ' rimuovo dalla lista pezzi
' Dim Index As Integer = Map.refProjectVM.BTLStructureVM.BTLPartVMList.IndexOf(BTLPartToUpdate)
' Map.refProjectVM.BTLStructureVM.SetSelBTLPart(Nothing)
' Map.refProjectVM.BTLStructureVM.BTLPartVMList.RemoveAt(Index)
' End If
' End If
'Next
' salvo gli id degli AsseBase presenti nel progetto corrente ' salvo gli id degli AsseBase presenti nel progetto corrente
Dim AsseBaseIdList As New List(Of Integer) Dim AsseBaseIdList As New List(Of Integer)
@@ -1384,11 +1343,6 @@ Public Class ProjManagerVM
Dim bShowBuilding As Boolean = False Dim bShowBuilding As Boolean = False
If Map.refMainMenuVM.SelPage = Pages.VIEW Then If Map.refMainMenuVM.SelPage = Pages.VIEW Then
Configuration.ShowAllPieces(bShowBuilding) Configuration.ShowAllPieces(bShowBuilding)
'If Map.refShowBeamPanelVM.bShowAll Then
' ' verifico se assemblato e lo annullo per salvataggio
' bShowBuilding = Map.refShowBeamPanelVM.ShowBuilding_IsChecked
' If bShowBuilding Then Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
'End If
End If End If
' per ogni BTLInfo nel progetto riporto il relativo nome del BTL ' per ogni BTLInfo nel progetto riporto il relativo nome del BTL
@@ -1,9 +1,7 @@
Imports System.Windows.Threading Imports System.Windows.Threading
Imports EgtBEAMWALL.Core Imports EgtBEAMWALL.Core
Imports EgtWPFLib5 Imports EgtWPFLib5
Imports EgtUILib
Imports System.Collections.ObjectModel Imports System.Collections.ObjectModel
Imports EgtBEAMWALL.DataLayer.Controllers
Public Class ProjectVM Public Class ProjectVM
Inherits VMBase Inherits VMBase
@@ -101,7 +99,7 @@ Public Class ProjectVM
Private m_PartManager_Visibility As Boolean = True Private m_PartManager_Visibility As Boolean = True
Public ReadOnly Property PartManager_Visibility As Visibility Public ReadOnly Property PartManager_Visibility As Visibility
Get Get
Return If(Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refProjectVM.BTLStructureVM.SelectionType = BTLStructureVM.SelectionTypes.SELECT_ AndAlso Not Map.refFreeContourManagerVM.bIsActive, Visibility.Visible, Visibility.Collapsed) Return If(Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refProjectVM.BTLStructureVM.SelectionType = BTLStructureVM.SelectionTypes.SELECT_ AndAlso Not Map.refFreeContourManagerVM.bIsActive, Visibility.Visible, Visibility.Collapsed)
End Get End Get
End Property End Property
Binary file not shown.

After

Width:  |  Height:  |  Size: 644 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 682 B

@@ -179,7 +179,6 @@ Public Class ShowBeamPanelVM
End If End If
' nascondo barra del pezzo ' nascondo barra del pezzo
Map.refProjectVM.BTLStructureVM.SetSelectionType(BTLStructureVM.SelectionTypes.NULL) Map.refProjectVM.BTLStructureVM.SetSelectionType(BTLStructureVM.SelectionTypes.NULL)
'Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProjectVM.PartManager_Visibility))
Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProdProjManagerVM.PartManager_Visibility)) Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProdProjManagerVM.PartManager_Visibility))
' mostro in parte bassa dati BTL ' mostro in parte bassa dati BTL
If Not IsNothing(Map.refBottomPanelVM) Then Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.STRUCTURE_) If Not IsNothing(Map.refBottomPanelVM) Then Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.STRUCTURE_)
@@ -166,7 +166,7 @@
</TabControl> </TabControl>
<Grid Grid.Row="1"> <Grid Grid.Row="1" Margin="5">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
@@ -138,7 +138,7 @@
</EgtBEAMWALLCORE:EgtDataGrid> </EgtBEAMWALLCORE:EgtDataGrid>
<Grid Grid.Row="1"> <Grid Grid.Row="1" Margin="5">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
@@ -359,7 +359,7 @@ Public Class StatisticsVM
sFileName = ProjectManagerVM.CurrProj.sProjDirPath & "\" & "Statistics.pdf" sFileName = ProjectManagerVM.CurrProj.sProjDirPath & "\" & "Statistics.pdf"
ElseIf Pages.MACHINING OrElse (Pages.ONLYPRODPAGE AndAlso Map.refInstrumentPanelVM.bVisOtt_Selected) Then ElseIf Pages.MACHINING OrElse (Pages.ONLYPRODPAGE AndAlso Map.refInstrumentPanelVM.bVisOtt_Selected) Then
sFileName = ProjectManagerVM.CurrProd.sProdDirPath & "\" & ProjectManagerVM.CurrProd.sProdId & " - " & "Statistics.pdf" sFileName = ProjectManagerVM.CurrProd.sProdDirPath & "\" & ProjectManagerVM.CurrProd.sProdId & " - " & "Statistics.pdf"
PrevSelect() If Not bOnlyProd Then PrevSelect()
End If End If
renderer.PdfDocument.Save(sFileName) renderer.PdfDocument.Save(sFileName)
@@ -9,10 +9,10 @@
</Grid.RowDefinitions> </Grid.RowDefinitions>
<EgtBEAMWALL:FreeContourInputV DataContext="{StaticResource FreeContourInputVM}" <EgtBEAMWALL:FreeContourInputV DataContext="{StaticResource FreeContourInputVM}"
Visibility="{Binding DataContext.FreeContourManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjWndV}}}"/> Visibility="{Binding Tag.FreeContourManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjWndV}}}"/>
<EgtBEAMWALL:PartManagerV DataContext="{StaticResource PartManagerVM}" <EgtBEAMWALL:PartManagerV DataContext="{StaticResource PartManagerVM}"
Tag="{Binding Tag.BTLStructureVM.SelBTLPart, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjWndV}}}" Tag="{Binding Tag.BTLStructureVM.SelBTLPart, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjWndV}}}"
Visibility="{Binding DataContext.PartManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjWndV}}}"/> Visibility="{Binding Tag.PartManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjWndV}}}"/>
<Grid Grid.Row="1"> <Grid Grid.Row="1">
@@ -1,7 +1,6 @@
Imports System.Collections.ObjectModel Imports System.Collections.ObjectModel
Imports EgtBEAMWALL.Core Imports EgtBEAMWALL.Core
Imports EgtUILib Imports EgtUILib
Imports EgtWPFLib5
Module Configuration Module Configuration
@@ -357,6 +357,14 @@
<Setter Property="HorizontalAlignment" Value="Center"/> <Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/> <Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="10,0,10,0"/> <Setter Property="Margin" Value="10,0,10,0"/>
</Style>
<Style x:Key="ListTextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="10,0,10,0"/>
<Setter Property="FontSize" Value="20"/>
</Style> </Style>
<Style x:Key="MachParamTextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}"> <Style x:Key="MachParamTextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">