コード例 #1
0
        public ChargingStationInfo(ChargingPoolInfo ChargePoolInfo,
                                   ChargingStation_Id StationId,
                                   Address?Address = null,
                                   GeoCoordinates?GeoCoordinates      = null,
                                   IEnumerable <EVSEDataRecord>?EVSEs = null)
        {
            this.ChargePoolInfo = ChargePoolInfo ?? throw new ArgumentNullException(nameof(ChargePoolInfo), "The given charging pool information must not be null!");
            this.StationId      = StationId;
            this.Address        = Address ?? throw new ArgumentNullException(nameof(Address), "The given address must not be null!");
            this.GeoCoordinates = GeoCoordinates ?? throw new ArgumentNullException(nameof(GeoCoordinates), "The given geo coordinates must not be null!");

            this._EVSEs = EVSEs != null
                                       ? EVSEs.ToDictionary(evse => evse.Id)
                                       : new Dictionary <EVSE_Id, EVSEDataRecord>();
        }
コード例 #2
0
        public void AddOrUpdateChargingStation(EVSEDataRecord CurrentEVSEDataRecord)
        {
            var chargingStationId = CurrentEVSEDataRecord.ChargingStationId
                                    ?? ChargingStation_Id.Generate(CurrentEVSEDataRecord.OperatorId,
                                                                   CurrentEVSEDataRecord.Address,
                                                                   CurrentEVSEDataRecord.GeoCoordinates,
                                                                   CurrentEVSEDataRecord.SubOperatorName,
                                                                   CurrentEVSEDataRecord.ChargingStationName);

            if (!_ChargingStations.TryGetValue(chargingStationId, out ChargingStationInfo chargingStationInfo))
            {
                chargingStationInfo = new ChargingStationInfo(this,
                                                              chargingStationId,
                                                              CurrentEVSEDataRecord.Address,
                                                              CurrentEVSEDataRecord.GeoCoordinates);

                _ChargingStations.Add(chargingStationInfo.StationId, chargingStationInfo);
            }

            chargingStationInfo.AddOrUpdateEVSE(CurrentEVSEDataRecord);
        }