b373807375
- aggiunta gestione prima disposizione in lista operazioni - migliorato controllo dati macchina al caricamento - ora macchina deve essere disegnata e definita cinematicamente con tutti gli assi a 0, si definisce la posizione home e dopo il carico viene posta in questa posizione.
103 lines
4.4 KiB
C++
103 lines
4.4 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/EGkObjUser.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
|
|
FixtureData( void)
|
|
: sName(), nId( GDB_ID_NULL), ptPos() {}
|
|
FixtureData( const std::string& sN, int nI, const Point3d& ptP)
|
|
: sName( sN), nId( nI), ptPos( ptP) {}
|
|
} ;
|
|
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 tipo 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 ;
|
|
|
|
//----------------------------------------------------------------------------
|
|
static std::string DIS_TABLE = "Tab" ;
|
|
static std::string DIS_FXD_TOT = "FxT" ;
|
|
static std::string DIS_FXD_NAME = "FxN" ;
|
|
static std::string DIS_FXD_POS = "FxP" ;
|
|
static std::string DIS_MVD_TOT = "MvT" ;
|
|
static std::string DIS_MVD_ID = "MvI" ;
|
|
static std::string DIS_MVD_TYPE = "MvT" ;
|
|
static std::string DIS_MVD_PNT = "MvP" ;
|
|
static std::string DIS_MVD_ANG = "MvA" ;
|
|
static std::string DIS_MVD_FLAG = "MvF" ;
|
|
|
|
//----------------------------------------------------------------------------
|
|
class Disposition : public IObjUser
|
|
{
|
|
public :
|
|
virtual Disposition* Clone( void) const ;
|
|
virtual const std::string& GetClassName( void) const ;
|
|
virtual bool Dump( std::string& sOut, 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) ;
|
|
int AddSubPiece( const std::string& sName, const Point3d& ptPos, bool bAddToList = true) ;
|
|
bool MoveSubPiece( int nId, const Vector3d& vtMove) ;
|
|
bool RemoveSubPiece( 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) ;
|
|
|
|
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
|
|
} ; |