public ImporterForwardingInfo(Action <DateTime, ImporterForwardingInfo, RoamingNetwork_Id, RoamingNetwork_Id> OnChangedCallback,
                               IEnumerable <EVSEOperator> EVSEOperators,
                               ChargingStation_Id StationId       = null,
                               String StationName                 = "",
                               String StationServiceTag           = "",
                               Address StationAddress             = null,
                               GeoCoordinate StationGeoCoordinate = null,
                               IEnumerable <EVSE_Id> EVSEIds      = null,
                               String PhoneNumber                 = null,
                               Timestamped <ChargingStationAdminStatusType>?AdminStatus = null,
                               DateTime?Created     = null,
                               Boolean OutOfService = false,
                               EVSEOperator ForwardedToEVSEOperator = null)
 {
     this._OnForwardingChanged     = OnChangedCallback;
     this._EVSEOperators           = EVSEOperators;
     this._EVSEIds                 = EVSEIds != null ? new HashSet <EVSE_Id>(EVSEIds) : new HashSet <EVSE_Id>();
     this._StationId               = StationId != null ? StationId                     : ChargingStation_Id.Create(EVSEIds);
     this.StationName              = StationName;
     this.StationServiceTag        = StationServiceTag;
     this.StationAddress           = StationAddress;
     this.StationGeoCoordinate     = StationGeoCoordinate != null ? StationGeoCoordinate          : new GeoCoordinate(new Latitude(0), new Longitude(0));
     this._AdminStatus             = AdminStatus != null ? AdminStatus.Value             : new Timestamped <ChargingStationAdminStatusType>(ChargingStationAdminStatusType.Operational);
     this._PhoneNumber             = PhoneNumber;
     this._Created                 = Created != null ? Created.Value                 : DateTime.Now;
     this._OutOfService            = OutOfService;
     this._LastTimeSeen            = _Created;
     this._ForwardedToEVSEOperator = ForwardedToEVSEOperator;
 }
示例#2
0
        /// <summary>
        /// Create a charge detail record for the given charging session (identification).
        /// </summary>
        /// <param name="SessionId">The unique charging session identification.</param>
        /// <param name="ChargingReservation">An optional charging reservation used for charging.</param>
        ///
        /// <param name="EVSE">The EVSE of the EVSE used for charging.</param>
        /// <param name="ChargingStation">The charging station of the charging station used for charging.</param>
        /// <param name="ChargingPool">The charging pool of the charging pool used for charging.</param>
        /// <param name="EVSEOperator">The EVSE operator used for charging.</param>
        /// <param name="ChargingProductId">An unqiue identification for the consumed charging product.</param>
        ///
        /// <param name="ReservationTime">Optional timestamps when the reservation started and ended.</param>
        /// <param name="ParkingTime">Optional timestamps when the parking started and ended.</param>
        /// <param name="SessionTime">Optional timestamps when the charging session started and ended.</param>
        ///
        /// <param name="EnergyMeterId">An optional unique identification of the energy meter.</param>
        /// <param name="EnergyMeteringValues">An optional enumeration of intermediate energy metering values.</param>
        /// <param name="MeteringSignature">An optional signature for the metering values.</param>
        ///
        /// <param name="IdentificationStart">The identification for the start of the charging process.</param>
        /// <param name="IdentificationStop">The identification for the stop of the charging process.</param>
        public ChargeDetailRecord(ChargingSession_Id SessionId,
                                  ChargingReservation Reservation      = null,
                                  ChargingReservation_Id ReservationId = null,

                                  EVSEOperator EVSEOperator       = null,
                                  ChargingPool ChargingPool       = null,
                                  ChargingStation ChargingStation = null,
                                  EVSE EVSE      = null,
                                  EVSE_Id EVSEId = null,
                                  ChargingProduct_Id ChargingProductId = null,

                                  EVSP_Id ProviderId = null,

                                  StartEndDateTime?ReservationTime = null,
                                  StartEndDateTime?ParkingTime     = null,
                                  StartEndDateTime?SessionTime     = null,

                                  EnergyMeter_Id EnergyMeterId = null,
                                  IEnumerable <Timestamped <Double> > EnergyMeteringValues = null,
                                  String MeteringSignature = null,

                                  AuthInfo IdentificationStart = null,
                                  AuthInfo IdentificationStop  = null)

        {
            #region Initial checks

            if (SessionId == null)
            {
                throw new ArgumentNullException("Id", "The charging session identification must not be null!");
            }

            #endregion

            this._SessionId = SessionId;

            this._Reservation     = Reservation;
            this._ReservationId   = ReservationId != null ? ReservationId : Reservation != null ? Reservation.Id : null;
            this._ReservationTime = ReservationTime;

            this._EVSE              = EVSE;
            this._EVSEId            = EVSE != null ? EVSE.Id : EVSEId;
            this._ChargingStation   = ChargingStation;
            this._ChargingPool      = ChargingPool;
            this._EVSEOperator      = EVSEOperator;
            this._ChargingProductId = ChargingProductId;

            this._ParkingTime = ParkingTime;
            this._SessionTime = SessionTime;

            this._EnergyMeterId        = EnergyMeterId;
            this._EnergyMeteringValues = EnergyMeteringValues != null ? EnergyMeteringValues : new Timestamped <Double> [0];

            this._IdentificationStart = IdentificationStart;
            this._IdentificationStop  = IdentificationStop;
        }
