Files
EgtMachKernel/MachMgr.h
T
Dario Sassi f31aacdc14 EgtMachKernel 2.2d4 :
- aggiunta gestione TcPos (posizioni di cambio utensile) da configurazione macchina
- aggiunte funzioni GetToolsInCurrSetupPos, GetTcPosId e GetAllTcPosNames.
2020-04-27 07:27:23 +00:00

507 lines
29 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2015-2019
//----------------------------------------------------------------------------
// File : MachMgr.h Data : 16.05.19 Versione : 2.1e3
// Contenuto : Dichiarazione della classe MachMgr.
//
//
//
// Modifiche : 23.03.15 DS Creazione modulo.
// 16.05.19 DS Aggiunto parametro sToolMakersDir a Init.
//
//----------------------------------------------------------------------------
#pragma once
#include "MachConst.h"
#include "Machine.h"
#include "ToolsMgr.h"
#include "MachiningsMgr.h"
#include "SetupMgr.h"
#include "Simulator.h"
#include "/EgtDev/Include/EMkMachMgr.h"
#include "/EgtDev/Include/EgtNumCollection.h"
//----------------------------------------------------------------------------
struct MachGrp {
std::string MGeoName ;
int SetupGroupId ;
int FixtGroupId ;
int RawGroupId ;
int OperGroupId ;
MachGrp( void)
: MGeoName(), SetupGroupId( GDB_ID_NULL), FixtGroupId( GDB_ID_NULL),
RawGroupId( GDB_ID_NULL), OperGroupId( GDB_ID_NULL) {}
MachGrp( const std::string& MgName, int SgId, int FgId, int RgId, int OgId)
: MGeoName( MgName), SetupGroupId( SgId), FixtGroupId( FgId),
RawGroupId( RgId), OperGroupId( OgId) {}
} ;
//----------------------------------------------------------------------------
struct AxisBlock {
std::string sAxis ;
double dVal ;
AxisBlock( void)
: sAxis(), dVal( 0) {}
AxisBlock( const std::string& sA, double dV)
: sAxis( sA), dVal( dV) {}
} ;
//----------------------------------------------------------------------------
struct MachineData {
std::string sName ;
Machine* pMachine ;
ToolsMgr* pTsMgr ;
MachiningsMgr* pMsMgr ;
MachineData( void)
: pMachine( nullptr), pTsMgr( nullptr), pMsMgr( nullptr) {}
MachineData( const std::string& sN, Machine* pM, ToolsMgr* pTM, MachiningsMgr* pMM)
{ sName = sN ; pMachine = pM ; pTsMgr = pTM ; pMsMgr = pMM ; }
} ;
//----------------------------------------------------------------------------
class MachMgr : public IMachMgr
{
public :
// Basic
~MachMgr( void) override ;
bool Init( const std::string& sMachinesDir, const std::string& sToolMakersDir, IGeomDB* pGeomDB,
int nContextId, const std::string& sLuaLibsDir, const std::string& sLuaLastRequire) override ;
bool Update( void) override ;
bool Insert( int nInsGrp) override ;
int GetLastErrorId( void) const override
{ return m_nLastError ; }
std::string GetLastErrorString( void) const override
{ return m_sLastError ; }
int GetWarningId( int nInd) const override
{ if ( nInd >= int( m_Warnings.size())) return 0 ; return m_Warnings[ nInd].first ; }
std::string GetWarningString( int nInd) const override
{ if ( nInd >= int( m_Warnings.size())) return "" ; return m_Warnings[ nInd].second ; }
// Machines
bool SetCurrMachine( const std::string& sMachineName) override ;
bool GetCurrMachineName( std::string& sMachineName) const override ;
bool GetCurrMachineDir( std::string& sMachineDir) const override ;
// MachGroups
int GetMachGroupCount( void) const override ;
int GetFirstMachGroup( void) const override ;
int GetNextMachGroup( int nId) const override ;
int GetLastMachGroup( void) const override ;
int GetPrevMachGroup( int nId) const override ;
bool GetMachGroupNewName( std::string& sName) const override ;
int AddMachGroup( const std::string& sName, const std::string& sMachineName) override ;
bool RemoveMachGroup( int nId) override ;
std::string GetMachGroupName( int nId) const override ;
std::string GetMachGroupMachineName( int nId) const override ;
int GetMachGroupId( const std::string& sName) const override ;
bool SetCurrMachGroup( int nId) override ;
bool ResetCurrMachGroup( void) override ;
int GetCurrMachGroup( void) const override ;
// Phases
int AddPhase( void) override ;
bool SetCurrPhase( int nPhase, bool bForced = false) override ;
int GetCurrPhase( void) const override ;
bool RemoveLastPhase( void) override ;
int GetPhaseCount( void) const override ;
// RawParts
int GetRawPartCount( void) const override ;
int GetFirstRawPart( void) const override ;
int GetNextRawPart( int nId) const override ;
bool IsRawPart( int nId) const override
{ return VerifyRawPart( nId) ; }
int AddRawPart( const Point3d& ptOrig, double dLen, double dWidth, double dHeight, Color cCol) override ;
int AddRawPartWithPart( int nPartId, int nCrvSrfId, double dOverMat, Color cCol) override ;
bool ModifyRawPart( int nRawId, const Point3d& ptOrig, double dLen, double dWidth, double dHeight, Color cCol) override ;
bool ModifyRawPart( int nRawId, int nCrvId, double dOverMat, double dZmin, double dHeight, Color cCol) override ;
bool ModifyRawPartSize( int nRawId, double dLength, double dWidth, double dHeight) override ;
bool ModifyRawPartHeight( int nRawId, double dHeight) override ;
bool KeepRawPart( int nRawId, int nSouPhase) override ;
bool VerifyRawPartPhase( int nRawId, int nPhase) const override ;
bool RemoveRawPartFromCurrPhase( int nRawId) override ;
bool RemoveRawPart( int nRawId) override ;
bool RotateRawPart( int nRawId, const Vector3d& vtAx, double dAngRotDeg) override ;
bool MoveToCornerRawPart( int nRawId, const Point3d& ptCorner, int nFlag) override ;
bool MoveToCenterRawPart( int nRawId, const Point3d& ptCenter, int nFlag) override ;
bool MoveRawPart( int nRawId, const Vector3d& vtMove) override ;
bool GetRawPartCenter( int nRawId, Point3d& ptCen) override ;
bool GetRawPartBBox( int nRawId, BBox3d& b3Raw) override ;
int SplitFlatRawPartWithMachinings( int nRawId, const INTVECTOR& vMchId) override ;
// Parts
int GetPartInRawPartCount( int nRawId) const override ;
int GetFirstPartInRawPart( int nRawId) const override ;
int GetNextPartInRawPart( int nId) const override ;
bool AddPartToRawPart( int nPartId, const Point3d& ptPos, int nRawId) override ;
int GetRawPartFromPart( int nPartId) override ;
bool RemovePartFromRawPart( int nPartId) override ;
bool TranslatePartInRawPart( int nPartId, const Vector3d& vtMove) override ;
bool RotatePartInRawPart( int nPartId, const Vector3d& vtAx, double dAngRotDeg) override ;
// Tables and Fixtures
bool SetTable( const std::string& sTable) override ;
bool SetTableAreaOffset( double dOffsXP, double dOffsYP, double dOffsXM, double dOffsYM) override ;
bool GetTable( std::string& sTable) const override ;
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 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 ;
bool RemoveFixture( int nFxtId) override ;
bool VerifyFixture( int nFxtId) const override ;
int GetFirstFixture( void) const override ;
int GetNextFixture( int nFxtId) const override ;
bool MoveFixture( int nId, const Vector3d& vtMove) override ;
bool RotateFixture( int nId, double dDeltaAngDeg) override ;
bool MoveFixtureMobile( int nId, double dDeltaMov) override ;
// Tools DataBase
bool TdbGetToolNewName( std::string& sName) const override ;
bool TdbAddTool( const std::string& sName, int nType) override ;
bool TdbCopyTool( const std::string& sSource, const std::string& sName) override ;
bool TdbRemoveTool( const std::string& sName) override ;
bool TdbGetFirstTool( int nFamily, std::string& sName, int& nType) const override ;
bool TdbGetNextTool( int nFamily, std::string& sName, int& nType) const override ;
bool TdbGetToolFromUUID( const std::string& sTuuid, std::string& sName) const override ;
bool TdbSetCurrTool( const std::string& sName) override ;
bool TdbSaveCurrTool( void) override ;
bool TdbIsCurrToolModified( void) const override ;
bool TdbSetCurrToolParam( int nType, bool bVal) override ;
bool TdbSetCurrToolParam( int nType, int nVal) override ;
bool TdbSetCurrToolParam( int nType, double dVal) override ;
bool TdbSetCurrToolParam( int nType, const std::string& sVal) override ;
bool TdbSetCurrToolValInNotes( int nType, const std::string& sKey, bool bVal) override ;
bool TdbSetCurrToolValInNotes( int nType, const std::string& sKey, int nVal) override ;
bool TdbSetCurrToolValInNotes( int nType, const std::string& sKey, double dVal) override ;
bool TdbSetCurrToolValInNotes( int nType, const std::string& sKey, const std::string& sVal) override ;
bool TdbRemoveCurrToolValInNotes( int nType, const std::string& sKey) override ;
bool TdbGetCurrToolParam( int nType, bool& bVal) const override ;
bool TdbGetCurrToolParam( int nType, int& nVal) const override ;
bool TdbGetCurrToolParam( int nType, double& dVal) const override ;
bool TdbGetCurrToolParam( int nType, std::string& sVal) const override ;
bool TdbGetCurrToolValInNotes( int nType, const std::string& sKey, bool& bVal) const override ;
bool TdbGetCurrToolValInNotes( int nType, const std::string& sKey, int& nVal) const override ;
bool TdbGetCurrToolValInNotes( int nType, const std::string& sKey, double& dVal) const override ;
bool TdbGetCurrToolValInNotes( int nType, const std::string& sKey, std::string& sVal) const override ;
bool TdbGetCurrToolMaxDepth( double& dMaxDepth) const override ;
bool TdbGetCurrToolThDiam( double& dThDiam) const override ;
int TdbCurrToolDraw( int nGenCtx, int nToolCtx) const override ;
bool TdbReload( void) override ;
bool TdbSave( void) const override ;
bool TdbGetToolDir( std::string& sToolDir) const override ;
bool TdbGetToolHolderDir( std::string& sTHolderDir) const override ;
// Setup
int GetCurrSetup( void) const override ;
bool GetDefaultSetupName( std::string& sName) const override ;
bool ImportSetup( const std::string& sName) override ;
bool VerifyCurrSetup( STRVECTOR& vsErrors) override ;
bool FindToolInCurrSetup( const std::string& sTool) override ;
bool GetToolsInCurrSetupPos( const std::string& sTcPos, STRVECTOR& vsTools) override ;
bool UpdateCurrSetup( void) override ;
bool EraseCurrSetup( void) override ;
// Machinings DataBase
bool MdbGetMachiningNewName( std::string& sName) const override ;
bool MdbAddMachining( const std::string& sName, int nType) ;
bool MdbCopyMachining( const std::string& sSource, const std::string& sName) override ;
bool MdbRemoveMachining( const std::string& sName) override ;
bool MdbGetFirstMachining( int nType, std::string& sName) const override ;
bool MdbGetNextMachining( int nType, std::string& sName) const override ;
bool MdbGetMachiningFromUUID( const std::string& sMuuid, std::string& sName) const override ;
bool MdbSetCurrMachining( const std::string& sName) override ;
bool MdbSaveCurrMachining( void) override ;
bool MdbIsCurrMachiningModified( void) const override ;
bool MdbSetCurrMachiningParam( int nType, bool bVal) override ;
bool MdbSetCurrMachiningParam( int nType, int nVal) override ;
bool MdbSetCurrMachiningParam( int nType, double dVal) override ;
bool MdbSetCurrMachiningParam( int nType, const std::string& sVal) override ;
bool MdbGetCurrMachiningParam( int nType, bool& bVal) const override ;
bool MdbGetCurrMachiningParam( int nType, int& nVal) const override ;
bool MdbGetCurrMachiningParam( int nType, double& dVal) const override ;
bool MdbGetCurrMachiningParam( int nType, std::string& sVal) const override ;
bool MdbSetGeneralParam( int nType, bool bVal) override ;
bool MdbSetGeneralParam( int nType, int nVal) override ;
bool MdbSetGeneralParam( int nType, double dVal) override ;
bool MdbGetGeneralParam( int nType, bool& bVal) const override ;
bool MdbGetGeneralParam( int nType, int& nVal) const override ;
bool MdbGetGeneralParam( int nType, double& dVal) const override ;
bool MdbReload( void) override ;
bool MdbSave( void) const override ;
bool MdbGetMachiningDir( std::string& sMchDir) const override ;
// Operations : general
int GetOperationCount( void) const override ;
int GetFirstOperation( void) const override ;
int GetNextOperation( int nId) const override ;
int GetLastOperation( void) const override ;
int GetPrevOperation( int nId) const override ;
int GetFirstActiveOperation( void) const override ;
int GetNextActiveOperation( int nId) const override ;
int GetLastActiveOperation( void) const override ;
int GetPrevActiveOperation( int nId) const override ;
int GetOperationType( int nId) const override ;
int GetOperationPhase( int nId) const override ;
bool SetOperationName( int nId, const std::string& sName) override ;
std::string GetOperationName( int nId) const override ;
int GetOperationId( const std::string& sName) const override ;
bool IsOperationEmpty( int nId) const override ;
bool RemoveOperation( int nId) override ;
bool RemoveAllPhaseOperations( int nPhase) override ;
bool RemoveAllOperations( void) override ;
bool SetOperationMode( int nId, bool bActive) override ;
bool GetOperationMode( int nId, bool& bActive) const override ;
bool SetAllOperationsMode( bool bExceptFirstDisp, bool bActive) override ;
bool SetOperationStatus( int nId, bool bShow) override ;
bool GetOperationStatus( int nId, bool& bShow) const override ;
bool SetAllOperationsStatus(bool bExceptFirstDisp, bool bShow) override ;
bool ChangeOperationPhase( int nMchId, int nNewPhase) override ;
int GetPhaseLastOperation( int nPhase) const override ;
bool RemoveOperationHome( int nId) override ;
// Operations : dispositions
int GetPhaseDisposition( int nPhase) const override ;
bool DispositionSpecialApply( int nId, bool bRecalc) override ;
bool DispositionSpecialUpdate( int nId) override ;
// Operations : machinings
int AddMachining( const std::string& sName, const std::string& sMachining) override ;
int AddMachining( const std::string& sName, int nMchType, const std::string& sTool) override ;
int CopyMachining( const std::string& sName, const std::string& sSouName) override ;
bool SetCurrMachining( int nId) override ;
bool ResetCurrMachining( void) override ;
int GetCurrMachining( void) const override ;
bool SetMachiningParam( int nType, bool bVal, bool* pbChanged = nullptr) override ;
bool SetMachiningParam( int nType, int nVal, bool* pbChanged = nullptr) override ;
bool SetMachiningParam( int nType, double dVal, bool* pbChanged = nullptr) override ;
bool SetMachiningParam( int nType, const std::string& sVal, bool* pbChanged = nullptr) override ;
bool SetMachiningGeometry( const SELVECTOR& vIds) override ;
bool MachiningPreview( bool bRecalc) override ;
bool ExistsMachiningPreview( void) override ;
bool RemoveMachiningPreview( void) override ;
bool MachiningApply( bool bRecalc, bool bPostApply = true) override ;
bool MachiningUpdate( bool bPostApply = true) override ;
bool PreparePreviewMachiningTool( void) const override ;
bool RemovePreviewMachiningTool( void) const override ;
int PreviewMachiningTool( int nEntId, int nFlag) const override ;
bool GetMachiningParam( int nType, bool& bVal) const override ;
bool GetMachiningParam( int nType, int& nVal) const override ;
bool GetMachiningParam( int nType, double& dVal) const override ;
bool GetMachiningParam( int nType, std::string& sVal) const override ;
bool GetMachiningGeometry( SELVECTOR& vIds) const override ;
bool IsMachiningEmpty( void) const override ;
bool GetMachiningStartPoint( Point3d& ptStart) const override ;
bool GetMachiningEndPoint( Point3d& ptEnd) const override ;
// CL Entities Interrogations
bool GetClEntMove( int nEntId, int& nMove) const override ;
bool GetClEntFlag( int nEntId, int& nFlag) const override ;
bool GetClEntIndex( int nEntId, int& nIndex) const override ;
// Simulation
bool SimInit( void) override ;
bool SimStart( bool bFirst) override ;
bool SimMove( int& nStatus) override ;
bool SimGetAxisInfoPos( int nI, std::string& sName, std::string& sToken, bool& bLinear, double& dVal) const override ;
bool SimGetToolInfo( std::string& sName, double& dSpeed) const override ;
bool SimGetOperationInfo( std::string& sName, int& nType) const override ;
bool SimGetMoveInfo( int& nGmove, double& dFeed) const override ;
bool SimSetStep( double dStep) override ;
bool SimSetUiStatus( int nUiStatus) override ;
bool SimGoHome( void) override ;
bool SimExit( void) override ;
// Generation
bool Generate( const std::string& sCncFile, const std::string& sInfo) override ;
bool Estimate( const std::string& sEstFile, const std::string& sInfo) override ;
// Machine Calc
bool SetCalcTable( const std::string& sTable) override ;
bool SetCalcTool( const std::string& sTool, const std::string& sHead, int nExit) override ;
bool SetRotAxisBlock( const std::string& sAxis, double dVal) override ;
bool GetRotAxisBlocked( int nInd, std::string& sAxis, double& dVal) const override ;
bool GetCalcTool( std::string& sTool) const override ;
bool GetCalcAngles( const Vector3d& vtDirT, const Vector3d& vtDirA,
int& nStat, double& dAngA1, double& dAngB1, double& dAngA2, double& dAngB2) const override ;
bool GetCalcAngles( const Vector3d& vtDirT, const Vector3d& vtDirA,
int& nStat, DBLVECTOR& vAng1, DBLVECTOR& vAng2) const ;
bool GetCalcPositions( const Point3d& ptP, double dAngA, double dAngB,
int& nStat, double& dX, double& dY, double& dZ) const override ;
bool GetCalcPositions( const Point3d& ptP, DBLVECTOR& vAng,
int& nStat, double& dX, double& dY, double& dZ) const ;
bool GetCalcTipFromPositions( double dX, double dY, double dZ, double dAngA, double dAngB,
bool bOverall, bool bBottom, Point3d& ptTip) const override ;
bool GetCalcTipFromPositions( double dX, double dY, double dZ, const DBLVECTOR& vAng,
bool bOverall, bool bBottom, Point3d& ptTip) const ;
bool GetCalcToolDirFromAngles( const DBLVECTOR& vAng, Vector3d& vtDir) const override ;
bool GetCalcAuxDirFromAngles( const DBLVECTOR& vAng, Vector3d& vtDir) const override ;
bool GetNearestAngleInStroke( int nInd, double dAngRef, double& dAng) const override ;
bool LimitAngleToStroke( int nInd, double& dAng) const override ;
bool VerifyOutstroke( double dX, double dY, double dZ, double dAngA, double dAngB, int& nStat) const override ;
std::string GetOutstrokeInfo( bool bMM = true) const override ;
// Machine
int GetBaseId( const std::string& sBase) const override ;
int GetTableId( const std::string& sTable) const override ;
int GetAxisId( const std::string& sAxis) const override ;
int GetHeadId( const std::string& sHead) const override ;
int GetHeadExitCount( const std::string& sHead) const override ;
int GetTcPosId( const std::string& sTcPos) const override ;
bool GetAxisToken( const std::string& sAxis, std::string& sToken) const override ;
bool GetAxisType( const std::string& sAxis, bool& bLinear) const override ;
bool GetAxisInvert( const std::string& sAxis, bool& bInvert) const override ;
bool SetAxisPos( const std::string& sAxis, double dVal, double* pdNewVal = nullptr) override ;
bool GetAxisPos( const std::string& sAxis, double& dVal) const override ;
bool GetAxisHomePos( const std::string& sAxis, double& dHomeVal) const override ;
bool ResetAxisPos( const std::string& sAxis) override ;
bool ResetAllAxesPos( void) override ;
bool GetAllTablesNames( STRVECTOR& vNames) const override ;
bool GetAllHeadsNames( STRVECTOR& vNames) const override ;
bool GetAllTcPosNames( STRVECTOR& vNames) const override ;
bool LoadTool( const std::string& sHead, int nExit, const std::string& sTool) override ;
bool GetLoadedTool( const std::string& sHead, int nExit, std::string& sTool) const override ;
bool UnloadTool( const std::string& sHead, int nExit) override ;
bool ResetHeadSet( const std::string& sHead) override ;
bool SetMachineLook( int nFlag) override ;
int GetMachineLook( void) const override ;
public :
MachMgr( void) ;
// Basic
int GetContextId( void) const
{ return m_nContextId ; }
IGeomDB* GetGeomDB( void) const
{ return m_pGeomDB ; }
int GetMachBaseId( void) const
{ return m_nMachBaseId ; }
int GetMachAuxId( void) const
{ return m_nMachAuxId ; }
std::string GetLuaLibsDir( void) const
{ return m_sLuaLibsDir ; }
std::string GetLuaLastRequire( void) const
{ return m_sLuaLastRequire ; }
bool SetLastError( int nErr, const std::string& sErr) ;
void ResetLastError( void)
{ m_nLastError = 0 ; m_sLastError.clear() ; }
bool SetWarning( int nWarn, const std::string& sWarn) ;
void ResetWarnings( void)
{ m_Warnings.clear() ; }
// Current Machine
std::string GetCurrSetupDir( void) const
{ Machine* pMch = GetCurrMachine() ;
return ( pMch != nullptr ? pMch->GetMachineDir() + "\\" + SETUP_DIR : "") ; }
std::string GetCurrFixtDir( void) const
{ Machine* pMch = GetCurrMachine() ;
return ( pMch != nullptr ? pMch->GetMachineDir() + "\\" + FIXTURES_DIR : "") ; }
// MachGroups
std::string GetCurrMGeoName( void) const
{ return ( ExistsCurrMachGroup() ? m_cCurrMGrp.MGeoName : "") ; }
int GetCurrSetupGroupId( void) const
{ return ( ExistsCurrMachGroup() ? m_cCurrMGrp.SetupGroupId : GDB_ID_NULL) ; }
int GetCurrFixtGroupId( void) const
{ return ( ExistsCurrMachGroup() ? m_cCurrMGrp.FixtGroupId : GDB_ID_NULL) ; }
int GetCurrRawGroupId( void) const
{ return ( ExistsCurrMachGroup() ? m_cCurrMGrp.RawGroupId : GDB_ID_NULL) ; }
int GetCurrOperId( void) const
{ return ( ExistsCurrMachGroup() ? m_cCurrMGrp.OperGroupId : GDB_ID_NULL) ; }
// RawParts
bool VerifyRawPart( int nRawId, bool bLinkedAllowed = true) const ;
bool GetRawPartPhases( int nRawId, INTVECTOR& vPhase) const ;
// Tables and Fixtures
bool VerifyFixtureInGroup( int nFxtId, bool bLinkedAllowed = true) const ;
bool GetFixturePhases( int nFxtId, INTVECTOR& vPhase) const ;
int GetUnusedFixture( const std::string& sName, int nPhase) const ;
bool IsUnusedFixture( int nId, int nPhase) const ;
// Setup
SetupMgr& GetCurrSetupMgr( void) const
{ return const_cast<SetupMgr&>( m_stuMgr) ; }
// Machines
bool IsCurrMachineLoaded( void) const ;
Machine* GetCurrMachine( void) const ;
ToolsMgr* GetCurrToolsMgr( void) const ;
MachiningsMgr* GetCurrMachiningsMgr( void) const ;
// MachineCalc
int GetCurrLinAxes( void) const ;
int GetCurrRotAxes( void) const ;
bool GetAllCurrAxesName( STRVECTOR& vAxName) const ;
bool GetAllCurrAxesHomePos( DBLVECTOR& vAxHomeVal) const ;
bool GetCurrAxisHomePos( int nInd, double& dHome) const ;
bool ApplyRotAxisBlock( void) ;
void ClearRotAxisBlock( void)
{ m_vAxisBlock.clear() ; }
bool IsKinematicRotAxisBlocked( int nInd) const ;
int GetCalcTool( void) const ;
double GetCalcRot1W( void) const ;
bool SetCalcSolCh( int nScc, bool bExact) ;
bool VerifyAngleOutstroke( int nInd, double dAng) const ;
bool VerifyOutstroke( double dX, double dY, double dZ, const DBLVECTOR& vAng, bool bClear, int& nStat) const ;
bool ExistProtectedAreas( void) const ;
// Operations
bool GetOperationNewName( std::string& sName) const ;
const ToolData* GetMachiningToolData( void) const ;
// Simulation
bool SimAddCollisionObj( int nInd, int nFrameId, int nType, double dPar1, double dPar2, double dPar3) ;
// Machine
bool GetHeadAbove( const std::string& sHead) const ;
double GetAngDeltaMinForHome( void) const ;
private :
// Basic
void Clear( void) ;
bool IsMachBase( int nId) const ;
int FindMachBase( int nGroupId) const ;
bool VerifyMachBase( void) const ;
bool CreateMachBase( void) ;
bool IsMachAux( int nId) const ;
bool VerifyMachAux( void) const ;
bool CreateMachAux( void) ;
// MachGroups
bool PrepareCurrMachGroup( int nId) ;
bool VerifyMachGroup( int nId, MachGrp& mgData) const ;
bool ExistsCurrMachGroup( void) const
{ return ( m_pGeomDB != nullptr && m_nCurrMGrpId != GDB_ID_NULL) ; }
// Machines
bool LoadMachine( const std::string& sMachineName) ;
int GetMachine( const std::string& sMachineName) const ;
int GetCurrMachineId( void) const ;
// Phases
bool PrepareCurrPhase( int nPhase, bool bDoDisp, bool bForced) ;
int CalcPhaseCount( void) const ;
// RawParts
int AddRawPart( int nCrvId, double dOverMat, double dZmin, double dHeight, Color cCol) ;
int AddRawPart( int nSurfId, Color cCol) ;
bool SetRawPartCenter( int nRawId) ;
bool ResetRawPartCenter( int nRawId) ;
// Parts
bool SwapParts( bool bToRawPart) ;
bool SwapRawPartParts( int nRawId, bool bToRawPart) ;
int SwapRawPartPart( int nId, bool bToRawPart) ;
bool UpdateStatusMgoLayers( int nPartId, bool bToRawPart) ;
bool ShowRootParts( bool bShow) ;
// Tools DataBase
bool UpdateAllToolDraws( void) const ;
bool UpdateToolDraw( const EgtUUID& UuidTool) 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 ;
// Operations : general
bool InitOperation( int nId) ;
// Operations : dispositions
int AddDisposition( const std::string& sName) ;
private :
typedef std::vector<MachineData> MCHDATAVECTOR ;
typedef std::vector<AxisBlock> AXBLOCKVECTOR ;
private :
int m_nContextId ; // indice contesto corrente (1-based)
IGeomDB* m_pGeomDB ; // puntatore al DB geometrico del contesto corrente
std::string m_sMachinesDir ; // direttorio delle macchine
std::string m_sToolMakersDir ; // direttorio dei generatori di disegni utensili standard
std::string m_sLuaLibsDir ; // direttorio delle librerie lua
std::string m_sLuaLastRequire ; // nome ultima libreria caricata
int m_nLastError ; // identificativo ultimo errore
std::string m_sLastError ; // descrittivo ultimo errore
INTSTRVECTOR m_Warnings ; // identificativi e descrittivi avvisi
int m_nMachBaseId ; // identificativo gruppo base per le macchinate
int m_nMachAuxId ; // identificativo gruppo base per le macchine
int m_nCurrMGrpId ; // identificativo macchinata corrente
MachGrp m_cCurrMGrp ; // dati principali macchinata corrente
int m_nCurrMch ; // indice macchina corrente (0-based)
MCHDATAVECTOR m_vMachines ; // elenco macchine caricate
SetupMgr m_stuMgr ; // gestore attrezzaggio macchinata corrente
int m_nPhasesCount ; // numero fasi di lavorazione della macchinata corrente
int m_nCurrPhase ; // indice fase corrente (1-based)
int m_nCurrDispId ; // identificativo della disposizione corrente
int m_nCurrMachiningId ; // identificativo della lavorazione corrente
AXBLOCKVECTOR m_vAxisBlock ; // elenco assi da bloccare
Simulator* m_pSimul ; // puntatore al simulatore attivo
} ;