Exemplo n.º 1
0
      private static void DoWorkRawCDF(int i)
      {
         var v = new VariableValue(59, "mm", i);

         var result = ConvertCdf(v, "m");
         var a = result.Value;
      }
Exemplo n.º 2
0
      public static VariableValue ConvertCdf(VariableValue variableValue, string targetUnit)
      {
         if (variableValue.UnitOfMeasure == targetUnit)
         {
            return variableValue;
         }

         var sourceUnitOfMeasure = GetUomCdf(variableValue.UnitOfMeasure);
         var targetUnitOfMeasure = GetUomCdf(targetUnit);
         var bn = new NumericValue(sourceUnitOfMeasure.ToModelUom(), variableValue.Value);
         bn.ConvertToUnit(targetUnitOfMeasure);
         var convertedValue = bn.Value;
         return new VariableValue(variableValue.Representation, targetUnit, convertedValue);
      }
Exemplo n.º 3
0
 protected bool Equals(VariableValue other)
 {
    return Value.Equals(other.Value) && string.Equals(UnitOfMeasure, other.UnitOfMeasure) && Representation == other.Representation;
 }