From bcf85c02465dcfbfd5c901da066d6eae9215c45f Mon Sep 17 00:00:00 2001 From: DarioS Date: Tue, 13 Sep 2022 08:16:30 +0200 Subject: [PATCH] EgtInterface 2.4h2 : - aggiunte interfacce per EgtGetMachines e EgtGetCurrMachineDir. --- API_MachMgr.cpp | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ EgtInterface.rc | Bin 11718 -> 11718 bytes 2 files changed, 48 insertions(+) diff --git a/API_MachMgr.cpp b/API_MachMgr.cpp index bb966b3..283cd1d 100644 --- a/API_MachMgr.cpp +++ b/API_MachMgr.cpp @@ -60,6 +60,41 @@ __stdcall EgtGetMachMgrWarningString( int nInd) //----------------------------------------------------------------------------- // Machines +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtGetMachines( wchar_t*& wsMachineNames, wchar_t*& wsMachineDirs) +{ + if ( &wsMachineNames == nullptr || &wsMachineDirs == nullptr) + return FALSE ; + STRVECTOR vsMachineNames ; + STRVECTOR vsMachineDirs ; + if ( ! ExeGetMachines( vsMachineNames, vsMachineDirs)) + return FALSE ; + // restituzione vettore nomi + string sMachineNames ; + for ( const auto& sName : vsMachineNames) { + if ( ! sMachineNames.empty()) + sMachineNames += "\n" ; + sMachineNames += sName ; + } + 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 ; + } + wsMachineDirs = _wcsdup( stringtoW( sMachineDirs)) ; + if ( wsMachineDirs == nullptr) { + free( wsMachineNames) ; + return FALSE ; + } + return TRUE ; +} + //----------------------------------------------------------------------------- BOOL __stdcall EgtSetCurrMachine( const wchar_t* wsMachineName) @@ -80,6 +115,19 @@ __stdcall EgtGetCurrMachineName( wchar_t*& wsMachineName) return (( wsMachineName == nullptr) ? FALSE : TRUE) ; } +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtGetCurrMachineDir( wchar_t*& wsMachineDir) +{ + if ( &wsMachineDir == nullptr) + return FALSE ; + string sMachineDir ; + if ( ! ExeGetCurrMachineDir( sMachineDir)) + return FALSE ; + wsMachineDir = _wcsdup( stringtoW( sMachineDir)) ; + return (( wsMachineDir == nullptr) ? FALSE : TRUE) ; +} + //----------------------------------------------------------------------------- // Machining Groups //----------------------------------------------------------------------------- diff --git a/EgtInterface.rc b/EgtInterface.rc index 2ec13d7a5487e3a3d5c71e061826e73db8dfa0dc..4d66dbeb87d726edfd383ac75f6fa0b304affb25 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{