private void DoChangedPowerMeter(object sender, EventArgs e)
        {
            CtrlTestRated       ctrl = null;
            RatedPowerMeterArgs args = e as RatedPowerMeterArgs;

            switch (args.Index)
            {
            case EConditionRated.ID11:
                ctrl = ratedTab.TabPages[(int)EConditionRated.ID12].Controls[0] as CtrlTestRated;
                break;

            case EConditionRated.ID12:
                ctrl = ratedTab.TabPages[(int)EConditionRated.ID11].Controls[0] as CtrlTestRated;
                break;

            case EConditionRated.ID21:
                ctrl = ratedTab.TabPages[(int)EConditionRated.ID22].Controls[0] as CtrlTestRated;
                break;

            case EConditionRated.ID22:
                ctrl = ratedTab.TabPages[(int)EConditionRated.ID21].Controls[0] as CtrlTestRated;
                break;
            }

            if (ctrl == null)
            {
                return;
            }

            if (args.Field == ETestRatedField.PM_IDU)
            {
                ctrl.SetIduComboSelectedIndexWithoutEvent(0, args.PowerMeterNo);
                ctrl.SetIduComboSelectedIndexWithoutEvent(1, args.PowerMeterNo);
            }
            else
            {
                ctrl.SetOduComboSelectedIndexWithoutEvent(0, args.PowerMeterNo);
                ctrl.SetOduComboSelectedIndexWithoutEvent(1, args.PowerMeterNo);
            }
        }
