public Appliance CreateAppliance(ApplianceTypes type)
        {
            Appliance app = new Appliance();

            if (type == ApplianceTypes.Boiler || type == ApplianceTypes.CHP ||
                type == ApplianceTypes.HeatPump || type == ApplianceTypes.LowTempHeatPump ||
                type == ApplianceTypes.WaterHeater)
            {
                app.DataSheet = new HeatingUnitDataSheet(); return(app);
            }
            else if (type == ApplianceTypes.SolarPanel)
            {
                app.DataSheet = new SolarCollectorDataSheet(); return(app);
            }
            else if (type == ApplianceTypes.SolarStation)
            {
                app.DataSheet = new SolarStationDataSheet(); return(app);
            }
            else if (type == ApplianceTypes.TemperatureController)
            {
                app.DataSheet = new TemperatureControllerDataSheet(); return(app);
            }
            else if (type == ApplianceTypes.Container)
            {
                app.DataSheet = new ContainerDataSheet(); return(app);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 2
0
        public static List <string> EEIChar(ApplianceTypes PrimaryHeat, float CalcEEI, float uncertainty = 0)
        {
            switch (PrimaryHeat)
            {
            case ApplianceTypes.HeatPump:
            case ApplianceTypes.Boiler:
            case ApplianceTypes.CHP:
                var heatBoilChPindex = GetLabel(PrimPumpOrBoilOrChp, CalcEEI, uncertainty);
                return(new List <string>
                {
                    Labels[heatBoilChPindex],
                    GetToNext(PrimPumpOrBoilOrChp, CalcEEI, heatBoilChPindex),
                    GetNextLabel(heatBoilChPindex)
                });

            case ApplianceTypes.LowTempHeatPump:
                var lowTempIndex = GetLabel(LowHeatPump, CalcEEI, uncertainty);
                return(new List <string>
                {
                    Labels[lowTempIndex],
                    GetToNext(PrimPumpOrBoilOrChp, CalcEEI, lowTempIndex),
                    GetNextLabel(lowTempIndex)
                });

            default:
                return(null);
            }
        }
Exemplo n.º 3
0
 public static DataSheet ConvertTypeToDataSheet(ApplianceTypes type)
 {
     if (TypeDataSheetTypeAssociation.ContainsKey(type))
     {
         return(Activator.CreateInstance(TypeDataSheetTypeAssociation[type]) as DataSheet);
     }
     return(null);
 }
Exemplo n.º 4
0
 public Appliance(string name, DataSheet datasheet, ApplianceTypes type)
 {
     Name      = name;
     DataSheet = datasheet;
     Type      = type;
 }
 public ApplianceStub(string name, HeatingUnitDataSheet datasheet, ApplianceTypes type)
 {
     Name = name; DataSheet = datasheet; Type = type;
 }
 public ApplianceStub(string name, SolarStationDataSheet datasheet, ApplianceTypes type)
 {
     Name = name; DataSheet = datasheet; Type = type;
 }
 public ApplianceStub(string name, TemperatureControllerDataSheet datasheet, ApplianceTypes type)
 {
     Name = name; DataSheet = datasheet; Type = type;
 }
 public ApplianceStub(string name, ContainerDataSheet datasheet, ApplianceTypes type)
 {
     Name = name; DataSheet = datasheet; Type = type;
 }
Exemplo n.º 9
0
 public void LabelChooserRegularReturnscCorrectLabel_true(ApplianceTypes Type, float calcEEI, string expected)
 {
     Assert.AreEqual(EEICharLabelChooser.EEIChar(Type, calcEEI)[0], expected);
 }
Exemplo n.º 10
0
 public ObservedData ToObservedData()
 {
     return(new ObservedData(TimeUnitId, Timestamps, ApplianceTypes.Select(at => at.ToApplianceType(Timestamps)).ToList(),
                             RootPowers.Select(p => (short?)p).ToList()));
 }
Exemplo n.º 11
0
 public static string ConvertTypeToString(ApplianceTypes type)
 {
     return(TypeNameAssocation.ContainsKey(type) ? TypeNameAssocation[type] : null);
 }
Exemplo n.º 12
0
 private void PopulateCombobox()
 {
     cmbTypes.ItemsSource = ApplianceTypes.GetApplianceTypes();
 }