EgtMachKernel :

- aggiunta gestione livello di debug in LOG*.
This commit is contained in:
Dario Sassi
2019-04-01 06:16:03 +00:00
parent 9cd9068b7b
commit e4613162c5
24 changed files with 120 additions and 96 deletions
+2 -2
View File
@@ -501,7 +501,7 @@ Chiseling::Apply( bool bRecalc, bool bPostApply)
if ( ! bRecalc && ! bToolChanged &&
( m_nStatus == MCH_ST_OK || ( ! bPostApply && m_nStatus == MCH_ST_NO_POSTAPPL))) {
m_nChisels = nCurrChisels ;
LOG_INFO( GetEMkLogger(), "Chiseling apply skipped : status already ok") ;
LOG_DBG_INFO( GetEMkLogger(), "Chiseling apply skipped : status already ok") ;
return true ;
}
m_nStatus = MCH_ST_TO_VERIFY ;
@@ -579,7 +579,7 @@ Chiseling::Update( bool bPostApply)
// se lavorazione vuota, esco
if ( m_nChisels == 0) {
LOG_INFO( GetEMkLogger(), "Warning in Chiseling : Plunges not found")
LOG_WARN( GetEMkLogger(), "Warning in Chiseling : Plunges not found")
return true ;
}
+2 -2
View File
@@ -1275,7 +1275,7 @@ Disposition::SpecialApply( bool bRecalc)
m_nShifts = nCurrShifts ;
m_bSomeByHand = bCurrSomeByHand ;
m_sTcPos = sCurrTcPos ;
LOG_INFO( GetEMkLogger(), "Disposition postapply skipped : status already ok") ;
LOG_DBG_INFO( GetEMkLogger(), "Disposition postapply skipped : status already ok") ;
return true ;
}
m_nStatus = MCH_ST_TO_VERIFY ;
@@ -1344,7 +1344,7 @@ Disposition::SpecialUpdate( void)
// se disposizione vuota, esco
if ( m_nShifts <= 0) {
if ( m_nShifts < 0)
LOG_INFO( GetEMkLogger(), "Warning in Disposition : No shifts")
LOG_WARN( GetEMkLogger(), "Warning in Disposition : No shifts")
return true ;
}
// calcolo assi macchina
+11 -11
View File
@@ -532,7 +532,7 @@ Drilling::Apply( bool bRecalc, bool bPostApply)
if ( ! bRecalc && ! bToolChanged &&
( m_nStatus == MCH_ST_OK || ( ! bPostApply && m_nStatus == MCH_ST_NO_POSTAPPL))) {
m_nDrillings = nCurrDrillings ;
LOG_INFO( GetEMkLogger(), "Drilling apply skipped : status already ok") ;
LOG_DBG_INFO( GetEMkLogger(), "Drilling apply skipped : status already ok") ;
return true ;
}
m_nStatus = MCH_ST_TO_VERIFY ;
@@ -589,7 +589,7 @@ Drilling::Update( bool bPostApply)
// se lavorazione vuota, esco
if ( m_nDrillings == 0) {
LOG_INFO( GetEMkLogger(), "Warning in Drilling : No machinable hole")
LOG_WARN( GetEMkLogger(), "Warning in Drilling : No machinable hole")
return true ;
}
@@ -716,7 +716,7 @@ Drilling::Chain( int nGrpDestId)
// ne verifico la validità
if ( IsNull( vpCrvs.back())) {
string sOut = "Entity " + ToString( Id) + " skipped by Drilling" ;
LOG_INFO( GetEMkLogger(), sOut.c_str()) ;
LOG_WARN( GetEMkLogger(), sOut.c_str()) ;
vpCrvs.back().Reset() ;
}
}
@@ -942,14 +942,14 @@ Drilling::GenerateHolePv( int nInd, const SelData& nCircId, const string& sPName
if ( ! GetHoleData( nCircId, hole) || ! VerifyDiameter( hole.dDiam, m_TParams.m_dDiam, dDiamTol)) {
m_pGeomDB->Erase( nPathId) ;
string sOut = "Entity " + ToString( nCircId) + " skipped by Drilling" ;
LOG_INFO( GetEMkLogger(), sOut.c_str()) ;
LOG_WARN( GetEMkLogger(), sOut.c_str()) ;
return true ;
}
// limito lunghezza foro a massima lavorazione della punta
if ( hole.dLen > m_TParams.m_dMaxMat + EPS_SMALL) {
hole.dLen = m_TParams.m_dMaxMat ;
string sOut = "Drill bit too short for Hole " + ToString( nCircId) ;
LOG_INFO( GetEMkLogger(), sOut.c_str()) ;
LOG_WARN( GetEMkLogger(), sOut.c_str()) ;
}
// inserisco circonferenza che rappresenta il foro
PtrOwner<ICurveArc> pCrvArc( CreateCurveArc()) ;
@@ -986,7 +986,7 @@ Drilling::GenerateHoleCl( int nInd, const SelData& nCircId, const string& sPName
if ( ! GetHoleData( nCircId, hole) || ! VerifyDiameter( hole.dDiam, m_TParams.m_dDiam, dDiamTol)) {
m_pGeomDB->Erase( nPathId) ;
string sOut = "Entity " + ToString( nCircId) + " skipped by Drilling" ;
LOG_INFO( GetEMkLogger(), sOut.c_str()) ;
LOG_WARN( GetEMkLogger(), sOut.c_str()) ;
return true ;
}
// se richiesta inversione e foro passante, provvedo
@@ -1003,7 +1003,7 @@ Drilling::GenerateHoleCl( int nInd, const SelData& nCircId, const string& sPName
hole.dLen = m_TParams.m_dMaxMat ;
hole.bBlind = true ;
string sOut = "Drill bit too short for Hole " + ToString( nCircId) ;
LOG_INFO( GetEMkLogger(), sOut.c_str()) ;
LOG_WARN( GetEMkLogger(), sOut.c_str()) ;
}
// verifiche per foro verso il basso
m_bAggrBottom = false ;
@@ -1026,7 +1026,7 @@ Drilling::GenerateHoleCl( int nInd, const SelData& nCircId, const string& sPName
else {
m_pGeomDB->Erase( nPathId) ;
string sOut = "Hole " + ToString( nCircId) + " skipped by Standard Drilling" ;
LOG_INFO( GetEMkLogger(), sOut.c_str()) ;
LOG_WARN( GetEMkLogger(), sOut.c_str()) ;
}
}
else {
@@ -1037,7 +1037,7 @@ Drilling::GenerateHoleCl( int nInd, const SelData& nCircId, const string& sPName
else {
m_pGeomDB->Erase( nPathId) ;
string sOut = "Hole " + ToString( nCircId) + " skipped by Peck Drilling" ;
LOG_INFO( GetEMkLogger(), sOut.c_str()) ;
LOG_WARN( GetEMkLogger(), sOut.c_str()) ;
}
}
@@ -1273,13 +1273,13 @@ Drilling::UpdateToolData( bool* pbChanged)
if ( ! EqualNoCase( m_Params.m_sToolName, m_TParams.m_sName)) {
string sLog = "Warning in Drilling : tool name changed (" +
m_Params.m_sToolName + "->" + m_TParams.m_sName + ")" ;
LOG_INFO( GetEMkLogger(), sLog.c_str()) ;
LOG_WARN( GetEMkLogger(), sLog.c_str()) ;
m_Params.m_sToolName = m_TParams.m_sName ;
}
if ( bChanged) {
string sLog = "Warning in Drilling : tool data changed (" +
m_Params.m_sToolName + ")" ;
LOG_INFO( GetEMkLogger(), sLog.c_str()) ;
LOG_WARN( GetEMkLogger(), sLog.c_str()) ;
}
// se definito parametro di ritorno, lo assegno
if ( pbChanged != nullptr)
+5 -5
View File
@@ -403,7 +403,7 @@ GenMachining::SetGeometry( const SELVECTOR& vIds)
int nSubs ;
if ( ! VerifyGeometry( Id, nSubs, nType)) {
string sOut = "Entity " + ToString( Id) + " skipped by GenMachining" ;
LOG_INFO( GetEMkLogger(), sOut.c_str()) ;
LOG_WARN( GetEMkLogger(), sOut.c_str()) ;
continue ;
}
// posso aggiungere alla lista
@@ -524,7 +524,7 @@ GenMachining::Apply( bool bRecalc, bool bPostApply)
if ( ! bRecalc && ! bToolChanged &&
( m_nStatus == MCH_ST_OK || ( ! bPostApply && m_nStatus == MCH_ST_NO_POSTAPPL))) {
m_nMills = nCurrMills ;
LOG_INFO( GetEMkLogger(), "GenMachining apply skipped : status already ok") ;
LOG_DBG_INFO( GetEMkLogger(), "GenMachining apply skipped : status already ok") ;
return true ;
}
m_nStatus = MCH_ST_TO_VERIFY ;
@@ -620,7 +620,7 @@ GenMachining::Update( bool bPostApply)
// se lavorazione vuota, esco
if ( m_nMills == 0) {
LOG_INFO( GetEMkLogger(), "Warning in GenMachining : No machinable path")
LOG_WARN( GetEMkLogger(), "Warning in GenMachining : No machinable path")
return true ;
}
@@ -802,13 +802,13 @@ GenMachining::UpdateToolData( bool* pbChanged)
if ( ! EqualNoCase( m_Params.m_sToolName, m_TParams.m_sName)) {
string sLog = "Warning in GenMachining : tool name changed (" +
m_Params.m_sToolName + "->" + m_TParams.m_sName + ")" ;
LOG_INFO( GetEMkLogger(), sLog.c_str()) ;
LOG_WARN( GetEMkLogger(), sLog.c_str()) ;
m_Params.m_sToolName = m_TParams.m_sName ;
}
if ( bChanged) {
string sLog = "Warning in GenMachining : tool data changed (" +
m_Params.m_sToolName + ")" ;
LOG_INFO( GetEMkLogger(), sLog.c_str()) ;
LOG_WARN( GetEMkLogger(), sLog.c_str()) ;
}
// se definito parametro di ritorno, lo assegno
if ( pbChanged != nullptr)
+1 -1
View File
@@ -297,6 +297,6 @@ MachMgr::SetLastError( int nErr, const string& sErr)
m_nLastError = nErr ;
m_sLastError = sErr ;
string sInfo = m_sLastError + " (" + ToString( nErr) + ")" ;
LOG_INFO( GetEMkLogger(), sInfo.c_str()) ;
LOG_ERROR( GetEMkLogger(), sInfo.c_str()) ;
return true ;
}
+6 -6
View File
@@ -682,7 +682,7 @@ MachMgr::AddMachining( const string& sName, const string& sMachining)
const MachiningData* pMd = pMMgr->GetMachining( sMachining) ;
if ( pMd == nullptr) {
string sOut = "AddMachining error : " + sMachining + " not found" ;
LOG_INFO( GetEMkLogger(), sOut.c_str())
LOG_ERROR( GetEMkLogger(), sOut.c_str())
return GDB_ID_NULL ;
}
int nMchType = pMd->GetType() ;
@@ -704,7 +704,7 @@ MachMgr::AddMachining( const string& sName, const string& sMachining)
// assegno il nome
if ( ! m_pGeomDB->SetName( nId, sNewName)) {
string sOut = "AddMachining error : " + sNewName + " invalid name " ;
LOG_INFO( GetEMkLogger(), sOut.c_str())
LOG_ERROR( GetEMkLogger(), sOut.c_str())
m_pGeomDB->Erase( nId) ;
return GDB_ID_NULL ;
}
@@ -714,7 +714,7 @@ MachMgr::AddMachining( const string& sName, const string& sMachining)
if ( pMch == nullptr || ! pMch->Init( this) ||
! pMch->SetPhase( m_nCurrPhase) || ! pMch->Prepare( sMachining)) {
string sOut = "AddMachining error : " + sMachining + " on " + sName ;
LOG_INFO( GetEMkLogger(), sOut.c_str())
LOG_ERROR( GetEMkLogger(), sOut.c_str())
m_pGeomDB->Erase( nId) ;
return GDB_ID_NULL ;
}
@@ -751,7 +751,7 @@ MachMgr::AddMachining( const string& sName, int nMchType, const string& sTool)
// assegno il nome
if ( ! m_pGeomDB->SetName( nId, sNewName)) {
string sOut = "AddMachining error : " + sNewName + " invalid name " ;
LOG_INFO( GetEMkLogger(), sOut.c_str())
LOG_ERROR( GetEMkLogger(), sOut.c_str())
m_pGeomDB->Erase( nId) ;
return GDB_ID_NULL ;
}
@@ -761,7 +761,7 @@ MachMgr::AddMachining( const string& sName, int nMchType, const string& sTool)
if ( pMch == nullptr || ! pMch->Init( this) ||
! pMch->SetPhase( m_nCurrPhase) || ! pMch->SetParam( MPA_TOOL, sTool)) {
string sOut = "AddMachining error : " + GetMachiningTitle( nMchType) + "/" + sTool + " on " + sName ;
LOG_INFO( GetEMkLogger(), sOut.c_str())
LOG_ERROR( GetEMkLogger(), sOut.c_str())
m_pGeomDB->Erase( nId) ;
return GDB_ID_NULL ;
}
@@ -801,7 +801,7 @@ MachMgr::CopyMachining( const string& sName, const string& sSouName)
// assegno il nome
if ( ! m_pGeomDB->SetName( nId, sNewName)) {
string sOut = "CopyMachining error : " + sNewName + " invalid name " ;
LOG_INFO( GetEMkLogger(), sOut.c_str())
LOG_ERROR( GetEMkLogger(), sOut.c_str())
m_pGeomDB->Erase( nId) ;
return GDB_ID_NULL ;
}
+4 -4
View File
@@ -707,7 +707,7 @@ MachMgr::RotateRawPart( int nRawId, const Vector3d& vtAx, double dAngRotDeg)
return false ;
// eseguo l'operazione
if ( ! pDisp->RotateRawPart( nRawId, vtAx, dAngRotDeg)) {
LOG_INFO( GetEMkLogger(), "Error on RotateRawPart") ;
LOG_ERROR( GetEMkLogger(), "Error on RotateRawPart") ;
return false ;
}
return true ;
@@ -723,7 +723,7 @@ MachMgr::MoveToCornerRawPart( int nRawId, const Point3d& ptP, int nFlag)
return false ;
// eseguo l'operazione
if ( ! pDisp->MoveToCornerRawPart( nRawId, ptP, nFlag)) {
LOG_INFO( GetEMkLogger(), "Error on MoveToCornerRawPart") ;
LOG_ERROR( GetEMkLogger(), "Error on MoveToCornerRawPart") ;
return false ;
}
return true ;
@@ -739,7 +739,7 @@ MachMgr::MoveToCenterRawPart( int nRawId, const Point3d& ptP, int nFlag)
return false ;
// eseguo l'operazione
if ( ! pDisp->MoveToCenterRawPart( nRawId, ptP, nFlag)) {
LOG_INFO( GetEMkLogger(), "Error on MoveToCenterRawPart") ;
LOG_ERROR( GetEMkLogger(), "Error on MoveToCenterRawPart") ;
return false ;
}
return true ;
@@ -755,7 +755,7 @@ MachMgr::MoveRawPart( int nRawId, const Vector3d& vtMove)
return false ;
// eseguo l'operazione
if ( ! pDisp->MoveRawPart( nRawId, vtMove)) {
LOG_INFO( GetEMkLogger(), "Error on MoveRawPart") ;
LOG_ERROR( GetEMkLogger(), "Error on MoveRawPart") ;
return false ;
}
return true ;
+3 -3
View File
@@ -267,7 +267,7 @@ Machine::AdjustTable( int nLay, const Point3d& ptRef1)
Vector3d vtMove = ptRef1 - ptPos ;
if ( ! vtMove.IsSmall()) {
string sOut = " Move = (" + ToString( vtMove) + ")" ;
LOG_ERROR( GetEMkLogger(), sOut.c_str()) ;
LOG_DBG_INFO( GetEMkLogger(), sOut.c_str()) ;
return m_pGeomDB->TranslateGlob( nLay, vtMove) ;
}
else
@@ -391,7 +391,7 @@ Machine::AdjustAxis( int nLay, const string& sPart, const string& sName,
}
else {
string sOut = " Move = (" + ToString( vtDelta) + ")" ;
LOG_ERROR( GetEMkLogger(), sOut.c_str()) ;
LOG_DBG_INFO( GetEMkLogger(), sOut.c_str()) ;
m_pGeomDB->TranslateGlob( nId, vtDelta) ;
}
}
@@ -783,7 +783,7 @@ Machine::CreateExitGroups( int nLay, const MUEXITVECTOR& vMuExit)
}
else {
string sOut = " Exit " + sName + " move = (" + ToString( vtDelta) +")" ;
LOG_ERROR( GetEMkLogger(), sOut.c_str()) ;
LOG_DBG_INFO( GetEMkLogger(), sOut.c_str()) ;
vtDelta.ToLoc( frHead) ;
frFrame.Translate( vtDelta) ;
GetGeoFrame3d( m_pGeomDB->GetGeoObj( nT))->Set( frFrame) ;
+7 -7
View File
@@ -189,7 +189,7 @@ Machine::SetCurrTool( const string& sTool, const string& sHead, int nExit)
Head* pHead = GetHead( nHeadId) ;
if ( pHead == nullptr) {
string sOut = "Missing head " + sHead + " for tool " + sTool ;
LOG_INFO( GetEMkLogger(), sOut.c_str())
LOG_ERROR( GetEMkLogger(), sOut.c_str())
return false ;
}
// recupero il gruppo dell'uscita
@@ -199,7 +199,7 @@ Machine::SetCurrTool( const string& sTool, const string& sHead, int nExit)
Exit* pExit = GetExit( nExitId) ;
if ( pExit == nullptr) {
string sOut = "Missing exit " + ToString( nExit) + " on head " + sHead ;
LOG_INFO( GetEMkLogger(), sOut.c_str())
LOG_ERROR( GetEMkLogger(), sOut.c_str())
return false ;
}
// recupero i dati dell'utensile
@@ -215,7 +215,7 @@ Machine::SetCurrTool( const string& sTool, const string& sHead, int nExit)
// carico l'utensile (si sostituisce ad altro già presente sulla stessa uscita)
if ( ! LoadTool( sHead, nExit, sTool)) {
string sOut = "Missing tool " + sTool ;
LOG_INFO( GetEMkLogger(), sOut.c_str())
LOG_ERROR( GetEMkLogger(), sOut.c_str())
return false ;
}
nToolId = m_pGeomDB->GetFirstNameInGroup( nExitId, sTool) ;
@@ -413,7 +413,7 @@ Machine::CalculateKinematicChain( void)
else if ( m_vCalcLinAx[2].vtDir.IsXplus())
swap( m_vCalcLinAx[0], m_vCalcLinAx[2]) ;
else {
LOG_INFO( GetEMkLogger(), "Linear Axes not aligned with Global XYZ")
LOG_ERROR( GetEMkLogger(), "Linear Axes not aligned with Global XYZ")
return false ;
}
}
@@ -421,7 +421,7 @@ Machine::CalculateKinematicChain( void)
if ( m_vCalcLinAx[2].vtDir.IsYplus())
swap( m_vCalcLinAx[1], m_vCalcLinAx[2]) ;
else {
LOG_INFO( GetEMkLogger(), "Linear Axes not aligned with Global XYZ")
LOG_ERROR( GetEMkLogger(), "Linear Axes not aligned with Global XYZ")
return false ;
}
}
@@ -469,7 +469,7 @@ Machine::CalculateKinematicChain( void)
}
// altrimenti non ancora gestito, quindi errore
LOG_INFO( GetEMkLogger(), "Rotary Axes not manageable")
LOG_ERROR( GetEMkLogger(), "Rotary Axes not manageable")
return false ;
}
@@ -611,7 +611,7 @@ Machine::SetSolCh( int nScc, bool bExact)
// recupero i dati della testa
Head* pHead = GetHead( m_nCalcHeadId) ;
if ( pHead == nullptr) {
LOG_INFO( GetEMkLogger(), "Missing head in SetSolCh")
LOG_ERROR( GetEMkLogger(), "Missing head in SetSolCh")
return false ;
}
// assegno il criterio definito nella testa (standard)
+1 -1
View File
@@ -150,7 +150,7 @@ Machine::LoadTool( Exit* pExit, const string& sTool)
// rinomino il gruppo SOLID con il nome dell'utensile
if ( ! m_pGeomDB->SetName( nSolidId, sTool)) {
string sOut = "LoadTool error : " + sTool + " invalid name" ;
LOG_INFO( GetEMkLogger(), sOut.c_str())
LOG_ERROR( GetEMkLogger(), sOut.c_str())
return false ;
}
// lo ruoto 90 deg attorno alla X locale
+10 -10
View File
@@ -235,7 +235,7 @@ Machine::LuaLoadMachine( const string& sFile)
// verifico sia stato caricato effettivamente qualcosa
if ( bOk) {
if ( m_pGeomDB == nullptr || m_pGeomDB->GetGroupObjs( m_nGroupId) == 0) {
LOG_INFO( GetEMkLogger(), "Error : mlde file is empty")
LOG_ERROR( GetEMkLogger(), "Error : mlde file is empty")
bOk = false ;
}
}
@@ -285,7 +285,7 @@ Machine::LuaEmtGeneral( lua_State* L)
sOut += ", " + sSpecial ;
if ( ! sProcessor.empty())
sOut += ", " + sProcessor ;
LOG_INFO( GetEMkLogger(), sOut.c_str())
LOG_DBG_INFO( GetEMkLogger(), sOut.c_str())
// verifico ci sia una macchina attiva
if ( m_pMchLua == nullptr)
@@ -303,7 +303,7 @@ Machine::LuaEmtGeneral( lua_State* L)
return luaL_error( L, " Load Special failed") ;
}
else {
LOG_INFO( GetEMkLogger(), " Special file not specified")
LOG_DBG_INFO( GetEMkLogger(), " Special file not specified")
}
// carico il processore della macchina
@@ -314,7 +314,7 @@ Machine::LuaEmtGeneral( lua_State* L)
return luaL_error( L, " Load Processor failed") ;
}
else {
LOG_INFO( GetEMkLogger(), " Processor file not specified")
LOG_DBG_INFO( GetEMkLogger(), " Processor file not specified")
}
// imposto massimo spostamento assi e uscite tra definizione cinematica e geometria
@@ -347,7 +347,7 @@ Machine::LuaEmtBase( lua_State* L)
// info
string sOut = "LuaEmtBase : " + sName ;
LOG_INFO( GetEMkLogger(), sOut.c_str())
LOG_DBG_INFO( GetEMkLogger(), sOut.c_str())
// verifico ci sia una macchina attiva
if ( m_pMchLua == nullptr)
@@ -398,7 +398,7 @@ Machine::LuaEmtTable( lua_State* L)
// info
string sOut = "LuaEmtTable : " + sName ;
LOG_INFO( GetEMkLogger(), sOut.c_str())
LOG_DBG_INFO( GetEMkLogger(), sOut.c_str())
// verifico ci sia una macchina attiva
if ( m_pMchLua == nullptr)
@@ -464,7 +464,7 @@ Machine::LuaEmtAxis( lua_State* L)
// info
string sOut = "LuaEmtAxis : " + sName ;
LOG_INFO( GetEMkLogger(), sOut.c_str())
LOG_DBG_INFO( GetEMkLogger(), sOut.c_str())
// verifico ci sia una macchina attiva
if ( m_pMchLua == nullptr)
@@ -555,7 +555,7 @@ Machine::LuaEmtStdHead( lua_State* L)
// info
string sOut = "LuaEmtStdHead : " + sName ;
LOG_INFO( GetEMkLogger(), sOut.c_str())
LOG_DBG_INFO( GetEMkLogger(), sOut.c_str())
// verifico ci sia una macchina attiva
if ( m_pMchLua == nullptr)
@@ -633,7 +633,7 @@ Machine::LuaEmtMultiHead( lua_State* L)
// info
string sOut = "LuaEmtMultiHead : " + sName ;
LOG_INFO( GetEMkLogger(), sOut.c_str())
LOG_DBG_INFO( GetEMkLogger(), sOut.c_str())
// verifico ci sia una macchina attiva
if ( m_pMchLua == nullptr)
@@ -700,7 +700,7 @@ Machine::LuaEmtSpecialHead( lua_State* L)
// info
string sOut = "LuaEmtSpecialHead : " + sName ;
LOG_INFO( GetEMkLogger(), sOut.c_str())
LOG_DBG_INFO( GetEMkLogger(), sOut.c_str())
// verifico ci sia una macchina attiva
if ( m_pMchLua == nullptr)
+1 -1
View File
@@ -165,7 +165,7 @@ MachiningsMgr::Reload( void)
}
{
string sOut = "ReloadMachinings : FileVer = " + ToString( nVersion) + " CurrVer = " + ToString( MF_CURR_VER) ;
LOG_INFO( GetEMkLogger(), sOut.c_str())
LOG_DBG_INFO( GetEMkLogger(), sOut.c_str())
}
// Leggo i dati generali (da versione 1002)
+3 -3
View File
@@ -625,7 +625,7 @@ Milling::Apply( bool bRecalc, bool bPostApply)
if ( ! bRecalc && ! bToolChanged &&
( m_nStatus == MCH_ST_OK || ( ! bPostApply && m_nStatus == MCH_ST_NO_POSTAPPL))) {
m_nMills = nCurrMills ;
LOG_INFO( GetEMkLogger(), "Milling apply skipped : status already ok") ;
LOG_DBG_INFO( GetEMkLogger(), "Milling apply skipped : status already ok") ;
return true ;
}
m_nStatus = MCH_ST_TO_VERIFY ;
@@ -715,7 +715,7 @@ Milling::Update( bool bPostApply)
// se lavorazione vuota, esco
if ( m_nMills == 0) {
LOG_INFO( GetEMkLogger(), "Warning in Milling : No machinable path")
LOG_WARN( GetEMkLogger(), "Warning in Milling : No machinable path")
return true ;
}
@@ -1441,7 +1441,7 @@ Milling::ProcessPath( int nPathId, int nPvId, int nClId)
// verifico che il percorso sia abbastanza lungo
double dLen ; pCompo->GetLength( dLen) ;
if ( dLen + m_Params.m_dStartAddLen + m_Params.m_dEndAddLen < 10 * EPS_SMALL) {
LOG_INFO( GetEMkLogger(), "Warning in Milling : skipped Path too small") ;
LOG_WARN( GetEMkLogger(), "Warning in Milling : skipped Path too small") ;
return true ;
}
// se una sola entità circonferenza completa, la divido in due per poterla allungare
+3 -3
View File
@@ -518,7 +518,7 @@ Mortising::Apply( bool bRecalc, bool bPostApply)
if ( ! bRecalc && ! bToolChanged &&
( m_nStatus == MCH_ST_OK || ( ! bPostApply && m_nStatus == MCH_ST_NO_POSTAPPL))) {
m_nMortises = nCurrMortises ;
LOG_INFO( GetEMkLogger(), "Mortising apply skipped : status already ok") ;
LOG_DBG_INFO( GetEMkLogger(), "Mortising apply skipped : status already ok") ;
return true ;
}
m_nStatus = MCH_ST_TO_VERIFY ;
@@ -596,7 +596,7 @@ Mortising::Update( bool bPostApply)
// se lavorazione vuota, esco
if ( m_nMortises == 0) {
LOG_INFO( GetEMkLogger(), "Warning in Mortising : Plunges not found")
LOG_WARN( GetEMkLogger(), "Warning in Mortising : Plunges not found")
return true ;
}
@@ -1128,7 +1128,7 @@ Mortising::ProcessPath( int nPathId, int nPvId, int nClId)
// verifico che il percorso sia abbastanza lungo
double dLen ; pCompo->GetLength( dLen) ;
if ( dLen + m_Params.m_dStartAddLen + m_Params.m_dEndAddLen < 10 * EPS_SMALL) {
LOG_INFO( GetEMkLogger(), "Warning in Mortising : skipped Path too small") ;
LOG_WARN( GetEMkLogger(), "Warning in Mortising : skipped Path too small") ;
return true ;
}
// se una sola entità circonferenza completa, la divido in due per poterla allungare
+4 -4
View File
@@ -1064,7 +1064,7 @@ Operation::CalculateClPathAxesValues( int nClPathId, int nLinAxes, int nRotAxes,
// verifico che il primo movimento non sia un arco
if ( bFirst && pCamData->IsArc()) {
pCamData->ResetAxes() ;
LOG_INFO( GetEMkLogger(), "Error : first move in ClPath is an arc")
LOG_ERROR( GetEMkLogger(), "Error : first move in ClPath is an arc")
return false ;
}
// calcolo degli assi rotanti della macchina
@@ -1073,7 +1073,7 @@ Operation::CalculateClPathAxesValues( int nClPathId, int nLinAxes, int nRotAxes,
bool bROk = m_pMchMgr->GetCalcAngles( pCamData->GetToolDir(), pCamData->GetAuxDir(), nRStat, vAng1, vAng2) ;
if ( ! bROk || nRStat == 0) {
pCamData->SetAxes( CamData::AS_DIR_ERR, vAxVal) ;
LOG_INFO( GetEMkLogger(), "Error : tool direction unreachable")
LOG_ERROR( GetEMkLogger(), "Error : tool direction unreachable")
return false ;
}
if ( abs( nRStat) == 1) {
@@ -1298,7 +1298,7 @@ Operation::CalculateClPathAxesValues( int nClPathId, int nLinAxes, int nRotAxes,
// calcolo arco per i tre punti espressi in assi macchina
PtrOwner<ICurve> pCurve( GetArc3P( ptP1M, ptP2M, ptP3M, false)) ;
if ( IsNull( pCurve)) {
LOG_INFO( GetEMkLogger(), "Error : arc on machine not calculable")
LOG_ERROR( GetEMkLogger(), "Error : arc on machine not calculable")
return false ;
}
// se realmente arco
@@ -2179,7 +2179,7 @@ Operation::SpecialMoveZup( Vector3d& vtTool, DBLVECTOR& vAx, bool& bModif)
if ( nErr != 0) {
bOk = false ;
string sOut = " Error in " + ON_SPECIAL_MOVEZUP + " (" + ToString( nErr) + ")" ;
LOG_INFO( GetEMkLogger(), sOut.c_str())
LOG_ERROR( GetEMkLogger(), sOut.c_str())
}
return bOk ;
}
+4 -4
View File
@@ -188,13 +188,13 @@ Operation::AddLinearMove( const Point3d& ptP)
return GDB_ID_NULL ;
// verifico di essere in uno stato valido per un movimento lineare
if ( ! m_bCurr || m_vtTool.IsSmall()) {
LOG_INFO( GetEMkLogger(), "Error on LinearMove : Curr or ToolDir")
LOG_ERROR( GetEMkLogger(), "Error on LinearMove : Curr or ToolDir")
return GDB_ID_NULL ;
}
// se feed nulla, assegno il minimo e lo segnalo
if ( m_dFeed < FEED_MIN) {
m_dFeed = FEED_MIN ;
LOG_INFO( GetEMkLogger(), "Warning on LinearMove : Min Feed")
LOG_WARN( GetEMkLogger(), "Warning on LinearMove : Min Feed")
}
// creo oggetto linea per DB geometrico
PtrOwner<ICurveLine> pLine( CreateCurveLine()) ;
@@ -244,13 +244,13 @@ Operation::AddArcMove( const Point3d& ptP, const Point3d& ptCen, double dAngCen,
return GDB_ID_NULL ;
// verifico di essere in uno stato valido per un movimento arco
if ( ! m_bCurr || m_vtTool.IsSmall()) {
LOG_INFO( GetEMkLogger(), "Error on ArcMove : Curr or ToolDir")
LOG_ERROR( GetEMkLogger(), "Error on ArcMove : Curr or ToolDir")
return GDB_ID_NULL ;
}
// se feed nulla, assegno il minimo e lo segnalo
if ( m_dFeed < FEED_MIN) {
m_dFeed = FEED_MIN ;
LOG_INFO( GetEMkLogger(), "Warning on ArcMove : Min Feed")
LOG_WARN( GetEMkLogger(), "Warning on ArcMove : Min Feed")
}
// creo oggetto arco per DB geometrico
PtrOwner<ICurveArc> pArc( CreateCurveArc()) ;
+3 -3
View File
@@ -463,7 +463,7 @@ Pocketing::SetGeometry( const SELVECTOR& vIds)
int nSubs ;
if ( ! VerifyGeometry( Id, nSubs, nType)) {
string sOut = "Entity " + ToString( Id) + " skipped by Milling" ;
LOG_INFO( GetEMkLogger(), sOut.c_str()) ;
LOG_WARN( GetEMkLogger(), sOut.c_str()) ;
continue ;
}
// posso aggiungere alla lista
@@ -578,7 +578,7 @@ Pocketing::Apply( bool bRecalc, bool bPostApply)
if ( ! bRecalc && ! bToolChanged &&
( m_nStatus == MCH_ST_OK || ( ! bPostApply && m_nStatus == MCH_ST_NO_POSTAPPL))) {
m_nPockets = nCurrPockets ;
LOG_INFO( GetEMkLogger(), "Pocketing apply skipped : status already ok") ;
LOG_DBG_INFO( GetEMkLogger(), "Pocketing apply skipped : status already ok") ;
return true ;
}
m_nStatus = MCH_ST_TO_VERIFY ;
@@ -668,7 +668,7 @@ Pocketing::Update( bool bPostApply)
// se lavorazione vuota, esco
if ( m_nPockets == 0) {
LOG_INFO( GetEMkLogger(), "Warning in Pocketing : No machinable pocket")
LOG_WARN( GetEMkLogger(), "Warning in Pocketing : No machinable pocket")
return true ;
}
+7 -7
View File
@@ -87,19 +87,19 @@ Processor::Run( const string& sOutFile, const std::string& sInfo)
bool bOk = true ;
if ( ! OnStart()) {
bOk = false ;
LOG_INFO( GetEMkLogger(), "OnStart error") ;
LOG_ERROR( GetEMkLogger(), "OnStart error") ;
}
// apertura file di output ed evento inizio programma
if ( bOk && ! OnProgramStart( m_pMachine->GetMachineName(), sOutFile, sInfo, m_pMchMgr->GetCurrSetupMgr().Exists())) {
bOk = false ;
LOG_INFO( GetEMkLogger(), "OnProgramStart error") ;
LOG_ERROR( GetEMkLogger(), "OnProgramStart error") ;
}
// emissione dati utensili
if ( bOk && ! ProcessToolData()) {
bOk = false ;
LOG_INFO( GetEMkLogger(), "ProcessToolData error") ;
LOG_ERROR( GetEMkLogger(), "ProcessToolData error") ;
}
// ciclo su tutte le operazioni della macchinata
@@ -132,7 +132,7 @@ Processor::Run( const string& sOutFile, const std::string& sInfo)
// evento fine programma
if ( bOk && ! OnProgramEnd()) {
bOk = false ;
LOG_INFO( GetEMkLogger(), "OnProgramEnd error") ;
LOG_ERROR( GetEMkLogger(), "OnProgramEnd error") ;
}
// chiudo il file di output
if ( ! m_pMachine->WriterClose())
@@ -141,7 +141,7 @@ Processor::Run( const string& sOutFile, const std::string& sInfo)
// evento fine esecuzione
if ( ! OnEnd()) {
bOk = false ;
LOG_INFO( GetEMkLogger(), "OnEnd error") ;
LOG_ERROR( GetEMkLogger(), "OnEnd error") ;
}
return bOk ;
@@ -645,7 +645,7 @@ Processor::ProcessToolData( void)
for ( size_t i = 0 ; i < vTdata.size() ; ++ i) {
if ( ! m_pMchMgr->GetCurrSetupMgr().FindTool( vTdata[i].sName)) {
string sErr = "Error : " + vTdata[i].sName + " missing in setup " ;
LOG_INFO( GetEMkLogger(), sErr.c_str())
LOG_ERROR( GetEMkLogger(), sErr.c_str())
bOk = false ;
}
}
@@ -716,7 +716,7 @@ Processor::ProcessToolData( void)
else {
if ( vTdata[i].sName != sPrevTool) {
string sErr = "Error : two tools in same position : " + sPrevTool + "<->" + vTdata[i].sName ;
LOG_INFO( GetEMkLogger(), sErr.c_str())
LOG_ERROR( GetEMkLogger(), sErr.c_str())
bOk = false ;
}
}
+2 -2
View File
@@ -486,7 +486,7 @@ SawFinishing::Apply( bool bRecalc, bool bPostApply)
if ( ! bRecalc && ! bToolChanged &&
( m_nStatus == MCH_ST_OK || ( ! bPostApply && m_nStatus == MCH_ST_NO_POSTAPPL))) {
m_nCuts = nCurrCuts ;
LOG_INFO( GetEMkLogger(), "SawFinishing apply skipped : status already ok") ;
LOG_DBG_INFO( GetEMkLogger(), "SawFinishing apply skipped : status already ok") ;
return true ;
}
m_nStatus = MCH_ST_TO_VERIFY ;
@@ -563,7 +563,7 @@ SawFinishing::Update( bool bPostApply)
// se lavorazione vuota, esco
if ( m_nCuts == 0) {
LOG_INFO( GetEMkLogger(), "Warning in SawFinishing : No machinable path")
LOG_WARN( GetEMkLogger(), "Warning in SawFinishing : No machinable path")
return true ;
}
+3 -3
View File
@@ -426,7 +426,7 @@ SawRoughing::SetGeometry( const SELVECTOR& vIds)
int nSubs ;
if ( ! VerifyGeometry( Id, nSubs)) {
string sOut = "Entity " + ToString( Id) + " skipped by SawRoughing" ;
LOG_INFO( GetEMkLogger(), sOut.c_str()) ;
LOG_WARN( GetEMkLogger(), sOut.c_str()) ;
continue ;
}
// posso aggiungere alla lista
@@ -469,7 +469,7 @@ SawRoughing::Apply( bool bRecalc, bool bPostApply)
if ( ! bRecalc && ! bToolChanged &&
( m_nStatus == MCH_ST_OK || ( ! bPostApply && m_nStatus == MCH_ST_NO_POSTAPPL))) {
m_nCuts = nCurrCuts ;
LOG_INFO( GetEMkLogger(), "SawRoughing apply skipped : status already ok") ;
LOG_DBG_INFO( GetEMkLogger(), "SawRoughing apply skipped : status already ok") ;
return true ;
}
m_nStatus = MCH_ST_TO_VERIFY ;
@@ -537,7 +537,7 @@ SawRoughing::Update( bool bPostApply)
// se lavorazione vuota, esco
if ( m_nCuts == 0) {
LOG_INFO( GetEMkLogger(), "Warning in SawRoughing : No machinable path")
LOG_WARN( GetEMkLogger(), "Warning in SawRoughing : No machinable path")
return true ;
}
+9 -9
View File
@@ -615,7 +615,7 @@ Sawing::Apply( bool bRecalc, bool bPostApply)
if ( ! bRecalc && ! bToolChanged &&
( m_nStatus == MCH_ST_OK || ( ! bPostApply && m_nStatus == MCH_ST_NO_POSTAPPL))) {
m_nCuts = nCurrCuts ;
LOG_INFO( GetEMkLogger(), "Sawing apply skipped : status already ok") ;
LOG_DBG_INFO( GetEMkLogger(), "Sawing apply skipped : status already ok") ;
return true ;
}
m_nStatus = MCH_ST_TO_VERIFY ;
@@ -697,7 +697,7 @@ Sawing::Update( bool bPostApply)
// se lavorazione vuota, esco
if ( m_nCuts == 0) {
LOG_INFO( GetEMkLogger(), "Warning in Sawing : No machinable path")
LOG_WARN( GetEMkLogger(), "Warning in Sawing : No machinable path")
return true ;
}
@@ -1306,7 +1306,7 @@ Sawing::ProcessPath( int nPathId, int nPvId, int nClId)
// verifico che il percorso sia abbastanza lungo
double dLen ; pCompo->GetLength( dLen) ;
if ( dLen + m_Params.m_dStartAddLen + m_Params.m_dEndAddLen < 10 * EPS_SMALL) {
LOG_INFO( GetEMkLogger(), "Warning in Sawing : skipped Path too small") ;
LOG_WARN( GetEMkLogger(), "Warning in Sawing : skipped Path too small") ;
return true ;
}
@@ -1553,7 +1553,7 @@ Sawing::ProcessEntity( const ICurve* pCrvP, const ICurve* pCrvC, const ICurve* p
}
}
else {
LOG_INFO( GetEMkLogger(), "Warning in Sawing : Skipped Arc") ;
LOG_WARN( GetEMkLogger(), "Warning in Sawing : Skipped Arc") ;
return true ;
}
}
@@ -1632,7 +1632,7 @@ Sawing::ProcessLine( const ICurve* pCrvP, const ICurveLine* pLineC, const ICurve
return false ;
}
if ( bToSkip) {
LOG_INFO( GetEMkLogger(), "Warning in Sawing : skipped Entity too small") ;
LOG_WARN( GetEMkLogger(), "Warning in Sawing : skipped Entity too small") ;
return true ;
}
@@ -2032,7 +2032,7 @@ Sawing::ProcessExtCurve( const ICurve* pCrvP, const ICurveComposite* pCrvC, cons
}
}
if ( dMinRad < m_pMchMgr->GetCurrMachiningsMgr()->GetExtSawArcMinRad()) {
LOG_INFO( GetEMkLogger(), "Warning in Sawing : Radius too small in ExtSawArc") ;
LOG_WARN( GetEMkLogger(), "Warning in Sawing : Radius too small in ExtSawArc") ;
return true ;
}
// se richiesta generazione, verifico limite standard angolo al centro archi
@@ -2127,7 +2127,7 @@ Sawing::ProcessExtCurve( const ICurve* pCrvP, const ICurveComposite* pCrvC, cons
return false ;
}
if ( bToSkip) {
LOG_INFO( GetEMkLogger(), "Warning in Sawing : skipped Entity too small") ;
LOG_WARN( GetEMkLogger(), "Warning in Sawing : skipped Entity too small") ;
return true ;
}
@@ -2733,7 +2733,7 @@ Sawing::ProcessIntArc( const ICurve* pCrvP, const ICurveArc* pArcC, const ICurve
double dRad = pArc->GetRadius() ;
double dSinA = dSawRad / dRad ;
if ( dSinA > sin( dMaxSideAng * DEGTORAD)) {
LOG_INFO( GetEMkLogger(), "Warning in Sawing : Radius too small in IntSawArc") ;
LOG_WARN( GetEMkLogger(), "Warning in Sawing : Radius too small in IntSawArc") ;
return true ;
}
double dSideAng = - asin( dSinA) * RADTODEG ;
@@ -2821,7 +2821,7 @@ Sawing::ProcessIntArc( const ICurve* pCrvP, const ICurveArc* pArcC, const ICurve
return false ;
}
if ( bToSkip) {
LOG_INFO( GetEMkLogger(), "Warning in Sawing : skipped Entity too small") ;
LOG_WARN( GetEMkLogger(), "Warning in Sawing : skipped Entity too small") ;
return true ;
}
// ricalcolo i versori fresa alle estremità (potrebbero essere cambiate)
+26 -4
View File
@@ -25,6 +25,7 @@
#include "/EgtDev/Include/EGkStringUtils3d.h"
#include "/EgtDev/Include/EMkToolConst.h"
#include "/EgtDev/Include/EMkOperationConst.h"
#include "/EgtDev/Include/EgtPerfCounter.h"
#include "/EgtDev/Include/EgtNumUtils.h"
using namespace std ;
@@ -44,6 +45,7 @@ Simulator::Simulator( void)
m_pMchMgr = nullptr ;
m_pGeomDB = nullptr ;
m_pMachine = nullptr ;
m_pPerfCnt = nullptr ;
m_dStep = MID_STEP ;
m_nUiStatus = MCH_UISIM_NULL ;
m_nOpId = GDB_ID_NULL ;
@@ -73,6 +75,11 @@ Simulator::~Simulator( void)
GoHome() ;
// rimuovo tavola variabili globali
m_pMachine->LuaResetGlobVar( GLOB_VAR) ;
// rimuovo performance counter
if ( m_pPerfCnt != nullptr) {
delete m_pPerfCnt ;
m_pPerfCnt = nullptr ;
}
}
//----------------------------------------------------------------------------
@@ -86,6 +93,7 @@ Simulator::Init( MachMgr* pMchMgr)
m_pMchMgr = pMchMgr ;
m_pGeomDB = m_pMchMgr->GetGeomDB() ;
m_pMachine = m_pMchMgr->GetCurrMachine() ;
m_pPerfCnt = new PerformanceCounter ;
return true ;
}
@@ -136,6 +144,10 @@ Simulator::Start( bool bFirst)
if ( ! FindAndManageOperationStart( true, bFirst, nStatus))
bOk = false ;
// Reset timer
if ( m_pPerfCnt != nullptr)
m_pPerfCnt->Start() ;
return bOk ;
}
@@ -192,6 +204,14 @@ Simulator::Move( int& nStatus)
return false ;
}
// Recupero tempo impiegato (calcolo + visualizzazione precedenti)
if ( m_pPerfCnt != nullptr && ExeGetDebugLevel() >= 5) {
double dElapsed = m_pPerfCnt->Stop() ;
string sOut = "Elapsed=" + ToString( dElapsed, 0) ;
LOG_DBG_INFO( GetEMkLogger(), sOut.c_str())
m_pPerfCnt->Start() ;
}
// Se arrivato alla fine dell'interpolazione
if ( m_dCoeff > COEFF_LIM) {
// recupero una nuova entità
@@ -888,7 +908,7 @@ Simulator::ManageSingleMove( int& nStatus, double& dMove)
double dPrevCoeff = m_dCoeff ;
double dDist = sqrt( dSqDist) ;
if ( dDist > EPS_SMALL) {
int nStep = int( max( dDist / ( ( nMoveType == 0 ? 4 : 1) * m_dStep), 1.)) ;
int nStep = int( max( dDist / ( ( nMoveType == 0 ? 2 : 1) * m_dStep), 1.)) ;
m_dCoeff += 1. / nStep ;
if ( m_dCoeff > 1)
m_dCoeff = 1 ;
@@ -1055,9 +1075,11 @@ Simulator::ExecLineVmill( int nVmId, const Point3d& ptHi, const Vector3d& vtHi,
ptHiL += m_dVmTdOffs * vtHiL + m_dVmAdOffs * vtAiL ;
ptHfL += m_dVmTdOffs * vtHfL + m_dVmAdOffs * vtAfL ;
// Log per debug
//string sOut = "Pi=(" + ToString( ptHiL) + ") Vi=(" + ToString( vtHiL) + ") Ai=(" + ToString( vtAiL) +
// ") Pf=(" + ToString( ptHfL) + ") Vf=(" + ToString( vtHfL) + ") Af=(" + ToString( vtAfL) + ")" ;
//LOG_INFO( GetEMkLogger(), sOut.c_str())
if ( ExeGetDebugLevel() >= 10) {
string sOut = "Pi=(" + ToString( ptHiL) + ") Vi=(" + ToString( vtHiL) + ") Ai=(" + ToString( vtAiL) +
") Pf=(" + ToString( ptHfL) + ") Vf=(" + ToString( vtHfL) + ") Af=(" + ToString( vtAfL) + ")" ;
LOG_DBG_INFO( GetEMkLogger(), sOut.c_str())
}
// Eseguo
return pVZM->MillingStep( ptHiL, vtHiL, vtAiL, ptHfL, vtHfL, vtAfL) ;
}
+2
View File
@@ -19,6 +19,7 @@
class MachMgr ;
class IGeomDB ;
class Machine ;
class PerformanceCounter ;
//----------------------------------------------------------------------------
class Simulator
@@ -84,6 +85,7 @@ class Simulator
MachMgr* m_pMchMgr ; // puntatore al gestore di tutte le lavorazioni
IGeomDB* m_pGeomDB ; // puntatore al DB geometrico
Machine* m_pMachine ; // puntatore alla macchina
PerformanceCounter* m_pPerfCnt ; // timer per calcolo FPS
double m_dStep ; // lunghezza di riferimento per la velocità di simulazione
int m_nUiStatus ; // stato simulazione a livello utente
int m_nOpId ; // identificativo della operazione (lavoraz.) corrente
+1 -1
View File
@@ -102,7 +102,7 @@ ToolsMgr::Reload( void)
}
{
string sOut = "ReloadTools : FileVer = " + ToString( nVersion) + " CurrVer = " + ToString( TF_CURR_VER) ;
LOG_INFO( GetEMkLogger(), sOut.c_str())
LOG_DBG_INFO( GetEMkLogger(), sOut.c_str())
}
// dimensiono maps