From 5a29814e3e709ced71e276528893768808857502 Mon Sep 17 00:00:00 2001 From: Steven Janzou Date: Tue, 10 Dec 2024 00:38:14 -0700 Subject: [PATCH 01/19] 2024.12.12.ssc.297 release candidate - no expiration --- .../FresnelPhysicalIph_MSLFIPHCommercial.json | 14 +- ...snelPhysicalIph_MSLFIPHLCOHCalculator.json | 12 +- .../FresnelPhysicalIph_MSLFIPHNone.json | 12 +- ...FresnelPhysicalIph_MSLFIPHSingleOwner.json | 14 +- ...Physical_MSLFAllEquityPartnershipFlip.json | 12 +- ...Physical_MSLFLeveragedPartnershipFlip.json | 12 +- .../FresnelPhysical_MSLFMerchantPlant.json | 12 +- .../FresnelPhysical_MSLFSaleLeaseback.json | 12 +- .../FresnelPhysical_MSLFSingleOwner.json | 12 +- .../SingleownerHeat_MSLFIPHSingleOwner.json | 2 +- ...wnerHeat_PhysicalTroughIPHSingleOwner.json | 2 +- ...sicalIph_PhysicalTroughIPHSingleOwner.json | 2 +- .../Utilityrate5_MSLFIPHCommercial.json | 2 +- .../Utilityrate5_MSLFIPHSingleOwner.json | 2 +- ...PVWattsWindBatteryHybridHostDeveloper.json | 56 +++---- ...indFuelCellBatteryHybridHostDeveloper.json | 24 +-- ...voltaicWindBatteryHybridHostDeveloper.json | 56 +++---- ...ityrate5_PhysicalTroughIPHSingleOwner.json | 2 +- api/include/SAM_FresnelPhysical.h | 110 ++++++------- api/include/SAM_FresnelPhysicalIph.h | 110 ++++++------- api/include/SAM_Pvsamv1.h | 2 + api/include/SAM_Pvwattsv8.h | 2 + api/modules/SAM_FresnelPhysical.cpp | 150 +++++++++--------- api/modules/SAM_FresnelPhysicalIph.cpp | 150 +++++++++--------- api/modules/SAM_Pvsamv1.cpp | 9 ++ api/modules/SAM_Pvwattsv8.cpp | 9 ++ src/main_add.h | 2 +- 27 files changed, 396 insertions(+), 408 deletions(-) diff --git a/api/api_autogen/library/defaults/FresnelPhysicalIph_MSLFIPHCommercial.json b/api/api_autogen/library/defaults/FresnelPhysicalIph_MSLFIPHCommercial.json index e5714b9ed..331baa3e8 100644 --- a/api/api_autogen/library/defaults/FresnelPhysicalIph_MSLFIPHCommercial.json +++ b/api/api_autogen/library/defaults/FresnelPhysicalIph_MSLFIPHCommercial.json @@ -28,10 +28,14 @@ "V_hdr_min": 2, "V_wind_des": 4, "eta_pump": 0.85, + "f_htfmax": 1.2, + "f_htfmin": 0.25, "field_fl_props": [ [1.000000, 7.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000] ], "land_mult": 1.6, + "m_dot_htfmax": 14.4763, + "m_dot_htfmin": 3.01589, "mc_bal_cold": 0.2, "mc_bal_hot": 0.2, "mc_bal_sca": 4.5, @@ -42,16 +46,10 @@ "rec_su_delay": 0.2, "theta_dep": 10, "theta_stow": 170, + "use_abs_or_rel_mdot_limit": 0, "washes_per_year": 120, "water_per_wash": 0.02 }, - "SolarField": { - "f_htfmax": 1.2, - "f_htfmin": 0.25, - "m_dot_htfmax": 14.4763, - "m_dot_htfmin": 3.01589, - "use_abs_or_rel_mdot_limit": 0 - }, "ColRec": { "A_aperture": 940.6, "AbsorberMaterial": [1.000000, 1.000000, 1.000000, 1.000000], @@ -311,7 +309,7 @@ "ur_en_ts_buy_rate": 0, "ur_en_ts_sell_rate": 0, "ur_enable_billing_demand": 0, - "ur_metering_option": 0, + "ur_metering_option": 4, "ur_monthly_fixed_charge": 0, "ur_monthly_min_charge": 0, "ur_nb_apply_credit_current_month": 0, diff --git a/api/api_autogen/library/defaults/FresnelPhysicalIph_MSLFIPHLCOHCalculator.json b/api/api_autogen/library/defaults/FresnelPhysicalIph_MSLFIPHLCOHCalculator.json index a94f62f8b..e50070bb4 100644 --- a/api/api_autogen/library/defaults/FresnelPhysicalIph_MSLFIPHLCOHCalculator.json +++ b/api/api_autogen/library/defaults/FresnelPhysicalIph_MSLFIPHLCOHCalculator.json @@ -28,10 +28,14 @@ "V_hdr_min": 2, "V_wind_des": 4, "eta_pump": 0.85, + "f_htfmax": 1.2, + "f_htfmin": 0.25, "field_fl_props": [ [1.000000, 7.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000] ], "land_mult": 1.6, + "m_dot_htfmax": 14.4763, + "m_dot_htfmin": 3.01589, "mc_bal_cold": 0.2, "mc_bal_hot": 0.2, "mc_bal_sca": 4.5, @@ -42,16 +46,10 @@ "rec_su_delay": 0.2, "theta_dep": 10, "theta_stow": 170, + "use_abs_or_rel_mdot_limit": 0, "washes_per_year": 120, "water_per_wash": 0.02 }, - "SolarField": { - "f_htfmax": 1.2, - "f_htfmin": 0.25, - "m_dot_htfmax": 14.4763, - "m_dot_htfmin": 3.01589, - "use_abs_or_rel_mdot_limit": 0 - }, "ColRec": { "A_aperture": 940.6, "AbsorberMaterial": [1.000000, 1.000000, 1.000000, 1.000000], diff --git a/api/api_autogen/library/defaults/FresnelPhysicalIph_MSLFIPHNone.json b/api/api_autogen/library/defaults/FresnelPhysicalIph_MSLFIPHNone.json index 7eaf40a1b..d3c584b58 100644 --- a/api/api_autogen/library/defaults/FresnelPhysicalIph_MSLFIPHNone.json +++ b/api/api_autogen/library/defaults/FresnelPhysicalIph_MSLFIPHNone.json @@ -28,10 +28,14 @@ "V_hdr_min": 2, "V_wind_des": 4, "eta_pump": 0.85, + "f_htfmax": 1.2, + "f_htfmin": 0.25, "field_fl_props": [ [1.000000, 7.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000] ], "land_mult": 1.6, + "m_dot_htfmax": 14.4763, + "m_dot_htfmin": 3.01589, "mc_bal_cold": 0.2, "mc_bal_hot": 0.2, "mc_bal_sca": 4.5, @@ -42,16 +46,10 @@ "rec_su_delay": 0.2, "theta_dep": 10, "theta_stow": 170, + "use_abs_or_rel_mdot_limit": 0, "washes_per_year": 120, "water_per_wash": 0.02 }, - "SolarField": { - "f_htfmax": 1.2, - "f_htfmin": 0.25, - "m_dot_htfmax": 14.4763, - "m_dot_htfmin": 3.01589, - "use_abs_or_rel_mdot_limit": 0 - }, "ColRec": { "A_aperture": 940.6, "AbsorberMaterial": [1.000000, 1.000000, 1.000000, 1.000000], diff --git a/api/api_autogen/library/defaults/FresnelPhysicalIph_MSLFIPHSingleOwner.json b/api/api_autogen/library/defaults/FresnelPhysicalIph_MSLFIPHSingleOwner.json index 50b581499..5ff4ecc54 100644 --- a/api/api_autogen/library/defaults/FresnelPhysicalIph_MSLFIPHSingleOwner.json +++ b/api/api_autogen/library/defaults/FresnelPhysicalIph_MSLFIPHSingleOwner.json @@ -28,10 +28,14 @@ "V_hdr_min": 2, "V_wind_des": 4, "eta_pump": 0.85, + "f_htfmax": 1.2, + "f_htfmin": 0.25, "field_fl_props": [ [1.000000, 7.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000] ], "land_mult": 1.6, + "m_dot_htfmax": 14.4763, + "m_dot_htfmin": 3.01589, "mc_bal_cold": 0.2, "mc_bal_hot": 0.2, "mc_bal_sca": 4.5, @@ -42,16 +46,10 @@ "rec_su_delay": 0.2, "theta_dep": 10, "theta_stow": 170, + "use_abs_or_rel_mdot_limit": 0, "washes_per_year": 120, "water_per_wash": 0.02 }, - "SolarField": { - "f_htfmax": 1.2, - "f_htfmin": 0.25, - "m_dot_htfmax": 14.4763, - "m_dot_htfmin": 3.01589, - "use_abs_or_rel_mdot_limit": 0 - }, "ColRec": { "A_aperture": 940.6, "AbsorberMaterial": [1.000000, 1.000000, 1.000000, 1.000000], @@ -355,7 +353,7 @@ "ur_en_ts_buy_rate": 0, "ur_en_ts_sell_rate": 0, "ur_enable_billing_demand": 0, - "ur_metering_option": 0, + "ur_metering_option": 4, "ur_monthly_fixed_charge": 0, "ur_monthly_min_charge": 0, "ur_nb_apply_credit_current_month": 0, diff --git a/api/api_autogen/library/defaults/FresnelPhysical_MSLFAllEquityPartnershipFlip.json b/api/api_autogen/library/defaults/FresnelPhysical_MSLFAllEquityPartnershipFlip.json index 4e9895b5a..494e5c1bf 100644 --- a/api/api_autogen/library/defaults/FresnelPhysical_MSLFAllEquityPartnershipFlip.json +++ b/api/api_autogen/library/defaults/FresnelPhysical_MSLFAllEquityPartnershipFlip.json @@ -30,10 +30,14 @@ "V_hdr_min": 2, "V_wind_des": 4, "eta_pump": 0.85, + "f_htfmax": 1.2, + "f_htfmin": 0.25, "field_fl_props": [ [0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000] ], "land_mult": 1.6, + "m_dot_htfmax": 14.4763, + "m_dot_htfmin": 3.01589, "mc_bal_cold": 0.2, "mc_bal_hot": 0.2, "mc_bal_sca": 4.5, @@ -42,16 +46,10 @@ "rec_htf_vol": 1, "theta_dep": 10, "theta_stow": 170, + "use_abs_or_rel_mdot_limit": 0, "washes_per_year": 120, "water_per_wash": 0.02 }, - "SolarField": { - "f_htfmax": 1.2, - "f_htfmin": 0.25, - "m_dot_htfmax": 14.4763, - "m_dot_htfmin": 3.01589, - "use_abs_or_rel_mdot_limit": 0 - }, "ColRec": { "A_aperture": 940.6, "AbsorberMaterial": [1.000000, 1.000000, 1.000000, 1.000000], diff --git a/api/api_autogen/library/defaults/FresnelPhysical_MSLFLeveragedPartnershipFlip.json b/api/api_autogen/library/defaults/FresnelPhysical_MSLFLeveragedPartnershipFlip.json index cdd85cb38..9df3fcd7f 100644 --- a/api/api_autogen/library/defaults/FresnelPhysical_MSLFLeveragedPartnershipFlip.json +++ b/api/api_autogen/library/defaults/FresnelPhysical_MSLFLeveragedPartnershipFlip.json @@ -30,10 +30,14 @@ "V_hdr_min": 2, "V_wind_des": 4, "eta_pump": 0.85, + "f_htfmax": 1.2, + "f_htfmin": 0.25, "field_fl_props": [ [0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000] ], "land_mult": 1.6, + "m_dot_htfmax": 14.4763, + "m_dot_htfmin": 3.01589, "mc_bal_cold": 0.2, "mc_bal_hot": 0.2, "mc_bal_sca": 4.5, @@ -42,16 +46,10 @@ "rec_htf_vol": 1, "theta_dep": 10, "theta_stow": 170, + "use_abs_or_rel_mdot_limit": 0, "washes_per_year": 120, "water_per_wash": 0.02 }, - "SolarField": { - "f_htfmax": 1.2, - "f_htfmin": 0.25, - "m_dot_htfmax": 14.4763, - "m_dot_htfmin": 3.01589, - "use_abs_or_rel_mdot_limit": 0 - }, "ColRec": { "A_aperture": 940.6, "AbsorberMaterial": [1.000000, 1.000000, 1.000000, 1.000000], diff --git a/api/api_autogen/library/defaults/FresnelPhysical_MSLFMerchantPlant.json b/api/api_autogen/library/defaults/FresnelPhysical_MSLFMerchantPlant.json index 4ee858cb7..ed5587702 100644 --- a/api/api_autogen/library/defaults/FresnelPhysical_MSLFMerchantPlant.json +++ b/api/api_autogen/library/defaults/FresnelPhysical_MSLFMerchantPlant.json @@ -30,10 +30,14 @@ "V_hdr_min": 2, "V_wind_des": 4, "eta_pump": 0.85, + "f_htfmax": 1.2, + "f_htfmin": 0.25, "field_fl_props": [ [0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000] ], "land_mult": 1.6, + "m_dot_htfmax": 14.4763, + "m_dot_htfmin": 3.01589, "mc_bal_cold": 0.2, "mc_bal_hot": 0.2, "mc_bal_sca": 4.5, @@ -42,16 +46,10 @@ "rec_htf_vol": 1, "theta_dep": 10, "theta_stow": 170, + "use_abs_or_rel_mdot_limit": 0, "washes_per_year": 120, "water_per_wash": 0.02 }, - "SolarField": { - "f_htfmax": 1.2, - "f_htfmin": 0.25, - "m_dot_htfmax": 14.4763, - "m_dot_htfmin": 3.01589, - "use_abs_or_rel_mdot_limit": 0 - }, "ColRec": { "A_aperture": 940.6, "AbsorberMaterial": [1.000000, 1.000000, 1.000000, 1.000000], diff --git a/api/api_autogen/library/defaults/FresnelPhysical_MSLFSaleLeaseback.json b/api/api_autogen/library/defaults/FresnelPhysical_MSLFSaleLeaseback.json index c30f5fd6d..4b6542471 100644 --- a/api/api_autogen/library/defaults/FresnelPhysical_MSLFSaleLeaseback.json +++ b/api/api_autogen/library/defaults/FresnelPhysical_MSLFSaleLeaseback.json @@ -30,10 +30,14 @@ "V_hdr_min": 2, "V_wind_des": 4, "eta_pump": 0.85, + "f_htfmax": 1.2, + "f_htfmin": 0.25, "field_fl_props": [ [0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000] ], "land_mult": 1.6, + "m_dot_htfmax": 14.4763, + "m_dot_htfmin": 3.01589, "mc_bal_cold": 0.2, "mc_bal_hot": 0.2, "mc_bal_sca": 4.5, @@ -42,16 +46,10 @@ "rec_htf_vol": 1, "theta_dep": 10, "theta_stow": 170, + "use_abs_or_rel_mdot_limit": 0, "washes_per_year": 120, "water_per_wash": 0.02 }, - "SolarField": { - "f_htfmax": 1.2, - "f_htfmin": 0.25, - "m_dot_htfmax": 14.4763, - "m_dot_htfmin": 3.01589, - "use_abs_or_rel_mdot_limit": 0 - }, "ColRec": { "A_aperture": 940.6, "AbsorberMaterial": [1.000000, 1.000000, 1.000000, 1.000000], diff --git a/api/api_autogen/library/defaults/FresnelPhysical_MSLFSingleOwner.json b/api/api_autogen/library/defaults/FresnelPhysical_MSLFSingleOwner.json index 5909060e4..07ec8bd47 100644 --- a/api/api_autogen/library/defaults/FresnelPhysical_MSLFSingleOwner.json +++ b/api/api_autogen/library/defaults/FresnelPhysical_MSLFSingleOwner.json @@ -30,10 +30,14 @@ "V_hdr_min": 2, "V_wind_des": 4, "eta_pump": 0.85, + "f_htfmax": 1.2, + "f_htfmin": 0.25, "field_fl_props": [ [0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000] ], "land_mult": 1.6, + "m_dot_htfmax": 14.4763, + "m_dot_htfmin": 3.01589, "mc_bal_cold": 0.2, "mc_bal_hot": 0.2, "mc_bal_sca": 4.5, @@ -42,16 +46,10 @@ "rec_htf_vol": 1, "theta_dep": 10, "theta_stow": 170, + "use_abs_or_rel_mdot_limit": 0, "washes_per_year": 120, "water_per_wash": 0.02 }, - "SolarField": { - "f_htfmax": 1.2, - "f_htfmin": 0.25, - "m_dot_htfmax": 14.4763, - "m_dot_htfmin": 3.01589, - "use_abs_or_rel_mdot_limit": 0 - }, "ColRec": { "A_aperture": 940.6, "AbsorberMaterial": [1.000000, 1.000000, 1.000000, 1.000000], diff --git a/api/api_autogen/library/defaults/SingleownerHeat_MSLFIPHSingleOwner.json b/api/api_autogen/library/defaults/SingleownerHeat_MSLFIPHSingleOwner.json index f6fa1311a..3f2de315b 100644 --- a/api/api_autogen/library/defaults/SingleownerHeat_MSLFIPHSingleOwner.json +++ b/api/api_autogen/library/defaults/SingleownerHeat_MSLFIPHSingleOwner.json @@ -311,7 +311,7 @@ "ur_en_ts_buy_rate": 0, "ur_en_ts_sell_rate": 0, "ur_enable_billing_demand": 0, - "ur_metering_option": 0, + "ur_metering_option": 4, "ur_monthly_fixed_charge": 0, "ur_monthly_min_charge": 0, "ur_nb_apply_credit_current_month": 0, diff --git a/api/api_autogen/library/defaults/SingleownerHeat_PhysicalTroughIPHSingleOwner.json b/api/api_autogen/library/defaults/SingleownerHeat_PhysicalTroughIPHSingleOwner.json index 5f6be959e..dd76673bf 100644 --- a/api/api_autogen/library/defaults/SingleownerHeat_PhysicalTroughIPHSingleOwner.json +++ b/api/api_autogen/library/defaults/SingleownerHeat_PhysicalTroughIPHSingleOwner.json @@ -311,7 +311,7 @@ "ur_en_ts_buy_rate": 0, "ur_en_ts_sell_rate": 0, "ur_enable_billing_demand": 0, - "ur_metering_option": 0, + "ur_metering_option": 4, "ur_monthly_fixed_charge": 0, "ur_monthly_min_charge": 0, "ur_nb_apply_credit_current_month": 0, diff --git a/api/api_autogen/library/defaults/TroughPhysicalIph_PhysicalTroughIPHSingleOwner.json b/api/api_autogen/library/defaults/TroughPhysicalIph_PhysicalTroughIPHSingleOwner.json index 223749ea8..51fb058bd 100644 --- a/api/api_autogen/library/defaults/TroughPhysicalIph_PhysicalTroughIPHSingleOwner.json +++ b/api/api_autogen/library/defaults/TroughPhysicalIph_PhysicalTroughIPHSingleOwner.json @@ -586,7 +586,7 @@ "ur_en_ts_buy_rate": 0, "ur_en_ts_sell_rate": 0, "ur_enable_billing_demand": 0, - "ur_metering_option": 0, + "ur_metering_option": 4, "ur_monthly_fixed_charge": 0, "ur_monthly_min_charge": 0, "ur_nb_apply_credit_current_month": 0, diff --git a/api/api_autogen/library/defaults/Utilityrate5_MSLFIPHCommercial.json b/api/api_autogen/library/defaults/Utilityrate5_MSLFIPHCommercial.json index be0f8d0ab..7cccce866 100644 --- a/api/api_autogen/library/defaults/Utilityrate5_MSLFIPHCommercial.json +++ b/api/api_autogen/library/defaults/Utilityrate5_MSLFIPHCommercial.json @@ -102,7 +102,7 @@ "ur_en_ts_buy_rate": 0, "ur_en_ts_sell_rate": 0, "ur_enable_billing_demand": 0, - "ur_metering_option": 0, + "ur_metering_option": 4, "ur_monthly_fixed_charge": 0, "ur_monthly_min_charge": 0, "ur_nb_apply_credit_current_month": 0, diff --git a/api/api_autogen/library/defaults/Utilityrate5_MSLFIPHSingleOwner.json b/api/api_autogen/library/defaults/Utilityrate5_MSLFIPHSingleOwner.json index e11e57fc7..2b0ae0f14 100644 --- a/api/api_autogen/library/defaults/Utilityrate5_MSLFIPHSingleOwner.json +++ b/api/api_autogen/library/defaults/Utilityrate5_MSLFIPHSingleOwner.json @@ -97,7 +97,7 @@ "ur_en_ts_buy_rate": 0, "ur_en_ts_sell_rate": 0, "ur_enable_billing_demand": 0, - "ur_metering_option": 0, + "ur_metering_option": 4, "ur_monthly_fixed_charge": 0, "ur_monthly_min_charge": 0, "ur_nb_apply_credit_current_month": 0, diff --git a/api/api_autogen/library/defaults/Utilityrate5_PVWattsWindBatteryHybridHostDeveloper.json b/api/api_autogen/library/defaults/Utilityrate5_PVWattsWindBatteryHybridHostDeveloper.json index 72f8ec16e..628183b48 100644 --- a/api/api_autogen/library/defaults/Utilityrate5_PVWattsWindBatteryHybridHostDeveloper.json +++ b/api/api_autogen/library/defaults/Utilityrate5_PVWattsWindBatteryHybridHostDeveloper.json @@ -16,7 +16,7 @@ "ur_dc_billing_demand_periods": [ [0.000000] ], - "ur_dc_enable": 0, + "ur_dc_enable": 1, "ur_dc_flat_mat": [ [0.000000, 1.000000, 99999999999999997748809823456034029568.000000, 0.000000], [1.000000, 1.000000, 99999999999999997748809823456034029568.000000, 0.000000], @@ -32,36 +32,38 @@ [11.000000, 1.000000, 99999999999999997748809823456034029568.000000, 0.000000] ], "ur_dc_sched_weekday": [ - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000] + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000] ], "ur_dc_sched_weekend": [ - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000] + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000] ], "ur_dc_tou_mat": [ - [1.000000, 1.000000, 99999999999999997748809823456034029568.000000, 0.000000], - [2.000000, 1.000000, 99999999999999997748809823456034029568.000000, 0.000000] + [1.000000, 1.000000, 100.000000, 20.000000], + [1.000000, 2.000000, 99999999999999997748809823456034029568.000000, 15.000000], + [2.000000, 1.000000, 100.000000, 10.000000], + [2.000000, 2.000000, 99999999999999997748809823456034029568.000000, 5.000000] ], "ur_ec_sched_weekday": [ [4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 3.000000, 3.000000, 3.000000, 3.000000, 3.000000, 4.000000, 4.000000, 4.000000, 4.000000], diff --git a/api/api_autogen/library/defaults/Utilityrate5_PVWattsWindFuelCellBatteryHybridHostDeveloper.json b/api/api_autogen/library/defaults/Utilityrate5_PVWattsWindFuelCellBatteryHybridHostDeveloper.json index 2c2ca6e55..4372fabeb 100644 --- a/api/api_autogen/library/defaults/Utilityrate5_PVWattsWindFuelCellBatteryHybridHostDeveloper.json +++ b/api/api_autogen/library/defaults/Utilityrate5_PVWattsWindFuelCellBatteryHybridHostDeveloper.json @@ -46,18 +46,18 @@ [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000] ], "ur_dc_sched_weekend": [ - [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], - [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], - [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], - [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], - [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], - [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], - [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], - [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], - [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], - [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], - [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], - [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000] + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000] ], "ur_dc_tou_mat": [ [1.000000, 1.000000, 100.000000, 20.000000], diff --git a/api/api_autogen/library/defaults/Utilityrate5_PhotovoltaicWindBatteryHybridHostDeveloper.json b/api/api_autogen/library/defaults/Utilityrate5_PhotovoltaicWindBatteryHybridHostDeveloper.json index d191bc817..70dc5e427 100644 --- a/api/api_autogen/library/defaults/Utilityrate5_PhotovoltaicWindBatteryHybridHostDeveloper.json +++ b/api/api_autogen/library/defaults/Utilityrate5_PhotovoltaicWindBatteryHybridHostDeveloper.json @@ -16,7 +16,7 @@ "ur_dc_billing_demand_periods": [ [0.000000] ], - "ur_dc_enable": 0, + "ur_dc_enable": 1, "ur_dc_flat_mat": [ [0.000000, 1.000000, 99999999999999997748809823456034029568.000000, 0.000000], [1.000000, 1.000000, 99999999999999997748809823456034029568.000000, 0.000000], @@ -32,36 +32,38 @@ [11.000000, 1.000000, 99999999999999997748809823456034029568.000000, 0.000000] ], "ur_dc_sched_weekday": [ - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000] + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 2.000000, 2.000000, 2.000000, 2.000000] ], "ur_dc_sched_weekend": [ - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000], - [1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000] + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000], + [2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000, 2.000000] ], "ur_dc_tou_mat": [ - [1.000000, 1.000000, 99999999999999997748809823456034029568.000000, 0.000000], - [2.000000, 1.000000, 99999999999999997748809823456034029568.000000, 0.000000] + [1.000000, 1.000000, 100.000000, 20.000000], + [1.000000, 2.000000, 99999999999999997748809823456034029568.000000, 15.000000], + [2.000000, 1.000000, 100.000000, 10.000000], + [2.000000, 2.000000, 99999999999999997748809823456034029568.000000, 5.000000] ], "ur_ec_sched_weekday": [ [4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 3.000000, 3.000000, 3.000000, 3.000000, 3.000000, 4.000000, 4.000000, 4.000000, 4.000000], diff --git a/api/api_autogen/library/defaults/Utilityrate5_PhysicalTroughIPHSingleOwner.json b/api/api_autogen/library/defaults/Utilityrate5_PhysicalTroughIPHSingleOwner.json index e11e57fc7..2b0ae0f14 100644 --- a/api/api_autogen/library/defaults/Utilityrate5_PhysicalTroughIPHSingleOwner.json +++ b/api/api_autogen/library/defaults/Utilityrate5_PhysicalTroughIPHSingleOwner.json @@ -97,7 +97,7 @@ "ur_en_ts_buy_rate": 0, "ur_en_ts_sell_rate": 0, "ur_enable_billing_demand": 0, - "ur_metering_option": 0, + "ur_metering_option": 4, "ur_monthly_fixed_charge": 0, "ur_monthly_min_charge": 0, "ur_nb_apply_credit_current_month": 0, diff --git a/api/include/SAM_FresnelPhysical.h b/api/include/SAM_FresnelPhysical.h index 8db5b012b..138c210bb 100644 --- a/api/include/SAM_FresnelPhysical.h +++ b/api/include/SAM_FresnelPhysical.h @@ -254,6 +254,22 @@ extern "C" */ SAM_EXPORT void SAM_FresnelPhysical_SolarField_eta_pump_nset(SAM_table ptr, double number, SAM_error *err); + /** + * Set f_htfmax: Maximum loop mass flow rate fraction of design + * options: None + * constraints: None + * required if: use_abs_or_rel_mdot_limit=1 + */ + SAM_EXPORT void SAM_FresnelPhysical_SolarField_f_htfmax_nset(SAM_table ptr, double number, SAM_error *err); + + /** + * Set f_htfmin: Minimum loop mass flow rate fraction of design + * options: None + * constraints: None + * required if: use_abs_or_rel_mdot_limit=1 + */ + SAM_EXPORT void SAM_FresnelPhysical_SolarField_f_htfmin_nset(SAM_table ptr, double number, SAM_error *err); + /** * Set field_fl_props: Fluid property data * options: None @@ -270,6 +286,22 @@ extern "C" */ SAM_EXPORT void SAM_FresnelPhysical_SolarField_land_mult_nset(SAM_table ptr, double number, SAM_error *err); + /** + * Set m_dot_htfmax: Maximum loop HTF flow rate [kg/s] + * options: None + * constraints: None + * required if: use_abs_or_rel_mdot_limit=0 + */ + SAM_EXPORT void SAM_FresnelPhysical_SolarField_m_dot_htfmax_nset(SAM_table ptr, double number, SAM_error *err); + + /** + * Set m_dot_htfmin: Minimum loop HTF flow rate [kg/s] + * options: None + * constraints: None + * required if: use_abs_or_rel_mdot_limit=0 + */ + SAM_EXPORT void SAM_FresnelPhysical_SolarField_m_dot_htfmin_nset(SAM_table ptr, double number, SAM_error *err); + /** * Set mc_bal_cold: The heat capacity of the balance of plant on the cold side [kWht/K-MWt] * options: None @@ -335,65 +367,28 @@ extern "C" SAM_EXPORT void SAM_FresnelPhysical_SolarField_theta_stow_nset(SAM_table ptr, double number, SAM_error *err); /** - * Set washes_per_year: Mirror washing frequency [none] + * Set use_abs_or_rel_mdot_limit: Use mass flow abs (0) or relative (1) limits * options: None * constraints: None - * required if: * + * required if: ?=0 */ - SAM_EXPORT void SAM_FresnelPhysical_SolarField_washes_per_year_nset(SAM_table ptr, double number, SAM_error *err); + SAM_EXPORT void SAM_FresnelPhysical_SolarField_use_abs_or_rel_mdot_limit_nset(SAM_table ptr, double number, SAM_error *err); /** - * Set water_per_wash: Water usage per wash [L/m2_aper] + * Set washes_per_year: Mirror washing frequency [none] * options: None * constraints: None * required if: * */ - SAM_EXPORT void SAM_FresnelPhysical_SolarField_water_per_wash_nset(SAM_table ptr, double number, SAM_error *err); - - - // - // SolarField parameters - // - - /** - * Set f_htfmax: Maximum loop mass flow rate fraction of design - * options: None - * constraints: None - * required if: use_abs_or_rel_mdot_limit=1 - */ - SAM_EXPORT void SAM_FresnelPhysical_SolarField_f_htfmax_nset(SAM_table ptr, double number, SAM_error *err); - - /** - * Set f_htfmin: Minimum loop mass flow rate fraction of design - * options: None - * constraints: None - * required if: use_abs_or_rel_mdot_limit=1 - */ - SAM_EXPORT void SAM_FresnelPhysical_SolarField_f_htfmin_nset(SAM_table ptr, double number, SAM_error *err); - - /** - * Set m_dot_htfmax: Maximum loop HTF flow rate [kg/s] - * options: None - * constraints: None - * required if: use_abs_or_rel_mdot_limit=0 - */ - SAM_EXPORT void SAM_FresnelPhysical_SolarField_m_dot_htfmax_nset(SAM_table ptr, double number, SAM_error *err); - - /** - * Set m_dot_htfmin: Minimum loop HTF flow rate [kg/s] - * options: None - * constraints: None - * required if: use_abs_or_rel_mdot_limit=0 - */ - SAM_EXPORT void SAM_FresnelPhysical_SolarField_m_dot_htfmin_nset(SAM_table ptr, double number, SAM_error *err); + SAM_EXPORT void SAM_FresnelPhysical_SolarField_washes_per_year_nset(SAM_table ptr, double number, SAM_error *err); /** - * Set use_abs_or_rel_mdot_limit: Use mass flow abs (0) or relative (1) limits + * Set water_per_wash: Water usage per wash [L/m2_aper] * options: None * constraints: None - * required if: ?=0 + * required if: * */ - SAM_EXPORT void SAM_FresnelPhysical_SolarField_use_abs_or_rel_mdot_limit_nset(SAM_table ptr, double number, SAM_error *err); + SAM_EXPORT void SAM_FresnelPhysical_SolarField_water_per_wash_nset(SAM_table ptr, double number, SAM_error *err); // @@ -1849,10 +1844,18 @@ extern "C" SAM_EXPORT double SAM_FresnelPhysical_SolarField_eta_pump_nget(SAM_table ptr, SAM_error *err); + SAM_EXPORT double SAM_FresnelPhysical_SolarField_f_htfmax_nget(SAM_table ptr, SAM_error *err); + + SAM_EXPORT double SAM_FresnelPhysical_SolarField_f_htfmin_nget(SAM_table ptr, SAM_error *err); + SAM_EXPORT double* SAM_FresnelPhysical_SolarField_field_fl_props_mget(SAM_table ptr, int* nrows, int* ncols, SAM_error *err); SAM_EXPORT double SAM_FresnelPhysical_SolarField_land_mult_nget(SAM_table ptr, SAM_error *err); + SAM_EXPORT double SAM_FresnelPhysical_SolarField_m_dot_htfmax_nget(SAM_table ptr, SAM_error *err); + + SAM_EXPORT double SAM_FresnelPhysical_SolarField_m_dot_htfmin_nget(SAM_table ptr, SAM_error *err); + SAM_EXPORT double SAM_FresnelPhysical_SolarField_mc_bal_cold_nget(SAM_table ptr, SAM_error *err); SAM_EXPORT double SAM_FresnelPhysical_SolarField_mc_bal_hot_nget(SAM_table ptr, SAM_error *err); @@ -1869,26 +1872,13 @@ extern "C" SAM_EXPORT double SAM_FresnelPhysical_SolarField_theta_stow_nget(SAM_table ptr, SAM_error *err); + SAM_EXPORT double SAM_FresnelPhysical_SolarField_use_abs_or_rel_mdot_limit_nget(SAM_table ptr, SAM_error *err); + SAM_EXPORT double SAM_FresnelPhysical_SolarField_washes_per_year_nget(SAM_table ptr, SAM_error *err); SAM_EXPORT double SAM_FresnelPhysical_SolarField_water_per_wash_nget(SAM_table ptr, SAM_error *err); - /** - * SolarField Getters - */ - - SAM_EXPORT double SAM_FresnelPhysical_SolarField_f_htfmax_nget(SAM_table ptr, SAM_error *err); - - SAM_EXPORT double SAM_FresnelPhysical_SolarField_f_htfmin_nget(SAM_table ptr, SAM_error *err); - - SAM_EXPORT double SAM_FresnelPhysical_SolarField_m_dot_htfmax_nget(SAM_table ptr, SAM_error *err); - - SAM_EXPORT double SAM_FresnelPhysical_SolarField_m_dot_htfmin_nget(SAM_table ptr, SAM_error *err); - - SAM_EXPORT double SAM_FresnelPhysical_SolarField_use_abs_or_rel_mdot_limit_nget(SAM_table ptr, SAM_error *err); - - /** * ColRec Getters */ diff --git a/api/include/SAM_FresnelPhysicalIph.h b/api/include/SAM_FresnelPhysicalIph.h index 33010d0d5..79fedca14 100644 --- a/api/include/SAM_FresnelPhysicalIph.h +++ b/api/include/SAM_FresnelPhysicalIph.h @@ -238,6 +238,22 @@ extern "C" */ SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_eta_pump_nset(SAM_table ptr, double number, SAM_error *err); + /** + * Set f_htfmax: Maximum loop mass flow rate fraction of design + * options: None + * constraints: None + * required if: use_abs_or_rel_mdot_limit=1 + */ + SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_f_htfmax_nset(SAM_table ptr, double number, SAM_error *err); + + /** + * Set f_htfmin: Minimum loop mass flow rate fraction of design + * options: None + * constraints: None + * required if: use_abs_or_rel_mdot_limit=1 + */ + SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_f_htfmin_nset(SAM_table ptr, double number, SAM_error *err); + /** * Set field_fl_props: Fluid property data * options: None @@ -254,6 +270,22 @@ extern "C" */ SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_land_mult_nset(SAM_table ptr, double number, SAM_error *err); + /** + * Set m_dot_htfmax: Maximum loop HTF flow rate [kg/s] + * options: None + * constraints: None + * required if: use_abs_or_rel_mdot_limit=0 + */ + SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_m_dot_htfmax_nset(SAM_table ptr, double number, SAM_error *err); + + /** + * Set m_dot_htfmin: Minimum loop HTF flow rate [kg/s] + * options: None + * constraints: None + * required if: use_abs_or_rel_mdot_limit=0 + */ + SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_m_dot_htfmin_nset(SAM_table ptr, double number, SAM_error *err); + /** * Set mc_bal_cold: The heat capacity of the balance of plant on the cold side [kWht/K-MWt] * options: None @@ -335,65 +367,28 @@ extern "C" SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_theta_stow_nset(SAM_table ptr, double number, SAM_error *err); /** - * Set washes_per_year: Mirror washing frequency [none] + * Set use_abs_or_rel_mdot_limit: Use mass flow abs (0) or relative (1) limits * options: None * constraints: None - * required if: * + * required if: ?=0 */ - SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_washes_per_year_nset(SAM_table ptr, double number, SAM_error *err); + SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_use_abs_or_rel_mdot_limit_nset(SAM_table ptr, double number, SAM_error *err); /** - * Set water_per_wash: Water usage per wash [L/m2_aper] + * Set washes_per_year: Mirror washing frequency [none] * options: None * constraints: None * required if: * */ - SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_water_per_wash_nset(SAM_table ptr, double number, SAM_error *err); - - - // - // SolarField parameters - // - - /** - * Set f_htfmax: Maximum loop mass flow rate fraction of design - * options: None - * constraints: None - * required if: use_abs_or_rel_mdot_limit=1 - */ - SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_f_htfmax_nset(SAM_table ptr, double number, SAM_error *err); - - /** - * Set f_htfmin: Minimum loop mass flow rate fraction of design - * options: None - * constraints: None - * required if: use_abs_or_rel_mdot_limit=1 - */ - SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_f_htfmin_nset(SAM_table ptr, double number, SAM_error *err); - - /** - * Set m_dot_htfmax: Maximum loop HTF flow rate [kg/s] - * options: None - * constraints: None - * required if: use_abs_or_rel_mdot_limit=0 - */ - SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_m_dot_htfmax_nset(SAM_table ptr, double number, SAM_error *err); - - /** - * Set m_dot_htfmin: Minimum loop HTF flow rate [kg/s] - * options: None - * constraints: None - * required if: use_abs_or_rel_mdot_limit=0 - */ - SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_m_dot_htfmin_nset(SAM_table ptr, double number, SAM_error *err); + SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_washes_per_year_nset(SAM_table ptr, double number, SAM_error *err); /** - * Set use_abs_or_rel_mdot_limit: Use mass flow abs (0) or relative (1) limits + * Set water_per_wash: Water usage per wash [L/m2_aper] * options: None * constraints: None - * required if: ?=0 + * required if: * */ - SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_use_abs_or_rel_mdot_limit_nset(SAM_table ptr, double number, SAM_error *err); + SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_water_per_wash_nset(SAM_table ptr, double number, SAM_error *err); // @@ -1933,10 +1928,18 @@ extern "C" SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_eta_pump_nget(SAM_table ptr, SAM_error *err); + SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_f_htfmax_nget(SAM_table ptr, SAM_error *err); + + SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_f_htfmin_nget(SAM_table ptr, SAM_error *err); + SAM_EXPORT double* SAM_FresnelPhysicalIph_SolarField_field_fl_props_mget(SAM_table ptr, int* nrows, int* ncols, SAM_error *err); SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_land_mult_nget(SAM_table ptr, SAM_error *err); + SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_m_dot_htfmax_nget(SAM_table ptr, SAM_error *err); + + SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_m_dot_htfmin_nget(SAM_table ptr, SAM_error *err); + SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_mc_bal_cold_nget(SAM_table ptr, SAM_error *err); SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_mc_bal_hot_nget(SAM_table ptr, SAM_error *err); @@ -1957,26 +1960,13 @@ extern "C" SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_theta_stow_nget(SAM_table ptr, SAM_error *err); + SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_use_abs_or_rel_mdot_limit_nget(SAM_table ptr, SAM_error *err); + SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_washes_per_year_nget(SAM_table ptr, SAM_error *err); SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_water_per_wash_nget(SAM_table ptr, SAM_error *err); - /** - * SolarField Getters - */ - - SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_f_htfmax_nget(SAM_table ptr, SAM_error *err); - - SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_f_htfmin_nget(SAM_table ptr, SAM_error *err); - - SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_m_dot_htfmax_nget(SAM_table ptr, SAM_error *err); - - SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_m_dot_htfmin_nget(SAM_table ptr, SAM_error *err); - - SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_use_abs_or_rel_mdot_limit_nget(SAM_table ptr, SAM_error *err); - - /** * ColRec Getters */ diff --git a/api/include/SAM_Pvsamv1.h b/api/include/SAM_Pvsamv1.h index 15aae3dd1..14fe70223 100644 --- a/api/include/SAM_Pvsamv1.h +++ b/api/include/SAM_Pvsamv1.h @@ -8217,6 +8217,8 @@ extern "C" SAM_EXPORT double* SAM_Pvsamv1_Outputs_survival_function_aget(SAM_table ptr, int* length, SAM_error *err); + SAM_EXPORT double SAM_Pvsamv1_Outputs_system_capacity_ac_nget(SAM_table ptr, SAM_error *err); + SAM_EXPORT double* SAM_Pvsamv1_Outputs_system_to_batt_aget(SAM_table ptr, int* length, SAM_error *err); SAM_EXPORT double* SAM_Pvsamv1_Outputs_system_to_batt_dc_aget(SAM_table ptr, int* length, SAM_error *err); diff --git a/api/include/SAM_Pvwattsv8.h b/api/include/SAM_Pvwattsv8.h index 70c4a74e4..6f81ffa32 100644 --- a/api/include/SAM_Pvwattsv8.h +++ b/api/include/SAM_Pvwattsv8.h @@ -741,6 +741,8 @@ extern "C" SAM_EXPORT double* SAM_Pvwattsv8_Outputs_sunup_aget(SAM_table ptr, int* length, SAM_error *err); + SAM_EXPORT double SAM_Pvwattsv8_Outputs_system_capacity_ac_nget(SAM_table ptr, SAM_error *err); + SAM_EXPORT double* SAM_Pvwattsv8_Outputs_tamb_aget(SAM_table ptr, int* length, SAM_error *err); SAM_EXPORT double* SAM_Pvwattsv8_Outputs_tcell_aget(SAM_table ptr, int* length, SAM_error *err); diff --git a/api/modules/SAM_FresnelPhysical.cpp b/api/modules/SAM_FresnelPhysical.cpp index c6d52fe89..c06e4e326 100644 --- a/api/modules/SAM_FresnelPhysical.cpp +++ b/api/modules/SAM_FresnelPhysical.cpp @@ -170,6 +170,18 @@ SAM_EXPORT void SAM_FresnelPhysical_SolarField_eta_pump_nset(SAM_table ptr, doub }); } +SAM_EXPORT void SAM_FresnelPhysical_SolarField_f_htfmax_nset(SAM_table ptr, double number, SAM_error *err){ + translateExceptions(err, [&]{ + ssc_data_set_number(ptr, "f_htfmax", number); + }); +} + +SAM_EXPORT void SAM_FresnelPhysical_SolarField_f_htfmin_nset(SAM_table ptr, double number, SAM_error *err){ + translateExceptions(err, [&]{ + ssc_data_set_number(ptr, "f_htfmin", number); + }); +} + SAM_EXPORT void SAM_FresnelPhysical_SolarField_field_fl_props_mset(SAM_table ptr, double* mat, int nrows, int ncols, SAM_error *err){ translateExceptions(err, [&]{ ssc_data_set_matrix(ptr, "field_fl_props", mat, nrows, ncols); @@ -182,6 +194,18 @@ SAM_EXPORT void SAM_FresnelPhysical_SolarField_land_mult_nset(SAM_table ptr, dou }); } +SAM_EXPORT void SAM_FresnelPhysical_SolarField_m_dot_htfmax_nset(SAM_table ptr, double number, SAM_error *err){ + translateExceptions(err, [&]{ + ssc_data_set_number(ptr, "m_dot_htfmax", number); + }); +} + +SAM_EXPORT void SAM_FresnelPhysical_SolarField_m_dot_htfmin_nset(SAM_table ptr, double number, SAM_error *err){ + translateExceptions(err, [&]{ + ssc_data_set_number(ptr, "m_dot_htfmin", number); + }); +} + SAM_EXPORT void SAM_FresnelPhysical_SolarField_mc_bal_cold_nset(SAM_table ptr, double number, SAM_error *err){ translateExceptions(err, [&]{ ssc_data_set_number(ptr, "mc_bal_cold", number); @@ -230,45 +254,21 @@ SAM_EXPORT void SAM_FresnelPhysical_SolarField_theta_stow_nset(SAM_table ptr, do }); } -SAM_EXPORT void SAM_FresnelPhysical_SolarField_washes_per_year_nset(SAM_table ptr, double number, SAM_error *err){ - translateExceptions(err, [&]{ - ssc_data_set_number(ptr, "washes_per_year", number); - }); -} - -SAM_EXPORT void SAM_FresnelPhysical_SolarField_water_per_wash_nset(SAM_table ptr, double number, SAM_error *err){ - translateExceptions(err, [&]{ - ssc_data_set_number(ptr, "water_per_wash", number); - }); -} - -SAM_EXPORT void SAM_FresnelPhysical_SolarField_f_htfmax_nset(SAM_table ptr, double number, SAM_error *err){ - translateExceptions(err, [&]{ - ssc_data_set_number(ptr, "f_htfmax", number); - }); -} - -SAM_EXPORT void SAM_FresnelPhysical_SolarField_f_htfmin_nset(SAM_table ptr, double number, SAM_error *err){ - translateExceptions(err, [&]{ - ssc_data_set_number(ptr, "f_htfmin", number); - }); -} - -SAM_EXPORT void SAM_FresnelPhysical_SolarField_m_dot_htfmax_nset(SAM_table ptr, double number, SAM_error *err){ +SAM_EXPORT void SAM_FresnelPhysical_SolarField_use_abs_or_rel_mdot_limit_nset(SAM_table ptr, double number, SAM_error *err){ translateExceptions(err, [&]{ - ssc_data_set_number(ptr, "m_dot_htfmax", number); + ssc_data_set_number(ptr, "use_abs_or_rel_mdot_limit", number); }); } -SAM_EXPORT void SAM_FresnelPhysical_SolarField_m_dot_htfmin_nset(SAM_table ptr, double number, SAM_error *err){ +SAM_EXPORT void SAM_FresnelPhysical_SolarField_washes_per_year_nset(SAM_table ptr, double number, SAM_error *err){ translateExceptions(err, [&]{ - ssc_data_set_number(ptr, "m_dot_htfmin", number); + ssc_data_set_number(ptr, "washes_per_year", number); }); } -SAM_EXPORT void SAM_FresnelPhysical_SolarField_use_abs_or_rel_mdot_limit_nset(SAM_table ptr, double number, SAM_error *err){ +SAM_EXPORT void SAM_FresnelPhysical_SolarField_water_per_wash_nset(SAM_table ptr, double number, SAM_error *err){ translateExceptions(err, [&]{ - ssc_data_set_number(ptr, "use_abs_or_rel_mdot_limit", number); + ssc_data_set_number(ptr, "water_per_wash", number); }); } @@ -1491,6 +1491,24 @@ SAM_EXPORT double SAM_FresnelPhysical_SolarField_eta_pump_nget(SAM_table ptr, SA return result; } +SAM_EXPORT double SAM_FresnelPhysical_SolarField_f_htfmax_nget(SAM_table ptr, SAM_error *err){ + double result; + translateExceptions(err, [&]{ + if (!ssc_data_get_number(ptr, "f_htfmax", &result)) + make_access_error("SAM_FresnelPhysical", "f_htfmax"); + }); + return result; +} + +SAM_EXPORT double SAM_FresnelPhysical_SolarField_f_htfmin_nget(SAM_table ptr, SAM_error *err){ + double result; + translateExceptions(err, [&]{ + if (!ssc_data_get_number(ptr, "f_htfmin", &result)) + make_access_error("SAM_FresnelPhysical", "f_htfmin"); + }); + return result; +} + SAM_EXPORT double* SAM_FresnelPhysical_SolarField_field_fl_props_mget(SAM_table ptr, int* nrows, int* ncols, SAM_error *err){ double* result = nullptr; translateExceptions(err, [&]{ @@ -1510,6 +1528,24 @@ SAM_EXPORT double SAM_FresnelPhysical_SolarField_land_mult_nget(SAM_table ptr, S return result; } +SAM_EXPORT double SAM_FresnelPhysical_SolarField_m_dot_htfmax_nget(SAM_table ptr, SAM_error *err){ + double result; + translateExceptions(err, [&]{ + if (!ssc_data_get_number(ptr, "m_dot_htfmax", &result)) + make_access_error("SAM_FresnelPhysical", "m_dot_htfmax"); + }); + return result; +} + +SAM_EXPORT double SAM_FresnelPhysical_SolarField_m_dot_htfmin_nget(SAM_table ptr, SAM_error *err){ + double result; + translateExceptions(err, [&]{ + if (!ssc_data_get_number(ptr, "m_dot_htfmin", &result)) + make_access_error("SAM_FresnelPhysical", "m_dot_htfmin"); + }); + return result; +} + SAM_EXPORT double SAM_FresnelPhysical_SolarField_mc_bal_cold_nget(SAM_table ptr, SAM_error *err){ double result; translateExceptions(err, [&]{ @@ -1582,65 +1618,29 @@ SAM_EXPORT double SAM_FresnelPhysical_SolarField_theta_stow_nget(SAM_table ptr, return result; } -SAM_EXPORT double SAM_FresnelPhysical_SolarField_washes_per_year_nget(SAM_table ptr, SAM_error *err){ - double result; - translateExceptions(err, [&]{ - if (!ssc_data_get_number(ptr, "washes_per_year", &result)) - make_access_error("SAM_FresnelPhysical", "washes_per_year"); - }); - return result; -} - -SAM_EXPORT double SAM_FresnelPhysical_SolarField_water_per_wash_nget(SAM_table ptr, SAM_error *err){ - double result; - translateExceptions(err, [&]{ - if (!ssc_data_get_number(ptr, "water_per_wash", &result)) - make_access_error("SAM_FresnelPhysical", "water_per_wash"); - }); - return result; -} - -SAM_EXPORT double SAM_FresnelPhysical_SolarField_f_htfmax_nget(SAM_table ptr, SAM_error *err){ - double result; - translateExceptions(err, [&]{ - if (!ssc_data_get_number(ptr, "f_htfmax", &result)) - make_access_error("SAM_FresnelPhysical", "f_htfmax"); - }); - return result; -} - -SAM_EXPORT double SAM_FresnelPhysical_SolarField_f_htfmin_nget(SAM_table ptr, SAM_error *err){ - double result; - translateExceptions(err, [&]{ - if (!ssc_data_get_number(ptr, "f_htfmin", &result)) - make_access_error("SAM_FresnelPhysical", "f_htfmin"); - }); - return result; -} - -SAM_EXPORT double SAM_FresnelPhysical_SolarField_m_dot_htfmax_nget(SAM_table ptr, SAM_error *err){ +SAM_EXPORT double SAM_FresnelPhysical_SolarField_use_abs_or_rel_mdot_limit_nget(SAM_table ptr, SAM_error *err){ double result; translateExceptions(err, [&]{ - if (!ssc_data_get_number(ptr, "m_dot_htfmax", &result)) - make_access_error("SAM_FresnelPhysical", "m_dot_htfmax"); + if (!ssc_data_get_number(ptr, "use_abs_or_rel_mdot_limit", &result)) + make_access_error("SAM_FresnelPhysical", "use_abs_or_rel_mdot_limit"); }); return result; } -SAM_EXPORT double SAM_FresnelPhysical_SolarField_m_dot_htfmin_nget(SAM_table ptr, SAM_error *err){ +SAM_EXPORT double SAM_FresnelPhysical_SolarField_washes_per_year_nget(SAM_table ptr, SAM_error *err){ double result; translateExceptions(err, [&]{ - if (!ssc_data_get_number(ptr, "m_dot_htfmin", &result)) - make_access_error("SAM_FresnelPhysical", "m_dot_htfmin"); + if (!ssc_data_get_number(ptr, "washes_per_year", &result)) + make_access_error("SAM_FresnelPhysical", "washes_per_year"); }); return result; } -SAM_EXPORT double SAM_FresnelPhysical_SolarField_use_abs_or_rel_mdot_limit_nget(SAM_table ptr, SAM_error *err){ +SAM_EXPORT double SAM_FresnelPhysical_SolarField_water_per_wash_nget(SAM_table ptr, SAM_error *err){ double result; translateExceptions(err, [&]{ - if (!ssc_data_get_number(ptr, "use_abs_or_rel_mdot_limit", &result)) - make_access_error("SAM_FresnelPhysical", "use_abs_or_rel_mdot_limit"); + if (!ssc_data_get_number(ptr, "water_per_wash", &result)) + make_access_error("SAM_FresnelPhysical", "water_per_wash"); }); return result; } diff --git a/api/modules/SAM_FresnelPhysicalIph.cpp b/api/modules/SAM_FresnelPhysicalIph.cpp index 09c06ac40..02b06f85c 100644 --- a/api/modules/SAM_FresnelPhysicalIph.cpp +++ b/api/modules/SAM_FresnelPhysicalIph.cpp @@ -158,6 +158,18 @@ SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_eta_pump_nset(SAM_table ptr, d }); } +SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_f_htfmax_nset(SAM_table ptr, double number, SAM_error *err){ + translateExceptions(err, [&]{ + ssc_data_set_number(ptr, "f_htfmax", number); + }); +} + +SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_f_htfmin_nset(SAM_table ptr, double number, SAM_error *err){ + translateExceptions(err, [&]{ + ssc_data_set_number(ptr, "f_htfmin", number); + }); +} + SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_field_fl_props_mset(SAM_table ptr, double* mat, int nrows, int ncols, SAM_error *err){ translateExceptions(err, [&]{ ssc_data_set_matrix(ptr, "field_fl_props", mat, nrows, ncols); @@ -170,6 +182,18 @@ SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_land_mult_nset(SAM_table ptr, }); } +SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_m_dot_htfmax_nset(SAM_table ptr, double number, SAM_error *err){ + translateExceptions(err, [&]{ + ssc_data_set_number(ptr, "m_dot_htfmax", number); + }); +} + +SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_m_dot_htfmin_nset(SAM_table ptr, double number, SAM_error *err){ + translateExceptions(err, [&]{ + ssc_data_set_number(ptr, "m_dot_htfmin", number); + }); +} + SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_mc_bal_cold_nset(SAM_table ptr, double number, SAM_error *err){ translateExceptions(err, [&]{ ssc_data_set_number(ptr, "mc_bal_cold", number); @@ -230,45 +254,21 @@ SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_theta_stow_nset(SAM_table ptr, }); } -SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_washes_per_year_nset(SAM_table ptr, double number, SAM_error *err){ - translateExceptions(err, [&]{ - ssc_data_set_number(ptr, "washes_per_year", number); - }); -} - -SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_water_per_wash_nset(SAM_table ptr, double number, SAM_error *err){ - translateExceptions(err, [&]{ - ssc_data_set_number(ptr, "water_per_wash", number); - }); -} - -SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_f_htfmax_nset(SAM_table ptr, double number, SAM_error *err){ - translateExceptions(err, [&]{ - ssc_data_set_number(ptr, "f_htfmax", number); - }); -} - -SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_f_htfmin_nset(SAM_table ptr, double number, SAM_error *err){ - translateExceptions(err, [&]{ - ssc_data_set_number(ptr, "f_htfmin", number); - }); -} - -SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_m_dot_htfmax_nset(SAM_table ptr, double number, SAM_error *err){ +SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_use_abs_or_rel_mdot_limit_nset(SAM_table ptr, double number, SAM_error *err){ translateExceptions(err, [&]{ - ssc_data_set_number(ptr, "m_dot_htfmax", number); + ssc_data_set_number(ptr, "use_abs_or_rel_mdot_limit", number); }); } -SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_m_dot_htfmin_nset(SAM_table ptr, double number, SAM_error *err){ +SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_washes_per_year_nset(SAM_table ptr, double number, SAM_error *err){ translateExceptions(err, [&]{ - ssc_data_set_number(ptr, "m_dot_htfmin", number); + ssc_data_set_number(ptr, "washes_per_year", number); }); } -SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_use_abs_or_rel_mdot_limit_nset(SAM_table ptr, double number, SAM_error *err){ +SAM_EXPORT void SAM_FresnelPhysicalIph_SolarField_water_per_wash_nset(SAM_table ptr, double number, SAM_error *err){ translateExceptions(err, [&]{ - ssc_data_set_number(ptr, "use_abs_or_rel_mdot_limit", number); + ssc_data_set_number(ptr, "water_per_wash", number); }); } @@ -1539,6 +1539,24 @@ SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_eta_pump_nget(SAM_table ptr, return result; } +SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_f_htfmax_nget(SAM_table ptr, SAM_error *err){ + double result; + translateExceptions(err, [&]{ + if (!ssc_data_get_number(ptr, "f_htfmax", &result)) + make_access_error("SAM_FresnelPhysicalIph", "f_htfmax"); + }); + return result; +} + +SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_f_htfmin_nget(SAM_table ptr, SAM_error *err){ + double result; + translateExceptions(err, [&]{ + if (!ssc_data_get_number(ptr, "f_htfmin", &result)) + make_access_error("SAM_FresnelPhysicalIph", "f_htfmin"); + }); + return result; +} + SAM_EXPORT double* SAM_FresnelPhysicalIph_SolarField_field_fl_props_mget(SAM_table ptr, int* nrows, int* ncols, SAM_error *err){ double* result = nullptr; translateExceptions(err, [&]{ @@ -1558,6 +1576,24 @@ SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_land_mult_nget(SAM_table ptr return result; } +SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_m_dot_htfmax_nget(SAM_table ptr, SAM_error *err){ + double result; + translateExceptions(err, [&]{ + if (!ssc_data_get_number(ptr, "m_dot_htfmax", &result)) + make_access_error("SAM_FresnelPhysicalIph", "m_dot_htfmax"); + }); + return result; +} + +SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_m_dot_htfmin_nget(SAM_table ptr, SAM_error *err){ + double result; + translateExceptions(err, [&]{ + if (!ssc_data_get_number(ptr, "m_dot_htfmin", &result)) + make_access_error("SAM_FresnelPhysicalIph", "m_dot_htfmin"); + }); + return result; +} + SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_mc_bal_cold_nget(SAM_table ptr, SAM_error *err){ double result; translateExceptions(err, [&]{ @@ -1648,65 +1684,29 @@ SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_theta_stow_nget(SAM_table pt return result; } -SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_washes_per_year_nget(SAM_table ptr, SAM_error *err){ - double result; - translateExceptions(err, [&]{ - if (!ssc_data_get_number(ptr, "washes_per_year", &result)) - make_access_error("SAM_FresnelPhysicalIph", "washes_per_year"); - }); - return result; -} - -SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_water_per_wash_nget(SAM_table ptr, SAM_error *err){ - double result; - translateExceptions(err, [&]{ - if (!ssc_data_get_number(ptr, "water_per_wash", &result)) - make_access_error("SAM_FresnelPhysicalIph", "water_per_wash"); - }); - return result; -} - -SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_f_htfmax_nget(SAM_table ptr, SAM_error *err){ - double result; - translateExceptions(err, [&]{ - if (!ssc_data_get_number(ptr, "f_htfmax", &result)) - make_access_error("SAM_FresnelPhysicalIph", "f_htfmax"); - }); - return result; -} - -SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_f_htfmin_nget(SAM_table ptr, SAM_error *err){ - double result; - translateExceptions(err, [&]{ - if (!ssc_data_get_number(ptr, "f_htfmin", &result)) - make_access_error("SAM_FresnelPhysicalIph", "f_htfmin"); - }); - return result; -} - -SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_m_dot_htfmax_nget(SAM_table ptr, SAM_error *err){ +SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_use_abs_or_rel_mdot_limit_nget(SAM_table ptr, SAM_error *err){ double result; translateExceptions(err, [&]{ - if (!ssc_data_get_number(ptr, "m_dot_htfmax", &result)) - make_access_error("SAM_FresnelPhysicalIph", "m_dot_htfmax"); + if (!ssc_data_get_number(ptr, "use_abs_or_rel_mdot_limit", &result)) + make_access_error("SAM_FresnelPhysicalIph", "use_abs_or_rel_mdot_limit"); }); return result; } -SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_m_dot_htfmin_nget(SAM_table ptr, SAM_error *err){ +SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_washes_per_year_nget(SAM_table ptr, SAM_error *err){ double result; translateExceptions(err, [&]{ - if (!ssc_data_get_number(ptr, "m_dot_htfmin", &result)) - make_access_error("SAM_FresnelPhysicalIph", "m_dot_htfmin"); + if (!ssc_data_get_number(ptr, "washes_per_year", &result)) + make_access_error("SAM_FresnelPhysicalIph", "washes_per_year"); }); return result; } -SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_use_abs_or_rel_mdot_limit_nget(SAM_table ptr, SAM_error *err){ +SAM_EXPORT double SAM_FresnelPhysicalIph_SolarField_water_per_wash_nget(SAM_table ptr, SAM_error *err){ double result; translateExceptions(err, [&]{ - if (!ssc_data_get_number(ptr, "use_abs_or_rel_mdot_limit", &result)) - make_access_error("SAM_FresnelPhysicalIph", "use_abs_or_rel_mdot_limit"); + if (!ssc_data_get_number(ptr, "water_per_wash", &result)) + make_access_error("SAM_FresnelPhysicalIph", "water_per_wash"); }); return result; } diff --git a/api/modules/SAM_Pvsamv1.cpp b/api/modules/SAM_Pvsamv1.cpp index 924e3bce4..3e59d6134 100644 --- a/api/modules/SAM_Pvsamv1.cpp +++ b/api/modules/SAM_Pvsamv1.cpp @@ -14897,6 +14897,15 @@ SAM_EXPORT double* SAM_Pvsamv1_Outputs_survival_function_aget(SAM_table ptr, int return result; } +SAM_EXPORT double SAM_Pvsamv1_Outputs_system_capacity_ac_nget(SAM_table ptr, SAM_error *err){ + double result; + translateExceptions(err, [&]{ + if (!ssc_data_get_number(ptr, "system_capacity_ac", &result)) + make_access_error("SAM_Pvsamv1", "system_capacity_ac"); + }); + return result; +} + SAM_EXPORT double* SAM_Pvsamv1_Outputs_system_to_batt_aget(SAM_table ptr, int* length, SAM_error *err){ double* result = nullptr; translateExceptions(err, [&]{ diff --git a/api/modules/SAM_Pvwattsv8.cpp b/api/modules/SAM_Pvwattsv8.cpp index dee26c160..4a2f312d4 100644 --- a/api/modules/SAM_Pvwattsv8.cpp +++ b/api/modules/SAM_Pvwattsv8.cpp @@ -1342,6 +1342,15 @@ SAM_EXPORT double* SAM_Pvwattsv8_Outputs_sunup_aget(SAM_table ptr, int* length, return result; } +SAM_EXPORT double SAM_Pvwattsv8_Outputs_system_capacity_ac_nget(SAM_table ptr, SAM_error *err){ + double result; + translateExceptions(err, [&]{ + if (!ssc_data_get_number(ptr, "system_capacity_ac", &result)) + make_access_error("SAM_Pvwattsv8", "system_capacity_ac"); + }); + return result; +} + SAM_EXPORT double* SAM_Pvwattsv8_Outputs_tamb_aget(SAM_table ptr, int* length, SAM_error *err){ double* result = nullptr; translateExceptions(err, [&]{ diff --git a/src/main_add.h b/src/main_add.h index 2cb262769..9a8a36a16 100644 --- a/src/main_add.h +++ b/src/main_add.h @@ -74,7 +74,7 @@ static SamApp::ver releases[] = { //intermediate version numbers are required in this list in order for the version upgrade script (versions.lk) to work correctly //please clarify the reason for the new version in a comment. Examples: public release, variable changes, internal release, public beta release, etc. //the top version should always be the current working version - { 2024, 12, 12}, // 2024.12.12 ssc 296 release candidate for testing expires 1/31/2025 + { 2024, 12, 12}, // 2024.12.12 ssc 297 release candidate - no expiration { 2024, 11, 14}, // 2024.11.14 ssc 295 beta release for IPH configurations expires 1/31/2025 { 2024, 9, 15}, // 2024.09.15 Placeholder version number for updated NT variable names (replace with release version number) { 2024, 9, 11}, // 2024.09.11 Final Norwich beta From 73ef931271c0475ac4655c24a30ef10533accc65 Mon Sep 17 00:00:00 2001 From: Steven Janzou Date: Wed, 11 Dec 2024 02:36:32 -0700 Subject: [PATCH 02/19] Geocode debugging on Linux --- src/geotools.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/geotools.cpp b/src/geotools.cpp index 88b88c355..44092036d 100644 --- a/src/geotools.cpp +++ b/src/geotools.cpp @@ -185,6 +185,8 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo wxEasyCurl curl; wxBusyCursor curs; + wxMessageBox(url, "geocode developer URL"); + if (showprogress) { if (!curl.Get(url, "Geocoding address '" + address + "'...")) return false; @@ -196,6 +198,9 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo rapidjson::Document reader; auto str = curl.GetDataAsString(); + + wxMessageBox(str, "geocode developer URL return string"); + reader.Parse(str.c_str()); From c18ac2e4fcd6eb9438006444e29a46ae01057e26 Mon Sep 17 00:00:00 2001 From: Steven Janzou Date: Wed, 11 Dec 2024 03:13:05 -0700 Subject: [PATCH 03/19] Update Geocoding URL for Linux #1968 --- src/geotools.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/geotools.cpp b/src/geotools.cpp index 44092036d..0eba5dacb 100644 --- a/src/geotools.cpp +++ b/src/geotools.cpp @@ -187,6 +187,10 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo wxBusyCursor curs; wxMessageBox(url, "geocode developer URL"); + // SAM issue 1968 + url.Replace("&", "\\&"); + wxMessageBox(url, "updated geocode developer URL"); + if (showprogress) { if (!curl.Get(url, "Geocoding address '" + address + "'...")) return false; From 76225356966138c5a6013d230145801b1cbf73d5 Mon Sep 17 00:00:00 2001 From: Steven Janzou Date: Wed, 11 Dec 2024 03:42:40 -0700 Subject: [PATCH 04/19] Add http headers for Linux #1968 --- src/geotools.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/geotools.cpp b/src/geotools.cpp index 0eba5dacb..7671cc7ca 100644 --- a/src/geotools.cpp +++ b/src/geotools.cpp @@ -187,9 +187,14 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo wxBusyCursor curs; wxMessageBox(url, "geocode developer URL"); - // SAM issue 1968 + // SAM issue 1968 + /* works from command line and fails in curl.get with invalid key url.Replace("&", "\\&"); wxMessageBox(url, "updated geocode developer URL"); + */ + curl.AddHttpHeader("Content-Type: application/json"); + curl.AddHttpHeader("Accept: application/json"); + if (showprogress) { if (!curl.Get(url, "Geocoding address '" + address + "'...")) From 13dac1e1cb3df350d72ee0ac0451c0c54ee88af6 Mon Sep 17 00:00:00 2001 From: Steven Janzou Date: Wed, 11 Dec 2024 04:02:30 -0700 Subject: [PATCH 05/19] timezone geocoding update for Linux #1968 --- src/geotools.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/geotools.cpp b/src/geotools.cpp index 7671cc7ca..2054c0ea4 100644 --- a/src/geotools.cpp +++ b/src/geotools.cpp @@ -269,6 +269,11 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo { success = false; + curl = wxEasyCurl(); + curl.AddHttpHeader("Content-Type: application/json"); + curl.AddHttpHeader("Accept: application/json"); + + url = SamApp::WebApi("bing_maps_timezone_api"); url.Replace("", wxString::Format("%.14lf,%.14lf", *lat, *lon)); url.Replace("", wxString(bing_api_key)); From 3ce73bcf110bf2ede1b376f33fdddc20b85951a5 Mon Sep 17 00:00:00 2001 From: Steven Janzou Date: Wed, 11 Dec 2024 04:18:41 -0700 Subject: [PATCH 06/19] Additional bing tz debugging messages for Linux #1968 --- src/geotools.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/geotools.cpp b/src/geotools.cpp index 2054c0ea4..0a173a485 100644 --- a/src/geotools.cpp +++ b/src/geotools.cpp @@ -278,6 +278,9 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo url.Replace("", wxString::Format("%.14lf,%.14lf", *lat, *lon)); url.Replace("", wxString(bing_api_key)); + + wxMessageBox(url, "geocode developer bing tz URL"); + if (showprogress) { if (!curl.Get(url, "Geocoding address '" + address + "'...")) @@ -289,6 +292,9 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo } str = curl.GetDataAsString(); + + wxMessageBox(str, "geocode developer bing tz URL return string"); + reader.Parse(str.c_str()); if (!reader.HasParseError()) { From 36ae74a5928b52b3ff3b5dff6726acced4039b9b Mon Sep 17 00:00:00 2001 From: Steven Janzou Date: Fri, 24 Jan 2025 03:48:16 -0700 Subject: [PATCH 07/19] move http headers for #1968 --- src/geotools.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/geotools.cpp b/src/geotools.cpp index 0a173a485..6a49e33fa 100644 --- a/src/geotools.cpp +++ b/src/geotools.cpp @@ -270,14 +270,18 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo success = false; curl = wxEasyCurl(); - curl.AddHttpHeader("Content-Type: application/json"); - curl.AddHttpHeader("Accept: application/json"); +// curl.AddHttpHeader("Content-Type: application/json"); +// curl.AddHttpHeader("Accept: application/json"); + url = SamApp::WebApi("bing_maps_timezone_api"); url.Replace("", wxString::Format("%.14lf,%.14lf", *lat, *lon)); url.Replace("", wxString(bing_api_key)); + curl.AddHttpHeader("Content-Type: application/json"); + curl.AddHttpHeader("Accept: application/json"); + wxMessageBox(url, "geocode developer bing tz URL"); From 9d4809cde814325ccfbe6eecf3c88ab7b28b280e Mon Sep 17 00:00:00 2001 From: Steven Janzou Date: Mon, 27 Jan 2025 01:09:05 -0700 Subject: [PATCH 08/19] api and geocode return message for #1968 --- ...hloanHeat_PhysicalTroughIPHCommercial.json | 2 +- ...esign_PhysicalTroughIPHLCOHCalculator.json | 2 +- ...wnerHeat_PhysicalTroughIPHSingleOwner.json | 4 +-- ...alrateIph_PhysicalTroughIPHCommercial.json | 2 +- ...ysicalIph_PhysicalTroughIPHCommercial.json | 24 ++++++++--------- ...alIph_PhysicalTroughIPHLCOHCalculator.json | 24 ++++++++--------- ...oughPhysicalIph_PhysicalTroughIPHNone.json | 24 ++++++++--------- ...sicalIph_PhysicalTroughIPHSingleOwner.json | 26 +++++++++---------- src/geotools.cpp | 4 ++- 9 files changed, 57 insertions(+), 55 deletions(-) diff --git a/api/api_autogen/library/defaults/CashloanHeat_PhysicalTroughIPHCommercial.json b/api/api_autogen/library/defaults/CashloanHeat_PhysicalTroughIPHCommercial.json index 47ba559f2..476f9a55a 100644 --- a/api/api_autogen/library/defaults/CashloanHeat_PhysicalTroughIPHCommercial.json +++ b/api/api_autogen/library/defaults/CashloanHeat_PhysicalTroughIPHCommercial.json @@ -23,7 +23,7 @@ "om_fixed_escal": 0, "om_production_escal": 0, "om_production_heat": [2.000000], - "total_installed_cost": 1.33794e+07 + "total_installed_cost": 1.36747e+07 }, "LandLease": { }, diff --git a/api/api_autogen/library/defaults/LcoefcrDesign_PhysicalTroughIPHLCOHCalculator.json b/api/api_autogen/library/defaults/LcoefcrDesign_PhysicalTroughIPHLCOHCalculator.json index 9b613a5eb..5e2125ed4 100644 --- a/api/api_autogen/library/defaults/LcoefcrDesign_PhysicalTroughIPHLCOHCalculator.json +++ b/api/api_autogen/library/defaults/LcoefcrDesign_PhysicalTroughIPHLCOHCalculator.json @@ -18,7 +18,7 @@ "variable_operating_cost": 0.002 }, "SystemCosts": { - "total_installed_cost": 1.33794e+07 + "total_installed_cost": 1.36747e+07 }, "IPHLCOH": { "electricity_rate": 0.06 diff --git a/api/api_autogen/library/defaults/SingleownerHeat_PhysicalTroughIPHSingleOwner.json b/api/api_autogen/library/defaults/SingleownerHeat_PhysicalTroughIPHSingleOwner.json index dd76673bf..aff09982f 100644 --- a/api/api_autogen/library/defaults/SingleownerHeat_PhysicalTroughIPHSingleOwner.json +++ b/api/api_autogen/library/defaults/SingleownerHeat_PhysicalTroughIPHSingleOwner.json @@ -8,7 +8,7 @@ }, "FinancialParameters": { "analysis_period": 25, - "construction_financing_cost": 1.00345e+06, + "construction_financing_cost": 1.0256e+06, "cost_debt_closing": 0, "cost_debt_fee": 2.75, "cost_other_financing": 0, @@ -51,7 +51,7 @@ "om_fixed_escal": 0, "om_production_escal": 0, "om_production_heat": [2.000000], - "total_installed_cost": 1.33794e+07 + "total_installed_cost": 1.36747e+07 }, "LandLease": { }, diff --git a/api/api_autogen/library/defaults/ThermalrateIph_PhysicalTroughIPHCommercial.json b/api/api_autogen/library/defaults/ThermalrateIph_PhysicalTroughIPHCommercial.json index ead38793c..002e0687d 100644 --- a/api/api_autogen/library/defaults/ThermalrateIph_PhysicalTroughIPHCommercial.json +++ b/api/api_autogen/library/defaults/ThermalrateIph_PhysicalTroughIPHCommercial.json @@ -2,7 +2,7 @@ "defaults": { "ThermalRate": { "gen_heat": [0], - "thermal_buy_rate_flat_heat_btu": 14, + "thermal_buy_rate_flat_heat_btu": 14.5, "thermal_buy_rate_option": 0, "thermal_conversion_efficiency": 85, "thermal_monthly_buy_rate_heat_btu": [0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000], diff --git a/api/api_autogen/library/defaults/TroughPhysicalIph_PhysicalTroughIPHCommercial.json b/api/api_autogen/library/defaults/TroughPhysicalIph_PhysicalTroughIPHCommercial.json index 0fc5a2cc9..395ac52e1 100644 --- a/api/api_autogen/library/defaults/TroughPhysicalIph_PhysicalTroughIPHCommercial.json +++ b/api/api_autogen/library/defaults/TroughPhysicalIph_PhysicalTroughIPHCommercial.json @@ -140,11 +140,11 @@ [0.935000, 0.935000, 0.935000, 0.963000], [0.935000, 0.935000, 0.935000, 0.963000] ], - "T_fp": 10, - "T_loop_in_des": 90, - "T_loop_out": 300, - "T_shutdown": 159.3, - "T_startup": 159.3, + "T_fp": 150, + "T_loop_in_des": 293, + "T_loop_out": 391, + "T_shutdown": 325.34, + "T_startup": 325.34, "Tau_envelope": [ [0.964000, 0.964000, 1.000000, 0.000000], [0.964000, 0.964000, 1.000000, 0.000000], @@ -324,13 +324,13 @@ "SystemCosts": { }, "TES": { - "cold_tank_Thtr": 60, + "cold_tank_Thtr": 250, "cold_tank_max_heat": 0.5, "d_tank_in": 0, "dt_hot": 5, - "h_tank_in": 15, - "h_tank_min": 0.5, - "hot_tank_Thtr": 110, + "h_tank_in": 12, + "h_tank_min": 1, + "hot_tank_Thtr": 365, "hot_tank_max_heat": 1, "init_hot_htf_percent": 30, "is_h_tank_fixed": 1, @@ -345,7 +345,7 @@ "tes_cyl_tank_insul_percent": 0, "tes_cyl_tank_thick": 0.0254, "tes_n_tsteps": 100, - "tes_pb_T_charge_min": 290, + "tes_pb_T_charge_min": 381, "tes_pb_T_cold_delta": 30, "tes_pb_T_hot_delta": 30, "tes_pb_cp_solid": 0.83, @@ -356,7 +356,7 @@ "tes_pb_void_frac": 0.22, "tes_type": 1, "tshours": 6, - "u_tank": 0.3 + "u_tank": 0.4 }, "Controller": { "T_tank_hot_inlet_min": 400, @@ -431,7 +431,7 @@ "csp_dtr_cost_sales_tax_percent": 80, "csp_dtr_cost_site_improvements_cost_per_m2": 16, "csp_dtr_cost_solar_field_cost_per_m2": 297, - "csp_dtr_cost_storage_cost_per_kwht": 62, + "csp_dtr_cost_storage_cost_per_kwht": 70, "sales_tax_rate": 5 }, "FinancialParameters": { diff --git a/api/api_autogen/library/defaults/TroughPhysicalIph_PhysicalTroughIPHLCOHCalculator.json b/api/api_autogen/library/defaults/TroughPhysicalIph_PhysicalTroughIPHLCOHCalculator.json index 006b9a7d1..e8da15919 100644 --- a/api/api_autogen/library/defaults/TroughPhysicalIph_PhysicalTroughIPHLCOHCalculator.json +++ b/api/api_autogen/library/defaults/TroughPhysicalIph_PhysicalTroughIPHLCOHCalculator.json @@ -140,11 +140,11 @@ [0.935000, 0.935000, 0.935000, 0.963000], [0.935000, 0.935000, 0.935000, 0.963000] ], - "T_fp": 10, - "T_loop_in_des": 90, - "T_loop_out": 300, - "T_shutdown": 159.3, - "T_startup": 159.3, + "T_fp": 150, + "T_loop_in_des": 293, + "T_loop_out": 391, + "T_shutdown": 325.34, + "T_startup": 325.34, "Tau_envelope": [ [0.964000, 0.964000, 1.000000, 0.000000], [0.964000, 0.964000, 1.000000, 0.000000], @@ -324,13 +324,13 @@ "SystemCosts": { }, "TES": { - "cold_tank_Thtr": 60, + "cold_tank_Thtr": 250, "cold_tank_max_heat": 0.5, "d_tank_in": 0, "dt_hot": 5, - "h_tank_in": 15, - "h_tank_min": 0.5, - "hot_tank_Thtr": 110, + "h_tank_in": 12, + "h_tank_min": 1, + "hot_tank_Thtr": 365, "hot_tank_max_heat": 1, "init_hot_htf_percent": 30, "is_h_tank_fixed": 1, @@ -345,7 +345,7 @@ "tes_cyl_tank_insul_percent": 0, "tes_cyl_tank_thick": 0.0254, "tes_n_tsteps": 100, - "tes_pb_T_charge_min": 290, + "tes_pb_T_charge_min": 381, "tes_pb_T_cold_delta": 30, "tes_pb_T_hot_delta": 30, "tes_pb_cp_solid": 0.83, @@ -356,7 +356,7 @@ "tes_pb_void_frac": 0.22, "tes_type": 1, "tshours": 6, - "u_tank": 0.3 + "u_tank": 0.4 }, "Controller": { "T_tank_hot_inlet_min": 400, @@ -458,7 +458,7 @@ "csp_dtr_cost_sales_tax_percent": 80, "csp_dtr_cost_site_improvements_cost_per_m2": 16, "csp_dtr_cost_solar_field_cost_per_m2": 297, - "csp_dtr_cost_storage_cost_per_kwht": 62, + "csp_dtr_cost_storage_cost_per_kwht": 70, "sales_tax_rate": 5 }, "FinancialParameters": { diff --git a/api/api_autogen/library/defaults/TroughPhysicalIph_PhysicalTroughIPHNone.json b/api/api_autogen/library/defaults/TroughPhysicalIph_PhysicalTroughIPHNone.json index fece7f2af..75189d7d4 100644 --- a/api/api_autogen/library/defaults/TroughPhysicalIph_PhysicalTroughIPHNone.json +++ b/api/api_autogen/library/defaults/TroughPhysicalIph_PhysicalTroughIPHNone.json @@ -140,11 +140,11 @@ [0.935000, 0.935000, 0.935000, 0.963000], [0.935000, 0.935000, 0.935000, 0.963000] ], - "T_fp": 10, - "T_loop_in_des": 90, - "T_loop_out": 300, - "T_shutdown": 159.3, - "T_startup": 159.3, + "T_fp": 150, + "T_loop_in_des": 293, + "T_loop_out": 391, + "T_shutdown": 325.34, + "T_startup": 325.34, "Tau_envelope": [ [0.964000, 0.964000, 1.000000, 0.000000], [0.964000, 0.964000, 1.000000, 0.000000], @@ -324,13 +324,13 @@ "SystemCosts": { }, "TES": { - "cold_tank_Thtr": 60, + "cold_tank_Thtr": 250, "cold_tank_max_heat": 0.5, "d_tank_in": 0, "dt_hot": 5, - "h_tank_in": 15, - "h_tank_min": 0.5, - "hot_tank_Thtr": 110, + "h_tank_in": 12, + "h_tank_min": 1, + "hot_tank_Thtr": 365, "hot_tank_max_heat": 1, "init_hot_htf_percent": 30, "is_h_tank_fixed": 1, @@ -345,7 +345,7 @@ "tes_cyl_tank_insul_percent": 0, "tes_cyl_tank_thick": 0.0254, "tes_n_tsteps": 100, - "tes_pb_T_charge_min": 290, + "tes_pb_T_charge_min": 381, "tes_pb_T_cold_delta": 30, "tes_pb_T_hot_delta": 30, "tes_pb_cp_solid": 0.83, @@ -356,7 +356,7 @@ "tes_pb_void_frac": 0.22, "tes_type": 1, "tshours": 6, - "u_tank": 0.3 + "u_tank": 0.4 }, "Controller": { "T_tank_hot_inlet_min": 400, @@ -458,7 +458,7 @@ "csp_dtr_cost_sales_tax_percent": 80, "csp_dtr_cost_site_improvements_cost_per_m2": 16, "csp_dtr_cost_solar_field_cost_per_m2": 297, - "csp_dtr_cost_storage_cost_per_kwht": 62, + "csp_dtr_cost_storage_cost_per_kwht": 70, "sales_tax_rate": 5 }, "FinancialParameters": { diff --git a/api/api_autogen/library/defaults/TroughPhysicalIph_PhysicalTroughIPHSingleOwner.json b/api/api_autogen/library/defaults/TroughPhysicalIph_PhysicalTroughIPHSingleOwner.json index 51fb058bd..688f1a305 100644 --- a/api/api_autogen/library/defaults/TroughPhysicalIph_PhysicalTroughIPHSingleOwner.json +++ b/api/api_autogen/library/defaults/TroughPhysicalIph_PhysicalTroughIPHSingleOwner.json @@ -140,11 +140,11 @@ [0.935000, 0.935000, 0.935000, 0.963000], [0.935000, 0.935000, 0.935000, 0.963000] ], - "T_fp": 10, - "T_loop_in_des": 90, - "T_loop_out": 300, - "T_shutdown": 159.3, - "T_startup": 159.3, + "T_fp": 150, + "T_loop_in_des": 293, + "T_loop_out": 391, + "T_shutdown": 325.34, + "T_startup": 325.34, "Tau_envelope": [ [0.964000, 0.964000, 1.000000, 0.000000], [0.964000, 0.964000, 1.000000, 0.000000], @@ -324,13 +324,13 @@ "SystemCosts": { }, "TES": { - "cold_tank_Thtr": 60, + "cold_tank_Thtr": 250, "cold_tank_max_heat": 0.5, "d_tank_in": 0, "dt_hot": 5, - "h_tank_in": 15, - "h_tank_min": 0.5, - "hot_tank_Thtr": 110, + "h_tank_in": 12, + "h_tank_min": 1, + "hot_tank_Thtr": 365, "hot_tank_max_heat": 1, "init_hot_htf_percent": 30, "is_h_tank_fixed": 1, @@ -345,7 +345,7 @@ "tes_cyl_tank_insul_percent": 0, "tes_cyl_tank_thick": 0.0254, "tes_n_tsteps": 100, - "tes_pb_T_charge_min": 290, + "tes_pb_T_charge_min": 381, "tes_pb_T_cold_delta": 30, "tes_pb_T_hot_delta": 30, "tes_pb_cp_solid": 0.83, @@ -356,7 +356,7 @@ "tes_pb_void_frac": 0.22, "tes_type": 1, "tshours": 6, - "u_tank": 0.3 + "u_tank": 0.4 }, "Controller": { "T_tank_hot_inlet_min": 400, @@ -430,7 +430,7 @@ "ppa_soln_mode": 1 }, "Revenue": { - "ppa_price_input_heat_btu": [15.000000] + "ppa_price_input_heat_btu": [19.000000] }, "TimeOfDeliveryFactors": { }, @@ -460,7 +460,7 @@ "csp_dtr_cost_sales_tax_percent": 80, "csp_dtr_cost_site_improvements_cost_per_m2": 16, "csp_dtr_cost_solar_field_cost_per_m2": 297, - "csp_dtr_cost_storage_cost_per_kwht": 62, + "csp_dtr_cost_storage_cost_per_kwht": 70, "sales_tax_rate": 5 }, "FinancialParameters": { diff --git a/src/geotools.cpp b/src/geotools.cpp index 6a49e33fa..0bc17f1a2 100644 --- a/src/geotools.cpp +++ b/src/geotools.cpp @@ -125,7 +125,7 @@ bool GeoTools::GeocodeGoogle(const wxString& address, double* lat, double* lon, if (tz != 0) { success = false; - // get timezone from Goolge timezone API + // get timezone from Google timezone API url = SamApp::WebApi("google_timezone_api") + wxString::Format("&location=%.14lf,%.14lf", *lat, *lon); url.Replace("", wxString(google_api_key)); @@ -264,6 +264,8 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo if (!success) return false; + wxMessageBox(str, "geocode developer success to tz "); + if (tz != 0) { From 0f304cc67ce9a07bbec0dd2ecfc3ca2176c3a3f1 Mon Sep 17 00:00:00 2001 From: Steven Janzou Date: Mon, 27 Jan 2025 01:57:10 -0700 Subject: [PATCH 09/19] additional Linux debugging for #1968 --- src/geotools.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/geotools.cpp b/src/geotools.cpp index 0bc17f1a2..699328a50 100644 --- a/src/geotools.cpp +++ b/src/geotools.cpp @@ -35,6 +35,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +#include // parser errors returned as char strings #include "main.h" #include "geotools.h" @@ -210,10 +211,22 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo wxMessageBox(str, "geocode developer URL return string"); - reader.Parse(str.c_str()); - /* example for "denver, co" + + rapidjson::ParseResult ok = reader.Parse(str.c_str()); + + + /* + ParseResult ok = doc.Parse("[42]"); + if (!ok) { + fprintf(stderr, "JSON parse error: %s (%u)", + GetParseError_En(ok.Code()), ok.Offset()); + exit(EXIT_FAILURE); + } + + + example for "denver, co" {"info": {"statuscode":0,"copyright": {"text":"© 2024 MapQuest, Inc.","imageUrl":"http://api.mqcdn.com/res/mqlogo.gif","imageAltText":"© 2024 MapQuest, Inc."} @@ -251,6 +264,7 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo } // check status code success = false;//overrides success of retrieving data + wxMessageBox(str, "geocode developer reset status code "); if (reader.HasMember("info")) { if (reader["info"].HasMember("statuscode")) { @@ -260,6 +274,9 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo } } } + else { + wxMessageBox(rapidjson::GetParseError_En(ok.Code()), "geocode developer parse error "); + } if (!success) return false; From 86365f8da5e842fa4ff396b8a145bc14eff438fc Mon Sep 17 00:00:00 2001 From: Steven Janzou Date: Mon, 27 Jan 2025 02:27:08 -0700 Subject: [PATCH 10/19] Try to fix RapidJSON empty document on Linux issue #1968 --- src/geotools.cpp | 6 +++--- src/urdb.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/geotools.cpp b/src/geotools.cpp index 699328a50..6196c0737 100644 --- a/src/geotools.cpp +++ b/src/geotools.cpp @@ -80,7 +80,7 @@ bool GeoTools::GeocodeGoogle(const wxString& address, double* lat, double* lon, } rapidjson::Document reader; - auto str = curl.GetDataAsString(); + wxString str = curl.GetDataAsString(); reader.Parse(str.c_str()); if (!reader.HasParseError()) { @@ -207,14 +207,14 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo } rapidjson::Document reader; - auto str = curl.GetDataAsString(); + wxString str = curl.GetDataAsString(); wxMessageBox(str, "geocode developer URL return string"); - rapidjson::ParseResult ok = reader.Parse(str.c_str()); + rapidjson::ParseResult ok = reader.Parse((const char *)str.c_str()); /* diff --git a/src/urdb.cpp b/src/urdb.cpp index 627a5c8e6..99ba143c5 100644 --- a/src/urdb.cpp +++ b/src/urdb.cpp @@ -216,7 +216,7 @@ bool OpenEI::QueryUtilityCompanies(wxArrayString &names, wxString *err) } rapidjson::Document reader; - reader.Parse(json_data.c_str()); + reader.Parse((const char *)json_data.c_str()); if (reader.HasParseError()) { From ba5c60a1792dc465a7f85c26fb12f023c7b431aa Mon Sep 17 00:00:00 2001 From: Steven Janzou Date: Mon, 27 Jan 2025 03:31:04 -0700 Subject: [PATCH 11/19] Test using parse stream to encode for linux #1968 --- src/geotools.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/geotools.cpp b/src/geotools.cpp index 6196c0737..75b49191a 100644 --- a/src/geotools.cpp +++ b/src/geotools.cpp @@ -40,6 +40,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "main.h" #include "geotools.h" +/* static wxString MyGet(const wxString& url) { wxEasyCurl curl; @@ -48,7 +49,7 @@ static wxString MyGet(const wxString& url) curl.Get(url); return curl.GetDataAsString(); } - +*/ // Geocode using Google API for non-NREL builds of SAM bool GeoTools::GeocodeGoogle(const wxString& address, double* lat, double* lon, double* tz, bool showprogress) { wxBusyCursor _curs; @@ -211,10 +212,14 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo wxMessageBox(str, "geocode developer URL return string"); + + rapidjson::StringStream is(str.c_str()); +// doc.ParseStream(is); - rapidjson::ParseResult ok = reader.Parse((const char *)str.c_str()); +// rapidjson::ParseResult ok = reader.Parse((const char*)str.c_str()); + rapidjson::ParseResult ok = reader.ParseStream(is); /* From c96d4caa79e7b5d77c90bfef1dc18956e2c4d982 Mon Sep 17 00:00:00 2001 From: Steven Janzou Date: Mon, 27 Jan 2025 03:52:44 -0700 Subject: [PATCH 12/19] Test escaping quotes for linux #1968 --- src/geotools.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/geotools.cpp b/src/geotools.cpp index 75b49191a..a9fa620a6 100644 --- a/src/geotools.cpp +++ b/src/geotools.cpp @@ -210,6 +210,8 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo rapidjson::Document reader; wxString str = curl.GetDataAsString(); + str.Replace("\"", "\\\""); + wxMessageBox(str, "geocode developer URL return string"); From 064bcc738ff0d871e615c0fb45653490787d60e6 Mon Sep 17 00:00:00 2001 From: Steven Janzou Date: Mon, 27 Jan 2025 04:13:10 -0700 Subject: [PATCH 13/19] Testing urdb curl updates for #1968 --- src/geotools.cpp | 4 ++-- src/urdb.cpp | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/geotools.cpp b/src/geotools.cpp index a9fa620a6..1a55f911c 100644 --- a/src/geotools.cpp +++ b/src/geotools.cpp @@ -194,8 +194,8 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo url.Replace("&", "\\&"); wxMessageBox(url, "updated geocode developer URL"); */ - curl.AddHttpHeader("Content-Type: application/json"); - curl.AddHttpHeader("Accept: application/json"); + // curl.AddHttpHeader("Content-Type: application/json"); + // curl.AddHttpHeader("Accept: application/json"); if (showprogress) { diff --git a/src/urdb.cpp b/src/urdb.cpp index 99ba143c5..d17939210 100644 --- a/src/urdb.cpp +++ b/src/urdb.cpp @@ -48,8 +48,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. static wxString MyGet(const wxString &url) { wxEasyCurl curl; - curl.AddHttpHeader( "Content-type: text/plain" ); +// curl.AddHttpHeader( "Content-type: text/plain" ); +// curl.AddHttpHeader( "Cache-Control: no-cache" ); curl.AddHttpHeader( "Cache-Control: no-cache" ); + curl.AddHttpHeader("Content-Type: application/json"); + curl.AddHttpHeader("Accept: application/json"); + curl.Get(url); return curl.GetDataAsString(); } From 5bfdf142248f78904946494a0493f6997451dc97 Mon Sep 17 00:00:00 2001 From: Steven Janzou Date: Mon, 27 Jan 2025 04:57:05 -0700 Subject: [PATCH 14/19] update parsing flags for linux #1968 --- src/geotools.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/geotools.cpp b/src/geotools.cpp index 1a55f911c..47fecc19a 100644 --- a/src/geotools.cpp +++ b/src/geotools.cpp @@ -210,18 +210,21 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo rapidjson::Document reader; wxString str = curl.GetDataAsString(); - str.Replace("\"", "\\\""); + // str.Replace("\"", "\\\""); - wxMessageBox(str, "geocode developer URL return string"); + std::string stdstr = str.ToStdString(); + + wxMessageBox(stdstr, "geocode developer URL return string"); - rapidjson::StringStream is(str.c_str()); +// rapidjson::StringStream is(str.c_str()); // doc.ParseStream(is); // rapidjson::ParseResult ok = reader.Parse((const char*)str.c_str()); - rapidjson::ParseResult ok = reader.ParseStream(is); +// rapidjson::ParseResult ok = reader.ParseStream(is); + rapidjson::ParseResult ok = reader.Parse<0>(stdstr.c_str()); /* From b2536049c01c3b47e487773e3e1b45d7c318b430 Mon Sep 17 00:00:00 2001 From: Steven Janzou Date: Mon, 27 Jan 2025 05:14:58 -0700 Subject: [PATCH 15/19] std string parsing with curl library #1968 --- src/geotools.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/geotools.cpp b/src/geotools.cpp index 47fecc19a..111aa7594 100644 --- a/src/geotools.cpp +++ b/src/geotools.cpp @@ -194,8 +194,8 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo url.Replace("&", "\\&"); wxMessageBox(url, "updated geocode developer URL"); */ - // curl.AddHttpHeader("Content-Type: application/json"); - // curl.AddHttpHeader("Accept: application/json"); + curl.AddHttpHeader("Content-Type: application/json"); + curl.AddHttpHeader("Accept: application/json"); if (showprogress) { From dd1b2bf1935c366e51a1cede0c99ef7b12823d72 Mon Sep 17 00:00:00 2001 From: Steven Janzou Date: Tue, 28 Jan 2025 02:18:21 -0700 Subject: [PATCH 16/19] Testing after verifying working with json str in vscode on RHEL #1968 --- src/geotools.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/geotools.cpp b/src/geotools.cpp index 111aa7594..ae4500513 100644 --- a/src/geotools.cpp +++ b/src/geotools.cpp @@ -208,13 +208,13 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo } rapidjson::Document reader; - wxString str = curl.GetDataAsString(); + // wxString str = curl.GetDataAsString(); // str.Replace("\"", "\\\""); - std::string stdstr = str.ToStdString(); + std::string str = curl.GetDataAsString().ToStdString(); - wxMessageBox(stdstr, "geocode developer URL return string"); + wxMessageBox((wxString)str, "geocode developer URL return string"); // rapidjson::StringStream is(str.c_str()); @@ -224,7 +224,7 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo // rapidjson::ParseResult ok = reader.Parse((const char*)str.c_str()); // rapidjson::ParseResult ok = reader.ParseStream(is); - rapidjson::ParseResult ok = reader.Parse<0>(stdstr.c_str()); + rapidjson::ParseResult ok = reader.Parse<0>(str.c_str()); /* @@ -361,7 +361,7 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo if (reader.HasMember("statusDescription")) { if (reader["statusDescription"].IsString()) { - str = reader["statusDescription"].GetString(); + wxString str = reader["statusDescription"].GetString(); success = str.Lower() == "ok"; } } From db667595788fc63827055899b23710ccc3ab16f6 Mon Sep 17 00:00:00 2001 From: Steven Janzou Date: Tue, 28 Jan 2025 02:34:05 -0700 Subject: [PATCH 17/19] Switch from std::string to wxString for testing GeocodeDeveloper method #1968 --- src/geotools.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/geotools.cpp b/src/geotools.cpp index ae4500513..281e40066 100644 --- a/src/geotools.cpp +++ b/src/geotools.cpp @@ -208,13 +208,13 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo } rapidjson::Document reader; - // wxString str = curl.GetDataAsString(); + wxString str = curl.GetDataAsString(); // str.Replace("\"", "\\\""); - std::string str = curl.GetDataAsString().ToStdString(); + // std::string str = curl.GetDataAsString().ToStdString(); - wxMessageBox((wxString)str, "geocode developer URL return string"); + wxMessageBox(str, "geocode developer URL return string"); // rapidjson::StringStream is(str.c_str()); From 128023d0c8cea9289b291ebe02c025aaa8154a02 Mon Sep 17 00:00:00 2001 From: Steven Janzou Date: Tue, 28 Jan 2025 03:51:23 -0700 Subject: [PATCH 18/19] Rewrite all parsing for UTF16 and test on Windows #1968 --- src/geotools.cpp | 104 +++++++-------- src/urdb.cpp | 326 +++++++++++++++++++++++------------------------ src/urdb.h | 2 +- 3 files changed, 217 insertions(+), 215 deletions(-) diff --git a/src/geotools.cpp b/src/geotools.cpp index 281e40066..41d8494c9 100644 --- a/src/geotools.cpp +++ b/src/geotools.cpp @@ -80,25 +80,26 @@ bool GeoTools::GeocodeGoogle(const wxString& address, double* lat, double* lon, return false; } - rapidjson::Document reader; + // change from UTF8 to UTF16 encoding to address unicode characters per SAM GitHub issue 1848 + rapidjson::GenericDocument < rapidjson::UTF16<> > reader; wxString str = curl.GetDataAsString(); reader.Parse(str.c_str()); if (!reader.HasParseError()) { - if (reader.HasMember("results")) { - if (reader["results"].IsArray()) { - if (reader["results"][0].HasMember("geometry")) { - if (reader["results"][0]["geometry"].IsArray()) { - if (reader["results"][0]["geometry"][0].HasMember("location")) { - if (reader["results"][0]["geometry"][0]["location"].HasMember("lat")) { - if (reader["results"][0]["geometry"][0]["location"]["lat"].IsNumber()) { - *lat = reader["results"][0]["geometry"][0]["location"]["lat"].GetDouble(); + if (reader.HasMember(L"results")) { + if (reader[L"results"].IsArray()) { + if (reader[L"results"][0].HasMember(L"geometry")) { + if (reader[L"results"][0][L"geometry"].IsArray()) { + if (reader[L"results"][0][L"geometry"][0].HasMember(L"location")) { + if (reader[L"results"][0][L"geometry"][0][L"location"].HasMember(L"lat")) { + if (reader[L"results"][0][L"geometry"][0][L"location"][L"lat"].IsNumber()) { + *lat = reader[L"results"][0][L"geometry"][0][L"location"][L"lat"].GetDouble(); success = true; } } - if (reader["results"][0]["geometry"][0]["location"].HasMember("lng")) { - if (reader["results"][0]["geometry"][0]["location"]["lng"].IsNumber()) { - *lon = reader["results"][0]["geometry"][0]["location"]["lng"].GetDouble(); + if (reader[L"results"][0][L"geometry"][0][L"location"].HasMember(L"lng")) { + if (reader[L"results"][0][L"geometry"][0][L"location"][L"lng"].IsNumber()) { + *lon = reader[L"results"][0][L"geometry"][0][L"location"][L"lng"].GetDouble(); success &= true; } } @@ -112,9 +113,9 @@ bool GeoTools::GeocodeGoogle(const wxString& address, double* lat, double* lon, success = false;//overrides success of retrieving data - if (reader.HasMember("status")) { - if (reader["status"].IsString()) { - str = reader["status"].GetString(); + if (reader.HasMember(L"status")) { + if (reader[L"status"].IsString()) { + str = reader[L"status"].GetString(); success = str.Lower() == "ok"; } } @@ -142,13 +143,13 @@ bool GeoTools::GeocodeGoogle(const wxString& address, double* lat, double* lon, reader.Parse(str.c_str()); if (!reader.HasParseError()) { - if (reader.HasMember("rawOffset")) { - if (reader["rawOffset"].IsNumber()) { - *tz = reader["rawOffset"].GetDouble() / 3600.0; + if (reader.HasMember(L"rawOffset")) { + if (reader[L"rawOffset"].IsNumber()) { + *tz = reader[L"rawOffset"].GetDouble() / 3600.0; success = true; } - else if (reader["rawOffset"].IsInt()) { - *tz = reader["rawOffset"].GetInt() / 3600.0; + else if (reader[L"rawOffset"].IsInt()) { + *tz = reader[L"rawOffset"].GetInt() / 3600.0; success = true; } } @@ -157,9 +158,9 @@ bool GeoTools::GeocodeGoogle(const wxString& address, double* lat, double* lon, // check status code success = false;//overrides success of retrieving data - if (reader.HasMember("status")) { - if (reader["status"].IsString()) { - str = reader["status"].GetString(); + if (reader.HasMember(L"status")) { + if (reader[L"status"].IsString()) { + str = reader[L"status"].GetString(); success = str.Lower() == "ok"; } } @@ -207,7 +208,8 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo return false; } - rapidjson::Document reader; + // change from UTF8 to UTF16 encoding to address unicode characters per SAM GitHub issue 1848 + rapidjson::GenericDocument < rapidjson::UTF16<> > reader; wxString str = curl.GetDataAsString(); // str.Replace("\"", "\\\""); @@ -224,7 +226,7 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo // rapidjson::ParseResult ok = reader.Parse((const char*)str.c_str()); // rapidjson::ParseResult ok = reader.ParseStream(is); - rapidjson::ParseResult ok = reader.Parse<0>(str.c_str()); + rapidjson::ParseResult ok = reader.Parse(str.c_str()); /* @@ -250,20 +252,20 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo */ if (!reader.HasParseError()) { - if (reader.HasMember("results")) { - if (reader["results"].IsArray()) { - if (reader["results"][0].HasMember("locations")) { - if (reader["results"][0]["locations"].IsArray()) { - if (reader["results"][0]["locations"][0].HasMember("latLng")) { - if (reader["results"][0]["locations"][0]["latLng"].HasMember("lat")) { - if (reader["results"][0]["locations"][0]["latLng"]["lat"].IsNumber()) { - *lat = reader["results"][0]["locations"][0]["latLng"]["lat"].GetDouble(); + if (reader.HasMember(L"results")) { + if (reader[L"results"].IsArray()) { + if (reader[L"results"][0].HasMember(L"locations")) { + if (reader[L"results"][0][L"locations"].IsArray()) { + if (reader[L"results"][0][L"locations"][0].HasMember(L"latLng")) { + if (reader[L"results"][0][L"locations"][0][L"latLng"].HasMember(L"lat")) { + if (reader[L"results"][0][L"locations"][0][L"latLng"][L"lat"].IsNumber()) { + *lat = reader[L"results"][0][L"locations"][0][L"latLng"][L"lat"].GetDouble(); success = true; } } - if (reader["results"][0]["locations"][0]["latLng"].HasMember("lng")) { - if (reader["results"][0]["locations"][0]["latLng"]["lng"].IsNumber()) { - *lon = reader["results"][0]["locations"][0]["latLng"]["lng"].GetDouble(); + if (reader[L"results"][0][L"locations"][0][L"latLng"].HasMember(L"lng")) { + if (reader[L"results"][0][L"locations"][0][L"latLng"][L"lng"].IsNumber()) { + *lon = reader[L"results"][0][L"locations"][0][L"latLng"][L"lng"].GetDouble(); success &= true; } } @@ -276,10 +278,10 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo success = false;//overrides success of retrieving data wxMessageBox(str, "geocode developer reset status code "); - if (reader.HasMember("info")) { - if (reader["info"].HasMember("statuscode")) { - if (reader["info"]["statuscode"].IsInt()) { - success = reader["info"]["statuscode"].GetInt() == 0; + if (reader.HasMember(L"info")) { + if (reader[L"info"].HasMember(L"statuscode")) { + if (reader[L"info"][L"statuscode"].IsInt()) { + success = reader[L"info"][L"statuscode"].GetInt() == 0; } } } @@ -331,14 +333,14 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo reader.Parse(str.c_str()); if (!reader.HasParseError()) { - if (reader.HasMember("resourceSets")) { - if (reader["resourceSets"].IsArray()) { - if (reader["resourceSets"][0].HasMember("resources")) { - if (reader["resourceSets"][0]["resources"].IsArray()) { - if (reader["resourceSets"][0]["resources"][0].HasMember("timeZone")) { - if (reader["resourceSets"][0]["resources"][0]["timeZone"].HasMember("utcOffset")) { - if (reader["resourceSets"][0]["resources"][0]["timeZone"]["utcOffset"].IsString()) { - wxString stz = reader["resourceSets"][0]["resources"][0]["timeZone"]["utcOffset"].GetString(); + if (reader.HasMember(L"resourceSets")) { + if (reader[L"resourceSets"].IsArray()) { + if (reader[L"resourceSets"][0].HasMember(L"resources")) { + if (reader[L"resourceSets"][0][L"resources"].IsArray()) { + if (reader[L"resourceSets"][0][L"resources"][0].HasMember(L"timeZone")) { + if (reader[L"resourceSets"][0][L"resources"][0][L"timeZone"].HasMember(L"utcOffset")) { + if (reader[L"resourceSets"][0][L"resources"][0][L"timeZone"][L"utcOffset"].IsString()) { + wxString stz = reader[L"resourceSets"][0][L"resources"][0][L"timeZone"][L"utcOffset"].GetString(); wxArrayString as = wxSplit(stz, ':'); if (as.Count() != 2) return false; if (!as[0].ToDouble(tz)) return false; @@ -359,9 +361,9 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo // check status code success = false;//overrides success of retrieving data - if (reader.HasMember("statusDescription")) { - if (reader["statusDescription"].IsString()) { - wxString str = reader["statusDescription"].GetString(); + if (reader.HasMember(L"statusDescription")) { + if (reader[L"statusDescription"].IsString()) { + wxString str = reader[L"statusDescription"].GetString(); success = str.Lower() == "ok"; } } diff --git a/src/urdb.cpp b/src/urdb.cpp index d17939210..2001cd9f1 100644 --- a/src/urdb.cpp +++ b/src/urdb.cpp @@ -50,7 +50,7 @@ static wxString MyGet(const wxString &url) wxEasyCurl curl; // curl.AddHttpHeader( "Content-type: text/plain" ); // curl.AddHttpHeader( "Cache-Control: no-cache" ); - curl.AddHttpHeader( "Cache-Control: no-cache" ); +// curl.AddHttpHeader( "Cache-Control: no-cache" ); curl.AddHttpHeader("Content-Type: application/json"); curl.AddHttpHeader("Accept: application/json"); @@ -219,8 +219,8 @@ bool OpenEI::QueryUtilityCompanies(wxArrayString &names, wxString *err) return false; } - rapidjson::Document reader; - reader.Parse((const char *)json_data.c_str()); + rapidjson::GenericDocument < rapidjson::UTF16<> > reader; + reader.Parse(json_data.c_str()); if (reader.HasParseError()) { @@ -228,10 +228,10 @@ bool OpenEI::QueryUtilityCompanies(wxArrayString &names, wxString *err) return false; } - if ( reader.HasMember("error") ) + if ( reader.HasMember(L"error") ) { - if (reader["error"].HasMember("message")) { - wxString str = reader["error"]["message"].GetString(); + if (reader[L"error"].HasMember(L"message")) { + wxString str = reader[L"error"][L"message"].GetString(); if (err) *err = "URDB API error: " + str; } return false; @@ -239,16 +239,16 @@ bool OpenEI::QueryUtilityCompanies(wxArrayString &names, wxString *err) names.Clear(); - if (reader.HasMember("items")) { + if (reader.HasMember(L"items")) { - if (reader["items"].IsArray()) { + if (reader[L"items"].IsArray()) { - auto item_list = reader["items"].GetArray(); + auto item_list = reader[L"items"].GetArray(); int count = item_list.Size(); for (int i = 0; i < count; i++) { - if (item_list[i].HasMember("label")) { - wxString buf = item_list[i]["label"].GetString(); + if (item_list[i].HasMember(L"label")) { + wxString buf = item_list[i][L"label"].GetString(); buf.Replace("&", "&"); names.Add(buf); } @@ -282,7 +282,7 @@ bool OpenEI::QueryUtilityCompaniesbyZipcode(const wxString &zipcode, wxArrayStri // wxJSONReader reader; // wxJSONValue root; - rapidjson::Document reader; + rapidjson::GenericDocument < rapidjson::UTF16<> > reader; reader.Parse(json_data.c_str()); if (reader.HasParseError()) @@ -293,14 +293,14 @@ bool OpenEI::QueryUtilityCompaniesbyZipcode(const wxString &zipcode, wxArrayStri wxString company_id = wxEmptyString; - if (reader.HasMember("outputs")) { + if (reader.HasMember(L"outputs")) { //wxJSONValue item_list = root.Item("outputs"); // does not resolve to OpenEI names only EIA names //wxString buf = item_list.Item("utility_name").AsString(); // EIAID number for utility company // some zip codes return company_id with multiple EIAIDs separated by single pipes - if (reader["outputs"].HasMember("company_id")) - company_id = reader["outputs"]["company_id"].GetString(); + if (reader[L"outputs"].HasMember(L"company_id")) + company_id = reader[L"outputs"][L"company_id"].GetString(); } if (company_id.IsEmpty()) { @@ -331,15 +331,15 @@ bool OpenEI::QueryUtilityCompaniesbyZipcode(const wxString &zipcode, wxArrayStri names.Clear(); - if (reader.HasMember("results")) { - if (reader["results"].IsObject()) { - const auto& item_list = reader["results"].GetObject(); + if (reader.HasMember(L"results")) { + if (reader[L"results"].IsObject()) { + const auto& item_list = reader[L"results"].GetObject(); //wxArrayString list_name = item_list.GetMemberNames(); if (item_list.MemberCount() > 0) { for (size_t i = 0; i < item_list.MemberCount(); i++) { wxString urdbname = (item_list.begin() + i)->name.GetString(); - if ((item_list.begin() + i)->value.HasMember("fulltext")) - urdbname = (item_list.begin() + i)->value["fulltext"].GetString(); + if ((item_list.begin() + i)->value.HasMember(L"fulltext")) + urdbname = (item_list.begin() + i)->value[L"fulltext"].GetString(); urdbname.Replace("&", "&"); names.Add(urdbname); } @@ -492,7 +492,7 @@ bool OpenEI::RetrieveUtilityRateData(const wxString &guid, RateData &rate, wxStr } - rapidjson::Document reader; + rapidjson::GenericDocument < rapidjson::UTF16<> > reader; reader.Parse(json_data.c_str()); if (reader.HasParseError()) @@ -502,7 +502,7 @@ bool OpenEI::RetrieveUtilityRateData(const wxString &guid, RateData &rate, wxStr } // wxJSONValue val = root.Item("items").ItemAt(0); - auto& val = reader["items"][0]; + auto& val = reader[L"items"][0]; if (val.IsNull()) { if (err) *err = "Root JSON structure error: Items is null for GUID = " + guid; @@ -537,74 +537,74 @@ bool OpenEI::RetrieveUtilityRateData(const wxString &guid, RateData &rate, wxStr rate.Header.GUID = guid; - rate.Header.Name = val["name"].GetString(); - rate.Header.Utility = val["utility"].GetString(); - rate.Header.Sector = val["sector"].GetString(); + rate.Header.Name = val[L"name"].GetString(); + rate.Header.Utility = val[L"utility"].GetString(); + rate.Header.Sector = val[L"sector"].GetString(); // optional - if (val.HasMember("description")) - rate.Header.Description = val["description"].GetString(); + if (val.HasMember(L"description")) + rate.Header.Description = val[L"description"].GetString(); // optional - if (val.HasMember("source")) - rate.Header.Source = val["source"].GetString(); + if (val.HasMember(L"source")) + rate.Header.Source = val[L"source"].GetString(); // optional - if (val.HasMember("version")) - rate.Header.Version = val["version"].GetInt(); + if (val.HasMember(L"version")) + rate.Header.Version = val[L"version"].GetInt(); // optional - if (val.HasMember("energycomments")) - rate.Header.EnergyComments = val["energycomments"].GetString(); + if (val.HasMember(L"energycomments")) + rate.Header.EnergyComments = val[L"energycomments"].GetString(); // optional - if (val.HasMember("demandcomments")) - rate.Header.DemandComments = val["demandcomments"].GetString(); + if (val.HasMember(L"demandcomments")) + rate.Header.DemandComments = val[L"demandcomments"].GetString(); // optional - if (val.HasMember("basicinformationcomments")) - rate.Header.BasicInformationComments = val["basicinformationcomments"].GetString(); + if (val.HasMember(L"basicinformationcomments")) + rate.Header.BasicInformationComments = val[L"basicinformationcomments"].GetString(); rate.Header.JSONURL = url; rate.Header.RateURL = SamApp::WebApi("urdb_view_rate") + "/rate/view/" + guid; // optional - if (val.HasMember("startdate")) - rate.Header.StartDate = GetDate(val["startdate"].GetInt()); + if (val.HasMember(L"startdate")) + rate.Header.StartDate = GetDate(val[L"startdate"].GetInt()); // optional - if (val.HasMember("enddate")) - rate.Header.EndDate = GetDate(val["enddate"].GetInt()); + if (val.HasMember(L"enddate")) + rate.Header.EndDate = GetDate(val[L"enddate"].GetInt()); else rate.Header.EndDate = "N/A"; // Metering Option // optional - if (val.HasMember("dgrules")) - rate.DgRules = val["dgrules"].GetString(); + if (val.HasMember(L"dgrules")) + rate.DgRules = val[L"dgrules"].GetString(); // Applicability // optional - if (val.HasMember("peakkwcapacityhistory")) - rate.Applicability.peakkwcapacityhistory = val["peakkwcapacityhistory"].GetDouble(); + if (val.HasMember(L"peakkwcapacityhistory")) + rate.Applicability.peakkwcapacityhistory = val[L"peakkwcapacityhistory"].GetDouble(); // optional - if (val.HasMember("peakkwcapacitymax")) - rate.Applicability.peakkwcapacitymax = val["peakkwcapacitymax"].GetDouble(); + if (val.HasMember(L"peakkwcapacitymax")) + rate.Applicability.peakkwcapacitymax = val[L"peakkwcapacitymax"].GetDouble(); // optional - if (val.HasMember("peakkwcapacitymin")) - rate.Applicability.peakkwcapacitymin = val["peakkwcapacitymin"].GetDouble(); + if (val.HasMember(L"peakkwcapacitymin")) + rate.Applicability.peakkwcapacitymin = val[L"peakkwcapacitymin"].GetDouble(); // optional - if (val.HasMember("peakkwhusagehistory")) - rate.Applicability.peakkwhusagehistory = val["peakkwhusagehistory"].GetDouble(); + if (val.HasMember(L"peakkwhusagehistory")) + rate.Applicability.peakkwhusagehistory = val[L"peakkwhusagehistory"].GetDouble(); // optional - if (val.HasMember("peakkwhusagemax")) - rate.Applicability.peakkwhusagemax = val["peakkwhusagemax"].GetDouble(); + if (val.HasMember(L"peakkwhusagemax")) + rate.Applicability.peakkwhusagemax = val[L"peakkwhusagemax"].GetDouble(); // optional - if (val.HasMember("peakkwhusagemin")) - rate.Applicability.peakkwhusagemin = val["peakkwhusagemin"].GetDouble(); + if (val.HasMember(L"peakkwhusagemin")) + rate.Applicability.peakkwhusagemin = val[L"peakkwhusagemin"].GetDouble(); // optional - if (val.HasMember("voltagemaximum")) - rate.Applicability.voltagemaximum = val["voltagemaximum"].GetDouble(); + if (val.HasMember(L"voltagemaximum")) + rate.Applicability.voltagemaximum = val[L"voltagemaximum"].GetDouble(); // optional - if (val.HasMember("voltageminimum")) - rate.Applicability.voltageminimum = val["voltageminimum"].GetDouble(); + if (val.HasMember(L"voltageminimum")) + rate.Applicability.voltageminimum = val[L"voltageminimum"].GetDouble(); // optional - if (val.HasMember("voltagecategory")) - rate.Applicability.voltagecategory = val["voltagecategory"].GetString(); + if (val.HasMember(L"voltagecategory")) + rate.Applicability.voltagecategory = val[L"voltagecategory"].GetString(); // optional - if (val.HasMember("phasewiring")) - rate.Applicability.phasewiring = val["phasewiring"].GetString(); + if (val.HasMember(L"phasewiring")) + rate.Applicability.phasewiring = val[L"phasewiring"].GetString(); // Unused Items, set HasUnusedItems to true for items that would affect bill calculation @@ -613,22 +613,22 @@ bool OpenEI::RetrieveUtilityRateData(const wxString &guid, RateData &rate, wxStr // wxJSONValue isd = val.Item("is_default"); // if ( isd.IsBool() ) - if (val.HasMember("is_default")) - if (val["is_default"].IsBool()) - rate.Unused.IsDefault = val["is_default"].GetBool(); + if (val.HasMember(L"is_default")) + if (val[L"is_default"].IsBool()) + rate.Unused.IsDefault = val[L"is_default"].GetBool(); // wxJSONValue st = val.Item("servicetype"); // if ( st.IsString()) - if (val.HasMember("servicetype")) - if (val["servicetype"].IsString()) - rate.Unused.ServiceType = val["servicetype"].GetString(); + if (val.HasMember(L"servicetype")) + if (val[L"servicetype"].IsString()) + rate.Unused.ServiceType = val[L"servicetype"].GetString(); // wxJSONValue fam = val.Item("fueladjustmentsmonthly"); // if (fam.Size() > 0) // { - if (val.HasMember("fueladjustmentsmonthly")) { - if (val["fueladjustmentsmonthly"].IsArray()) { - auto fam = val["fueladjustmentsmonthly"].GetArray(); + if (val.HasMember(L"fueladjustmentsmonthly")) { + if (val[L"fueladjustmentsmonthly"].IsArray()) { + auto fam = val[L"fueladjustmentsmonthly"].GetArray(); rate.Unused.HasUnusedItems = true; for (int i = 0; i < 12; i++) rate.Unused.FuelAdjustmentsMonthly[i] = fam[i].GetDouble(); @@ -637,19 +637,19 @@ bool OpenEI::RetrieveUtilityRateData(const wxString &guid, RateData &rate, wxStr // wxJSONValue dw = val.Item("demandwindow"); // if (dw.IsDouble()) - if (val.HasMember("demandwindow")) { - if (val["demandwindow"].IsNumber()) { + if (val.HasMember(L"demandwindow")) { + if (val[L"demandwindow"].IsNumber()) { rate.Unused.HasUnusedItems = true; - rate.Unused.DemandWindow = val["demandwindow"].GetDouble(); + rate.Unused.DemandWindow = val[L"demandwindow"].GetDouble(); } } // wxJSONValue drpc = val.Item("demandreactivepowercharge"); // if (drpc.IsDouble() ) - if (val.HasMember("demandreactivepowercharge")) { - if (val["demandreactivepowercharge"].IsNumber()) { + if (val.HasMember(L"demandreactivepowercharge")) { + if (val[L"demandreactivepowercharge"].IsNumber()) { rate.Unused.HasUnusedItems = true; - rate.Unused.DemandReactivePowerCharge = val["demandreactivepowercharge"].GetDouble(); + rate.Unused.DemandReactivePowerCharge = val[L"demandreactivepowercharge"].GetDouble(); } } @@ -657,8 +657,8 @@ bool OpenEI::RetrieveUtilityRateData(const wxString &guid, RateData &rate, wxStr // wxArrayString key; - if (val.HasMember("energyattrs")) { - auto& ea = val["energyattrs"]; + if (val.HasMember(L"energyattrs")) { + auto& ea = val[L"energyattrs"]; wxString ea_str = ""; if (ea.IsArray()){ rate.Unused.HasUnusedItems = true; @@ -676,8 +676,8 @@ bool OpenEI::RetrieveUtilityRateData(const wxString &guid, RateData &rate, wxStr } } // wxJSONValue fa = val.Item("fixedattrs"); - if (val.HasMember("fixedattrs")) { - auto& fa = val["fixedattrs"]; + if (val.HasMember(L"fixedattrs")) { + auto& fa = val[L"fixedattrs"]; wxString fa_str = ""; if (fa.IsArray()) { rate.Unused.HasUnusedItems = true; @@ -702,8 +702,8 @@ bool OpenEI::RetrieveUtilityRateData(const wxString &guid, RateData &rate, wxStr // wxJSONValue da = val.Item("demandattrs"); - if (val.HasMember("demandattrs")) { - auto& da = val["demandattrs"]; + if (val.HasMember(L"demandattrs")) { + auto& da = val[L"demandattrs"]; wxString da_str = ""; if (da.IsArray()) { rate.Unused.HasUnusedItems = true; @@ -721,13 +721,13 @@ bool OpenEI::RetrieveUtilityRateData(const wxString &guid, RateData &rate, wxStr } } - if (val.HasMember("coincidentrateunit")) - rate.Unused.CoincidentRateUnit = val["coincidentrateunit"].GetString(); + if (val.HasMember(L"coincidentrateunit")) + rate.Unused.CoincidentRateUnit = val[L"coincidentrateunit"].GetString(); - if (val.HasMember("coincidentratestructure")) { + if (val.HasMember(L"coincidentratestructure")) { int num_cr_rows = 0; - auto& cr_periods = val["coincidentratestructure"]; + auto& cr_periods = val[L"coincidentratestructure"]; if (cr_periods.IsArray()){ for (size_t period = 0; period < cr_periods.Size(); period++) { auto& cr_tier = cr_periods[period]; @@ -750,17 +750,17 @@ bool OpenEI::RetrieveUtilityRateData(const wxString &guid, RateData &rate, wxStr // double charge = json_double(cr_tier[tier].Item("rate"), 0.0, &rate.Unused.HasCoincidentRate); // double adj = json_double(cr_tier[tier].Item("adj"), 0.0, &rate.Unused.HasCoincidentRate); double max = 1e38; - if (cr_tier[tier].HasMember("max")) - if (cr_tier[tier]["max"].IsNumber()) - max = cr_tier[tier]["max"].GetDouble(); + if (cr_tier[tier].HasMember(L"max")) + if (cr_tier[tier][L"max"].IsNumber()) + max = cr_tier[tier][L"max"].GetDouble(); double charge = 0.0; - if (cr_tier[tier].HasMember("rate")) - if (cr_tier[tier]["rate"].IsNumber()) - charge = cr_tier[tier]["rate"].GetDouble(); + if (cr_tier[tier].HasMember(L"rate")) + if (cr_tier[tier][L"rate"].IsNumber()) + charge = cr_tier[tier][L"rate"].GetDouble(); double adj = 0.0; - if (cr_tier[tier].HasMember("adj")) - if (cr_tier[tier]["adj"].IsNumber()) - adj = cr_tier[tier]["adj"].GetDouble(); + if (cr_tier[tier].HasMember(L"adj")) + if (cr_tier[tier][L"adj"].IsNumber()) + adj = cr_tier[tier][L"adj"].GetDouble(); rate.Unused.CoincidentRateStructure.at(cr_row, 0) = period + 1; rate.Unused.CoincidentRateStructure.at(cr_row, 1) = tier + 1; rate.Unused.CoincidentRateStructure.at(cr_row, 2) = max; @@ -771,24 +771,24 @@ bool OpenEI::RetrieveUtilityRateData(const wxString &guid, RateData &rate, wxStr } } - if (val.HasMember("coincidentschedule")) - if (!RetrieveDiurnalData(val["coincidentschedule"], rate.Unused.CoincidentSchedule)) return false; + if (val.HasMember(L"coincidentschedule")) + if (!RetrieveDiurnalData(val[L"coincidentschedule"], rate.Unused.CoincidentSchedule)) return false; // Minimum Charge - if (val.HasMember("mincharge")) - rate.MinCharge = val["mincharge"].GetDouble(); - if (val.HasMember("minchargeunits")) - rate.MinChargeUnits = val["minchargeunits"].GetString(); + if (val.HasMember(L"mincharge")) + rate.MinCharge = val[L"mincharge"].GetDouble(); + if (val.HasMember(L"minchargeunits")) + rate.MinChargeUnits = val[L"minchargeunits"].GetString(); if (rate.MinChargeUnits == "$/day") rate.Unused.HasUnusedItems = true; // Fixed Charge - if (val.HasMember("fixedchargefirstmeter")) - rate.FixedChargeFirstMeter = val["fixedchargefirstmeter"].GetDouble(); - if (val.HasMember("fixedchargeeaaddl")) - rate.FixedChargeAddlMeter = val["fixedchargeeaaddl"].GetDouble(); - if (val.HasMember("fixedchargeunits")) - rate.FixedChargeUnits = val["fixedchargeunits"].GetString(); + if (val.HasMember(L"fixedchargefirstmeter")) + rate.FixedChargeFirstMeter = val[L"fixedchargefirstmeter"].GetDouble(); + if (val.HasMember(L"fixedchargeeaaddl")) + rate.FixedChargeAddlMeter = val[L"fixedchargeeaaddl"].GetDouble(); + if (val.HasMember(L"fixedchargeunits")) + rate.FixedChargeUnits = val[L"fixedchargeunits"].GetString(); if (rate.FixedChargeUnits != "$/month") rate.Unused.HasUnusedItems = true; @@ -796,10 +796,10 @@ bool OpenEI::RetrieveUtilityRateData(const wxString &guid, RateData &rate, wxStr rate.HasEnergyCharge = true; // first check for energy rate structure and resize matrix if present - if (val.HasMember("energyratestructure")) { + if (val.HasMember(L"energyratestructure")) { int num_ec_rows = 0; // default to one for each month // wxJSONValue ers_periods = val.Item("energyratestructure"); - auto& ers_periods = val["energyratestructure"]; + auto& ers_periods = val[L"energyratestructure"]; if (ers_periods.IsArray()) { for (size_t period = 0; period < ers_periods.Size(); period++) { auto& ers_tier = ers_periods[period]; @@ -822,24 +822,24 @@ bool OpenEI::RetrieveUtilityRateData(const wxString &guid, RateData &rate, wxStr for (size_t tier = 0; tier < ers_tier.Size(); tier++) { // double max = json_double(ers_tier[tier].Item("max"), 1e38, &rate.HasEnergyCharge); double max = 1e38; - if (ers_tier[tier].HasMember("max")) - if (ers_tier[tier]["max"].IsNumber()) // some max values are stored as integers - max = ers_tier[tier]["max"].GetDouble(); + if (ers_tier[tier].HasMember(L"max")) + if (ers_tier[tier][L"max"].IsNumber()) // some max values are stored as integers + max = ers_tier[tier][L"max"].GetDouble(); double buy = 0.0; - if (ers_tier[tier].HasMember("rate")) - if (ers_tier[tier]["rate"].IsNumber()) - buy = ers_tier[tier]["rate"].GetDouble(); + if (ers_tier[tier].HasMember(L"rate")) + if (ers_tier[tier][L"rate"].IsNumber()) + buy = ers_tier[tier][L"rate"].GetDouble(); double sell = 0.0; - if (ers_tier[tier].HasMember("sell")) - if (ers_tier[tier]["sell"].IsNumber()) - sell = ers_tier[tier]["sell"].GetDouble(); + if (ers_tier[tier].HasMember(L"sell")) + if (ers_tier[tier][L"sell"].IsNumber()) + sell = ers_tier[tier][L"sell"].GetDouble(); double adj = 0.0; - if (ers_tier[tier].HasMember("adj")) - if (ers_tier[tier]["adj"].IsNumber()) - adj = ers_tier[tier]["adj"].GetDouble(); + if (ers_tier[tier].HasMember(L"adj")) + if (ers_tier[tier][L"adj"].IsNumber()) + adj = ers_tier[tier][L"adj"].GetDouble(); wxString units; - if (ers_tier[tier].HasMember("unit")) - units = ers_tier[tier]["unit"].GetString(); + if (ers_tier[tier].HasMember(L"unit")) + units = ers_tier[tier][L"unit"].GetString(); rate.EnergyUnits = ""; int iunits = 0; // assume kWh if units not provided if (units.Lower() == "kwh") @@ -865,18 +865,18 @@ bool OpenEI::RetrieveUtilityRateData(const wxString &guid, RateData &rate, wxStr } } - if (!RetrieveDiurnalData(val["energyweekdayschedule"], rate.EnergyWeekdaySchedule)) return false; - if (!RetrieveDiurnalData(val["energyweekendschedule"], rate.EnergyWeekendSchedule)) return false; + if (!RetrieveDiurnalData(val[L"energyweekdayschedule"], rate.EnergyWeekdaySchedule)) return false; + if (!RetrieveDiurnalData(val[L"energyweekendschedule"], rate.EnergyWeekendSchedule)) return false; } // Demand Charge rate.HasDemandCharge = true; - if (val.HasMember("demandrateunit")) - rate.DemandRateUnit = val["demandrateunit"].GetString(); + if (val.HasMember(L"demandrateunit")) + rate.DemandRateUnit = val[L"demandrateunit"].GetString(); - if (val.HasMember("lookbackpercent")) { - auto& lp = val["lookbackpercent"]; + if (val.HasMember(L"lookbackpercent")) { + auto& lp = val[L"lookbackpercent"]; if (lp.IsNumber()) { rate.LookbackPercent = lp.GetDouble() * 100.0; } @@ -885,14 +885,14 @@ bool OpenEI::RetrieveUtilityRateData(const wxString &guid, RateData &rate, wxStr } } - if (val.HasMember("lookbackrange")) { - auto& lr = val["lookbackrange"]; + if (val.HasMember(L"lookbackrange")) { + auto& lr = val[L"lookbackrange"]; if (lr.IsInt()) rate.LookbackRange = lr.GetInt(); } - if (val.HasMember("lookbackmonths")) { - auto& lm = val["lookbackmonths"]; + if (val.HasMember(L"lookbackmonths")) { + auto& lm = val[L"lookbackmonths"]; if (lm.IsArray()) { for (size_t i = 0; i < lm.Size(); i++) { rate.LookbackMonths[i] = lm[i].GetBool(); @@ -901,8 +901,8 @@ bool OpenEI::RetrieveUtilityRateData(const wxString &guid, RateData &rate, wxStr } int num_months = 0; - if (val.HasMember("flatdemandmonths")) { - auto& fdm_periods = val["flatdemandmonths"]; + if (val.HasMember(L"flatdemandmonths")) { + auto& fdm_periods = val[L"flatdemandmonths"]; if (fdm_periods.IsArray()) { // addresses issue from Pieter 6/26/15 for Upper Cumberland EMC GS3 rate with incorrect json - not an entry for every month. num_months = fdm_periods.Size(); @@ -913,8 +913,8 @@ bool OpenEI::RetrieveUtilityRateData(const wxString &guid, RateData &rate, wxStr } } if (num_months == 12) { - if (val.HasMember("flatdemandmonths")) { - auto& fds_periods = val["flatdemandstructure"]; + if (val.HasMember(L"flatdemandmonths")) { + auto& fds_periods = val[L"flatdemandstructure"]; int fds_row = 0; if (fds_periods.IsArray()) { for (size_t period = 0; period < fds_periods.Size(); period++) { @@ -942,17 +942,17 @@ bool OpenEI::RetrieveUtilityRateData(const wxString &guid, RateData &rate, wxStr // double charge = json_double(fds_tier[tier].Item("rate"), 0.0, &rate.HasDemandCharge); // double adj = json_double(fds_tier[tier].Item("adj"), 0.0, &rate.HasDemandCharge); double max = 1e38; - if (fds_tier[tier].HasMember("max")) - if (fds_tier[tier]["max"].IsNumber()) - max = fds_tier[tier]["max"].GetDouble(); + if (fds_tier[tier].HasMember(L"max")) + if (fds_tier[tier][L"max"].IsNumber()) + max = fds_tier[tier][L"max"].GetDouble(); double charge = 0.0; - if (fds_tier[tier].HasMember("rate")) - if (fds_tier[tier]["rate"].IsNumber()) - charge = fds_tier[tier]["rate"].GetDouble(); + if (fds_tier[tier].HasMember(L"rate")) + if (fds_tier[tier][L"rate"].IsNumber()) + charge = fds_tier[tier][L"rate"].GetDouble(); double adj = 0.0; - if (fds_tier[tier].HasMember("adj")) - if (fds_tier[tier]["adj"].IsNumber()) - adj = fds_tier[tier]["adj"].GetDouble(); + if (fds_tier[tier].HasMember(L"adj")) + if (fds_tier[tier][L"adj"].IsNumber()) + adj = fds_tier[tier][L"adj"].GetDouble(); rate.DemandFlatStructure.at(fd_row, 0) = m; rate.DemandFlatStructure.at(fd_row, 1) = tier + 1; rate.DemandFlatStructure.at(fd_row, 2) = max; @@ -969,8 +969,8 @@ bool OpenEI::RetrieveUtilityRateData(const wxString &guid, RateData &rate, wxStr // first check for energy rate structure and resize matrix if present int num_dc_rows = 0; // default to one for each month - if (val.HasMember("demandratestructure")) { - auto& drs_periods = val["demandratestructure"]; + if (val.HasMember(L"demandratestructure")) { + auto& drs_periods = val[L"demandratestructure"]; if (drs_periods.IsArray()) { for (size_t period = 0; period < drs_periods.Size(); period++) { auto& drs_tier = drs_periods[period]; @@ -995,17 +995,17 @@ bool OpenEI::RetrieveUtilityRateData(const wxString &guid, RateData &rate, wxStr // double charge = json_double(drs_tier[tier].Item("rate"), 0.0, &rate.HasDemandCharge); // double adj = json_double(drs_tier[tier].Item("adj"), 0.0, &rate.HasDemandCharge); double max = 1e38; - if (drs_tier[tier].HasMember("max")) - if (drs_tier[tier]["max"].IsNumber()) - max = drs_tier[tier]["max"].GetDouble(); + if (drs_tier[tier].HasMember(L"max")) + if (drs_tier[tier][L"max"].IsNumber()) + max = drs_tier[tier][L"max"].GetDouble(); double charge = 0.0; - if (drs_tier[tier].HasMember("rate")) - if (drs_tier[tier]["rate"].IsNumber()) - charge = drs_tier[tier]["rate"].GetDouble(); + if (drs_tier[tier].HasMember(L"rate")) + if (drs_tier[tier][L"rate"].IsNumber()) + charge = drs_tier[tier][L"rate"].GetDouble(); double adj = 0.0; - if (drs_tier[tier].HasMember("adj")) - if (drs_tier[tier]["adj"].IsNumber()) - adj = drs_tier[tier]["adj"].GetDouble(); + if (drs_tier[tier].HasMember(L"adj")) + if (drs_tier[tier][L"adj"].IsNumber()) + adj = drs_tier[tier][L"adj"].GetDouble(); rate.DemandTOUStructure.at(ds_row, 0) = period + 1; rate.DemandTOUStructure.at(ds_row, 1) = tier + 1; @@ -1016,17 +1016,17 @@ bool OpenEI::RetrieveUtilityRateData(const wxString &guid, RateData &rate, wxStr } } - if (!RetrieveDiurnalData(val["demandweekdayschedule"], rate.DemandWeekdaySchedule)) return false; - if (!RetrieveDiurnalData(val["demandweekendschedule"], rate.DemandWeekendSchedule)) return false; + if (!RetrieveDiurnalData(val[L"demandweekdayschedule"], rate.DemandWeekdaySchedule)) return false; + if (!RetrieveDiurnalData(val[L"demandweekendschedule"], rate.DemandWeekendSchedule)) return false; } return true; } -bool OpenEI::RetrieveDiurnalData(rapidjson::Value &month_ary, double sched[12][24]) +bool OpenEI::RetrieveDiurnalData(rapidjson::GenericValue< rapidjson::UTF16<>> &month_ary, double sched[12][24]) { - rapidjson::Value hour_ary; + rapidjson::GenericValue< rapidjson::UTF16<>> hour_ary; if (month_ary.IsArray()) { diff --git a/src/urdb.h b/src/urdb.h index 03a45049d..71d43a02f 100644 --- a/src/urdb.h +++ b/src/urdb.h @@ -145,7 +145,7 @@ class OpenEI bool QueryUtilityCompaniesbyZipcode(const wxString &zipcode, wxArrayString &names, wxString *err=NULL); bool QueryUtilityRates(const wxString &name, std::vector &rates, wxString *err=NULL); bool RetrieveUtilityRateData(const wxString &guid, RateData &rate, wxString *json_url=NULL, wxString *err=NULL); - bool RetrieveDiurnalData(rapidjson::Value &month_ary, double sched[12][24]); + bool RetrieveDiurnalData(rapidjson::GenericValue< rapidjson::UTF16<>> &month_ary, double sched[12][24]); }; From b9f16fb2033392a8c12e93ae63f22efaca2ede8f Mon Sep 17 00:00:00 2001 From: Steven Janzou Date: Wed, 29 Jan 2025 01:17:09 -0700 Subject: [PATCH 19/19] Remove debugging messages and handle zero rate utilities #1968 Working without issue on Windows --- src/geotools.cpp | 37 +------------------------------------ src/urdb.cpp | 20 +++++++++++++++----- src/urdb.h | 2 +- 3 files changed, 17 insertions(+), 42 deletions(-) diff --git a/src/geotools.cpp b/src/geotools.cpp index 41d8494c9..c30d81ae6 100644 --- a/src/geotools.cpp +++ b/src/geotools.cpp @@ -188,13 +188,8 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo wxEasyCurl curl; wxBusyCursor curs; - wxMessageBox(url, "geocode developer URL"); - + // SAM issue 1968 - /* works from command line and fails in curl.get with invalid key - url.Replace("&", "\\&"); - wxMessageBox(url, "updated geocode developer URL"); - */ curl.AddHttpHeader("Content-Type: application/json"); curl.AddHttpHeader("Accept: application/json"); @@ -212,32 +207,10 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo rapidjson::GenericDocument < rapidjson::UTF16<> > reader; wxString str = curl.GetDataAsString(); - // str.Replace("\"", "\\\""); - - // std::string str = curl.GetDataAsString().ToStdString(); - - wxMessageBox(str, "geocode developer URL return string"); - - -// rapidjson::StringStream is(str.c_str()); - -// doc.ParseStream(is); - - -// rapidjson::ParseResult ok = reader.Parse((const char*)str.c_str()); -// rapidjson::ParseResult ok = reader.ParseStream(is); rapidjson::ParseResult ok = reader.Parse(str.c_str()); /* - ParseResult ok = doc.Parse("[42]"); - if (!ok) { - fprintf(stderr, "JSON parse error: %s (%u)", - GetParseError_En(ok.Code()), ok.Offset()); - exit(EXIT_FAILURE); - } - - example for "denver, co" {"info": {"statuscode":0,"copyright": @@ -276,7 +249,6 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo } // check status code success = false;//overrides success of retrieving data - wxMessageBox(str, "geocode developer reset status code "); if (reader.HasMember(L"info")) { if (reader[L"info"].HasMember(L"statuscode")) { @@ -293,7 +265,6 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo if (!success) return false; - wxMessageBox(str, "geocode developer success to tz "); if (tz != 0) @@ -301,8 +272,6 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo success = false; curl = wxEasyCurl(); -// curl.AddHttpHeader("Content-Type: application/json"); -// curl.AddHttpHeader("Accept: application/json"); @@ -314,8 +283,6 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo curl.AddHttpHeader("Accept: application/json"); - wxMessageBox(url, "geocode developer bing tz URL"); - if (showprogress) { if (!curl.Get(url, "Geocoding address '" + address + "'...")) @@ -328,8 +295,6 @@ bool GeoTools::GeocodeDeveloper(const wxString& address, double* lat, double* lo str = curl.GetDataAsString(); - wxMessageBox(str, "geocode developer bing tz URL return string"); - reader.Parse(str.c_str()); if (!reader.HasParseError()) { diff --git a/src/urdb.cpp b/src/urdb.cpp index 2001cd9f1..8a893bdaa 100644 --- a/src/urdb.cpp +++ b/src/urdb.cpp @@ -1281,8 +1281,9 @@ int OpenEIUtilityRateDialog::ShowModal() return wxDialog::ShowModal(); } -void OpenEIUtilityRateDialog::QueryRates(const wxString &utility_name) +bool OpenEIUtilityRateDialog::QueryRates(const wxString &utility_name) { + bool ret = true; wxBusyInfo busy("Getting available rates...", this); lblStatus->SetLabel("Loading rates..."); @@ -1293,8 +1294,10 @@ void OpenEIUtilityRateDialog::QueryRates(const wxString &utility_name) if (!api.QueryUtilityRates(utility_name, mUtilityRates, &err)) { busy.~wxBusyInfo(); - wxMessageBox("Utility Rate Query Error\n\n" + err, "URDB Download Message"); - return; +// wxMessageBox("Utility Rate Query Error\n\n" + err, "URDB Download Message"); +// return false; + ret = false; + mUtilityRates.clear(); } lblRateStatus->SetLabel(wxString::Format("%d rates available for %s", (int)mUtilityRates.size(), utility_name)); @@ -1305,6 +1308,7 @@ void OpenEIUtilityRateDialog::QueryRates(const wxString &utility_name) lblStatus->SetLabel("Ready."); UpdateRateList(); + return true; } void OpenEIUtilityRateDialog::UpdateRateList() @@ -1414,8 +1418,14 @@ void OpenEIUtilityRateDialog::OnEvent(wxCommandEvent &evt) UpdateRateList(); break; case ID_lstUtilities: - QueryRates( lstUtilities->GetStringSelection() ); - lblUtilityCount->SetLabel(wxString::Format("%d utilities", (int)lstUtilities->Count())); + if (QueryRates(lstUtilities->GetStringSelection())) { + lblUtilityCount->SetLabel(wxString::Format("%d utilities", (int)lstUtilities->Count())); + } + else { + lstRates->Clear(); + mGUIDList.Clear(); + mUtilityRates.clear(); + } break; case ID_lstRates: UpdateRateData(); diff --git a/src/urdb.h b/src/urdb.h index 71d43a02f..02b0f7204 100644 --- a/src/urdb.h +++ b/src/urdb.h @@ -163,7 +163,7 @@ class OpenEIUtilityRateDialog : public wxDialog void StartHttp(); void QueryUtilities(); void QueryUtilitiesByZipCode(); - void QueryRates(const wxString &utility_name); + bool QueryRates(const wxString &utility_name); void OnEvent(wxCommandEvent &evt); void OnTimer(wxTimerEvent &evt); void UpdateRateList();