EgtMachKernel 1.8c7 :

- modifiche per gestione unificata dell'attrezzaggio
- caricamento degli utensili di tutte le uscite di una testa al caricamento di un utensile qualunque della stessa.
This commit is contained in:
Dario Sassi
2017-04-01 08:53:52 +00:00
parent c8c07b7d7e
commit d10c193039
13 changed files with 127 additions and 41 deletions
+8 -9
View File
@@ -83,8 +83,7 @@ Generator::Run( const string& sCncFile, const std::string& sInfo)
return false ;
// recupero eventuale attrezzaggio della macchinata
m_stuMgr.Init( m_pMchMgr) ;
m_stuMgr.Load() ;
m_pMchMgr->UpdateSetup() ;
// evento inizio esecuzione
bool bOk = true ;
@@ -94,7 +93,7 @@ Generator::Run( const string& sCncFile, const std::string& sInfo)
}
// apertura file di output ed evento inizio programma
if ( bOk && ! OnProgramStart( m_pMachine->GetMachineName(), sCncFile, sInfo, m_stuMgr.Exists())) {
if ( bOk && ! OnProgramStart( m_pMachine->GetMachineName(), sCncFile, sInfo, m_pMchMgr->GetCurrSetupMgr().Exists())) {
bOk = false ;
LOG_INFO( GetEMkLogger(), "OnProgramStart error") ;
}
@@ -276,7 +275,7 @@ Generator::ProcessMachining( int nOpId, int nOpInd)
if ( ! m_sTool.empty() && m_sTool != sTool) {
// recupero la testa del prossimo utensile (prima dall'attrezzaggio, poi dal DB utensili)
string sNextTcPos ; string sNextHead ; int nNextExit ;
if ( ! m_stuMgr.GetToolData( sTool, sNextTcPos, sNextHead, nNextExit)) {
if ( ! m_pMchMgr->GetCurrSetupMgr().GetToolData( sTool, sNextTcPos, sNextHead, nNextExit)) {
if ( m_pMchMgr->TdbSetCurrTool( sTool)) {
m_pMchMgr->TdbGetCurrToolParam( TPA_TCPOS, sNextTcPos) ;
m_pMchMgr->TdbGetCurrToolParam( TPA_HEAD, sNextHead) ;
@@ -295,7 +294,7 @@ Generator::ProcessMachining( int nOpId, int nOpInd)
// Se utensile cambiato, emetto selezione nuovo utensile
if ( m_sTool != m_sPrevTool) {
string sTcPos ; string sHead ; int nExit ;
if ( ! m_stuMgr.GetToolData( m_sTool, sTcPos, sHead, nExit)) {
if ( ! m_pMchMgr->GetCurrSetupMgr().GetToolData( m_sTool, sTcPos, sHead, nExit)) {
m_pMchMgr->TdbGetCurrToolParam( TPA_HEAD, sHead) ;
m_pMchMgr->TdbGetCurrToolParam( TPA_EXIT, nExit) ;
m_pMchMgr->TdbGetCurrToolParam( TPA_TCPOS, sTcPos) ;
@@ -445,7 +444,7 @@ Generator::UpdateTool( const string& sTool)
return false ;
// lo carico in macchina (se esiste attrezzaggio prendo i dati da questo)
string sTcPos ; string sHead ; int nExit ;
if ( ! m_stuMgr.GetToolData( sTool, sTcPos, sHead, nExit)) {
if ( ! m_pMchMgr->GetCurrSetupMgr().GetToolData( sTool, sTcPos, sHead, nExit)) {
m_pMchMgr->TdbGetCurrToolParam( TPA_HEAD, sHead) ;
m_pMchMgr->TdbGetCurrToolParam( TPA_EXIT, nExit) ;
}
@@ -600,10 +599,10 @@ Generator::ProcessToolData( void)
bool bOk = true ;
// se definito attrezzaggio
if ( m_stuMgr.Exists()) {
if ( m_pMchMgr->GetCurrSetupMgr().Exists()) {
// verifico che tutti gli utensili siano attrezzati
for ( size_t i = 0 ; i < vTdata.size() ; ++ i) {
if ( ! m_stuMgr.FindTool( vTdata[i].sName)) {
if ( ! m_pMchMgr->GetCurrSetupMgr().FindTool( vTdata[i].sName)) {
string sErr = "Error : " + vTdata[i].sName + " missing in setup " ;
LOG_INFO( GetEMkLogger(), sErr.c_str())
bOk = false ;
@@ -611,7 +610,7 @@ Generator::ProcessToolData( void)
}
// emetto l'elenco di tutti gli utensili attrezzati
string sTcPos ; string sHead ; int nExit ; string sTool ;
for ( int i = 1 ; m_stuMgr.GetPosData( i, sTcPos, sHead , nExit, sTool); ++ i) {
for ( int i = 1 ; m_pMchMgr->GetCurrSetupMgr().GetPosData( i, sTcPos, sHead , nExit, sTool); ++ i) {
// se nella posizione non c'è utensile, vado oltre
if ( sTool.empty())
continue ;