2324a8b3f4
- modifiche a DB utensili per gestione utensile corrente - prima versione generatore codice.
97 lines
4.5 KiB
C++
97 lines
4.5 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2015-2015
|
|
//----------------------------------------------------------------------------
|
|
// File : Disposition.h Data : 27.05.15 Versione : 1.6e7
|
|
// Contenuto : Dichiarazione della classe Disposition.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 27.05.15 DS Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include "/EgtDev/Include/EGkPoint3d.h"
|
|
#include "/EgtDev/Include/EGkUserObj.h"
|
|
#include "/EgtDev/Include/EgtNumCollection.h"
|
|
#include <string>
|
|
|
|
//----------------------------------------------------------------------------
|
|
struct FixtureData
|
|
{
|
|
std::string sName ; // nome del dispositivo di bloccaggio
|
|
int nId ; // identificativo
|
|
Point3d ptPos ; // posizione nel riferimento tavola
|
|
double dAng ; // angolo di rotazione attorno al centro
|
|
FixtureData( void)
|
|
: sName(), nId( GDB_ID_NULL), ptPos(), dAng( 0) {}
|
|
FixtureData( const std::string& sN, int nI, const Point3d& ptP, double dA)
|
|
: sName( sN), nId( nI), ptPos( ptP), dAng( dA) {}
|
|
} ;
|
|
typedef std::vector<FixtureData> FIXDATAVECTOR ;
|
|
|
|
//----------------------------------------------------------------------------
|
|
struct MoveRawData
|
|
{
|
|
int nRawId ; // identificativo del grezzo
|
|
int nType ; // tipo di movimento ( 1=MoveToCorner, 2=MoveToCenter, 3=Rotate)
|
|
Point3d ptP ; // punto di riferimento / angoli di Eulero CAC'
|
|
int nFlag ; // flag sottotipo movimento/rotazione
|
|
enum { NONE = 0, COR = 1, CEN = 2, ROT = 3} ;
|
|
MoveRawData( void)
|
|
: nRawId( 0), nType( NONE), ptP(), nFlag( 0) {}
|
|
MoveRawData( int nId, int nT, const Point3d& ptR, int nF)
|
|
: nRawId( nId), nType( nT), ptP( ptR), nFlag( nF) {}
|
|
} ;
|
|
typedef std::vector<MoveRawData> MVRDATAVECTOR ;
|
|
|
|
//----------------------------------------------------------------------------
|
|
class Disposition : public IUserObj
|
|
{
|
|
public : // IUserObj
|
|
virtual Disposition* Clone( void) const ;
|
|
virtual const std::string& GetClassName( void) const ;
|
|
virtual bool Dump( std::string& sOut, bool bMM = true, const char* szNewLine = "\n") const ;
|
|
virtual bool ToSave( void) const { return true ; }
|
|
virtual bool Save( STRVECTOR& vString) const ;
|
|
virtual bool Load( const STRVECTOR& vString) ;
|
|
virtual bool SetOwner( int nId, IGeomDB* pGDB) ;
|
|
virtual int GetOwner( void) const ;
|
|
virtual IGeomDB* GetGeomDB( void) const ;
|
|
|
|
public :
|
|
Disposition( void) ;
|
|
bool Init( MachMgr* pMchMgr) ;
|
|
bool SetTable( const std::string& sTable) ;
|
|
bool Apply( void) ;
|
|
bool GetTable( std::string& sTable) const ;
|
|
bool GetTableRef1( Point3d& ptRef1) const ;
|
|
int AddFixture( const std::string& sName, const Point3d& ptPos, double dAngDeg = 0, bool bAddToList = true) ;
|
|
bool MoveFixture( int nId, const Vector3d& vtMove) ;
|
|
bool RotateFixture( int nId, double dAngDeg) ;
|
|
bool RemoveFixture( int nId) ;
|
|
bool MoveToCornerRawPart( int nRawId, const Point3d& ptP, int nFlag, bool bAddToList = true) ;
|
|
bool MoveToCenterRawPart( int nRawId, const Point3d& ptP, int nFlag, bool bAddToList = true) ;
|
|
bool MoveRawPart( int nRawId, const Vector3d& vtMove) ;
|
|
bool RotateRawPart( int nRawId, const Vector3d& vtAx, double dAngRotDeg) ;
|
|
bool ApplyRotationToRawPart( int nRawId, double dAngCDeg, double dAngADeg, double dAngC1Deg) ;
|
|
bool RemoveRawPart( int nRawId) ;
|
|
bool GetFixtureData( int nInd, std::string& sName, int& nId, Point3d& ptPos, double& dAngDeg) const ;
|
|
bool GetMoveRawData( int nInd, int& nRawId, int& nType, Point3d& ptPos, int& nFlag) const ;
|
|
|
|
private :
|
|
bool VerifyFixture( int nFixtId) const ;
|
|
bool VerifyRawPart( int nRawId) const ;
|
|
|
|
private :
|
|
int m_nOwnerId ;
|
|
IGeomDB* m_pGeomDB ;
|
|
MachMgr* m_pMchMgr ; // puntatore al gestore di tutte le lavorazioni
|
|
std::string m_sTabName ; // nome della tavola di appartenenza
|
|
Point3d m_ptRef1 ; // origine 1 della tavola
|
|
bool m_bTabOk ; // flag di tavola verificata
|
|
FIXDATAVECTOR m_vFixData ; // elenco posizionamento bloccaggi
|
|
MVRDATAVECTOR m_vMvrData ; // elenco movimenti grezzi
|
|
} ; |