Skip to content
Permalink
Browse files

Bed Dimensions in Printer Settings

  • Loading branch information...
Salandora Salandora
Salandora authored and Salandora committed Feb 28, 2014
1 parent 7231acc commit feba135cacb8000981d823ef6d4952dcbd89166e
Showing with 32 additions and 3 deletions.
  1. +14 −3 src/octoprint/static/js/app/viewmodels/settings.js
  2. +18 −0 src/octoprint/templates/settings.jinja2
@@ -13,14 +13,21 @@ function SettingsViewModel(loginStateViewModel, usersViewModel) {
/* I did attempt to allow arbitrary gradients but cross browser support via knockout or jquery was going to be horrible */
self.appearance_available_colors = ko.observable(["default", "red", "orange", "yellow", "green", "blue", "violet", "black"]);

self.printer_bedX = ko.observable(undefined);
self.printer_bedY = ko.observable(undefined);
self.printer_movementSpeedX = ko.observable(undefined);
self.printer_movementSpeedY = ko.observable(undefined);
self.printer_movementSpeedZ = ko.observable(undefined);
self.printer_movementSpeedE = ko.observable(undefined);
self.printer_invertAxes = ko.observable(undefined);
self.printer_numExtruders = ko.observable(undefined);
self.printer_extruderOffsets = ko.observableArray([]);
self.printer_bedDimensions = ko.observable(undefined);

This comment has been minimized.

This comment has been minimized.

Copy link
@Salandora

Salandora Mar 1, 2014

Owner

I know this is why the

self.printer_bedDimensions = ko.dependentObservable(function () { ... });

is there :-)

This comment has been minimized.

Copy link
@foosel

foosel via email Mar 1, 2014

self.printer_bedDimensionX = ko.observable(undefined);
self.printer_bedDimensionY = ko.observable(undefined);

self.printer_bedDimensions = ko.dependentObservable(function () {
return { "x": self.printer_bedDimensionX(), "y": self.printer_bedDimensionY() };
});

self.webcam_streamUrl = ko.observable(undefined);
self.webcam_snapshotUrl = ko.observable(undefined);
@@ -129,7 +136,8 @@ function SettingsViewModel(loginStateViewModel, usersViewModel) {
self.printer_invertAxes(response.printer.invertAxes);
self.printer_numExtruders(response.printer.numExtruders);
self.printer_extruderOffsets(response.printer.extruderOffsets);
self.printer_bedDimensions(response.printer.bedDimensions);
self.printer_bedDimensionX(response.printer.bedDimensions.x);
self.printer_bedDimensionY(response.printer.bedDimensions.y);

self.webcam_streamUrl(response.webcam.streamUrl);
self.webcam_snapshotUrl(response.webcam.snapshotUrl);
@@ -190,7 +198,10 @@ function SettingsViewModel(loginStateViewModel, usersViewModel) {
"invertAxes": self.printer_invertAxes(),
"numExtruders": self.printer_numExtruders(),
"extruderOffsets": self.printer_extruderOffsets(),
"bedDimensions": self.printer_bedDimensions()
"bedDimensions": {
"x": self.printer_bedDimensionX(),
"y": self.printer_bedDimensionY()
}
},
"webcam": {
"streamUrl": self.webcam_streamUrl(),
@@ -82,6 +82,24 @@
</div>
<div class="tab-pane" id="settings_printerParameters">
<form class="form-horizontal">
<div class="control-group">
<label class="control-label" for="settings-movementSpeedX">Bed X</label>
<div class="controls">
<div class="input-append">
<input type="number" class="input-mini text-right" data-bind="value: printer_bedDimensionX" id="settings-bedX">
<span class="add-on">mm</span>
</div>
</div>
</div>
<div class="control-group">
<label class="control-label" for="settings-movementSpeedY">Bed Y</label>
<div class="controls">
<div class="input-append">
<input type="number" class="input-mini text-right" data-bind="value: printer_bedDimensionY" id="settings-bedY">
<span class="add-on">mm</span>
</div>
</div>
</div>
<div class="control-group">
<label class="control-label" for="settings-movementSpeedX">Movement Speed X Axis</label>
<div class="controls">

0 comments on commit feba135

Please sign in to comment.
You can’t perform that action at this time.