EgtMachKernel 2.1g4 :

- modifiche a gestione DB lavorazioni per conservare soli dati della versione del DB letta
- aggiunto a DB lavorazioni parametro generale MaxDepthSafe
- utilizzo del parametro sopraindicato per calcolo MaxDepth delle frese.
This commit is contained in:
Dario Sassi
2019-07-24 17:18:22 +00:00
parent 280e3abf0c
commit 29c8cdec4e
9 changed files with 68 additions and 32 deletions
BIN
View File
Binary file not shown.
-4
View File
@@ -130,10 +130,6 @@ const double LIO_ELEV_TOL = 2.0 ;
// Per FlatParts (vedi Nesting di EgtExecutor)
const std::string NST_EXT_LAYER = "OutLoop" ;
//----------------------------------------------------------------------------
// Sicurezza su massimo affondamento utensili
const double MAX_DEPTH_SAFE = 2.0 ;
//----------------------------------------------------------------------------
// Minima componente zeta di versore utensile per lavorazione da sopra (-45deg)
const double MIN_ZDIR_TOP_TOOL = -0.7072 ;
+6 -1
View File
@@ -254,8 +254,13 @@ MachMgr::TdbGetCurrToolMaxDepth( double& dMaxDepth) const
ToolsMgr* pTsMgr = GetCurrToolsMgr() ;
if ( pTsMgr == nullptr)
return false ;
// recupero la sicurezza da aggiungere al massimo affondamento
MachiningsMgr* pMsMgr = GetCurrMachiningsMgr() ;
if ( pMsMgr == nullptr)
return false ;
double dSafe = pMsMgr->GetMaxDepthSafe() ;
// recupero il massimo affondamento
return pTsMgr->GetCurrToolMaxDepth( dMaxDepth) ;
return pTsMgr->GetCurrToolMaxDepth( dSafe, dMaxDepth) ;
}
//----------------------------------------------------------------------------
+36 -9
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2015-2019
//----------------------------------------------------------------------------
// File : MachiningsMgr.cpp Data : 17.06.19 Versione : 2.1f2
// File : MachiningsMgr.cpp Data : 24.07.19 Versione : 2.1g4
// Contenuto : Implementazione gestore database lavorazioni.
//
//
@@ -11,6 +11,7 @@
// 02.03.17 DS Aggiunto controllo nome.
// 17.05.17 DS Agg. gestione IntSawArcMaxSideAng (MF_CURR_VER = 1006).
// 17.06.19 DS Agg. lavorazione finitura superficie (MF_CURR_VER = 1007).
// 24.07.19 DS Agg. scrittura come versione letta e param MAXDEPTHSAFE (MF_CURR_VER = 1008).
//
//----------------------------------------------------------------------------
@@ -38,7 +39,7 @@ const string MF_HEADER = "[HEADER]" ;
const string MF_VERSION = "VERSION" ;
const string MF_TOTAL = "TOTAL" ;
const string MF_SIZE = "SIZE" ;
const int MF_CURR_VER = 1007 ;
const int MF_CURR_VER = 1008 ;
const string MF_GENERAL = "[GENERAL]" ;
const string MF_3AXCOMP = "3AXCOMP" ;
const bool MF_CURR_3AXCOMP = false ;
@@ -60,7 +61,8 @@ const string MF_INTSAWARCMAXSIDEANG = "INTSAWARCMAXSIDEANG" ;
const double MF_CURR_INTSAWARCMAXSIDEANG = 45 ;
const string MF_SPLITARCS = "SPLITARCS" ;
const int MF_CURR_SPLITARCS = SPLAR_NEVER ;
const string MF_MAXDEPTHSAFE = "MAXDEPTHSAFE" ;
const double MF_CURR_MAXDEPTHSAFE = 2.0 ;
//----------------------------------------------------------------------------
MachiningsMgr::MachiningsMgr( void)
@@ -69,6 +71,7 @@ MachiningsMgr::MachiningsMgr( void)
m_suCIter = m_suData.cend() ;
m_pCurrMach = nullptr ;
m_bModified = false ;
m_nDbVer = 0 ;
m_dSafeZ = MF_CURR_SAFEZ ;
m_dSafeAggrBottZ = MF_CURR_SAFEAGGRBOTTZ ;
m_b3AxComp = MF_CURR_3AXCOMP ;
@@ -79,6 +82,7 @@ MachiningsMgr::MachiningsMgr( void)
m_dExtSawArcMinRad = MF_CURR_EXTSAWARCMINRAD ;
m_dIntSawArcMaxSideAng = MF_CURR_INTSAWARCMAXSIDEANG ;
m_nSplitArcs = MF_CURR_SPLITARCS ;
m_dMaxDepthSafe = MF_CURR_MAXDEPTHSAFE ;
}
//----------------------------------------------------------------------------
@@ -157,20 +161,20 @@ MachiningsMgr::Reload( void)
bool bEnd = false ;
// Leggo l'intestazione
int nVersion = 0 ;
m_nDbVer = 0 ;
int nTotal = 0 ;
if ( ! LoadHeader( TheScanner, nVersion, nTotal, bEnd)) {
if ( ! LoadHeader( TheScanner, m_nDbVer, nTotal, bEnd)) {
bOk = false ;
string sOut = "ReloadMachinings : Error on Header" ;
LOG_ERROR( GetEMkLogger(), sOut.c_str())
}
{
string sOut = "ReloadMachinings : FileVer = " + ToString( nVersion) + " CurrVer = " + ToString( MF_CURR_VER) ;
string sOut = "ReloadMachinings : FileVer = " + ToString( m_nDbVer) + " CurrVer = " + ToString( MF_CURR_VER) ;
LOG_DBG_INFO( GetEMkLogger(), sOut.c_str())
}
// Leggo i dati generali (da versione 1002)
if ( nVersion >= 1002 && ! LoadGeneral( TheScanner, bEnd)) {
if ( m_nDbVer >= 1002 && ! LoadGeneral( TheScanner, bEnd)) {
bOk = false ;
string sOut = "ReloadMachinings : Error on General" ;
LOG_ERROR( GetEMkLogger(), sOut.c_str())
@@ -232,6 +236,8 @@ MachiningsMgr::LoadHeader( Scanner& TheScanner, int& nVersion, int& nTotal, bool
else
bOk = false ;
}
// controllo il numero di versione
nVersion = min( nVersion, MF_CURR_VER) ;
return bOk ;
}
@@ -286,8 +292,10 @@ MachiningsMgr::LoadGeneral( Scanner& TheScanner, bool& bEnd)
bOk = FromString( sVal, m_dIntSawArcMaxSideAng) ;
else if ( ToUpper( sKey) == MF_SPLITARCS)
bOk = FromString( sVal, m_nSplitArcs) ;
else if ( ToUpper( sKey) == MF_MAXDEPTHSAFE)
bOk = FromString( sVal, m_dMaxDepthSafe) ;
else
bOk = false ;
bOk = true ;
}
if ( ! bSafeAggrBottZ)
m_dSafeAggrBottZ = m_dSafeZ ;
@@ -431,7 +439,7 @@ MachiningsMgr::SaveHeader( Writer& TheWriter) const
string sOut ;
sOut = MF_HEADER ;
bOk = bOk && TheWriter.OutText( sOut) ;
sOut = MF_VERSION + "=" + ToString( MF_CURR_VER) ;
sOut = MF_VERSION + "=" + ToString( m_nDbVer) ;
bOk = bOk && TheWriter.OutText( sOut) ;
sOut = MF_TOTAL + "=" + ToString( int( m_umData.size())) ;
bOk = bOk && TheWriter.OutText( sOut) ;
@@ -467,6 +475,10 @@ MachiningsMgr::SaveGeneral( Writer& TheWriter) const
bOk = bOk && TheWriter.OutText( sOut) ;
sOut = MF_SPLITARCS + "=" + ToString( m_nSplitArcs) ;
bOk = bOk && TheWriter.OutText( sOut) ;
if ( m_nDbVer >= 1008) {
sOut = MF_MAXDEPTHSAFE + "=" + ToString( m_dMaxDepthSafe) ;
bOk = bOk && TheWriter.OutText( sOut) ;
}
return bOk ;
}
@@ -1126,9 +1138,24 @@ MachiningsMgr::SetSplitArcs( int nFlag)
{
if ( nFlag < SPLAR_NEVER || nFlag > SPLAR_ALWAYS)
return false ;
// se cambiato, salvo e setto modifica
if ( nFlag != m_nSplitArcs) {
m_nSplitArcs = nFlag ;
m_bModified = true ;
}
return true ;
}
//----------------------------------------------------------------------------
bool
MachiningsMgr::SetMaxDepthSafe( double dSafe)
{
// verifico non sia inferiore al minimo
dSafe = max( dSafe, MF_CURR_MAXDEPTHSAFE) ;
// se cambiato, salvo e setto modifica
if ( abs( dSafe - m_dMaxDepthSafe) > EPS_SMALL) {
m_dMaxDepthSafe = dSafe ;
m_bModified = true ;
}
return true ;
}
+12 -6
View File
@@ -61,23 +61,26 @@ class MachiningsMgr
double GetSafeAggrBottZ( void) const
{ return m_dSafeAggrBottZ ; }
bool SetExtraLOnCutRegion( double dExtraL) ;
double GetExtraLOnCutRegion( void)
double GetExtraLOnCutRegion( void) const
{ return m_dExtraLOnCutRegion ; }
bool SetExtraROnDrillRegion( double dExtraR) ;
double GetExtraROnDrillRegion( void)
double GetExtraROnDrillRegion( void) const
{ return m_dExtraROnDrillRegion ; }
bool SetHoleDiamToler( double dToler) ;
double GetHoleDiamToler( void)
double GetHoleDiamToler( void) const
{ return m_dHoleDiamToler ; }
bool SetExtSawArcMinRad( double dRad) ;
double GetExtSawArcMinRad( void)
double GetExtSawArcMinRad( void) const
{ return m_dExtSawArcMinRad ; }
bool SetIntSawArcMaxSideAng( double dSideAng) ;
double GetIntSawArcMaxSideAng( void)
double GetIntSawArcMaxSideAng( void) const
{ return m_dIntSawArcMaxSideAng ; }
bool SetSplitArcs( int nFlag) ;
int GetSplitArcs( void)
int GetSplitArcs( void) const
{ return m_nSplitArcs ; }
bool SetMaxDepthSafe( double dSafe) ;
double GetMaxDepthSafe( void) const
{ return m_dMaxDepthSafe ; }
private :
bool Clear( bool bReset) ;
@@ -101,6 +104,8 @@ class MachiningsMgr
std::string m_sMachsFile ;
// flag di dati modificati
mutable bool m_bModified ;
// versione DB caricato
int m_nDbVer ;
// database lavorazioni
UUIDPMDATA_UMAP m_umData ;
STRUUID_MAP m_suData ;
@@ -121,4 +126,5 @@ class MachiningsMgr
double m_dExtSawArcMinRad ;
double m_dIntSawArcMaxSideAng ;
int m_nSplitArcs ;
double m_dMaxDepthSafe ;
} ;
+2 -1
View File
@@ -1632,7 +1632,8 @@ Milling::ProcessPath( int nPathId, int nPvId, int nClId)
// altrimenti lavorazione a step
else {
// se l'elevazione supera il massimo affondamento dell'utensile
double dMaxDepth = m_TParams.m_dLen - ( m_TParams.m_dDiam > m_dTHoldDiam ? 0 : m_dTHoldLen) - MAX_DEPTH_SAFE ;
double dSafe = m_pMchMgr->GetCurrMachiningsMgr()->GetMaxDepthSafe() ;
double dMaxDepth = m_TParams.m_dLen - ( m_TParams.m_dDiam > m_dTHoldDiam ? 0 : m_dTHoldLen) - dSafe ;
if ( dElev > dMaxDepth + EPS_SMALL) {
// se affondamento riducibile : segnalo, riduco e continuo
if ( dDepth + max( dThick, 0.0) > dElev - dMaxDepth) {
+2 -1
View File
@@ -1503,7 +1503,8 @@ Pocketing::ProcessPath( int nPathId, int nPvId, int nClId)
// altrimenti lavorazione a step
else {
// se l'elevazione supera il massimo affondamento dell'utensile
double dMaxDepth = m_TParams.m_dLen - ( m_TParams.m_dDiam > m_dTHoldDiam ? 0 : m_dTHoldLen) - MAX_DEPTH_SAFE ;
double dSafe = m_pMchMgr->GetCurrMachiningsMgr()->GetMaxDepthSafe() ;
double dMaxDepth = m_TParams.m_dLen - ( m_TParams.m_dDiam > m_dTHoldDiam ? 0 : m_dTHoldLen) - dSafe ;
if ( dElev > dMaxDepth + EPS_SMALL) {
// se affondamento riducibile : segnalo, riduco e continuo
if ( dDepth + max( dThick, 0.0) > dElev - dMaxDepth) {
+2 -2
View File
@@ -659,7 +659,7 @@ ToolsMgr::GetCurrToolParam( int nType, string& sVal) const
//----------------------------------------------------------------------------
bool
ToolsMgr::GetCurrToolMaxDepth( double& dMaxDepth) const
ToolsMgr::GetCurrToolMaxDepth( double dSafe, double& dMaxDepth) const
{
// verifico esistenza utensile corrente
if ( ! m_bCurrTool)
@@ -688,7 +688,7 @@ ToolsMgr::GetCurrToolMaxDepth( double& dMaxDepth) const
GetValInNotes( m_tdCurrTool.m_sSysNotes, TSI_THDIAM, dTHoldDiam) ;
}
// calcolo il massimo affondamento
dMaxDepth = m_tdCurrTool.m_dLen - ( m_tdCurrTool.m_dDiam > dTHoldDiam ? 0 : dTHoldLen) - MAX_DEPTH_SAFE ;
dMaxDepth = m_tdCurrTool.m_dLen - ( m_tdCurrTool.m_dDiam > dTHoldDiam ? 0 : dTHoldLen) - dSafe ;
return true ;
}
// se mortasatrice o sega a catena
+8 -8
View File
@@ -51,7 +51,7 @@ class ToolsMgr
bool GetCurrToolParam( int nType, int& nVal) const ;
bool GetCurrToolParam( int nType, double& dVal) const ;
bool GetCurrToolParam( int nType, std::string& sVal) const ;
bool GetCurrToolMaxDepth( double& dMaxDepth) const ;
bool GetCurrToolMaxDepth( double dSafe, double& dMaxDepth) const ;
const ToolData* GetCurrTool( void) const
{ if ( m_bCurrTool)
return &m_tdCurrTool ;
@@ -73,13 +73,13 @@ class ToolsMgr
typedef STRUUID_MAP::const_iterator STRUUID_CITER ;
private :
std::string m_sToolsDir ;
std::string m_sToolsPath ;
UUIDTDATA_UMAP m_utData ;
STRUUID_MAP m_suData ;
std::string m_sToolsDir ;
std::string m_sToolsPath ;
UUIDTDATA_UMAP m_utData ;
STRUUID_MAP m_suData ;
mutable STRUUID_CITER m_suCIter ;
bool m_bCurrTool ;
ToolData m_tdCurrTool ;
mutable bool m_bModified ;
bool m_bCurrTool ;
ToolData m_tdCurrTool ;
mutable bool m_bModified ;
mutable UUIDVECTOR m_utModified ;
} ;