Files
Dario Sassi 5a4f77030c EgtMachKernel :
- aggiunto flag in Ini macchina [Machinings] RapidOnOut=1 per abilitare approcci e retrazioni in rapido diretti su estremi fresature 1 passata fuori dal grezzo
- migliorata precisione nella verifica collisioni per link tra lavorazioni con vere geometrie utensile con nome Tool_* (Tool_C, Tool_S,...).
2024-07-31 20:30:13 +02:00

112 lines
5.7 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2015-2015
//----------------------------------------------------------------------------
// File : ToolData.h Data : 03.06.15 Versione : 1.6f1
// Contenuto : Dichiarazione della struct ToolData e costanti associate.
//
//
//
// Modifiche : 03.06.15 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include "/EgtDev/Include/EGkGeoConst.h"
#include "/EgtDev/Include/EGnEgtUUID.h"
#include <string>
//----------------------------------------------------------------------------
struct ToolData
{
EgtUUID m_Uuid ; // identificativo universale dell'utensile
std::string m_sName ; // nome dell'utensile
std::string m_sDraw ; // nome del disegno associato
std::string m_sTcPos ; // posizione di attrezzaggio preferenziale
std::string m_sHead ; // testa di montaggio
int m_nExit ; // uscita di montaggio
int m_nCorr ; // numero di correttore
int m_nType ; // tipo
double m_dMaxSpeed ; // massima velocità di rotazione ammessa (giri/minuto)
double m_dMaxMat ; // massimo materiale
double m_dDiam ; // diametro
double m_dTDiam ; // diametro totale (di ingombro)
double m_dLen ; // lunghezza controllata
double m_dTLen ; // lunghezza totale (di ingombro)
double m_dThick ; // spessore per lame o altezza taglienti
double m_dCornRad ; // raggio corner
double m_dSideAng ; // angolo del fianco rispetto all'asse
double m_dSpeed ; // velocità di rotazione (+ se CCW, - se CW)
double m_dFeed ; // velocità di lavorazione normale
double m_dStartFeed ; // velocità di lavorazione iniziale
double m_dEndFeed ; // velocità di lavorazione finale
double m_dTipFeed ; // velocità di lavorazione di testa (di sfondamento se foratura)
double m_dOffsR ; // offset radiale
double m_dOffsL ; // offset longitudinale
int m_nCoolant ; // liquido di raffreddamento
double m_dMaxAbsorption ;// massimo assorbimento
double m_dMinFeed ; // minima riduzione di feed per contenere l'assorbimento
std::string m_sSysNotes ; // note interne
std::string m_sUserNotes ; // note dell'utente
ToolData( void)
: m_Uuid(), m_nExit( 0), m_nCorr(0), m_nType(0), m_dMaxSpeed(0), m_dMaxMat(0),
m_dDiam( 0), m_dTDiam( 0), m_dLen( 0), m_dTLen( 0), m_dThick( 0), m_dCornRad( 0), m_dSideAng( 0),
m_dSpeed( 0), m_dFeed(0), m_dStartFeed( 0), m_dEndFeed( 0), m_dTipFeed( 0),
m_dOffsR( 0), m_dOffsL( 0), m_nCoolant( 0), m_dMaxAbsorption( 0), m_dMinFeed( 0) {}
static int GetSize( void) ;
bool FromString( const std::string& sString, int& nKey) ;
std::string ToString( int nInd) const ;
bool VerifySpeed( double dVal) const ;
bool SetParam( int nType, bool bVal) ;
bool SetParam( int nType, int nVal) ;
bool SetParam( int nType, double dVal) ;
bool SetParam( int nType, const std::string& sVal) ;
bool GetParam( int nType, bool& bVal) const ;
bool GetParam( int nType, int& nVal) const ;
bool GetParam( int nType, double& dVal) const ;
bool GetParam( int nType, std::string& sVal) const ;
} ;
//----------------------------------------------------------------------------
inline bool
SameTool( const ToolData& Td1, const ToolData& Td2, bool bAlsoNameTcPosHeadExit = true)
{
const double EPS_TOOL_LEN = 10 * EPS_SMALL ;
const double EPS_TOOL_ANG = 10 * EPS_ANG_SMALL ;
const double EPS_SPEED = 0.5 ;
const double EPS_FEED = 0.5 ;
const double EPS_ABSORP = 0.5 ;
return ( Td1.m_Uuid == Td2.m_Uuid &&
( Td1.m_sName == Td2.m_sName || ! bAlsoNameTcPosHeadExit) &&
Td1.m_sDraw == Td2.m_sDraw &&
( Td1.m_sTcPos == Td2.m_sTcPos || ! bAlsoNameTcPosHeadExit) &&
( Td1.m_sHead == Td2.m_sHead || ! bAlsoNameTcPosHeadExit) &&
( Td1.m_nExit == Td2.m_nExit || ! bAlsoNameTcPosHeadExit) &&
Td1.m_nCorr == Td2.m_nCorr &&
Td1.m_nType == Td2.m_nType &&
abs( Td1.m_dMaxSpeed - Td2.m_dMaxSpeed) < EPS_SPEED &&
abs( Td1.m_dMaxMat - Td2.m_dMaxMat) < EPS_TOOL_LEN &&
abs( Td1.m_dDiam - Td2.m_dDiam) < EPS_TOOL_LEN &&
abs( Td1.m_dTDiam - Td2.m_dTDiam) < EPS_TOOL_LEN &&
abs( Td1.m_dLen - Td2.m_dLen) < EPS_TOOL_LEN &&
abs( Td1.m_dTLen - Td2.m_dTLen) < EPS_TOOL_LEN &&
abs( Td1.m_dThick - Td2.m_dThick) < EPS_TOOL_LEN &&
abs( Td1.m_dCornRad - Td2.m_dCornRad) < EPS_TOOL_LEN &&
abs( Td1.m_dSideAng - Td2.m_dSideAng) < EPS_TOOL_ANG &&
abs( Td1.m_dSpeed - Td2.m_dSpeed) < EPS_SPEED &&
abs( Td1.m_dFeed - Td2.m_dFeed) < EPS_FEED &&
abs( Td1.m_dStartFeed - Td2.m_dStartFeed) < EPS_FEED &&
abs( Td1.m_dEndFeed - Td2.m_dEndFeed) < EPS_FEED &&
abs( Td1.m_dTipFeed - Td2.m_dTipFeed) < EPS_FEED &&
abs( Td1.m_dOffsR - Td2.m_dOffsR) < EPS_TOOL_LEN &&
abs( Td1.m_dOffsL - Td2.m_dOffsL) < EPS_TOOL_LEN &&
Td1.m_nCoolant == Td2.m_nCoolant &&
abs( Td1.m_dMaxAbsorption - Td2.m_dMaxAbsorption) < EPS_ABSORP &&
abs( Td1.m_dMinFeed - Td2.m_dMinFeed) < EPS_FEED &&
Td1.m_sSysNotes == Td2.m_sSysNotes &&
Td1.m_sUserNotes == Td2.m_sUserNotes) ;
}