Skip to content

Commit

Permalink
Defaults manager update for hybrid configurations #1461
Browse files Browse the repository at this point in the history
  • Loading branch information
sjanzou committed Sep 25, 2023
1 parent db290a2 commit db6f742
Show file tree
Hide file tree
Showing 11 changed files with 217 additions and 130 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@
"bos_cost_total": 96300.0,
"cols": 1.0,
"degradation": [
0.0
0.5
],
"desired_farm_size": 0.0,
"elec_eff_loss": 1.91,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@
"bos_cost_total": 0.0,
"cols": 1.0,
"degradation": [
0.0
0.5
],
"desired_farm_size": 5.0,
"elec_eff_loss": 1.91,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@
"bos_cost_total": 71400000.0,
"cols": 1.0,
"degradation": [
0.0
0.5
],
"desired_farm_size": 10.0,
"elec_eff_loss": 1.91,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@
"bos_cost_total": 96300.0,
"cols": 1.0,
"degradation": [
0.0
0.5
],
"desired_farm_size": 5.0,
"elec_eff_loss": 1.91,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@
"bos_cost_total": 71400000.0,
"cols": 1.0,
"degradation": [
0.0
0.5
],
"desired_farm_size": 10.0,
"elec_eff_loss": 1.91,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3031,7 +3031,7 @@
"bos_cost_total": 96300.0,
"cols": 1.0,
"degradation": [
0.0
0.5
],
"desired_farm_size": 100.0,
"elec_eff_loss": 1.91,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3675,7 +3675,7 @@
"bos_cost_total": 714000.0,
"cols": 8.0,
"degradation": [
0.0
0.5
],
"desired_farm_size": 10.0,
"elec_eff_loss": 1.91,
Expand Down
1 change: 0 additions & 1 deletion src/case.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,6 @@ bool Case::SaveDefaults(bool quiet)

rapidjson::StringBuffer os;
rapidjson::PrettyWriter<rapidjson::StringBuffer> writer(os); // MSPT/MP 64MB JSON, 6.7MB txt, JSON Zip 242kB
//writer.SetMaxDecimalPlaces(6); // sets small values (e.g. 2.3e-8 to zero so cannot use
doc.Accept(writer);
wxString sfn = file;
wxFileName fn(sfn);
Expand Down
15 changes: 10 additions & 5 deletions src/casewin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2079,12 +2079,17 @@ void VarSelectDialog::SetConfiguration( const wxString &tech, const wxString &fi
if ( ConfigInfo *ci = SamApp::Config().Find( tech, fin ) )
{
wxArrayString names, labels;
for( VarInfoLookup::iterator it = ci->Variables[0].begin(); it != ci->Variables[0].end();++it )
{
names.Add( it->first );
wxString label = PrettyPrintLabel(it->first, *(it->second));

labels.Add( label );
for (size_t ndxHybrid = 0; ndxHybrid < ci->Technology.size(); ndxHybrid++) {
for (VarInfoLookup::iterator it = ci->Variables[ndxHybrid].begin(); it != ci->Variables[ndxHybrid].end(); ++it) {
wxString name = it->first;
if (ci->Technology.size() > 1) name = ci->Technology[ndxHybrid].Lower() + "_" + name;

names.Add(name);
wxString label = PrettyPrintLabel(name, *(it->second));

labels.Add(label);
}
}

wxArrayString output_names, output_labels, output_units, output_groups;
Expand Down
Loading

0 comments on commit db6f742

Please sign in to comment.