Files
EgtExecutor/EXE_MachMgr.cpp
T
Dario Sassi bb4772673b EgtExecutor 1.6l3 :
- aggiornamento per preview lavorazioni.
2015-12-15 14:52:02 +00:00

1472 lines
51 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2015-2015
//----------------------------------------------------------------------------
// File : EXE_MachMgr.cpp Data : 05.05.15 Versione : 1.6e1
// Contenuto : Funzioni Machining Manager per EXE.
//
//
//
// Modifiche : 23.03.15 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
//--------------------------- Include ----------------------------------------
#include "stdafx.h"
#include "EXE.h"
#include "EXE_Macro.h"
#include "Lua_Base.h"
#include "AuxTools.h"
#include "DllMachKernel.h"
#include "/EgtDev/Include/EXeExecutor.h"
#include "/EgtDev/Include/EGkStringUtils3d.h"
#include "/EgtDev/Include/EgtStringConverter.h"
#include "/EgtDev/Include/EgtPointerOwner.h"
using namespace std ;
//-----------------------------------------------------------------------------
bool
ExeInitMachMgr( const string& sMachinesDir)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_GEOMDB( pGseCtx, false)
// inizializzazione gestore lavorazioni
PtrOwner<IMachMgr> pMachMgr( MyCreateMachMgr()) ;
VERIFY_NULL( Get( pMachMgr), "Error in CreateMachMgr", false)
bool bOk = pMachMgr->Init( sMachinesDir, pGseCtx->m_pGeomDB,
GetIndCurrGseContext(), LuaGetLuaLibsDir(), LuaGetLastRequire()) ;
// assegno il gestore al contesto
pGseCtx->m_pMachMgr = ( bOk ? Release( pMachMgr) : nullptr) ;
// log avvio Machining Manager
string sLog = "MachMgr" ;
sLog += ( bOk ? " started" : " error") ;
sLog += " (" + sMachinesDir + ")" ;
LOG_INFO( GetLogger(), sLog.c_str())
return bOk ;
}
//-----------------------------------------------------------------------------
bool
ExeUpdateMachMgr( void)
{
IMachMgr* pMachMgr = GetCurrMachMgr() ;
VERIFY_MACHMGR( pMachMgr, false)
// aggiornamento gestore lavorazioni
return pMachMgr->Update() ;
}
//-----------------------------------------------------------------------------
bool
ExeInsertMachMgr( int nInsGrp)
{
IMachMgr* pMachMgr = GetCurrMachMgr() ;
VERIFY_MACHMGR( pMachMgr, false)
// sposto le macchinate dal gruppo di inserimento alla base macchinate
return pMachMgr->Insert( nInsGrp) ;
}
//-----------------------------------------------------------------------------
// Machines
//-----------------------------------------------------------------------------
bool
ExeSetCurrMachine( const string& sMachineName)
{
IMachMgr* pMachMgr = GetCurrMachMgr() ;
VERIFY_MACHMGR( pMachMgr, false)
// imposto la macchina corrente
return pMachMgr->SetCurrMachine( sMachineName) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetCurrMachineName( string& sMachineName)
{
IMachMgr* pMachMgr = GetCurrMachMgr() ;
VERIFY_MACHMGR( pMachMgr, false)
// recupero il nome della macchina corrente
return pMachMgr->GetCurrMachineName( sMachineName) ;
}
//-----------------------------------------------------------------------------
// Machining Groups
//-----------------------------------------------------------------------------
int
ExeGetMachGroupCount( void)
{
IMachMgr* pMachMgr = GetCurrMachMgr() ;
VERIFY_MACHMGR( pMachMgr, 0)
// recupero il numero di macchinate
return pMachMgr->GetMachGroupCount() ;
}
//-----------------------------------------------------------------------------
int
ExeGetFirstMachGroup( void)
{
IMachMgr* pMachMgr = GetCurrMachMgr() ;
VERIFY_MACHMGR( pMachMgr, GDB_ID_NULL)
// recupero la prima macchinata
return pMachMgr->GetFirstMachGroup() ;
}
//-----------------------------------------------------------------------------
int
ExeGetNextMachGroup( int nId)
{
IMachMgr* pMachMgr = GetCurrMachMgr() ;
VERIFY_MACHMGR( pMachMgr, GDB_ID_NULL)
// recupero la successiva macchinata
return pMachMgr->GetNextMachGroup( nId) ;
}
//-----------------------------------------------------------------------------
int
ExeAddMachGroup( const string& sName, const string& sMachineName)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, GDB_ID_NULL)
// aggiungo la macchinata (gruppo di lavorazione)
int nId = pGseCtx->m_pMachMgr->AddMachGroup( sName, sMachineName) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtAddMachGroup('" + sName + "','" +
sMachineName + "')" +
" -- Id=" + ToString( nId) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco il risultato
return nId ;
}
//-----------------------------------------------------------------------------
bool
ExeRemoveMachGroup( int nMGroupId)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// rimuovo la macchinata (gruppo di lavorazione)
bool bOk = pGseCtx->m_pMachMgr->RemoveMachGroup( nMGroupId) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtRemoveMachGroup(" + ToString( nMGroupId) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco il risultato
return bOk ;
}
//-----------------------------------------------------------------------------
bool
ExeGetMachGroupName( int nId, string& sName)
{
IMachMgr* pMachMgr = GetCurrMachMgr() ;
VERIFY_MACHMGR( pMachMgr, false)
// recupero il nome della macchinata
sName = pMachMgr->GetMachGroupName( nId) ;
return ( ! sName.empty()) ;
}
//-----------------------------------------------------------------------------
int
ExeGetMachGroupId( const string& sName)
{
IMachMgr* pMachMgr = GetCurrMachMgr() ;
VERIFY_MACHMGR( pMachMgr, false)
// recupero l'indice della macchinata
return pMachMgr->GetMachGroupId( sName) ;
}
//-----------------------------------------------------------------------------
bool
ExeSetCurrMachGroup( int nMGroupId)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposto la macchinata corrente
bool bOk = pGseCtx->m_pMachMgr->SetCurrMachGroup( nMGroupId) ;
// non cambia lo stato di modificato del progetto
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtSetCurrMachGroup(" + ToString( nMGroupId) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco il risultato
return bOk ;
}
//-----------------------------------------------------------------------------
bool
ExeResetCurrMachGroup( void)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// reset macchinata corrente
bool bOk = pGseCtx->m_pMachMgr->ResetCurrMachGroup() ;
// non cambia lo stato di modificato del progetto
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtResetCurrMachGroup()"
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco il risultato
return bOk ;
}
//-----------------------------------------------------------------------------
int
ExeGetCurrMachGroup( void)
{
IMachMgr* pMachMgr = GetCurrMachMgr() ;
VERIFY_MACHMGR( pMachMgr, GDB_ID_NULL)
// restituisco identificativo macchinata corrente
return pMachMgr->GetCurrMachGroup() ;
}
//-----------------------------------------------------------------------------
// Raw Parts & Parts
//-----------------------------------------------------------------------------
int
ExeGetRawPartCount( void)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero il numero di grezzi nella macchinata corrente
return pGseCtx->m_pMachMgr->GetRawPartCount() ;
}
//-----------------------------------------------------------------------------
int
ExeGetFirstRawPart( void)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero identificativo primo grezzo nella macchinata corrente
return pGseCtx->m_pMachMgr->GetFirstRawPart() ;
}
//-----------------------------------------------------------------------------
int
ExeGetNextRawPart( int nRawId)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero identificativo successivo grezzo nella macchinata corrente
return pGseCtx->m_pMachMgr->GetNextRawPart( nRawId) ;
}
//-----------------------------------------------------------------------------
int
ExeAddRawPart( Point3d ptOrig, double dLength, double dWidth, double dHeight, Color cCol)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, GDB_ID_NULL)
// inserisco grezzo nella macchinata corrente
int nId = pGseCtx->m_pMachMgr->AddRawPart( ptOrig, dLength, dWidth, dHeight, cCol) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtAddRawPart({" + ToString( ptOrig) + "}," +
ToString( dLength) + "," +
ToString( dWidth) + "," +
ToString( dHeight) + ",{" +
ToString( cCol) + "})" +
" -- Id=" + ToString( nId) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco il risultato
return nId ;
}
//-----------------------------------------------------------------------------
int
ExeAddRawPartWithPart( int nPartId, int nCrvId, double dOverMat, Color cCol)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, GDB_ID_NULL)
// inserisco grezzo con pezzo nella macchinata corrente
int nId = pGseCtx->m_pMachMgr->AddRawPartWithPart( nPartId, nCrvId, dOverMat, cCol) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtAddRawPartWithPart(" + ToString( nPartId) + "," +
ToString( nCrvId) + "," +
ToString( dOverMat) + ",{" +
ToString( cCol) + "})" +
" -- Id=" + ToString( nId) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco il risultato
return nId ;
}
//-----------------------------------------------------------------------------
bool
ExeModifyRawPart( int nRawId, Point3d ptOrig, double dLength, double dWidth, double dHeight, Color cCol)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, GDB_ID_NULL)
// modifico grezzo indicato nella macchinata corrente
bool bOk = pGseCtx->m_pMachMgr->ModifyRawPart( nRawId, ptOrig, dLength, dWidth, dHeight, cCol) ;
ExeSetModified() ;
// restituisco il risultato
return bOk ;
}
//-----------------------------------------------------------------------------
bool
ExeModifyRawPartSize( int nRawId, double dLength, double dWidth, double dHeight)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// modifico la lunghezza del grezzo
bool bOk = pGseCtx->m_pMachMgr->ModifyRawPartSize( nRawId, dLength, dWidth, dHeight) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtModifyRawPartSize(" + ToString( nRawId) + "," +
ToString( dLength) + "," +
ToString( dWidth) + "," +
ToString( dHeight) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco il risultato
return bOk ;
}
//-----------------------------------------------------------------------------
bool
ExeModifyRawPartHeight( int nRawId, double dHeight)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// modifico lo spessore del grezzo
bool bOk = pGseCtx->m_pMachMgr->ModifyRawPartHeight( nRawId, dHeight) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtModifyRawPartHeight(" + ToString( nRawId) + "," +
ToString( dHeight) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco il risultato
return bOk ;
}
//-----------------------------------------------------------------------------
bool
ExeRemoveRawPart( int nRawId)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// elimino grezzo dalla macchinata corrente
bool bOk = pGseCtx->m_pMachMgr->RemoveRawPart( nRawId) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtRemoveRawPart(" + ToString( nRawId) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco il risultato
return bOk ;
}
//-----------------------------------------------------------------------------
bool
ExeRotateRawPart( int nRawId, const Vector3d& vtAx, double dAngRotDeg)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// ruoto il grezzo
bool bOk = pGseCtx->m_pMachMgr->RotateRawPart( nRawId, vtAx, dAngRotDeg) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtRotateRawPart(" + ToString( nRawId) + ",{" +
ToString( vtAx) + "}," +
ToString( dAngRotDeg) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco il risultato
return bOk ;
}
//-----------------------------------------------------------------------------
bool
ExeMoveToCornerRawPart( int nRawId, const Point3d& ptCorner, int nFlag)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// mando il grezzo nel corner
bool bOk = pGseCtx->m_pMachMgr->MoveToCornerRawPart( nRawId, ptCorner, nFlag) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtMoveToCornerRawPart(" + ToString( nRawId) + ",{" +
ToString( ptCorner) + "}," +
RawPartCornerPosToString( nFlag) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco il risultato
return bOk ;
}
//-----------------------------------------------------------------------------
bool
ExeMoveToCenterRawPart( int nRawId, const Point3d& ptCenter, int nFlag)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// mando il grezzo nel corner
bool bOk = pGseCtx->m_pMachMgr->MoveToCenterRawPart( nRawId, ptCenter, nFlag) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtMoveToCenterRawPart(" + ToString( nRawId) + ",{" +
ToString( ptCenter) + "}," +
RawPartCenterPosToString( nFlag) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco il risultato
return bOk ;
}
//-----------------------------------------------------------------------------
bool
ExeMoveRawPart( int nRawId, const Vector3d& vtMove)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// traslo il grezzo
bool bOk = pGseCtx->m_pMachMgr->MoveRawPart( nRawId, vtMove) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtMoveRawPart(" + ToString( nRawId) + ",{" +
ToString( vtMove) + "})" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco il risultato
return bOk ;
}
//-----------------------------------------------------------------------------
int
ExeGetPartInRawPartCount( int nRawId)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero il numero di pezzi nel grezzo
return pGseCtx->m_pMachMgr->GetPartInRawPartCount( nRawId) ;
}
//-----------------------------------------------------------------------------
int
ExeGetFirstPartInRawPart( int nRawId)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero identificativo primo pezzo nel grezzo
return pGseCtx->m_pMachMgr->GetFirstPartInRawPart( nRawId) ;
}
//-----------------------------------------------------------------------------
int
ExeGetNextPartInRawPart( int nPartId)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero identificativo successivo pezzo nello stesso grezzo
return pGseCtx->m_pMachMgr->GetNextPartInRawPart( nPartId) ;
}
//-----------------------------------------------------------------------------
bool
ExeAddPartToRawPart( int nPartId, const Point3d& ptPos, int nRawId)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// inserisco pezzo in un grezzo della macchinata corrente
bool bOk = pGseCtx->m_pMachMgr->AddPartToRawPart( nPartId, ptPos, nRawId) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtAddPartToRawPart(" + ToString( nPartId) + ",{" +
ToString( ptPos) + "}," +
ToString( nRawId) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco il risultato
return bOk ;
}
//-----------------------------------------------------------------------------
bool
ExeRemovePartFromRawPart( int nPartId)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// elimino pezzo da grezzo della macchinata corrente
bool bOk = pGseCtx->m_pMachMgr->RemovePartFromRawPart( nPartId) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtRemovePartFromRawPart(" + ToString( nPartId) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco il risultato
return bOk ;
}
//-----------------------------------------------------------------------------
bool
ExeTranslatePartInRawPart( int nPartId, const Vector3d& vtMove)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// traslo il pezzo nel grezzo
bool bOk = pGseCtx->m_pMachMgr->TranslatePartInRawPart( nPartId, vtMove) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtMovePartInRawPart(" + ToString( nPartId) + ",{" +
ToString( vtMove) + "})" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco il risultato
return bOk ;
}
//-----------------------------------------------------------------------------
bool
ExeRotatePartInRawPart( int nPartId, const Vector3d& vtAx, double dAngRotDeg)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// ruoto il pezzo nel grezzo
bool bOk = pGseCtx->m_pMachMgr->RotatePartInRawPart( nPartId, vtAx, dAngRotDeg) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtRotatePartInRawPart(" + ToString( nPartId) + ",{" +
ToString( vtAx) + "}," +
ToString( dAngRotDeg) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco il risultato
return bOk ;
}
//-----------------------------------------------------------------------------
// Table & Fixtures
//-----------------------------------------------------------------------------
bool
ExeSetTable( const std::string& sTable)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposto la tavola corrente della macchinata corrente
return pGseCtx->m_pMachMgr->SetTable( sTable) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetTableRef( int nInd, Point3d& ptPos)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero il riferimento della tavola corrente della macchinata corrente
return pGseCtx->m_pMachMgr->GetTableRef( nInd, ptPos) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetTableArea( int nInd, BBox3d& b3Area)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero l'estensione dell'area utile della tavola corrente della macchinata corrente
return pGseCtx->m_pMachMgr->GetTableArea( nInd, b3Area) ;
}
//-----------------------------------------------------------------------------
bool
ExeShowOnlyTable( bool bVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// visualizzo solo la tavola corrente della macchinata corrente
return pGseCtx->m_pMachMgr->ShowOnlyTable( bVal) ;
}
//-----------------------------------------------------------------------------
int
ExeAddFixture( const string& sName, const Point3d& ptPos, double dAngRotDeg)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// inserisco il dispositivo di presa nella posizione indicata
return pGseCtx->m_pMachMgr->AddFixture( sName, ptPos, dAngRotDeg) ;
}
//-----------------------------------------------------------------------------
// DB utensili
//-----------------------------------------------------------------------------
bool
ExeTdbGetToolNewName( string& sName)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero un nuovo nome a partire da quello passato
return pGseCtx->m_pMachMgr->TdbGetToolNewName( sName) ;
}
//-----------------------------------------------------------------------------
bool
ExeTdbAddTool( const string& sName, int nType)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// aggiungo l'utensile
return pGseCtx->m_pMachMgr->TdbAddTool( sName, nType) ;
}
//-----------------------------------------------------------------------------
bool
ExeTdbCopyTool( const string& sSource, const string& sName)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// copio l'utensile
return pGseCtx->m_pMachMgr->TdbCopyTool( sSource, sName) ;
}
//-----------------------------------------------------------------------------
bool
ExeTdbRemoveTool( const string& sName)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// rimuovo l'utensile
return pGseCtx->m_pMachMgr->TdbRemoveTool( sName) ;
}
//----------------------------------------------------------------------------
bool
ExeTdbGetFirstTool( int nFamily, string& sName, int& nType)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// restituisce nome e tipo del primo utensile della famiglia
return pGseCtx->m_pMachMgr->TdbGetFirstTool( nFamily, sName, nType) ;
}
//----------------------------------------------------------------------------
bool
ExeTdbGetNextTool( int nFamily, string& sName, int& nType)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// restituisce nome e tipo del successivo utensile della famiglia
return pGseCtx->m_pMachMgr->TdbGetNextTool( nFamily, sName, nType) ;
}
//-----------------------------------------------------------------------------
bool
ExeTdbSetCurrTool( const std::string& sName)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposta l'utensile corrente
return pGseCtx->m_pMachMgr->TdbSetCurrTool( sName) ;
}
//-----------------------------------------------------------------------------
bool
ExeTdbSaveCurrTool( void)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// salva l'utensile corrente
return pGseCtx->m_pMachMgr->TdbSaveCurrTool() ;
}
//-----------------------------------------------------------------------------
bool
ExeTdbIsCurrToolModified( void)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// verifico se utensile corrente modificato
return pGseCtx->m_pMachMgr->TdbIsCurrToolModified() ;
}
//-----------------------------------------------------------------------------
bool
ExeTdbSetCurrToolParam( int nType, bool bVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposta il parametro dell'utensile
return pGseCtx->m_pMachMgr->TdbSetCurrToolParam( nType, bVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeTdbSetCurrToolParam( int nType, int nVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposta il parametro dell'utensile
return pGseCtx->m_pMachMgr->TdbSetCurrToolParam( nType, nVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeTdbSetCurrToolParam( int nType, double dVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposto il parametro dell'utensile
return pGseCtx->m_pMachMgr->TdbSetCurrToolParam( nType, dVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeTdbSetCurrToolParam( int nType, const string& sVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposto il parametro dell'utensile
return pGseCtx->m_pMachMgr->TdbSetCurrToolParam( nType, sVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeTdbGetCurrToolParam( int nType, bool& bVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero il parametro dell'utensile
return pGseCtx->m_pMachMgr->TdbGetCurrToolParam( nType, bVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeTdbGetCurrToolParam( int nType, int& nVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero il parametro dell'utensile
return pGseCtx->m_pMachMgr->TdbGetCurrToolParam( nType, nVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeTdbGetCurrToolParam( int nType, double& dVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero il parametro dell'utensile
return pGseCtx->m_pMachMgr->TdbGetCurrToolParam( nType, dVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeTdbGetCurrToolParam( int nType, string& sVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero il parametro dell'utensile
return pGseCtx->m_pMachMgr->TdbGetCurrToolParam( nType, sVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeTdbSave( void)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// eseguo il salvataggio del DB utensili
return pGseCtx->m_pMachMgr->TdbSave() ;
}
//-----------------------------------------------------------------------------
bool
ExeTdbGetToolDir( std::string& sToolDir)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero il direttorio degli utensili
return pGseCtx->m_pMachMgr->TdbGetToolDir( sToolDir) ;
}
//-----------------------------------------------------------------------------
bool
ExeTdbGetToolHolderDir( std::string& sTHolderDir)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero il direttorio dei porta utensili
return pGseCtx->m_pMachMgr->TdbGetToolHolderDir( sTHolderDir) ;
}
//-----------------------------------------------------------------------------
// DB lavorazioni
//-----------------------------------------------------------------------------
bool
ExeMdbGetMachiningNewName( string& sName)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero un nuovo nome a partire da quello passato
return pGseCtx->m_pMachMgr->MdbGetMachiningNewName( sName) ;
}
//-----------------------------------------------------------------------------
bool
ExeMdbAddMachining( const string& sName, int nType)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// aggiungo la lavorazione
return pGseCtx->m_pMachMgr->MdbAddMachining( sName, nType) ;
}
//-----------------------------------------------------------------------------
bool
ExeMdbCopyMachining( const string& sSource, const string& sName)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// copio la lavorazione
return pGseCtx->m_pMachMgr->MdbCopyMachining( sSource, sName) ;
}
//-----------------------------------------------------------------------------
bool
ExeMdbRemoveMachining( const string& sName)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// rimuovo la lavorazione
return pGseCtx->m_pMachMgr->MdbRemoveMachining( sName) ;
}
//-----------------------------------------------------------------------------
bool
ExeMdbGetFirstMachining( int nType, string& sName)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// rimuovo la lavorazione
return pGseCtx->m_pMachMgr->MdbGetFirstMachining( nType, sName) ;
}
//-----------------------------------------------------------------------------
bool
ExeMdbGetNextMachining( int nType, string& sName)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// rimuovo la lavorazione
return pGseCtx->m_pMachMgr->MdbGetNextMachining( nType, sName) ;
}
//-----------------------------------------------------------------------------
bool
ExeMdbSetCurrMachining( const std::string& sName)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposto la lavorazione corrente
return pGseCtx->m_pMachMgr->MdbSetCurrMachining( sName) ;
}
//-----------------------------------------------------------------------------
bool
ExeMdbSaveCurrMachining( void)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// salvo la lavorazione corrente
return pGseCtx->m_pMachMgr->MdbSaveCurrMachining() ;
}
//-----------------------------------------------------------------------------
bool
ExeMdbIsCurrMachiningModified( void)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// verifico se la lavorazione corrente stata modificata
return pGseCtx->m_pMachMgr->MdbIsCurrMachiningModified() ;
}
//-----------------------------------------------------------------------------
bool
ExeMdbSetCurrMachiningParam( int nType, bool bVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposta il parametro della lavorazione
return pGseCtx->m_pMachMgr->MdbSetCurrMachiningParam( nType, bVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeMdbSetCurrMachiningParam( int nType, int nVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposta il parametro della lavorazione
return pGseCtx->m_pMachMgr->MdbSetCurrMachiningParam( nType, nVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeMdbSetCurrMachiningParam( int nType, double dVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposta il parametro della lavorazione
return pGseCtx->m_pMachMgr->MdbSetCurrMachiningParam( nType, dVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeMdbSetCurrMachiningParam( int nType, const string& sVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposta il parametro della lavorazione
return pGseCtx->m_pMachMgr->MdbSetCurrMachiningParam( nType, sVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeMdbGetCurrMachiningParam( int nType, bool& bVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposta il parametro della lavorazione
return pGseCtx->m_pMachMgr->MdbGetCurrMachiningParam( nType, bVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeMdbGetCurrMachiningParam( int nType, int& nVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposta il parametro della lavorazione
return pGseCtx->m_pMachMgr->MdbGetCurrMachiningParam( nType, nVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeMdbGetCurrMachiningParam( int nType, double& dVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposta il parametro della lavorazione
return pGseCtx->m_pMachMgr->MdbGetCurrMachiningParam( nType, dVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeMdbGetCurrMachiningParam( int nType, string& sVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposta il parametro della lavorazione
return pGseCtx->m_pMachMgr->MdbGetCurrMachiningParam( nType, sVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeMdbSetSafeZ( double dSafeZ)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposta la distanza di sicurezza
return pGseCtx->m_pMachMgr->MdbSetSafeZ( dSafeZ) ;
}
//-----------------------------------------------------------------------------
bool
ExeMdbGetSafeZ( double& dSafeZ)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupera la distanza di sicurezza
return pGseCtx->m_pMachMgr->MdbGetSafeZ( dSafeZ) ;
}
//-----------------------------------------------------------------------------
bool
ExeMdbSave( void)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// eseguo il salvataggio del DB lavorazioni
return pGseCtx->m_pMachMgr->MdbSave() ;
}
//-----------------------------------------------------------------------------
bool
ExeMdbGetMachiningDir( std::string& sMchDir)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero il direttorio delle lavorazioni
return pGseCtx->m_pMachMgr->MdbGetMachiningDir( sMchDir) ;
}
//-----------------------------------------------------------------------------
// Operazioni
//-----------------------------------------------------------------------------
int
ExeGetFirstOperation( void)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero la prima operazione della macchinata corrente
return pGseCtx->m_pMachMgr->GetFirstOperation() ;
}
//-----------------------------------------------------------------------------
int
ExeGetNextOperation( int nId)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero la successiva operazione della macchinata corrente
return pGseCtx->m_pMachMgr->GetNextOperation( nId) ;
}
//-----------------------------------------------------------------------------
int
ExeGetOperationType( int nId)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero il tipo di operazione della macchinata corrente
return pGseCtx->m_pMachMgr->GetOperationType( nId) ;
}
//-----------------------------------------------------------------------------
bool
ExeRemoveOperation( int nId)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// elimino l'operazione indicata della macchinata corrente
return pGseCtx->m_pMachMgr->RemoveOperation( nId) ;
}
//-----------------------------------------------------------------------------
bool
ExeRemoveAllOperations( void)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// elimino tutte le operazioni della macchinata corrente tranne il primo posizionamento
return pGseCtx->m_pMachMgr->RemoveAllOperations( true) ;
}
//-----------------------------------------------------------------------------
// Lavorazioni
//-----------------------------------------------------------------------------
int
ExeAddMachining( const string& sName, const std::string& sMachining)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// aggiunge una lavorazione, prendendo i dati dalla libreria
return pGseCtx->m_pMachMgr->AddMachining( sName, sMachining) ;
}
//-----------------------------------------------------------------------------
bool
ExeSetCurrMachining( int nId)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposto la lavorazione di identificativo Id come corrnte
return pGseCtx->m_pMachMgr->SetCurrMachining( nId) ;
}
//-----------------------------------------------------------------------------
bool
ExeSetMachiningParam( int nType, bool bVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposto un parametro alla lavorazione corrente
return pGseCtx->m_pMachMgr->SetMachiningParam( nType, bVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeSetMachiningParam( int nType, int nVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposto un parametro alla lavorazione corrente
return pGseCtx->m_pMachMgr->SetMachiningParam( nType, nVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeSetMachiningParam( int nType, double dVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposto un parametro alla lavorazione corrente
return pGseCtx->m_pMachMgr->SetMachiningParam( nType, dVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeSetMachiningParam( int nType, const string& sVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposto un parametro alla lavorazione corrente
return pGseCtx->m_pMachMgr->SetMachiningParam( nType, sVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeSetMachiningGeometry( const SELVECTOR& vIds)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposto la geometria alla lavorazione corrente
return pGseCtx->m_pMachMgr->SetMachiningGeometry( vIds) ;
}
//-----------------------------------------------------------------------------
bool
ExePreviewMachining( bool bRecalc)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposto la geometria alla lavorazione corrente
return pGseCtx->m_pMachMgr->MachiningPreview( bRecalc) ;
}
//-----------------------------------------------------------------------------
bool
ExeApplyMachining( bool bRecalc)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposto la geometria alla lavorazione corrente
return pGseCtx->m_pMachMgr->MachiningApply( bRecalc) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetMachiningParam( int nType, bool& bVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero un parametro alla lavorazione corrente
return pGseCtx->m_pMachMgr->GetMachiningParam( nType, bVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetMachiningParam( int nType, int& nVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero un parametro alla lavorazione corrente
return pGseCtx->m_pMachMgr->GetMachiningParam( nType, nVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetMachiningParam( int nType, double& dVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero un parametro alla lavorazione corrente
return pGseCtx->m_pMachMgr->GetMachiningParam( nType, dVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetMachiningParam( int nType, string& sVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero un parametro alla lavorazione corrente
return pGseCtx->m_pMachMgr->GetMachiningParam( nType, sVal) ;
}
//-----------------------------------------------------------------------------
// Simulazione
//-----------------------------------------------------------------------------
bool
ExeSimStart( void)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// avvio la simulazione della macchinata corrente
return pGseCtx->m_pMachMgr->SimStart() ;
}
//-----------------------------------------------------------------------------
bool
ExeSimMove( int& nStatus)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// eseguo movimento di simulazione della macchinata corrente
return pGseCtx->m_pMachMgr->SimMove( nStatus) ;
}
//-----------------------------------------------------------------------------
bool
ExeSimHome( void)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// eseguo movimento di simulazione della macchinata corrente
return pGseCtx->m_pMachMgr->ResetAllAxesPos() ;
}
//-----------------------------------------------------------------------------
bool
ExeSimGetAxisInfoPos( int nI, std::string& sName, double& dVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero stringa con quote degli assi attivi
return pGseCtx->m_pMachMgr->SimGetAxisInfoPos( nI, sName, dVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeSimGetToolInfo( string& sName, double& dSpeed)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero dati dell'utensile
return pGseCtx->m_pMachMgr->SimGetToolInfo( sName, dSpeed) ;
}
//-----------------------------------------------------------------------------
bool
ExeSimGetMoveInfo( int& nGmove, double& dFeed)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// recupero dati sul movimento corrente
return pGseCtx->m_pMachMgr->SimGetMoveInfo( nGmove, dFeed) ;
}
//-----------------------------------------------------------------------------
bool
ExeSimSetStep( double dStep)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposto lo step di riferimento per la simulazione della macchinata corrente
return pGseCtx->m_pMachMgr->SimSetStep( dStep) ;
}
//-----------------------------------------------------------------------------
bool
ExeSimStop( void)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// termino la simulazione della macchinata corrente
return pGseCtx->m_pMachMgr->SimStop() ;
}
//-----------------------------------------------------------------------------
// Generazione
//-----------------------------------------------------------------------------
bool
ExeGenerate( const string& sCncFile, const std::string& sInfo)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// eseguo la generazione del part-program della macchinata corrente
return pGseCtx->m_pMachMgr->Generate( sCncFile, sInfo) ;
}
//-----------------------------------------------------------------------------
// Machine Calc
//-----------------------------------------------------------------------------
bool
ExeSetCalcTable( const std::string& sTable)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposto la tavola corrente della macchinata corrente per i calcoli
return pGseCtx->m_pMachMgr->SetCalcTable( sTable) ;
}
//-----------------------------------------------------------------------------
bool
ExeSetCalcTool( const std::string& sTool, const std::string& sHead, int nExit)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// imposto l'utensile corrente per il calcolo sulla macchina della macchinata corrente
return pGseCtx->m_pMachMgr->SetCalcTool( sTool, sHead, nExit) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetCalcTool( std::string& sTool)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// restituisco il nome dell'utensile corrente per il calcolo sulla macchina della macchinata corrente
return pGseCtx->m_pMachMgr->GetCalcTool( sTool) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetCalcAngles( const Vector3d& vtDirT, const Vector3d& vtDirA,
int& nStat, double& dAngA1, double& dAngB1, double& dAngA2, double& dAngB2)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// calcolo gli angoli macchina dalle direzioni fresa e ausiliaria passate
return pGseCtx->m_pMachMgr->GetCalcAngles( vtDirT, vtDirA, nStat, dAngA1, dAngB1, dAngA2, dAngB2) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetCalcPositions( const Point3d& ptP, double dAngA, double dAngB,
int& nStat, double& dX, double& dY, double& dZ)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// calcolo gli angoli macchina dalla direzione fresa passata
return pGseCtx->m_pMachMgr->GetCalcPositions( ptP, dAngA, dAngB, nStat, dX, dY, dZ) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetCalcTipFromPositions( double dX, double dY, double dZ, double dAngA, double dAngB,
bool bBottom, Point3d& ptTip)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// calcolo il tip utensile dagli assi macchina
return pGseCtx->m_pMachMgr->GetCalcTipFromPositions( dX, dY, dZ, dAngA, dAngB, bBottom, ptTip) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetCalcToolDirFromAngles( double dAngA, double dAngB, Vector3d& vtDir)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// calcolo il tip utensile dagli assi macchina
return pGseCtx->m_pMachMgr->GetCalcToolDirFromAngles( dAngA, dAngB, vtDir) ;
}
//-----------------------------------------------------------------------------
bool
ExeVerifyOutOfStroke( double dX, double dY, double dZ, double dAngA, double dAngB, int& nStat)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// verifica l'extracorsa degli assi
return pGseCtx->m_pMachMgr->VerifyOutOfStroke( dX, dY, dZ, dAngA, dAngB, nStat) ;
}
//-----------------------------------------------------------------------------
// Machine Move
//-----------------------------------------------------------------------------
bool
ExeSetAxisPos( const string& sAxis, double dVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// metto l'asse nella nuova posizione
return pGseCtx->m_pMachMgr->SetAxisPos( sAxis, dVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetAxisPos( const string& sAxis, double* pdVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// verifico il parametro di ritorno
if ( pdVal == nullptr)
return false ;
// metto l'asse nella nuova posizione
return pGseCtx->m_pMachMgr->GetAxisPos( sAxis, *pdVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetAxisHomePos( const string& sAxis, double* pdHomeVal)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// verifico il parametro di ritorno
if ( pdHomeVal == nullptr)
return false ;
// metto l'asse nella nuova posizione
return pGseCtx->m_pMachMgr->GetAxisHomePos( sAxis, *pdHomeVal) ;
}
//-----------------------------------------------------------------------------
bool
ExeResetAxisPos( const string& sAxis)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// metto l'asse nella posizione home
return pGseCtx->m_pMachMgr->ResetAxisPos( sAxis) ;
}
//-----------------------------------------------------------------------------
bool
ExeLoadTool( const string& sHead, int nExit, const string& sTool)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// carico l'utensile sulla macchina della macchinata corrente in posizione indicata
return pGseCtx->m_pMachMgr->LoadTool( sHead, nExit, sTool) ;
}
//-----------------------------------------------------------------------------
bool
ExeResetHeadSet( const string& sHead)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_MACHMGR( pGseCtx, false)
// carico l'utensile sulla macchina della macchinata corrente in posizione indicata
return pGseCtx->m_pMachMgr->ResetHeadSet( sHead) ;
}