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

Multicore visualizer cosmetic changes - mostly regarding comments and

some other small non-functional improvements

Change-Id: I93e49b7158c916f349ad65ab3ba7d34e193b56c9
Reviewed-on: https://git.eclipse.org/r/35144
Reviewed-by: Marc Dumais <marc.dumais@ericsson.com>
Tested-by: Marc Dumais <marc.dumais@ericsson.com>
This commit is contained in:
Marc Dumais 2014-10-20 08:29:25 -04:00
parent 6542690eff
commit 88a494349a
20 changed files with 163 additions and 228 deletions

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2013 Ericsson * Copyright (c) 2013, 2014 Ericsson and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -16,7 +16,7 @@ import org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.view.MulticoreVis
import org.eclipse.cdt.visualizer.ui.VisualizerAction; import org.eclipse.cdt.visualizer.ui.VisualizerAction;
/** /**
* @since 1.1 * Action that enables or disables load meters
*/ */
public class EnableLoadMetersAction extends VisualizerAction { public class EnableLoadMetersAction extends VisualizerAction {
@ -25,6 +25,7 @@ public class EnableLoadMetersAction extends VisualizerAction {
boolean m_enabled = false; boolean m_enabled = false;
/** Constructor */
public EnableLoadMetersAction(boolean enable) { public EnableLoadMetersAction(boolean enable) {
m_enabled = enable; m_enabled = enable;
setText(getTextToDisplay()); setText(getTextToDisplay());

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2013 Ericsson * Copyright (c) 2013, 2014 Ericsson and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -15,22 +15,22 @@ import org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.MulticoreVisualiz
import org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.view.MulticoreVisualizer; import org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.view.MulticoreVisualizer;
import org.eclipse.cdt.visualizer.ui.VisualizerAction; import org.eclipse.cdt.visualizer.ui.VisualizerAction;
/** /** Action that creates or clears a canvas filter */
* @since 1.1
*/
public class FilterCanvasAction extends VisualizerAction { public class FilterCanvasAction extends VisualizerAction {
/** Visualizer instance we're associated with. */ /** Visualizer instance we're associated with. */
MulticoreVisualizer m_visualizer = null; MulticoreVisualizer m_visualizer = null;
boolean m_haveFilter = false;
/** Does this action enable or disable the filter mechanism? */
boolean m_createFilter = false;
/** /**
* @param filterType: the type of canvas object the filter applies-to. If null, reset filter * Constructor
* @param create : Controls whether this action will create or clear the filter
*/ */
public FilterCanvasAction(boolean enable) { public FilterCanvasAction(boolean create) {
m_haveFilter = enable; m_createFilter = create;
if (m_haveFilter) { if (m_createFilter) {
setText(MulticoreVisualizerUIPlugin.getString("MulticoreVisualizer.actions.SetFilter.text")); //$NON-NLS-1$ setText(MulticoreVisualizerUIPlugin.getString("MulticoreVisualizer.actions.SetFilter.text")); //$NON-NLS-1$
} }
else { else {
@ -61,7 +61,7 @@ public class FilterCanvasAction extends VisualizerAction {
@Override @Override
public void run() { public void run() {
if (m_visualizer != null) { if (m_visualizer != null) {
if (m_haveFilter) { if (m_createFilter) {
m_visualizer.applyCanvasFilter(); m_visualizer.applyCanvasFilter();
} }
else { else {

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2012 Tilera Corporation and others. * Copyright (c) 2012, 2014 Tilera Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -16,7 +16,7 @@ import org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.view.MulticoreVis
import org.eclipse.cdt.visualizer.ui.VisualizerAction; import org.eclipse.cdt.visualizer.ui.VisualizerAction;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
/** Select All action for Visualizer context menu. */ /** Action that refreshes the Visualizer canvas. */
public class RefreshAction extends VisualizerAction public class RefreshAction extends VisualizerAction
{ {
// --- members --- // --- members ---

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2013 Ericsson * Copyright (c) 2013, 2014 Ericsson and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -16,7 +16,7 @@ import org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.view.MulticoreVis
import org.eclipse.cdt.visualizer.ui.VisualizerAction; import org.eclipse.cdt.visualizer.ui.VisualizerAction;
/** /**
* @since 1.1 * Action that sets the load meter refresh period
*/ */
public class SetLoadMeterPeriodAction extends VisualizerAction { public class SetLoadMeterPeriodAction extends VisualizerAction {

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2013 Ericsson * Copyright (c) 2013 Ericsson and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2012, 2013 Tilera Corporation and others. * Copyright (c) 2012, 2014 Tilera Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -31,9 +31,7 @@ public class VisualizerCPU
/** ID of this core. */ /** ID of this core. */
public int m_id; public int m_id;
/** Contains load information /** Load object associated to this cpu */
* @since 1.1
*/
protected VisualizerLoadInfo m_loadinfo; protected VisualizerLoadInfo m_loadinfo;
/** List of cores */ /** List of cores */
@ -90,20 +88,17 @@ public class VisualizerCPU
return null; return null;
} }
/** sets the load info for this CPU /** Sets the load object associated to this CPU */
* @since 1.1*/
public synchronized void setLoadInfo (VisualizerLoadInfo info) { public synchronized void setLoadInfo (VisualizerLoadInfo info) {
m_loadinfo = info; m_loadinfo = info;
} }
/** Gets the CPU usage load of this CPU. /** Gets the load value associated to this CPU */
* @since 1.1*/
public synchronized Integer getLoad() { public synchronized Integer getLoad() {
return (m_loadinfo == null) ? null : m_loadinfo.getLoad(); return (m_loadinfo == null) ? null : m_loadinfo.getLoad();
} }
/** get the highest recorded load for this CPU /** get the highest recorded load value for this CPU*/
* @since 1.1*/
public synchronized Integer getHighLoadWatermark() { public synchronized Integer getHighLoadWatermark() {
return (m_loadinfo == null) ? null : m_loadinfo.getHighLoadWaterMark(); return (m_loadinfo == null) ? null : m_loadinfo.getHighLoadWaterMark();
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2012, 2013 Tilera Corporation and others. * Copyright (c) 2012, 2014 Tilera Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -26,9 +26,7 @@ public class VisualizerCore
/** Linux CPU ID of this core. */ /** Linux CPU ID of this core. */
public int m_id = 0; public int m_id = 0;
/** Contains load information /** Load information associated to this core */
* @since 1.1
*/
protected VisualizerLoadInfo m_loadinfo; protected VisualizerLoadInfo m_loadinfo;
// --- constructors/destructors --- // --- constructors/destructors ---
@ -73,20 +71,17 @@ public class VisualizerCore
return getCPU(); return getCPU();
} }
/** sets the load info for this core /** Sets the load object associated to this core */
* @since 1.1*/
public synchronized void setLoadInfo (VisualizerLoadInfo info) { public synchronized void setLoadInfo (VisualizerLoadInfo info) {
m_loadinfo = info; m_loadinfo = info;
} }
/** Gets the CPU usage load of this core. /** Gets the load value of this core */
* @since 1.1*/
public synchronized Integer getLoad() { public synchronized Integer getLoad() {
return (m_loadinfo == null) ? null : m_loadinfo.getLoad(); return (m_loadinfo == null) ? null : m_loadinfo.getLoad();
} }
/** get the highest recorded load for this core /** Get the highest recorded load value for this core */
* @since 1.1*/
public synchronized Integer getHighLoadWatermark() { public synchronized Integer getHighLoadWatermark() {
return (m_loadinfo == null) ? null : m_loadinfo.getHighLoadWaterMark(); return (m_loadinfo == null) ? null : m_loadinfo.getHighLoadWaterMark();
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2013 Ericsson * Copyright (c) 2013, 2014 Ericsson and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -16,13 +16,13 @@ package org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.model;
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
/** /**
* @since 1.1 * Object that represents the load of a CPU or core
*/ */
public class VisualizerLoadInfo { public class VisualizerLoadInfo {
// --- members --- // --- members ---
/** load */ /** load */
protected Integer m_load = null; protected Integer m_load = null;
/** the high load water-mark */ /** the high load water-mark */

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2012, 2013 Ericsson and others. * Copyright (c) 2012, 2014 Ericsson and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -52,28 +52,23 @@ public class IMulticoreVisualizerConstants
// Colors for drawing CPUs // Colors for drawing CPUs
/** /** Foreground color for cpu */
* @since 1.1
*/
public static final Color COLOR_CPU_FG = Colors.GREEN; public static final Color COLOR_CPU_FG = Colors.GREEN;
/** /** Background color for cpu */
* @since 1.1
*/
public static final Color COLOR_CPU_BG = Colors.getColor(0,64,0); public static final Color COLOR_CPU_BG = Colors.getColor(0,64,0);
// Colors for text // Colors for text
/** Color to be used to draw a the text for a thread */ /** Foreground color to be used to draw a the text for a thread */
public static final Color COLOR_THREAD_TEXT_FG = Colors.WHITE; public static final Color COLOR_THREAD_TEXT_FG = Colors.WHITE;
/** Background color to be used to draw a the text for a thread */
public static final Color COLOR_THREAD_TEXT_BG = Colors.BLACK; public static final Color COLOR_THREAD_TEXT_BG = Colors.BLACK;
/** Color to be used to draw a the text for a core */ /** Color to be used to draw a the text for a core */
public static final Color COLOR_CORE_TEXT_FG = Colors.WHITE; public static final Color COLOR_CORE_TEXT_FG = Colors.WHITE;
public static final Color COLOR_CORE_TEXT_BG = Colors.BLACK; public static final Color COLOR_CORE_TEXT_BG = Colors.BLACK;
/** Color to be used to draw the load text /** Color to be used to draw the load text */
* @since 1.1
*/
public static final Color COLOR_LOAD_TEXT = Colors.GREEN; public static final Color COLOR_LOAD_TEXT = Colors.GREEN;
/** Color used to draw text to the status bar */ /** Color used to draw text to the status bar */
@ -81,20 +76,12 @@ public class IMulticoreVisualizerConstants
// Colors for load meters // Colors for load meters
/** /** Color used to draw the bar representing load, under normal load */
* @since 1.1
*/
public static final Color COLOR_LOAD_LOADBAR_NORMAL = Colors.GREEN; public static final Color COLOR_LOAD_LOADBAR_NORMAL = Colors.GREEN;
/** /** Color used to draw the bar representing load, under high load */
* @since 1.1
*/
public static final Color COLOR_LOAD_LOADBAR_OVERLOAD = Colors.RED; public static final Color COLOR_LOAD_LOADBAR_OVERLOAD = Colors.RED;
/** /** Color used to draw the load meter foreground */
* @since 1.1
*/
public static final Color COLOR_LOAD_UNDERBAR_FG = Colors.getColor(0,200,0); public static final Color COLOR_LOAD_UNDERBAR_FG = Colors.getColor(0,200,0);
/** /** Color used to draw the load meter background */
* @since 1.1
*/
public static final Color COLOR_LOAD_UNDERBAR_BG_DEFAULT = Colors.getColor(0,64,0); public static final Color COLOR_LOAD_UNDERBAR_BG_DEFAULT = Colors.getColor(0,64,0);
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2012 IBM Corporation and others. * Copyright (c) 2012, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -12,9 +12,6 @@ package org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.view;
import org.eclipse.osgi.util.NLS; import org.eclipse.osgi.util.NLS;
/**
* @since 1.1
*/
public class Messages extends NLS { public class Messages extends NLS {
public static String MulticoreVisualizer_name; public static String MulticoreVisualizer_name;
public static String MulticoreVisualizer_tooltip; public static String MulticoreVisualizer_tooltip;

View file

@ -132,33 +132,24 @@ public class MulticoreVisualizer extends GraphicCanvasVisualizer
// contexts, each time the model is recreated. This way // contexts, each time the model is recreated. This way
// we can avoid asking the backend for the CPU/core // we can avoid asking the backend for the CPU/core
// geometry each time we want to update the load information. // geometry each time we want to update the load information.
/**
* @since 1.1
*/
protected ICPUDMContext[] m_cpuContextsCache = null; protected ICPUDMContext[] m_cpuContextsCache = null;
/**
* @since 1.1
*/
protected ICoreDMContext[] m_coreContextsCache = null; protected ICoreDMContext[] m_coreContextsCache = null;
/** /** Main switch that determines if we should display the load meters */
* Main switch that determines if we should display the load meters
* @since 1.1
*/
protected boolean m_loadMetersEnabled = false; protected boolean m_loadMetersEnabled = false;
/** /** Timer used to trigger the update of the CPU/core load meters */
* Timer used to trigger the update of the CPU/core load meters
* @since 1.1
*/
protected Timer m_updateLoadMeterTimer = null; protected Timer m_updateLoadMeterTimer = null;
/** /** update period for the load meters */
* @since 1.1
*/
protected int m_loadMeterTimerPeriod = LOAD_METER_TIMER_MEDIUM; // default 1000ms protected int m_loadMeterTimerPeriod = LOAD_METER_TIMER_MEDIUM; // default 1000ms
// Load meters refresh periods, in ms // Load meters refresh periods, in ms
/** constant for the very short load meters update period */
private static final int LOAD_METER_TIMER_MIN = 100; private static final int LOAD_METER_TIMER_MIN = 100;
/** constant for the short load meters update period */
private static final int LOAD_METER_TIMER_FAST = 500; private static final int LOAD_METER_TIMER_FAST = 500;
/** constant for the medium load meters update period */
private static final int LOAD_METER_TIMER_MEDIUM = 1000; private static final int LOAD_METER_TIMER_MEDIUM = 1000;
/** constant for the long load meters update period */
private static final int LOAD_METER_TIMER_SLOW = 5000; private static final int LOAD_METER_TIMER_SLOW = 5000;
/** Currently pinned session id, if any */ /** Currently pinned session id, if any */
@ -202,6 +193,7 @@ public class MulticoreVisualizer extends GraphicCanvasVisualizer
/** Sub-menu */ /** Sub-menu */
IMenuManager m_loadMetersSubMenu = null; IMenuManager m_loadMetersSubMenu = null;
/** Sub-sub menu */ /** Sub-sub menu */
IMenuManager m_loadMetersRefreshSubSubmenu = null; IMenuManager m_loadMetersRefreshSubSubmenu = null;
@ -248,7 +240,7 @@ public class MulticoreVisualizer extends GraphicCanvasVisualizer
} }
/** /**
* @since 1.1 * Sets-up the timer associated to load meters refresh
*/ */
protected void initializeLoadMeterTimer() { protected void initializeLoadMeterTimer() {
if (!m_loadMetersEnabled) return; if (!m_loadMetersEnabled) return;
@ -258,7 +250,7 @@ public class MulticoreVisualizer extends GraphicCanvasVisualizer
} }
/** /**
* @since 1.1 * disposes of the load meter timer
*/ */
protected void disposeLoadMeterTimer() { protected void disposeLoadMeterTimer() {
if(m_updateLoadMeterTimer != null) { if(m_updateLoadMeterTimer != null) {
@ -297,7 +289,7 @@ public class MulticoreVisualizer extends GraphicCanvasVisualizer
} }
/** /**
* @since 1.1 * takes care of the details of changing the load meter timer period
*/ */
public void setLoadMeterTimerPeriod(int p) { public void setLoadMeterTimerPeriod(int p) {
assert (p > LOAD_METER_TIMER_MIN); assert (p > LOAD_METER_TIMER_MIN);
@ -308,7 +300,7 @@ public class MulticoreVisualizer extends GraphicCanvasVisualizer
} }
/** /**
* @since 1.1 * enables or disables the load meters
*/ */
public void setLoadMetersEnabled(boolean enabled) { public void setLoadMetersEnabled(boolean enabled) {
if (m_loadMetersEnabled == enabled) return; if (m_loadMetersEnabled == enabled) return;
@ -555,7 +547,6 @@ public class MulticoreVisualizer extends GraphicCanvasVisualizer
m_refreshAction = null; m_refreshAction = null;
} }
if (m_loadMetersSubMenu != null) { if (m_loadMetersSubMenu != null) {
m_loadMetersSubMenu.dispose(); m_loadMetersSubMenu.dispose();
m_loadMetersSubMenu = null; m_loadMetersSubMenu = null;
@ -635,7 +626,6 @@ public class MulticoreVisualizer extends GraphicCanvasVisualizer
createActions(); createActions();
// TODO: Anything we want to hide on the toolbar menu? // TODO: Anything we want to hide on the toolbar menu?
updateActions(); updateActions();
} }
@ -1203,7 +1193,6 @@ public class MulticoreVisualizer extends GraphicCanvasVisualizer
// Collect thread data // Collect thread data
DSFDebugModel.getThreadData(m_sessionState, cpuContext, coreContext, execContext, this, model); DSFDebugModel.getThreadData(m_sessionState, cpuContext, coreContext, execContext, this, model);
} }
} }
// keep track of cores visited // keep track of cores visited
@ -1277,9 +1266,7 @@ public class MulticoreVisualizer extends GraphicCanvasVisualizer
} }
/** /** Updates the loads for all cpus and cores */
* @since 1.1
*/
@ConfinedToDsfExecutor("getSession().getExecutor()") @ConfinedToDsfExecutor("getSession().getExecutor()")
@Override @Override
public void updateLoads() { public void updateLoads() {
@ -1309,9 +1296,7 @@ public class MulticoreVisualizer extends GraphicCanvasVisualizer
} }
} }
/** /** Invoked when a getLoad() request completes. */
* Invoked when a getLoad() request completes.
* @since 1.1*/
@Override @Override
@ConfinedToDsfExecutor("getSession().getExecutor()") @ConfinedToDsfExecutor("getSession().getExecutor()")
public void getLoadDone(IDMContext context, ILoadInfo load, Object arg) public void getLoadDone(IDMContext context, ILoadInfo load, Object arg)

View file

@ -34,20 +34,13 @@ public class MulticoreVisualizerCPU extends MulticoreVisualizerGraphicObject
/** Child cores. */ /** Child cores. */
protected ArrayList<MulticoreVisualizerCore> m_cores; protected ArrayList<MulticoreVisualizerCore> m_cores;
/** /** Load meter associated to this CPU */
* Load meter associated to this CPU
* @since 1.1
*/
protected MulticoreVisualizerLoadMeter m_loadMeter; protected MulticoreVisualizerLoadMeter m_loadMeter;
/** /** Background color used to draw cpu */
* @since 1.1
*/
protected static final Color BG_COLOR = IMulticoreVisualizerConstants.COLOR_CPU_BG; protected static final Color BG_COLOR = IMulticoreVisualizerConstants.COLOR_CPU_BG;
/** /** Foreground coloe used to draw cpu */
* @since 1.1
*/
protected static final Color FG_COLOR = IMulticoreVisualizerConstants.COLOR_CPU_FG; protected static final Color FG_COLOR = IMulticoreVisualizerConstants.COLOR_CPU_FG;
@ -101,16 +94,12 @@ public class MulticoreVisualizerCPU extends MulticoreVisualizerGraphicObject
return m_cores; return m_cores;
} }
/** /** Sets the load meter associated to this CPU */
* @since 1.1
*/
public void setLoadMeter (MulticoreVisualizerLoadMeter meter) { public void setLoadMeter (MulticoreVisualizerLoadMeter meter) {
m_loadMeter = meter; m_loadMeter = meter;
} }
/** /** Gets the load meter associated to this CPU */
* @since 1.1
*/
public MulticoreVisualizerLoadMeter getLoadMeter() { public MulticoreVisualizerLoadMeter getLoadMeter() {
return m_loadMeter; return m_loadMeter;
} }

View file

@ -76,20 +76,13 @@ public class MulticoreVisualizerCanvas extends GraphicCanvas
/** Whether we need to recache graphic objects. */ /** Whether we need to recache graphic objects. */
protected boolean m_recache = true; protected boolean m_recache = true;
/** /** Whether we need to recache objects that depend on target state */
* Whether we need to recache objects that depend on target state.
*/
protected boolean m_recacheState = true; protected boolean m_recacheState = true;
/** /** Whether view size has changed, requiring us to recalculate object sizes */
* Whether view size has changed, requiring us to recalculate object sizes.
*/
protected boolean m_recacheSizes = true; protected boolean m_recacheSizes = true;
/** /** Whether the load information has changed and we need to update the load meters */
* Whether the load information has changed and we need to update the load meters
* @since 1.1
*/
protected boolean m_recacheLoadMeters = true; protected boolean m_recacheLoadMeters = true;
/** Whether we need to repaint the canvas */ /** Whether we need to repaint the canvas */
@ -327,10 +320,7 @@ public class MulticoreVisualizerCanvas extends GraphicCanvas
requestUpdate(); requestUpdate();
} }
/** /** Requests that next paint call should update the load meters */
* only update the load meters
* @since 1.1
*/
public void refreshLoadMeters() { public void refreshLoadMeters() {
requestRecache(false, false, true); requestRecache(false, false, true);
} }
@ -377,8 +367,7 @@ public class MulticoreVisualizerCanvas extends GraphicCanvas
} }
/** /**
* Requests that the next paing call should recache state and/or size and/or load information * Requests that the next paint call should recache state and/or size and/or load information
* @since 1.1
*/ */
// 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 requestRecache(boolean state, boolean sizes, boolean load) { public synchronized void requestRecache(boolean state, boolean sizes, boolean load) {
@ -393,9 +382,11 @@ public class MulticoreVisualizerCanvas extends GraphicCanvas
m_canvasFilterManager.updateCurrentFilter(); m_canvasFilterManager.updateCurrentFilter();
} }
/** Fits n square items into a rectangle of the specified size. /**
* Fits n square items into a rectangle of the specified size.
* Returns largest edge of one of the square items that allows * Returns largest edge of one of the square items that allows
* them all to pack neatly in rows/columns in the specified area. */ * them all to pack neatly in rows/columns in the specified area.
*/
public int fitSquareItems(int nitems, int width, int height) { public int fitSquareItems(int nitems, int width, int height) {
int max_edge = 0; int max_edge = 0;
if (width > height) { if (width > height) {
@ -439,14 +430,8 @@ public class MulticoreVisualizerCanvas extends GraphicCanvas
m_coreMap.clear(); m_coreMap.clear();
m_threadMap.clear(); m_threadMap.clear();
// For debugging purposes only, allows us to force a CPU count.
//int cpu_count = 0;
//int force_cpu_count = 2;
if (m_model != null) { if (m_model != null) {
for (VisualizerCPU cpu : m_model.getCPUs()) { for (VisualizerCPU cpu : m_model.getCPUs()) {
//if (force_cpu_count >= cpu_count) break;
//cpu_count++;
// current filter permits displaying this CPU? // current filter permits displaying this CPU?
if (m_canvasFilterManager.displayObject(cpu)) { if (m_canvasFilterManager.displayObject(cpu)) {
MulticoreVisualizerCPU mcpu = new MulticoreVisualizerCPU(cpu.getID()); MulticoreVisualizerCPU mcpu = new MulticoreVisualizerCPU(cpu.getID());
@ -463,13 +448,6 @@ public class MulticoreVisualizerCanvas extends GraphicCanvas
} }
} }
} }
/*
while (cpu_count < force_cpu_count) {
MulticoreVisualizerCPU mcpu = new MulticoreVisualizerCPU(cpu_count);
m_cpus.add(mcpu);
cpu_count++;
}
*/
// we've recached state, which implies recacheing sizes and load meters // we've recached state, which implies recacheing sizes and load meters
m_recacheState = false; m_recacheState = false;
@ -549,7 +527,10 @@ public class MulticoreVisualizerCanvas extends GraphicCanvas
int height = bounds.height + cpu_separation - statusBarHeight; int height = bounds.height + cpu_separation - statusBarHeight;
// put status bar at the bottom of the canvas area // put status bar at the bottom of the canvas area
m_statusBar.setBounds(cpu_margin, bounds.y + bounds.height - 2 * cpu_margin , width , statusBarHeight); m_statusBar.setBounds(cpu_margin,
bounds.y + bounds.height - 2 * cpu_margin,
width ,
statusBarHeight);
int cpu_edge = fitSquareItems(ncpus, width, height); int cpu_edge = fitSquareItems(ncpus, width, height);
int cpu_size = cpu_edge - cpu_separation; int cpu_size = cpu_edge - cpu_separation;
@ -577,7 +558,10 @@ public class MulticoreVisualizerCanvas extends GraphicCanvas
for (MulticoreVisualizerCPU cpu : m_cpus) { for (MulticoreVisualizerCPU cpu : m_cpus) {
cpu.setBounds(x, y, cpu_size-1, cpu_size-1); cpu.setBounds(x, y, cpu_size-1, cpu_size-1);
// put cpu meter in the right margin of the CPU // put cpu meter in the right margin of the CPU
cpu.getLoadMeter().setBounds(x + cpu_size - 2*cpu_margin, y + 2*core_margin, loadMeterWidth, cpu_size-3*core_margin); cpu.getLoadMeter().setBounds(x + cpu_size - 2*cpu_margin,
y + 2*core_margin,
loadMeterWidth,
cpu_size-3*core_margin);
int left = x + core_margin; int left = x + core_margin;
int cx = left, cy = y + core_margin; int cx = left, cy = y + core_margin;

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2013 Ericsson * Copyright (c) 2013, 2014 Ericsson and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -31,41 +31,59 @@ import org.eclipse.jface.viewers.ISelection;
*/ */
public class MulticoreVisualizerCanvasFilter { public class MulticoreVisualizerCanvasFilter {
/** The white list */ /** white list of objects on which the filter is based */
List<IVisualizerModelObject> m_filterList = null; List<IVisualizerModelObject> m_filterList = null;
/** the dynamically expanded list, containing elements in the */
/** white list and their parents - recalculated as required */ /**
/** since some elements can move around and change parent */ * the dynamically expanded list, containing elements in the
* white list and their parents - recalculated as required
* since some elements can move around and change parent
*/
List<IVisualizerModelObject> m_dynamicFilterList = null; List<IVisualizerModelObject> m_dynamicFilterList = null;
/** reference to the canvas */ /** reference to the canvas */
private MulticoreVisualizerCanvas m_canvas = null; private MulticoreVisualizerCanvas m_canvas = null;
/** is the filter is active/set */ /** whether the filter is active */
private boolean m_filterActive = false; private boolean m_filterActive = false;
/** for stats */ /** counter that reflects the number of CPUs shown once the filter is applied */
private int m_shownCpu = 0; private int m_shownCpu = 0;
/** for stats */
/** counter that reflects the number of cores shown once the filter is applied */
private int m_shownCore = 0; private int m_shownCore = 0;
/** for stats */
/** counter that reflects the number of threads shown once the filter is applied */
private int m_shownThread = 0; private int m_shownThread = 0;
/** for stats */
/** total number of CPUs in the current MV model */
private int m_totalCpu = 0; private int m_totalCpu = 0;
/** for stats */
/** total number of cores in the current MV model */
private int m_totalCore = 0; private int m_totalCore = 0;
/** for stats */
/** total number of threads in the current MV model */
private int m_totalThread = 0; private int m_totalThread = 0;
/** String constant used in this class */ /** String constant used to denote that the filter is not active */
private static final String STR_FILTER_NOT_ACTIVE = MulticoreVisualizerUIPlugin.getString("MulticoreVisualizer.view.CanvasFilter.NotActive.text"); //$NON-NLS-1$ private static final String STR_FILTER_NOT_ACTIVE =
/** String constant used in this class */ MulticoreVisualizerUIPlugin.getString("MulticoreVisualizer.view.CanvasFilter.NotActive.text"); //$NON-NLS-1$
private static final String STR_FILTER_ACTIVE = MulticoreVisualizerUIPlugin.getString("MulticoreVisualizer.view.CanvasFilter.Active.text"); //$NON-NLS-1$
/** String constant used in this class */ /** String constant used to denote that the filter is active */
private static final String STR_CPU = MulticoreVisualizerUIPlugin.getString("MulticoreVisualizer.view.CanvasFilter.cpu.text"); //$NON-NLS-1$ private static final String STR_FILTER_ACTIVE =
/** String constant used in this class */ MulticoreVisualizerUIPlugin.getString("MulticoreVisualizer.view.CanvasFilter.Active.text"); //$NON-NLS-1$
private static final String STR_CORE = MulticoreVisualizerUIPlugin.getString("MulticoreVisualizer.view.CanvasFilter.core.text"); //$NON-NLS-1$
/** String constant used in this class */ /** String constant used to represent CPUs */
private static final String STR_THREAD = MulticoreVisualizerUIPlugin.getString("MulticoreVisualizer.view.CanvasFilter.thread.text"); //$NON-NLS-1$ private static final String STR_CPU =
MulticoreVisualizerUIPlugin.getString("MulticoreVisualizer.view.CanvasFilter.cpu.text"); //$NON-NLS-1$
/** String constant used to represent cores */
private static final String STR_CORE =
MulticoreVisualizerUIPlugin.getString("MulticoreVisualizer.view.CanvasFilter.core.text"); //$NON-NLS-1$
/** String constant used to represent threads */
private static final String STR_THREAD =
MulticoreVisualizerUIPlugin.getString("MulticoreVisualizer.view.CanvasFilter.thread.text"); //$NON-NLS-1$
// --- constructors/destructors --- // --- constructors/destructors ---
@ -84,8 +102,8 @@ public class MulticoreVisualizerCanvasFilter {
// --- filter methods --- // --- filter methods ---
/** /**
* Set-up a canvas white-list filter. Any applicable selected object is added to * Sets-up a canvas white-list filter from the current canvas selection.
* the filter. * Any applicable selected objects are added to the filter.
*/ */
public void applyFilter() { public void applyFilter() {
// replace current filter? Clear old one first. // replace current filter? Clear old one first.
@ -125,14 +143,13 @@ public class MulticoreVisualizerCanvasFilter {
} }
/** tells if a canvas filter is currently in place */ /** returns whether a canvas filter is currently in place */
public boolean isFilterActive() { public boolean isFilterActive() {
return m_filterActive; return m_filterActive;
} }
/** /**
* Updates the filter to contain the up-to-date parent objects, * Updates the dynamic filter so it contains the up-to-date parent objects
* for all filter objects.
*/ */
public void updateFilter() { public void updateFilter() {
if (m_filterList == null || m_canvas == null) if (m_filterList == null || m_canvas == null)
@ -169,8 +186,8 @@ public class MulticoreVisualizerCanvasFilter {
} }
/** /**
* Tells if a candidate model object should be displayed, according to the * returns whether a candidate model object should be displayed,
* filter in place. * according to the current filter.
*/ */
public boolean displayObject(final IVisualizerModelObject candidate) { public boolean displayObject(final IVisualizerModelObject candidate) {
// filter not active? Let anything be displayed // filter not active? Let anything be displayed
@ -191,7 +208,7 @@ public class MulticoreVisualizerCanvasFilter {
/** /**
* Adds an element to the dynamic filter list, if an equivalent * Adds an element to the dynamic filter list, if an equivalent
* element is not already there. * element is not already in there.
*/ */
private void addElementToFilterList(final IVisualizerModelObject elem) { private void addElementToFilterList(final IVisualizerModelObject elem) {
if (!isElementInFilterList(elem)) { if (!isElementInFilterList(elem)) {
@ -201,7 +218,7 @@ public class MulticoreVisualizerCanvasFilter {
} }
/** /**
* Checks if an element already has an equivalent in the * Returns whether an element already has an equivalent in the
* dynamic filter list. * dynamic filter list.
*/ */
private boolean isElementInFilterList(final IVisualizerModelObject candidate) { private boolean isElementInFilterList(final IVisualizerModelObject candidate) {
@ -216,7 +233,9 @@ public class MulticoreVisualizerCanvasFilter {
} }
/** Used to check if model elements in the filter still exist in the current model. */ /** returns whether a model object currently in the filter still exists in
* the current model.
*/
private boolean isElementInCurrentModel(IVisualizerModelObject element) { private boolean isElementInCurrentModel(IVisualizerModelObject element) {
VisualizerModel model = m_canvas.getModel(); VisualizerModel model = m_canvas.getModel();
if (model != null) { if (model != null) {
@ -254,8 +273,7 @@ public class MulticoreVisualizerCanvasFilter {
// --- Stats counters --- // --- Stats counters ---
/** /**
* Used to step the filtered counters for a given type of * Steps the filter counters for a given type of model object.
* model object.
*/ */
private void stepStatsCounter(IVisualizerModelObject modelObj) { private void stepStatsCounter(IVisualizerModelObject modelObj) {
if (modelObj instanceof VisualizerCPU) { if (modelObj instanceof VisualizerCPU) {
@ -269,7 +287,7 @@ public class MulticoreVisualizerCanvasFilter {
} }
} }
/** Reset the filtering counters */ /** Resets the filter counters */
private void resetCounters() { private void resetCounters() {
m_shownCpu = 0; m_shownCpu = 0;
m_shownCore = 0; m_shownCore = 0;
@ -286,10 +304,8 @@ public class MulticoreVisualizerCanvasFilter {
} }
/** returns a String giving the current filtering stats */ /** returns a String giving the current filtering stats */
private String getStats() { private String getStats() {
return STR_FILTER_ACTIVE + " " + STR_CPU + " " + m_shownCpu + "/" + m_totalCpu + ", " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ return STR_FILTER_ACTIVE + " " + STR_CPU + " " + m_shownCpu + "/" + m_totalCpu + ", " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
STR_CORE + " " + m_shownCore + "/" + m_totalCore + ", " + //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-1$ STR_CORE + " " + m_shownCore + "/" + m_totalCore + ", " + //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-1$
STR_THREAD + " " + m_shownThread + "/" + m_totalThread; //$NON-NLS-1$//$NON-NLS-2$ STR_THREAD + " " + m_shownThread + "/" + m_totalThread; //$NON-NLS-1$//$NON-NLS-2$

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2013 Ericsson * Copyright (c) 2013, 2014 Ericsson and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -57,8 +57,8 @@ public class MulticoreVisualizerCanvasFilterManager implements SessionEndedListe
} }
/** /**
* Returns existing filter for a given debug session or creates a new * Returns the filter for a given debug session if it exists, or else
* filter if it doesn't exist yet. * creates a new filter for that session.
*/ */
public MulticoreVisualizerCanvasFilter getFilter(String sessionId) { public MulticoreVisualizerCanvasFilter getFilter(String sessionId) {
MulticoreVisualizerCanvasFilter filter = null; MulticoreVisualizerCanvasFilter filter = null;
@ -82,28 +82,28 @@ public class MulticoreVisualizerCanvasFilterManager implements SessionEndedListe
} }
} }
/** Re-computes the current filter to reflect latest model changes */ /** Re-computes the current filter to reflect latest model changes */
public void updateCurrentFilter() { public void updateCurrentFilter() {
if( m_currentFilter != null) { if( m_currentFilter != null) {
m_currentFilter.updateFilter(); m_currentFilter.updateFilter();
} }
} }
/** Sets-up a filter, based on the current canvas selection */ /** Sets-up a filter, based on the current canvas selection */
public void applyFilter() { public void applyFilter() {
if( m_currentFilter != null) { if( m_currentFilter != null) {
m_currentFilter.applyFilter(); m_currentFilter.applyFilter();
} }
} }
/** Clears the current filter */ /** Clears the current filter */
public void clearFilter() { public void clearFilter() {
if( m_currentFilter != null) { if( m_currentFilter != null) {
m_currentFilter.clearFilter(); m_currentFilter.clearFilter();
} }
} }
/** Sets the current filter for a given model/session */ /** Sets the current filter for a given model/session */
public void setCurrentFilter(String sessionId) { public void setCurrentFilter(String sessionId) {
if (sessionId == null) { if (sessionId == null) {
m_currentFilter = null; m_currentFilter = null;
@ -113,12 +113,12 @@ public class MulticoreVisualizerCanvasFilterManager implements SessionEndedListe
} }
} }
/** Returns the current filter */ /** Returns the current filter */
public MulticoreVisualizerCanvasFilter getCurrentFilter() { public MulticoreVisualizerCanvasFilter getCurrentFilter() {
return m_currentFilter; return m_currentFilter;
} }
/** Checks if the current filter is active */ /** Checks if the current filter is active */
public boolean isCurrentFilterActive() { public boolean isCurrentFilterActive() {
if( m_currentFilter != null) { if( m_currentFilter != null) {
return m_currentFilter.isFilterActive(); return m_currentFilter.isFilterActive();
@ -126,7 +126,7 @@ public class MulticoreVisualizerCanvasFilterManager implements SessionEndedListe
return false; return false;
} }
/** Checks if the current filter permits the display of an object */ /** Checks if the current filter permits the display of an object */
public boolean displayObject(final IVisualizerModelObject obj) { public boolean displayObject(final IVisualizerModelObject obj) {
if( m_currentFilter != null) { if( m_currentFilter != null) {
return m_currentFilter.displayObject(obj); return m_currentFilter.displayObject(obj);
@ -136,6 +136,7 @@ public class MulticoreVisualizerCanvasFilterManager implements SessionEndedListe
@Override @Override
public void sessionEnded(DsfSession session) { public void sessionEnded(DsfSession session) {
// session has ended - remove corresponding filter
removeFilter(session.getId()); removeFilter(session.getId());
} }
} }

View file

@ -39,10 +39,7 @@ public class MulticoreVisualizerCore extends MulticoreVisualizerGraphicObject
/** List of threads currently on this core. */ /** List of threads currently on this core. */
protected ArrayList<MulticoreVisualizerThread> m_threads; protected ArrayList<MulticoreVisualizerThread> m_threads;
/** /** Load meter associated to this core */
* Load meter associated to this core
* @since 1.1
*/
protected MulticoreVisualizerLoadMeter m_loadMeter; protected MulticoreVisualizerLoadMeter m_loadMeter;
// --- constructors/destructors --- // --- constructors/destructors ---
@ -111,16 +108,12 @@ public class MulticoreVisualizerCore extends MulticoreVisualizerGraphicObject
return m_threads; return m_threads;
} }
/** /** Sets the load meter associated to this core */
* @since 1.1
*/
public void setLoadMeter (MulticoreVisualizerLoadMeter meter) { public void setLoadMeter (MulticoreVisualizerLoadMeter meter) {
m_loadMeter = meter; m_loadMeter = meter;
} }
/** /** Gets the load meter associated to this core */
* @since 1.1
*/
public MulticoreVisualizerLoadMeter getLoadMeter() { public MulticoreVisualizerLoadMeter getLoadMeter() {
return m_loadMeter; return m_loadMeter;
} }

View file

@ -19,7 +19,7 @@ import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.graphics.Rectangle;
/** /**
* @since 1.1 * Load meter graphic object
*/ */
public class MulticoreVisualizerLoadMeter extends MulticoreVisualizerGraphicObject { public class MulticoreVisualizerLoadMeter extends MulticoreVisualizerGraphicObject {
@ -53,7 +53,6 @@ public class MulticoreVisualizerLoadMeter extends MulticoreVisualizerGraphicObje
// --- constructors/destructors --- // --- constructors/destructors ---
/** Constructor */ /** Constructor */
public MulticoreVisualizerLoadMeter(Integer load) { public MulticoreVisualizerLoadMeter(Integer load) {
m_currentLoad = load; m_currentLoad = load;
} }
@ -73,14 +72,17 @@ public class MulticoreVisualizerLoadMeter extends MulticoreVisualizerGraphicObje
// --- accessors --- // --- accessors ---
public void setEnabled (boolean enabled) { /** Sets whether the load meter is enabled */
public void setEnabled(boolean enabled) {
m_enabled = enabled; m_enabled = enabled;
} }
/** Gets whether the load meter is enabled */
public boolean getEnabled() { public boolean getEnabled() {
return m_enabled; return m_enabled;
} }
/** Sets the load associated to this load meter */
public void setLoad(Integer load) { public void setLoad(Integer load) {
m_currentLoad = load; m_currentLoad = load;
} }
@ -106,6 +108,7 @@ public class MulticoreVisualizerLoadMeter extends MulticoreVisualizerGraphicObje
m_highLoadWatermark = wm; m_highLoadWatermark = wm;
} }
/** Sets the load value over which the load is considered overload */
public void setOverloadThreshold (int t) { public void setOverloadThreshold (int t) {
m_overloadThreshold = t; m_overloadThreshold = t;
} }
@ -122,7 +125,6 @@ public class MulticoreVisualizerLoadMeter extends MulticoreVisualizerGraphicObje
/** get a color that corresponds to the current load */ /** get a color that corresponds to the current load */
private Color getLoadColor() { private Color getLoadColor() {
if (getLoad() < m_overloadThreshold) { if (getLoad() < m_overloadThreshold) {
return IMulticoreVisualizerConstants.COLOR_LOAD_LOADBAR_NORMAL; return IMulticoreVisualizerConstants.COLOR_LOAD_LOADBAR_NORMAL;
} }

View file

@ -14,6 +14,7 @@ package org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.view;
import org.eclipse.cdt.visualizer.ui.util.GUIUtils; import org.eclipse.cdt.visualizer.ui.util.GUIUtils;
import org.eclipse.swt.graphics.GC; import org.eclipse.swt.graphics.GC;
/** Status bar graphic object */
public class MulticoreVisualizerStatusBar extends MulticoreVisualizerGraphicObject { public class MulticoreVisualizerStatusBar extends MulticoreVisualizerGraphicObject {
// --- members --- // --- members ---

View file

@ -92,8 +92,7 @@ public class DSFDebugModel {
} }
/** Request load information for a single CPU or core /** Request load information for a single CPU or core */
* @since 1.1*/
@ConfinedToDsfExecutor("getSession().getExecutor()") @ConfinedToDsfExecutor("getSession().getExecutor()")
public static void getLoad(DSFSessionState sessionState, public static void getLoad(DSFSessionState sessionState,
final IDMContext context, final IDMContext context,
@ -357,8 +356,8 @@ public class DSFDebugModel {
} }
} }
// For a suspended thread, let's see why it is suspended, /** For a suspended thread, let's see why it is suspended,
// to find out if the thread is crashed * to find out if the thread is crashed */
private static void getThreadSuspendReason(DSFSessionState sessionState, private static void getThreadSuspendReason(DSFSessionState sessionState,
final ICPUDMContext cpuContext, final ICPUDMContext cpuContext,
final ICoreDMContext coreContext, final ICoreDMContext coreContext,
@ -414,15 +413,11 @@ public class DSFDebugModel {
return false; return false;
} }
/** /** Creates and returns a timer that refreshes the load meters */
* Creates and returns a timer that refreshes the load meters
* @since 1.1
*/
public static Timer getLoadTimer(final DSFSessionState sessionState, public static Timer getLoadTimer(final DSFSessionState sessionState,
final int timeout, final int timeout,
final DSFDebugModelListener listener) final DSFDebugModelListener listener)
{ {
Timer t = new Timer(timeout) { Timer t = new Timer(timeout) {
@Override @Override
public void run() { public void run() {

View file

@ -70,16 +70,10 @@ public interface DSFDebugModelListener {
VisualizerExecutionState state, VisualizerExecutionState state,
Object arg); Object arg);
/** /** Invoked when getLoad() request completes. */
* Invoked when getLoad() request completes.
* @since 1.1
*/
public void getLoadDone(IDMContext context, ILoadInfo loads, Object arg); public void getLoadDone(IDMContext context, ILoadInfo loads, Object arg);
/** /** Invoked when the load timer triggers. */
* Invoked when the load timer triggers
* @since 1.1
*/
public void updateLoads(); public void updateLoads();
} }