0

I have created an "SCA Control Panel" project of the type "SCA Plugin with Waveform Control Panel" that is associated with a waveform that has been deployed to my SDR and noticed some odd behavior. When I run a configuration of Eclipse with the new plugin installed and I launch the waveform, the new control panel displays as expected. The "Controls" group displays the waveform's unique name. However, the "Viewer" TreeViewer remains empty. Now, I expand REDHAWK_DEV > Waveforms > MyWaveform in the SCA Explorer and the control panel "Viewer" TreeViewer populates with a list of the components in the waveform. I would expect the components to populate in the control panel when the waveform is launched.

What is occurring when I expand the waveform in SCA Explorer that causes the ContentProvider and/or LabelProvider to refresh? Can I call/poll something to refresh this automatically without needing to expand the waveform in the SCA Explorer?

1 Answers1

0

The ScaWaveform object can be refreshed explicitly by invoking its refresh method, e.g.

ScaWaveform myWaveform = ...
myWaveform.refresh(RefreshDepth.FULL); //NB there are other static members in RefreshDepth which can be used

This will cause the components to be available in the waveform.

Model objects such as ScaWaveform must be refreshed explicitly to make available child objects that were added after the model object was created. It works this way to ensure we avoid excessive data traffic between client and server.

As you noticed, the model object is refreshed when the user interacts with its view. You can also refresh it manually as shown above.

MidnightJava
  • 1,927
  • 2
  • 18
  • 38
  • This is good information! However, it looks like the refresh() method actually takes two arguments: IProgressMonitor and RefreshDepth. So, I had to call it from within a scheduled job similar to what is described [here](http://redhawksdr.github.io/Documentation/mainch24.html#x26-31200024). Then it worked! – wakeboard82 Sep 20 '13 at 15:27
  • Sorry I left off the first parameter. For others who may read this later, you can pass it an instance of IProgressMonitor that displays progress to the user, or `new NullProgressMonotor()` if you don't want to display progress to the user. – MidnightJava Dec 06 '13 at 03:06