Skip to content

Commit

Permalink
Merge pull request #15 from jcbelanger/master
Browse files Browse the repository at this point in the history
Support for Cura 5.1.0 (SDK 8.1.0)
  • Loading branch information
ronoaldo authored Aug 2, 2022
2 parents d27d57b + 841f2be commit 3c41710
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 15 deletions.
15 changes: 12 additions & 3 deletions plugins/FlashforgeFinderIntegration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,20 @@
"package_id": "FlashforgeFinderIntegration",
"package_type": "plugin",
"package_version": "1.0.0",
"sdk_version": "7.2.0",
"supported_sdk_versions": ["7.2.0"],
"sdk_version": "8.1.0",
"supported_sdk_versions": [
"7.2.0",
"7.3.0",
"7.4.0",
"7.5.0",
"7.8.0",
"7.9.0",
"8.0.0",
"8.1.0"
],
"tags": [
"Flashforge",
"Finder"
"Finder"
],
"website": "https://github.com/ronoaldo/FlashforgeFinderIntegration"
}
11 changes: 10 additions & 1 deletion plugins/FlashforgeFinderIntegration/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
"version": "1.0.0",
"description": "Flashforge Finder integration utilities to enable setting up and using the printer. This plugin uses the configuration files from https://github.com/eskeyaar/Flashforge-Finder-",
"api": 5,
"supported_sdk_versions": ["7.2.0"],
"supported_sdk_versions": [
"7.2.0",
"7.3.0",
"7.4.0",
"7.5.0",
"7.8.0",
"7.9.0",
"8.0.0",
"8.1.0"
],
"i18n-catalog": "cura"
}
18 changes: 13 additions & 5 deletions plugins/GXWriter/GXWriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@
from io import StringIO, BufferedIOBase
from typing import cast, List
from . import gx
from PyQt5 import QtGui, QtCore

qt_version = 6
try:
from PyQt6 import QtGui, QtCore
except ImportError:
qt_version = 5
from PyQt5 import QtGui, QtCore

# Helper function that extracts values from gcode to add to the binary header.
def getValue(line, key, default=None):
Expand Down Expand Up @@ -100,15 +106,17 @@ def _createSnapshot(self, g, *args):
try:
# Convert the image to grayscale, and back to 24bits so it renders properly
# in printer.
qt_format_ctx = QtGui.QImage.Format if qt_version == 6 else QtGui.QImage
qt_openmode_ctx = QtCore.QIODeviceBase.OpenModeFlag if qt_version == 6 else QtCore.QIODevice
img = Snapshot.snapshot(width = 80, height = 60)
img = img.convertToFormat(QtGui.QImage.Format_Grayscale8)
img = img.convertToFormat(QtGui.QImage.Format_RGB666)
img = img.convertToFormat(qt_format_ctx.Format_Grayscale8)
img = img.convertToFormat(qt_format_ctx.Format_RGB666)
# Converts the image into BMP byte array.
arr = QtCore.QByteArray()
buff = QtCore.QBuffer(arr)
buff.open(QtCore.QIODevice.WriteOnly)
buff.open(qt_openmode_ctx.WriteOnly)
img.save(buff, format="BMP")
g.bmp = arr.data()
g.bmp = arr.data()
except Exception:
Logger.logException("w", "Failed to create snapshot image")
g.bmp = gx._SAMPLE_BMP
16 changes: 11 additions & 5 deletions plugins/GXWriter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,19 @@
"package_id": "GXWriter",
"package_type": "plugin",
"package_version": "1.0.0",
"sdk_version": "7.1.0",
"supported_sdk_versions": ["5.0.0", "6.0.0", "7.0.0"],
"sdk_version": "8.1.0",
"supported_sdk_versions": [
"5.0.0",
"6.0.0",
"7.0.0",
"8.0.0",
"8.1.0"
],
"tags": [
"flashforge",
"finder",
"monoprice",
"xgcode"
"finder",
"monoprice",
"xgcode"
],
"website": "https://github.com/ronoaldo/FlashforgeFinderIntegration"
}
17 changes: 16 additions & 1 deletion plugins/GXWriter/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@
"version": "1.0.0",
"description": "GXWriter writes the required header metadata to printers that interpret GX files, such as Flashforge Finder and Monoprice.",
"api": 5,
"supported_sdk_versions": ["6.0.0", "6.1.0", "6.2.0", "6.3.0", "7.0.0", "7.1.0", "7.2.0"],
"supported_sdk_versions": [
"6.0.0",
"6.1.0",
"6.2.0",
"6.3.0",
"7.0.0",
"7.1.0",
"7.2.0",
"7.3.0",
"7.4.0",
"7.5.0",
"7.8.0",
"7.9.0",
"8.0.0",
"8.1.0"
],
"i18n-catalog": "cura"
}

0 comments on commit 3c41710

Please sign in to comment.