예제 #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);
 }