Rename Image class to Label

This commit is contained in:
2023-12-03 11:13:15 +01:00
parent 5f5c0f0f97
commit 28308dccad
12 changed files with 61 additions and 29 deletions

View File

@@ -39,7 +39,7 @@
#include "PrinterDriverFactory.hpp"
#include "PtouchPrint.hpp"
#include "graphics/Bitmap.hpp"
#include "graphics/Image.hpp"
#include "graphics/Label.hpp"
#include "libusbwrap/UsbDeviceFactory.hpp"
namespace ptprnt {
@@ -59,7 +59,7 @@ int PtouchPrint::init(int argc, char** argv) {
if (mVerboseFlag) {
setupLogger(spdlog::level::debug);
} else {
setupLogger(spdlog::level::err);
setupLogger(spdlog::level::warn);
}
if (!mUsbDeviceFactory.init()) {
@@ -98,6 +98,11 @@ int PtouchPrint::run() {
//printer->printBitmap(bm);
//printer->printText("wurst", 1);
if (0 == mCommands.size()) {
spdlog::warn("No command specified, nothing to do...");
return 0;
}
for (auto& cmd : mCommands) {
switch (cmd.first) {
case CliCmdType::Text:
@@ -152,7 +157,12 @@ std::vector<std::shared_ptr<IPrinterDriver>> PtouchPrint::getCompatiblePrinters(
void PtouchPrint::setupLogger(spdlog::level::level_enum lvl) {
auto consoleSink = std::make_shared<spdlog::sinks::stdout_color_sink_mt>();
consoleSink->set_level(lvl);
consoleSink->set_pattern("%^%L:%$ %v");
if (spdlog::level::level_enum::debug == lvl || spdlog::level::level_enum::trace == lvl) {
// This will enable file and line number for debug and trace macros
consoleSink->set_pattern("%^%L:%$ %v (%s:%#)");
} else {
consoleSink->set_pattern("%^%L:%$ %v");
}
auto fileSink = std::make_shared<spdlog::sinks::basic_file_sink_mt>("ptprnt.log", true);
fileSink->set_level(spdlog::level::trace);