diff --git a/Application.xaml.vb b/Application.xaml.vb
index 55b5e01..e939894 100644
--- a/Application.xaml.vb
+++ b/Application.xaml.vb
@@ -1,12 +1,19 @@
Imports EgtWPFLib5
Imports EgtCAM5.EgtCAM5
+Imports EgtUILib
Class Application
+ Friend Shared m_UpdateLayerTree As Boolean
+
' Application-level events, such as Startup, Exit, and DispatcherUnhandledException
' can be handled in this file.
Protected Overrides Sub OnStartUp(e As System.Windows.StartupEventArgs)
MyBase.OnStartup(e)
+
+ 'Dim TempCurrentDomain As AppDomain = AppDomain.CurrentDomain
+ 'AddHandler TempCurrentDomain.UnhandledException, AddressOf TempCurrentDomain_UnhandledException
+
ShutdownMode = System.Windows.ShutdownMode.OnMainWindowClose
' Creo la View principale
Dim MainWndView As New MainWindow
@@ -59,22 +66,12 @@ Class Application
Friend Const SHOWCURVEDIR As String = "ShowCurveDir"
' InstrumentPanel messages
- Friend Const SETSTATUSANALYZE As String = "SetStatusAnalyze"
- Friend Const RESETSTATUSANALYZE As String = "ResetStatusAnalyze"
- Friend Const SETSTATUSGETDISTANCE As String = "SetStatusGetDistance"
- Friend Const RESETSTATUSGETDISTANCE As String = "ResetStatusGetDistance"
Friend Const ANALYZE_ISCHECKED As String = "Analyze_IsChecked"
Friend Const GETDISTANCE_ISCHECKED As String = "GetDistance_IsChecked"
' GridViewPanel messages
- Friend Const ZOOMALL As String = "ZoomAll"
Friend Const ZOOMIN As String = "ZoomIn"
Friend Const ZOOMOUT As String = "ZoomOut"
- Friend Const TOPVIEW As String = "TopView"
- Friend Const FRONTVIEW As String = "FrontView"
- Friend Const LEFTVIEW As String = "LeftView"
- Friend Const BACKVIEW As String = "BackView"
- Friend Const RIGHTVIEW As String = "RightView"
Friend Const ISOVIEWSW As String = "IsoViewSW"
Friend Const ISOVIEWSE As String = "IsoViewSE"
Friend Const ISOVIEWNE As String = "IsoViewNE"
@@ -129,8 +126,6 @@ Class Application
Friend Const MIRROR As String = "Mirror"
Friend Const SCALE As String = "Scale"
Friend Const OFFSET As String = "Offset"
- Friend Const GETCURRLAYER As String = "GetCurrLayer"
- Friend Const SETCURRLAYER As String = "SetCurrLayer"
' Controller messages
Friend Const SETLASTBOOLEAN As String = "SetLastBoolean"
@@ -162,6 +157,7 @@ Class Application
Friend Const UPDATEOBJDATAINOBJTREE As String = "UpdateObjDataInObjTree"
Friend Const SETINFOBOX As String = "SetInfoBox"
Friend Const RIGHTCLICKEDLAYERTREEITEM As String = "RightClickedLayerTreeItem"
+ Friend Const ISRIGHTCLICKEDLAYERTREEITEM As String = "IsRightClickedLayerTreeItem"
Friend Const SAVEOBJECT As String = "SaveObject"
Friend Const REMOVEMARKFROMLASTOPERATION As String = "RemoveMarkFromLastOperation"
Friend Const SELECTEDOPERATION As String = "SelectedOperation"
@@ -194,7 +190,6 @@ Class Application
Friend Const UPDATECURRENTMACHINE As String = "UpdateCurrentMachine"
' TopCommandBar
- Friend Const NEWPROJECT As String = "NewProject"
Friend Const OPENPROJECT As String = "OpenProject"
Friend Const SAVEPROJECT As String = "SaveProject"
Friend Const SAVEASPROJECT As String = "SaveAsProject"
@@ -227,4 +222,10 @@ Class Application
#End Region
+ Public Sub TempCurrentDomain_UnhandledException(sender As Object, e As System.Windows.Threading.DispatcherUnhandledExceptionEventArgs) Handles Me.DispatcherUnhandledException
+ EgtOutLog(e.Exception.ToString)
+ m_UpdateLayerTree = True
+ e.Handled = True
+ End Sub
+
End Class
\ No newline at end of file
diff --git a/EgtCAM5.vbproj b/EgtCAM5.vbproj
index b8ec5ad..ec1a5f0 100644
--- a/EgtCAM5.vbproj
+++ b/EgtCAM5.vbproj
@@ -149,6 +149,7 @@
+
diff --git a/EgtCAM5Map.vb b/EgtCAM5Map.vb
new file mode 100644
index 0000000..eb5e436
--- /dev/null
+++ b/EgtCAM5Map.vb
@@ -0,0 +1,67 @@
+Module EgtCAM5Map
+
+#Region "Program ViewModel Map"
+
+ Private m_refMainWindowVM As EgtCAM5.MainWindowViewModel
+ Private m_refStatusBarVM As EgtCAM5.StatusBarViewModel
+ Private m_refTopCommandBarVM As EgtCAM5.TopCommandBarViewModel
+ Private m_refProjectVM As EgtCAM5.ProjectViewModel
+
+#Region "Get"
+
+ Public ReadOnly Property refMainWindowVM As EgtCAM5.MainWindowViewModel
+ Get
+ Return m_refMainWindowVM
+ End Get
+ End Property
+ Public ReadOnly Property refStatusBarVM As EgtCAM5.StatusBarViewModel
+ Get
+ Return m_refStatusBarVM
+ End Get
+ End Property
+ Public ReadOnly Property refTopCommandBarVM As EgtCAM5.TopCommandBarViewModel
+ Get
+ Return m_refTopCommandBarVM
+ End Get
+ End Property
+ Public ReadOnly Property refProjectVM As EgtCAM5.ProjectViewModel
+ Get
+ Return m_refProjectVM
+ End Get
+ End Property
+
+#End Region ' Get
+
+#Region "Set"
+
+ Friend Function SetRefStatusBarVM(StatusBarVM As EgtCAM5.StatusBarViewModel) As Boolean
+ m_refStatusBarVM = StatusBarVM
+ Return Not IsNothing(m_refStatusBarVM)
+ End Function
+ Friend Function SetRefTopCommandBarVM(TopCommandBarVM As EgtCAM5.TopCommandBarViewModel) As Boolean
+ m_refTopCommandBarVM = TopCommandBarVM
+ Return Not IsNothing(m_refTopCommandBarVM)
+ End Function
+ Friend Function SetRefProjectVM(ProjectVM As EgtCAM5.ProjectViewModel) As Boolean
+ m_refProjectVM = ProjectVM
+ Return Not IsNothing(m_refProjectVM)
+ End Function
+
+#End Region ' Set
+
+#Region "Init"
+
+ Friend Function BeginInit(MainWindowVM As EgtCAM5.MainWindowViewModel) As Boolean
+ m_refMainWindowVM = MainWindowVM
+ Return Not IsNothing(m_refMainWindowVM)
+ End Function
+ Friend Function EndInit() As Boolean
+ ' Verifico se tutti i pezzi necessari sono stati caricati
+ Return Not IsNothing(m_refMainWindowVM) AndAlso Not IsNothing(m_refStatusBarVM) AndAlso Not IsNothing(m_refProjectVM) AndAlso Not IsNothing(m_refTopCommandBarVM)
+ End Function
+
+#End Region ' Init
+
+#End Region ' Program ViewModel Map
+
+End Module
diff --git a/EgtCAM5Resources.xaml b/EgtCAM5Resources.xaml
index e3db7e5..3b96797 100644
--- a/EgtCAM5Resources.xaml
+++ b/EgtCAM5Resources.xaml
@@ -722,10 +722,10 @@
-
+ -->
+
@@ -758,7 +804,7 @@
-
+
@@ -768,9 +814,10 @@
-
+
-
+
diff --git a/IniFile.vb b/IniFile.vb
index e98d516..aa81080 100644
--- a/IniFile.vb
+++ b/IniFile.vb
@@ -95,6 +95,8 @@ Public Module IniFile
Friend m_bMachiningGroup As Boolean
' Variabile che indica se il programma e' riuscito ad avviarsi
Friend m_bFailedRun As Boolean
+ ' Variabile che contiene il vettore di traslazione dei pezzi nel passaggio da modalità diegna a lavora
+ Friend m_vtMachPartsPos As New Vector3d(Vector3d.NULL)
Public Function GetPrivateProfileInt(IpAppName As String, IpKeyName As String, nDefault As Integer) As Integer
Return EgtUILib.GetPrivateProfileInt(IpAppName, IpKeyName, nDefault, m_sIniFile)
diff --git a/MainWindow/MainWindowViewModel.vb b/MainWindow/MainWindowViewModel.vb
index cc6596e..42b9c8d 100644
--- a/MainWindow/MainWindowViewModel.vb
+++ b/MainWindow/MainWindowViewModel.vb
@@ -105,6 +105,8 @@ Namespace EgtCAM5
#Region "CONSTRUCTOR"
Sub New()
+ ' Inizializzo EgtCAM5Map
+ EgtCAM5Map.BeginInit(Me)
' INITIALIZE EGALTECH ENVIRONMENT
InitializeEgtEnvironment()
diff --git a/ProjectPage/DrawPanel/DrawPanelViewModel.vb b/ProjectPage/DrawPanel/DrawPanelViewModel.vb
index 3c91fb3..a81128d 100644
--- a/ProjectPage/DrawPanel/DrawPanelViewModel.vb
+++ b/ProjectPage/DrawPanel/DrawPanelViewModel.vb
@@ -262,9 +262,6 @@ Namespace EgtCAM5
#End Region ' ToolTip
- ' Definizione layer corrente
- Private m_CurrentLayer As Integer
-
' Proprietà che permettono di aprire e chiudere gli expander
Private m_Draw2DIsExpanded As Boolean
Public Property Draw2DIsExpanded As Boolean
@@ -404,10 +401,6 @@ Namespace EgtCAM5
WritePrivateProfileString(S_GENERAL, K_TRANSFORM, If(m_TransformIsExpanded, "1", "0"))
End If
End Sub)
-
- Application.Msn.Register(Application.SETCURRLAYER, Sub(CurrLayer As Integer)
- m_CurrentLayer = CurrLayer
- End Sub)
End Sub
#End Region ' Constructor
@@ -432,7 +425,13 @@ Namespace EgtCAM5
''' Execute the Point. This method is invoked by the PointCommand.
'''
Public Sub Point(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.POINT)
+ If (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control Then
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.FRAME)
+ ElseIf (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.VECTOR)
+ Else
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.POINT)
+ End If
End Sub
#End Region ' PointCommand
@@ -455,10 +454,13 @@ Namespace EgtCAM5
''' Execute the Line2P. This method is invoked by the Line2PCommand.
'''
Public Sub Line2P(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.LINE2P)
+ If (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control Then
+ EgtCAM5Map.refProjectVM.GetController.SetContinue()
+ 'EmitStripStatusOutput(EgtMsg(399)) ' Continue : 'L' with line, 'A' with arc
+ End If
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.LINE2P)
End Sub
-
#End Region ' Line2PCommand
#Region "LinePDLCommand"
@@ -479,7 +481,11 @@ Namespace EgtCAM5
''' Execute the LinePDL. This method is invoked by the LinePDLCommand.
'''
Public Sub LinePDL(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.LINEPDL)
+ If (Keyboard.Modifiers And ModifierKeys.Shift) <> ModifierKeys.Shift Then
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.LINEPDL)
+ Else
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.LINEPVL)
+ End If
End Sub
#End Region ' LinePDLCommand
@@ -502,7 +508,7 @@ Namespace EgtCAM5
''' Execute the CircleCP. This method is invoked by the CircleCPCommand.
'''
Public Sub CircleCP(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.CIRCLECP)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.CIRCLECP)
End Sub
#End Region ' CircleCPCommand
@@ -525,7 +531,7 @@ Namespace EgtCAM5
''' 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)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.CIRCLECD)
End Sub
#End Region ' CircleCDCommand
@@ -548,7 +554,7 @@ Namespace EgtCAM5
''' Execute the ArcCSE. This method is invoked by the ArcCSECommand.
'''
Public Sub ArcCSE(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.ARCCSE)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.ARCCSE)
End Sub
#End Region ' ArcCSECommand
@@ -571,7 +577,7 @@ Namespace EgtCAM5
''' Execute the Arc3P. This method is invoked by the Arc3PCommand.
'''
Public Sub Arc3P(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.ARC3P)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.ARC3P)
End Sub
#End Region ' Arc3PCommand
@@ -594,7 +600,15 @@ Namespace EgtCAM5
''' Execute the ArcPDP. This method is invoked by the ArcPDPCommand.
'''
Public Sub ArcPDP(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.ARCPDP)
+ If (Keyboard.Modifiers And ModifierKeys.Shift) <> ModifierKeys.Shift Then
+ If (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control Then
+ EgtCAM5Map.refProjectVM.GetController.SetContinue()
+ 'EmitStripStatusOutput(EgtMsg(399)) ' Continue : 'L' with line, 'A' with arc
+ End If
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.ARCPDP)
+ Else
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.ARCPVP)
+ End If
End Sub
#End Region ' ArcPDPCommand
@@ -617,7 +631,7 @@ Namespace EgtCAM5
''' Execute the Fillet. This method is invoked by the FilletCommand.
'''
Public Sub Fillet(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.FILLET)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.FILLET)
End Sub
#End Region ' FilletCommand
@@ -640,7 +654,7 @@ Namespace EgtCAM5
''' 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)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.CHAMFER)
End Sub
#End Region ' ChamferCommand
@@ -663,7 +677,7 @@ Namespace EgtCAM5
''' Execute the Rectangle2P. This method is invoked by the Rectangle2PCommand.
'''
Public Sub Rectangle2P(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.RECTANGLE2P)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.RECTANGLE2P)
End Sub
#End Region ' Rectangle2PCommand
@@ -686,7 +700,7 @@ Namespace EgtCAM5
''' Execute the Polygon. This method is invoked by the PolygonCommand.
'''
Public Sub Polygon(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.POLYGON)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.POLYGON)
End Sub
#End Region ' PolygonCommand
@@ -709,7 +723,7 @@ Namespace EgtCAM5
''' 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)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.POLYGONSIDE)
End Sub
#End Region ' PolygonSideCommand
@@ -732,7 +746,11 @@ Namespace EgtCAM5
''' Execute the Text. This method is invoked by the TextCommand.
'''
Public Sub Text(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.TEXT)
+ If (Keyboard.Modifiers And ModifierKeys.Shift) <> ModifierKeys.Shift Then
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.TEXT)
+ Else
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.TEXTPLUS)
+ End If
End Sub
#End Region ' TextCommand
@@ -755,7 +773,11 @@ Namespace EgtCAM5
''' Execute the Plane. This method is invoked by the PlaneCommand.
'''
Public Sub Plane(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.PLANE)
+ If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.REGION)
+ Else
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.PLANE)
+ End If
End Sub
#End Region ' PlaneCommand
@@ -778,7 +800,7 @@ Namespace EgtCAM5
''' Execute the Extrude. This method is invoked by the ExtrudeCommand.
'''
Public Sub Extrude(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.EXTRUDE)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.EXTRUDE)
End Sub
#End Region ' ExtrudeCommand
@@ -801,7 +823,7 @@ Namespace EgtCAM5
''' Execute the Revolve. This method is invoked by the RevolveCommand.
'''
Public Sub Revolve(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.REVOLVE)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.REVOLVE)
End Sub
#End Region ' RevolveCommand
@@ -824,7 +846,7 @@ Namespace EgtCAM5
''' Execute the Screw. This method is invoked by the ScrewCommand.
'''
Public Sub Screw(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.SCREW)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.SCREW)
End Sub
#End Region ' ScrewCommand
@@ -847,7 +869,7 @@ Namespace EgtCAM5
''' Execute the Ruled. This method is invoked by the RuledCommand.
'''
Public Sub Ruled(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.RULED)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.RULED)
End Sub
#End Region ' RuledCommand
@@ -870,7 +892,7 @@ Namespace EgtCAM5
''' Execute the MergeSurf. This method is invoked by the MergeSurfCommand.
'''
Public Sub MergeSurf(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.MERGESURF)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.MERGESURF)
End Sub
#End Region ' MergeSurfCommand
@@ -893,7 +915,7 @@ Namespace EgtCAM5
''' Execute the ExplodeSurf. This method is invoked by the ExplodeSurfCommand.
'''
Public Sub ExplodeSurf(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.EXPLODESURF)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.EXPLODESURF)
End Sub
#End Region ' ExplodeSurfCommand
@@ -916,7 +938,7 @@ Namespace EgtCAM5
''' Execute the InvertSurf. This method is invoked by the InvertSurfCommand.
'''
Public Sub InvertSurf(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.INVERTSURF)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.INVERTSURF)
End Sub
#End Region ' InvertSurfCommand
@@ -939,7 +961,8 @@ Namespace EgtCAM5
''' Execute the Delete. This method is invoked by the DeleteCommand.
'''
Public Sub Delete(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.DELETE)
+ EgtCAM5Map.refProjectVM.GetController.SetLastInteger(GDB_ID.SEL)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.DELETE)
End Sub
#End Region ' DeleteCommand
@@ -963,9 +986,9 @@ Namespace EgtCAM5
'''
Public Sub ChangeLayer(ByVal param As Object)
If (Keyboard.Modifiers And ModifierKeys.Shift) <> ModifierKeys.Shift Then
- Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.CHANGELAYERGLOB)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.CHANGELAYERGLOB)
Else
- Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.CHANGELAYER)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.CHANGELAYER)
End If
End Sub
@@ -989,7 +1012,7 @@ Namespace EgtCAM5
''' 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)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.CHANGEALPHA)
End Sub
#End Region ' ChangeAlphaCommand
@@ -1012,7 +1035,7 @@ Namespace EgtCAM5
''' 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)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.RESETCOLOR)
End Sub
#End Region ' ResetColorCommand
@@ -1035,7 +1058,7 @@ Namespace EgtCAM5
''' Execute the ChangeColor. This method is invoked by the ChangeColorCommand.
'''
Public Sub ChangeColor(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.CHANGECOLOR)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.CHANGECOLOR)
End Sub
#End Region ' ChangeColorCommand
@@ -1058,7 +1081,7 @@ Namespace EgtCAM5
''' Execute the InvertCurve. This method is invoked by the InvertCurveCommand.
'''
Public Sub InvertCurve(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.INVERTCURVE)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.INVERTCURVE)
End Sub
#End Region ' InvertCurveCommand
@@ -1081,7 +1104,7 @@ Namespace EgtCAM5
''' Execute the ChangeStartCurve. This method is invoked by the InvertCurveCommand.
'''
Public Sub ChangeStartCurve(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.CHANGESTARTCURVE)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.CHANGESTARTCURVE)
End Sub
#End Region ' ChangeStartCurveCommand
@@ -1104,7 +1127,7 @@ Namespace EgtCAM5
''' Execute the ExtendCurve. This method is invoked by the ExtendCurveCommand.
'''
Public Sub ExtendCurve(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.TRIMEXTENDCURVE)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.TRIMEXTENDCURVE)
End Sub
#End Region ' ExtendCurveCommand
@@ -1127,7 +1150,7 @@ Namespace EgtCAM5
''' Execute the BreakCurve. This method is invoked by the BreakCurveCommand.
'''
Public Sub BreakCurve(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.BREAKCURVE)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.BREAKCURVE)
End Sub
#End Region ' BreakCurveCommand
@@ -1150,7 +1173,7 @@ Namespace EgtCAM5
''' 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)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.SPLITCURVE)
End Sub
#End Region ' SplitCurveCommand
@@ -1173,7 +1196,12 @@ Namespace EgtCAM5
''' Execute the JoinCurve. This method is invoked by the JoinCurveCommand.
'''
Public Sub JoinCurve(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.JOINCURVE)
+ If (Keyboard.Modifiers And ModifierKeys.Shift) <> ModifierKeys.Shift Then
+ EgtCAM5Map.refProjectVM.GetController.SetLastBoolean(False)
+ Else
+ EgtCAM5Map.refProjectVM.GetController.SetLastBoolean(True)
+ End If
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.JOINCURVE)
End Sub
#End Region ' JoinCurveCommand
@@ -1196,7 +1224,7 @@ Namespace EgtCAM5
''' Execute the ExplodeCurve. This method is invoked by the ExplodeCurveCommand.
'''
Public Sub ExplodeCurve(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.EXPLODECURVE)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.EXPLODECURVE)
End Sub
#End Region ' ExplodeCurveCommand
@@ -1219,7 +1247,7 @@ Namespace EgtCAM5
''' Execute the SetCurveTh. This method is invoked by the SetCurveThCommand.
'''
Public Sub SetCurveTh(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.SETCURVETHICKNESS)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.SETCURVETHICKNESS)
End Sub
#End Region ' SetCurveThCommand
@@ -1242,7 +1270,7 @@ Namespace EgtCAM5
''' Execute the Move. This method is invoked by the MoveCommand.
'''
Public Sub Move(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.MOVE)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.MOVE)
End Sub
#End Region ' MoveCommand
@@ -1265,7 +1293,7 @@ Namespace EgtCAM5
''' Execute the Rotate. This method is invoked by the RotateCommand.
'''
Public Sub Rotate(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.ROTATE)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.ROTATE)
End Sub
#End Region ' RotateCommand
@@ -1288,7 +1316,7 @@ Namespace EgtCAM5
''' 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)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.ROTATE3D)
End Sub
#End Region ' Rotate3DCommand
@@ -1311,7 +1339,7 @@ Namespace EgtCAM5
''' Execute the Mirror. This method is invoked by the MirrorCommand.
'''
Public Sub Mirror(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.MIRROR)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.MIRROR)
End Sub
#End Region ' MirrorCommand
@@ -1334,7 +1362,7 @@ Namespace EgtCAM5
''' 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)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.MIRROR3D)
End Sub
#End Region ' Mirror3DCommand
@@ -1357,7 +1385,7 @@ Namespace EgtCAM5
''' Execute the Scale. This method is invoked by the ScaleCommand.
'''
Public Sub Scale(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.SCALE)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.SCALE)
End Sub
#End Region ' ScaleCommand
@@ -1380,7 +1408,7 @@ Namespace EgtCAM5
''' 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)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.SCALE3D)
End Sub
#End Region ' Scale3DCommand
@@ -1403,7 +1431,7 @@ Namespace EgtCAM5
''' Execute the Offset. This method is invoked by the OffsetCommand.
'''
Public Sub Offset(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.OFFSET)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.OFFSET)
End Sub
#End Region ' OffsetCommand
@@ -1412,12 +1440,16 @@ Namespace EgtCAM5
Private Sub OnIdle()
If IniFile.m_ProjectMode = ProjectModeOpt.DRAW OrElse IniFile.m_ProjectMode = ProjectModeOpt.ONLYDRAW Then
- Application.Msn.NotifyColleagues(Application.GETCURRLAYER)
- bLayerOk = m_CurrentLayer <> GDB_ID.NULL
+ bLayerOk = EgtCAM5Map.refProjectVM.GetController.GetCurrLayer <> GDB_ID.NULL
If Not IniFile.m_ProjectSceneContext = 0 Then
bSelOk = EgtGetFirstSelectedObj() <> GDB_ID.NULL
bLayerOkAndSelOk = m_bLayerOk And m_bSelOk
End If
+
+ If Application.m_UpdateLayerTree Then
+ Application.Msn.NotifyColleagues(Application.LOADOBJTREE)
+ Application.m_UpdateLayerTree = False
+ End If
End If
End Sub
diff --git a/ProjectPage/GridPanel/GridPanelViewModel.vb b/ProjectPage/GridPanel/GridPanelViewModel.vb
index 8085a9a..093e28b 100644
--- a/ProjectPage/GridPanel/GridPanelViewModel.vb
+++ b/ProjectPage/GridPanel/GridPanelViewModel.vb
@@ -89,7 +89,8 @@ Namespace EgtCAM5
''' Execute the CPlaneTop. This method is invoked by the CPlaneTopCommand.
'''
Public Sub CPlaneTop(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.CPLANETOP)
+ EgtCAM5Map.refProjectVM.GetController.SetLastInteger(Controller.GRID_TYPE.TOP)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.GRID)
End Sub
#End Region ' CPlaneTopCommand
@@ -112,7 +113,8 @@ Namespace EgtCAM5
''' Execute the CPlaneFront. This method is invoked by the CPlaneFrontCommand.
'''
Public Sub CPlaneFront(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.CPLANEFRONT)
+ EgtCAM5Map.refProjectVM.GetController.SetLastInteger(Controller.GRID_TYPE.FRONT)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.GRID)
End Sub
#End Region ' CPlaneFrontCommand
@@ -135,7 +137,8 @@ Namespace EgtCAM5
''' Execute the CPlaneRight. This method is invoked by the CPlaneRightCommand.
'''
Public Sub CPlaneRight(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.CPLANERIGHT)
+ EgtCAM5Map.refProjectVM.GetController.SetLastInteger(Controller.GRID_TYPE.RIGHT)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.GRID)
End Sub
#End Region ' CPlaneRightCommand
@@ -158,7 +161,8 @@ Namespace EgtCAM5
''' Execute the CPlaneBack. This method is invoked by the CPlaneBackCommand.
'''
Public Sub CPlaneBack(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.CPLANEBACK)
+ EgtCAM5Map.refProjectVM.GetController.SetLastInteger(Controller.GRID_TYPE.BACK)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.GRID)
End Sub
#End Region ' CPlaneBackCommand
@@ -181,7 +185,8 @@ Namespace EgtCAM5
''' Execute the CPlaneLeft. This method is invoked by the CPlaneLeftCommand.
'''
Public Sub CPlaneLeft(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.CPLANELEFT)
+ EgtCAM5Map.refProjectVM.GetController.SetLastInteger(Controller.GRID_TYPE.LEFT)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.GRID)
End Sub
#End Region ' CPlaneLeftCommand
@@ -204,34 +209,12 @@ Namespace EgtCAM5
''' Execute the CPlaneBottom. This method is invoked by the CPlaneBottomCommand.
'''
Public Sub CPlaneBottom(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.CPLANEBOTTOM)
+ EgtCAM5Map.refProjectVM.GetController.SetLastInteger(Controller.GRID_TYPE.BOTTOM)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.GRID)
End Sub
#End Region ' CPlaneBottomCommand
-#Region "CPlaneViewCommand"
-
- '''
- ''' Returns a command that do CPlaneView.
- '''
- Public ReadOnly Property CPlaneViewCommand As ICommand
- Get
- If m_cmdCPlaneView Is Nothing Then
- m_cmdCPlaneView = New RelayCommand(AddressOf CPlaneView)
- End If
- Return m_cmdCPlaneView
- End Get
- End Property
-
- '''
- ''' Execute the CPlaneView. This method is invoked by the CPlaneViewCommand.
- '''
- Public Sub CPlaneView(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.CPLANEVIEW)
- End Sub
-
-#End Region ' CPlaneViewCommand
-
#Region "CPlaneElevationCommand"
'''
@@ -250,7 +233,7 @@ Namespace EgtCAM5
''' Execute the CPlaneElevation. This method is invoked by the CPlaneElevationCommand.
'''
Public Sub CPlaneElevation(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.CPLANEELEVATION)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.GRID_ELEVATION)
End Sub
#End Region ' CPlaneElevationCommand
@@ -273,103 +256,11 @@ Namespace EgtCAM5
''' Execute the CPlaneOrigin. This method is invoked by the CPlaneOriginCommand.
'''
Public Sub CPlaneOrigin(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.CPLANEORIGIN)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.GRID_ORIGIN)
End Sub
#End Region ' CPlaneOriginCommand
-#Region "CPlaneRotateCommand"
-
- '''
- ''' Returns a command that do CPlaneRotate.
- '''
- Public ReadOnly Property CPlaneRotateCommand As ICommand
- Get
- If m_cmdCPlaneRotate Is Nothing Then
- m_cmdCPlaneRotate = New RelayCommand(AddressOf CPlaneRotate)
- End If
- Return m_cmdCPlaneRotate
- End Get
- End Property
-
- '''
- ''' Execute the CPlaneRotate. This method is invoked by the CPlaneRotateCommand.
- '''
- Public Sub CPlaneRotate(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.CPLANEROTATE)
- End Sub
-
-#End Region ' CPlaneRotateCommand
-
-#Region "CPlane3PCommand"
-
- '''
- ''' Returns a command that do CPlane3P.
- '''
- Public ReadOnly Property CPlane3PCommand As ICommand
- Get
- If m_cmdCPlane3P Is Nothing Then
- m_cmdCPlane3P = New RelayCommand(AddressOf CPlane3P)
- End If
- Return m_cmdCPlane3P
- End Get
- End Property
-
- '''
- ''' Execute the CPlane3P. This method is invoked by the CPlane3PCommand.
- '''
- Public Sub CPlane3P(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.CPLANE3P)
- End Sub
-
-#End Region ' CPlane3PCommand
-
-#Region "CPlanePerpObjCommand"
-
- '''
- ''' Returns a command that do CPlanePerpObj.
- '''
- Public ReadOnly Property CPlanePerpObjCommand As ICommand
- Get
- If m_cmdCPlanePerpObj Is Nothing Then
- m_cmdCPlanePerpObj = New RelayCommand(AddressOf CPlanePerpObj)
- End If
- Return m_cmdCPlanePerpObj
- End Get
- End Property
-
- '''
- ''' Execute the CPlanePerpObj. This method is invoked by the CPlanePerpObjCommand.
- '''
- Public Sub CPlanePerpObj(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.CPLANEPERPOBJ)
- End Sub
-
-#End Region ' CPlanePerpObjCommand
-
-#Region "CPlaneObjCommand"
-
- '''
- ''' Returns a command that do CPlanepObj.
- '''
- Public ReadOnly Property CPlaneObjCommand As ICommand
- Get
- If m_cmdCPlaneObj Is Nothing Then
- m_cmdCPlaneObj = New RelayCommand(AddressOf CPlaneObj)
- End If
- Return m_cmdCPlaneObj
- End Get
- End Property
-
- '''
- ''' Execute the CPlaneObj. This method is invoked by the CPlaneObjCommand.
- '''
- Public Sub CPlaneObj(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.CPLANEOBJ)
- End Sub
-
-#End Region ' CPlaneObjCommand
-
#End Region ' COMMANDS
End Class
diff --git a/ProjectPage/InstrumentPanel/InstrumentPanelView.xaml b/ProjectPage/InstrumentPanel/InstrumentPanelView.xaml
index b5f3fb0..b8711bf 100644
--- a/ProjectPage/InstrumentPanel/InstrumentPanelView.xaml
+++ b/ProjectPage/InstrumentPanel/InstrumentPanelView.xaml
@@ -1,14 +1,17 @@
-
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
+ IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False"
+ TitleBarOrientation="Horizontal">
-
+
-
+
-
+
diff --git a/ProjectPage/InstrumentPanel/InstrumentPanelViewModel.vb b/ProjectPage/InstrumentPanel/InstrumentPanelViewModel.vb
index b4a001b..15a8b2e 100644
--- a/ProjectPage/InstrumentPanel/InstrumentPanelViewModel.vb
+++ b/ProjectPage/InstrumentPanel/InstrumentPanelViewModel.vb
@@ -32,9 +32,10 @@ Namespace EgtCAM5
m_AnalyzeIsChecked = value
GetDistIsChecked = False
If value Then
- Application.Msn.NotifyColleagues(Application.SETSTATUSANALYZE)
+ EgtCAM5Map.refProjectVM.GetScene.SetStatusAnalyze()
Else
- Application.Msn.NotifyColleagues(Application.RESETSTATUSANALYZE)
+ EgtCAM5Map.refProjectVM.GetScene.ResetStatusAnalyze()
+ Application.Msn.NotifyColleagues(Application.SELECTIDINOBJTREE, GDB_ID.NULL)
End If
OnPropertyChanged("GetDistIsChecked")
OnPropertyChanged("AnalyzeIsChecked")
@@ -66,9 +67,10 @@ Namespace EgtCAM5
m_GetDistIsChecked = value
AnalyzeIsChecked = False
If value Then
- Application.Msn.NotifyColleagues(Application.SETSTATUSGETDISTANCE)
+ EgtCAM5Map.refProjectVM.GetScene.SetStatusGetDistance()
Else
- Application.Msn.NotifyColleagues(Application.RESETSTATUSGETDISTANCE)
+ EgtCAM5Map.refProjectVM.GetScene.ResetStatusGetDistance()
+ Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSOUTPUT, String.Empty)
End If
OnPropertyChanged("GetDistIsChecked")
OnPropertyChanged("AnalyzeIsChecked")
diff --git a/ProjectPage/MachGroupPanel/MachGroupPanelView.xaml b/ProjectPage/MachGroupPanel/MachGroupPanelView.xaml
index 1861363..94f042e 100644
--- a/ProjectPage/MachGroupPanel/MachGroupPanelView.xaml
+++ b/ProjectPage/MachGroupPanel/MachGroupPanelView.xaml
@@ -1,8 +1,14 @@
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5">
-
+
+
+
+
+
+
@@ -43,10 +49,10 @@
+ Margin="3,0,5,0" Command="{Binding AddMachGroupCommand}" Grid.Column="1"/>
+ Margin="0,0,5,0" Command="{Binding RemoveMachGroupCommand}" Grid.Column="2"/>
-
+
diff --git a/ProjectPage/MachGroupPanel/MachGroupPanelViewModel.vb b/ProjectPage/MachGroupPanel/MachGroupPanelViewModel.vb
index e95c905..cec58f3 100644
--- a/ProjectPage/MachGroupPanel/MachGroupPanelViewModel.vb
+++ b/ProjectPage/MachGroupPanel/MachGroupPanelViewModel.vb
@@ -52,6 +52,9 @@ Namespace EgtCAM5
#Region "METHODS"
Private Sub InitializeMachGroups()
+ ' calcolo bbox di tutti i pezzi disegnati
+ 'Dim bboxAllParts As New BBox3d
+ 'CalculateAllPartsBbox(bboxAllParts)
Dim bOk As Boolean
Dim nId = EgtGetFirstMachGroup()
If nId <> GDB_ID.NULL Then
@@ -59,11 +62,46 @@ Namespace EgtCAM5
Else
bOk = AddNewMachGroup()
End If
- LoadMachGroups()
- SelectedMachGroup = MachGroupList(0)
+ If bOk Then
+ 'CalculatePartsTranslationVt(bboxAllParts)
+ 'TraslateParts()
+ LoadMachGroups()
+ SelectedMachGroup = MachGroupList(0)
+ End If
Application.Msn.NotifyColleagues(Application.MACHGROUPSRESULT, bOk)
End Sub
+ Private Sub CalculateAllPartsBbox(ByRef bboxAllParts As BBox3d)
+ Dim nPart As Integer = EgtGetFirstPart()
+ While nPart <> GDB_ID.NULL
+ Dim bboxPart As New BBox3d
+ EgtGetBBoxGlob(nPart, GDB_BB.STANDARD, bboxPart)
+ bboxAllParts.Add(bboxPart)
+ nPart = EgtGetNextPart(nPart)
+ End While
+ End Sub
+
+ Private Sub CalculatePartsTranslationVt(bboxAllParts As BBox3d)
+ ' recupero area della tavola
+ Dim ptTableMin As Point3d
+ Dim ptTableMax As Point3d
+ Dim X = EgtGetTableArea(1, ptTableMin, ptTableMax)
+ IniFile.m_vtMachPartsPos = (New Point3d(ptTableMin.x, ptTableMin.y - 250, ptTableMin.z) - New Point3d(bboxAllParts.Min.x, bboxAllParts.Max.y, bboxAllParts.Min.z))
+ End Sub
+
+ Private Sub TraslateParts()
+ Dim nPart As Integer = EgtGetFirstPart()
+ While nPart <> GDB_ID.NULL
+ EgtMove(nPart, IniFile.m_vtMachPartsPos)
+ nPart = EgtGetNextPart(nPart)
+ End While
+ nPart = EgtGetFirstGhostPart()
+ While nPart <> GDB_ID.NULL
+ EgtMove(nPart, IniFile.m_vtMachPartsPos)
+ nPart = EgtGetNextGhostPart(nPart)
+ End While
+ End Sub
+
Private Sub LoadMachGroups()
' Pulisco la lista
MachGroupList.Clear()
diff --git a/ProjectPage/OptionPanel/DrawOptionPanel/ManageLayerExpander/LayerTreeView.vb b/ProjectPage/OptionPanel/DrawOptionPanel/ManageLayerExpander/LayerTreeView.vb
index 5480379..89fcdef 100644
--- a/ProjectPage/OptionPanel/DrawOptionPanel/ManageLayerExpander/LayerTreeView.vb
+++ b/ProjectPage/OptionPanel/DrawOptionPanel/ManageLayerExpander/LayerTreeView.vb
@@ -26,6 +26,7 @@ Public Class LayerTreeViewItem
m_IsSelected = value
If value Then
' recupero l'Id del nuovo oggetto selezionato
+ Application.Msn.NotifyColleagues(Application.ISRIGHTCLICKEDLAYERTREEITEM, False)
If m_MarkOnSel Then
Application.Msn.NotifyColleagues(Application.UPDATEOBJINOBJTREE, Me.Id)
Else
@@ -47,6 +48,7 @@ Public Class LayerTreeViewItem
Set(value As Boolean)
' In realtà il valore di value è insignificante perchè la cosa importante è che il click esegua questo Set
m_IsRightSelected = value
+ Application.Msn.NotifyColleagues(Application.ISRIGHTCLICKEDLAYERTREEITEM, True)
Application.Msn.NotifyColleagues(Application.RIGHTCLICKEDLAYERTREEITEM, Me.Id)
End Set
End Property
diff --git a/ProjectPage/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderViewModel.vb b/ProjectPage/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderViewModel.vb
index ed3fb91..49d199d 100644
--- a/ProjectPage/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderViewModel.vb
+++ b/ProjectPage/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderViewModel.vb
@@ -59,7 +59,13 @@ Namespace EgtCAM5
End Set
End Property
- '
+ Private m_IsRightClickedTreeItem As Boolean
+ Public ReadOnly Property IsRightClickedTreeItem As Integer
+ Get
+ Return m_RightClickedTreeItemId
+ End Get
+ End Property
+
Private m_RightClickedTreeItemId As Integer
Public ReadOnly Property RightClickedTreeItemId As Integer
Get
@@ -165,8 +171,12 @@ Namespace EgtCAM5
Me.m_nObjTreeOldId = ObjTreeOldId
End Sub)
Application.Msn.Register(Application.RIGHTCLICKEDLAYERTREEITEM, Sub(Id As Integer)
+ EgtResetMark(m_RightClickedTreeItemId)
m_RightClickedTreeItemId = Id
End Sub)
+ Application.Msn.Register(Application.ISRIGHTCLICKEDLAYERTREEITEM, Sub(Value As Boolean)
+ m_IsRightClickedTreeItem = Value
+ End Sub)
End Sub
@@ -182,7 +192,7 @@ Namespace EgtCAM5
Public ReadOnly Property NewPartCommand As ICommand
Get
If m_cmdNewPart Is Nothing Then
- m_cmdNewPart = New RelayCommand(AddressOf NewPart, AddressOf CanNewPart)
+ m_cmdNewPart = New RelayCommand(AddressOf NewPart)
End If
Return m_cmdNewPart
End Get
@@ -197,13 +207,6 @@ Namespace EgtCAM5
SelectIdInObjTree(EgtGetCurrLayer(), False)
End Sub
- '''
- ''' Returns always true.
- '''
- Private Function CanNewPart(ByVal param As Object) As Boolean
- Return True
- End Function
-
#End Region ' NewPartCommand
#Region "NewLayerCommand"
@@ -214,7 +217,7 @@ Namespace EgtCAM5
Public ReadOnly Property NewLayerCommand As ICommand
Get
If m_cmdNewLayer Is Nothing Then
- m_cmdNewLayer = New RelayCommand(AddressOf NewLayer, AddressOf CanNewLayer)
+ m_cmdNewLayer = New RelayCommand(AddressOf NewLayer)
End If
Return m_cmdNewLayer
End Get
@@ -229,13 +232,6 @@ Namespace EgtCAM5
SelectIdInObjTree(EgtGetCurrLayer(), False)
End Sub
- '''
- ''' Returns always true.
- '''
- Private Function CanNewLayer(ByVal param As Object) As Boolean
- Return True
- End Function
-
#End Region ' NewLayerCommand
#Region "LayerColorCommand"
@@ -246,7 +242,7 @@ Namespace EgtCAM5
Public ReadOnly Property LayerColorCommand As ICommand
Get
If m_cmdLayerColor Is Nothing Then
- m_cmdLayerColor = New RelayCommand(AddressOf LayerColor, AddressOf CanLayerColor)
+ m_cmdLayerColor = New RelayCommand(AddressOf LayerColor)
End If
Return m_cmdLayerColor
End Get
@@ -260,13 +256,6 @@ Namespace EgtCAM5
Application.Msn.NotifyColleagues(Application.LOADOBJTREE)
End Sub
- '''
- ''' Returns always true.
- '''
- Private Function CanLayerColor(ByVal param As Object) As Boolean
- Return True
- End Function
-
#End Region ' LayerColorCommand
#Region "TreeViewDoubleClickCommand"
@@ -277,7 +266,7 @@ Namespace EgtCAM5
Public ReadOnly Property TreeViewDoubleClickCommand As ICommand
Get
If m_cmdTreeViewDoubleClick Is Nothing Then
- m_cmdTreeViewDoubleClick = New RelayCommand(AddressOf TreeViewDoubleClick, AddressOf CanTreeViewDoubleClick)
+ m_cmdTreeViewDoubleClick = New RelayCommand(AddressOf TreeViewDoubleClick)
End If
Return m_cmdTreeViewDoubleClick
End Get
@@ -293,13 +282,6 @@ Namespace EgtCAM5
End If
End Sub
- '''
- ''' Returns always true.
- '''
- Private Function CanTreeViewDoubleClick(ByVal param As Object) As Boolean
- Return True
- End Function
-
#End Region ' TreeViewDoubleClickCommand
#Region "TreeViewMouseRightButtonCommand"
@@ -310,7 +292,7 @@ Namespace EgtCAM5
Public ReadOnly Property TreeViewMouseRightButtonCommand As ICommand
Get
If m_cmdTreeViewMouseRightButton Is Nothing Then
- m_cmdTreeViewMouseRightButton = New RelayCommand(AddressOf TreeViewMouseRightButton, AddressOf CanTreeViewMouseRightButton)
+ m_cmdTreeViewMouseRightButton = New RelayCommand(AddressOf TreeViewMouseRightButton)
End If
Return m_cmdTreeViewMouseRightButton
End Get
@@ -326,13 +308,6 @@ Namespace EgtCAM5
End If
End Sub
- '''
- ''' Returns always true.
- '''
- Private Function CanTreeViewMouseRightButton(ByVal param As Object) As Boolean
- Return True
- End Function
-
#End Region ' TreeViewMouseRightButtonCommand
#Region "TreeViewMouseUpCommand"
@@ -355,13 +330,15 @@ Namespace EgtCAM5
Public Sub TreeViewMouseUp(ByVal param As Object)
' determino Id di eventuale item sotto il mouse
Dim nId As Integer = GDB_ID.NULL
- Dim TNode As LayerTreeViewItem = DirectCast(param, LayerTreeViewItem)
- If isNothing(TNode) Then Return
- nId = TNode.Id
+ If m_IsRightClickedTreeItem Then
+ nId = m_RightClickedTreeItemId
+ Else
+ nId = m_nObjTreeOldId
+ End If
' se Id coincide con il corrente
- If nId <> GDB_ID.NULL And nId = m_nObjTreeOldId Then
+ If nId <> GDB_ID.NULL Then 'And nId = m_nObjTreeOldId Then
' evidenzio
- EgtSetMark(m_nObjTreeOldId)
+ EgtSetMark(nId)
EgtDraw()
' lancio timer per successiva de-evidenziazione
ObjTreeTimer.Stop()
@@ -395,7 +372,7 @@ Namespace EgtCAM5
Public ReadOnly Property SelectCommand As ICommand
Get
If m_cmdSelect Is Nothing Then
- m_cmdSelect = New RelayCommand(AddressOf SelectCmd, AddressOf CanSelect)
+ m_cmdSelect = New RelayCommand(AddressOf SelectCmd)
End If
Return m_cmdSelect
End Get
@@ -409,13 +386,6 @@ Namespace EgtCAM5
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.SELECTPARTLAYEROBJ)
End Sub
- '''
- ''' Returns always true.
- '''
- Private Function CanSelect(ByVal param As Object) As Boolean
- Return True
- End Function
-
#End Region ' SelectCommand
#Region "DeselectCommand"
@@ -426,7 +396,7 @@ Namespace EgtCAM5
Public ReadOnly Property DeselectCommand As ICommand
Get
If m_cmdDeselect Is Nothing Then
- m_cmdDeselect = New RelayCommand(AddressOf Deselect, AddressOf CanDeselect)
+ m_cmdDeselect = New RelayCommand(AddressOf Deselect)
End If
Return m_cmdDeselect
End Get
@@ -440,13 +410,6 @@ Namespace EgtCAM5
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.DESELECTPARTLAYEROBJ)
End Sub
- '''
- ''' Returns always true.
- '''
- Private Function CanDeselect(ByVal param As Object) As Boolean
- Return True
- End Function
-
#End Region ' DeselectCommand
#Region "NameCommand"
@@ -457,7 +420,7 @@ Namespace EgtCAM5
Public ReadOnly Property NameCommand As ICommand
Get
If m_cmdName Is Nothing Then
- m_cmdName = New RelayCommand(AddressOf Name, AddressOf CanName)
+ m_cmdName = New RelayCommand(AddressOf Name)
End If
Return m_cmdName
End Get
@@ -471,13 +434,6 @@ Namespace EgtCAM5
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.SETNAME)
End Sub
- '''
- ''' Returns always true.
- '''
- Private Function CanName(ByVal param As Object) As Boolean
- Return True
- End Function
-
#End Region ' NameCommand
#Region "InfoCommand"
@@ -488,7 +444,7 @@ Namespace EgtCAM5
Public ReadOnly Property InfoCommand As ICommand
Get
If m_cmdInfo Is Nothing Then
- m_cmdInfo = New RelayCommand(AddressOf Info, AddressOf CanInfo)
+ m_cmdInfo = New RelayCommand(AddressOf Info)
End If
Return m_cmdInfo
End Get
@@ -502,13 +458,6 @@ Namespace EgtCAM5
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.SETINFO)
End Sub
- '''
- ''' Returns always true.
- '''
- Private Function CanInfo(ByVal param As Object) As Boolean
- Return True
- End Function
-
#End Region ' InfoCommand
#Region "RelocateCommand"
@@ -519,7 +468,7 @@ Namespace EgtCAM5
Public ReadOnly Property RelocateCommand As ICommand
Get
If m_cmdRelocate Is Nothing Then
- m_cmdRelocate = New RelayCommand(AddressOf Relocate, AddressOf CanRelocate)
+ m_cmdRelocate = New RelayCommand(AddressOf Relocate)
End If
Return m_cmdRelocate
End Get
@@ -533,13 +482,6 @@ Namespace EgtCAM5
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.RELOCATEPARTLAYEROBJ)
End Sub
- '''
- ''' Returns always true.
- '''
- Private Function CanRelocate(ByVal param As Object) As Boolean
- Return True
- End Function
-
#End Region ' RelocateCommand
#Region "CopyCommand"
@@ -550,7 +492,7 @@ Namespace EgtCAM5
Public ReadOnly Property CopyCommand As ICommand
Get
If m_cmdCopy Is Nothing Then
- m_cmdCopy = New RelayCommand(AddressOf Copy, AddressOf CanCopy)
+ m_cmdCopy = New RelayCommand(AddressOf Copy)
End If
Return m_cmdCopy
End Get
@@ -564,13 +506,6 @@ Namespace EgtCAM5
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.COPYPARTLAYEROBJ)
End Sub
- '''
- ''' Returns always true.
- '''
- Private Function CanCopy(ByVal param As Object) As Boolean
- Return True
- End Function
-
#End Region ' CopyCommand
#Region "DeleteCommand"
@@ -581,7 +516,7 @@ Namespace EgtCAM5
Public ReadOnly Property DeleteCommand As ICommand
Get
If m_cmdDelete Is Nothing Then
- m_cmdDelete = New RelayCommand(AddressOf Delete, AddressOf CanDelete)
+ m_cmdDelete = New RelayCommand(AddressOf Delete)
End If
Return m_cmdDelete
End Get
@@ -595,13 +530,6 @@ Namespace EgtCAM5
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.DELETE)
End Sub
- '''
- ''' Returns always true.
- '''
- Private Function CanDelete(ByVal param As Object) As Boolean
- Return True
- End Function
-
#End Region ' DeleteCommand
#Region "SaveCommand"
@@ -612,7 +540,7 @@ Namespace EgtCAM5
Public ReadOnly Property SaveCommand As ICommand
Get
If m_cmdSave Is Nothing Then
- m_cmdSave = New RelayCommand(AddressOf Save, AddressOf CanSave)
+ m_cmdSave = New RelayCommand(AddressOf Save)
End If
Return m_cmdSave
End Get
@@ -628,13 +556,6 @@ Namespace EgtCAM5
Application.Msn.NotifyColleagues(Application.SAVEOBJECT, New SaveObjectParam(m_RightClickedTreeItemId, sDir, nType))
End Sub
- '''
- ''' Returns always true.
- '''
- Private Function CanSave(ByVal param As Object) As Boolean
- Return True
- End Function
-
#End Region ' SaveCommand
#End Region ' Commands
@@ -647,8 +568,14 @@ Namespace EgtCAM5
Private m_bEnableUpdateObjInObjTree As Boolean = True
Private Sub ObjTreeTickEvent(source As Object, e As EventArgs) Handles ObjTreeTimer.Tick
- If m_nObjTreeOldId <> GDB_ID.NULL Then
- EgtResetMark(m_nObjTreeOldId)
+ Dim nId As Integer = GDB_ID.NULL
+ If m_IsRightClickedTreeItem Then
+ nId = m_RightClickedTreeItemId
+ Else
+ nId = m_nObjTreeOldId
+ End If
+ If nId <> GDB_ID.NULL Then
+ EgtResetMark(nId)
EgtDraw()
End If
ObjTreeTimer.Stop()
diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderView.xaml b/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderView.xaml
index 06098a0..3e82e56 100644
--- a/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderView.xaml
+++ b/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderView.xaml
@@ -9,11 +9,11 @@
-
+
@@ -38,6 +38,7 @@
diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderView.xaml.vb b/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderView.xaml.vb
index a52cae9..6bc6eb9 100644
--- a/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderView.xaml.vb
+++ b/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderView.xaml.vb
@@ -1,13 +1,20 @@
Public Class MachiningTreeExpanderView
' Evento necessario per impedire che venga creata la lavorazione quando si fa doppio click sulla ScrollBar
- Private Sub MachiningsTreeView_MouseDoubleClick(sender As Object, e As System.Windows.Input.MouseButtonEventArgs) Handles MachiningsTreeView.MouseDoubleClick
- Dim src As DependencyObject = VisualTreeHelper.GetParent(DirectCast(e.OriginalSource, DependencyObject))
+ Private Sub MachiningsTreeView_MouseDoubleClick(sender As Object, e As System.Windows.Input.MouseButtonEventArgs)
+ 'Dim src As DependencyObject = VisualTreeHelper.GetParent(DirectCast(e.OriginalSource, DependencyObject))
- ' Your logic here
- If TypeOf src Is Control AndAlso src.[GetType]() <> GetType(Grid) Then
- e.Handled = True
- End If
+ '' Your logic here
+ 'If TypeOf src Is Control AndAlso src.[GetType]() <> GetType(Grid) Then
+ ' e.Handled = True
+ 'End If
+ ' recupero il viewmodel associato a questa view in cui è presente la funzione che l'evento deve lanciare
+ Dim MachiningTreeExpanderViewModel As EgtCAM5.MachiningTreeExpanderViewModel = DirectCast(Me.DataContext, EgtCAM5.MachiningTreeExpanderViewModel)
+ ' recupero il treeviewitem clickato(sorgente dell'evento)
+ Dim ClickedTreeViewItem As TreeViewItem = DirectCast(sender, TreeViewItem)
+ ' ne recupero il VM da passare alla funzione
+ Dim ClickedTreeViewItemVM As MachiningTreeViewExpanderItem = DirectCast(ClickedTreeViewItem.DataContext, MachiningTreeViewExpanderItem)
+ MachiningTreeExpanderViewModel.TreeViewDoubleClick(ClickedTreeViewItemVM)
End Sub
End Class
diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/DispositionParameterExpander/DispositionUtility.vb b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/DispositionParameterExpander/DispositionUtility.vb
index d333fa7..a0dc41d 100644
--- a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/DispositionParameterExpander/DispositionUtility.vb
+++ b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/DispositionParameterExpander/DispositionUtility.vb
@@ -548,7 +548,11 @@ Public NotInheritable Class DispositionUtility
Private Const ORIG_FRAME As String = "ORIGFRAME"
' Funzione che visualizza i pezzi disponibili e li sposta sotto il grezzo
- Friend Shared Sub ShowPartUnderTable()
+ Friend Shared Sub ShowParts()
+ ' prendo riferimento tavola
+
+
+
' ciclo sui pezzi
Dim nPartId As Integer = EgtGetFirstPart()
While nPartId <> GDB_ID.NULL
@@ -557,6 +561,11 @@ Public NotInheritable Class DispositionUtility
EgtGetGroupGlobFrame(nPartId, frOrigPart)
' salvo il riferimento originale
EgtSetInfo(nPartId, ORIG_FRAME, frOrigPart)
+
+
+ '
+
+
' Attivo la visualizzazione del pezzo mettendolo in modalità standard
EgtSetStatus(nPartId, GDB_ST.ON_)
' prendo il pezzo successivo
@@ -566,7 +575,7 @@ Public NotInheritable Class DispositionUtility
End Sub
' Funzione che rimette a posto i pezzi
- Friend Shared Sub HidePartUnderTable()
+ Friend Shared Sub HideParts()
' ciclo sui pezzi
Dim nPartId As Integer = EgtGetFirstPart()
While nPartId <> GDB_ID.NULL
diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/DispositionParameterExpander/RawPartOption/RawPartOptionViewModel.vb b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/DispositionParameterExpander/RawPartOption/RawPartOptionViewModel.vb
index 317af74..8975441 100644
--- a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/DispositionParameterExpander/RawPartOption/RawPartOptionViewModel.vb
+++ b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/DispositionParameterExpander/RawPartOption/RawPartOptionViewModel.vb
@@ -115,7 +115,7 @@ Namespace EgtCAM5
''' Execute the Point. This method is invoked by the DoneCommand.
'''
Public Sub NewRawPart()
- DispositionUtility.ShowPartUnderTable()
+ DispositionUtility.ShowParts()
m_bRawPartParamVisibility = Visibility.Visible
OnPropertyChanged("RawPartParamVisibility")
End Sub
diff --git a/ProjectPage/PopUpGridPanel/PopUpGridPanelViewModel.vb b/ProjectPage/PopUpGridPanel/PopUpGridPanelViewModel.vb
index ed20474..4ea20ed 100644
--- a/ProjectPage/PopUpGridPanel/PopUpGridPanelViewModel.vb
+++ b/ProjectPage/PopUpGridPanel/PopUpGridPanelViewModel.vb
@@ -66,7 +66,8 @@ Namespace EgtCAM5
''' Execute the CPlaneView. This method is invoked by the CPlaneViewCommand.
'''
Public Sub CPlaneView(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.CPLANEVIEW)
+ EgtCAM5Map.refProjectVM.GetController.SetLastInteger(Controller.GRID_TYPE.VIEW)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.GRID)
End Sub
#End Region ' CPlaneViewCommand
@@ -89,7 +90,11 @@ Namespace EgtCAM5
''' Execute the CPlaneRotate. This method is invoked by the CPlaneRotateCommand.
'''
Public Sub CPlaneRotate(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.CPLANEROTATE)
+ If (Keyboard.Modifiers And ModifierKeys.Shift) <> ModifierKeys.Shift Then
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.GRID_ROTATE)
+ Else
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.GRID_ROTATE3D)
+ End If
End Sub
#End Region ' CPlaneRotateCommand
@@ -112,7 +117,7 @@ Namespace EgtCAM5
''' Execute the CPlane3P. This method is invoked by the CPlane3PCommand.
'''
Public Sub CPlane3P(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.CPLANE3P)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.GRID_3P)
End Sub
#End Region ' CPlane3PCommand
@@ -135,7 +140,7 @@ Namespace EgtCAM5
''' Execute the CPlanePerpObj. This method is invoked by the CPlanePerpObjCommand.
'''
Public Sub CPlanePerpObj(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.CPLANEPERPOBJ)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.GRID_PERPCURVE)
End Sub
#End Region ' CPlanePerpObjCommand
@@ -158,7 +163,7 @@ Namespace EgtCAM5
''' Execute the CPlaneObj. This method is invoked by the CPlaneObjCommand.
'''
Public Sub CPlaneObj(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.CPLANEOBJ)
+ EgtCAM5Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.GRID_OBJ)
End Sub
#End Region ' CPlaneObjCommand
diff --git a/ProjectPage/PopUpViewPanel/PopUpViewPanelViewModel.vb b/ProjectPage/PopUpViewPanel/PopUpViewPanelViewModel.vb
index c2f8191..e5c91ec 100644
--- a/ProjectPage/PopUpViewPanel/PopUpViewPanelViewModel.vb
+++ b/ProjectPage/PopUpViewPanel/PopUpViewPanelViewModel.vb
@@ -77,7 +77,7 @@ Namespace EgtCAM5
''' Execute the ZoomIn. This method is invoked by the ZoomInCommand.
'''
Public Sub ZoomIn(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.ZOOMIN)
+ EgtCAM5Map.refProjectVM.GetScene.ZoomIn()
End Sub
#End Region ' ZoomInCommand
@@ -100,7 +100,7 @@ Namespace EgtCAM5
''' Execute the ZoomOut. This method is invoked by the ZoomOutCommand.
'''
Public Sub ZoomOut(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.ZOOMOUT)
+ EgtCAM5Map.refProjectVM.GetScene.ZoomOut()
End Sub
#End Region ' ZoomOutCommand
@@ -123,7 +123,7 @@ Namespace EgtCAM5
''' Execute the IsoViewSE. This method is invoked by the IsoViewSECommand.
'''
Public Sub IsoViewSE(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.ISOVIEWSE)
+ EgtCAM5Map.refProjectVM.GetScene.IsoViewSE()
End Sub
#End Region ' IsoViewSECommand
@@ -146,7 +146,7 @@ Namespace EgtCAM5
''' Execute the IsoViewNE. This method is invoked by the IsoViewNECommand.
'''
Public Sub IsoViewNE(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.ISOVIEWNE)
+ EgtCAM5Map.refProjectVM.GetScene.IsoViewNE()
End Sub
#End Region ' IsoViewNECommand
@@ -169,7 +169,7 @@ Namespace EgtCAM5
''' Execute the IsoViewNW. This method is invoked by the IsoViewNWCommand.
'''
Public Sub IsoViewNW(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.ISOVIEWNW)
+ EgtCAM5Map.refProjectVM.GetScene.IsoViewNW()
End Sub
#End Region ' IsoViewNWCommand
@@ -192,7 +192,7 @@ Namespace EgtCAM5
''' Execute the GetDist. This method is invoked by the GetDistCommand.
'''
Public Sub ViewToCPlane(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.VIEWTOCPLANE)
+ EgtCAM5Map.refProjectVM.GetScene.CPlaneView()
End Sub
#End Region ' ViewToCPlaneCommand
diff --git a/ProjectPage/ProjectView.xaml b/ProjectPage/ProjectView.xaml
index 726cd84..37884a7 100644
--- a/ProjectPage/ProjectView.xaml
+++ b/ProjectPage/ProjectView.xaml
@@ -14,7 +14,7 @@
-
@@ -23,10 +23,10 @@
-
+
-
+
@@ -67,6 +67,7 @@
diff --git a/ProjectPage/ProjectView.xaml.vb b/ProjectPage/ProjectView.xaml.vb
index 02a7914..e6c636d 100644
--- a/ProjectPage/ProjectView.xaml.vb
+++ b/ProjectPage/ProjectView.xaml.vb
@@ -20,7 +20,7 @@ Public Class ProjectView
Dim nTop As Integer = -1
ShowPanel.IsFloating = False
ViewPanel.IsFloating = False
- InstrumentPanel.IsFloating = False
+ 'InstrumentPanel.IsFloating = False
GridPanel.IsFloating = False
DbPanel.IsFloating = False
ExecutePanel.IsFloating = False
@@ -37,7 +37,7 @@ Public Class ProjectView
PanelPositioning(ViewPanel, sState, nIndex, nLeft, nTop)
End If
If GetPrivateProfileFloatingWinPos(S_GENERAL, "InstrumentPanel", sState, nIndex, nLeft, nTop) And Not String.IsNullOrEmpty(sState) Then
- PanelPositioning(InstrumentPanel, sState, nIndex, nLeft, nTop)
+ 'PanelPositioning(InstrumentPanel, sState, nIndex, nLeft, nTop)
End If
If GetPrivateProfileFloatingWinPos(S_GENERAL, "GridPanel", sState, nIndex, nLeft, nTop) And Not String.IsNullOrEmpty(sState) Then
PanelPositioning(GridPanel, sState, nIndex, nLeft, nTop)
@@ -59,9 +59,9 @@ Public Class ProjectView
m_bDoors = IniFile.IsActiveDoors()
m_bGunStock = IniFile.IsActiveGunStock()
Application.Msn.Register(Application.DRAWMODE_ISCHECKED, Sub()
- ShowPanel.Visibility = Visibility.Visible
+ 'ShowPanel.Visibility = Visibility.Visible
ViewPanel.Visibility = Visibility.Visible
- InstrumentPanel.Visibility = Visibility.Visible
+ 'InstrumentPanel.Visibility = Visibility.Visible
GridPanel.Visibility = Visibility.Visible
DbPanel.Visibility = If(IniFile.m_ProjectMode = ProjectModeOpt.ONLYDRAW, Visibility.Collapsed, Visibility.Visible)
ExecutePanel.Visibility = Visibility.Visible
@@ -73,9 +73,9 @@ Public Class ProjectView
MachGroupPanel.Visibility = Visibility.Collapsed
End Sub)
Application.Msn.Register(Application.MACHININGMODE_ISCHECKED, Sub()
- ShowPanel.Visibility = Visibility.Visible
+ 'ShowPanel.Visibility = Visibility.Visible
ViewPanel.Visibility = Visibility.Visible
- InstrumentPanel.Visibility = Visibility.Visible
+ 'InstrumentPanel.Visibility = Visibility.Visible
GridPanel.Visibility = Visibility.Visible
DbPanel.Visibility = Visibility.Visible
ExecutePanel.Visibility = Visibility.Collapsed
diff --git a/ProjectPage/ProjectViewModel.vb b/ProjectPage/ProjectViewModel.vb
index 4e6fc9c..f4e1472 100644
--- a/ProjectPage/ProjectViewModel.vb
+++ b/ProjectPage/ProjectViewModel.vb
@@ -62,7 +62,8 @@ Namespace EgtCAM5
#Region "CONSTRUCTOR"
Sub New()
- 'Me.sTabName = EgtMsg(MSG_MAINWINDOW + 1)
+ ' Creo riferimento a questa classe in EgtCAM5Map
+ EgtCAM5Map.SetRefProjectVM(Me)
' Creo classe di supporto per la visualizzazione dei parametri utensile e di lavorazione per Db e operazioni
SharedFieldsClass.bFirst = True
ManageClosingApplication()
@@ -71,9 +72,6 @@ Namespace EgtCAM5
'InitializeEgtProject()
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()
' Funzione che contiene la registrazione di tutti i comandi della StatusBar
@@ -109,6 +107,18 @@ Namespace EgtCAM5
#End Region
+#Region "Get & Set"
+
+ Friend Function GetScene() As Scene
+ Return m_ProjectScene
+ End Function
+
+ Friend Function GetController() As Controller
+ Return m_Controller
+ End Function
+
+#End Region ' Get & Set
+
#Region "COMMANDS"
#Region "LoadedCommand"
@@ -156,7 +166,7 @@ Namespace EgtCAM5
' inizializzo gestore lavorazioni
EgtInitMachMgr(IniFile.m_sMachinesRoot)
' Apro progetto vuoto
- Application.Msn.NotifyColleagues(Application.NEWPROJECT)
+ EgtCAM5Map.refTopCommandBarVM.NewCmd()
End If
' Seleziono la macchina impostata nel file ini
Application.Msn.NotifyColleagues(Application.LOADCURRENTMACHINE)
@@ -344,200 +354,6 @@ Namespace EgtCAM5
EgtSetGridColor(IniFile.MinLnColor, IniFile.MajLnColor)
End Sub
- '''
- ''' Method that manage the visibility of the ProjectPage's Panels
- '''
- Sub RegisterGridViewPanelCommands()
- Application.Msn.Register(Application.WIREFRAME, Sub()
- m_ProjectScene.WireFrame()
- End Sub)
- Application.Msn.Register(Application.HIDDENLINE, Sub()
- m_ProjectScene.HiddenLine()
- End Sub)
- Application.Msn.Register(Application.SHADING, Sub()
- m_ProjectScene.Shading()
- End Sub)
- Application.Msn.Register(Application.ZOOMALL, Sub()
- m_ProjectScene.ZoomAll()
- End Sub)
- Application.Msn.Register(Application.ZOOMIN, Sub()
- m_ProjectScene.ZoomIn()
- End Sub)
- Application.Msn.Register(Application.ZOOMOUT, Sub()
- m_ProjectScene.ZoomOut()
- End Sub)
- Application.Msn.Register(Application.TOPVIEW, Sub()
- m_ProjectScene.TopView()
- End Sub)
- Application.Msn.Register(Application.FRONTVIEW, Sub()
- m_ProjectScene.FrontView()
- End Sub)
- Application.Msn.Register(Application.LEFTVIEW, Sub()
- m_ProjectScene.LeftView()
- End Sub)
- Application.Msn.Register(Application.BACKVIEW, Sub()
- m_ProjectScene.BackView()
- End Sub)
- Application.Msn.Register(Application.RIGHTVIEW, Sub()
- m_ProjectScene.RightView()
- End Sub)
- Application.Msn.Register(Application.ISOVIEWSW, Sub()
- m_ProjectScene.IsoViewSW()
- End Sub)
- Application.Msn.Register(Application.ISOVIEWSE, Sub()
- m_ProjectScene.IsoViewSE()
- End Sub)
- Application.Msn.Register(Application.ISOVIEWNE, Sub()
- m_ProjectScene.IsoViewNE()
- End Sub)
- 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)
- Application.Msn.Register(Application.RESETSTATUSANALYZE, Sub()
- m_ProjectScene.ResetStatusAnalyze()
- Application.Msn.NotifyColleagues(Application.SELECTIDINOBJTREE, GDB_ID.NULL)
- End Sub)
- Application.Msn.Register(Application.SETSTATUSGETDISTANCE, Sub()
- m_ProjectScene.SetStatusGetDistance()
- End Sub)
- Application.Msn.Register(Application.RESETSTATUSGETDISTANCE, Sub()
- m_ProjectScene.ResetStatusGetDistance()
- Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSOUTPUT, String.Empty)
- End Sub)
- Application.Msn.Register(Application.CPLANETOP, Sub()
- m_Controller.SetLastInteger(Controller.GRID_TYPE.TOP)
- m_Controller.ExecuteCommand(Controller.CMD.GRID)
- End Sub)
- Application.Msn.Register(Application.CPLANEFRONT, Sub()
- m_Controller.SetLastInteger(Controller.GRID_TYPE.FRONT)
- m_Controller.ExecuteCommand(Controller.CMD.GRID)
- End Sub)
- Application.Msn.Register(Application.CPLANERIGHT, Sub()
- m_Controller.SetLastInteger(Controller.GRID_TYPE.RIGHT)
- m_Controller.ExecuteCommand(Controller.CMD.GRID)
- End Sub)
- Application.Msn.Register(Application.CPLANEBACK, Sub()
- m_Controller.SetLastInteger(Controller.GRID_TYPE.BACK)
- m_Controller.ExecuteCommand(Controller.CMD.GRID)
- End Sub)
- Application.Msn.Register(Application.CPLANELEFT, Sub()
- m_Controller.SetLastInteger(Controller.GRID_TYPE.LEFT)
- m_Controller.ExecuteCommand(Controller.CMD.GRID)
- End Sub)
- Application.Msn.Register(Application.CPLANEBOTTOM, Sub()
- m_Controller.SetLastInteger(Controller.GRID_TYPE.BOTTOM)
- m_Controller.ExecuteCommand(Controller.CMD.GRID)
- End Sub)
- Application.Msn.Register(Application.CPLANEVIEW, Sub()
- m_Controller.SetLastInteger(Controller.GRID_TYPE.VIEW)
- m_Controller.ExecuteCommand(Controller.CMD.GRID)
- End Sub)
- Application.Msn.Register(Application.CPLANEELEVATION, Sub()
- m_Controller.ExecuteCommand(Controller.CMD.GRID_ELEVATION)
- End Sub)
- Application.Msn.Register(Application.CPLANEORIGIN, Sub()
- m_Controller.ExecuteCommand(Controller.CMD.GRID_ORIGIN)
- End Sub)
- Application.Msn.Register(Application.CPLANEROTATE, Sub()
- If (Keyboard.Modifiers And ModifierKeys.Shift) <> ModifierKeys.Shift Then
- m_Controller.ExecuteCommand(Controller.CMD.GRID_ROTATE)
- Else
- m_Controller.ExecuteCommand(Controller.CMD.GRID_ROTATE3D)
- End If
- End Sub)
- Application.Msn.Register(Application.CPLANE3P, Sub()
- m_Controller.ExecuteCommand(Controller.CMD.GRID_3P)
- End Sub)
- Application.Msn.Register(Application.CPLANEPERPOBJ, Sub()
- m_Controller.ExecuteCommand(Controller.CMD.GRID_PERPCURVE)
- End Sub)
- Application.Msn.Register(Application.CPLANEOBJ, Sub()
- m_Controller.ExecuteCommand(Controller.CMD.GRID_OBJ)
- End Sub)
- End Sub
-
- Sub RegisterDrawPanelCommands()
- Application.Msn.Register(Application.GETCURRLAYER, Sub()
- If IniFile.m_ProjectSceneContext = 0 Then Return
- Dim CurrLayer As Integer = m_Controller.GetCurrLayer()
- Application.Msn.NotifyColleagues(Application.SETCURRLAYER, CurrLayer)
- End Sub)
-
- Application.Msn.Register(Application.POINT, Sub()
- If (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control Then
- m_Controller.ExecuteCommand(Controller.CMD.FRAME)
- ElseIf (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
- m_Controller.ExecuteCommand(Controller.CMD.VECTOR)
- Else
- m_Controller.ExecuteCommand(Controller.CMD.POINT)
- End If
- End Sub)
- Application.Msn.Register(Application.LINE2P, Sub()
- If (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control Then
- m_Controller.SetContinue()
- 'EmitStripStatusOutput(EgtMsg(399)) ' Continue : 'L' with line, 'A' with arc
- End If
- m_Controller.ExecuteCommand(Controller.CMD.LINE2P)
- End Sub)
- Application.Msn.Register(Application.LINEPDL, Sub()
- If (Keyboard.Modifiers And ModifierKeys.Shift) <> ModifierKeys.Shift Then
- m_Controller.ExecuteCommand(Controller.CMD.LINEPDL)
- Else
- m_Controller.ExecuteCommand(Controller.CMD.LINEPVL)
- 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
- m_Controller.SetContinue()
- 'EmitStripStatusOutput(EgtMsg(399)) ' Continue : 'L' with line, 'A' with arc
- End If
- m_Controller.ExecuteCommand(Controller.CMD.ARCPDP)
- Else
- m_Controller.ExecuteCommand(Controller.CMD.ARCPVP)
- End If
- End Sub)
- Application.Msn.Register(Application.POLYGON, Sub()
- 'If (Keyboard.Modifiers And ModifierKeys.Shift) <> ModifierKeys.Shift Then
- m_Controller.ExecuteCommand(Controller.CMD.POLYGON)
- 'Else
- ' m_Controller.ExecuteCommand(Controller.CMD.POLYGONSIDE)
- 'End If
- End Sub)
- Application.Msn.Register(Application.TEXT, Sub()
- If (Keyboard.Modifiers And ModifierKeys.Shift) <> ModifierKeys.Shift Then
- m_Controller.ExecuteCommand(Controller.CMD.TEXT)
- Else
- m_Controller.ExecuteCommand(Controller.CMD.TEXTPLUS)
- End If
- End Sub)
- Application.Msn.Register(Application.PLANE, Sub()
- If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
- m_Controller.ExecuteCommand(Controller.CMD.REGION)
- Else
- m_Controller.ExecuteCommand(Controller.CMD.PLANE)
- End If
- End 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.JOINCURVE, Sub()
- If (Keyboard.Modifiers And ModifierKeys.Shift) <> ModifierKeys.Shift Then
- m_Controller.SetLastBoolean(False)
- Else
- m_Controller.SetLastBoolean(True)
- End If
- m_Controller.ExecuteCommand(Controller.CMD.JOINCURVE)
- End Sub)
- End Sub
-
Sub RegisterDrawOptionPanelCommands()
Application.Msn.Register(Application.NOTIFYINPUTTEXT, Sub(sInputText As String)
m_InputText = sInputText
@@ -604,10 +420,6 @@ Namespace EgtCAM5
End Sub
Private Sub ManageTopCommandBar()
- Application.Msn.Register(Application.NEWPROJECT, Sub()
- m_Controller.NewProject(True)
- Application.Msn.NotifyColleagues(Application.SELECTIDINOBJTREENOMARK, EgtGetCurrLayer())
- End Sub)
Application.Msn.Register(Application.OPENPROJECT, Sub(sFilePath As String)
If String.IsNullOrEmpty(sFilePath) Then
Dim sDir As String = String.Empty
diff --git a/ProjectPage/ShowPanel/ShowPanelViewModel.vb b/ProjectPage/ShowPanel/ShowPanelViewModel.vb
index e2e9fc2..ec44a7b 100644
--- a/ProjectPage/ShowPanel/ShowPanelViewModel.vb
+++ b/ProjectPage/ShowPanel/ShowPanelViewModel.vb
@@ -48,7 +48,7 @@ Namespace EgtCAM5
If value <> m_WireframeIsChecked Then
m_WireframeIsChecked = value
If value Then
- Application.Msn.NotifyColleagues(Application.WIREFRAME)
+ EgtCAM5Map.refProjectVM.GetScene.WireFrame()
OnPropertyChanged("WireframeIsChecked")
End If
End If
@@ -64,7 +64,7 @@ Namespace EgtCAM5
If value <> m_HiddenLineIsChecked Then
m_HiddenLineIsChecked = value
If value Then
- Application.Msn.NotifyColleagues(Application.HIDDENLINE)
+ EgtCAM5Map.refProjectVM.GetScene.HiddenLine()
OnPropertyChanged("HiddenLineIsChecked")
End If
End If
@@ -80,7 +80,7 @@ Namespace EgtCAM5
If value <> m_ShadingIsChecked Then
m_ShadingIsChecked = value
If value Then
- Application.Msn.NotifyColleagues(Application.SHADING)
+ EgtCAM5Map.refProjectVM.GetScene.Shading()
OnPropertyChanged("ShadingIsChecked")
End If
End If
diff --git a/ProjectPage/ViewPanel/ViewPanelViewModel.vb b/ProjectPage/ViewPanel/ViewPanelViewModel.vb
index fc98362..9a77d6f 100644
--- a/ProjectPage/ViewPanel/ViewPanelViewModel.vb
+++ b/ProjectPage/ViewPanel/ViewPanelViewModel.vb
@@ -84,7 +84,7 @@ Namespace EgtCAM5
''' Execute the ZoomAll. This method is invoked by the ZoomAllCommand.
'''
Public Sub ZoomAll(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.ZOOMALL)
+ EgtCAM5Map.refProjectVM.GetScene.ZoomAll()
End Sub
#End Region ' ZoomAllCommand
@@ -107,7 +107,7 @@ Namespace EgtCAM5
''' Execute the TopView. This method is invoked by the TopViewCommand.
'''
Public Sub TopView(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.TOPVIEW)
+ EgtCAM5Map.refProjectVM.GetScene.TopView()
End Sub
#End Region ' TopViewCommand
@@ -130,7 +130,7 @@ Namespace EgtCAM5
''' Execute the FrontView. This method is invoked by the FrontViewCommand.
'''
Public Sub FrontView(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.FRONTVIEW)
+ EgtCAM5Map.refProjectVM.GetScene.FrontView()
End Sub
#End Region ' FrontViewCommand
@@ -153,7 +153,7 @@ Namespace EgtCAM5
''' Execute the LeftView. This method is invoked by the LeftViewCommand.
'''
Public Sub LeftView(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.LEFTVIEW)
+ EgtCAM5Map.refProjectVM.GetScene.LeftView()
End Sub
#End Region ' LeftViewCommand
@@ -176,7 +176,7 @@ Namespace EgtCAM5
''' Execute the BackView. This method is invoked by the BackViewCommand.
'''
Public Sub BackView(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.BACKVIEW)
+ EgtCAM5Map.refProjectVM.GetScene.BackView()
End Sub
#End Region ' BackViewCommand
@@ -199,7 +199,7 @@ Namespace EgtCAM5
''' Execute the RightView. This method is invoked by the RightViewCommand.
'''
Public Sub RightView(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.RIGHTVIEW)
+ EgtCAM5Map.refProjectVM.GetScene.RightView()
End Sub
#End Region ' RightViewCommand
@@ -222,7 +222,7 @@ Namespace EgtCAM5
''' Execute the IsoViewSW. This method is invoked by the IsoViewSWCommand.
'''
Public Sub IsoViewSW(ByVal param As Object)
- Application.Msn.NotifyColleagues(Application.ISOVIEWSW)
+ EgtCAM5Map.refProjectVM.GetScene.IsoViewSW()
End Sub
#End Region ' IsoViewSWCommand
diff --git a/SetUpWindow/SetUpViewModel.vb b/SetUpWindow/SetUpViewModel.vb
index 5a0ef55..5c44d41 100644
--- a/SetUpWindow/SetUpViewModel.vb
+++ b/SetUpWindow/SetUpViewModel.vb
@@ -1118,7 +1118,7 @@ Public Class Position
Else
EgtLuaSetGlobStringVar("STU.HEAD1", sHead)
EgtLuaSetGlobStringVar("STU.HEAD2", Head)
- Dim x = EgtLuaCallFunction("STU.IsCompatibleHeads")
+ EgtLuaCallFunction("STU.IsCompatibleHeads")
' Leggo variabili
Dim bIsValid As Boolean = False
EgtLuaGetGlobBoolVar("STU.ISVALID", bIsValid)
diff --git a/StatusBar/StatusBarViewModel.vb b/StatusBar/StatusBarViewModel.vb
index 8bf23a6..3c42d23 100644
--- a/StatusBar/StatusBarViewModel.vb
+++ b/StatusBar/StatusBarViewModel.vb
@@ -184,6 +184,8 @@ Namespace EgtCAM5
#Region "CONSTRUCTOR"
Sub New()
+ ' Creo riferimento a questa classe in EgtCAM5Map
+ EgtCAM5Map.SetRefStatusBarVM(Me)
Application.Msn.Register(Application.NOTIFYCURRPOS, Sub(sCursorPos As String)
StatusCurrPos = sCursorPos
End Sub)
@@ -478,8 +480,8 @@ Namespace EgtCAM5
'''
Private Sub SearchMachine()
' Se direttorio base macchine non definito o non esiste, ritorno
- If String.IsNullOrWhiteSpace(IniFile.m_sMachinesRoot) Or
- Not Directory.Exists(IniFile.m_sMachinesRoot) Then
+ If String.IsNullOrWhiteSpace(IniFile.m_sMachinesRoot) OrElse
+ Not Directory.Exists(IniFile.m_sMachinesRoot) OrElse Directory.GetDirectories(IniFile.m_sMachinesRoot).Count = 0 Then
IniFile.m_ProjectMode = ProjectModeOpt.ONLYDRAW
EgtOutLog(EgtMsg(MSG_STATUSBAR + 1))
Return
@@ -492,6 +494,11 @@ Namespace EgtCAM5
m_MachinesList.Add(New Machine With {.Name = Path.GetFileName(TempArray(i)), .MachineDirPath = TempArray(i)})
End If
Next
+ If m_MachinesList.Count = 0 Then
+ IniFile.m_ProjectMode = ProjectModeOpt.ONLYDRAW
+ EgtOutLog(EgtMsg(MSG_STATUSBAR + 1))
+ Return
+ End If
End Sub
'''
@@ -528,7 +535,7 @@ Namespace EgtCAM5
Return True
End Function
- Public Function ProcessEvents(ByVal nProg As Integer, ByVal nPause As Integer) As Integer
+ Private Function ProcessEvents(ByVal nProg As Integer, ByVal nPause As Integer) As Integer
' Se previsto, imposto progress
If nProg > 0 Then
StatusProgress = nProg
diff --git a/TopCommandBar/TopCommandBarView.xaml b/TopCommandBar/TopCommandBarView.xaml
index a8748dd..4dfbf43 100644
--- a/TopCommandBar/TopCommandBarView.xaml
+++ b/TopCommandBar/TopCommandBarView.xaml
@@ -1,7 +1,7 @@
-
+