Merge commit 'cfb2fea0bdd6627485111e68a57482098dc62c82' into feature/SvuotatureConIsole

This commit is contained in:
SaraP
2021-11-18 09:54:32 +01:00
26 changed files with 251 additions and 153 deletions
+1 -8
View File
@@ -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 -8
View File
@@ -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) ;
BIN
View File
Binary file not shown.
+1 -8
View File
@@ -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) ;
+12 -2
View File
@@ -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 ;
}
+3 -2
View File
@@ -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
+2 -2
View File
@@ -488,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
+23 -9
View File
@@ -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) ;
@@ -631,8 +643,10 @@ MachMgr::UpdateStandardToolDraw( const ToolData* pTdata, int nGenCtx, int nToolC
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())
@@ -775,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)
@@ -822,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
+1 -1
View File
@@ -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
View File
@@ -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)
+6 -2
View File
@@ -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) ;
+40 -2
View File
@@ -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) ;
@@ -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)
+60 -24
View File
@@ -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,7 +2230,8 @@ 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
@@ -2273,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 ;
}
@@ -2382,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 ;
}
@@ -2673,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)
@@ -2744,14 +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-)
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, ptP1 - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), vtEscape, dNewStElev) && dNewStElev > EPS_SMALL)
dStElev = min( dStElev, 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) ;
@@ -2861,14 +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-)
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, ptP1 - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), vtEscape, dNewEndElev) && dNewEndElev > EPS_SMALL)
dEndElev = min( dEndElev, 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) ;
@@ -3735,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 ;
@@ -3749,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 ;
@@ -3759,6 +3766,7 @@ 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 ;
Vector3d vtRot = vtN - vtN * vtStart * vtStart ;
@@ -3806,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 ;
@@ -3830,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)) ;
@@ -4022,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 ;
@@ -4038,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 ;
@@ -4055,6 +4081,16 @@ Milling::AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d
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
+3 -2
View File
@@ -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
View File
@@ -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()) ;
+45 -2
View File
@@ -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 ;
@@ -1209,6 +1209,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 +1310,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) ;
+1
View File
@@ -99,6 +99,7 @@ class Operation : public IUserObj
bool GetClPathFinalAxesValues( int nClPathId, bool bSkipRise, DBLVECTOR& vAxVal) 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) ;
+4 -11
View File
@@ -678,14 +678,7 @@ Pocketing::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) ;
@@ -1790,8 +1783,8 @@ Pocketing::CalcRegionElevation( const ICurveComposite* pCompo, const Vector3d& v
// calcolo la classificazione della curva rispetto al contorno
IntersCurveCurve intCC( *pLine, *pCompoL) ;
CRVCVECTOR ccClass ;
if ( intCC.GetCurveClassification( 0, ccClass)) {
CRVCVECTOR ccClass ;
if ( intCC.GetCurveClassification( 0, EPS_SMALL, ccClass)) {
// determino gli intervalli di curva interni
Intervals inOk ;
for ( auto& ccOne : ccClass) {
@@ -2982,7 +2975,7 @@ Pocketing::AddSpiralIn( const ISurfFlatRegion* pSrf, const Vector3d& vtTool, con
dStElev = dStep ;
bool bUnderRaw = m_bAboveHead && ! m_bAggrBottom &&
GetPointUnderRaw( ptP1, vtTool, 0, GetRadiusForStartEndElevation(), m_TParams.m_dLen, false, dSafeZ, dStElev) ;
if ( bUnderRaw)
if ( bUnderRaw || ( bOutStart && ! m_bAboveHead))
dStElev = max( dStElev, dStep) ;
dStElev -= ( ptP1 - ptStart) * vtExtr ;
+2 -9
View File
@@ -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
View File
@@ -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
View File
@@ -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) ;
+2 -9
View File
@@ -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) ;
@@ -1499,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 ;
}
+3 -3
View File
@@ -354,19 +354,19 @@ 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) > 0)
if ( abs( dVal) > EPS_SMALL)
SetValInNotes( TSI_CORE, dVal, m_sSysNotes) ;
else
RemoveValInNotes( TSI_CORE, m_sSysNotes) ;
+4 -13
View File
@@ -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
View File
@@ -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
View File
@@ -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) ;