mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 15:25:35 +08:00
Unit tests for acceleration and more for vector
This commit is contained in:
@@ -276,13 +276,15 @@ template <class MU, class PQ> bool CPhysicalQuantity<MU, PQ>::operator <=(const
|
||||
/*
|
||||
* Switch to another unit
|
||||
*/
|
||||
template <class MU, class PQ> CPhysicalQuantity<MU, PQ> &CPhysicalQuantity<MU, PQ>::switchUnit(const MU &newUnit)
|
||||
template <class MU, class PQ> PQ &CPhysicalQuantity<MU, PQ>::switchUnit(const MU &newUnit)
|
||||
{
|
||||
if (this->m_unit == newUnit) return *this;
|
||||
double cf = this->m_unit.conversionToUnit(this->m_unitValueD, newUnit);
|
||||
this->m_unit = newUnit;
|
||||
this->setUnitValue(cf);
|
||||
return *this;
|
||||
if (this->m_unit != newUnit)
|
||||
{
|
||||
double cf = this->m_unit.conversionToUnit(this->m_unitValueD, newUnit);
|
||||
this->m_unit = newUnit;
|
||||
this->setUnitValue(cf);
|
||||
}
|
||||
return static_cast<PQ &>(*this);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -407,6 +409,7 @@ template class CPhysicalQuantity<CTemperatureUnit, CTemperature>;
|
||||
template class CPhysicalQuantity<CSpeedUnit, CSpeed>;
|
||||
template class CPhysicalQuantity<CAngleUnit, CAngle>;
|
||||
template class CPhysicalQuantity<CTimeUnit, CTime>;
|
||||
template class CPhysicalQuantity<CAccelerationUnit, CAcceleration>;
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user