OmagCUT 1.6k10 :
- aggiornamenti e migliorie varie.
This commit is contained in:
@@ -64,6 +64,11 @@
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
<TextBlock Name="SafeZTxBl" Grid.Column="0" Grid.Row="2" FontSize="20" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" />
|
||||
<TextBox Name="SafeZTxBx" Grid.Column="1" Grid.Row="2" FontSize="20"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center" Width="150" TextAlignment="Center" />
|
||||
|
||||
</Grid>
|
||||
|
||||
<TextBlock Name="NCErrorMessages" Grid.ColumnSpan="3" FontSize="22" Width="1000"
|
||||
|
||||
+30
-4
@@ -22,18 +22,17 @@ Public Class AlarmsPageUC
|
||||
'Imposto i messaggi letti dal file dei messaggi
|
||||
CurrSawTxBl.Text = "Lama corrente"
|
||||
AuxiliaryToolTxBl.Text = "Secondo utensile"
|
||||
SafeZTxBl.Text = "Distanza di sicurezza"
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub AlarmsPage_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
If m_bFirst Then
|
||||
End If
|
||||
|
||||
If Not m_MainWindow.m_bNCLink = 0 Then
|
||||
ErrorLstBx.ItemsSource = m_CN.sz_NC_error_messages
|
||||
End If
|
||||
|
||||
'Aggiorno lista delle lame per pagina macchina in cui scegliere quella corrente
|
||||
' Aggiorno lista delle lame per pagina macchina in cui scegliere quella corrente
|
||||
SawList.Clear()
|
||||
Dim ToolName As String = String.Empty
|
||||
Dim nType As Integer = MCH_TY.NONE
|
||||
@@ -44,10 +43,15 @@ Public Class AlarmsPageUC
|
||||
End While
|
||||
End If
|
||||
|
||||
'Leggo lama corrente da file ini
|
||||
' Leggo lama corrente da file ini
|
||||
GetPrivateProfileString(S_MACH, K_CURRSAW, "", ToolName, m_MainWindow.GetIniFile())
|
||||
CurrSawCmBx.SelectedItem = ToolName
|
||||
|
||||
' Leggo distanza di sicurezza
|
||||
Dim dSafeZ As Double = 0
|
||||
EgtMdbGetSafeZ(dSafeZ)
|
||||
SafeZTxBx.Text = dSafeZ
|
||||
|
||||
End Sub
|
||||
|
||||
Friend Sub NcError()
|
||||
@@ -85,4 +89,26 @@ Public Class AlarmsPageUC
|
||||
m_MainWindow.m_CurrentProjectPageUC.ToolTxBx.Text = CurrSawCmBx.SelectedItem
|
||||
End Sub
|
||||
|
||||
Private Sub SafeZTxBx_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs) Handles SafeZTxBx.PreviewMouseDown
|
||||
|
||||
' Lancio calcolatrice
|
||||
Dim NumericKeyboardWD As New NumericKeyboardWD
|
||||
NumericKeyboardWD.Owner = m_MainWindow
|
||||
NumericKeyboardWD.NumericKeyboardWDTitle.Text = SafeZTxBl.Text
|
||||
NumericKeyboardWD.NumericKeyboardWDTextBox.Text = SafeZTxBx.Text
|
||||
' Text box per valore di ritorno
|
||||
NumericKeyboardWD.m_CurrentTxBx = SafeZTxBx
|
||||
' Imposto Dimensioni e posizione della calcolatrice
|
||||
NumericKeyboardWD.Top = m_MainWindow.Top + (m_MainWindow.Height / 12)
|
||||
NumericKeyboardWD.Left = m_MainWindow.Left + (m_MainWindow.Width / 15 * 3)
|
||||
NumericKeyboardWD.Height = m_MainWindow.Height / 12 * 5
|
||||
NumericKeyboardWD.Width = m_MainWindow.Width / 15 * 5
|
||||
' Visualizzo calcolatrice
|
||||
Dim bRes As Boolean = NumericKeyboardWD.ShowDialog()
|
||||
' Se nuovo valore
|
||||
If bRes Then
|
||||
EgtMdbSetSafeZ(NumericKeyboardWD.m_DoubleResult)
|
||||
EgtMdbSave()
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
+2
-2
@@ -21,8 +21,8 @@ Public Class CNCommunication
|
||||
'Classe del CN
|
||||
Public WithEvents m_CN As CN_generico
|
||||
|
||||
Private m_bNewPosData As Boolean = False
|
||||
Private m_bNewDeltaData As Boolean = False
|
||||
Private m_bNewPosData As Boolean = True
|
||||
Private m_bNewDeltaData As Boolean = True
|
||||
Private m_bNewVarData As Boolean = False
|
||||
Private m_bTimerBusy As Boolean = False
|
||||
|
||||
|
||||
@@ -192,8 +192,8 @@ Public Class CadCutPageUC
|
||||
' Salvo il progetto con le lavorazioni
|
||||
Dim sMchPath As String = m_MainWindow.GetTempDir() & "\" & "MachProj.nge"
|
||||
m_MainWindow.m_CurrentProjectPageUC.SaveFile(sMchPath)
|
||||
' Genero file CNC
|
||||
bOk = bOk AndAlso EgtGenerate(m_MainWindow.GetCncDir() & "\CadCut.xpi", "OmagCut")
|
||||
' Genero file CNC (lancio anche se errore in precedenza)
|
||||
bOk = EgtGenerate(m_MainWindow.GetCncDir() & "\CadCut.xpi", "OmagCut") And bOk
|
||||
' Riporto il progetto allo stato iniziale
|
||||
EgtRemoveAllOperations()
|
||||
' Abilito impostazione modificato
|
||||
@@ -208,13 +208,14 @@ Public Class CadCutPageUC
|
||||
End If
|
||||
' Download programma
|
||||
If m_MainWindow.m_bNCLink Then
|
||||
m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_Reset()
|
||||
If m_MainWindow.m_CNCommunication.m_nNCType = 1 Then
|
||||
bOk = (m_MainWindow.m_CNCommunication.m_CN.Delete_NC_prog("%900.0") = 0)
|
||||
bOk = bOk AndAlso (m_MainWindow.m_CNCommunication.m_CN.Delete_NC_prog("%900.0") = 0)
|
||||
End If
|
||||
bOk = bOk AndAlso (m_MainWindow.m_CNCommunication.m_CN.Download_NC_prog(m_MainWindow.GetCncDir() & "\CadCut.xpi", "%900.0") = 0)
|
||||
bOk = bOk AndAlso (m_MainWindow.m_CNCommunication.m_CN.Start_Transfer_NC_prog() = 0)
|
||||
' Attesa opportuna
|
||||
System.Threading.Thread.Sleep(100)
|
||||
System.Threading.Thread.Sleep(5000)
|
||||
' Attivazione programma
|
||||
bOk = bOk AndAlso (m_MainWindow.m_CNCommunication.m_CN.ActivateProgram(900) = 0)
|
||||
' Modalità automatica
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
Public Const MSG_ROWPARTPAGEUC As Integer = MSG_OMAGCUT + 500
|
||||
Public Const MSG_FRAMECUTPAGEUC As Integer = MSG_OMAGCUT + 600
|
||||
Public Const MSG_MACHINEPAGEUC As Integer = MSG_OMAGCUT + 700
|
||||
Public Const MSG_TOOLSDBPAGEUC As Integer = MSG_OMAGCUT + 730
|
||||
Public Const MSG_TOOLSDBPAGEUC As Integer = MSG_OMAGCUT + 720
|
||||
Public Const MSG_MACHININGSDBPAGEUC As Integer = MSG_OMAGCUT + 760
|
||||
Public Const MSG_ALARMSPAGEUC As Integer = MSG_OMAGCUT + 800
|
||||
Public Const MSG_OPTIONSPAGEUC As Integer = MSG_OMAGCUT + 900
|
||||
|
||||
@@ -286,6 +286,8 @@ Public Class CurrentProjectPageUC
|
||||
If Not EgtSetTable(MAIN_TAB) Then
|
||||
Return False
|
||||
End If
|
||||
' Aggiungo eventuale sovratavola
|
||||
AddAdditionalTable()
|
||||
End If
|
||||
' Visualizzo solo la tavola della macchina
|
||||
EgtShowOnlyTable(True)
|
||||
|
||||
+23
-12
@@ -46,39 +46,50 @@ Public Class MachineButtonsUC
|
||||
Private Sub MachineButton_Click(sender As Object, e As RoutedEventArgs) Handles MachineButton1.Click, MachineButton2.Click, MachineButton3.Click, MachineButton4.Click, MachineButton5.Click, MachineButton6.Click, MachineButton7.Click,
|
||||
MachineButton8.Click, MachineButton9.Click, MachineButton10.Click, MachineButton11.Click, MachineButton12.Click, MachineButton13.Click
|
||||
Dim CurrentBtn As Button = e.Source
|
||||
Dim nTemp As Integer = 0
|
||||
Dim dTemp As Double = 0
|
||||
Dim sTemp As String = String.Empty
|
||||
Dim b2Start As Boolean = False
|
||||
Dim CmdString As String = String.Empty
|
||||
EgtLuaExecFile(m_MainWindow.GetMachinesRootDir() & "\" & m_MainWindow.GetCurrMachine() & "\DirectCmd\" & CommandArray(GetButtonIndex(CurrentBtn) - 1))
|
||||
StringToDouble(m_DirectCutPage.m_ManualAxesMove.FeedTxBx.Text, dTemp)
|
||||
EgtLuaSetGlobNumVar("CMD.F", dTemp)
|
||||
StringToDouble(m_DirectCutPage.m_ManualAxesMove.SpeedTxBx.Text, dTemp)
|
||||
EgtLuaSetGlobNumVar("CMD.S", dTemp)
|
||||
GetPrivateProfileString(S_AXES, K_L1ID, "", sTemp, m_MainWindow.GetMachIniFile())
|
||||
StringToDouble(m_MainWindow.m_CNCommunication.m_CN.d_axis_position(sTemp), dTemp)
|
||||
nTemp = GetPrivateProfileInt(S_AXES, K_L1ID, 0, m_MainWindow.GetMachIniFile())
|
||||
dTemp = m_CN.d_axis_position(nTemp)
|
||||
EgtLuaSetGlobNumVar("CMD.L1", dTemp)
|
||||
GetPrivateProfileString(S_AXES, K_L2ID, "", sTemp, m_MainWindow.GetMachIniFile())
|
||||
StringToDouble(m_MainWindow.m_CNCommunication.m_CN.d_axis_position(sTemp), dTemp)
|
||||
nTemp = GetPrivateProfileInt(S_AXES, K_L2ID, 1, m_MainWindow.GetMachIniFile())
|
||||
dTemp = m_CN.d_axis_position(nTemp)
|
||||
EgtLuaSetGlobNumVar("CMD.L2", dTemp)
|
||||
GetPrivateProfileString(S_AXES, K_L3ID, "", sTemp, m_MainWindow.GetMachIniFile())
|
||||
StringToDouble(m_MainWindow.m_CNCommunication.m_CN.d_axis_position(sTemp), dTemp)
|
||||
nTemp = GetPrivateProfileInt(S_AXES, K_L3ID, 2, m_MainWindow.GetMachIniFile())
|
||||
dTemp = m_CN.d_axis_position(nTemp)
|
||||
EgtLuaSetGlobNumVar("CMD.L3", dTemp)
|
||||
GetPrivateProfileString(S_AXES, K_R1ID, "", sTemp, m_MainWindow.GetMachIniFile())
|
||||
StringToDouble(m_MainWindow.m_CNCommunication.m_CN.d_axis_position(sTemp), dTemp)
|
||||
nTemp = GetPrivateProfileInt(S_AXES, K_R1ID, 8, m_MainWindow.GetMachIniFile())
|
||||
dTemp = m_CN.d_axis_position(nTemp)
|
||||
EgtLuaSetGlobNumVar("CMD.R1", dTemp)
|
||||
GetPrivateProfileString(S_AXES, K_R2ID, "", sTemp, m_MainWindow.GetMachIniFile())
|
||||
StringToDouble(m_MainWindow.m_CNCommunication.m_CN.d_axis_position(sTemp), dTemp)
|
||||
nTemp = GetPrivateProfileInt(S_AXES, K_R2ID, 7, m_MainWindow.GetMachIniFile())
|
||||
dTemp = m_CN.d_axis_position(nTemp)
|
||||
EgtLuaSetGlobNumVar("CMD.R2", dTemp)
|
||||
EgtLuaExecLine("CmdString()")
|
||||
' Leggo variabili
|
||||
EgtLuaGetGlobStringVar("CMD.CMDSTRING", CmdString)
|
||||
EgtLuaGetGlobBoolVar("CMD.DOUBLESTART", b2Start)
|
||||
' Reset lua
|
||||
EgtLuaResetGlobVar("CmdString")
|
||||
EgtLuaResetGlobVar("CMD")
|
||||
|
||||
m_CN.DGeneralFunctions_WriteCncMode(2)
|
||||
m_CN.DGeneralFunctions_WriteCncMode(2) ' Modalità MDI
|
||||
System.Threading.Thread.Sleep(150)
|
||||
m_CN.sz_ManualDataInput = CmdString
|
||||
m_CN.MDI_command()
|
||||
System.Threading.Thread.Sleep(150)
|
||||
m_CN.DGeneralFunctions_CycleStart()
|
||||
m_CN.DGeneralFunctions_WriteCncMode(7)
|
||||
If b2Start Then
|
||||
System.Threading.Thread.Sleep(150)
|
||||
m_CN.DGeneralFunctions_CycleStart()
|
||||
End If
|
||||
m_CN.DGeneralFunctions_WriteCncMode(7) ' Modalità manuale
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ Public Class MachiningDbPageUC
|
||||
Dim ExtLinkType() As String = {"Centrato", "Esteso precedente", "Esteso successivo", "Estesi entrambi"}
|
||||
Dim LeadOutType() As String = {"Centrata", "Interna", "Esterna"}
|
||||
Dim CurveUse() As String = {"Salta", "Approssima", "Convesso"}
|
||||
Dim StepType() As String = {"Step", "Una via", "Spirale"}
|
||||
Dim StepType() As String = {"Zig zag", "Una via", "Va e Vieni"}
|
||||
Dim SawTool As New List(Of String)
|
||||
Dim DrillTool As New List(Of String)
|
||||
|
||||
@@ -306,7 +306,7 @@ Public Class MachiningDbPageUC
|
||||
End Select
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.TOOL, ToolString)
|
||||
Dim bToolExist As Boolean = False
|
||||
For Each CurrTool In SawTool
|
||||
For Each CurrTool In ToolCmBx.ItemsSource
|
||||
If CurrTool = ToolString Then
|
||||
bToolExist = True
|
||||
Exit For
|
||||
@@ -379,16 +379,24 @@ Public Class MachiningDbPageUC
|
||||
SideBrd.Visibility = Windows.Visibility.Visible
|
||||
TypeBrd.Visibility = Windows.Visibility.Visible
|
||||
CurveBrd.Visibility = Windows.Visibility.Visible
|
||||
StartPosTxBl.Visibility = Windows.Visibility.Hidden
|
||||
StartPosTxBx.Visibility = Windows.Visibility.Hidden
|
||||
StartPosTxBl.Visibility = Windows.Visibility.Visible
|
||||
StartPosTxBx.Visibility = Windows.Visibility.Visible
|
||||
StartPosTxBl.SetValue(Grid.ColumnProperty, 0)
|
||||
StartPosTxBl.SetValue(Grid.RowProperty, 7)
|
||||
StartPosTxBx.SetValue(Grid.ColumnProperty, 1)
|
||||
StartPosTxBx.SetValue(Grid.RowProperty, 7)
|
||||
StartsLowLenTxBl.Visibility = Windows.Visibility.Hidden
|
||||
StartsLowLenTxBx.Visibility = Windows.Visibility.Hidden
|
||||
EndsLowLenTxBl.Visibility = Windows.Visibility.Hidden
|
||||
EndsLowLenTxBx.Visibility = Windows.Visibility.Hidden
|
||||
ThrouAddLenTxBl.Visibility = Windows.Visibility.Hidden
|
||||
ThrouAddLenTxBx.Visibility = Windows.Visibility.Hidden
|
||||
StepTxBl.Visibility = Windows.Visibility.Hidden
|
||||
StepTxBx.Visibility = Windows.Visibility.Hidden
|
||||
StepTxBl.Visibility = Windows.Visibility.Visible
|
||||
StepTxBx.Visibility = Windows.Visibility.Visible
|
||||
StepTxBl.SetValue(Grid.ColumnProperty, 2)
|
||||
StepTxBl.SetValue(Grid.RowProperty, 7)
|
||||
StepTxBx.SetValue(Grid.ColumnProperty, 3)
|
||||
StepTxBx.SetValue(Grid.RowProperty, 7)
|
||||
ReturnPosTxBl.Visibility = Windows.Visibility.Hidden
|
||||
ReturnPosTxBx.Visibility = Windows.Visibility.Hidden
|
||||
Case MCH_MY.DRILLING 'Parametri Foratura
|
||||
@@ -403,6 +411,10 @@ Public Class MachiningDbPageUC
|
||||
CurveBrd.Visibility = Windows.Visibility.Hidden
|
||||
StartPosTxBl.Visibility = Windows.Visibility.Visible
|
||||
StartPosTxBx.Visibility = Windows.Visibility.Visible
|
||||
StartPosTxBl.SetValue(Grid.ColumnProperty, 0)
|
||||
StartPosTxBl.SetValue(Grid.RowProperty, 2)
|
||||
StartPosTxBx.SetValue(Grid.ColumnProperty, 1)
|
||||
StartPosTxBx.SetValue(Grid.RowProperty, 2)
|
||||
StartsLowLenTxBl.Visibility = Windows.Visibility.Visible
|
||||
StartsLowLenTxBx.Visibility = Windows.Visibility.Visible
|
||||
EndsLowLenTxBl.Visibility = Windows.Visibility.Visible
|
||||
@@ -411,6 +423,10 @@ Public Class MachiningDbPageUC
|
||||
ThrouAddLenTxBx.Visibility = Windows.Visibility.Visible
|
||||
StepTxBl.Visibility = Windows.Visibility.Visible
|
||||
StepTxBx.Visibility = Windows.Visibility.Visible
|
||||
StepTxBl.SetValue(Grid.ColumnProperty, 0)
|
||||
StepTxBl.SetValue(Grid.RowProperty, 4)
|
||||
StepTxBx.SetValue(Grid.ColumnProperty, 1)
|
||||
StepTxBx.SetValue(Grid.RowProperty, 4)
|
||||
ReturnPosTxBl.Visibility = Windows.Visibility.Visible
|
||||
ReturnPosTxBx.Visibility = Windows.Visibility.Visible
|
||||
End Select
|
||||
|
||||
@@ -26,18 +26,28 @@ Public Class ManualAxesMoveUC
|
||||
End Sub
|
||||
|
||||
Private Sub ManualAxesMove_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
|
||||
Dim dTemp As Double
|
||||
Dim nTemp As Integer = 0
|
||||
Dim dTemp As Double = 0
|
||||
' Leggo feed e speed da lama corrente
|
||||
EgtTdbSetCurrTool(m_MainWindow.m_CurrentProjectPageUC.ToolTxBx.Text)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.SPEED, dTemp)
|
||||
SpeedTxBx.Text = dTemp
|
||||
EgtTdbGetCurrToolParam(MCH_TP.FEED, dTemp)
|
||||
FeedTxBx.Text = dTemp
|
||||
|
||||
EgtTdbGetCurrToolParam(MCH_TP.SPEED, dTemp)
|
||||
SpeedTxBx.Text = dTemp
|
||||
' Agli assi lineari assegno '0' (sono incrementali)
|
||||
L1TxBx.Text = "0"
|
||||
L2TxBx.Text = "0"
|
||||
L3TxBx.Text = "0"
|
||||
' Agli assi rotanti assegno i valori macchina
|
||||
nTemp = GetPrivateProfileInt(S_AXES, K_R1ID, 8, m_MainWindow.GetMachIniFile())
|
||||
R1TxBx.Text = DoubleToString(m_CN.d_axis_position(nTemp), 3)
|
||||
nTemp = GetPrivateProfileInt(S_AXES, K_R2ID, 7, m_MainWindow.GetMachIniFile())
|
||||
R2TxBx.Text = DoubleToString(m_CN.d_axis_position(nTemp), 3)
|
||||
End Sub
|
||||
|
||||
Private Sub L1Btn_Click(sender As Object, e As RoutedEventArgs) Handles L1Btn.Click, L2Btn.Click, L3Btn.Click, R1Btn.Click, R2Btn.Click
|
||||
Dim CurrentBtn As Button = e.Source
|
||||
Dim nTemp As Integer = 0
|
||||
Dim dTemp As Double = 0
|
||||
Dim CmdString As String = String.Empty
|
||||
EgtLuaExecFile(m_MainWindow.GetMachinesRootDir() & "\" & m_MainWindow.GetCurrMachine() & "\DirectCmd\AxesMove.lua")
|
||||
@@ -45,6 +55,26 @@ Public Class ManualAxesMoveUC
|
||||
EgtLuaSetGlobNumVar("CMD.F", dTemp)
|
||||
StringToDouble(SpeedTxBx.Text, dTemp)
|
||||
EgtLuaSetGlobNumVar("CMD.S", dTemp)
|
||||
' Leggo gli assi lineari rispetto allo 0 pezzo (per essere compatibile con G150)
|
||||
m_CN.set_OP_OM(1)
|
||||
System.Threading.Thread.Sleep(500)
|
||||
nTemp = GetPrivateProfileInt(S_AXES, K_L1ID, 0, m_MainWindow.GetMachIniFile())
|
||||
dTemp = m_CN.d_axis_position(nTemp)
|
||||
EgtLuaSetGlobNumVar("CMD.L1", dTemp)
|
||||
nTemp = GetPrivateProfileInt(S_AXES, K_L2ID, 1, m_MainWindow.GetMachIniFile())
|
||||
dTemp = m_CN.d_axis_position(nTemp)
|
||||
EgtLuaSetGlobNumVar("CMD.L2", dTemp)
|
||||
nTemp = GetPrivateProfileInt(S_AXES, K_L3ID, 2, m_MainWindow.GetMachIniFile())
|
||||
dTemp = m_CN.d_axis_position(nTemp)
|
||||
EgtLuaSetGlobNumVar("CMD.L3", dTemp)
|
||||
' Ritorno a leggere dallo 0 macchina
|
||||
m_CN.set_OP_OM(0)
|
||||
nTemp = GetPrivateProfileInt(S_AXES, K_R1ID, 8, m_MainWindow.GetMachIniFile())
|
||||
dTemp = m_CN.d_axis_position(nTemp)
|
||||
EgtLuaSetGlobNumVar("CMD.R1", dTemp)
|
||||
nTemp = GetPrivateProfileInt(S_AXES, K_R2ID, 7, m_MainWindow.GetMachIniFile())
|
||||
dTemp = m_CN.d_axis_position(nTemp)
|
||||
EgtLuaSetGlobNumVar("CMD.R2", dTemp)
|
||||
EgtLuaSetGlobStringVar("CMD.AXISNAME", GetAxisName(CurrentBtn))
|
||||
StringToDouble(GetAxisMove(CurrentBtn), dTemp)
|
||||
EgtLuaSetGlobStringVar("CMD.AXISMOVE", dTemp)
|
||||
@@ -53,9 +83,11 @@ Public Class ManualAxesMoveUC
|
||||
EgtLuaResetGlobVar("CmdString")
|
||||
EgtLuaResetGlobVar("CMD")
|
||||
|
||||
m_CN.DGeneralFunctions_WriteCncMode(2)
|
||||
m_CN.DGeneralFunctions_WriteCncMode(2) ' Modalità MDI
|
||||
System.Threading.Thread.Sleep(150)
|
||||
m_CN.sz_ManualDataInput = CmdString
|
||||
m_CN.MDI_command()
|
||||
System.Threading.Thread.Sleep(150)
|
||||
m_CN.DGeneralFunctions_CycleStart()
|
||||
m_CN.DGeneralFunctions_WriteCncMode(7)
|
||||
|
||||
|
||||
@@ -55,5 +55,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.6.11.9")>
|
||||
<Assembly: AssemblyFileVersion("1.6.11.9")>
|
||||
<Assembly: AssemblyVersion("1.6.11.10")>
|
||||
<Assembly: AssemblyFileVersion("1.6.11.10")>
|
||||
|
||||
+2
-4
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
+75
-75
@@ -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
|
||||
|
||||
+97
-99
@@ -6,121 +6,119 @@
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="853.3" d:DesignWidth="1280" Initialized="SimulationPage_Initialized" Loaded="SimulationPage_Loaded">
|
||||
|
||||
<!-- Chiamata al Dictionary -->
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary Source="OmagCUTDictionary.xaml"></ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
<!-- Chiamata al Dictionary -->
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary Source="OmagCUTDictionary.xaml"></ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
|
||||
<!-- Definizione della SimulationPage -->
|
||||
<Grid Name="SimulationPageGrid" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="12*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<!-- Definizione della SimulationPage -->
|
||||
<Grid Name="SimulationPageGrid" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="12*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="8*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Definizione della Grid superiore -->
|
||||
<Grid Name="UpperButtonGrid" Grid.Column="1" Grid.Row="0" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="5*"/>
|
||||
<ColumnDefinition Width="7*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
</Grid>
|
||||
|
||||
<!-- Definizione della Grid Laterale -->
|
||||
<Grid Name="VariablesCompoGrid" Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="8*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Definizione della Grid superiore -->
|
||||
<Grid Name="UpperButtonGrid" Grid.Column="1" Grid.Row="0" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="5*"/>
|
||||
<ColumnDefinition Width="7*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Name="L1NameTxBl" Grid.Column="0" Grid.Row="1" FontSize="20" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" />
|
||||
<TextBlock Name="L1ValueTxBl" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center" TextAlignment="Right" Margin="0,0,50,0" />
|
||||
<TextBlock Name="L2NameTxBl" Grid.Column="0" Grid.Row="2" FontSize="20" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" />
|
||||
<TextBlock Name="L2ValueTxBl" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center" TextAlignment="Right" Margin="0,0,50,0" />
|
||||
<TextBlock Name="L3NameTxBl" Grid.Column="0" Grid.Row="3" FontSize="20" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" />
|
||||
<TextBlock Name="L3ValueTxBl" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center" TextAlignment="Right" Margin="0,0,50,0" />
|
||||
<TextBlock Name="R1NameTxBl" Grid.Column="0" Grid.Row="4" FontSize="20" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" />
|
||||
<TextBlock Name="R1ValueTxBl" Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center" TextAlignment="Right" Margin="0,0,50,0" />
|
||||
<TextBlock Name="R2NameTxBl" Grid.Column="0" Grid.Row="5" FontSize="20" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" />
|
||||
<TextBlock Name="R2ValueTxBl" Grid.Column="1" Grid.Row="5" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center" TextAlignment="Right" Margin="0,0,50,0" />
|
||||
<TextBlock Name="GCodeTxBl" Grid.Column="0" Grid.Row="6" FontSize="20" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" TextAlignment="Center" />
|
||||
<TextBlock Name="FValueTxBl" Grid.Column="1" Grid.Row="6" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center" TextAlignment="Right" Margin="0,0,50,0" />
|
||||
<TextBlock Name="TNameTxBl" Grid.Column="0" Grid.Row="7" FontSize="20" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" TextAlignment="Center" Margin="0,0,-50,0" />
|
||||
<TextBlock Name="SValueTxBl" Grid.Column="1" Grid.Row="7" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center" TextAlignment="Right" Margin="0,0,50,0" />
|
||||
|
||||
</Grid>
|
||||
|
||||
<!-- Definizione della Grid Laterale -->
|
||||
<Grid Name="VariablesCompoGrid" Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="L1NameTxBl" Grid.Column="0" Grid.Row="1" FontSize="20" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" />
|
||||
<TextBlock Name="L1ValueTxBl" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center" TextAlignment="Right" Margin="0,0,50,0" />
|
||||
<TextBlock Name="L2NameTxBl" Grid.Column="0" Grid.Row="2" FontSize="20" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" />
|
||||
<TextBlock Name="L2ValueTxBl" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center" TextAlignment="Right" Margin="0,0,50,0" />
|
||||
<TextBlock Name="L3NameTxBl" Grid.Column="0" Grid.Row="3" FontSize="20" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" />
|
||||
<TextBlock Name="L3ValueTxBl" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center" TextAlignment="Right" Margin="0,0,50,0" />
|
||||
<TextBlock Name="R1NameTxBl" Grid.Column="0" Grid.Row="4" FontSize="20" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" />
|
||||
<TextBlock Name="R1ValueTxBl" Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center" TextAlignment="Right" Margin="0,0,50,0" />
|
||||
<TextBlock Name="R2NameTxBl" Grid.Column="0" Grid.Row="5" FontSize="20" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" />
|
||||
<TextBlock Name="R2ValueTxBl" Grid.Column="1" Grid.Row="5" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center" TextAlignment="Right" Margin="0,0,50,0" />
|
||||
<TextBlock Name="GCodeTxBl" Grid.Column="0" Grid.Row="6" FontSize="20" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" />
|
||||
<TextBlock Name="FNameTxBl" Grid.Column="1" Grid.Row="6" FontSize="20" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" />
|
||||
<TextBlock Name="FValueTxBl" Grid.Column="2" Grid.Row="6" FontSize="20" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" />
|
||||
<TextBlock Name="SNameTxBl" Grid.Column="0" Grid.Row="7" FontSize="20" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" />
|
||||
<TextBlock Name="SValueTxBl" Grid.Column="1" Grid.Row="7" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" />
|
||||
|
||||
<Button Name="HomeBtn" Grid.Column="0" Grid.Row="9" >
|
||||
<Image Source="Resources/IndietroVeloce.png" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
<Button Name="HomeBtn" Grid.Column="0" Grid.Row="9" >
|
||||
<Image Source="Resources/IndietroVeloce.png" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</Button>
|
||||
</Button>
|
||||
|
||||
<Button Name="PlayPauseBtn" Grid.Column="1" Grid.Row="9" >
|
||||
<Image Name="PlayPauseImage" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
<Button Name="PlayPauseBtn" Grid.Column="1" Grid.Row="9" >
|
||||
<Image Name="PlayPauseImage" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</Button>
|
||||
</Button>
|
||||
|
||||
<Button Name="StopBtn" Grid.Column="2" Grid.Row="9" >
|
||||
<Image Source="Resources/Stop.png" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
<Button Name="StopBtn" Grid.Column="2" Grid.Row="9" >
|
||||
<Image Source="Resources/Stop.png" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</Button>
|
||||
</Button>
|
||||
|
||||
<Slider Name="SpeedSlider" Grid.Row="11" Grid.ColumnSpan="3" Width="230" Height="40" Minimum="1" Maximum="100" TickPlacement="BottomRight" TickFrequency="10" ValueChanged="SpeedSlider_ValueChanged" />
|
||||
<Slider Name="SpeedSlider" Grid.Row="11" Grid.ColumnSpan="3" Width="230" Height="40" Minimum="1" Maximum="100" TickPlacement="BottomRight" TickFrequency="10" ValueChanged="SpeedSlider_ValueChanged" />
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<TextBlock Name="OutMessageLbl" Grid.Row="2" Width="240" Height="60" FontSize="22" TextAlignment="Center" TextWrapping="Wrap" />
|
||||
<TextBlock Name="OutMessageLbl" Grid.Row="2" Width="240" Height="60" FontSize="22" TextAlignment="Center" TextWrapping="Wrap" />
|
||||
|
||||
<!-- Definizione della Grid Inferiore per i Button V e X -->
|
||||
<Grid Name="LowerButtonGrid" Grid.Column="1" Grid.Row="3">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="10*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Grid.Column="2" Click="ExitBtnUC_Click" >
|
||||
<Image Source="Resources/V.png" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
<!-- Definizione della Grid Inferiore per i Button V e X -->
|
||||
<Grid Name="LowerButtonGrid" Grid.Column="1" Grid.Row="3">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="10*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Grid.Column="2" Click="ExitBtnUC_Click" >
|
||||
<Image Source="Resources/V.png" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</Button>
|
||||
</Button>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -41,6 +41,9 @@
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center" Width="75" TextAlignment="Center"
|
||||
Style="{StaticResource NumericKeyboard}" />
|
||||
|
||||
<TextBlock Name="SawTipTxBl" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="2" FontSize="18" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" Text="" />
|
||||
|
||||
|
||||
<Button Name="OkBtn" Grid.Column="0" Grid.Row="6" FontSize="20" Content="Esegui"/>
|
||||
|
||||
|
||||
+49
-2
@@ -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
|
||||
|
||||
|
||||
+15
-6
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user