Merge remote-tracking branch 'origin/devel' into devel

This commit is contained in:
Gina Häußge committed 2015-01-13 10:32:59 +01:00
commit 466866c323
64 files changed
+5771 -3698

No files matched your search

+58 -1
View File
@@ -19,6 +19,19 @@
* OctoPrint now has a [plugin system](http://docs.octoprint.org/en/devel/plugins/index.html) which allows extending its
core functionality.
* New type of API key: [App Session Keys](http://docs.octoprint.org/en/devel/api/apps.html) for trusted applications
* Printer Profiles: Printer properties like print volume, extruder offsets etc are now managed via Printer Profiles. A
connection to a printer will always have a printer profile associated.
* OctoPrint now supports `action:...` commands received via debug messages (`// action:...`) from the printer. Currently supported are
- `action:pause`: Pauses the current job in OctoPrint
- `action:resume`: Resumes the current job in OctoPrint
- `action:disconnect`: Disconnects OctoPrint from the printer
* Mousing over the webcam image in the control tab enables key control mode, allowing you to quickly move the axis of your
printer with your computer's keyboard ([#610](https://github.com/foosel/OctoPrint/pull/610)):
- arrow keys: X and Y axes
- W, S / PageUp, PageDown: Y axes
- Home: Home X and Y axes
- End: Home Z axes
- 1, 2, 3, 4: change step size used (0.1, 1, 10, 100mm)
### Improvements
@@ -33,13 +46,17 @@
([#532](https://github.com/foosel/OctoPrint/issues/532) and [#590](https://github.com/foosel/OctoPrint/pull/590))
* Slicing has been greatly improved:
* It now allows for a definition of slicing profiles to use for slicing plus overrides which can be defined per slicing
job (defining overrides is not yet part of the UI but it's on the roadmap).
job (defining overrides is not yet part of the UI but it's on the roadmap).
* A new slicing dialog has been added which allows (re-)slicing uploaded STL files (which are now displayed in the file list
as well). This dialog also allows specifying which action to take after slicing has been completed (none, selecting the
sliced GCODE for printing or starting to print it directly)
* Slicers themselves are integrated into the system via ``SlicingPlugins``.
* The [Cura integration](https://github.com/daid/Cura) has changed in such a way that OctoPrint now calls the
[CuraEngine](https://github.com/Ultimaker/CuraEngine) directly instead of depending on the full Cura installation. See
[the wiki](https://github.com/foosel/OctoPrint/wiki/Plugin:-Cura) for instructions on how to change your setup to
accommodate the new integration.
* The "Slicing done" notification is now colored green ([#558](https://github.com/foosel/OctoPrint/issues/558)).
* The slicing API allows positioning the model to slice on the print bed (Note: this is not yet available in the UI).
* File management now supports STL files as first class citizens (including UI adjustments to allow management of
uploaded STL files including removal and reslicing) and also allows folders (not yet supported by UI)
* Also interpret lines starting with "!!" as errors
@@ -51,6 +68,17 @@
long as they are in use
* Settings in UI get refreshed when opening settings dialog
* New event "SettingsUpdated"
* "Print time left" is now not displayed until it becomes somewhat stable. Display in web interface now also happens
in a fuzzy way instead of the format hh:mm:ss, to not suggest a high accuracy anymore where the can't be one. Additionally
OctoPrint will use data from prior prints to enhance the initial print time estimation.
* Added handler for uncaught exceptions to make sure those get logged, should make the logs even more useful for analysing
bug reports
* The server now tracks the modification date of the configuration file and reloads it prior to saving the config if
it has been changed during runtime by external editing, hence no config settings added manually while the server
was running should be overwritten anymore.
* Automatically hard-reload the UI if upon reconnecting to the server a new version is detected.
* Better handling of errors on the websocket - no more logging of the full stack trace to the log, only a warning
message for now.
### Bug Fixes
@@ -60,19 +88,46 @@
setups under Smoothieware
* [#556](https://github.com/foosel/OctoPrint/issues/556) - Allow login of the same user from multiple browsers without
side effects
* [#680](https://github.com/foosel/OctoPrint/issues/680) - Don't accidentally include a newline from the MIME headers
in the parsed multipart data from file uploads
* [#709](https://github.com/foosel/OctoPrint/issues/709) - Properly initialize time estimation for SD card transfers too
* Various fixes of bugs in newly introduced features and improvements:
* [#625](https://github.com/foosel/OctoPrint/pull/625) - Newly added GCODE files were not being added to the analysis
queue
* [#664](https://github.com/foosel/OctoPrint/issues/664) - Fixed jog controls again
* [#677](https://github.com/foosel/OctoPrint/issues/677) - Fixed extruder offsets not being properly editable in
printer profiles
* [#683](https://github.com/foosel/OctoPrint/issues/683) - Fixed heated bed option not being properly displayed in
printer profiles
* [#714](https://github.com/foosel/OctoPrint/issues/714) - Fixed type validation of printer profiles
* Various fixes without tickets:
* GCODE viewer now doesn't stumble over completely extrusionless GCODE files
* Do not deliver the API key on settings API unless user has admin rights
* Don't hiccup on slic3r filament_diameter comments in GCODE generated for multi extruder setups
## 1.1.2 (Unreleased)
### Improvements
* Added deletion of `*.pyc` files to `python setup.py clean` command, should help tremendously when switching branches (backported
from [9e014eb](https://github.com/foosel/OctoPrint/commit/9e014eba1feffde11ed0601d9c911b8cac9f3fb0))
### Bug Fixes
* [#634](https://github.com/foosel/OctoPrint/pull/634) - Fixed missing `branch` fields in version dicts generated
by versioneer
* [IRC] - Don't hiccup on slic3r filament_diameter comments generated for multi extruder setups
* [ML] - Fixed relative URL to sockjs endpoint, wasn't yet using the proper base url
* [unreported] & [#698](https://github.com/foosel/OctoPrint/issues/698) - Generated URLs now take X-Forwarded-Host header
sent by proxies into account for included host and port, also fixed [#698](https://github.com/foosel/OctoPrint/issues/698)
introduced by this
* Small fixes for timelapse creation:
- [#344](https://github.com/foosel/OctoPrint/issues/344) - Made timelapses capable of coping with missing captures in between by decrementing the image counter again if there
was an error fetching the latest image from the snapshot URL (backport of [1a7a468](https://github.com/foosel/OctoPrint/commit/1a7a468eb65fdf2a13b4c7a7723280e822c9c34b)
and [bf9d5ef](https://github.com/foosel/OctoPrint/commit/bf9d5efe43a1e57aacd8512125082ddca06b4efc))
- [#693](https://github.com/foosel/OctoPrint/issues/693) - Try not to capture an image if image counter is still unset
- [unreported] Synchronize image counter decrementing as well as incrementing to prevent rare race conditions when generating the
image file names
## 1.1.1 (2014-10-27)
@@ -90,6 +145,8 @@
* [#604](https://github.com/foosel/OctoPrint/issues/604) - Properly initialize settings basedir on server startup
* [IRC] Also allow downloading .g files via Tornado
([Commits](https://github.com/foosel/OctoPrint/compare/1.1.0...1.1.1))
## 1.1.0 (2014-09-03)
### New Features
+76
View File
@@ -755,6 +755,61 @@ Retrieve the current SD state
:statuscode 200: No error
:statuscode 404: If SD support has been disabled in OctoPrint's config.
.. _sec-api-printer-arbcommand:
Send an arbitrary command to the printer
========================================
.. http:post:: /api/printer/command
Sends any command to the printer via the serial interface. Should be used with some care as some commands can interfere with
or even stop a running print job.
Expects a :ref:`Arbitrary Command Request <sec-api-printer-datamodel-arbcommand>` as the request's body.
If successful returns a :http:statuscode:`204` and an empty body.
**Example for sending a single command**
.. sourcecode:: http
POST /api/printer/command HTTP/1.1
Host: example.com
Content-Type: application/json
X-Api-Key: abcdef...
{
"command": "M106"
}
.. sourcecode:: http
HTTP/1.1 204 No Content
**Example for sending multiple commands**
.. sourcecode:: http
POST /api/printer/command HTTP/1.1
Host: example.com
Content-Type: application/json
X-Api-Key: abcdef...
{
"commands": [
"M18",
"M106 S0"
]
}
.. sourcecode:: http
HTTP/1.1 204 No Content
:json string command: Single command to send to the printer, mutually exclusive with ``commands``.
:json string commands: List of commands to send to the printer, mutually exclusive with ``command``.
:statuscode 204: No error
.. _sec-api-printer-datamodel:
Datamodel
@@ -831,3 +886,24 @@ SD State
- Boolean
- Whether the SD card has been initialized (``true``) or not (``false``).
.. _sec-api-printer-datamodel-arbcommand:
Arbitrary Command Request
-------------------------
.. list-table::
:widths: 15 5 10 30
:header-rows: 1
* - Name
- Multiplicity
- Type
- Description
* - ``command``
- 0..1
- String
- Single command to send to the printer, mutually exclusive with ``commands``.
* - ``commands``
- 0..*
- Array of String
- Multiple commands to send to the printer (in the given order), mutually exclusive with ``command``.
+4
View File
@@ -96,6 +96,10 @@ ClientOpened
ClientClosed
A client has disconnected from the webserver
Payload:
* ``remoteAddress``: the remote address (IP) of the client that disconnected
Printer communication
---------------------
+1
View File
@@ -3,3 +3,4 @@ nose>=1.3.0
sphinxcontrib-httpdomain
sphinx_rtd_theme
po2json
ddt
+20
View File
@@ -96,6 +96,26 @@ class CleanCommand(Command):
file_handler=delete_file
)
# pyc files
def delete_folder_if_empty(path, applied_handler):
if not applied_handler:
return
if len(os.listdir(path)) == 0:
shutil.rmtree(path)
print "Deleted %s since it was empty" % path
def delete_file(path):
os.remove(path)
print "Deleted %s" % path
import fnmatch
_recursively_handle_files(
os.path.abspath("src"),
lambda name: fnmatch.fnmatch(name.lower(), "*.pyc"),
folder_handler=delete_folder_if_empty,
file_handler=delete_file
)
class NewTranslation(Command):
description = "create a new translation"
+7 -5
View File
@@ -4,7 +4,7 @@ Generic linux daemon base class for python 3.x
Originally from http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/#c35
"""
import sys, os, time, atexit, signal
import sys, os, time, signal
class Daemon:
"""A generic daemon class.
@@ -53,14 +53,16 @@ class Daemon:
os.dup2(se.fileno(), sys.stderr.fileno())
# write pidfile
atexit.register(self.delpid)
pid = str(os.getpid())
with open(self.pidfile,'w+') as f:
f.write(pid + '\n')
def delpid(self):
# register listener for SIGTERM
signal.signal(signal.SIGTERM, self.term)
def term(self, _signo, _stack_frame):
os.remove(self.pidfile)
sys.exit(0)
def start(self):
"""Start the daemon."""
+3 -1
View File
@@ -42,6 +42,7 @@ class Events(object):
UPDATED_FILES = "UpdatedFiles"
METADATA_ANALYSIS_STARTED = "MetadataAnalysisStarted"
METADATA_ANALYSIS_FINISHED = "MetadataAnalysisFinished"
METADATA_STATISTICS_UPDATED = "MetadataStatisticsUpdated"
# SD Upload
TRANSFER_STARTED = "TransferStarted"
@@ -62,6 +63,7 @@ class Events(object):
HOME = "Home"
Z_CHANGE = "ZChange"
WAITING = "Waiting"
DWELL = "Dwelling"
COOLING = "Cooling"
ALERT = "Alert"
CONVEYOR = "Conveyor"
@@ -306,7 +308,7 @@ class CommandTrigger(GenericEventListener):
def _executeGcodeCommand(self, command):
commands = [command]
if isinstance(command, (list, tuple, set)):
self.logger.debug("Executing GCode commands: %r" % command)
self._logger.debug("Executing GCode commands: %r" % command)
commands = list(command)
else:
self._logger.debug("Executing GCode command: %s" % command)
+43 -19
View File
@@ -9,6 +9,7 @@ import logging
import os
from octoprint.events import eventManager, Events
from octoprint.plugin import plugin_manager, ProgressPlugin
from .destinations import FileDestinations
from .analysis import QueueEntry, AnalysisQueue
@@ -113,6 +114,8 @@ class FileManager(object):
self._slicing_progress_callbacks = []
self._last_slicing_progress = None
self._progress_plugins = plugin_manager().get_implementations(ProgressPlugin)
for storage_type, storage_manager in self._storage_managers.items():
self._determine_analysis_backlog(storage_type, storage_manager)
@@ -156,7 +159,7 @@ class FileManager(object):
position=None, profile=None, printer_profile_id=None, overrides=None, callback=None, callback_args=None):
absolute_source_path = self.get_absolute_path(source_location, source_path)
def stlProcessed(source_location, source_path, tmp_path, dest_location, dest_path, start_time, printer_profile_id, callback, callback_args, _error=None, _cancelled=False):
def stlProcessed(source_location, source_path, tmp_path, dest_location, dest_path, start_time, printer_profile_id, callback, callback_args, _error=None, _cancelled=False, _analysis=None):
try:
if _error:
eventManager().fire(Events.SLICING_FAILED, {"stl": source_path, "gcode": dest_path, "reason": _error})
@@ -184,7 +187,7 @@ class FileManager(object):
file_obj = Wrapper(stl_name, temp_path, hash)
printer_profile = self._printer_profile_manager.get(printer_profile_id)
self.add_file(dest_location, dest_path, file_obj, links=links, allow_overwrite=True, printer_profile=printer_profile)
self.add_file(dest_location, dest_path, file_obj, links=links, allow_overwrite=True, printer_profile=printer_profile, analysis=_analysis)
end_time = time.time()
eventManager().fire(Events.SLICING_DONE, {"stl": source_path, "gcode": dest_path, "time": end_time - start_time})
@@ -246,14 +249,25 @@ class FileManager(object):
return
progress_int = int(_progress * 100)
if self._last_slicing_progress == progress_int:
return
else:
if self._last_slicing_progress != progress_int:
self._last_slicing_progress = progress_int
for callback in self._slicing_progress_callbacks:
try: callback.sendSlicingProgress(slicer, source_location, source_path, dest_location, dest_path, progress_int)
except: self._logger.exception("Exception while pushing slicing progress")
if progress_int:
def call_plugins(slicer, source_location, source_path, dest_location, dest_path, progress):
for name, plugin in self._progress_plugins.items():
try:
plugin.on_slicing_progress(slicer, source_location, source_path, dest_location, dest_path, progress)
except:
self._logger.exception("Exception while sending slicing progress to plugin %s" % name)
import threading
thread = threading.Thread(target=call_plugins, args=(slicer, source_location, source_path, dest_location, dest_path, progress_int))
thread.daemon = False
thread.start()
for callback in self._slicing_progress_callbacks:
try: callback.sendSlicingProgress(slicer, source_location, source_path, dest_location, dest_path, progress_int)
except: self._logger.exception("Exception while pushing slicing progress")
def get_busy_files(self):
return self._slicing_jobs.keys()
@@ -272,17 +286,20 @@ class FileManager(object):
result[dst] = self._storage_managers[dst].list_files(path=path, filter=filter, recursive=recursive)
return result
def add_file(self, destination, path, file_object, links=None, allow_overwrite=False, printer_profile=None):
def add_file(self, destination, path, file_object, links=None, allow_overwrite=False, printer_profile=None, analysis=None):
if printer_profile is None:
printer_profile = self._printer_profile_manager.get_current_or_default()
file_path = self._storage(destination).add_file(path, file_object, links=links, printer_profile=printer_profile, allow_overwrite=allow_overwrite)
absolute_path = self._storage(destination).get_absolute_path(file_path)
file_type = get_file_type(absolute_path)
if file_type:
queue_entry = QueueEntry(file_path, file_type[-1], destination, absolute_path, printer_profile)
self._analysis_queue.enqueue(queue_entry, high_priority=True)
if analysis is None:
file_type = get_file_type(absolute_path)
if file_type:
queue_entry = QueueEntry(file_path, file_type[-1], destination, absolute_path, printer_profile)
self._analysis_queue.enqueue(queue_entry, high_priority=True)
else:
self._add_analysis_result(destination, path, analysis)
eventManager().fire(Events.UPDATED_FILES, dict(type="printables"))
return file_path
@@ -309,9 +326,13 @@ class FileManager(object):
def remove_link(self, destination, path, rel, data):
self._storage(destination).remove_link(path, rel, data)
def log_print(self, destination, path, timestamp, print_time, success):
def log_print(self, destination, path, timestamp, print_time, success, printer_profile):
try:
self._storage(destination).add_history(path, dict(timestamp=timestamp, printTime=print_time, success=success))
if success:
self._storage(destination).add_history(path, dict(timestamp=timestamp, printTime=print_time, success=success, printerProfile=printer_profile))
else:
self._storage(destination).add_history(path, dict(timestamp=timestamp, success=success, printerProfile=printer_profile))
eventManager().fire(Events.METADATA_STATISTICS_UPDATED, dict(storage=destination, path=path))
except NoSuchStorage:
# if there's no storage configured where to log the print, we'll just not log it
pass
@@ -348,10 +369,13 @@ class FileManager(object):
raise NoSuchStorage("No storage configured for destination {destination}".format(**locals()))
return self._storage_managers[destination]
def _on_analysis_finished(self, entry, result):
if not entry.location in self._storage_managers:
def _add_analysis_result(self, destination, path, result):
if not destination in self._storage_managers:
return
storage_manager = self._storage_managers[entry.location]
storage_manager.set_additional_metadata(entry.path, "analysis", result)
storage_manager = self._storage_managers[destination]
storage_manager.set_additional_metadata(path, "analysis", result)
def _on_analysis_finished(self, entry, result):
self._add_analysis_result(entry.location, entry.path, result)
+65 -8
View File
@@ -9,9 +9,12 @@ __copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms
import logging
import os
import pylru
import tempfile
import octoprint.filemanager
from octoprint.util import safeRename
class StorageInterface(object):
@@ -501,6 +504,7 @@ class LocalFileStorage(StorageInterface):
metadata[name]["history"] = []
metadata[name]["history"].append(data)
self._calculate_stats_from_history(name, path, metadata=metadata, save=False)
self._save_metadata(path, metadata)
def _update_history(self, name, path, index, data):
@@ -510,7 +514,8 @@ class LocalFileStorage(StorageInterface):
return
try:
metadata[name]["history"][index] = data
metadata[name]["history"][index].update(data)
self._calculate_stats_from_history(name, path, metadata=metadata, save=False)
self._save_metadata(path, metadata)
except IndexError:
pass
@@ -523,10 +528,55 @@ class LocalFileStorage(StorageInterface):
try:
del metadata[name]["history"][index]
self._calculate_stats_from_history(name, path, metadata=metadata, save=False)
self._save_metadata(path, metadata)
except IndexError:
pass
def _calculate_stats_from_history(self, name, path, metadata=None, save=True):
if metadata is None:
metadata = self._get_metadata(path)
if not name in metadata or not "history" in metadata[name]:
return
# collect data from history
former_print_times = dict()
last_print = dict()
for history_entry in metadata[name]["history"]:
if not "printTime" in history_entry or not "success" in history_entry or not history_entry["success"] or not "printerProfile" in history_entry:
continue
printer_profile = history_entry["printerProfile"]
print_time = history_entry["printTime"]
if not printer_profile in former_print_times:
former_print_times[printer_profile] = []
former_print_times[printer_profile].append(print_time)
if not printer_profile in last_print or last_print[printer_profile] is None or ("timestamp" in history_entry and history_entry["timestamp"] > last_print[printer_profile]["timestamp"]):
last_print[printer_profile] = history_entry
# calculate stats
statistics = dict(averagePrintTime=dict(), lastPrintTime=dict())
for printer_profile in former_print_times:
if not former_print_times[printer_profile]:
continue
statistics["averagePrintTime"][printer_profile] = sum(former_print_times[printer_profile]) / float(len(former_print_times[printer_profile]))
for printer_profile in last_print:
if not last_print[printer_profile]:
continue
statistics["lastPrintTime"][printer_profile] = last_print[printer_profile]["printTime"]
metadata[name]["statistics"] = statistics
if save:
self._save_metadata(path, metadata)
def _get_links(self, name, path, searched_rel):
metadata = self._get_metadata(path)
result = []
@@ -809,20 +859,27 @@ class LocalFileStorage(StorageInterface):
with open(metadata_path) as f:
try:
import yaml
return yaml.safe_load(f)
metadata = yaml.safe_load(f)
except:
self._logger.exception("Error while reading .metadata.yaml from {path}".format(**locals()))
else:
self._metadata_cache[path] = metadata
return metadata
return dict()
def _save_metadata(self, path, metadata):
metadata_path = os.path.join(path, ".metadata.yaml")
fh, metadata_temporary_path = tempfile.mkstemp()
os.close(fh)
with self._metadata_lock:
with open(metadata_path, "w") as f:
try:
try:
with open(metadata_temporary_path, "w") as f:
import yaml
yaml.safe_dump(metadata, stream=f, default_flow_style=False, indent=" ", allow_unicode=True)
except:
self._logger.exception("Error while writing .metadata.yaml to {path}".format(**locals()))
else:
self._metadata_cache[path] = metadata
safeRename(metadata_temporary_path, metadata_path, throw_error=True)
except:
self._logger.exception("Error while writing .metadata.yaml to {path}".format(**locals()))
else:
self._metadata_cache[path] = metadata
+2 -1
View File
@@ -30,7 +30,8 @@ def plugin_manager(init=False, plugin_folders=None, plugin_types=None, plugin_en
BlueprintPlugin,
EventHandlerPlugin,
SlicerPlugin,
AppPlugin]
AppPlugin,
ProgressPlugin]
if plugin_entry_points is None:
plugin_entry_points = "octoprint.plugin"
if plugin_disabled_list is None:
+30
View File
@@ -228,6 +228,36 @@ class SlicerPlugin(Plugin):
pass
class ProgressPlugin(Plugin):
"""
Via the ``ProgressPlugin`` mixing plugins can let themselves be called upon progress in print jobs or slicing jobs,
limited to minimally 1% steps.
"""
def on_print_progress(self, storage, path, progress):
"""
Called by OctoPrint on minimally 1% increments during a running print job.
:param location string: Location of the file
:param path string: Path of the file
:param progress int: Current progress as a value between 0 and 100
"""
pass
def on_slicing_progress(self, slicer, source_location, source_path, destination_location, destination_path, progress):
"""
Called by OctoPrint on minimally 1% increments during a running slicing job.
:param slicer string: Key of the slicer reporting the progress
:param source_location string: Location of the source file
:param source_path string: Path of the source file
:param destination_location string: Location the destination file
:param destination_path string: Path of the destination file
:param progress int: Current progress as a value between 0 and 100
"""
pass
class AppPlugin(Plugin):
def get_additional_apps(self):
return []
+89 -51
View File
@@ -9,6 +9,7 @@ import logging
import logging.handlers
import os
import flask
import math
import octoprint.plugin
import octoprint.util
@@ -114,9 +115,8 @@ class CuraPlugin(octoprint.plugin.SlicerPlugin,
# setup job tracking across threads
import threading
self._slicing_commands = dict()
self._slicing_commands_mutex = threading.Lock()
self._cancelled_jobs = []
self._cancelled_jobs_mutex = threading.Lock()
self._job_mutex = threading.Lock()
##~~ StartupPlugin API
@@ -188,7 +188,10 @@ class CuraPlugin(octoprint.plugin.SlicerPlugin,
def is_slicer_configured(self):
cura_engine = s.get(["cura_engine"])
return cura_engine is not None and os.path.exists(cura_engine)
if cura_engine is not None and os.path.exists(cura_engine):
return True
else:
self._logger.info("Path to CuraEngine has not been configured yet or does not exist (currently set to %r), Cura will not be selectable for slicing" % cura_engine)
def get_slicer_properties(self):
return dict(
@@ -230,54 +233,56 @@ class CuraPlugin(octoprint.plugin.SlicerPlugin,
self._save_profile(path, new_profile, allow_overwrite=allow_overwrite)
def do_slice(self, model_path, printer_profile, machinecode_path=None, profile_path=None, position=None, on_progress=None, on_progress_args=None, on_progress_kwargs=None):
if not profile_path:
profile_path = s.get(["default_profile"])
if not machinecode_path:
path, _ = os.path.splitext(model_path)
machinecode_path = path + ".gco"
if position and isinstance(position, dict) and "x" in position and "y" in position:
posX = position["x"]
posY = position["y"]
else:
posX = None
posY = None
if on_progress:
if not on_progress_args:
on_progress_args = ()
if not on_progress_kwargs:
on_progress_kwargs = dict()
self._cura_logger.info("### Slicing %s to %s using profile stored at %s" % (model_path, machinecode_path, profile_path))
engine_settings = self._convert_to_engine(profile_path, printer_profile, posX, posY)
executable = s.get(["cura_engine"])
if not executable:
return False, "Path to CuraEngine is not configured "
working_dir, _ = os.path.split(executable)
args = ['"%s"' % executable, '-v', '-p']
for k, v in engine_settings.items():
args += ["-s", '"%s=%s"' % (k, str(v))]
args += ['-o', '"%s"' % machinecode_path, '"%s"' % model_path]
import sarge
command = " ".join(args)
self._logger.info("Running %r in %s" % (command, working_dir))
try:
p = sarge.run(command, cwd=working_dir, async=True, stdout=sarge.Capture(), stderr=sarge.Capture())
try:
with self._slicing_commands_mutex:
self._slicing_commands[machinecode_path] = p.commands[0]
with self._job_mutex:
if not profile_path:
profile_path = s.get(["default_profile"])
if not machinecode_path:
path, _ = os.path.splitext(model_path)
machinecode_path = path + ".gco"
if position and isinstance(position, dict) and "x" in position and "y" in position:
posX = position["x"]
posY = position["y"]
else:
posX = None
posY = None
if on_progress:
if not on_progress_args:
on_progress_args = ()
if not on_progress_kwargs:
on_progress_kwargs = dict()
self._cura_logger.info("### Slicing %s to %s using profile stored at %s" % (model_path, machinecode_path, profile_path))
engine_settings = self._convert_to_engine(profile_path, printer_profile, posX, posY)
executable = s.get(["cura_engine"])
if not executable:
return False, "Path to CuraEngine is not configured "
working_dir, _ = os.path.split(executable)
args = ['"%s"' % executable, '-v', '-p']
for k, v in engine_settings.items():
args += ["-s", '"%s=%s"' % (k, str(v))]
args += ['-o', '"%s"' % machinecode_path, '"%s"' % model_path]
import sarge
command = " ".join(args)
self._logger.info("Running %r in %s" % (command, working_dir))
p = sarge.run(command, cwd=working_dir, async=True, stdout=sarge.Capture(), stderr=sarge.Capture())
self._slicing_commands[machinecode_path] = p.commands[0]
try:
layer_count = None
step_factor = dict(
inset=0,
skin=1,
export=2
)
analysis = None
while p.returncode is None:
line = p.stderr.readline(timeout=0.5)
if not line:
@@ -331,17 +336,50 @@ class CuraPlugin(octoprint.plugin.SlicerPlugin,
continue
on_progress_kwargs["_progress"] = (step_factor[step] * layer_count + current_layer) / (layer_count * 3)
on_progress(*on_progress_args, **on_progress_kwargs)
elif line.startswith("Print time:"):
try:
print_time = int(line[len("Print time:"):].strip())
if analysis is None:
analysis = dict()
analysis["estimatedPrintTime"] = print_time
except:
pass
elif line.startswith("Filament:") or line.startswith("Filament2:"):
if line.startswith("Filament:"):
filament_str = line[len("Filament:"):].strip()
tool_key = "tool0"
else:
filament_str = line[len("Filament2:"):].strip()
tool_key = "tool1"
try:
filament = int(filament_str)
if analysis is None:
analysis = dict()
if not "filament" in analysis:
analysis["filament"] = dict()
if not tool_key in analysis["filament"]:
analysis["filament"][tool_key] = dict()
analysis["filament"][tool_key]["length"] = filament
if "filamentDiameter" in engine_settings:
radius_in_cm = float(int(engine_settings["filamentDiameter"]) / 10000.0) / 2.0
filament_in_cm = filament / 10.0
analysis["filament"][tool_key]["volume"] = filament_in_cm * math.pi * radius_in_cm * radius_in_cm
except:
pass
finally:
p.close()
with self._cancelled_jobs_mutex:
with self._job_mutex:
if machinecode_path in self._cancelled_jobs:
self._cura_logger.info("### Cancelled")
raise octoprint.slicing.SlicingCancelled()
self._cura_logger.info("### Finished, returncode %d" % p.returncode)
if p.returncode == 0:
return True, None
return True, dict(analysis=analysis)
else:
self._logger.warn("Could not slice via Cura, got return code %r" % p.returncode)
return False, "Got returncode %r" % p.returncode
@@ -353,21 +391,21 @@ class CuraPlugin(octoprint.plugin.SlicerPlugin,
return False, "Unknown error, please consult the log file"
finally:
with self._cancelled_jobs_mutex:
with self._job_mutex:
if machinecode_path in self._cancelled_jobs:
self._cancelled_jobs.remove(machinecode_path)
with self._slicing_commands_mutex:
if machinecode_path in self._slicing_commands:
del self._slicing_commands[machinecode_path]
self._cura_logger.info("-" * 40)
def cancel_slicing(self, machinecode_path):
with self._slicing_commands_mutex:
with self._job_mutex:
if machinecode_path in self._slicing_commands:
with self._cancelled_jobs_mutex:
self._cancelled_jobs.append(machinecode_path)
self._slicing_commands[machinecode_path].terminate()
self._cancelled_jobs.append(machinecode_path)
command = self._slicing_commands[machinecode_path]
if command is not None:
command.terminate()
self._logger.info("Cancelled slicing of %s" % machinecode_path)
def _load_profile(self, path):
@@ -152,6 +152,9 @@ class DiscoveryPlugin(octoprint.plugin.StartupPlugin,
def get_blueprint(self):
return blueprint
def is_blueprint_protected(self):
return False
##~~ StartupPlugin API -- used for registering OctoPrint's Zeroconf and SSDP services upon application startup
def on_startup(self, host, port):
+169 -12
View File
@@ -3,7 +3,6 @@ __author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
import time
import datetime
import threading
import copy
import os
@@ -17,6 +16,8 @@ from octoprint.events import eventManager, Events
from octoprint.filemanager.destinations import FileDestinations
from octoprint.plugin import plugin_manager, ProgressPlugin
def getConnectionOptions():
"""
Retrieves the available ports, baudrates, prefered port and baudrate for connecting to the printer.
@@ -34,6 +35,8 @@ class Printer():
from collections import deque
self._logger = logging.getLogger(__name__)
#self._estimationLogger = logging.getLogger("ESTIMATIONS")
#self._printTimeLogger = logging.getLogger("PRINT_TIME")
self._analysisQueue = analysisQueue
self._fileManager = fileManager
@@ -73,13 +76,17 @@ class Printer():
self._streamingFinishedCallback = None
self._selectedFile = None
self._timeEstimationData = None
# comm
self._comm = None
# callbacks
self._callbacks = []
# progress plugins
self._lastProgressReport = None
self._progressPlugins = plugin_manager().get_implementations(ProgressPlugin)
self._stateMonitor = StateMonitor(
ratelimit=0.5,
@@ -108,7 +115,8 @@ class Printer():
currentZ=None
)
eventManager().subscribe(Events.METADATA_ANALYSIS_FINISHED, self.onMetadataAnalysisFinished);
eventManager().subscribe(Events.METADATA_ANALYSIS_FINISHED, self.onMetadataAnalysisFinished)
eventManager().subscribe(Events.METADATA_STATISTICS_UPDATED, self.onMetadataStatisticsUpdated)
#~~ callback handling
@@ -158,6 +166,31 @@ class Printer():
self._selectedFile["filesize"],
self._selectedFile["sd"])
def onMetadataStatisticsUpdated(self, event, data):
self._setJobData(self._selectedFile["filename"],
self._selectedFile["filesize"],
self._selectedFile["sd"])
#~~ progress plugin reporting
def _reportPrintProgressToPlugins(self, progress):
if not progress or not self._selectedFile or not "sd" in self._selectedFile or not "filename" in self._selectedFile:
return
storage = "sdcard" if self._selectedFile["sd"] else "local"
filename = self._selectedFile["filename"]
def call_plugins(storage, filename, progress):
for name, plugin in self._progressPlugins.items():
try:
plugin.on_print_progress(storage, filename, progress)
except:
self._logger.exception("Exception while sending print progress to plugin %s" % name)
thread = threading.Thread(target=call_plugins, args=(storage, filename, progress))
thread.daemon = False
thread.start()
#~~ printer commands
def connect(self, port=None, baudrate=None, profile=None):
@@ -283,6 +316,8 @@ class Printer():
if self._selectedFile is None:
return
self._timeEstimationData = TimeEstimationHelper()
self._lastProgressReport = None
self._setCurrentZ(None)
self._comm.startPrint()
@@ -320,7 +355,7 @@ class Printer():
# mark print as failure
if self._selectedFile is not None:
self._fileManager.log_print(FileDestinations.SDCARD if self._selectedFile["sd"] else FileDestinations.LOCAL, self._selectedFile["filename"], time.time(), self._comm.getPrintTime(), False)
self._fileManager.log_print(FileDestinations.SDCARD if self._selectedFile["sd"] else FileDestinations.LOCAL, self._selectedFile["filename"], time.time(), self._comm.getPrintTime(), False, self._printerProfileManager.get_current_or_default()["id"])
payload = {
"file": self._selectedFile["filename"],
"origin": FileDestinations.LOCAL
@@ -347,18 +382,64 @@ class Printer():
self._messages.append(message)
self._stateMonitor.addMessage(message)
def _setProgressData(self, progress, filepos, printTime, printTimeLeft):
def _estimateTotalPrintTime(self, progress, printTime):
if not progress or not printTime or not self._timeEstimationData:
#self._estimationLogger.info("{progress};{printTime};;;;".format(**locals()))
return None
else:
newEstimate = printTime / progress
self._timeEstimationData.update(newEstimate)
result = None
if self._timeEstimationData.is_stable():
result = self._timeEstimationData.average_total_rolling
#averageTotal = self._timeEstimationData.average_total
#averageTotalRolling = self._timeEstimationData.average_total_rolling
#averageDistance = self._timeEstimationData.average_distance
#self._estimationLogger.info("{progress};{printTime};{newEstimate};{averageTotal};{averageTotalRolling};{averageDistance}".format(**locals()))
return result
def _setProgressData(self, progress, filepos, printTime, cleanedPrintTime):
estimatedTotalPrintTime = self._estimateTotalPrintTime(progress, cleanedPrintTime)
statisticalTotalPrintTime = None
totalPrintTime = estimatedTotalPrintTime
if self._selectedFile and "estimatedPrintTime" in self._selectedFile and self._selectedFile["estimatedPrintTime"]:
statisticalTotalPrintTime = self._selectedFile["estimatedPrintTime"]
if progress and cleanedPrintTime:
if estimatedTotalPrintTime is None:
totalPrintTime = statisticalTotalPrintTime
else:
if progress < 0.5:
sub_progress = progress * 2
else:
sub_progress = 1.0
totalPrintTime = (1 - sub_progress) * statisticalTotalPrintTime + sub_progress * estimatedTotalPrintTime
#self._printTimeLogger.info("{progress};{cleanedPrintTime};{estimatedTotalPrintTime};{statisticalTotalPrintTime};{totalPrintTime}".format(**locals()))
self._progress = progress
self._printTime = printTime
self._printTimeLeft = printTimeLeft
self._printTimeLeft = totalPrintTime - cleanedPrintTime if (totalPrintTime is not None and cleanedPrintTime is not None) else None
self._stateMonitor.setProgress({
"completion": self._progress * 100 if self._progress is not None else None,
"filepos": filepos,
"printTime": int(self._printTime) if self._printTime is not None else None,
"printTimeLeft": int(self._printTimeLeft * 60) if self._printTimeLeft is not None else None
"printTimeLeft": int(self._printTimeLeft) if self._printTimeLeft is not None else None
})
if progress:
progress_int = int(progress * 100)
if self._lastProgressReport != progress_int:
self._lastProgressReport = progress_int
self._reportPrintProgressToPlugins(progress_int)
def _addTemperatureData(self, temp, bedTemp):
currentTimeUtc = int(time.time())
@@ -388,7 +469,8 @@ class Printer():
self._selectedFile = {
"filename": filename,
"filesize": filesize,
"sd": sd
"sd": sd,
"estimatedPrintTime": None
}
else:
self._selectedFile = None
@@ -400,12 +482,15 @@ class Printer():
"date": None
},
"estimatedPrintTime": None,
"averagePrintTime": None,
"lastPrintTime": None,
"filament": None,
})
return
estimatedPrintTime = None
lastPrintTime = None
averagePrintTime = None
date = None
filament = None
if filename:
@@ -424,8 +509,18 @@ class Printer():
estimatedPrintTime = fileData["analysis"]["estimatedPrintTime"]
if "filament" in fileData["analysis"].keys():
filament = fileData["analysis"]["filament"]
if "prints" in fileData and fileData["prints"] and "last" in fileData["prints"] and fileData["prints"]["last"] and "lastPrintTime" in fileData["prints"]["last"]:
lastPrintTime = fileData["prints"]["last"]["lastPrintTime"]
if "statistics" in fileData:
printer_profile = self._printerProfileManager.get_current_or_default()["id"]
if "averagePrintTime" in fileData["statistics"] and printer_profile in fileData["statistics"]["averagePrintTime"]:
averagePrintTime = fileData["statistics"]["averagePrintTime"][printer_profile]
if "lastPrintTime" in fileData["statistics"] and printer_profile in fileData["statistics"]["lastPrintTime"]:
lastPrintTime = fileData["statistics"]["lastPrintTime"][printer_profile]
if averagePrintTime is not None:
self._selectedFile["estimatedPrintTime"] = averagePrintTime
elif estimatedPrintTime is not None:
# TODO apply factor which first needs to be tracked!
self._selectedFile["estimatedPrintTime"] = estimatedPrintTime
self._stateMonitor.setJobData({
"file": {
@@ -435,6 +530,7 @@ class Printer():
"date": date
},
"estimatedPrintTime": estimatedPrintTime,
"averagePrintTime": averagePrintTime,
"lastPrintTime": lastPrintTime,
"filament": filament,
})
@@ -485,9 +581,9 @@ class Printer():
if self._comm is not None and oldState == self._comm.STATE_PRINTING:
if self._selectedFile is not None:
if state == self._comm.STATE_OPERATIONAL:
self._fileManager.log_print(FileDestinations.SDCARD if self._selectedFile["sd"] else FileDestinations.LOCAL, self._selectedFile["filename"], time.time(), self._comm.getPrintTime(), True)
self._fileManager.log_print(FileDestinations.SDCARD if self._selectedFile["sd"] else FileDestinations.LOCAL, self._selectedFile["filename"], time.time(), self._comm.getPrintTime(), True, self._printerProfileManager.get_current_or_default()["id"])
elif state == self._comm.STATE_CLOSED or state == self._comm.STATE_ERROR or state == self._comm.STATE_CLOSED_WITH_ERROR:
self._fileManager.log_print(FileDestinations.SDCARD if self._selectedFile["sd"] else FileDestinations.LOCAL, self._selectedFile["filename"], time.time(), self._comm.getPrintTime(), False)
self._fileManager.log_print(FileDestinations.SDCARD if self._selectedFile["sd"] else FileDestinations.LOCAL, self._selectedFile["filename"], time.time(), self._comm.getPrintTime(), False, self._printerProfileManager.get_current_or_default()["id"])
self._analysisQueue.resume() # printing done, put those cpu cycles to good use
elif self._comm is not None and state == self._comm.STATE_PRINTING:
self._analysisQueue.pause() # do not analyse files while printing
@@ -507,7 +603,7 @@ class Printer():
Triggers storage of new values for printTime, printTimeLeft and the current progress.
"""
self._setProgressData(self._comm.getPrintProgress(), self._comm.getPrintFilepos(), self._comm.getPrintTime(), self._comm.getPrintTimeRemainingEstimate())
self._setProgressData(self._comm.getPrintProgress(), self._comm.getPrintFilepos(), self._comm.getPrintTime(), self._comm.getCleanedPrintTime())
def mcZChange(self, newZ):
"""
@@ -562,6 +658,9 @@ class Printer():
def mcReceivedRegisteredMessage(self, command, output):
self._sendFeedbackCommandOutput(command, output)
def mcForceDisconnect(self):
self.disconnect()
#~~ sd file handling
def getSdFiles(self):
@@ -580,6 +679,7 @@ class Printer():
existingSdFiles = map(lambda x: x[0], self._comm.getSdFiles())
remoteName = util.getDosFilename(filename, existingSdFiles)
self._timeEstimationData = TimeEstimationHelper()
self._comm.startFileTransfer(absolutePath, filename, remoteName)
return remoteName
@@ -778,3 +878,60 @@ class StateMonitor(object):
"offsets": self._offsets
}
class TimeEstimationHelper(object):
STABLE_THRESHOLD = 0.1
STABLE_COUNTDOWN = 250
STABLE_ROLLING_WINDOW = 250
def __init__(self):
import collections
self._distances = collections.deque([], self.__class__.STABLE_ROLLING_WINDOW)
self._totals = collections.deque([], self.__class__.STABLE_ROLLING_WINDOW)
self._sum_total = 0
self._count = 0
self._stable_counter = None
def is_stable(self):
return self._stable_counter is not None and self._stable_counter >= self.__class__.STABLE_COUNTDOWN
def update(self, newEstimate):
old_average_total = self.average_total
self._sum_total += newEstimate
self._totals.append(newEstimate)
self._count += 1
if old_average_total:
self._distances.append(abs(self.average_total - old_average_total))
if -1.0 * self.__class__.STABLE_THRESHOLD < self.average_distance < self.__class__.STABLE_THRESHOLD:
if self._stable_counter is None:
self._stable_counter = 0
else:
self._stable_counter += 1
else:
self._stable_counter = None
@property
def average_total(self):
if not self._count:
return None
else:
return self._sum_total / self._count
@property
def average_total_rolling(self):
if not self._count or self._count < self.__class__.STABLE_ROLLING_WINDOW:
return None
else:
return sum(self._totals) / len(self._totals)
@property
def average_distance(self):
if not self._count or self._count < self.__class__.STABLE_ROLLING_WINDOW + 1:
return None
else:
return sum(self._distances) / len(self._distances)
+103 -14
View File
@@ -9,17 +9,28 @@ __copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms
import os
import copy
import re
import logging
from octoprint.settings import settings
from octoprint.util import dict_merge, dict_clean
from octoprint.util import dict_merge, dict_clean, dict_contains_keys
class SaveError(Exception):
pass
class CouldNotOverwriteError(SaveError):
pass
class InvalidProfileError(Exception):
pass
class BedTypes(object):
RECTANGULAR = "rectangular"
CIRCULAR = "circular"
@classmethod
def values(cls):
return [getattr(cls, name) for name in cls.__dict__ if not name.startswith("__")]
class PrinterProfileManager(object):
default = dict(
@@ -51,8 +62,8 @@ class PrinterProfileManager(object):
def __init__(self):
self._current = None
self._folder = settings().getBaseFolder("printerProfiles")
self._logger = logging.getLogger(__name__)
def select(self, identifier):
if identifier is None or not self.exists(identifier):
@@ -69,11 +80,14 @@ class PrinterProfileManager(object):
return self._load_all()
def get(self, identifier):
if identifier == "_default":
return self._load_default()
elif self.exists(identifier):
return self._load_from_path(self._get_profile_path(identifier))
else:
try:
if identifier == "_default":
return self._load_default()
elif self.exists(identifier):
return self._load_from_path(self._get_profile_path(identifier))
else:
return None
except InvalidProfileError:
return None
def remove(self, identifier):
@@ -87,7 +101,7 @@ class PrinterProfileManager(object):
elif "name" in profile:
identifier = profile["name"]
else:
raise ValueError("profile must contain either id or name")
raise InvalidProfileError("profile must contain either id or name")
identifier = self._sanitize(identifier)
profile["id"] = identifier
@@ -95,6 +109,9 @@ class PrinterProfileManager(object):
if identifier == "_default":
default_profile = dict_merge(self._load_default(), profile)
if not self._ensure_valid_profile(default_profile):
raise InvalidProfileError()
settings().set(["printerProfiles", "defaultProfile"], default_profile, defaults=dict(printerProfiles=dict(defaultProfile=self.__class__.default)))
settings().save()
else:
@@ -144,10 +161,13 @@ class PrinterProfileManager(object):
all_identifiers = self._load_all_identifiers()
results = dict()
for identifier, path in all_identifiers.items():
if identifier == "_default":
profile = self._load_default()
else:
profile = self._load_from_path(path)
try:
if identifier == "_default":
profile = self._load_default()
else:
profile = self._load_from_path(path)
except InvalidProfileError:
continue
if profile is None:
continue
@@ -176,9 +196,17 @@ class PrinterProfileManager(object):
import yaml
with open(path) as f:
profile = yaml.safe_load(f)
profile = self._ensure_valid_profile(profile)
if not profile:
self._logger.warn("Invalid profile: %s" % path)
raise InvalidProfileError()
return profile
def _save_to_path(self, path, profile, allow_overwrite=False):
validated_profile = self._ensure_valid_profile(profile)
if not validated_profile:
raise InvalidProfileError()
if os.path.exists(path) and not allow_overwrite:
raise SaveError("Profile %s already exists and not allowed to overwrite" % profile["id"])
@@ -197,8 +225,12 @@ class PrinterProfileManager(object):
return False
def _load_default(self):
default_profile = settings().get(["printerProfiles", "defaultProfile"])
return dict_merge(copy.deepcopy(self.__class__.default), default_profile)
default_overrides = settings().get(["printerProfiles", "defaultProfile"])
profile = self._ensure_valid_profile(dict_merge(copy.deepcopy(self.__class__.default), default_overrides))
if not profile:
self._logger.warn("Invalid default profile after applying overrides")
raise InvalidProfileError()
return profile
def _get_profile_path(self, identifier):
return os.path.join(self._folder, "%s.profile" % identifier)
@@ -216,3 +248,60 @@ class PrinterProfileManager(object):
sanitized_name = sanitized_name.replace(" ", "_")
return sanitized_name
def _ensure_valid_profile(self, profile):
# ensure all keys are present
if not dict_contains_keys(self.default, profile):
return False
# conversion helper
def convert_value(profile, path, converter):
value = profile
for part in path[:-1]:
if not isinstance(value, dict) or not part in value:
raise RuntimeError("%s is not contained in profile" % ".".join(path))
value = value[part]
if not isinstance(value, dict) or not path[-1] in value:
raise RuntimeError("%s is not contained in profile" % ".".join(path))
value[path[-1]] = converter(value[path[-1]])
# convert ints
for path in (("extruder", "count"), ("axes", "x", "speed"), ("axes", "y", "speed"), ("axes", "z", "speed")):
try:
convert_value(profile, path, int)
except:
return False
# convert floats
for path in (("volume", "width"), ("volume", "depth"), ("volume", "height"), ("extruder", "nozzleDiameter")):
try:
convert_value(profile, path, float)
except:
return False
# convert booleans
for path in (("axes", "x", "inverted"), ("axes", "y", "inverted"), ("axes", "z", "inverted")):
try:
convert_value(profile, path, bool)
except:
return False
# validate form factor
if not profile["volume"]["formFactor"] in BedTypes.values():
return False
# validate offsets
offsets = []
for offset in profile["extruder"]["offsets"]:
if not len(offset) == 2:
return False
x_offset, y_offset = offset
try:
offsets.append((float(x_offset), float(y_offset)))
except:
return False
profile["extruder"]["offsets"] = offsets
return profile
+8 -1
View File
@@ -216,6 +216,8 @@ class Server():
from tornado.ioloop import IOLoop
from tornado.web import Application
import sys
debug = self._debug
# first initialize the settings singleton and make sure it uses given configfile and basedir if available
@@ -224,6 +226,9 @@ class Server():
# then initialize logging
self._initLogging(self._debug, self._logConf)
logger = logging.getLogger(__name__)
def exception_logger(exc_type, exc_value, exc_tb):
logger.error("Uncaught exception", exc_info=(exc_type, exc_value, exc_tb))
sys.excepthook = exception_logger
logger.info("Starting OctoPrint %s" % DISPLAY_VERSION)
# then initialize the plugin manager
@@ -275,8 +280,10 @@ class Server():
app.wsgi_app,
settings().get(["server", "reverseProxy", "prefixHeader"]),
settings().get(["server", "reverseProxy", "schemeHeader"]),
settings().get(["server", "reverseProxy", "hostHeader"]),
settings().get(["server", "reverseProxy", "prefixFallback"]),
settings().get(["server", "reverseProxy", "prefixScheme"])
settings().get(["server", "reverseProxy", "schemeFallback"]),
settings().get(["server", "reverseProxy", "hostFallback"])
)
secret_key = settings().get(["server", "secretKey"])
+1 -1
View File
@@ -32,7 +32,7 @@ def connectionState():
@restricted_access
def connectionCommand():
valid_commands = {
"connect": ["autoconnect"],
"connect": [],
"disconnect": []
}
+6 -5
View File
@@ -89,9 +89,9 @@ def _getFileList(origin, filter=None):
failure = 0
last = None
for entry in history:
success += 1 if entry["success"] else 0
failure += 1 if not entry["success"] else 0
if not last or entry["timestamp"] > last["timestamp"]:
success += 1 if "success" in entry and entry["success"] else 0
failure += 1 if "success" in entry and not entry["success"] else 0
if not last or ("timestamp" in entry and "timestamp" in last and entry["timestamp"] > last["timestamp"]):
last = entry
if last:
prints = dict(
@@ -99,10 +99,11 @@ def _getFileList(origin, filter=None):
failure=failure,
last=dict(
success=last["success"],
date=last["timestamp"],
printTime=last["printTime"]
date=last["timestamp"]
)
)
if "printTime" in last:
prints["last"]["printTime"] = last["printTime"]
file["prints"] = prints
file.update({
+8 -7
View File
@@ -300,7 +300,6 @@ def printerSdState():
@api.route("/printer/command", methods=["POST"])
@restricted_access
def printerCommand():
# TODO: document me
if not printer.isOperational():
return make_response("Printer is not operational", 409)
@@ -309,15 +308,17 @@ def printerCommand():
data = request.json
parameters = {}
if "parameters" in data.keys():
parameters = data["parameters"]
parameters = dict()
if "parameters" in data.keys(): parameters = data["parameters"]
commands = []
if "command" in data.keys():
if "command" in data and "commands" in data:
return make_response("'command' and 'commands' are mutually exclusive", 400)
elif "command" in data:
commands = [data["command"]]
elif "commands" in data.keys():
elif "commands" in data and isinstance(data["commands"], (list, tuple)):
commands = data["commands"]
else:
return make_response("Need either single 'command' or list of 'commands'", 400)
commandsToSend = []
for command in commands:
+22 -67
View File
@@ -15,6 +15,7 @@ from octoprint.server.util.flask import restricted_access
from octoprint.util import dict_merge
from octoprint.server import printerProfileManager
from octoprint.printer.profile import InvalidProfileError, CouldNotOverwriteError, SaveError
@api.route("/printerprofiles", methods=["GET"])
@@ -42,18 +43,26 @@ def printerProfilesAdd():
del base_profile["id"]
if "name" in base_profile:
del base_profile["name"]
profile = dict_merge(base_profile, json_data["profile"])
if not _validate_profile(profile):
return None, None, make_response("Profile is invalid, missing obligatory values", 400)
return _overwrite_profile(profile)
profile = dict_merge(base_profile, json_data["profile"])
try:
saved_profile = printerProfileManager.save(profile, allow_overwrite=False)
except InvalidProfileError:
return make_response("Profile is invalid", 400)
except CouldNotOverwriteError:
return make_response("Profile already exists and overwriting was not allowed", 400)
except Exception as e:
return make_response("Could not save profile: %s" % e.message, 500)
else:
return jsonify(dict(profile=_convert_profile(saved_profile)))
@api.route("/printerprofiles/<string:identifier>", methods=["GET"])
def printerProfilesGet(identifier):
profile = printerProfileManager.get(identifier)
if profile is None:
make_response("Unknown profile: %s" % identifier, 404)
return jsonify(_convert_profile(profile))
return make_response("Unknown profile: %s" % identifier, 404)
else:
return jsonify(_convert_profile(profile))
@api.route("/printerprofiles/<string:identifier>", methods=["DELETE"])
@restricted_access
@@ -84,15 +93,17 @@ def printerProfilesUpdate(identifier):
del new_profile["default"]
new_profile["id"] = identifier
if not _validate_profile(new_profile):
make_response("Combined profile is invalid, missing obligatory values", 400)
try:
saved_profile = printerProfileManager.save(new_profile, allow_overwrite=True, make_default=make_default)
except InvalidProfileError:
return make_response("Profile is invalid", 400)
except CouldNotOverwriteError:
return make_response("Profile already exists and overwriting was not allowed", 400)
except Exception as e:
make_response("Could not save profile: %s" % e.message)
return jsonify(dict(profile=_convert_profile(saved_profile)))
return make_response("Could not save profile: %s" % e.message, 500)
else:
return jsonify(dict(profile=_convert_profile(saved_profile)))
def _convert_profiles(profiles):
result = dict()
@@ -109,59 +120,3 @@ def _convert_profile(profile):
converted["default"] = (profile["id"] == default)
converted["current"] = (profile["id"] == current)
return converted
def _validate_profile(profile):
if not "name" in profile \
and "volume" in profile \
and "width" in profile["volume"] \
and "depth" in profile["volume"] \
and "height" in profile["volume"] \
and "formFactor" in profile["volume"] \
and "heatedBed" in profile \
and "extruder" in profile \
and "count" in profile["extruder"] \
and "offsets" in profile["extruder"] \
and len(profile["extruder"]["offsets"]) == profile["extruder"]["count"]:
return False
for dimension in ("width", "depth", "height"):
try:
profile["volume"][dimension] = float(profile["volume"][dimension])
except:
return False
if not profile["volume"]["formFactor"] in ("rectangular", "circular"):
return False
try:
profile["heatedBed"] = bool(profile["heatedBed"])
except:
return False
try:
profile["extruder"]["count"] = int(profile["extruder"]["count"])
except:
return False
converted_offsets = []
for offset in profile["extruder"]["offsets"]:
try:
converted_offsets.append((float(offset[0]), float(offset[0])))
except:
return False
profile["extruder"]["offsets"] = converted_offsets
return True
def _overwrite_profile(profile):
if not "id" in profile and not "name" in profile:
return None, None, make_response("Profile must contain either id or name")
elif not "name" in profile:
return None, None, make_response("Profile must contain a name")
try:
saved_profile = printerProfileManager.save(profile, allow_overwrite=False)
except Exception as e:
return None, None, make_response("Could not save profile: %s" % e.message)
return jsonify(dict(profile=_convert_profile(saved_profile)))
+11 -1
View File
@@ -35,6 +35,10 @@ def getSettings():
"key": s.get(["api", "key"]) if admin_permission.can() else "n/a",
"allowCrossOrigin": s.get(["api", "allowCrossOrigin"])
},
"appearance": {
"name": s.get(["appearance", "name"]),
"color": s.get(["appearance", "color"])
},
"printer": {
"defaultExtrusionLength": s.getInt(["printerParameters", "defaultExtrusionLength"])
},
@@ -55,7 +59,8 @@ def getSettings():
"sdSupport": s.getBoolean(["feature", "sdSupport"]),
"sdAlwaysAvailable": s.getBoolean(["feature", "sdAlwaysAvailable"]),
"swallowOkAfterResend": s.getBoolean(["feature", "swallowOkAfterResend"]),
"repetierTargetTemp": s.getBoolean(["feature", "repetierTargetTemp"])
"repetierTargetTemp": s.getBoolean(["feature", "repetierTargetTemp"]),
"keyboardControl": s.getBoolean(["feature", "keyboardControl"])
},
"serial": {
"port": connectionOptions["portPreference"],
@@ -120,6 +125,10 @@ def setSettings():
if "key" in data["api"].keys(): s.set(["api", "key"], data["api"]["key"], True)
if "allowCrossOrigin" in data["api"].keys(): s.setBoolean(["api", "allowCrossOrigin"], data["api"]["allowCrossOrigin"])
if "appearance" in data.keys():
if "name" in data["appearance"].keys(): s.set(["appearance", "name"], data["appearance"]["name"])
if "color" in data["appearance"].keys(): s.set(["appearance", "color"], data["appearance"]["color"])
if "printer" in data.keys():
if "defaultExtrusionLength" in data["printer"]: s.setInt(["printerParameters", "defaultExtrusionLength"], data["printer"]["defaultExtrusionLength"])
@@ -141,6 +150,7 @@ def setSettings():
if "sdAlwaysAvailable" in data["feature"].keys(): s.setBoolean(["feature", "sdAlwaysAvailable"], data["feature"]["sdAlwaysAvailable"])
if "swallowOkAfterResend" in data["feature"].keys(): s.setBoolean(["feature", "swallowOkAfterResend"], data["feature"]["swallowOkAfterResend"])
if "repetierTargetTemp" in data["feature"].keys(): s.setBoolean(["feature", "repetierTargetTemp"], data["feature"]["repetierTargetTemp"])
if "keyboardControl" in data["feature"].keys(): s.setBoolean(["feature", "keyboardControl"], data["feature"]["keyboardControl"])
if "serial" in data.keys():
if "autoconnect" in data["serial"].keys(): s.setBoolean(["serial", "autoconnect"], data["serial"]["autoconnect"])
+17 -3
View File
@@ -147,20 +147,25 @@ class ReverseProxied(object):
:param app: the WSGI application
:param header_script_name: the HTTP header in the wsgi environment from which to determine the prefix
:param header_scheme: the HTTP header in the wsgi environment from which to determine the scheme
:param header_host: the HTTP header in the wsgi environment from which to determine the host for which to generate external URLs
:param base_url: the prefix to use as fallback if headers are not set
:param scheme: the scheme to use as fallback if headers are not set
:param host: the host to use as fallback if headers are not set
"""
def __init__(self, app, header_prefix="x-script-name", header_scheme="x-scheme", base_url="", scheme=""):
def __init__(self, app, header_prefix="x-script-name", header_scheme="x-scheme", header_host="x-forwarded-host", base_url="", scheme="", host=""):
self.app = app
# headers for prefix & scheme, converted to conform to WSGI format
# headers for prefix & scheme & host, converted to conform to WSGI format
to_wsgi_format = lambda header: "HTTP_" + header.upper().replace("-", "_")
self._header_prefix = to_wsgi_format(header_prefix)
self._header_scheme = to_wsgi_format(header_scheme)
self._header_host = to_wsgi_format(header_host)
# fallback prefix & scheme from config
# fallback prefix & scheme & host from config
self._fallback_prefix = base_url
self._fallback_scheme = scheme
self._fallback_host = host
def __call__(self, environ, start_response):
# determine prefix
@@ -184,6 +189,15 @@ class ReverseProxied(object):
if scheme:
environ["wsgi.url_scheme"] = scheme
# determine host
host = environ.get(self._header_host, "")
if not host:
host = self._fallback_host
# rewrite host header based on host
if host:
environ["HTTP_HOST"] = host
# call wrapped app with rewritten environment
return self.app(environ, start_response)
+11 -6
View File
@@ -34,6 +34,8 @@ class PrinterStateConnection(sockjs.tornado.SockJSConnection):
self._eventManager = eventManager
self._pluginManager = pluginManager
self._remoteAddress = None
def _getRemoteAddress(self, info):
forwardedFor = info.headers.get("X-Forwarded-For")
if forwardedFor is not None:
@@ -41,8 +43,8 @@ class PrinterStateConnection(sockjs.tornado.SockJSConnection):
return info.ip
def on_open(self, info):
remoteAddress = self._getRemoteAddress(info)
self._logger.info("New connection from client: %s" % remoteAddress)
self._remoteAddress = self._getRemoteAddress(info)
self._logger.info("New connection from client: %s" % self._remoteAddress)
# connected => update the API key, might be necessary if the client was left open while the server restarted
self._emit("connected", {"apikey": octoprint.server.UI_API_KEY, "version": octoprint.server.VERSION, "display_version": octoprint.server.DISPLAY_VERSION})
@@ -52,20 +54,20 @@ class PrinterStateConnection(sockjs.tornado.SockJSConnection):
octoprint.timelapse.registerCallback(self)
self._pluginManager.register_client(self)
self._eventManager.fire(Events.CLIENT_OPENED, {"remoteAddress": remoteAddress})
self._eventManager.fire(Events.CLIENT_OPENED, {"remoteAddress": self._remoteAddress})
for event in octoprint.events.all_events():
self._eventManager.subscribe(event, self._onEvent)
octoprint.timelapse.notifyCallbacks(octoprint.timelapse.current)
def on_close(self):
self._logger.info("Client connection closed")
self._logger.info("Client connection closed: %s" % self._remoteAddress)
self._printer.unregisterCallback(self)
self._fileManager.unregister_slicingprogress_callback(self)
octoprint.timelapse.unregisterCallback(self)
self._pluginManager.unregister_client(self)
self._eventManager.fire(Events.CLIENT_CLOSED)
self._eventManager.fire(Events.CLIENT_CLOSED, {"remoteAddress": self._remoteAddress})
for event in octoprint.events.all_events():
self._eventManager.unsubscribe(event, self._onEvent)
@@ -137,4 +139,7 @@ class PrinterStateConnection(sockjs.tornado.SockJSConnection):
self.sendEvent(event, payload)
def _emit(self, type, payload):
self.send({type: payload})
try:
self.send({type: payload})
except Exception as e:
self._logger.warn("Could not send message to client %s: %s" % (self._remoteAddress, e.message))
+3 -2
View File
@@ -194,7 +194,8 @@ class UploadStorageFallbackHandler(tornado.web.RequestHandler):
end_of_header = None
if delimiter_loc != -1:
# found the delimiter in the currently available data
data, self._buffer = data[0:delimiter_loc], data[delimiter_loc:]
delimiter_data_end = 0 if delimiter_loc == 0 else delimiter_loc - 2
data, self._buffer = data[0:delimiter_data_end], data[delimiter_loc:]
end_of_header = self._buffer.find("\r\n\r\n")
else:
# make sure any boundary (with single or double ==) contained at the end of chunk does not get
@@ -339,7 +340,7 @@ class UploadStorageFallbackHandler(tornado.web.RequestHandler):
if "content_type" in part and part["content_type"] is not None:
self._new_body += b"Content-Type: %s\r\n" % part["content_type"]
self._new_body += b"\r\n"
self._new_body += value
self._new_body += value + b"\r\n"
self._new_body += b"--%s--\r\n" % self._multipart_boundary
def _handle_method(self, *args, **kwargs):
+21 -12
View File
@@ -45,8 +45,10 @@ default_settings = {
"reverseProxy": {
"prefixHeader": "X-Script-Name",
"schemeHeader": "X-Scheme",
"hostHeader": "X-Forwarded-Host",
"prefixFallback": "",
"schemeFallback": ""
"schemeFallback": "",
"hostFallback": ""
},
"uploads": {
"maxSize": 1 * 1024 * 1024 * 1024, # 1GB
@@ -84,7 +86,8 @@ default_settings = {
"sdSupport": True,
"sdAlwaysAvailable": False,
"swallowOkAfterResend": True,
"repetierTargetTemp": False
"repetierTargetTemp": False,
"keyboardControl": True
},
"folder": {
"uploads": None,
@@ -111,6 +114,10 @@ default_settings = {
"pauseTriggers": [],
"defaultExtrusionLength": 5
},
"appearance": {
"name": "",
"color": "default"
},
"controls": [],
"system": {
"actions": []
@@ -158,10 +165,21 @@ default_settings = {
"okWithLinenumber": False,
"numExtruders": 1,
"includeCurrentToolInTemps": True,
"movementSpeed": {
"x": 6000,
"y": 6000,
"z": 200,
"e": 300
},
"hasBed": True,
"repetierStyleTargetTemperature": False,
"smoothieTemperatureReporting": False,
"extendedSdFileList": False
"extendedSdFileList": False,
"throttle": 0.01,
"waitOnLongMoves": False,
"rxBuffer": 64,
"txBuffer": 40,
"commandBuffer": 4
}
}
}
@@ -281,15 +299,6 @@ class Settings(object):
dirty = True
if "appearance" in self._config:
if "name" in self._config["appearance"]:
default_profile["name"] = self._config["appearance"]["name"]
if "color" in self._config["appearance"]:
default_profile["color"] = self._config["appearance"]["color"]
del self._config["appearance"]
dirty = True
if dirty:
if not "printerProfiles" in self._config:
self._config["printerProfiles"] = dict()
+2
View File
@@ -136,6 +136,8 @@ class SlicingManager(object):
if not ok:
callback_kwargs.update(dict(_error=result))
elif result is not None and isinstance(result, dict) and "analysis" in result:
callback_kwargs.update(dict(_analysis=result["analysis"]))
except SlicingCancelled:
callback_kwargs.update(dict(_cancelled=True))
finally:
+1 -1
View File
@@ -1 +1 @@
.btn{display:inline-block;*display:inline;*zoom:1;padding:4px 12px;margin-bottom:0;font-size:14px;line-height:20px;text-align:center;vertical-align:middle;cursor:pointer;color:#333;text-shadow:0 1px 1px rgba(255,255,255,.75);background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);*background-color:#e6e6e6;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);border:1px solid #ccc;*border:0;border-bottom-color:#b3b3b3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*margin-left:.3em;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05)}.btn:hover,.btn:focus,.btn:active,.btn.active,.btn.disabled,.btn[disabled]{color:#333;background-color:#e6e6e6;*background-color:#d9d9d9}.btn:active,.btn.active{background-color:#ccc \9}.btn:first-child{*margin-left:0}.btn:hover,.btn:focus{color:#333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05)}.btn.disabled,.btn[disabled]{cursor:default;background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-large{padding:11px 19px;font-size:17.5px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.btn-large [class^=icon-],.btn-large [class*=" icon-"]{margin-top:4px}.btn-small{padding:2px 10px;font-size:11.9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-small [class^=icon-],.btn-small [class*=" icon-"]{margin-top:0}.btn-mini [class^=icon-],.btn-mini [class*=" icon-"]{margin-top:-1px}.btn-mini{padding:0 6px;font-size:10.5px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-block{display:block;width:100%;padding-left:0;padding-right:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.btn-block+.btn-block{margin-top:5px}input[type=submit].btn-block,input[type=reset].btn-block,input[type=button].btn-block{width:100%}.btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active,.btn-inverse.active{color:rgba(255,255,255,.75)}.btn-primary{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25);background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);border-color:#04c #04c #002a80;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);*background-color:#04c;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.btn-primary:active,.btn-primary.active{background-color:#039 \9}.btn-warning{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25);background-color:#faa732;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0);border-color:#f89406 #f89406 #ad6704;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);*background-color:#f89406;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-warning:hover,.btn-warning:focus,.btn-warning:active,.btn-warning.activeLine truncated
.btn{display:inline-block;*display:inline;*zoom:1;padding:4px 12px;margin-bottom:0;font-size:14px;line-height:20px;text-align:center;vertical-align:middle;cursor:pointer;color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe6e6e6',GradientType=0);border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#e6e6e6;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);border:1px solid #ccc;*border:0;border-bottom-color:#b3b3b3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*margin-left:.3em;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05)}.btn:hover,.btn:focus,.btn:active,.btn.active,.btn.disabled,.btn[disabled]{color:#333;background-color:#e6e6e6;*background-color:#d9d9d9}.btn:active,.btn.active{background-color:#ccc \9}.btn:first-child{*margin-left:0}.btn:hover,.btn:focus{color:#333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05)}.btn.disabled,.btn[disabled]{cursor:default;background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-large{padding:11px 19px;font-size:17.5px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.btn-large [class^="icon-"],.btn-large [class*=" icon-"]{margin-top:4px}.btn-small{padding:2px 10px;font-size:11.9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-small [class^="icon-"],.btn-small [class*=" icon-"]{margin-top:0}.btn-mini [class^="icon-"],.btn-mini [class*=" icon-"]{margin-top:-1px}.btn-mini{padding:0 6px;font-size:10.5px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-block{display:block;width:100%;padding-left:0;padding-right:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active,.btn-inverse.active{color:rgba(255,255,255,0.75)}.btn-primary{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);border-color:#04c #04c #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#04c;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.btn-primary:active,.btn-primary.active{background-color:#039 \9}.btn-warning{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#faa732;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0);border-color:#f89406 #f89406 #ad6704;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#f89406;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}.btn-warning:hover,.btn-warning:focus,.btn-warning:aLine truncated
+15
View File
@@ -342,6 +342,21 @@ function formatDuration(seconds) {
return _.sprintf(gettext(/* L10N: duration format */ "%(hour)02d:%(minute)02d:%(second)02d"), {hour: h, minute: m, second: s});
}
function formatFuzzyEstimation(seconds, base) {
if (!seconds) return "-";
if (seconds < 0) return "-";
var m;
if (base != undefined) {
m = moment(base);
} else {
m = moment();
}
m.add(seconds, "s");
return m.fromNow(true);
}
function formatDate(unixTimestamp) {
if (!unixTimestamp) return "-";
return moment.unix(unixTimestamp).format(gettext(/* L10N: Date format */ "YYYY-MM-DD HH:mm"));
@@ -1,33 +1,20 @@
function AppearanceViewModel(settingsViewModel, printerStateViewModel) {
var self = this;
self.settings = settingsViewModel;
self.printerState = printerStateViewModel;
self.connected = ko.observable(false);
self.printerState.isErrorOrClosed.subscribe(function() {
self.connected(!self.printerState.isErrorOrClosed());
});
self.name = settingsViewModel.appearance_name;
self.color = settingsViewModel.appearance_color;
self.brand = ko.computed(function() {
if (self.settings.printerProfiles.currentProfileData().name() && self.connected())
return gettext("OctoPrint") + ": " + self.settings.printerProfiles.currentProfileData().name();
if (self.name())
return gettext("OctoPrint") + ": " + self.name();
else
return gettext("OctoPrint");
});
self.title = ko.computed(function() {
if (self.settings.printerProfiles.currentProfileData().name() && self.connected())
return self.settings.printerProfiles.currentProfileData().name() + " [" + gettext("OctoPrint") + "]";
if (self.name())
return self.name() + " [" + gettext("OctoPrint") + "]";
else
return gettext("OctoPrint");
});
self.color = ko.computed(function() {
if (self.settings.printerProfiles.currentProfileData().color() && self.connected())
return self.settings.printerProfiles.currentProfileData().color();
else
return "default";
});
}
@@ -62,6 +62,7 @@ function ConnectionViewModel(loginStateViewModel, settingsViewModel, printerProf
var portPreference = response.options.portPreference;
var baudratePreference = response.options.baudratePreference;
var printerPreference = response.options.printerProfilePreference;
var printerProfiles = response.options.printerProfiles;
self.portOptions(ports);
self.baudrateOptions(baudrates);
@@ -26,6 +26,15 @@ function ControlViewModel(loginStateViewModel, settingsViewModel) {
self.feedbackControlLookup = {};
self.keycontrolActive = ko.observable(false);
self.keycontrolHelpActive = ko.observable(false);
self.keycontrolPossible = ko.computed(function() {
return self.isOperational() && !self.isPrinting() && self.loginState.isUser() && !$.browser.mobile;
});
self.showKeycontrols = ko.computed(function() {
return self.keycontrolActive() && self.keycontrolPossible();
});
self.settings.printerProfiles.currentProfileData.subscribe(function() {
self._updateExtruderCount();
self.settings.printerProfiles.currentProfileData().extruder.count.subscribe(self._updateExtruderCount);
@@ -114,7 +123,7 @@ function ControlViewModel(loginStateViewModel, settingsViewModel) {
self.sendJogCommand = function(axis, multiplier, distance) {
if (typeof distance === "undefined")
distance = $('#jog_distance button.active').data('distance');
if (self.settings.getPrinterInvertAxis(axis)) {
if (self.settings.printerProfiles.currentProfileData() && self.settings.printerProfiles.currentProfileData()["axes"] && self.settings.printerProfiles.currentProfileData()["axes"][axis] && self.settings.printerProfiles.currentProfileData()["axes"][axis]["inverted"]()) {
multiplier *= -1;
}
@@ -236,9 +245,6 @@ function ControlViewModel(loginStateViewModel, settingsViewModel) {
callback();
}
if (data === undefined)
return;
};
self.displayMode = function(customControl) {
@@ -263,4 +269,110 @@ function ControlViewModel(loginStateViewModel, settingsViewModel) {
self.onStartup = function() {
self.requestData();
};
self.onFocus = function(data, event) {
if (!self.settings.feature_keyboardControl()) return;
self.keycontrolActive(true);
};
self.onMouseOver = function(data, event) {
if (!self.settings.feature_keyboardControl()) return;
$("#webcam_container").focus();
self.keycontrolActive(true);
};
self.onMouseOut = function(data, event) {
if (!self.settings.feature_keyboardControl()) return;
$("#webcam_container").blur();
self.keycontrolActive(false);
};
self.toggleKeycontrolHelp = function() {
self.keycontrolHelpActive(!self.keycontrolHelpActive());
};
self.onKeyDown = function(data, event) {
if (!self.settings.feature_keyboardControl()) return;
var button = undefined;
var visualizeClick = true;
switch(event.which) {
case 37: // left arrow key
// X-
button = $("#control-xdec");
break;
case 38: // up arrow key
// Y+
button = $("#control-yinc");
break;
case 39: // right arrow key
// X+
button = $("#control-xinc");
break;
case 40: // down arrow key
// Y-
button = $("#control-ydec");
break;
case 49: // number 1
case 97: // numpad 1
// Distance 0.1
button = $("#control-distance01");
visualizeClick = false;
break;
case 50: // number 2
case 98: // numpad 2
// Distance 1
button = $("#control-distance1");
visualizeClick = false;
break;
case 51: // number 3
case 99: // numpad 3
// Distance 10
button = $("#control-distance10");
visualizeClick = false;
break;
case 52: // number 4
case 100: // numpad 4
// Distance 100
button = $("#control-distance100");
visualizeClick = false;
break;
case 33: // page up key
case 87: // w key
// z lift up
button = $("#control-zinc");
break;
case 34: // page down key
case 83: // s key
// z lift down
button = $("#control-zdec");
break;
case 36: // home key
// xy home
button = $("#control-xyhome");
break;
case 35: // end key
// z home
button = $("#control-zhome");
break;
default:
event.preventDefault();
return false;
}
if (button === undefined) {
return false;
} else {
event.preventDefault();
if (visualizeClick) {
button.addClass("active");
setTimeout(function() {
button.removeClass("active");
}, 150);
}
button.click();
}
};
}
@@ -391,14 +391,6 @@ function GcodeViewModel(loginStateViewModel, settingsViewModel) {
} else {
var output = [];
output.push(gettext("Model size") + ": " + model.width.toFixed(2) + "mm &times; " + model.depth.toFixed(2) + "mm &times; " + model.height.toFixed(2) + "mm");
if (model.filament.length == 0) {
output.push(gettext("Total filament used") + ": " + model.filament.toFixed(2) + gettext("mm"));
} else {
for (var i = 0; i < model.filament.length; i++) {
output.push(gettext("Total filament used") + " (" + gettext("Tool") + " " + i + "): " + model.filament[i].toFixed(2) + gettext("mm"));
}
}
output.push(gettext("Estimated print time") + ": " + formatDuration(model.printTime));
output.push(gettext("Estimated layer height") + ": " + model.layerHeight.toFixed(2) + gettext("mm"));
output.push(gettext("Layer count") + ": " + model.layersPrinted.toFixed(0) + " " + gettext("printed") + ", " + model.layersTotal.toFixed(0) + " " + gettext("visited"));
@@ -215,7 +215,7 @@ function PrinterProfilesViewModel() {
self.editorVolumeHeight(data.volume.height);
self.editorVolumeFormFactor(data.volume.formFactor);
self.editorHeatedBed(data.volume.heatedBed);
self.editorHeatedBed(data.heatedBed);
self.editorNozzleDiameter(data.extruder.nozzleDiameter);
self.editorExtruders(data.extruder.count);
@@ -268,30 +268,30 @@ function PrinterProfilesViewModel() {
color: self.editorColor(),
model: self.editorModel(),
volume: {
width: self.editorVolumeWidth(),
depth: self.editorVolumeDepth(),
height: self.editorVolumeHeight(),
width: parseFloat(self.editorVolumeWidth()),
depth: parseFloat(self.editorVolumeDepth()),
height: parseFloat(self.editorVolumeHeight()),
formFactor: self.editorVolumeFormFactor()
},
heatedBed: self.editorHeatedBed(),
extruder: {
count: self.editorExtruders(),
count: parseInt(self.editorExtruders()),
offsets: [
[0.0, 0.0]
],
nozzleDiameter: self.editorNozzleDiameter()
nozzleDiameter: parseFloat(self.editorNozzleDiameter())
},
axes: {
x: {
speed: self.editorAxisXSpeed(),
speed: parseInt(self.editorAxisXSpeed()),
inverted: self.editorAxisXInverted()
},
y: {
speed: self.editorAxisYSpeed(),
speed: parseInt(self.editorAxisYSpeed()),
inverted: self.editorAxisYInverted()
},
z: {
speed: self.editorAxisZSpeed(),
speed: parseInt(self.editorAxisZSpeed()),
inverted: self.editorAxisZInverted()
}
}
@@ -301,7 +301,7 @@ function PrinterProfilesViewModel() {
for (var i = 1; i < self.editorExtruders(); i++) {
var offset = [0.0, 0.0];
if (i < self.editorExtruderOffsets().length) {
offset = self.editorExtruderOffsets()[i];
offset = [parseFloat(self.editorExtruderOffsets()[i]["x"]()), parseFloat(self.editorExtruderOffsets()[i]["y"]())];
}
profile.extruder.offsets.push(offset);
}
@@ -62,9 +62,15 @@ function PrinterStateViewModel(loginStateViewModel) {
return formatDuration(self.printTime());
});
self.printTimeLeftString = ko.computed(function() {
if (!self.printTimeLeft())
return "-";
return formatDuration(self.printTimeLeft());
if (self.printTimeLeft() == undefined) {
if (!self.printTime() || !(self.isPrinting() || self.isPaused())) {
return "-";
} else {
return gettext("Calculating...");
}
} else {
return formatFuzzyEstimation(self.printTimeLeft());
}
});
self.progressString = ko.computed(function() {
if (!self.progress())
@@ -9,6 +9,43 @@ function SettingsViewModel(loginStateViewModel, usersViewModel, printerProfilesV
self.api_key = ko.observable(undefined);
self.api_allowCrossOrigin = ko.observable(undefined);
self.appearance_name = ko.observable(undefined);
self.appearance_color = ko.observable(undefined);
self.appearance_available_colors = ko.observable([
{key: "default", name: gettext("default")},
{key: "red", name: gettext("red")},
{key: "orange", name: gettext("orange")},
{key: "yellow", name: gettext("yellow")},
{key: "green", name: gettext("green")},
{key: "blue", name: gettext("blue")},
{key: "violet", name: gettext("violet")},
{key: "black", name: gettext("black")}
]);
self.appearance_colorName = function(color) {
switch (color) {
case "red":
return gettext("red");
case "orange":
return gettext("orange");
case "yellow":
return gettext("yellow");
case "green":
return gettext("green");
case "blue":
return gettext("blue");
case "violet":
return gettext("violet");
case "black":
return gettext("black");
case "default":
return gettext("default");
default:
return color;
}
};
self.printer_defaultExtrusionLength = ko.observable(undefined);
self.webcam_streamUrl = ko.observable(undefined);
@@ -27,6 +64,7 @@ function SettingsViewModel(loginStateViewModel, usersViewModel, printerProfilesV
self.feature_sdAlwaysAvailable = ko.observable(undefined);
self.feature_swallowOkAfterResend = ko.observable(undefined);
self.feature_repetierTargetTemp = ko.observable(undefined);
self.feature_keyboardControl = ko.observable(undefined);
self.serial_port = ko.observable();
self.serial_baudrate = ko.observable();
@@ -101,6 +139,9 @@ function SettingsViewModel(loginStateViewModel, usersViewModel, printerProfilesV
self.api_key(response.api.key);
self.api_allowCrossOrigin(response.api.allowCrossOrigin);
self.appearance_name(response.appearance.name);
self.appearance_color(response.appearance.color);
self.printer_defaultExtrusionLength(response.printer.defaultExtrusionLength);
self.webcam_streamUrl(response.webcam.streamUrl);
@@ -119,6 +160,7 @@ function SettingsViewModel(loginStateViewModel, usersViewModel, printerProfilesV
self.feature_sdAlwaysAvailable(response.feature.sdAlwaysAvailable);
self.feature_swallowOkAfterResend(response.feature.swallowOkAfterResend);
self.feature_repetierTargetTemp(response.feature.repetierTargetTemp);
self.feature_keyboardControl(response.feature.keyboardControl);
self.serial_port(response.serial.port);
self.serial_baudrate(response.serial.baudrate);
@@ -158,6 +200,10 @@ function SettingsViewModel(loginStateViewModel, usersViewModel, printerProfilesV
"key": self.api_key(),
"allowCrossOrigin": self.api_allowCrossOrigin()
},
"appearance" : {
"name": self.appearance_name(),
"color": self.appearance_color()
},
"printer": {
"defaultExtrusionLength": self.printer_defaultExtrusionLength()
},
@@ -178,7 +224,8 @@ function SettingsViewModel(loginStateViewModel, usersViewModel, printerProfilesV
"sdSupport": self.feature_sdSupport(),
"sdAlwaysAvailable": self.feature_sdAlwaysAvailable(),
"swallowOkAfterResend": self.feature_swallowOkAfterResend(),
"repetierTargetTemp": self.feature_repetierTargetTemp()
"repetierTargetTemp": self.feature_repetierTargetTemp(),
"keyboardControl": self.feature_keyboardControl()
},
"serial": {
"port": self.serial_port(),
@@ -28,6 +28,7 @@ function SlicingViewModel(loginStateViewModel, printerProfilesViewModel) {
self.afterSlicing = ko.observable("none");
self.show = function(target, file) {
self.requestData();
self.target = target;
self.file = file;
self.title(_.sprintf(gettext("Slicing %(filename)s"), {filename: self.file}));
@@ -48,13 +49,18 @@ function SlicingViewModel(loginStateViewModel, printerProfilesViewModel) {
&& self.profile() != undefined;
});
self.requestData = function() {
self.requestData = function(callback) {
$.ajax({
url: API_BASEURL + "slicing",
type: "GET",
dataType: "json",
success: self.fromResponse
})
success: function(data) {
self.fromResponse(data);
if (callback !== undefined) {
callback();
}
}
});
};
self.fromResponse = function(data) {
+1 -1
View File
@@ -1 +1 @@
window.BABEL_TO_LOAD_de = {"locale": "de", "domain": "messages", "plural_expr": "(n != 1)", "messages": {"": "Project-Id-Version: OctoPrint\nReport-Msgid-Bugs-To: i18n@octoprint.org\nPOT-Creation-Date: 2014-10-20 09:44+0200\nPO-Revision-Date: 2014-10-20 09:48+0100\nLast-Translator: Gina H\u00e4u\u00dfge <osd@foosel.net>\nLanguage-Team: German (http://www.transifex.com/projects/p/octoprint/language/de/)\nPlural-Forms: nplurals=2; plural=(n != 1)\nMIME-Version: 1.0\nContent-Type: text/plain; charset=utf-8\nContent-Transfer-Encoding: 8bit\nGenerated-By: Babel 1.3\n", "Print Time Left": "Verbleibende Druckdauer", "Proceed": "Fortfahren", "Timelapse Temp Folder": "Tempor\u00e4res Zeitrafferverzeichnis", "Title": "Titel", "Only show files stored locally": "Nur lokal abgelegte Dateien anzeigen", "yellow": "Gelb", "Action": "Aktion", "Passwords do not match": "Passw\u00f6rter nicht identisch", "Sort by name": "Nach Name sortieren", "Save connection settings": "Verbindungseinstellungen speichern", "Rendering timelapse": "Zeitraffer wird gerendert", "Temperature": "Temperatur", "Files": "Dateien", "Bed Size": "Bettdimensionen", "Resume": "Weiter", "Always assume SD card is present": "Immer davon ausgehen, dass eine SD-Karte vorhanden ist", "Load and Print": "Laden und Drucken", "Sending file to SD": "Sende Datei zu SD", "Number of Extruders": "Anzahl Extruder", "black": "Schwarz", "Last Printed": "Zuletzt gedruckt", "Sourcecode": "Quellcode", "Estimated layer height": "Gesch\u00e4tzte Schichth\u00f6he", "You are now logged out": "Du bist jetzt ausgeloggt", "Uploaded": "Hochgeladen", "Opening serial port": "\u00d6ffnet Serialport", "New timelapse %(movie_basename)s is done rendering.": "Neue Zeitrafferaufnahme %(movie_basename)s wurde fertig gerendert", "Invert control": "Invertieren", "Webcam": "Webcam", "Remember me": "Login merken", "Enable GCode Visualizer": "GCode Viewer aktivieren", "The server appears to be offline, at least I'm not getting any response from it. I'll try to reconnect automatically <strong>over the next couple of minutes</strong>, however you are welcome to try a manual reconnect anytime using the button below.": "Der Server scheint offline zu sein, zumindest kann ich mich nicht mit ihm verbinden. Ich werde <strong>\u00fcber die n\u00e4chsten Minuten</strong> versuchen, zu reconnecten, aber Du kannst mittels des folgenden Buttons auch jederzeit einen manuellen Reconnect ansto\u00dfen.", "Rendering failed": "Rendering fehlgeschlagen", "Upload Folder": "Uploadverzeichnis", "descending": "absteigend", "Only show files stored on SD": "Nur auf SD abgelegte Dateien anzeigen", "X": "X", "Add user": "Nutzer hinzuf\u00fcgen", "GCODE commands in layer": "GCODE Kommandos in Schicht", "Estimated print time": "Gesch\u00e4tzte Druckdauer", "Serial Connection": "Serielle Verbindung", "Control": "Kontrolle", "Password": "Passwort", "Also show next layer": "Auch n\u00e4chste Schicht anzeigen", "Print Time": "Druckdauer", "Slicer": "Slicer", "Sort by file size": "Nach Gr\u00f6\u00dfe sortieren", "Machine State": "Druckerstatus", "Slicing Profile": "Slicingprofil", "Pauses the print job": "Pausiert den Druckjob", "API": "API", "Printing from SD": "Drucke von SD", "Stream URL": "Stream-URL", "Terminal filters": "Terminalfilter", "Change password for user \"%(user)s\"": "Passwort\u00e4nderung f\u00fcr Nutzer \"%(user)s\"", "mm": "mm", "Enable Temperature Graph": "Temperaturgraph aktivieren", "Delete user": "Nutzer l\u00f6schen", "Confirm Password": "Passwort best\u00e4tigen", "Disconnect": "Trennen", "Slicing done": "Slicing abgeschlossen", "Initialize SD card": "SD-Karte initialisieren", "System": "System", "Send": "Senden", "State": "Status", "Version": "Version", "YYYY-MM-DD HH:mm": "DD.MM.YYYY HH:mm", "Attempt to reconnect": "Erneut verbinden", "Streaming done": "Streaming abgeschlossen", "violet": "Violett", "Print": "Drucken", "Layer count": "Schichtanzahl", "OctoPrint Settings": "OctoPrint Einstellungen", "Are you sure?": "Bist Du sicher?", "blue": "Blau", "Printer": "Drucker", "Tool": "Werkzeug", "Settings": "Einstellungen", "Path to FFMPEG": "Pfad zu FFMPEG", "Upload to SD": "Upload (SD)", "The command \"%(command)s\" could not be executed.": "Das Kommando \"%(command)s\" konnte nicht ausgef\u00fchrt werden.", "Printed": "Gedruckt", "Wait for <code>start</code> on connect": "Bei der Verbindung auf <code>start</code> warten", "Layer number": "Schichtnummer", "Sync with job progress": "Job mit Fortschritt synchronisieren", "Circular": "Rund", "Total filament used": "Gesamtmenge genutzten Filaments", "red": "Rot", "Save as default": "Als Standard speichern", "Slicing ...": "Slice ...", "Last Print Time": "Letzte Druckdauer", "Target": "Soll", "Streaming ...": "Streame ...", "Default extrusion length": "Standard Extrusionsl\u00e4nge", "Logout successful": "Logout erfolgreich", "Now rendering timelapse %(movie_basename)s": "Rendere Zeitrafferaufnahme %(movie_basename)s", "Documentation": "Dokumentation", "%(hLine truncated
window.BABEL_TO_LOAD_de = {"locale": "de", "domain": "messages", "plural_expr": "(n != 1)", "messages": {"": "Project-Id-Version: OctoPrint\nReport-Msgid-Bugs-To: i18n@octoprint.org\nPOT-Creation-Date: 2014-12-18 14:45+0100\nPO-Revision-Date: 2014-12-18 14:11+0000\nLast-Translator: Gina H\u00e4u\u00dfge <gina@foosel.net>\nLanguage-Team: German (http://www.transifex.com/projects/p/octoprint/language/de/)\nPlural-Forms: nplurals=2; plural=(n != 1)\nMIME-Version: 1.0\nContent-Type: text/plain; charset=utf-8\nContent-Transfer-Encoding: 8bit\nGenerated-By: Babel 1.3\n", "Print Time Left": "Verbleibende Druckdauer", "sec": "Sek", "Proceed": "Fortfahren", "Timelapse Temp Folder": "Tempor\u00e4res Zeitrafferverzeichnis", "Support <code>TargetExtr%%n</code>/<code>TargetBed</code> target temperature format": "<code>TargetExtr%%n</code>/<code>TargetBed</code> Zieltemperaturformat unterst\u00fctzen", "Upload Folder": "Uploadverzeichnis", "Only show files stored locally": "Nur lokal abgelegte Dateien anzeigen", "Add Printer Profile": "Druckerprofil hinzuf\u00fcgen", "yellow": "Gelb", "Save": "Speichern", "Action": "Aktion", "Passwords do not match": "Passw\u00f6rter nicht identisch", "Sort by name": "Nach Name sortieren", "Save connection settings": "Verbindungseinstellungen speichern", "Rendering timelapse": "Zeitraffer wird gerendert", "Color": "Farbe", "Temperature": "Temperatur", "Files": "Dateien", "Resume": "Weiter", "Always assume SD card is present": "Immer davon ausgehen, dass eine SD-Karte vorhanden ist", "Load and Print": "Laden und Drucken", "Sending file to SD": "Sende Datei zu SD", "Number of Extruders": "Anzahl Extruder", "black": "Schwarz", "Last Printed": "Zuletzt gedruckt", "Sourcecode": "Quellcode", "Estimated layer height": "Gesch\u00e4tzte Schichth\u00f6he", "You are now logged out": "Du bist jetzt ausgeloggt", "Uploaded": "Hochgeladen", "Form Factor": "Formfaktor", "Opening serial port": "\u00d6ffnet Serialport", "New timelapse %(movie_basename)s is done rendering.": "Neue Zeitrafferaufnahme %(movie_basename)s wurde fertig gerendert", "Invert control": "Invertieren", "Webcam": "Webcam", "Select for printing": "Zum Drucken ausw\u00e4hlen", "Allow <a href=\"%(url)s\">Cross Origin Resource Sharing (CORS)</a>": "<a href=\"%(url)s\">Cross Origin Resource Sharing (CORS)</a> erlauben", "Remember me": "Login merken", "Enable GCode Visualizer": "GCode Viewer aktivieren", "The server appears to be offline, at least I'm not getting any response from it. I'll try to reconnect automatically <strong>over the next couple of minutes</strong>, however you are welcome to try a manual reconnect anytime using the button below.": "Der Server scheint offline zu sein, zumindest kann ich mich nicht mit ihm verbinden. Ich werde <strong>\u00fcber die n\u00e4chsten Minuten</strong> versuchen, mich erneut zu verbinden, aber Du kannst mittels des folgenden Buttons auch jederzeit einen manuellen Reconnect ansto\u00dfen.", "Rendering failed": "Rendering fehlgeschlagen", "Motors off": "Motoren aus", "descending": "absteigend", "Only show files stored on SD": "Nur auf SD abgelegte Dateien anzeigen", "X": "X", "Add user": "Nutzer hinzuf\u00fcgen", "GCODE commands in layer": "GCODE Kommandos in Schicht", "Estimated print time": "Gesch\u00e4tzte Druckdauer", "Serial Connection": "Serielle Verbindung", "Control": "Kontrolle", "Password": "Passwort", "Also show next layer": "Auch n\u00e4chste Schicht anzeigen", "Print Time": "Druckdauer", "Slicer": "Slicer", "Nozzle Diameter": "D\u00fcsendurchmesser", "Sort by file size": "Nach Gr\u00f6\u00dfe sortieren", "Machine State": "Druckerstatus", "Slicing Profile": "Slicingprofil", "mm": "mm", "API": "API", "Printing from SD": "Drucke von SD", "Stream URL": "Stream-URL", "Terminal filters": "Terminalfilter", "Change password for user \"%(user)s\"": "Passwort\u00e4nderung f\u00fcr Nutzer \"%(user)s\"", "Enable Temperature Graph": "Temperaturgraph aktivieren", "Delete user": "Nutzer l\u00f6schen", "Timelapse bitrate": "Zeitrafferbitrate", "Confirm Password": "Passwort best\u00e4tigen", "Disconnect": "Trennen", "Slicing done": "Slicing abgeschlossen", "Initialize SD card": "SD-Karte initialisieren", "System": "System", "Send": "Senden", "State": "Status", "Version": "Version", "YYYY-MM-DD HH:mm": "DD.MM.YYYY HH:mm", "Attempt to reconnect": "Erneut verbinden", "Streaming done": "Streaming abgeschlossen", "violet": "Violett", "Print": "Drucken", "Layer count": "Schichtanzahl", "OctoPrint Settings": "OctoPrint Einstellungen", "Are you sure?": "Bist Du sicher?", "blue": "Blau", "Printer": "Drucker", "Delete Profile": "Profil entfernen", "Tool": "Werkzeug", "Settings": "Einstellungen", "Circular": "Rund", "Path to FFMPEG": "Pfad zu FFMPEG", "Upload to SD": "Upload (SD)", "The command \"%(command)s\" could not be executed.": "Das Kommando \"%(command)s\" konnte nicht ausgef\u00fchrt werden.", "Select a slicing profile...": "W\u00e4hle ein Slicingprofile...", "Wait for <code>start</code> on connect":Line truncated
+1 -1
View File
@@ -1 +1 @@
window.BABEL_TO_LOAD_fr = {"locale": "fr", "domain": "messages", "plural_expr": "(n > 1)", "messages": {"": "Project-Id-Version: OctoPrint\nReport-Msgid-Bugs-To: i18n@octoprint.org\nPOT-Creation-Date: 2014-08-28 15:52+0200\nPO-Revision-Date: 2014-08-28 13:54+0000\nLast-Translator: Gina H\u00e4u\u00dfge <gina@foosel.net>\nLanguage-Team: French (http://www.transifex.com/projects/p/octoprint/language/fr/)\nPlural-Forms: nplurals=2; plural=(n > 1)\nMIME-Version: 1.0\nContent-Type: text/plain; charset=utf-8\nContent-Transfer-Encoding: 8bit\nGenerated-By: Babel 1.3\n", "Print Time Left": "Temps d'impression restant", "Proceed": "Continuer", "Timelapse Temp Folder": "R\u00e9pertoire temporaire des timelapses", "Title": "Titre", "Only show files stored locally": "Ne montre que les fichiers enregistr\u00e9s localement", "yellow": "jaune", "Path to Cura": "Chemin vers Cura", "Action": "Action", "Passwords do not match": "Les mots de passes ne sont pas semblables", "Sort by name": "Trier par nom", "Save connection settings": "Sauvegarder les param\u00e8tres de connection", "Rendering timelapse": "Rendu du timelapse en cours", "Cura": "Cura", "Files": "Fichiers", "Bed Size": "Taille du lit", "Always assume SD card is present": "Toujours supposer que la carte SD est pr\u00e9sente", "Load and Print": "Charger et imprimer", "Sending file to SD": "Envoi du fichier vers la carte SD en cours", "Number of Extruders": "Nombre d'extrudeurs", "black": "noir", "Last Printed": "Impression pr\u00e9c\u00e9dente", "Sourcecode": "Code source", "Estimated layer height": "Hauteur de couche estim\u00e9e", "You are now logged out": "Vous \u00eates maintenant d\u00e9connect\u00e9", "Uploaded": "Charg\u00e9", "Opening serial port": "Ouverture du port s\u00e9rie en cours", "New timelapse %(movie_basename)s is done rendering.": "Le rendu du nouveau timelapse %(movie_basename)s est termin\u00e9.", "Invert control": "Inverser le contr\u00f4le", "Webcam": "Webcam", "Remember me": "Se souvenir de moi", "Enable GCode Visualizer": "Activer le visualisateur de GCode", "The server appears to be offline, at least I'm not getting any response from it. I'll try to reconnect automatically <strong>over the next couple of minutes</strong>, however you are welcome to try a manual reconnect anytime using the button below.": "Le serveur semble \u00eatre hors ligne, du moins je ne re\u00e7ois aucunes r\u00e9ponses de celui-ci. Je vais tenter de me reconnecter automatiquement <strong>dans les minutes qui suivent</strong>. Quoiqu'il en soit vous pouvez tenter de vous reconnecter manuellement en utilisant le bouton ci-dessous.", "Rendering failed": "Echec du rendu", "Upload Folder": "R\u00e9pertoire des chargements", "descending": "descendant", "X": "X", "Add user": "Ajouter utilisateur", "GCODE commands in layer": "Commandes GCODE dans la couche", "Estimated print time": "Temps d'impression estim\u00e9", "Serial Connection": "Connection s\u00e9rie", "Control": "Contr\u00f4le", "Password": "Mot de passe", "Also show next layer": "Montrer \u00e9galement la couche suivante", "Print Time": "Temps d'impression", "Sort by file size": "Trier par taille des fichiers", "Machine State": "Etat de la machine", "default": "Par d\u00e9faut", "API": "API", "Printing from SD": "Impression depuis la carte SD en cours", "Terminal filters": "Filtres du terminal", "Change password for user \"%(user)s\"": "Changer le mot de passe pour l'utilisateur \"%(user)s\"", "Enable Temperature Graph": "Activer le graphique de temp\u00e9rature", "Delete user": "Supprimer utilisateur", "Confirm Password": "Confirmer le mot de passe", "Disconnect": "D\u00e9connecter", "Slicing done": "Tranchage termin\u00e9", "Initialize SD card": "Initialiser la carte SD", "System": "Syst\u00eame", "Send": "Envoyer", "State": "Etat", "Version": "Version", "YYYY-MM-DD HH:mm": "DD-MM-YYYY HH:mm", "Attempt to reconnect": "Tentative de reconnection", "Streaming done": "Diffusion en direct termin\u00e9", "violet": "violet", "Print": "Imprimer", "Layer count": "Nombre de couches", "OctoPrint Settings": "Param\u00e8tres d'OctoPrint", "Are you sure?": "Etes-vous s\u00fbre?", "blue": "bleu", "Printer": "Imprimante", "Tool": "Outil", "Settings": "Param\u00e8tres", "Path to FFMPEG": "Chemin vers FFMPEG", "Upload to SD": "Chargement vers la carte SD", "The command \"%(command)s\" could not be executed.": "La commande \"%(command)s\" n'a pas pu \u00eatre ex\u00e9cut\u00e9e", "Printed": "Imprim\u00e9", "Layer number": "Couche num\u00e9ro", "Sync with job progress": "Synchroniser avec le progr\u00e8s du job", "Circular": "Circulaire", "Total filament used": "Quantit\u00e9 de filament utilis\u00e9", "red": "rouge", "Save as default": "Sauver en tant que d\u00e9faut", "Slicing ...": "Tranchage en cours...", "Last Print Time": "Temps d'impression pr\u00e9c\u00e9dent", "Target": "Cible", "Streaming ...": "Diffusion en direct en cours...", "Logout successful": "Fermeture de session r\u00e9ussie", "Now rendering timelapse %(movieLine truncated
window.BABEL_TO_LOAD_fr = {"locale": "fr", "domain": "messages", "plural_expr": "(n > 1)", "messages": {"": "Project-Id-Version: OctoPrint\nReport-Msgid-Bugs-To: i18n@octoprint.org\nPOT-Creation-Date: 2014-12-18 14:45+0100\nPO-Revision-Date: 2014-12-18 14:04+0000\nLast-Translator: Gina H\u00e4u\u00dfge <gina@foosel.net>\nLanguage-Team: French (http://www.transifex.com/projects/p/octoprint/language/fr/)\nPlural-Forms: nplurals=2; plural=(n > 1)\nMIME-Version: 1.0\nContent-Type: text/plain; charset=utf-8\nContent-Transfer-Encoding: 8bit\nGenerated-By: Babel 1.3\n", "Print Time Left": "Temps d'impression restant", "sec": "sec", "Proceed": "Continuer", "Timelapse Temp Folder": "R\u00e9pertoire temporaire des timelapses", "Support <code>TargetExtr%%n</code>/<code>TargetBed</code> target temperature format": "Support <code>TargetExtr%%n</code>/<code>TargetBed</code> format de temp\u00e9rature de la cible", "Upload Folder": "R\u00e9pertoire des chargements", "Only show files stored locally": "Ne montre que les fichiers enregistr\u00e9s localement", "Add Printer Profile": "", "yellow": "jaune", "Save": "Sauver", "Action": "Action", "Passwords do not match": "Les mots de passes ne sont pas semblables", "Sort by name": "Trier par nom", "Save connection settings": "Sauvegarder les param\u00e8tres de connection", "Rendering timelapse": "Rendu du timelapse en cours", "Color": "Couleur", "Temperature": "Temp\u00e9rature", "Files": "Fichiers", "Resume": "", "Always assume SD card is present": "Toujours supposer que la carte SD est pr\u00e9sente", "Load and Print": "Charger et imprimer", "Sending file to SD": "Envoi du fichier vers la carte SD en cours", "Number of Extruders": "Nombre d'extrudeurs", "black": "noir", "Last Printed": "Impression pr\u00e9c\u00e9dente", "Sourcecode": "Code source", "Estimated layer height": "Hauteur de couche estim\u00e9e", "You are now logged out": "Vous \u00eates maintenant d\u00e9connect\u00e9", "Uploaded": "Charg\u00e9", "Form Factor": "", "Opening serial port": "Ouverture du port s\u00e9rie en cours", "New timelapse %(movie_basename)s is done rendering.": "Le rendu du nouveau timelapse %(movie_basename)s est termin\u00e9.", "Invert control": "Inverser le contr\u00f4le", "Webcam": "Webcam", "Select for printing": "", "Allow <a href=\"%(url)s\">Cross Origin Resource Sharing (CORS)</a>": "Permettre <a href=\"%(url)s\">Cross Origin Resource Sharing (CORS)</a>", "Remember me": "Se souvenir de moi", "Enable GCode Visualizer": "Activer le visualisateur de GCode", "The server appears to be offline, at least I'm not getting any response from it. I'll try to reconnect automatically <strong>over the next couple of minutes</strong>, however you are welcome to try a manual reconnect anytime using the button below.": "Le serveur semble \u00eatre hors ligne, du moins je ne re\u00e7ois aucunes r\u00e9ponses de celui-ci. Je vais tenter de me reconnecter automatiquement <strong>dans les minutes qui suivent</strong>. Quoiqu'il en soit vous pouvez tenter de vous reconnecter manuellement en utilisant le bouton ci-dessous.", "Rendering failed": "Echec du rendu", "Motors off": "Eteindre les moteurs", "descending": "descendant", "Only show files stored on SD": "Ne montrer que les fichier enregistr\u00e9s sur la carte SD", "X": "X", "Add user": "Ajouter utilisateur", "GCODE commands in layer": "Commandes GCODE dans la couche", "Estimated print time": "Temps d'impression estim\u00e9", "Serial Connection": "Connection s\u00e9rie", "Control": "Contr\u00f4le", "Password": "Mot de passe", "Also show next layer": "Montrer \u00e9galement la couche suivante", "Print Time": "Temps d'impression", "Slicer": "", "Nozzle Diameter": "", "Sort by file size": "Trier par taille des fichiers", "Machine State": "Etat de la machine", "Slicing Profile": "", "mm": "mm", "API": "API", "Printing from SD": "Impression depuis la carte SD en cours", "Stream URL": "URL de diffusion en direct", "Terminal filters": "Filtres du terminal", "Change password for user \"%(user)s\"": "Changer le mot de passe pour l'utilisateur \"%(user)s\"", "Enable Temperature Graph": "Activer le graphique de temp\u00e9rature", "Delete user": "Supprimer utilisateur", "Timelapse bitrate": "Bitrate du timelapse", "Confirm Password": "Confirmer le mot de passe", "Disconnect": "D\u00e9connecter", "Slicing done": "Tranchage termin\u00e9", "Initialize SD card": "Initialiser la carte SD", "System": "Syst\u00eame", "Send": "Envoyer", "State": "Etat", "Version": "Version", "YYYY-MM-DD HH:mm": "DD-MM-YYYY HH:mm", "Attempt to reconnect": "Tentative de reconnection", "Streaming done": "Diffusion en direct termin\u00e9", "violet": "violet", "Print": "Imprimer", "Layer count": "Nombre de couches", "OctoPrint Settings": "Param\u00e8tres d'OctoPrint", "Are you sure?": "Etes-vous s\u00fbre?", "blue": "bleu", "Printer": "Imprimante", "Delete Profile": "", "Tool": "Outil", "Settings": "Param\u00e8tres", "Circular": "Circulaire", "Path to FFMPEG": "Chemin vers FFMPEG", "Upload to Line truncated
+1 -1
View File
@@ -1 +1 @@
window.BABEL_TO_LOAD_he = {"locale": "he", "domain": "messages", "plural_expr": "(n != 1)", "messages": {"": "Project-Id-Version: OctoPrint 1.2.0-dev-131-g854387b\nReport-Msgid-Bugs-To: i18n@octoprint.org\nPOT-Creation-Date: 2014-08-31 12:52+0300\nPO-Revision-Date: 2014-08-31 18:44+0200\nLast-Translator: Guy Sheffer <guysoft@gmail.com>\nLanguage-Team: he <guysoft@gmail.com>\nPlural-Forms: nplurals=2; plural=(n != 1)\nMIME-Version: 1.0\nContent-Type: text/plain; charset=utf-8\nContent-Transfer-Encoding: 8bit\nGenerated-By: Babel 1.3\n", "Print Time Left": "\u05d6\u05de\u05df \u05d4\u05d3\u05e4\u05e1\u05d4 \u05e0\u05d5\u05ea\u05e8", "Proceed": "\u05d4\u05de\u05e9\u05da", "Timelapse Temp Folder": "\u05ea\u05e7\u05d9\u05d9\u05d4 \u05d6\u05de\u05e0\u05d9\u05ea \u05dc-timelapse", "Title": "\u05db\u05d5\u05ea\u05e8\u05ea", "Only show files stored locally": "\u05d4\u05e6\u05d2 \u05e8\u05e7 \u05e7\u05d1\u05e6\u05d9\u05dd \u05d4\u05e9\u05de\u05d5\u05e8\u05d9\u05dd \u05de\u05e7\u05d5\u05de\u05d9\u05ea", "yellow": "\u05e6\u05d4\u05d5\u05d1", "Path to Cura": "\u05e0\u05ea\u05d9\u05d1 \u05dc-Cura", "Action": "\u05e4\u05e2\u05d5\u05dc\u05d4", "Passwords do not match": "\u05e1\u05d9\u05e1\u05de\u05d0\u05d5\u05ea \u05dc\u05d0 \u05ea\u05d5\u05d0\u05de\u05d5\u05ea", "Sort by name": "\u05de\u05d9\u05d9\u05df \u05dc\u05e4\u05d9 \u05e9\u05dd", "Save connection settings": "\u05e9\u05de\u05d5\u05e8 \u05d4\u05d2\u05d3\u05e8\u05d5\u05ea \u05d7\u05d9\u05d1\u05d5\u05e8", "Rendering timelapse": "\u05de\u05e8\u05e0\u05d3\u05e8 timelapse", "Cura": "Cura", "Files": "\u05e7\u05d1\u05e6\u05d9\u05dd", "Bed Size": "\u05d2\u05d5\u05d3\u05dc \u05de\u05d9\u05d8\u05d4", "Always assume SD card is present": "\u05ea\u05de\u05d9\u05d3 \u05ea\u05e0\u05d9\u05d7 \u05e9\u05db\u05e8\u05d8\u05d9\u05e1 SD \u05e0\u05de\u05e6\u05d0", "Load and Print": "\u05d8\u05e2\u05df \u05d5\u05d4\u05d3\u05e4\u05e1", "Sending file to SD": "\u05e9\u05d5\u05dc\u05d7 \u05e7\u05d5\u05d1\u05e5 \u05d0\u05dc SD", "Number of Extruders": "\u05de\u05e1\u05e4\u05e8 \u05d0\u05e7\u05e1\u05d8\u05e8\u05d5\u05d3\u05e8\u05d9\u05dd", "black": "\u05e9\u05d7\u05d5\u05e8", "Last Printed": "\u05d4\u05d5\u05d3\u05e4\u05e1 \u05dc\u05d0\u05d7\u05e8\u05d5\u05e0\u05d4", "Sourcecode": "\u05e7\u05d5\u05d3 \u05de\u05e7\u05d5\u05e8", "Estimated layer height": "\u05d2\u05d5\u05d1\u05d4 \u05e9\u05db\u05d1\u05d5\u05ea \u05de\u05e9\u05d5\u05e2\u05e8", "You are now logged out": "\u05d4\u05ea\u05e0\u05ea\u05e7\u05ea \u05de\u05d4\u05de\u05e2\u05e8\u05db\u05ea", "Uploaded": "\u05d4\u05d5\u05e2\u05dc\u05d4", "Opening serial port": "\u05e4\u05d5\u05ea\u05d7 \u05d9\u05e6\u05d9\u05e8\u05d4 \u05d8\u05d5\u05e8\u05d9\u05ea", "New timelapse %(movie_basename)s is done rendering.": "\u05e1\u05d9\u05d9\u05dd \u05dc\u05e8\u05e0\u05d3\u05e8 \u05d0\u05ea \u05d4-timelapse %(movie_basename)s", "Invert control": "\u05d4\u05e4\u05d5\u05da \u05e9\u05dc\u05d9\u05d8\u05d4", "Webcam": "\u05de\u05e6\u05dc\u05de\u05ea \u05e8\u05e9\u05ea", "Remember me": "\u05d6\u05db\u05d5\u05e8 \u05d0\u05d5\u05ea\u05d9", "Enable GCode Visualizer": "\u05d4\u05e4\u05e2\u05dc \u05d5\u05d9\u05d6\u05d5\u05d0\u05dc\u05d9\u05d6\u05e6\u05d9\u05d4 \u05e9\u05dc GCode", "The server appears to be offline, at least I'm not getting any response from it. I'll try to reconnect automatically <strong>over the next couple of minutes</strong>, however you are welcome to try a manual reconnect anytime using the button below.": "\u05e0\u05e8\u05d0\u05d4 \u05e9\u05d4\u05e9\u05e8\u05ea \u05dc\u05d0 \u05de\u05d7\u05d5\u05d1\u05e8, \u05d0\u05d5 \u05dc\u05e4\u05d7\u05d5\u05ea \u05d0\u05e0\u05d9 \u05dc\u05d0 \u05de\u05e6\u05dc\u05d9\u05d7 \u05dc\u05e7\u05d1\u05dc \u05db\u05dc \u05ea\u05d2\u05d5\u05d1\u05d4 \u05de\u05de\u05e0\u05d5. \u05d0\u05e0\u05e1\u05d4 \u05dc\u05d4\u05ea\u05d7\u05d1\u05e8 \u05de\u05d7\u05d3\u05e9 \u05d0\u05d5\u05d8\u05d5\u05de\u05d8\u05d9\u05ea <strong>\u05d1\u05e2\u05d5\u05d3 \u05de\u05e1\u05e4\u05e8 \u05d3\u05e7\u05d5\u05ea</strong>, \u05d0\u05d1\u05dc \u05e0\u05d9\u05ea\u05df \u05d2\u05dd \u05dc\u05e0\u05e1\u05d5\u05ea \u05dc\u05d4\u05ea\u05d7\u05d1\u05e8 \u05de\u05d7\u05d3\u05e9 \u05e2\u05dd \u05d4\u05db\u05e4\u05ea\u05d5\u05e8 \u05dc\u05d4\u05dc\u05df.", "Rendering failed": "\u05e8\u05d9\u05e0\u05d3\u05d5\u05e8 \u05e0\u05db\u05e9\u05dc", "Upload Folder": "\u05ea\u05e7\u05d9\u05d9\u05ea \u05d4\u05e2\u05dc\u05d0\u05d4", "descending": "\u05e1\u05d3\u05e8 \u05d9\u05d5\u05e8\u05d3", "X": "X", "Add user": "\u05d4\u05d5\u05e1\u05e3 \u05de\u05e9\u05ea\u05de\u05e9", "GCODE commands in layer": "\u05e4\u05e7\u05d5\u05d3\u05d5\u05ea GCODE \u05d1\u05e9\u05db\u05d1\u05d4", "Estimated print time": "\u05d6\u05de\u05df \u05d4\u05d3\u05e4\u05e1\u05d4 \u05de\u05e9\u05d5\u05e2\u05e8", "Serial Connection": "\u05d7\u05d9\u05d1\u05d5\u05e8 \u05d8\u05d5\u05e8\u05d9", "Control": "\u05e9\u05dc\u05d9\u05d8\u05d4", "Password": "\u05e1\u05d9\u05e1\u05de\u05d4", "Also show next layer": "\u05d0\u05e4\u05e9\u05e8 \u05d4\u05e6\u05d2\u05d4 \u05e9\u05dc \u05e9\u05db\u05d1\u05d4 \u05d4Line truncated
window.BABEL_TO_LOAD_he = {"locale": "he", "domain": "messages", "plural_expr": "(n != 1)", "messages": {"": "Project-Id-Version: OctoPrint\nReport-Msgid-Bugs-To: i18n@octoprint.org\nPOT-Creation-Date: 2014-12-18 14:45+0100\nPO-Revision-Date: 2014-12-18 14:04+0000\nLast-Translator: Gina H\u00e4u\u00dfge <gina@foosel.net>\nLanguage-Team: Hebrew (http://www.transifex.com/projects/p/octoprint/language/he/)\nPlural-Forms: nplurals=2; plural=(n != 1)\nMIME-Version: 1.0\nContent-Type: text/plain; charset=utf-8\nContent-Transfer-Encoding: 8bit\nGenerated-By: Babel 1.3\n", "Print Time Left": "\u05d6\u05de\u05df \u05d4\u05d3\u05e4\u05e1\u05d4 \u05e0\u05d5\u05ea\u05e8", "sec": "\u05e9\u05e0'", "Proceed": "\u05d4\u05de\u05e9\u05da", "Timelapse Temp Folder": "\u05ea\u05e7\u05d9\u05d9\u05d4 \u05d6\u05de\u05e0\u05d9\u05ea \u05dc-timelapse", "Support <code>TargetExtr%%n</code>/<code>TargetBed</code> target temperature format": "\u05ea\u05de\u05d5\u05da \u05e2\u05d1\u05d5\u05e8 <code>TargetExtr%%n</code>/<code>TargetBed</code> \u05e4\u05d5\u05e8\u05de\u05d8 \u05d8\u05de\u05e4\u05e8\u05d8\u05d5\u05e8\u05ea \u05d9\u05d9\u05e2\u05d3", "Upload Folder": "\u05ea\u05e7\u05d9\u05d9\u05ea \u05d4\u05e2\u05dc\u05d0\u05d4", "Only show files stored locally": "\u05d4\u05e6\u05d2 \u05e8\u05e7 \u05e7\u05d1\u05e6\u05d9\u05dd \u05d4\u05e9\u05de\u05d5\u05e8\u05d9\u05dd \u05de\u05e7\u05d5\u05de\u05d9\u05ea", "Add Printer Profile": "", "yellow": "\u05e6\u05d4\u05d5\u05d1", "Save": "\u05e9\u05de\u05d5\u05e8", "Action": "\u05e4\u05e2\u05d5\u05dc\u05d4", "Passwords do not match": "\u05e1\u05d9\u05e1\u05de\u05d0\u05d5\u05ea \u05dc\u05d0 \u05ea\u05d5\u05d0\u05de\u05d5\u05ea", "Sort by name": "\u05de\u05d9\u05d9\u05df \u05dc\u05e4\u05d9 \u05e9\u05dd", "Save connection settings": "\u05e9\u05de\u05d5\u05e8 \u05d4\u05d2\u05d3\u05e8\u05d5\u05ea \u05d7\u05d9\u05d1\u05d5\u05e8", "Rendering timelapse": "\u05de\u05e8\u05e0\u05d3\u05e8 timelapse", "Color": "\u05e6\u05d1\u05e2", "Temperature": "\u05d8\u05de\u05e4\u05e8\u05d8\u05d5\u05e8\u05d4", "Files": "\u05e7\u05d1\u05e6\u05d9\u05dd", "Resume": "", "Always assume SD card is present": "\u05ea\u05de\u05d9\u05d3 \u05ea\u05e0\u05d9\u05d7 \u05e9\u05db\u05e8\u05d8\u05d9\u05e1 SD \u05e0\u05de\u05e6\u05d0", "Load and Print": "\u05d8\u05e2\u05df \u05d5\u05d4\u05d3\u05e4\u05e1", "Sending file to SD": "\u05e9\u05d5\u05dc\u05d7 \u05e7\u05d5\u05d1\u05e5 \u05d0\u05dc SD", "Number of Extruders": "\u05de\u05e1\u05e4\u05e8 \u05d0\u05e7\u05e1\u05d8\u05e8\u05d5\u05d3\u05e8\u05d9\u05dd", "black": "\u05e9\u05d7\u05d5\u05e8", "Last Printed": "\u05d4\u05d5\u05d3\u05e4\u05e1 \u05dc\u05d0\u05d7\u05e8\u05d5\u05e0\u05d4", "Sourcecode": "\u05e7\u05d5\u05d3 \u05de\u05e7\u05d5\u05e8", "Estimated layer height": "\u05d2\u05d5\u05d1\u05d4 \u05e9\u05db\u05d1\u05d5\u05ea \u05de\u05e9\u05d5\u05e2\u05e8", "You are now logged out": "\u05d4\u05ea\u05e0\u05ea\u05e7\u05ea \u05de\u05d4\u05de\u05e2\u05e8\u05db\u05ea", "Uploaded": "\u05d4\u05d5\u05e2\u05dc\u05d4", "Form Factor": "", "Opening serial port": "\u05e4\u05d5\u05ea\u05d7 \u05d9\u05e6\u05d9\u05e8\u05d4 \u05d8\u05d5\u05e8\u05d9\u05ea", "New timelapse %(movie_basename)s is done rendering.": "\u05e1\u05d9\u05d9\u05dd \u05dc\u05e8\u05e0\u05d3\u05e8 \u05d0\u05ea \u05d4-timelapse %(movie_basename)s", "Invert control": "\u05d4\u05e4\u05d5\u05da \u05e9\u05dc\u05d9\u05d8\u05d4", "Webcam": "\u05de\u05e6\u05dc\u05de\u05ea \u05e8\u05e9\u05ea", "Select for printing": "", "Allow <a href=\"%(url)s\">Cross Origin Resource Sharing (CORS)</a>": "\u05d0\u05e4\u05e9\u05e8 <a href=\"%(url)s\">Cross Origin Resource Sharing (CORS)</a>", "Remember me": "\u05d6\u05db\u05d5\u05e8 \u05d0\u05d5\u05ea\u05d9", "Enable GCode Visualizer": "\u05d4\u05e4\u05e2\u05dc \u05d5\u05d9\u05d6\u05d5\u05d0\u05dc\u05d9\u05d6\u05e6\u05d9\u05d4 \u05e9\u05dc GCode", "The server appears to be offline, at least I'm not getting any response from it. I'll try to reconnect automatically <strong>over the next couple of minutes</strong>, however you are welcome to try a manual reconnect anytime using the button below.": "\u05e0\u05e8\u05d0\u05d4 \u05e9\u05d4\u05e9\u05e8\u05ea \u05dc\u05d0 \u05de\u05d7\u05d5\u05d1\u05e8, \u05d0\u05d5 \u05dc\u05e4\u05d7\u05d5\u05ea \u05d0\u05e0\u05d9 \u05dc\u05d0 \u05de\u05e6\u05dc\u05d9\u05d7 \u05dc\u05e7\u05d1\u05dc \u05db\u05dc \u05ea\u05d2\u05d5\u05d1\u05d4 \u05de\u05de\u05e0\u05d5. \u05d0\u05e0\u05e1\u05d4 \u05dc\u05d4\u05ea\u05d7\u05d1\u05e8 \u05de\u05d7\u05d3\u05e9 \u05d0\u05d5\u05d8\u05d5\u05de\u05d8\u05d9\u05ea <strong>\u05d1\u05e2\u05d5\u05d3 \u05de\u05e1\u05e4\u05e8 \u05d3\u05e7\u05d5\u05ea</strong>, \u05d0\u05d1\u05dc \u05e0\u05d9\u05ea\u05df \u05d2\u05dd \u05dc\u05e0\u05e1\u05d5\u05ea \u05dc\u05d4\u05ea\u05d7\u05d1\u05e8 \u05de\u05d7\u05d3\u05e9 \u05e2\u05dd \u05d4\u05db\u05e4\u05ea\u05d5\u05e8 \u05dc\u05d4\u05dc\u05df.", "Rendering failed": "\u05e8\u05d9\u05e0\u05d3\u05d5\u05e8 \u05e0\u05db\u05e9\u05dc", "Motors off": "\u05db\u05d1\u05d4 \u05de\u05e0\u05d5\u05e2\u05d9\u05dd", "descending": "\u05eLine truncated
+1 -1
View File
@@ -1 +1 @@
window.BABEL_TO_LOAD_nl = {"locale": "nl", "domain": "messages", "plural_expr": "(n != 1)", "messages": {"": "Project-Id-Version: OctoPrint\nReport-Msgid-Bugs-To: i18n@octoprint.org\nPOT-Creation-Date: 2014-08-28 15:52+0200\nPO-Revision-Date: 2014-09-01 20:11+0000\nLast-Translator: leon.bek <leon.bek@gmail.com>\nLanguage-Team: Dutch (http://www.transifex.com/projects/p/octoprint/language/nl/)\nPlural-Forms: nplurals=2; plural=(n != 1)\nMIME-Version: 1.0\nContent-Type: text/plain; charset=utf-8\nContent-Transfer-Encoding: 8bit\nGenerated-By: Babel 1.3\n", "Print Time Left": "Resterende print tijd", "Proceed": "Verder", "Timelapse Temp Folder": "Tijdelijke timelapse map", "Title": "Titel", "Only show files stored locally": "Laat alleen lokale bestanden zien", "yellow": "geel", "Path to Cura": "Lokatie van Cura", "Action": "Actie", "Passwords do not match": "Wachtwoorden komen niet overeen", "Sort by name": "Sorteer op naam", "Save connection settings": "Verbindings instellingen opslaan", "Rendering timelapse": "Renderen van timelapse", "Cura": "Cura", "Files": "Bestanden", "Bed Size": "Platform grootte", "Always assume SD card is present": "Neem aan dat SD kaart altijd aanwezig is", "Load and Print": "Laad en print", "Sending file to SD": "Verstuur bestand naar SD", "Number of Extruders": "Aantal Extruders", "black": "zwart", "Last Printed": "Laats geprint", "Sourcecode": "Broncode", "Estimated layer height": "Geschatte laag hooge", "You are now logged out": "Je bent nu uitgelogd", "Uploaded": "Geupload", "Opening serial port": "Openen van seri\u00eble poort", "New timelapse %(movie_basename)s is done rendering.": "Nieuwe timelapse %(movie_basename)s is gereed", "Invert control": "Bedieining spiegelen", "Webcam": "Webcam", "Remember me": "Onthoud me", "Enable GCode Visualizer": "Schakel GCode Visualizer in", "The server appears to be offline, at least I'm not getting any response from it. I'll try to reconnect automatically <strong>over the next couple of minutes</strong>, however you are welcome to try a manual reconnect anytime using the button below.": "De server lijkt offline te zijn, dat wil zeggen dat ik er geen reactie van krijg. Ik zal proberen om <strong>gedurende een paar minuten</strong> opnieuw te verbinden. Maar je bent op elk moment vrij om handmatig proberen te verbinden met onderstaande knop.", "Rendering failed": "Renderen mislukt", "Upload Folder": "Lokatie voor Uploads", "descending": "Aflopend", "X": "X", "Add user": "Gebruiker toevoegen", "GCODE commands in layer": "GCODE commando's in laag", "Estimated print time": "Geschatte print tijd", "Serial Connection": "Seri\u00eble verbinding", "Control": "Controle", "Password": "Wachtwoord", "Also show next layer": "Laat ook volgende laag zien", "Print Time": "Print tijd", "Sort by file size": "Sorteer op bestands grootte", "Machine State": "Machine status", "default": "Standaard", "API": "API", "Printing from SD": "Printen vanaf SD", "Terminal filters": "Terminal filters", "Change password for user \"%(user)s\"": "Verander wachtwoord voor gebruiker \"%(user)s\"", "Enable Temperature Graph": "Schakel temperatuur grafiek in", "Delete user": "Gebruiker verwijderen", "Confirm Password": "Bevestig wachtwoord", "Disconnect": "Verbreken", "Slicing done": "Slicing klaar", "Initialize SD card": "Formateer SD kaart", "System": "Systeem", "Send": "Verstuur", "State": "Status", "Version": "Versie", "YYYY-MM-DD HH:mm": "DD-MM-YYYY HH:mm", "Attempt to reconnect": "Probeer opnieuw te verbinden", "Streaming done": "Streaming klaar", "violet": "violet", "Print": "Print", "Layer count": "Aantal lagen", "OctoPrint Settings": "OctoPrint instellingen", "Are you sure?": "Weet je het zeker?", "blue": "blauw", "Printer": "Printer", "Tool": "Gereedschap", "Settings": "Instellingen", "Path to FFMPEG": "Lokatie van FFMPEG", "Upload to SD": "Uploaden naar SD", "The command \"%(command)s\" could not be executed.": "Het commando \"%(command)s\" kon niet uitgevoerd worden.", "Printed": "Geprint", "Layer number": "Laag nummer", "Sync with job progress": "Synchroniseer met taak voortgang", "Circular": "Cirkelvormig", "Total filament used": "Totaal gebruikte filament", "red": "rood", "Save as default": "Stel in als standaard", "Slicing ...": "Slicing ...", "Last Print Time": "Laatste print tijd", "Target": "Doel", "Streaming ...": "Streaming ...", "Logout successful": "Uitloggen succesvol", "Now rendering timelapse %(movie_basename)s": "Aan het renderen van timelapse %(movie_basename)s", "Documentation": "Documentatie", "%(hour)02d:%(minute)02d:%(second)02d": "%(hour)02d:%(minute)02d:%(second)02d", "Upload": "Upload", "ascending": "Oplopend", "Model size": "Model grootte", "Temperatures": "Temperaturen", "visited": "bezocht", "Timed": "Getimed", "Edit user \"%(user)s\"": "Bewerk gebruiker \"%(user)s\"", "Snapshot URL": "Snapshot URL", "Release SD card": "Geef SD kaart vrij", "Server is offline": "Server is offline", "Log communication to serial.log (might negatively impact Line truncated
window.BABEL_TO_LOAD_nl = {"locale": "nl", "domain": "messages", "plural_expr": "(n != 1)", "messages": {"": "Project-Id-Version: OctoPrint\nReport-Msgid-Bugs-To: i18n@octoprint.org\nPOT-Creation-Date: 2014-12-18 14:45+0100\nPO-Revision-Date: 2014-12-18 14:04+0000\nLast-Translator: Gina H\u00e4u\u00dfge <gina@foosel.net>\nLanguage-Team: Dutch (http://www.transifex.com/projects/p/octoprint/language/nl/)\nPlural-Forms: nplurals=2; plural=(n != 1)\nMIME-Version: 1.0\nContent-Type: text/plain; charset=utf-8\nContent-Transfer-Encoding: 8bit\nGenerated-By: Babel 1.3\n", "Print Time Left": "Resterende print tijd", "sec": "sec", "Proceed": "Doorgaan", "Timelapse Temp Folder": "Tijdelijke timelapse map", "Support <code>TargetExtr%%n</code>/<code>TargetBed</code> target temperature format": "Support <code>TargetExtr%%n</code>/<code>TargetBed</code> target temperature format", "Upload Folder": "Lokatie voor Uploads", "Only show files stored locally": "Laat alleen lokale bestanden zien", "Add Printer Profile": "", "yellow": "geel", "Save": "Opslaan", "Action": "Actie", "Passwords do not match": "De wachtwoorden komen niet overeen", "Sort by name": "Sorteer op naam", "Save connection settings": "Verbindings instellingen opslaan", "Rendering timelapse": "Renderen van timelapse", "Color": "Kleur", "Temperature": "Temperatuur", "Files": "Bestanden", "Resume": "Ga verder", "Always assume SD card is present": "Neem aan dat SD kaart altijd aanwezig is", "Load and Print": "Laad en print", "Sending file to SD": "Verstuur bestand naar SD kaartje", "Number of Extruders": "Aantal Extruders", "black": "zwart", "Last Printed": "Vorige print-job", "Sourcecode": "Broncode", "Estimated layer height": "Geschatte laag hooge", "You are now logged out": "Je bent nu uitgelogd", "Uploaded": "Geupload", "Form Factor": "", "Opening serial port": "Openen van seri\u00eble poort", "New timelapse %(movie_basename)s is done rendering.": "Nieuwe timelapse %(movie_basename)s is gerenderd", "Invert control": "Bedieining spiegelen", "Webcam": "Webcam", "Select for printing": "", "Allow <a href=\"%(url)s\">Cross Origin Resource Sharing (CORS)</a>": "Sta <a href=\"%(url)s\">Cross Origin Resource Sharing (CORS)</a> toe", "Remember me": "Onthoud me", "Enable GCode Visualizer": "Schakel GCode Visualizer in", "The server appears to be offline, at least I'm not getting any response from it. I'll try to reconnect automatically <strong>over the next couple of minutes</strong>, however you are welcome to try a manual reconnect anytime using the button below.": "De server lijkt offline te zijn, althans er komt geen enkele reactie. Ik zal over <strong>een paar minuten</strong> opnieuw pogen te verbinden. Je kunt op elk moment met onderstaande knop 'handmatig' proberen te verbinden", "Rendering failed": "Renderen mislukt", "Motors off": "Motoren uit", "descending": "Aflopend", "Only show files stored on SD": "Laat alleen bestanden op SD-kaart zien", "X": "X", "Add user": "Gebruiker toevoegen", "GCODE commands in layer": "GCODE commando's in laag", "Estimated print time": "Geschatte print tijd", "Serial Connection": "Seri\u00eble verbinding", "Control": "Controle", "Password": "Wachtwoord", "Also show next layer": "Laat ook volgende laag zien", "Print Time": "Print tijd", "Slicer": "'Slicer' of fileersoftware", "Nozzle Diameter": "", "Sort by file size": "Sorteer op bestands grootte", "Machine State": "Machine status", "Slicing Profile": "Fileer profiel", "mm": "mm", "API": "API", "Printing from SD": "Printen vanaf SD kaartje", "Stream URL": "Stream URL", "Terminal filters": "Terminal filters", "Change password for user \"%(user)s\"": "Verander wachtwoord voor gebruiker \"%(user)s\"", "Enable Temperature Graph": "Schakel temperatuur grafiek in", "Delete user": "Gebruiker verwijderen", "Timelapse bitrate": "Timelapse bitrate", "Confirm Password": "Bevestig wachtwoord", "Disconnect": "Verbreken", "Slicing done": "Fileren is klaar", "Initialize SD card": "Formateer SD kaart", "System": "Systeem", "Send": "Verstuur", "State": "Status", "Version": "Versie", "YYYY-MM-DD HH:mm": "DD-MM-YYYY HH:mm", "Attempt to reconnect": "Probeer opnieuw te verbinden", "Streaming done": "Het Streamen is klaar", "violet": "violet", "Print": "Print", "Layer count": "Aantal lagen", "OctoPrint Settings": "OctoPrint instellingen", "Are you sure?": "Weet je het zeker?", "blue": "blauw", "Printer": "Printer", "Delete Profile": "", "Tool": "Gereedschap", "Settings": "Instellingen", "Circular": "Cirkelvormig", "Path to FFMPEG": "Lokatie van FFMPEG", "Upload to SD": "opslaan op SD-kaart ", "The command \"%(command)s\" could not be executed.": "Het commando \"%(command)s\" kon niet uitgevoerd worden.", "Select a slicing profile...": "", "Wait for <code>start</code> on connect": "Wacht voor <code>start</code> bij het verbinden", "Sync with job progress": "Synchroniseer met taak voortgang", "Calculating...": "", "Total filament used": "Totaal gebruikte filament", "red": "rood", "Save as default": Line truncated
+1 -1
View File
@@ -1 +1 @@
window.BABEL_TO_LOAD_no = {"locale": "nb_NO", "domain": "messages", "plural_expr": "(n != 1)", "messages": {"": "Project-Id-Version: OctoPrint\nReport-Msgid-Bugs-To: i18n@octoprint.org\nPOT-Creation-Date: 2014-08-28 15:52+0200\nPO-Revision-Date: 2014-09-03 16:07+0000\nLast-Translator: lobster2b <ch.eikefjord@gmail.com>\nLanguage-Team: Norwegian (http://www.transifex.com/projects/p/octoprint/language/no/)\nPlural-Forms: nplurals=2; plural=(n != 1)\nMIME-Version: 1.0\nContent-Type: text/plain; charset=utf-8\nContent-Transfer-Encoding: 8bit\nGenerated-By: Babel 1.3\n", "Print Time Left": "Gjenst\u00e5ende utskriftstid", "Proceed": "Fortsett", "Timelapse Temp Folder": "Timelapse midlertidig mappe", "Title": "Tittel", "Only show files stored locally": "Bare vis filer lagret lokalt", "yellow": "gul", "Path to Cura": "Sti til Cura", "Action": "Handling", "Passwords do not match": "Passordet er ikke likt", "Sort by name": "Sorter ved navn", "Save connection settings": "Lagre tilkoblingsinnstillinger", "Rendering timelapse": "Sammensetter timelapse", "Cura": "Cura", "Files": "Filer", "Bed Size": "Plattformst\u00f8rrelse", "Always assume SD card is present": "Alltid anta at minnekort er p\u00e5 plass", "Load and Print": "Last og skriv ut", "Sending file to SD": "Sender fil til minnekort", "Number of Extruders": "Antall dyser", "black": "svart", "Last Printed": "Sist utskrevet", "Sourcecode": "Kildekode", "Estimated layer height": "Estimert lagh\u00f8yde", "You are now logged out": "Du er n\u00e5 logget ut", "Uploaded": "Opplastet", "Opening serial port": "\u00c5pner serialport", "New timelapse %(movie_basename)s is done rendering.": "Ny timelapse for %(movie_basename)s er ferdig sammensatt", "Invert control": "Inverter kontroller", "Webcam": "Nettkamera", "Remember me": "Husk meg", "Enable GCode Visualizer": "Aktiver GCode framviser", "The server appears to be offline, at least I'm not getting any response from it. I'll try to reconnect automatically <strong>over the next couple of minutes</strong>, however you are welcome to try a manual reconnect anytime using the button below.": "Serveren er tilsynelatende frakoblet, i det minste f\u00e5r jeg ikke noen respons fra den. Jeg pr\u00f8ver \u00e5 koble til automatisk <strong>over de neste minuttene</strong>, du kan pr\u00f8ve en manuell oppkobling n\u00e5r du \u00f8nsker det ved \u00e5 bruke knappen nedenfor.", "Rendering failed": "Sammensetting feilet", "Upload Folder": "Opplastningsmappe", "descending": "synkende", "X": "X", "Add user": "Legg til bruker", "GCODE commands in layer": "GCODE kommandoer i lag", "Estimated print time": "Beregnet printtid", "Serial Connection": "Seriell kontakt", "Control": "Kontroll", "Password": "Passord", "Also show next layer": "Ogs\u00e5 vis neste lag", "Print Time": "Utskriftstid", "Sort by file size": "Sorter filer etter st\u00f8rrelse", "Machine State": "Maskintilstand", "default": "standard", "API": "API", "Printing from SD": "Utskrift fra minnekort", "Terminal filters": "Terminal filtre", "Change password for user \"%(user)s\"": "Endre passord for bruker \"%(user)s\"", "Enable Temperature Graph": "Aktiver temperaturgraf", "Delete user": "Slett bruker", "Confirm Password": "Bekreft passord", "Disconnect": "Koble fra", "Slicing done": "Slicing ferdig", "Initialize SD card": "Start minnekortet", "System": "System", "Send": "Send", "State": "Tilstand", "Version": "Versjon", "YYYY-MM-DD HH:mm": "YYYY-MM-DD HH:mm", "Attempt to reconnect": "Fors\u00f8k \u00e5 koble til p\u00e5 nytt", "Streaming done": "Streaming ferdig", "violet": "fiolett", "Print": "Utskriv", "Layer count": "Antall lag", "OctoPrint Settings": "OctoPrint innstillinger", "Are you sure?": "Er du sikker?", "blue": "bl\u00e5", "Printer": "Printer", "Tool": "Verkt\u00f8y", "Settings": "Innstillinger", "Path to FFMPEG": "Sti til FFMPEG", "Upload to SD": "Last opp til minnekort", "The command \"%(command)s\" could not be executed.": "Kommando \"%(command)s\" mislykkes", "Printed": "Utskrevet", "Layer number": "Lag nummer", "Sync with job progress": "Synkroniser med jobbprogresjon", "Circular": "Sirkul\u00e6r", "Total filament used": "Totalt tr\u00e5dforbruk", "red": "r\u00f8d", "Save as default": "Lagre som standard", "Slicing ...": "Slicing ...", "Last Print Time": "Siste utskriftstid", "Target": "M\u00e5l", "Streaming ...": "Streaming ...", "Logout successful": "Logg ut vellykket", "Now rendering timelapse %(movie_basename)s": "Sammensetter timelapse %(movie_basename)s", "Documentation": "Dokumentasjon", "%(hour)02d:%(minute)02d:%(second)02d": "%(hour)02d:%(minute)02d:%(second)02d", "Upload": "Last opp", "ascending": "stigende", "Model size": "Modellst\u00f8rrelse", "Temperatures": "Temperaturer", "visited": "bes\u00f8kt", "Timed": "Tidtakes", "Edit user \"%(user)s\"": "Endre bruker \"%(user)s\"", "Snapshot URL": "Hurtigbilde URL", "Release SD card": "L\u00f8s ut minnekort", "Server is offline": "Server er frakoblet", "Log communication to serial.log (might negatively imLine truncated
window.BABEL_TO_LOAD_no = {"locale": "nb_NO", "domain": "messages", "plural_expr": "(n != 1)", "messages": {"": "Project-Id-Version: OctoPrint\nReport-Msgid-Bugs-To: i18n@octoprint.org\nPOT-Creation-Date: 2014-12-18 14:45+0100\nPO-Revision-Date: 2014-12-18 14:04+0000\nLast-Translator: Gina H\u00e4u\u00dfge <gina@foosel.net>\nLanguage-Team: Norwegian (http://www.transifex.com/projects/p/octoprint/language/no/)\nPlural-Forms: nplurals=2; plural=(n != 1)\nMIME-Version: 1.0\nContent-Type: text/plain; charset=utf-8\nContent-Transfer-Encoding: 8bit\nGenerated-By: Babel 1.3\n", "Print Time Left": "Gjenst\u00e5ende utskriftstid", "sec": "sek", "Proceed": "Fortsett", "Timelapse Temp Folder": "Timelapse midlertidig mappe", "Support <code>TargetExtr%%n</code>/<code>TargetBed</code> target temperature format": "St\u00f8tte <code>TargetExtr%%n</code>/<code>TargetBed</code> m\u00e5l temperatur format", "Upload Folder": "Opplastningsmappe", "Only show files stored locally": "Bare vis filer lagret lokalt", "Add Printer Profile": "", "yellow": "gul", "Save": "Lagre", "Action": "Handling", "Passwords do not match": "Passordet er ikke likt", "Sort by name": "Sorter ved navn", "Save connection settings": "Lagre tilkoblingsinnstillinger", "Rendering timelapse": "Sammensetter timelapse", "Color": "Farge", "Temperature": "Temperatur", "Files": "Filer", "Resume": "Fortsett", "Always assume SD card is present": "Alltid anta at minnekort er p\u00e5 plass", "Load and Print": "Last og skriv ut", "Sending file to SD": "Sender fil til minnekort", "Number of Extruders": "Antall dyser", "black": "svart", "Last Printed": "Sist utskrevet", "Sourcecode": "Kildekode", "Estimated layer height": "Estimert lagh\u00f8yde", "You are now logged out": "Du er n\u00e5 logget ut", "Uploaded": "Opplastet", "Form Factor": "", "Opening serial port": "\u00c5pner serialport", "New timelapse %(movie_basename)s is done rendering.": "Ny timelapse for %(movie_basename)s er ferdig sammensatt", "Invert control": "Inverter kontroller", "Webcam": "Nettkamera", "Select for printing": "", "Allow <a href=\"%(url)s\">Cross Origin Resource Sharing (CORS)</a>": "Tillat <a href=\"%(url)s\">Cross Origin Resource Sharing (CORS)</a>", "Remember me": "Husk meg", "Enable GCode Visualizer": "Aktiver GCode framviser", "The server appears to be offline, at least I'm not getting any response from it. I'll try to reconnect automatically <strong>over the next couple of minutes</strong>, however you are welcome to try a manual reconnect anytime using the button below.": "Serveren er tilsynelatende frakoblet, i det minste f\u00e5r jeg ikke noen respons fra den. Jeg pr\u00f8ver \u00e5 koble til automatisk <strong>over de neste minuttene</strong>, du kan pr\u00f8ve en manuell oppkobling n\u00e5r du \u00f8nsker det ved \u00e5 bruke knappen nedenfor.", "Rendering failed": "Sammensetting feilet", "Motors off": "Motorer av", "descending": "synkende", "Only show files stored on SD": "Bare vis filer lagret p\u00e5 minnekortet", "X": "X", "Add user": "Legg til bruker", "GCODE commands in layer": "GCODE kommandoer i lag", "Estimated print time": "Beregnet printtid", "Serial Connection": "Seriell kontakt", "Control": "Kontroll", "Password": "Passord", "Also show next layer": "Ogs\u00e5 vis neste lag", "Print Time": "Utskriftstid", "Slicer": "Slicer", "Nozzle Diameter": "", "Sort by file size": "Sorter filer etter st\u00f8rrelse", "Machine State": "Maskintilstand", "Slicing Profile": "Slicer profil", "mm": "mm", "API": "API", "Printing from SD": "Utskrift fra minnekort", "Stream URL": "Str\u00f8m URL", "Terminal filters": "Terminal filtre", "Change password for user \"%(user)s\"": "Endre passord for bruker \"%(user)s\"", "Enable Temperature Graph": "Aktiver temperaturgraf", "Delete user": "Slett bruker", "Timelapse bitrate": "Timelapse bitrate", "Confirm Password": "Bekreft passord", "Disconnect": "Koble fra", "Slicing done": "Slicing ferdig", "Initialize SD card": "Start minnekortet", "System": "System", "Send": "Send", "State": "Tilstand", "Version": "Versjon", "YYYY-MM-DD HH:mm": "YYYY-MM-DD HH:mm", "Attempt to reconnect": "Fors\u00f8k \u00e5 koble til p\u00e5 nytt", "Streaming done": "Str\u00f8mming ferdig", "violet": "fiolett", "Print": "Utskriv", "Layer count": "Antall lag", "OctoPrint Settings": "OctoPrint innstillinger", "Are you sure?": "Er du sikker?", "blue": "bl\u00e5", "Printer": "Printer", "Delete Profile": "", "Tool": "Verkt\u00f8y", "Settings": "Innstillinger", "Circular": "Sirkul\u00e6r", "Path to FFMPEG": "Sti til FFMPEG", "Upload to SD": "Last opp til minnekort", "The command \"%(command)s\" could not be executed.": "Kommando \"%(command)s\" mislykkes", "Select a slicing profile...": "", "Wait for <code>start</code> on connect": "Vent for <code>start</code> p\u00e5 tilkobling", "Sync with job progress": "Synkroniser med jobbprogresjon", "Calculating...": "", "Total filament used": "Totalt tr\u00e5dforbruk", "red": "r\u00f8d", "Save as default": "Lagre som standard", "SlicingLine truncated
+1 -1
View File
@@ -1 +1 @@
window.BABEL_TO_LOAD_ro = {"locale": "ro", "domain": "messages", "plural_expr": "(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1))", "messages": {"": "Project-Id-Version: OctoPrint\nReport-Msgid-Bugs-To: i18n@octoprint.org\nPOT-Creation-Date: 2014-08-28 15:52+0200\nPO-Revision-Date: 2014-08-31 16:21+0000\nLast-Translator: 3Dmaker4U <3dmaker4u@gmail.com>\nLanguage-Team: Romanian (http://www.transifex.com/projects/p/octoprint/language/ro/)\nPlural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1))\nMIME-Version: 1.0\nContent-Type: text/plain; charset=utf-8\nContent-Transfer-Encoding: 8bit\nGenerated-By: Babel 1.3\n", "Print Time Left": "Timp de imprimare r\u0103mas", "Proceed": "Continuare", "Timelapse Temp Folder": "Director temporar pentru \u00eenregistrarea rapid\u0103", "Title": "Titlu", "Only show files stored locally": "Arat\u0103 doar fi\u0219ierele stocate local", "yellow": "galben", "Path to Cura": "Cale c\u0103tre Cura", "Action": "Ac\u021biune", "Passwords do not match": "Parolele nu se potrivesc", "Sort by name": "Sortare dup\u0103 nume", "Save connection settings": "Salvare configura\u021bie conexiune", "Rendering timelapse": "Redare \u00eenregistrare rapid\u0103", "Cura": "Cura", "Files": "Fi\u0219iere", "Bed Size": "M\u0103rime mas\u0103", "Always assume SD card is present": "Consider\u0103 \u00eentotdeauna cardul SD prezent", "Load and Print": "\u00cenc\u0103rcare \u0219i imprimare", "Sending file to SD": "Se transmite fi\u0219ierul c\u0103tre SD", "Number of Extruders": "Num\u0103r de extrudere", "black": "negru", "Last Printed": "Ultima dat\u0103 imprimat", "Sourcecode": "Cod surs\u0103", "Estimated layer height": "\u00cen\u0103l\u021bimea stratului estimat\u0103", "You are now logged out": "Acum e\u0219ti deconectat", "Uploaded": "\u00cenc\u0103rcat", "Opening serial port": "Se deschide portul serial", "New timelapse %(movie_basename)s is done rendering.": "Redarea noii \u00eenregistr\u0103ri rapide %(movie_basename)s s-a terminat.", "Invert control": "Inversare comand\u0103", "Webcam": "Webcam", "Remember me": "\u021aine-m\u0103 minte", "Enable GCode Visualizer": "Activeaz\u0103 vizualizarea GCode", "The server appears to be offline, at least I'm not getting any response from it. I'll try to reconnect automatically <strong>over the next couple of minutes</strong>, however you are welcome to try a manual reconnect anytime using the button below.": "Se pare c\u0103 serverul nu este connectat sau, cel pu\u021bin, mie nu-mi r\u0103spunde. Voi \u00eencerca s\u0103 m\u0103 reconectez automat <strong>\u00een urm\u0103toarele dou\u0103 minute</strong>, dar po\u021bi \u00eencerca oric\u00e2nd s\u0103 te reconectezi manual utiliz\u00e2nd butonul de mai jos.", "Rendering failed": "Redarea a e\u0219uat", "Upload Folder": "\u00cencarc\u0103 director", "descending": "descresc\u0103tor", "X": "X", "Add user": "Ad\u0103ugare utilizator", "GCODE commands in layer": "comenzi GCODE \u00een strat", "Estimated print time": "Timp de imprimare estimat", "Serial Connection": "Conexiune serial\u0103", "Control": "Control", "Password": "Parol\u0103", "Also show next layer": "Vizualizare strat urm\u0103tor", "Print Time": "Timp de imprimare", "Sort by file size": "Sortare dup\u0103 m\u0103rimea fi\u0219ierului", "Machine State": "Starea ma\u0219inii", "default": "implicit", "API": "API", "Printing from SD": "Se imprim\u0103 de pe SD", "Terminal filters": "Filtre pentru terminal", "Change password for user \"%(user)s\"": "Modificare parol\u0103 pentru utilizatorul \"%(user)s\"", "Enable Temperature Graph": "Activeaz\u0103 graficul temperaturii", "Delete user": "\u0218tergere utilizator", "Confirm Password": "Confirmare parol\u0103", "Disconnect": "Deconectare", "Slicing done": "Feliere terminat\u0103", "Initialize SD card": "Ini\u021bializare card SD", "System": "Sistem", "Send": "Trimitere", "State": "Stare", "Version": "Versiune", "YYYY-MM-DD HH:mm": "DD.MM.YYYY HH.mm", "Attempt to reconnect": "\u00cencercare de reconectare", "Streaming done": "Transmiterea s-a terminat", "violet": "violet", "Print": "Imprimare", "Layer count": "Num\u0103r de straturi", "OctoPrint Settings": "Configurare OctoPrint", "Are you sure?": "E\u0219ti sigur?", "blue": "albastru", "Printer": "Imprimant\u0103", "Tool": "Unealt\u0103", "Settings": "Configura\u021bii", "Path to FFMPEG": "Cale c\u0103tre FFMPEG", "Upload to SD": "\u00cenc\u0103rcare pe SD", "The command \"%(command)s\" could not be executed.": "Comanda \"%(command)s\" nu a putut fi executat\u0103.", "Printed": "Imprimat", "Layer number": "Num\u0103rul stratului", "Sync with job progress": "Sincronizare cu stadiul lucr\u0103rii", "Circular": "Circular", "Total filament used": "Filament utilizat \u00een total", "red": "ro\u0219u", "Save as default": "Salvare ca valori implicite", "Slicing ...": "Se feliaz\u0103...", "Last Print Time": "Ultima imprimare a durat", "Target": "\u021aint\u0103", "Streaming ...": "Se transmite...", "Logout successful": "DecoLine truncated
window.BABEL_TO_LOAD_ro = {"locale": "ro", "domain": "messages", "plural_expr": "(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1))", "messages": {"": "Project-Id-Version: OctoPrint\nReport-Msgid-Bugs-To: i18n@octoprint.org\nPOT-Creation-Date: 2014-12-18 14:45+0100\nPO-Revision-Date: 2014-12-18 14:04+0000\nLast-Translator: Gina H\u00e4u\u00dfge <gina@foosel.net>\nLanguage-Team: Romanian (http://www.transifex.com/projects/p/octoprint/language/ro/)\nPlural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1))\nMIME-Version: 1.0\nContent-Type: text/plain; charset=utf-8\nContent-Transfer-Encoding: 8bit\nGenerated-By: Babel 1.3\n", "Print Time Left": "Timp de imprimare r\u0103mas", "sec": "sec", "Proceed": "Continuare", "Timelapse Temp Folder": "Director temporar pentru \u00eenregistrarea rapid\u0103", "Support <code>TargetExtr%%n</code>/<code>TargetBed</code> target temperature format": "Sus\u021bine formatul <code>TargetExtr%%n</code>/<code>TargetBed</code> pentru temperatura \u021bint\u0103", "Upload Folder": "\u00cencarc\u0103 director", "Only show files stored locally": "Arat\u0103 doar fi\u0219ierele stocate local", "Add Printer Profile": "", "yellow": "galben", "Save": "Salvare", "Action": "Ac\u021biune", "Passwords do not match": "Parolele nu se potrivesc", "Sort by name": "Sortare dup\u0103 nume", "Save connection settings": "Salvare configura\u021bie conexiune", "Rendering timelapse": "Redare \u00eenregistrare rapid\u0103", "Color": "Culoare", "Temperature": "Temperatur\u0103", "Files": "Fi\u0219iere", "Resume": "", "Always assume SD card is present": "Consider\u0103 \u00eentotdeauna cardul SD prezent", "Load and Print": "\u00cenc\u0103rcare \u0219i imprimare", "Sending file to SD": "Se transmite fi\u0219ierul c\u0103tre SD", "Number of Extruders": "Num\u0103r de extrudere", "black": "negru", "Last Printed": "Ultima dat\u0103 imprimat", "Sourcecode": "Cod surs\u0103", "Estimated layer height": "\u00cen\u0103l\u021bimea stratului estimat\u0103", "You are now logged out": "Acum e\u0219ti deconectat", "Uploaded": "\u00cenc\u0103rcat", "Form Factor": "", "Opening serial port": "Se deschide portul serial", "New timelapse %(movie_basename)s is done rendering.": "Redarea noii \u00eenregistr\u0103ri rapide %(movie_basename)s s-a terminat.", "Invert control": "Inversare comand\u0103", "Webcam": "Webcam", "Select for printing": "", "Allow <a href=\"%(url)s\">Cross Origin Resource Sharing (CORS)</a>": "Permite <a href=\"%(url)s\">Cross Origin Resource Sharing (CORS)</a>", "Remember me": "\u021aine-m\u0103 minte", "Enable GCode Visualizer": "Activeaz\u0103 vizualizarea GCode", "The server appears to be offline, at least I'm not getting any response from it. I'll try to reconnect automatically <strong>over the next couple of minutes</strong>, however you are welcome to try a manual reconnect anytime using the button below.": "Se pare c\u0103 serverul nu este connectat sau, cel pu\u021bin, mie nu-mi r\u0103spunde. Voi \u00eencerca s\u0103 m\u0103 reconectez automat <strong>\u00een urm\u0103toarele dou\u0103 minute</strong>, dar po\u021bi \u00eencerca oric\u00e2nd s\u0103 te reconectezi manual utiliz\u00e2nd butonul de mai jos.", "Rendering failed": "Redarea a e\u0219uat", "Motors off": "Oprire motoare", "descending": "descresc\u0103tor", "Only show files stored on SD": "Arat\u0103 doar fi\u0219ierele stocate pe SD", "X": "X", "Add user": "Ad\u0103ugare utilizator", "GCODE commands in layer": "comenzi GCODE \u00een strat", "Estimated print time": "Timp de imprimare estimat", "Serial Connection": "Conexiune serial\u0103", "Control": "Control", "Password": "Parol\u0103", "Also show next layer": "Vizualizare strat urm\u0103tor", "Print Time": "Timp de imprimare", "Slicer": "", "Nozzle Diameter": "", "Sort by file size": "Sortare dup\u0103 m\u0103rimea fi\u0219ierului", "Machine State": "Starea ma\u0219inii", "Slicing Profile": "", "mm": "mm", "API": "API", "Printing from SD": "Se imprim\u0103 de pe SD", "Stream URL": "URL flux video", "Terminal filters": "Filtre pentru terminal", "Change password for user \"%(user)s\"": "Modificare parol\u0103 pentru utilizatorul \"%(user)s\"", "Enable Temperature Graph": "Activeaz\u0103 graficul temperaturii", "Delete user": "\u0218tergere utilizator", "Timelapse bitrate": "Vitez\u0103 \u00eenregistrare rapid\u0103", "Confirm Password": "Confirmare parol\u0103", "Disconnect": "Deconectare", "Slicing done": "Feliere terminat\u0103", "Initialize SD card": "Ini\u021bializare card SD", "System": "Sistem", "Send": "Trimitere", "State": "Stare", "Version": "Versiune", "YYYY-MM-DD HH:mm": "DD.MM.YYYY HH.mm", "Attempt to reconnect": "\u00cencercare de reconectare", "Streaming done": "Transmiterea s-a terminat", "violet": "violet", "Print": "Imprimare", "Layer count": "Num\u0103r de straturi", "OctoPrint Settings": "Configurare OctoPrint", "Are you sure?": "E\u0219ti sigur?", "blue": "albastru", "Printer": "Imprimant\u0103", "Delete Profile": "", "Tool": "Unealt\u0103", Line truncated
+45 -5
View File
@@ -410,6 +410,10 @@ ul.dropdown-menu li a {
#webcam_container {
width: 100%;
position: relative;
outline: none;
//min-height: 440px;
.flipH {
-webkit-transform: scaleX(-1);
@@ -425,6 +429,40 @@ ul.dropdown-menu li a {
-webkit-transform: scaleX(-1) scaleY(-1);
-moz-transform: scaleX(-1) scaleY(-1);
}
.keycontrol_overlay {
position: absolute;
left: 10px;
right: 10px;
bottom: 10px;
background: rgba(0, 0, 0, 0.5);
font-size: 85%;
color: white;
padding: 0;
kbd {
border: 1px solid #eeeeee;
border-radius: 3px;
margin-left: 2px;
margin-right: 2px;
font-size: 90%;
padding: 2px;
min-width: 1em;
}
.keycontrol_overlay_heading {
position: relative;
padding: 10px;
font-weight: bold;
}
.keycontrol_overlay_column {
position: relative;
width: 45%;
padding: 10px;
float: left;
}
}
}
/** GCODE file manager */
@@ -493,12 +531,14 @@ ul.dropdown-menu li a {
text-align: left;
}
.jog-panel > div {
text-align: center;
}
.jog-panel {
>div {
text-align: center;
}
.jog-panel > div.distance {
text-align: left;
>div.distance {
text-align: left;
}
}
.box {
+35 -15
View File
@@ -59,7 +59,7 @@
var CONFIG_GCODE_SIZE_THRESHOLD = {{ gcodeThreshold }};
var CONFIG_GCODE_MOBILE_SIZE_THRESHOLD = {{ gcodeMobileThreshold }};
var SOCKJS_URI = window.location.protocol.slice(0, -1) + "://" + (window.document ? window.document.domain : window.location.hostname) + ":" + window.location.port + BASEURL + "sockjs";
var SOCKJS_URI = "{{ url_for('index') }}" + "sockjs";
var SOCKJS_DEBUG = {% if debug -%} true; {% else %} false; {%- endif %}
var UI_API_KEY = "{{ uiApiKey }}";
@@ -125,7 +125,7 @@
<div class="accordion span4">
<div class="accordion-group" data-bind="visible: loginState.isUser" id="connection_accordion">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" href="#connection"><i class="icon-signal"></i> {{ _('Connection') }}</a>
<a class="accordion-toggle" data-toggle="collapse" data-target="#connection"><i class="icon-signal"></i> {{ _('Connection') }}</a>
</div>
<div class="accordion-body collapse in" id="connection">
<div class="accordion-inner">
@@ -353,8 +353,26 @@
</div>
<div class="tab-pane" id="control">
{% if webcamStream %}
<div id="webcam_container">
<div id="webcam_container" tabindex="0" data-bind="event: { keydown: onKeyDown, mouseover: onMouseOver, mouseout: onMouseOut, focus: onFocus }">
<img id="webcam_image" data-bind="css: { flipH: settings.webcam_flipH(), flipV: settings.webcam_flipV() }">
<div class="keycontrol_overlay" data-bind="visible: showKeycontrols">
<div class="keycontrol_overlay_heading">{{ _("Keyboard controls active") }} <a href="#" data-bind="click: toggleKeycontrolHelp"><i data-bind="css: { 'icon-chevron-down': !keycontrolHelpActive(), 'icon-chevron-up': keycontrolHelpActive() }"></i></a></div>
<div data-bind="visible: keycontrolHelpActive">
<div class="keycontrol_overlay_column">
<kbd>&rarr;</kbd> / <kbd>&larr;</kbd>: {{ _("X Axis") }} +/-<br>
<kbd>&uarr;</kbd> / <kbd>&darr;</kbd>: {{ _("Y Axis") }} +/-<br>
<kbd>W</kbd>, <kbd>{{ _("Page&uarr;") }}</kbd> / <kbd>S</kbd>, <kbd>{{ _("Page&darr;") }}</kbd>: {{ _("Z Axis") }} +/-
</div>
<div class="keycontrol_overlay_column">
<kbd>Home</kbd>: {{ _("Home X/Y") }}<br>
<kbd>End</kbd>: {{ _("Home Z") }}<br>
<kbd>1</kbd>, <kbd>2</kbd>, <kbd>3</kbd>, <kbd>4</kbd>: {{ _("Stepsize") }} 0.1, 1, 10, 100mm
</div>
</div>
</div>
</div>
<div data-bind="visible: keycontrolPossible">
<small>{{ _("Hint: If you move your mouse over the picture, you enter keyboard control mode.") }}</small>
</div>
{% endif %}
@@ -363,39 +381,41 @@
<div class="jog-panel">
<h1>X/Y</h1>
<div>
<button class="btn box" data-bind="enable: isOperational() && !isPrinting() && loginState.isUser(), click: function() { $root.sendJogCommand('y',1) }"><i class="icon-arrow-up"></i></button>
<button class="btn box" id="control-yinc" data-bind="enable: isOperational() && !isPrinting() && loginState.isUser(), click: function() { $root.sendJogCommand('y',1) }"><i class="icon-arrow-up"></i></button>
</div>
<div>
<button class="btn box pull-left" data-bind="enable: isOperational() && !isPrinting() && loginState.isUser(), click: function() { $root.sendJogCommand('x',-1) }"><i class="icon-arrow-left"></i></button>
<button class="btn box pull-left" data-bind="enable: isOperational() && !isPrinting() && loginState.isUser(), click: function() { $root.sendHomeCommand(['x', 'y']) }"><i class="icon-home"></i></button>
<button class="btn box pull-left" data-bind="enable: isOperational() && !isPrinting() && loginState.isUser(), click: function() { $root.sendJogCommand('x',1) }"><i class="icon-arrow-right"></i></button>
<button class="btn box pull-left" id="control-xdec" data-bind="enable: isOperational() && !isPrinting() && loginState.isUser(), click: function() { $root.sendJogCommand('x',-1) }"><i class="icon-arrow-left"></i></button>
<button class="btn box pull-left" id="control-xyhome" data-bind="enable: isOperational() && !isPrinting() && loginState.isUser(), click: function() { $root.sendHomeCommand(['x', 'y']) }"><i class="icon-home"></i></button>
<button class="btn box pull-left" id="control-xinc" data-bind="enable: isOperational() && !isPrinting() && loginState.isUser(), click: function() { $root.sendJogCommand('x',1) }"><i class="icon-arrow-right"></i></button>
</div>
<div>
<button class="btn box" data-bind="enable: isOperational() && !isPrinting() && loginState.isUser(), click: function() { $root.sendJogCommand('y',-1) }"><i class="icon-arrow-down"></i></button>
<button class="btn box" id="control-ydec" data-bind="enable: isOperational() && !isPrinting() && loginState.isUser(), click: function() { $root.sendJogCommand('y',-1) }"><i class="icon-arrow-down"></i></button>
</div>
</div>
<!-- Z jogging control panel -->
<div class="jog-panel">
<h1>Z</h1>
<div>
<button class="btn box" data-bind="enable: isOperational() && !isPrinting() && loginState.isUser(), click: function() { $root.sendJogCommand('z',1) }"><i class="icon-arrow-up"></i></button>
<button class="btn box" id="control-zinc" data-bind="enable: isOperational() && !isPrinting() && loginState.isUser(), click: function() { $root.sendJogCommand('z',1) }"><i class="icon-arrow-up"></i></button>
</div>
<div>
<button class="btn box" data-bind="enable: isOperational() && !isPrinting() && loginState.isUser(), click: function() { $root.sendHomeCommand(['z']) }"><i class="icon-home"></i></button>
<button class="btn box" id="control-zhome" data-bind="enable: isOperational() && !isPrinting() && loginState.isUser(), click: function() { $root.sendHomeCommand(['z']) }"><i class="icon-home"></i></button>
</div>
<div>
<button class="btn box" data-bind="enable: isOperational() && !isPrinting() && loginState.isUser(), click: function() { $root.sendJogCommand('z',-1) }"><i class="icon-arrow-down"></i></button>
<button class="btn box" id="control-zdec" data-bind="enable: isOperational() && !isPrinting() && loginState.isUser(), click: function() { $root.sendJogCommand('z',-1) }"><i class="icon-arrow-down"></i></button>
</div>
</div>
<!-- Jog distance -->
<div class="distance">
<div class="btn-group" data-toggle="buttons-radio" id="jog_distance">
<button type="button" class="btn distance" data-distance="0.1" data-bind="enable: loginState.isUser()">0.1</button>
<button type="button" class="btn distance" data-distance="1" data-bind="enable: loginState.isUser()">1</button>
<button type="button" class="btn distance active" data-distance="10" data-bind="enable: loginState.isUser()">10</button>
<button type="button" class="btn distance" data-distance="100" data-bind="enable: loginState.isUser()">100</button>
<button type="button" id="control-distance01" class="btn distance" data-distance="0.1" data-bind="enable: loginState.isUser()">0.1</button>
<button type="button" id="control-distance1" class="btn distance" data-distance="1" data-bind="enable: loginState.isUser()">1</button>
<button type="button" id="control-distance10" class="btn distance active" data-distance="10" data-bind="enable: loginState.isUser()">10</button>
<button type="button" id="control-distance100" class="btn distance" data-distance="100" data-bind="enable: loginState.isUser()">100</button>
</div>
</div>
</div>
<!-- Extrusion control panel -->
<div class="jog-panel" style="display: none;" data-bind="visible: loginState.isUser">
+25
View File
@@ -18,6 +18,7 @@
<li><a href="#settings_api" data-toggle="tab">{{ _('API') }}</a></li>
<li class="nav-header">OctoPrint</li>
<li><a href="#settings_folder" data-toggle="tab">{{ _('Folders') }}</a></li>
<li><a href="#settings_appearance" data-toggle="tab">{{ _('Appearance') }}</a></li>
<li><a href="#settings_logs" data-toggle="tab">{{ _('Logs') }}</a></li>
{% if settingsPlugins %}
<li class="nav-header">Plugins</li>
@@ -349,6 +350,13 @@
</label>
</div>
</div>
<div class="control-group">
<div class="controls">
<label class="checkbox">
<input type="checkbox" data-bind="checked: feature_keyboardControl" id="settings-featureKeyboardControl"> {{ _("Enable Keyboard Control") }}
</label>
</div>
</div>
<div class="control-group">
<div class="controls">
<label class="checkbox">
@@ -477,6 +485,23 @@
</div>
</form>
</div>
<div class="tab-pane" id="settings_appearance">
<form class="form-horizontal">
<div class="control-group">
<label class="control-label" for="settings-appearanceName">{{ _('Title') }}</label>
<div class="controls">
<input type="text" class="input-block-level" data-bind="value: appearance_name" id="settings-appearanceName">
</div>
</div>
<div class="control-group">
<label class="control-label" for="settings-appearanceColor">{{ _('Color') }}</label>
<div class="controls">
<select id="settings-appearanceColor" data-bind="value: appearance_color, options: appearance_available_colors, optionsText: 'name', optionsValue: 'key'">
</select>
</div>
</div>
</form>
</div>
<div class="tab-pane" id="settings_api">
<form class="form-horizontal" onsubmit="return false;">
<div class="control-group">
+9 -4
View File
@@ -227,8 +227,12 @@ class Timelapse(object):
self._logger.warn("Cannot capture image, capture directory is unset")
return
if self._imageNumber is None:
self._logger.warn("Cannot capture image, image number is unset")
return
with self._captureMutex:
filename = os.path.join(self._captureDir, "tmp_%05d.jpg" % (self._imageNumber))
filename = os.path.join(self._captureDir, "tmp_%05d.jpg" % self._imageNumber)
self._imageNumber += 1
self._logger.debug("Capturing image to %s" % filename)
captureThread = threading.Thread(target=self._captureWorker, kwargs={"filename": filename})
@@ -243,8 +247,9 @@ class Timelapse(object):
self._logger.debug("Image %s captured from %s" % (filename, self._snapshotUrl))
except:
self._logger.exception("Could not capture image %s from %s, decreasing image counter again" % (filename, self._snapshotUrl))
if self._imageNumber is not None and self._imageNumber > 0:
self._imageNumber -= 1
with self._captureMutex:
if self._imageNumber is not None and self._imageNumber > 0:
self._imageNumber -= 1
eventManager().fire(Events.CAPTURE_DONE, {"file": filename})
def _createMovie(self, success=True):
@@ -299,7 +304,7 @@ class Timelapse(object):
# finalize command with output file
self._logger.debug("Rendering movie to %s" % output)
command.append(output)
command.append("\"" + output + "\"")
eventManager().fire(Events.MOVIE_RENDERING, {"gcode": self._gcodeFile, "movie": output, "movie_basename": os.path.basename(output)})
command_str = " ".join(command)
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+20 -4
View File
@@ -147,7 +147,7 @@ def findCollisionfreeName(input, extension, existingFilenames):
raise ValueError("Can't create a collision free filename")
def safeRename(old, new):
def safeRename(old, new, throw_error=False):
"""
Safely renames a file.
@@ -172,12 +172,14 @@ def safeRename(old, new):
os.rename(new, backup)
os.rename(old, new)
os.remove(backup)
except OSError:
except OSError as e:
# if anything went wrong, try to rename the backup file to its original name
logger.error("Could not perform safe rename, trying to revert")
if os.path.exists(backup):
os.remove(new)
os.rename(backup, new)
silentRemove(new)
os.rename(backup, new)
if throw_error:
raise e
else:
# on anything else than windows it's ooooh so much easier...
os.rename(old, new)
@@ -267,6 +269,20 @@ def dict_clean(a, b):
return result
def dict_contains_keys(a, b):
if not isinstance(a, dict) or not isinstance(b, dict):
return False
for k, v in a.iteritems():
if not k in b:
return False
elif isinstance(v, dict):
if not dict_contains_keys(v, b[k]):
return False
return True
class Object(object):
pass
+76 -29
View File
@@ -77,6 +77,8 @@ gcodeToEvent = {
"M226": Events.WAITING,
"M0": Events.WAITING,
"M1": Events.WAITING,
# dwell command
"G4": Events.DWELL,
# part cooler
"M245": Events.COOLING,
@@ -143,10 +145,14 @@ class MachineCom(object):
self._bedTempOffset = 0
self._commandQueue = queue.Queue()
self._currentZ = None
self._heatupWaitStartTime = 0
self._heatupWaitStartTime = None
self._heatupWaitTimeLost = 0.0
self._pauseWaitStartTime = None
self._pauseWaitTimeLost = 0.0
self._currentExtruder = 0
self._timeout = None
self._alwaysSendChecksum = settings().getBoolean(["feature", "alwaysSendChecksum"])
self._currentLine = 1
self._resendDelta = None
@@ -155,6 +161,7 @@ class MachineCom(object):
# hooks
self._pluginManager = octoprint.plugin.plugin_manager()
self._gcode_hooks = self._pluginManager.get_hooks("octoprint.comm.protocol.gcode")
self._printer_action_hooks = self._pluginManager.get_hooks("octoprint.comm.protocol.action")
# SD status data
self._sdAvailable = False
@@ -314,20 +321,17 @@ class MachineCom(object):
if self._currentFile is None or self._currentFile.getStartTime() is None:
return None
else:
return time.time() - self._currentFile.getStartTime()
return time.time() - self._currentFile.getStartTime() - self._pauseWaitTimeLost
def getPrintTimeRemainingEstimate(self):
def getCleanedPrintTime(self):
printTime = self.getPrintTime()
if printTime is None:
return None
printTime /= 60
progress = self._currentFile.getProgress()
if progress:
printTimeTotal = printTime / progress
return printTimeTotal - printTime
else:
return None
cleanedPrintTime = printTime - self._heatupWaitTimeLost
if cleanedPrintTime < 0:
cleanedPrintTime = 0.0
return cleanedPrintTime
def getTemp(self):
return self._temp
@@ -388,6 +392,11 @@ class MachineCom(object):
if self._currentFile is None:
raise ValueError("No file selected for printing")
self._heatupWaitStartTime = 0
self._heatupWaitTimeLost = 0.0
self._pauseWaitStartTime = 0
self._pauseWaitTimeLost = 0.0
try:
self._currentFile.start()
@@ -470,6 +479,10 @@ class MachineCom(object):
return
if not pause and self.isPaused():
if self._pauseWaitStartTime:
self._pauseWaitTimeLost = self._pauseWaitTimeLost + (time.time() - self._pauseWaitStartTime)
self._pauseWaitStartTime = None
self._changeState(self.STATE_PRINTING)
if self.isSdFileSelected():
self.sendCommand("M24")
@@ -482,6 +495,9 @@ class MachineCom(object):
"origin": self._currentFile.getFileLocation()
})
elif pause and self.isPrinting():
if not self._pauseWaitStartTime:
self._pauseWaitStartTime = time.time()
self._changeState(self.STATE_PAUSED)
if self.isSdFileSelected():
self.sendCommand("M25") # pause print
@@ -637,9 +653,11 @@ class MachineCom(object):
self._changeState(self.STATE_CONNECTING)
#Start monitoring the serial port.
timeout = getNewTimeout("communication")
self._timeout = getNewTimeout("communication")
tempRequestTimeout = getNewTimeout("temperature")
sdStatusRequestTimeout = getNewTimeout("sdStatus")
startSeen = not settings().getBoolean(["feature", "waitForStartOnConnect"])
heatingUp = False
swallowOk = False
@@ -651,7 +669,28 @@ class MachineCom(object):
if line is None:
break
if line.strip() is not "":
timeout = getNewTimeout("communication")
self._timeout = getNewTimeout("communication")
##~~ debugging output handling
if line.startswith("//"):
debugging_output = line[2:].strip()
if debugging_output.startswith("action:"):
action_command = debugging_output[len("action:"):].strip()
if action_command == "pause":
self._log("Pausing on request of the printer...")
self.setPause(True)
elif action_command == "resume":
self._log("Resuming on request of the printer...")
self.setPause(False)
elif action_command == "disconnect":
self._log("Disconnecting on request of the printer...")
self._callback.mcForceDisconnect()
else:
for hook in self._printer_action_hooks:
self._printer_action_hooks[hook](self, line, action_command)
else:
continue
##~~ Error handling
line = self._handleErrors(line)
@@ -688,12 +727,9 @@ class MachineCom(object):
self._callback.mcTempUpdate(self._temp, self._bedTemp)
#If we are waiting for an M109 or M190 then measure the time we lost during heatup, so we can remove that time from our printing time estimate.
if not 'ok' in line:
heatingUp = True
if self._heatupWaitStartTime != 0:
t = time.time()
self._heatupWaitTimeLost = t - self._heatupWaitStartTime
self._heatupWaitStartTime = t
if 'ok' in line and self._heatupWaitStartTime:
self._heatupWaitTimeLost = self._heatupWaitTimeLost + (time.time() - self._heatupWaitStartTime)
self._heatupWaitStartTime = None
elif supportRepetierTargetTemp and ('TargetExtr' in line or 'TargetBed' in line):
matchExtr = self._regex_repetierTempExtr.match(line)
matchBed = self._regex_repetierTempBed.match(line)
@@ -823,7 +859,7 @@ class MachineCom(object):
### Baudrate detection
if self._state == self.STATE_DETECT_BAUDRATE:
if line == '' or time.time() > timeout:
if line == '' or time.time() > self._timeout:
if len(self._baudrateDetectList) < 1:
self.close()
self._errorValue = "No more baudrates to test, and no suitable baudrate found."
@@ -843,7 +879,7 @@ class MachineCom(object):
self._log("Trying baudrate: %d" % (baudrate))
self._baudrateDetectRetry = 5
self._baudrateDetectTestOk = 0
timeout = getNewTimeout("communication")
self._timeout = getNewTimeout("communication")
self._serial.write('\n')
self._sendCommand("M105")
self._testingBaudrate = True
@@ -879,7 +915,7 @@ class MachineCom(object):
else:
self.initSdCard()
eventManager().fire(Events.CONNECTED, {"port": self._port, "baudrate": self._baudrate})
elif time.time() > timeout:
elif time.time() > self._timeout:
self.close()
### Operational
@@ -901,7 +937,7 @@ class MachineCom(object):
### Printing
elif self._state == self.STATE_PRINTING:
if line == "" and time.time() > timeout:
if line == "" and time.time() > self._timeout:
self._log("Communication timeout during printing, forcing a line")
line = 'ok'
@@ -1238,14 +1274,25 @@ class MachineCom(object):
self._resendDelta = None
return None
def _gcode_M112(self, cmd): # It's an emergency what todo? Canceling the print should be the minimum
self.cancelPrint()
return cmd
def _gcode_M112(self, cmd): # It's an emergency what todo? Canceling the print should be the minimum
self.cancelPrint()
return cmd
def _gcode_G4(self, cmd):
# we are intending to dwell for a period of time, increase the timeout to match
cmd = cmd.upper()
p_idx = cmd.find('P')
s_idx = cmd.find('S')
_timeout = 0
if p_idx != -1:
# dwell time is specified in milliseconds
_timeout = int(cmd[p_idx+1:]) / 1000.0
elif s_idx != -1:
# dwell time is specified in seconds
_timeout = int(cmd[s_idx+1:])
self._timeout = getNewTimeout("communication") + _timeout
return cmd
### MachineCom callback ################################################################################################
@@ -1286,6 +1333,9 @@ class MachineComPrintCallback(object):
def mcReceivedRegisteredMessage(self, command, message):
pass
def mcForceDisconnect(self):
pass
### Printing file information classes ##################################################################################
class PrintingFileInformation(object):
@@ -1386,9 +1436,9 @@ class PrintingGcodeFileInformation(PrintingFileInformation):
"""
Opens the file for reading and determines the file size. Start time won't be recorded until 100 lines in
"""
PrintingFileInformation.start(self)
self._filehandle = open(self._filename, "r")
self._lineCount = None
self._startTime = None
def getNext(self):
"""
@@ -1415,9 +1465,6 @@ class PrintingGcodeFileInformation(PrintingFileInformation):
self._lineCount += 1
self._filepos = self._filehandle.tell()
if self._lineCount >= 100 and self._startTime is None:
self._startTime = time.time()
return processedLine
except Exception as (e):
if self._filehandle is not None:
+29 -11
View File
@@ -43,6 +43,7 @@ class gcode(object):
def _load(self, gcodeFile, printer_profile):
filePos = 0
readBytes = 0
pos = [0.0, 0.0, 0.0]
posOffset = [0.0, 0.0, 0.0]
currentE = [0.0]
@@ -53,29 +54,46 @@ class gcode(object):
absoluteE = True
scale = 1.0
posAbs = True
feedRateXY = min(printer_profile["axes"]["x"], printer_profile["axes"]["y"])
feedRateXY = min(printer_profile["axes"]["x"]["speed"], printer_profile["axes"]["y"]["speed"])
offsets = printer_profile["extruder"]["offsets"]
for line in gcodeFile:
if self._abort:
raise AnalysisAborted()
filePos += 1
readBytes += len(line)
if isinstance(gcodeFile, (file)):
percentage = float(readBytes) / float(self._fileSize)
elif isinstance(gcodeFile, (list)):
percentage = float(filePos) / float(len(gcodeFile))
else:
percentage = None
try:
if self.progressCallback is not None and (filePos % 1000 == 0):
if isinstance(gcodeFile, (file)):
self.progressCallback(float(gcodeFile.tell()) / float(self._fileSize))
elif isinstance(gcodeFile, (list)):
self.progressCallback(float(filePos) / float(len(gcodeFile)))
if self.progressCallback is not None and (filePos % 1000 == 0) and percentage is not None:
self.progressCallback(percentage)
except:
pass
if ';' in line:
comment = line[line.find(';')+1:].strip()
if comment.startswith("filament_diameter"):
self._filamentDiameter = float(comment.split("=", 1)[1].strip())
elif comment.startswith("CURA_PROFILE_STRING"):
curaOptions = self._parseCuraProfileString(comment)
filamentValue = comment.split("=", 1)[1].strip()
try:
self._filamentDiameter = float(filamentValue)
except ValueError:
try:
self._filamentDiameter = float(filamentValue.split(",")[0].strip())
except ValueError:
self._filamentDiameter = 0.0
elif comment.startswith("CURA_PROFILE_STRING") or comment.startswith("CURA_OCTO_PROFILE_STRING"):
if comment.startswith("CURA_PROFILE_STRING"):
prefix = "CURA_PROFILE_STRING:"
else:
prefix = "CURA_OCTO_PROFILE_STRING:"
curaOptions = self._parseCuraProfileString(comment, prefix)
if "filament_diameter" in curaOptions:
try:
self._filamentDiameter = float(curaOptions["filament_diameter"])
@@ -226,8 +244,8 @@ class gcode(object):
self.extrusionVolume[i] = (self.extrusionAmount[i] * (math.pi * radius * radius)) / 1000
self.totalMoveTimeMinute = totalMoveTimeMinute
def _parseCuraProfileString(self, comment):
return {key: value for (key, value) in map(lambda x: x.split("=", 1), zlib.decompress(base64.b64decode(comment[len("CURA_PROFILE_STRING:"):])).split("\b"))}
def _parseCuraProfileString(self, comment, prefix):
return {key: value for (key, value) in map(lambda x: x.split("=", 1), zlib.decompress(base64.b64decode(comment[len(prefix):])).split("\b"))}
def getCodeInt(line, code):
+410 -181
View File
@@ -9,21 +9,42 @@ import os
import re
import threading
import math
import Queue
from serial import SerialTimeoutException
from octoprint.settings import settings
class VirtualPrinter():
def __init__(self):
self.readList = ['start\n', 'Marlin: Virtual Marlin!\n', '\x80\n', 'SD init fail\n'] # no sd card as default startup scenario
def __init__(self, read_timeout=5.0, write_timeout=10.0):
self._read_timeout = read_timeout
self._write_timeout = write_timeout
self.incoming = CharCountingQueue(settings().getInt(["devel", "virtualPrinter", "rxBuffer"]), name="RxBuffer")
self.outgoing = Queue.Queue()
self.buffered = Queue.Queue(maxsize=settings().getInt(["devel", "virtualPrinter", "commandBuffer"]))
for item in ['start\n', 'Marlin: Virtual Marlin!\n', '\x80\n', 'SD card ok\n']: # no sd card as default startup scenario
self.outgoing.put(item)
self.currentExtruder = 0
self.temp = [0.0] * settings().getInt(["devel", "virtualPrinter", "numExtruders"])
self.targetTemp = [0.0] * settings().getInt(["devel", "virtualPrinter", "numExtruders"])
self.lastTempAt = time.time()
self.bedTemp = 1.0
self.bedTargetTemp = 1.0
self.speeds = settings().get(["devel", "virtualPrinter", "movementSpeed"])
self._relative = True
self._lastX = None
self._lastY = None
self._lastZ = None
self._lastE = None
self._unitModifier = 1
self._virtualSd = settings().getBaseFolder("virtualSd")
self._sdCardReady = False
self._sdCardReady = True
self._sdPrinter = None
self._sdPrintingSemaphore = threading.Event()
self._selectedSdFile = None
@@ -36,151 +57,221 @@ class VirtualPrinter():
self.currentLine = 0
self.lastN = 0
self._incoming_lock = threading.RLock()
waitThread = threading.Thread(target=self._sendWaitAfterTimeout)
waitThread.start()
def write(self, data):
if self.readList is None:
return
readThread = threading.Thread(target=self._processIncoming)
readThread.start()
data = data.strip()
bufferThread = threading.Thread(target=self._processBuffer)
bufferThread.start()
# strip checksum
if "*" in data:
data = data[:data.rfind("*")]
self.currentLine += 1
elif settings().getBoolean(["devel", "virtualPrinter", "forceChecksum"]):
self.readList.append("Error: Missing checksum")
return
def __str__(self):
return "VIRTUAL(read_timeout={read_timeout},write_timeout={write_timeout},options={options})"\
.format(read_timeout=self._read_timeout, write_timeout=self._write_timeout, options=settings().get(["devel", "virtualPrinter"]))
# track N = N + 1
if data.startswith("N") and "M110" in data:
linenumber = int(re.search("N([0-9]+)", data).group(1))
self.lastN = linenumber
self.currentLine = linenumber
self._sendOk()
return
elif data.startswith("N"):
linenumber = int(re.search("N([0-9]+)", data).group(1))
expected = self.lastN + 1
if linenumber != expected:
self.readList.append("Error: expected line %d got %d" % (expected, linenumber))
self.readList.append("Resend:%d" % expected)
if settings().getBoolean(["devel", "virtualPrinter", "okAfterResend"]):
self.readList.append("ok")
return
elif self.currentLine == 100:
# simulate a resend at line 100 of the last 5 lines
self.lastN = 94
self.readList.append("Error: Line Number is not Last Line Number\n")
self.readList.append("rs %d\n" % (self.currentLine - 5))
if settings().getBoolean(["devel", "virtualPrinter", "okAfterResend"]):
self.readList.append("ok")
return
else:
def _clearQueue(self, queue):
try:
while queue.get(block=False):
continue
except Queue.Empty:
pass
def _processIncoming(self):
while self.incoming is not None:
self._simulateTemps()
try:
data = self.incoming.get(timeout=0.01)
except Queue.Empty:
continue
if data is None:
continue
data = data.strip()
# strip checksum
if "*" in data:
data = data[:data.rfind("*")]
self.currentLine += 1
elif settings().getBoolean(["devel", "virtualPrinter", "forceChecksum"]):
self.outgoing.put("Error: Missing checksum")
continue
# track N = N + 1
if data.startswith("N") and "M110" in data:
linenumber = int(re.search("N([0-9]+)", data).group(1))
self.lastN = linenumber
data = data.split(None, 1)[1].strip()
self.currentLine = linenumber
self._sendOk()
continue
elif data.startswith("N"):
linenumber = int(re.search("N([0-9]+)", data).group(1))
expected = self.lastN + 1
if linenumber != expected:
with self._incoming_lock:
self._clearQueue(self.incoming)
self.outgoing.put("Error: expected line %d got %d" % (expected, linenumber))
self.outgoing.put("Resend:%d" % expected)
self.outgoing.put("ok")
continue
elif self.currentLine == 100:
# simulate a resend at line 100
with self._incoming_lock:
self.lastN = 99
self._clearQueue(self.incoming)
self.outgoing.put("Error: Line Number is not Last Line Number\n")
self.outgoing.put("rs 100\n")
self.outgoing.put("ok")
continue
else:
self.lastN = linenumber
data = data.split(None, 1)[1].strip()
data += "\n"
data += "\n"
# shortcut for writing to SD
if self._writingToSd and not self._selectedSdFile is None and not "M29" in data:
with open(self._selectedSdFile, "a") as f:
f.write(data)
self._sendOk()
return
# shortcut for writing to SD
if self._writingToSd and not self._selectedSdFile is None and not "M29" in data:
with open(self._selectedSdFile, "a") as f:
f.write(data)
self._sendOk()
continue
#print "Send: %s" % (data.rstrip())
if 'M104' in data or 'M109' in data:
self._parseHotendCommand(data)
return
#print "Send: %s" % (data.rstrip())
if 'M104' in data or 'M109' in data:
self._parseHotendCommand(data)
continue
if 'M140' in data or 'M190' in data:
self._parseBedCommand(data)
return
if 'M140' in data or 'M190' in data:
self._parseBedCommand(data)
continue
if 'M105' in data:
self._processTemperatureQuery()
elif 'M20' in data:
if self._sdCardReady:
self._listSd()
elif 'M21' in data:
self._sdCardReady = True
self.readList.append("SD card ok")
elif 'M22' in data:
self._sdCardReady = False
elif 'M23' in data:
if self._sdCardReady:
filename = data.split(None, 1)[1].strip()
self._selectSdFile(filename)
elif 'M24' in data:
if self._sdCardReady:
self._startSdPrint()
elif 'M25' in data:
if self._sdCardReady:
self._pauseSdPrint()
elif 'M26' in data:
if self._sdCardReady:
pos = int(re.search("S([0-9]+)", data).group(1))
self._setSdPos(pos)
elif 'M27' in data:
if self._sdCardReady:
self._reportSdStatus()
elif 'M28' in data:
if self._sdCardReady:
filename = data.split(None, 1)[1].strip()
self._writeSdFile(filename)
elif 'M29' in data:
if self._sdCardReady:
self._finishSdFile()
elif 'M30' in data:
if self._sdCardReady:
filename = data.split(None, 1)[1].strip()
self._deleteSdFile(filename)
elif "M114" in data:
# send dummy position report
self.readList.append("ok C: X:10.00 Y:3.20 Z:5.20 E:1.24")
elif "M117" in data:
# we'll just use this to echo a message, to allow playing around with pause triggers
self.readList.append("ok %s" % re.search("M117\s+(.*)", data).group(1))
elif "M999" in data:
# mirror Marlin behaviour
self.readList.append("Resend: 1")
elif data.startswith("T"):
self.currentExtruder = int(re.search("T(\d+)", data).group(1))
self._sendOk()
self.readList.append("Active Extruder: %d" % self.currentExtruder)
elif len(data.strip()) > 0:
self._sendOk()
if 'M105' in data:
self._processTemperatureQuery()
continue
elif 'M20' in data:
if self._sdCardReady:
self._listSd()
elif 'M21' in data:
self._sdCardReady = True
self.outgoing.put("SD card ok")
elif 'M22' in data:
self._sdCardReady = False
elif 'M23' in data:
if self._sdCardReady:
filename = data.split(None, 1)[1].strip()
self._selectSdFile(filename)
elif 'M24' in data:
if self._sdCardReady:
self._startSdPrint()
elif 'M25' in data:
if self._sdCardReady:
self._pauseSdPrint()
elif 'M26' in data:
if self._sdCardReady:
pos = int(re.search("S([0-9]+)", data).group(1))
self._setSdPos(pos)
elif 'M27' in data:
if self._sdCardReady:
self._reportSdStatus()
elif 'M28' in data:
if self._sdCardReady:
filename = data.split(None, 1)[1].strip()
self._writeSdFile(filename)
elif 'M29' in data:
if self._sdCardReady:
self._finishSdFile()
elif 'M30' in data:
if self._sdCardReady:
filename = data.split(None, 1)[1].strip()
self._deleteSdFile(filename)
elif "M114" in data:
# send dummy position report
self.outgoing.put("ok C: X:10.00 Y:3.20 Z:5.20 E:1.24")
continue
elif "M117" in data:
# we'll just use this to echo a message, to allow playing around with pause triggers
self.outgoing.put("echo:%s" % re.search("M117\s+(.*)", data).group(1))
elif "M999" in data:
# mirror Marlin behaviour
self.outgoing.put("Resend: 1")
elif data.startswith("T"):
self.currentExtruder = int(re.search("T(\d+)", data).group(1))
self.outgoing.put("Active Extruder: %d" % self.currentExtruder)
elif "G20" in data:
self._unitModifier = 1.0 / 2.54
if self._lastX is not None:
self._lastX *= 2.54
if self._lastY is not None:
self._lastY *= 2.54
if self._lastZ is not None:
self._lastZ *= 2.54
if self._lastE is not None:
self._lastE *= 2.54
elif "G21" in data:
self._unitModifier = 1.0
if self._lastX is not None:
self._lastX /= 2.54
if self._lastY is not None:
self._lastY /= 2.54
if self._lastZ is not None:
self._lastZ /= 2.54
if self._lastE is not None:
self._lastE /= 2.54
elif "G90" in data:
self._relative = False
elif "G91" in data:
self._relative = True
elif "G92" in data:
self._setPosition(data)
elif data.startswith("!!DEBUG:"):
self._debugTrigger(data[len("!!DEBUG:"):].strip())
elif data.startswith("G0") or data.startswith("G1") or data.startswith("G2") or data.startswith("G3") \
or data.startswith("G28") or data.startswith("G29") or data.startswith("G30") \
or data.startswith("G31") or data.startswith("G32"):
# simulate reprap buffered commands via a Queue with maxsize which internally simulates the moves
self.buffered.put(data)
if len(data.strip()) > 0:
self._sendOk()
def _debugTrigger(self, data):
if data == "action_pause":
self.outgoing.put("// action:pause")
elif data == "action_resume":
self.outgoing.put("// action:resume")
elif data == "action_disconnect":
self.outgoing.put("// action:disconnect")
def _listSd(self):
self.readList.append("Begin file list")
self.outgoing.put("Begin file list")
if settings().getBoolean(["devel", "virtualPrinter", "extendedSdFileList"]):
self.readList.extend(
map(
lambda x: "%s %d" % (x.upper(), os.stat(os.path.join(self._virtualSd, x)).st_size),
os.listdir(self._virtualSd)
)
items = map(
lambda x: "%s %d" % (x.upper(), os.stat(os.path.join(self._virtualSd, x)).st_size),
os.listdir(self._virtualSd)
)
else:
self.readList.extend(
map(
lambda x: x.upper(),
os.listdir(self._virtualSd)
)
items = map(
lambda x: x.upper(),
os.listdir(self._virtualSd)
)
self.readList.append("End file list")
self._sendOk()
for item in items:
self.outgoing.put(item)
self.outgoing.put("End file list")
def _selectSdFile(self, filename):
file = os.path.join(self._virtualSd, filename).lower()
if not os.path.exists(file) or not os.path.isfile(file):
self.readList.append("open failed, File: %s." % filename)
self.outgoing.put("open failed, File: %s." % filename)
else:
self._selectedSdFile = file
self._selectedSdFileSize = os.stat(file).st_size
self.readList.append("File opened: %s Size: %d" % (filename, self._selectedSdFileSize))
self.readList.append("File selected")
self.outgoing.put("File opened: %s Size: %d" % (filename, self._selectedSdFileSize))
self.outgoing.put("File selected")
def _startSdPrint(self):
if self._selectedSdFile is not None:
@@ -188,20 +279,18 @@ class VirtualPrinter():
self._sdPrinter = threading.Thread(target=self._sdPrintingWorker)
self._sdPrinter.start()
self._sdPrintingSemaphore.set()
self._sendOk()
def _pauseSdPrint(self):
self._sdPrintingSemaphore.clear()
self._sendOk()
def _setSdPos(self, pos):
self._newSdFilePos = pos
def _reportSdStatus(self):
if self._sdPrinter is not None and self._sdPrintingSemaphore.is_set:
self.readList.append("SD printing byte %d/%d" % (self._selectedSdFilePos, self._selectedSdFileSize))
self.outgoing.put("SD printing byte %d/%d" % (self._selectedSdFilePos, self._selectedSdFileSize))
else:
self.readList.append("Not SD printing")
self.outgoing.put("Not SD printing")
def _processTemperatureQuery(self):
includeTarget = not settings().getBoolean(["devel", "virtualPrinter", "repetierStyleTargetTemperature"])
@@ -224,16 +313,16 @@ class VirtualPrinter():
if settings().getBoolean(["devel", "virtualPrinter", "includeCurrentToolInTemps"]):
if includeTarget:
self.readList.append("ok T:%.2f /%.2f %s @:64\n" % (self.temp[self.currentExtruder], self.targetTemp[self.currentExtruder] + 1, allTempsString))
self.outgoing.put("ok T:%.2f /%.2f %s @:64\n" % (self.temp[self.currentExtruder], self.targetTemp[self.currentExtruder] + 1, allTempsString))
else:
self.readList.append("ok T:%.2f %s @:64\n" % (self.temp[self.currentExtruder], allTempsString))
self.outgoing.put("ok T:%.2f %s @:64\n" % (self.temp[self.currentExtruder], allTempsString))
else:
self.readList.append("ok %s @:64\n" % allTempsString)
self.outgoing.put("ok %s @:64\n" % allTempsString)
else:
if includeTarget:
self.readList.append("ok T:%.2f /%.2f B:%.2f /%.2f @:64\n" % (self.temp[0], self.targetTemp[0], self.bedTemp, self.bedTargetTemp))
self.outgoing.put("ok T:%.2f /%.2f B:%.2f /%.2f @:64\n" % (self.temp[0], self.targetTemp[0], self.bedTemp, self.bedTargetTemp))
else:
self.readList.append("ok T:%.2f B:%.2f @:64\n" % (self.temp[0], self.bedTemp))
self.outgoing.put("ok T:%.2f B:%.2f @:64\n" % (self.temp[0], self.bedTemp))
def _parseHotendCommand(self, line):
tool = 0
@@ -254,14 +343,10 @@ class VirtualPrinter():
pass
if "M109" in line:
self._heatupThread = threading.Thread(target=self._waitForHeatup, args=["tool%d" % tool])
self._heatupThread.start()
return
self._sendOk()
self._waitForHeatup("tool%d" % tool)
if settings().getBoolean(["devel", "virtualPrinter", "repetierStyleTargetTemperature"]):
self.readList.append("TargetExtr%d:%d" % (tool, self.targetTemp[tool]))
self.outgoing.put("TargetExtr%d:%d" % (tool, self.targetTemp[tool]))
self._sendOk()
def _parseBedCommand(self, line):
try:
@@ -270,14 +355,98 @@ class VirtualPrinter():
pass
if "M190" in line:
self._heatupThread = threading.Thread(target=self._waitForHeatup, args=["bed"])
self._heatupThread.start()
return
self._waitForHeatup("bed")
if settings().getBoolean(["devel", "virtualPrinter", "repetierStyleTargetTemperature"]):
self.outgoing.put("TargetBed:%d" % self.bedTargetTemp)
self._sendOk()
if settings().getBoolean(["devel", "virtualPrinter", "repetierStyleTargetTemperature"]):
self.readList.append("TargetBed:%d" % self.bedTargetTemp)
def _performMove(self, line):
matchX = re.search("X([0-9.]+)", line)
matchY = re.search("Y([0-9.]+)", line)
matchZ = re.search("Z([0-9.]+)", line)
matchE = re.search("E([0-9.]+)", line)
duration = 0
if matchX is not None:
try:
x = float(matchX.group(1))
if self._relative or self._lastX is None:
duration = max(duration, x * self._unitModifier / float(self.speeds["x"]) * 60.0)
else:
duration = max(duration, (x - self._lastX) * self._unitModifier / float(self.speeds["x"]) * 60.0)
self._lastX = x
except:
pass
if matchY is not None:
try:
y = float(matchY.group(1))
if self._relative or self._lastY is None:
duration = max(duration, y * self._unitModifier / float(self.speeds["y"]) * 60.0)
else:
duration = max(duration, (y - self._lastY) * self._unitModifier / float(self.speeds["y"]) * 60.0)
self._lastY = y
except:
pass
if matchZ is not None:
try:
z = float(matchZ.group(1))
if self._relative or self._lastZ is None:
duration = max(duration, z * self._unitModifier / float(self.speeds["z"]) * 60.0)
else:
duration = max(duration, (z - self._lastZ) * self._unitModifier / float(self.speeds["z"]) * 60.0)
self._lastZ = z
except:
pass
if matchE is not None:
try:
e = float(matchE.group(1))
if self._relative or self._lastE is None:
duration = max(duration, e * self._unitModifier / float(self.speeds["e"]) * 60.0)
else:
duration = max(duration, (e - self._lastE) * self._unitModifier / float(self.speeds["e"]) * 60.0)
self._lastE = e
except:
pass
if duration:
if settings().getBoolean(["devel", "virtualPrinter", "waitOnLongMoves"]):
slept = 0
while duration - slept > self._read_timeout:
time.sleep(self._read_timeout)
self.outgoing.put("wait")
slept += self._read_timeout
else:
time.sleep(duration)
def _setPosition(self, line):
matchX = re.search("X([0-9.]+)", line)
matchY = re.search("Y([0-9.]+)", line)
matchZ = re.search("Z([0-9.]+)", line)
matchE = re.search("E([0-9.]+)", line)
if matchX is None and matchY is None and matchZ is None and matchE is None:
self._lastX = self._lastY = self._lastZ = self._lastE = 0
else:
if matchX is not None:
try:
self._lastX = float(matchX.group(1))
except:
pass
if matchY is not None:
try:
self._lastY = float(matchY.group(1))
except:
pass
if matchZ is not None:
try:
self._lastZ = float(matchZ.group(1))
except:
pass
if matchE is not None:
try:
self._lastE = float(matchE.group(1))
except:
pass
def _writeSdFile(self, filename):
file = os.path.join(self._virtualSd, filename).lower()
@@ -285,17 +454,15 @@ class VirtualPrinter():
if os.path.isfile(file):
os.remove(file)
else:
self.readList.append("error writing to file")
self.outgoing.put("error writing to file")
self._writingToSd = True
self._selectedSdFile = file
self.readList.append("Writing to file: %s" % filename)
self._sendOk()
self.outgoing.put("Writing to file: %s" % filename)
def _finishSdFile(self):
self._writingToSd = False
self._selectedSdFile = None
self._sendOk()
def _sdPrintingWorker(self):
self._selectedSdFilePos = 0
@@ -318,47 +485,45 @@ class VirtualPrinter():
if 'M140' in line or 'M190' in line:
self._parseBedCommand(line)
time.sleep(0.01)
time.sleep(settings().getFloat(["devel", "virtualPrinter", "throttle"]))
self._sdPrintingSemaphore.clear()
self._selectedSdFilePos = 0
self._sdPrinter = None
self.readList.append("Done printing file")
self.outgoing.put("Done printing file")
def _waitForHeatup(self, heater):
delta = 0.5
delta = 1
delay = 1
if heater.startswith("tool"):
toolNum = int(heater[len("tool"):])
while self.temp[toolNum] < self.targetTemp[toolNum] - delta or self.temp[toolNum] > self.targetTemp[toolNum] + delta:
self._simulateTemps()
self.readList.append("T:%0.2f /%0.2f" % (self.temp[toolNum], self.targetTemp[toolNum]))
self._simulateTemps(delta=delta)
self.outgoing.put("T:%0.2f" % self.temp[toolNum])
time.sleep(delay)
elif heater == "bed":
while self.bedTemp < self.bedTargetTemp - delta or self.bedTemp > self.bedTargetTemp + delta:
self._simulateTemps()
self.readList.append("B:%0.2f /%0.2f" % (self.bedTemp, self.bedTargetTemp))
self._simulateTemps(delta=delta)
self.outgoing.put("B:%0.2f" % self.bedTemp)
time.sleep(delay)
self.readList.append("ok")
def _deleteSdFile(self, filename):
f = os.path.join(self._virtualSd, filename)
if os.path.exists(f) and os.path.isfile(f):
os.remove(f)
self._sendOk()
def _simulateTemps(self):
def _simulateTemps(self, delta=1):
timeDiff = self.lastTempAt - time.time()
self.lastTempAt = time.time()
for i in range(len(self.temp)):
if abs(self.temp[i] - self.targetTemp[i]) > 1:
if abs(self.temp[i] - self.targetTemp[i]) > delta:
oldVal = self.temp[i]
self.temp[i] += math.copysign(timeDiff * 10, self.targetTemp[i] - self.temp[i])
if math.copysign(1, self.targetTemp[i] - oldVal) != math.copysign(1, self.targetTemp[i] - self.temp[i]):
self.temp[i] = self.targetTemp[i]
if self.temp[i] < 0:
self.temp[i] = 0
if abs(self.bedTemp - self.bedTargetTemp) > 1:
if abs(self.bedTemp - self.bedTargetTemp) > delta:
oldVal = self.bedTemp
self.bedTemp += math.copysign(timeDiff * 10, self.bedTargetTemp - self.bedTemp)
if math.copysign(1, self.bedTargetTemp - oldVal) != math.copysign(1, self.bedTargetTemp - self.bedTemp):
@@ -366,34 +531,98 @@ class VirtualPrinter():
if self.bedTemp < 0:
self.bedTemp = 0
def _processBuffer(self):
while self.buffered is not None:
try:
line = self.buffered.get(timeout=0.5)
except Queue.Empty:
continue
if line is None:
continue
self._performMove(line)
def write(self, data):
with self._incoming_lock:
if self.incoming is None or self.outgoing is None:
return
try:
self.incoming.put(data, timeout=self._write_timeout)
except Queue.Full:
raise SerialTimeoutException()
def readline(self):
if self.readList is None:
return ''
n = 0
self._simulateTemps()
while len(self.readList) < 1:
time.sleep(0.1)
n += 1
if n == 20:
return ''
if self.readList is None:
return ''
time.sleep(0.001)
return self.readList.pop(0)
try:
line = self.outgoing.get(timeout=self._read_timeout)
time.sleep(settings().getFloat(["devel", "virtualPrinter", "throttle"]))
return line
except Queue.Empty:
return ""
def close(self):
self.readList = None
self.incoming = None
self.outgoing = None
self.buffered = None
def _sendOk(self):
if settings().getBoolean(["devel", "virtualPrinter", "okWithLinenumber"]):
self.readList.append("ok %d" % self.lastN)
self.outgoing.put("ok %d" % self.lastN)
else:
self.readList.append("ok")
self.outgoing.put("ok")
def _sendWaitAfterTimeout(self, timeout=5):
time.sleep(timeout)
if self.readList is not None:
self.readList.append("wait")
if self.outgoing is not None:
self.outgoing.put("wait")
class CharCountingQueue(Queue.Queue):
def __init__(self, maxsize, name=None):
Queue.Queue.__init__(self, maxsize=maxsize)
self._size = 0
self._name = name
def put(self, item, block=True, timeout=None):
self.not_full.acquire()
try:
item_size = self._len(item)
if not block:
if self._qsize() + item_size >= self.maxsize:
raise Queue.Full
elif timeout is None:
while self._qsize() + item_size >= self.maxsize:
self.not_full.wait()
elif timeout < 0:
raise ValueError("'timeout' must be a positive number")
else:
endtime = time.time() + timeout
while self._qsize() + item_size >= self.maxsize:
remaining = endtime - time.time()
if remaining <= 0.0:
raise Queue.Full
self.not_full.wait(remaining)
self._put(item)
self.unfinished_tasks += 1
self.not_empty.notify()
finally:
self.not_full.release()
def _len(self, item):
return len(item)
def _qsize(self, len=len):
return self._size
# Put a new item in the queue
def _put(self, item):
self.queue.append(item)
self._size += self._len(item)
# Get an item from the queue
def _get(self):
item = self.queue.popleft()
self._size -= self._len(item)
return item
+74
View File
@@ -0,0 +1,74 @@
# coding=utf-8
from __future__ import absolute_import
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
import unittest
from ddt import ddt, data, unpack
import octoprint.printer
@ddt
class EstimationTestCase(unittest.TestCase):
def setUp(self):
self.estimation_helper = type(octoprint.printer.TimeEstimationHelper)(octoprint.printer.TimeEstimationHelper.__name__, (octoprint.printer.TimeEstimationHelper,), {
'STABLE_THRESHOLD': 0.1,
'STABLE_ROLLING_WINDOW': 3,
'STABLE_COUNTDOWN': 1
})()
@data(
((1.0, 2.0, 3.0, 4.0, 5.0), 3.0),
((1.0, 2.0, 0.0, 1.0, 2.0), 1.2),
((1.0, -2.0, -1.0, -2.0, 3.0), -0.2)
)
@unpack
def test_average_total(self, estimates, expected):
for estimate in estimates:
self.estimation_helper.update(estimate)
self.assertEquals(self.estimation_helper.average_total, expected)
@data(
((1.0, 2.0), None), # not enough values, have 1, need 3
((1.0, 2.0, 3.0), None), # not enough values, have 2, need 3
((1.0, 2.0, 3.0, 4.0), 0.5), # average totals: 1.0, 1.5, 2.0, 2.5 => (3 * 0.5 / 3 = 0.5
((1.0, 2.0, 3.0, 4.0, 5.0), 0.5), # average totals: 1.0, 1.5, 2.0, 2.5, 3.0 => (0.5 + 0.5 + 0.5) / 3 = 0.5
((1.0, 2.0, 0.0, 1.0, 2.0), 0.7 / 3) # average totals: 1.0, 1.5, 1.0, 1.0, 1.2 => (0.5 + 0.0 + 0.2) / 3 = 0.7 / 3
)
@unpack
def test_average_distance(self, estimates, expected):
for estimate in estimates:
self.estimation_helper.update(estimate)
self.assertEquals(self.estimation_helper.average_distance, expected)
@data(
((1.0, 1.0), None),
((1.0, 1.0, 1.0), 1.0),
((1.0, 2.0, 3.0, 4.0, 5.0), 4.0),
)
@unpack
def test_average_total_rolling(self, estimates, expected):
for estimate in estimates:
self.estimation_helper.update(estimate)
self.assertEquals(self.estimation_helper.average_total_rolling, expected)
@data(
((1.0, 1.0, 1.0, 1.0), False), # average totals: 1.0, 1.0, 1.0, 1.0 => 3.0 / 3 = 1.0
((1.0, 1.0, 1.0, 1.0, 1.0), True), # average totals: 1.0, 1.0, 1.0, 1.0, 1.0 => 0.0 / 3 = 0.0
((1.0, 2.0, 3.0, 4.0, 5.0), False), # average totals: 1.0, 1.5, 2.0, 2.5, 3.0 => 1.5 / 3 = 0.5
((0.0, 0.09, 0.18, 0.27, 0.36), True) # average totals: 0.0, 0.045, 0.09, 0.135, 0.18 => (0.045 + 0.045 + 0.045) / 3 = 0.045
)
@unpack
def test_is_stable(self, estimates, expected):
for estimate in estimates:
self.estimation_helper.update(estimate)
self.assertEquals(self.estimation_helper.is_stable(), expected)