Files
EgtMachKernel/MachiningConst.h
T
Dario Sassi 44193063e1 EgtMachKernel 2.7f2 :
- aggiunto utensile di tipo Probe
- aggiunta lavorazione Probing.
2025-06-10 18:27:51 +02:00

130 lines
4.5 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",
"5AxisMilling",
"Probing"} ;
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_FIVEAXISMILLING : return MchTitle[13] ;
case MT_PROBING : return MchTitle[14] ;
}
return MchTitle[0] ;
}