fixed z-axis setting
This commit is contained in:
parent
9e2abc3632
commit
05687b1699
5 changed files with 34 additions and 24 deletions
|
|
@ -199,9 +199,11 @@ class LaserCutterProfilesPlugin(octoprint.plugin.SettingsPlugin,
|
|||
##~~ TemplatePlugin API
|
||||
|
||||
def get_template_vars(self):
|
||||
return dict(
|
||||
_settings_menu_entry="Laser cutter profile"
|
||||
selectedProfile = laserCutterProfileManager.get_current_or_default()
|
||||
d = dict(
|
||||
settings_menu_entry="Laser cutter profiles",
|
||||
)
|
||||
return d
|
||||
|
||||
def get_template_folder(self):
|
||||
import os
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ $(function() {
|
|||
var self = this;
|
||||
|
||||
self.workingarea = params[0];
|
||||
self.control = params[1];
|
||||
|
||||
self._cleanProfile = function() {
|
||||
return {
|
||||
|
|
@ -89,7 +90,6 @@ $(function() {
|
|||
var defaultProfile = undefined;
|
||||
var currentProfile = undefined;
|
||||
var currentProfileData = undefined;
|
||||
console.log("lasercutterprofiles", data.profiles);
|
||||
_.each(data.profiles, function(entry) {
|
||||
if (entry.default) {
|
||||
defaultProfile = entry.id;
|
||||
|
|
@ -109,6 +109,8 @@ $(function() {
|
|||
|
||||
self.workingarea.workingAreaWidthMM(self.currentProfileData().volume.width());
|
||||
self.workingarea.workingAreaHeightMM(self.currentProfileData().volume.depth());
|
||||
// self.control.currentProfile(self.currentProfileData());
|
||||
// console.log("lasercutterprofiles from_response", self.control.currentProfile());
|
||||
};
|
||||
|
||||
self.addProfile = function(callback) {
|
||||
|
|
@ -142,8 +144,6 @@ $(function() {
|
|||
profile = self._editorData();
|
||||
}
|
||||
|
||||
console.log("updateProfile", profile);
|
||||
|
||||
$.ajax({
|
||||
url: BASEURL + "plugin/lasercutterprofiles/profiles/" + profile.id,
|
||||
type: "PATCH",
|
||||
|
|
@ -247,13 +247,18 @@ $(function() {
|
|||
self.onSettingsShown = self.requestData;
|
||||
self.onStartup = function(){
|
||||
self.requestData();
|
||||
self.control.showZAxis = ko.computed(function(){
|
||||
var has = self.currentProfileData()['zAxis']();
|
||||
return has;
|
||||
}); // dependency injection
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
// view model class, identifier, parameters for constructor, container to bind to
|
||||
ADDITIONAL_VIEWMODELS.push([LaserCutterProfilesViewModel, "laserCutterProfilesViewModel",
|
||||
["workingAreaViewModel"],
|
||||
["workingAreaViewModel", "controlViewModel"],
|
||||
document.getElementById("laserCutterProfiles")]);
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1150,6 +1150,11 @@ ul.dropdown-menu li a {
|
|||
display:inline-block;
|
||||
width: 80px;
|
||||
}
|
||||
#control_zaxis_focus {
|
||||
display:inline-block;
|
||||
width: 80px;
|
||||
margin: 12px 0;
|
||||
}
|
||||
#control_xyaxis {
|
||||
display:inline-block;
|
||||
margin: 1em auto 0;
|
||||
|
|
|
|||
|
|
@ -165,7 +165,6 @@ function WorkingAreaViewModel(params) {
|
|||
};
|
||||
|
||||
self.onStartup = function(){
|
||||
console.log("working_area_onstartup");
|
||||
self.files.workingArea = self;
|
||||
$(window).resize(function(){
|
||||
self.trigger_resize();
|
||||
|
|
|
|||
|
|
@ -119,14 +119,14 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="jog-panel" id="control_zaxis">
|
||||
{% if hasZAxis %}
|
||||
Z-Axis
|
||||
<div class="btn-group-vertical" role="group" aria-label="z-axis control">
|
||||
<button class="btn" data-bind="enable: isOperational() && !isPrinting() && loginState.isUser(), click: function() { $root.sendJogCommand('z',1) }"><i class="icon-arrow-up"></i></button>
|
||||
<!--<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" data-bind="enable: isOperational() && !isPrinting() && loginState.isUser(), click: function() { $root.sendJogCommand('z',-1) }"><i class="icon-arrow-down"></i></button>
|
||||
<div data-bind="visible: showZAxis">
|
||||
Z-Axis
|
||||
<div class="btn-group-vertical" role="group" aria-label="z-axis control">
|
||||
<button class="btn" data-bind="enable: isOperational() && !isPrinting() && loginState.isUser(), click: function() { $root.sendJogCommand('z',1) }"><i class="icon-arrow-up"></i></button>
|
||||
<!--<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" data-bind="enable: isOperational() && !isPrinting() && loginState.isUser(), click: function() { $root.sendJogCommand('z',-1) }"><i class="icon-arrow-down"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div>
|
||||
<button id="set_coordinate_origin_btn" class="btn" data-bind="click: setCoordinateOrigin" title="set coordinate origin"><i class="icon-screenshot"></i></button>
|
||||
</div>
|
||||
|
|
@ -370,18 +370,17 @@
|
|||
<button id="btn_focus_off" class="btn btn-default" data-bind="enable: isOperational() && !isPrinting() && loginState.isUser(), click: focus_off ">{{ _('Disable Focus') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
{% if hasZAxis %}
|
||||
<div style="text-align:center">
|
||||
<div class="jog-panel" id="control_zaxis">
|
||||
|
||||
Z-Axis
|
||||
<div class="btn-group-vertical" role="group" aria-label="z-axis control">
|
||||
<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" data-bind="enable: isOperational() && !isPrinting() && loginState.isUser(), click: function() { $root.sendJogCommand('z',-1) }"><i class="icon-arrow-down"></i></button>
|
||||
|
||||
<div style="text-align:center" data-bind="visible: showZAxis">
|
||||
<div class="jog-panel" id="control_zaxis_focus">
|
||||
|
||||
Z-Axis
|
||||
<div class="btn-group-vertical" role="group" aria-label="z-axis control">
|
||||
<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" data-bind="enable: isOperational() && !isPrinting() && loginState.isUser(), click: function() { $root.sendJogCommand('z',-1) }"><i class="icon-arrow-down"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
<div class="span8">
|
||||
|
|
|
|||
Loading…
Reference in a new issue