EgtCAM5 :

- Migliorie varie.
This commit is contained in:
Emmanuele Sassi
2016-07-09 19:17:02 +00:00
parent a10b8d2ec6
commit 4db56e7e09
25 changed files with 510 additions and 44 deletions
+5
View File
@@ -1,4 +1,5 @@
Imports EgtCAM5.EgtCAM5
Class Application
' Application-level events, such as Startup, Exit, and DispatcherUnhandledException
@@ -25,6 +26,10 @@ Class Application
Friend Const CLOSEAPPLICATION As String = "CloseApplication"
Friend Const PROJECTPAGE_SELECTED As String = "ProjectPage_Selected"
Friend Const PROJECTPAGE_DESELECTED As String = "ProjectPage_Deselected"
Friend Const PROJECTPAGE_DRAWMODE As String = "ProjectPage_DrawMode"
Friend Const PROJECTPAGE_MACHININGMODE As String = "ProjectPage_MachiningMode"
Friend Const RESETSTATUS As String = "ResetStatus"
Friend Const LOADOPERATIONLIST As String = "LoadOperationList"
' ProjectPage messages
Friend Const NOTIFYCURRPOS As String = "NotifyCurrPos"
+6 -3
View File
@@ -3,13 +3,16 @@
Public Class TabViewModel
Inherits ViewModelBase
Private m_sTabName As String
Public Property sTabName As String
Friend m_sTabName As String
Public Overridable Property sTabName As String
Get
Return m_sTabName
End Get
Set(value As String)
m_sTabName = value
If value <> m_sTabName Then
m_sTabName = value
OnPropertyChanged("sTabName")
End If
End Set
End Property
+20 -1
View File
@@ -152,6 +152,11 @@
<DependentUpon>ManageLayerExpanderView.xaml</DependentUpon>
</Compile>
<Compile Include="ProjectPage\OptionPanel\DrawOptionPanel\ManageLayerExpander\ManageLayerExpanderViewModel.vb" />
<Compile Include="ProjectPage\OptionPanel\DrawOptionPanel\OperationExpander\OperationExpanderView.xaml.vb">
<DependentUpon>OperationExpanderView.xaml</DependentUpon>
</Compile>
<Compile Include="ProjectPage\OptionPanel\DrawOptionPanel\OperationExpander\OperationExpanderViewModel.vb" />
<Compile Include="ProjectPage\OptionPanel\DrawOptionPanel\OperationExpander\OperationListBox.vb" />
<Compile Include="ProjectPage\ProjectView.xaml.vb">
<DependentUpon>ProjectView.xaml</DependentUpon>
</Compile>
@@ -220,6 +225,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ProjectPage\OptionPanel\DrawOptionPanel\OperationExpander\OperationExpanderView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ProjectPage\ProjectView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -287,7 +296,7 @@
</ItemGroup>
<ItemGroup>
<Folder Include="Internals\" />
<Folder Include="ProjectPage\OptionPanel\MachiningOptionPanel\" />
<Folder Include="ProjectPage\OptionPanel\DrawOptionPanel\OperationPropertyExpander\" />
<Folder Include="Resources\OptionPanel\DrawOptionPanel\" />
<Folder Include="Resources\OptionPanel\MachiningOptionPanel\" />
<Folder Include="Resources\ProjectPage\" />
@@ -383,6 +392,16 @@
<Resource Include="Resources\TreeView\Text.ico" />
<Resource Include="Resources\TreeView\Vector.ico" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\TopCommandBar\Exec.png" />
<Resource Include="Resources\TopCommandBar\Export.png" />
<Resource Include="Resources\TopCommandBar\Import.png" />
<Resource Include="Resources\TopCommandBar\Insert.png" />
<Resource Include="Resources\TopCommandBar\New.png" />
<Resource Include="Resources\TopCommandBar\Open.png" />
<Resource Include="Resources\TopCommandBar\Save.png" />
<Resource Include="Resources\TopCommandBar\SaveAs.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtCAM5\EgtCAM5R32.exe
+3
View File
@@ -74,6 +74,9 @@
<Setter Property="Width" Value="30"/>
</Style>
<Style x:Key="DrawOptionPanel_ToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
</Style>
<Style x:Key="EgtCAM5_LampToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
<Setter Property="Height" Value="30"/>
<Setter Property="Width" Value="30"/>
+19 -1
View File
@@ -128,7 +128,7 @@ Namespace EgtCAM5
' INITIALIZE EGALTECH ENVIRONMENT
InitializeEgtEnvironment()
AddHandler Application.Current.MainWindow.KeyDown, AddressOf MainWindow_KeyDown
' INITIALIZE GRAPHICS
TabList.Add(New ProjectViewModel)
TabList.Add(New ToolsDbViewModel)
@@ -442,6 +442,24 @@ Namespace EgtCAM5
End If
End Sub
#End Region
#Region "Events"
Private Sub MainWindow_KeyDown(ByVal sender As System.Object, ByVal e As KeyEventArgs)
' Con ESC esco dall'azione corrente
If e.Key = Key.Escape Then
' reset Azione corrente
Application.Msn.NotifyColleagues(Application.RESETSTATUS)
' reset Analisi e Distanza
'chkAnalyze.Checked = False
'chkGetDist.Checked = False
' pulisco output
Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSOUTPUT, "")
Application.Msn.NotifyColleagues(Application.RESETINPUTBOX)
End If
End Sub
#End Region
End Class
@@ -12,7 +12,6 @@
<RadioButton Style="{StaticResource EgtCAM5_RadioButton}" Command="{Binding ShadingCommand}">
<Image Source="/Resources/GridViewPanel/RenderingSH.png" Stretch="Uniform"/>
</RadioButton>
<Separator Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" Background="LightGray"/>
<Button Style="{StaticResource EgtCAM5_Button}" Command="{Binding ZoomAllCommand}">
<Image Source="/Resources/GridViewPanel/ZoomAll.png" Stretch="Uniform"/>
</Button>
@@ -22,6 +21,7 @@
<Button Style="{StaticResource EgtCAM5_Button}" Command="{Binding ZoomOutCommand}">
<Image Source="/Resources/GridViewPanel/ZoomOut.png" Stretch="Uniform"/>
</Button>
<Separator Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" Background="LightGray"/>
<Button Style="{StaticResource EgtCAM5_Button}" Command="{Binding TopViewCommand}">
<Image Source="/Resources/GridViewPanel/LookFromTOP.png" Stretch="Uniform"/>
</Button>
@@ -58,6 +58,7 @@
<ToggleButton Style="{StaticResource EgtCAM5_ToggleButton}" Command="{Binding GetDistCommand}">
<Image Source="/Resources/GridViewPanel/GetDist.png" Stretch="Uniform"/>
</ToggleButton>
<Separator Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" Background="LightGray"/>
<Button Style="{StaticResource EgtCAM5_Button}" Command="{Binding CPlaneTopCommand}">
<Image Source="/Resources/GridViewPanel/CplaneTOP.png" Stretch="Uniform"/>
</Button>
@@ -3,6 +3,10 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="200">
<StackPanel Background="DarkGray">
<UniformGrid Rows="1">
<RadioButton Style="{StaticResource DrawOptionPanel_ToggleButton}" Content="DRAW" Height="30" IsChecked="{Binding DrawIsChecked}"/>
<RadioButton Style="{StaticResource DrawOptionPanel_ToggleButton}" Content="MACHINING" Height="30" IsChecked="{Binding WorkIsChecked}"/>
</UniformGrid>
<!--ContentPresenter that contains the ManageLayerExpander-->
<ContentPresenter Content="{Binding ManageLayerExpander}"/>
<!--ContentPresenter that contains the InfoExpander-->
@@ -1,17 +1,70 @@
Namespace EgtCAM5
Imports EgtUILib
Namespace EgtCAM5
Public Class DrawOptionPanelViewModel
Inherits ViewModelBase
' GRAPHICAL ELEMENTS
Private m_ManageLayerExpander As ManageLayerExpanderView
Public ReadOnly Property ManageLayerExpander As ManageLayerExpanderView
Private m_DrawIsChecked As Boolean
Public Property DrawIsChecked As Boolean
Get
If IsNothing(m_ManageLayerExpander) Then
m_ManageLayerExpander = New ManageLayerExpanderView
m_ManageLayerExpander.DataContext = New ManageLayerExpanderViewModel
Return m_DrawIsChecked
End Get
Set(value As Boolean)
If value <> m_DrawIsChecked Then
m_DrawIsChecked = value
If value Then
Application.Msn.NotifyColleagues(Application.PROJECTPAGE_DRAWMODE)
EgtResetCurrMachGroup()
EgtZoom(ZM.ALL)
End If
OnPropertyChanged("ManageLayerExpander")
End If
End Set
End Property
Private m_WorkIsChecked As Boolean
Public Property WorkIsChecked As Boolean
Get
Return m_WorkIsChecked
End Get
Set(value As Boolean)
If value <> m_WorkIsChecked Then
m_WorkIsChecked = value
If value Then
Application.Msn.NotifyColleagues(Application.PROJECTPAGE_MACHININGMODE)
Dim nId = EgtGetFirstMachGroup()
If nId <> GDB_ID.NULL Then
EgtSetCurrMachGroup(nId)
Else
EgtAddMachGroup("Mach01", "CMS-PF122R8RR")
End If
EgtZoom(ZM.ALL)
Application.Msn.NotifyColleagues(Application.LOADOPERATIONLIST)
End If
OnPropertyChanged("ManageLayerExpander")
End If
End Set
End Property
' GRAPHICAL ELEMENTS
Private m_OperationExpander As OperationExpanderView
Private m_ManageLayerExpander As ManageLayerExpanderView
Public ReadOnly Property ManageLayerExpander As ContentControl
Get
If m_DrawIsChecked Then
If IsNothing(m_ManageLayerExpander) Then
m_ManageLayerExpander = New ManageLayerExpanderView
m_ManageLayerExpander.DataContext = New ManageLayerExpanderViewModel
End If
Return m_ManageLayerExpander
Else
If IsNothing(m_OperationExpander) Then
m_OperationExpander = New OperationExpanderView
m_OperationExpander.DataContext = New OperationExpanderViewModel
End If
Return m_OperationExpander
End If
Return m_ManageLayerExpander
End Get
End Property
@@ -37,6 +90,11 @@
End Get
End Property
Sub New()
' Inizializzo la selezione della modilità Draw all'apertura del programma
DrawIsChecked = True
End Sub
End Class
End Namespace
@@ -11,6 +11,24 @@ Public Class LayerTreeViewItem
End Get
End Property
''' <summary>
''' Property that determines if the Tool 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 value Then
' recupero l'Id del nuovo oggetto selezionato
Application.Msn.NotifyColleagues(Application.UPDATEOBJINOBJTREE, Me.Id)
End If
End If
End Set
End Property
Private m_Items As New ObservableCollection(Of LayerTreeViewItem)
Public Property Items As ObservableCollection(Of LayerTreeViewItem)
Get
@@ -10,9 +10,8 @@
<Ellipse Height="10" Width="10" Fill="{Binding HeaderColor}" />
</StackPanel>
</Expander.Header>
<StackPanel>
<TextBox/>
<StackPanel>
<UniformGrid Rows="1">
<Button Content="New Part" Command="{Binding NewPartCommand}" Height="40"/>
@@ -378,19 +378,6 @@ Namespace EgtCAM5
End If
End Sub
'Private Sub ObjTree_AfterSelect(ByVal sender As Object, ByVal e As TreeViewEventArgs) Handles TreeView1.AfterSelect
' ' verifico che il select derivi da azione utente
' If e.Action = TreeViewAction.Unknown Then
' Return
' End If
' ' recupero l'Id del nuovo oggetto selezionato
' Dim nId As Integer
' If Not Int32.TryParse(e.Node.Name, nId) Then
' Return
' End If
' UpdateObjInObjTree(nId)
'End Sub
'Private Sub ObjTree_MouseUp(ByVal sender As Object, e As MouseEventArgs) Handles TreeView1.MouseUp
' ' determino Id di eventuale item sotto il mouse
' Dim nId As Integer = GDB_ID.NULL
@@ -0,0 +1,33 @@
<UserControl x:Class="OperationExpanderView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Expander Header="Operations List" IsExpanded="{Binding IsExpanded}">
<StackPanel>
<UniformGrid Rows="1">
<Button Content="New Machining" Command="{Binding NewMachiningCommand}" Height="40"/>
<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}">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Image Source="{Binding Image}" Height="15" Margin="0,0,5,0"/>
<TextBlock Grid.Column="1" Text="{Binding Name}" Margin="0,0,5,0"/>
<TextBlock Grid.Column="2" Text="{Binding Tool}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</StackPanel>
</Expander>
</UserControl>
@@ -0,0 +1,3 @@
Public Class OperationExpanderView
End Class
@@ -0,0 +1,167 @@
Imports System.Collections.ObjectModel
Imports EgtUILib
Namespace EgtCAM5
Public Class OperationExpanderViewModel
Inherits ViewModelBase
Private m_IsExpanded As Boolean
Public Property IsExpanded As Boolean
Get
Return m_IsExpanded
End Get
Set(value As Boolean)
If value <> m_IsExpanded Then
m_IsExpanded = value
OnPropertyChanged("IsExpanded")
End If
End Set
End Property
Private m_OperationList As New ObservableCollection(Of OperationListBoxItem)
Public Property OperationList As ObservableCollection(Of OperationListBoxItem)
Get
Return m_OperationList
End Get
Set(value As ObservableCollection(Of OperationListBoxItem))
m_OperationList = value
End Set
End Property
Private m_SelectedOperation As OperationListBoxItem
Public Property SelectedOperation As OperationListBoxItem
Get
Return m_SelectedOperation
End Get
Set(value As OperationListBoxItem)
m_SelectedOperation = value
End Set
End Property
' Definizione comandi
Private m_cmdNewMachining As ICommand
Private m_cmdNewPositioning As ICommand
Private m_cmdCancelOperation As ICommand
Sub New()
Application.Msn.Register(Application.LOADOPERATIONLIST, Sub()
LoadOperationList()
End Sub)
End Sub
#Region "COMMANDS"
#Region "NewMachiningCommand"
''' <summary>
''' Returns a command that do Point.
''' </summary>
Public ReadOnly Property NewMachiningCommand As ICommand
Get
If m_cmdNewMachining Is Nothing Then
m_cmdNewMachining = New RelayCommand(AddressOf NewMachining, AddressOf CanNewMachining)
End If
Return m_cmdNewMachining
End Get
End Property
''' <summary>
''' Execute the Point. This method is invoked by the PointCommand.
''' </summary>
Public Sub NewMachining(ByVal param As Object)
End Sub
''' <summary>
''' Returns always true.
''' </summary>
Private Function CanNewMachining(ByVal param As Object) As Boolean
Return True
End Function
#End Region ' NewMachiningCommand
#Region "NewPositioningCommand"
''' <summary>
''' Returns a command that do Point.
''' </summary>
Public ReadOnly Property NewPositioningCommand As ICommand
Get
If m_cmdNewPositioning Is Nothing Then
m_cmdNewPositioning = New RelayCommand(AddressOf NewPositioning, AddressOf CanNewPositioning)
End If
Return m_cmdNewPositioning
End Get
End Property
''' <summary>
''' Execute the Point. This method is invoked by the PointCommand.
''' </summary>
Public Sub NewPositioning(ByVal param As Object)
End Sub
''' <summary>
''' Returns always true.
''' </summary>
Private Function CanNewPositioning(ByVal param As Object) As Boolean
Return True
End Function
#End Region ' NewPositioningCommand
#Region "CancelOperationCommand"
''' <summary>
''' Returns a command that do Point.
''' </summary>
Public ReadOnly Property CancelOperationCommand As ICommand
Get
If m_cmdCancelOperation Is Nothing Then
m_cmdCancelOperation = New RelayCommand(AddressOf CancelOperation, AddressOf CanCancelOperation)
End If
Return m_cmdCancelOperation
End Get
End Property
''' <summary>
''' Execute the Point. This method is invoked by the PointCommand.
''' </summary>
Public Sub CancelOperation(ByVal param As Object)
End Sub
''' <summary>
''' Returns always true.
''' </summary>
Private Function CanCancelOperation(ByVal param As Object) As Boolean
Return True
End Function
#End Region ' CancelOperationCommand
#End Region ' Commands
Private Sub LoadOperationList()
Dim Id As Integer
Dim OpName As String = String.Empty
Dim OpType As Integer = 0
Dim OpTool As String = String.Empty
Id = EgtGetFirstOperation()
While Id <> GDB_ID.NULL
EgtGetOperationName(Id, OpName)
OpType = EgtGetOperationType(Id)
Select Case OpType
Case MCH_OY.DRILLING, MCH_OY.SAWING, MCH_OY.MILLING, MCH_OY.POCKETING, MCH_OY.MORTISING, MCH_OY.SAWROUGHING, MCH_OY.SAWFINISHING
EgtSetCurrMachining(Id)
EgtGetMachiningParam(MCH_MP.TOOL, OpTool)
Case MCH_OY.DISP
OpTool = String.Empty
End Select
OperationList.Add(New OperationListBoxItem(Id, OpName, OpType, OpTool))
Id = EgtGetNextOperation(Id)
End While
End Sub
End Class
End Namespace
@@ -0,0 +1,75 @@
Imports EgtUILib
Public Class OperationListBoxItem
Private m_Id As Integer
Public Property Id As Integer
Get
Return m_Id
End Get
Set(value As Integer)
m_Id = value
End Set
End Property
Private m_Name As String
Public Property Name As String
Get
Return m_Name
End Get
Set(value As String)
m_Name = value
End Set
End Property
Private m_Image As String
Public Property Image As String
Get
Return m_Image
End Get
Set(value As String)
m_Image = value
End Set
End Property
Private m_Tool As String
Public Property Tool As String
Get
Return m_Tool
End Get
Set(value As String)
m_Tool = 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
Me.Image = ConvertTypeToImage(Type)
Me.Tool = Tool
End Sub
Private Function ConvertTypeToImage(Type As Integer) As String
Select Type
Case MCH_OY.DISP
Return ""
Case MCH_OY.DRILLING
Return ""
Case MCH_OY.SAWING
Return ""
Case MCH_OY.MILLING
Return ""
Case MCH_OY.POCKETING
Return ""
Case MCH_OY.MORTISING
Return ""
Case MCH_OY.SAWROUGHING
Return ""
Case MCH_OY.SAWFINISHING
Return ""
Case Else
Return String.Empty
End Select
End Function
End Class
+64 -7
View File
@@ -26,13 +26,14 @@ Namespace EgtCAM5
Get
If m_bfirst Then
SceneHost = New WindowsFormsHost() With {.Child = m_ProjectScene}
PreInitializeScene()
If Not m_ProjectScene.Init() Then
EgtOutLog("Error in Project scene creation")
' Chiudo il programma
Application.Msn.NotifyColleagues(Application.CLOSEAPPLICATIONCOMMAND)
End If
IniFile.m_ProjectSceneContext = m_ProjectScene.GetCtx
InitializeEgtProject()
PostInitializeScene()
' inizializzo gestore lavorazioni
EgtInitMachMgr(IniFile.m_sMachinesRoot)
m_bfirst = False
@@ -68,7 +69,7 @@ Namespace EgtCAM5
Sub New()
Me.sTabName = EgtMsg(MSG_MAINWINDOW + 1)
Dim WinPos As New WinPos
GetPrivateProfileWinPos(S_GENERAL, "Win1", WinPos.nflag, WinPos.nLeft, WinPos.nTop, WinPos.nWidth, WinPos.nHeight)
GetPrivateProfileWinPos(S_GENERAL, "Win1", WinPos.nFlag, WinPos.nLeft, WinPos.nTop, WinPos.nWidth, WinPos.nHeight)
m_GridViewPanel = New BaseWindowView
m_GridViewPanel.DataContext = New GridViewPanelViewModel
WinPosToWindow(m_GridViewPanel, WinPos)
@@ -82,10 +83,15 @@ Namespace EgtCAM5
m_DrawOptionPanel = New BaseWindowView
m_DrawOptionPanel.DataContext = New DrawOptionPanelViewModel
WinPosToWindow(m_DrawOptionPanel, WinPos)
GetPrivateProfileWinPos(S_GENERAL, "Win3", WinPos.nFlag, WinPos.nLeft, WinPos.nTop, WinPos.nWidth, WinPos.nHeight)
m_DrawOptionPanel = New BaseWindowView
m_DrawOptionPanel.DataContext = New DrawOptionPanelViewModel
WinPosToWindow(m_DrawOptionPanel, WinPos)
m_DrawOptionPanel.Show()
' Funzione che contiene la registrazione alle funzioni che permettono di visualizzare e nascondere le finestre di disegno
ManagePanelVisibility()
ManageClosingApplication()
RegisterMainWindowCommands()
' Inizializza i parametri della scena
'InitializeEgtProject()
RegisterControllerCommands()
@@ -102,7 +108,43 @@ Namespace EgtCAM5
#Region "METHODS"
Private Sub InitializeEgtProject()
Private Sub PreInitializeScene()
' imposto colore di default
Dim DefColor As New Color3d(0, 0, 0)
GetPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor)
m_ProjectScene.SetDefaultMaterial(DefColor)
' imposto colori sfondo
Dim BackTopColor As New Color3d(192, 192, 192)
GetPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor)
Dim BackBotColor As New Color3d(BackTopColor)
GetPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor)
m_ProjectScene.SetViewBackground(BackTopColor, BackBotColor)
' imposto colore di evidenziazione
Dim MarkColor As New Color3d(255, 255, 0)
GetPrivateProfileColor(S_SCENE, K_MARK, MarkColor)
m_ProjectScene.SetMarkMaterial(MarkColor)
' imposto colore per superfici selezionate
Dim SelSurfColor As New Color3d(255, 255, 192)
GetPrivateProfileColor(S_SCENE, K_SELSURF, SelSurfColor)
m_ProjectScene.SetSelSurfMaterial(SelSurfColor)
' imposto tipo e colore del rettangolo di zoom
Dim bOutline As Boolean = True
Dim ZwColor As New Color3d(0, 0, 0)
GetPrivateProfileZoomWin(S_SCENE, K_ZOOMWIN, bOutline, ZwColor)
m_ProjectScene.SetZoomWinAttribs(bOutline, ZwColor)
' imposto colore della linea di distanza
Dim DstLnColor As New Color3d(255, 0, 0)
GetPrivateProfileColor(S_SCENE, K_DISTLINE, DstLnColor)
m_ProjectScene.SetDistLineMaterial(DstLnColor)
' imposto parametri OpenGL
Dim nDriver As Integer = GetPrivateProfileInt(S_OPENGL, K_DRIVER, 3)
Dim b2Buff As Boolean = (GetPrivateProfileInt(S_OPENGL, K_DOUBLEBUFFER, 1) <> 0)
Dim nColorBits As Integer = GetPrivateProfileInt(S_OPENGL, K_COLORBITS, 32)
Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32)
m_ProjectScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
End Sub
Private Sub PostInitializeScene()
'Impostazioni Controller
m_Controller.SetScene(m_ProjectScene)
Dim bLuaReg As Boolean = (GetPrivateProfileInt(S_GENERAL, K_COMMANDLOG, 0) <> 0)
@@ -143,6 +185,7 @@ Namespace EgtCAM5
' visualizzazione avanzata dei triangoli costituenti le superfici
Dim bShowTriaAdv As Boolean = (GetPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1) <> 0)
EgtSetShowTriaAdv(bShowTriaAdv)
Application.Msn.NotifyColleagues(Application.PROJECTPAGE_DRAWMODE)
' ObjTree non selezionato
Application.Msn.NotifyColleagues(Application.UPDATEOBJTREEOLDID, GDB_ID.NULL)
' nascondo input box
@@ -180,6 +223,18 @@ Namespace EgtCAM5
m_DrawPanel.Visibility = Visibility.Hidden
m_DrawOptionPanel.Visibility = Visibility.Hidden
End Sub)
Application.Msn.Register(Application.PROJECTPAGE_DRAWMODE, Sub()
Me.sTabName = EgtMsg(MSG_MAINWINDOW + 1)
m_GridViewPanel.Visibility = Visibility.Visible
m_DrawPanel.Visibility = Visibility.Visible
m_DrawOptionPanel.Visibility = Visibility.Visible
End Sub)
Application.Msn.Register(Application.PROJECTPAGE_MACHININGMODE, Sub()
Me.sTabName = EgtMsg(MSG_MAINWINDOW + 2)
m_GridViewPanel.Visibility = Visibility.Visible
m_DrawPanel.Visibility = Visibility.Hidden
m_DrawOptionPanel.Visibility = Visibility.Visible
End Sub)
End Sub
@@ -360,11 +415,11 @@ Namespace EgtCAM5
m_Controller.ExecuteCommand(Controller.CMD.PLANE)
End If
End Sub)
Application.Msn.Register(Application.DELETE, Sub()
Application.Msn.Register(Application.DELETE, Sub()
m_Controller.SetLastInteger(GDB_ID.SEL)
m_Controller.ExecuteCommand(Controller.CMD.DELETE)
End Sub)
Application.Msn.Register(Application.CHANGECOLOR, Sub()
Application.Msn.Register(Application.CHANGECOLOR, Sub()
If (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control Then
m_Controller.ExecuteCommand(Controller.CMD.CHANGEALPHA)
ElseIf (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
@@ -373,7 +428,7 @@ Namespace EgtCAM5
m_Controller.ExecuteCommand(Controller.CMD.CHANGECOLOR)
End If
End Sub)
Application.Msn.Register(Application.BREAKCURVE, Sub()
Application.Msn.Register(Application.BREAKCURVE, Sub()
If (Keyboard.Modifiers And ModifierKeys.Shift) <> ModifierKeys.Shift Then
m_Controller.ExecuteCommand(Controller.CMD.BREAKCURVE)
Else
@@ -459,11 +514,13 @@ Namespace EgtCAM5
End Sub)
End Sub
Sub RegisterMainWindowCommands()
Application.Msn.Register(Application.LOADGRIDDATA, Sub()
LoadGridData()
End Sub)
Application.Msn.Register(Application.RESETSTATUS, Sub()
m_Controller.ResetStatus()
End Sub)
End Sub
Private Sub ManageTopCommandBar()
Binary file not shown.

After

Width:  |  Height:  |  Size: 973 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 903 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 776 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 747 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 538 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 647 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 610 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 951 B

+24 -8
View File
@@ -4,14 +4,30 @@
<!--Barra superiore dei comandi-->
<StackPanel Orientation="Horizontal" Height="30">
<Button Content="New" Command="{Binding NewCommand}"/>
<Button Content="Open" Command="{Binding OpenCommand}"/>
<Button Content="Save" Command="{Binding SaveCommand}"/>
<Button Content="Save as..." Command="{Binding SaveAsCommand}"/>
<Button Content="Insert" Command="{Binding InsertCommand}"/>
<Button Content="Import" Command="{Binding ImportCommand}"/>
<Button Content="Export" Command="{Binding ExportCommand}"/>
<Button Content="Execute" Command="{Binding ExecCommand}"/>
<Button Command="{Binding NewCommand}">
<Image Source="/Resources/TopCommandBar/New.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding OpenCommand}">
<Image Source="/Resources/TopCommandBar/Open.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding SaveCommand}">
<Image Source="/Resources/TopCommandBar/Save.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding SaveAsCommand}">
<Image Source="/Resources/TopCommandBar/SaveAs.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding InsertCommand}">
<Image Source="/Resources/TopCommandBar/Insert.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding ImportCommand}">
<Image Source="/Resources/TopCommandBar/Import.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding ExportCommand}">
<Image Source="/Resources/TopCommandBar/Export.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding ExecCommand}">
<Image Source="/Resources/TopCommandBar/Exec.png" Stretch="Uniform"/>
</Button>
</StackPanel>
</UserControl>