Enable the model last, if set

We need all the values to be set before we can attempt to enable the
model.
This commit is contained in:
Yuri D'Elia 2022-06-27 14:22:37 +02:00
parent 49048fdcd6
commit 92bc7554b6

View file

@ -7808,12 +7808,14 @@ Sigma_Exit:
break;
}
// update all set parameters
if(S >= 0) temp_model_set_enabled(S);
// update all parameters
if(B >= 0) temp_model_set_warn_beep(B);
if(!isnan(C) || !isnan(P) || !isnan(T) || !isnan(W) || !isnan(E)) temp_model_set_params(C, P, T, W, E);
if(I >= 0 && !isnan(R)) temp_model_set_resistance(I, R);
// enable the model last, if requested
if(S >= 0) temp_model_set_enabled(S);
// run autotune
if(A >= 0) temp_model_autotune(A);
}