1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 454293 - Allow extending classes to turn off CPU load

Change-Id: I9fa14da634550c2fb852a4853290ca8971d78146
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/37736
This commit is contained in:
Marc Khouzam 2014-12-08 09:20:38 -05:00
parent c817c3aed5
commit 4fc7a1cf91

View file

@ -18,6 +18,7 @@
* Marc Dumais (Ericsson) - Bug 405390
* Marc Dumais (Ericsson) - Bug 407321
* Xavier Raynaud (Kalray) - Bug 431935
* Marc Khouzam (Ericsson) - Bug 454293
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.view;
@ -412,6 +413,13 @@ public class MulticoreVisualizerCanvas extends GraphicCanvas
return max_edge;
}
/**
* Allows overriding classes to change this behavior.
*/
protected boolean getCPULoadEnabled() {
return m_model == null ? false : m_model.getLoadMetersEnabled();
}
/** Recache persistent objects (tiles, etc.) for new monitor */
// synchronized so we don't change recache flags while doing a recache
public synchronized void recache() {
@ -466,7 +474,7 @@ public class MulticoreVisualizerCanvas extends GraphicCanvas
if (visualizerCpu != null) {
// update CPUs load meter
MulticoreVisualizerLoadMeter meter = visualizerCpu.getLoadMeter();
meter.setEnabled(m_model.getLoadMetersEnabled());
meter.setEnabled(getCPULoadEnabled());
meter.setLoad(modelCpu.getLoad());
meter.setHighLoadWatermark(modelCpu.getHighLoadWatermark());
@ -510,7 +518,7 @@ public class MulticoreVisualizerCanvas extends GraphicCanvas
}
// make room when load meters are present, else use a more compact layout
int core_margin = m_model.getLoadMetersEnabled() ? 20 : 12; // margin around cores in a CPU
int core_margin = getCPULoadEnabled() ? 20 : 12; // margin around cores in a CPU
int core_separation = 4; // spacing between cores
int loadMeterWidth = core_margin*3/5;