Пример #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;
}
Пример #2
0
void PopulateList()
{
	char label[MAX_PATHNAME_LEN];
	char fileName[MAX_PATHNAME_LEN];
	int numItems = 1; 
	
	ClearListCtrl (Main_pnl_handle, ERG_panel_loaded_mask_list);
	InsertListItem (Main_pnl_handle, ERG_panel_loaded_mask_list, -1, "flat", 0);
	
	SplitPath (mask_path, NULL, NULL, fileName);
	Fmt (label, "%s<%s%s%s", "Project Directory (", fileName, ")");
	GetFiles(mask_path, &numItems, numItems-1);
}
Пример #3
0
void InitManipulateCallback(int menubar, int menuItem, void *callbackData, int panel)
{
    int i, height1, height2;
    channelPtr chan;

    channel_InitViewPanel();
    InstallCtrlCallback (chanview.p1, CHANVIEW_CHANNELS,
                         ManipulateSelectionCallback, 0);
    ClearListCtrl (chanview.p1, CHANVIEW_CHANNELS);
    for (i = 0; i < channelG.channels.nItems; i++)
    {
        chan = channellist_GetItem (i);
        if (!chan->curves.nItems)
            InsertListItem (chanview.p1, CHANVIEW_CHANNELS, -1, chan->label, i);
    }

    SetCtrlIndex (chanview.p1, CHANVIEW_CHANNELS, 0);
    GetCtrlVal (chanview.p1, CHANVIEW_CHANNELS, &i);
    chan = channellist_GetItem (i);
    InstallCtrlCallback (chanview.p1, CHANVIEW_GRAPH,
                         ManipulateGraphCallback, chan);

    channel_UpdateViewPanel(chan);

    SetCtrlAttribute (chanview.p1, CHANVIEW_GRAPH, ATTR_CTRL_MODE,
                      VAL_HOT);
    SetCtrlAttribute (chanview.p1, CHANVIEW_GRAPH, ATTR_NUM_CURSORS, 1);
    SetCursorAttribute (chanview.p1, CHANVIEW_GRAPH, 1, ATTR_CURSOR_MODE,
                        VAL_SNAP_TO_POINT);
    SetCursorAttribute (chanview.p1, CHANVIEW_GRAPH, 1,
                        ATTR_CROSS_HAIR_STYLE, VAL_SHORT_CROSS);
    SetCursorAttribute (chanview.p1, CHANVIEW_GRAPH, 1, ATTR_CURSOR_COLOR,
                        VAL_YELLOW);
    GetPanelAttribute (chanview.p1, ATTR_HEIGHT, &height1);

    chanview.p2 = LoadPanel (chanview.p1, "chanfncu.uir", MANIP);
    
    GetPanelAttribute (chanview.p2, ATTR_HEIGHT, &height2);
    SetPanelAttribute (chanview.p1, ATTR_HEIGHT, height1+height2+6);
    SetPanelPos (chanview.p2, height1, 6);

    InstallCtrlCallback (chanview.p2, MANIP_READING,
                         ManipulateReadingCallback, chan);

    DisplayPanel (chanview.p2);
    InstallPopup (chanview.p1);
    MessagePopup ("Manipulate Channel Message", "Only channels not connected to a curve may be edited");
}
Пример #4
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;
}