Skip to content

Commit

Permalink
Re #7477. Add units to Run::setProtonCharge
Browse files Browse the repository at this point in the history
  • Loading branch information
peterfpeterson committed Jul 18, 2013
1 parent 7b21769 commit a376cea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Code/Mantid/Framework/API/src/Run.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,16 @@ Kernel::Logger& Run::g_log = Kernel::Logger::get("Run");
*/
void Run::setProtonCharge(const double charge)
{
const std::string PROTON_CHARGE_UNITS("uA.hour");
if( !hasProperty(PROTON_CHARGE_LOG_NAME) )
{
addProperty(PROTON_CHARGE_LOG_NAME, charge, "uA.hour");
addProperty(PROTON_CHARGE_LOG_NAME, charge, PROTON_CHARGE_UNITS);
}
else
{
Kernel::Property *charge_prop = getProperty(PROTON_CHARGE_LOG_NAME);
charge_prop->setValue(boost::lexical_cast<std::string>(charge));
charge_prop->setUnits(PROTON_CHARGE_UNITS);
}
}

Expand Down

0 comments on commit a376cea

Please sign in to comment.