From ad4abc9be9b7386410c1ff77ff430f0340fab7b5 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 30 Jan 2017 08:08:12 +0000 Subject: [PATCH] EgtInterface 1.6x8 : - modificata interfaccia di EgtSimGetAxisInfoPos per aggiunta paramentro nome asse - aggiunta interfaccia per EgtGetAllHeadsNames - aggiunta interfaccia per EgtGetAxisPos. --- API_MachMgr.cpp | 37 ++++++++++++++++++++++++++++++++----- EgtInterface.rc | Bin 11726 -> 11726 bytes 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/API_MachMgr.cpp b/API_MachMgr.cpp index 38c5ceb..06c135c 100644 --- a/API_MachMgr.cpp +++ b/API_MachMgr.cpp @@ -1324,17 +1324,19 @@ __stdcall EgtSimHome( void) //----------------------------------------------------------------------------- BOOL -__stdcall EgtSimGetAxisInfoPos( int nI, wchar_t*& wsToken, BOOL* pbLinear, double* pdVal) +__stdcall EgtSimGetAxisInfoPos( int nI, wchar_t*& wsName, wchar_t*& wsToken, BOOL* pbLinear, double* pdVal) { - if ( &wsToken == nullptr || pbLinear == nullptr || pdVal == nullptr) + if ( &wsName == nullptr || &wsToken == nullptr || pbLinear == nullptr || pdVal == nullptr) return FALSE ; + string sName ; string sToken ; bool bLinear ; - if ( ! ExeSimGetAxisInfoPos( nI, sToken, bLinear, *pdVal)) + if ( ! ExeSimGetAxisInfoPos( nI, sName, sToken, bLinear, *pdVal)) return FALSE ; - wsToken = _wcsdup( stringtoW( sToken)) ; + wsName = _wcsdup( stringtoW( sName)) ; + wsToken = ( wsName != nullptr ? _wcsdup( stringtoW( sToken)) : nullptr) ; *pbLinear = ( bLinear ? TRUE : FALSE) ; - return (( wsToken == nullptr) ? FALSE : TRUE) ; + return (( wsName == nullptr || wsToken == nullptr) ? FALSE : TRUE) ; } //----------------------------------------------------------------------------- @@ -1419,6 +1421,24 @@ __stdcall EgtGetHeadExitCount( const wchar_t* wsHead) return ExeGetHeadExitCount( wstrztoA( wsHead)) ; } +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtGetAllHeadsNames( wchar_t*& wsNames) +{ + if ( &wsNames == nullptr) + return FALSE ; + STRVECTOR vNames ; + if ( ! ExeGetAllHeadsNames( vNames)) + return false ; + string sNames ; + for each ( const auto& sName in vNames) + sNames += sName + "," ; + if ( ! sNames.empty()) + sNames.pop_back() ; + wsNames = _wcsdup( stringtoW( sNames)) ; + return (( wsNames == nullptr) ? FALSE : TRUE) ; +} + //----------------------------------------------------------------------------- // Machine Calc //----------------------------------------------------------------------------- @@ -1487,6 +1507,13 @@ __stdcall EgtSetAxisPos( const wchar_t* wsAxis, double dVal) return ( ExeSetAxisPos( wstrztoA( wsAxis), dVal) ? TRUE : FALSE) ; } +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtGetAxisPos( const wchar_t* wsAxis, double* pdVal) +{ + return ( ExeGetAxisPos( wstrztoA( wsAxis), pdVal) ? TRUE : FALSE) ; +} + //----------------------------------------------------------------------------- BOOL __stdcall EgtLoadTool( const wchar_t* wsHead, int nExit, const wchar_t* wsTool) diff --git a/EgtInterface.rc b/EgtInterface.rc index 67a6375f3daccca716af8a403c5e819b62f436a1..0f5b100cb93f67ff0b400c085e2731fe55d2e9cb 100644 GIT binary patch delta 113 zcmX>XeJ*;#A2vpd%@4(HGEKh5na5}``6H+9WG^L)&3#f*jGK>e8!&^VPclv3Cs+lM i-t491#khHcFjUGNr~*ls7YjlI&*XKAP&0v=TDSq2At@CA delta 113 zcmX>XeJ*;#A2vqw%@4(HGEKh5na5~8`6H+9WG^L)&3#f*jGK>e8!&^VPclv3Cs+lM i-t491#khHcFjUGNr~*ls7YjlI&*XKAP&0v=TDSq0S1Anu