예제 #1
0
        public Measurement(
            string name,
            DateTime dateTime,
            double latitude,
            double longitude,
            PhysicalQuantity physicalQuantity)
        {
            //TODO: Error checking

            this.name             = name;
            this.dateTime         = dateTime;
            this.latitude         = latitude;
            this.longitude        = longitude;
            this.physicalQuantity = physicalQuantity;
        }
예제 #2
0
        public bool Equals(PhysicalQuantity other)
        {
            if (!int.Equals(Precision, other.Precision))
            {
                return(false);
            }

            decimal diff = Math.Abs(
                this.Value - other.Value);

            if (diff > (decimal)precision)
            {
                return(false);
            }

            if (!String.Equals(Unit, other.Unit))
            {
                return(false);
            }

            return(true);
        }