From b9bb60125751d9f0a13dc787ad17f61edec4f2d2 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 27 Oct 2015 10:17:38 +0000 Subject: [PATCH] Include : - aggiornamenti. --- EInAPI.h | 22 ++++++++++++++++++++++ EMkMachMgr.h | 21 +++++++++++++++++---- EMkToolConst.h | 29 +++++++++++++++++++++++++++++ EXeExecutor.h | 27 ++++++++++++++++++++++++--- 4 files changed, 92 insertions(+), 7 deletions(-) diff --git a/EInAPI.h b/EInAPI.h index 8970081..c9004b1 100644 --- a/EInAPI.h +++ b/EInAPI.h @@ -49,6 +49,8 @@ EIN_EXPORT BOOL __stdcall EgtGetCpuInfo( wchar_t*& wsCpu) ; EIN_EXPORT BOOL __stdcall EgtGetMemoryInfo( wchar_t*& wsMem) ; EIN_EXPORT BOOL __stdcall EgtFreeMemory( void* pMem) ; EIN_EXPORT BOOL __stdcall EgtOutLog( const wchar_t* wsMsg) ; +typedef int (__stdcall * pfProcEvents) (int, int) ; +EIN_EXPORT BOOL __stdcall EgtSetProcessEvents( pfProcEvents pFun) ; // UiUnits EIN_EXPORT BOOL __stdcall EgtSetUiUnits( BOOL bMM) ; @@ -456,6 +458,9 @@ EIN_EXPORT BOOL __stdcall EgtMoveCluster( int nId[], int nCount, double vtMove[3 // Machining EIN_EXPORT BOOL __stdcall EgtInitMachMgr( const wchar_t* wsMachinesDir) ; +// Machines +EIN_EXPORT BOOL __stdcall EgtSetCurrMachine( const wchar_t* wsMachineName) ; +// Machining Groups EIN_EXPORT int __stdcall EgtGetMachGroupCount( void) ; EIN_EXPORT int __stdcall EgtGetFirstMachGroup( void) ; EIN_EXPORT int __stdcall EgtGetNextMachGroup( int nId) ; @@ -466,6 +471,7 @@ EIN_EXPORT int __stdcall EgtGetMachGroupId( const wchar_t* wsName) ; EIN_EXPORT BOOL __stdcall EgtSetCurrMachGroup( int nMGroupId) ; EIN_EXPORT BOOL __stdcall EgtResetCurrMachGroup( void) ; EIN_EXPORT int __stdcall EgtGetCurrMachGroup( void) ; +// RawParts EIN_EXPORT int __stdcall EgtGetRawPartCount( void) ; EIN_EXPORT int __stdcall EgtGetFirstRawPart( void) ; EIN_EXPORT int __stdcall EgtGetNextRawPart( int nRawId) ; @@ -478,12 +484,28 @@ EIN_EXPORT BOOL __stdcall EgtMoveToCornerRawPart( int nRawId, const double ptCor EIN_EXPORT BOOL __stdcall EgtMoveRawPart( int nRawId, const double vtMove[3]) ; EIN_EXPORT BOOL __stdcall EgtAddPartToRawPart( int nPartId, const double ptPos[3], int nRawId) ; EIN_EXPORT BOOL __stdcall EgtRemovePartFromRawPart( int nPartId) ; +// Table & Fixtures EIN_EXPORT BOOL __stdcall EgtSetTable( const wchar_t* wsTable) ; EIN_EXPORT BOOL __stdcall EgtGetTableRef1( double ptPos[3]) ; EIN_EXPORT BOOL __stdcall EgtGetTableArea1( int* pnAreaId) ; EIN_EXPORT BOOL __stdcall EgtShowOnlyTable( bool bVal) ; +// Tools DataBase +EIN_EXPORT BOOL __stdcall EgtTdbAddTool( const wchar_t* wsName, int nType) ; +EIN_EXPORT BOOL __stdcall EgtTdbCopyTool( const wchar_t* wsSource, const wchar_t* wsName) ; +EIN_EXPORT BOOL __stdcall EgtTdbRemoveTool( const wchar_t* wsName) ; +EIN_EXPORT BOOL __stdcall EgtTdbGetFirstTool( int nFamily, wchar_t*& wsName, int* pnType) ; +EIN_EXPORT BOOL __stdcall EgtTdbGetNextTool( int nFamily, wchar_t*& wsName, int* pnType) ; +EIN_EXPORT BOOL __stdcall EgtTdbSetToolParamInt( const wchar_t* wsName, int nType, int nVal) ; +EIN_EXPORT BOOL __stdcall EgtTdbSetToolParamDouble( const wchar_t* wsName, int nType, double dVal) ; +EIN_EXPORT BOOL __stdcall EgtTdbSetToolParamString( const wchar_t* wsName, int nType, const wchar_t* wsVal) ; +EIN_EXPORT BOOL __stdcall EgtTdbGetToolParamInt( const wchar_t* wsName, int nType, int* pnVal) ; +EIN_EXPORT BOOL __stdcall EgtTdbGetToolParamDouble( const wchar_t* wsName, int nType, double* pdVal) ; +EIN_EXPORT BOOL __stdcall EgtTdbGetToolParamString( const wchar_t* wsName, int nType, wchar_t*& wsVal) ; +EIN_EXPORT BOOL __stdcall EgtTdbSave( void) ; +// Simulation EIN_EXPORT BOOL __stdcall EgtSimStart( void) ; EIN_EXPORT BOOL __stdcall EgtSimMove( void) ; +EIN_EXPORT BOOL __stdcall EgtSimHome( void) ; EIN_EXPORT BOOL __stdcall EgtSimSetStep( double dStep) ; EIN_EXPORT BOOL __stdcall EgtSimStop( void) ; diff --git a/EMkMachMgr.h b/EMkMachMgr.h index 940abfb..142fcdf 100644 --- a/EMkMachMgr.h +++ b/EMkMachMgr.h @@ -34,6 +34,8 @@ class __declspec( novtable) IMachMgr int nContextId, const std::string& sLuaLibsDir, const std::string& sLuaLastRequire) = 0 ; virtual bool Update( void) = 0 ; virtual bool Insert( int nInsGrp) = 0 ; + // Machines + virtual bool SetCurrMachine( const std::string& sMachineName) = 0 ; // MachGroups virtual int GetMachGroupCount( void) const = 0 ; virtual int GetFirstMachGroup( void) const = 0 ; @@ -89,10 +91,19 @@ class __declspec( novtable) IMachMgr virtual bool GetCalcPositions( const Point3d& ptP, double dAngA, double dAngB, int& nStat, double& dX, double& dY, double& dZ) = 0 ; virtual bool VerifyOutOfStroke( double dX, double dY, double dZ, double dAngA, double dAngB, int& nStat) = 0 ; - // Tools - virtual bool GetToolParam( const std::string& sName, int nType, int& nVal) const = 0 ; - virtual bool GetToolParam( const std::string& sName, int nType, double& dVal) const = 0 ; - virtual bool GetToolParam( const std::string& sName, int nType, std::string& sVal) const = 0 ; + // Tool DataBase + 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 TdbSetToolParam( const std::string& sName, int nType, int nVal) = 0 ; + virtual bool TdbSetToolParam( const std::string& sName, int nType, double dVal) = 0 ; + virtual bool TdbSetToolParam( const std::string& sName, int nType, const std::string& sVal) = 0 ; + virtual bool TdbGetToolParam( const std::string& sName, int nType, int& nVal) const = 0 ; + virtual bool TdbGetToolParam( const std::string& sName, int nType, double& dVal) const = 0 ; + virtual bool TdbGetToolParam( const std::string& sName, int nType, std::string& sVal) const = 0 ; + virtual bool TdbSave( void) const = 0 ; // Operations virtual int AddMachining( const std::string& sName, const std::string& sMachining) = 0 ; virtual bool SetMachiningParam( int nType, bool bVal) = 0 ; @@ -103,6 +114,8 @@ class __declspec( novtable) IMachMgr virtual bool Apply( void) = 0 ; virtual int GetFirstOperation( void) const = 0 ; virtual int GetNextOperation( int nId) const = 0 ; + virtual int GetLastOperation( void) const = 0 ; + virtual int GetPrevOperation( int nId) const = 0 ; virtual int GetOperationType( int nId) const = 0 ; // Simulation virtual bool SimStart( void) = 0 ; diff --git a/EMkToolConst.h b/EMkToolConst.h index c26a36c..97fbf8c 100644 --- a/EMkToolConst.h +++ b/EMkToolConst.h @@ -15,6 +15,35 @@ #include +//---------------------------------------------------------------------------- +// Costanti per famiglie di utensili +const int TF_DRILLBIT = 0x0100 ; // 256 +const int TF_SAWBLADE = 0x0200 ; // 512 +const int TF_MILL = 0x0400 ; // 1024 +const int TF_MORTISE = 0x0800 ; // 2048 +const int TF_COMPO = 0x1000 ; // 4096 +// Tipologie di utensili +enum ToolType { + TT_NONE = 0, + TT_DRILL_STD = TF_DRILLBIT + 0, // 256 + TT_DRILL_LONG = TF_DRILLBIT + 1, // 257 + TT_SAW_STD = TF_SAWBLADE + 0, // 512 + TT_SAW_FLAT = TF_SAWBLADE + 1, // 513 + TT_MILL_STD = TF_MILL + 0, // 1024 + TT_MILL_NOTIP = TF_MILL + 1, // 1025 + TT_MORTISE_STD = TF_MORTISE + 0, // 2048 + TT_COMPO = TF_COMPO + 0 // 4096 +} ; +// Controllo tipo valido +bool inline IsValidToolType( int nType) +{ + return ( nType == TT_DRILL_STD || nType == TT_DRILL_LONG || + nType == TT_SAW_STD || nType == TT_SAW_FLAT || + nType == TT_MILL_STD || nType == TT_MILL_NOTIP || + nType == TT_MORTISE_STD || + nType == TT_COMPO) ; +} + //---------------------------------------------------------------------------- // Costanti famiglie di parametri ( i primi 12 bit (0-4095) restano liberi) const int TPA_BOOL = 0x1000 ; diff --git a/EXeExecutor.h b/EXeExecutor.h index 48d11ce..85716b6 100644 --- a/EXeExecutor.h +++ b/EXeExecutor.h @@ -49,6 +49,8 @@ EXE_EXPORT bool ExeGetOsInfo( std::string& sOs) ; EXE_EXPORT bool ExeGetCpuInfo( std::string& sCpu) ; EXE_EXPORT bool ExeGetMemoryInfo( std::string& sMem) ; EXE_EXPORT bool ExeOutLog( const std::string& sMsg) ; +typedef int (__stdcall * pfProcEvents) (int, int) ; +EXE_EXPORT bool ExeSetProcessEvents( pfProcEvents pFun) ; // UiUnits EXE_EXPORT bool ExeSetUiUnits( bool bMM) ; @@ -461,6 +463,9 @@ EXE_EXPORT bool ExeMoveCluster( const INTVECTOR& vIds, Vector3d& vtMove, EXE_EXPORT bool ExeInitMachMgr( const std::string& sMachinesDir) ; EXE_EXPORT bool ExeUpdateMachMgr( void) ; EXE_EXPORT bool ExeInsertMachMgr( int nInsGrp) ; +// Machines +EXE_EXPORT bool ExeSetCurrMachine( const std::string& sMachineName) ; +// Machining Groups EXE_EXPORT int ExeGetMachGroupCount( void) ; EXE_EXPORT int ExeGetFirstMachGroup( void) ; EXE_EXPORT int ExeGetNextMachGroup( int nId) ; @@ -471,6 +476,7 @@ EXE_EXPORT int ExeGetMachGroupId( const std::string& sName) ; EXE_EXPORT bool ExeSetCurrMachGroup( int nMGroupId) ; EXE_EXPORT bool ExeResetCurrMachGroup( void) ; EXE_EXPORT int ExeGetCurrMachGroup( void) ; +// Raw Parts EXE_EXPORT int ExeGetRawPartCount( void) ; EXE_EXPORT int ExeGetFirstRawPart( void) ; EXE_EXPORT int ExeGetNextRawPart( int nRawId) ; @@ -490,11 +496,13 @@ EXE_EXPORT bool ExeAddPartToRawPart( int nPartId, const Point3d& ptPos, int nRaw EXE_EXPORT bool ExeRemovePartFromRawPart( int nPartId) ; EXE_EXPORT bool ExeTranslatePartInRawPart( int nPartId, const Vector3d& vtMove) ; EXE_EXPORT bool ExeRotatePartInRawPart( int nPartId, const Vector3d& vtAx, double dAngRotDeg) ; +// Table & Disposition EXE_EXPORT bool ExeSetTable( const std::string& sTable) ; EXE_EXPORT bool ExeGetTableRef1( Point3d& ptPos) ; EXE_EXPORT bool ExeGetTableArea1( int& nAreaId) ; EXE_EXPORT bool ExeShowOnlyTable( bool bVal) ; EXE_EXPORT int ExeAddSubPiece( const std::string& sName, const Point3d& ptPos, double dAngRotDeg) ; +// Machine Calc EXE_EXPORT bool ExeSetAxisPos( const std::string& sAxis, double dVal) ; EXE_EXPORT bool ExeGetAxisPos( const std::string& sAxis, double* pdVal) ; EXE_EXPORT bool ExeGetAxisHomePos( const std::string& sAxis, double* pdHomeVal) ; @@ -509,9 +517,20 @@ EXE_EXPORT bool ExeGetCalcAngles( const Vector3d& vtDirT, const Vector3d& vtDirA EXE_EXPORT bool ExeGetCalcPositions( const Point3d& ptP, double dAngA, double dAngB, int& nStat, double& dX, double& dY, double& dZ) ; EXE_EXPORT bool ExeVerifyOutOfStroke( double dX, double dY, double dZ, double dAngA, double dAngB, int& nStat) ; -EXE_EXPORT bool ExeGetToolParam( const std::string& sName, int nType, int& nVal) ; -EXE_EXPORT bool ExeGetToolParam( const std::string& sName, int nType, double& dVal) ; -EXE_EXPORT bool ExeGetToolParam( const std::string& sName, int nType, std::string& sVal) ; +// Tool DataBase +EXE_EXPORT bool ExeTdbAddTool( const std::string& sName, int nType) ; +EXE_EXPORT bool ExeTdbCopyTool( const std::string& sSource, const std::string& sName) ; +EXE_EXPORT bool ExeTdbRemoveTool( const std::string& sName) ; +EXE_EXPORT bool ExeTdbGetFirstTool( int nFamily, std::string& sName, int& nType) ; +EXE_EXPORT bool ExeTdbGetNextTool( int nFamily, std::string& sName, int& nType) ; +EXE_EXPORT bool ExeTdbSetToolParam( const std::string& sName, int nType, int nVal) ; +EXE_EXPORT bool ExeTdbSetToolParam( const std::string& sName, int nType, double dVal) ; +EXE_EXPORT bool ExeTdbSetToolParam( const std::string& sName, int nType, const std::string& sVal) ; +EXE_EXPORT bool ExeTdbGetToolParam( const std::string& sName, int nType, int& nVal) ; +EXE_EXPORT bool ExeTdbGetToolParam( const std::string& sName, int nType, double& dVal) ; +EXE_EXPORT bool ExeTdbGetToolParam( const std::string& sName, int nType, std::string& sVal) ; +EXE_EXPORT bool ExeTdbSave( void) ; +// Machinings EXE_EXPORT int ExeAddMachining( const std::string& sName, const std::string& sMachining) ; EXE_EXPORT bool ExeSetMachiningParam( int nType, bool bVal) ; EXE_EXPORT bool ExeSetMachiningParam( int nType, int nVal) ; @@ -522,8 +541,10 @@ EXE_EXPORT bool ExeApplyMachining( void) ; EXE_EXPORT int ExeGetFirstOperation( void) ; EXE_EXPORT int ExeGetNextOperation( int nId) ; EXE_EXPORT int ExeGetOperationType( int nId) ; +// Simulation EXE_EXPORT bool ExeSimStart( void) ; EXE_EXPORT bool ExeSimMove( void) ; +EXE_EXPORT bool ExeSimHome( void) ; EXE_EXPORT bool ExeSimSetStep( double dStep) ; EXE_EXPORT bool ExeSimStop( void) ;