Esempio n. 1
0
 public RatedPowerMeterArgs(EConditionRated index, ETestRatedField field, int tag, int powerMeterNo)
 {
     Index        = index;
     Field        = field;
     Tag          = tag;
     PowerMeterNo = powerMeterNo;
 }
Esempio n. 2
0
        public CtrlTestRated(EConditionRated index, Dictionary <string, ValueRow> values)
        {
            InitializeComponent();

            CoolingRecNo = -1;
            HeatingRecNo = -1;
            Index        = index;
            Initialize(values);
        }
        private void RecalcTotalRatedCondition()
        {
            CtrlTestRated totalCtrl = (CtrlTestRated)ratedTab.TabPages[(int)EConditionRated.Total].Controls[0];

            double coolingCapacity = 0;
            double coolingPower    = 0;
            double heatingCapacity = 0;
            double heatingPower    = 0;

            foreach (TabPage page in ratedTab.TabPages)
            {
                EConditionRated index = (EConditionRated)int.Parse(page.Tag.ToString());

                if (index != EConditionRated.Total)
                {
                    CtrlTestRated ctrl = (CtrlTestRated)page.Controls[0];

                    coolingCapacity += double.Parse(ctrl.coolingCapacityEdit.Text);
                    coolingPower    += double.Parse(ctrl.coolingPowerInEdit.Text);

                    heatingCapacity += double.Parse(ctrl.heatingCapacityEdit.Text);
                    heatingPower    += double.Parse(ctrl.heatingPowerInEdit.Text);
                }
            }

            totalCtrl.coolingCapacityEdit.EditValue = coolingCapacity;
            totalCtrl.coolingPowerInEdit.EditValue  = coolingPower;

            totalCtrl.heatingCapacityEdit.EditValue = heatingCapacity;
            totalCtrl.heatingPowerInEdit.EditValue  = heatingPower;

            if (coolingPower == 0.0)
            {
                totalCtrl.coolingEepEdit.EditValue = 0.0;
            }
            else
            {
                totalCtrl.coolingEepEdit.EditValue = coolingCapacity / coolingPower;
            }

            if (heatingPower == 0.0)
            {
                totalCtrl.heatingEepEdit.EditValue = 0.0;
            }
            else
            {
                totalCtrl.heatingEepEdit.EditValue = heatingCapacity / heatingPower;
            }
        }
