コード例 #1
0
 public Meter(DateTimeOffset instant, SenecDecimal totalPower, MeterPhase l3, MeterPhase l2, MeterPhase l1, SenecDecimal frequency)
 {
     Instant    = instant;
     TotalPower = totalPower;
     L3         = l3;
     L2         = l2;
     L1         = l1;
     Frequency  = frequency;
 }
コード例 #2
0
 private static void MutualExclusive(SenecDecimal leftItem, SenecDecimal rightItem)
 {
     if (leftItem.Value.HasValue)
     {
         if (leftItem.Value.Value > decimal.Zero)
         {
             rightItem.Value = 0;
         }
         else
         {
             leftItem.Value  = 0;
             rightItem.Value = -rightItem.Value;
         }
     }
 }
コード例 #3
0
 public Energy(DateTimeOffset instant, SenecDecimal batteryPercentageFull, SenecDecimal homeInstantPowerConsumption, SenecDecimal solarPowerGeneration, SenecSystemState systemState, SenecBoolean isBatteryDischarging, SenecBoolean isBatteryCharging, SenecDecimal gridImportWatts, SenecDecimal batteryChargeWatts, SenecDecimal sTAT_STATE_DECODE, SenecDecimal sTAT_MAINT_REQUIRED)
 {
     Instant = instant;
     BatteryPercentageFull       = batteryPercentageFull;
     HomeInstantPowerConsumption = homeInstantPowerConsumption;
     SolarPowerGeneration        = solarPowerGeneration;
     SystemState          = systemState;
     IsBatteryDischarging = isBatteryDischarging;
     IsBatteryCharging    = isBatteryCharging;
     GridImportWatts      = gridImportWatts;
     GridExportWatts      = new SenecDecimal(GridImportWatts.Type, GridImportWatts.Value);
     MutualExclusive(GridImportWatts, GridExportWatts);
     BatteryChargeWatts    = batteryChargeWatts;
     BatteryDischargeWatts = new SenecDecimal(BatteryChargeWatts.Type, BatteryChargeWatts.Value);
     MutualExclusive(BatteryChargeWatts, BatteryDischargeWatts);
     STAT_STATE_DECODE   = sTAT_STATE_DECODE;
     STAT_MAINT_REQUIRED = sTAT_MAINT_REQUIRED;
 }
コード例 #4
0
 public SenecSystemState(SenecDecimal senecDecimal) : this(senecDecimal.Type, senecDecimal.Value)
 {
 }
コード例 #5
0
 public SenecBoolean(SenecDecimal senecDecimal) : this(senecDecimal.Type, senecDecimal.Value)
 {
 }