Compare commits
60 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4c282d7531 | |||
| a941f963c2 | |||
| eab341d7fe | |||
| acb8ceed4d | |||
| 65d8f58b45 | |||
| 07cf7ced42 | |||
| b1410ca11c | |||
| 1975f46995 | |||
| 6863186e07 | |||
| b434f80030 | |||
| 959fb2e44f | |||
| 941e7837be | |||
| 680505af10 | |||
| b0bfa67d2a | |||
| 29d8c1e29b | |||
| e5d4f223f8 | |||
| 3cfc7276c9 | |||
| 0c0233b27e | |||
| 4e8925515d | |||
| 3b552b2f4e | |||
| 0d4d853834 | |||
| 37fcbe8240 | |||
| 4393f282b7 | |||
| 6844a8c77c | |||
| 659405c52f | |||
| 6905a8d6dc | |||
| d8ba23894e | |||
| aba1572f95 | |||
| fdb0ed598b | |||
| 4cb3518346 | |||
| 56b8ee88d3 | |||
| d0439f2b05 | |||
| 997e8c380d | |||
| d49c231541 | |||
| 8d82058e49 | |||
| d6a9cac6b4 | |||
| 4ce898c25c | |||
| 6f59cddd80 | |||
| c8b018f6df | |||
| e287e827c4 | |||
| 68e9a9201d | |||
| 8946bf3a00 | |||
| aeb0be0590 | |||
| a15acb6528 | |||
| e7e9d26b75 | |||
| d9de23daca | |||
| ad5c9331ba | |||
| b67330b509 | |||
| ca66108145 | |||
| 379ccc7519 | |||
| b751c27773 | |||
| 14e1c254f0 | |||
| 6f08e5f520 | |||
| 7d8933cc39 | |||
| 2179996bff | |||
| 316bcc89ea | |||
| ce151e5db7 | |||
| b303fe2615 | |||
| 3e0d43c1d8 | |||
| 70b1822446 |
@@ -329,8 +329,6 @@ Public Class MoveRawPartPage
|
|||||||
VacuumCups.SetWeightInformation(AverageDensity, MaxSinglePlugger, MaxDoublePlugger)
|
VacuumCups.SetWeightInformation(AverageDensity, MaxSinglePlugger, MaxDoublePlugger)
|
||||||
VacuumCups.SetRotationForExtraStrokeY(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEY, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
VacuumCups.SetRotationForExtraStrokeY(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEY, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||||
VacuumCups.SetRotationForExtraStrokeX(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEX, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
VacuumCups.SetRotationForExtraStrokeX(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEX, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||||
' se su scarico frontale allora devo modificare la scelta delle ventose
|
|
||||||
VacuumCups.bUnloadingOnAuxTab = m_SplitPage.m_bOnAuxTab
|
|
||||||
If PutVacuumCupsOnRaw(nId, rmData) Then
|
If PutVacuumCupsOnRaw(nId, rmData) Then
|
||||||
' Visualizzo le ventose
|
' Visualizzo le ventose
|
||||||
EgtSetStatus(GetVacuumId(), GDB_ST.ON_)
|
EgtSetStatus(GetVacuumId(), GDB_ST.ON_)
|
||||||
|
|||||||
@@ -1353,8 +1353,8 @@ Public Class NestPageUC
|
|||||||
VeinMatching.OnDeselectPart(m_nIdToDesel)
|
VeinMatching.OnDeselectPart(m_nIdToDesel)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
' Reset
|
' Reset
|
||||||
|
GetFamilyGroupInPark()
|
||||||
m_bDrag = False
|
m_bDrag = False
|
||||||
m_nIdToSel = GDB_ID.NULL
|
m_nIdToSel = GDB_ID.NULL
|
||||||
m_nIdToDesel = GDB_ID.NULL
|
m_nIdToDesel = GDB_ID.NULL
|
||||||
|
|||||||
+17
-6
@@ -546,16 +546,27 @@ Module VacuumCups
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
' assegante le posizioni del centro delle ventose e l'angolo di posizionamento orizzontale verifica che la posizione sia raggiungibile
|
' assegnate le posizioni del centro delle ventose e l'angolo di posizionamento orizzontale verifica che la posizione sia raggiungibile
|
||||||
Public Function VerifyOutOfStrokes(ptRef As Point3d, dRotAngDeg As Double) As Integer
|
Public Function VerifyOutOfStrokes(ptRef As Point3d, dRotAngDeg As Double) As Integer
|
||||||
Dim dX, dY, dZ As Double
|
' Posizione Home dell'asse rotante
|
||||||
Dim nStat As Integer
|
|
||||||
Dim dCHome As Double
|
Dim dCHome As Double
|
||||||
EgtGetAxisHomePos("C", dCHome)
|
EgtGetAxisHomePos("C", dCHome)
|
||||||
' imposto la l'uscita della ventosa come fosse l'uscita di un utensile
|
' Corse dell'asse
|
||||||
|
Dim dCMin As Double
|
||||||
|
EgtGetAxisMin("C", dCMin)
|
||||||
|
Dim dCMax As Double
|
||||||
|
EgtGetAxisMax("C", dCMax)
|
||||||
|
' Porto l'angolo nel range
|
||||||
|
Dim dRotAngMachDeg As Double = dRotAngDeg + dCHome
|
||||||
|
AdjustAngleInRange(dRotAngMachDeg, dCMin, dCMax)
|
||||||
|
' Imposto la ventosa come fosse un utensile
|
||||||
EgtSetCalcTool("", "H4", 1)
|
EgtSetCalcTool("", "H4", 1)
|
||||||
EgtGetCalcPositions(ptRef, dRotAngDeg + dCHome, 0, nStat, dX, dY, dZ)
|
' Calcolo gli assi macchina
|
||||||
EgtVerifyOutstroke(dX, dY, dZ, dRotAngDeg + dCHome, 0, nStat)
|
Dim dX, dY, dZ As Double
|
||||||
|
Dim nStat As Integer
|
||||||
|
EgtGetCalcPositions(ptRef, dRotAngMachDeg, 0, nStat, dX, dY, dZ)
|
||||||
|
' Verifico le corse
|
||||||
|
EgtVerifyOutstroke(dX, dY, dZ, dRotAngMachDeg, 0, nStat)
|
||||||
Return nStat
|
Return nStat
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|||||||
@@ -189,6 +189,8 @@ Module ConstGen
|
|||||||
Public Const INFO_TOPRODAREA As String = "ToProdArea"
|
Public Const INFO_TOPRODAREA As String = "ToProdArea"
|
||||||
' Info per nome progetti
|
' Info per nome progetti
|
||||||
Public Const INFO_PROJNAME As String = "ProjName"
|
Public Const INFO_PROJNAME As String = "ProjName"
|
||||||
|
' Info per parcheggio asse C
|
||||||
|
Public Const INFO_CAXESHOME As String = "CAxesHome"
|
||||||
|
|
||||||
' Nome layer delle regioni
|
' Nome layer delle regioni
|
||||||
Public Const NAME_REGION As String = "Region"
|
Public Const NAME_REGION As String = "Region"
|
||||||
|
|||||||
@@ -116,6 +116,8 @@ Module ConstIni
|
|||||||
Public Const K_LASTCOLOR As String = "LastColor"
|
Public Const K_LASTCOLOR As String = "LastColor"
|
||||||
Public Const K_COLOR As String = "Color"
|
Public Const K_COLOR As String = "Color"
|
||||||
|
|
||||||
|
Public Const S_FRAMECOMPO As String = "FrameCompo"
|
||||||
|
|
||||||
Public Const S_EXTCOMPO As String = "Compo"
|
Public Const S_EXTCOMPO As String = "Compo"
|
||||||
|
|
||||||
Public Const S_INTCOMPO As String = "InternalCompo"
|
Public Const S_INTCOMPO As String = "InternalCompo"
|
||||||
@@ -223,6 +225,12 @@ Module ConstIni
|
|||||||
Public Const K_RAWOFFSX As String = "OffsX"
|
Public Const K_RAWOFFSX As String = "OffsX"
|
||||||
Public Const K_RAWOFFSY As String = "OffsY"
|
Public Const K_RAWOFFSY As String = "OffsY"
|
||||||
Public Const K_RAWKERF As String = "Kerf"
|
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 S_RAWMOVE As String = "RawMove"
|
||||||
Public Const K_RAWSTEP As String = "Step"
|
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_TEST_OFFSET As String = "TestOffset"
|
||||||
Public Const K_DC_OFFSET_SQUARING As String = "OffsetSquaring"
|
Public Const K_DC_OFFSET_SQUARING As String = "OffsetSquaring"
|
||||||
Public Const K_DC_EXTRA_LEN_SQUARING As String = "ExtraLenSquaring"
|
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 S_STATDATA As String = "StatData"
|
||||||
Public Const K_SD_DAY As String = "Day"
|
Public Const K_SD_DAY As String = "Day"
|
||||||
|
|||||||
@@ -46,6 +46,13 @@
|
|||||||
Public Const K_THREADSLEEP As String = "ThreadSleep"
|
Public Const K_THREADSLEEP As String = "ThreadSleep"
|
||||||
Public Const K_PHOTODELEY As String = "PhotoDeley"
|
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 S_EXECLUA As String = "ExecLua"
|
||||||
Public Const K_FILESCRIPT_LUA As String = "FileScript"
|
Public Const K_FILESCRIPT_LUA As String = "FileScript"
|
||||||
|
|
||||||
@@ -78,6 +85,7 @@
|
|||||||
Public Const K_TABLEDOWN As String = "TableDown"
|
Public Const K_TABLEDOWN As String = "TableDown"
|
||||||
Public Const K_MANUAL As String = "Manual"
|
Public Const K_MANUAL As String = "Manual"
|
||||||
Public Const K_DOORCLOSED As String = "DoorClosed"
|
Public Const K_DOORCLOSED As String = "DoorClosed"
|
||||||
|
Public Const K_DOOROPENDED As String = "DoorOpened"
|
||||||
Public Const K_LIMITZ As String = "LimitZ"
|
Public Const K_LIMITZ As String = "LimitZ"
|
||||||
Public Const K_POWEROVR As String = "PowerOvr"
|
Public Const K_POWEROVR As String = "PowerOvr"
|
||||||
Public Const K_PARKING As String = "Parking"
|
Public Const K_PARKING As String = "Parking"
|
||||||
@@ -112,6 +120,7 @@
|
|||||||
Public Const K_FEEDHOLD As String = "FeedHold"
|
Public Const K_FEEDHOLD As String = "FeedHold"
|
||||||
Public Const K_SPOTLIGHT1 As String = "SpotLight1"
|
Public Const K_SPOTLIGHT1 As String = "SpotLight1"
|
||||||
Public Const K_SPOTLIGHT2 As String = "SpotLight2"
|
Public Const K_SPOTLIGHT2 As String = "SpotLight2"
|
||||||
|
Public Const K_NAXES As String = "nAxes"
|
||||||
' Nuove variabili
|
' Nuove variabili
|
||||||
Public Const K_SPEEDHOLD As String = "SpeedHold"
|
Public Const K_SPEEDHOLD As String = "SpeedHold"
|
||||||
Public Const K_XYJOG As String = "XYJog"
|
Public Const K_XYJOG As String = "XYJog"
|
||||||
@@ -270,6 +279,7 @@
|
|||||||
Public Const S_MACH_PROBING As String = "Probing"
|
Public Const S_MACH_PROBING As String = "Probing"
|
||||||
Public Const K_PROBINGSTATEVAR As String = "ProbingStateVar"
|
Public Const K_PROBINGSTATEVAR As String = "ProbingStateVar"
|
||||||
Public Const K_SAWDIAMETER As String = "SawDiameter"
|
Public Const K_SAWDIAMETER As String = "SawDiameter"
|
||||||
|
Public Const K_TOOLLENGTH As String = "ToolLength"
|
||||||
Public Const K_RAWTHICKNESS As String = "RawThickness"
|
Public Const K_RAWTHICKNESS As String = "RawThickness"
|
||||||
Public Const K_ENABLERAWPROBE As String = "EnableRawProbe"
|
Public Const K_ENABLERAWPROBE As String = "EnableRawProbe"
|
||||||
|
|
||||||
|
|||||||
@@ -140,8 +140,11 @@ Public Class ControlsDirectCutUC
|
|||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' Caso standard
|
If m_MainWindow.m_DirectCutPageUC.m_ActiveControl <> DirectCutPageUC.Controls.MachineButtonUC Or
|
||||||
m_ActiveDirectCutPage = DirectCutPages.DirectCut
|
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
|
' Attivo le lavorazioni solo se esiste il grezzo e se presente testa H1
|
||||||
Dim bRawOk As Boolean = (GetRawHeight() > EPS_SMALL)
|
Dim bRawOk As Boolean = (GetRawHeight() > EPS_SMALL)
|
||||||
|
|||||||
@@ -76,6 +76,11 @@ Public Class ControlsMachineButtonUC
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
#Region "STATE CHANGED"
|
||||||
|
' ------------------------------------------------------------------------------
|
||||||
|
' i segeunti metodi notificano il cambiamento di stato di specifici bottoni
|
||||||
|
'-------------------------------------------------------------------------------
|
||||||
|
|
||||||
Friend Sub SpindleStateChanged(SpindleState As Boolean)
|
Friend Sub SpindleStateChanged(SpindleState As Boolean)
|
||||||
Dim SpindleButton As TwoStateButton = Nothing
|
Dim SpindleButton As TwoStateButton = Nothing
|
||||||
For Each MachineButton As MachineButton In m_ButtonList
|
For Each MachineButton As MachineButton In m_ButtonList
|
||||||
@@ -255,38 +260,34 @@ Public Class ControlsMachineButtonUC
|
|||||||
Dim DoorOpenedButton As ThreeStateButton = Nothing
|
Dim DoorOpenedButton As ThreeStateButton = Nothing
|
||||||
For Each MachineButton As MachineButton In m_ButtonList
|
For Each MachineButton As MachineButton In m_ButtonList
|
||||||
If MachineButton.StateFlag = K_DOORCLOSED Then
|
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
|
DoorClosedButton = MachineButton
|
||||||
End If
|
End If
|
||||||
If MachineButton.StateFlag = "DoorOpened" Then
|
If MachineButton.StateFlag = K_DOOROPENDED Then
|
||||||
DoorOpenedButton = MachineButton
|
DoorOpenedButton = MachineButton
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
' Chiusura porte (gesrtione comando Three/Two state
|
||||||
If Not IsNothing(DoorClosedButton) Then
|
If Not IsNothing(DoorClosedButton) Then
|
||||||
Select Case DoorClosedState
|
Select Case DoorClosedState
|
||||||
Case 0
|
Case 0
|
||||||
|
' porta aperta
|
||||||
DoorClosedButton.Background = Application.Current.FindResource("OmagCut_Red")
|
DoorClosedButton.Background = Application.Current.FindResource("OmagCut_Red")
|
||||||
Case 1, 2
|
Case 1, 2
|
||||||
|
' porta in movimento/aperta
|
||||||
DoorClosedButton.Background = Application.Current.FindResource("OmagCut_LightGray")
|
DoorClosedButton.Background = Application.Current.FindResource("OmagCut_LightGray")
|
||||||
End Select
|
End Select
|
||||||
End If
|
End If
|
||||||
|
' Chiusura porte (gesrtione comando Three/Two state
|
||||||
If Not IsNothing(DoorOpenedButton) Then
|
If Not IsNothing(DoorOpenedButton) Then
|
||||||
Select Case DoorClosedState
|
Select Case DoorClosedState
|
||||||
Case 0
|
Case 0
|
||||||
|
' porta aperta
|
||||||
DoorOpenedButton.Background = Application.Current.FindResource("OmagCut_LightGray")
|
DoorOpenedButton.Background = Application.Current.FindResource("OmagCut_LightGray")
|
||||||
Case 1
|
Case 1
|
||||||
|
' porta in movimento
|
||||||
DoorOpenedButton.Background = Application.Current.FindResource("OmagCut_Yellow")
|
DoorOpenedButton.Background = Application.Current.FindResource("OmagCut_Yellow")
|
||||||
Case 2
|
Case 2
|
||||||
|
' porta chiusa
|
||||||
DoorOpenedButton.Background = Application.Current.FindResource("OmagCut_Green")
|
DoorOpenedButton.Background = Application.Current.FindResource("OmagCut_Green")
|
||||||
End Select
|
End Select
|
||||||
End If
|
End If
|
||||||
@@ -372,6 +373,7 @@ Public Class ControlsMachineButtonUC
|
|||||||
'End If
|
'End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
#End Region ' State Range
|
||||||
|
|
||||||
Public Function GetPrivateProfileMachineButtons(
|
Public Function GetPrivateProfileMachineButtons(
|
||||||
ByVal lpAppName As String,
|
ByVal lpAppName As String,
|
||||||
@@ -569,13 +571,64 @@ Public MustInherit Class MachineButton
|
|||||||
EgtOutLog("dopo scrittura seconda variabile")
|
EgtOutLog("dopo scrittura seconda variabile")
|
||||||
End If
|
End If
|
||||||
Return
|
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 Select
|
||||||
End If
|
End If
|
||||||
'--------------------------------------------------------- MDI ---------------------------------------------------------
|
'--------------------------------------------------------- MDI ---------------------------------------------------------
|
||||||
Dim nResult As Short
|
Dim nResult As Short
|
||||||
' assegno la modalità di funzionamento
|
' assegno la modalità di funzionamento
|
||||||
Select Case m_MainWindow.m_CNCommunication.m_nNCType
|
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
|
nResult = m_CN.DGeneralFunctions_WriteCncMode(2) ' Modalità MDI per controlli num
|
||||||
Case 3
|
Case 3
|
||||||
'Per il siemens non devo fare nulla
|
'Per il siemens non devo fare nulla
|
||||||
@@ -599,7 +652,7 @@ Public MustInherit Class MachineButton
|
|||||||
m_CN.DGeneralFunctions_CycleStart()
|
m_CN.DGeneralFunctions_CycleStart()
|
||||||
End If
|
End If
|
||||||
System.Threading.Thread.Sleep(300)
|
System.Threading.Thread.Sleep(300)
|
||||||
' riprostino la modalità manuale
|
' ripristino la modalità manuale..?? siucuri ??
|
||||||
nResult = m_CN.DGeneralFunctions_WriteCncMode(7) ' Modalità manuale
|
nResult = m_CN.DGeneralFunctions_WriteCncMode(7) ' Modalità manuale
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -620,6 +673,7 @@ Public MustInherit Class MachineButton
|
|||||||
EgtTdbGetCurrToolParam(MCH_TP.FEED, dFeed)
|
EgtTdbGetCurrToolParam(MCH_TP.FEED, dFeed)
|
||||||
End If
|
End If
|
||||||
EgtLuaSetGlobNumVar("CMD.F", dFeed)
|
EgtLuaSetGlobNumVar("CMD.F", dFeed)
|
||||||
|
|
||||||
Dim dSpeed As Double = 0
|
Dim dSpeed As Double = 0
|
||||||
If Not String.IsNullOrWhiteSpace(m_DirectCutPage.m_ManualAxesMove.SpeedTxBx.Text) Then
|
If Not String.IsNullOrWhiteSpace(m_DirectCutPage.m_ManualAxesMove.SpeedTxBx.Text) Then
|
||||||
StringToDouble(m_DirectCutPage.m_ManualAxesMove.SpeedTxBx.Text, dSpeed)
|
StringToDouble(m_DirectCutPage.m_ManualAxesMove.SpeedTxBx.Text, dSpeed)
|
||||||
@@ -628,6 +682,18 @@ Public MustInherit Class MachineButton
|
|||||||
EgtTdbGetCurrToolParam(MCH_TP.SPEED, dSpeed)
|
EgtTdbGetCurrToolParam(MCH_TP.SPEED, dSpeed)
|
||||||
End If
|
End If
|
||||||
EgtLuaSetGlobNumVar("CMD.S", dSpeed)
|
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
|
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||||
m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2)
|
m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2)
|
||||||
EgtLuaSetGlobNumVar("CMD.L1", dL1)
|
EgtLuaSetGlobNumVar("CMD.L1", dL1)
|
||||||
@@ -789,6 +855,7 @@ Public Class NoStateButton
|
|||||||
ExecuteMDICommand(TLuaScriptName)
|
ExecuteMDICommand(TLuaScriptName)
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
|
' FANUC, SIEMENS
|
||||||
ExecuteMDICommand(TLuaScriptName)
|
ExecuteMDICommand(TLuaScriptName)
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
@@ -219,7 +219,10 @@
|
|||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<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*"/>-->
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
@@ -263,9 +266,11 @@
|
|||||||
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}">
|
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}">
|
||||||
<Image Source="{DynamicResource ParkingImg}" Style="{StaticResource OmagCut_ScaleButtonIcon}"/>
|
<Image Source="{DynamicResource ParkingImg}" Style="{StaticResource OmagCut_ScaleButtonIcon}"/>
|
||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--Comando Manula/MDI-->
|
<!--Comando Manula/MDI-->
|
||||||
<Button Name="ManualModeBtn" Grid.Column="8"
|
<Button Name="ManualModeBtn" Grid.Column="11"
|
||||||
Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
|
Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
|
||||||
<Image Source="{DynamicResource ManualImg}" Style="{StaticResource OmagCut_ScaleButtonIcon}"/>
|
<Image Source="{DynamicResource ManualImg}" Style="{StaticResource OmagCut_ScaleButtonIcon}"/>
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ Public Class DirectCutPageUC
|
|||||||
|
|
||||||
'Posizionemento nella griglia delle Page UserControl
|
'Posizionemento nella griglia delle Page UserControl
|
||||||
m_MachineButtons.SetValue(Grid.RowProperty, 2)
|
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_ManualAxesMove.SetValue(Grid.RowProperty, 1)
|
||||||
|
|
||||||
m_ControlsDirectCutUC.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])
|
' 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())
|
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())
|
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
|
If Not m_NewMachineButtonsType Then
|
||||||
'Assegno MachineButtons alla pagina
|
'Assegno MachineButtons alla pagina
|
||||||
LowerButtonGrid.Children.Add(m_MachineButtons)
|
LowerButtonGrid.Children.Add(m_MachineButtons)
|
||||||
ControlsMachineBtn.Visibility = Windows.Visibility.Collapsed
|
ControlsMachineBtn.Visibility = Windows.Visibility.Collapsed
|
||||||
VacuumMachineBtn.Visibility = Windows.Visibility.Collapsed
|
VacuumMachineBtn.Visibility = Windows.Visibility.Collapsed
|
||||||
End If
|
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
|
' nuovi bottoni 20/05/2021 - modifica specifiche 04/08/2021
|
||||||
' leggo il numero di assi attivi nella macchina
|
' leggo il numero di assi attivi nella macchina
|
||||||
@@ -209,6 +215,7 @@ Public Class DirectCutPageUC
|
|||||||
m_ControlsMachineButton.SetValue(Grid.RowProperty, 1)
|
m_ControlsMachineButton.SetValue(Grid.RowProperty, 1)
|
||||||
m_NewMachineButtonsType = m_ControlsMachineButton.GetPrivateProfileMachineButtons(S_CONTROLMACHBUTTONS, "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())
|
||||||
MachineButtonGrid.Children.Add(m_ControlsMachineButton)
|
MachineButtonGrid.Children.Add(m_ControlsMachineButton)
|
||||||
|
m_ActiveControl = Controls.MachineButtonUC
|
||||||
If VacuumMachineBtn.IsChecked Then
|
If VacuumMachineBtn.IsChecked Then
|
||||||
MachineButtonGrid.Children.Remove(m_VacuumMachineButton)
|
MachineButtonGrid.Children.Remove(m_VacuumMachineButton)
|
||||||
VacuumMachineBtn.IsChecked = False
|
VacuumMachineBtn.IsChecked = False
|
||||||
@@ -221,6 +228,7 @@ Public Class DirectCutPageUC
|
|||||||
Private Sub VacuumMachineBtn_Click(sender As Object, e As RoutedEventArgs) Handles VacuumMachineBtn.Click
|
Private Sub VacuumMachineBtn_Click(sender As Object, e As RoutedEventArgs) Handles VacuumMachineBtn.Click
|
||||||
If VacuumMachineBtn.IsChecked Then
|
If VacuumMachineBtn.IsChecked Then
|
||||||
MachineButtonGrid.Children.Add(m_VacuumMachineButton)
|
MachineButtonGrid.Children.Add(m_VacuumMachineButton)
|
||||||
|
m_ActiveControl = Controls.VacuumButtonUC
|
||||||
If ControlsMachineBtn.IsChecked Then
|
If ControlsMachineBtn.IsChecked Then
|
||||||
MachineButtonGrid.Children.Remove(m_ControlsMachineButton)
|
MachineButtonGrid.Children.Remove(m_ControlsMachineButton)
|
||||||
ControlsMachineBtn.IsChecked = False
|
ControlsMachineBtn.IsChecked = False
|
||||||
@@ -417,12 +425,14 @@ Public Class DirectCutPageUC
|
|||||||
If m_bShowMachine Then
|
If m_bShowMachine Then
|
||||||
' aggiorno lo stato
|
' aggiorno lo stato
|
||||||
Select Case m_nMachLook
|
Select Case m_nMachLook
|
||||||
Case MCH_LOOK.ALL
|
Case MCH_LOOK.ALL
|
||||||
m_nMachLook = MCH_LOOK.TAB_HEAD
|
m_nMachLook = MCH_LOOK.TAB_HEAD
|
||||||
Case MCH_LOOK.TAB_HEAD
|
Case MCH_LOOK.TAB_HEAD
|
||||||
m_nMachLook = MCH_LOOK.TAB_TOOL
|
m_nMachLook = MCH_LOOK.TAB_TOOL
|
||||||
Case Else
|
Case MCH_LOOK.TAB_TOOL
|
||||||
m_nMachLook = MCH_LOOK.ALL
|
m_nMachLook = MCH_LOOK.TAB
|
||||||
|
Case Else
|
||||||
|
m_nMachLook = MCH_LOOK.ALL
|
||||||
End Select
|
End Select
|
||||||
' aggiorno lo stato della macchina e la sua visualizzazione
|
' aggiorno lo stato della macchina e la sua visualizzazione
|
||||||
EgtSetMachineLook(m_nMachLook)
|
EgtSetMachineLook(m_nMachLook)
|
||||||
@@ -444,8 +454,12 @@ Public Class DirectCutPageUC
|
|||||||
m_ControlsDirectCutUC1.DirectCutPage_Unloaded(Nothing, Nothing)
|
m_ControlsDirectCutUC1.DirectCutPage_Unloaded(Nothing, Nothing)
|
||||||
Case Controls.MachineButtonUC
|
Case Controls.MachineButtonUC
|
||||||
MachineButtonGrid.Children.Remove(m_ControlsMachineButton)
|
MachineButtonGrid.Children.Remove(m_ControlsMachineButton)
|
||||||
|
MachineButtonGrid.Children.Remove(m_ControlsDirectCutUC)
|
||||||
|
MachineButtonGrid.Children.Remove(m_ControlsDirectCutUC1)
|
||||||
ControlsMachineBtn.IsChecked = False
|
ControlsMachineBtn.IsChecked = False
|
||||||
Case Controls.VacuumButtonUC
|
Case Controls.VacuumButtonUC
|
||||||
|
MachineButtonGrid.Children.Remove(m_ControlsMachineButton)
|
||||||
|
MachineButtonGrid.Children.Remove(m_ControlsDirectCutUC)
|
||||||
MachineButtonGrid.Children.Remove(m_VacuumMachineButton)
|
MachineButtonGrid.Children.Remove(m_VacuumMachineButton)
|
||||||
VacuumMachineBtn.IsChecked = False
|
VacuumMachineBtn.IsChecked = False
|
||||||
End Select
|
End Select
|
||||||
|
|||||||
@@ -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_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_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_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
|
' Se non vado in simulazione
|
||||||
If Not m_bSimul Then
|
If Not m_bSimul Then
|
||||||
' Dichiaro sottopagina da non riattivare
|
' Dichiaro sottopagina da non riattivare
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ Public Class MachineButtonsUC
|
|||||||
Private m_DirectCutPage As DirectCutPageUC
|
Private m_DirectCutPage As DirectCutPageUC
|
||||||
Friend m_CN As CN_generico
|
Friend m_CN As CN_generico
|
||||||
|
|
||||||
|
Public nCountButton As Integer = 11
|
||||||
|
|
||||||
Private m_bOnlyLaser As Boolean = False
|
Private m_bOnlyLaser As Boolean = False
|
||||||
Private m_bFirst As Boolean = True
|
Private m_bFirst As Boolean = True
|
||||||
|
|
||||||
@@ -76,6 +78,9 @@ Public Class MachineButtonsUC
|
|||||||
GetToggleButton(nIndex + 1).Visibility = Windows.Visibility.Hidden
|
GetToggleButton(nIndex + 1).Visibility = Windows.Visibility.Hidden
|
||||||
Next
|
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
|
' Se variabile di stato "Nothing"/"DoorOpened"/"DoorClosed" imposto immagine fissa
|
||||||
For nIndex As Integer = 0 To m_nCount - 1
|
For nIndex As Integer = 0 To m_nCount - 1
|
||||||
If StateFlagArray(nIndex) = BTN_STATE_NOTHING OrElse
|
If StateFlagArray(nIndex) = BTN_STATE_NOTHING OrElse
|
||||||
@@ -267,9 +272,62 @@ Public Class MachineButtonsUC
|
|||||||
End If
|
End If
|
||||||
Return
|
Return
|
||||||
End If
|
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 Select
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
Dim nResult As Short
|
Dim nResult As Short
|
||||||
' Imposto modalità MDI per controlli num
|
' Imposto modalità MDI per controlli num
|
||||||
Select Case m_MainWindow.m_CNCommunication.m_nNCType
|
Select Case m_MainWindow.m_CNCommunication.m_nNCType
|
||||||
@@ -286,6 +344,8 @@ Public Class MachineButtonsUC
|
|||||||
m_CN.DGeneralFunctions_CycleStart()
|
m_CN.DGeneralFunctions_CycleStart()
|
||||||
Case 3
|
Case 3
|
||||||
'Per il siemens non devo fare nulla
|
'Per il siemens non devo fare nulla
|
||||||
|
Case 4
|
||||||
|
' Nicola: 27/03/2023 attivazione della funzione M# indicata?
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
If b2Start Then
|
If b2Start Then
|
||||||
@@ -320,6 +380,17 @@ Public Class MachineButtonsUC
|
|||||||
EgtTdbGetCurrToolParam(MCH_TP.SPEED, dSpeed)
|
EgtTdbGetCurrToolParam(MCH_TP.SPEED, dSpeed)
|
||||||
End If
|
End If
|
||||||
EgtLuaSetGlobNumVar("CMD.S", dSpeed)
|
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
|
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||||
m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2)
|
m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2)
|
||||||
EgtLuaSetGlobNumVar("CMD.L1", dL1)
|
EgtLuaSetGlobNumVar("CMD.L1", dL1)
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ Public Class ManualAxesMoveUC
|
|||||||
System.Threading.Thread.Sleep(150)
|
System.Threading.Thread.Sleep(150)
|
||||||
m_CN.DGeneralFunctions_CycleStart()
|
m_CN.DGeneralFunctions_CycleStart()
|
||||||
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
|
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
|
m_MoveClicked = False
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
Imports EgtUILib
|
Imports System.Windows.Threading
|
||||||
|
Imports EgtUILib
|
||||||
|
|
||||||
Public Class SingleCutUC
|
Public Class SingleCutUC
|
||||||
|
|
||||||
@@ -43,6 +44,10 @@ Public Class SingleCutUC
|
|||||||
Private Const MIN_CUT_LEN As Double = 10.0
|
Private Const MIN_CUT_LEN As Double = 10.0
|
||||||
Private Const MAX_SIDE_ANG As Double = 60.0
|
Private Const MAX_SIDE_ANG As Double = 60.0
|
||||||
' Costanti che indicano la modalità di acquisizione dei punti
|
' 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
|
Private Enum PT_MODE As Integer
|
||||||
SAW = 0
|
SAW = 0
|
||||||
LASER = 1
|
LASER = 1
|
||||||
@@ -68,14 +73,14 @@ Public Class SingleCutUC
|
|||||||
SimulBtn.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 1)
|
SimulBtn.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 1)
|
||||||
OkBtn.ToolTip = EgtMsg(MSG_DIRECTCUTPAGEUC + 30)
|
OkBtn.ToolTip = EgtMsg(MSG_DIRECTCUTPAGEUC + 30)
|
||||||
' Carico i dati dell'ultimo taglio
|
' Carico i dati dell'ultimo taglio
|
||||||
m_dDepth = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_SING_DEPTH, m_dDepth, 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_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_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_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_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_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.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.y = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_SING_POSY, m_ptTipP1.y, m_MainWindow.GetIniFile())
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub SingleCut_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
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
|
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = True
|
||||||
EgtSetMachineLook(m_MainWindow.m_DirectCutPageUC.m_nMachLook)
|
EgtSetMachineLook(m_MainWindow.m_DirectCutPageUC.m_nMachLook)
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
|
' riavvio il timer per visualizzare la poszione della macchina
|
||||||
|
If Not IsNothing(m_RefreshTimer) Then
|
||||||
|
m_RefreshTimer.Start()
|
||||||
|
End If
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
' Disabilito registrazione progetto modificato
|
' Disabilito registrazione progetto modificato
|
||||||
@@ -114,7 +123,7 @@ Public Class SingleCutUC
|
|||||||
m_bPointP1Ok = False
|
m_bPointP1Ok = False
|
||||||
m_bPointP2Ok = False
|
m_bPointP2Ok = False
|
||||||
' Inizializzo primo punto acquisito dal disegno
|
' 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
|
m_ptPrev.z = m_ptRawMax.z
|
||||||
' Disegno crocetta che indica il punto acquisito
|
' Disegno crocetta che indica il punto acquisito
|
||||||
CreateCross(m_nTempLay, m_ptPrev)
|
CreateCross(m_nTempLay, m_ptPrev)
|
||||||
@@ -138,21 +147,40 @@ Public Class SingleCutUC
|
|||||||
' Deseleziono bottone primo punto
|
' Deseleziono bottone primo punto
|
||||||
Point1Btn.IsChecked = False
|
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
|
' Aggiorno visualizzazione
|
||||||
EgtDraw()
|
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
|
End Sub
|
||||||
|
|
||||||
Friend Sub SingleCut_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
Friend Sub SingleCut_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
||||||
' Salvo i dati correnti
|
' Salvo i dati correnti
|
||||||
WritePrivateProfileString( S_DIRECTCUTS, K_DC_SING_DEPTH, DoubleToString( m_dDepth, 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_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_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_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_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_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())
|
WritePrivateProfileString(S_DIRECTCUTS, K_DC_SING_POSY, DoubleToString(m_ptTipP1.y, 2), m_MainWindow.GetIniFile())
|
||||||
' Se non vado in simulazione
|
' Se non vado in simulazione
|
||||||
If Not m_bSimul Then
|
If Not m_bSimul Then
|
||||||
@@ -171,6 +199,8 @@ Public Class SingleCutUC
|
|||||||
EgtSetMachineLook(MCH_LOOK.TAB)
|
EgtSetMachineLook(MCH_LOOK.TAB)
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
End If
|
End If
|
||||||
|
' interrompo il Timer per aggiornare la visualizzazione del posizionamento macchina
|
||||||
|
m_RefreshTimer.Stop()
|
||||||
' Dichiaro pagina non attiva
|
' Dichiaro pagina non attiva
|
||||||
m_bActive = False
|
m_bActive = False
|
||||||
End Sub
|
End Sub
|
||||||
@@ -279,7 +309,7 @@ Public Class SingleCutUC
|
|||||||
DirectionTxBx.Text = DoubleToString(m_dAngO - m_MainWindow.m_CurrentMachine.dDeltaC, 2)
|
DirectionTxBx.Text = DoubleToString(m_dAngO - m_MainWindow.m_CurrentMachine.dDeltaC, 2)
|
||||||
SideAngleTxBx.Text = DoubleToString(m_dAngV, 2)
|
SideAngleTxBx.Text = DoubleToString(m_dAngV, 2)
|
||||||
|
|
||||||
' Altrimenti punto da click di mouse
|
' Altrimenti punto da click di mouse
|
||||||
Else
|
Else
|
||||||
' Assegno punto selezionato nel disegno a m_ptTipP1
|
' Assegno punto selezionato nel disegno a m_ptTipP1
|
||||||
m_ptTipP1 = m_ptPrev
|
m_ptTipP1 = m_ptPrev
|
||||||
@@ -298,6 +328,7 @@ Public Class SingleCutUC
|
|||||||
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = True
|
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = True
|
||||||
EgtSetMachineLook(m_MainWindow.m_DirectCutPageUC.m_nMachLook)
|
EgtSetMachineLook(m_MainWindow.m_DirectCutPageUC.m_nMachLook)
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
|
|
||||||
' Seleziono il bottone per indicare che il primo punto è stato acquisito
|
' Seleziono il bottone per indicare che il primo punto è stato acquisito
|
||||||
Point1Btn.IsChecked = True
|
Point1Btn.IsChecked = True
|
||||||
' Abilito e deseleziono secondo punto
|
' Abilito e deseleziono secondo punto
|
||||||
@@ -358,7 +389,7 @@ Public Class SingleCutUC
|
|||||||
m_dAngV = 90 - dTAngV
|
m_dAngV = 90 - dTAngV
|
||||||
SideAngleTxBx.Text = DoubleToString(m_dAngV, 2)
|
SideAngleTxBx.Text = DoubleToString(m_dAngV, 2)
|
||||||
|
|
||||||
' Altrimenti punto da click di mouse
|
' Altrimenti punto da click di mouse
|
||||||
Else
|
Else
|
||||||
' Assegno punto selezionato nel disegno a m_ptTipP2
|
' Assegno punto selezionato nel disegno a m_ptTipP2
|
||||||
m_ptTipP2 = m_ptPrev
|
m_ptTipP2 = m_ptPrev
|
||||||
@@ -476,7 +507,7 @@ Public Class SingleCutUC
|
|||||||
EgtDraw()
|
EgtDraw()
|
||||||
End Sub
|
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
|
' Recupero lo stato di check
|
||||||
m_bSawTh = SawThChBx.IsChecked()
|
m_bSawTh = SawThChBx.IsChecked()
|
||||||
' Disegno il taglio
|
' Disegno il taglio
|
||||||
@@ -536,9 +567,9 @@ Public Class SingleCutUC
|
|||||||
m_CurrProjPage.SetWarningMessage( "Trial Version")
|
m_CurrProjPage.SetWarningMessage( "Trial Version")
|
||||||
#Else
|
#Else
|
||||||
' Verifico non sia versione Ufficio
|
' Verifico non sia versione Ufficio
|
||||||
If m_MainWindow.GetKeyOption( MainWindow.KEY_OPT.OFFICE_TYPE) Then
|
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.OFFICE_TYPE) Then
|
||||||
m_CurrProjPage.SetWarningMessage( "Office Version")
|
m_CurrProjPage.SetWarningMessage("Office Version")
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
' Verifico ci sia un taglio valido
|
' Verifico ci sia un taglio valido
|
||||||
If Not m_bCutOk Then Return
|
If Not m_bCutOk Then Return
|
||||||
@@ -583,7 +614,7 @@ Public Class SingleCutUC
|
|||||||
Dim sSawing As String = m_MainWindow.m_CurrentMachine.sCurrSawing
|
Dim sSawing As String = m_MainWindow.m_CurrentMachine.sCurrSawing
|
||||||
EgtTdbSetCurrTool(sSaw)
|
EgtTdbSetCurrTool(sSaw)
|
||||||
Dim dThick As Double = 0
|
Dim dThick As Double = 0
|
||||||
' se è impostata una lavorazione di lama
|
' Se è impostata una lavorazione di lama
|
||||||
If Not String.IsNullOrEmpty(sSawing) Then
|
If Not String.IsNullOrEmpty(sSawing) Then
|
||||||
EgtTdbGetCurrToolParam(MCH_TP.THICK, dThick)
|
EgtTdbGetCurrToolParam(MCH_TP.THICK, dThick)
|
||||||
End If
|
End If
|
||||||
@@ -599,14 +630,19 @@ Public Class SingleCutUC
|
|||||||
Dim ptStart As Point3d = m_ptTipP1
|
Dim ptStart As Point3d = m_ptTipP1
|
||||||
ptStart.z = 0
|
ptStart.z = 0
|
||||||
Dim nCutId = EgtCreateLinePDL(nLayerId, ptStart, m_dAngO, m_dLen)
|
Dim nCutId = EgtCreateLinePDL(nLayerId, ptStart, m_dAngO, m_dLen)
|
||||||
If Math.Abs(m_dOffset) > 10 * EPS_SMALL Then
|
' Applico la correzione di spessore lama -> anche se Offset=0! ver_2.5b1
|
||||||
Dim dTotOffset = m_dOffset
|
Dim dTotOffset = m_dOffset
|
||||||
If m_bSawTh Then dTotOffset += If( m_dOffset > 0, dThick, -dThick)
|
If m_bSawTh Then
|
||||||
|
dTotOffset += If(m_dOffset > 0, dThick, -dThick)
|
||||||
|
EgtOffsetCurve(nCutId, dTotOffset, OFF_TYPE.EXTEND)
|
||||||
|
Else
|
||||||
EgtOffsetCurve(nCutId, dTotOffset, OFF_TYPE.EXTEND)
|
EgtOffsetCurve(nCutId, dTotOffset, OFF_TYPE.EXTEND)
|
||||||
End If
|
End If
|
||||||
' Imposto affondamento e angolo di fianco sul taglio
|
' Imposto affondamento e angolo di fianco sul taglio
|
||||||
EgtSetInfo(nCutId, INFO_DEPTH, m_dDepth)
|
EgtSetInfo(nCutId, INFO_DEPTH, m_dDepth)
|
||||||
EgtSetInfo(nCutId, INFO_SIDE_ANGLE, m_dAngV)
|
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
|
' Creo layer per crocetta di riferimento
|
||||||
Dim nCrossLayerId = EgtCreateGroup(nPartId)
|
Dim nCrossLayerId = EgtCreateGroup(nPartId)
|
||||||
' Aggiungo crocetta/e
|
' Aggiungo crocetta/e
|
||||||
|
|||||||
@@ -283,6 +283,19 @@ Public Class DrawPageUC
|
|||||||
m_sCsvOrder = ""
|
m_sCsvOrder = ""
|
||||||
m_sCsvList = ""
|
m_sCsvList = ""
|
||||||
m_sCsvName = ""
|
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
|
End Sub
|
||||||
|
|
||||||
' recupero il click sulla scena ed assegno il metodo a secondo della pagina aperta
|
' recupero il click sulla scena ed assegno il metodo a secondo della pagina aperta
|
||||||
@@ -553,6 +566,7 @@ Public Class DrawPageUC
|
|||||||
OkBtn.IsEnabled = True
|
OkBtn.IsEnabled = True
|
||||||
End Sub
|
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
|
Friend Sub BackBtn_Click(sender As Object, e As RoutedEventArgs) Handles BackBtn.Click
|
||||||
m_SceneButtons.MeasureBtn.IsChecked = False
|
m_SceneButtons.MeasureBtn.IsChecked = False
|
||||||
DrawPage_Unloaded(sender, e)
|
DrawPage_Unloaded(sender, e)
|
||||||
@@ -1124,6 +1138,30 @@ Public Class DrawPageUC
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
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
|
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
||||||
m_bBackFromInternalCompo = False
|
m_bBackFromInternalCompo = False
|
||||||
m_bInternalCompo = False
|
m_bInternalCompo = False
|
||||||
@@ -1139,7 +1177,12 @@ Public Class DrawPageUC
|
|||||||
Dim InsNbr As Integer = Int32.Parse(PartNumTxBx.Text)
|
Dim InsNbr As Integer = Int32.Parse(PartNumTxBx.Text)
|
||||||
' Passo al contesto principale
|
' Passo al contesto principale
|
||||||
'MakeInsert(InsNbr, sPartName)
|
'MakeInsert(InsNbr, sPartName)
|
||||||
MakeMultipleInsert(InsNbr, sPartName)
|
If m_MainWindow.FrameCutBtn.IsChecked Then
|
||||||
|
MakeSectionFrameInsert()
|
||||||
|
Else
|
||||||
|
MakeMultipleInsert(InsNbr, sPartName)
|
||||||
|
End If
|
||||||
|
|
||||||
' Aggiorno ambiente principale
|
' Aggiorno ambiente principale
|
||||||
EgtZoom(ZM.ALL)
|
EgtZoom(ZM.ALL)
|
||||||
' Elimino nome del componente precedente
|
' Elimino nome del componente precedente
|
||||||
@@ -1153,7 +1196,7 @@ Public Class DrawPageUC
|
|||||||
' Istruzioni per chiudere ImportPageUC e aprire CadCutPageUC
|
' Istruzioni per chiudere ImportPageUC e aprire CadCutPageUC
|
||||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
|
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
|
||||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
|
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
|
End Sub
|
||||||
|
|
||||||
@@ -1174,7 +1217,7 @@ Public Class DrawPageUC
|
|||||||
' Istruzioni per chiudere ImportPageUC e aprire CadCutPageUC
|
' Istruzioni per chiudere ImportPageUC e aprire CadCutPageUC
|
||||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
|
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
|
||||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
|
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
|
End Sub
|
||||||
|
|
||||||
Private Sub TrfDataBtn_Click(sender As Object, e As RoutedEventArgs) Handles TrfDataBtn.Click
|
Private Sub TrfDataBtn_Click(sender As Object, e As RoutedEventArgs) Handles TrfDataBtn.Click
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ Public Class MainComponentPageUC
|
|||||||
|
|
||||||
Private Sub Compo_Click(sender As Object, e As RoutedEventArgs) Handles Compo1.Click, Compo2.Click, Compo3.Click, Compo4.Click, Compo5.Click, Compo6.Click, Compo7.Click, Compo8.Click
|
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)
|
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_sCurrCompoFam = CompoName
|
||||||
m_SecondaryComponentPage.m_sCurrCompo = String.Empty
|
m_SecondaryComponentPage.m_sCurrCompo = String.Empty
|
||||||
Dim nCount As Integer = GetPrivateProfileInt(CompoName, K_CMP_COUNT, 0, m_MainWindow.GetIniFile())
|
Dim nCount As Integer = GetPrivateProfileInt(CompoName, K_CMP_COUNT, 0, m_MainWindow.GetIniFile())
|
||||||
@@ -251,13 +251,18 @@ Public Class MainComponentPageUC
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub LoadPage()
|
Private Sub LoadPage()
|
||||||
|
If m_MainWindow.FrameCutBtn.IsChecked Then
|
||||||
|
LoadFramePage()
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
|
||||||
Dim nDeltaSecondPage As Integer = 8
|
Dim nDeltaSecondPage As Integer = 8
|
||||||
' Leggo numero di componenti presenti
|
' Leggo numero di componenti presenti
|
||||||
Dim nCompoNumber As Integer = GetPrivateProfileInt(S_COMPO, K_CMP_COUNT, 0, m_MainWindow.GetIniFile())
|
Dim nCompoNumber As Integer = GetPrivateProfileInt(S_COMPO, K_CMP_COUNT, 0, m_MainWindow.GetIniFile())
|
||||||
' Calcolo indici a seconda della pagina in cui sono
|
' Calcolo indici a seconda della pagina in cui sono
|
||||||
If m_bIsFirstPage Then
|
If m_bIsFirstPage Then
|
||||||
ClearButton(nCompoNumber)
|
ClearButton(nCompoNumber)
|
||||||
nDeltaSecondPage = 0
|
nDeltaSecondPage = 0
|
||||||
Else
|
Else
|
||||||
ClearButton(nCompoNumber)
|
ClearButton(nCompoNumber)
|
||||||
nDeltaSecondPage = 8
|
nDeltaSecondPage = 8
|
||||||
@@ -325,16 +330,86 @@ Public Class MainComponentPageUC
|
|||||||
|
|
||||||
End Sub
|
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
|
' Gestione bottone altri componenti
|
||||||
Private Sub Compo9_Click(sender As Object, e As RoutedEventArgs) Handles Compo9.Click
|
Private Sub Compo9_Click(sender As Object, e As RoutedEventArgs) Handles Compo9.Click
|
||||||
If m_bIsFirstPage Then
|
If m_bIsFirstPage Then
|
||||||
m_bIsFirstPage = False
|
m_bIsFirstPage = False
|
||||||
LoadPage()
|
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.ColumnProperty, 0)
|
||||||
Compo9.SetValue(Grid.ColumnSpanProperty, 2)
|
Compo9.SetValue(Grid.ColumnSpanProperty, 2)
|
||||||
ImageCompo9.Visibility = Windows.Visibility.Hidden
|
ImageCompo9.Visibility = Windows.Visibility.Hidden
|
||||||
|
|||||||
+106
-98
@@ -7,124 +7,132 @@
|
|||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="853.3" d:DesignWidth="1280">
|
d:DesignHeight="853.3" d:DesignWidth="1280">
|
||||||
|
|
||||||
<!-- Definizione della FrameCutPage -->
|
<!-- Definizione della FrameCutPage -->
|
||||||
<Grid Name="FrameCutPageGrid" >
|
<Grid Name="FrameCutPageGrid" >
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="3*"/>
|
<ColumnDefinition Width="3*"/>
|
||||||
<ColumnDefinition Width="12*"/>
|
<ColumnDefinition Width="12*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Grid.RowDefinitions>
|
<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>
|
|
||||||
<RowDefinition Height="1*"/>
|
<RowDefinition Height="1*"/>
|
||||||
<RowDefinition Height="7*"/>
|
<RowDefinition Height="8*"/>
|
||||||
</Grid.RowDefinitions>
|
<RowDefinition Height="1*"/>
|
||||||
|
</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>
|
|
||||||
|
|
||||||
<ComboBox Name="AlongAxCmBx" Grid.Row="0" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_ComboBox}"
|
<!-- Definizione della Grid superiore -->
|
||||||
Width="200" MaxDropDownHeight="300">
|
<Grid Grid.Column="1" Grid.Row="0" >
|
||||||
<ComboBox.ItemTemplate>
|
<Grid.ColumnDefinitions>
|
||||||
<DataTemplate>
|
<ColumnDefinition Width="1*"/>
|
||||||
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
</DataTemplate>
|
<ColumnDefinition Width="1*"/>
|
||||||
</ComboBox.ItemTemplate>
|
<ColumnDefinition Width="1*"/>
|
||||||
</ComboBox>
|
<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="PhotoBtn" Grid.Column="0" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
|
||||||
<Button Name="SelSectionBtn"
|
<Image Source="{DynamicResource PhotoImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||||
Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
|
|
||||||
<Image Source="{DynamicResource Sezione-corniceImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
|
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button Name="RawPartBtn" Grid.Column="1" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
|
||||||
<Grid>
|
<Image Source="{DynamicResource RawPartImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||||
<Button Name="SelGuideBtn"
|
</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}"/>
|
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||||
<UniformGrid Name="ArcGrid" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" >
|
<UniformGrid Name="ArcGrid" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" >
|
||||||
<TextBlock Name="ArcRadTxBl" Grid.Row="2" Grid.ColumnSpan="2"
|
<TextBlock Name="ArcRadTxBl" Grid.Row="2" Grid.ColumnSpan="2"
|
||||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
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}"/>
|
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}"/>
|
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}"/>
|
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||||
</UniformGrid>
|
</UniformGrid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</UniformGrid>
|
</UniformGrid>
|
||||||
|
|
||||||
<TextBlock Name="OffsZTxBl" Grid.Row="2" Grid.ColumnSpan="2"
|
<TextBlock Name="OffsZTxBl" Grid.Row="2" Grid.ColumnSpan="2"
|
||||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
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}"/>
|
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}"/>
|
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}"/>
|
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}"/>
|
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}"/>
|
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
<UniformGrid Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="2" >
|
<UniformGrid Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="2" >
|
||||||
<Button Name="MirrorPartBtn"
|
<Button Name="MirrorPartBtn"
|
||||||
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
|
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
|
||||||
<Image Source="{DynamicResource SpecchiaImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
|
<Image Source="{DynamicResource SpecchiaImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Name="RemovePartBtn"
|
<Button Name="RemovePartBtn"
|
||||||
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
|
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
|
||||||
<Image Source="{DynamicResource Rimuovi_eliminaImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
|
<Image Source="{DynamicResource Rimuovi_eliminaImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
|
||||||
</Button>
|
</Button>
|
||||||
</UniformGrid>
|
</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}"/>
|
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||||
|
|
||||||
<ComboBox Name="SawRoughingCmBx" Grid.Row="5" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_ComboBox}"
|
<ComboBox Name="SawRoughingCmBx" Grid.Row="5" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_ComboBox}"
|
||||||
@@ -182,10 +190,10 @@
|
|||||||
</ComboBox.ItemTemplate>
|
</ComboBox.ItemTemplate>
|
||||||
</ComboBox>-->
|
</ComboBox>-->
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -81,6 +81,8 @@ Public Class FrameCutPageUC
|
|||||||
m_ProjectMgr.CSVBtn.Visibility = Windows.Visibility.Hidden
|
m_ProjectMgr.CSVBtn.Visibility = Windows.Visibility.Hidden
|
||||||
m_ProjectMgr.VeinMatchingBtn.Visibility = Windows.Visibility.Hidden
|
m_ProjectMgr.VeinMatchingBtn.Visibility = Windows.Visibility.Hidden
|
||||||
m_ProjectMgr.RegisterBtn.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
|
' Recupero dimensioni e kerf del grezzo
|
||||||
m_nRawId = EgtGetFirstRawPart()
|
m_nRawId = EgtGetFirstRawPart()
|
||||||
GetRawBox(m_RawBox)
|
GetRawBox(m_RawBox)
|
||||||
@@ -436,6 +438,16 @@ Public Class FrameCutPageUC
|
|||||||
End If
|
End If
|
||||||
End Sub
|
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
|
Friend Function CreateFrame(nPartId As Integer) As Boolean
|
||||||
If Not MyCreateFrame( nPartId) Then
|
If Not MyCreateFrame( nPartId) Then
|
||||||
EgtErase( nPartId)
|
EgtErase( nPartId)
|
||||||
|
|||||||
@@ -1163,6 +1163,10 @@ Public Class AlarmsPageUC
|
|||||||
Case 3
|
Case 3
|
||||||
Dim nResult As Short = m_CN.DGeneralFunctions_WriteCncMode(0)
|
Dim nResult As Short = m_CN.DGeneralFunctions_WriteCncMode(0)
|
||||||
EgtOutLog("Impostata modalità automatica: esito " & nResult.ToString)
|
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
|
End Select
|
||||||
' Recupero file LUA
|
' Recupero file LUA
|
||||||
EgtLuaExecFile(m_CurrentMachine.sMachDir() & "\DirectCmd\SawProbing.lua")
|
EgtLuaExecFile(m_CurrentMachine.sMachDir() & "\DirectCmd\SawProbing.lua")
|
||||||
@@ -1185,6 +1189,12 @@ Public Class AlarmsPageUC
|
|||||||
EgtLuaSetGlobNumVar("CMD.THICK", dToolThick * 1000)
|
EgtLuaSetGlobNumVar("CMD.THICK", dToolThick * 1000)
|
||||||
EgtTdbGetCurrToolParam(MCH_TP.LEN, dToolLen)
|
EgtTdbGetCurrToolParam(MCH_TP.LEN, dToolLen)
|
||||||
EgtLuaSetGlobNumVar("CMD.LENGTH", dToolLen * 1000)
|
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())
|
EgtLuaSetGlobBoolVar("CMD.INCHES", m_MainWindow.m_CNCommunication.GetMachineInInches())
|
||||||
EgtLuaCallFunction("CMD.CmdString")
|
EgtLuaCallFunction("CMD.CmdString")
|
||||||
' Leggo variabili
|
' Leggo variabili
|
||||||
@@ -1228,6 +1238,11 @@ Public Class AlarmsPageUC
|
|||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
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
|
' Aspetto e lo avvio
|
||||||
System.Threading.Thread.Sleep(300)
|
System.Threading.Thread.Sleep(300)
|
||||||
m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_CycleStart()
|
m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_CycleStart()
|
||||||
@@ -1277,6 +1292,10 @@ Public Class AlarmsPageUC
|
|||||||
Dim bRead As Boolean = False
|
Dim bRead As Boolean = False
|
||||||
Dim SawDiameterNameVar As String = String.Empty
|
Dim SawDiameterNameVar As String = String.Empty
|
||||||
GetPrivateProfileString(S_MACH_PROBING, K_SAWDIAMETER, "", SawDiameterNameVar, m_MainWindow.GetMachIniFile())
|
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
|
m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 0
|
||||||
For I As Integer = 0 To 20
|
For I As Integer = 0 To 20
|
||||||
' Devo rileggere la variabile ad ogni ciclo
|
' 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
|
If m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 3 Then
|
||||||
bRead = True
|
bRead = True
|
||||||
Dim dVal As Double = m_MainWindow.m_CNCommunication.m_CN.d_DReadELS_value
|
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
|
MsgBoxStateInfo.LoadingPrBr_Value = 100
|
||||||
' Tastatura conclusa con successo
|
' Tastatura conclusa con successo
|
||||||
Dim sOut As String = EgtMsg(MSG_DIRECTCUTPAGEUC + 43) & " : " & DoubleToString(dVal, 1)
|
Dim sOut As String = EgtMsg(MSG_DIRECTCUTPAGEUC + 43) & " : " & DoubleToString(dVal, 1)
|
||||||
|
|||||||
@@ -77,6 +77,9 @@ Public Class CurrentMachine
|
|||||||
Private m_bPolishingWheel As Boolean = False
|
Private m_bPolishingWheel As Boolean = False
|
||||||
Private m_bWaterJet 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
|
' Abilitazione DB WaterJet
|
||||||
Private m_bFromDBWaterJet As Boolean = False
|
Private m_bFromDBWaterJet As Boolean = False
|
||||||
|
|
||||||
@@ -752,6 +755,12 @@ Public Class CurrentMachine
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Friend ReadOnly Property bEnableInvert As Boolean
|
||||||
|
Get
|
||||||
|
Return m_bEnableInvetrt
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
Friend Property dAdditionalTable As Double
|
Friend Property dAdditionalTable As Double
|
||||||
Get
|
Get
|
||||||
Select Case GetCurrentTable()
|
Select Case GetCurrentTable()
|
||||||
@@ -1200,6 +1209,8 @@ Public Class CurrentMachine
|
|||||||
m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.ENABLE_WJ)
|
m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.ENABLE_WJ)
|
||||||
' possibilità di definire attacco speciale per materiali ceramici
|
' possibilità di definire attacco speciale per materiali ceramici
|
||||||
m_bSawingSpecialLeadIn = (GetPrivateProfileInt(S_MACHININGS, K_SAWINGSPECIALLEADIN, 0, sMachIniFile) > 0)
|
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
|
' Leggo utensili correnti
|
||||||
' lama
|
' lama
|
||||||
@@ -1351,6 +1362,29 @@ Public Class CurrentMachine
|
|||||||
m_nEnableBarCodeReader = GetPrivateProfileInt(S_MACH_BARCODEREADER, K_ENABLEBCR, 0, sMachIniFile)
|
m_nEnableBarCodeReader = GetPrivateProfileInt(S_MACH_BARCODEREADER, K_ENABLEBCR, 0, sMachIniFile)
|
||||||
End Sub
|
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)
|
Public Sub LoadWJMaterial(Optional bIsStart As Boolean = False)
|
||||||
Dim TempCurrMat As Material = CurrMat
|
Dim TempCurrMat As Material = CurrMat
|
||||||
' Svuoto l'attuale lista di materiali
|
' Svuoto l'attuale lista di materiali
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
<ColumnDefinition Width="2*"/>
|
<ColumnDefinition Width="2*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<Button Name="StartBtn" Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
<Button Name="StartBtn" Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||||
<Button Name="StopBtn" Grid.Column="1"
|
<Button Name="StopBtn" Grid.Column="1"
|
||||||
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||||
<Button Name="ResetBtn" Grid.Column="2"
|
<Button Name="ResetBtn" Grid.Column="2"
|
||||||
|
|||||||
@@ -248,16 +248,16 @@ Public Class MachineStatusUC
|
|||||||
dL3 = ptTip.z
|
dL3 = ptTip.z
|
||||||
End If
|
End If
|
||||||
' Visualizzazione
|
' Visualizzazione
|
||||||
Axis1TxBx.Text = LenToString(dL1, -3)
|
Axis1TxBx.Text = LenToString(dL1, -3, True)
|
||||||
Axis2TxBx.Text = LenToString(dL2, -3)
|
Axis2TxBx.Text = LenToString(dL2, -3, True)
|
||||||
Axis3TxBx.Text = LenToString(dL3, -3)
|
Axis3TxBx.Text = LenToString(dL3, -3, True)
|
||||||
Axis4TxBx.Text = DoubleToString(dR1, -3)
|
Axis4TxBx.Text = DoubleToString(dR1, -3)
|
||||||
Axis5TxBx.Text = DoubleToString(dR2, -3)
|
Axis5TxBx.Text = DoubleToString(dR2, -3)
|
||||||
If m_AxesNumber >= 6 Then Axis6TxBx.Text = DoubleToString(dA6, -3)
|
If m_AxesNumber >= 6 Then Axis6TxBx.Text = DoubleToString(dA6, -3)
|
||||||
If m_AxesNumber >= 7 Then Axis7TxBx.Text = LenToString(dA7, -3)
|
If m_AxesNumber >= 7 Then Axis7TxBx.Text = LenToString(dA7, -3, True)
|
||||||
If m_AxesNumber >= 8 Then Axis8TxBx.Text = LenToString(dA8, -3)
|
If m_AxesNumber >= 8 Then Axis8TxBx.Text = LenToString(dA8, -3, True)
|
||||||
If m_AxesNumber >= 9 Then Axis9TxBx.Text = LenToString(dA9, -3)
|
If m_AxesNumber >= 9 Then Axis9TxBx.Text = LenToString(dA9, -3, True)
|
||||||
If m_AxesNumber >= 10 Then Axis10TxBx.Text = LenToString(dA10, -3)
|
If m_AxesNumber >= 10 Then Axis10TxBx.Text = LenToString(dA10, -3, True)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub DisplayPositionDelta()
|
Sub DisplayPositionDelta()
|
||||||
@@ -265,22 +265,22 @@ Public Class MachineStatusUC
|
|||||||
Dim dL1, dL2, dL3, dR1, dR2, dA6, dA7, dA8, dA9, dA10 As Double
|
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)
|
m_MainWindow.m_CNCommunication.GetAxesDeltas(dL1, dL2, dL3, dR1, dR2, dA6, dA7, dA8, dA9, dA10)
|
||||||
' Visualizzazione
|
' Visualizzazione
|
||||||
DeltaAxis1TxBx.Text = LenToString(dL1, -3)
|
DeltaAxis1TxBx.Text = LenToString(dL1, -3, True)
|
||||||
DeltaAxis2TxBx.Text = LenToString(dL2, -3)
|
DeltaAxis2TxBx.Text = LenToString(dL2, -3, True)
|
||||||
DeltaAxis3TxBx.Text = LenToString(dL3, -3)
|
DeltaAxis3TxBx.Text = LenToString(dL3, -3, True)
|
||||||
DeltaAxis4TxBx.Text = DoubleToString(dR1, -3)
|
DeltaAxis4TxBx.Text = DoubleToString(dR1, -3)
|
||||||
DeltaAxis5TxBx.Text = DoubleToString(dR2, -3)
|
DeltaAxis5TxBx.Text = DoubleToString(dR2, -3)
|
||||||
If m_AxesNumber >= 6 Then DeltaAxis6TxBx.Text = DoubleToString(dA6, -3)
|
If m_AxesNumber >= 6 Then DeltaAxis6TxBx.Text = DoubleToString(dA6, -3)
|
||||||
If m_AxesNumber >= 7 Then DeltaAxis7TxBx.Text = LenToString(dA7, -3)
|
If m_AxesNumber >= 7 Then DeltaAxis7TxBx.Text = LenToString(dA7, -3, True)
|
||||||
If m_AxesNumber >= 8 Then DeltaAxis8TxBx.Text = LenToString(dA8, -3)
|
If m_AxesNumber >= 8 Then DeltaAxis8TxBx.Text = LenToString(dA8, -3, True)
|
||||||
If m_AxesNumber >= 9 Then DeltaAxis9TxBx.Text = LenToString(dA9, -3)
|
If m_AxesNumber >= 9 Then DeltaAxis9TxBx.Text = LenToString(dA9, -3, True)
|
||||||
If m_AxesNumber >= 10 Then DeltaAxis10TxBx.Text = LenToString(dA10, -3)
|
If m_AxesNumber >= 10 Then DeltaAxis10TxBx.Text = LenToString(dA10, -3, True)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub DisplayFeed()
|
Sub DisplayFeed()
|
||||||
Dim dRealFeed As Double = m_CN.d_DInterpo_Prog_Feed * m_CN.d_DInterpo_Feed_override / 100
|
Dim dRealFeed As Double = m_CN.d_DInterpo_Prog_Feed * m_CN.d_DInterpo_Feed_override / 100
|
||||||
'Feed = DoubleToString(dRealFeed, 0)
|
'Feed = DoubleToString(dRealFeed, 0)
|
||||||
FeedTxBx.Text = LenToString(dRealFeed, 0)
|
FeedTxBx.Text = LenToString(dRealFeed, 0, True)
|
||||||
'FeedOverride = DoubleToString(m_CN.d_DInterpo_Feed_override, 0) & "%"
|
'FeedOverride = DoubleToString(m_CN.d_DInterpo_Feed_override, 0) & "%"
|
||||||
Dim dFeedOverride As Double = m_CN.d_DInterpo_Feed_override
|
Dim dFeedOverride As Double = m_CN.d_DInterpo_Feed_override
|
||||||
FeedOverrideTxBx.Text = DoubleToString(dFeedOverride, 0) & "%"
|
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
|
If m_MainWindow.m_CNCommunication.m_nNCType = 3 AndAlso m_MainWindow.m_CNCommunication.m_CN.m_IsSiemensOne Then
|
||||||
dSpindlePower = m_CN.d_data(0)
|
dSpindlePower = m_CN.d_data(0)
|
||||||
dSpindleOvr = m_CN.d_data(1)
|
dSpindleOvr = m_CN.d_data(1)
|
||||||
|
ElseIf m_MainWindow.m_CNCommunication.m_nNCType = 4 Then
|
||||||
|
dSpindlePower = m_CN.d_spindle_power / 1000
|
||||||
Else
|
Else
|
||||||
dSpindlePower = m_CN.d_spindle_power
|
dSpindlePower = m_CN.d_spindle_power
|
||||||
dSpindleOvr = If(m_CN.bPowerOvr > 0, m_CN.d_spindle_power / m_CN.bPowerOvr * 100, 0)
|
dSpindleOvr = If(m_CN.bPowerOvr > 0, m_CN.d_spindle_power / m_CN.bPowerOvr * 100, 0)
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<!-- Definizione del ToolHolderUc -->
|
<!-- Definizione del ToolHolderUc -->
|
||||||
<Grid>
|
<Grid>
|
||||||
<Image Source="/Resources/ToolChangerPos.png"/>
|
<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>
|
<ToggleButton.Template>
|
||||||
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
||||||
<Grid>
|
<Grid>
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
</ToggleButton.Template>
|
</ToggleButton.Template>
|
||||||
</ToggleButton>
|
</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>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
+17
-2
@@ -38,6 +38,8 @@ Class MainWindow
|
|||||||
Friend m_MachinePageUC As MachinePageUC
|
Friend m_MachinePageUC As MachinePageUC
|
||||||
Friend m_OptionsPageUC As OptionsPageUC
|
Friend m_OptionsPageUC As OptionsPageUC
|
||||||
|
|
||||||
|
Friend m_IsClosingApplication As Integer = 0
|
||||||
|
|
||||||
' Dichiarazione variabili direttori
|
' Dichiarazione variabili direttori
|
||||||
Private m_sExeRoot As String = String.Empty
|
Private m_sExeRoot As String = String.Empty
|
||||||
Private m_sDataRoot As String = String.Empty
|
Private m_sDataRoot As String = String.Empty
|
||||||
@@ -326,8 +328,8 @@ Class MainWindow
|
|||||||
' Verifico abilitazione nesting automatico
|
' Verifico abilitazione nesting automatico
|
||||||
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
|
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
|
||||||
' Recupero opzioni della chiave
|
' Recupero opzioni della chiave
|
||||||
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2501, 1, m_nKeyLevel) And
|
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2505, 1, m_nKeyLevel) And
|
||||||
EgtGetKeyOptions(9423, 2501, 1, m_nKeyOptions)
|
EgtGetKeyOptions(9423, 2505, 1, m_nKeyOptions)
|
||||||
' Verifico abilitazione prodotto
|
' Verifico abilitazione prodotto
|
||||||
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
|
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
|
||||||
' Inizializzazione generale di EgtInterface
|
' Inizializzazione generale di EgtInterface
|
||||||
@@ -1085,6 +1087,19 @@ Class MainWindow
|
|||||||
m_CurrentProjectPageUC.SaveNamedProject()
|
m_CurrentProjectPageUC.SaveNamedProject()
|
||||||
m_CurrentProjectPageUC.SaveProject()
|
m_CurrentProjectPageUC.SaveProject()
|
||||||
End If
|
End If
|
||||||
|
' Inizio la chiusura del programma (verifico di aver terminato il processo DripFeed)
|
||||||
|
EgtOutLog("Iniziato processo di chiusura programma")
|
||||||
|
m_IsClosingApplication = 1
|
||||||
|
Dim nCount As Integer = 0
|
||||||
|
While m_IsClosingApplication <> 2
|
||||||
|
If nCount > 5 Then
|
||||||
|
Exit While
|
||||||
|
End If
|
||||||
|
' verifico che il processo DripFeed sia terminato
|
||||||
|
EgtOutLog("Stato chiusura programma: " & m_IsClosingApplication.ToString)
|
||||||
|
Thread.Sleep(100)
|
||||||
|
nCount += 1
|
||||||
|
End While
|
||||||
' Uscita
|
' Uscita
|
||||||
MainWindowExit()
|
MainWindowExit()
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
@@ -62,5 +62,5 @@ Imports System.Windows
|
|||||||
' by using the '*' as shown below:
|
' by using the '*' as shown below:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("2.5.1.2")>
|
<Assembly: AssemblyVersion("2.5.5.1")>
|
||||||
<Assembly: AssemblyFileVersion("2.5.1.2")>
|
<Assembly: AssemblyFileVersion("2.5.5.1")>
|
||||||
|
|||||||
+299
-9
@@ -2,6 +2,8 @@
|
|||||||
Imports System.Globalization
|
Imports System.Globalization
|
||||||
Imports System.Collections.ObjectModel
|
Imports System.Collections.ObjectModel
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
|
Imports System.IO
|
||||||
|
Imports System.Text
|
||||||
|
|
||||||
Public Class CNCommunication
|
Public Class CNCommunication
|
||||||
|
|
||||||
@@ -31,6 +33,7 @@ Public Class CNCommunication
|
|||||||
Private m_bNewDeltaData As Boolean = True
|
Private m_bNewDeltaData As Boolean = True
|
||||||
Private m_bNewVarData As Boolean = False
|
Private m_bNewVarData As Boolean = False
|
||||||
Private m_bTimerBusy As Boolean = False
|
Private m_bTimerBusy As Boolean = False
|
||||||
|
Private m_bTimerAxesBusy As Boolean = False
|
||||||
|
|
||||||
Private m_IsNewConsole As Boolean = False
|
Private m_IsNewConsole As Boolean = False
|
||||||
|
|
||||||
@@ -39,6 +42,7 @@ Public Class CNCommunication
|
|||||||
|
|
||||||
' Timer
|
' Timer
|
||||||
Private m_RefreshTimer As New DispatcherTimer
|
Private m_RefreshTimer As New DispatcherTimer
|
||||||
|
Private m_RefreshAxesFanuc As New DispatcherTimer
|
||||||
|
|
||||||
' Nomi e indici degli assi macchina
|
' Nomi e indici degli assi macchina
|
||||||
Private m_bAxesOk As Boolean = False
|
Private m_bAxesOk As Boolean = False
|
||||||
@@ -101,6 +105,12 @@ Public Class CNCommunication
|
|||||||
m_RefreshTimer.Interval = TimeSpan.FromMilliseconds(100)
|
m_RefreshTimer.Interval = TimeSpan.FromMilliseconds(100)
|
||||||
m_RefreshTimer.Start()
|
m_RefreshTimer.Start()
|
||||||
End If
|
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
|
' Leggo dati sugli assi della macchina
|
||||||
ReadAxesData()
|
ReadAxesData()
|
||||||
@@ -117,6 +127,8 @@ Public Class CNCommunication
|
|||||||
|
|
||||||
If m_nNCType = 3 Then
|
If m_nNCType = 3 Then
|
||||||
RefreshNoEvents()
|
RefreshNoEvents()
|
||||||
|
ElseIf m_nNCType = 4 Then
|
||||||
|
RefreshFANUC()
|
||||||
Else
|
Else
|
||||||
Refresh()
|
Refresh()
|
||||||
End If
|
End If
|
||||||
@@ -129,8 +141,22 @@ Public Class CNCommunication
|
|||||||
|
|
||||||
End Sub
|
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()
|
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
|
m_bAxesOk = True
|
||||||
GetPrivateProfileString(S_AXES, K_L1NAME, "X", m_sA1, m_MainWindow.GetMachIniFile())
|
GetPrivateProfileString(S_AXES, K_L1NAME, "X", m_sA1, m_MainWindow.GetMachIniFile())
|
||||||
m_nA1 = GetPrivateProfileInt(S_AXES, K_L1ID, 0, m_MainWindow.GetMachIniFile())
|
m_nA1 = GetPrivateProfileInt(S_AXES, K_L1ID, 0, m_MainWindow.GetMachIniFile())
|
||||||
@@ -222,6 +248,11 @@ Public Class CNCommunication
|
|||||||
m_CN = New Num.NumNC
|
m_CN = New Num.NumNC
|
||||||
Case 3
|
Case 3
|
||||||
m_CN = New CN_Siemens
|
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
|
End Select
|
||||||
' Recupero la stringa di inizializzazione della comunicazione
|
' Recupero la stringa di inizializzazione della comunicazione
|
||||||
|
|
||||||
@@ -354,8 +385,13 @@ Public Class CNCommunication
|
|||||||
If Not String.IsNullOrEmpty(sVal) Then m_CN.SetCnDataVar(CN_generico.CnData.Remote, sVal)
|
If Not String.IsNullOrEmpty(sVal) Then m_CN.SetCnDataVar(CN_generico.CnData.Remote, sVal)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' Inizializzo la comunicazione
|
' Solo per controllo FANUNC
|
||||||
m_CN.Init()
|
GetPrivateProfileString(S_NCDATA, K_NAXES, "", sVal, m_MainWindow.GetMachIniFile())
|
||||||
|
m_CN.SetCnDataVar(CN_generico.CnData.nAxes, sVal)
|
||||||
|
|
||||||
|
|
||||||
|
' Inizializzo la comunicazione
|
||||||
|
m_CN.Init()
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
' set status to statusbar
|
' set status to statusbar
|
||||||
@@ -418,6 +454,17 @@ Public Class CNCommunication
|
|||||||
m_MachineStatus.MachineStatusGrid.Background = Application.Current.FindResource("OmagCut_Red")
|
m_MachineStatus.MachineStatusGrid.Background = Application.Current.FindResource("OmagCut_Red")
|
||||||
End Try
|
End Try
|
||||||
End If
|
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
|
End Select
|
||||||
|
|
||||||
' Assegno riferimento al CN alle diverse pagine
|
' Assegno riferimento al CN alle diverse pagine
|
||||||
@@ -464,6 +511,7 @@ Public Class CNCommunication
|
|||||||
m_MachineStatus.DisplayPositionDelta()
|
m_MachineStatus.DisplayPositionDelta()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
' ----- INIZIO: lettura diretta di specifiche vaiabili -----
|
||||||
If m_CN.b_feed_changed Then
|
If m_CN.b_feed_changed Then
|
||||||
m_CN.b_feed_changed = False
|
m_CN.b_feed_changed = False
|
||||||
m_MachineStatus.DisplayFeed()
|
m_MachineStatus.DisplayFeed()
|
||||||
@@ -490,12 +538,14 @@ Public Class CNCommunication
|
|||||||
'FrmMain.LblToolRad.Text = cn.Tools(0).radius.ToString
|
'FrmMain.LblToolRad.Text = cn.Tools(0).radius.ToString
|
||||||
'FrmMain.LblToolComp.Text = cn.Tools(0).comp_num.ToString
|
'FrmMain.LblToolComp.Text = cn.Tools(0).comp_num.ToString
|
||||||
End If
|
End If
|
||||||
|
' ----- FINE : lettura diretta di specifiche vaiabili -----
|
||||||
|
|
||||||
Select Case m_nNCType
|
Select Case m_nNCType
|
||||||
Case 1
|
Case 1
|
||||||
If m_CN.read_active_mode() <> m_nCurrMode Then
|
If m_CN.read_active_mode() <> m_nCurrMode Then
|
||||||
m_nCurrMode = m_CN.read_active_mode()
|
m_nCurrMode = m_CN.read_active_mode()
|
||||||
m_MachineStatus.DisplayActiveMode(m_nCurrMode)
|
m_MachineStatus.DisplayActiveMode(m_nCurrMode)
|
||||||
|
m_CN.nMachineMode = m_nCurrMode
|
||||||
End If
|
End If
|
||||||
Case 2
|
Case 2
|
||||||
If m_CN.nMachineMode <> m_nCurrMode Then
|
If m_CN.nMachineMode <> m_nCurrMode Then
|
||||||
@@ -530,6 +580,7 @@ Public Class CNCommunication
|
|||||||
'End If
|
'End If
|
||||||
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
|
' 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_ActivePage = MainWindow.Pages.DirectCut Then
|
||||||
If m_MainWindow.m_DirectCutPageUC.m_NewMachineButtonsType Then
|
If m_MainWindow.m_DirectCutPageUC.m_NewMachineButtonsType Then
|
||||||
@@ -568,8 +619,14 @@ Public Class CNCommunication
|
|||||||
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.CloseAllChanged(m_CN.bCloseAllState)
|
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.Open123Changed(m_CN.bOpen123State)
|
||||||
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Open456Changed(m_CN.bOpen456State)
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Open456Changed(m_CN.bOpen456State)
|
||||||
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Close123Changed(m_CN.bClose123State)
|
' in assenza della configurazione delle variabili Close123 e Close456
|
||||||
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Close456Changed(m_CN.bClose456State)
|
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.BlowChanged(m_CN.bBlowState)
|
||||||
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.VacuumOnChanged(m_CN.bVacuumOn)
|
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.VacuumOffChanged(m_CN.bVacuumOff)
|
||||||
@@ -619,12 +676,189 @@ Public Class CNCommunication
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
' Nuove bottoni (Power Macchina)
|
' Nuove bottoni (Power Macchina)
|
||||||
If m_IsNewConsole AndAlso m_MainWindow.m_ActivePage = MainWindow.Pages.Machine Then
|
If m_MainWindow.m_ActivePage = MainWindow.Pages.Machine Then
|
||||||
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.PowerONChanged(m_CN.bPowerON)
|
If m_IsNewConsole Then
|
||||||
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.PowerOFFChanged(Not m_CN.bPowerON)
|
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)
|
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.CncModeChange(m_CN.nMachineMode)
|
||||||
End If
|
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)
|
||||||
|
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
|
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.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.CoolantStateChanged(m_CN.bCoolantState OrElse m_CN.bInternalCoolantState OrElse m_CN.bExternCoolantState)
|
||||||
@@ -907,28 +1141,84 @@ Public Class CNCommunication
|
|||||||
End If
|
End If
|
||||||
' Se richiesta successiva attivazione, faccio reset
|
' Se richiesta successiva attivazione, faccio reset
|
||||||
If bActivate Then
|
If bActivate Then
|
||||||
|
EgtOutLog("Call function: DGeneralFunctions_Reset")
|
||||||
|
TimeSpanInit()
|
||||||
m_CN.DGeneralFunctions_Reset()
|
m_CN.DGeneralFunctions_Reset()
|
||||||
|
EgtOutLog(TimeSpanEnd())
|
||||||
End If
|
End If
|
||||||
' Attesa opportuna
|
' Attesa opportuna
|
||||||
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nResetSendDelay)
|
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nResetSendDelay)
|
||||||
If m_nNCType = 1 Then
|
If m_nNCType = 1 Then
|
||||||
' Cancellazione eventuale file già presente con lo stesso nome (ignoro eventuale errore)
|
' Cancellazione eventuale file già presente con lo stesso nome (ignoro eventuale errore)
|
||||||
|
EgtOutLog("Delete_NC_prog(sNumProg)")
|
||||||
|
TimeSpanInit()
|
||||||
m_CN.Delete_NC_prog(sNumProg)
|
m_CN.Delete_NC_prog(sNumProg)
|
||||||
|
EgtOutLog(TimeSpanEnd())
|
||||||
' Attesa opportuna
|
' Attesa opportuna
|
||||||
System.Threading.Thread.Sleep(100)
|
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
|
End If
|
||||||
|
EgtOutLog("Download_NC_prog(sCncPath, sNumProg)")
|
||||||
|
' -------------- START DOWNLOAD --------------
|
||||||
|
TimeSpanInit()
|
||||||
bOk = bOk AndAlso (m_CN.Download_NC_prog(sCncPath, sNumProg) = 0)
|
bOk = bOk AndAlso (m_CN.Download_NC_prog(sCncPath, sNumProg) = 0)
|
||||||
' Attesa opportuna
|
' Attesa opportuna
|
||||||
System.Threading.Thread.Sleep(100)
|
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)
|
||||||
|
' 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())
|
||||||
|
' -------------- END DOWNLOAD --------------
|
||||||
|
' -------------- START ACTIVATE --------------
|
||||||
' Se richiesta attivazione
|
' Se richiesta attivazione
|
||||||
If bActivate Then
|
If bActivate Then
|
||||||
' Attivazione programma
|
' Attivazione programma
|
||||||
|
EgtOutLog("ActivateProgram(nNumProg)")
|
||||||
|
TimeSpanInit()
|
||||||
bOk = bOk AndAlso (m_CN.ActivateProgram(nNumProg) = 0)
|
bOk = bOk AndAlso (m_CN.ActivateProgram(nNumProg) = 0)
|
||||||
|
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
|
' Attesa opportuna
|
||||||
System.Threading.Thread.Sleep(100)
|
System.Threading.Thread.Sleep(100)
|
||||||
' Modalità automatica
|
' Modalità automatica
|
||||||
bOk = bOk AndAlso (m_CN.DGeneralFunctions_WriteCncMode(0) = 0)
|
EgtOutLog("DGeneralFunctions_WriteCncMode(0)")
|
||||||
|
TimeSpanInit()
|
||||||
|
EgtOutLog(TimeSpanEnd())
|
||||||
End If
|
End If
|
||||||
|
' -------------- END ACTIVATE --------------
|
||||||
' Messaggio con risultato
|
' Messaggio con risultato
|
||||||
If bOk Then
|
If bOk Then
|
||||||
m_CurrProjPage.SetInfoMessage(EgtMsg(90317)) 'Programma CN trasmesso con successo
|
m_CurrProjPage.SetInfoMessage(EgtMsg(90317)) 'Programma CN trasmesso con successo
|
||||||
|
|||||||
+63
-4
@@ -8,7 +8,7 @@ Public MustInherit Class CN_generico
|
|||||||
Public Const MAX_VAR As Short = 100
|
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_VALUES As Short = 9 ' Max. index to read the data from the FXServer array
|
||||||
Public Const MAX_TOOLS As Short = 100
|
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
|
Public m_NewVariable As Boolean = False ' per scrittura delle vairbaili Apllication del PLC
|
||||||
|
|
||||||
@@ -70,8 +70,18 @@ Public MustInherit Class CN_generico
|
|||||||
Parking = 52
|
Parking = 52
|
||||||
EnableZone = 53
|
EnableZone = 53
|
||||||
EnablePC = 54
|
EnablePC = 54
|
||||||
|
|
||||||
|
nAxes = 55
|
||||||
End Enum
|
End Enum
|
||||||
|
|
||||||
|
Public Enum Type As Short
|
||||||
|
TBoolean = 0
|
||||||
|
TInteger = 1
|
||||||
|
TLong = 2
|
||||||
|
TDouble = 3
|
||||||
|
TString = 4
|
||||||
|
|
||||||
|
End Enum
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region " Struct"
|
#Region " Struct"
|
||||||
@@ -218,10 +228,27 @@ Public MustInherit Class CN_generico
|
|||||||
Public bRemote As Boolean
|
Public bRemote As Boolean
|
||||||
' Nuovi di bottoni -------------------------------------------
|
' 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 nMachineMode As Integer
|
||||||
|
|
||||||
Public m_szCnDataVar(NUM_DATA - 1) As String
|
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 NewPositionData(ByVal sender As Object)
|
||||||
Public Event NewPosDeltaData(ByVal sender As Object)
|
Public Event NewPosDeltaData(ByVal sender As Object)
|
||||||
Public Event NewVarChanged(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_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, _
|
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, _
|
DLength_X As Double, DTipRadius_Z As Double,
|
||||||
nDirection As Short, nType As Short, nH As Integer) As Short
|
nDirection As Short, nType As Short, nH As Integer) As Short
|
||||||
|
|
||||||
Public Overridable Function SetProgramMainOrSub(bMain As Boolean) As Boolean
|
Public Overridable Function SetProgramMainOrSub(bMain As Boolean) As Boolean
|
||||||
@@ -341,4 +368,36 @@ Public MustInherit Class CN_generico
|
|||||||
|
|
||||||
#End Region
|
#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
|
End Class
|
||||||
|
|||||||
+1711
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+943
-786
File diff suppressed because it is too large
Load Diff
+10794
File diff suppressed because it is too large
Load Diff
+23
-5
@@ -122,11 +122,13 @@
|
|||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\EgtProg\DllD32\EgtUILib.dll</HintPath>
|
<HintPath>..\..\EgtProg\DllD32\EgtUILib.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="EgtWPFLib">
|
<Reference Include="EgtWPFLib, Version=2.5.2.2, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\EgtProg\DllD32\EgtWPFLib.dll</HintPath>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\EgtProg\Dll32\EgtWPFLib.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="EgtWPFLib5">
|
<Reference Include="EgtWPFLib5, Version=2.5.2.2, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\EgtProg\OmagCUT\EgtWPFLib5.dll</HintPath>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\EgtProg\Dll32\EgtWPFLib5.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Interop.FXLib">
|
<Reference Include="Interop.FXLib">
|
||||||
<HintPath>..\..\EgtProg\OmagCUT\Interop.FXLib.dll</HintPath>
|
<HintPath>..\..\EgtProg\OmagCUT\Interop.FXLib.dll</HintPath>
|
||||||
@@ -225,6 +227,9 @@
|
|||||||
<Compile Include="Machine\WaterJetPageUC.xaml.vb">
|
<Compile Include="Machine\WaterJetPageUC.xaml.vb">
|
||||||
<DependentUpon>WaterJetPageUC.xaml</DependentUpon>
|
<DependentUpon>WaterJetPageUC.xaml</DependentUpon>
|
||||||
</Compile>
|
</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">
|
<Compile Include="Project\AddToDataBaseUC.xaml.vb">
|
||||||
<DependentUpon>AddToDataBaseUC.xaml</DependentUpon>
|
<DependentUpon>AddToDataBaseUC.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -240,6 +245,9 @@
|
|||||||
<Compile Include="Project\CicloStartWD.xaml.vb">
|
<Compile Include="Project\CicloStartWD.xaml.vb">
|
||||||
<DependentUpon>CicloStartWD.xaml</DependentUpon>
|
<DependentUpon>CicloStartWD.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="RawPhoto\OtherRefTabWD.xaml.vb">
|
||||||
|
<DependentUpon>OtherRefTabWD.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="RawPhoto\SlabIdWD.xaml.vb">
|
<Compile Include="RawPhoto\SlabIdWD.xaml.vb">
|
||||||
<DependentUpon>SlabIdWD.xaml</DependentUpon>
|
<DependentUpon>SlabIdWD.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -514,6 +522,10 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="RawPhoto\OtherRefTabWD.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="RawPhoto\SlabIdWD.xaml">
|
<Page Include="RawPhoto\SlabIdWD.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
@@ -896,7 +908,7 @@
|
|||||||
<Resource Include="Resources\MachineStatusImage\Single.png" />
|
<Resource Include="Resources\MachineStatusImage\Single.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="Resources\ToolChangerPos.png" />
|
<Resource Include="Resources\ToolChangerPos_OLD.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="Resources\Manual.png" />
|
<Resource Include="Resources\Manual.png" />
|
||||||
@@ -1322,6 +1334,12 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="Resources\NewIcons\Quality.png" />
|
<Resource Include="Resources\NewIcons\Quality.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="Resources\ToolChangerPos.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="Resources\NewIcons\RefTab.png" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTR32.exe
|
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTR32.exe
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
<BitmapImage x:Key="AlignPiecesImg" UriSource="Resources/NewIcons/ruota-oggetto-inclinato.png"></BitmapImage>
|
<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="BarCodeImg" UriSource="Resources/NewIcons/BarCode.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="SlabIdImg" UriSource="Resources/NewIcons/SlabId.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="BottomLeftImg" UriSource="Resources/NewIcons/1-BottomLeft.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="BottomRightImg" UriSource="Resources/NewIcons/2-BottomRight.png"></BitmapImage>
|
<BitmapImage x:Key="BottomRightImg" UriSource="Resources/NewIcons/2-BottomRight.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="PartRotOnImg" UriSource="Resources/NewIcons/PartRotOn.png"></BitmapImage>
|
<BitmapImage x:Key="PartRotOnImg" UriSource="Resources/NewIcons/PartRotOn.png"></BitmapImage>
|
||||||
|
|||||||
@@ -102,6 +102,7 @@
|
|||||||
<BitmapImage x:Key="AlignPiecesImg" UriSource="Resources/AlignPieces.png"></BitmapImage>
|
<BitmapImage x:Key="AlignPiecesImg" UriSource="Resources/AlignPieces.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="BarCodeImg" UriSource="Resources/BarCode.png"></BitmapImage>
|
<BitmapImage x:Key="BarCodeImg" UriSource="Resources/BarCode.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="SlabIdImg" UriSource="Resources/SlabId.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="BottomLeftImg" UriSource="Resources/BottomLeft.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="BottomRightImg" UriSource="Resources/BottomRight.png"></BitmapImage>
|
<BitmapImage x:Key="BottomRightImg" UriSource="Resources/BottomRight.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="PartRotOnImg" UriSource="Resources/PartRotOn.png"></BitmapImage>
|
<BitmapImage x:Key="PartRotOnImg" UriSource="Resources/PartRotOn.png"></BitmapImage>
|
||||||
|
|||||||
@@ -412,6 +412,11 @@ Public Class CurrentProjectPageUC
|
|||||||
SetTotalArea(dTotArea)
|
SetTotalArea(dTotArea)
|
||||||
UpdateToProduceArea()
|
UpdateToProduceArea()
|
||||||
ShowAreas()
|
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
|
' Dichiaro progetto non modificato
|
||||||
EgtResetModified()
|
EgtResetModified()
|
||||||
Return True
|
Return True
|
||||||
@@ -522,7 +527,21 @@ Public Class CurrentProjectPageUC
|
|||||||
m_MainWindow.m_CurrentMachine.dAdditionalTable = dValue
|
m_MainWindow.m_CurrentMachine.dAdditionalTable = dValue
|
||||||
End If
|
End If
|
||||||
' forzo visualizzazione eventuali dati su aree
|
' 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
|
' Dichiaro progetto non modificato
|
||||||
EgtResetModified()
|
EgtResetModified()
|
||||||
Return True
|
Return True
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
Imports System.IO
|
Imports System.ComponentModel
|
||||||
|
Imports System.Drawing
|
||||||
|
Imports System.IO
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
Imports EgtWPFLib
|
Imports EgtWPFLib
|
||||||
|
|
||||||
@@ -99,7 +101,6 @@ Public Class ProjectMgrUC
|
|||||||
m_CurrProjPage.NewProject(nTabInd, bRetainParkedParts)
|
m_CurrProjPage.NewProject(nTabInd, bRetainParkedParts)
|
||||||
' Gestione stato FastGrid
|
' Gestione stato FastGrid
|
||||||
m_MainWindow.m_CadCutPageUC.m_FastGridSlabManager.OnPostNewProject()
|
m_MainWindow.m_CadCutPageUC.m_FastGridSlabManager.OnPostNewProject()
|
||||||
EgtZoom(ZM.ALL)
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Function ChooseTable() As Integer
|
Friend Function ChooseTable() As Integer
|
||||||
@@ -262,6 +263,10 @@ Public Class ProjectMgrUC
|
|||||||
Dim nWarn As Integer = 0
|
Dim nWarn As Integer = 0
|
||||||
ResetAllMachinings(nWarn)
|
ResetAllMachinings(nWarn)
|
||||||
If nWarn = 1 Then m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SPLITPAGEUC + 11)) ' Lama troppo grande per utilizzo ventosa
|
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
|
' Aggiorno visualizzazione
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -478,7 +483,6 @@ Public Class ProjectMgrUC
|
|||||||
If Not (m_CurrMachine.bProdLine Or m_CurrMachine.bDemo) Then
|
If Not (m_CurrMachine.bProdLine Or m_CurrMachine.bDemo) Then
|
||||||
' Download programma (eventuali errori sono segnalati dalla funzione)
|
' Download programma (eventuali errori sono segnalati dalla funzione)
|
||||||
If m_CurrNcComm.SendProgram(sCncPath, 900) Then
|
If m_CurrNcComm.SendProgram(sCncPath, 900) Then
|
||||||
' copio il progetto corrente come progetto in lavorazione
|
|
||||||
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
|
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
|
||||||
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
|
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
|
||||||
' se abilitato e non è restart, lancio eventuale lua post-trasmissione
|
' se abilitato e non è restart, lancio eventuale lua post-trasmissione
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -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
@@ -6,76 +6,76 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="853.3" d:DesignWidth="1280" Loaded="RawPartPage_Loaded" Initialized="RawPartPage_Initialized" Unloaded="RawPartPage_Unloaded">
|
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}"
|
<!-- Definizione della RowPartPage -->
|
||||||
GroupName="DefinitionMethod_GrezzoUC"/>
|
<Grid Name="RowPartPageGrid" >
|
||||||
<RadioButton Name="DamagedBtn" Style="{DynamicResource OmagCut_YellowToggleButton}"
|
<Grid.ColumnDefinitions>
|
||||||
Grid.Column="1" GroupName="DefinitionMethod_GrezzoUC"/>
|
<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 -->
|
<!-- Definizione della Grid superiore -->
|
||||||
<Grid Name="RawMeasureGrd" Grid.Row="1" Grid.ColumnSpan="2">
|
<Grid Name="UpperButtonGrid" Grid.Column="1" Grid.Row="0" >
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="5*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<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.ColumnDefinitions>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="1*"/>
|
<RowDefinition Height="1*"/>
|
||||||
<RowDefinition Height="0.5*"/>
|
<RowDefinition Height="4*"/>
|
||||||
<RowDefinition Height="0.5*"/>
|
<RowDefinition Height="1*"/>
|
||||||
<RowDefinition Height="0.5*"/>
|
<RowDefinition Height="1.5*"/>
|
||||||
<RowDefinition Height="0.5*"/>
|
<RowDefinition Height="1.*"/>
|
||||||
<RowDefinition Height="0.5*"/>
|
<RowDefinition Height="0.5*"/>
|
||||||
<RowDefinition Height="0.5*"/>
|
<RowDefinition Height="1*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<ComboBox Name="RawModeCmBx" Grid.Row="0" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_ComboBox}"
|
<RadioButton Name="OutlineBtn" Style="{DynamicResource OmagCut_YellowToggleButton}"
|
||||||
MaxDropDownHeight="300" Margin="6,0,6,0">
|
GroupName="DefinitionMethod_GrezzoUC"/>
|
||||||
<ComboBox.ItemTemplate>
|
<RadioButton Name="DamagedBtn" Style="{DynamicResource OmagCut_YellowToggleButton}"
|
||||||
<DataTemplate>
|
Grid.Column="1" GroupName="DefinitionMethod_GrezzoUC"/>
|
||||||
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
|
||||||
</DataTemplate>
|
|
||||||
</ComboBox.ItemTemplate>
|
|
||||||
</ComboBox>
|
|
||||||
|
|
||||||
<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">
|
MaxDropDownHeight="300" Margin="6,0,6,0">
|
||||||
<ComboBox.ItemTemplate>
|
<ComboBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
@@ -85,114 +85,123 @@
|
|||||||
</ComboBox>
|
</ComboBox>
|
||||||
|
|
||||||
<TextBlock Name="LengthTxBl" Grid.Row="1" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
|
<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}"/>
|
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||||
<TextBlock Name="WidthTxBl" Grid.Row="2" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
|
<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"
|
<EgtWPFLib:EgtTextBox Name="WidthTxBx" Grid.Column="1" Grid.Row="2" Margin="13,0,6,0"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||||
<TextBlock Name="HeightTxBl" Grid.Row="3" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
|
<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"
|
<EgtWPFLib:EgtTextBox Name="HeightTxBx" Grid.Column="1" Grid.Row="3" Margin="13,0,6,0"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||||
<TextBlock Name="OffsetXTxBl" Grid.Row="4" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
|
<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"
|
<EgtWPFLib:EgtTextBox Name="OffsetXTxBx" Grid.Column="1" Grid.Row="4" Margin="13,0,6,0"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||||
<TextBlock Name="OffsetYTxBl" Grid.Row="5" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
|
<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"
|
<EgtWPFLib:EgtTextBox Name="OffsetYTxBx" Grid.Column="1" Grid.Row="5" Margin="13,0,6,0"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||||
<TextBlock Name="KerfTxBl" Grid.Row="6" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
|
<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"
|
<EgtWPFLib:EgtTextBox Name="KerfTxBx" Grid.Column="1" Grid.Row="6" Margin="13,0,6,0"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<!-- 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}"
|
<!-- 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">
|
MaxDropDownHeight="600">
|
||||||
<ComboBox.ItemTemplate>
|
<ComboBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBlock Text="{Binding sName}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
<TextBlock Text="{Binding sName}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ComboBox.ItemTemplate>
|
</ComboBox.ItemTemplate>
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
|
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
<!-- Definizione della Grid per Punti -->
|
<!-- Definizione della Grid per Punti -->
|
||||||
<GroupBox Name="PointsGpBx" Grid.Row="3" Grid.ColumnSpan="2" Style="{DynamicResource OmagCut_GroupBox}" >
|
<GroupBox Name="PointsGpBx" Grid.Row="3" Grid.ColumnSpan="2" Style="{DynamicResource OmagCut_GroupBox}" >
|
||||||
|
|
||||||
<Grid >
|
<Grid >
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="1.5*"/>
|
<ColumnDefinition Width="1.5*"/>
|
||||||
<ColumnDefinition Width="1.5*"/>
|
<ColumnDefinition Width="1.5*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="1*"/>
|
<RowDefinition Height="1*"/>
|
||||||
<RowDefinition Height="1*"/>
|
<RowDefinition Height="1*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<ToggleButton Name="AddBtn"
|
<ToggleButton Name="AddBtn"
|
||||||
Style="{DynamicResource OmagCut_YellowToggleButton}"/>
|
Style="{DynamicResource OmagCut_YellowToggleButton}"/>
|
||||||
<ToggleButton Name="RemoveBtn" Grid.Column="1"
|
<ToggleButton Name="RemoveBtn" Grid.Column="1"
|
||||||
Style="{DynamicResource OmagCut_YellowToggleButton}"/>
|
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}"/>
|
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</GroupBox>
|
|
||||||
|
|
||||||
<!-- Definizione della Grid per Zona rovinata -->
|
</GroupBox>
|
||||||
<GroupBox Name="DamagedAreaGpBx" Grid.Row="4" Grid.ColumnSpan="2" Grid.RowSpan="2" Style="{DynamicResource OmagCut_GroupBox}">
|
|
||||||
|
|
||||||
<Grid>
|
<!-- Definizione della Grid per Zona rovinata -->
|
||||||
<Grid.ColumnDefinitions>
|
<GroupBox Name="DamagedAreaGpBx" Grid.Row="4" Grid.ColumnSpan="2" Grid.RowSpan="2" Style="{DynamicResource OmagCut_GroupBox}">
|
||||||
<ColumnDefinition Width="1*"/>
|
|
||||||
<ColumnDefinition Width="1*"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<ToggleButton Name="NewBtn" Style="{DynamicResource OmagCut_YellowToggleButton}"/>
|
<Grid>
|
||||||
<ToggleButton Name="DeleteBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowToggleButton}"/>
|
<Grid.ColumnDefinitions>
|
||||||
</Grid>
|
<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}"/>
|
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||||
|
|
||||||
</Grid>
|
</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>
|
|
||||||
|
|
||||||
<Button Name="RawProbingBtn" Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
|
<!-- Definizione della Grid Inferiore per i Button V e X -->
|
||||||
<Image Source="{DynamicResource RawProbeImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
<Grid Name="LowerButtonGrid" Grid.Column="1" Grid.Row="3">
|
||||||
</Button>
|
<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}">
|
<Button Name="RawProbingBtn" Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
|
||||||
<Image Source="{DynamicResource BarCodeImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
<Image Source="{DynamicResource RawProbeImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button Name="SlabIdBtn" Grid.Column="3" Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
|
<Button Name="BarCodeBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
|
||||||
<Image Source="{DynamicResource SlabIdImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
<Image Source="{DynamicResource BarCodeImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button Name="OkBtn" Grid.Column="5" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
|
<Button Name="SlabIdBtn" Grid.Column="3" Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
|
||||||
<Image Source="{DynamicResource VImg}" Width="65" Height="65" HorizontalAlignment="Center"
|
<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" />
|
VerticalAlignment="Center" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
Imports System.Globalization
|
Imports System.Globalization
|
||||||
|
Imports System.IO
|
||||||
|
Imports System.Windows.Media.Animation
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
Imports EgtWPFLib
|
Imports EgtWPFLib
|
||||||
|
Imports Microsoft.VisualBasic.Devices
|
||||||
|
|
||||||
Public Class RawPartPageUC
|
Public Class RawPartPageUC
|
||||||
|
|
||||||
@@ -78,6 +81,16 @@ Public Class RawPartPageUC
|
|||||||
' Costante raggio cerchietto
|
' Costante raggio cerchietto
|
||||||
Private Const RAD_CIRCLE As Double = 30
|
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
|
' mostra la pagina delle lavorazioni
|
||||||
Private m_SmartMachiningPage As Boolean = False
|
Private m_SmartMachiningPage As Boolean = False
|
||||||
|
|
||||||
@@ -105,6 +118,13 @@ Public Class RawPartPageUC
|
|||||||
FROM_SAW = 7
|
FROM_SAW = 7
|
||||||
End Enum
|
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)
|
Private Sub RawPartPage_Initialized(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
'Creazione della Page UserControl e relative impostazioni
|
'Creazione della Page UserControl e relative impostazioni
|
||||||
@@ -145,6 +165,13 @@ Public Class RawPartPageUC
|
|||||||
ReDim Preserve m_RawModeListEx(3)
|
ReDim Preserve m_RawModeListEx(3)
|
||||||
End If
|
End If
|
||||||
RawModeCmBx.ItemsSource = m_RawModeList
|
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
|
' lista per selezione RawModeDamaged
|
||||||
m_RawModeDamagedList(0) = EgtMsg(MSG_RAWPARTPAGEUC + 2) 'Per Punti
|
m_RawModeDamagedList(0) = EgtMsg(MSG_RAWPARTPAGEUC + 2) 'Per Punti
|
||||||
m_RawModeDamagedList(1) = EgtMsg(MSG_RAWPARTPAGEUC + 30) 'Da Laser
|
m_RawModeDamagedList(1) = EgtMsg(MSG_RAWPARTPAGEUC + 30) 'Da Laser
|
||||||
@@ -184,6 +211,8 @@ Public Class RawPartPageUC
|
|||||||
RemoveBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 15) 'Remove - Rimuovi
|
RemoveBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 15) 'Remove - Rimuovi
|
||||||
CloseBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 31) 'Close - Chiudi
|
CloseBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 31) 'Close - Chiudi
|
||||||
ConfirmPhotoBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 24) 'Conferma
|
ConfirmPhotoBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 24) 'Conferma
|
||||||
|
|
||||||
|
OtherRefTabTxBl.Text = "New Ref On Tab"
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub RawPartPage_Loaded(sender As Object, e As RoutedEventArgs)
|
Private Sub RawPartPage_Loaded(sender As Object, e As RoutedEventArgs)
|
||||||
@@ -277,6 +306,12 @@ Public Class RawPartPageUC
|
|||||||
Utility.SetBlockAndSlabNbr(sBlock, sSlabNbr)
|
Utility.SetBlockAndSlabNbr(sBlock, sSlabNbr)
|
||||||
End If
|
End If
|
||||||
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
|
' Assegno dati grezzo rettangolare ai textbox
|
||||||
LengthTxBx.Text = LenToString(m_RawLength, 2)
|
LengthTxBx.Text = LenToString(m_RawLength, 2)
|
||||||
WidthTxBx.Text = LenToString(m_RawWidth, 2)
|
WidthTxBx.Text = LenToString(m_RawWidth, 2)
|
||||||
@@ -320,6 +355,36 @@ Public Class RawPartPageUC
|
|||||||
Next
|
Next
|
||||||
End Sub
|
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
|
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
|
||||||
' Verifico di essere il gestore attivo
|
' Verifico di essere il gestore attivo
|
||||||
If Not m_bActive Then Return
|
If Not m_bActive Then Return
|
||||||
@@ -930,6 +995,13 @@ Public Class RawPartPageUC
|
|||||||
' Disattivo bottoni zone rovinate
|
' Disattivo bottoni zone rovinate
|
||||||
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
||||||
ConfirmPhotoBtn.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
|
Case RAWMODE.BY_POINTS
|
||||||
RawModeCmBx.IsEnabled = True
|
RawModeCmBx.IsEnabled = True
|
||||||
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
|
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
|
||||||
@@ -946,6 +1018,12 @@ Public Class RawPartPageUC
|
|||||||
' Disattivo bottoni zone rovinate e foto
|
' Disattivo bottoni zone rovinate e foto
|
||||||
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
||||||
ConfirmPhotoBtn.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
|
Case RAWMODE.FROM_LASER
|
||||||
RawModeCmBx.IsEnabled = True
|
RawModeCmBx.IsEnabled = True
|
||||||
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
|
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
|
||||||
@@ -962,6 +1040,11 @@ Public Class RawPartPageUC
|
|||||||
' Disattivo bottoni zone rovinate e foto
|
' Disattivo bottoni zone rovinate e foto
|
||||||
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
||||||
ConfirmPhotoBtn.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
|
Case RAWMODE.DAMAGED
|
||||||
RawModeCmBx.IsEnabled = False
|
RawModeCmBx.IsEnabled = False
|
||||||
RawModeDamagedCmBx.Visibility = Visibility.Visible
|
RawModeDamagedCmBx.Visibility = Visibility.Visible
|
||||||
@@ -980,6 +1063,11 @@ Public Class RawPartPageUC
|
|||||||
DamagedAreaGpBx.Visibility = Windows.Visibility.Visible
|
DamagedAreaGpBx.Visibility = Windows.Visibility.Visible
|
||||||
' Disattivo bottoni foto
|
' Disattivo bottoni foto
|
||||||
ConfirmPhotoBtn.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_PHOTO
|
Case RAWMODE.FROM_PHOTO
|
||||||
RawModeCmBx.IsEnabled = True
|
RawModeCmBx.IsEnabled = True
|
||||||
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
|
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
|
||||||
@@ -992,6 +1080,11 @@ Public Class RawPartPageUC
|
|||||||
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
||||||
' Visualizzo bottoni foto
|
' Visualizzo bottoni foto
|
||||||
ConfirmPhotoBtn.Visibility = Windows.Visibility.Visible
|
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
|
Case RAWMODE.DAMAGED_BY_LASER
|
||||||
RawModeCmBx.IsEnabled = True
|
RawModeCmBx.IsEnabled = True
|
||||||
RawModeDamagedCmBx.Visibility = Visibility.Visible
|
RawModeDamagedCmBx.Visibility = Visibility.Visible
|
||||||
@@ -1008,6 +1101,11 @@ Public Class RawPartPageUC
|
|||||||
' Disattivo bottoni zone rovinate e foto
|
' Disattivo bottoni zone rovinate e foto
|
||||||
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
||||||
ConfirmPhotoBtn.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
|
Case RAWMODE.DAMAGED_BY_SAW
|
||||||
RawModeCmBx.IsEnabled = True
|
RawModeCmBx.IsEnabled = True
|
||||||
RawModeDamagedCmBx.Visibility = Visibility.Visible
|
RawModeDamagedCmBx.Visibility = Visibility.Visible
|
||||||
@@ -1024,6 +1122,11 @@ Public Class RawPartPageUC
|
|||||||
' Disattivo bottoni zone rovinate e foto
|
' Disattivo bottoni zone rovinate e foto
|
||||||
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
||||||
ConfirmPhotoBtn.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
|
Case RAWMODE.FROM_SAW
|
||||||
RawModeCmBx.IsEnabled = True
|
RawModeCmBx.IsEnabled = True
|
||||||
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
|
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
|
||||||
@@ -1040,11 +1143,26 @@ Public Class RawPartPageUC
|
|||||||
' Disattivo bottoni zone rovinate e foto
|
' Disattivo bottoni zone rovinate e foto
|
||||||
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
||||||
ConfirmPhotoBtn.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
|
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
|
End Sub
|
||||||
|
|
||||||
Private Sub OutlineBtn_Click(sender As Object, e As RoutedEventArgs) Handles OutlineBtn.Click
|
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_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 = RAWMODE.BY_POINTS
|
||||||
m_ActiveRawMode = m_PrecActiveRawMode
|
m_ActiveRawMode = m_PrecActiveRawMode
|
||||||
RawModeCmBx.SelectedIndex = m_ActiveRawMode
|
RawModeCmBx.SelectedIndex = m_ActiveRawMode
|
||||||
@@ -1055,6 +1173,12 @@ Public Class RawPartPageUC
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub DamagedBtn_Click(sender As Object, e As RoutedEventArgs) Handles DamagedBtn.Click
|
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
|
m_PrecActiveRawMode = m_ActiveRawMode
|
||||||
If m_PrecActiveRawMode = RAWMODE.FROM_LASER Then
|
If m_PrecActiveRawMode = RAWMODE.FROM_LASER Then
|
||||||
m_ActiveRawMode = RAWMODE.DAMAGED_BY_LASER
|
m_ActiveRawMode = RAWMODE.DAMAGED_BY_LASER
|
||||||
@@ -1843,6 +1967,7 @@ Public Class RawPartPageUC
|
|||||||
WidthTxBx.Text = LenToString(m_RawWidth, 2)
|
WidthTxBx.Text = LenToString(m_RawWidth, 2)
|
||||||
m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_RAWPARTPAGEUC + 17) & " " & LenToString(dMaxWidth, 2)) 'Massima larghezza =
|
m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_RAWPARTPAGEUC + 17) & " " & LenToString(dMaxWidth, 2)) 'Massima larghezza =
|
||||||
End If
|
End If
|
||||||
|
RefTabModeChange()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub HeightTxBx_EgtClosed(sender As Object, e As EventArgs) Handles HeightTxBx.EgtClosed
|
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)
|
HeightTxBx.Text = LenToString(m_RawHeight, 3)
|
||||||
m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_RAWPARTPAGEUC + 18)) 'Non sono ammessi spessori negativi
|
m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_RAWPARTPAGEUC + 18)) 'Non sono ammessi spessori negativi
|
||||||
End If
|
End If
|
||||||
|
RefTabModeChange()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub OffsetXTxBx_EgtClosed(sender As Object, e As EventArgs) Handles OffsetXTxBx.EgtClosed
|
Private Sub OffsetXTxBx_EgtClosed(sender As Object, e As EventArgs) Handles OffsetXTxBx.EgtClosed
|
||||||
@@ -1918,6 +2044,108 @@ Public Class RawPartPageUC
|
|||||||
End If
|
End If
|
||||||
End Sub
|
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
|
Private Sub KerfTxBx_EgtClosed(sender As Object, e As EventArgs) Handles KerfTxBx.EgtClosed
|
||||||
Dim dKerf As Double
|
Dim dKerf As Double
|
||||||
If Not StringToLen(KerfTxBx.Text, dKerf) Then
|
If Not StringToLen(KerfTxBx.Text, dKerf) Then
|
||||||
@@ -1960,6 +2188,8 @@ Public Class RawPartPageUC
|
|||||||
Else
|
Else
|
||||||
CreateRawFromPhotoContour()
|
CreateRawFromPhotoContour()
|
||||||
End If
|
End If
|
||||||
|
' Forzo il riposizionamento del grezzo
|
||||||
|
RefTabModeChange()
|
||||||
' Ridisegno
|
' Ridisegno
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
ElseIf dKerf >= dMinKerf And dKerf < 0 Then
|
ElseIf dKerf >= dMinKerf And dKerf < 0 Then
|
||||||
@@ -2022,6 +2252,8 @@ Public Class RawPartPageUC
|
|||||||
Else
|
Else
|
||||||
CreateRawFromPhotoContour()
|
CreateRawFromPhotoContour()
|
||||||
End If
|
End If
|
||||||
|
' Forzo il riposizionamento del grezzo
|
||||||
|
RefTabModeChange()
|
||||||
' Ridisegno
|
' Ridisegno
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
ElseIf dKerf < dMinKerf Then
|
ElseIf dKerf < dMinKerf Then
|
||||||
@@ -2052,6 +2284,18 @@ Public Class RawPartPageUC
|
|||||||
' Recupero origine tavola rispetto allo 0 macchina
|
' Recupero origine tavola rispetto allo 0 macchina
|
||||||
Dim TableRef As Point3d
|
Dim TableRef As Point3d
|
||||||
EgtGetTableRef(1, TableRef)
|
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
|
' Recupero file LUA
|
||||||
EgtLuaExecFile(m_CurrentMachine.sMachDir() & "\DirectCmd\RawProbing.lua")
|
EgtLuaExecFile(m_CurrentMachine.sMachDir() & "\DirectCmd\RawProbing.lua")
|
||||||
' Imposto parametri
|
' Imposto parametri
|
||||||
@@ -2089,6 +2333,11 @@ Public Class RawPartPageUC
|
|||||||
End If
|
End If
|
||||||
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
||||||
EgtOutLog("RawProbing : sent NC program")
|
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
|
' Aspetto e lo avvio
|
||||||
System.Threading.Thread.Sleep(300)
|
System.Threading.Thread.Sleep(300)
|
||||||
m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_CycleStart()
|
m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_CycleStart()
|
||||||
@@ -2154,6 +2403,10 @@ Public Class RawPartPageUC
|
|||||||
Else
|
Else
|
||||||
RawThickness *= ONEMM / 1000
|
RawThickness *= ONEMM / 1000
|
||||||
End If
|
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
|
' Sottraggo eventuale spessore sovratavola
|
||||||
RawThickness -= m_CurrentMachine.dAdditionalTable
|
RawThickness -= m_CurrentMachine.dAdditionalTable
|
||||||
' Imposto spessore misurato come altezza grezzo
|
' Imposto spessore misurato come altezza grezzo
|
||||||
@@ -2246,6 +2499,7 @@ Public Class RawPartPageUC
|
|||||||
Private Sub RawPartPage_Unloaded(sender As Object, e As RoutedEventArgs)
|
Private Sub RawPartPage_Unloaded(sender As Object, e As RoutedEventArgs)
|
||||||
' Rimuovo layer temporaneo per crocette
|
' Rimuovo layer temporaneo per crocette
|
||||||
EgtErase(m_nTempLay)
|
EgtErase(m_nTempLay)
|
||||||
|
EgtErase(m_nOtherRefTabLay)
|
||||||
' Dichiaro pagina non attiva
|
' Dichiaro pagina non attiva
|
||||||
m_bActive = False
|
m_bActive = False
|
||||||
End Sub
|
End Sub
|
||||||
@@ -2561,4 +2815,44 @@ Public Class RawPartPageUC
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
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
|
End Class
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.5 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 |
@@ -567,6 +567,16 @@ Public Class SimulationPageUC
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub GenerateXPIUC_Click(sender As Object, e As RoutedEventArgs)
|
Private Sub GenerateXPIUC_Click(sender As Object, e As RoutedEventArgs)
|
||||||
|
' eventualmente fermo la simulazione
|
||||||
|
m_nStatus = MCH_SIM_ST.UI_STOP
|
||||||
|
m_bPlay = False
|
||||||
|
PlayPauseBtn_Click(Nothing, Nothing)
|
||||||
|
|
||||||
|
' se il bottone Shift è premuto apro il file CadCut1 nel programma NotePad
|
||||||
|
Dim IsPressedShiftKey As Boolean = False
|
||||||
|
If Keyboard.Modifiers And ModifierKeys.Shift Then
|
||||||
|
IsPressedShiftKey = True
|
||||||
|
End If
|
||||||
Dim bOk As Boolean = True
|
Dim bOk As Boolean = True
|
||||||
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
||||||
' Elimino eventuale attrezzaggio da OmagOFFICE
|
' Elimino eventuale attrezzaggio da OmagOFFICE
|
||||||
@@ -669,6 +679,26 @@ Public Class SimulationPageUC
|
|||||||
Else
|
Else
|
||||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
||||||
End If
|
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
|
End Sub
|
||||||
|
|
||||||
Private Function ProcessEvents(nProg As Integer, nPause As Integer) As Integer
|
Private Function ProcessEvents(nProg As Integer, nPause As Integer) As Integer
|
||||||
|
|||||||
+24
-6
@@ -1,4 +1,5 @@
|
|||||||
Imports System.Globalization
|
Imports System.Globalization
|
||||||
|
Imports System.Diagnostics
|
||||||
Imports System.Collections.ObjectModel
|
Imports System.Collections.ObjectModel
|
||||||
Imports System.Text.RegularExpressions
|
Imports System.Text.RegularExpressions
|
||||||
Imports EgtWPFLib
|
Imports EgtWPFLib
|
||||||
@@ -17,8 +18,25 @@ Module Utility
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
'--------------------------------------------------------------------------------------------------
|
Friend StopWatch As Stopwatch
|
||||||
Friend Sub UpdateUI()
|
|
||||||
|
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 Sub UpdateUI()
|
||||||
' Costringo ad aggiornare UI
|
' Costringo ad aggiornare UI
|
||||||
Dim nDummy As Integer
|
Dim nDummy As Integer
|
||||||
Application.Current.Dispatcher.Invoke(Windows.Threading.DispatcherPriority.Background, _
|
Application.Current.Dispatcher.Invoke(Windows.Threading.DispatcherPriority.Background, _
|
||||||
@@ -187,10 +205,10 @@ Module Utility
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
' conerte il dato (in mm) in stringa nell'unità corrente
|
' 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)
|
Dim sVal As String = DoubleToString(EgtToUiUnits(dVal), nNumDec)
|
||||||
' se richiesta scrittura in frazione (solo se unità corrente INCHES)
|
' 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
|
' conevrto il dato corrente in decimale
|
||||||
Dim dCurrVal As Double = dVal
|
Dim dCurrVal As Double = dVal
|
||||||
StringToDouble(sVal, dCurrVal)
|
StringToDouble(sVal, dCurrVal)
|
||||||
@@ -199,10 +217,10 @@ Module Utility
|
|||||||
Return sVal
|
Return sVal
|
||||||
End Function
|
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 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
|
Dim sValSource As String = sVal
|
||||||
' conevrto la stringa in formato decimale (sempre in stringa)
|
' conevrto la stringa in formato decimale (sempre in stringa)
|
||||||
StringFractionToStringDecimal(sValSource, sVal)
|
StringFractionToStringDecimal(sValSource, sVal)
|
||||||
|
|||||||
Reference in New Issue
Block a user