/* drawing (DXF) to G-code (NGC) converter
* Copyright 2013 Stefan Schuermans <stefan@schuermans.info>
* Copyleft: CC-BY-SA http://creativecommons.org/licenses/by-sa/3.0/
*/
#include <iostream>
#include <string>
#include "optdbl.h"
/// constructor
OptDbl:: OptDbl():
mUse(false),
mVal(0.0)
{
}
/// unset double value
void OptDbl::unset()
{
mUse = false;
mVal = 0.0;
}
/// set double value
void OptDbl::set(double val)
{
mUse = true;
mVal = val;
}
/**
* @brief output G-code command to stream
* @param[in] stream to write to
* @param[in] prefix to output
*/
void OptDbl::toStrm(std::ostream &strm, const std::string &prefix) const
{
if (mUse)
strm << prefix << mVal;
}