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 67a6375..0f5b100 100644 Binary files a/EgtInterface.rc and b/EgtInterface.rc differ