OmagCUT 1.9g3 :

- modifiche per importare direttamente pezzi da file nge di tipo OmagCUT
- piccole modifiche a gestione Linea Custom per recupero geometrie pezzi rovinati.
This commit is contained in:
Dario Sassi
2018-07-23 06:08:39 +00:00
parent f983950b0b
commit 9c7888d329
5 changed files with 42 additions and 10 deletions
+18 -6
View File
@@ -26,6 +26,8 @@ Public Class ImportPageUC
Private m_bEnableTrf As Boolean = False
' Costante per formato TRF
Private Const FT_TRF As Integer = 51
' Costante per formato CUT
Private Const FT_CUT As Integer = 52
' Indentificativo del pezzo selezionato
Private m_nSelectedPart As Integer = GDB_ID.NULL
@@ -301,8 +303,16 @@ Public Class ImportPageUC
ElseIf m_nFileType = FT.NGE Then
' Carico Nge
bOk = bOk AndAlso EgtOpenFile(sPath)
' Verifico se progetto OmagCut
If EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK) <> GDB_ID.NULL Then
Dim bIsFrame As Boolean = (EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_FRAME) <> GDB_ID.NULL)
If (m_MainWindow.m_PrevActivePage = MainWindow.Pages.CadCut And Not bIsFrame) Or
(m_MainWindow.m_PrevActivePage = MainWindow.Pages.FrameCut And bIsFrame) Then
m_nFileType = FT_CUT
End If
End If
' Filtro Nge
bOk = bOk AndAlso FilterNge()
bOk = bOk AndAlso FilterNge(m_nFileType = FT.NGE)
ElseIf m_nFileType = FT_TRF Then
' Carico Trf
bOk = bOk AndAlso ImportTrf(sPath)
@@ -327,8 +337,8 @@ Public Class ImportPageUC
SideAngleBtn.IsEnabled = False
DripCutBtn.IsEnabled = False
DripDrillBtn.IsEnabled = False
ElseIf m_nFileType = FT_TRF Then
' abilito bottoni UseLayer, UseClosedCurve e UseRegion, disabilito Reset e Insert
ElseIf m_nFileType = FT_TRF Or m_nFileType = FT_CUT Then
' abilito bottone Insert, disabilito bottoni UseLayer, UseClosedCurve, UseRegion e Reset
UseLayerBtn.IsEnabled = False
UseClosedCurveBtn.IsEnabled = False
UseRegionBtn.IsEnabled = False
@@ -342,6 +352,8 @@ Public Class ImportPageUC
End If
' altrimenti import per cornici
Else
mmBtn.IsEnabled = (m_nFileType = FT.DXF)
inchBtn.IsEnabled = (m_nFileType = FT.DXF)
OkBtn.IsEnabled = True
End If
Return bOk
@@ -522,7 +534,7 @@ Public Class ImportPageUC
DripDrillBtn.IsEnabled = True
End Sub
Private Function FilterNge() As Boolean
Private Function FilterNge(bEraseNames As Boolean) As Boolean
' Rimuovo eventuali gruppi con livello System
Dim nId As Integer = EgtGetFirstGroupInGroup(GDB_ID.ROOT)
While nId <> GDB_ID.NULL
@@ -537,7 +549,7 @@ Public Class ImportPageUC
' Passo al prossimo gruppo
nId = nNextId
End While
' Processo i sottogruppi, se di livello System li rimuovo altrimenti ne cancello il nome
' Processo i sottogruppi, se di livello System li rimuovo altrimenti se richiesto ne cancello il nome
Dim nGrpId As Integer = EgtGetFirstGroupInGroup(GDB_ID.ROOT)
While nGrpId <> GDB_ID.NULL
' Ciclo sui sottogruppi
@@ -550,7 +562,7 @@ Public Class ImportPageUC
EgtGetLevel(nSubId, nLevel)
If nLevel = GDB_LV.SYSTEM Then
EgtErase(nSubId)
Else
ElseIf bEraseNames Then
EgtRemoveName(nSubId)
End If
nSubId = nNextSubId
+21 -2
View File
@@ -1256,6 +1256,9 @@ Class MainWindow
' Se non esiste file PPL, esco
Dim sSouPplFile As String = m_CurrentMachine.sLineDataDir & "\" & CURR_PROJ_PPL
If Not My.Computer.FileSystem.FileExists(sSouPplFile) Then Return True
' Se non esiste file NGE, esco
Dim sSouNgeFile As String = m_CurrentMachine.sLineDataDir & "\" & CURR_PROJ_NGE
If Not My.Computer.FileSystem.FileExists(sSouNgeFile) Then Return True
' Sposto file epl dei pezzi rovinati nel direttorio temporaneo
Dim sDestEplFile = m_sTempDir & "\" & CURR_PROJ_EPL
Try
@@ -1270,13 +1273,22 @@ Class MainWindow
Catch ex As Exception
EgtOutLog("Error moving or erasing " & sSouPplFile)
End Try
' Sposto file nge dei pezzi prodotti nel direttorio temporaneo
Dim sDestNgeFile = m_sTempDir & "\" & CURR_PROJ_NGE
Try
My.Computer.FileSystem.MoveFile(sSouNgeFile, sDestNgeFile, True)
Catch ex As Exception
EgtOutLog("Error moving or erasing " & sSouNgeFile)
End Try
' Leggo variabile con ultimo progetto mandato a OmagView
Dim nLastCopy As Integer = GetPrivateProfileInt(S_GENERAL, K_LASTPROJTOVIEW, 0, GetIniFile())
' Leggo variabile con data termine lavorazione e inizio scarico
Dim sDateTime As String = String.Empty
GetPrivateProfileString(S_GENERAL, K_DATETIMETOVIEW, "", sDateTime, GetIniFile())
' Recupero direttorio per pezzi rovinati
Dim sRuPartsDir As String = GetRuinedPartsDir()
' Esecuzione dello script custom
ExecReceivedViewScript(nLastCopy, sDateTime)
ExecReceivedViewScript(nLastCopy, sDateTime, sRuPartsDir)
' Cancello file dei pezzi rovinati
Try
My.Computer.FileSystem.DeleteFile(sDestEplFile)
@@ -1289,10 +1301,16 @@ Class MainWindow
Catch ex As Exception
EgtOutLog("Error erasing " & sDestPplFile)
End Try
' Cancello file con le geometrie dei pezzi
Try
My.Computer.FileSystem.DeleteFile(sDestNgeFile)
Catch ex As Exception
EgtOutLog("Error erasing " & sDestNgeFile)
End Try
Return True
End Function
Private Function ExecReceivedViewScript(nLastCopy As Integer, sDateTime As String) As Boolean
Private Function ExecReceivedViewScript(nLastCopy As Integer, sDateTime As String, sRuPartsDir As String) As Boolean
' Verifico esistenza script
Dim sLuaPath As String = m_CurrentMachine.sMachDir() & "\Scripts\ReceivedView.lua"
If Not My.Computer.FileSystem.FileExists(sLuaPath) Then Return True
@@ -1302,6 +1320,7 @@ Class MainWindow
EgtLuaSetGlobBoolVar("RVS.PRODLINE", m_CurrentMachine.bProdLine)
EgtLuaSetGlobStringVar("RVS.LASTCOPY", nLastCopy.ToString("D4"))
EgtLuaSetGlobStringVar("RVS.DATETIME", sDateTime)
EgtLuaSetGlobStringVar("RVS.RUPARTSDIR", sRuPartsDir)
' Esecuzione
Dim nErr As Integer = 999
If EgtLuaExecFile(sLuaPath) AndAlso
+2 -2
View File
@@ -62,5 +62,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.9.7.2")>
<Assembly: AssemblyFileVersion("1.9.7.2")>
<Assembly: AssemblyVersion("1.9.7.3")>
<Assembly: AssemblyFileVersion("1.9.7.3")>
+1
View File
@@ -743,6 +743,7 @@ Public Class NestPageUC
' Se pezzo da Trf, verifico compatibilità
If Not VerifyTrfData(nId) Then
bWrongTrf = True
EgtSetStatus(nId, GDB_ST.ON_)
' Passo al successivo selezionato
nId = nNextId
Continue While
Binary file not shown.

Before

Width:  |  Height:  |  Size: 620 B

After

Width:  |  Height:  |  Size: 1.0 KiB