Skip to content

Commit

Permalink
Fix #1608 saving and loading project files (#1609)
Browse files Browse the repository at this point in the history
Defaults have only slight changes in PTES and ETES
  • Loading branch information
sjanzou authored Nov 29, 2023
1 parent 863a0dd commit a7c0c9e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/case.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ bool Case::Read( wxInputStream &_i )
if (di.wrong_type.size() > 0) {
wxLogStatus("\twrong type: " + wxJoin(di.wrong_type, ','));
}
if (m_vals.size() > m_oldVals.size()) {
if (m_vals[i].size() > m_oldVals[i].size()) {
for (auto& newVal : m_vals[i]) {
if (!m_oldVals[i].Get(newVal.first))
wxLogStatus("%s, %s configuration variable %s missing from project file", tech.c_str(), fin.c_str(), newVal.first.c_str());
Expand Down
7 changes: 4 additions & 3 deletions src/casewin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,10 @@ void CaseWindow::OnCaseEvent( Case *, CaseEvent &evt )
else if ( evt.GetType() == CaseEvent::CONFIG_CHANGED )
{
wxString sel = m_inputPageList->GetStringSelection();

// #1600 and #1608
m_case->LoadDefaults();

UpdateConfiguration();

// if (!sel.empty())
Expand Down Expand Up @@ -1357,9 +1361,6 @@ void CaseWindow::UpdateConfiguration()

m_case->BaseCase().Clear(); // reset for UpdateResults

// Testing for #1600
m_case->LoadDefaults();

wxString Ts(SamApp::Config().Options(cfg->TechnologyFullName).ShortName);
if ( Ts.IsEmpty() ) Ts = cfg->TechnologyFullName;

Expand Down
4 changes: 2 additions & 2 deletions test_results_win64.csv
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ Standalone Battery,Merchant Plant,-8397703,26.6181,NA,; Warning: IRR at end of a
Standalone Battery,Leveraged Partnership Flip,-8397703,78.2835,72.514,; Warning: IRR at end of analysis period is not a number (NaN). This can indicate that revenues are too low to cover costs, or that they are excessively high compared to costs. Warning: IRR in target year is not a number (NaN). This can indicate that revenues are too low to cover costs, or that they are excessively high compared to costs. Warning: NPV is $-3.12112e+07. A negative NPV indicates project costs are higher than revenues.
Standalone Battery,All Equity Partnership Flip,-8397703,79.1754,72.514,; Warning: IRR at end of analysis period is not a number (NaN). This can indicate that revenues are too low to cover costs, or that they are excessively high compared to costs. Warning: IRR in target year is not a number (NaN). This can indicate that revenues are too low to cover costs, or that they are excessively high compared to costs. Warning: NPV is $-3.85976e+07. A negative NPV indicates project costs are higher than revenues.
Standalone Battery,Sale Leaseback,-8397703,80.5079,72.514,; Warning: IRR at end of analysis period is not a number (NaN). This can indicate that revenues are too low to cover costs, or that they are excessively high compared to costs. Warning: NPV is $-4.61131e+07. A negative NPV indicates project costs are higher than revenues. Warning: NPV is $-8.70063e+07. A negative NPV indicates project costs are higher than revenues.
ETES,Single Owner,-466406720,14.8178,7.40269,;
PTES,Single Owner,-197545536,18.6659,10.3649,;
ETES,Single Owner,-466572064,14.7945,7.40855,;
PTES,Single Owner,-197595520,18.6636,10.3676,;
Physical Trough,Single Owner,376952608,14.1072,12.3469,;
Physical Trough,Merchant Plant,376952608,13.1892,NA,;
Physical Trough,Leveraged Partnership Flip,376952608,14.3762,12.3469,;
Expand Down

0 comments on commit a7c0c9e

Please sign in to comment.