BlinkenArea - GitList
Repositories
Blog
Wiki
dxfngc
Code
Commits
Branches
Tags
Search
Tree:
5dbde65
Branches
Tags
master
dxfngc
src
cmdparser.h
implement scaling
Stefan Schuermans
commited
5dbde65
at 2013-07-06 20:31:45
cmdparser.h
Blame
History
Raw
/* drawing (DXF) to G-code (NGC) converter * Copyright 2013 Stefan Schuermans <stefan@schuermans.info> * Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html */ #ifndef CMDPARSER_H #define CMDPARSER_H #include <iostream> #include <string> #include "drawing.h" #include "gcode.h" #include "layer.h" #include "polygons.h" #include "settings.h" /// command parser class CmdParser { public: /** * @brief get layer by name from stream * @param[in] strm stream to read layer name from * @param[out] name layer name from stream * @param[out] layer layer indicated by name from stream * @return if layer could be found */ bool getLayer(std::istream &strm, std::string &name, const Layer *&layer) const; /** * @brief get layer by name from stream and convert to polygons * @param[in] strm stream to read layer name from * @param[out] name layer name from stream * @param[out] layer layer indicated by name from stream * @param[in,out] polys polygons created from layer * @return if layer could be found and converted to polygons */ bool getLayerPolys(std::istream &strm, std::string &name, const Layer *&layer, Polygons &polys) const; /** * @brief process clear_ngc command * @param[in] strm stream to read command arguments from * @return if processing command was successful */ bool procCmd_clear_ngc(std::istream &strm); /** * @brief process cmd command * @param[in] strm stream to read command arguments from * @return if processing command was successful */ bool procCmd_cmd(std::istream &strm); /** * @brief process cut command * @param[in] strm stream to read command arguments from * @return if processing command was successful */ bool procCmd_cut(std::istream &strm); /** * @brief process cut_inside command * @param[in] strm stream to read command arguments from * @return if processing command was successful */ bool procCmd_cut_inside(std::istream &strm); /** * @brief process cut_outside command * @param[in] strm stream to read command arguments from * @return if processing command was successful */ bool procCmd_cut_outside(std::istream &strm); /** * @brief process cut_pocket command * @param[in] strm stream to read command arguments from * @return if processing command was successful */ bool procCmd_cut_pocket(std::istream &strm); /** * @brief process read_dxf command * @param[in] strm stream to read command arguments from * @return if processing command was successful */ bool procCmd_read_dxf(std::istream &strm); /** * @brief process set_base_z command * @param[in] strm stream to read command arguments from * @return if processing command was successful */ bool procCmd_set_base_z(std::istream &strm); /** * @brief process set_cut_z command * @param[in] strm stream to read command arguments from * @return if processing command was successful */ bool procCmd_set_cut_z(std::istream &strm); /** * @brief process set_cut_z_step command * @param[in] strm stream to read command arguments from * @return if processing command was successful */ bool procCmd_set_cut_z_step(std::istream &strm); /** * @brief process set_dwell_time command * @param[in] strm stream to read command arguments from * @return if processing command was successful */ bool procCmd_set_dwell_time(std::istream &strm); /** * @brief process set_feed_drill command * @param[in] strm stream to read command arguments from * @return if processing command was successful */ bool procCmd_set_feed_drill(std::istream &strm); /** * @brief process set_feed_mill command * @param[in] strm stream to read command arguments from * @return if processing command was successful */ bool procCmd_set_feed_mill(std::istream &strm); /** * @brief process set_layer_mode command * @param[in] strm stream to read command arguments from * @return if processing command was successful */ bool procCmd_set_layer_mode(std::istream &strm); /** * @brief process set_move_z command * @param[in] strm stream to read command arguments from * @return if processing command was successful */ bool procCmd_set_move_z(std::istream &strm); /** * @brief process set_offset_x command * @param[in] strm stream to read command arguments from * @return if processing command was successful */ bool procCmd_set_offset_x(std::istream &strm); /** * @brief process set_offset_y command * @param[in] strm stream to read command arguments from * @return if processing command was successful */ bool procCmd_set_offset_y(std::istream &strm); /** * @brief process set_precision command * @param[in] strm stream to read command arguments from * @return if processing command was successful */ bool procCmd_set_precision(std::istream &strm); /** * @brief process set_rotation_z command * @param[in] strm stream to read command arguments from * @return if processing command was successful */ bool procCmd_set_rotation_z(std::istream &strm); /** * @brief process set_scale_x command * @param[in] strm stream to read command arguments from * @return if processing command was successful */ bool procCmd_set_scale_x(std::istream &strm); /** * @brief process set_scale_y command * @param[in] strm stream to read command arguments from * @return if processing command was successful */ bool procCmd_set_scale_y(std::istream &strm); /** * @brief process set_tool_diameter command * @param[in] strm stream to read command arguments from * @return if processing command was successful */ bool procCmd_set_tool_diameter(std::istream &strm); /** * @brief process write_ngc command * @param[in] strm stream to read command arguments from * @return if processing command was successful */ bool procCmd_write_ngc(std::istream &strm); /** * @brief process command from line of text * @param[in] strLine line containing command to process * @return if processing command was successful */ bool procLine(const std::string &strLine); /** * @brief process commands from a stream * @param[in] strm stream to process * @param[in] if processing stream was successful * @return if processing commands was successful */ bool procStream(std::istream &strm); /** * @brief process commands from a file * @param[in] strFileName name of file to process * @param[in] if processing the file was successful * @return if processing commands was successful */ bool procFile(const std::string &strFileName); std::string mBaseDir; ///< base directory taken from name of file Settings mSettings; ///< settings for G-code generation Drawing mDrawing; ///< current drawing GCode mGCode; ///< G-code created so far }; #endif // #ifndef CMDPARSER_H