@@ -131,9 +131,7 @@ public boolean processDataEvent(DataEvent event) {
131131 predictors .put (predictor );
132132 }
133133
134- for (int sectorIdx =0 ; sectorIdx <SECTORS ; sectorIdx ++) {
135- update (bank , threshold , batchOutput [sectorIdx ], sectorIdx );
136- }
134+ update (bank , threshold , batchOutput );
137135
138136 event .removeBank (bankName );
139137 event .appendBank (bank );
@@ -194,14 +192,12 @@ public float[][][] processOutput(TranslatorContext ctx, NDList list) {
194192 }
195193
196194 // -------- Update single sector in bank --------
197- static void update (DataBank b , float threshold , float [][] data , int sectorIdx ) {
195+ static void update (DataBank b , float threshold , float [][][] data ) {
198196 for (int row =0 ; row <b .rows (); row ++) {
199- if ( b .getByte (0 ,row )-1 != sectorIdx ) continue ;
197+ int sector = b .getByte (0 ,row )-1 ;
200198 int layer =b .getByte (1 ,row )-1 ;
201199 int wire =b .getShort (2 ,row )-1 ;
202- if (layer <0 || layer >=data .length ) continue ;
203- if (wire <0 || wire >=data [0 ].length ) continue ;
204- if (data [layer ][wire ]<threshold ) {
200+ if (data [sector ][layer ][wire ]<threshold ) {
205201 if (b .getByte (3 ,row )==0 ) b .setByte (3 ,row ,(byte )60 );
206202 if (b .getByte (3 ,row )==10 ) b .setByte (3 ,row ,(byte )90 );
207203 }
0 commit comments