From 888b409cfa4c371ffd79e3486aa9aa841d42336c Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 27 Oct 2015 10:16:37 +0000 Subject: [PATCH] EgtInterface 1.6j3 : - aggiornamento interfaccia per gestione DB utensili - migliorie a simulazione e gestione macchina corrente - aggiunta funzione per installare gestione eventi di interfaccia. --- API_General.cpp | 7 +++ API_MachMgr.cpp | 133 ++++++++++++++++++++++++++++++++++++++++++++++++ EgtInterface.rc | Bin 11726 -> 11726 bytes 3 files changed, 140 insertions(+) diff --git a/API_General.cpp b/API_General.cpp index 117b7a5..af1a717 100644 --- a/API_General.cpp +++ b/API_General.cpp @@ -185,3 +185,10 @@ __stdcall EgtOutLog( const wchar_t* wsMsg) { return ( ExeOutLog( wstrztoA( wsMsg)) ? TRUE : FALSE) ; } + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtSetProcessEvents( pfProcEvents pFun) +{ + return ( ExeSetProcessEvents( pFun) ? TRUE : FALSE) ; +} diff --git a/API_MachMgr.cpp b/API_MachMgr.cpp index 8a329ce..878f32d 100644 --- a/API_MachMgr.cpp +++ b/API_MachMgr.cpp @@ -20,6 +20,7 @@ using namespace std ; + //----------------------------------------------------------------------------- BOOL __stdcall EgtInitMachMgr( const wchar_t* wsMachinesDir) @@ -27,6 +28,17 @@ __stdcall EgtInitMachMgr( const wchar_t* wsMachinesDir) return ( ExeInitMachMgr( wstrztoA( wsMachinesDir)) ? TRUE : FALSE) ; } +//----------------------------------------------------------------------------- +// Machines +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtSetCurrMachine( const wchar_t* wsMachineName) +{ + return ( ExeSetCurrMachine( wstrztoA( wsMachineName)) ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +// Machining Groups //----------------------------------------------------------------------------- int __stdcall EgtGetMachGroupCount( void) @@ -103,6 +115,8 @@ __stdcall EgtGetCurrMachGroup( void) return ExeGetCurrMachGroup() ; } +//----------------------------------------------------------------------------- +// Raw Parts //----------------------------------------------------------------------------- int __stdcall EgtGetRawPartCount( void) @@ -181,6 +195,8 @@ __stdcall EgtRemovePartFromRawPart( int nPartId) return ( ExeRemovePartFromRawPart( nPartId) ? TRUE : FALSE) ; } +//----------------------------------------------------------------------------- +// Table & Fixtures //----------------------------------------------------------------------------- BOOL __stdcall EgtSetTable( const wchar_t* wsTable) @@ -222,6 +238,116 @@ __stdcall EgtShowOnlyTable( bool bVal) return ( ExeShowOnlyTable( bVal) ? TRUE : FALSE) ; } +//----------------------------------------------------------------------------- +// Tools DataBase +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtTdbAddTool( const wchar_t* wsName, int nType) +{ + return ( ExeTdbAddTool( wstrztoA( wsName), nType) ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtTdbCopyTool( const wchar_t* wsSource, const wchar_t* wsName) +{ + return ( ExeTdbCopyTool( wstrztoA( wsSource), wstrztoA( wsName)) ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtTdbRemoveTool( const wchar_t* wsName) +{ + return ( ExeTdbRemoveTool( wstrztoA( wsName)) ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtTdbGetFirstTool( int nFamily, wchar_t*& wsName, int* pnType) +{ + if ( &wsName == nullptr || pnType == nullptr) + return FALSE ; + string sName ; + if ( ! ExeTdbGetFirstTool( nFamily, sName, *pnType)) + return FALSE ; + wsName = _wcsdup( stringtoW( sName)) ; + return (( wsName == nullptr) ? FALSE : TRUE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtTdbGetNextTool( int nFamily, wchar_t*& wsName, int* pnType) +{ + if ( &wsName == nullptr || pnType == nullptr) + return FALSE ; + string sName ; + if ( ! ExeTdbGetNextTool( nFamily, sName, *pnType)) + return FALSE ; + wsName = _wcsdup( stringtoW( sName)) ; + return (( wsName == nullptr) ? FALSE : TRUE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtTdbSetToolParamInt( const wchar_t* wsName, int nType, int nVal) +{ + return ( ExeTdbSetToolParam( wstrztoA( wsName), nType, nVal) ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtTdbSetToolParamDouble( const wchar_t* wsName, int nType, double dVal) +{ + return ( ExeTdbSetToolParam( wstrztoA( wsName), nType, dVal) ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtTdbSetToolParamString( const wchar_t* wsName, int nType, const wchar_t* wsVal) +{ + return ( ExeTdbSetToolParam( wstrztoA( wsName), nType, wstrztoA( wsVal)) ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtTdbGetToolParamInt( const wchar_t* wsName, int nType, int* pnVal) +{ + if ( pnVal == nullptr) + return FALSE ; + return ( ExeTdbGetToolParam( wstrztoA( wsName), nType, *pnVal) ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtTdbGetToolParamDouble( const wchar_t* wsName, int nType, double* pdVal) +{ + if ( pdVal == nullptr) + return FALSE ; + return ( ExeTdbGetToolParam( wstrztoA( wsName), nType, *pdVal) ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtTdbGetToolParamString( const wchar_t* wsName, int nType, wchar_t*& wsVal) +{ + if ( &wsVal == nullptr) + return FALSE ; + string sVal ; + if ( ! ExeTdbGetToolParam( wstrztoA( wsName), nType, sVal)) + return FALSE ; + wsVal = _wcsdup( stringtoW( sVal)) ; + return (( wsVal == nullptr) ? FALSE : TRUE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtTdbSave( void) +{ + return ( ExeTdbSave() ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +// Simulation //----------------------------------------------------------------------------- BOOL __stdcall EgtSimStart( void) @@ -236,6 +362,13 @@ __stdcall EgtSimMove( void) return ( ExeSimMove() ? TRUE : FALSE) ; } +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtSimHome( void) +{ + return ( ExeSimHome() ? TRUE : FALSE) ; +} + //----------------------------------------------------------------------------- BOOL __stdcall EgtSimSetStep( double dStep) diff --git a/EgtInterface.rc b/EgtInterface.rc index df64e46a81979c35c99948015ae866c4dfce48e1..71dd34ac5322781fa6cc796a230a5f832ffa108b 100644 GIT binary patch delta 113 zcmX>XeJ*;#A2vqg%@4(HGEKh5na5~6`6H+9WG^L)&3#f*jGK>e8!&^VPclv3Cs+lM i-t491#khHcFjUGNr~*ls7YjlI&*XKAP&0v=TDSp^FDUH* delta 113 zcmX>XeJ*;#A2vp#%@4(HGEKh5na5}}`6H+9WG^L)&3#f*jGK>e8!&^VPclv3Cs+lM i-t491#khHcFjUGNr~*ls7YjlI&*XKAP&0v=TDSp?WhmtU