build-local contains bash-isms. depend on bash

The *buntu's come with dash as the default shell and build-local.sh
fails to build because of it as it requires bash.

Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
Git should not track *~ and .*.swp files

*~ and .*.swp files are backup files used by editors. Git should always
ignore them.

Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
Add missing algorithm.h define for std::count

std::count requires algorithm.h to be included or the compiler gives an
error.

Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
Fix compiler warnings/errors due to wrong types

The compiler warns and errors due to the mis-use of unsigned vs signed
and size_t vs int in the unittests.

Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
Correct the usage of %zi vs %d in printf

currentLine, totalLines, bufferedLines are all ints and thus do not
require the 'z' length modifier that is required for size_t.

Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
Add a -p option to choose which printer the print server controls

When not using UCI to obtain the configuration settings, a dummy
variable forces a makerbot (or whatever printer) as default. Using -p
one of the available printers can be configured via the commandline.
When -p is not supplied, uci (or the dummy var) is used instead.

Missing still is to print the list of available printers when using -p
help or an empty -p. Since there is a function in the 'TODO' area to
print a list of printers, this item is also TODO.

Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
Require a device ID for several actions, fixes segfault

THe AT_GET_TEST an AT_GET_PROGRESS actions require a device ID when,
also when called from -g. If this is not done, calling these actions via
-g causes segfaults.

Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
Fix segfault when doing serial communication.

The serial module does not account for the \0 character when mallocing.
Request 1 extra byte of memory to account for \0.

Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
Use getopt's api as intended, store the return value in an int, not char

getopt returns an integer which is -1 when there is no more options left to be parsed.
Currently this result is stored in a char, which by definition is undefined whether
it is signed or unsigned. On ARM it may be unsigned and thus -1 never happens.

Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
Merge branch 'oliv3r-develop' into develop
Improve handling of cmdline options in server.
Add support to list supprted printer drivers and supported models.
Fix CMakeLists.txt to build with all warnings enabled.
Remove dummy printer type from settings.c.
Fix wrong type in test_root.h.
Minor stylistic changes.
Comment in gcode issue fix 1

Remove empty line at start of part that’s checked
Comment in geode issue fix 2

Make sure the buffer ends with an empty line, so new lines are added on
their own line
Pad levels in log messages to improve readability.
Added Builder3D printers to supported printers
getNextLine/eraseLine in GCodeBuffer now remove as many requested lines as possible and return actual count of removed lines.
Do not convert gcode to s3g before printing has been started.
Fix line counting in makerbot driver.
Merge branch 'develop' into feature/mb-gcodebuffer

Conflicts:
	.gitignore
	src/drivers/DriverFactory.cpp
	src/drivers/GCodeBuffer.cpp
	src/frontends/cmdline/fe_cmdline.c
	src/server/main.cpp
	src/settings.c
Change gcode buffer to keep gpx macro comments for use with makerbot driver.
Fix potential crash when single comment line is added to gcode buffer.
Update gcode buffer unit tests to account for changes in getNextLine/eraseLine.
Fix bug in gcode buffer.