EgtMachKernel :

- aggiunta gestione flag modificato su parametri di lavorazione.
This commit is contained in:
Dario Sassi
2016-11-09 14:07:38 +00:00
parent 8aff181070
commit 1771b5a6ff
2 changed files with 28 additions and 8 deletions
+24 -4
View File
@@ -742,7 +742,7 @@ MachMgr::AddMachining( const string& sName, int nMchType, const string& sTool)
//----------------------------------------------------------------------------
bool
MachMgr::SetMachiningParam( int nType, bool bVal)
MachMgr::SetMachiningParam( int nType, bool bVal, bool* pbChanged)
{
// recupero la lavorazione corrente
int nCurrMchId = GetCurrMachining() ;
@@ -752,13 +752,18 @@ MachMgr::SetMachiningParam( int nType, bool bVal)
Machining* pMch = GetMachining( m_pGeomDB->GetUserObj( nCurrMchId)) ;
if ( pMch == nullptr)
return false ;
// se richiesto, ne recupero il valore corrente, per verificare se modificato
if ( pbChanged != nullptr) {
bool bOldVal ;
*pbChanged = ( pMch->GetParam( nType, bOldVal) && bOldVal != bVal) ;
}
// imposto il parametro
return pMch->SetParam( nType, bVal) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::SetMachiningParam( int nType, int nVal)
MachMgr::SetMachiningParam( int nType, int nVal, bool* pbChanged)
{
// recupero la lavorazione corrente
int nCurrMchId = GetCurrMachining() ;
@@ -768,13 +773,18 @@ MachMgr::SetMachiningParam( int nType, int nVal)
Machining* pMch = GetMachining( m_pGeomDB->GetUserObj( nCurrMchId)) ;
if ( pMch == nullptr)
return false ;
// ne recupero il valore corrente, per verificare se modificato
if ( pbChanged != nullptr) {
int nOldVal ;
*pbChanged = ( pMch->GetParam( nType, nOldVal) && nOldVal != nVal) ;
}
// imposto il parametro
return pMch->SetParam( nType, nVal) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::SetMachiningParam( int nType, double dVal)
MachMgr::SetMachiningParam( int nType, double dVal, bool* pbChanged)
{
// recupero la lavorazione corrente
int nCurrMchId = GetCurrMachining() ;
@@ -784,13 +794,18 @@ MachMgr::SetMachiningParam( int nType, double dVal)
Machining* pMch = GetMachining( m_pGeomDB->GetUserObj( nCurrMchId)) ;
if ( pMch == nullptr)
return false ;
// ne recupero il valore corrente, per verificare se modificato
if ( pbChanged != nullptr) {
double dOldVal ;
*pbChanged = ( pMch->GetParam( nType, dOldVal) && abs( dOldVal - dVal) > EPS_SMALL) ;
}
// imposto il parametro
return pMch->SetParam( nType, dVal) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::SetMachiningParam( int nType, const string& sVal)
MachMgr::SetMachiningParam( int nType, const string& sVal, bool* pbChanged)
{
// recupero la lavorazione corrente
int nCurrMchId = GetCurrMachining() ;
@@ -800,6 +815,11 @@ MachMgr::SetMachiningParam( int nType, const string& sVal)
Machining* pMch = GetMachining( m_pGeomDB->GetUserObj( nCurrMchId)) ;
if ( pMch == nullptr)
return false ;
// ne recupero il valore corrente, per verificare se modificato
if ( pbChanged != nullptr) {
string sOldVal ;
*pbChanged = ( pMch->GetParam( nType, sOldVal) && sOldVal != sVal) ;
}
// imposto il parametro
return pMch->SetParam( nType, sVal) ;
}