Ejemplo n.º 1
0
        float GetConsumerPowerValue(DateTime t, Analog a)
        {
            EnergyConsumer ec;

            if ((a.MeasurementType != MeasurementType.ActivePower && a.MeasurementType != MeasurementType.ReactivePower) || !energyConsumers.TryGetValue(a.PowerSystemResource, out ec))
            {
                return(float.NaN);
            }

            DailyLoadProfile loadProfile = loadProfiles.Find(x => x.ConsumerClass == ec.ConsumerClass);

            if (loadProfile == null)
            {
                return(float.NaN);
            }

            return(loadProfile.Get(t.Hour, t.Minute) * (a.MeasurementType == MeasurementType.ActivePower ? ec.PFixed : ec.QFixed));
        }
Ejemplo n.º 2
0
        bool ReadEnergyConsumerPowerFromLoadProfile(EnergyConsumer ec, out float re, out float im)
        {
            re = float.NaN;
            im = float.NaN;

            DailyLoadProfile loadProfile = loadProfiles.Find(x => x.ConsumerClass == ec.ConsumerClass);

            if (loadProfile == null)
            {
                return(false);
            }

            float pu = loadProfile.Get(t.Hour, t.Minute);

            if (float.IsNaN(pu))
            {
                return(false);
            }

            re = pu * ec.PFixed;
            im = pu * ec.QFixed;

            return(true);
        }