Rev 1545 | Rev 1563 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1545 | Rev 1562 | ||
---|---|---|---|
Line 41... | Line 41... | ||
41 | } |
41 | } |
Line 42... | Line 42... | ||
42 | 42 | ||
Line 43... | Line 43... | ||
43 | public void start(String logId) {} |
43 | public void start(String logId) {} |
- | 44 | ||
- | 45 | public void log(DebugResponseFrame f, long timestamp) { |
|
- | 46 | if (f == null) { |
|
- | 47 | System.out.println("Oops, null response frame."); |
|
- | 48 | return; |
|
44 | 49 | } |
|
45 | public void log(DebugResponseFrame f, long timestamp) { |
50 | int l = f.getDigital()==null ? 0 : f.getDigital().length; |
46 | for (int i = 0; i < f.getDigital().length; i++) { |
51 | for (int i = 0; i < l; i++) { |
Line -... | Line 52... | ||
- | 52 | System.out.println("Digital " + i + ":\t" + f.getDigital()[i]); |
|
47 | System.out.println("Digital " + i + ":\t" + f.getDigital()[i]); |
53 | } |
48 | } |
54 | |
49 | 55 | l = f.getAnalog()==null ? 0 : f.getAnalog().length; |
|
50 | for (int i = 0; i < f.getAnalog().length; i++) { |
56 | for (int i = 0; i < l; i++) { |
51 | String label = labels[i] == null ? ("Analog " + i) : labels[i]; |
57 | String label = labels[i] == null ? ("Analog " + i) : labels[i]; |
Line 145... | Line 151... | ||
145 | for (int i = 0; i < 32; i++) { |
151 | for (int i = 0; i < 32; i++) { |
146 | missing.add(i); |
152 | missing.add(i); |
147 | } |
153 | } |
Line 148... | Line 154... | ||
148 | 154 | ||
149 | int tries = 0; |
155 | int tries = 0; |
150 | while (!missing.isEmpty() && tries < 100) { |
156 | while (!missing.isEmpty() && tries < 300) { |
151 | int i = missing.get(0); |
157 | int i = missing.get(0); |
152 | tries++; |
158 | tries++; |
153 | AnalogDebugLabelRequestFrame f2 = //ff.createAnalogDebugLabelRequestFrame(Frame.FC_ADDRESS, i); |
159 | AnalogDebugLabelRequestFrame f2 = //ff.createAnalogDebugLabelRequestFrame(Frame.FC_ADDRESS, i); |
154 | new AnalogDebugLabelRequestFrame(Frame.FC_ADDRESS, i); |
160 | new AnalogDebugLabelRequestFrame(Frame.FC_ADDRESS, i); |
155 | try { |
161 | try { |
156 | q.sendRequest(f2); |
162 | q.sendRequest(f2); |
157 | AnalogDebugLabelResponseFrame rf = (AnalogDebugLabelResponseFrame) q.getResponseFor(f2, 1000); |
163 | AnalogDebugLabelResponseFrame rf = (AnalogDebugLabelResponseFrame) q.getResponseFor(f2, 5000); |
158 | if (rf != null) { |
164 | if (rf != null) { |
- | 165 | logger.setLabel(i, rf.getLabelAsString()); |
|
159 | logger.setLabel(i, rf.getLabelAsString()); |
166 | missing.remove(0); |
160 | } else { |
167 | } else { |
161 | String unknown = "analog " + i; |
168 | String unknown = "analog " + i; |
162 | logger.setLabel(i, unknown); |
169 | logger.setLabel(i, unknown); |
163 | missing.add(i); |
170 | missing.add(i); |