EgtMachKernel :

- aggiunte lavorazioni Scalpellatura e Svuotatura.
This commit is contained in:
Dario Sassi
2017-02-04 15:31:52 +00:00
parent 880a3d856d
commit 363ada2528
10 changed files with 3612 additions and 1 deletions
+97
View File
@@ -0,0 +1,97 @@
//----------------------------------------------------------------------------
// EgalTech 2017-2017
//----------------------------------------------------------------------------
// File : Chiseling.h Data : 04.02.17 Versione : 1.8b1
// Contenuto : Dichiarazione della classe Chiseling.
//
//
//
// Modifiche : 04.02.17 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include "Machining.h"
#include "ChiselingData.h"
#include "ToolData.h"
class ICurve ;
class ICurveComposite ;
//----------------------------------------------------------------------------
class Chiseling : public Machining
{
public : // IUserObj
Chiseling* Clone( void) const override ;
const std::string& GetClassName( void) const override ;
bool Dump( std::string& sOut, bool bMM = true, const char* szNewLine = "\n") const override ;
bool ToSave( void) const override
{ return true ; }
bool Save( STRVECTOR& vString) const override ;
bool Load( const STRVECTOR& vString, int nBaseGdbId) override ;
public : // Operation
bool IsEmpty( void) const override
{ return ( m_nMills == 0) ; }
protected : // Operation
int GetSolCh( void) const override
{ return m_Params.m_nSolCh ; }
bool AdjustEndPointForAxesCalc( const CamData* pCamData, Point3d& ptP) const override ;
public : // Machining
bool Prepare( const std::string& sMillName) override ;
bool SetParam( int nType, bool bVal) override ;
bool SetParam( int nType, int nVal) override ;
bool SetParam( int nType, double dVal) override ;
bool SetParam( int nType, const std::string& sVal) override ;
bool SetGeometry( const SELVECTOR& vIds) override ;
bool Preview( bool bRecalc) override ;
bool Apply( bool bRecalc) override ;
bool GetParam( int nType, bool& bVal) const override ;
bool GetParam( int nType, int& nVal) const override ;
bool GetParam( int nType, double& dVal) const override ;
bool GetParam( int nType, std::string& sVal) const override ;
const ToolData& GetToolData( void) const ;
bool GetGeometry( SELVECTOR& vIds) const override ;
public :
Chiseling( void) ;
private :
bool UpdateToolData( void) ;
bool VerifyGeometry( SelData Id, int& nSubs, int& nType) ;
ICurve* GetCurve( SelData Id) ;
bool AdjustCurveFromSurf( ICurveComposite* pCrvCompo) ;
bool Chain( int nGrpDestId) ;
bool ProcessPath( int nPathId, int nPvId, int nClId) ;
bool CalcPathElevation( const ICurveComposite* pCompo, const Vector3d& vtTool, double dDepth, double dRad, double& dElev) ;
bool VerifyPathFromBottom( const ICurveComposite* pCompo, const Vector3d& vtTool) ;
bool GenerateMillingPv( int nPathId, const ICurveComposite* pCompo) ;
bool AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTool, const Vector3d& vtExtr,
double dDepth, double dElev, bool bSplitArcs) ;
bool AddApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dElev, double dAppr) ;
bool AddRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dElev, double dAppr) ;
double GetRadiusForStartEndElevation( void) ;
private :
double GetFeed() const
{ return ( abs( m_Params.m_dFeed) < EPS_MACH_LEN_PAR ? m_TParams.m_dFeed : m_Params.m_dFeed) ; }
double GetEndFeed() const
{ return ( abs( m_Params.m_dEndFeed) < EPS_MACH_LEN_PAR ? m_TParams.m_dEndFeed : m_Params.m_dEndFeed) ; }
double GetTipFeed() const
{ return ( abs( m_Params.m_dTipFeed) < EPS_MACH_LEN_PAR ? m_TParams.m_dTipFeed : m_Params.m_dTipFeed) ; }
double GetOffsL() const
{ return ( abs( m_Params.m_dOffsL - UNKNOWN_PAR) < EPS_MACH_LEN_PAR ? m_TParams.m_dOffsL : m_Params.m_dOffsL) ; }
double GetOffsR() const
{ return ( abs( m_Params.m_dOffsR - UNKNOWN_PAR) < EPS_MACH_LEN_PAR ? m_TParams.m_dOffsR : m_Params.m_dOffsR) ; }
private :
SELVECTOR m_vId ; // identificativi entità geometriche da lavorare
ChiselingData m_Params ; // parametri lavorazione
ToolData m_TParams ; // parametri utensile
int m_nMills ; // numero di percorsi di lavoro generati
bool m_bAggrBottom ; // flag di utilizzo dell'aggregato da sotto
} ;
+28
View File
@@ -35,6 +35,8 @@ enum nChiselingKey {
KEY_NAME,
KEY_NNS,
KEY_NNU,
KEY_OL,
KEY_OR,
KEY_PR,
KEY_PS,
KEY_SCC,
@@ -55,6 +57,8 @@ static const std::array<std::string,KEY_ZZZ> sChiselingKey = {
"NAME",
"NNS",
"NNU",
"OL",
"OR",
"PR",
"PS",
"SCC",
@@ -103,6 +107,8 @@ ChiselingData::CopyFrom( const MachiningData* pMdata)
m_dFeed = pDdata->m_dFeed ;
m_dEndFeed = pDdata->m_dEndFeed ;
m_dTipFeed = pDdata->m_dTipFeed ;
m_dOffsL = pDdata->m_dOffsL ;
m_dOffsR = pDdata->m_dOffsR ;
m_nWorkSide = pDdata->m_nWorkSide ;
m_bInvert = pDdata->m_bInvert ;
m_sDepth = pDdata->m_sDepth ;
@@ -135,6 +141,8 @@ ChiselingData::SameAs(const MachiningData* pMdata) const
abs( m_dFeed - pDdata->m_dFeed) < EPS_MACH_LEN_PAR &&
abs( m_dEndFeed - pDdata->m_dEndFeed) < EPS_MACH_LEN_PAR &&
abs( m_dTipFeed - pDdata->m_dTipFeed) < EPS_MACH_LEN_PAR &&
abs( m_dOffsL - pDdata->m_dOffsL) < EPS_MACH_LEN_PAR &&
abs( m_dOffsR - pDdata->m_dOffsR) < EPS_MACH_LEN_PAR &&
m_nWorkSide == pDdata->m_nWorkSide &&
m_bInvert == pDdata->m_bInvert &&
m_sDepth == pDdata->m_sDepth &&
@@ -212,6 +220,12 @@ ChiselingData::FromString( const string& sString, int& nKey)
case KEY_NNU :
m_sUserNotes = sVal ;
break ;
case KEY_OL :
bOk = ::FromString( sVal, m_dOffsL) ;
break ;
case KEY_OR :
bOk = ::FromString( sVal, m_dOffsR) ;
break ;
case KEY_PR :
bOk = ::FromString( sVal, m_dReturnPos) ;
break ;
@@ -257,6 +271,8 @@ ChiselingData::ToString( int nKey) const
case KEY_NAME : return ( sChiselingKey[KEY_NAME] + "=" + m_sName) ;
case KEY_NNS : return ( sChiselingKey[KEY_NNS] + "=" + m_sSysNotes) ;
case KEY_NNU : return ( sChiselingKey[KEY_NNU] + "=" + m_sUserNotes) ;
case KEY_OL : return ( sChiselingKey[KEY_OL] + "=" + ::ToString( m_dOffsL)) ;
case KEY_OR : return ( sChiselingKey[KEY_OR] + "=" + ::ToString( m_dOffsR)) ;
case KEY_PR : return ( sChiselingKey[KEY_PR] + "=" + ::ToString( m_dReturnPos)) ;
case KEY_PS : return ( sChiselingKey[KEY_PS] + "=" + ::ToString( m_dStartPos)) ;
case KEY_SCC : return ( sChiselingKey[KEY_SCC] + "=" + ::ToString( m_nSolCh)) ;
@@ -359,6 +375,12 @@ ChiselingData::SetParam( int nType, double dVal)
case MPA_TIPFEED :
m_dTipFeed = dVal ;
return true ;
case MPA_OFFSL :
m_dOffsL = dVal ;
return true ;
case MPA_OFFSR :
m_dOffsR = dVal ;
return true ;
case MPA_DEPTH :
m_sDepth = ::ToString( dVal) ;
return true ;
@@ -461,6 +483,12 @@ ChiselingData::GetParam( int nType, double& dVal) const
case MPA_TIPFEED :
dVal = m_dTipFeed ;
return true ;
case MPA_OFFSL :
dVal = m_dOffsL ;
return true ;
case MPA_OFFSR :
dVal = m_dOffsR ;
return true ;
case MPA_STARTPOS :
dVal = m_dStartPos ;
return true ;
+3 -1
View File
@@ -24,6 +24,8 @@ struct ChiselingData : public MachiningData
double m_dFeed ; // velocità di lavorazione normale ( se 0 da utensile)
double m_dEndFeed ; // velocità di lavorazione finale ( se 0 da utensile)
double m_dTipFeed ; // velocità di lavorazione di sfondamento ( se 0 da utensile)
double m_dOffsR ; // offset radiale ( se UNKNOWN_PAR da utensile)
double m_dOffsL ; // offset longitudinale ( se UNKNOWN_PAR da utensile)
bool m_bInvert ; // flag di inversione direzione lavorazione per casi passanti
int m_nWorkSide ; // lato di lavoro (destra, sinistra)
std::string m_sDepth ; // affondamento (espressione numerica)
@@ -36,7 +38,7 @@ struct ChiselingData : public MachiningData
ChiselingData( void)
: m_ToolUuid(), m_nSolCh( 0), m_dFeed( 0), m_dEndFeed( 0), m_dTipFeed( 0),
m_bInvert( false), m_nWorkSide( 2), m_dStartPos( 0),
m_dOffsR( UNKNOWN_PAR), m_dOffsL( UNKNOWN_PAR), m_bInvert( false), m_nWorkSide( 2), m_dStartPos( 0),
m_dStep( 0), m_dReturnPos( 0), m_dEndAddLen( 0) {}
ChiselingData* Clone( void) const override ;
bool CopyFrom( const MachiningData* pMdata) override ;
+1534
View File
File diff suppressed because it is too large Load Diff
+4
View File
@@ -211,6 +211,7 @@ copy $(TargetPath) \EgtProg\Dll64</Command>
<ClCompile Include="Axis.cpp" />
<ClCompile Include="CamData.cpp" />
<ClCompile Include="ChiselingData.cpp" />
<ClCompile Include="Chseling.cpp" />
<ClCompile Include="Disposition.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild>
@@ -251,6 +252,7 @@ copy $(TargetPath) \EgtProg\Dll64</Command>
<ClCompile Include="MillingData.cpp" />
<ClCompile Include="Operation.cpp" />
<ClCompile Include="OperationCL.cpp" />
<ClCompile Include="Pocketing.cpp" />
<ClCompile Include="PocketingData.cpp" />
<ClCompile Include="SawFinishing.cpp" />
<ClCompile Include="SawFinishingData.cpp" />
@@ -279,6 +281,7 @@ copy $(TargetPath) \EgtProg\Dll64</Command>
<ClInclude Include="..\Include\EMkMachMgr.h" />
<ClInclude Include="Axis.h" />
<ClInclude Include="CamData.h" />
<ClInclude Include="Chiseling.h" />
<ClInclude Include="ChiselingData.h" />
<ClInclude Include="Disposition.h" />
<ClInclude Include="DllMain.h" />
@@ -303,6 +306,7 @@ copy $(TargetPath) \EgtProg\Dll64</Command>
<ClInclude Include="MillingData.h" />
<ClInclude Include="Operation.h" />
<ClInclude Include="OutputConst.h" />
<ClInclude Include="Pocketing.h" />
<ClInclude Include="PocketingData.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="SawFinishing.h" />
+12
View File
@@ -195,6 +195,12 @@
<ClCompile Include="PocketingData.cpp">
<Filter>Source Files\Machinings</Filter>
</ClCompile>
<ClCompile Include="Chseling.cpp">
<Filter>Source Files\Operations</Filter>
</ClCompile>
<ClCompile Include="Pocketing.cpp">
<Filter>Source Files\Operations</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="DllMain.h">
@@ -338,6 +344,12 @@
<ClInclude Include="PocketingData.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Chiseling.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Pocketing.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="EgtMachKernel.rc">
+6
View File
@@ -171,12 +171,18 @@ MachMgr::GetOperationType( int nId) const
return OPER_SAWING ;
else if ( sUserObj == USEROBJ_GETNAME( Milling))
return OPER_MILLING ;
else if ( sUserObj == USEROBJ_GETNAME( Pocketing))
return OPER_POCKETING ;
//else if ( sUserObj == USEROBJ_GETNAME( Mortising))
// return OPER_MORTISING ;
else if ( sUserObj == USEROBJ_GETNAME( SawRoughing))
return OPER_SAWROUGHING ;
else if ( sUserObj == USEROBJ_GETNAME( SawFinishing))
return OPER_SAWFINISHING ;
else if ( sUserObj == USEROBJ_GETNAME( GenMachining))
return OPER_GENMACHINING ;
else if ( sUserObj == USEROBJ_GETNAME( Chiseling))
return OPER_CHISELING ;
else
return OPER_NULL ;
}
+5
View File
@@ -16,9 +16,11 @@
#include "Drilling.h"
#include "Sawing.h"
#include "Milling.h"
#include "Pocketing.h"
#include "SawRoughing.h"
#include "SawFinishing.h"
#include "GenMachining.h"
#include "Chiseling.h"
//----------------------------------------------------------------------------
// Dal tipo numerico crea una istanza della classe
@@ -29,9 +31,12 @@ CreateMachining( int nMchType)
case MT_DRILLING : return new( std::nothrow) Drilling ;
case MT_SAWING : return new( std::nothrow) Sawing ;
case MT_MILLING : return new( std::nothrow) Milling ;
case MT_POCKETING : return new( std::nothrow) Pocketing ;
// case MT_MORTISING : return new( std::nothrow) Mortising ;
case MT_SAWROUGHING : return new( std::nothrow) SawRoughing ;
case MT_SAWFINISHING : return new( std::nothrow) SawFinishing ;
case MT_GENMACHINING : return new( std::nothrow) GenMachining ;
case MT_CHISELING : return new( std::nothrow) Chiseling ;
}
return nullptr ;
}
+1816
View File
File diff suppressed because it is too large Load Diff
+107
View File
@@ -0,0 +1,107 @@
//----------------------------------------------------------------------------
// EgalTech 2017-2017
//----------------------------------------------------------------------------
// File :Pocketing.h Data : 04.02.17 Versione : 1.8b1
// Contenuto : Dichiarazione della classe Pocketing.
//
//
//
// Modifiche : 04.02.17 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include "Machining.h"
#include "PocketingData.h"
#include "ToolData.h"
class ICurve ;
class ICurveComposite ;
//----------------------------------------------------------------------------
class Pocketing : public Machining
{
public : // IUserObj
Pocketing* Clone( void) const override ;
const std::string& GetClassName( void) const override ;
bool Dump( std::string& sOut, bool bMM = true, const char* szNewLine = "\n") const override ;
bool ToSave( void) const override
{ return true ; }
bool Save( STRVECTOR& vString) const override ;
bool Load( const STRVECTOR& vString, int nBaseGdbId) override ;
public : // Operation
bool IsEmpty( void) const override
{ return ( m_nMills == 0) ; }
protected : // Operation
int GetSolCh( void) const override
{ return m_Params.m_nSolCh ; }
bool AdjustEndPointForAxesCalc( const CamData* pCamData, Point3d& ptP) const override ;
public : // Machining
bool Prepare( const std::string& sMillName) override ;
bool SetParam( int nType, bool bVal) override ;
bool SetParam( int nType, int nVal) override ;
bool SetParam( int nType, double dVal) override ;
bool SetParam( int nType, const std::string& sVal) override ;
bool SetGeometry( const SELVECTOR& vIds) override ;
bool Preview( bool bRecalc) override ;
bool Apply( bool bRecalc) override ;
bool GetParam( int nType, bool& bVal) const override ;
bool GetParam( int nType, int& nVal) const override ;
bool GetParam( int nType, double& dVal) const override ;
bool GetParam( int nType, std::string& sVal) const override ;
const ToolData& GetToolData( void) const ;
bool GetGeometry( SELVECTOR& vIds) const override ;
public :
Pocketing( void) ;
private :
bool UpdateToolData( void) ;
bool VerifyGeometry( SelData Id, int& nSubs, int& nType) ;
ICurve* GetCurve( SelData Id) ;
bool AdjustCurveFromSurf( ICurveComposite* pCrvCompo) ;
bool Chain( int nGrpDestId) ;
bool ProcessPath( int nPathId, int nPvId, int nClId) ;
bool CalcPathElevation( const ICurveComposite* pCompo, const Vector3d& vtTool, double dDepth, double dRad, double& dElev) ;
bool VerifyPathFromBottom( const ICurveComposite* pCompo, const Vector3d& vtTool) ;
bool GenerateMillingPv( int nPathId, const ICurveComposite* pCompo) ;
bool AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTool, const Vector3d& vtExtr,
double dDepth, double dElev, bool bSplitArcs) ;
bool AddApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dElev, double dAppr) ;
bool AddRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dElev, double dAppr) ;
bool CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtStart, const Vector3d& vtN, bool bInvert,
Point3d& ptP1) ;
bool AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d& vtStart,
const Vector3d& vtN, bool bInvert, bool bSplitArcs) ;
bool AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d& vtN,
bool bInvert, bool bSplitArcs, Point3d& ptP1) ;
double GetRadiusForStartEndElevation( void) ;
private :
double GetSpeed() const
{ return ( abs( m_Params.m_dSpeed) < EPS_MACH_ANG_PAR ? m_TParams.m_dSpeed : m_Params.m_dSpeed) ; }
double GetFeed() const
{ return ( abs( m_Params.m_dFeed) < EPS_MACH_LEN_PAR ? m_TParams.m_dFeed : m_Params.m_dFeed) ; }
double GetStartFeed() const
{ return ( abs( m_Params.m_dStartFeed) < EPS_MACH_LEN_PAR ? m_TParams.m_dStartFeed : m_Params.m_dStartFeed) ; }
double GetEndFeed() const
{ return ( abs( m_Params.m_dEndFeed) < EPS_MACH_LEN_PAR ? m_TParams.m_dEndFeed : m_Params.m_dEndFeed) ; }
double GetTipFeed() const
{ return ( abs( m_Params.m_dTipFeed) < EPS_MACH_LEN_PAR ? m_TParams.m_dTipFeed : m_Params.m_dTipFeed) ; }
double GetOffsL() const
{ return ( abs( m_Params.m_dOffsL - UNKNOWN_PAR) < EPS_MACH_LEN_PAR ? m_TParams.m_dOffsL : m_Params.m_dOffsL) ; }
double GetOffsR() const
{ return ( abs( m_Params.m_dOffsR - UNKNOWN_PAR) < EPS_MACH_LEN_PAR ? m_TParams.m_dOffsR : m_Params.m_dOffsR) ; }
private :
SELVECTOR m_vId ; // identificativi entità geometriche da lavorare
PocketingData m_Params ; // parametri lavorazione
ToolData m_TParams ; // parametri utensile
int m_nMills ; // numero di percorsi di lavoro generati
bool m_bAggrBottom ; // flag di utilizzo dell'aggregato da sotto
} ;