OmagCUT :

- aggiunta gestione parametri generali per WaterJet (ottimizza e lavora interni)
- sistemazione nomi costanti, variabili e funzioni
- semplificazione in Wj gestione scelta punto iniziale e separazione lato.
This commit is contained in:
Dario Sassi
2026-03-15 18:37:10 +01:00
parent c0e8838394
commit 4277434fce
9 changed files with 249 additions and 222 deletions
+7 -3
View File
@@ -255,7 +255,7 @@ Friend Module CamAuto
Dim nIdPart As Integer = EgtGetFirstPart()
While nIdPart <> GDB_ID.NULL
' elimino il layer dei flag di separazione "AUX_SPLIT_WJ"
Dim IdAuxLayer As Integer = EgtGetFirstNameInGroup(nIdPart, INFO_AUX_SPLIT_WJ)
Dim IdAuxLayer As Integer = EgtGetFirstNameInGroup(nIdPart, LAY_AUX_SPLIT_WJ)
EgtErase(IdAuxLayer)
' accedo al Layer OutLoop
Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP)
@@ -270,7 +270,7 @@ Friend Module CamAuto
nIdPart = EgtGetFirstPartInRawPart(nRawId)
While nIdPart <> GDB_ID.NULL
' elimino il layer dei flag di separazione "AUX_SPLIT_WJ"
Dim IdAuxLayer As Integer = EgtGetFirstNameInGroup(nIdPart, INFO_AUX_SPLIT_WJ)
Dim IdAuxLayer As Integer = EgtGetFirstNameInGroup(nIdPart, LAY_AUX_SPLIT_WJ)
EgtErase(IdAuxLayer)
' accedo al Layer OutLoop
Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP)
@@ -328,7 +328,7 @@ Friend Module CamAuto
Dim nNextParId As Integer = EgtGetNextPartInRawPart(nParId)
' verifico se il pezzo passato è un taglio di sepatazione (il nome deve contenere "SpliCut")
Dim sName As String = String.Empty
If EgtGetName(nParId, sName) AndAlso sName.Contains(SPLIT_CUT) Then
If EgtGetName(nParId, sName) AndAlso sName.Contains(NAME_SPLIT_CUT) Then
' Rimuovo il pezzo dal grezzo
If EgtRemovePartFromRawPart(nParId) Then
' Salvo l'indice del pezzo se non è stato già inserito
@@ -1065,6 +1065,8 @@ Friend Module CamAuto
Dim bMillingOnCorners As Boolean = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_MILLING_ON_CORNERS, 1, m_MainWindow.GetMachIniFile()) <> 0)
Dim bMillingOnSinks As Boolean = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_MILLING_ON_SINKS, 0, m_MainWindow.GetMachIniFile()) <> 0)
Dim dMillingShort As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_MILLING_SHORTENING, 0, m_MainWindow.GetMachIniFile())
Dim bWaterjetOptimize As Boolean = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_WATERJET_OPTIMIZE, 0, m_MainWindow.GetMachIniFile()) <> 0)
Dim bWaterjetOnSinks As Boolean = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_WATERJET_ON_SINKS, 0, m_MainWindow.GetMachIniFile()) <> 0)
EgtLuaSetGlobStringVar("CAM.MATERIAL", sMaterial)
EgtLuaSetGlobStringVar("CAM.SAWMCH", sSawMch)
EgtLuaSetGlobStringVar("CAM.SAWTILTEDMCH", sSawTiltedMch)
@@ -1084,6 +1086,8 @@ Friend Module CamAuto
EgtLuaSetGlobBoolVar("CAM.MILLINGONCORNERS", bMillingOnCorners)
EgtLuaSetGlobBoolVar("CAM.MILLINGONSINKS", bMillingOnSinks)
EgtLuaSetGlobNumVar("CAM.MILLINGSHORT", dMillingShort)
EgtLuaSetGlobBoolVar("CAM.WATERJETOPTIMIZE", bWaterjetOptimize)
EgtLuaSetGlobBoolVar("CAM.WATERJETONSINKS", bWaterjetOnSinks)
EgtLuaSetGlobNumVar("CAM.RAWHEIGHT", GetRawHeight())
EgtLuaSetGlobNumVar("CAM.REGROT", GetRegistrationRotation())
Return True
+144 -181
View File
@@ -352,62 +352,57 @@ Public Class NestPageUC
' Se non abilitata separazione lato waterjet o bottone mouse non Left, esco
If Not m_bIsCheckedSplitCurveWJ Or e.Button <> Windows.Forms.MouseButtons.Left Then Return
' Se esiste un elemento selezionato
EgtResetMark(m_nIdSelectedWaterJet)
' Verifico se selezionato indicativo di pezzo
' Imposto riconoscimento entità in finestra di selezione
EgtSetObjFilterForSelWin(False, True, False, False, False)
Dim nSelMy As Integer
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSelMy)
Dim nIdMy As Integer = EgtGetFirstObjInSelWin()
While nIdMy <> GDB_ID.NULL
' Ciclo su entità in finestra di selezione
Dim nMyId As Integer = EgtGetFirstObjInSelWin()
While nMyId <> GDB_ID.NULL
' Recupero layer di appartenenza e suo nome
Dim nLayerId As Integer = EgtGetParent(nMyId)
Dim sLayer As String = String.Empty
' layer di origine
Dim nIdParent As Integer = EgtGetParent(nIdMy)
' recupero il nome del Layer
EgtGetName(nIdParent, sLayer)
EgtGetName(nLayerId, sLayer)
' solo se il nome del layer è quello associato ad un lato esterno allora procedo con l'evidenziazione
If sLayer = NAME_OUTLOOP Then
If EgtGetType(nIdMy) = GDB_TY.CRV_ARC OrElse EgtGetType(nIdMy) = GDB_TY.CRV_COMPO OrElse EgtGetType(nIdMy) = GDB_TY.CRV_LINE Then
If m_nIdSelectedSideWJ <> GDB_ID.NULL Or m_nIdSelectedSideWJ = nIdMy Then
If EgtGetType(nMyId) = GDB_TY.CRV_ARC OrElse EgtGetType(nMyId) = GDB_TY.CRV_COMPO OrElse EgtGetType(nMyId) = GDB_TY.CRV_LINE Then
If m_nIdSelectedSideWJ <> GDB_ID.NULL Or m_nIdSelectedSideWJ = nMyId Then
EgtDeselectObj(m_nIdSelectedSideWJ)
End If
' recupero il gruppo della lavorazione associata
Dim nIdParentPart As Integer = EgtGetParent(nIdParent)
Dim nIdPV As Integer = EgtGetFirstNameInGroup(nIdParentPart, NAME_PREVIEW)
' recupero l'elenco delle Preview di Tipo WaterJet associate a questo Part
Dim ListGroup As List(Of Integer) = ResearchGropuWJ(nIdParent, nIdPV)
' se esiste almeno 1 Preview di tipo WaterJet
If ListGroup.Count > 0 Then
m_nIdSelectedSideWJ = nIdMy
Dim nPartId As Integer = EgtGetParent(nLayerId)
Dim nPartPvId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_PREVIEW)
' recupero Preview di tipo WaterJet associato all'entità
Dim nWjPvId As Integer = GetCurrentPreViewFromSide( nMyId, nPartPvId)
If nWjPvId <> GDB_ID.NULL Then
m_nIdSelectedSideWJ = nMyId
Dim nValInfo As Integer = 0
If EgtGetInfo(nIdMy, INFO_JOINENTITY, nValInfo) Then
If EgtGetInfo(nMyId, INFO_JOINENTITY, nValInfo) Then
nValInfo = If( nValInfo = 1, 0, 1)
End If
EgtSetInfo(nIdMy, INFO_JOINENTITY, nValInfo)
EgtSetInfo(nMyId, INFO_JOINENTITY, nValInfo)
' Ricalcolo tutte le lavorazioni
Dim nWarn As Integer = 0
ResetAllMachinings(nWarn)
' recupero l'indice del PreView che deve essere acceso per indicare la selezione
ListGroup = ResearchGropuWJ(nIdParent, nIdPV)
Dim nIdWJ As Integer = GetPVIdFromIdSide(ListGroup, nIdMy)
GetCurrentPVFromIdSide(ListGroup, nIdMy, nIdWJ, nIdParent)
' assegno un identificativo grafico per indicare che è un taglio separato
' Recupero nuovo Preview associato alla lavorazione dell'entità
nWjPvId = GetCurrentPreViewFromSide( nMyId, nPartPvId)
' Assegno un identificativo grafico per indicare che è un taglio separato
If nValInfo = 0 Then
AssignFlagOnGraphic(nIdMy, nIdParentPart)
AssignFlagOnGraphic(nMyId, nPartId)
Else
EraseFlagOnGraphic(nIdMy, nIdParentPart)
EraseFlagOnGraphic(nMyId, nPartId)
End If
' salvo il valore del PreView evidenziato
m_nIdSelectedWaterJet = nIdWJ
EgtSetMark(nIdWJ)
EgtSelectObj(nIdMy)
' Salvo il valore del PreView evidenziato
m_nIdSelectedWaterJet = nWjPvId
EgtSetMark(nWjPvId)
EgtSelectObj(nMyId)
EgtDraw()
Exit While
End If
End If
End If
nIdMy = EgtGetNextObjInSelWin()
nMyId = EgtGetNextObjInSelWin()
End While
End Sub
@@ -418,7 +413,7 @@ Public Class NestPageUC
' Se non abilitato spostamento punto inizio waterjet o bottone mouse non Left, esco
If Not m_bIsCheckedStartCurveWJ Or e.Button <> Windows.Forms.MouseButtons.Left Then Return
' Acquisisco punto da disegno
' Acquisisco punto di selezione
Dim ptStartCurv As New Point3d
EgtUnProjectPoint(e.Location, ptStartCurv)
' Aggiusto Z punto acquisito (è in globale)
@@ -428,56 +423,54 @@ Public Class NestPageUC
ptStartCurv.z = ptRawMax.z
End If
' Se esiste un elemento selezionato
EgtResetMark(m_nIdSelectedWaterJet)
' Verifico se selezionato indicativo di pezzo
' Imposto riconoscimento entità in finestra di selezione
EgtSetObjFilterForSelWin(False, True, False, False, False)
Dim nSelMy As Integer
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSelMy)
Dim nIdMy As Integer = EgtGetFirstObjInSelWin()
While nIdMy <> GDB_ID.NULL
Dim nMySel As Integer
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nMySel)
' Ciclo su entità in finestra di selezione
Dim nEntId As Integer = EgtGetFirstObjInSelWin()
While nEntId <> GDB_ID.NULL
' Recupero layer di appartenenza e suo nome
Dim nLayerId As Integer = EgtGetParent(nEntId)
Dim sLayer As String = String.Empty
' layer di origine
Dim nIdParent As Integer = EgtGetParent(nIdMy)
' recupero il nome del Layer
EgtGetName(nIdParent, sLayer)
' solo se il nome del layer è quello associato ad un lato esterno allora procedo con l'evidenziazione
EgtGetName(nLayerId, sLayer)
' Se il nome del layer è quello associato ad un lato esterno o interno allora procedo
If sLayer = NAME_OUTLOOP Or sLayer = NAME_INLOOP Then
If EgtGetType(nIdMy) = GDB_TY.CRV_ARC OrElse EgtGetType(nIdMy) = GDB_TY.CRV_COMPO OrElse EgtGetType(nIdMy) = GDB_TY.CRV_LINE Then
' verifico che il contorno sia chiuso, altrimenti esco
If Not VerifyOutLoopIsClosed(nIdParent) Then
If EgtGetType(nEntId) = GDB_TY.CRV_ARC OrElse EgtGetType(nEntId) = GDB_TY.CRV_COMPO OrElse EgtGetType(nEntId) = GDB_TY.CRV_LINE Then
' Verifico che il contorno sia chiuso, altrimenti esco
If Not VerifyOutLoopIsClosed(nLayerId) Then
m_CurrProjPage.SetWarningMessage(EgtMsg(91131)) ' Il contorno non è chiuso
Exit While
End If
' recupero il gruppo della lavorazione associata
Dim nIdParentPart As Integer = EgtGetParent(nIdParent)
Dim nIdPV As Integer = EgtGetFirstNameInGroup(nIdParentPart, NAME_PREVIEW)
' VERIFICA: recupero l'elenco delle Preview di Tipo WaterJet_n_S associate a questo Part
Dim ListGroup As List(Of Integer) = ResearchGropuWJ(nIdParent, nIdPV)
' VERIFICA: se esistono delle lavorazioni associate al percorso OutLoop di tipo Saw allora non procedo
Dim ListGroupSaw As List(Of Integer) = ResearchGropuSaw(nIdParent, nIdPV)
' se esiste 1 Preview di tipo WaterJet e nessuno di tipo Saw
If ListGroup.Count = 1 And ListGroupSaw.Count = 0 Then
EgtSetInfo(nIdParent, INFO_START, ptStartCurv)
' Recupero il gruppo della lavorazione associata
Dim nPartId As Integer = EgtGetParent(nLayerId)
Dim nPartPvId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_PREVIEW)
' Recupero l'elenco delle Preview di Tipo WaterJetNN_S associate a questo layer
Dim lstWjPV As List(Of Integer) = ResearchGroupWJ(nLayerId, nPartPvId)
' Recupero l'elenco delle Preview di Tipo Saw associate a questo layer
Dim lstSawPV As List(Of Integer) = ResearchGroupSaw(nLayerId, nPartPvId)
' Se esiste 1 Preview di tipo WaterJet e nessuno di tipo Saw, cambio inizio
If lstWjPV.Count = 1 And lstSawPV.Count = 0 Then
' Imposto punto di inizio
EgtSetInfo(nLayerId, INFO_START, ptStartCurv)
' Ricalcolo tutte le lavorazioni
Dim nWarn As Integer = 0
ResetAllMachinings(nWarn)
' recupero l'indice del PreView che deve essere acceso per indicare la selezione
ListGroup = ResearchGropuWJ(nIdParent, nIdPV)
Dim nIdWJ As Integer = GetPVIdFromIdSide(ListGroup, nIdMy)
GetCurrentPVFromIdSide(ListGroup, nIdMy, nIdWJ, nIdParent)
m_nIdSelectedWaterJet = nIdWJ
EgtSetMark(nIdWJ)
' Recupero nuovo Preview associato alla lavorazione dell'entità
Dim nWjPvId As Integer = GetCurrentPreViewFromSide( nEntId, nPartPvId)
' Salvo il valore del PreView evidenziato
m_nIdSelectedWaterJet = nWjPvId
EgtSetMark(nWjPvId)
EgtDraw()
Exit While
Else
m_CurrProjPage.SetWarningMessage(EgtMsg(91131)) ' Il contorno non è chiuso
Exit While
End If
End If
End If
nIdMy = EgtGetNextObjInSelWin()
nEntId = EgtGetNextObjInSelWin()
End While
End Sub
@@ -786,110 +779,83 @@ Public Class NestPageUC
#Region "SPLIT/START CURVE"
' restituisce l'elenco dei Gruppi Waterjet associati al contorno indicato
Public Function ResearchGropuWJ(nIdOutLoop As Integer, nIdPV As Integer) As List(Of Integer)
Dim ListOfGroupPV As New List(Of Integer)
Dim nIdGroup As Integer = GDB_ID.NULL
Dim nIdMy As Integer = GDB_ID.NULL
' recupero il primo lato dall'elenco dei lati della figura
nIdMy = EgtGetFirstInGroup(nIdOutLoop)
' altrimenti cerco all'interno del layer OutLoop per ogni lato la lavorazione associata
While nIdMy <> GDB_ID.NULL
Public Function ResearchGroupWJ(nLayId As Integer, nPvId As Integer) As List(Of Integer)
Dim lstPvGroup As New List(Of Integer)
' ciclo sui lati del layer OutLoop
Dim nMyId As Integer = EgtGetFirstInGroup(nLayId)
While nMyId <> GDB_ID.NULL
' verifico se esiste una Preview associata al lato
nIdGroup = EgtGetFirstNameInGroup(nIdPV, "Waterjet" & nIdMy.ToString & "S")
If nIdGroup <> GDB_ID.NULL Then
ListOfGroupPV.Add(nIdGroup)
Dim nGroupId As Integer = EgtGetFirstNameInGroup(nPvId, "Waterjet" & nMyId.ToString() & "S")
If nGroupId <> GDB_ID.NULL Then
lstPvGroup.Add(nGroupId)
End If
nIdMy = EgtGetNext(nIdMy)
nMyId = EgtGetNext(nMyId)
End While
Return ListOfGroupPV
Return lstPvGroup
End Function
' restituisce l'elenco dei Gruppi Saw associati al contorno indicato
Public Function ResearchGropuSaw(nIdOutLoop As Integer, nIdPV As Integer) As List(Of Integer)
Dim ListOfGroupPV As New List(Of Integer)
Dim nIdGroup As Integer = GDB_ID.NULL
Dim nIdMy As Integer = GDB_ID.NULL
Public Function ResearchGroupSaw(nLayId As Integer, nIdPV As Integer) As List(Of Integer)
Dim lstPvGroup As New List(Of Integer)
' recupero il primo lato dall'elenco dei lati della figura
nIdMy = EgtGetFirstInGroup(nIdOutLoop)
Dim nMyId As Integer = EgtGetFirstInGroup(nLayId)
' altrimenti cerco all'interno del layer OutLoop per ogni lato la lavorazione associata
While nIdMy <> GDB_ID.NULL
While nMyId <> GDB_ID.NULL
' verifico se esiste una Preview associata al lato
nIdGroup = EgtGetFirstNameInGroup(nIdPV, "Saw" & nIdMy.ToString)
Dim nIdGroup As Integer = EgtGetFirstNameInGroup(nIdPV, "Saw" & nMyId.ToString)
If nIdGroup <> GDB_ID.NULL Then
ListOfGroupPV.Add(nIdGroup)
lstPvGroup.Add(nIdGroup)
End If
nIdMy = EgtGetNext(nIdMy)
nMyId = EgtGetNext(nMyId)
End While
Return ListOfGroupPV
Return lstPvGroup
End Function
Public Function GetPVIdFromIdSide(ListGroup As List(Of Integer), nIdMy As Integer) As Integer
Dim IdWaterjetPV As Integer = GDB_ID.NULL
For Each nIdItem As Integer In ListGroup
Dim sName As String = String.Empty
If EgtGetName(nIdItem, sName) Then
If sName.Contains(nIdMy.ToString) Then
IdWaterjetPV = nIdItem
Exit For
End If
Private Function GetDirectPreViewFromSide( nSideId As Integer, nPvGroupId As Integer) As Integer
' Radice del nome del gruppo di Preview
Dim sRefName As String = "Waterjet" & nSideId.ToString() & "S"
' Ricerca nei gruppi all'interno del gruppo di Preview
Dim nEntId As Integer = EgtGetFirstInGroup( nPvGroupId)
While nEntId <> GDB_ID.NULL
Dim sName As String = ""
If EgtGetName( nEntId, sName) AndAlso sName.StartsWith( sRefName) Then
Return nEntId
End If
Next
Return IdWaterjetPV
nEntId = EgtGetNext( nEntId)
End While
' Non è stato trovato
return GDB_ID.NULL
End Function
Public Sub GetCurrentPVFromIdSide(ListGroup As List(Of Integer), nIdMy As Integer, ByRef nIdWj As Integer, nIdParent As Integer)
Dim nObjInGroup As Integer = EgtGetGroupObjs(nIdParent)
Dim nCount As Integer = 0
GetNextSideJoint(ListGroup, nIdMy, nIdWj, nCount, nObjInGroup)
If nIdWj <> GDB_ID.NULL Then Return
GetPrevSideJoint(ListGroup, nIdMy, nIdWj, nCount, nObjInGroup)
End Sub
' funzione ricorsiva per la ricerca del lato al quale è associata la PreView
Private Sub GetNextSideJoint(ListGroup As List(Of Integer), nIdMy As Integer, ByRef nIdWj As Integer, ByRef nCount As Integer, nObjInGroup As Integer)
Dim nValInfo As Integer = 1
' espressione di controllo per evitare di generare Loop infinito
If nCount > nObjInGroup Then Return
If nIdWj = GDB_ID.NULL Then
Dim nIdWJNext As Integer = EgtGetNext(nIdMy)
If nIdWJNext = GDB_ID.NULL Then nIdWJNext = EgtGetFirstInGroup(EgtGetParent(nIdMy))
nCount += 1
EgtGetInfo(nIdWJNext, INFO_JOINENTITY, nValInfo)
If nValInfo = 1 Then
nIdWj = GetPVIdFromIdSide(ListGroup, nIdWJNext)
If nIdWj <> GDB_ID.NULL Then Return
Else
Return
End If
'nIdWJNext = EgtGetNext(nIdWJNext)
GetNextSideJoint(ListGroup, nIdWJNext, nIdWj, nCount, nObjInGroup)
If nIdWj <> GDB_ID.NULL Then Return
End If
End Sub
' funzione ricorsiva per la ricerca del lato al quale è associata la PreView
Private Sub GetPrevSideJoint(ListGroup As List(Of Integer), nIdMy As Integer, ByRef nIdWj As Integer, ByRef nCount As Integer, nObjInGroup As Integer)
Dim nValInfo As Integer = 1
' espressione di controllo per evitare di generare Loop infinito
If nCount > nObjInGroup Then Return
If nIdWj = GDB_ID.NULL Then
Dim nIdWJPrev As Integer = EgtGetPrev(nIdMy)
' se arrivato al primo valore allora continuo la ricerca dall'ultimo
If nIdWJPrev = GDB_ID.NULL Then nIdWJPrev = EgtGetLastInGroup(EgtGetParent(nIdMy))
nCount += 1
EgtGetInfo(nIdWJPrev, INFO_JOINENTITY, nValInfo)
If nValInfo = 1 Then
nIdWj = GetPVIdFromIdSide(ListGroup, nIdWJPrev)
If nIdWj <> GDB_ID.NULL Then Return
Else
Return
End If
'nIdWJPrev = EgtGetPrev(nIdWJPrev)
GetPrevSideJoint(ListGroup, nIdWJPrev, nIdWj, nCount, nObjInGroup)
If nIdWj <> GDB_ID.NULL Then Return
End If
End Sub
Public Function GetCurrentPreViewFromSide( nSideId As Integer, nPvGroupId As Integer) As Integer
' Cerco Preview diretta
Dim nPvId As Integer = GetDirectPreViewFromSide( nSideId, nPvGroupId)
' Se trovata, esco con successo
If nPvId <> GDB_ID.NULL Then Return nPvId
' Se elemento non collegato, esco con insuccesso
Dim nJoint As Integer = 1
If EgtGetInfo( nSideId, INFO_JOINENTITY, nJoint) AndAlso nJoint = 0 Then Return GDB_ID.NULL
' Cerco su elementi successivi collegati
Dim nNextId = EgtGetNext( nSideId)
While nNextId <> GDB_ID.NULL
Dim nNextJoint As Integer = 1
If EgtGetInfo( nNextId, INFO_JOINENTITY, nNextJoint) AndAlso nNextJoint = 0 Then Exit While
nPvId = GetDirectPreViewFromSide( nNextId, nPvGroupId)
If nPvId <> GDB_ID.NULL Then Return nPvId
nNextId = EgtGetNext( nNextId)
End While
' Cerco su elementi precedenti collegati
Dim nPrevId = EgtGetPrev( nSideId)
While nPrevId <> GDB_ID.NULL
Dim nPrevJoint As Integer = 1
If EgtGetInfo( nPrevId, INFO_JOINENTITY, nPrevJoint) AndAlso nPrevJoint = 0 Then Exit While
nPvId = GetDirectPreViewFromSide( nPrevId, nPvGroupId)
If nPvId <> GDB_ID.NULL Then Return nPvId
nPrevId = EgtGetPrev( nPrevId)
End While
' Non trovato
Return GDB_ID.NULL
End Function
Public Sub ResetSplitCurvWJParam()
EgtDeselectObj(m_nIdSelectedSideWJ)
@@ -900,37 +866,33 @@ Public Class NestPageUC
End Sub
' ricevo l'ID del percorso di lavorazione WJ al quale associo una etichetta grafica con scritto "S"
Private Sub AssignFlagOnGraphic(nIdMy As Integer, IdParentPart As Integer)
Private Sub AssignFlagOnGraphic(nMyId As Integer, NPartId As Integer)
' cerco se esiste già un layer nominato "AUX_SPLIT_WJ", altrimenti lo creo
Dim IdAuxLayer As Integer = EgtGetFirstNameInGroup(IdParentPart, INFO_AUX_SPLIT_WJ)
If IdAuxLayer = GDB_ID.NULL Then
IdAuxLayer = EgtCreateGroup(IdParentPart)
EgtSetName(IdAuxLayer, INFO_AUX_SPLIT_WJ)
Dim nAuxLayerId As Integer = EgtGetFirstNameInGroup(NPartId, LAY_AUX_SPLIT_WJ)
If nAuxLayerId = GDB_ID.NULL Then
nAuxLayerId = EgtCreateGroup(NPartId)
EgtSetName(nAuxLayerId, LAY_AUX_SPLIT_WJ)
End If
' recupero il punto medio del segmento selezionato
Dim MidPoint As Point3d
EgtMidPoint(nIdMy, GDB_RT.GLOB, MidPoint)
'Dim nIdTextFlag As Integer = EgtCreateText(IdAuxLayer, MidPoint, "*", 20, GDB_RT.GLOB)
Dim nIdTextFlag As Integer = GetCreateFlagText(nIdMy, IdAuxLayer)
' inserisco flag
Dim nIdTextFlag As Integer = GetCreateFlagText(nMyId, nAuxLayerId)
EgtSetColor(nIdTextFlag, New Color3d(255, 0, 0))
EgtSetName(nIdTextFlag, "RefSide_" & nIdMy.ToString)
EgtSetName(nIdTextFlag, "RefSide_" & nMyId.ToString)
End Sub
Private Function GetCreateFlagText(nId As Integer, nIdLayer As Integer, Optional sText As String = "*") As Integer
' recupero il punto medio
Private Function GetCreateFlagText(nId As Integer, nLayerId As Integer, Optional sText As String = "*") As Integer
' Recupero il punto medio
Dim MidPoint As Point3d
EgtMidPoint(nId, GDB_RT.GLOB, MidPoint)
' recupero la direzione del vettore nel punto medio
' Recupero la direzione della curva nel punto medio e la ruota 90deg CCW
Dim vVers As Vector3d
EgtMidVector(nId, GDB_RT.GLOB, vVers)
vVers.Normalize()
vVers.Rotate(Vector3d.Z_AX, 90)
' Ingombro complessivo della lavorazione
Dim ptMin, ptMax As Point3d
EgtStartPoint(nId, GDB_RT.GLOB, ptMin)
EgtEndPoint(nId, GDB_RT.GLOB, ptMax)
Dim b3Ent As New BBox3d
EgtGetBBoxGlob(nId, BBFLAG, b3Ent)
' Metto il numero nel centro
Dim dRadXY = Point3d.DistXY(ptMin, ptMax)
Dim dRadXY = Point3d.DistXY(b3Ent.Min(), b3Ent.Max())
Dim dHtxt As Double = 50
Dim dRat As Double = 0.75
If dRadXY < 200 Then
@@ -940,18 +902,18 @@ Public Class NestPageUC
dHtxt = 25
dRat = 0.5
End If
' determino la posizione del flag
MidPoint.x += vVers.x * dHtxt / 2
MidPoint.y += vVers.y * dHtxt / 2
Return EgtCreateTextAdv(nIdLayer, MidPoint, 0, sText, "", 300, False, dHtxt, dRat, 0, INS_POS.MC, GDB_RT.GLOB)
' Determino la posizione
MidPoint.x += dHtxt / 2 * vVers.x
MidPoint.y += dHtxt / 2 * vVers.y
' Creo il testo
Return EgtCreateTextAdv(nLayerId, MidPoint, 0, sText, "", 300, False, dHtxt, dRat, 0, INS_POS.MC, GDB_RT.GLOB)
End Function
Private Sub EraseFlagOnGraphic(nIdMy As Integer, IdParentPart As Integer)
' cerco se esiste già un layer nominato "AUX_SPLIT_WJ", altrimenti lo creo
Dim IdAuxLayer As Integer = EgtGetFirstNameInGroup(IdParentPart, INFO_AUX_SPLIT_WJ)
If IdAuxLayer = GDB_ID.NULL Then Return
Dim nIdTextFlag As Integer = EgtGetFirstNameInGroup(IdAuxLayer, "RefSide_" & nIdMy.ToString)
Private Sub EraseFlagOnGraphic(nMyId As Integer, nPartId As Integer)
' cerco se esiste già un layer nominato "AUX_SPLIT_WJ"
Dim nAuxLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_AUX_SPLIT_WJ)
If nAuxLayerId = GDB_ID.NULL Then Return
Dim nIdTextFlag As Integer = EgtGetFirstNameInGroup(nAuxLayerId, "RefSide_" & nMyId.ToString)
EgtErase(nIdTextFlag)
End Sub
@@ -1224,6 +1186,7 @@ Public Class NestPageUC
m_bKeyLeftShiftPressed = m_bVerify
m_vtTotMove = Vector3d.NULL()
End Sub
Private Sub OnMyMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseMoveScene
' Verifico di essere il gestore attivo
If Not m_bActive Then Return
@@ -2730,8 +2693,8 @@ Public Class NestPageUC
DragRectangleBtn.IsChecked = False
m_bIsCheckedDragRectangle = False
StartCurveWJBtn.IsChecked = False
ResetStartCurvWJParam()
m_bIsCheckedStartCurveWJ = False
ResetStartCurvWJParam()
Else
m_bIsCheckedSplitCurveWJ = False
' resetto i parametri di selezione dei lati
+6
View File
@@ -289,6 +289,12 @@ Public Module SplitAuto
colCut = COL_MCH_ONCUT()
ElseIf bDrip Then
colCut = COL_MCH_DRIPCUT()
ElseIf nOperType = MCH_OY.WATERJETTING Then
If Math.Abs(dSideAng) > EPS_ANG_SMALL then
colCut = COL_MCH_WJ_ANG()
Else
colCut = COL_MCH_WJ()
End If
ElseIf nOperType = MCH_OY.SAWING AndAlso bSawTc Then
Dim sSawing As String = String.Empty, sSaw As String = String.Empty
m_MainWindow.m_CadCutPageUC.m_SplitPage.GetMachiningAndTool(nOperId, sSawing, sSaw)
+10 -4
View File
@@ -319,12 +319,12 @@ Module ConstGen
Public Const INFO_PARTROT As String = "ROT"
' Info in entità in OutLoop per indicare se è separata WaterJet
Public Const INFO_JOINENTITY As String = "JoinEntity"
' Nome layer per "*" inidcanti un lato separato nel taglio WaterJet
Public Const INFO_AUX_SPLIT_WJ As String = "AUX_SPLIT_WJ"
' Info in OutLoop per punto inzio lavorazione WaterJet
' Nome layer per "*" indicanti un lato separato nel taglio WaterJet
Public Const LAY_AUX_SPLIT_WJ As String = "AUX_SPLIT_WJ"
' Info in OutLoop per punto inizio lavorazione WaterJet
Public Const INFO_START As String = "Start"
' Nome dei tagli diretti inseriti in fase di Splitting
Public Const SPLIT_CUT As String = "SplitCut"
Public Const NAME_SPLIT_CUT As String = "SplitCut"
' Forzo specifica lavorazione
Public Const DEF_MACHINING As String = "Def_Machining"
' Forzo specifica lavorazione solo per tagli con inclinazione
@@ -406,6 +406,12 @@ Module ConstGen
Public Function COL_MCH_ONFREE() As Color3d
Return New Color3d(192, 128, 0)
End Function
Public Function COL_MCH_WJ() As Color3d
Return New Color3d(0, 128, 128)
End Function
Public Function COL_MCH_WJ_ANG() As Color3d
Return New Color3d(255, 0, 255)
End Function
Public Function COL_MCH_DRIPCUT() As Color3d
Return New Color3d(255, 0, 165)
End Function
+2
View File
@@ -262,6 +262,8 @@
Public Const K_MACH_STARTCENERTOOLPATH As String = "StartCenterToolPath"
Public Const K_MACH_ENGRAVING_DEPTH As String = "EngravingDepth"
Public Const K_MACH_ENGRAVING_WIDTH As String = "EngravingWidth"
Public Const K_MACH_WATERJET_OPTIMIZE As String = "WjOptimize"
Public Const K_MACH_WATERJET_ON_SINKS As String = "WjOnSinks"
Public Const K_MACH_NEST_ALIGNED As String = "Aligned"
Public Const K_MACH_NEST_GHIGLIOTTINA As String = "Guillotine"
Public Const K_MACH_WASHING As String = "Washing"
+2 -2
View File
@@ -949,7 +949,7 @@ Public Class SideAngleUC
End If
End Sub
' nuova funzione per gestire l'accorcaimento dei segmenti
' nuova funzione per gestire l'accorciamento dei segmenti
Friend Sub CreateDripGeom(nPartId As Integer)
' Recupero Id layer di contorno esterno
Dim nOutLoopId = EgtGetFirstNameInGroup(nPartId, NAME_OUTLOOP)
@@ -1146,7 +1146,7 @@ Public Class SideAngleUC
EgtStartVector(nCrvId, vtAux)
Dim vtExtrusion As Vector3d
EgtCurveExtrusion(nCrvId, vtExtrusion)
' ruoto il vetottore nella nuova direzione
' ruoto il vettore nella nuova direzione
vtExtrusion.Rotate(vtAux, -m_dEngraveAngle)
' assegno il vettore di estrusione nella nuova direzione indicata (segno negativo perchè dentro il pezzo)
EgtModifyCurveExtrusion(nCrvId, vtExtrusion)
+31 -2
View File
@@ -16,9 +16,9 @@
<ColumnDefinition Width="3*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="1.0*"/>
<RowDefinition Height="1.0*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
@@ -112,6 +112,35 @@
</Grid>
</GroupBox>
<!--Parametri WaterJet: 2 Parametri-->
<GroupBox Name="WjsParamGpBx" Grid.Column="1" Grid.RowSpan="2" Margin="0,0,5,0"
Style="{DynamicResource OmagCut_GroupBox}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="145*"/>
<ColumnDefinition Width="23*"/>
<ColumnDefinition Width="169*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
</Grid.RowDefinitions>
<TextBlock Name="WjOptimizeTxBl" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="3"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Margin="10,0,10,0" />
<CheckBox Name="WjOptimizeChBx" Grid.Column="2" Grid.Row="0"
Style="{DynamicResource OmagCut_CheckBox_Single}"
HorizontalAlignment="Right" Margin="10,0,10,0"/>
<TextBlock Name="WjIntCutsTxBl" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Margin="10,0,10,0" />
<CheckBox Name="WjIntCutsChBx" Grid.Column="2" Grid.Row="1"
Style="{DynamicResource OmagCut_CheckBox_Single}"
HorizontalAlignment="Right" Margin="10,0,10,0"/>
</Grid>
</GroupBox>
<!--Parametri Fresatura: 3 Parametri-->
<GroupBox Name="MillingsParamGpBx" Grid.Column="2" Grid.RowSpan="3" Margin="0,0,5,0"
Style="{DynamicResource OmagCut_GroupBox}">
+39 -22
View File
@@ -16,6 +16,7 @@ Public Class Alarms2PageUC
SawGpBx.Header = EgtMsg(90925) ' Parametri lama
HolesGpBx.Header = EgtMsg(90917) ' Parametri fori
WjsParamGpBx.Header = EgtMsg(91058) ' Parametri waterjet
MillingsParamGpBx.Header = EgtMsg(90929) ' Parametri fresature
HolesOffsetTxBl.Text = EgtMsg(90909) ' Offset fori
@@ -27,15 +28,17 @@ Public Class Alarms2PageUC
ExtArcMinRadTxBl.Text = EgtMsg(90918) ' Rmin archi est.
IntArcMaxSideAngTxBl.Text = EgtMsg(90924) ' Amax archi int.
PreCutExitTxBl.Text = EgtMsg(91065) ' PreTaglio uscite
WjOptimizeTxBl.Text = EgtMsg(91043) ' Ottimizza
WjIntCutsTxBl.Text = EgtMsg(90930) ' Sempre sugli interni
CornerCutsTxBl.Text = EgtMsg(90944) ' Sempre sugli angoli
InternalCutsTxBl.Text = EgtMsg(90930) ' Sempre sugli interni
ShortTxBl.Text = EgtMsg(90949) ' Accorciamento
End Sub
Private Sub Allarm2Page_Loaded() Handles Me.Loaded
Private Sub Alarms2Page_Loaded() Handles Me.Loaded
If m_bFirst Then
' in assenza della testa per lama (H1) nascondo i parametri lama
If Not m_CurrentMachine.ExistsSawHead() Then
' Se non previsti tagli di lama, nascondo i relativi parametri
If Not m_CurrentMachine.bSawing Then
SawGpBx.Visibility = Visibility.Hidden
End If
@@ -45,21 +48,30 @@ Public Class Alarms2PageUC
' Disattivo il gruppo dei parametri fori
HolesGpBx.Visibility = Windows.Visibility.Hidden
Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL
'Non faccio alcunchè
' Non faccio alcunchè
Case CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW
'Da implementare
' Da implementare
End Select
' Se non previste forature, disabilito relativo box
' Se non previste forature, nascondo relativo box
If Not m_CurrentMachine.bDrilling Then
HolesGpBx.Visibility = Visibility.Hidden
End If
' Se non previste fresature, disabilito relativo box e uso fresa con incisione
' Se non previste fresature, nascondo relativo box e uso fresa con incisione
If Not m_CurrentMachine.bMilling Then
MillingsParamGpBx.Visibility = Visibility.Hidden
End If
' Se non previsto taglio ad acqua (waterjet), nascondo relativo box
If Not m_CurrentMachine.bWaterJet Then
WjsParamGpBx.Visibility = Visibility.Hidden
' se altrimenti non c'è lama, nascondo il check e lo considero sempre vero
ElseIf Not m_CurrentMachine.bSawing Then
WjIntCutsTxBl.Visibility = Visibility.Hidden
WjIntCutsChBx.Visibility = Visibility.Hidden
End If
m_bFirst = False
End If
@@ -112,6 +124,10 @@ Public Class Alarms2PageUC
' Leggo accorciamento angoli con fresa
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_MILLING_SHORTENING, 0, m_MainWindow.GetMachIniFile())
ShortTxBx.Text = LenToString(dVal, 2)
' Leggo ottimizzazione lavorazione waterjet
WjOptimizeChBx.IsChecked = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_WATERJET_OPTIMIZE, 0, m_MainWindow.GetMachIniFile()) <> 0)
' Leggo lavorazione interni con waterjet
WjIntCutsChBx.IsChecked = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_WATERJET_ON_SINKS, 0, m_MainWindow.GetMachIniFile()) <> 0)
End Sub
Private Sub CutExtraLenTxBx_EgtClosed(sender As Object, e As EventArgs) Handles CutExtraLenTxBx.EgtClosed
@@ -183,19 +199,13 @@ Public Class Alarms2PageUC
End Sub
Private Sub OneHoleInCornerChBx_Click(sender As Object, e As RoutedEventArgs) Handles OneHoleInCornerChBx.Click
If OneHoleInCornerChBx.IsChecked() Then
WritePrivateProfileString(S_MACH_NEST, K_MACH_ONEHOLE_INTCORNER, "1", m_MainWindow.GetMachIniFile())
Else
WritePrivateProfileString(S_MACH_NEST, K_MACH_ONEHOLE_INTCORNER, "0", m_MainWindow.GetMachIniFile())
End If
Dim sVal As String = If( OneHoleInCornerChBx.IsChecked(), "1", "0")
WritePrivateProfileString(S_MACH_NEST, K_MACH_ONEHOLE_INTCORNER, sVal, m_MainWindow.GetMachIniFile())
End Sub
Private Sub CornerCutsChBx_Click(sender As Object, e As RoutedEventArgs) Handles CornerCutsChBx.Click
If CornerCutsChBx.IsChecked() Then
WritePrivateProfileString(S_MACH_NEST, K_MACH_MILLING_ON_CORNERS, "1", m_MainWindow.GetMachIniFile())
Else
WritePrivateProfileString(S_MACH_NEST, K_MACH_MILLING_ON_CORNERS, "0", m_MainWindow.GetMachIniFile())
End If
Dim sVal As String = If( CornerCutsChBx.IsChecked(), "1", "0")
WritePrivateProfileString(S_MACH_NEST, K_MACH_MILLING_ON_CORNERS, sVal, m_MainWindow.GetMachIniFile())
End Sub
Private Sub ShortTxBx_EgtClosed(sender As Object, e As EventArgs) Handles ShortTxBx.EgtClosed
@@ -205,11 +215,18 @@ Public Class Alarms2PageUC
End Sub
Private Sub InternalCutsChBx_Click(sender As Object, e As RoutedEventArgs) Handles InternalCutsChBx.Click
If InternalCutsChBx.IsChecked() Then
WritePrivateProfileString(S_MACH_NEST, K_MACH_MILLING_ON_SINKS, "1", m_MainWindow.GetMachIniFile())
Else
WritePrivateProfileString(S_MACH_NEST, K_MACH_MILLING_ON_SINKS, "0", m_MainWindow.GetMachIniFile())
End If
Dim sVal As String = If( InternalCutsChBx.IsChecked(), "1", "0")
WritePrivateProfileString(S_MACH_NEST, K_MACH_MILLING_ON_SINKS, sVal, m_MainWindow.GetMachIniFile())
End Sub
Private Sub WjOptimizeChBx_Click(sender As Object, e As RoutedEventArgs) Handles WjOptimizeChBx.Click
Dim sVal As String = If( WjOptimizeChBx.IsChecked(), "1", "0")
WritePrivateProfileString(S_MACH_NEST, K_MACH_WATERJET_OPTIMIZE, sVal, m_MainWindow.GetMachIniFile())
End Sub
Private Sub WjIntCutsChBx_Click(sender As Object, e As RoutedEventArgs) Handles WjIntCutsChBx.Click
Dim sVal As String = If( WjIntCutsChBx.IsChecked(), "1", "0")
WritePrivateProfileString(S_MACH_NEST, K_MACH_WATERJET_ON_SINKS, sVal, m_MainWindow.GetMachIniFile())
End Sub
End Class
+8 -8
View File
@@ -193,27 +193,27 @@
<TextBlock Name="CurrSawingTxBl" Grid.Column="0" Grid.Row="0"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="CurrSawingTxBx" Grid.Column="1" Grid.Row="0" Margin="10,0,10,0"
<EgtWPFLib:EgtTextBox Name="CurrSawingTxBx" Grid.Column="1" Grid.Row="0" Margin="5,0,5,0"
Style="{DynamicResource OmagCut_FixedTextBox}" />
<TextBlock Name="CurrSawingTiltedTxBl" Grid.Column="0" Grid.Row="1"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="CurrSawingTiltedTxBx" Grid.Column="1" Grid.Row="1" Margin="10,0,10,0"
<EgtWPFLib:EgtTextBox Name="CurrSawingTiltedTxBx" Grid.Column="1" Grid.Row="1" Margin="5,0,5,0"
Style="{DynamicResource OmagCut_FixedTextBox}" />
<TextBlock Name="CurrDrillingTxBl" Grid.Column="0" Grid.Row="2"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="CurrDrillingTxBx" Grid.Column="1" Grid.Row="2" Margin="10,0,10,0"
<EgtWPFLib:EgtTextBox Name="CurrDrillingTxBx" Grid.Column="1" Grid.Row="2" Margin="5,0,5,0"
Style="{DynamicResource OmagCut_FixedTextBox}" />
<TextBlock Name="CurrMillingTxBl" Grid.Column="0" Grid.Row="3"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="CurrMillingTxBx" Grid.Column="1" Grid.Row="3" Margin="10,0,10,0"
<EgtWPFLib:EgtTextBox Name="CurrMillingTxBx" Grid.Column="1" Grid.Row="3" Margin="5,0,5,0"
Style="{DynamicResource OmagCut_FixedTextBox}" />
<TextBlock Name="CurrPocketingTxBl" Grid.Column="0" Grid.Row="4"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="CurrPocketingTxBx" Grid.Column="1" Grid.Row="4" Margin="10,0,10,0"
<EgtWPFLib:EgtTextBox Name="CurrPocketingTxBx" Grid.Column="1" Grid.Row="4" Margin="5,0,5,0"
Style="{DynamicResource OmagCut_FixedTextBox}" />
<TextBlock Name="CurrWaterJettingTxBl" Grid.Column="0" Grid.Row="5"
@@ -222,11 +222,11 @@
<Grid Grid.Column="1" Grid.Row="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="1.6*"/>
</Grid.ColumnDefinitions>
<EgtWPFLib:EgtTextBox Name="CurrWaterJettingTxBx" Grid.Column="0" Margin="10,0,5,0"
<EgtWPFLib:EgtTextBox Name="CurrWaterJettingTxBx" Grid.Column="0" Margin="5,0,5,0"
Style="{DynamicResource OmagCut_FixedTextBox}" />
<EgtWPFLib:EgtTextBox Name="CurrWaterJettingQualityTxBx" Grid.Column="1" Margin="0,0,10,0"
<EgtWPFLib:EgtTextBox Name="CurrWaterJettingQualityTxBx" Grid.Column="1" Margin="0,0,5,0"
Style="{DynamicResource OmagCut_FixedTextBox}" />
</Grid>