Compare commits

...

4 Commits

Author SHA1 Message Date
Nicola Pievani 7b9d99a9c6 Correzione gestione FeedSideAng, chiave di protezione CompoFrame 2023-06-26 18:30:16 +02:00
Nicola Pievani 1e2b4bed27 Aggiornamento Feed (Reset + Ctrl) 2023-06-15 17:33:25 +02:00
Nicola Pievani 4ecf7980ce Merge commit '82157d3b6e2e25c8257612d6b026a6b8ef10304c' into develop 2023-06-15 12:27:28 +02:00
Nicola Pievani 82157d3b6e Abilitato inversione tagli waterjet verticali 2023-06-14 20:03:37 +02:00
5 changed files with 125 additions and 4 deletions
+4 -1
View File
@@ -1700,7 +1700,7 @@ Public Class SplitPageUC
End If
Dim nI As Integer = m_ItemList(Index).Ind
' Si possono invertire solo i tagli di lama
If m_MachiningList(nI).m_nType <> MCH_OY.SAWING Then Continue For
If m_MachiningList(nI).m_nType <> MCH_OY.SAWING And m_MachiningList(nI).m_nType <> MCH_OY.WATERJETTING Then Continue For
' Non si possono invertire i tagli di lama inclinati
If Math.Abs(m_MachiningList(nI).m_dSideAng) > 0.1 Then Continue For
' Se abilitata inversione automatica e quindi non invertito
@@ -1714,6 +1714,7 @@ Public Class SplitPageUC
ResetEnableInvert(m_MachiningList(nI).m_nEntId)
EgtErase(m_MachiningList(nI).m_nArrId)
NumberDirectionMachining(nI, False)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
EgtDraw()
End If
' se altrimenti disabilitata inversione automatica e invertito
@@ -1725,6 +1726,7 @@ Public Class SplitPageUC
SwapStartEndData(nI)
EgtErase(m_MachiningList(nI).m_nArrId)
NumberDirectionMachining(nI, False)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
EgtDraw()
End If
' altrimenti disabilitata inversione automatica e non invertito
@@ -2196,6 +2198,7 @@ Public Class SplitPageUC
' gestione bottone per generazione ponticelli
If Type = MCH_OY.WATERJETTING Then
InvertBtn.Visibility = Visibility.Visible
' siccome la stessa posizione è occupata da due comandi sovrapposti
If CutStartBtn.Visibility = Visibility.Hidden Then
BridgesWJBtn.Visibility = Visibility.Visible
+5 -1
View File
@@ -85,7 +85,11 @@ Public Class FrameCutPageUC
m_ProjectMgr.VeinMatchingBtn.Visibility = Windows.Visibility.Hidden
m_ProjectMgr.RegisterBtn.Visibility = Windows.Visibility.Hidden
' Visualizzo il bottone per l'importazione dei compo frame
CompoBtn.Visibility = If(GetPrivateProfileInt(S_FRAMECOMPO, K_CMP_COUNT, 0, m_MainWindow.GetIniFile()) > 0, Visibility.Visible, Visibility.Hidden)
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.COMPOFRAME) AndAlso GetPrivateProfileInt(S_FRAMECOMPO, K_CMP_COUNT, 0, m_MainWindow.GetIniFile()) > 0 Then
CompoBtn.Visibility = Visibility.Visible
Else
CompoBtn.Visibility = Visibility.Hidden
End If
' Recupero dimensioni e kerf del grezzo
m_nRawId = EgtGetFirstRawPart()
GetRawBox(m_RawBox)
+1 -1
View File
@@ -53,7 +53,7 @@
</ToggleButton>
</Grid>
<Button Grid.Column="2" Style="{DynamicResource OmagCut_BlueIconButton}" Click="ExitBtn_Click">
<Button Name="ExitBtn" Grid.Column="2" Style="{DynamicResource OmagCut_BlueIconButton}" Click="ExitBtn_Click">
<Image Source="{DynamicResource XImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
</Button>
+2 -1
View File
@@ -100,6 +100,7 @@ Class MainWindow
OFFICE_TYPE = 2 ^ 19 ' 524288
REGISTRATION = 2 ^ 20 ' 1048576
SIMPLESTATISTICS = 2 ^ 21 ' 2097152
COMPOFRAME = 2 ^ 22 ' 4194304
End Enum
' Opzione nesting automatico
Private m_bAutoNest As Boolean = False
@@ -560,7 +561,7 @@ Class MainWindow
End If
End If
' --------------------------------- SLAB DB -------------------------------------------------------
ExitBtn.ToolTip = "Exit" & vbCrLf & "Minimize (Shift)"
End Sub
Private Sub ManageSingleIstance()
+113
View File
@@ -1,6 +1,7 @@
Imports System.ComponentModel
Imports System.Drawing
Imports System.IO
Imports System.Windows.Forms.Integration
Imports EgtUILib
Imports EgtWPFLib
@@ -32,6 +33,7 @@ Public Class ProjectMgrUC
WorkBtn.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 2) 'Work - Lavora
End If
TestBtn.ToolTip = EgtMsg(90255) 'Test
ResetCutBtn.ToolTip = "Reset Cuts" & vbCrLf & "Reset Feed (Shift)"
End Sub
Private Sub ProjectMgrUC_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
@@ -250,6 +252,11 @@ Public Class ProjectMgrUC
End Sub
Private Sub ResetCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles ResetCutBtn.Click
If (Keyboard.Modifiers And ModifierKeys.Shift) Then
' eseguo il ricalcolo delle sole FEED di lavorazione
UpdateFeedAllMachining()
Return
End If
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
' Cancello eventuali messaggi
m_CurrProjPage.ClearMessage()
@@ -711,6 +718,112 @@ Public Class ProjectMgrUC
End While
End Sub
Public Sub UpdateFeedAllMachining()
' recupero il valore di Feed della lavorazione corrente
Dim sMachiningName As String = String.Empty
If Not EgtMdbGetCurrMachiningParam(MCH_MP.NAME, sMachiningName) Then
' errore: lavorazione non trovata
EgtOutLog(" - Prima di 'Reset Feed' accedere alla pagina MACCHINA!")
'm_MainWindow.m_CurrentProjectPageUC.SetErrorMessage("Salvare la lavorazione corrente")
Return
End If
Dim dFeed As Double = 0
EgtMdbGetCurrMachiningParam(MCH_MP.FEED, dFeed)
Dim dFeedStarted As Double = 0
EgtMdbGetCurrMachiningParam(MCH_MP.STARTFEED, dFeedStarted)
Dim dFeedEnded As Double = 0
EgtMdbGetCurrMachiningParam(MCH_MP.ENDFEED, dFeedEnded)
Dim dFeedTipped As Double = 0
EgtMdbGetCurrMachiningParam(MCH_MP.TIPFEED, dFeedTipped)
Dim dFeedBack As Double = 0
EgtMdbGetCurrMachiningParam(MCH_MP.BACKFEED, dFeedBack)
Dim dFeedSideAng As Double = 0
EgtMdbGetCurrMachiningParam(MCH_MP.SIDEANGFEED, dFeedSideAng)
Dim MachiningList As New List(Of SplitMach)
' Recupero l'indice della fase corrente
Dim nCurrPhase As Integer = 1
' recupero in numero di fasi presenti nel progetto
Dim nCountPhase As Integer = EgtGetPhaseCount()
' ciclo su tutte le fasi di lavorazione
Dim nMach As Integer = 0
Dim nMachUpdated As Integer = 0
For IndexPhase As Integer = 1 To nCountPhase
' imposto la fase corrente
nCurrPhase = IndexPhase
' Preparo la lista delle lavorazioni
CalculateSplitMachList(nCurrPhase, MachiningList)
' per ogni lavorazione corrente procedo ad aggiornare la feed
For IndexMachining As Integer = 0 To MachiningList.Count - 1
nMach += 1
Dim nOperId As Integer = MachiningList(IndexMachining).m_nId
' setto la lavorazione come corrente
If EgtSetCurrMachining(nOperId) Then
Dim bUpdate As Boolean = False
' STANDARD
Dim dOrigFeed As Double
EgtGetMachiningParam(MCH_MP.FEED, dOrigFeed)
' imposto il valore di Feed solo se differente da quello nuovo
If Math.Abs(dOrigFeed - dFeed) > 0.1 Then
bUpdate = bUpdate Or EgtSetMachiningParam(MCH_MP.FEED, dFeed)
' aggiorno la lavorazione (senza il ricalcolo dell'intera lavorazione)
EgtApplyMachining(True)
End If
' STARTED
Dim dOrigFeedStarted As Double
EgtGetMachiningParam(MCH_MP.STARTFEED, dOrigFeedStarted)
' imposto il valore di Feed solo se differente da quello nuovo
If Math.Abs(dOrigFeedStarted - dFeedStarted) > 0.1 Then
bUpdate = bUpdate Or EgtSetMachiningParam(MCH_MP.STARTFEED, dFeedStarted)
' aggiorno la lavorazione (senza il ricalcolo dell'intera lavorazione)
EgtApplyMachining(True)
End If
' ENDED
Dim dOrigFeedEnded As Double
EgtGetMachiningParam(MCH_MP.ENDFEED, dOrigFeedEnded)
' imposto il valore di Feed solo se differente da quello nuovo
If Math.Abs(dOrigFeedEnded - dFeedEnded) > 0.1 Then
bUpdate = bUpdate Or EgtSetMachiningParam(MCH_MP.ENDFEED, dFeedEnded)
' aggiorno la lavorazione (senza il ricalcolo dell'intera lavorazione)
EgtApplyMachining(True)
End If
' TIPPED
Dim dOrigFeedTipped As Double
EgtGetMachiningParam(MCH_MP.TIPFEED, dOrigFeedTipped)
' imposto il valore di Feed solo se differente da quello nuovo
If Math.Abs(dOrigFeedTipped - dFeedTipped) > 0.1 Then
bUpdate = bUpdate Or EgtSetMachiningParam(MCH_MP.TIPFEED, dFeedTipped)
' aggiorno la lavorazione (senza il ricalcolo dell'intera lavorazione)
EgtApplyMachining(True)
End If
' BACK
Dim dOrigFeedBack As Double
EgtGetMachiningParam(MCH_MP.BACKFEED, dOrigFeedBack)
' imposto il valore di Feed solo se differente da quello nuovo
If Math.Abs(dOrigFeedBack - dFeedBack) > 0.1 Then
bUpdate = bUpdate Or EgtSetMachiningParam(MCH_MP.BACKFEED, dFeedBack)
' aggiorno la lavorazione (senza il ricalcolo dell'intera lavorazione)
EgtApplyMachining(True)
End If
' SIDEANG
Dim dOrigFeedSideAng As Double
EgtMdbGetCurrMachiningParam(MCH_MP.SIDEANGFEED, dOrigFeedSideAng)
' imposto il valore di Feed solo se differente da quello nuovo
If Math.Abs(dOrigFeedBack - dFeedSideAng) > 0.1 Then
bUpdate = bUpdate Or EgtSetMachiningParam(MCH_MP.SIDEANGFEED, dFeedSideAng)
' aggiorno la lavorazione (senza il ricalcolo dell'intera lavorazione)
EgtApplyMachining(True)
End If
' conto il numero di lavorazioni aggiornate
If bUpdate Then
nMachUpdated += 1
End If
End If
Next
Next
m_MainWindow.m_CurrentProjectPageUC.SetInfoMessage("Lavorazione aggiornate: " & nMachUpdated & "/ " & nMach)
End Sub
' ------------------------------------------------ GENERA COMANDI CNC MOVIMENTO ------------------------------------------------
Private Sub ExecuteCommandCNC(ptMid As Point3d, dAngC As Double, dAngB As Double)