Skip to content

Commit 841f2be

Browse files
author
Joshua Belanger
committed
Support for Cura 5.1.0 (SDK 8.1.0)
1 parent d27d57b commit 841f2be

File tree

5 files changed

+62
-15
lines changed

5 files changed

+62
-15
lines changed

plugins/FlashforgeFinderIntegration/package.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,20 @@
1010
"package_id": "FlashforgeFinderIntegration",
1111
"package_type": "plugin",
1212
"package_version": "1.0.0",
13-
"sdk_version": "7.2.0",
14-
"supported_sdk_versions": ["7.2.0"],
13+
"sdk_version": "8.1.0",
14+
"supported_sdk_versions": [
15+
"7.2.0",
16+
"7.3.0",
17+
"7.4.0",
18+
"7.5.0",
19+
"7.8.0",
20+
"7.9.0",
21+
"8.0.0",
22+
"8.1.0"
23+
],
1524
"tags": [
1625
"Flashforge",
17-
"Finder"
26+
"Finder"
1827
],
1928
"website": "https://github.com/ronoaldo/FlashforgeFinderIntegration"
2029
}

plugins/FlashforgeFinderIntegration/plugin.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
"version": "1.0.0",
55
"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-",
66
"api": 5,
7-
"supported_sdk_versions": ["7.2.0"],
7+
"supported_sdk_versions": [
8+
"7.2.0",
9+
"7.3.0",
10+
"7.4.0",
11+
"7.5.0",
12+
"7.8.0",
13+
"7.9.0",
14+
"8.0.0",
15+
"8.1.0"
16+
],
817
"i18n-catalog": "cura"
918
}

plugins/GXWriter/GXWriter.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@
1818
from io import StringIO, BufferedIOBase
1919
from typing import cast, List
2020
from . import gx
21-
from PyQt5 import QtGui, QtCore
21+
22+
qt_version = 6
23+
try:
24+
from PyQt6 import QtGui, QtCore
25+
except ImportError:
26+
qt_version = 5
27+
from PyQt5 import QtGui, QtCore
2228

2329
# Helper function that extracts values from gcode to add to the binary header.
2430
def getValue(line, key, default=None):
@@ -100,15 +106,17 @@ def _createSnapshot(self, g, *args):
100106
try:
101107
# Convert the image to grayscale, and back to 24bits so it renders properly
102108
# in printer.
109+
qt_format_ctx = QtGui.QImage.Format if qt_version == 6 else QtGui.QImage
110+
qt_openmode_ctx = QtCore.QIODeviceBase.OpenModeFlag if qt_version == 6 else QtCore.QIODevice
103111
img = Snapshot.snapshot(width = 80, height = 60)
104-
img = img.convertToFormat(QtGui.QImage.Format_Grayscale8)
105-
img = img.convertToFormat(QtGui.QImage.Format_RGB666)
112+
img = img.convertToFormat(qt_format_ctx.Format_Grayscale8)
113+
img = img.convertToFormat(qt_format_ctx.Format_RGB666)
106114
# Converts the image into BMP byte array.
107115
arr = QtCore.QByteArray()
108116
buff = QtCore.QBuffer(arr)
109-
buff.open(QtCore.QIODevice.WriteOnly)
117+
buff.open(qt_openmode_ctx.WriteOnly)
110118
img.save(buff, format="BMP")
111-
g.bmp = arr.data()
119+
g.bmp = arr.data()
112120
except Exception:
113121
Logger.logException("w", "Failed to create snapshot image")
114122
g.bmp = gx._SAMPLE_BMP

plugins/GXWriter/package.json

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,19 @@
1010
"package_id": "GXWriter",
1111
"package_type": "plugin",
1212
"package_version": "1.0.0",
13-
"sdk_version": "7.1.0",
14-
"supported_sdk_versions": ["5.0.0", "6.0.0", "7.0.0"],
13+
"sdk_version": "8.1.0",
14+
"supported_sdk_versions": [
15+
"5.0.0",
16+
"6.0.0",
17+
"7.0.0",
18+
"8.0.0",
19+
"8.1.0"
20+
],
1521
"tags": [
1622
"flashforge",
17-
"finder",
18-
"monoprice",
19-
"xgcode"
23+
"finder",
24+
"monoprice",
25+
"xgcode"
2026
],
2127
"website": "https://github.com/ronoaldo/FlashforgeFinderIntegration"
2228
}

plugins/GXWriter/plugin.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,21 @@
44
"version": "1.0.0",
55
"description": "GXWriter writes the required header metadata to printers that interpret GX files, such as Flashforge Finder and Monoprice.",
66
"api": 5,
7-
"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+
"supported_sdk_versions": [
8+
"6.0.0",
9+
"6.1.0",
10+
"6.2.0",
11+
"6.3.0",
12+
"7.0.0",
13+
"7.1.0",
14+
"7.2.0",
15+
"7.3.0",
16+
"7.4.0",
17+
"7.5.0",
18+
"7.8.0",
19+
"7.9.0",
20+
"8.0.0",
21+
"8.1.0"
22+
],
823
"i18n-catalog": "cura"
924
}

0 commit comments

Comments
 (0)