Skip to content

Commit

Permalink
Added graceful degradation path if dialog or instrument isn't usable …
Browse files Browse the repository at this point in the history
…offline yet
  • Loading branch information
azonenberg committed Nov 21, 2023
1 parent 45d255d commit 2ce02e1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
20 changes: 10 additions & 10 deletions src/ngscopeclient/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2306,8 +2306,8 @@ bool MainWindow::LoadDialogs(const YAML::Node& node)
m_session.AddMultimeterDialog(meter);
else
{
ShowErrorPopup("Invalid meter", "Multimeter could not be loaded");
return false;
ShowErrorPopup("Invalid meter", "Multimeter dialog references nonexistent instrument");
continue;
}
}
}
Expand All @@ -2324,8 +2324,8 @@ bool MainWindow::LoadDialogs(const YAML::Node& node)
AddDialog(make_shared<FunctionGeneratorDialog>(gen, &m_session));
else
{
ShowErrorPopup("Invalid function generator", "Function generator could not be loaded");
return false;
ShowErrorPopup("Invalid function generator", "Function generator dialog references nonexistent instrument");
continue;
}
}
}
Expand All @@ -2342,8 +2342,8 @@ bool MainWindow::LoadDialogs(const YAML::Node& node)
AddDialog(make_shared<PowerSupplyDialog>(psu, m_session.GetPSUState(psu), &m_session));
else
{
ShowErrorPopup("Invalid PSU", "PSU could not be loaded");
return false;
ShowErrorPopup("Invalid PSU", "PSU dialog references nonexistent instrument");
continue;
}
}
}
Expand All @@ -2360,8 +2360,8 @@ bool MainWindow::LoadDialogs(const YAML::Node& node)
AddDialog(make_shared<BERTDialog>(bert, m_session.GetBERTState(bert), &m_session));
else
{
ShowErrorPopup("Invalid BERT", "BERT could not be loaded");
return false;
ShowErrorPopup("Invalid BERT", "BERT dialog references nonexistent instrument");
continue;
}
}
}
Expand All @@ -2378,8 +2378,8 @@ bool MainWindow::LoadDialogs(const YAML::Node& node)
AddDialog(make_shared<LoadDialog>(load, m_session.GetLoadState(load), &m_session));
else
{
ShowErrorPopup("Invalid load", "Load could not be loaded");
return false;
ShowErrorPopup("Invalid load", "Load dialog references nonexistent instrument");
continue;
}
}
}
Expand Down
28 changes: 14 additions & 14 deletions src/ngscopeclient/Session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1023,8 +1023,8 @@ bool Session::PreLoadLoad(int version, const YAML::Node& node, bool online)
node["args"].as<string>()
);
*/
LogError("offline loading of loads not implemented yet");
return false;
LogError("offline loading of loads not implemented yet\n");
return true;
}

//Make any config settings to the instrument from our preference settings
Expand Down Expand Up @@ -1098,8 +1098,8 @@ bool Session::PreLoadMisc(int version, const YAML::Node& node, bool online)
node["args"].as<string>()
);
*/
LogError("offline loading of misc instruments not implemented yet");
return false;
LogError("offline loading of misc instruments not implemented yet\n");
return true;
}

//Make any config settings to the instrument from our preference settings
Expand Down Expand Up @@ -1173,8 +1173,8 @@ bool Session::PreLoadBERT(int version, const YAML::Node& node, bool online)
node["args"].as<string>()
);
*/
LogError("offline loading of BERTs not implemented yet");
return false;
LogError("offline loading of BERTs not implemented yet\n");
return true;
}

//Make any config settings to the instrument from our preference settings
Expand Down Expand Up @@ -1248,8 +1248,8 @@ bool Session::PreLoadMultimeter(int version, const YAML::Node& node, bool online
node["args"].as<string>()
);
*/
LogError("offline loading of multimeters not implemented yet");
return false;
LogError("offline loading of multimeters not implemented yet\n");
return true;
}

//Make any config settings to the instrument from our preference settings
Expand Down Expand Up @@ -1323,8 +1323,8 @@ bool Session::PreLoadPowerSupply(int version, const YAML::Node& node, bool onlin
node["args"].as<string>()
);
*/
LogError("offline loading of power supplies not implemented yet");
return false;
LogError("offline loading of power supplies not implemented yet\n");
return true;
}

//Make any config settings to the instrument from our preference settings
Expand Down Expand Up @@ -1398,8 +1398,8 @@ bool Session::PreLoadRFSignalGenerator(int version, const YAML::Node& node, bool
node["args"].as<string>()
);
*/
LogError("offline loading of RF generators not implemented yet");
return false;
LogError("offline loading of RF generators not implemented yet\n");
return true;
}

//Make any config settings to the instrument from our preference settings
Expand Down Expand Up @@ -1473,8 +1473,8 @@ bool Session::PreLoadFunctionGenerator(int version, const YAML::Node& node, bool
node["args"].as<string>()
);
*/
LogError("offline loading of function generators not implemented yet");
return false;
LogError("offline loading of function generators not implemented yet\n");
return true;
}

//Make any config settings to the instrument from our preference settings
Expand Down

0 comments on commit 2ce02e1

Please sign in to comment.