From 6e58d72afca95919ee103ed32092f8c0bd1e4d94 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Fri, 23 Oct 2015 08:01:33 +0000 Subject: [PATCH] Include : - aggiornamenti. --- EGnStringUtils.h | 23 ++++++++++++++++++++++- EInAPI.h | 4 ++++ EMkMachMgr.h | 9 +++++++++ EMkOperationConst.h | 24 ++++++++++++++++++++++++ EXeExecutor.h | 7 +++++++ 5 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 EMkOperationConst.h diff --git a/EGnStringUtils.h b/EGnStringUtils.h index 1471187..29ed1e4 100644 --- a/EGnStringUtils.h +++ b/EGnStringUtils.h @@ -7,7 +7,7 @@ // // // Modifiche : 20.11.13 DS Creazione modulo. -// +// 20.10.15 DS Agg. FromString e ToString per std::array. // //---------------------------------------------------------------------------- @@ -16,6 +16,7 @@ #include "/EgtDev/Include/EgtStringBase.h" #include "/EgtDev/Include/EgtNumCollection.h" #include +#include //----------------------- Macro per import/export ----------------------------- #undef EGN_EXPORT @@ -140,6 +141,19 @@ bool FromString( const std::string& sVal, double (&dVal)[size]) } return ( errno == 0) ; } +template +bool FromString( const std::string& sVal, std::array& 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 +const std::string ToString( const std::array& 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) ; diff --git a/EInAPI.h b/EInAPI.h index 5638f40..8970081 100644 --- a/EInAPI.h +++ b/EInAPI.h @@ -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) ; diff --git a/EMkMachMgr.h b/EMkMachMgr.h index 82fcb6d..940abfb 100644 --- a/EMkMachMgr.h +++ b/EMkMachMgr.h @@ -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 ; } ; //----------------------------------------------------------------------------- diff --git a/EMkOperationConst.h b/EMkOperationConst.h new file mode 100644 index 0000000..b4cc34a --- /dev/null +++ b/EMkOperationConst.h @@ -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) + diff --git a/EXeExecutor.h b/EXeExecutor.h index 2e9b156..48d11ce 100644 --- a/EXeExecutor.h +++ b/EXeExecutor.h @@ -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) ;