Add flag to disable model size detection & check

Also marked feature as beta
This commit is contained in:
Gina Häußge 2016-06-28 14:47:17 +02:00
parent 7207421051
commit c4a0b63a87
5 changed files with 25 additions and 3 deletions

View file

@ -73,7 +73,8 @@ def getSettings():
"externalHeatupDetection": s.getBoolean(["feature", "externalHeatupDetection"]),
"keyboardControl": s.getBoolean(["feature", "keyboardControl"]),
"pollWatched": s.getBoolean(["feature", "pollWatched"]),
"ignoreIdenticalResends": s.getBoolean(["feature", "ignoreIdenticalResends"])
"ignoreIdenticalResends": s.getBoolean(["feature", "ignoreIdenticalResends"]),
"modelSizeDetection": s.getBoolean(["feature", "modelSizeDetection"])
},
"serial": {
"port": connectionOptions["portPreference"],
@ -235,6 +236,7 @@ def _saveSettings(data):
if "keyboardControl" in data["feature"].keys(): s.setBoolean(["feature", "keyboardControl"], data["feature"]["keyboardControl"])
if "pollWatched" in data["feature"]: s.setBoolean(["feature", "pollWatched"], data["feature"]["pollWatched"])
if "ignoreIdenticalResends" in data["feature"]: s.setBoolean(["feature", "ignoreIdenticalResends"], data["feature"]["ignoreIdenticalResends"])
if "modelSizeDetection" in data["feature"]: s.setBoolean(["feature", "modelSizeDetection"], data["feature"]["modelSizeDetection"])
if "serial" in data.keys():
if "autoconnect" in data["serial"].keys(): s.setBoolean(["serial", "autoconnect"], data["serial"]["autoconnect"])

View file

@ -181,7 +181,8 @@ default_settings = {
"pollWatched": False,
"ignoreIdenticalResends": False,
"identicalResendsCountdown": 7,
"supportFAsCommand": False
"supportFAsCommand": False,
"modelSizeDetection": True
},
"folder": {
"uploads": None,

View file

@ -447,6 +447,15 @@ $(function() {
};
self.evaluatePrintDimensions = function(data, notify) {
if (!self.settingsViewModel.feature_modelSizeDetection()) {
return true;
}
var analysis = data["gcodeAnalysis"];
if (!analysis) {
return true;
}
var printingArea = data["gcodeAnalysis"]["printingArea"];
if (!printingArea) {
return true;
@ -507,6 +516,8 @@ $(function() {
warning += pnotifyAdditionalInfo(info);
warning += "<p><small>You can disable this check via Settings &gt; Features &gt; \"Enable model size detection [...]\"</small></p>";
new PNotify({
title: gettext("Object doesn't fit print volume"),
text: warning,

View file

@ -131,6 +131,7 @@ $(function() {
self.feature_keyboardControl = ko.observable(undefined);
self.feature_pollWatched = ko.observable(undefined);
self.feature_ignoreIdenticalResends = ko.observable(undefined);
self.feature_modelSizeDetection = ko.observable(undefined);
self.serial_port = ko.observable();
self.serial_baudrate = ko.observable();

View file

@ -8,7 +8,14 @@
</div>
<div class="control-group">
<div class="controls">
<label class="checkbox">
<label class="checkbox">
<input type="checkbox" data-bind="checked: feature_modelSizeDetection" id="settings-modelSizeDetection"> {{ _('Enable model size detection and warn if model exceeds print bed') }} <span class="label label-info">{{ _('Beta') }}</span>
</label>
</div>
</div>
<div class="control-group">
<div class="controls">
<label class="checkbox">
<input type="checkbox" data-bind="checked: feature_sdSupport" id="settings-featureSdSupport"> {{ _('Enable SD support') }}
</label>
</div>