EgtInterface 1.6x8 :

- modificata interfaccia di EgtSimGetAxisInfoPos per aggiunta paramentro nome asse
- aggiunta interfaccia per EgtGetAllHeadsNames
- aggiunta interfaccia per EgtGetAxisPos.
This commit is contained in:
Dario Sassi
2017-01-30 08:08:12 +00:00
parent 6951d766a4
commit ad4abc9be9
2 changed files with 32 additions and 5 deletions
+32 -5
View File
@@ -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)