public static RegulatingControlModeKind GetDMSRegulatingControlModeKind(RegulatingControlModeKind regulatingControlModeKind)
        {
            switch (regulatingControlModeKind)
            {
            case RegulatingControlModeKind.activePower:
                return(RegulatingControlModeKind.activePower);

            case RegulatingControlModeKind.admittance:
                return(RegulatingControlModeKind.admittance);

            case RegulatingControlModeKind.currentFlow:
                return(RegulatingControlModeKind.currentFlow);

            case RegulatingControlModeKind.fiXed:
                return(RegulatingControlModeKind.fiXed);

            case RegulatingControlModeKind.powerFactor:
                return(RegulatingControlModeKind.powerFactor);

            case RegulatingControlModeKind.reactivePower:
                return(RegulatingControlModeKind.reactivePower);

            case RegulatingControlModeKind.temperature:
                return(RegulatingControlModeKind.temperature);

            case RegulatingControlModeKind.timeScheduled:
                return(RegulatingControlModeKind.timeScheduled);

            case RegulatingControlModeKind.voltage:
                return(RegulatingControlModeKind.voltage);

            default:
                return(RegulatingControlModeKind.voltage);
            }
        }
Пример #2
0
        public override void SetProperty(Property property)
        {
            switch (property.Id)
            {
            case ModelCode.REGUCONTROL_DISCRETE:
                discrete = property.AsBool();
                break;

            case ModelCode.REGUCONTROL_MODE:
                mode = (RegulatingControlModeKind)property.AsEnum();
                break;

            case ModelCode.REGUCONTROL_MONPHASE:
                monitoredPhase = (PhaseCode)property.AsEnum();
                break;

            case ModelCode.REGUCONTROL_TARRANGE:
                targetRange = property.AsFloat();
                break;

            case ModelCode.REGUCONTROL_TARVAL:
                targetValue = property.AsFloat();
                break;

            default:
                base.SetProperty(property);
                break;
            }
        }
Пример #3
0
        public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType)
        {
            if ((value == null))
            {
                return(null);
            }
            RegulatingControlModeKind valueCasted = ((RegulatingControlModeKind)(value));

            if ((valueCasted == RegulatingControlModeKind.ReactivePower))
            {
                return("reactivePower");
            }
            if ((valueCasted == RegulatingControlModeKind.TimeScheduled))
            {
                return("timeScheduled");
            }
            if ((valueCasted == RegulatingControlModeKind.Voltage))
            {
                return("voltage");
            }
            if ((valueCasted == RegulatingControlModeKind.ActivePower))
            {
                return("activePower");
            }
            if ((valueCasted == RegulatingControlModeKind.CurrentFlow))
            {
                return("currentFlow");
            }
            if ((valueCasted == RegulatingControlModeKind.Fixed))
            {
                return("fixed");
            }
            if ((valueCasted == RegulatingControlModeKind.Temperature))
            {
                return("temperature");
            }
            if ((valueCasted == RegulatingControlModeKind.PowerFactor))
            {
                return("powerFactor");
            }
            if ((valueCasted == RegulatingControlModeKind.Admittance))
            {
                return("admittance");
            }
            throw new ArgumentOutOfRangeException("value");
        }