diff --git a/sw/in_progress/motor_bench/mb_utils.sci b/sw/in_progress/motor_bench/mb_utils.sci index 0ba02b3277..7017053fe5 100644 --- a/sw/in_progress/motor_bench/mb_utils.sci +++ b/sw/in_progress/motor_bench/mb_utils.sci @@ -1,24 +1,32 @@ + + + function [time, throttle, rpm, amp, thrust, torque] = read_mb_log(filename) time=[]; -rpm_meas=[]; throttle=[]; rpm=[]; +amp=[]; +thrust=[]; +torque=[]; -no_line = 1; u=mopen(filename,'r'); + while meof(u) == 0, line = mgetl(u, 1); - if strindex(line, '#') ~= 1 & length(line) ~= 0, - [nb_scan, t, c, p, p_f] = msscanf(1, line, '%f %f %f %f'); - if nb_scan == 4, - time(no_line) = t; - throttle(no_line) = c*max_rpm; - rpm_sp(no_line) = p; - rpm_meas(no_line) =p_f; - no_line = no_line + 1; + if strindex(line, '#') ~= 1 & length(line) ~= 0, + [nb_scan, _time, _throttle, _rpm, _amp, _thrust, _torque] = msscanf(1, line, '%f %f %f %f %f %f'); + if nb_scan == 6, + time = [time _time]; + throttle = [throttle _throttle]; + rpm = [rpm _rpm]; + amp = [amp _amp]; + thrust = [thrust _thrust]; + torque = [torque _torque]; end end end mclose(u); + +endfunction