Example #1
0
        private double GetCapacityRatiokj(EUnitCapacity to)
        {
            double ratio = 0;

            switch (to)
            {
            case EUnitCapacity.W:
                ratio = 1.0 / 4.1868 * 1.1628;
                break;

            case EUnitCapacity.kcal:
                ratio = 1.0 / 4.1868;
                break;

            case EUnitCapacity.Btu:
                ratio = 1.0 / 4.1868 * 3.968;
                break;

            case EUnitCapacity.kJ:
                ratio = 1.0;
                break;
            }

            return(ratio);
        }
Example #2
0
        private double GetCapacityRatio(EUnitCapacity from, EUnitCapacity to)
        {
            double ratio = 0;

            switch (from)
            {
            case EUnitCapacity.W:
                ratio = GetCapacityRatioWatt(to);
                break;

            case EUnitCapacity.kcal:
                ratio = GetCapacityRatiokcal(to);
                break;

            case EUnitCapacity.Btu:
                ratio = GetCapacityRatioBtu(to);
                break;

            case EUnitCapacity.kJ:
                ratio = GetCapacityRatiokj(to);
                break;
            }

            return(ratio);
        }
Example #3
0
        public void Initialize()
        {
            RecNo   = -1;
            RegTime = DateTime.Now;

            ConditionSchedule sch = context.Condition.Schedules[context.Index];
            ReportSheet       sheet;

            ConditionMethod method = context.Condition.Method;

            Method.IntegralCount         = method.IntegralCount;
            Method.IntegralTime          = method.IntegralTime;
            Method.ScanTime              = method.ScanTime;
            Method.CoolingCapacity       = method.CoolingCapacity;
            Method.HeatingCapacity       = method.HeatingCapacity;
            Method.AirFlow               = method.AirFlow;
            Method.Enthalpy              = method.Enthalpy;
            Method.Pressure              = method.Pressure;
            Method.DiffPressure          = method.DiffPressure;
            Method.AtmPressure           = method.AtmPressure;
            Method.AutoControllerSetting = method.AutoControllerSetting;
            Method.UsePowerMeterIntegral = method.UsePowerMeterIntegral;

            ConditionNote note = context.Condition.Note;

            Note.Company     = note.Company;
            Note.Name        = note.Name;
            Note.No          = note.No;
            Note.Observer    = note.Observer;
            Note.Maker       = note.Maker;
            Note.Model1      = note.Model1;
            Note.Serial1     = note.Serial1;
            Note.Model2      = note.Model2;
            Note.Serial2     = note.Serial2;
            Note.Model3      = note.Model3;
            Note.Serial3     = note.Serial3;
            Note.ExpDevice   = note.ExpDevice;
            Note.Refrigerant = note.Refrigerant;
            Note.RefCharge   = note.RefCharge;
            Note.Memo        = note.Memo;

            EIndoorMode mode = sch.IndoorMode;

            if (mode == EIndoorMode.NotUsed)
            {
                mode = EIndoorMode.Cooling;
            }

            EUnitCapacity unitCapa = (mode == EIndoorMode.Cooling) ? method.CoolingCapacity : method.HeatingCapacity;

            context.Value.SetUnitTo(EUnitType.Capacity, (int)unitCapa);
            context.Value.SetUnitTo(EUnitType.EER_COP, (int)unitCapa);

            ConditionRated rated = context.Condition.Rateds[EConditionRated.Total][(int)mode];

            Rated.Capacity   = rated.Capacity;
            Rated.PowerInput = rated.PowerInput;
            Rated.EER_COP    = rated.EER_COP;
            Rated.Voltage    = rated.Voltage;
            Rated.Current    = rated.Current;
            Rated.Frequency  = rated.Frequency;
            Rated.PM_IDU     = rated.PM_IDU;
            Rated.PM_ODU     = rated.PM_ODU;
            Rated.Wiring     = rated.Wiring;

            lock (ValueSheets)
            {
                string nozzleName;
                string nozzleState = "O,O,O,O";
                List <CoefficientDataRow> coeff = Resource.Settings.Coefficients;

                ValueSheets.Clear();

                nozzleName = $"Nozzle ({coeff[0].Nozzle1:f0}/{coeff[0].Nozzle2:f0}/{coeff[0].Nozzle3:f0}/{coeff[0].Nozzle4:f0})";
                sheet      = new ReportCalorieSheet(context, "ID1", "ID11",
                                                    sch.Indoor1DB, sch.Indoor1WB, sch.Indoor1Use, sch.Indoor1Mode1,
                                                    sch.OutdoorDB, sch.OutdoorWB, sch.OutdoorUse, sch.OutdoorDpSensor,
                                                    nozzleName, nozzleState);
                sheet.Use = (sch.Indoor1Use == EIndoorUse.Indoor) ? true : false;
                ValueSheets.Add("ID A #1", sheet);

                nozzleName = $"Nozzle ({coeff[1].Nozzle1:f0}/{coeff[1].Nozzle2:f0}/{coeff[1].Nozzle3:f0}/{coeff[1].Nozzle4:f0})";
                sheet      = new ReportCalorieSheet(context, "ID1", "ID12",
                                                    sch.Indoor1DB, sch.Indoor1WB, sch.Indoor1Use, sch.Indoor1Mode2,
                                                    sch.OutdoorDB, sch.OutdoorWB, sch.OutdoorUse, sch.OutdoorDpSensor,
                                                    nozzleName, nozzleState);
                sheet.Use = (sch.Indoor1Use == EIndoorUse.Indoor) ? true : false;
                ValueSheets.Add("ID A #2", sheet);

                nozzleName = $"Nozzle ({coeff[2].Nozzle1:f0}/{coeff[2].Nozzle2:f0}/{coeff[2].Nozzle3:f0}/{coeff[2].Nozzle4:f0})";
                sheet      = new ReportCalorieSheet(context, "ID2", "ID21",
                                                    sch.Indoor2DB, sch.Indoor2WB, sch.Indoor2Use, sch.Indoor2Mode1,
                                                    sch.OutdoorDB, sch.OutdoorWB, sch.OutdoorUse, sch.OutdoorDpSensor,
                                                    nozzleName, nozzleState);
                sheet.Use = (sch.Indoor2Use == EIndoorUse.Indoor) ? true : false;
                ValueSheets.Add("ID B #1", sheet);

                nozzleName = $"Nozzle ({coeff[3].Nozzle1:f0}/{coeff[3].Nozzle2:f0}/{coeff[3].Nozzle3:f0}/{coeff[3].Nozzle4:f0})";
                sheet      = new ReportCalorieSheet(context, "ID2", "ID22",
                                                    sch.Indoor2DB, sch.Indoor2WB, sch.Indoor2Use, sch.Indoor2Mode2,
                                                    sch.OutdoorDB, sch.OutdoorWB, sch.OutdoorUse, sch.OutdoorDpSensor,
                                                    nozzleName, nozzleState);
                sheet.Use = (sch.Indoor2Use == EIndoorUse.Indoor) ? true : false;
                ValueSheets.Add("ID B #2", sheet);

                sheet = new ReportThermoSheet(context, "ID1", "",
                                              sch.Indoor1DB, sch.Indoor1WB, sch.Indoor1Use, sch.Indoor1Mode1,
                                              sch.OutdoorDB, sch.OutdoorWB, sch.OutdoorUse, sch.OutdoorDpSensor, "", "");
                if (sheet.Use == true)
                {
                    sheet.Use = (sch.Indoor1Use == EIndoorUse.Indoor) ? true : false;
                }
                ValueSheets.Add("ID A TC", sheet);

                sheet = new ReportThermoSheet(context, "ID2", "",
                                              sch.Indoor2DB, sch.Indoor2WB, sch.Indoor2Use, sch.Indoor2Mode1,
                                              sch.OutdoorDB, sch.OutdoorWB, sch.OutdoorUse, sch.OutdoorDpSensor, "", "");
                if (sheet.Use == true)
                {
                    sheet.Use = (sch.Indoor2Use == EIndoorUse.Indoor) ? true : false;
                }
                ValueSheets.Add("ID B TC", sheet);

                sheet = new ReportThermoSheet(context, "OD", "",
                                              sch.Indoor1DB, sch.Indoor1WB, sch.Indoor1Use, sch.Indoor1Mode1,
                                              sch.OutdoorDB, sch.OutdoorWB, sch.OutdoorUse, sch.OutdoorDpSensor, "", "");
                if (sheet.Use == true)
                {
                    sheet.Use = (sch.OutdoorUse == EOutdoorUse.Outdoor) ? true : false;
                }
                ValueSheets.Add("OD TC", sheet);
            }

            DataRaw.Clear();

            foreach (KeyValuePair <string, ValueRow> row in context.Value.Calcurated)
            {
                if (row.Value.Save == true)
                {
                    DataRaw.Rows.Add(row.Key, new DataRaw(-1, row.Value));
                }
            }

            foreach (KeyValuePair <string, ValueRow> row in context.Value.Measured)
            {
                if (row.Value.Save == true)
                {
                    DataRaw.Rows.Add(row.Key, new DataRaw(-1, row.Value));
                }
            }

            DataRaw.Count = DataRaw.Rows.Count / 600;
            if ((DataRaw.Rows.Count % 600) != 0)
            {
                DataRaw.Count++;
            }
        }