From 757e2024e230fad7ef8c2e557c0c81172a749f0c Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Sat, 14 Nov 2015 16:26:18 +0000 Subject: [PATCH] Include : - aggiornamenti. --- EInAPI.h | 22 ++++++++++++++++++++ EMkMachMgr.h | 32 +++++++++++++++++++++++------ EMkMachiningConst.h | 49 ++++++++++++++++++++++++++++++++++++++++++--- EXeExecutor.h | 22 +++++++++++++++++++- 4 files changed, 115 insertions(+), 10 deletions(-) diff --git a/EInAPI.h b/EInAPI.h index 8cf85f4..eea39ad 100644 --- a/EInAPI.h +++ b/EInAPI.h @@ -499,15 +499,37 @@ EIN_EXPORT BOOL __stdcall EgtTdbGetNextTool( int nFamily, wchar_t*& wsName, int* EIN_EXPORT BOOL __stdcall EgtTdbSetCurrTool( const wchar_t* wsName) ; EIN_EXPORT BOOL __stdcall EgtTdbSaveCurrTool( void) ; EIN_EXPORT BOOL __stdcall EgtTdbIsCurrToolModified( void) ; +EIN_EXPORT BOOL __stdcall EgtTdbSetCurrToolParamBool( int nType, BOOL bVal) ; EIN_EXPORT BOOL __stdcall EgtTdbSetCurrToolParamInt( int nType, int nVal) ; EIN_EXPORT BOOL __stdcall EgtTdbSetCurrToolParamDouble( int nType, double dVal) ; EIN_EXPORT BOOL __stdcall EgtTdbSetCurrToolParamString( int nType, const wchar_t* wsVal) ; +EIN_EXPORT BOOL __stdcall EgtTdbGetCurrToolParamBool( int nType, BOOL* pbVal) ; EIN_EXPORT BOOL __stdcall EgtTdbGetCurrToolParamInt( int nType, int* pnVal) ; EIN_EXPORT BOOL __stdcall EgtTdbGetCurrToolParamDouble( int nType, double* pdVal) ; EIN_EXPORT BOOL __stdcall EgtTdbGetCurrToolParamString( int nType, wchar_t*& wsVal) ; EIN_EXPORT BOOL __stdcall EgtTdbSave( void) ; EIN_EXPORT BOOL __stdcall EgtTdbGetToolDir( wchar_t*& wsToolDir) ; EIN_EXPORT BOOL __stdcall EgtTdbGetToolHolderDir( wchar_t*& wsTHolderDir) ; +// Machinings DataBase +EIN_EXPORT BOOL __stdcall EgtMdbGetMachiningNewName( const wchar_t* wsName, wchar_t*& wsNewName) ; +EIN_EXPORT BOOL __stdcall EgtMdbAddMachining( const wchar_t* wsName, int nType) ; +EIN_EXPORT BOOL __stdcall EgtMdbCopyMachining( const wchar_t* wsSource, const wchar_t* wsName) ; +EIN_EXPORT BOOL __stdcall EgtMdbRemoveMachining( const wchar_t* wsName) ; +EIN_EXPORT BOOL __stdcall EgtMdbGetFirstMachining( int nType, wchar_t*& wsName) ; +EIN_EXPORT BOOL __stdcall EgtMdbGetNextMachining( int nType, wchar_t*& wsName) ; +EIN_EXPORT BOOL __stdcall EgtMdbSetCurrMachining( const wchar_t* wsName) ; +EIN_EXPORT BOOL __stdcall EgtMdbSaveCurrMachining( void) ; +EIN_EXPORT BOOL __stdcall EgtMdbIsCurrMachiningModified( void) ; +EIN_EXPORT BOOL __stdcall EgtMdbSetCurrMachiningParamBool( int nType, BOOL bVal) ; +EIN_EXPORT BOOL __stdcall EgtMdbSetCurrMachiningParamInt( int nType, int nVal) ; +EIN_EXPORT BOOL __stdcall EgtMdbSetCurrMachiningParamDouble( int nType, double dVal) ; +EIN_EXPORT BOOL __stdcall EgtMdbSetCurrMachiningParamString( int nType, const wchar_t* wsVal) ; +EIN_EXPORT BOOL __stdcall EgtMdbGetCurrMachiningParamBool( int nType, BOOL* pbVal) ; +EIN_EXPORT BOOL __stdcall EgtMdbGetCurrMachiningParamInt( int nType, int* pnVal) ; +EIN_EXPORT BOOL __stdcall EgtMdbGetCurrMachiningParamDouble( int nType, double* pdVal) ; +EIN_EXPORT BOOL __stdcall EgtMdbGetCurrMachiningParamString( int nType, wchar_t*& wsVal) ; +EIN_EXPORT BOOL __stdcall EgtMdbSave( void) ; +EIN_EXPORT BOOL __stdcall EgtMdbGetMachiningDir( wchar_t*& wsMchDir) ; // Simulation EIN_EXPORT BOOL __stdcall EgtSimStart( void) ; EIN_EXPORT BOOL __stdcall EgtSimMove( void) ; diff --git a/EMkMachMgr.h b/EMkMachMgr.h index 2cb16d6..69da879 100644 --- a/EMkMachMgr.h +++ b/EMkMachMgr.h @@ -76,18 +76,20 @@ class __declspec( novtable) IMachMgr virtual int AddFixture( const std::string& sName, const Point3d& ptPos, double dAngRotDeg) = 0 ; virtual bool ShowOnlyTable( bool bVal) = 0 ; // Tools DataBase - virtual bool TdbGetToolNewName( std::string& sName) = 0 ; + virtual bool TdbGetToolNewName( std::string& sName) const = 0 ; virtual bool TdbAddTool( const std::string& sName, int nType) = 0 ; virtual bool TdbCopyTool( const std::string& sSource, const std::string& sName) = 0 ; virtual bool TdbRemoveTool( const std::string& sName) = 0 ; - virtual bool TdbGetFirstTool( int nFamily, std::string& sName, int& nType) = 0 ; - virtual bool TdbGetNextTool( int nFamily, std::string& sName, int& nType) = 0 ; + virtual bool TdbGetFirstTool( int nFamily, std::string& sName, int& nType) const = 0 ; + virtual bool TdbGetNextTool( int nFamily, std::string& sName, int& nType) const = 0 ; virtual bool TdbSetCurrTool( const std::string& sName) = 0 ; virtual bool TdbSaveCurrTool( void) = 0 ; - virtual bool TdbIsCurrToolModified( void) = 0 ; + virtual bool TdbIsCurrToolModified( void) const = 0 ; + virtual bool TdbSetCurrToolParam( int nType, bool bVal) = 0 ; virtual bool TdbSetCurrToolParam( int nType, int nVal) = 0 ; virtual bool TdbSetCurrToolParam( int nType, double dVal) = 0 ; virtual bool TdbSetCurrToolParam( int nType, const std::string& sVal) = 0 ; + virtual bool TdbGetCurrToolParam( int nType, bool& bVal) const = 0 ; virtual bool TdbGetCurrToolParam( int nType, int& nVal) const = 0 ; virtual bool TdbGetCurrToolParam( int nType, double& dVal) const = 0 ; virtual bool TdbGetCurrToolParam( int nType, std::string& sVal) const = 0 ; @@ -95,8 +97,26 @@ class __declspec( novtable) IMachMgr virtual bool TdbGetToolDir( std::string& sToolDir) const = 0 ; virtual bool TdbGetToolHolderDir( std::string& sTHolderDir) const = 0 ; // Machinings DataBase - // ... - // Operations : general + virtual bool MdbGetMachiningNewName( std::string& sName) const = 0 ; + virtual bool MdbAddMachining( const std::string& sName, int nType) = 0 ; + virtual bool MdbCopyMachining( const std::string& sSource, const std::string& sName) = 0 ; + virtual bool MdbRemoveMachining( const std::string& sName) = 0 ; + virtual bool MdbGetFirstMachining( int nType, std::string& sName) const = 0 ; + virtual bool MdbGetNextMachining( int nType, std::string& sName) const = 0 ; + virtual bool MdbSetCurrMachining( const std::string& sName) = 0 ; + virtual bool MdbSaveCurrMachining( void) = 0 ; + virtual bool MdbIsCurrMachiningModified( void) const = 0 ; + virtual bool MdbSetCurrMachiningParam( int nType, bool bVal) = 0 ; + virtual bool MdbSetCurrMachiningParam( int nType, int nVal) = 0 ; + virtual bool MdbSetCurrMachiningParam( int nType, double dVal) = 0 ; + virtual bool MdbSetCurrMachiningParam( int nType, const std::string& sVal) = 0 ; + virtual bool MdbGetCurrMachiningParam( int nType, bool& bVal) const = 0 ; + virtual bool MdbGetCurrMachiningParam( int nType, int& nVal) const = 0 ; + virtual bool MdbGetCurrMachiningParam( int nType, double& dVal) const = 0 ; + virtual bool MdbGetCurrMachiningParam( int nType, std::string& sVal) const = 0 ; + virtual bool MdbSave( void) const = 0 ; + virtual bool MdbGetMachiningDir( std::string& sMchDir) const = 0 ; + // Operations : general virtual int GetOperationCount( void) const = 0 ; virtual int GetFirstOperation( void) const = 0 ; virtual int GetNextOperation( int nId) const = 0 ; diff --git a/EMkMachiningConst.h b/EMkMachiningConst.h index 1987eaf..38fffed 100644 --- a/EMkMachiningConst.h +++ b/EMkMachiningConst.h @@ -15,6 +15,24 @@ #include +//---------------------------------------------------------------------------- +// Tipologie di lavorazioni +enum MachiningType { + MT_NONE = 0, + MT_DRILLING = 256, + MT_SAWING = 512, + MT_MILLING = 1024, + MT_POCKETING = 2048, + MT_MORTISING = 4096 +} ; +// Controllo tipo valido +bool inline IsValidMachiningType( int nType) +{ + return ( nType == MT_DRILLING || nType == MT_SAWING || + nType == MT_MILLING || nType == MT_POCKETING || + nType == MT_MORTISING) ; +} + //---------------------------------------------------------------------------- // Costanti famiglie di parametri ( i primi 12 bit (0-4095) restano liberi) const int MPA_BOOL = 0x1000 ; @@ -40,7 +58,7 @@ enum MpaType { MPA_NONE = 0, MPA_TOOLTIPFEED = ( MPA_DOU + 4), MPA_TOOLOFFSR = ( MPA_DOU + 5), MPA_TOOLOFFSL = ( MPA_DOU + 6), - MPA_DEPTH = ( MPA_DOU + 7), + MPA_DEPTH = ( MPA_DOU + 7), // solo set, get con MPA_DEPTH_STR MPA_SIDEANGLE = ( MPA_DOU + 8), MPA_APPROX = ( MPA_DOU + 9), MPA_STARTPOS = ( MPA_DOU + 10), @@ -62,8 +80,11 @@ enum MpaType { MPA_NONE = 0, MPA_LOPERP = ( MPA_DOU + 26), MPA_LOELEV = ( MPA_DOU + 27), MPA_LOCOMPLEN = ( MPA_DOU + 28), - MPA_TOOL = ( MPA_STR + 0), - MPA_DEPTH_STR = ( MPA_STR + 1)} ; + MPA_NAME = ( MPA_STR + 0), + MPA_TOOL = ( MPA_STR + 1), + MPA_DEPTH_STR = ( MPA_STR + 2), + MPA_TUUID = ( MPA_STR + 3), + MPA_UUID = ( MPA_STR + 4)} ; //---------------------------------------------------------------------------- // Parametri per lavorazione con lama @@ -93,3 +114,25 @@ enum { SAW_LO_CENT = 0, enum { SAW_CRV_SKIP = 0, SAW_CRV_APPROX = 1, SAW_CRV_CONVEX = 2} ; + +//---------------------------------------------------------------------------- +// Parametri per fresatura +// Lato di lavoro +enum { MILL_WS_CENTER = 0, + MILL_WS_LEFT = 1, + MILL_WS_RIGHT = 2 } ; +// Tipo di lavorazione a step +enum { MILL_ST_STEP = 0, + MILL_ST_ONEWAY = 1, + MILL_ST_SPIRAL = 2 } ; +// Tipo di attacco +enum { MILL_LI_NONE = 0, + MILL_LI_LINEAR = 1, + MILL_LI_TANGENT = 2, + MILL_LI_GLIDE = 3 } ; +// Tipo di uscita +enum { MILL_LO_NONE = 0, + MILL_LO_LINEAR = 1, + MILL_LO_TANGENT = 2, + MILL_LO_GLIDE = 3, + MILL_LO_AS_LI = 4} ; diff --git a/EXeExecutor.h b/EXeExecutor.h index 5a5816b..aba5391 100644 --- a/EXeExecutor.h +++ b/EXeExecutor.h @@ -514,9 +514,11 @@ EXE_EXPORT bool ExeTdbGetNextTool( int nFamily, std::string& sName, int& nType) EXE_EXPORT bool ExeTdbSetCurrTool( const std::string& sName) ; EXE_EXPORT bool ExeTdbSaveCurrTool( void) ; EXE_EXPORT bool ExeTdbIsCurrToolModified( void) ; +EXE_EXPORT bool ExeTdbSetCurrToolParam( int nType, bool bVal) ; EXE_EXPORT bool ExeTdbSetCurrToolParam( int nType, int nVal) ; EXE_EXPORT bool ExeTdbSetCurrToolParam( int nType, double dVal) ; EXE_EXPORT bool ExeTdbSetCurrToolParam( int nType, const std::string& sVal) ; +EXE_EXPORT bool ExeTdbGetCurrToolParam( int nType, bool& nVal) ; EXE_EXPORT bool ExeTdbGetCurrToolParam( int nType, int& nVal) ; EXE_EXPORT bool ExeTdbGetCurrToolParam( int nType, double& dVal) ; EXE_EXPORT bool ExeTdbGetCurrToolParam( int nType, std::string& sVal) ; @@ -524,7 +526,25 @@ EXE_EXPORT bool ExeTdbSave( void) ; EXE_EXPORT bool ExeTdbGetToolDir( std::string& sToolDir) ; EXE_EXPORT bool ExeTdbGetToolHolderDir( std::string& sTHolderDir) ; // Machinings Database -// ... +EXE_EXPORT bool ExeMdbGetMachiningNewName( std::string& sName) ; +EXE_EXPORT bool ExeMdbAddMachining( const std::string& sName, int nType) ; +EXE_EXPORT bool ExeMdbCopyMachining( const std::string& sSource, const std::string& sName) ; +EXE_EXPORT bool ExeMdbRemoveMachining( const std::string& sName) ; +EXE_EXPORT bool ExeMdbGetFirstMachining( int nType, std::string& sName) ; +EXE_EXPORT bool ExeMdbGetNextMachining( int nType, std::string& sName) ; +EXE_EXPORT bool ExeMdbSetCurrMachining( const std::string& sName) ; +EXE_EXPORT bool ExeMdbSaveCurrMachining( void) ; +EXE_EXPORT bool ExeMdbIsCurrMachiningModified( void) ; +EXE_EXPORT bool ExeMdbSetCurrMachiningParam( int nType, bool bVal) ; +EXE_EXPORT bool ExeMdbSetCurrMachiningParam( int nType, int nVal) ; +EXE_EXPORT bool ExeMdbSetCurrMachiningParam( int nType, double dVal) ; +EXE_EXPORT bool ExeMdbSetCurrMachiningParam( int nType, const std::string& sVal) ; +EXE_EXPORT bool ExeMdbGetCurrMachiningParam( int nType, bool& nVal) ; +EXE_EXPORT bool ExeMdbGetCurrMachiningParam( int nType, int& nVal) ; +EXE_EXPORT bool ExeMdbGetCurrMachiningParam( int nType, double& dVal) ; +EXE_EXPORT bool ExeMdbGetCurrMachiningParam( int nType, std::string& sVal) ; +EXE_EXPORT bool ExeMdbSave( void) ; +EXE_EXPORT bool ExeMdbGetMachiningDir( std::string& sMchDir) ; // Operations EXE_EXPORT int ExeGetFirstOperation( void) ; EXE_EXPORT int ExeGetNextOperation( int nId) ;