Merge commit '0c7c729914506c957c2ebf89d7b0df45303aa1c0'

This commit is contained in:
Nicola Pievani
2023-08-03 19:29:21 +02:00
7 changed files with 820 additions and 16 deletions
+26 -1
View File
@@ -100,7 +100,32 @@
VerticalAlignment="Center" />
</Button>
<UniformGrid Name ="UG0" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="3" >
<!--Comandi attivi solo in madalità REG-->
<UniformGrid Name ="UG0_Reg" Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="3" Columns="3" Visibility="Hidden">
<ToggleButton Name="AddPointRegBtn" Visibility="Hidden"
Style="{DynamicResource OmagCut_YellowIconToggleButton}">
<Image Source="{DynamicResource RefTabImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</ToggleButton>
<ToggleButton Name="ModPointRegBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
<Image Source="{DynamicResource RefTabImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</ToggleButton>
<ToggleButton Name="RemovePointRegBtn" Visibility="Hidden"
Style="{DynamicResource OmagCut_YellowIconToggleButton}">
<Image Source="{DynamicResource RefTabImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</ToggleButton>
</UniformGrid>
<!--Comandi attivi solo in madalità REG-->
<UniformGrid Name ="UG1_Reg" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="2" Visibility="Hidden">
<Button Name="AdjustPointRegBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource Parcheggia-pezzoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<ToggleButton Name="ActivatePointRegBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
<Image Source="{DynamicResource ON_OFF-singolo-taglioImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</ToggleButton>
</UniformGrid>
<UniformGrid Name ="UG0" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="3">
<Button Name="InsertPartBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource Inserisci-pezzoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
+726 -7
View File
@@ -1,4 +1,8 @@
Imports EgtUILib
Imports System.ComponentModel
Imports System.Reflection
Imports System.Windows.Forms
Imports System.Windows.Forms.Integration
Imports EgtUILib
Imports EgtWPFLib
Public Class NestPageUC
@@ -104,12 +108,17 @@ Public Class NestPageUC
DeselectAllBtn.ToolTip = EgtMsg(MSG_NESTPAGEUC + 5) 'Deselect All - Deseleziona Tutto
DragRettanleBtn.ToolTip = "Strech"
' Nascondo i pulsanti in uso quando attivo la modalità REG
UG0_Reg.Visibility = Visibility.Hidden
Dim nColumsIn_UG1 As Integer = 2
' gestisco la visualizzazione del comando PAN (per il drag dei rettangoli)
m_bIsVisibleDragRettangle = (GetPrivateProfileInt(S_NEST, K_DRAG_RETTANGLE, 0, m_MainWindow.GetIniFile()) <> 0)
If Not m_bIsVisibleDragRettangle Then
nColumsIn_UG1 = 1
DragRettanleBtn.Visibility = Visibility.Collapsed
Else
DragRettanleBtn.Visibility = Visibility.Visible
End If
' gestisco la visualizzazione del comando Splt (per i tagli waterjet)
@@ -186,6 +195,36 @@ Public Class NestPageUC
ShowParkedParts()
' Garantisco visibilità eventuale contorno da foto
m_CurrProjPage.ShowContour(True)
' Verifico se esiste il gruppo "REG"
Dim nIdRaws As Integer = EgtGetParent(m_CurrProjPage.m_nRawId)
Dim nIdReg As Integer = EgtGetFirstNameInGroup(EgtGetParent(nIdRaws), "Reg")
' Resetto le variabili di conteggio
m_nCountSpot = 0
m_nCountSpotCUT = 0
If nIdReg <> GDB_ID.NULL Then
m_nRegGroupId = nIdReg
EgtGetInfo(m_nRegGroupId, COUNTSPOT, m_nCountSpot)
EgtGetInfo(m_nRegGroupId, COUNTSPOTCUT, m_nCountSpotCUT)
' Lo nascondo
EgtSetStatus(m_nRegGroupId, GDB_ST.OFF)
Else
' Creo layer per definire i punti di REG
m_nRegGroupId = EgtCreateGroup(EgtGetParent(nIdRaws))
EgtSetName(m_nRegGroupId, REG)
m_nCountSpot = 0
m_nCountSpotCUT = 0
End If
' Se nel progetto non sono inseriti punti SpotReg disabilito i comandi
If m_nCountSpot < 1 Then
UG0_Reg.IsEnabled = False
UG1_Reg.IsEnabled = False
End If
' Se nel progetto non sono inseriti punti SpotRegCUT provvedo ad aggiungerli
If m_nCountSpotCUT < 1 Then
InsertSportRegistration()
End If
End Sub
Public Sub UpdateStepsOnUI()
@@ -890,10 +929,103 @@ Public Class NestPageUC
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
' Verifico di essere il gestore attivo e non in modalità registrazione
If Not m_bActive Or m_bRegister Then Return
If Not m_bActive Or m_bRegister Then
' procedo solo sel il click è avvenuto con il tasto sinistro del mouse
If e.Button <> MouseButtons.Left Then Return
' se aggiungo SpotReg e numero di Spot inferiore a quelli inseriti in Office
If AddPointRegBtn.IsChecked Then
If m_nCountSpotCUT < m_nCountSpot Then
' Acquisisco punto da disegno
EgtUnProjectPoint(e.Location, m_ptPrev)
Dim ptRawMax As Point3d = m_b3Raw.Max()
m_ptPrev.z = ptRawMax.z
' Inserisco un nuovo punto registrazione
CreateSpotRegistration(m_nRegGroupId, m_ptPrev, m_nCountSpotCUT + 1)
EgtDraw()
' disattivo il comando di inserimento
AddPointRegBtn.IsChecked = False
Else
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
m_MainWindow.m_CurrentProjectPageUC.SetWarningMessage("Max spot for reg: " & m_nCountSpot.ToString)
End If
ElseIf RemovePointRegBtn.IsChecked Then
' Verifico se selezionato indicativo di pezzo
EgtSetObjFilterForSelWin(True, True, True, True, True)
Dim nSelect As Integer
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSelect)
Dim nSelId As Integer = EgtGetFirstObjInSelWin()
Dim sName As String = String.Empty
While nSelId <> GDB_ID.NULL
sName = String.Empty
EgtGetName(nSelId, sName)
If sName.StartsWith(SPOTREGCUT_) Then
' recupero recupero il centro della prima curva
Dim nIdParent As Integer = EgtGetParent(nSelId)
RemoveSpotRegistration(nIdParent)
EgtDraw()
EgtErase(nIdParent)
RemovePointRegBtn.IsChecked = False
' Esco dal ciclo
Exit While
End If
nSelId = EgtGetNextObjInSelWin()
End While
ElseIf ModPointRegBtn.IsChecked Then
' Verifico se selezionato indicativo di pezzo
EgtSetObjFilterForSelWin(True, True, True, True, True)
Dim nSelect As Integer
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSelect)
Dim nSelId As Integer = EgtGetFirstObjInSelWin()
Dim sName As String = String.Empty
While nSelId <> GDB_ID.NULL
sName = String.Empty
EgtGetName(nSelId, sName)
If sName.StartsWith(SPOTREGCUT_) Then
EgtDeselectAll()
EgtResetMark(m_nCurrSpotRegId)
' recupero l'Id del gruppo di appartenenza
Dim nIdParent As Integer = EgtGetParent(nSelId)
EgtSelectGroupObjs(nIdParent)
EgtSetMark(nIdParent)
EgtDraw()
' Acquisisco punto da disegno
EgtUnProjectPoint(e.Location, m_ptPrev)
m_bDrag = True
' Salvo l'Id del punto SpotReg da spostare
m_nCurrSpotRegId = nIdParent
' Esco dal ciclo
Exit While
End If
nSelId = EgtGetNextObjInSelWin()
End While
ElseIf ActivatePointRegBtn.IsChecked Then
' Verifico se selezionato indicativo di pezzo
EgtSetObjFilterForSelWin(True, True, True, True, True)
Dim nSelect As Integer
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSelect)
Dim nSelId As Integer = EgtGetFirstObjInSelWin()
Dim sName As String = String.Empty
While nSelId <> GDB_ID.NULL
sName = String.Empty
EgtGetName(nSelId, sName)
' accetto qualsiasi punto di tipo SpotReg (sia da OFFICE che da CUT)
If sName.StartsWith(SPOTREG_) Or sName.StartsWith(SPOTREGCUT_) Then
Dim nIdParent As Integer = EgtGetParent(nSelId)
ActivateSpotRegistration(nIdParent)
EgtDraw()
' Esco dal ciclo
Exit While
End If
nSelId = EgtGetNextObjInSelWin()
End While
End If
' Devo sempre uscire da questa condizione
Return
End If
' Si può selezionare solo con il tasto sinistro e se stato NULL
If e.Button <> Windows.Forms.MouseButtons.Left Or
Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then
Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then
Return
End If
@@ -902,7 +1034,6 @@ Public Class NestPageUC
OnMyMouseDownSceneSelCurv(sender, e)
Return
End If
m_bIsCounterLy = False
' se in modalità DragRettangle (deformazione delle componenti rettangolari)
If m_bIsCheckedDragRettangle Then
@@ -963,7 +1094,6 @@ Public Class NestPageUC
End If
End If
End If
If Not m_bIsCounterLy Then
' Se già selezionato o posizione oggetto incompatibile con flag posizione selezionati
If nStat = GDB_ST.SEL Then
@@ -1022,6 +1152,10 @@ Public Class NestPageUC
EgtSetCurrPhase(nI)
EgtSetTableAreaOffset(TAB_OFFS, TAB_OFFS, TAB_OFFS, TAB_OFFS)
Next
' aggiorno posizionamento ventose per lavorazioni da sotto
UpdateVacuumsForDrip()
' dichiaro tutto aggiornato
m_CurrProjPage.SetOrderMachiningFlag()
EgtSetCurrPhase(1)
' Rotazione
Dim dAngRot As Double = If(sOtherTab = SECOND_TAB, 180, -180)
@@ -1067,7 +1201,6 @@ 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
@@ -1076,7 +1209,7 @@ Public Class NestPageUC
' Se primo movimento di drag, verifico di aver superato la soglia di movimento in pixel
If m_bDragToStart Then
If Math.Abs(e.Location.X - m_locPrev.X) < m_nRestRadius And
Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
Return
End If
m_bDragToStart = False
@@ -1087,6 +1220,19 @@ Public Class NestPageUC
OnMyMouseMoveSawRettangle(sender, e)
Return
End If
If ModPointRegBtn.IsChecked Then
' Ricavo il punto corrente in coordinate mondo
Dim ptCurr_ As Point3d
EgtUnProjectPoint(e.Location, ptCurr_)
' Ricavo il vettore di movimento
Dim vtMove As Vector3d = ptCurr_ - m_ptPrev
MoveSpotRegistration(m_nCurrSpotRegId, vtMove)
' Aggiorno il punto precedente
m_ptPrev = ptCurr_
' Terminata esecuzione di drag
m_bDragging = False
Return
End If
' Determino cosa muovere
Dim nMoveId = If(m_nIdToSel <> GDB_ID.NULL, m_nIdToSel, GDB_ID.SEL)
@@ -1650,6 +1796,10 @@ Public Class NestPageUC
nRevPhase += 1
End While
End If
' Muovo i punti SpotReg generati nel programma OFFICE
If bMoveOk Then
MoveAllSpotRegistration(vtMove)
End If
' Ripristino lo stato iniziale
EgtSetCurrPhase(1)
HideAllMachinings()
@@ -1909,12 +2059,160 @@ Public Class NestPageUC
' Dichiaro grezzo per punti
EgtSetInfo(GetCurrentRaw(), KEY_RAWBYPOINTS, 1)
End If
' Ruoto i punti SpotReg disegnati in Office
If bMoveOk Then
RotateAllSpotRegistration(dAngDeg, ptCen)
End If
' Ripristino lo stato iniziale
EgtSetCurrPhase(1)
HideAllMachinings()
Return bMoveOk
End Function
Friend Function RotateAllRawParts(dAngDeg As Double, ptCen As Point3d, Optional bIsReg As Boolean = True) As Boolean
' Recupero rotazione totale
Dim dRegRot As Double = GetRegistrationRotation()
' Recupero il centro del grezzo iniziale per usarlo come centro della rotazione
'Dim ptCen As New Point3d
'GetRawCenter(ptCen)
' Provo la rotazione
Dim bMoveOk As Boolean = True
Dim nPhase As Integer = 1
Dim nRawId As Integer = GDB_ID.NULL
While nPhase <= EgtGetPhaseCount()
EgtSetCurrPhase(nPhase)
nRawId = EgtGetFirstRawPart()
While nRawId <> GDB_ID.NULL
If EgtVerifyRawPartPhase(nRawId, nPhase) Then
' Rotazione del centro come spostamento grezzo più rotazione grezzo attorno al suo centro
Dim ptRawCen As New Point3d
EgtGetRawPartCenter(nRawId, ptRawCen)
Dim ptMovCen As New Point3d(ptRawCen)
ptMovCen.Rotate(ptCen, Vector3d.Z_AX(), dAngDeg)
If Not EgtMoveRawPart(nRawId, ptMovCen - ptRawCen) Then
bMoveOk = False
Exit While
End If
If Not EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAngDeg) Then
EgtMoveRawPart(nRawId, -(ptMovCen - ptRawCen))
bMoveOk = False
Exit While
End If
End If
nRawId = EgtGetNextRawPart(nRawId)
End While
If Not bMoveOk Then Exit While
nPhase += 1
End While
' Se rotazione impossibile, ripristino posizione dei grezzi già spostati
If Not bMoveOk Then
Dim nRevPhase As Integer = 1
Dim nRevRawId As Integer = GDB_ID.NULL
While nRevPhase <= nPhase
EgtSetCurrPhase(nRevPhase)
nRevRawId = EgtGetFirstRawPart()
While nRevRawId <> GDB_ID.NULL And (nRevPhase < nPhase Or nRevRawId <> nRawId)
If EgtVerifyRawPartPhase(nRevRawId, nRevPhase) Then
' Eseguo al contrario
EgtRotateRawPart(nRevRawId, Vector3d.Z_AX(), -dAngDeg)
Dim ptRawCen As New Point3d
EgtGetRawPartCenter(nRevRawId, ptRawCen)
Dim ptMovCen As New Point3d(ptRawCen)
ptMovCen.Rotate(ptCen, Vector3d.Z_AX(), -dAngDeg)
EgtMoveRawPart(nRevRawId, (ptMovCen - ptRawCen))
End If
nRevRawId = EgtGetNextRawPart(nRevRawId)
End While
nRevPhase += 1
End While
' Altrimenti eseguo sistemazioni
Else
' Origine della tavola
Dim ptOri As Point3d
EgtGetTableRef(1, ptOri)
' Annullo rotazioni dei grezzi e le rifaccio sulle parti componenti
Dim nRevPhase As Integer = 1
Dim nRevRawId As Integer = GDB_ID.NULL
While nRevPhase <= EgtGetPhaseCount()
EgtSetCurrPhase(nRevPhase)
nRevRawId = EgtGetFirstRawPart()
While nRevRawId <> GDB_ID.NULL
If EgtVerifyRawPartPhase(nRevRawId, nRevPhase) Then
' Eseguo al contrario
EgtRotateRawPart(nRevRawId, Vector3d.Z_AX(), -dAngDeg)
Dim ptRawCen As New Point3d
EgtGetRawPartCenter(nRevRawId, ptRawCen)
Dim ptMovCen As New Point3d(ptRawCen)
ptMovCen.Rotate(ptCen, Vector3d.Z_AX(), -dAngDeg)
EgtMoveRawPart(nRevRawId, (ptMovCen - ptRawCen))
' Rifaccio sugli oggetti contenuti nel grezzo
Dim nId As Integer = EgtGetFirstInGroup(nRevRawId)
While nId <> GDB_ID.NULL
EgtRotate(nId, ptCen, Vector3d.Z_AX(), dAngDeg, GDB_RT.GLOB)
nId = EgtGetNext(nId)
End While
' Imposto posizione esatta del grezzo dopo rotazione
Dim b3Raw As New BBox3d
EgtGetRawPartBBox(nRevRawId, b3Raw)
EgtMoveToCornerRawPart(nRevRawId, (b3Raw.Min() - ptOri) + Point3d.ORIG(), MCH_CR.BL)
End If
nRevRawId = EgtGetNextRawPart(nRevRawId)
End While
nRevPhase += 1
End While
' Ruoto opportunamente anche i dati di movimento
Dim nOpeId As Integer = EgtGetFirstActiveOperation()
While nOpeId <> GDB_ID.NULL
If EgtGetOperationType(nOpeId) = MCH_OY.DISP Then
' Recupero i gruppi con i dati
Dim nRpmId As Integer = EgtGetFirstNameInGroup(nOpeId, "Rpm*")
While nRpmId <> GDB_ID.NULL
' Recupero le informazioni
Dim vtRawMove As New Vector3d
If EgtGetInfo(nRpmId, "Mv", vtRawMove) Then
vtRawMove.Rotate(Vector3d.Z_AX(), dAngDeg)
EgtSetInfo(nRpmId, "Mv", vtRawMove)
End If
Dim vtDelta As New Vector3d
If EgtGetInfo(nRpmId, "Dt", vtDelta) Then
vtDelta.Rotate(Vector3d.Z_AX(), dAngDeg)
EgtSetInfo(nRpmId, "Dt", vtDelta)
End If
Dim dAngRotDeg As Double = 0
If EgtGetInfo(nRpmId, "Ad", dAngRotDeg) Then
EgtSetInfo(nRpmId, "Ad", dAngRotDeg + dAngDeg)
End If
' Cerco un altro gruppo
nRpmId = EgtGetNextName(nRpmId, "Rpm*")
End While
End If
nOpeId = EgtGetNextActiveOperation(nOpeId)
End While
' Se non è registrazione, ruoto anche l'eventuale foto della lastra
'If Not bIsReg Then
' Dim nPhotoId = m_CurrProjPage.GetPhoto()
' If nPhotoId <> GDB_ID.NULL then EgtRotatePhoto(nPhotoId, ptCen, Vector3d.Z_AX(), dAngDeg)
'End If
' Aggiorno rotazione totale
If bIsReg Then
SetRegistrationRotation(dRegRot + dAngDeg)
Else
SetRegistrationRotation(0)
End If
' Dichiaro grezzo per punti
EgtSetInfo(GetCurrentRaw(), KEY_RAWBYPOINTS, 1)
End If
' Ruoto i punti SpotReg disegnati in Office
If bMoveOk Then
RotateAllSpotRegistration(dAngDeg, ptCen)
End If
' Ripristino lo stato iniziale
EgtSetCurrPhase(1)
HideAllMachinings()
Return bMoveOk
End Function
Private Sub InsertPartBtn_Click(sender As Object, e As RoutedEventArgs) Handles InsertPartBtn.Click
' Se inserimento automatico
If GetPrivateProfileInt(S_NEST, K_AUTOMATICOPTIMIZE, 0, m_MainWindow.GetIniFile()) <> 0 And
@@ -2855,6 +3153,427 @@ Public Class NestPageUC
Return True
End Function
#Region "SPOT REG"
' Layer per crocette dei punti REG (creato in Office)
Public m_nRegGroupId As Integer = GDB_ID.NULL
' Numero di spot inseriti nel grezzo corrente (da Office)
Private m_nCountSpot As Integer = 0
' Gruppo Spot attualmente selezionato
Private m_nCurrSpotRegId As Integer = GDB_ID.NULL
' Nome info nuomero Spot (da Office)
Private Const COUNTSPOT As String = "CountSpot"
' Nome gruppo
Private Const REG As String = "Reg"
' Nome del gruppo di ogno Spot (da Office)
Private Const SPOTREG_ As String = "SpotReg_"
Private Const RADSPOT As Double = 20
' numero di Spot inseriti (da Cut)
Private m_nCountSpotCUT As Integer = 0
' Nome del gruppo di ogno Spot (da Cut)
Private Const SPOTREGCUT_ As String = "SpotRegCUT_"
' Nome info nuomero Spot (da Office)
Private Const COUNTSPOTCUT As String = "CountSpotCUT"
' Nome della Info per indicare se il punto è da usare
Private Const ACTIVATESPOTCUT As String = "ActivateSpotCut"
Private Sub AddPointReg_Click() Handles AddPointRegBtn.Click
DeselectCurSpotReg()
ModPointRegBtn.IsChecked = False
RemovePointRegBtn.IsChecked = False
ActivatePointRegBtn.IsChecked = False
End Sub
Private Sub ModPointReg_Click() Handles ModPointRegBtn.Click
' Deseleziono lo Spotreg selezionato
DeselectCurSpotReg()
AddPointRegBtn.IsChecked = False
RemovePointRegBtn.IsChecked = False
ActivatePointRegBtn.IsChecked = False
End Sub
Private Sub RemovePointReg_Click() Handles RemovePointRegBtn.Click
DeselectCurSpotReg()
ModPointRegBtn.IsChecked = False
AddPointRegBtn.IsChecked = False
ActivatePointRegBtn.IsChecked = False
End Sub
Private Sub AdjustPointReg_Click() Handles AdjustPointRegBtn.Click
PointRegCheckedOff()
AdjustRawWithSpotReg()
End Sub
Private Sub ActivatePointRegBtn_Click() Handles ActivatePointRegBtn.Click
DeselectCurSpotReg()
AddPointRegBtn.IsChecked = False
ModPointRegBtn.IsChecked = False
RemovePointRegBtn.IsChecked = False
End Sub
Private Sub DeselectCurSpotReg()
EgtDeselectAll()
If m_nCurrSpotRegId <> GDB_ID.NULL Then
EgtResetMark(m_nCurrSpotRegId)
m_nCurrSpotRegId = GDB_ID.NULL
EgtDraw()
End If
End Sub
' disabilito contemporaneamente tutti i comandi per la gestione punti SpotReg
Public Sub PointRegCheckedOff()
DeselectCurSpotReg()
AddPointRegBtn.IsChecked = False
ModPointRegBtn.IsChecked = False
RemovePointRegBtn.IsChecked = False
ActivatePointRegBtn.IsChecked = False
End Sub
' riceve l'ID del gruppo da muovere
Private Function MoveSpotRegistration(nIdGroup As Integer, vtMove As Vector3d) As Boolean
If nIdGroup = GDB_ID.NULL Then Return False
' Non ci deve essere movimento in Z
vtMove.z = 0
' Recupero il cercio di riferimento
Dim nArcId As Integer = EgtGetFirstInGroup(nIdGroup)
Dim b3Crv As New BBox3d
EgtGetBBoxGlob(nArcId, GDB_BB.STANDARD, b3Crv)
Dim ptMin, ptMax As Point3d
If EgtGetTableArea(1, ptMin, ptMax) Then
Dim m_ptTableMin As Point3d = ptMin
Dim m_dTableLength As Double = ptMax.x - ptMin.x
Dim m_dTableWidth As Double = ptMax.y - ptMin.y
b3Crv.Move(vtMove)
If b3Crv.Min().x < m_ptTableMin.x + 10 * EPS_SMALL Then
vtMove.x += m_ptTableMin.x + 10 * EPS_SMALL - b3Crv.Min().x
ElseIf b3Crv.Max().x > m_ptTableMin.x + m_dTableLength + 10 * EPS_SMALL Then
vtMove.x += m_ptTableMin.x + m_dTableLength - 10 * EPS_SMALL - b3Crv.Max().x
End If
If b3Crv.Min().y < m_ptTableMin.y + 10 * EPS_SMALL Then
vtMove.y += m_ptTableMin.y + 10 * EPS_SMALL - b3Crv.Min().y
ElseIf b3Crv.Max().y > m_ptTableMin.y + m_dTableWidth + 10 * EPS_SMALL Then
vtMove.y += m_ptTableMin.y + m_dTableWidth - 10 * EPS_SMALL - b3Crv.Max().y
End If
' muovo il gruppo
EgtMove(nIdGroup, vtMove)
EgtDraw()
Return True
End If
Return False
End Function
' Muovo solo gli elementi SpotReg creati nel programma OFFICE
Private Sub MoveAllSpotRegistration(vtMove As Vector3d, Optional bOnlyOfficeSpot As Boolean = True)
Dim nId As Integer = EgtGetFirstInGroup(m_nRegGroupId)
While nId <> GDB_ID.NULL
Dim sName As String = String.Empty
EgtGetName(nId, sName)
If Not sName.Contains("CUT") Or Not bOnlyOfficeSpot Then
EgtMove(nId, vtMove)
End If
nId = EgtGetNext(nId)
End While
EgtDraw()
End Sub
' Riposiziono i punti SpotReg (tutti) in funzione dell'altezza del grezzo
Public Sub UpdateSpotRegistration()
Dim ptCentArc As Point3d
If m_nRegGroupId <> GDB_ID.NULL Then Return
Dim nId As Integer = EgtGetFirstInGroup(m_nRegGroupId)
Dim sNameEnt As String = String.Empty
Dim sName As String = String.Empty
EgtGetName(nId, sName)
If sName.Contains("CUT") Then
sNameEnt = SPOTREGCUT_ & "Arc"
Else
sNameEnt = SPOTREG_ & "Arc"
End If
Dim nIdArc As Integer = EgtGetFirstNameInGroup(nId, sNameEnt)
If Not EgtCenterPoint(nIdArc, GDB_ID.ROOT, ptCentArc) Then
Return
End If
Dim dOffsetZ As Double = m_b3Raw.Max().z - ptCentArc.z
If Math.Abs(dOffsetZ) > 0.1 Then
MoveAllSpotRegistration(New Vector3d(0, 0, dOffsetZ + 0.1), False)
End If
End Sub
' Ruoto solo gli elementi SpotReg creati nel programma OFFICE
Private Sub RotateAllSpotRegistration(dAngRot As Double, ptCen As Point3d)
Dim nId As Integer = EgtGetFirstInGroup(m_nRegGroupId)
While nId <> GDB_ID.NULL
Dim sName As String = String.Empty
EgtGetName(nId, sName)
If Not sName.Contains("CUT") Then
EgtRotate(nId, ptCen, Vector3d.Z_AX, dAngRot)
End If
nId = EgtGetNext(nId)
End While
EgtDraw()
End Sub
' Per ogni SpotReg di OFFICE viene generato (nella stessa posizione) uno SpotRegCUT
Private Function InsertSportRegistration() As Boolean
' recupero l'elenco non ordinato degli Id dei punti SpotReg (da Office)
Dim SpotRegList As New List(Of Integer)
Dim nId As Integer = GDB_ID.NULL
' Creo la lista ordinata dei punti SpotReg (da OFFICE)
For nIndexSpot As Integer = 1 To m_nCountSpot
nId = EgtGetFirstNameInGroup(m_nRegGroupId, SPOTREG_ & nIndexSpot.ToString)
SpotRegList.Add(nId)
Next
' Creo i punti SpotRegCUT sovrapposti a quelli inseriti in OFFICE
Dim bOk As Boolean = True
For nIndex As Integer = 0 To SpotRegList.Count - 1
Dim ptCent As Point3d
GetCenterSpotReg(SpotRegList, SPOTREG_ & "Arc", nIndex + 1, ptCent)
bOk = bOk And CreateSpotRegistration(m_nRegGroupId, ptCent, nIndex + 1)
Next
Return bOk
End Function
' Creo il punto nel gruppo "Reg/SpotRegCUT_"
Private Function CreateSpotRegistration(nLayerIdReg As Integer, ptP As Point3d, nIndexSpot As Integer) As Boolean
' creo uno specifico layer per ogni spot (definito da una croce inscritta in un cerchio)
Dim nIdSpotLay As Integer = EgtCreateGroup(nLayerIdReg)
' Aggiungo cerchio
Dim nCircId As Integer = EgtCreateCircle(nIdSpotLay, ptP, RADSPOT)
' Inserisco una croce all'interno del
Dim nLineVId As Integer = EgtCreateLinePVL(nIdSpotLay, ptP, Vector3d.Y_AX, RADSPOT)
EgtExtendCurveStartByLen(nLineVId, RADSPOT)
Dim nLineHId As Integer = EgtCreateLinePVL(nIdSpotLay, ptP, Vector3d.X_AX, RADSPOT)
EgtExtendCurveStartByLen(nLineHId, RADSPOT)
Dim nTextId As Integer = EgtCreateText(nIdSpotLay, ptP + New Vector3d(1, 1, 0), nIndexSpot.ToString, 10)
' coloro gli oggetti appena creati ed assegno il nome
Dim bOk As Boolean = EgtSetColor(nCircId, New Color3d(0, 255, 0))
bOk = bOk And EgtSetName(nCircId, SPOTREGCUT_ & "Arc")
bOk = bOk And EgtSetColor(nLineVId, New Color3d(0, 255, 0))
bOk = bOk And EgtSetName(nLineVId, SPOTREGCUT_ & "LineV")
bOk = bOk And EgtSetColor(nLineHId, New Color3d(0, 255, 0))
bOk = bOk And EgtSetName(nLineHId, SPOTREGCUT_ & "LineH")
bOk = bOk And EgtSetColor(nTextId, New Color3d(255, 0, 0))
bOk = bOk And EgtSetName(nTextId, SPOTREGCUT_ & "Text")
' assegno il nome del gruppo corrente
bOk = bOk And EgtSetName(nIdSpotLay, SPOTREGCUT_ & nIndexSpot.ToString)
If bOk Then
' Aggiorno il contatore degli Spot
EgtSetInfo(nLayerIdReg, COUNTSPOTCUT, nIndexSpot)
m_nCountSpotCUT = nIndexSpot
End If
Return bOk
End Function
' Elimino il punto nel gruppo "Reg/SpotRegCUT_"
Private Function RemoveSpotRegistration(nSpotRegId As Integer) As Boolean
Dim nIndSpotReg As Integer = GetIndexGroupSpotReg(nSpotRegId)
If Not EgtErase(nSpotRegId) Then Return False
' faccio scorrere tutti i gruppi ed eventualmente li rinomino
Dim n_IdSR As Integer = EgtGetFirstInGroup(m_nRegGroupId)
m_nCountSpotCUT -= 1
EgtSetInfo(m_nRegGroupId, COUNTSPOTCUT, m_nCountSpotCUT)
While n_IdSR <> GDB_ID.NULL
Dim sName As String = String.Empty
EgtGetName(n_IdSR, sName)
If sName.Contains("CUT") Then
Dim nCurrIndSpotReg As Integer = GetIndexGroupSpotReg(n_IdSR)
If nCurrIndSpotReg > nIndSpotReg Then
' Recupero il testo
Dim nIdtext As Integer = EgtGetFirstNameInGroup(n_IdSR, SPOTREGCUT_ & "Text")
nCurrIndSpotReg -= 1
EgtModifyText(nIdtext, nCurrIndSpotReg.ToString)
EgtSetName(n_IdSR, SPOTREGCUT_ & nCurrIndSpotReg.ToString)
End If
End If
n_IdSR = EgtGetNext(n_IdSR)
End While
EgtDraw()
Return True
End Function
' Cambio lo stato dello SpotReg (sia di OFFICE che di CUT)
Private Function ActivateSpotRegistration(nSpotRegId As Integer) As Boolean
Dim nIndexSpot As Integer = GetIndexGroupSpotReg(nSpotRegId)
Dim nParentId As Integer = EgtGetParent(nSpotRegId)
Dim nInfo As Integer = 0
Dim bOk As Boolean = True
If Not EgtGetInfo(nSpotRegId, ACTIVATESPOTCUT, nInfo) Then
' 1: Attivo, 0: Disbilitato
nInfo = 1
End If
If nInfo = 1 Then
' inserisco una Info sullo SpotRegCUT che indica che è disattivo
nSpotRegId = EgtGetFirstNameInGroup(nParentId, SPOTREGCUT_ & nIndexSpot.ToString)
bOk = EgtSetInfo(nSpotRegId, ACTIVATESPOTCUT, 0)
Dim nEntId As Integer = EgtGetFirstNameInGroup(nSpotRegId, SPOTREGCUT_ & "Arc")
bOk = bOk And EgtSetColor(nEntId, New Color3d(255, 0, 0))
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREGCUT_ & "LineV")
bOk = bOk And EgtSetColor(nEntId, New Color3d(255, 0, 0))
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREGCUT_ & "LineH")
bOk = bOk And EgtSetColor(nEntId, New Color3d(255, 0, 0))
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREGCUT_ & "Text")
bOk = bOk And EgtSetColor(nEntId, New Color3d(255, 255, 0))
' inserisco una Info sullo SpotReg (OFFICE) che indica che è disattivo
nSpotRegId = EgtGetFirstNameInGroup(nParentId, SPOTREG_ & nIndexSpot.ToString)
bOk = EgtSetInfo(nSpotRegId, ACTIVATESPOTCUT, 0)
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "Arc")
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 0, 255))
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "LineV")
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 0, 255))
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "LineH")
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 0, 255))
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "Text")
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 0, 0))
Else
' inserisco una Info sul pezzo che indica che è attivo
nSpotRegId = EgtGetFirstNameInGroup(nParentId, SPOTREGCUT_ & nIndexSpot.ToString)
bOk = EgtSetInfo(nSpotRegId, ACTIVATESPOTCUT, 1)
Dim nEntId As Integer = EgtGetFirstNameInGroup(nSpotRegId, SPOTREGCUT_ & "Arc")
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 255, 0))
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREGCUT_ & "LineV")
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 255, 0))
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREGCUT_ & "LineH")
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 255, 0))
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREGCUT_ & "Text")
bOk = bOk And EgtSetColor(nEntId, New Color3d(255, 0, 0))
' inserisco una Info sullo SpotReg (OFFICE) che indica che è disattivo
nSpotRegId = EgtGetFirstNameInGroup(nParentId, SPOTREG_ & nIndexSpot.ToString)
bOk = EgtSetInfo(nSpotRegId, ACTIVATESPOTCUT, 1)
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "Arc")
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 0, 0))
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "LineV")
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 0, 0))
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "LineH")
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 0, 0))
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "Text")
bOk = bOk And EgtSetColor(nEntId, New Color3d(255, 0, 0))
End If
Return bOk
End Function
' Restituisce l'indice dello "SpotReg_" oppure "SpotRegCUT_"
Private Function GetIndexGroupSpotReg(nSpotRegId As Integer) As Integer
Dim sNameParent As String = String.Empty
EgtGetName(nSpotRegId, sNameParent)
' Ricavo l'indice dal nome
Dim sItems As String() = sNameParent.Split("_"c)
Dim nCurrIndex As Integer = 0
If sItems.Count = 2 Then
If Not Integer.TryParse(sItems(1), nCurrIndex) Then
nCurrIndex = -1
End If
End If
Return nCurrIndex
End Function
' Calcola gli spostamenti del grezzo per posizionare i punti di SpotReg
Private Function AdjustRawWithSpotReg() As Boolean
' Verifico che almeno un punto sia stato inserito
If m_nCountSpotCUT < 1 Then
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
m_MainWindow.m_CurrentProjectPageUC.SetWarningMessage("Insert one spot reg to start.")
End If
' recupero l'elenco non ordinato degli Id dei punti SpotReg (da Office)
Dim SpotRegList As New List(Of Integer)
Dim SpotRegCUTList As New List(Of Integer)
Dim nId As Integer = EgtGetFirstInGroup(m_nRegGroupId)
' Creo la lista ordinata dei punti
For nIndexSpot As Integer = 1 To m_nCountSpotCUT
nId = EgtGetFirstNameInGroup(m_nRegGroupId, SPOTREGCUT_ & nIndexSpot.ToString)
Dim nActivate As Integer = 0
If Not EgtGetInfo(nId, ACTIVATESPOTCUT, nActivate) Then
nActivate = 1
End If
If nId <> GDB_ID.NULL And nActivate = 1 Then
SpotRegCUTList.Add(nId)
nId = EgtGetFirstNameInGroup(m_nRegGroupId, SPOTREG_ & nIndexSpot.ToString)
SpotRegList.Add(nId)
End If
Next
' Carico la lista dei centri
Dim ptCentCUTList As New List(Of Point3d)
Dim ptCentLIst As New List(Of Point3d)
If Not GetAllCenterSpotReg(SpotRegCUTList, SpotRegList, ptCentCUTList, ptCentLIst) Then Return False
' Eseguo il primo posizionamento di massima
Dim vtMoveStart As Vector3d = ptCentCUTList(0) - ptCentLIst(0)
Dim dAngRotSum As Double = 0.0
Dim dScaleSum As Double = 0.0
For nIndex As Integer = 1 To ptCentCUTList.Count - 1
Dim vtDirCUT As Vector3d = ptCentCUTList(nIndex) - ptCentCUTList(0)
Dim vtDir As Vector3d = ptCentLIst(nIndex) - ptCentLIst(0)
Dim dLenCUT, dLen, dAngVCUT, dAngV, dAngHCUT, dAngH As Double
vtDirCUT.ToSpherical(dLenCUT, dAngVCUT, dAngHCUT)
vtDir.ToSpherical(dLen, dAngV, dAngH)
dScaleSum += Math.Abs(dLenCUT - dLen) / dLenCUT
dAngRotSum += dAngHCUT - dAngH
Next
vtMoveStart.z = 0
' Determino la deformazione media
Dim dScaleAvarage As Double = 1 - dScaleSum / (ptCentCUTList.Count - 1)
MoveAllRawParts(vtMoveStart)
' Ruoto del valor medio delle differenze angolari
Dim dAngAvarage As Double = dAngRotSum / (ptCentCUTList.Count - 1)
RotateAllRawParts(dAngAvarage, ptCentCUTList(0))
Dim sCurrINdexSpot As String = GetIndexGroupSpotReg(SpotRegCUTList(0)).ToString
EgtOutLog(" → REG Adjustment datas :")
EgtOutLog(" → move SpotReg_" & sCurrINdexSpot & " : " & vtMoveStart.x.ToString & ", " & vtMoveStart.y.ToString)
EgtOutLog(" → average rotation around SpotRegCUT_" & sCurrINdexSpot & " : " & dAngAvarage.ToString)
EgtOutLog(" → average scale deformation : " & dScaleAvarage.ToString)
' Correggo lo spostamento in funzione della deformazione misurata
Dim vtMoveSum As Vector3d = New Vector3d(0, 0, 0)
GetAllCenterSpotReg(SpotRegCUTList, SpotRegList, ptCentCUTList, ptCentLIst)
For nIndex As Integer = 1 To ptCentCUTList.Count - 1
vtMoveSum += ptCentCUTList(nIndex) - ptCentLIst(nIndex)
Next
vtMoveSum.z = 0
vtMoveSum = vtMoveSum / (ptCentCUTList.Count - 1)
MoveAllRawParts(vtMoveSum * dScaleAvarage / 2)
EgtDraw()
Return True
End Function
Private Function GetAllCenterSpotReg(SpotRegCUTList As List(Of Integer), SpotRegList As List(Of Integer),
ByRef ptCentCUTList As List(Of Point3d), ByRef ptCentLIst As List(Of Point3d)) As Boolean
ptCentCUTList.Clear()
ptCentLIst.Clear()
For nIndex As Integer = 0 To m_nCountSpotCUT
Dim ptCenCUT As Point3d
Dim ptCent As Point3d
If GetCenterSpotReg(SpotRegCUTList, SPOTREGCUT_ & "Arc", nIndex + 1, ptCenCUT) Then
ptCentCUTList.Add(ptCenCUT)
GetCenterSpotReg(SpotRegList, SPOTREG_ & "Arc", nIndex + 1, ptCent)
ptCentLIst.Add(ptCent)
End If
Next
If ptCentCUTList.Count > 0 AndAlso ptCentCUTList.Count = ptCentLIst.Count Then
Return True
Else
Return False
End If
End Function
' Data la lista di punti Spot e l'indice dello spot da ricercare restituisce il centro del punto indicato
Private Function GetCenterSpotReg(ListSR As List(Of Integer), sName As String, nIndex As Integer, ByRef ptCentArc As Point3d) As Boolean
For Each ItemSR As Integer In ListSR
If GetIndexGroupSpotReg(ItemSR) = nIndex Then
Dim nIdArc As Integer = EgtGetFirstNameInGroup(ItemSR, sName)
If EgtCenterPoint(nIdArc, GDB_ID.ROOT, ptCentArc) Then
Return True
End If
End If
Next
Return False
End Function
#End Region
End Class
+20 -4
View File
@@ -33,10 +33,26 @@ Public Class MainComponentPageUC
m_bIsFirstPage = True
LoadPage()
CurrentBtn = Nothing
Compo9.SetValue(Grid.ColumnProperty, 0)
Compo9.SetValue(Grid.ColumnSpanProperty, 2)
ImageCompo9.Visibility = Windows.Visibility.Hidden
LabelCompo9.Visibility = Windows.Visibility.Visible
If m_MainWindow.FrameCutBtn.IsChecked Then
' se il numero delle componenti è superiore a 8 allora inserisco la seconda pagina
If GetPrivateProfileInt(S_FRAMECOMPO, K_CMP_COUNT, 0, m_MainWindow.GetIniFile()) > 8 Then
OthersBackGr.Visibility = Visibility.Visible
Compo9.SetValue(Grid.ColumnProperty, 0)
Compo9.SetValue(Grid.ColumnSpanProperty, 2)
ImageCompo9.Visibility = Windows.Visibility.Hidden
LabelCompo9.Visibility = Windows.Visibility.Visible
Else
OthersBackGr.Visibility = Visibility.Hidden
End If
Else
OthersBackGr.Visibility = Visibility.Visible
Compo9.SetValue(Grid.ColumnProperty, 0)
Compo9.SetValue(Grid.ColumnSpanProperty, 2)
ImageCompo9.Visibility = Windows.Visibility.Hidden
LabelCompo9.Visibility = Windows.Visibility.Visible
End If
m_MainWindow.m_DrawPageUC.SideAngleBtn.IsEnabled = False
m_MainWindow.m_DrawPageUC.FiloTopBtn.IsEnabled = False
m_MainWindow.m_DrawPageUC.EngraveBtn.IsEnabled = False
+2 -2
View File
@@ -329,8 +329,8 @@ Class MainWindow
' Verifico abilitazione nesting automatico
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
' Recupero opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2507, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2507, 1, m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2508, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2508, 1, m_nKeyOptions)
' Verifico abilitazione prodotto
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
' Inizializzazione generale di EgtInterface
+2 -2
View File
@@ -62,5 +62,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.5.7.3")>
<Assembly: AssemblyFileVersion("2.5.7.3")>
<Assembly: AssemblyVersion("2.5.8.1")>
<Assembly: AssemblyFileVersion("2.5.8.1")>
+42
View File
@@ -982,6 +982,7 @@ Public Class ProjectMgrUC
ResetCutBtn.Visibility = Windows.Visibility.Hidden
SimulateBtn.Visibility = Windows.Visibility.Hidden
WorkBtn.Visibility = Windows.Visibility.Hidden
If TestBtn.Visibility = Windows.Visibility.Visible Then TestBtn.Visibility = Windows.Visibility.Hidden
' Nascondo bottoni CadCutPageUC
m_MainWindow.m_CadCutPageUC.PhotoBtn.Visibility = Windows.Visibility.Hidden
m_MainWindow.m_CadCutPageUC.RawPartBtn.Visibility = Windows.Visibility.Hidden
@@ -997,6 +998,18 @@ Public Class ProjectMgrUC
m_MainWindow.m_CadCutPageUC.m_NestPage.RemovePartBtn.Visibility = Windows.Visibility.Hidden
m_MainWindow.m_CadCutPageUC.m_NestPage.SelectAllBtn.Visibility = Windows.Visibility.Hidden
m_MainWindow.m_CadCutPageUC.m_NestPage.DeselectAllBtn.Visibility = Windows.Visibility.Hidden
' nuovi bottoni pagina di Nesting
m_MainWindow.m_CadCutPageUC.m_NestPage.DragRettanleBtn.Visibility = Windows.Visibility.Hidden
If m_MainWindow.m_CadCutPageUC.m_NestPage.SplitCurveWJBtn.Visibility = Windows.Visibility.Visible Then
m_MainWindow.m_CadCutPageUC.m_NestPage.SplitCurveWJBtn.Visibility = Windows.Visibility.Hidden
End If
' Nascondo bottoni rawpage
m_MainWindow.m_RawPartPage.OtherRefTabBtn.Visibility = Windows.Visibility.Hidden
' Rendo visibili i bottoni per la definizione degli Spotreg
m_MainWindow.m_CadCutPageUC.m_NestPage.UG0_Reg.Visibility = Visibility.Visible
m_MainWindow.m_CadCutPageUC.m_NestPage.UG1_Reg.Visibility = Visibility.Visible
' Deseleziono tutto
EgtDeselectAll()
' Se c'è la foto devo sistemare
@@ -1028,8 +1041,15 @@ Public Class ProjectMgrUC
End If
' Visualizzo step adatti alla scelta fatta
m_MainWindow.m_CadCutPageUC.m_NestPage.UpdateStepsOnUI()
' Cancello eventuali messaggi di errore/avvertimento
m_CurrProjPage.ClearMessage()
' visualizzo i punti di SpotReg
EgtSetStatus(m_MainWindow.m_CadCutPageUC.m_NestPage.m_nRegGroupId, GDB_ST.ON_)
' eventualmente risistemo tutti i punti Spotreg in funzione dell'altezza del grezzo
m_MainWindow.m_CadCutPageUC.m_NestPage.UpdateSpotRegistration()
EgtDraw()
End Sub
Private Sub RegisterBtn_Unchecked(sender As Object, e As RoutedEventArgs) Handles RegisterBtn.Unchecked
@@ -1057,6 +1077,7 @@ Public Class ProjectMgrUC
m_MainWindow.m_CadCutPageUC.DrawBtn.Visibility = Windows.Visibility.Visible
m_MainWindow.m_CadCutPageUC.ImportBtn.Visibility = Windows.Visibility.Visible
m_MainWindow.m_CadCutPageUC.SplitBtn.Visibility = Windows.Visibility.Visible
If TestBtn.Visibility = Windows.Visibility.Hidden Then TestBtn.Visibility = Windows.Visibility.Visible
' Visualizzo bottoni nesting
m_MainWindow.m_CadCutPageUC.m_NestPage.m_bRegister = False
m_MainWindow.m_CadCutPageUC.m_NestPage.MaximizeMoveBtn.IsEnabled = True
@@ -1066,6 +1087,22 @@ Public Class ProjectMgrUC
m_MainWindow.m_CadCutPageUC.m_NestPage.RemovePartBtn.Visibility = Windows.Visibility.Visible
m_MainWindow.m_CadCutPageUC.m_NestPage.SelectAllBtn.Visibility = Windows.Visibility.Visible
m_MainWindow.m_CadCutPageUC.m_NestPage.DeselectAllBtn.Visibility = Windows.Visibility.Visible
' nuovi bottoni pagina di Nesting
m_MainWindow.m_CadCutPageUC.m_NestPage.DragRettanleBtn.Visibility = Windows.Visibility.Visible
If m_MainWindow.m_CadCutPageUC.m_NestPage.SplitCurveWJBtn.Visibility = Windows.Visibility.Hidden Then
m_MainWindow.m_CadCutPageUC.m_NestPage.SplitCurveWJBtn.Visibility = Windows.Visibility.Visible
End If
' disabilito i comandi per gestioen SpotReg
m_MainWindow.m_CadCutPageUC.m_NestPage.PointRegCheckedOff()
m_MainWindow.m_CadCutPageUC.m_NestPage.UG0_Reg.Visibility = Visibility.Hidden
m_MainWindow.m_CadCutPageUC.m_NestPage.UG1_Reg.Visibility = Visibility.Hidden
' Nascondo bottoni rawpage
m_MainWindow.m_RawPartPage.OtherRefTabBtn.Visibility = Windows.Visibility.Visible
' Nascondo i bottoni per la definizione degli Spotreg
m_MainWindow.m_CadCutPageUC.m_NestPage.UG0_Reg.Visibility = Visibility.Hidden
' Se c'è la foto devo sistemare
If m_CurrProjPage.GetPhoto() <> GDB_ID.NULL Then
' Recupero il riferimento originale del primo grezzo
@@ -1110,6 +1147,11 @@ Public Class ProjectMgrUC
End If
' Visualizzo step adatti alla scelta fatta
m_MainWindow.m_CadCutPageUC.m_NestPage.UpdateStepsOnUI()
' nascondi i punti di SpotReg
EgtSetStatus(m_MainWindow.m_CadCutPageUC.m_NestPage.m_nRegGroupId, GDB_ST.OFF)
EgtDraw()
' Cancello eventuali messaggi di errore/avvertimento
m_CurrProjPage.ClearMessage()
End Sub
+2
View File
@@ -362,6 +362,8 @@ Public Class RawPartPageUC
OtherRefTabChBx.Visibility = Visibility.Collapsed
OtherRefTabTxBl.Visibility = Visibility.Collapsed
Return
Else
OtherRefTabBtn.Visibility = Visibility.Visible
End If
m_bOtherRefTab = (GetPrivateProfileInt(S_RAWPART, K_OTHERREFTAB, 0, m_MainWindow.GetIniFile()) <> 0)
m_OtherRefTabX = GetPrivateProfileDouble(S_RAWPART, K_OTHERREFTABX, 0, m_MainWindow.GetIniFile())