Exemple #1
0
int loadprojects()
{
	int i,j,resCode;
	char Tag[32] = "";
//	SetWindowText("打开项目");
	SetPanelAttribute(panel_open,ATTR_TITLE,"打开项目");
	SetCtrlAttribute(panel_open,OPPANEL_TREE_ProjectList,ATTR_LABEL_TEXT,"测试项目列表");
	ClearListCtrl(panel_open, OPPANEL_TREE_ProjectList);
	SetTreeColumnAttribute(panel_open,OPPANEL_TREE_ProjectList,0,ATTR_LABEL_TEXT,"测试项目名称");
	SetTreeColumnAttribute(panel_open,OPPANEL_TREE_ProjectList,1,ATTR_LABEL_TEXT,"项目创建日期");
	SetTreeColumnAttribute(panel_open,OPPANEL_TREE_ProjectList,2,ATTR_LABEL_TEXT,"项目创建时间");
	SetTreeColumnAttribute(panel_open,OPPANEL_TREE_ProjectList,3,ATTR_LABEL_TEXT,"已有测量组数");
	SetTreeColumnAttribute(panel_open,OPPANEL_TREE_ProjectList,0,ATTR_COLUMN_WIDTH,125);
	SetTreeColumnAttribute(panel_open,OPPANEL_TREE_ProjectList,1,ATTR_COLUMN_WIDTH,80);
	SetTreeColumnAttribute(panel_open,OPPANEL_TREE_ProjectList,2,ATTR_COLUMN_WIDTH,80);
	SetTreeColumnAttribute(panel_open,OPPANEL_TREE_ProjectList,3,ATTR_COLUMN_WIDTH,80);
	for (i = 0; i < projectlist.number; i++)
	{
		j = InsertTreeItem(panel_open,OPPANEL_TREE_ProjectList,VAL_SIBLING,i-1,VAL_LAST,projectlist.projects[i].TestTaskName,projectlist.projects[i].TestTaskName,Tag,i+1);
		resCode = SetTreeCellAttribute(panel_open,OPPANEL_TREE_ProjectList,j,1,ATTR_LABEL_TEXT,projectlist.projects[i].TestCreateDate.DateSTR);
		resCode = SetTreeCellAttribute(panel_open,OPPANEL_TREE_ProjectList,j,2,ATTR_LABEL_TEXT,projectlist.projects[i].TestCreateTime.TimeSTR);
		char buffer[BUFFERLEN] = "";
		sprintf(buffer,"%d",projectlist.projects[i].TestedGroupNumber);
		resCode = SetTreeCellAttribute(panel_open,OPPANEL_TREE_ProjectList,j,3,ATTR_LABEL_TEXT,buffer);
//		MessagePopup("",Tag);
	}
	state_open = 1;
	return 0;
}
Exemple #2
0
void TechTree::InsertTechs()
{
	const int Techs_Zerg[] = { 11, 16, 14, 17, 12, 32, 18, 15, 13 },
			  Techs_Terran[] = { 9, 6, 2, 34, 7, 1, 30, 10, 24, 4, 3, 0, 5, 8 },
			  Techs_Protoss[] = { 23, 28, 25, 29, 20, 31, 27, 19, 21, 22 },
			  Techs_Other[] = { 26, 33, 35, 36, 37, 38, 39, 40, 41, 42, 43 };

	const int* TreeTechs[] = { Techs_Zerg, Techs_Terran, Techs_Protoss, Techs_Other };
	const int nTreeTechs[] = { sizeof(Techs_Zerg)/sizeof(const int), sizeof(Techs_Terran)/sizeof(const int),
							   sizeof(Techs_Protoss)/sizeof(const int), sizeof(Techs_Other)/sizeof(const int) };
	const char* sTreeTechs[] = { "Zerg", "Terran", "Protoss", "Other" };

	for ( int i=0; i<sizeof(TreeTechs)/sizeof(const int*); i++ )
	{
		HTREEITEM LastGroup = InsertTreeItem(NULL, sTreeTechs[i], TREE_TYPE_CATEGORY|LAYER_UNITS);
		const int* techs = TreeTechs[i];
		for ( int j=0; j<nTreeTechs[i]; j++ )
		{
			u32 techId = techs[j];
			InsertTreeItem(LastGroup, techNames.at(techId).c_str(), TREE_TYPE_TECH|techId);
		}
	}
}
Exemple #3
0
int loadmeasuregroups()
{
	int i,j,resCode;
	char Tag[32], buffer[BUFFERLEN] = "";
//	SetWindowText("打开测量组");
	SetPanelAttribute(panel_open,ATTR_TITLE,"打开测量组");
	sprintf(buffer,"%s项目测量组列表",operatingproject.TestTaskName);
	SetCtrlAttribute(panel_open,OPPANEL_TREE_ProjectList,ATTR_LABEL_TEXT,buffer);
	ClearListCtrl(panel_open, OPPANEL_TREE_ProjectList);
	SetTreeColumnAttribute(panel_open,OPPANEL_TREE_ProjectList,0,ATTR_LABEL_TEXT,"测量组编号");
	SetTreeColumnAttribute(panel_open,OPPANEL_TREE_ProjectList,1,ATTR_LABEL_TEXT,"环境条件");
	SetTreeColumnAttribute(panel_open,OPPANEL_TREE_ProjectList,2,ATTR_LABEL_TEXT,"已执行/预设测量次数");
	SetTreeColumnAttribute(panel_open,OPPANEL_TREE_ProjectList,3,ATTR_LABEL_TEXT,"测量完成情况");
	SetTreeColumnAttribute(panel_open,OPPANEL_TREE_ProjectList,0,ATTR_COLUMN_WIDTH,120);
	SetTreeColumnAttribute(panel_open,OPPANEL_TREE_ProjectList,1,ATTR_COLUMN_WIDTH,90);
	SetTreeColumnAttribute(panel_open,OPPANEL_TREE_ProjectList,2,ATTR_COLUMN_WIDTH,120);
	SetTreeColumnAttribute(panel_open,OPPANEL_TREE_ProjectList,3,ATTR_COLUMN_WIDTH,80);
	for (i = 0; i < operatingproject.TestedGroupNumber; i++)
	{
		sprintf(buffer,"测量组%03d",i+1);
		j = InsertTreeItem(panel_open,OPPANEL_TREE_ProjectList,VAL_SIBLING,i-1,VAL_LAST,buffer,buffer,Tag,i+1);
		resCode = SetTreeCellAttribute(panel_open,OPPANEL_TREE_ProjectList,j,1,ATTR_LABEL_TEXT,operatingproject.MeasureGroups[i].Environment);
		sprintf(buffer,"%d / %d",operatingproject.MeasureGroups[i].MeasuredNumber,operatingproject.ParameterSetting.TestMeasurementsNumberEachGroup);
		resCode = SetTreeCellAttribute(panel_open,OPPANEL_TREE_ProjectList,j,2,ATTR_LABEL_TEXT,buffer);
		if (operatingproject.MeasureGroups[i].isMeasurementFinished == 0)
		{
			sprintf(buffer,"%s","未完成");
			resCode = SetTreeCellAttribute(panel_open,OPPANEL_TREE_ProjectList,j,3,ATTR_LABEL_TEXT,buffer);
			resCode = SetTreeCellAttribute(panel_open,OPPANEL_TREE_ProjectList,j,3,ATTR_LABEL_COLOR,VAL_RED);
		}
		else
		{
			sprintf(buffer,"%s","已完成");
			resCode = SetTreeCellAttribute(panel_open,OPPANEL_TREE_ProjectList,j,3,ATTR_LABEL_TEXT,buffer);
			resCode = SetTreeCellAttribute(panel_open,OPPANEL_TREE_ProjectList,j,3,ATTR_LABEL_COLOR,VAL_BLACK);
		}
//		MessagePopup("",Tag);
	}
	state_open = 2;
	return 0;
}
// 本体とプラグインの設定情報を読込み、ツリーに反映する
void ConfigFormUnit::LoadOptionTree() {
	tTVPCommandOptionList* options = TVPGetEngineCommandDesc();
	if( options ) {
		LoadPluginOptionDesc( options, L"\\", L"dll" );
		LoadPluginOptionDesc( options, L"\\", L"tpm" );
		LoadPluginOptionDesc( options, L"plugin\\", L"dll" );
		LoadPluginOptionDesc( options, L"plugin\\", L"tpm" );

		tTJSVariant val;
		HTREEITEM hFirst = NULL;
		// 有効なアイテム数をカウント
		tjs_uint itemcount = 0;
		tjs_uint count = options->Categories.size();
		for( tjs_uint i = 0; i < count; i++ ) {
			const tTVPCommandOptionCategory& category = options->Categories[i];
			tjs_uint optcount = category.Options.size();
			for( tjs_uint j = 0; j < optcount; j++ ) {
				if( category.Options[j].User ) itemcount++;
			}
		}
		TreeItems.resize(itemcount);

		tjs_uint itemidx = 0;
		for( tjs_uint i = 0; i < count; i++ ) {
			const tTVPCommandOptionCategory& category = options->Categories[i];
			tjs_uint optcount = category.Options.size();
			// まずはカテゴリに有効なアイテムがあるかチェックする
			bool hasitem = false;
			for( tjs_uint j = 0; j < optcount; j++ ) {
				if( category.Options[j].User ) {
					hasitem = true;
					break;
				}
			}
			if( hasitem == false ) continue;
			HTREEITEM hItem = InsertTreeItem( TVI_ROOT, category.Name );
			if( hFirst == NULL ) hFirst = hItem;
			for( tjs_uint j = 0; j < optcount; j++ ) {
				const tTVPCommandOption& option = category.Options[j];
				if( option.User ) {
					TreeItem& curitem = TreeItems[itemidx];
					curitem.Text = option.Caption;
					curitem.Parameter = option.Name;
					curitem.Description = std::wstring(L"-")+option.Name+std::wstring(L"\n")+option.Description;
					ConvertReturnCode( curitem.Description );
					tjs_uint valcount = option.Values.size();
					curitem.Select.resize( valcount );
					curitem.Defalut = -1;
					std::wstring argname( std::wstring(L"-") + option.Name );
					std::wstring selectvalue;
					if( TVPGetCommandLine( argname.c_str(), &val) ) {
						ttstr str(val);
						selectvalue.assign( str.c_str(), str.length() );
					}
					tjs_int selectindex = -1;
					for( tjs_uint k = 0; k < valcount; k++ ) {
						std::pair<std::wstring, std::wstring>& sel = curitem.Select[k];
						const tTVPCommandOptionsValue& val = option.Values[k];
						sel.first = val.Value;
						sel.second = val.Description;
						if( val.IsDefault ) {
							curitem.Defalut = k;
						}
						if( selectindex < 0 && !selectvalue.empty() && selectvalue == val.Value ) {
							selectindex = k;
						}
					}
					if( selectindex >= 0 ) {
						curitem.Value = selectindex;
					} else if( curitem.Defalut >= 0 ) {
						curitem.Value = curitem.Defalut;
					} else {
						curitem.Value = 0;
					}

					if( curitem.Defalut != curitem.Value ) {
						curitem.Caption = std::wstring(L"* ") + curitem.Text + std::wstring(L" : ") + curitem.Select[curitem.Value].second;
					} else {
						curitem.Caption = curitem.Text + std::wstring(L" : ") + curitem.Select[curitem.Value].second;
					}
					curitem.ItemHandle = InsertTreeItem( hItem, curitem.Caption );
					itemidx++;
				}
			}
			TreeView_Expand( TreeControl, hItem, TVE_EXPAND );
		}
		TreeView_SelectItem( TreeControl, hFirst );
		delete options;
	}
}
Exemple #5
0
void LocationTree::InsertLocationItem(const char* text, u32 index)
{
	if ( index <= TREE_ITEM_DATA )
		InsertTreeItem(hLocationRoot, text, index|TREE_TYPE_LOCATION);
}