diff --git a/RawPhoto/PhotoPageUC.xaml.vb b/RawPhoto/PhotoPageUC.xaml.vb index 178b17e..fcb98ad 100644 --- a/RawPhoto/PhotoPageUC.xaml.vb +++ b/RawPhoto/PhotoPageUC.xaml.vb @@ -142,8 +142,33 @@ Public Class PhotoPageUC Dim sPhoto As String = m_sCurrDir & "\" & m_sCurrFile Dim sContour As String = String.Empty If m_MainWindow.m_Camera.GetCalcContour() Then + + ' ----------------------- LANCIO file Batch per eseguire codice Python ----------------------- + Dim FileBatch As String = "C:\EgtData\OmagCUT\Temp\PostPhotoTemplate.bat" + If File.Exists(FileBatch) Then + Dim FileBatchCopy As String = "C:\EgtData\OmagCUT\Temp\PostPhoto.bat" + Try + IO.File.Delete(FileBatchCopy) + Catch ex As Exception + End Try + IO.File.Copy(FileBatch, FileBatchCopy) + Dim sFilePhoto As String = Path.GetDirectoryName(sPhoto) & "\" & Path.GetFileNameWithoutExtension(sPhoto) + IO.File.WriteAllText(FileBatchCopy, IO.File.ReadAllText(FileBatchCopy).Replace("£_FILE_IMAGE_£", sFilePhoto)) + ' Creo file Dxf del contorno + Dim RunPython As Process = Process.Start(FileBatchCopy) + While Not RunPython.HasExited + ' Attendo che il processo sia terminato + System.Threading.Thread.Sleep(1000) + End While + Try + IO.File.Delete(FileBatchCopy) + Catch ex As Exception + End Try + End If + ' ----------------------- LANCIO file Batch per eseguire codice Python ----------------------- + sContour = Path.ChangeExtension(sPhoto, "dxf") - End If + End If m_MainWindow.m_CadCutPageUC.PostPhoto(sPhoto, sContour) End If End Sub