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 @@