From aec93d06fb878ee3ecdeef060ab2f5b1575b9df0 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Thu, 2 Mar 2017 18:08:09 +0000 Subject: [PATCH] EgtMachKernel 1.8c1 : - liberalizzati nomi di utensili e lavorazioni (ora vietato solo carattere '\n') - migliorati controlli su reset lavorazione corrente - corretta elevazione di fresatura, svuotatura e scalpellatura quando percorso su superficie superiore del grezzo - corretto controllo step di fresatura e svuotatura quando nullo. --- Chiseling.cpp | 2 +- EgtMachKernel.rc | Bin 11774 -> 11774 bytes GenMachining.cpp | 2 +- MachMgrMachGroups.cpp | 4 ++-- MachMgrMachines.cpp | 2 +- MachMgrOperations.cpp | 4 ++-- MachiningsMgr.cpp | 26 ++++++++++++++++++++------ Milling.cpp | 4 ++-- Pocketing.cpp | 8 ++++++-- ToolsMgr.cpp | 17 +++++++++++------ 10 files changed, 46 insertions(+), 23 deletions(-) diff --git a/Chiseling.cpp b/Chiseling.cpp index 14a88c1..0f28b89 100644 --- a/Chiseling.cpp +++ b/Chiseling.cpp @@ -1039,7 +1039,7 @@ Chiseling::ProcessPath( int nPathId, int nPvId, int nClId) if ( dElev < EPS_SMALL && AreSameVectorApprox( vtExtr, Z_AX)) { BBox3d b3Crv ; pCompo->GetLocalBBox( b3Crv) ; - dElev = max( 0., b3Raw.GetMax().z - b3Crv.GetMin().z + dDepth) ; + dElev = max( 0., b3Raw.GetMax().z - b3Crv.GetMin().z + min( 0., dThick) + dDepth) ; } } else diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index ea71105e5f8dc07d54ebe9e7cb31cdcacec205b9..2185d16e098ba0d11add48acb87b088b22510fc4 100644 GIT binary patch delta 121 zcmewt{V#gMH#Syd1|0^&&A-{KnVFLr3@1O7)ZLuM)x!c8zsNNCgkT;*P6$a3MUMyL R=2g-z%(yjz6ex#q0RU-NCWrt4 delta 121 zcmewt{V#gMH#Sxy1|0_T&A-{KnVFLq%qKsT)ZLuM)x!c8zsNNCgkT;*P6$a3MUMyL R=2g-z%(yjz6ex#q0RVGJCa?ei diff --git a/GenMachining.cpp b/GenMachining.cpp index e356386..41472fa 100644 --- a/GenMachining.cpp +++ b/GenMachining.cpp @@ -1035,7 +1035,7 @@ GenMachining::ProcessPath( int nPathId, int nPvId, int nClId) if ( dElev < EPS_SMALL && AreSameVectorApprox( vtExtr, Z_AX)) { BBox3d b3Crv ; pCompo->GetLocalBBox( b3Crv) ; - dElev = max( 0., b3Raw.GetMax().z - b3Crv.GetMin().z + dDepth) ; + dElev = max( 0., b3Raw.GetMax().z - b3Crv.GetMin().z + min( 0., dThick) + dDepth) ; } } else diff --git a/MachMgrMachGroups.cpp b/MachMgrMachGroups.cpp index eb04944..cb87c9e 100644 --- a/MachMgrMachGroups.cpp +++ b/MachMgrMachGroups.cpp @@ -18,7 +18,7 @@ #include "MachConst.h" #include "Disposition.h" #include "/EgtDev/Include/EGkGdbIterator.h" -#include "/EgtDev/Include/EGnStringUtils.h" +#include "/EgtDev/Include/EGnStringKeyVal.h" #include "/EgtDev/Include/EgtPointerOwner.h" using namespace std ; @@ -78,7 +78,7 @@ MachMgr::GetMachGroupNewName( string& sName) const if ( sName.empty()) sName = "Mach" ; // se presenti caratteri vietati, li sostituisco - ValidateName( sName) ; + ValidateVal( sName) ; // verifico che il nome sia unico int nCount = 0 ; string sOrigName = sName ; diff --git a/MachMgrMachines.cpp b/MachMgrMachines.cpp index 55840f5..84716d9 100644 --- a/MachMgrMachines.cpp +++ b/MachMgrMachines.cpp @@ -30,7 +30,7 @@ bool MachMgr::LoadMachine( const string& sMachineName) { // verifico validitā del nome - if ( ! IsValidName( sMachineName)) + if ( ! IsValidFileName( sMachineName)) return false ; // se macchina giā caricata, non devo fare alcunchč if ( GetMachine( sMachineName) != - 1) diff --git a/MachMgrOperations.cpp b/MachMgrOperations.cpp index 46c339c..bdf1d51 100644 --- a/MachMgrOperations.cpp +++ b/MachMgrOperations.cpp @@ -22,7 +22,7 @@ #include "/EgtDev/Include/EMkOperationConst.h" #include "/EgtDev/Include/EGkUserObjFactory.h" #include "/EgtDev/Include/EGkGdbIterator.h" -#include "/EgtDev/Include/EGnStringUtils.h" +#include "/EgtDev/Include/EGnStringKeyVal.h" #include "/EgtDev/Include/EGnFileUtils.h" #include "/EgtDev/Include/EgtPointerOwner.h" @@ -232,7 +232,7 @@ MachMgr::GetOperationNewName( string& sName) const if ( sName.empty()) sName = "Oper" ; // se presenti caratteri vietati, li sostituisco - ValidateName( sName) ; + ValidateVal( sName) ; // verifico che il nome sia unico int nCount = 0 ; string sOrigName = sName ; diff --git a/MachiningsMgr.cpp b/MachiningsMgr.cpp index a2f7e5c..9ba3cc6 100644 --- a/MachiningsMgr.cpp +++ b/MachiningsMgr.cpp @@ -1,13 +1,14 @@ //---------------------------------------------------------------------------- // EgalTech 2015-2017 //---------------------------------------------------------------------------- -// File : MachiningsMgr.cpp Data : 15.01.17 Versione : 1.6x7 +// File : MachiningsMgr.cpp Data : 02.03.17 Versione : 1.8c1 // Contenuto : Implementazione gestore database lavorazioni. // // // // Modifiche : 02.06.15 DS Creazione modulo. // 13.07.16 DS Agg. gestione SplitArcs (MF_CURR_VER = 1005). +// 02.03.17 DS Aggiunto controllo nome. // //---------------------------------------------------------------------------- @@ -496,8 +497,13 @@ bool MachiningsMgr::AddMachining( const string& sName, int nType) { // annullo lavorazione corrente - if ( m_pCurrMach != nullptr) + if ( m_pCurrMach != nullptr) { delete m_pCurrMach ; + m_pCurrMach = nullptr ; + } + // verifico validitā del nome + if ( ! IsValidVal( sName)) + return false ; // verifico unicitā del nome if ( m_suData.find( sName) != m_suData.end()) return false ; @@ -528,8 +534,13 @@ bool MachiningsMgr::CopyMachining( const string& sSource, const string& sName) { // annullo lavorazione corrente - if ( m_pCurrMach != nullptr) + if ( m_pCurrMach != nullptr) { delete m_pCurrMach ; + m_pCurrMach = nullptr ; + } + // verifico validitā del nome + if ( ! IsValidVal( sName)) + return false ; // verifico unicitā del nome if ( m_suData.find( sName) != m_suData.end()) return false ; @@ -658,9 +669,10 @@ bool MachiningsMgr::SetCurrMachining( const string& sName) { // se c'č lavorazione corrente, la elimino - if ( m_pCurrMach != nullptr) + if ( m_pCurrMach != nullptr) { delete m_pCurrMach ; - m_pCurrMach = nullptr ; + m_pCurrMach = nullptr ; + } // recupero i dati della lavorazione const MachiningData* pMdata = GetMachining( sName) ; if ( pMdata == nullptr) @@ -802,8 +814,10 @@ MachiningsMgr::SetCurrMachiningParam( int nType, const std::string& sVal) // non č possibile cambiare UUID e Tool UUID if ( nType == MPA_UUID || nType == MPA_TUUID) return false ; - // č possibile cambiare il nome, solo se il nuovo non č giā presente nel DB (esclusa lavorazione corrente) + // č possibile cambiare il nome, solo se il nuovo č valido e non č giā presente nel DB (esclusa lavorazione corrente) if ( nType == MPA_NAME) { + if ( ! IsValidVal( sVal)) + return false ; const MachiningData* pMch = GetMachining( sVal) ; if ( pMch != nullptr && pMch->m_Uuid != m_pCurrMach->m_Uuid) return false ; diff --git a/Milling.cpp b/Milling.cpp index ff8a78a..092c48e 100644 --- a/Milling.cpp +++ b/Milling.cpp @@ -1235,7 +1235,7 @@ Milling::ProcessPath( int nPathId, int nPvId, int nClId) if ( dElev < EPS_SMALL && AreSameVectorApprox( vtExtr, Z_AX)) { BBox3d b3Crv ; pCompo->GetLocalBBox( b3Crv) ; - dElev = max( 0., b3Raw.GetMax().z - b3Crv.GetMin().z + dDepth) ; + dElev = max( 0., b3Raw.GetMax().z - b3Crv.GetMin().z + min( 0., dThick) + dDepth) ; } } else @@ -1244,7 +1244,7 @@ Milling::ProcessPath( int nPathId, int nPvId, int nClId) // verifico che lo step dell'utensile sia sensato double dOkStep = m_Params.m_dStep ; const double MIN_ZSTEP = 1.0 ; - if ( dOkStep < MIN_ZSTEP) { + if ( dOkStep >= EPS_SMALL && dOkStep < MIN_ZSTEP) { dOkStep = MIN_ZSTEP ; string sInfo = "Warning in Milling : machining step too small (" + ToString( m_Params.m_dStep, 2) + ")" ; diff --git a/Pocketing.cpp b/Pocketing.cpp index e4b908c..d8c84ea 100644 --- a/Pocketing.cpp +++ b/Pocketing.cpp @@ -1073,7 +1073,7 @@ Pocketing::ProcessPath( int nPathId, int nPvId, int nClId) if ( dElev < EPS_SMALL && AreSameVectorApprox( vtExtr, Z_AX)) { BBox3d b3Crv ; pCompo->GetLocalBBox( b3Crv) ; - dElev = max( 0., b3Raw.GetMax().z - b3Crv.GetMin().z + dDepth) ; + dElev = max( 0., b3Raw.GetMax().z - b3Crv.GetMin().z + min( 0., dThick) + dDepth) ; } } else @@ -1091,7 +1091,7 @@ Pocketing::ProcessPath( int nPathId, int nPvId, int nClId) // verifico che lo step dell'utensile sia sensato double dOkStep = m_Params.m_dStep ; const double MIN_ZSTEP = 1.0 ; - if ( dOkStep < MIN_ZSTEP) { + if ( dOkStep >= EPS_SMALL && dOkStep < MIN_ZSTEP) { dOkStep = MIN_ZSTEP ; string sInfo = "Warning in Pocketing : machining step too small (" + ToString( m_Params.m_dStep, 2) + ")" ; @@ -1997,6 +1997,10 @@ Pocketing::AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3 // Eseguo a seconda del tipo switch ( nType) { case POCKET_LI_NONE : + if ( ! AreSamePointApprox( ptP1, ptStart)) { + if ( AddLinearMove( ptStart, MCH_CL_LEADIN) == GDB_ID_NULL) + return false ; + } return true ; case POCKET_LI_GLIDE : // !!! DA FARE !!! diff --git a/ToolsMgr.cpp b/ToolsMgr.cpp index fc7e3ff..658842f 100644 --- a/ToolsMgr.cpp +++ b/ToolsMgr.cpp @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------- -// EgalTech 2015-2015 +// EgalTech 2015-2017 //---------------------------------------------------------------------------- -// File : ToolsMgr.cpp Data : 01.06.15 Versione : 1.6f1 +// File : ToolsMgr.cpp Data : 02.03.17 Versione : 1.8c1 // Contenuto : Implementazione gestore database utensili. // // @@ -9,6 +9,7 @@ // Modifiche : 01.06.15 DS Creazione modulo. // 21.10.15 DS Aggiunti VERSION e TOOLSIZE in HEADER (default VERSION = 1000 e TOOLSIZE = 26). // Ora VERSION = 1001 e TOOLSIZE = 29. +// 02.03.17 DS Aggiunto controllo nome. // //---------------------------------------------------------------------------- @@ -17,7 +18,7 @@ #include "ToolsMgr.h" #include "DllMain.h" #include "/EgtDEv/Include/EmkToolConst.h" -#include "/EgtDEv/Include/EGnStringUtils.h" +#include "/EgtDEv/Include/EGnStringKeyVal.h" #include "/EgtDEv/Include/EGnFileUtils.h" #include "/EgtDEv/Include/EGnScanner.h" #include "/EgtDEv/Include/EGnWriter.h" @@ -333,8 +334,10 @@ ToolsMgr::GetToolNewName( string& sName) const bool ToolsMgr::AddTool( const string& sName, int nType) { + // annullo utensile corrente + m_bCurrTool = false ; // verifico validitā del nome - if ( ! IsValidName( sName)) + if ( ! IsValidVal( sName)) return false ; // verifico unicitā del nome if ( m_suData.find( sName) != m_suData.end()) @@ -362,8 +365,10 @@ ToolsMgr::AddTool( const string& sName, int nType) bool ToolsMgr::CopyTool( const string& sSource, const string& sName) { + // annullo utensile corrente + m_bCurrTool = false ; // verifico validitā del nome - if ( ! IsValidName( sName)) + if ( ! IsValidVal( sName)) return false ; // verifico unicitā del nome if ( m_suData.find( sName) != m_suData.end()) @@ -576,7 +581,7 @@ ToolsMgr::SetCurrToolParam( int nType, const string& sVal) return false ; // č possibile cambiare il nome, solo se il nuovo č valido e non č giā presente nel DB (escluso utensile corrente) if ( nType == TPA_NAME) { - if ( ! IsValidName( sVal)) + if ( ! IsValidVal( sVal)) return false ; const ToolData* pTdata = GetTool( sVal) ; if ( pTdata != nullptr && pTdata->m_Uuid != m_tdCurrTool.m_Uuid)