Files
OmagCUT/SaveNameWD.xaml.vb
T
Dario Sassi 516f24bd88 OmagCUT 1.6t3 :
- sostituzione di CInt con StringToInt dove può fallire
- aggiunto Cancel per interrompere attesa tastatura
- permesso uso di tagli allungati da una sola parte e fresature per dividere i grezzi se movimento con ventose
- rotazione ventosa si adatta molto meglio alla forma del pezzo
- corretta visualizzazione angoli di taglio su pezzi parametrici con lavorazioni interne
- corretti tagli diretti multipli e griglia (crash)
- corretta gestione mm/inches in spianatura di tagli diretti
- aggiunta gestione punto da mouse in test lama di tagli diretti
- verificata dichiarazione pagine non attive su Unload.
2016-08-25 16:21:39 +00:00

81 lines
3.2 KiB
VB.net

Imports System.IO
Imports EgtUILib
Imports EgtWPFLib
Public Class SaveNameWD
' Riferimento alla MainWindow
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, 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
If m_MainWindow.m_ActivePage <> MainWindow.Pages.DirectCut Then
SaveNameTxbl.Text = EgtMsg(MSG_CADCUTPAGEUC + 7) 'Nuovo nome del progetto
GetPrivateProfileString(S_GENERAL, K_LASTNAMEPROJ, "", SaveNameTxBx.Text, m_MainWindow.GetIniFile())
Else
SaveNameTxbl.Text = EgtMsg(MSG_DIRECTCUTPAGEUC + 45) 'Nuovo nome della dima
End If
End Sub
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
Dim sPath As String = String.Empty
If m_MainWindow.m_ActivePage <> MainWindow.Pages.DirectCut Then
' Creo path completa con nome inserito
sPath = m_MainWindow.GetNamedSaveDir() & "\" & SaveNameTxBx.Text & ".nge"
Else
sPath = m_MainWindow.GetCopyTemplateDir() & "\" & SaveNameTxBx.Text & ".dxf"
End If
' Verifico se il nome inserito è già utilizzato
If File.Exists(sPath) Then
Dim ConfirmWD As New EgtMsgBox(m_MainWindow, "", EgtMsg(MSG_EGTMSGBOX + 6), EgtMsgBox.Buttons.OK_CANCEL, EgtMsgBox.Icons.NULL)
Select Case ConfirmWD.DialogResult
Case 0 'Cancel
' Esco
Return
End Select
End If
If m_MainWindow.m_ActivePage <> MainWindow.Pages.DirectCut Then
' Aggiorno file Ini
WritePrivateProfileString(S_GENERAL, K_LASTNAMEPROJ, SaveNameTxBx.Text, m_MainWindow.GetIniFile())
' Eseguo salvataggio
m_MainWindow.m_CurrentProjectPageUC.SaveNamedProject()
m_MainWindow.m_CurrentProjectPageUC.SaveProject()
' Se cornici, ripristino visualizzazione lavorazioni
If m_MainWindow.m_ActivePage = MainWindow.Pages.FrameCut Then
ShowAllCurrPhaseMachinings()
End If
Else
' Recupero nome gruppo da esportare
Dim nId = EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_COPYTEMPLATE)
' Se UI in pollici, scalo opportunamente per avere DXF in pollici
Dim bScale As Boolean = Not EgtUiUnitsAreMM()
If bScale Then EgtScale(nId, Frame3d.GLOB, 1 / ONEINCH, 1 / ONEINCH, 1 / ONEINCH, GDB_RT.GLOB)
' Eseguo esportazione
EgtExportDxf(nId, sPath)
' Se necessario, ripristino scala
If bScale Then EgtScale(nId, Frame3d.GLOB, ONEINCH, ONEINCH, ONEINCH, GDB_RT.GLOB)
End If
EgtDraw()
Close()
End Sub
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
EgtDraw()
Close()
End Sub
Private Sub Me_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
If e.Key = Key.System And e.SystemKey = Key.F4 Then
e.Handled = True
End If
End Sub
End Class