Skip to content

Commit

Permalink
100%
Browse files Browse the repository at this point in the history
  • Loading branch information
5axes committed Oct 26, 2020
1 parent d879423 commit 27ad94c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
11 changes: 6 additions & 5 deletions HtmlCuraSettings.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Copyright (c) 2020 5axes
#
# Initial Source from Johnny Matthews https://github.com/johnnygizmo/CuraSettingsWriter
# The HTML plugin is released under the terms of the AGPLv3 or higher.
# Version 1.0.3 : simplify the source code with WriteTd
# : Export also the meshfix paramater section by extruder and complementary information on extruder for machine definition
# Version 1.0.4 : html cleanup, no jquery dependency thanks to https://github.com/etet100
# Version 1.0.5 : for configuration with multi extruder export the right extrudeur position and the information concerning the enabled
# Version 1.0.6 : table width='100%'
#
import os
import platform
Expand All @@ -26,10 +26,10 @@

class HtmlCuraSettings(WorkspaceWriter):

def write(self, stream, nodes, mode):
def write(self, stream, nodes, mode = WorkspaceWriter.OutputMode.TextMode):

# Current File path
Logger.log("d", "stream = %s", os.path.abspath(stream.name))
# Logger.log("d", "stream = %s", os.path.abspath(stream.name))

stream.write("""<!DOCTYPE html>
<meta charset='UTF-8'>
Expand Down Expand Up @@ -76,7 +76,7 @@ def write(self, stream, nodes, mode):
extruder_count=stack.getProperty("machine_extruder_count", "value")
print_information = CuraApplication.getInstance().getPrintInformation()

stream.write("<table width='50%' border='1' cellpadding='3'>")
stream.write("<table width='100%' border='1' cellpadding='3'>")
# Job
self._WriteTd(stream,i18n_cura_catalog.i18nc("@label","Job Name"),print_information.jobName)

Expand Down Expand Up @@ -183,6 +183,7 @@ def _doTree(self,stack,key,stream,depth,extrud):
#output node
Info_Extrud=""
definition_key=key + " label"

ExtruderStrg = i18n_cura_catalog.i18nc("@label", "Extruder")

if stack.getProperty(key,"type") == "category":
Expand Down Expand Up @@ -219,7 +220,7 @@ def _doTree(self,stack,key,stream,depth,extrud):
GelValStr="{:.4f}".format(GetVal).rstrip("0").rstrip(".") # Formatage thanks to r_moeller
else:
GelValStr=str(GetVal)

stream.write("<td class='val'>" + GelValStr + "</td>")

stream.write("<td class='w-10'>" + str(stack.getProperty(key,"unit")) + "</td>")
Expand Down
21 changes: 12 additions & 9 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,22 @@

from . import HtmlCuraSettings

from UM.Platform import Platform
from UM.i18n import i18nCatalog
catalog = i18nCatalog("cura")

def getMetaData():
return {
"workspace_writer": {
"output": [{
"extension": "html",
"description": catalog.i18nc("@item:inlistbox", "Cura Settings Documentation"),
"mime_type": "text/html"
}]
}
def getMetaData():
metaData = {}

metaData["workspace_writer"] = {
"output": [{
"extension": "html",
"description": catalog.i18nc("@item:inlistbox", "Cura Settings Documentation"),
"mime_type": "text/html",
"mode": HtmlCuraSettings.HtmlCuraSettings.OutputMode.TextMode
}]
}
return metaData

def register(app):
return { "workspace_writer": HtmlCuraSettings.HtmlCuraSettings() }
4 changes: 2 additions & 2 deletions plugin.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "HTML Cura Settings",
"author": "5axes",
"version": "1.0.5",
"version": "1.0.6",
"description": "Export settings to an HTML File",
"api": 7,
"supported_sdk_versions": ["6.0.0", "7.0.0", "7.1.0", "7.2.0"],
"supported_sdk_versions": ["6.0.0", "7.0.0", "7.1.0", "7.2.0", "7.3.0", "7.4.0"],
"i18n-catalog":"cura"
}

0 comments on commit 27ad94c

Please sign in to comment.