/// <summary> /// Create a new charging station admin status. /// </summary> /// <param name="Id">The unique identification of the charging station.</param> /// <param name="StatusSchedule">The timestamped admin status of the charging station.</param> /// <param name="CustomData">An optional dictionary of customer-specific data.</param> public ChargingStationStatusSchedule(ChargingStation_Id Id, StatusSchedule <ChargingStationStatusTypes> StatusSchedule, IReadOnlyDictionary <String, Object> CustomData = null) : base(CustomData) { this.Id = Id; this.StatusSchedule = StatusSchedule; }
/// <summary> /// Create a new roaming network admin status. /// </summary> /// <param name="Id">The unique identification of the roaming network.</param> /// <param name="StatusSchedule">The timestamped admin status of the roaming network.</param> /// <param name="CustomData">An optional dictionary of customer-specific data.</param> public RoamingNetworkAdminStatusSchedule(RoamingNetwork_Id Id, StatusSchedule <RoamingNetworkAdminStatusTypes> StatusSchedule, IReadOnlyDictionary <String, Object> CustomData = null) : base(CustomData) { this.Id = Id; this.StatusSchedule = StatusSchedule; }
///// <summary> ///// An event fired whenever new EVSE data will be send upstream. ///// </summary> //public event OnPushEVSEDataRequestDelegate OnPushEVSEDataRequest; ///// <summary> ///// An event fired whenever new EVSE data had been sent upstream. ///// </summary> //public event OnPushEVSEDataResponseDelegate OnPushEVSEDataResponse; #endregion #region OnEVSEStatusPush/-Pushed ///// <summary> ///// An event fired whenever new EVSE status will be send upstream. ///// </summary> //public event OnPushEVSEStatusRequestDelegate OnPushEVSEStatusRequest; ///// <summary> ///// An event fired whenever new EVSE status had been sent upstream. ///// </summary> //public event OnPushEVSEStatusResponseDelegate OnPushEVSEStatusResponse; #endregion #endregion #region Constructor(s) /// <summary> /// Create a new e-mobility (service) provider having the given /// unique identification. /// </summary> /// <param name="Id">The unique e-mobility provider identification.</param> /// <param name="RoamingNetwork">The associated roaming network.</param> internal NavigationProvider(NavigationProvider_Id Id, RoamingNetwork RoamingNetwork, Action <NavigationProvider> Configurator = null, RemoteNavigationProviderCreatorDelegate RemoteNavigationProviderCreator = null, I18NString Name = null, I18NString Description = null, NavigationProviderPriority Priority = null, NavigationProviderAdminStatusType AdminStatus = NavigationProviderAdminStatusType.Available, NavigationProviderStatusType Status = NavigationProviderStatusType.Available, UInt16 MaxAdminStatusListSize = DefaultMaxAdminStatusListSize, UInt16 MaxStatusListSize = DefaultMaxStatusListSize) : base(Id) { #region Initial checks if (RoamingNetwork == null) { throw new ArgumentNullException(nameof(NavigationProvider), "The roaming network must not be null!"); } #endregion #region Init data and properties this.RoamingNetwork = RoamingNetwork; this._Name = Name ?? new I18NString(); this._Description = Description ?? new I18NString(); this._DataLicenses = new List <DataLicense>(); this.Priority = Priority ?? new NavigationProviderPriority(0); this._AdminStatusSchedule = new StatusSchedule <NavigationProviderAdminStatusType>(); this._AdminStatusSchedule.Insert(AdminStatus); this._StatusSchedule = new StatusSchedule <NavigationProviderStatusType>(); this._StatusSchedule.Insert(Status); #endregion Configurator?.Invoke(this); this.RemoteNavigationProvider = RemoteNavigationProviderCreator?.Invoke(this); }
/// <summary> /// Create a new e-mobility station having the given identification. /// </summary> /// <param name="Id">The unique identification of the e-mobility station pool.</param> /// <param name="MaxAdminStatusListSize">The default size of the admin status list.</param> internal eMobilityStation(eMobilityStation_Id Id, eMobilityProvider Provider, Action <eMobilityStation> Configurator = null, RemoteEMobilityStationCreatorDelegate RemoteeMobilityStationCreator = null, eMobilityStationAdminStatusType AdminStatus = eMobilityStationAdminStatusType.Operational, UInt16 MaxAdminStatusListSize = DefaultMaxAdminStatusListSize) : base(Id) { #region Initial checks if (Provider == null) { throw new ArgumentNullException(nameof(Provider), "The e-mobility provider must not be null!"); } #endregion #region Init data and properties this.Provider = Provider; this.Name = new I18NString(); this.Description = new I18NString(); this._UserComment = new I18NString(); this._ServiceProviderComment = new I18NString(); //this.GeoLocation = new GeoCoordinate(); this._ParkingSpaces = new List <ParkingSpace>(); this._PaymentOptions = new ReactiveSet <PaymentOptions>(); this._AdminStatusSchedule = new StatusSchedule <eMobilityStationAdminStatusType>(MaxAdminStatusListSize); this._AdminStatusSchedule.Insert(AdminStatus); #endregion #region Init events #endregion #region Link events this._AdminStatusSchedule.OnStatusChanged += (Timestamp, EventTrackingId, StatusSchedule, OldStatus, NewStatus) => UpdateAdminStatus(Timestamp, EventTrackingId, OldStatus, NewStatus); //// eMobilityStation events //this.OnEVSEAddition. OnVoting += (timestamp, station, evse, vote) => ChargingPool.EVSEAddition. SendVoting (timestamp, station, evse, vote); //this.OnEVSEAddition. OnNotification += (timestamp, station, evse) => ChargingPool.EVSEAddition. SendNotification(timestamp, station, evse); //this.OnEVSERemoval. OnVoting += (timestamp, station, evse, vote) => ChargingPool.EVSERemoval . SendVoting (timestamp, station, evse, vote); //this.OnEVSERemoval. OnNotification += (timestamp, station, evse) => ChargingPool.EVSERemoval . SendNotification(timestamp, station, evse); //// EVSE events //this.SocketOutletAddition. OnVoting += (timestamp, evse, outlet, vote) => ChargingPool.SocketOutletAddition. SendVoting (timestamp, evse, outlet, vote); //this.SocketOutletAddition. OnNotification += (timestamp, evse, outlet) => ChargingPool.SocketOutletAddition. SendNotification(timestamp, evse, outlet); //this.SocketOutletRemoval. OnVoting += (timestamp, evse, outlet, vote) => ChargingPool.SocketOutletRemoval. SendVoting (timestamp, evse, outlet, vote); //this.SocketOutletRemoval. OnNotification += (timestamp, evse, outlet) => ChargingPool.SocketOutletRemoval. SendNotification(timestamp, evse, outlet); #endregion this.OnPropertyChanged += UpdateData; Configurator?.Invoke(this); this.RemoteeMobilityStation = RemoteeMobilityStationCreator?.Invoke(this); }
/// <summary> /// Create a new charging station group. /// </summary> /// <param name="Id">The unique identification of the charing station group.</param> /// <param name="Operator">The charging station operator of this charging station group.</param> /// <param name="Name">The offical (multi-language) name of this charging station group.</param> /// <param name="Description">An optional (multi-language) description of this charging station group.</param> /// /// <param name="Members">An enumeration of charging stations member building this charging station group.</param> /// <param name="MemberIds">An enumeration of charging station identifications which are building this charging station group.</param> /// <param name="AutoIncludeStations">A delegate deciding whether to include new charging stations automatically into this group.</param> /// /// <param name="StatusAggregationDelegate">A delegate called to aggregate the dynamic status of all subordinated charging stations.</param> /// <param name="MaxGroupStatusListSize">The default size of the charging station group status list.</param> /// <param name="MaxGroupAdminStatusListSize">The default size of the charging station group admin status list.</param> internal ChargingStationGroup(ChargingStationGroup_Id Id, ChargingStationOperator Operator, I18NString Name, I18NString Description = null, Brand Brand = null, Priority?Priority = null, ChargingTariff Tariff = null, IEnumerable <DataLicense> DataLicenses = null, IEnumerable <ChargingStation> Members = null, IEnumerable <ChargingStation_Id> MemberIds = null, Func <ChargingStation, Boolean> AutoIncludeStations = null, Func <ChargingStationStatusReport, ChargingStationGroupStatusTypes> StatusAggregationDelegate = null, UInt16 MaxGroupStatusListSize = DefaultMaxGroupStatusListSize, UInt16 MaxGroupAdminStatusListSize = DefaultMaxGroupAdminStatusListSize) : base(Id) { #region Initial checks if (Operator == null) { throw new ArgumentNullException(nameof(Operator), "The charging station operator must not be null!"); } if (IEnumerableExtensions.IsNullOrEmpty(Name)) { throw new ArgumentNullException(nameof(Name), "The name of the charging station group must not be null or empty!"); } #endregion #region Init data and properties this.Operator = Operator; this.Name = Name; this.Description = Description ?? new I18NString(); this.Brand = Brand; this.Priority = Priority; this.Tariff = Tariff; this.DataLicenses = DataLicenses?.Any() == true ? new ReactiveSet <DataLicense>(DataLicenses) : new ReactiveSet <DataLicense>(); this._AllowedMemberIds = MemberIds != null ? new HashSet <ChargingStation_Id>(MemberIds) : new HashSet <ChargingStation_Id>(); this.AutoIncludeStations = AutoIncludeStations ?? (MemberIds == null ? (Func <ChargingStation, Boolean>)(station => true) : station => false); this._ChargingStations = new ConcurrentDictionary <ChargingStation_Id, ChargingStation>(); this.StatusAggregationDelegate = StatusAggregationDelegate; this._AdminStatusSchedule = new StatusSchedule <ChargingStationGroupAdminStatusTypes>(MaxGroupAdminStatusListSize); this._AdminStatusSchedule.Insert(ChargingStationGroupAdminStatusTypes.Unknown); this._StatusSchedule = new StatusSchedule <ChargingStationGroupStatusTypes> (MaxGroupStatusListSize); this._StatusSchedule.Insert(ChargingStationGroupStatusTypes.Unknown); #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 #endregion #region Link events this._AdminStatusSchedule.OnStatusChanged += (Timestamp, EventTrackingId, StatusSchedule, OldStatus, NewStatus) => UpdateAdminStatus(Timestamp, EventTrackingId, 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) => Operator.EVSEAddition.SendVoting(timestamp, station, evse, vote); this.OnEVSEAddition.OnNotification += (timestamp, station, evse) => Operator.EVSEAddition.SendNotification(timestamp, station, evse); this.OnEVSERemoval.OnVoting += (timestamp, station, evse, vote) => Operator.EVSERemoval.SendVoting(timestamp, station, evse, vote); this.OnEVSERemoval.OnNotification += (timestamp, station, evse) => Operator.EVSERemoval.SendNotification(timestamp, station, evse); #endregion if (Members?.Any() == true) { Members.ForEach(station => Add(station)); } }
/// <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 }
/// <summary> /// Create a new e-vehicle having the given identification. /// </summary> /// <param name="Id">The unique identification of the e-vehicle pool.</param> /// <param name="MaxAdminStatusListSize">The default size of the admin status list.</param> internal eVehicle(eVehicle_Id Id, eMobilityProvider Provider, Action <eVehicle> Configurator = null, RemoteEVehicleCreatorDelegate RemoteEVehicleCreator = null, eVehicleAdminStatusType AdminStatus = eVehicleAdminStatusType.Operational, eVehicleStatusType Status = eVehicleStatusType.Available, UInt16 MaxAdminStatusListSize = DefaultMaxAdminStatusListSize, UInt16 MaxStatusListSize = DefaultMaxStatusListSize) : base(Id) { #region Initial checks if (Provider == null) { throw new ArgumentNullException(nameof(Provider), "The e-mobility provider must not be null!"); } #endregion #region Init data and properties this.Provider = Provider; this.Description = new I18NString(); this._UserComment = new I18NString(); this._ServiceProviderComment = new I18NString(); this.GeoLocation = null; this._PaymentOptions = new ReactiveSet <PaymentOptions>(); this._AdminStatusSchedule = new StatusSchedule <eVehicleAdminStatusType>(MaxAdminStatusListSize); this._AdminStatusSchedule.Insert(AdminStatus); this._StatusSchedule = new StatusSchedule <eVehicleStatusType>(MaxStatusListSize); this._StatusSchedule.Insert(Status); #endregion #region Init events #endregion #region Link events this._AdminStatusSchedule.OnStatusChanged += (Timestamp, EventTrackingId, StatusSchedule, OldStatus, NewStatus) => UpdateAdminStatus(Timestamp, EventTrackingId, OldStatus, NewStatus); this._StatusSchedule.OnStatusChanged += (Timestamp, EventTrackingId, StatusSchedule, OldStatus, NewStatus) => UpdateStatus(Timestamp, EventTrackingId, OldStatus, NewStatus); #endregion this.OnPropertyChanged += UpdateData; Configurator?.Invoke(this); this.RemoteEVehicle = RemoteEVehicleCreator?.Invoke(this); }