274def test_peaks_data() -> int:
275 frame = DAPHNEFrame()
276 peaks = frame.peaks_data()
277
278 peaks.set_found(1, 0)
279 if peaks.is_found(0) != 1:
280 print(f"FAIL: peaks found(0) expected 1, got {peaks.is_found(0)}")
281 return 1
282
283 peaks.set_adc_integral(12345, 1)
284 if peaks.get_adc_integral(1) != 12345:
285 print(f"FAIL: adc_integral(1) mismatch, got {peaks.get_adc_integral(1)}")
286 return 1
287
288 peaks.set_num_subpeaks(7, 2)
289 if peaks.get_num_subpeaks(2) != 7:
290 print(f"FAIL: num_subpeaks(2) mismatch, got {peaks.get_num_subpeaks(2)}")
291 return 1
292
293 peaks.set_samples_over_baseline(200, 3)
294 if peaks.get_samples_over_baseline(3) != 200:
295 print(f"FAIL: samples_over_baseline(3) mismatch, got {peaks.get_samples_over_baseline(3)}")
296 return 1
297
298 peaks.set_adc_max(4000, 4)
299 if peaks.get_adc_max(4) != 4000:
300 print(f"FAIL: adc_max(4) mismatch, got {peaks.get_adc_max(4)}")
301 return 1
302
303 peaks.set_sample_max(123, 4)
304 if peaks.get_sample_max(4) != 123:
305 print(f"FAIL: sample_max(4) mismatch, got {peaks.get_sample_max(4)}")
306 return 1
307
308 peaks.set_sample_start(777, 0)
309 if peaks.get_sample_start(0) != 777:
310 print(f"FAIL: sample_start(0) mismatch, got {peaks.get_sample_start(0)}")
311 return 1
312
313 peaks.found_0 = 1
314 if peaks.found_0 != 1:
315 print(f"FAIL: found_0 property mismatch, got {peaks.found_0}")
316 return 1
317
318 peaks.adc_integral_0 = 54321
319 if peaks.adc_integral_0 != 54321:
320 print(f"FAIL: adc_integral_0 property mismatch, got {peaks.adc_integral_0}")
321 return 1
322
323 print("PASS: DAPHNEFramePeakDescriptorData methods and properties")
324 return 0
325
326