diff --git a/Application.xaml.vb b/Application.xaml.vb
index 034d211..ad146d9 100644
--- a/Application.xaml.vb
+++ b/Application.xaml.vb
@@ -132,6 +132,7 @@ Class Application
Friend Const UPDATEHEADERNAME As String = "UpdateHeaderName"
Friend Const UPDATEHEADERCOLOR As String = "UpdateHeaderColor"
Friend Const UPDATEOBJTREEOLDID As String = "UpdateObjTreeOldId"
+ Friend Const DRAWOPTIONPANEL_CLOSING As String = "DrawOptionPanel_Closing"
' StatusBar messages
Friend Const STATUSGRIDCOMMAND As String = "StatusGridCommand"
diff --git a/Constants/ConstIni.vb b/Constants/ConstIni.vb
index 7182302..985719e 100644
--- a/Constants/ConstIni.vb
+++ b/Constants/ConstIni.vb
@@ -85,6 +85,12 @@ Module ConstIni
Public Const S_MACH As String = "Mach"
Public Const K_MACHINESDIR As String = "MachinesDir"
Public Const K_TOOLMAKERSDIR As String = "ToolMakersDir"
+ Public Const K_CURRMACH As String = "CurrMach"
+
+ Public Const S_SIMUL As String = "Simul"
+ Public Const K_SLIDERX As String = "SliderX"
+ Public Const K_SLIDERVAL As String = "SliderVal"
+
Public Const S_MRUFILES As String = "MruFiles"
Public Const S_MRUSCRIPTS As String = "MruScripts"
diff --git a/Constants/ConstMsg.vb b/Constants/ConstMsg.vb
index 1949213..c7804f6 100644
--- a/Constants/ConstMsg.vb
+++ b/Constants/ConstMsg.vb
@@ -5,6 +5,7 @@
Public Const MSG_EGTCAM5 As Integer = 5000
Public Const MSG_MAINWINDOW As Integer = MSG_EGTCAM5
+ Public Const MSG_DRAWMODE As Integer = MSG_EGTCAM5 + 200
Public Const MSG_TOOLSDBPAGE As Integer = MSG_EGTCAM5 + 1000
Public Const MSG_TOOLSERRORS As Integer = MSG_EGTCAM5 + 1085
Public Const MSG_MACHININGSDBPAGE As Integer = MSG_EGTCAM5 + 1100
diff --git a/EgtCAM5.vbproj b/EgtCAM5.vbproj
index b6099bf..256e6da 100644
--- a/EgtCAM5.vbproj
+++ b/EgtCAM5.vbproj
@@ -147,6 +147,10 @@
InputExpanderView.xaml
+
+ MachiningTreeExpanderView.xaml
+
+ ManageLayerExpanderView.xaml
@@ -157,6 +161,14 @@
+
+ OperationPropertyExpanderView.xaml
+
+
+
+ SimulationExpanderView.xaml
+
+ ProjectView.xaml
@@ -221,6 +233,10 @@
DesignerMSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+ DesignerMSBuild:Compile
@@ -229,6 +245,14 @@
DesignerMSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+ DesignerMSBuild:Compile
@@ -296,9 +320,7 @@
-
-
@@ -309,7 +331,6 @@
-
@@ -402,6 +423,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtCAM5\EgtCAM5R32.exe
diff --git a/EgtCAM5Resources.xaml b/EgtCAM5Resources.xaml
index 6b0d700..b3e9f1c 100644
--- a/EgtCAM5Resources.xaml
+++ b/EgtCAM5Resources.xaml
@@ -2,7 +2,8 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:EgtCAM5"
- xmlns:ViewModel="clr-namespace:EgtCAM5.EgtCAM5">
+ xmlns:ViewModel="clr-namespace:EgtCAM5.EgtCAM5"
+ xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5">
@@ -64,17 +65,62 @@
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
diff --git a/MachiningsDbPage/MachiningsDbView.xaml b/MachiningsDbPage/MachiningsDbView.xaml
index 139109a..4c5fa5d 100644
--- a/MachiningsDbPage/MachiningsDbView.xaml
+++ b/MachiningsDbPage/MachiningsDbView.xaml
@@ -203,11 +203,11 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -486,6 +493,7 @@
UpdateSourceTrigger=PropertyChanged}"/>-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
+
-
+
+
+
+
-
+
+
+
+
diff --git a/ProjectPage/DrawPanel/DrawPanelViewModel.vb b/ProjectPage/DrawPanel/DrawPanelViewModel.vb
index 7e38700..b2c011f 100644
--- a/ProjectPage/DrawPanel/DrawPanelViewModel.vb
+++ b/ProjectPage/DrawPanel/DrawPanelViewModel.vb
@@ -5,17 +5,244 @@ Namespace EgtCAM5
Public Class DrawPanelViewModel
Inherits ViewModelBase
+ 'Proprietà ToolTip
+ Public ReadOnly Property PointToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 1)
+ End Get
+ End Property
+ Public ReadOnly Property Line2PToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 2)
+ End Get
+ End Property
+ Public ReadOnly Property LinePDLToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 3)
+ End Get
+ End Property
+ Public ReadOnly Property CirclePDToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 4)
+ End Get
+ End Property
+ Public ReadOnly Property CircleCDToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 5)
+ End Get
+ End Property
+ Public ReadOnly Property ArcCSEToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 6)
+ End Get
+ End Property
+ Public ReadOnly Property Arc3PToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 7)
+ End Get
+ End Property
+ Public ReadOnly Property ArcPDPToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 8)
+ End Get
+ End Property
+ Public ReadOnly Property FilletToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 9)
+ End Get
+ End Property
+ Public ReadOnly Property ChamferToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 10)
+ End Get
+ End Property
+ Public ReadOnly Property Rectangle2PToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 11)
+ End Get
+ End Property
+ Public ReadOnly Property PolygonToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 12)
+ End Get
+ End Property
+ Public ReadOnly Property PolygonSideToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 13)
+ End Get
+ End Property
+ Public ReadOnly Property TextToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 14)
+ End Get
+ End Property
+
+ Public ReadOnly Property PlaneToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 15)
+ End Get
+ End Property
+ Public ReadOnly Property ExtrudeToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 16)
+ End Get
+ End Property
+ Public ReadOnly Property RevolveToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 17)
+ End Get
+ End Property
+ Public ReadOnly Property ScrewToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 18)
+ End Get
+ End Property
+ Public ReadOnly Property RuledToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 19)
+ End Get
+ End Property
+ Public ReadOnly Property MergeSurfToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 20)
+ End Get
+ End Property
+ Public ReadOnly Property ExplodeSurfToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 21)
+ End Get
+ End Property
+ Public ReadOnly Property InvertSurfToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 22)
+ End Get
+ End Property
+
+ Public ReadOnly Property DeleteToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 23)
+ End Get
+ End Property
+
+ Public ReadOnly Property ChangeLayerToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 24)
+ End Get
+ End Property
+ Public ReadOnly Property ChangeAlphaToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 25)
+ End Get
+ End Property
+ Public ReadOnly Property ResetColorToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 26)
+ End Get
+ End Property
+ Public ReadOnly Property ChangeColorToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 27)
+ End Get
+ End Property
+
+ Public ReadOnly Property InvertCurveToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 28)
+ End Get
+ End Property
+ Public ReadOnly Property ChangeStartToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 29)
+ End Get
+ End Property
+ Public ReadOnly Property ExtendCurveToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 30)
+ End Get
+ End Property
+ Public ReadOnly Property BreakCurveToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 31)
+ End Get
+ End Property
+ Public ReadOnly Property SplitCurveToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 32)
+ End Get
+ End Property
+
+ Public ReadOnly Property JoinCurveToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 33)
+ End Get
+ End Property
+ Public ReadOnly Property ExplodeCurveToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 34)
+ End Get
+ End Property
+ Public ReadOnly Property ThickCurveToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 35)
+ End Get
+ End Property
+
+ Public ReadOnly Property MoveToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 36)
+ End Get
+ End Property
+ Public ReadOnly Property RotateToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 37)
+ End Get
+ End Property
+ Public ReadOnly Property Rotate3DToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 38)
+ End Get
+ End Property
+ Public ReadOnly Property MirrorToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 39)
+ End Get
+ End Property
+ Public ReadOnly Property Mirror3DToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 40)
+ End Get
+ End Property
+ Public ReadOnly Property ScaleToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 41)
+ End Get
+ End Property
+ Public ReadOnly Property Scale3DToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 42)
+ End Get
+ End Property
+
+ Public ReadOnly Property OffsetToolTip As String
+ Get
+ Return EgtMsg(MSG_DRAWMODE + 43)
+ End Get
+ End Property
+
' Definizione comandi
Private m_cmdPoint As ICommand
Private m_cmdLine2P As ICommand
Private m_cmdLinePDL As ICommand
- Private m_cmdCircle As ICommand
+ Private m_cmdCircleCP As ICommand
+ Private m_cmdCircleCD As ICommand
Private m_cmdArcCSE As ICommand
Private m_cmdArc3P As ICommand
Private m_cmdArcPDP As ICommand
Private m_cmdFillet As ICommand
+ Private m_cmdChamfer As ICommand
Private m_cmdRectangle2P As ICommand
Private m_cmdPolygon As ICommand
+ Private m_cmdPolygonSide As ICommand
Private m_cmdText As ICommand
Private m_cmdPlane As ICommand
Private m_cmdExtrude As ICommand
@@ -27,18 +254,24 @@ Namespace EgtCAM5
Private m_cmdInvertSurf As ICommand
Private m_cmdDelete As ICommand
Private m_cmdChangeLayer As ICommand
+ Private m_cmdChangeAlpha As ICommand
+ Private m_cmdResetColor As ICommand
Private m_cmdChangeColor As ICommand
Private m_cmdInvertCurve As ICommand
Private m_cmdChangeStartCurve As ICommand
Private m_cmdExtendCurve As ICommand
Private m_cmdBreakCurve As ICommand
+ Private m_cmdSplitCurve As ICommand
Private m_cmdJoinCurve As ICommand
Private m_cmdExplodeCurve As ICommand
Private m_cmdSetCurveTh As ICommand
Private m_cmdMove As ICommand
Private m_cmdRotate As ICommand
+ Private m_cmdRotate3D As ICommand
Private m_cmdMirror As ICommand
+ Private m_cmdMirror3D As ICommand
Private m_cmdScale As ICommand
+ Private m_cmdScale3D As ICommand
Private m_cmdOffset As ICommand
@@ -136,35 +369,65 @@ Namespace EgtCAM5
#End Region ' LinePDLCommand
-#Region "CircleCommand"
+#Region "CircleCPCommand"
'''
- ''' Returns a command that do Circle.
+ ''' Returns a command that do CircleCP.
'''
- Public ReadOnly Property CircleCommand As ICommand
+ Public ReadOnly Property CircleCPCommand As ICommand
Get
- If m_cmdCircle Is Nothing Then
- m_cmdCircle = New RelayCommand(AddressOf Circle, AddressOf CanCircle)
+ If m_cmdCircleCP Is Nothing Then
+ m_cmdCircleCP = New RelayCommand(AddressOf CircleCP, AddressOf CanCircleCP)
End If
- Return m_cmdCircle
+ Return m_cmdCircleCP
End Get
End Property
'''
- ''' Execute the Circle. This method is invoked by the CircleCommand.
+ ''' Execute the CircleCP. This method is invoked by the CircleCPCommand.
'''
- Public Sub Circle(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.CIRCLE)
+ Public Sub CircleCP(ByVal param As Object)
+ Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.CIRCLECP)
End Sub
'''
''' Returns always true.
'''
- Private Function CanCircle(ByVal param As Object) As Boolean
+ Private Function CanCircleCP(ByVal param As Object) As Boolean
Return True
End Function
-#End Region ' CircleCommand
+#End Region ' CircleCPCommand
+
+#Region "CircleCDCommand"
+
+ '''
+ ''' Returns a command that do CircleCD.
+ '''
+ Public ReadOnly Property CircleCDCommand As ICommand
+ Get
+ If m_cmdCircleCD Is Nothing Then
+ m_cmdCircleCD = New RelayCommand(AddressOf CircleCD, AddressOf CanCircleCD)
+ End If
+ Return m_cmdCircleCD
+ End Get
+ End Property
+
+ '''
+ ''' Execute the CircleCD. This method is invoked by the CircleCDCommand.
+ '''
+ Public Sub CircleCD(ByVal param As Object)
+ Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.CIRCLECD)
+ End Sub
+
+ '''
+ ''' Returns always true.
+ '''
+ Private Function CanCircleCD(ByVal param As Object) As Boolean
+ Return True
+ End Function
+
+#End Region ' CircleCDCommand
#Region "ArcCSECommand"
@@ -286,6 +549,36 @@ Namespace EgtCAM5
#End Region ' FilletCommand
+#Region "ChamferCommand"
+
+ '''
+ ''' Returns a command that do Chamfer.
+ '''
+ Public ReadOnly Property ChamferCommand As ICommand
+ Get
+ If m_cmdChamfer Is Nothing Then
+ m_cmdChamfer = New RelayCommand(AddressOf Chamfer, AddressOf CanChamfer)
+ End If
+ Return m_cmdChamfer
+ End Get
+ End Property
+
+ '''
+ ''' Execute the Chamfer. This method is invoked by the ChamferCommand.
+ '''
+ Public Sub Chamfer(ByVal param As Object)
+ Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.CHAMFER)
+ End Sub
+
+ '''
+ ''' Returns always true.
+ '''
+ Private Function CanChamfer(ByVal param As Object) As Boolean
+ Return True
+ End Function
+
+#End Region ' ChamferCommand
+
#Region "Rectangle2PCommand"
'''
@@ -346,6 +639,36 @@ Namespace EgtCAM5
#End Region ' PolygonCommand
+#Region "PolygonSideCommand"
+
+ '''
+ ''' Returns a command that do PolygonSide.
+ '''
+ Public ReadOnly Property PolygonSideCommand As ICommand
+ Get
+ If m_cmdPolygonSide Is Nothing Then
+ m_cmdPolygonSide = New RelayCommand(AddressOf PolygonSide, AddressOf CanPolygonSide)
+ End If
+ Return m_cmdPolygonSide
+ End Get
+ End Property
+
+ '''
+ ''' Execute the PolygonSide. This method is invoked by the PolygonSideCommand.
+ '''
+ Public Sub PolygonSide(ByVal param As Object)
+ Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.POLYGONSIDE)
+ End Sub
+
+ '''
+ ''' Returns always true.
+ '''
+ Private Function CanPolygonSide(ByVal param As Object) As Boolean
+ Return True
+ End Function
+
+#End Region ' PolygonSideCommand
+
#Region "TextCommand"
'''
@@ -676,6 +999,66 @@ Namespace EgtCAM5
#End Region ' ChangeLayerCommand
+#Region "ChangeAlphaCommand"
+
+ '''
+ ''' Returns a command that do ChangeAlpha.
+ '''
+ Public ReadOnly Property ChangeAlphaCommand As ICommand
+ Get
+ If m_cmdChangeAlpha Is Nothing Then
+ m_cmdChangeAlpha = New RelayCommand(AddressOf ChangeAlpha, AddressOf CanChangeAlpha)
+ End If
+ Return m_cmdChangeAlpha
+ End Get
+ End Property
+
+ '''
+ ''' Execute the ChangeAlpha. This method is invoked by the ChangeAlphaCommand.
+ '''
+ Public Sub ChangeAlpha(ByVal param As Object)
+ Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.CHANGEALPHA)
+ End Sub
+
+ '''
+ ''' Returns always true.
+ '''
+ Private Function CanChangeAlpha(ByVal param As Object) As Boolean
+ Return True
+ End Function
+
+#End Region ' ChangeAlphaCommand
+
+#Region "ResetColorCommand"
+
+ '''
+ ''' Returns a command that do ResetColor.
+ '''
+ Public ReadOnly Property ResetColorCommand As ICommand
+ Get
+ If m_cmdResetColor Is Nothing Then
+ m_cmdResetColor = New RelayCommand(AddressOf ResetColor, AddressOf CanResetColor)
+ End If
+ Return m_cmdResetColor
+ End Get
+ End Property
+
+ '''
+ ''' Execute the ResetColor. This method is invoked by the ResetColorCommand.
+ '''
+ Public Sub ResetColor(ByVal param As Object)
+ Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.RESETCOLOR)
+ End Sub
+
+ '''
+ ''' Returns always true.
+ '''
+ Private Function CanResetColor(ByVal param As Object) As Boolean
+ Return True
+ End Function
+
+#End Region ' ResetColorCommand
+
#Region "ChangeColorCommand"
'''
@@ -694,7 +1077,7 @@ Namespace EgtCAM5
''' Execute the ChangeColor. This method is invoked by the ChangeColorCommand.
'''
Public Sub ChangeColor(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.CHANGECOLOR)
+ Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.CHANGECOLOR)
End Sub
'''
@@ -814,7 +1197,7 @@ Namespace EgtCAM5
''' Execute the BreakCurve. This method is invoked by the BreakCurveCommand.
'''
Public Sub BreakCurve(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.BREAKCURVE)
+ Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.BREAKCURVE)
End Sub
'''
@@ -826,6 +1209,36 @@ Namespace EgtCAM5
#End Region ' BreakCurveCommand
+#Region "SplitCurveCommand"
+
+ '''
+ ''' Returns a command that do SplitCurve.
+ '''
+ Public ReadOnly Property SplitCurveCommand As ICommand
+ Get
+ If m_cmdSplitCurve Is Nothing Then
+ m_cmdSplitCurve = New RelayCommand(AddressOf SplitCurve, AddressOf CanSplitCurve)
+ End If
+ Return m_cmdSplitCurve
+ End Get
+ End Property
+
+ '''
+ ''' Execute the SplitCurve. This method is invoked by the SplitCurveCommand.
+ '''
+ Public Sub SplitCurve(ByVal param As Object)
+ Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.SPLITCURVE)
+ End Sub
+
+ '''
+ ''' Returns always true.
+ '''
+ Private Function CanSplitCurve(ByVal param As Object) As Boolean
+ Return True
+ End Function
+
+#End Region ' SplitCurveCommand
+
#Region "JoinCurveCommand"
'''
@@ -964,7 +1377,7 @@ Namespace EgtCAM5
''' Execute the Rotate. This method is invoked by the RotateCommand.
'''
Public Sub Rotate(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.ROTATE)
+ Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.ROTATE)
End Sub
'''
@@ -976,6 +1389,36 @@ Namespace EgtCAM5
#End Region ' RotateCommand
+#Region "Rotate3DCommand"
+
+ '''
+ ''' Returns a command that do Rotate3D.
+ '''
+ Public ReadOnly Property Rotate3DCommand As ICommand
+ Get
+ If m_cmdRotate3D Is Nothing Then
+ m_cmdRotate3D = New RelayCommand(AddressOf Rotate3D, AddressOf CanRotate3D)
+ End If
+ Return m_cmdRotate3D
+ End Get
+ End Property
+
+ '''
+ ''' Execute the Rotate3D. This method is invoked by the Rotate3DCommand.
+ '''
+ Public Sub Rotate3D(ByVal param As Object)
+ Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.ROTATE3D)
+ End Sub
+
+ '''
+ ''' Returns always true.
+ '''
+ Private Function CanRotate3D(ByVal param As Object) As Boolean
+ Return True
+ End Function
+
+#End Region ' Rotate3DCommand
+
#Region "MirrorCommand"
'''
@@ -994,7 +1437,7 @@ Namespace EgtCAM5
''' Execute the Mirror. This method is invoked by the MirrorCommand.
'''
Public Sub Mirror(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.MIRROR)
+ Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.MIRROR)
End Sub
'''
@@ -1006,6 +1449,36 @@ Namespace EgtCAM5
#End Region ' MirrorCommand
+#Region "Mirror3DCommand"
+
+ '''
+ ''' Returns a command that do Mirror3D.
+ '''
+ Public ReadOnly Property Mirror3DCommand As ICommand
+ Get
+ If m_cmdMirror3D Is Nothing Then
+ m_cmdMirror3D = New RelayCommand(AddressOf Mirror3D, AddressOf CanMirror3D)
+ End If
+ Return m_cmdMirror3D
+ End Get
+ End Property
+
+ '''
+ ''' Execute the Mirror3D. This method is invoked by the Mirror3DCommand.
+ '''
+ Public Sub Mirror3D(ByVal param As Object)
+ Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.MIRROR3D)
+ End Sub
+
+ '''
+ ''' Returns always true.
+ '''
+ Private Function CanMirror3D(ByVal param As Object) As Boolean
+ Return True
+ End Function
+
+#End Region ' Mirror3DCommand
+
#Region "ScaleCommand"
'''
@@ -1024,7 +1497,7 @@ Namespace EgtCAM5
''' Execute the Scale. This method is invoked by the ScaleCommand.
'''
Public Sub Scale(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.SCALE)
+ Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.SCALE)
End Sub
'''
@@ -1036,6 +1509,36 @@ Namespace EgtCAM5
#End Region ' ScaleCommand
+#Region "Scale3DCommand"
+
+ '''
+ ''' Returns a command that do Scale3D.
+ '''
+ Public ReadOnly Property Scale3DCommand As ICommand
+ Get
+ If m_cmdScale3D Is Nothing Then
+ m_cmdScale3D = New RelayCommand(AddressOf Scale3D, AddressOf CanScale3D)
+ End If
+ Return m_cmdScale3D
+ End Get
+ End Property
+
+ '''
+ ''' Execute the Scale3D. This method is invoked by the Scale3DCommand.
+ '''
+ Public Sub Scale3D(ByVal param As Object)
+ Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.SCALE3D)
+ End Sub
+
+ '''
+ ''' Returns always true.
+ '''
+ Private Function CanScale3D(ByVal param As Object) As Boolean
+ Return True
+ End Function
+
+#End Region ' Scale3DCommand
+
#Region "OffsetCommand"
'''
diff --git a/ProjectPage/OptionPanel/DrawOptionPanel/DrawOptionPanelView.xaml b/ProjectPage/OptionPanel/DrawOptionPanel/DrawOptionPanelView.xaml
index cfe00f6..1d2b3e0 100644
--- a/ProjectPage/OptionPanel/DrawOptionPanel/DrawOptionPanelView.xaml
+++ b/ProjectPage/OptionPanel/DrawOptionPanel/DrawOptionPanelView.xaml
@@ -1,6 +1,13 @@
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="200"
+ xmlns:interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity">
+
+
+
+
+
+
@@ -8,11 +15,13 @@
-
+
+
+
diff --git a/ProjectPage/OptionPanel/DrawOptionPanel/DrawOptionPanelViewModel.vb b/ProjectPage/OptionPanel/DrawOptionPanel/DrawOptionPanelViewModel.vb
index 9b060ff..8913ba2 100644
--- a/ProjectPage/OptionPanel/DrawOptionPanel/DrawOptionPanelViewModel.vb
+++ b/ProjectPage/OptionPanel/DrawOptionPanel/DrawOptionPanelViewModel.vb
@@ -19,6 +19,9 @@ Namespace EgtCAM5
EgtZoom(ZM.ALL)
End If
OnPropertyChanged("ManageLayerExpander")
+ OnPropertyChanged("InfoExpander")
+ OnPropertyChanged("InputExpander")
+ OnPropertyChanged("SimulationExpander")
End If
End Set
End Property
@@ -40,9 +43,11 @@ Namespace EgtCAM5
EgtAddMachGroup("Mach01", "CMS-PF122R8RR")
End If
EgtZoom(ZM.ALL)
- Application.Msn.NotifyColleagues(Application.LOADOPERATIONLIST)
End If
OnPropertyChanged("ManageLayerExpander")
+ OnPropertyChanged("InfoExpander")
+ OnPropertyChanged("InputExpander")
+ OnPropertyChanged("SimulationExpander")
End If
End Set
End Property
@@ -63,38 +68,108 @@ Namespace EgtCAM5
m_OperationExpander = New OperationExpanderView
m_OperationExpander.DataContext = New OperationExpanderViewModel
End If
+ Application.Msn.NotifyColleagues(Application.LOADOPERATIONLIST)
Return m_OperationExpander
End If
End Get
End Property
- Private m_InputExpander As InputExpanderView
- Public ReadOnly Property InputExpander As InputExpanderView
+ Private m_OperationPropertyExpander As OperationPropertyExpanderView
+ Private m_InfoExpander As InfoExpanderView
+ Public ReadOnly Property InfoExpander As ContentControl
Get
- If IsNothing(m_InputExpander) Then
- m_InputExpander = New InputExpanderView
- m_InputExpander.DataContext = New InputExpanderViewModel
+ If m_DrawIsChecked Then
+ If IsNothing(m_InfoExpander) Then
+ m_InfoExpander = New InfoExpanderView
+ m_InfoExpander.DataContext = New InfoExpanderViewModel
+ End If
+ Return m_InfoExpander
+ Else
+ If IsNothing(m_OperationPropertyExpander) Then
+ m_OperationPropertyExpander = New OperationPropertyExpanderView
+ m_OperationPropertyExpander.DataContext = New OperationPropertyExpanderViewModel
+ End If
+ Return m_OperationPropertyExpander
End If
- Return m_InputExpander
End Get
End Property
- Private m_InfoExpander As InfoExpanderView
- Public ReadOnly Property InfoExpander As InfoExpanderView
+ Private m_MachiningsTreeExpander As MachiningTreeExpanderView
+ Private m_InputExpander As InputExpanderView
+ Public ReadOnly Property InputExpander As ContentControl
Get
- If IsNothing(m_InfoExpander) Then
- m_InfoExpander = New InfoExpanderView
- m_InfoExpander.DataContext = New InfoExpanderViewModel
+ If m_DrawIsChecked Then
+ If IsNothing(m_InputExpander) Then
+ m_InputExpander = New InputExpanderView
+ m_InputExpander.DataContext = New InputExpanderViewModel
+ End If
+ Return m_InputExpander
+ Else
+ If IsNothing(m_MachiningsTreeExpander) Then
+ m_MachiningsTreeExpander = New MachiningTreeExpanderView
+ m_MachiningsTreeExpander.DataContext = New MachiningTreeExpanderViewModel
+ End If
+ Return m_MachiningsTreeExpander
End If
- Return m_InfoExpander
End Get
End Property
+ Private m_SimulationExpander As SimulationExpanderView
+ Public ReadOnly Property SimulationExpander As ContentControl
+ Get
+ If m_DrawIsChecked Then
+ Return Nothing
+ Else
+ If IsNothing(m_SimulationExpander) Then
+ m_SimulationExpander = New SimulationExpanderView
+ m_SimulationExpander.DataContext = New SimulationExpanderViewModel
+ End If
+ Return m_SimulationExpander
+ End If
+ End Get
+ End Property
+
+ ' Definizione comandi
+ Private m_cmdClosing As ICommand
+
Sub New()
' Inizializzo la selezione della modilità Draw all'apertura del programma
DrawIsChecked = True
End Sub
+#Region "COMMANDS"
+
+#Region "ClosingCommand"
+
+ '''
+ ''' Returns a command that create a new tool.
+ '''
+ Public ReadOnly Property ClosingCommand As ICommand
+ Get
+ If m_cmdClosing Is Nothing Then
+ m_cmdClosing = New RelayCommand(AddressOf Closing, AddressOf CanClosing)
+ End If
+ Return m_cmdClosing
+ End Get
+ End Property
+
+ '''
+ ''' Creata the new tool. This method is invoked by the NewCommand.
+ '''
+ Public Sub Closing(ByVal param As Object)
+ Application.Msn.NotifyColleagues(Application.DRAWOPTIONPANEL_CLOSING)
+ End Sub
+
+ '''
+ ''' Returns true if the selected treeviewitem is valid for new tool creation.
+ '''
+ Private Function CanClosing(ByVal param As Object) As Boolean
+ Return True
+ End Function
+
+#End Region ' ClosingCommand
+
+#End Region ' Commands
End Class
End Namespace
\ No newline at end of file
diff --git a/ProjectPage/OptionPanel/DrawOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderView.xaml b/ProjectPage/OptionPanel/DrawOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderView.xaml
new file mode 100644
index 0000000..331b4eb
--- /dev/null
+++ b/ProjectPage/OptionPanel/DrawOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderView.xaml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
diff --git a/ProjectPage/OptionPanel/DrawOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderView.xaml.vb b/ProjectPage/OptionPanel/DrawOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderView.xaml.vb
new file mode 100644
index 0000000..492f63d
--- /dev/null
+++ b/ProjectPage/OptionPanel/DrawOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderView.xaml.vb
@@ -0,0 +1,3 @@
+Public Class MachiningTreeExpanderView
+
+End Class
diff --git a/ProjectPage/OptionPanel/DrawOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderViewModel.vb b/ProjectPage/OptionPanel/DrawOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderViewModel.vb
new file mode 100644
index 0000000..a39dc21
--- /dev/null
+++ b/ProjectPage/OptionPanel/DrawOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderViewModel.vb
@@ -0,0 +1,7 @@
+Namespace EgtCAM5
+
+ Public Class MachiningTreeExpanderViewModel
+
+ End Class
+
+End Namespace
\ No newline at end of file
diff --git a/ProjectPage/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderView.xaml b/ProjectPage/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderView.xaml
index 3fae2b0..c92100b 100644
--- a/ProjectPage/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderView.xaml
+++ b/ProjectPage/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderView.xaml
@@ -18,7 +18,7 @@
-
diff --git a/ProjectPage/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderViewModel.vb b/ProjectPage/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderViewModel.vb
index e03e48d..1a4392c 100644
--- a/ProjectPage/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderViewModel.vb
+++ b/ProjectPage/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderViewModel.vb
@@ -321,8 +321,8 @@ Namespace EgtCAM5
Else
sText = sTitle + " " + nId.ToString
End If
- Dim CurrColor As Color3d
- EgtGetCalcColor(nGroupId, CurrColor)
+ Dim CurrColor As New Color3d(0, 0, 0, 0)
+ EgtGetColor(nId, CurrColor)
Dim sImage As String = TypeToImageInObjTree(nType, nDepth)
Dim CurrNod As LayerTreeViewItem = New LayerTreeViewItem(nId, sText, sImage, CurrColor)
CurrNodColl.Add(CurrNod)
diff --git a/ProjectPage/OptionPanel/DrawOptionPanel/OperationExpander/OperationExpanderView.xaml b/ProjectPage/OptionPanel/DrawOptionPanel/OperationExpander/OperationExpanderView.xaml
index 7908bdc..e813b4a 100644
--- a/ProjectPage/OptionPanel/DrawOptionPanel/OperationExpander/OperationExpanderView.xaml
+++ b/ProjectPage/OptionPanel/DrawOptionPanel/OperationExpander/OperationExpanderView.xaml
@@ -11,7 +11,8 @@
-
+
diff --git a/ProjectPage/OptionPanel/DrawOptionPanel/OperationExpander/OperationExpanderViewModel.vb b/ProjectPage/OptionPanel/DrawOptionPanel/OperationExpander/OperationExpanderViewModel.vb
index 2a792bc..32c0b1c 100644
--- a/ProjectPage/OptionPanel/DrawOptionPanel/OperationExpander/OperationExpanderViewModel.vb
+++ b/ProjectPage/OptionPanel/DrawOptionPanel/OperationExpander/OperationExpanderViewModel.vb
@@ -143,6 +143,7 @@ Namespace EgtCAM5
#End Region ' Commands
Private Sub LoadOperationList()
+ OperationList.Clear()
Dim Id As Integer
Dim OpName As String = String.Empty
Dim OpType As Integer = 0
diff --git a/ProjectPage/OptionPanel/DrawOptionPanel/OperationPropertyExpander/OperationPropertyExpanderView.xaml b/ProjectPage/OptionPanel/DrawOptionPanel/OperationPropertyExpander/OperationPropertyExpanderView.xaml
new file mode 100644
index 0000000..1919f22
--- /dev/null
+++ b/ProjectPage/OptionPanel/DrawOptionPanel/OperationPropertyExpander/OperationPropertyExpanderView.xaml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
diff --git a/ProjectPage/OptionPanel/DrawOptionPanel/OperationPropertyExpander/OperationPropertyExpanderView.xaml.vb b/ProjectPage/OptionPanel/DrawOptionPanel/OperationPropertyExpander/OperationPropertyExpanderView.xaml.vb
new file mode 100644
index 0000000..0306a33
--- /dev/null
+++ b/ProjectPage/OptionPanel/DrawOptionPanel/OperationPropertyExpander/OperationPropertyExpanderView.xaml.vb
@@ -0,0 +1,3 @@
+Public Class OperationPropertyExpanderView
+
+End Class
diff --git a/ProjectPage/OptionPanel/DrawOptionPanel/OperationPropertyExpander/OperationPropertyExpanderViewModel.vb b/ProjectPage/OptionPanel/DrawOptionPanel/OperationPropertyExpander/OperationPropertyExpanderViewModel.vb
new file mode 100644
index 0000000..29cae7b
--- /dev/null
+++ b/ProjectPage/OptionPanel/DrawOptionPanel/OperationPropertyExpander/OperationPropertyExpanderViewModel.vb
@@ -0,0 +1,7 @@
+Namespace EgtCAM5
+
+ Public Class OperationPropertyExpanderViewModel
+
+ End Class
+
+End Namespace
\ No newline at end of file
diff --git a/ProjectPage/OptionPanel/DrawOptionPanel/SimulationExpander/SimulationExpanderView.xaml b/ProjectPage/OptionPanel/DrawOptionPanel/SimulationExpander/SimulationExpanderView.xaml
new file mode 100644
index 0000000..dbb07f0
--- /dev/null
+++ b/ProjectPage/OptionPanel/DrawOptionPanel/SimulationExpander/SimulationExpanderView.xaml
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ProjectPage/OptionPanel/DrawOptionPanel/SimulationExpander/SimulationExpanderView.xaml.vb b/ProjectPage/OptionPanel/DrawOptionPanel/SimulationExpander/SimulationExpanderView.xaml.vb
new file mode 100644
index 0000000..1e22ed1
--- /dev/null
+++ b/ProjectPage/OptionPanel/DrawOptionPanel/SimulationExpander/SimulationExpanderView.xaml.vb
@@ -0,0 +1,3 @@
+Public Class SimulationExpanderView
+
+End Class
diff --git a/ProjectPage/OptionPanel/DrawOptionPanel/SimulationExpander/SimulationExpanderViewModel.vb b/ProjectPage/OptionPanel/DrawOptionPanel/SimulationExpander/SimulationExpanderViewModel.vb
new file mode 100644
index 0000000..298f96e
--- /dev/null
+++ b/ProjectPage/OptionPanel/DrawOptionPanel/SimulationExpander/SimulationExpanderViewModel.vb
@@ -0,0 +1,611 @@
+Imports EgtUILib
+Namespace EgtCAM5
+
+ Public Class SimulationExpanderViewModel
+ Inherits ViewModelBase
+
+#Region "FIELDS & PROPERTIES"
+
+ 'EGT PROPERTIES
+ ' Stato di visualizzazione della macchina
+ Private m_nMachLook As Integer = MCH_LOOK.ALL
+ ' Utensile corrente
+ Private m_sCurrTool As String = String.Empty
+ ' Stato e comando correnti
+ Public Enum SIM_ST As Integer
+ ST_STOP = 1
+ ST_PLAY = 2
+ ST_STEP = 3
+ ST_PAUSE = 4
+ End Enum
+ Private m_nStatus As Integer = SIM_ST.ST_STOP
+ ' Stato bottone Play
+ Private m_bPlay As Boolean = True
+ ' Coefficiente per valore Slider
+ Private m_SliderX As Double = 1
+
+ 'GRAPHICAL PROPERTIES
+
+ 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
+ If value Then
+ InitializeSimulation()
+ Else
+ CloseSimulation()
+ End If
+ m_IsExpanded = value
+ OnPropertyChanged("IsExpanded")
+ End If
+ End Set
+ End Property
+
+ Private m_L1Name As String
+ Public Property L1Name As String
+ Get
+ Return m_L1Name
+ End Get
+ Set(value As String)
+ If value <> m_L1Name Then
+ m_L1Name = value
+ OnPropertyChanged("L1Name")
+ End If
+ End Set
+ End Property
+
+ Private m_L1Value As String
+ Public Property L1Value As String
+ Get
+ Return m_L1Value
+ End Get
+ Set(value As String)
+ If value <> m_L1Value Then
+ m_L1Value = value
+ OnPropertyChanged("L1Value")
+ End If
+ End Set
+ End Property
+
+ Private m_L2Name As String
+ Public Property L2Name As String
+ Get
+ Return m_L2Name
+ End Get
+ Set(value As String)
+ If value <> m_L2Name Then
+ m_L2Name = value
+ OnPropertyChanged("L2Name")
+ End If
+ End Set
+ End Property
+
+ Private m_L2Value As String
+ Public Property L2Value As String
+ Get
+ Return m_L2Value
+ End Get
+ Set(value As String)
+ If value <> m_L2Value Then
+ m_L2Value = value
+ OnPropertyChanged("L2Value")
+ End If
+ End Set
+ End Property
+
+ Private m_L3Name As String
+ Public Property L3Name As String
+ Get
+ Return m_L3Name
+ End Get
+ Set(value As String)
+ If value <> m_L3Name Then
+ m_L3Name = value
+ OnPropertyChanged("L3Name")
+ End If
+ End Set
+ End Property
+
+ Private m_L3Value As String
+ Public Property L3Value As String
+ Get
+ Return m_L3Value
+ End Get
+ Set(value As String)
+ If value <> m_L2Value Then
+ m_L3Value = value
+ OnPropertyChanged("L3Value")
+ End If
+ End Set
+ End Property
+
+ Private m_R1Name As String
+ Public Property R1Name As String
+ Get
+ Return m_R1Name
+ End Get
+ Set(value As String)
+ If value <> m_R1Name Then
+ m_R1Name = value
+ OnPropertyChanged("R1Name")
+ End If
+ End Set
+ End Property
+
+ Private m_R1Value As String
+ Public Property R1Value As String
+ Get
+ Return m_R1Value
+ End Get
+ Set(value As String)
+ If value <> m_L2Value Then
+ m_R1Value = value
+ OnPropertyChanged("R1Value")
+ End If
+ End Set
+ End Property
+
+ Private m_R2Name As String
+ Public Property R2Name As String
+ Get
+ Return m_R2Name
+ End Get
+ Set(value As String)
+ If value <> m_R2Name Then
+ m_R2Name = value
+ OnPropertyChanged("R2Name")
+ End If
+ End Set
+ End Property
+
+ Private m_R2Value As String
+ Public Property R2Value As String
+ Get
+ Return m_R2Value
+ End Get
+ Set(value As String)
+ If value <> m_L2Value Then
+ m_R2Value = value
+ OnPropertyChanged("R2Value")
+ End If
+ End Set
+ End Property
+
+ Private m_GCode As String
+ Public Property GCode As String
+ Get
+ Return m_GCode
+ End Get
+ Set(value As String)
+ If value <> m_GCode Then
+ m_GCode = value
+ OnPropertyChanged("GCode")
+ End If
+ End Set
+ End Property
+
+ Private m_FValue As String
+ Public Property FValue As String
+ Get
+ Return m_FValue
+ End Get
+ Set(value As String)
+ If value <> m_FValue Then
+ m_FValue = value
+ OnPropertyChanged("FValue")
+ End If
+ End Set
+ End Property
+
+ Private m_TName As String
+ Public Property TName As String
+ Get
+ Return m_TName
+ End Get
+ Set(value As String)
+ If value <> m_TName Then
+ m_TName = value
+ OnPropertyChanged("TName")
+ End If
+ End Set
+ End Property
+
+ Private m_SValue As String
+ Public Property SValue As String
+ Get
+ Return m_SValue
+ End Get
+ Set(value As String)
+ If value <> m_SValue Then
+ m_SValue = value
+ OnPropertyChanged("SValue")
+ End If
+ End Set
+ End Property
+
+ Private m_PlayPauseImage As String
+ Public ReadOnly Property PlayPauseImage As String
+ Get
+ Select Case m_bPlay
+ Case False
+ Return "/Resources/OptionPanel/MachiningOptionPanel/SimulationExpander/Pause.png"
+ Case True
+ Return "/Resources/OptionPanel/MachiningOptionPanel/SimulationExpander/Play.png"
+ Case Else
+ Return ""
+ End Select
+ End Get
+ End Property
+
+ Private m_SliderValue As Double
+ Public Property SliderValue As Double
+ Get
+ Return m_SliderValue
+ End Get
+ Set(value As Double)
+ If value <> m_SliderValue Then
+ m_SliderValue = value
+ EgtSimSetStep(value * m_SliderX)
+ OnPropertyChanged("SliderValue")
+ End If
+ End Set
+ End Property
+
+ ' Definizione comandi
+ Private m_cmdStep As ICommand
+ Private m_cmdPlayPause As ICommand
+ Private m_cmdStop As ICommand
+
+#End Region
+
+#Region "CONSTRUCTOR"
+
+ Sub New()
+ Application.Msn.Register(Application.DRAWOPTIONPANEL_CLOSING, Sub()
+ If IsExpanded Then
+ ResetSimulation()
+ End If
+ End Sub)
+ End Sub
+
+#End Region
+
+#Region "COMMANDS"
+
+#Region "StepCommand"
+
+ '''
+ ''' Returns a command that create a new tool.
+ '''
+ Public ReadOnly Property StepCommand As ICommand
+ Get
+ If m_cmdStep Is Nothing Then
+ m_cmdStep = New RelayCommand(AddressOf StepCmd, AddressOf CanStep)
+ End If
+ Return m_cmdStep
+ End Get
+ End Property
+
+ '''
+ ''' Creata the new tool. This method is invoked by the NewCommand.
+ '''
+ Public Sub StepCmd(ByVal param As Object)
+ 'm_CurrProjPage.ClearMessage()
+ ' Se stato stop, devo avviare simulazione
+ If m_nStatus = SIM_ST.ST_STOP Then
+ m_nStatus = SIM_ST.ST_STEP
+ ExecSim()
+ ' Aggiorno bottone
+ 'SetPlayPauseBtnToPlay()
+ ' Alrimenti imposto solo il nuovo stato
+ Else
+ m_nStatus = SIM_ST.ST_STEP
+ ' Aggiornamenti per bottone Play/Pause
+ 'SetPlayPauseBtnToPause()
+ End If
+ End Sub
+
+ '''
+ ''' Returns true if the selected treeviewitem is valid for new tool creation.
+ '''
+ Private Function CanStep(ByVal param As Object) As Boolean
+ Return True
+ End Function
+
+#End Region ' StepCommand
+
+#Region "PlayPauseCommand"
+
+ '''
+ ''' Returns a command that create a new tool.
+ '''
+ Public ReadOnly Property PlayPauseCommand As ICommand
+ Get
+ If m_cmdPlayPause Is Nothing Then
+ m_cmdPlayPause = New RelayCommand(AddressOf PlayPause, AddressOf CanPlayPause)
+ End If
+ Return m_cmdPlayPause
+ End Get
+ End Property
+
+ '''
+ ''' Creata the new tool. This method is invoked by the NewCommand.
+ '''
+ Public Sub PlayPause(ByVal param As Object)
+ 'm_CurrProjPage.ClearMessage()
+ If m_bPlay Then
+ ' Aggiorno bottone
+ m_bPlay = False
+ OnPropertyChanged("PlayPauseImage")
+ ' Eseguo
+ If m_nStatus = SIM_ST.ST_STOP Then
+ ' Lancio simulazione
+ m_nStatus = SIM_ST.ST_PLAY
+ ExecSim()
+ ' Aggiorno bottone
+ m_bPlay = True
+ OnPropertyChanged("PlayPauseImage")
+ ElseIf m_nStatus = SIM_ST.ST_PAUSE Then
+ m_nStatus = SIM_ST.ST_PLAY
+ End If
+ Else
+ ' Aggiorno bottone
+ m_bPlay = True
+ OnPropertyChanged("PlayPauseImage")
+ ' Se play o step, imposto stato pausa
+ If m_nStatus = SIM_ST.ST_PLAY Or m_nStatus = SIM_ST.ST_STEP Then
+ m_nStatus = SIM_ST.ST_PAUSE
+ End If
+ End If
+ End Sub
+
+ '''
+ ''' Returns true if the selected treeviewitem is valid for new tool creation.
+ '''
+ Private Function CanPlayPause(ByVal param As Object) As Boolean
+ Return True
+ End Function
+
+#End Region ' PlayPauseCommand
+
+#Region "StopCommand"
+
+ '''
+ ''' Returns a command that create a new tool.
+ '''
+ Public ReadOnly Property StopCommand As ICommand
+ Get
+ If m_cmdStop Is Nothing Then
+ m_cmdStop = New RelayCommand(AddressOf StopCmd, AddressOf CanStop)
+ End If
+ Return m_cmdStop
+ End Get
+ End Property
+
+ '''
+ ''' Creata the new tool. This method is invoked by the NewCommand.
+ '''
+ Public Sub StopCmd(ByVal param As Object)
+ 'm_CurrProjPage.ClearMessage()
+ ' Se stato già stop, porto in home
+ If m_nStatus = SIM_ST.ST_STOP Then
+ ' Vado in home
+ EgtSimHome()
+ ' Imposto prima fase
+ EgtSetCurrPhase(1, True)
+ ' Aggiorno visualizzazione
+ EgtDraw()
+ ' Aggiorno dati CNC
+ ShowCncData()
+ End If
+ ' Imposto il nuovo stato
+ m_nStatus = SIM_ST.ST_STOP
+ End Sub
+
+ '''
+ ''' Returns true if the selected treeviewitem is valid for new tool creation.
+ '''
+ Private Function CanStop(ByVal param As Object) As Boolean
+ Return True
+ End Function
+
+#End Region ' StopCommand
+
+#End Region
+
+#Region "METHODS"
+
+ Private Sub InitializeSimulation()
+ ' Imposto prima fase
+ EgtSetCurrPhase(1)
+ ' Costringo ad aggiornare UI
+ UpdateUI()
+ ' Imposto stato corrente
+ m_nStatus = SIM_ST.ST_STOP
+ m_bPlay = True
+ m_SliderX = GetPrivateProfileDouble(S_SIMUL, K_SLIDERX, 1)
+ Dim SliderVal As Double = GetPrivateProfileDouble(S_SIMUL, K_SLIDERVAL, 10)
+ SliderValue = SliderVal
+ ' Porto la testa in home
+ EgtSimStart()
+ EgtSimHome()
+ LoadCurrTools()
+ EgtDraw()
+ ShowCncData()
+ End Sub
+
+ Private Sub CloseSimulation()
+ ' Mi assicuro di terminare la simulazione
+ ResetSimulation()
+ ' Nascondo tutte le lavorazioni
+ 'HideAllMachinings()
+ ' Cancello eventuali messaggi
+ 'm_CurrProjPage.ClearMessage()
+
+ End Sub
+
+ Private Sub ResetSimulation()
+ ' Termino la simulazione
+ m_nStatus = SIM_ST.ST_STOP
+ EgtSimStop()
+ ' Salvo valore dello slider
+ Dim sVal As String = DoubleToString(SliderValue, 1)
+ WritePrivateProfileString(S_SIMUL, K_SLIDERVAL, sVal)
+ ' Torno alla prima fase
+ EgtSetCurrPhase(1, True)
+ ' Ripristino visibilità standard
+ 'EgtSetMachineLook(MCH_LOOK.TAB)
+ End Sub
+
+ Private Sub ExecSim()
+ EgtSimStart()
+ LoadCurrTools()
+ EgtSimSetStep(SliderValue * m_SliderX)
+ While m_nStatus <> SIM_ST.ST_STOP
+ ' Se simulazione in svolgimento
+ If m_nStatus = SIM_ST.ST_PLAY Or m_nStatus = SIM_ST.ST_STEP Then
+ ' Eseguo movimento
+ Dim nMove As Integer
+ Dim bMove As Boolean = EgtSimMove(nMove)
+ ' Se arrivato a fine step e sono in step
+ If bMove Then
+ If m_nStatus = SIM_ST.ST_STEP And nMove = MCH_SIM.END_STEP Then
+ ' Imposto stato Pausa
+ m_nStatus = SIM_ST.ST_PAUSE
+ ' Aggiornamenti per bottone Play/Pause
+ 'SetPlayPauseBtnToPlay()
+ m_bPlay = True
+ OnPropertyChanged("PlayPauseImage")
+ End If
+ ' Se movimento non riuscito
+ Else
+ m_nStatus = SIM_ST.ST_STOP
+ m_bPlay = True
+ OnPropertyChanged("PlayPauseImage")
+ ' Aggiornamenti per bottone Play/Pause
+ 'SetPlayPauseBtnToPlay()
+ 'Select Case nMove
+ ' Case MCH_SIM.END_
+ ' m_CurrProjPage.SetInfoMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 1)) 'Simulazione completata
+ ' Case MCH_SIM.OUTSTROKE
+ ' Dim sInfo As String = String.Empty
+ ' EgtGetOutstrokeInfo(sInfo)
+ ' m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo) 'Extracorsa ...
+ ' Case MCH_SIM.DIR_ERR
+ ' m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 3)) 'Direzione utensile irraggiungibile
+ ' Case Else
+ ' m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 4)) 'Errore
+ 'End Select
+ End If
+ ' Aggiorno stato visualizzazione macchina (dipende anche da utensile)
+ 'UpdateMachView()
+ ' Aggiorno visualizzazione
+ EgtDraw()
+ ' Aggiorno dati CNC
+ ShowCncData()
+ Else
+ ' Per evitare di ciclare rapidissimamente e consumare inutilmente CPU
+ System.Threading.Thread.Sleep(1)
+ End If
+ '' Costringo ad aggiornare UI
+ UpdateUI()
+ End While
+ End Sub
+
+ Private Sub ShowCncData()
+ ' Assi
+ ShowAxisNameVal(0, L1Name, L1Value)
+ ShowAxisNameVal(1, L2Name, L2Value)
+ ShowAxisNameVal(2, L3Name, L3Value)
+ ShowAxisNameVal(3, R1Name, R1Value)
+ ShowAxisNameVal(4, R2Name, R2Value)
+ ' Tipo di movimento e feed
+ ShowMoveTypeFeed()
+ ' Nome utensile e speed
+ ShowToolNameSpeed()
+ End Sub
+
+ Private Function ShowAxisNameVal(ByVal nInd As Integer, ByRef sName As String, ByRef sVal As String) As Boolean
+ Dim sInfo As String = String.Empty
+ Dim dVal As Double = 0
+ If EgtSimGetAxisInfoPos(nInd, sInfo, dVal) Then
+ sName = sInfo
+ sVal = If(nInd < 3, LenToString(dVal, -3), DoubleToString(dVal, -3))
+ Return True
+ Else
+ sName = String.Empty
+ sVal = String.Empty
+ Return False
+ End If
+ End Function
+
+ Private Function ShowMoveTypeFeed() As Boolean
+ Dim nG As Integer = 0
+ Dim dFeed As Double = 0
+ If EgtSimGetMoveInfo(nG, dFeed) Then
+ If nG <> 0 Then
+ GCode = "G" & nG.ToString()
+ FValue = "F" & LenToString(dFeed, 0)
+ Else
+ GCode = "G" & nG.ToString()
+ FValue = ""
+ End If
+ Return True
+ Else
+ GCode = ""
+ FValue = ""
+ Return False
+ End If
+ End Function
+
+ Private Function ShowToolNameSpeed() As Boolean
+ Dim sTool As String = String.Empty
+ Dim dSpeed As Double = 0
+ If EgtSimGetToolInfo(sTool, dSpeed) Then
+ TName = sTool
+ SValue = "S" & DoubleToString(dSpeed, 0)
+ Return True
+ Else
+ TName = ""
+ SValue = ""
+ Return False
+ End If
+ End Function
+
+ Private Function LoadCurrTools() As Boolean
+ '' Imposto la lama corrente
+ 'Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
+ 'If Not EgtLoadTool("H1", 1, sSaw) Then
+ ' Return False
+ 'End If
+ '' Imposto eventuale secondo utensile montato
+ 'If m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL Then
+ ' Dim sTool As String = m_MainWindow.m_CurrentMachine.sCurrDrill
+ ' If String.IsNullOrEmpty(sTool) Then sTool = m_MainWindow.m_CurrentMachine.sCurrMill
+ ' If Not String.IsNullOrEmpty(sTool) AndAlso Not EgtLoadTool("H1", 2, sTool) Then
+ ' Return False
+ ' End If
+ 'End If
+ Return True
+ End Function
+
+ Private Sub UpdateMachView()
+ ' Se cambiato utensile, aggiorno stato visualizzazione macchina
+ Dim sTool As String = String.Empty
+ Dim dSpeed As Double = 0
+ If EgtSimGetToolInfo(sTool, dSpeed) Then
+ If sTool <> m_sCurrTool Then
+ m_sCurrTool = sTool
+ EgtSetMachineLook(m_nMachLook)
+ End If
+ End If
+ End Sub
+
+#End Region
+
+ End Class
+
+End Namespace
\ No newline at end of file
diff --git a/ProjectPage/ProjectViewModel.vb b/ProjectPage/ProjectViewModel.vb
index d0e05b6..0997df0 100644
--- a/ProjectPage/ProjectViewModel.vb
+++ b/ProjectPage/ProjectViewModel.vb
@@ -97,6 +97,7 @@ Namespace EgtCAM5
RegisterControllerCommands()
ManageTopCommandBar()
' Funzione che contiene la registrazione di tutti le funzioni del DrawPanel
+ RegisterGridViewPanelCommands()
RegisterDrawPanelCommands()
' Funzione che contiene la registrazione di tutti i comandi del DrawOptionPanel
RegisterDrawOptionPanelCommands()
@@ -241,7 +242,7 @@ Namespace EgtCAM5
'''
''' Method that manage the visibility of the ProjectPage's Panels
'''
- Sub RegisterDrawPanelCommands()
+ Sub RegisterGridViewPanelCommands()
Application.Msn.Register(Application.WIREFRAME, Sub()
m_ProjectScene.WireFrame()
End Sub)
@@ -346,6 +347,9 @@ Namespace EgtCAM5
Application.Msn.Register(Application.CPLANEOBJ, Sub()
m_Controller.ExecuteCommand(Controller.CMD.GRID_OBJ)
End Sub)
+ End Sub
+
+ Sub RegisterDrawPanelCommands()
Application.Msn.Register(Application.POINT, Sub()
If (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control Then
m_Controller.ExecuteCommand(Controller.CMD.FRAME)
@@ -369,13 +373,6 @@ Namespace EgtCAM5
m_Controller.ExecuteCommand(Controller.CMD.LINEPVL)
End If
End Sub)
- Application.Msn.Register(Application.CIRCLE, Sub()
- If (Keyboard.Modifiers And ModifierKeys.Shift) <> ModifierKeys.Shift Then
- m_Controller.ExecuteCommand(Controller.CMD.CIRCLECP)
- Else
- m_Controller.ExecuteCommand(Controller.CMD.CIRCLECD)
- End If
- End Sub)
Application.Msn.Register(Application.ARCPDP, Sub()
If (Keyboard.Modifiers And ModifierKeys.Shift) <> ModifierKeys.Shift Then
If (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control Then
@@ -387,14 +384,7 @@ Namespace EgtCAM5
m_Controller.ExecuteCommand(Controller.CMD.ARCPVP)
End If
End Sub)
- Application.Msn.Register(Application.FILLET, Sub()
- If (Keyboard.Modifiers And ModifierKeys.Shift) <> ModifierKeys.Shift Then
- m_Controller.ExecuteCommand(Controller.CMD.FILLET)
- Else
- m_Controller.ExecuteCommand(Controller.CMD.CHAMFER)
- End If
- End Sub)
- Application.Msn.Register(Application.POLYGON, Sub()
+ Application.Msn.Register(Application.POLYGON, Sub()
If (Keyboard.Modifiers And ModifierKeys.Shift) <> ModifierKeys.Shift Then
m_Controller.ExecuteCommand(Controller.CMD.POLYGON)
Else
@@ -419,22 +409,6 @@ Namespace EgtCAM5
m_Controller.SetLastInteger(GDB_ID.SEL)
m_Controller.ExecuteCommand(Controller.CMD.DELETE)
End 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
- m_Controller.ExecuteCommand(Controller.CMD.RESETCOLOR)
- Else
- m_Controller.ExecuteCommand(Controller.CMD.CHANGECOLOR)
- End If
- End Sub)
- Application.Msn.Register(Application.BREAKCURVE, Sub()
- If (Keyboard.Modifiers And ModifierKeys.Shift) <> ModifierKeys.Shift Then
- m_Controller.ExecuteCommand(Controller.CMD.BREAKCURVE)
- Else
- m_Controller.ExecuteCommand(Controller.CMD.SPLITCURVE)
- End If
- End Sub)
Application.Msn.Register(Application.JOINCURVE, Sub()
If (Keyboard.Modifiers And ModifierKeys.Shift) <> ModifierKeys.Shift Then
m_Controller.SetLastBoolean(False)
@@ -443,27 +417,6 @@ Namespace EgtCAM5
End If
m_Controller.ExecuteCommand(Controller.CMD.JOINCURVE)
End Sub)
- Application.Msn.Register(Application.ROTATE, Sub()
- If (Keyboard.Modifiers And ModifierKeys.Shift) <> ModifierKeys.Shift Then
- m_Controller.ExecuteCommand(Controller.CMD.ROTATE)
- Else
- m_Controller.ExecuteCommand(Controller.CMD.ROTATE3D)
- End If
- End Sub)
- Application.Msn.Register(Application.MIRROR, Sub()
- If (Keyboard.Modifiers And ModifierKeys.Shift) <> ModifierKeys.Shift Then
- m_Controller.ExecuteCommand(Controller.CMD.MIRROR)
- Else
- m_Controller.ExecuteCommand(Controller.CMD.MIRROR3D)
- End If
- End Sub)
- Application.Msn.Register(Application.SCALE, Sub()
- If (Keyboard.Modifiers And ModifierKeys.Shift) <> ModifierKeys.Shift Then
- m_Controller.ExecuteCommand(Controller.CMD.SCALE)
- Else
- m_Controller.ExecuteCommand(Controller.CMD.SCALE3D)
- End If
- End Sub)
End Sub
Sub RegisterDrawOptionPanelCommands()
diff --git a/Resources/DrawPanel/Chamfer.png b/Resources/DrawPanel/Chamfer.png
new file mode 100644
index 0000000..a10190d
Binary files /dev/null and b/Resources/DrawPanel/Chamfer.png differ
diff --git a/Resources/DrawPanel/ChangeColorAlpha.png b/Resources/DrawPanel/ChangeColorAlpha.png
new file mode 100644
index 0000000..04bb076
Binary files /dev/null and b/Resources/DrawPanel/ChangeColorAlpha.png differ
diff --git a/Resources/DrawPanel/CircleCD.png b/Resources/DrawPanel/CircleCD.png
new file mode 100644
index 0000000..8f0a580
Binary files /dev/null and b/Resources/DrawPanel/CircleCD.png differ
diff --git a/Resources/DrawPanel/CircleCP.png b/Resources/DrawPanel/CircleCP.png
new file mode 100644
index 0000000..c825800
Binary files /dev/null and b/Resources/DrawPanel/CircleCP.png differ
diff --git a/Resources/DrawPanel/Mirror3D.png b/Resources/DrawPanel/Mirror3D.png
new file mode 100644
index 0000000..a169939
Binary files /dev/null and b/Resources/DrawPanel/Mirror3D.png differ
diff --git a/Resources/DrawPanel/PolygonSide.png b/Resources/DrawPanel/PolygonSide.png
new file mode 100644
index 0000000..c90cd4b
Binary files /dev/null and b/Resources/DrawPanel/PolygonSide.png differ
diff --git a/Resources/DrawPanel/RemoveColor.png b/Resources/DrawPanel/RemoveColor.png
new file mode 100644
index 0000000..c3b2850
Binary files /dev/null and b/Resources/DrawPanel/RemoveColor.png differ
diff --git a/Resources/DrawPanel/Rotate3D.png b/Resources/DrawPanel/Rotate3D.png
new file mode 100644
index 0000000..f9d6d3d
Binary files /dev/null and b/Resources/DrawPanel/Rotate3D.png differ
diff --git a/Resources/DrawPanel/Scale3D.png b/Resources/DrawPanel/Scale3D.png
new file mode 100644
index 0000000..08bf3a1
Binary files /dev/null and b/Resources/DrawPanel/Scale3D.png differ
diff --git a/Resources/DrawPanel/SplitCurve.png b/Resources/DrawPanel/SplitCurve.png
new file mode 100644
index 0000000..25386eb
Binary files /dev/null and b/Resources/DrawPanel/SplitCurve.png differ
diff --git a/Resources/OptionPanel/MachiningOptionPanel/SimulationExpander/Pause.png b/Resources/OptionPanel/MachiningOptionPanel/SimulationExpander/Pause.png
new file mode 100644
index 0000000..f7c5176
Binary files /dev/null and b/Resources/OptionPanel/MachiningOptionPanel/SimulationExpander/Pause.png differ
diff --git a/Resources/OptionPanel/MachiningOptionPanel/SimulationExpander/Play.png b/Resources/OptionPanel/MachiningOptionPanel/SimulationExpander/Play.png
new file mode 100644
index 0000000..322e67e
Binary files /dev/null and b/Resources/OptionPanel/MachiningOptionPanel/SimulationExpander/Play.png differ
diff --git a/Resources/OptionPanel/MachiningOptionPanel/SimulationExpander/PlayStep.png b/Resources/OptionPanel/MachiningOptionPanel/SimulationExpander/PlayStep.png
new file mode 100644
index 0000000..60e8c55
Binary files /dev/null and b/Resources/OptionPanel/MachiningOptionPanel/SimulationExpander/PlayStep.png differ
diff --git a/Resources/OptionPanel/MachiningOptionPanel/SimulationExpander/Stop.png b/Resources/OptionPanel/MachiningOptionPanel/SimulationExpander/Stop.png
new file mode 100644
index 0000000..adecf17
Binary files /dev/null and b/Resources/OptionPanel/MachiningOptionPanel/SimulationExpander/Stop.png differ
diff --git a/ToolsDbPage/ToolsDbView.xaml b/ToolsDbPage/ToolsDbView.xaml
index c6302b9..d2bab09 100644
--- a/ToolsDbPage/ToolsDbView.xaml
+++ b/ToolsDbPage/ToolsDbView.xaml
@@ -173,11 +173,11 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-