- create tray top, bottom, left e right
- gestiti panel con Visibility - gestiti elementi grafici in ProjectV con ItemsControl - eliminato pannello Printing3d - aggiunta gestione Plugin - verifica bit per Plugin
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
<Grid x:Class="BottomTrayV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
DockPanel.Dock="Bottom">
|
||||
<EgtWPFLib5:EgtMachGroupPanelV DataContext="{StaticResource MachGroupPanelViewModel}"
|
||||
RepaetButtonStyle="{StaticResource CustomScrollBarButton}"
|
||||
MachGroupButtonStyle="{StaticResource {x:Type ToggleButton}}"
|
||||
IsToolBar="False"
|
||||
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False"
|
||||
IsRightDockable="False" />
|
||||
</Grid>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class BottomTrayV
|
||||
|
||||
End Class
|
||||
@@ -1,9 +1,11 @@
|
||||
<UserControl x:Class="DrawPanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:Interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
|
||||
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
|
||||
xmlns:EgtCAM5="clr-namespace:EgtCAM5">
|
||||
<EgtFloating:EgtFloatingPanel x:Class="DrawPanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:Interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
|
||||
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
|
||||
xmlns:EgtCAM5="clr-namespace:EgtCAM5"
|
||||
TitleBarOrientation="Vertical"
|
||||
Visibility="{Binding DrawPanel_Visibility}">
|
||||
|
||||
<StackPanel Background="Transparent" MaxHeight="{Binding MaxHeight,RelativeSource={RelativeSource AncestorType={x:Type EgtFloating:EgtFloatingPanel}}}">
|
||||
<Expander Name="Draw2D" Style="{StaticResource ExpanderStyle}" Grid.Row="0"
|
||||
@@ -352,4 +354,4 @@
|
||||
</Interactivity:Interaction.Behaviors>
|
||||
</StackPanel>
|
||||
|
||||
</UserControl>
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
|
||||
@@ -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
|
||||
|
||||
+45
-8
@@ -116,6 +116,7 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\EgtProg\EgtCAM5\Microsoft.Expression.Interactions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ComponentModel.Composition" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
@@ -153,11 +154,18 @@
|
||||
<Compile Include="BeamMachiningsWindow\BeamMachiningsWindowV.xaml.vb">
|
||||
<DependentUpon>BeamMachiningsWindowV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BottomTray\BottomTrayV.xaml.vb">
|
||||
<DependentUpon>BottomTrayV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="CurrSetUp\CurrSetUpV.xaml.vb">
|
||||
<DependentUpon>CurrSetUpV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="CurrSetUp\CurrSetUpVM.vb" />
|
||||
<Compile Include="LeftTray\LeftTrayV.xaml.vb">
|
||||
<DependentUpon>LeftTrayV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MachGroupPanel\MyMachGroupPanelVM.vb" />
|
||||
<Compile Include="MEFPlugin\MefPlugin.vb" />
|
||||
<Compile Include="OptionPanel\MachiningOptionPanel\EstimationsExpander\EstimationsExpanderV.xaml.vb">
|
||||
<DependentUpon>EstimationsExpanderV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -227,6 +235,12 @@
|
||||
<Compile Include="OptionsWindow\MachineBox.xaml.vb">
|
||||
<DependentUpon>MachineBox.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="RightTray\RightTrayV.xaml.vb">
|
||||
<DependentUpon>RightTrayV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SceneContentControl\SceneContentControlV.xaml.vb">
|
||||
<DependentUpon>SceneContentControlV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SetUpDb\SetUpDbV.xaml.vb">
|
||||
<DependentUpon>SetUpDbV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -236,10 +250,6 @@
|
||||
<DependentUpon>SetUpV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SetUp\SetUpVM.vb" />
|
||||
<Compile Include="Special-3dPrinting\Printing3DPanelV.xaml.vb">
|
||||
<DependentUpon>Printing3DPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Special-3dPrinting\Printing3DPanelVM.vb" />
|
||||
<Compile Include="Special-BeamWall\Beam.vb" />
|
||||
<Compile Include="Command\Command.vb" />
|
||||
<Compile Include="Command\RelayCommand.vb" />
|
||||
@@ -278,6 +288,9 @@
|
||||
</Compile>
|
||||
<Compile Include="StatusBar\MyStatusBarVM.vb" />
|
||||
<Compile Include="ToolsDbWindow\MyToolDbWindowVM.vb" />
|
||||
<Compile Include="TopTray\TopTrayV.xaml.vb">
|
||||
<DependentUpon>TopTrayV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Utility\Analyze.vb" />
|
||||
<Compile Include="Utility\BindingProxy.vb" />
|
||||
<Compile Include="Utility\Map.vb" />
|
||||
@@ -416,6 +429,10 @@
|
||||
<Compile Include="Utility\Utility.vb" />
|
||||
<Compile Include="Utility\VMBase.vb" />
|
||||
<Compile Include="ValidationGroup.vb" />
|
||||
<Compile Include="WinFormPluginControl\WinFormPluginControlVM.vb" />
|
||||
<Compile Include="WinFormPluginControl\WinFormPluginControlV.xaml.vb">
|
||||
<DependentUpon>WinFormPluginControlV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Page Include="AboutBoxWindow\AboutBoxView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -424,6 +441,10 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="BottomTray\BottomTrayV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="CurrSetUp\CurrSetUpV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -432,6 +453,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="LeftTray\LeftTrayV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="MachOptionsWindow\MachOptionV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -520,6 +545,14 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="RightTray\RightTrayV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="SceneContentControl\SceneContentControlV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="SetUpDb\SetUpDbV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -528,10 +561,6 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Special-3dPrinting\Printing3DPanelV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Special-BeamWall\BeamWallPanelV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -588,6 +617,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>XamlIntelliSenseFileGenerator</Generator>
|
||||
</Page>
|
||||
<Page Include="TopTray\TopTrayV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Utility\Dictionary.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -680,6 +713,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="WinFormPluginControl\WinFormPluginControlV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="System.Linq" />
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<UserControl x:Class="ExecutePanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<EgtFloating:EgtFloatingPanel x:Class="ExecutePanelV"
|
||||
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"
|
||||
Visibility="{Binding ExecutePanel_Visibility}">
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button Command="{Binding ExecCommand}" ToolTip="{Binding ExecToolTip}"
|
||||
@@ -13,4 +15,4 @@
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
||||
</UserControl>
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<Grid x:Class="LeftTrayV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:EgtCAM5"
|
||||
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
|
||||
DockPanel.Dock="Left">
|
||||
|
||||
<local:DrawPanelV DataContext="{StaticResource DrawPanelViewModel}"/>
|
||||
|
||||
</Grid>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class LeftTrayV
|
||||
|
||||
End Class
|
||||
@@ -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)
|
||||
|
||||
<ImportMany(AllowRecomposition:=True)>
|
||||
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
|
||||
@@ -1,6 +1,8 @@
|
||||
<UserControl x:Class="MachinePanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<EgtFloating:EgtFloatingPanel x:Class="MachinePanelV"
|
||||
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"
|
||||
Visibility="{Binding MachinePanel_Visibility}">
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<!--Combobox per selezionare la macchina corrente-->
|
||||
@@ -32,4 +34,4 @@
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
||||
</UserControl>
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
|
||||
@@ -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
|
||||
|
||||
+56
-20
@@ -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
|
||||
@@ -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
|
||||
|
||||
|
||||
+20
-102
@@ -1,108 +1,26 @@
|
||||
<UserControl x:Class="ProjectV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:EgtCAM5"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
|
||||
xmlns:interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity">
|
||||
|
||||
<ItemsControl x:Class="ProjectV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:EgtCAM5"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
|
||||
xmlns:interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
|
||||
ItemsSource="{Binding PanelList}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<DockPanel />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemContainerStyle>
|
||||
<Style>
|
||||
<Setter Property="DockPanel.Dock" Value="{Binding}" />
|
||||
</Style>
|
||||
</ItemsControl.ItemContainerStyle>
|
||||
|
||||
<interactivity:Interaction.Triggers>
|
||||
<interactivity:EventTrigger EventName="Loaded">
|
||||
<interactivity:InvokeCommandAction Command="{Binding LoadedCommand}"/>
|
||||
</interactivity:EventTrigger>
|
||||
</interactivity:Interaction.Triggers>
|
||||
|
||||
<EgtFloating:EgtFloatingManager>
|
||||
<EgtFloating:EgtFloatingTray x:Name="TOPTRAY" DockPanel.Dock="Top">
|
||||
<WrapPanel Orientation="Horizontal" Width="{Binding ActualWidth, ElementName=TOPTRAY}">
|
||||
<EgtFloating:EgtFloatingPanel Name="ShowPanel"
|
||||
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
|
||||
<local:ShowPanelV DataContext="{StaticResource ShowPanelViewModel}"/>
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
<EgtFloating:EgtFloatingPanel Name="ViewPanel"
|
||||
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
|
||||
<local:ViewPanelV DataContext="{StaticResource ViewPanelViewModel}"/>
|
||||
<local:PopUpViewPanelV DataContext="{StaticResource PopUpViewPanelViewModel}" EgtFloating:EgtFloatingPanel.IsInPopUp="True"/>
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
<!--<EgtFloating:EgtFloatingPanel Name="InstrumentPanel"
|
||||
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">-->
|
||||
<local:InstrumentPanelV DataContext="{StaticResource InstrumentPanelViewModel}"/>
|
||||
<!--</EgtFloating:EgtFloatingPanel>-->
|
||||
<EgtFloating:EgtFloatingPanel Name="GridPanel"
|
||||
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
|
||||
<local:GridPanelV DataContext="{StaticResource GridPanelViewModel}"/>
|
||||
<local:PopUpGridPanelV DataContext="{StaticResource PopUpGridPanelViewModel}" EgtFloating:EgtFloatingPanel.IsInPopUp="True"/>
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
<EgtFloating:EgtFloatingPanel Name="DbPanel"
|
||||
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
|
||||
<local:MachinePanelV DataContext="{StaticResource DbPanelViewModel}"/>
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
<EgtFloating:EgtFloatingPanel Name="ExecutePanel"
|
||||
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
|
||||
<local:ExecutePanelV DataContext="{StaticResource ExecutePanelViewModel}"/>
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
<EgtFloating:EgtFloatingPanel Name="SpecialPanel"
|
||||
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
|
||||
<local:SpecialPanelV DataContext="{StaticResource SpecialPanelViewModel}"/>
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
<EgtFloating:EgtFloatingPanel Name="BeamPanel"
|
||||
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
|
||||
<local:BeamPanelV DataContext="{StaticResource BeamPanelViewModel}"/>
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
<EgtFloating:EgtFloatingPanel Name="WallPanel"
|
||||
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
|
||||
<local:WallPanelV DataContext="{StaticResource WallPanelViewModel}"/>
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
<EgtFloating:EgtFloatingPanel Name="BeamWallPanel"
|
||||
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
|
||||
<local:BeamWallPanelV DataContext="{StaticResource BeamWallPanelViewModel}"/>
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
<EgtFloating:EgtFloatingPanel Name="DoorsPanel"
|
||||
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
|
||||
<local:DoorPanelV DataContext="{StaticResource DoorsPanelViewModel}"/>
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
<EgtFloating:EgtFloatingPanel Name="GunStockPanel"
|
||||
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
|
||||
<local:GunStockPanelV DataContext="{StaticResource GunStockPanelViewModel}"/>
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
<EgtFloating:EgtFloatingPanel Name="PrintingPanel"
|
||||
IsTopDockable="True"
|
||||
IsBottomDockable="True"
|
||||
IsLeftDockable="False"
|
||||
IsRightDockable="False">
|
||||
<local:Printing3DPanelV DataContext="{StaticResource Printing3DPanelVM}"/>
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
</WrapPanel>
|
||||
</EgtFloating:EgtFloatingTray>
|
||||
<EgtFloating:EgtFloatingTray x:Name="LEFTTRAY" DockPanel.Dock="Left">
|
||||
<EgtFloating:EgtFloatingPanel Name="DrawPanel" TitleBarOrientation="Vertical"
|
||||
IsTopDockable="False" IsBottomDockable="False" IsLeftDockable="True" IsRightDockable="True">
|
||||
<local:DrawPanelV DataContext="{StaticResource DrawPanelViewModel}"/>
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
</EgtFloating:EgtFloatingTray>
|
||||
<EgtFloating:EgtFloatingTray x:Name="RIGHTTRAY" DockPanel.Dock="Right">
|
||||
<EgtFloating:EgtFloatingPanel Name="OptionPanel" TitleBarOrientation="Vertical"
|
||||
IsTopDockable="False" IsBottomDockable="False" IsLeftDockable="True" IsRightDockable="True">
|
||||
<local:OptionPanelV DataContext="{StaticResource OptionPanelViewModel}"/>
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
</EgtFloating:EgtFloatingTray>
|
||||
<!--<EgtFloating:EgtFloatingTray x:Name="BOTTOMTRAY" DockPanel.Dock="Bottom">
|
||||
<EgtFloating:EgtFloatingPanel Name="MachGroupPanel"
|
||||
IsToolBar="False"
|
||||
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
|
||||
<local:MachGroupPanelV DataContext="{StaticResource MachGroupPanelViewModel}"/>
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
</EgtFloating:EgtFloatingTray>-->
|
||||
<EgtFloating:EgtFloatingTray x:Name="BOTTOMTRAY" DockPanel.Dock="Bottom">
|
||||
<EgtWPFLib5:EgtMachGroupPanelV DataContext="{StaticResource MachGroupPanelViewModel}"
|
||||
RepaetButtonStyle="{StaticResource CustomScrollBarButton}"
|
||||
MachGroupButtonStyle="{StaticResource {x:Type ToggleButton}}"
|
||||
IsToolBar="False"
|
||||
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False"
|
||||
IsRightDockable="False" />
|
||||
</EgtFloating:EgtFloatingTray>
|
||||
<!--ContentControl che ospita la scena restituita sotto forma di WindowsFormsHost-->
|
||||
<ContentControl Content="{Binding ProjectSceneHost}"/>
|
||||
</EgtFloating:EgtFloatingManager>
|
||||
|
||||
</UserControl>
|
||||
</ItemsControl>
|
||||
|
||||
+40
-42
@@ -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
|
||||
|
||||
+164
-125
@@ -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
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<Grid x:Class="RightTrayV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:EgtCAM5"
|
||||
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
|
||||
DockPanel.Dock="Right">
|
||||
<EgtFloating:EgtFloatingPanel Name="OptionPanel"
|
||||
TitleBarOrientation="Vertical"
|
||||
IsTopDockable="False"
|
||||
IsBottomDockable="False"
|
||||
IsLeftDockable="True"
|
||||
IsRightDockable="True">
|
||||
<local:OptionPanelV DataContext="{StaticResource OptionPanelViewModel}"/>
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
</Grid>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class RightTrayV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,8 @@
|
||||
<Grid x:Class="SceneContentControlV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<!--ContentControl che ospita la scena restituita sotto forma di WindowsFormsHost-->
|
||||
<ContentControl Content="{Binding ProjectSceneHost}"/>
|
||||
|
||||
</Grid>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class SceneContentControlV
|
||||
|
||||
End Class
|
||||
@@ -1,20 +0,0 @@
|
||||
<UserControl x:Class="Printing3DPanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<ItemsControl ItemsSource="{Binding ButtonList}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Button ToolTip="{Binding ToolTip}" Command="{Binding LuaExecCommand}" Style="{StaticResource DrawPanelButton}">
|
||||
<Image Source="{Binding ImagePath}"/>
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
</UserControl>
|
||||
@@ -1,3 +0,0 @@
|
||||
Public Class Printing3DPanelV
|
||||
|
||||
End Class
|
||||
@@ -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
|
||||
@@ -1,6 +1,8 @@
|
||||
<UserControl x:Class="BeamPanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<EgtFloating:EgtFloatingPanel x:Class="BeamPanelV"
|
||||
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"
|
||||
Visibility="{Binding BeamPanel_Visibility}">
|
||||
|
||||
<ItemsControl ItemsSource="{Binding ButtonList}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
@@ -17,4 +19,4 @@
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
</UserControl>
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<UserControl x:Class="BeamWallPanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<EgtFloating:EgtFloatingPanel x:Class="BeamWallPanelV"
|
||||
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"
|
||||
Visibility="{Binding BeamWallPanel_Visibility}">
|
||||
|
||||
<ItemsControl ItemsSource="{Binding ButtonList}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
@@ -17,4 +19,4 @@
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
</UserControl>
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<UserControl x:Class="WallPanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<EgtFloating:EgtFloatingPanel x:Class="WallPanelV"
|
||||
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"
|
||||
Visibility="{Binding WallPanel_Visibility}">
|
||||
|
||||
<ItemsControl ItemsSource="{Binding ButtonList}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
@@ -17,4 +19,4 @@
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
</UserControl>
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<UserControl x:Class="DoorPanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<EgtFloating:EgtFloatingPanel x:Class="DoorPanelV"
|
||||
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"
|
||||
Visibility="{Binding DoorPanel_Visibility}">
|
||||
|
||||
<!--Barra superiore dei comandi-->
|
||||
<StackPanel Background="Transparent" Orientation="Horizontal">
|
||||
@@ -18,4 +20,4 @@
|
||||
IsEnabled="{Binding MTableDb_IsEnabled}"/>
|
||||
</StackPanel>
|
||||
|
||||
</UserControl>
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<UserControl x:Class="GunStockPanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<EgtFloating:EgtFloatingPanel x:Class="GunStockPanelV"
|
||||
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"
|
||||
Visibility="{Binding GunStockPanel_Visibility}">
|
||||
|
||||
<StackPanel Background="Transparent" Orientation="Horizontal">
|
||||
<Button Command="{Binding NewGunStockCommand}" Style="{StaticResource GridViewPanelButton}"
|
||||
@@ -27,4 +29,4 @@
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
||||
</UserControl>
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<UserControl x:Class="SpecialPanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<EgtFloating:EgtFloatingPanel x:Class="SpecialPanelV"
|
||||
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"
|
||||
Visibility="{Binding SpecialPanel_Visibility}">
|
||||
|
||||
<ItemsControl ItemsSource="{Binding ButtonList}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
@@ -18,4 +20,4 @@
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
</UserControl>
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
''' </summary>
|
||||
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
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<WrapPanel x:Class="TopTrayV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:EgtCAM5"
|
||||
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
|
||||
DockPanel.Dock="Top"
|
||||
Orientation="Horizontal">
|
||||
|
||||
<EgtFloating:EgtFloatingPanel Name="ShowPanel"
|
||||
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
|
||||
<local:ShowPanelV DataContext="{StaticResource ShowPanelViewModel}"/>
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
<EgtFloating:EgtFloatingPanel Name="ViewPanel"
|
||||
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
|
||||
<local:ViewPanelV DataContext="{StaticResource ViewPanelViewModel}"/>
|
||||
<local:PopUpViewPanelV DataContext="{StaticResource PopUpViewPanelViewModel}" EgtFloating:EgtFloatingPanel.IsInPopUp="True"/>
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
<!--<EgtFloating:EgtFloatingPanel Name="InstrumentPanel"
|
||||
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">-->
|
||||
<local:InstrumentPanelV DataContext="{StaticResource InstrumentPanelViewModel}"/>
|
||||
<!--</EgtFloating:EgtFloatingPanel>-->
|
||||
<EgtFloating:EgtFloatingPanel Name="GridPanel"
|
||||
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
|
||||
<local:GridPanelV DataContext="{StaticResource GridPanelViewModel}"/>
|
||||
<local:PopUpGridPanelV DataContext="{StaticResource PopUpGridPanelViewModel}" EgtFloating:EgtFloatingPanel.IsInPopUp="True"/>
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
<local:MachinePanelV DataContext="{StaticResource DbPanelViewModel}"/>
|
||||
<local:ExecutePanelV DataContext="{StaticResource ExecutePanelViewModel}"/>
|
||||
<local:SpecialPanelV DataContext="{StaticResource SpecialPanelViewModel}"/>
|
||||
<local:BeamPanelV DataContext="{StaticResource BeamPanelViewModel}"/>
|
||||
<local:WallPanelV DataContext="{StaticResource WallPanelViewModel}"/>
|
||||
<local:BeamWallPanelV DataContext="{StaticResource BeamWallPanelViewModel}"/>
|
||||
<local:DoorPanelV DataContext="{StaticResource DoorsPanelViewModel}"/>
|
||||
<local:GunStockPanelV DataContext="{StaticResource GunStockPanelViewModel}"/>
|
||||
|
||||
</WrapPanel>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class TopTrayV
|
||||
|
||||
End Class
|
||||
@@ -37,7 +37,6 @@
|
||||
<EgtCAM5:BeamWallPanelVM x:Key="BeamWallPanelViewModel"/>
|
||||
<EgtCAM5:DoorPanelVM x:Key="DoorsPanelViewModel"/>
|
||||
<EgtCAM5:GunStockPanelVM x:Key="GunStockPanelViewModel"/>
|
||||
<EgtCAM5:Printing3DPanelVM x:Key="Printing3DPanelVM"/>
|
||||
<EgtCAM5:MyMachGroupPanelVM x:Key="MachGroupPanelViewModel"/>
|
||||
<!--<EgtCAM5:MachGroupPanelVM x:Key="MachGroupPanelViewModel"/>-->
|
||||
<!--<EgtCAM5:OperationExpanderVM x:Key="OperationExpanderViewModel"/>-->
|
||||
|
||||
+6
-9
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<Grid x:Class="WinFormPluginControlV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
DockPanel.Dock="{Binding DockSide}">
|
||||
|
||||
<!--ContentControl che ospita la scena restituita sotto forma di WindowsFormsHost-->
|
||||
<!--<ContentControl Content="{Binding WinFormUserControlHost}"/>-->
|
||||
<WindowsFormsHost Name="WinFormHost"/>
|
||||
|
||||
</Grid>
|
||||
@@ -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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user