From 92769d67837686d0bc54a8eb9382fcdb07aa84e2 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Sat, 22 Mar 2025 18:07:41 +0100 Subject: [PATCH] EgtInterface 2.7c2 : - aggiunta interfaccia funzione EgtGetAllInfo - piccola miglioria accodamento stringhe con separatore '\n'. --- API_GdbObjAttribs.cpp | 19 +++++++++++++++ API_MachMgr.cpp | 54 +++++++++++++++++++----------------------- EgtInterface.rc | Bin 11718 -> 11718 bytes 3 files changed, 43 insertions(+), 30 deletions(-) diff --git a/API_GdbObjAttribs.cpp b/API_GdbObjAttribs.cpp index 0ecf6c2..d69d1cc 100644 --- a/API_GdbObjAttribs.cpp +++ b/API_GdbObjAttribs.cpp @@ -426,6 +426,25 @@ __stdcall EgtGetInfoFrame( int nId, const wchar_t* wsKey, double ptOrig[3], return TRUE ; } +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtGetAllInfo( int nId, wchar_t*& wsInfos) +{ + if ( &wsInfos == nullptr) + return FALSE ; + STRVECTOR vsInfo ; + if ( ! ExeGetAllInfo( nId, vsInfo)) + return FALSE ; + // restituzione vettore risultati + string sInfos ; + for ( const auto& sInfo : vsInfo) + sInfos += sInfo + "\n" ; + if ( ! sInfos.empty()) + sInfos.pop_back() ; + wsInfos = _wcsdup( stringtoW( sInfos)) ; + return (( wsInfos == nullptr) ? FALSE : TRUE) ; +} + //----------------------------------------------------------------------------- BOOL __stdcall EgtExistsInfo( int nId, const wchar_t* wsKey) diff --git a/API_MachMgr.cpp b/API_MachMgr.cpp index b5ac2b2..18c5a29 100644 --- a/API_MachMgr.cpp +++ b/API_MachMgr.cpp @@ -72,21 +72,19 @@ __stdcall EgtGetMachines( wchar_t*& wsMachineNames, wchar_t*& wsMachineDirs) return FALSE ; // restituzione vettore nomi string sMachineNames ; - for ( const auto& sName : vsMachineNames) { - if ( ! sMachineNames.empty()) - sMachineNames += "\n" ; - sMachineNames += sName ; - } + for ( const auto& sName : vsMachineNames) + sMachineNames += sName + "\n" ; + if ( ! sMachineNames.empty()) + sMachineNames.pop_back() ; wsMachineNames = _wcsdup( stringtoW( sMachineNames)) ; if ( wsMachineNames == nullptr) return FALSE ; // restituzione vettore direttori string sMachineDirs ; - for ( const auto& sName : vsMachineDirs) { - if ( ! sMachineDirs.empty()) - sMachineDirs += "\n" ; - sMachineDirs += sName ; - } + for ( const auto& sName : vsMachineDirs) + sMachineDirs += sName + "\n" ; + if ( ! sMachineDirs.empty()) + sMachineDirs.pop_back() ; wsMachineDirs = _wcsdup( stringtoW( sMachineDirs)) ; if ( wsMachineDirs == nullptr) { free( wsMachineNames) ; @@ -1019,11 +1017,10 @@ __stdcall EgtTdbToBeImported( const wchar_t* wsFile, wchar_t*& wsToolsNames, int return FALSE ; // restituzione vettore nomi string sToolsNames ; - for ( const auto& sName : vsToolsNames) { - if ( ! sToolsNames.empty()) - sToolsNames += "\n" ; - sToolsNames += sName ; - } + for ( const auto& sName : vsToolsNames) + sToolsNames += sName + "\n" ; + if ( ! sToolsNames.empty()) + sToolsNames.pop_back() ; wsToolsNames = _wcsdup( stringtoW( sToolsNames)) ; if ( wsToolsNames == nullptr) return FALSE ; @@ -1061,11 +1058,10 @@ __stdcall EgtTdbImport( const wchar_t* wsFile, const wchar_t* wsToolsToImport, c if ( ! ExeTdbImport( string( wstrztoA( wsFile)), vsToolsToImport, vsToolsNames, vsImported)) return FALSE ; string sImported ; - for ( const auto& sName : vsImported) { - if ( ! sImported.empty()) - sImported += "\n" ; - sImported += sName ; - } + for ( const auto& sName : vsImported) + sImported += sName + "\n" ; + if ( ! sImported.empty()) + sImported.pop_back() ; wsImported = _wcsdup( stringtoW( sImported)) ; return (( wsImported == nullptr) ? FALSE : TRUE) ; } @@ -1369,11 +1365,10 @@ __stdcall EgtMdbToBeImported( const wchar_t* wsFile, wchar_t*& wsMachiningsNames return FALSE ; // restituzione vettore nomi string sMachiningsNames ; - for ( const auto& sName : vsMachiningsNames) { - if ( ! sMachiningsNames.empty()) - sMachiningsNames += "\n" ; - sMachiningsNames += sName ; - } + for ( const auto& sName : vsMachiningsNames) + sMachiningsNames += sName + "\n" ; + if ( ! sMachiningsNames.empty()) + sMachiningsNames.pop_back() ; wsMachiningsNames = _wcsdup( stringtoW( sMachiningsNames)) ; if ( wsMachiningsNames == nullptr) return FALSE ; @@ -1411,11 +1406,10 @@ __stdcall EgtMdbImport( const wchar_t* wsFile, const wchar_t* wsMachiningsToImpo if ( ! ExeMdbImport( string( wstrztoA( wsFile)), vsMachiningsToImport, vsMachiningsNames, vsImported)) return FALSE ; string sImported ; - for ( const auto& sName : vsImported) { - if ( ! sImported.empty()) - sImported += "\n" ; - sImported += sName ; - } + for ( const auto& sName : vsImported) + sImported += sName + "\n" ; + if ( ! sImported.empty()) + sImported.pop_back() ; wsImported = _wcsdup( stringtoW( sImported)) ; return (( wsImported == nullptr) ? FALSE : TRUE) ; } diff --git a/EgtInterface.rc b/EgtInterface.rc index 18ce3bfb96bc5725c9bd859197dea4441c0a42f2..cde14c85175d744b08266b1bab8cb65b48522f0a 100644 GIT binary patch delta 111 zcmX>WeJpyzFE&P_%^&$rGEF|hS;uHJ`Jtfh<^rw;7OzIAO+TQQ4Xt~E@c}o07g?Nt^fc4 delta 111 zcmX>WeJpyzFE&QQ%^&$rGEF|hS;uHN`Jtfh<^rw;7OzIAO+TQQ4Xt~E@c}o07PdfrT_o{