Compare commits

...

46 Commits

Author SHA1 Message Date
Nicola Pievani 97ec72e3e1 Costruzione solido in fase di definzione COMPO 2023-06-05 10:33:18 +02:00
Nicola Pievani ca3193b9a4 Correzione gestione apertura CN per Tagli Diretti 2023-05-31 12:27:08 +02:00
Nicola Pievani 93e7144753 Creata funzione condivisa per genrazione SOLIDO 2023-05-26 14:54:45 +02:00
Nicola Pievani 31e6bbaca7 Gestione script per creazione solido in FIloTop 2023-05-25 16:43:27 +02:00
Nicola Pievani 8935622888 Inizio gestione solido per FILOTOP 2023-05-25 12:22:18 +02:00
Nicola Pievani c47370405c Configurato Script per cereazione solido con lati smussati 2023-05-22 12:58:03 +02:00
Nicola Pievani a04e2cbe62 Gestione avanzata posizionamento pezzi VeinMatch 2023-05-18 14:43:03 +02:00
Nicola Pievani da980a649e Merge branch 'Features/Compo_Frames' into develop 2023-05-18 11:18:14 +02:00
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 9c7d60d307 Aggiornati i messaggi 2023-05-15 14:57:25 +02:00
Nicola Pievani a7adcdcaca Correzione visualizzazione Pagine componenti 2023-05-15 12:14:54 +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
Nicola Pievani d49c231541 Cambio versione 2.5c1 2023-03-13 10:45:21 +01:00
Nicola Pievani 8d82058e49 Merge branch 'Features/Assistance_Axium_PLC' into develop 2023-03-13 10:40:05 +01:00
Nicola Pievani aeb0be0590 Gestione sempre decimale poszione macchina 2023-02-28 18:00:33 +01:00
47 changed files with 15750 additions and 485 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
+3 -1
View File
@@ -37,7 +37,7 @@ Public Class CompoDimensionUC
InternComponentBtn.Content = EgtMsg(MSG_COMPONENTPAGEUC + 47) ' Componenti interni
If Not String.IsNullOrEmpty(sCompoDir) Then
bEnableAlzFront = True
AlzFrontBtn.Content = "Alzatine & Frontalini"
AlzFrontBtn.Content = EgtMsg(91137)
Else
AlzFrontBtn.Visibility = Visibility.Collapsed
End If
@@ -107,8 +107,10 @@ Public Class CompoDimensionUC
Friend Sub ShowAlzFrontBtn(ByVal value As Boolean)
If value Then
AlzFrontBtn.Visibility = Visibility.Visible
m_MainWindow.m_DrawPageUC.MessageGrid.Visibility = Visibility.Hidden
Else
AlzFrontBtn.Visibility = Visibility.Hidden
m_MainWindow.m_DrawPageUC.MessageGrid.Visibility = Visibility.Visible
End If
End Sub
+52 -4
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)
@@ -604,6 +618,10 @@ Public Class DrawPageUC
MakePreview(sMsg)
MessageTxBl.Text = sMsg
MessageGrid.Background = If(m_bDrawOk, Brushes.Transparent, Application.Current.FindResource("OmagCut_Red"))
' EseguoUpdate del solido
Utility.CreateSolid3D(m_MainWindow.GetIniFile())
' aggiorno visualizzazione
EgtSetView(VT.TOP, False)
EgtZoom(ZM.ALL)
@@ -613,7 +631,8 @@ Public Class DrawPageUC
' Costruisco path completa del componente
Dim sPath = m_sCompoDir & "\" & m_sCompoName
' Carico il file
Return EgtLuaExecFile(sPath)
Dim bOk As Boolean = EgtLuaExecFile(sPath)
Return bOk
End Function
Private Function ReadAndShowVariables() As Boolean
@@ -1124,6 +1143,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 +1182,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 +1201,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 +1222,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
+21 -12
View File
@@ -1,4 +1,5 @@
Imports EgtUILib
Imports EgtWPFLib5
Public Class FiloTopUC
@@ -38,17 +39,18 @@ Public Class FiloTopUC
m_CallingPage = m_MainWindow.m_ActivePage
' Imposto messaggi
ParameterTxBl.Text = EgtMsg( MSG_IMPORTPAGEUC + 10) ' Offset
Parameter2TxBl.Text = EgtMsg( MSG_IMPORTPAGEUC + 11) ' Affondamento
ParameterTxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 10) ' Offset
Parameter2TxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 11) ' Affondamento
Parameter3TxBl.Text = EgtMsg(91138)
If m_CallingPage = MainWindow.Pages.Draw Then
' Imposto questa come pagina correntemente visualizzata nella drawpage
m_MainWindow.m_DrawPageUC.m_ActiveComponentPage = DrawPageUC.Pages.FiloTop
' Imposto contesto corrente
EgtSetCurrentContext( m_MainWindow.m_DrawPageUC.DrawScene.GetCtx())
EgtSetCurrentContext(m_MainWindow.m_DrawPageUC.DrawScene.GetCtx())
ElseIf m_CallingPage = MainWindow.Pages.Import Then
' Imposto contesto corrente
EgtSetCurrentContext( m_MainWindow.m_ImportPageUC.ImportScene.GetCtx())
EgtSetCurrentContext(m_MainWindow.m_ImportPageUC.ImportScene.GetCtx())
End If
' Gestisco visualizzazione dei parametri
@@ -57,9 +59,9 @@ Public Class FiloTopUC
Parameter3TxBl.Visibility = Windows.Visibility.Visible
' Aggiorno valori
m_dFiloTopOffset = GetPrivateProfileDouble( S_SIDES, K_FILOTOPOFFSET, 5, m_MainWindow.GetIniFile())
ParameterTxBx.Text = LenToString( m_dFiloTopOffset, 3)
m_dFiloTopDepth = GetPrivateProfileDouble( S_SIDES, K_FILOTOPDEPTH, 5, m_MainWindow.GetIniFile())
m_dFiloTopOffset = GetPrivateProfileDouble(S_SIDES, K_FILOTOPOFFSET, 5, m_MainWindow.GetIniFile())
ParameterTxBx.Text = LenToString(m_dFiloTopOffset, 3)
m_dFiloTopDepth = GetPrivateProfileDouble(S_SIDES, K_FILOTOPDEPTH, 5, m_MainWindow.GetIniFile())
Parameter2TxBx.Text = LenToString(m_dFiloTopDepth, 3)
m_bCornerradius = GetPrivateProfileInt(S_SIDES, K_ROUNDOFF, 0, m_MainWindow.GetIniFile()) <> 0
Parameter3ChBx.IsChecked = m_bCornerradius
@@ -80,8 +82,8 @@ Public Class FiloTopUC
Dim nLayId As Integer = EgtGetFirstLayer(nPartId)
While nLayId <> GDB_ID.NULL
Dim sLayName As String = ""
If EgtGetName( nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo( nLayId, INFO_FILOTOP) Then
EgtSetInfo( nLayId, INFO_OFFSET, m_dFiloTopOffset)
If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo(nLayId, INFO_FILOTOP) Then
EgtSetInfo(nLayId, INFO_OFFSET, m_dFiloTopOffset)
End If
nLayId = EgtGetNextLayer(nLayId)
End While
@@ -101,13 +103,16 @@ Public Class FiloTopUC
Dim nLayId As Integer = EgtGetFirstLayer(nPartId)
While nLayId <> GDB_ID.NULL
Dim sLayName As String = ""
If EgtGetName( nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo( nLayId, INFO_FILOTOP) Then
EgtSetInfo( nLayId, INFO_DEPTH, m_dFiloTopDepth)
If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo(nLayId, INFO_FILOTOP) Then
EgtSetInfo(nLayId, INFO_DEPTH, m_dFiloTopDepth)
End If
nLayId = EgtGetNextLayer(nLayId)
End While
nPartId = EgtGetNextPart(nPartId)
End While
Utility.CreateSolid3D(m_MainWindow.GetIniFile())
EgtDraw()
End Sub
Private Sub Parameter3ChBx_Checked() Handles Parameter3ChBx.Click
@@ -215,12 +220,16 @@ Public Class FiloTopUC
EgtRemoveInfo(nLayId, "FiloTopRef")
EgtOutLog("Error in generation OffsetPreView in TopEgde ")
End If
If bOk Then Utility.CreateSolid3D(m_MainWindow.GetIniFile())
' ---------------------- Fine GESTIONE PREVIEW percorso -------------------------------
End If
nLayId = EgtGetNextLayer(nLayId)
nLayId = EgtGetNextLayer(nLayId)
End While
nPartId = EgtGetNextPart(nPartId)
End While
EgtDraw()
End Sub
+83 -7
View File
@@ -41,6 +41,7 @@ Public Class MainComponentPageUC
m_MainWindow.m_DrawPageUC.FiloTopBtn.IsEnabled = False
m_MainWindow.m_DrawPageUC.EngraveBtn.IsEnabled = False
m_MainWindow.m_DrawPageUC.DripCutBtn.IsEnabled = False
m_MainWindow.m_DrawPageUC.m_bBackFromInternalCompo = False
End Sub
Private Function GetButton(ByVal nInd As Integer) As Button
@@ -167,7 +168,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 +252,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 +331,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
+36 -32
View File
@@ -171,25 +171,25 @@ Public Class SideAngleUC
' Aggiorno valori
If m_Mode = ModeOpt.DRIP Then
m_dDripOffset = GetPrivateProfileDouble( S_SIDES, K_DRIPOFFSET, 20, m_MainWindow.GetIniFile())
m_dDripOffset2 = GetPrivateProfileDouble( S_SIDES, K_DRIPOFFSET2, 0, m_MainWindow.GetIniFile())
m_dDripDepth = GetPrivateProfileDouble( S_SIDES, K_DRIPDEPTH, 10, m_MainWindow.GetIniFile())
m_dDripShort = GetPrivateProfileDouble( S_SIDES, K_DRIPSHORT, 0, m_MainWindow.GetIniFile())
Parameter1TxBx.Text = LenToString( m_dDripOffset, 3)
Parameter2TxBx.Text = LenToString( m_dDripOffset2, 3)
Parameter3TxBx.Text = LenToString( m_dDripDepth, 3)
Parameter4TxBx.Text = LenToString( m_dDripShort, 3)
m_dDripOffset = GetPrivateProfileDouble(S_SIDES, K_DRIPOFFSET, 20, m_MainWindow.GetIniFile())
m_dDripOffset2 = GetPrivateProfileDouble(S_SIDES, K_DRIPOFFSET2, 0, m_MainWindow.GetIniFile())
m_dDripDepth = GetPrivateProfileDouble(S_SIDES, K_DRIPDEPTH, 10, m_MainWindow.GetIniFile())
m_dDripShort = GetPrivateProfileDouble(S_SIDES, K_DRIPSHORT, 0, m_MainWindow.GetIniFile())
Parameter1TxBx.Text = LenToString(m_dDripOffset, 3)
Parameter2TxBx.Text = LenToString(m_dDripOffset2, 3)
Parameter3TxBx.Text = LenToString(m_dDripDepth, 3)
Parameter4TxBx.Text = LenToString(m_dDripShort, 3)
ElseIf m_Mode = ModeOpt.ENGRAVE Then
m_dDripOffset = GetPrivateProfileDouble( S_SIDES, K_ENGRAVEOFFSET, 20, m_MainWindow.GetIniFile())
m_nEngrNbr2 = GetPrivateProfileInt( S_SIDES, K_ENGRAVENUMBER2, 1, m_MainWindow.GetIniFile())
m_dDripOffset2 = GetPrivateProfileDouble( S_SIDES, K_ENGRAVEOFFSET2, 0, m_MainWindow.GetIniFile())
m_dDripDepth = GetPrivateProfileDouble( S_SIDES, K_ENGRAVEDEPTH, 10, m_MainWindow.GetIniFile())
m_dDripOffset = GetPrivateProfileDouble(S_SIDES, K_ENGRAVEOFFSET, 20, m_MainWindow.GetIniFile())
m_nEngrNbr2 = GetPrivateProfileInt(S_SIDES, K_ENGRAVENUMBER2, 1, m_MainWindow.GetIniFile())
m_dDripOffset2 = GetPrivateProfileDouble(S_SIDES, K_ENGRAVEOFFSET2, 0, m_MainWindow.GetIniFile())
m_dDripDepth = GetPrivateProfileDouble(S_SIDES, K_ENGRAVEDEPTH, 10, m_MainWindow.GetIniFile())
m_dEngraveDepth2 = GetPrivateProfileDouble(S_SIDES, K_ENGRAVEDEPTH2, 0, m_MainWindow.GetIniFile())
m_dEngraveAngle = GetPrivateProfileDouble(S_SIDES, K_ENGRAVEANGLE, 0, m_MainWindow.GetIniFile())
Parameter1TxBx.Text = LenToString(m_dDripOffset, 3)
Parameter2aTxBx.Text = m_nEngrNbr2.ToString()
Parameter2bTxBx.Text = LenToString( m_dDripOffset2, 3)
Parameter3TxBx.Text = LenToString( m_dDripDepth, 3)
Parameter2bTxBx.Text = LenToString(m_dDripOffset2, 3)
Parameter3TxBx.Text = LenToString(m_dDripDepth, 3)
Parameter4TxBx.Text = LenToString(m_dEngraveDepth2, 3)
Parameter5TxBx.Text = DoubleToString(m_dEngraveAngle, 3)
End If
@@ -311,8 +311,8 @@ Public Class SideAngleUC
' Attualmente il vaore m_nCount è inizializzato ad "1"..
' Bottoni Prev Next
If m_nCount <= MAX_LINES Then
PrevBtn.Visibility= Windows.Visibility.Hidden
NextBtn.Visibility= Windows.Visibility.Hidden
PrevBtn.Visibility = Windows.Visibility.Hidden
NextBtn.Visibility = Windows.Visibility.Hidden
Else
Grid.SetRow(PrevBtn, MAX_LINES - m_nShow)
PrevBtn.Visibility = Windows.Visibility.Visible
@@ -371,7 +371,7 @@ Public Class SideAngleUC
GetHeelTxBxFromIndex(Index).Text = GetPrivateProfileDouble(S_SIDES, K_DRIPSHORT & "A" & nI.ToString & "_End", 0, m_MainWindow.GetIniFile())
End If
End If
Dim TxBlIndex As Integer = (m_nCurrPage - 1) * MAX_LINES + nI - 1
Dim TxBlIndex As Integer = (m_nCurrPage - 1) * MAX_LINES + nI - 1
GetTxBlFromIndex(Index).Text = If(m_Mode = ModeOpt.SIDEANGLE,
m_SideAngleEntityList(TxBlIndex).sEntityName,
m_DripEntityList(TxBlIndex).sEntityName)
@@ -495,15 +495,15 @@ Public Class SideAngleUC
'-------------> Restituisce gli oggetto della grafica assegnato l'indice
' quando esco salvo nel file l'ultima configurazione per le incisioni
Private Sub SideAngleUC_Unloaded( sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
Private Sub SideAngleUC_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
If m_CallingPage = MainWindow.Pages.Draw Then
' Ricavo nome pezzo
Dim PartId As Integer = EgtGetFirstInGroup( GDB_ID.ROOT)
Dim PartId As Integer = EgtGetFirstInGroup(GDB_ID.ROOT)
' Svuoto layer in cui sono presenti i testi con le inclinazioni dei lati
If m_Mode = ModeOpt.SIDEANGLE Then
EgtEmptyGroup( EgtGetFirstNameInGroup( PartId, SIDE_ANGLE_LAYER))
EgtEmptyGroup(EgtGetFirstNameInGroup(PartId, SIDE_ANGLE_LAYER))
Else
EgtEmptyGroup( EgtGetFirstNameInGroup( PartId, SIDE_ANGLE_LAYER))
EgtEmptyGroup(EgtGetFirstNameInGroup(PartId, SIDE_ANGLE_LAYER))
End If
ElseIf m_CallingPage = MainWindow.Pages.Import Then
' Nessuna azione necessaria
@@ -516,7 +516,7 @@ Public Class SideAngleUC
'WritePrivateProfileString( S_SIDES, K_DRIPSHORT, DoubleToString( m_dDripShort, 3), m_MainWindow.GetIniFile())
ElseIf m_Mode = ModeOpt.ENGRAVE Then
WritePrivateProfileString(S_SIDES, K_ENGRAVEOFFSET, LenToString(m_dDripOffset, 3), m_MainWindow.GetIniFile())
WritePrivateProfileString( S_SIDES, K_ENGRAVENUMBER2, m_nEngrNbr2.ToString(), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_SIDES, K_ENGRAVENUMBER2, m_nEngrNbr2.ToString(), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_SIDES, K_ENGRAVEOFFSET2, LenToString(m_dDripOffset2, 3), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_SIDES, K_ENGRAVEDEPTH, LenToString(m_dDripDepth, 3), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_SIDES, K_ENGRAVEDEPTH2, LenToString(m_dEngraveDepth2, 3), m_MainWindow.GetIniFile())
@@ -538,7 +538,7 @@ Public Class SideAngleUC
PartId = If(m_MainWindow.m_DrawPageUC.SelectedLayer <> GDB_ID.NULL, EgtGetFirstPart(), GDB_ID.NULL)
' Recupero nome layer con geometria di contorno (esterno o interno) del pezzo
LoopId = m_MainWindow.m_DrawPageUC.SelectedLayer
ElseIf m_CallingPage = MainWindow.Pages.Import Then
ElseIf m_CallingPage = MainWindow.Pages.Import Then
' Imposto contesto corrente
EgtSetCurrentContext(m_MainWindow.m_ImportPageUC.ImportScene.GetCtx())
' Recupero nome pezzo
@@ -579,6 +579,10 @@ Public Class SideAngleUC
' Creo le geometrie dei gocciolatoi
CreateDripGeom(PartId)
End If
' se abilitato e dimensione solido da sotto: creo il solido
Utility.CreateSolid3D(m_MainWindow.GetIniFile())
' Aggiorno visualizzazione
EgtDraw()
End Sub
@@ -600,7 +604,7 @@ Public Class SideAngleUC
For nIndex As Integer = 1 To m_nCount
Dim Entity As DripEntity = m_DripEntityList(nIndex - 1)
' Imposto check box (se sono stati definiti il numero corretto di CheckBox
If nIndex < ( m_nCurrPage - 1) * MAX_LINES Or nIndex > m_nCurrPage * MAX_LINES Then Continue For
If nIndex < (m_nCurrPage - 1) * MAX_LINES Or nIndex > m_nCurrPage * MAX_LINES Then Continue For
Dim nChIndex As Integer = nIndex - (m_nCurrPage - 1) * MAX_LINES + MAX_LINES - m_nShow
' verifico se l'entità ha un gocciolatoio
GetChBxFromIndex(nChIndex).IsChecked = Entity.bHaveDrip
@@ -973,15 +977,15 @@ Public Class SideAngleUC
Private Sub PrevBtn_Click(sender As Object, e As RoutedEventArgs) Handles PrevBtn.Click
If m_nCurrPage = 1 Then Return
m_nCurrPage -= 1
m_nShow = Math.Min( m_nCount - ( m_nCurrPage - 1) * MAX_LINES, MAX_LINES)
m_nShow = Math.Min(m_nCount - (m_nCurrPage - 1) * MAX_LINES, MAX_LINES)
TxBlChBxView()
RefreshCheckAndValue()
End Sub
Private Sub NextBtn_Click(sender As Object, e As RoutedEventArgs) Handles NextBtn.Click
If m_nCount <= ( m_nCurrPage - 1) * MAX_LINES Then Return
If m_nCount <= (m_nCurrPage - 1) * MAX_LINES Then Return
m_nCurrPage += 1
m_nShow = Math.Min( m_nCount - ( m_nCurrPage - 1) * MAX_LINES, MAX_LINES)
m_nShow = Math.Min(m_nCount - (m_nCurrPage - 1) * MAX_LINES, MAX_LINES)
TxBlChBxView()
RefreshCheckAndValue()
End Sub
@@ -993,7 +997,7 @@ Public Class SideAngleUC
Dim bVal As Boolean = CurrCheckBox.IsChecked()
Dim SideIndex As Integer = CInt(CurrCheckBox.Name.Substring(1))
' Converto nome checkbox in nome elemento tenendo conto della pagina e dello slittamento verso il basso
Dim nCurrSide As Integer = ( m_nCurrPage - 1) * MAX_LINES + SideIndex - ( MAX_LINES - m_nShow)
Dim nCurrSide As Integer = (m_nCurrPage - 1) * MAX_LINES + SideIndex - (MAX_LINES - m_nShow)
Dim sCurrSide As String = m_DripEntityList(nCurrSide - 1).sEntityName
' aggiorno l'entità con i valori scritti nel campo di testo
Dim CurrEntity As DripEntity = DripEntity.FindEntity(sCurrSide)
@@ -1192,7 +1196,7 @@ Public Class SideAngleUC
AngleTxBx.Text = DoubleToString(dSideAngle, 2)
End If
' Converto nome checkbox in nome elemento tenendo conto della pagina e dello slittamento verso il basso
Dim nCurrSide As Integer = ( m_nCurrPage - 1) * MAX_LINES + SideIndex - ( MAX_LINES - m_nShow)
Dim nCurrSide As Integer = (m_nCurrPage - 1) * MAX_LINES + SideIndex - (MAX_LINES - m_nShow)
Dim sCurrSide As String = m_SideAngleEntityList(nCurrSide - 1).sEntityName
' Lo modifico nella geometria e nella lista inclinazioni
ModifySideAngle(sCurrSide, dSideAngle)
@@ -1262,7 +1266,7 @@ Public Class SideAngleUC
HeelTxBx.Text = "0"
End If
' Converto nome checkbox in nome elemento tenendo conto della pagina e dello slittamento verso il basso
Dim nCurrSide As Integer = ( m_nCurrPage - 1) * MAX_LINES + SideIndex - ( MAX_LINES - m_nShow)
Dim nCurrSide As Integer = (m_nCurrPage - 1) * MAX_LINES + SideIndex - (MAX_LINES - m_nShow)
Dim sCurrSide As String = m_SideAngleEntityList(nCurrSide - 1).sEntityName
' Lo modifico nella geometria e nella lista inclinazioni
ModifySideHeel(sCurrSide, dSideHeel)
@@ -1303,7 +1307,7 @@ Public Class SideAngleUC
If dSideAngle <> 0 Then
EgtSetInfo(CurrEntity.nGeomId, INFO_SIDE_ANGLE, dSideAngle)
EgtSetInfo(CurrEntity.nGeomId, INFO_ORIG_SIDE_ANGLE, dSideAngle)
' Cancello inclinazione nell'apposito campo info
' Cancello inclinazione nell'apposito campo info
Else
EgtRemoveInfo(CurrEntity.nGeomId, INFO_SIDE_ANGLE)
EgtRemoveInfo(CurrEntity.nGeomId, INFO_ORIG_SIDE_ANGLE)
@@ -1324,7 +1328,7 @@ Public Class SideAngleUC
' Scrivo nuovo tallone nelle info
If dSideHeel > 10 * EPS_SMALL Then
EgtSetInfo(CurrEntity.nGeomId, INFO_HEEL, dSideHeel)
' Cancello inclinazione nell'apposito campo info
' Cancello inclinazione nell'apposito campo info
Else
EgtRemoveInfo(CurrEntity.nGeomId, INFO_HEEL)
End If
+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"
+17 -15
View File
@@ -248,16 +248,16 @@ Public Class MachineStatusUC
dL3 = ptTip.z
End If
' Visualizzazione
Axis1TxBx.Text = LenToString(dL1, -3)
Axis2TxBx.Text = LenToString(dL2, -3)
Axis3TxBx.Text = LenToString(dL3, -3)
Axis1TxBx.Text = LenToString(dL1, -3, True)
Axis2TxBx.Text = LenToString(dL2, -3, True)
Axis3TxBx.Text = LenToString(dL3, -3, True)
Axis4TxBx.Text = DoubleToString(dR1, -3)
Axis5TxBx.Text = DoubleToString(dR2, -3)
If m_AxesNumber >= 6 Then Axis6TxBx.Text = DoubleToString(dA6, -3)
If m_AxesNumber >= 7 Then Axis7TxBx.Text = LenToString(dA7, -3)
If m_AxesNumber >= 8 Then Axis8TxBx.Text = LenToString(dA8, -3)
If m_AxesNumber >= 9 Then Axis9TxBx.Text = LenToString(dA9, -3)
If m_AxesNumber >= 10 Then Axis10TxBx.Text = LenToString(dA10, -3)
If m_AxesNumber >= 7 Then Axis7TxBx.Text = LenToString(dA7, -3, True)
If m_AxesNumber >= 8 Then Axis8TxBx.Text = LenToString(dA8, -3, True)
If m_AxesNumber >= 9 Then Axis9TxBx.Text = LenToString(dA9, -3, True)
If m_AxesNumber >= 10 Then Axis10TxBx.Text = LenToString(dA10, -3, True)
End Sub
Sub DisplayPositionDelta()
@@ -265,22 +265,22 @@ Public Class MachineStatusUC
Dim dL1, dL2, dL3, dR1, dR2, dA6, dA7, dA8, dA9, dA10 As Double
m_MainWindow.m_CNCommunication.GetAxesDeltas(dL1, dL2, dL3, dR1, dR2, dA6, dA7, dA8, dA9, dA10)
' Visualizzazione
DeltaAxis1TxBx.Text = LenToString(dL1, -3)
DeltaAxis2TxBx.Text = LenToString(dL2, -3)
DeltaAxis3TxBx.Text = LenToString(dL3, -3)
DeltaAxis1TxBx.Text = LenToString(dL1, -3, True)
DeltaAxis2TxBx.Text = LenToString(dL2, -3, True)
DeltaAxis3TxBx.Text = LenToString(dL3, -3, True)
DeltaAxis4TxBx.Text = DoubleToString(dR1, -3)
DeltaAxis5TxBx.Text = DoubleToString(dR2, -3)
If m_AxesNumber >= 6 Then DeltaAxis6TxBx.Text = DoubleToString(dA6, -3)
If m_AxesNumber >= 7 Then DeltaAxis7TxBx.Text = LenToString(dA7, -3)
If m_AxesNumber >= 8 Then DeltaAxis8TxBx.Text = LenToString(dA8, -3)
If m_AxesNumber >= 9 Then DeltaAxis9TxBx.Text = LenToString(dA9, -3)
If m_AxesNumber >= 10 Then DeltaAxis10TxBx.Text = LenToString(dA10, -3)
If m_AxesNumber >= 7 Then DeltaAxis7TxBx.Text = LenToString(dA7, -3, True)
If m_AxesNumber >= 8 Then DeltaAxis8TxBx.Text = LenToString(dA8, -3, True)
If m_AxesNumber >= 9 Then DeltaAxis9TxBx.Text = LenToString(dA9, -3, True)
If m_AxesNumber >= 10 Then DeltaAxis10TxBx.Text = LenToString(dA10, -3, True)
End Sub
Sub DisplayFeed()
Dim dRealFeed As Double = m_CN.d_DInterpo_Prog_Feed * m_CN.d_DInterpo_Feed_override / 100
'Feed = DoubleToString(dRealFeed, 0)
FeedTxBx.Text = LenToString(dRealFeed, 0)
FeedTxBx.Text = LenToString(dRealFeed, 0, True)
'FeedOverride = DoubleToString(m_CN.d_DInterpo_Feed_override, 0) & "%"
Dim dFeedOverride As Double = m_CN.d_DInterpo_Feed_override
FeedOverrideTxBx.Text = DoubleToString(dFeedOverride, 0) & "%"
@@ -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
@@ -61,8 +61,8 @@ Public Class PolishingsPageUC
RepeatTxBl.Text = EgtMsg(91093) ' Ripetizioni
StepTxBl.Text = EgtMsg(90787) ' Passo
OffSetTxBl.Text = EgtMsg(91089) ' Offset
RadiusTxBl.Text = "Raggio"
DistanceTxBl.Text = "Distanza"
RadiusTxBl.Text = EgtMsg(91139) ' Raggio
DistanceTxBl.Text = EgtMsg(91140) ' Distanza
LiLoGpBx.Header = EgtMsg(91094) ' Attacco/Uscita
LiLenTxBl.Text = EgtMsg(91097) ' Lunghezza
LiHeightTxBl.Text = EgtMsg(91095) ' Altezza
+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, 2502, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2502, 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.2")>
<Assembly: AssemblyFileVersion("2.5.3.2")>
<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

+69
View File
@@ -567,6 +567,55 @@ Public Class SimulationPageUC
End Sub
Private Sub GenerateXPIUC_Click(sender As Object, e As RoutedEventArgs)
' 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
' Se nella pagina di tagli diretti
If m_MainWindow.DirectCutBtn.IsChecked And Not m_MainWindow.CadCutBtn.IsChecked Then
' Genero file CNC (lancio anche se errore in precedenza)
Dim sCncPathDirect As String = m_MainWindow.GetCncDir() & "\DirectCut" & m_MainWindow.m_CurrentMachine.sIsoFileExt
Dim bOkDirect As Boolean = EgtGenerate(sCncPathDirect, "OmagCut ver." & m_MainWindow.GetVersion())
' Costringo ad aggiornare UI
UpdateUI()
' Ripristino come fase corrente quella iniziale
EgtSetCurrPhase(1)
If bOkDirect Then
m_CurrProjPage.SetInfoMessage("Genarato file " & "DirectCut" & m_MainWindow.m_CurrentMachine.sIsoFileExt)
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 bOkDirect And IsPressedShiftKey Then
Try
Process.Start("Notepad.exe", sCncPathDirect)
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()
' esco
Return
End If
' eventualmente fermo la simulazione
m_nStatus = MCH_SIM_ST.UI_STOP
m_bPlay = False
PlayPauseBtn_Click(Nothing, Nothing)
Dim bOk As Boolean = True
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
' Elimino eventuale attrezzaggio da OmagOFFICE
@@ -669,6 +718,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
+92 -62
View File
@@ -6,6 +6,36 @@ Imports EgtWPFLib
Imports EgtUILib
Module Utility
'--------------------------------------------------------------------------------------------------
#Region "COMPO SOLID3d"
Friend Function CreateSolid3D(sIniFile As String) As Boolean
EgtSaveFile("C:\EgtData\OmagCUT\Temp\Ribasso.nge", NGE.TEXT)
Dim bOk As Boolean = False
Dim dRawHeight As Double = GetPrivateProfileDouble(S_RAWPART, K_RAWHEIGHT, 30, sIniFile)
' se abilitato e dimensione solido da sotto: creo il solido
Dim sPathSOLID As String = String.Empty
If GetPrivateProfileString(S_SIDES, "CreateSOLID", "", sPathSOLID, sIniFile) <> 0 And
GetPrivateProfileInt(S_SIDES, K_SIZEALWAYSONTOP, 0, sIniFile) = 0 Then
' Recupero file LUA
EgtLuaExecFile(sPathSOLID)
Dim dThick As Double = dRawHeight
EgtLuaSetGlobNumVar("CMP.THICK", dThick)
bOk = EgtLuaExecLine("CMP_Draw(false)")
Dim nErr As Integer = 0
EgtLuaGetGlobIntVar("CMP.ERR", nErr)
' Reset lua
EgtLuaResetGlobVar("CMP")
Else
EgtOutLog("CreateSolid3d Failed: file '" & sPathSOLID & "' not found or parameter 'SizeAlwaysOnTop' is TRUE")
End If
Return bOk
End Function
#End Region ' Compo Solid3d
'--------------------------------------------------------------------------------------------------
Friend Function CompoColor(sIniFile As String) As Color3d
Dim InsertColor As New Color3d(89, 210, 210, 25)
Dim IndexColor As Integer = GetPrivateProfileInt(S_COMPO, K_LASTCOLOR, 1, sIniFile)
@@ -18,28 +48,28 @@ Module Utility
End Function
Friend StopWatch As Stopwatch
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()
Dim sTime As String = ""
If Not IsNothing(StopWatch) Then
StopWatch.Stop()
Dim ts As TimeSpan = StopWatch.Elapsed
sTime = String.Format("{0:00}:{1:00}:{2:00}.{3:000}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds)
End If
Return sTime
End Function
Friend Function TimeSpanEnd()
Dim sTime As String = ""
If Not IsNothing(StopWatch) Then
StopWatch.Stop()
Dim ts As TimeSpan = StopWatch.Elapsed
sTime = String.Format("{0:00}:{1:00}:{2:00}.{3:000}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds)
End If
Return sTime
End Function
'--------------------------------------------------------------------------------------------------
Friend Sub UpdateUI()
'--------------------------------------------------------------------------------------------------
Friend Sub UpdateUI()
' Costringo ad aggiornare UI
Dim nDummy As Integer
Application.Current.Dispatcher.Invoke(Windows.Threading.DispatcherPriority.Background, _
Application.Current.Dispatcher.Invoke(Windows.Threading.DispatcherPriority.Background,
New Action(Function() nDummy = 0))
End Sub
@@ -205,10 +235,10 @@ Module Utility
End Function
' conerte il dato (in mm) in stringa nell'unità corrente
Friend Function LenToString(dVal As Double, nNumDec As Integer) As String
Friend Function LenToString(dVal As Double, nNumDec As Integer, Optional ByVal bForceToDecimal As Boolean = False) As String
Dim sVal As String = DoubleToString(EgtToUiUnits(dVal), nNumDec)
' se richiesta scrittura in frazione (solo se unità corrente INCHES)
If nCurrFractionPattern <> FractionPattern.None And Not EgtUiUnitsAreMM() Then
If (nCurrFractionPattern <> FractionPattern.None And Not EgtUiUnitsAreMM()) And Not bForceToDecimal Then
' conevrto il dato corrente in decimale
Dim dCurrVal As Double = dVal
StringToDouble(sVal, dCurrVal)
@@ -217,10 +247,10 @@ Module Utility
Return sVal
End Function
Friend Function StringToLen(sVal As String, ByRef dVal As Double) As Boolean
Friend Function StringToLen(sVal As String, ByRef dVal As Double, Optional ByVal bForceToDecimal As Boolean = False) As Boolean
If String.IsNullOrEmpty(sVal) Then Return False
If nCurrFractionPattern <> FractionPattern.None And Not EgtUiUnitsAreMM() Then
If (nCurrFractionPattern <> FractionPattern.None And Not EgtUiUnitsAreMM()) And Not bForceToDecimal Then
Dim sValSource As String = sVal
' conevrto la stringa in formato decimale (sempre in stringa)
StringFractionToStringDecimal(sValSource, sVal)
@@ -366,20 +396,20 @@ Module Utility
If bOldEnMod Then EgtEnableModified()
End Sub
Friend Function SetTextColor( nGroup As Integer) As Boolean
Friend Function SetTextColor(nGroup As Integer) As Boolean
' Recupero il colore da assegnare ai testi
Dim colText As New Color3d( 0, 0, 0)
Dim colText As New Color3d(0, 0, 0)
Dim sTextColor As String = " "
Dim MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
If GetPrivateProfileString(S_NEST, K_TEXTCOLOR, " ", sTextColor, MainWindow.GetIniFile()) <> 0 Then
Dim sTextColorArray() As String = sTextColor.Split(",")
Dim nRed As Integer = 0 : Integer.TryParse( sTextColorArray(0), nRed)
Dim nGreen As Integer = 0 : Integer.TryParse( sTextColorArray(1), nGreen)
Dim nBlue As Integer = 0 : Integer.TryParse( sTextColorArray(2), nBlue)
colText.Setup( nRed, nGreen, nBlue)
Dim nRed As Integer = 0 : Integer.TryParse(sTextColorArray(0), nRed)
Dim nGreen As Integer = 0 : Integer.TryParse(sTextColorArray(1), nGreen)
Dim nBlue As Integer = 0 : Integer.TryParse(sTextColorArray(2), nBlue)
colText.Setup(nRed, nGreen, nBlue)
End If
' Assegno questo colore ai testi del layer indicato
Dim nId As Integer = EgtGetFirstInGroup( nGroup)
Dim nId As Integer = EgtGetFirstInGroup(nGroup)
While nId <> GDB_ID.NULL
If EgtGetType(nId) = GDB_TY.EXT_TEXT Then
EgtSetColor(nId, colText)
@@ -389,62 +419,62 @@ Module Utility
Return True
End Function
Friend Function AddTopToPartRegion( nRegId As Integer) As Boolean
Dim frReg As New Frame3d : EgtGetGroupGlobFrame( nRegId, frReg)
Dim b3Reg As New BBox3d : EgtGetBBoxGlob( nRegId, GDB_BB.STANDARD, b3Reg)
Friend Function AddTopToPartRegion(nRegId As Integer) As Boolean
Dim frReg As New Frame3d : EgtGetGroupGlobFrame(nRegId, frReg)
Dim b3Reg As New BBox3d : EgtGetBBoxGlob(nRegId, GDB_BB.STANDARD, b3Reg)
Dim dH As Double = Math.Min(0.1 * b3Reg.DimY(), 30)
Dim ptIns As New Point3d( b3Reg.Center().x, b3Reg.Max().y - dH, b3Reg.Max().z)
ptIns.ToLoc( frReg)
Dim nSfrId As Integer = EgtGetFirstInGroup( nRegId)
While nSfrId <> GDB_ID.NULL
If EgtGetType( nSfrId) = GDB_TY.SRF_FRGN Then Exit While
nSfrId = EgtGetNext( nSfrId)
Dim ptIns As New Point3d(b3Reg.Center().x, b3Reg.Max().y - dH, b3Reg.Max().z)
ptIns.ToLoc(frReg)
Dim nSfrId As Integer = EgtGetFirstInGroup(nRegId)
While nSfrId <> GDB_ID.NULL
If EgtGetType(nSfrId) = GDB_TY.SRF_FRGN Then Exit While
nSfrId = EgtGetNext(nSfrId)
End While
If nSfrId <> GDB_ID.NULL Then
Dim ptStart As New Point3d ( b3Reg.Min().x, b3Reg.Max().y - dH, b3Reg.Max().z)
ptStart.ToLoc( frReg)
Dim ptEnd As New Point3d ( b3Reg.Max().x, b3Reg.Max().y - dH, b3Reg.Max().z)
ptEnd.ToLoc( frReg)
Dim nLineId As Integer = EgtCreateLine( nRegId, ptStart, ptEnd)
Dim ptStart As New Point3d(b3Reg.Min().x, b3Reg.Max().y - dH, b3Reg.Max().z)
ptStart.ToLoc(frReg)
Dim ptEnd As New Point3d(b3Reg.Max().x, b3Reg.Max().y - dH, b3Reg.Max().z)
ptEnd.ToLoc(frReg)
Dim nLineId As Integer = EgtCreateLine(nRegId, ptStart, ptEnd)
Dim nCount As Integer = 0
Dim nNewId As Integer = EgtTrimCurveWithRegion( nLineId, nSfrId, True, False, nCount)
Dim nNewId As Integer = EgtTrimCurveWithRegion(nLineId, nSfrId, True, False, nCount)
If nNewId <> GDB_ID.NULL Then
If nCount > 0 Then EgtMidPoint( nNewId, ptIns)
If nCount > 0 Then EgtMidPoint(nNewId, ptIns)
For nTmpId As Integer = nNewId To nNewId + nCount - 1
EgtErase( nTmpId)
Next
EgtErase(nTmpId)
Next
Else
EgtErase( nLineId)
EgtErase(nLineId)
End If
End If
Dim vtDir As New Vector3d( 1, 0, 0)
vtDir.ToLoc( frReg)
Dim vtDir As New Vector3d(1, 0, 0)
vtDir.ToLoc(frReg)
Dim dLen, dAngV, dAngH As Double
vtDir.ToSpherical( dLen, dAngV, dAngH)
vtDir.ToSpherical(dLen, dAngV, dAngH)
Dim nText As Integer = EgtCreateTextAdv(nRegId, ptIns, dAngH, "*TOP*", "", 500, False, dH, 1, 0, INS_POS.MC)
Return ( nText <> GDB_ID.NULL)
Return (nText <> GDB_ID.NULL)
End Function
Friend Function SetBlockAndSlabNbr( sBlock As String, sSlabNbr As String) As Boolean
Friend Function SetBlockAndSlabNbr(sBlock As String, sSlabNbr As String) As Boolean
Dim nRawId As Integer = GetCurrentRaw()
If nRawId = GDB_ID.NULL Then Return False
If String.IsNullOrWhiteSpace(sBlock) Then sSlabNbr = ""
' Assegno info
EgtSetInfo( nRawId, INFO_RAW_BLOCK, sBlock)
EgtSetInfo( nRawId, INFO_RAW_SLABNBR, sSlabNbr)
EgtSetInfo(nRawId, INFO_RAW_BLOCK, sBlock)
EgtSetInfo(nRawId, INFO_RAW_SLABNBR, sSlabNbr)
' Cancello eventuale vecchio BarCode
EgtErase( EgtGetFirstNameInGroup( nRawId, NAME_BARCODE))
EgtErase(EgtGetFirstNameInGroup(nRawId, NAME_BARCODE))
' Se definito, inserisco nuovo BarCode
Dim sBarCode As String = sBlock & " - " & sSlabNbr
If sBarCode <> " - " Then
Dim ptRawCen As Point3d
GetRawCenter( ptRawCen)
GetRawCenter(ptRawCen)
Dim ptRawMin, ptRawMax As Point3d
GetRawBox( ptRawMin, ptRawMax)
Dim ptText As New Point3d( ptRawCen.x, ptRawCen.y, ptRawMax.z)
Dim nText As Integer = EgtCreateTextAdv( nRawId, ptText, 0, sBarCode, "", 500, False, 50.0, 1, 0, INS_POS.MC, GDB_RT.GLOB)
EgtSetName( nText, NAME_BARCODE)
EgtSetColor( nText, New Color3d(255, 0, 0))
GetRawBox(ptRawMin, ptRawMax)
Dim ptText As New Point3d(ptRawCen.x, ptRawCen.y, ptRawMax.z)
Dim nText As Integer = EgtCreateTextAdv(nRawId, ptText, 0, sBarCode, "", 500, False, 50.0, 1, 0, INS_POS.MC, GDB_RT.GLOB)
EgtSetName(nText, NAME_BARCODE)
EgtSetColor(nText, New Color3d(255, 0, 0))
End If
Return True
End Function
@@ -480,7 +510,7 @@ Module Utility
End Class
Public Function GetPrivateProfileLanguage( lpAppName As String, lpKeyName As String, lpFileName As String) As Language
Public Function GetPrivateProfileLanguage(lpAppName As String, lpKeyName As String, lpFileName As String) As Language
Dim sVal As String = String.Empty
GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, lpFileName)
Dim sItems() As String = sVal.Split(",".ToCharArray)
+51 -26
View File
@@ -4,6 +4,7 @@ Imports System.Collections.ObjectModel
Imports System.Runtime.InteropServices
Imports EgtUILib
Imports EgtWPFLib
Imports OmagCUT.VeinMatchingWindow
Public Class VeinMatchingWindow
@@ -19,6 +20,11 @@ Public Class VeinMatchingWindow
Private m_nIdToSel As Integer = GDB_ID.NULL
Private m_nIdToDesel As Integer = GDB_ID.NULL
Enum ALETTE
F = 2
A = 1
End Enum
Private Sub Window_Initialized(sender As Object, e As EventArgs)
' Assegnazione scena all'host e posizionamento nella PlacePageGrid
VeinMatchingSceneHost.Child = VeinMatchingScene
@@ -267,7 +273,7 @@ Friend Module VeinMatching
Dim nRegId As Integer = EgtGetFirstInGroup(nRegLayId)
While nRegId <> GDB_ID.NULL
If EgtGetType(nRegId) = GDB_TY.SRF_FRGN Then
Exit While
Exit While
End If
nRegId = EgtGetNext(nRegId)
End While
@@ -364,19 +370,21 @@ Friend Module VeinMatching
' Imposto il contesto del progetto
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
' Riattivo il gruppo di lavoro
EgtSetCurrMachGroup( EgtGetFirstMachGroup())
EgtSetCurrMachGroup(EgtGetFirstMachGroup())
' Verifico quali pezzi sono nel grezzo, per dichiararlo al VM
nId = EgtGetFirstPartInRawPart( CamAuto.GetCurrentRaw())
nId = EgtGetFirstPartInRawPart(CamAuto.GetCurrentRaw())
While nId <> GDB_ID.NULL
' Dichiaro pezzo nel grezzo per VM
VeinMatching.OnInsertPartInRaw( nId)
VeinMatching.OnInsertPartInRaw(nId)
' Passo al pezzo successivo
nId = EgtGetNextPartInRawPart(nId)
End While
' Ripristino visualizzazione di eventuali pezzi in parcheggio
ShowParkedParts()
' Ripristino il contesto corrente
EgtSetCurrentContext( nCurrCtx)
EgtSetCurrentContext(nCurrCtx)
' EgtSaveFile("C:\EgtData\OmagCUT\Temp\MyVeinMatch.nge", NGE.TEXT)
Return True
End Function
@@ -422,11 +430,11 @@ Friend Module VeinMatching
nCurrId = EgtGetFirstNameInGroup(nVeinId2, NAME_PREVIEW)
EgtSetStatus(nCurrId, GDB_ST.OFF)
' Se esiste OutLoop.orig OutLoop -> OutLoop.mach e OutLoop.orig -> OutLoop
Dim nOutLoopOrig As Integer = EgtGetFirstNameInGroup( nVeinId2, NAME_OUTLOOP & ".orig")
Dim nOutLoopOrig As Integer = EgtGetFirstNameInGroup(nVeinId2, NAME_OUTLOOP & ".orig")
If nOutLoopOrig <> GDB_ID.NULL Then
Dim nOutLoop As Integer = EgtGetFirstNameInGroup( nVeinId2, NAME_OUTLOOP)
EgtSetName( nOutLoop, NAME_OUTLOOP & ".mach")
EgtSetName( nOutLoopOrig, NAME_OUTLOOP)
Dim nOutLoop As Integer = EgtGetFirstNameInGroup(nVeinId2, NAME_OUTLOOP)
EgtSetName(nOutLoop, NAME_OUTLOOP & ".mach")
EgtSetName(nOutLoopOrig, NAME_OUTLOOP)
End If
' Se necessario, ripristino il contesto originale
If nCurrCtx > 0 Then EgtSetCurrentContext(nCurrCtx)
@@ -555,8 +563,8 @@ Friend Module VeinMatching
' Se richiesto, eseguo deselezione
If bDeselect Then EgtDeselectObj(nId)
End If
EgtDraw()
End If
EgtDraw()
EgtSetCurrentContext(nMainCtx)
Return True
End Function
@@ -1039,37 +1047,44 @@ Friend Module VeinMatching
End Function
Friend Function MoveAlettaSolid(ByRef Item As Aletta, ByRef ThicknessRaw As Double) As Boolean
' A: alzatina, F: frontalino
Dim nType As Integer
If Not EgtGetInfo(Item.IdSideRef, "AF", nType) Then Return False
Dim ptSRef, ptERef, ptE As Point3d
Dim ptSRef, ptERef, ptS, ptE As Point3d
' Piano cucina
If Not EgtStartPoint(Item.IdSideRef, GDB_ID.ROOT, ptSRef) Then Return False
If Not EgtEndPoint(Item.IdSideRef, GDB_ID.ROOT, ptERef) Then Return False
' AlzFront
If Not EgtStartPoint(Item.SideId, GDB_ID.ROOT, ptS) Then Return False
If Not EgtEndPoint(Item.SideId, GDB_ID.ROOT, ptE) Then Return False
' vettore lato cucina
Dim vtRotRef As Vector3d = ptERef - ptSRef
' vettore lato AlzFront
Dim vtRot As Vector3d = ptE - ptS
' ruoto il solido intorno al lato di riferimento
Dim vtRot As Vector3d = ptERef - ptSRef
If nType = 1 Then
EgtRotate(Item.PartId, ptE, vtRot, -90, GDB_RT.GLOB)
ElseIf nType = 2 Then
If nType = ALETTE.A Then
EgtRotate(Item.PartId, ptE, vtRot, 90, GDB_RT.GLOB)
ElseIf nType = ALETTE.F Then
EgtRotate(Item.PartId, ptE, vtRot, -90, GDB_RT.GLOB)
End If
' punto di riferimento per la traslazione sul solido
Dim ptSolid As Point3d
If nType = 1 Then
If nType = ALETTE.A Then
' cerco id della curva che definisce la front face
Dim nSolidGrp As Integer = EgtGetFirstNameInGroup(Item.PartId, NAME_VM_SOLID)
Dim nFrontCrvId As Integer = EgtGetFirstInGroup(nSolidGrp)
EgtStartPoint(nFrontCrvId, ptSolid)
ElseIf nType = 2 Then
EgtStartPoint(Item.SideId, ptSolid)
EgtStartPoint(nFrontCrvId, GDB_ID.ROOT, ptSolid)
ElseIf nType = ALETTE.F Then
EgtStartPoint(Item.SideId, GDB_ID.ROOT, ptSolid)
End If
Dim ItemFrame As New Frame3d
If Not EgtGetGroupGlobFrame(Item.PartId, ItemFrame) Then Return False
ptSolid.ToGlob(ItemFrame)
' Dim ItemFrame As New Frame3d
' If Not EgtGetGroupGlobFrame(Item.PartId, ItemFrame) Then Return False
' ptSolid.ToGlob(ItemFrame)
'punto di riferimento per la traslazione sul piano cucina
Dim ptKitchen As Point3d = ptERef
@@ -1077,6 +1092,16 @@ Friend Module VeinMatching
Dim vtMove As Vector3d = ptKitchen - ptSolid
EgtMove(Item.PartId, vtMove, GDB_RT.GLOB)
' eventualmente ruoto per allineare l'alzatina al piano cucina
Dim dLRef, dAngVRef, dAngHRef As Double
vtRotRef.ToSpherical(dLRef, dAngVRef, dAngHRef)
Dim dL, dAngV, dAngH As Double
vtRot.Rotate(Vector3d.Z_AX, 180)
vtRot.ToSpherical(dL, dAngV, dAngH)
Dim dDelta As Double = dAngHRef - dAngH
If Math.Abs(dDelta) < EPS_ANG_SMALL Then Return True
EgtRotate(Item.PartId, ptKitchen, Vector3d.Z_AX, dDelta, GDB_RT.GLOB)
Return True
End Function
@@ -1206,7 +1231,7 @@ Friend Module VeinMatching
' Se necessario, cambio contesto
If m_nVeinCtx <> nCurrCtx Then
If EgtSetCurrentContext(m_nVeinCtx) Then
Return If( nCurrCtx > 0, nCurrCtx, -2)
Return If(nCurrCtx > 0, nCurrCtx, -2)
Else
Return 0
End If
@@ -1268,7 +1293,7 @@ Friend Module VeinMatching
While nId <> GDB_ID.NULL
Dim nOriId As Integer
If EgtGetInfo(nId, KEY_ORI_ID, nOriId) AndAlso nOriId = nPartId Then
Exit While
Exit While
End If
nId = EgtGetNextPart(nId)
End While