/// <summary>
 /// This type is used to schedule EVSE status periods in the future.
 /// </summary>
 /// <param name="Begin">Begin of the scheduled period.</param>
 /// <param name="End">Optional end of the scheduled period.</param>
 /// <param name="EVSEStatus">EVSE status value during the scheduled period.</param>
 public EVSEStatusSchedule(DateTime        Begin,
                           DateTime?       End,
                           EVSEStatusType  EVSEStatus)
 {
     this._Begin       = Begin;
     this._End         = End;
     this._EVSEStatus  = EVSEStatus;
 }
Example #2
0
 /// <summary>
 /// This type is used to schedule EVSE status periods in the future.
 /// </summary>
 /// <param name="Begin">Begin of the scheduled period.</param>
 /// <param name="End">Optional end of the scheduled period.</param>
 /// <param name="EVSEStatus">EVSE status value during the scheduled period.</param>
 public EVSEStatusSchedule(DateTime Begin,
                           DateTime?End,
                           EVSEStatusType EVSEStatus)
 {
     this._Begin      = Begin;
     this._End        = End;
     this._EVSEStatus = EVSEStatus;
 }
Example #3
0
        /// <summary>
        /// Check if the given enumeration of EVSEs and their current status
        /// contains the given pair of EVSE identification and status.
        /// </summary>
        /// <param name="EVSEStatus">An enumeration of EVSEs and their current status.</param>
        /// <param name="Id">An EVSE identification.</param>
        /// <param name="Status">An EVSE status.</param>
        public static Boolean Contains(this IEnumerable <EVSEStatus> EVSEStatus,
                                       EVSE_Id Id,
                                       EVSEStatusType Status)
        {
            foreach (var status in EVSEStatus)
            {
                if (status.Id == Id &&
                    status.Status == Status)
                {
                    return(true);
                }
            }

            return(false);
        }
Example #4
0
        /// <summary>
        /// The EVSE object describes the part that controls the power supply to a single EV in a single session.
        /// </summary>
        /// <param name="Id">Uniquely identifies the EVSE within the CPOs platform (and suboperator platforms).</param>
        /// <param name="Location">The charging location object that contains this EVSE.</param>
        internal EVSE(EVSE_Id Id,
                      Location Location)

            : base(Id)

        {
            #region Initial checks

            if (Location == null)
            {
                throw new ArgumentNullException("Location", "The given parameter must not be null!");
            }

            #endregion

            #region Init data and properties

            this._Location = Location;

            this._Status             = EVSEStatusType.Unknown;
            this._StatusSchedule     = new ReactiveSet <EVSEStatusSchedule>();
            this._Capabilities       = new ReactiveSet <CapabilityType>();
            this._Connectors         = new ReactiveSet <Connector>();
            this._Directions         = new I18NString();
            this._ParkingRestriction = new ReactiveSet <ParkingRestrictionType>();
            this._Images             = new ReactiveSet <Image>();

            #endregion

            #region Init events

            //// EVSE events
            //this.SocketOutletAddition     = new VotingNotificator<DateTime, EVSE, SocketOutlet, Boolean>(() => new VetoVote(), true);
            //this.SocketOutletRemoval      = new VotingNotificator<DateTime, EVSE, SocketOutlet, Boolean>(() => new VetoVote(), true);

            #endregion

            #region Link events

            //// EVSE events
            //this.SocketOutletAddition.     OnVoting       += (timestamp, evse, outlet, vote)       => ChargingStation.SocketOutletAddition.   SendVoting      (timestamp, evse, outlet, vote);
            //this.SocketOutletAddition.     OnNotification += (timestamp, evse, outlet)             => ChargingStation.SocketOutletAddition.   SendNotification(timestamp, evse, outlet);
            //
            //this.SocketOutletRemoval.      OnVoting       += (timestamp, evse, outlet, vote)       => ChargingStation.SocketOutletRemoval.    SendVoting      (timestamp, evse, outlet, vote);
            //this.SocketOutletRemoval.      OnNotification += (timestamp, evse, outlet)             => ChargingStation.SocketOutletRemoval.    SendNotification(timestamp, evse, outlet);

            #endregion
        }
Example #5
0
        /// <summary>
        /// Create a new EVSE status.
        /// </summary>
        /// <param name="Id">The unique identification of the EVSE.</param>
        /// <param name="Status">The current status of the EVSE.</param>
        /// <param name="Timestamp">The timestamp of the current status of the EVSE.</param>
        public EVSEStatus(EVSE_Id Id,
                          EVSEStatusType Status,
                          DateTime Timestamp)

        {
            #region Initial checks

            if (Id == null)
            {
                throw new ArgumentNullException(nameof(Id), "The given unique identification of an EVSE must not be null!");
            }

            #endregion

            this._Id        = Id;
            this._Status    = Status;
            this._Timestamp = Timestamp;
        }