Esempio n. 4
0
        private void Initialize()
        {
            Color evenColor = Color.FromArgb(244, 244, 236);

            NameValue<EIndoorUse>[] inUseItems = EnumHelper.GetNameValues<EIndoorUse>();
            scheduleIDUseLookUp.DataSource = inUseItems;
            scheduleIDUseLookUp.DisplayMember = "Name";
            scheduleIDUseLookUp.ValueMember = "Value";
            scheduleIDUseLookUp.KeyMember = "Value";

            NameValue<EIndoorMode>[] modeItems = EnumHelper.GetNameValues<EIndoorMode>();
            scheduleIDModeLookUp.DataSource = modeItems;
            scheduleIDModeLookUp.DisplayMember = "Name";
            scheduleIDModeLookUp.ValueMember = "Value";
            scheduleIDModeLookUp.KeyMember = "Value";

            NameValue<EIndoorDuct>[] ductItems = EnumHelper.GetNameValues<EIndoorDuct>();
            scheduleIDDuctLookUp.DataSource = ductItems;
            scheduleIDDuctLookUp.DisplayMember = "Name";
            scheduleIDDuctLookUp.ValueMember = "Value";
            scheduleIDDuctLookUp.KeyMember = "Value";

            NameValue<EOutdoorUse>[] outUseItems = EnumHelper.GetNameValues<EOutdoorUse>();
            scheduleODUseLookUp.DataSource = outUseItems;
            scheduleODUseLookUp.DisplayMember = "Name";
            scheduleODUseLookUp.ValueMember = "Value";
            scheduleODUseLookUp.KeyMember = "Value";

            NameValue<EEtcUse>[] etcUseItems = EnumHelper.GetNameValues<EEtcUse>();
            scheduleEtcUseLookUp.DataSource = etcUseItems;
            scheduleEtcUseLookUp.DisplayMember = "Name";
            scheduleEtcUseLookUp.ValueMember = "Value";
            scheduleEtcUseLookUp.KeyMember = "Value";

            scheduleGrid.DataSource = context.Condition.Schedules;
            scheduleGridView.Appearance.EvenRow.BackColor = evenColor;
            scheduleGridView.OptionsView.EnableAppearanceEvenRow = true;

            thermo1Grid.DataSource = context.Condition.TC1;
            thermo1GridView.Appearance.EvenRow.BackColor = evenColor;
            thermo1GridView.OptionsView.EnableAppearanceEvenRow = true;

            thermo2Grid.DataSource = context.Condition.TC2;
            thermo2GridView.Appearance.EvenRow.BackColor = evenColor;
            thermo2GridView.OptionsView.EnableAppearanceEvenRow = true;

            thermo3Grid.DataSource = context.Condition.TC3;
            thermo3GridView.Appearance.EvenRow.BackColor = evenColor;
            thermo3GridView.OptionsView.EnableAppearanceEvenRow = true;

            thermoTagGrid.DataSource = Resource.Tag.Thermos;
            thermoTagGridView.Appearance.EvenRow.BackColor = evenColor;
            thermoTagGridView.OptionsView.EnableAppearanceEvenRow = true;

            pressureGrid.DataSource = context.Condition.Pressures;
            pressureGridView.Appearance.EvenRow.BackColor = evenColor;
            pressureGridView.OptionsView.EnableAppearanceEvenRow = true;

            pressureTagGrid.DataSource = Resource.Tag.Presses;
            pressureTagGridView.Appearance.EvenRow.BackColor = evenColor;
            pressureTagGridView.OptionsView.EnableAppearanceEvenRow = true;

            methodCapaCoolingUnitCombo.DataSource = EnumHelper.GetNameValues<EUnitCapacity>();
            methodCapaCoolingUnitCombo.DisplayMember = "Name";
            methodCapaCoolingUnitCombo.ValueMember = "Value";

            methodCapaHeatingUnitCombo.DataSource = EnumHelper.GetNameValues<EUnitCapacity>();
            methodCapaHeatingUnitCombo.DisplayMember = "Name";
            methodCapaHeatingUnitCombo.ValueMember = "Value";

            methodAirFlowUnitCombo.DataSource = EnumHelper.GetNameValues<EUnitAirFlow>();
            methodAirFlowUnitCombo.DisplayMember = "Name";
            methodAirFlowUnitCombo.ValueMember = "Value";

            methodEnthalpyUnitCombo.DataSource = EnumHelper.GetNameValues<EUnitEnthalpy>();
            methodEnthalpyUnitCombo.DisplayMember = "Name";
            methodEnthalpyUnitCombo.ValueMember = "Value";

            methodPressureUnitCombo.DataSource = EnumHelper.GetNameValues<EUnitPressure>();
            methodPressureUnitCombo.DisplayMember = "Name";
            methodPressureUnitCombo.ValueMember = "Value";

            methodTempUnitCombo.DataSource = EnumHelper.GetNameValues<EUnitTemperature>();
            methodTempUnitCombo.DisplayMember = "Name";
            methodTempUnitCombo.ValueMember = "Value";

            methodDiffPressureUnitCombo.DataSource = EnumHelper.GetNameValues<EUnitDiffPressure>();
            methodDiffPressureUnitCombo.DisplayMember = "Name";
            methodDiffPressureUnitCombo.ValueMember = "Value";

            methodAtmPressureUnitCombo.DataSource = EnumHelper.GetNameValues<EUnitAtmPressure>();
            methodAtmPressureUnitCombo.DisplayMember = "Name";
            methodAtmPressureUnitCombo.ValueMember = "Value";

            foreach (TabPage page in ratedTab.TabPages)
            {
                EConditionRated index = (EConditionRated)int.Parse(page.Tag.ToString());
                CtrlTestRated ctrl = new CtrlTestRated(index, context.Value.Calcurated);
                ctrl.CalcCapacity += DoCalcCapacity;
                ctrl.ChangedPowerMeter += DoChangedPowerMeter;
                page.Controls.Add(ctrl);
            }

            schAddButton_Click(null, null);
        }
        private void Initialize()
        {
            Color evenColor = Color.FromArgb(244, 244, 236);

            db       = Resource.ConfigDB;
            mode     = EDataSetMode.View;
            bookmark = new GridBookmark(conditionGridView);

            int length = Resource.Tag.ThermoLength / 3;

            id1TCs = new List <MeasureRow>();
            id2TCs = new List <MeasureRow>();
            odTCs  = new List <MeasureRow>();

            for (int i = 0; i < length; i++)
            {
                id1TCs.Add(new MeasureRow(null, "", "", i + 1));
                id2TCs.Add(new MeasureRow(null, "", "", i + length + 1));
                odTCs.Add(new MeasureRow(null, "", "", i + length * 2 + 1));
            }

            presses = new List <MeasureRow>();

            for (int i = 0; i < Resource.Tag.PressLength; i++)
            {
                presses.Add(new MeasureRow(null, "", "", i + 1));
            }

            thermo1Grid.DataSource = id1TCs;
            thermo1GridView.Appearance.EvenRow.BackColor        = evenColor;
            thermo1GridView.OptionsView.EnableAppearanceEvenRow = true;

            thermo2Grid.DataSource = id2TCs;
            thermo2GridView.Appearance.EvenRow.BackColor        = evenColor;
            thermo2GridView.OptionsView.EnableAppearanceEvenRow = true;

            thermo3Grid.DataSource = odTCs;
            thermo3GridView.Appearance.EvenRow.BackColor        = evenColor;
            thermo3GridView.OptionsView.EnableAppearanceEvenRow = true;

            thermoTagGrid.DataSource = Resource.Tag.Thermos;
            thermoTagGridView.Appearance.EvenRow.BackColor        = evenColor;
            thermoTagGridView.OptionsView.EnableAppearanceEvenRow = true;

            pressureGrid.DataSource = presses;
            pressureGridView.Appearance.EvenRow.BackColor        = evenColor;
            pressureGridView.OptionsView.EnableAppearanceEvenRow = true;

            pressureTagGrid.DataSource = Resource.Tag.Presses;
            pressureTagGridView.Appearance.EvenRow.BackColor        = evenColor;
            pressureTagGridView.OptionsView.EnableAppearanceEvenRow = true;

            methodCapaCoolingUnitCombo.DisplayMember = "Name";
            methodCapaCoolingUnitCombo.ValueMember   = "Value";
            methodCapaCoolingUnitCombo.DataSource    = EnumHelper.GetNameValues <EUnitCapacity>();

            methodCapaHeatingUnitCombo.DisplayMember = "Name";
            methodCapaHeatingUnitCombo.ValueMember   = "Value";
            methodCapaHeatingUnitCombo.DataSource    = EnumHelper.GetNameValues <EUnitCapacity>();

            foreach (TabPage page in ratedTab.TabPages)
            {
                EConditionRated index = (EConditionRated)int.Parse(page.Tag.ToString());
                CtrlTestRated   ctrl  = new CtrlTestRated(index, Resource.Variables.Graph);
                ctrl.CalcCapacity      += DoCalcCapacity;
                ctrl.ChangedPowerMeter += DoChangedPowerMeter;
                page.Controls.Add(ctrl);
            }

            noteEdits = new List <TextEdit>();
            noteEdits.Add(noteCompanyEdit);
            noteEdits.Add(noteTestNameEdit);
            noteEdits.Add(noteTestNoEdit);
            noteEdits.Add(noteObserverEdit);
            noteEdits.Add(noteMakerEdit);
            noteEdits.Add(noteModel1Edit);
            noteEdits.Add(noteSerial1Edit);
            noteEdits.Add(noteModel2Edit);
            noteEdits.Add(noteSerial2Edit);
            noteEdits.Add(noteModel3Edit);
            noteEdits.Add(noteSerial3Edit);
            noteEdits.Add(noteExpDeviceEdit);
            noteEdits.Add(noteRefChargeEdit);
            noteEdits.Add(noteMemoEdit);

            gridViews = new List <GridView>();
            gridViews.Add(thermo1GridView);
            gridViews.Add(thermo2GridView);
            gridViews.Add(thermo3GridView);
            gridViews.Add(thermoTagGridView);
            gridViews.Add(pressureGridView);
            gridViews.Add(pressureTagGridView);

            SetPanelActive(true);
        }
