Compare commits

..

30 Commits

Author SHA1 Message Date
Nicola Pievani 5da026accb Gestione doppia fotocamera (rulliera-tavolo) 2023-07-25 17:03:26 +02:00
Nicola Pievani 5396796d28 Merge commit 'ae18c7f027cc2408ed5f4adb03903ff9521da07d' into develop 2023-07-25 12:51:17 +02:00
Nicola Pievani ae18c7f027 Merge commit '54122d82e6f5179fe8dcfe0a6a907ed15a0c1a43' 2023-07-25 12:50:31 +02:00
DarioS 54122d82e6 OmagCUT 2.5g2 :
- migliorie varie alla gestione spostamento pezzi con due teste su macchine di linea
- disabilitati attese di comunicazione in modalità demo.
2023-07-25 08:33:05 +02:00
Nicola Pievani f85e97a126 Aggiunti commenti e apertura file Log 2023-07-24 18:40:18 +02:00
DarioS 06654d923c OmagCUT :
- in chiusura si aspetta chiusura DreepFeed solo se NUM_OLD (Axium).
2023-07-24 08:29:53 +02:00
Nicola Pievani ce1c6fcf02 Merge commit 'da11ec0a11faa5e6e59cee2171b222747faec822' 2023-07-21 17:31:58 +02:00
Nicola Pievani da11ec0a11 Merge commit '52688ed0dafd532cfca811a82f0c7c32b057cfb4' into develop 2023-07-21 17:31:38 +02:00
Nicola Pievani 52688ed0da Inizio gestione Vaccum due teste 2023-07-21 14:31:25 +02:00
Nicola Pievani 60eda04669 Correzione creazione file NewClick,txt 2023-07-17 09:51:25 +02:00
Nicola Pievani b95dd8f41d Gestione estensione file inviato al CN 2023-07-13 10:42:42 +02:00
Nicola Pievani 4b2351c20a Cambio versione 2.5g1 2023-07-11 16:02:51 +02:00
Nicola Pievani 988743187b Merge commit '2c0afccbe3b165a9d3c82b57d7328409ba334513' into develop 2023-07-10 14:59:29 +02:00
Nicola Pievani 2c0afccbe3 Avvio lo scatto automatico per OmagPHOTO 2023-07-10 14:58:14 +02:00
Nicola Pievani a5d6d34664 Merge commit '27b13292cf73a4d6b5ecfbaf614d5eaf6eaa1d54' 2023-06-26 18:32:42 +02:00
Nicola Pievani 27b13292cf Merge commit '7b9d99a9c66d353a869c189f7d348db75b489bf5' into develop 2023-06-26 18:30:43 +02:00
Nicola Pievani 7b9d99a9c6 Correzione gestione FeedSideAng, chiave di protezione CompoFrame 2023-06-26 18:30:16 +02:00
Nicola Pievani 1e2b4bed27 Aggiornamento Feed (Reset + Ctrl) 2023-06-15 17:33:25 +02:00
Nicola Pievani 4ecf7980ce Merge commit '82157d3b6e2e25c8257612d6b026a6b8ef10304c' into develop 2023-06-15 12:27:28 +02:00
Nicola Pievani 82157d3b6e Abilitato inversione tagli waterjet verticali 2023-06-14 20:03:37 +02:00
Nicola Pievani 10cb8f64f5 Merge commit '6dbf4f5ccbeb207f8df7d69550dd6d8bf6d06b89' 2023-06-13 18:34:25 +02:00
Nicola Pievani 6dbf4f5ccb Gestione multi inserimento e interasse Frame 2023-06-13 18:29:39 +02:00
Nicola Pievani 4ba0fe2520 Merge commit 'a55ab4f83d56dc7237f70ed32fd7aba08221c063' 2023-06-08 17:14:51 +02:00
Nicola Pievani a55ab4f83d Correzione importazione DXF 2023-06-07 12:53:57 +02:00
Nicola Pievani 419776c89f Merge commit 'fd89a6cf3b31ca241a41a8fc450fca9dbdc3f4aa' 2023-06-05 10:33:36 +02:00
Nicola Pievani fd89a6cf3b Gestione interruzione simulazione in TagliDiretti 2023-05-31 12:32:48 +02:00
Nicola Pievani b505b79d9a Correzione gestione apertura CN per Tagli Diretti 2023-05-31 12:29:08 +02:00
Nicola Pievani b1313ddb55 Modificata disosizione pulsanti 2023-05-31 11:50:44 +02:00
Nicola Pievani f3889ede24 Cambio versione 2.5f1 2023-05-31 10:53:33 +02:00
Nicola Pievani 5ca010ae4a Merge branch 'Features/Rectification_SideAng_WJ' into develop 2023-05-31 10:51:09 +02:00
30 changed files with 654 additions and 210 deletions
+1 -1
View File
@@ -30,7 +30,7 @@
</Grid.ColumnDefinitions>
<Button Name="PhotoBtn" Grid.Column="0" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource PhotoImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
<Image Name="PhotoIMG" 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}"/>
+11 -1
View File
@@ -370,7 +370,15 @@ Public Class MoveRawPartPage
VacuumCups.SetWeightInformation(AverageDensity, MaxSinglePlugger, MaxDoublePlugger)
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)
If PutVacuumCupsOnRaw(nId, rmData) Then
VacuumCups.ResetHeadName()
Dim bPutVacuum As Boolean = PutVacuumCupsOnRaw(nId, rmData)
If Not bPutVacuum Then
Dim bTwoHeadVac As Boolean = ( EgtGetHeadId( VACUUM_HEAD_2) <> GDB_ID.NULL)
If bTwoHeadVac Then bPutVacuum = PutVacuumCupsOnRaw(nId, rmData)
End If
If bPutVacuum Then
' Visualizzo le ventose
EgtSetStatus(GetVacuumId(), GDB_ST.ON_)
' Aggiorno i dati
@@ -392,6 +400,8 @@ Public Class MoveRawPartPage
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
End If
End If
End If
End If
EgtDraw()
+5 -2
View File
@@ -2482,8 +2482,11 @@ Public Class NestPageUC
Const STORE_LARGH As Double = 6000
Const STORE_DIST As Double = 200
Const STORE_OFFS As Double = 20 + 40 + 20
Dim dStXmin As Double = b3Tab.Min().x - 0.5 * (STORE_LARGH - b3Tab.DimX())
Return EgtPackBox(nId, dStXmin, -INFINITO, dStXmin + STORE_LARGH, b3Tab.Min().y - STORE_DIST, STORE_OFFS, False)
Dim dStoreLarg As Double = GetPrivateProfileDouble("Store", "StoreLargh", STORE_LARGH, m_MainWindow.GetMachIniFile())
Dim dStoreDist As Double = GetPrivateProfileDouble("Store", "StoreDist", STORE_DIST, m_MainWindow.GetMachIniFile())
Dim dStoreOffs As Double = GetPrivateProfileDouble("Store", "StoreOffs", STORE_OFFS, m_MainWindow.GetMachIniFile())
Dim dStXmin As Double = b3Tab.Min().x - 0.5 * (dStoreLarg - b3Tab.DimX())
Return EgtPackBox(nId, dStXmin, -INFINITO, dStXmin + dStoreLarg, b3Tab.Min().y - dStoreDist, dStoreOffs, False)
End Function
Private Sub RemovePartBtn_Click(sender As Object, e As RoutedEventArgs) Handles RemovePartBtn.Click
+20 -8
View File
@@ -1,4 +1,5 @@
Imports System.Windows.Forms.Integration
Imports System.Net
Imports System.Windows.Forms.Integration
Imports EgtUILib
Public Module SplitAuto
@@ -119,6 +120,9 @@ Public Module SplitAuto
Mach.m_dStartFreeLen > FREELEN_INF And Mach.m_bIsLine
Mach.m_bCanEndAll = (dEndAddLen > -EPS_SMALL And (nRes And CAR_RES.LO_OK) <> 0) And
Mach.m_dEndFreeLen > FREELEN_INF And Mach.m_bIsLine
If nRes = 0 Then
EgtOutLog("Operation ID " & nOperId.ToString & " isn't split cut! verify depth machining.")
End If
End If
' se trasformabile in taglio di separazione, verifico se lo è
If Mach.m_bCanStartAll Or Mach.m_bCanEndAll Then
@@ -795,21 +799,29 @@ Public Module SplitAuto
Private Function ExecMove(nDispId As Integer, vNewRaws As List(Of Integer),
vtMove As Vector3d, dMinMove As Double) As Boolean
Dim vtMove2 As Vector3d = -vtMove
Dim bTwoHeadVac As Boolean = ( EgtGetHeadId( VACUUM_HEAD_2) <> GDB_ID.NULL)
Dim rmData As New RawMoveData
If PutVacuumCupsOnRaw(vNewRaws(1), rmData) AndAlso
SafeMoveRawPart(vNewRaws(1), vtMove, dMinMove) Then
Dim vtMove2 As Vector3d = -vtMove
VacuumCups.ResetHeadName()
Dim bPutVacuum As Boolean = PutVacuumCupsOnRaw(vNewRaws(1), rmData)
If Not bPutVacuum And bTwoHeadVac Then bPutVacuum= PutVacuumCupsOnRaw(vNewRaws(1), rmData)
If bPutVacuum AndAlso SafeMoveRawPart(vNewRaws(1), vtMove, dMinMove) Then
rmData.m_vtRawMove = vtMove
SaveOneMoveInfoInDisposition(nDispId, rmData)
Return True
ElseIf PutVacuumCupsOnRaw(vNewRaws(0), rmData) AndAlso
SafeMoveRawPart(vNewRaws(0), vtMove2, dMinMove) Then
End If
VacuumCups.ResetHeadName()
Dim bPut2Vacuum As Boolean = PutVacuumCupsOnRaw(vNewRaws(0), rmData)
If Not bPut2Vacuum And bTwoHeadVac Then bPutVacuum = PutVacuumCupsOnRaw(vNewRaws(0), rmData)
If bPut2Vacuum AndAlso SafeMoveRawPart(vNewRaws(0), vtMove2, dMinMove) Then
rmData.m_vtRawMove = vtMove2
SaveOneMoveInfoInDisposition(nDispId, rmData)
Return True
Else
Return False
End If
Return False
End Function
Private Function SafeMoveRawPart(nRawId As Integer, ByRef vtMove As Vector3d, dMindist As Double) As Boolean
+4 -1
View File
@@ -1700,7 +1700,7 @@ Public Class SplitPageUC
End If
Dim nI As Integer = m_ItemList(Index).Ind
' Si possono invertire solo i tagli di lama
If m_MachiningList(nI).m_nType <> MCH_OY.SAWING Then Continue For
If m_MachiningList(nI).m_nType <> MCH_OY.SAWING And m_MachiningList(nI).m_nType <> MCH_OY.WATERJETTING Then Continue For
' Non si possono invertire i tagli di lama inclinati
If Math.Abs(m_MachiningList(nI).m_dSideAng) > 0.1 Then Continue For
' Se abilitata inversione automatica e quindi non invertito
@@ -1714,6 +1714,7 @@ Public Class SplitPageUC
ResetEnableInvert(m_MachiningList(nI).m_nEntId)
EgtErase(m_MachiningList(nI).m_nArrId)
NumberDirectionMachining(nI, False)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
EgtDraw()
End If
' se altrimenti disabilitata inversione automatica e invertito
@@ -1725,6 +1726,7 @@ Public Class SplitPageUC
SwapStartEndData(nI)
EgtErase(m_MachiningList(nI).m_nArrId)
NumberDirectionMachining(nI, False)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
EgtDraw()
End If
' altrimenti disabilitata inversione automatica e non invertito
@@ -2196,6 +2198,7 @@ Public Class SplitPageUC
' gestione bottone per generazione ponticelli
If Type = MCH_OY.WATERJETTING Then
InvertBtn.Visibility = Visibility.Visible
' siccome la stessa posizione è occupata da due comandi sovrapposti
If CutStartBtn.Visibility = Visibility.Hidden Then
BridgesWJBtn.Visibility = Visibility.Visible
+75 -40
View File
@@ -1,5 +1,6 @@
Imports EgtUILib
Imports System.Text.RegularExpressions
Imports System.Threading
Module VacuumCups
' Tipo manipolatore con ventosa (0=assente, 1=dietro, 2=laterale)
@@ -31,6 +32,19 @@ Module VacuumCups
' Nome del gruppo temporaneo per le ventose
Private Const VACTMP_GRP As String = "VacTmp"
Private m_sHeadName As String = VACUUM_HEAD
Public Sub ResetHeadName()
Dim bReload As Boolean = (m_sHeadName <> VACUUM_HEAD)
m_sHeadName = VACUUM_HEAD
If bReload Then LoadVacuumCups()
End Sub
Public Function ChangeHeadName() As Boolean
If EgtGetHeadId( VACUUM_HEAD_2) = GDB_ID.NULL Then Return False
m_sHeadName = If( m_sHeadName = VACUUM_HEAD, VACUUM_HEAD_2, VACUUM_HEAD)
LoadVacuumCups()
Return True
End Function
'-----------------------------------------------------------------------------------------------
Friend Class RawMoveData
@@ -87,17 +101,17 @@ Module VacuumCups
Friend Function LoadVacuumCups() As Boolean
' Leggo tipo manipolatore con ventosa
m_nVacType = 0
EgtGetInfo(EgtGetHeadId(VACUUM_HEAD), KEY_VAC_TYPE, m_nVacType)
EgtGetInfo(EgtGetHeadId(m_sHeadName), KEY_VAC_TYPE, m_nVacType)
' Cancello eventuali vecchie ventose
RemoveVacuumCups()
' Identificativo ventose nella macchina
Dim nLayId As Integer = EgtGetFirstNameInGroup(EgtGetHeadId(VACUUM_HEAD), VACUUM_HEAD_LAYOUT)
Dim nLayId As Integer = EgtGetFirstNameInGroup(EgtGetHeadId(m_sHeadName), VACUUM_HEAD_LAYOUT)
If nLayId = GDB_ID.NULL Then Return False
' Identificativo riferimento della testa nella macchina
Dim nT1Id As Integer = EgtGetFirstNameInGroup(EgtGetHeadId(VACUUM_HEAD), HEAD_FIRST_EXIT)
Dim nT1Id As Integer = EgtGetFirstNameInGroup(EgtGetHeadId(m_sHeadName), HEAD_FIRST_EXIT)
If nT1Id = GDB_ID.NULL Then Return False
' imposto la l'uscita della ventosa come fosse l'uscita di un utensile
EgtSetCalcTool("", "H4", 1)
EgtSetCalcTool("", m_sHeadName, 1)
' Creo gruppo temporaneo in cui copiarli
m_nTempId = EgtCreateGroup(GDB_ID.ROOT)
If m_nTempId = GDB_ID.NULL Then Return False
@@ -107,23 +121,23 @@ Module VacuumCups
m_nVacId = EgtCopyGlob(nLayId, m_nTempId)
If m_nVacId = GDB_ID.NULL Then Return False
' Angolo di rotazione preferito
EgtGetInfo( m_nVacId, KEY_VACLAY_PREFROT, m_dPreferredRot)
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFROT, m_dPreferredRot)
' Angoli di rotazione preferiti per ventosa in verticale (lungo Y) a sinistra e a destra del centro tavola
EgtGetInfo( m_nVacId, KEY_VACLAY_PREFVROTXMINUS, m_dPrefVertRotXMinus)
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTXMINUS, m_dPrefVertRotXMinus)
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTXPLUS, m_dPrefVertRotXPlus)
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTYMINUS, m_dPrefVertRotYMinus)
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTYPLUS, m_dPrefVertRotYPlus)
' Direzione di riferimento per tagli Drip
EgtGetInfo( m_nVacId, KEY_VACLAY_DRIPREFDIR, m_dDripRefAng)
EgtGetInfo(m_nVacId, KEY_VACLAY_DRIPREFDIR, m_dDripRefAng)
' Nascondo il gruppo ma rendo visibili le curve di contorno delle ventose
EgtSetStatus(m_nVacId, GDB_ST.OFF)
Dim nId As Integer = EgtGetFirstInGroup(m_nVacId)
While nId <> GDB_ID.NULL
Select Case EgtGetType(nId)
Case GDB_TY.CRV_LINE, GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_COMPO
EgtSetStatus(nId, GDB_ST.ON_)
Case Else
EgtSetStatus(nId, GDB_ST.OFF)
Case GDB_TY.CRV_LINE, GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_COMPO
EgtSetStatus(nId, GDB_ST.ON_)
Case Else
EgtSetStatus(nId, GDB_ST.OFF)
End Select
nId = EgtGetNext(nId)
End While
@@ -152,7 +166,7 @@ Module VacuumCups
Friend Function ResetVacuumCups() As Boolean
' Ripristino posizione e rotazione originali
Dim frOriRef As New Frame3d
EgtFrame(EgtGetFirstNameInGroup(EgtGetHeadId(VACUUM_HEAD), HEAD_FIRST_EXIT), GDB_ID.ROOT, frOriRef)
EgtFrame(EgtGetFirstNameInGroup(EgtGetHeadId(m_sHeadName), HEAD_FIRST_EXIT), GDB_ID.ROOT, frOriRef)
Dim frCurrRef As New Frame3d
EgtFrame(m_nRefId, GDB_ID.ROOT, frCurrRef)
EgtMove(m_nVacId, frOriRef.Orig() - frCurrRef.Orig(), GDB_RT.GLOB)
@@ -164,10 +178,10 @@ Module VacuumCups
Dim nId As Integer = EgtGetFirstInGroup(m_nVacId)
While nId <> GDB_ID.NULL
Select Case EgtGetType(nId)
Case GDB_TY.CRV_LINE, GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_COMPO
EgtSetStatus(nId, GDB_ST.ON_)
Case Else
EgtSetStatus(nId, GDB_ST.OFF)
Case GDB_TY.CRV_LINE, GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_COMPO
EgtSetStatus(nId, GDB_ST.ON_)
Case Else
EgtSetStatus(nId, GDB_ST.OFF)
End Select
nId = EgtGetNext(nId)
End While
@@ -207,14 +221,17 @@ Module VacuumCups
EgtSurfFrGrossArea(nRKerfId, RawArea)
' volume calcolato in mmc
Dim RawVolume As Double = RawArea * b3Raw.DimZ()
' peso calolato in kg
' peso calcolato in kg
m_RawWeight = RawVolume * m_RawDensity / Math.Pow(10, 9)
'-------------------- FINE CALCOLO PESO --------------------
' Eseguo ricerca
If FindVacuumCupsOnRaw(nRawId, ptRawCen, b3Kerf, ptKerfCen, nKerfId, nRKerfId, rmData) Then
Return True
Else
If ChangeHeadName() Then Return False
End If
' In caso di fallimento, provo riducendo con offset la regione di kerf
' (così si simula la proiezione del centro sul MAT - medial axis transform)
Dim bOkFind As Boolean = False
@@ -241,20 +258,20 @@ Module VacuumCups
' Verifico sia veramente un pezzo
If EgtGetRawPartFromPart(nPartId) = GDB_ID.NULL Then Return False
' Cerco la direzione del primo taglio attivo da sotto
Dim nDripLayId As Integer = EgtGetFirstNameInGroup( nPartId, NAME_DRIPCUT)
Dim nDripLineId As Integer = EgtGetFirstInGroup( nDripLayId)
Dim nDripLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_DRIPCUT)
Dim nDripLineId As Integer = EgtGetFirstInGroup(nDripLayId)
While nDripLineId <> GDB_ID.NULL
Dim nMchId As Integer = EgtGetOperationId( "DripSaw" & nDripLineId.ToString())
Dim nMchId As Integer = EgtGetOperationId("DripSaw" & nDripLineId.ToString())
Dim nMode As Integer
If EgtGetMode( nMchId, nMode) AndAlso nMode = GDB_MD.STD Then Exit While
nDripLineId = EgtGetNext( nDripLineId)
If EgtGetMode(nMchId, nMode) AndAlso nMode = GDB_MD.STD Then Exit While
nDripLineId = EgtGetNext(nDripLineId)
End While
Dim vtDir As New Vector3d
if EgtStartVector( nDripLineId, GDB_ID.ROOT, vtDir) Then
If EgtStartVector(nDripLineId, GDB_ID.ROOT, vtDir) Then
Dim dLen, dAngV, dAngH As Double
vtDir.ToSpherical( dLen, dAngV, dAngH)
vtDir.ToSpherical(dLen, dAngV, dAngH)
Dim dOffsAng = dAngH - m_dDripRefAng
While dOffsAng - m_dPreferredRot >= 90
While dOffsAng - m_dPreferredRot >= 90
dOffsAng -= 180
End While
While dOffsAng - m_dPreferredRot <= -90
@@ -388,7 +405,7 @@ Module VacuumCups
Private Function GetVacRotAxisSteps(ByRef vAngRot As List(Of Double)) As Boolean
' Recupero l'asse rotante della testa ventosa
Dim nRotAxId As Integer = EgtGetParent(EgtGetHeadId(VACUUM_HEAD))
Dim nRotAxId As Integer = EgtGetParent(EgtGetHeadId(m_sHeadName))
' Verifico se contiene info con STEPS
Dim sSteps As String = ""
If Not EgtGetInfo(nRotAxId, KEY_ROTVAC_STEPS, sSteps) Then Return False
@@ -493,15 +510,15 @@ Module VacuumCups
' Ordino secondo distanza angolare crescente da direzione di allineamento (modulo 180 deg)
Dim dRotRefDeg As Double = dRotAngDeg
vAngRot.Sort(Function(P, Q)
Dim dDiffP = Math.Abs( P - dRotRefDeg)
If Math.Abs( dDiffP - 180) < 10 * EPS_ANG_SMALL Then dDiffP = 1
Dim dDiffQ = Math.Abs( Q - dRotRefDeg)
If Math.Abs( dDiffQ - 180) < 10 * EPS_ANG_SMALL Then dDiffQ = 1
Return ( dDiffP - dDiffQ)
Dim dDiffP = Math.Abs(P - dRotRefDeg)
If Math.Abs(dDiffP - 180) < 10 * EPS_ANG_SMALL Then dDiffP = 1
Dim dDiffQ = Math.Abs(Q - dRotRefDeg)
If Math.Abs(dDiffQ - 180) < 10 * EPS_ANG_SMALL Then dDiffQ = 1
Return (dDiffP - dDiffQ)
End Function)
' Annullo la rotazione di allineamento
dRotAngDeg = 0
' altrimenti in continuo
' altrimenti in continuo
Else
' Assegno più valori di ricerca e conservo angolo di allineamento
vAngRot.AddRange({0, +5, -5, +12.5, -12.5, +25, -25, +45, -45})
@@ -548,25 +565,43 @@ Module VacuumCups
' 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
Dim sAxisName As String = "C"
' verifico che il nome dell'asse impostato sia corretto
If Not EgtGetAxisId(sAxisName) Then
If m_sHeadName = VACUUM_HEAD Then
sAxisName = "C1"
Else
sAxisName = "C2"
End If
End If
' Posizione Home dell'asse rotante
Dim dCHome As Double
EgtGetAxisHomePos("C", dCHome)
EgtGetAxisHomePos(sAxisName, dCHome)
' Corse dell'asse
Dim dCMin As Double
EgtGetAxisMin("C", dCMin)
EgtGetAxisMin(sAxisName, dCMin)
Dim dCMax As Double
EgtGetAxisMax("C", dCMax)
EgtGetAxisMax(sAxisName, 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("", m_sHeadName, 1)
' Calcolo gli assi macchina
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)
If EgtGetAxisId("A") Then
' Asse tavola rotante (movimenti solo con A0)
EgtGetCalcPositions(ptRef, 0, dRotAngMachDeg, nStat, dX, dY, dZ)
' Verifico le corse
EgtVerifyOutstroke(dX, dY, dZ, 0, dRotAngMachDeg, nStat)
Else
EgtGetCalcPositions(ptRef, dRotAngMachDeg, 0, nStat, dX, dY, dZ)
' Verifico le corse
EgtVerifyOutstroke(dX, dY, dZ, dRotAngMachDeg, 0, nStat)
End If
Return nStat
End Function
@@ -732,7 +767,7 @@ Module VacuumCups
rmList.RemoveAt(nInd)
nInd = rmList.Count() - 1
End If
' Se non trovato, lo accodo
' Se non trovato, lo accodo
Else
rmList.Add(New RawMoveData(nRawId))
nInd = rmList.Count() - 1
+5
View File
@@ -84,6 +84,11 @@ Module ConstGen
' Nome testa con ventose per spostamento pezzi
Public Const VACUUM_HEAD As String = "H4"
Public Const VACUUM_HEAD_2 As String = "H104"
' Nome teste laser
Public Const LASER_HEAD As String = "H3"
Public Const LASER_HEAD_2 As String = "H103"
' Info tipo ventosa
Public Const KEY_VAC_TYPE As String = "VacType"
' Nome gruppo layout in testa con ventose
+1
View File
@@ -206,6 +206,7 @@ Module ConstIni
Public Const K_OFFSZ As String = "OffsZ"
Public Const K_OFFSXY As String = "OffsXY"
Public Const K_OFFSYY As String = "OffsYY"
Public Const K_OFFSXINTERY As String = "OffsYInterY"
Public Const K_STARTTRIM As String = "StartTrim"
Public Const K_ENDTRIM As String = "EndTrim"
Public Const K_OTHERSIDE As String = "OtherSide"
+9
View File
@@ -5,6 +5,7 @@
Public Const S_PARTPROGRAM As String = "PartProgram"
Public Const K_EXTENSION As String = "Extension"
Public Const K_EXTFILECN As String = "ExtFileCN"
Public Const S_AXES As String = "Axes"
Public Const K_AXESNUM As String = "AxesNum"
@@ -56,6 +57,10 @@
Public Const S_EXECLUA As String = "ExecLua"
Public Const K_FILESCRIPT_LUA As String = "FileScript"
Public Const S_CAMERAHQ As String = "CameraHQ"
Public Const K_CAMERAHQ_ENABLE As String = "EnableHQ"
Public Const K_CAMERAHQ_ACTIVATE As String = "ActivateHQ"
Public Const S_NCDATA As String = "NcData"
Public Const K_NEWVARIABLE As String = "NewVariable"
Public Const K_NEWCONSOLE As String = "NewConsole"
@@ -151,6 +156,10 @@
Public Const K_PRODLIPROBINGTCPOS2VAR As String = "ProbingTcPos2Var"
Public Const K_PRODLISAWDIAMETER2VAR As String = "SawDiameter2Var"
Public Const S_POLISHLINE As String = "PolishLine"
Public Const K_CLICKSTATE As String = "ClickState"
Public Const k_CLICKDIR As String = "ClickDir"
Public Const S_STATISTICS As String = "Stats"
Public Const K_DATADIR As String = "DataDir"
Public Const K_SHOWAREAS As String = "ShowAreas"
+12 -9
View File
@@ -1138,7 +1138,7 @@ Public Class DrawPageUC
Return True
End Function
Private Function MakeSectionFrameInsert() As Boolean
Private Function MakeSectionFrameInsert(ByVal nNbr As Integer) As Boolean
' m_MainWindow.m_ImportPageUC.LoadFrame()
' recupero il primo layer del primo pezzo
Dim nLayerId As Integer = EgtGetFirstLayer(EgtGetFirstPart())
@@ -1150,13 +1150,16 @@ Public Class DrawPageUC
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)
' eseguo inserimento
For i As Integer = 1 To nNbr
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)
Next
' Cancello il file
My.Computer.FileSystem.DeleteFile(sTmpFile)
Return True
@@ -1178,7 +1181,7 @@ Public Class DrawPageUC
' Passo al contesto principale
'MakeInsert(InsNbr, sPartName)
If m_MainWindow.FrameCutBtn.IsChecked Then
MakeSectionFrameInsert()
MakeSectionFrameInsert(InsNbr)
Else
MakeMultipleInsert(InsNbr, sPartName)
End If
+1 -1
View File
@@ -58,7 +58,7 @@
<ListBox Name="FileListBox" Grid.Row="1" Grid.RowSpan="2" ItemTemplate="{DynamicResource DataTemplateItem}"
ItemsSource="{Binding ItemList}"/>
<Grid Grid.Row="3" Margin="0,0,8,0">
<Grid Name="FinderGrd" Grid.Row="3" Margin="0,0,8,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="1*"/>
+25 -3
View File
@@ -19,6 +19,9 @@ Public Class ImportPageUC
Friend WithEvents ImportScene As New Scene
Private ImportSceneHost As New System.Windows.Forms.Integration.WindowsFormsHost
Private m_SelListHole As New List(Of Integer)
Private m_DeselectListHole As New List(Of Integer)
' Properties
Private m_sCurrDir As String = String.Empty
Private m_sCurrFile As String = String.Empty
@@ -101,6 +104,8 @@ Public Class ImportPageUC
' abilitazione Ordine e Distinta per importazione DXF
m_bEnableOrderList = (m_MainWindow.m_PrevActivePage = MainWindow.Pages.CadCut And
GetPrivateProfileInt(S_COMPO, K_CSVDATA, 0, m_MainWindow.GetIniFile()) <> 0)
' rendo visibilie il pulsante di ricerca file
FinderGrd.Visibility = Visibility.Visible
If m_bFirst Then
' imposto colore di default
@@ -196,7 +201,6 @@ Public Class ImportPageUC
PartNumTxBx.Text = "1"
' disabilito ok
OkBtn.IsEnabled = False
End Sub
Private Sub LoadGridData()
@@ -345,7 +349,7 @@ Public Class ImportPageUC
End Function
Private Function LoadCurrFile() As Boolean
' Pulisco il DB geometrico locale
' Pulisco il DB geometrico locale
Dim bOk As Boolean = EgtNewFile()
' Costruisco path completa del file
Dim sPath = IO.Path.Combine(m_sCurrDir, m_sCurrFile)
@@ -415,7 +419,7 @@ Public Class ImportPageUC
DripCutBtn.IsEnabled = False
DripDrillBtn.IsEnabled = False
End If
' altrimenti import per cornici
' altrimenti import per cornici
Else
mmBtn.IsEnabled = (m_nFileType = FT.DXF)
inchBtn.IsEnabled = (m_nFileType = FT.DXF)
@@ -569,6 +573,8 @@ Public Class ImportPageUC
EgtSetColor(nEntId, New Color3d(127, 63, 0))
nEntId = EgtGetNext( nEntId)
End While
m_DeselectListHole.Add(nLayId)
m_SelListHole.Remove(nLayId)
End If
Else
Dim nLayId As Integer = GDB_ID.NULL
@@ -585,6 +591,8 @@ Public Class ImportPageUC
EgtSetColor(nEntId, New Color3d(255, 255, 255))
nEntId = EgtGetNext( nEntId)
End While
m_SelListHole.Add(nLayId)
m_DeselectListHole.Remove(nLayId)
End If
End If
EgtDraw()
@@ -592,6 +600,12 @@ Public Class ImportPageUC
End If
nId = EgtGetNextObjInSelWin()
End While
m_FiloTopUC.CreateFiloTopPreView(m_SelListHole)
m_FiloTopUC.EraseFiloTopPreview(m_DeselectListHole)
If m_SelListHole.Count > 0 Then
MessageTxBx.Text = ""
MessageBrd.Background = Brushes.Transparent
End If
End Sub
Private Sub OnShowDistanceVector(sender As Object, vtDist As Vector3d) Handles ImportScene.OnShowDistanceVector
@@ -1040,6 +1054,7 @@ Public Class ImportPageUC
Private Sub SideAngleBtn_Click(sender As Object, e As RoutedEventArgs) Handles SideAngleBtn.Click
If SideAngleBtn.IsChecked() Then
FinderGrd.Visibility = Visibility.Hidden
' Aggiungo regioni per percorsi interni
AdjustSelectRegions()
' Dichiaro nessuna selezione
@@ -1062,6 +1077,7 @@ Public Class ImportPageUC
MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 6) ' Selezionare un contorno
MessageBrd.Background = Application.Current.FindResource("OmagCut_Green")
Else
FinderGrd.Visibility = Visibility.Visible
' Rimuovo regioni per percorsi interni
RemoveSelectRegions()
FilePathTxBl.Visibility = Windows.Visibility.Visible
@@ -1092,6 +1108,7 @@ Public Class ImportPageUC
Private Sub DripCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles DripCutBtn.Click
If DripCutBtn.IsChecked() Then
FinderGrd.Visibility = Visibility.Hidden
' Dichiaro nessuna selezione
m_nSelectedPart = GDB_ID.NULL
m_nSelectedLayer = GDB_ID.NULL
@@ -1112,6 +1129,7 @@ Public Class ImportPageUC
MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 6) ' Selezionare un contorno
MessageBrd.Background = Application.Current.FindResource("OmagCut_Green")
Else
FinderGrd.Visibility = Visibility.Visible
FilePathTxBl.Visibility = Windows.Visibility.Visible
FileListBox.Visibility = Windows.Visibility.Visible
LeftGrid.Children.Remove(m_SideAngleUC)
@@ -1142,6 +1160,7 @@ Public Class ImportPageUC
Private Sub DripDrillBtn_Click(sender As Object, e As RoutedEventArgs) Handles DripDrillBtn.Click
If DripDrillBtn.IsChecked() Then
FinderGrd.Visibility = Visibility.Hidden
' Aggiungo regioni di selezione per percorsi interni
AdjustSelectRegions()
' Imposto modalità fori da sotto
@@ -1160,6 +1179,7 @@ Public Class ImportPageUC
MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 15) ' Selezionare uno o più fori
MessageBrd.Background = Application.Current.FindResource("OmagCut_Green")
Else
FinderGrd.Visibility = Visibility.Visible
' Rimuovo regioni per percorsi interni
RemoveSelectRegions()
FilePathTxBl.Visibility = Windows.Visibility.Visible
@@ -1187,6 +1207,7 @@ Public Class ImportPageUC
Private Sub FiloTopBtn_Click(sender As Object, e As RoutedEventArgs) Handles FiloTopBtn.Click
If FiloTopBtn.IsChecked() Then
FinderGrd.Visibility = Visibility.Hidden
' Aggiungo regioni per percorsi interni
AdjustSelectRegions()
' Dichiaro nessuna selezione
@@ -1208,6 +1229,7 @@ Public Class ImportPageUC
MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 6) ' Selezionare un contorno interno
MessageBrd.Background = Application.Current.FindResource("OmagCut_Green")
Else
FinderGrd.Visibility = Visibility.Visible
' Rimuovo regioni per percorsi interni
RemoveSelectRegions()
FilePathTxBl.Visibility = Windows.Visibility.Visible
+23 -9
View File
@@ -39,6 +39,15 @@
<Button Name="RawPartBtn" Grid.Column="1" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource RawPartImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="CompoBtn" Grid.Column="2" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource DrawImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="SelSectionBtn" Grid.Column="3" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource Sezione-corniceImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
</Button>
<ToggleButton Name="MachiningBtn" Grid.Column="4" Style="{DynamicResource OmagCut_RightGrayYellowIconToggleButton}">
<Image Source="{DynamicResource FrameMachiningImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</ToggleButton>
@@ -63,6 +72,7 @@
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.8*"/>
<RowDefinition Height="0.8*"/>
<RowDefinition Height="1.7*"/>
@@ -78,14 +88,13 @@
</ComboBox>
<UniformGrid Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" >
<Button Name="SelSectionBtn"
<!--<Button Name="SelSectionBtn"
Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<Image Source="{DynamicResource Sezione-corniceImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
</Button>
</Button>-->
<Grid>
<Button Name="SelGuideBtn"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
<Button Name="SelGuideBtn" Style="{DynamicResource OmagCut_YellowTextButton}"/>
<UniformGrid Name="ArcGrid" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" >
<TextBlock Name="ArcRadTxBl" Grid.Row="2" Grid.ColumnSpan="2"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
@@ -110,11 +119,16 @@
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<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"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<UniformGrid Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="2" >
<TextBlock Name="OffsXInteryTxBl" Grid.Row="5" Grid.ColumnSpan="2"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="OffsXInteryTxBx" Grid.Column="2" Grid.Row="5" Width="50"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<UniformGrid Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="3" Columns="2" >
<Button Name="MirrorPartBtn"
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource SpecchiaImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
@@ -125,12 +139,12 @@
</Button>
</UniformGrid>
<UniformGrid Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="3" Columns="2" >
<!--<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>
</UniformGrid>-->
<!--<TextBlock Name="SawRoughingTxBl" Grid.Row="4" Grid.ColumnSpan="3"
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
+22 -5
View File
@@ -52,6 +52,8 @@ Public Class FrameCutPageUC
OffsXyTxBx.Text = LenToString(dOffsXY, 3)
Dim dOffsYY As Double = GetPrivateProfileDouble(S_FRAME, K_OFFSYY, 5, m_MainWindow.GetIniFile())
OffsYyTxBx.Text = LenToString(dOffsYY, 3)
Dim dOffsXInterY As Double = GetPrivateProfileDouble(S_FRAME, K_OFFSXINTERY, 5, m_MainWindow.GetIniFile())
OffsXInteryTxBx.Text = LenToString(dOffsXInterY, 3)
' Imposto i messaggi letti dal file dei messaggi
m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 1)) 'Lungo X
@@ -70,6 +72,7 @@ Public Class FrameCutPageUC
OffsZTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 8) 'Distanza sopra
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 9) 'Distanza inizio
OffsYyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 22) 'Distanza Y
OffsXInteryTxBl.Text = EgtMsg(90645) 'Interasse
End Sub
Private Sub FrameCutPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
@@ -82,7 +85,11 @@ Public Class FrameCutPageUC
m_ProjectMgr.VeinMatchingBtn.Visibility = Windows.Visibility.Hidden
m_ProjectMgr.RegisterBtn.Visibility = Windows.Visibility.Hidden
' Visualizzo il bottone per l'importazione dei compo frame
CompoBtn.Visibility = If(GetPrivateProfileInt(S_FRAMECOMPO, K_CMP_COUNT, 0, m_MainWindow.GetIniFile()) > 0, Visibility.Visible, Visibility.Hidden)
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.COMPOFRAME) AndAlso GetPrivateProfileInt(S_FRAMECOMPO, K_CMP_COUNT, 0, m_MainWindow.GetIniFile()) > 0 Then
CompoBtn.Visibility = Visibility.Visible
Else
CompoBtn.Visibility = Visibility.Hidden
End If
' Recupero dimensioni e kerf del grezzo
m_nRawId = EgtGetFirstRawPart()
GetRawBox(m_RawBox)
@@ -273,7 +280,7 @@ Public Class FrameCutPageUC
End If
End Sub
Private Sub OffsXXTxBx_EgtClosed(sender As Object, e As EventArgs) Handles OffsZTxBx.EgtClosed, OffsXyTxBx.EgtClosed, OffsYyTxBx.EgtClosed
Private Sub OffsXXTxBx_EgtClosed(sender As Object, e As EventArgs) Handles OffsZTxBx.EgtClosed, OffsXyTxBx.EgtClosed, OffsYyTxBx.EgtClosed, OffsXInteryTxBx.EgtClosed
' Forzo aggiornamento grezzo nella pagina di Nesting
m_MainWindow.m_CadCutPageUC.m_NestPage.CalcRawPart()
' Parcheggio pezzi presenti nel grezzo
@@ -298,9 +305,13 @@ Public Class FrameCutPageUC
WritePrivateProfileString(S_FRAME, K_OFFSXY, DoubleToString(dOffsXy, 3), m_MainWindow.GetIniFile())
End If
Dim dOffsYy As Double = 0
If StringToLen(OffsYyTxBx.Text, dOffsYY) Then
If StringToLen(OffsYyTxBx.Text, dOffsYy) Then
WritePrivateProfileString(S_FRAME, K_OFFSYY, DoubleToString(dOffsYy, 3), m_MainWindow.GetIniFile())
End If
Dim dOffsXIntery As Double = 0
If StringToLen(OffsXInteryTxBx.Text, dOffsXIntery) Then
WritePrivateProfileString(S_FRAME, K_OFFSXINTERY, DoubleToString(dOffsXIntery, 3), m_MainWindow.GetIniFile())
End If
End Sub
Private Sub MirrorPartBtn_Click(sender As Object, e As RoutedEventArgs) Handles MirrorPartBtn.Click
@@ -948,12 +959,18 @@ Public Class FrameCutPageUC
' Determino distanza da spessore lama
Dim dMinDist As Double = 0
Dim dSawThick As Double = 0
Dim dOffsXIntery As Double = 0
StringToLen(OffsXInteryTxBx.Text, dOffsXIntery)
If EgtTdbSetCurrTool(m_MainWindow.m_CurrentMachine.sCurrSaw) AndAlso
EgtTdbGetCurrToolParam(MCH_TP.THICK, dSawThick) Then
dMinDist = dSawThick + 5 * EPS_SMALL
If dOffsXIntery <= dSawThick Then
dMinDist = dSawThick + 5 * EPS_SMALL
Else
dMinDist = dOffsXIntery + 5 * EPS_SMALL
End If
Else
EgtOutLog("Not found current saw for frames mindist")
dMinDist = 0
dMinDist = dOffsXIntery
End If
' Inserisco il pezzo nel grezzo
Dim ptIns As Point3d
+34 -2
View File
@@ -1,6 +1,7 @@
Imports System.Collections.ObjectModel
Imports EgtWPFLib5
Imports EgtUILib
Imports System.IO
Public Class CurrentMachine
@@ -51,6 +52,10 @@ Public Class CurrentMachine
Private m_sProdLiProbingState2Var As String = ""
Private m_sProdLiProbingTcPos2Var As String = ""
Private m_sProdLiSawDiameter2Var As String = ""
Private m_sClickState As String = "E80028"
Private m_sClickDir As String = ""
' Gestione speciale per canali CN
Private m_sExtFileCN As String = ".0"
' Numero e tipo di utensili correntemente disponibili sulla macchina
Private m_MountedToolConfig As MountedToolConfigs = MountedToolConfigs.SAW
@@ -316,7 +321,7 @@ Public Class CurrentMachine
Return m_bAskNewOnResend
End Get
End Property
Friend ReadOnly Property nProdLiSawProbe As Integer
Get
@@ -324,6 +329,24 @@ Public Class CurrentMachine
End Get
End Property
Friend ReadOnly Property sClickState As String
Get
Return m_sClickState
End Get
End Property
Friend ReadOnly Property sClickDir As String
Get
Return m_sClickDir
End Get
End Property
Friend ReadOnly Property sExtFileCN As String
Get
Return m_sExtFileCN
End Get
End Property
Friend Function sProdLiProbingStateVar(nI As Integer) As String
If nI = 1 Then Return m_sProdLiProbingStateVar
If nI = 2 Then Return m_sProdLiProbingState2Var
@@ -788,7 +811,7 @@ Public Class CurrentMachine
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), K_TAB3_ADDITIONALTABLE, value)
End If
End If
Case 2
Case 2
If Math.Abs(value - m_dTab2AdditionalTable) > EPS_SMALL And
WritePrivateProfileString(S_TABLE, K_TAB2_ADDITIONALTABLE, DoubleToString(value, 3), sMachIniFile) Then
' Aggiorno il valore corrente
@@ -1120,6 +1143,8 @@ Public Class CurrentMachine
m_sMachIniFile = m_MainWindow.GetMachinesRootDir & "\" & sMachineName & "\" & sMachineName & ".ini"
' Leggo estensione del file programma pezzo
GetPrivateProfileString(S_PARTPROGRAM, K_EXTENSION, "xpi", m_sIsoFileExt, sMachIniFile)
' per gestione canali separati (macchina NUM con più di 5 Assi) ver. 2.5g1
GetPrivateProfileString(S_PARTPROGRAM, K_EXTFILECN, ".0", m_sExtFileCN, sMachIniFile)
If m_sIsoFileExt(0) <> "." Then m_sIsoFileExt = "." & m_sIsoFileExt
' Leggo flag incremento asse C
m_dDeltaC = GetPrivateProfileDouble(S_AXES, K_DELTA_C, 0.0, sMachIniFile)
@@ -1153,6 +1178,13 @@ Public Class CurrentMachine
GetPrivateProfileString(S_PRODUCTIONLINE, K_PRODLIPROBINGTCPOS2VAR, "0", m_sProdLiProbingTcPos2Var, sMachIniFile)
GetPrivateProfileString(S_PRODUCTIONLINE, K_PRODLISAWDIAMETER2VAR, "", m_sProdLiSawDiameter2Var, sMachIniFile)
GetPrivateProfileString(S_POLISHLINE, K_CLICKSTATE, "", m_sClickState, sMachIniFile)
GetPrivateProfileString(S_POLISHLINE, k_CLICKDIR, "", m_sClickDir, sMachIniFile)
If Not Directory.Exists(m_sClickDir) Then
m_sClickState = ""
EgtOutLog("Directory " & m_sClickDir & " does not exist")
End If
' Leggo configurazione degli utensili in macchina
m_MountedToolConfig = GetPrivateProfileInt(S_TOOLS, K_MOUNTEDTOOLCONFIG, 0, sMachIniFile)
' Leggo flag presenza tipologie utensili
+90 -77
View File
@@ -7,110 +7,123 @@
mc:Ignorable="d"
d:DesignHeight="768" d:DesignWidth="1280">
<!-- Definizione della ImportPage -->
<Border Background="{DynamicResource OmagCut_Gray}" >
<!-- Definizione della ImportPage -->
<Border Background="{DynamicResource OmagCut_Gray}" >
<Grid Name="ImportPageGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="7.5*"/>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="4.5*"/>
</Grid.RowDefinitions>
<Grid Name="ImportPageGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="7.5*"/>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="4.5*"/>
</Grid.RowDefinitions>
<GroupBox Name="CNModeGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.ColumnSpan="2" Margin="0,0,4,0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="1.5*"/>
</Grid.ColumnDefinitions>
<GroupBox Name="CNModeGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.ColumnSpan="2" Margin="0,0,4,0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="1.5*"/>
</Grid.ColumnDefinitions>
<ToggleButton Name="AutoBtn" Grid.Column="0"
<ToggleButton Name="AutoBtn" Grid.Column="0"
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}"
Foreground="White"/>
<ToggleButton Name="ManualBtn" Grid.Column="1"
<ToggleButton Name="ManualBtn" Grid.Column="1"
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}"
Foreground="White"/>
<ToggleButton Name="MDIBtn" Grid.Column="2"
<ToggleButton Name="MDIBtn" Grid.Column="2"
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}"
Foreground="White"/>
<ToggleButton Name="SingleBtn" Grid.Column="3"
<ToggleButton Name="SingleBtn" Grid.Column="3"
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}"
Foreground="White"/>
<ToggleButton Name="HomeBtn" Grid.Column="4"
<ToggleButton Name="HomeBtn" Grid.Column="4"
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}"
Foreground="White"/>
</Grid>
</Grid>
</GroupBox>
</GroupBox>
<GroupBox Name="CommandsGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="2" Grid.ColumnSpan="2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<GroupBox Name="CommandsGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="2" Grid.ColumnSpan="2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<Button Name="StartBtn" Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
<Button Name="StopBtn" Grid.Column="1"
<Button Name="StartBtn" Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
<Button Name="StopBtn" Grid.Column="1"
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
<Button Name="ResetBtn" Grid.Column="2"
<Button Name="ResetBtn" Grid.Column="2"
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
</Grid>
</Grid>
</GroupBox>
</GroupBox>
<GroupBox Name="MDICommandGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Row="1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="6*"/>
<ColumnDefinition Width="1.5*"/>
</Grid.ColumnDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="6*"/>
<ColumnDefinition Width="1.5*"/>
</Grid.ColumnDefinitions>
<EgtWPFLib:EgtTextBox Name="MDITxBx" Margin="10,0,10,0" Style="{DynamicResource OmagCut_MDIKeyboardTextBox}"/>
<Button Name="MDIConfirmBtn" Grid.Column="1"
<Button Name="MDIConfirmBtn" Grid.Column="1"
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
</Grid>
</Grid>
</GroupBox>
</GroupBox>
<GroupBox Name="PartProgTransferGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Row="2"
<GroupBox Name="CameraHQ" Style="{DynamicResource OmagCut_GroupBox}" Grid.Row="1" Grid.Column="2" Grid.ColumnSpan="2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<ToggleButton Name="CameraHQBtn" Grid.Column="2"
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}"
Foreground="White"/>
</Grid>
</GroupBox>
<GroupBox Name="PartProgTransferGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Row="2"
Grid.ColumnSpan="3">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<Button Name="DownloadBtn" Grid.Column="0"
<Button Name="DownloadBtn" Grid.Column="0"
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
<Button Name="UploadBtn" Grid.Column="1"
<Button Name="UploadBtn" Grid.Column="1"
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
<Button Name="ActivateBtn" Grid.Column="2"
<Button Name="ActivateBtn" Grid.Column="2"
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
<Button Name="DeleteBtn" Grid.Column="3"
<Button Name="DeleteBtn" Grid.Column="3"
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
<EgtWPFLib:EgtTextBox Name="DULoadTxBx" Grid.Column="4" Width="100" Text="900.0"
<EgtWPFLib:EgtTextBox Name="DULoadTxBx" Grid.Column="4" Width="100" Text="900.0"
Style="{DynamicResource OmagCut_KeyboardTextBox}"/>
</Grid>
</GroupBox>
</Grid>
</GroupBox>
<GroupBox Name="PowerGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Row="2"
Grid.Column="3" Grid.ColumnSpan="3" Margin="5,0,0,0">
@@ -131,18 +144,18 @@
</GroupBox>
<GroupBox Name="ErrorLstGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Row="3" Grid.ColumnSpan="4">
<ListBox Name="ErrorLstBx">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<ListBox Name="ErrorLstBx">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</GroupBox>
</GroupBox>
</Grid>
</Grid>
</Border>
</Border>
</UserControl>
+36
View File
@@ -29,6 +29,7 @@ Public Class MachineCNPageUC
MDICommandGpBx.Header = EgtMsg(MSG_MACHINECNPAGEUC + 16)
PartProgTransferGpBx.Header = EgtMsg(MSG_MACHINECNPAGEUC + 17)
ErrorLstGpBx.Header = EgtMsg(MSG_ALARMSPAGEUC + 12)
' Attivo gruppo PartProgTransferGpBx leggendo la variabile nel file ini
If GetPrivateProfileInt(S_GENERAL, K_TESTINGPAGE, 0, m_MainWindow.GetIniFile()) = 1 Then
PartProgTransferGpBx.Visibility = Windows.Visibility.Visible
@@ -44,6 +45,27 @@ Public Class MachineCNPageUC
Else
PowerGpBx.Visibility = Visibility.Collapsed
End If
' verifico che sia attiva la modalità per l'uso di due fotocamere
If GetPrivateProfileInt(S_CAMERAHQ, K_CAMERAHQ_ENABLE, 0, m_MainWindow.GetMachIniFile()) = 1 Then
CameraHQ.Header = "Photo on table"
CameraHQBtn.Content = "HQ"
' verifico quale camera è impostata
If GetPrivateProfileInt(S_CAMERAHQ, K_CAMERAHQ_ACTIVATE, 0, m_MainWindow.GetMachIniFile()) = 1 Then
CameraHQBtn.IsChecked = True
If Not IsNothing(m_MainWindow.m_CadCutPageUC.PhotoIMG) Then
m_MainWindow.m_CadCutPageUC.PhotoIMG.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/NewIcons/icone-tagli-1HQ.png", UriKind.Relative))
End If
Else
CameraHQBtn.IsChecked = False
If Not IsNothing(m_MainWindow.m_CadCutPageUC.PhotoIMG) Then
m_MainWindow.m_CadCutPageUC.PhotoIMG.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/NewIcons/icone-tagli-1.png", UriKind.Relative))
End If
End If
Else
CameraHQ.Visibility = Visibility.Collapsed
End If
End Sub
Private Sub TestingPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
@@ -203,6 +225,20 @@ Public Class MachineCNPageUC
m_CN.DGeneralFunctions_WriteCncMode(8)
End Sub
Private Sub CameraHQBtn_Click(sender As Object, e As RoutedEventArgs) Handles CameraHQBtn.Click
Dim sEnableHQ As String = If(CameraHQBtn.IsChecked, "1", "0")
WritePrivateProfileString(S_CAMERAHQ, K_CAMERAHQ_ENABLE, sEnableHQ, m_MainWindow.GetMachIniFile())
If CameraHQBtn.IsChecked Then
If Not IsNothing(m_MainWindow.m_CadCutPageUC.PhotoIMG) Then
m_MainWindow.m_CadCutPageUC.PhotoIMG.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/NewIcons/icone-tagli-1HQ.png", UriKind.Relative))
End If
Else
If Not IsNothing(m_MainWindow.m_CadCutPageUC.PhotoIMG) Then
m_MainWindow.m_CadCutPageUC.PhotoIMG.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/NewIcons/icone-tagli-1.png", UriKind.Relative))
End If
End If
End Sub
Private Sub MDITxBx_KeyDown(sender As Object, e As KeyEventArgs) Handles MDITxBx.KeyDown
If e.Key = Key.Return Then
' leggo se stato reset
+1 -1
View File
@@ -53,7 +53,7 @@
</ToggleButton>
</Grid>
<Button Grid.Column="2" Style="{DynamicResource OmagCut_BlueIconButton}" Click="ExitBtn_Click">
<Button Name="ExitBtn" Grid.Column="2" Style="{DynamicResource OmagCut_BlueIconButton}" Click="ExitBtn_Click">
<Image Source="{DynamicResource XImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
</Button>
+54 -39
View File
@@ -100,6 +100,7 @@ Class MainWindow
OFFICE_TYPE = 2 ^ 19 ' 524288
REGISTRATION = 2 ^ 20 ' 1048576
SIMPLESTATISTICS = 2 ^ 21 ' 2097152
COMPOFRAME = 2 ^ 22 ' 4194304
End Enum
' Opzione nesting automatico
Private m_bAutoNest As Boolean = False
@@ -323,13 +324,13 @@ Class MainWindow
Dim sNestKey As String = ""
EgtUILib.GetPrivateProfileString(S_LICENCE, K_NESTKEY, "", sNestKey, sLicFile)
EgtSetNestKey(sNestKey)
Dim bNetHwKey As Boolean = ( GetPrivateProfileInt(S_GENERAL, K_NETKEY, 0, m_sIniFile) = 1)
EgtSetNetHwKey( bNetHwKey)
Dim bNetHwKey As Boolean = (GetPrivateProfileInt(S_GENERAL, K_NETKEY, 0, m_sIniFile) = 1)
EgtSetNetHwKey(bNetHwKey)
' Verifico abilitazione nesting automatico
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
' Recupero opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2505, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2505, 1, m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2507, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2507, 1, m_nKeyOptions)
' Verifico abilitazione prodotto
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
' Inizializzazione generale di EgtInterface
@@ -439,7 +440,7 @@ Class MainWindow
' abilito il bottone per la gestione del comando di Check-Up-Start (posziona lama prelavorazione)
If GetPrivateProfileInt(S_GENERAL, "Test", "0", m_sIniFile) = 0 OrElse
Not File.Exists( m_CurrentMachine.sMachDir() & "\DirectCmd\TestWork.lua") Then
Not File.Exists(m_CurrentMachine.sMachDir() & "\DirectCmd\TestWork.lua") Then
m_CadCutPageUC.m_ProjectMgr.TestBtn.Visibility = Visibility.Collapsed
Else
m_CadCutPageUC.m_ProjectMgr.TestBtn.Visibility = Visibility.Visible
@@ -553,14 +554,14 @@ Class MainWindow
' è permessa una sola istanza alla volta del programma OmagCUT -> "(1)" : "(" & nIstance.ToString & ")"
EgtPHOTOLib.MainData.SetUser(Environment.MachineName & "\" & Environment.UserName & " (1)")
Dim sIdKey As String = String.Empty
EgtGetKeyInfo(sIdKey)
EgtPHOTOLib.MainData.SetKey(sIdKey)
End If
Dim sIdKey As String = String.Empty
EgtGetKeyInfo(sIdKey)
EgtPHOTOLib.MainData.SetKey(sIdKey)
End If
End If
End If
' --------------------------------- SLAB DB -------------------------------------------------------
ExitBtn.ToolTip = "Exit" & vbCrLf & "Minimize (Shift)"
End Sub
Private Sub ManageSingleIstance()
@@ -997,6 +998,16 @@ Class MainWindow
' Se già visualizzato errore, lo nascondo
If m_CurrentProjectPageUC.OutMessageBrd.IsMouseOver Then
m_CurrentProjectPageUC.ClearMessage()
' se è premuto il pulsante Shift allora provvedo ad aprire il file di Log
If Keyboard.Modifiers And ModifierKeys.Shift Then
' Genero file CNC (lancio anche se errore in precedenza)
Dim sTemoDirect As String = GetTempDir() & "\OmagCUTLog.txt"
Try
Process.Start("Notepad.exe", sTemoDirect)
Catch ex As Exception
EgtOutLog(ex.ToString)
End Try
End If
End If
' Condizioni che impediscono di clickare fuori dalla calcolatrice o tastiera quando una di queste è aperta
If EgtWPFLib.EgtCalculator.GetbIsActive Then
@@ -1087,9 +1098,9 @@ Class MainWindow
m_CurrentProjectPageUC.SaveNamedProject()
m_CurrentProjectPageUC.SaveProject()
End If
' Inizio la chiusura del programma (verifico di aver terminato il processo DripFeed)
' Inizio la chiusura del programma (se NUM_OLD verifico di aver terminato il processo DripFeed)
EgtOutLog("Iniziato processo di chiusura programma")
m_IsClosingApplication = 1
m_IsClosingApplication = If( m_CNCommunication.m_nNCType = 1, 1, 2)
Dim nCount As Integer = 0
While m_IsClosingApplication <> 2
If nCount > 5 Then
@@ -1216,7 +1227,7 @@ Class MainWindow
Private Sub MainWindow_ContentRendered(sender As Object, e As EventArgs) Handles Me.ContentRendered
' Verifico presenza del collegamento al CN
m_bNCLink = (GetPrivateProfileInt(S_GENERAL, K_CNLINK, 0, m_sIniFile) <> 0) And
Not GetKeyOption( KEY_OPT.OFFICE_TYPE)
Not GetKeyOption(KEY_OPT.OFFICE_TYPE)
m_CNCommunication.CNCommunication_Initialization()
' Se linea di produzione abilitata e collegata, lancio relativo timer
If m_bNCLink And m_CurrentMachine.bProdLine Then
@@ -1293,7 +1304,9 @@ Class MainWindow
m_CNCommunication.m_CN.ReadEls_Add_Parameter(m_CurrentMachine.sVarProjFinished, 1)
Dim nVarFin As Integer = 0
For I As Integer = 1 To 4
System.Threading.Thread.Sleep(50)
If Not m_CurrentMachine.bDemo Then
System.Threading.Thread.Sleep(50)
End If
If m_CNCommunication.m_CN.n_DReadELS_handle = 1 Then
nVarFin = CInt(m_CNCommunication.m_CN.d_DReadELS_value)
Exit For
@@ -1306,11 +1319,11 @@ Class MainWindow
' Salvo in INI indice del progetto terminato
WritePrivateProfileString(S_GENERAL, K_LASTPROJFINISHED, nVarFin.ToString("D4"), GetIniFile())
' Salvo in INI data e ora attuali di termine lavorazione del progetto (solo gli ultimi 10 tramite modulo)
Dim sKey As String = K_DATETIMEFINISHED & "." & ( nVarFin Mod 10).ToString()
Dim sKey As String = K_DATETIMEFINISHED & "." & (nVarFin Mod 10).ToString()
Dim sDateTime As String = My.Computer.Clock.LocalTime.ToString("dd.MM.yyyy HH\:mm\:ss")
WritePrivateProfileString(S_GENERAL, sKey, sDateTime, GetIniFile())
' Eseguo script
ExecFinishedProgScript( nVarFin, sDateTime)
ExecFinishedProgScript(nVarFin, sDateTime)
End If
End If
' Se OmagVIEW blocca, esco (riproverò al prossimo giro)
@@ -1346,16 +1359,18 @@ Class MainWindow
' Se richieste modalità standard o speciali
If m_CurrentMachine.nSaveProduced <> 3 Then
StandardAndSpecialViewFileManagement()
' altrimenti modalità custom
' altrimenti modalità custom
Else
CustomViewFileManagement( nProjInd)
CustomViewFileManagement(nProjInd)
End If
' Leggo variabile con indice progetto da copiare per OmagVIEW (standard E80025)
m_CNCommunication.m_CN.n_DReadELS_handle = 0
m_CNCommunication.m_CN.ReadEls_Add_Parameter(m_CurrentMachine.sVarProjCopy, 1)
Dim nVarCopy As Integer = 0
For I As Integer = 1 To 10
System.Threading.Thread.Sleep(50)
If Not m_CurrentMachine.bDemo Then
System.Threading.Thread.Sleep(50)
End If
If m_CNCommunication.m_CN.n_DReadELS_handle = 1 Then
nVarCopy = CInt(m_CNCommunication.m_CN.d_DReadELS_value)
Exit For
@@ -1556,7 +1571,7 @@ Class MainWindow
nNewProjInd -= 1
End While
End If
' se altrimenti richiesto progetto successivo
' se altrimenti richiesto progetto successivo
ElseIf nMove > 0 Then
nNewProjInd = nProjInd + 1
If nProjInd > nLastProj Then
@@ -1657,7 +1672,7 @@ Class MainWindow
Catch ex As Exception
EgtOutLog("Error erasing " & sDestEplFile)
End Try
' altrimenti, ogni commessa ha il suo file dei pezzi rovinati
' altrimenti, ogni commessa ha il suo file dei pezzi rovinati
Else
' Sposto nel direttorio temporaneo
Dim sDestEplFile = m_sTempDir & "\" & CURR_PROJ_EPL
@@ -1767,7 +1782,7 @@ Class MainWindow
Return True
End Function
Private Function CustomViewFileManagement( nProjInd As Integer) As Boolean
Private Function CustomViewFileManagement(nProjInd As Integer) As Boolean
' Se non esiste file EPL, esco
Dim sSouEplFile As String = m_CurrentMachine.sLineDataDir & "\" & CURR_PROJ_EPL
If Not My.Computer.FileSystem.FileExists(sSouEplFile) Then Return True
@@ -1806,7 +1821,7 @@ Class MainWindow
' Verifico progetto restituito da View
If nProjInd = 0 Then nProjInd = nLastCopy
' Leggo variabile con data termine lavorazione
Dim sKey As String = K_DATETIMEFINISHED & "." & ( nProjInd Mod 10).ToString()
Dim sKey As String = K_DATETIMEFINISHED & "." & (nProjInd Mod 10).ToString()
GetPrivateProfileString(S_GENERAL, sKey, sDateTime, sDateTime, GetIniFile())
' Recupero direttorio per pezzi rovinati
Dim sRuPartsDir As String = GetRuinedPartsDir()
@@ -1833,7 +1848,7 @@ Class MainWindow
Return True
End Function
Friend Function ExecSentProgScript( bDirectCut As Boolean, Optional bAlreadySent As Boolean = False) As Boolean
Friend Function ExecSentProgScript(bDirectCut As Boolean, Optional bAlreadySent As Boolean = False) As Boolean
' Verifico esistenza script
Dim sLuaPath As String = m_CurrentMachine.sMachDir() & "\Scripts\SentProg.lua"
If Not My.Computer.FileSystem.FileExists(sLuaPath) Then Return True
@@ -1852,8 +1867,8 @@ Class MainWindow
End If
EgtLuaResetGlobVar("SPS")
If nErr <> 0 Then
EgtOutLog("Error in SentProg : " & nErr.ToString())
m_CurrentProjectPageUC.SetErrorMessage(EgtMsg(90325)) 'Errore nel salvataggio delle statistiche
EgtOutLog("Error in SentProg : " & nErr.ToString())
m_CurrentProjectPageUC.SetErrorMessage(EgtMsg(90325)) 'Errore nel salvataggio delle statistiche
End If
Return (nErr = 0)
End Function
@@ -1935,15 +1950,15 @@ Class MainWindow
End If
' Dichiaro progetto passato da View
If nProjInd = m_CurrentProjectPageUC.GetCurrentProject() Then
EgtSetInfo( EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_UNLOADSAVED, 1)
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_UNLOADSAVED, 1)
Else
Dim nTmpCtx As Integer = EgtInitContext()
If nTmpCtx <> 0 Then
Dim sNgeFile As String = GetSaveDir() & "\" & nProjInd.ToString("D4") & ".nge"
EgtOpenFile( sNgeFile)
EgtSetInfo( EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_UNLOADSAVED, 1)
EgtSaveFile( sNgeFile, NGE.CMPTEXT)
EgtDeleteContext( nTmpCtx)
EgtOpenFile(sNgeFile)
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_UNLOADSAVED, 1)
EgtSaveFile(sNgeFile, NGE.CMPTEXT)
EgtDeleteContext(nTmpCtx)
EgtSetCurrentContext(m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
End If
End If
@@ -1977,21 +1992,21 @@ Class MainWindow
' Evento che apre AboutBox quando viene clickato il logo
Private Sub LogoBrd_MouseDown(sender As Object, e As MouseButtonEventArgs) Handles LogoBrd.MouseDown
' Se non premuto Shift -> AboutBox
If ( Keyboard.Modifiers And ModifierKeys.Shift) = 0 Then
Dim AboutBox As New AboutBoxWD( Me)
' Altrimenti lancio cambio macchina (solo uso interno)
If (Keyboard.Modifiers And ModifierKeys.Shift) = 0 Then
Dim AboutBox As New AboutBoxWD(Me)
' Altrimenti lancio cambio macchina (solo uso interno)
Else
If m_ActivePage = Pages.CadCut Or m_ActivePage = Pages.FrameCut Then
' Cambio macchina
EgtLuaCreateGlobTable( "CHM")
EgtLuaExecFile( GetConfigDir() & "\ChangeMachine.lua")
EgtLuaCreateGlobTable("CHM")
EgtLuaExecFile(GetConfigDir() & "\ChangeMachine.lua")
Dim nRestart As Integer = 0
EgtLuaGetGlobIntVar( "CHM.RESTART", nRestart)
EgtLuaResetGlobVar( "CHM")
EgtLuaGetGlobIntVar("CHM.RESTART", nRestart)
EgtLuaResetGlobVar("CHM")
' Riavvio
If nRestart = 1 Then
Close()
Process.Start( Application.ResourceAssembly.Location)
Process.Start(Application.ResourceAssembly.Location)
End If
End If
End If
+2 -2
View File
@@ -62,5 +62,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.5.5.2")>
<Assembly: AssemblyFileVersion("2.5.5.2")>
<Assembly: AssemblyVersion("2.5.7.2")>
<Assembly: AssemblyFileVersion("2.5.7.2")>
+33 -1
View File
@@ -133,6 +133,10 @@ Public Class CNCommunication
Refresh()
End If
If Not String.IsNullOrEmpty(m_MainWindow.m_CurrentMachine.sClickState) Then
ClickOnPolishLine()
End If
m_bTimerBusy = False
m_RefreshTimer.Start()
Else
@@ -499,6 +503,33 @@ Public Class CNCommunication
End Sub
Private Sub ClickOnPolishLine()
' Se richiesto di scattare foto sulla linea di lucidatura
m_CN.n_DReadELS_handle = 0
m_CN.ReadEls_Add_Parameter(m_MainWindow.m_CurrentMachine.sClickState, 1)
Dim nClickState As Integer = 0
For I As Integer = 0 To 10
System.Threading.Thread.Sleep(50)
If m_CN.n_DReadELS_handle = 1 Then
nClickState = CInt(m_CN.d_DReadELS_value)
If nClickState = 1 Then
' procedo a costruire un nuovo file nella cartella indicata in configurazione
Try
Dim fs As FileStream = File.Create(m_MainWindow.m_CurrentMachine.sClickDir & "\NewClick.txt")
' chiudo il file creato
fs.Close()
' Dichiaro di aver provveduto a comunicare di scattare la foto
m_CN.DVariables_WriteVariables2(m_MainWindow.m_CurrentMachine.sClickState, "0")
Catch ex As Exception
EgtOutLog("Error on PolishLine comunication: " & ex.ToString)
End Try
End If
Exit For
End If
Next
End Sub
Private Sub Refresh()
If m_bNewPosData Then
@@ -1136,7 +1167,8 @@ Public Class CNCommunication
bOk = (m_nNCType > 0)
Dim sNumProg As String = String.Empty
If m_nNCType = 1 Or m_nNCType = 2 Then
sNumProg = "%" & nNumProg.ToString() & ".0"
Dim sExtFileCN As String = m_MainWindow.m_CurrentMachine.sExtFileCN
sNumProg = "%" & nNumProg.ToString() & sExtFileCN
Else
sNumProg = nNumProg.ToString()
End If
+1 -1
View File
@@ -144,7 +144,7 @@ Public Class CN_Siemens
End Select
Else
' per verificare che la comunicazione funzioni correttamente
EgtOutLog("Modo -read_active_mode-: " & M_MMFiles.SiemensRet.n_param2.ToString)
' EgtOutLog("Modo -read_active_mode-: " & M_MMFiles.SiemensRet.n_param2.ToString)
Return M_MMFiles.read_active_mode()
'Return CShort(M_MMFiles.SiemensRet.n_param2)
End If
+6
View File
@@ -1340,6 +1340,12 @@
<ItemGroup>
<Resource Include="Resources\NewIcons\RefTab.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\PhotoHQ.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\icone-tagli-1HQ.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTR32.exe
+2 -1
View File
@@ -1400,7 +1400,8 @@ Public Class CurrentProjectPageUC
Friend Sub ClearMessage()
OutMessageBrd.Background = Brushes.Transparent
OutMessageBrd.Visibility = Windows.Visibility.Hidden
OutMessageTxBl.Text = ""
'OutMessageBrd.Visibility = Windows.Visibility.Hidden
End Sub
End Class
+113
View File
@@ -1,6 +1,7 @@
Imports System.ComponentModel
Imports System.Drawing
Imports System.IO
Imports System.Windows.Forms.Integration
Imports EgtUILib
Imports EgtWPFLib
@@ -32,6 +33,7 @@ Public Class ProjectMgrUC
WorkBtn.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 2) 'Work - Lavora
End If
TestBtn.ToolTip = EgtMsg(90255) 'Test
ResetCutBtn.ToolTip = "Reset Cuts" & vbCrLf & "Reset Feed (Shift)"
End Sub
Private Sub ProjectMgrUC_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
@@ -250,6 +252,11 @@ Public Class ProjectMgrUC
End Sub
Private Sub ResetCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles ResetCutBtn.Click
If (Keyboard.Modifiers And ModifierKeys.Shift) Then
' eseguo il ricalcolo delle sole FEED di lavorazione
UpdateFeedAllMachining()
Return
End If
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
' Cancello eventuali messaggi
m_CurrProjPage.ClearMessage()
@@ -711,6 +718,112 @@ Public Class ProjectMgrUC
End While
End Sub
Public Sub UpdateFeedAllMachining()
' recupero il valore di Feed della lavorazione corrente
Dim sMachiningName As String = String.Empty
If Not EgtMdbGetCurrMachiningParam(MCH_MP.NAME, sMachiningName) Then
' errore: lavorazione non trovata
EgtOutLog(" - Prima di 'Reset Feed' accedere alla pagina MACCHINA!")
'm_MainWindow.m_CurrentProjectPageUC.SetErrorMessage("Salvare la lavorazione corrente")
Return
End If
Dim dFeed As Double = 0
EgtMdbGetCurrMachiningParam(MCH_MP.FEED, dFeed)
Dim dFeedStarted As Double = 0
EgtMdbGetCurrMachiningParam(MCH_MP.STARTFEED, dFeedStarted)
Dim dFeedEnded As Double = 0
EgtMdbGetCurrMachiningParam(MCH_MP.ENDFEED, dFeedEnded)
Dim dFeedTipped As Double = 0
EgtMdbGetCurrMachiningParam(MCH_MP.TIPFEED, dFeedTipped)
Dim dFeedBack As Double = 0
EgtMdbGetCurrMachiningParam(MCH_MP.BACKFEED, dFeedBack)
Dim dFeedSideAng As Double = 0
EgtMdbGetCurrMachiningParam(MCH_MP.SIDEANGFEED, dFeedSideAng)
Dim MachiningList As New List(Of SplitMach)
' Recupero l'indice della fase corrente
Dim nCurrPhase As Integer = 1
' recupero in numero di fasi presenti nel progetto
Dim nCountPhase As Integer = EgtGetPhaseCount()
' ciclo su tutte le fasi di lavorazione
Dim nMach As Integer = 0
Dim nMachUpdated As Integer = 0
For IndexPhase As Integer = 1 To nCountPhase
' imposto la fase corrente
nCurrPhase = IndexPhase
' Preparo la lista delle lavorazioni
CalculateSplitMachList(nCurrPhase, MachiningList)
' per ogni lavorazione corrente procedo ad aggiornare la feed
For IndexMachining As Integer = 0 To MachiningList.Count - 1
nMach += 1
Dim nOperId As Integer = MachiningList(IndexMachining).m_nId
' setto la lavorazione come corrente
If EgtSetCurrMachining(nOperId) Then
Dim bUpdate As Boolean = False
' STANDARD
Dim dOrigFeed As Double
EgtGetMachiningParam(MCH_MP.FEED, dOrigFeed)
' imposto il valore di Feed solo se differente da quello nuovo
If Math.Abs(dOrigFeed - dFeed) > 0.1 Then
bUpdate = bUpdate Or EgtSetMachiningParam(MCH_MP.FEED, dFeed)
' aggiorno la lavorazione (senza il ricalcolo dell'intera lavorazione)
EgtApplyMachining(True)
End If
' STARTED
Dim dOrigFeedStarted As Double
EgtGetMachiningParam(MCH_MP.STARTFEED, dOrigFeedStarted)
' imposto il valore di Feed solo se differente da quello nuovo
If Math.Abs(dOrigFeedStarted - dFeedStarted) > 0.1 Then
bUpdate = bUpdate Or EgtSetMachiningParam(MCH_MP.STARTFEED, dFeedStarted)
' aggiorno la lavorazione (senza il ricalcolo dell'intera lavorazione)
EgtApplyMachining(True)
End If
' ENDED
Dim dOrigFeedEnded As Double
EgtGetMachiningParam(MCH_MP.ENDFEED, dOrigFeedEnded)
' imposto il valore di Feed solo se differente da quello nuovo
If Math.Abs(dOrigFeedEnded - dFeedEnded) > 0.1 Then
bUpdate = bUpdate Or EgtSetMachiningParam(MCH_MP.ENDFEED, dFeedEnded)
' aggiorno la lavorazione (senza il ricalcolo dell'intera lavorazione)
EgtApplyMachining(True)
End If
' TIPPED
Dim dOrigFeedTipped As Double
EgtGetMachiningParam(MCH_MP.TIPFEED, dOrigFeedTipped)
' imposto il valore di Feed solo se differente da quello nuovo
If Math.Abs(dOrigFeedTipped - dFeedTipped) > 0.1 Then
bUpdate = bUpdate Or EgtSetMachiningParam(MCH_MP.TIPFEED, dFeedTipped)
' aggiorno la lavorazione (senza il ricalcolo dell'intera lavorazione)
EgtApplyMachining(True)
End If
' BACK
Dim dOrigFeedBack As Double
EgtGetMachiningParam(MCH_MP.BACKFEED, dOrigFeedBack)
' imposto il valore di Feed solo se differente da quello nuovo
If Math.Abs(dOrigFeedBack - dFeedBack) > 0.1 Then
bUpdate = bUpdate Or EgtSetMachiningParam(MCH_MP.BACKFEED, dFeedBack)
' aggiorno la lavorazione (senza il ricalcolo dell'intera lavorazione)
EgtApplyMachining(True)
End If
' SIDEANG
Dim dOrigFeedSideAng As Double
EgtMdbGetCurrMachiningParam(MCH_MP.SIDEANGFEED, dOrigFeedSideAng)
' imposto il valore di Feed solo se differente da quello nuovo
If Math.Abs(dOrigFeedBack - dFeedSideAng) > 0.1 Then
bUpdate = bUpdate Or EgtSetMachiningParam(MCH_MP.SIDEANGFEED, dFeedSideAng)
' aggiorno la lavorazione (senza il ricalcolo dell'intera lavorazione)
EgtApplyMachining(True)
End If
' conto il numero di lavorazioni aggiornate
If bUpdate Then
nMachUpdated += 1
End If
End If
Next
Next
m_MainWindow.m_CurrentProjectPageUC.SetInfoMessage("Lavorazione aggiornate: " & nMachUpdated & "/ " & nMach)
End Sub
' ------------------------------------------------ GENERA COMANDI CNC MOVIMENTO ------------------------------------------------
Private Sub ExecuteCommandCNC(ptMid As Point3d, dAngC As Double, dAngB As Double)
+16
View File
@@ -205,6 +205,12 @@ Public Class Camera
Dim nInd As Integer = 1
If m_nCameraCount = 2 Then
nInd = GetCurrentTable()
' verifico se la macchina è configurata per fotocamera sulla tavola di lavoro
If (GetPrivateProfileInt(S_CAMERAHQ, K_CAMERAHQ_ENABLE, 0, m_MainWindow.GetMachIniFile()) <> 0) AndAlso
(GetPrivateProfileInt(S_CAMERAHQ, K_CAMERAHQ_ACTIVATE, 0, m_MainWindow.GetMachIniFile()) <> 0) Then
' forzo l'utilizzo della seconda camera (sopra alla tavola di lavoro)
nInd = 2
End If
If nInd <> 1 And nInd <> 2 Then Return 0
End If
' Se gestore macchina non attivo, lo lancio in modo cieco
@@ -315,6 +321,16 @@ Public Class Camera
GetPrivateProfileString(S_NCDATA, K_SPOTLIGHT2, "", sPLCVarSpotLight2, m_MainWindow.GetMachIniFile())
Dim nPhotoDeley As Integer = GetPrivateProfileInt(S_NCNUM, K_PHOTODELEY, "100", m_MainWindow.GetMachIniFile())
' eventualmente rimuovo inizio stringa: "PLC, ___"
Dim sItemString1() As String = Split(sPLCVarSpotLight1, ","c)
If sItemString1.Count > 1 Then
sPLCVarSpotLight1 = sItemString1(1).Trim
End If
Dim sItemString2() As String = Split(sPLCVarSpotLight2, ","c)
If sItemString2.Count > 1 Then
sPLCVarSpotLight2 = sItemString2(1).Trim
End If
Select Case m_MainWindow.m_CNCommunication.m_nNCType
Case 1, 2
If m_MainWindow.m_CNCommunication.m_nNCType = 2 Then
+7 -1
View File
@@ -1420,7 +1420,7 @@ Public Class RawPartPageUC
Dim nExit As Integer = 0
EgtGetCalcTool(sTool, sHead, nExit)
' Imposto come testa corrente il laser (senza utensile ovviamente)
If Not EgtSetCalcTool("", "H3", 1) Then
If Not EgtSetCalcTool("", LASER_HEAD, 1) Then
Return False
End If
' Trasformo in posizione punta utensile in basso
@@ -1432,6 +1432,10 @@ Public Class RawPartPageUC
' Porto il tip nell'origine tavola
ptAcquired = ptTipP1
ptAcquired.ToLoc(New Frame3d(m_ptTableMin))
EgtOutLog("Actual axis laser H3: L1=" & dL1.ToString & ", L2=" & dL2.ToString & ", L3=" & dL3.ToString &
", R1=" & dR1.ToString & ", R2=" & dR2.ToString)
EgtOutLog("Actual pos laser H3: " & ptTipP1.x.ToString & "," & ptTipP1.y.ToString & "," & ptTipP1.z.ToString &
"; on table: " & ptAcquired.x.ToString & "," & ptAcquired.y.ToString & "," & ptAcquired.z.ToString)
Return True
End Function
@@ -1449,6 +1453,8 @@ Public Class RawPartPageUC
EgtGetCalcTool(sTool, sHead, nExit)
' Trasformo in posizione punta utensile in basso
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, ptTipP1) Then
EgtOutLog("Actual pos " & sHead & ": L1=" & dL1.ToString & ", L2=" & dL2.ToString & ", L3=" & dL3.ToString &
", R1=" & dR1.ToString & ", R2=" & dR2.ToString)
Return False
End If
' Porto il tip nell'origine tavola
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

+45 -5
View File
@@ -567,16 +567,56 @@ Public Class SimulationPageUC
End Sub
Private Sub GenerateXPIUC_Click(sender As Object, e As RoutedEventArgs)
' eventualmente fermo la simulazione
m_nStatus = MCH_SIM_ST.UI_STOP
m_bPlay = False
PlayPauseBtn_Click(Nothing, Nothing)
' se il bottone Shift è premuto apro il file CadCut1 nel programma NotePad
Dim IsPressedShiftKey As Boolean = False
If Keyboard.Modifiers And ModifierKeys.Shift Then
IsPressedShiftKey = True
End If
' eventualmente fermo la simulazione
m_nStatus = MCH_SIM_ST.UI_STOP
m_bPlay = False
PlayPauseBtn_Click(Nothing, Nothing)
' Se nella pagina di tagli diretti
If m_MainWindow.DirectCutBtn.IsChecked And Not m_MainWindow.CadCutBtn.IsChecked Then
' Genero file CNC (lancio anche se errore in precedenza)
Dim sCncPathDirect As String = m_MainWindow.GetCncDir() & "\DirectCut" & m_MainWindow.m_CurrentMachine.sIsoFileExt
Dim bOkDirect As Boolean = EgtGenerate(sCncPathDirect, "OmagCut ver." & m_MainWindow.GetVersion())
' Costringo ad aggiornare UI
UpdateUI()
' Ripristino come fase corrente quella iniziale
EgtSetCurrPhase(1)
If bOkDirect Then
m_CurrProjPage.SetInfoMessage("Genarato file " & "DirectCut" & m_MainWindow.m_CurrentMachine.sIsoFileExt)
Else
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
End If
' procedo all'apertura del file CadCut1 apenna generato (solo se generazione corretta)
If bOkDirect And IsPressedShiftKey Then
Try
Process.Start("Notepad.exe", sCncPathDirect)
Catch ex As Exception
EgtOutLog(ex.ToString)
End Try
End If
' ricarico la pagina di simulazione
EgtSetCurrPhase(1)
' nascondo i pezzi in parcheggio
HideParkedParts(True)
' Avvio ambiente di simulazione
EgtSimInit()
EgtSimStart()
' Imposto stato corrente
SetStatus(MCH_SIM_ST.UI_STOP)
m_bPlay = True
' Costringo ad aggiornare UI
UpdateUI()
' esco
Return
End If
Dim bOk As Boolean = True
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
' Elimino eventuale attrezzaggio da OmagOFFICE