Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libbgcode for openSUSE:Factory checked in at 2024-09-01 19:21:06 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libbgcode (Old) and /work/SRC/openSUSE:Factory/.libbgcode.new.2698 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libbgcode" Sun Sep 1 19:21:06 2024 rev:2 rq:1197511 version:0.2.0+git20240829.b5c57c4 Changes: -------- --- /work/SRC/openSUSE:Factory/libbgcode/libbgcode.changes 2024-01-03 12:23:52.905052077 +0100 +++ /work/SRC/openSUSE:Factory/.libbgcode.new.2698/libbgcode.changes 2024-09-01 19:21:29.824187848 +0200 @@ -1,0 +2,22 @@ +Thu Aug 29 16:12:03 UTC 2024 - Ben Greiner <c...@bnavigator.de> + +- Update to 0.2.0+git20240829.b5c57c4 + * Added filament_abrasive and nozzle_high_flow into the + conversion function + * Updated conversion of print and printer metadata to match + PrusaSlicer export + * read extruder_colour in connect metadata + * Added 'S' to the list of parameter for which MeatPack keeps the + leading space + * Fixed out of bound access in function MeatPack::unbinarize() + * cancel objects info in metadata + * method for getting Connect metadata at once + * method for reading metadata needed by oCnnect + * Fix messed up BlockHeader binding + * importing memopen to pybgcode + * Add memopen function to pybgcode to open byte buffers. No Win + support! + * Fixed bug in conversion from binary to ascii gcode letting 'G29 + G' lines be translated to 'G29G', missing the space + +------------------------------------------------------------------- --- /work/SRC/openSUSE:Factory/libbgcode/python-pybgcode.changes 2024-01-03 12:23:53.513074293 +0100 +++ /work/SRC/openSUSE:Factory/.libbgcode.new.2698/python-pybgcode.changes 2024-09-01 19:21:30.136200623 +0200 @@ -1,0 +2,22 @@ +Thu Aug 29 16:12:09 UTC 2024 - Ben Greiner <c...@bnavigator.de> + +- Update to 0.2.0+git20240829.b5c57c4 + * Added filament_abrasive and nozzle_high_flow into the + conversion function + * Updated conversion of print and printer metadata to match + PrusaSlicer export + * read extruder_colour in connect metadata + * Added 'S' to the list of parameter for which MeatPack keeps the + leading space + * Fixed out of bound access in function MeatPack::unbinarize() + * cancel objects info in metadata + * method for getting Connect metadata at once + * method for reading metadata needed by oCnnect + * Fix messed up BlockHeader binding + * importing memopen to pybgcode + * Add memopen function to pybgcode to open byte buffers. No Win + support! + * Fixed bug in conversion from binary to ascii gcode letting 'G29 + G' lines be translated to 'G29G', missing the space + +------------------------------------------------------------------- Old: ---- libbgcode-0.2.0+git20231219.7aaf717.tar.xz New: ---- libbgcode-0.2.0+git20240829.b5c57c4.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libbgcode.spec ++++++ --- /var/tmp/diff_new_pack.H6UlDY/_old 2024-09-01 19:21:30.904232068 +0200 +++ /var/tmp/diff_new_pack.H6UlDY/_new 2024-09-01 19:21:30.908232231 +0200 @@ -1,7 +1,7 @@ # # spec file for package libbgcode # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -22,21 +22,20 @@ %define soversion 0_2_0 Name: libbgcode # Use the set_version source service for adjusting the field below -Version: 0.2.0+git20231219.7aaf717 +Version: 0.2.0+git20240829.b5c57c4 Release: 0 Summary: Prusa Block & Binary G-code reader / writer / converter License: AGPL-3.0-only URL: https://github.com/prusa3d/libbgcode Source0: libbgcode-%{version}.tar.xz BuildRequires: boost-devel >= 1.78 -BuildRequires: cmake BuildRequires: c++_compiler +BuildRequires: cmake BuildRequires: heatshrink BuildRequires: libboost_nowide-devel >= 1.78 BuildRequires: zlib-devel -BuildRequires: cmake(heatshrink) BuildRequires: (cmake(Catch2) >= 2.9 with cmake(Catch2) < 3) - +BuildRequires: cmake(heatshrink) %description A new G-code file format featuring the following improvements over the legacy G-code: ++++++ python-pybgcode.spec ++++++ --- /var/tmp/diff_new_pack.H6UlDY/_old 2024-09-01 19:21:30.940233541 +0200 +++ /var/tmp/diff_new_pack.H6UlDY/_new 2024-09-01 19:21:30.944233706 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-pybgcode # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,10 +15,11 @@ # Please submit bugfixes or comments via https://bugs.opensuse.org/ # + %define pyversion 0.2.0 Name: python-pybgcode # Use the set_version source service for adjusting the field below -Version: 0.2.0+git20231219.7aaf717 +Version: 0.2.0+git20240829.b5c57c4 Release: 0 Summary: Python bindings for libbgcode License: AGPL-3.0-only @@ -28,15 +29,15 @@ Source99: python-pybgcode.rpmlintrc BuildRequires: %{python_module devel >= 3.7} BuildRequires: %{python_module pip} -BuildRequires: %{python_module pytest} -BuildRequires: %{python_module pybind11-devel} BuildRequires: %{python_module py-build-cmake >= 0.1.8} -BuildRequires: python-rpm-macros -BuildRequires: git-core +BuildRequires: %{python_module pybind11-devel} +BuildRequires: %{python_module pytest} +BuildRequires: boost-devel >= 1.78 BuildRequires: c++_compiler -BuildRequires: cmake(LibBGCode) = %{pyversion} +BuildRequires: git-core BuildRequires: libboost_nowide-devel >= 1.78 -BuildRequires: boost-devel >= 1.78 +BuildRequires: python-rpm-macros +BuildRequires: cmake(LibBGCode) = %{pyversion} %python_subpackages %description ++++++ libbgcode-0.2.0+git20231219.7aaf717.tar.xz -> libbgcode-0.2.0+git20240829.b5c57c4.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libbgcode-0.2.0+git20231219.7aaf717/.github/workflows/build.yml new/libbgcode-0.2.0+git20240829.b5c57c4/.github/workflows/build.yml --- old/libbgcode-0.2.0+git20231219.7aaf717/.github/workflows/build.yml 2023-12-19 12:40:39.000000000 +0100 +++ new/libbgcode-0.2.0+git20240829.b5c57c4/.github/workflows/build.yml 2024-08-29 11:15:55.000000000 +0200 @@ -313,7 +313,7 @@ # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands run: | - python3 -m pip install build + brew install python-build cmake -E make_directory ${{github.workspace}}/build cmake -E make_directory ${{github.workspace}}/build/dist cmake -E make_directory ${{github.workspace}}/example/build_fp @@ -365,7 +365,7 @@ - name: Build Python wheel working-directory: ${{github.workspace}} shell: bash - run: python3 -m build --wheel + run: pyproject-build --wheel - name: Build example (using find_package) working-directory: ${{github.workspace}}/example/build_fp @@ -392,4 +392,4 @@ if: success() with: name: libbgcode-python-mac - path: ${{github.workspace}}/dist/ \ No newline at end of file + path: ${{github.workspace}}/dist/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libbgcode-0.2.0+git20231219.7aaf717/.gitignore new/libbgcode-0.2.0+git20240829.b5c57c4/.gitignore --- old/libbgcode-0.2.0+git20231219.7aaf717/.gitignore 2023-12-19 12:40:39.000000000 +0100 +++ new/libbgcode-0.2.0+git20240829.b5c57c4/.gitignore 2024-08-29 11:15:55.000000000 +0200 @@ -8,3 +8,4 @@ Testing .py-build* __pycache__ +venv diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libbgcode-0.2.0+git20231219.7aaf717/pybgcode/pybgcode/__init__.py new/libbgcode-0.2.0+git20240829.b5c57c4/pybgcode/pybgcode/__init__.py --- old/libbgcode-0.2.0+git20231219.7aaf717/pybgcode/pybgcode/__init__.py 2023-12-19 12:40:39.000000000 +0100 +++ new/libbgcode-0.2.0+git20240829.b5c57c4/pybgcode/pybgcode/__init__.py 2024-08-29 11:15:55.000000000 +0200 @@ -20,6 +20,7 @@ get_config, is_open, open, + memopen, read_header, read_next_block_header, rewind, @@ -134,3 +135,79 @@ return get_metadata(gcodefile, header, block_header, metadata_block_class) +# this list was taken from gcode-metadata library +connect_metadata_keys = [ + "filament used [cm3]", "filament used [mm]", "filament used [g]", + "filament cost", "filament_type", "temperature", "bed_temperature", + "nozzle_diameter", "estimated printing time (normal mode)", + "printer_model", "layer_height", "fill_density", "brim_width", + "support_material", "ironing", "quiet_percent_present", + "quiet_left_present", "quiet_change_in_present", "normal_percent_present", + "normal_left_present", "normal_change_in_present", "layer_info_present", + "max_layer_z", "objects_info", "extruder_colour"] + + +def filter_connect_metadata(output: dict) -> dict: + all_metadata = {**output['print'], **output['printer']} + connect_metadata = { + key: item for key, item in all_metadata.items() + if (key in connect_metadata_keys and item != '""')} + return {'thumbnails': output['thumbnails'], 'metadata': connect_metadata} + + +def read_connect_metadata(wrapper: FILEWrapper): + """Read metadata from binary gcode file.""" + output = {'print': None, 'thumbnails': [], 'printer': None} + + # read file header + res, header = get_header(wrapper) + block_header = BlockHeader() + while True: + # read next block header + res = read_next_block_header(wrapper, header, block_header) + if res != EResult.Success: + raise ResultError(res) + if block_header.type == 0: + # file metadata - we do not need them + metadata_block = FileMetadataBlock() + res = metadata_block.read_data( + wrapper, header, block_header) + if res != EResult.Success: + raise ResultError(res) + elif block_header.type in (1, 2): + # GCode block or Slicer metadata block - no more metadata + return filter_connect_metadata(output) + elif block_header.type == 3: + # printer metadata - we need them + metadata_block = PrinterMetadataBlock() + res = metadata_block.read_data( + wrapper, header, block_header) + if res != EResult.Success: + raise ResultError(res) + output['printer'] = dict( + metadata_block.raw_data) if metadata_block else None + elif block_header.type == 4: + # print metdata - we need them + metadata_block = PrintMetadataBlock() + res = metadata_block.read_data( + wrapper, header, block_header) + if res != EResult.Success: + raise ResultError(res) + output['print'] = dict( + metadata_block.raw_data) if metadata_block else None + return filter_connect_metadata(output) + elif block_header.type == 5: + # thumbnails block + thumbnail_block = ThumbnailBlock() + res = thumbnail_block.read_data(wrapper, header, block_header) + if res != EResult.Success: + raise ResultError(res) + output['thumbnails'].append( + {"meta": thumbnail_block.params, + "bytes": thumbnail_block.data()}) + else: + # not documented value + return filter_connect_metadata(output) + + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libbgcode-0.2.0+git20231219.7aaf717/pybgcode/pybgcode.cpp new/libbgcode-0.2.0+git20240829.b5c57c4/pybgcode/pybgcode.cpp --- old/libbgcode-0.2.0+git20231219.7aaf717/pybgcode/pybgcode.cpp 2023-12-19 12:40:39.000000000 +0100 +++ new/libbgcode-0.2.0+git20240829.b5c57c4/pybgcode/pybgcode.cpp 2024-08-29 11:15:55.000000000 +0200 @@ -96,6 +96,27 @@ py::arg("name"), py::arg("mode")); +// Opening a byte buffer in python. This will only be available on Unix platforms +#ifndef _MSC_VER + m.def("memopen", [](py::bytes buffer) { + std::string_view cbuf(buffer); + + // Ugly but will work, despite the const_cast, the buffer will not + // be modified. Open mode is "rb" + FILE *fptr = fmemopen(const_cast<void *>(static_cast<const void *>(cbuf.data())), + cbuf.size(), + "rb"); + + if (!fptr) { + throw std::runtime_error(std::strerror(errno)); + } + + return std::make_unique<FILEWrapper>(fptr); + }, + R"pbdoc(Open a gcode memory buffer to process using pybgcode)pbdoc", + py::arg("buffer")); +#endif + m.def("close", [](FILEWrapper &f) { f.close(); }, R"pbdoc(Close a previously opened file)pbdoc", py::arg("file")); m.def("is_open", [](const FILEWrapper &f) { return f.fptr != nullptr; }, @@ -180,9 +201,9 @@ .def(py::init<>()) .def_readonly("type", &core::BlockHeader::type) .def_readonly("compression", &core::BlockHeader::compression) - .def_readonly("uncompressed_size", &core::BlockHeader::type) + .def_readonly("uncompressed_size", &core::BlockHeader::uncompressed_size) .def_readonly("compressed_size", &core::BlockHeader::compressed_size) - .def("get_size()", &core::BlockHeader::get_size) + .def("get_size", &core::BlockHeader::get_size) .def("read", [](core::BlockHeader &self, FILEWrapper &file) { return self.read(*file.fptr); }) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libbgcode-0.2.0+git20231219.7aaf717/pybgcode/tests/test_convert.py new/libbgcode-0.2.0+git20240829.b5c57c4/pybgcode/tests/test_convert.py --- old/libbgcode-0.2.0+git20231219.7aaf717/pybgcode/tests/test_convert.py 2023-12-19 12:40:39.000000000 +0100 +++ new/libbgcode-0.2.0+git20240829.b5c57c4/pybgcode/tests/test_convert.py 2024-08-29 11:15:55.000000000 +0200 @@ -8,7 +8,9 @@ EResult, EThumbnailFormat, read_thumbnails, - read_metadata + read_metadata, + read_connect_metadata, + connect_metadata_keys ) # pylint: disable=missing-function-docstring @@ -82,6 +84,13 @@ assert print_metadata == TEST_PRINT_METADATA slicer_metadata = read_metadata(thumb_f, 'slicer') assert len(slicer_metadata) == TEST_LEN_SLICER_METADATA + + all_metadata = read_connect_metadata(thumb_f) + # ; extruder_colour = "" filtered out + assert 'extruder_colour' not in all_metadata['metadata'] + assert len(all_metadata['thumbnails']) == TEST_THUMBNAILS + for key in all_metadata['metadata'].keys(): + assert key in connect_metadata_keys pybgcode.close(thumb_f) # write thumbnails to png files diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libbgcode-0.2.0+git20231219.7aaf717/src/LibBGCode/binarize/meatpack.cpp new/libbgcode-0.2.0+git20240829.b5c57c4/src/LibBGCode/binarize/meatpack.cpp --- old/libbgcode-0.2.0+git20231219.7aaf717/src/LibBGCode/binarize/meatpack.cpp 2023-12-19 12:40:39.000000000 +0100 +++ new/libbgcode-0.2.0+git20240829.b5c57c4/src/LibBGCode/binarize/meatpack.cpp 2024-08-29 11:15:55.000000000 +0200 @@ -383,8 +383,10 @@ 'X', 'Y', 'Z', 'E', 'F', // G2, G3 'I', 'J', 'R', + // G4 + 'S', // G29 - 'P', 'W', 'H', 'C', 'A' + 'G', 'P', 'W', 'H', 'C', 'A' }; return std::find(parameters.begin(), parameters.end(), c) != parameters.end(); }; @@ -395,20 +397,33 @@ // GCodeReader::parse_line_internal() is unable to parse a G line where the data are not separated by spaces // so we add them where needed const size_t curr_unbin_buffer_length = std::distance(unbin_buffer.begin(), it_unbin_end); - if (c_unbin[i] == 'G' && (curr_unbin_buffer_length == 0 || *std::prev(it_unbin_end, 1) == '\n')) + bool new_line = false; + if (c_unbin[i] == 'G' && (curr_unbin_buffer_length == 0 || *std::prev(it_unbin_end, 1) == '\n')) { add_space = true; + new_line = true; + } else if (c_unbin[i] == '\n') add_space = false; - if (add_space && (curr_unbin_buffer_length == 0 || *std::prev(it_unbin_end, 1) != ' ') && + if (!new_line && add_space && (curr_unbin_buffer_length == 0 || *std::prev(it_unbin_end, 1) != ' ') && is_gline_parameter(c_unbin[i])) { *it_unbin_end = ' '; ++it_unbin_end; + if (it_unbin_end == unbin_buffer.end()) { + // the buffer is not big enough, resize it + unbin_buffer.resize(2 * unbin_buffer.size(), 0); + it_unbin_end = unbin_buffer.begin() + curr_unbin_buffer_length + 1; + } } if (c_unbin[i] != '\n' || std::distance(unbin_buffer.begin(), it_unbin_end) == 0 || *std::prev(it_unbin_end, 1) != '\n') { *it_unbin_end = c_unbin[i]; ++it_unbin_end; + if (it_unbin_end == unbin_buffer.end()) { + // the buffer is not big enough, resize it + unbin_buffer.resize(2 * unbin_buffer.size(), 0); + it_unbin_end = unbin_buffer.begin() + curr_unbin_buffer_length + 1; + } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libbgcode-0.2.0+git20231219.7aaf717/src/LibBGCode/convert/convert.cpp new/libbgcode-0.2.0+git20240829.b5c57c4/src/LibBGCode/convert/convert.cpp --- old/libbgcode-0.2.0+git20231219.7aaf717/src/LibBGCode/convert/convert.cpp 2023-12-19 12:40:39.000000000 +0100 +++ new/libbgcode-0.2.0+git20240829.b5c57c4/src/LibBGCode/convert/convert.cpp 2024-08-29 11:15:55.000000000 +0200 @@ -184,36 +184,40 @@ using namespace std::literals; static constexpr const std::string_view GeneratedByPrusaSlicer = "generated by PrusaSlicer"sv; - static constexpr const std::string_view PrinterModel = "printer_model"sv; - static constexpr const std::string_view FilamentType = "filament_type"sv; - static constexpr const std::string_view NozzleDiameter = "nozzle_diameter"sv; - static constexpr const std::string_view BedTemperature = "bed_temperature"sv; - static constexpr const std::string_view BrimWidth = "brim_width"sv; - static constexpr const std::string_view FillDensity = "fill_density"sv; - static constexpr const std::string_view LayerHeight = "layer_height"sv; - static constexpr const std::string_view Temperature = "temperature"sv; - static constexpr const std::string_view Ironing = "ironing"sv; - static constexpr const std::string_view SupportMaterial = "support_material"sv; - static constexpr const std::string_view MaxLayerZ = "max_layer_z"sv; - static constexpr const std::string_view ExtruderColour = "extruder_colour"sv; - static constexpr const std::string_view FilamentUsedMm = "filament used [mm]"sv; - static constexpr const std::string_view FilamentUsedG = "filament used [g]"sv; - static constexpr const std::string_view EstimatedPrintingTimeNormal = "estimated printing time (normal mode)"sv; - static constexpr const std::string_view FilamentUsedCm3 = "filament used [cm3]"sv; - static constexpr const std::string_view FilamentCost = "filament cost"sv; - static constexpr const std::string_view TotalFilamentUsedG = "total filament used [g]"sv; - static constexpr const std::string_view TotalFilamentCost = "total filament cost"sv; - static constexpr const std::string_view TotalFilamentUsedWipeTower = "total filament used for wipe tower [g]"sv; - static constexpr const std::string_view EstimatedPrintingTimeSilent = "estimated printing time (silent mode)"sv; + static constexpr const std::string_view PrinterModel = "printer_model"sv; + static constexpr const std::string_view FilamentType = "filament_type"sv; + static constexpr const std::string_view FilamentAbrasive = "filament_abrasive"sv; + static constexpr const std::string_view NozzleDiameter = "nozzle_diameter"sv; + static constexpr const std::string_view NozzleHighFlow = "nozzle_high_flow"sv; + static constexpr const std::string_view BedTemperature = "bed_temperature"sv; + static constexpr const std::string_view BrimWidth = "brim_width"sv; + static constexpr const std::string_view FillDensity = "fill_density"sv; + static constexpr const std::string_view LayerHeight = "layer_height"sv; + static constexpr const std::string_view Temperature = "temperature"sv; + static constexpr const std::string_view Ironing = "ironing"sv; + static constexpr const std::string_view SupportMaterial = "support_material"sv; + static constexpr const std::string_view MaxLayerZ = "max_layer_z"sv; + static constexpr const std::string_view ExtruderColour = "extruder_colour"sv; + static constexpr const std::string_view FilamentUsedMm = "filament used [mm]"sv; + static constexpr const std::string_view FilamentUsedG = "filament used [g]"sv; + static constexpr const std::string_view EstimatedPrintingTimeNormal = "estimated printing time (normal mode)"sv; + static constexpr const std::string_view FilamentUsedCm3 = "filament used [cm3]"sv; + static constexpr const std::string_view FilamentCost = "filament cost"sv; + static constexpr const std::string_view TotalFilamentUsedG = "total filament used [g]"sv; + static constexpr const std::string_view TotalFilamentCost = "total filament cost"sv; + static constexpr const std::string_view TotalFilamentUsedWipeTower = "total filament used for wipe tower [g]"sv; + static constexpr const std::string_view EstimatedPrintingTimeSilent = "estimated printing time (silent mode)"sv; static constexpr const std::string_view Estimated1stLayerPrintingTimeNormal = "estimated first layer printing time (normal mode)"sv; static constexpr const std::string_view Estimated1stLayerPrintingTimeSilent = "estimated first layer printing time (silent mode)"sv; + static constexpr const std::string_view ObjectsInfo = "objects_info"sv; + static constexpr const std::string_view TotalToolChanges = "total toolchanges"sv; static constexpr const std::string_view ThumbnailPNGBegin = "thumbnail begin"sv; - static constexpr const std::string_view ThumbnailPNGEnd = "thumbnail end"sv; + static constexpr const std::string_view ThumbnailPNGEnd = "thumbnail end"sv; static constexpr const std::string_view ThumbnailJPGBegin = "thumbnail_JPG begin"sv; - static constexpr const std::string_view ThumbnailJPGEnd = "thumbnail_JPG end"sv; + static constexpr const std::string_view ThumbnailJPGEnd = "thumbnail_JPG end"sv; static constexpr const std::string_view ThumbnailQOIBegin = "thumbnail_QOI begin"sv; - static constexpr const std::string_view ThumbnailQOIEnd = "thumbnail_QOI end"sv; + static constexpr const std::string_view ThumbnailQOIEnd = "thumbnail_QOI end"sv; static constexpr const std::string_view PrusaSlicerConfig = "prusaslicer_config"sv; @@ -246,7 +250,9 @@ std::string printer_model; std::string filament_type; + std::string filament_abrasive; std::string nozzle_diameter; + std::string nozzle_high_flow; std::string bed_temperature; std::string brim_width; std::string fill_density; @@ -267,6 +273,8 @@ std::string estimated_printing_time_silent; std::string estimated_1st_layer_printing_time_normal; std::string estimated_1st_layer_printing_time_silent; + std::string objects_info; + std::string total_tool_changes; std::optional<EThumbnailFormat> reading_thumbnail; size_t curr_thumbnail_data_size = 0; @@ -322,29 +330,33 @@ return false; }; - if (collect_metadata(PrinterModel, printer_model, true)) return; - if (collect_metadata(FilamentType, filament_type, true)) return; - if (collect_metadata(NozzleDiameter, nozzle_diameter, true)) return; - if (collect_metadata(BedTemperature, bed_temperature, true)) return; - if (collect_metadata(BrimWidth, brim_width, true)) return; - if (collect_metadata(FillDensity, fill_density, true)) return; - if (collect_metadata(LayerHeight, layer_height, true)) return; - if (collect_metadata(Temperature, temperature, true)) return; - if (collect_metadata(Ironing, ironing, true)) return; - if (collect_metadata(SupportMaterial, support_material, true)) return; - if (collect_metadata(MaxLayerZ, max_layer_z)) return; - if (collect_metadata(ExtruderColour, extruder_colour, true)) return; - if (collect_metadata(FilamentUsedMm, filament_used_mm)) return; - if (collect_metadata(FilamentUsedG, filament_used_g)) return; - if (collect_metadata(EstimatedPrintingTimeNormal, estimated_printing_time_normal)) return; - if (collect_metadata(FilamentUsedCm3, filament_used_cm3)) return; - if (collect_metadata(FilamentCost, filament_cost)) return; - if (collect_metadata(TotalFilamentUsedG, total_filament_used_g)) return; - if (collect_metadata(TotalFilamentCost, total_filament_cost)) return; - if (collect_metadata(TotalFilamentUsedWipeTower, total_filament_used_wipe_tower)) return; - if (collect_metadata(EstimatedPrintingTimeSilent, estimated_printing_time_silent)) return; + if (collect_metadata(PrinterModel, printer_model, true)) return; + if (collect_metadata(FilamentType, filament_type, true)) return; + if (collect_metadata(FilamentAbrasive, filament_abrasive, true)) return; + if (collect_metadata(NozzleDiameter, nozzle_diameter, true)) return; + if (collect_metadata(NozzleHighFlow, nozzle_high_flow, true)) return; + if (collect_metadata(BedTemperature, bed_temperature, true)) return; + if (collect_metadata(BrimWidth, brim_width, true)) return; + if (collect_metadata(FillDensity, fill_density, true)) return; + if (collect_metadata(LayerHeight, layer_height, true)) return; + if (collect_metadata(Temperature, temperature, true)) return; + if (collect_metadata(Ironing, ironing, true)) return; + if (collect_metadata(SupportMaterial, support_material, true)) return; + if (collect_metadata(MaxLayerZ, max_layer_z)) return; + if (collect_metadata(ExtruderColour, extruder_colour, true)) return; + if (collect_metadata(FilamentUsedMm, filament_used_mm)) return; + if (collect_metadata(FilamentUsedG, filament_used_g)) return; + if (collect_metadata(EstimatedPrintingTimeNormal, estimated_printing_time_normal)) return; + if (collect_metadata(FilamentUsedCm3, filament_used_cm3)) return; + if (collect_metadata(FilamentCost, filament_cost)) return; + if (collect_metadata(TotalFilamentUsedG, total_filament_used_g)) return; + if (collect_metadata(TotalFilamentCost, total_filament_cost)) return; + if (collect_metadata(TotalFilamentUsedWipeTower, total_filament_used_wipe_tower)) return; + if (collect_metadata(EstimatedPrintingTimeSilent, estimated_printing_time_silent)) return; if (collect_metadata(Estimated1stLayerPrintingTimeNormal, estimated_1st_layer_printing_time_normal)) return; if (collect_metadata(Estimated1stLayerPrintingTimeSilent, estimated_1st_layer_printing_time_silent)) return; + if (collect_metadata(ObjectsInfo, objects_info)) return; + if (collect_metadata(TotalToolChanges, total_tool_changes)) return; // update slicer metadata if (!reading_config) { @@ -500,34 +512,40 @@ }; // update printer metadata - append_metadata(binary_data.printer_metadata.raw_data, std::string(PrinterModel), printer_model); - append_metadata(binary_data.printer_metadata.raw_data, std::string(FilamentType), filament_type); - append_metadata(binary_data.printer_metadata.raw_data, std::string(NozzleDiameter), nozzle_diameter); - append_metadata(binary_data.printer_metadata.raw_data, std::string(BedTemperature), bed_temperature); - append_metadata(binary_data.printer_metadata.raw_data, std::string(BrimWidth), brim_width); - append_metadata(binary_data.printer_metadata.raw_data, std::string(FillDensity), fill_density); - append_metadata(binary_data.printer_metadata.raw_data, std::string(LayerHeight), layer_height); - append_metadata(binary_data.printer_metadata.raw_data, std::string(Temperature), temperature); - append_metadata(binary_data.printer_metadata.raw_data, std::string(Ironing), ironing); - append_metadata(binary_data.printer_metadata.raw_data, std::string(SupportMaterial), support_material); - append_metadata(binary_data.printer_metadata.raw_data, std::string(MaxLayerZ), max_layer_z); - append_metadata(binary_data.printer_metadata.raw_data, std::string(ExtruderColour), extruder_colour); - append_metadata(binary_data.printer_metadata.raw_data, std::string(FilamentUsedMm), filament_used_mm); - append_metadata(binary_data.printer_metadata.raw_data, std::string(FilamentUsedCm3), filament_used_cm3); - append_metadata(binary_data.printer_metadata.raw_data, std::string(FilamentUsedG), filament_used_g); - append_metadata(binary_data.printer_metadata.raw_data, std::string(FilamentCost), filament_cost); + append_metadata(binary_data.printer_metadata.raw_data, std::string(PrinterModel), printer_model); + append_metadata(binary_data.printer_metadata.raw_data, std::string(FilamentType), filament_type); + append_metadata(binary_data.printer_metadata.raw_data, std::string(FilamentAbrasive), filament_abrasive); + append_metadata(binary_data.printer_metadata.raw_data, std::string(NozzleDiameter), nozzle_diameter); + append_metadata(binary_data.printer_metadata.raw_data, std::string(NozzleHighFlow), nozzle_high_flow); + append_metadata(binary_data.printer_metadata.raw_data, std::string(BedTemperature), bed_temperature); + append_metadata(binary_data.printer_metadata.raw_data, std::string(BrimWidth), brim_width); + append_metadata(binary_data.printer_metadata.raw_data, std::string(FillDensity), fill_density); + append_metadata(binary_data.printer_metadata.raw_data, std::string(LayerHeight), layer_height); + append_metadata(binary_data.printer_metadata.raw_data, std::string(Temperature), temperature); + append_metadata(binary_data.printer_metadata.raw_data, std::string(Ironing), ironing); + append_metadata(binary_data.printer_metadata.raw_data, std::string(SupportMaterial), support_material); + append_metadata(binary_data.printer_metadata.raw_data, std::string(MaxLayerZ), max_layer_z); + append_metadata(binary_data.printer_metadata.raw_data, std::string(ExtruderColour), extruder_colour); + append_metadata(binary_data.printer_metadata.raw_data, std::string(FilamentUsedMm), filament_used_mm); + append_metadata(binary_data.printer_metadata.raw_data, std::string(FilamentUsedCm3), filament_used_cm3); + append_metadata(binary_data.printer_metadata.raw_data, std::string(FilamentUsedG), filament_used_g); + append_metadata(binary_data.printer_metadata.raw_data, std::string(FilamentCost), filament_cost); append_metadata(binary_data.printer_metadata.raw_data, std::string(EstimatedPrintingTimeNormal), estimated_printing_time_normal); + append_metadata(binary_data.printer_metadata.raw_data, std::string(EstimatedPrintingTimeSilent), estimated_printing_time_silent); + append_metadata(binary_data.printer_metadata.raw_data, std::string(TotalFilamentUsedWipeTower), total_filament_used_wipe_tower); + append_metadata(binary_data.printer_metadata.raw_data, std::string(ObjectsInfo), objects_info); // update print metadata - append_metadata(binary_data.print_metadata.raw_data, std::string(FilamentUsedMm), filament_used_mm); - append_metadata(binary_data.print_metadata.raw_data, std::string(FilamentUsedCm3), filament_used_cm3); - append_metadata(binary_data.print_metadata.raw_data, std::string(FilamentUsedG), filament_used_g); - append_metadata(binary_data.print_metadata.raw_data, std::string(FilamentCost), filament_cost); - append_metadata(binary_data.print_metadata.raw_data, std::string(TotalFilamentUsedG), total_filament_used_g); - append_metadata(binary_data.print_metadata.raw_data, std::string(TotalFilamentCost), total_filament_cost); - append_metadata(binary_data.print_metadata.raw_data, std::string(TotalFilamentUsedWipeTower), total_filament_used_wipe_tower); - append_metadata(binary_data.print_metadata.raw_data, std::string(EstimatedPrintingTimeNormal), estimated_printing_time_normal); - append_metadata(binary_data.print_metadata.raw_data, std::string(EstimatedPrintingTimeSilent), estimated_printing_time_silent); + append_metadata(binary_data.print_metadata.raw_data, std::string(TotalToolChanges), total_tool_changes); + append_metadata(binary_data.print_metadata.raw_data, std::string(FilamentUsedMm), filament_used_mm); + append_metadata(binary_data.print_metadata.raw_data, std::string(FilamentUsedCm3), filament_used_cm3); + append_metadata(binary_data.print_metadata.raw_data, std::string(FilamentUsedG), filament_used_g); + append_metadata(binary_data.print_metadata.raw_data, std::string(FilamentCost), filament_cost); + append_metadata(binary_data.print_metadata.raw_data, std::string(TotalFilamentUsedG), total_filament_used_g); + append_metadata(binary_data.print_metadata.raw_data, std::string(TotalFilamentCost), total_filament_cost); + append_metadata(binary_data.print_metadata.raw_data, std::string(TotalFilamentUsedWipeTower), total_filament_used_wipe_tower); + append_metadata(binary_data.print_metadata.raw_data, std::string(EstimatedPrintingTimeNormal), estimated_printing_time_normal); + append_metadata(binary_data.print_metadata.raw_data, std::string(EstimatedPrintingTimeSilent), estimated_printing_time_silent); append_metadata(binary_data.print_metadata.raw_data, std::string(Estimated1stLayerPrintingTimeNormal), estimated_1st_layer_printing_time_normal); append_metadata(binary_data.print_metadata.raw_data, std::string(Estimated1stLayerPrintingTimeSilent), estimated_1st_layer_printing_time_silent); ++++++ libbgcode.obsinfo ++++++ --- /var/tmp/diff_new_pack.H6UlDY/_old 2024-09-01 19:21:31.132241403 +0200 +++ /var/tmp/diff_new_pack.H6UlDY/_new 2024-09-01 19:21:31.136241566 +0200 @@ -1,5 +1,5 @@ name: libbgcode -version: 0.2.0+git20231219.7aaf717 -mtime: 1702986039 -commit: 7aaf717fef6a83e4568b67729d5b0267453de815 +version: 0.2.0+git20240829.b5c57c4 +mtime: 1724922955 +commit: b5c57c423c958a78dacae468aeee63ab3d2de947