本文整理汇总了C++中openstudio::createSILength方法的典型用法代码示例。如果您正苦于以下问题:C++ openstudio::createSILength方法的具体用法?C++ openstudio::createSILength怎么用?C++ openstudio::createSILength使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openstudio
的用法示例。
在下文中一共展示了openstudio::createSILength方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createSIMass
TEST_F(UnitsFixture,SIUnit_createFunctions)
{
SIUnit u;
u = createSIMass();
EXPECT_EQ(1,u.baseUnitExponent("kg"));
EXPECT_EQ(0,u.scale().exponent);
EXPECT_EQ("kg",u.standardString());
EXPECT_EQ("",u.prettyString());
u = createSILength();
EXPECT_EQ(1,u.baseUnitExponent("m"));
EXPECT_EQ(0,u.scale().exponent);
EXPECT_EQ("m",u.standardString());
EXPECT_EQ("",u.prettyString());
u = createSITime();
EXPECT_EQ(1,u.baseUnitExponent("s"));
EXPECT_EQ(0,u.scale().exponent);
EXPECT_EQ("s",u.standardString());
EXPECT_EQ("",u.prettyString());
u = createSITemperature();
EXPECT_EQ(1,u.baseUnitExponent("K"));
EXPECT_EQ(0,u.scale().exponent);
EXPECT_EQ("K",u.standardString());
EXPECT_EQ("",u.prettyString());
u = createSIPeople();
EXPECT_EQ(1,u.baseUnitExponent("people"));
EXPECT_EQ(0,u.scale().exponent);
EXPECT_EQ("people",u.standardString());
EXPECT_EQ("",u.prettyString());
u.pow(-1);
EXPECT_EQ("1/person",u.standardString());
u = createSIForce();
EXPECT_EQ(0,u.scale().exponent);
EXPECT_EQ("kg*m/s^2",u.standardString());
EXPECT_EQ("N",u.prettyString());
u = createSIEnergy();
EXPECT_EQ(0,u.scale().exponent);
EXPECT_EQ("kg*m^2/s^2",u.standardString());
EXPECT_EQ("J",u.prettyString());
u = createSIPower();
EXPECT_EQ(0,u.scale().exponent);
EXPECT_EQ("kg*m^2/s^3",u.standardString());
EXPECT_EQ("W",u.prettyString());
}