EgtMachKernel 1.6u6 :

- aggiustamenti nel calcolo assi rotanti
- aggiunto Hint assi in note di lavorazione come suggerimento angoli iniziali.
This commit is contained in:
Dario Sassi
2016-09-29 14:57:43 +00:00
parent b188caeba3
commit 7468c3bf17
14 changed files with 195 additions and 48 deletions
+2 -1
View File
@@ -875,7 +875,8 @@ Disposition::SpecialApply( bool bRecalc)
if ( m_nShifts == 0)
return bOk ;
// calcolo assi macchina
bOk = bOk && CalculateAxesValues() ;
string sHint = "" ;
bOk = bOk && CalculateAxesValues( sHint) ;
// gestione movimenti all'inizio di ogni singolo percorso di lavorazione e alla fine di tutti
bOk = bOk && AdjustStartEndMovements() ;
return bOk ;
+2 -1
View File
@@ -467,7 +467,8 @@ Drilling::Apply( bool bRecalc)
return true ;
// calcolo gli assi macchina
if ( ! CalculateAxesValues())
string sHint = ExtractHint( m_Params.m_sUserNotes) ;
if ( ! CalculateAxesValues( sHint))
return false ;
// gestione movimenti all'inizio di ogni singolo percorso di lavorazione e alla fine della lavorazione
BIN
View File
Binary file not shown.
+20 -19
View File
@@ -237,19 +237,20 @@ class MachMgr : public IMachMgr
bool SetCalcTable( const std::string& sTable) override ;
bool SetCalcTool( const std::string& sTool, const std::string& sHead, int nExit) override ;
bool SetRotAxisBlock( const std::string& sAxis, double dVal) override ;
bool GetCalcTool( std::string& sTool) override ;
bool GetCalcTool( std::string& sTool) const override ;
bool GetCalcAngles( const Vector3d& vtDirT, const Vector3d& vtDirA,
int& nStat, double& dAngA1, double& dAngB1, double& dAngA2, double& dAngB2) override ;
int& nStat, double& dAngA1, double& dAngB1, double& dAngA2, double& dAngB2) const override ;
bool GetCalcAngles( const Vector3d& vtDirT, const Vector3d& vtDirA,
int& nStat, DBLVECTOR& vAng1, DBLVECTOR& vAng2) ;
int& nStat, DBLVECTOR& vAng1, DBLVECTOR& vAng2) const ;
bool GetCalcPositions( const Point3d& ptP, double dAngA, double dAngB,
int& nStat, double& dX, double& dY, double& dZ) override ;
int& nStat, double& dX, double& dY, double& dZ) const override ;
bool GetCalcPositions( const Point3d& ptP, DBLVECTOR& vAng,
int& nStat, double& dX, double& dY, double& dZ) ;
int& nStat, double& dX, double& dY, double& dZ) const ;
bool GetCalcTipFromPositions( double dX, double dY, double dZ, double dAngA, double dAngB,
bool bOverall, bool bBottom, Point3d& ptTip) override ;
bool GetCalcToolDirFromAngles( double dAngA, double dAngB, Vector3d& vtDir) override ;
bool GetNearestAngleInStroke( int nInd, double dAngRef, double& dAng) override ;
bool bOverall, bool bBottom, Point3d& ptTip) const override ;
bool GetCalcToolDirFromAngles( double dAngA, double dAngB, Vector3d& vtDir) const override ;
bool GetNearestAngleInStroke( int nInd, double dAngRef, double& dAng) const override ;
bool LimitAngleToStroke( int nInd, double& dAng) const override ;
bool VerifyOutstroke( double dX, double dY, double dZ, double dAngA, double dAngB, int& nStat) override ;
bool VerifyOutstroke( double dX, double dY, double dZ, const DBLVECTOR& vAng, int& nStat) ;
const std::string& GetOutstrokeInfo( void) const override ;
@@ -264,7 +265,7 @@ class MachMgr : public IMachMgr
bool ResetAxisPos( const std::string& sAxis) override ;
bool ResetAllAxesPos( void) override ;
bool LoadTool( const std::string& sHead, int nExit, const std::string& sTool) override ;
bool GetLoadedTool( const std::string& sHead, int nExit, std::string& sTool) override ;
bool GetLoadedTool( const std::string& sHead, int nExit, std::string& sTool) const override ;
bool UnloadTool( const std::string& sHead, int nExit) override ;
bool ResetHeadSet( const std::string& sHead) override ;
bool SetMachineLook( int nFlag) override ;
@@ -272,13 +273,13 @@ class MachMgr : public IMachMgr
public :
MachMgr( void) ;
// Basic
int GetContextId( void)
int GetContextId( void) const
{ return m_nContextId ; }
IGeomDB* GetGeomDB( void)
IGeomDB* GetGeomDB( void) const
{ return m_pGeomDB ; }
int GetMachBaseId( void)
int GetMachBaseId( void) const
{ return m_nMachBaseId ; }
int GetMachAuxId( void)
int GetMachAuxId( void) const
{ return m_nMachAuxId ; }
std::string GetLuaLibsDir( void) const
{ return m_sLuaLibsDir ; }
@@ -305,13 +306,13 @@ class MachMgr : public IMachMgr
ToolsMgr* GetCurrToolsMgr( void) const ;
MachiningsMgr* GetCurrMachiningsMgr( void) const ;
// MachineCalc
int GetCurrLinAxes( void) ;
int GetCurrRotAxes( void) ;
bool GetAllCurrAxesName( STRVECTOR& vAxName) ;
bool GetAllCalcAxesHomePos( DBLVECTOR& vAxHomeVal) ;
int GetCurrLinAxes( void) const ;
int GetCurrRotAxes( void) const ;
bool GetAllCurrAxesName( STRVECTOR& vAxName) const ;
bool GetAllCalcAxesHomePos( DBLVECTOR& vAxHomeVal) const ;
bool ApplyRotAxisBlock( void) ;
bool IsKinematicRotAxisBlocked( int nInd) ;
double GetCalcRot1W( void) ;
bool IsKinematicRotAxisBlocked( int nInd) const ;
double GetCalcRot1W( void) const ;
bool SetCalcSolCh( int nScc) ;
// operations
bool GetOperationNewName( std::string& sName) const ;
+23 -15
View File
@@ -250,7 +250,7 @@ MachMgr::LoadTool( const string& sHead, int nExit, const string& sTool)
//----------------------------------------------------------------------------
bool
MachMgr::GetLoadedTool( const string& sHead, int nExit, string& sTool)
MachMgr::GetLoadedTool( const string& sHead, int nExit, string& sTool) const
{
Machine* pMch = GetCurrMachine() ;
return ( ( pMch != nullptr) ? pMch->GetLoadedTool( sHead, nExit, sTool) : false) ;
@@ -322,7 +322,7 @@ MachMgr::ApplyRotAxisBlock( void)
//----------------------------------------------------------------------------
bool
MachMgr::IsKinematicRotAxisBlocked( int nInd)
MachMgr::IsKinematicRotAxisBlocked( int nInd) const
{
Machine* pMch = GetCurrMachine() ;
return ( ( pMch != nullptr) ? pMch->IsKinematicRotAxisBlocked( nInd) : false) ;
@@ -341,7 +341,7 @@ MachMgr::SetCalcSolCh( int nScc)
//----------------------------------------------------------------------------
bool
MachMgr::GetCalcTool( string& sTool)
MachMgr::GetCalcTool( string& sTool) const
{
Machine* pMch = GetCurrMachine() ;
return ( ( pMch != nullptr) ? pMch->GetCurrTool( sTool) : false) ;
@@ -349,7 +349,7 @@ MachMgr::GetCalcTool( string& sTool)
//----------------------------------------------------------------------------
double
MachMgr::GetCalcRot1W( void)
MachMgr::GetCalcRot1W( void) const
{
Machine* pMch = GetCurrMachine() ;
return ( ( pMch != nullptr) ? pMch->GetCurrRot1W() : false) ;
@@ -357,7 +357,7 @@ MachMgr::GetCalcRot1W( void)
//----------------------------------------------------------------------------
int
MachMgr::GetCurrLinAxes( void)
MachMgr::GetCurrLinAxes( void) const
{
Machine* pMch = GetCurrMachine() ;
return ( ( pMch != nullptr) ? pMch->GetCurrLinAxes() : false) ;
@@ -365,7 +365,7 @@ MachMgr::GetCurrLinAxes( void)
//----------------------------------------------------------------------------
int
MachMgr::GetCurrRotAxes( void)
MachMgr::GetCurrRotAxes( void) const
{
Machine* pMch = GetCurrMachine() ;
return ( ( pMch != nullptr) ? pMch->GetCurrRotAxes() : false) ;
@@ -373,7 +373,7 @@ MachMgr::GetCurrRotAxes( void)
//----------------------------------------------------------------------------
bool
MachMgr::GetAllCurrAxesName( STRVECTOR& vAxName)
MachMgr::GetAllCurrAxesName( STRVECTOR& vAxName) const
{
Machine* pMch = GetCurrMachine() ;
return ( ( pMch != nullptr) ? pMch->GetAllCurrAxesName( vAxName) : false) ;
@@ -381,7 +381,7 @@ MachMgr::GetAllCurrAxesName( STRVECTOR& vAxName)
//----------------------------------------------------------------------------
bool
MachMgr::GetAllCalcAxesHomePos( DBLVECTOR& vAxHomeVal)
MachMgr::GetAllCalcAxesHomePos( DBLVECTOR& vAxHomeVal) const
{
Machine* pMch = GetCurrMachine() ;
return ( ( pMch != nullptr) ? pMch->GetAllCurrAxesHomePos( vAxHomeVal) : false) ;
@@ -390,7 +390,7 @@ MachMgr::GetAllCalcAxesHomePos( DBLVECTOR& vAxHomeVal)
//----------------------------------------------------------------------------
bool
MachMgr::GetCalcAngles( const Vector3d& vtDirT, const Vector3d& vtDirA,
int& nStat, double& dAngA1, double& dAngB1, double& dAngA2, double& dAngB2)
int& nStat, double& dAngA1, double& dAngB1, double& dAngA2, double& dAngB2) const
{
Machine* pMch = GetCurrMachine() ;
return ( ( pMch != nullptr) ? pMch->GetAngles( vtDirT, vtDirA, nStat, dAngA1, dAngB1, dAngA2, dAngB2) : false) ;
@@ -399,7 +399,7 @@ MachMgr::GetCalcAngles( const Vector3d& vtDirT, const Vector3d& vtDirA,
//----------------------------------------------------------------------------
bool
MachMgr::GetCalcAngles( const Vector3d& vtDirT, const Vector3d& vtDirA,
int& nStat, DBLVECTOR& vAng1, DBLVECTOR& vAng2)
int& nStat, DBLVECTOR& vAng1, DBLVECTOR& vAng2) const
{
Machine* pMch = GetCurrMachine() ;
return ( ( pMch != nullptr) ? pMch->GetAngles( vtDirT, vtDirA, nStat, vAng1, vAng2) : false) ;
@@ -408,7 +408,7 @@ MachMgr::GetCalcAngles( const Vector3d& vtDirT, const Vector3d& vtDirA,
//----------------------------------------------------------------------------
bool
MachMgr::GetCalcPositions( const Point3d& ptP, double dAngA, double dAngB,
int& nStat, double& dX, double& dY, double& dZ)
int& nStat, double& dX, double& dY, double& dZ) const
{
Machine* pMch = GetCurrMachine() ;
return ( ( pMch != nullptr) ? pMch->GetPositions( ptP, dAngA, dAngB, nStat, dX, dY, dZ) : false) ;
@@ -417,7 +417,7 @@ MachMgr::GetCalcPositions( const Point3d& ptP, double dAngA, double dAngB,
//----------------------------------------------------------------------------
bool
MachMgr::GetCalcPositions( const Point3d& ptP, DBLVECTOR& vAng,
int& nStat, double& dX, double& dY, double& dZ)
int& nStat, double& dX, double& dY, double& dZ) const
{
Machine* pMch = GetCurrMachine() ;
return ( ( pMch != nullptr) ? pMch->GetPositions( ptP, vAng, nStat, dX, dY, dZ) : false) ;
@@ -427,7 +427,7 @@ MachMgr::GetCalcPositions( const Point3d& ptP, DBLVECTOR& vAng,
//----------------------------------------------------------------------------
bool
MachMgr::GetCalcTipFromPositions( double dX, double dY, double dZ, double dAngA, double dAngB,
bool bOverall, bool bBottom, Point3d& ptTip)
bool bOverall, bool bBottom, Point3d& ptTip) const
{
Machine* pMch = GetCurrMachine() ;
return ( ( pMch != nullptr) ? pMch->GetTipFromPositions( dX, dY, dZ, dAngA, dAngB, bOverall, bBottom, ptTip) : false) ;
@@ -435,7 +435,7 @@ MachMgr::GetCalcTipFromPositions( double dX, double dY, double dZ, double dAngA,
//----------------------------------------------------------------------------
bool
MachMgr::GetCalcToolDirFromAngles( double dAngA, double dAngB, Vector3d& vtDir)
MachMgr::GetCalcToolDirFromAngles( double dAngA, double dAngB, Vector3d& vtDir) const
{
Machine* pMch = GetCurrMachine() ;
return ( ( pMch != nullptr) ? pMch->GetToolDirFromAngles( dAngA, dAngB, vtDir) : false) ;
@@ -443,12 +443,20 @@ MachMgr::GetCalcToolDirFromAngles( double dAngA, double dAngB, Vector3d& vtDir)
//----------------------------------------------------------------------------
bool
MachMgr::GetNearestAngleInStroke( int nInd, double dAngRef, double& dAng)
MachMgr::GetNearestAngleInStroke( int nInd, double dAngRef, double& dAng) const
{
Machine* pMch = GetCurrMachine() ;
return ( ( pMch != nullptr) ? pMch->GetNearestAngleInStroke( nInd, dAngRef, dAng) : false) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::LimitAngleToStroke( int nInd, double& dAng) const
{
Machine* pMch = GetCurrMachine() ;
return ( ( pMch != nullptr) ? pMch->LimitAngleToStroke( nInd, dAng) : false) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::VerifyOutstroke( double dX, double dY, double dZ, double dAngA, double dAngB, int& nStat)
+5 -2
View File
@@ -52,7 +52,7 @@ class Machine
return ( IsHeadGroup( nId) ? nId : GDB_ID_NULL) ; }
bool SetLook( int nFlag) ;
bool LoadTool( const std::string& sHead, int nExit, const std::string& sTool) ;
bool GetLoadedTool( const std::string& sHead, int nExit, std::string& sTool) ;
bool GetLoadedTool( const std::string& sHead, int nExit, std::string& sTool) const ;
bool UnloadTool( const string& sHead, int nExit) ;
bool ResetHeadSet( const std::string& sHead) ;
bool SetAxisPos( const std::string& sAxis, double dVal) ;
@@ -76,11 +76,13 @@ class Machine
bool BlockKinematicRotAxis( int nId, double dVal) ;
bool FreeKinematicRotAxis( const std::string& sName) ;
bool FreeKinematicRotAxis( int nId) ;
bool IsKinematicRotAxisBlocked( int nInd) ;
bool IsKinematicRotAxisBlocked( int nInd) const ;
bool SetSolCh( int nScc) ;
int GetCurrLinAxes( void) const ;
int GetCurrRotAxes( void) const ;
bool GetCurrAxisName( int nInd, std::string& sAxName) const ;
bool GetAllCurrAxesName( STRVECTOR& vAxName) const ;
bool GetCurrAxisToken( int nInd, std::string& sAxToken) const ;
bool GetAllCurrAxesToken( STRVECTOR& vAxToken) const ;
bool GetCurrAxisHomePos( int nInd, double& dHome) const ;
bool GetAllCurrAxesHomePos( DBLVECTOR& vAxHomeVal) const ;
@@ -98,6 +100,7 @@ class Machine
bool bBottom, bool bOverall, Point3d& ptTip) const ;
bool GetToolDirFromAngles( double dAngA, double dAngB, Vector3d& vtDir) const ;
bool GetNearestAngleInStroke( int nInd, double dAngRef, double& dAng) const ;
bool LimitAngleToStroke( int nInd, double& dAng) const ;
bool VerifyOutstroke( double dX, double dY, double dZ, const DBLVECTOR& vAng, int& nStat) const ;
const std::string& GetOutstrokeInfo( void) const
{ return m_sOutstrokeInfo ; }
+63 -1
View File
@@ -454,7 +454,7 @@ Machine::FreeKinematicRotAxis( int nId)
//----------------------------------------------------------------------------
bool
Machine::IsKinematicRotAxisBlocked( int nInd)
Machine::IsKinematicRotAxisBlocked( int nInd) const
{
int nRotAxTot = int( m_vCalcRotAx.size()) ;
if ( nInd < 0 || nInd >= nRotAxTot)
@@ -1006,6 +1006,21 @@ Machine::GetNearestAngleInStroke( int nInd, double dAngRef, double& dAng) const
dAng <= m_vCalcRotAx[nInd].stroke.Max) ;
}
//----------------------------------------------------------------------------
bool
Machine::LimitAngleToStroke( int nInd, double& dAng) const
{
// se angolo fittizio (non esiste l'asse rotante corrispondente), non c'è alcunchè da fare
if ( nInd < 0 || nInd >= int( m_vCalcRotAx.size()))
return true ;
// se angolo fuori corsa, lo porto all'estremo più vicino
if ( dAng < m_vCalcRotAx[nInd].stroke.Min)
dAng = m_vCalcRotAx[nInd].stroke.Min ;
else if ( dAng > m_vCalcRotAx[nInd].stroke.Max)
dAng = m_vCalcRotAx[nInd].stroke.Max ;
return true ;
}
//----------------------------------------------------------------------------
bool
Machine::VerifyOutstroke( double dX, double dY, double dZ, const DBLVECTOR& vAng, int& nStat) const
@@ -1061,6 +1076,29 @@ Machine::GetCurrRotAxes( void) const
return int( m_vCalcRotAx.size()) ;
}
//----------------------------------------------------------------------------
bool
Machine::GetCurrAxisName( int nInd, string& sAxName) const
{
int nLinAxes = int( m_vCalcLinAx.size()) ;
int nRotAxes = int( m_vCalcRotAx.size()) ;
if ( nInd >= 0 && nInd < nLinAxes) {
Axis* pAx = GetAxis( m_vCalcLinAx[nInd].nGrpId) ;
if ( pAx == nullptr)
return false ;
sAxName = pAx->GetName() ;
return true ;
}
else if ( nInd >= nLinAxes && nInd < nLinAxes + nRotAxes) {
Axis* pAx = GetAxis( m_vCalcRotAx[nInd-nLinAxes].nGrpId) ;
if ( pAx == nullptr)
return false ;
sAxName = pAx->GetName() ;
return true ;
}
return false ;
}
//----------------------------------------------------------------------------
bool
Machine::GetAllCurrAxesName( STRVECTOR& vAxName) const
@@ -1086,6 +1124,30 @@ Machine::GetAllCurrAxesName( STRVECTOR& vAxName) const
return bOk ;
}
//----------------------------------------------------------------------------
bool
Machine::GetCurrAxisToken( int nInd, string& sAxToken) const
{
int nLinAxes = int( m_vCalcLinAx.size()) ;
int nRotAxes = int( m_vCalcRotAx.size()) ;
if ( nInd >= 0 && nInd < nLinAxes) {
Axis* pAx = GetAxis( m_vCalcLinAx[nInd].nGrpId) ;
if ( pAx == nullptr)
return false ;
sAxToken = pAx->GetToken() ;
return true ;
}
else if ( nInd >= nLinAxes && nInd < nLinAxes + nRotAxes) {
Axis* pAx = GetAxis( m_vCalcRotAx[nInd-nLinAxes].nGrpId) ;
if ( pAx == nullptr)
return false ;
sAxToken = pAx->GetToken() ;
return true ;
}
return false ;
}
//----------------------------------------------------------------------------
bool
Machine::GetAllCurrAxesToken( STRVECTOR& vAxToken) const
+1 -1
View File
@@ -75,7 +75,7 @@ Machine::LoadTool( const string& sHead, int nExit, const string& sTool)
//----------------------------------------------------------------------------
bool
Machine::GetLoadedTool( const string& sHead, int nExit, string& sTool)
Machine::GetLoadedTool( const string& sHead, int nExit, string& sTool) const
{
// controllo GeomDB
if ( m_pGeomDB == nullptr)
+2 -1
View File
@@ -515,7 +515,8 @@ Milling::Apply( bool bRecalc)
return true ;
// calcolo gli assi macchina
if ( ! CalculateAxesValues())
string sHint = ExtractHint( m_Params.m_sUserNotes) ;
if ( ! CalculateAxesValues( sHint))
return false ;
// gestione movimenti all'inizio di ogni singolo percorso di lavorazione e alla fine della lavorazione
+69 -3
View File
@@ -449,9 +449,28 @@ Operation::GetClPathFinalAxesValues( int nClPathId, DBLVECTOR& vAxVal)
return ( vAxVal.size() > 0) ;
}
//----------------------------------------------------------------------------
std::string
Operation::ExtractHint( const std::string& sNotes)
{
const string KEY_HINT = "Hint:" ;
string sHint ;
STRVECTOR vsCmd ;
Tokenize( sNotes, ";", vsCmd) ;
for each (const auto& sCmd in vsCmd) {
// se per assi rotanti
if ( sCmd.find( KEY_HINT) != string::npos) {
sHint = sCmd ;
ReplaceString( sHint, KEY_HINT, "") ;
break ;
}
}
return sHint ;
}
//----------------------------------------------------------------------------
bool
Operation::CalculateAxesValues( void)
Operation::CalculateAxesValues( const string& sHint)
{
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
return false ;
@@ -483,7 +502,7 @@ Operation::CalculateAxesValues( void)
int nLinAxes = m_pMchMgr->GetCurrLinAxes() ;
int nRotAxes = m_pMchMgr->GetCurrRotAxes() ;
// assegno gli angoli iniziali
// Assegno gli angoli iniziali
DBLVECTOR vAxRotPrec( nRotAxes, 0.) ;
DBLVECTOR vAxVal ;
// se utensile non cambiato, uso gli angoli finali della lavorazione precedente
@@ -498,6 +517,25 @@ Operation::CalculateAxesValues( void)
for ( int i = 0 ; i < nRotAxes ; ++ i)
vAxRotPrec[i] = vAxVal[nLinAxes + i] ;
}
// se ci sono suggerimenti validi per gli assi rotanti, li applico
if ( ! sHint.empty()) {
STRVECTOR vsTok ;
Tokenize( sHint, ",", vsTok) ;
for each (const auto& sTok in vsTok) {
string szKey, szVal ;
Split( sTok, "=", true, szKey, szVal) ;
for ( int i = 0 ; i < nRotAxes ; ++ i) {
string sAxToken ;
if ( m_pMchMgr->GetCurrMachine()->GetCurrAxisToken(nLinAxes + i, sAxToken) &&
szKey == sAxToken) {
double dVal ;
if ( FromString( szVal, dVal))
vAxRotPrec[i] = dVal ;
break ;
}
}
}
}
// recupero peso primo asse rotante di testa
double dRot1W = m_pMchMgr->GetCalcRot1W() ;
@@ -581,12 +619,21 @@ Operation::CalculateClPathAxesValues( int nClPathId, int nLinAxes, int nRotAxes,
// porto gli angoli ai valori più vicini ai precedenti con offset di uno o più giri
for ( size_t i = 0 ; i < vAng1.size() ; ++ i)
m_pMchMgr->GetNearestAngleInStroke( int( i), vAxRotPrec[i], vAng1[i]) ;
// se sol.ne indeterminata (sempre il primo asse), assegno il precedente, limitandolo alla corsa
if ( nRStat < 0 && vAng1.size() >= 1) {
vAng1[0] = vAxRotPrec[0] ;
m_pMchMgr->LimitAngleToStroke( 0, vAng1[0]) ;
}
}
// per movimenti successivi
else {
// scelgo gli angoli più vicini, per continuità non applico offset per stare nelle corse
for ( size_t i = 0 ; i < vAng1.size() ; ++ i)
vAng1[i] = AngleNearAngle( vAng1[i], vAxRotPrec[i]) ;
// se sol.ne indeterminata (sempre il primo asse), assegno il precedente
if ( nRStat < 0 && vAng1.size() >= 1) {
vAng1[0] = vAxRotPrec[0] ;
}
}
}
if ( abs( nRStat) == 2) {
@@ -597,12 +644,23 @@ Operation::CalculateClPathAxesValues( int nClPathId, int nLinAxes, int nRotAxes,
m_pMchMgr->GetNearestAngleInStroke( int( i), vAxRotPrec[i], vAng1[i]) ;
m_pMchMgr->GetNearestAngleInStroke( int( i), vAxRotPrec[i], vAng2[i]) ;
}
// se sol.ne indeterminata (sempre il primo asse), assegno il precedente, limitandolo alla corsa
if ( nRStat < 0 && vAng1.size() >= 1) {
vAng1[0] = vAxRotPrec[0] ;
m_pMchMgr->LimitAngleToStroke( 0, vAng1[0]) ;
vAng2[0] = vAng1[0] ;
}
}
else {
// scelgo gli angoli più vicini, per continuità non applico offset per stare nelle corse
for ( size_t i = 0 ; i < vAng1.size() ; ++ i) {
vAng1[i] = AngleNearAngle( vAng1[i], vAxRotPrec[i]) ;
vAng2[i] = AngleNearAngle( vAng2[i], vAxRotPrec[i]) ;
// se sol.ne indeterminata (sempre il primo asse), assegno il precedente
if ( nRStat < 0 && vAng1.size() >= 1) {
vAng1[0] = vAxRotPrec[0] ;
vAng2[0] = vAng1[0] ;
}
}
}
// scelgo la soluzione più vicina ai precedenti
@@ -611,7 +669,7 @@ Operation::CalculateClPathAxesValues( int nClPathId, int nLinAxes, int nRotAxes,
bool bFirst = true ;
for ( size_t i = 0 ; i < vAng1.size() ; ++ i) {
// ignoro gli assi bloccati
if ( ! m_pMchMgr->IsKinematicRotAxisBlocked( int( i)))
if ( m_pMchMgr->IsKinematicRotAxisBlocked( int( i)))
continue ;
// calcolo i delta asse con eventuale peso
dDelta1 += fabs( vAng1[i] - vAxRotPrec[i]) * ( bFirst ? dRot1W : 1) ;
@@ -653,6 +711,14 @@ Operation::CalculateClPathAxesValues( int nClPathId, int nLinAxes, int nRotAxes,
}
string sInfo = "Outstroke : " + m_pMchMgr->GetOutstrokeInfo() ;
LOG_INFO( GetEMkLogger(), sInfo.c_str())
// imposto stato
bFirst = false ;
// memorizzo i valori degli assi lineari come nuovi precedenti
dXprec = dX ;
dYprec = dY ;
dZprec = dZ ;
// memorizzo i valori degli angoli come nuovi precedenti
vAxRotPrec = vAng1 ;
continue ;
}
// salvo i valori degli assi
+2 -1
View File
@@ -70,7 +70,8 @@ class Operation : public IUserObj
bool GetClPathInitialAxesValues( int nClPathId, DBLVECTOR& vAxVal) ;
bool GetFinalAxesValues( DBLVECTOR& vAxVal) ;
bool GetClPathFinalAxesValues( int nClPathId, DBLVECTOR& vAxVal) ;
bool CalculateAxesValues( void) ;
std::string ExtractHint( const std::string& sNotes) ;
bool CalculateAxesValues( const std::string& sHint) ;
bool CalculateClPathAxesValues( int nClPathId, int nLinAxes, int nRotAxes, double dRot1W,
DBLVECTOR& vAxRotPrec, int& nOutStrC) ;
bool AdjustStartEndMovements( bool bOnlyStart = false) ;
+2 -1
View File
@@ -443,7 +443,8 @@ SawFinishing::Apply( bool bRecalc)
return true ;
// calcolo gli assi macchina
if ( ! CalculateAxesValues())
string sHint = ExtractHint( m_Params.m_sUserNotes) ;
if ( ! CalculateAxesValues( sHint))
return false ;
// gestione movimenti all'inizio di ogni singolo percorso di lavorazione e alla fine della lavorazione
+2 -1
View File
@@ -422,7 +422,8 @@ SawRoughing::Apply( bool bRecalc)
return true ;
// calcolo gli assi macchina
if ( ! CalculateAxesValues())
string sHint = ExtractHint( m_Params.m_sUserNotes) ;
if ( ! CalculateAxesValues( sHint))
return false ;
// gestione movimenti all'inizio di ogni singolo percorso di lavorazione e alla fine della lavorazione
+2 -1
View File
@@ -529,7 +529,8 @@ Sawing::Apply( bool bRecalc)
return true ;
// calcolo gli assi macchina
if ( ! CalculateAxesValues())
string sHint = ExtractHint( m_Params.m_sUserNotes) ;
if ( ! CalculateAxesValues( sHint))
return false ;
// gestione movimenti all'inizio di ogni singolo percorso di lavorazione e alla fine della lavorazione