Implement basic layouting
Some checks failed
Build ptprnt / build (push) Failing after 37s

This commit is contained in:
2024-04-28 17:37:09 +02:00
parent 37ee7c10f1
commit bb7ab6239d
8 changed files with 261 additions and 110 deletions

View File

@@ -32,7 +32,7 @@
#include "spdlog/fmt/bin_to_hex.h"
// as long as DRYRUN is defined, no data is actually send to the printer, we need to save some tape ;)
//#define DRYRUN
#define DRYRUN
namespace ptprnt::printer {
@@ -119,7 +119,7 @@ bool P700Printer::detachUsbDevice() {
bool P700Printer::printBitmap(const graphics::Bitmap<graphics::ALPHA8>& bitmap) {
#ifdef DRYRUN
SPDLOG_DEBUG("DRYRUN enabled");
spdlog::debug("DRYRUN enabled");
for (unsigned int lineNo = 0; lineNo < bitmap.getHeight(); lineNo++) {
auto line = bitmap.getLine(lineNo);
auto monoLine = graphics::Monochrome(*line);
@@ -158,26 +158,6 @@ bool P700Printer::printBitmap(const graphics::Bitmap<graphics::ALPHA8>& bitmap)
return true;
}
bool P700Printer::setText(const std::string& text) {
return true;
};
bool P700Printer::setFont(const std::string& text) {
return true;
};
bool P700Printer::setFontSize(uint8_t fontSize) {
return true;
};
bool P700Printer::setHAlign(HAlignPosition hpos) {
return true;
};
bool P700Printer::setVAlign(VAlignPosition vpos) {
return true;
}
bool P700Printer::print() {
send(p700::commands::LF);
send(p700::commands::FF);
@@ -201,7 +181,7 @@ bool P700Printer::send(const std::vector<uint8_t>& data) {
}
#else
tx = data.size();
spdlog::info("USB raw data(len {}): {}", data.size(), spdlog::to_hex(data));
spdlog::trace("USB raw data(len {}): {}", data.size(), spdlog::to_hex(data));
#endif
if (tx != static_cast<int>(data.size())) {