Exemplo n.º 1
0
/**
 * \brief      Converts the DOUBLE physical values to INT64 RAW values
 * \param[in]  dMaxVal Maximum physical value
 * \param[in]  dMinVal Minimum physical value
 * \param[in]  dOffset Offset Value
 * \param[in]  dScaleFactor Scaling Factor
 * \param[out] nMaxVal Maximum RAW value
 * \param[out] nMinVal Minimum RAW value
 *
 * Converts the DOUBLE physical values to INT64 RAW values.
 */
int nConvertPhysicalToRaw(double dMaxVal, double dMinVal, double dOffset, double dScaleFactor, long long int& nMaxVal, long long int& nMinVal)
{
    double dTempMaxVal = ((dMaxVal - dOffset) / dScaleFactor);
    double dTempMinVal = ((dMinVal - dOffset) / dScaleFactor);
    nMaxVal = (long long int)unRoundOffdoubleValue(dTempMaxVal);
    nMinVal = (long long int)unRoundOffdoubleValue(dTempMinVal);
    return 0;
}
Exemplo n.º 2
0
/**
 * \brief      Converts the DOUBLE physical values to UINT64 RAW values
 * \param[in]  dMaxVal Maximum physical value
 * \param[in]  dMinVal Minimum physical value
 * \param[in]  dOffset Offset value
 * \param[in]  dScaleFactor Scaling Factor
 * \param[out] unMaxVal Maximum RAW value
 * \param[out] unMinVal Minimum RAW value
 *
 * Converts the DOUBLE physical values to UINT64 RAW values.
 */
unsigned int unConvertPhysicalToRaw(double dMaxVal, double dMinVal, double dOffset, double dScaleFactor, unsigned long long int& unMaxVal, unsigned long long int& unMinVal)
{
    double dTempMaxVal = ((dMaxVal - dOffset) / dScaleFactor);
    double dTempMinVal = ((dMinVal - dOffset) / dScaleFactor);
    unMaxVal = (unsigned long long int)unRoundOffdoubleValue(dTempMaxVal);
    unMinVal = (unsigned long long int)unRoundOffdoubleValue(dTempMinVal);
    return 0;
}
Exemplo n.º 3
0
/**
* \brief      Converts the DOUBLE physical values to INT64 RAW values
* \param[in]  DOUBLE dMaxVal, Maximum physical value
*             DOUBLE dMinVal, Minimum physical value
*             DOUBLE dOffset, Offset Value
*             DOUBLE dScalFactor, Scaling Factor
* \param[out] UINT64& unMaxVal, UIN64 Maximum vlaue
*             UINT64& unMinVal, UINT64 Minimum RAW value    
* \return     INT   
* \authors    Venkatanarayana Makam
* \date       27.07.2011
*/
INT nConvertPhysicalToRaw(DOUBLE dMaxVal, DOUBLE dMinVal, DOUBLE dOffset, DOUBLE dScalFactor, INT64& nMaxVal, INT64& nMinVal)
{
    double dTempMaxVal = ((dMaxVal - dOffset) / dScalFactor);
    double dTempMinVal = ((dMinVal - dOffset) / dScalFactor);

    nMaxVal = (INT64)unRoundOffdoubleValue(dTempMaxVal);
    nMinVal = (INT64)unRoundOffdoubleValue(dTempMinVal);
    return 0;
}