From 2ea387dfbb6b788690d3f969e54f04d9de732f18 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Sat, 14 Nov 2015 16:25:19 +0000 Subject: [PATCH] EgtInterface 1.6k5 : - modifiche per gestione DB lavorazioni. --- API_MachMgr.cpp | 197 +++++++++++++++++++++++++++++++++++++++++++++++- EgtInterface.rc | Bin 11726 -> 11726 bytes 2 files changed, 196 insertions(+), 1 deletion(-) diff --git a/API_MachMgr.cpp b/API_MachMgr.cpp index fcb625e..cf3646b 100644 --- a/API_MachMgr.cpp +++ b/API_MachMgr.cpp @@ -321,6 +321,13 @@ __stdcall EgtTdbIsCurrToolModified( void) return ( ExeTdbIsCurrToolModified() ? TRUE : FALSE) ; } +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtTdbSetCurrToolParamBool( int nType, BOOL bVal) +{ + return ( ExeTdbSetCurrToolParam( nType, ( bVal != FALSE)) ? TRUE : FALSE) ; +} + //----------------------------------------------------------------------------- BOOL __stdcall EgtTdbSetCurrToolParamInt( int nType, int nVal) @@ -339,7 +346,20 @@ __stdcall EgtTdbSetCurrToolParamDouble( int nType, double dVal) BOOL __stdcall EgtTdbSetCurrToolParamString( int nType, const wchar_t* wsVal) { - return ( ExeTdbSetCurrToolParam( nType, wstrztoA( wsVal)) ? TRUE : FALSE) ; + return ( ExeTdbSetCurrToolParam( nType, string( wstrztoA( wsVal))) ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtTdbGetCurrToolParamBool( int nType, BOOL* pbVal) +{ + if ( pbVal == nullptr) + return FALSE ; + bool bVal ; + if ( ! ExeTdbGetCurrToolParam( nType, bVal)) + return FALSE ; + *pbVal = ( bVal ? TRUE : FALSE) ; + return TRUE ; } //----------------------------------------------------------------------------- @@ -406,6 +426,181 @@ __stdcall EgtTdbGetToolHolderDir( wchar_t*& wsTHolderDir) return (( wsTHolderDir == nullptr) ? FALSE : TRUE) ; } +//----------------------------------------------------------------------------- +// Machiningss DataBase +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtMdbGetMachiningNewName( const wchar_t* wsName, wchar_t*& wsNewName) +{ + if ( &wsNewName == nullptr) + return FALSE ; + string sNewName = wstrztoA( wsName) ; + if ( ! ExeMdbGetMachiningNewName( sNewName)) + return FALSE ; + wsNewName = _wcsdup( stringtoW( sNewName)) ; + return (( wsNewName == nullptr) ? FALSE : TRUE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtMdbAddMachining( const wchar_t* wsName, int nType) +{ + return ( ExeMdbAddMachining( wstrztoA( wsName), nType) ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtMdbCopyMachining( const wchar_t* wsSource, const wchar_t* wsName) +{ + return ( ExeMdbCopyMachining( wstrztoA( wsSource), wstrztoA( wsName)) ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtMdbRemoveMachining( const wchar_t* wsName) +{ + return ( ExeMdbRemoveMachining( wstrztoA( wsName)) ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtMdbGetFirstMachining( int nType, wchar_t*& wsName) +{ + if ( &wsName == nullptr) + return FALSE ; + string sName ; + if ( ! ExeMdbGetFirstMachining( nType, sName)) + return FALSE ; + wsName = _wcsdup( stringtoW( sName)) ; + return (( wsName == nullptr) ? FALSE : TRUE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtMdbGetNextMachining( int nType, wchar_t*& wsName) +{ + if ( &wsName == nullptr) + return FALSE ; + string sName ; + if ( ! ExeMdbGetNextMachining( nType, sName)) + return FALSE ; + wsName = _wcsdup( stringtoW( sName)) ; + return (( wsName == nullptr) ? FALSE : TRUE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtMdbSetCurrMachining( const wchar_t* wsName) +{ + return ( ExeMdbSetCurrMachining( wstrztoA( wsName)) ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtMdbSaveCurrMachining( void) +{ + return ( ExeMdbSaveCurrMachining() ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtMdbIsCurrMachiningModified( void) +{ + return ( ExeMdbIsCurrMachiningModified() ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtMdbSetCurrMachiningParamBool( int nType, BOOL bVal) +{ + return ( ExeMdbSetCurrMachiningParam( nType, ( bVal != FALSE)) ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtMdbSetCurrMachiningParamInt( int nType, int nVal) +{ + return ( ExeMdbSetCurrMachiningParam( nType, nVal) ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtMdbSetCurrMachiningParamDouble( int nType, double dVal) +{ + return ( ExeMdbSetCurrMachiningParam( nType, dVal) ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtMdbSetCurrMachiningParamString( int nType, const wchar_t* wsVal) +{ + return ( ExeMdbSetCurrMachiningParam( nType, string( wstrztoA( wsVal))) ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtMdbGetCurrMachiningParamBool( int nType, BOOL* pbVal) +{ + if ( pbVal == nullptr) + return FALSE ; + bool bVal ; + if ( ! ExeMdbGetCurrMachiningParam( nType, bVal)) + return FALSE ; + *pbVal = ( bVal ? TRUE : FALSE) ; + return TRUE ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtMdbGetCurrMachiningParamInt( int nType, int* pnVal) +{ + if ( pnVal == nullptr) + return FALSE ; + return ( ExeMdbGetCurrMachiningParam( nType, *pnVal) ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtMdbGetCurrMachiningParamDouble( int nType, double* pdVal) +{ + if ( pdVal == nullptr) + return FALSE ; + return ( ExeMdbGetCurrMachiningParam( nType, *pdVal) ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtMdbGetCurrMachiningParamString( int nType, wchar_t*& wsVal) +{ + if ( &wsVal == nullptr) + return FALSE ; + string sVal ; + if ( ! ExeMdbGetCurrMachiningParam( nType, sVal)) + return FALSE ; + wsVal = _wcsdup( stringtoW( sVal)) ; + return (( wsVal == nullptr) ? FALSE : TRUE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtMdbSave( void) +{ + return ( ExeMdbSave() ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtMdbGetMachiningDir( wchar_t*& wsMchDir) +{ + if ( &wsMchDir == nullptr) + return FALSE ; + string sMchDir ; + if ( ! ExeTdbGetToolDir( sMchDir)) + return FALSE ; + wsMchDir = _wcsdup( stringtoW( sMchDir)) ; + return (( wsMchDir == nullptr) ? FALSE : TRUE) ; +} + //----------------------------------------------------------------------------- // Simulation //----------------------------------------------------------------------------- diff --git a/EgtInterface.rc b/EgtInterface.rc index 3260c1ed9d1ceea52bc55356d89a64491149e27b..7ec868d8d2dc8935148b065fad0742b4ee7adcd9 100644 GIT binary patch delta 113 zcmX>XeJ*;#A2vqQ%@4(HGEKh5na5~4`6H+9WG^L)&3#f*jGK>e8!&^VPclv3Cs+lM i-t491#khHcFjUGNr~*ls7YjlI&*XKAP&0v=TDSp{!zld# delta 113 zcmX>XeJ*;#A2vpl%@4(HGEKh5na5}{`6H+9WG^L)&3#f*jGK>e8!&^VPclv3Cs+lM i-t491#khHcFjUGNr~*ls7YjlI&*XKAP&0v=TDSp_`6%@O