Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 18966d103e | |||
| 8a65942370 | |||
| c55cbfa5bb | |||
| 1557f0865c | |||
| c7828774d8 | |||
| cd0388b970 |
+15
-14
@@ -92,22 +92,23 @@
|
|||||||
Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
|
Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
|
||||||
<Image Source="{DynamicResource Sezione-corniceImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
|
<Image Source="{DynamicResource Sezione-corniceImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
|
||||||
</Button>-->
|
</Button>-->
|
||||||
|
<UniformGrid Name="ArcGrid" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" >
|
||||||
<Grid>
|
<TextBlock Name="ArcRadTxBl" Grid.Row="2" Grid.ColumnSpan="2"
|
||||||
<Button Name="SelGuideBtn" Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||||
<UniformGrid Name="ArcGrid" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" >
|
<EgtWPFLib:EgtTextBox Name="ArcRadTxBx" Grid.Column="2" Grid.Row="2" Width="50"
|
||||||
<TextBlock Name="ArcRadTxBl" Grid.Row="2" Grid.ColumnSpan="2"
|
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
<TextBlock Name="ArcAngTxBl" Grid.Row="3" Grid.ColumnSpan="2"
|
||||||
<EgtWPFLib:EgtTextBox Name="ArcRadTxBx" Grid.Column="2" Grid.Row="2" Width="50"
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
<EgtWPFLib:EgtTextBox Name="ArcAngTxBx" Grid.Column="2" Grid.Row="3" Width="50"
|
||||||
<TextBlock Name="ArcAngTxBl" Grid.Row="3" Grid.ColumnSpan="2"
|
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
</UniformGrid>
|
||||||
<EgtWPFLib:EgtTextBox Name="ArcAngTxBx" Grid.Column="2" Grid.Row="3" Width="50"
|
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
|
||||||
</UniformGrid>
|
|
||||||
</Grid>
|
|
||||||
</UniformGrid>
|
</UniformGrid>
|
||||||
|
|
||||||
|
<UniformGrid Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" >
|
||||||
|
<Button Name="SelGuideBtn" Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||||
|
<ToggleButton Name="SelRawSideBtn" Style="{DynamicResource OmagCut_YellowToggleButton}"/>
|
||||||
|
</UniformGrid>
|
||||||
|
|
||||||
<TextBlock Name="OffsZTxBl" Grid.Row="2" Grid.ColumnSpan="2"
|
<TextBlock Name="OffsZTxBl" Grid.Row="2" Grid.ColumnSpan="2"
|
||||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="OffsZTxBx" Grid.Column="2" Grid.Row="2" Width="50"
|
<EgtWPFLib:EgtTextBox Name="OffsZTxBx" Grid.Column="2" Grid.Row="2" Width="50"
|
||||||
|
|||||||
+257
-91
@@ -23,6 +23,10 @@ Public Class FrameCutPageUC
|
|||||||
' Importazione guida in corso
|
' Importazione guida in corso
|
||||||
Private m_bGuide As Boolean = False
|
Private m_bGuide As Boolean = False
|
||||||
|
|
||||||
|
' Linea selezionata dal contorno del grezzo
|
||||||
|
Private m_LineDir As Integer = -1
|
||||||
|
Private m_ptMidLineDir As New Point3d
|
||||||
|
|
||||||
Private Sub FrameCutPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
Private Sub FrameCutPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||||
' Creazione delle Page UserControl
|
' Creazione delle Page UserControl
|
||||||
m_ProjectMgr = New ProjectMgrUC
|
m_ProjectMgr = New ProjectMgrUC
|
||||||
@@ -61,9 +65,10 @@ Public Class FrameCutPageUC
|
|||||||
m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 1)) 'Lungo X
|
m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 1)) 'Lungo X
|
||||||
m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 2)) 'Lungo Y
|
m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 2)) 'Lungo Y
|
||||||
If GetPrivateProfileInt(S_FRAME, K_ARC_ENABLE, 0, m_MainWindow.GetIniFile()) <> 0 And
|
If GetPrivateProfileInt(S_FRAME, K_ARC_ENABLE, 0, m_MainWindow.GetIniFile()) <> 0 And
|
||||||
m_MainWindow.GetKeyOption( MainWindow.KEY_OPT.CURVED_FRAME) Then
|
m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.CURVED_FRAME) Then
|
||||||
m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 13)) 'Arco
|
m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 13)) 'Arco
|
||||||
m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 14)) 'Guida
|
m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 14)) 'Guida
|
||||||
|
m_AlongAx.Add("Raw side")
|
||||||
End If
|
End If
|
||||||
SelSectionBtn.ToolTip = EgtMsg(MSG_FRAMECUTPAGEUC + 15) 'Sezione
|
SelSectionBtn.ToolTip = EgtMsg(MSG_FRAMECUTPAGEUC + 15) 'Sezione
|
||||||
SelGuideBtn.Content = EgtMsg(MSG_FRAMECUTPAGEUC + 16) 'Guida
|
SelGuideBtn.Content = EgtMsg(MSG_FRAMECUTPAGEUC + 16) 'Guida
|
||||||
@@ -75,6 +80,7 @@ Public Class FrameCutPageUC
|
|||||||
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 9) 'Distanza inizio
|
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 9) 'Distanza inizio
|
||||||
OffsYyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 22) 'Distanza Y
|
OffsYyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 22) 'Distanza Y
|
||||||
OffsXInteryTxBl.Text = EgtMsg(90645) 'Interasse
|
OffsXInteryTxBl.Text = EgtMsg(90645) 'Interasse
|
||||||
|
SelRawSideBtn.Content = "Sel raw side"
|
||||||
Dim sChBxToolTip As String = EgtMsg(90646) 'Applica valore indicato\n altrienti spessore lama
|
Dim sChBxToolTip As String = EgtMsg(90646) 'Applica valore indicato\n altrienti spessore lama
|
||||||
sChBxToolTip = sChBxToolTip.Replace("/n", "£")
|
sChBxToolTip = sChBxToolTip.Replace("/n", "£")
|
||||||
Dim sItems As String() = sChBxToolTip.Split("£")
|
Dim sItems As String() = sChBxToolTip.Split("£")
|
||||||
@@ -138,25 +144,26 @@ Public Class FrameCutPageUC
|
|||||||
AlongAxCmBx.SelectedIndex = m_CurrAx
|
AlongAxCmBx.SelectedIndex = m_CurrAx
|
||||||
AlongAxCmBx.IsEnabled = False
|
AlongAxCmBx.IsEnabled = False
|
||||||
' Se cornice arco o curva, disabilito scelta nuova sezione
|
' Se cornice arco o curva, disabilito scelta nuova sezione
|
||||||
SelSectionBtn.IsEnabled = ( m_CurrAx = 0 Or m_CurrAx = 1)
|
SelSectionBtn.IsEnabled = (m_CurrAx = 0 Or m_CurrAx = 1)
|
||||||
' Se cornice curva, verifico se disabilitare scelta guida
|
' Se cornice curva, verifico se disabilitare scelta guida
|
||||||
If m_CurrAx = 3 Then
|
Dim bIsEnable As Boolean = (EgtGetFirstNameInGroup(nPartId, NAME_GUIDE) = GDB_ID.NULL)
|
||||||
SelGuideBtn.IsEnabled = ( EgtGetFirstNameInGroup( nPartId, NAME_GUIDE) = GDB_ID.NULL)
|
If m_CurrAx = 3 Then SelGuideBtn.IsEnabled = bIsEnable
|
||||||
End If
|
If m_CurrAx = 4 Then SelRawSideBtn.IsEnabled = bIsEnable
|
||||||
' Se cornice su arco ne leggo i dati
|
' Se cornice su arco ne leggo i dati
|
||||||
If m_CurrAx = 2 Then
|
If m_CurrAx = 2 Then
|
||||||
Dim dExtRad As Double
|
Dim dExtRad As Double
|
||||||
if EgtGetInfo(nPartId, INFO_FRAME_ARCRAD, dExtRad) Then ArcRadTxBx.Text = LenToString( dExtRad, 3)
|
If EgtGetInfo(nPartId, INFO_FRAME_ARCRAD, dExtRad) Then ArcRadTxBx.Text = LenToString(dExtRad, 3)
|
||||||
Dim dAngCenDeg As Double
|
Dim dAngCenDeg As Double
|
||||||
if EgtGetInfo(nPartId, INFO_FRAME_ARCANG, dAngCenDeg) Then ArcAngTxBx.Text = DoubleToString( dAngCenDeg, 3)
|
If EgtGetInfo(nPartId, INFO_FRAME_ARCANG, dAngCenDeg) Then ArcAngTxBx.Text = DoubleToString(dAngCenDeg, 3)
|
||||||
End If
|
End If
|
||||||
' Altrimenti
|
' Altrimenti
|
||||||
Else
|
Else
|
||||||
' Abilito cambio direzione e scelta sezione
|
' Abilito cambio direzione e scelta sezione
|
||||||
AlongAxCmBx.SelectedIndex = m_CurrAx
|
AlongAxCmBx.SelectedIndex = m_CurrAx
|
||||||
AlongAxCmBx.IsEnabled = True
|
AlongAxCmBx.IsEnabled = True
|
||||||
SelSectionBtn.IsEnabled = True
|
SelSectionBtn.IsEnabled = True
|
||||||
SelGuideBtn.IsEnabled = True
|
If m_CurrAx = 3 Then SelGuideBtn.IsEnabled = True
|
||||||
|
If m_CurrAx = 4 Then SelRawSideBtn.IsEnabled = True
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -168,6 +175,7 @@ Public Class FrameCutPageUC
|
|||||||
ArcGrid.Visibility = Windows.Visibility.Collapsed
|
ArcGrid.Visibility = Windows.Visibility.Collapsed
|
||||||
OffsYyTxBl.Visibility = Windows.Visibility.Collapsed
|
OffsYyTxBl.Visibility = Windows.Visibility.Collapsed
|
||||||
OffsYyTxBx.Visibility = Windows.Visibility.Collapsed
|
OffsYyTxBx.Visibility = Windows.Visibility.Collapsed
|
||||||
|
SelRawSideBtn.Visibility = Windows.Visibility.Collapsed
|
||||||
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 9) 'Distanza inizio
|
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 9) 'Distanza inizio
|
||||||
Case 2 'Arco
|
Case 2 'Arco
|
||||||
SelSectionBtn.Visibility = Windows.Visibility.Visible
|
SelSectionBtn.Visibility = Windows.Visibility.Visible
|
||||||
@@ -175,6 +183,7 @@ Public Class FrameCutPageUC
|
|||||||
ArcGrid.Visibility = Windows.Visibility.Visible
|
ArcGrid.Visibility = Windows.Visibility.Visible
|
||||||
OffsYyTxBl.Visibility = Windows.Visibility.Visible
|
OffsYyTxBl.Visibility = Windows.Visibility.Visible
|
||||||
OffsYyTxBx.Visibility = Windows.Visibility.Visible
|
OffsYyTxBx.Visibility = Windows.Visibility.Visible
|
||||||
|
SelRawSideBtn.Visibility = Windows.Visibility.Collapsed
|
||||||
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 21) 'Distanza X
|
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 21) 'Distanza X
|
||||||
Case 3 'Guida
|
Case 3 'Guida
|
||||||
SelSectionBtn.Visibility = Windows.Visibility.Visible
|
SelSectionBtn.Visibility = Windows.Visibility.Visible
|
||||||
@@ -183,6 +192,16 @@ Public Class FrameCutPageUC
|
|||||||
ArcGrid.Visibility = Windows.Visibility.Collapsed
|
ArcGrid.Visibility = Windows.Visibility.Collapsed
|
||||||
OffsYyTxBl.Visibility = Windows.Visibility.Visible
|
OffsYyTxBl.Visibility = Windows.Visibility.Visible
|
||||||
OffsYyTxBx.Visibility = Windows.Visibility.Visible
|
OffsYyTxBx.Visibility = Windows.Visibility.Visible
|
||||||
|
SelRawSideBtn.Visibility = Windows.Visibility.Collapsed
|
||||||
|
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 21) 'Distanza X
|
||||||
|
Case 4
|
||||||
|
SelSectionBtn.Visibility = Windows.Visibility.Visible
|
||||||
|
SelGuideBtn.Visibility = Windows.Visibility.Collapsed
|
||||||
|
ArcGrid.Visibility = Windows.Visibility.Collapsed
|
||||||
|
OffsYyTxBl.Visibility = Windows.Visibility.Visible
|
||||||
|
OffsYyTxBx.Visibility = Windows.Visibility.Visible
|
||||||
|
SelRawSideBtn.Visibility = Windows.Visibility.Visible
|
||||||
|
SelRawSideBtn.IsEnabled = False
|
||||||
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 21) 'Distanza X
|
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 21) 'Distanza X
|
||||||
End Select
|
End Select
|
||||||
End Sub
|
End Sub
|
||||||
@@ -209,11 +228,58 @@ Public Class FrameCutPageUC
|
|||||||
Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then
|
Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' Verifico se selezionato indicativo di pezzo
|
' Verifico se selezionato indicativo di pezzo
|
||||||
EgtSetObjFilterForSelWin(False, False, True, False, False)
|
Dim nSel As Integer = GDB_ID.NULL
|
||||||
Dim nSel As Integer
|
Dim nId As Integer = GDB_ID.NULL
|
||||||
|
|
||||||
|
If SelRawSideBtn.IsChecked Then
|
||||||
|
' Verifico se selezionato indicativo di pezzo
|
||||||
|
EgtSetObjFilterForSelWin(False, True, False, False, False)
|
||||||
|
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel)
|
||||||
|
nId = EgtGetFirstObjInSelWin()
|
||||||
|
Dim ptPrev As Point3d
|
||||||
|
' Verifico cosa selezionato
|
||||||
|
Dim nSolidId = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_RAW_SOLID)
|
||||||
|
Dim nKerfId = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_KERF)
|
||||||
|
' Acquisisco punto da disegno
|
||||||
|
EgtUnProjectPoint(e.Location, ptPrev)
|
||||||
|
Dim sName As String = String.Empty
|
||||||
|
While nId <> GDB_ID.NULL
|
||||||
|
sName = String.Empty
|
||||||
|
EgtGetName(nId, sName)
|
||||||
|
If sName = NAME_KERF Then
|
||||||
|
' la sottoentità del Kerf selezionato
|
||||||
|
EgtUnProjectPoint(e.Location, ptPrev)
|
||||||
|
Dim dDist, dU As Double
|
||||||
|
EgtPointCurveDist(ptPrev.Loc(nKerfId), nKerfId, nKerfId, dDist, dU)
|
||||||
|
Dim ptStart As New Point3d
|
||||||
|
EgtAtParamPoint(nKerfId, CInt(Math.Floor(dU)), GDB_ID.ROOT, ptStart)
|
||||||
|
Dim ptEnd As New Point3d
|
||||||
|
EgtAtParamPoint(nKerfId, CInt(Math.Ceiling(dU)), GDB_ID.ROOT, ptEnd)
|
||||||
|
Dim nParentLineGuide As Integer = EgtCreateGroup(GDB_ID.ROOT)
|
||||||
|
' creo la linea a partire dall'entita sopra
|
||||||
|
m_LineDir = EgtCreateLine(EgtCreateGroup(nParentLineGuide), ptStart, ptEnd, GDB_RT.GLOB)
|
||||||
|
m_ptMidLineDir = New Point3d(ptStart)
|
||||||
|
EgtMidPoint(m_LineDir, GDB_RT.GLOB, m_ptMidLineDir)
|
||||||
|
EgtExtendCurveStartByLen(m_LineDir, 3500)
|
||||||
|
EgtSetMark(m_LineDir)
|
||||||
|
EgtDraw()
|
||||||
|
m_bGuide = True
|
||||||
|
If MyCreateFrame(nParentLineGuide) Then SelRawSideBtn.IsChecked = False
|
||||||
|
' Privilegio il kerf, pertanto esco
|
||||||
|
Exit While
|
||||||
|
End If
|
||||||
|
nId = EgtGetNextObjInSelWin()
|
||||||
|
End While
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
|
||||||
|
' Verifico se selezionato indicativo di pezzo
|
||||||
|
EgtSetObjFilterForSelWin(False, True, True, False, False)
|
||||||
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel)
|
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel)
|
||||||
Dim nId As Integer = EgtGetFirstObjInSelWin()
|
nId = EgtGetFirstObjInSelWin()
|
||||||
|
|
||||||
While nId <> GDB_ID.NULL
|
While nId <> GDB_ID.NULL
|
||||||
' Recupero l'identificativo del layer e del pezzo cui appartiene
|
' Recupero l'identificativo del layer e del pezzo cui appartiene
|
||||||
Dim nLayId As Integer = EgtGetParent(nId)
|
Dim nLayId As Integer = EgtGetParent(nId)
|
||||||
@@ -374,14 +440,14 @@ Public Class FrameCutPageUC
|
|||||||
' Cerco pezzo in grezzo
|
' Cerco pezzo in grezzo
|
||||||
Dim nPartId As Integer = EgtGetFirstPartInRawPart(m_nRawId)
|
Dim nPartId As Integer = EgtGetFirstPartInRawPart(m_nRawId)
|
||||||
' Se modalità curva e presa solo sezione, cancello unico pezzo in grezzo
|
' Se modalità curva e presa solo sezione, cancello unico pezzo in grezzo
|
||||||
If m_CurrAx = 3 And EgtGetFirstNameInGroup( nPartId, NAME_GUIDE) = GDB_ID.NULL
|
If m_CurrAx = 3 And EgtGetFirstNameInGroup(nPartId, NAME_GUIDE) = GDB_ID.NULL Then
|
||||||
If EgtRemovePartFromRawPart(nPartId) Then
|
If EgtRemovePartFromRawPart(nPartId) Then
|
||||||
' Rimuovo le lavorazioni
|
' Rimuovo le lavorazioni
|
||||||
EraseMachinings(nPartId)
|
EraseMachinings(nPartId)
|
||||||
' Cancello
|
' Cancello
|
||||||
EgtErase(nPartId)
|
EgtErase(nPartId)
|
||||||
End If
|
End If
|
||||||
' Altrimenti esco subito
|
' Altrimenti esco subito
|
||||||
Else
|
Else
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
@@ -478,14 +544,14 @@ Public Class FrameCutPageUC
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Function CreateFrame(nPartId As Integer) As Boolean
|
Friend Function CreateFrame(nPartId As Integer) As Boolean
|
||||||
If Not MyCreateFrame( nPartId) Then
|
If Not MyCreateFrame(nPartId) Then
|
||||||
EgtErase( nPartId)
|
EgtErase(nPartId)
|
||||||
If m_CurrAx <> 2 Then
|
If m_CurrAx <> 2 Then
|
||||||
' Errore : creazione cornice non riuscita
|
' Errore : creazione cornice non riuscita
|
||||||
m_CurrProjPage.SetErrorMessage( EgtMsg(MSG_FRAMECUTPAGEUC + 20))
|
m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_FRAMECUTPAGEUC + 20))
|
||||||
Else
|
Else
|
||||||
' Errore : raggio più piccolo della larghezza della sezione
|
' Errore : raggio più piccolo della larghezza della sezione
|
||||||
m_CurrProjPage.SetErrorMessage( EgtMsg(MSG_FRAMECUTPAGEUC + 19))
|
m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_FRAMECUTPAGEUC + 19))
|
||||||
End If
|
End If
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
@@ -501,12 +567,12 @@ Public Class FrameCutPageUC
|
|||||||
' Sistemo la sezione o la guida della cornice
|
' Sistemo la sezione o la guida della cornice
|
||||||
If Not m_bGuide Then
|
If Not m_bGuide Then
|
||||||
If Not AdjustSection(nPartId) Then
|
If Not AdjustSection(nPartId) Then
|
||||||
EgtOutLog( "Error in CreateFrame : problems with Section")
|
EgtOutLog("Error in CreateFrame : problems with Section")
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
If Not AdjustGuide(nPartId) Then
|
If Not AdjustGuide(nPartId) Then
|
||||||
EgtOutLog( "Error in CreateFrame : problems with Guide")
|
EgtOutLog("Error in CreateFrame : problems with Guide")
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -518,48 +584,49 @@ Public Class FrameCutPageUC
|
|||||||
Dim nSectId As Integer = EgtGetFirstInGroup(nSectLayId)
|
Dim nSectId As Integer = EgtGetFirstInGroup(nSectLayId)
|
||||||
If nSectId = GDB_ID.NULL Then Return False
|
If nSectId = GDB_ID.NULL Then Return False
|
||||||
' Creazione cornice
|
' Creazione cornice
|
||||||
nSurfId = CreateLineFrame( nSectId, nSectLayId, nPartId)
|
nSurfId = CreateLineFrame(nSectId, nSectLayId, nPartId)
|
||||||
' Se non creata superficie, reset di tutto e segnalazione errore
|
' Se non creata superficie, reset di tutto e segnalazione errore
|
||||||
If nSurfId = GDB_ID.NULL Then
|
If nSurfId = GDB_ID.NULL Then
|
||||||
EgtErase( nPartId)
|
EgtErase(nPartId)
|
||||||
EgtOutLog( "Error in CreateFrame : Surface not constructible")
|
EgtOutLog("Error in CreateFrame : Surface not constructible")
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
' se cornice su arco
|
' se cornice su arco
|
||||||
ElseIf m_CurrAx = 2 Then
|
ElseIf m_CurrAx = 2 Then
|
||||||
' Recupero layer e curva della sezione
|
' Recupero layer e curva della sezione
|
||||||
Dim nSectLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_SECT)
|
Dim nSectLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_SECT)
|
||||||
Dim nSectId As Integer = EgtGetFirstInGroup(nSectLayId)
|
Dim nSectId As Integer = EgtGetFirstInGroup(nSectLayId)
|
||||||
If nSectId = GDB_ID.NULL Then Return False
|
If nSectId = GDB_ID.NULL Then Return False
|
||||||
' Porto l'inizio della curva a X0 locale
|
' Porto l'inizio della curva a X0 locale
|
||||||
ChangeCurveStartToX0( nSectId)
|
ChangeCurveStartToX0(nSectId)
|
||||||
' Creazione cornice
|
' Creazione cornice
|
||||||
nSurfId = CreateArcFrame( nSectId, nSectLayId, nPartId)
|
nSurfId = CreateArcFrame(nSectId, nSectLayId, nPartId)
|
||||||
' Se non creata superficie, reset di tutto e segnalazione errore
|
' Se non creata superficie, reset di tutto e segnalazione errore
|
||||||
If nSurfId = GDB_ID.NULL Then
|
If nSurfId = GDB_ID.NULL Then
|
||||||
EgtErase( nPartId)
|
EgtErase(nPartId)
|
||||||
EgtOutLog( "Error in CreateFrame : radius too small for the section")
|
EgtOutLog("Error in CreateFrame : radius too small for the section")
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
' altrimenti cornice su guida
|
' altrimenti cornice su guida
|
||||||
Else
|
Else
|
||||||
If not m_bGuide Then
|
If Not m_bGuide Then
|
||||||
' Recupero layer e curva della sezione
|
' Recupero layer e curva della sezione
|
||||||
Dim nSectLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_SECT)
|
Dim nSectLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_SECT)
|
||||||
Dim nSectId As Integer = EgtGetFirstInGroup(nSectLayId)
|
Dim nSectId As Integer = EgtGetFirstInGroup(nSectLayId)
|
||||||
If nSectId = GDB_ID.NULL Then Return False
|
If nSectId = GDB_ID.NULL Then Return False
|
||||||
' Porto l'inizio della curva a X0 locale
|
' Porto l'inizio della curva a X0 locale
|
||||||
ChangeCurveStartToX0( nSectId)
|
ChangeCurveStartToX0(nSectId)
|
||||||
Else
|
Else
|
||||||
' Porto la guida nel pezzo con la sezione
|
' Porto la guida nel pezzo con la sezione
|
||||||
Dim nTruePartId As Integer = EgtGetFirstPartInRawPart( m_nRawId)
|
Dim nTruePartId As Integer = EgtGetFirstPartInRawPart(m_nRawId)
|
||||||
|
|
||||||
If nTruePartId = GDB_ID.NULL Then
|
If nTruePartId = GDB_ID.NULL Then
|
||||||
EgtOutLog( "Error in CreateFrame : Section not found")
|
EgtOutLog("Error in CreateFrame : Section not found")
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
' Parcheggio il pezzo trovato
|
' Parcheggio il pezzo trovato
|
||||||
m_MainWindow.m_CadCutPageUC.m_NestPage.CalcRawPart()
|
m_MainWindow.m_CadCutPageUC.m_NestPage.CalcRawPart()
|
||||||
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePart( nTruePartId)
|
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePart(nTruePartId)
|
||||||
' Recupero layer e curva della sezione
|
' Recupero layer e curva della sezione
|
||||||
Dim nSectLayId As Integer = EgtGetFirstNameInGroup(nTruePartId, NAME_SECT)
|
Dim nSectLayId As Integer = EgtGetFirstNameInGroup(nTruePartId, NAME_SECT)
|
||||||
Dim nSectId As Integer = EgtGetFirstInGroup(nSectLayId)
|
Dim nSectId As Integer = EgtGetFirstInGroup(nSectLayId)
|
||||||
@@ -569,17 +636,17 @@ Public Class FrameCutPageUC
|
|||||||
Dim nGuideId As Integer = EgtGetFirstInGroup(nGuideLayId)
|
Dim nGuideId As Integer = EgtGetFirstInGroup(nGuideLayId)
|
||||||
If nGuideId = GDB_ID.NULL Then Return False
|
If nGuideId = GDB_ID.NULL Then Return False
|
||||||
' Sposto la guida in questo pezzo
|
' Sposto la guida in questo pezzo
|
||||||
EgtRelocate( nGuideLayId, nTruePartId)
|
EgtRelocate(nGuideLayId, nTruePartId)
|
||||||
' Cancello il pezzo
|
' Cancello il pezzo
|
||||||
EgtErase( nPartId)
|
EgtErase(nPartId)
|
||||||
' Creazione cornice
|
' Creazione cornice
|
||||||
nPartId = nTruePartId
|
nPartId = nTruePartId
|
||||||
nSurfId = CreateCurveFrame( nSectId, nSectLayId, nGuideId, nGuideLayId, nPartId)
|
nSurfId = CreateCurveFrame(nSectId, nSectLayId, nGuideId, nGuideLayId, nPartId)
|
||||||
m_bGuide = False
|
m_bGuide = False
|
||||||
' Se non creata superficie, reset di tutto e segnalazione errore
|
' Se non creata superficie, reset di tutto e segnalazione errore
|
||||||
If nSurfId = GDB_ID.NULL Then
|
If nSurfId = GDB_ID.NULL Then
|
||||||
EgtErase( nPartId)
|
EgtErase(nPartId)
|
||||||
EgtOutLog( "Error in CreateFrame : Surface not constructible")
|
EgtOutLog("Error in CreateFrame : Surface not constructible")
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -623,17 +690,17 @@ Public Class FrameCutPageUC
|
|||||||
Dim nSurfId As Integer = GDB_ID.NULL
|
Dim nSurfId As Integer = GDB_ID.NULL
|
||||||
' Se cornice rettilinea
|
' Se cornice rettilinea
|
||||||
If m_CurrAx = 0 Or m_CurrAx = 1 Then
|
If m_CurrAx = 0 Or m_CurrAx = 1 Then
|
||||||
nSurfId = CreateLineFrame( nSectId, nSectLayId, nPartId)
|
nSurfId = CreateLineFrame(nSectId, nSectLayId, nPartId)
|
||||||
' se cornice su arco
|
' se cornice su arco
|
||||||
ElseIf m_CurrAx = 2 Then
|
ElseIf m_CurrAx = 2 Then
|
||||||
nSurfId = CreateArcFrame( nSectId, nSectLayId, nPartId)
|
nSurfId = CreateArcFrame(nSectId, nSectLayId, nPartId)
|
||||||
' altrimenti cornice su curva
|
' altrimenti cornice su curva
|
||||||
Else
|
Else
|
||||||
' Recupero layer e curva della guida
|
' Recupero layer e curva della guida
|
||||||
Dim nGuideLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_GUIDE)
|
Dim nGuideLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_GUIDE)
|
||||||
Dim nGuideId As Integer = EgtGetFirstInGroup(nGuideLayId)
|
Dim nGuideId As Integer = EgtGetFirstInGroup(nGuideLayId)
|
||||||
If nGuideId = GDB_ID.NULL Then Return False
|
If nGuideId = GDB_ID.NULL Then Return False
|
||||||
nSurfId = CreateCurveFrame( nSectId, nSectLayId, nGuideId, nGuideLayId, nPartId)
|
nSurfId = CreateCurveFrame(nSectId, nSectLayId, nGuideId, nGuideLayId, nPartId)
|
||||||
End If
|
End If
|
||||||
' Assegno nome e direzione a pezzo
|
' Assegno nome e direzione a pezzo
|
||||||
EgtSetName(nPartId, NAME_FRAME)
|
EgtSetName(nPartId, NAME_FRAME)
|
||||||
@@ -699,7 +766,7 @@ Public Class FrameCutPageUC
|
|||||||
ptStart = ptTmp
|
ptStart = ptTmp
|
||||||
End If
|
End If
|
||||||
' Se cornice rettilinea
|
' Se cornice rettilinea
|
||||||
If m_CurrAx = 0 Or m_CurrAx = 1 Then
|
If m_CurrAx = 0 Or m_CurrAx = 1 Then
|
||||||
' Se linea orizzontale, aggiungo tratti verticali
|
' Se linea orizzontale, aggiungo tratti verticali
|
||||||
If b3Box.DimY() < EPS_SMALL Then
|
If b3Box.DimY() < EPS_SMALL Then
|
||||||
ptStart -= 10 * EPS_SMALL * Vector3d.Y_AX()
|
ptStart -= 10 * EPS_SMALL * Vector3d.Y_AX()
|
||||||
@@ -740,7 +807,7 @@ Public Class FrameCutPageUC
|
|||||||
EgtAddCurveCompoLine(nCrvId, ptEnd)
|
EgtAddCurveCompoLine(nCrvId, ptEnd)
|
||||||
b3Box.Add(ptEnd)
|
b3Box.Add(ptEnd)
|
||||||
End If
|
End If
|
||||||
' Altrimenti cornice curva
|
' Altrimenti cornice curva
|
||||||
Else
|
Else
|
||||||
' Aggiungo linea verticale dall'estremo più alto alla quota del più basso
|
' Aggiungo linea verticale dall'estremo più alto alla quota del più basso
|
||||||
If ptStart.y > ptEnd.y Then
|
If ptStart.y > ptEnd.y Then
|
||||||
@@ -767,7 +834,15 @@ Public Class FrameCutPageUC
|
|||||||
EgtSelectLayerObjs(nLayerId)
|
EgtSelectLayerObjs(nLayerId)
|
||||||
Dim nCrvIds(0) As Integer
|
Dim nCrvIds(0) As Integer
|
||||||
nCrvIds(0) = GDB_ID.SEL
|
nCrvIds(0) = GDB_ID.SEL
|
||||||
Dim nCrvId As Integer = EgtCreateCurveCompoByChain(nLayerId, 1, nCrvIds, New Point3d(), True)
|
' ---- INIZIO ---- NUOVA GESTIONE ---- Verifico che il segmento passato è una linea ricavata dal contorno del grezzo
|
||||||
|
Dim nCrvId As Integer = GDB_ID.NULL
|
||||||
|
If m_CurrAx = 4 And m_LineDir <> GDB_ID.NULL Then
|
||||||
|
nCrvId = m_LineDir
|
||||||
|
Else
|
||||||
|
nCrvId = EgtCreateCurveCompoByChain(nLayerId, 1, nCrvIds, New Point3d(), True)
|
||||||
|
End If
|
||||||
|
' ---- FINE ---- NUOVA GESTIONE ----
|
||||||
|
' Se non è stata creata esco
|
||||||
If nCrvId = GDB_ID.NULL Then Return False
|
If nCrvId = GDB_ID.NULL Then Return False
|
||||||
' Elimino eventuali curve oltre la prima
|
' Elimino eventuali curve oltre la prima
|
||||||
Dim nId As Integer = EgtGetNext(nCrvId)
|
Dim nId As Integer = EgtGetNext(nCrvId)
|
||||||
@@ -792,17 +867,17 @@ Public Class FrameCutPageUC
|
|||||||
' Elimino vecchio layer
|
' Elimino vecchio layer
|
||||||
EgtErase(nLayerId)
|
EgtErase(nLayerId)
|
||||||
' Impongo rotazione guida CCW
|
' Impongo rotazione guida CCW
|
||||||
Dim bClosed As Boolean = EgtCurveIsClosed( nCrvId)
|
Dim bClosed As Boolean = EgtCurveIsClosed(nCrvId)
|
||||||
If Not bClosed Then EgtCloseCurveCompo( nCrvId)
|
If Not bClosed Then EgtCloseCurveCompo(nCrvId)
|
||||||
Dim dArea As Double = 0
|
Dim dArea As Double = 0
|
||||||
EgtCurveAreaXY( nCrvId, dArea)
|
EgtCurveAreaXY(nCrvId, dArea)
|
||||||
If Not bClosed Then EgtRemoveCurveCompoCurve( nCrvId)
|
If Not bClosed Then EgtRemoveCurveCompoCurve(nCrvId)
|
||||||
If dArea < -1 Then EgtInvertCurve( nCrvId)
|
If dArea < -1 Then EgtInvertCurve(nCrvId)
|
||||||
' Se curva chiusa, impongo inizio a metà del lato a X max
|
' Se curva chiusa, impongo inizio a metà del lato a X max
|
||||||
If bClosed Then
|
If bClosed Then
|
||||||
Dim b3Guide As New BBox3d
|
Dim b3Guide As New BBox3d
|
||||||
EgtGetBBox( nCrvId, GDB_BB.STANDARD, b3Guide)
|
EgtGetBBox(nCrvId, GDB_BB.STANDARD, b3Guide)
|
||||||
Dim ptStart As New Point3d( b3Guide.Max().x, b3Guide.Center().y, b3Guide.Center().z)
|
Dim ptStart As New Point3d(b3Guide.Max().x, b3Guide.Center().y, b3Guide.Center().z)
|
||||||
EgtChangeClosedCurveStartPoint(nCrvId, ptStart)
|
EgtChangeClosedCurveStartPoint(nCrvId, ptStart)
|
||||||
End If
|
End If
|
||||||
Return True
|
Return True
|
||||||
@@ -828,7 +903,7 @@ Public Class FrameCutPageUC
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function CreateLineFrame( nSectId As Integer, nSectLayId As Integer, nPartId As Integer) As Integer
|
Private Function CreateLineFrame(nSectId As Integer, nSectLayId As Integer, nPartId As Integer) As Integer
|
||||||
' Porto la sezione nel piano opportuno e calcolo il vettore di estrusione
|
' Porto la sezione nel piano opportuno e calcolo il vettore di estrusione
|
||||||
Dim vtExtr As Vector3d
|
Dim vtExtr As Vector3d
|
||||||
If m_CurrAx = 0 Then
|
If m_CurrAx = 0 Then
|
||||||
@@ -869,7 +944,7 @@ Public Class FrameCutPageUC
|
|||||||
Return nSurfId
|
Return nSurfId
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function CreateArcFrame( nSectId As Integer, nSectLayId As Integer, nPartId As Integer) As Integer
|
Private Function CreateArcFrame(nSectId As Integer, nSectLayId As Integer, nPartId As Integer) As Integer
|
||||||
' Recupero ingombro locale della sezione
|
' Recupero ingombro locale della sezione
|
||||||
Dim b3Sect As New BBox3d
|
Dim b3Sect As New BBox3d
|
||||||
EgtGetBBox(nSectId, GDB_BB.STANDARD, b3Sect)
|
EgtGetBBox(nSectId, GDB_BB.STANDARD, b3Sect)
|
||||||
@@ -912,22 +987,22 @@ Public Class FrameCutPageUC
|
|||||||
' Creo la superficie swept
|
' Creo la superficie swept
|
||||||
Dim dSectRotDeg As Double = 90 + dAngIniDeg
|
Dim dSectRotDeg As Double = 90 + dAngIniDeg
|
||||||
EgtRotate(nSectLayId, ptStart, Vector3d.Z_AX(), dSectRotDeg, GDB_RT.LOC)
|
EgtRotate(nSectLayId, ptStart, Vector3d.Z_AX(), dSectRotDeg, GDB_RT.LOC)
|
||||||
Dim nSurfId As Integer = EgtCreateSurfTmSwept( nSurfLayId, nSectId, nGuideId, True, EPS_STM)
|
Dim nSurfId As Integer = EgtCreateSurfTmSwept(nSurfLayId, nSectId, nGuideId, True, EPS_STM)
|
||||||
Return nSurfId
|
Return nSurfId
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function CreateCurveFrame( nSectId As Integer, nSectLayId As Integer, nGuideId As Integer, nGuideLayId As Integer, nPartId As Integer) As Integer
|
Private Function CreateCurveFrame(nSectId As Integer, nSectLayId As Integer, nGuideId As Integer, nGuideLayId As Integer, nPartId As Integer) As Integer
|
||||||
' Recupero flag lavorazione da lato opposto
|
' Recupero flag lavorazione da lato opposto
|
||||||
Dim bOthSide As Boolean = False
|
Dim bOthSide As Boolean = False
|
||||||
EgtGetInfo( nPartId, INFO_FRAME_OTHSIDE, bOthSide)
|
EgtGetInfo(nPartId, INFO_FRAME_OTHSIDE, bOthSide)
|
||||||
' Recupero dati inizio guida
|
' Recupero dati inizio guida
|
||||||
Dim ptStart As Point3d
|
Dim ptStart As Point3d
|
||||||
EgtStartPoint(nGuideId, nPartId, ptStart)
|
EgtStartPoint(nGuideId, nPartId, ptStart)
|
||||||
Dim vtStart As Vector3d
|
Dim vtStart As Vector3d
|
||||||
EgtStartVector(nGuideId, nPartId, vtStart)
|
EgtStartVector(nGuideId, nPartId, vtStart)
|
||||||
' Creo riferimento per sezione
|
' Creo riferimento per sezione
|
||||||
dim frSect As New Frame3d
|
Dim frSect As New Frame3d
|
||||||
frSect.Setup( ptStart, -vtStart)
|
frSect.Setup(ptStart, -vtStart)
|
||||||
' Porto la sezione in questo riferimento
|
' Porto la sezione in questo riferimento
|
||||||
EgtChangeGroupFrame(nSectLayId, frSect)
|
EgtChangeGroupFrame(nSectLayId, frSect)
|
||||||
' Recupero ingombro locale della sezione
|
' Recupero ingombro locale della sezione
|
||||||
@@ -935,16 +1010,16 @@ Public Class FrameCutPageUC
|
|||||||
EgtGetBBox(nSectId, GDB_BB.STANDARD, b3Sect)
|
EgtGetBBox(nSectId, GDB_BB.STANDARD, b3Sect)
|
||||||
' Recupero ingombro locale della guida
|
' Recupero ingombro locale della guida
|
||||||
Dim b3Guide As New BBox3d
|
Dim b3Guide As New BBox3d
|
||||||
EgtGetBBox( nGuideId, GDB_BB.STANDARD, b3Guide)
|
EgtGetBBox(nGuideId, GDB_BB.STANDARD, b3Guide)
|
||||||
b3Guide.ToLoc( frSect)
|
b3Guide.ToLoc(frSect)
|
||||||
' Muovo sezione dalla parte interna della curva
|
' Muovo sezione dalla parte interna della curva
|
||||||
If ( Not bOthSide And Math.Abs( b3Guide.Min().x) > Math.Abs( b3Guide.Max().x)) OrElse
|
If (Not bOthSide And Math.Abs(b3Guide.Min().x) > Math.Abs(b3Guide.Max().x)) OrElse
|
||||||
( bOthSide And Math.Abs( b3Guide.Min().x) <= Math.Abs( b3Guide.Max().x)) Then
|
(bOthSide And Math.Abs(b3Guide.Min().x) <= Math.Abs(b3Guide.Max().x)) Then
|
||||||
Dim vtMove As New Vector3d( - b3Sect.Max().x, -b3Sect.Min().y, 0)
|
Dim vtMove As New Vector3d(-b3Sect.Max().x, -b3Sect.Min().y, 0)
|
||||||
EgtMove( nSectId, vtMove)
|
EgtMove(nSectId, vtMove)
|
||||||
Else
|
Else
|
||||||
Dim vtMove As New Vector3d( - b3Sect.Min().x, -b3Sect.Min().y, 0)
|
Dim vtMove As New Vector3d(-b3Sect.Min().x, -b3Sect.Min().y, 0)
|
||||||
EgtMove( nSectId, vtMove)
|
EgtMove(nSectId, vtMove)
|
||||||
End If
|
End If
|
||||||
' Recupero o creo layer per la superficie
|
' Recupero o creo layer per la superficie
|
||||||
Dim nSurfLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_SURF)
|
Dim nSurfLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_SURF)
|
||||||
@@ -956,25 +1031,12 @@ Public Class FrameCutPageUC
|
|||||||
End If
|
End If
|
||||||
EgtSetColor(nSurfLayId, COL_FRAME())
|
EgtSetColor(nSurfLayId, COL_FRAME())
|
||||||
' Creo la superficie swept
|
' Creo la superficie swept
|
||||||
Dim nSurfId As Integer = EgtCreateSurfTmSwept( nSurfLayId, nSectId, nGuideId, True, EPS_STM)
|
Dim nSurfId As Integer = EgtCreateSurfTmSwept(nSurfLayId, nSectId, nGuideId, True, EPS_STM)
|
||||||
Return nSurfId
|
Return nSurfId
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function InsertPartInRawPart(nPartId As Integer) As Boolean
|
Private Function InsertPartInRawPart(nPartId As Integer) As Boolean
|
||||||
' Determino ingombro del pezzo
|
' Determino distanza (interasse cornici) da spessore lama oppure offset
|
||||||
Dim PartBox As New BBox3d
|
|
||||||
EgtGetBBoxGlob(nPartId, GDB_BB.EXACT + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM, PartBox)
|
|
||||||
' Determino ingombro di eventuali pezzi già presenti
|
|
||||||
Dim OtherBox As New BBox3d
|
|
||||||
Dim nId2 As Integer = EgtGetFirstPartInRawPart(m_nRawId)
|
|
||||||
While nId2 <> GDB_ID.NULL
|
|
||||||
Dim TmpBox As New BBox3d
|
|
||||||
If EgtGetBBoxGlob(nId2, GDB_BB.EXACT + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM, TmpBox) Then
|
|
||||||
OtherBox.Add(TmpBox)
|
|
||||||
End If
|
|
||||||
nId2 = EgtGetNextPartInRawPart(nId2)
|
|
||||||
End While
|
|
||||||
' Determino distanza da spessore lama
|
|
||||||
Dim dMinDist As Double = 0
|
Dim dMinDist As Double = 0
|
||||||
Dim dSawThick As Double = 0
|
Dim dSawThick As Double = 0
|
||||||
Dim dOffsXIntery As Double = 0
|
Dim dOffsXIntery As Double = 0
|
||||||
@@ -991,16 +1053,36 @@ Public Class FrameCutPageUC
|
|||||||
Else
|
Else
|
||||||
dMinDist = dSawThick + 5 * EPS_SMALL
|
dMinDist = dSawThick + 5 * EPS_SMALL
|
||||||
End If
|
End If
|
||||||
'If dOffsXIntery <= dSawThick Then
|
|
||||||
' dMinDist = dSawThick + 5 * EPS_SMALL
|
|
||||||
' EgtOutLog("WARNINGS: Saw tickness is more width then interaxis")
|
|
||||||
'Else
|
|
||||||
' dMinDist = dOffsXIntery + 5 * EPS_SMALL
|
|
||||||
'End If
|
|
||||||
Else
|
Else
|
||||||
EgtOutLog("Not found current saw for frames mindist")
|
EgtOutLog("Not found current saw for frames mindist")
|
||||||
dMinDist = dOffsXIntery
|
dMinDist = dOffsXIntery
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If m_CurrAx = 4 Then
|
||||||
|
Dim nCountFrame As Integer = 0
|
||||||
|
Dim nIdOtherFrame As Integer = EgtGetFirstPartInRawPart(m_nRawId)
|
||||||
|
While nIdOtherFrame <> GDB_ID.NULL
|
||||||
|
nCountFrame += 1
|
||||||
|
nIdOtherFrame = EgtGetNextPartInRawPart(nIdOtherFrame)
|
||||||
|
End While
|
||||||
|
EgtAddPartToRawPart(nPartId, New Point3d(0, 0, 0), EgtGetFirstRawPart())
|
||||||
|
Return AdjustPartInGenericRawPart(nCountFrame, dMinDist)
|
||||||
|
End If
|
||||||
|
|
||||||
|
' Determino ingombro del pezzo
|
||||||
|
Dim PartBox As New BBox3d
|
||||||
|
EgtGetBBoxGlob(nPartId, GDB_BB.EXACT + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM, PartBox)
|
||||||
|
' Determino ingombro di eventuali pezzi già presenti
|
||||||
|
Dim OtherBox As New BBox3d
|
||||||
|
Dim nId2 As Integer = EgtGetFirstPartInRawPart(m_nRawId)
|
||||||
|
While nId2 <> GDB_ID.NULL
|
||||||
|
Dim TmpBox As New BBox3d
|
||||||
|
If EgtGetBBoxGlob(nId2, GDB_BB.EXACT + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM, TmpBox) Then
|
||||||
|
OtherBox.Add(TmpBox)
|
||||||
|
End If
|
||||||
|
nId2 = EgtGetNextPartInRawPart(nId2)
|
||||||
|
End While
|
||||||
|
|
||||||
' Inserisco il pezzo nel grezzo
|
' Inserisco il pezzo nel grezzo
|
||||||
Dim ptIns As Point3d
|
Dim ptIns As Point3d
|
||||||
If OtherBox.IsEmpty() Then
|
If OtherBox.IsEmpty() Then
|
||||||
@@ -1027,11 +1109,95 @@ Public Class FrameCutPageUC
|
|||||||
ptIns.y = m_dKerf
|
ptIns.y = m_dKerf
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim dOffsZ As Double = 0
|
Dim dOffsZ As Double = 0
|
||||||
StringToLen(OffsZTxBx.Text, dOffsZ)
|
StringToLen(OffsZTxBx.Text, dOffsZ)
|
||||||
ptIns.z = (m_RawBox.Max().z - m_RawBox.Min().z) - (PartBox.Max().z - PartBox.Min().z) - dOffsZ
|
ptIns.z = (m_RawBox.Max().z - m_RawBox.Min().z) - (PartBox.Max().z - PartBox.Min().z) - dOffsZ
|
||||||
ptIns.z = Math.Max(ptIns.z, 0)
|
ptIns.z = Math.Max(ptIns.z, 0)
|
||||||
Return EgtAddPartToRawPart(nPartId, ptIns, EgtGetFirstRawPart())
|
Return EgtAddPartToRawPart(nPartId, ptIns, EgtGetFirstRawPart())
|
||||||
|
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function AdjustPartInGenericRawPart(Optional nCountOtherFrame As Integer = 0, Optional dMinDist As Double = 0) As Boolean
|
||||||
|
' --- Eseguo una traslazione per portare il FRAME sul punto iniziale della guida (NON NEL PUNTO MINIMO DEL BOX!) ---
|
||||||
|
Dim nTruePartId As Integer = EgtGetFirstPartInRawPart(m_nRawId)
|
||||||
|
|
||||||
|
' Recupero layer e curva della guida
|
||||||
|
Dim nGuideLayId As Integer = EgtGetFirstNameInGroup(nTruePartId, NAME_GUIDE)
|
||||||
|
If nGuideLayId = GDB_ID.NULL Then Return True
|
||||||
|
Dim nGuideId As Integer = EgtGetFirstInGroup(nGuideLayId)
|
||||||
|
' Recupero il layer e il contorno della sezione
|
||||||
|
Dim nSectLayId As Integer = EgtGetFirstNameInGroup(nTruePartId, NAME_SECT)
|
||||||
|
Dim nSectId As Integer = EgtGetFirstInGroup(nSectLayId)
|
||||||
|
|
||||||
|
' Aggiusto la poszione del pezzo: punto medio della guida sul punto medio del lato selezionato
|
||||||
|
Dim ptMid As Point3d
|
||||||
|
EgtMidPoint(nGuideId, GDB_RT.GLOB, ptMid)
|
||||||
|
Dim vtTrasl As Vector3d = m_ptMidLineDir - ptMid
|
||||||
|
vtTrasl.z = 0
|
||||||
|
EgtMove(nTruePartId, vtTrasl)
|
||||||
|
|
||||||
|
' Porto il pezzo dentro al grezzo
|
||||||
|
Dim vtPerp As New Vector3d
|
||||||
|
EgtStartVector(nGuideId, GDB_RT.GLOB, vtPerp)
|
||||||
|
vtPerp.Rotate(Vector3d.Z_AX, 90)
|
||||||
|
' Definisco il frame su cui iniziare a lavorare
|
||||||
|
Dim ptS As New Point3d
|
||||||
|
EgtStartPoint(nGuideId, GDB_RT.GLOB, ptS)
|
||||||
|
Dim vtDir As New Vector3d
|
||||||
|
EgtStartVector(nGuideId, GDB_RT.GLOB, vtDir)
|
||||||
|
Dim frSect As New Frame3d(ptS, vtDir, vtPerp, Vector3d.Z_AX)
|
||||||
|
' Costruisco il BBox nel riferimento indicato
|
||||||
|
Dim BBoxRef As New BBox3d
|
||||||
|
EgtGetBBoxRef(nTruePartId, GDB_BB.EXACT + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM, frSect, BBoxRef)
|
||||||
|
' Nella grafica i nomi dei parametri di offset devono diventare "Perp" e "Orto" oppure un solo parametro "Orto"?
|
||||||
|
Dim dOffsXy As Double = 0
|
||||||
|
StringToLen(OffsXyTxBx.Text, dOffsXy)
|
||||||
|
dOffsXy = (dOffsXy + BBoxRef.DimY) + (dMinDist + BBoxRef.DimY) * nCountOtherFrame
|
||||||
|
EgtMove(nTruePartId, vtPerp * dOffsXy)
|
||||||
|
|
||||||
|
' Ritaglio il volume del pezzo per occupare il grezzo
|
||||||
|
Dim nSurfLayId As Integer = EgtGetFirstNameInGroup(nTruePartId, "Surf")
|
||||||
|
Dim nSurfId As Integer = EgtGetFirstInGroup(nSurfLayId)
|
||||||
|
' Recupero una copia del grezzo
|
||||||
|
Dim nCopyRawId As Integer = EgtCopyGlob(EgtGetFirstNameInGroup(m_nRawId, "RawSolid"), nSurfLayId)
|
||||||
|
EgtSetName(nCopyRawId, "SurfTrimmed")
|
||||||
|
EgtSurfTmIntersect(nCopyRawId, nSurfId)
|
||||||
|
' Assegno colori e trasparenza
|
||||||
|
EgtSetColor(nCopyRawId, COL_FRAME)
|
||||||
|
EgtSetAlpha(nCopyRawId, 100)
|
||||||
|
EgtErase(nSurfId)
|
||||||
|
|
||||||
|
|
||||||
|
' Recupero il box in coordinate locali dell'ingombro del pezzo
|
||||||
|
Dim ptSlast As New Point3d
|
||||||
|
EgtStartPoint(nGuideId, GDB_RT.GLOB, ptSlast)
|
||||||
|
Dim frSectLast As New Frame3d(ptSlast, vtDir, vtPerp, Vector3d.Z_AX)
|
||||||
|
Dim BBoxRefLast As New BBox3d
|
||||||
|
EgtGetBBoxRef(nCopyRawId, GDB_BB.EXACT + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM, frSect, BBoxRefLast)
|
||||||
|
|
||||||
|
' Ricalcolo la lunghezza della guida
|
||||||
|
Dim dLenGUide As Double = 0
|
||||||
|
EgtCurveLength(nGuideId, dLenGUide)
|
||||||
|
Dim pt1 As New Point3d
|
||||||
|
EgtStartPoint(nGuideId, GDB_RT.GLOB, pt1)
|
||||||
|
EgtTrimExtendCurveByLen(nGuideId, -BBoxRefLast.Min.x, pt1)
|
||||||
|
|
||||||
|
Dim pt2 As New Point3d
|
||||||
|
EgtEndPoint(nGuideId, GDB_RT.GLOB, pt2)
|
||||||
|
EgtTrimExtendCurveByLen(nGuideId, BBoxRefLast.Max.x - dLenGUide, pt2)
|
||||||
|
|
||||||
|
|
||||||
|
' riposizione l'origine della sezione
|
||||||
|
Dim pt3 As New Point3d
|
||||||
|
EgtStartPoint(nGuideId, GDB_RT.GLOB, pt3)
|
||||||
|
EgtMove(nSectId, New Vector3d(pt3 - pt1), GDB_RT.GLOB)
|
||||||
|
|
||||||
|
EgtDraw()
|
||||||
|
|
||||||
|
'EgtSaveFile("C:\EgtData\OmagCUT\Temp\BOB.nge", NGE.BIN)
|
||||||
|
|
||||||
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
+1
-1
@@ -26,7 +26,7 @@ Class MainWindow
|
|||||||
' Variabile che definisce l'avvio forzato in modalità FRAME
|
' Variabile che definisce l'avvio forzato in modalità FRAME
|
||||||
Friend m_OnlyFrame As Boolean = False
|
Friend m_OnlyFrame As Boolean = False
|
||||||
|
|
||||||
Public Shared m_bShowSVGParkInd As Boolean = False
|
Public Shared m_bShowSVGParkInd As Boolean = True
|
||||||
|
|
||||||
' Dichiarazione delle Page UserControl
|
' Dichiarazione delle Page UserControl
|
||||||
Friend m_WorkInProgressPageUC As WorkInProgressPageUC
|
Friend m_WorkInProgressPageUC As WorkInProgressPageUC
|
||||||
|
|||||||
Reference in New Issue
Block a user