Search in sources :

Example 1 with SettingView

use of com.tencent.wstt.apt.ui.views.SettingView in project GT by Tencent.

the class GetCurCheckedStateUtil method update.

/**
	* @Description 按照设置和设备视图中的更改更新CPU和内存视图中的曲线 
	* @param    
	* @return void 
	* @throws
	 */
public static void update() {
    SettingView settingViewPart = (SettingView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(SettingView.ID);
    DevicesView deviceViewPart = (DevicesView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(DevicesView.ID);
    CPUView cpuViewPart = (CPUView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(CPUView.ID);
    MemoryView memViewPart = (MemoryView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(MemoryView.ID);
    if (deviceViewPart == null || settingViewPart == null) {
        return;
    }
    boolean[] pkgCheckeds = deviceViewPart.getPkgChecked();
    if (cpuViewPart != null) {
        for (int i = 0; i < pkgCheckeds.length; i++) {
            cpuViewPart.cpuRealTimeChart.setTimeSeriesEnable(i, 0, pkgCheckeds[i]);
        }
        //当启动APT后,直接打开log,此时tableviewfilter为空
        if (cpuViewPart.cpuTableFilter != null) {
            ((TableViewFilter) cpuViewPart.cpuTableFilter).update(pkgCheckeds, new boolean[] { true });
            cpuViewPart.cpuViewer.refresh();
        }
        if (TestSence.getInstance().isTestJiffies) {
            if (cpuViewPart.jiffiesTableFilter != null) {
                ((TableViewFilter) cpuViewPart.jiffiesTableFilter).update(pkgCheckeds, new boolean[] { true });
                cpuViewPart.jiffiesViewer.refresh();
            }
        }
    }
    if (memViewPart != null) {
        boolean[] memStateCheckeds = settingViewPart.getMemChecked();
        //更新曲线
        for (int i = 0; i < pkgCheckeds.length; i++) {
            for (int j = 0; j < memStateCheckeds.length; j++) {
                memViewPart.memRealTimeChart.setTimeSeriesEnable(i, j, pkgCheckeds[i] && memStateCheckeds[j]);
            }
        }
        //更新统计表格
        if (memViewPart.tableFilter != null) {
            ((TableViewFilter) memViewPart.tableFilter).update(pkgCheckeds, memStateCheckeds);
            memViewPart.viewer.refresh();
        }
    }
}
Also used : MemoryView(com.tencent.wstt.apt.ui.views.MemoryView) SettingView(com.tencent.wstt.apt.ui.views.SettingView) CPUView(com.tencent.wstt.apt.ui.views.CPUView) DevicesView(com.tencent.wstt.apt.ui.views.DevicesView)

Example 2 with SettingView

use of com.tencent.wstt.apt.ui.views.SettingView in project GT by Tencent.

the class APTState method setUIEnable.

/**
	 * 设置UI控件是否可用;主要包括三类控件
	* @Title: setUIEnable  
	* @Description:   
	* @param isEnable 
	* void 
	* @throws
	 */
private boolean setUIEnable(boolean isEnable) {
    SettingView settingViewPart = (SettingView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(SettingView.ID);
    DevicesView deviceViewPart = (DevicesView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(DevicesView.ID);
    if (settingViewPart == null || deviceViewPart == null) {
        APTConsoleFactory.getInstance().APTPrint("setUIEnable:Setting或者Device视图对象为空");
        return false;
    }
    /**
		 * 测试开关和测试周期
		 */
    for (int i = 0; i < Constant.TEST_ITEM_COUNT; i++) {
        settingViewPart.itemTestSwitch[i].setEnabled(isEnable);
        settingViewPart.itemTestSwitchClose[i].setEnabled(isEnable);
        settingViewPart.itemTestPeriod[i].setEnabled(isEnable);
    }
    /**
		 * CPU测试方式和是否测试jiffies
		 */
    settingViewPart.cpuTestMethod.setEnabled(isEnable);
    settingViewPart.jiffiesSwitch.setEnabled(isEnable);
    settingViewPart.hprofDumpSwitch.setEnabled(isEnable);
    settingViewPart.hprofDumpThreshold.setEnabled(isEnable);
    /**
		 * 禁止进程列表增删操作,包括手动添加
		 */
    deviceViewPart.setAddAndDelOperEnable(isEnable);
    /**
		 * 其他三个按钮
		 */
    deviceViewPart.refreshAction.setEnabled(isEnable);
    deviceViewPart.openLogWithChartAction.setEnabled(isEnable);
    deviceViewPart.openResultDirAction.setEnabled(isEnable);
    return true;
}
Also used : SettingView(com.tencent.wstt.apt.ui.views.SettingView) DevicesView(com.tencent.wstt.apt.ui.views.DevicesView)

Example 3 with SettingView

use of com.tencent.wstt.apt.ui.views.SettingView in project GT by Tencent.

the class APTState method setCheckBoxsEnable.

/**
	 * 控制内存曲线、进程显示按钮是否可用
	* @Title: setCheckBoxsEnable  
	* @Description:   
	* @param isEnable 
	* void 
	* @throws
	 */
private boolean setCheckBoxsEnable(boolean isEnable) {
    SettingView settingViewPart = (SettingView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(SettingView.ID);
    DevicesView deviceViewPart = (DevicesView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(DevicesView.ID);
    if (settingViewPart == null || deviceViewPart == null) {
        APTConsoleFactory.getInstance().APTPrint("setCheckBoxsEnable:Setting或者Device视图对象为空");
        return false;
    }
    deviceViewPart.setCheckChangeEnable(isEnable);
    settingViewPart.setCheckChangeEnable(isEnable);
    return true;
}
Also used : SettingView(com.tencent.wstt.apt.ui.views.SettingView) DevicesView(com.tencent.wstt.apt.ui.views.DevicesView)

Example 4 with SettingView

use of com.tencent.wstt.apt.ui.views.SettingView in project GT by Tencent.

the class TestSenceUtil method update.

/**
	* @Description 获取当前的测试设置 
	* @param @return   
	* @return boolean 
	* @throws
	 */
public static boolean update() {
    DevicesView dvPart = (DevicesView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(DevicesView.ID);
    SettingView svPart = (SettingView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(SettingView.ID);
    if (dvPart == null || svPart == null) {
        return false;
    }
    /**
		 * 用这种方式获取测试参数的方式有很大的问题
		 * 比如用户设置完后,关闭了settings页面,然后点击开始测试
		 * 
		 * 理想的方式应该是用编辑器实现,页面背后对应一个xml文件进行存储
		 */
    dvPart.getTargetPkgInfoList();
    svPart.getTestArgs();
    return true;
}
Also used : SettingView(com.tencent.wstt.apt.ui.views.SettingView) DevicesView(com.tencent.wstt.apt.ui.views.DevicesView)

Aggregations

DevicesView (com.tencent.wstt.apt.ui.views.DevicesView)4 SettingView (com.tencent.wstt.apt.ui.views.SettingView)4 CPUView (com.tencent.wstt.apt.ui.views.CPUView)1 MemoryView (com.tencent.wstt.apt.ui.views.MemoryView)1