예제 #1
0
 /// <summary>
 /// Create new charging profile.
 /// </summary>
 /// <param name="ChargingRateUnit">The unit of measure.</param>
 /// <param name="Start">Starting point of an absolute profile. If absent the profile will be relative to start of charging.</param>
 /// <param name="Duration">Duration of the charging profile in seconds. If the duration is left empty, the last period will continue indefinitely or until end of the transaction in case startProfile is absent.</param>
 /// <param name="MinChargingRate">Duration of the charging profile in seconds. If the duration is left empty, the last period will continue indefinitely or until end of the transaction in case startProfile is absent.</param>
 /// <param name="ChargingProfilePeriods">Duration of the charging profile in seconds. If the duration is left empty, the last period will continue indefinitely or until end of the transaction in case startProfile is absent.</param>
 public ChargingProfile(ChargingRateUnits ChargingRateUnit,
                        DateTime?Start         = null,
                        TimeSpan?Duration      = null,
                        Single?MinChargingRate = null,
                        IEnumerable <ChargingProfilePeriod> ChargingProfilePeriods = null)
 {
     this.ChargingRateUnit       = ChargingRateUnit;
     this.Start                  = Start;
     this.Duration               = Duration;
     this.MinChargingRate        = MinChargingRate;
     this.ChargingProfilePeriods = ChargingProfilePeriods?.Distinct() ?? new ChargingProfilePeriod[0];
 }
예제 #2
0
        public static String AsText(this ChargingRateUnits ChargingRateUnitType)
        {
            switch (ChargingRateUnitType)
            {
            case ChargingRateUnits.Amperes:
                return("A");

            case ChargingRateUnits.Watts:
                return("W");


            default:
                return("unknown");
            }
        }
예제 #3
0
        /// <summary>
        /// Create a charging schedule.
        /// </summary>
        /// <param name="ChargingRateUnit">The unit of measure the limit is expressed in.</param>
        /// <param name="ChargingSchedulePeriods">An enumeration of ChargingSchedulePeriods defining maximum power or current usage over time.</param>
        /// <param name="Duration">The optional duration of the charging schedule. If the duration is no defined, the last period will continue indefinitely or until end of the transaction in case startSchedule is also undefined.</param>
        /// <param name="StartSchedule">The optional starting point of an absolute schedule. If absent the schedule will be relative to start of charging.</param>
        /// <param name="MinChargingRate">An optional minimum charging rate supported by the electric vehicle. The unit of measure is defined by the chargingRateUnit. This parameter is intended to be used by a local smart charging algorithm to optimize the power allocation for in the case a charging process is inefficient at lower charging rates.</param>
        public ChargingSchedule(ChargingRateUnits ChargingRateUnit,
                                IEnumerable <ChargingSchedulePeriod> ChargingSchedulePeriods,
                                TimeSpan?Duration       = null,
                                DateTime?StartSchedule  = null,
                                Decimal?MinChargingRate = null)
        {
            #region Initial checks

            if (ChargingSchedulePeriods.IsNullOrEmpty())
            {
                throw new ArgumentNullException(nameof(ChargingSchedulePeriods), "The given enumeration of charging schedule periods must not be null or empty!");
            }

            #endregion

            this.ChargingRateUnit        = ChargingRateUnit;
            this.ChargingSchedulePeriods = ChargingSchedulePeriods;
            this.Duration        = Duration;
            this.StartSchedule   = StartSchedule;
            this.MinChargingRate = MinChargingRate;
        }