EgtCAM5 :
- Migliorie varie.
This commit is contained in:
@@ -64,6 +64,7 @@ Class Application
|
||||
Friend Const ISOVIEWSE As String = "IsoViewSE"
|
||||
Friend Const ISOVIEWNE As String = "IsoViewNE"
|
||||
Friend Const ISOVIEWNW As String = "IsoViewNW"
|
||||
Friend Const VIEWTOCPLANE As String = "ViewToCPlane"
|
||||
Friend Const SETSTATUSANALYZE As String = "SetStatusAnalyze"
|
||||
Friend Const RESETSTATUSANALYZE As String = "ResetStatusAnalyze"
|
||||
Friend Const SETSTATUSGETDISTANCE As String = "SetStatusGetDistance"
|
||||
@@ -150,6 +151,11 @@ Class Application
|
||||
Friend Const RIGHTCLICKEDLAYERTREEITEM As String = "RightClickedLayerTreeItem"
|
||||
Friend Const SAVEOBJECT As String = "SaveObject"
|
||||
Friend Const REMOVEMARKFROMLASTOPERATION As String = "RemoveMarkFromLastOperation"
|
||||
Friend Const SELECTEDOPERATION As String = "SelectedOperation"
|
||||
|
||||
' MachiningOptionPanel
|
||||
' MachiningTreeViewExpander
|
||||
Friend Const MACHININGTREEVIEWEXPANDERISENABLED As String = "MachiningTreeViewExpanderIsEnabled"
|
||||
|
||||
' StatusBar messages
|
||||
Friend Const STATUSGRIDCOMMAND As String = "StatusGridCommand"
|
||||
|
||||
+8
-10
@@ -148,10 +148,10 @@
|
||||
</Compile>
|
||||
<Compile Include="ProjectPage\GridViewPanel\GridViewPanelViewModel.vb" />
|
||||
<Compile Include="IniFile.vb" />
|
||||
<Compile Include="ProjectPage\OptionPanel\DrawOptionPanel\DrawOptionPanelView.xaml.vb">
|
||||
<Compile Include="ProjectPage\OptionPanel\DrawOptionPanelView.xaml.vb">
|
||||
<DependentUpon>DrawOptionPanelView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ProjectPage\OptionPanel\DrawOptionPanel\DrawOptionPanelViewModel.vb" />
|
||||
<Compile Include="ProjectPage\OptionPanel\DrawOptionPanelViewModel.vb" />
|
||||
<Compile Include="ProjectPage\OptionPanel\DrawOptionPanel\InfoExpander\InfoExpanderView.xaml.vb">
|
||||
<DependentUpon>InfoExpanderView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -160,15 +160,13 @@
|
||||
<DependentUpon>InputExpanderView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ProjectPage\OptionPanel\DrawOptionPanel\InputExpander\InputExpanderViewModel.vb" />
|
||||
<Compile Include="ProjectPage\OptionPanel\MachiningOptionPanel\MachiningsTreeViewExpander\MachiningTreeExpanderView.xaml.vb">
|
||||
<DependentUpon>MachiningTreeExpanderView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ProjectPage\OptionPanel\MachiningOptionPanel\MachiningsTreeViewExpander\MachiningTreeExpanderViewModel.vb" />
|
||||
<Compile Include="ProjectPage\OptionPanel\DrawOptionPanel\ManageLayerExpander\LayerTreeView.vb" />
|
||||
<Compile Include="ProjectPage\OptionPanel\DrawOptionPanel\ManageLayerExpander\ManageLayerExpanderView.xaml.vb">
|
||||
<DependentUpon>ManageLayerExpanderView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ProjectPage\OptionPanel\DrawOptionPanel\ManageLayerExpander\ManageLayerExpanderViewModel.vb" />
|
||||
<Compile Include="ProjectPage\OptionPanel\MachiningOptionPanel\MachiningsTreeViewExpander\MachiningTreeViewExpander.vb" />
|
||||
<Compile Include="ProjectPage\OptionPanel\MachiningOptionPanel\OperationExpander\OperationExpanderView.xaml.vb">
|
||||
<DependentUpon>OperationExpanderView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -239,7 +237,7 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="ProjectPage\OptionPanel\DrawOptionPanel\DrawOptionPanelView.xaml">
|
||||
<Page Include="ProjectPage\OptionPanel\DrawOptionPanelView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
@@ -251,14 +249,14 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="ProjectPage\OptionPanel\MachiningOptionPanel\MachiningsTreeViewExpander\MachiningTreeExpanderView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="ProjectPage\OptionPanel\DrawOptionPanel\ManageLayerExpander\ManageLayerExpanderView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="ProjectPage\OptionPanel\MachiningOptionPanel\MachiningsTreeViewExpander\MachiningTreeExpanderView.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="ProjectPage\OptionPanel\MachiningOptionPanel\OperationExpander\OperationExpanderView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
@@ -49,6 +49,9 @@
|
||||
<Button ToolTip="{Binding LookFromIso_NWToolTip}" Style="{StaticResource GridViewPanelButton}" Command="{Binding IsoViewNWCommand}">
|
||||
<Image Source="/Resources/GridViewPanel/LookFromISO_NW.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button ToolTip="{Binding ViewToCPlaneToolTip}" Style="{StaticResource GridViewPanelButton}" Command="{Binding ViewToCPlaneCommand}">
|
||||
<Image Source="/Resources/GridViewPanel/CplaneView.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<ToggleButton ToolTip="{Binding CurveDirToolTip}" Style="{StaticResource GridViewPanelToggleButton}" IsChecked="{Binding CurveDirIsChecked}">
|
||||
<Image Source="/Resources/GridViewPanel/CurveDir.png" Stretch="Uniform"/>
|
||||
</ToggleButton>
|
||||
|
||||
@@ -160,6 +160,11 @@ Namespace EgtCAM5
|
||||
Return EgtMsg(MSG_GRIDVIEWPANEL + 15)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property ViewToCPlaneToolTip As String
|
||||
Get
|
||||
Return EgtMsg(MSG_GRIDVIEWPANEL + 32)
|
||||
End Get
|
||||
End Property
|
||||
'Proprietà ToolTip
|
||||
Public ReadOnly Property CurveDirToolTip As String
|
||||
Get
|
||||
@@ -273,6 +278,7 @@ Namespace EgtCAM5
|
||||
Private m_cmdIsoViewSE As ICommand
|
||||
Private m_cmdIsoViewNE As ICommand
|
||||
Private m_cmdIsoViewNW As ICommand
|
||||
Private m_cmdViewToCPlane As ICommand
|
||||
Private m_cmdCurveDir As ICommand
|
||||
Private m_cmdAnalyze As ICommand
|
||||
Private m_cmdGetDist As ICommand
|
||||
@@ -740,95 +746,35 @@ Namespace EgtCAM5
|
||||
|
||||
#End Region ' IsoViewNWCommand
|
||||
|
||||
'#Region "CurveDirCommand"
|
||||
#Region "ViewToCPlaneCommand"
|
||||
|
||||
' ''' <summary>
|
||||
' ''' Returns a command that do CurveDir.
|
||||
' ''' </summary>
|
||||
' Public ReadOnly Property CurveDirCommand As ICommand
|
||||
' Get
|
||||
' If m_cmdCurveDir Is Nothing Then
|
||||
' m_cmdCurveDir = New RelayCommand(AddressOf CurveDir, AddressOf CanCurveDir)
|
||||
' End If
|
||||
' Return m_cmdCurveDir
|
||||
' End Get
|
||||
' End Property
|
||||
''' <summary>
|
||||
''' Returns a command that do GetDist.
|
||||
''' </summary>
|
||||
Public ReadOnly Property ViewToCPlaneCommand As ICommand
|
||||
Get
|
||||
If m_cmdViewToCPlane Is Nothing Then
|
||||
m_cmdViewToCPlane = New RelayCommand(AddressOf ViewToCPlane, AddressOf CanViewToCPlane)
|
||||
End If
|
||||
Return m_cmdViewToCPlane
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' ''' <summary>
|
||||
' ''' Execute the CurveDir. This method is invoked by the CurveDirCommand.
|
||||
' ''' </summary>
|
||||
' Public Sub CurveDir(ByVal param As Object)
|
||||
' Application.Msn.NotifyColleagues(Application.CURVEDIR)
|
||||
' End Sub
|
||||
''' <summary>
|
||||
''' Execute the GetDist. This method is invoked by the GetDistCommand.
|
||||
''' </summary>
|
||||
Public Sub ViewToCPlane(ByVal param As Object)
|
||||
Application.Msn.NotifyColleagues(Application.VIEWTOCPLANE)
|
||||
End Sub
|
||||
|
||||
' ''' <summary>
|
||||
' ''' Returns always true.
|
||||
' ''' </summary>
|
||||
' Private Function CanCurveDir(ByVal param As Object) As Boolean
|
||||
' Return True
|
||||
' End Function
|
||||
''' <summary>
|
||||
''' Returns always true.
|
||||
''' </summary>
|
||||
Private Function CanViewToCPlane(ByVal param As Object) As Boolean
|
||||
Return True
|
||||
End Function
|
||||
|
||||
'#End Region ' CurveDirCommand
|
||||
|
||||
'#Region "AnalyzeCommand"
|
||||
|
||||
' ''' <summary>
|
||||
' ''' Returns a command that do Analyze.
|
||||
' ''' </summary>
|
||||
' Public ReadOnly Property AnalyzeCommand As ICommand
|
||||
' Get
|
||||
' If m_cmdAnalyze Is Nothing Then
|
||||
' m_cmdAnalyze = New RelayCommand(AddressOf Analyze, AddressOf CanAnalyze)
|
||||
' End If
|
||||
' Return m_cmdAnalyze
|
||||
' End Get
|
||||
' End Property
|
||||
|
||||
' ''' <summary>
|
||||
' ''' Execute the Analyze. This method is invoked by the AnalyzeCommand.
|
||||
' ''' </summary>
|
||||
' Public Sub Analyze(ByVal param As Object)
|
||||
' Application.Msn.NotifyColleagues(Application.ANALYZE)
|
||||
' End Sub
|
||||
|
||||
' ''' <summary>
|
||||
' ''' Returns always true.
|
||||
' ''' </summary>
|
||||
' Private Function CanAnalyze(ByVal param As Object) As Boolean
|
||||
' Return True
|
||||
' End Function
|
||||
|
||||
'#End Region ' AnalyzeCommand
|
||||
|
||||
'#Region "GetDistCommand"
|
||||
|
||||
' ''' <summary>
|
||||
' ''' Returns a command that do GetDist.
|
||||
' ''' </summary>
|
||||
' Public ReadOnly Property GetDistCommand As ICommand
|
||||
' Get
|
||||
' If m_cmdGetDist Is Nothing Then
|
||||
' m_cmdGetDist = New RelayCommand(AddressOf GetDist, AddressOf CanGetDist)
|
||||
' End If
|
||||
' Return m_cmdGetDist
|
||||
' End Get
|
||||
' End Property
|
||||
|
||||
' ''' <summary>
|
||||
' ''' Execute the GetDist. This method is invoked by the GetDistCommand.
|
||||
' ''' </summary>
|
||||
' Public Sub GetDist(ByVal param As Object)
|
||||
' Application.Msn.NotifyColleagues(Application.GETDIST)
|
||||
' End Sub
|
||||
|
||||
' ''' <summary>
|
||||
' ''' Returns always true.
|
||||
' ''' </summary>
|
||||
' Private Function CanGetDist(ByVal param As Object) As Boolean
|
||||
' Return True
|
||||
' End Function
|
||||
|
||||
'#End Region ' GetDistCommand
|
||||
#End Region ' ViewToCPlaneCommand
|
||||
|
||||
#Region "CPlaneTopCommand"
|
||||
|
||||
|
||||
+59
-3
@@ -1,10 +1,66 @@
|
||||
<UserControl x:Class="MachiningTreeExpanderView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
|
||||
xmlns:local="clr-namespace:EgtCAM5">
|
||||
|
||||
<Expander Header="Machinings List" IsExpanded="{Binding IsEnabled}">
|
||||
<Expander Header="Machinings List" IsExpanded="{Binding IsEnabled}" IsEnabled="{Binding IsEnabled}">
|
||||
<UniformGrid>
|
||||
<TreeView>
|
||||
<TreeView Name="MachiningsTreeView" Grid.Row="1"
|
||||
ItemsSource="{Binding Path=MachiningsList}">
|
||||
<interactivity:Interaction.Triggers>
|
||||
<interactivity:EventTrigger EventName="MouseDoubleClick">
|
||||
<interactivity:InvokeCommandAction Command="{Binding TreeViewDoubleClickCommand}" CommandParameter="{Binding ElementName=MachiningsTreeView,Path=SelectedItem}"/>
|
||||
</interactivity:EventTrigger>
|
||||
</interactivity:Interaction.Triggers>
|
||||
<TreeView.Resources>
|
||||
<!--Modifico HierarchicalDataTemplate del CathegoryItem per poter inserire immagine e testo e per -->
|
||||
<!--renderlo apribile con un solo click -->
|
||||
<HierarchicalDataTemplate DataType="{x:Type local:FamilyMachiningTreeViewExpanderItem}" ItemsSource="{Binding Items}">
|
||||
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Image Grid.Column="0" Source="{Binding PictureString}" Height="15" Margin="0,0,5,0"/>
|
||||
<TextBlock Grid.Column="1" Text="{Binding Name}"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
<!--Assegna ai nodi ToolItem lo Style normale dei TreeViewItem, eliminando l'ombra, data dal
|
||||
multibinding quando sono attivi.-->
|
||||
<HierarchicalDataTemplate.ItemContainerStyle>
|
||||
<Style TargetType="{x:Type TreeViewItem}" >
|
||||
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
</Style>
|
||||
</HierarchicalDataTemplate.ItemContainerStyle>
|
||||
|
||||
</HierarchicalDataTemplate>
|
||||
<!--Modifico DataTemplate del ToolItem per poter inserire immagine e testo-->
|
||||
<DataTemplate DataType="{x:Type local:MachiningTreeViewExpanderItem}">
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!--<Image Grid.Column="0" Source="{Binding PictureString}" Height="32" Margin="0,8,6,4" />-->
|
||||
<TextBlock Grid.Column="1" Text="{Binding Name}"/>
|
||||
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</TreeView.Resources>
|
||||
|
||||
<!--Style dei nodi CathegoryItem che li riquadra di azzurro quando clicckati ed elimina l'ombra grigia -->
|
||||
<!--che si presenta quando la categoria rimane vuota (ombra causata dal multibinding). -->
|
||||
<TreeView.ItemContainerStyle>
|
||||
<Style TargetType="{x:Type TreeViewItem}">
|
||||
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
</Style>
|
||||
</TreeView.ItemContainerStyle>
|
||||
|
||||
</TreeView>
|
||||
</UniformGrid>
|
||||
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
Public Class MachiningTreeExpanderView
|
||||
|
||||
End Class
|
||||
+179
-1
@@ -1,6 +1,184 @@
|
||||
Namespace EgtCAM5
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
|
||||
Namespace EgtCAM5
|
||||
|
||||
Public Class MachiningTreeExpanderViewModel
|
||||
Inherits ViewModelBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_IsEnabled As Boolean
|
||||
Public Property IsEnabled As Boolean
|
||||
Get
|
||||
Return m_IsEnabled
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If value <> m_IsEnabled Then
|
||||
m_IsEnabled = value
|
||||
OnPropertyChanged("IsEnabled")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Lista delle lavorazioni
|
||||
Private m_MachiningsList As New ObservableCollection(Of FamilyMachiningTreeViewExpanderItem)
|
||||
Public Property MachiningsList As ObservableCollection(Of FamilyMachiningTreeViewExpanderItem)
|
||||
Get
|
||||
Return m_MachiningsList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of FamilyMachiningTreeViewExpanderItem))
|
||||
m_MachiningsList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdTreeViewDoubleClick As ICommand
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
' Per caricare l'albero la prima volta che viene aperto
|
||||
IsEnabled = False
|
||||
LoadSelectedMachineMachinings()
|
||||
Application.Msn.Register(Application.PROJECTPAGE_MACHININGMODE, Sub()
|
||||
m_MachiningsList.Clear()
|
||||
LoadSelectedMachineMachinings()
|
||||
End Sub)
|
||||
Application.Msn.Register(Application.MACHININGTREEVIEWEXPANDERISENABLED, Sub(bValue As Boolean)
|
||||
IsEnabled = bValue
|
||||
End Sub)
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "TreeViewDoubleClickCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do TreeViewDoubleClick.
|
||||
''' </summary>
|
||||
Public ReadOnly Property TreeViewDoubleClickCommand As ICommand
|
||||
Get
|
||||
If m_cmdTreeViewDoubleClick Is Nothing Then
|
||||
m_cmdTreeViewDoubleClick = New RelayCommand(AddressOf TreeViewDoubleClick, AddressOf CanTreeViewDoubleClick)
|
||||
End If
|
||||
Return m_cmdTreeViewDoubleClick
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the TreeViewDoubleClick. This method is invoked by the TreeViewDoubleClickCommand.
|
||||
''' </summary>
|
||||
Public Sub TreeViewDoubleClick(ByVal param As Object)
|
||||
If TypeOf param Is MachiningTreeViewExpanderItem Then
|
||||
Dim Machining As MachiningTreeViewExpanderItem = DirectCast(param, MachiningTreeViewExpanderItem)
|
||||
Dim x = EgtAddMachining(MachiningTypeToString(DirectCast(Machining.Type, MCH_MY)) & "_1", Machining.Name)
|
||||
Application.Msn.NotifyColleagues(Application.LOADOPERATIONLIST)
|
||||
Application.Msn.NotifyColleagues(Application.MACHININGTREEVIEWEXPANDERISENABLED, False)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Returns always true.
|
||||
''' </summary>
|
||||
Private Function CanTreeViewDoubleClick(ByVal param As Object) As Boolean
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function MachiningTypeToString(Type As MCH_MY) As String
|
||||
Select Case Type
|
||||
Case MCH_MY.DRILLING
|
||||
Return EgtMsg(MSG_MACHININGSDBPAGE + 1)
|
||||
Case MCH_MY.SAWING
|
||||
Return EgtMsg(MSG_MACHININGSDBPAGE + 2)
|
||||
Case MCH_MY.MILLING
|
||||
Return EgtMsg(MSG_MACHININGSDBPAGE + 3)
|
||||
Case MCH_MY.POCKETING
|
||||
Return EgtMsg(MSG_MACHININGSDBPAGE + 4)
|
||||
Case MCH_MY.MORTISING
|
||||
Return EgtMsg(MSG_MACHININGSDBPAGE + 5)
|
||||
Case MCH_MY.SAWROUGHING
|
||||
Return EgtMsg(MSG_MACHININGSDBPAGE + 6)
|
||||
Case MCH_MY.SAWFINISHING
|
||||
Return EgtMsg(MSG_MACHININGSDBPAGE + 7)
|
||||
Case Else
|
||||
Return String.Empty
|
||||
End Select
|
||||
End Function
|
||||
|
||||
#End Region ' TreeViewDoubleClickCommand
|
||||
|
||||
#End Region ' Commands
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
''' <summary>
|
||||
''' Method that search the machines in the correct folder and add to the MachinesList those valid.
|
||||
''' </summary>
|
||||
Private Sub LoadSelectedMachineMachinings()
|
||||
Dim ActiveMachiningsTypes() As MachiningsType = ReadActiveMachiningsFamilies()
|
||||
For Each MachiningsType In ActiveMachiningsTypes
|
||||
Dim FamilyTreeView As New FamilyMachiningTreeViewExpanderItem(MachiningsType.TypeName, MachiningsType.TypeId)
|
||||
MachiningsList.Add(FamilyTreeView)
|
||||
Dim MachiningName As String = String.Empty
|
||||
If EgtMdbGetFirstMachining(MachiningsType.TypeId, MachiningName) Then
|
||||
FamilyTreeView.Items.Add(New MachiningTreeViewExpanderItem(MachiningName, MachiningsType.TypeId))
|
||||
While EgtMdbGetNextMachining(MachiningsType.TypeId, MachiningName)
|
||||
FamilyTreeView.Items.Add(New MachiningTreeViewExpanderItem(MachiningName, MachiningsType.TypeId))
|
||||
End While
|
||||
End If
|
||||
Next
|
||||
' Se esiste almeno una famiglia di lavorazioni, la seleziono
|
||||
If MachiningsList.Count > 0 Then
|
||||
MachiningsList(0).IsSelected = True
|
||||
MachiningsList(0).NotifyPropertyChanged("IsSelected")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Method that search the machines in the correct folder and add to the MachinesList those valid.
|
||||
''' </summary>
|
||||
Private Function ReadActiveMachiningsFamilies() As MachiningsType()
|
||||
Dim ActiveMachiningsFamiliesList As New List(Of MachiningsType)
|
||||
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_DRILLING, 0, m_sDbsCurrMachIniFilePath) <> 0 Then
|
||||
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.TypeId = MCH_MY.DRILLING, .TypeName = EgtMsg(MSG_MACHININGSDBPAGE + 1)})
|
||||
End If
|
||||
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_SAWING, 0, m_sDbsCurrMachIniFilePath) <> 0 Then
|
||||
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.TypeId = MCH_MY.SAWING, .TypeName = EgtMsg(MSG_MACHININGSDBPAGE + 2)})
|
||||
End If
|
||||
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_MILLING, 0, m_sDbsCurrMachIniFilePath) <> 0 Then
|
||||
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.TypeId = MCH_MY.MILLING, .TypeName = EgtMsg(MSG_MACHININGSDBPAGE + 3)})
|
||||
End If
|
||||
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_POCKETING, 0, m_sDbsCurrMachIniFilePath) <> 0 Then
|
||||
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.TypeId = MCH_MY.POCKETING, .TypeName = EgtMsg(MSG_MACHININGSDBPAGE + 4)})
|
||||
End If
|
||||
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_MORTISING, 0, m_sDbsCurrMachIniFilePath) <> 0 Then
|
||||
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.TypeId = MCH_MY.MORTISING, .TypeName = EgtMsg(MSG_MACHININGSDBPAGE + 5)})
|
||||
End If
|
||||
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_SAWROUGHING, 0, m_sDbsCurrMachIniFilePath) <> 0 Then
|
||||
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.TypeId = MCH_MY.SAWROUGHING, .TypeName = EgtMsg(MSG_MACHININGSDBPAGE + 6)})
|
||||
End If
|
||||
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_SAWFINISHING, 0, m_sDbsCurrMachIniFilePath) <> 0 Then
|
||||
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.TypeId = MCH_MY.SAWFINISHING, .TypeName = EgtMsg(MSG_MACHININGSDBPAGE + 7)})
|
||||
End If
|
||||
Return ActiveMachiningsFamiliesList.ToArray
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Structure that represent a tool's family, containing family type and family name
|
||||
''' </summary>
|
||||
Structure MachiningsType
|
||||
|
||||
Friend TypeId As MCH_MY
|
||||
Friend TypeName As String
|
||||
|
||||
End Structure
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
Imports EgtUILib
|
||||
|
||||
''' <summary>
|
||||
''' Class that represent a Machining in the treeview.
|
||||
''' It's an element in the treeview that represent the child of familymachiningtreeviewitem, but also the class that read and write in the machining's database
|
||||
''' </summary>
|
||||
Public Class MachiningTreeViewExpanderItem
|
||||
Inherits ChildItem
|
||||
|
||||
#Region "Machining Property"
|
||||
|
||||
Private m_Type As MCH_MY
|
||||
Public ReadOnly Property Type As Integer
|
||||
Get
|
||||
Return m_Type
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Property that determines if the Machining is selected or not
|
||||
''' </summary>
|
||||
Public Overrides Property IsSelected As Boolean
|
||||
Get
|
||||
Return m_isSelected
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If (value <> m_isSelected) Then
|
||||
m_isSelected = value
|
||||
' If Machining is selected, set it as current and notify all machining's property
|
||||
' to refresh them values with those of the new selected machining
|
||||
If value Then
|
||||
EgtMdbSetCurrMachining(Me.Name)
|
||||
Else
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End Set
|
||||
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
#End Region ' Machining Property
|
||||
|
||||
#Region "Constructors"
|
||||
|
||||
Sub New(Name As String, Type As MCH_MY)
|
||||
MyBase.New(Name)
|
||||
Me.m_Type = Type
|
||||
End Sub
|
||||
|
||||
#End Region ' Constructors
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Class that represent a FamilyMachining in the treeview.
|
||||
''' It's an element in the treeview that represent a folder, but also a machining family
|
||||
''' </summary>
|
||||
Public Class FamilyMachiningTreeViewExpanderItem
|
||||
Inherits ParentItem
|
||||
|
||||
Private m_MachiningType As MCH_MY
|
||||
''' <summary>
|
||||
''' Property that determines the machining type of the family
|
||||
''' </summary>
|
||||
Public Property MachiningType As MCH_MY
|
||||
Get
|
||||
Return m_MachiningType
|
||||
End Get
|
||||
Set(value As MCH_MY)
|
||||
m_MachiningType = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Property that determines if the Machining is selected or not
|
||||
''' </summary>
|
||||
Public Overrides Property IsSelected As Boolean
|
||||
Get
|
||||
Return m_isSelected
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If (value <> m_isSelected) Then
|
||||
m_isSelected = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Constructor that receive the name of the FamilyMachiningTreeViewItem, the MachiningType, and set
|
||||
''' the picture(Folder.png)
|
||||
''' </summary>
|
||||
Sub New(Name As String, MachiningType As MCH_MY)
|
||||
MyBase.New(Name)
|
||||
Me.MachiningType = MachiningType
|
||||
Me.PictureString = "/Resources/TreeView/Folder.png"
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
+2
-2
@@ -11,8 +11,8 @@
|
||||
<Button Content="New Positioning" Command="{Binding NewPositioningCommand}" Height="40"/>
|
||||
<Button Content="Cancel Operation" Command="{Binding CancelOperationCommand}" Height="40"/>
|
||||
</UniformGrid>
|
||||
<ListBox ItemsSource="{Binding OperationList}" SelectedItem="{Binding SelectedOperation}"
|
||||
MaxHeight="400">
|
||||
<ListBox ItemsSource="{Binding OperationList}" SelectedItem="{Binding SelectedOperation}"
|
||||
MaxHeight="400" x:Name="OperationList">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
|
||||
+4
-1
@@ -37,12 +37,14 @@ Namespace EgtCAM5
|
||||
End Get
|
||||
Set(value As OperationListBoxItem)
|
||||
If value IsNot m_SelectedOperation Then
|
||||
'EgtSetCurrMachining(value.Id)
|
||||
If m_LastMarkedOperationId <> GDB_ID.NULL Then
|
||||
EgtResetMark(m_LastMarkedOperationId)
|
||||
End If
|
||||
EgtSetMark(value.Id)
|
||||
m_LastMarkedOperationId = value.Id
|
||||
EgtDraw()
|
||||
Application.Msn.NotifyColleagues(Application.SELECTEDOPERATION, value)
|
||||
m_SelectedOperation = value
|
||||
End If
|
||||
End Set
|
||||
@@ -82,7 +84,8 @@ Namespace EgtCAM5
|
||||
''' Execute the Point. This method is invoked by the PointCommand.
|
||||
''' </summary>
|
||||
Public Sub NewMachining(ByVal param As Object)
|
||||
|
||||
EgtDeselectAll()
|
||||
Application.Msn.NotifyColleagues(Application.MACHININGTREEVIEWEXPANDERISENABLED, True)
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
Imports EgtUILib
|
||||
Imports System.ComponentModel
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class OperationListBoxItem
|
||||
Implements INotifyPropertyChanged
|
||||
|
||||
Private m_Id As Integer
|
||||
Public Property Id As Integer
|
||||
@@ -42,6 +44,20 @@ Public Class OperationListBoxItem
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'Public Property Invert As Boolean
|
||||
' Get
|
||||
' 'EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
' Dim bInvert As Boolean = False
|
||||
' EgtMdbGetCurrMachiningParam(MCH_MP.INVERT, bInvert)
|
||||
' Return bInvert
|
||||
' End Get
|
||||
' Set(value As Boolean)
|
||||
' 'EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
' EgtMdbSetCurrMachiningParam(MCH_MP.INVERT, value)
|
||||
' End Set
|
||||
'End Property
|
||||
|
||||
|
||||
Sub New(Id As Integer, Name As String, Type As Integer, Tool As String)
|
||||
Me.Id = Id
|
||||
Me.Name = Name
|
||||
@@ -50,7 +66,7 @@ Public Class OperationListBoxItem
|
||||
End Sub
|
||||
|
||||
Private Function ConvertTypeToImage(Type As Integer) As String
|
||||
Select Type
|
||||
Select Case Type
|
||||
Case MCH_OY.DISP
|
||||
Return ""
|
||||
Case MCH_OY.DRILLING
|
||||
@@ -72,4 +88,10 @@ Public Class OperationListBoxItem
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
|
||||
|
||||
Public Sub NotifyPropertyChanged(propName As String)
|
||||
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
+187
-5
@@ -1,11 +1,193 @@
|
||||
<UserControl x:Class="OperationPropertyExpanderView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:EgtCAM5">
|
||||
|
||||
<Expander Header="Operation Parameters" IsExpanded="{Binding IsEnabled}">
|
||||
<UniformGrid>
|
||||
<TextBox Text="{Binding InfoBox}"/>
|
||||
</UniformGrid>
|
||||
<Expander Header="Operation Parameters">
|
||||
<StackPanel DataContext="{Binding OperationListBoxItem}">
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="Name"/>
|
||||
<TextBox Text="{Binding Invert}"/>
|
||||
</UniformGrid>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="Depth"/>
|
||||
<TextBox Text="{Binding Depth}"/>
|
||||
</UniformGrid>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="Invert"/>
|
||||
<CheckBox HorizontalAlignment="Center" IsChecked="{Binding Invert}" />
|
||||
</UniformGrid>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="WorkSide"/>
|
||||
<ComboBox ItemsSource="{Binding WorkSideList}"
|
||||
SelectedIndex="{Binding SelectedWorkSide}">
|
||||
<ComboBoxItem Content="Center" IsSelected="True"/>
|
||||
<ComboBoxItem Content="Left"/>
|
||||
<ComboBoxItem Content="Right"/>
|
||||
</ComboBox>
|
||||
</UniformGrid>
|
||||
<Expander Header="Generic">
|
||||
<StackPanel>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="Step"/>
|
||||
<TextBox />
|
||||
</UniformGrid>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="StepType"/>
|
||||
<TextBox />
|
||||
</UniformGrid>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="SideAngle"/>
|
||||
<TextBox />
|
||||
</UniformGrid>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="StartPos"/>
|
||||
<TextBox />
|
||||
</UniformGrid>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="ReturnPos"/>
|
||||
<TextBox />
|
||||
</UniformGrid>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="StartSlowLen"/>
|
||||
<TextBox />
|
||||
</UniformGrid>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="EndSlowLen"/>
|
||||
<TextBox />
|
||||
</UniformGrid>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="OffsetSr"/>
|
||||
<TextBox />
|
||||
</UniformGrid>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="OffsetSl"/>
|
||||
<TextBox />
|
||||
</UniformGrid>
|
||||
</StackPanel>
|
||||
</Expander>
|
||||
<Expander>
|
||||
<Expander.Header>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="LeadInType"/>
|
||||
<ComboBox>
|
||||
<ComboBoxItem Content="None"/>
|
||||
<ComboBoxItem Content="Linear"/>
|
||||
<ComboBoxItem Content="Tangent" IsSelected="True"/>
|
||||
<ComboBoxItem Content="Helix"/>
|
||||
</ComboBox>
|
||||
</UniformGrid>
|
||||
</Expander.Header>
|
||||
<StackPanel>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="StartAddLen"/>
|
||||
<TextBox />
|
||||
</UniformGrid>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="ReturnPos"/>
|
||||
<TextBox />
|
||||
</UniformGrid>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="ReturnPos"/>
|
||||
<TextBox />
|
||||
</UniformGrid>
|
||||
<TextBox />
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="ReturnPos"/>
|
||||
<TextBox />
|
||||
</UniformGrid>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="ReturnPos"/>
|
||||
<TextBox />
|
||||
</UniformGrid>
|
||||
</StackPanel>
|
||||
</Expander>
|
||||
<Expander HorizontalAlignment="Left">
|
||||
<Expander.Header>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="LeadOutType"/>
|
||||
<ComboBox>
|
||||
<ComboBoxItem Content="None"/>
|
||||
<ComboBoxItem Content="Linear"/>
|
||||
<ComboBoxItem Content="Tangent" IsSelected="True"/>
|
||||
<ComboBoxItem Content="Helix"/>
|
||||
</ComboBox>
|
||||
</UniformGrid>
|
||||
</Expander.Header>
|
||||
<StackPanel>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="ReturnPos"/>
|
||||
<TextBox />
|
||||
</UniformGrid>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="ReturnPos"/>
|
||||
<TextBox />
|
||||
</UniformGrid>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="ReturnPos"/>
|
||||
<TextBox />
|
||||
</UniformGrid>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="ReturnPos"/>
|
||||
<TextBox />
|
||||
</UniformGrid>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="ReturnPos"/>
|
||||
<TextBox />
|
||||
</UniformGrid>
|
||||
</StackPanel>
|
||||
</Expander>
|
||||
<Expander>
|
||||
<Expander.Header>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="LeaveTab"/>
|
||||
<CheckBox HorizontalAlignment="Center"/>
|
||||
</UniformGrid>
|
||||
</Expander.Header>
|
||||
<StackPanel>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="ReturnPos"/>
|
||||
<TextBox />
|
||||
</UniformGrid>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="ReturnPos"/>
|
||||
<TextBox />
|
||||
</UniformGrid>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="ReturnPos"/>
|
||||
<TextBox />
|
||||
</UniformGrid>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="ReturnPos"/>
|
||||
<TextBox />
|
||||
</UniformGrid>
|
||||
</StackPanel>
|
||||
</Expander>
|
||||
<Expander Header="Tool">
|
||||
<StackPanel>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="Speed"/>
|
||||
<TextBox />
|
||||
</UniformGrid>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="Feed"/>
|
||||
<TextBox />
|
||||
</UniformGrid>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="StartFeed"/>
|
||||
<TextBox />
|
||||
</UniformGrid>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="EndFeed"/>
|
||||
<TextBox />
|
||||
</UniformGrid>
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="TipFeed"/>
|
||||
<TextBox />
|
||||
</UniformGrid>
|
||||
</StackPanel>
|
||||
</Expander>
|
||||
</StackPanel>
|
||||
</Expander>
|
||||
|
||||
</UserControl>
|
||||
|
||||
+41
-1
@@ -1,6 +1,46 @@
|
||||
Namespace EgtCAM5
|
||||
Imports EgtUILib
|
||||
|
||||
Namespace EgtCAM5
|
||||
|
||||
Public Class OperationPropertyExpanderViewModel
|
||||
Inherits ViewModelBase
|
||||
|
||||
Private m_SelectedOperation As OperationListBoxItem
|
||||
Public Property SelectedOperation As OperationListBoxItem
|
||||
Get
|
||||
Return m_SelectedOperation
|
||||
End Get
|
||||
Set(value As OperationListBoxItem)
|
||||
If value IsNot m_SelectedOperation Then
|
||||
Dim x = EgtSetCurrMachining(value.Id)
|
||||
m_SelectedOperation = value
|
||||
|
||||
m_SelectedOperation.NotifyPropertyChanged("Invert")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'Private m_Depth As String
|
||||
'Public Property Depth As String
|
||||
' Get
|
||||
' EgtGetMachiningParam(MCH_MP.DEPTH, m_Depth)
|
||||
' Return m_Depth
|
||||
' End Get
|
||||
' Set(value As String)
|
||||
' If value <> m_Depth Then
|
||||
' If EgtSetMachiningParam(MCH_MP.NAME, value) Then
|
||||
' m_Depth = value
|
||||
' End If
|
||||
' End If
|
||||
' 'OnPropertyChanged("Depth")
|
||||
' End Set
|
||||
'End Property
|
||||
|
||||
Sub New()
|
||||
Application.Msn.Register(Application.SELECTEDOPERATION, Sub(SelectedOperation As OperationListBoxItem)
|
||||
Me.SelectedOperation = SelectedOperation
|
||||
End Sub)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
@@ -404,6 +404,9 @@ Namespace EgtCAM5
|
||||
Application.Msn.Register(Application.ISOVIEWNW, Sub()
|
||||
m_ProjectScene.IsoViewNW()
|
||||
End Sub)
|
||||
Application.Msn.Register(Application.VIEWTOCPLANE, Sub()
|
||||
m_ProjectScene.CPlaneView()
|
||||
End Sub)
|
||||
Application.Msn.Register(Application.SETSTATUSANALYZE, Sub()
|
||||
m_ProjectScene.SetStatusAnalyze()
|
||||
End Sub)
|
||||
|
||||
Reference in New Issue
Block a user