//
//
// To parse this JSON data, add NuGet 'Newtonsoft.Json' then do:
//
// using HEM;
//
// var coordinate = Coordinate.FromJson(jsonString);
namespace HEM
{
using System;
using System.Collections.Generic;
using System.Globalization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
public partial class Coordinate
{
[JsonProperty("ApplianceGains", NullValueHandling = NullValueHandling.Ignore)]
public Dictionary ApplianceGains { get; set; }
[JsonProperty("Appliances")]
public Dictionary Appliances { get; set; }
[JsonProperty("ColdWaterSource")]
public ColdWaterSourceClass ColdWaterSource { get; set; }
[JsonProperty("Control")]
public Dictionary Control { get; set; }
[JsonProperty("EnergySupply")]
public Dictionary EnergySupply { get; set; }
[JsonProperty("Events")]
public Dictionary>> Events { get; set; }
[JsonProperty("ExternalConditions")]
public ExternalConditions ExternalConditions { get; set; }
[JsonProperty("General")]
public General General { get; set; }
///
/// For a house, the area of the ground floor (unit: m²)
///
[JsonProperty("GroundFloorArea")]
public double? GroundFloorArea { get; set; }
[JsonProperty("HeatingControlType")]
public HeatingControlTypeEnum? HeatingControlType { get; set; }
[JsonProperty("HeatSourceWet")]
public Dictionary HeatSourceWet { get; set; }
[JsonProperty("HotWaterDemand")]
public HotWaterDemand HotWaterDemand { get; set; }
[JsonProperty("HotWaterSource")]
public HotWaterSource HotWaterSource { get; set; }
[JsonProperty("InfiltrationVentilation")]
public InfiltrationVentilation InfiltrationVentilation { get; set; }
[JsonProperty("InternalGains")]
public InternalGains InternalGains { get; set; }
[JsonProperty("NumberOfBedrooms")]
public long? NumberOfBedrooms { get; set; }
[JsonProperty("NumberOfWetRooms")]
public long? NumberOfWetRooms { get; set; }
[JsonProperty("OnSiteGeneration")]
public Dictionary OnSiteGeneration { get; set; }
[JsonProperty("PartGcompliance")]
public bool? PartGcompliance { get; set; }
[JsonProperty("PartO_active_cooling_required")]
public bool? PartO_active_cooling_required { get; set; }
[JsonProperty("PreHeatedWaterSource")]
public Dictionary PreHeatedWaterSource { get; set; }
[JsonProperty("SimulationTime")]
public SimulationTime SimulationTime { get; set; }
[JsonProperty("SmartApplianceControls", NullValueHandling = NullValueHandling.Ignore)]
public Dictionary SmartApplianceControls { get; set; }
[JsonProperty("SpaceCoolSystem")]
public Dictionary SpaceCoolSystem { get; set; }
[JsonProperty("SpaceHeatSystem")]
public Dictionary SpaceHeatSystem { get; set; }
[JsonProperty("Tariff")]
public TariffClass Tariff { get; set; }
[JsonProperty("temp_internal_air_static_calcs")]
public double? temp_internal_air_static_calcs { get; set; }
[JsonProperty("WaterHeatSchedDefault")]
public WaterHeatSchedDefaultEnum? WaterHeatSchedDefault { get; set; }
[JsonProperty("Window_Opening_For_Cooling")]
public WindowOpeningForCoolingClass Window_Opening_For_Cooling { get; set; }
[JsonProperty("WWHRS")]
public Dictionary WWHRS { get; set; }
[JsonProperty("Zone")]
public Dictionary Zone { get; set; }
}
public partial class ApplianceGainValue
{
[JsonProperty("EnergySupply")]
public string EnergySupply { get; set; }
///
/// List of appliance usage events
///
[JsonProperty("Events")]
public List Events { get; set; }
///
/// Proportion of appliance demand turned into heat gains (no unit)
///
[JsonProperty("gains_fraction")]
public double gains_fraction { get; set; }
[JsonProperty("loadshifting")]
public LoadshiftingClass loadshifting { get; set; }
[JsonProperty("priority")]
public long? priority { get; set; }
[JsonProperty("schedule")]
public Dictionary schedule { get; set; }
///
/// Appliance power consumption when not in use (unit: W)
///
[JsonProperty("Standby")]
public double? Standby { get; set; }
///
/// First day of the time series, day of the year, 0 to 365
///
[JsonProperty("start_day")]
public long start_day { get; set; }
///
/// Timestep of the time series data (unit: hours)
///
[JsonProperty("time_series_step")]
public double time_series_step { get; set; }
[JsonProperty("type")]
public string type { get; set; }
}
public partial class ApplianceGainEvent
{
[JsonProperty("demand_W")]
public double demand_W { get; set; }
[JsonProperty("duration")]
public double duration { get; set; }
[JsonProperty("start")]
public double start { get; set; }
}
public partial class LoadshiftingClass
{
[JsonProperty("Control", NullValueHandling = NullValueHandling.Ignore)]
public string Control { get; set; }
[JsonProperty("demand_limit_weighted")]
public double demand_limit_weighted { get; set; }
[JsonProperty("demand_timeseries")]
public List demand_timeseries { get; set; }
[JsonProperty("max_shift_hrs")]
public double max_shift_hrs { get; set; }
[JsonProperty("priority")]
public long? priority { get; set; }
[JsonProperty("weight", NullValueHandling = NullValueHandling.Ignore)]
public Weight? weight { get; set; }
[JsonProperty("weight_timeseries")]
public List weight_timeseries { get; set; }
}
public partial class TempChargeCutDeltaClass
{
[JsonProperty("repeat")]
public long repeat { get; set; }
[JsonProperty("value")]
public ChargeLevelValue value { get; set; }
}
public partial class ApplianceClass
{
[JsonProperty("Energysupply")]
public string Energysupply { get; set; }
[JsonProperty("kg_load")]
public double? kg_load { get; set; }
[JsonProperty("kWh_per_100cycle")]
public double? kWh_per_100cycle { get; set; }
[JsonProperty("kWh_per_annum")]
public double? kWh_per_annum { get; set; }
[JsonProperty("kWh_per_cycle")]
public double? kWh_per_cycle { get; set; }
[JsonProperty("loadshifting")]
public LoadshiftingClass loadshifting { get; set; }
[JsonProperty("standard_use")]
public double? standard_use { get; set; }
}
public partial class ColdWaterSourceClass
{
[JsonProperty("header tank")]
public HeaderTankClass headertank { get; set; }
[JsonProperty("mains water")]
public HeaderTankClass mainswater { get; set; }
}
public partial class HeaderTankClass
{
///
/// First day of the time series, day of the year, 0 to 365
///
[JsonProperty("start_day")]
public long start_day { get; set; }
///
/// List of cold water temperatures, one entry per hour (unit: ˚C)
///
[JsonProperty("temperatures")]
public List temperatures { get; set; }
///
/// Timestep of the time series data (unit: hours)
///
[JsonProperty("time_series_step")]
public double time_series_step { get; set; }
[JsonProperty("type")]
public string type { get; set; }
}
public partial class EControl
{
[JsonProperty("allow_null")]
public bool? allow_null { get; set; }
[JsonProperty("logic_type")]
public LogicTypeEnum? logic_type { get; set; }
///
/// List of boolean values where true means on, one entry per hour
///
/// List of cost values (one entry per time_series_step)
///
/// List of temperature values, one entry per hour (unit: ˚C)
///
/// List of boolean values where true means 'on' (one entry per hour)
///
[JsonProperty("schedule", NullValueHandling = NullValueHandling.Ignore)]
public Dictionary schedule { get; set; }
///
/// First day of the time series, day of the year, 0 to 365
///
[JsonProperty("start_day")]
public long start_day { get; set; }
///
/// Timestep of the time series data (unit: hours)
///
[JsonProperty("time_series_step")]
public double time_series_step { get; set; }
[JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)]
public ControlType? type { get; set; }
///
/// Number of 'on' hours to be set per day
///
[JsonProperty("time_on_daily")]
public double? time_on_daily { get; set; }
///
/// How long before heating period the system should switch on (unit: hours)
///
[JsonProperty("advanced_start")]
public double? advanced_start { get; set; }
///
/// If both min and max limits are set but setpoint is not, whether to default to min (false)
/// or max (true)
///
[JsonProperty("default_to_max")]
public bool? default_to_max { get; set; }
///
/// Maximum setpoint allowed (unit: ˚C)
///
[JsonProperty("setpoint_max")]
public double? setpoint_max { get; set; }
///
/// Minimum setpoint allowed (unit: ˚C)
///
[JsonProperty("setpoint_min")]
public double? setpoint_min { get; set; }
///
/// Proportion of the charge targeted for each day
///
[JsonProperty("charge_level")]
public ChargeLevel? charge_level { get; set; }
[JsonProperty("external_sensor")]
public ExternalSensorClass external_sensor { get; set; }
[JsonProperty("full_charge_temp_diff")]
public double? full_charge_temp_diff { get; set; }
[JsonProperty("min_target_charge_factor")]
public double? min_target_charge_factor { get; set; }
///
/// (Ignored and likely not part of final specification)
///
[JsonProperty("target_charge")]
public double? target_charge { get; set; }
[JsonProperty("temp_charge_cut")]
public double? temp_charge_cut { get; set; }
[JsonProperty("temp_charge_cut_delta")]
public Dictionary temp_charge_cut_delta { get; set; }
[JsonProperty("combination", NullValueHandling = NullValueHandling.Ignore)]
public Dictionary combination { get; set; }
}
public partial class MainForm
{
[JsonProperty("controls")]
public List controls { get; set; }
[JsonProperty("operation")]
public Operation operation { get; set; }
}
public partial class ExternalSensorClass
{
[JsonProperty("correlation")]
public List correlation { get; set; }
}
public partial class CorrelationElement
{
[JsonProperty("max_charge")]
public double max_charge { get; set; }
[JsonProperty("temperature")]
public double temperature { get; set; }
}
public partial class PurpleCoordinat
{
[JsonProperty("repeat")]
public long repeat { get; set; }
[JsonProperty("value")]
public PurpleValue value { get; set; }
}
public partial class FluffyCoordinat
{
[JsonProperty("repeat")]
public long repeat { get; set; }
[JsonProperty("value")]
public PurpleValue value { get; set; }
}
public partial class EnergySupplyValue
{
[JsonProperty("diverter")]
public DiverterClass diverter { get; set; }
[JsonProperty("ElectricBattery")]
public ElectricBatteryClass ElectricBattery { get; set; }
[JsonProperty("factor")]
public FactorClass factor { get; set; }
[JsonProperty("fuel")]
public Fuel fuel { get; set; }
///
/// Denotes that this energy supply can export its surplus supply
///
[JsonProperty("is_export_capable")]
public bool? is_export_capable { get; set; }
[JsonProperty("priority")]
public List priority { get; set; }
[JsonProperty("tariff")]
public string tariff { get; set; }
[JsonProperty("threshold_charges")]
public List threshold_charges { get; set; }
[JsonProperty("threshold_prices")]
public List threshold_prices { get; set; }
}
public partial class ElectricBatteryClass
{
[JsonProperty("battery_age")]
public double battery_age { get; set; }
[JsonProperty("battery_location")]
public BatteryLocationEnum battery_location { get; set; }
[JsonProperty("capacity")]
public double capacity { get; set; }
[JsonProperty("charge_discharge_efficiency_round_trip")]
public double charge_discharge_efficiency_round_trip { get; set; }
[JsonProperty("grid_charging_possible")]
public bool grid_charging_possible { get; set; }
[JsonProperty("maximum_charge_rate_one_way_trip")]
public double maximum_charge_rate_one_way_trip { get; set; }
[JsonProperty("maximum_discharge_rate_one_way_trip")]
public double maximum_discharge_rate_one_way_trip { get; set; }
[JsonProperty("minimum_charge_rate_one_way_trip")]
public double minimum_charge_rate_one_way_trip { get; set; }
}
public partial class DiverterClass
{
[JsonProperty("Controlmax", NullValueHandling = NullValueHandling.Ignore)]
public string Controlmax { get; set; }
[JsonProperty("HeatSource")]
public HeatSource HeatSource { get; set; }
[JsonProperty("StorageTank")]
public StorageTankEnum? StorageTank { get; set; }
}
public partial class FactorClass
{
[JsonProperty("Emissions Factor kgCO2e/kWh")]
public double EmissionsFactorkgCO2ekWh { get; set; }
[JsonProperty("Emissions Factor kgCO2e/kWh including out-of-scope emissions")]
public double EmissionsFactorkgCO2ekWhincludingoutofscopeemissions { get; set; }
[JsonProperty("Primary Energy Factor kWh/kWh delivered")]
public double PrimaryEnergyFactorkWhkWhdelivered { get; set; }
}
public partial class CoordinateEvent
{
[JsonProperty("duration")]
public double? duration { get; set; }
[JsonProperty("start")]
public double start { get; set; }
[JsonProperty("temperature")]
public double temperature { get; set; }
[JsonProperty("volume")]
public double? volume { get; set; }
}
public partial class ExternalConditions
{
///
/// List of external air temperatures, one entry per hour (unit: ˚C)
///
[JsonProperty("air_temperatures")]
public List air_temperatures { get; set; }
///
/// How daylight savings are handled in the climate data
///
[JsonProperty("daylight_savings")]
public DaylightSavingsEnum? daylight_savings { get; set; }
///
/// List of diffuse horizontal radiation values, one entry per hour (unit: W/m²)
///
[JsonProperty("diffuse_horizontal_radiation")]
public List diffuse_horizontal_radiation { get; set; }
///
/// A flag to indicate whether direct beam radiation from climate data needs to be converted
/// from horizontal to normal incidence; if normal direct beam radiation values are provided
/// then no conversion is needed
///
[JsonProperty("direct_beam_conversion_needed")]
public bool? direct_beam_conversion_needed { get; set; }
///
/// List of direct beam radiation values, one entry per hour (unit: W/m²)
///
[JsonProperty("direct_beam_radiation")]
public List direct_beam_radiation { get; set; }
///
/// Last day of the time series, day of the year, 0 to 365
///
[JsonProperty("end_day")]
public long? end_day { get; set; }
///
/// (Not used)
///
[JsonProperty("ground_temperatures")]
public List ground_temperatures { get; set; }
///
/// Day of the week for January 1st, Monday to Sunday, 1 to 7
///
[JsonProperty("january_first")]
public long? january_first { get; set; }
///
/// Latitude of weather station, angle from south (unit: ˚)
///
[JsonProperty("latitude")]
public double? latitude { get; set; }
///
/// Whether climate data includes a leap day
///
[JsonProperty("leap_day_included")]
public bool? leap_day_included { get; set; }
///
/// Longitude of weather station, easterly +ve westerly -ve (unit: ˚)
///
[JsonProperty("longitude")]
public double? longitude { get; set; }
///
/// Data splitting the ground plane into segments (8-36) and giving height and distance to
/// shading objects surrounding the building
///
[JsonProperty("shading_segments", NullValueHandling = NullValueHandling.Ignore)]
public List shading_segments { get; set; }
///
/// List of ground reflectivity values, 0 to 1, one entry per hour
///
[JsonProperty("solar_reflectivity_of_ground")]
public List solar_reflectivity_of_ground { get; set; }
///
/// First day of the time series, day of the year, 0 to 365
///
[JsonProperty("start_day")]
public long? start_day { get; set; }
///
/// Timestep of the time series data (unit: hours)
///
[JsonProperty("time_series_step")]
public double? time_series_step { get; set; }
///
/// Timezone of weather station, -12 to 12
///
[JsonProperty("timezone")]
public long? timezone { get; set; }
///
/// List of wind directions in degrees where North=0, East=90, South=180, West=270. Values
/// range: 0 to 360. Wind direction is reported by the direction from which it originates,
/// e.g. a southernly (180 degree) wind blows from the south to the north. (unit: ˚)
///
[JsonProperty("wind_directions")]
public List wind_directions { get; set; }
///
/// List of wind speeds, one entry per hour (unit: m/s)
///
[JsonProperty("wind_speeds")]
public List wind_speeds { get; set; }
}
public partial class ShadingSegmentElement
{
[JsonProperty("end360")]
public double end360 { get; set; }
[JsonProperty("number")]
public long number { get; set; }
[JsonProperty("shading")]
public List shading { get; set; }
[JsonProperty("start360")]
public double start360 { get; set; }
}
public partial class ShadingElement
{
[JsonProperty("distance")]
public double distance { get; set; }
[JsonProperty("height")]
public double height { get; set; }
[JsonProperty("type")]
public PurpleType type { get; set; }
}
public partial class General
{
[JsonProperty("build_type")]
public BuildType build_type { get; set; }
[JsonProperty("storey_of_dwelling")]
public long? storey_of_dwelling { get; set; }
[JsonProperty("storeys_in_building")]
public long storeys_in_building { get; set; }
}
public partial class HeatPump
{
[JsonProperty("backup_ctrl_type", NullValueHandling = NullValueHandling.Ignore)]
public BackupCtrlType? backup_ctrl_type { get; set; }
[JsonProperty("boiler")]
public BoilerClass boiler { get; set; }
[JsonProperty("BufferTank")]
public BufferTankClass BufferTank { get; set; }
[JsonProperty("eahp_mixed_max_temp")]
public double? eahp_mixed_max_temp { get; set; }
[JsonProperty("eahp_mixed_min_temp")]
public double? eahp_mixed_min_temp { get; set; }
[JsonProperty("EnergySupply")]
public string EnergySupply { get; set; }
[JsonProperty("EnergySupply_heat_network")]
public string EnergySupply_heat_network { get; set; }
[JsonProperty("MechanicalVentilation")]
public string MechanicalVentilation { get; set; }
[JsonProperty("min_modulation_rate_20")]
public double? min_modulation_rate_20 { get; set; }
[JsonProperty("min_modulation_rate_35")]
public double? min_modulation_rate_35 { get; set; }
[JsonProperty("min_modulation_rate_55")]
public double? min_modulation_rate_55 { get; set; }
[JsonProperty("min_temp_diff_flow_return_for_hp_to_operate", NullValueHandling = NullValueHandling.Ignore)]
public double? min_temp_diff_flow_return_for_hp_to_operate { get; set; }
[JsonProperty("modulating_control", NullValueHandling = NullValueHandling.Ignore)]
public bool? modulating_control { get; set; }
[JsonProperty("power_crankcase_heater", NullValueHandling = NullValueHandling.Ignore)]
public double? power_crankcase_heater { get; set; }
[JsonProperty("power_heating_circ_pump", NullValueHandling = NullValueHandling.Ignore)]
public double? power_heating_circ_pump { get; set; }
[JsonProperty("power_heating_warm_air_fan")]
public double? power_heating_warm_air_fan { get; set; }
[JsonProperty("power_max_backup")]
public double? power_max_backup { get; set; }
[JsonProperty("power_off", NullValueHandling = NullValueHandling.Ignore)]
public double? power_off { get; set; }
[JsonProperty("power_source_circ_pump", NullValueHandling = NullValueHandling.Ignore)]
public double? power_source_circ_pump { get; set; }
[JsonProperty("power_standby", NullValueHandling = NullValueHandling.Ignore)]
public double? power_standby { get; set; }
[JsonProperty("sink_type", NullValueHandling = NullValueHandling.Ignore)]
public SinkType? sink_type { get; set; }
[JsonProperty("source_type", NullValueHandling = NullValueHandling.Ignore)]
public SourceType? source_type { get; set; }
[JsonProperty("temp_distribution_heat_network")]
public double? temp_distribution_heat_network { get; set; }
[JsonProperty("temp_lower_operating_limit", NullValueHandling = NullValueHandling.Ignore)]
public double? temp_lower_operating_limit { get; set; }
[JsonProperty("temp_return_feed_max", NullValueHandling = NullValueHandling.Ignore)]
public double? temp_return_feed_max { get; set; }
[JsonProperty("test_data_EN14825", NullValueHandling = NullValueHandling.Ignore)]
public List test_data_EN14825 { get; set; }
[JsonProperty("time_constant_onoff_operation", NullValueHandling = NullValueHandling.Ignore)]
public double? time_constant_onoff_operation { get; set; }
[JsonProperty("time_delay_backup", NullValueHandling = NullValueHandling.Ignore)]
public double? time_delay_backup { get; set; }
[JsonProperty("type")]
public HeatSourceWetType type { get; set; }
[JsonProperty("var_flow_temp_ctrl_during_test", NullValueHandling = NullValueHandling.Ignore)]
public bool? var_flow_temp_ctrl_during_test { get; set; }
[JsonProperty("boiler_location", NullValueHandling = NullValueHandling.Ignore)]
public BoilerLocation? boiler_location { get; set; }
[JsonProperty("efficiency_full_load", NullValueHandling = NullValueHandling.Ignore)]
public double? efficiency_full_load { get; set; }
[JsonProperty("efficiency_part_load", NullValueHandling = NullValueHandling.Ignore)]
public double? efficiency_part_load { get; set; }
[JsonProperty("electricity_circ_pump", NullValueHandling = NullValueHandling.Ignore)]
public double? electricity_circ_pump { get; set; }
[JsonProperty("electricity_full_load", NullValueHandling = NullValueHandling.Ignore)]
public double? electricity_full_load { get; set; }
[JsonProperty("electricity_part_load", NullValueHandling = NullValueHandling.Ignore)]
public double? electricity_part_load { get; set; }
[JsonProperty("electricity_standby", NullValueHandling = NullValueHandling.Ignore)]
public double? electricity_standby { get; set; }
[JsonProperty("EnergySupply_aux", NullValueHandling = NullValueHandling.Ignore)]
public string EnergySupply_aux { get; set; }
[JsonProperty("modulation_load", NullValueHandling = NullValueHandling.Ignore)]
public double? modulation_load { get; set; }
[JsonProperty("rated_power", NullValueHandling = NullValueHandling.Ignore)]
public double? rated_power { get; set; }
[JsonProperty("A", NullValueHandling = NullValueHandling.Ignore)]
public double? A { get; set; }
[JsonProperty("B", NullValueHandling = NullValueHandling.Ignore)]
public double? B { get; set; }
[JsonProperty("capillary_diameter_m", NullValueHandling = NullValueHandling.Ignore)]
public double? capillary_diameter_m { get; set; }
[JsonProperty("ControlCharge", NullValueHandling = NullValueHandling.Ignore)]
public string ControlCharge { get; set; }
[JsonProperty("flow_rate_l_per_min", NullValueHandling = NullValueHandling.Ignore)]
public double? flow_rate_l_per_min { get; set; }
[JsonProperty("heat_battery_location", NullValueHandling = NullValueHandling.Ignore)]
public BoilerLocation? heat_battery_location { get; set; }
[JsonProperty("heat_exchanger_surface_area_m2", NullValueHandling = NullValueHandling.Ignore)]
public double? heat_exchanger_surface_area_m2 { get; set; }
[JsonProperty("heat_storage_zone_material_kJ_per_K_above_Phase_transition", NullValueHandling = NullValueHandling.Ignore)]
public double? heat_storage_zone_material_kJ_per_K_above_Phase_transition { get; set; }
[JsonProperty("heat_storage_zone_material_kJ_per_K_below_Phase_transition", NullValueHandling = NullValueHandling.Ignore)]
public double? heat_storage_zone_material_kJ_per_K_below_Phase_transition { get; set; }
[JsonProperty("heat_storage_zone_material_kJ_per_K_during_Phase_transition", NullValueHandling = NullValueHandling.Ignore)]
public double? heat_storage_zone_material_kJ_per_K_during_Phase_transition { get; set; }
[JsonProperty("max_rated_losses", NullValueHandling = NullValueHandling.Ignore)]
public double? max_rated_losses { get; set; }
[JsonProperty("max_temperature", NullValueHandling = NullValueHandling.Ignore)]
public double? max_temperature { get; set; }
[JsonProperty("number_of_units", NullValueHandling = NullValueHandling.Ignore)]
public long? number_of_units { get; set; }
[JsonProperty("phase_transition_temperature_lower", NullValueHandling = NullValueHandling.Ignore)]
public double? phase_transition_temperature_lower { get; set; }
[JsonProperty("phase_transition_temperature_upper", NullValueHandling = NullValueHandling.Ignore)]
public double? phase_transition_temperature_upper { get; set; }
[JsonProperty("rated_charge_power", NullValueHandling = NullValueHandling.Ignore)]
public double? rated_charge_power { get; set; }
[JsonProperty("simultaneous_charging_and_discharging", NullValueHandling = NullValueHandling.Ignore)]
public bool? simultaneous_charging_and_discharging { get; set; }
[JsonProperty("velocity_in_HEX_tube_at_1_l_per_min_m_per_s", NullValueHandling = NullValueHandling.Ignore)]
public double? velocity_in_HEX_tube_at_1_l_per_min_m_per_s { get; set; }
[JsonProperty("building_level_distribution_losses", NullValueHandling = NullValueHandling.Ignore)]
public double? building_level_distribution_losses { get; set; }
[JsonProperty("HIU_daily_loss", NullValueHandling = NullValueHandling.Ignore)]
public double? HIU_daily_loss { get; set; }
[JsonProperty("power_max", NullValueHandling = NullValueHandling.Ignore)]
public double? power_max { get; set; }
}
public partial class BufferTankClass
{
[JsonProperty("daily_losses")]
public double daily_losses { get; set; }
[JsonProperty("pump_fixed_flow_rate")]
public double pump_fixed_flow_rate { get; set; }
[JsonProperty("pump_power_at_flow_rate")]
public double pump_power_at_flow_rate { get; set; }
[JsonProperty("volume")]
public double volume { get; set; }
}
public partial class BoilerClass
{
[JsonProperty("boiler_location")]
public BoilerLocation boiler_location { get; set; }
[JsonProperty("cost_schedule_hybrid")]
public CostScheduleHybridClass cost_schedule_hybrid { get; set; }
[JsonProperty("efficiency_full_load")]
public double efficiency_full_load { get; set; }
[JsonProperty("efficiency_part_load")]
public double efficiency_part_load { get; set; }
[JsonProperty("electricity_circ_pump")]
public double electricity_circ_pump { get; set; }
[JsonProperty("electricity_full_load")]
public double electricity_full_load { get; set; }
[JsonProperty("electricity_part_load")]
public double electricity_part_load { get; set; }
[JsonProperty("electricity_standby")]
public double electricity_standby { get; set; }
[JsonProperty("EnergySupply")]
public string EnergySupply { get; set; }
[JsonProperty("EnergySupply_aux")]
public string EnergySupply_aux { get; set; }
[JsonProperty("modulation_load")]
public double modulation_load { get; set; }
[JsonProperty("rated_power")]
public double rated_power { get; set; }
}
public partial class CostScheduleHybridClass
{
[JsonProperty("cost_schedule_boiler")]
public Dictionary cost_schedule_boiler { get; set; }
[JsonProperty("cost_schedule_hp")]
public Dictionary cost_schedule_hp { get; set; }
[JsonProperty("cost_schedule_start_day")]
public long cost_schedule_start_day { get; set; }
[JsonProperty("cost_schedule_time_series_step")]
public double cost_schedule_time_series_step { get; set; }
}
public partial class TestDataEn14825Element
{
[JsonProperty("air_flow_rate")]
public double? air_flow_rate { get; set; }
[JsonProperty("capacity")]
public double capacity { get; set; }
[JsonProperty("cop")]
public double cop { get; set; }
[JsonProperty("degradation_coeff")]
public double degradation_coeff { get; set; }
[JsonProperty("design_flow_temp")]
public double design_flow_temp { get; set; }
[JsonProperty("eahp_mixed_ext_air_ratio")]
public double? eahp_mixed_ext_air_ratio { get; set; }
[JsonProperty("temp_outlet")]
public double temp_outlet { get; set; }
[JsonProperty("temp_source")]
public double temp_source { get; set; }
[JsonProperty("temp_test")]
public double temp_test { get; set; }
[JsonProperty("test_letter")]
public TestLetter test_letter { get; set; }
}
public partial class HotWaterDemand
{
[JsonProperty("Bath")]
public Dictionary Bath { get; set; }
[JsonProperty("Distribution")]
public List Distribution { get; set; }
[JsonProperty("Other")]
public Dictionary Other { get; set; }
[JsonProperty("Shower")]
public Dictionary Shower { get; set; }
}
public partial class BathValue
{
[JsonProperty("ColdWaterSource")]
public ColdWaterSourceEnum ColdWaterSource { get; set; }
///
/// Tap/outlet flow rate (unit: litre/minute)
///
[JsonProperty("flowrate")]
public double flowrate { get; set; }
///
/// Volume held by bath (unit: litre)
///
[JsonProperty("size")]
public double size { get; set; }
}
public partial class DistributionElement
{
[JsonProperty("external_diameter_mm")]
public double? external_diameter_mm { get; set; }
[JsonProperty("insulation_thermal_conductivity")]
public double? insulation_thermal_conductivity { get; set; }
[JsonProperty("insulation_thickness_mm")]
public double? insulation_thickness_mm { get; set; }
[JsonProperty("internal_diameter_mm")]
public double? internal_diameter_mm { get; set; }
[JsonProperty("length")]
public double length { get; set; }
[JsonProperty("location")]
public BoilerLocation location { get; set; }
[JsonProperty("pipe_contents")]
public PipeContentsEnum? pipe_contents { get; set; }
[JsonProperty("surface_reflectivity")]
public bool? surface_reflectivity { get; set; }
}
public partial class OtherValue
{
[JsonProperty("ColdWaterSource")]
public ColdWaterSourceEnum ColdWaterSource { get; set; }
///
/// Tap/outlet flow rate (unit: litre/minute)
///
[JsonProperty("flowrate")]
public double flowrate { get; set; }
}
public partial class Shower
{
[JsonProperty("ColdWaterSource")]
public ColdWaterSourceEnum ColdWaterSource { get; set; }
///
/// Tap/outlet flow rate (unit: litre/minute)
///
[JsonProperty("flowrate", NullValueHandling = NullValueHandling.Ignore)]
public double? flowrate { get; set; }
[JsonProperty("type")]
public ShowerType type { get; set; }
[JsonProperty("WWHRS")]
public string WWHRS { get; set; }
[JsonProperty("EnergySupply", NullValueHandling = NullValueHandling.Ignore)]
public string EnergySupply { get; set; }
[JsonProperty("rated_power", NullValueHandling = NullValueHandling.Ignore)]
public double? rated_power { get; set; }
}
public partial class HotWaterSource
{
[JsonProperty("hw cylinder")]
public StorageTank hwcylinder { get; set; }
}
public partial class StorageTank
{
[JsonProperty("ColdWaterSource")]
public string ColdWaterSource { get; set; }
[JsonProperty("Control_hold_at_setpnt")]
public string Control_hold_at_setpnt { get; set; }
///
/// Measured standby losses due to cylinder insulation at standardised conditions (unit:
/// kWh/24h)
///
[JsonProperty("daily_losses", NullValueHandling = NullValueHandling.Ignore)]
public double? daily_losses { get; set; }
[JsonProperty("heat_exchanger_surface_area")]
public double? heat_exchanger_surface_area { get; set; }
[JsonProperty("HeatSource", NullValueHandling = NullValueHandling.Ignore)]
public Dictionary HeatSource { get; set; }
[JsonProperty("init_temp")]
public double? init_temp { get; set; }
///
/// Minimum temperature required for domestic hot water (unit: ˚C)
///
[JsonProperty("min_temp")]
public double? min_temp { get; set; }
[JsonProperty("primary_pipework")]
public List primary_pipework { get; set; }
///
/// Setpoint temperature (unit: ˚C)
///
[JsonProperty("setpoint_temp")]
public double? setpoint_temp { get; set; }
[JsonProperty("type")]
public HwCylinderType type { get; set; }
///
/// Total volume of tank (unit: litre)
///
[JsonProperty("volume", NullValueHandling = NullValueHandling.Ignore)]
public double? volume { get; set; }
[JsonProperty("Control")]
public string Control { get; set; }
[JsonProperty("daily_HW_usage", NullValueHandling = NullValueHandling.Ignore)]
public double? daily_HW_usage { get; set; }
[JsonProperty("fuel_energy_2", NullValueHandling = NullValueHandling.Ignore)]
public double? fuel_energy_2 { get; set; }
[JsonProperty("HeatSourceWet", NullValueHandling = NullValueHandling.Ignore)]
public HeatSourceWet? HeatSourceWet { get; set; }
[JsonProperty("rejected_energy_1", NullValueHandling = NullValueHandling.Ignore)]
public double? rejected_energy_1 { get; set; }
[JsonProperty("rejected_energy_2", NullValueHandling = NullValueHandling.Ignore)]
public double? rejected_energy_2 { get; set; }
[JsonProperty("rejected_factor_3", NullValueHandling = NullValueHandling.Ignore)]
public double? rejected_factor_3 { get; set; }
[JsonProperty("separate_DHW_tests", NullValueHandling = NullValueHandling.Ignore)]
public SeparateDhwTests? separate_DHW_tests { get; set; }
[JsonProperty("storage_loss_factor_2", NullValueHandling = NullValueHandling.Ignore)]
public double? storage_loss_factor_2 { get; set; }
[JsonProperty("efficiency", NullValueHandling = NullValueHandling.Ignore)]
public double? efficiency { get; set; }
[JsonProperty("EnergySupply", NullValueHandling = NullValueHandling.Ignore)]
public string EnergySupply { get; set; }
[JsonProperty("EnergySupply_pump", NullValueHandling = NullValueHandling.Ignore)]
public string EnergySupply_pump { get; set; }
[JsonProperty("max_flow_rate_pump_l_per_min", NullValueHandling = NullValueHandling.Ignore)]
public double? max_flow_rate_pump_l_per_min { get; set; }
[JsonProperty("power_pump_kW", NullValueHandling = NullValueHandling.Ignore)]
public double? power_pump_kW { get; set; }
[JsonProperty("temp_setpnt_max", NullValueHandling = NullValueHandling.Ignore)]
public string temp_setpnt_max { get; set; }
[JsonProperty("temp_usable", NullValueHandling = NullValueHandling.Ignore)]
public double? temp_usable { get; set; }
}
public partial class ImmersionHeater
{
[JsonProperty("Control")]
public ControlWindowOpeningEnum? Control { get; set; }
[JsonProperty("Controlmax")]
public string Controlmax { get; set; }
[JsonProperty("Controlmin")]
public string Controlmin { get; set; }
[JsonProperty("EnergySupply")]
public string EnergySupply { get; set; }
[JsonProperty("heater_position")]
public double heater_position { get; set; }
[JsonProperty("power", NullValueHandling = NullValueHandling.Ignore)]
public double? power { get; set; }
[JsonProperty("thermostat_position", NullValueHandling = NullValueHandling.Ignore)]
public double? thermostat_position { get; set; }
[JsonProperty("type")]
public HeatSourceType type { get; set; }
[JsonProperty("area_module", NullValueHandling = NullValueHandling.Ignore)]
public double? area_module { get; set; }
[JsonProperty("collector_mass_flow_rate", NullValueHandling = NullValueHandling.Ignore)]
public double? collector_mass_flow_rate { get; set; }
[JsonProperty("control")]
public ControlWindowOpeningEnum? control { get; set; }
[JsonProperty("first_order_hlc", NullValueHandling = NullValueHandling.Ignore)]
public double? first_order_hlc { get; set; }
[JsonProperty("incidence_angle_modifier", NullValueHandling = NullValueHandling.Ignore)]
public double? incidence_angle_modifier { get; set; }
[JsonProperty("modules", NullValueHandling = NullValueHandling.Ignore)]
public long? modules { get; set; }
[JsonProperty("orientation360", NullValueHandling = NullValueHandling.Ignore)]
public double? orientation360 { get; set; }
[JsonProperty("peak_collector_efficiency", NullValueHandling = NullValueHandling.Ignore)]
public double? peak_collector_efficiency { get; set; }
[JsonProperty("power_pump", NullValueHandling = NullValueHandling.Ignore)]
public double? power_pump { get; set; }
[JsonProperty("power_pump_control", NullValueHandling = NullValueHandling.Ignore)]
public double? power_pump_control { get; set; }
[JsonProperty("second_order_hlc", NullValueHandling = NullValueHandling.Ignore)]
public double? second_order_hlc { get; set; }
[JsonProperty("sol_loc", NullValueHandling = NullValueHandling.Ignore)]
public SolLoc? sol_loc { get; set; }
[JsonProperty("solar_loop_piping_hlc", NullValueHandling = NullValueHandling.Ignore)]
public double? solar_loop_piping_hlc { get; set; }
[JsonProperty("tilt", NullValueHandling = NullValueHandling.Ignore)]
public double? tilt { get; set; }
[JsonProperty("ColdWaterSource")]
public ColdWaterSourceEnum? ColdWaterSource { get; set; }
[JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
public string name { get; set; }
[JsonProperty("temp_flow_limit_upper")]
public double? temp_flow_limit_upper { get; set; }
[JsonProperty("temp_return")]
public double? temp_return { get; set; }
[JsonProperty("daily_losses_declared", NullValueHandling = NullValueHandling.Ignore)]
public double? daily_losses_declared { get; set; }
[JsonProperty("heat_exchanger_surface_area_declared", NullValueHandling = NullValueHandling.Ignore)]
public double? heat_exchanger_surface_area_declared { get; set; }
[JsonProperty("in_use_factor_mismatch", NullValueHandling = NullValueHandling.Ignore)]
public double? in_use_factor_mismatch { get; set; }
[JsonProperty("power_max", NullValueHandling = NullValueHandling.Ignore)]
public double? power_max { get; set; }
[JsonProperty("tank_volume_declared", NullValueHandling = NullValueHandling.Ignore)]
public double? tank_volume_declared { get; set; }
[JsonProperty("test_data", NullValueHandling = NullValueHandling.Ignore)]
public TestData test_data { get; set; }
[JsonProperty("vol_hw_daily_average", NullValueHandling = NullValueHandling.Ignore)]
public double? vol_hw_daily_average { get; set; }
}
public partial class TestData
{
[JsonProperty("L")]
public MClass L { get; set; }
[JsonProperty("M")]
public MClass M { get; set; }
}
public partial class MClass
{
[JsonProperty("cop_dhw")]
public double cop_dhw { get; set; }
[JsonProperty("energy_input_measured")]
public double energy_input_measured { get; set; }
[JsonProperty("hw_tapping_prof_daily_total")]
public double hw_tapping_prof_daily_total { get; set; }
[JsonProperty("hw_vessel_loss_daily")]
public double hw_vessel_loss_daily { get; set; }
[JsonProperty("power_standby")]
public double power_standby { get; set; }
}
public partial class HeatSourceWetClass
{
[JsonProperty("Other")]
public string Other { get; set; }
}
public partial class HwCylinderPrimaryPipework
{
[JsonProperty("external_diameter_mm")]
public double? external_diameter_mm { get; set; }
[JsonProperty("insulation_thermal_conductivity")]
public double? insulation_thermal_conductivity { get; set; }
[JsonProperty("insulation_thickness_mm")]
public double? insulation_thickness_mm { get; set; }
[JsonProperty("internal_diameter_mm")]
public double? internal_diameter_mm { get; set; }
[JsonProperty("length")]
public double length { get; set; }
[JsonProperty("location")]
public BoilerLocation location { get; set; }
[JsonProperty("pipe_contents")]
public PipeContentsEnum? pipe_contents { get; set; }
[JsonProperty("surface_reflectivity")]
public bool? surface_reflectivity { get; set; }
}
public partial class InfiltrationVentilation
{
[JsonProperty("ach_max_static_calcs")]
public double? ach_max_static_calcs { get; set; }
[JsonProperty("ach_min_static_calcs")]
public double? ach_min_static_calcs { get; set; }
[JsonProperty("AirTerminalDevices")]
public Dictionary AirTerminalDevices { get; set; }
[JsonProperty("altitude")]
public double altitude { get; set; }
[JsonProperty("CombustionAppliances")]
public Dictionary CombustionAppliances { get; set; }
[JsonProperty("Control_VentAdjustMax")]
public string Control_VentAdjustMax { get; set; }
[JsonProperty("Control_VentAdjustMin")]
public string Control_VentAdjustMin { get; set; }
[JsonProperty("Control_WindowAdjust")]
public string Control_WindowAdjust { get; set; }
[JsonProperty("Cowls")]
public Dictionary Cowls { get; set; }
[JsonProperty("cross_vent_factor")]
public bool cross_vent_factor { get; set; }
[JsonProperty("Leaks")]
public Leaks Leaks { get; set; }
[JsonProperty("MechanicalVentilation", NullValueHandling = NullValueHandling.Ignore)]
public Dictionary MechanicalVentilation { get; set; }
[JsonProperty("noise_nuisance")]
public bool? noise_nuisance { get; set; }
[JsonProperty("PDUs")]
public Dictionary PDUs { get; set; }
[JsonProperty("shield_class")]
public ShieldClass shield_class { get; set; }
[JsonProperty("terrain_class")]
public TerrainClass terrain_class { get; set; }
[JsonProperty("vent_opening_ratio_init")]
public double? vent_opening_ratio_init { get; set; }
///
/// Base height of the ventilation zone relative to ground (m)
///
[JsonProperty("ventilation_zone_base_height")]
public double ventilation_zone_base_height { get; set; }
[JsonProperty("Vents")]
public Dictionary Vents { get; set; }
}
public partial class AirTerminalDeviceValue
{
[JsonProperty("area_cm2")]
public double area_cm2 { get; set; }
[JsonProperty("pressure_difference_ref")]
public double pressure_difference_ref { get; set; }
}
public partial class CombustionApplianceValue
{
[JsonProperty("appliance_type")]
public ApplianceType appliance_type { get; set; }
[JsonProperty("exhaust_situation")]
public ExhaustSituation exhaust_situation { get; set; }
[JsonProperty("fuel_type")]
public FuelType fuel_type { get; set; }
[JsonProperty("supply_situation")]
public SupplySituation supply_situation { get; set; }
}
public partial class Leaks
{
///
/// Surface area of facades (unit: m²)
///
[JsonProperty("area_facades")]
public double? area_facades { get; set; }
///
/// Surface area of the roof of the ventilation zone (unit: m²)
///
[JsonProperty("area_roof")]
public double? area_roof { get; set; }
///
/// Reference area of the envelope airtightness index
///
[JsonProperty("env_area")]
public double env_area { get; set; }
///
/// Reference pressure difference (unit: Pa)
///
[JsonProperty("test_pressure")]
public double test_pressure { get; set; }
///
/// Flow rate through
///
[JsonProperty("test_result")]
public double test_result { get; set; }
[JsonProperty("ventilation_zone_height")]
public double ventilation_zone_height { get; set; }
}
public partial class MechanicalVentilationValue
{
[JsonProperty("Control")]
public string Control { get; set; }
///
/// (unit: m³/hour)
///
[JsonProperty("design_outdoor_air_flow_rate")]
public double design_outdoor_air_flow_rate { get; set; }
[JsonProperty("design_zone_cooling_covered_by_mech_vent")]
public double? design_zone_cooling_covered_by_mech_vent { get; set; }
[JsonProperty("design_zone_heating_covered_by_mech_vent")]
public double? design_zone_heating_covered_by_mech_vent { get; set; }
[JsonProperty("ductwork")]
public List ductwork { get; set; }
[JsonProperty("EnergySupply")]
public string EnergySupply { get; set; }
[JsonProperty("measured_air_flow_rate")]
public double? measured_air_flow_rate { get; set; }
[JsonProperty("measured_fan_power")]
public double? measured_fan_power { get; set; }
///
/// MVHR efficiency
///
[JsonProperty("mvhr_eff")]
public double? mvhr_eff { get; set; }
[JsonProperty("mvhr_location")]
public BatteryLocationEnum? mvhr_location { get; set; }
///
/// Specific fan power, inclusive of any in use factors (unit: W/l/s)
///
[JsonProperty("SFP")]
public double? SFP { get; set; }
[JsonProperty("sup_air_flw_ctrl")]
public SupAirFlwCtrl sup_air_flw_ctrl { get; set; }
[JsonProperty("sup_air_temp_ctrl")]
public SupAirTempCtrl sup_air_temp_ctrl { get; set; }
[JsonProperty("vent_sys_op")]
public string vent_sys_op { get; set; }
[JsonProperty("vent_type")]
public VentType vent_type { get; set; }
}
public partial class DuctworkElement
{
[JsonProperty("cross_section_shape")]
public CrossSectionShape cross_section_shape { get; set; }
[JsonProperty("duct_perimeter_mm")]
public double? duct_perimeter_mm { get; set; }
[JsonProperty("duct_type")]
public DuctType duct_type { get; set; }
[JsonProperty("external_diameter_mm")]
public double? external_diameter_mm { get; set; }
[JsonProperty("insulation_thermal_conductivity")]
public double insulation_thermal_conductivity { get; set; }
[JsonProperty("insulation_thickness_mm")]
public double insulation_thickness_mm { get; set; }
[JsonProperty("internal_diameter_mm")]
public double? internal_diameter_mm { get; set; }
[JsonProperty("length")]
public double length { get; set; }
[JsonProperty("reflective")]
public bool reflective { get; set; }
}
public partial class VentValue
{
[JsonProperty("area_cm2")]
public double area_cm2 { get; set; }
[JsonProperty("mid_height_air_flow_path")]
public double mid_height_air_flow_path { get; set; }
[JsonProperty("orientation360")]
public double orientation360 { get; set; }
[JsonProperty("pitch")]
public double pitch { get; set; }
///
/// Reference pressure difference for an air terminal device (unit: Pa)
///
[JsonProperty("pressure_difference_ref")]
public double pressure_difference_ref { get; set; }
}
public partial class InternalGains
{
[JsonProperty("ColdWaterLosses")]
public ColdWaterLossesClass ColdWaterLosses { get; set; }
[JsonProperty("EvaporativeLosses")]
public ColdWaterLossesClass EvaporativeLosses { get; set; }
[JsonProperty("metabolic gains")]
public ColdWaterLossesClass metabolicgains { get; set; }
[JsonProperty("other")]
public ColdWaterLossesClass other { get; set; }
[JsonProperty("total internal gains")]
public ColdWaterLossesClass totalinternalgains { get; set; }
[JsonProperty("total_internal_gains")]
public ColdWaterLossesClass total_internal_gains { get; set; }
}
public partial class ColdWaterLossesClass
{
[JsonProperty("schedule")]
public Dictionary schedule { get; set; }
[JsonProperty("start_day")]
public long start_day { get; set; }
[JsonProperty("time_series_step")]
public double time_series_step { get; set; }
}
public partial class PhotovoltaicSystem
{
///
/// The distance between the ground and the lowest edge of the PV panel (unit: m)
///
[JsonProperty("base_height")]
public double base_height { get; set; }
[JsonProperty("EnergySupply")]
public string EnergySupply { get; set; }
///
/// Height of the PV panel (unit: m)
///
[JsonProperty("height")]
public double height { get; set; }
///
/// Whether the inverter is considered inside the building
///
[JsonProperty("inverter_is_inside")]
public bool inverter_is_inside { get; set; }
///
/// Peak power; represents the peak electrical power input to the inverter (unit: kW)
///
[JsonProperty("inverter_peak_power")]
public double? inverter_peak_power { get; set; }
[JsonProperty("inverter_peak_power_ac")]
public double? inverter_peak_power_ac { get; set; }
[JsonProperty("inverter_peak_power_dc")]
public double? inverter_peak_power_dc { get; set; }
[JsonProperty("inverter_type")]
public InverterTypeEnum? inverter_type { get; set; }
///
/// Orientation angle of the inclined surface, expressed as the geographical azimuth angle of
/// the horizontal projection of the inclined surface normal, 0 to 360 (unit: ˚)
///
[JsonProperty("orientation360")]
public double orientation360 { get; set; }
///
/// Peak power; represents the electrical power of a photovoltaic system with a given area
/// and a for a solar irradiance of 1 kW/m² on this surface (at 25 degrees) (unit: kW)
///
[JsonProperty("peak_power")]
public double peak_power { get; set; }
///
/// The tilt angle (inclination) of the PV panel from horizontal, measured upwards facing, 0
/// to 90 (unit: ˚)
///
[JsonProperty("pitch")]
public double pitch { get; set; }
[JsonProperty("shading")]
public List shading { get; set; }
[JsonProperty("type")]
public OnSiteGenerationType type { get; set; }
[JsonProperty("ventilation_strategy")]
public VentilationStrategy ventilation_strategy { get; set; }
///
/// Width of the PV panel (unit: m)
///
[JsonProperty("width")]
public double width { get; set; }
}
public partial class Obstacle
{
[JsonProperty("distance")]
public double distance { get; set; }
[JsonProperty("height", NullValueHandling = NullValueHandling.Ignore)]
public double? height { get; set; }
[JsonProperty("transparency", NullValueHandling = NullValueHandling.Ignore)]
public double? transparency { get; set; }
[JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)]
public FluffyType? type { get; set; }
[JsonProperty("depth", NullValueHandling = NullValueHandling.Ignore)]
public double? depth { get; set; }
}
public partial class PreHeatedWaterSourceValue
{
[JsonProperty("ColdWaterSource")]
public string ColdWaterSource { get; set; }
[JsonProperty("Control_hold_at_setpnt")]
public string Control_hold_at_setpnt { get; set; }
///
/// Measured standby losses due to cylinder insulation at standardised conditions (unit:
/// kWh/24h)
///
[JsonProperty("daily_losses")]
public double daily_losses { get; set; }
[JsonProperty("heat_exchanger_surface_area")]
public double? heat_exchanger_surface_area { get; set; }
[JsonProperty("HeatSource")]
public Dictionary HeatSource { get; set; }
[JsonProperty("init_temp")]
public double? init_temp { get; set; }
///
/// Minimum temperature required for domestic hot water (unit: ˚C)
///
[JsonProperty("min_temp")]
public double? min_temp { get; set; }
[JsonProperty("primary_pipework")]
public List primary_pipework { get; set; }
///
/// Setpoint temperature (unit: ˚C)
///
[JsonProperty("setpoint_temp")]
public double? setpoint_temp { get; set; }
[JsonProperty("type")]
public PreHeatedWaterSourceType type { get; set; }
///
/// Total volume of tank (unit: litre)
///
[JsonProperty("volume")]
public double volume { get; set; }
}
public partial class PreHeatedWaterSourcePrimaryPipework
{
[JsonProperty("external_diameter_mm")]
public double external_diameter_mm { get; set; }
[JsonProperty("insulation_thermal_conductivity")]
public double insulation_thermal_conductivity { get; set; }
[JsonProperty("insulation_thickness_mm")]
public double insulation_thickness_mm { get; set; }
[JsonProperty("internal_diameter_mm")]
public double internal_diameter_mm { get; set; }
[JsonProperty("length")]
public double length { get; set; }
[JsonProperty("location")]
public BoilerLocation location { get; set; }
[JsonProperty("pipe_contents")]
public PipeContentsEnum pipe_contents { get; set; }
[JsonProperty("surface_reflectivity")]
public bool surface_reflectivity { get; set; }
}
public partial class SimulationTime
{
[JsonProperty("end")]
public double end { get; set; }
[JsonProperty("start")]
public double start { get; set; }
[JsonProperty("step")]
public double step { get; set; }
}
public partial class SmartApplianceControlValue
{
[JsonProperty("Appliances")]
public List Appliances { get; set; }
[JsonProperty("battery24hr")]
public Battery24Hr battery24hr { get; set; }
[JsonProperty("non_appliance_demand_24hr")]
public Dictionary> non_appliance_demand_24hr { get; set; }
[JsonProperty("power_timeseries")]
public Dictionary> power_timeseries { get; set; }
[JsonProperty("time_series_step")]
public double time_series_step { get; set; }
}
public partial class Battery24Hr
{
[JsonProperty("battery_state_of_charge")]
public Dictionary> battery_state_of_charge { get; set; }
[JsonProperty("energy_into_battery_from_generation")]
public Dictionary> energy_into_battery_from_generation { get; set; }
[JsonProperty("energy_into_battery_from_grid")]
public Dictionary> energy_into_battery_from_grid { get; set; }
[JsonProperty("energy_out_of_battery")]
public Dictionary> energy_out_of_battery { get; set; }
}
public partial class SpaceCoolSystemValue
{
[JsonProperty("advanced_start", NullValueHandling = NullValueHandling.Ignore)]
public double? advanced_start { get; set; }
[JsonProperty("Control")]
public string Control { get; set; }
///
/// Maximum cooling capacity of the system (unit: kW)
///
[JsonProperty("cooling_capacity")]
public double cooling_capacity { get; set; }
[JsonProperty("efficiency")]
public double efficiency { get; set; }
[JsonProperty("EnergySupply")]
public string EnergySupply { get; set; }
///
/// Convective fraction for cooling
///
[JsonProperty("frac_convective")]
public double frac_convective { get; set; }
[JsonProperty("temp_setback")]
public double? temp_setback { get; set; }
[JsonProperty("type")]
public SpaceCoolSystemType type { get; set; }
}
public partial class InstantElecHeater
{
[JsonProperty("advanced_start")]
public double? advanced_start { get; set; }
[JsonProperty("Control")]
public string Control { get; set; }
[JsonProperty("EnergySupply")]
public string EnergySupply { get; set; }
///
/// Convective fraction for heating
///
[JsonProperty("frac_convective", NullValueHandling = NullValueHandling.Ignore)]
public double? frac_convective { get; set; }
[JsonProperty("HeatSource")]
public HeatSourceClass HeatSource { get; set; }
///
/// (unit: kW)
///
[JsonProperty("rated_power", NullValueHandling = NullValueHandling.Ignore)]
public double? rated_power { get; set; }
[JsonProperty("temp_setback")]
public double? temp_setback { get; set; }
[JsonProperty("type")]
public SpaceHeatSystemType type { get; set; }
///
/// The zone where the unit(s) is/are installed
///
[JsonProperty("Zone")]
public string Zone { get; set; }
[JsonProperty("air_flow_type", NullValueHandling = NullValueHandling.Ignore)]
public AirFlowType? air_flow_type { get; set; }
[JsonProperty("ControlCharger", NullValueHandling = NullValueHandling.Ignore)]
public string ControlCharger { get; set; }
[JsonProperty("ESH_max_output", NullValueHandling = NullValueHandling.Ignore)]
public List> ESH_max_output { get; set; }
[JsonProperty("ESH_min_output", NullValueHandling = NullValueHandling.Ignore)]
public List> ESH_min_output { get; set; }
///
/// Fan power (unit: W)
///
[JsonProperty("fan_pwr", NullValueHandling = NullValueHandling.Ignore)]
public double? fan_pwr { get; set; }
[JsonProperty("n_units", NullValueHandling = NullValueHandling.Ignore)]
public long? n_units { get; set; }
[JsonProperty("pwr_in", NullValueHandling = NullValueHandling.Ignore)]
public double? pwr_in { get; set; }
///
/// (instant backup) (unit: kW)
///
[JsonProperty("rated_power_instant", NullValueHandling = NullValueHandling.Ignore)]
public double? rated_power_instant { get; set; }
[JsonProperty("storage_capacity", NullValueHandling = NullValueHandling.Ignore)]
public double? storage_capacity { get; set; }
[JsonProperty("bypass_percentage_recirculated")]
public double? bypass_percentage_recirculated { get; set; }
[JsonProperty("design_flow_rate")]
public double? design_flow_rate { get; set; }
[JsonProperty("design_flow_temp", NullValueHandling = NullValueHandling.Ignore)]
public long? design_flow_temp { get; set; }
[JsonProperty("ecodesign_controller", NullValueHandling = NullValueHandling.Ignore)]
public EcodesignController ecodesign_controller { get; set; }
[JsonProperty("emitters", NullValueHandling = NullValueHandling.Ignore)]
public List emitters { get; set; }
[JsonProperty("max_flow_rate")]
public double? max_flow_rate { get; set; }
[JsonProperty("min_flow_rate")]
public double? min_flow_rate { get; set; }
[JsonProperty("n", NullValueHandling = NullValueHandling.Ignore)]
public double? n { get; set; }
[JsonProperty("temp_diff_emit_dsgn", NullValueHandling = NullValueHandling.Ignore)]
public double? temp_diff_emit_dsgn { get; set; }
[JsonProperty("thermal_mass")]
public double? thermal_mass { get; set; }
[JsonProperty("variable_flow")]
public bool? variable_flow { get; set; }
[JsonProperty("wet_emitter_type")]
public string wet_emitter_type { get; set; }
}
public partial class HeatSourceClass
{
[JsonProperty("name")]
public string name { get; set; }
[JsonProperty("temp_flow_limit_upper")]
public double? temp_flow_limit_upper { get; set; }
}
public partial class EcodesignController
{
[JsonProperty("ecodesign_control_class")]
public long ecodesign_control_class { get; set; }
[JsonProperty("max_outdoor_temp")]
public double? max_outdoor_temp { get; set; }
[JsonProperty("min_flow_temp")]
public double? min_flow_temp { get; set; }
[JsonProperty("min_outdoor_temp")]
public double? min_outdoor_temp { get; set; }
}
public partial class Radiator
{
[JsonProperty("c", NullValueHandling = NullValueHandling.Ignore)]
public double? c { get; set; }
[JsonProperty("frac_convective")]
public double frac_convective { get; set; }
[JsonProperty("n", NullValueHandling = NullValueHandling.Ignore)]
public double? n { get; set; }
[JsonProperty("wet_emitter_type", NullValueHandling = NullValueHandling.Ignore)]
public WetEmitterType? wet_emitter_type { get; set; }
[JsonProperty("emitter_floor_area", NullValueHandling = NullValueHandling.Ignore)]
public double? emitter_floor_area { get; set; }
[JsonProperty("equivalent_specific_thermal_mass", NullValueHandling = NullValueHandling.Ignore)]
public double? equivalent_specific_thermal_mass { get; set; }
[JsonProperty("system_performance_factor", NullValueHandling = NullValueHandling.Ignore)]
public double? system_performance_factor { get; set; }
[JsonProperty("fancoil_test_data", NullValueHandling = NullValueHandling.Ignore)]
public FancoilTestData fancoil_test_data { get; set; }
[JsonProperty("n_units", NullValueHandling = NullValueHandling.Ignore)]
public long? n_units { get; set; }
}
public partial class FancoilTestData
{
[JsonProperty("fan_power_W")]
public List fan_power_W { get; set; }
[JsonProperty("fan_speed_data")]
public List fan_speed_data { get; set; }
}
public partial class FanSpeedDatumElement
{
[JsonProperty("power_output")]
public List power_output { get; set; }
[JsonProperty("temperature_diff")]
public double temperature_diff { get; set; }
}
public partial class TariffClass
{
[JsonProperty("schedule")]
public Dictionary schedule { get; set; }
}
public partial class WwhrValue
{
[JsonProperty("ColdWaterSource")]
public ColdWaterSourceEnum ColdWaterSource { get; set; }
[JsonProperty("efficiencies")]
public List efficiencies { get; set; }
[JsonProperty("electrical_consumption")]
public double? electrical_consumption { get; set; }
[JsonProperty("flow_rates")]
public List flow_rates { get; set; }
[JsonProperty("type")]
public WwhrType type { get; set; }
[JsonProperty("utilisation_factor")]
public double utilisation_factor { get; set; }
}
public partial class WindowOpeningForCoolingClass
{
[JsonProperty("equivalent_area")]
public double equivalent_area { get; set; }
}
public partial class ZoneValue
{
///
/// Useful floor area of the zone (unit: m²)
///
[JsonProperty("area")]
public double area { get; set; }
[JsonProperty("BuildingElement")]
public Dictionary BuildingElement { get; set; }
[JsonProperty("Control_WindowOpening")]
public ControlWindowOpeningEnum? Control_WindowOpening { get; set; }
[JsonProperty("Lighting")]
public LightingClass Lighting { get; set; }
[JsonProperty("SpaceCoolSystem")]
public SpaceSystem? SpaceCoolSystem { get; set; }
[JsonProperty("SpaceHeatControl")]
public SpaceHeatControlEnum? SpaceHeatControl { get; set; }
[JsonProperty("SpaceHeatSystem")]
public SpaceSystem? SpaceHeatSystem { get; set; }
[JsonProperty("temp_setpnt_basis")]
public TempSetpntBasisEnum? temp_setpnt_basis { get; set; }
[JsonProperty("temp_setpnt_cool")]
public double? temp_setpnt_cool { get; set; }
[JsonProperty("temp_setpnt_heat")]
public double? temp_setpnt_heat { get; set; }
///
/// Setpoint temperature to use during initialisation (unit: ˚C)
///
[JsonProperty("temp_setpnt_init")]
public double? temp_setpnt_init { get; set; }
[JsonProperty("ThermalBridging")]
public ThermalBridging ThermalBridging { get; set; }
[JsonProperty("volume")]
public double volume { get; set; }
}
public partial class BuildingElement
{
///
/// Net area of the opaque building element (i.e. minus any windows / doors / etc.) (unit:
/// m²)
///
/// Area of this building element within the zone (unit: m²)
///
/// Area of this building element (unit: m²)
///
[JsonProperty("area")]
public double? area { get; set; }
///
/// Areal heat capacity (unit: J/m².K)
///
/// Areal heat capacity of the ground floor element (unit: J/m2.K)
///
/// Areal heat capacity (unit: J/m2.K)
///
[JsonProperty("areal_heat_capacity", NullValueHandling = NullValueHandling.Ignore)]
public double? areal_heat_capacity { get; set; }
///
/// The distance between the ground and the lowest edge of the element (unit: m)
///
[JsonProperty("base_height", NullValueHandling = NullValueHandling.Ignore)]
public double? base_height { get; set; }
[JsonProperty("h_ce")]
public double? h_ce { get; set; }
[JsonProperty("h_ci")]
public double? h_ci { get; set; }
[JsonProperty("h_re")]
public double? h_re { get; set; }
[JsonProperty("h_ri")]
public double? h_ri { get; set; }
///
/// The height of the building element (unit: m)
///
[JsonProperty("height", NullValueHandling = NullValueHandling.Ignore)]
public double? height { get; set; }
[JsonProperty("is_external_door")]
public bool? is_external_door { get; set; }
[JsonProperty("is_unheated_pitched_roof")]
public bool? is_unheated_pitched_roof { get; set; }
[JsonProperty("mass_distribution_class", NullValueHandling = NullValueHandling.Ignore)]
public MassDistributionClass? mass_distribution_class { get; set; }
///
/// The orientation angle of the inclined surface, expressed as the geographical azimuth
/// angle of the horizontal projection of the inclined surface normal, 0 to 360 (unit: ˚)
///
[JsonProperty("orientation360", NullValueHandling = NullValueHandling.Ignore)]
public double? orientation360 { get; set; }
///
/// Tilt angle of the surface from horizontal, between 0 and 180, where 0 means the external
/// surface is facing up, 90 means the external surface is vertical and 180 means the
/// external surface is facing down (unit: ˚)
///
[JsonProperty("pitch")]
public double pitch { get; set; }
///
/// Solar absorption coefficient at the external surface (dimensionless)
///
[JsonProperty("solar_absorption_coeff", NullValueHandling = NullValueHandling.Ignore)]
public double? solar_absorption_coeff { get; set; }
///
/// Thermal resistance (unit: m².K/W)
///
/// Thermal resistance (unit: m2.K/W)
///
[JsonProperty("thermal_resistance_construction")]
public double? thermal_resistance_construction { get; set; }
[JsonProperty("type")]
public BuildingElementType type { get; set; }
///
/// Steady-state thermal transmittance of floor, including the effect of the ground
/// (calculated for the entire ground floor, even if it is distributed among several zones)
/// (unit: W/m2.K)
///
[JsonProperty("u_value")]
public double? u_value { get; set; }
///
/// The width of the building element (unit: m)
///
[JsonProperty("width", NullValueHandling = NullValueHandling.Ignore)]
public double? width { get; set; }
[JsonProperty("Control_WindowOpenable")]
public string Control_WindowOpenable { get; set; }
///
/// The frame area fraction of window, ratio of the projected frame area to the overall
/// projected area of the glazed element of the window
///
[JsonProperty("frame_area_fraction", NullValueHandling = NullValueHandling.Ignore)]
public double? frame_area_fraction { get; set; }
[JsonProperty("free_area_height")]
public double? free_area_height { get; set; }
///
/// Total solar energy transmittance of the transparent part of the window
///
[JsonProperty("g_value", NullValueHandling = NullValueHandling.Ignore)]
public double? g_value { get; set; }
[JsonProperty("max_window_open_area")]
public double? max_window_open_area { get; set; }
[JsonProperty("mid_height")]
public double? mid_height { get; set; }
[JsonProperty("security_risk")]
public bool? security_risk { get; set; }
[JsonProperty("shading", NullValueHandling = NullValueHandling.Ignore)]
public List shading { get; set; }
[JsonProperty("treatment")]
public List treatment { get; set; }
[JsonProperty("window_part_list")]
public List window_part_list { get; set; }
///
/// Area of ventilation openings per perimeter (unit: m²/m)
///
[JsonProperty("area_per_perimeter_vent")]
public double? area_per_perimeter_vent { get; set; }
///
/// Depth of basement floor below ground level (unit: m)
///
[JsonProperty("depth_basement_floor")]
public double? depth_basement_floor { get; set; }
[JsonProperty("edge_insulation")]
public List edge_insulation { get; set; }
[JsonProperty("floor_type", NullValueHandling = NullValueHandling.Ignore)]
public FloorType? floor_type { get; set; }
///
/// Height of the basement walls above ground level (unit: m)
///
[JsonProperty("height_basement_walls")]
public double? height_basement_walls { get; set; }
[JsonProperty("height_upper_surface")]
public double? height_upper_surface { get; set; }
///
/// Perimeter of the floor; calculated for the entire ground floor, even if it is distributed
/// among several zones (unit: m)
///
[JsonProperty("perimeter", NullValueHandling = NullValueHandling.Ignore)]
public double? perimeter { get; set; }
///
/// Linear thermal transmittance of the junction between the floor and the walls (unit: W/m.K)
///
[JsonProperty("psi_wall_floor_junc", NullValueHandling = NullValueHandling.Ignore)]
public double? psi_wall_floor_junc { get; set; }
///
/// Wind shielding factor
///
[JsonProperty("shield_fact_location")]
public ShieldFactLocationEnum? shield_fact_location { get; set; }
///
/// Thermal resistance of insulation on base of underfloor space (unit: m².K/W)
///
[JsonProperty("thermal_resist_insul")]
public double? thermal_resist_insul { get; set; }
///
/// Thermal resistance of walls of the basement (unit: m².K/W)
///
[JsonProperty("thermal_resist_walls_base")]
public double? thermal_resist_walls_base { get; set; }
///
/// Total thermal resistance of all layers in the floor construction (unit: m².K/W)
///
[JsonProperty("thermal_resistance_floor_construction", NullValueHandling = NullValueHandling.Ignore)]
public double? thermal_resistance_floor_construction { get; set; }
///
/// Thermal transmittance of floor above basement (unit: W/m².K)
///
[JsonProperty("thermal_transm_envi_base")]
public double? thermal_transm_envi_base { get; set; }
///
/// Thermal transmittance of walls above ground (unit: W/m².K)
///
[JsonProperty("thermal_transm_walls")]
public double? thermal_transm_walls { get; set; }
///
/// Thickness of the walls (unit: m)
///
[JsonProperty("thickness_walls", NullValueHandling = NullValueHandling.Ignore)]
public double? thickness_walls { get; set; }
///
/// Total area of the building element across entire dwelling; if the Floor is divided among
/// several zones, this is the total area across all zones (unit: m²)
///
[JsonProperty("total_area", NullValueHandling = NullValueHandling.Ignore)]
public double? total_area { get; set; }
///
/// Effective thermal resistance of unheated space (unit: m².K/W)
///
[JsonProperty("thermal_resistance_unconditioned_space", NullValueHandling = NullValueHandling.Ignore)]
public double? thermal_resistance_unconditioned_space { get; set; }
}
public partial class Horizontal
{
[JsonProperty("edge_thermal_resistance")]
public double edge_thermal_resistance { get; set; }
[JsonProperty("type")]
public EdgeInsulationType type { get; set; }
[JsonProperty("width", NullValueHandling = NullValueHandling.Ignore)]
public double? width { get; set; }
[JsonProperty("depth", NullValueHandling = NullValueHandling.Ignore)]
public double? depth { get; set; }
}
public partial class TreatmentElement
{
[JsonProperty("closing_irrad")]
public double? closing_irrad { get; set; }
[JsonProperty("Control_closing_irrad")]
public string Control_closing_irrad { get; set; }
[JsonProperty("Control_open")]
public string Control_open { get; set; }
[JsonProperty("Control_opening_irrad")]
public string Control_opening_irrad { get; set; }
[JsonProperty("controls")]
public Controls controls { get; set; }
[JsonProperty("delta_r")]
public double delta_r { get; set; }
///
/// This field should be a boolean - any string provided will be ignored and treated as a
/// null.
///
[JsonProperty("is_open")]
public IsOpenUnion? is_open { get; set; }
[JsonProperty("opening_delay_hrs")]
public double? opening_delay_hrs { get; set; }
[JsonProperty("opening_irrad")]
public double? opening_irrad { get; set; }
[JsonProperty("trans_red")]
public double trans_red { get; set; }
[JsonProperty("type")]
public TreatmentType type { get; set; }
[JsonProperty("waking_hour")]
public long? waking_hour { get; set; }
}
public partial class WindowPartListElement
{
[JsonProperty("mid_height_air_flow_path")]
public double mid_height_air_flow_path { get; set; }
}
public partial class LightingClass
{
[JsonProperty("bulbs", NullValueHandling = NullValueHandling.Ignore)]
public Dictionary bulbs { get; set; }
[JsonProperty("efficacy")]
public double efficacy { get; set; }
}
public partial class BulbValue
{
///
/// The number of bulbs present.
///
[JsonProperty("count")]
public long count { get; set; }
[JsonProperty("efficacy")]
public double efficacy { get; set; }
[JsonProperty("power")]
[JsonConverter(typeof(MinMaxValueCheckConverter))]
public double power { get; set; }
}
public partial class ThermalBridge
{
[JsonProperty("junction_type")]
public string junction_type { get; set; }
[JsonProperty("length", NullValueHandling = NullValueHandling.Ignore)]
public double? length { get; set; }
[JsonProperty("linear_thermal_transmittance", NullValueHandling = NullValueHandling.Ignore)]
public double? linear_thermal_transmittance { get; set; }
[JsonProperty("type")]
public ThermalBridgingType type { get; set; }
[JsonProperty("heat_transfer_coeff", NullValueHandling = NullValueHandling.Ignore)]
public double? heat_transfer_coeff { get; set; }
}
public enum Weight { Tariff };
public enum ApplianceApplianceEnum { Default, NotInstalled };
public enum Operation { And, Max, Mean, Min, Not, Or, Xor };
public enum LogicTypeEnum { Automatic, Celect, HeatBattery, Hhrsh, Manual };
public enum ControlType { ChargeControl, CombinationTimeControl, OnOffCostMinimisingTimeControl, OnOffTimeControl, SetpointTimeControl };
public enum BatteryLocationEnum { Inside, Outside };
public enum HeatSource { Immersion };
public enum StorageTankEnum { HwCylinder };
public enum Fuel { Custom, Electricity, EnergyFromEnvironment, LpgBottled, LpgBulk, LpgCondition11F, MainsGas, UnmetDemand };
public enum PriorityElement { Diverter, ElectricBattery };
public enum DaylightSavingsEnum { ApplicableAndTakenIntoAccount, ApplicableButNotTakenIntoAccount, NotApplicable };
public enum PurpleType { Obstacle, Overhang };
public enum BuildType { Flat, House };
public enum BackupCtrlType { None, Substitute, TopUp };
public enum BoilerLocation { External, Internal };
public enum SinkType { Air, Glycol25, Water };
public enum SourceType { ExhaustAirMev, ExhaustAirMixed, ExhaustAirMvhr, Ground, HeatNetwork, OutsideAir, WaterGround, WaterSurface };
public enum TestLetter { A, B, C, D, F, F2 };
public enum HeatSourceWetType { Boiler, HeatBattery, HeatPump, Hiu };
public enum HeatingControlTypeEnum { SeparateTempControl, SeparateTimeAndTempControl };
public enum ColdWaterSourceEnum { HeaderTank, MainsWater };
public enum PipeContentsEnum { Air, Glycol25, Water };
public enum ShowerType { InstantElecShower, MixerShower };
public enum ControlWindowOpeningEnum { AlwaysOff, HwTimer, WindowOpening, WindowOpeningLivingRoom, WindowOpeningRestOfDwelling };
public enum SolLoc { Hs, Nhs, Out };
public enum HeatSourceType { HeatPumpHwOnly, HeatSourceWet, ImmersionHeater, SolarThermalSystem };
public enum SeparateDhwTests { ML, MOnly, MS, NoAdditionalTests };
public enum HwCylinderType { CombiBoiler, HeatBattery, Hiu, PointOfUse, SmartHotWaterTank, StorageTank };
public enum ApplianceType { ClosedFire, ClosedWithFan, OpenFireplace, OpenGasFire, OpenGasFlueBalancer, OpenGasKitchenStove };
public enum ExhaustSituation { IntoMechVent, IntoRoom, IntoSeparateDuct };
public enum FuelType { Coal, Gas, Oil, Wood };
public enum SupplySituation { Outside, RoomAir };
public enum CrossSectionShape { Circular, Rectangular };
public enum DuctType { Exhaust, Extract, Intake, Supply };
public enum SupAirFlwCtrl { Load, Oda };
public enum SupAirTempCtrl { Const, LoadCom, NoCtrl };
public enum VentType { CentralisedContinuousMev, DecentralisedContinuousMev, IntermittentMev, Mvhr, Piv };
public enum ShieldClass { Normal, Open, Shielded };
public enum TerrainClass { OpenField, OpenWater, Suburban, Urban };
public enum InverterTypeEnum { OptimisedInverter, StringInverter };
public enum FluffyType { Obstacle, Overhang, Reveal, Sidefinleft, Sidefinright };
public enum OnSiteGenerationType { PhotovoltaicSystem };
public enum VentilationStrategy { ModeratelyVentilated, RearSurfaceFree, StronglyOrForcedVentilated, Unventilated };
public enum PreHeatedWaterSourceType { StorageTank };
public enum ApplianceElement { ClothesDrying, ClothesWashing, Dishwasher, Freezer, Fridge, FridgeFreezer, Hobs, Kettle, Lighting, Microwave, Otherdevices, Oven };
public enum SpaceCoolSystemType { AirConditioning };
public enum AirFlowType { DamperOnly, FanAssisted };
public enum WetEmitterType { Fancoil, Radiator, Ufh };
public enum SpaceHeatSystemType { ElecStorageHeater, InstantElecHeater, WarmAir, WetDistribution };
public enum WwhrType { WwhrsInstantaneousSystemA, WwhrsInstantaneousSystemB, WwhrsInstantaneousSystemC };
public enum WaterHeatSchedDefaultEnum { AllDay, HeatingHours };
public enum EdgeInsulationType { Horizontal, Vertical };
public enum FloorType { HeatedBasement, SlabEdgeInsulation, SlabNoEdgeInsulation, SuspendedFloor, UnheatedBasement };
///
/// distribution of mass in building element, one of: 'I' - mass concentrated on internal
/// side; 'E': mass concentrated on external side; 'IE': mass divided over internal and
/// external side; 'D': mass equally distributed; 'M': mass concentrated inside
///
public enum MassDistributionClass { D, E, I, Ie, M };
public enum ShieldFactLocationEnum { Average, Exposed, Sheltered };
public enum Controls { AutoMotorised, CombinedLightBlindHvac, Manual, ManualMotorised };
public enum TreatmentType { Blinds, Curtains };
public enum BuildingElementType { BuildingElementAdjacentConditionedSpace, BuildingElementAdjacentUnconditionedSpaceSimple, BuildingElementGround, BuildingElementOpaque, BuildingElementTransparent };
public enum SpaceHeatControlEnum { Livingroom, Restofdwelling };
public enum ThermalBridgingType { ThermalBridgeLinear, ThermalBridgePoint };
public enum TempSetpntBasisEnum { Air, Operative };
public partial struct ChargeLevelValue
{
public double? Double;
public string String;
public static implicit operator ChargeLevelValue(double Double) => new ChargeLevelValue { Double = Double };
public static implicit operator ChargeLevelValue(string String) => new ChargeLevelValue { String = String };
public bool IsNull => Double == null && String == null;
}
public partial struct TempChargeCutDeltaElement
{
public double? Double;
public string String;
public TempChargeCutDeltaClass TempChargeCutDeltaClass;
public static implicit operator TempChargeCutDeltaElement(double Double) => new TempChargeCutDeltaElement { Double = Double };
public static implicit operator TempChargeCutDeltaElement(string String) => new TempChargeCutDeltaElement { String = String };
public static implicit operator TempChargeCutDeltaElement(TempChargeCutDeltaClass TempChargeCutDeltaClass) => new TempChargeCutDeltaElement { TempChargeCutDeltaClass = TempChargeCutDeltaClass };
public bool IsNull => TempChargeCutDeltaClass == null && Double == null && String == null;
}
public partial struct TempChargeCutDeltaValue
{
public List AnythingArray;
public double? Double;
public string String;
public TempChargeCutDeltaClass TempChargeCutDeltaClass;
public static implicit operator TempChargeCutDeltaValue(List AnythingArray) => new TempChargeCutDeltaValue { AnythingArray = AnythingArray };
public static implicit operator TempChargeCutDeltaValue(double Double) => new TempChargeCutDeltaValue { Double = Double };
public static implicit operator TempChargeCutDeltaValue(string String) => new TempChargeCutDeltaValue { String = String };
public static implicit operator TempChargeCutDeltaValue(TempChargeCutDeltaClass TempChargeCutDeltaClass) => new TempChargeCutDeltaValue { TempChargeCutDeltaClass = TempChargeCutDeltaClass };
public bool IsNull => AnythingArray == null && TempChargeCutDeltaClass == null && Double == null && String == null;
}
public partial struct ApplianceValue
{
public ApplianceClass ApplianceClass;
public ApplianceApplianceEnum? Enum;
public static implicit operator ApplianceValue(ApplianceClass ApplianceClass) => new ApplianceValue { ApplianceClass = ApplianceClass };
public static implicit operator ApplianceValue(ApplianceApplianceEnum Enum) => new ApplianceValue { Enum = Enum };
}
///
/// Proportion of the charge targeted for each day
///
public partial struct ChargeLevel
{
public Dictionary AnythingMap;
public double? Double;
public List DoubleArray;
public static implicit operator ChargeLevel(Dictionary AnythingMap) => new ChargeLevel { AnythingMap = AnythingMap };
public static implicit operator ChargeLevel(double Double) => new ChargeLevel { Double = Double };
public static implicit operator ChargeLevel(List DoubleArray) => new ChargeLevel { DoubleArray = DoubleArray };
public bool IsNull => DoubleArray == null && Double == null && AnythingMap == null;
}
public partial struct PurpleValue
{
public bool? Bool;
public double? Double;
public string String;
public static implicit operator PurpleValue(bool Bool) => new PurpleValue { Bool = Bool };
public static implicit operator PurpleValue(double Double) => new PurpleValue { Double = Double };
public static implicit operator PurpleValue(string String) => new PurpleValue { String = String };
public bool IsNull => Bool == null && Double == null && String == null;
}
public partial struct TentacledCoordinat
{
public bool? Bool;
public double? Double;
public PurpleCoordinat PurpleCoordinat;
public string String;
public static implicit operator TentacledCoordinat(bool Bool) => new TentacledCoordinat { Bool = Bool };
public static implicit operator TentacledCoordinat(double Double) => new TentacledCoordinat { Double = Double };
public static implicit operator TentacledCoordinat(PurpleCoordinat PurpleCoordinat) => new TentacledCoordinat { PurpleCoordinat = PurpleCoordinat };
public static implicit operator TentacledCoordinat(string String) => new TentacledCoordinat { String = String };
public bool IsNull => Bool == null && PurpleCoordinat == null && Double == null && String == null;
}
public partial struct StickyCoordinat
{
public List AnythingArray;
public bool? Bool;
public double? Double;
public FluffyCoordinat FluffyCoordinat;
public string String;
public static implicit operator StickyCoordinat(List AnythingArray) => new StickyCoordinat { AnythingArray = AnythingArray };
public static implicit operator StickyCoordinat(bool Bool) => new StickyCoordinat { Bool = Bool };
public static implicit operator StickyCoordinat(double Double) => new StickyCoordinat { Double = Double };
public static implicit operator StickyCoordinat(FluffyCoordinat FluffyCoordinat) => new StickyCoordinat { FluffyCoordinat = FluffyCoordinat };
public static implicit operator StickyCoordinat(string String) => new StickyCoordinat { String = String };
public bool IsNull => AnythingArray == null && Bool == null && FluffyCoordinat == null && Double == null && String == null;
}
public partial struct HeatSourceWet
{
public HeatSourceWetClass HeatSourceWetClass;
public string String;
public static implicit operator HeatSourceWet(HeatSourceWetClass HeatSourceWetClass) => new HeatSourceWet { HeatSourceWetClass = HeatSourceWetClass };
public static implicit operator HeatSourceWet(string String) => new HeatSourceWet { String = String };
}
///
/// This field should be a boolean - any string provided will be ignored and treated as a
/// null.
///
public partial struct IsOpenUnion
{
public bool? Bool;
public string String;
public static implicit operator IsOpenUnion(bool Bool) => new IsOpenUnion { Bool = Bool };
public static implicit operator IsOpenUnion(string String) => new IsOpenUnion { String = String };
public bool IsNull => Bool == null && String == null;
}
public partial struct SpaceSystem
{
public string String;
public List StringArray;
public static implicit operator SpaceSystem(string String) => new SpaceSystem { String = String };
public static implicit operator SpaceSystem(List StringArray) => new SpaceSystem { StringArray = StringArray };
public bool IsNull => StringArray == null && String == null;
}
public partial struct ThermalBridging
{
public double? Double;
public Dictionary ThermalBridgeMap;
public static implicit operator ThermalBridging(double Double) => new ThermalBridging { Double = Double };
public static implicit operator ThermalBridging(Dictionary ThermalBridgeMap) => new ThermalBridging { ThermalBridgeMap = ThermalBridgeMap };
}
public partial class Coordinate
{
public static Coordinate FromJson(string json) => JsonConvert.DeserializeObject(json, HEM.Converter.Settings);
}
public static class Serialize
{
public static string ToJson(this Coordinate self) => JsonConvert.SerializeObject(self, HEM.Converter.Settings);
}
internal static class Converter
{
public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings
{
MetadataPropertyHandling = MetadataPropertyHandling.Ignore,
DateParseHandling = DateParseHandling.None,
Converters =
{
WeightConverter.Singleton,
TempChargeCutDeltaValueConverter.Singleton,
TempChargeCutDeltaElementConverter.Singleton,
ChargeLevelValueConverter.Singleton,
ApplianceValueConverter.Singleton,
ApplianceApplianceEnumConverter.Singleton,
ChargeLevelConverter.Singleton,
OperationConverter.Singleton,
LogicTypeEnumConverter.Singleton,
StickyCoordinatConverter.Singleton,
TentacledCoordinatConverter.Singleton,
PurpleValueConverter.Singleton,
ControlTypeConverter.Singleton,
BatteryLocationEnumConverter.Singleton,
HeatSourceConverter.Singleton,
StorageTankEnumConverter.Singleton,
FuelConverter.Singleton,
PriorityElementConverter.Singleton,
DaylightSavingsEnumConverter.Singleton,
PurpleTypeConverter.Singleton,
BuildTypeConverter.Singleton,
BackupCtrlTypeConverter.Singleton,
BoilerLocationConverter.Singleton,
SinkTypeConverter.Singleton,
SourceTypeConverter.Singleton,
TestLetterConverter.Singleton,
HeatSourceWetTypeConverter.Singleton,
HeatingControlTypeEnumConverter.Singleton,
ColdWaterSourceEnumConverter.Singleton,
PipeContentsEnumConverter.Singleton,
ShowerTypeConverter.Singleton,
ControlWindowOpeningEnumConverter.Singleton,
SolLocConverter.Singleton,
HeatSourceTypeConverter.Singleton,
HeatSourceWetConverter.Singleton,
SeparateDhwTestsConverter.Singleton,
HwCylinderTypeConverter.Singleton,
ApplianceTypeConverter.Singleton,
ExhaustSituationConverter.Singleton,
FuelTypeConverter.Singleton,
SupplySituationConverter.Singleton,
CrossSectionShapeConverter.Singleton,
DuctTypeConverter.Singleton,
SupAirFlwCtrlConverter.Singleton,
SupAirTempCtrlConverter.Singleton,
VentTypeConverter.Singleton,
ShieldClassConverter.Singleton,
TerrainClassConverter.Singleton,
InverterTypeEnumConverter.Singleton,
FluffyTypeConverter.Singleton,
OnSiteGenerationTypeConverter.Singleton,
VentilationStrategyConverter.Singleton,
PreHeatedWaterSourceTypeConverter.Singleton,
ApplianceElementConverter.Singleton,
SpaceCoolSystemTypeConverter.Singleton,
AirFlowTypeConverter.Singleton,
WetEmitterTypeConverter.Singleton,
SpaceHeatSystemTypeConverter.Singleton,
WwhrTypeConverter.Singleton,
WaterHeatSchedDefaultEnumConverter.Singleton,
EdgeInsulationTypeConverter.Singleton,
FloorTypeConverter.Singleton,
MassDistributionClassConverter.Singleton,
ShieldFactLocationEnumConverter.Singleton,
ControlsConverter.Singleton,
IsOpenUnionConverter.Singleton,
TreatmentTypeConverter.Singleton,
BuildingElementTypeConverter.Singleton,
SpaceSystemConverter.Singleton,
SpaceHeatControlEnumConverter.Singleton,
ThermalBridgingConverter.Singleton,
ThermalBridgingTypeConverter.Singleton,
TempSetpntBasisEnumConverter.Singleton,
new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal }
},
};
}
internal class WeightConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(Weight) || t == typeof(Weight?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
if (value == "Tariff")
{
return Weight.Tariff;
}
throw new Exception("Cannot unmarshal type Weight");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (Weight)untypedValue;
if (value == Weight.Tariff)
{
serializer.Serialize(writer, "Tariff");
return;
}
throw new Exception("Cannot marshal type Weight");
}
public static readonly WeightConverter Singleton = new WeightConverter();
}
internal class TempChargeCutDeltaValueConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(TempChargeCutDeltaValue) || t == typeof(TempChargeCutDeltaValue?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
switch (reader.TokenType)
{
case JsonToken.Null:
return new TempChargeCutDeltaValue { };
case JsonToken.Integer:
case JsonToken.Float:
var doubleValue = serializer.Deserialize(reader);
return new TempChargeCutDeltaValue { Double = doubleValue };
case JsonToken.String:
case JsonToken.Date:
var stringValue = serializer.Deserialize(reader);
return new TempChargeCutDeltaValue { String = stringValue };
case JsonToken.StartObject:
var objectValue = serializer.Deserialize(reader);
return new TempChargeCutDeltaValue { TempChargeCutDeltaClass = objectValue };
case JsonToken.StartArray:
var arrayValue = serializer.Deserialize>(reader);
return new TempChargeCutDeltaValue { AnythingArray = arrayValue };
}
throw new Exception("Cannot unmarshal type TempChargeCutDeltaValue");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (TempChargeCutDeltaValue)untypedValue;
if (value.IsNull)
{
serializer.Serialize(writer, null);
return;
}
if (value.Double != null)
{
serializer.Serialize(writer, value.Double.Value);
return;
}
if (value.String != null)
{
serializer.Serialize(writer, value.String);
return;
}
if (value.AnythingArray != null)
{
serializer.Serialize(writer, value.AnythingArray);
return;
}
if (value.TempChargeCutDeltaClass != null)
{
serializer.Serialize(writer, value.TempChargeCutDeltaClass);
return;
}
throw new Exception("Cannot marshal type TempChargeCutDeltaValue");
}
public static readonly TempChargeCutDeltaValueConverter Singleton = new TempChargeCutDeltaValueConverter();
}
internal class TempChargeCutDeltaElementConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(TempChargeCutDeltaElement) || t == typeof(TempChargeCutDeltaElement?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
switch (reader.TokenType)
{
case JsonToken.Null:
return new TempChargeCutDeltaElement { };
case JsonToken.Integer:
case JsonToken.Float:
var doubleValue = serializer.Deserialize(reader);
return new TempChargeCutDeltaElement { Double = doubleValue };
case JsonToken.String:
case JsonToken.Date:
var stringValue = serializer.Deserialize(reader);
return new TempChargeCutDeltaElement { String = stringValue };
case JsonToken.StartObject:
var objectValue = serializer.Deserialize(reader);
return new TempChargeCutDeltaElement { TempChargeCutDeltaClass = objectValue };
}
throw new Exception("Cannot unmarshal type TempChargeCutDeltaElement");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (TempChargeCutDeltaElement)untypedValue;
if (value.IsNull)
{
serializer.Serialize(writer, null);
return;
}
if (value.Double != null)
{
serializer.Serialize(writer, value.Double.Value);
return;
}
if (value.String != null)
{
serializer.Serialize(writer, value.String);
return;
}
if (value.TempChargeCutDeltaClass != null)
{
serializer.Serialize(writer, value.TempChargeCutDeltaClass);
return;
}
throw new Exception("Cannot marshal type TempChargeCutDeltaElement");
}
public static readonly TempChargeCutDeltaElementConverter Singleton = new TempChargeCutDeltaElementConverter();
}
internal class ChargeLevelValueConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(ChargeLevelValue) || t == typeof(ChargeLevelValue?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
switch (reader.TokenType)
{
case JsonToken.Null:
return new ChargeLevelValue { };
case JsonToken.Integer:
case JsonToken.Float:
var doubleValue = serializer.Deserialize(reader);
return new ChargeLevelValue { Double = doubleValue };
case JsonToken.String:
case JsonToken.Date:
var stringValue = serializer.Deserialize(reader);
return new ChargeLevelValue { String = stringValue };
}
throw new Exception("Cannot unmarshal type ChargeLevelValue");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (ChargeLevelValue)untypedValue;
if (value.IsNull)
{
serializer.Serialize(writer, null);
return;
}
if (value.Double != null)
{
serializer.Serialize(writer, value.Double.Value);
return;
}
if (value.String != null)
{
serializer.Serialize(writer, value.String);
return;
}
throw new Exception("Cannot marshal type ChargeLevelValue");
}
public static readonly ChargeLevelValueConverter Singleton = new ChargeLevelValueConverter();
}
internal class ApplianceValueConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(ApplianceValue) || t == typeof(ApplianceValue?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
switch (reader.TokenType)
{
case JsonToken.String:
case JsonToken.Date:
var stringValue = serializer.Deserialize(reader);
switch (stringValue)
{
case "Default":
return new ApplianceValue { Enum = ApplianceApplianceEnum.Default };
case "Not Installed":
return new ApplianceValue { Enum = ApplianceApplianceEnum.NotInstalled };
}
break;
case JsonToken.StartObject:
var objectValue = serializer.Deserialize(reader);
return new ApplianceValue { ApplianceClass = objectValue };
}
throw new Exception("Cannot unmarshal type ApplianceValue");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (ApplianceValue)untypedValue;
if (value.Enum != null)
{
switch (value.Enum)
{
case ApplianceApplianceEnum.Default:
serializer.Serialize(writer, "Default");
return;
case ApplianceApplianceEnum.NotInstalled:
serializer.Serialize(writer, "Not Installed");
return;
}
}
if (value.ApplianceClass != null)
{
serializer.Serialize(writer, value.ApplianceClass);
return;
}
throw new Exception("Cannot marshal type ApplianceValue");
}
public static readonly ApplianceValueConverter Singleton = new ApplianceValueConverter();
}
internal class ApplianceApplianceEnumConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(ApplianceApplianceEnum) || t == typeof(ApplianceApplianceEnum?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "Default":
return ApplianceApplianceEnum.Default;
case "Not Installed":
return ApplianceApplianceEnum.NotInstalled;
}
throw new Exception("Cannot unmarshal type ApplianceApplianceEnum");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (ApplianceApplianceEnum)untypedValue;
switch (value)
{
case ApplianceApplianceEnum.Default:
serializer.Serialize(writer, "Default");
return;
case ApplianceApplianceEnum.NotInstalled:
serializer.Serialize(writer, "Not Installed");
return;
}
throw new Exception("Cannot marshal type ApplianceApplianceEnum");
}
public static readonly ApplianceApplianceEnumConverter Singleton = new ApplianceApplianceEnumConverter();
}
internal class ChargeLevelConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(ChargeLevel) || t == typeof(ChargeLevel?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
switch (reader.TokenType)
{
case JsonToken.Null:
return new ChargeLevel { };
case JsonToken.Integer:
case JsonToken.Float:
var doubleValue = serializer.Deserialize(reader);
return new ChargeLevel { Double = doubleValue };
case JsonToken.StartObject:
var objectValue = serializer.Deserialize>(reader);
return new ChargeLevel { AnythingMap = objectValue };
case JsonToken.StartArray:
var arrayValue = serializer.Deserialize>(reader);
return new ChargeLevel { DoubleArray = arrayValue };
}
throw new Exception("Cannot unmarshal type ChargeLevel");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (ChargeLevel)untypedValue;
if (value.IsNull)
{
serializer.Serialize(writer, null);
return;
}
if (value.Double != null)
{
serializer.Serialize(writer, value.Double.Value);
return;
}
if (value.DoubleArray != null)
{
serializer.Serialize(writer, value.DoubleArray);
return;
}
if (value.AnythingMap != null)
{
serializer.Serialize(writer, value.AnythingMap);
return;
}
throw new Exception("Cannot marshal type ChargeLevel");
}
public static readonly ChargeLevelConverter Singleton = new ChargeLevelConverter();
}
internal class OperationConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(Operation) || t == typeof(Operation?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "AND":
return Operation.And;
case "MAX":
return Operation.Max;
case "MEAN":
return Operation.Mean;
case "MIN":
return Operation.Min;
case "NOT":
return Operation.Not;
case "OR":
return Operation.Or;
case "XOR":
return Operation.Xor;
}
throw new Exception("Cannot unmarshal type Operation");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (Operation)untypedValue;
switch (value)
{
case Operation.And:
serializer.Serialize(writer, "AND");
return;
case Operation.Max:
serializer.Serialize(writer, "MAX");
return;
case Operation.Mean:
serializer.Serialize(writer, "MEAN");
return;
case Operation.Min:
serializer.Serialize(writer, "MIN");
return;
case Operation.Not:
serializer.Serialize(writer, "NOT");
return;
case Operation.Or:
serializer.Serialize(writer, "OR");
return;
case Operation.Xor:
serializer.Serialize(writer, "XOR");
return;
}
throw new Exception("Cannot marshal type Operation");
}
public static readonly OperationConverter Singleton = new OperationConverter();
}
internal class LogicTypeEnumConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(LogicTypeEnum) || t == typeof(LogicTypeEnum?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "Automatic":
return LogicTypeEnum.Automatic;
case "Manual":
return LogicTypeEnum.Manual;
case "celect":
return LogicTypeEnum.Celect;
case "heat_battery":
return LogicTypeEnum.HeatBattery;
case "hhrsh":
return LogicTypeEnum.Hhrsh;
}
throw new Exception("Cannot unmarshal type LogicTypeEnum");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (LogicTypeEnum)untypedValue;
switch (value)
{
case LogicTypeEnum.Automatic:
serializer.Serialize(writer, "Automatic");
return;
case LogicTypeEnum.Manual:
serializer.Serialize(writer, "Manual");
return;
case LogicTypeEnum.Celect:
serializer.Serialize(writer, "celect");
return;
case LogicTypeEnum.HeatBattery:
serializer.Serialize(writer, "heat_battery");
return;
case LogicTypeEnum.Hhrsh:
serializer.Serialize(writer, "hhrsh");
return;
}
throw new Exception("Cannot marshal type LogicTypeEnum");
}
public static readonly LogicTypeEnumConverter Singleton = new LogicTypeEnumConverter();
}
internal class StickyCoordinatConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(StickyCoordinat) || t == typeof(StickyCoordinat?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
switch (reader.TokenType)
{
case JsonToken.Null:
return new StickyCoordinat { };
case JsonToken.Integer:
case JsonToken.Float:
var doubleValue = serializer.Deserialize(reader);
return new StickyCoordinat { Double = doubleValue };
case JsonToken.Boolean:
var boolValue = serializer.Deserialize(reader);
return new StickyCoordinat { Bool = boolValue };
case JsonToken.String:
case JsonToken.Date:
var stringValue = serializer.Deserialize(reader);
return new StickyCoordinat { String = stringValue };
case JsonToken.StartObject:
var objectValue = serializer.Deserialize(reader);
return new StickyCoordinat { FluffyCoordinat = objectValue };
case JsonToken.StartArray:
var arrayValue = serializer.Deserialize>(reader);
return new StickyCoordinat { AnythingArray = arrayValue };
}
throw new Exception("Cannot unmarshal type StickyCoordinat");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (StickyCoordinat)untypedValue;
if (value.IsNull)
{
serializer.Serialize(writer, null);
return;
}
if (value.Double != null)
{
serializer.Serialize(writer, value.Double.Value);
return;
}
if (value.Bool != null)
{
serializer.Serialize(writer, value.Bool.Value);
return;
}
if (value.String != null)
{
serializer.Serialize(writer, value.String);
return;
}
if (value.AnythingArray != null)
{
serializer.Serialize(writer, value.AnythingArray);
return;
}
if (value.FluffyCoordinat != null)
{
serializer.Serialize(writer, value.FluffyCoordinat);
return;
}
throw new Exception("Cannot marshal type StickyCoordinat");
}
public static readonly StickyCoordinatConverter Singleton = new StickyCoordinatConverter();
}
internal class TentacledCoordinatConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(TentacledCoordinat) || t == typeof(TentacledCoordinat?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
switch (reader.TokenType)
{
case JsonToken.Null:
return new TentacledCoordinat { };
case JsonToken.Integer:
case JsonToken.Float:
var doubleValue = serializer.Deserialize(reader);
return new TentacledCoordinat { Double = doubleValue };
case JsonToken.Boolean:
var boolValue = serializer.Deserialize(reader);
return new TentacledCoordinat { Bool = boolValue };
case JsonToken.String:
case JsonToken.Date:
var stringValue = serializer.Deserialize(reader);
return new TentacledCoordinat { String = stringValue };
case JsonToken.StartObject:
var objectValue = serializer.Deserialize(reader);
return new TentacledCoordinat { PurpleCoordinat = objectValue };
}
throw new Exception("Cannot unmarshal type TentacledCoordinat");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (TentacledCoordinat)untypedValue;
if (value.IsNull)
{
serializer.Serialize(writer, null);
return;
}
if (value.Double != null)
{
serializer.Serialize(writer, value.Double.Value);
return;
}
if (value.Bool != null)
{
serializer.Serialize(writer, value.Bool.Value);
return;
}
if (value.String != null)
{
serializer.Serialize(writer, value.String);
return;
}
if (value.PurpleCoordinat != null)
{
serializer.Serialize(writer, value.PurpleCoordinat);
return;
}
throw new Exception("Cannot marshal type TentacledCoordinat");
}
public static readonly TentacledCoordinatConverter Singleton = new TentacledCoordinatConverter();
}
internal class PurpleValueConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(PurpleValue) || t == typeof(PurpleValue?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
switch (reader.TokenType)
{
case JsonToken.Null:
return new PurpleValue { };
case JsonToken.Integer:
case JsonToken.Float:
var doubleValue = serializer.Deserialize(reader);
return new PurpleValue { Double = doubleValue };
case JsonToken.Boolean:
var boolValue = serializer.Deserialize(reader);
return new PurpleValue { Bool = boolValue };
case JsonToken.String:
case JsonToken.Date:
var stringValue = serializer.Deserialize(reader);
return new PurpleValue { String = stringValue };
}
throw new Exception("Cannot unmarshal type PurpleValue");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (PurpleValue)untypedValue;
if (value.IsNull)
{
serializer.Serialize(writer, null);
return;
}
if (value.Double != null)
{
serializer.Serialize(writer, value.Double.Value);
return;
}
if (value.Bool != null)
{
serializer.Serialize(writer, value.Bool.Value);
return;
}
if (value.String != null)
{
serializer.Serialize(writer, value.String);
return;
}
throw new Exception("Cannot marshal type PurpleValue");
}
public static readonly PurpleValueConverter Singleton = new PurpleValueConverter();
}
internal class ControlTypeConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(ControlType) || t == typeof(ControlType?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "ChargeControl":
return ControlType.ChargeControl;
case "CombinationTimeControl":
return ControlType.CombinationTimeControl;
case "OnOffCostMinimisingTimeControl":
return ControlType.OnOffCostMinimisingTimeControl;
case "OnOffTimeControl":
return ControlType.OnOffTimeControl;
case "SetpointTimeControl":
return ControlType.SetpointTimeControl;
}
throw new Exception("Cannot unmarshal type ControlType");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (ControlType)untypedValue;
switch (value)
{
case ControlType.ChargeControl:
serializer.Serialize(writer, "ChargeControl");
return;
case ControlType.CombinationTimeControl:
serializer.Serialize(writer, "CombinationTimeControl");
return;
case ControlType.OnOffCostMinimisingTimeControl:
serializer.Serialize(writer, "OnOffCostMinimisingTimeControl");
return;
case ControlType.OnOffTimeControl:
serializer.Serialize(writer, "OnOffTimeControl");
return;
case ControlType.SetpointTimeControl:
serializer.Serialize(writer, "SetpointTimeControl");
return;
}
throw new Exception("Cannot marshal type ControlType");
}
public static readonly ControlTypeConverter Singleton = new ControlTypeConverter();
}
internal class BatteryLocationEnumConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(BatteryLocationEnum) || t == typeof(BatteryLocationEnum?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "inside":
return BatteryLocationEnum.Inside;
case "outside":
return BatteryLocationEnum.Outside;
}
throw new Exception("Cannot unmarshal type BatteryLocationEnum");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (BatteryLocationEnum)untypedValue;
switch (value)
{
case BatteryLocationEnum.Inside:
serializer.Serialize(writer, "inside");
return;
case BatteryLocationEnum.Outside:
serializer.Serialize(writer, "outside");
return;
}
throw new Exception("Cannot marshal type BatteryLocationEnum");
}
public static readonly BatteryLocationEnumConverter Singleton = new BatteryLocationEnumConverter();
}
internal class HeatSourceConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(HeatSource) || t == typeof(HeatSource?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
if (value == "immersion")
{
return HeatSource.Immersion;
}
throw new Exception("Cannot unmarshal type HeatSource");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (HeatSource)untypedValue;
if (value == HeatSource.Immersion)
{
serializer.Serialize(writer, "immersion");
return;
}
throw new Exception("Cannot marshal type HeatSource");
}
public static readonly HeatSourceConverter Singleton = new HeatSourceConverter();
}
internal class StorageTankEnumConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(StorageTankEnum) || t == typeof(StorageTankEnum?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
if (value == "hw cylinder")
{
return StorageTankEnum.HwCylinder;
}
throw new Exception("Cannot unmarshal type StorageTankEnum");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (StorageTankEnum)untypedValue;
if (value == StorageTankEnum.HwCylinder)
{
serializer.Serialize(writer, "hw cylinder");
return;
}
throw new Exception("Cannot marshal type StorageTankEnum");
}
public static readonly StorageTankEnumConverter Singleton = new StorageTankEnumConverter();
}
internal class FuelConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(Fuel) || t == typeof(Fuel?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "LPG_bottled":
return Fuel.LpgBottled;
case "LPG_bulk":
return Fuel.LpgBulk;
case "LPG_condition_11F":
return Fuel.LpgCondition11F;
case "custom":
return Fuel.Custom;
case "electricity":
return Fuel.Electricity;
case "energy_from_environment":
return Fuel.EnergyFromEnvironment;
case "mains_gas":
return Fuel.MainsGas;
case "unmet_demand":
return Fuel.UnmetDemand;
}
throw new Exception("Cannot unmarshal type Fuel");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (Fuel)untypedValue;
switch (value)
{
case Fuel.LpgBottled:
serializer.Serialize(writer, "LPG_bottled");
return;
case Fuel.LpgBulk:
serializer.Serialize(writer, "LPG_bulk");
return;
case Fuel.LpgCondition11F:
serializer.Serialize(writer, "LPG_condition_11F");
return;
case Fuel.Custom:
serializer.Serialize(writer, "custom");
return;
case Fuel.Electricity:
serializer.Serialize(writer, "electricity");
return;
case Fuel.EnergyFromEnvironment:
serializer.Serialize(writer, "energy_from_environment");
return;
case Fuel.MainsGas:
serializer.Serialize(writer, "mains_gas");
return;
case Fuel.UnmetDemand:
serializer.Serialize(writer, "unmet_demand");
return;
}
throw new Exception("Cannot marshal type Fuel");
}
public static readonly FuelConverter Singleton = new FuelConverter();
}
internal class PriorityElementConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(PriorityElement) || t == typeof(PriorityElement?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "ElectricBattery":
return PriorityElement.ElectricBattery;
case "diverter":
return PriorityElement.Diverter;
}
throw new Exception("Cannot unmarshal type PriorityElement");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (PriorityElement)untypedValue;
switch (value)
{
case PriorityElement.ElectricBattery:
serializer.Serialize(writer, "ElectricBattery");
return;
case PriorityElement.Diverter:
serializer.Serialize(writer, "diverter");
return;
}
throw new Exception("Cannot marshal type PriorityElement");
}
public static readonly PriorityElementConverter Singleton = new PriorityElementConverter();
}
internal class DaylightSavingsEnumConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(DaylightSavingsEnum) || t == typeof(DaylightSavingsEnum?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "applicable and taken into account":
return DaylightSavingsEnum.ApplicableAndTakenIntoAccount;
case "applicable but not taken into account":
return DaylightSavingsEnum.ApplicableButNotTakenIntoAccount;
case "not applicable":
return DaylightSavingsEnum.NotApplicable;
}
throw new Exception("Cannot unmarshal type DaylightSavingsEnum");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (DaylightSavingsEnum)untypedValue;
switch (value)
{
case DaylightSavingsEnum.ApplicableAndTakenIntoAccount:
serializer.Serialize(writer, "applicable and taken into account");
return;
case DaylightSavingsEnum.ApplicableButNotTakenIntoAccount:
serializer.Serialize(writer, "applicable but not taken into account");
return;
case DaylightSavingsEnum.NotApplicable:
serializer.Serialize(writer, "not applicable");
return;
}
throw new Exception("Cannot marshal type DaylightSavingsEnum");
}
public static readonly DaylightSavingsEnumConverter Singleton = new DaylightSavingsEnumConverter();
}
internal class PurpleTypeConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(PurpleType) || t == typeof(PurpleType?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "obstacle":
return PurpleType.Obstacle;
case "overhang":
return PurpleType.Overhang;
}
throw new Exception("Cannot unmarshal type PurpleType");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (PurpleType)untypedValue;
switch (value)
{
case PurpleType.Obstacle:
serializer.Serialize(writer, "obstacle");
return;
case PurpleType.Overhang:
serializer.Serialize(writer, "overhang");
return;
}
throw new Exception("Cannot marshal type PurpleType");
}
public static readonly PurpleTypeConverter Singleton = new PurpleTypeConverter();
}
internal class BuildTypeConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(BuildType) || t == typeof(BuildType?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "flat":
return BuildType.Flat;
case "house":
return BuildType.House;
}
throw new Exception("Cannot unmarshal type BuildType");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (BuildType)untypedValue;
switch (value)
{
case BuildType.Flat:
serializer.Serialize(writer, "flat");
return;
case BuildType.House:
serializer.Serialize(writer, "house");
return;
}
throw new Exception("Cannot marshal type BuildType");
}
public static readonly BuildTypeConverter Singleton = new BuildTypeConverter();
}
internal class BackupCtrlTypeConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(BackupCtrlType) || t == typeof(BackupCtrlType?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "None":
return BackupCtrlType.None;
case "Substitute":
return BackupCtrlType.Substitute;
case "TopUp":
return BackupCtrlType.TopUp;
}
throw new Exception("Cannot unmarshal type BackupCtrlType");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (BackupCtrlType)untypedValue;
switch (value)
{
case BackupCtrlType.None:
serializer.Serialize(writer, "None");
return;
case BackupCtrlType.Substitute:
serializer.Serialize(writer, "Substitute");
return;
case BackupCtrlType.TopUp:
serializer.Serialize(writer, "TopUp");
return;
}
throw new Exception("Cannot marshal type BackupCtrlType");
}
public static readonly BackupCtrlTypeConverter Singleton = new BackupCtrlTypeConverter();
}
internal class BoilerLocationConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(BoilerLocation) || t == typeof(BoilerLocation?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "external":
return BoilerLocation.External;
case "internal":
return BoilerLocation.Internal;
}
throw new Exception("Cannot unmarshal type BoilerLocation");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (BoilerLocation)untypedValue;
switch (value)
{
case BoilerLocation.External:
serializer.Serialize(writer, "external");
return;
case BoilerLocation.Internal:
serializer.Serialize(writer, "internal");
return;
}
throw new Exception("Cannot marshal type BoilerLocation");
}
public static readonly BoilerLocationConverter Singleton = new BoilerLocationConverter();
}
internal class SinkTypeConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(SinkType) || t == typeof(SinkType?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "Air":
return SinkType.Air;
case "Glycol25":
return SinkType.Glycol25;
case "Water":
return SinkType.Water;
}
throw new Exception("Cannot unmarshal type SinkType");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (SinkType)untypedValue;
switch (value)
{
case SinkType.Air:
serializer.Serialize(writer, "Air");
return;
case SinkType.Glycol25:
serializer.Serialize(writer, "Glycol25");
return;
case SinkType.Water:
serializer.Serialize(writer, "Water");
return;
}
throw new Exception("Cannot marshal type SinkType");
}
public static readonly SinkTypeConverter Singleton = new SinkTypeConverter();
}
internal class SourceTypeConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(SourceType) || t == typeof(SourceType?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "ExhaustAirMEV":
return SourceType.ExhaustAirMev;
case "ExhaustAirMVHR":
return SourceType.ExhaustAirMvhr;
case "ExhaustAirMixed":
return SourceType.ExhaustAirMixed;
case "Ground":
return SourceType.Ground;
case "HeatNetwork":
return SourceType.HeatNetwork;
case "OutsideAir":
return SourceType.OutsideAir;
case "WaterGround":
return SourceType.WaterGround;
case "WaterSurface":
return SourceType.WaterSurface;
}
throw new Exception("Cannot unmarshal type SourceType");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (SourceType)untypedValue;
switch (value)
{
case SourceType.ExhaustAirMev:
serializer.Serialize(writer, "ExhaustAirMEV");
return;
case SourceType.ExhaustAirMvhr:
serializer.Serialize(writer, "ExhaustAirMVHR");
return;
case SourceType.ExhaustAirMixed:
serializer.Serialize(writer, "ExhaustAirMixed");
return;
case SourceType.Ground:
serializer.Serialize(writer, "Ground");
return;
case SourceType.HeatNetwork:
serializer.Serialize(writer, "HeatNetwork");
return;
case SourceType.OutsideAir:
serializer.Serialize(writer, "OutsideAir");
return;
case SourceType.WaterGround:
serializer.Serialize(writer, "WaterGround");
return;
case SourceType.WaterSurface:
serializer.Serialize(writer, "WaterSurface");
return;
}
throw new Exception("Cannot marshal type SourceType");
}
public static readonly SourceTypeConverter Singleton = new SourceTypeConverter();
}
internal class TestLetterConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(TestLetter) || t == typeof(TestLetter?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "A":
return TestLetter.A;
case "B":
return TestLetter.B;
case "C":
return TestLetter.C;
case "D":
return TestLetter.D;
case "F":
return TestLetter.F;
case "F2":
return TestLetter.F2;
}
throw new Exception("Cannot unmarshal type TestLetter");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (TestLetter)untypedValue;
switch (value)
{
case TestLetter.A:
serializer.Serialize(writer, "A");
return;
case TestLetter.B:
serializer.Serialize(writer, "B");
return;
case TestLetter.C:
serializer.Serialize(writer, "C");
return;
case TestLetter.D:
serializer.Serialize(writer, "D");
return;
case TestLetter.F:
serializer.Serialize(writer, "F");
return;
case TestLetter.F2:
serializer.Serialize(writer, "F2");
return;
}
throw new Exception("Cannot marshal type TestLetter");
}
public static readonly TestLetterConverter Singleton = new TestLetterConverter();
}
internal class HeatSourceWetTypeConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(HeatSourceWetType) || t == typeof(HeatSourceWetType?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "Boiler":
return HeatSourceWetType.Boiler;
case "HIU":
return HeatSourceWetType.Hiu;
case "HeatBattery":
return HeatSourceWetType.HeatBattery;
case "HeatPump":
return HeatSourceWetType.HeatPump;
}
throw new Exception("Cannot unmarshal type HeatSourceWetType");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (HeatSourceWetType)untypedValue;
switch (value)
{
case HeatSourceWetType.Boiler:
serializer.Serialize(writer, "Boiler");
return;
case HeatSourceWetType.Hiu:
serializer.Serialize(writer, "HIU");
return;
case HeatSourceWetType.HeatBattery:
serializer.Serialize(writer, "HeatBattery");
return;
case HeatSourceWetType.HeatPump:
serializer.Serialize(writer, "HeatPump");
return;
}
throw new Exception("Cannot marshal type HeatSourceWetType");
}
public static readonly HeatSourceWetTypeConverter Singleton = new HeatSourceWetTypeConverter();
}
internal class HeatingControlTypeEnumConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(HeatingControlTypeEnum) || t == typeof(HeatingControlTypeEnum?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "SeparateTempControl":
return HeatingControlTypeEnum.SeparateTempControl;
case "SeparateTimeAndTempControl":
return HeatingControlTypeEnum.SeparateTimeAndTempControl;
}
throw new Exception("Cannot unmarshal type HeatingControlTypeEnum");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (HeatingControlTypeEnum)untypedValue;
switch (value)
{
case HeatingControlTypeEnum.SeparateTempControl:
serializer.Serialize(writer, "SeparateTempControl");
return;
case HeatingControlTypeEnum.SeparateTimeAndTempControl:
serializer.Serialize(writer, "SeparateTimeAndTempControl");
return;
}
throw new Exception("Cannot marshal type HeatingControlTypeEnum");
}
public static readonly HeatingControlTypeEnumConverter Singleton = new HeatingControlTypeEnumConverter();
}
internal class ColdWaterSourceEnumConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(ColdWaterSourceEnum) || t == typeof(ColdWaterSourceEnum?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "header tank":
return ColdWaterSourceEnum.HeaderTank;
case "mains water":
return ColdWaterSourceEnum.MainsWater;
}
throw new Exception("Cannot unmarshal type ColdWaterSourceEnum");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (ColdWaterSourceEnum)untypedValue;
switch (value)
{
case ColdWaterSourceEnum.HeaderTank:
serializer.Serialize(writer, "header tank");
return;
case ColdWaterSourceEnum.MainsWater:
serializer.Serialize(writer, "mains water");
return;
}
throw new Exception("Cannot marshal type ColdWaterSourceEnum");
}
public static readonly ColdWaterSourceEnumConverter Singleton = new ColdWaterSourceEnumConverter();
}
internal class PipeContentsEnumConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(PipeContentsEnum) || t == typeof(PipeContentsEnum?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "air":
return PipeContentsEnum.Air;
case "glycol25":
return PipeContentsEnum.Glycol25;
case "water":
return PipeContentsEnum.Water;
}
throw new Exception("Cannot unmarshal type PipeContentsEnum");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (PipeContentsEnum)untypedValue;
switch (value)
{
case PipeContentsEnum.Air:
serializer.Serialize(writer, "air");
return;
case PipeContentsEnum.Glycol25:
serializer.Serialize(writer, "glycol25");
return;
case PipeContentsEnum.Water:
serializer.Serialize(writer, "water");
return;
}
throw new Exception("Cannot marshal type PipeContentsEnum");
}
public static readonly PipeContentsEnumConverter Singleton = new PipeContentsEnumConverter();
}
internal class ShowerTypeConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(ShowerType) || t == typeof(ShowerType?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "InstantElecShower":
return ShowerType.InstantElecShower;
case "MixerShower":
return ShowerType.MixerShower;
}
throw new Exception("Cannot unmarshal type ShowerType");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (ShowerType)untypedValue;
switch (value)
{
case ShowerType.InstantElecShower:
serializer.Serialize(writer, "InstantElecShower");
return;
case ShowerType.MixerShower:
serializer.Serialize(writer, "MixerShower");
return;
}
throw new Exception("Cannot marshal type ShowerType");
}
public static readonly ShowerTypeConverter Singleton = new ShowerTypeConverter();
}
internal class ControlWindowOpeningEnumConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(ControlWindowOpeningEnum) || t == typeof(ControlWindowOpeningEnum?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "WindowOpening_LivingRoom":
return ControlWindowOpeningEnum.WindowOpeningLivingRoom;
case "WindowOpening_RestOfDwelling":
return ControlWindowOpeningEnum.WindowOpeningRestOfDwelling;
case "always off":
return ControlWindowOpeningEnum.AlwaysOff;
case "hw timer":
return ControlWindowOpeningEnum.HwTimer;
case "window opening":
return ControlWindowOpeningEnum.WindowOpening;
}
throw new Exception("Cannot unmarshal type ControlWindowOpeningEnum");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (ControlWindowOpeningEnum)untypedValue;
switch (value)
{
case ControlWindowOpeningEnum.WindowOpeningLivingRoom:
serializer.Serialize(writer, "WindowOpening_LivingRoom");
return;
case ControlWindowOpeningEnum.WindowOpeningRestOfDwelling:
serializer.Serialize(writer, "WindowOpening_RestOfDwelling");
return;
case ControlWindowOpeningEnum.AlwaysOff:
serializer.Serialize(writer, "always off");
return;
case ControlWindowOpeningEnum.HwTimer:
serializer.Serialize(writer, "hw timer");
return;
case ControlWindowOpeningEnum.WindowOpening:
serializer.Serialize(writer, "window opening");
return;
}
throw new Exception("Cannot marshal type ControlWindowOpeningEnum");
}
public static readonly ControlWindowOpeningEnumConverter Singleton = new ControlWindowOpeningEnumConverter();
}
internal class SolLocConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(SolLoc) || t == typeof(SolLoc?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "HS":
return SolLoc.Hs;
case "NHS":
return SolLoc.Nhs;
case "OUT":
return SolLoc.Out;
}
throw new Exception("Cannot unmarshal type SolLoc");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (SolLoc)untypedValue;
switch (value)
{
case SolLoc.Hs:
serializer.Serialize(writer, "HS");
return;
case SolLoc.Nhs:
serializer.Serialize(writer, "NHS");
return;
case SolLoc.Out:
serializer.Serialize(writer, "OUT");
return;
}
throw new Exception("Cannot marshal type SolLoc");
}
public static readonly SolLocConverter Singleton = new SolLocConverter();
}
internal class HeatSourceTypeConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(HeatSourceType) || t == typeof(HeatSourceType?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "HeatPump_HWOnly":
return HeatSourceType.HeatPumpHwOnly;
case "HeatSourceWet":
return HeatSourceType.HeatSourceWet;
case "ImmersionHeater":
return HeatSourceType.ImmersionHeater;
case "SolarThermalSystem":
return HeatSourceType.SolarThermalSystem;
}
throw new Exception("Cannot unmarshal type HeatSourceType");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (HeatSourceType)untypedValue;
switch (value)
{
case HeatSourceType.HeatPumpHwOnly:
serializer.Serialize(writer, "HeatPump_HWOnly");
return;
case HeatSourceType.HeatSourceWet:
serializer.Serialize(writer, "HeatSourceWet");
return;
case HeatSourceType.ImmersionHeater:
serializer.Serialize(writer, "ImmersionHeater");
return;
case HeatSourceType.SolarThermalSystem:
serializer.Serialize(writer, "SolarThermalSystem");
return;
}
throw new Exception("Cannot marshal type HeatSourceType");
}
public static readonly HeatSourceTypeConverter Singleton = new HeatSourceTypeConverter();
}
internal class HeatSourceWetConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(HeatSourceWet) || t == typeof(HeatSourceWet?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
switch (reader.TokenType)
{
case JsonToken.String:
case JsonToken.Date:
var stringValue = serializer.Deserialize(reader);
return new HeatSourceWet { String = stringValue };
case JsonToken.StartObject:
var objectValue = serializer.Deserialize(reader);
return new HeatSourceWet { HeatSourceWetClass = objectValue };
}
throw new Exception("Cannot unmarshal type HeatSourceWet");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (HeatSourceWet)untypedValue;
if (value.String != null)
{
serializer.Serialize(writer, value.String);
return;
}
if (value.HeatSourceWetClass != null)
{
serializer.Serialize(writer, value.HeatSourceWetClass);
return;
}
throw new Exception("Cannot marshal type HeatSourceWet");
}
public static readonly HeatSourceWetConverter Singleton = new HeatSourceWetConverter();
}
internal class SeparateDhwTestsConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(SeparateDhwTests) || t == typeof(SeparateDhwTests?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "M&L":
return SeparateDhwTests.ML;
case "M&S":
return SeparateDhwTests.MS;
case "M_only":
return SeparateDhwTests.MOnly;
case "No_additional_tests":
return SeparateDhwTests.NoAdditionalTests;
}
throw new Exception("Cannot unmarshal type SeparateDhwTests");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (SeparateDhwTests)untypedValue;
switch (value)
{
case SeparateDhwTests.ML:
serializer.Serialize(writer, "M&L");
return;
case SeparateDhwTests.MS:
serializer.Serialize(writer, "M&S");
return;
case SeparateDhwTests.MOnly:
serializer.Serialize(writer, "M_only");
return;
case SeparateDhwTests.NoAdditionalTests:
serializer.Serialize(writer, "No_additional_tests");
return;
}
throw new Exception("Cannot marshal type SeparateDhwTests");
}
public static readonly SeparateDhwTestsConverter Singleton = new SeparateDhwTestsConverter();
}
internal class HwCylinderTypeConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(HwCylinderType) || t == typeof(HwCylinderType?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "CombiBoiler":
return HwCylinderType.CombiBoiler;
case "HIU":
return HwCylinderType.Hiu;
case "HeatBattery":
return HwCylinderType.HeatBattery;
case "PointOfUse":
return HwCylinderType.PointOfUse;
case "SmartHotWaterTank":
return HwCylinderType.SmartHotWaterTank;
case "StorageTank":
return HwCylinderType.StorageTank;
}
throw new Exception("Cannot unmarshal type HwCylinderType");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (HwCylinderType)untypedValue;
switch (value)
{
case HwCylinderType.CombiBoiler:
serializer.Serialize(writer, "CombiBoiler");
return;
case HwCylinderType.Hiu:
serializer.Serialize(writer, "HIU");
return;
case HwCylinderType.HeatBattery:
serializer.Serialize(writer, "HeatBattery");
return;
case HwCylinderType.PointOfUse:
serializer.Serialize(writer, "PointOfUse");
return;
case HwCylinderType.SmartHotWaterTank:
serializer.Serialize(writer, "SmartHotWaterTank");
return;
case HwCylinderType.StorageTank:
serializer.Serialize(writer, "StorageTank");
return;
}
throw new Exception("Cannot marshal type HwCylinderType");
}
public static readonly HwCylinderTypeConverter Singleton = new HwCylinderTypeConverter();
}
internal class ApplianceTypeConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(ApplianceType) || t == typeof(ApplianceType?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "closed_fire":
return ApplianceType.ClosedFire;
case "closed_with_fan":
return ApplianceType.ClosedWithFan;
case "open_fireplace":
return ApplianceType.OpenFireplace;
case "open_gas_fire":
return ApplianceType.OpenGasFire;
case "open_gas_flue_balancer":
return ApplianceType.OpenGasFlueBalancer;
case "open_gas_kitchen_stove":
return ApplianceType.OpenGasKitchenStove;
}
throw new Exception("Cannot unmarshal type ApplianceType");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (ApplianceType)untypedValue;
switch (value)
{
case ApplianceType.ClosedFire:
serializer.Serialize(writer, "closed_fire");
return;
case ApplianceType.ClosedWithFan:
serializer.Serialize(writer, "closed_with_fan");
return;
case ApplianceType.OpenFireplace:
serializer.Serialize(writer, "open_fireplace");
return;
case ApplianceType.OpenGasFire:
serializer.Serialize(writer, "open_gas_fire");
return;
case ApplianceType.OpenGasFlueBalancer:
serializer.Serialize(writer, "open_gas_flue_balancer");
return;
case ApplianceType.OpenGasKitchenStove:
serializer.Serialize(writer, "open_gas_kitchen_stove");
return;
}
throw new Exception("Cannot marshal type ApplianceType");
}
public static readonly ApplianceTypeConverter Singleton = new ApplianceTypeConverter();
}
internal class ExhaustSituationConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(ExhaustSituation) || t == typeof(ExhaustSituation?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "into_mech_vent":
return ExhaustSituation.IntoMechVent;
case "into_room":
return ExhaustSituation.IntoRoom;
case "into_separate_duct":
return ExhaustSituation.IntoSeparateDuct;
}
throw new Exception("Cannot unmarshal type ExhaustSituation");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (ExhaustSituation)untypedValue;
switch (value)
{
case ExhaustSituation.IntoMechVent:
serializer.Serialize(writer, "into_mech_vent");
return;
case ExhaustSituation.IntoRoom:
serializer.Serialize(writer, "into_room");
return;
case ExhaustSituation.IntoSeparateDuct:
serializer.Serialize(writer, "into_separate_duct");
return;
}
throw new Exception("Cannot marshal type ExhaustSituation");
}
public static readonly ExhaustSituationConverter Singleton = new ExhaustSituationConverter();
}
internal class FuelTypeConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(FuelType) || t == typeof(FuelType?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "coal":
return FuelType.Coal;
case "gas":
return FuelType.Gas;
case "oil":
return FuelType.Oil;
case "wood":
return FuelType.Wood;
}
throw new Exception("Cannot unmarshal type FuelType");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (FuelType)untypedValue;
switch (value)
{
case FuelType.Coal:
serializer.Serialize(writer, "coal");
return;
case FuelType.Gas:
serializer.Serialize(writer, "gas");
return;
case FuelType.Oil:
serializer.Serialize(writer, "oil");
return;
case FuelType.Wood:
serializer.Serialize(writer, "wood");
return;
}
throw new Exception("Cannot marshal type FuelType");
}
public static readonly FuelTypeConverter Singleton = new FuelTypeConverter();
}
internal class SupplySituationConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(SupplySituation) || t == typeof(SupplySituation?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "outside":
return SupplySituation.Outside;
case "room_air":
return SupplySituation.RoomAir;
}
throw new Exception("Cannot unmarshal type SupplySituation");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (SupplySituation)untypedValue;
switch (value)
{
case SupplySituation.Outside:
serializer.Serialize(writer, "outside");
return;
case SupplySituation.RoomAir:
serializer.Serialize(writer, "room_air");
return;
}
throw new Exception("Cannot marshal type SupplySituation");
}
public static readonly SupplySituationConverter Singleton = new SupplySituationConverter();
}
internal class CrossSectionShapeConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(CrossSectionShape) || t == typeof(CrossSectionShape?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "circular":
return CrossSectionShape.Circular;
case "rectangular":
return CrossSectionShape.Rectangular;
}
throw new Exception("Cannot unmarshal type CrossSectionShape");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (CrossSectionShape)untypedValue;
switch (value)
{
case CrossSectionShape.Circular:
serializer.Serialize(writer, "circular");
return;
case CrossSectionShape.Rectangular:
serializer.Serialize(writer, "rectangular");
return;
}
throw new Exception("Cannot marshal type CrossSectionShape");
}
public static readonly CrossSectionShapeConverter Singleton = new CrossSectionShapeConverter();
}
internal class DuctTypeConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(DuctType) || t == typeof(DuctType?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "exhaust":
return DuctType.Exhaust;
case "extract":
return DuctType.Extract;
case "intake":
return DuctType.Intake;
case "supply":
return DuctType.Supply;
}
throw new Exception("Cannot unmarshal type DuctType");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (DuctType)untypedValue;
switch (value)
{
case DuctType.Exhaust:
serializer.Serialize(writer, "exhaust");
return;
case DuctType.Extract:
serializer.Serialize(writer, "extract");
return;
case DuctType.Intake:
serializer.Serialize(writer, "intake");
return;
case DuctType.Supply:
serializer.Serialize(writer, "supply");
return;
}
throw new Exception("Cannot marshal type DuctType");
}
public static readonly DuctTypeConverter Singleton = new DuctTypeConverter();
}
internal class SupAirFlwCtrlConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(SupAirFlwCtrl) || t == typeof(SupAirFlwCtrl?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "LOAD":
return SupAirFlwCtrl.Load;
case "ODA":
return SupAirFlwCtrl.Oda;
}
throw new Exception("Cannot unmarshal type SupAirFlwCtrl");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (SupAirFlwCtrl)untypedValue;
switch (value)
{
case SupAirFlwCtrl.Load:
serializer.Serialize(writer, "LOAD");
return;
case SupAirFlwCtrl.Oda:
serializer.Serialize(writer, "ODA");
return;
}
throw new Exception("Cannot marshal type SupAirFlwCtrl");
}
public static readonly SupAirFlwCtrlConverter Singleton = new SupAirFlwCtrlConverter();
}
internal class SupAirTempCtrlConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(SupAirTempCtrl) || t == typeof(SupAirTempCtrl?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "CONST":
return SupAirTempCtrl.Const;
case "LOAD_COM":
return SupAirTempCtrl.LoadCom;
case "NO_CTRL":
return SupAirTempCtrl.NoCtrl;
}
throw new Exception("Cannot unmarshal type SupAirTempCtrl");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (SupAirTempCtrl)untypedValue;
switch (value)
{
case SupAirTempCtrl.Const:
serializer.Serialize(writer, "CONST");
return;
case SupAirTempCtrl.LoadCom:
serializer.Serialize(writer, "LOAD_COM");
return;
case SupAirTempCtrl.NoCtrl:
serializer.Serialize(writer, "NO_CTRL");
return;
}
throw new Exception("Cannot marshal type SupAirTempCtrl");
}
public static readonly SupAirTempCtrlConverter Singleton = new SupAirTempCtrlConverter();
}
internal class VentTypeConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(VentType) || t == typeof(VentType?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "Centralised continuous MEV":
return VentType.CentralisedContinuousMev;
case "Decentralised continuous MEV":
return VentType.DecentralisedContinuousMev;
case "Intermittent MEV":
return VentType.IntermittentMev;
case "MVHR":
return VentType.Mvhr;
case "PIV":
return VentType.Piv;
}
throw new Exception("Cannot unmarshal type VentType");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (VentType)untypedValue;
switch (value)
{
case VentType.CentralisedContinuousMev:
serializer.Serialize(writer, "Centralised continuous MEV");
return;
case VentType.DecentralisedContinuousMev:
serializer.Serialize(writer, "Decentralised continuous MEV");
return;
case VentType.IntermittentMev:
serializer.Serialize(writer, "Intermittent MEV");
return;
case VentType.Mvhr:
serializer.Serialize(writer, "MVHR");
return;
case VentType.Piv:
serializer.Serialize(writer, "PIV");
return;
}
throw new Exception("Cannot marshal type VentType");
}
public static readonly VentTypeConverter Singleton = new VentTypeConverter();
}
internal class ShieldClassConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(ShieldClass) || t == typeof(ShieldClass?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "Normal":
return ShieldClass.Normal;
case "Open":
return ShieldClass.Open;
case "Shielded":
return ShieldClass.Shielded;
}
throw new Exception("Cannot unmarshal type ShieldClass");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (ShieldClass)untypedValue;
switch (value)
{
case ShieldClass.Normal:
serializer.Serialize(writer, "Normal");
return;
case ShieldClass.Open:
serializer.Serialize(writer, "Open");
return;
case ShieldClass.Shielded:
serializer.Serialize(writer, "Shielded");
return;
}
throw new Exception("Cannot marshal type ShieldClass");
}
public static readonly ShieldClassConverter Singleton = new ShieldClassConverter();
}
internal class TerrainClassConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(TerrainClass) || t == typeof(TerrainClass?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "OpenField":
return TerrainClass.OpenField;
case "OpenWater":
return TerrainClass.OpenWater;
case "Suburban":
return TerrainClass.Suburban;
case "Urban":
return TerrainClass.Urban;
}
throw new Exception("Cannot unmarshal type TerrainClass");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (TerrainClass)untypedValue;
switch (value)
{
case TerrainClass.OpenField:
serializer.Serialize(writer, "OpenField");
return;
case TerrainClass.OpenWater:
serializer.Serialize(writer, "OpenWater");
return;
case TerrainClass.Suburban:
serializer.Serialize(writer, "Suburban");
return;
case TerrainClass.Urban:
serializer.Serialize(writer, "Urban");
return;
}
throw new Exception("Cannot marshal type TerrainClass");
}
public static readonly TerrainClassConverter Singleton = new TerrainClassConverter();
}
internal class InverterTypeEnumConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(InverterTypeEnum) || t == typeof(InverterTypeEnum?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "optimised_inverter":
return InverterTypeEnum.OptimisedInverter;
case "string_inverter":
return InverterTypeEnum.StringInverter;
}
throw new Exception("Cannot unmarshal type InverterTypeEnum");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (InverterTypeEnum)untypedValue;
switch (value)
{
case InverterTypeEnum.OptimisedInverter:
serializer.Serialize(writer, "optimised_inverter");
return;
case InverterTypeEnum.StringInverter:
serializer.Serialize(writer, "string_inverter");
return;
}
throw new Exception("Cannot marshal type InverterTypeEnum");
}
public static readonly InverterTypeEnumConverter Singleton = new InverterTypeEnumConverter();
}
internal class FluffyTypeConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(FluffyType) || t == typeof(FluffyType?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "obstacle":
return FluffyType.Obstacle;
case "overhang":
return FluffyType.Overhang;
case "reveal":
return FluffyType.Reveal;
case "sidefinleft":
return FluffyType.Sidefinleft;
case "sidefinright":
return FluffyType.Sidefinright;
}
throw new Exception("Cannot unmarshal type FluffyType");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (FluffyType)untypedValue;
switch (value)
{
case FluffyType.Obstacle:
serializer.Serialize(writer, "obstacle");
return;
case FluffyType.Overhang:
serializer.Serialize(writer, "overhang");
return;
case FluffyType.Reveal:
serializer.Serialize(writer, "reveal");
return;
case FluffyType.Sidefinleft:
serializer.Serialize(writer, "sidefinleft");
return;
case FluffyType.Sidefinright:
serializer.Serialize(writer, "sidefinright");
return;
}
throw new Exception("Cannot marshal type FluffyType");
}
public static readonly FluffyTypeConverter Singleton = new FluffyTypeConverter();
}
internal class OnSiteGenerationTypeConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(OnSiteGenerationType) || t == typeof(OnSiteGenerationType?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
if (value == "PhotovoltaicSystem")
{
return OnSiteGenerationType.PhotovoltaicSystem;
}
throw new Exception("Cannot unmarshal type OnSiteGenerationType");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (OnSiteGenerationType)untypedValue;
if (value == OnSiteGenerationType.PhotovoltaicSystem)
{
serializer.Serialize(writer, "PhotovoltaicSystem");
return;
}
throw new Exception("Cannot marshal type OnSiteGenerationType");
}
public static readonly OnSiteGenerationTypeConverter Singleton = new OnSiteGenerationTypeConverter();
}
internal class VentilationStrategyConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(VentilationStrategy) || t == typeof(VentilationStrategy?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "moderately_ventilated":
return VentilationStrategy.ModeratelyVentilated;
case "rear_surface_free":
return VentilationStrategy.RearSurfaceFree;
case "strongly_or_forced_ventilated":
return VentilationStrategy.StronglyOrForcedVentilated;
case "unventilated":
return VentilationStrategy.Unventilated;
}
throw new Exception("Cannot unmarshal type VentilationStrategy");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (VentilationStrategy)untypedValue;
switch (value)
{
case VentilationStrategy.ModeratelyVentilated:
serializer.Serialize(writer, "moderately_ventilated");
return;
case VentilationStrategy.RearSurfaceFree:
serializer.Serialize(writer, "rear_surface_free");
return;
case VentilationStrategy.StronglyOrForcedVentilated:
serializer.Serialize(writer, "strongly_or_forced_ventilated");
return;
case VentilationStrategy.Unventilated:
serializer.Serialize(writer, "unventilated");
return;
}
throw new Exception("Cannot marshal type VentilationStrategy");
}
public static readonly VentilationStrategyConverter Singleton = new VentilationStrategyConverter();
}
internal class PreHeatedWaterSourceTypeConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(PreHeatedWaterSourceType) || t == typeof(PreHeatedWaterSourceType?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
if (value == "StorageTank")
{
return PreHeatedWaterSourceType.StorageTank;
}
throw new Exception("Cannot unmarshal type PreHeatedWaterSourceType");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (PreHeatedWaterSourceType)untypedValue;
if (value == PreHeatedWaterSourceType.StorageTank)
{
serializer.Serialize(writer, "StorageTank");
return;
}
throw new Exception("Cannot marshal type PreHeatedWaterSourceType");
}
public static readonly PreHeatedWaterSourceTypeConverter Singleton = new PreHeatedWaterSourceTypeConverter();
}
internal class ApplianceElementConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(ApplianceElement) || t == typeof(ApplianceElement?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "Clothes_drying":
return ApplianceElement.ClothesDrying;
case "Clothes_washing":
return ApplianceElement.ClothesWashing;
case "Dishwasher":
return ApplianceElement.Dishwasher;
case "Freezer":
return ApplianceElement.Freezer;
case "Fridge":
return ApplianceElement.Fridge;
case "Fridge-Freezer":
return ApplianceElement.FridgeFreezer;
case "Hobs":
return ApplianceElement.Hobs;
case "Kettle":
return ApplianceElement.Kettle;
case "Microwave":
return ApplianceElement.Microwave;
case "Otherdevices":
return ApplianceElement.Otherdevices;
case "Oven":
return ApplianceElement.Oven;
case "lighting":
return ApplianceElement.Lighting;
}
throw new Exception("Cannot unmarshal type ApplianceElement");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (ApplianceElement)untypedValue;
switch (value)
{
case ApplianceElement.ClothesDrying:
serializer.Serialize(writer, "Clothes_drying");
return;
case ApplianceElement.ClothesWashing:
serializer.Serialize(writer, "Clothes_washing");
return;
case ApplianceElement.Dishwasher:
serializer.Serialize(writer, "Dishwasher");
return;
case ApplianceElement.Freezer:
serializer.Serialize(writer, "Freezer");
return;
case ApplianceElement.Fridge:
serializer.Serialize(writer, "Fridge");
return;
case ApplianceElement.FridgeFreezer:
serializer.Serialize(writer, "Fridge-Freezer");
return;
case ApplianceElement.Hobs:
serializer.Serialize(writer, "Hobs");
return;
case ApplianceElement.Kettle:
serializer.Serialize(writer, "Kettle");
return;
case ApplianceElement.Microwave:
serializer.Serialize(writer, "Microwave");
return;
case ApplianceElement.Otherdevices:
serializer.Serialize(writer, "Otherdevices");
return;
case ApplianceElement.Oven:
serializer.Serialize(writer, "Oven");
return;
case ApplianceElement.Lighting:
serializer.Serialize(writer, "lighting");
return;
}
throw new Exception("Cannot marshal type ApplianceElement");
}
public static readonly ApplianceElementConverter Singleton = new ApplianceElementConverter();
}
internal class SpaceCoolSystemTypeConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(SpaceCoolSystemType) || t == typeof(SpaceCoolSystemType?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
if (value == "AirConditioning")
{
return SpaceCoolSystemType.AirConditioning;
}
throw new Exception("Cannot unmarshal type SpaceCoolSystemType");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (SpaceCoolSystemType)untypedValue;
if (value == SpaceCoolSystemType.AirConditioning)
{
serializer.Serialize(writer, "AirConditioning");
return;
}
throw new Exception("Cannot marshal type SpaceCoolSystemType");
}
public static readonly SpaceCoolSystemTypeConverter Singleton = new SpaceCoolSystemTypeConverter();
}
internal class AirFlowTypeConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(AirFlowType) || t == typeof(AirFlowType?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "damper-only":
return AirFlowType.DamperOnly;
case "fan-assisted":
return AirFlowType.FanAssisted;
}
throw new Exception("Cannot unmarshal type AirFlowType");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (AirFlowType)untypedValue;
switch (value)
{
case AirFlowType.DamperOnly:
serializer.Serialize(writer, "damper-only");
return;
case AirFlowType.FanAssisted:
serializer.Serialize(writer, "fan-assisted");
return;
}
throw new Exception("Cannot marshal type AirFlowType");
}
public static readonly AirFlowTypeConverter Singleton = new AirFlowTypeConverter();
}
internal class WetEmitterTypeConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(WetEmitterType) || t == typeof(WetEmitterType?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "fancoil":
return WetEmitterType.Fancoil;
case "radiator":
return WetEmitterType.Radiator;
case "ufh":
return WetEmitterType.Ufh;
}
throw new Exception("Cannot unmarshal type WetEmitterType");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (WetEmitterType)untypedValue;
switch (value)
{
case WetEmitterType.Fancoil:
serializer.Serialize(writer, "fancoil");
return;
case WetEmitterType.Radiator:
serializer.Serialize(writer, "radiator");
return;
case WetEmitterType.Ufh:
serializer.Serialize(writer, "ufh");
return;
}
throw new Exception("Cannot marshal type WetEmitterType");
}
public static readonly WetEmitterTypeConverter Singleton = new WetEmitterTypeConverter();
}
internal class SpaceHeatSystemTypeConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(SpaceHeatSystemType) || t == typeof(SpaceHeatSystemType?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "ElecStorageHeater":
return SpaceHeatSystemType.ElecStorageHeater;
case "InstantElecHeater":
return SpaceHeatSystemType.InstantElecHeater;
case "WarmAir":
return SpaceHeatSystemType.WarmAir;
case "WetDistribution":
return SpaceHeatSystemType.WetDistribution;
}
throw new Exception("Cannot unmarshal type SpaceHeatSystemType");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (SpaceHeatSystemType)untypedValue;
switch (value)
{
case SpaceHeatSystemType.ElecStorageHeater:
serializer.Serialize(writer, "ElecStorageHeater");
return;
case SpaceHeatSystemType.InstantElecHeater:
serializer.Serialize(writer, "InstantElecHeater");
return;
case SpaceHeatSystemType.WarmAir:
serializer.Serialize(writer, "WarmAir");
return;
case SpaceHeatSystemType.WetDistribution:
serializer.Serialize(writer, "WetDistribution");
return;
}
throw new Exception("Cannot marshal type SpaceHeatSystemType");
}
public static readonly SpaceHeatSystemTypeConverter Singleton = new SpaceHeatSystemTypeConverter();
}
internal class WwhrTypeConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(WwhrType) || t == typeof(WwhrType?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "WWHRS_InstantaneousSystemA":
return WwhrType.WwhrsInstantaneousSystemA;
case "WWHRS_InstantaneousSystemB":
return WwhrType.WwhrsInstantaneousSystemB;
case "WWHRS_InstantaneousSystemC":
return WwhrType.WwhrsInstantaneousSystemC;
}
throw new Exception("Cannot unmarshal type WwhrType");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (WwhrType)untypedValue;
switch (value)
{
case WwhrType.WwhrsInstantaneousSystemA:
serializer.Serialize(writer, "WWHRS_InstantaneousSystemA");
return;
case WwhrType.WwhrsInstantaneousSystemB:
serializer.Serialize(writer, "WWHRS_InstantaneousSystemB");
return;
case WwhrType.WwhrsInstantaneousSystemC:
serializer.Serialize(writer, "WWHRS_InstantaneousSystemC");
return;
}
throw new Exception("Cannot marshal type WwhrType");
}
public static readonly WwhrTypeConverter Singleton = new WwhrTypeConverter();
}
internal class WaterHeatSchedDefaultEnumConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(WaterHeatSchedDefaultEnum) || t == typeof(WaterHeatSchedDefaultEnum?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "AllDay":
return WaterHeatSchedDefaultEnum.AllDay;
case "HeatingHours":
return WaterHeatSchedDefaultEnum.HeatingHours;
}
throw new Exception("Cannot unmarshal type WaterHeatSchedDefaultEnum");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (WaterHeatSchedDefaultEnum)untypedValue;
switch (value)
{
case WaterHeatSchedDefaultEnum.AllDay:
serializer.Serialize(writer, "AllDay");
return;
case WaterHeatSchedDefaultEnum.HeatingHours:
serializer.Serialize(writer, "HeatingHours");
return;
}
throw new Exception("Cannot marshal type WaterHeatSchedDefaultEnum");
}
public static readonly WaterHeatSchedDefaultEnumConverter Singleton = new WaterHeatSchedDefaultEnumConverter();
}
internal class EdgeInsulationTypeConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(EdgeInsulationType) || t == typeof(EdgeInsulationType?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "horizontal":
return EdgeInsulationType.Horizontal;
case "vertical":
return EdgeInsulationType.Vertical;
}
throw new Exception("Cannot unmarshal type EdgeInsulationType");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (EdgeInsulationType)untypedValue;
switch (value)
{
case EdgeInsulationType.Horizontal:
serializer.Serialize(writer, "horizontal");
return;
case EdgeInsulationType.Vertical:
serializer.Serialize(writer, "vertical");
return;
}
throw new Exception("Cannot marshal type EdgeInsulationType");
}
public static readonly EdgeInsulationTypeConverter Singleton = new EdgeInsulationTypeConverter();
}
internal class FloorTypeConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(FloorType) || t == typeof(FloorType?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "Heated_basement":
return FloorType.HeatedBasement;
case "Slab_edge_insulation":
return FloorType.SlabEdgeInsulation;
case "Slab_no_edge_insulation":
return FloorType.SlabNoEdgeInsulation;
case "Suspended_floor":
return FloorType.SuspendedFloor;
case "Unheated_basement":
return FloorType.UnheatedBasement;
}
throw new Exception("Cannot unmarshal type FloorType");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (FloorType)untypedValue;
switch (value)
{
case FloorType.HeatedBasement:
serializer.Serialize(writer, "Heated_basement");
return;
case FloorType.SlabEdgeInsulation:
serializer.Serialize(writer, "Slab_edge_insulation");
return;
case FloorType.SlabNoEdgeInsulation:
serializer.Serialize(writer, "Slab_no_edge_insulation");
return;
case FloorType.SuspendedFloor:
serializer.Serialize(writer, "Suspended_floor");
return;
case FloorType.UnheatedBasement:
serializer.Serialize(writer, "Unheated_basement");
return;
}
throw new Exception("Cannot marshal type FloorType");
}
public static readonly FloorTypeConverter Singleton = new FloorTypeConverter();
}
internal class MassDistributionClassConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(MassDistributionClass) || t == typeof(MassDistributionClass?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "D":
return MassDistributionClass.D;
case "E":
return MassDistributionClass.E;
case "I":
return MassDistributionClass.I;
case "IE":
return MassDistributionClass.Ie;
case "M":
return MassDistributionClass.M;
}
throw new Exception("Cannot unmarshal type MassDistributionClass");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (MassDistributionClass)untypedValue;
switch (value)
{
case MassDistributionClass.D:
serializer.Serialize(writer, "D");
return;
case MassDistributionClass.E:
serializer.Serialize(writer, "E");
return;
case MassDistributionClass.I:
serializer.Serialize(writer, "I");
return;
case MassDistributionClass.Ie:
serializer.Serialize(writer, "IE");
return;
case MassDistributionClass.M:
serializer.Serialize(writer, "M");
return;
}
throw new Exception("Cannot marshal type MassDistributionClass");
}
public static readonly MassDistributionClassConverter Singleton = new MassDistributionClassConverter();
}
internal class ShieldFactLocationEnumConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(ShieldFactLocationEnum) || t == typeof(ShieldFactLocationEnum?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "Average":
return ShieldFactLocationEnum.Average;
case "Exposed":
return ShieldFactLocationEnum.Exposed;
case "Sheltered":
return ShieldFactLocationEnum.Sheltered;
}
throw new Exception("Cannot unmarshal type ShieldFactLocationEnum");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (ShieldFactLocationEnum)untypedValue;
switch (value)
{
case ShieldFactLocationEnum.Average:
serializer.Serialize(writer, "Average");
return;
case ShieldFactLocationEnum.Exposed:
serializer.Serialize(writer, "Exposed");
return;
case ShieldFactLocationEnum.Sheltered:
serializer.Serialize(writer, "Sheltered");
return;
}
throw new Exception("Cannot marshal type ShieldFactLocationEnum");
}
public static readonly ShieldFactLocationEnumConverter Singleton = new ShieldFactLocationEnumConverter();
}
internal class ControlsConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(Controls) || t == typeof(Controls?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "auto_motorised":
return Controls.AutoMotorised;
case "combined_light_blind_HVAC":
return Controls.CombinedLightBlindHvac;
case "manual":
return Controls.Manual;
case "manual_motorised":
return Controls.ManualMotorised;
}
throw new Exception("Cannot unmarshal type Controls");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (Controls)untypedValue;
switch (value)
{
case Controls.AutoMotorised:
serializer.Serialize(writer, "auto_motorised");
return;
case Controls.CombinedLightBlindHvac:
serializer.Serialize(writer, "combined_light_blind_HVAC");
return;
case Controls.Manual:
serializer.Serialize(writer, "manual");
return;
case Controls.ManualMotorised:
serializer.Serialize(writer, "manual_motorised");
return;
}
throw new Exception("Cannot marshal type Controls");
}
public static readonly ControlsConverter Singleton = new ControlsConverter();
}
internal class IsOpenUnionConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(IsOpenUnion) || t == typeof(IsOpenUnion?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
switch (reader.TokenType)
{
case JsonToken.Null:
return new IsOpenUnion { };
case JsonToken.Boolean:
var boolValue = serializer.Deserialize(reader);
return new IsOpenUnion { Bool = boolValue };
case JsonToken.String:
case JsonToken.Date:
var stringValue = serializer.Deserialize(reader);
return new IsOpenUnion { String = stringValue };
}
throw new Exception("Cannot unmarshal type IsOpenUnion");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (IsOpenUnion)untypedValue;
if (value.IsNull)
{
serializer.Serialize(writer, null);
return;
}
if (value.Bool != null)
{
serializer.Serialize(writer, value.Bool.Value);
return;
}
if (value.String != null)
{
serializer.Serialize(writer, value.String);
return;
}
throw new Exception("Cannot marshal type IsOpenUnion");
}
public static readonly IsOpenUnionConverter Singleton = new IsOpenUnionConverter();
}
internal class TreatmentTypeConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(TreatmentType) || t == typeof(TreatmentType?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "blinds":
return TreatmentType.Blinds;
case "curtains":
return TreatmentType.Curtains;
}
throw new Exception("Cannot unmarshal type TreatmentType");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (TreatmentType)untypedValue;
switch (value)
{
case TreatmentType.Blinds:
serializer.Serialize(writer, "blinds");
return;
case TreatmentType.Curtains:
serializer.Serialize(writer, "curtains");
return;
}
throw new Exception("Cannot marshal type TreatmentType");
}
public static readonly TreatmentTypeConverter Singleton = new TreatmentTypeConverter();
}
internal class BuildingElementTypeConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(BuildingElementType) || t == typeof(BuildingElementType?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "BuildingElementAdjacentConditionedSpace":
return BuildingElementType.BuildingElementAdjacentConditionedSpace;
case "BuildingElementAdjacentUnconditionedSpace_Simple":
return BuildingElementType.BuildingElementAdjacentUnconditionedSpaceSimple;
case "BuildingElementGround":
return BuildingElementType.BuildingElementGround;
case "BuildingElementOpaque":
return BuildingElementType.BuildingElementOpaque;
case "BuildingElementTransparent":
return BuildingElementType.BuildingElementTransparent;
}
throw new Exception("Cannot unmarshal type BuildingElementType");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (BuildingElementType)untypedValue;
switch (value)
{
case BuildingElementType.BuildingElementAdjacentConditionedSpace:
serializer.Serialize(writer, "BuildingElementAdjacentConditionedSpace");
return;
case BuildingElementType.BuildingElementAdjacentUnconditionedSpaceSimple:
serializer.Serialize(writer, "BuildingElementAdjacentUnconditionedSpace_Simple");
return;
case BuildingElementType.BuildingElementGround:
serializer.Serialize(writer, "BuildingElementGround");
return;
case BuildingElementType.BuildingElementOpaque:
serializer.Serialize(writer, "BuildingElementOpaque");
return;
case BuildingElementType.BuildingElementTransparent:
serializer.Serialize(writer, "BuildingElementTransparent");
return;
}
throw new Exception("Cannot marshal type BuildingElementType");
}
public static readonly BuildingElementTypeConverter Singleton = new BuildingElementTypeConverter();
}
internal class MinMaxValueCheckConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(double) || t == typeof(double?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
if (value >= 0)
{
return value;
}
throw new Exception("Cannot unmarshal type double");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (double)untypedValue;
if (value >= 0)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type double");
}
public static readonly MinMaxValueCheckConverter Singleton = new MinMaxValueCheckConverter();
}
internal class SpaceSystemConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(SpaceSystem) || t == typeof(SpaceSystem?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
switch (reader.TokenType)
{
case JsonToken.Null:
return new SpaceSystem { };
case JsonToken.String:
case JsonToken.Date:
var stringValue = serializer.Deserialize(reader);
return new SpaceSystem { String = stringValue };
case JsonToken.StartArray:
var arrayValue = serializer.Deserialize>(reader);
return new SpaceSystem { StringArray = arrayValue };
}
throw new Exception("Cannot unmarshal type SpaceSystem");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (SpaceSystem)untypedValue;
if (value.IsNull)
{
serializer.Serialize(writer, null);
return;
}
if (value.String != null)
{
serializer.Serialize(writer, value.String);
return;
}
if (value.StringArray != null)
{
serializer.Serialize(writer, value.StringArray);
return;
}
throw new Exception("Cannot marshal type SpaceSystem");
}
public static readonly SpaceSystemConverter Singleton = new SpaceSystemConverter();
}
internal class SpaceHeatControlEnumConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(SpaceHeatControlEnum) || t == typeof(SpaceHeatControlEnum?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "livingroom":
return SpaceHeatControlEnum.Livingroom;
case "restofdwelling":
return SpaceHeatControlEnum.Restofdwelling;
}
throw new Exception("Cannot unmarshal type SpaceHeatControlEnum");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (SpaceHeatControlEnum)untypedValue;
switch (value)
{
case SpaceHeatControlEnum.Livingroom:
serializer.Serialize(writer, "livingroom");
return;
case SpaceHeatControlEnum.Restofdwelling:
serializer.Serialize(writer, "restofdwelling");
return;
}
throw new Exception("Cannot marshal type SpaceHeatControlEnum");
}
public static readonly SpaceHeatControlEnumConverter Singleton = new SpaceHeatControlEnumConverter();
}
internal class ThermalBridgingConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(ThermalBridging) || t == typeof(ThermalBridging?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
switch (reader.TokenType)
{
case JsonToken.Integer:
case JsonToken.Float:
var doubleValue = serializer.Deserialize(reader);
return new ThermalBridging { Double = doubleValue };
case JsonToken.StartObject:
var objectValue = serializer.Deserialize>(reader);
return new ThermalBridging { ThermalBridgeMap = objectValue };
}
throw new Exception("Cannot unmarshal type ThermalBridging");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (ThermalBridging)untypedValue;
if (value.Double != null)
{
serializer.Serialize(writer, value.Double.Value);
return;
}
if (value.ThermalBridgeMap != null)
{
serializer.Serialize(writer, value.ThermalBridgeMap);
return;
}
throw new Exception("Cannot marshal type ThermalBridging");
}
public static readonly ThermalBridgingConverter Singleton = new ThermalBridgingConverter();
}
internal class ThermalBridgingTypeConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(ThermalBridgingType) || t == typeof(ThermalBridgingType?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "ThermalBridgeLinear":
return ThermalBridgingType.ThermalBridgeLinear;
case "ThermalBridgePoint":
return ThermalBridgingType.ThermalBridgePoint;
}
throw new Exception("Cannot unmarshal type ThermalBridgingType");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (ThermalBridgingType)untypedValue;
switch (value)
{
case ThermalBridgingType.ThermalBridgeLinear:
serializer.Serialize(writer, "ThermalBridgeLinear");
return;
case ThermalBridgingType.ThermalBridgePoint:
serializer.Serialize(writer, "ThermalBridgePoint");
return;
}
throw new Exception("Cannot marshal type ThermalBridgingType");
}
public static readonly ThermalBridgingTypeConverter Singleton = new ThermalBridgingTypeConverter();
}
internal class TempSetpntBasisEnumConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(TempSetpntBasisEnum) || t == typeof(TempSetpntBasisEnum?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize(reader);
switch (value)
{
case "air":
return TempSetpntBasisEnum.Air;
case "operative":
return TempSetpntBasisEnum.Operative;
}
throw new Exception("Cannot unmarshal type TempSetpntBasisEnum");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (TempSetpntBasisEnum)untypedValue;
switch (value)
{
case TempSetpntBasisEnum.Air:
serializer.Serialize(writer, "air");
return;
case TempSetpntBasisEnum.Operative:
serializer.Serialize(writer, "operative");
return;
}
throw new Exception("Cannot marshal type TempSetpntBasisEnum");
}
public static readonly TempSetpntBasisEnumConverter Singleton = new TempSetpntBasisEnumConverter();
}
}