Skip to content

Commit

Permalink
Add error handling on epsplumes background
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvielamythepaut committed Jan 11, 2023
1 parent 4ddd74a commit 966d614
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/visualisers/EpsGraph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2664,6 +2664,17 @@ void EpsPlume::verticalprofile(Data& data, BasicGraphicsObjectContainer& visitor
void EpsPlume::background(BasicGraphicsObjectContainer& visitor) {
// Add background
const Transformation& transformation = visitor.transformation();
if ( background_level_list_.empty() )
return;

if ( background_colour_list_.size() < background_level_list_.size() + 1 ) {
MagLog::error() << "Note enough colours for the EpsPlumes background " << endl;
MagLog::error() << "should be at least " << background_level_list_.size() + 1 << " but found " << background_colour_list_.size() << endl;
MagLog::error() << " Please check your colour list " << endl;
return;
}



double from = transformation.getMinY();
auto colour = background_colour_list_.begin();
Expand Down

0 comments on commit 966d614

Please sign in to comment.