Add MUMAX parameter
This commit is contained in:
parent
fe58a68b96
commit
370dbb5ca1
|
@ -10,12 +10,13 @@ extern "C" {
|
||||||
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
CountedEnum(ParamType, size_t, PF_BBAL, PF_SLIPREF, PF_ASRP, PF_ASRON, PF_TEST1,
|
CountedEnum(ParamType, size_t, PF_BBAL, PF_SLIPREF, PF_MUMAX, PF_ASRP, PF_ASRON,
|
||||||
PF_TEST2, PF_TEST3, PF_TEST4);
|
PF_TEST1, PF_TEST2, PF_TEST3, PF_TEST4);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
float bbal;
|
float bbal;
|
||||||
float slipref;
|
float slipref;
|
||||||
|
float mumax;
|
||||||
unsigned asrp;
|
unsigned asrp;
|
||||||
unsigned asron;
|
unsigned asron;
|
||||||
unsigned test[4];
|
unsigned test[4];
|
||||||
|
|
|
@ -17,6 +17,9 @@ void params_inc(ParamType param) {
|
||||||
case PF_SLIPREF:
|
case PF_SLIPREF:
|
||||||
params.slipref += 0.01f;
|
params.slipref += 0.01f;
|
||||||
break;
|
break;
|
||||||
|
case PF_MUMAX:
|
||||||
|
params.mumax += 0.1f;
|
||||||
|
break;
|
||||||
case PF_ASRP:
|
case PF_ASRP:
|
||||||
params.asrp++;
|
params.asrp++;
|
||||||
break;
|
break;
|
||||||
|
@ -51,6 +54,11 @@ void params_dec(ParamType param) {
|
||||||
params.slipref -= 0.01f;
|
params.slipref -= 0.01f;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case PF_MUMAX:
|
||||||
|
if (params.mumax > 0) {
|
||||||
|
params.mumax -= 0.1f;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case PF_ASRP:
|
case PF_ASRP:
|
||||||
if (params.asrp > 0) {
|
if (params.asrp > 0) {
|
||||||
params.asrp--;
|
params.asrp--;
|
||||||
|
@ -91,6 +99,9 @@ void params_broadcast(ParamType param) {
|
||||||
case PF_SLIPREF:
|
case PF_SLIPREF:
|
||||||
value = params.slipref * 100;
|
value = params.slipref * 100;
|
||||||
break;
|
break;
|
||||||
|
case PF_MUMAX:
|
||||||
|
value = params.mumax * 10;
|
||||||
|
break;
|
||||||
case PF_ASRP:
|
case PF_ASRP:
|
||||||
value = params.asrp;
|
value = params.asrp;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -282,6 +282,7 @@ NamedFieldDescription paramFieldDescs[] = {
|
||||||
[PF_BBAL] = {NamedFieldKind::Float, "BBAL", 2, 1, PARAM_FIELD(bbal)},
|
[PF_BBAL] = {NamedFieldKind::Float, "BBAL", 2, 1, PARAM_FIELD(bbal)},
|
||||||
[PF_SLIPREF] = {NamedFieldKind::Float, "SLIPREF", 2, 2,
|
[PF_SLIPREF] = {NamedFieldKind::Float, "SLIPREF", 2, 2,
|
||||||
PARAM_FIELD(slipref)},
|
PARAM_FIELD(slipref)},
|
||||||
|
[PF_MUMAX] = {NamedFieldKind::Float, "MUMAX", 2, 1, PARAM_FIELD(mumax)},
|
||||||
[PF_ASRP] = {NamedFieldKind::Int, "ASR-P", 2, 0, PARAM_FIELD(asrp)},
|
[PF_ASRP] = {NamedFieldKind::Int, "ASR-P", 2, 0, PARAM_FIELD(asrp)},
|
||||||
[PF_ASRON] = {NamedFieldKind::Int, "ASR-ON", 2, 0, PARAM_FIELD(asron)},
|
[PF_ASRON] = {NamedFieldKind::Int, "ASR-ON", 2, 0, PARAM_FIELD(asron)},
|
||||||
[PF_TEST1] = {NamedFieldKind::Int, "TEST1", 2, 0, PARAM_FIELD(test[0])},
|
[PF_TEST1] = {NamedFieldKind::Int, "TEST1", 2, 0, PARAM_FIELD(test[0])},
|
||||||
|
|
Loading…
Reference in New Issue