Example #2
0
        private void Initialize(Dictionary <string, ValueRow> values)
        {
            string format, devFormat;

            powerArgs = new RatedPowerMeterArgs(Index, ETestRatedField.PM_IDU, 0, 0);

            coolingFreqCombo.SelectedIndex = 1;
            heatingFreqCombo.SelectedIndex = 1;

            NameValue <EWT330Wiring>[] coolWiring = EnumHelper.GetNameValues <EWT330Wiring>();

            coolingPhaseCombo.DataSource    = coolWiring;
            coolingPhaseCombo.DisplayMember = "Name";
            coolingPhaseCombo.ValueMember   = "Value";
            coolingPhaseCombo.SelectedValue = EWT330Wiring.P3W4;

            NameValue <EWT330Wiring>[] heatWiring = EnumHelper.GetNameValues <EWT330Wiring>();

            heatingPhaseCombo.DataSource    = heatWiring;
            heatingPhaseCombo.DisplayMember = "Name";
            heatingPhaseCombo.ValueMember   = "Value";
            heatingPhaseCombo.SelectedValue = EWT330Wiring.P3W4;

            coolingPowerMeter1Combo.Items.Clear();
            coolingPowerMeter2Combo.Items.Clear();

            heatingPowerMeter1Combo.Items.Clear();
            heatingPowerMeter2Combo.Items.Clear();

            foreach (PowerMeterRow <float> row in Resource.Client.Devices.PowerMeter.Rows)
            {
                if (row.Phase == EWT330Phase.P1)
                {
                    coolingPowerMeter1Combo.Items.Add(row.Name);
                    heatingPowerMeter1Combo.Items.Add(row.Name);
                }
                else
                {
                    coolingPowerMeter2Combo.Items.Add(row.Name);
                    heatingPowerMeter2Combo.Items.Add(row.Name);
                }
            }

            coolingPowerMeter1Combo.SelectedIndex = 0;
            coolingPowerMeter2Combo.SelectedIndex = 0;

            heatingPowerMeter1Combo.SelectedIndex = 0;
            heatingPowerMeter2Combo.SelectedIndex = 0;

            format    = values["Total.Capacity"].Format;
            devFormat = ToDevFormat(format);

            coolingCapacityEdit.EditValue = 0;
            coolingCapacityEdit.Properties.Mask.EditMask              = devFormat;
            coolingCapacityEdit.Properties.DisplayFormat.FormatType   = FormatType.Numeric;
            coolingCapacityEdit.Properties.DisplayFormat.FormatString = devFormat;
            coolingCapacityEdit.Properties.EditFormat.FormatType      = FormatType.Numeric;
            coolingCapacityEdit.Properties.EditFormat.FormatString    = devFormat;
            heatingCapacityEdit.EditValue = 0;
            heatingCapacityEdit.Properties.Mask.EditMask              = devFormat;
            heatingCapacityEdit.Properties.DisplayFormat.FormatType   = FormatType.Numeric;
            heatingCapacityEdit.Properties.DisplayFormat.FormatString = devFormat;
            heatingCapacityEdit.Properties.EditFormat.FormatType      = FormatType.Numeric;
            heatingCapacityEdit.Properties.EditFormat.FormatString    = devFormat;

            format    = values["Total.Power"].Format;
            devFormat = ToDevFormat(format);

            coolingPowerInEdit.EditValue = 0;
            coolingPowerInEdit.Properties.Mask.EditMask              = devFormat;
            coolingPowerInEdit.Properties.DisplayFormat.FormatType   = FormatType.Numeric;
            coolingPowerInEdit.Properties.DisplayFormat.FormatString = devFormat;
            coolingPowerInEdit.Properties.EditFormat.FormatType      = FormatType.Numeric;
            coolingPowerInEdit.Properties.EditFormat.FormatString    = devFormat;
            heatingPowerInEdit.EditValue = 0;
            heatingPowerInEdit.Properties.Mask.EditMask              = devFormat;
            heatingPowerInEdit.Properties.DisplayFormat.FormatType   = FormatType.Numeric;
            heatingPowerInEdit.Properties.DisplayFormat.FormatString = devFormat;
            heatingPowerInEdit.Properties.EditFormat.FormatType      = FormatType.Numeric;
            heatingPowerInEdit.Properties.EditFormat.FormatString    = devFormat;

            format    = values["Total.EER_COP"].Format;
            devFormat = ToDevFormat(format);

            coolingEepEdit.EditValue = 0;
            coolingEepEdit.Properties.Mask.EditMask              = devFormat;
            coolingEepEdit.Properties.DisplayFormat.FormatType   = FormatType.Numeric;
            coolingEepEdit.Properties.DisplayFormat.FormatString = devFormat;
            coolingEepEdit.Properties.EditFormat.FormatType      = FormatType.Numeric;
            coolingEepEdit.Properties.EditFormat.FormatString    = devFormat;
            coolingEepEdit.Properties.ReadOnly                   = true;
            heatingEepEdit.EditValue                             = 0;
            heatingEepEdit.Properties.Mask.EditMask              = devFormat;
            heatingEepEdit.Properties.DisplayFormat.FormatType   = FormatType.Numeric;
            heatingEepEdit.Properties.DisplayFormat.FormatString = devFormat;
            heatingEepEdit.Properties.EditFormat.FormatType      = FormatType.Numeric;
            heatingEepEdit.Properties.EditFormat.FormatString    = devFormat;
            heatingEepEdit.Properties.ReadOnly                   = true;

            format    = values["ID1.IDU.Voltage"].Format;
            devFormat = ToDevFormat(format);

            coolingVoltEdit.EditValue = 0;
            coolingVoltEdit.Properties.Mask.EditMask              = devFormat;
            coolingVoltEdit.Properties.DisplayFormat.FormatType   = FormatType.Numeric;
            coolingVoltEdit.Properties.DisplayFormat.FormatString = devFormat;
            coolingVoltEdit.Properties.EditFormat.FormatType      = FormatType.Numeric;
            coolingVoltEdit.Properties.EditFormat.FormatString    = devFormat;
            heatingVoltEdit.EditValue = 0;
            heatingVoltEdit.Properties.Mask.EditMask              = devFormat;
            heatingVoltEdit.Properties.DisplayFormat.FormatType   = FormatType.Numeric;
            heatingVoltEdit.Properties.DisplayFormat.FormatString = devFormat;
            heatingVoltEdit.Properties.EditFormat.FormatType      = FormatType.Numeric;
            heatingVoltEdit.Properties.EditFormat.FormatString    = devFormat;

            format    = values["ID1.IDU.Current"].Format;
            devFormat = ToDevFormat(format);

            coolingCurrentEdit.EditValue = 0;
            coolingCurrentEdit.Properties.Mask.EditMask              = devFormat;
            coolingCurrentEdit.Properties.DisplayFormat.FormatType   = FormatType.Numeric;
            coolingCurrentEdit.Properties.DisplayFormat.FormatString = devFormat;
            coolingCurrentEdit.Properties.EditFormat.FormatType      = FormatType.Numeric;
            coolingCurrentEdit.Properties.EditFormat.FormatString    = devFormat;
            heatingCurrentEdit.EditValue = 0;
            heatingCurrentEdit.Properties.Mask.EditMask              = devFormat;
            heatingCurrentEdit.Properties.DisplayFormat.FormatType   = FormatType.Numeric;
            heatingCurrentEdit.Properties.DisplayFormat.FormatString = devFormat;
            heatingCurrentEdit.Properties.EditFormat.FormatType      = FormatType.Numeric;
            heatingCurrentEdit.Properties.EditFormat.FormatString    = devFormat;

            unitCoolingLabels = new List <Label>();
            unitCoolingLabels.Add(coolingCapacityUnitLabel);
            unitCoolingLabels.Add(coolingPowerUnitLabel);
            unitCoolingLabels.Add(coolingEER_COPUnitLabel);
            unitCoolingLabels.Add(coolingVoltageUnitLabel);
            unitCoolingLabels.Add(coolingCurrentUnitLabel);

            unitHeatingLabels = new List <Label>();
            unitHeatingLabels.Add(heatingCapacityUnitLabel);
            unitHeatingLabels.Add(heatingPowerUnitLabel);
            unitHeatingLabels.Add(heatingEER_COPUnitLabel);
            unitHeatingLabels.Add(heatingVoltageUnitLabel);
            unitHeatingLabels.Add(heatingCurrentUnitLabel);

            ReadOnly = false;
        }
Example #3
0
 private void OnChangedPowerMeter(object sender, RatedPowerMeterArgs args)
 {
     ChangedPowerMeter?.Invoke(sender, args);
 }