EgtWpfLib :

- Agiunti pannelli, StatusBar e scena generici per uso comune.
- Miglioramenti vari.
This commit is contained in:
Emmanuele Sassi
2017-11-25 17:01:25 +00:00
parent 0b44f5a723
commit f325ea4bdf
29 changed files with 1723 additions and 35 deletions
+9 -3
View File
@@ -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
+1 -1
View File
@@ -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
@@ -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
+5 -5
View File
@@ -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
+2
View File
@@ -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()
+26 -5
View File
@@ -87,6 +87,7 @@
<Compile Include="Constants\ConstMachIni.vb" />
<Compile Include="Constants\ConstMsg.vb" />
<Compile Include="Constants\Enums.vb" />
<Compile Include="Converters\ItemsControlItemDimensionMultiplier.vb" />
<Compile Include="EgtCustomWindow.vb" />
<Compile Include="EgtOpenFileDialog.xaml.vb">
<DependentUpon>EgtOpenFileDialog.xaml</DependentUpon>
@@ -98,25 +99,35 @@
<Compile Include="EgtFloating\EgtFloatingPanel.vb" />
<Compile Include="EgtFloating\EgtFloatingTray.vb" />
<Compile Include="EgtFloating\EgtFloatingWindow.vb" />
<Compile Include="MachGroupPanel\EgtMachGroupPanelV.xaml.vb">
<DependentUpon>EgtMachGroupPanelV.xaml</DependentUpon>
<Compile Include="InstrumentPanel\InstrumentPanelVM.vb" />
<Compile Include="MachGroupPanel\MachGroupPanelV.xaml.vb">
<DependentUpon>MachGroupPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="MachGroupPanel\EgtMachGroupPanelVM.vb" />
<Compile Include="MachGroupPanel\MachGroupPanelVM.vb" />
<Compile Include="MachGroupPanel\NewMachGroupWnd\NewMachGroupWndV.xaml.vb">
<DependentUpon>NewMachGroupWndV.xaml</DependentUpon>
</Compile>
<Compile Include="MachGroupPanel\NewMachGroupWnd\NewMachGroupWndVM.vb" />
<Compile Include="Machine.vb" />
<Compile Include="Utility\Machine.vb" />
<Compile Include="MachiningDbWindow\MachiningDbWindowV.xaml.vb">
<DependentUpon>MachiningDbWindowV.xaml</DependentUpon>
</Compile>
<Compile Include="MachiningDbWindow\MachiningDbWindowVM.vb" />
<Compile Include="MachiningDbWindow\MachiningTreeView.vb" />
<Compile Include="SceneHost\SceneHostV.xaml.vb">
<DependentUpon>SceneHostV.xaml</DependentUpon>
</Compile>
<Compile Include="SceneHost\SceneHostVM.vb" />
<Compile Include="SetUpWindow\SetUpUtility.vb" />
<Compile Include="SetUpWindow\SetUpWindowV.xaml.vb">
<DependentUpon>SetUpWindowV.xaml</DependentUpon>
</Compile>
<Compile Include="SetUpWindow\SetUpWindowVM.vb" />
<Compile Include="ShowPanel\ShowPanelVM.vb" />
<Compile Include="StatusBar\StatusBarV.xaml.vb">
<DependentUpon>StatusBarV.xaml</DependentUpon>
</Compile>
<Compile Include="StatusBar\StatusBarVM.vb" />
<Compile Include="ToolDbWindow\ToolDbWindowV.xaml.vb">
<DependentUpon>ToolDbWindowV.xaml</DependentUpon>
</Compile>
@@ -150,10 +161,12 @@
<Compile Include="Utility\Language.vb" />
<Compile Include="Utility\MachineUtility.vb" />
<Compile Include="Utility\MruList.vb" />
<Compile Include="Utility\LibMap.vb" />
<Compile Include="Utility\TMDbParamVisibility.vb" />
<Compile Include="Utility\StringConversion.vb" />
<Compile Include="Utility\VMBase.vb" />
<Compile Include="Utility\WinPos.vb" />
<Compile Include="ViewPanel\ViewPanelVM.vb" />
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
@@ -178,7 +191,7 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MachGroupPanel\EgtMachGroupPanelV.xaml">
<Page Include="MachGroupPanel\MachGroupPanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
@@ -190,10 +203,18 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SceneHost\SceneHostV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SetUpWindow\SetUpWindowV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="StatusBar\StatusBarV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Themes\Generic.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
+14
View File
@@ -0,0 +1,14 @@
<EgtFloating:EgtFloatingPanel x:Class="InstrumentPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
IsTopDockable="True" IsBottomDockable="False" IsLeftDockable="False"
IsRightDockable="False" Style="{StaticResource ToolBar_EgtFloatingPanel}">
<ToggleButton ToolTip="{Binding GetDistToolTip}"
Style="{StaticResource ToolBar_ToggleButton}"
IsChecked="{Binding GetDistIsChecked}">
<Image Source="/Resources/InstrumentPanel/GetDist.png" Stretch="Uniform"/>
</ToggleButton>
</EgtFloating:EgtFloatingPanel>
+3
View File
@@ -0,0 +1,3 @@
Public Class InstrumentPanelV
End Class
+95
View File
@@ -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
@@ -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}">
<EgtFloating:EgtFloatingPanel.Resources>
<SolidColorBrush x:Key="ListBox.Static.Background" Color="#FFFFFFFF"/>
@@ -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
+8
View File
@@ -0,0 +1,8 @@
<WindowsFormsHost x:Class="SceneHostV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtUILib="clr-namespace:EgtUILib;assembly=EgtUILib">
<EgtUILib:Scene x:Name="MainScene"/>
</WindowsFormsHost>
+18
View File
@@ -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
+389
View File
@@ -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
+24
View File
@@ -0,0 +1,24 @@
<EgtFloating:EgtFloatingPanel x:Class="ShowPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
IsTopDockable="True" IsBottomDockable="False" IsLeftDockable="False"
IsRightDockable="False" Style="{StaticResource ToolBar_EgtFloatingPanel}">
<RadioButton ToolTip="{Binding RenderingWFToolTip}"
Style="{StaticResource ToolBar_ToggleButton}"
IsChecked="{Binding WireframeIsChecked}">
<Image Source="/Resources/ShowPanel/RenderingWF.png" Stretch="Uniform"/>
</RadioButton>
<RadioButton ToolTip="{Binding RenderingHLToolTip}"
Style="{StaticResource ToolBar_ToggleButton}"
IsChecked="{Binding HiddenLineIsChecked}">
<Image Source="/Resources/ShowPanel/RenderingHL.png" Stretch="Uniform"/>
</RadioButton>
<RadioButton ToolTip="{Binding RenderingSHToolTip}"
Style="{StaticResource ToolBar_ToggleButton}"
IsChecked="{Binding ShadingIsChecked}">
<Image Source="/Resources/ShowPanel/RenderingSH.png" Stretch="Uniform"/>
</RadioButton>
</EgtFloating:EgtFloatingPanel>
+3
View File
@@ -0,0 +1,3 @@
Public Class ShowPanelV
End Class
+127
View File
@@ -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
+55
View File
@@ -0,0 +1,55 @@
<StatusBar x:Class="StatusBarV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Background="{StaticResource EgaltechBlue1}">
<StatusBar.ItemsPanel>
<ItemsPanelTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
</Grid>
</ItemsPanelTemplate>
</StatusBar.ItemsPanel>
<!--Barra di caricamento-->
<StatusBarItem Grid.Column="0">
<ProgressBar Value="{Binding LoadingProgress}"
Height="20" Width="150"
Visibility="{Binding LoadingProgress_Visibility}"/>
</StatusBarItem>
<!--Stringa di output messaggi-->
<StatusBarItem Grid.Column="1">
<TextBlock Text="{Binding OutputMessage}"
Foreground="{Binding OutputMessage_Foreground}"/>
</StatusBarItem>
<!--Indica il tipo di punto notevole selezionato-->
<StatusBarItem Grid.Column="2">
<Button Content="{Binding SnapPointType}"
Background="{Binding SnapPointType_Background}"
Width="80"/>
</StatusBarItem>
<!--Indica la posizione del mouse quando è sulla scena-->
<StatusBarItem Grid.Column="3">
<TextBlock Text="{Binding CurrPos}"
TextAlignment="Right"
Foreground="{StaticResource EgaltechWhite}"
Width="250"/>
</StatusBarItem>
<!--Indica l'unità di misura-->
<StatusBarItem Grid.Column="4">
<TextBlock Text="{Binding MeasureUnit}"
Foreground="{StaticResource EgaltechWhite}"
Width="35"/>
</StatusBarItem>
</StatusBar>
+3
View File
@@ -0,0 +1,3 @@
Public Class StatusBarV
End Class
+185
View File
@@ -0,0 +1,185 @@
Imports EgtWPFLib5
Public Class StatusBarVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Private WithEvents OutputMessageTimer As New System.Windows.Threading.DispatcherTimer
' GRAPHICAL ELEMENTS
Private m_LoadingProgress As Integer
Public Property LoadingProgress As Integer
Get
Return m_LoadingProgress
End Get
Set(value As Integer)
m_LoadingProgress = value
End Set
End Property
Private m_LoadingProgress_Visibility As Visibility = Visibility.Hidden
Public ReadOnly Property LoadingProgress_Visibility As Visibility
Get
Return m_LoadingProgress_Visibility
End Get
End Property
Private m_OutputMessage As String
Public Property OutputMessage As String
Get
Return m_OutputMessage
End Get
Set(value As String)
m_OutputMessage = value
End Set
End Property
Private m_OutputMessage_Foreground As Brush = Brushes.Black
Public Property OutputMessage_Foreground As Brush
Get
Return m_OutputMessage_Foreground
End Get
Set(value As Brush)
m_OutputMessage_Foreground = value
End Set
End Property
Private m_MeasureUnit As String
Public Property MeasureUnit As String
Get
Return m_MeasureUnit
End Get
Set(value As String)
m_MeasureUnit = value
End Set
End Property
Private m_CurrPos As String
Public Property CurrPos As String
Get
Return m_CurrPos
End Get
Set(value As String)
m_CurrPos = value
End Set
End Property
Private m_SnapPointType As String
Public Property SnapPointType As String
Get
Return m_SnapPointType
End Get
Set(value As String)
m_SnapPointType = value
End Set
End Property
Private m_SnapPointType_Background As SolidColorBrush
Public Property SnapPointType_Background As SolidColorBrush
Get
Return m_SnapPointType_Background
End Get
Set(value As SolidColorBrush)
m_SnapPointType_Background = value
End Set
End Property
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Sub New()
' Creo riferimento a questa classe in OmagOFFICEMap
LibMap.SetRefStatusBarVM(Me)
End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
Public Sub SetLoadingProgress(sProgress As Integer)
m_LoadingProgress = sProgress
NotifyPropertyChanged("LoadingProgress")
End Sub
Public Sub SetLoadingProgress_Visibility(IsVisible As Boolean)
If IsVisible Then
m_LoadingProgress_Visibility = Visibility.Visible
Else
m_LoadingProgress_Visibility = Visibility.Hidden
End If
NotifyPropertyChanged("LoadingProgress_Visibility")
End Sub
Public Overloads Sub SetOutputMessage(sMessage As String, Optional nMsgType As MSG_TYPE = MSG_TYPE.INFO)
SetMsgColor(nMsgType)
m_OutputMessage = sMessage
NotifyPropertyChanged("OutputMessage")
End Sub
Public Overloads Sub SetOutputMessage(sMessage As String, nTime As Integer, Optional nMsgType As MSG_TYPE = MSG_TYPE.INFO)
SetMsgColor(nMsgType)
m_OutputMessage = sMessage
NotifyPropertyChanged("OutputMessage")
OutputMessageTimer.Interval = TimeSpan.FromSeconds(nTime)
OutputMessageTimer.IsEnabled = True
OutputMessageTimer.Start()
End Sub
Public Sub ClearOutputMessage()
m_OutputMessage_Foreground = Brushes.Black
NotifyPropertyChanged("MsgColor")
m_OutputMessage = String.Empty
NotifyPropertyChanged("OutputMessage")
If OutputMessageTimer.IsEnabled Then
OutputMessageTimer.Stop()
OutputMessageTimer.IsEnabled = False
End If
End Sub
Public Sub SetMeasureUnit(nMeasureUnit As Integer)
m_MeasureUnit = If(nMeasureUnit = 0, "in", "mm")
NotifyPropertyChanged("MeasureUnit")
End Sub
Public Sub SetCurrPos(sCurrPos As String)
m_CurrPos = sCurrPos
NotifyPropertyChanged("CurrPos")
End Sub
Public Sub SetMsgColor(nMsgType As MSG_TYPE)
Select Case nMsgType
Case MSG_TYPE.INFO
m_OutputMessage_Foreground = Brushes.Black
Case MSG_TYPE.WARNING
m_OutputMessage_Foreground = Brushes.SaddleBrown
Case MSG_TYPE.ERROR_
m_OutputMessage_Foreground = Brushes.Red
End Select
NotifyPropertyChanged("MsgColor")
End Sub
Public Sub SetSnapPointType(sSnapPntType As String, Optional SnapPntTypeBackground As Brush = Nothing)
m_SnapPointType = sSnapPntType
NotifyPropertyChanged("SnapPointType")
If Not IsNothing(SnapPntTypeBackground) Then
m_SnapPointType_Background = SnapPntTypeBackground
NotifyPropertyChanged("SnapPointTypeBackground")
End If
End Sub
#End Region ' METHODS
#Region "EVENTS"
Private Sub OutputMessageTimer_Tick(source As Object, e As EventArgs) Handles OutputMessageTimer.Tick
ClearOutputMessage()
OutputMessageTimer.Stop()
OutputMessageTimer.IsEnabled = False
End Sub
#End Region ' EVENTS
End Class
+1 -1
View File
@@ -303,7 +303,7 @@
<Button Command="{TemplateBinding AboutBoxCommand}" Height="{TemplateBinding TitleBarHeight}" Width="{TemplateBinding TitleBarHeight}" Style="{StaticResource IconButtonStyle}">
<Image x:Name="PART_TitleBarIcon" Source="{TemplateBinding Icon}"/>
</Button>
<ContentPresenter Content="{TemplateBinding TitleUserControl}" VerticalAlignment="Center" Grid.Column="1"/>
<ContentPresenter Content="{TemplateBinding TitlePanel}" VerticalAlignment="Center" Grid.Column="1"/>
<TextBlock x:Name="PART_MoveRectangle" TextAlignment="Center" Foreground="White" FontSize="15" Grid.Column="2"
Text="{TemplateBinding Title}" VerticalAlignment="Center" Margin="20,0,20,0">
</TextBlock>
+2 -2
View File
@@ -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
+222
View File
@@ -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
+4 -4
View File
@@ -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
+5 -5
View File
@@ -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
+77
View File
@@ -0,0 +1,77 @@
<EgtFloating:EgtFloatingPanel x:Class="ViewPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
IsTopDockable="True" IsBottomDockable="False" IsLeftDockable="False"
IsRightDockable="False" Style="{StaticResource ToolBar_EgtFloatingPanel}">
<Button ToolTip="{Binding ZoomAllToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding ZoomAllCommand}">
<Image Source="/Resources/ViewPanel/ZoomAll.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding LookFromTopToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding TopViewCommand}">
<Image Source="/Resources/ViewPanel/LookFromTOP.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding LookFromFrontToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding FrontViewCommand}">
<Image Source="/Resources/ViewPanel/LookFromFRONT.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding LookFromRightToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding RightViewCommand}">
<Image Source="/Resources/ViewPanel/LookFromRIGHT.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding LookFromBackToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding BackViewCommand}">
<Image Source="/Resources/ViewPanel/LookFromBACK.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding LookFromLeftToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding LeftViewCommand}">
<Image Source="/Resources/ViewPanel/LookFromLEFT.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding LookFromIso_SWToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding IsoViewSWCommand}">
<Image Source="/Resources/ViewPanel/LookFromISO_SW.png" Stretch="Uniform"/>
</Button>
<StackPanel Background="Transparent" Orientation="Horizontal" EgtFloating:EgtFloatingPanel.IsInPopUp="True">
<Button ToolTip="{Binding ZoomInToolTip}"
Style="{StaticResource GridViewPanelButton}"
Command="{Binding ZoomInCommand}">
<Image Source="/Resources/GridViewPanel/ZoomIn.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding ZoomOutToolTip}"
Style="{StaticResource GridViewPanelButton}"
Command="{Binding ZoomOutCommand}">
<Image Source="/Resources/GridViewPanel/ZoomOut.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding LookFromIso_SEToolTip}"
Style="{StaticResource GridViewPanelButton}"
Command="{Binding IsoViewSECommand}">
<Image Source="/Resources/GridViewPanel/LookFromISO_SE.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding LookFromIso_NEToolTip}"
Style="{StaticResource GridViewPanelButton}"
Command="{Binding IsoViewNECommand}">
<Image Source="/Resources/GridViewPanel/LookFromISO_NE.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding LookFromIso_NWToolTip}"
Style="{StaticResource GridViewPanelButton}"
Command="{Binding IsoViewNWCommand}">
<Image Source="/Resources/GridViewPanel/LookFromISO_NW.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding ViewToCPlaneToolTip}"
Style="{StaticResource GridViewPanelButton}"
Command="{Binding ViewToCPlaneCommand}">
<Image Source="/Resources/GridViewPanel/CplaneView.png" Stretch="Uniform"/>
</Button>
</StackPanel>
</EgtFloating:EgtFloatingPanel>
+3
View File
@@ -0,0 +1,3 @@
Public Class GridViewPanelV
End Class
+410
View File
@@ -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"
''' <summary>
''' Returns a command that do ZoomAll.
''' </summary>
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
''' <summary>
''' Execute the ZoomAll. This method is invoked by the ZoomAllCommand.
''' </summary>
Public Sub ZoomAll(ByVal param As Object)
LibMap.refSceneHostVM.ZoomMode(ZM.ALL)
End Sub
#End Region ' ZoomAllCommand
#Region "ZoomInCommand"
''' <summary>
''' Returns a command that do ZoomIn.
''' </summary>
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
''' <summary>
''' Execute the ZoomIn. This method is invoked by the ZoomInCommand.
''' </summary>
Public Sub ZoomIn(ByVal param As Object)
LibMap.refSceneHostVM.MainScene.ZoomIn()
End Sub
#End Region ' ZoomInCommand
#Region "ZoomOutCommand"
''' <summary>
''' Returns a command that do ZoomOut.
''' </summary>
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
''' <summary>
''' Execute the ZoomOut. This method is invoked by the ZoomOutCommand.
''' </summary>
Public Sub ZoomOut(ByVal param As Object)
LibMap.refSceneHostVM.MainScene.ZoomOut()
End Sub
#End Region ' ZoomOutCommand
#Region "TopViewCommand"
''' <summary>
''' Returns a command that do TopView.
''' </summary>
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
''' <summary>
''' Execute the TopView. This method is invoked by the TopViewCommand.
''' </summary>
Public Sub TopView(ByVal param As Object)
LibMap.refSceneHostVM.ViewMode(VT.TOP)
End Sub
#End Region ' TopViewCommand
#Region "FrontViewCommand"
''' <summary>
''' Returns a command that do FrontView.
''' </summary>
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
''' <summary>
''' Execute the FrontView. This method is invoked by the FrontViewCommand.
''' </summary>
Public Sub FrontView(ByVal param As Object)
LibMap.refSceneHostVM.ViewMode(VT.FRONT)
End Sub
#End Region ' FrontViewCommand
#Region "LeftViewCommand"
''' <summary>
''' Returns a command that do LeftView.
''' </summary>
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
''' <summary>
''' Execute the LeftView. This method is invoked by the LeftViewCommand.
''' </summary>
Public Sub LeftView(ByVal param As Object)
LibMap.refSceneHostVM.ViewMode(VT.LEFT)
End Sub
#End Region ' LeftViewCommand
#Region "BackViewCommand"
''' <summary>
''' Returns a command that do BackView.
''' </summary>
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
''' <summary>
''' Execute the BackView. This method is invoked by the BackViewCommand.
''' </summary>
Public Sub BackView(ByVal param As Object)
LibMap.refSceneHostVM.ViewMode(VT.BACK)
End Sub
#End Region ' BackViewCommand
#Region "RightViewCommand"
''' <summary>
''' Returns a command that do RightView.
''' </summary>
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
''' <summary>
''' Execute the RightView. This method is invoked by the RightViewCommand.
''' </summary>
Public Sub RightView(ByVal param As Object)
LibMap.refSceneHostVM.ViewMode(VT.RIGHT)
End Sub
#End Region ' RightViewCommand
#Region "IsoViewSECommand"
''' <summary>
''' Returns a command that do IsoViewSE.
''' </summary>
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
''' <summary>
''' Execute the IsoViewSE. This method is invoked by the IsoViewSECommand.
''' </summary>
Public Sub IsoViewSE(ByVal param As Object)
LibMap.refSceneHostVM.MainScene.IsoViewSE()
End Sub
#End Region ' IsoViewSECommand
#Region "IsoViewSWCommand"
''' <summary>
''' Returns a command that do IsoViewSW.
''' </summary>
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
''' <summary>
''' Execute the IsoViewSW. This method is invoked by the IsoViewSWCommand.
''' </summary>
Public Sub IsoViewSW(ByVal param As Object)
LibMap.refSceneHostVM.ViewMode(VT.ISO_SW)
End Sub
#End Region ' IsoViewSWCommand
#Region "IsoViewNECommand"
''' <summary>
''' Returns a command that do IsoViewNE.
''' </summary>
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
''' <summary>
''' Execute the IsoViewNE. This method is invoked by the IsoViewNECommand.
''' </summary>
Public Sub IsoViewNE(ByVal param As Object)
LibMap.refSceneHostVM.MainScene.IsoViewNE()
End Sub
#End Region ' IsoViewNECommand
#Region "IsoViewNWCommand"
''' <summary>
''' Returns a command that do IsoViewNW.
''' </summary>
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
''' <summary>
''' Execute the IsoViewNW. This method is invoked by the IsoViewNWCommand.
''' </summary>
Public Sub IsoViewNW(ByVal param As Object)
LibMap.refSceneHostVM.MainScene.IsoViewNW()
End Sub
#End Region ' IsoViewNWCommand
#Region "ViewToCPlaneCommand"
''' <summary>
''' Returns a command that do GetDist.
''' </summary>
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
''' <summary>
''' Execute the GetDist. This method is invoked by the GetDistCommand.
''' </summary>
Public Sub ViewToCPlane(ByVal param As Object)
LibMap.refSceneHostVM.MainScene.CPlaneView()
End Sub
#End Region ' ViewToCPlaneCommand
#End Region ' COMMANDS
End Class