Innovenergy_trunk/csharp/app/VenusLogger/VeService.cs

34 lines
2.4 KiB
C#
Raw Normal View History

2023-02-16 12:57:06 +00:00
using InnovEnergy.Lib.Victron.VeDBus;
namespace InnovEnergy.VenusLogger;
public static class VeService
{
public const String Generator = "com.victronenergy.genset.";
public const String Grid = "com.victronenergy.grid.";
public const String SolarCharger = "com.victronenergy.solarcharger.";
public const String PvInverter = "com.victronenergy.pvinverter.";
public const String Battery = "com.victronenergy.battery.";
public const String Inverter = "com.victronenergy.vebus.";
public const String Settings = "com.victronenergy.settings";
public const String System = "com.victronenergy.system";
public static Boolean IsGeneratorService (this ServiceProperties sp) => sp.ServiceName.IsGeneratorServiceName();
public static Boolean IsGridService (this ServiceProperties sp) => sp.ServiceName.IsGridServiceName();
public static Boolean IsSolarChargerService(this ServiceProperties sp) => sp.ServiceName.IsSolarChargerServiceName();
public static Boolean IsPvInverterService (this ServiceProperties sp) => sp.ServiceName.IsPvInverterServiceName();
public static Boolean IsBatteryService (this ServiceProperties sp) => sp.ServiceName.IsBatteryServiceName();
public static Boolean IsInverterService (this ServiceProperties sp) => sp.ServiceName.IsInverterServiceName();
public static Boolean IsSettingsService (this ServiceProperties sp) => sp.ServiceName.IsSettingsServiceName();
public static Boolean IsSystemService (this ServiceProperties sp) => sp.ServiceName.IsSystemServiceName();
public static Boolean IsGeneratorServiceName (this String serviceName) => serviceName.StartsWith(Generator);
public static Boolean IsGridServiceName (this String serviceName) => serviceName.StartsWith(Grid);
public static Boolean IsSolarChargerServiceName(this String serviceName) => serviceName.StartsWith(SolarCharger);
public static Boolean IsPvInverterServiceName (this String serviceName) => serviceName.StartsWith(PvInverter);
public static Boolean IsBatteryServiceName (this String serviceName) => serviceName.StartsWith(Battery);
public static Boolean IsInverterServiceName (this String serviceName) => serviceName.StartsWith(Inverter);
public static Boolean IsSettingsServiceName (this String serviceName) => serviceName == Settings;
public static Boolean IsSystemServiceName (this String serviceName) => serviceName == System;
}