Exemplo n.º 1
0
 private bool Equals(PeriodicIntervalTime that)
 {
     return(new EqualsBuilder().AppendSuper(base.Equals(that))
            .Append(this.period, that.period)
            .Append(this.phase, that.phase)
            .Append(this.representation, that.representation)
            .Append(this.repetitions, that.repetitions)
            .Append(this.quantity, that.quantity)
            .IsEquals());
 }
Exemplo n.º 2
0
        public static PeriodicIntervalTimeR2 CreateFromPivlR1(PeriodicIntervalTime pivlR1)
        {
            DateDiff                period   = pivlR1.Period;
            PhysicalQuantity        periodPq = (period != null ? period.ValueAsPhysicalQuantity : null);
            Interval <PlatformDate> phase    = pivlR1.Phase;
            PhysicalQuantity        quantity = pivlR1.Quantity;
            Int32?repetitions = pivlR1.Repetitions;

            return(new PeriodicIntervalTimeR2(phase, periodPq, null, null, repetitions, quantity));
        }
Exemplo n.º 3
0
        public virtual void TestGtsEquals()
        {
            PeriodicIntervalTime pivl1 = PeriodicIntervalTime.CreatePeriodPhase(new DateDiff(new PhysicalQuantity(new BigDecimal(4),
                                                                                                                  Ca.Infoway.Messagebuilder.Domainvalue.Basic.UnitsOfMeasureCaseSensitive.DAY)), IntervalFactory.CreateLowHigh(new PlatformDate
                                                                                                                                                                                                                                   (1234), new PlatformDate(5678)));
            GeneralTimingSpecification gts1 = new GeneralTimingSpecification(IntervalFactory.CreateLowHigh(new PlatformDate(2222), new
                                                                                                           PlatformDate(3333)), pivl1);
            PeriodicIntervalTime pivl2 = PeriodicIntervalTime.CreatePeriodPhase(new DateDiff(new PhysicalQuantity(new BigDecimal(4),
                                                                                                                  Ca.Infoway.Messagebuilder.Domainvalue.Basic.UnitsOfMeasureCaseSensitive.DAY)), IntervalFactory.CreateLowHigh(new PlatformDate
                                                                                                                                                                                                                                   (1234), new PlatformDate(5678)));
            GeneralTimingSpecification gts2 = new GeneralTimingSpecification(IntervalFactory.CreateLowHigh(new PlatformDate(2222), new
                                                                                                           PlatformDate(3333)), pivl2);

            Assert.AreEqual(gts1, gts2);
        }
Exemplo n.º 4
0
        public virtual void TestPivlEquals()
        {
            PeriodicIntervalTime pivl1 = PeriodicIntervalTime.CreatePeriodPhase(new DateDiff(new PhysicalQuantity(new BigDecimal(4),
                                                                                                                  Ca.Infoway.Messagebuilder.Domainvalue.Basic.UnitsOfMeasureCaseSensitive.DAY)), IntervalFactory.CreateLowHigh(new PlatformDate
                                                                                                                                                                                                                                   (1234), new PlatformDate(5678)));
            PeriodicIntervalTime pivl2 = PeriodicIntervalTime.CreatePeriodPhase(new DateDiff(new PhysicalQuantity(new BigDecimal(4),
                                                                                                                  Ca.Infoway.Messagebuilder.Domainvalue.Basic.UnitsOfMeasureCaseSensitive.DAY)), IntervalFactory.CreateLowHigh(new PlatformDate
                                                                                                                                                                                                                                   (1234), new PlatformDate(5678)));

            Assert.AreEqual(pivl1, pivl2);
            pivl1 = PeriodicIntervalTime.CreateFrequency(5, new PhysicalQuantity(new BigDecimal(4), Ca.Infoway.Messagebuilder.Domainvalue.Basic.UnitsOfMeasureCaseSensitive
                                                                                 .DAY));
            pivl2 = PeriodicIntervalTime.CreateFrequency(5, new PhysicalQuantity(new BigDecimal(4), Ca.Infoway.Messagebuilder.Domainvalue.Basic.UnitsOfMeasureCaseSensitive
                                                                                 .DAY));
            Assert.AreEqual(pivl1, pivl2);
        }
Exemplo n.º 5
0
 /// <summary>
 /// Constructs a GeneralTimingSpecification with the given supplied values.
 /// </summary>
 ///
 /// <param name="duration_0">the duration as a date interval</param>
 /// <param name="frequency_1">the frequency as a PeriodicIntervalTime</param>
 public GeneralTimingSpecification(Interval <Ca.Infoway.Messagebuilder.PlatformDate> duration_0,
                                   PeriodicIntervalTime frequency_1) : base()
 {
     this.duration  = duration_0;
     this.frequency = frequency_1;
 }