Compare commits

...

13 Commits

Author SHA1 Message Date
NicolaP 0477c42208 Salvo dimensione sovratavola per ogni macchinata 2022-06-09 12:37:44 +02:00
NicolaP c11925e90f Merge remote-tracking branch 'origin/master' into develop 2022-06-08 17:21:26 +02:00
DarioS d745119195 OmagOFFICE 2.4e4 :
- correzione versione.
2022-05-31 00:29:40 +02:00
NicolaP aa283fd190 Merge branch 'develop' 2022-05-30 15:13:27 +02:00
NicolaP 243125cbb4 Merge remote-tracking branch 'origin/master' 2022-05-30 15:12:22 +02:00
NicolaP 2789051005 Cambio versione 2022-05-30 14:54:55 +02:00
NicolaP 0b13379731 Inseriti messaggi e costanti 2022-05-30 11:02:11 +02:00
NicolaP 6cc7ba8ccd Gestione StartPoint per tagli WJ InLoop 2022-05-26 17:47:39 +02:00
NicolaP 36674aeb65 Aggiunta gestione grafica per Taglio WJ separato 2022-05-26 16:29:11 +02:00
NicolaP 9aa9b51710 Merge branch 'Features/Manage_Interference_On_Vacuum_Move' into develop 2022-05-25 18:23:15 +02:00
NicolaP 15b87d7911 Merge branch 'Features/WaterJet_Punto_Inizio' into develop 2022-05-25 18:22:47 +02:00
DarioS e9ff1c198b OmagOFFICE 2.4e3 :
- modifiche per prima versione con chiave di rete.
2022-05-17 08:27:56 +02:00
NicolaP abc304e25c Verifica interferenze tra grezzi in fase di split 2022-05-02 14:28:08 +02:00
10 changed files with 299 additions and 35 deletions
+1
View File
@@ -18,6 +18,7 @@ Module ConstIni
Public Const S_GENERAL As String = "General"
Public Const K_DEBUG As String = "Debug"
Public Const K_LICENCE As String = "Licence"
Public Const K_NETKEY As String = "NetKey"
Public Const K_USERLEVEL As String = "UserLevel"
Public Const K_MAXINST As String = "MaxInstances"
Public Const K_INSTANCES As String = "Instances"
+6
View File
@@ -99,6 +99,9 @@ Friend Module CamAuto
Dim bOk As Boolean = True
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, "AUX_SPLIT_WJ")
EgtErase(IdAuxLayer)
' accedo al Layer OutLoop
Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP)
Dim nIdMy As Integer = EgtGetFirstInGroup(nIdLayerOutLoop)
@@ -111,6 +114,9 @@ Friend Module CamAuto
Dim nRawId As Integer = CamAuto.GetCurrentRaw()
nIdPart = EgtGetFirstPartInRawPart(nRawId)
While nIdPart <> GDB_ID.NULL
' elimino il layer dei flag di separazione "AUX_SPLIT_WJ"
Dim IdAuxLayer As Integer = EgtGetFirstNameInGroup(nIdPart, "AUX_SPLIT_WJ")
EgtErase(IdAuxLayer)
' accedo al Layer OutLoop
Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP)
Dim nIdMy As Integer = EgtGetFirstInGroup(nIdLayerOutLoop)
+6
View File
@@ -251,6 +251,12 @@ Module ConstMach
Public Const SELECT_REGION_LAYER As String = "SelectRegion"
' Info in pezzo per stato rotazione
Public Const INFO_PARTROT As String = "ROT"
' Info in entità in OutLoop per indicare se è separata WaterJet
Public Const INFO_JOINTENTITY 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
Public Const INFO_START As String = "Start"
' Nome di pezzo che è una cornice
Public Const NAME_FRAME As String = "Frame"
+2
View File
@@ -192,6 +192,8 @@ Public Class MainWindowM
Dim sNestKey As String = ""
EgtUILib.GetPrivateProfileString( S_LICENCE, K_NESTKEY, "", sNestKey, sLicFile)
EgtSetNestKey( sNestKey)
Dim bNetHwKey As Boolean = ( GetMainPrivateProfileInt(S_GENERAL, K_NETKEY, 0) = 1)
EgtSetNetHwKey( bNetHwKey)
' Verifico abilitazione nesting automatico
m_bAutoNestOption = Not String.IsNullOrWhiteSpace( sNestKey)
' Recupero livello e opzioni della chiave
+2 -2
View File
@@ -69,6 +69,6 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.4.5.1")>
<Assembly: AssemblyFileVersion("2.4.5.1")>
<Assembly: AssemblyVersion("2.4.5.4")>
<Assembly: AssemblyFileVersion("2.4.5.4")>
+30 -2
View File
@@ -223,6 +223,8 @@ Public Class MySceneHostVM
End Sub
Private Function ExecExport(sDirDest As String) As Boolean
' salvo il nome della macchina correntemente selezionata
Dim CurrentSelectedMachGroup As String = OmagOFFICEMap.refMachGroupPanelVM.SelectedMachGroup.Machine
' Path completa del progetto corrente
Dim sFilePath As String = String.Empty
EgtGetCurrFilePath(sFilePath)
@@ -282,10 +284,10 @@ Public Class MySceneHostVM
File.Copy(sOriPath, sNewPath, True)
Catch ex As Exception
bOk = False
EgtOutLog( "Slab image not found :" & sOriPath)
EgtOutLog("Slab image not found :" & sOriPath)
End Try
EgtSetName(nPhotoId, PHOTO_NAME)
EgtChangePhotoCenterAsFlatScan( nPhotoId)
EgtChangePhotoCenterAsFlatScan(nPhotoId)
End If
' Elimino gli altri gruppi di lavorazioni
For Each nMGrpId As Integer In vMchGrps
@@ -308,6 +310,25 @@ Public Class MySceneHostVM
Dim nMarkId As Integer = EgtCreateGroup(GDB_ID.ROOT)
EgtSetName(nMarkId, NAME_PROJMARK)
EgtSetLevel(nMarkId, GDB_LV.SYSTEM)
' Imposto la macchina: salvo l'altezza della sovratavola
Dim sMachine As String = String.Empty
EgtGetInfo(nMchGrpId, "Machine", sMachine)
If Not String.IsNullOrEmpty(sMachine) Then
InitCurrentMachine(OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot, sMachine,
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.PRODUCTION_LINE),
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.ENABLE_MILL),
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.ENABLE_POLISHING),
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.ENABLE_WJ),
True)
Select Case GetCurrentTable()
Case 3
EgtSetInfo(nMarkId, K_TAB3_ADDITIONALTABLE, CurrentMachine.dAdditionalTable)
Case 2
EgtSetInfo(nMarkId, K_TAB2_ADDITIONALTABLE, CurrentMachine.dAdditionalTable)
Case Else
EgtSetInfo(nMarkId, K_ADDITIONALTABLE, CurrentMachine.dAdditionalTable)
End Select
End If
Dim nReducedCut As Integer = 1
EgtGetInfo(nMchGrpId, INFO_REDUCEDCUT, nReducedCut)
EgtSetInfo(nMarkId, INFO_REDUCEDCUT, nReducedCut)
@@ -326,6 +347,13 @@ Public Class MySceneHostVM
' Salvo il file
If Not EgtSaveFile(sFileDest, NGE.CMPTEXT) Then bOk = False
Next
' reimposto la macchina corrente
InitCurrentMachine(OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot, CurrentSelectedMachGroup,
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.PRODUCTION_LINE),
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.ENABLE_MILL),
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.ENABLE_POLISHING),
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.ENABLE_WJ),
True)
' Distruggo il contesto corrente e ripristino quello originale
EgtSetCurrentContext(nCurrCtx)
EgtDeleteContext(nCtx)
+12 -5
View File
@@ -224,13 +224,17 @@ Public Class MachiningTabVM
End Property
Public Sub Prev(ByVal param As Object)
Dim bOk As Boolean = True
' Dichiaro solo visualizzazione
m_bIsShow = True
If m_MachiningMode = MachiningModeOpt.SPLIT Then
OmagOFFICEMap.refSplitModeVM.ExitSplitRaw(False)
Else
OmagOFFICEMap.refMoveRawModeVM.ExitMoveRaw()
' verifico collisione dei pezzi in fase di scarico
bOk = OmagOFFICEMap.refMoveRawModeVM.ExitMoveRaw()
End If
' se trovata interferenza tra grezzi (dopo movimentazione) esco
If Not bOk Then Return
' Torno alla fase precedente
EgtSetCurrPhase(EgtGetCurrPhase() - 1)
' Si va sempre in Split
@@ -255,19 +259,22 @@ Public Class MachiningTabVM
End Property
Public Sub NextCmd(ByVal param As Object)
Dim bOk As Boolean = True
If m_MachiningMode = MachiningModeOpt.SPLIT Then
OmagOFFICEMap.refSplitModeVM.ExitSplitRaw(False)
MachiningMode = MachiningModeOpt.MOVERAWPART
AutoVisibility = Visibility.Hidden
OmagOFFICEMap.refMoveRawModeVM.InitMoveRaw()
bOk = OmagOFFICEMap.refMoveRawModeVM.InitMoveRaw()
Else
OmagOFFICEMap.refMoveRawModeVM.ExitMoveRaw()
' se verificata una interferenza allora esco
bOk = OmagOFFICEMap.refMoveRawModeVM.ExitMoveRaw()
If Not bOk Then Return
MachiningMode = MachiningModeOpt.SPLIT
AutoVisibility = Visibility.Visible
OmagOFFICEMap.refSplitModeVM.InitSplitRaw()
End If
' Aggiorno possibilità di uscire
ManageExit()
' Se non ci sono interferenze tra i grezzi -> aggiorno possibilità di uscire
If bOk Then ManageExit()
End Sub
#End Region ' NextCommand
+92 -5
View File
@@ -17,6 +17,7 @@ Public Class MoveRawModeVM
Private m_bRemovedRaw As Boolean = False ' flag per rimozione manuale pezzi
Private m_RawMoveDataList As New List(Of RawMoveData) ' dati di movimento
Private m_bRawWithCups As Boolean = False ' flag per pezzo corrente con ventose
Private m_CurrRawOnVacuum As Integer = GDB_ID.NULL ' identificativo pezzo correntemente attaccato alle ventose
Private m_dMoveStep As Double
Public Property MoveStep As String
@@ -108,6 +109,17 @@ Public Class MoveRawModeVM
#Region "METHODS"
Friend Function InitMoveRaw() As Boolean
'' verifico che il pezzo sia depositabile
'If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
' ' mantengo la selezione del pezzo
' EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
' OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Collisione pezzi", 3, MSG_TYPE.ERROR_)
' EgtDraw()
' ' non cambio pagina
' Return False
'End If
' resetto l'inidice del pezzo da mnovimentare
m_CurrRawOnVacuum = GDB_ID.NULL
' Deseleziono tutto
EgtDeselectAll()
' Recupero i tagli allungati prima definiti
@@ -158,14 +170,14 @@ Public Class MoveRawModeVM
' Distanza iniziale
m_dCurrDist = 0
End If
' Non dovrebbe mai accadere, ma inizializzo con default
' Non dovrebbe mai accadere, ma inizializzo con default
Else
m_vtDir = Vector3d.Y_AX()
m_ptMid = Point3d.ORIG()
m_dOrigDist = 0
m_dCurrDist = 0
End If
' Altrimenti movimento con ventose
' Altrimenti movimento con ventose
Else
m_bRemovedRaw = False
m_bRawWithCups = False
@@ -182,7 +194,7 @@ Public Class MoveRawModeVM
If OmagOFFICEMap.refMachiningTabVM.ByHand Then
LRArrowVisibility = Visibility.Hidden
RotationVisibility = Visibility.Hidden
' Altrimenti per movimento con ventose
' Altrimenti per movimento con ventose
Else
LRArrowVisibility = Visibility.Visible
RotationVisibility = If(CurrentMachine.bRawSplMovRotate, Visibility.Visible, Visibility.Hidden)
@@ -195,6 +207,17 @@ Public Class MoveRawModeVM
End Function
Friend Function ExitMoveRaw() As Boolean
' verifico che il pezzo sia depositabile
If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
' mantengo la selezione del pezzo
EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Collisione pezzi", 3, MSG_TYPE.ERROR_)
EgtDraw()
' non cambio pagina
Return False
End If
' resetto l'inidice del pezzo da mnovimentare
m_CurrRawOnVacuum = GDB_ID.NULL
' Deseleziono tutto
EgtDeselectAll()
' Se movimento con ventose
@@ -351,6 +374,39 @@ Public Class MoveRawModeVM
Return bOk
End Function
' Veririfica che il grezzo non entri in colliosione con altri pezzi
Private Function VerifyCollisionWithOtherRawPart(nIdOnVacumm As Integer) As Boolean
If nIdOnVacumm = GDB_ID.NULL Then Return False
' Creo gruppo temporaneo in cui generare le superfici per la veririfica di collisione
Dim m_nTempId As Integer = EgtCreateGroup(GDB_ID.ROOT)
If m_nTempId = GDB_ID.NULL Then Return False
EgtSetName(m_nTempId, "RawTemp")
Dim nIdActualRawOutLine As Integer = EgtGetFirstNameInGroup(nIdOnVacumm, "RawOutline")
Dim ActualRawFlatRegion As Integer = EgtCreateSurfFlatRegion(m_nTempId, nIdActualRawOutLine)
Dim nCurrPhase As Integer = EgtGetCurrPhase()
Dim nRawGroupId = EgtGetParent(EgtGetFirstRawPart())
Dim nIdRaw As Integer = EgtGetFirstRawPart()
' ciclo su tutti i grezzi per veririficare eventuali collisioni
While nIdRaw <> GDB_ID.NULL
' verifico la fase del grezzo
If EgtVerifyRawPartCurrPhase(nIdRaw) And nIdOnVacumm <> nIdRaw Then
' recupero il contorno del pezzo
Dim nIdRawOutLine As Integer = EgtGetFirstNameInGroup(nIdRaw, "RawOutline")
Dim nIdRawFlatRegion As Integer = EgtCreateSurfFlatRegion(m_nTempId, nIdRawOutLine)
If EgtSurfFrIntersect(nIdRawFlatRegion, ActualRawFlatRegion) Then
If EgtExistsObj(nIdRawFlatRegion) Then
EgtErase(m_nTempId)
' esiste una intersezione delle superfici
Return True
End If
End If
End If
nIdRaw = EgtGetNextRawPart(nIdRaw)
End While
EgtErase(m_nTempId)
Return False
End Function
#End Region ' METHODS
#Region "COMMANDS"
@@ -685,12 +741,34 @@ Public Class MoveRawModeVM
' Se trovato il grezzo
If nParentId = nRawGroupId Then
Dim nStat As Integer = GDB_ST.ON_
' Se il pezzo corrente è selezionato allora lo disattivo -> deposito del pezzo
EgtGetStatus(nId, nStat)
If nStat = GDB_ST.SEL Then
EgtSetStatus(nId, GDB_ST.ON_)
' Se con ventose, le nascondo
If Not OmagOFFICEMap.refMachiningTabVM.ByHand Then EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
' prima di rilasciare il pezzo verifico che non vada in collisione con altri pezzi sulla tavola
If VerifyCollisionWithOtherRawPart(nId) Then
' mantengo la selezione del pezzo
EgtSetStatus(nId, GDB_ST.SEL)
OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Collisione pezzi", 3, MSG_TYPE.ERROR_)
Else
' Se con ventose, le nascondo
If Not OmagOFFICEMap.refMachiningTabVM.ByHand Then EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
End If
Else
' verifico che il pezzo precedente possa essere depositato correttamente
If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
' mantengo la selezione del pezzo
EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Collisione pezzi", 3, MSG_TYPE.ERROR_)
EgtDraw()
' esco dal ciclo, prima devo depositare correttamente il pezzo
Exit While
End If
' salvo l'indice del pezzo correntemente attaccato alle ventose
m_CurrRawOnVacuum = nId
EgtDeselectAll()
EgtSetStatus(nId, GDB_ST.SEL)
' Se con ventose, le posiziono sul grezzo
@@ -736,6 +814,15 @@ Public Class MoveRawModeVM
End If
nId = EgtGetNextObjInSelWin()
End While
' clicco su un oggetto che non è un grezzo -> verifico che il pezzo precedente possa essere depositato correttamente
If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
' mantengo la selezione del pezzo
EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Collisione pezzi", 3, MSG_TYPE.ERROR_)
EgtDraw()
End If
End Sub
#End Region ' EVENTS
+39
View File
@@ -797,6 +797,15 @@ Public Class SplitModeVM
vtXY.Normalize()
Dim ptCen As Point3d = Point3d.Media(ptMin, ptMax) + vtXY * If(Not b2ndLav, -0.8, 0.8) * dHtxt
ptCen.z = ptMax.z + 1
' ricavo la posizione del punto (se waterjet separata)
If m_MachiningList(nI).m_nType = MCH_OY.WATERJETTING Or m_MachiningList(nI).m_nType = MCH_OY.MILLING Then
Dim ptMid As Point3d
Dim vVers As Vector3d
MidPointOfCurve(m_MachiningList(nI).m_nId, ptMid, vVers)
ptCen = ptMid ' + vVers * If(Not b2ndLav, -0.8, 0.8) * dHtxt
End If
If bNumber Then
Dim nNbrId As Integer = EgtCreateTextAdv(m_nNbrGrpId, ptCen, 0, (nI + 1).ToString(), "",
300, False, dHtxt, dRat, 0, INS_POS.MC)
@@ -851,6 +860,36 @@ Public Class SplitModeVM
Return EgtGetBBoxGlob(nPvId, GDB_BB.STANDARD, ptMin, ptMax)
End Function
Private Function MidPointOfCurve(nOperId As Integer, ByRef ptMid As Point3d, ByRef vVers As Vector3d) As Boolean
Dim nPvId As Integer = GDB_ID.NULL
EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId)
' creo un layer ausiliario per creare la curva composita
Dim AuxLayer As Integer = EgtCreateGroup(nPvId)
' imposto la lavorazione corrente
EgtSetCurrMachining(nOperId)
' recupero tutte le entità della lavorazione corrente
Dim nInd As Integer = 0
Dim nIdCurr As Integer
Dim nSub As Integer
Dim CurveCompoList As New List(Of Integer)
While EgtGetMachiningGeometry(nInd, nIdCurr, nSub)
CurveCompoList.Add(nIdCurr)
nInd += 1
End While
Dim PtNearStart As Point3d
Dim nIdCutPath As Integer = EgtCreateCurveCompoByChain(AuxLayer, CurveCompoList.ToArray, PtNearStart, False)
Dim dLength As Double = 0
EgtCurveLength(nIdCutPath, dLength)
Dim dParam As Double = 0
EgtCurveParamAtLength(nIdCutPath, dLength / 2, dParam)
EgtAtParamPoint(nIdCutPath, dParam, GDB_RT.GLOB, ptMid)
EgtAtParamVector(nIdCutPath, dParam, -1, vVers)
vVers.Normalize()
vVers.Rotate(Vector3d.Z_AX, 90)
EgtErase(AuxLayer)
Return True
End Function
Private Function AddMachiningDirection(ptStart As Point3d, vtDir As Vector3d, dLen As Double, bTwin As Boolean) As Integer
Dim dArrX As Double = dLen * Math.Cos(30 * Math.PI / 180)
Dim dArrY As Double = dLen * Math.Sin(30 * Math.PI / 180)
+109 -21
View File
@@ -190,13 +190,15 @@ Public Class NestingTabVM
Public ReadOnly Property SplitCurvWJMsg As String
Get
Return "Split"
'91133=Separa
Return EgtMsg(91133)
End Get
End Property
Public ReadOnly Property StartCurvWJMsg As String
Get
Return "Start"
'91132=Start
Return EgtMsg(91132)
End Get
End Property
@@ -603,7 +605,7 @@ Public Class NestingTabVM
End If
' recupero il gruppo della lavorazione associata
Dim nIdParentPart As Integer = EgtGetParent(nIdParent)
Dim nIdPV As Integer = EgtGetFirstNameInGroup(nIdParentPart, "PV")
Dim nIdPV As Integer = EgtGetFirstNameInGroup(nIdParentPart, NAME_PREVIEW)
' se non esiste un gruppo di lavorazione associato allora esco
If nIdPV = GDB_ID.NULL Then
'm_CurrProjPage.ClearMessage()
@@ -915,26 +917,27 @@ Public Class NestingTabVM
End If
' recupero il gruppo della lavorazione associata
Dim nIdParentPart As Integer = EgtGetParent(nIdParent)
Dim nIdPV As Integer = EgtGetFirstNameInGroup(nIdParentPart, "PV")
Dim nIdPV As Integer = EgtGetFirstNameInGroup(nIdParentPart, NAME_PREVIEW)
' VERIFICA: recupero l'elenco delle Preview di Tipo WaterJet 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 non esiste almeno 1 Preview di tipo WaterJet
If ListGroup.Count > 0 Then
If ListGroup.Count > 0 And ListGroupSaw.Count = 0 Then
m_nIdSelectedSideWJ = nIdMy
Dim nValInfo As Integer = 1
If EgtGetInfo(nIdMy, "JoinEntity", nValInfo) Then
Dim nNewValInfo As Integer = nValInfo
If EgtGetInfo(nIdMy, INFO_JOINTENTITY, nValInfo) Then
If nValInfo = 1 Then
' separo il taglio
EgtSetInfo(nIdMy, "JoinEntity", 0)
nNewValInfo = 0
Else
' unisco il taglio
EgtSetInfo(nIdMy, "JoinEntity", 1)
nNewValInfo = 1
End If
Else
' se manca l'info allora il taglio sValInfo = "1" quindi separo il taglio
EgtSetInfo(nIdMy, "JoinEntity", 0)
nNewValInfo = 0
End If
EgtSetInfo(nIdMy, INFO_JOINTENTITY, nNewValInfo)
' Ricalcolo tutte le lavorazioni
Dim nWarn As Integer = 0
ResetAllMachinings(nWarn)
@@ -942,6 +945,12 @@ Public Class NestingTabVM
ListGroup = ResearchGropuWJ(nIdParent, nIdPV)
Dim nIdWJ As Integer = GetPVIdFromIdSide(ListGroup, nIdMy)
GetCurrentPVFromIdSide(ListGroup, nIdMy, nIdWJ, nIdParent)
' assegno un identificativo grafico per inidcare che è un taglio separato
If nNewValInfo = 0 Then
AssignFlagOnGraphic(nIdMy, nIdParentPart)
Else
EraseFlagOnGraphic(nIdMy, nIdParentPart)
End If
' salvo il valore del PreView evidenziato
m_nIdSelectedWaterJet = nIdWJ
EgtSetMark(nIdWJ)
@@ -976,6 +985,25 @@ Public Class NestingTabVM
Return ListOfGroupPV
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
' 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
' verifico se esiste una Preview associata al lato
nIdGroup = EgtGetFirstNameInGroup(nIdPV, "Saw" & nIdMy.ToString)
If nIdGroup <> GDB_ID.NULL Then
ListOfGroupPV.Add(nIdGroup)
End If
nIdMy = EgtGetNext(nIdMy)
End While
Return ListOfGroupPV
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
@@ -1030,7 +1058,7 @@ Public Class NestingTabVM
' 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, "JoinEntity", nValInfo)
EgtGetInfo(nIdWJPrev, INFO_JOINTENTITY, nValInfo)
If nValInfo = 1 Then
nIdWj = GetPVIdFromIdSide(ListGroup, nIdWJPrev)
If nIdWj <> GDB_ID.NULL Then Return
@@ -1054,6 +1082,62 @@ Public Class NestingTabVM
EgtDraw()
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)
' 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)
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)
EgtSetColor(nIdTextFlag, New Color3d(255, 0, 0))
EgtSetName(nIdTextFlag, "RefSide_" & nIdMy.ToString)
End Sub
Private Function GetCreateFlagText(nId As Integer, nIdLayer 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
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)
' Metto il numero nel centro
Dim dRadXY = Point3d.DistXY(ptMin, ptMax)
Dim dHtxt As Double = 50
Dim dRat As Double = 0.75
If dRadXY < 200 Then
dHtxt = 40
dRat = 0.6
ElseIf dRadXY < 25 Then
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)
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)
EgtErase(nIdTextFlag)
End Sub
#End Region ' WaterJet Section and StartPoint
Private m_bSplitCurvWJ As Boolean
@@ -1127,21 +1211,24 @@ Public Class NestingTabVM
' 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
If sLayer = NAME_OUTLOOP Then
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
OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Il contorno non è chiuso (0)", MSG_TYPE.WARNING)
'91131=Il contorno non è chiuso
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(91131), MSG_TYPE.WARNING)
Exit While
End If
' recupero il gruppo della lavorazione associata
Dim nIdParentPart As Integer = EgtGetParent(nIdParent)
Dim nIdPV As Integer = EgtGetFirstNameInGroup(nIdParentPart, "PV")
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 non esiste almeno 1 Preview di tipo WaterJet
If ListGroup.Count <> EgtGetGroupObjs(nIdParent) Then
EgtSetInfo(nIdParent, "Start", ptStartCurv)
If ListGroup.Count = 1 And ListGroupSaw.Count = 0 Then
EgtSetInfo(nIdParent, INFO_START, ptStartCurv)
' Ricalcolo tutte le lavorazioni
Dim nWarn As Integer = 0
ResetAllMachinings(nWarn)
@@ -1154,18 +1241,19 @@ Public Class NestingTabVM
EgtDraw()
Exit While
Else
OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Il contorno non è chiuso (1)", MSG_TYPE.WARNING)
'91131=Il contorno non è chiuso
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(91131), MSG_TYPE.WARNING)
Exit While
End If
End If
End If
End If
nIdMy = EgtGetNextObjInSelWin()
End While
Return
End Sub
#End Region
#End Region ' Water Start Point
Private m_bStartCurvWJ As Boolean
Public Property bStartCurvWJ As Boolean