Compare commits

...

33 Commits

Author SHA1 Message Date
Nicola Pievani 4c282d7531 Abilito visualizzazione pulsante per inserimento FrameCompo 2023-05-18 11:13:40 +02:00
Nicola Pievani a941f963c2 Disabilito i comandi dei compo piani 2023-05-16 10:31:58 +02:00
Nicola Pievani eab341d7fe Importazione FrameCompo 2023-05-15 19:37:31 +02:00
Nicola Pievani acb8ceed4d Merge branch 'Features/Other_Ref_On_Table' into develop 2023-05-09 17:15:22 +02:00
Nicola Pievani 65d8f58b45 Migliorata impaginazione dati e disegno RefTab 2023-05-09 17:15:10 +02:00
Nicola Pievani 07cf7ced42 Definizione nuovp roferimento su stavola 2023-05-08 20:04:56 +02:00
Nicola Pievani b1410ca11c Aggiunti parametri TCPOS e DIAM per comandi diretti 2023-05-05 13:12:15 +02:00
Nicola Pievani 1975f46995 Merge branch 'Features/Probing_Polishing_Tool' into develop 2023-05-04 14:55:56 +02:00
Nicola Pievani 6863186e07 Aggiunto nuovo parametro per tastatura 2023-05-04 14:37:17 +02:00
Nicola Pievani b434f80030 Correzione gestione Z safe, cambio versione 2.5e1 2023-05-03 18:09:58 +02:00
Nicola Pievani 959fb2e44f Aggiornamento versione 2.5d3 2023-04-28 12:43:13 +02:00
Nicola Pievani 941e7837be Aggiunta variabile DripFeed al CN_generico per NumOld 2023-04-28 12:16:28 +02:00
Nicola Pievani 680505af10 Merge branch 'Features/CN_Fanuc' into develop 2023-04-19 16:44:38 +02:00
Nicola Pievani b0bfa67d2a Aggiornamento assi macchina in taglio singolo 2023-04-19 16:44:04 +02:00
Nicola Pievani 29d8c1e29b Nascondo pezzi in parcheggio dopo ripristino fase 1 2023-04-19 13:20:45 +02:00
Nicola Pievani e5d4f223f8 Gestione generazione CN durante simulazione 2023-04-18 18:08:03 +02:00
Nicola Pievani 3cfc7276c9 Gestione scrittura valore FeedHold letto da configurazione 2023-04-18 15:53:28 +02:00
Nicola Pievani 0c0233b27e Correzione generazione CN in simulazione 2023-04-18 15:12:07 +02:00
Nicola Pievani 4e8925515d Corretto il valore di ritorno di alcune funzioni 2023-04-18 12:37:42 +02:00
Nicola Pievani 3b552b2f4e Disabilito inversione tagli diretti 2023-04-17 18:27:38 +02:00
Nicola Pievani 0d4d853834 Salvataggio nelle info progetto C axes home 2023-04-13 15:13:08 +02:00
Nicola Pievani 37fcbe8240 Aggiornato disegno ToolChangerPos 2023-04-13 11:14:27 +02:00
Nicola Pievani 4393f282b7 Aggiornamento di versione 2.5d2 2023-04-12 12:09:23 +02:00
Nicola Pievani 6844a8c77c Merge branch 'Features/CN_Fanuc' into develop 2023-04-12 12:07:41 +02:00
Nicola Pievani 659405c52f Testato codice con controllo FANUC 2023-04-12 12:07:04 +02:00
Nicola Pievani 6905a8d6dc Aggiornamento versione 2023-04-07 10:01:07 +02:00
Nicola Pievani d8ba23894e Merge branch 'Features/CN_Fanuc' into develop 2023-04-07 09:55:49 +02:00
Nicola Pievani aba1572f95 Gestione comunicazione FANUC 2023-04-07 09:55:29 +02:00
Nicola Pievani fdb0ed598b Aggiunto commento 2023-03-27 18:51:22 +02:00
Nicola Pievani 4cb3518346 Gestione lettura variabili Vacuum 2023-03-27 18:50:33 +02:00
Nicola Pievani 56b8ee88d3 Inseriti commenti nella nuove classi Fanuc 2023-03-27 15:38:27 +02:00
Nicola Pievani d0439f2b05 Configurazione cn FANUC 2023-03-27 11:40:36 +02:00
Nicola Pievani 997e8c380d Migliorata gestione pulsantiera comandi diretti 2023-03-20 14:52:28 +01:00
42 changed files with 15489 additions and 339 deletions
+2
View File
@@ -189,6 +189,8 @@ Module ConstGen
Public Const INFO_TOPRODAREA As String = "ToProdArea"
' Info per nome progetti
Public Const INFO_PROJNAME As String = "ProjName"
' Info per parcheggio asse C
Public Const INFO_CAXESHOME As String = "CAxesHome"
' Nome layer delle regioni
Public Const NAME_REGION As String = "Region"
+9
View File
@@ -116,6 +116,8 @@ Module ConstIni
Public Const K_LASTCOLOR As String = "LastColor"
Public Const K_COLOR As String = "Color"
Public Const S_FRAMECOMPO As String = "FrameCompo"
Public Const S_EXTCOMPO As String = "Compo"
Public Const S_INTCOMPO As String = "InternalCompo"
@@ -223,6 +225,12 @@ Module ConstIni
Public Const K_RAWOFFSX As String = "OffsX"
Public Const K_RAWOFFSY As String = "OffsY"
Public Const K_RAWKERF As String = "Kerf"
Public Const K_ENABLEOTHERREFTAB As String = "EnableOtherRefTab"
Public Const K_OTHERREFTAB As String = "OtherRefTab"
Public Const K_OTHERREFTABX As String = "OtherRefTabX"
Public Const K_OTHERREFTABY As String = "OtherRefTabY"
Public Const K_OTHERREFTABPOS As String = "OtherRefTabPos"
Public Const S_RAWMOVE As String = "RawMove"
Public Const K_RAWSTEP As String = "Step"
@@ -332,6 +340,7 @@ Module ConstIni
Public Const K_DC_TEST_OFFSET As String = "TestOffset"
Public Const K_DC_OFFSET_SQUARING As String = "OffsetSquaring"
Public Const K_DC_EXTRA_LEN_SQUARING As String = "ExtraLenSquaring"
Public Const K_ENABLEINVERT As String = "EnableInvert"
Public Const S_STATDATA As String = "StatData"
Public Const K_SD_DAY As String = "Day"
+10
View File
@@ -46,6 +46,13 @@
Public Const K_THREADSLEEP As String = "ThreadSleep"
Public Const K_PHOTODELEY As String = "PhotoDeley"
Public Const S_NCFANUC As String = "NcFanuc"
Public Const K_SETNCMODE As String = "SetNcMode"
Public Const K_BASEADDRINT As String = "BaseAddrInt"
Public Const K_BASEADDRBIT As String = "BaseAddrBit"
Public Const K_NUMVARINT As String = "NumVarInt"
Public Const K_NUMVARBIT As String = "NumVarBit"
Public Const S_EXECLUA As String = "ExecLua"
Public Const K_FILESCRIPT_LUA As String = "FileScript"
@@ -78,6 +85,7 @@
Public Const K_TABLEDOWN As String = "TableDown"
Public Const K_MANUAL As String = "Manual"
Public Const K_DOORCLOSED As String = "DoorClosed"
Public Const K_DOOROPENDED As String = "DoorOpened"
Public Const K_LIMITZ As String = "LimitZ"
Public Const K_POWEROVR As String = "PowerOvr"
Public Const K_PARKING As String = "Parking"
@@ -112,6 +120,7 @@
Public Const K_FEEDHOLD As String = "FeedHold"
Public Const K_SPOTLIGHT1 As String = "SpotLight1"
Public Const K_SPOTLIGHT2 As String = "SpotLight2"
Public Const K_NAXES As String = "nAxes"
' Nuove variabili
Public Const K_SPEEDHOLD As String = "SpeedHold"
Public Const K_XYJOG As String = "XYJog"
@@ -270,6 +279,7 @@
Public Const S_MACH_PROBING As String = "Probing"
Public Const K_PROBINGSTATEVAR As String = "ProbingStateVar"
Public Const K_SAWDIAMETER As String = "SawDiameter"
Public Const K_TOOLLENGTH As String = "ToolLength"
Public Const K_RAWTHICKNESS As String = "RawThickness"
Public Const K_ENABLERAWPROBE As String = "EnableRawProbe"
+5 -2
View File
@@ -140,8 +140,11 @@ Public Class ControlsDirectCutUC
Return
End If
' Caso standard
m_ActiveDirectCutPage = DirectCutPages.DirectCut
If m_MainWindow.m_DirectCutPageUC.m_ActiveControl <> DirectCutPageUC.Controls.MachineButtonUC Or
m_MainWindow.m_DirectCutPageUC.m_ActiveControl <> DirectCutPageUC.Controls.VacuumButtonUC Then
' Caso standard
m_ActiveDirectCutPage = DirectCutPages.DirectCut
End If
' Attivo le lavorazioni solo se esiste il grezzo e se presente testa H1
Dim bRawOk As Boolean = (GetRawHeight() > EPS_SMALL)
+81 -14
View File
@@ -76,6 +76,11 @@ Public Class ControlsMachineButtonUC
End If
End Sub
#Region "STATE CHANGED"
' ------------------------------------------------------------------------------
' i segeunti metodi notificano il cambiamento di stato di specifici bottoni
'-------------------------------------------------------------------------------
Friend Sub SpindleStateChanged(SpindleState As Boolean)
Dim SpindleButton As TwoStateButton = Nothing
For Each MachineButton As MachineButton In m_ButtonList
@@ -255,38 +260,34 @@ Public Class ControlsMachineButtonUC
Dim DoorOpenedButton As ThreeStateButton = Nothing
For Each MachineButton As MachineButton In m_ButtonList
If MachineButton.StateFlag = K_DOORCLOSED Then
'If TypeOf MachineButton Is NoStateButton Then
' DoorClosedButton = DirectCast(MachineButton, NoStateButton)
'ElseIf TypeOf MachineButton Is TwoStateButton Then
' DoorClosedButton = DirectCast(MachineButton, TwoStateButton)
'ElseIf TypeOf MachineButton Is ThreeStateButton Then
' DoorClosedButton = DirectCast(MachineButton, ThreeStateButton)
'ElseIf TypeOf MachineButton Is DoubleCommandButton Then
' DoorClosedButton = DirectCast(MachineButton, DoubleCommandButton)
'ElseIf TypeOf MachineButton Is PressedCommandButton Then
' DoorClosedButton = DirectCast(MachineButton, PressedCommandButton)
'End If
DoorClosedButton = MachineButton
End If
If MachineButton.StateFlag = "DoorOpened" Then
If MachineButton.StateFlag = K_DOOROPENDED Then
DoorOpenedButton = MachineButton
End If
Next
' Chiusura porte (gesrtione comando Three/Two state
If Not IsNothing(DoorClosedButton) Then
Select Case DoorClosedState
Case 0
' porta aperta
DoorClosedButton.Background = Application.Current.FindResource("OmagCut_Red")
Case 1, 2
' porta in movimento/aperta
DoorClosedButton.Background = Application.Current.FindResource("OmagCut_LightGray")
End Select
End If
' Chiusura porte (gesrtione comando Three/Two state
If Not IsNothing(DoorOpenedButton) Then
Select Case DoorClosedState
Case 0
' porta aperta
DoorOpenedButton.Background = Application.Current.FindResource("OmagCut_LightGray")
Case 1
' porta in movimento
DoorOpenedButton.Background = Application.Current.FindResource("OmagCut_Yellow")
Case 2
' porta chiusa
DoorOpenedButton.Background = Application.Current.FindResource("OmagCut_Green")
End Select
End If
@@ -372,6 +373,7 @@ Public Class ControlsMachineButtonUC
'End If
End Sub
#End Region ' State Range
Public Function GetPrivateProfileMachineButtons(
ByVal lpAppName As String,
@@ -569,13 +571,64 @@ Public MustInherit Class MachineButton
EgtOutLog("dopo scrittura seconda variabile")
End If
Return
Case 4
' ------------------------------------ FANUC ------------------------------------
' eventuale scrittura di linea di comando MDI
If Not String.IsNullOrEmpty(CmdString) Then
' attivo mpdalità MDI
m_CN.DGeneralFunctions_WriteCncMode(2)
System.Threading.Thread.Sleep(100)
' salvo la stringa di comando ricevuta dal file lua
m_CN.sz_ManualDataInput = CmdString
' esguo la funzione che ha il compito di scrivere il comando MDI
m_CN.MDI_command()
End If
' attivo modalità AUTO
m_CN.DGeneralFunctions_WriteCncMode(7)
System.Threading.Thread.Sleep(100)
If String.IsNullOrEmpty(EValue) Then
' EActive: impulsivo "D#####"
m_CN.NC_pulse_bit(ENumber)
EgtOutLog("Fanuc_DNumber= " & ENumber)
Else
' EActive + EValue: scrittura comando invariabile Short oppure Bit
If ENumber.Contains(".") Then
' D#####.#
Dim bEValue As Boolean
If EValue.Trim = "1" Then bEValue = True
m_CN.NC_write_var_bit(ENumber, CBool(EValue))
Else
' D#####
m_CN.NC_write_var_short(ENumber, CShort(EValue))
End If
EgtOutLog("Fanuc_DNumber= " & ENumber & " DValue= " & EValue)
End If
' eventale caricamento seconda variabile
If String.IsNullOrEmpty(EValue2) Then
' EActive: impulsivo "D#####"
m_CN.NC_pulse_bit(ENumber2)
EgtOutLog("Fanuc_DNumber= " & ENumber2)
Else
' EActive + EValue: scrittura comando invariabile Short oppure Bit
If ENumber2.Contains(".") Then
' D#####.#
Dim bEValue2 As Boolean
If EValue2.Trim = "1" Then bEValue2 = True
m_CN.NC_write_var_bit(ENumber2, CBool(EValue2))
Else
' D#####
m_CN.NC_write_var_short(ENumber2, CShort(EValue2))
End If
EgtOutLog("Fanuc_DNumber2= " & ENumber2 & " DValue2= " & EValue2)
End If
Return
End Select
End If
'--------------------------------------------------------- MDI ---------------------------------------------------------
Dim nResult As Short
' assegno la modalità di funzionamento
Select Case m_MainWindow.m_CNCommunication.m_nNCType
Case 1, 2
Case 1, 2, 4
nResult = m_CN.DGeneralFunctions_WriteCncMode(2) ' Modalità MDI per controlli num
Case 3
'Per il siemens non devo fare nulla
@@ -599,7 +652,7 @@ Public MustInherit Class MachineButton
m_CN.DGeneralFunctions_CycleStart()
End If
System.Threading.Thread.Sleep(300)
' riprostino la modalità manuale
' ripristino la modalità manuale..?? siucuri ??
nResult = m_CN.DGeneralFunctions_WriteCncMode(7) ' Modalità manuale
End Sub
@@ -620,6 +673,7 @@ Public MustInherit Class MachineButton
EgtTdbGetCurrToolParam(MCH_TP.FEED, dFeed)
End If
EgtLuaSetGlobNumVar("CMD.F", dFeed)
Dim dSpeed As Double = 0
If Not String.IsNullOrWhiteSpace(m_DirectCutPage.m_ManualAxesMove.SpeedTxBx.Text) Then
StringToDouble(m_DirectCutPage.m_ManualAxesMove.SpeedTxBx.Text, dSpeed)
@@ -628,6 +682,18 @@ Public MustInherit Class MachineButton
EgtTdbGetCurrToolParam(MCH_TP.SPEED, dSpeed)
End If
EgtLuaSetGlobNumVar("CMD.S", dSpeed)
' versione 2.5e1
EgtTdbSetCurrTool(m_MainWindow.m_CurrentProjectPageUC.ToolTxBx.Text)
Dim sToolPos As String = String.Empty
If EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sToolPos) Then
EgtLuaGetGlobStringVar("CMD.TCPOS", sToolPos)
End If
Dim dToolDiam As Double = 0
If EgtTdbGetCurrToolParam(MCH_TP.DIAM, dToolDiam) Then
EgtLuaSetGlobNumVar("CMD.DIAM", dToolDiam * 1000)
End If
Dim dL1, dL2, dL3, dR1, dR2 As Double
m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2)
EgtLuaSetGlobNumVar("CMD.L1", dL1)
@@ -789,6 +855,7 @@ Public Class NoStateButton
ExecuteMDICommand(TLuaScriptName)
End If
Else
' FANUC, SIEMENS
ExecuteMDICommand(TLuaScriptName)
End If
End Sub
+7 -2
View File
@@ -219,7 +219,10 @@
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<!--<ColumnDefinition Width="1*"/>-->
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
@@ -263,9 +266,11 @@
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}">
<Image Source="{DynamicResource ParkingImg}" Style="{StaticResource OmagCut_ScaleButtonIcon}"/>
</ToggleButton>
<!--Comando Manula/MDI-->
<Button Name="ManualModeBtn" Grid.Column="8"
<Button Name="ManualModeBtn" Grid.Column="11"
Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<Image Source="{DynamicResource ManualImg}" Style="{StaticResource OmagCut_ScaleButtonIcon}"/>
</Button>
+21 -7
View File
@@ -53,7 +53,7 @@ Public Class DirectCutPageUC
'Posizionemento nella griglia delle Page UserControl
m_MachineButtons.SetValue(Grid.RowProperty, 2)
m_MachineButtons.SetValue(Grid.ColumnSpanProperty, 7)
m_MachineButtons.SetValue(Grid.ColumnSpanProperty, m_MachineButtons.nCountButton)
m_ManualAxesMove.SetValue(Grid.RowProperty, 1)
m_ControlsDirectCutUC.SetValue(Grid.RowProperty, 1)
@@ -64,12 +64,18 @@ Public Class DirectCutPageUC
' verifico che sia presente almeno uno dei bottoni della nuova console (SOLO PER MACCHINA CON paragrafo [ControlMachButtons])
Dim bCollapsedNewBottonsConsole As Boolean = Not m_ControlsMachineButton.GetPrivateProfileMachineButtons("JogButtons", "Button1", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, m_MainWindow.GetMachIniFile())
m_NewMachineButtonsType = m_ControlsMachineButton.GetPrivateProfileMachineButtons(S_CONTROLMACHBUTTONS, "Button1", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, m_MainWindow.GetMachIniFile())
' verifico che sia presente almeno uno dei bottoni della nuova console (SOLO PER MACCHINA CON paragrafo [VacuumMachButtons])
Dim bCollapsedVacuumButton As Boolean = Not m_ControlsMachineButton.GetPrivateProfileMachineButtons(S_VACUUMMACHBUTTONS, "Button1", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, m_MainWindow.GetMachIniFile())
If Not m_NewMachineButtonsType Then
'Assegno MachineButtons alla pagina
LowerButtonGrid.Children.Add(m_MachineButtons)
ControlsMachineBtn.Visibility = Windows.Visibility.Collapsed
VacuumMachineBtn.Visibility = Windows.Visibility.Collapsed
End If
' se non sono configurate le ventose allora nascondo il comando
If m_NewMachineButtonsType AndAlso bCollapsedVacuumButton Then
VacuumMachineBtn.Visibility = Windows.Visibility.Collapsed
End If
' nuovi bottoni 20/05/2021 - modifica specifiche 04/08/2021
' leggo il numero di assi attivi nella macchina
@@ -209,6 +215,7 @@ Public Class DirectCutPageUC
m_ControlsMachineButton.SetValue(Grid.RowProperty, 1)
m_NewMachineButtonsType = m_ControlsMachineButton.GetPrivateProfileMachineButtons(S_CONTROLMACHBUTTONS, "Button1", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, m_MainWindow.GetMachIniFile())
MachineButtonGrid.Children.Add(m_ControlsMachineButton)
m_ActiveControl = Controls.MachineButtonUC
If VacuumMachineBtn.IsChecked Then
MachineButtonGrid.Children.Remove(m_VacuumMachineButton)
VacuumMachineBtn.IsChecked = False
@@ -221,6 +228,7 @@ Public Class DirectCutPageUC
Private Sub VacuumMachineBtn_Click(sender As Object, e As RoutedEventArgs) Handles VacuumMachineBtn.Click
If VacuumMachineBtn.IsChecked Then
MachineButtonGrid.Children.Add(m_VacuumMachineButton)
m_ActiveControl = Controls.VacuumButtonUC
If ControlsMachineBtn.IsChecked Then
MachineButtonGrid.Children.Remove(m_ControlsMachineButton)
ControlsMachineBtn.IsChecked = False
@@ -417,12 +425,14 @@ Public Class DirectCutPageUC
If m_bShowMachine Then
' aggiorno lo stato
Select Case m_nMachLook
Case MCH_LOOK.ALL
m_nMachLook = MCH_LOOK.TAB_HEAD
Case MCH_LOOK.TAB_HEAD
m_nMachLook = MCH_LOOK.TAB_TOOL
Case Else
m_nMachLook = MCH_LOOK.ALL
Case MCH_LOOK.ALL
m_nMachLook = MCH_LOOK.TAB_HEAD
Case MCH_LOOK.TAB_HEAD
m_nMachLook = MCH_LOOK.TAB_TOOL
Case MCH_LOOK.TAB_TOOL
m_nMachLook = MCH_LOOK.TAB
Case Else
m_nMachLook = MCH_LOOK.ALL
End Select
' aggiorno lo stato della macchina e la sua visualizzazione
EgtSetMachineLook(m_nMachLook)
@@ -444,8 +454,12 @@ Public Class DirectCutPageUC
m_ControlsDirectCutUC1.DirectCutPage_Unloaded(Nothing, Nothing)
Case Controls.MachineButtonUC
MachineButtonGrid.Children.Remove(m_ControlsMachineButton)
MachineButtonGrid.Children.Remove(m_ControlsDirectCutUC)
MachineButtonGrid.Children.Remove(m_ControlsDirectCutUC1)
ControlsMachineBtn.IsChecked = False
Case Controls.VacuumButtonUC
MachineButtonGrid.Children.Remove(m_ControlsMachineButton)
MachineButtonGrid.Children.Remove(m_ControlsDirectCutUC)
MachineButtonGrid.Children.Remove(m_VacuumMachineButton)
VacuumMachineBtn.IsChecked = False
End Select
+4 -1
View File
@@ -186,7 +186,10 @@ Public Class FlatteningCut
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_MACHTYPE, m_nMachType.ToString(), m_MainWindow.GetIniFile())
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_ROTLOCK, If( m_bRotLock, "1", "0"), m_MainWindow.GetIniFile())
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_POSX, DoubleToString( m_ptTipP1.x, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_POSY, DoubleToString( m_ptTipP1.y, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_DIRECTCUTS, K_DC_FLATT_POSY, DoubleToString(m_ptTipP1.y, 2), m_MainWindow.GetIniFile())
' imposto la Z di sicurezza corretta
EgtMdbSetGeneralParam(MCH_GP.SAFEZ, DirectCutPageUC.m_dZSafe)
EgtMdbSave()
' Se non vado in simulazione
If Not m_bSimul Then
' Dichiaro sottopagina da non riattivare
+71
View File
@@ -7,6 +7,8 @@ Public Class MachineButtonsUC
Private m_DirectCutPage As DirectCutPageUC
Friend m_CN As CN_generico
Public nCountButton As Integer = 11
Private m_bOnlyLaser As Boolean = False
Private m_bFirst As Boolean = True
@@ -76,6 +78,9 @@ Public Class MachineButtonsUC
GetToggleButton(nIndex + 1).Visibility = Windows.Visibility.Hidden
Next
' notifico nella variabile pubblica il numero di pulsanti inseriti nella barra
nCountButton = m_nCount
' Se variabile di stato "Nothing"/"DoorOpened"/"DoorClosed" imposto immagine fissa
For nIndex As Integer = 0 To m_nCount - 1
If StateFlagArray(nIndex) = BTN_STATE_NOTHING OrElse
@@ -267,9 +272,62 @@ Public Class MachineButtonsUC
End If
Return
End If
' CONTROLLO FANUC
Case 4
' ------------------------------------ FANUC ------------------------------------
' eventuale scrittura di linea di comando MDI
If Not String.IsNullOrEmpty(CmdString) Then
' attivo mpdalità MDI
m_CN.DGeneralFunctions_WriteCncMode(2)
System.Threading.Thread.Sleep(100)
' salvo la stringa di comando ricevuta dal file lua
m_CN.sz_ManualDataInput = CmdString
' esguo la funzione che ha il compito di scrivere il comando MDI
m_CN.MDI_command()
End If
' attivo modalità AUTO
m_CN.DGeneralFunctions_WriteCncMode(7)
System.Threading.Thread.Sleep(100)
If String.IsNullOrEmpty(EValue) Then
' EActive: impulsivo "D#####"
m_CN.NC_pulse_bit(ENumber)
EgtOutLog("Fanuc_DNumber= " & ENumber)
Else
' EActive + EValue: scrittura comando invariabile Short oppure Bit
If ENumber.Contains(".") Then
' D#####.#
Dim bEValue As Boolean
If EValue.Trim = "1" Then bEValue = True
m_CN.NC_write_var_bit(ENumber, CBool(EValue))
Else
' D#####
m_CN.NC_write_var_short(ENumber, CShort(EValue))
End If
EgtOutLog("Fanuc_DNumber= " & ENumber & " DValue= " & EValue)
End If
' eventale caricamento seconda variabile
If String.IsNullOrEmpty(EValue2) Then
' EActive: impulsivo "D#####"
m_CN.NC_pulse_bit(ENumber2)
EgtOutLog("Fanuc_DNumber= " & ENumber2)
Else
' EActive + EValue: scrittura comando invariabile Short oppure Bit
If ENumber2.Contains(".") Then
' D#####.#
Dim bEValue2 As Boolean
If EValue2.Trim = "1" Then bEValue2 = True
m_CN.NC_write_var_bit(ENumber2, CBool(EValue2))
Else
' D#####
m_CN.NC_write_var_short(ENumber2, CShort(EValue2))
End If
EgtOutLog("Fanuc_DNumber2= " & ENumber2 & " DValue2= " & EValue2)
End If
Return
End Select
End If
Dim nResult As Short
' Imposto modalità MDI per controlli num
Select Case m_MainWindow.m_CNCommunication.m_nNCType
@@ -286,6 +344,8 @@ Public Class MachineButtonsUC
m_CN.DGeneralFunctions_CycleStart()
Case 3
'Per il siemens non devo fare nulla
Case 4
' Nicola: 27/03/2023 attivazione della funzione M# indicata?
End Select
If b2Start Then
@@ -320,6 +380,17 @@ Public Class MachineButtonsUC
EgtTdbGetCurrToolParam(MCH_TP.SPEED, dSpeed)
End If
EgtLuaSetGlobNumVar("CMD.S", dSpeed)
' versione 2.5e1
EgtTdbSetCurrTool(m_MainWindow.m_CurrentProjectPageUC.ToolTxBx.Text)
Dim sToolPos As String = String.Empty
If EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sToolPos) Then
EgtLuaGetGlobStringVar("CMD.TCPOS", sToolPos)
End If
Dim dToolDiam As Double = 0
If EgtTdbGetCurrToolParam(MCH_TP.DIAM, dToolDiam) Then
EgtLuaSetGlobNumVar("CMD.DIAM", dToolDiam * 1000)
End If
Dim dL1, dL2, dL3, dR1, dR2 As Double
m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2)
EgtLuaSetGlobNumVar("CMD.L1", dL1)
+1 -1
View File
@@ -209,7 +209,7 @@ Public Class ManualAxesMoveUC
System.Threading.Thread.Sleep(150)
m_CN.DGeneralFunctions_CycleStart()
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
m_CN.DGeneralFunctions_WriteCncMode(7) ' Modalità manuale
' m_CN.DGeneralFunctions_WriteCncMode(7) ' Modalità manuale
m_MoveClicked = False
End Sub
+53 -20
View File
@@ -1,4 +1,5 @@
Imports EgtUILib
Imports System.Windows.Threading
Imports EgtUILib
Public Class SingleCutUC
@@ -43,6 +44,10 @@ Public Class SingleCutUC
Private Const MIN_CUT_LEN As Double = 10.0
Private Const MAX_SIDE_ANG As Double = 60.0
' Costanti che indicano la modalità di acquisizione dei punti
' Utilizzato per aggiornare la posizione della macchina
Private m_RefreshTimer As New DispatcherTimer
Private Enum PT_MODE As Integer
SAW = 0
LASER = 1
@@ -68,14 +73,14 @@ Public Class SingleCutUC
SimulBtn.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 1)
OkBtn.ToolTip = EgtMsg(MSG_DIRECTCUTPAGEUC + 30)
' Carico i dati dell'ultimo taglio
m_dDepth = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_SING_DEPTH, m_dDepth, m_MainWindow.GetIniFile())
m_dLen = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_SING_LENGTH, m_dLen, m_MainWindow.GetIniFile())
m_dAngO = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_SING_ANGH, m_dAngO, m_MainWindow.GetIniFile())
m_dAngV = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_SING_ANGV, m_dAngV, m_MainWindow.GetIniFile())
m_dDepth = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_SING_DEPTH, m_dDepth, m_MainWindow.GetIniFile())
m_dLen = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_SING_LENGTH, m_dLen, m_MainWindow.GetIniFile())
m_dAngO = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_SING_ANGH, m_dAngO, m_MainWindow.GetIniFile())
m_dAngV = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_SING_ANGV, m_dAngV, m_MainWindow.GetIniFile())
m_dOffset = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_SING_OFFSET, m_dOffset, m_MainWindow.GetIniFile())
m_bSawTh = (GetPrivateProfileInt(S_DIRECTCUTS, K_DC_SING_SAWTH, 0, m_MainWindow.GetIniFile()) <> 0)
m_ptTipP1.x = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_SING_POSX, m_ptTipP1.x, m_MainWindow.GetIniFile())
m_ptTipP1.y = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_SING_POSY, m_ptTipP1.y, m_MainWindow.GetIniFile())
m_ptTipP1.x = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_SING_POSX, m_ptTipP1.x, m_MainWindow.GetIniFile())
m_ptTipP1.y = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_SING_POSY, m_ptTipP1.y, m_MainWindow.GetIniFile())
End Sub
Private Sub SingleCut_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
@@ -92,6 +97,10 @@ Public Class SingleCutUC
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = True
EgtSetMachineLook(m_MainWindow.m_DirectCutPageUC.m_nMachLook)
EgtDraw()
' riavvio il timer per visualizzare la poszione della macchina
If Not IsNothing(m_RefreshTimer) Then
m_RefreshTimer.Start()
End If
Return
End If
' Disabilito registrazione progetto modificato
@@ -114,7 +123,7 @@ Public Class SingleCutUC
m_bPointP1Ok = False
m_bPointP2Ok = False
' Inizializzo primo punto acquisito dal disegno
m_ptPrev = m_ptTipP1 + ( m_ptTabOri - Point3d.ORIG())
m_ptPrev = m_ptTipP1 + (m_ptTabOri - Point3d.ORIG())
m_ptPrev.z = m_ptRawMax.z
' Disegno crocetta che indica il punto acquisito
CreateCross(m_nTempLay, m_ptPrev)
@@ -138,21 +147,40 @@ Public Class SingleCutUC
' Deseleziono bottone primo punto
Point1Btn.IsChecked = False
' la visualizzazione dei comandi è gestira dalla DirectCutPageUC richiamando la funzione ReloadParam
' la visualizzazione dei comandi è gestita dalla DirectCutPageUC richiamando la funzione ReloadParam
' forzo la macchina ad essere visibile fin da subito
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = True
m_MainWindow.m_DirectCutPageUC.m_nMachLook = MCH_LOOK.TAB
' Creo il timer il timer per aggiornare il posizionamento della macchina
AddHandler m_RefreshTimer.Tick, AddressOf RefreshTimer_tick
m_RefreshTimer.Interval = TimeSpan.FromMilliseconds(1000)
' Aggiorno visualizzazione
EgtDraw()
' Avvi il timer
m_RefreshTimer.Start()
End Sub
Private Sub RefreshTimer_tick()
' se è impostata la visualizzazione della sola tavola allora non aggiorno il disegno
If m_MainWindow.m_DirectCutPageUC.m_nMachLook = MCH_LOOK.TAB Then Return
' Aggiorno visualizzazione
SetMachineInCurrPos()
' Aggiorno il disegno
EgtDraw()
End Sub
Friend Sub SingleCut_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
' Salvo i dati correnti
WritePrivateProfileString( S_DIRECTCUTS, K_DC_SING_DEPTH, DoubleToString( m_dDepth, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString( S_DIRECTCUTS, K_DC_SING_LENGTH, DoubleToString( m_dLen, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString( S_DIRECTCUTS, K_DC_SING_ANGH, DoubleToString( m_dAngO, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString( S_DIRECTCUTS, K_DC_SING_ANGV, DoubleToString( m_dAngV, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_DIRECTCUTS, K_DC_SING_DEPTH, DoubleToString(m_dDepth, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_DIRECTCUTS, K_DC_SING_LENGTH, DoubleToString(m_dLen, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_DIRECTCUTS, K_DC_SING_ANGH, DoubleToString(m_dAngO, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_DIRECTCUTS, K_DC_SING_ANGV, DoubleToString(m_dAngV, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_DIRECTCUTS, K_DC_SING_OFFSET, DoubleToString(m_dOffset, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_DIRECTCUTS, K_DC_SING_SAWTH, If(m_bSawTh, "1", "0"), m_MainWindow.GetIniFile())
WritePrivateProfileString( S_DIRECTCUTS, K_DC_SING_POSX, DoubleToString( m_ptTipP1.x, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_DIRECTCUTS, K_DC_SING_POSX, DoubleToString(m_ptTipP1.x, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_DIRECTCUTS, K_DC_SING_POSY, DoubleToString(m_ptTipP1.y, 2), m_MainWindow.GetIniFile())
' Se non vado in simulazione
If Not m_bSimul Then
@@ -171,6 +199,8 @@ Public Class SingleCutUC
EgtSetMachineLook(MCH_LOOK.TAB)
EgtDraw()
End If
' interrompo il Timer per aggiornare la visualizzazione del posizionamento macchina
m_RefreshTimer.Stop()
' Dichiaro pagina non attiva
m_bActive = False
End Sub
@@ -279,7 +309,7 @@ Public Class SingleCutUC
DirectionTxBx.Text = DoubleToString(m_dAngO - m_MainWindow.m_CurrentMachine.dDeltaC, 2)
SideAngleTxBx.Text = DoubleToString(m_dAngV, 2)
' Altrimenti punto da click di mouse
' Altrimenti punto da click di mouse
Else
' Assegno punto selezionato nel disegno a m_ptTipP1
m_ptTipP1 = m_ptPrev
@@ -298,6 +328,7 @@ Public Class SingleCutUC
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = True
EgtSetMachineLook(m_MainWindow.m_DirectCutPageUC.m_nMachLook)
EgtDraw()
' Seleziono il bottone per indicare che il primo punto è stato acquisito
Point1Btn.IsChecked = True
' Abilito e deseleziono secondo punto
@@ -358,7 +389,7 @@ Public Class SingleCutUC
m_dAngV = 90 - dTAngV
SideAngleTxBx.Text = DoubleToString(m_dAngV, 2)
' Altrimenti punto da click di mouse
' Altrimenti punto da click di mouse
Else
' Assegno punto selezionato nel disegno a m_ptTipP2
m_ptTipP2 = m_ptPrev
@@ -476,7 +507,7 @@ Public Class SingleCutUC
EgtDraw()
End Sub
Private Sub SawThick_Click( sender As Object, e As RoutedEventArgs) Handles SawThChBx.Click
Private Sub SawThick_Click(sender As Object, e As RoutedEventArgs) Handles SawThChBx.Click
' Recupero lo stato di check
m_bSawTh = SawThChBx.IsChecked()
' Disegno il taglio
@@ -536,9 +567,9 @@ Public Class SingleCutUC
m_CurrProjPage.SetWarningMessage( "Trial Version")
#Else
' Verifico non sia versione Ufficio
If m_MainWindow.GetKeyOption( MainWindow.KEY_OPT.OFFICE_TYPE) Then
m_CurrProjPage.SetWarningMessage( "Office Version")
Return
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.OFFICE_TYPE) Then
m_CurrProjPage.SetWarningMessage("Office Version")
Return
End If
' Verifico ci sia un taglio valido
If Not m_bCutOk Then Return
@@ -610,6 +641,8 @@ Public Class SingleCutUC
' Imposto affondamento e angolo di fianco sul taglio
EgtSetInfo(nCutId, INFO_DEPTH, m_dDepth)
EgtSetInfo(nCutId, INFO_SIDE_ANGLE, m_dAngV)
' Imposto se disabilitare l'inversine di direzione del taglio
If Not m_MainWindow.m_CurrentMachine.bEnableInvert Then EgtSetInfo(nCutId, INFO_ENABLE_INVERT, 0)
' Creo layer per crocetta di riferimento
Dim nCrossLayerId = EgtCreateGroup(nPartId)
' Aggiungo crocetta/e
+46 -3
View File
@@ -283,6 +283,19 @@ Public Class DrawPageUC
m_sCsvOrder = ""
m_sCsvList = ""
m_sCsvName = ""
' Visuliazzazione dei bottoni per modifica dei componenti
If m_MainWindow.FrameCutBtn.IsChecked Then
SideAngleBtn.Visibility = Visibility.Hidden
FiloTopBtn.Visibility = Visibility.Hidden
EngraveBtn.Visibility = Visibility.Hidden
DripCutBtn.Visibility = Visibility.Hidden
Else
SideAngleBtn.Visibility = Visibility.Visible
FiloTopBtn.Visibility = Visibility.Visible
EngraveBtn.Visibility = Visibility.Visible
DripCutBtn.Visibility = Visibility.Visible
End If
End Sub
' recupero il click sulla scena ed assegno il metodo a secondo della pagina aperta
@@ -553,6 +566,7 @@ Public Class DrawPageUC
OkBtn.IsEnabled = True
End Sub
' Navigazione nelle due pagine per la selezione dei componenti da disegnare
Friend Sub BackBtn_Click(sender As Object, e As RoutedEventArgs) Handles BackBtn.Click
m_SceneButtons.MeasureBtn.IsChecked = False
DrawPage_Unloaded(sender, e)
@@ -1124,6 +1138,30 @@ Public Class DrawPageUC
Return True
End Function
Private Function MakeSectionFrameInsert() As Boolean
' m_MainWindow.m_ImportPageUC.LoadFrame()
' recupero il primo layer del primo pezzo
Dim nLayerId As Integer = EgtGetFirstLayer(EgtGetFirstPart())
If nLayerId = GDB_ID.NULL Then Return False
' percorso in cui salvare tempora
Dim sTmpFile As String = m_MainWindow.GetTempDir() & "\Frame.Nge"
If Not EgtSaveObjToFile(nLayerId, sTmpFile, NGE.BIN) Then Return False
' Passo al contesto principale
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
' Inserisco il pezzo
If Not My.Computer.FileSystem.FileExists(sTmpFile) Then Return False
EgtInsertFile(sTmpFile)
' Ne recupero l'Id
Dim nPartId As Integer = EgtGetLastPart()
' Creo la cornice
m_MainWindow.m_FrameCutPageUC.CreateFrame(nPartId)
' Ricalcolo lavorazioni
AddFrameMachinings(m_MainWindow.m_FrameCutPageUC.m_FrameMachiningUC.m_dStartTrim, m_MainWindow.m_FrameCutPageUC.m_FrameMachiningUC.m_dEndTrim)
' Cancello il file
My.Computer.FileSystem.DeleteFile(sTmpFile)
Return True
End Function
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
m_bBackFromInternalCompo = False
m_bInternalCompo = False
@@ -1139,7 +1177,12 @@ Public Class DrawPageUC
Dim InsNbr As Integer = Int32.Parse(PartNumTxBx.Text)
' Passo al contesto principale
'MakeInsert(InsNbr, sPartName)
MakeMultipleInsert(InsNbr, sPartName)
If m_MainWindow.FrameCutBtn.IsChecked Then
MakeSectionFrameInsert()
Else
MakeMultipleInsert(InsNbr, sPartName)
End If
' Aggiorno ambiente principale
EgtZoom(ZM.ALL)
' Elimino nome del componente precedente
@@ -1153,7 +1196,7 @@ Public Class DrawPageUC
' Istruzioni per chiudere ImportPageUC e aprire CadCutPageUC
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
m_MainWindow.m_ActivePage = MainWindow.Pages.CadCut
m_MainWindow.m_ActivePage = If(m_MainWindow.FrameCutBtn.IsChecked, MainWindow.Pages.FrameCut, MainWindow.Pages.CadCut)
End Sub
@@ -1174,7 +1217,7 @@ Public Class DrawPageUC
' Istruzioni per chiudere ImportPageUC e aprire CadCutPageUC
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
m_MainWindow.m_ActivePage = MainWindow.Pages.CadCut
m_MainWindow.m_ActivePage = If(m_MainWindow.FrameCutBtn.IsChecked, MainWindow.Pages.FrameCut, MainWindow.Pages.CadCut)
End Sub
Private Sub TrfDataBtn_Click(sender As Object, e As RoutedEventArgs) Handles TrfDataBtn.Click
+82 -7
View File
@@ -167,7 +167,7 @@ Public Class MainComponentPageUC
Private Sub Compo_Click(sender As Object, e As RoutedEventArgs) Handles Compo1.Click, Compo2.Click, Compo3.Click, Compo4.Click, Compo5.Click, Compo6.Click, Compo7.Click, Compo8.Click
CurrentBtn = DirectCast(e.Source, Button)
Dim CompoName As String = S_COMPO & GetIndexFromButton(CurrentBtn).ToString
Dim CompoName As String = If(m_MainWindow.FrameCutBtn.IsChecked, S_FRAMECOMPO, S_COMPO) & GetIndexFromButton(CurrentBtn).ToString
m_sCurrCompoFam = CompoName
m_SecondaryComponentPage.m_sCurrCompo = String.Empty
Dim nCount As Integer = GetPrivateProfileInt(CompoName, K_CMP_COUNT, 0, m_MainWindow.GetIniFile())
@@ -251,13 +251,18 @@ Public Class MainComponentPageUC
End Sub
Private Sub LoadPage()
If m_MainWindow.FrameCutBtn.IsChecked Then
LoadFramePage()
Return
End If
Dim nDeltaSecondPage As Integer = 8
' Leggo numero di componenti presenti
Dim nCompoNumber As Integer = GetPrivateProfileInt(S_COMPO, K_CMP_COUNT, 0, m_MainWindow.GetIniFile())
' Calcolo indici a seconda della pagina in cui sono
If m_bIsFirstPage Then
ClearButton(nCompoNumber)
nDeltaSecondPage = 0
nDeltaSecondPage = 0
Else
ClearButton(nCompoNumber)
nDeltaSecondPage = 8
@@ -325,16 +330,86 @@ Public Class MainComponentPageUC
End Sub
Private Sub LoadFramePage()
Dim nDeltaSecondPage As Integer = 8
' Leggo numero di componenti presenti
Dim nCompoNumber As Integer = GetPrivateProfileInt(S_FRAMECOMPO, K_CMP_COUNT, 0, m_MainWindow.GetIniFile())
' Calcolo indici a seconda della pagina in cui sono
If m_bIsFirstPage Then
ClearButton(nCompoNumber)
nDeltaSecondPage = 0
Else
ClearButton(nCompoNumber)
nDeltaSecondPage = 8
End If
' Creazione converter da String a ImageSource
Dim ImageConverter As New ImageSourceConverter
Dim ThicknessConverter As New ThicknessConverter
'Assegnazione immagine e testo ai Button
For index As Integer = 1 To 8
Dim CustomThickness As New Thickness(0)
Dim nCompoName As Integer = GetPrivateProfileInt(S_FRAMECOMPO & index + nDeltaSecondPage, "Name", 0, m_MainWindow.GetIniFile())
Dim sCompoImage As String = ""
Dim sCompoImageSource As ImageSource
'verifico presenza immagine e la aggiungo
If GetPrivateProfileString(S_FRAMECOMPO & index + nDeltaSecondPage, "Image", "", sCompoImage, m_MainWindow.GetIniFile()) <> 0 Then
Try
sCompoImageSource = ImageConverter.ConvertFromString(m_MainWindow.GetResourcesDir() & "\" & sCompoImage)
GetImage(index).Height = 65
GetImage(index).Width = 65
GetImage(index).Source = sCompoImageSource
Catch ex As Exception
EgtOutLog("Error loading image " & sCompoImage)
sCompoImage = String.Empty
GetImage(index).Height = 0
GetImage(index).Width = 0
CustomThickness.Right = 0
GetImage(index).Margin = CustomThickness
End Try
Else
'Se non c'è l'immagine azzero la distanza tra testo e immagine
CustomThickness.Right = 0
GetImage(index).Margin = CustomThickness
End If
'verifico presenza testo
If nCompoName > 0 Then
Dim sCompoName As String = EgtMsg(MSG_COMPONENTPAGEUC + nCompoName)
'verifico presenza immagine
If sCompoImage.Length > 0 Then
'se la lunghezza del testo è maggiore di 15 lo taglio
If sCompoName.Length > 15 Then
sCompoName = sCompoName.Substring(0, 15)
End If
GetLabel(index).Text = sCompoName
'Se ci sono sia testo che immagine imposto un margine di 10
CustomThickness.Right = 10
GetImage(index).Margin = CustomThickness
Else
'se l'immagine non c'è e il testo è maggiore di 20 lo taglio
If sCompoName.Length > 20 Then
sCompoName = sCompoName.Substring(0, 20)
End If
GetLabel(index).Text = sCompoName
End If
Else
'Se non c'è testo azzero la distanza tra testo e immagine
CustomThickness.Right = 0
GetImage(index).Margin = CustomThickness
End If
Next
End Sub
' Gestione bottone altri componenti
Private Sub Compo9_Click(sender As Object, e As RoutedEventArgs) Handles Compo9.Click
If m_bIsFirstPage Then
m_bIsFirstPage = False
LoadPage()
'Compo9.SetValue(Grid.ColumnProperty, 1)
'Compo9.SetValue(Grid.ColumnSpanProperty, 1)
'ImageCompo9.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/NumericKeyboardArrow.png", UriKind.Relative))
'ImageCompo9.Visibility = Windows.Visibility.Visible
'LabelCompo9.Visibility = Windows.Visibility.Hidden
Compo9.SetValue(Grid.ColumnProperty, 0)
Compo9.SetValue(Grid.ColumnSpanProperty, 2)
ImageCompo9.Visibility = Windows.Visibility.Hidden
+106 -98
View File
@@ -7,124 +7,132 @@
mc:Ignorable="d"
d:DesignHeight="853.3" d:DesignWidth="1280">
<!-- Definizione della FrameCutPage -->
<Grid Name="FrameCutPageGrid" >
<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 Grid.Column="1" Grid.Row="0" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="4*"/>
</Grid.ColumnDefinitions>
<Button Name="PhotoBtn" Grid.Column="0" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource PhotoImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="RawPartBtn" Grid.Column="1" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource RawPartImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<ToggleButton Name="MachiningBtn" Grid.Column="4" Style="{DynamicResource OmagCut_RightGrayYellowIconToggleButton}">
<Image Source="{DynamicResource FrameMachiningImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</ToggleButton>
</Grid>
<Grid Name="LeftGrid" Grid.Row="1">
<Grid.RowDefinitions>
<!-- Definizione della FrameCutPage -->
<Grid Name="FrameCutPageGrid" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="12*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="7*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.6*"/>
<RowDefinition Height="0.8*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.8*"/>
<RowDefinition Height="2.5*"/>
</Grid.RowDefinitions>
<RowDefinition Height="8*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<ComboBox Name="AlongAxCmBx" Grid.Row="0" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_ComboBox}"
Width="200" MaxDropDownHeight="300">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<!-- Definizione della Grid superiore -->
<Grid Grid.Column="1" Grid.Row="0" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="4*"/>
</Grid.ColumnDefinitions>
<UniformGrid Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" >
<Button Name="SelSectionBtn"
Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<Image Source="{DynamicResource Sezione-corniceImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
<Button Name="PhotoBtn" Grid.Column="0" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource PhotoImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Grid>
<Button Name="SelGuideBtn"
<Button Name="RawPartBtn" Grid.Column="1" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource RawPartImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<ToggleButton Name="MachiningBtn" Grid.Column="4" Style="{DynamicResource OmagCut_RightGrayYellowIconToggleButton}">
<Image Source="{DynamicResource FrameMachiningImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</ToggleButton>
</Grid>
<Grid Name="LeftGrid" Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="7*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.6*"/>
<RowDefinition Height="0.8*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.8*"/>
<RowDefinition Height="0.8*"/>
<RowDefinition Height="1.7*"/>
</Grid.RowDefinitions>
<ComboBox Name="AlongAxCmBx" Grid.Row="0" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_ComboBox}"
Width="200" MaxDropDownHeight="300">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<UniformGrid Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" >
<Button Name="SelSectionBtn"
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"
<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"
<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"
<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"
<EgtWPFLib:EgtTextBox Name="ArcAngTxBx" Grid.Column="2" Grid.Row="3" Width="50"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
</UniformGrid>
</Grid>
</UniformGrid>
</UniformGrid>
</Grid>
</UniformGrid>
<TextBlock Name="OffsZTxBl" Grid.Row="2" Grid.ColumnSpan="2"
<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"
<EgtWPFLib:EgtTextBox Name="OffsZTxBx" Grid.Column="2" Grid.Row="2" Width="50"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="OffsXyTxBl" Grid.Row="3" Grid.ColumnSpan="2"
<TextBlock Name="OffsXyTxBl" Grid.Row="3" Grid.ColumnSpan="2"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="OffsXyTxBx" Grid.Column="2" Grid.Row="3" Width="50"
<EgtWPFLib:EgtTextBox Name="OffsXyTxBx" Grid.Column="2" Grid.Row="3" Width="50"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="OffsYyTxBl" Grid.Row="4" Grid.ColumnSpan="2"
<TextBlock Name="OffsYyTxBl" Grid.Row="4" Grid.ColumnSpan="2"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="OffsYyTxBx" Grid.Column="2" Grid.Row="4" Width="50"
<EgtWPFLib:EgtTextBox Name="OffsYyTxBx" Grid.Column="2" Grid.Row="4" Width="50"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<UniformGrid Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="2" >
<Button Name="MirrorPartBtn"
<UniformGrid Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="2" >
<Button Name="MirrorPartBtn"
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource SpecchiaImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="RemovePartBtn"
</Button>
<Button Name="RemovePartBtn"
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource Rimuovi_eliminaImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
</Button>
</UniformGrid>
</Button>
</UniformGrid>
<!--<TextBlock Name="SawRoughingTxBl" Grid.Row="4" Grid.ColumnSpan="3"
<UniformGrid Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="3" Columns="2" >
<Button Name="CompoBtn"
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource DrawImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
</Button>
</UniformGrid>
<!--<TextBlock Name="SawRoughingTxBl" Grid.Row="4" Grid.ColumnSpan="3"
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<ComboBox Name="SawRoughingCmBx" Grid.Row="5" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_ComboBox}"
@@ -182,10 +190,10 @@
</ComboBox.ItemTemplate>
</ComboBox>-->
</Grid>
</Grid>
</Grid>
</Grid>
</Grid>
</Grid>
</UserControl>
+12
View File
@@ -81,6 +81,8 @@ Public Class FrameCutPageUC
m_ProjectMgr.CSVBtn.Visibility = Windows.Visibility.Hidden
m_ProjectMgr.VeinMatchingBtn.Visibility = Windows.Visibility.Hidden
m_ProjectMgr.RegisterBtn.Visibility = Windows.Visibility.Hidden
' Visualizzo il bottone per l'importazione dei compo frame
CompoBtn.Visibility = If(GetPrivateProfileInt(S_FRAMECOMPO, K_CMP_COUNT, 0, m_MainWindow.GetIniFile()) > 0, Visibility.Visible, Visibility.Hidden)
' Recupero dimensioni e kerf del grezzo
m_nRawId = EgtGetFirstRawPart()
GetRawBox(m_RawBox)
@@ -436,6 +438,16 @@ Public Class FrameCutPageUC
End If
End Sub
Private Sub CompoBtn_Click(sender As Object, e As RoutedEventArgs) Handles CompoBtn.Click
m_MainWindow.TestOff()
m_MainWindow.DragRettangleOff()
m_MainWindow.SplitCurvWJOff()
m_MainWindow.StartCurvWJOff()
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_CurrentProjectPageUC)
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_DrawPageUC)
m_MainWindow.m_ActivePage = MainWindow.Pages.Draw
End Sub
Friend Function CreateFrame(nPartId As Integer) As Boolean
If Not MyCreateFrame( nPartId) Then
EgtErase( nPartId)
+23 -1
View File
@@ -1163,6 +1163,10 @@ Public Class AlarmsPageUC
Case 3
Dim nResult As Short = m_CN.DGeneralFunctions_WriteCncMode(0)
EgtOutLog("Impostata modalità automatica: esito " & nResult.ToString)
Case 4
' FANUC - Manual:7, Edit:1
Dim nResult As Short = m_CN.DGeneralFunctions_WriteCncMode(7)
EgtOutLog("Impostata modalità manuale: esito " & nResult.ToString)
End Select
' Recupero file LUA
EgtLuaExecFile(m_CurrentMachine.sMachDir() & "\DirectCmd\SawProbing.lua")
@@ -1185,6 +1189,12 @@ Public Class AlarmsPageUC
EgtLuaSetGlobNumVar("CMD.THICK", dToolThick * 1000)
EgtTdbGetCurrToolParam(MCH_TP.LEN, dToolLen)
EgtLuaSetGlobNumVar("CMD.LENGTH", dToolLen * 1000)
' Nuova varibile per gestione tastatura utensili Frankfurt (Polishing)
Dim nType As Integer
EgtTdbGetCurrToolParam(MCH_TP.TYPE, nType)
If m_CurrentMachine.bPolishingWheel AndAlso nType = MCH_TY.MILL_POLISHING Then
EgtLuaSetGlobStringVar("CMD.POLISHING", "1")
End If
EgtLuaSetGlobBoolVar("CMD.INCHES", m_MainWindow.m_CNCommunication.GetMachineInInches())
EgtLuaCallFunction("CMD.CmdString")
' Leggo variabili
@@ -1228,6 +1238,11 @@ Public Class AlarmsPageUC
Return
End If
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
' Se fanuc passo in modalità AUTO e attivo
If m_MainWindow.m_CNCommunication.m_nNCType = 4 Then
Dim nResult As Short = m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_WriteCncMode(0)
EgtOutLog("Impostata modalità automatica: esito " & nResult.ToString)
End If
' Aspetto e lo avvio
System.Threading.Thread.Sleep(300)
m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_CycleStart()
@@ -1277,6 +1292,10 @@ Public Class AlarmsPageUC
Dim bRead As Boolean = False
Dim SawDiameterNameVar As String = String.Empty
GetPrivateProfileString(S_MACH_PROBING, K_SAWDIAMETER, "", SawDiameterNameVar, m_MainWindow.GetMachIniFile())
' Se utensile non lama, allora la variabile in cui leggo il dato potrebbe essere differente
If Not ToolForProbing.m_IsSaw Then
GetPrivateProfileString(S_MACH_PROBING, K_TOOLLENGTH, SawDiameterNameVar, SawDiameterNameVar, m_MainWindow.GetMachIniFile())
End If
m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 0
For I As Integer = 0 To 20
' Devo rileggere la variabile ad ogni ciclo
@@ -1285,7 +1304,10 @@ Public Class AlarmsPageUC
If m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 3 Then
bRead = True
Dim dVal As Double = m_MainWindow.m_CNCommunication.m_CN.d_DReadELS_value
dVal = dVal / 1000
' Se fanuc il dato è in mm (NON MICRON)
If m_MainWindow.m_CNCommunication.m_nNCType <> 4 Then
dVal = dVal / 1000
End If
MsgBoxStateInfo.LoadingPrBr_Value = 100
' Tastatura conclusa con successo
Dim sOut As String = EgtMsg(MSG_DIRECTCUTPAGEUC + 43) & " : " & DoubleToString(dVal, 1)
+34
View File
@@ -77,6 +77,9 @@ Public Class CurrentMachine
Private m_bPolishingWheel As Boolean = False
Private m_bWaterJet As Boolean = False
' Flag che indica se gesire l'inversione del taglio nei tagli singoli
Private m_bEnableInvetrt As Boolean = True
' Abilitazione DB WaterJet
Private m_bFromDBWaterJet As Boolean = False
@@ -752,6 +755,12 @@ Public Class CurrentMachine
End Get
End Property
Friend ReadOnly Property bEnableInvert As Boolean
Get
Return m_bEnableInvetrt
End Get
End Property
Friend Property dAdditionalTable As Double
Get
Select Case GetCurrentTable()
@@ -1200,6 +1209,8 @@ Public Class CurrentMachine
m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.ENABLE_WJ)
' possibilità di definire attacco speciale per materiali ceramici
m_bSawingSpecialLeadIn = (GetPrivateProfileInt(S_MACHININGS, K_SAWINGSPECIALLEADIN, 0, sMachIniFile) > 0)
' mantengo la direzione del taglio definita nel taglio diretto
m_bEnableInvetrt = (GetPrivateProfileInt(S_DIRECTCUTS, K_ENABLEINVERT, 1, sMachIniFile) <> 0)
' Leggo utensili correnti
' lama
@@ -1351,6 +1362,29 @@ Public Class CurrentMachine
m_nEnableBarCodeReader = GetPrivateProfileInt(S_MACH_BARCODEREADER, K_ENABLEBCR, 0, sMachIniFile)
End Sub
' Per il controllo FANUC al momento dell'inizializzazione del CN devono essere lette alcune variabili
Public Sub InitFANUC(CN_Generic As CN_generico)
' Leggo ritardo tra reset e send per NUM
m_nResetSendDelay = GetPrivateProfileInt(S_NCFANUC, K_RESETSENDDELAY, 1000, sMachIniFile)
' Leggo ritardo tra reset e send per NUM
m_nThreadSleep = GetPrivateProfileInt(S_NCFANUC, K_THREADSLEEP, 150, sMachIniFile)
' Leggo i dati strettamente correlati alla comunicazione NC-PC
Dim CN As CN_generico = CN_Generic
' Leggo l'indirizzo in cui scrivere lo stato macchina
Dim dAddNcMode As String = CN.s_addr_set_nc_mode
GetPrivateProfileString(S_NCFANUC, K_SETNCMODE, CN.s_addr_set_nc_mode, CN.s_addr_set_nc_mode, sMachIniFile)
' Leggo primo indirizzo libero delle variabili di tipo intero
CN.n_Base_addr_int_vars = GetPrivateProfileInt(S_NCFANUC, K_BASEADDRINT, CN.n_Base_addr_int_vars, sMachIniFile)
' Leggo primo indirizzo libero delle variabili di tipo bit
CN.n_Base_addr_byte_for_bits_vars = GetPrivateProfileInt(S_NCFANUC, K_BASEADDRBIT, CN.n_Base_addr_byte_for_bits_vars, sMachIniFile)
' Leggo numero di variabili di tipo intero
CN.n_num_var_int_to_read = CShort(GetPrivateProfileInt(S_NCFANUC, K_NUMVARINT, CInt(CN.n_num_var_int_to_read), sMachIniFile))
' Leggo numero di varibili di tipo bit
CN.n_num_var_byte_for_bits_to_read = CShort(GetPrivateProfileInt(S_NCFANUC, K_NUMVARBIT, CInt(CN.n_num_var_byte_for_bits_to_read), sMachIniFile))
' Leggo variabile abilitata alla gestione di FeedHold
GetPrivateProfileString(S_NCFANUC, K_SETNCMODE, CN.s_addr_feedhold, CN.s_addr_feedhold, sMachIniFile)
End Sub
Public Sub LoadWJMaterial(Optional bIsStart As Boolean = False)
Dim TempCurrMat As Material = CurrMat
' Svuoto l'attuale lista di materiali
+1 -1
View File
@@ -62,7 +62,7 @@
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<Button Name="StartBtn" Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
<Button Name="StartBtn" Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
<Button Name="StopBtn" Grid.Column="1"
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
<Button Name="ResetBtn" Grid.Column="2"
+2
View File
@@ -304,6 +304,8 @@ Public Class MachineStatusUC
If m_MainWindow.m_CNCommunication.m_nNCType = 3 AndAlso m_MainWindow.m_CNCommunication.m_CN.m_IsSiemensOne Then
dSpindlePower = m_CN.d_data(0)
dSpindleOvr = m_CN.d_data(1)
ElseIf m_MainWindow.m_CNCommunication.m_nNCType = 4 Then
dSpindlePower = m_CN.d_spindle_power / 1000
Else
dSpindlePower = m_CN.d_spindle_power
dSpindleOvr = If(m_CN.bPowerOvr > 0, m_CN.d_spindle_power / m_CN.bPowerOvr * 100, 0)
+2 -2
View File
@@ -9,7 +9,7 @@
<!-- Definizione del ToolHolderUc -->
<Grid>
<Image Source="/Resources/ToolChangerPos.png"/>
<ToggleButton Name="Tool" Width="50" Height="50" Margin="22,40,26,8" Background="#7FB4B4B4">
<ToggleButton Name="Tool" Width="50" Height="50" Margin="62,10,16,10" Background="#7FB4B4B4">
<ToggleButton.Template>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Grid>
@@ -25,7 +25,7 @@
</ToggleButton.Template>
</ToggleButton>
<TextBlock Name="PositionNameTxBl" Height="22" Width="68" FontSize="16" Margin="12,16,41,61"/>
<TextBlock Name="PositionNameTxBl" Height="22" Width="50" FontSize="16" Margin="20,40,70,53"/>
</Grid>
</UserControl>
+2 -2
View File
@@ -328,8 +328,8 @@ Class MainWindow
' Verifico abilitazione nesting automatico
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
' Recupero opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2503, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2503, 1, m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2505, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2505, 1, m_nKeyOptions)
' Verifico abilitazione prodotto
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
' Inizializzazione generale di EgtInterface
+2 -2
View File
@@ -62,5 +62,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.5.3.1")>
<Assembly: AssemblyFileVersion("2.5.3.1")>
<Assembly: AssemblyVersion("2.5.5.1")>
<Assembly: AssemblyFileVersion("2.5.5.1")>
+272 -12
View File
@@ -2,7 +2,8 @@
Imports System.Globalization
Imports System.Collections.ObjectModel
Imports EgtUILib
Imports OmagCUT.Num
Imports System.IO
Imports System.Text
Public Class CNCommunication
@@ -32,6 +33,7 @@ Public Class CNCommunication
Private m_bNewDeltaData As Boolean = True
Private m_bNewVarData As Boolean = False
Private m_bTimerBusy As Boolean = False
Private m_bTimerAxesBusy As Boolean = False
Private m_IsNewConsole As Boolean = False
@@ -40,6 +42,7 @@ Public Class CNCommunication
' Timer
Private m_RefreshTimer As New DispatcherTimer
Private m_RefreshAxesFanuc As New DispatcherTimer
' Nomi e indici degli assi macchina
Private m_bAxesOk As Boolean = False
@@ -102,6 +105,12 @@ Public Class CNCommunication
m_RefreshTimer.Interval = TimeSpan.FromMilliseconds(100)
m_RefreshTimer.Start()
End If
' solo per controllo FANUC creo un timer apposito solo per la lettura degli assi
If m_nNCType = 4 Then
AddHandler m_RefreshAxesFanuc.Tick, AddressOf RefreshAxesFanucTimer_tick
m_RefreshAxesFanuc.Interval = TimeSpan.FromMilliseconds(50)
m_RefreshAxesFanuc.Start()
End If
' Leggo dati sugli assi della macchina
ReadAxesData()
@@ -118,6 +127,8 @@ Public Class CNCommunication
If m_nNCType = 3 Then
RefreshNoEvents()
ElseIf m_nNCType = 4 Then
RefreshFANUC()
Else
Refresh()
End If
@@ -130,8 +141,22 @@ Public Class CNCommunication
End Sub
Private Sub RefreshAxesFanucTimer_tick()
If Not m_bTimerAxesBusy Then
m_bTimerAxesBusy = True
m_RefreshAxesFanuc.Stop()
RefreshAxesFANUC()
m_bTimerAxesBusy = False
m_RefreshAxesFanuc.Start()
Else
Dim nDummy As Integer = 10
End If
End Sub
Private Sub ReadAxesData()
' Nomi e indici degli assi macchina
' Nomi e indici degli assi macchina: definisco il nome degli assi da satampare nella pagina MachineStatusUC
m_bAxesOk = True
GetPrivateProfileString(S_AXES, K_L1NAME, "X", m_sA1, m_MainWindow.GetMachIniFile())
m_nA1 = GetPrivateProfileInt(S_AXES, K_L1ID, 0, m_MainWindow.GetMachIniFile())
@@ -223,6 +248,11 @@ Public Class CNCommunication
m_CN = New Num.NumNC
Case 3
m_CN = New CN_Siemens
Case 4
' Fanuc
m_CN = New Fanuc.Fanuc
' proveddo a sovrscrivere i datti di comunicazione PC-NC settati di default nella classe CN_Generico
m_MainWindow.m_CurrentMachine.InitFANUC(m_CN)
End Select
' Recupero la stringa di inizializzazione della comunicazione
@@ -355,6 +385,11 @@ Public Class CNCommunication
If Not String.IsNullOrEmpty(sVal) Then m_CN.SetCnDataVar(CN_generico.CnData.Remote, sVal)
End If
' Solo per controllo FANUNC
GetPrivateProfileString(S_NCDATA, K_NAXES, "", sVal, m_MainWindow.GetMachIniFile())
m_CN.SetCnDataVar(CN_generico.CnData.nAxes, sVal)
' Inizializzo la comunicazione
m_CN.Init()
@@ -419,6 +454,17 @@ Public Class CNCommunication
m_MachineStatus.MachineStatusGrid.Background = Application.Current.FindResource("OmagCut_Red")
End Try
End If
Case 4
If IsNothing(m_CN) OrElse m_CN.n_state < 2 Then
' Per evitare crash con azioni verso il controllo, avvio quello di debug
m_nNCType = 0
Me.m_CN = New CN_Debug
m_MachineStatus.MachineStatusGrid.Background = Application.Current.FindResource("OmagCut_Red")
Else
' ATTENZIONE: durante l'inizializzazione della classe il vettore che contiene tutti gli indirizzi di memoria non è caricato
m_CN.b_axis_events_enable = True
m_MachineStatus.MachineStatusGrid.Background = Application.Current.FindResource("OmagCut_DarkGray")
End If
End Select
' Assegno riferimento al CN alle diverse pagine
@@ -465,6 +511,7 @@ Public Class CNCommunication
m_MachineStatus.DisplayPositionDelta()
End If
' ----- INIZIO: lettura diretta di specifiche vaiabili -----
If m_CN.b_feed_changed Then
m_CN.b_feed_changed = False
m_MachineStatus.DisplayFeed()
@@ -491,6 +538,7 @@ Public Class CNCommunication
'FrmMain.LblToolRad.Text = cn.Tools(0).radius.ToString
'FrmMain.LblToolComp.Text = cn.Tools(0).comp_num.ToString
End If
' ----- FINE : lettura diretta di specifiche vaiabili -----
Select Case m_nNCType
Case 1
@@ -532,6 +580,7 @@ Public Class CNCommunication
'End If
End If
' QUESTE VARIABILI NON SONO LETTE IN QUANTO NON SONO STATE CARICATE → vedere come esempio il NUM che assegna queste variabili
' Flag e variabili per bottoni macchina, che verifico solo nelle pagine in cui ci sono
If m_MainWindow.m_ActivePage = MainWindow.Pages.DirectCut Then
If m_MainWindow.m_DirectCutPageUC.m_NewMachineButtonsType Then
@@ -570,8 +619,186 @@ Public Class CNCommunication
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.CloseAllChanged(m_CN.bCloseAllState)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Open123Changed(m_CN.bOpen123State)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Open456Changed(m_CN.bOpen456State)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Close123Changed(m_CN.bClose123State)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Close456Changed(m_CN.bClose456State)
' in assenza della configurazione delle variabili Close123 e Close456
If Not String.IsNullOrEmpty(m_CN.m_szCnDataVar(CN_generico.CnData.Close123State)) Then
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Close123Changed(m_CN.bClose123State)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Close456Changed(m_CN.bClose456State)
Else
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Close123Changed(Not m_CN.bOpen123State)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Close456Changed(Not m_CN.bOpen456State)
End If
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.BlowChanged(m_CN.bBlowState)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.VacuumOnChanged(m_CN.bVacuumOn)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.VacuumOffChanged(m_CN.bVacuumOff)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.BypassChanged(m_CN.bBypassState)
' Nuovi bottoni (uso joystick)
If m_IsNewConsole Then
m_MainWindow.m_DirectCutPageUC.XYJogChanged(m_CN.bXYJog)
m_MainWindow.m_DirectCutPageUC.ZCJogChanged(m_CN.bZCJog)
m_MainWindow.m_DirectCutPageUC.ZBJogChanged(m_CN.bZBCJog)
m_MainWindow.m_DirectCutPageUC.RemoteChanged(m_CN.bRemote)
m_MainWindow.m_DirectCutPageUC.ParkingStateChanged(m_CN.bParkingState)
End If
Else
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.SpindleStateChanged(m_CN.bSpindleState)
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.CoolantStateChanged(m_CN.bCoolantState OrElse m_CN.bInternalCoolantState OrElse m_CN.bExternCoolantState)
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.LaserStateChanged(m_CN.bLaserState)
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.LaserTracStateChanged(m_CN.bLaserTracState)
If m_CN.Is_G24_active() Then
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.ThreeAxisStateChanged(False)
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.FiveAxisStateChanged(True)
Else
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.ThreeAxisStateChanged(True)
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.FiveAxisStateChanged(False)
End If
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.DoorStateChanged(m_CN.nDoorClosedState)
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.ParkingStateChanged(m_CN.bParkingState)
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.EnableZoneStateChanged(m_CN.nEnableZone)
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.EnablePcStateChanged(m_CN.nEnablePc)
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.TableUpChanged(m_CN.bTableUpState)
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.TableDownChanged(m_CN.bTableDownState)
' Nuovi bottoni (uso joystick) per Area4
If m_IsNewConsole Then
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.XYJogChanged(m_CN.bXYJog)
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.ZJogChanged(m_CN.bZCJog)
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.BCJogChanged(m_CN.bZBCJog)
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.RemoteChanged(m_CN.bRemote)
m_MainWindow.m_DirectCutPageUC.ParkingStateChanged(m_CN.bParkingState)
End If
End If
End If
If m_MainWindow.m_ActivePage = MainWindow.Pages.RawPart Then
m_MainWindow.m_RawPartPage.m_MachineButtons.LaserStateChanged(m_CN.bLaserState)
End If
' Nuove bottoni (Power Macchina)
If m_MainWindow.m_ActivePage = MainWindow.Pages.Machine Then
If m_IsNewConsole Then
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.PowerONChanged(m_CN.bPowerON)
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.PowerOFFChanged(Not m_CN.bPowerON)
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.CncModeChange(m_CN.nMachineMode)
End If
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.CncModeChange(m_CN.nMachineMode)
End If
If m_MainWindow.m_ActivePage = MainWindow.Pages.WorkInProgress Then
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.SpindleStateChanged(m_CN.bSpindleState)
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.CoolantStateChanged(m_CN.bCoolantState OrElse m_CN.bInternalCoolantState OrElse m_CN.bExternCoolantState)
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.LaserStateChanged(m_CN.bLaserState)
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.LaserTracStateChanged(m_CN.bLaserTracState)
If m_CN.Is_G24_active() Then
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.ThreeAxisStateChanged(False)
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.FiveAxisStateChanged(True)
Else
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.ThreeAxisStateChanged(True)
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.FiveAxisStateChanged(False)
End If
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.DoorStateChanged(m_CN.nDoorClosedState)
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.ParkingStateChanged(m_CN.bParkingState)
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.EnableZoneStateChanged(m_CN.nEnableZone)
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.EnablePcStateChanged(m_CN.nEnablePc)
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.TableUpChanged(m_CN.bTableUpState)
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.TableDownChanged(m_CN.bTableDownState)
End If
End Sub
Private Sub RefreshAxesFANUC()
' ----- INIZIO: lettura diretta di specifiche vaiabili -----
' avvio lettura variabili da CN
m_CN.Geppo()
' notifico valori all'interfaccia
m_MachineStatus.DisplayPosition()
m_MachineStatus.DisplayPositionDelta()
m_MachineStatus.DisplayFeed()
m_MachineStatus.DisplaySpeed()
m_MachineStatus.DisplayPower()
End Sub
Private Sub RefreshFANUC()
' Copia della funzione Refresh
' ----- INIZIO: lettura diretta di specifiche vaiabili -----
'' avvio lettura variabili da CN
'm_CN.Geppo()
'' notifico valori all'interfaccia
'm_MachineStatus.DisplayPosition()
'm_MachineStatus.DisplayPositionDelta()
'm_MachineStatus.DisplayFeed()
'm_MachineStatus.DisplaySpeed()
'm_MachineStatus.DisplayPower()
' eventualmente carico messaggi di errore
ErrorList.Clear()
If m_CN.b_NC_error Then
ErrorList.Clear()
SyncLock m_CN
For Each Item As String In m_CN.sz_NC_error_messages
ErrorList.Add(Item)
Next
End SyncLock
End If
m_AlarmsPage.NcError()
' ----- FINE : lettura diretta di specifiche vaiabili -----
If m_CN.read_active_mode() <> CShort(m_nCurrMode) Then
m_nCurrMode = CInt(m_CN.read_active_mode())
m_MachineStatus.DisplayActiveMode(m_nCurrMode)
m_CN.nMachineMode = m_nCurrMode
End If
' QUESTE VARIABILI NON SONO LETTE IN QUANTO NON SONO STATE CARICATE → vedere come esempio il NUM che assegna queste variabili
' Flag e variabili per bottoni macchina, che verifico solo nelle pagine in cui ci sono
If m_MainWindow.m_ActivePage = MainWindow.Pages.DirectCut Then
If m_MainWindow.m_DirectCutPageUC.m_NewMachineButtonsType Then
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.SpindleStateChanged(m_CN.bSpindleState)
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.LaserStateChanged(m_CN.bLaserState)
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.LaserTracStateChanged(m_CN.bLaserTracState)
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.CoolantStateChanged(m_CN.bCoolantState)
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.InternalCoolantStateChanged(m_CN.bInternalCoolantState)
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.ExternCoolantStateChanged(m_CN.bExternCoolantState)
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.CBAxesStateChanged(m_CN.bCBAxesState)
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.AirBlowStateChanged(m_CN.bAirBlowState)
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.HomeStateChanged(m_CN.bHomeState)
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.TableUpChanged(m_CN.bTableUpState)
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.TableDownChanged(m_CN.bTableDownState)
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.DoorClosedChanged(m_CN.nDoorClosedState)
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.LimitZChanged(m_CN.bLimitZState)
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.FiveAxisStateChanged(m_CN.Is_G24_active())
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.ParkingStateChanged(m_CN.bParkingState)
'm_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.ZoneStateChanged(m_CN.nEnableZone)
'm_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.PcStateChanged(m_CN.nEnablePc)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.VacuumUpChanged(m_CN.bVacuumUp)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.VacuumDownChanged(m_CN.bVacuumDown)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum2UpChanged(m_CN.bVacuum2Up)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum2DownChanged(m_CN.bVacuum2Down)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum0Changed(m_CN.bVacuum0)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum90Changed(m_CN.bVacuum90)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum1Changed(m_CN.bVacuum1State)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum2Changed(m_CN.bVacuum2State)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum3Changed(m_CN.bVacuum3State)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum4Changed(m_CN.bVacuum4State)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum5Changed(m_CN.bVacuum5State)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum6Changed(m_CN.bVacuum6State)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum135Changed(m_CN.bVacuum135State)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum246Changed(m_CN.bVacuum246State)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.OpenAllChanged(m_CN.bOpenAllState)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.CloseAllChanged(m_CN.bCloseAllState)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Open123Changed(m_CN.bOpen123State)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Open456Changed(m_CN.bOpen456State)
' in assenza della configurazione delle variabili Close123 e Close456
If Not String.IsNullOrEmpty(m_CN.m_szCnDataVar(CN_generico.CnData.Close123State)) Then
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Close123Changed(m_CN.bClose123State)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Close456Changed(m_CN.bClose456State)
Else
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Close123Changed(Not m_CN.bOpen123State)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Close456Changed(Not m_CN.bOpen456State)
End If
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.BlowChanged(m_CN.bBlowState)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.VacuumOnChanged(m_CN.bVacuumOn)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.VacuumOffChanged(m_CN.bVacuumOff)
@@ -929,20 +1156,50 @@ Public Class CNCommunication
EgtOutLog(TimeSpanEnd())
' Attesa opportuna
System.Threading.Thread.Sleep(100)
ElseIf m_nNCType = 4 Then
' FANUC: imposto modalità EDIT
bOk = bOk AndAlso (m_CN.DGeneralFunctions_WriteCncMode(1) = 0)
' Attesa opportuna
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
End If
EgtOutLog("Download_NC_prog(sCncPath, sNumProg)")
' -------------- START DOWNLOAD --------------
TimeSpanInit()
bOk = bOk AndAlso (m_CN.Download_NC_prog(sCncPath, sNumProg) = 0)
' Attesa opportuna
System.Threading.Thread.Sleep(100)
' FANUC: genero un file 901 vuoto da aspedire, attivare; poi rispedisco il file 900
If m_nNCType = 4 And Not bOk Then
bOk = True
Dim sCncPath1 As String = m_MainWindow.GetCncDir() & "\PlaceHolder" & m_MainWindow.m_CurrentMachine.sIsoFileExt
Dim fs As FileStream = File.Create(sCncPath1)
' Add text to the file.
Dim info As Byte() = New UTF8Encoding(True).GetBytes(vbLf & "(PlaceHolder)")
fs.Write(info, 0, info.Length)
fs.Close()
bOk = bOk AndAlso (m_CN.Download_NC_prog(sCncPath1, "901") = 0)
' Attesa opportuna
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
If bActivate Then
bOk = bOk AndAlso (m_CN.ActivateProgram("901") = 0)
' Attesa opportuna
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
End If
' riprovo ad eseguire il programma 900
bOk = True
bOk = bOk AndAlso (m_CN.Download_NC_prog(sCncPath, sNumProg) = 0)
' Attesa opportuna
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
End If
EgtOutLog("Nc Type : " & m_nNCType.ToString)
EgtOutLog("IsDripFeed : " & DirectCast(m_CN, NumNCOld).bIsDripFeed)
If m_nNCType = 1 AndAlso TypeOf m_CN Is NumNCOld AndAlso DirectCast(m_CN, NumNCOld).bIsDripFeed Then
' eventauli cambi di stato sono trattati all'interno della funzione
' AXIUM (NUM OLD): se DripFeed non esegluo attivazione programma)
If m_nNCType = 1 AndAlso m_CN.bIsDripFeed Then
' eventauli cambi di stato sono trattati all'interno della funzione DownLoad_NC_prog
Return True
End If
EgtOutLog(TimeSpanEnd())
' Attesa opportuna
System.Threading.Thread.Sleep(100)
' -------------- END DOWNLOAD --------------
' -------------- START ACTIVATE --------------
' Se richiesta attivazione
If bActivate Then
' Attivazione programma
@@ -952,13 +1209,16 @@ Public Class CNCommunication
EgtOutLog(TimeSpanEnd())
' Attesa opportuna
System.Threading.Thread.Sleep(100)
' Attivo la modalità AUTO prima per preparar il cyclo start
bOk = bOk AndAlso (m_CN.DGeneralFunctions_WriteCncMode(0) = 0)
' Attesa opportuna
System.Threading.Thread.Sleep(100)
' Modalità automatica
EgtOutLog("DGeneralFunctions_WriteCncMode(0)")
TimeSpanInit()
bOk = bOk AndAlso (m_CN.DGeneralFunctions_WriteCncMode(0) = 0)
EgtOutLog(TimeSpanEnd())
End If
' -------------- END ACTIVATE --------------
' Messaggio con risultato
If bOk Then
m_CurrProjPage.SetInfoMessage(EgtMsg(90317)) 'Programma CN trasmesso con successo
+63 -4
View File
@@ -8,7 +8,7 @@ Public MustInherit Class CN_generico
Public Const MAX_VAR As Short = 100
Public Const MAX_VALUES As Short = 9 ' Max. index to read the data from the FXServer array
Public Const MAX_TOOLS As Short = 100
Public Const NUM_DATA = 55 ' Numero di dati del CN (Speed,Feed,...)
Public Const NUM_DATA = 56 ' Numero di dati del CN (Speed,Feed,...)
Public m_NewVariable As Boolean = False ' per scrittura delle vairbaili Apllication del PLC
@@ -70,8 +70,18 @@ Public MustInherit Class CN_generico
Parking = 52
EnableZone = 53
EnablePC = 54
nAxes = 55
End Enum
Public Enum Type As Short
TBoolean = 0
TInteger = 1
TLong = 2
TDouble = 3
TString = 4
End Enum
#End Region
#Region " Struct"
@@ -218,10 +228,27 @@ Public MustInherit Class CN_generico
Public bRemote As Boolean
' Nuovi di bottoni -------------------------------------------
' solo per NumOld
Public bIsDripFeed As Boolean = False
' usato nel FANUC per leggere lo stato macchina se 5 assi attivo
Public b5AxesActive As Boolean
Public nMachineMode As Integer
Public m_szCnDataVar(NUM_DATA - 1) As String
'
' nuovi dal 29-III-2023 per Fanuc
'
Public n_Base_addr_int_vars As Integer = 59800
Public n_Base_addr_byte_for_bits_vars As Integer = 59820
Public n_num_var_int_to_read As Short = 10
Public n_num_var_byte_for_bits_to_read As Short = 30
Public s_addr_set_nc_mode As String = "D59825"
Public s_addr_feedhold As String = "D59850.6"
'
' Eventi
'
Public Event NewPositionData(ByVal sender As Object)
Public Event NewPosDeltaData(ByVal sender As Object)
Public Event NewVarChanged(ByVal sender As Object)
@@ -294,8 +321,8 @@ Public MustInherit Class CN_generico
Public MustOverride Function DTool_set_read_range(n_start As Short, n_stop As Short) As Short
Public MustOverride Function DTool_write_tool(n_tool_number As Short, Length_X As Double, Radius As Double, TipRadius_Z As Double, _
DLength_X As Double, DTipRadius_Z As Double, _
Public MustOverride Function DTool_write_tool(n_tool_number As Short, Length_X As Double, Radius As Double, TipRadius_Z As Double,
DLength_X As Double, DTipRadius_Z As Double,
nDirection As Short, nType As Short, nH As Integer) As Short
Public Overridable Function SetProgramMainOrSub(bMain As Boolean) As Boolean
@@ -341,4 +368,36 @@ Public MustInherit Class CN_generico
#End Region
#Region " Nuovi metodi pubblici"
Public Overridable Function NC_read_var_short(VarAddr As String, ByRef value As Short) As Boolean
Return False
End Function
Public Overridable Function NC_read_var_short_range(VarStartAddr As String, VarEndAddr As String, ByRef values() As Short) As Boolean
Return False
End Function
Public Overridable Function NC_write_var_short(VarAddr As String, ByRef value As Short) As Boolean
Return False
End Function
Public Overridable Function NC_read_var_bit(VarAddr As String, ByRef value As Boolean) As Boolean
Return False
End Function
Public Overridable Function NC_write_var_bit(VarAddr As String, ByRef value As Boolean) As Boolean
Return False
End Function
Public Overridable Function NC_pulse_bit(VarAddr As String) As Boolean
Return False
End Function
Public Overridable Function Geppo() As Boolean
Return False
End Function
#End Region
End Class
+1711
View File
File diff suppressed because it is too large Load Diff
+1351
View File
File diff suppressed because it is too large Load Diff
+1 -4
View File
@@ -12,16 +12,13 @@ Imports EgtUILib
Imports System.IO
Imports System.Threading
Imports System.Windows.Threading
Imports System.Reflection.Emit
Imports System.Drawing.Text
Imports OmagCUT.CN_Siemens
Namespace Num
Public Class NumNCOld
Inherits CN_generico
Public bIsDripFeed As Boolean = False
'Public bIsDripFeed As Boolean = False
' costruisco il riferimento alla pagina principale
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
' costruisco il riferimento alla barra ProjectMng
+10794
View File
File diff suppressed because it is too large Load Diff
+23 -5
View File
@@ -122,11 +122,13 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\EgtProg\DllD32\EgtUILib.dll</HintPath>
</Reference>
<Reference Include="EgtWPFLib">
<HintPath>..\..\EgtProg\DllD32\EgtWPFLib.dll</HintPath>
<Reference Include="EgtWPFLib, Version=2.5.2.2, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\EgtProg\Dll32\EgtWPFLib.dll</HintPath>
</Reference>
<Reference Include="EgtWPFLib5">
<HintPath>..\..\EgtProg\OmagCUT\EgtWPFLib5.dll</HintPath>
<Reference Include="EgtWPFLib5, Version=2.5.2.2, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\EgtProg\Dll32\EgtWPFLib5.dll</HintPath>
</Reference>
<Reference Include="Interop.FXLib">
<HintPath>..\..\EgtProg\OmagCUT\Interop.FXLib.dll</HintPath>
@@ -225,6 +227,9 @@
<Compile Include="Machine\WaterJetPageUC.xaml.vb">
<DependentUpon>WaterJetPageUC.xaml</DependentUpon>
</Compile>
<Compile Include="NcComm\fwlib32.vb" />
<Compile Include="NcComm\M_Fanuc.vb" />
<Compile Include="NcComm\M_Fanuc_hi.vb" />
<Compile Include="Project\AddToDataBaseUC.xaml.vb">
<DependentUpon>AddToDataBaseUC.xaml</DependentUpon>
</Compile>
@@ -240,6 +245,9 @@
<Compile Include="Project\CicloStartWD.xaml.vb">
<DependentUpon>CicloStartWD.xaml</DependentUpon>
</Compile>
<Compile Include="RawPhoto\OtherRefTabWD.xaml.vb">
<DependentUpon>OtherRefTabWD.xaml</DependentUpon>
</Compile>
<Compile Include="RawPhoto\SlabIdWD.xaml.vb">
<DependentUpon>SlabIdWD.xaml</DependentUpon>
</Compile>
@@ -514,6 +522,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="RawPhoto\OtherRefTabWD.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="RawPhoto\SlabIdWD.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -896,7 +908,7 @@
<Resource Include="Resources\MachineStatusImage\Single.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolChangerPos.png" />
<Resource Include="Resources\ToolChangerPos_OLD.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Manual.png" />
@@ -1322,6 +1334,12 @@
<ItemGroup>
<Resource Include="Resources\NewIcons\Quality.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolChangerPos.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\RefTab.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTR32.exe
+1
View File
@@ -32,6 +32,7 @@
<BitmapImage x:Key="AlignPiecesImg" UriSource="Resources/NewIcons/ruota-oggetto-inclinato.png"></BitmapImage>
<BitmapImage x:Key="BarCodeImg" UriSource="Resources/NewIcons/BarCode.png"></BitmapImage>
<BitmapImage x:Key="SlabIdImg" UriSource="Resources/NewIcons/SlabId.png"></BitmapImage>
<BitmapImage x:Key="RefTabImg" UriSource="Resources/NewIcons/RefTab.png"></BitmapImage>
<BitmapImage x:Key="BottomLeftImg" UriSource="Resources/NewIcons/1-BottomLeft.png"></BitmapImage>
<BitmapImage x:Key="BottomRightImg" UriSource="Resources/NewIcons/2-BottomRight.png"></BitmapImage>
<BitmapImage x:Key="PartRotOnImg" UriSource="Resources/NewIcons/PartRotOn.png"></BitmapImage>
+1
View File
@@ -102,6 +102,7 @@
<BitmapImage x:Key="AlignPiecesImg" UriSource="Resources/AlignPieces.png"></BitmapImage>
<BitmapImage x:Key="BarCodeImg" UriSource="Resources/BarCode.png"></BitmapImage>
<BitmapImage x:Key="SlabIdImg" UriSource="Resources/SlabId.png"></BitmapImage>
<BitmapImage x:Key="RefTabImg" UriSource="Resources/NewIcons/RefTab.png"></BitmapImage>
<BitmapImage x:Key="BottomLeftImg" UriSource="Resources/BottomLeft.png"></BitmapImage>
<BitmapImage x:Key="BottomRightImg" UriSource="Resources/BottomRight.png"></BitmapImage>
<BitmapImage x:Key="PartRotOnImg" UriSource="Resources/PartRotOn.png"></BitmapImage>
+20 -1
View File
@@ -412,6 +412,11 @@ Public Class CurrentProjectPageUC
SetTotalArea(dTotArea)
UpdateToProduceArea()
ShowAreas()
' Salvo info di C home
Dim dCHome As Double
EgtGetAxisHomePos("C", dCHome)
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME, DoubleToString(dCHome, 0))
EgtZoom(ZM.ALL)
' Dichiaro progetto non modificato
EgtResetModified()
Return True
@@ -522,7 +527,21 @@ Public Class CurrentProjectPageUC
m_MainWindow.m_CurrentMachine.dAdditionalTable = dValue
End If
' forzo visualizzazione eventuali dati su aree
SetAreasStatus( True)
SetAreasStatus(True)
' Recupero info C Home
Dim dCHomeCurrMach As Double
Dim dCHomeCurrproj As Double
EgtGetAxisHomePos("C", dCHomeCurrMach)
' Verifico che esista l'info del progetto
If EgtExistsInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME) Then
EgtGetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME, dCHomeCurrproj)
' Se la macchina indicata ha C Home differente allora comunico un errore del progetto
If Math.Abs(dCHomeCurrproj - dCHomeCurrMach) > EPS_ANG_SMALL Then
EgtOutLog(" WARNING -> C axes home project is different from current machine, delta ang C home:" & DoubleToString(dCHomeCurrproj - dCHomeCurrMach, 2))
End If
Else
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME, DoubleToString(dCHomeCurrMach, 0))
End If
' Dichiaro progetto non modificato
EgtResetModified()
Return True
+4 -1
View File
@@ -101,7 +101,6 @@ Public Class ProjectMgrUC
m_CurrProjPage.NewProject(nTabInd, bRetainParkedParts)
' Gestione stato FastGrid
m_MainWindow.m_CadCutPageUC.m_FastGridSlabManager.OnPostNewProject()
EgtZoom(ZM.ALL)
End Sub
Friend Function ChooseTable() As Integer
@@ -264,6 +263,10 @@ Public Class ProjectMgrUC
Dim nWarn As Integer = 0
ResetAllMachinings(nWarn)
If nWarn = 1 Then m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SPLITPAGEUC + 11)) ' Lama troppo grande per utilizzo ventosa
' Aggiorno Info C Home
Dim dCHome As Double
EgtGetAxisHomePos("C", dCHome)
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME, DoubleToString(dCHome, 0))
' Aggiorno visualizzazione
EgtDraw()
End Sub
+82
View File
@@ -0,0 +1,82 @@
<Window x:Class="OtherRefTabWD"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
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">
<!--Definizione della pagina di scelta del nome con cui salvare il progetto-->
<Border Style="{DynamicResource OmagCut_Border}">
<Grid x:Name="SaveNameGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="0.2*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<!--<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>-->
<RowDefinition Height="0.2*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.2*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.2*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.2*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="0.2*"/>
</Grid.RowDefinitions>
<TextBlock Name="RefRawTxbl" Grid.Column="1" Grid.Row="1"
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<ComboBox Name="RefTabModeCmBx" Grid.Column="2" Grid.Row="1" Style="{StaticResource OmagCut_ComboBox}"
MaxDropDownHeight="300" Margin="0,0,0,0">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Name="RefTabXTxbl" Grid.Column="1" Grid.Row="3"
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="RefTabXTxBx" Grid.Column="2" Grid.Row="3"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="RefTabYTxbl" Grid.Column="1" Grid.Row="5"
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="RefTabYTxBx" Grid.Column="2" Grid.Row="5"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<Grid Name="ButtonsGrid" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="7" Grid.RowSpan="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Button Name="OkBtn" Grid.Column="1"
Style="{DynamicResource OmagCut_GradientBlueIconButton}">
<Image Source="{DynamicResource VImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="ExitBtn" Grid.Column="3"
IsCancel="True"
Style="{DynamicResource OmagCut_GradientBlueIconButton}">
<Image Source="{DynamicResource XImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
</Grid>
</Grid>
</Border>
</Window>
+108
View File
@@ -0,0 +1,108 @@
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib
Public Class OtherRefTabWD
Dim m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
Dim m_RawPartPage As RawPartPageUC
Private m_sPosX As String = "0"
Private m_sPosY As String = "0"
Private m_dPrevOffsetX As Double = 0
Private m_dPrevOffsetY As Double = 0
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)
Me.Owner = Owner
' La chiamata è richiesta dalla finestra di progettazione.
InitializeComponent()
' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent().
m_sPosX = PosX
m_sPosY = PosY
m_dPrevOffsetX = OffsetX
m_dPrevOffsetY = OffsetY
m_SelIndex = OtherRefMode
End Sub
Private Sub OtherRrefTabWD_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
' costruisco il riferimento alla pagina Raw
m_RawPartPage = m_MainWindow.m_RawPartPage
' posiziono la finestra
Me.Top = Owner.Top + Owner.Height / 4 - Me.Height / 2
Me.Left = Owner.Left + Owner.Width / 6 - Me.Width / 2
RefRawTxbl.Text = "Raw reference"
RefTabXTxbl.Text = "Position X"
RefTabYTxbl.Text = "Position Y"
RefTabModeCmBx.ItemsSource = m_RawPartPage.m_OtherRefTabList
RefTabModeCmBx.SelectedIndex = m_RawPartPage.m_OtherRefTabPos
End Sub
Private Sub OtherRrefTabWD_Load(sender As Object, e As EventArgs) Handles Me.Loaded
RefTabXTxBx.Text = m_sPosX
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())
m_RawPartPage.RefTabModeChange()
End Sub
Private Sub RefTabXTxBx_EgtClosed(sender As Object, e As EventArgs) Handles RefTabXTxBx.EgtClosed
Dim ptMin, ptMax As Point3d
If EgtGetTableArea(1, ptMin, ptMax) Then
Dim dX As Double = 0
StringToLen(RefTabXTxBx.Text, dX)
If Not (dX > 0 And dX < ptMax.x - ptMin.x) Then
If dX > 0 Then
dX = ptMax.x - ptMin.x
Else
dX = 0
End If
RefTabXTxBx.Text = LenToString(dX, 2)
' errore, posizione fuori dalla tavola
End If
m_RawPartPage.m_OtherRefTabX = dX
m_RawPartPage.RefTabModeChange()
End If
End Sub
Private Sub RefTabYTxBx_EgtClosed(sender As Object, e As EventArgs) Handles RefTabYTxBx.EgtClosed
Dim ptMin, ptMax As Point3d
If EgtGetTableArea(1, ptMin, ptMax) Then
Dim dY As Double = 0
StringToLen(RefTabYTxBx.Text, dY)
If Not (dY > 0 And dY < ptMax.y - ptMin.y) Then
If dY > 0 Then
dY = ptMax.y - ptMin.y
Else
dY = 0
End If
RefTabYTxBx.Text = LenToString(dY, 2)
' errore, posizione fuori dalla tavola
End If
m_RawPartPage.m_OtherRefTabY = dY
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())
Me.Close()
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
m_RawPartPage.RefTabModeChange()
End Sub
End Class
+153 -144
View File
@@ -6,76 +6,76 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="853.3" d:DesignWidth="1280" Loaded="RawPartPage_Loaded" Initialized="RawPartPage_Initialized" Unloaded="RawPartPage_Unloaded">
<!-- Definizione della RowPartPage -->
<Grid Name="RowPartPageGrid" >
<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="LeftButtonGrid" Grid.RowSpan="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="1.5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="4*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="1.*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<RadioButton Name="OutlineBtn" Style="{DynamicResource OmagCut_YellowToggleButton}"
GroupName="DefinitionMethod_GrezzoUC"/>
<RadioButton Name="DamagedBtn" Style="{DynamicResource OmagCut_YellowToggleButton}"
Grid.Column="1" GroupName="DefinitionMethod_GrezzoUC"/>
<!-- Definizione della RowPartPage -->
<Grid Name="RowPartPageGrid" >
<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 per definizione grezzo -->
<Grid Name="RawMeasureGrd" Grid.Row="1" Grid.ColumnSpan="2">
<!-- Definizione della Grid superiore -->
<Grid Name="UpperButtonGrid" Grid.Column="1" Grid.Row="0" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="7*"/>
</Grid.ColumnDefinitions>
</Grid>
<!-- Definizione della Grid Laterale -->
<Grid Name="LeftButtonGrid" Grid.RowSpan="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="1.5*"/>
</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="1*"/>
<RowDefinition Height="4*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="1.*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<ComboBox Name="RawModeCmBx" Grid.Row="0" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_ComboBox}"
MaxDropDownHeight="300" Margin="6,0,6,0">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<RadioButton Name="OutlineBtn" Style="{DynamicResource OmagCut_YellowToggleButton}"
GroupName="DefinitionMethod_GrezzoUC"/>
<RadioButton Name="DamagedBtn" Style="{DynamicResource OmagCut_YellowToggleButton}"
Grid.Column="1" GroupName="DefinitionMethod_GrezzoUC"/>
<ComboBox Name="RawModeDamagedCmBx" Grid.Row="0" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_ComboBox}"
<!-- Definizione della Grid per definizione grezzo -->
<Grid Name="RawMeasureGrd" Grid.Row="1" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<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*"/>
</Grid.RowDefinitions>
<ComboBox Name="RawModeCmBx" Grid.Row="0" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_ComboBox}"
MaxDropDownHeight="300" Margin="6,0,6,0">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<ComboBox Name="RawModeDamagedCmBx" Grid.Row="0" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_ComboBox}"
MaxDropDownHeight="300" Margin="6,0,6,0">
<ComboBox.ItemTemplate>
<DataTemplate>
@@ -85,114 +85,123 @@
</ComboBox>
<TextBlock Name="LengthTxBl" Grid.Row="1" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="LengthTxBx" Grid.Column="1" Grid.Row="1" Margin="13,0,6,0"
<EgtWPFLib:EgtTextBox Name="LengthTxBx" Grid.Column="1" Grid.Row="1" Margin="13,0,6,0"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="WidthTxBl" Grid.Row="2" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="WidthTxBx" Grid.Column="1" Grid.Row="2" Margin="13,0,6,0"
<TextBlock Name="WidthTxBl" Grid.Row="2" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="WidthTxBx" Grid.Column="1" Grid.Row="2" Margin="13,0,6,0"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="HeightTxBl" Grid.Row="3" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="HeightTxBx" Grid.Column="1" Grid.Row="3" Margin="13,0,6,0"
<TextBlock Name="HeightTxBl" Grid.Row="3" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="HeightTxBx" Grid.Column="1" Grid.Row="3" Margin="13,0,6,0"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="OffsetXTxBl" Grid.Row="4" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="OffsetXTxBx" Grid.Column="1" Grid.Row="4" Margin="13,0,6,0"
<TextBlock Name="OffsetXTxBl" Grid.Row="4" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="OffsetXTxBx" Grid.Column="1" Grid.Row="4" Margin="13,0,6,0"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="OffsetYTxBl" Grid.Row="5" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="OffsetYTxBx" Grid.Column="1" Grid.Row="5" Margin="13,0,6,0"
<TextBlock Name="OffsetYTxBl" Grid.Row="5" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="OffsetYTxBx" Grid.Column="1" Grid.Row="5" Margin="13,0,6,0"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="KerfTxBl" Grid.Row="6" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="KerfTxBx" Grid.Column="1" Grid.Row="6" Margin="13,0,6,0"
<TextBlock Name="KerfTxBl" Grid.Row="6" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="KerfTxBx" Grid.Column="1" Grid.Row="6" Margin="13,0,6,0"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
</Grid>
<!-- Definizione della Grid per il materiale -->
<GroupBox Name="MaterialGpBx" Grid.Row="2" Grid.ColumnSpan="2" Style="{DynamicResource OmagCut_GroupBox}">
</Grid>
<ComboBox Name="MaterialsCmbx" Style="{StaticResource OmagCut_ComboBox}"
<!-- Definizione della Grid per il materiale -->
<GroupBox Name="MaterialGpBx" Grid.Row="2" Grid.ColumnSpan="2" Style="{DynamicResource OmagCut_GroupBox}">
<ComboBox Name="MaterialsCmbx" Style="{StaticResource OmagCut_ComboBox}"
MaxDropDownHeight="600">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding sName}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding sName}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</GroupBox>
</GroupBox>
<!-- Definizione della Grid per Punti -->
<GroupBox Name="PointsGpBx" Grid.Row="3" Grid.ColumnSpan="2" Style="{DynamicResource OmagCut_GroupBox}" >
<!-- Definizione della Grid per Punti -->
<GroupBox Name="PointsGpBx" Grid.Row="3" Grid.ColumnSpan="2" Style="{DynamicResource OmagCut_GroupBox}" >
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="1.5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="1.5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<ToggleButton Name="AddBtn"
<ToggleButton Name="AddBtn"
Style="{DynamicResource OmagCut_YellowToggleButton}"/>
<ToggleButton Name="RemoveBtn" Grid.Column="1"
<ToggleButton Name="RemoveBtn" Grid.Column="1"
Style="{DynamicResource OmagCut_YellowToggleButton}"/>
<Button Name="CloseBtn" Grid.Row="1" Grid.ColumnSpan="2"
<Button Name="CloseBtn" Grid.Row="1" Grid.ColumnSpan="2"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
</Grid>
</GroupBox>
</Grid>
<!-- Definizione della Grid per Zona rovinata -->
<GroupBox Name="DamagedAreaGpBx" Grid.Row="4" Grid.ColumnSpan="2" Grid.RowSpan="2" Style="{DynamicResource OmagCut_GroupBox}">
</GroupBox>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<!-- Definizione della Grid per Zona rovinata -->
<GroupBox Name="DamagedAreaGpBx" Grid.Row="4" Grid.ColumnSpan="2" Grid.RowSpan="2" Style="{DynamicResource OmagCut_GroupBox}">
<ToggleButton Name="NewBtn" Style="{DynamicResource OmagCut_YellowToggleButton}"/>
<ToggleButton Name="DeleteBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowToggleButton}"/>
</Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
</GroupBox>
<ToggleButton Name="NewBtn" Style="{DynamicResource OmagCut_YellowToggleButton}"/>
<ToggleButton Name="DeleteBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowToggleButton}"/>
</Grid>
<Button Name="ConfirmPhotoBtn" Grid.Row="4" Grid.ColumnSpan="2" Visibility="Hidden"
</GroupBox>
<TextBlock Name="OtherRefTabTxBl" Grid.Row="5" Grid.ColumnSpan="2" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
<CheckBox Name="OtherRefTabChBx" Grid.Row="5" Grid.Column="1" Style="{StaticResource OmagCut_CheckBox}"
HorizontalAlignment="Right" Margin="0,0,6,0"/>
<Button Name="ConfirmPhotoBtn" Grid.Row="4" Grid.ColumnSpan="2" Visibility="Hidden"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
</Grid>
<!-- Definizione della Grid Inferiore per i Button V e X -->
<Grid Name="LowerButtonGrid" Grid.Column="1" Grid.Row="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="6*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
</Grid>
<Button Name="RawProbingBtn" Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<Image Source="{DynamicResource RawProbeImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<!-- Definizione della Grid Inferiore per i Button V e X -->
<Grid Name="LowerButtonGrid" Grid.Column="1" Grid.Row="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Name="BarCodeBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<Image Source="{DynamicResource BarCodeImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="RawProbingBtn" Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<Image Source="{DynamicResource RawProbeImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="SlabIdBtn" Grid.Column="3" Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<Image Source="{DynamicResource SlabIdImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="BarCodeBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<Image Source="{DynamicResource BarCodeImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="OkBtn" Grid.Column="5" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
<Image Source="{DynamicResource VImg}" Width="65" Height="65" HorizontalAlignment="Center"
<Button Name="SlabIdBtn" Grid.Column="3" Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<Image Source="{DynamicResource SlabIdImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="OtherRefTabBtn" Grid.Column="4" Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<Image Source="{DynamicResource RefTabImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="OkBtn" Grid.Column="6" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
<Image Source="{DynamicResource VImg}" Width="65" Height="65" HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Button>
</Grid>
</Grid>
</Button>
</Grid>
</Grid>
</UserControl>
+294
View File
@@ -1,6 +1,9 @@
Imports System.Globalization
Imports System.IO
Imports System.Windows.Media.Animation
Imports EgtUILib
Imports EgtWPFLib
Imports Microsoft.VisualBasic.Devices
Public Class RawPartPageUC
@@ -78,6 +81,16 @@ Public Class RawPartPageUC
' Costante raggio cerchietto
Private Const RAD_CIRCLE As Double = 30
' 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
Private m_nOtherRefTabLay As Integer = GDB_ID.NULL
Private m_OtherRefTabPoint As Point3d
' mostra la pagina delle lavorazioni
Private m_SmartMachiningPage As Boolean = False
@@ -105,6 +118,13 @@ Public Class RawPartPageUC
FROM_SAW = 7
End Enum
Private Enum OTHERREFMODE As Integer
BL = 0
BR = 1
TR = 2
TL = 3
End Enum
Private Sub RawPartPage_Initialized(sender As Object, e As EventArgs)
'Creazione della Page UserControl e relative impostazioni
@@ -145,6 +165,13 @@ Public Class RawPartPageUC
ReDim Preserve m_RawModeListEx(3)
End If
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"
' lista per selezione RawModeDamaged
m_RawModeDamagedList(0) = EgtMsg(MSG_RAWPARTPAGEUC + 2) 'Per Punti
m_RawModeDamagedList(1) = EgtMsg(MSG_RAWPARTPAGEUC + 30) 'Da Laser
@@ -184,6 +211,8 @@ Public Class RawPartPageUC
RemoveBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 15) 'Remove - Rimuovi
CloseBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 31) 'Close - Chiudi
ConfirmPhotoBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 24) 'Conferma
OtherRefTabTxBl.Text = "New Ref On Tab"
End Sub
Private Sub RawPartPage_Loaded(sender As Object, e As RoutedEventArgs)
@@ -277,6 +306,12 @@ Public Class RawPartPageUC
Utility.SetBlockAndSlabNbr(sBlock, sSlabNbr)
End If
End If
' Carico le info del riferimento alternativo della tavola
m_nOtherRefTabLay = EgtCreateGroup(GDB_ID.ROOT)
EgtSetLevel(m_nTempLay, GDB_LV.TEMP)
LoadOtherRefTab()
' Assegno dati grezzo rettangolare ai textbox
LengthTxBx.Text = LenToString(m_RawLength, 2)
WidthTxBx.Text = LenToString(m_RawWidth, 2)
@@ -320,6 +355,36 @@ Public Class RawPartPageUC
Next
End Sub
Private Sub LoadOtherRefTab()
m_bEnableOtherRefTab = (GetPrivateProfileInt(S_RAWPART, K_ENABLEOTHERREFTAB, 0, m_MainWindow.GetIniFile()) <> 0)
If Not m_bEnableOtherRefTab Then
OtherRefTabBtn.Visibility = Visibility.Collapsed
OtherRefTabChBx.Visibility = Visibility.Collapsed
OtherRefTabTxBl.Visibility = Visibility.Collapsed
Return
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())
' RefTabPosCmbx.SelectedIndex = m_OtherRefTabPos
OtherRefTabChBx.IsChecked = m_bOtherRefTab
' se riferimento tavola differente da quello atteso
If m_bOtherRefTab Then
' dasibilito la modifica dei parametri di Offset
OffsetXTxBx.IsEnabled = False
OffsetYTxBx.IsEnabled = False
UpdateOffsetText()
End If
' Rimuovo eventuali crocette create acquisendo i punti nel disegno
EgtEmptyGroup(m_nOtherRefTabLay)
' Acquisisco punto da disegno
m_OtherRefTabPoint = New Point3d(m_ptTableMin.x + m_OtherRefTabX, m_ptTableMin.y + m_OtherRefTabY, m_ptTableMin.z + 0.15 + m_CurrentMachine.dAdditionalTable)
CreateOtherRefTab(m_nOtherRefTabLay, m_OtherRefTabPoint)
' EgtDraw()
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
@@ -930,6 +995,13 @@ Public Class RawPartPageUC
' Disattivo bottoni zone rovinate
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
If m_bEnableOtherRefTab Then
OtherRefTabChBx.IsEnabled = True
OtherRefTabBtn.IsEnabled = True
' disegno il riferimento
m_OtherRefTabPoint = New Point3d(m_ptTableMin.x + m_OtherRefTabX, m_ptTableMin.y + m_OtherRefTabY, m_ptTableMin.z + 0.15 + m_CurrentMachine.dAdditionalTable)
CreateOtherRefTab(m_nOtherRefTabLay, m_OtherRefTabPoint)
End If
Case RAWMODE.BY_POINTS
RawModeCmBx.IsEnabled = True
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
@@ -946,6 +1018,12 @@ Public Class RawPartPageUC
' Disattivo bottoni zone rovinate e foto
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
' disettivo la possibilità di modificare il riferimento
If m_bEnableOtherRefTab Then
OtherRefTabChBx.IsEnabled = False
OtherRefTabBtn.IsEnabled = False
EgtEmptyGroup(m_nOtherRefTabLay)
End If
Case RAWMODE.FROM_LASER
RawModeCmBx.IsEnabled = True
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
@@ -962,6 +1040,11 @@ Public Class RawPartPageUC
' Disattivo bottoni zone rovinate e foto
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
If m_bEnableOtherRefTab Then
OtherRefTabChBx.IsEnabled = False
OtherRefTabBtn.IsEnabled = False
EgtEmptyGroup(m_nOtherRefTabLay)
End If
Case RAWMODE.DAMAGED
RawModeCmBx.IsEnabled = False
RawModeDamagedCmBx.Visibility = Visibility.Visible
@@ -980,6 +1063,11 @@ Public Class RawPartPageUC
DamagedAreaGpBx.Visibility = Windows.Visibility.Visible
' Disattivo bottoni foto
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
If m_bEnableOtherRefTab Then
OtherRefTabChBx.IsEnabled = False
OtherRefTabBtn.IsEnabled = False
EgtEmptyGroup(m_nOtherRefTabLay)
End If
Case RAWMODE.FROM_PHOTO
RawModeCmBx.IsEnabled = True
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
@@ -992,6 +1080,11 @@ Public Class RawPartPageUC
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
' Visualizzo bottoni foto
ConfirmPhotoBtn.Visibility = Windows.Visibility.Visible
If m_bEnableOtherRefTab Then
OtherRefTabChBx.IsEnabled = False
OtherRefTabBtn.IsEnabled = False
EgtEmptyGroup(m_nOtherRefTabLay)
End If
Case RAWMODE.DAMAGED_BY_LASER
RawModeCmBx.IsEnabled = True
RawModeDamagedCmBx.Visibility = Visibility.Visible
@@ -1008,6 +1101,11 @@ Public Class RawPartPageUC
' Disattivo bottoni zone rovinate e foto
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
If m_bEnableOtherRefTab Then
OtherRefTabChBx.IsEnabled = False
OtherRefTabBtn.IsEnabled = False
EgtEmptyGroup(m_nOtherRefTabLay)
End If
Case RAWMODE.DAMAGED_BY_SAW
RawModeCmBx.IsEnabled = True
RawModeDamagedCmBx.Visibility = Visibility.Visible
@@ -1024,6 +1122,11 @@ Public Class RawPartPageUC
' Disattivo bottoni zone rovinate e foto
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
If m_bEnableOtherRefTab Then
OtherRefTabChBx.IsEnabled = False
OtherRefTabBtn.IsEnabled = False
EgtEmptyGroup(m_nOtherRefTabLay)
End If
Case RAWMODE.FROM_SAW
RawModeCmBx.IsEnabled = True
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
@@ -1040,11 +1143,26 @@ Public Class RawPartPageUC
' Disattivo bottoni zone rovinate e foto
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
If m_bEnableOtherRefTab Then
OtherRefTabChBx.IsEnabled = False
OtherRefTabBtn.IsEnabled = False
EgtEmptyGroup(m_nOtherRefTabLay)
End If
End Select
' se abilitato nuovo riferimento del grezzo disabilito le text per offset
If OtherRefTabChBx.IsChecked Then
OffsetXTxBx.IsEnabled = False
OffsetYTxBx.IsEnabled = False
End If
End Sub
Private Sub OutlineBtn_Click(sender As Object, e As RoutedEventArgs) Handles OutlineBtn.Click
If m_ActiveRawMode = RAWMODE.DAMAGED Or m_ActiveRawMode = RAWMODE.DAMAGED_BY_LASER Or m_ActiveRawMode = RAWMODE.DAMAGED_BY_SAW Then
If m_bEnableOtherRefTab Then
OtherRefTabTxBl.Visibility = Visibility.Visible
OtherRefTabBtn.Visibility = Visibility.Visible
OtherRefTabChBx.Visibility = Visibility.Visible
End If
' m_ActiveRawMode = RAWMODE.BY_POINTS
m_ActiveRawMode = m_PrecActiveRawMode
RawModeCmBx.SelectedIndex = m_ActiveRawMode
@@ -1055,6 +1173,12 @@ Public Class RawPartPageUC
End Sub
Private Sub DamagedBtn_Click(sender As Object, e As RoutedEventArgs) Handles DamagedBtn.Click
If m_bEnableOtherRefTab Then
OtherRefTabTxBl.Visibility = Visibility.Hidden
OtherRefTabBtn.Visibility = Visibility.Hidden
OtherRefTabChBx.Visibility = Visibility.Hidden
OtherRefTabBtn.IsEnabled = False
End If
m_PrecActiveRawMode = m_ActiveRawMode
If m_PrecActiveRawMode = RAWMODE.FROM_LASER Then
m_ActiveRawMode = RAWMODE.DAMAGED_BY_LASER
@@ -1843,6 +1967,7 @@ Public Class RawPartPageUC
WidthTxBx.Text = LenToString(m_RawWidth, 2)
m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_RAWPARTPAGEUC + 17) & " " & LenToString(dMaxWidth, 2)) 'Massima larghezza =
End If
RefTabModeChange()
End Sub
Private Sub HeightTxBx_EgtClosed(sender As Object, e As EventArgs) Handles HeightTxBx.EgtClosed
@@ -1872,6 +1997,7 @@ Public Class RawPartPageUC
HeightTxBx.Text = LenToString(m_RawHeight, 3)
m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_RAWPARTPAGEUC + 18)) 'Non sono ammessi spessori negativi
End If
RefTabModeChange()
End Sub
Private Sub OffsetXTxBx_EgtClosed(sender As Object, e As EventArgs) Handles OffsetXTxBx.EgtClosed
@@ -1918,6 +2044,108 @@ Public Class RawPartPageUC
End If
End Sub
#Region "OTHERREFTAB"
Private Sub OtherRefTabChBx_Click(sender As Object, e As EventArgs) Handles OtherRefTabChBx.Click
If OtherRefTabChBx.IsChecked Then
m_bOtherRefTab = True
MoveRawToOtherRefTab()
Else
m_bOtherRefTab = False
'MoveRawToMaiRefTab()
End If
UpdateOffsetText()
RawModeView()
WritePrivateProfileString(S_RAWPART, K_OTHERREFTAB, If(m_bOtherRefTab, "1", "0"), m_MainWindow.GetIniFile())
End Sub
Public Sub RefTabModeChange()
MoveRawToMaiRefTab()
MoveRawToOtherRefTab()
UpdateRefTabDraw()
UpdateOffsetText()
End Sub
Public Sub UpdateRefTabDraw()
' Rimuovo eventuali crocette create acquisendo i punti nel disegno
EgtEmptyGroup(m_nOtherRefTabLay)
' Acquisisco punto da disegno
m_OtherRefTabPoint = New Point3d(m_ptTableMin.x + m_OtherRefTabX, m_ptTableMin.y + m_OtherRefTabY, m_ptTableMin.z + 0.15)
CreateOtherRefTab(m_nOtherRefTabLay, m_OtherRefTabPoint)
EgtDraw()
End Sub
Private Sub UpdateOffsetText()
Dim ptRawMin, ptRawMax As Point3d
Dim dInvertKerf As Double = 1
If GetRawBox(ptRawMin, ptRawMax) Then
' kerf
EgtGetInfo(EgtGetFirstRawPart(), KEY_KERF, m_RawKerf)
' verifico se il kerf è negativo
EgtGetInfo(EgtGetFirstRawPart(), KEY_INVERT_KERF, dInvertKerf)
' aggiorno dati grezzo
If dInvertKerf < 0 Then
m_RawOffsX = ptRawMin.x - m_ptTableMin.x
m_RawOffsY = ptRawMin.y - m_ptTableMin.y
Else
m_RawOffsX = ptRawMin.x - m_ptTableMin.x + m_RawKerf * dInvertKerf
m_RawOffsY = ptRawMin.y - m_ptTableMin.y + m_RawKerf * dInvertKerf
End If
OffsetXTxBx.Text = LenToString(m_RawOffsX, 2)
OffsetYTxBx.Text = LenToString(m_RawOffsY, 2)
End If
End Sub
Private Sub MoveRawToOtherRefTab()
Dim dKerf As Double = 0
StringToLen(KerfTxBx.Text, dKerf)
Select Case m_OtherRefTabPos
Case OTHERREFMODE.BL
m_RawOffsX = m_OtherRefTabX + If((dKerf < 0), -dKerf, dKerf)
m_RawOffsY = m_OtherRefTabY + If((dKerf < 0), -dKerf, dKerf)
Case OTHERREFMODE.BR
m_RawOffsX = m_OtherRefTabX - m_RawLength - If((dKerf < 0), -dKerf, dKerf)
m_RawOffsY = m_OtherRefTabY + If((dKerf < 0), -dKerf, dKerf)
Case OTHERREFMODE.TR
m_RawOffsX = m_OtherRefTabX - m_RawLength - If((dKerf < 0), -dKerf, dKerf)
m_RawOffsY = m_OtherRefTabY - m_RawWidth - If((dKerf < 0), -dKerf, dKerf)
Case OTHERREFMODE.TL
m_RawOffsX = m_OtherRefTabX + If((dKerf < 0), -dKerf, dKerf)
m_RawOffsY = m_OtherRefTabY - m_RawWidth - If((dKerf < 0), -dKerf, dKerf)
Case Else
End Select
UpdateRawPart()
End Sub
Private Sub MoveRawToMaiRefTab()
Dim dKerf As Double = 0
StringToLen(KerfTxBx.Text, dKerf)
Select Case m_OtherRefTabPos
Case OTHERREFMODE.BR
m_RawOffsX = If((dKerf < 0), 0, dKerf)
m_RawOffsY = If((dKerf < 0), 0, dKerf)
Case OTHERREFMODE.BL
m_RawOffsX = If((dKerf < 0), 0, dKerf)
m_RawOffsY = If((dKerf < 0), 0, dKerf)
Case OTHERREFMODE.TL
m_RawOffsX = If((dKerf < 0), 0, dKerf)
m_RawOffsY = If((dKerf < 0), 0, dKerf)
Case OTHERREFMODE.TR
m_RawOffsX = If((dKerf < 0), 0, dKerf)
m_RawOffsY = If((dKerf < 0), 0, dKerf)
Case Else
End Select
UpdateRawPart()
End Sub
Private Sub OtherRefTabBtn_Click(sender As Object, e As EventArgs) Handles OtherRefTabBtn.Click
' 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)
OthWD.ShowDialog()
End Sub
#End Region ' OtherRefTab
Private Sub KerfTxBx_EgtClosed(sender As Object, e As EventArgs) Handles KerfTxBx.EgtClosed
Dim dKerf As Double
If Not StringToLen(KerfTxBx.Text, dKerf) Then
@@ -1960,6 +2188,8 @@ Public Class RawPartPageUC
Else
CreateRawFromPhotoContour()
End If
' Forzo il riposizionamento del grezzo
RefTabModeChange()
' Ridisegno
EgtDraw()
ElseIf dKerf >= dMinKerf And dKerf < 0 Then
@@ -2022,6 +2252,8 @@ Public Class RawPartPageUC
Else
CreateRawFromPhotoContour()
End If
' Forzo il riposizionamento del grezzo
RefTabModeChange()
' Ridisegno
EgtDraw()
ElseIf dKerf < dMinKerf Then
@@ -2052,6 +2284,18 @@ Public Class RawPartPageUC
' Recupero origine tavola rispetto allo 0 macchina
Dim TableRef As Point3d
EgtGetTableRef(1, TableRef)
' imposto modo automatico
Select Case m_MainWindow.m_CNCommunication.m_nNCType
Case 1, 2
' in attesa di verifica
Case 3
Dim nResult As Short = m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_WriteCncMode(0)
EgtOutLog("Impostata modalità automatica: esito " & nResult.ToString)
Case 4
' FANUC - Manual:7, Edit:1
Dim nResult As Short = m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_WriteCncMode(7)
EgtOutLog("Impostata modalità manuale: esito " & nResult.ToString)
End Select
' Recupero file LUA
EgtLuaExecFile(m_CurrentMachine.sMachDir() & "\DirectCmd\RawProbing.lua")
' Imposto parametri
@@ -2089,6 +2333,11 @@ Public Class RawPartPageUC
End If
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
EgtOutLog("RawProbing : sent NC program")
' Se fanuc passo in modalità AUTO e attivo
If m_MainWindow.m_CNCommunication.m_nNCType = 4 Then
Dim nResult As Short = m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_WriteCncMode(0)
EgtOutLog("Impostata modalità automatica: esito " & nResult.ToString)
End If
' Aspetto e lo avvio
System.Threading.Thread.Sleep(300)
m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_CycleStart()
@@ -2154,6 +2403,10 @@ Public Class RawPartPageUC
Else
RawThickness *= ONEMM / 1000
End If
' Se fanuc il dato è in mm (NON MICRON)
If m_MainWindow.m_CNCommunication.m_nNCType = 4 Then
RawThickness *= 1000
End If
' Sottraggo eventuale spessore sovratavola
RawThickness -= m_CurrentMachine.dAdditionalTable
' Imposto spessore misurato come altezza grezzo
@@ -2246,6 +2499,7 @@ Public Class RawPartPageUC
Private Sub RawPartPage_Unloaded(sender As Object, e As RoutedEventArgs)
' Rimuovo layer temporaneo per crocette
EgtErase(m_nTempLay)
EgtErase(m_nOtherRefTabLay)
' Dichiaro pagina non attiva
m_bActive = False
End Sub
@@ -2561,4 +2815,44 @@ Public Class RawPartPageUC
Return True
End Function
Private Function CreateOtherRefTab(nLayerId As Integer, ptP As Point3d) As Boolean
EgtEmptyGroup(m_nOtherRefTabLay)
If Not m_bOtherRefTab Or Not OtherRefTabChBx.IsEnabled Then
EgtDraw()
Return False
End If
If File.Exists(m_MainWindow.GetResourcesDir() & "\" & "RefTabBL.nge") Then
' Aggiungo disegno staffa fermo pezzo
EgtInsertFile(m_MainWindow.GetResourcesDir() & "\" & "RefTabBL.nge")
Dim nLastPart As Integer = EgtGetLastPart()
Dim Lay As Integer = EgtGetFirstInGroup(nLastPart)
Dim Ent As Integer = EgtGetFirstInGroup(Lay)
While Ent <> -1
Dim NextEnt As Integer = EgtGetNext(Ent)
EgtRelocate(Ent, nLayerId)
EgtMove(Ent, ptP - Point3d.ORIG)
EgtRotate(Ent, ptP, Vector3d.Z_AX, 90 * m_OtherRefTabPos)
Ent = NextEnt
End While
EgtErase(nLastPart)
Else
' Aggiungo crocette
ptP += New Vector3d(0, 0, 0.15)
Dim vtCrossX As New Vector3d(100, 0, 0)
Dim vtCrossY As New Vector3d(0, 100, 0)
Dim vtCrossZ As New Vector3d(0, 0, 100)
Dim nCrossId1 = EgtCreateLine(nLayerId, ptP, ptP + vtCrossX)
EgtSetColor(nCrossId1, New Color3d(245, 0, 0))
Dim nCrossId2 = EgtCreateLine(nLayerId, ptP, ptP + vtCrossY)
EgtSetColor(nCrossId2, New Color3d(0, 245, 0))
Dim nCrossId3 = EgtCreateLine(nLayerId, ptP, ptP + vtCrossZ)
EgtSetColor(nCrossId3, New Color3d(0, 0, 245))
End If
EgtDraw()
'EgtSaveFile("C:\EgtData\OmagCUT\Temp\MyTest.nge", NGE.BIN)
Return True
End Function
End Class
Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 857 B

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 857 B

+30
View File
@@ -567,6 +567,16 @@ Public Class SimulationPageUC
End Sub
Private Sub GenerateXPIUC_Click(sender As Object, e As RoutedEventArgs)
' eventualmente fermo la simulazione
m_nStatus = MCH_SIM_ST.UI_STOP
m_bPlay = False
PlayPauseBtn_Click(Nothing, Nothing)
' se il bottone Shift è premuto apro il file CadCut1 nel programma NotePad
Dim IsPressedShiftKey As Boolean = False
If Keyboard.Modifiers And ModifierKeys.Shift Then
IsPressedShiftKey = True
End If
Dim bOk As Boolean = True
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
' Elimino eventuale attrezzaggio da OmagOFFICE
@@ -669,6 +679,26 @@ Public Class SimulationPageUC
Else
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
End If
' procedo all'apertura del file CadCut1 apenna generato (solo se generazione corretta)
If bOk And IsPressedShiftKey Then
Try
Process.Start("Notepad.exe", sCncPath)
Catch ex As Exception
EgtOutLog(ex.ToString)
End Try
End If
' ricarico la pagina di simulazione
EgtSetCurrPhase(1)
' nascondo i pezzi in parcheggio
HideParkedParts(True)
' Avvio ambiente di simulazione
EgtSimInit()
EgtSimStart()
' Imposto stato corrente
SetStatus(MCH_SIM_ST.UI_STOP)
m_bPlay = True
' Costringo ad aggiornare UI
UpdateUI()
End Sub
Private Function ProcessEvents(nProg As Integer, nPause As Integer) As Integer
+5 -5
View File
@@ -20,12 +20,12 @@ Module Utility
Friend StopWatch As Stopwatch
Friend Sub TimeSpanInit()
StopWatch = New Stopwatch
StopWatch.Start()
End Sub
Friend Sub TimeSpanInit()
StopWatch = New Stopwatch
StopWatch.Start()
End Sub
Friend Function TimeSpanEnd()
Friend Function TimeSpanEnd()
Dim sTime As String = ""
If Not IsNothing(StopWatch) Then
StopWatch.Stop()