Optuma Forums › Optuma Scripting › Help with scripting language for temporal filtering › Filter test code failure 1
- Topics: 6
- Replies: 13
- Posts: 19
Filter test code failure 1
This is the first run at the code from the spec. of the previous posting. Simple enough:
This shows the code was accepted by the script editor.
This is the script:
// Filter setpoints Non_1 = 4; // A->B interval threshold Nih_1 = 3; // number of A pulses to inhibit after next B pulse //Filter inputs A_1 = CLOSE() CrossesAbove MA(); B_1 = CLOSE() CrossesBelow MA() ; // Filter processing A_1_cnt = COUNTMATCHSINCESIGNAL( 1, A_1 and (inhibit_1 == 0) ); B_1_cnt = Nih_1 + 1 – COUNTMATCHSINCESIGNAL( 1, B_1 and (A_1_cnt >= Non_1) ); inhibit_1 = SWITCH( (A_1_cnt >= Non_1), (B_1_cnt <= 0) ); // Filter outputs A_2 = A_1 and (inhibit_1 == 0); B_2 = B_1; // Plot values plot1 = 12 + A_1; plot1.Plotstyle = Step; plot1.Colour = Blue; plot2 = 10 + B_1; plot2.Colour = Red; plot2.Plotstyle = Step; plot3 = A_1_cnt; plot3.Colour = Blue; plot3.Plotstyle = Step; plot4 = B_1_cnt; plot4.Colour = Red; plot4.Plotstyle = Step; plot5 = -4+inhibit_1; plot5.Plotstyle = Step; plot5.Colour = Black; plot6 = -6 + A_2; plot6.Colour = Blue; plot6.Plotstyle = Step; plot7 = -8 + B_2; plot7.Colour = Red; plot7.Plotstyle = Step; plot8 = 0.0; plot8.Colour = Gray; plot8.Plotstyle = line; plot8.Linestyle = LongDashDotDot;
I could not use the editor PRE/POST option. It simply didn’t allow me to. Sorry!
This is what the failed output looks like:
I look forward to forum advice!