Exemplo n.º 1
0
 public EVSEInfo(Operator_Id OperatorId,
                 ChargingPool_Id PoolId,
                 Address PoolAddress,
                 GeoCoordinates?PoolLocation,
                 ChargingStation_Id?StationId)
 {
     this.OperatorId   = OperatorId;
     this.PoolId       = PoolId;
     this.PoolAddress  = PoolAddress;
     this.PoolLocation = PoolLocation;
     this.StationId    = StationId;
 }
Exemplo n.º 2
0
        public ChargingPoolInfo(OperatorInfo OperatorInfo,
                                ChargingPool_Id PoolId,
                                Address?Address = null,
                                GeoCoordinates?GeoCoordinates = null,
                                IEnumerable <ChargingStationInfo>?ChargingStationInfos = null)
        {
            if (PoolId.IsNullOrEmpty)
            {
                throw new ArgumentNullException(nameof(PoolId), "The given pool identification must not be null or empty!");
            }

            this.OperatorInfo   = OperatorInfo ?? throw new ArgumentNullException(nameof(OperatorInfo), "The given OperatorInfo must not be null!");
            this.PoolId         = PoolId;
            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._ChargingStations = ChargingStationInfos != null
                                          ? ChargingStationInfos.ToDictionary(station => station.StationId)
                                          : new Dictionary <ChargingStation_Id, ChargingStationInfo>();
        }
Exemplo n.º 3
0
        public void AddOrUpdateChargingPool(EVSEDataRecord CurrentEVSEDataRecord)
        {
            var chargingPoolId = CurrentEVSEDataRecord.ChargingPoolId
                                 ?? ChargingPool_Id.Generate(OperatorId,
                                                             CurrentEVSEDataRecord.Address,
                                                             CurrentEVSEDataRecord.GeoCoordinates,
                                                             CurrentEVSEDataRecord.SubOperatorName);

            if (!_ChargingPools.TryGetValue(chargingPoolId, out ChargingPoolInfo chargingPoolInfo))
            {
                chargingPoolInfo = new ChargingPoolInfo(this,
                                                        chargingPoolId,
                                                        CurrentEVSEDataRecord.Address,
                                                        CurrentEVSEDataRecord.GeoCoordinates);

                _ChargingPools.Add(chargingPoolInfo.PoolId, chargingPoolInfo);
            }

            chargingPoolInfo.AddOrUpdateChargingStation(CurrentEVSEDataRecord);
        }