Include :

- aggiornamenti.
This commit is contained in:
Dario Sassi
2015-10-23 08:01:33 +00:00
parent 869ec96cc2
commit 6e58d72afc
5 changed files with 66 additions and 1 deletions
+22 -1
View File
@@ -7,7 +7,7 @@
//
//
// Modifiche : 20.11.13 DS Creazione modulo.
//
// 20.10.15 DS Agg. FromString e ToString per std::array<double,N>.
//
//----------------------------------------------------------------------------
@@ -16,6 +16,7 @@
#include "/EgtDev/Include/EgtStringBase.h"
#include "/EgtDev/Include/EgtNumCollection.h"
#include <algorithm>
#include <array>
//----------------------- Macro per import/export -----------------------------
#undef EGN_EXPORT
@@ -140,6 +141,19 @@ bool FromString( const std::string& sVal, double (&dVal)[size])
}
return ( errno == 0) ;
}
template <size_t size>
bool FromString( const std::string& sVal, std::array<double,size>& dVal)
{ const char* pStart = sVal.c_str() ;
char* pStop ;
errno = 0 ;
for ( int i = 0 ; i < size ; ++ i) {
dVal[i] = strtod( pStart, &pStop) ;
if ( ( i < size - 1 && *pStop != ',') || errno != 0)
return false ;
pStart = pStop + 1 ;
}
return ( errno == 0) ;
}
EGN_EXPORT bool FromString( const std::string& sVal, INTVECTOR& vnVal) ;
EGN_EXPORT bool FromString( const std::string& sVal, DBLVECTOR& vdVal) ;
EGN_EXPORT bool FromString( const std::string& sVal, STRVECTOR& vsVal) ;
@@ -183,6 +197,13 @@ const std::string ToString( const double (&dVal)[size], int nPrec = 6)
sDest += ToString( dV, nPrec) + "," ;
sDest.pop_back() ;
return sDest ; }
template <size_t size>
const std::string ToString( const std::array<double,size>& dVal, int nPrec = 6)
{ std::string sDest ; sDest.reserve( 14 * size) ;
for ( const auto& dV : dVal)
sDest += ToString( dV, nPrec) + "," ;
sDest.pop_back() ;
return sDest ; }
EGN_EXPORT const std::string ToString( const INTVECTOR& vnVal, int nPrec = 1) ;
EGN_EXPORT const std::string ToString( const DBLVECTOR& vdVal, int nPrec = 6) ;
EGN_EXPORT const std::string ToString( const STRVECTOR& vsVal) ;
+4
View File
@@ -482,6 +482,10 @@ EIN_EXPORT BOOL __stdcall EgtSetTable( const wchar_t* wsTable) ;
EIN_EXPORT BOOL __stdcall EgtGetTableRef1( double ptPos[3]) ;
EIN_EXPORT BOOL __stdcall EgtGetTableArea1( int* pnAreaId) ;
EIN_EXPORT BOOL __stdcall EgtShowOnlyTable( bool bVal) ;
EIN_EXPORT BOOL __stdcall EgtSimStart( void) ;
EIN_EXPORT BOOL __stdcall EgtSimMove( void) ;
EIN_EXPORT BOOL __stdcall EgtSimSetStep( double dStep) ;
EIN_EXPORT BOOL __stdcall EgtSimStop( void) ;
// Scene
EIN_EXPORT BOOL __stdcall EgtInitScene( HWND hWnd, int nDriver, BOOL b2Buff, int nColorBits, int nDepthBits) ;
+9
View File
@@ -78,6 +78,7 @@ class __declspec( novtable) IMachMgr
virtual bool GetAxisPos( const std::string& sAxis, double& dVal) = 0 ;
virtual bool GetAxisHomePos( const std::string& sAxis, double& dHomeVal) = 0 ;
virtual bool ResetAxisPos( const std::string& sAxis) = 0 ;
virtual bool ResetAllAxesPos( void) = 0 ;
virtual bool LoadTool( const std::string& sHead, int nExit, const std::string& sTool) = 0 ;
virtual bool ResetHeadSet( const std::string& sHead) = 0 ;
virtual bool SetCalcTable( const std::string& sTable) = 0 ;
@@ -100,6 +101,14 @@ class __declspec( novtable) IMachMgr
virtual bool SetMachiningParam( int nType, const std::string& sVal) = 0 ;
virtual bool SetMachiningGeometry( const SELVECTOR& vIds) = 0 ;
virtual bool Apply( void) = 0 ;
virtual int GetFirstOperation( void) const = 0 ;
virtual int GetNextOperation( int nId) const = 0 ;
virtual int GetOperationType( int nId) const = 0 ;
// Simulation
virtual bool SimStart( void) = 0 ;
virtual bool SimMove( void) = 0 ;
virtual bool SimSetStep( double dStep) = 0 ;
virtual bool SimStop( void) = 0 ;
} ;
//-----------------------------------------------------------------------------
+24
View File
@@ -0,0 +1,24 @@
//----------------------------------------------------------------------------
// EgalTech 2015-2015
//----------------------------------------------------------------------------
// File : EmkOperationConst.h Data : 12.10.15 Versione : 1.6j2
// Contenuto : Costanti delle operazioni.
//
//
//
// Modifiche : 12.10.15 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
//------------------------ Costanti per tipo Operazioni -----------------------
const int OPER_GEN = 0x100 ;
const int OPER_MACH = 0x200 ;
enum OperType { OPER_NULL = 0, // nulla
OPER_DISP = OPER_GEN + 0, // disposizione (256)
OPER_DRILLING = OPER_MACH + 0, // foratura (512)
OPER_SAWING = OPER_MACH + 1, // taglio di lama (513)
OPER_MILLING = OPER_MACH + 2} ; // fresatura (514)
+7
View File
@@ -519,6 +519,13 @@ EXE_EXPORT bool ExeSetMachiningParam( int nType, double dVal) ;
EXE_EXPORT bool ExeSetMachiningParam( int nType, const std::string& sVal) ;
EXE_EXPORT bool ExeSetMachiningGeometry( const SELVECTOR& vIds) ;
EXE_EXPORT bool ExeApplyMachining( void) ;
EXE_EXPORT int ExeGetFirstOperation( void) ;
EXE_EXPORT int ExeGetNextOperation( int nId) ;
EXE_EXPORT int ExeGetOperationType( int nId) ;
EXE_EXPORT bool ExeSimStart( void) ;
EXE_EXPORT bool ExeSimMove( void) ;
EXE_EXPORT bool ExeSimSetStep( double dStep) ;
EXE_EXPORT bool ExeSimStop( void) ;
// Scene
EXE_EXPORT bool ExeInitScene( HWND hWnd, int nDriver, bool b2Buff, int nColorBits, int nDepthBits) ;