moving the toggle_rotary to backend
This commit is contained in:
@@ -238,12 +238,12 @@ module.exports = new Vue({
|
||||
},
|
||||
|
||||
is_rotary_active: function() {
|
||||
if(this.config.motors[2]['axis'] == 'Y') return false;
|
||||
if(this.state["2an"] == 1) return false;
|
||||
return true;
|
||||
},
|
||||
|
||||
enable_rotary: function() {
|
||||
if(this.config.motors[2]['axis'] == 'Y' || this.config.motors[2]['axis'] == 'A') return true;
|
||||
if(this.state["2an"] == 1 || this.state["2an"] == 3) return true;
|
||||
return false;
|
||||
}
|
||||
},
|
||||
@@ -338,6 +338,7 @@ module.exports = new Vue({
|
||||
this.config.motors[1]['max-velocity'] /= 2;
|
||||
}
|
||||
try {
|
||||
await api.put("rotary", {status : motor['axis'] == 'A'});
|
||||
await api.put("config/save", this.config);
|
||||
} catch (error) {
|
||||
console.error("Restore failed:", error);
|
||||
|
||||
@@ -98,7 +98,7 @@ script#control-view-template(type="text/x-template")
|
||||
button(:style="getJogIncrStyle('large')", @click="jog_incr = 'large'")
|
||||
span {{jog_incr_amounts[display_units].large}}#[span.jog-units {{metric ? 'mm' : 'in'}}]
|
||||
|
||||
tr(v-if="config.motors[2]['axis'] == 'A'")
|
||||
tr(v-if="state['2an'] == 3")
|
||||
td(style="height:100px", align="center", colspan="1")
|
||||
button(@click="showProbeDialog('a')")
|
||||
| Probe
|
||||
|
||||
@@ -603,6 +603,18 @@ class TimeHandler(bbctrl.APIHandler):
|
||||
except Exception as e:
|
||||
self.get_log('TimeHandler').info('Error: {}'.format(e))
|
||||
|
||||
class RotaryHandler(bbctrl.APIHandler):
|
||||
|
||||
def put_ok(self):
|
||||
status = self.json.get('status', None)
|
||||
state = self.get_ctrl().state
|
||||
try:
|
||||
self.get_log('RotaryHandler').info('Status: {}'.format(status))
|
||||
state.set("rotary", status)
|
||||
|
||||
except Exception as e:
|
||||
self.get_log('RotaryHandler').info('Error: {}'.format(e))
|
||||
|
||||
|
||||
class RemoteDiagnosticsHandler(bbctrl.APIHandler):
|
||||
|
||||
@@ -776,6 +788,7 @@ class Web(tornado.web.Application):
|
||||
(r'/api/video', bbctrl.VideoHandler),
|
||||
(r'/api/screen-rotation', ScreenRotationHandler),
|
||||
(r'/api/time', TimeHandler),
|
||||
(r'/api/rotary', RotaryHandler),
|
||||
(r'/api/remote-diagnostics', RemoteDiagnosticsHandler),
|
||||
(r'/(.*)', StaticFileHandler,
|
||||
{'path': bbctrl.get_resource('http/'),
|
||||
|
||||
Reference in New Issue
Block a user