add conditional checks
This commit is contained in:
@@ -243,7 +243,7 @@ module.exports = new Vue({
|
|||||||
},
|
},
|
||||||
|
|
||||||
enable_rotary: function() {
|
enable_rotary: function() {
|
||||||
if(this.state["2an"] == 1 || this.state["2an"] == 3) return true;
|
if((this.state["2an"] == 1 || this.state["2an"] == 3) && this.is_idle) return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -640,7 +640,16 @@ class RotaryHandler(bbctrl.APIHandler):
|
|||||||
motor_1["max-velocity"] *= 2 if is_axis_A else 0.5
|
motor_1["max-velocity"] *= 2 if is_axis_A else 0.5
|
||||||
|
|
||||||
if is_axis_A:
|
if is_axis_A:
|
||||||
if 'min-soft-limit-backup' in motor_2 and 'max-soft-limit-backup' in motor_2:
|
required_keys = [
|
||||||
|
'min-soft-limit-backup',
|
||||||
|
'max-soft-limit-backup',
|
||||||
|
'max-velocity-backup',
|
||||||
|
'max-accel-backup',
|
||||||
|
'max-jerk-backup',
|
||||||
|
'step-angle-backup',
|
||||||
|
'travel-per-rev-backup'
|
||||||
|
]
|
||||||
|
if all(key in motor_2 for key in required_keys):
|
||||||
motor_2['min-soft-limit'] = motor_2['min-soft-limit-backup']
|
motor_2['min-soft-limit'] = motor_2['min-soft-limit-backup']
|
||||||
motor_2['max-soft-limit'] = motor_2['max-soft-limit-backup']
|
motor_2['max-soft-limit'] = motor_2['max-soft-limit-backup']
|
||||||
motor_2['max-velocity'] = motor_2["max-velocity-backup"]
|
motor_2['max-velocity'] = motor_2["max-velocity-backup"]
|
||||||
|
|||||||
Reference in New Issue
Block a user