*/
protected final Object fStatisticsUpdateSyncObj = new Object();
+ /**
+ * Update range synchronization object.
+ */
+ protected final Object fStatisticsRangeUpdateSyncObj = new Object();
+
/**
* Indicates to process all events
*/
return;
}
- // Sends the time range request only once in this method.
- if (fSendRangeRequest) {
- fSendRangeRequest = false;
- // Calculate the selected time range to request
- long startTime = signal.getRange().getStartTime().normalize(0, TIME_SCALE).getValue();
- TmfTimestamp startTS = new TmfTimestamp(startTime, TIME_SCALE);
- TmfTimestamp endTS = new TmfTimestamp(startTime + INITIAL_WINDOW_SPAN, TIME_SCALE);
- TmfTimeRange timeRange = new TmfTimeRange(startTS, endTS);
-
- requestTimeRangeData(experiment, timeRange);
+ synchronized (fStatisticsRangeUpdateSyncObj) {
+ // Sends the time range request only once from this method.
+ if (fSendRangeRequest) {
+ fSendRangeRequest = false;
+ // Calculate the selected time range to request
+ long startTime = signal.getRange().getStartTime().normalize(0, TIME_SCALE).getValue();
+ TmfTimestamp startTS = new TmfTimestamp(startTime, TIME_SCALE);
+ TmfTimestamp endTS = new TmfTimestamp(startTime + INITIAL_WINDOW_SPAN, TIME_SCALE);
+ TmfTimeRange timeRange = new TmfTimeRange(startTS, endTS);
+
+ requestTimeRangeData(experiment, timeRange);
+ }
}
requestData(experiment, signal.getRange());
}
});
}
+ /**
+ * Will force a request on the partial event count if one is needed.
+ */
+ public void sendPartialRequestOnNextUpdate() {
+ synchronized (fStatisticsRangeUpdateSyncObj) {
+ fSendRangeRequest = true;
+ }
+ }
+
/**
* Focus on the statistics tree of the viewer
*/
fExperiment.endSynch(new TmfEndSynchSignal(0));
fRequestData = false;
}
+ } else {
+ /*
+ * If the same experiment is reselected, sends a notification to
+ * the viewers to make sure they reload correctly their partial
+ * event count.
+ */
+ TmfStatisticsViewer statsViewer;
+ for (ITmfViewer viewer : fStatsViewers.getViewers()) {
+ if (!(viewer instanceof TmfStatisticsViewer)) {
+ Activator.getDefault().logError("Error - cannot cast viewer to a statistics viewer"); //$NON-NLS-1$
+ continue;
+ }
+ statsViewer = (TmfStatisticsViewer) viewer;
+ // Will update the partial event count if needed.
+ statsViewer.sendPartialRequestOnNextUpdate();
+ }
}
}
}