本文整理汇总了C++中CUnit::IsDate方法的典型用法代码示例。如果您正苦于以下问题:C++ CUnit::IsDate方法的具体用法?C++ CUnit::IsDate怎么用?C++ CUnit::IsDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUnit
的用法示例。
在下文中一共展示了CUnit::IsDate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetAnimationDescr
//----------------------------------------
void CXYPlotPanel::SetAnimationDescr(uint32_t indexValue)
{
if (m_plotDataCollection == NULL)
{
return;
}
// glbSizerAnimationDescr->Hide(m_animationToolbar->GetDescr());
m_animationToolbar->GetDescr()->SetLabel("");
if (m_plotDataCollection->size() <= 0)
{
return;
}
wxString descr;
uint32_t nData = m_plotDataCollection->size();
for (uint32_t i = 0 ; i < nData ; i++)
{
CXYPlotData* data = m_plotDataCollection->Get(i);
if (data->GetVarComplement().GetNbValues() <= 0)
{
continue;
}
CFieldNetCdf& field = data->GetFieldComplement();
string fieldDescr = field.GetMostExplicitName();
string strUnit = field.GetUnit();
CUnit* unit = field.GetNetCdfUnit();
uint32_t index = indexValue;
if (index >= data->GetVarComplement().GetNbValues())
{
index = data->GetVarComplement().GetNbValues() - 1;
}
if (unit->IsDate())
{
CDate d1950_01_01 = unit->ConvertToBaseUnit(data->GetVarComplement().GetValues()[index]);
descr.Append(wxString::Format("'%s' value for above plot: %s (field '%s')\n",
fieldDescr.c_str(),
d1950_01_01.AsString("", true).c_str(),
data->GetName().c_str()));
}
else
{
descr.Append(wxString::Format("'%s' value for above plot: %f %s (field '%s')\n",
fieldDescr.c_str(),
data->GetVarComplement().GetValues()[index],
strUnit.c_str(),
data->GetName().c_str()));
}
uint32_t iOtherFields = 0;
const CObArray& otherFields = data->GetOtherFields();
//const vector<CExpressionValue>& otherData = data->GetOtherVars();
const CObArray& otherData = data->GetOtherVars();
//otherFields.Dump(*(CTrace::GetInstance()->GetDumpContext()));
for (iOtherFields = 0 ; iOtherFields < otherFields.size() ; iOtherFields++)
{
CFieldNetCdf* field = dynamic_cast<CFieldNetCdf*>(otherFields.at(iOtherFields));
if (field == NULL)
{
continue;
}
string fieldDescr = field->GetMostExplicitName();
string strUnit = field->GetUnit();
CUnit* unit = field->GetNetCdfUnit();
uint32_t index = indexValue;
CExpressionValue* exprValue = CExpressionValue::GetExpressionValue(otherData.at(iOtherFields));
if (index >= exprValue->GetNbValues())
{
index = exprValue->GetNbValues() - 1;
}
if (unit->IsDate())
{
CDate d1950_01_01 = unit->ConvertToBaseUnit(exprValue->GetValues()[index]);
descr.Append(wxString::Format("'%s' value for above plot: %s (field '%s')\n",
fieldDescr.c_str(),
d1950_01_01.AsString("", true).c_str(),
data->GetName().c_str()));
}
else
//.........这里部分代码省略.........