EgtMachKernel 1.6e7 :

- introdotto uso ObjUser per gruppi di macchina
- prima versione prototipo delle forature
- migliorie al calolo angoli e posizioni macchina.
This commit is contained in:
Dario Sassi
2015-05-26 06:49:55 +00:00
parent fe07bb767d
commit 3076dccb4b
25 changed files with 1402 additions and 247 deletions
+15 -12
View File
@@ -15,6 +15,7 @@
#include "stdafx.h"
#include "MachMgr.h"
#include "DllMain.h"
#include "Exit.h"
#include "/EgtDev/Include/EGnStringUtils.h"
#include "/EgtDev/Include/EGnFileUtils.h"
@@ -26,16 +27,16 @@ Machine::LoadTool( const string& sHead, int nExit, const string& sTool)
{
// recupero il gruppo della testa
int nHdGrp = GetGroup( sHead) ;
if ( nHdGrp == GDB_ID_NULL || ! IsHeadGroup( nHdGrp))
if ( ! IsHeadGroup( nHdGrp))
return false ;
// cerco il gruppo dell'uscita in quello della testa
string sExit = "T" + ToString( nExit) ;
string sExit = MCH_EXIT + ToString( nExit) ;
int nExGrp = m_pMchMgr->m_pGeomDB->GetFirstNameInGroup( nHdGrp, sExit) ;
if ( nExGrp == GDB_ID_NULL || m_pMchMgr->m_pGeomDB->GetGdbType( nExGrp) != GDB_TY_GROUP)
Exit* pExit = GetExit( nExGrp) ;
if ( pExit == nullptr)
return false ;
// se utensile già montato, abilito ed esco
string sOldTool ;
if ( m_pMchMgr->m_pGeomDB->GetInfo( nExGrp, "Tool", sOldTool) && sTool == sOldTool)
if ( sTool == pExit->GetTool())
return EnableHeadInSet( sHead) ;
// verifico esistenza file utensile
string sToolFile = m_sMachineDir + "\\" + TOOLS_DIR + "\\" + sTool + ".Nge" ;
@@ -58,7 +59,7 @@ Machine::LoadTool( const string& sHead, int nExit, const string& sTool)
if ( nT == GDB_ID_NULL)
return false ;
m_pMchMgr->m_pGeomDB->Rotate( nT, ORIG, X_AX, 90) ;
m_pMchMgr->m_pGeomDB->SetInfo( nExGrp, "Tool", sTool) ;
pExit->SetTool( sTool) ;
return EnableHeadInSet( sHead) ;
}
@@ -67,25 +68,27 @@ bool
Machine::ResetHeadSet( const string& sHead)
{
// recupero il set della testa
STRVECTOR vsHSet ;
if ( ! GetHSet( sHead, vsHSet))
const STRVECTOR& vsHSet = GetHSet( sHead) ;
if ( vsHSet.empty())
return false ;
// ciclo su tutte le teste dell'insieme per svuotarle
for ( size_t i = 0 ; i < vsHSet.size() ; ++ i) {
// recupero il gruppo della testa
int nHdGrp = GetGroup( vsHSet[i]) ;
if ( nHdGrp == GDB_ID_NULL || ! IsHeadGroup( nHdGrp))
if ( ! IsHeadGroup( nHdGrp))
return false ;
// ciclo sulle sue uscite
for ( int j = 1 ; true ; ++ j) {
// recupero il gruppo dell'uscita
string sExit = "T" + ToString( j) ;
string sExit = MCH_EXIT + ToString( j) ;
int nExGrp = m_pMchMgr->m_pGeomDB->GetFirstNameInGroup( nHdGrp, sExit) ;
if ( nExGrp == GDB_ID_NULL || m_pMchMgr->m_pGeomDB->GetGdbType( nExGrp) != GDB_TY_GROUP)
// recupero l'oggetto uscita
Exit* pExit = GetExit( nExGrp) ;
if ( pExit == nullptr)
break ;
// pulisco il gruppo dell'uscita
m_pMchMgr->m_pGeomDB->EmptyGroup( nExGrp) ;
m_pMchMgr->m_pGeomDB->RemoveInfo( nExGrp, "Tool") ;
pExit->SetTool( "") ;
}
// visualizzo solo la prima testa
m_pMchMgr->m_pGeomDB->SetStatus( nHdGrp, ( i == 0 ? GDB_ST_ON : GDB_ST_OFF)) ;