Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

Commit

Permalink
Add evaporationRate control pipe command
Browse files Browse the repository at this point in the history
This replicates the -evr command line argument as a control pipe command
so that the evaporation rate can be changed in a running sandbox.

Because negative evaporation values are accepted, another way to use this
control pipe command is for global rain.

Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
  • Loading branch information
skrobinson committed Aug 3, 2021
1 parent 6c447fb commit 392203b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Sandbox.cpp
Expand Up @@ -1320,6 +1320,15 @@ void Sandbox::frame(void) {
std::cerr << "Wrong number of arguments for dippingBedThickness control pipe command" <<
std::endl;
}
} else if (isToken(tokens[0], "evaporationRate")) {
if (tokens.size() == 2) {
double evaporationRate = atof(tokens[1].c_str());
if (waterTable != 0) {
waterTable->setWaterDeposit(evaporationRate);
}
} else {
std::cerr << "Wrong number of arguments for evaporationRate control pipe command" << std::endl;
}
} else {
std::cerr << "Unrecognized control pipe command " << tokens[0] << std::endl;
}
Expand Down

0 comments on commit 392203b

Please sign in to comment.