EgtMachKernel 1.6x7 :
- aggiunta lavorazione generica (versione preliminare).
This commit is contained in:
Binary file not shown.
@@ -221,6 +221,8 @@ copy $(TargetPath) \EgtProg\Dll64</Command>
|
||||
<ClCompile Include="EMkDllMain.cpp" />
|
||||
<ClCompile Include="Exit.cpp" />
|
||||
<ClCompile Include="Generator.cpp" />
|
||||
<ClCompile Include="GenMachining.cpp" />
|
||||
<ClCompile Include="GenMachiningData.cpp" />
|
||||
<ClCompile Include="GeoCalc.cpp" />
|
||||
<ClCompile Include="Machine.cpp" />
|
||||
<ClCompile Include="MachineAxes.cpp" />
|
||||
@@ -280,6 +282,8 @@ copy $(TargetPath) \EgtProg\Dll64</Command>
|
||||
<ClInclude Include="DrillingData.h" />
|
||||
<ClInclude Include="Exit.h" />
|
||||
<ClInclude Include="Generator.h" />
|
||||
<ClInclude Include="GenMachining.h" />
|
||||
<ClInclude Include="GenMachiningData.h" />
|
||||
<ClInclude Include="GeoCalc.h" />
|
||||
<ClInclude Include="MachConst.h" />
|
||||
<ClInclude Include="Machine.h" />
|
||||
|
||||
@@ -180,6 +180,12 @@
|
||||
<ClCompile Include="MachMgrSetup.cpp">
|
||||
<Filter>Source Files\MachMgr</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GenMachiningData.cpp">
|
||||
<Filter>Source Files\Machinings</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GenMachining.cpp">
|
||||
<Filter>Source Files\Operations</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="DllMain.h">
|
||||
@@ -308,6 +314,12 @@
|
||||
<ClInclude Include="SetTempPhase.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GenMachiningData.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GenMachining.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="EgtMachKernel.rc">
|
||||
|
||||
+1416
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,99 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2017-2017
|
||||
//----------------------------------------------------------------------------
|
||||
// File :GenMachining.h Data : 15.01.17 Versione : 1.6x7
|
||||
// Contenuto : Dichiarazione della classe GenMachining.
|
||||
//
|
||||
//
|
||||
//
|
||||
// Modifiche : 15.01.17 DS Creazione modulo.
|
||||
//
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Machining.h"
|
||||
#include "GenMachiningData.h"
|
||||
#include "ToolData.h"
|
||||
|
||||
class ICurve ;
|
||||
class ICurveComposite ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
class GenMachining : public Machining
|
||||
{
|
||||
public : // IUserObj
|
||||
GenMachining* 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 :
|
||||
GenMachining( 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 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 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
|
||||
GenMachiningData m_Params ; // parametri lavorazione
|
||||
ToolData m_TParams ; // parametri utensile
|
||||
int m_nMills ; // numero di percorsi di lavoro generati
|
||||
} ;
|
||||
@@ -0,0 +1,502 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2017-2017
|
||||
//----------------------------------------------------------------------------
|
||||
// File : GenMachiningData.cpp Data : 15.01.17 Versione : 1.6x7
|
||||
// Contenuto : Implementazione struttura dati lavorazione generica.
|
||||
//
|
||||
//
|
||||
//
|
||||
// Modifiche : 15.01.17 DS Creazione modulo.
|
||||
//
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
//--------------------------- Include ----------------------------------------
|
||||
#include "stdafx.h"
|
||||
#include "GenMachiningData.h"
|
||||
#include "MachiningDataFactory.h"
|
||||
#include "MachiningConst.h"
|
||||
#include "/EgtDev/Include/EmkToolConst.h"
|
||||
#include "/EgtDev/Include/EmkSimuGenConst.h"
|
||||
#include "/EgtDev/Include/EGnStringUtils.h"
|
||||
#include <array>
|
||||
#include <cassert>
|
||||
|
||||
using namespace std ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
enum nGenMachiningKey {
|
||||
KEY_DH = 0,
|
||||
KEY_F,
|
||||
KEY_FE,
|
||||
KEY_FS,
|
||||
KEY_FT,
|
||||
KEY_INV,
|
||||
KEY_NAME,
|
||||
KEY_NNS,
|
||||
KEY_NNU,
|
||||
KEY_OL,
|
||||
KEY_OR,
|
||||
KEY_PS,
|
||||
KEY_S,
|
||||
KEY_SCC,
|
||||
KEY_TNAME,
|
||||
KEY_TUUID,
|
||||
KEY_UUID,
|
||||
KEY_ZZZ} ; // rappresenta il numero di elementi
|
||||
|
||||
static const std::array<std::string,KEY_ZZZ> sGenMachiningKey = {
|
||||
"DH",
|
||||
"F",
|
||||
"FE",
|
||||
"FS",
|
||||
"FT",
|
||||
"INV",
|
||||
"NAME",
|
||||
"NNS",
|
||||
"NNU",
|
||||
"OL",
|
||||
"OR",
|
||||
"PS",
|
||||
"S",
|
||||
"SCC",
|
||||
"TN",
|
||||
"TU",
|
||||
"UUID"} ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
MCHDATA_REGISTER( MT_GENMACHINING, "GENMACHINING", GenMachiningData) ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
GenMachiningData*
|
||||
GenMachiningData::Clone( void) const
|
||||
{
|
||||
// alloco oggetto
|
||||
GenMachiningData* pDdata = new(nothrow) GenMachiningData ;
|
||||
// copio i dati
|
||||
if ( pDdata != nullptr) {
|
||||
if ( ! pDdata->CopyFrom( this)) {
|
||||
delete pDdata ;
|
||||
return nullptr ;
|
||||
}
|
||||
}
|
||||
return pDdata ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GenMachiningData::CopyFrom( const MachiningData* pMdata)
|
||||
{
|
||||
// è inutile copiare se sorgente coincide con destinazione
|
||||
if ( pMdata == this)
|
||||
return true ;
|
||||
// la sorgente deve essere dello stesso tipo
|
||||
const GenMachiningData* pGdata = GetGenMachiningData( pMdata) ;
|
||||
if ( pGdata == nullptr)
|
||||
return false ;
|
||||
// eseguo copia
|
||||
m_Uuid = pGdata->m_Uuid ;
|
||||
m_sName = pGdata->m_sName ;
|
||||
m_nSolCh = pGdata->m_nSolCh ;
|
||||
m_ToolUuid = pGdata->m_ToolUuid ;
|
||||
m_sToolName = pGdata->m_sToolName ;
|
||||
m_dSpeed = pGdata->m_dSpeed ;
|
||||
m_dFeed = pGdata->m_dFeed ;
|
||||
m_dEndFeed = pGdata->m_dEndFeed ;
|
||||
m_dStartFeed = pGdata->m_dStartFeed ;
|
||||
m_dTipFeed = pGdata->m_dTipFeed ;
|
||||
m_dOffsL = pGdata->m_dOffsL ;
|
||||
m_dOffsR = pGdata->m_dOffsR ;
|
||||
m_bInvert = pGdata->m_bInvert ;
|
||||
m_sDepth = pGdata->m_sDepth ;
|
||||
m_dStartPos = pGdata->m_dStartPos ;
|
||||
m_sSysNotes = pGdata->m_sSysNotes ;
|
||||
m_sUserNotes = pGdata->m_sUserNotes ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GenMachiningData::SameAs(const MachiningData* pMdata) const
|
||||
{
|
||||
// se coincide con altro -> uguali
|
||||
if ( pMdata == this)
|
||||
return true ;
|
||||
// se sono di tipo diverso -> diversi
|
||||
const GenMachiningData* pGdata = GetGenMachiningData( pMdata) ;
|
||||
if ( pGdata == nullptr)
|
||||
return false ;
|
||||
// confronto termine a termine
|
||||
return ( m_Uuid == pGdata->m_Uuid &&
|
||||
m_sName == pGdata->m_sName &&
|
||||
m_ToolUuid == pGdata->m_ToolUuid &&
|
||||
m_sToolName == pGdata->m_sToolName &&
|
||||
m_nSolCh == pGdata->m_nSolCh &&
|
||||
abs( m_dSpeed - pGdata->m_dSpeed) < EPS_MACH_ANG_PAR &&
|
||||
abs( m_dFeed - pGdata->m_dFeed) < EPS_MACH_LEN_PAR &&
|
||||
abs( m_dEndFeed - pGdata->m_dEndFeed) < EPS_MACH_LEN_PAR &&
|
||||
abs( m_dStartFeed - pGdata->m_dStartFeed) < EPS_MACH_LEN_PAR &&
|
||||
abs( m_dTipFeed - pGdata->m_dTipFeed) < EPS_MACH_LEN_PAR &&
|
||||
abs( m_dOffsL - pGdata->m_dOffsL) < EPS_MACH_LEN_PAR &&
|
||||
abs( m_dOffsR - pGdata->m_dOffsR) < EPS_MACH_LEN_PAR &&
|
||||
m_bInvert == pGdata->m_bInvert &&
|
||||
m_sDepth == pGdata->m_sDepth &&
|
||||
abs( m_dStartPos - pGdata->m_dStartPos) < EPS_MACH_LEN_PAR &&
|
||||
m_sSysNotes == pGdata->m_sSysNotes &&
|
||||
m_sUserNotes == pGdata->m_sUserNotes) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
int
|
||||
GenMachiningData::GetSize( void) const
|
||||
{
|
||||
// in debug verifico validità ultimo campo
|
||||
assert( sGenMachiningKey[KEY_UUID] == "UUID") ;
|
||||
return KEY_ZZZ ;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
string
|
||||
GenMachiningData::GetTitle( void) const
|
||||
{
|
||||
return MCHDATA_GETNAME( GenMachiningData) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
int
|
||||
FindGenMachiningKey( const string& sKey)
|
||||
{
|
||||
auto TheRange = equal_range( sGenMachiningKey.cbegin(), sGenMachiningKey.cend(), sKey) ;
|
||||
if ( TheRange.first == TheRange.second)
|
||||
return - 1 ;
|
||||
return int( TheRange.first - sGenMachiningKey.cbegin()) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GenMachiningData::FromString( const string& sString, int& nKey)
|
||||
{
|
||||
// separo chiave da valore
|
||||
string sKey, sVal ;
|
||||
SplitFirst( sString, "=", sKey, sVal) ;
|
||||
// riconosco la chiave
|
||||
nKey = FindGenMachiningKey( ToUpper( sKey)) ;
|
||||
bool bOk = ( nKey >= 0) ;
|
||||
switch ( nKey) {
|
||||
case KEY_DH :
|
||||
m_sDepth = sVal ;
|
||||
if ( m_sDepth.empty())
|
||||
m_sDepth = "0" ;
|
||||
break ;
|
||||
case KEY_F :
|
||||
bOk = ::FromString( sVal, m_dFeed) ;
|
||||
break ;
|
||||
case KEY_FE :
|
||||
bOk = ::FromString( sVal, m_dEndFeed) ;
|
||||
break ;
|
||||
case KEY_FS :
|
||||
bOk = ::FromString( sVal, m_dStartFeed) ;
|
||||
break ;
|
||||
case KEY_FT :
|
||||
bOk = ::FromString( sVal, m_dTipFeed) ;
|
||||
break ;
|
||||
case KEY_INV :
|
||||
bOk = ::FromString( sVal, m_bInvert) ;
|
||||
break ;
|
||||
case KEY_NAME :
|
||||
m_sName = sVal ;
|
||||
bOk = ! m_sName.empty() ;
|
||||
break ;
|
||||
case KEY_NNS :
|
||||
m_sSysNotes = sVal ;
|
||||
break ;
|
||||
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_PS :
|
||||
bOk = ::FromString( sVal, m_dStartPos) ;
|
||||
break ;
|
||||
case KEY_S :
|
||||
bOk = ::FromString( sVal, m_dSpeed) ;
|
||||
break ;
|
||||
case KEY_SCC :
|
||||
bOk = ::FromString( sVal, m_nSolCh) ;
|
||||
break ;
|
||||
case KEY_TNAME :
|
||||
m_sToolName = sVal ;
|
||||
break ;
|
||||
case KEY_TUUID :
|
||||
bOk = ::FromString( sVal, m_ToolUuid) ;
|
||||
break ;
|
||||
case KEY_UUID :
|
||||
bOk = ::FromString( sVal, m_Uuid) ;
|
||||
break ;
|
||||
default :
|
||||
bOk = false ;
|
||||
break ;
|
||||
}
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
string
|
||||
GenMachiningData::ToString( int nKey) const
|
||||
{
|
||||
switch ( nKey) {
|
||||
case KEY_DH : return ( sGenMachiningKey[KEY_DH] + "=" + m_sDepth) ;
|
||||
case KEY_F : return ( sGenMachiningKey[KEY_F] + "=" + ::ToString( m_dFeed)) ;
|
||||
case KEY_FE : return ( sGenMachiningKey[KEY_FE] + "=" + ::ToString( m_dEndFeed)) ;
|
||||
case KEY_FS : return ( sGenMachiningKey[KEY_FS] + "=" + ::ToString( m_dStartFeed)) ;
|
||||
case KEY_FT : return ( sGenMachiningKey[KEY_FT] + "=" + ::ToString( m_dTipFeed)) ;
|
||||
case KEY_INV : return ( sGenMachiningKey[KEY_INV] + "=" + ::ToString( m_bInvert)) ;
|
||||
case KEY_NAME : return ( sGenMachiningKey[KEY_NAME] + "=" + m_sName) ;
|
||||
case KEY_NNS : return ( sGenMachiningKey[KEY_NNS] + "=" + m_sSysNotes) ;
|
||||
case KEY_NNU : return ( sGenMachiningKey[KEY_NNU] + "=" + m_sUserNotes) ;
|
||||
case KEY_OL : return ( sGenMachiningKey[KEY_OL] + "=" + ::ToString( m_dOffsL)) ;
|
||||
case KEY_OR : return ( sGenMachiningKey[KEY_OR] + "=" + ::ToString( m_dOffsR)) ;
|
||||
case KEY_PS : return ( sGenMachiningKey[KEY_PS] + "=" + ::ToString( m_dStartPos)) ;
|
||||
case KEY_S : return ( sGenMachiningKey[KEY_S] + "=" + ::ToString( m_dSpeed)) ;
|
||||
case KEY_SCC : return ( sGenMachiningKey[KEY_SCC] + "=" + ::ToString( m_nSolCh)) ;
|
||||
case KEY_TNAME : return ( sGenMachiningKey[KEY_TNAME] + "=" + m_sToolName) ;
|
||||
case KEY_TUUID : return ( sGenMachiningKey[KEY_TUUID] + "=" + ::ToString( m_ToolUuid)) ;
|
||||
case KEY_UUID : return ( sGenMachiningKey[KEY_UUID] + "=" + ::ToString( m_Uuid)) ;
|
||||
default : return "" ;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GenMachiningData::IsOptional( int nKey) const
|
||||
{
|
||||
return false ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GenMachiningData::VerifySolCh( int nVal) const
|
||||
{
|
||||
return IsValidOperationScc( nVal) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GenMachiningData::VerifyTool( const ToolsMgr* pToolsMgr, const std::string& sVal, const ToolData*& pTdata) const
|
||||
{
|
||||
if ( pToolsMgr == nullptr)
|
||||
return false ;
|
||||
pTdata = pToolsMgr->GetTool( sVal) ;
|
||||
if ( pTdata == nullptr)
|
||||
return false ;
|
||||
if ( ( pTdata->m_nType & TF_MILL) == 0 && ( pTdata->m_nType & TF_DRILLBIT) == 0 &&
|
||||
( pTdata->m_nType & TF_SAWBLADE) == 0)
|
||||
return false ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GenMachiningData::GetTool( const ToolsMgr* pToolsMgr, const ToolData*& pTdata) const
|
||||
{
|
||||
if ( pToolsMgr == nullptr)
|
||||
return false ;
|
||||
pTdata = pToolsMgr->GetTool( m_ToolUuid) ;
|
||||
return ( pTdata != nullptr) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GenMachiningData::SetParam( int nType, bool bVal)
|
||||
{
|
||||
switch ( nType) {
|
||||
case MPA_INVERT :
|
||||
m_bInvert = bVal ;
|
||||
return true ;
|
||||
}
|
||||
return false ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GenMachiningData::SetParam( int nType, int nVal)
|
||||
{
|
||||
switch ( nType) {
|
||||
case MPA_SCC :
|
||||
if ( ! VerifySolCh( nVal))
|
||||
return false ;
|
||||
m_nSolCh = nVal ;
|
||||
return true ;
|
||||
}
|
||||
return false ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GenMachiningData::SetParam( int nType, double dVal)
|
||||
{
|
||||
switch ( nType) {
|
||||
case MPA_SPEED :
|
||||
m_dSpeed = dVal ;
|
||||
return true ;
|
||||
case MPA_FEED :
|
||||
m_dFeed = dVal ;
|
||||
return true ;
|
||||
case MPA_STARTFEED :
|
||||
m_dStartFeed = dVal ;
|
||||
return true ;
|
||||
case MPA_ENDFEED :
|
||||
m_dEndFeed = dVal ;
|
||||
return true ;
|
||||
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 ;
|
||||
case MPA_STARTPOS :
|
||||
m_dStartPos = dVal ;
|
||||
return true ;
|
||||
}
|
||||
return false ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GenMachiningData::SetParam( int nType, const string& sVal)
|
||||
{
|
||||
switch ( nType) {
|
||||
case MPA_NAME :
|
||||
m_sName = sVal ;
|
||||
return true ;
|
||||
case MPA_TOOL :
|
||||
m_sToolName = sVal ;
|
||||
return true ;
|
||||
case MPA_DEPTH_STR :
|
||||
m_sDepth = sVal ;
|
||||
return true ;
|
||||
case MPA_TUUID :
|
||||
return ::FromString( sVal, m_ToolUuid) ;
|
||||
case MPA_UUID :
|
||||
return ::FromString( sVal, m_Uuid) ;
|
||||
case MPA_SYSNOTES :
|
||||
m_sSysNotes = sVal ;
|
||||
return true ;
|
||||
case MPA_USERNOTES :
|
||||
m_sUserNotes = sVal ;
|
||||
return true ;
|
||||
}
|
||||
return false ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GenMachiningData::ResetTool( void)
|
||||
{
|
||||
m_sToolName.clear() ;
|
||||
m_ToolUuid.Clear() ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GenMachiningData::GetParam( int nType, bool& bVal) const
|
||||
{
|
||||
switch ( nType) {
|
||||
case MPA_INVERT :
|
||||
bVal = m_bInvert ;
|
||||
return true ;
|
||||
}
|
||||
bVal = false ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GenMachiningData::GetParam( int nType, int& nVal) const
|
||||
{
|
||||
switch ( nType) {
|
||||
case MPA_TYPE :
|
||||
nVal = MT_GENMACHINING ;
|
||||
return true ;
|
||||
case MPA_SCC :
|
||||
nVal = m_nSolCh ;
|
||||
return true ;
|
||||
}
|
||||
nVal = 0 ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GenMachiningData::GetParam( int nType, double& dVal) const
|
||||
{
|
||||
switch ( nType) {
|
||||
case MPA_SPEED :
|
||||
dVal = m_dSpeed ;
|
||||
return true ;
|
||||
case MPA_FEED :
|
||||
dVal = m_dFeed ;
|
||||
return true ;
|
||||
case MPA_STARTFEED :
|
||||
dVal = m_dStartFeed ;
|
||||
return true ;
|
||||
case MPA_ENDFEED :
|
||||
dVal = m_dEndFeed ;
|
||||
return true ;
|
||||
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 ;
|
||||
}
|
||||
dVal = 0 ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GenMachiningData::GetParam( int nType, string& sVal) const
|
||||
{
|
||||
switch ( nType) {
|
||||
case MPA_NAME :
|
||||
sVal = m_sName ;
|
||||
return true ;
|
||||
case MPA_TOOL :
|
||||
sVal = m_sToolName ;
|
||||
return true ;
|
||||
case MPA_DEPTH_STR :
|
||||
sVal = m_sDepth ;
|
||||
return true ;
|
||||
case MPA_TUUID :
|
||||
sVal = ::ToString( m_ToolUuid) ;
|
||||
return true ;
|
||||
case MPA_UUID :
|
||||
sVal = ::ToString( m_Uuid) ;
|
||||
return true ;
|
||||
case MPA_SYSNOTES :
|
||||
sVal = m_sSysNotes ;
|
||||
return true ;
|
||||
case MPA_USERNOTES :
|
||||
sVal = m_sUserNotes ;
|
||||
return true ;
|
||||
}
|
||||
sVal = "" ;
|
||||
return false ;
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2017-2017
|
||||
//----------------------------------------------------------------------------
|
||||
// File : GenMachiningData.h Data : 15.01.17 Versione : 1.6x7
|
||||
// Contenuto : Dichiarazione della struct GenMachiningData e costanti associate.
|
||||
//
|
||||
//
|
||||
//
|
||||
// Modifiche : 15.01.17 DS Creazione modulo.
|
||||
//
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "MachiningData.h"
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
struct GenMachiningData : public MachiningData
|
||||
{
|
||||
EgtUUID m_ToolUuid ; // identificativo universale dell'utensile
|
||||
std::string m_sToolName ; // nome dell'utensile
|
||||
int m_nSolCh ; // criterio scelta soluzione (quando possibili molteplici)
|
||||
double m_dSpeed ; // velocità di rotazione (+ se CCW, - se CW) ( se 0 da utensile)
|
||||
double m_dFeed ; // velocità di lavorazione normale ( se 0 da utensile)
|
||||
double m_dStartFeed ; // velocità di lavorazione iniziale ( 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 fori aperti
|
||||
std::string m_sDepth ; // affondamento (espressione numerica)
|
||||
double m_dStartPos ; // quota di inizio lavorazione (sempre >= 0)
|
||||
std::string m_sSysNotes ; // note interne
|
||||
std::string m_sUserNotes ; // note dell'utente
|
||||
|
||||
GenMachiningData( void)
|
||||
: m_ToolUuid(), m_nSolCh( 0), m_dSpeed( 0), m_dFeed( 0), m_dStartFeed( 0), m_dEndFeed( 0), m_dTipFeed( 0),
|
||||
m_dOffsR( 0), m_dOffsL( 0), m_bInvert( false), m_dStartPos( 0) {}
|
||||
GenMachiningData* Clone( void) const override ;
|
||||
bool CopyFrom( const MachiningData* pMdata) override ;
|
||||
bool SameAs(const MachiningData* pMdata) const override ;
|
||||
int GetType( void) const override
|
||||
{ return MT_GENMACHINING ; }
|
||||
int GetSize( void) const override ;
|
||||
std::string GetTitle( void) const override ;
|
||||
bool FromString( const std::string& sString, int& nKey) override ;
|
||||
std::string ToString( int nKey) const override ;
|
||||
bool IsOptional( int nKey) const 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 ResetTool( void) 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 ;
|
||||
bool GetTool( const ToolsMgr* pToolsMgr, const ToolData*& pTdata) const override ;
|
||||
bool VerifyTool( const ToolsMgr* pToolsMgr, const std::string& sVal, const ToolData*& pTdata) const override ;
|
||||
bool VerifySolCh( int nVal) const ;
|
||||
} ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
inline const GenMachiningData* GetGenMachiningData( const MachiningData* pMdata)
|
||||
{ return (dynamic_cast<const GenMachiningData*>( pMdata)) ; }
|
||||
inline GenMachiningData* GetGenMachiningData( MachiningData* pMdata)
|
||||
{ return (dynamic_cast<GenMachiningData*>( pMdata)) ; }
|
||||
@@ -175,6 +175,8 @@ MachMgr::GetOperationType( int nId) const
|
||||
return OPER_SAWROUGHING ;
|
||||
else if ( sUserObj == USEROBJ_GETNAME( SawFinishing))
|
||||
return OPER_SAWFINISHING ;
|
||||
else if ( sUserObj == USEROBJ_GETNAME( GenMachining))
|
||||
return OPER_GENMACHINING ;
|
||||
else
|
||||
return OPER_NULL ;
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "Milling.h"
|
||||
#include "SawRoughing.h"
|
||||
#include "SawFinishing.h"
|
||||
#include "GenMachining.h"
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Dal tipo numerico crea una istanza della classe
|
||||
@@ -30,6 +31,7 @@ CreateMachining( int nMchType)
|
||||
case MT_MILLING : return new( std::nothrow) Milling ;
|
||||
case MT_SAWROUGHING : return new( std::nothrow) SawRoughing ;
|
||||
case MT_SAWFINISHING : return new( std::nothrow) SawFinishing ;
|
||||
case MT_GENMACHINING : return new( std::nothrow) GenMachining ;
|
||||
}
|
||||
return nullptr ;
|
||||
}
|
||||
|
||||
+12
-12
@@ -1,13 +1,13 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2015-2016
|
||||
// EgalTech 2015-2017
|
||||
//----------------------------------------------------------------------------
|
||||
// File : MachiningsMgr.cpp Data : 13.07.16 Versione : 1.6r8
|
||||
// File : MachiningsMgr.cpp Data : 15.01.17 Versione : 1.6x7
|
||||
// Contenuto : Implementazione gestore database lavorazioni.
|
||||
//
|
||||
//
|
||||
//
|
||||
// Modifiche : 02.06.15 DS Creazione modulo.
|
||||
// 13.07.16 DS Aggiunta gestione SplitArcs (MF_CURR_VER = 1005).
|
||||
// 13.07.16 DS Agg. gestione SplitArcs (MF_CURR_VER = 1005).
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
@@ -17,14 +17,14 @@
|
||||
#include "MachiningDataFactory.h"
|
||||
#include "MachiningConst.h"
|
||||
#include "DllMain.h"
|
||||
#include "/EgtDEv/Include/EGkGeoConst.h"
|
||||
#include "/EgtDEv/Include/EMkMachiningConst.h"
|
||||
#include "/EgtDEv/Include/EGnStringKeyVal.h"
|
||||
#include "/EgtDEv/Include/EGnStringUtils.h"
|
||||
#include "/EgtDEv/Include/EGnFileUtils.h"
|
||||
#include "/EgtDEv/Include/EGnScanner.h"
|
||||
#include "/EgtDEv/Include/EGnWriter.h"
|
||||
#include "/EgtDEv/Include/EgtPointerOwner.h"
|
||||
#include "/EgtDev/Include/EGkGeoConst.h"
|
||||
#include "/EgtDev/Include/EMkMachiningConst.h"
|
||||
#include "/EgtDev/Include/EGnStringKeyVal.h"
|
||||
#include "/EgtDev/Include/EGnStringUtils.h"
|
||||
#include "/EgtDev/Include/EGnFileUtils.h"
|
||||
#include "/EgtDev/Include/EGnScanner.h"
|
||||
#include "/EgtDev/Include/EGnWriter.h"
|
||||
#include "/EgtDev/Include/EgtPointerOwner.h"
|
||||
#include <cassert>
|
||||
#include <bitset>
|
||||
|
||||
@@ -620,7 +620,7 @@ MachiningsMgr::GetFirstMachining( int nType, string& sName) const
|
||||
bool
|
||||
MachiningsMgr::GetNextMachining( int nType, string& sName) const
|
||||
{
|
||||
// mentre esiste utensile
|
||||
// mentre esiste lavorazione
|
||||
while ( m_suCIter != m_suData.end()) {
|
||||
// nome successivo
|
||||
++ m_suCIter ;
|
||||
|
||||
Reference in New Issue
Block a user