Add the skeleton of the plugin

Contributes to CURA-5155.
This commit is contained in:
Diego Prado Gesto 2019-03-08 21:57:07 +01:00
parent 8c41bc86d2
commit 412bcc9b90
5 changed files with 75 additions and 3 deletions

View File

@ -12,9 +12,6 @@ catalog = i18nCatalog("cura")
from . import MarlinFlavorParser, RepRapFlavorParser from . import MarlinFlavorParser, RepRapFlavorParser
# Class for loading and parsing G-code files # Class for loading and parsing G-code files
class GCodeReader(MeshReader): class GCodeReader(MeshReader):
_flavor_default = "Marlin" _flavor_default = "Marlin"

View File

@ -0,0 +1,24 @@
# Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from UM.Mesh.MeshReader import MeshReader
from UM.MimeTypeDatabase import MimeType, MimeTypeDatabase
from cura.Scene.CuraSceneNode import CuraSceneNode
class UFPReader(MeshReader):
def __init__(self) -> None:
super().__init__()
MimeTypeDatabase.addMimeType(
MimeType(
name = "application/x-ufp",
comment = "Cura UFP File",
suffixes = ["ufp"]
)
)
self._supported_extensions = [".ufp"]
def _read(self, file_name: str) -> CuraSceneNode:
print("Reading", file_name)

View File

@ -0,0 +1,26 @@
#Copyright (c) 2019 Ultimaker B.V.
#Cura is released under the terms of the LGPLv3 or higher.
from UM.i18n import i18nCatalog
from . import UFPReader
i18n_catalog = i18nCatalog("cura")
def getMetaData():
return {
"mesh_reader": [
{
"mime_type": "application/x-ufp",
"extension": "ufp",
"description": i18n_catalog.i18nc("@item:inlistbox", "Ultimaker Format Package")
}
]
}
def register(app):
app.addNonSliceableExtension(".ufp")
return {"mesh_reader": UFPReader.UFPReader()}

View File

@ -0,0 +1,8 @@
{
"name": "UFP Reader",
"author": "Ultimaker B.V.",
"version": "1.0.0",
"description": "Provides support for reading Ultimaker Format Packages.",
"supported_sdk_versions": ["6.0.0"],
"i18n-catalog": "cura"
}

View File

@ -492,6 +492,23 @@
} }
} }
}, },
"UFPReader": {
"package_info": {
"package_id": "UFPReader",
"package_type": "plugin",
"display_name": "UFP Reader",
"description": "Provides support for reading Ultimaker Format Packages.",
"package_version": "1.0.0",
"sdk_version": "6.0",
"website": "https://ultimaker.com",
"author": {
"author_id": "UltimakerPackages",
"display_name": "Ultimaker B.V.",
"email": "plugins@ultimaker.com",
"website": "https://ultimaker.com"
}
}
},
"UFPWriter": { "UFPWriter": {
"package_info": { "package_info": {
"package_id": "UFPWriter", "package_id": "UFPWriter",