/// <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; }
public SignedMeteringValue(DateTime Timestamp, Double MeterValue, EnergyMeter_Id MeterId, EVSE_Id EVSEId, AAuthentication UserId, PgpPublicKey PublicKey, String lastSignature = "", String Signature = "") { this.Timestamp = Timestamp; this.MeterValue = MeterValue; this.MeterId = MeterId; this.EVSEId = EVSEId; this.UserId = UserId; this.PublicKey = PublicKey; this.lastSignature = lastSignature != null?lastSignature.Trim() : ""; this.Signature = Signature != null?Signature.Trim() : ""; if (UserId == null) { new ArgumentNullException(nameof(UserId), "A signed meter value must have some kind of user identification!"); } }