Example #1
0
SIUnit createSITime() {
  return SIUnit(SIExpnt(0,0,1));
}
Example #2
0
SIUnit createSIThermalConductance() {
  return SIUnit(SIExpnt(1,0,-3,-1),0,"W/m^2*K");
}
Example #3
0
SIUnit createSIHeatCapacity() {
  return SIUnit(SIExpnt(1,0,-2,-1),0,"J/m^2*K");
}
Example #4
0
SIUnit createSIEnergyUseIntensity() {
  return SIUnit(SIExpnt(1,0,-2),0,"J/m^2");
}
Example #5
0
SIUnit createSIPowerPerPerson() {
  return SIUnit(SIExpnt(1,2,-3,0,0,0,0,0,0,-1),0,"W/person");
}
Example #6
0
SIUnit createSIInductance() {
  return SIUnit(SIExpnt(1,2,-2,0,-2),0,"H");
}
Example #7
0
SIUnit createSIIlluminance() {
  return SIUnit(SIExpnt(0,-2,0,0,0,1,0,0,1),0,"lux");
}
Example #8
0
SIUnit createSIPeople() {
  return SIUnit(SIExpnt(0,0,0,0,0,0,0,0,0,1));
}
Example #9
0
SIUnit createSICycle() {
  return SIUnit(SIExpnt(0,0,0,0,0,0,0,0,0,0,1));
}
Example #10
0
SIUnit createSIAmountOfSubstance() {
  return SIUnit(SIExpnt(0,0,0,0,0,0,1));
}
Example #11
0
SIUnit createSISolidAngle() {
  return SIUnit(SIExpnt(0,0,0,0,0,0,0,0,1));
}
Example #12
0
SIUnit createSILuminousIntensity() {
  return SIUnit(SIExpnt(0,0,0,0,0,1));
}
Example #13
0
SIUnit createSIElectricCurrent() {
  return SIUnit(SIExpnt(0,0,0,0,1));
}
Example #14
0
SIUnit createSITemperature() {
  return SIUnit(SIExpnt(0,0,0,1));
}
Example #15
0
SIUnit createSIMagneticFlux() {
  return SIUnit(SIExpnt(1,2,-2,0,-1),0,"Wb");
}
Example #16
0
SIUnit createSIForce() {
  return SIUnit(SIExpnt(1,1,-2),0,"N");
}
Example #17
0
SIUnit createSIMagneticFieldStrength() {
  return SIUnit(SIExpnt(1,0,-2,0,-1),0,"T");
}
Example #18
0
SIUnit createSIEnergy() {
  return SIUnit(SIExpnt(1,2,-2),0,"J");
}
Example #19
0
SIUnit createSILuminousFlux() {
  return SIUnit(SIExpnt(0,0,0,0,0,1,0,0,1),0,"lm");
}
Example #20
0
SIUnit createSIPower() {
  return SIUnit(SIExpnt(1,2,-3),0,"W");
}
Example #21
0
SIUnit createSIFrequency() {
  return SIUnit(SIExpnt(0,0,-1,0,0,0,0,0,0,0,1),0,"Hz");
}
Example #22
0
SIUnit createSIElectricCharge() {
  return SIUnit(SIExpnt(0,0,1,0,1),0,"C");
}
Example #23
0
SIUnit createSIPowerDensity() {
  return SIUnit(SIExpnt(1,0,-3),0,"W/m^2");
}
Example #24
0
SIUnit createSIElectricalPotential() {
  return SIUnit(SIExpnt(1,2,-3,0,-1),0,"V");
}
Example #25
0
SIUnit createSIPressure() {
  return SIUnit(SIExpnt(1,-1,-2),0,"Pa");
}
Example #26
0
SIUnit createSIElectricCapacitance() {
  return SIUnit(SIExpnt(-1,-2,4,0,2),0,"F");
}
Example #27
0
SIUnit createSIThermalResistance() {
  return SIUnit(SIExpnt(-1,0,3,1),0,"m^2*K/W");
}
Example #28
0
SIUnit createSIElectricResistance() {
  return SIUnit(SIExpnt(1,2,-3,0,-2),0,"ohm");
}
Example #29
0
boost::optional<Unit> ScheduleTypeLimits::units(std::string unitType, bool returnIP) {
  boost::to_lower(unitType);
  OptionalUnit result;

  if (unitType.empty() ||
      (unitType == "dimensionless") ||
      (unitType == "availability") ||
      (unitType == "controlmode"))
  {
    if (returnIP) {
      result = IPUnit();
    }
    else {
      result = SIUnit();
    }
    return result;
  }

  char firstLetter = unitType[0];
  switch (firstLetter) {
  case 'a' :
    {
      if (unitType == "activitylevel") {
        result = (createSIPower() / createSIPeople());
      }
      else if (unitType == "angle") {
        result = createIPAngle();
      }
      break;
    }
  case 'c' :
    {
      if (unitType == "capacity") {
        if (returnIP) {
          result = BTUUnit(BTUExpnt(1,0,-1));
        }
        else {
          result = createSIPower();
        }
      }
      else if (unitType == "clothinginsulation") {
        result = Unit();
        result->setBaseUnitExponent("clo",1);
      }
      else if (unitType == "convectioncoefficient") {
        if (returnIP) {
          result = BTUUnit(BTUExpnt(1,-2,-1,-1));
        }
        else {
          result = createSIThermalConductance();
        }
      }
      break;
    }
  case 'd' :
    {
      if (unitType == "deltatemperature") {
        if (returnIP) {
          result = createFahrenheitTemperature();
          result->cast<TemperatureUnit>().setAsRelative();
        }
        else {
          result = createCelsiusTemperature();
          result->cast<TemperatureUnit>().setAsRelative();
        }
      }
      break;
    }
  case 'l' :
    {
      if (unitType == "linearpowerdensity") {
        if (returnIP) {
          result = (createIPPower() / createIPLength());
        }
        else {
          result = (createSIPower() / createSILength());
        }
      }
      break;
    }
  case 'm' :
    {
      if (unitType == "massflowrate") {
        if (returnIP) {
          result = IPUnit(IPExpnt(1,0,-1));
        }
        else {
          result = SIUnit(SIExpnt(1,0,-1));
        }
      }
      break;
    }
  case 'p' :
    {
      if (unitType == "percent") {
        result = Unit();
        result->setBaseUnitExponent("%",1);
      }
      else if (unitType == "power") {
        result = createSIPower();
      }
      else if (unitType == "precipitationrate") {
        if (returnIP) {
          result = BTUUnit(BTUExpnt(0,1,-1));
        }
        else {
          result = WhUnit(WhExpnt(0,-1,1));
        }
      }
      else if (unitType == "pressure") {
        if (returnIP) {
          result = createIPPressure();
        }
        else {
          result = createSIPressure();
        }
      }
      break;
    }
  case 'r' :
    {
      if (unitType == "rotationsperminute") {
        result = createCFMFrequency();
      }
      break;
    }
  case 's' :
    {
      if (unitType == "solarenergy") {
        result = WhUnit(WhExpnt(1,1,-2));
      }
      break;
    }
  case 't' :
    {
      if (unitType == "temperature") {
        if (returnIP) {
          result = createFahrenheitTemperature();
        }
        else {
          result = createCelsiusTemperature();
        }
      }
      break;
    }
  case 'v' :
    {
      if (unitType == "velocity") {
        if (returnIP) {
          result = CFMUnit(CFMExpnt(1,-1));
        }
        else {
          result = SIUnit(SIExpnt(0,1,-1));
        }
      }
      if (unitType == "volumetricflowrate") {
        if (returnIP) {
          result = IPUnit(IPExpnt(0,3,-1));
        }
        else {
          result = SIUnit(SIExpnt(0,3,-1));
        }
      }
      break;
    }
  }

  return result;
}
Example #30
0
SIUnit createSILength() {
  return SIUnit(SIExpnt(0,1));
}