Пример #1
0
        /// <summary>
        /// Create an new OCPP charging profile.
        /// </summary>
        /// <param name="ChargingProfileId">The unique identification of this profile.</param>
        /// <param name="StackLevel">Value determining level in hierarchy stack of profiles. Higher values have precedence over lower values. Lowest level is 0.</param>
        /// <param name="ChargingProfilePurpose">Defines the purpose of the schedule transferred by this message.</param>
        /// <param name="ChargingProfileKind">Indicates the kind of schedule.</param>
        /// <param name="ChargingSchedule">Contains limits for the available power or current over time.</param>
        ///
        /// <param name="TransactionId">When the ChargingProfilePurpose is set to TxProfile, this value MAY be used to match the profile to a specific charging transaction.</param>
        /// <param name="RecurrencyKind">An optional indication of the start point of a recurrence.</param>
        /// <param name="ValidFrom">An optional timestamp at which the profile starts to be valid. If absent, the profile is valid as soon as it is received by the charge point. Not allowed to be used when ChargingProfilePurpose is TxProfile.</param>
        /// <param name="ValidTo">An optional timestamp at which the profile stops to be valid. If absent, the profile is valid until it is replaced by another profile. Not allowed to be used when ChargingProfilePurpose is TxProfile.</param>
        public ChargingProfile(ChargingProfile_Id ChargingProfileId,
                               UInt32 StackLevel,
                               ChargingProfilePurposes ChargingProfilePurpose,
                               ChargingProfileKinds ChargingProfileKind,
                               ChargingSchedule ChargingSchedule,

                               Transaction_Id?TransactionId   = null,
                               RecurrencyKinds?RecurrencyKind = null,
                               DateTime?ValidFrom             = null,
                               DateTime?ValidTo = null)

        {
            #region Initial checks

            if (ChargingSchedule == null)
            {
                throw new ArgumentNullException(nameof(ChargingSchedule), "The given charging schedule must not be null!");
            }

            #endregion

            this.ChargingProfileId      = ChargingProfileId;
            this.StackLevel             = StackLevel;
            this.ChargingProfilePurpose = ChargingProfilePurpose;
            this.ChargingProfileKind    = ChargingProfileKind;
            this.ChargingSchedule       = ChargingSchedule;

            this.TransactionId  = TransactionId ?? new Transaction_Id?();
            this.RecurrencyKind = RecurrencyKind ?? new RecurrencyKinds?();
            this.ValidFrom      = ValidFrom ?? new DateTime?();
            this.ValidTo        = ValidTo ?? new DateTime?();
        }
Пример #2
0
        public static String AsText(this ChargingProfileKinds ChargingProfileKindType)
        {
            switch (ChargingProfileKindType)
            {
            case ChargingProfileKinds.Absolute:
                return("Absolute");

            case ChargingProfileKinds.Recurring:
                return("Recurring");

            case ChargingProfileKinds.Relative:
                return("Relative");


            default:
                return("unknown");
            }
        }