本文整理汇总了C++中CDate::Convert2DSM方法的典型用法代码示例。如果您正苦于以下问题:C++ CDate::Convert2DSM方法的具体用法?C++ CDate::Convert2DSM怎么用?C++ CDate::Convert2DSM使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDate
的用法示例。
在下文中一共展示了CDate::Convert2DSM方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ComputeHighResolutionFields
//----------------------------------------
void CProductJason::ComputeHighResolutionFields(CDataSet* dataSet, double deltaLat, double deltaLon)
{
// Save current recordset pointer
CRecordSet* currentRecordSetOld = dataSet->GetCurrentRecordSet();
//dataSet->SetCurrentRecordSet(dataSet->GetFirstRecordSet());
CFieldSetDbl *fieldSetLat = NULL;
CFieldSetDbl *fieldSetLon = NULL;
CFieldSetDbl *fieldSetTimeStampDay = NULL;
CFieldSetDbl *fieldSetTimeStampSecond = NULL;
CFieldSetDbl *fieldSetTimeStampMicrosecond = NULL;
size_t count = dataSet->size();
for (size_t index = 0 ; index < count ; index++)
{
dataSet->SetCurrentRecordSet(index);
fieldSetLat = dataSet->GetFieldSetAsDbl( m_fieldNameEquivalence.Exists(m_latitudeFieldName) );
fieldSetLon = dataSet->GetFieldSetAsDbl( m_fieldNameEquivalence.Exists(m_longitudeFieldName) );
fieldSetTimeStampDay = dataSet->GetFieldSetAsDbl( m_fieldNameEquivalence.Exists(m_timeStampDayFieldName) );
fieldSetTimeStampSecond = dataSet->GetFieldSetAsDbl( m_fieldNameEquivalence.Exists(m_timeStampSecondFieldName) );
fieldSetTimeStampMicrosecond = dataSet->GetFieldSetAsDbl( m_fieldNameEquivalence.Exists(m_timeStampMicrosecondFieldName) );
// Compute latitude
if (fieldSetLat != NULL)
{
fieldSetLat->m_value = CTools::Plus(fieldSetLat->m_value,
CTools::Multiply(deltaLat,
static_cast<double>(index - m_refPoint)));
}
// Compute longitude
if (fieldSetLon != NULL)
{
//fieldSetLon->m_value = CTools::NormalizeLongitude(-180,
// CTools::Plus(fieldSetLon->m_value,
// CTools::Multiply(deltaLon,
// static_cast<double>(index - m_refPoint))));
fieldSetLon->m_value = CTools::Plus(fieldSetLon->m_value,
CTools::Multiply(deltaLon,
static_cast<double>(index - m_refPoint)));
}
// Compute timestamp
// WARNING - fieldSetTimeStampDay, fieldSetTimeStampSecond, fieldSetTimeStampMicrosecond are converted to SI
// after they have been read. So their value are stated in seconds
// fieldSetTimeStampDay = number of seconds from reference SI unit (i.e. 1950-01-01 00:00:00.0)
// fieldSetTimeStampSecond = number of seconds within the day
// fieldSetTimeStampMicrosecond = number of seconds within the seconds ( < 1 second)
double nbSeconds = 0;
if (fieldSetTimeStampDay != NULL)
{
nbSeconds = CTools::Plus(nbSeconds, fieldSetTimeStampDay->m_value);
}
if (fieldSetTimeStampSecond != NULL)
{
nbSeconds = CTools::Plus(nbSeconds, fieldSetTimeStampSecond->m_value);
}
if (fieldSetTimeStampMicrosecond != NULL)
{
nbSeconds = CTools::Plus(nbSeconds, fieldSetTimeStampMicrosecond->m_value);
}
nbSeconds = CTools::Plus(nbSeconds,
CTools::Multiply(m_deltaTimeHighResolution,
static_cast<double>(index - m_refPoint)));
CDate timeStamp;
//timeStamp.SetDate(nbSeconds, m_refDate);
timeStamp.SetDate(nbSeconds);
double days;
double seconds;
double muSeconds;
//WARNING At this point, fieldSetTimeStampDay is stated in number of day,
// fieldSetTimeStampSecond in number of seconds and fieldSetTimeStampMicrosecond in numbers of microseconds
timeStamp.Convert2DSM(days,
seconds,
muSeconds);
//std::string str = timeStamp.AsString();
// WARNING - convert fieldSetTimeStampDay, fieldSetTimeStampSecond, fieldSetTimeStampMicrosecond in SI
// after they have been read. So their value are stated in seconds
//.........这里部分代码省略.........