Files
EgtMachKernel/MachiningConst.h
Dario Sassi f92cec9d3d EgtMachKernel 2.5i1 :
- aggiunta visualizzazione geometria di lavorazione in doppio per Drill, Pocketing e Milling
- a OnSetHead passata anche variabile globale EMC.USERNOTES con note utente dell'utensile
- in Simulazione corretto richiamo impostazione virtual milling su utensili con raggio maggiore del massimo gambo ammesso dal portautensile.
2023-09-11 10:47:42 +02:00

129 lines
4.4 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2015-2015
//----------------------------------------------------------------------------
// File : MachiningConst.h Data : 18.06.15 Versione : 1.6f3
// Contenuto : Costanti delle lavorazioni.
//
//
//
// Modifiche : 18.06.15 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include "/EgtDev/Include/EMkMachiningConst.h"
#include "/EgtDev/Include/EMkMachiningGeoConst.h"
#include "/EgtDev/Include/EMkToolConst.h"
#include "/EgtDev/Include/EGkGeoConst.h"
//----------------------------------------------------------------------------
// Epsilon per parametri lavorazioni
const double EPS_MACH_LEN_PAR = 10 * EPS_SMALL ;
const double EPS_MACH_ANG_PAR = 10 * EPS_ANG_SMALL ;
// Valore parametro lavorazione non inizializzato
const double UNKNOWN_PAR = 9999999 ;
//----------------------------------------------------------------------------
// Costanti per stato lavorazione
enum Mch_Status { MCH_ST_OK = 0,
MCH_ST_NO_POSTAPPL = 1,
MCH_ST_TO_VERIFY = 2,
MCH_ST_GEO_MODIF = 4,
MCH_ST_PARAM_MODIF = 8,
MCH_ST_OTH_MODIF = 16} ;
//----------------------------------------------------------------------------
inline bool
AreSameLenValue( double dLen1, double dLen2)
{
return abs( dLen1 - dLen2) < EPS_MACH_LEN_PAR ;
}
//----------------------------------------------------------------------------
inline bool
AreSameAngValue( double dAng1, double dAng2)
{
return abs( dAng1 - dAng2) < EPS_MACH_ANG_PAR ;
}
//----------------------------------------------------------------------------
inline bool
IsNullLenValue( double dLen)
{
return abs( dLen) < EPS_MACH_LEN_PAR ;
}
//----------------------------------------------------------------------------
inline bool
IsNullAngValue( double dAng)
{
return abs( dAng) < EPS_MACH_ANG_PAR ;
}
//----------------------------------------------------------------------------
inline bool
IsUnknownValue( double dVal)
{
return abs( dVal - UNKNOWN_PAR) < EPS_MACH_LEN_PAR ;
}
//----------------------------------------------------------------------------
// Conversione dei parametri lavorazione negli equivalenti utensile, ove esistano
inline int
MPA2TPA( int nType)
{
switch ( nType) {
case MPA_SPEED : return TPA_SPEED ;
case MPA_FEED : return TPA_FEED ;
case MPA_STARTFEED : return TPA_STARTFEED ;
case MPA_ENDFEED : return TPA_ENDFEED ;
case MPA_TIPFEED : return TPA_TIPFEED ;
case MPA_VERTFEED : return TPA_FEED ;
case MPA_BACKFEED : return TPA_FEED ;
case MPA_SIDEANGFEED : return TPA_FEED ;
case MPA_OFFSR : return TPA_RADOFFSET ;
case MPA_OFFSL : return TPA_LONOFFSET ;
}
return TPA_NONE ;
}
//----------------------------------------------------------------------------
// Dal tipo numerico restituisce il nome della lavorazione
inline const std::string&
GetMachiningTitle( int nMchType)
{
static std::string MchTitle[] = {"Unknown",
"Drilling",
"Sawing",
"Milling",
"Pocketing",
"Mortising",
"SawRoughing",
"SawFinishing",
"GenMachining",
"Chiseling",
"SurfRoughing",
"SurfFinishing",
"Waterjetting",
"5axMachining"} ;
switch ( nMchType) {
case MT_DRILLING : return MchTitle[1] ;
case MT_SAWING : return MchTitle[2] ;
case MT_MILLING : return MchTitle[3] ;
case MT_POCKETING : return MchTitle[4] ;
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] ;
case MT_SURFROUGHING : return MchTitle[10] ;
case MT_SURFFINISHING : return MchTitle[11] ;
case MT_WATERJETTING : return MchTitle[12] ;
case MT_5AXMACHINING : return MchTitle[13] ;
}
return MchTitle[0] ;
}