EgtMachKernel 1.6k5 :
- aggiunta gestione DB lavorazioni.
This commit is contained in:
@@ -0,0 +1,255 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2015-2015
|
||||
//----------------------------------------------------------------------------
|
||||
// File : MachMgrDBTools.cpp Data : 17.09.15 Versione : 1.6i7
|
||||
// Contenuto : Implementazione gestione DB utensili della classe MachMgr.
|
||||
//
|
||||
//
|
||||
//
|
||||
// Modifiche : 17.09.15 DS Creazione modulo.
|
||||
//
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
//--------------------------- Include ----------------------------------------
|
||||
#include "stdafx.h"
|
||||
#include "DllMain.h"
|
||||
#include "MachMgr.h"
|
||||
|
||||
using namespace std ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::TdbGetToolNewName( string& sName) const
|
||||
{
|
||||
// recupero il gestore di utensili della macchina corrente
|
||||
ToolsMgr* pTsMgr = GetCurrToolsMgr() ;
|
||||
if ( pTsMgr == nullptr)
|
||||
return false ;
|
||||
// verifico nome ed eventualmente lo modifico per renderlo nuovo
|
||||
return pTsMgr->GetToolNewName( sName) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::TdbAddTool( const string& sName, int nType)
|
||||
{
|
||||
// recupero il gestore di utensili della macchina corrente
|
||||
ToolsMgr* pTsMgr = GetCurrToolsMgr() ;
|
||||
if ( pTsMgr == nullptr)
|
||||
return false ;
|
||||
// aggiungo l'utensile al DB utensili
|
||||
return pTsMgr->AddTool( sName, nType) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::TdbCopyTool( const string& sSource, const string& sName)
|
||||
{
|
||||
// recupero il gestore di utensili della macchina corrente
|
||||
ToolsMgr* pTsMgr = GetCurrToolsMgr() ;
|
||||
if ( pTsMgr == nullptr)
|
||||
return false ;
|
||||
// copio l'utensile nel DB utensili
|
||||
return pTsMgr->CopyTool( sSource, sName) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::TdbRemoveTool( const string& sName)
|
||||
{
|
||||
// recupero il gestore di utensili della macchina corrente
|
||||
ToolsMgr* pTsMgr = GetCurrToolsMgr() ;
|
||||
if ( pTsMgr == nullptr)
|
||||
return false ;
|
||||
// rimuovo l'utensile dal DB utensili
|
||||
return pTsMgr->RemoveTool( sName) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::TdbGetFirstTool( int nFamily, string& sName, int& nType) const
|
||||
{
|
||||
// recupero il gestore di utensili della macchina corrente
|
||||
ToolsMgr* pTsMgr = GetCurrToolsMgr() ;
|
||||
if ( pTsMgr == nullptr)
|
||||
return false ;
|
||||
// cerco il primo utensile della famiglia nel DB utensili
|
||||
return pTsMgr->GetFirstTool( nFamily, sName, nType) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::TdbGetNextTool( int nFamily, string& sName, int& nType) const
|
||||
{
|
||||
// recupero il gestore di utensili della macchina corrente
|
||||
ToolsMgr* pTsMgr = GetCurrToolsMgr() ;
|
||||
if ( pTsMgr == nullptr)
|
||||
return false ;
|
||||
// cerco il successivo utensile della famiglia nel DB utensili
|
||||
return pTsMgr->GetNextTool( nFamily, sName, nType) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::TdbSetCurrTool( const string& sName)
|
||||
{
|
||||
// recupero il gestore di utensili della macchina corrente
|
||||
ToolsMgr* pTsMgr = GetCurrToolsMgr() ;
|
||||
if ( pTsMgr == nullptr)
|
||||
return false ;
|
||||
// imposto l'utensile corrente
|
||||
return pTsMgr->SetCurrTool( sName) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::TdbSaveCurrTool( void)
|
||||
{
|
||||
// recupero il gestore di utensili della macchina corrente
|
||||
ToolsMgr* pTsMgr = GetCurrToolsMgr() ;
|
||||
if ( pTsMgr == nullptr)
|
||||
return false ;
|
||||
// salvo l'utensile corrente
|
||||
return pTsMgr->SaveCurrTool() ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::TdbIsCurrToolModified( void) const
|
||||
{
|
||||
// recupero il gestore di utensili della macchina corrente
|
||||
ToolsMgr* pTsMgr = GetCurrToolsMgr() ;
|
||||
if ( pTsMgr == nullptr)
|
||||
return false ;
|
||||
// verifico se l'utensile corrente è stato modificato
|
||||
return pTsMgr->IsCurrToolModified() ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::TdbSetCurrToolParam( int nType, bool bVal)
|
||||
{
|
||||
// recupero il gestore di utensili della macchina corrente
|
||||
ToolsMgr* pTsMgr = GetCurrToolsMgr() ;
|
||||
if ( pTsMgr == nullptr)
|
||||
return false ;
|
||||
// assegno il parametro
|
||||
return pTsMgr->SetCurrToolParam( nType, bVal) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::TdbSetCurrToolParam( int nType, int nVal)
|
||||
{
|
||||
// recupero il gestore di utensili della macchina corrente
|
||||
ToolsMgr* pTsMgr = GetCurrToolsMgr() ;
|
||||
if ( pTsMgr == nullptr)
|
||||
return false ;
|
||||
// assegno il parametro
|
||||
return pTsMgr->SetCurrToolParam( nType, nVal) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::TdbSetCurrToolParam( int nType, double dVal)
|
||||
{
|
||||
// recupero il gestore di utensili della macchina corrente
|
||||
ToolsMgr* pTsMgr = GetCurrToolsMgr() ;
|
||||
if ( pTsMgr == nullptr)
|
||||
return false ;
|
||||
// assegno il parametro
|
||||
return pTsMgr->SetCurrToolParam( nType, dVal) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::TdbSetCurrToolParam( int nType, const string& sVal)
|
||||
{
|
||||
// recupero il gestore di utensili della macchina corrente
|
||||
ToolsMgr* pTsMgr = GetCurrToolsMgr() ;
|
||||
if ( pTsMgr == nullptr)
|
||||
return false ;
|
||||
// assegno il parametro
|
||||
return pTsMgr->SetCurrToolParam( nType, sVal) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::TdbGetCurrToolParam( int nType, bool& bVal) const
|
||||
{
|
||||
// recupero il gestore di utensili della macchina corrente
|
||||
ToolsMgr* pTsMgr = GetCurrToolsMgr() ;
|
||||
if ( pTsMgr == nullptr)
|
||||
return false ;
|
||||
// recupero il parametro
|
||||
return pTsMgr->GetCurrToolParam( nType, bVal) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::TdbGetCurrToolParam( int nType, int& nVal) const
|
||||
{
|
||||
// recupero il gestore di utensili della macchina corrente
|
||||
ToolsMgr* pTsMgr = GetCurrToolsMgr() ;
|
||||
if ( pTsMgr == nullptr)
|
||||
return false ;
|
||||
// recupero il parametro
|
||||
return pTsMgr->GetCurrToolParam( nType, nVal) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::TdbGetCurrToolParam( int nType, double& dVal) const
|
||||
{
|
||||
// recupero il gestore di utensili della macchina corrente
|
||||
ToolsMgr* pTsMgr = GetCurrToolsMgr() ;
|
||||
if ( pTsMgr == nullptr)
|
||||
return false ;
|
||||
// recupero il parametro
|
||||
return pTsMgr->GetCurrToolParam( nType, dVal) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::TdbGetCurrToolParam( int nType, string& sVal) const
|
||||
{
|
||||
// recupero il gestore di utensili della macchina corrente
|
||||
ToolsMgr* pTsMgr = GetCurrToolsMgr() ;
|
||||
if ( pTsMgr == nullptr)
|
||||
return false ;
|
||||
// recupero il parametro
|
||||
return pTsMgr->GetCurrToolParam( nType, sVal) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::TdbSave( void) const
|
||||
{
|
||||
// recupero il gestore di utensili della macchina corrente
|
||||
ToolsMgr* pTsMgr = GetCurrToolsMgr() ;
|
||||
if ( pTsMgr == nullptr)
|
||||
return nullptr ;
|
||||
// salvo il db utensili
|
||||
return pTsMgr->Save() ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::TdbGetToolDir( string& sToolDir) const
|
||||
{
|
||||
if ( GetCurrMachine() == nullptr)
|
||||
return false ;
|
||||
sToolDir = m_sMachinesDir + "\\" + GetCurrMachine()->GetMachineName() + "\\" + TOOLS_DIR ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::TdbGetToolHolderDir( string& sToolDir) const
|
||||
{
|
||||
if ( GetCurrMachine() == nullptr)
|
||||
return false ;
|
||||
sToolDir = m_sMachinesDir + "\\" + GetCurrMachine()->GetMachineName() + "\\" + TOOLHOLDERS_DIR ;
|
||||
return true ;
|
||||
}
|
||||
Reference in New Issue
Block a user