2023.07.26 10:31 AM
Can someone please help me with the 2.4 question.
**2.4. Augment ```.f1.checkSensor``` to check if the `mysensor` parameter has received one of
the acceptable options and do:**
2023.08.04 02:32 AM
Hi @ab this looks great - just possibly one missing ; in your line defining benchmark - see end of second parameter
You have:
benchmark: ?[lapTab;
enlist(like;`sensorId;dict[mysensor])
enlist[`sensorId]!enlist(`sensorId);
enlist[`benchmarkValue]!enlist(avg;`sensorValue)];
versus
benchmark: ?[lapTab;
enlist(like;`sensorId;dict[mysensor]);
enlist[`sensorId]!enlist(`sensorId);
enlist[`benchmarkValue]!enlist(avg;`sensorValue)];
2023.07.28 01:56 AM
Hi @ab what problem / error are you seeing? I can better advise if you explain what you have tried or add a code snippet and some screenshots of any errors.
2023.07.31 03:41 AM
.f1.checkSensor:{[raceTab;lapTab;mysensor]dict:`temp`tyre`wind`all!("temp*";"tyre*";"wind*";"*e*");if[0b=mysensor in dict;.Q.trp[{ `$(mysensor)," is not a valid option for mysensor - valid options include `temp`tyre`wind`all" }]];benchmark: ?[lapTab;enlist(like;`sensorId;dict[mysensor])enlist[`sensorId]!enlist(`sensorId);enlist[`benchmarkValue]!enlist(avg;`sensorValue)];chk: ?[raceTab;enlist(like;`sensorId;dict[mysensor]);enlist[`sensorId]!enlist(`sensorId);`avgValue`stdDevValue!((avg;`sensorValue);(dev;`sensorValue))];chk: update diffValue:"F"$.Q.f'[5;abs[benchmarkValue-avgValue]] from benchmark lj chk;chk: update diffFlag:?[(diffValue>1);0b;1b], stdFlag:?[(stdDevValue>1.5);0b;1b] from chk;chk}
This is what I have done. Just added if and .Q.trp function to the 2.3 function.
2023.08.04 02:32 AM
Hi @ab this looks great - just possibly one missing ; in your line defining benchmark - see end of second parameter
You have:
benchmark: ?[lapTab;
enlist(like;`sensorId;dict[mysensor])
enlist[`sensorId]!enlist(`sensorId);
enlist[`benchmarkValue]!enlist(avg;`sensorValue)];
versus
benchmark: ?[lapTab;
enlist(like;`sensorId;dict[mysensor]);
enlist[`sensorId]!enlist(`sensorId);
enlist[`benchmarkValue]!enlist(avg;`sensorValue)];
2023.08.11 11:58 AM
Did your logic for input validation work? i.e temperature throws error? I am struggling with the logic
EMEA
Tel: +44 (0)28 3025 2242
AMERICAS
Tel: +1 (212) 447 6700
APAC
Tel: +61 (0)2 9236 5700
KX. All Rights Reserved.
KX and kdb+ are registered trademarks of KX Systems, Inc., a subsidiary of FD Technologies plc.