BlinkenArea - GitList
Repositories
Blog
Wiki
dxfngc
Code
Commits
Branches
Tags
Search
Tree:
be85cfc
Branches
Tags
master
dxfngc
src
optdbl.cpp
initial version, DXFs can be read, some G-code can be produced
Stefan Schuermans
commited
be85cfc
at 2013-01-20 20:53:53
optdbl.cpp
Blame
History
Raw
/* 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; }