MCPcopy Create free account
hub / github.com/NatLabRockies/SAM / QueryRates

Method QueryRates

src/urdb.cpp:1302–1330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1300}
1301
1302bool OpenEIUtilityRateDialog::QueryRates(const wxString &utility_name)
1303{
1304 bool ret = true;
1305 wxBusyInfo busy("Getting available rates...", this);
1306 lblStatus->SetLabel("Loading rates...");
1307
1308 mUtilityRates.clear();
1309 wxString err;
1310
1311 // get rates
1312 if (!api.QueryUtilityRates(utility_name, mUtilityRates, &err))
1313 {
1314 busy.~wxBusyInfo();
1315// wxMessageBox("Utility Rate Query Error\n\n" + err, "URDB Download Message");
1316// return false;
1317 ret = false;
1318 mUtilityRates.clear();
1319 }
1320
1321 lblRateStatus->SetLabel(wxString::Format("%d rates available for %s", (int)mUtilityRates.size(), utility_name));
1322
1323 if (mUtilityRates.size() == 0)
1324 lblStatus->SetLabel(wxString::Format("No rates for %s.", utility_name));
1325 else
1326 lblStatus->SetLabel("Ready.");
1327
1328 UpdateRateList();
1329 return true;
1330}
1331
1332void OpenEIUtilityRateDialog::UpdateRateList()
1333{

Callers

nothing calls this directly

Calls 4

QueryUtilityRatesMethod · 0.80
sizeMethod · 0.80
SetLabelMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected