diff --git a/BottomTray/BottomTrayV.xaml b/BottomTray/BottomTrayV.xaml
new file mode 100644
index 0000000..baeef4e
--- /dev/null
+++ b/BottomTray/BottomTrayV.xaml
@@ -0,0 +1,12 @@
+
+
+
diff --git a/BottomTray/BottomTrayV.xaml.vb b/BottomTray/BottomTrayV.xaml.vb
new file mode 100644
index 0000000..5f44b25
--- /dev/null
+++ b/BottomTray/BottomTrayV.xaml.vb
@@ -0,0 +1,3 @@
+Public Class BottomTrayV
+
+End Class
diff --git a/DrawPanel/DrawPanelV.xaml b/DrawPanel/DrawPanelV.xaml
index b5fa3bb..e49453e 100644
--- a/DrawPanel/DrawPanelV.xaml
+++ b/DrawPanel/DrawPanelV.xaml
@@ -1,9 +1,11 @@
-
+
-
+
diff --git a/DrawPanel/DrawPanelVM.vb b/DrawPanel/DrawPanelVM.vb
index 00f57a3..e4e5dbc 100644
--- a/DrawPanel/DrawPanelVM.vb
+++ b/DrawPanel/DrawPanelVM.vb
@@ -393,6 +393,18 @@ Public Class DrawPanelVM
End Set
End Property
+ Private m_DrawPanel_Visibility As Visibility
+ Public ReadOnly Property DrawPanel_Visibility As Visibility
+ Get
+ Return m_DrawPanel_Visibility
+ End Get
+ End Property
+ Friend Sub SetDrawPanelVisibility(bValue As Boolean)
+ m_DrawPanel_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
+ OnPropertyChanged(NameOf(DrawPanel_Visibility))
+ End Sub
+
+
#Region "Button state"
Private m_bLayerOk As Boolean
diff --git a/EgtCAM5.vbproj b/EgtCAM5.vbproj
index 4487256..e9ad71f 100644
--- a/EgtCAM5.vbproj
+++ b/EgtCAM5.vbproj
@@ -116,6 +116,7 @@
False..\..\EgtProg\EgtCAM5\Microsoft.Expression.Interactions.dll
+
@@ -153,11 +154,18 @@
BeamMachiningsWindowV.xaml
+
+ BottomTrayV.xaml
+ CurrSetUpV.xaml
+
+ LeftTrayV.xaml
+
+ EstimationsExpanderV.xaml
@@ -227,6 +235,12 @@
MachineBox.xaml
+
+ RightTrayV.xaml
+
+
+ SceneContentControlV.xaml
+ SetUpDbV.xaml
@@ -236,10 +250,6 @@
SetUpV.xaml
-
- Printing3DPanelV.xaml
-
-
@@ -278,6 +288,9 @@
+
+ TopTrayV.xaml
+
@@ -416,6 +429,10 @@
+
+
+ WinFormPluginControlV.xaml
+ DesignerMSBuild:Compile
@@ -424,6 +441,10 @@
MSBuild:CompileDesigner
+
+ Designer
+ MSBuild:Compile
+ MSBuild:CompileDesigner
@@ -432,6 +453,10 @@
DesignerMSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+ DesignerMSBuild:Compile
@@ -520,6 +545,14 @@
MSBuild:CompileDesigner
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+ DesignerMSBuild:Compile
@@ -528,10 +561,6 @@
MSBuild:CompileDesigner
-
- Designer
- MSBuild:Compile
- MSBuild:CompileDesigner
@@ -588,6 +617,10 @@
DesignerXamlIntelliSenseFileGenerator
+
+ Designer
+ MSBuild:Compile
+ MSBuild:CompileDesigner
@@ -680,6 +713,10 @@
DesignerMSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
diff --git a/ExecutePanel/ExecutePanelV.xaml b/ExecutePanel/ExecutePanelV.xaml
index 94f6ecf..d914077 100644
--- a/ExecutePanel/ExecutePanelV.xaml
+++ b/ExecutePanel/ExecutePanelV.xaml
@@ -1,6 +1,8 @@
-
+
-
+
diff --git a/ExecutePanel/ExecutePanelVM.vb b/ExecutePanel/ExecutePanelVM.vb
index c72e64f..558b699 100644
--- a/ExecutePanel/ExecutePanelVM.vb
+++ b/ExecutePanel/ExecutePanelVM.vb
@@ -12,6 +12,18 @@ Public Class ExecutePanelVM
End Get
End Property
+ Private m_ExecutePanel_Visibility As Visibility
+ Public ReadOnly Property ExecutePanel_Visibility As Visibility
+ Get
+ Return m_ExecutePanel_Visibility
+ End Get
+ End Property
+
+ Friend Sub SetExecutePanelVisibility(bValue As Boolean)
+ m_ExecutePanel_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
+ OnPropertyChanged(NameOf(ExecutePanel_Visibility))
+ End Sub
+
' Definizione comandi
Private m_cmdExec As ICommand
Private Shared m_cmdOpenMruScript As ICommand
@@ -28,6 +40,11 @@ Public Class ExecutePanelVM
#End Region ' FIELDS & PROPERTIES
+ Sub New()
+ ' Creo riferimento a questa classe in Map
+ Map.SetRefExecutePanelVM(Me)
+ End Sub
+
#Region "COMMANDS"
#Region "ExecCommand"
diff --git a/LeftTray/LeftTrayV.xaml b/LeftTray/LeftTrayV.xaml
new file mode 100644
index 0000000..3326083
--- /dev/null
+++ b/LeftTray/LeftTrayV.xaml
@@ -0,0 +1,10 @@
+
+
+
+
+
diff --git a/LeftTray/LeftTrayV.xaml.vb b/LeftTray/LeftTrayV.xaml.vb
new file mode 100644
index 0000000..39e514e
--- /dev/null
+++ b/LeftTray/LeftTrayV.xaml.vb
@@ -0,0 +1,3 @@
+Public Class LeftTrayV
+
+End Class
diff --git a/MEFPlugin/MefPlugin.vb b/MEFPlugin/MefPlugin.vb
new file mode 100644
index 0000000..003f11b
--- /dev/null
+++ b/MEFPlugin/MefPlugin.vb
@@ -0,0 +1,74 @@
+Imports System.ComponentModel.Composition
+Imports System.ComponentModel.Composition.hosting
+
+Public Class MEFLoader
+ Private importers As Dictionary(Of String, List(Of Object)) = New Dictionary(Of String, List(Of Object))()
+
+ Public Overridable Function LoadByTag(Of T)(ByVal path As String, ByVal tag As String) As ICollection(Of T)
+ Dim importer = GetImporter(Of T)(path)
+ Return importer.LoadByMEF(path, tag)
+ End Function
+
+ Protected Function GetImporter(Of T)(ByVal path As String) As MEFImporter(Of T)
+ Dim importerList = GetImporterList(path)
+ Dim importer = importerList.OfType(Of MEFImporter(Of T))().FirstOrDefault()
+
+ If importer Is Nothing Then
+ importer = New MEFImporter(Of T)(path)
+ importerList.Add(importer)
+ End If
+
+ Return importer
+ End Function
+
+ Protected Function GetImporterList(ByVal path As String) As List(Of Object)
+ If importers.ContainsKey(path) = False Then importers.Add(path, New List(Of Object)())
+ Return importers(path)
+ End Function
+
+ Public Overridable Function LoadByType(Of T)(ByVal path As String) As ICollection(Of T)
+ Return LoadByTag(Of T)(path, String.Empty)
+ End Function
+End Class
+
+Public Interface IMetadata
+ ReadOnly Property Name As String
+End Interface
+
+Public Class MEFImporter(Of T)
+
+
+ Public Property [imports] As IEnumerable(Of Lazy(Of T, IMetadata))
+
+ Private Sub New()
+ End Sub
+
+ Public Sub New(ByVal path As String)
+ Me.New()
+ directoryCatalog = New DirectoryCatalog(path)
+ End Sub
+
+ Protected directoryCatalog As DirectoryCatalog = Nothing
+
+ Protected Sub DoImport(ByVal path As String)
+ Dim catalog = New AggregateCatalog()
+ catalog.Catalogs.Add(directoryCatalog)
+ Dim container As CompositionContainer = New CompositionContainer(catalog)
+ container.ComposeParts(Me)
+ End Sub
+
+ Public Function LoadByMEF(ByVal path As String, ByVal name As String) As ICollection(Of T)
+ Dim res = New List(Of T)()
+ DoImport(path)
+
+ For Each [module] As Lazy(Of T, IMetadata) In [imports]
+
+ If [module].Metadata.Name = name OrElse String.IsNullOrEmpty(name) Then
+ res.Add([module].Value)
+ End If
+ Next
+
+ Return res
+ End Function
+
+End Class
diff --git a/MachinePanel/MachinePanelV.xaml b/MachinePanel/MachinePanelV.xaml
index b270405..1833b32 100644
--- a/MachinePanel/MachinePanelV.xaml
+++ b/MachinePanel/MachinePanelV.xaml
@@ -1,6 +1,8 @@
-
+
@@ -32,4 +34,4 @@
-
+
diff --git a/MachinePanel/MyMachinePanelVM.vb b/MachinePanel/MyMachinePanelVM.vb
index 068edf3..be49523 100644
--- a/MachinePanel/MyMachinePanelVM.vb
+++ b/MachinePanel/MyMachinePanelVM.vb
@@ -82,6 +82,17 @@ Public Class MyMachinePanelVM
End Set
End Property
+ Private m_MachinePanel_Visibility As Visibility
+ Public ReadOnly Property MachinePanel_Visibility As Visibility
+ Get
+ Return m_MachinePanel_Visibility
+ End Get
+ End Property
+ Friend Sub SetMachinePanelVisibility(bValue As Boolean)
+ m_MachinePanel_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
+ NotifyPropertyChanged(NameOf(MachinePanel_Visibility))
+ End Sub
+
#Region "Messages"
Public ReadOnly Property ToolDBMsg As String
diff --git a/MainWindow/MainWindowVM.vb b/MainWindow/MainWindowVM.vb
index c5e8b98..f489024 100644
--- a/MainWindow/MainWindowVM.vb
+++ b/MainWindow/MainWindowVM.vb
@@ -333,35 +333,35 @@ Public Class MainWindowVM
' Impostazione direttorio toolmakers
Dim sToolMakersDir As String = String.Empty
GetPrivateProfileString(S_MACH, K_TOOLMAKERSDIR, "", sToolMakersDir)
- #If PLATFORM = "x64" Then
+#If PLATFORM = "x64" Then
GetPrivateProfileString(S_MACH, K_TOOLMAKERSDIR64, sToolMakersDir, sToolMakersDir)
- #End If
- If Not String.IsNullOrWhiteSpace( sToolMakersDir) Then
+#End If
+ If Not String.IsNullOrWhiteSpace(sToolMakersDir) Then
IniFile.m_sToolMakersDir = sToolMakersDir
Else
IniFile.m_sToolMakersDir = m_sDataRoot & "\" & TOOLMAKER_DFL_DIR
- End If
+ End If
' Verifico indice di istanza
ManageInstance()
' Imposto tipo di chiave
EgtSetLockType(KEY_TYPE.HW)
' Leggo e imposto chiave di protezione ed eventuale chiave nesting
Dim sLicFileName As String = ""
- GetPrivateProfileString( S_GENERAL, K_LICENCE, LIC_FILE_NAME, sLicFileName)
+ GetPrivateProfileString(S_GENERAL, K_LICENCE, LIC_FILE_NAME, sLicFileName)
Dim sLicFile As String = m_sConfigDir & "\" & sLicFileName
Dim sKey As String = ""
- EgtUILib.GetPrivateProfileString( S_LICENCE, K_KEY, "", sKey, sLicFile)
- EgtSetKey( sKey)
+ EgtUILib.GetPrivateProfileString(S_LICENCE, K_KEY, "", sKey, sLicFile)
+ EgtSetKey(sKey)
Dim sNestKey As String = ""
- EgtUILib.GetPrivateProfileString( S_LICENCE, K_NESTKEY, "", sNestKey, sLicFile)
- EgtSetNestKey( sNestKey)
+ EgtUILib.GetPrivateProfileString(S_LICENCE, K_NESTKEY, "", sNestKey, sLicFile)
+ EgtSetNestKey(sNestKey)
' Impostazioni per chiave di rete
- Dim bNetKey As Boolean = ( GetPrivateProfileInt( S_GENERAL, K_NETKEY, 0) = 1)
- EgtSetNetHwKey( bNetKey)
+ Dim bNetKey As Boolean = (GetPrivateProfileInt(S_GENERAL, K_NETKEY, 0) = 1)
+ EgtSetNetHwKey(bNetKey)
Dim sLockId As String = ""
- EgtUILib.GetPrivateProfileString( S_LICENCE, K_LOCKID, "", sLockId, sLicFile)
- If Not String.IsNullOrEmpty( sLockId) Then
- EgtSetLockId( sLockId)
+ EgtUILib.GetPrivateProfileString(S_LICENCE, K_LOCKID, "", sLockId, sLicFile)
+ If Not String.IsNullOrEmpty(sLockId) Then
+ EgtSetLockId(sLockId)
End If
' Recupero livello e opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(3279, 2510, 1, IniFile.m_nKeyLevel) And
@@ -379,10 +379,10 @@ Public Class MainWindowVM
IniFile.m_sLogFile = m_sTempDir & "\" & GENLOG_FILE_NAME.Replace("#", IniFile.m_nInstance.ToString())
Dim sLogMsg As String = "User " & Environment.MachineName & "\" & Environment.UserName &
" Inst" & IniFile.m_nInstance.ToString() &
- " Ulv" & IniFile.m_nUserLevel.ToString() & " Dbg" & DebugLevel().ToString() & vbLf &
+" Ulv" & IniFile.m_nUserLevel.ToString() & " Dbg" & DebugLevel().ToString() & vbLf &
My.Application.Info.Title.ToString() & " ver. " & m_sVersion
EgtInit(m_nDebug, IniFile.m_sLogFile, sLogMsg)
- EgtSetUserLevel( IniFile.m_nUserLevel)
+ EgtSetUserLevel(IniFile.m_nUserLevel)
' Leggo direttorio dei messaggi (se manca uso direttorio di configurazione)
Dim sMsgDir As String = String.Empty
If GetPrivateProfileString(S_GENERAL, K_MESSAGESDIR, "", sMsgDir) = 0 Then
@@ -411,9 +411,9 @@ Public Class MainWindowVM
' Imposto dir di default per libreria Lua e lancio libreria di base
Dim sLuaLibsDir As String = String.Empty
GetPrivateProfileString(S_LUA, K_LIBSDIR, "", sLuaLibsDir)
- #If PLATFORM = "x64" Then
+#If PLATFORM = "x64" Then
GetPrivateProfileString(S_LUA, K_LIBSDIR64, sLuaLibsDir, sLuaLibsDir)
- #End If
+#End If
EgtSetLuaLibs(sLuaLibsDir)
Dim sLuaBaseLib As String = String.Empty
GetPrivateProfileString(S_LUA, K_BASELIB, "EgtBase", sLuaBaseLib)
@@ -555,7 +555,7 @@ Public Class MainWindowVM
WritePrivateProfileString(S_GRID, K_SNAPSTEPINCH, DoubleToString(IniFile.dSnapStepInch, 4))
End If
' gestisco la chiusura di DrawPanelVM
- If Not IniFile.m_bFailedRun Then
+ If Not IniFile.m_bFailedRun AndAlso Not IsNothing(Map.refDrawPanelVM) Then
WritePrivateProfileString(S_GENERAL, K_DRAW2D, If(Map.refDrawPanelVM.Draw2DIsExpanded, "1", "0"))
WritePrivateProfileString(S_GENERAL, K_DRAW3D, If(Map.refDrawPanelVM.Draw3DIsExpanded, "1", "0"))
WritePrivateProfileString(S_GENERAL, K_MODIFY, If(Map.refDrawPanelVM.ModifyIsExpanded, "1", "0"))
@@ -567,7 +567,7 @@ Public Class MainWindowVM
#Region "Events"
- Private Sub MainWindow_KeyDown(ByVal sender As System.Object, ByVal e As KeyEventArgs)
+ Private Sub MainWindow_KeyDown(ByVal sender As Object, ByVal e As KeyEventArgs)
' Con ESC esco dall'azione corrente
If e.Key = Key.Escape Then
' reset Azione corrente
@@ -593,4 +593,40 @@ Public Class MainWindowVM
#End Region
+#Region "MEF Plugin"
+
+ Private m_Loader As MEFLoader = New MEFLoader()
+
+ Private Function GetPathByName(ByVal name As String) As String
+ Dim PluginNameSplit() As String = name.Split("."c)
+ Dim res = Map.refMainWindowVM.m_sDataRoot & "\Plugin\" & PluginNameSplit(0)
+ Return res
+ End Function
+
+ Friend Function GetControlByName(Of T)(ByVal name As String) As Panel
+ Dim PlugInControl As Object = m_Loader.LoadByTag(Of T)(GetPathByName(name), name).FirstOrDefault()
+ Dim PluginPanel As Panel = Nothing
+ Select Case PlugInControl.GetType().BaseType.FullName
+ Case GetType(Panel).FullName, GetType(Grid).FullName
+ PluginPanel = TryCast(PlugInControl, Panel)
+ Case GetType(Forms.UserControl).FullName
+ Dim PluginUserControl As Forms.UserControl = TryCast(PlugInControl, Forms.UserControl)
+ PluginPanel = New WinFormPluginControlV(New WinFormPluginControlVM(PluginUserControl))
+ End Select
+ Return PluginPanel
+ End Function
+
+ Friend Function GetConfigData(Of T)(ByVal name As String) As IPluginConfigData
+ Dim PlugInControl As Object = m_Loader.LoadByTag(Of T)(GetPathByName(name), name).FirstOrDefault()
+ Dim PluginConfigData As IPluginConfigData = Nothing
+ Dim v = PlugInControl.GetType()
+ If PlugInControl.GetType().Name = PLUGIN_CONFIGURATION_DATA Then
+ Return TryCast(PlugInControl, IPluginConfigData)
+ Else
+ Return Nothing
+ End If
+ End Function
+
+#End Region ' MEF Plugin
+
End Class
\ No newline at end of file
diff --git a/OptionPanel/MachiningOptionPanel/OperationsListExpander/OperationsListExpanderVM.vb b/OptionPanel/MachiningOptionPanel/OperationsListExpander/OperationsListExpanderVM.vb
index 3a07d3d..fdb7238 100644
--- a/OptionPanel/MachiningOptionPanel/OperationsListExpander/OperationsListExpanderVM.vb
+++ b/OptionPanel/MachiningOptionPanel/OperationsListExpander/OperationsListExpanderVM.vb
@@ -971,8 +971,8 @@ Public Class OperationsListExpanderVM
Map.refProjectVM.SceneSelMode = SceneSelModeOpt.ALL
OnPropertyChanged("ListIsExpanded")
Map.refMachinePanelVM.ToolMachSetUpIsEnabled(True, True, True)
- Map.refDoorPanelVM.MTableIsEnabled(True)
- Map.refSpecialPanelVM.SpecialPanelIsEnabled(True)
+ If Not IsNothing(Map.refDoorPanelVM) Then Map.refDoorPanelVM.MTableIsEnabled(True)
+ If Not IsNothing(Map.refSpecialPanelVM) Then Map.refSpecialPanelVM.SpecialPanelIsEnabled(True)
Return True
End Function
diff --git a/Project/ProjectV.xaml b/Project/ProjectV.xaml
index d946ce8..234c847 100644
--- a/Project/ProjectV.xaml
+++ b/Project/ProjectV.xaml
@@ -1,108 +1,26 @@
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/Project/ProjectV.xaml.vb b/Project/ProjectV.xaml.vb
index 67593ff..8f3119e 100644
--- a/Project/ProjectV.xaml.vb
+++ b/Project/ProjectV.xaml.vb
@@ -7,18 +7,17 @@ Public Class ProjectV
Private m_bWall As Boolean = False
Private m_bDoors As Boolean = False
Private m_bGunStock As Boolean = False
- Private m_bPrinting3d As Boolean = False
Private Sub UserControl_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
' Creo riferimento a questa classe in Map
Map.SetRefProjectV(Me)
- SpecialPanel.Visibility = Visibility.Collapsed
- BeamPanel.Visibility = Visibility.Collapsed
- WallPanel.Visibility = Visibility.Collapsed
- DoorsPanel.Visibility = Visibility.Collapsed
- GunStockPanel.Visibility = Visibility.Collapsed
- PrintingPanel.Visibility = Visibility.Collapsed
- Map.refMachGroupPanelVM.SetMachGroupPanelVisibility(False) ' MachGroupPanel.Visibility = Visibility.Collapsed
+ 'SpecialPanel.Visibility = Visibility.Collapsed
+ 'BeamPanel.Visibility = Visibility.Collapsed
+ 'WallPanel.Visibility = Visibility.Collapsed
+ 'DoorsPanel.Visibility = Visibility.Collapsed
+ 'GunStockPanel.Visibility = Visibility.Collapsed
+ 'PrintingPanel.Visibility = Visibility.Collapsed
+ ' Map.refMachGroupPanelVM.SetMachGroupPanelVisibility(False) ' MachGroupPanel.Visibility = Visibility.Collapsed
End Sub
Private Sub UserControl_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
@@ -48,7 +47,6 @@ Public Class ProjectV
m_bWall = IniFile.IsActiveWall()
m_bDoors = IniFile.IsActiveDoors()
m_bGunStock = IniFile.IsActiveGunStock()
- m_bPrinting3d = IniFile.IsActivePrinting3d()
End Sub
Private Sub PanelPositioning(FloatingPanel As EgtFloatingPanel, sState As String, nIndex As Integer, nLeft As Integer, nTop As Integer)
@@ -67,47 +65,47 @@ Public Class ProjectV
End Sub
Friend Sub SetDbPanelVisibility()
- DbPanel.Visibility = If(IniFile.m_ProjectMode = ProjectModeOpt.ONLYDRAW, Visibility.Collapsed, Visibility.Visible)
+ 'DbPanel.Visibility = If(IniFile.m_ProjectMode = ProjectModeOpt.ONLYDRAW, Visibility.Collapsed, Visibility.Visible)
End Sub
Friend Sub MachiningMode_IsChecked()
- 'ShowPanel.Visibility = Visibility.Visible
- ViewPanel.Visibility = Visibility.Visible
- 'InstrumentPanel.Visibility = Visibility.Visible
- GridPanel.Visibility = Visibility.Visible
- DbPanel.Visibility = Visibility.Visible
- ExecutePanel.Visibility = Visibility.Collapsed
- SpecialPanel.Visibility = If(m_bSpecial And Map.refSpecialPanelVM.SetSpecialPanelButtonsVisibility(True), Visibility.Visible, Visibility.Collapsed)
- BeamPanel.Visibility = Visibility.Collapsed
- WallPanel.Visibility = Visibility.Collapsed
- BeamWallPanel.Visibility = Visibility.Collapsed
- DoorsPanel.Visibility = If(m_bDoors, Visibility.Visible, Visibility.Collapsed)
- PrintingPanel.Visibility = Visibility.Collapsed
- GunStockPanel.Visibility = Visibility.Collapsed
- DrawPanel.Visibility = Visibility.Collapsed
- OptionPanel.Visibility = Visibility.Visible
+ ''ShowPanel.Visibility = Visibility.Visible
+ 'ViewPanel.Visibility = Visibility.Visible
+ ''InstrumentPanel.Visibility = Visibility.Visible
+ 'GridPanel.Visibility = Visibility.Visible
+ 'DbPanel.Visibility = Visibility.Visible
+ 'ExecutePanel.Visibility = Visibility.Collapsed
+ 'SpecialPanel.Visibility = If(m_bSpecial And Map.refSpecialPanelVM.SetSpecialPanelButtonsVisibility(True), Visibility.Visible, Visibility.Collapsed)
+ 'BeamPanel.Visibility = Visibility.Collapsed
+ 'WallPanel.Visibility = Visibility.Collapsed
+ 'BeamWallPanel.Visibility = Visibility.Collapsed
+ 'DoorsPanel.Visibility = If(m_bDoors, Visibility.Visible, Visibility.Collapsed)
+ 'PrintingPanel.Visibility = Visibility.Collapsed
+ 'GunStockPanel.Visibility = Visibility.Collapsed
+ 'DrawPanel.Visibility = Visibility.Collapsed
+ 'OptionPanel.Visibility = Visibility.Visible
Map.refMachGroupPanelVM.SetMachGroupPanelVisibility(IniFile.m_bMachiningGroup) ' MachGroupPanel.Visibility = If(IniFile.m_bMachiningGroup, Visibility.Visible, Visibility.Collapsed)
If m_bDoors Then Map.refDoorPanelVM.SetDoorPanelButtonsVisibility(False)
End Sub
Friend Sub DrawMode_IsChecked()
- 'ShowPanel.Visibility = Visibility.Visible
- ViewPanel.Visibility = Visibility.Visible
- 'InstrumentPanel.Visibility = Visibility.Visible
- GridPanel.Visibility = Visibility.Visible
- DbPanel.Visibility = If(IniFile.m_ProjectMode = ProjectModeOpt.ONLYDRAW, Visibility.Collapsed, Visibility.Visible)
- ExecutePanel.Visibility = Visibility.Visible
- SpecialPanel.Visibility = If(m_bSpecial And Map.refSpecialPanelVM.SetSpecialPanelButtonsVisibility(False), Visibility.Visible, Visibility.Collapsed)
- BeamPanel.Visibility = If(m_bBeam, Visibility.Visible, Visibility.Collapsed)
- WallPanel.Visibility = If(m_bWall, Visibility.Visible, Visibility.Collapsed)
- BeamWallPanel.Visibility = If(m_bBeam Or m_bWall, Visibility.Visible, Visibility.Collapsed)
- DoorsPanel.Visibility = If(m_bDoors, Visibility.Visible, Visibility.Collapsed)
- PrintingPanel.Visibility = If(m_bPrinting3d, Visibility.Visible, Visibility.Collapsed)
- GunStockPanel.Visibility = If(m_bGunStock, Visibility.Visible, Visibility.Collapsed)
- DrawPanel.Visibility = Visibility.Visible
- OptionPanel.Visibility = Visibility.Visible
- Map.refMachGroupPanelVM.SetMachGroupPanelVisibility(False) ' MachGroupPanel.Visibility = Visibility.Collapsed
- If m_bDoors Then Map.refDoorPanelVM.SetDoorPanelButtonsVisibility(True)
+ ''ShowPanel.Visibility = Visibility.Visible
+ 'ViewPanel.Visibility = Visibility.Visible
+ ''InstrumentPanel.Visibility = Visibility.Visible
+ 'GridPanel.Visibility = Visibility.Visible
+ 'DbPanel.Visibility = If(IniFile.m_ProjectMode = ProjectModeOpt.ONLYDRAW, Visibility.Collapsed, Visibility.Visible)
+ 'ExecutePanel.Visibility = Visibility.Visible
+ 'SpecialPanel.Visibility = If(m_bSpecial And Map.refSpecialPanelVM.SetSpecialPanelButtonsVisibility(False), Visibility.Visible, Visibility.Collapsed)
+ 'BeamPanel.Visibility = If(m_bBeam, Visibility.Visible, Visibility.Collapsed)
+ 'WallPanel.Visibility = If(m_bWall, Visibility.Visible, Visibility.Collapsed)
+ 'BeamWallPanel.Visibility = If(m_bBeam Or m_bWall, Visibility.Visible, Visibility.Collapsed)
+ 'DoorsPanel.Visibility = If(m_bDoors, Visibility.Visible, Visibility.Collapsed)
+ 'PrintingPanel.Visibility = If(m_bPrinting3d, Visibility.Visible, Visibility.Collapsed)
+ 'GunStockPanel.Visibility = If(m_bGunStock, Visibility.Visible, Visibility.Collapsed)
+ 'DrawPanel.Visibility = Visibility.Visible
+ 'OptionPanel.Visibility = Visibility.Visible
+ ' Map.refMachGroupPanelVM.SetMachGroupPanelVisibility(False) ' MachGroupPanel.Visibility = Visibility.Collapsed
+ ' If m_bDoors Then Map.refDoorPanelVM.SetDoorPanelButtonsVisibility(True)
End Sub
Private Sub UserControl_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
diff --git a/Project/ProjectVM.vb b/Project/ProjectVM.vb
index 7a41c9e..5e76842 100644
--- a/Project/ProjectVM.vb
+++ b/Project/ProjectVM.vb
@@ -7,86 +7,125 @@ Imports EgtWPFLib5
Imports EgtWPFLib5.EgtFloating
Public Class ProjectVM
- Inherits TabViewModel
+ Inherits TabViewModel
#Region "FIELDS"
- Friend Event OnPreControllerExec(sFilePath As String)
- Friend Event OnPostControllerExec()
+ Friend Event OnPreControllerExec(sFilePath As String)
+ Friend Event OnPostControllerExec()
- ' Variabili in cui salvo i filtri di selezione della modalità Draw e che poi ripristino all'uscita dalla modalità Machining
- Private m_bSelZeroDim As Boolean = True
- Private m_bSelCurve As Boolean = True
- Private m_bSelSurf As Boolean = True
- Private m_bSelVolume As Boolean = True
- Private m_bSelExtra As Boolean = True
+ ' Variabili in cui salvo i filtri di selezione della modalità Draw e che poi ripristino all'uscita dalla modalità Machining
+ Private m_bSelZeroDim As Boolean = True
+ Private m_bSelCurve As Boolean = True
+ Private m_bSelSurf As Boolean = True
+ Private m_bSelVolume As Boolean = True
+ Private m_bSelExtra As Boolean = True
- Private m_bLoaded As Boolean = False
+ Private m_bLoaded As Boolean = False
- ' Variabile che contiene il Frame di disegno per poterlo ripristinare dopo essere passato dalla lavorazioneù
- Private m_GridDrawFrame3d As Frame3d = New Frame3d(New Point3d(0, 0, 0))
+ ' Variabile che contiene il Frame di disegno per poterlo ripristinare dopo essere passato dalla lavorazioneù
+ Private m_GridDrawFrame3d As Frame3d = New Frame3d(New Point3d(0, 0, 0))
- 'PROJECT PAGE'S SCENE FIELDS AND PROPERTIES
- ' Reference to the ProjectScene
- Private WithEvents m_ProjectScene As New Scene
- ' Reference to the ProjectSceneHost
- Private SceneHost As WindowsFormsHost
- ' Property used to bind the scene to the WindowsFormsHost in XAML
- Private m_bfirst As Boolean = True
- Public ReadOnly Property ProjectSceneHost As WindowsFormsHost
- Get
- If m_bfirst Then
- SceneHost = New WindowsFormsHost() With {.Child = m_ProjectScene}
- m_bfirst = False
- End If
- Return SceneHost
- End Get
- End Property
- ' Scene controller
- Private WithEvents m_Controller As New Controller
+ 'PROJECT PAGE'S SCENE FIELDS AND PROPERTIES
+ ' Reference to the ProjectScene
+ Private WithEvents m_ProjectScene As New Scene
+ ' Reference to the ProjectSceneHost
+ Private SceneHost As WindowsFormsHost
+ ' Property used to bind the scene to the WindowsFormsHost in XAML
+ Private m_bfirst As Boolean = True
+ Public ReadOnly Property ProjectSceneHost As WindowsFormsHost
+ Get
+ If m_bfirst Then
+ SceneHost = New WindowsFormsHost() With {.Child = m_ProjectScene}
+ m_bfirst = False
+ End If
+ Return SceneHost
+ End Get
+ End Property
+ ' Scene controller
+ Private WithEvents m_Controller As New Controller
- ' Definizione comandi
- Private m_cmdLoaded As ICommand
+ ' Definizione comandi
+ Private m_cmdLoaded As ICommand
- ' Flag per non salvare Script appena eseguito in elenco MruScript
- Private m_bScriptInMru As Boolean = True
+ ' Flag per non salvare Script appena eseguito in elenco MruScript
+ Private m_bScriptInMru As Boolean = True
+
+ Private m_PanelList As New List(Of Panel)
+ Public ReadOnly Property PanelList As List(Of Panel)
+ Get
+ Return m_PanelList
+ End Get
+ End Property
#End Region
#Region "EGTUILIB FIELDS"
- Private m_bCPlaneTypePos As Boolean
- 'Private m_bStopExec As Boolean = False
- 'Private m_ProcEventsCallback As New ProcessEventsCallback(AddressOf ProcessEvents)
- 'Private m_OutTextCallback As New OutTextCallback(AddressOf OutText)
+ Private m_bCPlaneTypePos As Boolean
+ 'Private m_bStopExec As Boolean = False
+ 'Private m_ProcEventsCallback As New ProcessEventsCallback(AddressOf ProcessEvents)
+ 'Private m_OutTextCallback As New OutTextCallback(AddressOf OutText)
- ' Variabile per implementazione eventi
- Private m_InputText As String
+ ' Variabile per implementazione eventi
+ Private m_InputText As String
#End Region
#Region "CONSTRUCTOR"
- Sub New()
- ' Creo riferimento a questa classe in EgtCAM5Map e in ButtonItem
- Map.SetRefProjectVM(Me)
- ButtonItem.m_ProjectVM = Me
- ' Creo classe di supporto per la visualizzazione dei parametri utensile e di lavorazione per Db e operazioni
- TMDbParamVisibility.bFirst = True
- ' Inizializza i parametri della scena
- 'InitializeEgtProject()
- End Sub
+ Sub New()
+ ' Creo riferimento a questa classe in EgtCAM5Map e in ButtonItem
+ Map.SetRefProjectVM(Me)
+ ButtonItem.m_ProjectVM = Me
+ ' Creo classe di supporto per la visualizzazione dei parametri utensile e di lavorazione per Db e operazioni
+ TMDbParamVisibility.bFirst = True
+ ' Inizializza i parametri della scena
+ 'InitializeEgtProject()
+ ' aggiungo componenti interfaccia
+ Dim bPlugin As Boolean = True
+ If IsActivePlugin() Then
+ ' recupero nome del plugin
+ Dim PluginDirNameList() As String = Directory.GetDirectories(IniFile.m_sDataRoot & "\Plugin")
+ For Each PluginDirName In PluginDirNameList
+ Dim PluginName As String = Path.GetFileNameWithoutExtension(PluginDirName)
+ Dim ConfigurationData As IPluginConfigData = Map.refMainWindowVM.GetConfigData(Of IPluginConfigData)(PluginName & ".ConfigurationData")
+ If Not IsNothing(ConfigurationData) And ConfigurationData.ControlList.Count > 0 Then
+ For Each Element In ConfigurationData.ControlList
+ Select Case Element
+ Case PLUGIN_RIGHT_TRAY
+ m_PanelList.Add(New RightTrayV)
+ Case PLUGIN_LEFT_TRAY
+ m_PanelList.Add(New LeftTrayV)
+ Case Else
+ m_PanelList.Add(Map.refMainWindowVM.GetControlByName(Of IPluginControl)(Element))
+ End Select
+ Next
+ End If
+
+ Next
+
+ m_PanelList.Add(New BottomTrayV)
+ m_PanelList.Add(New TopTrayV)
+ Else
+ m_PanelList.Add(New TopTrayV)
+ m_PanelList.Add(New LeftTrayV)
+ m_PanelList.Add(New RightTrayV)
+ m_PanelList.Add(New BottomTrayV)
+ End If
+ m_PanelList.Add(New SceneContentControlV)
+ End Sub
#End Region
#Region "Get & Set"
- Friend Function GetScene() As Scene
- Return m_ProjectScene
- End Function
+ Friend Function GetScene() As Scene
+ Return m_ProjectScene
+ End Function
- Friend Function GetController() As Controller
- Return m_Controller
- End Function
+ Friend Function GetController() As Controller
+ Return m_Controller
+ End Function
#End Region ' Get & Set
@@ -100,7 +139,7 @@ Public Class ProjectVM
Public ReadOnly Property LoadedCommand As ICommand
Get
If m_cmdLoaded Is Nothing Then
- m_cmdLoaded = New RelayCommand(AddressOf Loaded)
+ m_cmdLoaded = New RelayCommand(AddressOf Loaded)
End If
Return m_cmdLoaded
End Get
@@ -129,42 +168,42 @@ Public Class ProjectVM
Map.refProjectV.SetDbPanelVisibility()
End If
' Inizializzo gestore travi e pareti
- If ( IniFile.m_nKeyOptions And KEY_OPT.BEAM) <> 0 Or ( IniFile.m_nKeyOptions And KEY_OPT.WALL) <> 0 Then
- Dim nFlag As Integer = GetPrivateProfileInt( S_IMPORT, K_BTLFLAG, EIB_FL.NONE)
- EgtInitBeamMgr( nFlag)
+ If (IniFile.m_nKeyOptions And KEY_OPT.BEAM) <> 0 Or (IniFile.m_nKeyOptions And KEY_OPT.WALL) <> 0 Then
+ Dim nFlag As Integer = GetPrivateProfileInt(S_IMPORT, K_BTLFLAG, EIB_FL.NONE)
+ EgtInitBeamMgr(nFlag)
End If
' Log di eventuali estensioni
- EgtOutLog( "Extensions :")
+ EgtOutLog("Extensions :")
Dim bExtensions As Boolean = False
If IniFile.IsActiveBeam() Then
bExtensions = True
Dim sVersion As String = "---"
- IniFile.GetSpecialLuaVersion( IniFile.m_sBeamDirPath, sVersion)
+ IniFile.GetSpecialLuaVersion(IniFile.m_sBeamDirPath, sVersion)
Dim sOut As String = "Beam ver. " & sVersion & " " & IniFile.m_sBeamDirPath
- EgtOutLog( sOut)
+ EgtOutLog(sOut)
End If
If IniFile.IsActiveWall() Then
bExtensions = True
Dim sVersion As String = "---"
- IniFile.GetSpecialLuaVersion( IniFile.m_sWallDirPath, sVersion)
+ IniFile.GetSpecialLuaVersion(IniFile.m_sWallDirPath, sVersion)
Dim sOut As String = "Wall ver. " & sVersion & " " & IniFile.m_sWallDirPath
- EgtOutLog( sOut)
+ EgtOutLog(sOut)
End If
If IniFile.IsActiveDoors() Then
bExtensions = True
Dim sVersion As String = "---"
- IniFile.GetSpecialLuaVersion( IniFile.m_sDoorsDirPath, sVersion)
+ IniFile.GetSpecialLuaVersion(IniFile.m_sDoorsDirPath, sVersion)
Dim sOut As String = "Doors ver. " & sVersion & " " & IniFile.m_sDoorsDirPath
- EgtOutLog( sOut)
+ EgtOutLog(sOut)
End If
If IniFile.IsActiveGunStock() Then
bExtensions = True
Dim sVersion As String = "---"
- IniFile.GetSpecialLuaVersion( IniFile.m_sGunstockDirPath, sVersion)
+ IniFile.GetSpecialLuaVersion(IniFile.m_sGunstockDirPath, sVersion)
Dim sOut As String = "Gunstock ver. " & sVersion & " " & IniFile.m_sGunstockDirPath
- EgtOutLog( sOut)
+ EgtOutLog(sOut)
End If
- If Not bExtensions Then EgtOutLog( "---")
+ If Not bExtensions Then EgtOutLog("---")
' Apro progetto vuoto
Map.refTopCommandBarVM.NewCmd()
' Seleziono la macchina impostata nel file ini
@@ -270,8 +309,8 @@ Public Class ProjectVM
If Not m_Controller.SetCommandLog(bLuaReg, m_sTempDir, sCmdLogFile) Then
EgtOutLog("Command log not started")
If Environment.GetCommandLineArgs.Count() <= 1 Then
- MessageBox.Show("Command log not started", "EgtCAM5 Warning",
- MessageBoxButton.OK, MessageBoxImage.Warning)
+ MessageBox.Show("Command log not started", "EgtCAM5 Warning",
+ MessageBoxButton.OK, MessageBoxImage.Warning)
End If
End If
m_Controller.SetSurfTmTolerance(OptionModule.m_dGeometryTolerance)
@@ -323,9 +362,9 @@ Public Class ProjectVM
' lettura flag visualizzazione solo tavola in definizione lavorazioni
IniFile.m_bShowOnlyTable = (GetPrivateProfileInt(S_MACH, K_SHOWONLYTABLE, 1) <> 0)
' ObjTree non selezionato
- Map.refManageLayerExpanderVM.UpdateObjTreeOldId(GDB_ID.NULL)
+ If Not IsNothing(Map.refManageLayerExpanderVM) Then Map.refManageLayerExpanderVM.UpdateObjTreeOldId(GDB_ID.NULL)
' nascondo input box
- Map.refInputExpanderVM.ResetInputBox()
+ If Not IsNothing(Map.refInputExpanderVM) Then Map.refInputExpanderVM.ResetInputBox()
' Imposto stato filtro selezione
m_ProjectScene.GetObjFilterForSel(m_bSelZeroDim, m_bSelCurve, m_bSelSurf, m_bSelVolume, m_bSelExtra)
m_Controller.MouseSetObjFilterForSelect(m_bSelZeroDim, m_bSelCurve, m_bSelSurf, m_bSelVolume, m_bSelExtra)
@@ -412,8 +451,8 @@ Public Class ProjectVM
Return
End If
' Esecuzione
- bOk = ExecBeam(sFile, sMachine, nFlag, true)
- ' altrimenti pareti
+ bOk = ExecBeam(sFile, sMachine, nFlag, True)
+ ' altrimenti pareti
Else
' Verifica abilitazione elaborazione pareti
If Not VerifyWall(sFile, sMachine, nFlag) Then
@@ -421,18 +460,18 @@ Public Class ProjectVM
Return
End If
' Esecuzione
- bOk = ExecWall(sFile, sMachine, nFlag, true)
+ bOk = ExecWall(sFile, sMachine, nFlag, True)
End If
' Se richiesta uscita immediata
If nFlag = 0 Or nFlag = 3 Or nFlag = 4 Then
Map.refMachinePanelVM.SaveCurrentMachine()
Map.refMainWindowVM.CloseApplicationCmd()
- ' Altrimenti se richiesta visualizzazione DB utensili
+ ' Altrimenti se richiesta visualizzazione DB utensili
ElseIf nFlag = 11 And bOk Then
MyMachinePanelVM.ToolDb()
Map.refMachinePanelVM.SaveCurrentMachine()
Map.refMainWindowVM.CloseApplicationCmd()
- ' Altrimenti se richiesta visualizzazione DB lavorazioni
+ ' Altrimenti se richiesta visualizzazione DB lavorazioni
ElseIf nFlag = 12 And bOk Then
MyMachinePanelVM.MachDb()
If bBeam Then
@@ -442,7 +481,7 @@ Public Class ProjectVM
End If
Map.refMachinePanelVM.SaveCurrentMachine()
Map.refMainWindowVM.CloseApplicationCmd()
- ' Altrimenti se errore
+ ' Altrimenti se errore
ElseIf Not bOk Then
EgtZoom(ZM.ALL)
End If
@@ -503,8 +542,8 @@ Public Class ProjectVM
Return
End If
' Esecuzione
- bOk = ExecBeam(sFile, sMachine, nFlag, false)
- ' altrimenti pareti
+ bOk = ExecBeam(sFile, sMachine, nFlag, False)
+ ' altrimenti pareti
ElseIf nBWType = 2 Then
' Verifica abilitazione elaborazione pareti
If Not VerifyWall(sFile, sMachine, nFlag) Then
@@ -512,13 +551,13 @@ Public Class ProjectVM
Return
End If
' Esecuzione
- bOk = ExecWall(sFile, sMachine, nFlag, false)
+ bOk = ExecWall(sFile, sMachine, nFlag, False)
End If
' Se richiesta uscita immediata
If nFlag = 0 Or nFlag = 3 Or nFlag = 4 Then
Map.refMachinePanelVM.SaveCurrentMachine()
Map.refMainWindowVM.CloseApplicationCmd()
- ' Altrimenti se errore
+ ' Altrimenti se errore
ElseIf Not bOk Then
EgtZoom(ZM.ALL)
End If
@@ -685,7 +724,7 @@ Public Class ProjectVM
GetPrivateProfileString(S_GENERAL, K_LASTLUADIR, "", sDir)
m_Controller.Exec(sDir)
Else
- If bRaiseEvent Then RaiseEvent OnPreControllerExec( sFilePath)
+ If bRaiseEvent Then RaiseEvent OnPreControllerExec(sFilePath)
m_Controller.Exec(sFilePath, False)
If bRaiseEvent Then RaiseEvent OnPostControllerExec()
End If
@@ -809,7 +848,7 @@ Public Class ProjectVM
' Copia dei file terminata con successo ...
Dim sMsg As String = EgtMsg(8216) & vbCrLf & sFilePath & vbCrLf & "->" & sDirDest
MessageBox.Show(sMsg, EgtMsg(8214), MessageBoxButton.OK, MessageBoxImage.Information)
- else
+ Else
' Errore nella copia dei file ...
Dim sMsg As String = EgtMsg(8255) & vbCrLf & sFilePath & vbCrLf & "->" & sDirDest
MessageBox.Show(sMsg, EgtMsg(8251), MessageBoxButton.OK, MessageBoxImage.Error)
@@ -1134,22 +1173,22 @@ Public Class ProjectVM
' Se eseguito drag
If Not m_bDragToStart Then
' Basta reset alla fine
- ' se sono in modalità movimento barre
+ ' se sono in modalità movimento barre
ElseIf m_SelType = DispositionUtility.SelType.BARS Then
' Basta reset alla fine
- ' Se selezione da eseguire
+ ' Se selezione da eseguire
ElseIf m_nIdToSel <> GDB_ID.NULL Then
' se sono in modalità sottopezzi
If m_SceneSelType = SceneSelTypeOpt.FIXTURE Then
' se il sottopezzo da selezionare è un riferimento e ci sono altri oggetti selezionati resetto lo stato di selezione ed esco
- If DispositionUtility.FixtureType(m_nIdToSel) = DispositionUtility.FIX_TYPE.REFERENCE AndAlso
+ If DispositionUtility.FixtureType(m_nIdToSel) = DispositionUtility.FIX_TYPE.REFERENCE AndAlso
EgtGetSelectedObjCount() > 0 Then
m_bDrag = False
m_nIdToSel = GDB_ID.NULL
m_nIdToDesel = GDB_ID.NULL
EgtDraw()
Return
- ' altrimenti verifico il tipo del primo oggetto selezionato
+ ' altrimenti verifico il tipo del primo oggetto selezionato
Else
Dim nFirstSelId As Integer = EgtGetFirstSelectedObj()
' se è un riferimento resetto lo stato di selezione ed esco
@@ -1175,7 +1214,7 @@ Public Class ProjectVM
End If
' Eseguo la selezione
EgtSelectObj(m_nIdToSel)
- ' Se deselezione da eseguire
+ ' Se deselezione da eseguire
ElseIf m_nIdToDesel <> GDB_ID.NULL Then
' se l'elemento da deselezionare è marcato
Dim bMarked As Boolean = False
@@ -1217,9 +1256,9 @@ Public Class ProjectVM
If Not bOk Then Return
' Impedisco la selezione di oggetti in modo Locked o Hidden
Dim nMode As Integer = GDB_MD.STD
- EgtGetCalcMode( nId, nMode)
+ EgtGetCalcMode(nId, nMode)
If nMode <> GDB_MD.STD Then
- bOk = False
+ bOk = False
Return
End If
' Se in modalità Draw accetto tutto
@@ -1235,7 +1274,7 @@ Public Class ProjectVM
End If
Case SceneSelTypeOpt.MACHPATH
Dim nCurrOpeId As Integer = Map.refOperationsListExpanderVM.GetOperationId(nId)
- bOk = ( nCurrOpeId <> GDB_ID.NULL AndAlso nCurrOpeId <> m_nSelOpeId)
+ bOk = (nCurrOpeId <> GDB_ID.NULL AndAlso nCurrOpeId <> m_nSelOpeId)
If m_nSelOpeId = GDB_ID.NULL Then m_nSelOpeId = nCurrOpeId
Case Else
bOk = False
@@ -1268,15 +1307,15 @@ Public Class ProjectVM
Private Sub OnMousePointFromSelection(ByVal sender As Object, ByVal nId As Integer, ByVal PtP As Point3d, ByVal nAux As Integer) Handles m_ProjectScene.OnMousePointFromSelection
m_Controller.SetPointFromSelection(nId, PtP, nAux)
If IniFile.m_ProjectMode = ProjectModeOpt.MACHINING And m_SceneSelType = SceneSelTypeOpt.MACHINING And
- ( EgtGetType( nId) = GDB_TY.SRF_MESH Or EgtGetType( nId) = GDB_TY.SRF_FRGN) Then
- If EgtIsSelectedObj( nId) Then
- Dim nFac As Integer = If( EgtGetType( nId) = GDB_TY.SRF_MESH, Math.Max( EgtSurfTmFacetFromTria( nId, nAux), 0), nAux)
- If Not SelData.FindIdSub( nId, nFac) Then
+ (EgtGetType(nId) = GDB_TY.SRF_MESH Or EgtGetType(nId) = GDB_TY.SRF_FRGN) Then
+ If EgtIsSelectedObj(nId) Then
+ Dim nFac As Integer = If(EgtGetType(nId) = GDB_TY.SRF_MESH, Math.Max(EgtSurfTmFacetFromTria(nId, nAux), 0), nAux)
+ If Not SelData.FindIdSub(nId, nFac) Then
SelData.AddIdSub(nId, nFac)
Else
SelData.RemoveIdSub(nId, nFac)
- If Not SelData.FindId( nId) Then
- EgtDeselectObj( nId)
+ If Not SelData.FindId(nId) Then
+ EgtDeselectObj(nId)
End If
End If
Else
@@ -1310,29 +1349,29 @@ Public Class ProjectVM
Analyze.ClearAnalyzeGroup()
Map.refStatusBarVM.NotifyStatusOutput("")
' Se curva composita, visualizzo numerazione curve semplici
- If EgtGetType( nId) = GDB_TY.CRV_COMPO Then
+ If EgtGetType(nId) = GDB_TY.CRV_COMPO Then
' Visualizzo numerazione
Analyze.CreateAnalyzeGroup()
- Analyze.CreateCurveCompoPntNbrs( nId)
- ' Se superficie trimesh, visualizzo dati faccetta toccata
- ElseIf EgtGetType( nId) = GDB_TY.SRF_MESH Then
- Dim nFac As Integer = EgtSurfTmFacetFromTria( nId, nSub)
+ Analyze.CreateCurveCompoPntNbrs(nId)
+ ' Se superficie trimesh, visualizzo dati faccetta toccata
+ ElseIf EgtGetType(nId) = GDB_TY.SRF_MESH Then
+ Dim nFac As Integer = EgtSurfTmFacetFromTria(nId, nSub)
If nFac <> -1 Then
' Visualizzo la normale e il contorno della faccia
Analyze.CreateAnalyzeGroup()
- Analyze.CreateNormal( nId, nFac)
- Analyze.CreateFacetLoops( nId, nFac)
+ Analyze.CreateNormal(nId, nFac)
+ Analyze.CreateFacetLoops(nId, nFac)
' Recupero i dati (in globale o griglia a seconda della impostazione)
Dim ptC As Point3d
Dim vtN As Vector3d
- EgtSurfTmFacetCenter( nId, nFac, If( m_bCPlaneTypePos, GDB_ID.GRID, GDB_ID.ROOT), ptC, vtN)
+ EgtSurfTmFacetCenter(nId, nFac, If(m_bCPlaneTypePos, GDB_ID.GRID, GDB_ID.ROOT), ptC, vtN)
Dim dLen, dPhi, dTheta As Double
- vtN.ToSpherical( dLen, dTheta, dPhi)
+ vtN.ToSpherical(dLen, dTheta, dPhi)
' Emetto info sulla barra di stato
Dim sOut As String = "Facet " + nFac.ToString() +
- " : C(" + LenToString( ptC.x, 3) + "," + LenToString( ptC.y, 3) + "," + LenToString( ptC.z, 3) + ")" +
- " N(" + DoubleToString( vtN.x, 4) + "," + DoubleToString( vtN.y, 4) + "," + DoubleToString( vtN.z, 4) + ")" +
- " / φ=" + DoubleToString( dPhi, 2) + " θ=" + DoubleToString( dTheta, 2)
+ " : C(" + LenToString(ptC.x, 3) + "," + LenToString(ptC.y, 3) + "," + LenToString(ptC.z, 3) + ")" +
+ " N(" + DoubleToString(vtN.x, 4) + "," + DoubleToString(vtN.y, 4) + "," + DoubleToString(vtN.z, 4) + ")" +
+ " / φ=" + DoubleToString(dPhi, 2) + " θ=" + DoubleToString(dTheta, 2)
Map.refStatusBarVM.NotifyStatusOutput(sOut)
End If
End If
@@ -1349,19 +1388,19 @@ Public Class ProjectVM
If e.KeyData = System.Windows.Forms.Keys.Delete AndAlso Map.refTopCommandBarVM.DrawIsChecked Then
m_Controller.SetLastInteger(GDB_ID.SEL)
m_Controller.ExecuteCommand(Controller.CMD.DELETE)
- ' Con END eseguo deselezione di tutto
+ ' Con END eseguo deselezione di tutto
ElseIf e.KeyData = System.Windows.Forms.Keys.End Then
- m_Controller.MouseDeselectedAll( True)
- ' Con SPAZIO ripeto l'ultimo comando
+ m_Controller.MouseDeselectedAll(True)
+ ' Con SPAZIO ripeto l'ultimo comando
ElseIf e.KeyData = System.Windows.Forms.Keys.Space Then
m_Controller.RepeatLastCommand()
- ' Con 'A' e in modalità continuazione, forzo il passaggio ad arco
+ ' Con 'A' e in modalità continuazione, forzo il passaggio ad arco
ElseIf e.KeyData = System.Windows.Forms.Keys.A AndAlso m_Controller.GetContinue() Then
m_Controller.ContinueArcPDP()
- ' Con 'L' e in modalità continuazione, forzo il passaggio a retta
+ ' Con 'L' e in modalità continuazione, forzo il passaggio a retta
ElseIf e.KeyData = System.Windows.Forms.Keys.L AndAlso m_Controller.GetContinue() Then
m_Controller.ContinueLine2P()
- ' Con 'V' cambio lo stato del check
+ ' Con 'V' cambio lo stato del check
ElseIf e.KeyData = System.Windows.Forms.Keys.V Then
Map.refInputExpanderVM.ChangeInputBoxCheck()
End If
@@ -1387,7 +1426,7 @@ Public Class ProjectVM
End Sub
Private Sub OnOpeningProject(ByVal sender As Object) Handles m_Controller.OnOpeningProject
- Map.refManageLayerExpanderVM.ClearObjTree()
+ If Not IsNothing(Map.refManageLayerExpanderVM) Then Map.refManageLayerExpanderVM.ClearObjTree()
End Sub
Private Sub OnOpenProject(ByVal sender As Object, ByVal sFile As String, ByVal bOk As Boolean) Handles m_Controller.OnOpenProject
@@ -1398,7 +1437,7 @@ Public Class ProjectVM
Else
IniFile.m_MruFiles.Remove(sFile)
Dim sMsg As String
- If My.Computer.FileSystem.FileExists( sFile) Then
+ If My.Computer.FileSystem.FileExists(sFile) Then
sMsg = EgtMsg(10003) & " '" & sFile & "'" 'Error opening file
Else
sMsg = EgtMsg(10009) & " '" & sFile & "'" 'Missing file
@@ -1500,7 +1539,7 @@ Public Class ProjectVM
End If
Else
If m_bScriptInMru Then
- If File.Exists( sFile) Then
+ If File.Exists(sFile) Then
IniFile.m_MruScripts.Add(sFile)
WritePrivateProfileString(S_GENERAL, K_LASTLUADIR, Path.GetDirectoryName(sFile))
Else
@@ -1535,7 +1574,7 @@ Public Class ProjectVM
Private Sub OnUpdateUI(ByVal sender As Object, ByVal bReloadUI As Boolean) Handles m_Controller.UpdateUI
' pulisco input e relativi messaggi
- Map.refInputExpanderVM.ResetInputBox()
+ If Not IsNothing(Map.refInputExpanderVM) Then Map.refInputExpanderVM.ResetInputBox()
If m_Controller.GetContinue() Then
Map.refStatusBarVM.NotifyStatusOutput((EgtMsg(399))) ' Continue : 'L' with line, 'A' with arc
Else
@@ -1545,9 +1584,9 @@ Public Class ProjectVM
EmitTitle()
EmitCurrPartLayer()
If bReloadUI Then
- Map.refManageLayerExpanderVM.LoadObjTree()
+ If Not IsNothing(Map.refManageLayerExpanderVM) Then Map.refManageLayerExpanderVM.LoadObjTree()
Else
- Map.refManageLayerExpanderVM.UpdateObjTree()
+ If Not IsNothing(Map.refManageLayerExpanderVM) Then Map.refManageLayerExpanderVM.UpdateObjTree()
End If
' aggiorno macchina corrente
Map.refMachinePanelVM.UpdateCurrentMachine()
@@ -1622,9 +1661,9 @@ Public Class ProjectVM
EgtGetCalcColor(nCurrLayer, colObj)
End If
End If
- Map.refManageLayerExpanderVM.UpdateHeaderName(sText)
+ If Not IsNothing(Map.refManageLayerExpanderVM) Then Map.refManageLayerExpanderVM.UpdateHeaderName(sText)
colObj.A = 100
- Map.refManageLayerExpanderVM.UpdateHeaderColor(colObj)
+ If Not IsNothing(Map.refManageLayerExpanderVM) Then Map.refManageLayerExpanderVM.UpdateHeaderColor(colObj)
End Sub
#End Region 'DrawOptionPanel
diff --git a/RightTray/RightTrayV.xaml b/RightTray/RightTrayV.xaml
new file mode 100644
index 0000000..ce78fe0
--- /dev/null
+++ b/RightTray/RightTrayV.xaml
@@ -0,0 +1,15 @@
+
+
+
+
+
diff --git a/RightTray/RightTrayV.xaml.vb b/RightTray/RightTrayV.xaml.vb
new file mode 100644
index 0000000..cbac5e1
--- /dev/null
+++ b/RightTray/RightTrayV.xaml.vb
@@ -0,0 +1,3 @@
+Public Class RightTrayV
+
+End Class
diff --git a/SceneContentControl/SceneContentControlV.xaml b/SceneContentControl/SceneContentControlV.xaml
new file mode 100644
index 0000000..6f6a2ce
--- /dev/null
+++ b/SceneContentControl/SceneContentControlV.xaml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
diff --git a/SceneContentControl/SceneContentControlV.xaml.vb b/SceneContentControl/SceneContentControlV.xaml.vb
new file mode 100644
index 0000000..ebb0df0
--- /dev/null
+++ b/SceneContentControl/SceneContentControlV.xaml.vb
@@ -0,0 +1,3 @@
+Public Class SceneContentControlV
+
+End Class
diff --git a/Special-3dPrinting/Printing3DPanelV.xaml b/Special-3dPrinting/Printing3DPanelV.xaml
deleted file mode 100644
index 4ed4ffd..0000000
--- a/Special-3dPrinting/Printing3DPanelV.xaml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Special-3dPrinting/Printing3DPanelV.xaml.vb b/Special-3dPrinting/Printing3DPanelV.xaml.vb
deleted file mode 100644
index f216a8c..0000000
--- a/Special-3dPrinting/Printing3DPanelV.xaml.vb
+++ /dev/null
@@ -1,3 +0,0 @@
-Public Class Printing3DPanelV
-
-End Class
diff --git a/Special-3dPrinting/Printing3DPanelVM.vb b/Special-3dPrinting/Printing3DPanelVM.vb
deleted file mode 100644
index 4b4142a..0000000
--- a/Special-3dPrinting/Printing3DPanelVM.vb
+++ /dev/null
@@ -1,26 +0,0 @@
-Imports System.IO
-Imports EgtUILib
-
-Public Class Printing3DPanelVM
-
- Private m_ButtonList As New List(Of ButtonItem)
- Public ReadOnly Property ButtonList As List(Of ButtonItem)
- Get
- Return m_ButtonList
- End Get
- End Property
-
- Sub New()
- ' Se attivo, inizializzo i bottoni leggendoli da file ini
- If IniFile.IsActivePrinting3d() Then
- ' Inizializzo i bottoni leggendoli da file ini
- Dim BtnIndex As Integer = 1
- Dim CurrBtn As ButtonItem = Nothing
- While GetPrivateProfileButton(S_PRINTING3D, K_BUTTON & BtnIndex, IniFile.m_sPrinting3dDirPath, CurrBtn)
- m_ButtonList.Add(CurrBtn)
- BtnIndex += 1
- End While
- End If
- End Sub
-
-End Class
diff --git a/Special-BeamWall/BeamPanelV.xaml b/Special-BeamWall/BeamPanelV.xaml
index b972e6a..500c7fe 100644
--- a/Special-BeamWall/BeamPanelV.xaml
+++ b/Special-BeamWall/BeamPanelV.xaml
@@ -1,6 +1,8 @@
-
+
@@ -17,4 +19,4 @@
-
+
diff --git a/Special-BeamWall/BeamPanelVM.vb b/Special-BeamWall/BeamPanelVM.vb
index a425142..dac9543 100644
--- a/Special-BeamWall/BeamPanelVM.vb
+++ b/Special-BeamWall/BeamPanelVM.vb
@@ -2,6 +2,7 @@
Imports EgtUILib
Public Class BeamPanelVM
+ Inherits VMBase
Friend Const BEAM_PROCESS As String = "Beam\Process.lua"
Friend Const BEAM_MACHININGS As String = "BeamMachinings"
@@ -13,7 +14,20 @@ Public Class BeamPanelVM
End Get
End Property
+ Private m_BeamPanel_Visibility As Visibility
+ Public ReadOnly Property BeamPanel_Visibility As Visibility
+ Get
+ Return m_BeamPanel_Visibility
+ End Get
+ End Property
+ Friend Sub SetBeamPanelVisibility(bValue As Boolean)
+ m_BeamPanel_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
+ NotifyPropertyChanged(NameOf(BeamPanel_Visibility))
+ End Sub
+
Sub New()
+ ' Creo riferimento a questa classe in Map
+ Map.SetRefBeamPanelVM(Me)
' Se attivo, inizializzo i bottoni leggendoli da file ini
If IniFile.IsActiveBeam() Then
' Inizializzo i bottoni leggendoli da file ini
diff --git a/Special-BeamWall/BeamWallPanelV.xaml b/Special-BeamWall/BeamWallPanelV.xaml
index 47648c7..21d3377 100644
--- a/Special-BeamWall/BeamWallPanelV.xaml
+++ b/Special-BeamWall/BeamWallPanelV.xaml
@@ -1,6 +1,8 @@
-
+
@@ -17,4 +19,4 @@
-
+
diff --git a/Special-BeamWall/BeamWallPanelVM.vb b/Special-BeamWall/BeamWallPanelVM.vb
index 33b6bbe..cfdb5bc 100644
--- a/Special-BeamWall/BeamWallPanelVM.vb
+++ b/Special-BeamWall/BeamWallPanelVM.vb
@@ -2,6 +2,7 @@
Imports EgtUILib
Public Class BeamWallPanelVM
+ Inherits VMBase
Private m_ButtonList As New List(Of ButtonItem)
Public ReadOnly Property ButtonList As List(Of ButtonItem)
@@ -10,14 +11,27 @@ Public Class BeamWallPanelVM
End Get
End Property
+ Private m_BeamWallPanel_Visibility As Visibility
+ Public ReadOnly Property BeamWallPanel_Visibility As Visibility
+ Get
+ Return m_BeamWallPanel_Visibility
+ End Get
+ End Property
+ Friend Sub SetBeamWallPanelVisibility(bValue As Boolean)
+ m_BeamWallPanel_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
+ NotifyPropertyChanged(NameOf(BeamWallPanel_Visibility))
+ End Sub
+
Sub New()
+ ' Creo riferimento a questa classe in Map
+ Map.SetRefBeamWallPanelVM(Me)
' Se attivo Beam o Wall, inizializzo i bottoni leggendoli da file ini
If IniFile.IsActiveBeam() Or IniFile.IsActiveWall() Then
- GetPrivateProfileString( S_BEAMWALL, K_BEAMWALLBASEDIR, "", m_sBeamWallDirPath)
+ GetPrivateProfileString(S_BEAMWALL, K_BEAMWALLBASEDIR, "", m_sBeamWallDirPath)
' Inizializzo i bottoni leggendoli da file ini
Dim BtnIndex As Integer = 1
Dim CurrBtn As ButtonItem = Nothing
- While GetPrivateProfileButton( S_BEAMWALL, K_BEAMWALLBUTTON & BtnIndex, IniFile.m_sBeamWallDirPath, CurrBtn)
+ While GetPrivateProfileButton(S_BEAMWALL, K_BEAMWALLBUTTON & BtnIndex, IniFile.m_sBeamWallDirPath, CurrBtn)
m_ButtonList.Add(CurrBtn)
BtnIndex += 1
End While
diff --git a/Special-BeamWall/WallPanelV.xaml b/Special-BeamWall/WallPanelV.xaml
index baae7cf..924c9f1 100644
--- a/Special-BeamWall/WallPanelV.xaml
+++ b/Special-BeamWall/WallPanelV.xaml
@@ -1,6 +1,8 @@
-
+
@@ -17,4 +19,4 @@
-
+
diff --git a/Special-BeamWall/WallPanelVM.vb b/Special-BeamWall/WallPanelVM.vb
index b53fbf3..8725f28 100644
--- a/Special-BeamWall/WallPanelVM.vb
+++ b/Special-BeamWall/WallPanelVM.vb
@@ -2,6 +2,7 @@
Imports EgtUILib
Public Class WallPanelVM
+ Inherits VMBase
Friend Const WALL_MACHININGS As String = "WallMachinings"
@@ -12,7 +13,20 @@ Public Class WallPanelVM
End Get
End Property
+ Private m_WallPanel_Visibility As Visibility
+ Public ReadOnly Property WallPanel_Visibility As Visibility
+ Get
+ Return m_WallPanel_Visibility
+ End Get
+ End Property
+ Friend Sub SetWallPanelVisibility(bValue As Boolean)
+ m_WallPanel_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
+ NotifyPropertyChanged(NameOf(WallPanel_Visibility))
+ End Sub
+
Sub New()
+ ' Creo riferimento a questa classe in Map
+ Map.SetRefWallPanelVM(Me)
' Se attivo, inizializzo i bottoni leggendoli da file ini
If IniFile.IsActiveWall() Then
' Inizializzo i bottoni leggendoli da file ini
diff --git a/Special-Doors/DoorPanelV.xaml b/Special-Doors/DoorPanelV.xaml
index 90b1e17..8a07e29 100644
--- a/Special-Doors/DoorPanelV.xaml
+++ b/Special-Doors/DoorPanelV.xaml
@@ -1,6 +1,8 @@
-
+
@@ -18,4 +20,4 @@
IsEnabled="{Binding MTableDb_IsEnabled}"/>
-
+
diff --git a/Special-Doors/DoorPanelVM.vb b/Special-Doors/DoorPanelVM.vb
index 861e99f..417aad5 100644
--- a/Special-Doors/DoorPanelVM.vb
+++ b/Special-Doors/DoorPanelVM.vb
@@ -31,6 +31,17 @@ Public Class DoorPanelVM
End Get
End Property
+ Private m_DoorPanel_Visibility As Visibility
+ Public ReadOnly Property DoorPanel_Visibility As Visibility
+ Get
+ Return m_DoorPanel_Visibility
+ End Get
+ End Property
+ Friend Sub SetDoorPanelVisibility(bValue As Boolean)
+ m_DoorPanel_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
+ OnPropertyChanged(NameOf(DoorPanel_Visibility))
+ End Sub
+
' Definizione comandi
Private m_cmdDoors As ICommand
Private m_cmdDMach As ICommand
diff --git a/Special-GunStock/GunStockPanelV.xaml b/Special-GunStock/GunStockPanelV.xaml
index ec8e36e..24d5569 100644
--- a/Special-GunStock/GunStockPanelV.xaml
+++ b/Special-GunStock/GunStockPanelV.xaml
@@ -1,6 +1,8 @@
-
+
-
+
diff --git a/Special-GunStock/GunStockPanelVM.vb b/Special-GunStock/GunStockPanelVM.vb
index 020e348..0dd041d 100644
--- a/Special-GunStock/GunStockPanelVM.vb
+++ b/Special-GunStock/GunStockPanelVM.vb
@@ -16,6 +16,25 @@ Public Class GunStockPanelVM
End Get
End Property
+ Public ReadOnly Property CopyGunStock_Visibility As Visibility
+ Get
+ Dim sFunction As String = String.Empty
+ GetPrivateProfileString(S_GUNSTOCK, K_COPYFUNCTION, "", sFunction)
+ Return If(String.IsNullOrWhiteSpace(sFunction), Visibility.Collapsed, Visibility.Visible)
+ End Get
+ End Property
+
+ Private m_GunStockPanel_Visibility As Visibility
+ Public ReadOnly Property GunStockPanel_Visibility As Visibility
+ Get
+ Return m_GunStockPanel_Visibility
+ End Get
+ End Property
+ Friend Sub SetGunStockPanelVisibility(bValue As Boolean)
+ m_GunStockPanel_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
+ OnPropertyChanged(NameOf(GunStockPanel_Visibility))
+ End Sub
+
#Region "Messages"
Public ReadOnly Property NewGunStockMsg As String
@@ -56,13 +75,6 @@ Public Class GunStockPanelVM
#End Region ' ToolTip
- Public ReadOnly Property CopyGunStock_Visibility As Visibility
- Get
- Dim sFunction As String = String.Empty
- GetPrivateProfileString(S_GUNSTOCK, K_COPYFUNCTION, "", sFunction)
- Return If( String.IsNullOrWhiteSpace( sFunction), Visibility.Collapsed, Visibility.Visible)
- End Get
- End Property
' Definizione comandi
@@ -72,6 +84,10 @@ Public Class GunStockPanelVM
Private Shared m_cmdOpenMruNewGunStock As ICommand
Private Shared m_cmdOpenMruModifyGunStock As ICommand
+ Sub New()
+ ' Creo riferimento a questa classe in Map
+ Map.SetRefGunStockPanelVM(Me)
+ End Sub
#Region "COMMANDS"
#Region "NewGunStockCommand"
diff --git a/SpecialPanel/SpecialPanelV.xaml b/SpecialPanel/SpecialPanelV.xaml
index 4d7d606..b0e0330 100644
--- a/SpecialPanel/SpecialPanelV.xaml
+++ b/SpecialPanel/SpecialPanelV.xaml
@@ -1,6 +1,8 @@
-
+
@@ -18,4 +20,4 @@
-
+
diff --git a/SpecialPanel/SpecialPanelVM.vb b/SpecialPanel/SpecialPanelVM.vb
index 5161056..4a8a49d 100644
--- a/SpecialPanel/SpecialPanelVM.vb
+++ b/SpecialPanel/SpecialPanelVM.vb
@@ -2,6 +2,7 @@
Imports EgtUILib
Public Class SpecialPanelVM
+ Inherits VMBase
Private m_ButtonList As New List(Of ButtonItem)
Public ReadOnly Property ButtonList As List(Of ButtonItem)
@@ -10,6 +11,17 @@ Public Class SpecialPanelVM
End Get
End Property
+ Private m_SpecialPanel_Visibility As Visibility
+ Public ReadOnly Property SpecialPanel_Visibility As Visibility
+ Get
+ Return m_SpecialPanel_Visibility
+ End Get
+ End Property
+ Friend Sub SetSpecialPanelVisibility(bValue As Boolean)
+ m_SpecialPanel_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
+ NotifyPropertyChanged(NameOf(SpecialPanel_Visibility))
+ End Sub
+
Sub New()
' Creo riferimento a questa classe in Map
Map.SetRefSpecialPanelVM(Me)
diff --git a/TopCommandBar/TopCommandBarVM.vb b/TopCommandBar/TopCommandBarVM.vb
index 4cf7556..bbbd683 100644
--- a/TopCommandBar/TopCommandBarVM.vb
+++ b/TopCommandBar/TopCommandBarVM.vb
@@ -220,10 +220,10 @@ Public Class TopCommandBarVM
Dim bIsEnabled As Boolean = Not IsNothing(Map.refOperationParametersExpanderVM) AndAlso Not Map.refOperationParametersExpanderVM.ParametersIsExpanded
Map.refMachinePanelVM.ToolMachSetUpIsEnabled(bIsEnabled, bIsEnabled, bIsEnabled)
' se parametri di una lavorazione aperti, disattivo MTable e SpecialPanel
- Map.refDoorPanelVM.MTableIsEnabled(bIsEnabled)
- Map.refSpecialPanelVM.SpecialPanelIsEnabled(bIsEnabled)
+ If Not IsNothing(Map.refDoorPanelVM) Then Map.refDoorPanelVM.MTableIsEnabled(bIsEnabled)
+ If Not IsNothing(Map.refSpecialPanelVM) Then Map.refSpecialPanelVM.SpecialPanelIsEnabled(bIsEnabled)
End If
- Else
+ Else
' Deseleziono tutto
EgtDeselectAll()
' Pulisco lista e geometria faccette di superfici di lavorazione corrente
@@ -307,7 +307,7 @@ Public Class TopCommandBarVM
'''
Friend Sub NewCmd()
Map.refProjectVM.GetController.NewProject(True)
- Map.refManageLayerExpanderVM.SelectIdInObjTreeNoMark(EgtGetCurrLayer())
+ If Not IsNothing(Map.refManageLayerExpanderVM) Then Map.refManageLayerExpanderVM.SelectIdInObjTreeNoMark(EgtGetCurrLayer())
OnPropertyChanged("MruFileNames")
End Sub
@@ -342,7 +342,7 @@ Public Class TopCommandBarVM
Else
Map.refProjectVM.GetController.OpenProject(sFilePath, False)
End If
- Map.refManageLayerExpanderVM.SelectIdInObjTreeNoMark(EgtGetCurrLayer())
+ If Not IsNothing(Map.refManageLayerExpanderVM) Then Map.refManageLayerExpanderVM.SelectIdInObjTreeNoMark(EgtGetCurrLayer())
End Sub
#End Region ' OpenCommand
@@ -733,7 +733,7 @@ Public Class TopCommandBarVM
If nErr = 0 Then
Map.refMachinePanelVM.UpdateCurrentMachine()
MachiningMode_IsChecked()
- Map.refMachiningTreeExpanderVM.UpdateOperationMachiningList()
+ If Not IsNothing(Map.refMachiningTreeExpanderVM) Then Map.refMachiningTreeExpanderVM.UpdateOperationMachiningList()
IniFile.m_ProjectMode = ProjectModeOpt.MACHINING
Else
m_MachiningIsChecked = False
@@ -760,6 +760,18 @@ Public Class TopCommandBarVM
' ProjectV
If Not IsNothing(Map.refProjectV) Then
Map.refProjectV.DrawMode_IsChecked()
+ Map.refMachinePanelVM.SetMachinePanelVisibility(IniFile.m_ProjectMode <> ProjectModeOpt.ONLYDRAW)
+ Map.refExecutePanelVM.SetExecutePanelVisibility(True)
+ Map.refSpecialPanelVM.SetSpecialPanelVisibility(IniFile.IsActiveSpecialPanel() And Map.refSpecialPanelVM.SetSpecialPanelButtonsVisibility(False))
+ Map.refBeamPanelVM.SetBeamPanelVisibility(IniFile.IsActiveBeam())
+ Map.refWallPanelVM.SetWallPanelVisibility(IniFile.IsActiveWall())
+ Map.refBeamWallPanelVM.SetBeamWallPanelVisibility(IniFile.IsActiveBeam() Or IniFile.IsActiveWall())
+ Map.refDoorPanelVM.SetDoorPanelVisibility(IniFile.IsActiveDoors())
+ Map.refGunStockPanelVM.SetGunStockPanelVisibility(IniFile.IsActiveGunStock())
+ If Not IsNothing(Map.refDrawPanelVM) Then Map.refDrawPanelVM.SetDrawPanelVisibility(True)
+ Map.refMachGroupPanelVM.SetMachGroupPanelVisibility(False)
+ If IniFile.IsActiveDoors() Then Map.refDoorPanelVM.SetDoorPanelButtonsVisibility(True)
+
End If
' ProjectVM
If Not IsNothing(Map.refProjectVM) Then
@@ -786,10 +798,24 @@ Public Class TopCommandBarVM
Friend Sub MachiningMode_IsChecked()
' ProjectV
Map.refProjectV.MachiningMode_IsChecked()
+ Map.refMachinePanelVM.SetMachinePanelVisibility(True)
+ Map.refExecutePanelVM.SetExecutePanelVisibility(False)
+ Map.refSpecialPanelVM.SetSpecialPanelVisibility(IniFile.IsActiveSpecialPanel() And Map.refSpecialPanelVM.SetSpecialPanelButtonsVisibility(True))
+ Map.refBeamPanelVM.SetBeamPanelVisibility(False)
+ Map.refWallPanelVM.SetWallPanelVisibility(False)
+ Map.refBeamWallPanelVM.SetBeamWallPanelVisibility(False)
+ Map.refDoorPanelVM.SetDoorPanelVisibility(False)
+ Map.refGunStockPanelVM.SetGunStockPanelVisibility(False)
+
+ If Not IsNothing(Map.refDrawPanelVM) Then Map.refDrawPanelVM.SetDrawPanelVisibility(False)
+ Map.refMachGroupPanelVM.SetMachGroupPanelVisibility(IniFile.m_bMachiningGroup)
+ If IniFile.IsActiveDoors() Then Map.refDoorPanelVM.SetDoorPanelButtonsVisibility(False)
+
+
' ProjectVM
Map.refProjectVM.MachiningMode_IsChecked()
' OptionPanelVM
- Map.refOptionPanelVM.MachiningMode_IsChecked()
+ If Not IsNothing(Map.refOptionPanelVM) Then Map.refOptionPanelVM.MachiningMode_IsChecked()
' MyMachinePanelVM
Map.refMachinePanelVM.MachineListIsEnabled = False
' InstrumentPanel
diff --git a/TopTray/TopTrayV.xaml b/TopTray/TopTrayV.xaml
new file mode 100644
index 0000000..71dcaa7
--- /dev/null
+++ b/TopTray/TopTrayV.xaml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/TopTray/TopTrayV.xaml.vb b/TopTray/TopTrayV.xaml.vb
new file mode 100644
index 0000000..061985c
--- /dev/null
+++ b/TopTray/TopTrayV.xaml.vb
@@ -0,0 +1,3 @@
+Public Class TopTrayV
+
+End Class
diff --git a/Utility/Dictionary.xaml b/Utility/Dictionary.xaml
index 7c235e6..216f9c0 100644
--- a/Utility/Dictionary.xaml
+++ b/Utility/Dictionary.xaml
@@ -37,7 +37,6 @@
-
diff --git a/Utility/IniFile.vb b/Utility/IniFile.vb
index fb9eccd..b5df84f 100644
--- a/Utility/IniFile.vb
+++ b/Utility/IniFile.vb
@@ -50,7 +50,7 @@ Public Module IniFile
CAD2D = 128
STEELDORS = 256
WALL = 512
- _3DPRINT = 1024
+ PLUGIN = 1024
ADVMACHINING = 2048
End Enum
Friend m_sDataRoot As String
@@ -284,14 +284,6 @@ Public Module IniFile
Return bIsActive
End Function
- Friend Function IsActivePrinting3d() As Boolean
- Dim bIsActive As Boolean = (IniFile.m_nKeyOptions And KEY_OPT._3DPRINT) <> 0 And (GetPrivateProfileInt(S_PRINTING3D, K_ENABLE, 0) <> 0)
- If bIsActive Then
- GetPrivateProfileString(S_PRINTING3D, K_3PRNBASEDIR, "", m_sPrinting3dDirPath)
- End If
- Return bIsActive
- End Function
-
Friend Function IsActiveDoors() As Boolean
Dim bIsActive As Boolean = (IniFile.m_nKeyOptions And KEY_OPT.DOORS) <> 0 And (GetPrivateProfileInt(S_DOORS, K_DDFENABLE, 0) <> 0)
If bIsActive Then GetPrivateProfileString(S_DOORS, K_BASEDIR, "", m_sDoorsDirPath)
@@ -308,6 +300,11 @@ Public Module IniFile
Return bIsActive
End Function
+ Friend Function IsActivePlugin() As Boolean
+ Dim bIsActive As Boolean = (IniFile.m_nKeyOptions And KEY_OPT.PLUGIN) <> 0
+ Return bIsActive
+ End Function
+
Friend Function IsKeyEnabledVirtualMilling() As Boolean
Return (IniFile.m_nKeyOptions And KEY_OPT.VIRTUALMILLING) <> 0
End Function
diff --git a/Utility/Map.vb b/Utility/Map.vb
index f9aa08a..c100b0e 100644
--- a/Utility/Map.vb
+++ b/Utility/Map.vb
@@ -29,6 +29,11 @@ Module Map
Private m_refProjectV As ProjectV
Private m_refDoorPanelVM As DoorPanelVM
Private m_refSpecialPanelVM As SpecialPanelVM
+ Private m_refExecutePanelVM As ExecutePanelVM
+ Private m_refBeamPanelVM As BeamPanelVM
+ Private m_refWallPanelVM As WallPanelVM
+ Private m_refBeamWallPanelVM As BeamWallPanelVM
+ Private m_refGunStockPanelVM As GunStockPanelVM
#Region "Get"
@@ -157,6 +162,31 @@ Module Map
Return m_refSpecialPanelVM
End Get
End Property
+ Public ReadOnly Property refExecutePanelVM As ExecutePanelVM
+ Get
+ Return m_refExecutePanelVM
+ End Get
+ End Property
+ Public ReadOnly Property refBeamPanelVM As BeamPanelVM
+ Get
+ Return m_refBeamPanelVM
+ End Get
+ End Property
+ Public ReadOnly Property refWallPanelVM As WallPanelVM
+ Get
+ Return m_refWallPanelVM
+ End Get
+ End Property
+ Public ReadOnly Property refBeamWallPanelVM As BeamWallPanelVM
+ Get
+ Return m_refBeamWallPanelVM
+ End Get
+ End Property
+ Public ReadOnly Property refGunStockPanelVM As GunStockPanelVM
+ Get
+ Return m_refGunStockPanelVM
+ End Get
+ End Property
#End Region ' Get
@@ -259,6 +289,26 @@ Module Map
m_refSpecialPanelVM = SpecialPanelVM
Return Not IsNothing(m_refSpecialPanelVM)
End Function
+ Friend Function SetRefExecutePanelVM(ExecutePanelVM As ExecutePanelVM) As Boolean
+ m_refExecutePanelVM = ExecutePanelVM
+ Return Not IsNothing(m_refExecutePanelVM)
+ End Function
+ Friend Function SetRefBeamPanelVM(BeamPanelVM As BeamPanelVM) As Boolean
+ m_refBeamPanelVM = BeamPanelVM
+ Return Not IsNothing(m_refBeamPanelVM)
+ End Function
+ Friend Function SetRefWallPanelVM(WallPanelVM As WallPanelVM) As Boolean
+ m_refWallPanelVM = WallPanelVM
+ Return Not IsNothing(m_refWallPanelVM)
+ End Function
+ Friend Function SetRefBeamWallPanelVM(BeamWallPanelVM As BeamWallPanelVM) As Boolean
+ m_refBeamWallPanelVM = BeamWallPanelVM
+ Return Not IsNothing(m_refBeamWallPanelVM)
+ End Function
+ Friend Function SetRefGunStockPanelVM(GunStockPanelVM As GunStockPanelVM) As Boolean
+ m_refGunStockPanelVM = GunStockPanelVM
+ Return Not IsNothing(m_refGunStockPanelVM)
+ End Function
#End Region ' Set
diff --git a/WinFormPluginControl/WinFormPluginControlV.xaml b/WinFormPluginControl/WinFormPluginControlV.xaml
new file mode 100644
index 0000000..5190bc5
--- /dev/null
+++ b/WinFormPluginControl/WinFormPluginControlV.xaml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
diff --git a/WinFormPluginControl/WinFormPluginControlV.xaml.vb b/WinFormPluginControl/WinFormPluginControlV.xaml.vb
new file mode 100644
index 0000000..c637b42
--- /dev/null
+++ b/WinFormPluginControl/WinFormPluginControlV.xaml.vb
@@ -0,0 +1,30 @@
+Imports System.Windows.Forms.Integration
+
+Public Class WinFormPluginControlV
+
+ Private m_WinFormPluginControlVM As WinFormPluginControlVM
+ Public ReadOnly Property WinFormPluginControlVM As WinFormPluginControlVM
+ Get
+ Return m_WinFormPluginControlVM
+ End Get
+ End Property
+
+ Private m_WinFormUserControlHost As WindowsFormsHost
+ Public ReadOnly Property WinFormUserControlHost As WindowsFormsHost
+ Get
+ Return m_WinFormUserControlHost
+ End Get
+ End Property
+
+ Sub New(WinFormPluginControlVM As WinFormPluginControlVM)
+
+ ' This call is required by the designer.
+ InitializeComponent()
+
+ ' Add any initialization after the InitializeComponent() call.
+ WinFormHost.Child = WinFormPluginControlVM.WinFormUserControl
+ Me.DataContext = WinFormPluginControlVM
+ m_WinFormPluginControlVM = WinFormPluginControlVM
+ End Sub
+
+End Class
diff --git a/WinFormPluginControl/WinFormPluginControlVM.vb b/WinFormPluginControl/WinFormPluginControlVM.vb
new file mode 100644
index 0000000..9abcae7
--- /dev/null
+++ b/WinFormPluginControl/WinFormPluginControlVM.vb
@@ -0,0 +1,35 @@
+Imports System.Windows.Forms.Integration
+Imports EgtUILib
+
+Public Class WinFormPluginControlVM
+
+ Private m_WinFormUserControl As Forms.Control
+ Public ReadOnly Property WinFormUserControl As Forms.Control
+ Get
+ Return m_WinFormUserControl
+ End Get
+ End Property
+
+ Private m_DockSide As Dock
+ Public ReadOnly Property DockSide As Dock
+ Get
+ Select Case TryCast(m_WinFormUserControl, IPluginControl).DockSide
+ Case Forms.DockStyle.Top
+ Return Dock.Top
+ Case Forms.DockStyle.Bottom
+ Return Dock.Bottom
+ Case Forms.DockStyle.Left
+ Return Dock.Left
+ Case Forms.DockStyle.Right
+ Return Dock.Right
+ Case Else
+ Return Nothing
+ End Select
+ End Get
+ End Property
+
+ Sub New(WinFormControl As Forms.Control)
+ m_WinFormUserControl = WinFormControl
+ End Sub
+
+End Class