diff --git a/CadCutPageUC.xaml b/CadCutPageUC.xaml
index 287ca26..8c2dedd 100644
--- a/CadCutPageUC.xaml
+++ b/CadCutPageUC.xaml
@@ -60,7 +60,8 @@
-
+
+
@@ -71,9 +72,11 @@
Style="{StaticResource OmagCut_YellowGradientYellowTextButton}"/>
+
-
-
+
+
diff --git a/CadCutPageUC.xaml.vb b/CadCutPageUC.xaml.vb
index d027231..8ef1bf4 100644
--- a/CadCutPageUC.xaml.vb
+++ b/CadCutPageUC.xaml.vb
@@ -14,6 +14,9 @@ Public Class CadCutPageUC
Friend m_SplitPage As SplitPageUC
Friend m_MoveRawPartPage As MoveRawPartPage
+ ' Riferimento alla finestra di salvataggio con nome
+ Friend m_SaveNameWD As SaveNameWD
+
' Variabile che indica la modalità
Friend m_MovePartPage As MovePartsPages
@@ -51,6 +54,7 @@ Public Class CadCutPageUC
NewBtn.Content = EgtMsg(MSG_CADCUTPAGEUC + 3)
LoadBtn.Content = EgtMsg(MSG_CADCUTPAGEUC + 4)
SaveBtn.Content = EgtMsg(MSG_CADCUTPAGEUC + 5)
+ SaveNameBtn.Content = EgtMsg(MSG_CADCUTPAGEUC + 6)
End Sub
Private Sub CadCutPage_Loaded(sender As Object, e As RoutedEventArgs)
@@ -144,6 +148,8 @@ Public Class CadCutPageUC
' Non devo fare alcunchè
End Select
End If
+ ' Cancello progetto salvato con nome da file ini
+ WritePrivateProfileString(S_GENERAL, K_LASTNAMEPROJ, "", m_MainWindow.GetIniFile())
m_MainWindow.m_CurrentProjectPageUC.NewProject()
EgtZoom(ZM.ALL)
End Sub
@@ -167,20 +173,37 @@ Public Class CadCutPageUC
m_MainWindow.m_ActivePage = MainWindow.Pages.Open
End Sub
- Friend Sub PostLoad(ByVal sPath As String)
+ Friend Sub PostLoad(ByVal sCurrDir As String, sCurrFile As String)
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
- If Not m_MainWindow.m_CurrentProjectPageUC.LoadProject(sPath) Then
+ If Not m_MainWindow.m_CurrentProjectPageUC.LoadProject(sCurrDir & "\" & sCurrFile) Then
m_MainWindow.m_CurrentProjectPageUC.NewProject()
+ Else
+ ' Verifico se file salvato con nome guardando il nome della cartella in cui si trova
+ Dim sSaveDir As String = String.Empty
+ GetPrivateProfileString(S_GENERAL, K_SAVEDIR, "", sSaveDir, m_MainWindow.GetIniFile())
+ If Not sCurrDir = sSaveDir Then
+ WritePrivateProfileString(S_GENERAL, K_LASTNAMEPROJ, sCurrFile.Substring(0, sCurrFile.Length - 4), m_MainWindow.GetIniFile())
+ End If
End If
EgtZoom(ZM.ALL)
End Sub
Private Sub SaveBtn_Click(sender As Object, e As RoutedEventArgs) Handles SaveBtn.Click
' Eseguo salvataggio
+ Dim sCurrNameProj As String = String.Empty
+ GetPrivateProfileString(S_GENERAL, K_LASTNAMEPROJ, "", sCurrNameProj, m_MainWindow.GetIniFile())
+ If Not String.IsNullOrEmpty(sCurrNameProj) Then
+ m_MainWindow.m_CurrentProjectPageUC.SaveNameProject()
+ End If
m_MainWindow.m_CurrentProjectPageUC.SaveProject()
EgtDraw()
End Sub
+ Private Sub SaveNameBtn_Click(sender As Object, e As RoutedEventArgs) Handles SaveNameBtn.Click
+ m_SaveNameWD = New SaveNameWD(m_MainWindow)
+ m_SaveNameWD.ShowDialog()
+ End Sub
+
Private Sub SimulateBtn_Click(sender As Object, e As RoutedEventArgs) Handles SimulateBtn.Click
m_MainWindow.m_CurrentProjectPageUC.CurrProjGrid.Visibility = Windows.Visibility.Hidden
m_MainWindow.m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Remove(m_MainWindow.m_CadCutPageUC)
diff --git a/ChooseMachining.xaml b/ChooseMachining.xaml
index ae72d80..c266c0f 100644
--- a/ChooseMachining.xaml
+++ b/ChooseMachining.xaml
@@ -1,10 +1,11 @@
-
-
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ FontFamily="./Resources/Fonts/#Century Gothic"
+ ResizeMode="NoResize" WindowStyle="None" AllowsTransparency="True" Background="Transparent"
+ Title="ChooseMachining" Height="255.9" Width="426.5">
+
+
diff --git a/ConstGen.vb b/ConstGen.vb
index fc95ec3..45775b6 100644
--- a/ConstGen.vb
+++ b/ConstGen.vb
@@ -41,6 +41,8 @@ Module ConstGen
Public Const CNC_DIR As String = "CNC"
' Sottodirettorio di default per il salvataggio
Public Const SAVE_DFL_DIR As String = "Data"
+ ' Sottodirettorio di default per il salvataggio con nome
+ Public Const SAVE_DFL_NAMEDIR As String = "MyProjects"
' Sottodirettorio di default per le macchine
Public Const MACHINES_DFL_DIR As String = "Machines"
diff --git a/ConstIni.vb b/ConstIni.vb
index d094e99..3746316 100644
--- a/ConstIni.vb
+++ b/ConstIni.vb
@@ -24,8 +24,10 @@ Module ConstIni
Public Const K_MMUNITS As String = "MmUnits"
Public Const K_MAXPROJ As String = "MaxProj"
Public Const K_LASTPROJ As String = "LastProj"
+ Public Const K_LASTNAMEPROJ As String = "LastNameProj"
Public Const K_AUTOLOADLASTPROJ As String = "AutoLoadLastProj"
Public Const K_SAVEDIR As String = "SaveDir"
+ Public Const K_SAVENAMEDIR As String = "SaveNameDir"
Public Const K_IMAGEDIR As String = "ImageDir"
Public Const K_CAMERALINK As String = "CameraLink"
Public Const K_CNLINK As String = "CNLink"
diff --git a/CurrentProjectPageUC.xaml.vb b/CurrentProjectPageUC.xaml.vb
index 4fafab8..ddbb34f 100644
--- a/CurrentProjectPageUC.xaml.vb
+++ b/CurrentProjectPageUC.xaml.vb
@@ -341,6 +341,48 @@ Public Class CurrentProjectPageUC
Return bOk
End Function
+ Friend Function SaveNameProject() As Boolean
+ ' Determino nome del progetto
+ Dim CurrProjName As String = String.Empty
+ If Not IsNothing(m_MainWindow.m_CadCutPageUC.m_SaveNameWD) Then
+ CurrProjName = m_MainWindow.m_CadCutPageUC.m_SaveNameWD.SaveNameTxBx.Text
+ Else
+ GetPrivateProfileString(S_GENERAL, K_LASTNAMEPROJ, "", CurrProjName, m_MainWindow.GetIniFile())
+ End If
+ Dim sPath As String = m_MainWindow.GetSaveNameDir() & "\" & CurrProjName & ".nge"
+ ' Aggiorno file Ini
+ WritePrivateProfileString(S_GENERAL, K_LASTNAMEPROJ, CurrProjName, m_MainWindow.GetIniFile())
+ ' Rinomino eventuale fotografia
+ Dim nPhotoId As Integer = GetPhoto()
+ If nPhotoId <> GDB_ID.NULL Then
+ ' Path originale
+ Dim sPhoto As String = String.Empty
+ EgtGetPhotoPath(nPhotoId, sPhoto)
+ ' Nuova path
+ Dim sNewPhoto As String = Path.ChangeExtension(sPath, Path.GetExtension(sPhoto))
+ ' Se diverse, eseguo copia
+ If Not String.Equals(sPhoto, sNewPhoto, StringComparison.InvariantCultureIgnoreCase) Then
+ Try
+ File.Copy(sPhoto, sNewPhoto, True)
+ Catch ex As Exception
+ Return False
+ End Try
+ End If
+ ' Notifico a foto il cambio di path
+ EgtChangePhotoPath(nPhotoId, sNewPhoto)
+ End If
+ ' Se assente, inserisco contrassegno di progetto OmagCut valido
+ AddProjectMark()
+ ' Eseguo
+ If Not SaveFile(sPath) Then
+ Return False
+ End If
+ ' Dichiaro progetto non modificato
+ EgtResetModified()
+ Return True
+ End Function
+
+
Friend Function RemovePreviewFromParts() As Boolean
' Processo i sottogruppi, se di livello System li rimuovo
Dim nGrpId As Integer = EgtGetFirstGroupInGroup(GDB_ID.ROOT)
diff --git a/MainWindow.xaml.vb b/MainWindow.xaml.vb
index a6ba940..8390c3f 100644
--- a/MainWindow.xaml.vb
+++ b/MainWindow.xaml.vb
@@ -42,6 +42,7 @@ Class MainWindow
Private m_sResourcesDir As String = String.Empty
Private m_sTempDir As String = String.Empty
Private m_sSaveDir As String = String.Empty
+ Private m_sSaveNameDir As String = String.Empty
Private m_sCncDir As String = String.Empty
Private m_sMachinesRoot As String = String.Empty
Private m_sIniFile As String = String.Empty
@@ -97,6 +98,10 @@ Class MainWindow
Return m_sSaveDir
End Function
+ Public Function GetSaveNameDir() As String
+ Return m_sSaveNameDir
+ End Function
+
Public Function GetCamAutoDir() As String
Return m_sDataRoot & "\" & CAMAUTO_DIR
End Function
@@ -135,10 +140,14 @@ Class MainWindow
m_sCncDir = m_sDataRoot & "\" & CNC_DIR
' Impostazione path Ini file
m_sIniFile = m_sConfigDir & "\" & INI_FILE_NAME
- ' Impostazione direttorio di salvataggio
+ ' Impostazione direttorio di salvataggio automatico
If GetPrivateProfileString(S_GENERAL, K_SAVEDIR, "", m_sSaveDir, m_sIniFile) = 0 Then
m_sSaveDir = m_sDataRoot & "\" & SAVE_DFL_DIR
End If
+ ' Impostazione direttorio di salvataggio dei progetti con nome
+ If GetPrivateProfileString(S_GENERAL, K_SAVENAMEDIR, "", m_sSaveNameDir, m_sIniFile) = 0 Then
+ m_sSaveNameDir = m_sDataRoot & "\" & SAVE_DFL_NAMEDIR
+ End If
' Impostazione direttorio per le macchine
If GetPrivateProfileString(S_MACH, K_MACHINESDIR, "", m_sMachinesRoot, m_sIniFile) = 0 Then
m_sMachinesRoot = m_sDataRoot & "\" & MACHINES_DFL_DIR
diff --git a/NestPageUC.xaml b/NestPageUC.xaml
index 1286ee5..4d3c7b1 100644
--- a/NestPageUC.xaml
+++ b/NestPageUC.xaml
@@ -119,10 +119,10 @@
-
-
+
+
+
-
diff --git a/OmagCUT.vbproj b/OmagCUT.vbproj
index 4ac40fd..552f483 100644
--- a/OmagCUT.vbproj
+++ b/OmagCUT.vbproj
@@ -209,6 +209,9 @@
OptionsPageUC.xaml
+
+ SaveNameWD.xaml
+ SawTestUC.xaml
@@ -361,6 +364,10 @@
DesignerMSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+ MSBuild:CompileDesigner
diff --git a/OpenPageUC.xaml b/OpenPageUC.xaml
index 7b5bc47..a438deb 100644
--- a/OpenPageUC.xaml
+++ b/OpenPageUC.xaml
@@ -1,68 +1,70 @@
-
-
-
-
-
-
-
-
-
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ mc:Ignorable="d"
+ d:DesignHeight="853.3" d:DesignWidth="1280" Initialized="OpenPage_Initialized" Loaded="OpenPage_Loaded" Unloaded="OpenPage_Unloaded">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/OpenPageUC.xaml.vb b/OpenPageUC.xaml.vb
index 79ba5ec..1a669dd 100644
--- a/OpenPageUC.xaml.vb
+++ b/OpenPageUC.xaml.vb
@@ -81,7 +81,7 @@ Public Class OpenPageUC
' inizializzo gestore lavorazioni
EgtInitMachMgr(m_MainWindow.GetMachinesRootDir())
' leggo direttorio corrente
- GetPrivateProfileString(S_GENERAL, K_SAVEDIR, "", m_sCurrDir, m_MainWindow.GetIniFile())
+ GetPrivateProfileString(S_GENERAL, K_SAVENAMEDIR, "", m_sCurrDir, m_MainWindow.GetIniFile())
' lo carico
LoadCurrDir()
m_bFirst = False
@@ -272,7 +272,7 @@ Public Class OpenPageUC
Private Sub ConfirmBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
' Lancio caricamento nuovo progetto corrente
If m_bFileOk Then
- m_MainWindow.m_CadCutPageUC.PostLoad(m_sCurrDir & "\" & m_sCurrFile)
+ m_MainWindow.m_CadCutPageUC.PostLoad(m_sCurrDir, m_sCurrFile)
End If
' Istruzioni per chiudere OpenPageUC e aprire currentproject e cadcut page
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_OpenPage)
diff --git a/SaveNameWD.xaml b/SaveNameWD.xaml
new file mode 100644
index 0000000..95a9030
--- /dev/null
+++ b/SaveNameWD.xaml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SaveNameWD.xaml.vb b/SaveNameWD.xaml.vb
new file mode 100644
index 0000000..2330797
--- /dev/null
+++ b/SaveNameWD.xaml.vb
@@ -0,0 +1,26 @@
+Imports EgtUILib
+
+Public Class SaveNameWD
+
+ ' Riferimento alla MainWindow
+ Private m_MainWindow As MainWindow = Application.Current.MainWindow
+
+ Sub New(Owner As Window)
+ Me.Owner = Owner
+ InitializeComponent()
+ End Sub
+
+ Private Sub SaveNameWD_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
+ Me.Top = Owner.Top + Owner.Height / 2 - Me.Height / 2
+ Me.Left = Owner.Left + Owner.Width / 2 - Me.Width / 2
+ SaveNameTxbl.Text = "Nome del progetto da salvare"
+ End Sub
+
+ Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
+ ' Eseguo salvataggio
+ m_MainWindow.m_CurrentProjectPageUC.SaveNameProject()
+ m_MainWindow.m_CurrentProjectPageUC.SaveProject()
+ EgtDraw()
+ End Sub
+
+End Class