示例#3
0
        //ToDo: Store on disc after OnChargingStationAdminStatusChanged!!!

        #region RegisterEVSEOperator(EVSEOperator)

        public WWCPImporter <T> RegisterEVSEOperator(EVSEOperator EVSEOperator)
        {
            _EVSEOperators.Add(EVSEOperator);

            EVSEOperator.OnChargingStationAdminStatusChanged += async(Timestamp, ChargingStation, OldStatus, NewStatus) => {
                var fwd = AllForwardingInfos.FirstOrDefault(fwdinfo => fwdinfo.StationId == ChargingStation.Id);
                if (fwd != null)
                {
                    fwd.AdminStatus = ChargingStation.AdminStatus;

                    //ToDo: Store on disc!
                }
            };

            return(this);
        }
示例#4
0
 public Task <Acknowledgement> PushEVSEStatus(EVSEOperator EVSEOperator, ActionType ActionType = ActionType.update, EVSEOperator_Id OperatorId = null, string OperatorName = null, Func <EVSE, bool> IncludeEVSEs = null, TimeSpan?QueryTimeout = default(TimeSpan?))
 {
     return(Task.FromResult(new Acknowledgement(true)));
 }
示例#5
0
 public Task <Acknowledgement> PushEVSEData(EVSEOperator EVSEOperator, ActionType ActionType = ActionType.fullLoad, EVSEOperator_Id OperatorId = null, string OperatorName = null, Func <EVSE, bool> IncludeEVSEs = null, TimeSpan?QueryTimeout = default(TimeSpan?))
 {
     throw new NotImplementedException();
 }
示例#6
0
        /// <summary>
        /// Create a new group/pool of charging stations having the given identification.
        /// </summary>
        /// <param name="Id">The unique identification of the charing pool.</param>
        /// <param name="EVSEOperator">The parent EVSE operator.</param>
        /// <param name="MaxPoolStatusListSize">The default size of the charging pool (aggregated charging station) status list.</param>
        /// <param name="MaxPoolAdminStatusListSize">The default size of the charging pool admin status list.</param>
        internal ChargingStationGroup(ChargingStationGroup_Id Id,
                                      EVSEOperator EVSEOperator,
                                      UInt16 MaxPoolStatusListSize      = DefaultMaxPoolStatusListSize,
                                      UInt16 MaxPoolAdminStatusListSize = DefaultMaxPoolAdminStatusListSize)

            : base(Id)

        {
            #region Initial checks

            if (EVSEOperator == null)
            {
                throw new ArgumentNullException("EVSEOperator", "The EVSE operator must not be null!");
            }

            #endregion

            #region Init data and properties

            this._EVSEOperator = EVSEOperator;

            //this._ChargingStations           = new ConcurrentDictionary<ChargingStation_Id, ChargingStation>();

            this.Name        = new I18NString();
            this.Description = new I18NString();

            this._AdminStatusSchedule = new StatusSchedule <ChargingStationGroupAdminStatusType>(MaxPoolAdminStatusListSize);
            this._AdminStatusSchedule.Insert(ChargingStationGroupAdminStatusType.Unspecified);

            this._AllowedChargingStationIds = new HashSet <ChargingStation_Id>();

            #endregion

            #region Init events

            // ChargingStationGroup events
            this.ChargingStationAddition = new VotingNotificator <DateTime, ChargingStationGroup, ChargingStation, Boolean>(() => new VetoVote(), true);
            this.ChargingStationRemoval  = new VotingNotificator <DateTime, ChargingStationGroup, ChargingStation, Boolean>(() => new VetoVote(), true);

            // ChargingStation events
            this.EVSEAddition = new VotingNotificator <DateTime, ChargingStation, EVSE, Boolean>(() => new VetoVote(), true);
            this.EVSERemoval  = new VotingNotificator <DateTime, ChargingStation, EVSE, Boolean>(() => new VetoVote(), true);

            // 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

            this._AdminStatusSchedule.OnStatusChanged += (Timestamp, StatusSchedule, OldStatus, NewStatus)
                                                         => UpdateAdminStatus(Timestamp, OldStatus, NewStatus);

            // ChargingStationGroup events
            //this.OnChargingStationAddition.OnVoting       += (timestamp, evseoperator, pool, vote) => EVSEOperator.ChargingStationAddition.SendVoting      (timestamp, evseoperator, pool, vote);
            //this.OnChargingStationAddition.OnNotification += (timestamp, evseoperator, pool)       => EVSEOperator.ChargingStationAddition.SendNotification(timestamp, evseoperator, pool);
            //
            //this.OnChargingStationRemoval. OnVoting       += (timestamp, evseoperator, pool, vote) => EVSEOperator.ChargingStationRemoval. SendVoting      (timestamp, evseoperator, pool, vote);
            //this.OnChargingStationRemoval. OnNotification += (timestamp, evseoperator, pool)       => EVSEOperator.ChargingStationRemoval. SendNotification(timestamp, evseoperator, pool);

            // ChargingStation events
            this.OnEVSEAddition.OnVoting       += (timestamp, station, evse, vote) => EVSEOperator.EVSEAddition.SendVoting(timestamp, station, evse, vote);
            this.OnEVSEAddition.OnNotification += (timestamp, station, evse) => EVSEOperator.EVSEAddition.SendNotification(timestamp, station, evse);

            this.OnEVSERemoval.OnVoting       += (timestamp, station, evse, vote) => EVSEOperator.EVSERemoval.SendVoting(timestamp, station, evse, vote);
            this.OnEVSERemoval.OnNotification += (timestamp, station, evse) => EVSEOperator.EVSERemoval.SendNotification(timestamp, station, evse);

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

            this.SocketOutletRemoval.OnVoting       += (timestamp, evse, outlet, vote) => EVSEOperator.SocketOutletRemoval.SendVoting(timestamp, evse, outlet, vote);
            this.SocketOutletRemoval.OnNotification += (timestamp, evse, outlet) => EVSEOperator.SocketOutletRemoval.SendNotification(timestamp, evse, outlet);

            #endregion
        }