示例#1
0
        private NumericRepresentationValue CreateRepresentationValue(double value, string inputUnitOfMeasure)
        {
            //RepresentationValue
            NumericRepresentationValue returnValue = new NumericRepresentationValue();

            //Use vrSeedLoadQuantity Representation
            RepresentationSystem.Representation representation = RepresentationSystem.RepresentationManager.Instance.Representations.First(r => r.DomainId == "vrSeedLoadQuantity");
            if (representation != null)
            {
                // Convert to ADAPT Numeric Representation object
                returnValue.Representation = ((RepresentationSystem.NumericRepresentation)representation).ToModelRepresentation();
            }

            //Value
            // Map bg to bag
            string uomCode = inputUnitOfMeasure?.ToLower() == "bg" ? "bag" : inputUnitOfMeasure?.ToLower() ?? string.Empty;

            if (!UnitSystem.InternalUnitSystemManager.Instance.UnitOfMeasures.Contains(uomCode))
            {
                // Didn't find uom so just use unitless
                uomCode = "unitless";

                Errors.Add(new Error(string.Empty, "ShippedItemInstanceMapper.CreateRepresentationValue", $"Unit of Measure {uomCode} not found, using unitless instead.", string.Empty));
            }
            UnitOfMeasure uom = UnitSystem.UnitSystemManager.GetUnitOfMeasure(uomCode);

            returnValue.Value = new ApplicationDataModel.Representations.NumericValue(uom, value);

            return(returnValue);
        }
示例#2
0
      protected virtual void Append(Representation.RepresentationSystem.EnumeratedRepresentation definedRepresentation, StringBuilder stringBuilder)
      {

      }
示例#3
0
      protected virtual void Append(Representation.RepresentationSystem.NumericRepresentation representation, StringBuilder stringBuilder)
      {

      }
 public bool IsMember(Representation representation)
 {
     return IsMember(representation.DomainTag);
 }
 protected void Add(Representation representation)
 {
     _representations.Add(representation.DomainTag, representation);
 }
示例#6
0
 public bool IsMember(Representation representation)
 {
     return(IsMember(representation.DomainTag));
 }
示例#7
0
 protected void Add(Representation representation)
 {
     _representations.Add(representation.DomainTag, representation);
 }