diff --git a/AlarmsPageUC.xaml b/AlarmsPageUC.xaml
index af2bbf9..de34f29 100644
--- a/AlarmsPageUC.xaml
+++ b/AlarmsPageUC.xaml
@@ -64,6 +64,11 @@
+
+
+
-
-
+
+
diff --git a/NestPageUC.xaml.vb b/NestPageUC.xaml.vb
index 10a1688..19e3965 100644
--- a/NestPageUC.xaml.vb
+++ b/NestPageUC.xaml.vb
@@ -291,10 +291,8 @@ Public Class NestPageUC
Public Function InsertOnePart(ByVal nId As Integer) As Boolean
' Se esiste grezzo e pezzo in parcheggio, lo metto nella tavola
If m_CurrProjPage.m_nRawId <> GDB_ID.NULL AndAlso EgtIsPart(nId) Then
- Dim ptPmin, ptPmax As Point3d
- EgtGetBBoxGlob(nId, BBFLAG, ptPmin, ptPmax)
- ptPmin.z = m_ptRawMax.z
- EgtAddPartToRawPart(nId, ptPmin, m_nRawId)
+ Dim ptP As New Point3d(0, 0, m_ptRawMax.z - m_ptRawMin.z)
+ EgtAddPartToRawPart(nId, ptP, m_nRawId)
If EgtPackPart(nId, m_ptRawMin.x + m_dKerf, m_ptRawMin.y + m_dKerf,
m_ptRawMax.x - m_dKerf, m_ptRawMax.y - m_dKerf, m_dMinDist, True) Then
Return True
diff --git a/NumericKeyboardWD.xaml.vb b/NumericKeyboardWD.xaml.vb
index 7094034..b3f868c 100644
--- a/NumericKeyboardWD.xaml.vb
+++ b/NumericKeyboardWD.xaml.vb
@@ -3,11 +3,12 @@ Imports EgtUILib
Public Class NumericKeyboardWD
- Dim MainWindowUC As MainWindow = Application.Current.MainWindow
- Public m_CurrentTxBx As TextBox
- Public m_CurrentLbl As String = String.Empty
+ Private MainWindowUC As MainWindow = Application.Current.MainWindow
+ Friend m_DoubleResult As Double = 0
+ Friend m_CurrentTxBx As TextBox
+ Friend m_CurrentLbl As String = String.Empty
Private m_sErrorString As String = String.Empty
- Dim m_bErrorState As Boolean = False
+ Friend m_bErrorState As Boolean = False
Private Sub NumericKeyboardWD_Initialized(sender As Object, e As EventArgs)
m_sErrorString = EgtMsg(MSG_NUMERICKEYBOARDWD + 1)
@@ -141,10 +142,9 @@ Public Class NumericKeyboardWD
End Sub
Private Sub Evaluate()
- Dim DoubleResult As Double = 0
- Dim bOk As Boolean = EgtUILib.EgtLuaEvalNumExpr(NumericKeyboardWDTextBox.Text, DoubleResult)
+ Dim bOk As Boolean = EgtUILib.EgtLuaEvalNumExpr(NumericKeyboardWDTextBox.Text, m_DoubleResult)
If bOk Then
- NumericKeyboardWDTextBox.Text = DoubleResult.ToString(CultureInfo.InvariantCulture)
+ NumericKeyboardWDTextBox.Text = m_DoubleResult.ToString(CultureInfo.InvariantCulture)
If m_bErrorState Then
m_bErrorState = False
NumericKeyboardWDTitle.Foreground = Brushes.Black
diff --git a/RawPartPageUC.xaml.vb b/RawPartPageUC.xaml.vb
index d0d39a7..de3ed15 100644
--- a/RawPartPageUC.xaml.vb
+++ b/RawPartPageUC.xaml.vb
@@ -299,81 +299,81 @@ Public Class RawPartPageUC
End If
End Function
- Friend Sub UpdateRawPart()
- ' Raccolgo i dati del grezzo rettangolare
- Dim dLength As Double
- If Not StringToDouble(LengthTxBx.Text, dLength) Or dLength < EPS_SMALL Then
- Return
- End If
- m_RawLength = dLength
- Dim dWidth As Double
- If Not StringToDouble(WidthTxBx.Text, dWidth) Or dWidth < EPS_SMALL Then
- Return
- End If
- m_RawWidth = dWidth
- Dim dHeight As Double
- If Not StringToDouble(HeightTxBx.Text, dHeight) Or dHeight < -EPS_ZERO Then
- Return
- End If
- Dim bHeightModif As Boolean = (Math.Abs(dHeight - m_RawHeight) > EPS_SMALL)
- m_RawHeight = dHeight
- Dim dOffsetX As Double
- If Not StringToDouble(OffsetXTxBx.Text, dOffsetX) Then
- Return
- End If
- m_RawOffsX = dOffsetX
- Dim dOffsetY As Double
- If Not StringToDouble(OffsetYTxBx.Text, dOffsetY) Then
- Return
- End If
- m_RawOffsY = dOffsetY
- Dim dKerf As Double
- If Not StringToDouble(KerfTxBx.Text, dKerf) Then
- Return
- End If
- If dKerf < EPS_SMALL Then
- dKerf = 0
- End If
- m_RawKerf = dKerf
- ' Se cambiato spessore e c'è foto, aggiorno quota fotografia
- If bHeightModif And m_CurrProjPage.GetPhoto() <> GDB_ID.NULL Then
- ' Aggiorno spessore in progetto corrente
- m_CurrProjPage.m_dRawHeight = m_RawHeight
- m_CurrProjPage.HeightTxBx.Text = DoubleToString(m_RawHeight, 2)
- ' Ricarico fotografia
- Dim sPath As String = String.Empty
- EgtGetPhotoPath(m_CurrProjPage.GetPhoto(), sPath)
- m_MainWindow.m_CadCutPageUC.PostPhoto(sPath)
- End If
- ' Se non esiste già il grezzo e richiesto, lo inserisco
- Dim nRawId As Integer = EgtGetFirstRawPart()
- If nRawId = GDB_ID.NULL And m_RawHeight > EPS_SMALL Then
- ' recupero il colore
- Dim Col As New Color3d(64, 192, 255, 40)
- GetPrivateProfileColor(S_RAWPART, K_RAWCOLOR, Col, m_MainWindow.GetIniFile())
- ' in presenza di foto rendo molto più trasparente
- If m_CurrProjPage.GetPhoto() <> GDB_ID.NULL Then
- Col.A = 20
- End If
- m_CurrProjPage.m_nRawId = EgtAddRawPart(Point3d.ORIG(), m_RawLength + 2 * m_RawKerf,
- m_RawWidth + 2 * m_RawKerf, m_RawHeight - DELTAZ_RAW, Col)
- ' se esiste e da cancellare
- ElseIf m_RawHeight < EPS_SMALL Then
- EgtRemoveRawPart(nRawId)
- m_CurrProjPage.m_nRawId = GDB_ID.NULL
- ' Altrimenti lo modifico
- Else
- m_CurrProjPage.m_nRawId = nRawId
- EgtModifyRawPartSize(nRawId, m_RawLength + 2 * m_RawKerf,
- m_RawWidth + 2 * m_RawKerf, m_RawHeight - DELTAZ_RAW)
- End If
- UpdateRawPartKerf()
- ' Sistemo la posizione
- Dim ptRef As New Point3d(m_RawOffsX - m_RawKerf, m_RawOffsY - m_RawKerf, m_CurrProjPage.m_dAddTable)
- EgtMoveToCornerRawPart(m_CurrProjPage.m_nRawId, ptRef, MCH_CR.BL)
- ' Aggiorno visualizzazione
- EgtZoom(ZM.ALL)
- End Sub
+ Friend Sub UpdateRawPart()
+ ' Raccolgo i dati del grezzo rettangolare
+ Dim dLength As Double
+ If Not StringToDouble(LengthTxBx.Text, dLength) Or dLength < EPS_SMALL Then
+ Return
+ End If
+ m_RawLength = dLength
+ Dim dWidth As Double
+ If Not StringToDouble(WidthTxBx.Text, dWidth) Or dWidth < EPS_SMALL Then
+ Return
+ End If
+ m_RawWidth = dWidth
+ Dim dHeight As Double
+ If Not StringToDouble(HeightTxBx.Text, dHeight) Or dHeight < -EPS_ZERO Then
+ Return
+ End If
+ Dim bHeightModif As Boolean = (Math.Abs(dHeight - m_RawHeight) > EPS_SMALL)
+ m_RawHeight = dHeight
+ Dim dOffsetX As Double
+ If Not StringToDouble(OffsetXTxBx.Text, dOffsetX) Then
+ Return
+ End If
+ m_RawOffsX = dOffsetX
+ Dim dOffsetY As Double
+ If Not StringToDouble(OffsetYTxBx.Text, dOffsetY) Then
+ Return
+ End If
+ m_RawOffsY = dOffsetY
+ Dim dKerf As Double
+ If Not StringToDouble(KerfTxBx.Text, dKerf) Then
+ Return
+ End If
+ If dKerf < EPS_SMALL Then
+ dKerf = 0
+ End If
+ m_RawKerf = dKerf
+ ' Se cambiato spessore e c'è foto, aggiorno quota fotografia
+ If bHeightModif And m_CurrProjPage.GetPhoto() <> GDB_ID.NULL Then
+ ' Aggiorno spessore in progetto corrente
+ m_CurrProjPage.m_dRawHeight = m_RawHeight
+ m_CurrProjPage.HeightTxBx.Text = DoubleToString(m_RawHeight, 2)
+ ' Ricarico fotografia
+ Dim sPath As String = String.Empty
+ EgtGetPhotoPath(m_CurrProjPage.GetPhoto(), sPath)
+ m_MainWindow.m_CadCutPageUC.PostPhoto(sPath)
+ End If
+ ' Recupero il colore
+ Dim Col As New Color3d(64, 192, 255, 40)
+ GetPrivateProfileColor(S_RAWPART, K_RAWCOLOR, Col, m_MainWindow.GetIniFile())
+ ' in presenza di foto rendo molto più trasparente
+ If m_CurrProjPage.GetPhoto() <> GDB_ID.NULL Then
+ Col.A = 20
+ End If
+ ' Se non esiste già il grezzo e richiesto, lo inserisco
+ Dim nRawId As Integer = EgtGetFirstRawPart()
+ If nRawId = GDB_ID.NULL And m_RawHeight > EPS_SMALL Then
+ m_CurrProjPage.m_nRawId = EgtAddRawPart(Point3d.ORIG(), m_RawLength + 2 * m_RawKerf,
+ m_RawWidth + 2 * m_RawKerf, m_RawHeight - DELTAZ_RAW, Col)
+ ' se esiste e da cancellare
+ ElseIf m_RawHeight < EPS_SMALL Then
+ EgtRemoveRawPart(nRawId)
+ m_CurrProjPage.m_nRawId = GDB_ID.NULL
+ ' Altrimenti lo modifico
+ Else
+ m_CurrProjPage.m_nRawId = nRawId
+ EgtModifyRawPart(nRawId, Point3d.ORIG(), m_RawLength + 2 * m_RawKerf,
+ m_RawWidth + 2 * m_RawKerf, m_RawHeight - DELTAZ_RAW, Col)
+ End If
+ UpdateRawPartKerf()
+ ' Sistemo la posizione
+ Dim ptRef As New Point3d(m_RawOffsX - m_RawKerf, m_RawOffsY - m_RawKerf, m_CurrProjPage.m_dAddTable)
+ EgtMoveToCornerRawPart(m_CurrProjPage.m_nRawId, ptRef, MCH_CR.BL)
+ ' Aggiorno visualizzazione
+ EgtZoom(ZM.ALL)
+ End Sub
Private Function UpdateRawPartKerf() As Boolean
' Se non c'è il grezzo, esco
diff --git a/SimulationPageUC.xaml b/SimulationPageUC.xaml
index fecf9f2..8258d2d 100644
--- a/SimulationPageUC.xaml
+++ b/SimulationPageUC.xaml
@@ -6,121 +6,119 @@
mc:Ignorable="d"
d:DesignHeight="853.3" d:DesignWidth="1280" Initialized="SimulationPage_Initialized" Loaded="SimulationPage_Loaded">
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
-
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
+
-
+
diff --git a/SimulationPageUC.xaml.vb b/SimulationPageUC.xaml.vb
index 8894539..b4e489d 100644
--- a/SimulationPageUC.xaml.vb
+++ b/SimulationPageUC.xaml.vb
@@ -16,7 +16,7 @@ Public Class SimulationPageUC
' Stato bottone Play
Private m_bPlay As Boolean = True
- ' Coeeficiente per valore Slider
+ ' Coefficiente per valore Slider
Private m_SliderX As Double = 1
Friend Sub ResetSimulation()
@@ -71,6 +71,10 @@ Public Class SimulationPageUC
' Salvo il progetto con le lavorazioni
Dim sMchPath As String = m_MainWindow.GetTempDir() & "\" & "MachProj.nge"
m_CurrProjPage.SaveFile(sMchPath)
+ ' Nascondo eventuali pezzi in parcheggio
+ HideParkedParts()
+ ' Visualizzo tutta la macchina
+ EgtShowOnlyTable(False)
' Imposto vista 3d isometrica di tutto
EgtSetView(VT.ISO_SE, False)
EgtZoom(ZM.ALL)
@@ -176,11 +180,16 @@ Public Class SimulationPageUC
End Sub
Private Sub ShowCncData()
+ ' Assi
ShowAxisNameVal(0, L1NameTxBl.Text, L1ValueTxBl.Text)
ShowAxisNameVal(1, L2NameTxBl.Text, L2ValueTxBl.Text)
ShowAxisNameVal(2, L3NameTxBl.Text, L3ValueTxBl.Text)
ShowAxisNameVal(3, R1NameTxBl.Text, R1ValueTxBl.Text)
ShowAxisNameVal(4, R2NameTxBl.Text, R2ValueTxBl.Text)
+ ' Tipo di movimento e feed
+ ShowMoveTypeFeed()
+ ' Nome utensile e speed
+ ShowToolNameSpeed()
End Sub
Private Function ShowAxisNameVal(ByVal nInd As Integer, ByRef sName As String, ByRef sVal As String) As Boolean
@@ -197,6 +206,39 @@ Public Class SimulationPageUC
End If
End Function
+ Private Function ShowMoveTypeFeed() As Boolean
+ Dim nG As Integer = 0
+ Dim dFeed As Double = 0
+ If EgtSimGetMoveInfo(nG, dFeed) Then
+ If nG <> 0 Then
+ GCodeTxBl.Text = "G" & nG.ToString()
+ FValueTxBl.Text = "F" & DoubleToString(dFeed, 0)
+ Else
+ GCodeTxBl.Text = "G" & nG.ToString()
+ FValueTxBl.Text = ""
+ End If
+ Return True
+ Else
+ GCodeTxBl.Text = ""
+ FValueTxBl.Text = ""
+ Return False
+ End If
+ End Function
+
+ Private Function ShowToolNameSpeed() As Boolean
+ Dim sTool As String = String.Empty
+ Dim dSpeed As Double = 0
+ If EgtSimGetToolInfo(sTool, dSpeed) Then
+ TNameTxBl.Text = sTool
+ SValueTxBl.Text = "S" & DoubleToString(dSpeed, 0)
+ Return True
+ Else
+ TNameTxBl.Text = ""
+ SValueTxBl.Text = ""
+ Return False
+ End If
+ End Function
+
Private Sub ExitBtnUC_Click(sender As Object, e As RoutedEventArgs)
' Mi assicuro di terminare la simulazione
ResetSimulation()
diff --git a/SingleCutUC.xaml b/SingleCutUC.xaml
index 609ae52..687158d 100644
--- a/SingleCutUC.xaml
+++ b/SingleCutUC.xaml
@@ -41,6 +41,9 @@
HorizontalAlignment="Center" VerticalAlignment="Center" Width="75" TextAlignment="Center"
Style="{StaticResource NumericKeyboard}" />
+
+
diff --git a/SingleCutUC.xaml.vb b/SingleCutUC.xaml.vb
index f6d869f..fab4c9d 100644
--- a/SingleCutUC.xaml.vb
+++ b/SingleCutUC.xaml.vb
@@ -1,12 +1,59 @@
-Public Class SingleCutUC
+Imports EgtUILib
+
+Public Class SingleCutUC
Private m_MainWindow As MainWindow = Application.Current.MainWindow
+ Private m_bPointOk As Boolean = False
+ Private m_ptTip As Point3d
+
+ Private Sub PointBtn_Click(sender As Object, e As RoutedEventArgs) Handles PointBtn.Click
+ SawTipTxBl.Text = String.Empty
+ ' Recupero la posizione macchina
+ Dim nX As Integer = GetPrivateProfileInt(S_AXES, K_L1ID, 0, m_MainWindow.GetMachIniFile())
+ Dim dX As Double = m_MainWindow.m_CNCommunication.m_CN.d_axis_position(nX)
+ Dim nY As Integer = GetPrivateProfileInt(S_AXES, K_L2ID, 1, m_MainWindow.GetMachIniFile())
+ Dim dY As Double = m_MainWindow.m_CNCommunication.m_CN.d_axis_position(nY)
+ Dim nZ As Integer = GetPrivateProfileInt(S_AXES, K_L3ID, 2, m_MainWindow.GetMachIniFile())
+ Dim dZ As Double = m_MainWindow.m_CNCommunication.m_CN.d_axis_position(nZ)
+ Dim nC As Integer = GetPrivateProfileInt(S_AXES, K_R1ID, 8, m_MainWindow.GetMachIniFile())
+ Dim dC As Double = m_MainWindow.m_CNCommunication.m_CN.d_axis_position(nC)
+ Dim nB As Integer = GetPrivateProfileInt(S_AXES, K_R2ID, 7, m_MainWindow.GetMachIniFile())
+ Dim dB As Double = m_MainWindow.m_CNCommunication.m_CN.d_axis_position(nB)
+ ' Imposto la lama corrente
+ Dim sSaw As String = String.Empty
+ GetPrivateProfileString(S_MACH, K_CURRSAW, "", sSaw, m_MainWindow.GetIniFile())
+ If Not EgtSetCalcTool(sSaw, "H1", 1) Then
+ m_bPointOk = False
+ Return
+ End If
+ ' Trasformo in posizione punta utensile in basso
+ If Not EgtGetCalcTipFromPositions(dX, dY, dZ, dC, dB, True, m_ptTip) Then
+ m_bPointOk = False
+ Return
+ End If
+ ' Recupero l'origine della tavola
+ Dim ptOri As Point3d
+ If Not EgtGetTableRef(1, ptOri) Then
+ m_bPointOk = False
+ Return
+ End If
+ ' Porto il tip nell'origine tavola
+ m_ptTip.ToLoc(New Frame3d(ptOri))
+ m_bPointOk = True
+ ' Visualizzo quote
+ Dim sSawTip As String = "X" & DoubleToString(m_ptTip.x, 0) & " Y" & DoubleToString(m_ptTip.y, 0) &
+ " Z" & DoubleToString(m_ptTip.z, 0) & " C" & DoubleToString(dC, 0) &
+ " B" & DoubleToString(dB, 0)
+ SawTipTxBl.Text = sSawTip
+ End Sub
+
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
- m_MainWindow.m_DirectCutPageUC.LeftButtonGrid.Children.Remove(Me)
+
End Sub
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
+ m_bPointOk = False
m_MainWindow.m_DirectCutPageUC.LeftButtonGrid.Children.Remove(Me)
End Sub
diff --git a/ToolsDbPageUC.xaml.vb b/ToolsDbPageUC.xaml.vb
index d3a65d0..eacb581 100644
--- a/ToolsDbPageUC.xaml.vb
+++ b/ToolsDbPageUC.xaml.vb
@@ -222,15 +222,24 @@ Public Class ToolsDbPageUC
m_OldItem = ToolTreeView.SelectedItem
End If
Next
- ' Imposto testa ed uscita del nuovo utensile
+ ' Imposto testa e uscita
+ ' determino il tipo di utensile
Dim nTemp As Integer
- EgtTdbGetCurrToolParam(MCH_TP.TYPE, nTemp)
- If (nTemp And MCH_TF.SAWBLADE) <> 0 Then
- EgtTdbSetCurrToolParam(MCH_TP.HEAD, "H1")
+ EgtTdbGetCurrToolParam(MCH_TP.TYPE, nTemp)
+ Dim bSaw As Boolean = ((nTemp And MCH_TF.SAWBLADE) <> 0)
+ ' Per macchine con ToolChanger lame su H1.1 e altri utensili su H2.1
+ If m_bShowToolChanger Then
+ EgtTdbSetCurrToolParam(MCH_TP.HEAD, If(bSaw, "H1", "H2"))
+ EgtTdbSetCurrToolParam(MCH_TP.EXIT_, 1)
+ ' Altrimenti lame su H1.1 e altri utensili su H1.2
Else
- EgtTdbSetCurrToolParam(MCH_TP.HEAD, "H2")
+ EgtTdbSetCurrToolParam(MCH_TP.HEAD, "H1")
+ EgtTdbSetCurrToolParam(MCH_TP.EXIT_, If(bSaw, 1, 2))
+ End If
+ ' Per macchine senza ToolChanger, resetto la posizione su questo
+ If Not m_bShowToolChanger Then
+ EgtTdbSetCurrToolParam(MCH_TP.TCPOS, "")
End If
- EgtTdbSetCurrToolParam(MCH_TP.EXIT_, 1)
EgtTdbSaveCurrTool()
GetToolParams()
ViewToolParams()