diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..ab848d9
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,330 @@
+# ---> VisualStudio
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+
+# User-specific files
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+build/
+bld/
+[Bb]in/
+[Oo]bj/
+
+# Visual Studio 2015 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUNIT
+*.VisualState.xml
+TestResult.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# DNX
+project.lock.json
+artifacts/
+
+*_i.c
+*_p.c
+*_i.h
+*.ilk
+*.meta
+*.obj
+*.pch
+*.pdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opensdf
+*.sdf
+*.cachefile
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# JustCode is a .NET coding add-in
+.JustCode
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# TODO: Comment the next line if you want to checkin your web deploy settings
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# NuGet Packages
+*.nupkg
+# The packages folder can be ignored because of Package Restore
+**/packages/*
+# except build/, which is used as an MSBuild target.
+!**/packages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/packages/repositories.config
+
+# Windows Azure Build Output
+csx/
+*.build.csdef
+
+# Windows Store app package directory
+AppPackages/
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!*.[Cc]ache/
+
+# Others
+ClientBin/
+[Ss]tyle[Cc]op.*
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.pfx
+*.publishsettings
+node_modules/
+orleans.codegen.cs
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+
+# SQL Server files
+*.mdf
+*.ldf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# ---> C Sharp
+# Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
+[Bb]in/
+[Oo]bj/
+
+# mstest test results
+TestResults
+
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+
+# User-specific files
+*.suo
+*.user
+*.sln.docstates
+
+# Build results
+[Dd]ebug/
+[Rr]elease/
+x64/
+*_i.c
+*_p.c
+*.ilk
+*.meta
+*.obj
+*.pch
+*.pdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.log
+*.vspscc
+*.vssscc
+.builds
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opensdf
+*.sdf
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*
+
+# NCrunch
+*.ncrunch*
+.*crunch*.local.xml
+
+# Installshield output folder
+[Ee]xpress
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish
+
+# Publish Web Output
+*.Publish.xml
+
+# NuGet Packages Directory
+packages
+
+# Windows Azure Build Output
+csx
+*.build.csdef
+
+# Windows Store app package directory
+AppPackages/
+
+# Others
+[Bb]in
+[Oo]bj
+sql
+TestResults
+[Tt]est[Rr]esult*
+*.Cache
+ClientBin
+[Ss]tyle[Cc]op.*
+~$*
+*.dbmdl
+Generated_Code #added for RIA/Silverlight projects
+
+# Backup & report files from converting an old project file to a newer
+# Visual Studio version. Backup files are not needed, because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+
+.ionide/symbolCache.db
diff --git a/3dPrintApp.sln b/3dPrintApp.sln
new file mode 100644
index 0000000..da87235
--- /dev/null
+++ b/3dPrintApp.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.32002.261
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "3dPrintApp", "3dPrintApp/3dPrintApp.vbproj", "{BCDE0368-2C69-4948-8723-D0FE71417986}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x64 = Debug|x64
+ Release|x64 = Release|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {BCDE0368-2C69-4948-8723-D0FE71417986}.Debug|x64.ActiveCfg = Debug|x64
+ {BCDE0368-2C69-4948-8723-D0FE71417986}.Debug|x64.Build.0 = Debug|x64
+ {BCDE0368-2C69-4948-8723-D0FE71417986}.Release|x64.ActiveCfg = Release|x64
+ {BCDE0368-2C69-4948-8723-D0FE71417986}.Release|x64.Build.0 = Release|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {81E51533-B864-460A-ABD4-ADD1566CCDE0}
+ EndGlobalSection
+EndGlobal
diff --git a/3dPrintApp/3dPrintApp.sln b/3dPrintApp/3dPrintApp.sln
new file mode 100644
index 0000000..7844821
--- /dev/null
+++ b/3dPrintApp/3dPrintApp.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.32002.261
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "3dPrintApp", "3dPrintApp.vbproj", "{BCDE0368-2C69-4948-8723-D0FE71417986}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x64 = Debug|x64
+ Release|x64 = Release|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {BCDE0368-2C69-4948-8723-D0FE71417986}.Debug|x64.ActiveCfg = Debug|x64
+ {BCDE0368-2C69-4948-8723-D0FE71417986}.Debug|x64.Build.0 = Debug|x64
+ {BCDE0368-2C69-4948-8723-D0FE71417986}.Release|x64.ActiveCfg = Release|x64
+ {BCDE0368-2C69-4948-8723-D0FE71417986}.Release|x64.Build.0 = Release|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {81E51533-B864-460A-ABD4-ADD1566CCDE0}
+ EndGlobalSection
+EndGlobal
diff --git a/3dPrintApp/3dPrintApp.vbproj b/3dPrintApp/3dPrintApp.vbproj
new file mode 100644
index 0000000..d7c80ad
--- /dev/null
+++ b/3dPrintApp/3dPrintApp.vbproj
@@ -0,0 +1,336 @@
+
+
+
+ Debug
+ AnyCPU
+ {BCDE0368-2C69-4948-8723-D0FE71417986}
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}
+ WinExe
+ _3dPrintApp
+ 3dPrintApp
+ v4.7.2
+ Custom
+ true
+ true
+
+
+ On
+
+
+ Binary
+
+
+ Off
+
+
+ On
+
+
+ true
+ true
+ true
+ bin\x64\Debug\
+ 3dPrintApp.xml
+ 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314
+ full
+ x64
+ true
+
+
+ true
+ bin\x64\Release\
+ 3dPrintApp.xml
+ true
+ 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314
+ pdbonly
+ x64
+ true
+
+
+
+ ..\..\EgtProg\DllD32\EgtUILib.dll
+
+
+ ..\..\EgtProg\DllD32\EgtWPFLib5.dll
+
+
+ packages\Ionic.Zip.1.9.1.8\lib\Ionic.Zip.dll
+
+
+
+
+
+
+
+
+
+
+ 4.0
+
+
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+
+
+
+
+
+
+
+
+
+ CurrLayerSliderV.xaml
+
+
+
+ InstrumentPanelV.xaml
+
+
+
+ LeftPanelV.xaml
+
+
+
+ MachinePanelV.xaml
+
+
+
+ ProjectV.xaml
+
+
+
+ ProjManagerV.xaml
+
+
+
+
+ SceneHostV.xaml
+
+
+ SecondaryWindowV.xaml
+
+
+
+ ShowPanelV.xaml
+
+
+ Printing3DPanelV.xaml
+
+
+
+
+
+ StatusBarV.xaml
+
+
+ TopPanelV.xaml
+
+
+
+
+ Dictionary.xaml
+
+
+
+
+
+
+
+
+ ViewPanelV.xaml
+
+
+
+ Designer
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+ Designer
+
+
+ Designer
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ Application.xaml
+ Code
+
+
+ MainWindow.xaml
+ Code
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ Designer
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ Designer
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MainWindowV.xaml
+
+
+
+ Code
+
+
+ Microsoft.VisualBasic.WPF.MyExtension
+ 1.0.0.0
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+ VbMyResourcesResXFileCodeGenerator
+ Resources.Designer.vb
+ My.Resources
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.vb
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\3dPrintApp\3dPrintAppR64.exe
+IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Debug" copy $(TargetPath) c:\EgtProg\3dPrintApp\3dPrintAppD64.exe
+
+
\ No newline at end of file
diff --git a/3dPrintApp/AboutBoxWindow/AboutBoxV.xaml b/3dPrintApp/AboutBoxWindow/AboutBoxV.xaml
new file mode 100644
index 0000000..1e807e4
--- /dev/null
+++ b/3dPrintApp/AboutBoxWindow/AboutBoxV.xaml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/3dPrintApp/AboutBoxWindow/AboutBoxV.xaml.vb b/3dPrintApp/AboutBoxWindow/AboutBoxV.xaml.vb
new file mode 100644
index 0000000..7ee72ba
--- /dev/null
+++ b/3dPrintApp/AboutBoxWindow/AboutBoxV.xaml.vb
@@ -0,0 +1,37 @@
+Imports EgtUILib
+
+Public Class AboutBoxV
+
+ Private Sub AboutBoxWD_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
+ Me.Owner = Application.Current.MainWindow
+ DescriptionLbl.Text = My.Application.Info.Description.ToString()
+ VersionLbl.Text = "Version : " & My.Application.Info.Version.Major.ToString() &
+ "." & My.Application.Info.Version.Minor.ToString() &
+ (ChrW(97 - 1 + My.Application.Info.Version.Build)).ToString() &
+ My.Application.Info.Version.Revision.ToString()
+ CopyrightLbl.Text = My.Application.Info.Copyright.ToString()
+ Dim sInfo As String = String.Empty
+ Dim sKey As String = String.Empty
+ EgtGetKeyInfo(sKey)
+ Dim sKlev As String = Map.refMainWindowVM.MainWindowM.nKeyLevel.ToString()
+ Dim sOpts As String = Map.refMainWindowVM.MainWindowM.nKeyOptions.ToString()
+ Dim sLeftDays As String = ""
+ Dim nLeftDays As Integer
+ if EgtGetKeyLeftDays( nLeftDays) AndAlso nLeftDays < 500 Then sLeftDays= " (" & nLeftDays.ToString() & ")"
+ sInfo = If( EgtIsDebug(), "*** Debug Libraries ***" & Environment.NewLine, "")
+ sInfo &= "User " & Environment.MachineName & "\" & Environment.UserName &
+ " (" & Map.refMainWindowVM.MainWindowM.nInstance.ToString() & ")" & Environment.NewLine
+ sInfo &= sKey & " - " & sKlev & " - " & sOpts & sLeftDays & Environment.NewLine
+ sInfo &= "DataRoot " & Map.refMainWindowVM.MainWindowM.sDataRoot & Environment.NewLine
+ sInfo &= "MachinesRoot " & Map.refMainWindowVM.MainWindowM.sMachinesRoot & Environment.NewLine
+ Dim sCPU As String = String.Empty
+ EgtGetCpuInfo( sCPU)
+ sInfo &= sCPU & Environment.NewLine
+ Dim sScene As String = String.Empty
+ EgtGetSceneInfo(sScene)
+ sInfo &= sScene
+ InfoLbl.Text = sInfo
+ ExitBtn.Content = EgtMsg(MSG_MISSINGKEYWD + 4) 'Ok
+ End Sub
+
+End Class
diff --git a/3dPrintApp/AirspacePopup.vb b/3dPrintApp/AirspacePopup.vb
new file mode 100644
index 0000000..86b662e
--- /dev/null
+++ b/3dPrintApp/AirspacePopup.vb
@@ -0,0 +1,275 @@
+' Follow steps 1a or 1b and then 2 to use this custom control in a XAML file.
+'
+' Step 1a) Using this custom control in a XAML file that exists in the current project.
+' Add this XmlNamespace attribute to the root element of the markup file where it is
+' to be used:
+'
+' xmlns:MyNamespace="clr-namespace:_3dPrintApp"
+'
+'
+' Step 1b) Using this custom control in a XAML file that exists in a different project.
+' Add this XmlNamespace attribute to the root element of the markup file where it is
+' to be used:
+'
+' xmlns:MyNamespace="clr-namespace:_3dPrintApp;assembly=_3dPrintApp"
+'
+' You will also need to add a project reference from the project where the XAML file lives
+' to this project and Rebuild to avoid compilation errors:
+'
+' Right click on the target project in the Solution Explorer and
+' "Add Reference"->"Projects"->[Browse to and select this project]
+'
+'
+' Step 2)
+' Go ahead and use your control in the XAML file. Note that Intellisense in the
+' XML editor does not currently work on custom controls and its child elements.
+'
+'
+'
+
+Imports System.Windows.Controls.Primitives
+Imports System
+Imports System.ComponentModel
+Imports System.Diagnostics
+Imports System.Runtime.InteropServices
+Imports System.Windows
+Imports System.Windows.Input
+Imports System.Windows.Interop
+
+Public Class AirspacePopup
+ Inherits Popup
+
+ Public Shared ReadOnly IsTopmostProperty As DependencyProperty = DependencyProperty.Register("IsTopmost", GetType(Boolean), GetType(AirspacePopup), New FrameworkPropertyMetadata(False, AddressOf OnIsTopmostChanged))
+ Public Shared ReadOnly FollowPlacementTargetProperty As DependencyProperty = DependencyProperty.RegisterAttached("FollowPlacementTarget", GetType(Boolean), GetType(AirspacePopup), New UIPropertyMetadata(False))
+ Public Shared ReadOnly AllowOutsideScreenPlacementProperty As DependencyProperty = DependencyProperty.RegisterAttached("AllowOutsideScreenPlacement", GetType(Boolean), GetType(AirspacePopup), New UIPropertyMetadata(False))
+ Public Shared ReadOnly ParentWindowProperty As DependencyProperty = DependencyProperty.RegisterAttached("ParentWindow", GetType(Window), GetType(AirspacePopup), New UIPropertyMetadata(Nothing, AddressOf ParentWindowPropertyChanged))
+
+ Private Shared Sub OnIsTopmostChanged(ByVal source As DependencyObject, ByVal e As DependencyPropertyChangedEventArgs)
+ Dim airspacePopup As AirspacePopup = TryCast(source, AirspacePopup)
+ airspacePopup.SetTopmostState(airspacePopup.IsTopmost)
+ End Sub
+
+ Private Shared Sub ParentWindowPropertyChanged(ByVal source As DependencyObject, ByVal e As DependencyPropertyChangedEventArgs)
+ Dim airspacePopup As AirspacePopup = TryCast(source, AirspacePopup)
+ airspacePopup.ParentWindowChanged()
+ End Sub
+
+ Private m_appliedTopMost As Boolean?
+ Private m_alreadyLoaded As Boolean
+ Private m_parentWindow As Window
+
+ Shared Sub New()
+ 'This OverrideMetadata call tells the system that this element wants to provide a style that is different than its base class.
+ 'This style is defined in themes\generic.xaml
+ DefaultStyleKeyProperty.OverrideMetadata(GetType(AirspacePopup), New FrameworkPropertyMetadata(GetType(AirspacePopup)))
+ End Sub
+
+ Public Sub New()
+ AddHandler Loaded, AddressOf OnPopupLoaded
+ AddHandler Unloaded, AddressOf OnPopupUnloaded
+ Dim descriptor As DependencyPropertyDescriptor = DependencyPropertyDescriptor.FromProperty(PlacementTargetProperty, GetType(AirspacePopup))
+ descriptor.AddValueChanged(Me, AddressOf PlacementTargetChanged)
+ End Sub
+
+ Public Property IsTopmost As Boolean
+ Get
+ Return CBool(GetValue(IsTopmostProperty))
+ End Get
+ Set(ByVal value As Boolean)
+ SetValue(IsTopmostProperty, value)
+ End Set
+ End Property
+
+ Public Property FollowPlacementTarget As Boolean
+ Get
+ Return CBool(GetValue(FollowPlacementTargetProperty))
+ End Get
+ Set(ByVal value As Boolean)
+ SetValue(FollowPlacementTargetProperty, value)
+ End Set
+ End Property
+
+ Public Property AllowOutsideScreenPlacement As Boolean
+ Get
+ Return CBool(GetValue(AllowOutsideScreenPlacementProperty))
+ End Get
+ Set(ByVal value As Boolean)
+ SetValue(AllowOutsideScreenPlacementProperty, value)
+ End Set
+ End Property
+
+ Public Property ParentWindow As Window
+ Get
+ Return CType(GetValue(ParentWindowProperty), Window)
+ End Get
+ Set(ByVal value As Window)
+ SetValue(ParentWindowProperty, value)
+ End Set
+ End Property
+
+ Private Sub ParentWindowChanged()
+ If ParentWindow IsNot Nothing Then
+ AddHandler ParentWindow.LocationChanged, Function(sender, e2)
+ UpdatePopupPosition()
+ End Function
+
+ AddHandler ParentWindow.SizeChanged, Function(sender, e2)
+ UpdatePopupPosition()
+ End Function
+ End If
+ End Sub
+
+ Private Sub PlacementTargetChanged(ByVal sender As Object, ByVal e As EventArgs)
+ Dim placementTarget As FrameworkElement = TryCast(Me.PlacementTarget, FrameworkElement)
+
+ If placementTarget IsNot Nothing Then
+ AddHandler placementTarget.SizeChanged, Function(sender2, e2)
+ UpdatePopupPosition()
+ End Function
+ End If
+ End Sub
+
+ Private Sub UpdatePopupPosition()
+ Dim placementTarget As FrameworkElement = TryCast(Me.PlacementTarget, FrameworkElement)
+ Dim child As FrameworkElement = TryCast(Me.Child, FrameworkElement)
+
+ If PresentationSource.FromVisual(placementTarget) IsNot Nothing AndAlso AllowOutsideScreenPlacement = True Then
+ Dim leftOffset As Double = CutLeft(placementTarget)
+ Dim topOffset As Double = CutTop(placementTarget)
+ Dim rightOffset As Double = CutRight(placementTarget)
+ Dim bottomOffset As Double = CutBottom(placementTarget)
+ Debug.WriteLine(bottomOffset)
+ Me.Width = Math.Max(0, Math.Min(leftOffset, rightOffset) + placementTarget.ActualWidth)
+ Me.Height = Math.Max(0, Math.Min(topOffset, bottomOffset) + placementTarget.ActualHeight)
+
+ If child IsNot Nothing Then
+ child.Margin = New Thickness(leftOffset, topOffset, rightOffset, bottomOffset)
+ End If
+ End If
+
+ If FollowPlacementTarget = True Then
+ Me.HorizontalOffset += 0.01
+ Me.HorizontalOffset -= 0.01
+ End If
+ End Sub
+
+ Private Function CutLeft(ByVal placementTarget As FrameworkElement) As Double
+ Dim point As Point = placementTarget.PointToScreen(New Point(0, placementTarget.ActualWidth))
+ Return Math.Min(0, point.X)
+ End Function
+
+ Private Function CutTop(ByVal placementTarget As FrameworkElement) As Double
+ Dim point As Point = placementTarget.PointToScreen(New Point(placementTarget.ActualHeight, 0))
+ Return Math.Min(0, point.Y)
+ End Function
+
+ Private Function CutRight(ByVal placementTarget As FrameworkElement) As Double
+ Dim point As Point = placementTarget.PointToScreen(New Point(0, placementTarget.ActualWidth))
+ point.X += placementTarget.ActualWidth
+ Return Math.Min(0, SystemParameters.VirtualScreenWidth - (Math.Max(SystemParameters.VirtualScreenWidth, point.X)))
+ End Function
+
+ Private Function CutBottom(ByVal placementTarget As FrameworkElement) As Double
+ Dim point As Point = placementTarget.PointToScreen(New Point(placementTarget.ActualHeight, 0))
+ point.Y += placementTarget.ActualHeight
+ Return Math.Min(0, SystemParameters.VirtualScreenHeight - (Math.Max(SystemParameters.VirtualScreenHeight, point.Y)))
+ End Function
+
+ Private Sub OnPopupLoaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
+ If m_alreadyLoaded Then Return
+ m_alreadyLoaded = True
+
+ If Child IsNot Nothing Then
+ Child.[AddHandler](PreviewMouseLeftButtonDownEvent, New MouseButtonEventHandler(AddressOf OnChildPreviewMouseLeftButtonDown), True)
+ End If
+
+ m_parentWindow = Window.GetWindow(Me)
+ If m_parentWindow Is Nothing Then Return
+ AddHandler m_parentWindow.Activated, AddressOf OnParentWindowActivated
+ AddHandler m_parentWindow.Deactivated, AddressOf OnParentWindowDeactivated
+ End Sub
+
+ Private Sub OnPopupUnloaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
+ If m_parentWindow Is Nothing Then Return
+ RemoveHandler m_parentWindow.Activated, AddressOf OnParentWindowActivated
+ RemoveHandler m_parentWindow.Deactivated, AddressOf OnParentWindowDeactivated
+ End Sub
+
+ Private Sub OnParentWindowActivated(ByVal sender As Object, ByVal e As EventArgs)
+ SetTopmostState(True)
+ End Sub
+
+ Private Sub OnParentWindowDeactivated(ByVal sender As Object, ByVal e As EventArgs)
+ If IsTopmost = False Then
+ SetTopmostState(IsTopmost)
+ End If
+ End Sub
+
+ Private Sub OnChildPreviewMouseLeftButtonDown(ByVal sender As Object, ByVal e As MouseButtonEventArgs)
+ SetTopmostState(True)
+
+ If Not m_parentWindow.IsActive AndAlso IsTopmost = False Then
+ m_parentWindow.Activate()
+ End If
+ End Sub
+
+ Protected Overrides Sub OnOpened(ByVal e As EventArgs)
+ SetTopmostState(IsTopmost)
+ MyBase.OnOpened(e)
+ End Sub
+
+ Private Sub SetTopmostState(ByVal isTop As Boolean)
+ If m_appliedTopMost.HasValue AndAlso m_appliedTopMost = isTop Then
+ Return
+ End If
+
+ If Child Is Nothing Then Return
+ Dim hwndSource = TryCast((PresentationSource.FromVisual(Child)), HwndSource)
+ If hwndSource Is Nothing Then Return
+ Dim hwnd = hwndSource.Handle
+ Dim rect As RECT
+ If Not GetWindowRect(hwnd, rect) Then Return
+ Debug.WriteLine("setting z-order " & isTop)
+
+ If isTop Then
+ SetWindowPos(hwnd, HWND_TOPMOST, rect.Left, rect.Top, CInt(Width), CInt(Height), TOPMOST_FLAGS)
+ Else
+ SetWindowPos(hwnd, HWND_BOTTOM, rect.Left, rect.Top, CInt(Width), CInt(Height), TOPMOST_FLAGS)
+ SetWindowPos(hwnd, HWND_TOP, rect.Left, rect.Top, CInt(Width), CInt(Height), TOPMOST_FLAGS)
+ SetWindowPos(hwnd, HWND_NOTOPMOST, rect.Left, rect.Top, CInt(Width), CInt(Height), TOPMOST_FLAGS)
+ End If
+
+ m_appliedTopMost = isTop
+ End Sub
+
+
+ Public Structure RECT
+ Public Left As Integer
+ Public Top As Integer
+ Public Right As Integer
+ Public Bottom As Integer
+ End Structure
+
+
+ Private Shared Function GetWindowRect(ByVal hWnd As IntPtr, ByRef lpRect As RECT) As Boolean
+ End Function
+
+ Private Shared Function SetWindowPos(ByVal hWnd As IntPtr, ByVal hWndInsertAfter As IntPtr, ByVal X As Integer, ByVal Y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal uFlags As UInteger) As Boolean
+ End Function
+ Shared ReadOnly HWND_TOPMOST As IntPtr = New IntPtr(-1)
+ Shared ReadOnly HWND_NOTOPMOST As IntPtr = New IntPtr(-2)
+ Shared ReadOnly HWND_TOP As IntPtr = New IntPtr(0)
+ Shared ReadOnly HWND_BOTTOM As IntPtr = New IntPtr(1)
+ Private Const SWP_NOSIZE As UInt32 = &H1
+ Const SWP_NOMOVE As UInt32 = &H2
+ Const SWP_NOZORDER As UInt32 = &H4
+ Const SWP_NOREDRAW As UInt32 = &H8
+ Const SWP_NOACTIVATE As UInt32 = &H10
+ Const SWP_FRAMECHANGED As UInt32 = &H20
+ Const SWP_SHOWWINDOW As UInt32 = &H40
+ Const SWP_HIDEWINDOW As UInt32 = &H80
+ Const SWP_NOCOPYBITS As UInt32 = &H100
+ Const SWP_NOOWNERZORDER As UInt32 = &H200
+ Const SWP_NOSENDCHANGING As UInt32 = &H400
+ Const TOPMOST_FLAGS As UInt32 = SWP_NOACTIVATE Or SWP_NOOWNERZORDER Or SWP_NOSIZE Or SWP_NOMOVE Or SWP_NOREDRAW Or SWP_NOSENDCHANGING
+End Class
diff --git a/3dPrintApp/App.config b/3dPrintApp/App.config
new file mode 100644
index 0000000..56efbc7
--- /dev/null
+++ b/3dPrintApp/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/3dPrintApp/Application.xaml b/3dPrintApp/Application.xaml
new file mode 100644
index 0000000..f421ce5
--- /dev/null
+++ b/3dPrintApp/Application.xaml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
diff --git a/3dPrintApp/Application.xaml.vb b/3dPrintApp/Application.xaml.vb
new file mode 100644
index 0000000..71345d4
--- /dev/null
+++ b/3dPrintApp/Application.xaml.vb
@@ -0,0 +1,19 @@
+Class Application
+
+ ' Application-level events, such as Startup, Exit, and DispatcherUnhandledException
+ ' can be handled in this file.
+ Protected Overrides Sub OnStartup(e As StartupEventArgs)
+ MyBase.OnStartup(e)
+ ShutdownMode = System.Windows.ShutdownMode.OnMainWindowClose
+ ' Creo la View principale
+ Me.MainWindow = New MainWindowV
+ ' Mostro la View principale
+ Me.MainWindow.Show()
+ ' inizializzo finestra interfaccia
+ Dim m_SceneHostWnd = New SecondaryWindowV(Application.Current.MainWindow)
+ m_SceneHostWnd.Owner = Me.MainWindow
+ m_SceneHostWnd.Show()
+
+ End Sub
+
+End Class
diff --git a/3dPrintApp/Constants/ConstBeam.vb b/3dPrintApp/Constants/ConstBeam.vb
new file mode 100644
index 0000000..f652378
--- /dev/null
+++ b/3dPrintApp/Constants/ConstBeam.vb
@@ -0,0 +1,302 @@
+Public Module ConstBeam
+
+ Public Enum BTLParamType As Integer
+ DOUBLE_ = 1
+ STRING_ = 2
+ COMBO = 3
+ LENGTH = 4
+ CHECKBOX = 5
+ End Enum
+
+ Public Enum BTLPartParam As Integer
+ NULL = 0
+ PDN = 1
+ NAM = 2
+ GRP = 3
+ End Enum
+
+ Public Enum GRPType As Integer
+ L = 0
+ T = 1
+ End Enum
+
+ Enum MachineType As Integer
+ NULL = 0
+ BEAM = 1
+ WALL = 2
+ BOTH = 3
+ End Enum
+
+ Enum CalcStates As Integer
+ NOTCALCULATED = -1
+ OK = 0
+ INFO = 1
+ WARNING = 2
+ ERROR_ = 3
+ End Enum
+
+ Public Enum Range As Integer
+ STANDARD = 1
+ EXTENDED = 2
+ End Enum
+
+ Public Enum PartOffset_RefSideFixClamp As Integer
+ INACTIVE = 0
+ REFSIDE1 = 1
+ REFSIDE2 = 2
+ REFSIDE3 = 3
+ REFSIDE4 = 4
+ End Enum
+
+ Public Enum ProcessingQuality As Integer
+ AUTOMATIC = 1
+ VISIBLE = 2
+ FAST = 3
+ End Enum
+
+ Public Enum Recess As Integer
+ AUTOMATIC = 1
+ MANUAL = 2
+ End Enum
+
+ Public Enum StoreyType As Integer
+ CEILING = 1
+ ROOF = 2
+ WALL = 3
+ End Enum
+
+ Public Enum AlignmentLocation As Integer
+ INACTIV = 0
+ BR = 1
+ TR = 2
+ BA = 3
+ TA = 4
+ HC = 5
+ VC = 6
+ AC = 7
+ End Enum
+
+ Public Enum AlignmentEndtype As Integer
+ R = 1
+ A = 2
+ D = 3
+ End Enum
+
+ Public Enum MaterialType As Integer
+ INACTIV = 0
+ BA = 1
+ CL = 2
+ MT = 3
+ ME_ = 4
+ GB = 5
+ GF = 6
+ IN_ = 7
+ SH = 8
+ FB = 9
+ PB = 10
+ PL = 11
+ End Enum
+
+ Public Enum MoveDirections As Integer
+ UP = -1
+ DOWN = 1
+ End Enum
+
+ Public Const BTLFEATURES_FILE_NAME As String = "BTLFeatures.ini"
+
+ 'Public Const S_GENERAL As String = "General"
+ 'Public Const K_DEBUG As String = "Debug"
+
+ ' Tipo di progetto
+ Public Enum ProjectType As Integer
+ PROJ = 1
+ PROD = 2
+ End Enum
+
+ ' Tipo di progetto (Beam o Wall)
+ Public Enum BWType As Integer
+ NULL = 0
+ BEAM = 1
+ WALL = 2
+ End Enum
+
+ Public Const PROJ As String = "PROJ"
+ Public Const FILENAMESEPARATOR As Char = "^"c
+ Public Const BTLINFO As String = "BtlInfo"
+
+ ' layer per assemblato
+ Public Const ASSEBASE As String = "AsseBase"
+ ' info parametri assemblato
+ Public Const BTL_ASSEBASE_N As String = "N"
+
+ ' info parametri BTL
+ Public Const BTL_PRT_PROJ As String = "PROJ"
+ Public Const BTL_PRT_PDN As String = "PDN"
+ Public Const BTL_PRT_DO As String = "DO"
+ Public Const BTL_PRT_NAM As String = "NAM"
+ Public Const BTL_PRT_L As String = "L"
+ Public Const BTL_PRT_W As String = "W"
+ Public Const BTL_PRT_H As String = "H"
+ Public Const BTL_PRT_CNT As String = "CNT"
+ Public Const BTL_PRT_ADDED As String = "ADDED"
+ Public Const BTL_PRT_DONE As String = "DONE"
+ Public Const BTL_PRT_ROTATED As String = "ROTATED"
+ Public Const BTL_PRT_INVERTED As String = "INVERTED"
+ Public Const BTL_PRT_MATERIAL As String = "MATERIAL"
+ Public Const BTL_PRT_VOLUME As String = "VOLUME"
+ ' parametri pezzo
+ Public Const BTL_PRT_SINGLEMEMBERNUM = "SINGLEMEMBERNUMBER"
+ Public Const BTL_PRT_ASSEMBLYNUM = "ASSEMBLYNUMBER"
+ Public Const BTL_PRT_ORDERNUM = "ORDERNUMBER"
+ Public Const BTL_PRT_DESIGNATION = "DESIGNATION"
+ Public Const BTL_PRT_ANNOTATION = "ANNOTATION"
+ Public Const BTL_PRT_STOREY = "STOREY"
+ Public Const BTL_PRT_GROUP = "GROUP"
+ Public Const BTL_PRT_PACKAGE = "PACKAGE"
+ Public Const BTL_PRT_TIMBERGRADE = "TIMBERGRADE"
+ Public Const BTL_PRT_QUALITYGRADE = "QUALITYGRADE"
+ Public Const BTL_PRT_COLOUR = "COLOUR"
+ Public Const BTL_PRT_PLANINGLENGTH = "PLANINGLENGTH"
+ Public Const BTL_PRT_STARTOFFSET = "STARTOFFSET"
+ Public Const BTL_PRT_ENDOFFSET = "ENDOFFSET"
+ Public Const BTL_PRT_UID = "UID"
+ Public Const BTL_PRT_TRANSFORMATION = "TRANSFORMATION"
+ Public Const BTL_PRT_CAMBER = "CAMBER"
+ Public Const BTL_PRT_PARTOFFSET = "PARTOFFSET"
+ Public Const BTL_PRT_PROCESSINGQUALITY = "PROCESSINGQUALITY"
+ Public Const BTL_PRT_RECESS = "RECESS"
+ Public Const BTL_PRT_STOREYTYPE = "STOREYTYPE"
+ Public Const BTL_PRT_ELEMENTNUM = "ELEMENTNUMBER"
+ Public Const BTL_PRT_LAYER = "LAYER"
+ Public Const BTL_PRT_MODULENUM = "MODULENUMBER"
+ 'Friend Const BTL_PRT_USERATTRIBUTE = "USERATTRIBUTE"
+ Public Const BTL_PRT_COMMENT = "COMMENT"
+ Public Const BTL_PRT_GRAINDIR = "GRAINDIRECTION"
+ Public Const BTL_PRT_REFSIDE = "REFERENCESIDE"
+ Public Const BTL_PRT_ALIGNMENT = "ALIGNMENT"
+ Public Const BTL_PRT_MATERIALTYPE = "MATERIALTYPE"
+
+ ' parametri generici
+ Public Const BTL_GEN_PROJNUM = "PROJECTNUMBER"
+ Public Const BTL_GEN_PROJNAME = "PROJECTNAME"
+ Public Const BTL_GEN_PROJPART = "PROJECTPART"
+ Public Const BTL_GEN_PROJGUID = "PROJECTGUID"
+ Public Const BTL_GEN_PROJTYPE = "PROJECTTYPE"
+ Public Const BTL_GEN_LISTNAME = "LISTNAME"
+ Public Const BTL_GEN_CUSTOMER = "CUSTOMER"
+ Public Const BTL_GEN_ARCHITECT = "ARCHITECT"
+ Public Const BTL_GEN_EDITOR = "EDITOR"
+ Public Const BTL_GEN_DELIVDATE = "DELIVERYDATE"
+ Public Const BTL_GEN_EXPDATE = "EXPORTDATE"
+ Public Const BTL_GEN_EXPTIME = "EXPORTTIME"
+ Public Const BTL_GEN_EXPRELEASE = "EXPORTRELEASE"
+ Public Const BTL_GEN_LANGUAGE = "LANGUAGE"
+ Public Const BTL_GEN_RANGE = "RANGE"
+ Public Const BTL_GEN_COMPUTERNAME = "COMPUTERNAME"
+ Public Const BTL_GEN_USER = "USER"
+ Public Const BTL_GEN_SRCFILE = "SOURCEFILE"
+ Public Const BTL_GEN_EXPFILE = "EXPORTFILE"
+ Public Const BTL_GEN_USERATTRIBUTE = "USERATTRIBUTE"
+
+ Public Const PROCESSINGS As String = "Processings"
+ Public Const OUTLINE As String = "Outline"
+ Public Const BTL_FTR_GRP As String = "GRP"
+ Public Const BTL_FTR_PRC As String = "PRC"
+ Public Const BTL_FTR_DO As String = "DO"
+ Public Const BTL_FTR_SIDE As String = "SIDE"
+ Public Const BTL_FTR_NAME As String = "NAME"
+ Public Const BTL_FTR_DES As String = "DES"
+ Public Const BTL_FTR_PRID As String = "PRID"
+ Public Const BTL_FTR_FRAME As String = "FRAME"
+ Public Const BTL_FTR_MAINID As String = "MAINID"
+ Public Const BTL_FTR_ADJID As String = "ADJID"
+ Public Const BTL_FTR_AUXID As String = "AUXID"
+
+ ' parametri machgroup grezzi
+ Public Const MGR_RPT_ID As String = "ID"
+ Public Const MGR_RPT_L As String = "L"
+ Public Const MGR_RPT_W As String = "W"
+ Public Const MGR_RPT_H As String = "H"
+ Public Const MGR_RPT_WASTE As String = "WASTE"
+ Public Const MGR_RPT_USAGE As String = "USAGE"
+ Public Const MGR_RPT_STARTCUT As String = "STARTCUT"
+ Public Const MGR_RPT_MATERIAL As String = "MATERIAL"
+
+ Public Const MGR_PRT_PDN As String = "PDN"
+ Public Const MGR_PRT_L As String = "L"
+ Public Const MGR_PRT_W As String = "W"
+ Public Const MGR_PRT_H As String = "H"
+ Public Const MGR_PRT_DES As String = "DES"
+ Public Const MGR_PRT_STARTCUT As String = "STARTCUT"
+ Public Const MGR_PRT_MATERIAL As String = "MATERIAL"
+ Public Const MGR_PRT_DO As String = "DO"
+ Public Const MGR_PRT_ROT As String = "ROT"
+ Public Const MGR_PRT_FLIP As String = "FLIP"
+ Public Const MGR_PRT_POSX As String = "POSX"
+ Public Const MGR_PRT_POSY As String = "POSY"
+
+ Public Const MGR_FTR_GRP As String = "GRP"
+ Public Const MGR_FTR_PRC As String = "PRC"
+ Public Const MGR_FTR_DO As String = "DO"
+ Public Const MGR_FTR_SIDE As String = "SIDE"
+ Public Const MGR_FTR_NAME As String = "NAME"
+ Public Const MGR_FTR_DES As String = "DES"
+ Public Const MGR_FTR_PRID As String = "PRID"
+ Public Const MGR_FTR_FRAME As String = "FRAME"
+
+ ' parametri creazione barre
+ Public Const MGR_RPT_BARLEN As String = "BARLEN"
+ Public Const MGR_RPT_BARHEIGHT As String = "BARHEIGHT"
+ Public Const MGR_RPT_BARWIDTH As String = "BARWIDTH"
+ Public Const MGR_RPT_PANELLEN As String = "PANELLEN"
+ Public Const MGR_RPT_PANELWIDTH As String = "PANELWIDTH"
+ Public Const MGR_RPT_PANELHEIGHT As String = "PANELHEIGHT"
+ Public Const MGR_RPT_PART As String = "PART"
+
+ ' parametri P per comunicazione con la macchina
+ Public Const MGR_RPT_PRODID As String = "PRODID"
+ Public Const MGR_RPT_PATTID As String = "PATTID"
+
+ ' parametri errori integration
+ Public Const ITG_CUTID As String = "CUTID"
+ Public Const ITG_TASKID As String = "TASKID"
+ Public Const ITG_PROJ_ERR As String = "PROJ_ERR"
+ Public Const ITG_PROJ_MSG As String = "PROJ_MSG"
+ Public Const ITG_PROJ_ROT As String = "PROJ_ROT"
+ Public Const ITG_PROJ_FALL As String = "PROJ_FALL"
+ Public Const ITG_PROJ_TIME As String = "PROJ_TIME"
+
+ ' parametri errori integration
+ Public Const ITG_PROD_ERR As String = "PROD_ERR"
+ Public Const ITG_PROD_MSG As String = "PROD_MSG"
+ Public Const ITG_PROD_ROT As String = "PROD_ROT"
+ Public Const ITG_PROD_FALL As String = "PROD_FALL"
+ Public Const ITG_PROD_TIME As String = "PROD_TIME"
+
+ ' parametri blocco rot e flip
+ Public Const LOCK_ROT As String = "MANUALROT"
+ Public Const LOCK_FLIP As String = "MANUALFLIP"
+
+ ' parametri errori integration
+ Public Const DUPLO_TODELETE As String = "DUPLO_TODELETE"
+
+ ' parametri warehouse
+ Public Const WRH_BEAM As String = "BEAM"
+ Public Const WRH_WALL As String = "WALL"
+ Public Const WRH_CURRENT As String = "Current"
+ Public Const WRH_STARTOFFSET As String = "StartOffset"
+ Public Const WRH_OFFSET As String = "Offset"
+ Public Const WRH_RANGE As String = "Range"
+ Public Const WRH_QUANTITY As String = "Quantity"
+ Public Const WRH_L As String = "L"
+ Public Const WRH_KERF As String = "Kerf"
+ Public Const WRH_S As String = "S"
+
+ ' parametri import/export
+ Public Const EXP_PROJ As String = "EXPORTPROJ"
+ Public Const EXP_PROD As String = "EXPORTPROD"
+ Public Const BTLFILENAME As String = "BTLFILENAME"
+ Public Const EXP_PART As String = "ImportExport"
+ Public Const EXP_MACHINE As String = "Machine"
+
+End Module
diff --git a/3dPrintApp/Constants/ConstColumns.vb b/3dPrintApp/Constants/ConstColumns.vb
new file mode 100644
index 0000000..e0a3ac2
--- /dev/null
+++ b/3dPrintApp/Constants/ConstColumns.vb
@@ -0,0 +1,16 @@
+Public Module ConstColumns
+
+ Public Const COL_DO As String = "colDO"
+ Public Const COL_VALUE As String = "colVALUE"
+ Public Const COL_CUSTOM As String = "colCUSTOM"
+ Public Const COL_STARTCUT As String = "colSTARTCUT"
+ Public Const COL_W As String = "colW"
+ Public Const COL_L As String = "colL"
+ Public Const COL_ROT As String = "colROT"
+ Public Const COL_FLIP As String = "colFLIP"
+ Public Const COL_POSX As String = "colPOSX"
+ Public Const COL_POSY As String = "colPOSY"
+ Public Const COL_OFFSET As String = "colOFFSET"
+ Public Const COL_REDO As String = "colREDO"
+
+End Module
diff --git a/3dPrintApp/Constants/ConstDataGridColumnsIni.vb b/3dPrintApp/Constants/ConstDataGridColumnsIni.vb
new file mode 100644
index 0000000..9f0d611
--- /dev/null
+++ b/3dPrintApp/Constants/ConstDataGridColumnsIni.vb
@@ -0,0 +1,34 @@
+Public Module ConstDataGridColumnsIni
+
+ Public Const DATAGRIDCOLUMNS_FILE_NAME As String = "DataGridColumns.ini"
+
+ Public Const S_FEATURELIST As String = "DG_FeatureList"
+ Public Const S_OPENPROJFILEDLG_PROJ As String = "DG_OpenProjectFileDialog_PROJ"
+ Public Const S_OPENPROJFILEDLG_PROD As String = "DG_OpenProjectFileDialog_PROD"
+ Public Const S_RAWPARTLIST_BEAM As String = "DG_RawPartList_BEAM"
+ Public Const S_RAWPARTLIST_WALL As String = "DG_RawPartList_WALL"
+ Public Const S_PARTINRAWPARTLIST_BEAM As String = "DG_PartInRawPartList_BEAM"
+ Public Const S_PARTINRAWPARTLIST_WALL As String = "DG_PartInRawPartList_WALL"
+ Public Const S_PARAMETERLIST_P As String = "DG_ParameterList_P"
+ Public Const S_PARAMETERLIST_Q As String = "DG_ParameterList_Q"
+ Public Const S_DUPLOPARAMETERLIST_Q As String = "DG_DuploParameterList_Q"
+ Public Const S_RAWPARTLIST_SUPERVISOR As String = "DG_RawPartList_SUPERVISOR"
+ Public Const S_PARTINRAWPARTLIST_SUPERVISOR As String = "DG_PartInRawPartList_SUPERVISOR"
+ Public Const S_FEATUREINPARTINRAWPARTLIST_SUPERVISOR As String = "DG_FeatureInPartInRawPartList_SUPERVISOR"
+ Public Const S_PARTLIST As String = "DG_PartList"
+ Public Const S_FEATUREINPARTINRAWPARTLIST As String = "DG_FeatureInPartInRawPartList"
+ Public Const S_STATISTICS As String = "DG_Statistics"
+ Public Const S_OPTIMIZERSTATISTICS As String = "DG_OptimizerStatistics"
+ Public Const S_RAWPARTSTATISTICS As String = "DG_RawPartStatistics"
+ Public Const S_BEAMMACHININGS As String = "DG_BeamMachinings"
+ Public Const S_SPARAMLIST_BEAM As String = "DG_SParamList_BEAM"
+ Public Const S_SPARAMLIST_WALL As String = "DG_SParamList_WALL"
+ Public Const S_SECTXMATLIST_BEAM As String = "DG_SectXMatList_BEAM"
+ Public Const S_SECTXMATLIST_WALL As String = "DG_SectXMatList_WALL"
+ Public Const S_VARIABLESLIST As String = "DG_VariablesList"
+ Public Const S_MDICOMMANDS As String = "DG_MDICommands"
+ Public Const S_UPDATEBTLPARTLIST As String = "DG_UpdateBTLPartList"
+
+ Public Const K_LOCKTABLE As String = "LockTable"
+
+End Module
diff --git a/3dPrintApp/Constants/ConstDims.vb b/3dPrintApp/Constants/ConstDims.vb
new file mode 100644
index 0000000..1d56999
--- /dev/null
+++ b/3dPrintApp/Constants/ConstDims.vb
@@ -0,0 +1,13 @@
+Public Class ConstDims
+
+ Public Const DIMENSIONS_FILE_NAME As String = "Dimensions.ini"
+
+ Public Const PROJECT_VIEW As String = "Project_View"
+ Public Const PROJECT_OPTIMIZER As String = "Project_Optimizer"
+ Public Const LEFTPANEL_VIEW As String = "LeftPanel_View"
+ Public Const LEFTPANEL_OPTIMIZER As String = "LeftPanel_Optimizer"
+ Public Const TOPPANEL_OPTIMIZER As String = "TopPanel_Optimizer"
+ Public Const LEFTPANEL_SUPERVISOR As String = "LeftPanel_Supervisor"
+ Public Const PROJECT_SUPERVISOR As String = "Project_Supervisor"
+
+End Class
diff --git a/3dPrintApp/Constants/ConstGen.vb b/3dPrintApp/Constants/ConstGen.vb
new file mode 100644
index 0000000..1623224
--- /dev/null
+++ b/3dPrintApp/Constants/ConstGen.vb
@@ -0,0 +1,74 @@
+'----------------------------------------------------------------------------
+' EgalTech 2015-2017
+'----------------------------------------------------------------------------
+' File : ConstGen.vb Data : 10.04.17 Versione : 1.8d1
+' Contenuto : Modulo costanti generali.
+'
+'
+'
+' Modifiche : 10.04.17 DS Creazione modulo.
+'
+'
+'----------------------------------------------------------------------------
+
+Public Module ConstGen
+
+ ' File con direttorio radice dei dati
+ Public Const DAT_FILE_NAME As String = "DataRoot.Ini"
+ Public Const S_DATA As String = "Data"
+ Public Const K_DATAROOT As String = "DataRoot"
+
+ ' File con dati di licenza
+ Public Const LIC_FILE_NAME As String = "3dPrintApp.lic"
+ Public Const S_LICENCE As String = "Licence"
+ Public Const K_KEY As String = "Key"
+ Public Const K_NESTKEY As String = "NestKey"
+
+ ' Pagine del programma
+ Public Enum Pages As Integer
+ VIEW = 0
+ MACHINING = 1
+ SUPERVISOR = 2
+ CONFIG = 3
+ INPUTS = 4
+ OUTPUTS = 5
+ End Enum
+
+ ' Abilitazioni licenza
+ Friend Enum KEY_OPT As UInteger
+ BASE = 1 ' Prodotto EgtCAM5
+ DOORS = 2
+ GUNSTOCK = 4
+ DOORCREATOR = 8 ' Prodotto DOORCreator
+ VIRTUALMILLING = 16
+ JAMBS = 32
+ BEAM = 64
+ CAD2D = 128
+ STEELDORS = 256
+ WALL = 512
+ _3DPRINT = 1024
+ End Enum
+
+ ' File di log generale
+ Public Const GENLOG_FILE_NAME As String = "3dPrintApp#.txt"
+
+ ' Sottodirettorio di configurazione
+ Public Const CONF_DIR As String = "Config"
+ ' Sottodirettorio delle risorse
+ Public Const RES_DIR As String = "Resources"
+ ' Sottodirettorio temporaneo
+ Public Const TEMP_DIR As String = "Temp"
+ ' Sottodirettorio lavorazioni
+ Public Const MACHININGS_DIR As String = "Machinings"
+ ' Sottodirettorio materiali
+ Public Const MATERIALS_DIR As String = "Materials"
+ ' Sottodirettorio per lavorazioni travi
+ Public Const _3DPRINTING_DIR As String = "3dPrintApp"
+ ' Sottodirettorio di default per le macchine
+ Public Const MACHINES_DFL_DIR As String = "Machines"
+ ' Sottodirettorio di default per toolmakers
+ Public Const TOOLMAKERS_DFL_DIR As String = "ToolMakers"
+ ' Nome file Lua con le funzioni di attrezzaggio
+ Public Const SETUP_LUA As String = "SetUp.lua"
+
+End Module
diff --git a/3dPrintApp/Constants/ConstIni.vb b/3dPrintApp/Constants/ConstIni.vb
new file mode 100644
index 0000000..018413f
--- /dev/null
+++ b/3dPrintApp/Constants/ConstIni.vb
@@ -0,0 +1,105 @@
+'----------------------------------------------------------------------------
+' EgalTech 2015-2015
+'----------------------------------------------------------------------------
+' File : ConstIni.vb Data : 12.02.15 Versione : 1.6b3
+' Contenuto : Modulo costanti sezione e chiavi per file Ini.
+'
+'
+'
+' Modifiche : 12.02.15 DS Creazione modulo.
+'
+'
+'----------------------------------------------------------------------------
+
+Public Module ConstIni
+
+ Public Const INI_FILE_NAME As String = "3dPrintApp.ini"
+
+ 'Public Const S_GENERAL As String = "General"
+ 'Public Const K_DEBUG As String = "Debug"
+ 'Public Const K_LICENCE As String = "Licence"
+ 'Public Const K_USERLEVEL As String = "UserLevel"
+ 'Public Const K_MAXINST As String = "MaxInstances"
+ Public Const K_MAXCAMINST As String = "MaxCamInstances"
+ Public Const K_VIEWOPTIM_INSTANCES As String = "ViewOptimInstances"
+ Public Const K_SUPERVISOR_INSTANCES As String = "SupervisorInstances"
+ 'Public Const K_COMMANDLOG As String = "CommandLog"
+ 'Public Const K_MESSAGESDIR As String = "MessagesDir"
+ 'Public Const K_MESSAGES As String = "Messages"
+ 'Public Const K_WINPLACE As String = "WinPlace"
+ 'Public Const K_LASTPROJ As String = "LastProj"
+ Public Const K_LASTNGEDIR As String = "LastNgeDir"
+ 'Public Const K_AUTOLOADLASTPROJ As String = "AutoLoadLastProj"
+ Public Const K_LASTIMPDIR As String = "LastImpDir"
+ Public Const K_LASTNGEXPDIR As String = "LastNgexpDir"
+ Public Const K_LASTUPDATEDIR As String = "LastUpdateDir"
+ Public Const K_PROJSINDEX As String = "ProjsIndex"
+ Public Const K_PRODSINDEX As String = "ProdsIndex"
+ 'Public Const K_SUPPORT As String = "Support"
+ Public Const K_WAREHOUSE As String = "Warehouse"
+ Public Const K_DBADDRESS As String = "DbAddress"
+ Public Const K_DBMASTERKEY As String = "DbMasterKey"
+ Public Const K_UPDATEBTL As String = "UpdateBtl"
+ Public Const K_DATADIR As String = "DataDir"
+
+ 'Public Const S_LANGUAGES As String = "Languages"
+ 'Public Const K_LANGUAGE As String = "Language"
+
+ 'Public Const S_LUA As String = "Lua"
+ 'Public Const K_LIBSDIR As String = "LibsDir"
+ 'Public Const K_BASELIB As String = "BaseLib"
+
+ 'Public Const S_GEOMDB As String = "GeomDB"
+ 'Public Const K_DEFAULTFONT As String = "DefaultFont"
+ 'Public Const K_NFEFONTDIR As String = "NfeFontDir"
+ 'Public Const K_DEFAULTCOLOR As String = "DefaultColor"
+ 'Public Const K_SAVETYPE As String = "SaveType"
+
+ 'Public Const S_OPENGL As String = "OpenGL"
+ 'Public Const K_DOUBLEBUFFER As String = "DoubleBuffer"
+ 'Public Const K_COLORBITS As String = "ColorBits"
+ 'Public Const K_DEPTHBITS As String = "DepthBits"
+ 'Public Const K_DRIVER As String = "Driver"
+
+ 'Public Const S_SCENE As String = "Scene"
+ 'Public Const K_BACKTOP As String = "BackTop"
+ 'Public Const K_BACKBOTTOM As String = "BackBottom"
+ 'Public Const K_SHOWGFRAME As String = "ShowGFrame"
+ 'Public Const K_MARK As String = "Mark"
+ 'Public Const K_SELSURF As String = "SelSurf"
+ 'Public Const K_SHOWMODE As String = "ShowMode"
+ Public Const K_SHOWBUILDING As String = "ShowBuilding"
+ 'Public Const K_CURVEDIR As String = "CurveDir"
+ 'Public Const K_SHOWTRIAADV As String = "ShowTriaAdv"
+ Public Const K_LINEWIDTH As String = "LineWidth"
+ 'Public Const K_TEXMAXLINPIX As String = "TextureMaxLinPixels"
+ 'Public Const K_ZOOMWIN As String = "ZoomWin"
+ 'Public Const K_DISTLINE As String = "DistLine"
+ 'Public Const K_MMUNITS As String = "MmUnits"
+ Public Const K_CUSTOMCOLORS As String = "CustomColors"
+
+ 'Public Const S_GRID As String = "Grid"
+ 'Public Const K_SHOWGRID As String = "ShowGrid"
+ 'Public Const K_SHOWFRAME As String = "ShowFrame"
+ 'Public Const K_SNAPSTEP As String = "SnapStep"
+ 'Public Const K_SNAPSTEPINCH As String = "SnapStepInch"
+ 'Public Const K_MINLINESSTEP As String = "MinLineSStep"
+ 'Public Const K_MAJLINESSTEP As String = "MajLineSStep"
+ 'Public Const K_EXTSSTEP As String = "ExtSStep"
+ 'Public Const K_MINLNCOLOR As String = "MinLnColor"
+ 'Public Const K_MAJLNCOLOR As String = "MajLnColor"
+
+ Public Const S_IMPORT As String = "Import"
+ Public Const K_CNCFLAG As String = "CncFlag"
+
+ 'Public Const S_SIMUL As String = "Simul"
+ 'Public Const K_SLIDERX As String = "SliderX"
+ 'Public Const K_SLIDERVAL As String = "SliderVal"
+
+ Public Const S_PRINTING3D As String = "3dPrinting"
+ Public Const K_3PRNBASEDIR As String = "BaseDir"
+ Public Const K_CURRMATERIAL As String = "CurrMaterial"
+
+ Public Const S_MRUFILES As String = "MruFiles"
+
+End Module
diff --git a/3dPrintApp/Constants/ConstMachComm.vb b/3dPrintApp/Constants/ConstMachComm.vb
new file mode 100644
index 0000000..6748309
--- /dev/null
+++ b/3dPrintApp/Constants/ConstMachComm.vb
@@ -0,0 +1,60 @@
+Public Module ConstMachComm
+
+ Public Enum ResultTypes As Integer
+ NULL = 0
+ EXECUTED = 1
+ RESULT = 2
+ End Enum
+
+ Public Enum CommandTypes As Integer
+ ERROR_ = 1
+ CONNECT = 2
+ DISCONNECT = 3
+ START = 4
+ SOFTSTART = 5
+ STOP_ = 6
+ RESET = 7
+ STEP_ = 8
+ SETPOINT = 9
+ SENDPROG = 10
+ REMOVEPROG = 11
+ REMOVEALLPROG = 12
+ READ_TPA = 13
+ WRITE = 14
+ DELETEALARMS = 15
+ SETOPMODE = 16
+ READ_NUMFLEXIUM = 17
+ STOPREAD_NUMFLEXIUM = 18
+ MDI = 19
+ SETCHANNEL = 20
+ End Enum
+
+ Public Enum LogCommandTypes As Integer
+ NULL = 0
+ ERROR_ = 1
+ CONNECT = 2
+ DISCONNECT = 3
+ START = 4
+ SOFTSTART = 5
+ STOP_ = 6
+ RESET = 7
+ STEP_ = 8
+ SETPOINT = 9
+ SENDPROG = 10
+ REMOVEPROG = 11
+ REMOVEALLPROG = 12
+ READ = 13
+ WRITE = 14
+ DELETEALARMS = 15
+ SETOP = 16
+ ALARM = 17
+ NEWOP = 18
+ End Enum
+
+ Public Enum CommandStates As Integer
+ NULL = 0
+ ERROR_ = 1
+ OK = 2
+ End Enum
+
+End Module
diff --git a/3dPrintApp/Constants/ConstMachIni.vb b/3dPrintApp/Constants/ConstMachIni.vb
new file mode 100644
index 0000000..ce8f6b2
--- /dev/null
+++ b/3dPrintApp/Constants/ConstMachIni.vb
@@ -0,0 +1,27 @@
+Public Module ConstMachIni
+
+ Public Const MACH_INI_FILE_NAME As String = "MachData.ini"
+ Public Const GETWALLDATA_FILE_NAME As String = "GetWallData.lua"
+ Public Const GETTS3DATA_FILE_NAME As String = "GetTs3Data.lua"
+
+ Public Const K_NCTYPE As String = "NCType"
+ Public Const K_CONNECTIONSTRING As String = "ConnectionString"
+
+ Public Const S_CHANNELS As String = "Channels"
+
+ ' Variables della macchina corrente
+ Public Const S_MAINVARIABLES As String = "MainVariables"
+ Public Const S_VARIABLES As String = "Variables"
+ Public Const S_INPUTVARIABLES As String = "InputVariables"
+ Public Const S_OUTPUTVARIABLES As String = "OutputVariables"
+ Public Const S_MDI As String = "MDI"
+
+ Public Const K_BEAM As String = "Beam"
+ Public Const K_WALL As String = "Wall"
+ Public Const K_SCRIPT As String = "Scripts"
+ Public Const K_SETUP As String = "Setup"
+ Public Const K_FLOW As String = "Flow"
+
+ Public Const TS3DATA_FILE As String = "Ts3Data.lua"
+
+End Module
diff --git a/3dPrintApp/Constants/ConstMsg.vb b/3dPrintApp/Constants/ConstMsg.vb
new file mode 100644
index 0000000..26be903
--- /dev/null
+++ b/3dPrintApp/Constants/ConstMsg.vb
@@ -0,0 +1,54 @@
+Public Module ConstMsg
+
+ Public Const MSG_SETUPERRORS As Integer = 5000 + 1470
+
+ Public Const MSG_MISSINGKEYWD As Integer = 10100
+ Public Const MSG_NUMERICKEYBOARDWD As Integer = 10200
+ Public Const MSG_MESSAGEBOX As Integer = 15000
+ Public Const MSG_EGTSAVEFILEDIALOG As Integer = 30000
+
+ Public Const MSG_OMAGCUT As Integer = 90000
+ Public Const MSG_GENERAL As Integer = MSG_OMAGCUT
+ Public Const MSG_WORKINPROGRESSPAGEUC As Integer = MSG_OMAGCUT + 100
+ Public Const MSG_DIRECTCUTPAGEUC As Integer = MSG_OMAGCUT + 200
+ Public Const MSG_MANUALAXESMOVEPAGEUC As Integer = MSG_OMAGCUT + 220
+ Public Const MSG_CADCUTPAGEUC As Integer = MSG_OMAGCUT + 300
+ Public Const MSG_NESTPAGEUC As Integer = MSG_OMAGCUT + 330
+ Public Const MSG_SPLITPAGEUC As Integer = MSG_OMAGCUT + 340
+ Public Const MSG_MOVERAWPAGEUC As Integer = MSG_OMAGCUT + 360
+ Public Const MSG_DRAWPAGEUC As Integer = MSG_OMAGCUT + 380
+ Public Const MSG_COMPONENTPAGEUC As Integer = MSG_OMAGCUT + 400
+ Public Const MSG_IMPORTPAGEUC As Integer = MSG_OMAGCUT + 450
+ Public Const MSG_OPENPAGEUC As Integer = MSG_OMAGCUT + 490
+ Public Const MSG_RAWPARTPAGEUC As Integer = MSG_OMAGCUT + 500
+ Public Const MSG_CHOOSEMACHININGPAGEUC As Integer = MSG_OMAGCUT + 535
+ Public Const MSG_SIMULATIONPAGEUC As Integer = MSG_OMAGCUT + 550
+ Public Const MSG_FRAMECUTPAGEUC As Integer = MSG_OMAGCUT + 600
+ Public Const MSG_MACHINEPAGEUC As Integer = MSG_OMAGCUT + 700
+ Public Const MSG_TOOLSDBPAGEUC As Integer = MSG_OMAGCUT + 720
+ Public Const MSG_MACHININGSDBPAGEUC As Integer = MSG_OMAGCUT + 760
+ Public Const MSG_COMBOBOXPARAM As Integer = MSG_OMAGCUT + 800
+ Public Const MSG_ALARMSPAGEUC As Integer = MSG_OMAGCUT + 900
+ Public Const MSG_MACHINECNPAGEUC As Integer = MSG_OMAGCUT + 950
+ Public Const MSG_OPTIONSPAGEUC As Integer = MSG_OMAGCUT + 980
+ Public Const MSG_EGTMSGBOX As Integer = MSG_OMAGCUT + 1100
+ Public Const MSG_CSVPAGEUC As Integer = MSG_OMAGCUT + 1200
+
+ Public Const MSG_OMAGOFFICE As Integer = 91400
+ Public Const MSG_OPTIONPANEL As Integer = MSG_OMAGOFFICE
+ Public Const MSG_MYMACHININGDBWINDOW As Integer = MSG_OMAGOFFICE + 50
+ Public Const MSG_TOPCMDBAR As Integer = MSG_OMAGOFFICE + 100
+ Public Const MSG_RAWPARTTAB As Integer = MSG_OMAGOFFICE + 150
+ Public Const MSG_VEINMATCHING As Integer = MSG_OMAGOFFICE + 200
+ Public Const MSG_GENERIC As Integer = MSG_OMAGOFFICE + 250
+
+ Public Const MSG_EGTWPFLIB5 As Integer = 30000
+ Public Const MSG_TOPCOMMANDBAR As Integer = MSG_EGTWPFLIB5 + 500
+ Public Const MSG_GRIDVIEWPANEL As Integer = MSG_EGTWPFLIB5 + 800
+ Public Const MSG_TOOLDB As Integer = MSG_EGTWPFLIB5 + 1000
+ Public Const MSG_TOOLDBERRORS As Integer = MSG_EGTWPFLIB5 + 1100
+ Public Const MSG_MACHININGDB As Integer = MSG_EGTWPFLIB5 + 1200
+ Public Const MSG_MACHININGDBERRORS As Integer = MSG_EGTWPFLIB5 + 1400
+ Public Const MSG_SIMULATION As Integer = MSG_EGTWPFLIB5 + 1600
+
+End Module
diff --git a/3dPrintApp/CurrLayerSlider/CurrLayerSliderV.xaml b/3dPrintApp/CurrLayerSlider/CurrLayerSliderV.xaml
new file mode 100644
index 0000000..14a7efe
--- /dev/null
+++ b/3dPrintApp/CurrLayerSlider/CurrLayerSliderV.xaml
@@ -0,0 +1,10 @@
+
+
+
+
+
diff --git a/3dPrintApp/CurrLayerSlider/CurrLayerSliderV.xaml.vb b/3dPrintApp/CurrLayerSlider/CurrLayerSliderV.xaml.vb
new file mode 100644
index 0000000..dbcd9c4
--- /dev/null
+++ b/3dPrintApp/CurrLayerSlider/CurrLayerSliderV.xaml.vb
@@ -0,0 +1,3 @@
+Public Class CurrLayerSliderV
+
+End Class
diff --git a/3dPrintApp/CurrLayerSlider/CurrLayerSliderVM.vb b/3dPrintApp/CurrLayerSlider/CurrLayerSliderVM.vb
new file mode 100644
index 0000000..1b382d6
--- /dev/null
+++ b/3dPrintApp/CurrLayerSlider/CurrLayerSliderVM.vb
@@ -0,0 +1,16 @@
+Imports EgtWPFLib5
+
+Public Class CurrLayerSliderVM
+ Inherits VMBase
+
+ Private m_nValue As Integer = 0
+ Public Property nValue As Integer
+ Get
+ Return m_nValue
+ End Get
+ Set(value As Integer)
+ m_nValue = value
+ End Set
+ End Property
+
+End Class
diff --git a/3dPrintApp/InstrumentPanel/InstrumentPanelV.xaml b/3dPrintApp/InstrumentPanel/InstrumentPanelV.xaml
new file mode 100644
index 0000000..f1b58c5
--- /dev/null
+++ b/3dPrintApp/InstrumentPanel/InstrumentPanelV.xaml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
diff --git a/3dPrintApp/InstrumentPanel/InstrumentPanelV.xaml.vb b/3dPrintApp/InstrumentPanel/InstrumentPanelV.xaml.vb
new file mode 100644
index 0000000..b8adb88
--- /dev/null
+++ b/3dPrintApp/InstrumentPanel/InstrumentPanelV.xaml.vb
@@ -0,0 +1,3 @@
+Public Class InstrumentPanelV
+
+End Class
diff --git a/3dPrintApp/InstrumentPanel/MyInstrumentPanelVM.vb b/3dPrintApp/InstrumentPanel/MyInstrumentPanelVM.vb
new file mode 100644
index 0000000..3628a6c
--- /dev/null
+++ b/3dPrintApp/InstrumentPanel/MyInstrumentPanelVM.vb
@@ -0,0 +1,47 @@
+Imports System.Collections.ObjectModel
+Imports System.IO
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Public Class MyInstrumentPanelVM
+ Inherits InstrumentPanelVM
+
+ Private m_InstrumentPanel_IsEnabled As Boolean = True
+ Public Property InstrumentPanel_IsEnabled As Boolean
+ Get
+ Return m_InstrumentPanel_IsEnabled
+ End Get
+ Set(value As Boolean)
+ m_InstrumentPanel_IsEnabled = value
+ End Set
+ End Property
+
+
+#Region "CONSTRUCTORS"
+
+ Sub New()
+ ' imposto riferimento in Map
+ Map.SetRefInstrumentPanelVM(Me)
+ End Sub
+
+#End Region ' CONSTRUCTORS
+
+#Region "METHODS"
+
+ Public Overrides Function OnPostGetDistIsChecked() As Boolean
+ Map.refSceneHostVM.MainScene.SetStatusNull()
+ Return True
+ End Function
+
+ Friend Sub SetGetDistance_IsChecked(bIsChecked As Boolean)
+ GetDistIsChecked = bIsChecked
+ End Sub
+
+ Friend Sub SetInstrumentPanelIsEnabled(bIsEnabled As Boolean)
+ m_InstrumentPanel_IsEnabled = bIsEnabled
+ NotifyPropertyChanged(NameOf(InstrumentPanel_IsEnabled))
+ End Sub
+
+#End Region ' METHODS
+
+End Class
diff --git a/3dPrintApp/LeftPanel/LeftPanelV.xaml b/3dPrintApp/LeftPanel/LeftPanelV.xaml
new file mode 100644
index 0000000..d1cb175
--- /dev/null
+++ b/3dPrintApp/LeftPanel/LeftPanelV.xaml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/3dPrintApp/LeftPanel/LeftPanelV.xaml.vb b/3dPrintApp/LeftPanel/LeftPanelV.xaml.vb
new file mode 100644
index 0000000..919aa0c
--- /dev/null
+++ b/3dPrintApp/LeftPanel/LeftPanelV.xaml.vb
@@ -0,0 +1,3 @@
+Public Class LeftPanelV
+
+End Class
diff --git a/3dPrintApp/LeftPanel/LeftPanelVM.vb b/3dPrintApp/LeftPanel/LeftPanelVM.vb
new file mode 100644
index 0000000..ccd634e
--- /dev/null
+++ b/3dPrintApp/LeftPanel/LeftPanelVM.vb
@@ -0,0 +1,25 @@
+Imports System.Globalization
+
+Public Class LeftPanelVM
+
+End Class
+
+Public Class CenterToolTipConverter
+ Implements IMultiValueConverter
+
+ Public Function Convert(ByVal values As Object(), ByVal targetType As Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object Implements IMultiValueConverter.Convert
+ For Each value In values
+ If TypeOf (value) IsNot Double Then
+ Return Double.NaN
+ End If
+ Next
+ Dim placementTargetHeight As Double = CDbl(values(0))
+ Dim toolTipHeight As Double = CDbl(values(1))
+ Return (placementTargetHeight / 2.0) - (toolTipHeight / 2.0)
+ End Function
+
+ Public Function ConvertBack(ByVal value As Object, ByVal targetTypes As Type(), ByVal parameter As Object, ByVal culture As CultureInfo) As Object() Implements IMultiValueConverter.ConvertBack
+ Throw New NotSupportedException()
+ End Function
+
+End Class
diff --git a/3dPrintApp/MachinePanel/MachinePanelV.xaml b/3dPrintApp/MachinePanel/MachinePanelV.xaml
new file mode 100644
index 0000000..a963f60
--- /dev/null
+++ b/3dPrintApp/MachinePanel/MachinePanelV.xaml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/3dPrintApp/MachinePanel/MachinePanelV.xaml.vb b/3dPrintApp/MachinePanel/MachinePanelV.xaml.vb
new file mode 100644
index 0000000..83a5832
--- /dev/null
+++ b/3dPrintApp/MachinePanel/MachinePanelV.xaml.vb
@@ -0,0 +1,3 @@
+Public Class MachinePanelV
+
+End Class
diff --git a/3dPrintApp/MachinePanel/MachinePanelVM.vb b/3dPrintApp/MachinePanel/MachinePanelVM.vb
new file mode 100644
index 0000000..5aba00d
--- /dev/null
+++ b/3dPrintApp/MachinePanel/MachinePanelVM.vb
@@ -0,0 +1,168 @@
+Imports System.Collections.ObjectModel
+Imports System.IO
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Public Class MachinePanelVM
+ Inherits EgtWPFLib5.MachinePanelVM
+
+#Region "FIELDS & PROPERTIES"
+
+ ' Radice del direttorio delle macchine
+ Private m_sMachinesRoot As String
+
+ ' Macchina correntemente selezionata e quindi attiva
+ Private m_SelectedMachine As Machine = Nothing
+ Public Overrides Property SelectedMachine As Machine
+ Get
+ Return m_SelectedMachine
+ End Get
+ Set(value As Machine)
+ If value IsNot m_SelectedMachine Then
+ ' imposto macchina in DbGeometrico
+ If EgtSetCurrMachine(value.Name) Then
+ m_SelectedMachine = value
+ End If
+ ' Salvo impostazione macchina corrente
+ SaveCurrentMachine()
+ NotifyPropertyChanged(NameOf(SelectedMachine))
+ ' inizializzo la macchina selezionata come macchina corrente
+ InitCurrentMachine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, value.Name)
+ ' aggiorno nome macchina in statusbar
+ Map.refMyStatusBarVM.RefreshMachName()
+ End If
+ End Set
+ End Property
+
+ Private m_MachPanel_IsEnabled As Boolean = True
+ Public Property MachPanel_IsEnabled As Boolean
+ Get
+ Return m_MachPanel_IsEnabled
+ End Get
+ Set(value As Boolean)
+ m_MachPanel_IsEnabled = value
+ NotifyPropertyChanged("MachPanel_IsEnabled")
+ End Set
+ End Property
+
+ Private m_BeamTable_Visibility As Visibility
+ Public ReadOnly Property BeamTable_Visibility As Visibility
+ Get
+ Return m_BeamTable_Visibility
+ End Get
+ End Property
+
+ Private m_WallTable_Visibility As Visibility
+ Public ReadOnly Property WallTable_Visibility As Visibility
+ Get
+ Return m_WallTable_Visibility
+ End Get
+ End Property
+
+#Region "Messages"
+
+ Public ReadOnly Property ToolDBMsg As String
+ Get
+ Return EgtMsg(MSG_MACHINEPAGEUC + 6)
+ End Get
+ End Property
+ Public ReadOnly Property MachiningDbMsg As String
+ Get
+ Return EgtMsg(MSG_MACHINEPAGEUC + 7)
+ End Get
+ End Property
+ Public ReadOnly Property SetUpMsg As String
+ Get
+ Return EgtMsg(MSG_ALARMSPAGEUC + 33)
+ End Get
+ End Property
+
+#End Region ' Messages
+
+#Region "ToolTip"
+
+ Public ReadOnly Property ToolDBToolTip As String
+ Get
+ Return EgtMsg(5003)
+ End Get
+ End Property
+ Public ReadOnly Property MachiningDbToolTip As String
+ Get
+ Return EgtMsg(5004)
+ End Get
+ End Property
+ Public ReadOnly Property SetUpToolTip As String
+ Get
+ Return EgtMsg(31501)
+ End Get
+ End Property
+
+#End Region ' ToolTip
+
+ ' Definizione comandi
+ Private m_cmdBeamTable As ICommand
+ Private m_cmdWallTable As ICommand
+
+#End Region 'FIELDS & PROPERTIES
+
+#Region "CONSTRUCTOR"
+
+ Sub New()
+ ' Creo riferimento a questa classe in Map
+ Map.SetRefMachinePanelVM(Me)
+ ' recupero cartella radice delle macchine
+ m_sMachinesRoot = Map.refMainWindowVM.MainWindowM.sMachinesRoot
+ ' Carica macchine da cartella delle macchine
+ MyMachine.MachineListInit(m_sMachinesRoot, MachineList)
+ End Sub
+
+#End Region ' CONSTRUCTOR
+
+#Region "METHODS"
+
+ Friend Sub LoadCurrentMachine()
+ If MachineList.Count = 0 Then Return
+ Dim CurrMachine As Machine = Nothing
+ Dim CurrMachineName As String = String.Empty
+ GetMainPrivateProfileString(S_MACH, K_CURRMACH, String.Empty, CurrMachineName)
+ Dim bFound As Boolean = False
+ If Not String.IsNullOrEmpty(CurrMachineName) Then
+ For Each Mach In MachineList
+ If Mach.Name = CurrMachineName Then
+ bFound = True
+ CurrMachine = Mach
+ Exit For
+ End If
+ Next
+ End If
+ If Not bFound And MachineList.Count > 0 Then
+ CurrMachine = MachineList(0)
+ End If
+ If Not IsNothing(CurrMachine) Then
+ If EgtSetCurrMachine(CurrMachine.Name) Then
+ SelectedMachine = CurrMachine
+ End If
+ End If
+ End Sub
+
+ Friend Sub SaveCurrentMachine()
+ If IsNothing(m_SelectedMachine) Then Return
+ WriteMainPrivateProfileString(S_MACH, K_CURRMACH, SelectedMachine.Name)
+ End Sub
+
+ Friend Sub UpdateCurrentMachine()
+ 'EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
+ Dim sMachName As String = String.Empty
+ If EgtGetCurrMachineName(sMachName) Then
+ For Each Mach In MachineList
+ If Mach.Name = sMachName Then
+ SelectedMachine = Mach
+ Exit For
+ End If
+ Next
+ End If
+ End Sub
+
+#End Region
+
+End Class
diff --git a/3dPrintApp/MainWindow.xaml b/3dPrintApp/MainWindow.xaml
new file mode 100644
index 0000000..6d76522
--- /dev/null
+++ b/3dPrintApp/MainWindow.xaml
@@ -0,0 +1,12 @@
+
+
+
+
+
diff --git a/3dPrintApp/MainWindow.xaml.vb b/3dPrintApp/MainWindow.xaml.vb
new file mode 100644
index 0000000..922a5de
--- /dev/null
+++ b/3dPrintApp/MainWindow.xaml.vb
@@ -0,0 +1,3 @@
+Class MainWindow
+
+End Class
diff --git a/3dPrintApp/MainWindow/MainWindowM.vb b/3dPrintApp/MainWindow/MainWindowM.vb
new file mode 100644
index 0000000..b8daf65
--- /dev/null
+++ b/3dPrintApp/MainWindow/MainWindowM.vb
@@ -0,0 +1,347 @@
+Imports System.Threading
+Imports System.Math
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Public Class MainWindowM
+
+#Region "FIELDS"
+
+ ' massimo numero di istanze del programma ammesse
+ Const MAX_INST As Integer = 32
+
+ Private m_sDataRoot As String = String.Empty
+ Friend ReadOnly Property sDataRoot As String
+ Get
+ Return m_sDataRoot
+ End Get
+ End Property
+
+ Private m_sDataDir As String = String.Empty
+ Friend ReadOnly Property sDataDir As String
+ Get
+ Return m_sDataDir
+ End Get
+ End Property
+
+ Private m_sConfigDir As String = String.Empty
+ Public ReadOnly Property sConfigDir As String
+ Get
+ Return m_sConfigDir
+ End Get
+ End Property
+
+ Private m_nDebug As Integer = 0
+
+ Private m_objMutex As Mutex
+
+ Private m_bFirstInstance As Boolean = False
+ Friend ReadOnly Property bFirstInstance As Boolean
+ Get
+ Return m_bFirstInstance
+ End Get
+ End Property
+
+ Private m_nInstance As Integer = 0
+ Friend ReadOnly Property nInstance As Integer
+ Get
+ Return m_nInstance
+ End Get
+ End Property
+
+ Private m_nUserLevel As Integer = 1
+ Friend ReadOnly Property nUserLevel As Integer
+ Get
+ Return m_nUserLevel
+ End Get
+ End Property
+
+ Private m_nKeyLevel As Integer = 0
+ Friend ReadOnly Property nKeyLevel As Integer
+ Get
+ Return m_nKeyLevel
+ End Get
+ End Property
+
+ Private m_nKeyOptions As UInteger = 0
+ Friend ReadOnly Property nKeyOptions As Integer
+ Get
+ Return m_nKeyOptions
+ End Get
+ End Property
+
+ Private m_bAutoNestOption As Boolean = False
+ Friend ReadOnly Property AutoNestOption As Boolean
+ Get
+ Return m_bAutoNestOption
+ End Get
+ End Property
+
+ Friend ReadOnly Property sVersion As String
+ Get
+ Return My.Application.Info.Version.Major.ToString() & "." &
+ My.Application.Info.Version.Minor.ToString() &
+ (ChrW(97 - 1 + My.Application.Info.Version.Build)).ToString() &
+ My.Application.Info.Version.Revision.ToString()
+ End Get
+ End Property
+
+ Private m_s3dPrintingDir As String
+ Friend ReadOnly Property s3dPrintingDir As String
+ Get
+ Return m_s3dPrintingDir
+ End Get
+ End Property
+ Private m_sMachiningsDir As String
+ Friend ReadOnly Property sMachiningsDir As String
+ Get
+ Return m_sMachiningsDir
+ End Get
+ End Property
+ Private m_sMaterialsDir As String
+ Friend ReadOnly Property sMaterialsDir As String
+ Get
+ Return m_sMaterialsDir
+ End Get
+ End Property
+
+ Private m_sTempDir As String
+ Friend ReadOnly Property sTempDir As String
+ Get
+ Return m_sTempDir
+ End Get
+ End Property
+ Private m_sMachinesRoot As String
+ Friend ReadOnly Property sMachinesRoot As String
+ Get
+ Return m_sMachinesRoot
+ End Get
+ End Property
+ Private m_sToolMakersDir As String
+ Friend ReadOnly Property sToolMakersDir As String
+ Get
+ Return m_sToolMakersDir
+ End Get
+ End Property
+ Private m_sResourcesRoot As String
+ Friend ReadOnly Property sResourcesRoot As String
+ Get
+ Return m_sResourcesRoot
+ End Get
+ End Property
+ Private m_sLogFile As String
+ Friend ReadOnly Property sLogFile As String
+ Get
+ Return m_sLogFile
+ End Get
+ End Property
+
+#End Region ' FIELDS
+
+#Region "CONSTRUCTOR"
+
+ Sub New()
+ InitializeEgtEnvironment()
+ End Sub
+
+#End Region ' CONSTRUCTOR
+
+#Region "METHODS"
+
+ Private Sub InitializeEgtEnvironment()
+ '' Abilito drag and drop
+ 'Me.AllowDrop = True
+ ' Impostazione path radice per i dati
+ m_sDataRoot = System.AppDomain.CurrentDomain.BaseDirectory
+ If EgtUILib.GetPrivateProfileString(S_DATA, K_DATAROOT, "", m_sDataRoot, m_sDataRoot & "\" & DAT_FILE_NAME) = 0 Then
+ m_sDataRoot = System.AppDomain.CurrentDomain.BaseDirectory
+ End If
+ ' Impostazione direttorio di configurazione
+ m_sConfigDir = m_sDataRoot & "\" & CONF_DIR
+ ' Impostazione direttorio per file temporanei
+ m_sTempDir = m_sDataRoot & "\" & TEMP_DIR
+ ' Impostazione path Ini file
+ IniFile.m_sIniFile = m_sConfigDir & "\" & INI_FILE_NAME
+ ' Impostazione path resources dir
+ m_sResourcesRoot = m_sDataRoot & "\" & RES_DIR
+ ' Impostazione path machinings e materials dir
+ m_sMachiningsDir = m_sDataRoot & "\" & MACHININGS_DIR
+ m_sMaterialsDir = m_sDataRoot & "\" & MATERIALS_DIR
+ ' Impostazione direttorio per le macchine
+ If GetMainPrivateProfileString(S_MACH, K_MACHINESDIR, "", m_sMachinesRoot) = 0 Then
+ m_sMachinesRoot = m_sDataRoot & "\" & MACHINES_DFL_DIR
+ End If
+ ' Impostazione direttorio per toolmakers
+ If GetMainPrivateProfileString(S_MACH, K_TOOLMAKERSDIR, "", m_sToolMakersDir) = 0 Then
+ m_sToolMakersDir = m_sDataRoot & "\" & TOOLMAKERS_DFL_DIR
+ End If
+ ' Impostazione direttorio 3dPrinting
+ If GetMainPrivateProfileString(S_PRINTING3D, K_3PRNBASEDIR, "", m_s3dPrintingDir) = 0 Then
+ m_s3dPrintingDir = m_sDataRoot & "\" & _3DPRINTING_DIR
+ End If
+ ' Verifico indice di istanza
+ ManageInstance()
+ ' Imposto tipo di chiave
+ EgtSetLockType(KEY_TYPE.HW)
+ ' Leggo e imposto chiave di protezione
+ Dim sLicFileName As String = String.Empty
+ GetMainPrivateProfileString(S_GENERAL, K_LICENCE, LIC_FILE_NAME, sLicFileName)
+ Dim sLicFile As String = m_sConfigDir & "\" & sLicFileName
+ Dim sKey As String = String.Empty
+ EgtUILib.GetPrivateProfileString(S_LICENCE, K_KEY, "", sKey, sLicFile)
+ EgtSetKey(sKey)
+ Dim sNestKey As String = ""
+ EgtUILib.GetPrivateProfileString(S_LICENCE, K_NESTKEY, "", sNestKey, sLicFile)
+ 'EgtSetNestKey(sNestKey)
+ ' Verifico abilitazione nesting automatico
+ m_bAutoNestOption = Not String.IsNullOrWhiteSpace(sNestKey)
+ ' Recupero livello e opzioni della chiave
+ Dim bKey As Boolean = EgtGetKeyLevel(3279, 2405, 1, m_nKeyLevel) And
+ EgtGetKeyOptions(3279, 2405, 1, m_nKeyOptions)
+ ' Inizializzazione generale di EgtInterface
+ m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
+ m_sLogFile = m_sTempDir & "\" & GENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
+ Dim sLogMsg As String = "User " & Environment.MachineName & "\" & Environment.UserName & " (" & m_nInstance.ToString() & ")" & vbLf &
+ My.Application.Info.Title.ToString() & " ver. " &
+ My.Application.Info.Version.Major.ToString() &
+ "." & My.Application.Info.Version.Minor.ToString() &
+ (ChrW(97 - 1 + My.Application.Info.Version.Build)).ToString() &
+ My.Application.Info.Version.Revision.ToString()
+ EgtInit(m_nDebug, m_sLogFile, sLogMsg)
+ EgtSetTempDir(m_sTempDir)
+ EgtSetIniFile(IniFile.m_sIniFile)
+ ' Leggo direttorio dei messaggi (se manca uso direttorio di configurazione)
+ Dim sMsgDir As String = String.Empty
+ If GetMainPrivateProfileString(S_GENERAL, K_MESSAGESDIR, "", sMsgDir) = 0 Then
+ sMsgDir = m_sConfigDir
+ End If
+ ' Leggo lingua corrente
+ Dim sLanguage As String = String.Empty
+ GetMainPrivateProfileString(S_GENERAL, K_MESSAGES, "", sLanguage)
+ ' Recupero nome file dei messaggi della lingua corrente
+ Dim sMsgName As String = "EgalTechIta.txt"
+ Dim nIndex As Integer = 1
+ While True
+ Dim ReadLanguage As Language = GetMainPrivateProfileLanguage(S_LANGUAGES, K_LANGUAGE & nIndex)
+ If IsNothing(ReadLanguage) Then Exit While
+ If String.Compare(ReadLanguage.Name, sLanguage, True) = 0 Then
+ sMsgName = ReadLanguage.FilePath
+ Exit While
+ End If
+ nIndex += 1
+ End While
+ ' Leggo file messaggi
+ Dim sMsgFilePath As String = sMsgDir & "\" & sMsgName
+ If Not EgtLoadMessages(sMsgFilePath) Then
+ EgtOutLog("Error in EgtLoadMessages")
+ End If
+ ' Leggo e imposto unità di misura per interfaccia utente
+ EgtSetUiUnits(GetMainPrivateProfileInt(S_SCENE, K_MMUNITS, 1) <> 0)
+ ' Leggo e imposto livello utilizzatore
+ m_nUserLevel = Math.Min(m_nKeyLevel, GetMainPrivateProfileInt(S_GENERAL, K_USERLEVEL, 1))
+ ' Imposto dir font Nfe e font default
+ Dim sNfeDir As String = String.Empty
+ GetMainPrivateProfileString(S_GEOMDB, K_NFEFONTDIR, "", sNfeDir)
+ Dim sDefFont As String = String.Empty
+ GetMainPrivateProfileString(S_GEOMDB, K_DEFAULTFONT, "", sDefFont)
+ EgtSetFont(sNfeDir, sDefFont)
+ ' imposto dir di default per libreria Lua e lancio libreria di base
+ Dim sLuaLibsDir As String = String.Empty
+ GetMainPrivateProfileString(S_LUA, K_LIBSDIR, "", sLuaLibsDir)
+ EgtSetLuaLibs(sLuaLibsDir)
+ Dim sLuaBaseLib As String = String.Empty
+ GetMainPrivateProfileString(S_LUA, K_BASELIB, "EgtBase", sLuaBaseLib)
+ EgtLuaRequire(sLuaBaseLib)
+ ' Info su opzioni chiave
+ EgtOutLog("KeyOptions : " & bKey.ToString() & " " & m_nKeyOptions.ToString())
+ End Sub
+
+ Private Sub ManageInstance()
+ Dim bCreated As Boolean
+ Try
+ m_objMutex = New Mutex(False, "Global\3dPrintApp", bCreated)
+ Catch
+ bCreated = False
+ End Try
+ m_bFirstInstance = bCreated
+ If bCreated Then
+ ' Prima istanza
+ m_nInstance = 1
+ ' Aggiorno stato istanze attive
+ WriteMainPrivateProfileString(S_GENERAL, K_VIEWOPTIM_INSTANCES, m_nInstance.ToString())
+ Else
+ ' Leggo il massimo numero di istanze ammesse
+ Dim nMaxInst As Integer = GetMaxInstances()
+ ' Cerco il primo indice di istanza libero
+ Dim nTmp As Integer = GetMainPrivateProfileInt(S_GENERAL, K_VIEWOPTIM_INSTANCES, 0)
+ m_nInstance = 1
+ Dim nMask As Integer = 1
+ While (nTmp And nMask) <> 0 And m_nInstance <= MAX_INST
+ m_nInstance += 1
+ nMask *= 2
+ End While
+ ' Se l'indice supera il massimo
+ If m_nInstance > nMaxInst Then
+ ' porto in primo piano la prima istanza
+ Dim bFound As Boolean = False
+ ' processi del programma a 32 bit
+ Dim localProc As Process() = Process.GetProcessesByName("3dPrintAppR32")
+ For Each p As Process In localProc
+ If p.Id <> Process.GetCurrentProcess().Id Then
+ bFound = True
+ ShowWindow(p.MainWindowHandle, 1)
+ Exit For
+ End If
+ Next
+ ' se non trovati processi a 32 bit provo a 64 bit
+ If Not bFound Then
+ localProc = Process.GetProcessesByName("3dPrintAppR64")
+ For Each p As Process In localProc
+ If p.Id <> Process.GetCurrentProcess().Id Then
+ bFound = True
+ ShowWindow(p.MainWindowHandle, SW.RESTORE)
+ Exit For
+ End If
+ Next
+ End If
+ ' esco dal programma
+ End
+ End If
+ ' Aggiorno stato istanze attive
+ nTmp += (1 << (m_nInstance - 1))
+ WriteMainPrivateProfileString(S_GENERAL, K_VIEWOPTIM_INSTANCES, nTmp.ToString())
+ End If
+ End Sub
+
+ Friend Function GetKeyOption(nKeyOpt As KEY_OPT) As Boolean
+ Return ((m_nKeyOptions And nKeyOpt) <> 0)
+ End Function
+
+ Friend Function GetMaxInstances() As Integer
+ ' Leggo il massimo numero di istanze ammesse
+ Dim nMaxInst As Integer = GetMainPrivateProfileInt(S_GENERAL, K_MAXINST, 1)
+ Return 1 ' Max(1, Min(nMaxInst, MAX_INST))
+ End Function
+
+ Friend Function GetMaxCamInstances() As Integer
+ ' Leggo il massimo numero di istanze ammesse
+ Dim nMaxInst As Integer = GetMainPrivateProfileInt(S_GENERAL, K_MAXCAMINST, 1)
+ Return Max(1, Min(nMaxInst, MAX_INST))
+ End Function
+
+ Friend Sub Close()
+ ' Terminazione generale di EgtInterface
+ EgtExit()
+ ' Aggiorno istanze usate
+ m_objMutex.WaitOne(1000)
+ Dim nTmp As Integer = GetMainPrivateProfileInt(S_GENERAL, K_VIEWOPTIM_INSTANCES, 0)
+ nTmp -= (1 << (m_nInstance - 1))
+ WriteMainPrivateProfileString(S_GENERAL, K_VIEWOPTIM_INSTANCES, nTmp.ToString())
+ m_objMutex.ReleaseMutex()
+ ' Rilascio mutex
+ If Not IsNothing(m_objMutex) Then m_objMutex.Close()
+ End Sub
+
+#End Region ' METHODS
+
+End Class
diff --git a/3dPrintApp/MainWindow/MainWindowV.xaml b/3dPrintApp/MainWindow/MainWindowV.xaml
new file mode 100644
index 0000000..a782b35
--- /dev/null
+++ b/3dPrintApp/MainWindow/MainWindowV.xaml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
diff --git a/3dPrintApp/MainWindow/MainWindowV.xaml.vb b/3dPrintApp/MainWindow/MainWindowV.xaml.vb
new file mode 100644
index 0000000..053ef6f
--- /dev/null
+++ b/3dPrintApp/MainWindow/MainWindowV.xaml.vb
@@ -0,0 +1,63 @@
+Imports EgtWPFLib5
+Imports EgtUILib
+Imports System.Windows.Interop
+
+Class MainWindowV
+
+ Private m_MainWindowVM As MainWindowVM
+ Private m_SceneHostWnd As SecondaryWindowV
+
+#Region "CONSTRUCTOR"
+
+ Sub New()
+ m_MainWindowVM = New MainWindowVM
+ ' Funzione che interpreta l'xaml
+ InitializeComponent()
+ Me.DataContext = m_MainWindowVM
+ ' creo finestra della scena
+ AddHandler Me.Loaded, AddressOf MainWindowV_Loaded
+ AddHandler Me.Closing, AddressOf MainWindowV_Closing
+ AddHandler Me.KeyDown, AddressOf MainWindowV_KeyDown
+ End Sub
+
+#End Region ' CONSTRUCTOR
+
+#Region "EVENTS"
+
+ Private Sub MainWindowV_Loaded(sender As Object, e As RoutedEventArgs)
+ ' Carico e imposto posizione finestra
+ WinPosFromIniToWindow(S_GENERAL, K_WINPLACE, Me)
+ ' Recupero e imposto handle finestra principale
+ Dim hMainWnd As IntPtr = New WindowInteropHelper(Application.Current.MainWindow).Handle
+ EgtSetMainWindowHandle(hMainWnd)
+ End Sub
+
+ Private Sub MainWindowV_Closing(sender As Object, e As System.ComponentModel.CancelEventArgs)
+ If (Keyboard.Modifiers And ModifierKeys.Alt) = ModifierKeys.Alt OrElse Keyboard.IsKeyDown(Key.F4) Then
+ e.Cancel = True
+ Return
+ End If
+ ' Salvo posizione finestra (se non minimizzata)
+ If WindowState <> WindowState.Minimized Then
+ WinPosFromWindowToIni(Me, S_GENERAL, K_WINPLACE)
+ End If
+ End Sub
+
+ Private Sub MainWindowV_KeyDown(sender As Object, e As KeyEventArgs)
+ 'm_MainWindowVM.KeyDown(e.Key)
+ End Sub
+
+ Private Sub MainWindowV_Drop(sender As Object, e As DragEventArgs)
+ ' Se drag di file
+ If e.Data.GetDataPresent(DataFormats.FileDrop) Then
+ ' Attivo il programma
+ Me.Activate()
+ ' Recupero l'array di stringhe con i nomi del file
+ Dim sFiles() As String = DirectCast(e.Data.GetData(DataFormats.FileDrop), String())
+
+ End If
+ End Sub
+
+#End Region ' EVENTS
+
+End Class
diff --git a/3dPrintApp/MainWindow/MainWindowVM.vb b/3dPrintApp/MainWindow/MainWindowVM.vb
new file mode 100644
index 0000000..c78cfd4
--- /dev/null
+++ b/3dPrintApp/MainWindow/MainWindowVM.vb
@@ -0,0 +1,280 @@
+Imports EgtUILib
+Imports EgtWPFLib5
+Imports System.IO
+Imports System.Threading
+Imports System.Windows.Threading
+
+Public Class MainWindowVM
+ Inherits VMBase
+
+ Private m_SupervisorCommThread As Thread
+ Private m_Supervisor_Timer As New DispatcherTimer
+
+ ' Riferimento al Model della MainWindow
+ Private m_MainWindowM As MainWindowM
+ Friend ReadOnly Property MainWindowM As MainWindowM
+ Get
+ Return m_MainWindowM
+ End Get
+ End Property
+
+ ' Variabile che indica che il programma è stato avviato correttamente (sia la mappa che l'ambiente Egt)
+ Private m_bInitStatus As Boolean
+ Friend ReadOnly Property bInitStatus As Boolean
+ Get
+ Return m_bInitStatus
+ End Get
+ End Property
+
+ ' Titolo
+ Private m_Title As String = ""
+ Public ReadOnly Property Title As String
+ Get
+ Return m_Title
+ End Get
+ End Property
+
+ ' proprietà che seleziona la giusta pagina del TabControl
+ Public Property nSelTabPage As Integer
+ Get
+ ' Return If(IsNothing(Map.refMainMenuVM.SelPage) OrElse Map.refMainMenuVM.SelPage = -1 OrElse Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.MACHINING, 0, 1)
+ End Get
+ Set(value As Integer)
+ End Set
+ End Property
+
+ Private m_MachinePanelVM As MachinePanelVM
+ Public ReadOnly Property MachinePanelVM As MachinePanelVM
+ Get
+ Return m_MachinePanelVM
+ End Get
+ End Property
+
+ 'Friend m_SupervisorStop As Boolean = False
+ 'Private BlockedWnd As BlockedWndV
+
+ ' definizione comandi
+ Private m_cmdAboutBox As ICommand
+ Private m_cmdCloseApplication As ICommand
+
+#Region "CONSTRUCTOR"
+
+ Sub New()
+ ' Avvio l'inizializzazione della mappa passandogli il riferimento al MainWindowVM
+ Map.BeginInit(Me)
+ ' Creo Model della MainWindow
+ m_MainWindowM = New MainWindowM
+ ' inizializzo machine panel
+ m_MachinePanelVM = New MachinePanelVM
+ ' inizializzo contatore per blocco da supervisore
+ m_Supervisor_Timer.Interval = TimeSpan.FromMilliseconds(500)
+ ' AddHandler m_Supervisor_Timer.Tick, AddressOf SupervisorTimer_Tick
+ m_Supervisor_Timer.Start()
+ End Sub
+
+#End Region ' CONSTRUCTOR
+
+ '#Region "METHODS"
+
+ ' Friend Sub SetTitle(sTitle As String)
+ ' m_Title = sTitle
+ ' NotifyPropertyChanged(NameOf(Title))
+ ' End Sub
+ ' Public Sub UpdateTitle()
+ ' m_Title = ""
+ ' Select Case Map.refMainMenuVM.SelPage
+ ' Case Pages.VIEW
+ ' If Not IsNothing(Map.refProjManagerVM.CurrProj) Then
+ ' If Map.refProjManagerVM.CurrProj.bIsNew Then m_Title = "New - "
+ ' m_Title &= Map.refProjManagerVM.CurrProj.nProjId.ToString("0000") & " - " & Map.refProjManagerVM.CurrProj.sBTLFileName
+ ' End If
+ ' Case Pages.MACHINING
+ ' If Not IsNothing(Map.refProdManagerVM.CurrProd) Then
+ ' If Map.refProdManagerVM.CurrProd.bIsNew Then m_Title = "New - "
+ ' m_Title &= Map.refProdManagerVM.CurrProd.nProdId.ToString("0000") & " - " & Map.refProdManagerVM.CurrProd.sBTLFileName
+ ' End If
+ ' Case Pages.CONFIG
+ ' m_Title = "Configuration Page"
+ ' End Select
+ ' m_Title &= " - EgtBEAMWALL"
+ ' NotifyPropertyChanged(NameOf(Title))
+ ' End Sub
+
+ ' Friend Sub ContentRendered()
+ ' DbControllers.Init()
+ ' '' chiamata a caso su Db per inizializzarlo
+ ' DbControllers.m_ProjController.FindByProjDbId(0)
+ ' ' Verifico che l'inizializzazione di tutte le parti del programma sia andata a buon fine
+ ' If Map.EndInit() Then
+ ' m_bInitStatus = True
+ ' ' altrimenti chiudo il programma
+ ' Else
+ ' m_bInitStatus = False
+ ' End If
+ ' ' Aggiorno visualizzazione unità di misura
+ ' 'Map.refStatusBarVM.SetMeasureUnit(If(EgtUiUnitsAreMM(), MeasureUnitOpt.MM, MeasureUnitOpt.INCH))
+ ' ' imposto MainWindow per finestra di Loading
+ ' LoadingWndHelper.SetMainWindow(Application.Current.MainWindow)
+ ' ' leggo riga di comando
+ ' Dim nCommandType As Integer = 0
+ ' Dim nPage As Pages = Pages.VIEW
+ ' Dim nProdId As Integer = 0
+ ' If ProcessCommandLine(nCommandType, nPage, nProdId) Then
+ ' Select Case nCommandType
+ ' Case 1
+ ' Map.refProdManagerVM.SetCurrProd(nProdId)
+ ' Case 2
+ ' ' pagina gia' impostata nella variabile
+ ' End Select
+ ' Else
+ ' ' setto il primo file dalla lista degli MRU come progetto corrente da aprire
+ ' Dim sLastProjectPath As String = String.Empty
+ ' GetMainPrivateProfileString(S_MRUPROJFILES, K_FILE & "1", String.Empty, sLastProjectPath)
+ ' If Not String.IsNullOrWhiteSpace(sLastProjectPath) AndAlso File.Exists(sLastProjectPath) Then
+ ' ' ricavo l'Id e il progetto associato per l'apertura di quest'ultimo
+ ' Dim PjId As Integer = 0
+ ' Dim sPjId As String = Path.GetFileNameWithoutExtension(sLastProjectPath)
+ ' Integer.TryParse(sPjId, PjId)
+ ' Map.refProjManagerVM.SetCurrProj(PjId)
+ ' End If
+ ' End If
+ ' ' seleziono pagina da aprire
+ ' Map.refMainMenuVM.SelPage = nPage
+
+ ' ' inizializzo thread di aggiornamento e comunicazione con DB
+ ' ' creo thread gestione macchina
+ ' m_SupervisorCommThread = New Thread(Sub()
+ ' SupervisorCommThread.SupervisorCommThreadFunction()
+ ' End Sub)
+ ' m_SupervisorCommThread.SetApartmentState(ApartmentState.STA)
+ ' ' avvio thread di gestione della macchina che avvia la connessione
+ ' m_SupervisorCommThread.Start()
+
+ ' End Sub
+
+ ' Friend Function ProcessCommandLine(ByRef nCommandType As Integer, ByRef nPage As Pages, ByRef nProdId As Integer) As Boolean
+ ' ' Se non ci sono veri parametri su linea di comando, esco (il primo è sempre il nome del programma)
+ ' If Environment.GetCommandLineArgs.Count() <= 1 Then Return False
+ ' ' Recupero primo parametro che dovrebbe essere il tipo di modalita' riga di comando
+ ' Dim sFile As String = Environment.GetCommandLineArgs(1)
+ ' If String.IsNullOrWhiteSpace(sFile) OrElse Not Integer.TryParse(sFile, nCommandType) OrElse nCommandType <= 0 Then Return False
+ ' Select Case nCommandType
+ ' Case 1 ' apri progetto in ottimizzatore
+ ' ' recupero secondo parametro
+ ' Dim sProdId As String = Environment.GetCommandLineArgs(2)
+ ' If Not Integer.TryParse(sProdId, nProdId) OrElse nProdId <= 0 Then Return False
+ ' nPage = Pages.MACHINING
+ ' Return True
+ ' Case 2 ' apri pagina specifica senza progetto specifico
+ ' ' recupero secondo parametro
+ ' Dim sPage As String = Environment.GetCommandLineArgs(2)
+ ' If Not Integer.TryParse(sPage, nPage) OrElse (nPage <> Pages.VIEW AndAlso nPage <> Pages.MACHINING) Then Return False
+ ' Return True
+ ' End Select
+ ' Return False
+ ' End Function
+
+ ' Friend Sub KeyDown(PressedKey As Key)
+ ' ' Con ESC esco dall'azione corrente
+ ' If PressedKey = Key.Escape Then
+ ' ' se in modifica L250
+ ' If Map.refFreeContourManagerVM.bIsActive Then
+ ' ' se in modifica testo angolo di inclinazione
+ ' If Map.refFreeContourManagerVM.bIsModifyingTextAngle Then
+ ' Map.refFreeContourManagerVM.CloseIsModifyingTextAngle(False)
+ ' End If
+ ' ' reset Azione corrente
+ ' Map.refSceneHostVM.MainController.ResetStatus()
+ ' Map.refFreeContourInputVM.ResetInputBox()
+ ' End If
+ ' ' se misura attiva, la disattivo
+ ' If Map.refInstrumentPanelVM.GetDistIsChecked Then
+ ' Map.refInstrumentPanelVM.SetGetDistance_IsChecked(False)
+ ' End If
+ ' ' se Reset Macchina è aperto
+ ' If (nSelTabPage = Pages.VIEW Or nSelTabPage = Pages.MACHINING) AndAlso Map.refCALCPanelVM.ChooseMachine_Visibility = Visibility.Visible Then
+ ' Map.refCALCPanelVM.CloseResetMachine()
+ ' End If
+ ' ' pulisco output
+ ' Map.refMyStatusBarVM.ClearOutputMessage()
+ ' End If
+ ' End Sub
+
+ ' Friend m_ManagingSupervisorStop As Boolean = False
+
+ ' Private Sub SupervisorTimer_Tick()
+ ' If SupervisorCommThread.bViewerOptimizerBlocked And Not m_ManagingSupervisorStop Then
+ ' m_ManagingSupervisorStop = True
+ ' BlockedWnd = New BlockedWndV(Application.Current.MainWindow, New BlockedWndVM)
+ ' BlockedWnd.ShowDialog()
+ ' ElseIf Not SupervisorCommThread.bViewerOptimizerBlocked And m_ManagingSupervisorStop Then
+ ' m_ManagingSupervisorStop = False
+ ' BlockedWnd.Close()
+ ' End If
+ ' End Sub
+
+ '#End Region ' METHODS
+
+ '#Region "COMMANDS"
+
+ '#Region "AboutBoxCommand"
+
+ ' ' Returns a command that manage the MainWindow_Unloaded command
+ ' Public ReadOnly Property AboutBoxCommand() As ICommand
+ ' Get
+ ' If m_cmdAboutBox Is Nothing Then
+ ' m_cmdAboutBox = New Command(AddressOf AboutBox)
+ ' End If
+ ' Return m_cmdAboutBox
+ ' End Get
+ ' End Property
+
+ ' ' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
+ ' Public Sub AboutBox(ByVal param As Object)
+ ' Dim AboutBoxWindow As New AboutBoxV
+ ' AboutBoxWindow.Owner = Application.Current.MainWindow
+ ' AboutBoxWindow.ShowDialog()
+ ' End Sub
+
+ '#End Region ' AboutBoxCommand
+
+ '#Region "CloseApplicationCommand"
+
+ ' ' Returns a command that manage the MainWindow_Unloaded command
+ ' Public ReadOnly Property CloseApplicationCommand() As ICommand
+ ' Get
+ ' If m_cmdCloseApplication Is Nothing Then
+ ' m_cmdCloseApplication = New Command(AddressOf CloseApplication)
+ ' End If
+ ' Return m_cmdCloseApplication
+ ' End Get
+ ' End Property
+
+ ' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
+ Friend Sub CloseApplication()
+ If (Keyboard.Modifiers And ModifierKeys.Alt) = ModifierKeys.Alt OrElse Keyboard.IsKeyDown(Key.F4) Then
+ Return
+ End If
+ ' Gestisco eventuale file corrente modificato
+ Dim bOk As Boolean = True
+ 'bOk = ProjFileVM.VerifyProjectModification(Map.refProjManagerVM.CurrProj, ProjectType.PROJ)
+ ' se salvataggio annullato, rimango
+ If Not bOk Then Return
+ Dim bAllowClose As Boolean = Map.refSceneHostVM.MainController.ManageModified()
+ ' Salvo impostazione macchina corrente
+ 'Map.refMachinePanelVM.SaveCurrentMachine()
+ ' Se non confermata chiusura, esco
+ If Not bAllowClose Then Return
+ ' salvo modo di visualizzazione
+ WriteMainPrivateProfileString(S_SCENE, K_SHOWMODE, EgtGetShowMode().ToString)
+ ' Termino il Model
+ m_MainWindowM.Close()
+ ' Termino il programma
+ Application.Current.Shutdown()
+ End Sub
+
+ '#End Region ' CloseApplicationCommand
+
+ '#End Region ' COMMANDS
+
+End Class
diff --git a/3dPrintApp/My Project/AssemblyInfo.vb b/3dPrintApp/My Project/AssemblyInfo.vb
new file mode 100644
index 0000000..f61215d
--- /dev/null
+++ b/3dPrintApp/My Project/AssemblyInfo.vb
@@ -0,0 +1,59 @@
+Imports System
+Imports System.Globalization
+Imports System.Reflection
+Imports System.Resources
+Imports System.Runtime.InteropServices
+Imports System.Windows
+
+' General Information about an assembly is controlled through the following
+' set of attributes. Change these attribute values to modify the information
+' associated with an assembly.
+
+' Review the values of the assembly attributes
+
+
+
+
+
+
+
+
+
+'In order to begin building localizable applications, set
+'CultureYouAreCodingWith in your .vbproj file
+'inside a . For example, if you are using US english
+'in your source files, set the to "en-US". Then uncomment the
+'NeutralResourceLanguage attribute below. Update the "en-US" in the line
+'below to match the UICulture setting in the project file.
+
+'
+
+
+'The ThemeInfo attribute describes where any theme specific and generic resource dictionaries can be found.
+'1st parameter: where theme specific resource dictionaries are located
+'(used if a resource is not found in the page,
+' or application resource dictionaries)
+
+'2nd parameter: where the generic resource dictionary is located
+'(used if a resource is not found in the page,
+'app, and any theme specific resource dictionaries)
+
+
+
+
+'The following GUID is for the ID of the typelib if this project is exposed to COM
+
+
+' Version information for an assembly consists of the following four values:
+'
+' Major Version
+' Minor Version
+' Build Number
+' Revision
+'
+' You can specify all the values or you can default the Build and Revision Numbers
+' by using the '*' as shown below:
+'
+
+
+
diff --git a/3dPrintApp/My Project/MyExtensions/MyWpfExtension.vb b/3dPrintApp/My Project/MyExtensions/MyWpfExtension.vb
new file mode 100644
index 0000000..22f84b7
--- /dev/null
+++ b/3dPrintApp/My Project/MyExtensions/MyWpfExtension.vb
@@ -0,0 +1,121 @@
+#If _MyType <> "Empty" Then
+
+Namespace My
+ '''
+ ''' Module used to define the properties that are available in the My Namespace for WPF
+ '''
+ '''
+ _
+ Module MyWpfExtension
+ Private s_Computer As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Devices.Computer)
+ Private s_User As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.ApplicationServices.User)
+ Private s_Windows As New ThreadSafeObjectProvider(Of MyWindows)
+ Private s_Log As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Logging.Log)
+ '''
+ ''' Returns the application object for the running application
+ '''
+ _
+ Friend ReadOnly Property Application() As Application
+ Get
+ Return CType(Global.System.Windows.Application.Current, Application)
+ End Get
+ End Property
+ '''
+ ''' Returns information about the host computer.
+ '''
+ _
+ Friend ReadOnly Property Computer() As Global.Microsoft.VisualBasic.Devices.Computer
+ Get
+ Return s_Computer.GetInstance()
+ End Get
+ End Property
+ '''
+ ''' Returns information for the current user. If you wish to run the application with the current
+ ''' Windows user credentials, call My.User.InitializeWithWindowsUser().
+ '''
+ _
+ Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.User
+ Get
+ Return s_User.GetInstance()
+ End Get
+ End Property
+ '''
+ ''' Returns the application log. The listeners can be configured by the application's configuration file.
+ '''
+ _
+ Friend ReadOnly Property Log() As Global.Microsoft.VisualBasic.Logging.Log
+ Get
+ Return s_Log.GetInstance()
+ End Get
+ End Property
+
+ '''
+ ''' Returns the collection of Windows defined in the project.
+ '''
+ _
+ Friend ReadOnly Property Windows() As MyWindows
+ _
+ Get
+ Return s_Windows.GetInstance()
+ End Get
+ End Property
+ _
+ _
+ Friend NotInheritable Class MyWindows
+ _
+ Private Shared Function Create__Instance__(Of T As {New, Global.System.Windows.Window})(ByVal Instance As T) As T
+ If Instance Is Nothing Then
+ If s_WindowBeingCreated IsNot Nothing Then
+ If s_WindowBeingCreated.ContainsKey(GetType(T)) = True Then
+ Throw New Global.System.InvalidOperationException("The window cannot be accessed via My.Windows from the Window constructor.")
+ End If
+ Else
+ s_WindowBeingCreated = New Global.System.Collections.Hashtable()
+ End If
+ s_WindowBeingCreated.Add(GetType(T), Nothing)
+ Return New T()
+ s_WindowBeingCreated.Remove(GetType(T))
+ Else
+ Return Instance
+ End If
+ End Function
+ _
+ _
+ Private Sub Dispose__Instance__(Of T As Global.System.Windows.Window)(ByRef instance As T)
+ instance = Nothing
+ End Sub
+ _
+ _
+ Public Sub New()
+ MyBase.New()
+ End Sub
+ Private Shared s_WindowBeingCreated As Global.System.Collections.Hashtable
+ Public Overrides Function Equals(ByVal o As Object) As Boolean
+ Return MyBase.Equals(o)
+ End Function
+ Public Overrides Function GetHashCode() As Integer
+ Return MyBase.GetHashCode
+ End Function
+ _
+ _
+ Friend Overloads Function [GetType]() As Global.System.Type
+ Return GetType(MyWindows)
+ End Function
+ Public Overrides Function ToString() As String
+ Return MyBase.ToString
+ End Function
+ End Class
+ End Module
+End Namespace
+Partial Class Application
+ Inherits Global.System.Windows.Application
+ _
+ _
+ Friend ReadOnly Property Info() As Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo
+ _
+ Get
+ Return New Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo(Global.System.Reflection.Assembly.GetExecutingAssembly())
+ End Get
+ End Property
+End Class
+#End If
\ No newline at end of file
diff --git a/3dPrintApp/My Project/Resources.Designer.vb b/3dPrintApp/My Project/Resources.Designer.vb
new file mode 100644
index 0000000..b22e10f
--- /dev/null
+++ b/3dPrintApp/My Project/Resources.Designer.vb
@@ -0,0 +1,62 @@
+'------------------------------------------------------------------------------
+'
+' This code was generated by a tool.
+' Runtime Version:$clrversion$
+'
+' Changes to this file may cause incorrect behavior and will be lost if
+' the code is regenerated.
+'
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+
+Namespace My.Resources
+
+ 'This class was auto-generated by the StronglyTypedResourceBuilder
+ 'class via a tool like ResGen or Visual Studio.
+ 'To add or remove a member, edit your .ResX file then rerun ResGen
+ 'with the /str option, or rebuild your VS project.
+ '''
+ ''' A strongly-typed resource class, for looking up localized strings, etc.
+ '''
+ _
+ Friend Module Resources
+
+ Private resourceMan As Global.System.Resources.ResourceManager
+
+ Private resourceCulture As Global.System.Globalization.CultureInfo
+
+ '''
+ ''' Returns the cached ResourceManager instance used by this class.
+ '''
+ _
+ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
+ Get
+ If Object.ReferenceEquals(resourceMan, Nothing) Then
+ Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("$safeprojectname$.Resources", GetType(Resources).Assembly)
+ resourceMan = temp
+ End If
+ Return resourceMan
+ End Get
+ End Property
+
+ '''
+ ''' Overrides the current thread's CurrentUICulture property for all
+ ''' resource lookups using this strongly typed resource class.
+ '''
+ _
+ Friend Property Culture() As Global.System.Globalization.CultureInfo
+ Get
+ Return resourceCulture
+ End Get
+ Set(ByVal value As Global.System.Globalization.CultureInfo)
+ resourceCulture = value
+ End Set
+ End Property
+ End Module
+End Namespace
diff --git a/3dPrintApp/My Project/Resources.resx b/3dPrintApp/My Project/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/3dPrintApp/My Project/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/3dPrintApp/My Project/Settings.Designer.vb b/3dPrintApp/My Project/Settings.Designer.vb
new file mode 100644
index 0000000..6e8e27f
--- /dev/null
+++ b/3dPrintApp/My Project/Settings.Designer.vb
@@ -0,0 +1,73 @@
+'------------------------------------------------------------------------------
+'
+' This code was generated by a tool.
+' Runtime Version:4.0.30319.42000
+'
+' Changes to this file may cause incorrect behavior and will be lost if
+' the code is regenerated.
+'
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+
+Namespace My
+
+ _
+ Partial Friend NotInheritable Class MySettings
+ Inherits Global.System.Configuration.ApplicationSettingsBase
+
+ Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings)
+
+#Region "My.Settings Auto-Save Functionality"
+#If _MyType = "WindowsForms" Then
+ Private Shared addedHandler As Boolean
+
+ Private Shared addedHandlerLockObject As New Object
+
+ _
+ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
+ If My.Application.SaveMySettingsOnExit Then
+ My.Settings.Save()
+ End If
+ End Sub
+#End If
+#End Region
+
+ Public Shared ReadOnly Property [Default]() As MySettings
+ Get
+
+#If _MyType = "WindowsForms" Then
+ If Not addedHandler Then
+ SyncLock addedHandlerLockObject
+ If Not addedHandler Then
+ AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
+ addedHandler = True
+ End If
+ End SyncLock
+ End If
+#End If
+ Return defaultInstance
+ End Get
+ End Property
+ End Class
+End Namespace
+
+Namespace My
+
+ _
+ Friend Module MySettingsProperty
+
+ _
+ Friend ReadOnly Property Settings() As Global._3dPrintApp.My.MySettings
+ Get
+ Return Global._3dPrintApp.My.MySettings.Default
+ End Get
+ End Property
+ End Module
+End Namespace
diff --git a/3dPrintApp/My Project/Settings.settings b/3dPrintApp/My Project/Settings.settings
new file mode 100644
index 0000000..40ed9fd
--- /dev/null
+++ b/3dPrintApp/My Project/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/3dPrintApp/ProjManager/ProjManagerV.xaml b/3dPrintApp/ProjManager/ProjManagerV.xaml
new file mode 100644
index 0000000..5a85478
--- /dev/null
+++ b/3dPrintApp/ProjManager/ProjManagerV.xaml
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/3dPrintApp/ProjManager/ProjManagerV.xaml.vb b/3dPrintApp/ProjManager/ProjManagerV.xaml.vb
new file mode 100644
index 0000000..74e0c1c
--- /dev/null
+++ b/3dPrintApp/ProjManager/ProjManagerV.xaml.vb
@@ -0,0 +1,3 @@
+Public Class ProjManagerV
+
+End Class
diff --git a/3dPrintApp/ProjManager/ProjManagerVM.vb b/3dPrintApp/ProjManager/ProjManagerVM.vb
new file mode 100644
index 0000000..aceb184
--- /dev/null
+++ b/3dPrintApp/ProjManager/ProjManagerVM.vb
@@ -0,0 +1,438 @@
+Imports System.Collections.ObjectModel
+Imports System.IO
+Imports EgtWPFLib5
+Imports EgtUILib
+
+Public Class ProjManagerVM
+ Inherits VMBase
+
+#Region "FIELDS & PROPERTIES"
+
+ Private m_ProjManager_IsEnabled As Boolean = True
+ Public ReadOnly Property ProjManager_IsEnabled As Boolean
+ Get
+ Return m_ProjManager_IsEnabled
+ End Get
+ End Property
+
+ Private m_MruFiles As New MruList
+ Public ReadOnly Property MruFiles As MruList
+ Get
+ Return m_MruFiles
+ End Get
+ End Property
+ Public ReadOnly Property MruFileNames As ObservableCollection(Of String)
+ Get
+ For Each FileName In m_MruFiles.FileNames.ToList()
+ If Not File.Exists(FileName) Then
+ m_MruFiles.Remove(FileName)
+ End If
+ Next
+ Return m_MruFiles.FileNames
+ End Get
+ End Property
+
+ ' Definizione comandi
+ Private m_cmdNew As ICommand
+ Private m_cmdOpen As ICommand
+ Private m_cmdOpenMruFile As ICommand
+ Private m_cmdSave As ICommand
+ Private m_cmdSaveAs As ICommand
+ Private m_cmdImport As ICommand
+ Private m_cmdOptions As ICommand
+ Private m_cmdSendFeedback As ICommand
+
+
+#Region "ToolTip"
+
+ 'Proprietà ToolTip
+ Public ReadOnly Property NewToolTip As String
+ Get
+ Return EgtMsg(MSG_TOPCOMMANDBAR + 1)
+ End Get
+ End Property
+ Public ReadOnly Property OpenToolTip As String
+ Get
+ Return EgtMsg(MSG_TOPCOMMANDBAR + 2)
+ End Get
+ End Property
+ Public ReadOnly Property SaveToolTip As String
+ Get
+ Return EgtMsg(MSG_TOPCOMMANDBAR + 3)
+ End Get
+ End Property
+ Public ReadOnly Property SaveAsToolTip As String
+ Get
+ Return EgtMsg(MSG_TOPCOMMANDBAR + 4)
+ End Get
+ End Property
+ Public ReadOnly Property InsertToolTip As String
+ Get
+ Return EgtMsg(MSG_TOPCOMMANDBAR + 5)
+ End Get
+ End Property
+ Public ReadOnly Property ImportBTL_ToolTip As String
+ Get
+ Return EgtMsg(61840)
+ End Get
+ End Property
+ Public ReadOnly Property UpdateBTL_ToolTip As String
+ Get
+ Return EgtMsg(61834)
+ End Get
+ End Property
+ Public ReadOnly Property ExportProject_ToolTip As String
+ Get
+ Return EgtMsg(61838)
+ End Get
+ End Property
+ Public ReadOnly Property ImportProject_ToolTip As String
+ Get
+ Return EgtMsg(61839)
+ End Get
+ End Property
+ Public ReadOnly Property GoToProd_ToolTip As String
+ Get
+ Return EgtMsg(61835)
+ End Get
+ End Property
+
+#End Region ' ToolTip
+
+#End Region ' Fields & Properties
+
+#Region "CONSTRUCTOR"
+
+ Sub New()
+ ' Creo riferimento a questa classe in Map
+ Map.SetRefProjManagerVM(Me)
+ ' Impostazioni MruLists
+ m_MruFiles.Init(S_MRUFILES, 8)
+ End Sub
+
+#End Region ' CONSTRUCTOR
+
+#Region "METHODS"
+
+#End Region ' METHODS
+
+#Region "COMMANDS"
+
+#Region "New"
+
+ '''
+ ''' Returns a command that do Save.
+ '''
+ Public ReadOnly Property New_Command As ICommand
+ Get
+ If m_cmdNew Is Nothing Then
+ m_cmdNew = New Command(AddressOf NewProject)
+ End If
+ Return m_cmdNew
+ End Get
+ End Property
+
+ '''
+ ''' Execute the Save. This method is invoked by the SaveCommand.
+ '''
+ Public Sub NewProject()
+ Map.refSceneHostVM.MainController.NewProject(True)
+ NotifyPropertyChanged(NameOf(MruFileNames))
+ End Sub
+
+#End Region ' New
+
+#Region "OpenCommand"
+
+ '''
+ ''' Returns a command that do Open.
+ '''
+ Public ReadOnly Property OpenCommand As ICommand
+ Get
+ If m_cmdOpen Is Nothing Then
+ m_cmdOpen = New Command(AddressOf Open)
+ End If
+ Return m_cmdOpen
+ End Get
+ End Property
+
+ '''
+ ''' Execute the Open. This method is invoked by the OpenCommand.
+ '''
+ Friend Sub Open()
+ OpenProject(Nothing)
+ End Sub
+
+ Friend Sub OpenProject(sFilePath As String)
+ If String.IsNullOrEmpty(sFilePath) Then
+ Dim sDir As String = String.Empty
+ GetMainPrivateProfileString(S_GENERAL, K_LASTNGEDIR, "", sDir)
+ Map.refSceneHostVM.MainController.OpenProject(sDir)
+ Else
+ Map.refSceneHostVM.MainController.OpenProject(sFilePath, False)
+ End If
+ End Sub
+
+#End Region ' OpenCommand
+
+#Region "OpenMruFileCommand"
+
+ '''
+ ''' Returns a command that do Open.
+ '''
+ Public ReadOnly Property OpenMruFileCommand As ICommand
+ Get
+ If m_cmdOpenMruFile Is Nothing Then
+ m_cmdOpenMruFile = New Command(AddressOf OpenMruFile)
+ End If
+ Return m_cmdOpenMruFile
+ End Get
+ End Property
+
+ '''
+ ''' Execute the Open. This method is invoked by the OpenCommand.
+ '''
+ Public Sub OpenMruFile(ByVal param As Object)
+ OpenProject(DirectCast(param, String).Replace("__", "_"))
+ End Sub
+
+#End Region ' OpenMruFileCommand
+
+#Region "SaveCommand"
+
+ '''
+ ''' Returns a command that do Save.
+ '''
+ Public ReadOnly Property SaveCommand As ICommand
+ Get
+ If m_cmdSave Is Nothing Then
+ m_cmdSave = New Command(AddressOf SaveCmd)
+ End If
+ Return m_cmdSave
+ End Get
+ End Property
+
+ Public Sub SaveCmd()
+ Save(True)
+ End Sub
+
+ '''
+ ''' Execute the Save. This method is invoked by the SaveCommand.
+ '''
+ Public Sub Save(Optional bShowLoading As Boolean = False)
+ Map.refSceneHostVM.SaveProject()
+ End Sub
+
+#End Region ' SaveCommand
+
+#Region "SaveAsCommand"
+
+ '''
+ ''' Returns a command that do SaveAs.
+ '''
+ Public ReadOnly Property SaveAsCommand As ICommand
+ Get
+ If m_cmdSaveAs Is Nothing Then
+ m_cmdSaveAs = New Command(AddressOf SaveAs)
+ End If
+ Return m_cmdSaveAs
+ End Get
+ End Property
+
+ '''
+ ''' Execute the SaveAs. This method is invoked by the SaveAsCommand.
+ '''
+ Public Sub SaveAs(ByVal param As Object)
+ Map.refSceneHostVM.SaveAsProject()
+ End Sub
+
+#End Region ' SaveAsCommand
+
+#Region "Import"
+
+ '''
+ ''' Returns a command that do Import.
+ '''
+ Public ReadOnly Property ImportCommand As ICommand
+ Get
+ If m_cmdImport Is Nothing Then
+ m_cmdImport = New Command(AddressOf Import)
+ End If
+ Return m_cmdImport
+ End Get
+ End Property
+
+ '''
+ ''' Execute the Import. This method is invoked by the ImportCommand.
+ '''
+ Public Sub Import(ByVal param As Object)
+ Map.refSceneHostVM.InsertProject()
+ End Sub
+
+#End Region ' Import
+
+#Region "Options"
+
+ '''
+ ''' Returns a command that do Export.
+ '''
+ Public ReadOnly Property OptionsCommand As ICommand
+ Get
+ If m_cmdOptions Is Nothing Then
+ m_cmdOptions = New Command(AddressOf Options)
+ End If
+ Return m_cmdOptions
+ End Get
+ End Property
+
+ '''
+ ''' Execute the Export. This method is invoked by the ExportCommand.
+ '''
+ Public Sub Options(ByVal param As Object)
+ 'Dim OptionsWindow As New OptionWindowV
+ 'OptionsWindow.DataContext = New OptionWindowVM
+ 'OptionsWindow.Owner = Application.Current.MainWindow
+ 'OptionsWindow.ShowDialog()
+ End Sub
+
+#End Region ' Options
+
+#Region "SendFeedback"
+
+ '''
+ ''' Returns a command that do SendFeedback.
+ '''
+ Public ReadOnly Property SendFeedbackCommand As ICommand
+ Get
+ If m_cmdSendFeedback Is Nothing Then
+ m_cmdSendFeedback = New Command(AddressOf SendFeedback)
+ End If
+ Return m_cmdSendFeedback
+ End Get
+ End Property
+
+ '''
+ ''' Execute the SendFeedback. This method is invoked by the SendFeedbackCommand.
+ '''
+ Public Sub SendFeedback(ByVal param As Object)
+ ' Recupero indirizzo a cui spedire la mail
+ Dim sSupportAddress As String = String.Empty
+ GetMainPrivateProfileString(S_GENERAL, K_SUPPORT, "support@egaltech.com", sSupportAddress)
+ ' se vuoto do messaggio di errore ed esco
+ If String.IsNullOrWhiteSpace(sSupportAddress) Then
+ MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 10), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
+ Return
+ End If
+ ' Recupero numero chiave
+ Dim sKey As String = String.Empty
+ EgtGetKeyInfo(sKey)
+ ' Recupero file del progetto corrente
+ Dim sCurrProject As String = String.Empty
+ EgtGetCurrFilePath(sCurrProject)
+ ' se nome file vuoto, chiedo se si vuole salvare
+ If String.IsNullOrWhiteSpace(sCurrProject) Then
+ If MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
+ Map.refSceneHostVM.SaveProject()
+ End If
+ EgtGetCurrFilePath(sCurrProject)
+ ' se modificato, chiedo se si vuole salvare
+ Else
+ If EgtGetModified() Then
+ If MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
+ Map.refSceneHostVM.SaveProject()
+ End If
+ End If
+ End If
+ ' Verifico se il progetto corrente è una porta
+ Dim nPartId As Integer = EgtGetFirstPart()
+ If nPartId = GDB_ID.NULL Then
+ nPartId = EgtGetFirstPartInRawPart(EgtGetFirstRawPart())
+ End If
+ Dim sPartName As String = String.Empty
+ EgtGetName(nPartId, sPartName)
+ Dim bPrjIsDoor As Boolean = (String.Compare(sPartName, "DOOR") = 0)
+ ' Recupero macchine dei gruppi di lavoro del progetto
+ Dim Machines As New List(Of String)
+ Dim nMchGrpId As Integer = EgtGetFirstMachGroup()
+ While nMchGrpId <> GDB_ID.NULL
+ Dim sMachineName As String = String.Empty
+ EgtGetMachGroupMachineName(nMchGrpId, sMachineName)
+ If Not String.IsNullOrWhiteSpace(sMachineName) Then
+ Machines.Add(sMachineName)
+ End If
+ nMchGrpId = EgtGetNextMachGroup(nMchGrpId)
+ End While
+ ' Recupero altri file con lo stesso nome del progetto
+ Dim OtherFiles As New List(Of String)
+ If Not String.IsNullOrWhiteSpace(sCurrProject) Then
+ Dim sCurrProjectDir As String = Path.GetDirectoryName(sCurrProject)
+ If Not String.IsNullOrWhiteSpace(sCurrProjectDir) Then
+ Dim TempFiles() As String = Directory.GetFiles(sCurrProjectDir)
+ For FileIndex = 0 To TempFiles.Count - 1
+ If Path.GetFileNameWithoutExtension(TempFiles(FileIndex)).Contains(Path.GetFileNameWithoutExtension(sCurrProject)) AndAlso TempFiles(FileIndex) <> sCurrProject Then
+ OtherFiles.Add(TempFiles(FileIndex))
+ End If
+ Next
+ End If
+ End If
+ ' Creo zip file da allegare
+ Dim sZipToCreate As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\Feedback.zip"
+ If File.Exists(sZipToCreate) Then
+ File.Delete(sZipToCreate)
+ End If
+ Try
+ Using zip As New Ionic.Zip.ZipFile(sZipToCreate, Console.Out)
+ ' aggiungo file macchine
+ For Each sMachineName As String In Machines
+ Dim sMachineDir As String = Map.refMainWindowVM.MainWindowM.sMachinesRoot & "\" & sMachineName
+ If Directory.Exists(sMachineDir) Then
+ zip.AddItem(sMachineDir, sMachineName)
+ End If
+ Next
+ ' aggiungo progetto corrente
+ If File.Exists(sCurrProject) Then
+ zip.AddItem(sCurrProject, "")
+ End If
+ ' aggiungo file log
+ If File.Exists(Map.refMainWindowVM.MainWindowM.sLogFile) Then
+ zip.AddItem(Map.refMainWindowVM.MainWindowM.sLogFile, "")
+ End If
+ ' aggiungo file ausiliari
+ For Each sOther As String In OtherFiles
+ zip.AddItem(sOther, "")
+ Next
+ ' salvo lo zip
+ zip.Save()
+ End Using
+ Catch ex1 As Exception
+ EgtOutLog("Exception in zip: " & ex1.ToString())
+ End Try
+ ' preparo la mail per il supporto
+ Dim bEx As Boolean = False
+ Try
+ Dim sAddressArray As String() = sSupportAddress.Split(CType(",", Char()))
+ Dim SendFeedbackWindow As New EgtWPFLib5.MapiMailMessage("EgtCAM5 Feedback - " & sKey)
+ SendFeedbackWindow.Recipients.Add(sAddressArray(0))
+ For index As Integer = 1 To sAddressArray.Length() - 1
+ SendFeedbackWindow.Recipients.Add(sAddressArray(index), EgtWPFLib5.MapiMailMessage.RecipientType.CC)
+ Next
+ If Not String.IsNullOrWhiteSpace(sZipToCreate) AndAlso File.Exists(sZipToCreate) Then
+ SendFeedbackWindow.Files.Add(Map.refMainWindowVM.MainWindowM.sTempDir & "\Feedback.zip")
+ End If
+ SendFeedbackWindow.ShowDialog()
+ Catch ex As Exception
+ EgtOutLog("Feedback exception: " & ex.ToString)
+ bEx = True
+ End Try
+ If bEx OrElse EgtWPFLib5.MapiMailMessage.m_ErrorCode <> 0 Then
+ MessageBox.Show(String.Format(EgtMsg(MSG_TOPCOMMANDBAR + 12), sSupportAddress, sZipToCreate), EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK, MessageBoxImage.Information)
+ Else
+ Map.refMyStatusBarVM.SetOutputMessage(EgtMsg(MSG_TOPCOMMANDBAR + 14), 5)
+ End If
+ End Sub
+
+#End Region ' SendFeedback
+
+#End Region ' Commands
+
+End Class
diff --git a/3dPrintApp/Project/ProjectV.xaml b/3dPrintApp/Project/ProjectV.xaml
new file mode 100644
index 0000000..723a05c
--- /dev/null
+++ b/3dPrintApp/Project/ProjectV.xaml
@@ -0,0 +1,185 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/3dPrintApp/Project/ProjectV.xaml.vb b/3dPrintApp/Project/ProjectV.xaml.vb
new file mode 100644
index 0000000..32a2c3b
--- /dev/null
+++ b/3dPrintApp/Project/ProjectV.xaml.vb
@@ -0,0 +1,3 @@
+Public Class ProjectV
+
+End Class
diff --git a/3dPrintApp/Project/ProjectVM.vb b/3dPrintApp/Project/ProjectVM.vb
new file mode 100644
index 0000000..2afdde7
--- /dev/null
+++ b/3dPrintApp/Project/ProjectVM.vb
@@ -0,0 +1,478 @@
+Imports System.Windows.Threading
+Imports EgtWPFLib5
+Imports EgtUILib
+Imports System.Collections.ObjectModel
+Imports System.IO
+
+Public Class ProjectVM
+ Inherits VMBase
+
+#Region "FIELDS & PROPERTIES"
+
+ Private m_MaterialList As New List(Of String)
+ Public ReadOnly Property MaterialList As List(Of String)
+ Get
+ Return m_MaterialList
+ End Get
+ End Property
+
+ Private m_SelMaterial As String
+ Public Property SelMaterial As String
+ Get
+ Return m_SelMaterial
+ End Get
+ Set(value As String)
+ m_SelMaterial = value
+ WriteMainPrivateProfileString(S_PRINTING3D, K_CURRMATERIAL, value)
+ End Set
+ End Property
+
+ Private m_PartList As New ObservableCollection(Of Print3dPartVM)
+ Public ReadOnly Property PartList As ObservableCollection(Of Print3dPartVM)
+ Get
+ Return m_PartList
+ End Get
+ End Property
+
+ Private m_SelPart As Print3dPartVM
+ Public Property SelPart As Print3dPartVM
+ Get
+ Return m_SelPart
+ End Get
+ Set(value As Print3dPartVM)
+ m_SelPart = value
+ ' Eseguo la selezione
+ EgtDeselectAll()
+ EgtSelectPartObjs(m_SelPart.nPartId)
+ EgtDraw()
+ End Set
+ End Property
+
+ Private m_MachiningLib As New List(Of String)
+ Public ReadOnly Property MachiningLib As List(Of String)
+ Get
+ Return m_MachiningLib
+ End Get
+ End Property
+
+ 'Private m_Calc_Timer As New DispatcherTimer
+
+ 'Private Property m_GridDims As New ObservableCollection(Of GridDimension)
+ 'Public Property GridDims As ObservableCollection(Of GridDimension)
+ ' Get
+ ' Return m_GridDims
+ ' End Get
+ ' Set
+ ' m_GridDims = Value
+ ' NotifyPropertyChanged(NameOf(GridDims))
+ ' End Set
+ 'End Property
+
+ 'Private m_BTLStructureVM As BTLStructureVM
+ 'Public Property BTLStructureVM As BTLStructureVM
+ ' Get
+ ' Return m_BTLStructureVM
+ ' End Get
+ ' Set(value As BTLStructureVM)
+ ' m_BTLStructureVM = value
+ ' NotifyPropertyChanged(NameOf(BTLStructureVM))
+ ' End Set
+ 'End Property
+
+ 'Private m_MachGroupPanelVM As MyMachGroupPanelVM
+ 'Public Property MachGroupPanelVM As MyMachGroupPanelVM
+ ' Get
+ ' Return m_MachGroupPanelVM
+ ' End Get
+ ' Set(value As MyMachGroupPanelVM)
+ ' m_MachGroupPanelVM = value
+ ' NotifyPropertyChanged(NameOf(MachGroupPanelVM))
+ ' End Set
+ 'End Property
+
+ 'Private m_bCalcRunning As Boolean = False
+ 'Public ReadOnly Property bCalcRunning As Boolean
+ ' Get
+ ' Return m_bCalcRunning
+ ' End Get
+ 'End Property
+ 'Private m_bLockUX As Boolean = False
+
+ 'Private m_LeftPanel_Visibility As Boolean = True
+ 'Public Property LeftPanel_Visibility As Visibility
+ ' Get
+ ' Return If(m_LeftPanel_Visibility, Visibility.Visible, Visibility.Collapsed)
+ ' End Get
+ ' Set(value As Visibility)
+ ' m_LeftPanel_Visibility = (value = Visibility.Visible)
+ ' End Set
+ 'End Property
+ 'Friend Sub SetLeftPanel_Visibility(IsVisible As Boolean)
+ ' m_LeftPanel_Visibility = IsVisible
+ 'End Sub
+
+ 'Private m_TopPanel_Visibility As Boolean = False
+ 'Public Property TopPanel_Visibility As Visibility
+ ' Get
+ ' Return If(m_TopPanel_Visibility, Visibility.Visible, Visibility.Collapsed)
+ ' End Get
+ ' Set(value As Visibility)
+ ' m_TopPanel_Visibility = (value = Visibility.Visible)
+ ' End Set
+ 'End Property
+ 'Friend Sub SetTopPanel_Visibility(IsVisible As Boolean)
+ ' m_TopPanel_Visibility = IsVisible
+ 'End Sub
+
+ 'Private m_BottomPanel_Visibility As Boolean = True
+ 'Public Property BottomPanel_Visibility As Visibility
+ ' Get
+ ' Return If(m_BottomPanel_Visibility, Visibility.Visible, Visibility.Collapsed)
+ ' End Get
+ ' Set(value As Visibility)
+ ' m_BottomPanel_Visibility = (value = Visibility.Visible)
+ ' End Set
+ 'End Property
+ 'Friend Sub SetBottomPanel_Visibility(IsVisible As Boolean)
+ ' m_BottomPanel_Visibility = IsVisible
+ 'End Sub
+
+ 'Private m_PartManager_Visibility As Boolean = True
+ 'Public ReadOnly Property PartManager_Visibility As Visibility
+ ' Get
+ ' Return If(Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refProjectVM.BTLStructureVM.SelBTLPartsCnt = 1, Visibility.Visible, Visibility.Collapsed)
+ ' End Get
+ 'End Property
+
+ 'Private m_FeatureManager_Visibility As Boolean = True
+ 'Public Property FeatureManager_Visibility As Visibility
+ ' Get
+ ' Return If(m_FeatureManager_Visibility, Visibility.Visible, Visibility.Collapsed)
+ ' End Get
+ ' Set(value As Visibility)
+ ' m_FeatureManager_Visibility = (value = Visibility.Visible)
+ ' End Set
+ 'End Property
+ 'Friend Sub SetFeatureManager_Visibility(IsVisible As Boolean)
+ ' m_FeatureManager_Visibility = IsVisible
+ 'End Sub
+
+ 'Private m_ShowBeamPanel_Visibility As Boolean = True
+ 'Public Property ShowBeamPanel_Visibility As Visibility
+ ' Get
+ ' Return If(m_ShowBeamPanel_Visibility, Visibility.Visible, Visibility.Collapsed)
+ ' End Get
+ ' Set(value As Visibility)
+ ' m_ShowBeamPanel_Visibility = (value = Visibility.Visible)
+ ' End Set
+ 'End Property
+ 'Friend Sub SetShowBeamPanel_Visibility(IsVisible As Boolean)
+ ' m_ShowBeamPanel_Visibility = IsVisible
+ 'End Sub
+
+ 'Private m_ProjManager_Visibility As Boolean = True
+ 'Public Property ProjManager_Visibility As Visibility
+ ' Get
+ ' Return If(m_ProjManager_Visibility, Visibility.Visible, Visibility.Collapsed)
+ ' End Get
+ ' Set(value As Visibility)
+ ' m_ProjManager_Visibility = (value = Visibility.Visible)
+ ' End Set
+ 'End Property
+ 'Friend Sub SetProjManager_Visibility(IsVisible As Boolean)
+ ' m_ProjManager_Visibility = IsVisible
+ 'End Sub
+
+ 'Private m_ProdManager_Visibility As Boolean = True
+ 'Public Property ProdManager_Visibility As Visibility
+ ' Get
+ ' Return If(m_ProdManager_Visibility, Visibility.Visible, Visibility.Collapsed)
+ ' End Get
+ ' Set(value As Visibility)
+ ' m_ProdManager_Visibility = (value = Visibility.Visible)
+ ' End Set
+ 'End Property
+ 'Friend Sub SetProdManager_Visibility(IsVisible As Boolean)
+ ' m_ProdManager_Visibility = IsVisible
+ 'End Sub
+
+ 'Private m_OptimizePanel_Visibility As Boolean = True
+ 'Public Property OptimizePanel_Visibility As Visibility
+ ' Get
+ ' Return If(m_OptimizePanel_Visibility, Visibility.Visible, Visibility.Collapsed)
+ ' End Get
+ ' Set(value As Visibility)
+ ' m_OptimizePanel_Visibility = (value = Visibility.Visible)
+ ' End Set
+ 'End Property
+ 'Friend Sub SetOptimizePanel_Visibility(IsVisible As Boolean)
+ ' m_OptimizePanel_Visibility = IsVisible
+ ' NotifyPropertyChanged(NameOf(OptimizePanel_Visibility))
+ ' Map.refOptimizePanelVM.NotifyPropertyChanged(NameOf(Map.refOptimizePanelVM.CalcRotFlip_Visibility))
+ ' Map.refOptimizePanelVM.NotifyPropertyChanged(NameOf(Map.refOptimizePanelVM.Optimize_Visibility))
+ ' Map.refOptimizePanelVM.NotifyPropertyChanged(NameOf(Map.refOptimizePanelVM.OriginType_Visibility))
+ ' Map.refOptimizePanelVM.NotifyPropertyChanged(NameOf(Map.refOptimizePanelVM.ViewPage_Visibility))
+ ' Map.refOptimizePanelVM.NotifyPropertyChanged(NameOf(Map.refOptimizePanelVM.MachiningPage_Visibility))
+ ' Map.refOptimizePanelVM.NotifyPropertyChanged(NameOf(Map.refOptimizePanelVM.NestingOption_Visibility))
+ 'End Sub
+
+ 'Friend Sub NotifyCalcPanel_Visibility()
+ ' Map.refCALCPanelVM.NotifyPropertyChanged(NameOf(Map.refCALCPanelVM.ViewPage_Visibility))
+ 'End Sub
+
+ 'Private m_FreeContourManager_Visibility As Boolean = False
+ 'Public Property FreeContourManager_Visibility As Visibility
+ ' Get
+ ' Return If(m_FreeContourManager_Visibility, Visibility.Visible, Visibility.Collapsed)
+ ' End Get
+ ' Set(value As Visibility)
+ ' m_FreeContourManager_Visibility = (value = Visibility.Visible)
+ ' End Set
+ 'End Property
+ 'Friend Sub SetFreeContourManager_Visibility(IsVisible As Boolean)
+ ' m_FreeContourManager_Visibility = IsVisible
+ ' NotifyPropertyChanged("FreeContourManager_Visibility")
+ 'End Sub
+
+ 'Friend Sub NotifyAllPanelVisibility()
+ ' NotifyPropertyChanged("LeftPanel_Visibility")
+ ' NotifyPropertyChanged("TopPanel_Visibility")
+ ' NotifyPropertyChanged("BottomPanel_Visibility")
+ ' NotifyPropertyChanged("PartManager_Visibility")
+ ' NotifyPropertyChanged("FeatureManager_Visibility")
+ ' NotifyPropertyChanged("ShowBeamPanel_Visibility")
+ ' NotifyPropertyChanged("ProjManager_Visibility")
+ ' NotifyPropertyChanged("ProdManager_Visibility")
+ ' NotifyCalcPanel_Visibility()
+ 'End Sub
+
+#End Region ' FIELDS & PROPERTIES
+
+#Region "CONSTRUCTOR"
+
+ Sub New()
+ ' Creo riferimento a questa classe in Map
+ Map.SetRefProjectVM(Me)
+ ' imposto timer per aggiornamenti Calc
+ 'm_Calc_Timer.Interval = TimeSpan.FromMilliseconds(500)
+ 'AddHandler m_Calc_Timer.Tick, AddressOf Calc_Timer_Tick
+ '' imposto dimensioni colonne/righe della Grid
+ 'DimensionsIniFile.ReadGridDimensions(ConstDims.PROJECT_VIEW, GridDims)
+ ' carico lista materiali
+ InitMaterialList()
+ ' carico lista parametri di stampa
+ InitMachiningsList()
+ End Sub
+
+#End Region ' CONSTRUCTOR
+
+ '#Region "METHODS"
+
+ Friend Sub AddNewPart(sFile As String)
+ ' rinomino pezzo e layer
+ Dim nPartId As Integer = EgtGetLastPart()
+ EgtSetName(nPartId, "PART")
+ Dim nLayerId As Integer = EgtGetFirstInGroup(nPartId)
+ EgtSetName(nLayerId, "OriginalSolid")
+ ' posiziono il pezzo al centro
+ Dim b3Part As New BBox3d
+ EgtGetBBoxGlob(nPartId, GDB_BB.EXACT, b3Part)
+ Dim dPosX As Double = (CurrentMachine.b3Tab.DimX() / 2) - (b3Part.DimX() / 2)
+ Dim dPosY As Double = (CurrentMachine.b3Tab.DimY() / 2) - (b3Part.DimY() / 2)
+
+ ' Posiziono il pezzo e aggiorno il suo box
+ Dim vtMove As Vector3d = New Point3d(dPosX, dPosY, 0) - b3Part.Min()
+ EgtMove(nPartId, vtMove)
+ b3Part.Move(vtMove)
+
+ ' Creo il frame del pezzo
+ Dim frPart = New Frame3d(b3Part.Center() - 0.5 * b3Part.DimZ() * Vector3d.Z_AX(), Frame3d.TYPE.TOP)
+ Dim nFrameId = EgtCreateGeoFrame(nPartId, frPart, GDB_RT.GLOB)
+ If nFrameId <> GDB_ID.NULL Then
+ EgtSetName(nFrameId, "FramePart")
+ EgtSetMode(nFrameId, GDB_MD.LOCKED)
+ End If
+
+ EgtAddMachGroup("3dPrint")
+ EgtSetTable("Tab")
+
+ Dim nRawId As Integer = EgtAddRawPart(b3Part.Min, b3Part.DimX, b3Part.DimY, b3Part.DimZ, New Color3d(128, 128, 128, 30))
+ EgtAddPartToRawPart(nPartId, b3Part.Min, nRawId)
+ EgtMoveToCornerRawPart(nRawId, New Point3d(dPosX, dPosY, 0), MCH_CR.BL)
+
+ EgtResetCurrMachGroup()
+
+ ' creo lo start point
+ Dim ptStart As Point3d = b3Part.Center() - 0.6 * b3Part.DimY() * Vector3d.Y_AX() - 0.5 * b3Part.DimZ() * Vector3d.Z_AX()
+ Dim nPtStartId As Integer = EgtCreateGeoPoint(nPartId, ptStart, GDB_RT.GLOB)
+ If nPtStartId <> GDB_ID.NULL Then
+ EgtSetName(nPtStartId, "StartPoint")
+ EgtSetColor(nPtStartId, New Color3d(255, 0, 0))
+ End If
+
+ ' aggiungo a lista pezzi e seleziono
+ Dim NewPart As New Print3dPartVM(nPartId, sFile)
+ PartList.Add(NewPart)
+ SelPart = NewPart
+ NotifyPropertyChanged(NameOf(SelPart))
+
+ End Sub
+
+ Friend Sub SelPartFromId(nPartId As Integer)
+ Dim PartToSel As Print3dPartVM = m_PartList.First(Function(x) x.nPartId = nPartId)
+ If Not IsNothing(PartToSel) Then
+ SelPart = PartToSel
+ NotifyPropertyChanged(NameOf(SelPart))
+ End If
+ End Sub
+
+ Friend Sub InitMaterialList()
+ Dim MaterialFiles As String() = Directory.GetFiles(Map.refMainWindowVM.MainWindowM.sMaterialsDir)
+ For Each Material In MaterialFiles
+ If String.Compare(Path.GetExtension(Material), "csv", True) Then
+ MaterialList.Add(Path.GetFileNameWithoutExtension(Material))
+ End If
+ Next
+ Dim sCurrMaterial As String = ""
+ GetMainPrivateProfileString(S_PRINTING3D, K_CURRMATERIAL, "", sCurrMaterial)
+ If MaterialList.Contains(sCurrMaterial) Then
+ m_SelMaterial = sCurrMaterial
+ End If
+ End Sub
+
+ Friend Sub InitMachiningsList()
+ Dim MachiningFiles As String() = Directory.GetFiles(Map.refMainWindowVM.MainWindowM.sMachiningsDir)
+ For Each Machining In MachiningFiles
+ If String.Compare(Path.GetExtension(Machining), "ini", True) Then
+ m_MachiningLib.Add(Path.GetFileNameWithoutExtension(Machining))
+ End If
+ Next
+ End Sub
+
+ ' Friend Sub SetCalcRunning(value As Boolean)
+ ' If value Then m_Calc_Timer.Start()
+ ' m_bCalcRunning = value
+ ' End Sub
+
+ ' Friend Sub ManageIsEnabled(bIsEnabled As Boolean)
+ ' Map.refInstrumentPanelVM.SetInstrumentPanelIsEnabled(bIsEnabled)
+ ' Map.refCALCPanelVM.SetCalcPanelIsEnabled(bIsEnabled)
+ ' Map.refMainMenuVM.SetMainMenuIsEnabled(bIsEnabled)
+ ' Map.refPartManagerVM.SetPartManagerIsEnabled(bIsEnabled)
+ ' Map.refLeftPanelVM.SetLeftPanelIsEnabled(bIsEnabled)
+ ' Map.refProjManagerVM.SetProjManagerIsEnabled(bIsEnabled)
+ ' Map.refProdManagerVM.SetProdManagerIsEnabled(bIsEnabled)
+ ' Map.refTopPanelVM.SetTopPanelIsEnabled(bIsEnabled)
+ ' Map.refOptimizePanelVM.SetOptimizePanelIsEnabled(bIsEnabled)
+ ' Map.refFeatureManagerVM.SetFeatureManagerIsEnabled(bIsEnabled)
+ ' End Sub
+
+ ' 'Private Sub Calc_Timer_Tick()
+ ' ' If m_bCalcRunning <> m_bLockUX Then
+ ' ' ' se calcolo iniziato
+ ' ' If m_bCalcRunning Then
+ ' ' ManageIsEnabled(False)
+ ' ' ' aggiungere gestione colonne editabili delle tabelle
+ ' ' If Not IsNothing(Map.refPartListVM.colPart_Do) Then
+ ' ' Map.refPartListVM.colPart_Do.IsReadOnly = True
+ ' ' End If
+ ' ' If Not IsNothing(Map.refFeatureListVM.colFeature_Do) Then
+ ' ' Map.refFeatureListVM.colFeature_Do.IsReadOnly = True
+ ' ' End If
+ ' ' If Not IsNothing(Map.refPParameterListVM.colPParam_Value) Then
+ ' ' Map.refPParameterListVM.colPParam_Value.IsReadOnly = True
+ ' ' End If
+ ' ' If Not IsNothing(Map.refQParameterListVM.colQParam_Value) Then
+ ' ' Map.refQParameterListVM.colQParam_Value.IsReadOnly = True
+ ' ' End If
+ ' ' If Not IsNothing(Map.refQParameterListVM.colQParam_Custom) Then
+ ' ' Map.refQParameterListVM.colQParam_Custom.IsReadOnly = True
+ ' ' End If
+ ' ' If Not IsNothing(Map.refRawPartListVM.colRawPart_StartCut) Then
+ ' ' Map.refRawPartListVM.colRawPart_StartCut.IsReadOnly = True
+ ' ' End If
+ ' ' If m_BTLStructureVM.nPROJTYPE <> BWType.BEAM AndAlso Not IsNothing(Map.refRawPartListVM.colRawPart_W) Then
+ ' ' Map.refRawPartListVM.colRawPart_W.IsReadOnly = True
+ ' ' End If
+ ' ' If Not IsNothing(Map.refRawPartListVM.colRawPart_L) Then
+ ' ' Map.refRawPartListVM.colRawPart_L.IsReadOnly = True
+ ' ' End If
+ ' ' If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_Offset) Then
+ ' ' Map.refPartInRawPartListVM.colPartInRawPart_Offset.IsReadOnly = True
+ ' ' End If
+ ' ' If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_Rot) Then
+ ' ' Map.refPartInRawPartListVM.colPartInRawPart_Rot.IsReadOnly = True
+ ' ' End If
+ ' ' If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_Flip) Then
+ ' ' Map.refPartInRawPartListVM.colPartInRawPart_Flip.IsReadOnly = True
+ ' ' End If
+ ' ' If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_PosX) Then
+ ' ' Map.refPartInRawPartListVM.colPartInRawPart_PosX.IsReadOnly = True
+ ' ' End If
+ ' ' If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_PosY) Then
+ ' ' Map.refPartInRawPartListVM.colPartInRawPart_PosY.IsReadOnly = True
+ ' ' End If
+ ' ' If Not IsNothing(Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Do) Then
+ ' ' Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Do.IsReadOnly = True
+ ' ' End If
+ ' ' m_bLockUX = True
+ ' ' ' se calcolo finito
+ ' ' Else
+ ' ' ManageIsEnabled(True)
+ ' ' ' aggiungere gestione colonne editabili delle tabelle
+ ' ' If Not IsNothing(Map.refPartListVM.colPart_Do) Then
+ ' ' Map.refPartListVM.colPart_Do.IsReadOnly = False
+ ' ' End If
+ ' ' If Not IsNothing(Map.refFeatureListVM.colFeature_Do) Then
+ ' ' Map.refFeatureListVM.colFeature_Do.IsReadOnly = False
+ ' ' End If
+ ' ' If Not IsNothing(Map.refPParameterListVM.colPParam_Value) Then
+ ' ' Map.refPParameterListVM.colPParam_Value.IsReadOnly = False
+ ' ' End If
+ ' ' If Not IsNothing(Map.refQParameterListVM.colQParam_Value) Then
+ ' ' Map.refQParameterListVM.colQParam_Value.IsReadOnly = False
+ ' ' End If
+ ' ' If Not IsNothing(Map.refQParameterListVM.colQParam_Custom) Then
+ ' ' Map.refQParameterListVM.colQParam_Custom.IsReadOnly = False
+ ' ' End If
+ ' ' If Not IsNothing(Map.refRawPartListVM.colRawPart_StartCut) Then
+ ' ' Map.refRawPartListVM.colRawPart_StartCut.IsReadOnly = False
+ ' ' End If
+ ' ' If Not IsNothing(Map.refRawPartListVM.colRawPart_W) Then
+ ' ' Map.refRawPartListVM.colRawPart_W.IsReadOnly = False
+ ' ' End If
+ ' ' If Not IsNothing(Map.refRawPartListVM.colRawPart_L) Then
+ ' ' Map.refRawPartListVM.colRawPart_L.IsReadOnly = False
+ ' ' End If
+ ' ' If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_Offset) Then
+ ' ' Map.refPartInRawPartListVM.colPartInRawPart_Offset.IsReadOnly = False
+ ' ' End If
+ ' ' If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_Rot) Then
+ ' ' Map.refPartInRawPartListVM.colPartInRawPart_Rot.IsReadOnly = False
+ ' ' End If
+ ' ' If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_Flip) Then
+ ' ' Map.refPartInRawPartListVM.colPartInRawPart_Flip.IsReadOnly = False
+ ' ' End If
+ ' ' If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_PosX) Then
+ ' ' Map.refPartInRawPartListVM.colPartInRawPart_PosX.IsReadOnly = False
+ ' ' End If
+ ' ' If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_PosY) Then
+ ' ' Map.refPartInRawPartListVM.colPartInRawPart_PosY.IsReadOnly = False
+ ' ' End If
+ ' ' If Not IsNothing(Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Do) Then
+ ' ' Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Do.IsReadOnly = False
+ ' ' End If
+ ' ' ' fermo il timer
+ ' ' If Not m_bCalcRunning Then
+ ' ' m_Calc_Timer.Stop()
+ ' ' m_bLockUX = False
+ ' ' End If
+ ' ' End If
+ ' ' End If
+
+ ' 'End Sub
+
+ '#End Region ' METHODS
+
+End Class
+
diff --git a/3dPrintApp/Resources/AboutBoxImage.png b/3dPrintApp/Resources/AboutBoxImage.png
new file mode 100644
index 0000000..a11230b
Binary files /dev/null and b/3dPrintApp/Resources/AboutBoxImage.png differ
diff --git a/3dPrintApp/Resources/CALCPanel/ChooseMachine.png b/3dPrintApp/Resources/CALCPanel/ChooseMachine.png
new file mode 100644
index 0000000..4ec67a8
Binary files /dev/null and b/3dPrintApp/Resources/CALCPanel/ChooseMachine.png differ
diff --git a/3dPrintApp/Resources/CALCPanel/Edit.png b/3dPrintApp/Resources/CALCPanel/Edit.png
new file mode 100644
index 0000000..ac7c56e
Binary files /dev/null and b/3dPrintApp/Resources/CALCPanel/Edit.png differ
diff --git a/3dPrintApp/Resources/CALCPanel/ResetCalc.png b/3dPrintApp/Resources/CALCPanel/ResetCalc.png
new file mode 100644
index 0000000..ad0f349
Binary files /dev/null and b/3dPrintApp/Resources/CALCPanel/ResetCalc.png differ
diff --git a/3dPrintApp/Resources/CALCPanel/Simulate.png b/3dPrintApp/Resources/CALCPanel/Simulate.png
new file mode 100644
index 0000000..9e20532
Binary files /dev/null and b/3dPrintApp/Resources/CALCPanel/Simulate.png differ
diff --git a/3dPrintApp/Resources/CALCPanel/Verify.png b/3dPrintApp/Resources/CALCPanel/Verify.png
new file mode 100644
index 0000000..aa40374
Binary files /dev/null and b/3dPrintApp/Resources/CALCPanel/Verify.png differ
diff --git a/3dPrintApp/Resources/CALCPanel/VerifyAll.png b/3dPrintApp/Resources/CALCPanel/VerifyAll.png
new file mode 100644
index 0000000..886a130
Binary files /dev/null and b/3dPrintApp/Resources/CALCPanel/VerifyAll.png differ
diff --git a/3dPrintApp/Resources/Configuration/MachiningsTable.png b/3dPrintApp/Resources/Configuration/MachiningsTable.png
new file mode 100644
index 0000000..5ab6b0c
Binary files /dev/null and b/3dPrintApp/Resources/Configuration/MachiningsTable.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/AddPointCurve.png b/3dPrintApp/Resources/DrawPanel/AddPointCurve.png
new file mode 100644
index 0000000..5bd7bfb
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/AddPointCurve.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/ApproxCurve.png b/3dPrintApp/Resources/DrawPanel/ApproxCurve.png
new file mode 100644
index 0000000..593f866
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/ApproxCurve.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/Arc3P.png b/3dPrintApp/Resources/DrawPanel/Arc3P.png
new file mode 100644
index 0000000..1df2af4
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/Arc3P.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/ArcCSE.png b/3dPrintApp/Resources/DrawPanel/ArcCSE.png
new file mode 100644
index 0000000..64e2aee
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/ArcCSE.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/ArcFlip.png b/3dPrintApp/Resources/DrawPanel/ArcFlip.png
new file mode 100644
index 0000000..4468ce0
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/ArcFlip.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/ArcPDP.png b/3dPrintApp/Resources/DrawPanel/ArcPDP.png
new file mode 100644
index 0000000..f74b1a5
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/ArcPDP.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/BreakCurve.png b/3dPrintApp/Resources/DrawPanel/BreakCurve.png
new file mode 100644
index 0000000..183d4a2
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/BreakCurve.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/Chamfer.png b/3dPrintApp/Resources/DrawPanel/Chamfer.png
new file mode 100644
index 0000000..a10190d
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/Chamfer.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/ChangeColor.png b/3dPrintApp/Resources/DrawPanel/ChangeColor.png
new file mode 100644
index 0000000..3497b6b
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/ChangeColor.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/ChangeColorAlpha.png b/3dPrintApp/Resources/DrawPanel/ChangeColorAlpha.png
new file mode 100644
index 0000000..04bb076
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/ChangeColorAlpha.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/ChangeLayer.png b/3dPrintApp/Resources/DrawPanel/ChangeLayer.png
new file mode 100644
index 0000000..cb06885
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/ChangeLayer.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/ChangeStart.png b/3dPrintApp/Resources/DrawPanel/ChangeStart.png
new file mode 100644
index 0000000..1321300
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/ChangeStart.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/Circle3P.png b/3dPrintApp/Resources/DrawPanel/Circle3P.png
new file mode 100644
index 0000000..ae4f8bd
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/Circle3P.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/CircleCD.png b/3dPrintApp/Resources/DrawPanel/CircleCD.png
new file mode 100644
index 0000000..5480d8f
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/CircleCD.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/CircleCP.png b/3dPrintApp/Resources/DrawPanel/CircleCP.png
new file mode 100644
index 0000000..77a481b
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/CircleCP.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/Delete.png b/3dPrintApp/Resources/DrawPanel/Delete.png
new file mode 100644
index 0000000..b90063f
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/Delete.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/ExplodeCurve.png b/3dPrintApp/Resources/DrawPanel/ExplodeCurve.png
new file mode 100644
index 0000000..be9e1c7
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/ExplodeCurve.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/ExplodeSurf.png b/3dPrintApp/Resources/DrawPanel/ExplodeSurf.png
new file mode 100644
index 0000000..b62f3e9
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/ExplodeSurf.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/ExtendCurve.png b/3dPrintApp/Resources/DrawPanel/ExtendCurve.png
new file mode 100644
index 0000000..cbf8d91
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/ExtendCurve.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/ExtractFacetLoops.png b/3dPrintApp/Resources/DrawPanel/ExtractFacetLoops.png
new file mode 100644
index 0000000..2fd4591
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/ExtractFacetLoops.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/ExtractLoops.png b/3dPrintApp/Resources/DrawPanel/ExtractLoops.png
new file mode 100644
index 0000000..6c71a4c
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/ExtractLoops.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/ExtractSurfFacet.png b/3dPrintApp/Resources/DrawPanel/ExtractSurfFacet.png
new file mode 100644
index 0000000..7660171
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/ExtractSurfFacet.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/Extrude.png b/3dPrintApp/Resources/DrawPanel/Extrude.png
new file mode 100644
index 0000000..1b245f2
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/Extrude.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/Fillet.png b/3dPrintApp/Resources/DrawPanel/Fillet.png
new file mode 100644
index 0000000..b40c377
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/Fillet.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/IntersectSurfSurf.png b/3dPrintApp/Resources/DrawPanel/IntersectSurfSurf.png
new file mode 100644
index 0000000..1f4c4aa
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/IntersectSurfSurf.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/InvertCurve.png b/3dPrintApp/Resources/DrawPanel/InvertCurve.png
new file mode 100644
index 0000000..e10899d
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/InvertCurve.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/InvertSurf.png b/3dPrintApp/Resources/DrawPanel/InvertSurf.png
new file mode 100644
index 0000000..5b3bf7f
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/InvertSurf.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/JoinCurve.png b/3dPrintApp/Resources/DrawPanel/JoinCurve.png
new file mode 100644
index 0000000..666b2e6
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/JoinCurve.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/Line2P.png b/3dPrintApp/Resources/DrawPanel/Line2P.png
new file mode 100644
index 0000000..2690838
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/Line2P.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/LinePDL.png b/3dPrintApp/Resources/DrawPanel/LinePDL.png
new file mode 100644
index 0000000..043fe98
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/LinePDL.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/LinearDimension.png b/3dPrintApp/Resources/DrawPanel/LinearDimension.png
new file mode 100644
index 0000000..706c9e8
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/LinearDimension.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/MergeSurf.png b/3dPrintApp/Resources/DrawPanel/MergeSurf.png
new file mode 100644
index 0000000..f3f6ed3
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/MergeSurf.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/Mirror.png b/3dPrintApp/Resources/DrawPanel/Mirror.png
new file mode 100644
index 0000000..c8edab7
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/Mirror.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/Mirror3D.png b/3dPrintApp/Resources/DrawPanel/Mirror3D.png
new file mode 100644
index 0000000..a169939
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/Mirror3D.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/ModifyCurve.png b/3dPrintApp/Resources/DrawPanel/ModifyCurve.png
new file mode 100644
index 0000000..f84dfcf
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/ModifyCurve.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/ModifyText.png b/3dPrintApp/Resources/DrawPanel/ModifyText.png
new file mode 100644
index 0000000..ba37037
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/ModifyText.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/Move.png b/3dPrintApp/Resources/DrawPanel/Move.png
new file mode 100644
index 0000000..78ab3a2
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/Move.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/Offset.png b/3dPrintApp/Resources/DrawPanel/Offset.png
new file mode 100644
index 0000000..81c0be2
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/Offset.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/Plane.png b/3dPrintApp/Resources/DrawPanel/Plane.png
new file mode 100644
index 0000000..bb85fcb
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/Plane.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/Point.png b/3dPrintApp/Resources/DrawPanel/Point.png
new file mode 100644
index 0000000..5a43bfe
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/Point.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/Polygon.png b/3dPrintApp/Resources/DrawPanel/Polygon.png
new file mode 100644
index 0000000..fe09e3a
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/Polygon.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/PolygonSide.png b/3dPrintApp/Resources/DrawPanel/PolygonSide.png
new file mode 100644
index 0000000..c90cd4b
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/PolygonSide.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/Rectangle2P.png b/3dPrintApp/Resources/DrawPanel/Rectangle2P.png
new file mode 100644
index 0000000..51bb0a7
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/Rectangle2P.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/RemoveColor.png b/3dPrintApp/Resources/DrawPanel/RemoveColor.png
new file mode 100644
index 0000000..c3b2850
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/RemoveColor.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/RemovePointCurve.png b/3dPrintApp/Resources/DrawPanel/RemovePointCurve.png
new file mode 100644
index 0000000..ee039fe
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/RemovePointCurve.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/Revolve.png b/3dPrintApp/Resources/DrawPanel/Revolve.png
new file mode 100644
index 0000000..821795f
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/Revolve.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/Rotate.png b/3dPrintApp/Resources/DrawPanel/Rotate.png
new file mode 100644
index 0000000..ec86735
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/Rotate.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/Rotate3D.png b/3dPrintApp/Resources/DrawPanel/Rotate3D.png
new file mode 100644
index 0000000..f9d6d3d
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/Rotate3D.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/Ruled.png b/3dPrintApp/Resources/DrawPanel/Ruled.png
new file mode 100644
index 0000000..25aa70c
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/Ruled.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/Scale.png b/3dPrintApp/Resources/DrawPanel/Scale.png
new file mode 100644
index 0000000..ab5f447
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/Scale.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/Scale3D.png b/3dPrintApp/Resources/DrawPanel/Scale3D.png
new file mode 100644
index 0000000..08bf3a1
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/Scale3D.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/Screw.png b/3dPrintApp/Resources/DrawPanel/Screw.png
new file mode 100644
index 0000000..f9d5227
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/Screw.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/SolidAddSurf.png b/3dPrintApp/Resources/DrawPanel/SolidAddSurf.png
new file mode 100644
index 0000000..cd687b1
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/SolidAddSurf.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/SolidIntersectSurf.png b/3dPrintApp/Resources/DrawPanel/SolidIntersectSurf.png
new file mode 100644
index 0000000..b5d1518
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/SolidIntersectSurf.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/SolidSubtractSurf.png b/3dPrintApp/Resources/DrawPanel/SolidSubtractSurf.png
new file mode 100644
index 0000000..0672f49
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/SolidSubtractSurf.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/SplitCurve.png b/3dPrintApp/Resources/DrawPanel/SplitCurve.png
new file mode 100644
index 0000000..25386eb
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/SplitCurve.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/Swept.png b/3dPrintApp/Resources/DrawPanel/Swept.png
new file mode 100644
index 0000000..88f86ee
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/Swept.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/Text.png b/3dPrintApp/Resources/DrawPanel/Text.png
new file mode 100644
index 0000000..c7af3e0
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/Text.png differ
diff --git a/3dPrintApp/Resources/DrawPanel/ThickCurve.png b/3dPrintApp/Resources/DrawPanel/ThickCurve.png
new file mode 100644
index 0000000..03ac50c
Binary files /dev/null and b/3dPrintApp/Resources/DrawPanel/ThickCurve.png differ
diff --git a/3dPrintApp/Resources/EgtBEAMWALL.ico b/3dPrintApp/Resources/EgtBEAMWALL.ico
new file mode 100644
index 0000000..90d6296
Binary files /dev/null and b/3dPrintApp/Resources/EgtBEAMWALL.ico differ
diff --git a/3dPrintApp/Resources/InstrumentPanel/Analyze.png b/3dPrintApp/Resources/InstrumentPanel/Analyze.png
new file mode 100644
index 0000000..e322f1d
Binary files /dev/null and b/3dPrintApp/Resources/InstrumentPanel/Analyze.png differ
diff --git a/3dPrintApp/Resources/InstrumentPanel/ChangeParam.png b/3dPrintApp/Resources/InstrumentPanel/ChangeParam.png
new file mode 100644
index 0000000..d8c892a
Binary files /dev/null and b/3dPrintApp/Resources/InstrumentPanel/ChangeParam.png differ
diff --git a/3dPrintApp/Resources/InstrumentPanel/GetDist.png b/3dPrintApp/Resources/InstrumentPanel/GetDist.png
new file mode 100644
index 0000000..520e406
Binary files /dev/null and b/3dPrintApp/Resources/InstrumentPanel/GetDist.png differ
diff --git a/3dPrintApp/Resources/InstrumentPanel/Statistics.png b/3dPrintApp/Resources/InstrumentPanel/Statistics.png
new file mode 100644
index 0000000..7b449f4
Binary files /dev/null and b/3dPrintApp/Resources/InstrumentPanel/Statistics.png differ
diff --git a/3dPrintApp/Resources/LeftPanel/AddFeature.png b/3dPrintApp/Resources/LeftPanel/AddFeature.png
new file mode 100644
index 0000000..c32126a
Binary files /dev/null and b/3dPrintApp/Resources/LeftPanel/AddFeature.png differ
diff --git a/3dPrintApp/Resources/LeftPanel/AddPart.png b/3dPrintApp/Resources/LeftPanel/AddPart.png
new file mode 100644
index 0000000..1668e53
Binary files /dev/null and b/3dPrintApp/Resources/LeftPanel/AddPart.png differ
diff --git a/3dPrintApp/Resources/LeftPanel/AddToRawPart.png b/3dPrintApp/Resources/LeftPanel/AddToRawPart.png
new file mode 100644
index 0000000..f45b5b1
Binary files /dev/null and b/3dPrintApp/Resources/LeftPanel/AddToRawPart.png differ
diff --git a/3dPrintApp/Resources/LeftPanel/CopyFeature.png b/3dPrintApp/Resources/LeftPanel/CopyFeature.png
new file mode 100644
index 0000000..1c75bbf
Binary files /dev/null and b/3dPrintApp/Resources/LeftPanel/CopyFeature.png differ
diff --git a/3dPrintApp/Resources/LeftPanel/CopyPart.png b/3dPrintApp/Resources/LeftPanel/CopyPart.png
new file mode 100644
index 0000000..4134ad8
Binary files /dev/null and b/3dPrintApp/Resources/LeftPanel/CopyPart.png differ
diff --git a/3dPrintApp/Resources/LeftPanel/MacroFeature.png b/3dPrintApp/Resources/LeftPanel/MacroFeature.png
new file mode 100644
index 0000000..27354f1
Binary files /dev/null and b/3dPrintApp/Resources/LeftPanel/MacroFeature.png differ
diff --git a/3dPrintApp/Resources/LeftPanel/NewRawPart.png b/3dPrintApp/Resources/LeftPanel/NewRawPart.png
new file mode 100644
index 0000000..b7cb987
Binary files /dev/null and b/3dPrintApp/Resources/LeftPanel/NewRawPart.png differ
diff --git a/3dPrintApp/Resources/LeftPanel/RemoveFeature.png b/3dPrintApp/Resources/LeftPanel/RemoveFeature.png
new file mode 100644
index 0000000..4d2f756
Binary files /dev/null and b/3dPrintApp/Resources/LeftPanel/RemoveFeature.png differ
diff --git a/3dPrintApp/Resources/LeftPanel/RemovePart.png b/3dPrintApp/Resources/LeftPanel/RemovePart.png
new file mode 100644
index 0000000..3f9973d
Binary files /dev/null and b/3dPrintApp/Resources/LeftPanel/RemovePart.png differ
diff --git a/3dPrintApp/Resources/MainMenu/Send.png b/3dPrintApp/Resources/MainMenu/Send.png
new file mode 100644
index 0000000..a9bcbe4
Binary files /dev/null and b/3dPrintApp/Resources/MainMenu/Send.png differ
diff --git a/3dPrintApp/Resources/MovePartInRawPart/MoveLeftParts.png b/3dPrintApp/Resources/MovePartInRawPart/MoveLeftParts.png
new file mode 100644
index 0000000..25b6de3
Binary files /dev/null and b/3dPrintApp/Resources/MovePartInRawPart/MoveLeftParts.png differ
diff --git a/3dPrintApp/Resources/MovePartInRawPart/MoveRightParts.png b/3dPrintApp/Resources/MovePartInRawPart/MoveRightParts.png
new file mode 100644
index 0000000..551c31f
Binary files /dev/null and b/3dPrintApp/Resources/MovePartInRawPart/MoveRightParts.png differ
diff --git a/3dPrintApp/Resources/OptimizePanel/FlipRot.png b/3dPrintApp/Resources/OptimizePanel/FlipRot.png
new file mode 100644
index 0000000..1feba5c
Binary files /dev/null and b/3dPrintApp/Resources/OptimizePanel/FlipRot.png differ
diff --git a/3dPrintApp/Resources/OptimizePanel/UnlockFlip.png b/3dPrintApp/Resources/OptimizePanel/UnlockFlip.png
new file mode 100644
index 0000000..77be85a
Binary files /dev/null and b/3dPrintApp/Resources/OptimizePanel/UnlockFlip.png differ
diff --git a/3dPrintApp/Resources/OptimizePanel/UnlockRotation.png b/3dPrintApp/Resources/OptimizePanel/UnlockRotation.png
new file mode 100644
index 0000000..ef225a8
Binary files /dev/null and b/3dPrintApp/Resources/OptimizePanel/UnlockRotation.png differ
diff --git a/3dPrintApp/Resources/OptimizePanel/Warehouse.png b/3dPrintApp/Resources/OptimizePanel/Warehouse.png
new file mode 100644
index 0000000..024e2a6
Binary files /dev/null and b/3dPrintApp/Resources/OptimizePanel/Warehouse.png differ
diff --git a/3dPrintApp/Resources/PartManager/LeftInvert.png b/3dPrintApp/Resources/PartManager/LeftInvert.png
new file mode 100644
index 0000000..25b6de3
Binary files /dev/null and b/3dPrintApp/Resources/PartManager/LeftInvert.png differ
diff --git a/3dPrintApp/Resources/PartManager/LeftRotate.png b/3dPrintApp/Resources/PartManager/LeftRotate.png
new file mode 100644
index 0000000..2df81e1
Binary files /dev/null and b/3dPrintApp/Resources/PartManager/LeftRotate.png differ
diff --git a/3dPrintApp/Resources/PartManager/Locked.old.png b/3dPrintApp/Resources/PartManager/Locked.old.png
new file mode 100644
index 0000000..273cb2e
Binary files /dev/null and b/3dPrintApp/Resources/PartManager/Locked.old.png differ
diff --git a/3dPrintApp/Resources/PartManager/Locked.png b/3dPrintApp/Resources/PartManager/Locked.png
new file mode 100644
index 0000000..93b1273
Binary files /dev/null and b/3dPrintApp/Resources/PartManager/Locked.png differ
diff --git a/3dPrintApp/Resources/PartManager/RightInvert.png b/3dPrintApp/Resources/PartManager/RightInvert.png
new file mode 100644
index 0000000..f2d8c5c
Binary files /dev/null and b/3dPrintApp/Resources/PartManager/RightInvert.png differ
diff --git a/3dPrintApp/Resources/PartManager/RightRotate.png b/3dPrintApp/Resources/PartManager/RightRotate.png
new file mode 100644
index 0000000..2eb4182
Binary files /dev/null and b/3dPrintApp/Resources/PartManager/RightRotate.png differ
diff --git a/3dPrintApp/Resources/PartManager/Unlocked.old.png b/3dPrintApp/Resources/PartManager/Unlocked.old.png
new file mode 100644
index 0000000..9266567
Binary files /dev/null and b/3dPrintApp/Resources/PartManager/Unlocked.old.png differ
diff --git a/3dPrintApp/Resources/PartManager/Unlocked.png b/3dPrintApp/Resources/PartManager/Unlocked.png
new file mode 100644
index 0000000..f0500eb
Binary files /dev/null and b/3dPrintApp/Resources/PartManager/Unlocked.png differ
diff --git a/3dPrintApp/Resources/ProjectManager/ExportProject.png b/3dPrintApp/Resources/ProjectManager/ExportProject.png
new file mode 100644
index 0000000..1c8d93a
Binary files /dev/null and b/3dPrintApp/Resources/ProjectManager/ExportProject.png differ
diff --git a/3dPrintApp/Resources/ProjectManager/GoToProd.png b/3dPrintApp/Resources/ProjectManager/GoToProd.png
new file mode 100644
index 0000000..ca0eb96
Binary files /dev/null and b/3dPrintApp/Resources/ProjectManager/GoToProd.png differ
diff --git a/3dPrintApp/Resources/ProjectManager/GoToProj.png b/3dPrintApp/Resources/ProjectManager/GoToProj.png
new file mode 100644
index 0000000..8eb9666
Binary files /dev/null and b/3dPrintApp/Resources/ProjectManager/GoToProj.png differ
diff --git a/3dPrintApp/Resources/ProjectManager/Import.png b/3dPrintApp/Resources/ProjectManager/Import.png
new file mode 100644
index 0000000..1e19eab
Binary files /dev/null and b/3dPrintApp/Resources/ProjectManager/Import.png differ
diff --git a/3dPrintApp/Resources/ProjectManager/ImportBTL.png b/3dPrintApp/Resources/ProjectManager/ImportBTL.png
new file mode 100644
index 0000000..7be9497
Binary files /dev/null and b/3dPrintApp/Resources/ProjectManager/ImportBTL.png differ
diff --git a/3dPrintApp/Resources/ProjectManager/ImportProject.png b/3dPrintApp/Resources/ProjectManager/ImportProject.png
new file mode 100644
index 0000000..2c32c08
Binary files /dev/null and b/3dPrintApp/Resources/ProjectManager/ImportProject.png differ
diff --git a/3dPrintApp/Resources/ProjectManager/New.png b/3dPrintApp/Resources/ProjectManager/New.png
new file mode 100644
index 0000000..78a5a0b
Binary files /dev/null and b/3dPrintApp/Resources/ProjectManager/New.png differ
diff --git a/3dPrintApp/Resources/ProjectManager/Open.png b/3dPrintApp/Resources/ProjectManager/Open.png
new file mode 100644
index 0000000..616c02b
Binary files /dev/null and b/3dPrintApp/Resources/ProjectManager/Open.png differ
diff --git a/3dPrintApp/Resources/ProjectManager/Options.png b/3dPrintApp/Resources/ProjectManager/Options.png
new file mode 100644
index 0000000..6fb84bb
Binary files /dev/null and b/3dPrintApp/Resources/ProjectManager/Options.png differ
diff --git a/3dPrintApp/Resources/ProjectManager/Save.png b/3dPrintApp/Resources/ProjectManager/Save.png
new file mode 100644
index 0000000..0eca260
Binary files /dev/null and b/3dPrintApp/Resources/ProjectManager/Save.png differ
diff --git a/3dPrintApp/Resources/ProjectManager/SaveAs.png b/3dPrintApp/Resources/ProjectManager/SaveAs.png
new file mode 100644
index 0000000..1d5cfae
Binary files /dev/null and b/3dPrintApp/Resources/ProjectManager/SaveAs.png differ
diff --git a/3dPrintApp/Resources/ProjectManager/Send.png b/3dPrintApp/Resources/ProjectManager/Send.png
new file mode 100644
index 0000000..a9bcbe4
Binary files /dev/null and b/3dPrintApp/Resources/ProjectManager/Send.png differ
diff --git a/3dPrintApp/Resources/ProjectManager/UpdateBTL.png b/3dPrintApp/Resources/ProjectManager/UpdateBTL.png
new file mode 100644
index 0000000..18fa216
Binary files /dev/null and b/3dPrintApp/Resources/ProjectManager/UpdateBTL.png differ
diff --git a/3dPrintApp/Resources/ShowBeamPanel/ShowAll.png b/3dPrintApp/Resources/ShowBeamPanel/ShowAll.png
new file mode 100644
index 0000000..37a0de8
Binary files /dev/null and b/3dPrintApp/Resources/ShowBeamPanel/ShowAll.png differ
diff --git a/3dPrintApp/Resources/ShowBeamPanel/ShowBuilding.png b/3dPrintApp/Resources/ShowBeamPanel/ShowBuilding.png
new file mode 100644
index 0000000..419a955
Binary files /dev/null and b/3dPrintApp/Resources/ShowBeamPanel/ShowBuilding.png differ
diff --git a/3dPrintApp/Resources/ShowBeamPanel/ShowSolid.png b/3dPrintApp/Resources/ShowBeamPanel/ShowSolid.png
new file mode 100644
index 0000000..383a95e
Binary files /dev/null and b/3dPrintApp/Resources/ShowBeamPanel/ShowSolid.png differ
diff --git a/3dPrintApp/Resources/ShowPanel/CurveDir.png b/3dPrintApp/Resources/ShowPanel/CurveDir.png
new file mode 100644
index 0000000..f7e12b5
Binary files /dev/null and b/3dPrintApp/Resources/ShowPanel/CurveDir.png differ
diff --git a/3dPrintApp/Resources/ShowPanel/RenderingHL.png b/3dPrintApp/Resources/ShowPanel/RenderingHL.png
new file mode 100644
index 0000000..8aa5a3a
Binary files /dev/null and b/3dPrintApp/Resources/ShowPanel/RenderingHL.png differ
diff --git a/3dPrintApp/Resources/ShowPanel/RenderingSH.png b/3dPrintApp/Resources/ShowPanel/RenderingSH.png
new file mode 100644
index 0000000..0c6690d
Binary files /dev/null and b/3dPrintApp/Resources/ShowPanel/RenderingSH.png differ
diff --git a/3dPrintApp/Resources/ShowPanel/RenderingWF.png b/3dPrintApp/Resources/ShowPanel/RenderingWF.png
new file mode 100644
index 0000000..1f2de62
Binary files /dev/null and b/3dPrintApp/Resources/ShowPanel/RenderingWF.png differ
diff --git a/3dPrintApp/Resources/Statistics/CopyToClipboard.png b/3dPrintApp/Resources/Statistics/CopyToClipboard.png
new file mode 100644
index 0000000..e41378a
Binary files /dev/null and b/3dPrintApp/Resources/Statistics/CopyToClipboard.png differ
diff --git a/3dPrintApp/Resources/Statistics/PrintPDF.png b/3dPrintApp/Resources/Statistics/PrintPDF.png
new file mode 100644
index 0000000..1a973e8
Binary files /dev/null and b/3dPrintApp/Resources/Statistics/PrintPDF.png differ
diff --git a/3dPrintApp/Resources/TopPanel/CopyRawPart.png b/3dPrintApp/Resources/TopPanel/CopyRawPart.png
new file mode 100644
index 0000000..bbe681b
Binary files /dev/null and b/3dPrintApp/Resources/TopPanel/CopyRawPart.png differ
diff --git a/3dPrintApp/Resources/TopPanel/MoveDownPart.png b/3dPrintApp/Resources/TopPanel/MoveDownPart.png
new file mode 100644
index 0000000..25b6de3
Binary files /dev/null and b/3dPrintApp/Resources/TopPanel/MoveDownPart.png differ
diff --git a/3dPrintApp/Resources/TopPanel/MovePartInRawPart.png b/3dPrintApp/Resources/TopPanel/MovePartInRawPart.png
new file mode 100644
index 0000000..c4dcd5a
Binary files /dev/null and b/3dPrintApp/Resources/TopPanel/MovePartInRawPart.png differ
diff --git a/3dPrintApp/Resources/TopPanel/MoveUpPart.png b/3dPrintApp/Resources/TopPanel/MoveUpPart.png
new file mode 100644
index 0000000..551c31f
Binary files /dev/null and b/3dPrintApp/Resources/TopPanel/MoveUpPart.png differ
diff --git a/3dPrintApp/Resources/TopPanel/ProduceAllRawPart.png b/3dPrintApp/Resources/TopPanel/ProduceAllRawPart.png
new file mode 100644
index 0000000..8b79c88
Binary files /dev/null and b/3dPrintApp/Resources/TopPanel/ProduceAllRawPart.png differ
diff --git a/3dPrintApp/Resources/TopPanel/ProduceRawPart.png b/3dPrintApp/Resources/TopPanel/ProduceRawPart.png
new file mode 100644
index 0000000..4963035
Binary files /dev/null and b/3dPrintApp/Resources/TopPanel/ProduceRawPart.png differ
diff --git a/3dPrintApp/Resources/TopPanel/RemovePart.old.png b/3dPrintApp/Resources/TopPanel/RemovePart.old.png
new file mode 100644
index 0000000..aa4257e
Binary files /dev/null and b/3dPrintApp/Resources/TopPanel/RemovePart.old.png differ
diff --git a/3dPrintApp/Resources/TopPanel/RemovePart.png b/3dPrintApp/Resources/TopPanel/RemovePart.png
new file mode 100644
index 0000000..dedca01
Binary files /dev/null and b/3dPrintApp/Resources/TopPanel/RemovePart.png differ
diff --git a/3dPrintApp/Resources/TopPanel/RemoveRawPart.png b/3dPrintApp/Resources/TopPanel/RemoveRawPart.png
new file mode 100644
index 0000000..cb298d1
Binary files /dev/null and b/3dPrintApp/Resources/TopPanel/RemoveRawPart.png differ
diff --git a/3dPrintApp/Resources/TopPanel/ReorderPart.png b/3dPrintApp/Resources/TopPanel/ReorderPart.png
new file mode 100644
index 0000000..9c7ffef
Binary files /dev/null and b/3dPrintApp/Resources/TopPanel/ReorderPart.png differ
diff --git a/3dPrintApp/Resources/TreeView/Folder.png b/3dPrintApp/Resources/TreeView/Folder.png
new file mode 100644
index 0000000..2c1339d
Binary files /dev/null and b/3dPrintApp/Resources/TreeView/Folder.png differ
diff --git a/3dPrintApp/Resources/ViewPanel/LookFromBACK.png b/3dPrintApp/Resources/ViewPanel/LookFromBACK.png
new file mode 100644
index 0000000..0c2790c
Binary files /dev/null and b/3dPrintApp/Resources/ViewPanel/LookFromBACK.png differ
diff --git a/3dPrintApp/Resources/ViewPanel/LookFromBOTTOM.png b/3dPrintApp/Resources/ViewPanel/LookFromBOTTOM.png
new file mode 100644
index 0000000..6a48b64
Binary files /dev/null and b/3dPrintApp/Resources/ViewPanel/LookFromBOTTOM.png differ
diff --git a/3dPrintApp/Resources/ViewPanel/LookFromFRONT.png b/3dPrintApp/Resources/ViewPanel/LookFromFRONT.png
new file mode 100644
index 0000000..08abc99
Binary files /dev/null and b/3dPrintApp/Resources/ViewPanel/LookFromFRONT.png differ
diff --git a/3dPrintApp/Resources/ViewPanel/LookFromISO_NE.png b/3dPrintApp/Resources/ViewPanel/LookFromISO_NE.png
new file mode 100644
index 0000000..e0c71ba
Binary files /dev/null and b/3dPrintApp/Resources/ViewPanel/LookFromISO_NE.png differ
diff --git a/3dPrintApp/Resources/ViewPanel/LookFromISO_NW.png b/3dPrintApp/Resources/ViewPanel/LookFromISO_NW.png
new file mode 100644
index 0000000..203e290
Binary files /dev/null and b/3dPrintApp/Resources/ViewPanel/LookFromISO_NW.png differ
diff --git a/3dPrintApp/Resources/ViewPanel/LookFromISO_SE.png b/3dPrintApp/Resources/ViewPanel/LookFromISO_SE.png
new file mode 100644
index 0000000..2891088
Binary files /dev/null and b/3dPrintApp/Resources/ViewPanel/LookFromISO_SE.png differ
diff --git a/3dPrintApp/Resources/ViewPanel/LookFromISO_SW.png b/3dPrintApp/Resources/ViewPanel/LookFromISO_SW.png
new file mode 100644
index 0000000..909e25e
Binary files /dev/null and b/3dPrintApp/Resources/ViewPanel/LookFromISO_SW.png differ
diff --git a/3dPrintApp/Resources/ViewPanel/LookFromLEFT.png b/3dPrintApp/Resources/ViewPanel/LookFromLEFT.png
new file mode 100644
index 0000000..d4a4e85
Binary files /dev/null and b/3dPrintApp/Resources/ViewPanel/LookFromLEFT.png differ
diff --git a/3dPrintApp/Resources/ViewPanel/LookFromRIGHT.png b/3dPrintApp/Resources/ViewPanel/LookFromRIGHT.png
new file mode 100644
index 0000000..f182c1a
Binary files /dev/null and b/3dPrintApp/Resources/ViewPanel/LookFromRIGHT.png differ
diff --git a/3dPrintApp/Resources/ViewPanel/LookFromTOP.png b/3dPrintApp/Resources/ViewPanel/LookFromTOP.png
new file mode 100644
index 0000000..214358d
Binary files /dev/null and b/3dPrintApp/Resources/ViewPanel/LookFromTOP.png differ
diff --git a/3dPrintApp/Resources/ViewPanel/ZoomAll.png b/3dPrintApp/Resources/ViewPanel/ZoomAll.png
new file mode 100644
index 0000000..e1a27d1
Binary files /dev/null and b/3dPrintApp/Resources/ViewPanel/ZoomAll.png differ
diff --git a/3dPrintApp/Resources/ViewPanel/ZoomIn.png b/3dPrintApp/Resources/ViewPanel/ZoomIn.png
new file mode 100644
index 0000000..b370a3e
Binary files /dev/null and b/3dPrintApp/Resources/ViewPanel/ZoomIn.png differ
diff --git a/3dPrintApp/Resources/ViewPanel/ZoomOut.png b/3dPrintApp/Resources/ViewPanel/ZoomOut.png
new file mode 100644
index 0000000..187a1a0
Binary files /dev/null and b/3dPrintApp/Resources/ViewPanel/ZoomOut.png differ
diff --git a/3dPrintApp/SceneHost/MySceneHostVM.vb b/3dPrintApp/SceneHost/MySceneHostVM.vb
new file mode 100644
index 0000000..a1d0d8f
--- /dev/null
+++ b/3dPrintApp/SceneHost/MySceneHostVM.vb
@@ -0,0 +1,717 @@
+Imports System.IO
+Imports EgtUILib
+Imports EgtWPFLib5
+Imports Microsoft.Win32
+
+Public Class MySceneHostVM
+ Inherits EgtWPFLib5.SceneHostVM
+
+ Friend m_bIsFocused As Boolean
+ Friend Sub SetIsFocused(bValue As Boolean)
+ m_bIsFocused = bValue
+ End Sub
+
+ ' Identificativi per pezzo da selezionare/deselezionare
+ Private m_nIdToSel As Integer = GDB_ID.NULL
+ Private m_nIdToDesel As Integer = GDB_ID.NULL
+ ' Dati movimento
+ Private m_dMaxStep As Double = 0
+ ' Dati per Drag
+ Private m_nRestRadius As Integer = 5
+ Private m_bDrag As Boolean = False
+ Private m_bDragToStart As Boolean = False
+ Private m_bVerify As Boolean = False
+ Private m_bFromParking As Boolean = False
+ Private m_bDragging As Boolean = False
+ Private m_locPrev As System.Drawing.Point
+ Private m_ptPrev As Point3d
+ Private m_vtTotMove As Vector3d
+ Private m_dSnapDist As Double = 0
+
+ Private bReducedCut As Boolean = False
+ Private m_bMagnetic As Boolean
+
+ ' punto di snap per inizializzazione
+ Private m_SnapType As SP
+ Friend ReadOnly Property SnapType As SP
+ Get
+ Return m_SnapType
+ End Get
+ End Property
+
+#Region "CONSTRUCTOR"
+
+ Sub New()
+ MyBase.New()
+ AddHandler MainController.OnNewProject, AddressOf OnNewProject
+ AddHandler MainController.OnOpenProject, AddressOf OnOpenProject
+ AddHandler MainController.OnSavingProject, AddressOf OnSavingProject
+ AddHandler MainController.OnSavedProject, AddressOf OnSavedProject
+ AddHandler MainController.OnInsertedProject, AddressOf OnInsertedProject
+ AddHandler MainController.OnImportingProject, AddressOf OnImportingProject
+ AddHandler MainController.OnImportedProject, AddressOf OnImportedProject
+ AddHandler MainController.PrepareInputBox, AddressOf PrepareInputBox
+ AddHandler MainController.SetInputBoxText, AddressOf SetInputBoxText
+ AddHandler MainController.SetInputBoxCheck, AddressOf SetInputBoxCheck
+ AddHandler MainController.AddInputBoxCombo, AddressOf AddInputBoxCombo
+ AddHandler MainController.UpdateUI, AddressOf UpdateUI
+ End Sub
+
+#End Region ' CONSTRUCTOR
+
+#Region "METHODS"
+
+ Overrides Sub InitScene()
+ InitSceneEvents()
+ ' Inizializzazione Scena
+ PreInitializeScene()
+ ' Se tutto bene
+ If MainScene.Init() And Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT._3DPRINT) Then
+ PostInitializeScene()
+ ' Imposto stato gestione mouse diretto della scena a nessuno
+ MainScene.SetStatusNull()
+ EgtSetCurrentContext(MainScene.GetCtx())
+ ' inizializzo gestore lavorazioni
+ EgtInitMachMgr(Map.refMainWindowVM.MainWindowM.sMachinesRoot, Map.refMainWindowVM.MainWindowM.sToolMakersDir)
+ Return
+ End If
+ ' Problemi
+ ' Se manca la chiave
+ If Map.refMainWindowVM.MainWindowM.nKeyLevel = -1 Or Map.refMainWindowVM.MainWindowM.nKeyLevel = -2 Then
+ EgtOutLog("Missing Dongle")
+ ' Box di avviso chiave mancante : "Chiave non presente. \n Inserirla e riavviare il programma." "Errore"
+ Dim sText As String = EgtMsg(MSG_MISSINGKEYWD + 2) & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 3)
+ Dim sTitle As String = EgtMsg(MSG_MISSINGKEYWD + 1)
+ MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error)
+ ' Altrimenti manca la licenza
+ Else
+ EgtOutLog("Problems with Licence")
+ ' Box di avviso licenza con problemi : "Programma senza licenza. \n Caricala e riavvia il programma." "Errore"
+ Dim sText As String = EgtMsg(MSG_MISSINGKEYWD + 5) & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 6)
+ Dim sTitle As String = EgtMsg(MSG_MISSINGKEYWD + 1)
+ If MessageBox.Show(sText, sTitle, MessageBoxButton.OKCancel, MessageBoxImage.Error) = MessageBoxResult.OK Then
+ ' Apro dialogo per richiesta file licenza
+ Dim LicDlg As New Microsoft.Win32.OpenFileDialog() With {
+ .DefaultExt = ".lic",
+ .Filter = "Licences (.lic)|*.lic",
+ .CheckFileExists = True,
+ .ValidateNames = True
+ }
+ If LicDlg.ShowDialog() = True Then
+ ' Recupero il direttorio del file
+ Dim sDir As String = Path.GetDirectoryName(LicDlg.FileName)
+ ' Se il file non è già nel direttorio di configurazione lo copio
+ If Not String.Equals(Path.GetFullPath(sDir), Path.GetFullPath(Map.refMainWindowVM.MainWindowM.sConfigDir), StringComparison.OrdinalIgnoreCase) Then
+ Try
+ File.Copy(LicDlg.FileName, Path.Combine(Map.refMainWindowVM.MainWindowM.sConfigDir, LicDlg.SafeFileName), True)
+ Catch ex As Exception
+ End Try
+ End If
+ ' Imposto il nuovo file di licenza nell'Ini
+ WriteMainPrivateProfileString(S_GENERAL, K_LICENCE, LicDlg.SafeFileName)
+ End If
+ End If
+ End If
+ ' Chiudo il programma
+ End
+ End Sub
+
+ Public Overrides Sub InitSceneEvents()
+ AddHandler MainScene.OnCursorPos, AddressOf OnCursorPos
+ AddHandler MainScene.OnMouseSetObjFilterForSelect, AddressOf OnMouseSetObjFilterForSelect
+ AddHandler MainScene.OnMouseSelectedAll, AddressOf OnMouseSelectedAll
+ AddHandler MainScene.OnMouseDeselectedAll, AddressOf OnMouseDeselectedAll
+ AddHandler MainScene.OnMouseDownScene, AddressOf OnMouseDownScene
+ AddHandler MainScene.OnMouseMoveScene, AddressOf OnMouseMoveScene
+ AddHandler MainScene.OnMouseUpScene, AddressOf OnMouseUpScene
+ AddHandler MainScene.OnMouseSelectedObj, AddressOf OnMouseSelectedObj
+ AddHandler MainScene.OnMouseSelectedPart, AddressOf OnMouseSelectedPart
+ AddHandler MainScene.OnMouseSelectedLayer, AddressOf OnMouseSelectedLayer
+ AddHandler MainScene.OnMouseSelectedPath, AddressOf OnMouseSelectedPath
+ AddHandler MainScene.OnMousePointFromSelection, AddressOf OnMousePointFromSelection
+ AddHandler MainScene.OnMouseDone, AddressOf OnMouseDone
+ AddHandler MainScene.OnMouseSelectedPoint, AddressOf OnMouseSelectedPoint
+ AddHandler MainScene.OnMouseSelectedDir, AddressOf OnMouseSelectedDir
+ AddHandler MainScene.OnMouseMoveSelPoint, AddressOf OnMouseMoveSelPoint
+ AddHandler MainScene.OnShowDistance, AddressOf OnShowDistance
+ AddHandler MainScene.KeyDown, AddressOf OnKeyDown
+ AddHandler MainScene.OnCloseGetDist, AddressOf OnCloseGetDist
+ AddHandler MainScene.OnChangedSnapPointType, AddressOf OnChangedSnapPointType
+ End Sub
+
+ Private Sub PreInitializeScene()
+ ' imposto colore di default
+ Dim DefColor As New Color3d(0, 0, 0)
+ GetMainPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor)
+ MainScene.SetDefaultMaterial(DefColor)
+ ' imposto colori sfondo
+ Dim BackTopColor As New Color3d(192, 192, 192)
+ GetMainPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor)
+ Dim BackBotColor As New Color3d(BackTopColor)
+ GetMainPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor)
+ MainScene.SetViewBackground(BackTopColor, BackBotColor)
+ ' imposto spessore linee
+ Dim nLineWidth As Integer = 1
+ nLineWidth = GetMainPrivateProfileInt(S_SCENE, K_LINEWIDTH, nLineWidth)
+ MainScene.SetLineWidth(nLineWidth)
+ ' imposto colore di evidenziazione
+ Dim MarkColor As New Color3d(255, 255, 0)
+ GetMainPrivateProfileColor(S_SCENE, K_MARK, MarkColor)
+ MainScene.SetMarkMaterial(MarkColor)
+ ' imposto colore per superfici selezionate
+ Dim SelSurfColor As New Color3d(255, 255, 192)
+ GetMainPrivateProfileColor(S_SCENE, K_SELSURF, SelSurfColor)
+ MainScene.SetSelSurfMaterial(SelSurfColor)
+ ' imposto tipo e colore del rettangolo di zoom
+ Dim bOutline As Boolean = True
+ Dim ZwColor As New Color3d(0, 0, 0)
+ GetMainPrivateProfileZoomWin(S_SCENE, K_ZOOMWIN, bOutline, ZwColor)
+ MainScene.SetZoomWinAttribs(bOutline, ZwColor)
+ ' imposto colore della linea di distanza
+ Dim DstLnColor As New Color3d(255, 0, 0)
+ GetMainPrivateProfileColor(S_SCENE, K_DISTLINE, DstLnColor)
+ MainScene.SetDistLineMaterial(DstLnColor)
+ ' imposto parametri OpenGL
+ Dim nDriver As Integer = GetMainPrivateProfileInt(S_OPENGL, K_DRIVER, 3)
+ Dim b2Buff As Boolean = (GetMainPrivateProfileInt(S_OPENGL, K_DOUBLEBUFFER, 1) <> 0)
+ Dim nColorBits As Integer = GetMainPrivateProfileInt(S_OPENGL, K_COLORBITS, 32)
+ Dim nDepthBits As Integer = GetMainPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32)
+ MainScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
+ End Sub
+
+ Private Sub PostInitializeScene()
+ ' Impostazioni Controller
+ MainController.SetScene(MainScene)
+ MainController.SetSurfTmTolerance(0.05)
+ MainController.SetUseCustomColors(True, S_SCENE, K_CUSTOMCOLORS)
+ ' imposto unità di misura per interfaccia utente
+ Dim nMeasureUnit As Integer = GetMainPrivateProfileInt(S_SCENE, K_MMUNITS, 1)
+ EgtSetUiUnits(nMeasureUnit <> 0)
+ 'Map.refMyStatusBarVM.SetMeasureUnit(nMeasureUnit <> 0)
+ ' imposto visualizzazione riferimento globale
+ EgtSetGlobFrameShow(True)
+ ' imposto i dati della griglia
+ 'LoadGridData()
+ EgtSetGridFrame(Frame3d.GLOB)
+ EgtSetGridGeo(10, 10, 100, 484)
+ EgtSetGridColor(New Color3d(160, 160, 160), New Color3d(160, 160, 160))
+ EgtSetGridShow(True, False)
+ ' imposto tipo coordinate
+ MainScene.SetGridCursorPos(True)
+ ' modo di visualizzazione
+ Dim nShowMode As Integer = GetMainPrivateProfileInt(S_SCENE, K_SHOWMODE, SM.SHADING)
+ '''Map.refShowPanelVM.SetShowMode(DirectCast(nShowMode, SM))
+ ' visualizzazione avanzata dei triangoli costituenti le superfici
+ Dim bShowTriaAdv As Boolean = (GetMainPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1) <> 0)
+ EgtSetShowTriaAdv(bShowTriaAdv)
+ ' tipo visualizzazione per Zmap
+ Dim nShowZmap As Integer = GetMainPrivateProfileInt(S_SCENE, K_SHOWZMAP, 1)
+ EgtSetShowZmap(DirectCast(nShowZmap, ZSM), False)
+ ' dimensione lineare max in pixel delle textures
+ Dim nTxrMaxLinPix As Integer = GetMainPrivateProfileInt(S_SCENE, K_TEXMAXLINPIX, 4096)
+ EgtSetTextureMaxLinPixels(nTxrMaxLinPix)
+ ' tipo snap point
+ MainScene.SetSnapPointType(SP.PT_SKETCH)
+ ' visualizzazione assemblato
+ Dim nShowBuilding As Boolean = GetMainPrivateProfileInt(S_SCENE, K_SHOWBUILDING, 0) <> 0
+ '''Map.refShowBeamPanelVM.SetShowBuilding(nShowBuilding)
+ ' nascondo input box
+ '''Map.refFreeContourInputVM.ResetInputBox()
+ End Sub
+
+#End Region ' METHODS
+
+#Region "ProjectManager"
+
+ Public Overrides Sub NewProject()
+ EgtSetCurrentContext(MainScene.GetCtx())
+ Dim bOk As Boolean = MainController.NewProject()
+ MainScene.SetStatusNull()
+ End Sub
+
+ Public Overrides Sub OpenProject(sFilePath As String)
+ EgtSetCurrentContext(MainScene.GetCtx())
+ Dim bOk As Boolean = False
+ If String.IsNullOrEmpty(sFilePath) Then
+ ' Recupero cartella dell'ultimo progetto aperto
+ Dim sDir As String = MainController.GetCurrFile()
+ If String.IsNullOrWhiteSpace(sDir) Then
+ GetMainPrivateProfileString(S_MRUFILES, K_FILE, "", sDir)
+ End If
+ If Not String.IsNullOrWhiteSpace(sDir) Then
+ sDir = Path.GetDirectoryName(sDir)
+ End If
+ bOk = MainController.OpenProject(sDir)
+ Else
+ bOk = MainController.OpenProject(sFilePath, False)
+ End If
+ MainScene.SetStatusNull()
+ End Sub
+
+ Public Overrides Sub SaveProject()
+ MyBase.SaveProject()
+ ' Imposto stato gestione mouse diretto della scena a nessuno
+ MainScene.SetStatusNull()
+ End Sub
+
+ Public Overrides Sub SaveAsProject()
+ MyBase.SaveAsProject()
+ ' Imposto stato gestione mouse diretto della scena a nessuno
+ MainScene.SetStatusNull()
+ End Sub
+
+ Public Overrides Sub InsertProject()
+ ' eseguo
+ Dim sDir As String = String.Empty
+ GetMainPrivateProfileString(S_MRUIMPORT, K_FILE & "1", "", sDir)
+ Dim OpenFileDialog As New OpenFileDialog With {.Title = "Insert",
+ .Filter = "Stereolithography (*.stl)|*.stl" &
+ "|New geometry EgalTech(*.nge)|*.nge" &
+ "|All Files (*.*)|*.*",
+ .FilterIndex = 1,
+ .InitialDirectory = sDir}
+ If Not OpenFileDialog.ShowDialog Then
+ Return
+ End If
+ Dim sFile As String = String.Empty
+ sFile = OpenFileDialog.FileName
+ MainController.InsertProject(sFile, False)
+ End Sub
+
+ Public Overrides Sub ImportProject()
+ Dim sDir As String = String.Empty
+ GetMainPrivateProfileString(S_MRUIMPORT, K_FILE & "1", "", sDir)
+ If Not String.IsNullOrWhiteSpace(sDir) Then
+ sDir = Path.GetDirectoryName(sDir)
+ End If
+ sDir.TrimEnd("\"c)
+ MainController.ImportProject(sDir)
+ ' Imposto stato gestione mouse diretto della scena a nessuno
+ MainScene.SetStatusNull()
+ End Sub
+
+ Friend Sub PreExecScript(bScriptInMru As Boolean)
+ 'm_bScriptInMru = bScriptInMru
+ End Sub
+
+ Friend Sub ExecScript(sFilePath As String)
+ If String.IsNullOrEmpty(sFilePath) Then
+ Dim sDir As String = String.Empty
+ 'GetMainPrivateProfileString(S_GENERAL, K_LASTLUADIR, "", sDir)
+ MainController.Exec(sDir)
+ Else
+ MainController.Exec(sFilePath, False)
+ End If
+ Dim bMachiningMode As Boolean = EgtGetCurrMachGroup() <> GDB_ID.NULL
+ If Not bMachiningMode And EgtGetCurrLayer() = GDB_ID.NULL Then
+ Dim nCurrPart As Integer = EgtGetCurrPart()
+ If nCurrPart = GDB_ID.NULL Or Not EgtSetCurrPartLayer(nCurrPart, EgtGetFirstLayer(nCurrPart, True)) Then
+ EgtResetCurrPartLayer()
+ End If
+ End If
+ End Sub
+
+#End Region ' ProjectManager
+
+#Region "SCENE EVENTS"
+
+ Private Sub OnCursorPos(ByVal sender As Object, ByVal sCursorPos As String)
+ Map.refMyStatusBarVM.SetCurrPos(sCursorPos)
+ End Sub
+
+ Private Sub OnMouseSetObjFilterForSelect(sender As Object, bZeroDim As Boolean, bCurve As Boolean,
+ bSurf As Boolean, bVolume As Boolean, bExtra As Boolean)
+ End Sub
+
+ Private Sub OnMouseSelectedAll(ByVal sender As Object, bOnlyVisble As Boolean)
+ End Sub
+
+ Private Sub OnMouseDeselectedAll(ByVal sender As Object)
+ End Sub
+
+ Private Sub OnMouseDownScene(sender As Object, e As Forms.MouseEventArgs)
+ If e.Button = Forms.MouseButtons.Middle Then Return
+ If Map.refInstrumentPanelVM.GetDistIsChecked Then Return
+ Basic_OnMouseDownScene(sender, e)
+ 'Select Case Map.refMainMenuVM.SelPage
+ ' Case Pages.VIEW
+ ' If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
+ ' If Map.refFreeContourManagerVM.bIsActive Then Return
+ ' If Map.refShowBeamPanelVM.bShowAll Then
+ ' View_Part_OnMouseDownScene(sender, e)
+ ' Else
+ ' View_Feature_OnMouseDownScene(sender, e)
+ ' End If
+ ' End If
+ ' Case Pages.MACHINING
+ ' If Not IsNothing(Map.refMachGroupPanelVM) AndAlso Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
+ ' Dim SelectedMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
+ ' If EgtGetCurrMachGroup() = GDB_ID.NULL Then Return
+ ' If SelectedMachGroup.nType = BWType.BEAM Then
+ ' Beam_OnMouseDownScene(sender, e)
+ ' ElseIf SelectedMachGroup.nType = BWType.WALL Then
+ ' Wall_OnMouseDownScene(sender, e)
+ ' End If
+ ' End If
+ 'End Select
+ End Sub
+
+ Private Sub OnMouseMoveScene(sender As Object, e As Forms.MouseEventArgs)
+ If e.Button = Forms.MouseButtons.Middle Then Return
+ If Map.refInstrumentPanelVM.GetDistIsChecked Then Return
+ Basic_OnMouseMoveScene(sender, e)
+ 'Select Case Map.refMainMenuVM.SelPage
+ ' Case Pages.VIEW
+ ' If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
+ ' If Map.refFreeContourManagerVM.bIsActive Then Return
+ ' If Map.refShowBeamPanelVM.bShowAll Then
+ ' View_Part_OnMouseMoveScene(sender, e)
+ ' Else
+ ' View_Feature_OnMouseMoveScene(sender, e)
+ ' End If
+ ' End If
+ ' Case Pages.MACHINING
+ ' If Not IsNothing(Map.refMachGroupPanelVM) AndAlso Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
+ ' Dim SelectedMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
+ ' If EgtGetCurrMachGroup() = GDB_ID.NULL Then Return
+ ' If SelectedMachGroup.nType = BWType.BEAM Then
+ ' Beam_OnMouseMoveScene(sender, e)
+ ' ElseIf SelectedMachGroup.nType = BWType.WALL Then
+ ' Wall_OnMouseMoveScene(sender, e)
+ ' End If
+ ' End If
+ 'End Select
+ End Sub
+
+ Private Sub OnMouseUpScene(sender As Object, e As Forms.MouseEventArgs)
+ If e.Button = Forms.MouseButtons.Middle Then Return
+ If Map.refInstrumentPanelVM.GetDistIsChecked Then Return
+ Basic_OnMouseUpScene(sender, e)
+ 'Select Case Map.refMainMenuVM.SelPage
+ ' Case Pages.VIEW
+ ' If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
+ ' If Map.refFreeContourManagerVM.bIsActive Then Return
+ ' If Map.refShowBeamPanelVM.bShowAll Then
+ ' View_Part_OnMouseUpScene(sender, e)
+ ' Else
+ ' View_Feature_OnMouseUpScene(sender, e)
+ ' End If
+ ' End If
+ ' Case Pages.MACHINING
+ ' If Not IsNothing(Map.refMachGroupPanelVM) AndAlso Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
+ ' Dim SelectedMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
+ ' If EgtGetCurrMachGroup() = GDB_ID.NULL Then Return
+ ' If SelectedMachGroup.nType = BWType.BEAM Then
+ ' Beam_OnMouseUpScene(sender, e)
+ ' ElseIf SelectedMachGroup.nType = BWType.WALL Then
+ ' Wall_OnMouseUpScene(sender, e)
+ ' End If
+ ' End If
+ 'End Select
+ End Sub
+
+ Private Sub OnMouseSelectedObj(ByVal sender As Object, ByVal nId As Integer, ByVal bLast As Boolean)
+ '' Se in modalità edit L250
+ 'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
+ ' ' se sto editando testo angoli
+ ' If Map.refFreeContourManagerVM.bIsModifyingTextAngle Then
+ ' ' passo testo selezionato
+ ' Map.refFreeContourManagerVM.TextAngleSelected(nId)
+ ' End If
+ ' MainController.MouseSelectedObj(nId, bLast)
+ 'End If
+ End Sub
+
+ Private Sub OnMouseSelectedPart(ByVal sender As Object, ByVal nId As Integer)
+ '' Se in modalità edit L250
+ 'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
+ ' MainController.MouseSelectedPart(nId)
+ 'End If
+ End Sub
+
+ Private Sub OnMouseSelectedLayer(ByVal sender As Object, ByVal nId As Integer)
+ '' Se in modalità edit L250
+ 'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
+ ' MainController.MouseSelectedLayer(nId)
+ 'End If
+ End Sub
+
+ Private Sub OnMouseSelectedPath(ByVal sender As Object, ByVal nId As Integer, ByVal bHaltOnFork As Boolean)
+ '' Se in modalità edit L250
+ 'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
+ ' MainController.MouseSelectedPath(nId, bHaltOnFork)
+ 'End If
+ End Sub
+
+ Private Sub OnMousePointFromSelection(ByVal sender As Object, ByVal nId As Integer, ByVal PtP As Point3d, ByVal nAux As Integer)
+ '' Se in modalità edit L250
+ 'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
+ ' MainController.SetPointFromSelection(nId, PtP, nAux)
+ 'End If
+ End Sub
+
+ Private Sub OnMouseDone(ByVal sender As Object)
+ '' Se in modalità edit L250
+ 'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
+ ' MainController.Done(Map.refFreeContourInputVM.Text)
+ 'End If
+ End Sub
+
+ Private Sub OnMouseSelectedPoint(ByVal sender As Object, ByVal PtP As Point3d, ByVal nSep As SEP, ByVal nId As Integer)
+ '' Se in modalità edit L250
+ 'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
+ ' Dim bDone As Boolean = (Keyboard.Modifiers And ModifierKeys.Control) <> ModifierKeys.Control
+ ' MainController.MouseSelectedPoint(PtP, nSep, nId, bDone)
+ 'End If
+ End Sub
+
+ Private Sub OnMouseSelectedDir(ByVal sender As Object, ByVal VtDir As Vector3d)
+ '' Se in modalità edit L250
+ 'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
+ ' MainController.SetLastVector3d(VtDir)
+ 'End If
+ End Sub
+
+ Private Sub OnMouseMoveSelPoint(ByVal sender As Object, ByVal PtP As Point3d)
+ '' Se in modalità edit L250
+ 'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
+ ' MainController.MouseMoveInSelectionPoint(PtP)
+ 'End If
+ End Sub
+
+ Private Sub OnShowDistance(ByVal sender As Object, ByVal sDistance As String)
+ Map.refMyStatusBarVM.SetOutputMessage(sDistance)
+ End Sub
+
+ Private Sub OnKeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs)
+ '' Se in modalità edit L250
+ 'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
+ ' ' Con DEL eseguo cancellazione delle entità selezionate
+ ' If e.KeyData = System.Windows.Forms.Keys.Delete Then
+ ' MainController.SetLastInteger(GDB_ID.SEL)
+ ' MainController.ExecuteCommand(Controller.CMD.DELETE)
+ ' ' Con SPAZIO ripeto l'ultimo comando
+ ' ElseIf e.KeyData = System.Windows.Forms.Keys.Space Then
+ ' MainController.RepeatLastCommand()
+ ' ' Con 'A' e in modalità continuazione, forzo il passaggio ad arco
+ ' ElseIf e.KeyData = System.Windows.Forms.Keys.A And MainController.GetContinue() Then
+ ' MainController.ContinueArcPDP()
+ ' ' Con 'L' e in modalità continuazione, forzo il passaggio a retta
+ ' ElseIf e.KeyData = System.Windows.Forms.Keys.L And MainController.GetContinue() Then
+ ' MainController.ContinueLine2P()
+ ' ' Con 'V' cambio lo stato del check
+ ' ElseIf e.KeyData = System.Windows.Forms.Keys.V Then
+ ' Map.refFreeContourInputVM.ChangeInputBoxCheck()
+ ' End If
+ 'End If
+ End Sub
+
+ Private Sub OnCloseGetDist(sender As System.Object)
+ Map.refInstrumentPanelVM.SetGetDistance_IsChecked(False)
+ End Sub
+
+ Friend Sub OnChangedSnapPointType(ByVal sender As Object, ByVal nSpType As SP, ByVal bUser As Boolean)
+ m_SnapType = nSpType
+ If Not IsNothing(Map.refMyStatusBarVM) Then Map.refMyStatusBarVM.SetSnapPointType(nSpType)
+ End Sub
+
+#End Region ' SCENE EVENTS
+
+#Region "CONTROLLER EVENTS"
+
+ Private Sub OnNewProject(sender As Object, bOk As Boolean)
+ CurrentMachine.CreateMachineTable()
+ If Not bOk Then
+ MessageBox.Show(Application.Current.MainWindow, EgtMsg(10002), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error on new file - Error
+ End If
+ EgtZoom(ZM.ALL)
+ MainScene.SetStatusNull()
+ End Sub
+
+ Private Sub OnOpenProject(sender As Object, sFile As String, bOk As Boolean)
+ EgtZoom(ZM.ALL)
+ WriteMainPrivateProfileString(S_GENERAL, K_LASTNGEDIR, Path.GetDirectoryName(sFile))
+ If bOk Then
+ Map.refProjManagerVM.MruFiles.Add(sFile)
+ Else
+ Map.refProjManagerVM.MruFiles.Remove(sFile)
+ Dim sMsg As String
+ If My.Computer.FileSystem.FileExists(sFile) Then
+ sMsg = EgtMsg(10003) & " '" & sFile & "'" 'Error opening file
+ Else
+ sMsg = EgtMsg(10009) & " '" & sFile & "'" 'Missing file
+ End If
+ MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) 'Error
+ End If
+ MainScene.SetStatusNull()
+ End Sub
+
+ Private Sub OnSavingProject(ByVal sender As Object, sFile As String)
+ End Sub
+
+ Private Sub OnSavedProject(ByVal sender As Object, ByVal sFile As String, ByVal bOk As Boolean)
+ WriteMainPrivateProfileString(S_GENERAL, K_LASTNGEDIR, Path.GetDirectoryName(sFile))
+ If bOk Then
+ Map.refProjManagerVM.MruFiles.Add(sFile)
+ Else
+ Map.refProjManagerVM.MruFiles.Remove(sFile)
+ Dim sMsg As String = EgtMsg(10004) & " '" & sFile & "'" 'Error saving file
+ MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error
+ End If
+ End Sub
+
+ Private Sub OnInsertedProject(ByVal sender As Object, ByVal sFile As String, ByVal bOk As Boolean)
+ ' Segnalo eventuale errore
+ If Not bOk Then
+ Dim sMsg As String = EgtMsg(10006) & " '" & sFile & "'" 'Error importing file
+ MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error
+ Else
+ ' lo aggiungo alla lista pezzi
+ Map.refProjectVM.AddNewPart(sFile)
+ End If
+ EgtDraw()
+ MainScene.SetStatusNull()
+ End Sub
+
+ Private Sub OnImportingProject(sender As Object, nType As Integer, ByRef nFlag As Integer)
+ If nType <> FT.NULL Then
+ If nType = FT.CNC Then
+ nFlag = GetMainPrivateProfileInt(S_IMPORT, K_CNCFLAG, EIC_FL.NONE)
+ Else
+ nFlag = 0
+ End If
+ ' Abilito progress e bottone stop
+ Map.refMyStatusBarVM.StartLoading("", True)
+ Else
+ MessageBox.Show(Application.Current.MainWindow, EgtMsg(10005), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' File type unknown - Error
+ End If
+ End Sub
+
+ Private Sub OnImportedProject(ByVal sender As Object, ByVal sFile As String, ByVal bOk As Boolean)
+ EgtZoom(ZM.ALL)
+ ' Disabilito progress e bottone stop
+ Map.refMyStatusBarVM.EndLoading("")
+ ' Salvo path
+ WriteMainPrivateProfileString(S_GENERAL, K_LASTIMPDIR, Path.GetDirectoryName(sFile))
+ ' Segnalo eventuale errore
+ If Not bOk Then
+ Dim sMsg As String = EgtMsg(10006) & " '" & sFile & "'" 'Error importing file
+ MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error
+ ElseIf Path.GetExtension(sFile) <> ".cnc" Then
+ ' creo oggetto pezzo in lista
+ 'Map.refProjectVM.
+ End If
+ MainScene.SetStatusNull()
+ End Sub
+
+ Private Sub PrepareInputBox(ByVal sTitle As String, ByVal sLabel As String, ByVal sCheckLabel As String,
+ ByVal bShowCombo As Boolean, ByVal bShowBtn As Boolean)
+ 'Map.refFreeContourInputVM.PrepareInputBox(sTitle, sLabel, sCheckLabel, bShowCombo, bShowBtn)
+ End Sub
+
+ Private Sub SetInputBoxText(ByVal sText As String)
+ 'Map.refFreeContourInputVM.SetInputBoxText(sText)
+ End Sub
+
+ Private Sub SetInputBoxCheck(ByVal bCheck As Boolean)
+ 'Map.refFreeContourInputVM.SetInputBoxCheck(bCheck)
+ End Sub
+
+ Private Sub AddInputBoxCombo(ByVal sText As String, ByVal bSelected As Boolean)
+ 'Map.refFreeContourInputVM.AddInputBoxCombo(sText, bSelected)
+ End Sub
+
+ Private Sub UpdateUI(ByVal sender As Object, ByVal bReloadUI As Boolean)
+ '' pulisco input e relativi messaggi
+ 'Map.refFreeContourInputVM.ResetInputBox()
+ If MainController.GetContinue() Then
+ Map.refMyStatusBarVM.SetOutputMessage(EgtMsg(399)) ' Continue : 'L' with line, 'A' with arc
+ Else
+ Map.refMyStatusBarVM.ClearOutputMessage()
+ End If
+ End Sub
+
+#End Region ' CONTROLLER EVENTS
+
+#Region "Part"
+
+ Friend Sub Basic_OnMouseDownScene(sender As Object, e As Forms.MouseEventArgs)
+ ' Verifico se selezionato indicativo di pezzo
+ EgtSetObjFilterForSelWin(True, True, True, True, True)
+ Dim nSel As Integer
+ EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel)
+ Dim nId As Integer = EgtGetFirstObjInSelWin()
+ While nId <> GDB_ID.NULL
+ ' Recupero l'identificativo del pezzo cui appartiene
+ Dim nPartId As Integer = EgtGetParent(EgtGetParent(nId))
+ Dim bFound As Boolean = False
+ If EgtIsPart(nPartId) Then bFound = True
+ If Not bFound Then
+ nId = EgtGetNextObjInSelWin()
+ Continue While
+ End If
+ Dim nStat As Integer = GDB_ST.ON_
+ EgtGetStatus(nPartId, nStat)
+ ' Se già selezionato
+ If nStat = GDB_ST.SEL Then
+ ' Memorizzo Id da deselezionare
+ m_nIdToDesel = nPartId
+ Else
+ ' Memorizzo Id da selezionare
+ m_nIdToSel = nPartId
+ End If
+ Exit While
+ nId = EgtGetNextObjInSelWin()
+ End While
+ ' Dati per drag
+ m_bDragToStart = True
+ End Sub
+
+ Friend Sub Basic_OnMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
+ ' Se drag non abilitato o già in esecuzione, esco
+ If Not m_bDragToStart Then Return
+ ' Se primo movimento di drag, verifico di aver superato la soglia di movimento in pixel
+ If m_bDragToStart Then
+ If Math.Abs(e.Location.X - m_locPrev.X) < m_nRestRadius And
+ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
+ Return
+ End If
+ m_bDragToStart = False
+ End If
+ End Sub
+
+ Friend Sub Basic_OnMouseUpScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
+ ' Se eseguito drag
+ If Not m_bDragToStart Then
+ ' Se selezione da eseguire
+ ElseIf m_nIdToSel <> GDB_ID.NULL Then
+ ' Se pezzo da selezionare non è già selezionato
+ 'If EgtIsSelectedObj(m_nIdToSel) Then
+ ' Eseguo la selezione
+ Map.refProjectVM.SelPartFromId(m_nIdToSel)
+ 'EgtDeselectAll()
+ 'EgtSelectPartObjs(m_nIdToSel)
+ 'EgtSelectObj(m_nIdToSel)
+ 'EgtSetMark(m_nIdToSel)
+ 'End If
+ 'If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) OrElse Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId <> m_nIdToSel Then
+ ' ' Eseguo la selezione
+ ' For Each BTLPart In Map.refProjectVM.BTLStructureVM.BTLPartVMList
+ ' If BTLPart.nPartId = m_nIdToSel Then
+ ' BTLPart.SetIsSelected(True)
+ ' ElseIf BTLPart.IsSelected Then
+ ' BTLPart.SetIsSelected(False)
+ ' End If
+ ' Next
+ ' End If
+ End If
+ ' Reset
+ m_bDrag = False
+ m_nIdToSel = GDB_ID.NULL
+ m_nIdToDesel = GDB_ID.NULL
+ EgtDraw()
+ End Sub
+
+#End Region ' Part
+
+End Class
diff --git a/3dPrintApp/SceneHost/MySceneHostVM.vb.bak b/3dPrintApp/SceneHost/MySceneHostVM.vb.bak
new file mode 100644
index 0000000..b07847b
--- /dev/null
+++ b/3dPrintApp/SceneHost/MySceneHostVM.vb.bak
@@ -0,0 +1,655 @@
+Imports System.IO
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Public Class MySceneHostVM
+ Inherits EgtWPFLib5.SceneHostVM
+
+ Friend m_bIsFocused As Boolean
+ Friend Sub SetIsFocused(bValue As Boolean)
+ m_bIsFocused = bValue
+ End Sub
+
+ ' Identificativi per pezzo da selezionare/deselezionare
+ Private m_nIdToSel As Integer = GDB_ID.NULL
+ Private m_nIdToDesel As Integer = GDB_ID.NULL
+ ' Dati movimento
+ Private m_dMaxStep As Double = 0
+ ' Dati per Drag
+ Private m_nRestRadius As Integer = 5
+ Private m_bDrag As Boolean = False
+ Private m_bDragToStart As Boolean = False
+ Private m_bVerify As Boolean = False
+ Private m_bFromParking As Boolean = False
+ Private m_bDragging As Boolean = False
+ Private m_locPrev As System.Drawing.Point
+ Private m_ptPrev As Point3d
+ Private m_vtTotMove As Vector3d
+ Private m_dSnapDist As Double = 0
+
+
+ Private bReducedCut As Boolean = False
+ Private m_bMagnetic As Boolean
+
+#Region "CONSTRUCTOR"
+
+ Sub New()
+ MyBase.New()
+ AddHandler MainController.OnNewProject, AddressOf OnNewProject
+ AddHandler MainController.OnOpenProject, AddressOf OnOpenProject
+ AddHandler MainController.OnSavingProject, AddressOf OnSavingProject
+ AddHandler MainController.OnSavedProject, AddressOf OnSavedProject
+ AddHandler MainController.OnImportingProject, AddressOf OnImportingProject
+ AddHandler MainController.OnImportedProject, AddressOf OnImportedProject
+ AddHandler MainController.PrepareInputBox, AddressOf PrepareInputBox
+ AddHandler MainController.SetInputBoxText, AddressOf SetInputBoxText
+ AddHandler MainController.SetInputBoxCheck, AddressOf SetInputBoxCheck
+ AddHandler MainController.AddInputBoxCombo, AddressOf AddInputBoxCombo
+ AddHandler MainController.UpdateUI, AddressOf UpdateUI
+ End Sub
+
+#End Region ' CONSTRUCTOR
+
+#Region "METHODS"
+
+ Overrides Sub InitScene()
+ InitSceneEvents()
+ ' Inizializzazione Scena
+ PreInitializeScene()
+ ' Se tutto bene
+ If MainScene.Init() And Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT._3DPRINT) Then
+ PostInitializeScene()
+ ' Imposto stato gestione mouse diretto della scena a nessuno
+ MainScene.SetStatusNull()
+ EgtSetCurrentContext(MainScene.GetCtx())
+ ' inizializzo gestore travi e pareti
+ EgtInitBeamMgr(EIB_FL.TS3_POS + EIB_FL.USEUATTR)
+ ' inizializzo gestore lavorazioni
+ EgtInitMachMgr(Map.refMainWindowVM.MainWindowM.sMachinesRoot, Map.refMainWindowVM.MainWindowM.sToolMakersDir)
+ Return
+ End If
+ ' Problemi
+ ' Se manca la chiave
+ If Map.refMainWindowVM.MainWindowM.nKeyLevel = -1 Or Map.refMainWindowVM.MainWindowM.nKeyLevel = -2 Then
+ EgtOutLog("Missing Dongle")
+ ' Box di avviso chiave mancante : "Chiave non presente. \n Inserirla e riavviare il programma." "Errore"
+ Dim sText As String = EgtMsg(MSG_MISSINGKEYWD + 2) & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 3)
+ Dim sTitle As String = EgtMsg(MSG_MISSINGKEYWD + 1)
+ MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error)
+ ' Altrimenti manca la licenza
+ Else
+ EgtOutLog("Problems with Licence")
+ ' Box di avviso licenza con problemi : "Programma senza licenza. \n Caricala e riavvia il programma." "Errore"
+ Dim sText As String = EgtMsg(MSG_MISSINGKEYWD + 5) & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 6)
+ Dim sTitle As String = EgtMsg(MSG_MISSINGKEYWD + 1)
+ If MessageBox.Show(sText, sTitle, MessageBoxButton.OKCancel, MessageBoxImage.Error) = MessageBoxResult.OK Then
+ ' Apro dialogo per richiesta file licenza
+ Dim LicDlg As New Microsoft.Win32.OpenFileDialog() With {
+ .DefaultExt = ".lic",
+ .Filter = "Licences (.lic)|*.lic",
+ .CheckFileExists = True,
+ .ValidateNames = True
+ }
+ If LicDlg.ShowDialog() = True Then
+ ' Recupero il direttorio del file
+ Dim sDir As String = Path.GetDirectoryName(LicDlg.FileName)
+ ' Se il file non è già nel direttorio di configurazione lo copio
+ If Not String.Equals(Path.GetFullPath(sDir), Path.GetFullPath(Map.refMainWindowVM.MainWindowM.sConfigDir), StringComparison.OrdinalIgnoreCase) Then
+ Try
+ File.Copy(LicDlg.FileName, Path.Combine(Map.refMainWindowVM.MainWindowM.sConfigDir, LicDlg.SafeFileName), True)
+ Catch ex As Exception
+ End Try
+ End If
+ ' Imposto il nuovo file di licenza nell'Ini
+ WriteMainPrivateProfileString(S_GENERAL, K_LICENCE, LicDlg.SafeFileName)
+ End If
+ End If
+ End If
+ ' Chiudo il programma
+ End
+ End Sub
+
+ Public Overrides Sub InitSceneEvents()
+ AddHandler MainScene.OnCursorPos, AddressOf OnCursorPos
+ AddHandler MainScene.OnMouseSetObjFilterForSelect, AddressOf OnMouseSetObjFilterForSelect
+ AddHandler MainScene.OnMouseSelectedAll, AddressOf OnMouseSelectedAll
+ AddHandler MainScene.OnMouseDeselectedAll, AddressOf OnMouseDeselectedAll
+ AddHandler MainScene.OnMouseDownScene, AddressOf OnMouseDownScene
+ AddHandler MainScene.OnMouseMoveScene, AddressOf OnMouseMoveScene
+ AddHandler MainScene.OnMouseUpScene, AddressOf OnMouseUpScene
+ AddHandler MainScene.OnMouseSelectedObj, AddressOf OnMouseSelectedObj
+ AddHandler MainScene.OnMouseSelectedPart, AddressOf OnMouseSelectedPart
+ AddHandler MainScene.OnMouseSelectedLayer, AddressOf OnMouseSelectedLayer
+ AddHandler MainScene.OnMouseSelectedPath, AddressOf OnMouseSelectedPath
+ AddHandler MainScene.OnMousePointFromSelection, AddressOf OnMousePointFromSelection
+ AddHandler MainScene.OnMouseDone, AddressOf OnMouseDone
+ AddHandler MainScene.OnMouseSelectedPoint, AddressOf OnMouseSelectedPoint
+ AddHandler MainScene.OnMouseSelectedDir, AddressOf OnMouseSelectedDir
+ AddHandler MainScene.OnMouseMoveSelPoint, AddressOf OnMouseMoveSelPoint
+ AddHandler MainScene.OnShowDistance, AddressOf OnShowDistance
+ AddHandler MainScene.KeyDown, AddressOf OnKeyDown
+ AddHandler MainScene.OnCloseGetDist, AddressOf OnCloseGetDist
+ AddHandler MainScene.OnChangedSnapPointType, AddressOf OnChangedSnapPointType
+ End Sub
+
+ Private Sub PreInitializeScene()
+ ' imposto colore di default
+ Dim DefColor As New Color3d(0, 0, 0)
+ GetMainPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor)
+ MainScene.SetDefaultMaterial(DefColor)
+ ' imposto colori sfondo
+ Dim BackTopColor As New Color3d(192, 192, 192)
+ GetMainPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor)
+ Dim BackBotColor As New Color3d(BackTopColor)
+ GetMainPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor)
+ MainScene.SetViewBackground(BackTopColor, BackBotColor)
+ ' imposto colore di evidenziazione
+ Dim MarkColor As New Color3d(255, 255, 0)
+ GetMainPrivateProfileColor(S_SCENE, K_MARK, MarkColor)
+ MainScene.SetMarkMaterial(MarkColor)
+ ' imposto colore per superfici selezionate
+ Dim SelSurfColor As New Color3d(255, 255, 192)
+ GetMainPrivateProfileColor(S_SCENE, K_SELSURF, SelSurfColor)
+ MainScene.SetSelSurfMaterial(SelSurfColor)
+ ' imposto tipo e colore del rettangolo di zoom
+ Dim bOutline As Boolean = True
+ Dim ZwColor As New Color3d(0, 0, 0)
+ GetMainPrivateProfileZoomWin(S_SCENE, K_ZOOMWIN, bOutline, ZwColor)
+ MainScene.SetZoomWinAttribs(bOutline, ZwColor)
+ ' imposto colore della linea di distanza
+ Dim DstLnColor As New Color3d(255, 0, 0)
+ GetMainPrivateProfileColor(S_SCENE, K_DISTLINE, DstLnColor)
+ MainScene.SetDistLineMaterial(DstLnColor)
+ ' imposto parametri OpenGL
+ Dim nDriver As Integer = GetMainPrivateProfileInt(S_OPENGL, K_DRIVER, 3)
+ Dim b2Buff As Boolean = (GetMainPrivateProfileInt(S_OPENGL, K_DOUBLEBUFFER, 1) <> 0)
+ Dim nColorBits As Integer = GetMainPrivateProfileInt(S_OPENGL, K_COLORBITS, 32)
+ Dim nDepthBits As Integer = GetMainPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32)
+ MainScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
+ End Sub
+
+ Private Sub PostInitializeScene()
+ ' Impostazioni Controller
+ MainController.SetScene(MainScene)
+ ' imposto tipo coordinate
+ MainScene.SetGridCursorPos(True)
+ ' modo di visualizzazione
+ Dim nShowMode As Integer = GetMainPrivateProfileInt(S_SCENE, K_SHOWMODE, SM.SHADING)
+ '''Map.refShowPanelVM.SetShowMode(DirectCast(nShowMode, SM))
+ ' visualizzazione avanzata dei triangoli costituenti le superfici
+ Dim bShowTriaAdv As Boolean = (GetMainPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1) <> 0)
+ EgtSetShowTriaAdv(bShowTriaAdv)
+ ' tipo visualizzazione per Zmap
+ Dim nShowZmap As Integer = GetMainPrivateProfileInt(S_SCENE, K_SHOWZMAP, 1)
+ EgtSetShowZmap(DirectCast(nShowZmap, ZSM), False)
+ ' dimensione lineare max in pixel delle textures
+ Dim nTxrMaxLinPix As Integer = GetMainPrivateProfileInt(S_SCENE, K_TEXMAXLINPIX, 4096)
+ EgtSetTextureMaxLinPixels(nTxrMaxLinPix)
+ ' tipo snap point
+ MainScene.SetSnapPointType(SP.PT_SKETCH)
+ ' visualizzazione assemblato
+ Dim nShowBuilding As Boolean = GetMainPrivateProfileInt(S_SCENE, K_SHOWBUILDING, 0) <> 0
+ '''Map.refShowBeamPanelVM.SetShowBuilding(nShowBuilding)
+ ' nascondo input box
+ '''Map.refFreeContourInputVM.ResetInputBox()
+ End Sub
+
+#End Region ' METHODS
+
+#Region "ProjectManager"
+
+ Public Overrides Sub NewProject()
+ EgtSetCurrentContext(MainScene.GetCtx())
+ Dim bOk As Boolean = MainController.NewProject()
+ MainScene.SetStatusNull()
+ End Sub
+
+ Public Overrides Sub OpenProject(sFilePath As String)
+ EgtSetCurrentContext(MainScene.GetCtx())
+ Dim bOk As Boolean = False
+ If String.IsNullOrEmpty(sFilePath) Then
+ ' Recupero cartella dell'ultimo progetto aperto
+ Dim sDir As String = MainController.GetCurrFile()
+ If String.IsNullOrWhiteSpace(sDir) Then
+ GetMainPrivateProfileString(S_MRUFILES, K_FILE, "", sDir)
+ End If
+ If Not String.IsNullOrWhiteSpace(sDir) Then
+ sDir = Path.GetDirectoryName(sDir)
+ End If
+ bOk = MainController.OpenProject(sDir)
+ Else
+ bOk = MainController.OpenProject(sFilePath, False)
+ End If
+ MainScene.SetStatusNull()
+ End Sub
+
+ Public Overrides Sub SaveProject()
+ MyBase.SaveProject()
+ ' Imposto stato gestione mouse diretto della scena a nessuno
+ MainScene.SetStatusNull()
+ End Sub
+
+ Public Overrides Sub SaveAsProject()
+ MyBase.SaveAsProject()
+ ' Imposto stato gestione mouse diretto della scena a nessuno
+ MainScene.SetStatusNull()
+ End Sub
+
+ Public Overrides Sub ImportProject()
+ Dim sDir As String = String.Empty
+ GetMainPrivateProfileString(S_MRUIMPORT, K_FILE & "1", "", sDir)
+ If Not String.IsNullOrWhiteSpace(sDir) Then
+ sDir = Path.GetDirectoryName(sDir)
+ End If
+ sDir.TrimEnd("\"c)
+ MainController.ImportProject(sDir)
+ ' Imposto stato gestione mouse diretto della scena a nessuno
+ MainScene.SetStatusNull()
+ End Sub
+
+ Friend Sub PreExecScript(bScriptInMru As Boolean)
+ 'm_bScriptInMru = bScriptInMru
+ End Sub
+
+ Friend Sub ExecScript(sFilePath As String)
+ If String.IsNullOrEmpty(sFilePath) Then
+ Dim sDir As String = String.Empty
+ 'GetMainPrivateProfileString(S_GENERAL, K_LASTLUADIR, "", sDir)
+ MainController.Exec(sDir)
+ Else
+ MainController.Exec(sFilePath, False)
+ End If
+ Dim bMachiningMode As Boolean = EgtGetCurrMachGroup() <> GDB_ID.NULL
+ If Not bMachiningMode And EgtGetCurrLayer() = GDB_ID.NULL Then
+ Dim nCurrPart As Integer = EgtGetCurrPart()
+ If nCurrPart = GDB_ID.NULL Or Not EgtSetCurrPartLayer(nCurrPart, EgtGetFirstLayer(nCurrPart, True)) Then
+ EgtResetCurrPartLayer()
+ End If
+ End If
+ End Sub
+
+#End Region ' ProjectManager
+
+#Region "SCENE EVENTS"
+
+ Private Sub OnCursorPos(ByVal sender As Object, ByVal sCursorPos As String)
+ Map.refMyStatusBarVM.SetCurrPos(sCursorPos)
+ End Sub
+
+ Private Sub OnMouseSetObjFilterForSelect(sender As Object, bZeroDim As Boolean, bCurve As Boolean,
+ bSurf As Boolean, bVolume As Boolean, bExtra As Boolean)
+ End Sub
+
+ Private Sub OnMouseSelectedAll(ByVal sender As Object, bOnlyVisble As Boolean)
+ End Sub
+
+ Private Sub OnMouseDeselectedAll(ByVal sender As Object)
+ End Sub
+
+ Private Sub OnMouseDownScene(sender As Object, e As Forms.MouseEventArgs)
+ If e.Button = Forms.MouseButtons.Middle Then Return
+ If Map.refInstrumentPanelVM.GetDistIsChecked Then Return
+ Basic_OnMouseDownScene(sender, e)
+ 'Select Case Map.refMainMenuVM.SelPage
+ ' Case Pages.VIEW
+ ' If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
+ ' If Map.refFreeContourManagerVM.bIsActive Then Return
+ ' If Map.refShowBeamPanelVM.bShowAll Then
+ ' View_Part_OnMouseDownScene(sender, e)
+ ' Else
+ ' View_Feature_OnMouseDownScene(sender, e)
+ ' End If
+ ' End If
+ ' Case Pages.MACHINING
+ ' If Not IsNothing(Map.refMachGroupPanelVM) AndAlso Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
+ ' Dim SelectedMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
+ ' If EgtGetCurrMachGroup() = GDB_ID.NULL Then Return
+ ' If SelectedMachGroup.nType = BWType.BEAM Then
+ ' Beam_OnMouseDownScene(sender, e)
+ ' ElseIf SelectedMachGroup.nType = BWType.WALL Then
+ ' Wall_OnMouseDownScene(sender, e)
+ ' End If
+ ' End If
+ 'End Select
+ End Sub
+
+ Private Sub OnMouseMoveScene(sender As Object, e As Forms.MouseEventArgs)
+ If e.Button = Forms.MouseButtons.Middle Then Return
+ If Map.refInstrumentPanelVM.GetDistIsChecked Then Return
+ Basic_OnMouseMoveScene(sender, e)
+ 'Select Case Map.refMainMenuVM.SelPage
+ ' Case Pages.VIEW
+ ' If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
+ ' If Map.refFreeContourManagerVM.bIsActive Then Return
+ ' If Map.refShowBeamPanelVM.bShowAll Then
+ ' View_Part_OnMouseMoveScene(sender, e)
+ ' Else
+ ' View_Feature_OnMouseMoveScene(sender, e)
+ ' End If
+ ' End If
+ ' Case Pages.MACHINING
+ ' If Not IsNothing(Map.refMachGroupPanelVM) AndAlso Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
+ ' Dim SelectedMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
+ ' If EgtGetCurrMachGroup() = GDB_ID.NULL Then Return
+ ' If SelectedMachGroup.nType = BWType.BEAM Then
+ ' Beam_OnMouseMoveScene(sender, e)
+ ' ElseIf SelectedMachGroup.nType = BWType.WALL Then
+ ' Wall_OnMouseMoveScene(sender, e)
+ ' End If
+ ' End If
+ 'End Select
+ End Sub
+
+ Private Sub OnMouseUpScene(sender As Object, e As Forms.MouseEventArgs)
+ If e.Button = Forms.MouseButtons.Middle Then Return
+ If Map.refInstrumentPanelVM.GetDistIsChecked Then Return
+ Basic_OnMouseUpScene(sender, e)
+ 'Select Case Map.refMainMenuVM.SelPage
+ ' Case Pages.VIEW
+ ' If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
+ ' If Map.refFreeContourManagerVM.bIsActive Then Return
+ ' If Map.refShowBeamPanelVM.bShowAll Then
+ ' View_Part_OnMouseUpScene(sender, e)
+ ' Else
+ ' View_Feature_OnMouseUpScene(sender, e)
+ ' End If
+ ' End If
+ ' Case Pages.MACHINING
+ ' If Not IsNothing(Map.refMachGroupPanelVM) AndAlso Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
+ ' Dim SelectedMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
+ ' If EgtGetCurrMachGroup() = GDB_ID.NULL Then Return
+ ' If SelectedMachGroup.nType = BWType.BEAM Then
+ ' Beam_OnMouseUpScene(sender, e)
+ ' ElseIf SelectedMachGroup.nType = BWType.WALL Then
+ ' Wall_OnMouseUpScene(sender, e)
+ ' End If
+ ' End If
+ 'End Select
+ End Sub
+
+ Private Sub OnMouseSelectedObj(ByVal sender As Object, ByVal nId As Integer, ByVal bLast As Boolean)
+ '' Se in modalità edit L250
+ 'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
+ ' ' se sto editando testo angoli
+ ' If Map.refFreeContourManagerVM.bIsModifyingTextAngle Then
+ ' ' passo testo selezionato
+ ' Map.refFreeContourManagerVM.TextAngleSelected(nId)
+ ' End If
+ ' MainController.MouseSelectedObj(nId, bLast)
+ 'End If
+ End Sub
+
+ Private Sub OnMouseSelectedPart(ByVal sender As Object, ByVal nId As Integer)
+ '' Se in modalità edit L250
+ 'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
+ ' MainController.MouseSelectedPart(nId)
+ 'End If
+ End Sub
+
+ Private Sub OnMouseSelectedLayer(ByVal sender As Object, ByVal nId As Integer)
+ '' Se in modalità edit L250
+ 'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
+ ' MainController.MouseSelectedLayer(nId)
+ 'End If
+ End Sub
+
+ Private Sub OnMouseSelectedPath(ByVal sender As Object, ByVal nId As Integer, ByVal bHaltOnFork As Boolean)
+ '' Se in modalità edit L250
+ 'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
+ ' MainController.MouseSelectedPath(nId, bHaltOnFork)
+ 'End If
+ End Sub
+
+ Private Sub OnMousePointFromSelection(ByVal sender As Object, ByVal nId As Integer, ByVal PtP As Point3d, ByVal nAux As Integer)
+ '' Se in modalità edit L250
+ 'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
+ ' MainController.SetPointFromSelection(nId, PtP, nAux)
+ 'End If
+ End Sub
+
+ Private Sub OnMouseDone(ByVal sender As Object)
+ '' Se in modalità edit L250
+ 'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
+ ' MainController.Done(Map.refFreeContourInputVM.Text)
+ 'End If
+ End Sub
+
+ Private Sub OnMouseSelectedPoint(ByVal sender As Object, ByVal PtP As Point3d, ByVal nSep As SEP, ByVal nId As Integer)
+ '' Se in modalità edit L250
+ 'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
+ ' Dim bDone As Boolean = (Keyboard.Modifiers And ModifierKeys.Control) <> ModifierKeys.Control
+ ' MainController.MouseSelectedPoint(PtP, nSep, nId, bDone)
+ 'End If
+ End Sub
+
+ Private Sub OnMouseSelectedDir(ByVal sender As Object, ByVal VtDir As Vector3d)
+ '' Se in modalità edit L250
+ 'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
+ ' MainController.SetLastVector3d(VtDir)
+ 'End If
+ End Sub
+
+ Private Sub OnMouseMoveSelPoint(ByVal sender As Object, ByVal PtP As Point3d)
+ '' Se in modalità edit L250
+ 'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
+ ' MainController.MouseMoveInSelectionPoint(PtP)
+ 'End If
+ End Sub
+
+ Private Sub OnShowDistance(ByVal sender As Object, ByVal sDistance As String)
+ Map.refMyStatusBarVM.SetOutputMessage(sDistance)
+ End Sub
+
+ Private Sub OnKeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs)
+ '' Se in modalità edit L250
+ 'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
+ ' ' Con DEL eseguo cancellazione delle entità selezionate
+ ' If e.KeyData = System.Windows.Forms.Keys.Delete Then
+ ' MainController.SetLastInteger(GDB_ID.SEL)
+ ' MainController.ExecuteCommand(Controller.CMD.DELETE)
+ ' ' Con SPAZIO ripeto l'ultimo comando
+ ' ElseIf e.KeyData = System.Windows.Forms.Keys.Space Then
+ ' MainController.RepeatLastCommand()
+ ' ' Con 'A' e in modalità continuazione, forzo il passaggio ad arco
+ ' ElseIf e.KeyData = System.Windows.Forms.Keys.A And MainController.GetContinue() Then
+ ' MainController.ContinueArcPDP()
+ ' ' Con 'L' e in modalità continuazione, forzo il passaggio a retta
+ ' ElseIf e.KeyData = System.Windows.Forms.Keys.L And MainController.GetContinue() Then
+ ' MainController.ContinueLine2P()
+ ' ' Con 'V' cambio lo stato del check
+ ' ElseIf e.KeyData = System.Windows.Forms.Keys.V Then
+ ' Map.refFreeContourInputVM.ChangeInputBoxCheck()
+ ' End If
+ 'End If
+ End Sub
+
+ Private Sub OnCloseGetDist(sender As System.Object)
+ Map.refInstrumentPanelVM.SetGetDistance_IsChecked(False)
+ End Sub
+
+ Friend Sub OnChangedSnapPointType(ByVal sender As Object, ByVal nSpType As SP, ByVal bUser As Boolean)
+ If Not IsNothing(Map.refMyStatusBarVM) Then Map.refMyStatusBarVM.SetSnapPointType(nSpType)
+ End Sub
+
+#End Region ' SCENE EVENTS
+
+#Region "CONTROLLER EVENTS"
+
+ Private Sub OnNewProject(sender As Object, bOk As Boolean)
+ EgtZoom(ZM.ALL)
+ If Not bOk Then
+ MessageBox.Show(Application.Current.MainWindow, EgtMsg(10002), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error on new file - Error
+ End If
+ MainScene.SetStatusNull()
+ End Sub
+
+ Private Sub OnOpenProject(sender As Object, sFile As String, bOk As Boolean)
+ EgtZoom(ZM.ALL)
+ WriteMainPrivateProfileString(S_GENERAL, K_LASTNGEDIR, Path.GetDirectoryName(sFile))
+ If bOk Then
+ Map.refProjManagerVM.MruFiles.Add(sFile)
+ Else
+ Map.refProjManagerVM.MruFiles.Remove(sFile)
+ Dim sMsg As String
+ If My.Computer.FileSystem.FileExists(sFile) Then
+ sMsg = EgtMsg(10003) & " '" & sFile & "'" 'Error opening file
+ Else
+ sMsg = EgtMsg(10009) & " '" & sFile & "'" 'Missing file
+ End If
+ MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) 'Error
+ End If
+ MainScene.SetStatusNull()
+ End Sub
+
+ Private Sub OnSavingProject(ByVal sender As Object, sFile As String)
+ End Sub
+
+ Private Sub OnSavedProject(ByVal sender As Object, ByVal sFile As String, ByVal bOk As Boolean)
+ WriteMainPrivateProfileString(S_GENERAL, K_LASTNGEDIR, Path.GetDirectoryName(sFile))
+ If bOk Then
+ Map.refProjManagerVM.MruFiles.Add(sFile)
+ Else
+ Map.refProjManagerVM.MruFiles.Remove(sFile)
+ Dim sMsg As String = EgtMsg(10004) & " '" & sFile & "'" 'Error saving file
+ MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error
+ End If
+ End Sub
+
+ Private Sub OnImportingProject(sender As Object, nType As Integer, ByRef nFlag As Integer)
+ If nType <> FT.NULL Then
+ If nType = FT.CNC Then
+ nFlag = GetMainPrivateProfileInt(S_IMPORT, K_CNCFLAG, EIC_FL.NONE)
+ Else
+ nFlag = 0
+ End If
+ ' Abilito progress e bottone stop
+ Map.refMyStatusBarVM.StartLoading("", True)
+ Else
+ MessageBox.Show(Application.Current.MainWindow, EgtMsg(10005), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' File type unknown - Error
+ End If
+ End Sub
+
+ Private Sub OnImportedProject(ByVal sender As Object, ByVal sFile As String, ByVal bOk As Boolean)
+ EgtZoom(ZM.ALL)
+ ' Disabilito progress e bottone stop
+ Map.refMyStatusBarVM.EndLoading("")
+ ' Salvo path
+ WriteMainPrivateProfileString(S_GENERAL, K_LASTIMPDIR, Path.GetDirectoryName(sFile))
+ ' Segnalo eventuale errore
+ If Not bOk Then
+ Dim sMsg As String = EgtMsg(10006) & " '" & sFile & "'" 'Error importing file
+ MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error
+ End If
+ MainScene.SetStatusNull()
+ End Sub
+
+ Private Sub PrepareInputBox(ByVal sTitle As String, ByVal sLabel As String, ByVal sCheckLabel As String,
+ ByVal bShowCombo As Boolean, ByVal bShowBtn As Boolean)
+ 'Map.refFreeContourInputVM.PrepareInputBox(sTitle, sLabel, sCheckLabel, bShowCombo, bShowBtn)
+ End Sub
+
+ Private Sub SetInputBoxText(ByVal sText As String)
+ 'Map.refFreeContourInputVM.SetInputBoxText(sText)
+ End Sub
+
+ Private Sub SetInputBoxCheck(ByVal bCheck As Boolean)
+ 'Map.refFreeContourInputVM.SetInputBoxCheck(bCheck)
+ End Sub
+
+ Private Sub AddInputBoxCombo(ByVal sText As String, ByVal bSelected As Boolean)
+ 'Map.refFreeContourInputVM.AddInputBoxCombo(sText, bSelected)
+ End Sub
+
+ Private Sub UpdateUI(ByVal sender As Object, ByVal bReloadUI As Boolean)
+ '' pulisco input e relativi messaggi
+ 'Map.refFreeContourInputVM.ResetInputBox()
+ If MainController.GetContinue() Then
+ Map.refMyStatusBarVM.SetOutputMessage(EgtMsg(399)) ' Continue : 'L' with line, 'A' with arc
+ Else
+ Map.refMyStatusBarVM.ClearOutputMessage()
+ End If
+ End Sub
+
+#End Region ' CONTROLLER EVENTS
+
+#Region "Part"
+
+ Friend Sub Basic_OnMouseDownScene(sender As Object, e As Forms.MouseEventArgs)
+ ' Verifico se selezionato indicativo di pezzo
+ EgtSetObjFilterForSelWin(True, True, True, True, True)
+ Dim nSel As Integer
+ EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel)
+ Dim nId As Integer = EgtGetFirstObjInSelWin()
+ While nId <> GDB_ID.NULL
+ ' Recupero l'identificativo del pezzo cui appartiene
+ Dim nPartId As Integer = EgtGetParent(EgtGetParent(nId))
+ Dim bFound As Boolean = False
+ If EgtIsPart(nPartId) Then bFound = True
+ If Not bFound Then
+ nId = EgtGetNextObjInSelWin()
+ Continue While
+ End If
+ Dim nStat As Integer = GDB_ST.ON_
+ EgtGetStatus(nPartId, nStat)
+ ' Se già selezionato
+ If nStat = GDB_ST.SEL Then
+ ' Memorizzo Id da deselezionare
+ m_nIdToDesel = nPartId
+ Else
+ ' Memorizzo Id da selezionare
+ m_nIdToSel = nPartId
+ End If
+ Exit While
+ nId = EgtGetNextObjInSelWin()
+ End While
+ ' Dati per drag
+ m_bDragToStart = True
+ End Sub
+
+ Friend Sub Basic_OnMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
+ ' Se drag non abilitato o già in esecuzione, esco
+ If Not m_bDragToStart Then Return
+ ' Se primo movimento di drag, verifico di aver superato la soglia di movimento in pixel
+ If m_bDragToStart Then
+ If Math.Abs(e.Location.X - m_locPrev.X) < m_nRestRadius And
+ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
+ Return
+ End If
+ m_bDragToStart = False
+ End If
+ End Sub
+
+ Friend Sub Basic_OnMouseUpScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
+ ' Se eseguito drag
+ If Not m_bDragToStart Then
+ ' Se selezione da eseguire
+ ElseIf m_nIdToSel <> GDB_ID.NULL Then
+ ' Se pezzo da selezionare non è già selezionato
+ 'If EgtIsSelectedObj(m_nIdToSel) Then
+ ' Eseguo la selezione
+ EgtDeselectAll()
+ EgtSelectPartObjs(m_nIdToSel)
+ 'EgtSelectObj(m_nIdToSel)
+ 'EgtSetMark(m_nIdToSel)
+ 'End If
+ 'If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) OrElse Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId <> m_nIdToSel Then
+ ' ' Eseguo la selezione
+ ' For Each BTLPart In Map.refProjectVM.BTLStructureVM.BTLPartVMList
+ ' If BTLPart.nPartId = m_nIdToSel Then
+ ' BTLPart.SetIsSelected(True)
+ ' ElseIf BTLPart.IsSelected Then
+ ' BTLPart.SetIsSelected(False)
+ ' End If
+ ' Next
+ ' End If
+ End If
+ ' Reset
+ m_bDrag = False
+ m_nIdToSel = GDB_ID.NULL
+ m_nIdToDesel = GDB_ID.NULL
+ EgtDraw()
+ End Sub
+
+#End Region ' Part
+
+End Class
diff --git a/3dPrintApp/SceneHost/SceneHostV.xaml b/3dPrintApp/SceneHost/SceneHostV.xaml
new file mode 100644
index 0000000..22e5547
--- /dev/null
+++ b/3dPrintApp/SceneHost/SceneHostV.xaml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
diff --git a/3dPrintApp/SceneHost/SceneHostV.xaml.vb b/3dPrintApp/SceneHost/SceneHostV.xaml.vb
new file mode 100644
index 0000000..259a9a2
--- /dev/null
+++ b/3dPrintApp/SceneHost/SceneHostV.xaml.vb
@@ -0,0 +1,33 @@
+Imports System.Windows.Interop
+Imports System.IO
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Public Class SceneHostV
+
+ Private m_MySceneHostVM As MySceneHostVM
+
+ Sub New()
+ ' This call is required by the designer.
+ InitializeComponent()
+ ' Assegno al riferimento locale al VM il VM preso dal DataContext
+ Me.DataContext = New MySceneHostVM
+ m_MySceneHostVM = DirectCast(Me.DataContext, MySceneHostVM)
+ m_MySceneHostVM.SetMainScene(MainScene)
+ End Sub
+
+ Private Sub MainScene_GotFocus() Handles MainScene.GotFocus
+ m_MySceneHostVM.SetIsFocused(True)
+ EgtOutLog("MainScene_GotFocus")
+ ' Map.refSecondaryWindowV.Topmost = True
+ 'Map.refSecondaryWindowVM.SetVisibility(True)
+ End Sub
+
+ Private Sub MainScene_LostFocus() Handles MainScene.LostFocus
+ m_MySceneHostVM.SetIsFocused(False)
+ EgtOutLog("MainScene_LostFocus")
+ ' Map.refSecondaryWindowV.Topmost = False
+ 'Map.refSecondaryWindowVM.SetVisibility(False)
+ End Sub
+
+End Class
diff --git a/3dPrintApp/SecondaryWindow/SecondaryWindowV.xaml b/3dPrintApp/SecondaryWindow/SecondaryWindowV.xaml
new file mode 100644
index 0000000..d9c5d4b
--- /dev/null
+++ b/3dPrintApp/SecondaryWindow/SecondaryWindowV.xaml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/3dPrintApp/SecondaryWindow/SecondaryWindowV.xaml.vb b/3dPrintApp/SecondaryWindow/SecondaryWindowV.xaml.vb
new file mode 100644
index 0000000..47bec95
--- /dev/null
+++ b/3dPrintApp/SecondaryWindow/SecondaryWindowV.xaml.vb
@@ -0,0 +1,65 @@
+Imports EgtWPFLib5
+Imports EgtUILib
+
+Public Class SecondaryWindowV
+
+ Private m_SecondaryWindowVM As SecondaryWindowVM
+
+#Region "CONSTRUCTOR"
+
+ Sub New(Owner As Window)
+ ' Funzione che interpreta l'xaml
+ InitializeComponent()
+ m_SecondaryWindowVM = New SecondaryWindowVM
+ Me.DataContext = m_SecondaryWindowVM
+ Map.SetRefSecondaryWindowV(Me)
+ AddHandler Me.ContentRendered, AddressOf SecondaryWindowV_ContentRendered
+ AddHandler Me.Loaded, AddressOf SecondaryWindowV_Loaded
+ AddHandler Me.Closing, AddressOf SecondaryWindowV_Closing
+ AddHandler Me.LocationChanged, AddressOf SecondaryWindowV_LocationChanged
+ AddHandler Me.SizeChanged, AddressOf SecondaryWindowV_SizeChanged
+ AddHandler Me.StateChanged, AddressOf SecondaryWindowV_StateChanged
+ End Sub
+
+ Private Sub SecondaryWindowV_ContentRendered(sender As Object, e As EventArgs)
+ m_SecondaryWindowVM.ContentRendered()
+ End Sub
+
+ Private Sub SecondaryWindowV_Loaded(sender As Object, e As RoutedEventArgs)
+ ' Carico e imposto posizione finestra
+ WinPosFromIniToWindow(S_GENERAL, K_WINPLACE, Me)
+ End Sub
+
+ Private Sub SecondaryWindowV_Closing(sender As Object, e As System.ComponentModel.CancelEventArgs)
+ If (Keyboard.Modifiers And ModifierKeys.Alt) = ModifierKeys.Alt OrElse Keyboard.IsKeyDown(Key.F4) Then
+ e.Cancel = True
+ Return
+ End If
+ ' Salvo posizione finestra (se non minimizzata)
+ If WindowState <> WindowState.Minimized Then
+ WinPosFromWindowToIni(Me, S_GENERAL, K_WINPLACE)
+ End If
+ End Sub
+
+ Private Sub SecondaryWindowV_LocationChanged(sender As Object, e As EventArgs)
+ Application.Current.MainWindow.Top = Me.Top
+ Application.Current.MainWindow.Left = Me.Left
+ End Sub
+
+ Private Sub SecondaryWindowV_SizeChanged(sender As Object, e As SizeChangedEventArgs)
+ If Not IsNothing(Application.Current.MainWindow) Then
+ If e.WidthChanged Then Application.Current.MainWindow.Width = e.NewSize.Width
+ If e.HeightChanged Then Application.Current.MainWindow.Height = e.NewSize.Height
+ Application.Current.MainWindow.InvalidateVisual()
+ End If
+ End Sub
+
+ Private Sub SecondaryWindowV_StateChanged(sender As Object, e As EventArgs)
+ Application.Current.MainWindow.WindowState = Me.WindowState
+ Application.Current.MainWindow.Topmost = True
+ Application.Current.MainWindow.Topmost = False
+ End Sub
+
+#End Region ' CONSTRUCTOR
+
+End Class
diff --git a/3dPrintApp/SecondaryWindow/SecondaryWindowVM.vb b/3dPrintApp/SecondaryWindow/SecondaryWindowVM.vb
new file mode 100644
index 0000000..a3eda04
--- /dev/null
+++ b/3dPrintApp/SecondaryWindow/SecondaryWindowVM.vb
@@ -0,0 +1,71 @@
+Imports EgtWPFLib5
+Imports EgtUILib
+
+Public Class SecondaryWindowVM
+ Inherits VMBase
+
+ Private m_Visibility As Boolean
+ Public Property Visibility As Visibility
+ Get
+ Return If(m_Visibility, Visibility.Visible, Visibility.Collapsed)
+ End Get
+ Set(value As Visibility)
+ m_Visibility = (value = Visibility.Visible)
+ End Set
+ End Property
+
+ Friend Sub SetVisibility(bValue As Boolean)
+ If bValue <> m_Visibility Then
+ m_Visibility = bValue
+ NotifyPropertyChanged(NameOf(Visibility))
+ End If
+ End Sub
+
+ ' definizione comandi
+ Private m_cmdAboutBox As ICommand
+ Private m_cmdCloseApplication As ICommand
+
+#Region "CONSTRUCTOR"
+
+ Sub New()
+ ' Creo riferimento a questa classe in Map
+ Map.SetRefSecondaryWindowVM(Me)
+ End Sub
+
+#End Region ' CONSTRUCTOR
+
+ Friend Sub ContentRendered()
+ ' Seleziono la macchina impostata nel file ini
+ Map.refMachinePanelVM.LoadCurrentMachine()
+ ' imposto SnapPoint
+ Map.refMyStatusBarVM.SetSnapPointType(Map.refSceneHostVM.SnapType)
+ Map.refMyStatusBarVM.SetMeasureUnit(EgtUiUnitsAreMM)
+ EgtSetView(VT.ISO_SW, False)
+ ' creo nuovo progetto di partenza
+ Map.refProjManagerVM.NewProject()
+ End Sub
+
+#Region "COMMANDS"
+
+#Region "CloseApplicationCommand"
+
+ ' Returns a command that manage the MainWindow_Unloaded command
+ Public ReadOnly Property CloseApplicationCommand() As ICommand
+ Get
+ If m_cmdCloseApplication Is Nothing Then
+ m_cmdCloseApplication = New Command(AddressOf CloseApplication)
+ End If
+ Return m_cmdCloseApplication
+ End Get
+ End Property
+
+ ' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
+ Public Sub CloseApplication(ByVal param As Object)
+ Map.refMainWindowVM.CloseApplication()
+ End Sub
+
+#End Region ' CloseApplicationCommand
+
+#End Region ' COMMANDS
+
+End Class
diff --git a/3dPrintApp/ShowPanel/ShowPanelV.xaml b/3dPrintApp/ShowPanel/ShowPanelV.xaml
new file mode 100644
index 0000000..73a49e0
--- /dev/null
+++ b/3dPrintApp/ShowPanel/ShowPanelV.xaml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/3dPrintApp/ShowPanel/ShowPanelV.xaml.vb b/3dPrintApp/ShowPanel/ShowPanelV.xaml.vb
new file mode 100644
index 0000000..9840677
--- /dev/null
+++ b/3dPrintApp/ShowPanel/ShowPanelV.xaml.vb
@@ -0,0 +1,3 @@
+Public Class ShowPanelV
+
+End Class
diff --git a/3dPrintApp/Special-3dPrinting/Printing3DPanelV.xaml b/3dPrintApp/Special-3dPrinting/Printing3DPanelV.xaml
new file mode 100644
index 0000000..7cffe68
--- /dev/null
+++ b/3dPrintApp/Special-3dPrinting/Printing3DPanelV.xaml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/3dPrintApp/Special-3dPrinting/Printing3DPanelV.xaml.vb b/3dPrintApp/Special-3dPrinting/Printing3DPanelV.xaml.vb
new file mode 100644
index 0000000..f216a8c
--- /dev/null
+++ b/3dPrintApp/Special-3dPrinting/Printing3DPanelV.xaml.vb
@@ -0,0 +1,3 @@
+Public Class Printing3DPanelV
+
+End Class
diff --git a/3dPrintApp/Special-3dPrinting/Printing3DPanelVM.vb b/3dPrintApp/Special-3dPrinting/Printing3DPanelVM.vb
new file mode 100644
index 0000000..08b72d6
--- /dev/null
+++ b/3dPrintApp/Special-3dPrinting/Printing3DPanelVM.vb
@@ -0,0 +1,108 @@
+Imports System.IO
+Imports EgtUILib
+Imports EgtWPFLib5
+
+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()
+ ' Inizializzo i bottoni leggendoli da file ini
+ Dim BtnIndex As Integer = 1
+ Dim CurrBtn As ButtonItem = Nothing
+ While GetPrivateProfileButton(S_PRINTING3D, K_BUTTON & BtnIndex, Map.refMainWindowVM.MainWindowM.s3dPrintingDir, CurrBtn)
+ m_ButtonList.Add(CurrBtn)
+ BtnIndex += 1
+ End While
+ End Sub
+
+End Class
+
+Public Class ButtonItem
+ Inherits VMBase
+
+ Private m_sImagePath As String
+ Public ReadOnly Property ImagePath As String
+ Get
+ Return m_sImagePath
+ End Get
+ End Property
+ Private m_sLuaCmdPath As String
+ Private m_sToolTip As String
+ Public ReadOnly Property ToolTip As String
+ Get
+ Return m_sToolTip
+ End Get
+ End Property
+ Private m_nDrawMachOrBoth As Integer
+ Public ReadOnly Property nDrawMachOrBoth As Integer
+ Get
+ Return m_nDrawMachOrBoth
+ End Get
+ End Property
+ Friend m_Btn_Visibility As Visibility
+ Public ReadOnly Property Btn_Visibility As Visibility
+ Get
+ Return m_Btn_Visibility
+ End Get
+ End Property
+
+ Friend m_Btn_IsEnabled As Boolean = True
+ Public ReadOnly Property Btn_IsEnabled As Boolean
+ Get
+ Return m_Btn_IsEnabled
+ End Get
+ End Property
+
+ ' Definizione comandi
+ Private m_cmdLuaExec As ICommand
+
+ Sub New(sLuaCmdPath As String, sImagePath As String, sToolTip As String, sDrawMachOrBoth As String)
+ If File.Exists(sImagePath) Then
+ m_sImagePath = sImagePath
+ Else
+ m_sImagePath = Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\" & sImagePath
+ End If
+ m_sLuaCmdPath = sLuaCmdPath
+ m_sToolTip = sToolTip
+ If Not Integer.TryParse(sDrawMachOrBoth, m_nDrawMachOrBoth) Then m_nDrawMachOrBoth = 0
+ End Sub
+
+#Region "COMMANDS"
+
+#Region "LuaExecCommand"
+
+ '''
+ ''' Returns a command that do New.
+ '''
+ Public ReadOnly Property LuaExecCommand As ICommand
+ Get
+ If m_cmdLuaExec Is Nothing Then
+ m_cmdLuaExec = New Command(AddressOf LuaExec)
+ End If
+ Return m_cmdLuaExec
+ End Get
+ End Property
+
+ '''
+ ''' Execute the New. This method is invoked by the NewCommand.
+ '''
+ Public Sub LuaExec(ByVal param As Object)
+ If String.IsNullOrWhiteSpace(m_sLuaCmdPath) Then Return
+ If Not File.Exists(m_sLuaCmdPath) Then Return
+ If Not Path.GetExtension(m_sLuaCmdPath).ToLower = ".lua" Then Return
+ ' eseguo file Lua
+ Map.refSceneHostVM.PreExecScript(False)
+ Map.refSceneHostVM.ExecScript(m_sLuaCmdPath)
+ End Sub
+
+#End Region ' LuaExecCommand
+
+#End Region ' Commands
+
+End Class
\ No newline at end of file
diff --git a/3dPrintApp/Special-3dPrinting/Printing3DUtility.vb b/3dPrintApp/Special-3dPrinting/Printing3DUtility.vb
new file mode 100644
index 0000000..bb3bd08
--- /dev/null
+++ b/3dPrintApp/Special-3dPrinting/Printing3DUtility.vb
@@ -0,0 +1,26 @@
+Imports EgtWPFLib5
+
+Module Printing3DUtility
+
+ Public Function GetPrivateProfileButton(sSection As String, sKey As String, sBaseDir As String, ByRef ReadedButtonItem As ButtonItem) As Boolean
+ ReadedButtonItem = Nothing
+ Dim sVal As String = String.Empty
+ GetmainPrivateProfileString(sSection, sKey, "", sVal)
+ If String.IsNullOrWhiteSpace(sVal) Then Return False
+ Dim sItems() As String = sVal.Split(",".ToCharArray)
+ If sItems.Count() >= 1 Then
+ Dim sLuaPath As String = sItems(0)
+ Dim sImagePath As String = If(sItems.Count() >= 2, sItems(1), "")
+ Dim sToolTip As String = If(sItems.Count() >= 3, sItems(2), "")
+ Dim sDrawMachOrBoth As String = If(sItems.Count() >= 4 AndAlso Not String.IsNullOrWhiteSpace(sItems(3)), sItems(3), "1")
+ If Not String.IsNullOrWhiteSpace(sBaseDir) And Not String.IsNullOrWhiteSpace(sLuaPath) Then
+ If sLuaPath.Contains(".lua") Then sLuaPath = sBaseDir & "\" & sLuaPath
+ If Not String.IsNullOrWhiteSpace(sImagePath) Then sImagePath = sBaseDir & "\" & sImagePath
+ End If
+ ReadedButtonItem = New ButtonItem(sLuaPath, sImagePath, sToolTip, sDrawMachOrBoth)
+ Return True
+ End If
+ Return False
+ End Function
+
+End Module
diff --git a/3dPrintApp/StatusBar/MyStatusBarVM.vb b/3dPrintApp/StatusBar/MyStatusBarVM.vb
new file mode 100644
index 0000000..4524b04
--- /dev/null
+++ b/3dPrintApp/StatusBar/MyStatusBarVM.vb
@@ -0,0 +1,142 @@
+Imports System.Runtime.InteropServices
+Imports System.Threading
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Public Class MyStatusBarVM
+ Inherits EgtWPFLib5.StatusBarVM
+
+ ' Funzioni di callback per output in interfaccia da LUA
+ Private m_ProcEventsCallback As New ProcessEventsCallback(AddressOf ProcessEvents)
+ Private m_OutTextCallback As New OutTextCallback(AddressOf OutText)
+
+ Private m_bStopProgress As Boolean
+ Friend ReadOnly Property bStopProgress As Boolean
+ Get
+ Return m_bStopProgress
+ End Get
+ End Property
+
+ 'Public ReadOnly Property CurrMachine As String
+ ' Get
+ ' Return If(Not IsNothing(Map.refMachinePanelVM.SelectedMachine), Map.refMachinePanelVM.SelectedMachine.Name, "")
+ ' End Get
+ 'End Property
+
+ ' Definizione comandi
+ Private m_cmdStopProgress As ICommand
+
+ Sub New()
+ ' Creo riferimento a questa classe in Map
+ Map.SetRefMyStatusBarVM(Me)
+ ' Installo funzione gestione eventi per lua
+ EgtSetProcessEvents(m_ProcEventsCallback)
+ ' Installo funzione output testo su status per lua
+ EgtSetOutText(m_OutTextCallback)
+ End Sub
+
+ Friend Overloads Sub SetSnapPointType(sSnapPntType As SP)
+ Dim BtnColor As Brush
+ BtnColor = New SolidColorBrush(SystemColors.ControlColor)
+ Select Case sSnapPntType
+ Case SP.PT_SKETCH
+ Map.refMyStatusBarVM.SetSnapPointType(EgtMsg(1102), BtnColor) 'Sketch Point
+ Case SP.PT_GRID
+ Map.refMyStatusBarVM.SetSnapPointType(EgtMsg(1104), BtnColor) 'Grid Point
+ Case SP.PT_END
+ Map.refMyStatusBarVM.SetSnapPointType(EgtMsg(1106), BtnColor) 'End Point
+ Case SP.PT_MID
+ Map.refMyStatusBarVM.SetSnapPointType(EgtMsg(1108), BtnColor) 'Mid Point
+ Case SP.CENTER
+ Map.refMyStatusBarVM.SetSnapPointType(EgtMsg(1110), BtnColor) 'Center
+ Case SP.CENTROID
+ Map.refMyStatusBarVM.SetSnapPointType(EgtMsg(1112), BtnColor) 'Centroid
+ Case SP.PT_NEAR
+ Map.refMyStatusBarVM.SetSnapPointType(EgtMsg(1114), BtnColor) 'Near Point
+ Case SP.PT_INTERS
+ Map.refMyStatusBarVM.SetSnapPointType(EgtMsg(1116), BtnColor) 'Inters Point
+ Case SP.PT_TANGENT
+ Map.refMyStatusBarVM.SetSnapPointType(EgtMsg(1118), BtnColor) 'Tang Point
+ Case SP.PT_PERPENDICULAR
+ Map.refMyStatusBarVM.SetSnapPointType(EgtMsg(1120), BtnColor) 'Perp Point
+ Case SP.PT_MINDIST
+ Map.refMyStatusBarVM.SetSnapPointType(EgtMsg(1122), BtnColor) 'MinDist Point
+ Case Else
+ Map.refMyStatusBarVM.SetSnapPointType("---", BtnColor)
+ End Select
+ End Sub
+
+ Friend Sub ResetStopProgress()
+ m_bStopProgress = False
+ End Sub
+
+ Public Function OutText(ByRef psText As IntPtr) As Boolean
+ ' Assegno stringa
+ OutputMessage = (Marshal.PtrToStringUni(psText))
+ ' Costringo ad aggiornare
+ UpdateUI()
+ Return True
+ End Function
+
+ Private Function ProcessEvents(ByVal nProg As Integer, ByVal nPause As Integer) As Integer
+ ' Se previsto, imposto progress
+ If nProg > 0 Then SetLoadingProgress(Math.Min(nProg, 100))
+ ' Costringo ad aggiornare
+ UpdateUI()
+ ' Eventuale attesa
+ Thread.Sleep(nPause)
+ ' Ritorno eventuale stop
+ If m_bStopProgress Then
+ m_bStopProgress = False
+ Return 1
+ Else
+ Return 0
+ End If
+ End Function
+
+ Friend Sub StartLoading(sMessage As String, bIsStop As Boolean)
+ Map.refMyStatusBarVM.SetLoadingProgress_Visibility(True)
+ Map.refMyStatusBarVM.SetStopProgress_IsActive(bIsStop)
+ Map.refMyStatusBarVM.SetStopProgress_IsEnabled(bIsStop)
+ Map.refMyStatusBarVM.SetOutputMessage(sMessage)
+ End Sub
+
+ Friend Sub EndLoading(sMessage As String, Optional nMessageTime As Integer = 3)
+ Map.refMyStatusBarVM.SetLoadingProgress_Visibility(False)
+ Map.refMyStatusBarVM.SetStopProgress_IsActive(False)
+ Map.refMyStatusBarVM.SetStopProgress_IsEnabled(False)
+ Map.refMyStatusBarVM.SetOutputMessage(sMessage, nMessageTime)
+ End Sub
+
+ Friend Sub RefreshMachName()
+ ' NotifyPropertyChanged(NameOf(CurrMachine))
+ End Sub
+
+#Region "COMMANDS"
+
+#Region "StopProgress"
+
+ '''
+ ''' Returns a command that do Exec.
+ '''
+ Public ReadOnly Property StopProgress_Command As ICommand
+ Get
+ If m_cmdStopProgress Is Nothing Then
+ m_cmdStopProgress = New Command(AddressOf StopProgress)
+ End If
+ Return m_cmdStopProgress
+ End Get
+ End Property
+
+ '''
+ ''' Execute the Exec. This method is invoked by the ExecCommand.
+ '''
+ Public Sub StopProgress()
+ m_bStopProgress = True
+ End Sub
+
+#End Region ' StopProgress
+
+#End Region ' COMMANDS
+
+End Class
diff --git a/3dPrintApp/StatusBar/StatusBarV.xaml b/3dPrintApp/StatusBar/StatusBarV.xaml
new file mode 100644
index 0000000..a6a1bf3
--- /dev/null
+++ b/3dPrintApp/StatusBar/StatusBarV.xaml
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/3dPrintApp/StatusBar/StatusBarV.xaml.vb b/3dPrintApp/StatusBar/StatusBarV.xaml.vb
new file mode 100644
index 0000000..03d9798
--- /dev/null
+++ b/3dPrintApp/StatusBar/StatusBarV.xaml.vb
@@ -0,0 +1,3 @@
+Public Class StatusBarV
+
+End Class
diff --git a/3dPrintApp/Themes/Generic.xaml b/3dPrintApp/Themes/Generic.xaml
new file mode 100644
index 0000000..ce5777e
--- /dev/null
+++ b/3dPrintApp/Themes/Generic.xaml
@@ -0,0 +1,19 @@
+
+
+
+
+
diff --git a/3dPrintApp/TopPanel/TopPanelV.xaml b/3dPrintApp/TopPanel/TopPanelV.xaml
new file mode 100644
index 0000000..0234b92
--- /dev/null
+++ b/3dPrintApp/TopPanel/TopPanelV.xaml
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/3dPrintApp/TopPanel/TopPanelV.xaml.vb b/3dPrintApp/TopPanel/TopPanelV.xaml.vb
new file mode 100644
index 0000000..566a343
--- /dev/null
+++ b/3dPrintApp/TopPanel/TopPanelV.xaml.vb
@@ -0,0 +1,3 @@
+Public Class TopPanelV
+
+End Class
diff --git a/3dPrintApp/TopPanel/TopPanelVM.vb b/3dPrintApp/TopPanel/TopPanelVM.vb
new file mode 100644
index 0000000..43953a1
--- /dev/null
+++ b/3dPrintApp/TopPanel/TopPanelVM.vb
@@ -0,0 +1,6 @@
+Imports EgtWPFLib5
+
+Public Class TopPanelVM
+ Inherits VMBase
+
+End Class
diff --git a/3dPrintApp/Utility/BTLIniFile.vb b/3dPrintApp/Utility/BTLIniFile.vb
new file mode 100644
index 0000000..0e5c96f
--- /dev/null
+++ b/3dPrintApp/Utility/BTLIniFile.vb
@@ -0,0 +1,173 @@
+'----------------------------------------------------------------------------
+' EgalTech 2017-2017
+'----------------------------------------------------------------------------
+' File : IniFile.vb Data : 08.04.17 Versione : 1.8d1
+' Contenuto : Modulo IniFile per gestione lettura/scrittura da file INI.
+'
+'
+'
+' Modifiche : 08.04.17 ES Creazione modulo.
+'
+'
+'----------------------------------------------------------------------------
+
+Imports System.Collections.ObjectModel
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Public Module BTLIniFile
+
+ Public m_sBTLIniFile As String
+
+ Public Function GetBeamPrivateProfileProcessList(IpGRPType As GRPType, ByRef IpProcessList As ObservableCollection(Of Integer)) As Boolean
+ Dim PRCList As New ObservableCollection(Of Integer)
+ Dim sProcess As String = String.Empty
+ If EgtUILib.GetPrivateProfileString(PROCESSINGS, IpGRPType, String.Empty, sProcess, m_sBTLIniFile) > 0 Then
+ Dim sProcesses() As String = sProcess.Split(","c)
+ ' verifico ce ne sia almeno uno
+ If sProcesses.Count >= 0 Then
+ ' cancello spazi
+ For Index = 0 To sProcesses.Count - 1
+ sProcesses(Index) = sProcesses(Index).Trim()
+ Dim nProcess As Integer
+ Integer.TryParse(sProcesses(Index), nProcess)
+ PRCList.Add(nProcess)
+ Next
+ IpProcessList = PRCList
+ Return True
+ End If
+ End If
+ Return False
+ End Function
+
+ Public Function GetBeamPrivateProfileGRPList(IpGRP As Integer, IpPRC As Integer, ByRef IpGRPList As ObservableCollection(Of Integer)) As Boolean
+ IpGRPList.Clear()
+ ' ciclo sui tipi di gruppo
+ Dim sBTLGroup As String = String.Empty
+ If EgtUILib.GetPrivateProfileString(IpGRP & "." & IpPRC, BTL_FTR_GRP, String.Empty, sBTLGroup, m_sBTLIniFile) > 0 Then
+ Dim sBTLGroups() As String = sBTLGroup.Split(","c)
+ ' verifico numero minimo di parametri
+ If sBTLGroups.Count >= 0 Then
+ ' cancello spazi
+ For Index = 0 To sBTLGroups.Count - 1
+ sBTLGroups(Index) = sBTLGroups(Index).Trim()
+ Next
+ ' creo parametro
+ For Each Group In sBTLGroups
+ Dim nGroup As Integer = -1
+ Integer.TryParse(Group, nGroup)
+ If IpGRP = GRPType.L And (nGroup = 0 OrElse nGroup = 3 OrElse nGroup = 4) Then
+ IpGRPList.Add(nGroup)
+ ElseIf IpGRP = GRPType.T And (nGroup = 1 OrElse nGroup = 2) Then
+ IpGRPList.Add(nGroup)
+ End If
+ Next
+ End If
+ End If
+ Return IpGRPList.Count > 0
+ End Function
+
+ 'Public Function GetBeamPrivateProfileVerifyGRP(IpAppName As String, IpGPRtoVerify As String) As Boolean
+ ' ' ciclo sui tipi di gruppo
+ ' Dim sBTLGroup As String = String.Empty
+ ' If EgtUILib.GetPrivateProfileString(IpAppName, BTL_FTR_GRP, String.Empty, sBTLGroup, m_sBTLIniFile) > 0 Then
+ ' Dim sBTLGroups() As String = sBTLGroup.Split(","c)
+ ' ' verifico numero minimo di parametri
+ ' If sBTLGroups.Count >= 0 Then
+ ' ' cancello spazi
+ ' For Index = 0 To sBTLGroups.Count - 1
+ ' sBTLGroups(Index) = sBTLGroups(Index).Trim()
+ ' Next
+ ' End If
+ ' Return sBTLGroups.Contains(IpGPRtoVerify)
+ ' End If
+ ' Return False
+ 'End Function
+
+ Public Function CalcBeamPrivateProfileGRP(nGRP As Integer) As Integer
+ If nGRP = 1 Or nGRP = 2 Then
+ Return 1
+ ElseIf nGRP = 0 Or nGRP = 3 Or nGRP = 4 Then
+ Return 0
+ Else
+ Return nGRP
+ End If
+ End Function
+
+ Public Function GetBeamPrivateProfileName(IpGRP As Integer, IpPRC As Integer, ByRef IpBTLFeature As BTLFeatureVM) As Boolean
+ Dim sBTLName As String = String.Empty
+ ' creo lista GRP e leggo nome
+ If EgtUILib.GetPrivateProfileString(CalcBeamPrivateProfileGRP(IpGRP) & "." & IpPRC, BTL_FTR_NAME, String.Empty, sBTLName, m_sBTLIniFile) > 0 Then
+ ' verifico numero minimo di parametri
+ If Not String.IsNullOrEmpty(sBTLName) Then
+ Dim nNameMsg As Integer
+ Integer.TryParse(sBTLName, nNameMsg)
+ IpBTLFeature.SetName(EgtMsg(nNameMsg))
+ Return True
+ End If
+ End If
+ Return False
+ End Function
+
+ Public Function GetBeamPrivateProfileName(IpGRP As Integer, IpPRC As Integer) As String
+ Dim sBTLName As String = String.Empty
+ ' creo lista GRP e leggo nome
+ If EgtUILib.GetPrivateProfileString(CalcBeamPrivateProfileGRP(IpGRP) & "." & IpPRC, BTL_FTR_NAME, String.Empty, sBTLName, m_sBTLIniFile) > 0 Then
+ ' verifico numero minimo di parametri
+ If Not String.IsNullOrEmpty(sBTLName) Then
+ Dim nNameMsg As Integer
+ Integer.TryParse(sBTLName, nNameMsg)
+ Return EgtMsg(nNameMsg)
+ Return True
+ End If
+ End If
+ Return ""
+ End Function
+
+ Public Function GetBeamPrivateProfileParam(IpGRP As Integer, IpPRC As Integer, IsP As Boolean, IpFeatureParamIndex As String, IpParentFeature As BTLFeatureVM, ByRef IpBTLParam As BTLParamVM) As Boolean
+ Dim sBTLParam As String = String.Empty
+ If EgtUILib.GetPrivateProfileString(CalcBeamPrivateProfileGRP(IpGRP) & "." & IpPRC, If(IsP, "P", "Q") & IpFeatureParamIndex, String.Empty, sBTLParam, m_sBTLIniFile) > 0 Then
+ Dim sBTLParamParams() As String = sBTLParam.Split(","c)
+ ' verifico numero minimo di parametri
+ If sBTLParamParams.Count >= 6 Then
+ ' cancello spazi
+ For Index = 0 To sBTLParamParams.Count - 1
+ sBTLParamParams(Index) = sBTLParamParams(Index).Trim()
+ Next
+ ' creo parametro
+ If sBTLParamParams(0) = "d" OrElse sBTLParamParams(0) = "l" Then
+ Dim dMin As Double
+ Dim dMax As Double
+ Dim dDefault As Double
+ StringToDouble(sBTLParamParams(2), dMin)
+ StringToDouble(sBTLParamParams(3), dMax)
+ StringToDouble(sBTLParamParams(4), dDefault)
+ Dim ParamType As BTLParamType
+ If sBTLParamParams(0) = "d" Then
+ ParamType = BTLParamType.DOUBLE_
+ Else
+ ParamType = BTLParamType.LENGTH
+ End If
+ IpBTLParam = New BTLParamVM(IpParentFeature, IsP, ParamType, sBTLParamParams(1), dMin, dMax, dDefault, sBTLParamParams(5))
+ Return Not IsNothing(IpBTLParam)
+ ElseIf sBTLParamParams(0) = "s" Then
+ IpBTLParam = New BTLParamVM(IpParentFeature, IsP, BTLParamType.STRING_, sBTLParamParams(1), sBTLParamParams(5))
+ Return Not IsNothing(IpBTLParam)
+ ElseIf sBTLParamParams(0) = "c" Then
+ Dim nMin As Integer
+ Dim nMax As Integer
+ Dim nDefault As Integer
+ Integer.TryParse(sBTLParamParams(2), nMin)
+ Integer.TryParse(sBTLParamParams(3), nMax)
+ Integer.TryParse(sBTLParamParams(4), nDefault)
+ ' recupero lista valori
+ Dim ValueList As New List(Of String)
+ IpBTLParam = New BTLParamVM(IpParentFeature, IsP, BTLParamType.COMBO, sBTLParamParams(1), nMin, nMax, nDefault, sBTLParamParams(5), ValueList)
+ Return Not IsNothing(IpBTLParam)
+ End If
+ End If
+ End If
+ Return False
+ End Function
+
+End Module
diff --git a/3dPrintApp/Utility/Converters.vb b/3dPrintApp/Utility/Converters.vb
new file mode 100644
index 0000000..529bf8b
--- /dev/null
+++ b/3dPrintApp/Utility/Converters.vb
@@ -0,0 +1,18 @@
+
+Public Class PQVisibilityConverter
+ Implements IValueConverter
+
+ Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.Convert
+ Select Case CStr(value)
+ Case "Q"
+ Return Visibility.Visible
+ Case Else
+ Return Visibility.Collapsed
+ End Select
+ End Function
+
+ Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack
+ Throw New NotImplementedException
+ End Function
+
+End Class
diff --git a/3dPrintApp/Utility/CurrentMachine.vb b/3dPrintApp/Utility/CurrentMachine.vb
new file mode 100644
index 0000000..82775e8
--- /dev/null
+++ b/3dPrintApp/Utility/CurrentMachine.vb
@@ -0,0 +1,96 @@
+Imports System.Collections.ObjectModel
+Imports System.IO
+Imports EgtBEAMWALL.Core
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Public Module CurrentMachine
+
+ ' Nome macchina corrente
+ Private m_sMachineName As String = String.Empty
+ ' Direttorio macchina corrente
+ Private m_sMachDir As String = String.Empty
+ ' File ini della macchina
+ Private m_sMachIniFile As String = String.Empty
+
+ ' box della tavola macchina
+ Private m_b3Tab As New BBox3d
+ Friend ReadOnly Property b3Tab As BBox3d
+ Get
+ Return m_b3Tab
+ End Get
+ End Property
+#Region "Proprietà che leggono e scrivono i valori anche da o su file ini"
+
+ Friend ReadOnly Property sMachineName As String
+ Get
+ Return m_sMachineName
+ End Get
+ End Property
+
+ Friend ReadOnly Property sMachDir As String
+ Get
+ Return m_sMachDir
+ End Get
+ End Property
+
+ Friend ReadOnly Property sMachIniFile As String
+ Get
+ Return m_sMachIniFile
+ End Get
+ End Property
+
+#End Region
+
+#Region "Init"
+
+ Sub InitCurrentMachine(sMachinesRootDir As String, sMachineName As String)
+ ' Nome macchina corrente
+ m_sMachineName = sMachineName
+ ' Impostazione direttorio macchina
+ m_sMachDir = sMachinesRootDir & "\" & sMachineName
+ ' Impostazione path MachIni file
+ m_sMachIniFile = sMachinesRootDir & "\" & sMachineName & "\" & sMachineName & ".ini"
+ ' Disabilito segnalazione modificato
+ Dim DisableMgr As New DisableModifiedMgr
+ ' recupero box macchina
+ Dim nQqqId = EgtAddMachGroup("qqq")
+ EgtSetTable("Tab")
+ EgtGetTableArea(1, m_b3Tab)
+ EgtRemoveMachGroup(nQqqId Or GDB_ID.NULL)
+ ' Ripristino stato segnalazione modifica
+ DisableMgr.ReEnable()
+ End Sub
+
+#End Region 'Init
+
+#Region "Methods"
+
+ Public Sub CreateMachineTable()
+ ' Disabilito segnalazione modificato
+ Dim DisableMgr As New DisableModifiedMgr
+ ' Recupero dati tavola (creando gruppo di lavoro temporaneo)
+ Dim nTempId = EgtAddMachGroup("qqq")
+ EgtSetTable("Tab")
+ Dim b3Tab As New BBox3d
+ EgtGetTableArea(1, b3Tab)
+ Dim dTabX = b3Tab.DimX
+ Dim dTabY = b3Tab.DimY()
+ EgtRemoveMachGroup(nTempId)
+ ' Disegno tavola
+ Dim nTabPartId As Integer = EgtCreateGroup(GDB_ID.ROOT)
+ EgtSetLevel(nTabPartId, GDB_LV.SYSTEM)
+ EgtSetMode(nTabPartId, GDB_MD.LOCKED)
+ EgtSetStatus(nTabPartId, GDB_ST.ON_)
+ EgtSetName(nTabPartId, "TABLE")
+ Dim nTabLayerId As Integer = EgtCreateGroup(nTabPartId)
+ EgtSetName(nTabLayerId, "TABLE")
+ Dim nTabOutlineId As Integer = EgtCreateRectangle2P(nTabLayerId, New Point3d(0, 0, 0), New Point3d(dTabX, dTabY, 0))
+ EgtSetName(nTabOutlineId, "TABLE_OUTLINE")
+ ' Ripristino stato segnalazione modifica
+ DisableMgr.ReEnable()
+ End Sub
+
+#End Region 'Methods
+
+End Module
diff --git a/3dPrintApp/Utility/DbControllers.vb b/3dPrintApp/Utility/DbControllers.vb
new file mode 100644
index 0000000..cd37a86
--- /dev/null
+++ b/3dPrintApp/Utility/DbControllers.vb
@@ -0,0 +1,67 @@
+Imports EgtUILib
+Imports EgtWPFLib5
+Imports EgtBEAMWALL.Core
+Imports EgtBEAMWALL.ViewerOptimizer
+
+Public Module DbControllers
+
+ Friend m_SupervisorId As String = "1"
+
+ Public m_ProjController As DataLayer.Controllers.ProjController
+ Public m_ProdController As DataLayer.Controllers.ProdController
+ Public m_MachGroupController As DataLayer.Controllers.MachGroupController
+ Public m_StatusMapController As DataLayer.Controllers.StatusMapController
+ Public m_PartController As DataLayer.Controllers.PartController
+
+ Sub Init()
+ End Sub
+
+ Sub New()
+
+ ' se demo--> server = db.steamware.net, nKey e sKey come le hai...
+
+ Dim sKey = "", sUser = "", sPwd = ""
+
+ EgtGetKeyInfo(sKey)
+ sKey = sKey.Replace(" ", "")
+ If Not IsNothing(sKey) AndAlso sKey.Length > 11 Then
+ sUser = sKey.Substring(3, 6)
+ sPwd = sKey.Substring(10, sKey.Length - 10).Replace("(", "").Replace(")", "")
+ End If
+ Try
+ Dim DbAddress As String = "127.0.0.1"
+ Dim DbMasterKey As Integer = 0
+ Dim sDbMasterKey As String = ""
+ If Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK) Then
+ GetMainPrivateProfileString(S_GENERAL, K_DBADDRESS, "127.0.0.1", DbAddress)
+ DbMasterKey = GetMainPrivateProfileInt(S_GENERAL, K_DBMASTERKEY, 0)
+ If DbMasterKey > 0 Then
+ sDbMasterKey = DbMasterKey.ToString("000000")
+ End If
+ If String.IsNullOrWhiteSpace(DbAddress) OrElse DbMasterKey <= 0 Then
+ DbAddress = "127.0.0.1"
+ DbMasterKey = 0
+ End If
+ End If
+ DataLayer.DbConfig.InitDb(DbAddress, sUser, sPwd, sDbMasterKey)
+ DataLayer.DbConfig.CheckUser(sUser, sPwd, Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK))
+ Catch ex As Exception
+ EgtOutLog("InitDb error: " & ex.ToString())
+ MessageBox.Show(Application.Current.MainWindow, "Db connection error!!", "Error")
+ End
+ End Try
+
+ If Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK) Then
+ Dim sSupervisorMachName As String = ""
+ GetMainPrivateProfileString(S_MACH, K_SUPERVISORMACH, "", sSupervisorMachName)
+ If Not String.IsNullOrWhiteSpace(sSupervisorMachName) Then m_SupervisorId = sSupervisorMachName
+ End If
+
+ m_ProjController = New DataLayer.Controllers.ProjController
+ m_ProdController = New DataLayer.Controllers.ProdController
+ m_MachGroupController = New DataLayer.Controllers.MachGroupController
+ m_StatusMapController = New DataLayer.Controllers.StatusMapController
+ m_PartController = New DataLayer.Controllers.PartController
+ End Sub
+
+End Module
diff --git a/3dPrintApp/Utility/Dictionary.xaml b/3dPrintApp/Utility/Dictionary.xaml
new file mode 100644
index 0000000..515dfc6
--- /dev/null
+++ b/3dPrintApp/Utility/Dictionary.xaml
@@ -0,0 +1,841 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ None
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/3dPrintApp/Utility/Dictionary.xaml.vb b/3dPrintApp/Utility/Dictionary.xaml.vb
new file mode 100644
index 0000000..fef4e3b
--- /dev/null
+++ b/3dPrintApp/Utility/Dictionary.xaml.vb
@@ -0,0 +1,30 @@
+Public Class OmagOFFICEDictionary
+
+ Public Shared ReadOnly MySceneHostVM As String = "MySceneHostVM"
+
+#Region "Colors"
+
+ Private m_Omag_Red As SolidColorBrush = Brushes.Red
+ Public ReadOnly Property Omag_Red As SolidColorBrush
+ Get
+ Return m_Omag_Red
+ End Get
+ End Property
+
+ Private Shared m_Button_Static_Background As SolidColorBrush = New BrushConverter().ConvertFrom("#FFDDDDDD")
+ Public Shared ReadOnly Property Button_Static_Background As SolidColorBrush
+ Get
+ Return m_Button_Static_Background
+ End Get
+ End Property
+
+ Private Shared m_TabControl_Header_Background As LinearGradientBrush = Application.Current.FindResource("TabItem.Static.Background")
+ Public Shared ReadOnly Property TabControl_Header_Background As LinearGradientBrush
+ Get
+ Return m_TabControl_Header_Background
+ End Get
+ End Property
+
+#End Region ' Colors
+
+End Class
diff --git a/3dPrintApp/Utility/DisableModifiedMgr.vb b/3dPrintApp/Utility/DisableModifiedMgr.vb
new file mode 100644
index 0000000..e4d6a67
--- /dev/null
+++ b/3dPrintApp/Utility/DisableModifiedMgr.vb
@@ -0,0 +1,16 @@
+Imports EgtUILib
+
+Public Class DisableModifiedMgr
+
+ Private m_bOldEnMod As Boolean
+
+ Sub New()
+ m_bOldEnMod = EgtGetEnableModified()
+ If m_bOldEnMod Then EgtDisableModified()
+ End Sub
+
+ Public Sub ReEnable()
+ If m_bOldEnMod Then EgtEnableModified()
+ End Sub
+
+End Class
diff --git a/3dPrintApp/Utility/LuaExec.vb b/3dPrintApp/Utility/LuaExec.vb
new file mode 100644
index 0000000..43df526
--- /dev/null
+++ b/3dPrintApp/Utility/LuaExec.vb
@@ -0,0 +1,209 @@
+Imports EgtBEAMWALL.Core
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Module LuaExec
+
+ Friend Function ExecBeam(sFile As String, sMachine As String, nFlag As Integer, bBtl As Boolean) As Boolean
+ EgtOutLog("-- Start ExecBeam --")
+ ' Recupero lo script da eseguire
+ Dim sExecPath As String = ""
+ Dim sExecName As String = ""
+ GetMainPrivateProfileString(S_BEAM, K_BEAMBWEEXEC, "", sExecName)
+ sExecPath = (Map.refMainWindowVM.MainWindowM.sBeamRoot & "\" & sExecName).TrimEnd({"\"c})
+ If Not My.Computer.FileSystem.FileExists(sExecPath) Then
+ EgtOutLog("Not found BeamExec script " & sExecPath)
+ Return False
+ End If
+ ' Assegno i dati
+ EgtLuaCreateGlobTable("BEAM")
+ EgtLuaSetGlobStringVar("BEAM.BASEDIR", Map.refMainWindowVM.MainWindowM.sBeamRoot)
+ EgtLuaSetGlobStringVar("BEAM.FILE", sFile)
+ EgtLuaSetGlobStringVar("BEAM.MACHINE", sMachine)
+ EgtLuaSetGlobIntVar("BEAM.FLAG", nFlag)
+ ' Eseguo lo script
+ Dim bOk As Boolean = False
+ If EgtLuaExecFile(sExecPath) Then
+ ' Recupero i risultati
+ Dim nErr As Integer = 999
+ EgtLuaGetGlobIntVar("BEAM.ERR", nErr)
+ bOk = (nErr <= 0)
+ If Not bOk Then EgtOutLog("BeamExec Err=" & nErr.ToString())
+ Else
+ EgtOutLog("Error executing Beam Exec script " & sExecPath)
+ Return False
+ End If
+ ' Cancello tavola globale
+ EgtLuaResetGlobVar("BEAM")
+ Return bOk
+ End Function
+
+ Friend Function ExecWall(sFile As String, sMachine As String, nFlag As Integer, bBtl As Boolean, bNestingCornerBL As Boolean) As Boolean
+ EgtOutLog("-- Start ExecWall --")
+ ' Recupero lo script da eseguire
+ Dim sExecPath As String = ""
+ Dim sExecName As String = ""
+ GetMainPrivateProfileString(S_WALL, K_WALLBWEEXEC, "", sExecName)
+ sExecPath = (Map.refMainWindowVM.MainWindowM.sWallRoot & "\" & sExecName).TrimEnd({"\"c})
+ If Not My.Computer.FileSystem.FileExists(sExecPath) Then
+ EgtOutLog("Not found WallExec script " & sExecPath)
+ Return False
+ End If
+ ' Assegno i dati
+ EgtLuaCreateGlobTable("WALL")
+ EgtLuaSetGlobStringVar("WALL.BASEDIR", Map.refMainWindowVM.MainWindowM.sWallRoot)
+ EgtLuaSetGlobStringVar("WALL.FILE", sFile)
+ EgtLuaSetGlobStringVar("WALL.MACHINE", sMachine)
+ EgtLuaSetGlobIntVar("WALL.FLAG", nFlag)
+ EgtLuaSetGlobBoolVar("WALL.NESTINGCORNERBL", bNestingCornerBL)
+ ' Eseguo lo script
+ Dim bOk As Boolean = False
+ If EgtLuaExecFile(sExecPath) Then
+ ' Recupero i risultati
+ Dim nErr As Integer = 999
+ EgtLuaGetGlobIntVar("WALL.ERR", nErr)
+ bOk = (nErr <= 0)
+ If Not bOk Then EgtOutLog("WallExec Err=" & nErr.ToString())
+ Else
+ bOk = False
+ EgtOutLog("Error executing Wall Exec script " & sExecPath)
+ End If
+ ' Cancello tavola globale
+ EgtLuaResetGlobVar("WALL")
+ Return bOk
+ End Function
+
+ Friend Function ExecNesting(sFile As String, sMachine As String, PartList As List(Of BTLPartM), SectionList As List(Of SParam), dStartOffset As Double, dOffset As Double, dKerf As Double, bLDIntersOther As Boolean, nMinScore As Integer, nNestTime As Integer) As Boolean
+ If PartList.Count = 0 Then
+ EgtOutLog("Exit nesting: no parts received!")
+ Return True
+ End If
+ EgtOutLog("-- Start ExecNest --")
+ ' Recupero lo script da eseguire
+ Dim sExecPath As String = ""
+ Dim sExecName As String = ""
+ GetMainPrivateProfileString(S_NEST, K_NESTEXEC, "", sExecName)
+ Dim sRoot As String = ""
+ If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then
+ sRoot = Map.refMainWindowVM.MainWindowM.sBeamRoot
+ ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
+ sRoot = Map.refMainWindowVM.MainWindowM.sWallRoot
+ End If
+ sExecPath = (sRoot & "\" & sExecName).TrimEnd({"\"c})
+ If Not My.Computer.FileSystem.FileExists(sExecPath) Then
+ EgtOutLog("Not found NestExec script " & sExecPath)
+ Return False
+ End If
+ ' Assegno i dati
+ EgtLuaCreateGlobTable("NEST")
+ EgtLuaSetGlobStringVar("NEST.BASEDIR", sRoot)
+ EgtLuaSetGlobStringVar("NEST.FILE", sFile)
+ EgtLuaSetGlobStringVar("NEST.MACHINE", sMachine)
+ 'EgtLuaSetGlobNumVar("NEST.LEN", dLength)
+ 'EgtLuaSetGlobNumVar("NEST.WIDTH", dWidth)
+ EgtLuaSetGlobNumVar("NEST.STARTOFFSET", dStartOffset)
+ EgtLuaSetGlobNumVar("NEST.OFFSET", dOffset)
+ EgtLuaSetGlobNumVar("NEST.KERF", dKerf)
+ EgtLuaSetGlobNumVar("NEST.DRILL_MACH_AREA", If(bLDIntersOther, 1, 0))
+ EgtLuaSetGlobNumVar("NEST.MIN_ANGLE_PNT", nMinScore)
+ Dim nNestCorner As Integer
+ Select Case CurrentMachine.NestingCorner
+ Case MCH_CR.TL
+ nNestCorner = 1
+ Case MCH_CR.TR
+ nNestCorner = 3
+ Case MCH_CR.BL
+ nNestCorner = 0
+ Case MCH_CR.BR
+ nNestCorner = 2
+ End Select
+ EgtLuaSetGlobNumVar("NEST.CORNER", nNestCorner)
+ EgtLuaSetGlobStringVar("NEST.MATERIAL", PartList(0).sMATERIAL)
+ 'EgtLuaSetGlobNumVar("NEST.QTY", nQty)
+ EgtLuaSetGlobNumVar("NEST.TIME", nNestTime)
+ EgtLuaSetGlobNumVar("NEST.PRODID", Map.refProdManagerVM.CurrProd.nProdId)
+ EgtLuaCreateGlobTable("PART")
+ For PartIndex = 0 To PartList.Count - 1
+ EgtLuaSetGlobIntVar("PART." & PartList(PartIndex).nPartId.ToString(), PartList(PartIndex).m_nCNT + PartList(PartIndex).m_nADDED - PartList(PartIndex).nINPROD)
+ Next
+ EgtLuaCreateGlobTable("LEN")
+ For SectionIndex = 0 To SectionList.Count - 1
+ EgtLuaSetGlobNumVar("LEN." & SectionIndex + 1, SectionList(SectionIndex).dL)
+ Next
+ EgtLuaCreateGlobTable("WIDTH")
+ For SectionIndex = 0 To SectionList.Count - 1
+ EgtLuaSetGlobNumVar("WIDTH." & SectionIndex + 1, SectionList(SectionIndex).dW)
+ Next
+ EgtLuaCreateGlobTable("QTY")
+ For SectionIndex = 0 To SectionList.Count - 1
+ EgtLuaSetGlobNumVar("QTY." & SectionIndex + 1, SectionList(SectionIndex).nQuantity)
+ Next
+ EgtLuaCreateGlobTable("MATERIAL")
+ For SectionIndex = 0 To SectionList.Count - 1
+ EgtLuaSetGlobStringVar("MATERIAL." & SectionIndex + 1, SectionList(SectionIndex).SectXMat.sSectionXMaterial)
+ Next
+ ' Eseguo lo script
+ Dim bOk As Boolean = False
+ If EgtLuaExecFile(sExecPath) Then
+ ' Recupero i risultati
+ Dim nErr As Integer = 999
+ EgtLuaGetGlobIntVar("NEST.ERR", nErr)
+ bOk = (nErr <= 0)
+ If Not bOk Then EgtOutLog("NestExec Err=" & nErr.ToString())
+ Else
+ bOk = False
+ EgtOutLog("Error executing Nest Exec script " & sExecPath)
+ End If
+ ' Cancello tavola globale
+ EgtLuaResetGlobVar("NEST")
+ EgtLuaResetGlobVar("PART")
+ EgtLuaResetGlobVar("LEN")
+ EgtLuaResetGlobVar("WIDTH")
+ EgtLuaResetGlobVar("QTY")
+ EgtLuaResetGlobVar("MATERIAL")
+ Return bOk
+ End Function
+
+ Friend Function ExecRotFlip(nPartId As Integer) As Boolean
+ If IsNothing(nPartId) OrElse nPartId = GDB_ID.NULL Then
+ EgtOutLog("Exit nesting: no parts received!")
+ Return True
+ End If
+ EgtOutLog("-- Start ExecFlipRot --")
+ ' Recupero lo script da eseguire
+ Dim sExecPath As String = ""
+ Dim sExecName As String = ""
+ GetMainPrivateProfileString(S_NEST, K_FLIPROT, "", sExecName)
+ Dim sRoot As String = ""
+ If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then
+ sRoot = Map.refMainWindowVM.MainWindowM.sBeamRoot
+ ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
+ sRoot = Map.refMainWindowVM.MainWindowM.sWallRoot
+ End If
+ sExecPath = (sRoot & "\" & sExecName).TrimEnd({"\"c})
+ If Not My.Computer.FileSystem.FileExists(sExecPath) Then
+ EgtOutLog("Not found NestExec script " & sExecPath)
+ Return False
+ End If
+ ' Assegno i dati
+ EgtLuaCreateGlobTable("NFAR")
+ EgtLuaSetGlobStringVar("NFAR.BASEDIR", sRoot)
+ EgtLuaSetGlobStringVar("NFAR.PARTID", nPartId)
+ ' Eseguo lo script
+ Dim bOk As Boolean = False
+ If EgtLuaExecFile(sExecPath) Then
+ ' Recupero i risultati
+ Dim nErr As Integer = 999
+ EgtLuaGetGlobIntVar("NFAR.ERR", nErr)
+ bOk = (nErr <= 0)
+ If Not bOk Then EgtOutLog("FlipRot Err=" & nErr.ToString())
+ Else
+ bOk = False
+ EgtOutLog("Error executing Nest FlipRot script " & sExecPath)
+ End If
+ ' Cancello tavola globale
+ EgtLuaResetGlobVar("NFAR")
+ Return bOk
+ End Function
+
+End Module
diff --git a/3dPrintApp/Utility/MachParamIniFile.vb b/3dPrintApp/Utility/MachParamIniFile.vb
new file mode 100644
index 0000000..59a55fb
--- /dev/null
+++ b/3dPrintApp/Utility/MachParamIniFile.vb
@@ -0,0 +1,70 @@
+Imports System.Collections.ObjectModel
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Friend Module MachParamIniFile
+
+ Public Function GetMachPrivateProfileParam(IpParentTable As Integer, IpMachParamIndex As String, ByRef IpMachParam As MachParam, TableName As String, bTs3dataLoaded As Boolean) As Boolean
+ Dim sMachParam As String = String.Empty
+ If EgtUILib.GetPrivateProfileString(IpParentTable, IpMachParamIndex, String.Empty, sMachParam, sMachParamIniFile) > 0 Then
+ Dim sMachParamParams() As String = sMachParam.Split(","c)
+ ' verifico numero minimo di parametri
+ If sMachParamParams.Count >= 4 Then
+ ' cancello spazi
+ For Index = 0 To sMachParamParams.Count - 1
+ sMachParamParams(Index) = sMachParamParams(Index).Trim()
+ Next
+ ' creo parametro
+ If sMachParamParams(0) = "d" OrElse sMachParamParams(0) = "l" Then
+ Dim dDefault As Double
+ StringToDouble(sMachParamParams(2), dDefault)
+ Dim ParamType As MachParamType
+ If sMachParamParams(0) = "d" Then
+ ParamType = MachParamType.DOUBLE_
+ Else
+ ParamType = MachParamType.LENGTH
+ End If
+ If bTs3dataLoaded Then
+ Dim dTs3DataValue As Double
+ If EgtLuaGetGlobNumVar(TableName & "." & sMachParamParams(1), dTs3DataValue) Then
+ dDefault = dTs3DataValue
+ End If
+ End If
+ IpMachParam = New MachParam(IpParentTable, IpMachParamIndex, ParamType, sMachParamParams(1), dDefault, sMachParamParams(3))
+ Return Not IsNothing(IpMachParam)
+ ElseIf sMachParamParams(0) = "s" Then
+ IpMachParam = New MachParam(IpParentTable, IpMachParamIndex, MachParamType.STRING_, sMachParamParams(1), sMachParamParams(3))
+ Return Not IsNothing(IpMachParam)
+ End If
+ End If
+ End If
+ Return False
+ End Function
+
+ Public Function GetMachPrivateProfileString(IpAppName As String, IpKeyName As String, IpDefault As String, ByRef IpString As String) As Integer
+ Return EgtUILib.GetPrivateProfileString(IpAppName, IpKeyName, IpDefault, IpString, sMachParamIniFile)
+ End Function
+
+ Public Function GetMachPrivateProfileParamValue(IpParentTable As Integer, IpMachParamIndex As String, ByRef IpMachParamValue As String) As Boolean
+ Dim sMachParam As String = String.Empty
+ If EgtUILib.GetPrivateProfileString(IpParentTable, IpMachParamIndex, String.Empty, sMachParam, sMachParamIniFile) > 0 Then
+ Dim sMachParamParams() As String = sMachParam.Split(","c)
+ ' verifico numero minimo di parametri
+ If sMachParamParams.Count >= 4 Then
+ ' cancello spazi
+ For Index = 0 To sMachParamParams.Count - 1
+ sMachParamParams(Index) = sMachParamParams(Index).Trim()
+ Next
+ 'restituisco il valore del parametro
+ IpMachParamValue = sMachParamParams(2)
+ Return Not IsNothing(IpMachParamValue)
+ End If
+ End If
+ Return False
+ End Function
+
+ Public Function WriteMachPrivateProfileString(IpAppName As String, IpKeyName As String, ByRef IpString As String) As Boolean
+ Return EgtUILib.WritePrivateProfileString(IpAppName, IpKeyName, IpString, sMachParamIniFile)
+ End Function
+
+End Module
\ No newline at end of file
diff --git a/3dPrintApp/Utility/Map.vb b/3dPrintApp/Utility/Map.vb
new file mode 100644
index 0000000..d3d0508
--- /dev/null
+++ b/3dPrintApp/Utility/Map.vb
@@ -0,0 +1,537 @@
+Imports EgtWPFLib5
+
+Module Map
+
+ Private m_refMainWindowVM As MainWindowVM
+ Private m_refMyStatusBarVM As MyStatusBarVM
+ Private m_refProjManagerVM As ProjManagerVM
+ 'Private m_refProdManagerVM As ProdManagerVM
+ Private m_refProjectVM As ProjectVM
+ Private m_refSecondaryWindowVM As SecondaryWindowVM
+ Private m_refSecondaryWindowV As SecondaryWindowV
+ 'Private m_refMainMenuVM As MainMenuVM
+ Private m_refMachinePanelVM As MachinePanelVM
+ ''Private m_refMyMachGroupPanelVM As MyMachGroupPanelVM
+ 'Private m_refLeftPanelVM As LeftPanelVM
+ 'Private m_refBottomPanelVM As BottomPanelVM
+ 'Private m_refShowBeamPanelVM As ShowBeamPanelVM
+ 'Private m_refConfigurationPageVM As ConfigurationPageVM
+ 'Private m_refRawPartListVM As RawPartListVM
+ 'Private m_refPartInRawPartListVM As PartInRawPartListVM
+ 'Private m_refWarehouseWndVM As WarehouseWndVM
+ 'Private m_refFeatureListVM As FeatureListVM
+ 'Private m_refFreeContourManagerVM As FreeContourManagerVM
+ 'Private m_refFreeContourInputVM As FreeContourInputVM
+ 'Private m_refPartManagerVM As PartManagerVM
+ Private m_refInstrumentPanelVM As InstrumentPanelVM
+ 'Private m_refTopPanelVM As TopPanelVM
+ 'Private m_refOptimizePanelVM As OptimizePanelVM
+ 'Private m_refCALCPanelVM As CALCPanelVM
+ 'Private m_refPartListVM As BTLPartListVM
+ 'Private m_refFeatureInPartInRawPartListVM As FeatureInPartInRawPartListVM
+ 'Private m_refStatisticsVM As StatisticsVM
+ 'Private m_refPParameterListVM As PParameterListVM
+ 'Private m_refQParameterListVM As QParameterListVM
+ 'Private m_refFeatureManagerVM As FeatureManagerVM
+ 'Private m_refAddSectionXMaterialWndVM As AddSectionXMaterialWndVM
+ 'Private m_refStatisticsTimePanelVM As StatisticsTimePanelVM
+ 'Private m_refOpenProjectFileDialogVM As OpenProjectFileDialogVM
+ 'Private m_refRawPartTabVM As RawPartTabVM
+ 'Private m_refNestingTabVM As NestingTabVM
+ 'Private m_refMachiningTabVM As MachiningTabVM
+ 'Private m_refSplitModeVM As SplitModeVM
+ 'Private m_refMoveRawModeVM As MoveRawModeVM
+ 'Private m_refSimulTabVM As SimulTabVM
+
+#Region "Get"
+
+ Public ReadOnly Property refMainWindowVM As MainWindowVM
+ Get
+ Return m_refMainWindowVM
+ End Get
+ End Property
+
+ Public ReadOnly Property refMyStatusBarVM As MyStatusBarVM
+ Get
+ Return LibMap.refStatusBarVM
+ End Get
+ End Property
+
+ Public ReadOnly Property refProjManagerVM As ProjManagerVM
+ Get
+ Return m_refProjManagerVM
+ End Get
+ End Property
+
+ Public ReadOnly Property refProjectVM As ProjectVM
+ Get
+ Return m_refProjectVM
+ End Get
+ End Property
+
+ Public ReadOnly Property refSceneHostVM As MySceneHostVM
+ Get
+ Return LibMap.refSceneHostVM
+ End Get
+ End Property
+
+ Public ReadOnly Property refSecondaryWindowVM As SecondaryWindowVM
+ Get
+ Return m_refSecondaryWindowVM
+ End Get
+ End Property
+ Public ReadOnly Property refSecondaryWindowV As SecondaryWindowV
+ Get
+ Return m_refSecondaryWindowV
+ End Get
+ End Property
+
+ 'Public ReadOnly Property refShowPanelVM As ShowPanelVM
+ ' Get
+ ' Return LibMap.refShowPanelVM
+ ' End Get
+ 'End Property
+
+ 'Public ReadOnly Property refMainMenuVM As MainMenuVM
+ ' Get
+ ' Return m_refMainMenuVM
+ ' End Get
+ 'End Property
+
+ Public ReadOnly Property refMachinePanelVM As MachinePanelVM
+ Get
+ Return m_refMachinePanelVM
+ End Get
+ End Property
+
+ 'Public ReadOnly Property refLeftPanelVM As LeftPanelVM
+ ' Get
+ ' Return m_refLeftPanelVM
+ ' End Get
+ 'End Property
+
+ 'Public ReadOnly Property refMachGroupPanelVM As MyMachGroupPanelVM
+ ' Get
+ ' Return CoreMap.refMachGroupPanelVM
+ ' End Get
+ 'End Property
+
+ 'Public ReadOnly Property refBottomPanelVM As BottomPanelVM
+ ' Get
+ ' Return m_refBottomPanelVM
+ ' End Get
+ 'End Property
+
+ 'Public ReadOnly Property refShowBeamPanelVM As ShowBeamPanelVM
+ ' Get
+ ' Return m_refShowBeamPanelVM
+ ' End Get
+ 'End Property
+
+ 'Public ReadOnly Property refConfigurationPageVM As ConfigurationPageVM
+ ' Get
+ ' Return m_refConfigurationPageVM
+ ' End Get
+ 'End Property
+
+ 'Public ReadOnly Property refRawPartListVM As RawPartListVM
+ ' Get
+ ' Return m_refRawPartListVM
+ ' End Get
+ 'End Property
+
+ 'Public ReadOnly Property refPartInRawPartListVM As PartInRawPartListVM
+ ' Get
+ ' Return m_refPartInRawPartListVM
+ ' End Get
+ 'End Property
+
+ 'Public ReadOnly Property refWarehouseWndVM As WarehouseWndVM
+ ' Get
+ ' Return m_refWarehouseWndVM
+ ' End Get
+ 'End Property
+
+ 'Public ReadOnly Property refFeatureListVM As FeatureListVM
+ ' Get
+ ' Return m_refFeatureListVM
+ ' End Get
+ 'End Property
+
+ 'Public ReadOnly Property refFreeContourManagerVM As FreeContourManagerVM
+ ' Get
+ ' Return m_refFreeContourManagerVM
+ ' End Get
+ 'End Property
+
+ 'Public ReadOnly Property refFreeContourInputVM As FreeContourInputVM
+ ' Get
+ ' Return m_refFreeContourInputVM
+ ' End Get
+ 'End Property
+
+ 'Public ReadOnly Property refPartManagerVM As PartManagerVM
+ ' Get
+ ' Return m_refPartManagerVM
+ ' End Get
+ 'End Property
+
+ Public ReadOnly Property refInstrumentPanelVM As MyInstrumentPanelVM
+ Get
+ Return m_refInstrumentPanelVM
+ End Get
+ End Property
+
+ 'Public ReadOnly Property refTopPanelVM As TopPanelVM
+ ' Get
+ ' Return m_refTopPanelVM
+ ' End Get
+ 'End Property
+
+ 'Public ReadOnly Property refOptimizePanelVM As OptimizePanelVM
+ ' Get
+ ' Return m_refOptimizePanelVM
+ ' End Get
+ 'End Property
+
+ 'Public ReadOnly Property refCALCPanelVM As CALCPanelVM
+ ' Get
+ ' Return m_refCALCPanelVM
+ ' End Get
+ 'End Property
+
+ 'Public ReadOnly Property refPartListVM As BTLPartListVM
+ ' Get
+ ' Return m_refPartListVM
+ ' End Get
+ 'End Property
+
+ 'Public ReadOnly Property refFeatureInPartInRawPartListVM As FeatureInPartInRawPartListVM
+ ' Get
+ ' Return m_refFeatureInPartInRawPartListVM
+ ' End Get
+ 'End Property
+
+ 'Public ReadOnly Property refStatisticsVM As StatisticsVM
+ ' Get
+ ' Return m_refStatisticsVM
+ ' End Get
+ 'End Property
+
+ 'Public ReadOnly Property refPParameterListVM As PParameterListVM
+ ' Get
+ ' Return m_refPParameterListVM
+ ' End Get
+ 'End Property
+
+ 'Public ReadOnly Property refQParameterListVM As QParameterListVM
+ ' Get
+ ' Return m_refQParameterListVM
+ ' End Get
+ 'End Property
+
+ 'Public ReadOnly Property refFeatureManagerVM As FeatureManagerVM
+ ' Get
+ ' Return m_refFeatureManagerVM
+ ' End Get
+ 'End Property
+
+ 'Public ReadOnly Property refAddSectionXMaterialWndVM As AddSectionXMaterialWndVM
+ ' Get
+ ' Return m_refAddSectionXMaterialWndVM
+ ' End Get
+ 'End Property
+
+ 'Public ReadOnly Property refStatisticsTimePanelVM As StatisticsTimePanelVM
+ ' Get
+ ' Return m_refStatisticsTimePanelVM
+ ' End Get
+ 'End Property
+
+ 'Public ReadOnly Property refOpenProjectFileDialogVM As OpenProjectFileDialogVM
+ ' Get
+ ' Return m_refOpenProjectFileDialogVM
+ ' End Get
+ 'End Property
+
+ 'Public ReadOnly Property refOptionPanelVM As OptionPanelVM
+ ' Get
+ ' Return m_refOptionPanelVM
+ ' End Get
+ 'End Property
+
+ 'Public ReadOnly Property refRawPartTabVM As RawPartTabVM
+ ' Get
+ ' Return m_refRawPartTabVM
+ ' End Get
+ 'End Property
+
+ 'Public ReadOnly Property refNestingTabVM As NestingTabVM
+ ' Get
+ ' Return m_refNestingTabVM
+ ' End Get
+ 'End Property
+
+ 'Public ReadOnly Property refMachiningTabVM As MachiningTabVM
+ ' Get
+ ' Return m_refMachiningTabVM
+ ' End Get
+ 'End Property
+
+ 'Public ReadOnly Property refSplitModeVM As SplitModeVM
+ ' Get
+ ' Return m_refSplitModeVM
+ ' End Get
+ 'End Property
+
+ 'Public ReadOnly Property refMoveRawModeVM As MoveRawModeVM
+ ' Get
+ ' Return m_refMoveRawModeVM
+ ' End Get
+ 'End Property
+
+ 'Public ReadOnly Property refSimulTabVM As SimulTabVM
+ ' Get
+ ' Return m_refSimulTabVM
+ ' End Get
+ 'End Property
+
+#End Region ' Get
+
+#Region "Set"
+
+ Friend Function SetRefMyStatusBarVM(MyStatusBarVM As MyStatusBarVM) As Boolean
+ LibMap.SetRefStatusBarVM(MyStatusBarVM)
+ Return Not IsNothing(LibMap.refStatusBarVM)
+ End Function
+
+ Friend Function SetRefProjManagerVM(ProjManagerVM As ProjManagerVM) As Boolean
+ m_refProjManagerVM = ProjManagerVM
+ Return Not IsNothing(m_refProjManagerVM)
+ End Function
+
+ 'Friend Function SetRefProdManagerVM(ProdManagerVM As ProdManagerVM) As Boolean
+ ' m_refProdManagerVM = ProdManagerVM
+ ' Return Not IsNothing(m_refProdManagerVM)
+ 'End Function
+
+ Friend Function SetRefProjectVM(ProjectVM As ProjectVM) As Boolean
+ m_refProjectVM = ProjectVM
+ Return Not IsNothing(m_refProjectVM)
+ End Function
+
+ 'Friend Function SetRefMainMenuVM(MainMenuVM As MainMenuVM) As Boolean
+ ' m_refMainMenuVM = MainMenuVM
+ ' Return Not IsNothing(m_refMainMenuVM)
+ 'End Function
+
+ Friend Function SetRefSceneHostVM(SceneHostVM As SceneHostVM) As Boolean
+ LibMap.SetRefSceneHostVM(SceneHostVM)
+ Return Not IsNothing(LibMap.refSceneHostVM)
+ End Function
+
+ Friend Function SetRefSecondaryWindowVM(SecondaryWindowVM As SecondaryWindowVM) As Boolean
+ m_refSecondaryWindowVM = SecondaryWindowVM
+ Return Not IsNothing(m_refSecondaryWindowVM)
+ End Function
+ Friend Function SetRefSecondaryWindowV(SecondaryWindowV As SecondaryWindowV) As Boolean
+ m_refSecondaryWindowV = SecondaryWindowV
+ Return Not IsNothing(m_refSecondaryWindowV)
+ End Function
+
+ 'Friend Function SetRefShowPanelVM(ShowPanelVM As ShowPanelVM) As Boolean
+ ' LibMap.SetRefShowPanelVM(ShowPanelVM)
+ ' Return Not IsNothing(LibMap.refShowPanelVM)
+ 'End Function
+
+ Friend Function SetRefMachinePanelVM(MachinePanelVM As MachinePanelVM) As Boolean
+ m_refMachinePanelVM = MachinePanelVM
+ Return Not IsNothing(m_refMachinePanelVM)
+ End Function
+
+ 'Friend Function SetRefLeftPanelVM(LeftPanelVM As LeftPanelVM) As Boolean
+ ' m_refLeftPanelVM = LeftPanelVM
+ ' Return Not IsNothing(m_refLeftPanelVM)
+ 'End Function
+
+ 'Friend Function SetRefMachGroupPanelVM(MachGroupPanelVM As MyMachGroupPanelVM) As Boolean
+ ' CoreMap.SetRefMachGroupPanelVM(MachGroupPanelVM)
+ ' Return Not IsNothing(CoreMap.refMachGroupPanelVM)
+ 'End Function
+
+ 'Friend Function SetRefBottomPanelVM(BottomPanelVM As BottomPanelVM) As Boolean
+ ' m_refBottomPanelVM = BottomPanelVM
+ ' Return Not IsNothing(m_refBottomPanelVM)
+ 'End Function
+
+ 'Friend Function SetRefShowBeamPanelVM(ShowBeamPanelVM As ShowBeamPanelVM) As Boolean
+ ' m_refShowBeamPanelVM = ShowBeamPanelVM
+ ' Return Not IsNothing(m_refShowBeamPanelVM)
+ 'End Function
+
+ 'Friend Function SetRefConfigurationPageVM(ConfigurationPageVM As ConfigurationPageVM) As Boolean
+ ' m_refConfigurationPageVM = ConfigurationPageVM
+ ' Return Not IsNothing(m_refConfigurationPageVM)
+ 'End Function
+
+ 'Friend Function SetRefRawPartListVM(RawPartListVM As RawPartListVM) As Boolean
+ ' m_refRawPartListVM = RawPartListVM
+ ' Return Not IsNothing(m_refRawPartListVM)
+ 'End Function
+
+ 'Friend Function SetRefPartInRawPartListVM(PartInRawPartListVM As PartInRawPartListVM) As Boolean
+ ' m_refPartInRawPartListVM = PartInRawPartListVM
+ ' Return Not IsNothing(m_refPartInRawPartListVM)
+ 'End Function
+
+ 'Friend Function SetRefWarehouseWndVM(WarehouseWndVM As WarehouseWndVM) As Boolean
+ ' m_refWarehouseWndVM = WarehouseWndVM
+ ' Return Not IsNothing(m_refWarehouseWndVM)
+ 'End Function
+
+ 'Friend Function SetRefFeatureListVM(FeatureListVM As FeatureListVM) As Boolean
+ ' m_refFeatureListVM = FeatureListVM
+ ' Return Not IsNothing(m_refFeatureListVM)
+ 'End Function
+
+ 'Friend Function SetRefFreeContourManagerVM(FreeContourManagerVM As FreeContourManagerVM) As Boolean
+ ' m_refFreeContourManagerVM = FreeContourManagerVM
+ ' Return Not IsNothing(m_refFreeContourManagerVM)
+ 'End Function
+
+ 'Friend Function SetRefFreeContourInputVM(FreeContourInputVM As FreeContourInputVM) As Boolean
+ ' m_refFreeContourInputVM = FreeContourInputVM
+ ' Return Not IsNothing(m_refFreeContourInputVM)
+ 'End Function
+
+ 'Friend Function SetRefPartManagerVM(PartManagerVM As PartManagerVM) As Boolean
+ ' m_refPartManagerVM = PartManagerVM
+ ' Return Not IsNothing(m_refPartManagerVM)
+ 'End Function
+
+ Friend Function SetRefInstrumentPanelVM(InstrumentPanelVM As InstrumentPanelVM) As Boolean
+ m_refInstrumentPanelVM = InstrumentPanelVM
+ Return Not IsNothing(m_refInstrumentPanelVM)
+ End Function
+
+ 'Friend Function SetRefTopPanelVM(TopPanelVM As TopPanelVM) As Boolean
+ ' m_refTopPanelVM = TopPanelVM
+ ' Return Not IsNothing(m_refTopPanelVM)
+ 'End Function
+
+ 'Friend Function SetRefOptimizePanelVM(OptimizePanelVM As OptimizePanelVM) As Boolean
+ ' m_refOptimizePanelVM = OptimizePanelVM
+ ' Return Not IsNothing(m_refOptimizePanelVM)
+ 'End Function
+
+ 'Friend Function SetRefCALCPanelVM(CALCPanelVM As CALCPanelVM) As Boolean
+ ' m_refCALCPanelVM = CALCPanelVM
+ ' Return Not IsNothing(m_refCALCPanelVM)
+ 'End Function
+
+ 'Friend Function SetRefPartListVM(PartListVM As BTLPartListVM) As Boolean
+ ' m_refPartListVM = PartListVM
+ ' Return Not IsNothing(m_refPartListVM)
+ 'End Function
+
+ 'Friend Function SetRefFeatureInPartInRawPartListVM(FeatureInPartInRawPartListVM As FeatureInPartInRawPartListVM) As Boolean
+ ' m_refFeatureInPartInRawPartListVM = FeatureInPartInRawPartListVM
+ ' Return Not IsNothing(m_refFeatureInPartInRawPartListVM)
+ 'End Function
+
+ 'Friend Function SetRefStatisticsVM(StatisticsVM As StatisticsVM) As Boolean
+ ' m_refStatisticsVM = StatisticsVM
+ ' Return Not IsNothing(m_refStatisticsVM)
+ 'End Function
+
+ 'Friend Function SetRefPParameterListVM(PParameterListVM As PParameterListVM) As Boolean
+ ' m_refPParameterListVM = PParameterListVM
+ ' Return Not IsNothing(m_refPParameterListVM)
+ 'End Function
+
+ 'Friend Function SetRefQParameterListVM(QParameterListVM As QParameterListVM) As Boolean
+ ' m_refQParameterListVM = QParameterListVM
+ ' Return Not IsNothing(m_refQParameterListVM)
+ 'End Function
+
+ 'Friend Function SetRefFeatureManagerVM(FeatureManagerVM As FeatureManagerVM) As Boolean
+ ' m_refFeatureManagerVM = FeatureManagerVM
+ ' Return Not IsNothing(m_refFeatureManagerVM)
+ 'End Function
+
+ 'Friend Function SetRefAddSectionXMaterialWndVM(AddSectionXMaterialWndVM As AddSectionXMaterialWndVM) As Boolean
+ ' m_refAddSectionXMaterialWndVM = AddSectionXMaterialWndVM
+ ' Return Not IsNothing(m_refAddSectionXMaterialWndVM)
+ 'End Function
+
+ 'Friend Function SetRefStatisticsTimePanelVM(StatisticsTimePanelVM As StatisticsTimePanelVM) As Boolean
+ ' m_refStatisticsTimePanelVM = StatisticsTimePanelVM
+ ' Return Not IsNothing(m_refStatisticsTimePanelVM)
+ 'End Function
+
+ 'Friend Function SetRefOpenProjectFileDialogVM(OpenProjectFileDialogVM As OpenProjectFileDialogVM) As Boolean
+ ' m_refOpenProjectFileDialogVM = OpenProjectFileDialogVM
+ ' Return Not IsNothing(m_refOpenProjectFileDialogVM)
+ 'End Function
+
+ 'Friend Function SetRefOptionPanelVM(OptionPanelVM As OptionPanelVM) As Boolean
+ ' m_refOptionPanelVM = OptionPanelVM
+ ' Return Not IsNothing(m_refOptionPanelVM)
+ 'End Function
+
+ 'Friend Function SetRefRawPartTabVM(RawPartTabVM As RawPartTabVM) As Boolean
+ ' m_refRawPartTabVM = RawPartTabVM
+ ' Return Not IsNothing(m_refRawPartTabVM)
+ 'End Function
+
+ 'Friend Function SetRefNestingTabVM(NestingTabVM As NestingTabVM) As Boolean
+ ' m_refNestingTabVM = NestingTabVM
+ ' Return Not IsNothing(m_refNestingTabVM)
+ 'End Function
+
+ 'Friend Function SetRefMachiningTabVM(MachiningTabVM As MachiningTabVM) As Boolean
+ ' m_refMachiningTabVM = MachiningTabVM
+ ' Return Not IsNothing(m_refMachiningTabVM)
+ 'End Function
+
+ 'Friend Function SetRefSplitModeVM(SplitModeVM As SplitModeVM) As Boolean
+ ' m_refSplitModeVM = SplitModeVM
+ ' Return Not IsNothing(m_refSplitModeVM)
+ 'End Function
+
+ 'Friend Function SetRefMoveRawModeVM(MoveRawModeVM As MoveRawModeVM) As Boolean
+ ' m_refMoveRawModeVM = MoveRawModeVM
+ ' Return Not IsNothing(m_refMoveRawModeVM)
+ 'End Function
+
+ 'Friend Function SetRefSimulTabVM(SimulTabVM As SimulTabVM) As Boolean
+ ' m_refSimulTabVM = SimulTabVM
+ ' Return Not IsNothing(m_refSimulTabVM)
+ 'End Function
+
+#End Region ' Set
+
+#Region "Init"
+
+ Friend Function BeginInit(MainWindowVM As MainWindowVM) As Boolean
+ m_refMainWindowVM = MainWindowVM
+ Return Not IsNothing(m_refMainWindowVM)
+ End Function
+ Friend Function EndInit() As Boolean
+ ' Verifico se tutti i pezzi necessari sono stati caricati
+ 'Return Not IsNothing(m_refMainWindowVM) AndAlso Not IsNothing(m_refProjectVM) AndAlso
+ ' Not IsNothing(LibMap.refStatusBarVM) AndAlso Not IsNothing(m_refProjectManagerVM) AndAlso
+ ' Not IsNothing(LibMap.refSceneHostVM) AndAlso Not IsNothing(LibMap.refShowPanelVM) AndAlso
+ ' Not IsNothing(m_refVeinMatchPanelVM) AndAlso
+ ' Not IsNothing(m_refOptionPanelVM) AndAlso Not IsNothing(m_refRawPartTabVM) AndAlso
+ ' Not IsNothing(m_refNestingTabVM) AndAlso Not IsNothing(m_refSimulTabVM) AndAlso
+ ' Not IsNothing(m_refMachiningTabVM) AndAlso
+ ' LibMap.EndInit()
+ Return Not IsNothing(m_refMainWindowVM) AndAlso
+ Not IsNothing(LibMap.refStatusBarVM) AndAlso
+ LibMap.EndInit()
+ End Function
+
+#End Region ' Init
+
+End Module
diff --git a/3dPrintApp/Utility/MyMachine.vb b/3dPrintApp/Utility/MyMachine.vb
new file mode 100644
index 0000000..9fbb0ef
--- /dev/null
+++ b/3dPrintApp/Utility/MyMachine.vb
@@ -0,0 +1,34 @@
+Imports System.IO
+Imports EgtWPFLib5
+Imports EgtUILib
+
+Public Class MyMachine
+ Inherits Machine
+
+ Sub New(sDirPath As String, sIniPath As String)
+ MyBase.New(sDirPath, sIniPath)
+ End Sub
+
+ Public Shared Shadows Function MachineListInit(sMachinesRootDir As String, MachineList As IList(Of Machine)) As Boolean
+ ' Se direttorio base macchine non definito o non esiste, ritorno
+ If String.IsNullOrWhiteSpace(sMachinesRootDir) OrElse
+ Not Directory.Exists(sMachinesRootDir) Then
+ MachineList = Nothing
+ Return False
+ End If
+ ' Cerco le macchine
+ Dim Machines As String() = Directory.GetDirectories(sMachinesRootDir)
+ For i As Integer = 0 To Machines.Count - 1
+ Dim PathIni As String = Machines(i) & "\" & Path.GetFileName(Machines(i)) & ".ini"
+ If File.Exists(PathIni) Then
+ Dim sMaterial As String = ""
+ GetPrivateProfileString(S_GENERAL, "Material", "", sMaterial, Machines(i) & "\" & Path.GetFileName(Machines(i)) & ".ini")
+ If sMaterial = "Additive" Then
+ MachineList.Add(New MyMachine(Machines(i), PathIni))
+ End If
+ End If
+ Next
+ Return True
+ End Function
+
+End Class
\ No newline at end of file
diff --git a/3dPrintApp/Utility/RawPartConfiguration.vb b/3dPrintApp/Utility/RawPartConfiguration.vb
new file mode 100644
index 0000000..cad8987
--- /dev/null
+++ b/3dPrintApp/Utility/RawPartConfiguration.vb
@@ -0,0 +1,17 @@
+Module RawPartConfiguration
+
+ Private m_dBeamDist As Double = 5.4
+ Public ReadOnly Property dBeamDist As Double
+ Get
+ Return m_dBeamDist
+ End Get
+ End Property
+
+ Private m_dWallDist As Double = 40
+ Public ReadOnly Property dWallDist As Double
+ Get
+ Return m_dWallDist
+ End Get
+ End Property
+
+End Module
diff --git a/3dPrintApp/Utility/SectionXMaterialToBeAdded.vb b/3dPrintApp/Utility/SectionXMaterialToBeAdded.vb
new file mode 100644
index 0000000..144ab77
--- /dev/null
+++ b/3dPrintApp/Utility/SectionXMaterialToBeAdded.vb
@@ -0,0 +1,81 @@
+Imports System.Windows
+Imports EgtBEAMWALL.Core
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Public Class SectionXMaterialToBeAdded
+ Inherits SectionXMaterial
+
+ Sub New(SectXMat As SectionXMaterial)
+ MyBase.New(SectXMat.dW, SectXMat.dH, SectXMat.dL, SectXMat.sMaterial(0))
+ End Sub
+
+ Private m_Alias_IsChecked As Boolean
+ Public Overrides Property Alias_IsChecked As Boolean
+ Get
+ Return m_Alias_IsChecked
+ End Get
+ Set(value As Boolean)
+ m_Alias_IsChecked = value
+ ' Se Alias è checkato seleziono subito il primo elemento nella CmBx altrimenti setto la selezione a Nothing
+ SelMaterialForSameSection = If(m_Alias_IsChecked, MaterialForSameSection_List(0), Nothing)
+ NotifyPropertyChanged(NameOf(SelMaterialForSameSection))
+ ' Setto SelNewSectionXMaterial al suo stesso valore per aggiornare l'abilitazione della CmBx
+ Map.refAddSectionXMaterialWndVM.SelNewSectionXMaterial = Map.refAddSectionXMaterialWndVM.SelNewSectionXMaterial
+ Map.refAddSectionXMaterialWndVM.NotifyPropertyChanged(NameOf(Map.refAddSectionXMaterialWndVM.SelNewSectionXMaterial))
+ NotifyPropertyChanged(NameOf(Alias_IsChecked))
+ NotifyPropertyChanged(NameOf(Alias_IsNotChecked))
+ End Set
+ End Property
+
+ Private m_Alias_IsNotChecked As Boolean
+ Public ReadOnly Property Alias_IsNotChecked As Boolean
+ Get
+ Return Not Alias_IsChecked
+ End Get
+ End Property
+
+ Public Property sNewW As String
+ Get
+ Return LenToString(dNewW, 3)
+ End Get
+ Set(value As String)
+ Dim dTempNewW As Double
+ If StringToLen(value, dTempNewW) AndAlso dTempNewW > 0 Then
+ dNewW = dTempNewW
+ Else
+ NotifyPropertyChanged(NameOf(sNewW))
+ End If
+ End Set
+ End Property
+
+ Public Property sNewL As String
+ Get
+ Return LenToString(dNewL, 3)
+ End Get
+ Set(value As String)
+ Dim dTempNewL As Double
+ If StringToLen(value, dTempNewL) AndAlso dTempNewL > 0 Then
+ dNewL = dTempNewL
+ Else
+ NotifyPropertyChanged(NameOf(sNewL))
+ End If
+ End Set
+ End Property
+
+ Public Property sQuantity As String
+ Get
+ Return nQuantity
+ End Get
+ Set(value As String)
+ Dim nTempQuantity As Integer
+ If Integer.TryParse(value, nTempQuantity) AndAlso nTempQuantity >= 0 Then
+ nQuantity = nTempQuantity
+ Else
+ NotifyPropertyChanged(NameOf(sQuantity))
+ End If
+ End Set
+ End Property
+
+End Class
+
diff --git a/3dPrintApp/Utility/TextBlockUtils.vb b/3dPrintApp/Utility/TextBlockUtils.vb
new file mode 100644
index 0000000..553bca4
--- /dev/null
+++ b/3dPrintApp/Utility/TextBlockUtils.vb
@@ -0,0 +1,69 @@
+Imports System.ComponentModel
+Imports System.Globalization
+
+Module TextBlockUtils
+
+ Public ReadOnly AutoTooltipProperty As DependencyProperty = DependencyProperty.RegisterAttached("AutoTooltip", GetType(Boolean), GetType(TextBlockUtils), New FrameworkPropertyMetadata(False, New PropertyChangedCallback(AddressOf OnAutoTooltipPropertyChanged)))
+
+ Sub SetAutoTooltip(ByVal d As DependencyObject, ByVal value As Boolean)
+ d.SetValue(AutoTooltipProperty, value)
+ End Sub
+
+ Function GetAutoTooltip(ByVal d As DependencyObject) As Boolean
+ Return CBool(d.GetValue(AutoTooltipProperty))
+ End Function
+
+ Private Sub OnAutoTooltipPropertyChanged(ByVal d As DependencyObject, ByVal e As DependencyPropertyChangedEventArgs)
+ Dim tb As TextBlock = TryCast(d, TextBlock)
+
+ If tb IsNot Nothing Then
+ Dim newValue As Boolean = CBool(e.NewValue)
+
+ If newValue Then
+ tb.TextTrimming = TextTrimming.WordEllipsis
+ SetTooltipBasedOnTrimmingState(tb)
+ AddHandler tb.SizeChanged, AddressOf OnTextBlockSizeChanged
+ Else
+ RemoveHandler tb.SizeChanged, AddressOf OnTextBlockSizeChanged
+ End If
+ End If
+ End Sub
+
+ Private Sub OnTextBlockSizeChanged(ByVal sender As Object, ByVal e As SizeChangedEventArgs)
+ Dim tb = TryCast(sender, TextBlock)
+
+ If tb IsNot Nothing Then
+ SetTooltipBasedOnTrimmingState(tb)
+ End If
+ End Sub
+
+ Private Sub SetTooltipBasedOnTrimmingState(ByVal tb As TextBlock)
+ Dim textBlock As FrameworkElement = CType(tb, FrameworkElement)
+ textBlock.Measure(New System.Windows.Size(Double.PositiveInfinity, Double.PositiveInfinity))
+ 'textBlock.UpdateLayout()
+ Dim width = tb.DesiredSize.Width
+ ToolTipService.SetToolTip(tb, If((CType(tb, FrameworkElement)).ActualWidth < (CType(tb, FrameworkElement)).DesiredSize.Width, tb.Text, Nothing))
+ End Sub
+
+End Module
+
+Public Class TrimmedTextBlockVisibilityConverter
+ Implements IValueConverter
+
+ Public Function Convert(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.Convert
+ If value Is Nothing Then Return Visibility.Collapsed
+ Dim textBlock As FrameworkElement = CType(value, FrameworkElement)
+ textBlock.Measure(New System.Windows.Size(Double.PositiveInfinity, Double.PositiveInfinity))
+
+ If (CType(value, FrameworkElement)).ActualWidth < (CType(value, FrameworkElement)).DesiredSize.Width Then
+ Return Visibility.Visible
+ Else
+ Return Visibility.Collapsed
+ End If
+ End Function
+
+ Public Function ConvertBack(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack
+ Throw New NotImplementedException()
+ End Function
+
+End Class
diff --git a/3dPrintApp/Utility/TreeViewItemBase.vb b/3dPrintApp/Utility/TreeViewItemBase.vb
new file mode 100644
index 0000000..4fd2dc7
--- /dev/null
+++ b/3dPrintApp/Utility/TreeViewItemBase.vb
@@ -0,0 +1,258 @@
+Imports System.Collections.ObjectModel
+Imports System.ComponentModel
+
+' Classe che definisce un elemento di base del TreeView
+Public Class TreeViewItemBase
+ Implements INotifyPropertyChanged
+
+ Friend m_Name As String
+ Public Overridable Property Name As String
+ Get
+ Return m_Name
+ End Get
+ Set(value As String)
+ If (value <> m_Name) Then
+ m_Name = value
+ NotifyPropertyChanged("Name")
+ End If
+ End Set
+ End Property
+
+ Friend m_isSelected As Boolean
+ Public Overridable Property IsSelected As Boolean
+ Get
+ Return m_isSelected
+ End Get
+ Set(value As Boolean)
+ If (value <> m_isSelected) Then
+ m_isSelected = value
+ NotifyPropertyChanged("IsSelected")
+ End If
+ End Set
+ End Property
+
+ Private m_isExpanded As Boolean
+ Public Property IsExpanded As Boolean
+ Get
+ Return m_isExpanded
+ End Get
+ Set(value As Boolean)
+ If (value <> m_isExpanded) Then
+ m_isExpanded = value
+ NotifyPropertyChanged("IsExpanded")
+ End If
+ End Set
+ End Property
+
+ Private m_IsActive As Boolean
+ Public Property IsActive As Boolean
+ Get
+ Return m_IsActive
+ End Get
+ Set(value As Boolean)
+ If value <> m_IsActive Then
+ m_IsActive = value
+ NotifyPropertyChanged("IsActive")
+ End If
+ End Set
+ End Property
+
+ Private m_IsEnabled As Boolean = True
+ Public Property IsEnabled As Boolean
+ Get
+ Return m_IsEnabled
+ End Get
+ Set(value As Boolean)
+ m_IsEnabled = value
+ NotifyPropertyChanged("IsEnabled")
+ End Set
+ End Property
+
+ Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
+
+ Public Sub NotifyPropertyChanged(propName As String)
+ RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
+ End Sub
+
+ Sub New(Name As String)
+ m_Name = Name
+ End Sub
+
+ Sub New(Name As String, IsSelected As Boolean, IsExpanded As Boolean, IsActive As Boolean)
+ Me.Name = Name
+ Me.IsSelected = IsSelected
+ Me.IsExpanded = IsExpanded
+ Me.IsActive = IsActive
+ End Sub
+
+End Class
+
+' Elemento del treeview che ha sottoelementi del suo stesso tipo
+Public Class InheritableTreeViewItem
+ Implements INotifyPropertyChanged
+
+ Friend m_Name As String
+ Public Property Name As String
+ Get
+ Return m_Name
+ End Get
+ Set(value As String)
+ If (value <> m_Name) Then
+ m_Name = value
+ NotifyPropertyChanged("Name")
+ End If
+ End Set
+ End Property
+
+ Friend m_IsSelected As Boolean
+ Public Overridable Property IsSelected As Boolean
+ Get
+ Return m_IsSelected
+ End Get
+ Set(value As Boolean)
+ If (value <> m_IsSelected) Then
+ m_IsSelected = value
+ NotifyPropertyChanged("IsSelected")
+ End If
+ End Set
+ End Property
+
+ Private m_isExpanded As Boolean
+ Public Property IsExpanded As Boolean
+ Get
+ Return m_isExpanded
+ End Get
+ Set(value As Boolean)
+ If (value <> m_isExpanded) Then
+ m_isExpanded = value
+ NotifyPropertyChanged("IsExpanded")
+ End If
+ End Set
+ End Property
+
+ Private m_IsActive As Boolean
+ Public Property IsActive As Boolean
+ Get
+ Return m_IsActive
+ End Get
+ Set(value As Boolean)
+ If value <> m_IsActive Then
+ m_IsActive = value
+ NotifyPropertyChanged("IsActive")
+ End If
+ End Set
+ End Property
+
+ Private m_IsEnabled As Boolean = True
+ Public Property IsEnabled As Boolean
+ Get
+ Return m_IsEnabled
+ End Get
+ Set(value As Boolean)
+ m_IsEnabled = value
+ NotifyPropertyChanged("IsEnabled")
+ End Set
+ End Property
+
+ Private m_sPictureString As String
+ Public Property PictureString As String
+ Get
+ Return m_sPictureString
+ End Get
+ Set(value As String)
+ If value <> m_sPictureString Then
+ m_sPictureString = value
+ NotifyPropertyChanged("PictureString")
+ End If
+ End Set
+ End Property
+
+ Private m_Items As ObservableCollection(Of InheritableTreeViewItem)
+ Public Property Items As ObservableCollection(Of InheritableTreeViewItem)
+ Get
+ Return m_Items
+ End Get
+ Set(value As ObservableCollection(Of InheritableTreeViewItem))
+ m_Items = value
+ End Set
+ End Property
+
+ Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
+
+ Public Sub NotifyPropertyChanged(propName As String)
+ RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
+ End Sub
+
+ Sub New(Name As String)
+ Me.Name = Name
+ Me.Items = New ObservableCollection(Of InheritableTreeViewItem)
+ End Sub
+
+End Class
+
+' Elemento che ha sottoelementi di tipo childitem
+Public Class ParentItem
+ Inherits TreeViewItemBase
+
+ Private m_sPictureString As String
+ Private m_Items As ObservableCollection(Of ChildItem)
+
+ Public Property PictureString As String
+ Get
+ Return m_sPictureString
+ End Get
+ Set(value As String)
+ If value <> m_sPictureString Then
+ m_sPictureString = value
+ NotifyPropertyChanged("PictureString")
+ End If
+ End Set
+ End Property
+
+ Public Property Items As ObservableCollection(Of ChildItem)
+ Get
+ Return m_Items
+ End Get
+ Set(value As ObservableCollection(Of ChildItem))
+ m_Items = value
+ End Set
+ End Property
+
+ Sub New(Name As String)
+ MyBase.New(Name)
+ Me.Items = New ObservableCollection(Of ChildItem)
+ End Sub
+
+ Sub New(Name As String, IsSelected As Boolean, IsExpanded As Boolean, IsActive As Boolean)
+ MyBase.New(Name, IsSelected, IsExpanded, IsActive)
+ Me.Items = New ObservableCollection(Of ChildItem)
+ End Sub
+
+End Class
+
+' Elemento presente solo come figlio di un ParentItem
+Public Class ChildItem
+ Inherits TreeViewItemBase
+
+ Private m_sPictureString As String
+ Public Property PictureString As String
+ Get
+ Return m_sPictureString
+ End Get
+ Set(value As String)
+ If value <> m_sPictureString Then
+ m_sPictureString = value
+ NotifyPropertyChanged("PictureString")
+ End If
+ End Set
+ End Property
+
+ Sub New(Name As String)
+ MyBase.New(Name)
+ End Sub
+
+ Sub New(Name As String, IsSelected As Boolean, IsExpanded As Boolean, IsActive As Boolean)
+ MyBase.New(Name, IsSelected, IsExpanded, IsActive)
+ End Sub
+
+End Class
diff --git a/3dPrintApp/ViewModel/MaterialVM.vb b/3dPrintApp/ViewModel/MaterialVM.vb
new file mode 100644
index 0000000..d515884
--- /dev/null
+++ b/3dPrintApp/ViewModel/MaterialVM.vb
@@ -0,0 +1,60 @@
+Public Class MaterialVM
+
+ Private m_sName As String
+ Public ReadOnly Property sName As String
+ Get
+ Return m_sName
+ End Get
+ End Property
+
+ Private m_SectionTimeList As List(Of SectionTime)
+ Public ReadOnly Property SectionTimeList As List(Of SectionTime)
+ Get
+ Return m_SectionTimeList
+ End Get
+ End Property
+End Class
+
+Public Class SectionTime
+
+ Private m_dStrandW As Double
+ Public Property dStrandW As Double
+ Get
+ Return m_dStrandW
+ End Get
+ Set(value As Double)
+ m_dStrandW = value
+ End Set
+ End Property
+
+ Private m_dStrandH As Double
+ Public Property dStrandH As Double
+ Get
+ Return m_dStrandH
+ End Get
+ Set(value As Double)
+ m_dStrandH = value
+ End Set
+ End Property
+
+ Private m_nMinTime As Integer
+ Public Property nMinTime As Integer
+ Get
+ Return m_nMinTime
+ End Get
+ Set(value As Integer)
+ m_nMinTime = value
+ End Set
+ End Property
+
+ Private m_nMaxTime As Integer
+ Public Property nMaxTime As Integer
+ Get
+ Return m_nMaxTime
+ End Get
+ Set(value As Integer)
+ m_nMaxTime = value
+ End Set
+ End Property
+
+End Class
\ No newline at end of file
diff --git a/3dPrintApp/ViewModel/Print3dLayerVM.vb b/3dPrintApp/ViewModel/Print3dLayerVM.vb
new file mode 100644
index 0000000..e7e9dba
--- /dev/null
+++ b/3dPrintApp/ViewModel/Print3dLayerVM.vb
@@ -0,0 +1,3 @@
+Public Class Print3dLayerVM
+
+End Class
diff --git a/3dPrintApp/ViewModel/Print3dPartVM.vb b/3dPrintApp/ViewModel/Print3dPartVM.vb
new file mode 100644
index 0000000..b489cb8
--- /dev/null
+++ b/3dPrintApp/ViewModel/Print3dPartVM.vb
@@ -0,0 +1,50 @@
+Imports System.Collections.ObjectModel
+
+Public Class Print3dPartVM
+
+ Private m_nPartId As Integer
+ Public ReadOnly Property nPartId As Integer
+ Get
+ Return m_nPartId
+ End Get
+ End Property
+
+ Private m_sImportedFileName As String
+ Public Property sImportedFileName As String
+ Get
+ Return m_sImportedFileName
+ End Get
+ Set(value As String)
+ m_sImportedFileName = value
+ End Set
+ End Property
+
+ Private m_sImportedFilePath As String
+ Public Property sImportedFilePath As String
+ Get
+ Return m_sImportedFilePath
+ End Get
+ Set(value As String)
+ m_sImportedFilePath = value
+ End Set
+ End Property
+
+ Private m_LayerList As ObservableCollection(Of Print3dLayerVM)
+ Public ReadOnly Property LayerList As ObservableCollection(Of Print3dLayerVM)
+ Get
+ Return m_LayerList
+ End Get
+ End Property
+
+#Region "Default Machining Params"
+
+
+#End Region ' Default Machining Params
+
+ Sub New(nPartId As Integer, sImportedFilePath As String)
+ m_nPartId = nPartId
+ m_sImportedFilePath = sImportedFilePath
+ m_sImportedFileName = IO.Path.GetFileName(m_sImportedFilePath)
+ End Sub
+
+End Class
diff --git a/3dPrintApp/ViewPanel/ViewPanelV.xaml b/3dPrintApp/ViewPanel/ViewPanelV.xaml
new file mode 100644
index 0000000..0caf70a
--- /dev/null
+++ b/3dPrintApp/ViewPanel/ViewPanelV.xaml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/3dPrintApp/ViewPanel/ViewPanelV.xaml.vb b/3dPrintApp/ViewPanel/ViewPanelV.xaml.vb
new file mode 100644
index 0000000..d9dd0b2
--- /dev/null
+++ b/3dPrintApp/ViewPanel/ViewPanelV.xaml.vb
@@ -0,0 +1,3 @@
+Public Class ViewPanelV
+
+End Class
diff --git a/3dPrintApp/ViewPanel/ViewPanelVM.vb b/3dPrintApp/ViewPanel/ViewPanelVM.vb
new file mode 100644
index 0000000..7f7c3d1
--- /dev/null
+++ b/3dPrintApp/ViewPanel/ViewPanelVM.vb
@@ -0,0 +1,231 @@
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Public Class ViewPanelVM
+ Inherits vmbase
+
+#Region "FIELDS & PROPERTIES"
+
+ ' Definizione comandi
+ Private m_cmdZoomAll As ICommand
+ Private m_cmdTopView As ICommand
+ Private m_cmdFrontView As ICommand
+ Private m_cmdLeftView As ICommand
+ Private m_cmdBackView As ICommand
+ Private m_cmdRightView As ICommand
+ Private m_cmdIsoViewSW As ICommand
+
+#Region "ToolTip"
+
+ Public ReadOnly Property ZoomAllToolTip As String
+ Get
+ Return EgtMsg(MSG_GRIDVIEWPANEL + 4)
+ End Get
+ End Property
+
+ Public ReadOnly Property LookFromTopToolTip As String
+ Get
+ Return EgtMsg(MSG_GRIDVIEWPANEL + 7)
+ End Get
+ End Property
+
+ Public ReadOnly Property LookFromFrontToolTip As String
+ Get
+ Return EgtMsg(MSG_GRIDVIEWPANEL + 8)
+ End Get
+ End Property
+
+ Public ReadOnly Property LookFromLeftToolTip As String
+ Get
+ Return EgtMsg(MSG_GRIDVIEWPANEL + 9)
+ End Get
+ End Property
+
+ Public ReadOnly Property LookFromBackToolTip As String
+ Get
+ Return EgtMsg(MSG_GRIDVIEWPANEL + 10)
+ End Get
+ End Property
+
+ Public ReadOnly Property LookFromRightToolTip As String
+ Get
+ Return EgtMsg(MSG_GRIDVIEWPANEL + 11)
+ End Get
+ End Property
+
+ Public ReadOnly Property LookFromIso_SWToolTip As String
+ Get
+ Return EgtMsg(MSG_GRIDVIEWPANEL + 12)
+ End Get
+ End Property
+
+#End Region ' ToolTip
+
+#End Region ' FIELDS & PROPERTIES
+
+#Region "COMMANDS"
+
+#Region "ZoomAllCommand"
+
+ '''
+ ''' Returns a command that do ZoomAll.
+ '''
+ Public ReadOnly Property ZoomAllCommand As ICommand
+ Get
+ If m_cmdZoomAll Is Nothing Then
+ m_cmdZoomAll = New Command(AddressOf ZoomAll)
+ End If
+ Return m_cmdZoomAll
+ End Get
+ End Property
+
+ '''
+ ''' Execute the ZoomAll. This method is invoked by the ZoomAllCommand.
+ '''
+ Public Sub ZoomAll(ByVal param As Object)
+ Map.refSceneHostVM.MainScene.ZoomAll()
+ End Sub
+
+#End Region ' ZoomAllCommand
+
+#Region "TopViewCommand"
+
+ '''
+ ''' Returns a command that do TopView.
+ '''
+ Public ReadOnly Property TopViewCommand As ICommand
+ Get
+ If m_cmdTopView Is Nothing Then
+ m_cmdTopView = New Command(AddressOf TopView)
+ End If
+ Return m_cmdTopView
+ End Get
+ End Property
+
+ '''
+ ''' Execute the TopView. This method is invoked by the TopViewCommand.
+ '''
+ Public Sub TopView(ByVal param As Object)
+ Map.refSceneHostVM.MainScene.TopView()
+ End Sub
+
+#End Region ' TopViewCommand
+
+#Region "FrontViewCommand"
+
+ '''
+ ''' Returns a command that do FrontView.
+ '''
+ Public ReadOnly Property FrontViewCommand As ICommand
+ Get
+ If m_cmdFrontView Is Nothing Then
+ m_cmdFrontView = New Command(AddressOf FrontView)
+ End If
+ Return m_cmdFrontView
+ End Get
+ End Property
+
+ '''
+ ''' Execute the FrontView. This method is invoked by the FrontViewCommand.
+ '''
+ Public Sub FrontView(ByVal param As Object)
+ Map.refSceneHostVM.MainScene.FrontView()
+ End Sub
+
+#End Region ' FrontViewCommand
+
+#Region "LeftViewCommand"
+
+ '''
+ ''' Returns a command that do LeftView.
+ '''
+ Public ReadOnly Property LeftViewCommand As ICommand
+ Get
+ If m_cmdLeftView Is Nothing Then
+ m_cmdLeftView = New Command(AddressOf LeftView)
+ End If
+ Return m_cmdLeftView
+ End Get
+ End Property
+
+ '''
+ ''' Execute the LeftView. This method is invoked by the LeftViewCommand.
+ '''
+ Public Sub LeftView(ByVal param As Object)
+ Map.refSceneHostVM.MainScene.LeftView()
+ End Sub
+
+#End Region ' LeftViewCommand
+
+#Region "BackViewCommand"
+
+ '''
+ ''' Returns a command that do BackView.
+ '''
+ Public ReadOnly Property BackViewCommand As ICommand
+ Get
+ If m_cmdBackView Is Nothing Then
+ m_cmdBackView = New Command(AddressOf BackView)
+ End If
+ Return m_cmdBackView
+ End Get
+ End Property
+
+ '''
+ ''' Execute the BackView. This method is invoked by the BackViewCommand.
+ '''
+ Public Sub BackView(ByVal param As Object)
+ Map.refSceneHostVM.MainScene.BackView()
+ End Sub
+
+#End Region ' BackViewCommand
+
+#Region "RightViewCommand"
+
+ '''
+ ''' Returns a command that do RightView.
+ '''
+ Public ReadOnly Property RightViewCommand As ICommand
+ Get
+ If m_cmdRightView Is Nothing Then
+ m_cmdRightView = New Command(AddressOf RightView)
+ End If
+ Return m_cmdRightView
+ End Get
+ End Property
+
+ '''
+ ''' Execute the RightView. This method is invoked by the RightViewCommand.
+ '''
+ Public Sub RightView(ByVal param As Object)
+ Map.refSceneHostVM.MainScene.RightView()
+ End Sub
+
+#End Region ' RightViewCommand
+
+#Region "IsoViewSWCommand"
+
+ '''
+ ''' Returns a command that do IsoViewSW.
+ '''
+ Public ReadOnly Property IsoViewSWCommand As ICommand
+ Get
+ If m_cmdIsoViewSW Is Nothing Then
+ m_cmdIsoViewSW = New Command(AddressOf IsoViewSW)
+ End If
+ Return m_cmdIsoViewSW
+ End Get
+ End Property
+
+ '''
+ ''' Execute the IsoViewSW. This method is invoked by the IsoViewSWCommand.
+ '''
+ Public Sub IsoViewSW(ByVal param As Object)
+ Map.refSceneHostVM.MainScene.IsoViewSW()
+ End Sub
+
+#End Region ' IsoViewSWCommand
+
+#End Region ' COMMANDS
+
+End Class
\ No newline at end of file
diff --git a/3dPrintApp/packages.config b/3dPrintApp/packages.config
new file mode 100644
index 0000000..fdc9817
--- /dev/null
+++ b/3dPrintApp/packages.config
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file