SmartChargingProfile.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using EVCB_OCPP.Packet.Features.SmartCharging;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace EVCB_OCPP.Packet.Features
  8. {
  9. public class SmartChargingProfile : Profile
  10. {
  11. public SmartChargingProfile()
  12. {
  13. Name = "SmartCharging";
  14. //加入支援的Features
  15. features.Add(new ClearChargingProfileFeature());
  16. features.Add(new GetCompositeScheduleFeature());
  17. features.Add(new SetChargingProfileFeature());
  18. actions.Add(Actions.ClearChargingProfile.ToString());
  19. actions.Add(Actions.GetCompositeSchedule.ToString());
  20. actions.Add(Actions.SetChargingProfile.ToString());
  21. }
  22. public string GetActionFromConfirmation(Type seekType)
  23. {
  24. return features.Where(x => x.GetConfirmationType() == seekType).FirstOrDefault().GetAction();
  25. }
  26. public string GetActionFromRequest(Type seekType)
  27. {
  28. return GetFeaturebyType(seekType).GetAction();
  29. }
  30. }
  31. }