Compare commits
103 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2c0afccbe3 | |||
| 27b13292cf | |||
| 7b9d99a9c6 | |||
| 1e2b4bed27 | |||
| 4ecf7980ce | |||
| 82157d3b6e | |||
| 6dbf4f5ccb | |||
| a55ab4f83d | |||
| fd89a6cf3b | |||
| b505b79d9a | |||
| b1313ddb55 | |||
| f3889ede24 | |||
| 5ca010ae4a | |||
| 391d25507e | |||
| c954f364e3 | |||
| 1ab6d2746f | |||
| 41de0516c8 | |||
| dec4c0d312 | |||
| 834f3afe1c | |||
| e6c95323fb | |||
| fa6e5b520f | |||
| aefc037cd9 | |||
| c475f7dc12 | |||
| c5f3d4fcfb | |||
| a04e2cbe62 | |||
| da980a649e | |||
| 4c282d7531 | |||
| a941f963c2 | |||
| eab341d7fe | |||
| 9c7d60d307 | |||
| a7adcdcaca | |||
| acb8ceed4d | |||
| 65d8f58b45 | |||
| 07cf7ced42 | |||
| b1410ca11c | |||
| 1975f46995 | |||
| 6863186e07 | |||
| b434f80030 | |||
| 0151cd8f9e | |||
| 75e3729216 | |||
| ef1aef12ed | |||
| 959fb2e44f | |||
| 59e3ae5841 | |||
| 941e7837be | |||
| 58de5d4077 | |||
| b6beef668d | |||
| 680505af10 | |||
| b0bfa67d2a | |||
| 29d8c1e29b | |||
| e5d4f223f8 | |||
| 3cfc7276c9 | |||
| 0c0233b27e | |||
| 4e8925515d | |||
| 3b552b2f4e | |||
| 3fae33404b | |||
| 0d4d853834 | |||
| 37fcbe8240 | |||
| 4393f282b7 | |||
| 6844a8c77c | |||
| 659405c52f | |||
| efafacf6ca | |||
| 6905a8d6dc | |||
| d8ba23894e | |||
| aba1572f95 | |||
| fdb0ed598b | |||
| 4cb3518346 | |||
| 56b8ee88d3 | |||
| d0439f2b05 | |||
| 07d8145d57 | |||
| 652c396933 | |||
| 997e8c380d | |||
| 8d363b8b06 | |||
| 7ecad4c218 | |||
| d49c231541 | |||
| 8d82058e49 | |||
| d6a9cac6b4 | |||
| 4ce898c25c | |||
| 6f59cddd80 | |||
| c8b018f6df | |||
| 36a1ecb509 | |||
| e287e827c4 | |||
| 68e9a9201d | |||
| 0eaebd5aad | |||
| 8946bf3a00 | |||
| aeb0be0590 | |||
| a15acb6528 | |||
| e7e9d26b75 | |||
| b48d4900ea | |||
| d9de23daca | |||
| ad5c9331ba | |||
| b67330b509 | |||
| ca66108145 | |||
| 379ccc7519 | |||
| b751c27773 | |||
| 14e1c254f0 | |||
| 6f08e5f520 | |||
| 7d8933cc39 | |||
| 2179996bff | |||
| 316bcc89ea | |||
| ce151e5db7 | |||
| b303fe2615 | |||
| 3e0d43c1d8 | |||
| 70b1822446 |
+19
-2
@@ -1,4 +1,5 @@
|
|||||||
Imports EgtUILib
|
Imports System.Windows.Forms.Integration
|
||||||
|
Imports EgtUILib
|
||||||
|
|
||||||
Friend Module CamAuto
|
Friend Module CamAuto
|
||||||
|
|
||||||
@@ -29,7 +30,7 @@ Friend Module CamAuto
|
|||||||
Return bOk
|
Return bOk
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Friend Function AddWaterJetMachining( nOperId As Integer, ByRef nWarn As Integer) As Boolean
|
Friend Function AddWaterJetMachining(nOperId As Integer, ByRef nWarn As Integer) As Boolean
|
||||||
EgtLuaCreateGlobTable("CAM")
|
EgtLuaCreateGlobTable("CAM")
|
||||||
SetLuaStandardCamParams()
|
SetLuaStandardCamParams()
|
||||||
EgtLuaSetGlobIntVar("CAM.OPERID", nOperId)
|
EgtLuaSetGlobIntVar("CAM.OPERID", nOperId)
|
||||||
@@ -163,6 +164,22 @@ Friend Module CamAuto
|
|||||||
Return bOk
|
Return bOk
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Friend Function ResetAllRawPart() As Boolean
|
||||||
|
Dim nPhase As Integer = 1
|
||||||
|
Dim nOtherRaw As Integer = EgtGetFirstRawPart()
|
||||||
|
While nOtherRaw <> GDB_ID.NULL
|
||||||
|
' se il pezzo non appartiene alla prima fase allora viene eliminato
|
||||||
|
If Not EgtVerifyRawPartPhase(nOtherRaw, nPhase) Then
|
||||||
|
Dim NextRaw As Integer = EgtGetNextRawPart(nOtherRaw)
|
||||||
|
EgtRemoveRawPart(nOtherRaw)
|
||||||
|
nOtherRaw = NextRaw
|
||||||
|
Else
|
||||||
|
nOtherRaw = EgtGetNextRawPart(nOtherRaw)
|
||||||
|
End If
|
||||||
|
End While
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
' verifico che il contorno passato non sia stato separato
|
' verifico che il contorno passato non sia stato separato
|
||||||
Friend Function VerifyOutLoopIsClosed(nIdLayerOutLoop As Integer)
|
Friend Function VerifyOutLoopIsClosed(nIdLayerOutLoop As Integer)
|
||||||
Dim nIdMy As Integer = EgtGetFirstInGroup(nIdLayerOutLoop)
|
Dim nIdMy As Integer = EgtGetFirstInGroup(nIdLayerOutLoop)
|
||||||
|
|||||||
@@ -132,13 +132,16 @@
|
|||||||
VerticalAlignment="Center" />
|
VerticalAlignment="Center" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
|
<!--Gestione sfridi-->
|
||||||
<Button Name="RemovePartBtn" Grid.ColumnSpan="2" Grid.Row="6"
|
<Button Name="RemovePartBtn" Grid.ColumnSpan="2" Grid.Row="6"
|
||||||
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||||
|
|
||||||
<Button Name="ScrapsBtn" Grid.Column="3" Grid.Row="6"
|
<Button Name="ScrapsBtn" Grid.Column="3" Grid.Row="6"
|
||||||
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||||
|
|
||||||
|
<!--Gestione scarico pezzi-->
|
||||||
|
<Button Name="UnloadPartsBtn" Grid.ColumnSpan="2" Grid.Row="7"
|
||||||
|
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||||
|
|
||||||
<Grid Grid.Row="7" Grid.ColumnSpan="3">
|
<Grid Grid.Row="7" Grid.ColumnSpan="3">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
|
|||||||
+285
-54
@@ -1,4 +1,5 @@
|
|||||||
Imports EgtUILib
|
Imports System.Windows.Forms.Integration
|
||||||
|
Imports EgtUILib
|
||||||
|
|
||||||
Public Class MoveRawPartPage
|
Public Class MoveRawPartPage
|
||||||
' Riferimento alla MainWindow
|
' Riferimento alla MainWindow
|
||||||
@@ -35,12 +36,16 @@ Public Class MoveRawPartPage
|
|||||||
Private m_ScrapsVisibility As Visibility = Visibility.Visible
|
Private m_ScrapsVisibility As Visibility = Visibility.Visible
|
||||||
Private m_CurrRawOnVacuum As Integer = GDB_ID.NULL
|
Private m_CurrRawOnVacuum As Integer = GDB_ID.NULL
|
||||||
|
|
||||||
|
' definisce se è stata inserito uno scarico
|
||||||
|
Private m_IsCurrPhaseUnloaded As Boolean = False
|
||||||
|
|
||||||
Private Sub MoveRawPartPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
Private Sub MoveRawPartPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||||
' Assegno testi
|
' Assegno testi
|
||||||
RemovePartBtn.Content = EgtMsg(MSG_MOVERAWPAGEUC + 1) 'Rimuovi
|
RemovePartBtn.Content = EgtMsg(MSG_MOVERAWPAGEUC + 1) 'Rimuovi
|
||||||
ModifyBtn.Content = EgtMsg(MSG_SPLITPAGEUC + 17) 'Modifica
|
ModifyBtn.Content = EgtMsg(MSG_SPLITPAGEUC + 17) 'Modifica
|
||||||
ResetBtn.Content = EgtMsg(MSG_NESTPAGEUC + 6) 'Reset
|
ResetBtn.Content = EgtMsg(MSG_NESTPAGEUC + 6) 'Reset
|
||||||
ScrapsBtn.Content = "Add Scraps"
|
ScrapsBtn.Content = "Add Scraps"
|
||||||
|
UnloadPartsBtn.Content = "Move part"
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub MoveRawPartPage_Loaded(sender As Object, e As EventArgs) Handles Me.Loaded
|
Private Sub MoveRawPartPage_Loaded(sender As Object, e As EventArgs) Handles Me.Loaded
|
||||||
@@ -60,7 +65,12 @@ Public Class MoveRawPartPage
|
|||||||
End If
|
End If
|
||||||
' Deseleziono tutto
|
' Deseleziono tutto
|
||||||
EgtDeselectAll()
|
EgtDeselectAll()
|
||||||
' Recupero i tagli allungati prima definiti
|
' resetto variabili di navigazione nelle fasi
|
||||||
|
m_bPrev = False
|
||||||
|
m_bToNext = False
|
||||||
|
|
||||||
|
'---------------------------- CREATE NEW PHASE ----------------------------
|
||||||
|
' Recupero i tagli ABILITATI prima definiti
|
||||||
Dim Cuts(0) As Integer
|
Dim Cuts(0) As Integer
|
||||||
m_SplitPage.GetEnabledCuts(Cuts)
|
m_SplitPage.GetEnabledCuts(Cuts)
|
||||||
' Fase precedente
|
' Fase precedente
|
||||||
@@ -69,11 +79,19 @@ Public Class MoveRawPartPage
|
|||||||
Dim vNewRaws As New List(Of Integer)
|
Dim vNewRaws As New List(Of Integer)
|
||||||
If Not m_SplitPage.m_bShow Then
|
If Not m_SplitPage.m_bShow Then
|
||||||
SplitRawParts(nPrevPhase, Cuts, vNewRaws)
|
SplitRawParts(nPrevPhase, Cuts, vNewRaws)
|
||||||
|
m_IsCurrPhaseUnloaded = False
|
||||||
Else
|
Else
|
||||||
EgtSetCurrPhase(nPrevPhase + 1)
|
nPrevPhase = nPrevPhase + 1
|
||||||
|
EgtSetCurrPhase(nPrevPhase)
|
||||||
HideAllMachinings()
|
HideAllMachinings()
|
||||||
|
' verifico se la fase corrente è di tipo scarico frontale
|
||||||
|
m_nCurrDisposition = EgtGetPhaseDisposition(nPrevPhase)
|
||||||
|
If IsDispUnloadOnAuxTab(m_nCurrDisposition) Then
|
||||||
|
m_SplitPage.m_bOnAuxTab = True
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
m_nCurrPhase = EgtGetCurrPhase()
|
m_nCurrPhase = EgtGetCurrPhase()
|
||||||
|
'---------------------------- CREATE NEW PHASE ----------------------------
|
||||||
|
|
||||||
'---------------------------- SCRAPS ----------------------------
|
'---------------------------- SCRAPS ----------------------------
|
||||||
' gestione visualizzazione del comando "Scraps"
|
' gestione visualizzazione del comando "Scraps"
|
||||||
@@ -101,14 +119,19 @@ Public Class MoveRawPartPage
|
|||||||
End If
|
End If
|
||||||
'---------------------------- SCRAPS ----------------------------
|
'---------------------------- SCRAPS ----------------------------
|
||||||
|
|
||||||
|
'---------------------------- AUX TABLE ----------------------------
|
||||||
' Se movimento pezzi finale, sistemazioni per tavolo ausiliario
|
' Se movimento pezzi finale, sistemazioni per tavolo ausiliario
|
||||||
If m_SplitPage.m_bOnAuxTab Then
|
If m_SplitPage.m_bOnAuxTab And m_SplitPage.m_bEnableOnAuxTab Then
|
||||||
' assegnazione delle info tavola ausiliaria alla dispozione corrente
|
' assegnazione delle info tavola ausiliaria alla dispozione corrente (Spostato nella funzione Refresh)
|
||||||
SetAuxTabInCurrDisposition()
|
SetAuxTabInCurrDisposition()
|
||||||
|
UnloadPartsBtn.Content = "Go to MOVE part"
|
||||||
' altrimenti, aggiorno visualizzazione
|
' altrimenti, aggiorno visualizzazione
|
||||||
Else
|
ElseIf Not m_SplitPage.m_bOnAuxTab And m_SplitPage.m_bEnableOnAuxTab Then
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
|
UnloadPartsBtn.Content = "Go to UNLOAD part"
|
||||||
End If
|
End If
|
||||||
|
'---------------------------- AUX TABLE ----------------------------
|
||||||
|
|
||||||
' Carico i parametri di movimento
|
' Carico i parametri di movimento
|
||||||
m_dStep = GetPrivateProfileDouble(S_RAWMOVE, K_RAWSTEP, 50, m_MainWindow.GetIniFile())
|
m_dStep = GetPrivateProfileDouble(S_RAWMOVE, K_RAWSTEP, 50, m_MainWindow.GetIniFile())
|
||||||
' Ricavo la lunghezza del baffo di taglio
|
' Ricavo la lunghezza del baffo di taglio
|
||||||
@@ -167,6 +190,30 @@ Public Class MoveRawPartPage
|
|||||||
|
|
||||||
' aggiorno il messaggio del comando per gestire gli sfridi
|
' aggiorno il messaggio del comando per gestire gli sfridi
|
||||||
VerifyIsNewScrap(m_CurrRawOnVacuum)
|
VerifyIsNewScrap(m_CurrRawOnVacuum)
|
||||||
|
' aggiorno la visibilità dei comandi
|
||||||
|
RefreshVisibility()
|
||||||
|
' salvo l'idice della fase corrente
|
||||||
|
m_nCurrDisposition = EgtGetPhaseDisposition(m_nCurrPhase)
|
||||||
|
' Abilitazione bottone modifica
|
||||||
|
ModifyBtn.IsEnabled = m_SplitPage.m_bShow
|
||||||
|
' gestione abilitazione altri bottoni
|
||||||
|
EnableButtons()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' Gestione di visualizzazione dei comandi per il movimento dei pezzi
|
||||||
|
Private Sub RefreshVisibility()
|
||||||
|
' Aggiorno visulizzazione comando per passare alla pagina di scarico
|
||||||
|
If Not m_SplitPage.m_bEnableOnAuxTab Then
|
||||||
|
UnloadPartsBtn.Visibility = Visibility.Hidden
|
||||||
|
Else
|
||||||
|
UnloadPartsBtn.Visibility = Visibility.Visible
|
||||||
|
If m_SplitPage.m_bOnAuxTab Then
|
||||||
|
UnloadPartsBtn.Content = "Go to MOVE part"
|
||||||
|
' altrimenti, aggiorno visualizzazione
|
||||||
|
Else
|
||||||
|
UnloadPartsBtn.Content = "Go to UNLOAD part"
|
||||||
|
End If
|
||||||
|
End If
|
||||||
' Aggiorno interfaccia per taglio perpendicolare
|
' Aggiorno interfaccia per taglio perpendicolare
|
||||||
If m_bByHand Then
|
If m_bByHand Then
|
||||||
UpBtn.Visibility = Windows.Visibility.Visible
|
UpBtn.Visibility = Windows.Visibility.Visible
|
||||||
@@ -222,12 +269,6 @@ Public Class MoveRawPartPage
|
|||||||
ResetBtn.Visibility = Windows.Visibility.Visible
|
ResetBtn.Visibility = Windows.Visibility.Visible
|
||||||
ScrapsBtn.Visibility = Windows.Visibility.Hidden
|
ScrapsBtn.Visibility = Windows.Visibility.Hidden
|
||||||
End If
|
End If
|
||||||
' salvo l'idice della fase corrente
|
|
||||||
m_nCurrDisposition = EgtGetPhaseDisposition(m_nCurrPhase)
|
|
||||||
' Abilitazione bottone modifica
|
|
||||||
ModifyBtn.IsEnabled = m_SplitPage.m_bShow
|
|
||||||
' gestione abilitazione altri bottoni
|
|
||||||
EnableButtons()
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub SetAuxTabInCurrDisposition()
|
Private Sub SetAuxTabInCurrDisposition()
|
||||||
@@ -329,8 +370,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_)
|
||||||
@@ -782,6 +821,33 @@ Public Class MoveRawPartPage
|
|||||||
End While
|
End While
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
' Passo dalla pagina di movimento dei pezzi alla pagina di scarico
|
||||||
|
Private Sub UnloadPartBtn_Click() Handles UnloadPartsBtn.Click
|
||||||
|
' forzo lo stato di scarico frontale oppure di movimento
|
||||||
|
m_SplitPage.m_bOnAuxTab = Not m_SplitPage.m_bOnAuxTab
|
||||||
|
|
||||||
|
' se rientro nella fase di spostamenti allora nascondo la tavola di scarico
|
||||||
|
If Not m_SplitPage.m_bOnAuxTab Then
|
||||||
|
' se ci sono pezzi sulla tavola di scarico non posso nasconderla
|
||||||
|
Dim LclLstOfUnldPart As New List(Of Integer)
|
||||||
|
If Not PartOnAuxTab(LclLstOfUnldPart, m_nCurrPhase) Then
|
||||||
|
EgtDisableModified()
|
||||||
|
' nascondo la tavola di scarico
|
||||||
|
EgtSetStatus(m_nAuxTabId, GDB_ST.OFF)
|
||||||
|
' Nascondo eventuali pezzi in parcheggio
|
||||||
|
HideParkedParts()
|
||||||
|
EgtEnableModified()
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
' Assegnazione delle info tavola ausiliaria alla dispozione corrente
|
||||||
|
SetAuxTabInCurrDisposition()
|
||||||
|
End If
|
||||||
|
|
||||||
|
' Mantengo la fase che è stata creata e passo a gestire solo la visualizzazione dei bottoni
|
||||||
|
RefreshVisibility()
|
||||||
|
EgtZoom(ZM.ALL, True)
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Sub StepMoveTxBx_EgtClosed(sender As Object, e As EventArgs) Handles StepMoveTxBx.EgtClosed
|
Private Sub StepMoveTxBx_EgtClosed(sender As Object, e As EventArgs) Handles StepMoveTxBx.EgtClosed
|
||||||
Dim dStep As Double
|
Dim dStep As Double
|
||||||
If StringToLen(StepMoveTxBx.Text, dStep) Then
|
If StringToLen(StepMoveTxBx.Text, dStep) Then
|
||||||
@@ -823,8 +889,8 @@ Public Class MoveRawPartPage
|
|||||||
Dim ptRef As Point3d
|
Dim ptRef As Point3d
|
||||||
If Not EgtGetInfo(nRefId, "Pos", ptRef) Then Return
|
If Not EgtGetInfo(nRefId, "Pos", ptRef) Then Return
|
||||||
Dim sCorn As String = ""
|
Dim sCorn As String = ""
|
||||||
EgtGetInfo( nRefId, "COR", sCorn)
|
EgtGetInfo(nRefId, "COR", sCorn)
|
||||||
Select sCorn
|
Select Case sCorn
|
||||||
Case "TL"
|
Case "TL"
|
||||||
nCorn = MCH_CR.TL
|
nCorn = MCH_CR.TL
|
||||||
Case "TR"
|
Case "TR"
|
||||||
@@ -1009,8 +1075,44 @@ Public Class MoveRawPartPage
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Sub PauseBtn_Click(sender As Object, e As RoutedEventArgs) Handles PauseBtn.Click
|
Private Sub PauseBtn_Click(sender As Object, e As RoutedEventArgs) Handles PauseBtn.Click
|
||||||
|
' verifico la presenza di eventuali pezzi sulla tavola di scarico
|
||||||
|
Dim LclLstOfUnldPart As New List(Of Integer)
|
||||||
|
PartOnAuxTab(LclLstOfUnldPart, m_nCurrPhase)
|
||||||
|
If Not InsertPauseInCurrPhase() Then Return
|
||||||
|
AddNewPhase()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' restituisce la lista dei pezzi che sono sulla tavola di scarico nella fase indicata
|
||||||
|
Private Function PartOnAuxTab(ByRef ListOfUnloadedPatr As List(Of Integer), nPhase As Integer) As Boolean
|
||||||
|
m_IsCurrPhaseUnloaded = False
|
||||||
|
' Area tavolo ausiliario
|
||||||
|
Dim b3AuxTab As New BBox3d
|
||||||
|
EgtGetBBoxGlob(EgtGetFirstNameInGroup(m_nAuxTabId, "A1"), GDB_BB.STANDARD, b3AuxTab)
|
||||||
|
' Area pezzi
|
||||||
|
Dim nOtherRaw As Integer = EgtGetFirstRawPart()
|
||||||
|
While nOtherRaw <> GDB_ID.NULL
|
||||||
|
If EgtVerifyRawPartPhase(nOtherRaw, nPhase) Then
|
||||||
|
Dim b3OtherRaw As New BBox3d
|
||||||
|
' EgtGetRawPartBBox(nOtherRaw, b3OtherRaw)
|
||||||
|
EgtGetBBoxGlob(nOtherRaw, GDB_BB.STANDARD, b3OtherRaw)
|
||||||
|
' se il centro del pezzo è sulla tavola di scarico
|
||||||
|
If b3OtherRaw.Center.y < b3AuxTab.Max().y Then
|
||||||
|
m_IsCurrPhaseUnloaded = True
|
||||||
|
ListOfUnloadedPatr.Add(nOtherRaw)
|
||||||
|
' salvo l'info che indica che il pezzo deve essere scaricato
|
||||||
|
EgtSetInfo(nOtherRaw, "Unloaded", 1)
|
||||||
|
'Exit While
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
nOtherRaw = EgtGetNextRawPart(nOtherRaw)
|
||||||
|
End While
|
||||||
|
Return m_IsCurrPhaseUnloaded
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' inserisce una pausa nella fase corrente
|
||||||
|
Private Function InsertPauseInCurrPhase() As Boolean
|
||||||
' verifico che ci sia almeno un elemto selezionato (dati di aggancio pezzo)
|
' verifico che ci sia almeno un elemto selezionato (dati di aggancio pezzo)
|
||||||
If m_RawMoveDataList.Count = 0 Then Return
|
If m_RawMoveDataList.Count = 0 Then Return False
|
||||||
' verifico che sia stato inseito almeno uno spostamento, altrimenti lo rimuovo
|
' verifico che sia stato inseito almeno uno spostamento, altrimenti lo rimuovo
|
||||||
Dim Index As Integer = 0
|
Dim Index As Integer = 0
|
||||||
For Index = m_RawMoveDataList.Count - 1 To 0 Step -1
|
For Index = m_RawMoveDataList.Count - 1 To 0 Step -1
|
||||||
@@ -1019,8 +1121,9 @@ Public Class MoveRawPartPage
|
|||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
' verifico che la lista non sia vuota
|
' verifico che la lista non sia vuota
|
||||||
If m_RawMoveDataList.Count = 0 Then Return
|
If m_RawMoveDataList.Count = 0 Then
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
' recupero disposizione fase corrente
|
' recupero disposizione fase corrente
|
||||||
Dim nDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
|
Dim nDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
|
||||||
' imposto la pausa nella disposizione corrente
|
' imposto la pausa nella disposizione corrente
|
||||||
@@ -1028,30 +1131,22 @@ Public Class MoveRawPartPage
|
|||||||
' aggiungo al gruppo disposizione dei sottogruppi con i dati di movimento dei grezzi spostati
|
' aggiungo al gruppo disposizione dei sottogruppi con i dati di movimento dei grezzi spostati
|
||||||
SaveMoveInfoInDisposition(nDispId, m_RawMoveDataList)
|
SaveMoveInfoInDisposition(nDispId, m_RawMoveDataList)
|
||||||
' imposto eventuale movimento pezzi su tavola ausiliaria
|
' imposto eventuale movimento pezzi su tavola ausiliaria
|
||||||
SaveMovePartsOnAuxTable(nDispId, m_SplitPage.m_bOnAuxTab)
|
SaveMovePartsOnAuxTable(nDispId, m_IsCurrPhaseUnloaded)
|
||||||
|
' SaveMovePartsOnAuxTable(nDispId, m_SplitPage.m_bOnAuxTab)
|
||||||
'' Eseguo calcolo speciale dei movimenti: per tavola multicut
|
'' Eseguo calcolo speciale dei movimenti: per tavola multicut
|
||||||
'SpecialApplyDisposition(nDispId, True, Not m_SplitPage.m_bOnAuxTab)
|
'SpecialApplyDisposition(nDispId, True, Not m_SplitPage.m_bOnAuxTab)
|
||||||
|
SaveRemoveByHandInDisposition(nDispId, False)
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' crea una nuvoa fase/disposizione, la rende corrente, ricalcolo i grezzi e le lavorazioni della nuova fase
|
||||||
|
Private Function AddNewPhase() As Boolean
|
||||||
' Creo nuova fase
|
' Creo nuova fase
|
||||||
Dim nNewPhase As Integer = EgtAddPhase()
|
Dim nNewPhase As Integer = EgtAddPhase()
|
||||||
|
' Carico i grezzi rimasti sulla tavola nella nuova fase
|
||||||
' Eseguo eventuali spezzature dei grezzi e vi sposto i pezzi (i grezzi devono essere sempre copiati per Registrazione con rotazione)
|
ChangePhaseRawPart(nNewPhase)
|
||||||
Dim nRawId As Integer = EgtGetFirstRawPart()
|
' Sposto le lavorazioni rimaste nella nuova fase
|
||||||
While nRawId <> GDB_ID.NULL
|
ChangeOperationPhase(nNewPhase)
|
||||||
' se il grezzo è presente nella fase precedente e non è quello selezionato allora procedo a creare una copia nella nuova fase
|
|
||||||
If EgtVerifyRawPartPhase(nRawId, nNewPhase - 1) Then
|
|
||||||
Dim bKeepRawPart As Boolean = True
|
|
||||||
For Each RawOnAuxTabData As RawMoveData In m_RawMoveDataList
|
|
||||||
If nRawId = RawOnAuxTabData.m_nId Then
|
|
||||||
bKeepRawPart = False
|
|
||||||
Exit For
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
If bKeepRawPart Then EgtKeepRawPart(nRawId, nNewPhase - 1)
|
|
||||||
End If
|
|
||||||
' passo al successivo grezzo
|
|
||||||
nRawId = EgtGetNextRawPart(nRawId)
|
|
||||||
End While
|
|
||||||
|
|
||||||
Dim nCurrDisposition As Integer = EgtGetPhaseDisposition(nNewPhase)
|
Dim nCurrDisposition As Integer = EgtGetPhaseDisposition(nNewPhase)
|
||||||
'SetPause(nCurrDisposition)
|
'SetPause(nCurrDisposition)
|
||||||
@@ -1062,8 +1157,43 @@ Public Class MoveRawPartPage
|
|||||||
SetAuxTabInCurrDisposition()
|
SetAuxTabInCurrDisposition()
|
||||||
' ripulisco la lista degli spostamenti
|
' ripulisco la lista degli spostamenti
|
||||||
m_RawMoveDataList.Clear()
|
m_RawMoveDataList.Clear()
|
||||||
|
m_IsCurrPhaseUnloaded = False
|
||||||
' aggiorno la fase corrente
|
' aggiorno la fase corrente
|
||||||
m_nCurrPhase = EgtGetCurrPhase()
|
m_nCurrPhase = EgtGetCurrPhase()
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' Copio i grezzi rimasti sulla tavola nella fase successiva
|
||||||
|
Private Sub ChangePhaseRawPart(ByVal nNewPhase As Integer)
|
||||||
|
' recupero l'elenco dei pezzi che sono stati scaricati sulla tavola
|
||||||
|
Dim LocalLstOfUnldPart As New List(Of Integer)
|
||||||
|
PartOnAuxTab(LocalLstOfUnldPart, nNewPhase - 1)
|
||||||
|
' Eseguo eventuali spezzature dei grezzi e vi sposto i pezzi (i grezzi devono essere sempre copiati per Registrazione con rotazione)
|
||||||
|
Dim nRawId As Integer = EgtGetFirstRawPart()
|
||||||
|
While nRawId <> GDB_ID.NULL
|
||||||
|
' se il grezzo è presente nella fase precedente e non è quello selezionato allora procedo a creare una copia nella nuova fase
|
||||||
|
If EgtVerifyRawPartPhase(nRawId, nNewPhase - 1) Then
|
||||||
|
Dim bKeepRawPart As Boolean = True
|
||||||
|
For Each RawOnAuxTabData As RawMoveData In m_RawMoveDataList
|
||||||
|
If nRawId = RawOnAuxTabData.m_nId Then
|
||||||
|
' se il pezzo è stato scaricato allora non deve essere riportato nella fase successiva
|
||||||
|
For Each UnloadPart As Integer In LocalLstOfUnldPart
|
||||||
|
If nRawId = UnloadPart Then
|
||||||
|
' salvo l'info che indica che il pezzo deve essere scaricato
|
||||||
|
EgtSetInfo(nRawId, "Unloaded", 1)
|
||||||
|
bKeepRawPart = False
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
'bKeepRawPart = False
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
If bKeepRawPart Then EgtKeepRawPart(nRawId, nNewPhase - 1)
|
||||||
|
End If
|
||||||
|
' passo al successivo grezzo
|
||||||
|
nRawId = EgtGetNextRawPart(nRawId)
|
||||||
|
End While
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ResetBtn_Click(sender As Object, e As RoutedEventArgs) Handles ResetBtn.Click
|
Private Sub ResetBtn_Click(sender As Object, e As RoutedEventArgs) Handles ResetBtn.Click
|
||||||
@@ -1079,6 +1209,8 @@ Public Class MoveRawPartPage
|
|||||||
EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAngRaw)
|
EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAngRaw)
|
||||||
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
|
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
|
||||||
RemoveRawMoveData(nRawId, m_RawMoveDataList)
|
RemoveRawMoveData(nRawId, m_RawMoveDataList)
|
||||||
|
' elimino l'info che indica che il pezzo è scaricato sulla tavola
|
||||||
|
EgtRemoveInfo(nRawId, "Unloaded")
|
||||||
' Disabilito pezzo e nascondo le ventose
|
' Disabilito pezzo e nascondo le ventose
|
||||||
EgtSetStatus(nRawId, GDB_ST.ON_)
|
EgtSetStatus(nRawId, GDB_ST.ON_)
|
||||||
EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
|
EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
|
||||||
@@ -1111,6 +1243,14 @@ Public Class MoveRawPartPage
|
|||||||
m_nCurrPhase -= 1
|
m_nCurrPhase -= 1
|
||||||
m_bPrev = False
|
m_bPrev = False
|
||||||
m_SplitPage.m_bShow = True
|
m_SplitPage.m_bShow = True
|
||||||
|
m_SplitPage.m_bOnAuxTab = True
|
||||||
|
' imposto la visibilità della tavola ausiliaria
|
||||||
|
SetAuxTabInCurrDisposition()
|
||||||
|
' carico le info di disposizione dei pezzi
|
||||||
|
m_RawMoveDataList.Clear()
|
||||||
|
m_bRemovedRaw = GetRemoveByHandInDisposition(m_nCurrDisposition)
|
||||||
|
GetMoveInfoInDisposition(m_nCurrDisposition, m_RawMoveDataList)
|
||||||
|
RefreshVisibility()
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
@@ -1141,18 +1281,53 @@ Public Class MoveRawPartPage
|
|||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' se la disposizione corrente è sulla tavola ausiliaria allora lo sarà anche quella successiva
|
' ------- VISUALIZZAZIONE -------
|
||||||
If IsDispUnloadOnAuxTab(m_nCurrDisposition) <> 0 Then
|
If m_SplitPage.m_bShow Then
|
||||||
EgtSetCurrPhase(m_nCurrPhase + 1)
|
' verifico se la fase successiva è uno scarico frontale
|
||||||
m_nCurrDisposition = EgtGetNextOperation(m_nCurrDisposition)
|
If NextOperationIsUnloading(m_nCurrDisposition) Then
|
||||||
m_nCurrPhase += 1
|
' imposto la nuova fase (che è stata modificata all'interno della funzione di controllo)
|
||||||
m_bToNext = False
|
EgtSetCurrPhase(m_nCurrPhase)
|
||||||
m_SplitPage.m_bShow = True
|
' carico i dati di movimento dei pezzi nella fase corrente
|
||||||
|
m_RawMoveDataList.Clear()
|
||||||
|
m_bRemovedRaw = GetRemoveByHandInDisposition(m_nCurrDisposition)
|
||||||
|
GetMoveInfoInDisposition(m_nCurrDisposition, m_RawMoveDataList)
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
EnableButtons()
|
EnableButtons()
|
||||||
Return
|
Return
|
||||||
|
ElseIf IsDispUnloadOnAuxTab(m_nCurrDisposition) <> 0 AndAlso Not NextOperationIsUnloading(m_nCurrDisposition) Then
|
||||||
|
' imposto la nuova fase, al termine della Sub verrà caricata la pagina Split nella fase indicata ora
|
||||||
|
m_bToNext = True
|
||||||
|
m_nCurrPhase += 1
|
||||||
|
EgtSetCurrPhase(m_nCurrPhase)
|
||||||
|
EgtDraw()
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
' ------- MODIFICA -------
|
||||||
|
If Not m_SplitPage.m_bShow Then
|
||||||
|
' se la tavola di scarico presente oppure ci sono pezzi sulla tavola di scarico
|
||||||
|
Dim LclLstOfUnldPart As New List(Of Integer)
|
||||||
|
If m_SplitPage.m_bOnAuxTab Or PartOnAuxTab(LclLstOfUnldPart, m_nCurrPhase) Then
|
||||||
|
' se ci sono pezzi sulla tavola di scarico prima di procedere inserisco una pausa e creo una nuoava fase
|
||||||
|
If m_IsCurrPhaseUnloaded AndAlso InsertPauseInCurrPhase() Then AddNewPhase()
|
||||||
|
' nascondo la tavola di scarico
|
||||||
|
EgtDisableModified()
|
||||||
|
EgtSetStatus(m_nAuxTabId, GDB_ST.OFF)
|
||||||
|
EgtEnableModified()
|
||||||
|
End If
|
||||||
|
m_bToNext = True
|
||||||
|
'' se la disposizione corrente è sulla tavola ausiliaria allora lo sarà anche quella successiva
|
||||||
|
'If IsDispUnloadOnAuxTab(m_nCurrDisposition) <> 0 Then
|
||||||
|
' EgtSetCurrPhase(m_nCurrPhase + 1)
|
||||||
|
' m_nCurrDisposition = EgtGetNextOperation(m_nCurrDisposition)
|
||||||
|
' m_nCurrPhase += 1
|
||||||
|
' m_bToNext = False
|
||||||
|
' m_SplitPage.m_bShow = True
|
||||||
|
' EgtDraw()
|
||||||
|
' EnableButtons()
|
||||||
|
' Return
|
||||||
|
'End If
|
||||||
|
End If
|
||||||
' resetto l'inidice del pezzo da mnovimentare
|
' resetto l'inidice del pezzo da mnovimentare
|
||||||
m_CurrRawOnVacuum = GDB_ID.NULL
|
m_CurrRawOnVacuum = GDB_ID.NULL
|
||||||
' Deseleziono tutto
|
' Deseleziono tutto
|
||||||
@@ -1195,7 +1370,7 @@ Public Class MoveRawPartPage
|
|||||||
' disabilito bottone
|
' disabilito bottone
|
||||||
ModifyBtn.IsEnabled = False
|
ModifyBtn.IsEnabled = False
|
||||||
' gestione abilitazione altri bottoni
|
' gestione abilitazione altri bottoni
|
||||||
EnableButtons()
|
EnableButtons(MachiningList.Count > 0)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
' verifica se la disposizione indicata è uno scarico sulla tavola ausiliaria
|
' verifica se la disposizione indicata è uno scarico sulla tavola ausiliaria
|
||||||
@@ -1206,6 +1381,20 @@ Public Class MoveRawPartPage
|
|||||||
Return bVal
|
Return bVal
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
' restituisce e attiva la successiva disposizione se è uno scarico frontale
|
||||||
|
Public Function NextOperationIsUnloading(nCurrDispId As Integer) As Boolean
|
||||||
|
' recupero la primo operazione successiva
|
||||||
|
Dim nNextIdOperation As Integer = EgtGetNextOperation(nCurrDispId)
|
||||||
|
' a partire da questa cerco la prima disposizione disponibile
|
||||||
|
Dim nNextIdDips As Integer = GetNextDisposition(nNextIdOperation)
|
||||||
|
If nNextIdDips = nNextIdOperation And IsDispUnloadOnAuxTab(nNextIdOperation) Then
|
||||||
|
m_nCurrPhase += 1
|
||||||
|
m_nCurrDisposition = nNextIdOperation
|
||||||
|
Return True
|
||||||
|
End If
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
|
||||||
' recupero la prima disposizione disponibile tra l'elenco delle operazioni presenti
|
' recupero la prima disposizione disponibile tra l'elenco delle operazioni presenti
|
||||||
Public Function GetNextDisposition(nCurrDisposId As Integer) As Integer
|
Public Function GetNextDisposition(nCurrDisposId As Integer) As Integer
|
||||||
Dim nDispId As Integer = nCurrDisposId
|
Dim nDispId As Integer = nCurrDisposId
|
||||||
@@ -1218,7 +1407,7 @@ Public Class MoveRawPartPage
|
|||||||
Return GDB_ID.NULL
|
Return GDB_ID.NULL
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Sub EnableButtons()
|
Private Sub EnableButtons(Optional bExistsMachining As Boolean = False)
|
||||||
UpBtn.IsEnabled = Not m_SplitPage.m_bShow
|
UpBtn.IsEnabled = Not m_SplitPage.m_bShow
|
||||||
LeftBtn.IsEnabled = Not m_SplitPage.m_bShow
|
LeftBtn.IsEnabled = Not m_SplitPage.m_bShow
|
||||||
RightBtn.IsEnabled = Not m_SplitPage.m_bShow
|
RightBtn.IsEnabled = Not m_SplitPage.m_bShow
|
||||||
@@ -1234,19 +1423,35 @@ Public Class MoveRawPartPage
|
|||||||
BottomRBtn.IsEnabled = Not m_SplitPage.m_bShow
|
BottomRBtn.IsEnabled = Not m_SplitPage.m_bShow
|
||||||
PauseBtn.IsEnabled = Not m_SplitPage.m_bShow
|
PauseBtn.IsEnabled = Not m_SplitPage.m_bShow
|
||||||
ResetBtn.IsEnabled = Not m_SplitPage.m_bShow
|
ResetBtn.IsEnabled = Not m_SplitPage.m_bShow
|
||||||
|
UnloadPartsBtn.IsEnabled = Not m_SplitPage.m_bShow
|
||||||
If m_SplitPage.m_bShow Then
|
If m_SplitPage.m_bShow Then
|
||||||
NextBtn.IsEnabled = (m_nCurrPhase < EgtGetPhaseCount())
|
NextBtn.IsEnabled = (m_nCurrPhase < EgtGetPhaseCount())
|
||||||
Else
|
Else
|
||||||
|
' Se esistono delle lavorazioni allora abilito il pulsante per procedere
|
||||||
|
If Not bExistsMachining Then
|
||||||
NextBtn.IsEnabled = Not m_SplitPage.m_bOnAuxTab
|
NextBtn.IsEnabled = Not m_SplitPage.m_bOnAuxTab
|
||||||
|
Else
|
||||||
|
NextBtn.IsEnabled = True
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
' esco dalla pagina di scarico
|
||||||
Private Sub MoveRawPartPage_Unloaded(sender As Object, e As EventArgs) Handles Me.Unloaded
|
Private Sub MoveRawPartPage_Unloaded(sender As Object, e As EventArgs) Handles Me.Unloaded
|
||||||
' verifico che la fase corrente non sia vuota
|
' verifico che la fase corrente non sia vuota
|
||||||
Dim nLastDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
|
Dim nLastDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
|
||||||
If EgtIsOperationEmpty(nLastDispId) And m_SplitPage.m_bOnAuxTab And m_RawMoveDataList.Count = 0 Then
|
|
||||||
EgtErase(nLastDispId)
|
'' se sono in visualizzazione allora non elimino essuna operazione
|
||||||
End If
|
'If Not m_SplitPage.m_bShow Then
|
||||||
|
' If EgtIsOperationEmpty(nLastDispId) And Not m_SplitPage.m_bOnAuxTab And m_RawMoveDataList.Count = 0 Then
|
||||||
|
' EgtErase(nLastDispId)
|
||||||
|
' ElseIf EgtIsOperationEmpty(nLastDispId) And m_SplitPage.m_bOnAuxTab And m_RawMoveDataList.Count = 0 Then
|
||||||
|
' ' Dichiaro pagina non attiva
|
||||||
|
' m_bActive = False
|
||||||
|
' Return
|
||||||
|
' End If
|
||||||
|
'End If
|
||||||
|
|
||||||
' Se movimento con ventose
|
' Se movimento con ventose
|
||||||
If Not m_bByHand Then
|
If Not m_bByHand Then
|
||||||
@@ -1262,8 +1467,9 @@ Public Class MoveRawPartPage
|
|||||||
SaveMoveInfoInDisposition(nDispId, m_RawMoveDataList)
|
SaveMoveInfoInDisposition(nDispId, m_RawMoveDataList)
|
||||||
' imposto eventuale presenza rimozioni manuali
|
' imposto eventuale presenza rimozioni manuali
|
||||||
SaveRemoveByHandInDisposition(nDispId, m_bRemovedRaw)
|
SaveRemoveByHandInDisposition(nDispId, m_bRemovedRaw)
|
||||||
' imposto eventuale movimento pezzi su tavola ausiliaria
|
' imposto eventuale movimento pezzi su tavola ausiliaria (se è realmente avvenuto)
|
||||||
SaveMovePartsOnAuxTable(nDispId, m_SplitPage.m_bOnAuxTab)
|
'SaveMovePartsOnAuxTable(nDispId, m_SplitPage.m_bOnAuxTab)
|
||||||
|
SaveMovePartsOnAuxTable(nDispId, m_IsCurrPhaseUnloaded)
|
||||||
' Eseguo calcolo speciale dei movimenti
|
' Eseguo calcolo speciale dei movimenti
|
||||||
SpecialApplyDisposition(nDispId, True, Not m_SplitPage.m_bOnAuxTab)
|
SpecialApplyDisposition(nDispId, True, Not m_SplitPage.m_bOnAuxTab)
|
||||||
End If
|
End If
|
||||||
@@ -1279,13 +1485,18 @@ Public Class MoveRawPartPage
|
|||||||
SpecialApplyDisposition(nDispId, True)
|
SpecialApplyDisposition(nDispId, True)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' Nascondo eventuale tavola ausiliaria
|
' Nascondo eventuale tavola ausiliaria
|
||||||
If m_SplitPage.m_bOnAuxTab Then
|
If m_SplitPage.m_bOnAuxTab Then
|
||||||
EgtDisableModified()
|
EgtDisableModified()
|
||||||
EgtSetStatus(m_nAuxTabId, GDB_ST.OFF)
|
EgtSetStatus(m_nAuxTabId, GDB_ST.OFF)
|
||||||
EgtEnableModified()
|
EgtEnableModified()
|
||||||
EgtZoom(ZM.ALL, False)
|
' se sto uscendo dalla pagina delle spezzature
|
||||||
If Not m_bPrev Then
|
If Not m_bPrev And Not m_bToNext Then
|
||||||
|
Dim nDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
|
||||||
|
' se sto uscendo dalla pagina split (senza passare dal comando next)
|
||||||
|
Dim lclLstUnlPart As New List(Of Integer)
|
||||||
|
SaveMovePartsOnAuxTable(nDispId, PartOnAuxTab(lclLstUnlPart, m_nCurrPhase))
|
||||||
' Cancello eventuale manipolatore pezzi
|
' Cancello eventuale manipolatore pezzi
|
||||||
EgtDisableModified()
|
EgtDisableModified()
|
||||||
RemoveVacuumCups()
|
RemoveVacuumCups()
|
||||||
@@ -1302,10 +1513,30 @@ Public Class MoveRawPartPage
|
|||||||
m_bPrev = False
|
m_bPrev = False
|
||||||
m_SplitPage.m_bShow = True
|
m_SplitPage.m_bShow = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Dim Ph As Integer = EgtGetCurrPhase()
|
||||||
|
' aggiorno il disegno
|
||||||
|
EgtZoom(ZM.ALL, False)
|
||||||
' Dichiaro pagina non attiva
|
' Dichiaro pagina non attiva
|
||||||
m_bActive = False
|
m_bActive = False
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
' ----------------- TEST funzione per debug operazioni -----------------
|
||||||
|
Private Sub SaveMyFileTest(sFilename As String)
|
||||||
|
LoadCurrPhaseMachining()
|
||||||
|
' salvo il file corrente per poterlo studiare e capire cosa è successo nella rappresentazione dei grezzi
|
||||||
|
EgtSaveFile("C:\EgtData\OmagCUT\MyProjects\" & sFilename & ".nge", NGE.BIN)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub LoadCurrPhaseMachining()
|
||||||
|
Dim m_MachiningList As New List(Of SplitMach)
|
||||||
|
'm_SplitPage.ShowMachiningList()
|
||||||
|
'm_SplitPage.SaveOrderMachinig(m_nCurrPhase)
|
||||||
|
' Preparo la lista delle lavorazioni
|
||||||
|
CalculateSplitMachList(m_nCurrPhase, m_MachiningList)
|
||||||
|
Dim b As Boolean = False
|
||||||
|
End Sub
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
+60
-8
@@ -1,4 +1,5 @@
|
|||||||
Imports EgtUILib
|
Imports System.Windows.Forms.Integration
|
||||||
|
Imports EgtUILib
|
||||||
|
|
||||||
Public Module SplitAuto
|
Public Module SplitAuto
|
||||||
|
|
||||||
@@ -194,7 +195,7 @@ Public Module SplitAuto
|
|||||||
|
|
||||||
Private Sub ColorSingleMachining(nOperId As Integer, sLay As String, dSideAng As Double, bEnabled As Boolean, nInterf As Integer)
|
Private Sub ColorSingleMachining(nOperId As Integer, sLay As String, dSideAng As Double, bEnabled As Boolean, nInterf As Integer)
|
||||||
' Verifico se è un taglio da sopra o da sotto
|
' Verifico se è un taglio da sopra o da sotto
|
||||||
Dim bOnMach As Boolean = (sLay = NAME_ONPATH Or ( sLay = NAME_INLOOP AndAlso EgtExistsInfo( nOperId, INFO_FILOTOP)))
|
Dim bOnMach As Boolean = (sLay = NAME_ONPATH Or (sLay = NAME_INLOOP AndAlso EgtExistsInfo(nOperId, INFO_FILOTOP)))
|
||||||
Dim bDrip As Boolean = (sLay = NAME_DRIPCUT Or sLay = NAME_UNDERDRILL)
|
Dim bDrip As Boolean = (sLay = NAME_DRIPCUT Or sLay = NAME_UNDERDRILL)
|
||||||
' Recupero il preview della lavorazione
|
' Recupero il preview della lavorazione
|
||||||
Dim nPvId As Integer = GDB_ID.NULL
|
Dim nPvId As Integer = GDB_ID.NULL
|
||||||
@@ -219,11 +220,11 @@ Public Module SplitAuto
|
|||||||
Next
|
Next
|
||||||
EgtSetColor(nDwnCutId, COL_MCH_DISABLED)
|
EgtSetColor(nDwnCutId, COL_MCH_DISABLED)
|
||||||
Dim bFreeStart As Boolean = (nInterf And FMI_TYPE.LI) <> FMI_TYPE.LI
|
Dim bFreeStart As Boolean = (nInterf And FMI_TYPE.LI) <> FMI_TYPE.LI
|
||||||
EgtSetColor(nPrcId, If(bFreeStart, COL_MCH_DISABLED, COL_MCH_DIS_INTERF))
|
EgtSetColor(nPrcId, If(bFreeStart, COL_MCH_DISABLED(), COL_MCH_DIS_INTERF()))
|
||||||
EgtSetColor(nDwnPrcId, If(bFreeStart, COL_MCH_DISABLED, COL_MCH_DIS_INTERF))
|
EgtSetColor(nDwnPrcId, If(bFreeStart, COL_MCH_DISABLED(), COL_MCH_DIS_INTERF()))
|
||||||
Dim bFreeEnd As Boolean = (nInterf And FMI_TYPE.LO) <> FMI_TYPE.LO
|
Dim bFreeEnd As Boolean = (nInterf And FMI_TYPE.LO) <> FMI_TYPE.LO
|
||||||
EgtSetColor(nPocId, If(bFreeEnd, COL_MCH_DISABLED, COL_MCH_DIS_INTERF))
|
EgtSetColor(nPocId, If(bFreeEnd, COL_MCH_DISABLED(), COL_MCH_DIS_INTERF()))
|
||||||
EgtSetColor(nDwnPocId, If(bFreeEnd, COL_MCH_DISABLED, COL_MCH_DIS_INTERF))
|
EgtSetColor(nDwnPocId, If(bFreeEnd, COL_MCH_DISABLED(), COL_MCH_DIS_INTERF()))
|
||||||
Else
|
Else
|
||||||
Dim colCut As Color3d
|
Dim colCut As Color3d
|
||||||
If bOnMach Then
|
If bOnMach Then
|
||||||
@@ -342,6 +343,7 @@ Public Module SplitAuto
|
|||||||
Dim ptOri As Point3d
|
Dim ptOri As Point3d
|
||||||
EgtGetTableRef(1, ptOri)
|
EgtGetTableRef(1, ptOri)
|
||||||
Dim vtOri As New Vector3d(ptOri.x, ptOri.y, ptOri.z)
|
Dim vtOri As New Vector3d(ptOri.x, ptOri.y, ptOri.z)
|
||||||
|
' ---------------------------------- GREZZI ----------------------------------
|
||||||
' Eseguo eventuali spezzature dei grezzi e vi sposto i pezzi (i grezzi devono essere sempre copiati per Registrazione con rotazione)
|
' Eseguo eventuali spezzature dei grezzi e vi sposto i pezzi (i grezzi devono essere sempre copiati per Registrazione con rotazione)
|
||||||
Dim nRawId As Integer = EgtGetFirstRawPart()
|
Dim nRawId As Integer = EgtGetFirstRawPart()
|
||||||
While nRawId <> GDB_ID.NULL
|
While nRawId <> GDB_ID.NULL
|
||||||
@@ -393,10 +395,19 @@ Public Module SplitAuto
|
|||||||
' passo al successivo grezzo
|
' passo al successivo grezzo
|
||||||
nRawId = EgtGetNextRawPart(nRawId)
|
nRawId = EgtGetNextRawPart(nRawId)
|
||||||
End While
|
End While
|
||||||
|
' ---------------------------------- GREZZI ----------------------------------
|
||||||
' Cancello preview dei tagli allungati dalla lavorazione
|
' Cancello preview dei tagli allungati dalla lavorazione
|
||||||
For Each nCut As Integer In vCuts
|
For Each nCut As Integer In vCuts
|
||||||
RemoveMachiningPreview(nCut)
|
RemoveMachiningPreview(nCut)
|
||||||
Next
|
Next
|
||||||
|
' ---------------------------------- LAVORAZIONI ----------------------------------
|
||||||
|
ChangeOperationPhase(nNewPhase)
|
||||||
|
' ---------------------------------- LAVORAZIONI ----------------------------------
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' Sposta le lavorzioni della fase precedente a quella indicata
|
||||||
|
Friend Sub ChangeOperationPhase_ERR(nNewPhase As Integer)
|
||||||
' Sposto tutte le lavorazioni disabilitate e le eventuali inglobate nella nuova fase
|
' Sposto tutte le lavorazioni disabilitate e le eventuali inglobate nella nuova fase
|
||||||
Dim nId = EgtGetFirstOperation()
|
Dim nId = EgtGetFirstOperation()
|
||||||
While nId <> GDB_ID.NULL
|
While nId <> GDB_ID.NULL
|
||||||
@@ -417,9 +428,50 @@ Public Module SplitAuto
|
|||||||
End If
|
End If
|
||||||
nId = nNextId
|
nId = nNextId
|
||||||
End While
|
End While
|
||||||
Return True
|
End Sub
|
||||||
End Function
|
|
||||||
|
|
||||||
|
' Miglioramento della gestione delle lavorazioni
|
||||||
|
Friend Sub ChangeOperationPhase(nNewPhase As Integer)
|
||||||
|
' creo l'elenco delle lavorazioni che devono essere sposate
|
||||||
|
Dim MchList As New List(Of Integer)
|
||||||
|
' Recupero le lavorazioni disabilitate e le eventuali inglobate nella nuova fase
|
||||||
|
Dim nId = EgtGetFirstOperation()
|
||||||
|
While nId <> GDB_ID.NULL
|
||||||
|
Dim nNextId = EgtGetNextOperation(nId)
|
||||||
|
If IsValidMachining(nId) And EgtGetOperationPhase(nId) = nNewPhase - 1 And EgtExistsInfo(nId, INFO_MCH_USER_OFF) Then
|
||||||
|
' Provo ad inserire la lavorazione nell'elenco
|
||||||
|
AddMach(MchList, nId)
|
||||||
|
' sposto le inglobate
|
||||||
|
Dim sInfo As String = String.Empty
|
||||||
|
If EgtGetInfo(nId, INFO_MCH_OTHMID, sInfo) Then
|
||||||
|
Dim sItems() As String = sInfo.Split(",".ToCharArray)
|
||||||
|
For Each sId2 As String In sItems
|
||||||
|
Dim nId2 As Integer = 0
|
||||||
|
StringToInt(sId2, nId2)
|
||||||
|
If nId2 > 0 Then
|
||||||
|
' Provo ad inserire la lavorazione nell'elenco
|
||||||
|
AddMach(MchList, nId2)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
nId = nNextId
|
||||||
|
End While
|
||||||
|
' Procedo ora a spostare le lavorazioni nella nuova disposizione
|
||||||
|
For Each ItemMchId As Integer In MchList
|
||||||
|
EgtChangeOperationPhase(ItemMchId, nNewPhase)
|
||||||
|
Next
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' Inserisce gli inidici delle lavorazioni evitando di inserire dei doppioni
|
||||||
|
Private Sub AddMach(MchList As List(Of Integer), IdMch As Integer)
|
||||||
|
For Each Item As Integer In MchList
|
||||||
|
If IdMch = Item Then
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
MchList.Add(IdMch)
|
||||||
|
End Sub
|
||||||
'-----------------------------------------------------------------------------------------------
|
'-----------------------------------------------------------------------------------------------
|
||||||
Friend Function CalculateSplitAuto() As Boolean
|
Friend Function CalculateSplitAuto() As Boolean
|
||||||
' Fase iniziale
|
' Fase iniziale
|
||||||
|
|||||||
+49
-48
@@ -13,7 +13,7 @@ Public Class SplitPageUC
|
|||||||
' Tipo movimento dei grezzi (manuale o con testa ventosa)
|
' Tipo movimento dei grezzi (manuale o con testa ventosa)
|
||||||
Private m_bByHand As Boolean = True
|
Private m_bByHand As Boolean = True
|
||||||
' Abilitazione movimento finale pezzi su tavola ausiliaria
|
' Abilitazione movimento finale pezzi su tavola ausiliaria
|
||||||
Private m_bEnableOnAuxTab As Boolean = False
|
Friend m_bEnableOnAuxTab As Boolean = False
|
||||||
' Stato
|
' Stato
|
||||||
Private m_nCurrPhase As Integer = 0
|
Private m_nCurrPhase As Integer = 0
|
||||||
Private m_MachiningList As New List(Of SplitMach)
|
Private m_MachiningList As New List(Of SplitMach)
|
||||||
@@ -49,6 +49,7 @@ Public Class SplitPageUC
|
|||||||
Private m_bModified As Boolean = False
|
Private m_bModified As Boolean = False
|
||||||
Private m_nNbrGrpId As Integer = GDB_ID.NULL
|
Private m_nNbrGrpId As Integer = GDB_ID.NULL
|
||||||
Private m_bToNext As Boolean = False
|
Private m_bToNext As Boolean = False
|
||||||
|
Private m_bToPrev As Boolean = False
|
||||||
Friend m_bOnAuxTab As Boolean = False
|
Friend m_bOnAuxTab As Boolean = False
|
||||||
' Drag
|
' Drag
|
||||||
Private m_nDragInd As Integer = -1
|
Private m_nDragInd As Integer = -1
|
||||||
@@ -167,6 +168,7 @@ Public Class SplitPageUC
|
|||||||
m_bModified = False
|
m_bModified = False
|
||||||
' Reset flag tipo uscita
|
' Reset flag tipo uscita
|
||||||
m_bToNext = False
|
m_bToNext = False
|
||||||
|
m_bToPrev = False
|
||||||
' Abilitazione bottoni
|
' Abilitazione bottoni
|
||||||
EnableButtons()
|
EnableButtons()
|
||||||
' Se sola visualizzazione, segnalazione di eventuale fase di restart
|
' Se sola visualizzazione, segnalazione di eventuale fase di restart
|
||||||
@@ -180,7 +182,8 @@ Public Class SplitPageUC
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ShowMachiningList()
|
' preparo la lista delle lavorazioni da mostrare in interfaccia
|
||||||
|
Public Sub ShowMachiningList()
|
||||||
m_ItemList.Clear()
|
m_ItemList.Clear()
|
||||||
For i As Integer = 1 To m_MachiningList.Count()
|
For i As Integer = 1 To m_MachiningList.Count()
|
||||||
Dim Mach As SplitMach = m_MachiningList(i - 1)
|
Dim Mach As SplitMach = m_MachiningList(i - 1)
|
||||||
@@ -710,30 +713,8 @@ Public Class SplitPageUC
|
|||||||
MoveUpBtn.IsEnabled = False
|
MoveUpBtn.IsEnabled = False
|
||||||
MoveDownBtn.IsEnabled = False
|
MoveDownBtn.IsEnabled = False
|
||||||
End If
|
End If
|
||||||
|
' Recupero la selezione dei tagli correnti
|
||||||
GetCurrSelection()
|
GetCurrSelection()
|
||||||
|
|
||||||
'' verifico che siano contigui
|
|
||||||
'Dim bContigus As Boolean = False
|
|
||||||
'Dim OrdIndex = 0
|
|
||||||
'OrdIndex = MachiningLsBx.SelectedItems(MachiningLsBx.SelectedItems.Count - 1).Ind
|
|
||||||
'' recupero l'indice dell'ultimo elemento selezionato
|
|
||||||
'Dim LastSel As NameIdLsBxItem = MachiningLsBx.SelectedItems(MachiningLsBx.SelectedItems.Count - 1)
|
|
||||||
'If MachiningLsBx.SelectedItems.Count = 1 Then
|
|
||||||
' bContigus = True
|
|
||||||
'Else
|
|
||||||
' For Each Item As NameIdLsBxItem In ItemList
|
|
||||||
' If Item.Ind = LastSel.Ind + 1 Or Item.Ind = LastSel.Ind - 1 Then
|
|
||||||
' bContigus = True
|
|
||||||
' End If
|
|
||||||
' Next
|
|
||||||
'End If
|
|
||||||
'' se non contiguo, elimino dai selezionati il primo(che è l'ultimo ad essere stato selezionato)
|
|
||||||
'If Not bContigus Then
|
|
||||||
' ItemList.Remove(LastSel)
|
|
||||||
' MachiningLsBx.SelectedItems.RemoveAt(MachiningLsBx.SelectedItems.Count - 1)
|
|
||||||
'End If
|
|
||||||
|
|
||||||
' resetto marcatura lavorazioni
|
' resetto marcatura lavorazioni
|
||||||
If m_CurrFirstInd > -1 Then
|
If m_CurrFirstInd > -1 Then
|
||||||
For Index As Integer = m_CurrFirstInd To m_CurrLastInd
|
For Index As Integer = m_CurrFirstInd To m_CurrLastInd
|
||||||
@@ -827,6 +808,8 @@ Public Class SplitPageUC
|
|||||||
Next
|
Next
|
||||||
|
|
||||||
VerifyHomogenousMachining(ItemList)
|
VerifyHomogenousMachining(ItemList)
|
||||||
|
' Abilitazione bottone Next
|
||||||
|
EnableButtons()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub AllOnBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllOnBtn.Click
|
Private Sub AllOnBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllOnBtn.Click
|
||||||
@@ -1717,7 +1700,7 @@ Public Class SplitPageUC
|
|||||||
End If
|
End If
|
||||||
Dim nI As Integer = m_ItemList(Index).Ind
|
Dim nI As Integer = m_ItemList(Index).Ind
|
||||||
' Si possono invertire solo i tagli di lama
|
' 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
|
' Non si possono invertire i tagli di lama inclinati
|
||||||
If Math.Abs(m_MachiningList(nI).m_dSideAng) > 0.1 Then Continue For
|
If Math.Abs(m_MachiningList(nI).m_dSideAng) > 0.1 Then Continue For
|
||||||
' Se abilitata inversione automatica e quindi non invertito
|
' Se abilitata inversione automatica e quindi non invertito
|
||||||
@@ -1731,6 +1714,7 @@ Public Class SplitPageUC
|
|||||||
ResetEnableInvert(m_MachiningList(nI).m_nEntId)
|
ResetEnableInvert(m_MachiningList(nI).m_nEntId)
|
||||||
EgtErase(m_MachiningList(nI).m_nArrId)
|
EgtErase(m_MachiningList(nI).m_nArrId)
|
||||||
NumberDirectionMachining(nI, False)
|
NumberDirectionMachining(nI, False)
|
||||||
|
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
End If
|
End If
|
||||||
' se altrimenti disabilitata inversione automatica e invertito
|
' se altrimenti disabilitata inversione automatica e invertito
|
||||||
@@ -1742,6 +1726,7 @@ Public Class SplitPageUC
|
|||||||
SwapStartEndData(nI)
|
SwapStartEndData(nI)
|
||||||
EgtErase(m_MachiningList(nI).m_nArrId)
|
EgtErase(m_MachiningList(nI).m_nArrId)
|
||||||
NumberDirectionMachining(nI, False)
|
NumberDirectionMachining(nI, False)
|
||||||
|
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
End If
|
End If
|
||||||
' altrimenti disabilitata inversione automatica e non invertito
|
' altrimenti disabilitata inversione automatica e non invertito
|
||||||
@@ -1780,15 +1765,26 @@ Public Class SplitPageUC
|
|||||||
Private Sub PrevBtn_Click(sender As Object, e As RoutedEventArgs) Handles PrevBtn.Click
|
Private Sub PrevBtn_Click(sender As Object, e As RoutedEventArgs) Handles PrevBtn.Click
|
||||||
' Dichiaro solo visualizzazione
|
' Dichiaro solo visualizzazione
|
||||||
m_bShow = True
|
m_bShow = True
|
||||||
' Esco
|
'' Esco
|
||||||
ExitSplit(False)
|
'ExitSplit(False)
|
||||||
' Torno alla fase precedente
|
' Torno alla fase precedente
|
||||||
EgtSetCurrPhase(EgtGetCurrPhase() - 1)
|
Dim nCurrPhase As Integer = EgtGetCurrPhase()
|
||||||
|
' se questa è la prima fase, non possono tornare più indietro di così
|
||||||
|
If nCurrPhase = 1 Then
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
EgtSetCurrPhase(nCurrPhase - 1)
|
||||||
|
m_bToPrev = True
|
||||||
' Reimposto la precedente
|
' Reimposto la precedente
|
||||||
SplitPageUC_Loaded(Nothing, Nothing)
|
'SplitPageUC_Loaded(Nothing, Nothing)
|
||||||
|
' torno alla disposizione della fase corrente
|
||||||
|
m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Remove(m_MainWindow.m_CadCutPageUC.m_SplitPage)
|
||||||
|
m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Add(m_MainWindow.m_CadCutPageUC.m_MoveRawPartPage)
|
||||||
|
m_MainWindow.m_CadCutPageUC.m_CadCutMode = CadCutPageUC.CadCutModes.MoveRawPart
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub NextBtn_Click(sender As Object, e As RoutedEventArgs) Handles NextBtn.Click
|
Private Sub NextBtn_Click(sender As Object, e As RoutedEventArgs) Handles NextBtn.Click
|
||||||
|
' ------- VISUALIZZAZIONE -------
|
||||||
If m_bShow Then
|
If m_bShow Then
|
||||||
Dim CurrDisposition As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
|
Dim CurrDisposition As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
|
||||||
' recupero l'operazione successiva
|
' recupero l'operazione successiva
|
||||||
@@ -1910,7 +1906,7 @@ Public Class SplitPageUC
|
|||||||
Private Sub SplitPageUC_Unloaded(sender As Object, e As EventArgs) Handles Me.Unloaded
|
Private Sub SplitPageUC_Unloaded(sender As Object, e As EventArgs) Handles Me.Unloaded
|
||||||
m_bActive = False
|
m_bActive = False
|
||||||
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
||||||
ExitSplit(Not m_bToNext)
|
ExitSplit(Not m_bToNext And Not m_bToPrev)
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -1929,22 +1925,7 @@ Public Class SplitPageUC
|
|||||||
EgtEnableModified()
|
EgtEnableModified()
|
||||||
' se modificato salvo ordine e stato delle lavorazioni
|
' se modificato salvo ordine e stato delle lavorazioni
|
||||||
If m_bModified Then
|
If m_bModified Then
|
||||||
' Al primo posto deve rimanere la disposizione della fase
|
SaveOrderMachinig(m_nCurrPhase)
|
||||||
Dim nFirstOperId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
|
|
||||||
For i As Integer = m_ItemList.Count() - 1 To 0 Step -1
|
|
||||||
Dim nI As Integer = m_ItemList(i).Ind
|
|
||||||
Dim nMchId As Integer = m_MachiningList(nI).m_nId
|
|
||||||
EgtRelocate(nMchId, nFirstOperId, GDB_POS.AFTER)
|
|
||||||
If m_MachiningList(nI).m_bEnabled Then
|
|
||||||
EgtSetOperationMode(m_MachiningList(nI).m_nId, True)
|
|
||||||
EgtRemoveInfo(m_MachiningList(nI).m_nId, INFO_MCH_USER_OFF)
|
|
||||||
Else
|
|
||||||
EgtSetOperationMode(m_MachiningList(nI).m_nId, False)
|
|
||||||
EgtSetInfo(m_MachiningList(nI).m_nId, INFO_MCH_USER_OFF, True)
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
' dichiaro ordine salvato
|
|
||||||
m_MainWindow.m_CurrentProjectPageUC.SetOrderMachiningFlag()
|
|
||||||
End If
|
End If
|
||||||
' Affondamento ridotto
|
' Affondamento ridotto
|
||||||
Dim dReducedDepth As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_REDUCEDDEPTH, 1, m_MainWindow.GetMachIniFile())
|
Dim dReducedDepth As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_REDUCEDDEPTH, 1, m_MainWindow.GetMachIniFile())
|
||||||
@@ -1968,6 +1949,25 @@ Public Class SplitPageUC
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Friend Sub SaveOrderMachinig(CurrPhase As Integer)
|
||||||
|
' Al primo posto deve rimanere la disposizione della fase
|
||||||
|
Dim nFirstOperId As Integer = EgtGetPhaseDisposition(CurrPhase)
|
||||||
|
For i As Integer = m_ItemList.Count() - 1 To 0 Step -1
|
||||||
|
Dim nI As Integer = m_ItemList(i).Ind
|
||||||
|
Dim nMchId As Integer = m_MachiningList(nI).m_nId
|
||||||
|
EgtRelocate(nMchId, nFirstOperId, GDB_POS.AFTER)
|
||||||
|
If m_MachiningList(nI).m_bEnabled Then
|
||||||
|
EgtSetOperationMode(m_MachiningList(nI).m_nId, True)
|
||||||
|
EgtRemoveInfo(m_MachiningList(nI).m_nId, INFO_MCH_USER_OFF)
|
||||||
|
Else
|
||||||
|
EgtSetOperationMode(m_MachiningList(nI).m_nId, False)
|
||||||
|
EgtSetInfo(m_MachiningList(nI).m_nId, INFO_MCH_USER_OFF, True)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
' dichiaro ordine salvato
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.SetOrderMachiningFlag()
|
||||||
|
End Sub
|
||||||
|
|
||||||
Friend Function GetDisabledCutsCount() As Integer
|
Friend Function GetDisabledCutsCount() As Integer
|
||||||
' Determino il numero di tagli disabilitati
|
' Determino il numero di tagli disabilitati
|
||||||
Dim nCount As Integer = 0
|
Dim nCount As Integer = 0
|
||||||
@@ -2032,7 +2032,7 @@ Public Class SplitPageUC
|
|||||||
NextBtn.IsEnabled = (GetDisabledCutsCount() > 0 And GetSplitCutsCount() = 1)
|
NextBtn.IsEnabled = (GetDisabledCutsCount() > 0 And GetSplitCutsCount() = 1)
|
||||||
' Altrimenti
|
' Altrimenti
|
||||||
Else
|
Else
|
||||||
' movimento standard sulla tavola (almeno un taglio disabilitato)
|
' movimento standard sulla tavola (almeno un taglio disabilitato allora False)
|
||||||
Dim bStdTab As Boolean = (GetDisabledCutsCount() > 0)
|
Dim bStdTab As Boolean = (GetDisabledCutsCount() > 0)
|
||||||
' movimento su tavola di scarico
|
' movimento su tavola di scarico
|
||||||
m_bOnAuxTab = Not bStdTab AndAlso (m_nCurrPhase = EgtGetPhaseCount() And m_bEnableOnAuxTab)
|
m_bOnAuxTab = Not bStdTab AndAlso (m_nCurrPhase = EgtGetPhaseCount() And m_bEnableOnAuxTab)
|
||||||
@@ -2198,6 +2198,7 @@ Public Class SplitPageUC
|
|||||||
|
|
||||||
' gestione bottone per generazione ponticelli
|
' gestione bottone per generazione ponticelli
|
||||||
If Type = MCH_OY.WATERJETTING Then
|
If Type = MCH_OY.WATERJETTING Then
|
||||||
|
InvertBtn.Visibility = Visibility.Visible
|
||||||
' siccome la stessa posizione è occupata da due comandi sovrapposti
|
' siccome la stessa posizione è occupata da due comandi sovrapposti
|
||||||
If CutStartBtn.Visibility = Visibility.Hidden Then
|
If CutStartBtn.Visibility = Visibility.Hidden Then
|
||||||
BridgesWJBtn.Visibility = Visibility.Visible
|
BridgesWJBtn.Visibility = Visibility.Visible
|
||||||
|
|||||||
+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"
|
||||||
@@ -204,6 +206,7 @@ Module ConstIni
|
|||||||
Public Const K_OFFSZ As String = "OffsZ"
|
Public Const K_OFFSZ As String = "OffsZ"
|
||||||
Public Const K_OFFSXY As String = "OffsXY"
|
Public Const K_OFFSXY As String = "OffsXY"
|
||||||
Public Const K_OFFSYY As String = "OffsYY"
|
Public Const K_OFFSYY As String = "OffsYY"
|
||||||
|
Public Const K_OFFSXINTERY As String = "OffsYInterY"
|
||||||
Public Const K_STARTTRIM As String = "StartTrim"
|
Public Const K_STARTTRIM As String = "StartTrim"
|
||||||
Public Const K_ENDTRIM As String = "EndTrim"
|
Public Const K_ENDTRIM As String = "EndTrim"
|
||||||
Public Const K_OTHERSIDE As String = "OtherSide"
|
Public Const K_OTHERSIDE As String = "OtherSide"
|
||||||
@@ -223,6 +226,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 +341,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"
|
||||||
@@ -142,6 +151,10 @@
|
|||||||
Public Const K_PRODLIPROBINGTCPOS2VAR As String = "ProbingTcPos2Var"
|
Public Const K_PRODLIPROBINGTCPOS2VAR As String = "ProbingTcPos2Var"
|
||||||
Public Const K_PRODLISAWDIAMETER2VAR As String = "SawDiameter2Var"
|
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 S_STATISTICS As String = "Stats"
|
||||||
Public Const K_DATADIR As String = "DataDir"
|
Public Const K_DATADIR As String = "DataDir"
|
||||||
Public Const K_SHOWAREAS As String = "ShowAreas"
|
Public Const K_SHOWAREAS As String = "ShowAreas"
|
||||||
@@ -223,6 +236,7 @@
|
|||||||
Public Const K_HOLES_OFFSETWJ As String = "HolesOffsetWJ"
|
Public Const K_HOLES_OFFSETWJ As String = "HolesOffsetWJ"
|
||||||
Public Const K_MIN_RADIUSWJ As String = "MinRadiusWJ"
|
Public Const K_MIN_RADIUSWJ As String = "MinRadiusWJ"
|
||||||
Public Const K_MACH_DRILLINGWJ_ON_CORNERS As String = "DrillingWJOnCorners"
|
Public Const K_MACH_DRILLINGWJ_ON_CORNERS As String = "DrillingWJOnCorners"
|
||||||
|
Public Const K_MACH_RECTIFICATION_ON_SUBSQUARE As String = "RectificationSubSqWJ"
|
||||||
' DrillMillC90
|
' DrillMillC90
|
||||||
' CutLongDxSx
|
' CutLongDxSx
|
||||||
' AngRotMultiCut
|
' AngRotMultiCut
|
||||||
@@ -270,6 +284,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
|
||||||
|
|
||||||
|
If m_MainWindow.m_DirectCutPageUC.m_ActiveControl <> DirectCutPageUC.Controls.MachineButtonUC Or
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ActiveControl <> DirectCutPageUC.Controls.VacuumButtonUC Then
|
||||||
' Caso standard
|
' Caso standard
|
||||||
m_ActiveDirectCutPage = DirectCutPages.DirectCut
|
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>
|
||||||
@@ -264,8 +267,10 @@
|
|||||||
<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
|
||||||
@@ -421,6 +429,8 @@ Public Class DirectCutPageUC
|
|||||||
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 MCH_LOOK.TAB_TOOL
|
||||||
|
m_nMachLook = MCH_LOOK.TAB
|
||||||
Case Else
|
Case Else
|
||||||
m_nMachLook = MCH_LOOK.ALL
|
m_nMachLook = MCH_LOOK.ALL
|
||||||
End Select
|
End Select
|
||||||
@@ -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
|
||||||
|
|
||||||
@@ -33,6 +35,7 @@ Public Class MachineButtonsUC
|
|||||||
Private Const BTN_STATE_DOOR_OPENED As String = "DoorOpened"
|
Private Const BTN_STATE_DOOR_OPENED As String = "DoorOpened"
|
||||||
Private Const BTN_STATE_DOOR_CLOSED As String = "DoorClosed"
|
Private Const BTN_STATE_DOOR_CLOSED As String = "DoorClosed"
|
||||||
Private Const BTN_STATE_PARKING As String = "Parking"
|
Private Const BTN_STATE_PARKING As String = "Parking"
|
||||||
|
Private Const BTN_STATE_HOME As String = "Home"
|
||||||
Private Const BTN_ENABLE_ZONE_1 As String = "EnableZone1"
|
Private Const BTN_ENABLE_ZONE_1 As String = "EnableZone1"
|
||||||
Private Const BTN_ENABLE_ZONE_2 As String = "EnableZone2"
|
Private Const BTN_ENABLE_ZONE_2 As String = "EnableZone2"
|
||||||
Private Const BTN_ENABLE_PC As String = "EnablePC"
|
Private Const BTN_ENABLE_PC As String = "EnablePC"
|
||||||
@@ -76,6 +79,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 +273,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 +345,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 +381,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)
|
||||||
@@ -640,6 +712,40 @@ Public Class MachineButtonsUC
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Friend Sub HomeStateChanged(HomeState As Boolean)
|
||||||
|
Dim nIndex As Integer = Array.IndexOf(StateFlagArray, BTN_STATE_HOME)
|
||||||
|
If nIndex = -1 Then Return
|
||||||
|
If HomeState Then
|
||||||
|
GetToggleButton(nIndex + 1).IsChecked = True
|
||||||
|
Try
|
||||||
|
Dim s As String
|
||||||
|
If (m_MainWindow.m_OptionsPageUC.ThemesCmBx.SelectedIndex = 0) Then
|
||||||
|
s = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\" & ImageArrayY(nIndex)
|
||||||
|
Else
|
||||||
|
s = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\NewIcons\" & ImageArrayY(nIndex)
|
||||||
|
End If
|
||||||
|
Dim sButtonImageSource As ImageSource = ImageConverter.ConvertFromString(s)
|
||||||
|
GetImage(nIndex + 1).Source = sButtonImageSource
|
||||||
|
Catch ex As Exception
|
||||||
|
EgtOutLog("Error loading image " & ImageArrayY(nIndex + 1))
|
||||||
|
End Try
|
||||||
|
Else
|
||||||
|
GetToggleButton(nIndex + 1).IsChecked = False
|
||||||
|
Try
|
||||||
|
Dim s As String
|
||||||
|
If (m_MainWindow.m_OptionsPageUC.ThemesCmBx.SelectedIndex = 0) Then
|
||||||
|
s = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\" & ImageArrayY(nIndex)
|
||||||
|
Else
|
||||||
|
s = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\NewIcons\" & ImageArrayY(nIndex)
|
||||||
|
End If
|
||||||
|
Dim sButtonImageSource As ImageSource = ImageConverter.ConvertFromString(s)
|
||||||
|
GetImage(nIndex + 1).Source = sButtonImageSource
|
||||||
|
Catch ex As Exception
|
||||||
|
EgtOutLog("Error loading image " & ImageArrayN(nIndex + 1))
|
||||||
|
End Try
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
Friend Sub EnableZoneStateChanged(ZoneState As Integer)
|
Friend Sub EnableZoneStateChanged(ZoneState As Integer)
|
||||||
Dim sFlag As String = String.Empty
|
Dim sFlag As String = String.Empty
|
||||||
If ZoneState = 1 Then
|
If ZoneState = 1 Then
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -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
|
||||||
@@ -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,8 +567,8 @@ 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
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ Public Class CompoDimensionUC
|
|||||||
InternComponentBtn.Content = EgtMsg(MSG_COMPONENTPAGEUC + 47) ' Componenti interni
|
InternComponentBtn.Content = EgtMsg(MSG_COMPONENTPAGEUC + 47) ' Componenti interni
|
||||||
If Not String.IsNullOrEmpty(sCompoDir) Then
|
If Not String.IsNullOrEmpty(sCompoDir) Then
|
||||||
bEnableAlzFront = True
|
bEnableAlzFront = True
|
||||||
AlzFrontBtn.Content = "Alzatine & Frontalini"
|
AlzFrontBtn.Content = EgtMsg(91137)
|
||||||
Else
|
Else
|
||||||
AlzFrontBtn.Visibility = Visibility.Collapsed
|
AlzFrontBtn.Visibility = Visibility.Collapsed
|
||||||
End If
|
End If
|
||||||
@@ -107,8 +107,10 @@ Public Class CompoDimensionUC
|
|||||||
Friend Sub ShowAlzFrontBtn(ByVal value As Boolean)
|
Friend Sub ShowAlzFrontBtn(ByVal value As Boolean)
|
||||||
If value Then
|
If value Then
|
||||||
AlzFrontBtn.Visibility = Visibility.Visible
|
AlzFrontBtn.Visibility = Visibility.Visible
|
||||||
|
m_MainWindow.m_DrawPageUC.MessageGrid.Visibility = Visibility.Hidden
|
||||||
Else
|
Else
|
||||||
AlzFrontBtn.Visibility = Visibility.Hidden
|
AlzFrontBtn.Visibility = Visibility.Hidden
|
||||||
|
m_MainWindow.m_DrawPageUC.MessageGrid.Visibility = Visibility.Visible
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|||||||
@@ -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,33 @@ Public Class DrawPageUC
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
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())
|
||||||
|
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
|
||||||
|
' 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
|
||||||
|
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 +1180,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)
|
||||||
|
If m_MainWindow.FrameCutBtn.IsChecked Then
|
||||||
|
MakeSectionFrameInsert(InsNbr)
|
||||||
|
Else
|
||||||
MakeMultipleInsert(InsNbr, sPartName)
|
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 +1199,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 +1220,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
|
||||||
|
|||||||
@@ -39,7 +39,8 @@ Public Class FiloTopUC
|
|||||||
|
|
||||||
' Imposto messaggi
|
' Imposto messaggi
|
||||||
ParameterTxBl.Text = EgtMsg( MSG_IMPORTPAGEUC + 10) ' Offset
|
ParameterTxBl.Text = EgtMsg( MSG_IMPORTPAGEUC + 10) ' Offset
|
||||||
Parameter2TxBl.Text = EgtMsg( MSG_IMPORTPAGEUC + 11) ' Affondamento
|
Parameter2TxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 11) ' Affondamento
|
||||||
|
Parameter3TxBl.Text = EgtMsg(91138)
|
||||||
|
|
||||||
If m_CallingPage = MainWindow.Pages.Draw Then
|
If m_CallingPage = MainWindow.Pages.Draw Then
|
||||||
' Imposto questa come pagina correntemente visualizzata nella drawpage
|
' Imposto questa come pagina correntemente visualizzata nella drawpage
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
<ListBox Name="FileListBox" Grid.Row="1" Grid.RowSpan="2" ItemTemplate="{DynamicResource DataTemplateItem}"
|
<ListBox Name="FileListBox" Grid.Row="1" Grid.RowSpan="2" ItemTemplate="{DynamicResource DataTemplateItem}"
|
||||||
ItemsSource="{Binding ItemList}"/>
|
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>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="4*"/>
|
<ColumnDefinition Width="4*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ Public Class ImportPageUC
|
|||||||
Friend WithEvents ImportScene As New Scene
|
Friend WithEvents ImportScene As New Scene
|
||||||
Private ImportSceneHost As New System.Windows.Forms.Integration.WindowsFormsHost
|
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
|
' Properties
|
||||||
Private m_sCurrDir As String = String.Empty
|
Private m_sCurrDir As String = String.Empty
|
||||||
Private m_sCurrFile 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
|
' abilitazione Ordine e Distinta per importazione DXF
|
||||||
m_bEnableOrderList = (m_MainWindow.m_PrevActivePage = MainWindow.Pages.CadCut And
|
m_bEnableOrderList = (m_MainWindow.m_PrevActivePage = MainWindow.Pages.CadCut And
|
||||||
GetPrivateProfileInt(S_COMPO, K_CSVDATA, 0, m_MainWindow.GetIniFile()) <> 0)
|
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
|
If m_bFirst Then
|
||||||
' imposto colore di default
|
' imposto colore di default
|
||||||
@@ -196,7 +201,6 @@ Public Class ImportPageUC
|
|||||||
PartNumTxBx.Text = "1"
|
PartNumTxBx.Text = "1"
|
||||||
' disabilito ok
|
' disabilito ok
|
||||||
OkBtn.IsEnabled = False
|
OkBtn.IsEnabled = False
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub LoadGridData()
|
Private Sub LoadGridData()
|
||||||
@@ -569,6 +573,8 @@ Public Class ImportPageUC
|
|||||||
EgtSetColor(nEntId, New Color3d(127, 63, 0))
|
EgtSetColor(nEntId, New Color3d(127, 63, 0))
|
||||||
nEntId = EgtGetNext( nEntId)
|
nEntId = EgtGetNext( nEntId)
|
||||||
End While
|
End While
|
||||||
|
m_DeselectListHole.Add(nLayId)
|
||||||
|
m_SelListHole.Remove(nLayId)
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
Dim nLayId As Integer = GDB_ID.NULL
|
Dim nLayId As Integer = GDB_ID.NULL
|
||||||
@@ -585,6 +591,8 @@ Public Class ImportPageUC
|
|||||||
EgtSetColor(nEntId, New Color3d(255, 255, 255))
|
EgtSetColor(nEntId, New Color3d(255, 255, 255))
|
||||||
nEntId = EgtGetNext( nEntId)
|
nEntId = EgtGetNext( nEntId)
|
||||||
End While
|
End While
|
||||||
|
m_SelListHole.Add(nLayId)
|
||||||
|
m_DeselectListHole.Remove(nLayId)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
@@ -592,6 +600,12 @@ Public Class ImportPageUC
|
|||||||
End If
|
End If
|
||||||
nId = EgtGetNextObjInSelWin()
|
nId = EgtGetNextObjInSelWin()
|
||||||
End While
|
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
|
End Sub
|
||||||
|
|
||||||
Private Sub OnShowDistanceVector(sender As Object, vtDist As Vector3d) Handles ImportScene.OnShowDistanceVector
|
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
|
Private Sub SideAngleBtn_Click(sender As Object, e As RoutedEventArgs) Handles SideAngleBtn.Click
|
||||||
If SideAngleBtn.IsChecked() Then
|
If SideAngleBtn.IsChecked() Then
|
||||||
|
FinderGrd.Visibility = Visibility.Hidden
|
||||||
' Aggiungo regioni per percorsi interni
|
' Aggiungo regioni per percorsi interni
|
||||||
AdjustSelectRegions()
|
AdjustSelectRegions()
|
||||||
' Dichiaro nessuna selezione
|
' Dichiaro nessuna selezione
|
||||||
@@ -1062,6 +1077,7 @@ Public Class ImportPageUC
|
|||||||
MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 6) ' Selezionare un contorno
|
MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 6) ' Selezionare un contorno
|
||||||
MessageBrd.Background = Application.Current.FindResource("OmagCut_Green")
|
MessageBrd.Background = Application.Current.FindResource("OmagCut_Green")
|
||||||
Else
|
Else
|
||||||
|
FinderGrd.Visibility = Visibility.Visible
|
||||||
' Rimuovo regioni per percorsi interni
|
' Rimuovo regioni per percorsi interni
|
||||||
RemoveSelectRegions()
|
RemoveSelectRegions()
|
||||||
FilePathTxBl.Visibility = Windows.Visibility.Visible
|
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
|
Private Sub DripCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles DripCutBtn.Click
|
||||||
If DripCutBtn.IsChecked() Then
|
If DripCutBtn.IsChecked() Then
|
||||||
|
FinderGrd.Visibility = Visibility.Hidden
|
||||||
' Dichiaro nessuna selezione
|
' Dichiaro nessuna selezione
|
||||||
m_nSelectedPart = GDB_ID.NULL
|
m_nSelectedPart = GDB_ID.NULL
|
||||||
m_nSelectedLayer = GDB_ID.NULL
|
m_nSelectedLayer = GDB_ID.NULL
|
||||||
@@ -1112,6 +1129,7 @@ Public Class ImportPageUC
|
|||||||
MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 6) ' Selezionare un contorno
|
MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 6) ' Selezionare un contorno
|
||||||
MessageBrd.Background = Application.Current.FindResource("OmagCut_Green")
|
MessageBrd.Background = Application.Current.FindResource("OmagCut_Green")
|
||||||
Else
|
Else
|
||||||
|
FinderGrd.Visibility = Visibility.Visible
|
||||||
FilePathTxBl.Visibility = Windows.Visibility.Visible
|
FilePathTxBl.Visibility = Windows.Visibility.Visible
|
||||||
FileListBox.Visibility = Windows.Visibility.Visible
|
FileListBox.Visibility = Windows.Visibility.Visible
|
||||||
LeftGrid.Children.Remove(m_SideAngleUC)
|
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
|
Private Sub DripDrillBtn_Click(sender As Object, e As RoutedEventArgs) Handles DripDrillBtn.Click
|
||||||
If DripDrillBtn.IsChecked() Then
|
If DripDrillBtn.IsChecked() Then
|
||||||
|
FinderGrd.Visibility = Visibility.Hidden
|
||||||
' Aggiungo regioni di selezione per percorsi interni
|
' Aggiungo regioni di selezione per percorsi interni
|
||||||
AdjustSelectRegions()
|
AdjustSelectRegions()
|
||||||
' Imposto modalità fori da sotto
|
' Imposto modalità fori da sotto
|
||||||
@@ -1160,6 +1179,7 @@ Public Class ImportPageUC
|
|||||||
MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 15) ' Selezionare uno o più fori
|
MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 15) ' Selezionare uno o più fori
|
||||||
MessageBrd.Background = Application.Current.FindResource("OmagCut_Green")
|
MessageBrd.Background = Application.Current.FindResource("OmagCut_Green")
|
||||||
Else
|
Else
|
||||||
|
FinderGrd.Visibility = Visibility.Visible
|
||||||
' Rimuovo regioni per percorsi interni
|
' Rimuovo regioni per percorsi interni
|
||||||
RemoveSelectRegions()
|
RemoveSelectRegions()
|
||||||
FilePathTxBl.Visibility = Windows.Visibility.Visible
|
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
|
Private Sub FiloTopBtn_Click(sender As Object, e As RoutedEventArgs) Handles FiloTopBtn.Click
|
||||||
If FiloTopBtn.IsChecked() Then
|
If FiloTopBtn.IsChecked() Then
|
||||||
|
FinderGrd.Visibility = Visibility.Hidden
|
||||||
' Aggiungo regioni per percorsi interni
|
' Aggiungo regioni per percorsi interni
|
||||||
AdjustSelectRegions()
|
AdjustSelectRegions()
|
||||||
' Dichiaro nessuna selezione
|
' Dichiaro nessuna selezione
|
||||||
@@ -1208,6 +1229,7 @@ Public Class ImportPageUC
|
|||||||
MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 6) ' Selezionare un contorno interno
|
MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 6) ' Selezionare un contorno interno
|
||||||
MessageBrd.Background = Application.Current.FindResource("OmagCut_Green")
|
MessageBrd.Background = Application.Current.FindResource("OmagCut_Green")
|
||||||
Else
|
Else
|
||||||
|
FinderGrd.Visibility = Visibility.Visible
|
||||||
' Rimuovo regioni per percorsi interni
|
' Rimuovo regioni per percorsi interni
|
||||||
RemoveSelectRegions()
|
RemoveSelectRegions()
|
||||||
FilePathTxBl.Visibility = Windows.Visibility.Visible
|
FilePathTxBl.Visibility = Windows.Visibility.Visible
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ Public Class MainComponentPageUC
|
|||||||
m_MainWindow.m_DrawPageUC.FiloTopBtn.IsEnabled = False
|
m_MainWindow.m_DrawPageUC.FiloTopBtn.IsEnabled = False
|
||||||
m_MainWindow.m_DrawPageUC.EngraveBtn.IsEnabled = False
|
m_MainWindow.m_DrawPageUC.EngraveBtn.IsEnabled = False
|
||||||
m_MainWindow.m_DrawPageUC.DripCutBtn.IsEnabled = False
|
m_MainWindow.m_DrawPageUC.DripCutBtn.IsEnabled = False
|
||||||
|
m_MainWindow.m_DrawPageUC.m_bBackFromInternalCompo = False
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function GetButton(ByVal nInd As Integer) As Button
|
Private Function GetButton(ByVal nInd As Integer) As Button
|
||||||
@@ -167,7 +168,7 @@ Public Class MainComponentPageUC
|
|||||||
|
|
||||||
Private Sub Compo_Click(sender As Object, e As RoutedEventArgs) Handles Compo1.Click, Compo2.Click, Compo3.Click, Compo4.Click, Compo5.Click, Compo6.Click, Compo7.Click, Compo8.Click
|
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,6 +252,11 @@ 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())
|
||||||
@@ -325,16 +331,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
|
||||||
|
|||||||
@@ -39,6 +39,15 @@
|
|||||||
<Button Name="RawPartBtn" Grid.Column="1" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
|
<Button Name="RawPartBtn" Grid.Column="1" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
|
||||||
<Image Source="{DynamicResource RawPartImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
<Image Source="{DynamicResource RawPartImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||||
</Button>
|
</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}">
|
<ToggleButton Name="MachiningBtn" Grid.Column="4" Style="{DynamicResource OmagCut_RightGrayYellowIconToggleButton}">
|
||||||
<Image Source="{DynamicResource FrameMachiningImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
<Image Source="{DynamicResource FrameMachiningImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
@@ -63,8 +72,10 @@
|
|||||||
<RowDefinition Height="0.5*"/>
|
<RowDefinition Height="0.5*"/>
|
||||||
<RowDefinition Height="0.5*"/>
|
<RowDefinition Height="0.5*"/>
|
||||||
<RowDefinition Height="0.5*"/>
|
<RowDefinition Height="0.5*"/>
|
||||||
|
<RowDefinition Height="0.5*"/>
|
||||||
<RowDefinition Height="0.8*"/>
|
<RowDefinition Height="0.8*"/>
|
||||||
<RowDefinition Height="2.5*"/>
|
<RowDefinition Height="0.8*"/>
|
||||||
|
<RowDefinition Height="1.7*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<ComboBox Name="AlongAxCmBx" Grid.Row="0" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_ComboBox}"
|
<ComboBox Name="AlongAxCmBx" Grid.Row="0" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_ComboBox}"
|
||||||
@@ -77,14 +88,13 @@
|
|||||||
</ComboBox>
|
</ComboBox>
|
||||||
|
|
||||||
<UniformGrid Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" >
|
<UniformGrid Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" >
|
||||||
<Button Name="SelSectionBtn"
|
<!--<Button Name="SelSectionBtn"
|
||||||
Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
|
Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
|
||||||
<Image Source="{DynamicResource Sezione-corniceImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
|
<Image Source="{DynamicResource Sezione-corniceImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
|
||||||
</Button>
|
</Button>-->
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<Button Name="SelGuideBtn"
|
<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}"/>
|
||||||
@@ -113,7 +123,12 @@
|
|||||||
<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" >
|
<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"
|
<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}"/>
|
||||||
@@ -124,6 +139,13 @@
|
|||||||
</Button>
|
</Button>
|
||||||
</UniformGrid>
|
</UniformGrid>
|
||||||
|
|
||||||
|
<!--<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"
|
<!--<TextBlock Name="SawRoughingTxBl" Grid.Row="4" Grid.ColumnSpan="3"
|
||||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,8 @@ Public Class FrameCutPageUC
|
|||||||
OffsXyTxBx.Text = LenToString(dOffsXY, 3)
|
OffsXyTxBx.Text = LenToString(dOffsXY, 3)
|
||||||
Dim dOffsYY As Double = GetPrivateProfileDouble(S_FRAME, K_OFFSYY, 5, m_MainWindow.GetIniFile())
|
Dim dOffsYY As Double = GetPrivateProfileDouble(S_FRAME, K_OFFSYY, 5, m_MainWindow.GetIniFile())
|
||||||
OffsYyTxBx.Text = LenToString(dOffsYY, 3)
|
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
|
' Imposto i messaggi letti dal file dei messaggi
|
||||||
m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 1)) 'Lungo X
|
m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 1)) 'Lungo X
|
||||||
@@ -70,6 +72,7 @@ Public Class FrameCutPageUC
|
|||||||
OffsZTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 8) 'Distanza sopra
|
OffsZTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 8) 'Distanza sopra
|
||||||
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 9) 'Distanza inizio
|
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 9) 'Distanza inizio
|
||||||
OffsYyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 22) 'Distanza Y
|
OffsYyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 22) 'Distanza Y
|
||||||
|
OffsXInteryTxBl.Text = EgtMsg(90645) 'Interasse
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub FrameCutPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
Private Sub FrameCutPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||||
@@ -81,6 +84,12 @@ 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
|
||||||
|
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
|
' Recupero dimensioni e kerf del grezzo
|
||||||
m_nRawId = EgtGetFirstRawPart()
|
m_nRawId = EgtGetFirstRawPart()
|
||||||
GetRawBox(m_RawBox)
|
GetRawBox(m_RawBox)
|
||||||
@@ -271,7 +280,7 @@ Public Class FrameCutPageUC
|
|||||||
End If
|
End If
|
||||||
End Sub
|
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
|
' Forzo aggiornamento grezzo nella pagina di Nesting
|
||||||
m_MainWindow.m_CadCutPageUC.m_NestPage.CalcRawPart()
|
m_MainWindow.m_CadCutPageUC.m_NestPage.CalcRawPart()
|
||||||
' Parcheggio pezzi presenti nel grezzo
|
' Parcheggio pezzi presenti nel grezzo
|
||||||
@@ -296,9 +305,13 @@ Public Class FrameCutPageUC
|
|||||||
WritePrivateProfileString(S_FRAME, K_OFFSXY, DoubleToString(dOffsXy, 3), m_MainWindow.GetIniFile())
|
WritePrivateProfileString(S_FRAME, K_OFFSXY, DoubleToString(dOffsXy, 3), m_MainWindow.GetIniFile())
|
||||||
End If
|
End If
|
||||||
Dim dOffsYy As Double = 0
|
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())
|
WritePrivateProfileString(S_FRAME, K_OFFSYY, DoubleToString(dOffsYy, 3), m_MainWindow.GetIniFile())
|
||||||
End If
|
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
|
End Sub
|
||||||
|
|
||||||
Private Sub MirrorPartBtn_Click(sender As Object, e As RoutedEventArgs) Handles MirrorPartBtn.Click
|
Private Sub MirrorPartBtn_Click(sender As Object, e As RoutedEventArgs) Handles MirrorPartBtn.Click
|
||||||
@@ -436,6 +449,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)
|
||||||
@@ -936,12 +959,18 @@ Public Class FrameCutPageUC
|
|||||||
' Determino distanza da spessore lama
|
' Determino distanza da spessore lama
|
||||||
Dim dMinDist As Double = 0
|
Dim dMinDist As Double = 0
|
||||||
Dim dSawThick 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
|
If EgtTdbSetCurrTool(m_MainWindow.m_CurrentMachine.sCurrSaw) AndAlso
|
||||||
EgtTdbGetCurrToolParam(MCH_TP.THICK, dSawThick) Then
|
EgtTdbGetCurrToolParam(MCH_TP.THICK, dSawThick) Then
|
||||||
|
If dOffsXIntery <= dSawThick Then
|
||||||
dMinDist = dSawThick + 5 * EPS_SMALL
|
dMinDist = dSawThick + 5 * EPS_SMALL
|
||||||
|
Else
|
||||||
|
dMinDist = dOffsXIntery + 5 * EPS_SMALL
|
||||||
|
End If
|
||||||
Else
|
Else
|
||||||
EgtOutLog("Not found current saw for frames mindist")
|
EgtOutLog("Not found current saw for frames mindist")
|
||||||
dMinDist = 0
|
dMinDist = dOffsXIntery
|
||||||
End If
|
End If
|
||||||
' Inserisco il pezzo nel grezzo
|
' Inserisco il pezzo nel grezzo
|
||||||
Dim ptIns As Point3d
|
Dim ptIns As Point3d
|
||||||
|
|||||||
@@ -184,6 +184,31 @@
|
|||||||
|
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
|
<!--Parametri rettifica tagli sottosquadra: 1 Parametro -->
|
||||||
|
<GroupBox Name="RectificationWJParamGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="2" >
|
||||||
|
<Grid Grid.Column="3" Grid.Row="2">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="2*"/>
|
||||||
|
<ColumnDefinition Width="2*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<TextBlock Name="EnableRectificationTxBl" Grid.Row="0" Grid.ColumnSpan="2"
|
||||||
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" />
|
||||||
|
<CheckBox Name="EnableRectificationChBx" Grid.Row="0" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_CheckBox_Single}"
|
||||||
|
HorizontalAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
|
||||||
|
<!--<TextBlock Name="OffsetRectificationTxBl" Grid.Row="1" Grid.Column="0"
|
||||||
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||||
|
<EgtWPFLib:EgtTextBox Name="OffsetRectificationTxBx" Grid.Row="1" Grid.Column="1" Margin="10,0,10,0"
|
||||||
|
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>-->
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</GroupBox>
|
||||||
|
|
||||||
<!--Parametri WaterJet: 5 Parametro (se questo GroupBox attivo allora nascondo Fori/Fresatura)-->
|
<!--Parametri WaterJet: 5 Parametro (se questo GroupBox attivo allora nascondo Fori/Fresatura)-->
|
||||||
<GroupBox Name="WjsParamGpBx" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Grid.RowSpan="4"
|
<GroupBox Name="WjsParamGpBx" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Grid.RowSpan="4"
|
||||||
Style="{DynamicResource OmagCut_GroupBox}">
|
Style="{DynamicResource OmagCut_GroupBox}">
|
||||||
|
|||||||
@@ -97,7 +97,10 @@ Public Class AlarmsPageUC
|
|||||||
HolesOffsetWJTxBl.Text = "Offset"
|
HolesOffsetWJTxBl.Text = "Offset"
|
||||||
MinRadiusWJTxBl.Text = "Min Radius"
|
MinRadiusWJTxBl.Text = "Min Radius"
|
||||||
OneHoleInCornerWJTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 26)
|
OneHoleInCornerWJTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 26)
|
||||||
'-- FINE -- nuovi parametri per preforo lavello
|
'-- INIZIO -- nuovi parametro Rettifica tagli sottosquadra WJ
|
||||||
|
REctificationWJParamGpBx.Header = "Rectification"
|
||||||
|
EnableRectificationTxBl.Text = "Enable (on subsquare angle)"
|
||||||
|
'-- FINE -- nuovi parametro Rettifica tagli sottosquadra WJ
|
||||||
NestingParamGpBx.Header = EgtMsg(MSG_ALARMSPAGEUC + 31) ' Nesting
|
NestingParamGpBx.Header = EgtMsg(MSG_ALARMSPAGEUC + 31) ' Nesting
|
||||||
AlignTxBl.Text = EgtMsg(90932) ' Allineato
|
AlignTxBl.Text = EgtMsg(90932) ' Allineato
|
||||||
GhigliottinaTxBl.Text = EgtMsg(91066) ' Ghigliottina
|
GhigliottinaTxBl.Text = EgtMsg(91066) ' Ghigliottina
|
||||||
@@ -175,6 +178,7 @@ Public Class AlarmsPageUC
|
|||||||
' Se non previsti tagli waterjet, disabilito relativo box
|
' Se non previsti tagli waterjet, disabilito relativo box
|
||||||
If Not m_CurrentMachine.bWaterJetting Then
|
If Not m_CurrentMachine.bWaterJetting Then
|
||||||
WjsParamGpBx.Visibility = Visibility.Hidden
|
WjsParamGpBx.Visibility = Visibility.Hidden
|
||||||
|
RectificationWJParamGpBx.Visibility = Visibility.Hidden
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' Abilitazione box per contorni grezzo da foto
|
' Abilitazione box per contorni grezzo da foto
|
||||||
@@ -354,7 +358,9 @@ Public Class AlarmsPageUC
|
|||||||
MinRadiusWJTxBx.Text = LenToString(dVal, 2)
|
MinRadiusWJTxBx.Text = LenToString(dVal, 2)
|
||||||
OneHoleInCornerWJChBx.IsChecked =
|
OneHoleInCornerWJChBx.IsChecked =
|
||||||
(GetPrivateProfileInt(S_MACH_NEST, K_MACH_DRILLINGWJ_ON_CORNERS, 1, m_MainWindow.GetMachIniFile()) <> 0)
|
(GetPrivateProfileInt(S_MACH_NEST, K_MACH_DRILLINGWJ_ON_CORNERS, 1, m_MainWindow.GetMachIniFile()) <> 0)
|
||||||
|
' leggo se attiva la rettifica degli angoli per WaterJet
|
||||||
|
EnableRectificationChBx.IsChecked =
|
||||||
|
(GetPrivateProfileInt(S_MACH_NEST, K_MACH_RECTIFICATION_ON_SUBSQUARE, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||||
' Leggo accorciamento angoli con fresa
|
' Leggo accorciamento angoli con fresa
|
||||||
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_MILLING_SHORTENING, 0, m_MainWindow.GetMachIniFile())
|
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_MILLING_SHORTENING, 0, m_MainWindow.GetMachIniFile())
|
||||||
ShortTxBx.Text = LenToString(dVal, 2)
|
ShortTxBx.Text = LenToString(dVal, 2)
|
||||||
@@ -970,9 +976,18 @@ Public Class AlarmsPageUC
|
|||||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_DRILLINGWJ_ON_CORNERS, "0", m_MainWindow.GetMachIniFile())
|
WritePrivateProfileString(S_MACH_NEST, K_MACH_DRILLINGWJ_ON_CORNERS, "0", m_MainWindow.GetMachIniFile())
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
' -- FINE -- nuovi parametri per prefori WaterJet
|
' -- FINE -- nuovi parametri per prefori WaterJet
|
||||||
|
|
||||||
|
' -- INIZIO -- nuovi parametri per Rettifica angoli in sottosquadra WaterJet
|
||||||
|
Private Sub EnableRectificationChBx_Click(sender As Object, e As EventArgs) Handles EnableRectificationChBx.Click
|
||||||
|
If EnableRectificationChBx.IsChecked() Then
|
||||||
|
WritePrivateProfileString(S_MACH_NEST, K_MACH_RECTIFICATION_ON_SUBSQUARE, "1", m_MainWindow.GetMachIniFile)
|
||||||
|
Else
|
||||||
|
WritePrivateProfileString(S_MACH_NEST, K_MACH_RECTIFICATION_ON_SUBSQUARE, "0", m_MainWindow.GetMachIniFile)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
' -- FINE -- nuovi parametri per Rettifica angoli in sottosquadra WaterJet
|
||||||
|
|
||||||
Private Sub TmEnableChBx_Click(sender As Object, e As RoutedEventArgs) Handles TmEnableChBx.Click
|
Private Sub TmEnableChBx_Click(sender As Object, e As RoutedEventArgs) Handles TmEnableChBx.Click
|
||||||
If TmEnableChBx.IsChecked() Then
|
If TmEnableChBx.IsChecked() Then
|
||||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_ENGRAVING_WITHMILL, "1", m_MainWindow.GetMachIniFile())
|
WritePrivateProfileString(S_MACH_NEST, K_MACH_ENGRAVING_WITHMILL, "1", m_MainWindow.GetMachIniFile())
|
||||||
@@ -1163,6 +1178,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 +1204,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 +1253,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 +1307,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 +1319,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
|
||||||
|
' Se fanuc il dato è in mm (NON MICRON)
|
||||||
|
If m_MainWindow.m_CNCommunication.m_nNCType <> 4 Then
|
||||||
dVal = dVal / 1000
|
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)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
Imports System.Collections.ObjectModel
|
Imports System.Collections.ObjectModel
|
||||||
Imports EgtWPFLib5
|
Imports EgtWPFLib5
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
|
Imports System.IO
|
||||||
|
|
||||||
Public Class CurrentMachine
|
Public Class CurrentMachine
|
||||||
|
|
||||||
@@ -51,6 +52,8 @@ Public Class CurrentMachine
|
|||||||
Private m_sProdLiProbingState2Var As String = ""
|
Private m_sProdLiProbingState2Var As String = ""
|
||||||
Private m_sProdLiProbingTcPos2Var As String = ""
|
Private m_sProdLiProbingTcPos2Var As String = ""
|
||||||
Private m_sProdLiSawDiameter2Var As String = ""
|
Private m_sProdLiSawDiameter2Var As String = ""
|
||||||
|
Private m_sClickState As String = "E80028"
|
||||||
|
Private m_sClickDir As String = ""
|
||||||
|
|
||||||
' Numero e tipo di utensili correntemente disponibili sulla macchina
|
' Numero e tipo di utensili correntemente disponibili sulla macchina
|
||||||
Private m_MountedToolConfig As MountedToolConfigs = MountedToolConfigs.SAW
|
Private m_MountedToolConfig As MountedToolConfigs = MountedToolConfigs.SAW
|
||||||
@@ -77,6 +80,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
|
||||||
|
|
||||||
@@ -321,6 +327,18 @@ Public Class CurrentMachine
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
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 Function sProdLiProbingStateVar(nI As Integer) As String
|
Friend Function sProdLiProbingStateVar(nI As Integer) As String
|
||||||
If nI = 1 Then Return m_sProdLiProbingStateVar
|
If nI = 1 Then Return m_sProdLiProbingStateVar
|
||||||
If nI = 2 Then Return m_sProdLiProbingState2Var
|
If nI = 2 Then Return m_sProdLiProbingState2Var
|
||||||
@@ -752,6 +770,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()
|
||||||
@@ -1144,6 +1168,13 @@ Public Class CurrentMachine
|
|||||||
GetPrivateProfileString(S_PRODUCTIONLINE, K_PRODLIPROBINGTCPOS2VAR, "0", m_sProdLiProbingTcPos2Var, sMachIniFile)
|
GetPrivateProfileString(S_PRODUCTIONLINE, K_PRODLIPROBINGTCPOS2VAR, "0", m_sProdLiProbingTcPos2Var, sMachIniFile)
|
||||||
GetPrivateProfileString(S_PRODUCTIONLINE, K_PRODLISAWDIAMETER2VAR, "", m_sProdLiSawDiameter2Var, 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
|
' Leggo configurazione degli utensili in macchina
|
||||||
m_MountedToolConfig = GetPrivateProfileInt(S_TOOLS, K_MOUNTEDTOOLCONFIG, 0, sMachIniFile)
|
m_MountedToolConfig = GetPrivateProfileInt(S_TOOLS, K_MOUNTEDTOOLCONFIG, 0, sMachIniFile)
|
||||||
' Leggo flag presenza tipologie utensili
|
' Leggo flag presenza tipologie utensili
|
||||||
@@ -1200,6 +1231,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 +1384,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
|
||||||
|
|||||||
@@ -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,28 @@ 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
|
||||||
|
' modifica richiesta 26/05/2023 da Rosario per cliente Lanzetta
|
||||||
|
If m_MainWindow.m_CNCommunication.m_nNCType = 4 Then
|
||||||
|
dRealFeed = m_CN.d_DInterpo_Prog_Feed
|
||||||
|
Else
|
||||||
|
dRealFeed = m_CN.d_DInterpo_Prog_Feed * m_CN.d_DInterpo_Feed_override / 100
|
||||||
|
End If
|
||||||
'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 +310,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)
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ Public Class PolishingsPageUC
|
|||||||
RepeatTxBl.Text = EgtMsg(91093) ' Ripetizioni
|
RepeatTxBl.Text = EgtMsg(91093) ' Ripetizioni
|
||||||
StepTxBl.Text = EgtMsg(90787) ' Passo
|
StepTxBl.Text = EgtMsg(90787) ' Passo
|
||||||
OffSetTxBl.Text = EgtMsg(91089) ' Offset
|
OffSetTxBl.Text = EgtMsg(91089) ' Offset
|
||||||
RadiusTxBl.Text = "Raggio"
|
RadiusTxBl.Text = EgtMsg(91139) ' Raggio
|
||||||
DistanceTxBl.Text = "Distanza"
|
DistanceTxBl.Text = EgtMsg(91140) ' Distanza
|
||||||
LiLoGpBx.Header = EgtMsg(91094) ' Attacco/Uscita
|
LiLoGpBx.Header = EgtMsg(91094) ' Attacco/Uscita
|
||||||
LiLenTxBl.Text = EgtMsg(91097) ' Lunghezza
|
LiLenTxBl.Text = EgtMsg(91097) ' Lunghezza
|
||||||
LiHeightTxBl.Text = EgtMsg(91095) ' Altezza
|
LiHeightTxBl.Text = EgtMsg(91095) ' Altezza
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
+1
-1
@@ -53,7 +53,7 @@
|
|||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
</Grid>
|
</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}"/>
|
<Image Source="{DynamicResource XImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
|
|||||||
+21
-4
@@ -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
|
||||||
@@ -98,6 +100,7 @@ Class MainWindow
|
|||||||
OFFICE_TYPE = 2 ^ 19 ' 524288
|
OFFICE_TYPE = 2 ^ 19 ' 524288
|
||||||
REGISTRATION = 2 ^ 20 ' 1048576
|
REGISTRATION = 2 ^ 20 ' 1048576
|
||||||
SIMPLESTATISTICS = 2 ^ 21 ' 2097152
|
SIMPLESTATISTICS = 2 ^ 21 ' 2097152
|
||||||
|
COMPOFRAME = 2 ^ 22 ' 4194304
|
||||||
End Enum
|
End Enum
|
||||||
' Opzione nesting automatico
|
' Opzione nesting automatico
|
||||||
Private m_bAutoNest As Boolean = False
|
Private m_bAutoNest As Boolean = False
|
||||||
@@ -326,8 +329,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, 2506, 1, m_nKeyLevel) And
|
||||||
EgtGetKeyOptions(9423, 2501, 1, m_nKeyOptions)
|
EgtGetKeyOptions(9423, 2506, 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
|
||||||
@@ -558,7 +561,7 @@ Class MainWindow
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
' --------------------------------- SLAB DB -------------------------------------------------------
|
' --------------------------------- SLAB DB -------------------------------------------------------
|
||||||
|
ExitBtn.ToolTip = "Exit" & vbCrLf & "Minimize (Shift)"
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ManageSingleIstance()
|
Private Sub ManageSingleIstance()
|
||||||
@@ -1085,6 +1088,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
|
||||||
@@ -1211,7 +1227,8 @@ Class MainWindow
|
|||||||
m_ProdLineTimer.Interval = TimeSpan.FromMilliseconds(2000)
|
m_ProdLineTimer.Interval = TimeSpan.FromMilliseconds(2000)
|
||||||
m_ProdLineTimer.Start()
|
m_ProdLineTimer.Start()
|
||||||
End If
|
End If
|
||||||
|
' di default attivo la pagina CadCut
|
||||||
|
m_ActivePage = MainWindow.Pages.CadCut
|
||||||
' seleziono il tipo di avvio
|
' seleziono il tipo di avvio
|
||||||
m_CurrentProjectPageUC.StartProgram()
|
m_CurrentProjectPageUC.StartProgram()
|
||||||
' aggiorno la grafica
|
' aggiorno la grafica
|
||||||
|
|||||||
@@ -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.6.2")>
|
||||||
<Assembly: AssemblyFileVersion("2.5.1.2")>
|
<Assembly: AssemblyFileVersion("2.5.6.2")>
|
||||||
|
|||||||
+323
-3
@@ -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,10 +127,16 @@ 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
|
||||||
|
|
||||||
|
If Not String.IsNullOrEmpty(m_MainWindow.m_CurrentMachine.sClickState) Then
|
||||||
|
ClickOnPolishLine()
|
||||||
|
End If
|
||||||
|
|
||||||
m_bTimerBusy = False
|
m_bTimerBusy = False
|
||||||
m_RefreshTimer.Start()
|
m_RefreshTimer.Start()
|
||||||
Else
|
Else
|
||||||
@@ -129,8 +145,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 +252,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,6 +389,11 @@ 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
|
||||||
|
|
||||||
|
' Solo per controllo FANUNC
|
||||||
|
GetPrivateProfileString(S_NCDATA, K_NAXES, "", sVal, m_MainWindow.GetMachIniFile())
|
||||||
|
m_CN.SetCnDataVar(CN_generico.CnData.nAxes, sVal)
|
||||||
|
|
||||||
|
|
||||||
' Inizializzo la comunicazione
|
' Inizializzo la comunicazione
|
||||||
m_CN.Init()
|
m_CN.Init()
|
||||||
|
|
||||||
@@ -418,6 +458,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
|
||||||
@@ -452,6 +503,31 @@ Public Class CNCommunication
|
|||||||
|
|
||||||
End Sub
|
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
|
||||||
|
File.Create(m_MainWindow.m_CurrentMachine.sClickDir & "\NewClick.txt")
|
||||||
|
' 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()
|
Private Sub Refresh()
|
||||||
|
|
||||||
If m_bNewPosData Then
|
If m_bNewPosData Then
|
||||||
@@ -464,6 +540,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 +567,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 +609,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 +648,187 @@ 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)
|
||||||
|
' 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.Close123Changed(m_CN.bClose123State)
|
||||||
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Close456Changed(m_CN.bClose456State)
|
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.HomeStateChanged(m_CN.bHomeState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.EnableZoneStateChanged(m_CN.nEnableZone)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.EnablePcStateChanged(m_CN.nEnablePc)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.TableUpChanged(m_CN.bTableUpState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.TableDownChanged(m_CN.bTableDownState)
|
||||||
|
|
||||||
|
' Nuovi bottoni (uso joystick) per Area4
|
||||||
|
If m_IsNewConsole Then
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.XYJogChanged(m_CN.bXYJog)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.ZJogChanged(m_CN.bZCJog)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.BCJogChanged(m_CN.bZBCJog)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.RemoteChanged(m_CN.bRemote)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.ParkingStateChanged(m_CN.bParkingState)
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If m_MainWindow.m_ActivePage = MainWindow.Pages.RawPart Then
|
||||||
|
m_MainWindow.m_RawPartPage.m_MachineButtons.LaserStateChanged(m_CN.bLaserState)
|
||||||
|
End If
|
||||||
|
|
||||||
|
' Nuove bottoni (Power Macchina)
|
||||||
|
If m_MainWindow.m_ActivePage = MainWindow.Pages.Machine Then
|
||||||
|
If m_IsNewConsole Then
|
||||||
|
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.PowerONChanged(m_CN.bPowerON)
|
||||||
|
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.PowerOFFChanged(Not m_CN.bPowerON)
|
||||||
|
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.CncModeChange(m_CN.nMachineMode)
|
||||||
|
End If
|
||||||
|
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.CncModeChange(m_CN.nMachineMode)
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
If m_MainWindow.m_ActivePage = MainWindow.Pages.WorkInProgress Then
|
||||||
|
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.SpindleStateChanged(m_CN.bSpindleState)
|
||||||
|
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.CoolantStateChanged(m_CN.bCoolantState OrElse m_CN.bInternalCoolantState OrElse m_CN.bExternCoolantState)
|
||||||
|
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.LaserStateChanged(m_CN.bLaserState)
|
||||||
|
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.LaserTracStateChanged(m_CN.bLaserTracState)
|
||||||
|
If m_CN.Is_G24_active() Then
|
||||||
|
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.ThreeAxisStateChanged(False)
|
||||||
|
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.FiveAxisStateChanged(True)
|
||||||
|
Else
|
||||||
|
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.ThreeAxisStateChanged(True)
|
||||||
|
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.FiveAxisStateChanged(False)
|
||||||
|
End If
|
||||||
|
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.DoorStateChanged(m_CN.nDoorClosedState)
|
||||||
|
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.ParkingStateChanged(m_CN.bParkingState)
|
||||||
|
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.EnableZoneStateChanged(m_CN.nEnableZone)
|
||||||
|
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.EnablePcStateChanged(m_CN.nEnablePc)
|
||||||
|
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.TableUpChanged(m_CN.bTableUpState)
|
||||||
|
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.TableDownChanged(m_CN.bTableDownState)
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub RefreshAxesFANUC()
|
||||||
|
' ----- INIZIO: lettura diretta di specifiche vaiabili -----
|
||||||
|
' avvio lettura variabili da CN
|
||||||
|
m_CN.Geppo()
|
||||||
|
' notifico valori all'interfaccia
|
||||||
|
m_MachineStatus.DisplayPosition()
|
||||||
|
m_MachineStatus.DisplayPositionDelta()
|
||||||
|
m_MachineStatus.DisplayFeed()
|
||||||
|
m_MachineStatus.DisplaySpeed()
|
||||||
|
m_MachineStatus.DisplayPower()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub RefreshFANUC()
|
||||||
|
' Copia della funzione Refresh
|
||||||
|
|
||||||
|
' ----- INIZIO: lettura diretta di specifiche vaiabili -----
|
||||||
|
'' avvio lettura variabili da CN
|
||||||
|
'm_CN.Geppo()
|
||||||
|
'' notifico valori all'interfaccia
|
||||||
|
'm_MachineStatus.DisplayPosition()
|
||||||
|
'm_MachineStatus.DisplayPositionDelta()
|
||||||
|
'm_MachineStatus.DisplayFeed()
|
||||||
|
'm_MachineStatus.DisplaySpeed()
|
||||||
|
'm_MachineStatus.DisplayPower()
|
||||||
|
' eventualmente carico messaggi di errore
|
||||||
|
ErrorList.Clear()
|
||||||
|
If m_CN.b_NC_error Then
|
||||||
|
ErrorList.Clear()
|
||||||
|
SyncLock m_CN
|
||||||
|
For Each Item As String In m_CN.sz_NC_error_messages
|
||||||
|
ErrorList.Add(Item)
|
||||||
|
Next
|
||||||
|
End SyncLock
|
||||||
|
End If
|
||||||
|
m_AlarmsPage.NcError()
|
||||||
|
' ----- FINE : lettura diretta di specifiche vaiabili -----
|
||||||
|
|
||||||
|
If m_CN.read_active_mode() <> CShort(m_nCurrMode) Then
|
||||||
|
m_nCurrMode = CInt(m_CN.read_active_mode())
|
||||||
|
m_MachineStatus.DisplayActiveMode(m_nCurrMode)
|
||||||
|
m_CN.nMachineMode = m_nCurrMode
|
||||||
|
End If
|
||||||
|
|
||||||
|
' QUESTE VARIABILI NON SONO LETTE IN QUANTO NON SONO STATE CARICATE → vedere come esempio il NUM che assegna queste variabili
|
||||||
|
' Flag e variabili per bottoni macchina, che verifico solo nelle pagine in cui ci sono
|
||||||
|
If m_MainWindow.m_ActivePage = MainWindow.Pages.DirectCut Then
|
||||||
|
If m_MainWindow.m_DirectCutPageUC.m_NewMachineButtonsType Then
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.SpindleStateChanged(m_CN.bSpindleState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.LaserStateChanged(m_CN.bLaserState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.LaserTracStateChanged(m_CN.bLaserTracState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.CoolantStateChanged(m_CN.bCoolantState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.InternalCoolantStateChanged(m_CN.bInternalCoolantState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.ExternCoolantStateChanged(m_CN.bExternCoolantState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.CBAxesStateChanged(m_CN.bCBAxesState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.AirBlowStateChanged(m_CN.bAirBlowState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.HomeStateChanged(m_CN.bHomeState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.TableUpChanged(m_CN.bTableUpState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.TableDownChanged(m_CN.bTableDownState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.DoorClosedChanged(m_CN.nDoorClosedState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.LimitZChanged(m_CN.bLimitZState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.FiveAxisStateChanged(m_CN.Is_G24_active())
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.ParkingStateChanged(m_CN.bParkingState)
|
||||||
|
'm_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.ZoneStateChanged(m_CN.nEnableZone)
|
||||||
|
'm_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.PcStateChanged(m_CN.nEnablePc)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.VacuumUpChanged(m_CN.bVacuumUp)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.VacuumDownChanged(m_CN.bVacuumDown)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum2UpChanged(m_CN.bVacuum2Up)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum2DownChanged(m_CN.bVacuum2Down)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum0Changed(m_CN.bVacuum0)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum90Changed(m_CN.bVacuum90)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum1Changed(m_CN.bVacuum1State)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum2Changed(m_CN.bVacuum2State)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum3Changed(m_CN.bVacuum3State)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum4Changed(m_CN.bVacuum4State)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum5Changed(m_CN.bVacuum5State)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum6Changed(m_CN.bVacuum6State)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum135Changed(m_CN.bVacuum135State)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum246Changed(m_CN.bVacuum246State)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.OpenAllChanged(m_CN.bOpenAllState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.CloseAllChanged(m_CN.bCloseAllState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Open123Changed(m_CN.bOpen123State)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Open456Changed(m_CN.bOpen456State)
|
||||||
|
' in assenza della configurazione delle variabili Close123 e Close456
|
||||||
|
If Not String.IsNullOrEmpty(m_CN.m_szCnDataVar(CN_generico.CnData.Close123State)) Then
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Close123Changed(m_CN.bClose123State)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Close456Changed(m_CN.bClose456State)
|
||||||
|
Else
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Close123Changed(Not m_CN.bOpen123State)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Close456Changed(Not m_CN.bOpen456State)
|
||||||
|
End If
|
||||||
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.BlowChanged(m_CN.bBlowState)
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.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,11 +878,16 @@ 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
|
||||||
|
If m_IsNewConsole Then
|
||||||
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.PowerONChanged(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.PowerOFFChanged(Not m_CN.bPowerON)
|
||||||
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.CncModeChange(m_CN.nMachineMode)
|
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.CncModeChange(m_CN.nMachineMode)
|
||||||
End If
|
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)
|
||||||
@@ -907,28 +1171,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
+169
-12
@@ -9,12 +9,50 @@ Imports System.Text
|
|||||||
Imports System.Windows.Forms
|
Imports System.Windows.Forms
|
||||||
Imports System.Runtime.InteropServices
|
Imports System.Runtime.InteropServices
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
|
Imports System.IO
|
||||||
|
Imports System.Threading
|
||||||
|
Imports System.Windows.Threading
|
||||||
|
|
||||||
Namespace Num
|
Namespace Num
|
||||||
|
|
||||||
Public Class NumNCOld
|
Public Class NumNCOld
|
||||||
Inherits CN_generico
|
Inherits CN_generico
|
||||||
|
|
||||||
|
'Public bIsDripFeed As Boolean = False
|
||||||
|
' costruisco il riferimento alla pagina principale
|
||||||
|
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||||
|
' costruisco il riferimento alla barra ProjectMng
|
||||||
|
Private m_ProjectMng As ProjectMgrUC
|
||||||
|
|
||||||
|
' Messaggi ricevuti direttamente dal Thread che gestisce la comunicazione DripFeed
|
||||||
|
Private m_nMsg As Integer = 0
|
||||||
|
' Colore originale del bottone WorkBtn
|
||||||
|
Private m_BackgroundOrig As SolidColorBrush
|
||||||
|
' Timer per la lettura aggiornata dei messaggi in fase di comunicazione DriFeed
|
||||||
|
Private m_RefreshTimer As New DispatcherTimer
|
||||||
|
' funzione richiamata ad ogni clik
|
||||||
|
Private Sub RefreshTimer_tick()
|
||||||
|
' verifico se ci sono messaggi da stampare (Se n_Msg > 0 è una info, Se n_Msg < 0 è un errore)
|
||||||
|
If m_nMsg > 0 Then
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.SetInfoMessage(EgtMsg(m_nMsg))
|
||||||
|
ElseIf m_nMsg < 0 Then
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.SetWarningMessage(EgtMsg(Math.Abs(m_nMsg)))
|
||||||
|
End If
|
||||||
|
' dopo la stampa del messaggio resetto l'indice
|
||||||
|
m_nMsg = 0
|
||||||
|
' se ha terminato la trasmissione DripFeed fermo il timer
|
||||||
|
If Not bIsDripFeed Then
|
||||||
|
m_RefreshTimer.Stop()
|
||||||
|
' reimposto il colore originale del bottone WorkBtn della pagina ProjectMng
|
||||||
|
If Not IsNothing(m_ProjectMng) Then
|
||||||
|
m_ProjectMng.WorkBtn.Background = m_BackgroundOrig
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
#Region " Classes"
|
#Region " Classes"
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
@@ -79,6 +117,10 @@ Public Class NumNCOld
|
|||||||
Const TSi = 1, TFi = 2, SPi = 3, THi = 4, INI = 5, TABSYMB = 10, ALLMODULE = 16, CMODULE = 65, TXTFILE = 97
|
Const TSi = 1, TFi = 2, SPi = 3, THi = 4, INI = 5, TABSYMB = 10, ALLMODULE = 16, CMODULE = 65, TXTFILE = 97
|
||||||
Const IHMFNT = 98, IHMBMP = 99, IHMRSC = 100, IHMINI = 101, IHMTXT = 102, IHMICO = 103, IHMCOD = 104
|
Const IHMFNT = 98, IHMBMP = 99, IHMRSC = 100, IHMINI = 101, IHMTXT = 102, IHMICO = 103, IHMCOD = 104
|
||||||
|
|
||||||
|
' Const DNC_MODE_FIRST = &H3A00, DNC_MODE_CONTINUE = &H3B00, DNC_MODE_ABORT = &H3C00
|
||||||
|
Const DNC_MODE_FIRST = 0, DNC_MODE_CONTINUE = 1, DNC_MODE_ABORT = 2
|
||||||
|
Const DNC_IN_PROGRES = &HC8, DNC_RING_BUFFER_FULL = &H7
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region " Structures"
|
#Region " Structures"
|
||||||
@@ -115,7 +157,7 @@ Public Class NumNCOld
|
|||||||
Dim Type As Long
|
Dim Type As Long
|
||||||
End Structure
|
End Structure
|
||||||
|
|
||||||
<StructLayout(LayoutKind.Explicit)> _
|
<StructLayout(LayoutKind.Explicit)>
|
||||||
Public Structure tDNC20_ObjectList
|
Public Structure tDNC20_ObjectList
|
||||||
<FieldOffset(0)> Public ElemNum As UInt16
|
<FieldOffset(0)> Public ElemNum As UInt16
|
||||||
<FieldOffset(2)> Public First As UInt16
|
<FieldOffset(2)> Public First As UInt16
|
||||||
@@ -123,7 +165,7 @@ Public Class NumNCOld
|
|||||||
End Structure
|
End Structure
|
||||||
|
|
||||||
Public Structure My_data_struct
|
Public Structure My_data_struct
|
||||||
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=256)> _
|
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=256)>
|
||||||
Public data As Byte()
|
Public data As Byte()
|
||||||
End Structure
|
End Structure
|
||||||
|
|
||||||
@@ -149,6 +191,7 @@ Public Class NumNCOld
|
|||||||
|
|
||||||
Private iFirstVar As UInt16
|
Private iFirstVar As UInt16
|
||||||
Private n_portNC As Int16
|
Private n_portNC As Int16
|
||||||
|
Private n_PPport As Int16
|
||||||
|
|
||||||
Private Vmminch As Long = 1000
|
Private Vmminch As Long = 1000
|
||||||
Private NumCifreDecP4 As Long = 1000
|
Private NumCifreDecP4 As Long = 1000
|
||||||
@@ -209,6 +252,9 @@ Public Class NumNCOld
|
|||||||
|
|
||||||
Declare Function UpLoadFile Lib "dnc2.dll" (ByVal Port As Int16, ByVal prog As Int32, ByVal filename As String) As Int16
|
Declare Function UpLoadFile Lib "dnc2.dll" (ByVal Port As Int16, ByVal prog As Int32, ByVal filename As String) As Int16
|
||||||
Declare Function DownLoadFile Lib "dnc2.dll" (ByVal Port As Int16, ByVal prog As Int32, ByVal filename As String) As Int16
|
Declare Function DownLoadFile Lib "dnc2.dll" (ByVal Port As Int16, ByVal prog As Int32, ByVal filename As String) As Int16
|
||||||
|
Declare Function DownLoadFileAsyn Lib "dnc2.dll" (ByVal Port As Int16, ByVal prog As Int32, ByVal ringsize As Int32, ByVal filename As String, ByVal Mode As UInt16, ByRef Index As UInt16) As Int16
|
||||||
|
Declare Function DownLoadPPPFile Lib "dnc2.dll" (ByVal Port As Int16, ByVal prog As Int32, ByVal ringsize As Int32, ByVal filename As String) As Int16
|
||||||
|
Declare Function DownLoadPPPFile2 Lib "dnc2.dll" (ByVal Port As Int16, ByVal prog As Int32, ByVal ringsize As Int32, ByVal filename As String, ByVal Offset As Int16, ByVal Mode As UInt16, ByRef Index As UInt16) As Int16
|
||||||
Declare Function DncDeleteFile Lib "dnc2.dll" (ByVal Port As Int16, ByVal prog As Int32) As Int16
|
Declare Function DncDeleteFile Lib "dnc2.dll" (ByVal Port As Int16, ByVal prog As Int32) As Int16
|
||||||
|
|
||||||
Declare Function DNC20_Position_OM Lib "dnc20_2.dll" (ByVal Port As Int16, ByVal Groupe As Int16, ByRef d As My_data_struct, ByVal Mode As UInt16) As Int16
|
Declare Function DNC20_Position_OM Lib "dnc20_2.dll" (ByVal Port As Int16, ByVal Groupe As Int16, ByRef d As My_data_struct, ByVal Mode As UInt16) As Int16
|
||||||
@@ -316,6 +362,14 @@ Public Class NumNCOld
|
|||||||
EgtOutLog(msga)
|
EgtOutLog(msga)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
nret = Get_Port(n_PPport)
|
||||||
|
If nret <> 0 Then
|
||||||
|
msga = " PP Port not available (Get_Port) : " & nret.ToString
|
||||||
|
EgtOutLog(msga)
|
||||||
|
Else
|
||||||
|
EgtOutLog("PP Port available: " & n_PPport.ToString)
|
||||||
|
End If
|
||||||
|
|
||||||
' eventualmente aggiungere apertura porta per PPP
|
' eventualmente aggiungere apertura porta per PPP
|
||||||
'iport3 = 3
|
'iport3 = 3
|
||||||
'nret = Get_Port(iport3)
|
'nret = Get_Port(iport3)
|
||||||
@@ -333,6 +387,7 @@ Public Class NumNCOld
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Dim nret As Int16 = Free_Port(n_portNC)
|
Dim nret As Int16 = Free_Port(n_portNC)
|
||||||
|
nret = Free_Port(n_PPport)
|
||||||
|
|
||||||
global_state = eStateType.NOT_INIT
|
global_state = eStateType.NOT_INIT
|
||||||
|
|
||||||
@@ -481,6 +536,8 @@ Public Class NumNCOld
|
|||||||
|
|
||||||
If nret <> 0 Then
|
If nret <> 0 Then
|
||||||
EgtOutLog("Error in set_NC_mode(" & n_mode.ToString() & ") : " & nret.ToString())
|
EgtOutLog("Error in set_NC_mode(" & n_mode.ToString() & ") : " & nret.ToString())
|
||||||
|
Else
|
||||||
|
EgtOutLog("set_NC_mode(" & n_mode.ToString() & ") : " & nret.ToString() & " → ok")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
global_state = eStateType.READY
|
global_state = eStateType.READY
|
||||||
@@ -693,7 +750,7 @@ Public Class NumNCOld
|
|||||||
' Set DPOsition Mode OP/OM
|
' Set DPOsition Mode OP/OM
|
||||||
'
|
'
|
||||||
Public Overrides Sub set_OP_OM(n As Short)
|
Public Overrides Sub set_OP_OM(n As Short)
|
||||||
b_OM_pos = ( n = 0)
|
b_OM_pos = (n = 0)
|
||||||
End Sub
|
End Sub
|
||||||
'
|
'
|
||||||
' Read Once position
|
' Read Once position
|
||||||
@@ -792,33 +849,133 @@ Public Class NumNCOld
|
|||||||
Return nret
|
Return nret
|
||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
'
|
'
|
||||||
' da PC a CN
|
' da PC a CN (sincrono)
|
||||||
'
|
'
|
||||||
Public Overrides Function Download_NC_prog(sz_PC_filename As String, sz_NC_filename As String) As Int16
|
Public Overrides Function Download_NC_prog(sz_PC_filename As String, sz_NC_filename As String) As Int16
|
||||||
|
|
||||||
' Verifico accessibilità CN
|
' Verifico accessibilità CN
|
||||||
If VerifyBusy() <> eStateType.READY Then
|
If VerifyBusy() <> eStateType.READY Then
|
||||||
|
EgtOutLog("Stato CN " & global_state.ToString)
|
||||||
Return global_state
|
Return global_state
|
||||||
End If
|
End If
|
||||||
' Dichiaro CN occupato
|
|
||||||
global_state = eStateType.BUSY
|
|
||||||
|
|
||||||
' Determino numero programma ( %900.0 -> 9000)
|
' Determino numero programma ( %900.0 -> 9000)
|
||||||
Dim l As Int32 = get_Num_prog_number(sz_NC_filename)
|
Dim l As Int32 = get_Num_prog_number(sz_NC_filename)
|
||||||
' Trasmetto il programma
|
' verifico la dimensione del file
|
||||||
Dim nRet As Int16 = DownLoadFile(n_portNC, l, sz_PC_filename)
|
Dim myFile As New FileInfo(sz_PC_filename)
|
||||||
|
' determino dimensione file
|
||||||
|
Dim sizeInBytes As Long = myFile.Length
|
||||||
|
|
||||||
|
EgtOutLog(" --- Dimensione file CadCut " & sizeInBytes.ToString)
|
||||||
|
' Verifico se dimensione file è maggiore del Buffer
|
||||||
|
If sizeInBytes > 32000 Then
|
||||||
|
' Trasmetto il programma (PPPFile2)
|
||||||
|
EgtOutLog(" --- START DOWNLOAD PPP FILE --- ")
|
||||||
|
' Imposto la modalità AUTO
|
||||||
|
set_NC_mode(0)
|
||||||
|
' Dichiaro CN occupato
|
||||||
|
global_state = eStateType.BUSY
|
||||||
|
' Attesa opportuna
|
||||||
|
System.Threading.Thread.Sleep(1000)
|
||||||
|
' 90969=Drip feed has been started
|
||||||
|
m_nMsg = 90969
|
||||||
|
bIsDripFeed = True
|
||||||
|
' cambio lo sfondo del pulsante WorkBtn
|
||||||
|
If Not IsNothing(m_MainWindow.m_FrameCutPageUC) AndAlso Not IsNothing(m_MainWindow.m_FrameCutPageUC.m_ProjectMgr) Then
|
||||||
|
m_ProjectMng = m_MainWindow.m_FrameCutPageUC.m_ProjectMgr
|
||||||
|
ElseIf Not IsNothing(m_MainWindow.m_CadCutPageUC) AndAlso Not IsNothing(m_MainWindow.m_CadCutPageUC.m_ProjectMgr) Then
|
||||||
|
m_ProjectMng = m_MainWindow.m_CadCutPageUC.m_ProjectMgr
|
||||||
|
End If
|
||||||
|
If Not IsNothing(m_ProjectMng) Then
|
||||||
|
m_BackgroundOrig = m_ProjectMng.WorkBtn.Background
|
||||||
|
Dim MyLinearGradientBrush As LinearGradientBrush = Application.Current.FindResource("OmagCut_GradientYellow")
|
||||||
|
m_ProjectMng.WorkBtn.Background = MyLinearGradientBrush
|
||||||
|
End If
|
||||||
|
' avvio il timer per la lettura dei messaggi, imposto il clock a 1s
|
||||||
|
AddHandler m_RefreshTimer.Tick, AddressOf RefreshTimer_tick
|
||||||
|
m_RefreshTimer.Interval = TimeSpan.FromMilliseconds(1000)
|
||||||
|
m_RefreshTimer.Start()
|
||||||
|
Dim thread As New Thread(Sub()
|
||||||
|
Download_Drip_CN_prog(sz_PC_filename, sz_NC_filename)
|
||||||
|
End Sub)
|
||||||
|
thread.Start()
|
||||||
|
Return 1
|
||||||
|
Else
|
||||||
|
' Dichiaro CN occupato
|
||||||
|
global_state = eStateType.BUSY
|
||||||
|
' Trasmetto il programma (interamente)
|
||||||
|
Dim nRet As Int16 = DownLoadFile(n_portNC, l, sz_PC_filename)
|
||||||
If nRet <> 0 Then
|
If nRet <> 0 Then
|
||||||
EgtOutLog("Error in Download_NC_prog : " & nRet.ToString())
|
EgtOutLog("Error in Download_NC_prog : " & nRet.ToString())
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' Dichiaro CN libero
|
' Dichiaro CN libero
|
||||||
global_state = eStateType.READY
|
global_state = eStateType.READY
|
||||||
|
Return nRet
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
End Function
|
||||||
|
'
|
||||||
|
' da PC a CN (asincrono)
|
||||||
|
'
|
||||||
|
|
||||||
|
Private Function Download_Drip_CN_prog(sz_PC_filename As String, sz_NC_filename As String) As Int16
|
||||||
|
' Determino numero programma ( %900.0 -> 9000)
|
||||||
|
Dim l As Int32 = get_Num_prog_number(sz_NC_filename)
|
||||||
|
' Ultimo numero di segmento invaito
|
||||||
|
Dim i As UInt16
|
||||||
|
' Invia il primo segmento (dati comunicazione)
|
||||||
|
EgtOutLog(" -> Invia il primo segmento " & " → PPport: " & n_PPport & " → NC file name: " & sz_PC_filename & " → Dnc Mode: " & DNC_MODE_FIRST)
|
||||||
|
Dim nRet As Int16 = DownLoadPPPFile2(n_PPport, l, 32768, sz_PC_filename, Nothing, DNC_MODE_FIRST, i)
|
||||||
|
' Inserisco un tempo di attesa di sicurezza
|
||||||
|
Thread.Sleep(100)
|
||||||
|
' Verifico che il primo invio sia andato a buon fine (il CN deve esser in modalità IN_PROGRESS oppure RING_BUFFER_FULL)
|
||||||
|
If nRet <> DNC_IN_PROGRES And nRet <> DNC_RING_BUFFER_FULL And m_MainWindow.m_IsClosingApplication <> 1 Then
|
||||||
|
' 90970=Drip feed has been failed (Error)
|
||||||
|
m_nMsg = -90970
|
||||||
|
EgtOutLog("Error in Download_NC_prog/DownLoadPPPFile : " & nRet.ToString())
|
||||||
|
Else
|
||||||
|
' 90969=Drip feed has been started (Info)
|
||||||
|
m_nMsg = 90969
|
||||||
|
' Se il primo invio è andato a buon fine allora invio i segmenti seguenti
|
||||||
|
While (nRet = DNC_IN_PROGRES Or nRet = DNC_RING_BUFFER_FULL) And m_MainWindow.m_IsClosingApplication <> 1
|
||||||
|
nRet = DownLoadPPPFile2(n_portNC, l, 32768, sz_PC_filename, Nothing, DNC_MODE_CONTINUE, i)
|
||||||
|
Thread.Sleep(10)
|
||||||
|
End While
|
||||||
|
End If
|
||||||
|
|
||||||
|
' Verifico che il processo sia terminato correttamente
|
||||||
|
If nRet <> 0 Then
|
||||||
|
' 90971=Drip feed hes been aborted (Error)
|
||||||
|
If m_nMsg > 0 Then
|
||||||
|
' se in precedenza non è stato generato un messaggio di errore (m_nMsg = -90970) comunico che il processo è stato interrotto
|
||||||
|
m_nMsg = -90971
|
||||||
|
End If
|
||||||
|
EgtOutLog("Error in Download_NC_prog/DownLoadPPPFile : " & nRet.ToString() & ", DownLoadPPPFile is aborted")
|
||||||
|
Else
|
||||||
|
' 90972=Drip feed has been ended (Info)
|
||||||
|
m_nMsg = 90972
|
||||||
|
End If
|
||||||
|
|
||||||
|
' prima di terminare (a prescinere dall'esito della comunicazione) forzo la terminazione
|
||||||
|
nRet = DownLoadPPPFile2(n_PPport, l, 32768, sz_PC_filename, Nothing, DNC_MODE_ABORT, i)
|
||||||
|
' Dichiaro CN libero
|
||||||
|
global_state = eStateType.READY
|
||||||
|
bIsDripFeed = False
|
||||||
|
EgtOutLog("IsDripFeed : " & bIsDripFeed.ToString)
|
||||||
|
EgtOutLog(" --- END DOWNLOAD PPP FILE --- ")
|
||||||
|
' se richiesta chiusura del programma, notifico che è stata chiusa correttmanete la comunicazione DripFeed
|
||||||
|
If m_MainWindow.m_IsClosingApplication = 1 Then
|
||||||
|
m_MainWindow.m_IsClosingApplication = 2
|
||||||
|
End If
|
||||||
|
' chiudo il thread aperto
|
||||||
Return nRet
|
Return nRet
|
||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
'
|
'
|
||||||
' da CN a pc
|
' da CN a pc
|
||||||
'
|
'
|
||||||
@@ -973,7 +1130,7 @@ Public Class NumNCOld
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Overrides Function Is_G24_active() As Boolean
|
Public Overrides Function Is_G24_active() As Boolean
|
||||||
Return (( Var6003 And &H2) <> 0)
|
Return ((Var6003 And &H2) <> 0)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Overrides Function get_program_status() As Int16
|
Public Overrides Function get_program_status() As Int16
|
||||||
@@ -1154,6 +1311,6 @@ Public Class NumNCOld
|
|||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
End Namespace
|
End Namespace
|
||||||
+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
|
||||||
|
|||||||
@@ -491,7 +491,19 @@ Public Class OpenPageUC
|
|||||||
m_SceneButtons.MeasureBtn.IsChecked = False
|
m_SceneButtons.MeasureBtn.IsChecked = False
|
||||||
' Istruzioni per chiudere OpenPageUC e aprire currentproject e cadcut page
|
' Istruzioni per chiudere OpenPageUC e aprire currentproject e cadcut page
|
||||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_OpenPage)
|
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_OpenPage)
|
||||||
|
If m_MainWindow.m_PrevActivePage = MainWindow.Pages.CadCut Then
|
||||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
|
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
|
||||||
|
If Not m_MainWindow.CadCutBtn.IsChecked Then
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_CadCutPageUC)
|
||||||
|
m_MainWindow.CadCutBtn.IsChecked = True
|
||||||
|
End If
|
||||||
|
ElseIf m_MainWindow.m_PrevActivePage = MainWindow.Pages.FrameCut Then
|
||||||
|
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
|
||||||
|
If Not m_MainWindow.FrameCutBtn.IsChecked Then
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_FrameCutPageUC)
|
||||||
|
m_MainWindow.FrameCutBtn.IsChecked = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
' Non modifico progetto corrente
|
' Non modifico progetto corrente
|
||||||
m_MainWindow.m_ActivePage = m_MainWindow.m_PrevActivePage
|
m_MainWindow.m_ActivePage = m_MainWindow.m_PrevActivePage
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
Imports System.IO
|
Imports System.ComponentModel
|
||||||
|
Imports System.Drawing
|
||||||
|
Imports System.IO
|
||||||
|
Imports System.Windows.Forms.Integration
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
Imports EgtWPFLib
|
Imports EgtWPFLib
|
||||||
|
|
||||||
@@ -30,6 +33,7 @@ Public Class ProjectMgrUC
|
|||||||
WorkBtn.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 2) 'Work - Lavora
|
WorkBtn.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 2) 'Work - Lavora
|
||||||
End If
|
End If
|
||||||
TestBtn.ToolTip = EgtMsg(90255) 'Test
|
TestBtn.ToolTip = EgtMsg(90255) 'Test
|
||||||
|
ResetCutBtn.ToolTip = "Reset Cuts" & vbCrLf & "Reset Feed (Shift)"
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ProjectMgrUC_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
Private Sub ProjectMgrUC_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||||
@@ -99,7 +103,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
|
||||||
@@ -249,6 +252,11 @@ Public Class ProjectMgrUC
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ResetCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles ResetCutBtn.Click
|
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())
|
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
||||||
' Cancello eventuali messaggi
|
' Cancello eventuali messaggi
|
||||||
m_CurrProjPage.ClearMessage()
|
m_CurrProjPage.ClearMessage()
|
||||||
@@ -262,6 +270,12 @@ 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
|
||||||
|
' Se eistono elimino i grezzi delle fasi che non contengono lavorazioni
|
||||||
|
ResetAllRawPart()
|
||||||
|
' 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 +492,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
|
||||||
@@ -705,6 +718,112 @@ Public Class ProjectMgrUC
|
|||||||
End While
|
End While
|
||||||
End Sub
|
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 ------------------------------------------------
|
' ------------------------------------------------ GENERA COMANDI CNC MOVIMENTO ------------------------------------------------
|
||||||
Private Sub ExecuteCommandCNC(ptMid As Point3d, dAngC As Double, dAngB As Double)
|
Private Sub ExecuteCommandCNC(ptMid As Point3d, dAngC As Double, dAngB As Double)
|
||||||
|
|
||||||
|
|||||||
@@ -315,6 +315,16 @@ Public Class Camera
|
|||||||
GetPrivateProfileString(S_NCDATA, K_SPOTLIGHT2, "", sPLCVarSpotLight2, m_MainWindow.GetMachIniFile())
|
GetPrivateProfileString(S_NCDATA, K_SPOTLIGHT2, "", sPLCVarSpotLight2, m_MainWindow.GetMachIniFile())
|
||||||
Dim nPhotoDeley As Integer = GetPrivateProfileInt(S_NCNUM, K_PHOTODELEY, "100", 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
|
Select Case m_MainWindow.m_CNCommunication.m_nNCType
|
||||||
Case 1, 2
|
Case 1, 2
|
||||||
If m_MainWindow.m_CNCommunication.m_nNCType = 2 Then
|
If m_MainWindow.m_CNCommunication.m_nNCType = 2 Then
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -157,6 +157,10 @@
|
|||||||
|
|
||||||
</GroupBox>
|
</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"
|
<Button Name="ConfirmPhotoBtn" Grid.Row="4" Grid.ColumnSpan="2" Visibility="Hidden"
|
||||||
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||||
|
|
||||||
@@ -169,7 +173,8 @@
|
|||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="6*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
|
<ColumnDefinition Width="5*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
@@ -186,7 +191,11 @@
|
|||||||
<Image Source="{DynamicResource SlabIdImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
<Image Source="{DynamicResource SlabIdImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button Name="OkBtn" Grid.Column="5" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
|
<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"
|
<Image Source="{DynamicResource VImg}" Width="65" Height="65" HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Center" />
|
VerticalAlignment="Center" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -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,109 @@ 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()
|
||||||
|
If Not m_bOtherRefTab Then Return
|
||||||
|
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 +2189,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 +2253,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 +2285,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 +2334,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 +2404,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 +2500,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 +2816,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,56 @@ 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)
|
||||||
|
' 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
|
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 +719,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
|
||||||
|
|||||||
+22
-4
@@ -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,6 +18,23 @@ Module Utility
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
Friend StopWatch As Stopwatch
|
||||||
|
|
||||||
|
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()
|
Friend Sub UpdateUI()
|
||||||
' Costringo ad aggiornare UI
|
' Costringo ad aggiornare UI
|
||||||
@@ -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)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ Imports System.Collections.ObjectModel
|
|||||||
Imports System.Runtime.InteropServices
|
Imports System.Runtime.InteropServices
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
Imports EgtWPFLib
|
Imports EgtWPFLib
|
||||||
|
Imports OmagCUT.VeinMatchingWindow
|
||||||
|
|
||||||
Public Class VeinMatchingWindow
|
Public Class VeinMatchingWindow
|
||||||
|
|
||||||
@@ -19,6 +20,11 @@ Public Class VeinMatchingWindow
|
|||||||
Private m_nIdToSel As Integer = GDB_ID.NULL
|
Private m_nIdToSel As Integer = GDB_ID.NULL
|
||||||
Private m_nIdToDesel As Integer = GDB_ID.NULL
|
Private m_nIdToDesel As Integer = GDB_ID.NULL
|
||||||
|
|
||||||
|
Enum ALETTE
|
||||||
|
F = 2
|
||||||
|
A = 1
|
||||||
|
End Enum
|
||||||
|
|
||||||
Private Sub Window_Initialized(sender As Object, e As EventArgs)
|
Private Sub Window_Initialized(sender As Object, e As EventArgs)
|
||||||
' Assegnazione scena all'host e posizionamento nella PlacePageGrid
|
' Assegnazione scena all'host e posizionamento nella PlacePageGrid
|
||||||
VeinMatchingSceneHost.Child = VeinMatchingScene
|
VeinMatchingSceneHost.Child = VeinMatchingScene
|
||||||
@@ -364,19 +370,21 @@ Friend Module VeinMatching
|
|||||||
' Imposto il contesto del progetto
|
' Imposto il contesto del progetto
|
||||||
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
|
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
|
||||||
' Riattivo il gruppo di lavoro
|
' Riattivo il gruppo di lavoro
|
||||||
EgtSetCurrMachGroup( EgtGetFirstMachGroup())
|
EgtSetCurrMachGroup(EgtGetFirstMachGroup())
|
||||||
' Verifico quali pezzi sono nel grezzo, per dichiararlo al VM
|
' Verifico quali pezzi sono nel grezzo, per dichiararlo al VM
|
||||||
nId = EgtGetFirstPartInRawPart( CamAuto.GetCurrentRaw())
|
nId = EgtGetFirstPartInRawPart(CamAuto.GetCurrentRaw())
|
||||||
While nId <> GDB_ID.NULL
|
While nId <> GDB_ID.NULL
|
||||||
' Dichiaro pezzo nel grezzo per VM
|
' Dichiaro pezzo nel grezzo per VM
|
||||||
VeinMatching.OnInsertPartInRaw( nId)
|
VeinMatching.OnInsertPartInRaw(nId)
|
||||||
' Passo al pezzo successivo
|
' Passo al pezzo successivo
|
||||||
nId = EgtGetNextPartInRawPart(nId)
|
nId = EgtGetNextPartInRawPart(nId)
|
||||||
End While
|
End While
|
||||||
' Ripristino visualizzazione di eventuali pezzi in parcheggio
|
' Ripristino visualizzazione di eventuali pezzi in parcheggio
|
||||||
ShowParkedParts()
|
ShowParkedParts()
|
||||||
' Ripristino il contesto corrente
|
' Ripristino il contesto corrente
|
||||||
EgtSetCurrentContext( nCurrCtx)
|
EgtSetCurrentContext(nCurrCtx)
|
||||||
|
|
||||||
|
' EgtSaveFile("C:\EgtData\OmagCUT\Temp\MyVeinMatch.nge", NGE.TEXT)
|
||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
@@ -422,11 +430,11 @@ Friend Module VeinMatching
|
|||||||
nCurrId = EgtGetFirstNameInGroup(nVeinId2, NAME_PREVIEW)
|
nCurrId = EgtGetFirstNameInGroup(nVeinId2, NAME_PREVIEW)
|
||||||
EgtSetStatus(nCurrId, GDB_ST.OFF)
|
EgtSetStatus(nCurrId, GDB_ST.OFF)
|
||||||
' Se esiste OutLoop.orig OutLoop -> OutLoop.mach e OutLoop.orig -> OutLoop
|
' Se esiste OutLoop.orig OutLoop -> OutLoop.mach e OutLoop.orig -> OutLoop
|
||||||
Dim nOutLoopOrig As Integer = EgtGetFirstNameInGroup( nVeinId2, NAME_OUTLOOP & ".orig")
|
Dim nOutLoopOrig As Integer = EgtGetFirstNameInGroup(nVeinId2, NAME_OUTLOOP & ".orig")
|
||||||
If nOutLoopOrig <> GDB_ID.NULL Then
|
If nOutLoopOrig <> GDB_ID.NULL Then
|
||||||
Dim nOutLoop As Integer = EgtGetFirstNameInGroup( nVeinId2, NAME_OUTLOOP)
|
Dim nOutLoop As Integer = EgtGetFirstNameInGroup(nVeinId2, NAME_OUTLOOP)
|
||||||
EgtSetName( nOutLoop, NAME_OUTLOOP & ".mach")
|
EgtSetName(nOutLoop, NAME_OUTLOOP & ".mach")
|
||||||
EgtSetName( nOutLoopOrig, NAME_OUTLOOP)
|
EgtSetName(nOutLoopOrig, NAME_OUTLOOP)
|
||||||
End If
|
End If
|
||||||
' Se necessario, ripristino il contesto originale
|
' Se necessario, ripristino il contesto originale
|
||||||
If nCurrCtx > 0 Then EgtSetCurrentContext(nCurrCtx)
|
If nCurrCtx > 0 Then EgtSetCurrentContext(nCurrCtx)
|
||||||
@@ -1039,37 +1047,44 @@ Friend Module VeinMatching
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Friend Function MoveAlettaSolid(ByRef Item As Aletta, ByRef ThicknessRaw As Double) As Boolean
|
Friend Function MoveAlettaSolid(ByRef Item As Aletta, ByRef ThicknessRaw As Double) As Boolean
|
||||||
|
' A: alzatina, F: frontalino
|
||||||
Dim nType As Integer
|
Dim nType As Integer
|
||||||
If Not EgtGetInfo(Item.IdSideRef, "AF", nType) Then Return False
|
If Not EgtGetInfo(Item.IdSideRef, "AF", nType) Then Return False
|
||||||
|
|
||||||
Dim ptSRef, ptERef, ptE As Point3d
|
Dim ptSRef, ptERef, ptS, ptE As Point3d
|
||||||
|
' Piano cucina
|
||||||
If Not EgtStartPoint(Item.IdSideRef, GDB_ID.ROOT, ptSRef) Then Return False
|
If Not EgtStartPoint(Item.IdSideRef, GDB_ID.ROOT, ptSRef) Then Return False
|
||||||
If Not EgtEndPoint(Item.IdSideRef, GDB_ID.ROOT, ptERef) Then Return False
|
If Not EgtEndPoint(Item.IdSideRef, GDB_ID.ROOT, ptERef) Then Return False
|
||||||
|
' AlzFront
|
||||||
|
If Not EgtStartPoint(Item.SideId, GDB_ID.ROOT, ptS) Then Return False
|
||||||
If Not EgtEndPoint(Item.SideId, GDB_ID.ROOT, ptE) Then Return False
|
If Not EgtEndPoint(Item.SideId, GDB_ID.ROOT, ptE) Then Return False
|
||||||
|
|
||||||
|
' vettore lato cucina
|
||||||
|
Dim vtRotRef As Vector3d = ptERef - ptSRef
|
||||||
|
' vettore lato AlzFront
|
||||||
|
Dim vtRot As Vector3d = ptE - ptS
|
||||||
|
|
||||||
' ruoto il solido intorno al lato di riferimento
|
' ruoto il solido intorno al lato di riferimento
|
||||||
Dim vtRot As Vector3d = ptERef - ptSRef
|
If nType = ALETTE.A Then
|
||||||
If nType = 1 Then
|
|
||||||
EgtRotate(Item.PartId, ptE, vtRot, -90, GDB_RT.GLOB)
|
|
||||||
ElseIf nType = 2 Then
|
|
||||||
EgtRotate(Item.PartId, ptE, vtRot, 90, GDB_RT.GLOB)
|
EgtRotate(Item.PartId, ptE, vtRot, 90, GDB_RT.GLOB)
|
||||||
|
ElseIf nType = ALETTE.F Then
|
||||||
|
EgtRotate(Item.PartId, ptE, vtRot, -90, GDB_RT.GLOB)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' punto di riferimento per la traslazione sul solido
|
' punto di riferimento per la traslazione sul solido
|
||||||
Dim ptSolid As Point3d
|
Dim ptSolid As Point3d
|
||||||
If nType = 1 Then
|
If nType = ALETTE.A Then
|
||||||
' cerco id della curva che definisce la front face
|
' cerco id della curva che definisce la front face
|
||||||
Dim nSolidGrp As Integer = EgtGetFirstNameInGroup(Item.PartId, NAME_VM_SOLID)
|
Dim nSolidGrp As Integer = EgtGetFirstNameInGroup(Item.PartId, NAME_VM_SOLID)
|
||||||
Dim nFrontCrvId As Integer = EgtGetFirstInGroup(nSolidGrp)
|
Dim nFrontCrvId As Integer = EgtGetFirstInGroup(nSolidGrp)
|
||||||
EgtStartPoint(nFrontCrvId, ptSolid)
|
EgtStartPoint(nFrontCrvId, GDB_ID.ROOT, ptSolid)
|
||||||
ElseIf nType = 2 Then
|
ElseIf nType = ALETTE.F Then
|
||||||
EgtStartPoint(Item.SideId, ptSolid)
|
EgtStartPoint(Item.SideId, GDB_ID.ROOT, ptSolid)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim ItemFrame As New Frame3d
|
' Dim ItemFrame As New Frame3d
|
||||||
If Not EgtGetGroupGlobFrame(Item.PartId, ItemFrame) Then Return False
|
' If Not EgtGetGroupGlobFrame(Item.PartId, ItemFrame) Then Return False
|
||||||
ptSolid.ToGlob(ItemFrame)
|
' ptSolid.ToGlob(ItemFrame)
|
||||||
|
|
||||||
'punto di riferimento per la traslazione sul piano cucina
|
'punto di riferimento per la traslazione sul piano cucina
|
||||||
Dim ptKitchen As Point3d = ptERef
|
Dim ptKitchen As Point3d = ptERef
|
||||||
@@ -1077,6 +1092,16 @@ Friend Module VeinMatching
|
|||||||
Dim vtMove As Vector3d = ptKitchen - ptSolid
|
Dim vtMove As Vector3d = ptKitchen - ptSolid
|
||||||
EgtMove(Item.PartId, vtMove, GDB_RT.GLOB)
|
EgtMove(Item.PartId, vtMove, GDB_RT.GLOB)
|
||||||
|
|
||||||
|
' eventualmente ruoto per allineare l'alzatina al piano cucina
|
||||||
|
Dim dLRef, dAngVRef, dAngHRef As Double
|
||||||
|
vtRotRef.ToSpherical(dLRef, dAngVRef, dAngHRef)
|
||||||
|
Dim dL, dAngV, dAngH As Double
|
||||||
|
vtRot.Rotate(Vector3d.Z_AX, 180)
|
||||||
|
vtRot.ToSpherical(dL, dAngV, dAngH)
|
||||||
|
Dim dDelta As Double = dAngHRef - dAngH
|
||||||
|
If Math.Abs(dDelta) < EPS_ANG_SMALL Then Return True
|
||||||
|
EgtRotate(Item.PartId, ptKitchen, Vector3d.Z_AX, dDelta, GDB_RT.GLOB)
|
||||||
|
|
||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
@@ -1206,7 +1231,7 @@ Friend Module VeinMatching
|
|||||||
' Se necessario, cambio contesto
|
' Se necessario, cambio contesto
|
||||||
If m_nVeinCtx <> nCurrCtx Then
|
If m_nVeinCtx <> nCurrCtx Then
|
||||||
If EgtSetCurrentContext(m_nVeinCtx) Then
|
If EgtSetCurrentContext(m_nVeinCtx) Then
|
||||||
Return If( nCurrCtx > 0, nCurrCtx, -2)
|
Return If(nCurrCtx > 0, nCurrCtx, -2)
|
||||||
Else
|
Else
|
||||||
Return 0
|
Return 0
|
||||||
End If
|
End If
|
||||||
|
|||||||
Reference in New Issue
Block a user