EgtMachKernel 1.6x6 :
- aggiunta MachMgr::GetHeadExitCount.
This commit is contained in:
Binary file not shown.
@@ -1,13 +1,13 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2015-2015
|
||||
// EgalTech 2015-2017
|
||||
//----------------------------------------------------------------------------
|
||||
// File : Head.cpp Data : 25.05.15 Versione : 1.6e7
|
||||
// File : Head.cpp Data : 11.01.17 Versione : 1.6x6
|
||||
// Contenuto : Oggetto testa per gruppo testa di macchina.
|
||||
//
|
||||
//
|
||||
//
|
||||
// Modifiche : 25.05.15 DS Creazione modulo.
|
||||
//
|
||||
// 11.01.17 DS Aggiunto contatore uscite.
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
@@ -45,6 +45,7 @@ Head::Clone( void) const
|
||||
pHead->m_pGeomDB = nullptr ;
|
||||
pHead->m_sName = m_sName ;
|
||||
pHead->m_nType = m_nType ;
|
||||
pHead->m_nExitCount = m_nExitCount ;
|
||||
pHead->m_vsHSet = m_vsHSet ;
|
||||
pHead->m_vtADir = m_vtADir ;
|
||||
pHead->m_dRot1W = m_dRot1W ;
|
||||
@@ -68,6 +69,7 @@ Head::Dump( string& sOut, bool bMM, const char* szNewLine) const
|
||||
sOut += "Id=" + ToString( m_nOwnerId) + szNewLine ;
|
||||
sOut += "Name=" + m_sName + szNewLine ;
|
||||
sOut += "Type=" + ToString( m_nType) + szNewLine ;
|
||||
sOut += "ExitCount=" + ToString( m_nExitCount) + szNewLine ;
|
||||
sOut += "HSet=" + ToString( m_vsHSet) + szNewLine ;
|
||||
sOut += "ADir=" + ToString( m_vtADir) + szNewLine ;
|
||||
return true ;
|
||||
@@ -99,7 +101,7 @@ Head::GetGeomDB( void) const
|
||||
//----------------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------------
|
||||
Head::Head( void)
|
||||
: m_nOwnerId( GDB_ID_NULL), m_pGeomDB( nullptr), m_nType( MCH_HT_NONE),
|
||||
: m_nOwnerId( GDB_ID_NULL), m_pGeomDB( nullptr), m_nType( MCH_HT_NONE), m_nExitCount( 0),
|
||||
m_dRot1W( 1), m_nSolCh( MCH_SCC_NONE)
|
||||
{
|
||||
m_Rot2Stroke.Min = - INFINITO ;
|
||||
@@ -108,11 +110,15 @@ Head::Head( void)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Head::Set( const string& sName, int nType, const string& sHSet, const Vector3d& vtADir,
|
||||
Head::Set( const string& sName, int nType, int nExitCount, const string& sHSet, const Vector3d& vtADir,
|
||||
double dRot1W, const STROKE& Rot2Stroke, int nSolCh)
|
||||
{
|
||||
m_sName = sName ;
|
||||
m_nType = nType ;
|
||||
if ( m_nType == MCH_HT_MULTI)
|
||||
m_nExitCount = nExitCount ;
|
||||
else
|
||||
m_nExitCount = 1 ;
|
||||
m_vsHSet.clear() ;
|
||||
m_vsHSet.push_back( sHSet) ;
|
||||
m_vtADir = vtADir ;
|
||||
|
||||
@@ -30,13 +30,15 @@ class Head : public IUserObj
|
||||
|
||||
public :
|
||||
Head( void) ;
|
||||
bool Set( const std::string& sName, int nType, const std::string& sHSet, const Vector3d& vtADir,
|
||||
double dRot1W, const STROKE& Rot2Stroke, int nSolCh) ;
|
||||
bool Set( const std::string& sName, int nType, int nExitCount, const std::string& sHSet,
|
||||
const Vector3d& vtADir, double dRot1W, const STROKE& Rot2Stroke, int nSolCh) ;
|
||||
bool AddHeadToHSet( const std::string& sHead) ;
|
||||
const std::string& GetName( void)
|
||||
{ return m_sName ; }
|
||||
int GetType( void)
|
||||
{ return m_nType ; }
|
||||
int GetExitCount( void)
|
||||
{ return m_nExitCount ; }
|
||||
const STRVECTOR& GetHSet(void)
|
||||
{ return m_vsHSet ; }
|
||||
const Vector3d& GetADir( void)
|
||||
@@ -53,6 +55,7 @@ class Head : public IUserObj
|
||||
IGeomDB* m_pGeomDB ;
|
||||
std::string m_sName ;
|
||||
int m_nType ;
|
||||
int m_nExitCount ;
|
||||
STRVECTOR m_vsHSet ;
|
||||
Vector3d m_vtADir ;
|
||||
double m_dRot1W ;
|
||||
|
||||
@@ -277,6 +277,7 @@ class MachMgr : public IMachMgr
|
||||
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 ;
|
||||
bool GetAxisToken( const std::string& sAxis, std::string& sToken) const override ;
|
||||
bool SetAxisPos( const std::string& sAxis, double dVal) override ;
|
||||
bool GetAxisPos( const std::string& sAxis, double& dVal) const override ;
|
||||
|
||||
@@ -213,6 +213,15 @@ MachMgr::GetHeadId( const string& sHead) const
|
||||
return ( ( pMch != nullptr) ? pMch->GetHeadId( sHead) : GDB_ID_NULL) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
int
|
||||
MachMgr::GetHeadExitCount( const string& sHead) const
|
||||
{
|
||||
Machine* pMch = GetCurrMachine() ;
|
||||
// recupero il numero di uscite della testa
|
||||
return ( ( pMch != nullptr) ? pMch->GetHeadExitCount( sHead) : 0) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::GetAxisToken( const string& sAxis, string& sToken) const
|
||||
|
||||
+3
-3
@@ -471,7 +471,7 @@ Machine::LoadMachineStdHead( const string& sName, const string& sParent, const s
|
||||
Head* pHead = new(nothrow) Head ;
|
||||
if ( pHead == nullptr)
|
||||
return false ;
|
||||
pHead->Set( sName, MCH_HT_STD, sHSet, vtADir, dRot1W, Rot2Stroke, nSolCh) ;
|
||||
pHead->Set( sName, MCH_HT_STD, 1, sHSet, vtADir, dRot1W, Rot2Stroke, nSolCh) ;
|
||||
m_pGeomDB->SetUserObj( nLay, pHead) ;
|
||||
// aggiorno la testa capostipite
|
||||
if ( ! AddHeadToSet( sHSet, sName))
|
||||
@@ -520,7 +520,7 @@ Machine::LoadMachineMultiHead( const string& sName, const string& sParent, const
|
||||
Head* pHead = new(nothrow) Head ;
|
||||
if ( pHead == nullptr)
|
||||
return false ;
|
||||
pHead->Set( sName, MCH_HT_MULTI, sHSet, vtADir, dRot1W, Rot2Stroke, nSolCh) ;
|
||||
pHead->Set( sName, MCH_HT_MULTI, int( vMuExit.size()), sHSet, vtADir, dRot1W, Rot2Stroke, nSolCh) ;
|
||||
m_pGeomDB->SetUserObj( nLay, pHead) ;
|
||||
// aggiorno la testa capostipite
|
||||
if ( ! AddHeadToSet( sHSet, sName))
|
||||
@@ -567,7 +567,7 @@ Machine::LoadMachineSpecialHead( const string& sName, const string& sParent, con
|
||||
Head* pHead = new(nothrow) Head ;
|
||||
if ( pHead == nullptr)
|
||||
return false ;
|
||||
pHead->Set( sName, MCH_HT_SPECIAL, sHSet, vtADir, dRot1W, Rot2Stroke, nSolCh) ;
|
||||
pHead->Set( sName, MCH_HT_SPECIAL, 1, sHSet, vtADir, dRot1W, Rot2Stroke, nSolCh) ;
|
||||
m_pGeomDB->SetUserObj( nLay, pHead) ;
|
||||
// aggiorno la testa capostipite
|
||||
if ( ! AddHeadToSet( sHSet, sName))
|
||||
|
||||
@@ -53,6 +53,7 @@ class Machine
|
||||
{ int nId = GetGroup( sHead) ;
|
||||
return ( IsHeadGroup( nId) ? nId : GDB_ID_NULL) ; }
|
||||
bool SetLook( int nFlag) ;
|
||||
int GetHeadExitCount( const std::string& sHead) const ;
|
||||
bool LoadTool( const std::string& sHead, int nExit, const std::string& sTool) ;
|
||||
bool GetLoadedTool( const std::string& sHead, int nExit, std::string& sTool) const ;
|
||||
bool UnloadTool( const string& sHead, int nExit) ;
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "MachMgr.h"
|
||||
#include "DllMain.h"
|
||||
#include "Head.h"
|
||||
#include "Exit.h"
|
||||
#include "/EgtDev/Include/EMkToolConst.h"
|
||||
#include "/EgtDev/Include/EGnStringUtils.h"
|
||||
@@ -22,6 +23,14 @@
|
||||
|
||||
using namespace std ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
int
|
||||
Machine::GetHeadExitCount( const string& sHead) const
|
||||
{
|
||||
Head* pHead = GetHead( GetGroup( sHead)) ;
|
||||
return ( ( pHead != nullptr) ? pHead->GetExitCount() : 0) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Machine::LoadTool( const string& sHead, int nExit, const string& sTool)
|
||||
|
||||
Reference in New Issue
Block a user