EgtMachKernel 1.8h1 :
- migliorata gestione oggetti utente operazioni - aggiunta SimGetOperationInfo.
This commit is contained in:
+2
-2
@@ -16,7 +16,7 @@
|
||||
#include "MachMgr.h"
|
||||
#include "DllMain.h"
|
||||
#include "Chiseling.h"
|
||||
#include "MachiningConst.h"
|
||||
#include "OperationConst.h"
|
||||
#include "/EgtDev/Include/EGkCurveLine.h"
|
||||
#include "/EgtDev/Include/EGkCurveArc.h"
|
||||
#include "/EgtDev/Include/EGkCurveComposite.h"
|
||||
@@ -60,7 +60,7 @@ struct SqHole
|
||||
} ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
USEROBJ_REGISTER( "EMkChiseling", Chiseling) ;
|
||||
USEROBJ_REGISTER( GetOperationClass( OPER_CHISELING), Chiseling) ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
const string&
|
||||
|
||||
@@ -34,6 +34,8 @@ class Chiseling : public Machining
|
||||
bool Load( const STRVECTOR& vString, int nBaseGdbId) override ;
|
||||
|
||||
public : // Operation
|
||||
int GetType( void) const override
|
||||
{ return OPER_CHISELING ; }
|
||||
bool IsEmpty( void) const override
|
||||
{ return ( m_nChisels == 0) ; }
|
||||
|
||||
|
||||
+2
-1
@@ -16,6 +16,7 @@
|
||||
#include "MachMgr.h"
|
||||
#include "DllMain.h"
|
||||
#include "Disposition.h"
|
||||
#include "OperationConst.h"
|
||||
#include "/EgtDev/Include/EMkDispositionConst.h"
|
||||
#include "/EgtDev/Include/EGkAngle.h"
|
||||
#include "/EgtDev/Include/EGkStringUtils3d.h"
|
||||
@@ -62,7 +63,7 @@ static std::string DIS_SOMEBYHAND = "Sbh" ;
|
||||
static double DISP_BOX_TOL = - 0.5 ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
USEROBJ_REGISTER( "EMkDisposition", Disposition) ;
|
||||
USEROBJ_REGISTER( GetOperationClass( OPER_DISP), Disposition) ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
const string&
|
||||
|
||||
+3
-1
@@ -58,7 +58,9 @@ class Disposition : public Operation
|
||||
bool Load( const STRVECTOR& vString, int nBaseGdbId) override ;
|
||||
|
||||
public : // Operation
|
||||
bool IsEmpty( void) const override
|
||||
int GetType( void) const override
|
||||
{ return OPER_DISP ; }
|
||||
bool IsEmpty( void) const override
|
||||
{ return ( m_nShifts == 0) ; }
|
||||
|
||||
protected : // Operation
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@
|
||||
#include "MachMgr.h"
|
||||
#include "DllMain.h"
|
||||
#include "Drilling.h"
|
||||
#include "MachiningConst.h"
|
||||
#include "OperationConst.h"
|
||||
#include "/EgtDev/Include/EXeCmdLogOff.h"
|
||||
#include "/EgtDev/Include/EGkGeoPoint3d.h"
|
||||
#include "/EgtDev/Include/EGkCurveLine.h"
|
||||
@@ -60,7 +60,7 @@ struct Hole
|
||||
} ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
USEROBJ_REGISTER( "EMkDrilling", Drilling) ;
|
||||
USEROBJ_REGISTER( GetOperationClass( OPER_DRILLING), Drilling) ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
const string&
|
||||
|
||||
@@ -34,6 +34,8 @@ class Drilling : public Machining
|
||||
bool Load( const STRVECTOR& vString, int nBaseGdbId) override ;
|
||||
|
||||
public : // Operation
|
||||
int GetType( void) const override
|
||||
{ return OPER_DRILLING ; }
|
||||
bool IsEmpty( void) const override
|
||||
{ return ( m_nDrillings == 0) ; }
|
||||
|
||||
|
||||
Binary file not shown.
@@ -306,6 +306,7 @@ copy $(TargetPath) \EgtProg\Dll64</Command>
|
||||
<ClInclude Include="Milling.h" />
|
||||
<ClInclude Include="MillingData.h" />
|
||||
<ClInclude Include="Operation.h" />
|
||||
<ClInclude Include="OperationConst.h" />
|
||||
<ClInclude Include="OutputConst.h" />
|
||||
<ClInclude Include="Pocketing.h" />
|
||||
<ClInclude Include="PocketingData.h" />
|
||||
|
||||
@@ -356,6 +356,9 @@
|
||||
<ClInclude Include="SetTempMachLook.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="OperationConst.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="EgtMachKernel.rc">
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@
|
||||
#include "MachMgr.h"
|
||||
#include "DllMain.h"
|
||||
#include "GenMachining.h"
|
||||
#include "MachiningConst.h"
|
||||
#include "OperationConst.h"
|
||||
#include "/EgtDev/Include/EGkCurveLine.h"
|
||||
#include "/EgtDev/Include/EGkCurveArc.h"
|
||||
#include "/EgtDev/Include/EGkCurveComposite.h"
|
||||
@@ -63,7 +63,7 @@ static const string ON_PREVIEW = "OnPreview_" ;
|
||||
static const string ON_APPLY = "OnApply_" ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
USEROBJ_REGISTER( "EMkGenMachining", GenMachining) ;
|
||||
USEROBJ_REGISTER( GetOperationClass( OPER_GENMACHINING), GenMachining) ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
const string&
|
||||
|
||||
@@ -33,6 +33,8 @@ class GenMachining : public Machining
|
||||
bool Load( const STRVECTOR& vString, int nBaseGdbId) override ;
|
||||
|
||||
public : // Operation
|
||||
int GetType( void) const override
|
||||
{ return OPER_GENMACHINING ; }
|
||||
bool IsEmpty( void) const override
|
||||
{ return ( m_nMills == 0) ; }
|
||||
|
||||
|
||||
@@ -260,9 +260,10 @@ class MachMgr : public IMachMgr
|
||||
// Simulation
|
||||
bool SimStart( bool bFirst) override ;
|
||||
bool SimMove( int& nStatus) override ;
|
||||
bool SimGetAxisInfoPos( int nI, std::string& sName, std::string& sToken, bool& bLinear, double& dVal) override ;
|
||||
bool SimGetToolInfo( std::string& sName, double& dSpeed) override ;
|
||||
bool SimGetMoveInfo( int& nGmove, double& dFeed) override ;
|
||||
bool SimGetAxisInfoPos( int nI, std::string& sName, std::string& sToken, bool& bLinear, double& dVal) const override ;
|
||||
bool SimGetToolInfo( std::string& sName, double& dSpeed) const override ;
|
||||
bool SimGetOperationInfo( std::string& sName, int& nType) const override ;
|
||||
bool SimGetMoveInfo( int& nGmove, double& dFeed) const override ;
|
||||
bool SimSetStep( double dStep) override ;
|
||||
bool SimGoHome( void) override ;
|
||||
bool SimStop( void) override ;
|
||||
@@ -272,7 +273,7 @@ class MachMgr : public IMachMgr
|
||||
bool SetCalcTable( const std::string& sTable) override ;
|
||||
bool SetCalcTool( const std::string& sTool, const std::string& sHead, int nExit) override ;
|
||||
bool SetRotAxisBlock( const std::string& sAxis, double dVal) override ;
|
||||
bool GetRotAxisBlocked( int nInd, std::string& sAxis, double& dVal) override ;
|
||||
bool GetRotAxisBlocked( int nInd, std::string& sAxis, double& dVal) const override ;
|
||||
bool GetCalcTool( std::string& sTool) const override ;
|
||||
bool GetCalcAngles( const Vector3d& vtDirT, const Vector3d& vtDirA,
|
||||
int& nStat, double& dAngA1, double& dAngB1, double& dAngA2, double& dAngB2) const override ;
|
||||
|
||||
+2
-2
@@ -365,7 +365,7 @@ MachMgr::SetRotAxisBlock( const string& sAxis, double dVal)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::GetRotAxisBlocked( int nInd, string& sAxis, double& dVal)
|
||||
MachMgr::GetRotAxisBlocked( int nInd, string& sAxis, double& dVal) const
|
||||
{
|
||||
// se bloccaggi non ancora impostati
|
||||
if ( ! m_vAxisBlock.empty()) {
|
||||
@@ -376,7 +376,7 @@ MachMgr::GetRotAxisBlocked( int nInd, string& sAxis, double& dVal)
|
||||
return true ;
|
||||
}
|
||||
// altrimenti cerco negli assi rotanti correnti
|
||||
Machine* pMch = GetCurrMachine() ;
|
||||
const Machine* pMch = GetCurrMachine() ;
|
||||
if ( pMch == nullptr)
|
||||
return false ;
|
||||
int nMyInd = 0 ;
|
||||
|
||||
+58
-81
@@ -17,11 +17,10 @@
|
||||
#include "MachMgr.h"
|
||||
#include "MachConst.h"
|
||||
#include "Disposition.h"
|
||||
#include "Machining.h"
|
||||
#include "MachiningCreate.h"
|
||||
#include "SetTempPhase.h"
|
||||
#include "SetTempMachLook.h"
|
||||
#include "/EgtDev/Include/EMkOperationConst.h"
|
||||
#include "/EgtDev/Include/EGkUserObjFactory.h"
|
||||
#include "/EgtDev/Include/EGkGdbIterator.h"
|
||||
#include "/EgtDev/Include/EGnStringKeyVal.h"
|
||||
#include "/EgtDev/Include/EGnFileUtils.h"
|
||||
@@ -151,72 +150,66 @@ MachMgr::GetPrevActiveOperation( int nId) const
|
||||
int
|
||||
MachMgr::GetOperationType( int nId) const
|
||||
{
|
||||
// verifiche
|
||||
if ( m_pGeomDB == nullptr || m_pGeomDB->GetParentId( nId) != GetCurrOperId())
|
||||
return 0 ;
|
||||
// recupero l'operazione
|
||||
PtrOwner<IGdbIterator> pIter( CreateGdbIterator( m_pGeomDB)) ;
|
||||
if ( IsNull( pIter) || ! pIter->GoTo( nId))
|
||||
return OPER_NULL ;
|
||||
// verifico che il gruppo ricevuto sia corretto
|
||||
if ( pIter->GetParentId() != GetCurrOperId())
|
||||
return OPER_NULL ;
|
||||
// recupero user object
|
||||
IUserObj* pUserObj = pIter->GetUserObj() ;
|
||||
if ( pUserObj == nullptr)
|
||||
return OPER_NULL ;
|
||||
// recupero il tipo di UserObj
|
||||
const string& sUserObj = pUserObj->GetClassName() ;
|
||||
if ( sUserObj == USEROBJ_GETNAME( Disposition))
|
||||
return OPER_DISP ;
|
||||
else if ( sUserObj == USEROBJ_GETNAME( Drilling))
|
||||
return OPER_DRILLING ;
|
||||
else if ( sUserObj == USEROBJ_GETNAME( Sawing))
|
||||
return OPER_SAWING ;
|
||||
else if ( sUserObj == USEROBJ_GETNAME( Milling))
|
||||
return OPER_MILLING ;
|
||||
else if ( sUserObj == USEROBJ_GETNAME( Pocketing))
|
||||
return OPER_POCKETING ;
|
||||
//else if ( sUserObj == USEROBJ_GETNAME( Mortising))
|
||||
// return OPER_MORTISING ;
|
||||
else if ( sUserObj == USEROBJ_GETNAME( SawRoughing))
|
||||
return OPER_SAWROUGHING ;
|
||||
else if ( sUserObj == USEROBJ_GETNAME( SawFinishing))
|
||||
return OPER_SAWFINISHING ;
|
||||
else if ( sUserObj == USEROBJ_GETNAME( GenMachining))
|
||||
return OPER_GENMACHINING ;
|
||||
else if ( sUserObj == USEROBJ_GETNAME( Chiseling))
|
||||
return OPER_CHISELING ;
|
||||
else
|
||||
const Operation* pOpe = GetOperation( m_pGeomDB->GetUserObj( nId)) ;
|
||||
if ( pOpe == nullptr)
|
||||
return OPER_NULL ;
|
||||
// restituisco il tipo
|
||||
return pOpe->GetType() ;
|
||||
|
||||
//// recupero l'operazione
|
||||
// PtrOwner<IGdbIterator> pIter( CreateGdbIterator( m_pGeomDB)) ;
|
||||
// if ( IsNull( pIter) || ! pIter->GoTo( nId))
|
||||
// return OPER_NULL ;
|
||||
//// verifico che il gruppo ricevuto sia corretto
|
||||
// if ( pIter->GetParentId() != GetCurrOperId())
|
||||
// return OPER_NULL ;
|
||||
//// recupero user object
|
||||
// IUserObj* pUserObj = pIter->GetUserObj() ;
|
||||
// if ( pUserObj == nullptr)
|
||||
// return OPER_NULL ;
|
||||
//// recupero il tipo di UserObj
|
||||
// const string& sUserObj = pUserObj->GetClassName() ;
|
||||
// if ( sUserObj == USEROBJ_GETNAME( Disposition))
|
||||
// return OPER_DISP ;
|
||||
// else if ( sUserObj == USEROBJ_GETNAME( Drilling))
|
||||
// return OPER_DRILLING ;
|
||||
// else if ( sUserObj == USEROBJ_GETNAME( Sawing))
|
||||
// return OPER_SAWING ;
|
||||
// else if ( sUserObj == USEROBJ_GETNAME( Milling))
|
||||
// return OPER_MILLING ;
|
||||
// else if ( sUserObj == USEROBJ_GETNAME( Pocketing))
|
||||
// return OPER_POCKETING ;
|
||||
// //else if ( sUserObj == USEROBJ_GETNAME( Mortising))
|
||||
// // return OPER_MORTISING ;
|
||||
// else if ( sUserObj == USEROBJ_GETNAME( SawRoughing))
|
||||
// return OPER_SAWROUGHING ;
|
||||
// else if ( sUserObj == USEROBJ_GETNAME( SawFinishing))
|
||||
// return OPER_SAWFINISHING ;
|
||||
// else if ( sUserObj == USEROBJ_GETNAME( GenMachining))
|
||||
// return OPER_GENMACHINING ;
|
||||
// else if ( sUserObj == USEROBJ_GETNAME( Chiseling))
|
||||
// return OPER_CHISELING ;
|
||||
// else
|
||||
// return OPER_NULL ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
int
|
||||
MachMgr::GetOperationPhase( int nId) const
|
||||
{
|
||||
// recupero l'operazione
|
||||
PtrOwner<IGdbIterator> pIter( CreateGdbIterator( m_pGeomDB)) ;
|
||||
if ( IsNull( pIter) || ! pIter->GoTo( nId))
|
||||
// verifiche
|
||||
if ( m_pGeomDB == nullptr || m_pGeomDB->GetParentId( nId) != GetCurrOperId())
|
||||
return 0 ;
|
||||
// verifico che il gruppo ricevuto sia corretto
|
||||
if ( pIter->GetParentId() != GetCurrOperId())
|
||||
// recupero operazione
|
||||
const Operation* pOpe = GetOperation( m_pGeomDB->GetUserObj( nId)) ;
|
||||
if ( pOpe == nullptr)
|
||||
return 0 ;
|
||||
// recupero user object
|
||||
IUserObj* pUserObj = pIter->GetUserObj() ;
|
||||
if ( pUserObj == nullptr)
|
||||
return 0 ;
|
||||
// se disposizione
|
||||
if ( pUserObj->GetClassName() == USEROBJ_GETNAME( Disposition)) {
|
||||
const Disposition* pDisp = ::GetDisposition( pUserObj) ;
|
||||
if ( pDisp != nullptr)
|
||||
return pDisp->GetPhase() ;
|
||||
}
|
||||
// altrimenti lavorazione
|
||||
else {
|
||||
const Machining* pMch = GetMachining( pUserObj) ;
|
||||
if ( pMch != nullptr)
|
||||
return pMch->GetPhase() ;
|
||||
}
|
||||
// errore
|
||||
return 0 ;
|
||||
// restituisco la fase
|
||||
return pOpe->GetPhase() ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -290,31 +283,15 @@ MachMgr::GetOperationId( const string& sName) const
|
||||
bool
|
||||
MachMgr::IsOperationEmpty( int nId) const
|
||||
{
|
||||
// recupero l'operazione
|
||||
PtrOwner<IGdbIterator> pIter( CreateGdbIterator( m_pGeomDB)) ;
|
||||
if ( IsNull( pIter) || ! pIter->GoTo( nId))
|
||||
// verifiche
|
||||
if ( m_pGeomDB == nullptr || m_pGeomDB->GetParentId( nId) != GetCurrOperId())
|
||||
return true ;
|
||||
// verifico che il gruppo ricevuto sia corretto
|
||||
if ( pIter->GetParentId() != GetCurrOperId())
|
||||
// recupero operazione
|
||||
const Operation* pOpe = GetOperation( m_pGeomDB->GetUserObj( nId)) ;
|
||||
if ( pOpe == nullptr)
|
||||
return true ;
|
||||
// recupero user object
|
||||
IUserObj* pUserObj = pIter->GetUserObj() ;
|
||||
if ( pUserObj == nullptr)
|
||||
return true ;
|
||||
// se disposizione
|
||||
if ( pUserObj->GetClassName() == USEROBJ_GETNAME( Disposition)) {
|
||||
const Disposition* pDisp = ::GetDisposition( pUserObj) ;
|
||||
if ( pDisp != nullptr)
|
||||
return pDisp->IsEmpty() ;
|
||||
}
|
||||
// altrimenti lavorazione
|
||||
else {
|
||||
const Machining* pMch = GetMachining( pUserObj) ;
|
||||
if ( pMch != nullptr)
|
||||
return pMch->IsEmpty() ;
|
||||
}
|
||||
// errore
|
||||
return true ;
|
||||
// restituisco se vuota
|
||||
return pOpe->IsEmpty() ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
+15
-4
@@ -52,7 +52,7 @@ MachMgr::SimMove( int& nStatus)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::SimGetAxisInfoPos( int nI, string& sName, string& sToken, bool& bLinear, double& dVal)
|
||||
MachMgr::SimGetAxisInfoPos( int nI, string& sName, string& sToken, bool& bLinear, double& dVal) const
|
||||
{
|
||||
// verifico simulatore
|
||||
if ( m_pSimul == nullptr)
|
||||
@@ -63,18 +63,29 @@ MachMgr::SimGetAxisInfoPos( int nI, string& sName, string& sToken, bool& bLinear
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::SimGetToolInfo( string& sName, double& dSpeed)
|
||||
MachMgr::SimGetToolInfo( string& sName, double& dSpeed) const
|
||||
{
|
||||
// verifico simulatore
|
||||
if ( m_pSimul == nullptr)
|
||||
return false ;
|
||||
// recupero quote
|
||||
// recupero dati utensile corrente
|
||||
return m_pSimul->GetToolInfo( sName, dSpeed) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::SimGetMoveInfo( int& nGmove, double& dFeed)
|
||||
MachMgr::SimGetOperationInfo( string& sName, int& nType) const
|
||||
{
|
||||
// verifico simulatore
|
||||
if ( m_pSimul == nullptr)
|
||||
return false ;
|
||||
// recupero dati operazione corrente
|
||||
return m_pSimul->GetOperationInfo( sName, nType) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::SimGetMoveInfo( int& nGmove, double& dFeed) const
|
||||
{
|
||||
// verifico simulatore
|
||||
if ( m_pSimul == nullptr)
|
||||
|
||||
+5
-1
@@ -54,7 +54,9 @@ GetMachiningTitle( int nMchType)
|
||||
"Pocketing",
|
||||
"Mortising",
|
||||
"SawRoughing",
|
||||
"SawFinishing"} ;
|
||||
"SawFinishing",
|
||||
"GenMachining",
|
||||
"Chiseling"} ;
|
||||
switch ( nMchType) {
|
||||
case MT_DRILLING : return MchTitle[1] ;
|
||||
case MT_SAWING : return MchTitle[2] ;
|
||||
@@ -63,6 +65,8 @@ GetMachiningTitle( int nMchType)
|
||||
case MT_MORTISING : return MchTitle[5] ;
|
||||
case MT_SAWROUGHING : return MchTitle[6] ;
|
||||
case MT_SAWFINISHING : return MchTitle[7] ;
|
||||
case MT_GENMACHINING : return MchTitle[8] ;
|
||||
case MT_CHISELING : return MchTitle[9] ;
|
||||
}
|
||||
return MchTitle[0] ;
|
||||
}
|
||||
|
||||
+15
-20
@@ -13,30 +13,25 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Drilling.h"
|
||||
#include "Sawing.h"
|
||||
#include "Milling.h"
|
||||
#include "Pocketing.h"
|
||||
#include "SawRoughing.h"
|
||||
#include "SawFinishing.h"
|
||||
#include "GenMachining.h"
|
||||
#include "Chiseling.h"
|
||||
#include "Machining.h"
|
||||
#include "OperationConst.h"
|
||||
#include "/EgtDev/Include/EGkUserObjFactory.h"
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Dal tipo numerico crea una istanza della classe
|
||||
inline Machining*
|
||||
CreateMachining( int nMchType)
|
||||
{
|
||||
switch ( nMchType) {
|
||||
case MT_DRILLING : return new( std::nothrow) Drilling ;
|
||||
case MT_SAWING : return new( std::nothrow) Sawing ;
|
||||
case MT_MILLING : return new( std::nothrow) Milling ;
|
||||
case MT_POCKETING : return new( std::nothrow) Pocketing ;
|
||||
// case MT_MORTISING : return new( std::nothrow) Mortising ;
|
||||
case MT_SAWROUGHING : return new( std::nothrow) SawRoughing ;
|
||||
case MT_SAWFINISHING : return new( std::nothrow) SawFinishing ;
|
||||
case MT_GENMACHINING : return new( std::nothrow) GenMachining ;
|
||||
case MT_CHISELING : return new( std::nothrow) Chiseling ;
|
||||
}
|
||||
return nullptr ;
|
||||
// verifico sia richiesto un oggetto utente di tipo lavorazione
|
||||
if ( ! IsValidMachiningType( nMchType))
|
||||
return false ;
|
||||
// creo l'oggetto
|
||||
IUserObj* pUsrObj = USEROBJ_CREATE( GetOperationClass( nMchType)) ;
|
||||
if ( pUsrObj == nullptr)
|
||||
return false ;
|
||||
// lo converto a lavorazione
|
||||
Machining* pMch = GetMachining( pUsrObj) ;
|
||||
if ( pMch == nullptr)
|
||||
delete pUsrObj ;
|
||||
return pMch ;
|
||||
}
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@
|
||||
#include "MachMgr.h"
|
||||
#include "DllMain.h"
|
||||
#include "Milling.h"
|
||||
#include "MachiningConst.h"
|
||||
#include "OperationConst.h"
|
||||
#include "/EgtDev/Include/EGkCurveLine.h"
|
||||
#include "/EgtDev/Include/EGkCurveArc.h"
|
||||
#include "/EgtDev/Include/EGkCurveComposite.h"
|
||||
@@ -56,7 +56,7 @@ using namespace std ;
|
||||
// 2321 = "Error in Milling : post apply not calculable"
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
USEROBJ_REGISTER( "EMkMilling", Milling) ;
|
||||
USEROBJ_REGISTER( GetOperationClass( OPER_MILLING), Milling) ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
const string&
|
||||
|
||||
@@ -33,6 +33,8 @@ class Milling : public Machining
|
||||
bool Load( const STRVECTOR& vString, int nBaseGdbId) override ;
|
||||
|
||||
public : // Operation
|
||||
int GetType( void) const override
|
||||
{ return OPER_MILLING ; }
|
||||
bool IsEmpty( void) const override
|
||||
{ return ( m_nMills == 0) ; }
|
||||
|
||||
|
||||
+2
-1
@@ -15,13 +15,14 @@
|
||||
#include "stdafx.h"
|
||||
#include "DllMain.h"
|
||||
#include "Operation.h"
|
||||
#include "OperationConst.h"
|
||||
#include "MachMgr.h"
|
||||
#include "OutputConst.h"
|
||||
#include "/EgtDev/Include/EGkAngle.h"
|
||||
#include "/EgtDev/Include/EGkGeoPoint3d.h"
|
||||
#include "/EgtDev/Include/EGkCurveLine.h"
|
||||
#include "/EgtDev/Include/EGkCurveArc.h"
|
||||
#include "/EgtDev/Include/EgkArcSpecial.h"
|
||||
#include "/EgtDev/Include/EGkArcSpecial.h"
|
||||
#include "/EgtDev/Include/EGkCurveComposite.h"
|
||||
#include "/EgtDev/Include/EGkDistPointCurve.h"
|
||||
#include "/EgtDev/Include/EGkIntersCurves.h"
|
||||
|
||||
@@ -43,6 +43,7 @@ class Operation : public IUserObj
|
||||
virtual bool RemoveHome( void) ;
|
||||
|
||||
public :
|
||||
virtual int GetType( void) const = 0 ;
|
||||
virtual bool IsEmpty( void) const = 0 ;
|
||||
|
||||
protected :
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2017-2017
|
||||
//----------------------------------------------------------------------------
|
||||
// File : OperationConst.h Data : 17.08.17 Versione : 1.8h1
|
||||
// Contenuto : Costanti per le operazioni.
|
||||
//
|
||||
//
|
||||
//
|
||||
// Modifiche : 17.08.17 DS Creazione modulo.
|
||||
//
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "/EgtDev/Include/EMkOperationConst.h"
|
||||
#include <string>
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static const std::string s_OpeClass[] = {"",
|
||||
"EMkDisposition",
|
||||
"EMkDrilling",
|
||||
"EMkSawing",
|
||||
"EMkMilling",
|
||||
"EMkPocketing",
|
||||
"EMkMortising",
|
||||
"EMkSawRoughing",
|
||||
"EMkSawFinishing",
|
||||
"EMkGenMachining",
|
||||
"EMkChiseling"} ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Dal tipo numerico restituisce la classe della operazione
|
||||
inline const std::string&
|
||||
GetOperationClass( int nOpeType)
|
||||
{
|
||||
switch ( nOpeType) {
|
||||
case OPER_DISP : return s_OpeClass[1] ;
|
||||
case OPER_DRILLING : return s_OpeClass[2] ;
|
||||
case OPER_SAWING : return s_OpeClass[3] ;
|
||||
case OPER_MILLING : return s_OpeClass[4] ;
|
||||
case OPER_POCKETING : return s_OpeClass[5] ;
|
||||
case OPER_MORTISING : return s_OpeClass[6] ;
|
||||
case OPER_SAWROUGHING : return s_OpeClass[7] ;
|
||||
case OPER_SAWFINISHING : return s_OpeClass[8] ;
|
||||
case OPER_GENMACHINING : return s_OpeClass[9] ;
|
||||
case OPER_CHISELING : return s_OpeClass[10] ;
|
||||
}
|
||||
return s_OpeClass[0] ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Dalla classe restituisce il tipo numerico della operazione
|
||||
inline int
|
||||
GetOperationType( const std::string& sOpeClass)
|
||||
{
|
||||
if ( sOpeClass == s_OpeClass[1])
|
||||
return OPER_DISP ;
|
||||
else if ( sOpeClass == s_OpeClass[2])
|
||||
return OPER_DRILLING ;
|
||||
else if ( sOpeClass == s_OpeClass[3])
|
||||
return OPER_SAWING ;
|
||||
else if ( sOpeClass == s_OpeClass[4])
|
||||
return OPER_MILLING ;
|
||||
else if ( sOpeClass == s_OpeClass[5])
|
||||
return OPER_POCKETING ;
|
||||
else if ( sOpeClass == s_OpeClass[6])
|
||||
return OPER_MORTISING ;
|
||||
else if ( sOpeClass == s_OpeClass[7])
|
||||
return OPER_SAWROUGHING ;
|
||||
else if ( sOpeClass == s_OpeClass[8])
|
||||
return OPER_SAWFINISHING ;
|
||||
else if ( sOpeClass == s_OpeClass[9])
|
||||
return OPER_GENMACHINING ;
|
||||
else if ( sOpeClass == s_OpeClass[10])
|
||||
return OPER_CHISELING ;
|
||||
else
|
||||
return OPER_NULL ;
|
||||
}
|
||||
+2
-1
@@ -16,6 +16,7 @@
|
||||
#include "MachMgr.h"
|
||||
#include "DllMain.h"
|
||||
#include "Pocketing.h"
|
||||
#include "OperationConst.h"
|
||||
#include "MachiningConst.h"
|
||||
#include "/EgtDev/Include/EGkCurveLine.h"
|
||||
#include "/EgtDev/Include/EGkCurveArc.h"
|
||||
@@ -63,7 +64,7 @@ using namespace std ;
|
||||
// 2427 = "Error in Pocketing : post apply not calculable"
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
USEROBJ_REGISTER( "EMkPocketing", Pocketing) ;
|
||||
USEROBJ_REGISTER( GetOperationClass( OPER_POCKETING), Pocketing) ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
const string&
|
||||
|
||||
@@ -34,6 +34,8 @@ class Pocketing : public Machining
|
||||
bool Load( const STRVECTOR& vString, int nBaseGdbId) override ;
|
||||
|
||||
public : // Operation
|
||||
int GetType( void) const override
|
||||
{ return OPER_POCKETING ; }
|
||||
bool IsEmpty( void) const override
|
||||
{ return ( m_nPockets == 0) ; }
|
||||
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@
|
||||
#include "MachMgr.h"
|
||||
#include "DllMain.h"
|
||||
#include "SawFinishing.h"
|
||||
#include "CamData.h"
|
||||
#include "OperationConst.h"
|
||||
#include "/EgtDev/Include/EXeCmdLogOff.h"
|
||||
#include "/EgtDev/Include/EXeConst.h"
|
||||
#include "/EgtDev/Include/EGkCurveLine.h"
|
||||
@@ -62,7 +62,7 @@ enum nCrvClass {
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
USEROBJ_REGISTER( "EMkSawFinishing", SawFinishing) ;
|
||||
USEROBJ_REGISTER( GetOperationClass( OPER_SAWFINISHING), SawFinishing) ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
const string&
|
||||
|
||||
@@ -36,6 +36,8 @@ class SawFinishing : public Machining
|
||||
bool Load( const STRVECTOR& vString, int nBaseGdbId) override ;
|
||||
|
||||
public : // Operation
|
||||
int GetType( void) const override
|
||||
{ return OPER_SAWFINISHING ; }
|
||||
bool IsEmpty( void) const override
|
||||
{ return ( m_nCuts == 0) ; }
|
||||
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@
|
||||
#include "MachMgr.h"
|
||||
#include "DllMain.h"
|
||||
#include "SawRoughing.h"
|
||||
#include "CamData.h"
|
||||
#include "OperationConst.h"
|
||||
#include "/EgtDev/Include/EXeCmdLogOff.h"
|
||||
#include "/EgtDev/Include/EXeConst.h"
|
||||
#include "/EgtDev/Include/EGkCurveLine.h"
|
||||
@@ -55,7 +55,7 @@ const std::string MCH_SECTION = "Sect" ;
|
||||
const std::string MCH_GUIDE = "Guide" ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
USEROBJ_REGISTER( "EMkSawRoughing", SawRoughing) ;
|
||||
USEROBJ_REGISTER( GetOperationClass( OPER_SAWROUGHING), SawRoughing) ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
const string&
|
||||
|
||||
@@ -36,6 +36,8 @@ class SawRoughing : public Machining
|
||||
bool Load( const STRVECTOR& vString, int nBaseGdbId) override ;
|
||||
|
||||
public : // Operation
|
||||
int GetType( void) const override
|
||||
{ return OPER_SAWROUGHING ; }
|
||||
bool IsEmpty( void) const override
|
||||
{ return ( m_nCuts == 0) ; }
|
||||
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@
|
||||
#include "MachMgr.h"
|
||||
#include "DllMain.h"
|
||||
#include "Sawing.h"
|
||||
#include "CamData.h"
|
||||
#include "OperationConst.h"
|
||||
#include "/EgtDev/Include/EXeCmdLogOff.h"
|
||||
#include "/EgtDev/Include/EXeConst.h"
|
||||
#include "/EgtDev/Include/EGkCurveLine.h"
|
||||
@@ -55,7 +55,7 @@ using namespace std ;
|
||||
// 2219 = "Error in Sawing : post apply not calculable"
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
USEROBJ_REGISTER( "EMkSawing", Sawing) ;
|
||||
USEROBJ_REGISTER( GetOperationClass( OPER_SAWING), Sawing) ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
const string&
|
||||
|
||||
@@ -36,6 +36,8 @@ class Sawing : public Machining
|
||||
bool Load( const STRVECTOR& vString, int nBaseGdbId) override ;
|
||||
|
||||
public : // Operation
|
||||
int GetType( void) const override
|
||||
{ return OPER_SAWING ; }
|
||||
bool IsEmpty( void) const override
|
||||
{ return ( m_nCuts == 0) ; }
|
||||
|
||||
|
||||
+25
-5
@@ -259,20 +259,40 @@ Simulator::GetAxisInfoPos( int nI, string& sName, string& sToken, bool& bLinear,
|
||||
bool
|
||||
Simulator::GetToolInfo( string& sName, double& dSpeed) const
|
||||
{
|
||||
// Inizializzo i parametri di ritorno
|
||||
sName.clear() ;
|
||||
dSpeed = 0 ;
|
||||
// Verifiche
|
||||
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
|
||||
return false ;
|
||||
// Assegno il nome dell'utensile
|
||||
sName = m_sTool ;
|
||||
if ( sName.empty()) {
|
||||
dSpeed = 0 ;
|
||||
if ( sName.empty())
|
||||
return true ;
|
||||
}
|
||||
// Recupero speed
|
||||
Machining* pMch = GetMachining( m_pGeomDB->GetUserObj( m_nOpId)) ;
|
||||
const Machining* pMch = GetMachining( m_pGeomDB->GetUserObj( m_nOpId)) ;
|
||||
return ( pMch != nullptr && pMch->GetParam( MPA_SPEED, dSpeed)) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Simulator::GetOperationInfo( string& sName, int& nType) const
|
||||
{
|
||||
// Inizializzo i parametri di ritorno
|
||||
sName.clear() ;
|
||||
nType = OPER_NULL ;
|
||||
// Verifiche
|
||||
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
|
||||
return false ;
|
||||
// Recupero il tipo
|
||||
Operation* pOpe = GetOperation( m_pGeomDB->GetUserObj( m_nOpId)) ;
|
||||
if ( pOpe == nullptr)
|
||||
return false ;
|
||||
nType = pOpe->GetType() ;
|
||||
// Recupero il nome
|
||||
return m_pGeomDB->GetName( m_nOpId, sName) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Simulator::GetMoveInfo( int& nGmove, double& dFeed) const
|
||||
@@ -281,7 +301,7 @@ Simulator::GetMoveInfo( int& nGmove, double& dFeed) const
|
||||
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
|
||||
return false ;
|
||||
// Recupero il movimento corrente
|
||||
CamData* pCamData = GetCamData( m_pGeomDB->GetUserObj( m_nEntId)) ;
|
||||
const CamData* pCamData = GetCamData( m_pGeomDB->GetUserObj( m_nEntId)) ;
|
||||
if ( pCamData == nullptr)
|
||||
return false ;
|
||||
// Assegno feed
|
||||
|
||||
@@ -31,6 +31,7 @@ class Simulator
|
||||
bool Move( int& nStatus) ;
|
||||
bool GetAxisInfoPos( int nI, std::string& sName, std::string& sToken, bool& bLinear, double& dVal) const ;
|
||||
bool GetToolInfo( std::string& sName, double& dSpeed) const ;
|
||||
bool GetOperationInfo( std::string& sName, int& nType) const ;
|
||||
bool GetMoveInfo( int& nGmove, double& dFeed) const ;
|
||||
bool SetStep( double dStep) ;
|
||||
bool GoHome( void) ;
|
||||
|
||||
Reference in New Issue
Block a user