6dd2abf95d
- Altri nomi modificati. - Eliminato namespace.
229 lines
11 KiB
VB.net
229 lines
11 KiB
VB.net
Imports EgtWPFLib5
|
|
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)
|
|
ShutdownMode = System.Windows.ShutdownMode.OnMainWindowClose
|
|
' Creo la View principale
|
|
Dim MainWndView As New MainWindowV
|
|
MainWindow = MainWndView
|
|
System.Windows.Forms.Integration.ElementHost.EnableModelessKeyboardInterop(Me.MainWindow)
|
|
' Creo il ViewModel principale
|
|
Dim MainWndViewModel As New MainWindowVM
|
|
' Assegno il ViewModel alla View
|
|
MainWndView.DataContext = MainWndViewModel
|
|
' Mostro la View principale
|
|
MainWndView.Show()
|
|
End Sub
|
|
|
|
#Region "Messages"
|
|
|
|
' Generic messages
|
|
Friend Const MAINWINDOW_CONTENTRENDERED As String = "MainWindow_ContentRendered"
|
|
Friend Const MAINWINDOW_ACTIVATED As String = "MainWindow_Activated"
|
|
Friend Const MAINWINDOW_DEACTIVATED As String = "MainWindow_Deactivated"
|
|
Friend Const CLOSEAPPLICATIONCOMMAND As String = "CloseApplicationCommand"
|
|
Friend Const CLOSEAPPLICATION As String = "CloseApplication"
|
|
Friend Const PROJECTPAGE_SELECTED As String = "ProjectPage_Selected"
|
|
Friend Const PROJECTPAGE_DESELECTED As String = "ProjectPage_Deselected"
|
|
Friend Const DRAWMODE_ISCHECKED As String = "DrawMode_IsChecked"
|
|
Friend Const MACHININGMODE_ISCHECKED As String = "MachiningMode_IsChecked"
|
|
Friend Const RESETSTATUS As String = "ResetStatus"
|
|
Friend Const LOADOPERATIONLIST As String = "LoadOperationList"
|
|
Friend Const UPDATEMAINWINDOWTITLE As String = "UpdateMainWindowTitle"
|
|
Friend Const EMITTITLE As String = "EmitTitle"
|
|
Friend Const SETMACHININGMODE As String = "SetMachiningMode"
|
|
Friend Const SETDRAWMODE As String = "SetDrawMode"
|
|
|
|
' ProjectPage messages
|
|
Friend Const NOTIFYCURRPOS As String = "NotifyCurrPos"
|
|
Friend Const NOTIFYINPUTTEXT As String = "NotifyInputText"
|
|
Friend Const NOTIFYSTATUSOUTPUT As String = "NotifyStatusOutput"
|
|
Friend Const NOTIFYSTATUSPROGRESS As String = "NotifyStatusProgress"
|
|
Friend Const NOTIFYSTATUSSTOP As String = "NotifyStatusStop"
|
|
Friend Const UPDATESTATUSGRID As String = "UpdateStatusGrid"
|
|
Friend Const LOADGRIDDATA As String = "LoadGridData"
|
|
Friend Const MMUNITSCHANGED As String = "MmUnitsChanged"
|
|
Friend Const SETSCENESELMODE As String = "SetSceneSelMode"
|
|
Friend Const SETSCENESELTYPE As String = "SetSceneSelType"
|
|
Friend Const SETMOVEINDISPOSITION As String = "SetMoveInDisposition"
|
|
|
|
' ShowPanel messages
|
|
Friend Const WIREFRAME As String = "Wireframe"
|
|
Friend Const HIDDENLINE As String = "HiddenLine"
|
|
Friend Const SHADING As String = "Shading"
|
|
Friend Const SHOWMODESTATE As String = "ShowModeState"
|
|
Friend Const SHOWCURVEDIR As String = "ShowCurveDir"
|
|
|
|
' InstrumentPanel messages
|
|
Friend Const ANALYZE_ISCHECKED As String = "Analyze_IsChecked"
|
|
Friend Const GETDISTANCE_ISCHECKED As String = "GetDistance_IsChecked"
|
|
|
|
' GridViewPanel messages
|
|
Friend Const ZOOMIN As String = "ZoomIn"
|
|
Friend Const ZOOMOUT As String = "ZoomOut"
|
|
Friend Const ISOVIEWSW As String = "IsoViewSW"
|
|
Friend Const ISOVIEWSE As String = "IsoViewSE"
|
|
Friend Const ISOVIEWNE As String = "IsoViewNE"
|
|
Friend Const ISOVIEWNW As String = "IsoViewNW"
|
|
Friend Const VIEWTOCPLANE As String = "ViewToCPlane"
|
|
Friend Const CPLANETOP As String = "CPlaneTop"
|
|
Friend Const CPLANEFRONT As String = "CPlaneFront"
|
|
Friend Const CPLANERIGHT As String = "CPlaneRight"
|
|
Friend Const CPLANEBACK As String = "CPlaneBack"
|
|
Friend Const CPLANELEFT As String = "CPlaneLeft"
|
|
Friend Const CPLANEBOTTOM As String = "CPlaneBottom"
|
|
Friend Const CPLANEVIEW As String = "CPlaneView"
|
|
Friend Const CPLANEELEVATION As String = "CPlaneElevation"
|
|
Friend Const CPLANEORIGIN As String = "CPlaneOrigin"
|
|
Friend Const CPLANEROTATE As String = "CPlaneRotate"
|
|
Friend Const CPLANE3P As String = "CPlane3P"
|
|
Friend Const CPLANEPERPOBJ As String = "CPlanePerpObj"
|
|
Friend Const CPLANEOBJ As String = "CPlaneObj"
|
|
|
|
' DrawPanel messages
|
|
Friend Const POINT As String = "Point"
|
|
Friend Const LINE2P As String = "Line2P"
|
|
Friend Const LINEPDL As String = "LinePDL"
|
|
Friend Const CIRCLE As String = "Circle"
|
|
Friend Const ARCCSE As String = "ArcCSE"
|
|
Friend Const ARC3P As String = "Arc3P"
|
|
Friend Const ARCPDP As String = "ArcPDP"
|
|
Friend Const FILLET As String = "Fillet"
|
|
Friend Const RECTANGLE2P As String = "Rectangle2P"
|
|
Friend Const POLYGON As String = "Polygon"
|
|
Friend Const TEXT As String = "Text"
|
|
Friend Const PLANE As String = "Plane"
|
|
Friend Const EXTRUDE As String = "Extrude"
|
|
Friend Const REVOLVE As String = "Revolve"
|
|
Friend Const SCREW As String = "Screw"
|
|
Friend Const RULED As String = "Ruled"
|
|
Friend Const MERGESURF As String = "MergeSurf"
|
|
Friend Const EXPLODESURF As String = "ExplodeSurf"
|
|
Friend Const INVERTSURF As String = "InvertSurf"
|
|
Friend Const DELETE As String = "Delete"
|
|
Friend Const CHANGELAYER As String = "ChangeLayer"
|
|
Friend Const CHANGECOLOR As String = "ChangeColor"
|
|
Friend Const INVERTCURVE As String = "InvertCurve"
|
|
Friend Const CHANGESTARTCURVE As String = "ChangeStartCurve"
|
|
Friend Const EXTENDCURVE As String = "ExtendCurve"
|
|
Friend Const BREAKCURVE As String = "BreakCurve"
|
|
Friend Const JOINCURVE As String = "JoinCurve"
|
|
Friend Const EXPLODECURVE As String = "ExplodeCurve"
|
|
Friend Const SETCURVETH As String = "SetCurveTh"
|
|
Friend Const MOVE As String = "Move"
|
|
Friend Const ROTATE As String = "Rotate"
|
|
Friend Const MIRROR As String = "Mirror"
|
|
Friend Const SCALE As String = "Scale"
|
|
Friend Const OFFSET As String = "Offset"
|
|
|
|
' Controller messages
|
|
Friend Const SETLASTBOOLEAN As String = "SetLastBoolean"
|
|
Friend Const SETLASTINTEGER As String = "SetLastInteger"
|
|
Friend Const SHOW As String = "Show"
|
|
Friend Const DONE As String = "Done"
|
|
Friend Const EXECUTECOMMAND As String = "ExecuteCommand"
|
|
Friend Const MANAGEMODIFIED As String = "ManageModified"
|
|
Friend Const ALLOWWINDOWTOCLOSE As String = "AllowWindowToClose"
|
|
|
|
' DrawOptionPanel messages
|
|
Friend Const PREPAREINPUTBOX As String = "PrepareInputBox"
|
|
Friend Const SETINPUTBOXTEXT As String = "SetInputBoxText"
|
|
Friend Const SETINPUTBOXCHECK As String = "SetInputBoxCheck"
|
|
Friend Const CHANGEINPUTBOXCHECK As String = "ChangeInputBoxCheck"
|
|
Friend Const ADDINPUTBOXCOMBO As String = "AddInputBoxCombo"
|
|
Friend Const RESETINPUTBOX As String = "ResetInputBox"
|
|
Friend Const LOADOBJTREE As String = "LoadObjTree"
|
|
Friend Const UPDATEOBJINOBJTREE As String = "UpdateObjInObjTree"
|
|
Friend Const UPDATEOBJINOBJTREENOMARK As String = "UpdateObjInObjTreeNoMark"
|
|
Friend Const SELECTIDINOBJTREE As String = "SelectIdInObjTree"
|
|
Friend Const SELECTIDINOBJTREENOMARK As String = "SelectIdInObjTreeNoMark"
|
|
Friend Const CLEAROBJTREE As String = "ClearObjTree"
|
|
Friend Const UPDATEOBJTREE As String = "UpdateObjTree"
|
|
Friend Const UPDATEHEADERNAME As String = "UpdateHeaderName"
|
|
Friend Const UPDATEHEADERCOLOR As String = "UpdateHeaderColor"
|
|
Friend Const UPDATEOBJTREEOLDID As String = "UpdateObjTreeOldId"
|
|
Friend Const DRAWOPTIONPANEL_CLOSING As String = "DrawOptionPanel_Closing"
|
|
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"
|
|
|
|
' MachiningGroupPanel
|
|
Friend Const INITIALIZEMACHGROUPS As String = "InitializeMachGroups"
|
|
Friend Const MACHGROUPSISENABLED As String = "MachGroupsIsEnabled"
|
|
Friend Const MACHGROUPSRESULT As String = "MachGroupsResult"
|
|
|
|
' MachiningOptionPanel
|
|
Friend Const OPERATIONVIEWEXPANDERISENABLED As String = "OperationViewExpanderIsEnabled"
|
|
Friend Const MACHININGTREEVIEWEXPANDERISENABLED As String = "MachiningTreeViewExpanderIsEnabled"
|
|
Friend Const NEWMACHININGMODEISACTIVE As String = "NewMachiningModeIsActive"
|
|
Friend Const SIMULATIONEXPANDER_GET_ISEXPANDED As String = "Get_SimulationExpander_IsExpanded"
|
|
Friend Const SIMULATIONEXPANDER_SET_ISEXPANDED As String = "Set_SimulationExpander_IsExpanded"
|
|
Friend Const SIMULATIONEXPANDER_UPDATE_CNCDATA As String = "SimulationExpander_Update_CncData"
|
|
Friend Const CANCELOPERATIONCOMMAND As String = "CancelOperationCommand"
|
|
Friend Const UPDATEOPERATIONMACHININGLIST As String = "UpdateOperationMachiningList"
|
|
|
|
' StatusBar messages
|
|
Friend Const STATUSGRIDCOMMAND As String = "StatusGridCommand"
|
|
Friend Const STATUSCURRPOSTYPECOMMAND As String = "StatusCurrPosTypeCommand"
|
|
Friend Const STATUSCURRPOSTYPETEXT As String = "StatusCurrPosTypeText"
|
|
Friend Const STATUSUNITSCOMMAND As String = "StatusUnitsCommand"
|
|
Friend Const UPDATESTATUSUNITS As String = "UpdateStatusUnits"
|
|
Friend Const STATUSSNAPPOINTTYPETEXT As String = "StatusSnapPointTypeText"
|
|
Friend Const STATUSSNAPPOINTTYPEBACKGROUND As String = "StatusSnapPointTypeBackground"
|
|
Friend Const LOADSELECTEDMACHINE As String = "LoadSelectedMachine"
|
|
Friend Const LOADCURRENTMACHINE As String = "LoadCurrentMachine"
|
|
Friend Const SAVECURRENTMACHINE As String = "SaveCurrentMachine"
|
|
Friend Const UPDATECURRENTMACHINE As String = "UpdateCurrentMachine"
|
|
|
|
' TopCommandBar
|
|
Friend Const OPENPROJECT As String = "OpenProject"
|
|
Friend Const SAVEPROJECT As String = "SaveProject"
|
|
Friend Const SAVEASPROJECT As String = "SaveAsProject"
|
|
Friend Const INSERTPROJECT As String = "InsertProject"
|
|
Friend Const IMPORTPROJECT As String = "ImportProject"
|
|
Friend Const EXPORTPROJECT As String = "ExportProject"
|
|
Friend Const PREEXECSCRIPT As String = "PreExecScript"
|
|
Friend Const EXECSCRIPT As String = "ExecScript"
|
|
Friend Const SETDRAWISENABLED As String = "SetDrawIsEnabled"
|
|
|
|
' Special
|
|
' Door
|
|
Friend Const DOORSSCRIPT As String = "DoorsScript"
|
|
Friend Const DMACHSCRIPT As String = "DMachScript"
|
|
|
|
' GunStock
|
|
Friend Const GUNSTOCKNEW As String = "GunStockNew"
|
|
Friend Const GUNSTOCKMODIF As String = "GunStockModif"
|
|
|
|
Shared ReadOnly _messenger As New Messenger()
|
|
|
|
Friend Shared ReadOnly Property Msn As Messenger
|
|
Get
|
|
Return _messenger
|
|
End Get
|
|
End Property
|
|
|
|
Private Sub Application_DispatcherUnhandledException(ByVal sender As System.Object, ByVal e As System.Windows.Threading.DispatcherUnhandledExceptionEventArgs)
|
|
MessageBox.Show(e.Exception.Message)
|
|
e.Handled = True
|
|
End Sub
|
|
|
|
#End Region
|
|
|
|
Public Sub ManageUnhandledException(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 |