diff --git a/CAM/CamAuto.vb b/CAM/CamAuto.vb index bf90f76..e2b567e 100644 --- a/CAM/CamAuto.vb +++ b/CAM/CamAuto.vb @@ -25,6 +25,9 @@ Friend Module CamAuto If nErr <> 0 Then bOk = False EgtOutLog("Error in CamAuto : " & nErr.ToString()) + If nErr < 0 Then + m_MainWindow.m_CurrentProjectPageUC.SetWarningMessage(EgtMsg(91017)) + End If End If m_MainWindow.m_CurrentProjectPageUC.ResetOrderMachiningFlag() Return bOk @@ -43,6 +46,7 @@ Friend Module CamAuto If nErr <> 0 Then bOk = False EgtOutLog("Error in CamAuto : " & nErr.ToString()) + m_MainWindow.m_CurrentProjectPageUC.ClearMessage() End If Return bOk End Function diff --git a/CadCuts/NestPageUC.xaml.vb b/CadCuts/NestPageUC.xaml.vb index 84c6b98..ec71902 100644 --- a/CadCuts/NestPageUC.xaml.vb +++ b/CadCuts/NestPageUC.xaml.vb @@ -230,21 +230,21 @@ Public Class NestPageUC m_nCountSpot = 0 m_nCountSpotCUT = 0 End If - EgtOutLog("Numero di SPOT caricati da OFFICE: " & m_nCountSpot.ToString) + 'EgtOutLog("Numero di SPOT caricati da OFFICE: " & m_nCountSpot.ToString) ' Se nel progetto non sono inseriti punti SpotReg disabilito i comandi If m_nCountSpot < 1 Then UG0_Reg.IsEnabled = False UG1_Reg.IsEnabled = False - EgtOutLog(" Abilito comandi gestione SPOT") + 'EgtOutLog(" Abilito comandi gestione SPOT") Else UG0_Reg.IsEnabled = True UG1_Reg.IsEnabled = True - EgtOutLog(" Disabilito comandi gestione SPOT") + 'EgtOutLog(" Disabilito comandi gestione SPOT") End If ' Se nel progetto non sono inseriti punti SpotRegCUT provvedo ad aggiungerli If m_nCountSpotCUT < 1 Then InsertSpotRegistration() - EgtOutLog(" Creo SPOT_CUT") + 'EgtOutLog(" Creo SPOT_CUT") End If ' Se necessario riabilito impostazione modificato diff --git a/Constants/ConstIni.vb b/Constants/ConstIni.vb index 01de51e..6d47034 100644 --- a/Constants/ConstIni.vb +++ b/Constants/ConstIni.vb @@ -90,6 +90,7 @@ Module ConstIni Public Const K_TEXMAXLINPIX As String = "TextureMaxLinPixels" Public Const K_ZOOMWIN As String = "ZoomWin" Public Const K_DISTLINE As String = "DistLine" + Public Const K_ORTOGRAPHIC As String = "OrtoGraphic" Public Const S_ALZFRONT As String = "Alz&Front" Public Const K_ALZFRONT As String = "Alz&Front" diff --git a/DrawImport/DrawPageUC.xaml.vb b/DrawImport/DrawPageUC.xaml.vb index 34c879d..ddbfb50 100644 --- a/DrawImport/DrawPageUC.xaml.vb +++ b/DrawImport/DrawPageUC.xaml.vb @@ -1175,6 +1175,9 @@ Public Class DrawPageUC ' Se errore esco If Not m_bDrawOk Then Return + ' Attivo il parcheggio dei pezzi Draw (per il corretto posizionamento nella scena) + ActivateParkIndZero() + ' Nome pezzo Dim sPartName As String = PartNameTxBx.Text ' Leggo numero di pezzi da inserire @@ -1206,9 +1209,6 @@ Public Class DrawPageUC m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC) m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC) m_MainWindow.m_ActivePage = If(m_MainWindow.FrameCutBtn.IsChecked, MainWindow.Pages.FrameCut, MainWindow.Pages.CadCut) - ' Attivo il parcheggio dei pezzi Draw - ActivateParkIndZero() - Else m_SceneButtons.MeasureBtn.IsChecked = False DrawPage_Unloaded(sender, e) diff --git a/Machine/CurrentMachine.vb b/Machine/CurrentMachine.vb index 074f9f9..e4d9c5b 100644 --- a/Machine/CurrentMachine.vb +++ b/Machine/CurrentMachine.vb @@ -204,6 +204,9 @@ Public Class CurrentMachine ' Massima profondità lavorabile nei tagli diretti Private m_MaxTabDepth As Double = 10.0 + ' Massima altezza lavorabile con lama grande + Private m_dHighPieceZ As Double = 200.0 + #Region "Proprietà che leggono e scrivono i valori anche da o su file ini" Friend ReadOnly Property MaxTabDepth As Double Get @@ -1149,6 +1152,12 @@ Public Class CurrentMachine End Get End Property + Friend ReadOnly Property dHighPieceZ As Double + Get + Return m_dHighPieceZ + End Get + End Property + #End Region Sub New() @@ -1417,6 +1426,9 @@ Public Class CurrentMachine If m_MaxTabDepth < 0 Then m_MaxTabDepth = 10.0 End If + + ' Massimo spessore lavorabile con lama grande + m_dHighPieceZ = GetPrivateProfileDouble(S_RAWMOVE, "MaxHeightPiece", 800.0, m_MainWindow.GetMachIniFile()) End Sub ' Per il controllo FANUC al momento dell'inizializzazione del CN devono essere lette alcune variabili diff --git a/MainWindow.xaml.vb b/MainWindow.xaml.vb index 4db4389..51889ba 100644 --- a/MainWindow.xaml.vb +++ b/MainWindow.xaml.vb @@ -26,7 +26,7 @@ Class MainWindow ' Variabile che definisce l'avvio forzato in modalità FRAME Friend m_OnlyFrame As Boolean = False - Public Shared m_bShowSVGParkInd As Boolean = True + Public Shared m_bShowSVGParkInd As Boolean = False ' Dichiarazione delle Page UserControl Friend m_WorkInProgressPageUC As WorkInProgressPageUC @@ -345,8 +345,8 @@ Class MainWindow ' Verifico abilitazione nesting automatico m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey) ' Recupero opzioni della chiave - Dim bKey As Boolean = EgtGetKeyLevel(9423, 2612, 1, m_nKeyLevel) And - EgtGetKeyOptions(9423, 2612, 1, m_nKeyOptions) + Dim bKey As Boolean = EgtGetKeyLevel(9423, 2701, 1, m_nKeyLevel) And + EgtGetKeyOptions(9423, 2701, 1, m_nKeyOptions) ' Verifico abilitazione prodotto Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE) ' Impostazione per programma OnlyFrame: solo se CUT_BASE non attivo diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index c849d31..a9ad02d 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -22,7 +22,7 @@ Imports System.Windows #End If - + @@ -62,5 +62,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/Project/CurrentProjectPageUC.xaml.vb b/Project/CurrentProjectPageUC.xaml.vb index 83f7a2c..00201c1 100644 --- a/Project/CurrentProjectPageUC.xaml.vb +++ b/Project/CurrentProjectPageUC.xaml.vb @@ -196,7 +196,7 @@ Public Class CurrentProjectPageUC ' Inizializzo gestore lavorazioni EgtInitMachMgr(m_MainWindow.GetMachinesRootDir(), m_MainWindow.GetToolMakersDir()) m_bFirst = False - Dim bOrtoGraphic As Boolean = (GetPrivateProfileInt(S_SCENE, "OrtoGraphic", 1, m_MainWindow.GetIniFile()) <> 0) + Dim bOrtoGraphic As Boolean = (GetPrivateProfileInt(S_SCENE, K_ORTOGRAPHIC, 1, m_MainWindow.GetIniFile()) <> 0) EgtSetCameraType(bOrtoGraphic, True) ' creo nuovo progetto m_nCurrProj = GetPrivateProfileInt(S_GENERAL, K_LASTPROJ, 0, m_MainWindow.GetIniFile()) diff --git a/Project/SceneButtonsUC.xaml.vb b/Project/SceneButtonsUC.xaml.vb index 9f81c14..5274ea3 100644 --- a/Project/SceneButtonsUC.xaml.vb +++ b/Project/SceneButtonsUC.xaml.vb @@ -49,6 +49,12 @@ Public Class SceneButtonsUC 'End Sub Private Sub PanBtn_Click(sender As Object, e As RoutedEventArgs) Handles PanBtn.Click + If Keyboard.IsKeyDown(Key.LeftShift) Then + Dim bOrtoGraphic As Boolean = (GetPrivateProfileInt(S_SCENE, K_ORTOGRAPHIC, 1, m_MainWindow.GetIniFile()) <> 0) + EgtSetCameraType(Not bOrtoGraphic, True) + WritePrivateProfileString(S_SCENE, K_ORTOGRAPHIC, If(Not bOrtoGraphic, "1", "0"), m_MainWindow.GetIniFile()) + Return + End If GetCurrScene.SetStatusPan() End Sub diff --git a/RawPhoto/RawPartPageUC.xaml.vb b/RawPhoto/RawPartPageUC.xaml.vb index b25e33d..d4a584a 100644 --- a/RawPhoto/RawPartPageUC.xaml.vb +++ b/RawPhoto/RawPartPageUC.xaml.vb @@ -320,6 +320,8 @@ Public Class RawPartPageUC OffsetXTxBx.Text = LenToString(m_RawOffsX, 2) OffsetYTxBx.Text = LenToString(m_RawOffsY, 2) KerfTxBx.Text = LenToString(dInvertKerf * m_RawKerf, 2) + ' Verifico se attivare la visualizzazione dell'area sicura + DrawSafetyZone(m_RawHeight, m_CurrentMachine.dHighPieceZ) ' Creo layer temporaneo per crocette m_nTempLay = EgtCreateGroup(GDB_ID.ROOT) EgtSetLevel(m_nTempLay, GDB_LV.TEMP) @@ -571,6 +573,9 @@ Public Class RawPartPageUC ' Ricavo il punto corrente in coordinate mondo Dim ptCurr As Point3d EgtUnProjectPoint(e.Location, ptCurr) + + If Not DrawSafetyZone(m_RawHeight, m_CurrentMachine.dHighPieceZ) Then Return + ' Eseguo modifica Select Case m_ActiveRawMode Case RAWMODE.RECTANGLE @@ -745,6 +750,8 @@ Public Class RawPartPageUC If Not m_bActive Then Return ' Disabilito modalità drag m_bDrag = False + ' Verifico che il pezzo sia in una posizione corretta + DrawSafetyZone(m_RawHeight, m_CurrentMachine.dHighPieceZ) End Sub Private Sub MaterialsCmbx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles MaterialsCmbx.SelectionChanged @@ -2063,6 +2070,8 @@ Public Class RawPartPageUC If Not StringToLen(HeightTxBx.Text, dHeight) Then Return End If + ' verifico se l'altezza del pezzo è maggiore di quella consentita in macchina + DrawSafetyZone(dHeight, m_CurrentMachine.dHighPieceZ) If dHeight > -EPS_ZERO Then m_CurrProjPage.ClearMessage() If Math.Abs(dHeight - m_RawHeight) > EPS_SMALL Then @@ -2132,6 +2141,64 @@ Public Class RawPartPageUC End If End Sub + Private Function DrawSafetyZone(dHeight As Double, dHighPieceZ As Double) As Boolean + Dim nStatus As GDB_ST = GDB_ST.OFF + If dHeight > dHighPieceZ Then + nStatus = GDB_ST.ON_ + End If + ' attivo la visualizzazione delle pareti che delimitano l'area sicura + Dim nIdBase As Integer = EgtGetBaseId("Base") + Dim nIdMinRedX As Integer = EgtGetFirstNameInGroup(nIdBase, "MinRedX") + EgtSetStatus(nIdMinRedX, nStatus) + Dim nIdMinRedY As Integer = EgtGetFirstNameInGroup(nIdBase, "MinRedY") + EgtSetStatus(nIdMinRedY, nStatus) + EgtDraw() + If nStatus = GDB_ST.ON_ Then + Return VerifyRawInSafetyZone(nIdMinRedX, nIdMinRedY) + End If + Return True + End Function + + Private Function VerifyRawInSafetyZone(nIdMinRedX As Integer, nIdMinRedY As Integer) As Boolean + Dim bOk As Boolean = True + Dim nRawSolidId = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_RAW_SOLID) + Dim ptMinRaw, ptMaxRaw As Point3d + EgtGetBBoxGlob(nRawSolidId, GDB_BB.STANDARD, ptMinRaw, ptMaxRaw) + Dim ptMinX, ptMaxX As Point3d + EgtGetBBoxGlob(nIdMinRedX, GDB_BB.STANDARD, ptMinX, ptMaxX) + Dim ptMinY, ptMaxY As Point3d + EgtGetBBoxGlob(nIdMinRedY, GDB_BB.STANDARD, ptMinY, ptMaxY) + ' Verifico che il grezzo sia all'interno di questi estremi + If ptMinRaw.x < ptMinX.x Then + ' EgtSetColor(nRawSolidId, New Color3d(255, 0, 0), 40) + Dim ptRef As Point3d = New Point3d(ptMinX.x - m_ptTableMin.x, ptMinRaw.y - m_ptTableMin.y, 0) + EgtMoveToCornerRawPart(m_CurrProjPage.m_nRawId, ptRef, MCH_CR.BL) + m_RawOffsX = ptMinX.x + m_RawKerf - m_ptTableMin.x + m_RawOffsY = ptMinRaw.y + m_RawKerf - m_ptTableMin.y + OffsetXTxBx.Text = LenToString(m_RawOffsX, 2) + OffsetYTxBx.Text = LenToString(m_RawOffsY, 2) + EgtDraw() + bOk = False + End If + ' Ricalcolo la posizione del grezzo se nel processo sopra ho eseguito uno spostamento + If Not bOk Then EgtGetBBoxGlob(nRawSolidId, GDB_BB.STANDARD, ptMinRaw, ptMaxRaw) + If ptMaxRaw.y > ptMinY.y Then + ' EgtSetColor(nRawSolidId, New Color3d(255, 0, 0), 40) + Dim dRawWidth As Double = ptMaxRaw.y - ptMinRaw.y + Dim ptRef As Point3d = New Point3d(ptMinRaw.x - m_ptTableMin.x, ptMinY.y - dRawWidth - m_ptTableMin.y, 0) + EgtMoveToCornerRawPart(m_CurrProjPage.m_nRawId, ptRef, MCH_CR.BL) + m_RawOffsX = ptMinRaw.x + m_RawKerf - m_ptTableMin.x + m_RawOffsY = ptMinY.y - dRawWidth + m_RawKerf - m_ptTableMin.y + OffsetXTxBx.Text = LenToString(m_RawOffsX, 2) + OffsetYTxBx.Text = LenToString(m_RawOffsY, 2) + EgtDraw() + bOk = False + End If + If bOk Then EgtSetColor(nRawSolidId, m_RawCol) + EgtDraw() + Return bOk + End Function + #Region "OTHERREFTAB" Private Sub OtherRefTabChBx_Click(sender As Object, e As EventArgs) Handles OtherRefTabChBx.Click