Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Irrelevant unit type warnings suppressed #1327

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 20 additions & 19 deletions Revit_Core_Engine/Objects/SpecTypeId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@


using Autodesk.Revit.DB;
using BH.oM.Base.Attributes;
using System.ComponentModel;

#if (REVIT2018 || REVIT2019 || REVIT2020)
Expand Down Expand Up @@ -166,27 +167,27 @@ public static partial class SpecTypeId
public static UnitType PipingTemperatureDifference { get { return UnitType.UT_Piping_TemperatureDifference; } }
public static UnitType ElectricalTemperatureDifference { get { return UnitType.UT_Electrical_TemperatureDifference; } }
public static UnitType Custom { get { return UnitType.UT_Custom; } }

public static UnitType Stationing { get { return NonExistentUnitType(nameof(Stationing), 2021); } }
public static UnitType ThermalGradientCoefficientForMoistureCapacity { get { return NonExistentUnitType(nameof(ThermalGradientCoefficientForMoistureCapacity), 2021); } }
public static UnitType StationingInterval { get { return NonExistentUnitType(nameof(StationingInterval), 2021); } }
public static UnitType RotationAngle { get { return NonExistentUnitType(nameof(RotationAngle), 2021); } }
public static UnitType PowerPerLength { get { return NonExistentUnitType(nameof(PowerPerLength), 2021); } }
public static UnitType PowerPerFlow { get { return NonExistentUnitType(nameof(PowerPerFlow), 2021); } }
public static UnitType PipingMassPerTime { get { return NonExistentUnitType(nameof(PipingMassPerTime), 2021); } }
public static UnitType IsothermalMoistureCapacity { get { return NonExistentUnitType(nameof(IsothermalMoistureCapacity), 2021); } }
public static UnitType HvacMassPerTime { get { return NonExistentUnitType(nameof(HvacMassPerTime), 2021); } }
public static UnitType FlowPerPower { get { return NonExistentUnitType(nameof(FlowPerPower), 2021); } }
public static UnitType Distance { get { return NonExistentUnitType(nameof(Distance), 2021); } }
public static UnitType Diffusivity { get { return NonExistentUnitType(nameof(Diffusivity), 2021); } }
public static UnitType CostRatePower { get { return NonExistentUnitType(nameof(CostRatePower), 2021); } }
public static UnitType CostRateEnergy { get { return NonExistentUnitType(nameof(CostRateEnergy), 2021); } }
public static UnitType CostPerArea { get { return NonExistentUnitType(nameof(CostPerArea), 2021); } }
public static UnitType AngularSpeed { get { return NonExistentUnitType(nameof(AngularSpeed), 2021); } }
public static UnitType Stationing { [NotImplemented] get { return NonExistentUnitType(nameof(Stationing), 2021); } }
public static UnitType ThermalGradientCoefficientForMoistureCapacity { [NotImplemented] get { return NonExistentUnitType(nameof(ThermalGradientCoefficientForMoistureCapacity), 2021); } }
public static UnitType StationingInterval { [NotImplemented] get { return NonExistentUnitType(nameof(StationingInterval), 2021); } }
public static UnitType RotationAngle { [NotImplemented] get { return NonExistentUnitType(nameof(RotationAngle), 2021); } }
public static UnitType PowerPerLength { [NotImplemented] get { return NonExistentUnitType(nameof(PowerPerLength), 2021); } }
public static UnitType PowerPerFlow { [NotImplemented] get { return NonExistentUnitType(nameof(PowerPerFlow), 2021); } }
public static UnitType PipingMassPerTime { [NotImplemented] get { return NonExistentUnitType(nameof(PipingMassPerTime), 2021); } }
public static UnitType IsothermalMoistureCapacity { [NotImplemented] get { return NonExistentUnitType(nameof(IsothermalMoistureCapacity), 2021); } }
public static UnitType HvacMassPerTime { [NotImplemented] get { return NonExistentUnitType(nameof(HvacMassPerTime), 2021); } }
public static UnitType FlowPerPower { [NotImplemented] get { return NonExistentUnitType(nameof(FlowPerPower), 2021); } }
public static UnitType Distance { [NotImplemented] get { return NonExistentUnitType(nameof(Distance), 2021); } }
public static UnitType Diffusivity { [NotImplemented] get { return NonExistentUnitType(nameof(Diffusivity), 2021); } }
public static UnitType CostRatePower { [NotImplemented] get { return NonExistentUnitType(nameof(CostRatePower), 2021); } }
public static UnitType CostRateEnergy { [NotImplemented] get { return NonExistentUnitType(nameof(CostRateEnergy), 2021); } }
public static UnitType CostPerArea { [NotImplemented] get { return NonExistentUnitType(nameof(CostPerArea), 2021); } }
public static UnitType AngularSpeed { [NotImplemented] get { return NonExistentUnitType(nameof(AngularSpeed), 2021); } }

