Files
EgtMachKernel/Table.cpp
T
Dario Sassi 3076dccb4b EgtMachKernel 1.6e7 :
- introdotto uso ObjUser per gruppi di macchina
- prima versione prototipo delle forature
- migliorie al calolo angoli e posizioni macchina.
2015-05-26 06:49:55 +00:00

97 lines
2.6 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2015-2015
//----------------------------------------------------------------------------
// File : Table.cpp Data : 25.05.15 Versione : 1.6e7
// Contenuto : Oggetto tavola per gruppo tavola di macchina.
//
//
//
// Modifiche : 25.05.15 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
//--------------------------- Include ----------------------------------------
#include "stdafx.h"
#include "Table.h"
#include "MachConst.h"
#include "/EgtDev/Include/EGkGdbConst.h"
#include "/EgtDev/Include/EGkObjUserFactory.h"
#include "/EgtDev/Include/EGkStringUtils3d.h"
using namespace std ;
//----------------------------------------------------------------------------
OBJUSER_REGISTER( "EMkTable", Table) ;
//----------------------------------------------------------------------------
const string&
Table::GetClassName( void) const
{
return OBJUSER_GETNAME( Table) ;
}
//----------------------------------------------------------------------------
Table*
Table::Clone( void) const
{
// alloco oggetto
Table* pAx = new(nothrow) Table ;
// eseguo copia dei dati
if ( pAx != nullptr) {
try { pAx->m_nOwnerId = GDB_ID_NULL ;
pAx->m_sName = m_sName ;
pAx->m_nType = m_nType ;
}
catch( ...) {
delete pAx ;
return nullptr ;
}
}
// ritorno l'oggetto
return pAx ;
}
//----------------------------------------------------------------------------
bool
Table::Dump( string& sOut, const char* szNewLine) const
{
sOut += GetClassName() + szNewLine ;
sOut += "Id=" + ToString( m_nOwnerId) + szNewLine ;
sOut += "Name=" + m_sName + szNewLine ;
sOut += "Type=" + ToString( m_nType) + szNewLine ;
return true ;
}
//----------------------------------------------------------------------------
bool
Table::SetOwner( int nId)
{
m_nOwnerId = nId ;
return true ;
}
//----------------------------------------------------------------------------
int
Table::GetOwner( void) const
{
return m_nOwnerId ;
}
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
Table::Table( void)
: m_nOwnerId( GDB_ID_NULL), m_nType( MCH_TT_NONE)
{
}
//----------------------------------------------------------------------------
bool
Table::Set( const string& sName, int nType)
{
m_sName = sName ;
m_nType = nType ;
return true ;
}