void Radiometric::CreateLookupTable(){ int tableSz = (1 << MAXDATABITS) +1 ; delete (char *)Table; Table = new char [tableSz* WordSize[WordType] ]; for(short i = 0; i < tableSz; i++) CopyToTable(i, getRadiometric(i), Table); CopyToTable((short) tableSz-1, MapDot, Table); }
/* SELECT <_pcFlt> FROM <m_strTableName> WHERE <_pcKey> */ bool SqlTable::Query(const CMyStr& strQuery, TTable* _pTable ) { std::cerr << strQuery << std::endl; MYSQL_RES* pRes = m_sqlBase.Query( strQuery.c_str() ); if (pRes == 0) return false; CopyToTable(_pTable, pRes); m_sqlBase.FreeRes( pRes ); return true; }
/* SELECT <_pcFlt> FROM <m_strTableName> WHERE <_pcKey> */ bool SqlTable::Select(const char* _pcFlt, const char* _pcKey, TTable* _pTable ) { CMyStr strQuery; strQuery = "SELECT "+CMyStr( _pcFlt )+" FROM "+m_strTableName+" WHERE "+CMyStr( _pcKey ); std::cerr << strQuery << std::endl; MYSQL_RES* pRes = m_sqlBase.Query( strQuery.c_str() ); if (pRes == 0) return false; CopyToTable(_pTable, pRes); m_sqlBase.FreeRes( pRes ); return true; }
/* SELECT <_pcFlt> FROM <m_strTableName> WHERE <_pcKey> ='< _pcVal>' */ bool SqlTable::Select(const char* _pcFlt, const char* _pcKey,const char* _pcVal, TTable* _pTable ) { CMyStr strQuery; strQuery = "SELECT "+CMyStr( _pcFlt )+" FROM "+m_strTableName+" WHERE "+CMyStr( _pcKey ); if (_pcVal != 0) strQuery = strQuery + "='" + CMyStr( _pcVal ) + "'" ; else strQuery = strQuery + " IS NULL"; MYSQL_RES* pRes = m_sqlBase.Query( strQuery.c_str() ); if (pRes == 0) return false; CopyToTable(_pTable, pRes); m_sqlBase.FreeRes( pRes ); return true; }
void * Radiometric::convert(unsigned short kounts){ memset(& Cnvrt, 0, 4); CopyToTable(0, getRadiometric(kounts), & Cnvrt) ; return(& Cnvrt); }