#if (REVIT2018 || REVIT2019)
public static UnitType Time { get { return NonExistentUnitType(nameof(Time), 2020); } }
public static UnitType Speed { get { return NonExistentUnitType(nameof(Speed), 2020); } }
public static UnitType Time { [NotImplemented] get { return NonExistentUnitType(nameof(Time), 2020); } }
public static UnitType Speed { [NotImplemented] get { return NonExistentUnitType(nameof(Speed), 2020); } }
#else
public static UnitType Time { get { return UnitType.UT_TimeInterval; } }
public static UnitType Speed { get { return UnitType.UT_Speed; } }
Expand Down
91 changes: 46 additions & 45 deletions Revit_Core_Engine/Objects/UnitTypeId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*/

using Autodesk.Revit.DB;
using BH.oM.Base.Attributes;
using System.ComponentModel;

#if (REVIT2018 || REVIT2019 || REVIT2020)
Expand Down Expand Up @@ -282,51 +283,51 @@ public static class UnitTypeId
public static DisplayUnitType RankineInterval { get { return DisplayUnitType.DUT_RANKINE_DIFFERENCE; } }
public static DisplayUnitType Custom { get { return DisplayUnitType.DUT_CUSTOM; } }

public static DisplayUnitType StationingMeters { get { return NonExistent(nameof(StationingMeters), 2021); } }
public static DisplayUnitType StationingFeet { get { return NonExistent(nameof(StationingFeet), 2021); } }
public static DisplayUnitType CubicFeetPerHour { get { return NonExistent(nameof(CubicFeetPerHour), 2021); } }
public static DisplayUnitType LitersPerHour { get { return NonExistent(nameof(LitersPerHour), 2021); } }
public static DisplayUnitType RatioTo1 { get { return NonExistent(nameof(RatioTo1), 2021); } }
public static DisplayUnitType UsSurveyFeet { get { return NonExistent(nameof(UsSurveyFeet), 2021); } }
public static DisplayUnitType WattsPerMeter { get { return NonExistent(nameof(WattsPerMeter), 2021); } }
public static DisplayUnitType WattsPerFoot { get { return NonExistent(nameof(WattsPerFoot), 2021); } }
public static DisplayUnitType WattsPerCubicMeterPerSecond { get { return NonExistent(nameof(WattsPerCubicMeterPerSecond), 2021); } }
public static DisplayUnitType WattsPerCubicFootPerMinute { get { return NonExistent(nameof(WattsPerCubicFootPerMinute), 2021); } }
public static DisplayUnitType ThousandBritishThermalUnitsPerHour { get { return NonExistent(nameof(ThousandBritishThermalUnitsPerHour), 2021); } }
public static DisplayUnitType SquareMetersPerSecond { get { return NonExistent(nameof(SquareMetersPerSecond), 2021); } }
public static DisplayUnitType SquareFeetPerSecond { get { return NonExistent(nameof(SquareFeetPerSecond), 2021); } }
public static DisplayUnitType RevolutionsPerSecond { get { return NonExistent(nameof(RevolutionsPerSecond), 2021); } }
public static DisplayUnitType RevolutionsPerMinute { get { return NonExistent(nameof(RevolutionsPerMinute), 2021); } }
public static DisplayUnitType PoundsMassPerSecond { get { return NonExistent(nameof(PoundsMassPerSecond), 2021); } }
public static DisplayUnitType PoundsMassPerPoundDegreeFahrenheit { get { return NonExistent(nameof(PoundsMassPerPoundDegreeFahrenheit), 2021); } }
public static DisplayUnitType PoundsMassPerMinute { get { return NonExistent(nameof(PoundsMassPerMinute), 2021); } }
public static DisplayUnitType PoundsMassPerHour { get { return NonExistent(nameof(PoundsMassPerHour), 2021); } }
public static DisplayUnitType PoundForceSecondsPerSquareFoot { get { return NonExistent(nameof(PoundForceSecondsPerSquareFoot), 2021); } }
public static DisplayUnitType Pi { get { return NonExistent(nameof(Pi), 2021); } }
public static DisplayUnitType NewtonSecondsPerSquareMeter { get { return NonExistent(nameof(NewtonSecondsPerSquareMeter), 2021); } }
public static DisplayUnitType MillimetersOfWaterColumnPerMeter { get { return NonExistent(nameof(MillimetersOfWaterColumnPerMeter), 2021); } }
public static DisplayUnitType MillimetersOfWaterColumn { get { return NonExistent(nameof(MillimetersOfWaterColumn), 2021); } }
public static DisplayUnitType MetersOfWaterColumnPerMeter { get { return NonExistent(nameof(MetersOfWaterColumnPerMeter), 2021); } }
public static DisplayUnitType MetersOfWaterColumn { get { return NonExistent(nameof(MetersOfWaterColumn), 2021); } }
public static DisplayUnitType KilogramsPerSecond { get { return NonExistent(nameof(KilogramsPerSecond), 2021); } }
public static DisplayUnitType KilogramsPerMinute { get { return NonExistent(nameof(KilogramsPerMinute), 2021); } }
public static DisplayUnitType KilogramsPerMeterSecond { get { return NonExistent(nameof(KilogramsPerMeterSecond), 2021); } }
public static DisplayUnitType KilogramsPerMeterHour { get { return NonExistent(nameof(KilogramsPerMeterHour), 2021); } }
public static DisplayUnitType KilogramsPerKilogramKelvin { get { return NonExistent(nameof(KilogramsPerKilogramKelvin), 2021); } }
public static DisplayUnitType KilogramsPerHour { get { return NonExistent(nameof(KilogramsPerHour), 2021); } }
public static DisplayUnitType CurrencyPerWattHour { get { return NonExistent(nameof(CurrencyPerWattHour), 2021); } }
public static DisplayUnitType CurrencyPerWatt { get { return NonExistent(nameof(CurrencyPerWatt), 2021); } }
public static DisplayUnitType CurrencyPerSquareMeter { get { return NonExistent(nameof(CurrencyPerSquareMeter), 2021); } }
public static DisplayUnitType CurrencyPerSquareFoot { get { return NonExistent(nameof(CurrencyPerSquareFoot), 2021); } }
public static DisplayUnitType CurrencyPerBritishThermalUnitPerHour { get { return NonExistent(nameof(CurrencyPerBritishThermalUnitPerHour), 2021); } }
public static DisplayUnitType CurrencyPerBritishThermalUnit { get { return NonExistent(nameof(CurrencyPerBritishThermalUnit), 2021); } }
public static DisplayUnitType CubicMetersPerWattSecond { get { return NonExistent(nameof(CubicMetersPerWattSecond), 2021); } }
public static DisplayUnitType CubicMetersPerKilogram { get { return NonExistent(nameof(CubicMetersPerKilogram), 2021); } }
public static DisplayUnitType CubicMetersPerHourSquareMeter { get { return NonExistent(nameof(CubicMetersPerHourSquareMeter), 2021); } }
public static DisplayUnitType CubicMetersPerHourCubicMeter { get { return NonExistent(nameof(CubicMetersPerHourCubicMeter), 2021); } }
public static DisplayUnitType CubicFeetPerPoundMass { get { return NonExistent(nameof(CubicFeetPerPoundMass), 2021); } }
public static DisplayUnitType CubicFeetPerMinutePerBritishThermalUnitPerHour { get { return NonExistent(nameof(CubicFeetPerMinutePerBritishThermalUnitPerHour), 2021); } }
public static DisplayUnitType CandelasPerSquareFoot { get { return NonExistent(nameof(CandelasPerSquareFoot), 2021); } }
public static DisplayUnitType StationingMeters { [NotImplemented] get { return NonExistent(nameof(StationingMeters), 2021); } }
public static DisplayUnitType StationingFeet { [NotImplemented] get { return NonExistent(nameof(StationingFeet), 2021); } }
public static DisplayUnitType CubicFeetPerHour { [NotImplemented] get { return NonExistent(nameof(CubicFeetPerHour), 2021); } }
public static DisplayUnitType LitersPerHour { [NotImplemented] get { return NonExistent(nameof(LitersPerHour), 2021); } }
public static DisplayUnitType RatioTo1 { [NotImplemented] get { return NonExistent(nameof(RatioTo1), 2021); } }
public static DisplayUnitType UsSurveyFeet { [NotImplemented] get { return NonExistent(nameof(UsSurveyFeet), 2021); } }
public static DisplayUnitType WattsPerMeter { [NotImplemented] get { return NonExistent(nameof(WattsPerMeter), 2021); } }
public static DisplayUnitType WattsPerFoot { [NotImplemented] get { return NonExistent(nameof(WattsPerFoot), 2021); } }
public static DisplayUnitType WattsPerCubicMeterPerSecond { [NotImplemented] get { return NonExistent(nameof(WattsPerCubicMeterPerSecond), 2021); } }
public static DisplayUnitType WattsPerCubicFootPerMinute { [NotImplemented] get { return NonExistent(nameof(WattsPerCubicFootPerMinute), 2021); } }
public static DisplayUnitType ThousandBritishThermalUnitsPerHour { [NotImplemented] get { return NonExistent(nameof(ThousandBritishThermalUnitsPerHour), 2021); } }
public static DisplayUnitType SquareMetersPerSecond { [NotImplemented] get { return NonExistent(nameof(SquareMetersPerSecond), 2021); } }
public static DisplayUnitType SquareFeetPerSecond { [NotImplemented] get { return NonExistent(nameof(SquareFeetPerSecond), 2021); } }
public static DisplayUnitType RevolutionsPerSecond { [NotImplemented] get { return NonExistent(nameof(RevolutionsPerSecond), 2021); } }
public static DisplayUnitType RevolutionsPerMinute { [NotImplemented] get { return NonExistent(nameof(RevolutionsPerMinute), 2021); } }
public static DisplayUnitType PoundsMassPerSecond { [NotImplemented] get { return NonExistent(nameof(PoundsMassPerSecond), 2021); } }
public static DisplayUnitType PoundsMassPerPoundDegreeFahrenheit { [NotImplemented] get { return NonExistent(nameof(PoundsMassPerPoundDegreeFahrenheit), 2021); } }
public static DisplayUnitType PoundsMassPerMinute { [NotImplemented] get { return NonExistent(nameof(PoundsMassPerMinute), 2021); } }
public static DisplayUnitType PoundsMassPerHour { [NotImplemented] get { return NonExistent(nameof(PoundsMassPerHour), 2021); } }
public static DisplayUnitType PoundForceSecondsPerSquareFoot { [NotImplemented] get { return NonExistent(nameof(PoundForceSecondsPerSquareFoot), 2021); } }
public static DisplayUnitType Pi { [NotImplemented] get { return NonExistent(nameof(Pi), 2021); } }
public static DisplayUnitType NewtonSecondsPerSquareMeter { [NotImplemented] get { return NonExistent(nameof(NewtonSecondsPerSquareMeter), 2021); } }
public static DisplayUnitType MillimetersOfWaterColumnPerMeter { [NotImplemented] get { return NonExistent(nameof(MillimetersOfWaterColumnPerMeter), 2021); } }
public static DisplayUnitType MillimetersOfWaterColumn { [NotImplemented] get { return NonExistent(nameof(MillimetersOfWaterColumn), 2021); } }
public static DisplayUnitType MetersOfWaterColumnPerMeter { [NotImplemented] get { return NonExistent(nameof(MetersOfWaterColumnPerMeter), 2021); } }
public static DisplayUnitType MetersOfWaterColumn { [NotImplemented] get { return NonExistent(nameof(MetersOfWaterColumn), 2021); } }
public static DisplayUnitType KilogramsPerSecond { [NotImplemented] get { return NonExistent(nameof(KilogramsPerSecond), 2021); } }
public static DisplayUnitType KilogramsPerMinute { [NotImplemented] get { return NonExistent(nameof(KilogramsPerMinute), 2021); } }
public static DisplayUnitType KilogramsPerMeterSecond { [NotImplemented] get { return NonExistent(nameof(KilogramsPerMeterSecond), 2021); } }
public static DisplayUnitType KilogramsPerMeterHour { [NotImplemented] get { return NonExistent(nameof(KilogramsPerMeterHour), 2021); } }
public static DisplayUnitType KilogramsPerKilogramKelvin { [NotImplemented] get { return NonExistent(nameof(KilogramsPerKilogramKelvin), 2021); } }
public static DisplayUnitType KilogramsPerHour { [NotImplemented] get { return NonExistent(nameof(KilogramsPerHour), 2021); } }
public static DisplayUnitType CurrencyPerWattHour { [NotImplemented] get { return NonExistent(nameof(CurrencyPerWattHour), 2021); } }
public static DisplayUnitType CurrencyPerWatt { [NotImplemented] get { return NonExistent(nameof(CurrencyPerWatt), 2021); } }
public static DisplayUnitType CurrencyPerSquareMeter { [NotImplemented] get { return NonExistent(nameof(CurrencyPerSquareMeter), 2021); } }
public static DisplayUnitType CurrencyPerSquareFoot { [NotImplemented] get { return NonExistent(nameof(CurrencyPerSquareFoot), 2021); } }
public static DisplayUnitType CurrencyPerBritishThermalUnitPerHour { [NotImplemented] get { return NonExistent(nameof(CurrencyPerBritishThermalUnitPerHour), 2021); } }
public static DisplayUnitType CurrencyPerBritishThermalUnit { [NotImplemented] get { return NonExistent(nameof(CurrencyPerBritishThermalUnit), 2021); } }
public static DisplayUnitType CubicMetersPerWattSecond { [NotImplemented] get { return NonExistent(nameof(CubicMetersPerWattSecond), 2021); } }
public static DisplayUnitType CubicMetersPerKilogram { [NotImplemented] get { return NonExistent(nameof(CubicMetersPerKilogram), 2021); } }
public static DisplayUnitType CubicMetersPerHourSquareMeter { [NotImplemented] get { return NonExistent(nameof(CubicMetersPerHourSquareMeter), 2021); } }
public static DisplayUnitType CubicMetersPerHourCubicMeter { [NotImplemented] get { return NonExistent(nameof(CubicMetersPerHourCubicMeter), 2021); } }
public static DisplayUnitType CubicFeetPerPoundMass { [NotImplemented] get { return NonExistent(nameof(CubicFeetPerPoundMass), 2021); } }
public static DisplayUnitType CubicFeetPerMinutePerBritishThermalUnitPerHour { [NotImplemented] get { return NonExistent(nameof(CubicFeetPerMinutePerBritishThermalUnitPerHour), 2021); } }
public static DisplayUnitType CandelasPerSquareFoot { [NotImplemented] get { return NonExistent(nameof(CandelasPerSquareFoot), 2021); } }


/***************************************************/
Expand Down
9 changes: 6 additions & 3 deletions Revit_Core_Engine/Query/UnitTypeByPropertyName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,12 @@ private static void CollectUnitTypes()
m_UnitTypesWithIdentifiers = new Dictionary<string, UnitType>();
foreach (PropertyInfo info in typeof(SpecTypeId).GetProperties())
{
UnitType? unitType = info.GetValue(null) as UnitType?;
if (unitType != null && unitType != UnitType.UT_Undefined)
m_UnitTypesWithIdentifiers.Add(info.Name, unitType.Value);
if (info.GetGetMethod().GetCustomAttribute<NotImplementedAttribute>() == null)
{
UnitType? unitType = info.GetValue(null) as UnitType?;
if (unitType != null && unitType != UnitType.UT_Undefined)
m_UnitTypesWithIdentifiers.Add(info.Name, unitType.Value);
}
}
}

Expand Down