Esempio n. 6
0
        private void Initialize()
        {
            Color evenColor = Color.FromArgb(244, 244, 236);
            int   length    = Resource.Tag.ThermoLength / 3;

            RecNo = -1;

            id1TCs = new List <MeasureRow>();
            id2TCs = new List <MeasureRow>();
            odTCs  = new List <MeasureRow>();

            for (int i = 0; i < length; i++)
            {
                id1TCs.Add(new MeasureRow(null, "", "", i + 1));
                id2TCs.Add(new MeasureRow(null, "", "", i + length + 1));
                odTCs.Add(new MeasureRow(null, "", "", i + length * 2 + 1));
            }

            presses = new List <MeasureRow>();

            for (int i = 0; i < Resource.Tag.PressLength; i++)
            {
                presses.Add(new MeasureRow(null, "", "", i + 1));
            }

            thermo1Grid.DataSource      = id1TCs;
            thermo1Grid.UseDirectXPaint = DefaultBoolean.False;
            thermo1GridView.Appearance.EvenRow.BackColor        = evenColor;
            thermo1GridView.OptionsView.EnableAppearanceEvenRow = true;

            thermo2Grid.DataSource      = id2TCs;
            thermo2Grid.UseDirectXPaint = DefaultBoolean.False;
            thermo2GridView.Appearance.EvenRow.BackColor        = evenColor;
            thermo2GridView.OptionsView.EnableAppearanceEvenRow = true;

            thermo3Grid.DataSource      = odTCs;
            thermo3Grid.UseDirectXPaint = DefaultBoolean.False;
            thermo3GridView.Appearance.EvenRow.BackColor        = evenColor;
            thermo3GridView.OptionsView.EnableAppearanceEvenRow = true;

            pressureGrid.DataSource      = presses;
            pressureGrid.UseDirectXPaint = DefaultBoolean.False;
            pressureGridView.Appearance.EvenRow.BackColor        = evenColor;
            pressureGridView.OptionsView.EnableAppearanceEvenRow = true;

            methodCapaCoolingUnitCombo.DisplayMember = "Name";
            methodCapaCoolingUnitCombo.ValueMember   = "Value";
            methodCapaCoolingUnitCombo.DataSource    = EnumHelper.GetNameValues <EUnitCapacity>();

            methodCapaHeatingUnitCombo.DisplayMember = "Name";
            methodCapaHeatingUnitCombo.ValueMember   = "Value";
            methodCapaHeatingUnitCombo.DataSource    = EnumHelper.GetNameValues <EUnitCapacity>();

            foreach (TabPage page in ratedTab.TabPages)
            {
                EConditionRated index = (EConditionRated)int.Parse(page.Tag.ToString());
                CtrlTestRated   ctrl  = new CtrlTestRated(index, Resource.Variables.Calcurated);
                page.Controls.Add(ctrl);
            }

            noteEdits = new List <TextEdit>();
            noteEdits.Add(noteCompanyEdit);
            noteEdits.Add(noteTestNameEdit);
            noteEdits.Add(noteTestNoEdit);
            noteEdits.Add(noteObserverEdit);
            noteEdits.Add(noteMakerEdit);
            noteEdits.Add(noteModel1Edit);
            noteEdits.Add(noteSerial1Edit);
            noteEdits.Add(noteModel2Edit);
            noteEdits.Add(noteSerial2Edit);
            noteEdits.Add(noteModel3Edit);
            noteEdits.Add(noteSerial3Edit);
            noteEdits.Add(noteExpDeviceEdit);
            noteEdits.Add(noteRefChargeEdit);
            noteEdits.Add(noteMemoEdit);

            gridViews = new List <GridView>();
            gridViews.Add(thermo1GridView);
            gridViews.Add(thermo2GridView);
            gridViews.Add(thermo3GridView);
            gridViews.Add(pressureGridView);

            SetEditReadOnly(true);
        }