Compare commits

..

12 Commits

Author SHA1 Message Date
Nicola Pievani 18966d103e Pulizia codice 2025-04-08 14:11:07 +02:00
Nicola Pievani 8a65942370 Creazione primo frame non parallelo agli assi 2025-04-08 12:18:12 +02:00
Nicola Pievani c55cbfa5bb Inizio gestione inserimento cornici (DA RIFARE) 2025-04-04 11:32:18 +02:00
Nicola Pievani 1557f0865c Merge commit 'e5e80e9a55ff8ea618bd0bc5149e626c3ac3ac7d' into develop 2025-04-03 12:16:45 +02:00
Nicola Pievani e5e80e9a55 Correzione/miglioramento gestione offset spostamento 2025-04-02 16:09:35 +02:00
Nicola Pievani c7828774d8 Inizio gestione Frame allineato con il grezzo 2025-04-01 12:04:43 +02:00
Nicola Pievani cd0388b970 Merge commit '135be5f104c891b92201b98e3855117851ed42d5' into develop 2025-03-26 11:26:41 +01:00
Nicola Pievani 135be5f104 Modifica lettura Feed per controllo FANUC 2025-03-24 19:14:54 +01:00
Nicola Pievani 2f116ba3fe Gestione più di un riferimento del grezzo 2025-03-24 15:01:43 +01:00
Nicola Pievani 96ee5b5172 Correzione gestione lama test 2025-03-19 18:32:45 +01:00
Nicola Pievani 484f7eb410 Merge branch 'develop' 2025-03-13 17:58:13 +01:00
Nicola Pievani c1eb839fe8 Nascondo le pareti dell'area sicura quando esco dal grezzo 2025-03-13 17:58:01 +01:00
12 changed files with 546 additions and 153 deletions
+6
View File
@@ -74,6 +74,12 @@ Public Class ChooseTestToolWD
End If
Select Case m_MainWindow.m_CurrentMachine.MountedToolConfig
Case CurrentMachine.MountedToolConfigs.SAW
sNameTool = m_MainWindow.m_CurrentMachine.sCurrSaw
If Not String.IsNullOrEmpty(sNameTool) Then
' Imposto la lama
m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool))
End If
Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL
sNameTool = m_MainWindow.m_CurrentMachine.sCurrSaw
If Not String.IsNullOrEmpty(sNameTool) Then
+9 -1
View File
@@ -133,9 +133,17 @@ Public Class MoveRawPartPage
EgtDraw()
' Carico i parametri di movimento
m_dStep = GetPrivateProfileDouble(S_RAWMOVE, K_RAWSTEP, 50, m_MainWindow.GetIniFile())
' Carico il valore ci
Dim ExtraStep As Double = GetPrivateProfileDouble(S_RAWMOVE, K_EXTRASTEP, 1, m_MainWindow.GetIniFile())
' Ricavo la lunghezza del baffo di taglio
m_dStep = SplitAuto.MaxCuttingMustache(m_dStep)
StepMoveTxBx.Text = LenToString(m_dStep, 1) & "+1"
If ExtraStep < EPS_SMALL Then
StepMoveTxBx.Text = LenToString(m_dStep, 1)
Else
StepMoveTxBx.Text = LenToString(m_dStep, 1) & "+" & LenToString(ExtraStep, 1)
' Aggiorno il valore sommando l'extra
m_dStep = m_dStep + ExtraStep
End If
m_dRotation = GetPrivateProfileDouble(S_RAWMOVE, K_RAWROTATION, 30, m_MainWindow.GetIniFile())
RotationAngleTxBx.Text = DoubleToString(m_dRotation, 3)
' Se movimento manuale perpendicolare
+3
View File
@@ -237,10 +237,13 @@ Module ConstIni
Public Const K_OTHERREFTABX As String = "OtherRefTabX"
Public Const K_OTHERREFTABY As String = "OtherRefTabY"
Public Const K_OTHERREFTABPOS As String = "OtherRefTabPos"
Public Const K_REFTAB As String = "RefTab"
Public Const K_CURRENTREFTAB As String = "CurrRefTab"
Public Const S_RAWMOVE As String = "RawMove"
Public Const K_RAWSTEP As String = "Step"
Public Const K_EXTRASTEP As String = "ExtraStep"
Public Const K_RAWROTATION As String = "Rotation"
Public Const K_PERPENDICULAR As String = "Perpendicular"
+15 -14
View File
@@ -92,22 +92,23 @@
Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<Image Source="{DynamicResource Sezione-corniceImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
</Button>-->
<Grid>
<Button Name="SelGuideBtn" Style="{DynamicResource OmagCut_YellowTextButton}"/>
<UniformGrid Name="ArcGrid" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" >
<TextBlock Name="ArcRadTxBl" Grid.Row="2" Grid.ColumnSpan="2"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="ArcRadTxBx" Grid.Column="2" Grid.Row="2" Width="50"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="ArcAngTxBl" Grid.Row="3" Grid.ColumnSpan="2"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="ArcAngTxBx" Grid.Column="2" Grid.Row="3" Width="50"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
</UniformGrid>
</Grid>
<UniformGrid Name="ArcGrid" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" >
<TextBlock Name="ArcRadTxBl" Grid.Row="2" Grid.ColumnSpan="2"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="ArcRadTxBx" Grid.Column="2" Grid.Row="2" Width="50"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="ArcAngTxBl" Grid.Row="3" Grid.ColumnSpan="2"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="ArcAngTxBx" Grid.Column="2" Grid.Row="3" Width="50"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
</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"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="OffsZTxBx" Grid.Column="2" Grid.Row="2" Width="50"
+257 -91
View File
@@ -23,6 +23,10 @@ Public Class FrameCutPageUC
' Importazione guida in corso
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
' Creazione delle Page UserControl
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 + 2)) 'Lungo Y
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 + 14)) 'Guida
m_AlongAx.Add("Raw side")
End If
SelSectionBtn.ToolTip = EgtMsg(MSG_FRAMECUTPAGEUC + 15) 'Sezione
SelGuideBtn.Content = EgtMsg(MSG_FRAMECUTPAGEUC + 16) 'Guida
@@ -75,6 +80,7 @@ Public Class FrameCutPageUC
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 9) 'Distanza inizio
OffsYyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 22) 'Distanza Y
OffsXInteryTxBl.Text = EgtMsg(90645) 'Interasse
SelRawSideBtn.Content = "Sel raw side"
Dim sChBxToolTip As String = EgtMsg(90646) 'Applica valore indicato\n altrienti spessore lama
sChBxToolTip = sChBxToolTip.Replace("/n", "£")
Dim sItems As String() = sChBxToolTip.Split("£")
@@ -138,25 +144,26 @@ Public Class FrameCutPageUC
AlongAxCmBx.SelectedIndex = m_CurrAx
AlongAxCmBx.IsEnabled = False
' 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
If m_CurrAx = 3 Then
SelGuideBtn.IsEnabled = ( EgtGetFirstNameInGroup( nPartId, NAME_GUIDE) = GDB_ID.NULL)
End If
Dim bIsEnable As Boolean = (EgtGetFirstNameInGroup(nPartId, NAME_GUIDE) = GDB_ID.NULL)
If m_CurrAx = 3 Then SelGuideBtn.IsEnabled = bIsEnable
If m_CurrAx = 4 Then SelRawSideBtn.IsEnabled = bIsEnable
' Se cornice su arco ne leggo i dati
If m_CurrAx = 2 Then
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
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
' Altrimenti
' Altrimenti
Else
' Abilito cambio direzione e scelta sezione
AlongAxCmBx.SelectedIndex = m_CurrAx
AlongAxCmBx.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 Sub
@@ -168,6 +175,7 @@ Public Class FrameCutPageUC
ArcGrid.Visibility = Windows.Visibility.Collapsed
OffsYyTxBl.Visibility = Windows.Visibility.Collapsed
OffsYyTxBx.Visibility = Windows.Visibility.Collapsed
SelRawSideBtn.Visibility = Windows.Visibility.Collapsed
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 9) 'Distanza inizio
Case 2 'Arco
SelSectionBtn.Visibility = Windows.Visibility.Visible
@@ -175,6 +183,7 @@ Public Class FrameCutPageUC
ArcGrid.Visibility = Windows.Visibility.Visible
OffsYyTxBl.Visibility = Windows.Visibility.Visible
OffsYyTxBx.Visibility = Windows.Visibility.Visible
SelRawSideBtn.Visibility = Windows.Visibility.Collapsed
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 21) 'Distanza X
Case 3 'Guida
SelSectionBtn.Visibility = Windows.Visibility.Visible
@@ -183,6 +192,16 @@ Public Class FrameCutPageUC
ArcGrid.Visibility = Windows.Visibility.Collapsed
OffsYyTxBl.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
End Select
End Sub
@@ -209,11 +228,58 @@ Public Class FrameCutPageUC
Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then
Return
End If
' Verifico se selezionato indicativo di pezzo
EgtSetObjFilterForSelWin(False, False, True, False, False)
Dim nSel As Integer
Dim nSel As Integer = GDB_ID.NULL
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)
Dim nId As Integer = EgtGetFirstObjInSelWin()
nId = EgtGetFirstObjInSelWin()
While nId <> GDB_ID.NULL
' Recupero l'identificativo del layer e del pezzo cui appartiene
Dim nLayId As Integer = EgtGetParent(nId)
@@ -374,14 +440,14 @@ Public Class FrameCutPageUC
' Cerco pezzo in grezzo
Dim nPartId As Integer = EgtGetFirstPartInRawPart(m_nRawId)
' 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
' Rimuovo le lavorazioni
EraseMachinings(nPartId)
' Cancello
EgtErase(nPartId)
End If
' Altrimenti esco subito
' Altrimenti esco subito
Else
Return
End If
@@ -478,14 +544,14 @@ Public Class FrameCutPageUC
End Sub
Friend Function CreateFrame(nPartId As Integer) As Boolean
If Not MyCreateFrame( nPartId) Then
EgtErase( nPartId)
If Not MyCreateFrame(nPartId) Then
EgtErase(nPartId)
If m_CurrAx <> 2 Then
' Errore : creazione cornice non riuscita
m_CurrProjPage.SetErrorMessage( EgtMsg(MSG_FRAMECUTPAGEUC + 20))
m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_FRAMECUTPAGEUC + 20))
Else
' Errore : raggio più piccolo della larghezza della sezione
m_CurrProjPage.SetErrorMessage( EgtMsg(MSG_FRAMECUTPAGEUC + 19))
m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_FRAMECUTPAGEUC + 19))
End If
Return False
End If
@@ -501,12 +567,12 @@ Public Class FrameCutPageUC
' Sistemo la sezione o la guida della cornice
If Not m_bGuide Then
If Not AdjustSection(nPartId) Then
EgtOutLog( "Error in CreateFrame : problems with Section")
EgtOutLog("Error in CreateFrame : problems with Section")
Return False
End If
Else
If Not AdjustGuide(nPartId) Then
EgtOutLog( "Error in CreateFrame : problems with Guide")
EgtOutLog("Error in CreateFrame : problems with Guide")
Return False
End If
End If
@@ -518,48 +584,49 @@ Public Class FrameCutPageUC
Dim nSectId As Integer = EgtGetFirstInGroup(nSectLayId)
If nSectId = GDB_ID.NULL Then Return False
' Creazione cornice
nSurfId = CreateLineFrame( nSectId, nSectLayId, nPartId)
nSurfId = CreateLineFrame(nSectId, nSectLayId, nPartId)
' Se non creata superficie, reset di tutto e segnalazione errore
If nSurfId = GDB_ID.NULL Then
EgtErase( nPartId)
EgtOutLog( "Error in CreateFrame : Surface not constructible")
EgtErase(nPartId)
EgtOutLog("Error in CreateFrame : Surface not constructible")
Return False
End If
' se cornice su arco
' se cornice su arco
ElseIf m_CurrAx = 2 Then
' Recupero layer e curva della sezione
Dim nSectLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_SECT)
Dim nSectId As Integer = EgtGetFirstInGroup(nSectLayId)
If nSectId = GDB_ID.NULL Then Return False
' Porto l'inizio della curva a X0 locale
ChangeCurveStartToX0( nSectId)
ChangeCurveStartToX0(nSectId)
' Creazione cornice
nSurfId = CreateArcFrame( nSectId, nSectLayId, nPartId)
nSurfId = CreateArcFrame(nSectId, nSectLayId, nPartId)
' Se non creata superficie, reset di tutto e segnalazione errore
If nSurfId = GDB_ID.NULL Then
EgtErase( nPartId)
EgtOutLog( "Error in CreateFrame : radius too small for the section")
EgtErase(nPartId)
EgtOutLog("Error in CreateFrame : radius too small for the section")
Return False
End If
' altrimenti cornice su guida
' altrimenti cornice su guida
Else
If not m_bGuide Then
If Not m_bGuide Then
' Recupero layer e curva della sezione
Dim nSectLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_SECT)
Dim nSectId As Integer = EgtGetFirstInGroup(nSectLayId)
If nSectId = GDB_ID.NULL Then Return False
' Porto l'inizio della curva a X0 locale
ChangeCurveStartToX0( nSectId)
ChangeCurveStartToX0(nSectId)
Else
' 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
EgtOutLog( "Error in CreateFrame : Section not found")
EgtOutLog("Error in CreateFrame : Section not found")
Return False
End If
' Parcheggio il pezzo trovato
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
Dim nSectLayId As Integer = EgtGetFirstNameInGroup(nTruePartId, NAME_SECT)
Dim nSectId As Integer = EgtGetFirstInGroup(nSectLayId)
@@ -569,17 +636,17 @@ Public Class FrameCutPageUC
Dim nGuideId As Integer = EgtGetFirstInGroup(nGuideLayId)
If nGuideId = GDB_ID.NULL Then Return False
' Sposto la guida in questo pezzo
EgtRelocate( nGuideLayId, nTruePartId)
EgtRelocate(nGuideLayId, nTruePartId)
' Cancello il pezzo
EgtErase( nPartId)
EgtErase(nPartId)
' Creazione cornice
nPartId = nTruePartId
nSurfId = CreateCurveFrame( nSectId, nSectLayId, nGuideId, nGuideLayId, nPartId)
nPartId = nTruePartId
nSurfId = CreateCurveFrame(nSectId, nSectLayId, nGuideId, nGuideLayId, nPartId)
m_bGuide = False
' Se non creata superficie, reset di tutto e segnalazione errore
If nSurfId = GDB_ID.NULL Then
EgtErase( nPartId)
EgtOutLog( "Error in CreateFrame : Surface not constructible")
EgtErase(nPartId)
EgtOutLog("Error in CreateFrame : Surface not constructible")
Return False
End If
End If
@@ -623,17 +690,17 @@ Public Class FrameCutPageUC
Dim nSurfId As Integer = GDB_ID.NULL
' Se cornice rettilinea
If m_CurrAx = 0 Or m_CurrAx = 1 Then
nSurfId = CreateLineFrame( nSectId, nSectLayId, nPartId)
' se cornice su arco
nSurfId = CreateLineFrame(nSectId, nSectLayId, nPartId)
' se cornice su arco
ElseIf m_CurrAx = 2 Then
nSurfId = CreateArcFrame( nSectId, nSectLayId, nPartId)
' altrimenti cornice su curva
nSurfId = CreateArcFrame(nSectId, nSectLayId, nPartId)
' altrimenti cornice su curva
Else
' Recupero layer e curva della guida
Dim nGuideLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_GUIDE)
Dim nGuideId As Integer = EgtGetFirstInGroup(nGuideLayId)
If nGuideId = GDB_ID.NULL Then Return False
nSurfId = CreateCurveFrame( nSectId, nSectLayId, nGuideId, nGuideLayId, nPartId)
nSurfId = CreateCurveFrame(nSectId, nSectLayId, nGuideId, nGuideLayId, nPartId)
End If
' Assegno nome e direzione a pezzo
EgtSetName(nPartId, NAME_FRAME)
@@ -699,7 +766,7 @@ Public Class FrameCutPageUC
ptStart = ptTmp
End If
' 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
If b3Box.DimY() < EPS_SMALL Then
ptStart -= 10 * EPS_SMALL * Vector3d.Y_AX()
@@ -740,7 +807,7 @@ Public Class FrameCutPageUC
EgtAddCurveCompoLine(nCrvId, ptEnd)
b3Box.Add(ptEnd)
End If
' Altrimenti cornice curva
' Altrimenti cornice curva
Else
' Aggiungo linea verticale dall'estremo più alto alla quota del più basso
If ptStart.y > ptEnd.y Then
@@ -767,7 +834,15 @@ Public Class FrameCutPageUC
EgtSelectLayerObjs(nLayerId)
Dim nCrvIds(0) As Integer
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
' Elimino eventuali curve oltre la prima
Dim nId As Integer = EgtGetNext(nCrvId)
@@ -792,17 +867,17 @@ Public Class FrameCutPageUC
' Elimino vecchio layer
EgtErase(nLayerId)
' Impongo rotazione guida CCW
Dim bClosed As Boolean = EgtCurveIsClosed( nCrvId)
If Not bClosed Then EgtCloseCurveCompo( nCrvId)
Dim bClosed As Boolean = EgtCurveIsClosed(nCrvId)
If Not bClosed Then EgtCloseCurveCompo(nCrvId)
Dim dArea As Double = 0
EgtCurveAreaXY( nCrvId, dArea)
If Not bClosed Then EgtRemoveCurveCompoCurve( nCrvId)
If dArea < -1 Then EgtInvertCurve( nCrvId)
EgtCurveAreaXY(nCrvId, dArea)
If Not bClosed Then EgtRemoveCurveCompoCurve(nCrvId)
If dArea < -1 Then EgtInvertCurve(nCrvId)
' Se curva chiusa, impongo inizio a metà del lato a X max
If bClosed Then
Dim b3Guide As New BBox3d
EgtGetBBox( nCrvId, GDB_BB.STANDARD, b3Guide)
Dim ptStart As New Point3d( b3Guide.Max().x, b3Guide.Center().y, b3Guide.Center().z)
EgtGetBBox(nCrvId, GDB_BB.STANDARD, b3Guide)
Dim ptStart As New Point3d(b3Guide.Max().x, b3Guide.Center().y, b3Guide.Center().z)
EgtChangeClosedCurveStartPoint(nCrvId, ptStart)
End If
Return True
@@ -828,7 +903,7 @@ Public Class FrameCutPageUC
Return True
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
Dim vtExtr As Vector3d
If m_CurrAx = 0 Then
@@ -869,7 +944,7 @@ Public Class FrameCutPageUC
Return nSurfId
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
Dim b3Sect As New BBox3d
EgtGetBBox(nSectId, GDB_BB.STANDARD, b3Sect)
@@ -912,22 +987,22 @@ Public Class FrameCutPageUC
' Creo la superficie swept
Dim dSectRotDeg As Double = 90 + dAngIniDeg
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
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
Dim bOthSide As Boolean = False
EgtGetInfo( nPartId, INFO_FRAME_OTHSIDE, bOthSide)
EgtGetInfo(nPartId, INFO_FRAME_OTHSIDE, bOthSide)
' Recupero dati inizio guida
Dim ptStart As Point3d
EgtStartPoint(nGuideId, nPartId, ptStart)
Dim vtStart As Vector3d
EgtStartVector(nGuideId, nPartId, vtStart)
' Creo riferimento per sezione
dim frSect As New Frame3d
frSect.Setup( ptStart, -vtStart)
Dim frSect As New Frame3d
frSect.Setup(ptStart, -vtStart)
' Porto la sezione in questo riferimento
EgtChangeGroupFrame(nSectLayId, frSect)
' Recupero ingombro locale della sezione
@@ -935,16 +1010,16 @@ Public Class FrameCutPageUC
EgtGetBBox(nSectId, GDB_BB.STANDARD, b3Sect)
' Recupero ingombro locale della guida
Dim b3Guide As New BBox3d
EgtGetBBox( nGuideId, GDB_BB.STANDARD, b3Guide)
b3Guide.ToLoc( frSect)
EgtGetBBox(nGuideId, GDB_BB.STANDARD, b3Guide)
b3Guide.ToLoc(frSect)
' Muovo sezione dalla parte interna della curva
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
Dim vtMove As New Vector3d( - b3Sect.Max().x, -b3Sect.Min().y, 0)
EgtMove( nSectId, vtMove)
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
Dim vtMove As New Vector3d(-b3Sect.Max().x, -b3Sect.Min().y, 0)
EgtMove(nSectId, vtMove)
Else
Dim vtMove As New Vector3d( - b3Sect.Min().x, -b3Sect.Min().y, 0)
EgtMove( nSectId, vtMove)
Dim vtMove As New Vector3d(-b3Sect.Min().x, -b3Sect.Min().y, 0)
EgtMove(nSectId, vtMove)
End If
' Recupero o creo layer per la superficie
Dim nSurfLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_SURF)
@@ -956,25 +1031,12 @@ Public Class FrameCutPageUC
End If
EgtSetColor(nSurfLayId, COL_FRAME())
' 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
End Function
Private Function InsertPartInRawPart(nPartId As Integer) As Boolean
' 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
' Determino distanza da spessore lama
' Determino distanza (interasse cornici) da spessore lama oppure offset
Dim dMinDist As Double = 0
Dim dSawThick As Double = 0
Dim dOffsXIntery As Double = 0
@@ -991,16 +1053,36 @@ Public Class FrameCutPageUC
Else
dMinDist = dSawThick + 5 * EPS_SMALL
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
EgtOutLog("Not found current saw for frames mindist")
dMinDist = dOffsXIntery
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
Dim ptIns As Point3d
If OtherBox.IsEmpty() Then
@@ -1027,11 +1109,95 @@ Public Class FrameCutPageUC
ptIns.y = m_dKerf
End If
End If
Dim dOffsZ As Double = 0
StringToLen(OffsZTxBx.Text, 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)
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 Class
+10 -6
View File
@@ -279,12 +279,16 @@ Public Class MachineStatusUC
Sub DisplayFeed()
Dim dRealFeed As Double = m_CN.d_DInterpo_Prog_Feed * m_CN.d_DInterpo_Feed_override / 100
' modifica richiesta 26/05/2023 da Rosario per cliente Lanzetta
If m_MainWindow.m_CNCommunication.m_nNCType = 4 Then
dRealFeed = m_CN.d_DInterpo_Prog_Feed
Else
dRealFeed = m_CN.d_DInterpo_Prog_Feed * m_CN.d_DInterpo_Feed_override / 100
End If
'' modifica richiesta 26/05/2023 da Rosario per cliente Lanzetta (lettura feed per CN Fanuc)
'If m_MainWindow.m_CNCommunication.m_nNCType = 4 Then
' dRealFeed = m_CN.d_DInterpo_Prog_Feed
'Else
' dRealFeed = m_CN.d_DInterpo_Prog_Feed * m_CN.d_DInterpo_Feed_override / 100
'End If
' modifica richiesta 24/03/2025 da Fabio per cliente Frigerio
dRealFeed = m_CN.d_DInterpo_Prog_Feed * m_CN.d_DInterpo_Feed_override / 100
'Feed = DoubleToString(dRealFeed, 0)
FeedTxBx.Text = LenToString(dRealFeed, 0, True)
'FeedOverride = DoubleToString(m_CN.d_DInterpo_Feed_override, 0) & "%"
+3 -3
View File
@@ -26,7 +26,7 @@ Class MainWindow
' Variabile che definisce l'avvio forzato in modalità FRAME
Friend m_OnlyFrame As Boolean = False
Public Shared m_bShowSVGParkInd As Boolean = False
Public Shared m_bShowSVGParkInd As Boolean = True
' Dichiarazione delle Page UserControl
Friend m_WorkInProgressPageUC As WorkInProgressPageUC
@@ -345,8 +345,8 @@ Class MainWindow
' Verifico abilitazione nesting automatico
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
' Recupero opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2703, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2703, 1, m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2704, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2704, 1, m_nKeyOptions)
' Verifico abilitazione prodotto
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
' Impostazione per programma OnlyFrame: solo se CUT_BASE non attivo
+2 -2
View File
@@ -62,5 +62,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.7.3.2")>
<Assembly: AssemblyFileVersion("2.7.3.2")>
<Assembly: AssemblyVersion("2.7.4.1")>
<Assembly: AssemblyFileVersion("2.7.4.1")>
+25 -9
View File
@@ -4,7 +4,7 @@
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
FontFamily="{DynamicResource OmagCut_Font}"
ResizeMode="NoResize" WindowStyle="None" AllowsTransparency="True" Background="Transparent"
Title="ModifStartEndWD" Height="250" Width="320" ShowInTaskbar="False">
Title="ModifStartEndWD" Height="350" Width="320" ShowInTaskbar="False">
<!--Definizione della pagina di scelta del nome con cui salvare il progetto-->
<Border Style="{DynamicResource OmagCut_Border}">
@@ -28,14 +28,30 @@
<RowDefinition Height="0.2*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.2*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.2*"/>
<RowDefinition Height="0.2*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="0.2*"/>
</Grid.RowDefinitions>
<TextBlock Name="RefRawTxbl" Grid.Column="1" Grid.Row="1"
<TextBlock Name="SelRefTxbl" Grid.Column="1" Grid.Row="1"
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<ComboBox Name="RefTabModeCmBx" Grid.Column="2" Grid.Row="1" Style="{StaticResource OmagCut_ComboBox}"
<ComboBox Name="RefTabCmBx" Grid.Column="2" Grid.Row="1" Style="{StaticResource OmagCut_ComboBox}"
MaxDropDownHeight="300" Margin="0,0,0,0">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Name="RefRawTxbl" Grid.Column="1" Grid.Row="3"
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<ComboBox Name="RefTabOrientationCmBx" Grid.Column="2" Grid.Row="3" Style="{StaticResource OmagCut_ComboBox}"
MaxDropDownHeight="300" Margin="0,0,0,0">
<ComboBox.ItemTemplate>
<DataTemplate>
@@ -44,17 +60,17 @@
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Name="RefTabXTxbl" Grid.Column="1" Grid.Row="3"
<TextBlock Name="RefTabXTxbl" Grid.Column="1" Grid.Row="5"
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="RefTabXTxBx" Grid.Column="2" Grid.Row="3"
<EgtWPFLib:EgtTextBox Name="RefTabXTxBx" Grid.Column="2" Grid.Row="5"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="RefTabYTxbl" Grid.Column="1" Grid.Row="5"
<TextBlock Name="RefTabYTxbl" Grid.Column="1" Grid.Row="7"
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="RefTabYTxBx" Grid.Column="2" Grid.Row="5"
<EgtWPFLib:EgtTextBox Name="RefTabYTxBx" Grid.Column="2" Grid.Row="7"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<Grid Name="ButtonsGrid" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="7" Grid.RowSpan="1">
<Grid Name="ButtonsGrid" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="10" Grid.RowSpan="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
+135 -14
View File
@@ -1,4 +1,5 @@
Imports System.IO
Imports System.Reflection
Imports EgtUILib
Imports EgtWPFLib
@@ -12,9 +13,14 @@ Public Class OtherRefTabWD
Private m_dPrevOffsetX As Double = 0
Private m_dPrevOffsetY As Double = 0
Private m_bModifX As Boolean = False
Private m_bModifY As Boolean = False
Private m_SelIndex As Integer = 0
Sub New(Owner As Window, PosX As String, PosY As String, OffsetX As Double, OffsetY As Double, OtherRefMode As Integer)
Private m_SelRef As Integer = 0
Sub New(Owner As Window, PosX As String, PosY As String, OffsetX As Double, OffsetY As Double, OtherRefMode As Integer, SelRef As Integer)
Me.Owner = Owner
' La chiamata è richiesta dalla finestra di progettazione.
InitializeComponent()
@@ -25,6 +31,7 @@ Public Class OtherRefTabWD
m_dPrevOffsetX = OffsetX
m_dPrevOffsetY = OffsetY
m_SelIndex = OtherRefMode
m_SelRef = SelRef
End Sub
Private Sub OtherRrefTabWD_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
@@ -36,8 +43,11 @@ Public Class OtherRefTabWD
RefRawTxbl.Text = "Raw reference"
RefTabXTxbl.Text = "Position X"
RefTabYTxbl.Text = "Position Y"
RefTabModeCmBx.ItemsSource = m_RawPartPage.m_OtherRefTabList
RefTabModeCmBx.SelectedIndex = m_RawPartPage.m_OtherRefTabPos
SelRefTxbl.Text = "Sel reference"
RefTabOrientationCmBx.ItemsSource = m_RawPartPage.m_OtherRefTabOrientationList
RefTabOrientationCmBx.SelectedIndex = m_RawPartPage.m_OtherRefTabPos
RefTabCmBx.ItemsSource = m_RawPartPage.m_OtherRefTabList
RefTabCmBx.SelectedIndex = m_RawPartPage.m_CurrRefTab
End Sub
Private Sub OtherRrefTabWD_Load(sender As Object, e As EventArgs) Handles Me.Loaded
@@ -45,9 +55,44 @@ Public Class OtherRefTabWD
RefTabYTxBx.Text = m_sPosY
End Sub
Private Sub RefTabModeCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles RefTabModeCmBx.SelectionChanged
m_RawPartPage.m_OtherRefTabPos = RefTabModeCmBx.SelectedIndex
WritePrivateProfileString(S_RAWPART, K_OTHERREFTABPOS, m_RawPartPage.m_OtherRefTabPos.ToString, m_MainWindow.GetIniFile())
Private Sub RefTabCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles RefTabCmBx.SelectionChanged
If m_bModifX Or m_bModifY Then
Dim SaveCurrToolWnd = New EgtMsgBox(m_MainWindow, "", EgtMsg(MSG_EGTMSGBOX + 2), EgtMsgBox.Buttons.YES_NO_CANCEL, EgtMsgBox.Icons.NULL)
Select Case SaveCurrToolWnd.m_nPressedBtn
Case 0 ' Annulla
' annullo l'operazione di cambio indice
RefTabCmBx.SelectedIndex = m_RawPartPage.m_CurrRefTab
Return
Case 1 ' Si
' salvo i valori modificati
UpdateCurrOffset()
' recupero l'oggetto precedentemente selezionato e lo aggiorno (per evitare di rileggere il file ini)
Dim temp_RefTab As ReferenceTable = m_RawPartPage.m_OtherRefTabList(m_RawPartPage.m_CurrRefTab)
temp_RefTab.dOffsetX = m_RawPartPage.m_OtherRefTabX
temp_RefTab.dOffsetY = m_RawPartPage.m_OtherRefTabY
temp_RefTab.nPos = m_RawPartPage.m_OtherRefTabPos
Case 2 ' No
' Non salvo e vado oltre
m_bModifX = False
m_bModifY = False
End Select
End If
' recupero l'oggetto selezionato
Dim local_RefTab As ReferenceTable = m_RawPartPage.m_OtherRefTabList(RefTabCmBx.SelectedIndex)
m_RawPartPage.m_CurrRefTab = RefTabCmBx.SelectedIndex
' Imposto gli Offset del riferimento selezionato
RefTabXTxBx.Text = LenToString(local_RefTab.dOffsetX, 2)
m_RawPartPage.m_OtherRefTabX = local_RefTab.dOffsetX
RefTabYTxBx.Text = LenToString(local_RefTab.dOffsetY, 2)
m_RawPartPage.m_OtherRefTabY = local_RefTab.dOffsetY
' Aggiorno la posizine del grezzo
m_RawPartPage.RefTabModeChange()
m_bModifX = False
m_bModifY = False
End Sub
Private Sub RefTabOrientationCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles RefTabOrientationCmBx.SelectionChanged
m_RawPartPage.m_OtherRefTabPos = RefTabOrientationCmBx.SelectedIndex
m_RawPartPage.RefTabModeChange()
End Sub
@@ -66,6 +111,7 @@ Public Class OtherRefTabWD
' errore, posizione fuori dalla tavola
End If
m_RawPartPage.m_OtherRefTabX = dX
m_bModifX = True
m_RawPartPage.RefTabModeChange()
End If
End Sub
@@ -85,24 +131,99 @@ Public Class OtherRefTabWD
' errore, posizione fuori dalla tavola
End If
m_RawPartPage.m_OtherRefTabY = dY
m_bModifY = True
m_RawPartPage.RefTabModeChange()
End If
End Sub
Private Sub OkBtn_Click() Handles OkBtn.Click
WritePrivateProfileString(S_RAWPART, K_OTHERREFTABX, DoubleToString(RefTabXTxBx.Text, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_RAWPART, K_OTHERREFTABY, DoubleToString(RefTabYTxBx.Text, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_RAWPART, K_OTHERREFTABPOS, m_RawPartPage.m_OtherRefTabPos.ToString, m_MainWindow.GetIniFile())
WritePrivateProfileString(S_RAWPART, K_CURRENTREFTAB, m_RawPartPage.m_CurrRefTab.ToString, m_MainWindow.GetIniFile())
' Aggiorno il valore del riferimento correntemente modificato
UpdateCurrOffset()
m_RawPartPage.RefTabModeChange()
Me.Close()
End Sub
Private Sub UpdateCurrOffset()
Dim sKeyMsg As String = K_REFTAB & m_RawPartPage.m_CurrRefTab.ToString
Dim sValMsg As String = DoubleToString(m_RawPartPage.m_OtherRefTabX, 2) & "," & DoubleToString(m_RawPartPage.m_OtherRefTabY, 2) & "," & m_RawPartPage.m_OtherRefTabPos.ToString
WritePrivateProfileString(S_RAWPART, sKeyMsg, sValMsg, m_MainWindow.GetIniFile())
End Sub
Private Sub ExitBtn_Click() Handles ExitBtn.Click
' riposiziono l'origine
m_RawPartPage.m_OtherRefTabX = m_sPosX
m_RawPartPage.m_OtherRefTabY = m_sPosY
' ripristino il valore della combobox
m_RawPartPage.m_OtherRefTabPos = m_SelIndex
' Recupero la prima selezione eseguita
m_RawPartPage.m_CurrRefTab = m_SelRef
Dim temp_RefTab As ReferenceTable = m_RawPartPage.m_OtherRefTabList(m_RawPartPage.m_CurrRefTab)
' aggiorno i valori
m_RawPartPage.m_OtherRefTabX = temp_RefTab.dOffsetX
m_RawPartPage.m_OtherRefTabY = temp_RefTab.dOffsetY
m_RawPartPage.m_OtherRefTabPos = temp_RefTab.nPos
m_RawPartPage.RefTabModeChange()
End Sub
End Class
Public Class ReferenceTable
Private m_dOffsetX As Double
Private m_dOffsetY As Double
Private m_nPos As RawPartPageUC.OTHERREFMODE = RawPartPageUC.OTHERREFMODE.BL
Private m_nIndexRef As Integer = 0
Public Property dOffsetX As Double
Get
Return m_dOffsetX
End Get
Set(value As Double)
m_dOffsetX = value
End Set
End Property
Public Property dOffsetY As Double
Get
Return m_dOffsetY
End Get
Set(value As Double)
m_dOffsetY = value
End Set
End Property
Public Property nPos As Integer
Get
Return m_nPos
End Get
Set(value As Integer)
m_nPos = value
End Set
End Property
Public Property nIndexRef As Integer
Get
Return m_nIndexRef
End Get
Set(value As Integer)
m_nIndexRef = value
End Set
End Property
Public ReadOnly Property Name As String
Get
Return "REF_" & m_nIndexRef.ToString()
End Get
End Property
Public ReadOnly bOk As Boolean = True
Sub New(sStringFromIni As String, IndexRef As Integer)
Dim sItems() As String = sStringFromIni.Split(","c)
If sItems.Count = 3 Then
bOk = bOk And StringToLen(sItems(0), m_dOffsetX)
bOk = bOk And StringToLen(sItems(1), m_dOffsetY)
bOk = bOk And StringToInt(sItems(2), m_nPos)
m_nIndexRef = IndexRef
Else
bOk = False
End If
End Sub
End Class
+75 -13
View File
@@ -1,4 +1,5 @@
Imports System.IO
Imports System.Reflection
Imports EgtUILib
Imports EgtWPFLib
@@ -92,10 +93,12 @@ Public Class RawPartPageUC
' Riferimento grezzo
Private m_bEnableOtherRefTab As Boolean = False
Private m_bOtherRefTab As Boolean
Public m_OtherRefTabX As Double = 0
Public m_OtherRefTabY As Double = 0
Public m_OtherRefTabList(3) As String
Public m_OtherRefTabPos As Integer = 0
Public m_OtherRefTabX As Double = 0 ' offset riferimento corrente
Public m_OtherRefTabY As Double = 0 ' offset riferimento corrente
Public m_OtherRefTabPos As Integer = 0 ' poisizione riferimento (Bottom-Left, ..)
Public m_OtherRefTabOrientationList(3) As String ' oriemtazione riferiemnto
Public m_OtherRefTabList As New List(Of ReferenceTable) ' lista dei riferiemneti configurata nel programma
Public m_CurrRefTab As Integer = 1 ' inidice del riferimento della lista corrente
Private m_nOtherRefTabLay As Integer = GDB_ID.NULL
Private m_OtherRefTabPoint As Point3d
@@ -126,7 +129,7 @@ Public Class RawPartPageUC
FROM_SAW = 7
End Enum
Private Enum OTHERREFMODE As Integer
Friend Enum OTHERREFMODE As Integer
BL = 0
BR = 1
TR = 2
@@ -182,10 +185,10 @@ Public Class RawPartPageUC
RawModeCmBx.ItemsSource = m_RawModeList
' Creo la lista dei riferimenti tavola
m_OtherRefTabList(OTHERREFMODE.BL) = "Bottom left"
m_OtherRefTabList(OTHERREFMODE.BR) = "Bottom right"
m_OtherRefTabList(OTHERREFMODE.TR) = "Top right"
m_OtherRefTabList(OTHERREFMODE.TL) = "Top left"
m_OtherRefTabOrientationList(OTHERREFMODE.BL) = "Bottom left"
m_OtherRefTabOrientationList(OTHERREFMODE.BR) = "Bottom right"
m_OtherRefTabOrientationList(OTHERREFMODE.TR) = "Top right"
m_OtherRefTabOrientationList(OTHERREFMODE.TL) = "Top left"
' lista per selezione RawModeDamaged
m_RawModeDamagedList(0) = EgtMsg(MSG_RAWPARTPAGEUC + 2) 'Per Punti
@@ -400,9 +403,36 @@ Public Class RawPartPageUC
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())
m_OtherRefTabY = GetPrivateProfileDouble(S_RAWPART, K_OTHERREFTABY, 0, m_MainWindow.GetIniFile())
m_OtherRefTabPos = GetPrivateProfileInt(S_RAWPART, K_OTHERREFTABPOS, 0, m_MainWindow.GetIniFile())
' Recupero il riferimento attivo
m_CurrRefTab = GetPrivateProfileInt(S_RAWPART, K_CURRENTREFTAB, 0, m_MainWindow.GetIniFile())
' carico l'elenco dei riferimenti da usare
LoadRefTabList()
' Solo se non esiste una lista allora leggo i valori
If m_OtherRefTabList.Count = 0 Then
' Versione precedente 2.7c# DEPRECABILE
Dim Off_X As Double = -1000
Dim Off_Y As Double = -1000
Dim Pos_Ind As Integer = -1
Off_X = GetPrivateProfileDouble(S_RAWPART, K_OTHERREFTABX, -1000, m_MainWindow.GetIniFile())
Off_Y = GetPrivateProfileDouble(S_RAWPART, K_OTHERREFTABY, -1000, m_MainWindow.GetIniFile())
Pos_Ind = GetPrivateProfileInt(S_RAWPART, K_OTHERREFTABPOS, -1, m_MainWindow.GetIniFile())
If Off_X <> -1000 And Off_Y <> -1000 And Pos_Ind <> -1 Then
Dim Local_Text As String = DoubleToString(Off_X, 2) & "," & DoubleToString(Off_Y, 2) & "," & Pos_Ind.ToString
Dim local_NewRef As New ReferenceTable(Local_Text, 0)
If local_NewRef.bOk Then
m_OtherRefTabList.Add(local_NewRef)
m_CurrRefTab = 0
' Carico i valori
m_OtherRefTabX = m_OtherRefTabList(m_CurrRefTab).dOffsetX
m_OtherRefTabY = m_OtherRefTabList(m_CurrRefTab).dOffsetY
m_OtherRefTabPos = m_OtherRefTabList(m_CurrRefTab).nPos
' Creo la nuova configurazione da usare
Dim sKeyMsg As String = K_REFTAB & m_CurrRefTab.ToString
Dim sValMsg As String = DoubleToString(m_OtherRefTabX, 2) & "," & DoubleToString(m_OtherRefTabY, 2) & "," & m_OtherRefTabPos.ToString
WritePrivateProfileString(S_RAWPART, sKeyMsg, sValMsg, m_MainWindow.GetIniFile())
End If
End If
End If
' RefTabPosCmbx.SelectedIndex = m_OtherRefTabPos
OtherRefTabChBx.IsChecked = m_bOtherRefTab
' se riferimento tavola differente da quello atteso
@@ -421,6 +451,29 @@ Public Class RawPartPageUC
' EgtDraw()
End Sub
Private Sub LoadRefTabList()
m_OtherRefTabList.Clear()
Dim sRefTab As String = String.Empty
Dim nIndex As Integer = 0
While GetPrivateProfileString(S_RAWPART, K_REFTAB & nIndex.ToString, "", sRefTab, m_MainWindow.GetIniFile()) > 0
Dim local_NewRef As New ReferenceTable(sRefTab, nIndex)
If local_NewRef.bOk Then
m_OtherRefTabList.Add(local_NewRef)
nIndex += 1
Else
EgtOutLog("ERROR in reading RefTab" & nIndex.ToString & " is not correctly defined in file OmagCUT.ini, any other reference will not loaded")
Exit While
End If
End While
' Assegno il riferimento corrente
If m_CurrRefTab < m_OtherRefTabList.Count Then
m_OtherRefTabX = m_OtherRefTabList(m_CurrRefTab).dOffsetX
m_OtherRefTabY = m_OtherRefTabList(m_CurrRefTab).dOffsetY
m_OtherRefTabPos = m_OtherRefTabList(m_CurrRefTab).nPos
End If
End Sub
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
' Verifico di essere il gestore attivo
If Not m_bActive Then Return
@@ -809,6 +862,13 @@ Public Class RawPartPageUC
If m_bProbingOn Then Return
' reimposto il comando OutLine
OutlineBtn_Click(Nothing, Nothing)
' Nasocndo eventuali pareti
If m_bExistsSafetyZone Then
' gestisco la visualizzazione delle pareti che delimitano l'area sicura
EgtSetStatus(m_nIdMinRedX, GDB_ST.OFF)
EgtSetStatus(m_nIdMinRedY, GDB_ST.OFF)
End If
' Se confermata uscita
If ExitRawPart(True) Then
m_MainWindow.m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Remove(Me)
@@ -2362,8 +2422,10 @@ Public Class RawPartPageUC
End Sub
Private Sub OtherRefTabBtn_Click(sender As Object, e As EventArgs) Handles OtherRefTabBtn.Click
' Aggiorno la lista dei riferimenti
LoadRefTabList()
' apro la finestra per gestire il riferimento
Dim OthWD As New OtherRefTabWD(m_MainWindow, LenToString(m_OtherRefTabX, 2), LenToString(m_OtherRefTabY, 2), m_RawOffsX, m_RawOffsY, m_OtherRefTabPos)
Dim OthWD As New OtherRefTabWD(m_MainWindow, LenToString(m_OtherRefTabX, 2), LenToString(m_OtherRefTabY, 2), m_RawOffsX, m_RawOffsY, m_OtherRefTabPos, m_CurrRefTab)
OthWD.ShowDialog()
End Sub
+6
View File
@@ -206,6 +206,12 @@ Public Class SimulationPageUC
Else
PlayPauseImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/NewIcons/Play.png", UriKind.Relative))
End If
Dim nIdBase As Integer = EgtGetBaseId("Base")
Dim m_nIdMinRedX = EgtGetFirstNameInGroup(nIdBase, "MinRedX")
If m_nIdMinRedX <> GDB_ID.NULL Then EgtSetStatus(m_nIdMinRedX, GDB_ST.OFF)
Dim m_nIdMinRedY = EgtGetFirstNameInGroup(nIdBase, "MinRedY")
If m_nIdMinRedY <> GDB_ID.NULL Then EgtSetStatus(m_nIdMinRedY, GDB_ST.OFF)
End Sub
Private Sub StepBtn_Click(sender As Object, e As RoutedEventArgs) Handles StepBtn.Click