Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 66466225d4 | |||
| 8483c1609a | |||
| 17c7be3a56 | |||
| 34ef5388e1 | |||
| a470ffa6ce | |||
| cfb2fea0bd | |||
| ac17810065 | |||
| 543afd4c7a | |||
| 73ce1f1018 | |||
| 23c0e1c8d5 | |||
| 8e64f0ad00 | |||
| 5a8fb790b0 | |||
| fa6928c593 | |||
| 52a26ceb52 | |||
| bb8b6b9fc1 | |||
| 7b90e2b152 | |||
| 929c724b9f | |||
| 5c6ad44bb5 | |||
| af688d4fb7 | |||
| d1ad8fe9c5 | |||
| 01cb04ac96 | |||
| fb02fa7243 | |||
| 0c3ad1ebe5 | |||
| 7b3a544c9f | |||
| b3a13a94bb | |||
| 8318dcc2a8 | |||
| bdb93bf21f | |||
| 260b35c7e3 | |||
| b18c309344 | |||
| 83cbe5b299 | |||
| c6ede73c9e | |||
| 5fca2321af | |||
| f9ebc68077 | |||
| 22aa1cebc8 | |||
| 9d836abbca | |||
| 3f7ad3e961 | |||
| bea99328ab | |||
| baedb87cd1 |
+1
-8
@@ -588,14 +588,7 @@ Chiseling::Update( bool bPostApply)
|
||||
}
|
||||
|
||||
// imposto eventuale asse bloccato da lavorazione
|
||||
if ( ! m_Params.m_sBlockedAxis.empty()) {
|
||||
string sAxis, sVal ;
|
||||
Split( m_Params.m_sBlockedAxis, "=", true, sAxis, sVal) ;
|
||||
double dVal = 0 ;
|
||||
FromString( sVal, dVal) ;
|
||||
m_pMchMgr->ClearRotAxisBlock() ;
|
||||
m_pMchMgr->SetRotAxisBlock( sAxis, dVal) ;
|
||||
}
|
||||
SetBlockedRotAxis( m_Params.m_sBlockedAxis) ;
|
||||
|
||||
// calcolo gli assi macchina
|
||||
string sHint = ExtractHint( m_Params.m_sUserNotes) ;
|
||||
|
||||
+1
-1
@@ -306,7 +306,7 @@ Disposition::Load( const STRVECTOR& vString, int nBaseGdbId)
|
||||
//----------------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------------
|
||||
Disposition::Disposition( void)
|
||||
: m_bTabOk( false), m_nExit( 0), m_nStatus( MCH_ST_TO_VERIFY), m_nShifts( 0), m_bSomeByHand( false), m_dAreaOffset({{0,0,0,0}})
|
||||
: m_bTabOk( false), m_dAreaOffset({{0,0,0,0}}), m_nExit( 0), m_nStatus( MCH_ST_TO_VERIFY), m_nShifts( 0), m_bSomeByHand( false)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
+1
-8
@@ -607,14 +607,7 @@ Drilling::Update( bool bPostApply)
|
||||
}
|
||||
|
||||
// imposto eventuale asse bloccato da lavorazione
|
||||
if ( ! m_Params.m_sBlockedAxis.empty()) {
|
||||
string sAxis, sVal ;
|
||||
Split( m_Params.m_sBlockedAxis, "=", true, sAxis, sVal) ;
|
||||
double dVal = 0 ;
|
||||
FromString( sVal, dVal) ;
|
||||
m_pMchMgr->ClearRotAxisBlock() ;
|
||||
m_pMchMgr->SetRotAxisBlock( sAxis, dVal) ;
|
||||
}
|
||||
SetBlockedRotAxis( m_Params.m_sBlockedAxis) ;
|
||||
|
||||
// calcolo gli assi macchina
|
||||
string sHint = ExtractHint( m_Params.m_sUserNotes) ;
|
||||
|
||||
Binary file not shown.
+1
-8
@@ -629,14 +629,7 @@ GenMachining::Update( bool bPostApply)
|
||||
}
|
||||
|
||||
// imposto eventuale asse bloccato da lavorazione
|
||||
if ( ! m_Params.m_sBlockedAxis.empty()) {
|
||||
string sAxis, sVal ;
|
||||
Split( m_Params.m_sBlockedAxis, "=", true, sAxis, sVal) ;
|
||||
double dVal = 0 ;
|
||||
FromString( sVal, dVal) ;
|
||||
m_pMchMgr->ClearRotAxisBlock() ;
|
||||
m_pMchMgr->SetRotAxisBlock( sAxis, dVal) ;
|
||||
}
|
||||
SetBlockedRotAxis( m_Params.m_sBlockedAxis) ;
|
||||
|
||||
// calcolo gli assi macchina
|
||||
string sHint = ExtractHint( m_Params.m_sUserNotes) ;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2015-2017
|
||||
// EgalTech 2015-2021
|
||||
//----------------------------------------------------------------------------
|
||||
// File : Head.cpp Data : 11.01.17 Versione : 1.6x6
|
||||
// File : Head.cpp Data : 14.10.21 Versione : 2.3j5
|
||||
// Contenuto : Oggetto testa per gruppo testa di macchina.
|
||||
//
|
||||
//
|
||||
@@ -122,6 +122,7 @@ Head::Set( const string& sName, int nType, int nExitCount, const string& sHSet,
|
||||
m_vsHSet.clear() ;
|
||||
m_vsHSet.push_back( sHSet) ;
|
||||
m_vtADir = vtADir ;
|
||||
m_vtADir.Normalize() ;
|
||||
m_dRot1W = dRot1W ;
|
||||
m_Rot2Stroke = Rot2Stroke ;
|
||||
if ( IsValidHeadScc( nSolCh))
|
||||
@@ -142,3 +143,12 @@ Head::AddHeadToHSet( const string& sHead)
|
||||
m_vsHSet.emplace_back( sHead) ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Head::ModifyHeadAuxDirection( const Vector3d& vtADir)
|
||||
{
|
||||
m_vtADir = vtADir ;
|
||||
m_vtADir.Normalize() ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2015-2015
|
||||
// EgalTech 2015-2021
|
||||
//----------------------------------------------------------------------------
|
||||
// File : Head.h Data : 25.05.15 Versione : 1.6e7
|
||||
// File : Head.h Data : 14.10.21 Versione : 2.3j5
|
||||
// Contenuto : Dichiarazione della classe Head.
|
||||
//
|
||||
//
|
||||
@@ -34,6 +34,7 @@ class Head : public IUserObj
|
||||
const Vector3d& vtADir, double dRot1W, const STROKE& Rot2Stroke, int nSolCh,
|
||||
const STRVECTOR& vsOthColl) ;
|
||||
bool AddHeadToHSet( const std::string& sHead) ;
|
||||
bool ModifyHeadAuxDirection( const Vector3d& vtADir) ;
|
||||
const std::string& GetName( void) const
|
||||
{ return m_sName ; }
|
||||
int GetType( void) const
|
||||
|
||||
@@ -144,6 +144,7 @@ class MachMgr : public IMachMgr
|
||||
bool GetTableRef( int nInd, Point3d& ptPos) const override ;
|
||||
bool GetTableArea( int nInd, BBox3d& b3Area) const override ;
|
||||
bool GetTableAreaOffset( int nInd, BBox3d& b3AreaOffs) const override ;
|
||||
bool ChangeTable( const std::string& sTable, bool bUpdateDisp) override ;
|
||||
bool ShowOnlyTable( bool bVal) override ;
|
||||
int AddFixture( const std::string& sName, const Point3d& ptPos, double dAngRotDeg, double dMov) override ;
|
||||
bool KeepFixture( int nFxtId, int nSouPhase) override ;
|
||||
@@ -230,6 +231,10 @@ class MachMgr : public IMachMgr
|
||||
bool MdbReload( void) override ;
|
||||
bool MdbSave( void) const override ;
|
||||
bool MdbGetMachiningDir( std::string& sMchDir) const override ;
|
||||
bool MdbExport( const STRVECTOR& vsMachiningsNames, const std::string& sOutFile) const ;
|
||||
bool MdbToBeImported( const std::string& sFile, STRVECTOR& vsMachiningsNames, INTVECTOR& vMachiningsTypes) const ;
|
||||
bool MdbImport( const std::string& sFile, const STRVECTOR& vsMachiningsToImport, const STRVECTOR& vsMachiningsNames,
|
||||
STRVECTOR& vsImported) ;
|
||||
// Operations : general
|
||||
int GetOperationCount( void) const override ;
|
||||
int GetFirstOperation( void) const override ;
|
||||
@@ -483,11 +488,11 @@ class MachMgr : public IMachMgr
|
||||
bool ShowRootParts( bool bShow) ;
|
||||
// Tools DataBase
|
||||
bool UpdateAllToolDraws( void) const ;
|
||||
bool UpdateToolDraw( const EgtUUID& UuidTool) const ;
|
||||
bool UpdateToolDraw( const EgtUUID& UuidTool, double& dTHoldLen, double& dTHoldDiam) const ;
|
||||
int UpdateStandardToolDraw( const ToolData* pTdata, int nGenCtx, int nToolCtx, bool bToSave) const ;
|
||||
int UpdateCustomToolDraw( const ToolData* pTdata, int nGenCtx, int nToolCtx, bool bToSave) const ;
|
||||
std::string GetToolMakerKeyFromType( int nType) const ;
|
||||
std::string GetToolHolderPath( const std::string& sHeadName, int nExit, int nType) const ;
|
||||
std::string GetToolHolderPath( const std::string& sHeadName, int nExit, int nType, const std::string& sUserNotes) const ;
|
||||
// Operations : general
|
||||
bool InitOperation( int nId) ;
|
||||
// Operations : dispositions
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "DllMain.h"
|
||||
#include "MachMgr.h"
|
||||
#include "/EgtDev/Include/EGnFileUtils.h"
|
||||
|
||||
using namespace std ;
|
||||
|
||||
@@ -416,3 +417,58 @@ MachMgr::MdbGetMachiningDir( string& sMchDir) const
|
||||
sMchDir = m_sMachinesDir + "\\" + sMachineName + "\\" + MACHININGS_DIR ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::MdbExport( const STRVECTOR& vsMachiningsNames, const string& sOutFile) const
|
||||
{
|
||||
if ( vsMachiningsNames.empty())
|
||||
return true ;
|
||||
|
||||
// recupero il gestore di lavorazioni della macchina corrente
|
||||
MachiningsMgr* pMsMgr = GetCurrMachiningsMgr() ;
|
||||
if ( pMsMgr == nullptr)
|
||||
return false ;
|
||||
|
||||
return pMsMgr->Export( vsMachiningsNames, sOutFile) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::MdbToBeImported( const string& sFile, STRVECTOR& vsMachiningsNames, INTVECTOR& vMachiningsTypes) const
|
||||
{
|
||||
if ( ! ExistsFile( sFile)) {
|
||||
LOG_ERROR( GetEMkLogger(), "MdbToBeImported Error : File does not exist") ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
// recupero il gestore di lavorazioni della macchina corrente
|
||||
MachiningsMgr* pMsMgr = GetCurrMachiningsMgr() ;
|
||||
if ( pMsMgr == nullptr)
|
||||
return false ;
|
||||
|
||||
return pMsMgr->ToBeImported( sFile, vsMachiningsNames, vMachiningsTypes) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::MdbImport( const string& sFile, const STRVECTOR& vsMachiningsToImport, const STRVECTOR& vsMachiningsNames, STRVECTOR& vsImported)
|
||||
{
|
||||
if ( vsMachiningsToImport.empty())
|
||||
return true ;
|
||||
|
||||
if ( ! ExistsFile( sFile)) {
|
||||
LOG_ERROR( GetEMkLogger(), "MdbImport Error : File does not exist") ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
if ( vsMachiningsToImport.size() != vsMachiningsNames.size())
|
||||
return false ;
|
||||
|
||||
// recupero il gestore di lavorazioni della macchina corrente
|
||||
MachiningsMgr* pMsMgr = GetCurrMachiningsMgr() ;
|
||||
if ( pMsMgr == nullptr)
|
||||
return false ;
|
||||
|
||||
return pMsMgr->Import( sFile, vsMachiningsToImport, vsMachiningsNames, vsImported) ;
|
||||
}
|
||||
+28
-13
@@ -526,9 +526,15 @@ MachMgr::UpdateAllToolDraws( void) const
|
||||
// verifico se non esiste il disegno associato
|
||||
string sDraw ; pTdata->GetParam( TPA_DRAW, sDraw) ;
|
||||
bool bNoDraw = ( ! sDraw.empty() && ! ExistsFile( sToolDir + "\\" + sDraw)) ;
|
||||
// se modificato o senza disegno, ne lancio la creazione
|
||||
if ( bModif || bNoDraw)
|
||||
UpdateToolDraw( UuidTool) ;
|
||||
// se modificato o senza disegno, ne lancio la creazione e aggiorno dati portautensile
|
||||
if ( bModif || bNoDraw) {
|
||||
double dTHoldLen = 0, dTHoldDiam = 0 ;
|
||||
UpdateToolDraw( UuidTool, dTHoldLen, dTHoldDiam) ;
|
||||
pTsMgr->SetCurrTool( sName) ;
|
||||
pTsMgr->UpdateCurrToolHolderData( dTHoldLen, dTHoldDiam) ;
|
||||
pTsMgr->SaveCurrTool() ;
|
||||
pTsMgr->SetCurrTool( "") ;
|
||||
}
|
||||
// passo al successivo
|
||||
bNext = pTsMgr->GetNextTool( TF_ALL, sName, nType) ;
|
||||
}
|
||||
@@ -542,7 +548,7 @@ MachMgr::UpdateAllToolDraws( void) const
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::UpdateToolDraw( const EgtUUID& UuidTool) const
|
||||
MachMgr::UpdateToolDraw( const EgtUUID& UuidTool, double& dTHoldLen, double& dTHoldDiam) const
|
||||
{
|
||||
// recupero il gestore di utensili della macchina corrente
|
||||
ToolsMgr* pTsMgr = GetCurrToolsMgr() ;
|
||||
@@ -581,6 +587,12 @@ MachMgr::UpdateToolDraw( const EgtUUID& UuidTool) const
|
||||
// Salvo il disegno
|
||||
ExeSetCurrentContext( nToolCtx) ;
|
||||
bOk = bOk && ExeSaveFile( sDrawPath, GDB_SV_BIN) ;
|
||||
// Recupero i dati del portautensile
|
||||
int nToolId = ExeGetFirstGroupInGroup( GDB_ID_ROOT) ;
|
||||
if ( ! ExeGetInfo( nToolId, TTH_LEN, dTHoldLen))
|
||||
dTHoldLen = 0 ;
|
||||
if ( ! ExeGetInfo( nToolId, TTH_DIAM, dTHoldDiam))
|
||||
dTHoldDiam = 0 ;
|
||||
// Ripristino il contesto originale
|
||||
ExeSetCurrentContext( nGenCtx) ;
|
||||
ExeDeleteContext( nToolCtx) ;
|
||||
@@ -625,10 +637,16 @@ MachMgr::UpdateStandardToolDraw( const ToolData* pTdata, int nGenCtx, int nToolC
|
||||
pTdata->GetParam( TPA_SIDEANG, dSideAng) ;
|
||||
double dThick = 0 ;
|
||||
pTdata->GetParam( TPA_THICK, dThick) ;
|
||||
double dCore = 0 ;
|
||||
pTdata->GetParam( TPA_CORE, dCore) ;
|
||||
if ( dCore < EPS_SMALL && ( nType == TT_SAW_STD || nType == TT_SAW_FLAT))
|
||||
dCore = ( dLen >= dThick ? dThick - 1 : 2 * dLen - dThick) ;
|
||||
double dSpeed = 0 ;
|
||||
pTdata->GetParam( TPA_SPEED, dSpeed) ;
|
||||
string sUserNotes ;
|
||||
pTdata->GetParam( TPA_USERNOTES, sUserNotes) ;
|
||||
// Recupero la path dell'eventuale portautensile
|
||||
string sThPath = GetToolHolderPath( sHeadName, nExit, nType) ;
|
||||
string sThPath = GetToolHolderPath( sHeadName, nExit, nType, sUserNotes) ;
|
||||
// Carico generatore disegno utensile
|
||||
string sMaker = GetPrivateProfileStringUtf8( TOOLS_SEC.c_str(), GetToolMakerKeyFromType( nType).c_str(), "", sMachIni.c_str()) ;
|
||||
if ( sMaker.empty())
|
||||
@@ -657,7 +675,7 @@ MachMgr::UpdateStandardToolDraw( const ToolData* pTdata, int nGenCtx, int nToolC
|
||||
bOk = bOk && ExeLuaSetGlobStringVar( "TOOL.TOOLHOLDER", sThPath) ;
|
||||
bOk = bOk && ExeLuaSetGlobNumVar( "TOOL.LEN", dLen) ;
|
||||
bOk = bOk && ExeLuaSetGlobNumVar( "TOOL.DIAM", dDiam) ;
|
||||
bOk = bOk && ExeLuaSetGlobNumVar( "TOOL.CORE", ( dLen >= dThick ? dThick - 1 : 2 * dLen - dThick)) ;
|
||||
bOk = bOk && ExeLuaSetGlobNumVar( "TOOL.CORE", dCore) ;
|
||||
bOk = bOk && ExeLuaSetGlobNumVar( "TOOL.THICK", dThick) ;
|
||||
bOk = bOk && ExeLuaSetGlobNumVar( "TOOL.MAXMAT", dMaxMat) ;
|
||||
bOk = bOk && ExeLuaSetGlobNumVar( "TOOL.CORNRAD", dCornRad) ;
|
||||
@@ -724,9 +742,6 @@ MachMgr::UpdateCustomToolDraw( const ToolData* pTdata, int nGenCtx, int nToolCtx
|
||||
pTdata->GetParam( TPA_DIAM, dDiam) ;
|
||||
double dDist = 0 ;
|
||||
pTdata->GetParam( TPA_DIST, dDist) ;
|
||||
// Non più limitato alle sole frese
|
||||
//if ( nType != TT_MILL_STD && nType != TT_MILL_NOTIP && nType != TT_MILL_POLISHING)
|
||||
// return TD_INT_ERR ;
|
||||
// Imposto contesto per il disegno utensile
|
||||
if ( ! ExeSetCurrentContext( nToolCtx))
|
||||
return TD_INT_ERR ;
|
||||
@@ -774,7 +789,7 @@ MachMgr::GetToolMakerKeyFromType( int nType) const
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
string
|
||||
MachMgr::GetToolHolderPath( const string& sHeadName, int nExit, int nType) const
|
||||
MachMgr::GetToolHolderPath( const string& sHeadName, int nExit, int nType, const std::string& sUserNotes) const
|
||||
{
|
||||
// Verifiche su testa e uscita
|
||||
if ( sHeadName.empty() || nExit == 0)
|
||||
@@ -821,9 +836,9 @@ MachMgr::GetToolHolderPath( const string& sHeadName, int nExit, int nType) const
|
||||
sToolHolder = GetPrivateProfileStringUtf8( TOOLS_SEC.c_str(), MILLHOLDER_KEY.c_str(), "", sMachIni.c_str()) ;
|
||||
}
|
||||
// Verifico se sovrascritto da nota dell'utensile
|
||||
string sNotes, sVal ;
|
||||
if ( TdbGetCurrToolParam( TPA_USERNOTES, sNotes) &&
|
||||
GetValInNotes( sNotes, "TH", sVal) &&
|
||||
string sVal ;
|
||||
if ( ! sUserNotes.empty() &&
|
||||
GetValInNotes( sUserNotes, "TH", sVal) &&
|
||||
ExistsFile( sToolHolderDir + "\\" + sVal))
|
||||
sToolHolder = sVal ;
|
||||
// Se non trovato ancora, esco
|
||||
|
||||
@@ -44,6 +44,26 @@ MachMgr::GetTable( string& sTable) const
|
||||
return pDisp->GetTable( sTable) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::ChangeTable( const string& sTable, bool bUpdateDisp)
|
||||
{
|
||||
bool bOk = true ;
|
||||
// imposto la tavola per tutte le disposizioni ( e il calcolo)
|
||||
for ( int nPhase = 1 ; nPhase <= GetPhaseCount() && bOk ; ++ nPhase) {
|
||||
Disposition* pDisp = ::GetDisposition( m_pGeomDB->GetUserObj( GetPhaseDisposition( nPhase))) ;
|
||||
if ( pDisp != nullptr && pDisp->Init( this) && pDisp->SetTable( sTable) && pDisp->ResetAreaOffset()) {
|
||||
if ( bUpdateDisp)
|
||||
bOk = SetCurrPhase( nPhase, true) && bOk ;
|
||||
}
|
||||
else
|
||||
bOk = false ;
|
||||
}
|
||||
SetCurrPhase( 1) ;
|
||||
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::GetTableRef( int nInd, Point3d& ptPos) const
|
||||
|
||||
+1
-1
@@ -414,7 +414,7 @@ MachMgr::AddRawPart( int nSurfId, Color cCol)
|
||||
// ne calcolo la silhouette secondo Z+
|
||||
POLYLINEVECTOR vPL ;
|
||||
bool bSilh = false ;
|
||||
if ( pStm->GetSilhouette( Z_AX, vPL) && vPL.size() > 0) {
|
||||
if ( pStm->GetSilhouette( Z_AX, 10.0, vPL) && vPL.size() > 0) {
|
||||
// cerco il contorno esterno
|
||||
int nInd = - 1 ;
|
||||
double dMaxArea = 0 ;
|
||||
|
||||
+25
-2
@@ -1,7 +1,7 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2015-2015
|
||||
// EgalTech 2015-2021
|
||||
//----------------------------------------------------------------------------
|
||||
// File : Machine.cpp Data : 06.05.15 Versione : 1.6e3
|
||||
// File : Machine.cpp Data : 14.10.21 Versione : 2.3j5
|
||||
// Contenuto : Implementazione gestione macchina.
|
||||
//
|
||||
//
|
||||
@@ -801,6 +801,22 @@ Machine::EnableHeadInSet( const string& sHead)
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Machine::ModifyMachineHeadAuxDirection( const string& sHead, const Vector3d& vtADir)
|
||||
{
|
||||
// controllo GeomDB
|
||||
if ( m_pGeomDB == nullptr)
|
||||
return false ;
|
||||
// recupero testa
|
||||
int nHeadId = GetGroup( sHead) ;
|
||||
Head* pHead = GetHead( nHeadId) ;
|
||||
if ( pHead == nullptr)
|
||||
return false ;
|
||||
// eseguo la modifica
|
||||
return pHead->ModifyHeadAuxDirection( vtADir) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Machine::AdjustExitFrames( int nLay, const MUEXITVECTOR& vMuExit, const Vector3d& vtADir)
|
||||
@@ -1081,6 +1097,13 @@ Machine::IsLinkedRawPart( int nRawId) const
|
||||
return ( find( m_vLinkedRawParts.begin(), m_vLinkedRawParts.end(), nRawId) != m_vLinkedRawParts.end()) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
const INTVECTOR&
|
||||
Machine:: GetAllLinkedRawParts( void) const
|
||||
{
|
||||
return m_vLinkedRawParts ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Machine::UnlinkRawPartFromGroup( int nRawPartId)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2015-2015
|
||||
// EgalTech 2015-2021
|
||||
//----------------------------------------------------------------------------
|
||||
// File : Machine.h Data : 06.05.15 Versione : 1.6e3
|
||||
// File : Machine.h Data : 14.10.21 Versione : 2.3j5
|
||||
// Contenuto : Dichiarazione della classe Machine.
|
||||
//
|
||||
//
|
||||
@@ -151,6 +151,7 @@ class Machine
|
||||
{ return m_nMachineLook ; }
|
||||
bool LinkRawPartToGroup( int nRawPartId, const std::string& sGroupName) ;
|
||||
bool IsLinkedRawPart( int nRawId) const ;
|
||||
const INTVECTOR& GetAllLinkedRawParts( void) const ;
|
||||
bool UnlinkRawPartFromGroup( int nRawPartId) ;
|
||||
bool UnlinkAllRawPartsFromGroups( void) ;
|
||||
bool LinkFixtureToGroup( int nFxtId, const std::string& sGroupName) ;
|
||||
@@ -230,6 +231,7 @@ class Machine
|
||||
const STRVECTOR& GetHSet( const std::string& sHead) const ;
|
||||
bool EnableHeadInSet( const std::string& sHead) ;
|
||||
bool LoadTool( Exit* pExit, const std::string& sTool) ;
|
||||
bool ModifyMachineHeadAuxDirection( const std::string& sHead, const Vector3d& vtADir) ;
|
||||
bool AdjustExitFrames( int nLay, const MUEXITVECTOR& vMuExit, const Vector3d& vtADir) ;
|
||||
bool CreateExitGroups( int nLay, const MUEXITVECTOR& vMuExit) ;
|
||||
bool ModifyMachineExitPosition( const std::string& sHead, int nExit, const Point3d& ptPos) ;
|
||||
@@ -310,6 +312,7 @@ class Machine
|
||||
static int LuaEmtModifyAxisDirection( lua_State* L) ;
|
||||
static int LuaEmtModifyAxisStroke( lua_State* L) ;
|
||||
static int LuaEmtModifyAxisHome( lua_State* L) ;
|
||||
static int LuaEmtModifyHeadAuxDirection( lua_State* L) ;
|
||||
static int LuaEmtModifyExitPosition( lua_State* L) ;
|
||||
static int LuaEmtAddRapidStart( lua_State* L) ;
|
||||
static int LuaEmtAddRapidMove( lua_State* L) ;
|
||||
@@ -319,6 +322,7 @@ class Machine
|
||||
static int LuaEmtGetAxesPos( lua_State* L) ;
|
||||
static int LuaEmtGetBackAuxDir( lua_State* L) ;
|
||||
static int LuaEmtLinkRawPartToGroup( lua_State* L) ;
|
||||
static int LuaEmtGetAllLinkedRawParts( lua_State* L) ;
|
||||
static int LuaEmtUnlinkRawPartFromGroup( lua_State* L) ;
|
||||
static int LuaEmtUnlinkAllRawPartsFromGroups( lua_State* L) ;
|
||||
static int LuaEmtLinkFixtureToGroup( lua_State* L) ;
|
||||
|
||||
+43
-5
@@ -1,7 +1,7 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2015-2020
|
||||
// EgalTech 2015-2021
|
||||
//----------------------------------------------------------------------------
|
||||
// File : MachineLua.cpp Data : 26.04.20 Versione : 2.2d4
|
||||
// File : MachineLua.cpp Data : 14.10.21 Versione : 2.3j5
|
||||
// Contenuto : Implementazione gestione macchina : funzioni Lua.
|
||||
//
|
||||
//
|
||||
@@ -93,8 +93,10 @@ Machine::LuaInit( const string& sMachineName)
|
||||
m_LuaMgr.RegisterFunction( "EmtModifyAxisDirection", Machine::LuaEmtModifyAxisDirection) ;
|
||||
m_LuaMgr.RegisterFunction( "EmtModifyAxisStroke", Machine::LuaEmtModifyAxisStroke) ;
|
||||
m_LuaMgr.RegisterFunction( "EmtModifyAxisHome", Machine::LuaEmtModifyAxisHome) ;
|
||||
m_LuaMgr.RegisterFunction( "EmtModifyHeadAuxDirection", Machine::LuaEmtModifyHeadAuxDirection) ;
|
||||
m_LuaMgr.RegisterFunction( "EmtModifyExitPosition", Machine::LuaEmtModifyExitPosition) ;
|
||||
m_LuaMgr.RegisterFunction( "EmtLinkRawPartToGroup", Machine::LuaEmtLinkRawPartToGroup) ;
|
||||
m_LuaMgr.RegisterFunction( "EmtGetAllLinkedRawParts", Machine::LuaEmtGetAllLinkedRawParts) ;
|
||||
m_LuaMgr.RegisterFunction( "EmtUnlinkRawPartFromGroup", Machine::LuaEmtUnlinkRawPartFromGroup) ;
|
||||
m_LuaMgr.RegisterFunction( "EmtUnlinkAllRawPartsFromGroups", Machine::LuaEmtUnlinkAllRawPartsFromGroups) ;
|
||||
m_LuaMgr.RegisterFunction( "EmtLinkFixtureToGroup", Machine::LuaEmtLinkFixtureToGroup) ;
|
||||
@@ -589,7 +591,7 @@ Machine::LuaEmtStdHead( lua_State* L)
|
||||
double dRot1W = 1 ;
|
||||
LuaGetTabFieldParam( L, 1, FLD_ROT1W, dRot1W) ;
|
||||
// lettura eventuale campo 'Rot2Stroke' dalla tabella
|
||||
STROKE Rot2Stroke{ -INFINITO, INFINITO} ;
|
||||
STROKE Rot2Stroke{{ -INFINITO, INFINITO}} ;
|
||||
LuaGetTabFieldParam( L, 1, FLD_ROT2STROKE, Rot2Stroke.v) ;
|
||||
// lettura eventuale campo 'SolCh' dalla tabella
|
||||
int nSolCh = MCH_SCC_NONE ;
|
||||
@@ -667,7 +669,7 @@ Machine::LuaEmtMultiHead( lua_State* L)
|
||||
double dRot1W = 1 ;
|
||||
LuaGetTabFieldParam( L, 1, FLD_ROT1W, dRot1W) ;
|
||||
// lettura eventuale campo 'Rot2Stroke' dalla tabella
|
||||
STROKE Rot2Stroke{ -INFINITO, INFINITO} ;
|
||||
STROKE Rot2Stroke{{ -INFINITO, INFINITO}} ;
|
||||
LuaGetTabFieldParam( L, 1, FLD_ROT2STROKE, Rot2Stroke.v) ;
|
||||
// lettura eventuale campo 'SolCh' dalla tabella
|
||||
int nSolCh = MCH_SCC_NONE ;
|
||||
@@ -734,7 +736,7 @@ Machine::LuaEmtSpecialHead( lua_State* L)
|
||||
double dRot1W = 1 ;
|
||||
LuaGetTabFieldParam( L, 1, FLD_ROT1W, dRot1W) ;
|
||||
// lettura eventuale campo 'Rot2Stroke' dalla tabella
|
||||
STROKE Rot2Stroke{ -INFINITO, INFINITO} ;
|
||||
STROKE Rot2Stroke{{ -INFINITO, INFINITO}} ;
|
||||
LuaGetTabFieldParam( L, 1, FLD_ROT2STROKE, Rot2Stroke.v) ;
|
||||
// lettura eventuale campo 'SolCh' dalla tabella
|
||||
int nSolCh = MCH_SCC_NONE ;
|
||||
@@ -903,6 +905,26 @@ Machine::LuaEmtModifyAxisHome( lua_State* L)
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
int
|
||||
Machine::LuaEmtModifyHeadAuxDirection( lua_State* L)
|
||||
{
|
||||
// 2 parametri : sHead, vtADir
|
||||
string sHead ;
|
||||
LuaCheckParam( L, 1, sHead)
|
||||
Vector3d vtADir ;
|
||||
LuaCheckParam( L, 2, vtADir)
|
||||
LuaClearStack( L) ;
|
||||
// verifico ci sia una macchina attiva
|
||||
if ( m_pMchLua == nullptr)
|
||||
return luaL_error( L, " Unknown Machine") ;
|
||||
// modifico la direzione ausiliaria della testa
|
||||
bool bOk = m_pMchLua->ModifyMachineHeadAuxDirection( sHead, vtADir) ;
|
||||
// assegno risultato
|
||||
LuaSetParam( L, bOk) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
int
|
||||
Machine::LuaEmtModifyExitPosition( lua_State* L)
|
||||
@@ -963,6 +985,22 @@ Machine::LuaEmtUnlinkRawPartFromGroup( lua_State* L)
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
int
|
||||
Machine::LuaEmtGetAllLinkedRawParts( lua_State* L)
|
||||
{
|
||||
// nessun parametro
|
||||
LuaClearStack( L) ;
|
||||
// verifico ci sia una macchina attiva
|
||||
if ( m_pMchLua == nullptr)
|
||||
return luaL_error( L, " Unknown Machine") ;
|
||||
// recupero l'elenco dei grezzi agganciati ad un gruppo macchina
|
||||
const INTVECTOR& vLinkedRawParts = m_pMchLua->GetAllLinkedRawParts() ;
|
||||
// assegno risultato
|
||||
LuaSetParam( L, vLinkedRawParts) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
int
|
||||
Machine::LuaEmtUnlinkAllRawPartsFromGroups( lua_State* L)
|
||||
|
||||
+315
-8
@@ -311,7 +311,7 @@ MachiningsMgr::LoadGeneral( Scanner& TheScanner, bool& bEnd)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachiningsMgr::LoadOneMachining( Scanner& TheScanner, bool& bEnd)
|
||||
MachiningsMgr::LoadOneMachining( Scanner& TheScanner, bool& bEnd, MachiningData** ppMch)
|
||||
{
|
||||
// leggo la prossima linea
|
||||
string sLine ;
|
||||
@@ -324,7 +324,7 @@ MachiningsMgr::LoadOneMachining( Scanner& TheScanner, bool& bEnd)
|
||||
if ( sLine.front() != '[' || sLine.back() != ']')
|
||||
return false ;
|
||||
Trim( sLine, "[]") ;
|
||||
// separo tipo da contatore
|
||||
// separo tipo da contatore
|
||||
string sType, sCount ;
|
||||
SplitFirst( sLine, "_", sType, sCount) ;
|
||||
ToUpper( sType) ;
|
||||
@@ -367,9 +367,13 @@ MachiningsMgr::LoadOneMachining( Scanner& TheScanner, bool& bEnd)
|
||||
// verifico di aver letto tutti i campi
|
||||
bOk = bOk && ( Flag.count() == nSize) ;
|
||||
// salvo i dati della lavorazione
|
||||
bOk = bOk && m_umData.emplace( pMch->m_Uuid, Get( pMch)).second ;
|
||||
bOk = bOk && m_suData.emplace( pMch->m_sName, pMch->m_Uuid).second ;
|
||||
Release( pMch) ;
|
||||
if ( ppMch == nullptr ) {
|
||||
bOk = bOk && m_umData.emplace( pMch->m_Uuid, Get( pMch)).second ;
|
||||
bOk = bOk && m_suData.emplace( pMch->m_sName, pMch->m_Uuid).second ;
|
||||
Release( pMch) ;
|
||||
}
|
||||
else
|
||||
*ppMch = Release( pMch) ;
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
@@ -438,7 +442,7 @@ MachiningsMgr::Save( bool bCompressed) const
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachiningsMgr::SaveHeader( Writer& TheWriter) const
|
||||
MachiningsMgr::SaveHeader( Writer& TheWriter, const int nTotal) const
|
||||
{
|
||||
// scrivo l'intestazione
|
||||
bool bOk = true ;
|
||||
@@ -447,7 +451,10 @@ MachiningsMgr::SaveHeader( Writer& TheWriter) const
|
||||
bOk = bOk && TheWriter.OutText( sOut) ;
|
||||
sOut = MF_VERSION + "=" + ToString( m_nDbVer) ;
|
||||
bOk = bOk && TheWriter.OutText( sOut) ;
|
||||
sOut = MF_TOTAL + "=" + ToString( int( m_umData.size())) ;
|
||||
if ( nTotal == -1)
|
||||
sOut = MF_TOTAL + "=" + ToString( int( m_umData.size())) ;
|
||||
else
|
||||
sOut = MF_TOTAL + "=" + ToString( nTotal) ;
|
||||
bOk = bOk && TheWriter.OutText( sOut) ;
|
||||
return bOk ;
|
||||
}
|
||||
@@ -514,7 +521,7 @@ MachiningsMgr::SaveOneMachining( const EgtUUID& Uuid, int& nCounter, Writer& The
|
||||
bool
|
||||
MachiningsMgr::GetMachiningNewName( string& sName) const
|
||||
{
|
||||
// il parametro nome deve essere valido
|
||||
// il parametro nome deve essere valido
|
||||
if ( &sName == nullptr)
|
||||
return false ;
|
||||
// se nome vuoto, assegno radice standard
|
||||
@@ -1168,3 +1175,303 @@ MachiningsMgr::SetMaxDepthSafe( double dSafe)
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachiningsMgr::Export( const STRVECTOR& vsMachiningsNames, const string& sOutFile, bool bCompressed) const
|
||||
{
|
||||
LOG_INFO( GetEMkLogger(), ( "Export Machinings " + sOutFile).c_str()) ;
|
||||
|
||||
// conto le lavorazioni da esportare
|
||||
int nMachinings = 0 ;
|
||||
for ( size_t i = 0 ; i < vsMachiningsNames.size() ; i ++) {
|
||||
if ( m_suData.find( vsMachiningsNames[i]) != m_suData.end())
|
||||
nMachinings ++ ;
|
||||
}
|
||||
|
||||
// inizializzo il writer
|
||||
Writer TheWriter ;
|
||||
if ( ! TheWriter.Init( sOutFile, bCompressed)) {
|
||||
LOG_ERROR( GetEMkLogger(), " Error Exporting Machinings on Init") ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
// scrivo linea di inizio file
|
||||
string sOut = "; --- " + sOutFile + " " + CurrDateTime() + " ---" ;
|
||||
if ( ! TheWriter.OutText( sOut)) {
|
||||
LOG_ERROR( GetEMkLogger(), " Error Exporting Machinings on Start") ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
// scrivo l'intestazione
|
||||
if ( ! SaveHeader( TheWriter, nMachinings)) {
|
||||
LOG_ERROR( GetEMkLogger(), " Error Exporting Machinings on Header") ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
// scrivo i dati generali
|
||||
if ( m_nDbVer >= 1002 && ! SaveGeneral( TheWriter)) {
|
||||
LOG_ERROR( GetEMkLogger(), " Error Exporting Machinings on General") ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
// ciclo su tutti i nomi delle lavorazioni da esportare
|
||||
int nCounter = 0 ;
|
||||
for ( size_t i = 0 ; i < vsMachiningsNames.size() ; i ++) {
|
||||
auto it = m_suData.find( vsMachiningsNames[i]) ;
|
||||
// se la lavorazione non esiste passo alla sucessiva
|
||||
if ( it == m_suData.end()) {
|
||||
string sOut = " Warning Exporting Machinings : " + vsMachiningsNames[i] + " not found. Machining is ignored." ;
|
||||
LOG_ERROR( GetEMkLogger(), sOut.c_str()) ;
|
||||
continue ;
|
||||
}
|
||||
// esporto la singola lavorazione
|
||||
if ( ! SaveOneMachining( it->second, nCounter, TheWriter)) {
|
||||
string sOut = " Error Exporting Machining " + it->first ;
|
||||
LOG_ERROR( GetEMkLogger(), sOut.c_str()) ;
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
|
||||
// scrivo linea di fine file
|
||||
if ( ! TheWriter.OutText( "; --- End ---")) {
|
||||
LOG_ERROR( GetEMkLogger(), " Error Exporting Machinings on End") ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
// chiudo la scrittura
|
||||
TheWriter.Close() ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachiningsMgr::ToBeImported( const string& sFile, STRVECTOR& vsMachiningsNames, INTVECTOR& vMachiningsTypes)
|
||||
{
|
||||
// inizializzo lo scanner
|
||||
Scanner TheScanner ;
|
||||
if ( ! TheScanner.Init( sFile, ";")) {
|
||||
LOG_ERROR( GetEMkLogger(), "Machinings ToBeImported : Error on Init") ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
// leggo l'intestazione
|
||||
int nVersion = 0 ;
|
||||
int nTotal = 0 ;
|
||||
bool bEnd = false ;
|
||||
if ( ! LoadHeader( TheScanner, nVersion, nTotal, bEnd)) {
|
||||
LOG_ERROR( GetEMkLogger(), "Machinings ToBeImported : Error on Header") ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
string sLine ;
|
||||
if ( ! TheScanner.GetLine( sLine))
|
||||
return true ; // il file è finito, esco
|
||||
|
||||
// parte generale
|
||||
if ( sLine == MF_GENERAL) {
|
||||
// scorro le linee fino ad arrivare alla sezione successiva
|
||||
while ( TheScanner.GetLine( sLine)) {
|
||||
if ( sLine.front() == '[' && sLine.back() == ']')
|
||||
break ;
|
||||
}
|
||||
// se non c'è una sezione successiva esco
|
||||
if ( sLine.empty())
|
||||
return true ;
|
||||
}
|
||||
else if ( nVersion >= 1002) {
|
||||
LOG_ERROR( GetEMkLogger(), "Machinings ToBeImported : General section missing") ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
bool bMachiningName = false ;
|
||||
bool bAdd = true ;
|
||||
string sName ;
|
||||
int nType = 0 ;
|
||||
|
||||
TheScanner.UngetLine( sLine) ;
|
||||
while ( TheScanner.GetLine( sLine)) {
|
||||
if ( sLine.front() == '[' && sLine.back() == ']') { // se è intestazione
|
||||
// aggiungo lavorazione precedente se ok
|
||||
if ( bAdd && bMachiningName && nType != 0) {
|
||||
vsMachiningsNames.push_back( sName) ;
|
||||
vMachiningsTypes.push_back( nType) ;
|
||||
}
|
||||
bMachiningName = false ;
|
||||
bAdd = true ;
|
||||
|
||||
// salvo il tipo di lavorazione
|
||||
Trim( sLine, "[]") ;
|
||||
string sType, sCount ;
|
||||
SplitFirst( sLine, "_", sType, sCount) ;
|
||||
ToUpper( sType) ;
|
||||
nType = MCHDATA_NAMETOTYPE( sType) ;
|
||||
}
|
||||
else {
|
||||
string sKey, sVal ;
|
||||
SplitFirst( sLine, "=", sKey, sVal) ;
|
||||
if ( ToUpper( sKey) == "NAME") {
|
||||
if ( ! bMachiningName) {
|
||||
bMachiningName = true ;
|
||||
sName = sVal ;
|
||||
}
|
||||
else // se lavorazione ha più nomi è errore, non deve essere importata
|
||||
bAdd = false ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// aggiungo ultima lavorazione se ok
|
||||
if ( bAdd && bMachiningName && nType != 0) {
|
||||
vsMachiningsNames.push_back( sName) ;
|
||||
vMachiningsTypes.push_back( nType) ;
|
||||
}
|
||||
|
||||
if ( vsMachiningsNames.size() != vMachiningsTypes.size())
|
||||
return false ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachiningsMgr::Import( const string& sFile, const STRVECTOR& vsMachiningsToImport, const STRVECTOR& vsMachiningsNames, STRVECTOR& vsImported)
|
||||
{
|
||||
LOG_INFO( GetEMkLogger(), ( "Import Machinings : " + sFile).c_str()) ;
|
||||
|
||||
for ( size_t i = 0 ; i < vsMachiningsNames.size() ; i ++) {
|
||||
// se esiste già nel DB una lavorazione con lo stesso nome la rimuovo
|
||||
if ( m_suData.find( vsMachiningsNames[i]) != m_suData.end()) {
|
||||
bool bOk = RemoveMachining( vsMachiningsNames[i]) ;
|
||||
if ( ! bOk) {
|
||||
LOG_ERROR( GetEMkLogger(), ( " Error Importing Machinings : removing " + vsMachiningsNames[i] + " failed" ).c_str()) ;
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// verfico che il nome non sia ripetuto nella lista dei vsMachiningsNames
|
||||
if ( i != vsMachiningsNames.size() - 1 &&
|
||||
find( vsMachiningsNames.begin() + i + 1, vsMachiningsNames.end(), vsMachiningsNames[i]) != vsMachiningsNames.end()) {
|
||||
LOG_ERROR( GetEMkLogger(), ( " Error Importing Machinings : name \"" + vsMachiningsNames[i] + "\" is already used").c_str()) ;
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
|
||||
// inizializzo lo scanner
|
||||
Scanner TheScanner ;
|
||||
if ( ! TheScanner.Init( sFile, ";")) {
|
||||
LOG_ERROR( GetEMkLogger(), " Error Importing Machinings on Init") ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
// leggo l'intestazione
|
||||
int nVersion = 0 ;
|
||||
int nTotal = 0 ;
|
||||
bool bEnd ;
|
||||
if ( ! LoadHeader( TheScanner, nVersion, nTotal, bEnd)) {
|
||||
LOG_ERROR( GetEMkLogger(), " Error Importing Machinings on Header") ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
// leggo i dati generali (da versione 1002) e li confronto con quelli della classe
|
||||
if ( nVersion >= 1002 && ! CheckGeneral( TheScanner, bEnd)) {
|
||||
LOG_ERROR( GetEMkLogger(), " Error Importing Machinings on General") ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
// ciclo di lettura delle lavorazioni
|
||||
while ( ! bEnd) {
|
||||
MachiningData* pMch = nullptr ;
|
||||
if ( ! LoadOneMachining( TheScanner, bEnd, &pMch) || pMch == nullptr)
|
||||
// se errore nel leggere la lavorazione, proseguo con la successiva
|
||||
continue ;
|
||||
|
||||
auto it = find( vsMachiningsToImport.begin(), vsMachiningsToImport.end(), pMch->m_sName) ;
|
||||
// se la lavorazione non deve essere importata proseguo con la successiva
|
||||
if ( it == vsMachiningsToImport.end())
|
||||
continue ;
|
||||
|
||||
// assegno il nuovo nome
|
||||
pMch->m_sName = vsMachiningsNames[ it - vsMachiningsToImport.begin()] ;
|
||||
// se il suo UUID esiste già nel DB lo modifico
|
||||
if ( m_umData.find( pMch->m_Uuid) != m_umData.end()) {
|
||||
LOG_ERROR( GetEMkLogger(), ( " Warning Importing Machinings: " + pMch->m_sName + " UUID changed").c_str()) ;
|
||||
CreateEgtUUID( pMch->m_Uuid) ;
|
||||
}
|
||||
|
||||
// aggiungo la lavorazione
|
||||
bool bOk = m_umData.emplace( pMch->m_Uuid, pMch).second ;
|
||||
bOk = bOk && m_suData.emplace( pMch->m_sName, pMch->m_Uuid).second ;
|
||||
if ( ! bOk) {
|
||||
LOG_ERROR( GetEMkLogger(), ( " Error Importing Machinings : adding " + pMch->m_sName + " failed" ).c_str()) ;
|
||||
continue ;
|
||||
}
|
||||
vsImported.push_back( pMch->m_sName) ;
|
||||
}
|
||||
|
||||
if ( ! vsImported.empty())
|
||||
m_bModified = true ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachiningsMgr::CheckGeneral( Scanner& TheScanner, bool& bEnd) const
|
||||
{
|
||||
// leggo la prossima linea
|
||||
string sLine ;
|
||||
if ( ! TheScanner.GetLine( sLine)) {
|
||||
// fine file
|
||||
bEnd = true ;
|
||||
return true ;
|
||||
}
|
||||
// deve essere dati generali
|
||||
if ( sLine != MF_GENERAL)
|
||||
return false ;
|
||||
bool bOk = true ;
|
||||
// leggo le linee successive
|
||||
bEnd = true ;
|
||||
while ( bOk && TheScanner.GetLine( sLine)) {
|
||||
// se sezione successiva
|
||||
if ( sLine.front() == '[' && sLine.back() == ']') {
|
||||
TheScanner.UngetLine( sLine) ;
|
||||
bEnd = false ;
|
||||
break ;
|
||||
}
|
||||
// separo chiave da valore
|
||||
string sKey, sVal ;
|
||||
bool bVal ;
|
||||
int nVal ;
|
||||
double dVal ;
|
||||
SplitFirst( sLine, "=", sKey, sVal) ;
|
||||
// riconosco la chiave e verifico che il valore corrisponda a quello salvato nella classe
|
||||
if ( ToUpper( sKey) == MF_3AXCOMP)
|
||||
bOk = FromString( sVal, bVal) && bVal == m_b3AxComp ;
|
||||
else if ( ToUpper( sKey) == MF_5AXCOMP)
|
||||
bOk = FromString( sVal, bVal) && bVal == m_b5AxComp ;
|
||||
else if ( ToUpper( sKey) == MF_SAFEZ)
|
||||
bOk = FromString( sVal, dVal) && abs( m_dSafeZ - dVal) < EPS_SMALL ;
|
||||
else if ( ToUpper( sKey) == MF_SAFEAGGRBOTTZ)
|
||||
bOk = FromString( sVal, dVal) && abs( m_dSafeAggrBottZ - dVal) < EPS_SMALL ;
|
||||
else if ( ToUpper( sKey) == MF_EXTRALCR)
|
||||
bOk = FromString( sVal, dVal) && abs( m_dExtraLOnCutRegion - dVal) < EPS_SMALL ;
|
||||
else if ( ToUpper( sKey) == MF_EXTRARDR)
|
||||
bOk = FromString( sVal, dVal) && abs( m_dExtraROnDrillRegion - dVal) < EPS_SMALL ;
|
||||
else if ( ToUpper( sKey) == MF_HOLEDTOL)
|
||||
bOk = FromString( sVal, dVal) && abs( m_dHoleDiamToler - dVal) < EPS_SMALL ;
|
||||
else if ( ToUpper( sKey) == MF_EXTSAWARCMINRAD)
|
||||
bOk = FromString( sVal, dVal) && abs( m_dExtSawArcMinRad - dVal) < EPS_SMALL ;
|
||||
else if ( ToUpper( sKey) == MF_INTSAWARCMAXSIDEANG)
|
||||
bOk = FromString( sVal, dVal) && abs( m_dIntSawArcMaxSideAng - dVal) < EPS_SMALL ;
|
||||
else if ( ToUpper( sKey) == MF_SPLITARCS)
|
||||
bOk = FromString( sVal, nVal) && m_nSplitArcs == nVal ;
|
||||
else if ( ToUpper( sKey) == MF_MAXDEPTHSAFE)
|
||||
bOk = FromString( sVal, dVal) && abs( m_dMaxDepthSafe - dVal) < EPS_SMALL ;
|
||||
else
|
||||
bOk = true ;
|
||||
}
|
||||
|
||||
return bOk ;
|
||||
}
|
||||
+6
-2
@@ -29,6 +29,9 @@ class MachiningsMgr
|
||||
bool Load( const std::string& sMachsFile, const ToolsMgr* pTsMgr) ;
|
||||
bool Reload( void) ;
|
||||
bool Save( bool bCompressed = true) const ;
|
||||
bool Export( const STRVECTOR& vsMachiningsNames, const std::string& sOutFile, bool bCompressed = true) const ;
|
||||
bool ToBeImported( const std::string& sFile, STRVECTOR& vsMachiningsNames, INTVECTOR& vMachiningsTypes) ;
|
||||
bool Import( const std::string& sFile, const STRVECTOR& vsMachiningsToImport, const STRVECTOR& vsMachiningsNames, STRVECTOR& vsImported) ;
|
||||
bool GetMachiningNewName( std::string& sName) const ;
|
||||
bool AddMachining( const std::string& sName, int nType) ;
|
||||
bool CopyMachining( const std::string& sSource, const std::string& sName) ;
|
||||
@@ -86,8 +89,9 @@ class MachiningsMgr
|
||||
bool Clear( bool bReset) ;
|
||||
bool LoadHeader( Scanner& TheScanner, int& nVersion, int& nTotal, bool& bEnd) ;
|
||||
bool LoadGeneral( Scanner& TheScanner, bool& bEnd) ;
|
||||
bool LoadOneMachining( Scanner& TheScanner, bool& bEnd) ;
|
||||
bool SaveHeader( Writer& TheWriter) const ;
|
||||
bool CheckGeneral( Scanner& TheScanner, bool& bEnd) const ;
|
||||
bool LoadOneMachining( Scanner& TheScanner, bool& bEnd, MachiningData** ppMch = nullptr) ;
|
||||
bool SaveHeader( Writer& TheWriter, const int nTotal = -1) const ;
|
||||
bool SaveGeneral( Writer& TheWriter) const ;
|
||||
bool SaveOneMachining( const EgtUUID& Uuid, int& nCounter, Writer& TheWriter) const ;
|
||||
bool VerifyCurrMachining( int nType, std::string& sName) const ;
|
||||
|
||||
+162
-74
@@ -823,14 +823,7 @@ Milling::Update( bool bPostApply)
|
||||
}
|
||||
|
||||
// imposto eventuale asse bloccato da lavorazione
|
||||
if ( ! m_Params.m_sBlockedAxis.empty()) {
|
||||
string sAxis, sVal ;
|
||||
Split( m_Params.m_sBlockedAxis, "=", true, sAxis, sVal) ;
|
||||
double dVal = 0 ;
|
||||
FromString( sVal, dVal) ;
|
||||
m_pMchMgr->ClearRotAxisBlock() ;
|
||||
m_pMchMgr->SetRotAxisBlock( sAxis, dVal) ;
|
||||
}
|
||||
SetBlockedRotAxis( m_Params.m_sBlockedAxis) ;
|
||||
|
||||
// calcolo gli assi macchina
|
||||
string sHint = ExtractHint( m_Params.m_sUserNotes) ;
|
||||
@@ -1480,7 +1473,7 @@ Milling::AdjustEndPointForAxesCalc( const CamData* pCamData, Point3d& ptP) const
|
||||
// se utensile lama
|
||||
if ( ( m_TParams.m_nType & TF_SAWBLADE) != 0) {
|
||||
// traslazione opposta a quanto fatto in AdjustPathDrawForSaw
|
||||
double dOffset = 0.5 * m_TParams.m_dTDiam - 10 * EPS_SMALL ;
|
||||
double dOffset = 0.5 * m_TParams.m_dDiam - 10 * EPS_SMALL ;
|
||||
ptP.Translate( dOffset * pCamData->GetCorrDir()) ;
|
||||
}
|
||||
// negli altri casi, non devo fare alcunché
|
||||
@@ -1501,7 +1494,7 @@ Milling::AdjustArcCenterForAxesCalc( const CamData* pCamData, Point3d& ptCen) co
|
||||
// se versori correzione uguali, correggo il centro
|
||||
if ( AreSameVectorApprox( pCamData->GetCorrDir(), pPrevCamData->GetCorrDir())) {
|
||||
// traslazione opposta a quanto fatto in AdjustPathDrawForSaw
|
||||
double dOffset = 0.5 * m_TParams.m_dTDiam - 10 * EPS_SMALL ;
|
||||
double dOffset = 0.5 * m_TParams.m_dDiam - 10 * EPS_SMALL ;
|
||||
ptCen.Translate( dOffset * pCamData->GetCorrDir()) ;
|
||||
}
|
||||
}
|
||||
@@ -1943,7 +1936,7 @@ Milling::AdjustPathDrawForSaw( int nClPathId)
|
||||
if ( ( m_TParams.m_nType & TF_SAWBLADE) == 0)
|
||||
return true ;
|
||||
// porto il percorso praticamente sull'estremo della lama ( appena meno per evitare di trasformare archi in punti)
|
||||
double dOffset = 0.5 * m_TParams.m_dTDiam - 10 * EPS_SMALL ;
|
||||
double dOffset = 0.5 * m_TParams.m_dDiam - 10 * EPS_SMALL ;
|
||||
Vector3d vtPrevCorr ;
|
||||
for ( int nId = m_pGeomDB->GetFirstInGroup( nClPathId) ;
|
||||
nId != GDB_ID_NULL ;
|
||||
@@ -2237,16 +2230,21 @@ Milling::AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTo
|
||||
// determino se l'inizio dell'attacco è fuori dal grezzo
|
||||
bool bOutStart = GetPointOutOfRaw( ptP1, vtTool, dElev, dSafeZ) ;
|
||||
// determino se l'inizio dell'attacco è sopra il grezzo
|
||||
bool bAboveStart = m_bAboveHead && GetPointAboveRaw( ptP1, vtTool) ;
|
||||
bool bGeomAboveStart = GetPointAboveRaw( ptP1, vtTool) ;
|
||||
bool bAboveStart = ( m_bAboveHead && bGeomAboveStart) ;
|
||||
// imposto versore correzione e ausiliario sul punto di partenza
|
||||
CalcAndSetCorrAuxDir( pCompo, i) ;
|
||||
// aggiungo approccio per frese normali
|
||||
if ( ( m_TParams.m_nType & TF_SAWBLADE) == 0) {
|
||||
// correggo elevazione iniziale per punto inizio attacco (se testa da sopra senza aggregato approccio mai Z-)
|
||||
if ( m_bAboveHead && ! m_bAggrBottom && vtTool.z < - EPS_SMALL)
|
||||
dStElev -= ScalarXY( (ptP1 - ptStart), vtTool) ;
|
||||
else
|
||||
dStElev -= ( ptP1 - ptStart) * vtTool ;
|
||||
Vector3d vtEscape = vtTool ;
|
||||
if ( m_bAboveHead && ! m_bAggrBottom && vtTool.z < - EPS_SMALL) {
|
||||
vtEscape.z = 0 ;
|
||||
vtEscape.Normalize() ;
|
||||
}
|
||||
double dNewStElev ;
|
||||
if ( GetElevation( m_nPhase, ptP1 - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), vtEscape, dNewStElev) && dNewStElev > EPS_SMALL)
|
||||
dStElev = min( dStElev, dNewStElev) ;
|
||||
// determino se l'inizio dell'attacco è esattamente sotto il grezzo, nel qual caso ricalcolo l'elevazione
|
||||
bool bUnderStart = m_bAboveHead && GetPointUnderRaw( ptP1, vtTool, 0,
|
||||
GetRadiusForStartEndElevation(), m_TParams.m_dLen, false, dSafeZ, dStElev) ;
|
||||
@@ -2269,7 +2267,7 @@ Milling::AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTo
|
||||
double dSawStartElev = 0 ;
|
||||
bool bUnderStart = m_bAboveHead && GetPointUnderRaw( ptP1, vtTool, m_TParams.m_dTDiam / 2,
|
||||
GetRadiusForStartEndElevation( false), m_TParams.m_dLen, true, dSafeZ, dSawStartElev) ;
|
||||
if ( ! bUnderStart && bOk) {
|
||||
if ( ! bGeomAboveStart && ! bUnderStart && bOk) {
|
||||
m_pMchMgr->SetLastError( 2314, "Error in Milling : LeadIn must be out of rawpart") ;
|
||||
bOk = false ;
|
||||
}
|
||||
@@ -2356,10 +2354,14 @@ Milling::AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTo
|
||||
// determino se la fine dell'uscita è sopra il grezzo
|
||||
bool bAboveEnd = m_bAboveHead && GetPointAboveRaw( ptP1, vtTool) ;
|
||||
// correggo elevazione finale per punto fine uscita (se testa da sopra senza aggregato approccio mai Z-)
|
||||
if ( m_bAboveHead && ! m_bAggrBottom && vtTool.z < - EPS_SMALL)
|
||||
dEndElev -= ScalarXY( (ptP1 - ptEnd), vtTool) ;
|
||||
else
|
||||
dEndElev -= ( ptP1 - ptEnd) * vtTool ;
|
||||
Vector3d vtEscape = vtTool ;
|
||||
if ( m_bAboveHead && ! m_bAggrBottom && vtTool.z < - EPS_SMALL) {
|
||||
vtEscape.z = 0 ;
|
||||
vtEscape.Normalize() ;
|
||||
}
|
||||
double dNewEndElev ;
|
||||
if ( GetElevation( m_nPhase, ptP1 - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), vtEscape, dNewEndElev) && dNewEndElev > EPS_SMALL)
|
||||
dEndElev = min( dEndElev, dNewEndElev) ;
|
||||
// determino se l'inizio dell'uscita è esattamente sotto il grezzo, nel qual caso ricalcolo l'elevazione
|
||||
bool bUnderEnd = m_bAboveHead && GetPointUnderRaw( ptP1, vtTool, 0,
|
||||
GetRadiusForStartEndElevation(), m_TParams.m_dLen, false, dSafeZ, dEndElev) ;
|
||||
@@ -2374,11 +2376,13 @@ Milling::AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTo
|
||||
// verifico di uscire in aria
|
||||
bool bOutEnd = GetPointOutOfRaw( ptP1, vtTool, dElev, dSafeZ) ;
|
||||
if ( ! bOutEnd) {
|
||||
// verifico se sono sopra
|
||||
bool bGeomAboveEnd = GetPointAboveRaw( ptP1, vtTool) ;
|
||||
// verifico se sono sotto
|
||||
double dSawEndElev = 0 ;
|
||||
bool bUnderEnd = m_bAboveHead && GetPointUnderRaw( ptP1, vtTool, m_TParams.m_dTDiam / 2,
|
||||
GetRadiusForStartEndElevation( false), m_TParams.m_dLen, true, dSafeZ, dSawEndElev) ;
|
||||
if ( ! bUnderEnd && bOk) {
|
||||
if ( ! bGeomAboveEnd && ! bUnderEnd && bOk) {
|
||||
m_pMchMgr->SetLastError( 2324, "Error in Milling : LeadOut must be out of rawpart") ;
|
||||
bOk = false ;
|
||||
}
|
||||
@@ -2462,7 +2466,7 @@ Milling::AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
double dStElev ;
|
||||
if ( j == 1) {
|
||||
if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), vtTool, dStElev))
|
||||
dStElev = dElev ;
|
||||
dStElev = dStep ;
|
||||
}
|
||||
else
|
||||
dStElev = dStep - LIO_ELEV_TOL - 10 * EPS_SMALL ;
|
||||
@@ -2479,10 +2483,14 @@ Milling::AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
// se primo step aggiungo approccio per frese normali
|
||||
if ( j == 1 && ( m_TParams.m_nType & TF_SAWBLADE) == 0) {
|
||||
// correggo elevazione iniziale per punto inizio attacco (se testa da sopra senza aggregato approccio mai Z-)
|
||||
if ( m_bAboveHead && ! m_bAggrBottom && vtTool.z < - EPS_SMALL)
|
||||
dStElev -= ScalarXY( (ptP1 - ptStart), vtTool) ;
|
||||
else
|
||||
dStElev -= ( ptP1 - ptStart) * vtTool ;
|
||||
Vector3d vtEscape = vtTool ;
|
||||
if ( m_bAboveHead && ! m_bAggrBottom && vtTool.z < - EPS_SMALL) {
|
||||
vtEscape.z = 0 ;
|
||||
vtEscape.Normalize() ;
|
||||
}
|
||||
double dNewStElev ;
|
||||
if ( GetElevation( m_nPhase, ptP1 - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), vtEscape, dNewStElev) && dNewStElev > EPS_SMALL)
|
||||
dStElev = min( dStElev, dNewStElev) ;
|
||||
// determino se l'inizio dell'attacco è esattamente sotto il grezzo, nel qual caso ricalcolo l'elevazione
|
||||
bool bUnderStart = m_bAboveHead && GetPointUnderRaw( ptP1, vtTool, 0,
|
||||
GetRadiusForStartEndElevation(), m_TParams.m_dLen, false, dSafeZ, dStElev) ;
|
||||
@@ -2606,10 +2614,14 @@ Milling::AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
// determino se la fine dell'uscita è sopra il grezzo
|
||||
bool bAboveEnd = m_bAboveHead && GetPointAboveRaw( ptP1, vtTool) ;
|
||||
// correggo elevazione finale per punto fine uscita (se testa da sopra senza aggregato approccio mai Z-)
|
||||
if ( m_bAboveHead && ! m_bAggrBottom && vtTool.z < - EPS_SMALL)
|
||||
dEndElev -= ScalarXY( (ptP1 - ptEnd), vtTool) ;
|
||||
else
|
||||
dEndElev -= ( ptP1 - ptEnd) * vtTool ;
|
||||
Vector3d vtEscape = vtTool ;
|
||||
if ( m_bAboveHead && ! m_bAggrBottom && vtTool.z < - EPS_SMALL) {
|
||||
vtEscape.z = 0 ;
|
||||
vtEscape.Normalize() ;
|
||||
}
|
||||
double dNewEndElev ;
|
||||
if ( GetElevation( m_nPhase, ptP1 - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), vtEscape, dNewEndElev) && dNewEndElev > EPS_SMALL)
|
||||
dEndElev = min( dEndElev, dNewEndElev) ;
|
||||
// determino se l'inizio dell'uscita è esattamente sotto il grezzo, nel qual caso ricalcolo l'elevazione
|
||||
bool bUnderEnd = m_bAboveHead && GetPointUnderRaw( ptP1, vtTool, 0,
|
||||
GetRadiusForStartEndElevation(), m_TParams.m_dLen, false, dSafeZ, dEndElev) ;
|
||||
@@ -2657,12 +2669,12 @@ Milling::AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
int nLoType = GetLeadOutType() ;
|
||||
if ( nLiType == MILL_LI_NONE && ( nLoType == MILL_LO_NONE || nLoType == MILL_LO_AS_LI))
|
||||
bMidRetract = false ;
|
||||
if ( ( nLiType == MILL_LI_TANGENT || nLiType == MILL_LI_LINEAR) &&
|
||||
if ( ( nLiType == MILL_LI_TANGENT || nLiType == MILL_LI_LINEAR || nLiType == MILL_LI_TG_PERP) &&
|
||||
nLoType == MILL_LO_AS_LI &&
|
||||
abs( m_Params.m_dLiTang) < EPS_SMALL)
|
||||
bMidRetract = false ;
|
||||
if ( ( nLiType == MILL_LI_TANGENT || nLiType == MILL_LI_LINEAR) &&
|
||||
( nLoType == MILL_LO_TANGENT || nLoType == MILL_LO_LINEAR) &&
|
||||
if ( ( nLiType == MILL_LI_TANGENT || nLiType == MILL_LI_LINEAR || nLiType == MILL_LI_TG_PERP) &&
|
||||
( nLoType == MILL_LO_TANGENT || nLoType == MILL_LO_LINEAR || nLoType == MILL_LO_PERP_TG) &&
|
||||
abs( m_Params.m_dLiTang) < EPS_SMALL &&
|
||||
abs( m_Params.m_dLoTang) < EPS_SMALL &&
|
||||
abs( m_Params.m_dLiPerp - m_Params.m_dLoPerp) < EPS_SMALL)
|
||||
@@ -2718,6 +2730,8 @@ Milling::AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
double dStElev ;
|
||||
if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), vtTool, dStElev))
|
||||
dStElev = dElev ;
|
||||
if ( ! bAboveStartEnd)
|
||||
dStElev = max( dStElev, j * dStep) ;
|
||||
// determino inizio attacco
|
||||
if ( ! CalcLeadInStart( ptStart, vtStart, vtTool, dStElev, false, pCompo, ptP1))
|
||||
return false ;
|
||||
@@ -2726,10 +2740,19 @@ Milling::AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
// aggiungo approccio per frese normali
|
||||
if ( ( m_TParams.m_nType & TF_SAWBLADE) == 0) {
|
||||
// correggo elevazione iniziale per punto inizio attacco (se testa da sopra senza aggregato approccio mai Z-)
|
||||
if ( m_bAboveHead && ! m_bAggrBottom && vtTool.z < - EPS_SMALL)
|
||||
dStElev -= ScalarXY( (ptP1 - ptStart), vtTool) ;
|
||||
else
|
||||
dStElev -= ( ptP1 - ptStart) * vtTool ;
|
||||
Point3d ptP1m = ptP1 - 10 * EPS_SMALL * vtTool ;
|
||||
Vector3d vtEscape = vtTool ;
|
||||
if ( m_bAboveHead && ! m_bAggrBottom && vtTool.z < - EPS_SMALL) {
|
||||
vtEscape.z = 0 ;
|
||||
vtEscape.Normalize() ;
|
||||
}
|
||||
double dNewStElev ;
|
||||
if ( GetElevation( m_nPhase, ptP1m, vtTool, GetRadiusForStartEndElevation(), vtEscape, dNewStElev) && dNewStElev > EPS_SMALL) {
|
||||
if ( bAboveStartEnd)
|
||||
dStElev = min( dStElev, dNewStElev) ;
|
||||
else
|
||||
dStElev = max( dStElev, dNewStElev) ;
|
||||
}
|
||||
// determino se l'inizio dell'attacco è esattamente sotto il grezzo, nel qual caso ricalcolo l'elevazione
|
||||
bool bUnderStart = m_bAboveHead && GetPointUnderRaw( ptP1, vtTool, 0,
|
||||
GetRadiusForStartEndElevation(), m_TParams.m_dLen, false, dSafeZ, dStElev) ;
|
||||
@@ -2827,6 +2850,8 @@ Milling::AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
double dEndElev ;
|
||||
if ( ! GetElevation( m_nPhase, ptEnd - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), vtTool, dEndElev))
|
||||
dEndElev = dElev ;
|
||||
if ( ! bAboveStartEnd)
|
||||
dEndElev = max( dEndElev, j * dStep) ;
|
||||
// aggiungo uscita
|
||||
Point3d ptP1 ;
|
||||
SetFeed( GetEndFeed()) ;
|
||||
@@ -2837,10 +2862,19 @@ Milling::AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
// aggiungo retrazione per frese normali (esclusi step intermedi senza retrazione)
|
||||
if ( ( m_TParams.m_nType & TF_SAWBLADE) == 0 && ( j == nStep || bMidRetract)) {
|
||||
// correggo elevazione finale per punto fine uscita (se testa da sopra senza aggregato approccio mai Z-)
|
||||
if ( m_bAboveHead && ! m_bAggrBottom && vtTool.z < - EPS_SMALL)
|
||||
dEndElev -= ScalarXY( (ptP1 - ptEnd), vtTool) ;
|
||||
else
|
||||
dEndElev -= ( ptP1 - ptEnd) * vtTool ;
|
||||
Point3d ptP1m = ptP1 - 10 * EPS_SMALL * vtTool ;
|
||||
Vector3d vtEscape = vtTool ;
|
||||
if ( m_bAboveHead && ! m_bAggrBottom && vtTool.z < - EPS_SMALL) {
|
||||
vtEscape.z = 0 ;
|
||||
vtEscape.Normalize() ;
|
||||
}
|
||||
double dNewEndElev ;
|
||||
if ( GetElevation( m_nPhase, ptP1m, vtTool, GetRadiusForStartEndElevation(), vtEscape, dNewEndElev) && dNewEndElev > EPS_SMALL) {
|
||||
if ( bAboveStartEnd)
|
||||
dEndElev = min( dEndElev, dNewEndElev) ;
|
||||
else
|
||||
dEndElev = max( dEndElev, dNewEndElev) ;
|
||||
}
|
||||
// determino se l'inizio dell'uscita è esattamente sotto il grezzo, nel qual caso ricalcolo l'elevazione
|
||||
bool bUnderEnd = m_bAboveHead && GetPointUnderRaw( ptP1, vtTool, 0,
|
||||
GetRadiusForStartEndElevation(), m_TParams.m_dLen, false, dSafeZ, dEndElev) ;
|
||||
@@ -2931,10 +2965,14 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
// aggiungo approccio per frese normali
|
||||
if ( ( m_TParams.m_nType & TF_SAWBLADE) == 0) {
|
||||
// correggo elevazione iniziale per punto inizio attacco (se testa da sopra senza aggregato approccio mai Z-)
|
||||
if ( m_bAboveHead && ! m_bAggrBottom && vtTool.z < - EPS_SMALL)
|
||||
dStElev -= ScalarXY( (ptP1 - ptStart), vtTool) ;
|
||||
else
|
||||
dStElev -= ( ptP1 - ptStart) * vtTool ;
|
||||
Vector3d vtEscape = vtTool ;
|
||||
if ( m_bAboveHead && ! m_bAggrBottom && vtTool.z < - EPS_SMALL) {
|
||||
vtEscape.z = 0 ;
|
||||
vtEscape.Normalize() ;
|
||||
}
|
||||
double dNewStElev ;
|
||||
if ( GetElevation( m_nPhase, ptP1 - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), vtEscape, dNewStElev) && dNewStElev > EPS_SMALL)
|
||||
dStElev = min( dStElev, dNewStElev) ;
|
||||
// determino se l'inizio dell'attacco è esattamente sotto il grezzo, nel qual caso ricalcolo l'elevazione
|
||||
bool bUnderStart = m_bAboveHead && GetPointUnderRaw( ptP1, vtTool, 0,
|
||||
GetRadiusForStartEndElevation(), m_TParams.m_dLen, false, dSafeZ, dStElev) ;
|
||||
@@ -3030,10 +3068,14 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
// determino se la fine dell'uscita è sopra il grezzo
|
||||
bool bAboveEnd = m_bAboveHead && GetPointAboveRaw( ptP1, vtTool) ;
|
||||
// correggo elevazione finale per punto fine uscita (se testa da sopra senza aggregato approccio mai Z-)
|
||||
if ( m_bAboveHead && ! m_bAggrBottom && vtTool.z < - EPS_SMALL)
|
||||
dEndElev -= ScalarXY( (ptP1 - ptEnd), vtTool) ;
|
||||
else
|
||||
dEndElev -= ( ptP1 - ptEnd) * vtTool ;
|
||||
Vector3d vtEscape = vtTool ;
|
||||
if ( m_bAboveHead && ! m_bAggrBottom && vtTool.z < - EPS_SMALL) {
|
||||
vtEscape.z = 0 ;
|
||||
vtEscape.Normalize() ;
|
||||
}
|
||||
double dNewEndElev ;
|
||||
if ( GetElevation( m_nPhase, ptP1 - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), vtEscape, dNewEndElev) && dNewEndElev > EPS_SMALL)
|
||||
dEndElev = min( dEndElev, dNewEndElev) ;
|
||||
// determino se l'inizio dell'uscita è esattamente sotto il grezzo, nel qual caso ricalcolo l'elevazione
|
||||
bool bUnderEnd = m_bAboveHead && GetPointUnderRaw( ptP1, vtTool, 0,
|
||||
GetRadiusForStartEndElevation(), m_TParams.m_dLen, false, dSafeZ, dEndElev) ;
|
||||
@@ -3095,10 +3137,14 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
// aggiungo approccio per frese normali
|
||||
if ( ( m_TParams.m_nType & TF_SAWBLADE) == 0) {
|
||||
// correggo elevazione iniziale per punto inizio attacco (se testa da sopra senza aggregato approccio mai Z-)
|
||||
if ( m_bAboveHead && ! m_bAggrBottom && vtTool.z < - EPS_SMALL)
|
||||
dStElev -= ScalarXY( (ptP1 - ptStart), vtTool) ;
|
||||
else
|
||||
dStElev -= ( ptP1 - ptStart) * vtTool ;
|
||||
Vector3d vtEscape = vtTool ;
|
||||
if ( m_bAboveHead && ! m_bAggrBottom && vtTool.z < - EPS_SMALL) {
|
||||
vtEscape.z = 0 ;
|
||||
vtEscape.Normalize() ;
|
||||
}
|
||||
double dNewStElev ;
|
||||
if ( GetElevation( m_nPhase, ptP1 - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), vtEscape, dNewStElev) && dNewStElev > EPS_SMALL)
|
||||
dStElev = min( dStElev, dNewStElev) ;
|
||||
// determino se l'inizio dell'attacco è fuori dal grezzo
|
||||
bool bOutStart = GetPointOutOfRaw( ptP1, vtTool, dElev, dSafeZ) ;
|
||||
// determino se l'inizio dell'attacco è sopra il grezzo
|
||||
@@ -3193,10 +3239,14 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
// determino se la fine dell'uscita è sopra il grezzo
|
||||
bool bAboveEnd = m_bAboveHead && GetPointAboveRaw( ptP1, vtTool) ;
|
||||
// correggo elevazione finale per punto fine uscita (se testa da sopra senza aggregato approccio mai Z-)
|
||||
if ( m_bAboveHead && ! m_bAggrBottom && vtTool.z < - EPS_SMALL)
|
||||
dEndElev -= ScalarXY( (ptP1 - ptEnd), vtTool) ;
|
||||
else
|
||||
dEndElev -= ( ptP1 - ptEnd) * vtTool ;
|
||||
Vector3d vtEscape = vtTool ;
|
||||
if ( m_bAboveHead && ! m_bAggrBottom && vtTool.z < - EPS_SMALL) {
|
||||
vtEscape.z = 0 ;
|
||||
vtEscape.Normalize() ;
|
||||
}
|
||||
double dNewEndElev ;
|
||||
if ( GetElevation( m_nPhase, ptP1 - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), vtEscape, dNewEndElev) && dNewEndElev > EPS_SMALL)
|
||||
dEndElev = min( dEndElev, dNewEndElev) ;
|
||||
// determino se l'inizio dell'uscita è esattamente sotto il grezzo, nel qual caso ricalcolo l'elevazione
|
||||
bool bUnderEnd = m_bAboveHead && GetPointUnderRaw( ptP1, vtTool, 0,
|
||||
GetRadiusForStartEndElevation(), m_TParams.m_dLen, false, dSafeZ, dEndElev) ;
|
||||
@@ -3691,6 +3741,7 @@ Milling::CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtStart, const
|
||||
if ( nType != MILL_LI_ZIGZAG && nType != MILL_LI_HELIX) {
|
||||
switch ( m_Params.m_nLeadOutType) {
|
||||
case MILL_LO_LINEAR : nType = MILL_LI_LINEAR ; break ;
|
||||
case MILL_LO_PERP_TG : nType = MILL_LI_TG_PERP ; break ;
|
||||
case MILL_LO_TANGENT : nType = MILL_LI_TANGENT ; break ;
|
||||
case MILL_LO_GLIDE : nType = MILL_LI_GLIDE ; break ;
|
||||
case MILL_LO_AS_LI : /* resta inalterato */ ; break ;
|
||||
@@ -3705,7 +3756,7 @@ Milling::CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtStart, const
|
||||
}
|
||||
// senso di rotazione da dir tg a dir esterna
|
||||
bool bCcwRot = (( ! bInvert && m_Params.m_nWorkSide == MILL_WS_LEFT) ||
|
||||
( bInvert && m_Params.m_nWorkSide != MILL_WS_LEFT)) ;
|
||||
( bInvert && m_Params.m_nWorkSide != MILL_WS_LEFT)) ;
|
||||
// verifico di poter fare l'ingresso a inseguimento
|
||||
if ( nType == MILL_LI_GLIDE && ! pCompo->IsClosed() && m_dAddedOverlap < EPS_SMALL)
|
||||
nType = MILL_LI_NONE ;
|
||||
@@ -3715,9 +3766,11 @@ Milling::CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtStart, const
|
||||
ptP1 = ptStart ;
|
||||
return true ;
|
||||
case MILL_LI_LINEAR :
|
||||
case MILL_LI_TG_PERP :
|
||||
case MILL_LI_TANGENT : {
|
||||
Vector3d vtPerp = vtStart ;
|
||||
vtPerp.Rotate( vtN, 0, ( bCcwRot ? 1 : - 1)) ;
|
||||
Vector3d vtRot = vtN - vtN * vtStart * vtStart ;
|
||||
vtPerp.Rotate( vtRot, 0, ( bCcwRot ? 1 : - 1)) ;
|
||||
ptP1 = ptStart - vtStart * dTang + vtPerp * dPerp + vtN * dElev ;
|
||||
return true ;
|
||||
}
|
||||
@@ -3761,21 +3814,28 @@ Milling::AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d&
|
||||
// Assegno il tipo
|
||||
int nType = GetLeadInType() ;
|
||||
double dTang = m_Params.m_dLiTang ;
|
||||
double dPerp = m_Params.m_dLiPerp ;
|
||||
// se step invertito
|
||||
if ( bInvert) {
|
||||
// va aggiustato se non zigzag o spirale
|
||||
if ( nType != MILL_LI_ZIGZAG && nType != MILL_LI_HELIX) {
|
||||
switch ( GetLeadOutType()) {
|
||||
case MILL_LO_LINEAR : nType = MILL_LI_LINEAR ; break ;
|
||||
case MILL_LO_PERP_TG : nType = MILL_LI_TG_PERP ; break ;
|
||||
case MILL_LO_TANGENT : nType = MILL_LI_TANGENT ; break ;
|
||||
case MILL_LO_GLIDE : nType = MILL_LI_GLIDE ; break ;
|
||||
case MILL_LO_AS_LI : /* resta inalterato */ ; break ;
|
||||
default : nType = MILL_LI_NONE ; break ;
|
||||
}
|
||||
if ( m_Params.m_nLeadOutType != MILL_LO_AS_LI)
|
||||
if ( m_Params.m_nLeadOutType != MILL_LO_AS_LI) {
|
||||
dTang = m_Params.m_dLoTang ;
|
||||
dPerp = m_Params.m_dLoPerp ;
|
||||
}
|
||||
}
|
||||
}
|
||||
// senso di rotazione da dir tg a dir esterna
|
||||
bool bCcwRot = (( ! bInvert && m_Params.m_nWorkSide == MILL_WS_LEFT) ||
|
||||
( bInvert && m_Params.m_nWorkSide != MILL_WS_LEFT)) ;
|
||||
// verifico di poter fare l'ingresso a inseguimento
|
||||
if ( nType == MILL_LI_GLIDE && ! pCompo->IsClosed() && m_dAddedOverlap < EPS_SMALL)
|
||||
nType = MILL_LI_NONE ;
|
||||
@@ -3785,6 +3845,16 @@ Milling::AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d&
|
||||
return true ;
|
||||
case MILL_LI_LINEAR :
|
||||
return ( AddLinearMove( ptStart, MCH_CL_LEADIN) != GDB_ID_NULL) ;
|
||||
case MILL_LI_TG_PERP :
|
||||
{
|
||||
// direzione perpendicolare
|
||||
Vector3d vtPerp = vtStart ;
|
||||
Vector3d vtRot = vtN - vtN * vtStart * vtStart ;
|
||||
vtPerp.Rotate( vtRot, 0, ( bCcwRot ? 1 : - 1)) ;
|
||||
Point3d ptMid = ptStart + vtPerp * dPerp ;
|
||||
return ( AddLinearMove( ptMid, MCH_CL_LEADIN) != GDB_ID_NULL &&
|
||||
AddLinearMove( ptStart, MCH_CL_LEADIN) != GDB_ID_NULL) ;
|
||||
}
|
||||
case MILL_LI_TANGENT :
|
||||
{
|
||||
PtrOwner<ICurve> pCrv( GetArc2PVN( ptStart, ptP1, - vtStart, vtN)) ;
|
||||
@@ -3977,6 +4047,7 @@ Milling::AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d
|
||||
int nLiType = GetLeadInType() ;
|
||||
switch ( nLiType) {
|
||||
case MILL_LI_LINEAR : nType = MILL_LO_LINEAR ; break ;
|
||||
case MILL_LI_TG_PERP : nType = MILL_LO_PERP_TG ; break ;
|
||||
case MILL_LI_TANGENT : nType = MILL_LO_TANGENT ; break ;
|
||||
case MILL_LI_GLIDE : nType = MILL_LO_GLIDE ; break ;
|
||||
case MILL_LI_ZIGZAG : nType = MILL_LO_NONE ; break ;
|
||||
@@ -3993,7 +4064,7 @@ Milling::AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d
|
||||
}
|
||||
// senso di rotazione da dir tg a dir esterna
|
||||
bool bCcwRot = (( ! bInvert && m_Params.m_nWorkSide == MILL_WS_LEFT) ||
|
||||
( bInvert && m_Params.m_nWorkSide != MILL_WS_LEFT)) ;
|
||||
( bInvert && m_Params.m_nWorkSide != MILL_WS_LEFT)) ;
|
||||
// verifico di poter fare l'uscita a inseguimento
|
||||
if ( nType == MILL_LO_GLIDE && ! pCompo->IsClosed() && m_dAddedOverlap < EPS_SMALL)
|
||||
nType = MILL_LO_NONE ;
|
||||
@@ -4005,15 +4076,27 @@ Milling::AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d
|
||||
case MILL_LO_LINEAR :
|
||||
{
|
||||
Vector3d vtPerp = vtEnd ;
|
||||
vtPerp.Rotate( vtN, 0, ( bCcwRot ? 1 : - 1)) ;
|
||||
Vector3d vtRot = vtN - vtN * vtEnd * vtEnd ;
|
||||
vtPerp.Rotate( vtRot, 0, ( bCcwRot ? 1 : - 1)) ;
|
||||
ptP1 = ptEnd + vtEnd * dTang + vtPerp * dPerp + vtN * dElev ;
|
||||
return ( AddLinearMove( ptP1, MCH_CL_LEADOUT) != GDB_ID_NULL) ;
|
||||
}
|
||||
case MILL_LO_PERP_TG :
|
||||
{
|
||||
Vector3d vtPerp = vtEnd ;
|
||||
Vector3d vtRot = vtN - vtN * vtEnd * vtEnd ;
|
||||
vtPerp.Rotate( vtRot, 0, ( bCcwRot ? 1 : - 1)) ;
|
||||
Point3d ptMid = ptEnd + vtPerp * dPerp ;
|
||||
ptP1 = ptMid + vtEnd * dTang + vtN * dElev ;
|
||||
return ( AddLinearMove( ptMid, MCH_CL_LEADOUT) != GDB_ID_NULL &&
|
||||
AddLinearMove( ptP1, MCH_CL_LEADOUT) != GDB_ID_NULL) ;
|
||||
}
|
||||
case MILL_LO_TANGENT :
|
||||
{
|
||||
// calcolo punto finale dell'uscita
|
||||
Vector3d vtPerp = vtEnd ;
|
||||
vtPerp.Rotate( vtN, 0, ( bCcwRot ? 1 : - 1)) ;
|
||||
Vector3d vtRot = vtN - vtN * vtEnd * vtEnd ;
|
||||
vtPerp.Rotate( vtRot, 0, ( bCcwRot ? 1 : - 1)) ;
|
||||
ptP1 = ptEnd + vtEnd * dTang + vtPerp * dPerp + vtN * dElev ;
|
||||
// inserisco uscita
|
||||
PtrOwner<ICurve> pCrv( GetArc2PVN( ptEnd, ptP1, vtEnd, vtN)) ;
|
||||
@@ -5001,8 +5084,8 @@ Milling::GetRadiusForStartEndElevation( bool bExtra) const
|
||||
if ( ! bExtra)
|
||||
return ( 0.5 * m_TParams.m_dTDiam) ;
|
||||
// aumentato
|
||||
const double DELTA_ELEV_RAD = 20.0 ;
|
||||
double dDeltaRad = DELTA_ELEV_RAD + max( max( m_Params.m_dStartAddLen, m_Params.m_dEndAddLen), 0.0) ;
|
||||
const double DELTA_ELEV_RAD = 2.0 ;
|
||||
double dDeltaRad = min( DELTA_ELEV_RAD, 0.5 * m_TParams.m_dTDiam) ;
|
||||
return ( 0.5 * m_TParams.m_dTDiam + dDeltaRad) ;
|
||||
}
|
||||
|
||||
@@ -5167,22 +5250,27 @@ Milling::CalcOffset( ICurveComposite* pCompo, double dSignOffs)
|
||||
}
|
||||
if ( m_Params.m_bLeaveTab || m_Params.m_bOscEnable)
|
||||
nFlag |= ICurve::OFF_MEDIA_INTDZ ;
|
||||
// eseguo offset semplice
|
||||
if ( pCompo->SimpleOffset( dSignOffs, nFlag))
|
||||
return true ;
|
||||
// se curva piatta, provo con offset avanzato
|
||||
bool bOk = false ;
|
||||
// determino se curva piatta e recupero suo vettore estrusione
|
||||
Plane3d plPlane ;
|
||||
if ( pCompo->IsFlat( plPlane, true, 100 * EPS_SMALL)) {
|
||||
bool bIsFlat = pCompo->IsFlat( plPlane, false, 10 * EPS_SMALL) ;
|
||||
Vector3d vtExtr ; pCompo->GetExtrusion( vtExtr) ;
|
||||
// se curva piatta con estrusione non perpendicolare forzo offset avanzato
|
||||
bool bAdvOffs = ( bIsFlat && abs( vtExtr * plPlane.GetVersN()) < cos( 0.1 * DEGTORAD)) ;
|
||||
// eseguo offset semplice
|
||||
if ( ! bAdvOffs && pCompo->SimpleOffset( dSignOffs, nFlag))
|
||||
return true ;
|
||||
// eseguo offset avanzato
|
||||
if ( bIsFlat) {
|
||||
OffsetCurve OffsCrv ;
|
||||
if ( OffsCrv.Make( pCompo, dSignOffs, nFlag)) {
|
||||
ICurve* pOffs = OffsCrv.GetLongerCurve() ;
|
||||
if ( pOffs != nullptr) {
|
||||
pCompo->Clear() ;
|
||||
pCompo->AddCurve( pOffs) ;
|
||||
bOk = true ;
|
||||
pCompo->ArcsBezierCurvesToArcsPerpExtr( LIN_TOL_MID, ANG_TOL_STD_DEG) ;
|
||||
return true ;
|
||||
}
|
||||
}
|
||||
}
|
||||
return bOk ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
+3
-2
@@ -574,7 +574,8 @@ MillingData::VerifyLeadInType( int nVal) const
|
||||
{
|
||||
return ( nVal == MILL_LI_NONE || nVal == MILL_LI_LINEAR ||
|
||||
nVal == MILL_LI_TANGENT || nVal == MILL_LI_GLIDE ||
|
||||
nVal == MILL_LI_ZIGZAG || nVal == MILL_LI_HELIX) ;
|
||||
nVal == MILL_LI_ZIGZAG || nVal == MILL_LI_HELIX ||
|
||||
nVal == MILL_LI_TG_PERP) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -583,7 +584,7 @@ MillingData::VerifyLeadOutType( int nVal) const
|
||||
{
|
||||
return ( nVal == MILL_LO_NONE || nVal == MILL_LO_LINEAR ||
|
||||
nVal == MILL_LO_TANGENT || nVal == MILL_LO_GLIDE ||
|
||||
nVal == MILL_LO_AS_LI) ;
|
||||
nVal == MILL_LO_AS_LI || nVal == MILL_LO_PERP_TG) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
+7
-8
@@ -627,14 +627,7 @@ Mortising::Update( bool bPostApply)
|
||||
}
|
||||
|
||||
// imposto eventuale asse bloccato da lavorazione
|
||||
if ( ! m_Params.m_sBlockedAxis.empty()) {
|
||||
string sAxis, sVal ;
|
||||
Split( m_Params.m_sBlockedAxis, "=", true, sAxis, sVal) ;
|
||||
double dVal = 0 ;
|
||||
FromString( sVal, dVal) ;
|
||||
m_pMchMgr->ClearRotAxisBlock() ;
|
||||
m_pMchMgr->SetRotAxisBlock( sAxis, dVal) ;
|
||||
}
|
||||
SetBlockedRotAxis( m_Params.m_sBlockedAxis) ;
|
||||
|
||||
// calcolo gli assi macchina
|
||||
string sHint = ExtractHint( m_Params.m_sUserNotes) ;
|
||||
@@ -1488,6 +1481,9 @@ Mortising::GenerateMortisingCl( const ICurveComposite* pCompo, const Vector3d& v
|
||||
Point3d ptLi = ptStart + vtTool * dDelta ;
|
||||
bool bUnderStart = GetPointUnderRaw( ptLi, vtTool, 0,
|
||||
GetRadiusForStartEndElevation(), m_TParams.m_dLen, false, dSafeZ, dStartElev) ;
|
||||
// altrimenti ridetermino elevazione su inizio percorso di lavoro
|
||||
if ( ! bUnderStart)
|
||||
GetElevation( m_nPhase, ptLi, vtTool, GetRadiusForStartEndElevation(), vtTool, dStartElev) ;
|
||||
|
||||
// 1 -> punto approccio
|
||||
SetFlag( 1) ;
|
||||
@@ -1569,6 +1565,9 @@ Mortising::GenerateMortisingCl( const ICurveComposite* pCompo, const Vector3d& v
|
||||
Point3d ptLo = ptLast + vtTool * dDelta ;
|
||||
bool bUnderEnd = GetPointUnderRaw( ptLo, vtTool, 0,
|
||||
GetRadiusForStartEndElevation(), m_TParams.m_dLen, false, dSafeZ, dEndElev) ;
|
||||
// altrimenti ridetermino elevazione su fine percorso di lavoro
|
||||
if ( ! bUnderEnd)
|
||||
GetElevation( m_nPhase, ptLo, vtTool, GetRadiusForStartEndElevation(), vtTool, dEndElev) ;
|
||||
|
||||
// 6 -> ritorno all'approccio
|
||||
SetFeed( GetEndFeed()) ;
|
||||
|
||||
+362
-112
@@ -372,7 +372,7 @@ Operation::GetPointUnderRaw( const Point3d& ptP, const Vector3d& vtTool, double
|
||||
int nStmId = m_pGeomDB->GetFirstNameInGroup( nRawId, MACH_RAW_SOLID) ;
|
||||
BBox3d b3Raw ;
|
||||
m_pGeomDB->GetGlobalBBox( nStmId, b3Raw) ;
|
||||
b3Raw.Expand( 0.5 * dSafeZ) ;
|
||||
b3Raw.Expand( 0.5 * dSafeZ, 0.5 * dSafeZ, 0) ;
|
||||
if ( ! b3Raw.IsEmpty() && b3Raw.OverlapsXY( b3Tool) && ptP.z + dExtraZ < b3Raw.GetMin().z - 10 * EPS_SMALL) {
|
||||
double dRawCentZ = ( b3Raw.GetMin().z + b3Raw.GetMax().z) / 2 ;
|
||||
double dRawDimZ = b3Raw.GetMax().z - b3Raw.GetMin().z ;
|
||||
@@ -1111,34 +1111,19 @@ Operation::CalcAndSetAxesBBox( void)
|
||||
//----------------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Operation::GetInitialAxesValues( DBLVECTOR& vAxVal) const
|
||||
Operation::GetInitialAxesValues( bool bSkipClimb, DBLVECTOR& vAxVal) const
|
||||
{
|
||||
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
|
||||
return false ;
|
||||
// recupero gruppo per geometria di lavorazione (Cutter Location)
|
||||
int nClId = m_pGeomDB->GetFirstNameInGroup( GetOwner(), MCH_CL) ;
|
||||
if ( nClId == GDB_ID_NULL)
|
||||
return false ;
|
||||
// recupero il primo percorso CL
|
||||
int nClPathId = m_pGeomDB->GetFirstGroupInGroup( nClId) ;
|
||||
// restituisco i valori iniziali degli assi di questo percorso di lavorazione
|
||||
return GetClPathInitialAxesValues( nClPathId, vAxVal) ;
|
||||
const CamData* pCamData = GetInitialCamData( bSkipClimb) ;
|
||||
vAxVal = ( pCamData != nullptr ? pCamData->GetAxesVal() : DBLVECTOR()) ;
|
||||
return ( vAxVal.size() > 0) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Operation::GetClPathInitialAxesValues( int nClPathId, DBLVECTOR& vAxVal) const
|
||||
Operation::GetClPathInitialAxesValues( int nClPathId, bool bSkipClimb, DBLVECTOR& vAxVal) const
|
||||
{
|
||||
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
|
||||
return false ;
|
||||
// recupero la prima entità di questo percorso
|
||||
int nEntId = m_pGeomDB->GetFirstInGroup( nClPathId) ;
|
||||
// recupero i dati Cam dell'entità
|
||||
CamData* pCamData = GetCamData( m_pGeomDB->GetUserObj( nEntId)) ;
|
||||
if ( pCamData == nullptr)
|
||||
return false ;
|
||||
// assegno i valori degli assi
|
||||
vAxVal = pCamData->GetAxesVal() ;
|
||||
const CamData* pCamData = GetClPathInitialCamData( nClPathId, bSkipClimb) ;
|
||||
vAxVal = ( pCamData != nullptr ? pCamData->GetAxesVal() : DBLVECTOR()) ;
|
||||
return ( vAxVal.size() > 0) ;
|
||||
}
|
||||
|
||||
@@ -1146,24 +1131,115 @@ Operation::GetClPathInitialAxesValues( int nClPathId, DBLVECTOR& vAxVal) const
|
||||
bool
|
||||
Operation::GetFinalAxesValues( bool bSkipRise, DBLVECTOR& vAxVal) const
|
||||
{
|
||||
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
|
||||
return false ;
|
||||
// recupero gruppo per geometria di lavorazione (Cutter Location)
|
||||
int nClId = m_pGeomDB->GetFirstNameInGroup( GetOwner(), MCH_CL) ;
|
||||
if ( nClId == GDB_ID_NULL)
|
||||
return false ;
|
||||
// recupero l'ultimo percorso CL
|
||||
int nClPathId = m_pGeomDB->GetLastGroupInGroup( nClId) ;
|
||||
// restituisco i valori finali degli assi di questo percorso di lavorazione
|
||||
return GetClPathFinalAxesValues( nClPathId, bSkipRise, vAxVal) ;
|
||||
const CamData* pCamData = GetFinalCamData( bSkipRise) ;
|
||||
vAxVal = ( pCamData != nullptr ? pCamData->GetAxesVal() : DBLVECTOR()) ;
|
||||
return ( vAxVal.size() > 0) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Operation::GetClPathFinalAxesValues( int nClPathId, bool bSkipRise, DBLVECTOR& vAxVal) const
|
||||
{
|
||||
const CamData* pCamData = GetClPathFinalCamData( nClPathId, bSkipRise) ;
|
||||
vAxVal = ( pCamData != nullptr ? pCamData->GetAxesVal() : DBLVECTOR()) ;
|
||||
return ( vAxVal.size() > 0) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Operation::GetInitialToolDir( bool bSkipClimb, Vector3d& vtTool) const
|
||||
{
|
||||
const CamData* pCamData = GetInitialCamData( bSkipClimb) ;
|
||||
vtTool = ( pCamData != nullptr ? pCamData->GetToolDir() : V_NULL) ;
|
||||
return ( ! vtTool.IsSmall()) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Operation::GetClPathInitialToolDir( int nClPathId, bool bSkipClimb, Vector3d& vtTool) const
|
||||
{
|
||||
const CamData* pCamData = GetClPathInitialCamData( nClPathId, bSkipClimb) ;
|
||||
vtTool = ( pCamData != nullptr ? pCamData->GetToolDir() : V_NULL) ;
|
||||
return ( ! vtTool.IsSmall()) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Operation::GetFinalToolDir( bool bSkipRise, Vector3d& vtTool) const
|
||||
{
|
||||
const CamData* pCamData = GetFinalCamData( bSkipRise) ;
|
||||
vtTool = ( pCamData != nullptr ? pCamData->GetToolDir() : V_NULL) ;
|
||||
return ( ! vtTool.IsSmall()) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Operation::GetClPathFinalToolDir( int nClPathId, bool bSkipRise, Vector3d& vtTool) const
|
||||
{
|
||||
const CamData* pCamData = GetClPathFinalCamData( nClPathId, bSkipRise) ;
|
||||
vtTool = ( pCamData != nullptr ? pCamData->GetToolDir() : V_NULL) ;
|
||||
return ( ! vtTool.IsSmall()) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
const CamData*
|
||||
Operation::GetInitialCamData( bool bSkipClimb) const
|
||||
{
|
||||
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
|
||||
return false ;
|
||||
return nullptr ;
|
||||
// recupero gruppo per geometria di lavorazione (Cutter Location)
|
||||
int nClId = m_pGeomDB->GetFirstNameInGroup( GetOwner(), MCH_CL) ;
|
||||
if ( nClId == GDB_ID_NULL)
|
||||
return nullptr ;
|
||||
// recupero il primo percorso CL
|
||||
int nClPathId = m_pGeomDB->GetFirstGroupInGroup( nClId) ;
|
||||
// recupero i dati Cam della prima entità del percorso
|
||||
return GetClPathInitialCamData( nClPathId, bSkipClimb) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
const CamData*
|
||||
Operation::GetClPathInitialCamData( int nClPathId, bool bSkipClimb) const
|
||||
{
|
||||
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
|
||||
return nullptr ;
|
||||
// recupero la prima entità di questo percorso
|
||||
int nEntId = m_pGeomDB->GetFirstInGroup( nClPathId) ;
|
||||
// se richiesto di ignorare le entità CLIMB
|
||||
if ( bSkipClimb) {
|
||||
while ( nEntId != GDB_ID_NULL) {
|
||||
string sName ;
|
||||
if ( ! m_pGeomDB->GetName( nEntId, sName) || sName != MCH_CL_CLIMB)
|
||||
break ;
|
||||
nEntId = m_pGeomDB->GetNext( nEntId) ;
|
||||
}
|
||||
}
|
||||
// recupero i dati Cam dell'entità
|
||||
return GetCamData( m_pGeomDB->GetUserObj( nEntId)) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
const CamData*
|
||||
Operation::GetFinalCamData( bool bSkipRise) const
|
||||
{
|
||||
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
|
||||
return nullptr ;
|
||||
// recupero gruppo per geometria di lavorazione (Cutter Location)
|
||||
int nClId = m_pGeomDB->GetFirstNameInGroup( GetOwner(), MCH_CL) ;
|
||||
if ( nClId == GDB_ID_NULL)
|
||||
return nullptr ;
|
||||
// recupero l'ultimo percorso CL
|
||||
int nClPathId = m_pGeomDB->GetLastGroupInGroup( nClId) ;
|
||||
// recupero i dati Cam dell'ultima entità del percorso
|
||||
return GetClPathFinalCamData( nClPathId, bSkipRise) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
const CamData*
|
||||
Operation::GetClPathFinalCamData( int nClPathId, bool bSkipRise) const
|
||||
{
|
||||
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
|
||||
return nullptr ;
|
||||
// recupero l'ultima entità di questo percorso
|
||||
int nEntId = m_pGeomDB->GetLastInGroup( nClPathId) ;
|
||||
// se richiesto di ignorare le entità RISE
|
||||
@@ -1176,12 +1252,7 @@ Operation::GetClPathFinalAxesValues( int nClPathId, bool bSkipRise, DBLVECTOR& v
|
||||
}
|
||||
}
|
||||
// recupero i dati Cam dell'entità
|
||||
CamData* pCamData = GetCamData( m_pGeomDB->GetUserObj( nEntId)) ;
|
||||
if ( pCamData == nullptr)
|
||||
return false ;
|
||||
// assegno i valori degli assi
|
||||
vAxVal = pCamData->GetAxesVal() ;
|
||||
return ( vAxVal.size() > 0) ;
|
||||
return GetCamData( m_pGeomDB->GetUserObj( nEntId)) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -1209,6 +1280,49 @@ Operation::ExtractHint( const string& sNotes) const
|
||||
return ExtractInfo( sNotes, "Hint:") ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Operation::SetBlockedRotAxis( const string& sBlockedAxis) const
|
||||
{
|
||||
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
|
||||
return false ;
|
||||
// cancello bloccaggio attuale
|
||||
m_pMchMgr->ClearRotAxisBlock() ;
|
||||
// se non ci sono bloccaggi, esco
|
||||
if ( sBlockedAxis.empty())
|
||||
return true ;
|
||||
// recupero token/nome asse e valore
|
||||
string sKey, sVal ;
|
||||
Split( sBlockedAxis, "=", true, sKey, sVal) ;
|
||||
if ( sKey.empty() || sVal.empty())
|
||||
return true ;
|
||||
double dVal = 0 ;
|
||||
if ( ! FromString( sVal, dVal))
|
||||
return true ;
|
||||
// imposto l'utensile per i calcoli macchina
|
||||
if ( ! m_pMchMgr->SetCalcTool( GetToolName(), GetHeadName(), GetExitNbr()))
|
||||
return false ;
|
||||
// recupero numero assi lineari e rotanti correnti
|
||||
int nLinAxes = m_pMchMgr->GetCurrLinAxes() ;
|
||||
int nRotAxes = m_pMchMgr->GetCurrRotAxes() ;
|
||||
// lo cerco tra i token degli assi rotanti correnti
|
||||
bool bFound = false ;
|
||||
for ( int i = 0 ; i < nRotAxes && ! bFound ; ++ i) {
|
||||
string sAxToken ;
|
||||
if ( m_pMchMgr->GetCurrMachine()->GetCurrAxisToken( i + nLinAxes, sAxToken) &&
|
||||
sKey == Trim( sAxToken)) {
|
||||
string sAxis ;
|
||||
m_pMchMgr->GetCurrMachine()->GetCurrAxisName( i + nLinAxes, sAxis) ;
|
||||
m_pMchMgr->SetRotAxisBlock( sAxis, dVal) ;
|
||||
bFound = true ;
|
||||
}
|
||||
}
|
||||
if ( bFound)
|
||||
return true ;
|
||||
// lo cerco tra gli assi rotanti della macchina
|
||||
return m_pMchMgr->SetRotAxisBlock( sKey, dVal) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Operation::CalculateAxesValues( const string& sHint, bool bSolChExact)
|
||||
@@ -1267,7 +1381,7 @@ Operation::CalculateAxesValues( const string& sHint, bool bSolChExact)
|
||||
if ( ! sHint.empty()) {
|
||||
STRVECTOR vsTok ;
|
||||
Tokenize( sHint, ",;", vsTok) ;
|
||||
for (const auto& sTok : vsTok) {
|
||||
for ( const auto& sTok : vsTok) {
|
||||
string szKey, szVal ;
|
||||
Split( sTok, "=", true, szKey, szVal) ;
|
||||
Trim( szKey) ;
|
||||
@@ -1749,16 +1863,20 @@ Operation::AdjustStartEndMovements( bool bVerifyPreviousLink)
|
||||
if ( bVerifyPreviousLink) {
|
||||
// recupero se ZHome è in basso
|
||||
bool bZHomeDown = GetZHomeDown() ;
|
||||
// recupero quota di home in Z
|
||||
double dHomeZ ;
|
||||
if ( ! m_pMchMgr->GetCurrAxisHomePos( 2, dHomeZ))
|
||||
return false ;
|
||||
// elimino eventuali CLIMB già presenti
|
||||
RemoveClimb( m_pGeomDB->GetFirstGroupInGroup( nClId)) ;
|
||||
// recupero posizione iniziale lavorazione
|
||||
DBLVECTOR vAxIni ;
|
||||
if ( ! GetInitialAxesValues( vAxIni))
|
||||
if ( ! GetInitialAxesValues( false, vAxIni))
|
||||
return false ;
|
||||
// se necessaria, aggiungo risalita parziale
|
||||
double dDeltaZ = ( vAxIni[2] - vAxVal[2]) ;
|
||||
if ( ( ! bZHomeDown && dDeltaZ > 100 * EPS_SMALL) ||
|
||||
( bZHomeDown && dDeltaZ < -100 * EPS_SMALL)) {
|
||||
if ( ( ! bZHomeDown && dDeltaZ > 100 * EPS_SMALL && vAxIni[2] <= dHomeZ) ||
|
||||
( bZHomeDown && dDeltaZ < -100 * EPS_SMALL && vAxIni[2] >= dHomeZ)) {
|
||||
if ( ! pPrevOp->AddRise( vAxVal, dDeltaZ, GDB_ID_NULL, bZHomeDown))
|
||||
return false ;
|
||||
// aggiorno quota in Z della posizione iniziale ( anche se verrà aggiornata solo in seguito)
|
||||
@@ -1766,51 +1884,49 @@ Operation::AdjustStartEndMovements( bool bVerifyPreviousLink)
|
||||
}
|
||||
// Verifico non ci sia collisione a HomeZ
|
||||
bool bToZmax = false ;
|
||||
double dHomeZ ;
|
||||
if ( m_pMchMgr->GetCurrAxisHomePos( 2, dHomeZ)) {
|
||||
DBLVECTOR vAxVal2 = vAxVal ; vAxVal2[2] = dHomeZ ;
|
||||
DBLVECTOR vAxIni2 = vAxIni ; vAxIni2[2] = dHomeZ ;
|
||||
if ( ! TestCollisionAvoid( vAxVal2, vAxIni2)) {
|
||||
// se ammessa risalita aggiuntiva
|
||||
double dExtraZ, dMaxAngV ;
|
||||
if ( GetExtraZ( dHomeZ, dExtraZ, dMaxAngV)) {
|
||||
if ( vAxVal2.size() < 5 || ( abs( vAxVal2[4]) < dMaxAngV && abs( vAxIni2[4]) < dMaxAngV)) {
|
||||
double dMyHomeZ = dHomeZ + dExtraZ ;
|
||||
vAxVal2[2] = dMyHomeZ ;
|
||||
vAxIni2[2] = dMyHomeZ ;
|
||||
if ( TestCollisionAvoid( vAxVal2, vAxIni2))
|
||||
dHomeZ = dMyHomeZ ;
|
||||
else
|
||||
bToZmax = true ;
|
||||
}
|
||||
DBLVECTOR vAxVal2 = vAxVal ; vAxVal2[2] = dHomeZ ;
|
||||
DBLVECTOR vAxIni2 = vAxIni ; vAxIni2[2] = dHomeZ ;
|
||||
if ( ! TestCollisionAvoid( vAxVal2, vAxIni2)) {
|
||||
// se ammessa risalita aggiuntiva
|
||||
Vector3d vtTprev ; pPrevOp->GetFinalToolDir( false, vtTprev) ;
|
||||
Vector3d vtTcurr ; GetInitialToolDir( false, vtTcurr) ;
|
||||
double dExtraZ ;
|
||||
if ( GetExtraZ( vAxVal2, vtTprev, vAxIni2, vtTcurr, dHomeZ, dExtraZ)) {
|
||||
if ( abs( dExtraZ) > EPS_SMALL) {
|
||||
double dMyHomeZ = dHomeZ + dExtraZ ;
|
||||
vAxVal2[2] = dMyHomeZ ;
|
||||
vAxIni2[2] = dMyHomeZ ;
|
||||
if ( TestCollisionAvoid( vAxVal2, vAxIni2))
|
||||
dHomeZ = dMyHomeZ ;
|
||||
else
|
||||
bToZmax = true ;
|
||||
}
|
||||
// se altrimenti ammessa rotazione a Zmax e richiesta rotazione
|
||||
else if ( GetRotationAtZmax() &&
|
||||
(( vAxVal2.size() >= 4 && abs( vAxVal2[3] - vAxIni2[3]) > 5) ||
|
||||
( vAxVal2.size() >= 5 && abs( vAxVal2[4] - vAxIni2[4]) > 5))) {
|
||||
// verifico se va bene rotazione assi iniziale e poi movimento
|
||||
DBLVECTOR vAxMid2 = vAxVal2 ;
|
||||
vAxMid2[3] = vAxIni2[3] ;
|
||||
if ( vAxVal2.size() >= 5)
|
||||
vAxMid2[4] = vAxIni2[4] ;
|
||||
if ( TestCollisionAvoid( vAxVal2, vAxMid2) &&
|
||||
TestCollisionAvoid( vAxMid2, vAxIni2) &&
|
||||
pPrevOp->AddRise( vAxVal2) &&
|
||||
pPrevOp->AddSpecialRise( vAxMid2, true, GDB_ID_NULL, 5)) {
|
||||
vAxVal = vAxMid2 ;
|
||||
bMaxZ = true ;
|
||||
}
|
||||
else
|
||||
return false ;
|
||||
else
|
||||
bToZmax = true ;
|
||||
}
|
||||
// se altrimenti ammessa rotazione a Zmax e richiesta rotazione
|
||||
else if ( GetRotationAtZmax() &&
|
||||
(( vAxVal2.size() >= 4 && abs( vAxVal2[3] - vAxIni2[3]) > 5) ||
|
||||
( vAxVal2.size() >= 5 && abs( vAxVal2[4] - vAxIni2[4]) > 5))) {
|
||||
// verifico se va bene rotazione assi iniziale e poi movimento
|
||||
DBLVECTOR vAxMid2 = vAxVal2 ;
|
||||
vAxMid2[3] = vAxIni2[3] ;
|
||||
if ( vAxVal2.size() >= 5)
|
||||
vAxMid2[4] = vAxIni2[4] ;
|
||||
if ( TestCollisionAvoid( vAxVal2, vAxMid2) &&
|
||||
TestCollisionAvoid( vAxMid2, vAxIni2) &&
|
||||
pPrevOp->AddRise( vAxVal2) &&
|
||||
pPrevOp->AddSpecialRise( vAxMid2, true, GDB_ID_NULL, 5)) {
|
||||
vAxVal = vAxMid2 ;
|
||||
bMaxZ = true ;
|
||||
}
|
||||
else
|
||||
return false ;
|
||||
}
|
||||
// altrimenti impossibile
|
||||
else
|
||||
return false ;
|
||||
}
|
||||
else
|
||||
return false ;
|
||||
// Se già a Zmax
|
||||
if ( bMaxZ) {
|
||||
// non devo fare alcunché
|
||||
@@ -1840,7 +1956,7 @@ Operation::AdjustStartEndMovements( bool bVerifyPreviousLink)
|
||||
dSafeZ = dUnsafeZ ;
|
||||
}
|
||||
else {
|
||||
for ( int i = 1 ; i <= 4 ; ++ i) {
|
||||
for ( int i = 1 ; i <= 3 ; ++ i) {
|
||||
double dTestSafeZ = ( dUnsafeZ + dSafeZ) / 2 ;
|
||||
vAxVal2[2] = dTestSafeZ ;
|
||||
vAxIni2[2] = dTestSafeZ ;
|
||||
@@ -1853,6 +1969,16 @@ Operation::AdjustStartEndMovements( bool bVerifyPreviousLink)
|
||||
}
|
||||
}
|
||||
}
|
||||
// se necessario, riprovo appena prima di Zmax
|
||||
if ( ! bPartRise) {
|
||||
double dOffsZ = 5 * ( bZHomeDown ? 1 : -1) ;
|
||||
vAxVal2[2] = dHomeZ + dOffsZ ;
|
||||
vAxIni2[2] = dHomeZ + dOffsZ ;
|
||||
if ( TestCollisionAvoid( vAxVal2, vAxIni2)) {
|
||||
bPartRise = true ;
|
||||
dSafeZ = dHomeZ + dOffsZ ;
|
||||
}
|
||||
}
|
||||
if ( ! bPartRise) {
|
||||
// cancello eventuale risalita parziale della lavorazione precedente
|
||||
pPrevOp->RemoveRise() ;
|
||||
@@ -1868,7 +1994,8 @@ Operation::AdjustStartEndMovements( bool bVerifyPreviousLink)
|
||||
// recupero le nuove quote finali (per calcolare il corretto delta)
|
||||
pPrevOp->GetFinalAxesValues( false, vAxVal) ;
|
||||
// aggiungo risalita a Zsafe
|
||||
if ( ! pPrevOp->AddRise( vAxVal, dSafeZ - vAxVal[2], GDB_ID_NULL, bZHomeDown))
|
||||
double dDelta = ( ! bZHomeDown ? max( dSafeZ - vAxVal[2], 0.) : min( dSafeZ - vAxVal[2], 0.)) ;
|
||||
if ( ! pPrevOp->AddRise( vAxVal, dDelta, GDB_ID_NULL, bZHomeDown))
|
||||
return false ;
|
||||
// aggiorno quota iniziale in Z
|
||||
vAxIni[2] = dSafeZ ;
|
||||
@@ -1989,6 +2116,16 @@ Operation::AdjustOneStartMovement( int nClPathId, int nPrevClPathId, Operation*
|
||||
double dHomeZ ;
|
||||
if ( ! m_pMchMgr->GetCurrAxisHomePos( 2, dHomeZ))
|
||||
return false ;
|
||||
// aggiungo eventuale ExtraZ
|
||||
const CamData* pCamDataPrev = GetClPathFinalCamData( nPrevClPathId, true) ;
|
||||
const DBLVECTOR& vAxPrev = ( pCamDataPrev != nullptr ? pCamDataPrev->GetAxesVal() : DBLVECTOR()) ;
|
||||
const Vector3d& vtTprev = ( pCamDataPrev != nullptr ? pCamDataPrev->GetToolDir() : V_NULL) ;
|
||||
const Vector3d& vtTcurr = pCamData->GetToolDir() ;
|
||||
double dExtraZ ;
|
||||
if ( GetExtraZ( vAxPrev, vtTprev, vAxCurr, vtTcurr, dHomeZ, dExtraZ)) {
|
||||
if ( abs( dExtraZ) > EPS_SMALL)
|
||||
dHomeZ += dExtraZ ;
|
||||
}
|
||||
// modifico quella originale (è la prima del percorso)
|
||||
m_pGeomDB->SetName( nEntId, MCH_CL_CLIMB) ;
|
||||
DBLVECTOR vAxNew = vAxCurr ;
|
||||
@@ -2032,28 +2169,45 @@ Operation::AdjustOneStartMovement( int nClPathId, int nPrevClPathId, Operation*
|
||||
double dHomeZ ;
|
||||
if ( ! m_pMchMgr->GetCurrAxisHomePos( 2, dHomeZ))
|
||||
return false ;
|
||||
// riprovo con una Z intermedia
|
||||
bool bPartRise = false ;
|
||||
double dSafeZ = dHomeZ ;
|
||||
double dUnsafeZ = dTopZ ;
|
||||
for ( int i = 1 ; i <= 4 ; ++ i) {
|
||||
double dTestSafeZ = ( dUnsafeZ + dSafeZ) / 2 ;
|
||||
vAxPrevTmp[2] = dTestSafeZ ;
|
||||
vAxCurrTmp[2] = dTestSafeZ ;
|
||||
if ( ! bForcedZMax && TestCollisionAvoid( vAxPrevTmp, vAxCurrTmp))
|
||||
dSafeZ = dTestSafeZ ;
|
||||
else
|
||||
dUnsafeZ = dTestSafeZ ;
|
||||
// se non forzata Zmax
|
||||
if ( ! bForcedZMax) {
|
||||
// riprovo con una Z intermedia
|
||||
double dUnsafeZ = dTopZ ;
|
||||
for ( int i = 1 ; i <= 3 ; ++ i) {
|
||||
double dTestSafeZ = ( dUnsafeZ + dSafeZ) / 2 ;
|
||||
vAxPrevTmp[2] = dTestSafeZ ;
|
||||
vAxCurrTmp[2] = dTestSafeZ ;
|
||||
if ( TestCollisionAvoid( vAxPrevTmp, vAxCurrTmp)) {
|
||||
bPartRise = true ;
|
||||
dSafeZ = dTestSafeZ ;
|
||||
}
|
||||
else
|
||||
dUnsafeZ = dTestSafeZ ;
|
||||
}
|
||||
// se necessario, riprovo appena prima di Zmax
|
||||
if ( ! bPartRise) {
|
||||
double dOffsZ = 5 * ( bZHomeDown ? 1 : -1) ;
|
||||
vAxPrevTmp[2] = dHomeZ + dOffsZ ;
|
||||
vAxCurrTmp[2] = dHomeZ + dOffsZ ;
|
||||
if ( TestCollisionAvoid( vAxPrevTmp, vAxCurrTmp)) {
|
||||
bPartRise = true ;
|
||||
dSafeZ = dHomeZ + dOffsZ ;
|
||||
}
|
||||
}
|
||||
}
|
||||
// risalita sopra fine percorso precedente
|
||||
DBLVECTOR vAxNew1 ;
|
||||
double dDelta = ( ! bZHomeDown ? max( dSafeZ - vAxPrev[2], 0.) : min( dSafeZ - vAxPrev[2], 0.)) ;
|
||||
if ( nPrevClPathId == GDB_ID_NULL) {
|
||||
if ( pPrevOp == nullptr ||
|
||||
! pPrevOp->RemoveRise() ||
|
||||
! pPrevOp->AddRise( vAxNew1, dSafeZ - vAxPrev[2], GDB_ID_NULL, bZHomeDown))
|
||||
! pPrevOp->AddRise( vAxNew1, dDelta, GDB_ID_NULL, bZHomeDown))
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( ! AddRise( vAxNew1, dSafeZ - vAxPrev[2], nPrevClPathId, bZHomeDown))
|
||||
if ( ! AddRise( vAxNew1, dDelta, nPrevClPathId, bZHomeDown))
|
||||
return false ;
|
||||
}
|
||||
// aggiungo posizione elevata prima dell'inizio del percorso corrente
|
||||
@@ -2064,7 +2218,7 @@ Operation::AdjustOneStartMovement( int nClPathId, int nPrevClPathId, Operation*
|
||||
DBLVECTOR vAxNew = vAxCurr ;
|
||||
vAxNew[2] = vAxNew1[2] ;
|
||||
int nFlagNew = 2 ;
|
||||
int nFlag2New = 1 ;
|
||||
int nFlag2New = ( bPartRise ? 0 : 1) ;
|
||||
// eventuali aggiustamenti speciali dipendenti dalla macchina
|
||||
Vector3d vtTool = pCamData->GetToolDir() ;
|
||||
DBLVECTOR vAxTmp = vAxNew ;
|
||||
@@ -2098,7 +2252,8 @@ Operation::AdjustOneStartMovement( int nClPathId, int nPrevClPathId, Operation*
|
||||
return true ;
|
||||
// aggiungo risalita alla fine del precedente percorso
|
||||
DBLVECTOR vAxNew ;
|
||||
if ( ! AddRise( vAxNew, vAxCurr[2] - vAxPrev[2], nPrevClPathId, bZHomeDown))
|
||||
double dDelta = ( ! bZHomeDown ? max( vAxCurr[2] - vAxPrev[2], 0.) : min( vAxCurr[2] - vAxPrev[2], 0.)) ;
|
||||
if ( ! AddRise( vAxNew, dDelta, nPrevClPathId, bZHomeDown))
|
||||
return false ;
|
||||
}
|
||||
// altrimenti Z corrente minore della precedente
|
||||
@@ -2501,24 +2656,56 @@ Operation::CalcDeltaZForHeadRotation( const DBLVECTOR& vAxStart, const DBLVECTOR
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Operation::GetExtraZ( double dSafeZ, double& dExtraZ, double& dMaxAngV) const
|
||||
Operation::GetExtraZ( const DBLVECTOR& vAx1, const Vector3d& vtTool1,
|
||||
const DBLVECTOR& vAx2, const Vector3d& vtTool2,
|
||||
double dSafeZ, double& dExtraZ) const
|
||||
{
|
||||
// Recupero macchina corrente
|
||||
Machine* pMch = ( m_pMchMgr != nullptr ? m_pMchMgr->GetCurrMachine() : nullptr) ;
|
||||
if ( pMch == nullptr)
|
||||
return 0 ;
|
||||
// Se testa con Info ZEXTRA la recupero e la limito alla corsa dell'asse
|
||||
return false ;
|
||||
|
||||
// Flag per posizione sicura in alto o in basso
|
||||
int nHeadId = pMch->GetCurrHead() ;
|
||||
bool bZHomeDown ;
|
||||
if ( ! m_pGeomDB->GetInfo( nHeadId, MCH_ZHOMEDOWN, bZHomeDown))
|
||||
bZHomeDown = false ;
|
||||
|
||||
// Estremi dell'asse Z (asse 3, quindi indice 2)
|
||||
double dAxZmax ; pMch->GetCurrAxisMax( 2, dAxZmax) ;
|
||||
double dAxZmin ; pMch->GetCurrAxisMin( 2, dAxZmin) ;
|
||||
|
||||
// Se definito e correttamente eseguito script SpecialGetMaxZ
|
||||
double dMaxZ ;
|
||||
if ( SpecialGetMaxZ( vAx1, vtTool1, vAx2, vtTool2, dMaxZ)) {
|
||||
// se caso standard
|
||||
if ( ! bZHomeDown) {
|
||||
dExtraZ = min( dMaxZ, dAxZmax) - dSafeZ ;
|
||||
return ( dExtraZ > EPS_SMALL) ;
|
||||
}
|
||||
// altrimenti caso con posizione sicura in basso (teste da sotto)
|
||||
else {
|
||||
dExtraZ = max( dMaxZ, dAxZmin) - dSafeZ ;
|
||||
return ( dExtraZ < EPS_SMALL) ;
|
||||
}
|
||||
}
|
||||
|
||||
// Altrimenti verifico se testa ha Info ZEXTRA
|
||||
DBLVECTOR vdVal ;
|
||||
if ( m_pGeomDB->GetInfo( nHeadId, MCH_ZEXTRA, vdVal) && vdVal.size() >= 1 && vdVal[0] > EPS_SMALL) {
|
||||
// angolo limite per applicare questo allontanamento extra
|
||||
dMaxAngV = 30 ;
|
||||
if ( vdVal.size() >= 2)
|
||||
dMaxAngV = vdVal[1] ;
|
||||
// flag per posizione sicura in alto o in basso
|
||||
bool bZHomeDown ;
|
||||
if ( ! m_pGeomDB->GetInfo( nHeadId, MCH_ZHOMEDOWN, bZHomeDown))
|
||||
bZHomeDown = false ;
|
||||
if ( ! m_pGeomDB->GetInfo( nHeadId, MCH_ZEXTRA, vdVal) || vdVal.empty() || vdVal[0] < EPS_SMALL)
|
||||
return false ;
|
||||
// angolo verticale limite per applicare questo allontanamento extra
|
||||
double dMaxAngV = 30 ;
|
||||
if ( vdVal.size() >= 2)
|
||||
dMaxAngV = vdVal[1] ;
|
||||
// angolo verticale
|
||||
double dAngV = 0 ;
|
||||
if ( vAx1.size() >= 5 && vAx2.size() >= 5)
|
||||
dAngV = max( abs( vAx1[4]), abs( vAx2[4])) ;
|
||||
else if ( vAx2.size() >= 5)
|
||||
dAngV = abs( vAx2[4]) ;
|
||||
// verifica angolo verticale
|
||||
if ( dAngV < dMaxAngV) {
|
||||
// se caso standard
|
||||
if ( ! bZHomeDown) {
|
||||
double dZmax ;
|
||||
@@ -2534,7 +2721,70 @@ Operation::GetExtraZ( double dSafeZ, double& dExtraZ, double& dMaxAngV) const
|
||||
return ( dExtraZ < EPS_SMALL) ;
|
||||
}
|
||||
}
|
||||
return false ;
|
||||
// Lascio provare a Zmax
|
||||
dExtraZ = 0 ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Operation::SpecialGetMaxZ( const DBLVECTOR& vAx1, const Vector3d& vtTool1,
|
||||
const DBLVECTOR& vAx2, const Vector3d& vtTool2,
|
||||
double& dMaxZ) const
|
||||
{
|
||||
// recupero la macchina corrente
|
||||
Machine* pMch = ( m_pMchMgr != nullptr ? m_pMchMgr->GetCurrMachine() : nullptr) ;
|
||||
if ( pMch == nullptr)
|
||||
return false ;
|
||||
|
||||
// verifico numero assi
|
||||
int nNumAx1 = int( vAx1.size()) ;
|
||||
int nNumAx2 = int( vAx2.size()) ;
|
||||
if ( nNumAx1 != nNumAx2 && nNumAx1 != 0 && ! vtTool1.IsSmall())
|
||||
return false ;
|
||||
|
||||
// costanti
|
||||
static const string EMC_VAR = "EMC" ; // tabella variabili locali per calcolo
|
||||
static const string EVAR_ERROR = ".ERR" ; // OUT (int) codice di errore ( 0 = ok)
|
||||
static const string EVAR_MAXZ = ".MAXZ" ; // OUT (double) valore Zmax
|
||||
static const string ON_SPECIAL_GETMAXZ = "OnSpecialGetMaxZ" ;
|
||||
|
||||
// verifico definizione funzione
|
||||
if ( ! pMch->LuaExistsFunction( ON_SPECIAL_GETMAXZ))
|
||||
return false ;
|
||||
|
||||
// avvio
|
||||
bool bOk = true ;
|
||||
int nErr = 99 ;
|
||||
// imposto valori parametri
|
||||
bOk = bOk && pMch->LuaCreateGlobTable( EMC_VAR) ;
|
||||
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + GVAR_TOOL, GetToolName()) ;
|
||||
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + GVAR_HEAD, GetHeadName()) ;
|
||||
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + GVAR_EXIT, GetExitNbr()) ;
|
||||
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + GVAR_TCPOS, GetToolTcPos()) ;
|
||||
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + GVAR_MCHID, GetOwner()) ;
|
||||
// valori degli assi
|
||||
for ( int i = 1 ; i <= nNumAx1 ; ++ i)
|
||||
bOk = bOk && pMch->LuaSetGlobVar( GetGlobVarAxisPrev( i, EMC_VAR), vAx1[i-1]) ;
|
||||
for ( int i = 1 ; i <= nNumAx2 ; ++ i)
|
||||
bOk = bOk && pMch->LuaSetGlobVar( GetGlobVarAxisValue( i, EMC_VAR), vAx2[i-1]) ;
|
||||
// direzioni utensile
|
||||
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + GVAR_TDIRP, vtTool1) ;
|
||||
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + GVAR_TDIR, vtTool2) ;
|
||||
// eseguo
|
||||
bOk = bOk && pMch->LuaCallFunction( ON_SPECIAL_GETMAXZ, false) ;
|
||||
// recupero valori parametri obbligatori
|
||||
bOk = bOk && pMch->LuaGetGlobVar( EMC_VAR + EVAR_ERROR, nErr) ;
|
||||
bOk = bOk && pMch->LuaGetGlobVar( EMC_VAR + EVAR_MAXZ, dMaxZ) ;
|
||||
// reset
|
||||
bOk = bOk && pMch->LuaResetGlobVar( EMC_VAR) ;
|
||||
// segnalo errori
|
||||
if ( nErr != 0) {
|
||||
bOk = false ;
|
||||
string sOut = " Error in " + ON_SPECIAL_GETMAXZ + " (" + ToString( nErr) + ")" ;
|
||||
LOG_ERROR( GetEMkLogger(), sOut.c_str())
|
||||
}
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -2544,7 +2794,7 @@ Operation::GetRotationAtZmax( void) const
|
||||
// Recupero macchina corrente
|
||||
Machine* pMch = ( m_pMchMgr != nullptr ? m_pMchMgr->GetCurrMachine() : nullptr) ;
|
||||
if ( pMch == nullptr)
|
||||
return 0 ;
|
||||
return false ;
|
||||
// Se testa con Info ROTATZMAX la recupero e restituisco abilitazione rotazione a Zmax
|
||||
int nHeadId = pMch->GetCurrHead() ;
|
||||
int nVal = 0 ;
|
||||
@@ -2656,7 +2906,7 @@ Operation::TestCollisionAvoid( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEn
|
||||
INTVECTOR vCollId ;
|
||||
pMch->GetCurrHeadCollGroups( vCollId) ;
|
||||
// distanza di sicurezza
|
||||
const double TOL_SAFEDIST = 10.0 ;
|
||||
const double TOL_SAFEDIST = 5.0 ;
|
||||
const double MIN_SAFEDIST = 10.0 ;
|
||||
double dSafeDist = m_pMchMgr->GetCurrMachiningsMgr()->GetSafeZ() ;
|
||||
dSafeDist = max( dSafeDist - TOL_SAFEDIST, MIN_SAFEDIST) ;
|
||||
|
||||
+18
-3
@@ -93,12 +93,21 @@ class Operation : public IUserObj
|
||||
bool CalcAndSetBBox( int nClId) ;
|
||||
bool CalcAndSetAxesBBox( void) ;
|
||||
|
||||
bool GetInitialAxesValues( DBLVECTOR& vAxVal) const ;
|
||||
bool GetClPathInitialAxesValues( int nClPathId, DBLVECTOR& vAxVal) const ;
|
||||
bool GetInitialAxesValues( bool bSkipClimb, DBLVECTOR& vAxVal) const ;
|
||||
bool GetClPathInitialAxesValues( int nClPathId, bool bSkipClimb, DBLVECTOR& vAxVal) const ;
|
||||
bool GetFinalAxesValues( bool bSkipRise, DBLVECTOR& vAxVal) const ;
|
||||
bool GetClPathFinalAxesValues( int nClPathId, bool bSkipRise, DBLVECTOR& vAxVal) const ;
|
||||
bool GetInitialToolDir( bool bSkipClimb, Vector3d& vtTool) const ;
|
||||
bool GetClPathInitialToolDir( int nClPathId, bool bSkipClimb, Vector3d& vtTool) const ;
|
||||
bool GetFinalToolDir( bool bSkipRise, Vector3d& vtTool) const ;
|
||||
bool GetClPathFinalToolDir( int nClPathId, bool bSkipRise, Vector3d& vtTool) const ;
|
||||
const CamData* GetInitialCamData( bool bSkipClimb) const ;
|
||||
const CamData* GetClPathInitialCamData( int nClPathId, bool bSkipClimb) const ;
|
||||
const CamData* GetFinalCamData( bool bSkipRise) const ;
|
||||
const CamData* GetClPathFinalCamData( int nClPathId, bool bSkipRise) const ;
|
||||
std::string ExtractInfo( const std::string& sNotes, const std::string& sKey) const ;
|
||||
std::string ExtractHint( const std::string& sNotes) const ;
|
||||
bool SetBlockedRotAxis( const std::string& sBlockedAxis) const ;
|
||||
bool CalculateAxesValues( const std::string& sHint, bool bSolChExact = false) ;
|
||||
bool CalculateClPathAxesValues( int nClPathId, int nLinAxes, int nRotAxes, double dRot1W,
|
||||
double dAngDeltaMinForHome, const DBLVECTOR& vAxRotHome, DBLVECTOR& vAxRotPrec, int& nOutStrC) ;
|
||||
@@ -111,7 +120,13 @@ class Operation : public IUserObj
|
||||
bool RemoveRise( int nClPathId = GDB_ID_NULL) ;
|
||||
bool AddHome( void) ;
|
||||
bool CalcDeltaZForHeadRotation( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd, double& dDeltaZ) const ;
|
||||
bool GetExtraZ( double dSafeZ, double& dExtraZ, double& dMaxAngV) const ;
|
||||
bool GetExtraZ( const DBLVECTOR& vAx1, const Vector3d& vtTool1,
|
||||
const DBLVECTOR& vAx2, const Vector3d& vtTool2,
|
||||
double dSafeZ, double& dExtraZ) const ;
|
||||
bool SpecialGetMaxZ( const DBLVECTOR& vAx1, const Vector3d& vtTool1,
|
||||
const DBLVECTOR& vAx2, const Vector3d& vtTool2,
|
||||
double& dMaxZ) const ;
|
||||
bool SpecialGetMaxZ( DBLVECTOR& vAx1, Vector3d& vtTool1, DBLVECTOR& vAx2, Vector3d& vtTool2, int& dMaxZ) ;
|
||||
bool GetRotationAtZmax( void) const ;
|
||||
bool ForcedZmax( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd) const ;
|
||||
int GetUserNotesZmax( void) const ;
|
||||
|
||||
+134
-133
@@ -20,143 +20,144 @@
|
||||
static const int MAX_AXES = 7 ;
|
||||
// Variabili
|
||||
static const std::string GLOB_VAR = "EMT" ; // tavola variabili globali
|
||||
static const std::string GVAR_VER = ".VER" ; // (string) versione della Dll
|
||||
static const std::string GVAR_ERR = ".ERR" ; // (int) codice di errore (0=ok)
|
||||
static const std::string GVAR_USETO1 = ".USETO1" ; // (bool) flag per utilizzo origine tavola
|
||||
static const std::string GVAR_MODAL = ".MODAL" ; // (bool) flag per emissione modale dei valori
|
||||
static const std::string GVAR_INCHES = ".INCHES" ; // (bool) flag unità di misura (true=inches, false=mm)
|
||||
static const std::string GVAR_SPLITARCS = ".SPLITARCS" ; // (int) flag spezzatura archi (0=mai, 1=piani generici, 2=piani diversi da XY, 3=sempre)
|
||||
static const std::string GVAR_NUM = ".NUM" ; // (bool) flag numerazione
|
||||
static const std::string GVAR_NUMTOK = ".Nt" ; // (string) token per numerazione
|
||||
static const std::string GVAR_LINENBR = ".LINENBR" ; // (int) numero progressivo di linea
|
||||
static const std::string GVAR_LINEINC = ".LINEINC" ; // (int) incremento per numero di linea
|
||||
static const std::string GVAR_F = ".F" ; // (num) valore della feed
|
||||
static const std::string GVAR_FT = ".Ft" ; // (string) token per feed
|
||||
static const std::string GVAR_S = ".S" ; // (num) valore della speed
|
||||
static const std::string GVAR_ST = ".St" ; // (string) token per speed
|
||||
static const std::string GVAR_MACHNAME = ".MACHNAME" ; // (string) nome macchina
|
||||
static const std::string GVAR_FILE = ".FILE" ; // (string) path file di output
|
||||
static const std::string GVAR_INFO = ".INFO" ; // (string) informazioni iniziali
|
||||
static const std::string GVAR_SETUP = ".SETUP" ; // (bool) flag definizione setup
|
||||
static const std::string GVAR_DISPID = ".DISPID" ; // (int) identificativo disposizione
|
||||
static const std::string GVAR_DISPIND = ".DISPIND" ; // (int) indice disposizione
|
||||
static const std::string GVAR_PHASE = ".PHASE" ; // (int) indice fase
|
||||
static const std::string GVAR_EMPTY = ".EMPTY" ; // (bool) flag disposizione passiva
|
||||
static const std::string GVAR_SBH = ".SBH" ; // (bool) flag disposizione con operazioni manuali
|
||||
static const std::string GVAR_TABNAME = ".TABNAME" ; // (string) nome tavola
|
||||
static const std::string GVAR_TABORI1 = ".TABORI1" ; // (Point3d) prima origine di tavola
|
||||
static const std::string GVAR_FIXID = ".FIXID" ; // (int) identificativo bloccaggio (fixture)
|
||||
static const std::string GVAR_FIXIND = ".FIXIND" ; // (int) indice bloccaggio
|
||||
static const std::string GVAR_FIXNAME = ".FIXNAME" ; // (string) nome bloccaggio
|
||||
static const std::string GVAR_FIXPOS = ".FIXPOS" ; // (Point3d) posizione bloccaggio
|
||||
static const std::string GVAR_FIXANG = ".FIXANG" ; // (num) angolo di rotazione bloccaggio
|
||||
static const std::string GVAR_FIXMOB = ".FIXMOB" ; // (num) movimento eventuale parte mobile del bloccaggio
|
||||
static const std::string GVAR_RAWID = ".RAWID" ; // (int) identificativo grezzo
|
||||
static const std::string GVAR_RAWIND = ".RAWIND" ; // (int) indice movimento del grezzo
|
||||
static const std::string GVAR_RAWTYPE = ".RAWTYPE" ; // (int) tipo di movimento del grezzo
|
||||
static const std::string GVAR_RAWPOS = ".RAWPOS" ; // (Point3d) posizione di movimento del grezzo
|
||||
static const std::string GVAR_RAWFLAG = ".RAWFLAG" ; // (int) flag per movimento del grezzo
|
||||
static const std::string GVAR_TOOL = ".TOOL" ; // (string) nome utensile
|
||||
static const std::string GVAR_HEAD = ".HEAD" ; // (string) nome testa
|
||||
static const std::string GVAR_EXIT = ".EXIT" ; // (int) indice uscita
|
||||
static const std::string GVAR_TCPOS = ".TCPOS" ; // (string) eventuale posizione utensile nel TC
|
||||
static const std::string GVAR_TCOMP = ".TCOMP" ; // (int) numero correttore utensile
|
||||
static const std::string GVAR_TDIAM = ".TDIAM" ; // (num) diametro utensile
|
||||
static const std::string GVAR_TTOTDIAM = ".TTOTDIAM" ; // (num) diametro totale utensile
|
||||
static const std::string GVAR_TLEN = ".TLEN" ; // (num) lunghezza utensile
|
||||
static const std::string GVAR_TTOTLEN = ".TTOTLEN" ; // (num) lunghezza totale utensile
|
||||
static const std::string GVAR_TUSED = ".TUSED" ; // (bool) flag per indicare che l'utensile attrezzato è anche utilizzato
|
||||
static const std::string GVAR_SMAX = ".SMAX" ; // (num) massima speed utensile
|
||||
static const std::string GVAR_FIRST = ".FIRST" ; // (bool) flag per primo utensile
|
||||
static const std::string GVAR_NEXTTOOL = ".NEXTTOOL" ; // (string) nome del prossimo utensile
|
||||
static const std::string GVAR_NEXTHEAD = ".NEXTHEAD" ; // (string) nome testa del prossimo utensile
|
||||
static const std::string GVAR_NEXTEXIT = ".NEXTEXIT" ; // (int) indice uscita su testa del prox utensile
|
||||
static const std::string GVAR_NEXTTCPOS = ".NEXTTCPOS" ; // (string) eventuale posizione del prox utensile nel TC
|
||||
static const std::string GVAR_MCHID = ".MCHID" ; // (int) identificativo lavorazione
|
||||
static const std::string GVAR_MCHIND = ".MCHIND" ; // (int) indice lavorazione
|
||||
static const std::string GVAR_MMIN = ".MMIN" ; // (Point3d) punto minimo di ingombro della lavorazione
|
||||
static const std::string GVAR_MMAX = ".MMAX" ; // (Point3d) punto massimo di ingombro della lavorazione
|
||||
static const std::string GVAR_VER = ".VER" ; // (string) versione della Dll
|
||||
static const std::string GVAR_ERR = ".ERR" ; // (int) codice di errore (0=ok)
|
||||
static const std::string GVAR_USETO1 = ".USETO1" ; // (bool) flag per utilizzo origine tavola
|
||||
static const std::string GVAR_MODAL = ".MODAL" ; // (bool) flag per emissione modale dei valori
|
||||
static const std::string GVAR_INCHES = ".INCHES" ; // (bool) flag unità di misura (true=inches, false=mm)
|
||||
static const std::string GVAR_SPLITARCS = ".SPLITARCS" ; // (int) flag spezzatura archi (0=mai, 1=piani generici, 2=piani diversi da XY, 3=sempre)
|
||||
static const std::string GVAR_NUM = ".NUM" ; // (bool) flag numerazione
|
||||
static const std::string GVAR_NUMTOK = ".Nt" ; // (string) token per numerazione
|
||||
static const std::string GVAR_LINENBR = ".LINENBR" ; // (int) numero progressivo di linea
|
||||
static const std::string GVAR_LINEINC = ".LINEINC" ; // (int) incremento per numero di linea
|
||||
static const std::string GVAR_F = ".F" ; // (num) valore della feed
|
||||
static const std::string GVAR_FT = ".Ft" ; // (string) token per feed
|
||||
static const std::string GVAR_S = ".S" ; // (num) valore della speed
|
||||
static const std::string GVAR_ST = ".St" ; // (string) token per speed
|
||||
static const std::string GVAR_MACHNAME = ".MACHNAME" ; // (string) nome macchina
|
||||
static const std::string GVAR_FILE = ".FILE" ; // (string) path file di output
|
||||
static const std::string GVAR_INFO = ".INFO" ; // (string) informazioni iniziali
|
||||
static const std::string GVAR_SETUP = ".SETUP" ; // (bool) flag definizione setup
|
||||
static const std::string GVAR_DISPID = ".DISPID" ; // (int) identificativo disposizione
|
||||
static const std::string GVAR_DISPIND = ".DISPIND" ; // (int) indice disposizione
|
||||
static const std::string GVAR_PHASE = ".PHASE" ; // (int) indice fase
|
||||
static const std::string GVAR_EMPTY = ".EMPTY" ; // (bool) flag disposizione passiva
|
||||
static const std::string GVAR_SBH = ".SBH" ; // (bool) flag disposizione con operazioni manuali
|
||||
static const std::string GVAR_TABNAME = ".TABNAME" ; // (string) nome tavola
|
||||
static const std::string GVAR_TABORI1 = ".TABORI1" ; // (Point3d) prima origine di tavola
|
||||
static const std::string GVAR_FIXID = ".FIXID" ; // (int) identificativo bloccaggio (fixture)
|
||||
static const std::string GVAR_FIXIND = ".FIXIND" ; // (int) indice bloccaggio
|
||||
static const std::string GVAR_FIXNAME = ".FIXNAME" ; // (string) nome bloccaggio
|
||||
static const std::string GVAR_FIXPOS = ".FIXPOS" ; // (Point3d) posizione bloccaggio
|
||||
static const std::string GVAR_FIXANG = ".FIXANG" ; // (num) angolo di rotazione bloccaggio
|
||||
static const std::string GVAR_FIXMOB = ".FIXMOB" ; // (num) movimento eventuale parte mobile del bloccaggio
|
||||
static const std::string GVAR_RAWID = ".RAWID" ; // (int) identificativo grezzo
|
||||
static const std::string GVAR_RAWIND = ".RAWIND" ; // (int) indice movimento del grezzo
|
||||
static const std::string GVAR_RAWTYPE = ".RAWTYPE" ; // (int) tipo di movimento del grezzo
|
||||
static const std::string GVAR_RAWPOS = ".RAWPOS" ; // (Point3d) posizione di movimento del grezzo
|
||||
static const std::string GVAR_RAWFLAG = ".RAWFLAG" ; // (int) flag per movimento del grezzo
|
||||
static const std::string GVAR_TOOL = ".TOOL" ; // (string) nome utensile
|
||||
static const std::string GVAR_HEAD = ".HEAD" ; // (string) nome testa
|
||||
static const std::string GVAR_EXIT = ".EXIT" ; // (int) indice uscita
|
||||
static const std::string GVAR_TCPOS = ".TCPOS" ; // (string) eventuale posizione utensile nel TC
|
||||
static const std::string GVAR_TCOMP = ".TCOMP" ; // (int) numero correttore utensile
|
||||
static const std::string GVAR_TDIAM = ".TDIAM" ; // (num) diametro utensile
|
||||
static const std::string GVAR_TTOTDIAM = ".TTOTDIAM" ; // (num) diametro totale utensile
|
||||
static const std::string GVAR_TLEN = ".TLEN" ; // (num) lunghezza utensile
|
||||
static const std::string GVAR_TTOTLEN = ".TTOTLEN" ; // (num) lunghezza totale utensile
|
||||
static const std::string GVAR_TUSED = ".TUSED" ; // (bool) flag per indicare che l'utensile attrezzato è anche utilizzato
|
||||
static const std::string GVAR_SMAX = ".SMAX" ; // (num) massima speed utensile
|
||||
static const std::string GVAR_FIRST = ".FIRST" ; // (bool) flag per primo utensile
|
||||
static const std::string GVAR_NEXTTOOL = ".NEXTTOOL" ; // (string) nome del prossimo utensile
|
||||
static const std::string GVAR_NEXTHEAD = ".NEXTHEAD" ; // (string) nome testa del prossimo utensile
|
||||
static const std::string GVAR_NEXTEXIT = ".NEXTEXIT" ; // (int) indice uscita su testa del prox utensile
|
||||
static const std::string GVAR_NEXTTCPOS = ".NEXTTCPOS" ; // (string) eventuale posizione del prox utensile nel TC
|
||||
static const std::string GVAR_MCHID = ".MCHID" ; // (int) identificativo lavorazione
|
||||
static const std::string GVAR_MCHIND = ".MCHIND" ; // (int) indice lavorazione
|
||||
static const std::string GVAR_MMIN = ".MMIN" ; // (Point3d) punto minimo di ingombro della lavorazione
|
||||
static const std::string GVAR_MMAX = ".MMAX" ; // (Point3d) punto massimo di ingombro della lavorazione
|
||||
static const std::string GVAR_MAXMIN = ".MAXMIN" ; // (double/s) minimo di ingombro degli assi della lavorazione
|
||||
static const std::string GVAR_MAXMAX = ".MAXMAX" ; // (double/s) massimo di ingombro degli assi della lavorazione
|
||||
static const std::string GVAR_PATHID = ".PATHID" ; // (int) identificativo percorso di lavorazione
|
||||
static const std::string GVAR_PATHIND = ".PATHIND" ; // (int) indice percorso di lavorazione
|
||||
static const std::string GVAR_START = ".START" ; // (Point3d) punto iniziale del percorso originale
|
||||
static const std::string GVAR_END = ".END" ; // (Point3d) punto finale del percorso originale
|
||||
static const std::string GVAR_EXTR = ".EXTR" ; // (Vector3d)versore estrusione
|
||||
static const std::string GVAR_PMIN = ".PMIN" ; // (Point3d) punto minimo di ingombro del percorso di lavorazione
|
||||
static const std::string GVAR_PMAX = ".PMAX" ; // (Point3d) punto massimo di ingombro del percorso di lavorazione
|
||||
static const std::string GVAR_PATHID = ".PATHID" ; // (int) identificativo percorso di lavorazione
|
||||
static const std::string GVAR_PATHIND = ".PATHIND" ; // (int) indice percorso di lavorazione
|
||||
static const std::string GVAR_START = ".START" ; // (Point3d) punto iniziale del percorso originale
|
||||
static const std::string GVAR_END = ".END" ; // (Point3d) punto finale del percorso originale
|
||||
static const std::string GVAR_EXTR = ".EXTR" ; // (Vector3d) versore estrusione
|
||||
static const std::string GVAR_PMIN = ".PMIN" ; // (Point3d) punto minimo di ingombro del percorso di lavorazione
|
||||
static const std::string GVAR_PMAX = ".PMAX" ; // (Point3d) punto massimo di ingombro del percorso di lavorazione
|
||||
static const std::string GVAR_PAXMIN = ".PAXMIN" ; // (double/s) minimo di ingombro degli assi del percorso di lavorazione
|
||||
static const std::string GVAR_PAXMAX = ".PAXMAX" ; // (double/s) massimo di ingombro degli assi del percorso di lavorazione
|
||||
static const std::string GVAR_ELEV = ".ELEV" ; // (double) massima elevazione
|
||||
static const std::string GVAR_AUXTOT = ".AUXTOT" ; // (int) numero totale dati ausiliari inizio/fine percorso di lavorazione
|
||||
static const std::string GVAR_AUXIND = ".AUXIND" ; // (int) indice dato ausiliario inizio/fine percorso di lavorazione
|
||||
static const std::string GVAR_AUX = ".AUX" ; // (string) dato ausiliario inizio/fine percorso di lavorazione
|
||||
static const std::string GVAR_MOVEID = ".MOVEID" ; // (int) identificativo movimento
|
||||
static const std::string GVAR_MOVEIND = ".MOVEIND" ; // (int) indice movimento
|
||||
static const std::string GVAR_MOVE = ".MOVE" ; // (int) tipo di movimento (0,1,2,3)
|
||||
static const std::string GVAR_L1 = ".L1" ; // (num) valore del primo asse lineare
|
||||
static const std::string GVAR_L2 = ".L2" ; // (num) valore del secondo asse lineare
|
||||
static const std::string GVAR_L3 = ".L3" ; // (num) valore del terzo asse lineare
|
||||
static const std::string GVAR_R1 = ".R1" ; // (num) valore del primo asse rotante
|
||||
static const std::string GVAR_R2 = ".R2" ; // (num) valore del secondo asse rotante
|
||||
static const std::string GVAR_R3 = ".R3" ; // (num) valore del terzo asse rotante
|
||||
static const std::string GVAR_R4 = ".R4" ; // (num) valore del quarto asse rotante
|
||||
static const std::string GVAR_C1 = ".C1" ; // (num) valore del primo asse lineare per centro arco
|
||||
static const std::string GVAR_C2 = ".C2" ; // (num) valore del secondo asse lineare per centro arco
|
||||
static const std::string GVAR_C3 = ".C3" ; // (num) valore del terzo asse lineare per centro arco
|
||||
static const std::string GVAR_M1 = ".M1" ; // (num) valore del primo asse lineare per punto medio arco
|
||||
static const std::string GVAR_M2 = ".M2" ; // (num) valore del secondo asse lineare per punto medio arco
|
||||
static const std::string GVAR_M3 = ".M3" ; // (num) valore del terzo asse lineare per punto medio arco
|
||||
static const std::string GVAR_RR = ".RR" ; // (num) valore raggio per arco
|
||||
static const std::string GVAR_AC = ".AC" ; // (num) valore angolo al centro per arco
|
||||
static const std::string GVAR_L1P = ".L1p" ; // (num) valore precedente del primo asse lineare
|
||||
static const std::string GVAR_L2P = ".L2p" ; // (num) valore precedente del secondo asse lineare
|
||||
static const std::string GVAR_L3P = ".L3p" ; // (num) valore precedente del terzo asse lineare
|
||||
static const std::string GVAR_R1P = ".R1p" ; // (num) valore precedente del primo asse rotante
|
||||
static const std::string GVAR_R2P = ".R2p" ; // (num) valore precedente del secondo asse rotante
|
||||
static const std::string GVAR_R3P = ".R3p" ; // (num) valore precedente del terzo asse rotante
|
||||
static const std::string GVAR_R4P = ".R4p" ; // (num) valore precedente del quarto asse rotante
|
||||
static const std::string GVAR_L1T = ".L1t" ; // (string) token del primo asse lineare
|
||||
static const std::string GVAR_L2T = ".L2t" ; // (string) token del secondo asse lineare
|
||||
static const std::string GVAR_L3T = ".L3t" ; // (string) token del terzo asse lineare
|
||||
static const std::string GVAR_R1T = ".R1t" ; // (string) token del primo asse rotante
|
||||
static const std::string GVAR_R2T = ".R2t" ; // (string) token del secondo asse rotante
|
||||
static const std::string GVAR_R3T = ".R3t" ; // (string) token del terzo asse rotante
|
||||
static const std::string GVAR_R4T = ".R4t" ; // (string) token del quarto asse rotante
|
||||
static const std::string GVAR_C1T = ".C1t" ; // (string) token del primo asse lineare per centro arco
|
||||
static const std::string GVAR_C2T = ".C2t" ; // (string) token del secondo asse lineare per centro arco
|
||||
static const std::string GVAR_C3T = ".C3t" ; // (string) token del terzo asse lineare per centro arco
|
||||
static const std::string GVAR_M1T = ".M1t" ; // (string) token del primo asse lineare per punto medio arco
|
||||
static const std::string GVAR_M2T = ".M2t" ; // (string) token del secondo asse lineare per punto medio arco
|
||||
static const std::string GVAR_M3T = ".M3t" ; // (string) token del terzo asse lineare per punto medio arco
|
||||
static const std::string GVAR_RRT = ".RRt" ; // (string) token del raggio per arco
|
||||
static const std::string GVAR_L1N = ".L1n" ; // (string) nome del primo asse lineare
|
||||
static const std::string GVAR_L2N = ".L2n" ; // (string) nome del secondo asse lineare
|
||||
static const std::string GVAR_L3N = ".L3n" ; // (string) nome del terzo asse lineare
|
||||
static const std::string GVAR_R1N = ".R1n" ; // (string) nome del primo asse rotante
|
||||
static const std::string GVAR_R2N = ".R2n" ; // (string) nome del secondo asse rotante
|
||||
static const std::string GVAR_R3N = ".R3n" ; // (string) nome del terzo asse rotante
|
||||
static const std::string GVAR_R4N = ".R4n" ; // (string) nome del quarto asse rotante
|
||||
static const std::string GVAR_MASK = ".MASK" ; // (int) mask associato ai movimenti in rapido
|
||||
static const std::string GVAR_FLAG = ".FLAG" ; // (int) flag associato ad ogni movimento
|
||||
static const std::string GVAR_FLAG2 = ".FLAG2" ; // (int) secondo flag associato ad ogni movimento
|
||||
static const std::string GVAR_INDEX = ".IDX" ; // (int) indice associato ad ogni movimento
|
||||
static const std::string GVAR_TDIR = ".TDIR" ; // (Vector3d)versore utensile nel riferimento pezzo
|
||||
static const std::string GVAR_CDIR = ".CDIR" ; // (Vector3d)versore correzione nel riferimento pezzo
|
||||
static const std::string GVAR_ADIR = ".ADIR" ; // (Vector3d)versore ausiliario nel riferimento pezzo
|
||||
static const std::string GVAR_ENABAXES = ".EnabAxes" ; // (bool) flag abilitazione assi attivi per simulazione
|
||||
static const std::string GVAR_SHOWAXES = ".ShowAxes" ; // (bool) flag visualizzazione assi attivi per simulazione
|
||||
static const std::string GVAR_AUXAXES = ".AuxAxes" ; // (int) numero assi ausiliari per simulazione
|
||||
static const std::string GVAR_AN = ".AN" ; // (num) valore del N-esimo asse ausiliario per simulazione
|
||||
static const std::string GVAR_ANN = ".ANn" ; // (string) nome del N-esimo asse ausiliario per simulazione
|
||||
static const std::string GVAR_VMILL = ".VMILL" ; // (int/s) identificativi Zmap attivi per Virtual Milling
|
||||
static const std::string GVAR_CODET = ".CODET" ; // (int/s) identificativi Zmap attivi per Collision Detection
|
||||
static const std::string GVAR_SIM1ST = ".SIM1ST" ; // (bool) flag inizio simulazione
|
||||
static const std::string GVAR_SIMSTEP = ".SIMSTEP" ; // (num) step di movimento durante la simulazione
|
||||
static const std::string GVAR_SIMUISTAT = ".SIMUISTAT" ; // (num) stato simulazione imposto da utente
|
||||
static const std::string GVAR_SAFEDIST = ".SAFEDIST" ; // (num) distanza di sicurezza per verifica di collisione
|
||||
static const std::string GVAR_SIMVMID = ".SIMVMID" ; // (int) identificativo grezzo Vmill in collisione
|
||||
static const std::string GVAR_SIMCOBIND = ".SIMCOBIND" ; // (int) indice oggetto in collisione
|
||||
static const std::string GVAR_ELEV = ".ELEV" ; // (double) massima elevazione
|
||||
static const std::string GVAR_AUXTOT = ".AUXTOT" ; // (int) numero totale dati ausiliari inizio/fine percorso di lavorazione
|
||||
static const std::string GVAR_AUXIND = ".AUXIND" ; // (int) indice dato ausiliario inizio/fine percorso di lavorazione
|
||||
static const std::string GVAR_AUX = ".AUX" ; // (string) dato ausiliario inizio/fine percorso di lavorazione
|
||||
static const std::string GVAR_MOVEID = ".MOVEID" ; // (int) identificativo movimento
|
||||
static const std::string GVAR_MOVEIND = ".MOVEIND" ; // (int) indice movimento
|
||||
static const std::string GVAR_MOVE = ".MOVE" ; // (int) tipo di movimento (0,1,2,3)
|
||||
static const std::string GVAR_L1 = ".L1" ; // (num) valore del primo asse lineare
|
||||
static const std::string GVAR_L2 = ".L2" ; // (num) valore del secondo asse lineare
|
||||
static const std::string GVAR_L3 = ".L3" ; // (num) valore del terzo asse lineare
|
||||
static const std::string GVAR_R1 = ".R1" ; // (num) valore del primo asse rotante
|
||||
static const std::string GVAR_R2 = ".R2" ; // (num) valore del secondo asse rotante
|
||||
static const std::string GVAR_R3 = ".R3" ; // (num) valore del terzo asse rotante
|
||||
static const std::string GVAR_R4 = ".R4" ; // (num) valore del quarto asse rotante
|
||||
static const std::string GVAR_C1 = ".C1" ; // (num) valore del primo asse lineare per centro arco
|
||||
static const std::string GVAR_C2 = ".C2" ; // (num) valore del secondo asse lineare per centro arco
|
||||
static const std::string GVAR_C3 = ".C3" ; // (num) valore del terzo asse lineare per centro arco
|
||||
static const std::string GVAR_M1 = ".M1" ; // (num) valore del primo asse lineare per punto medio arco
|
||||
static const std::string GVAR_M2 = ".M2" ; // (num) valore del secondo asse lineare per punto medio arco
|
||||
static const std::string GVAR_M3 = ".M3" ; // (num) valore del terzo asse lineare per punto medio arco
|
||||
static const std::string GVAR_RR = ".RR" ; // (num) valore raggio per arco
|
||||
static const std::string GVAR_AC = ".AC" ; // (num) valore angolo al centro per arco
|
||||
static const std::string GVAR_L1P = ".L1p" ; // (num) valore precedente del primo asse lineare
|
||||
static const std::string GVAR_L2P = ".L2p" ; // (num) valore precedente del secondo asse lineare
|
||||
static const std::string GVAR_L3P = ".L3p" ; // (num) valore precedente del terzo asse lineare
|
||||
static const std::string GVAR_R1P = ".R1p" ; // (num) valore precedente del primo asse rotante
|
||||
static const std::string GVAR_R2P = ".R2p" ; // (num) valore precedente del secondo asse rotante
|
||||
static const std::string GVAR_R3P = ".R3p" ; // (num) valore precedente del terzo asse rotante
|
||||
static const std::string GVAR_R4P = ".R4p" ; // (num) valore precedente del quarto asse rotante
|
||||
static const std::string GVAR_L1T = ".L1t" ; // (string) token del primo asse lineare
|
||||
static const std::string GVAR_L2T = ".L2t" ; // (string) token del secondo asse lineare
|
||||
static const std::string GVAR_L3T = ".L3t" ; // (string) token del terzo asse lineare
|
||||
static const std::string GVAR_R1T = ".R1t" ; // (string) token del primo asse rotante
|
||||
static const std::string GVAR_R2T = ".R2t" ; // (string) token del secondo asse rotante
|
||||
static const std::string GVAR_R3T = ".R3t" ; // (string) token del terzo asse rotante
|
||||
static const std::string GVAR_R4T = ".R4t" ; // (string) token del quarto asse rotante
|
||||
static const std::string GVAR_C1T = ".C1t" ; // (string) token del primo asse lineare per centro arco
|
||||
static const std::string GVAR_C2T = ".C2t" ; // (string) token del secondo asse lineare per centro arco
|
||||
static const std::string GVAR_C3T = ".C3t" ; // (string) token del terzo asse lineare per centro arco
|
||||
static const std::string GVAR_M1T = ".M1t" ; // (string) token del primo asse lineare per punto medio arco
|
||||
static const std::string GVAR_M2T = ".M2t" ; // (string) token del secondo asse lineare per punto medio arco
|
||||
static const std::string GVAR_M3T = ".M3t" ; // (string) token del terzo asse lineare per punto medio arco
|
||||
static const std::string GVAR_RRT = ".RRt" ; // (string) token del raggio per arco
|
||||
static const std::string GVAR_L1N = ".L1n" ; // (string) nome del primo asse lineare
|
||||
static const std::string GVAR_L2N = ".L2n" ; // (string) nome del secondo asse lineare
|
||||
static const std::string GVAR_L3N = ".L3n" ; // (string) nome del terzo asse lineare
|
||||
static const std::string GVAR_R1N = ".R1n" ; // (string) nome del primo asse rotante
|
||||
static const std::string GVAR_R2N = ".R2n" ; // (string) nome del secondo asse rotante
|
||||
static const std::string GVAR_R3N = ".R3n" ; // (string) nome del terzo asse rotante
|
||||
static const std::string GVAR_R4N = ".R4n" ; // (string) nome del quarto asse rotante
|
||||
static const std::string GVAR_MASK = ".MASK" ; // (int) mask associato ai movimenti in rapido
|
||||
static const std::string GVAR_FLAG = ".FLAG" ; // (int) flag associato ad ogni movimento
|
||||
static const std::string GVAR_FLAG2 = ".FLAG2" ; // (int) secondo flag associato ad ogni movimento
|
||||
static const std::string GVAR_INDEX = ".IDX" ; // (int) indice associato ad ogni movimento
|
||||
static const std::string GVAR_TDIR = ".TDIR" ; // (Vector3d) versore utensile nel riferimento pezzo
|
||||
static const std::string GVAR_CDIR = ".CDIR" ; // (Vector3d) versore correzione nel riferimento pezzo
|
||||
static const std::string GVAR_ADIR = ".ADIR" ; // (Vector3d) versore ausiliario nel riferimento pezzo
|
||||
static const std::string GVAR_TDIRP = ".TDIRp" ; // (Vector3d) precedente versore utensile nel riferimento pezzo
|
||||
static const std::string GVAR_ENABAXES = ".EnabAxes" ; // (bool) flag abilitazione assi attivi per simulazione
|
||||
static const std::string GVAR_SHOWAXES = ".ShowAxes" ; // (bool) flag visualizzazione assi attivi per simulazione
|
||||
static const std::string GVAR_AUXAXES = ".AuxAxes" ; // (int) numero assi ausiliari per simulazione
|
||||
static const std::string GVAR_AN = ".AN" ; // (num) valore del N-esimo asse ausiliario per simulazione
|
||||
static const std::string GVAR_ANN = ".ANn" ; // (string) nome del N-esimo asse ausiliario per simulazione
|
||||
static const std::string GVAR_VMILL = ".VMILL" ; // (int/s) identificativi Zmap attivi per Virtual Milling
|
||||
static const std::string GVAR_CODET = ".CODET" ; // (int/s) identificativi Zmap attivi per Collision Detection
|
||||
static const std::string GVAR_SIM1ST = ".SIM1ST" ; // (bool) flag inizio simulazione
|
||||
static const std::string GVAR_SIMSTEP = ".SIMSTEP" ; // (num) step di movimento durante la simulazione
|
||||
static const std::string GVAR_SIMUISTAT = ".SIMUISTAT" ; // (num) stato simulazione imposto da utente
|
||||
static const std::string GVAR_SAFEDIST = ".SAFEDIST" ; // (num) distanza di sicurezza per verifica di collisione
|
||||
static const std::string GVAR_SIMVMID = ".SIMVMID" ; // (int) identificativo grezzo Vmill in collisione
|
||||
static const std::string GVAR_SIMCOBIND = ".SIMCOBIND" ; // (int) indice oggetto in collisione
|
||||
// Funzioni generazione
|
||||
static const std::string ON_START = "OnStart" ;
|
||||
static const std::string ON_END = "OnEnd" ;
|
||||
|
||||
+1813
-1021
File diff suppressed because it is too large
Load Diff
+36
-27
@@ -18,6 +18,7 @@
|
||||
#include "ToolData.h"
|
||||
#include "/EgtDev/Include/EGkCurveComposite.h"
|
||||
#include "/EgtDev/Include/EgtNumUtils.h"
|
||||
#include "/EgtDev/Include/EGkSurfFlatRegion.h"
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
class Pocketing : public Machining
|
||||
@@ -70,46 +71,54 @@ class Pocketing : public Machining
|
||||
bool SetCurveAllTempProp( int nCrvId, ICurve* pCurve) ;
|
||||
bool ResetCurveAllTempProp( ICurve* pCurve) ;
|
||||
bool Chain( int nGrpDestId) ;
|
||||
bool ProcessPath( int nPathId, int nPvId, int nClId) ;
|
||||
bool ProcessPath( int nAuxId, int nPvId, int nClId) ;
|
||||
bool CalcRegionElevation( const ICurveComposite* pCompo, const Vector3d& vtTool, double dDepth, double dRad, double& dElev) const ;
|
||||
bool VerifyPathFromBottom( const ICurveComposite* pCompo, const Vector3d& vtTool) ;
|
||||
bool GeneratePocketingPv( int nPathId, const ICurveComposite* pCompo) ;
|
||||
bool AddZigZag( const ICurveComposite* pCompo, const Vector3d& vtTool, const Vector3d& vtExtr,
|
||||
double dDepth, double dElev, double dOkStep, bool bSplitArcs) ;
|
||||
bool CalcZigZag( const ICurveComposite* pOffs, ICRVCOMPOPOVECTOR& vpCrvs) ;
|
||||
bool AddOneWay( const ICurveComposite* pCompo, const Vector3d& vtTool, const Vector3d& vtExtr,
|
||||
double dDepth, double dElev, double dOkStep, bool bSplitArcs) ;
|
||||
bool AddSpiralIn( const ICurveComposite* pCompo, const Vector3d& vtTool, const Vector3d& vtExtr,
|
||||
double dDepth, double dElev, double dOkStep, bool bSplitArcs, bool bMidOpen,
|
||||
const Point3d& ptMidOpen, const Vector3d& vtMidOut) ;
|
||||
bool AddSpiralOut( const ICurveComposite* pCompo, const Vector3d& vtTool, const Vector3d& vtExtr,
|
||||
double dDepth, double dElev, double dOkStep, bool bSplitArcs) ;
|
||||
bool CalcSpiral( const ICurveComposite* pCompo, int nReg, bool bSplitArcs,
|
||||
ICurveComposite* pMCrv, ICurveComposite* pRCrv) ;
|
||||
bool CalcBoundedLink( const Point3d& ptStart, const Point3d& ptEnd, const ICurve* pCrvBound,
|
||||
ICurveComposite* pCrvLink) ;
|
||||
bool GeneratePocketingPv( int nPathId, const ISurfFlatRegion* pSrf) ;
|
||||
bool AddZigZag( const ISurfFlatRegion* pSrf, const Vector3d& vtTool, const Vector3d& vtExtr,
|
||||
double dDepth, double dElev, double dOkStep, bool bSplitArcs) ;
|
||||
bool CalcZigZag( const ISurfFlatRegion* pSrf, ICRVCOMPOPOVECTOR& vpCrvs) ;
|
||||
bool AddOneWay( const ISurfFlatRegion* pSrf, const Vector3d& vtTool, const Vector3d& vtExtr,
|
||||
double dDepth, double dElev, double dOkStep, bool bSplitArcs) ;
|
||||
bool AddSpiralIn( const ISurfFlatRegion* pSrf, const Vector3d& vtTool, const Vector3d& vtExtr,
|
||||
double dDepth, double dElev, double dOkStep, bool bSplitArcs, bool bMidOpen,
|
||||
const Point3d& ptMidOpen, const Vector3d& vtMidOut) ;
|
||||
bool AddSpiralOut( const ISurfFlatRegion* pSrf, const Vector3d& vtTool, const Vector3d& vtExtr,
|
||||
double dDepth, double dElev, double dOkStep, bool bSplitArcs) ;
|
||||
bool CalcSpiral( const ISurfFlatRegion* pSrf, int nReg, bool bSplitArcs,
|
||||
ICurveComposite* pMCrv, ICurveComposite* pRCrv) ;
|
||||
bool RemoveUncutRegions( const ISurfFlatRegion * pCutRegion, ICRVCOMPOPVECTOR& vOffs, const ISurfFlatRegion * pSrfBound) ;
|
||||
bool FindCurveForPathAdd( const ICurve* pResidualCrv, const ICRVCOMPOPOVECTOR& vOffs, size_t& nIdxMin, Point3d& ptMinDist,
|
||||
double& dMinDistPar, const ISurfFlatRegion * pSrfBound) ;
|
||||
bool ComputeAdditionalPath( const Point3d ptStart, Point3d ptEnd, bool bUsePtEnd, ICurveComposite * pAddPath,
|
||||
const ICurve * pResidualCrv, const ISurfFlatRegion * pSrfBound, ISurfFlatRegion * pNewCutRegion) ;
|
||||
bool AdditionalPathExternalCentroid( const Point3d ptStart, ICurveComposite * pAddPath, ICurveComposite * pResidualCrv,
|
||||
const ISurfFlatRegion * pSrfBound, ISurfFlatRegion * pNewCutRegion) ;
|
||||
bool CalcBoundedLink( const Point3d& ptStart, const Point3d& ptEnd, const ISurfFlatRegion * pSrf,
|
||||
ICurveComposite* pCrvLink) ;
|
||||
bool CircleSpiral( ISurfFlatRegion* pSrf, bool bSplitArcs, ICRVCOMPOPVECTOR& vOffs, ICurveComposite* pRCrv) ;
|
||||
bool CalcCircleSpiral( const Point3d& ptCen, const Vector3d& vtN, double dOutRad, double dIntRad,
|
||||
bool bSplitArcs, ICurveComposite* pMCrv, ICurveComposite* pRCrv) ;
|
||||
bool bSplitArcs, ICurveComposite* pMCrv, ICurveComposite* pRCrv) ;
|
||||
bool AddApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dSafeAggrBottZ,
|
||||
double dElev, double dAppr, bool bOutStart) ;
|
||||
double dElev, double dAppr, bool bOutStart) ;
|
||||
bool AddLinkApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dSafeAggrBottZ,
|
||||
double dElev, double dAppr) ;
|
||||
double dElev, double dAppr) ;
|
||||
bool AddLinkRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dSafeAggrBottZ,
|
||||
double dElev, double dAppr) ;
|
||||
double dElev, double dAppr) ;
|
||||
bool AddRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dSafeAggrBottZ,
|
||||
double dElev, double dAppr) ;
|
||||
double dElev, double dAppr) ;
|
||||
bool CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtStart, const Vector3d& vtN,
|
||||
const ICurveComposite* pRCrv, Point3d& ptP1) const ;
|
||||
const ICurveComposite* pRCrv, Point3d& ptP1) const ;
|
||||
bool AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d& vtStart, const Vector3d& vtN,
|
||||
const ICurveComposite* pCompo, const ICurveComposite* pRCrv, bool bAtLeft, bool bSplitArcs, bool bNoneForced = false) ;
|
||||
const ISurfFlatRegion* pSrf, const ICurveComposite* pRCrv, bool bAtLeft, bool bSplitArcs, bool bNoneForced = false) ;
|
||||
bool AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d& vtN,
|
||||
const ICurveComposite* pRCrv, bool bSplitArcs, Point3d& ptP1, double& dElev, bool bNoneForced = false) ;
|
||||
const ICurveComposite* pRCrv, bool bSplitArcs, Point3d& ptP1, double& dElev, bool bNoneForced = false) ;
|
||||
double GetRadiusForStartEndElevation( void) const ;
|
||||
bool GetMidOfLongestOpenSide( const ICurveComposite* pCompo, Point3d& ptMid, Vector3d& vtMidOut) ;
|
||||
bool AdjustContourWithOpenEdges( ICurveComposite* pCompo) ;
|
||||
bool AdjustContourWithOpenEdges( ICurveComposite* pCompo) ;
|
||||
bool AdjustContourStart( ICurveComposite* pCompo) ;
|
||||
bool VerifyLeadInHelix( const ICurveComposite* pCompo, const Point3d& ptCen, double dRad) const ;
|
||||
bool VerifyLeadInZigZag( const ICurveComposite* pCompo, const Point3d& ptPa, const Point3d& ptPb) const ;
|
||||
bool VerifyLeadInHelix( const ISurfFlatRegion* pSrf, const Point3d& ptCen, double dRad) const ;
|
||||
bool VerifyLeadInZigZag( const ISurfFlatRegion* pSrf, const Point3d& ptPa, const Point3d& ptPb) const ;
|
||||
|
||||
private :
|
||||
double GetSpeed( void) const
|
||||
|
||||
+2
-9
@@ -600,14 +600,7 @@ SawFinishing::Update( bool bPostApply)
|
||||
}
|
||||
|
||||
// imposto eventuale asse bloccato da lavorazione
|
||||
if ( ! m_Params.m_sBlockedAxis.empty()) {
|
||||
string sAxis, sVal ;
|
||||
Split( m_Params.m_sBlockedAxis, "=", true, sAxis, sVal) ;
|
||||
double dVal = 0 ;
|
||||
FromString( sVal, dVal) ;
|
||||
m_pMchMgr->ClearRotAxisBlock() ;
|
||||
m_pMchMgr->SetRotAxisBlock( sAxis, dVal) ;
|
||||
}
|
||||
SetBlockedRotAxis( m_Params.m_sBlockedAxis) ;
|
||||
|
||||
// calcolo gli assi macchina
|
||||
string sHint = ExtractHint( m_Params.m_sUserNotes) ;
|
||||
@@ -1774,7 +1767,7 @@ SawFinishing::TrimSection( ICurve* pCrv)
|
||||
|
||||
// calcolo la classificazione della curva rispetto alla regione
|
||||
CRVCVECTOR ccClass ;
|
||||
if ( ! pSfr->GetCurveClassification( *pCrv, ccClass))
|
||||
if ( ! pSfr->GetCurveClassification( *pCrv, EPS_SMALL, ccClass))
|
||||
return false ;
|
||||
|
||||
// determino l'intervallo di curva da conservare
|
||||
|
||||
+2
-9
@@ -564,14 +564,7 @@ SawRoughing::Update( bool bPostApply)
|
||||
}
|
||||
|
||||
// imposto eventuale asse bloccato da lavorazione
|
||||
if ( ! m_Params.m_sBlockedAxis.empty()) {
|
||||
string sAxis, sVal ;
|
||||
Split( m_Params.m_sBlockedAxis, "=", true, sAxis, sVal) ;
|
||||
double dVal = 0 ;
|
||||
FromString( sVal, dVal) ;
|
||||
m_pMchMgr->ClearRotAxisBlock() ;
|
||||
m_pMchMgr->SetRotAxisBlock( sAxis, dVal) ;
|
||||
}
|
||||
SetBlockedRotAxis( m_Params.m_sBlockedAxis) ;
|
||||
|
||||
// calcolo gli assi macchina
|
||||
string sHint = ExtractHint( m_Params.m_sUserNotes) ;
|
||||
@@ -1459,7 +1452,7 @@ SawRoughing::TrimSection( ICurve* pCrv)
|
||||
|
||||
// calcolo la classificazione della curva rispetto alla regione
|
||||
CRVCVECTOR ccClass ;
|
||||
if ( ! pSfr->GetCurveClassification( *pCrv, ccClass))
|
||||
if ( ! pSfr->GetCurveClassification( *pCrv, EPS_SMALL, ccClass))
|
||||
return false ;
|
||||
|
||||
// determino l'intervallo di curva da conservare
|
||||
|
||||
+1
-8
@@ -735,14 +735,7 @@ Sawing::Update( bool bPostApply)
|
||||
}
|
||||
|
||||
// imposto eventuale asse bloccato da lavorazione
|
||||
if ( ! m_Params.m_sBlockedAxis.empty()) {
|
||||
string sAxis, sVal ;
|
||||
Split( m_Params.m_sBlockedAxis, "=", true, sAxis, sVal) ;
|
||||
double dVal = 0 ;
|
||||
FromString( sVal, dVal) ;
|
||||
m_pMchMgr->ClearRotAxisBlock() ;
|
||||
m_pMchMgr->SetRotAxisBlock( sAxis, dVal) ;
|
||||
}
|
||||
SetBlockedRotAxis( m_Params.m_sBlockedAxis) ;
|
||||
|
||||
// calcolo gli assi macchina
|
||||
string sHint = ExtractHint( m_Params.m_sUserNotes) ;
|
||||
|
||||
+45
-28
@@ -593,14 +593,7 @@ SurfFinishing::Update( bool bPostApply)
|
||||
}
|
||||
|
||||
// imposto eventuale asse bloccato da lavorazione
|
||||
if ( ! m_Params.m_sBlockedAxis.empty()) {
|
||||
string sAxis, sVal ;
|
||||
Split( m_Params.m_sBlockedAxis, "=", true, sAxis, sVal) ;
|
||||
double dVal = 0 ;
|
||||
FromString( sVal, dVal) ;
|
||||
m_pMchMgr->ClearRotAxisBlock() ;
|
||||
m_pMchMgr->SetRotAxisBlock( sAxis, dVal) ;
|
||||
}
|
||||
SetBlockedRotAxis( m_Params.m_sBlockedAxis) ;
|
||||
|
||||
// calcolo gli assi macchina
|
||||
string sHint = ExtractHint( m_Params.m_sUserNotes) ;
|
||||
@@ -840,28 +833,39 @@ bool
|
||||
SurfFinishing::VerifyGeometry( SelData Id, int& nSubs)
|
||||
{
|
||||
// ammessi : curve o superfici
|
||||
|
||||
// per ora accetto solo curve
|
||||
const ICurve* pCurve = nullptr ;
|
||||
const IGeoObj* pGObj = m_pGeomDB->GetGeoObj( Id.nId) ;
|
||||
// se direttamente la curva
|
||||
if ( Id.nSub == SEL_SUB_ALL) {
|
||||
pCurve = ::GetCurve( pGObj) ;
|
||||
if ( pCurve != nullptr) {
|
||||
if ( pCurve->GetType() == CRV_COMPO)
|
||||
nSubs = ::GetCurveComposite( pCurve)->GetCurveCount() ;
|
||||
else
|
||||
nSubs = 0 ;
|
||||
if ( pGObj == nullptr)
|
||||
return false ;
|
||||
// se curva
|
||||
if ( ( pGObj->GetType() & GEO_CURVE) != 0) {
|
||||
const ICurve* pCurve = nullptr ;
|
||||
// se direttamente la curva
|
||||
if ( Id.nSub == SEL_SUB_ALL) {
|
||||
pCurve = ::GetCurve( pGObj) ;
|
||||
if ( pCurve != nullptr) {
|
||||
if ( pCurve->GetType() == CRV_COMPO)
|
||||
nSubs = ::GetCurveComposite( pCurve)->GetCurveCount() ;
|
||||
else
|
||||
nSubs = 0 ;
|
||||
}
|
||||
}
|
||||
// altrimenti sottocurva di composita
|
||||
else {
|
||||
const ICurveComposite* pCompo = GetCurveComposite( pGObj) ;
|
||||
if ( pCompo != nullptr)
|
||||
pCurve = pCompo->GetCurve( Id.nSub) ;
|
||||
nSubs = 0 ;
|
||||
}
|
||||
return ( pCurve != nullptr) ;
|
||||
}
|
||||
// altrimenti sottocurva di composita
|
||||
else {
|
||||
const ICurveComposite* pCompo = GetCurveComposite( pGObj) ;
|
||||
if ( pCompo != nullptr)
|
||||
pCurve = pCompo->GetCurve( Id.nSub) ;
|
||||
nSubs = 0 ;
|
||||
// se altrimenti è superficie trimesh
|
||||
else if ( pGObj->GetType() == SRF_TRIMESH) {
|
||||
const ISurfTriMesh* pSurf = ::GetSurfTriMesh( pGObj) ;
|
||||
return ( pSurf != nullptr && pSurf->GetFacetCount() >= 1) ;
|
||||
}
|
||||
return ( pCurve != nullptr) ;
|
||||
// altrimenti errore
|
||||
else
|
||||
return false ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -921,6 +925,10 @@ SurfFinishing::GetCurves( SelData Id, ICURVEPLIST& lstPC)
|
||||
lstPC.emplace_back( Release( pCurve)) ;
|
||||
return true ;
|
||||
}
|
||||
// se altrimenti superficie
|
||||
else if ( pGObj->GetType() == SRF_TRIMESH)
|
||||
return true ;
|
||||
// altrimenti errore
|
||||
else
|
||||
return false ;
|
||||
}
|
||||
@@ -1222,7 +1230,16 @@ SurfFinishing::GetActiveSurfaces( INTVECTOR& vSurfId) const
|
||||
// verifiche
|
||||
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
|
||||
return false ;
|
||||
// ciclo sui grezzi attivi nella fase
|
||||
// cerco tra gli oggetti selezionati
|
||||
for ( const auto& Id : m_vId) {
|
||||
int nEntId = Id.nId ;
|
||||
if ( m_pGeomDB->GetGeoType( nEntId) == SRF_TRIMESH)
|
||||
vSurfId.emplace_back( nEntId) ;
|
||||
}
|
||||
// se trovate superfici, considero solo queste ed esco
|
||||
if ( ! vSurfId.empty())
|
||||
return true ;
|
||||
// altrimenti considero tutte le superfici dei pezzi nei grezzi attivi della fase
|
||||
int nRawId = m_pMchMgr->GetFirstRawPart() ;
|
||||
while ( nRawId != GDB_ID_NULL) {
|
||||
if ( m_pMchMgr->VerifyRawPartPhase(nRawId, m_nPhase)) {
|
||||
@@ -1475,7 +1492,7 @@ SurfFinishing::CalcZigZag( const ICurveComposite* pOffs,
|
||||
// calcolo la classificazione della curva rispetto al contorno esterno offsettato
|
||||
IntersCurveCurve intCC( *pLine, *pOffs) ;
|
||||
CRVCVECTOR ccClass ;
|
||||
if ( ! intCC.GetCurveClassification( 0, ccClass)) {
|
||||
if ( ! intCC.GetCurveClassification( 0, EPS_SMALL, ccClass)) {
|
||||
m_pMchMgr->SetLastError( 3110, "Error in SurfFinishing : Toolpath not computable") ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
+12
-2
@@ -354,17 +354,23 @@ ToolData::SetParam( int nType, double dVal)
|
||||
m_dMinFeed = dVal ;
|
||||
return true ;
|
||||
case TPA_DIST :
|
||||
if ( abs( dVal) > 0)
|
||||
if ( abs( dVal) > EPS_SMALL)
|
||||
SetValInNotes( TSI_DIST, dVal, m_sSysNotes) ;
|
||||
else
|
||||
RemoveValInNotes( TSI_DIST, m_sSysNotes) ;
|
||||
return true ;
|
||||
case TPA_STEMDIAM :
|
||||
if ( abs( dVal) > 0)
|
||||
if ( abs( dVal) > EPS_SMALL)
|
||||
SetValInNotes( TSI_STEM_DIAM, dVal, m_sSysNotes) ;
|
||||
else
|
||||
RemoveValInNotes( TSI_STEM_DIAM, m_sSysNotes) ;
|
||||
return true ;
|
||||
case TPA_CORE :
|
||||
if ( abs( dVal) > EPS_SMALL)
|
||||
SetValInNotes( TSI_CORE, dVal, m_sSysNotes) ;
|
||||
else
|
||||
RemoveValInNotes( TSI_CORE, m_sSysNotes) ;
|
||||
return true ;
|
||||
}
|
||||
return false ;
|
||||
}
|
||||
@@ -500,6 +506,10 @@ ToolData::GetParam( int nType, double& dVal) const
|
||||
dVal = 0 ;
|
||||
GetValInNotes( m_sSysNotes, TSI_STEM_DIAM, dVal) ;
|
||||
return true ;
|
||||
case TPA_CORE :
|
||||
dVal = 0 ;
|
||||
GetValInNotes( m_sSysNotes, TSI_CORE, dVal) ;
|
||||
return true ;
|
||||
}
|
||||
dVal = 0 ;
|
||||
return false ;
|
||||
|
||||
+4
-13
@@ -542,8 +542,6 @@ ToolsMgr::SaveCurrTool( void)
|
||||
m_suData.emplace( m_tdCurrTool.m_sName, m_tdCurrTool.m_Uuid) ;
|
||||
}
|
||||
}
|
||||
// aggiorno dati portautensile
|
||||
UpdateCurrToolHolderData() ;
|
||||
// eseguo salvataggio
|
||||
m_bModified = true ;
|
||||
if ( find( m_utModified.begin(), m_utModified.end(), m_tdCurrTool.m_Uuid) == m_utModified.end())
|
||||
@@ -554,18 +552,11 @@ ToolsMgr::SaveCurrTool( void)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ToolsMgr::UpdateCurrToolHolderData( void)
|
||||
ToolsMgr::UpdateCurrToolHolderData( double dTHoldLen, double dTHoldDiam)
|
||||
{
|
||||
// Leggo i dati del portautensile dal disegno dell'utensile
|
||||
PtrOwner<IGeomDB> pGeomDB( CreateGeomDB()) ;
|
||||
pGeomDB->Init() ;
|
||||
string sDrawPath = m_sToolsDir + "\\" + m_tdCurrTool.m_sDraw ;
|
||||
pGeomDB->Load( sDrawPath) ;
|
||||
int nToolId = pGeomDB->GetFirstGroupInGroup( GDB_ID_ROOT) ;
|
||||
double dTHoldLen = 0 ;
|
||||
pGeomDB->GetInfo( nToolId, TTH_LEN, dTHoldLen) ;
|
||||
double dTHoldDiam = 0 ;
|
||||
pGeomDB->GetInfo( nToolId, TTH_DIAM, dTHoldDiam) ;
|
||||
// verifico validità utensile corrente
|
||||
if ( ! m_bCurrTool)
|
||||
return false ;
|
||||
// Aggiorno i dati nelle note di sistema
|
||||
SetValInNotes( TSI_THLEN, dTHoldLen, m_tdCurrTool.m_sSysNotes) ;
|
||||
SetValInNotes( TSI_THDIAM, dTHoldDiam, m_tdCurrTool.m_sSysNotes) ;
|
||||
|
||||
+1
-1
@@ -56,6 +56,7 @@ class ToolsMgr
|
||||
bool GetCurrToolParam( int nType, double& dVal) const ;
|
||||
bool GetCurrToolParam( int nType, std::string& sVal) const ;
|
||||
template <class T> bool GetCurrToolValInNotes( int nType, const std::string& sKey, T& Val) const ;
|
||||
bool UpdateCurrToolHolderData( double dTHoldLen, double dTHoldDiam) ;
|
||||
bool GetCurrToolMaxDepth( double dSafe, double& dMaxDepth) const ;
|
||||
bool GetCurrToolThDiam( double& dThDiam) const ;
|
||||
bool GetCurrToolThLength( double& dThLen) const ;
|
||||
@@ -72,7 +73,6 @@ class ToolsMgr
|
||||
bool SaveHeader( Writer& TheWriter) const ;
|
||||
bool SaveOneTool( const EgtUUID& Uuid, int& nCounter, Writer& TheWriter) const ;
|
||||
bool VerifyTool( int nFamily, std::string& sName, int& nType) const ;
|
||||
bool UpdateCurrToolHolderData( void) ;
|
||||
bool ExportOneTool( const std::string& sToolName, Writer& TheWriter, const int& nCounter, const std::string& sOutDir) ;
|
||||
bool ReadTool( Scanner& TheScanner, ToolData& tData, const int& nToolSize) const ;
|
||||
bool CopyToolDraw( const std::string& sDraw, const std::string& sOutDraw, const std::string& sToolName) ;
|
||||
|
||||
+1
-8
@@ -725,14 +725,7 @@ WaterJetting::Update( bool bPostApply)
|
||||
}
|
||||
|
||||
// imposto eventuale asse bloccato da lavorazione
|
||||
if ( ! m_Params.m_sBlockedAxis.empty()) {
|
||||
string sAxis, sVal ;
|
||||
Split( m_Params.m_sBlockedAxis, "=", true, sAxis, sVal) ;
|
||||
double dVal = 0 ;
|
||||
FromString( sVal, dVal) ;
|
||||
m_pMchMgr->ClearRotAxisBlock() ;
|
||||
m_pMchMgr->SetRotAxisBlock( sAxis, dVal) ;
|
||||
}
|
||||
SetBlockedRotAxis( m_Params.m_sBlockedAxis) ;
|
||||
|
||||
// calcolo gli assi macchina
|
||||
string sHint = ExtractHint( m_Params.m_sUserNotes) ;
|
||||
|
||||
Reference in New Issue
Block a user