Compare commits

...

1 Commits

Author SHA1 Message Date
Nicola Pievani 9b0e464e4b Ricavo contorno da codice python 2024-08-28 11:07:57 +02:00
+26 -1
View File
@@ -142,8 +142,33 @@ Public Class PhotoPageUC
Dim sPhoto As String = m_sCurrDir & "\" & m_sCurrFile Dim sPhoto As String = m_sCurrDir & "\" & m_sCurrFile
Dim sContour As String = String.Empty Dim sContour As String = String.Empty
If m_MainWindow.m_Camera.GetCalcContour() Then 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") sContour = Path.ChangeExtension(sPhoto, "dxf")
End If End If
m_MainWindow.m_CadCutPageUC.PostPhoto(sPhoto, sContour) m_MainWindow.m_CadCutPageUC.PostPhoto(sPhoto, sContour)
End If End If
End Sub End Sub