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:
parent
c817c3aed5
commit
4fc7a1cf91
1 changed files with 10 additions and 2 deletions
|
@ -18,6 +18,7 @@
|
||||||
* Marc Dumais (Ericsson) - Bug 405390
|
* Marc Dumais (Ericsson) - Bug 405390
|
||||||
* Marc Dumais (Ericsson) - Bug 407321
|
* Marc Dumais (Ericsson) - Bug 407321
|
||||||
* Xavier Raynaud (Kalray) - Bug 431935
|
* Xavier Raynaud (Kalray) - Bug 431935
|
||||||
|
* Marc Khouzam (Ericsson) - Bug 454293
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.view;
|
package org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.view;
|
||||||
|
@ -412,6 +413,13 @@ public class MulticoreVisualizerCanvas extends GraphicCanvas
|
||||||
return max_edge;
|
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 */
|
/** Recache persistent objects (tiles, etc.) for new monitor */
|
||||||
// synchronized so we don't change recache flags while doing a recache
|
// synchronized so we don't change recache flags while doing a recache
|
||||||
public synchronized void recache() {
|
public synchronized void recache() {
|
||||||
|
@ -466,7 +474,7 @@ public class MulticoreVisualizerCanvas extends GraphicCanvas
|
||||||
if (visualizerCpu != null) {
|
if (visualizerCpu != null) {
|
||||||
// update CPUs load meter
|
// update CPUs load meter
|
||||||
MulticoreVisualizerLoadMeter meter = visualizerCpu.getLoadMeter();
|
MulticoreVisualizerLoadMeter meter = visualizerCpu.getLoadMeter();
|
||||||
meter.setEnabled(m_model.getLoadMetersEnabled());
|
meter.setEnabled(getCPULoadEnabled());
|
||||||
meter.setLoad(modelCpu.getLoad());
|
meter.setLoad(modelCpu.getLoad());
|
||||||
meter.setHighLoadWatermark(modelCpu.getHighLoadWatermark());
|
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
|
// 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 core_separation = 4; // spacing between cores
|
||||||
|
|
||||||
int loadMeterWidth = core_margin*3/5;
|
int loadMeterWidth = core_margin*3/5;
|
||||||
|
|
Loading…
Add table
Reference in a new issue