Hi all,
I'm developing a plugin in OpenChrom to control our home-made in situ TOF mass spectrometer.
In the device control view, I wrote the following code for the "Acquire data" button:
new Job("Acquisition") {
@Override
protected IStatus run(final IProgressMonitor monitor) {
final File saveFile = new File("20160830112233.tms");
// new a empty AbstractChromatogramMSD to hold the acquiring data
final XmTideTofChromatogram tideMSChromatogram = new XmTideTofChromatogram();
tideMSChromatogram.setFile(saveFile);
final ZipBufferWriter writer = new ZipBufferWriter(saveFile); // a zip writer to save data to disk
// create ChromatogramEditorMSD part and setObject(tideMSChromatogram) in UIJob
openMSDEditor(tideMSChromatogram);
//acquires scans and adds to tideMSChromatogram
for(int i = 0; i < usbDevice.getSpectraNumber(); i++) {
//acquires one scan and adds it to tideMSChromatogram: tideMSChromatogram.addScan(scan), also writes scan data to disk
// How to fire update of the ChromatogramEditorMSD ???
usbDevice.acquireMassSpectrum(tideMSChromatogram, writer, i);
}
// writes tic and close file in end
writer.writeOverviewFolder(tideMSChromatogram);
When the button clicked, a ChromatogramEditorMSD part created, but nothing display, just empty figure.
What's wrong with my codes?