Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
458ab91f91 | ||
|
|
ab8ad72bc3 | ||
|
|
57b085ff5c | ||
|
|
0cfc08748b | ||
|
|
0188745d05 | ||
|
|
5246e2ccb4 | ||
|
|
f1d4cb670a | ||
|
|
9dd1e95eae | ||
|
|
6083943e03 | ||
|
|
a8ba43308e | ||
|
|
4511d8667b | ||
|
|
af3a63fd9b | ||
|
|
93e54f57e0 |
No files matched your search
+5
-5
@@ -24,13 +24,13 @@ maintenance 1.4.1 2da7aa358d950b4567aaab8f18d6b5779193e077 pep440-dev
|
||||
fix/.* 1.4.1 2da7aa358d950b4567aaab8f18d6b5779193e077 pep440-dev
|
||||
improve/.* 1.4.1 2da7aa358d950b4567aaab8f18d6b5779193e077 pep440-dev
|
||||
|
||||
# staging/maintenance is currently the branch for preparation of 1.4.1rc3
|
||||
# staging/maintenance is currently the branch for preparation of 1.4.1rc4
|
||||
# so is regressionfix/...
|
||||
staging/maintenance 1.4.1rc3 650d54d1885409fa1d411eb54b9e8c7ff428910f pep440-dev
|
||||
regressionfix/.* 1.4.1rc3 650d54d1885409fa1d411eb54b9e8c7ff428910f pep440-dev
|
||||
staging/maintenance 1.4.1rc4 650d54d1885409fa1d411eb54b9e8c7ff428910f pep440-dev
|
||||
regressionfix/.* 1.4.1rc4 650d54d1885409fa1d411eb54b9e8c7ff428910f pep440-dev
|
||||
|
||||
# staging/devel is currently inactive (but has the 1.4.1rc3 namespace)
|
||||
staging/devel 1.4.1rc3 650d54d1885409fa1d411eb54b9e8c7ff428910f pep440-dev
|
||||
# staging/devel is currently inactive (but has the 1.4.1rc4 namespace)
|
||||
staging/devel 1.4.1rc4 650d54d1885409fa1d411eb54b9e8c7ff428910f pep440-dev
|
||||
|
||||
# every other branch is a development branch and thus gets resolved to 1.5.0-dev for now
|
||||
.* 1.5.0 2da7aa358d950b4567aaab8f18d6b5779193e077 pep440-dev
|
||||
+1
-2
@@ -17,7 +17,6 @@ thanks to everyone who contributed!
|
||||
* D Brian Kimmel
|
||||
* DeltaMaker 3D Printers
|
||||
* Dennis Breining
|
||||
* Dorian Gray
|
||||
* Eric Betts
|
||||
* Ernesto Martinez
|
||||
* Franziska Kunsmann
|
||||
@@ -66,4 +65,4 @@ thanks to everyone who contributed!
|
||||
* Sven Mueller
|
||||
* Ulrich Kempken
|
||||
|
||||
and 1886 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel) or via [Github Sponsors](https://github.com/users/foosel/sponsorship)!
|
||||
and 1932 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel) or via [Github Sponsors](https://github.com/users/foosel/sponsorship)!
|
||||
@@ -13,8 +13,8 @@ from octoprint.util.version import get_octoprint_version_string, is_released_oct
|
||||
from flask import jsonify
|
||||
from flask_babel import gettext
|
||||
|
||||
SENTRY_URL_SERVER = "https://829e2245ec4d4693a0b708523004c4eb@o118517.ingest.sentry.io/1373987"
|
||||
SENTRY_URL_COREUI = "https://fcbbcf95f5514b59866c5e7360fba1fe@o118517.ingest.sentry.io/1374096"
|
||||
SENTRY_URL_SERVER = "https://912dd511a2274c6f99705d926c2b5126@o118517.ingest.sentry.io/1373987"
|
||||
SENTRY_URL_COREUI = "https://572ed52f42d241c484db1c741e3c131e@o118517.ingest.sentry.io/1374096"
|
||||
|
||||
SETTINGS_DEFAULTS = dict(enabled=False,
|
||||
enabled_unreleased=False,
|
||||
|
||||
@@ -268,7 +268,7 @@
|
||||
<small class="prop" data-bind="visible: $data.stats !== undefined" title="{{ _('Active instances past month')|edq }}"><i class="fa fa-server"></i> <span data-bind="text: $data.stats !== undefined ? formatNumberK($data.stats.instances_month) : 0"></span></small>
|
||||
<small class="prop" data-bind="visible: $data.github !== undefined && $data.github.stars !== undefined" title="{{ _('Github stars')|edq }}"><i class="fa fa-star"></i> <span data-bind="text: ($data.github !== undefined && $data.github.stars !== undefined) ? formatNumberK($data.github.stars) : 0"></span></small>
|
||||
<small class="prop" data-bind="visible: $data.github !== undefined && $data.github.last_push !== undefined" title="{{ _('Last push to main branch')|edq }}"><i class="fa fa-refresh"></i> <span data-bind="text: ($data.github !== undefined && $data.github.last_push !== undefined) ? $data.github.last_push.substring(0, 10) : ''"></span></small>
|
||||
<small class="prop" data-bind="visible: $data.github !== undefined && $data.github.latest_release != undefined" title="{{ _('Latest release & date')|edq }}"><i class="fa fa-tag"></i> <span data-bind="text: $data.github !== undefined && $data.github.latest_release !== undefined ? $data.github.latest_release.tag : ''"></span> (<span data-bind="text: $data.github !== undefined && $data.github.latest_release !== undefined ? $data.github.latest_release.date.substring(0, 10) : ''"></span>)</small>
|
||||
<small class="prop" data-bind="visible: $data.github !== undefined && $data.github.latest_release != undefined && $data.github.latest_release.tag && $data.github.latest_release.date" title="{{ _('Latest release & date')|edq }}"><i class="fa fa-tag"></i> <span data-bind="text: $data.github !== undefined && $data.github.latest_release !== undefined && $data.github.latest_release.tag ? $data.github.latest_release.tag : ''"></span> (<span data-bind="text: $data.github !== undefined && $data.github.latest_release !== undefined && $data.github.latest_release.date ? $data.github.latest_release.date.substring(0, 10) : ''"></span>)</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -267,6 +267,7 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
|
||||
logging.getLogger("SERIAL").info("serial.log is currently not enabled, you can enable it via Settings > Serial Connection > Log communication to serial.log")
|
||||
|
||||
self._comm = comm.MachineCom(port, baudrate, callbackObject=self, printerProfileManager=self._printerProfileManager)
|
||||
self._comm.start()
|
||||
|
||||
def disconnect(self, *args, **kwargs):
|
||||
"""
|
||||
@@ -1505,7 +1506,9 @@ class StateMonitor(object):
|
||||
self._last_update = monotonic_time()
|
||||
self._change_event.clear()
|
||||
except Exception:
|
||||
logging.getLogger(__name__).exception("Looks like something crashed inside the state update worker. Please report this on the OctoPrint issue tracker (make sure to include logs!)")
|
||||
logging.getLogger(__name__).exception("Looks like something crashed inside the state update worker. "
|
||||
"Please report this on the OctoPrint issue tracker (make sure "
|
||||
"to include logs!)")
|
||||
|
||||
def get_current_data(self):
|
||||
with self._progress_lock:
|
||||
|
||||
@@ -63,7 +63,12 @@ def _create_lastmodified(path, recursive):
|
||||
return max(lms)
|
||||
|
||||
else:
|
||||
storage, path_in_storage = path.split("/", 1)
|
||||
if "/" in path:
|
||||
storage, path_in_storage = path.split("/", 1)
|
||||
else:
|
||||
storage = path
|
||||
path_in_storage = None
|
||||
|
||||
try:
|
||||
return fileManager.last_modified(storage, path=path_in_storage, recursive=recursive)
|
||||
except Exception:
|
||||
|
||||
@@ -117,9 +117,12 @@ class PrinterStateConnection(octoprint.vendor.sockjs.tornado.SockJSConnection,
|
||||
self._remoteAddress = None
|
||||
self._user = self._userManager.anonymous_user_factory()
|
||||
|
||||
self._throttleFactor = 1
|
||||
self._lastCurrent = 0
|
||||
self._baseRateLimit = 0.5
|
||||
self._throttle_factor = 1
|
||||
self._last_current = 0
|
||||
self._base_rate_limit = 0.5
|
||||
|
||||
self._held_back_current = None
|
||||
self._held_back_mutex = threading.RLock()
|
||||
|
||||
self._register_hooks = self._pluginManager.get_hooks("octoprint.server.sockjs.register")
|
||||
self._authed_hooks = self._pluginManager.get_hooks("octoprint.server.sockjs.authed")
|
||||
@@ -222,18 +225,27 @@ class PrinterStateConnection(octoprint.vendor.sockjs.tornado.SockJSConnection,
|
||||
except ValueError:
|
||||
self._logger.warning("Got invalid throttle factor from client {}, ignoring: {!r}".format(self._remoteAddress, message["throttle"]))
|
||||
else:
|
||||
self._throttleFactor = throttle
|
||||
self._logger.debug("Set throttle factor for client {} to {}".format(self._remoteAddress, self._throttleFactor))
|
||||
self._throttle_factor = throttle
|
||||
self._logger.debug("Set throttle factor for client {} to {}".format(self._remoteAddress, self._throttle_factor))
|
||||
|
||||
def on_printer_send_current_data(self, data):
|
||||
if not self._user.has_permission(Permissions.STATUS):
|
||||
return
|
||||
|
||||
# make sure we rate limit the updates according to our throttle factor
|
||||
now = time.time()
|
||||
if now < self._lastCurrent + self._baseRateLimit * self._throttleFactor:
|
||||
return
|
||||
self._lastCurrent = now
|
||||
with self._held_back_mutex:
|
||||
if self._held_back_current is not None:
|
||||
self._held_back_current.cancel()
|
||||
self._held_back_current = None
|
||||
|
||||
now = time.time()
|
||||
delta = self._last_current + self._base_rate_limit * self._throttle_factor - now
|
||||
if delta > 0:
|
||||
self._held_back_current = threading.Timer(delta, lambda: self.on_printer_send_current_data(data))
|
||||
self._held_back_current.start()
|
||||
return
|
||||
|
||||
self._last_current = now
|
||||
|
||||
# add current temperature, log and message backlogs to sent data
|
||||
with self._temperatureBacklogMutex:
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<span class="search-clear" data-bind="click: clearSearchQuery"><i class="fa fa-remove"></i></span>
|
||||
</div>
|
||||
</form>
|
||||
<div class="gcode_files" data-bind="visible: $root.loginState.hasPermissionKo($root.access.permissions.FILES_LIST)">
|
||||
<div class="gcode_files" data-test-id="files-list" data-bind="visible: $root.loginState.hasPermissionKo($root.access.permissions.FILES_LIST)">
|
||||
<div class="entry back clickable" data-bind="visible: currentPath() != '', click: function() { $root.navigateUp(); }" style="display: none">
|
||||
<div class="back-arrow"><i class="fa fa-arrow-left"></i> {{ _('Back') }}</div>
|
||||
<div class="back-path"><small class="muted">{{ _('Currently in') }} <span data-bind="text: currentPath"></span></small></div>
|
||||
@@ -67,18 +67,18 @@
|
||||
<span class="btn btn-primary fileinput-button span6" style="margin-bottom: 10px">
|
||||
<i class="fa fa-upload"></i>
|
||||
<span>{{ _('Upload') }}</span>
|
||||
<input id="gcode_upload" accept="{{ ",".join(supportedExtensions) }}" type="file" name="file" class="fileinput-button">
|
||||
<input id="gcode_upload" data-test-id="upload-local" accept="{{ ",".join(supportedExtensions) }}" type="file" name="file" class="fileinput-button">
|
||||
</span>
|
||||
<span class="btn btn-primary fileinput-button span6" data-bind="enable: $root.isSdReady() && !$root.isPrinting(), css: {disabled: !$root.isSdReady() || $root.isPrinting()}" style="margin-bottom: 10px">
|
||||
<i class="fa fa-upload"></i>
|
||||
<span>{{ _('Upload to SD') }}</span>
|
||||
<input id="gcode_upload_sd" accept="{{ ",".join(supportedExtensions) }}" type="file" name="file" class="fileinput-button" data-bind="enable: isSdReady()">
|
||||
<input id="gcode_upload_sd" data-test-id="upload-sd" accept="{{ ",".join(supportedExtensions) }}" type="file" name="file" class="fileinput-button" data-bind="enable: isSdReady()">
|
||||
</span>
|
||||
{% else %}
|
||||
<span class="btn btn-primary fileinput-button span12" style="margin-bottom: 10px">
|
||||
<i class="icon-upload-alt icon-white"></i>
|
||||
<span>{{ _('Upload') }}</span>
|
||||
<input id="gcode_upload" accept="{{ ",".join(supportedExtensions) }}" type="file" name="file" class="fileinput-button">
|
||||
<input id="gcode_upload" data-test-id="upload-local" accept="{{ ",".join(supportedExtensions) }}" type="file" name="file" class="fileinput-button">
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
<button class="btn btn-block control-box" data-bind="enable: isOperational() && !isPrinting(), click: function() { $root.sendRetractCommand() }">{{ _('Retract') }}</button>
|
||||
|
||||
<!-- Flow rate -->
|
||||
<div id="control-jog-feedrate" class="jog-panel">
|
||||
<div id="control-jog-flowrate" class="jog-panel">
|
||||
<label>{{ _('Flow rate modifier:') }} <a class="text-info" href="javascript:void(0)" data-bind="popover: {placement: 'top', trigger: 'hover', title: '{{ _('Please note!') }}', content: '{{ _('The flow rate can only be set, it cannot be read back from the firmware due to a limitation of the communication protocol. There is no way to show the current setting.') }}'}"><i class="fa fa-info-circle"></i></a></label>
|
||||
<div class="input-append control-box">
|
||||
<input type="number" class="input-mini" min="1" step="1" data-bind="value: flowRate, event: { blur: resetFlowRateDisplay, focus: cancelFlowRateDisplayReset }, css: { pulsate_text_opacity: flowRateResetter() !== undefined }">
|
||||
|
||||
+38
-16
@@ -648,12 +648,17 @@ class MachineCom(object):
|
||||
self._monitoring_active = True
|
||||
self.monitoring_thread = threading.Thread(target=self._monitor, name="comm._monitor")
|
||||
self.monitoring_thread.daemon = True
|
||||
self.monitoring_thread.start()
|
||||
|
||||
# sending thread
|
||||
self._send_queue_active = True
|
||||
self.sending_thread = threading.Thread(target=self._send_loop, name="comm.sending_thread")
|
||||
self.sending_thread.daemon = True
|
||||
|
||||
def start(self):
|
||||
# doing this here instead of __init__ combats a race condition where
|
||||
# self._comm in the printer interface is still None on first pushs from
|
||||
# the comm layer during detection
|
||||
self.monitoring_thread.start()
|
||||
self.sending_thread.start()
|
||||
|
||||
def __del__(self):
|
||||
@@ -959,7 +964,7 @@ class MachineCom(object):
|
||||
self._send_queue_active = False
|
||||
|
||||
if self._serial is not None:
|
||||
if not is_error:
|
||||
if not is_error and self._state in self.OPERATIONAL_STATES:
|
||||
self.sendGcodeScript("beforePrinterDisconnected")
|
||||
if wait:
|
||||
if timeout is not None:
|
||||
@@ -990,15 +995,17 @@ class MachineCom(object):
|
||||
self._logger.exception("Error while trying to close serial port")
|
||||
is_error = True
|
||||
|
||||
# if we are printing, this will also make sure of firing PRINT_FAILED
|
||||
if is_error:
|
||||
self._changeState(self.STATE_CLOSED_WITH_ERROR)
|
||||
else:
|
||||
self._changeState(self.STATE_CLOSED)
|
||||
else:
|
||||
deactivate_monitoring_and_send_queue()
|
||||
|
||||
self._serial = None
|
||||
|
||||
# if we are printing, this will also make sure of firing PRINT_FAILED
|
||||
if is_error:
|
||||
self._changeState(self.STATE_CLOSED_WITH_ERROR)
|
||||
else:
|
||||
self._changeState(self.STATE_CLOSED)
|
||||
|
||||
if settings().getBoolean(["feature", "sdSupport"]):
|
||||
self._sdFileList = []
|
||||
|
||||
@@ -1677,6 +1684,10 @@ class MachineCom(object):
|
||||
self._changeState(self.STATE_DETECT_SERIAL)
|
||||
self._perform_detection_step(init=True)
|
||||
|
||||
if not self._state in (self.STATE_CONNECTING, self.STATE_DETECT_SERIAL):
|
||||
# we got cancelled during connection, bail
|
||||
return
|
||||
|
||||
# Start monitoring the serial port
|
||||
self._log("Connected to: %s, starting monitor" % self._serial)
|
||||
|
||||
@@ -2403,19 +2414,30 @@ class MachineCom(object):
|
||||
self._detection_candidates))))
|
||||
|
||||
def attempt_handshake():
|
||||
timeout = self._get_communication_timeout_interval()
|
||||
if self._serial.timeout != timeout:
|
||||
self._serial.timeout = timeout
|
||||
self._timeout = self._ok_timeout = monotonic_time() + timeout
|
||||
|
||||
log("Handshake attempt #{} with timeout {}s".format(self._detection_retry + 1, timeout))
|
||||
|
||||
self._detection_retry += 1
|
||||
self._do_send_without_checksum(b"", log=False) # new line to reset things
|
||||
self.sayHello(tags={"trigger:detection", })
|
||||
timeout = self._get_communication_timeout_interval()
|
||||
|
||||
log("Handshake attempt #{} with timeout {}s".format(self._detection_retry, timeout))
|
||||
try:
|
||||
if self._serial.timeout != timeout:
|
||||
self._serial.timeout = timeout
|
||||
self._timeout = self._ok_timeout = monotonic_time() + timeout
|
||||
except Exception:
|
||||
self._log("Unexpected error while setting timeout {}: {}".format(timeout, get_exception_string()))
|
||||
self._logger.exception("Unexpected error while setting timeout {}".format(timeout))
|
||||
else:
|
||||
self._do_send_without_checksum(b"", log=False) # new line to reset things
|
||||
self.sayHello(tags={"trigger:detection", })
|
||||
|
||||
while len(self._detection_candidates) > 0 or self._detection_retry < self.DETECTION_RETRIES:
|
||||
if self._state not in (self.STATE_DETECT_SERIAL,):
|
||||
return
|
||||
|
||||
if self._detection_retry < self.DETECTION_RETRIES:
|
||||
if self._serial is None:
|
||||
self._detection_retry = self.DETECTION_RETRIES
|
||||
continue
|
||||
|
||||
attempt_handshake()
|
||||
return
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
M117 I'm just a test upload during E2E
|
||||
G28 X0 Y0
|
||||
M117 That is all folks!
|
||||
@@ -0,0 +1,24 @@
|
||||
import { prepare_server, login, await_coreui } from "../util/util"
|
||||
|
||||
context('Upload tests', () => {
|
||||
const username = 'admin';
|
||||
const password = 'test';
|
||||
|
||||
beforeEach(() => {
|
||||
prepare_server();
|
||||
|
||||
// login
|
||||
login(username, password);
|
||||
|
||||
cy.visit('/');
|
||||
await_coreui();
|
||||
});
|
||||
|
||||
it("uploads file to local via button", () => {
|
||||
cy.get('[data-test-id=upload-local]')
|
||||
.attachFile("e2e-test.gcode");
|
||||
cy.wait("@files");
|
||||
cy.get('[data-test-id=files-list]')
|
||||
.contains("e2e-test.gcode");
|
||||
});
|
||||
});
|
||||
Generated
+13
@@ -428,6 +428,14 @@
|
||||
"resolved": "https://registry.npmjs.org/cypress-commands/-/cypress-commands-1.1.0.tgz",
|
||||
"integrity": "sha512-Q8Jr25pHJQFXwln6Hp8O+Hgs8Z506Y2wA9F1Te2cTajjc5L9gtt9WPOcw1Ogh+OgyqaMHF+uq31vdfImRTio5Q=="
|
||||
},
|
||||
"cypress-file-upload": {
|
||||
"version": "4.0.7",
|
||||
"resolved": "https://registry.npmjs.org/cypress-file-upload/-/cypress-file-upload-4.0.7.tgz",
|
||||
"integrity": "sha512-rFFmnoZ2bWyWFpSV09AhkSUgYEiVy70pcQ6nf/mGTMTrVHvKCCCIfRu3TbgVYHbgBq+0hqjfjQrtz4IbgH7qZA==",
|
||||
"requires": {
|
||||
"mime": "2.4.6"
|
||||
}
|
||||
},
|
||||
"cypress-plugin-retries": {
|
||||
"version": "1.5.2",
|
||||
"resolved": "https://registry.npmjs.org/cypress-plugin-retries/-/cypress-plugin-retries-1.5.2.tgz",
|
||||
@@ -1083,6 +1091,11 @@
|
||||
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
|
||||
"integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4="
|
||||
},
|
||||
"mime": {
|
||||
"version": "2.4.6",
|
||||
"resolved": "https://registry.npmjs.org/mime/-/mime-2.4.6.tgz",
|
||||
"integrity": "sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA=="
|
||||
},
|
||||
"mime-db": {
|
||||
"version": "1.44.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz",
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
"dependencies": {
|
||||
"cypress": "^4.9.0",
|
||||
"cypress-commands": "^1.1.0",
|
||||
"cypress-file-upload": "^4.0.7",
|
||||
"cypress-plugin-retries": "^1.5.2",
|
||||
"cypress-terminal-report": "^1.4.1",
|
||||
"cypress-wait-until": "^1.7.1"
|
||||
|
||||
@@ -1,27 +1,2 @@
|
||||
// ***********************************************
|
||||
// This example commands.js shows you how to
|
||||
// create various custom commands and overwrite
|
||||
// existing commands.
|
||||
//
|
||||
// For more comprehensive examples of custom
|
||||
// commands please read more here:
|
||||
// https://on.cypress.io/custom-commands
|
||||
// ***********************************************
|
||||
//
|
||||
//
|
||||
// -- This is a parent command --
|
||||
// Cypress.Commands.add("login", (email, password) => { ... })
|
||||
//
|
||||
//
|
||||
// -- This is a child command --
|
||||
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
|
||||
//
|
||||
//
|
||||
// -- This is a dual command --
|
||||
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
|
||||
//
|
||||
//
|
||||
// -- This will overwrite an existing command --
|
||||
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
|
||||
|
||||
import 'cypress-wait-until';
|
||||
import 'cypress-file-upload';
|
||||
Reference in new issue
Block a user