ocpp 0.24.1
A C++ implementation of the Open Charge Point Protocol
Public Member Functions | List of all members
ocpp::v16::SmartChargingHandler Class Reference

This class handles and maintains incoming ChargingProfiles and contains the logic to calculate the composite schedules. More...

#include <smart_charging.hpp>

Public Member Functions

 SmartChargingHandler (std::map< int32_t, std::shared_ptr< Connector > > &connectors, std::shared_ptr< DatabaseHandler > database_handler, ChargePointConfiguration &configuration)
 
bool validate_profile (ChargingProfile &profile, const int connector_id, bool ignore_no_transaction, const int profile_max_stack_level, const int max_charging_profiles_installed, const int charging_schedule_max_periods, const std::vector< ChargingRateUnit > &charging_schedule_allowed_charging_rate_units)
 validates the given profile according to the specification
 
void add_charge_point_max_profile (const ChargingProfile &profile)
 Adds the given profile to the collection of stack_level_charge_point_max_profiles_map.
 
void add_tx_default_profile (const ChargingProfile &profile, const int connector_id)
 Adds the given profile to the collection of stack_level_tx_default_profiles_map of the respective connector or to all connectors if connector_id is 0.
 
void add_tx_profile (const ChargingProfile &profile, const int connector_id)
 Adds the given profile to the collection of stack_level_tx_profiles_map of the respective connector.
 
bool clear_all_profiles_with_filter (std::optional< int > profile_id, std::optional< int > connector_id, std::optional< int > stack_level, std::optional< ChargingProfilePurposeType > charging_profile_purpose, bool check_id_only)
 Clears all charging profiles using optional filters.
 
void clear_all_profiles ()
 Clears all present profiles from all collections.
 
std::vector< ChargingProfileget_valid_profiles (const ocpp::DateTime &start_time, const ocpp::DateTime &end_time, const int connector_id, const std::set< ChargingProfilePurposeType > &purposes_to_ignore={})
 Gets all valid profiles within the given absoulte start_time and absolute end_time for the given connector_id . Only profiles that are not contained in purposes_to_ignore are included in the response.
 
EnhancedChargingSchedule calculate_enhanced_composite_schedule (const std::vector< ChargingProfile > &valid_profiles, const ocpp::DateTime &start_time, const ocpp::DateTime &end_time, const int connector_id, std::optional< ChargingRateUnit > charging_rate_unit)
 Calculates the enhanced composite schedule for the given valid_profiles and the given connector_id.
 
ChargingSchedule calculate_composite_schedule (const std::vector< ChargingProfile > &valid_profiles, const ocpp::DateTime &start_time, const ocpp::DateTime &end_time, const int connector_id, std::optional< ChargingRateUnit > charging_rate_unit)
 Calculates the composite schedule for the given valid_profiles and the given connector_id.
 

Detailed Description

This class handles and maintains incoming ChargingProfiles and contains the logic to calculate the composite schedules.


The documentation for this class was generated from the following files: