fixing motor/servo indicator

10.3.x-maintenance
skaman82 2015-11-09 21:40:26 +01:00
parent ec8771bcc8
commit 09b8578300
1 changed files with 2 additions and 2 deletions

View File

@ -446,7 +446,7 @@ TABS.motors.initialize = function (callback) {
var data = MOTOR_DATA[i] - MISC.mincommand, var data = MOTOR_DATA[i] - MISC.mincommand,
margin_top = block_height - (data * (block_height / full_block_scale)).clamp(0, block_height), margin_top = block_height - (data * (block_height / full_block_scale)).clamp(0, block_height),
height = (data * (block_height / full_block_scale)).clamp(0, block_height), height = (data * (block_height / full_block_scale)).clamp(0, block_height),
color = parseInt(data * 0.01); color = parseInt(data * 0.009);
$('.motor-' + i + ' .label', motors_wrapper).text(MOTOR_DATA[i]); $('.motor-' + i + ' .label', motors_wrapper).text(MOTOR_DATA[i]);
$('.motor-' + i + ' .indicator', motors_wrapper).css({'margin-top' : margin_top + 'px', 'height' : height + 'px', 'background-color' : 'rgba(89,170,41,0.'+ color +')'}); $('.motor-' + i + ' .indicator', motors_wrapper).css({'margin-top' : margin_top + 'px', 'height' : height + 'px', 'background-color' : 'rgba(89,170,41,0.'+ color +')'});
@ -457,7 +457,7 @@ TABS.motors.initialize = function (callback) {
var data = SERVO_DATA[i] - 1000, var data = SERVO_DATA[i] - 1000,
margin_top = block_height - (data * (block_height / 1000)).clamp(0, block_height), margin_top = block_height - (data * (block_height / 1000)).clamp(0, block_height),
height = (data * (block_height / 1000)).clamp(0, block_height), height = (data * (block_height / 1000)).clamp(0, block_height),
color = parseInt(data * 0.01); color = parseInt(data * 0.009);
$('.servo-' + i + ' .label', servos_wrapper).text(SERVO_DATA[i]); $('.servo-' + i + ' .label', servos_wrapper).text(SERVO_DATA[i]);
$('.servo-' + i + ' .indicator', servos_wrapper).css({'margin-top' : margin_top + 'px', 'height' : height + 'px', 'background-color' : 'rgba(89,170,41,0.'+ color +')'}); $('.servo-' + i + ' .indicator', servos_wrapper).css({'margin-top' : margin_top + 'px', 'height' : height + 'px', 'background-color' : 'rgba(89,170,41,0.'+ color +')'});