diff --git a/Constants/ConstIni.vb b/Constants/ConstIni.vb index 9020deb..e57e456 100644 --- a/Constants/ConstIni.vb +++ b/Constants/ConstIni.vb @@ -11,7 +11,7 @@ ' '---------------------------------------------------------------------------- -Module ConstIni +Public Module ConstIni 'Public Const INI_FILE_NAME As String = "EgtCAM5.ini" @@ -44,11 +44,11 @@ Module ConstIni 'Public Const K_LIBSDIR As String = "LibsDir" 'Public Const K_BASELIB As String = "BaseLib" - 'Public Const S_GEOMDB As String = "GeomDB" + Public Const S_GEOMDB As String = "GeomDB" 'Public Const K_DEFAULTFONT As String = "DefaultFont" 'Public Const K_NFEFONTDIR As String = "NfeFontDir" 'Public Const K_DEFAULTCOLOR As String = "DefaultColor" - 'Public Const K_SAVETYPE As String = "SaveType" + Public Const K_SAVETYPE As String = "SaveType" 'Public Const S_OPENGL As String = "OpenGL" 'Public Const K_DOUBLEBUFFER As String = "DoubleBuffer" @@ -112,6 +112,12 @@ Module ConstIni 'Public Const K_NEWMACHININGISLASTONE As String = "NewMachiningIsLastOne" 'Public Const K_USEDISPOSITIONSCRIPT As String = "UseDispositionScript" + Public Const S_MRUFILES As String = "MruFiles" + Public Const S_MRUIMPORT As String = "MruImport" + Public Const S_MRUSCRIPTS As String = "MruScripts" + Public Const S_MRUDOORS As String = "MruDoors" + Public Const S_MRUGUNSTOCKMOD As String = "MruGunStockMod" + Public Const S_MRUGUNSTOCKPEZ As String = "MruGunStockPez" Public Const K_FILE As String = "File" End Module diff --git a/Constants/ConstMsg.vb b/Constants/ConstMsg.vb index d2d3db8..7a655fb 100644 --- a/Constants/ConstMsg.vb +++ b/Constants/ConstMsg.vb @@ -4,7 +4,7 @@ Public Const MSG_MAINWINDOW As Integer = MSG_EGTCAM5 'Public Const MSG_TOPCOMMANDBAR As Integer = MSG_EGTCAM5 + 100 'Public Const MSG_DRAWPANEL As Integer = MSG_EGTCAM5 + 200 - 'Public Const MSG_GRIDVIEWPANEL As Integer = MSG_EGTCAM5 + 250 + Public Const MSG_GRIDVIEWPANEL As Integer = MSG_EGTCAM5 + 250 'Public Const MSG_SIMULATION As Integer = MSG_EGTCAM5 + 300 'Public Const MSG_DRAWOPTION As Integer = MSG_EGTCAM5 + 350 'Public Const MSG_OPERATION As Integer = MSG_EGTCAM5 + 400 diff --git a/Converters/ItemsControlItemDimensionMultiplier.vb b/Converters/ItemsControlItemDimensionMultiplier.vb new file mode 100644 index 0000000..7b9e38f --- /dev/null +++ b/Converters/ItemsControlItemDimensionMultiplier.vb @@ -0,0 +1,14 @@ +Public Class ItemsControlItemDimensionMultiplier + Implements IValueConverter + + Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.Convert + Dim dValue As Double = CDbl(value) + Dim nParam As Integer = CInt(parameter) + Return dValue / nParam + End Function + + Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack + Throw New NotImplementedException + End Function + +End Class diff --git a/EgtCustomWindow.vb b/EgtCustomWindow.vb index a16e9f0..b92ca57 100644 --- a/EgtCustomWindow.vb +++ b/EgtCustomWindow.vb @@ -114,13 +114,13 @@ Public Class EgtCustomWindow End Property ' Proprietà che permette di impostare uno UserControl per aggiungere elementi alla TitleBar - Public Shared ReadOnly TitleUserControlProperty As DependencyProperty = DependencyProperty.Register("TitleUserControl", GetType(UserControl), GetType(EgtCustomWindow), New PropertyMetadata(Nothing)) - Public Property TitleUserControl() As UserControl + Public Shared ReadOnly TitlePanelProperty As DependencyProperty = DependencyProperty.Register("TitlePanel", GetType(Panel), GetType(EgtCustomWindow), New PropertyMetadata(Nothing)) + Public Property TitlePanel() As Panel Get - Return DirectCast(GetValue(TitleUserControlProperty), UserControl) + Return DirectCast(GetValue(TitlePanelProperty), Panel) End Get - Set(ByVal value As UserControl) - SetValue(TitleUserControlProperty, value) + Set(ByVal value As Panel) + SetValue(TitlePanelProperty, value) End Set End Property diff --git a/EgtFloating/EgtFloatingTray.vb b/EgtFloating/EgtFloatingTray.vb index 0ee78dd..5a38570 100644 --- a/EgtFloating/EgtFloatingTray.vb +++ b/EgtFloating/EgtFloatingTray.vb @@ -80,6 +80,8 @@ Namespace EgtFloating 'DA ABILITARE PER PERMETTERE DI SPOSTARE LE WINDOW TRAY NEL CASO VENGA SPOSTATA LA MAINWINDOW!!!!!!! AddHandler m_FloatingManager.ParentWindow.LocationChanged, AddressOf Me_LocationChanged AddHandler m_FloatingManager.ParentWindow.SizeChanged, AddressOf Me_DimensionChanged + ' eseguo il calcolo delle dimensioni all'avvio + Me_DimensionChanged() End Sub Friend Sub ShowTrayWindow() diff --git a/EgtWPFLib5.vbproj b/EgtWPFLib5.vbproj index 3b713ab..a2e26ab 100644 --- a/EgtWPFLib5.vbproj +++ b/EgtWPFLib5.vbproj @@ -87,6 +87,7 @@ + EgtOpenFileDialog.xaml @@ -98,25 +99,35 @@ - - EgtMachGroupPanelV.xaml + + + MachGroupPanelV.xaml - + NewMachGroupWndV.xaml - + MachiningDbWindowV.xaml + + SceneHostV.xaml + + SetUpWindowV.xaml + + + StatusBarV.xaml + + ToolDbWindowV.xaml @@ -150,10 +161,12 @@ + + VbMyResourcesResXFileCodeGenerator Resources.Designer.vb @@ -178,7 +191,7 @@ Designer MSBuild:Compile - + MSBuild:Compile Designer @@ -190,10 +203,18 @@ MSBuild:Compile Designer + + MSBuild:Compile + Designer + MSBuild:Compile Designer + + MSBuild:Compile + Designer + MSBuild:Compile Designer diff --git a/InstrumentPanel/InstrumentPanelV.xaml b/InstrumentPanel/InstrumentPanelV.xaml new file mode 100644 index 0000000..cdc375a --- /dev/null +++ b/InstrumentPanel/InstrumentPanelV.xaml @@ -0,0 +1,14 @@ + + + + + + + diff --git a/InstrumentPanel/InstrumentPanelV.xaml.vb b/InstrumentPanel/InstrumentPanelV.xaml.vb new file mode 100644 index 0000000..25cc2db --- /dev/null +++ b/InstrumentPanel/InstrumentPanelV.xaml.vb @@ -0,0 +1,3 @@ +Public Class InstrumentPanelV + +End Class diff --git a/InstrumentPanel/InstrumentPanelVM.vb b/InstrumentPanel/InstrumentPanelVM.vb new file mode 100644 index 0000000..5bd1ff6 --- /dev/null +++ b/InstrumentPanel/InstrumentPanelVM.vb @@ -0,0 +1,95 @@ +Imports EgtUILib + +Public Class InstrumentPanelVM + Inherits VMBase + +#Region "FIELDS & PROPERTIES" + + Private m_AnalyzeIsChecked As Boolean + Public Property AnalyzeIsChecked As Boolean + Get + Return m_AnalyzeIsChecked + End Get + Set(value As Boolean) + If value <> m_AnalyzeIsChecked Then + m_AnalyzeIsChecked = value + GetDistIsChecked = False + If value Then + LibMap.refSceneHostVM.MainScene.SetStatusAnalyze() + Else + LibMap.refSceneHostVM.MainScene.ResetStatusAnalyze() + End If + NotifyPropertyChanged("GetDistIsChecked") + NotifyPropertyChanged("AnalyzeIsChecked") + End If + End Set + End Property + + Private m_AnalyzeIsEnabled As Boolean + Public Property AnalyzeIsEnabled As Boolean + Get + Return m_AnalyzeIsEnabled + End Get + Set(value As Boolean) + If value <> m_AnalyzeIsEnabled Then + m_AnalyzeIsEnabled = value + NotifyPropertyChanged("AnalyzeIsEnabled") + End If + End Set + End Property + + Private m_GetDistIsChecked As Boolean + Public Property GetDistIsChecked As Boolean + Get + Return m_GetDistIsChecked + End Get + Set(value As Boolean) + If value <> m_GetDistIsChecked Then + m_GetDistIsChecked = value + AnalyzeIsChecked = False + If value Then + LibMap.refSceneHostVM.GetDistanceON() + Else + LibMap.refSceneHostVM.GetDistanceOFF() + LibMap.refSceneHostVM.MainScene.SetStatusNull() + LibMap.refStatusBarVM.ClearOutputMessage() + OnPostGetDistIsChecked() + End If + NotifyPropertyChanged("GetDistIsChecked") + NotifyPropertyChanged("AnalyzeIsChecked") + End If + End Set + End Property + + + Public Overridable Function OnPostGetDistIsChecked() As Boolean + Return True + End Function + + +#Region "ToolTip" + + Public ReadOnly Property AnalyzeToolTip As String + Get + Return EgtMsg(MSG_GRIDVIEWPANEL + 17) + End Get + End Property + Public ReadOnly Property GetDistToolTip As String + Get + Return EgtMsg(MSG_GRIDVIEWPANEL + 18) + End Get + End Property + +#End Region ' ToolTip + +#End Region ' FIELDS & PROPERTIES + +#Region "CONSTRUCTOR" + + Sub New() + + End Sub + +#End Region ' CONSTRUCTOR + +End Class \ No newline at end of file diff --git a/MachGroupPanel/EgtMachGroupPanelV.xaml b/MachGroupPanel/MachGroupPanelV.xaml similarity index 97% rename from MachGroupPanel/EgtMachGroupPanelV.xaml rename to MachGroupPanel/MachGroupPanelV.xaml index 55fcccf..73f0fb0 100644 --- a/MachGroupPanel/EgtMachGroupPanelV.xaml +++ b/MachGroupPanel/MachGroupPanelV.xaml @@ -3,7 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5" xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating" - Visibility="{Binding PanelVisibility}"> + Visibility="{Binding MachGroupPanel_Visibility}"> diff --git a/MachGroupPanel/EgtMachGroupPanelV.xaml.vb b/MachGroupPanel/MachGroupPanelV.xaml.vb similarity index 100% rename from MachGroupPanel/EgtMachGroupPanelV.xaml.vb rename to MachGroupPanel/MachGroupPanelV.xaml.vb diff --git a/MachGroupPanel/EgtMachGroupPanelVM.vb b/MachGroupPanel/MachGroupPanelVM.vb similarity index 92% rename from MachGroupPanel/EgtMachGroupPanelVM.vb rename to MachGroupPanel/MachGroupPanelVM.vb index 30289bf..25a0d6f 100644 --- a/MachGroupPanel/EgtMachGroupPanelVM.vb +++ b/MachGroupPanel/MachGroupPanelVM.vb @@ -3,7 +3,7 @@ Imports System.IO Imports EgtUILib Imports EgtWPFLib5 -Public Class EgtMachGroupPanelVM +Public Class MachGroupPanelVM Inherits VMBase #Region "FIELDS & PROPERTIES" @@ -53,13 +53,23 @@ Public Class EgtMachGroupPanelVM End Set End Property - Private m_PanelVisibility As Visibility - Public ReadOnly Property PanelVisibility As Visibility + Private m_MachGroupPanel_Visibility As Visibility + Public ReadOnly Property MachGroupPanel_Visibility As Visibility Get - Return m_PanelVisibility + Return m_MachGroupPanel_Visibility End Get End Property + Public Sub SetMachGroupPanelVisibility(IsVisible As Boolean) + If IsVisible Then + m_MachGroupPanel_Visibility = Visibility.Visible + Else + m_MachGroupPanel_Visibility = Visibility.Collapsed + End If + NotifyPropertyChanged("MachGroupPanel_Visibility") + End Sub + + ' Variabile che permette di abilitare/disabilitare i bottoni aggiungi e togli MachGroup Private m_IsEnabledAddRemove As Boolean Public Property IsEnabledAddRemove As Boolean @@ -89,8 +99,8 @@ Public Class EgtMachGroupPanelVM #Region "CONSTRUCTOR" Sub New() - - + ' Creo riferimento a questa classe in LibMap + LibMap.SetRefMachGroupPanelVM(Me) End Sub #End Region ' CONSTRUCTOR @@ -102,8 +112,7 @@ Public Class EgtMachGroupPanelVM Optional sBaseName As String = "MachGroup_1") As Boolean m_IsMultiMachGroup = IsMultiMachGroup ' se è a gruppo singolo, nascondo il panel - If Not m_IsMultiMachGroup Then m_PanelVisibility = Visibility.Collapsed - NotifyPropertyChanged("PanelVisibility") + If Not m_IsMultiMachGroup Then SetMachGroupPanelVisibility(False) ' Assegno nome base m_BaseName = sBaseName ' Recupero lista macchine diff --git a/SceneHost/SceneHostV.xaml b/SceneHost/SceneHostV.xaml new file mode 100644 index 0000000..8cbc723 --- /dev/null +++ b/SceneHost/SceneHostV.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/SceneHost/SceneHostV.xaml.vb b/SceneHost/SceneHostV.xaml.vb new file mode 100644 index 0000000..29c3f02 --- /dev/null +++ b/SceneHost/SceneHostV.xaml.vb @@ -0,0 +1,18 @@ +Imports System.Windows.Interop +Imports System.IO +Imports EgtUILib +Imports EgtWPFLib5 + +Public Class SceneHostV + + Private m_SceneHostVM As SceneHostVM + + Sub New() + ' This call is required by the designer. + InitializeComponent() + ' Assegno al riferimento locale al VM il VM preso dal DataContext + m_SceneHostVM = DirectCast(Me.DataContext, SceneHostVM) + m_SceneHostVM.SetMainScene(MainScene) + End Sub + +End Class diff --git a/SceneHost/SceneHostVM.vb b/SceneHost/SceneHostVM.vb new file mode 100644 index 0000000..264d601 --- /dev/null +++ b/SceneHost/SceneHostVM.vb @@ -0,0 +1,389 @@ +Imports System.IO +Imports EgtUILib +Imports EgtWPFLib5 + +Public Class SceneHostVM + Inherits VMBase + +#Region "FIELDS & PROPERTIES" + + Private m_MainScene As Scene + Public ReadOnly Property MainScene As Scene + Get + Return m_MainScene + End Get + End Property + + ' Scene controller + Private WithEvents m_MainController As New Controller + Public ReadOnly Property MainController As Controller + Get + Return m_MainController + End Get + End Property + +#End Region ' FIELDS & PROPERTIES + +#Region "CONSTRUCTOR" + + Sub New() + ' Creo riferimento a questa classe in LibMap + LibMap.SetRefSceneHostVM(Me) + End Sub + +#End Region ' CONSTRUCTOR + +#Region "METHODS" + + Public Sub SetMainScene(ViewMainScene As Scene) + m_MainScene = ViewMainScene + InitScene() + End Sub + + Public Overridable Sub InitScene() + End Sub + + Public Overridable Sub InitSceneEvents() + End Sub + +#End Region ' METHODS + +#Region "ProjectManager" + + Public Overridable Sub NewProject() + EgtSetCurrentContext(MainScene.GetCtx()) + Dim bOk As Boolean = m_MainController.NewProject() + End Sub + + Public Overridable Sub OpenProject(sFilePath As String) + EgtSetCurrentContext(MainScene.GetCtx()) + Dim bOk As Boolean = False + If String.IsNullOrEmpty(sFilePath) Then + ' Recupero cartella dell'ultimo progetto aperto + Dim sDir As String = m_MainController.GetCurrFile() + If String.IsNullOrWhiteSpace(sDir) Then + GetMainPrivateProfileString(S_MRUFILES, K_FILE & "1", "", sDir) + End If + If Not String.IsNullOrWhiteSpace(sDir) Then + sDir = Path.GetDirectoryName(sDir) + End If + bOk = m_MainController.OpenProject(sDir) + Else + bOk = m_MainController.OpenProject(sFilePath, False) + End If + End Sub + + Public Overridable Sub SaveProject() + EgtSetCurrentContext(MainScene.GetCtx()) + Dim nType As NGE = DirectCast(GetMainPrivateProfileInt(S_GEOMDB, K_SAVETYPE, NGE.CMPTEXT), NGE) + Dim sFile As String = m_MainController.GetCurrFile() + If Not String.IsNullOrWhiteSpace(sFile) Then + m_MainController.SaveProject(nType) + Else + SaveAsProject() + End If + End Sub + + Public Overridable Sub SaveAsProject() + EgtSetCurrentContext(MainScene.GetCtx()) + Dim nType As NGE = DirectCast(GetMainPrivateProfileInt(S_GEOMDB, K_SAVETYPE, NGE.CMPTEXT), NGE) + Dim sFile As String = m_MainController.GetCurrFile() + If String.IsNullOrWhiteSpace(sFile) Then + GetMainPrivateProfileString(S_MRUFILES, K_FILE & "1", "", sFile) + If Not String.IsNullOrWhiteSpace(sFile) Then + sFile = Path.GetDirectoryName(sFile) + End If + sFile.TrimEnd("\"c) + 'sFile += "\New" & m_nInstance.ToString() & ".nge" 'KK? + End If + m_MainController.SaveAsProject(sFile, nType) + End Sub + + Public Overridable Sub InsertProject() + Dim sDir As String = String.Empty + GetMainPrivateProfileString(S_MRUFILES, K_FILE & "1", "", sDir) + If Not String.IsNullOrWhiteSpace(sDir) Then + sDir = Path.GetDirectoryName(sDir) + End If + sDir.TrimEnd("\"c) + m_MainController.InsertProject(sDir) + End Sub + + Public Overridable Sub ImportProject() + Dim sDir As String = String.Empty + GetMainPrivateProfileString(S_MRUIMPORT, K_FILE & "1", "", sDir) + If Not String.IsNullOrWhiteSpace(sDir) Then + sDir = Path.GetDirectoryName(sDir) + End If + sDir.TrimEnd("\"c) + m_MainController.ImportProject(sDir) + End Sub + + Public Overridable Sub ExportProject() + EgtSetCurrentContext(MainScene.GetCtx()) + m_MainController.ExportProject(Path.ChangeExtension(m_MainController.GetCurrFile(), "dxf")) + End Sub + + Public Overridable Sub ExecScript(sFilePath As String) + If String.IsNullOrEmpty(sFilePath) Then + Dim sDir As String = String.Empty + GetMainPrivateProfileString(S_MRUSCRIPTS, K_FILE & "1", "", sDir) + If Not String.IsNullOrWhiteSpace(sDir) Then + sDir = Path.GetDirectoryName(sDir) + End If + sDir.TrimEnd("\"c) + m_MainController.Exec(sDir) + Else + m_MainController.Exec(sFilePath, False) + End If + End Sub + +#End Region ' ProjectManager + +#Region "ShowMode" + + Public Sub ShowMode(nType As SM) + Select Case nType + Case SM.WIREFRAME + MainScene.WireFrame() + Case SM.HIDDENLINE + MainScene.HiddenLine() + Case SM.SHADING + MainScene.Shading() + End Select + End Sub + +#End Region ' ShowMode + +#Region "Zoom" + + Public Sub ZoomMode(nType As ZM) + Select Case nType + Case ZM.ALL + MainScene.ZoomAll() + Case ZM.IN_ + MainScene.ZoomIn() + Case ZM.OUT + MainScene.ZoomOut() + End Select + End Sub + +#End Region ' Zoom + +#Region "ViewMode" + + Public Sub ViewMode(nType As VT) + Select Case nType + Case VT.TOP + MainScene.TopView() + Case VT.FRONT + MainScene.FrontView() + Case VT.RIGHT + MainScene.RightView() + Case VT.BACK + MainScene.BackView() + Case VT.LEFT + MainScene.LeftView() + Case VT.BOTTOM + MainScene.BottomView() + Case VT.ISO_SW + MainScene.IsoViewSW() + Case VT.ISO_SE + MainScene.IsoViewSE() + Case VT.ISO_NE + MainScene.IsoViewNE() + Case VT.ISO_NW + MainScene.IsoViewNW() + End Select + End Sub + +#End Region ' ViewMode + +#Region "GetDistance" + + Public Sub GetDistanceON() + MainScene.SetStatusGetDistance() + End Sub + + Public Sub GetDistanceOFF() + MainScene.ResetStatusGetDistance() + End Sub + +#End Region + + '#Region "EVENTS" + + ' Private Sub OnNewProject(sender As Object, bOk As Boolean) Handles m_Controller.OnNewProject + ' OmagOFFICEMap.refMainWindowVM.Title = " New - OmagOFFICE" + ' End Sub + + ' Private Sub OnOpenProject(sender As Object, sFile As String, bOk As Boolean) Handles m_Controller.OnOpenProject + ' OmagOFFICEMap.refMainWindowVM.Title = sFile & " - OmagOFFICE" + ' WriteMainPrivateProfileString(S_GENERAL, K_LASTPROJ, sFile) + ' If bOk Then + ' OmagOFFICEMap.refTopCommandBarVM.m_MruFiles.Add(sFile) + ' Else + ' OmagOFFICEMap.refTopCommandBarVM.m_MruFiles.Remove(sFile) + ' Dim sMsg As String = EgtMsg(10003) & " '" & sFile & "'" 'Error opening file + ' MessageBox.Show(sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) 'Error + ' End If + ' End Sub + + ' Private Sub OnSavingProject(ByVal sender As Object, sFile As String) Handles m_Controller.OnSavingProject + ' ' Recupero tutti i file di texture associabili ai gruppi di lavoro del progetto + ' Dim sDirToSearch As String = Path.GetDirectoryName(sFile) + ' Dim sFileToSearch As String = Path.GetFileNameWithoutExtension(sFile) & "." & PHOTO_NAME & "*" + ' Dim vsTxrFile As New List(Of String) + ' For Each sTxrFile In My.Computer.FileSystem.GetFiles(sDirToSearch, FileIO.SearchOption.SearchTopLevelOnly, sFileToSearch) + ' vsTxrFile.Add(sTxrFile) + ' Next + ' ' Rinomino path di eventuali fotografie + ' Dim nPhotoId As Integer = EgtGetFirstInGroup(EgtGetFirstNameInGroup(GDB_ID.ROOT, PHOTO_GRP)) + ' While nPhotoId <> GDB_ID.NULL + ' ' Path originale + ' Dim sPhoto As String = String.Empty + ' If EgtGetPhotoPath(nPhotoId, sPhoto) Then + ' ' Nome della foto + ' Dim sName As String = String.Empty + ' EgtGetName(nPhotoId, sName) + ' ' Nuova path + ' Dim sNewPhoto As String = Path.GetDirectoryName(sFile) & "\" & + ' Path.GetFileNameWithoutExtension(sFile) & "." & sName & + ' Path.GetExtension(sPhoto) + ' ' Se diverse, eseguo copia + ' If String.Compare(sPhoto, sNewPhoto, True) <> 0 Then + ' Try + ' ' Eseguo copia + ' File.Copy(sPhoto, sNewPhoto, True) + ' ' Notifico a foto il cambio di path + ' EgtChangePhotoPath(nPhotoId, sNewPhoto) + ' ' Eventuale notifica a VeinMatching del cambio di path + ' VeinMatching.ChangePhotoPath(sPhoto, sNewPhoto) + ' Catch ex As Exception + ' End Try + ' End If + ' ' Tolgo da lista file texture associabili, se presente + ' vsTxrFile.Remove(sNewPhoto) + ' End If + ' ' passo alla successiva + ' nPhotoId = EgtGetNext(nPhotoId) + ' End While + ' ' Se rimasti file associabili, li cancello + ' For Each sTxrFile In vsTxrFile + ' Try + ' My.Computer.FileSystem.DeleteFile(sTxrFile) + ' Catch + ' End Try + ' Next + ' End Sub + + ' Private Sub OnSavedProject(ByVal sender As Object, ByVal sFile As String, ByVal bOk As Boolean) Handles m_Controller.OnSavedProject + ' ' Se salvataggio non riuscito, esco subito + ' If Not bOk Then + ' OmagOFFICEMap.refTopCommandBarVM.m_MruFiles.Remove(sFile) + ' Dim sMsg As String = EgtMsg(10004) & " '" & sFile & "'" 'Error saving file + ' MessageBox.Show(sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error + ' Return + ' End If + ' ' Eventuale salvataggio VM + ' Dim sVmFile As String = Path.ChangeExtension(sFile, ".vme") + ' VeinMatching.Save(sVmFile) + ' ' Eventuale salvataggio CSV + ' CsvM.SaveCsvPartList() + ' ' Aggiornamento titolo + ' OmagOFFICEMap.refMainWindowVM.Title = sFile & " - OmagOFFICE" + ' ' Riabilito visualizzazione pezzi in parcheggio + ' EstCalc.ShowParkedParts() + ' ' Inserisco nome in MRU + ' OmagOFFICEMap.refTopCommandBarVM.m_MruFiles.Add(sFile) + ' ' Salvo nome ultimo file + ' WriteMainPrivateProfileString(S_GENERAL, K_LASTPROJ, sFile) + ' End Sub + + ' Private Sub OnMouseDownScene(sender As Object, e As Windows.Forms.MouseEventArgs) Handles OmagOFFICEScene.OnMouseDownScene + ' ' Si può selezionare solo con il tasto sinistro e se stato NULL + ' If e.Button <> Windows.Forms.MouseButtons.Left Or Not OmagOFFICEScene.IsStatusNull() Then + ' Return + ' End If + ' ' Chiamo l'opportuno gestore + ' Select Case OmagOFFICEMap.refOptionPanelVM.SelItem + ' Case OptionPanelVM.Tabs.RAWPART + ' OmagOFFICEMap.refRawPartTabVM.OnMouseDownScene(sender, e) + ' Case OptionPanelVM.Tabs.NESTING + ' OmagOFFICEMap.refNestingTabVM.OnMouseDownScene(sender, e) + ' Case OptionPanelVM.Tabs.MACHINING + ' OmagOFFICEMap.refMachiningTabVM.OnMouseDownScene(sender, e) + ' Case OptionPanelVM.Tabs.SIMUL + ' End Select + ' End Sub + + ' Private Sub OnMouseMoveScene(sender As Object, e As Windows.Forms.MouseEventArgs) Handles OmagOFFICEScene.OnMouseMoveScene + ' ' Chiamo l'opportuno gestore + ' Select Case OmagOFFICEMap.refOptionPanelVM.SelItem + ' Case OptionPanelVM.Tabs.RAWPART + ' OmagOFFICEMap.refRawPartTabVM.OnMouseMoveScene(sender, e) + ' Case OptionPanelVM.Tabs.NESTING + ' OmagOFFICEMap.refNestingTabVM.OnMouseMoveScene(sender, e) + ' Case OptionPanelVM.Tabs.MACHINING + ' Case OptionPanelVM.Tabs.SIMUL + ' End Select + ' End Sub + + ' Private Sub OnMouseUpScene(sender As Object, e As Windows.Forms.MouseEventArgs) Handles OmagOFFICEScene.OnMouseUpScene + ' ' Chiamo l'opportuno gestore + ' Select Case OmagOFFICEMap.refOptionPanelVM.SelItem + ' Case OptionPanelVM.Tabs.RAWPART + ' OmagOFFICEMap.refRawPartTabVM.OnMouseUpScene(sender, e) + ' Case OptionPanelVM.Tabs.NESTING + ' OmagOFFICEMap.refNestingTabVM.OnMouseUpScene(sender, e) + ' Case OptionPanelVM.Tabs.MACHINING + ' Case OptionPanelVM.Tabs.SIMUL + ' End Select + ' End Sub + + ' Private Sub OnCursorPos(ByVal sender As Object, ByVal sCursorPos As String) Handles OmagOFFICEScene.OnCursorPos + ' OmagOFFICEMap.refStatusBarVM.SetCurrPos(sCursorPos) + ' End Sub + + ' Private Sub OnShowDistance(ByVal sender As Object, ByVal sDistance As String) Handles OmagOFFICEScene.OnShowDistance + ' OmagOFFICEMap.refStatusBarVM.SetOutputMessage(sDistance) + ' End Sub + + ' Private Sub OnChangedSnapPointType(ByVal sender As Object, ByVal nSpType As SP, ByVal bUser As Boolean) Handles OmagOFFICEScene.OnChangedSnapPointType + ' Dim BtnColor As Brush + ' If bUser Then + ' BtnColor = New SolidColorBrush(SystemColors.ControlColor) + ' Else + ' BtnColor = Brushes.Bisque + ' End If + ' Select Case nSpType + ' Case SP.PT_SKETCH + ' OmagOFFICEMap.refStatusBarVM.SetSnapPointType(EgtMsg(1102), BtnColor) 'Sketch Point + ' Case SP.PT_GRID + ' OmagOFFICEMap.refStatusBarVM.SetSnapPointType(EgtMsg(1104), BtnColor) 'Grid Point + ' Case SP.PT_END + ' OmagOFFICEMap.refStatusBarVM.SetSnapPointType(EgtMsg(1106), BtnColor) 'End Point + ' Case SP.PT_MID + ' OmagOFFICEMap.refStatusBarVM.SetSnapPointType(EgtMsg(1108), BtnColor) 'Mid Point + ' Case SP.CENTER + ' OmagOFFICEMap.refStatusBarVM.SetSnapPointType(EgtMsg(1110), BtnColor) 'Center + ' Case SP.CENTROID + ' OmagOFFICEMap.refStatusBarVM.SetSnapPointType(EgtMsg(1112), BtnColor) 'Centroid + ' Case SP.PT_NEAR + ' OmagOFFICEMap.refStatusBarVM.SetSnapPointType(EgtMsg(1114), BtnColor) 'Near Point + ' Case SP.PT_INTERS + ' OmagOFFICEMap.refStatusBarVM.SetSnapPointType(EgtMsg(1116), BtnColor) 'Inters Point + ' Case SP.PT_TANGENT + ' OmagOFFICEMap.refStatusBarVM.SetSnapPointType(EgtMsg(1118), BtnColor) 'Tang Point + ' Case SP.PT_PERPENDICULAR + ' OmagOFFICEMap.refStatusBarVM.SetSnapPointType(EgtMsg(1120), BtnColor) 'Perp Point + ' Case SP.PT_MINDIST + ' OmagOFFICEMap.refStatusBarVM.SetSnapPointType(EgtMsg(1122), BtnColor) 'MinDist Point + ' Case Else + ' OmagOFFICEMap.refStatusBarVM.SetSnapPointType("---", BtnColor) + ' End Select + ' End Sub + + '#End Region ' EVENTS + +End Class diff --git a/ShowPanel/ShowPanelV.xaml b/ShowPanel/ShowPanelV.xaml new file mode 100644 index 0000000..aebedd1 --- /dev/null +++ b/ShowPanel/ShowPanelV.xaml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + diff --git a/ShowPanel/ShowPanelV.xaml.vb b/ShowPanel/ShowPanelV.xaml.vb new file mode 100644 index 0000000..25dc4d5 --- /dev/null +++ b/ShowPanel/ShowPanelV.xaml.vb @@ -0,0 +1,3 @@ +Public Class ShowPanelV + +End Class diff --git a/ShowPanel/ShowPanelVM.vb b/ShowPanel/ShowPanelVM.vb new file mode 100644 index 0000000..51fa0e7 --- /dev/null +++ b/ShowPanel/ShowPanelVM.vb @@ -0,0 +1,127 @@ +Imports EgtUILib + +Public Class ShowPanelVM + Inherits VMBase + +#Region "FIELDS & PROPERTIES" + + ' Definizione comandi + Private m_cmdCurveDir As ICommand + +#Region "ToolTip" + + Public ReadOnly Property RenderingWFToolTip As String + Get + Return EgtMsg(MSG_GRIDVIEWPANEL + 1) + End Get + End Property + + Public ReadOnly Property RenderingHLToolTip As String + Get + Return EgtMsg(MSG_GRIDVIEWPANEL + 2) + End Get + End Property + + Public ReadOnly Property RenderingSHToolTip As String + Get + Return EgtMsg(MSG_GRIDVIEWPANEL + 3) + End Get + End Property + + Public ReadOnly Property CurveDirToolTip As String + Get + Return EgtMsg(MSG_GRIDVIEWPANEL + 16) + End Get + End Property + +#End Region + + Private m_WireframeIsChecked As Boolean + Public Property WireframeIsChecked As Boolean + Get + Return m_WireframeIsChecked + End Get + Set(value As Boolean) + If value <> m_WireframeIsChecked Then + m_WireframeIsChecked = value + If value Then + LibMap.refSceneHostVM.ShowMode(SM.WIREFRAME) + NotifyPropertyChanged("WireframeIsChecked") + End If + End If + End Set + End Property + + Private m_HiddenLineIsChecked As Boolean + Public Property HiddenLineIsChecked As Boolean + Get + Return m_HiddenLineIsChecked + End Get + Set(value As Boolean) + If value <> m_HiddenLineIsChecked Then + m_HiddenLineIsChecked = value + If value Then + LibMap.refSceneHostVM.ShowMode(SM.HIDDENLINE) + NotifyPropertyChanged("HiddenLineIsChecked") + End If + End If + End Set + End Property + + Private m_ShadingIsChecked As Boolean + Public Property ShadingIsChecked As Boolean + Get + Return m_ShadingIsChecked + End Get + Set(value As Boolean) + If value <> m_ShadingIsChecked Then + m_ShadingIsChecked = value + If value Then + LibMap.refSceneHostVM.ShowMode(SM.SHADING) + NotifyPropertyChanged("ShadingIsChecked") + End If + End If + End Set + End Property + + Private m_CurveDirIsChecked As Boolean + Public Property CurveDirIsChecked As Boolean + Get + Return m_CurveDirIsChecked + End Get + Set(value As Boolean) + If value <> m_CurveDirIsChecked Then + m_CurveDirIsChecked = value + EgtSetShowCurveDirection(value) + NotifyPropertyChanged("CurveDirIsChecked") + End If + End Set + End Property + +#End Region ' FIELDS & PROPERTIES + +#Region "CONSTRUCTOR" + + Sub New() + ' Creo riferimento a questa classe in OmagOFFICEMap + LibMap.SetRefShowPanelVM(Me) + End Sub + +#End Region ' CONSTRUCTOR + +#Region "METHODS" + + Public Sub SetShowMode(nShowModeType As SM) + Select Case nShowModeType + Case SM.WIREFRAME + WireframeIsChecked = True + Case SM.HIDDENLINE + HiddenLineIsChecked = True + Case SM.SHADING + ShadingIsChecked = True + End Select + End Sub + +#End Region + +End Class \ No newline at end of file diff --git a/StatusBar/StatusBarV.xaml b/StatusBar/StatusBarV.xaml new file mode 100644 index 0000000..57f6b1b --- /dev/null +++ b/StatusBar/StatusBarV.xaml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/Utility/IdNameStruct.vb b/Utility/IdNameStruct.vb index 1952c90..f5e7ac5 100644 --- a/Utility/IdNameStruct.vb +++ b/Utility/IdNameStruct.vb @@ -31,14 +31,14 @@ Public Structure IdNameStruct Return Name End Function - Friend Shared Function IndFromId(Id As Integer, List As ObservableCollection(Of IdNameStruct)) As Integer + Public Shared Function IndFromId(Id As Integer, List As ObservableCollection(Of IdNameStruct)) As Integer For i = 0 To List.Count - 1 If List(i).Id = Id Then Return i Next Return 0 End Function - Friend Shared Function IdFromInd(Ind As Integer, List As ObservableCollection(Of IdNameStruct)) As Integer + Public Shared Function IdFromInd(Ind As Integer, List As ObservableCollection(Of IdNameStruct)) As Integer Return List(Ind).Id End Function diff --git a/Utility/LibMap.vb b/Utility/LibMap.vb new file mode 100644 index 0000000..8334d59 --- /dev/null +++ b/Utility/LibMap.vb @@ -0,0 +1,222 @@ +Imports EgtWPFLib5 + +Public Module LibMap + + 'Private m_refMainWindowVM As MainWindowVM + Private m_refStatusBarVM As StatusBarVM + 'Private m_refTopCommandBarVM As TopCommandBarVM + 'Private m_refProjectVM As ProjectVM + Private m_refSceneHostVM As SceneHostVM + Private m_refShowPanelVM As ShowPanelVM + 'Private m_refMachinePanelVM As MachinePanelVM + Private m_refMachGroupPanelVM As MachGroupPanelVM + 'Private m_refOptionPanelVM As OptionPanelVM + 'Private m_refRawPartTabVM As RawPartTabVM + 'Private m_refNestingTabVM As NestingTabVM + 'Private m_refMachiningTabVM As MachiningTabVM + 'Private m_refSplitModeVM As SplitModeVM + 'Private m_refMoveRawModeVM As MoveRawModeVM + 'Private m_refSimulTabVM As SimulTabVM + +#Region "Get" + + 'Public ReadOnly Property refMainWindowVM As MainWindowVM + ' Get + ' Return m_refMainWindowVM + ' End Get + 'End Property + + Public ReadOnly Property refStatusBarVM As StatusBarVM + Get + Return m_refStatusBarVM + End Get + End Property + + 'Public ReadOnly Property refTopCommandBarVM As TopCommandBarVM + ' Get + ' Return m_refTopCommandBarVM + ' End Get + 'End Property + + 'Public ReadOnly Property refProjectVM As ProjectVM + ' Get + ' Return m_refProjectVM + ' End Get + 'End Property + + Public ReadOnly Property refSceneHostVM As SceneHostVM + Get + Return m_refSceneHostVM + End Get + End Property + + Public ReadOnly Property refShowPanelVM As ShowPanelVM + Get + Return m_refShowPanelVM + End Get + End Property + + 'Public ReadOnly Property refVeinMatchPanelVM As VeinMatchPanelVM + ' Get + ' Return m_refVeinMatchPanelVM + ' End Get + 'End Property + + 'Public ReadOnly Property refMachinePanelVM As MachinePanelVM + ' Get + ' Return m_refMachinePanelVM + ' End Get + 'End Property + + Public ReadOnly Property refMachGroupPanelVM As MachGroupPanelVM + Get + Return m_refMachGroupPanelVM + End Get + End Property + + 'Public ReadOnly Property refOptionPanelVM As OptionPanelVM + ' Get + ' Return m_refOptionPanelVM + ' End Get + 'End Property + + 'Public ReadOnly Property refRawPartTabVM As RawPartTabVM + ' Get + ' Return m_refRawPartTabVM + ' End Get + 'End Property + + 'Public ReadOnly Property refNestingTabVM As NestingTabVM + ' Get + ' Return m_refNestingTabVM + ' End Get + 'End Property + + 'Public ReadOnly Property refMachiningTabVM As MachiningTabVM + ' Get + ' Return m_refMachiningTabVM + ' End Get + 'End Property + + 'Public ReadOnly Property refSplitModeVM As SplitModeVM + ' Get + ' Return m_refSplitModeVM + ' End Get + 'End Property + + 'Public ReadOnly Property refMoveRawModeVM As MoveRawModeVM + ' Get + ' Return m_refMoveRawModeVM + ' End Get + 'End Property + + 'Public ReadOnly Property refSimulTabVM As SimulTabVM + ' Get + ' Return m_refSimulTabVM + ' End Get + 'End Property + +#End Region ' Get + +#Region "Set" + + Public Function SetRefStatusBarVM(StatusBarVM As StatusBarVM) As Boolean + m_refStatusBarVM = StatusBarVM + Return Not IsNothing(m_refStatusBarVM) + End Function + + 'Friend Function SetRefTopCommandBarVM(TopCommandBarVM As TopCommandBarVM) As Boolean + ' m_refTopCommandBarVM = TopCommandBarVM + ' Return Not IsNothing(m_refTopCommandBarVM) + 'End Function + + 'Friend Function SetRefProjectVM(ProjectVM As ProjectVM) As Boolean + ' m_refProjectVM = ProjectVM + ' Return Not IsNothing(m_refProjectVM) + 'End Function + + Public Function SetRefSceneHostVM(SceneHostVM As SceneHostVM) As Boolean + m_refSceneHostVM = SceneHostVM + Return Not IsNothing(m_refSceneHostVM) + End Function + + Public Function SetRefShowPanelVM(ShowPanelVM As ShowPanelVM) As Boolean + m_refShowPanelVM = ShowPanelVM + Return Not IsNothing(m_refShowPanelVM) + End Function + + 'Friend Function SetRefVeinMatchPanelVM(VeinMatchPanelVM As VeinMatchPanelVM) As Boolean + ' m_refVeinMatchPanelVM = VeinMatchPanelVM + ' Return Not IsNothing(m_refVeinMatchPanelVM) + 'End Function + + 'Friend Function SetRefMachinePanelVM(MachinePanelVM As MachinePanelVM) As Boolean + ' m_refMachinePanelVM = MachinePanelVM + ' Return Not IsNothing(m_refMachinePanelVM) + 'End Function + + Public Function SetRefMachGroupPanelVM(MachGroupPanelVM As MachGroupPanelVM) As Boolean + m_refMachGroupPanelVM = MachGroupPanelVM + Return Not IsNothing(m_refMachGroupPanelVM) + End Function + + 'Friend Function SetRefOptionPanelVM(OptionPanelVM As OptionPanelVM) As Boolean + ' m_refOptionPanelVM = OptionPanelVM + ' Return Not IsNothing(m_refOptionPanelVM) + 'End Function + + 'Friend Function SetRefRawPartTabVM(RawPartTabVM As RawPartTabVM) As Boolean + ' m_refRawPartTabVM = RawPartTabVM + ' Return Not IsNothing(m_refRawPartTabVM) + 'End Function + + 'Friend Function SetRefNestingTabVM(NestingTabVM As NestingTabVM) As Boolean + ' m_refNestingTabVM = NestingTabVM + ' Return Not IsNothing(m_refNestingTabVM) + 'End Function + + 'Friend Function SetRefMachiningTabVM(MachiningTabVM As MachiningTabVM) As Boolean + ' m_refMachiningTabVM = MachiningTabVM + ' Return Not IsNothing(m_refMachiningTabVM) + 'End Function + + 'Friend Function SetRefSplitModeVM(SplitModeVM As SplitModeVM) As Boolean + ' m_refSplitModeVM = SplitModeVM + ' Return Not IsNothing(m_refSplitModeVM) + 'End Function + + 'Friend Function SetRefMoveRawModeVM(MoveRawModeVM As MoveRawModeVM) As Boolean + ' m_refMoveRawModeVM = MoveRawModeVM + ' Return Not IsNothing(m_refMoveRawModeVM) + 'End Function + + 'Friend Function SetRefSimulTabVM(SimulTabVM As SimulTabVM) As Boolean + ' m_refSimulTabVM = SimulTabVM + ' Return Not IsNothing(m_refSimulTabVM) + 'End Function + +#End Region ' Set + +#Region "Init" + + 'Friend Function BeginInit(MainWindowVM As MainWindowVM) As Boolean + ' m_refMainWindowVM = MainWindowVM + ' Return Not IsNothing(m_refMainWindowVM) + 'End Function + + Public Function EndInit() As Boolean + ' Verifico se tutti i pezzi necessari sono stati caricati + Return Not IsNothing(m_refSceneHostVM) AndAlso Not IsNothing(m_refShowPanelVM) AndAlso + Not IsNothing(m_refMachGroupPanelVM) + 'Not IsNothing(m_refMainWindowVM) AndAlso Not IsNothing(m_refProjectVM) AndAlso + 'Not IsNothing(m_refStatusBarVM) AndAlso Not IsNothing(m_refTopCommandBarVM) AndAlso + 'Not IsNothing(m_refVeinMatchPanelVM) AndAlso + 'Not IsNothing(m_refMachinePanelVM) AndAlso + 'Not IsNothing(m_refOptionPanelVM) AndAlso Not IsNothing(m_refRawPartTabVM) AndAlso + 'Not IsNothing(m_refNestingTabVM) AndAlso Not IsNothing(m_refSimulTabVM) AndAlso + 'Not IsNothing(m_refMachiningTabVM) + End Function + +#End Region ' Init + +End Module diff --git a/Machine.vb b/Utility/Machine.vb similarity index 88% rename from Machine.vb rename to Utility/Machine.vb index 115db90..5c80b2b 100644 --- a/Machine.vb +++ b/Utility/Machine.vb @@ -38,7 +38,7 @@ Public Class Machine End If End Sub - Public Shared Function MachineListInit(sMachinesRootDir As String, MachineList As List(Of Machine)) As Boolean + Public Shared Function MachineListInit(sMachinesRootDir As String, MachineList As IList(Of Machine)) As Boolean ' Se direttorio base macchine non definito o non esiste, ritorno If String.IsNullOrWhiteSpace(sMachinesRootDir) OrElse Not Directory.Exists(sMachinesRootDir) Then @@ -56,7 +56,7 @@ Public Class Machine Return True End Function - Public Shared Function SearchMachine(sName As String, MachineList As List(Of Machine), ByRef FoundedMachine As Machine) As Boolean + Public Shared Function SearchMachine(sName As String, MachineList As IList(Of Machine), ByRef FoundedMachine As Machine) As Boolean For Each Machine In MachineList If Machine.Name = sName Then FoundedMachine = Machine @@ -67,7 +67,7 @@ Public Class Machine Return False End Function - Public Shared Function SearchMachineIni(sName As String, MachineList As List(Of Machine), ByRef FoundedIni As String) As Boolean + Public Shared Function SearchMachineIni(sName As String, MachineList As IList(Of Machine), ByRef FoundedIni As String) As Boolean For Each Machine In MachineList If Machine.Name = sName Then FoundedIni = Machine.IniPath @@ -78,7 +78,7 @@ Public Class Machine Return False End Function - Public Shared Function ExistsMachine(sName As String, MachineList As List(Of Machine)) As Boolean + Public Shared Function ExistsMachine(sName As String, MachineList As IList(Of Machine)) As Boolean For Each Machine In MachineList If Machine.Name = sName Then Return True diff --git a/Utility/StringConversion.vb b/Utility/StringConversion.vb index b1a8310..a895b39 100644 --- a/Utility/StringConversion.vb +++ b/Utility/StringConversion.vb @@ -1,9 +1,9 @@ Imports System.Globalization Imports EgtUILib -Module StringConversion +Public Module StringConversion - Friend Function DoubleToString(ByVal dVal As Double, ByVal nNumDec As Integer) As String + Public Function DoubleToString(ByVal dVal As Double, ByVal nNumDec As Integer) As String Dim sFormat As String = "F" + Math.Abs(nNumDec).ToString() Dim sVal As String = dVal.ToString(sFormat, CultureInfo.InvariantCulture) If nNumDec > 0 Then @@ -13,15 +13,15 @@ Module StringConversion End If End Function - Friend Function StringToDouble(ByVal sVal As String, ByRef dVal As Double) As Boolean + Public Function StringToDouble(ByVal sVal As String, ByRef dVal As Double) As Boolean Return EgtLuaEvalNumExpr(sVal, dVal) End Function - Friend Function LenToString(ByVal dVal As Double, ByVal nNumDec As Integer) As String + Public Function LenToString(ByVal dVal As Double, ByVal nNumDec As Integer) As String Return DoubleToString(EgtToUiUnits(dVal), nNumDec) End Function - Friend Function StringToLen(ByVal sVal As String, ByRef dVal As Double) As Boolean + Public Function StringToLen(ByVal sVal As String, ByRef dVal As Double) As Boolean If EgtLuaEvalNumExpr(sVal, dVal) Then dVal = EgtFromUiUnits(dVal) Return True diff --git a/ViewPanel/ViewPanelV.xaml b/ViewPanel/ViewPanelV.xaml new file mode 100644 index 0000000..c5bc418 --- /dev/null +++ b/ViewPanel/ViewPanelV.xaml @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/ViewPanel/ViewPanelV.xaml.vb b/ViewPanel/ViewPanelV.xaml.vb new file mode 100644 index 0000000..0fdf160 --- /dev/null +++ b/ViewPanel/ViewPanelV.xaml.vb @@ -0,0 +1,3 @@ +Public Class GridViewPanelV + +End Class diff --git a/ViewPanel/ViewPanelVM.vb b/ViewPanel/ViewPanelVM.vb new file mode 100644 index 0000000..5c3ac9c --- /dev/null +++ b/ViewPanel/ViewPanelVM.vb @@ -0,0 +1,410 @@ +Imports EgtUILib + +Public Class ViewPanelVM + +#Region "FIELDS & PROPERTIES" + + ' Definizione comandi + Private m_cmdZoomAll As ICommand + Private m_cmdZoomIn As ICommand + Private m_cmdZoomOut As ICommand + Private m_cmdTopView As ICommand + Private m_cmdFrontView As ICommand + Private m_cmdLeftView As ICommand + Private m_cmdBackView As ICommand + Private m_cmdRightView As ICommand + Private m_cmdIsoViewSE As ICommand + Private m_cmdIsoViewSW As ICommand + Private m_cmdIsoViewNE As ICommand + Private m_cmdIsoViewNW As ICommand + Private m_cmdViewToCPlane As ICommand + +#Region "ToolTip" + + Public ReadOnly Property ZoomAllToolTip As String + Get + Return EgtMsg(MSG_GRIDVIEWPANEL + 4) + End Get + End Property + + Public ReadOnly Property ZoomInToolTip As String + Get + Return EgtMsg(MSG_GRIDVIEWPANEL + 5) + End Get + End Property + + Public ReadOnly Property ZoomOutToolTip As String + Get + Return EgtMsg(MSG_GRIDVIEWPANEL + 6) + End Get + End Property + + Public ReadOnly Property LookFromTopToolTip As String + Get + Return EgtMsg(MSG_GRIDVIEWPANEL + 7) + End Get + End Property + + Public ReadOnly Property LookFromFrontToolTip As String + Get + Return EgtMsg(MSG_GRIDVIEWPANEL + 8) + End Get + End Property + + Public ReadOnly Property LookFromLeftToolTip As String + Get + Return EgtMsg(MSG_GRIDVIEWPANEL + 9) + End Get + End Property + + Public ReadOnly Property LookFromBackToolTip As String + Get + Return EgtMsg(MSG_GRIDVIEWPANEL + 10) + End Get + End Property + + Public ReadOnly Property LookFromRightToolTip As String + Get + Return EgtMsg(MSG_GRIDVIEWPANEL + 11) + End Get + End Property + + Public ReadOnly Property LookFromIso_SEToolTip As String + Get + Return EgtMsg(MSG_GRIDVIEWPANEL + 13) + End Get + End Property + + Public ReadOnly Property LookFromIso_SWToolTip As String + Get + Return EgtMsg(MSG_GRIDVIEWPANEL + 12) + End Get + End Property + + Public ReadOnly Property LookFromIso_NEToolTip As String + Get + Return EgtMsg(MSG_GRIDVIEWPANEL + 14) + End Get + End Property + + Public ReadOnly Property LookFromIso_NWToolTip As String + Get + Return EgtMsg(MSG_GRIDVIEWPANEL + 15) + End Get + End Property + + Public ReadOnly Property ViewToCPlaneToolTip As String + Get + Return EgtMsg(MSG_GRIDVIEWPANEL + 32) + End Get + End Property + +#End Region ' ToolTip + +#End Region ' FIELDS & PROPERTIES + +#Region "COMMANDS" + +#Region "ZoomAllCommand" + + ''' + ''' Returns a command that do ZoomAll. + ''' + Public ReadOnly Property ZoomAllCommand As ICommand + Get + If m_cmdZoomAll Is Nothing Then + m_cmdZoomAll = New Command(AddressOf ZoomAll) + End If + Return m_cmdZoomAll + End Get + End Property + + ''' + ''' Execute the ZoomAll. This method is invoked by the ZoomAllCommand. + ''' + Public Sub ZoomAll(ByVal param As Object) + LibMap.refSceneHostVM.ZoomMode(ZM.ALL) + End Sub + +#End Region ' ZoomAllCommand + +#Region "ZoomInCommand" + + ''' + ''' Returns a command that do ZoomIn. + ''' + Public ReadOnly Property ZoomInCommand As ICommand + Get + If m_cmdZoomIn Is Nothing Then + m_cmdZoomIn = New Command(AddressOf ZoomIn) + End If + Return m_cmdZoomIn + End Get + End Property + + ''' + ''' Execute the ZoomIn. This method is invoked by the ZoomInCommand. + ''' + Public Sub ZoomIn(ByVal param As Object) + LibMap.refSceneHostVM.MainScene.ZoomIn() + End Sub + +#End Region ' ZoomInCommand + +#Region "ZoomOutCommand" + + ''' + ''' Returns a command that do ZoomOut. + ''' + Public ReadOnly Property ZoomOutCommand As ICommand + Get + If m_cmdZoomOut Is Nothing Then + m_cmdZoomOut = New Command(AddressOf ZoomOut) + End If + Return m_cmdZoomOut + End Get + End Property + + ''' + ''' Execute the ZoomOut. This method is invoked by the ZoomOutCommand. + ''' + Public Sub ZoomOut(ByVal param As Object) + LibMap.refSceneHostVM.MainScene.ZoomOut() + End Sub + +#End Region ' ZoomOutCommand + +#Region "TopViewCommand" + + ''' + ''' Returns a command that do TopView. + ''' + Public ReadOnly Property TopViewCommand As ICommand + Get + If m_cmdTopView Is Nothing Then + m_cmdTopView = New Command(AddressOf TopView) + End If + Return m_cmdTopView + End Get + End Property + + ''' + ''' Execute the TopView. This method is invoked by the TopViewCommand. + ''' + Public Sub TopView(ByVal param As Object) + LibMap.refSceneHostVM.ViewMode(VT.TOP) + End Sub + +#End Region ' TopViewCommand + +#Region "FrontViewCommand" + + ''' + ''' Returns a command that do FrontView. + ''' + Public ReadOnly Property FrontViewCommand As ICommand + Get + If m_cmdFrontView Is Nothing Then + m_cmdFrontView = New Command(AddressOf FrontView) + End If + Return m_cmdFrontView + End Get + End Property + + ''' + ''' Execute the FrontView. This method is invoked by the FrontViewCommand. + ''' + Public Sub FrontView(ByVal param As Object) + LibMap.refSceneHostVM.ViewMode(VT.FRONT) + End Sub + +#End Region ' FrontViewCommand + +#Region "LeftViewCommand" + + ''' + ''' Returns a command that do LeftView. + ''' + Public ReadOnly Property LeftViewCommand As ICommand + Get + If m_cmdLeftView Is Nothing Then + m_cmdLeftView = New Command(AddressOf LeftView) + End If + Return m_cmdLeftView + End Get + End Property + + ''' + ''' Execute the LeftView. This method is invoked by the LeftViewCommand. + ''' + Public Sub LeftView(ByVal param As Object) + LibMap.refSceneHostVM.ViewMode(VT.LEFT) + End Sub + +#End Region ' LeftViewCommand + +#Region "BackViewCommand" + + ''' + ''' Returns a command that do BackView. + ''' + Public ReadOnly Property BackViewCommand As ICommand + Get + If m_cmdBackView Is Nothing Then + m_cmdBackView = New Command(AddressOf BackView) + End If + Return m_cmdBackView + End Get + End Property + + ''' + ''' Execute the BackView. This method is invoked by the BackViewCommand. + ''' + Public Sub BackView(ByVal param As Object) + LibMap.refSceneHostVM.ViewMode(VT.BACK) + End Sub + +#End Region ' BackViewCommand + +#Region "RightViewCommand" + + ''' + ''' Returns a command that do RightView. + ''' + Public ReadOnly Property RightViewCommand As ICommand + Get + If m_cmdRightView Is Nothing Then + m_cmdRightView = New Command(AddressOf RightView) + End If + Return m_cmdRightView + End Get + End Property + + ''' + ''' Execute the RightView. This method is invoked by the RightViewCommand. + ''' + Public Sub RightView(ByVal param As Object) + LibMap.refSceneHostVM.ViewMode(VT.RIGHT) + End Sub + +#End Region ' RightViewCommand + +#Region "IsoViewSECommand" + + ''' + ''' Returns a command that do IsoViewSE. + ''' + Public ReadOnly Property IsoViewSECommand As ICommand + Get + If m_cmdIsoViewSE Is Nothing Then + m_cmdIsoViewSE = New Command(AddressOf IsoViewSE) + End If + Return m_cmdIsoViewSE + End Get + End Property + + ''' + ''' Execute the IsoViewSE. This method is invoked by the IsoViewSECommand. + ''' + Public Sub IsoViewSE(ByVal param As Object) + LibMap.refSceneHostVM.MainScene.IsoViewSE() + End Sub + +#End Region ' IsoViewSECommand + +#Region "IsoViewSWCommand" + + ''' + ''' Returns a command that do IsoViewSW. + ''' + Public ReadOnly Property IsoViewSWCommand As ICommand + Get + If m_cmdIsoViewSW Is Nothing Then + m_cmdIsoViewSW = New Command(AddressOf IsoViewSW) + End If + Return m_cmdIsoViewSW + End Get + End Property + + ''' + ''' Execute the IsoViewSW. This method is invoked by the IsoViewSWCommand. + ''' + Public Sub IsoViewSW(ByVal param As Object) + LibMap.refSceneHostVM.ViewMode(VT.ISO_SW) + End Sub + +#End Region ' IsoViewSWCommand + +#Region "IsoViewNECommand" + + ''' + ''' Returns a command that do IsoViewNE. + ''' + Public ReadOnly Property IsoViewNECommand As ICommand + Get + If m_cmdIsoViewNE Is Nothing Then + m_cmdIsoViewNE = New Command(AddressOf IsoViewNE) + End If + Return m_cmdIsoViewNE + End Get + End Property + + ''' + ''' Execute the IsoViewNE. This method is invoked by the IsoViewNECommand. + ''' + Public Sub IsoViewNE(ByVal param As Object) + LibMap.refSceneHostVM.MainScene.IsoViewNE() + End Sub + +#End Region ' IsoViewNECommand + +#Region "IsoViewNWCommand" + + ''' + ''' Returns a command that do IsoViewNW. + ''' + Public ReadOnly Property IsoViewNWCommand As ICommand + Get + If m_cmdIsoViewNW Is Nothing Then + m_cmdIsoViewNW = New Command(AddressOf IsoViewNW) + End If + Return m_cmdIsoViewNW + End Get + End Property + + ''' + ''' Execute the IsoViewNW. This method is invoked by the IsoViewNWCommand. + ''' + Public Sub IsoViewNW(ByVal param As Object) + LibMap.refSceneHostVM.MainScene.IsoViewNW() + End Sub + +#End Region ' IsoViewNWCommand + +#Region "ViewToCPlaneCommand" + + ''' + ''' Returns a command that do GetDist. + ''' + Public ReadOnly Property ViewToCPlaneCommand As ICommand + Get + If m_cmdViewToCPlane Is Nothing Then + m_cmdViewToCPlane = New Command(AddressOf ViewToCPlane) + End If + Return m_cmdViewToCPlane + End Get + End Property + + ''' + ''' Execute the GetDist. This method is invoked by the GetDistCommand. + ''' + Public Sub ViewToCPlane(ByVal param As Object) + LibMap.refSceneHostVM.MainScene.CPlaneView() + End Sub + +#End Region ' ViewToCPlaneCommand + +#End Region ' COMMANDS + +End Class +