Example #1
0
File: util.c Project: gaorlov/DAAS
void util_InitClose (int panel, int control, int visible)
{
    SetPanelAttribute (panel, ATTR_CLOSE_CTRL, control);
    SetPanelAttribute (panel, ATTR_SYSTEM_MENU_VISIBLE, TRUE);
    SetPanelAttribute (panel, ATTR_CLOSE_ITEM_VISIBLE, TRUE);
    SetCtrlAttribute (panel, control, ATTR_VISIBLE, visible);
}
Example #2
0
int CreateProgressPanel ( char* szMainTitle , int iNumberOfBars )
{
	int					hPanelWait					=	0; 
	
	if (( iNumberOfBars > WAIT_MAX_BARS ) || ( iNumberOfBars < 1 ))
		return -1;
	
	hPanelWait = LoadPanel ( 0 , "database.uir" , PROGRESS );
	
	if ( hPanelWait < 1 )
		return -1;
	
	if ( szMainTitle != NULL )
		SetPanelAttribute ( hPanelWait , ATTR_TITLE , szMainTitle );
	
	SetPanelAttribute ( hPanelWait , ATTR_HEIGHT , WAIT_BAR_START + ( WAIT_BAR_STEP * iNumberOfBars ) );
		
	InstallPopup (hPanelWait);
	
	MakeApplicationActive ();
	SetActivePanel ( hPanelWait );
	ProcessDrawEvents();

	return hPanelWait;
}
Example #3
0
File: util.c Project: gaorlov/DAAS
void utilG_Init (void (*DiscardPanels)(void))
{
    int p, control, top, height, width;
	int grw, chw, asw, acw;
    

    utilG.acq.pt = 0;
    utilG.acq.nPts = 0;
    utilG.acq.status = ACQ_NONE;

    utilG.p = LoadPanel (0, "utilu.uir", BG);
    
    utilG.DiscardPanels = DiscardPanels;

	SetPanelAttribute (utilG.p, ATTR_WINDOW_ZOOM, VAL_MAXIMIZE);
    DisplayPanel (utilG.p);
	
	GetCtrlAttribute(utilG.p, BG_GRAPHS, ATTR_WIDTH, &grw);
	GetCtrlAttribute(utilG.p, BG_CHANNELS, ATTR_WIDTH, &chw);
	GetCtrlAttribute(utilG.p, BG_ACQSETUP, ATTR_WIDTH, &asw);
	GetCtrlAttribute(utilG.p, BG_ACQCHANNELS, ATTR_WIDTH, &acw);
	GetPanelAttribute(utilG.p, ATTR_WIDTH, &width);
	
	SetCtrlAttribute(utilG.p, BG_GRAPHS, ATTR_LEFT,			(3*width/20) - grw);
	SetCtrlAttribute(utilG.p, BG_CHANNELS, ATTR_LEFT, 		(7*width/20) - chw);
	SetCtrlAttribute(utilG.p, BG_ACQSETUP, ATTR_LEFT, 		(9*width/15) - asw);
	SetCtrlAttribute(utilG.p, BG_ACQCHANNELS, ATTR_LEFT, 	(9*width/10) - acw);
	
	initP = LoadPanel (utilG.p, "utilu.uir", INIT);
    
    SetPanelPos (initP, VAL_AUTO_CENTER, VAL_AUTO_CENTER);

    SetCtrlAttribute (initP, INIT_TEXT, ATTR_VISIBLE, FALSE);
    DisplayPanel (initP);

    GetUserEvent (1, &p, &control);
    switch (control) {
        case INIT_CONTROL: utilG.acq.status = ACQ_DONE; break;
        case INIT_ANALYSIS: utilG.acq.status = ACQ_NONE; break;
        case INIT_EXIT:
            utilG_Exit();
            QuitUserInterface(0);
            exit (EXIT_SUCCESS);
            break;
    }
    SetMouseCursor (VAL_HOUR_GLASS_CURSOR);

    SetCtrlAttribute (initP, INIT_TEXT, ATTR_VISIBLE, TRUE);
    SetCtrlAttribute (initP, INIT_TEXT_10, ATTR_VISIBLE, FALSE);
    SetCtrlAttribute (initP, INIT_CONTROL, ATTR_VISIBLE, FALSE);
    SetCtrlAttribute (initP, INIT_ANALYSIS, ATTR_VISIBLE, FALSE);
    SetCtrlAttribute (initP, INIT_EXIT, ATTR_VISIBLE, FALSE);

    GetCtrlAttribute (initP, INIT_TEXT, ATTR_TOP, &top);
    GetCtrlAttribute (initP, INIT_TEXT, ATTR_HEIGHT, &height);
    SetPanelAttribute (initP, ATTR_HEIGHT, top+height+6);
    util_ChangeInitMessage ("DAAS Utilities...");
}
Example #4
0
/*----------------------------------------------------------------------------
------------------------------------------------------------------------------
.	Función: 	 GRA_XYSubmenu
. 	Descripcion: Ajusta la posición del submenu a las coordenadas que se hayan
.				 detectado del cursor del mouse.
.	Argumentos:	 int panel | Referencia del panel donde se encuentra el
.							 control
.				 int submenu | Referencia del panel donde se encuentre el
.							   submenu que se desea mostrar
.   Retorno:	 Nada
------------------------------------------------------------------------------
----------------------------------------------------------------------------*/
void GRA_XYSubmenu(int panel, int submenu)
{
	int panelX;
	int panelY;
	
	//Obtiene las coordenadas del cursor
	GetRelativeMouseState(panel,0,&panelX,&panelY,NULL,NULL,NULL);
	SetPanelAttribute (submenu, ATTR_LEFT, panelX-10);
	SetPanelAttribute (submenu, ATTR_TOP, panelY+10);
	
}
Example #5
0
File: K213.c Project: gaorlov/DAAS
static void k213_Operate (int menubar, int menuItem, void *callbackData, int panel)
{
    int p, m, port, width, height;
    gpibioPtr dev = callbackData;
    k213Ptr quadsrc = dev->device;
    char label[256];

    SetMenuBarAttribute (menubar, menuItem, ATTR_DIMMED, TRUE);

    p = dev->iPanel? dev->iPanel: LoadPanel (utilG.p, "k213u.uir", K213);
    dev->iPanel = p;
	
    Fmt (label, "Keithley 213 : %s", dev->label);
    SetPanelAttribute (p, ATTR_TITLE, label);

    m = LoadMenuBar (p, "k213u.uir", K213MENUS);
    
    SetPanelMenuBar (p, m);

    SetPanelAttribute (p, ATTR_CALLBACK_DATA, dev);

    SetMenuBarAttribute (m, K213MENUS_FILE_SAVE, ATTR_CALLBACK_DATA, dev);
    SetMenuBarAttribute (m, K213MENUS_FILE_LOAD, ATTR_CALLBACK_DATA, dev);
    SetMenuBarAttribute (m, K213MENUS_FILE_GPIB, ATTR_CALLBACK_DATA, dev);

    for (port = 0; port < 4; port++) {
        quadsrc->port[port].panel = LoadPanel (p, "k213u.uir", K213PORT);
        GetPanelAttribute (quadsrc->port[port].panel, ATTR_WIDTH, &width);
        GetPanelAttribute (quadsrc->port[port].panel, ATTR_HEIGHT, &height);
        
        SetPanelPos (quadsrc->port[port].panel, 17+2, (port*(width+4))+2);
        Fmt (label, "port %i", port+1);
        SetCtrlVal (quadsrc->port[port].panel, K213PORT_TITLE, label);

        SetCtrlAttribute (quadsrc->port[port].panel, K213PORT_DISPLAY, ATTR_CALLBACK_DATA, dev);
        SetCtrlAttribute (quadsrc->port[port].panel, K213PORT_AUTORANGE, ATTR_CALLBACK_DATA, dev);
        SetCtrlAttribute (quadsrc->port[port].panel, K213PORT_RANGE, ATTR_CALLBACK_DATA, dev);
        SetCtrlAttribute (quadsrc->port[port].panel, K213PORT_SETUP, ATTR_CALLBACK_DATA, dev);
		SetPanelAttribute(quadsrc->port[port].panel, ATTR_CALLBACK_DATA, dev);
        DisplayPanel (quadsrc->port[port].panel);
    }

    SetPanelAttribute (p, ATTR_WIDTH, (width+4)*port);
    SetPanelAttribute (p, ATTR_HEIGHT, height+4+17);
    SetPanelPos (p, VAL_AUTO_CENTER, VAL_AUTO_CENTER);
    k213_UpdateControls (p, dev);

    devPanel_Add (p, dev, k213_UpdateReadings);
    DisplayPanel (p);
}
Example #6
0
File: K236.c Project: gaorlov/DAAS
static void OperateK236 (int menubar, int menuItem, void *callbackData, int panel)
{
    int p, m;
    gpibioPtr dev = callbackData;
    k236Ptr smu = dev->device;
    char label[256];

    SetMenuBarAttribute (menubar, menuItem, ATTR_DIMMED, TRUE);

    p = dev->iPanel? dev->iPanel:LoadPanel (utilG.p, "k236u.uir", K236);
	dev->iPanel = p;
    
    SetPanelPos (p, VAL_AUTO_CENTER, VAL_AUTO_CENTER);

    Fmt (label, "Keithley 236 Source Measure Unit: %s", dev->label);
    SetPanelAttribute (p, ATTR_TITLE, label);

    m = LoadMenuBar (p, "k236u.uir", K236MENUS);
    
    SetPanelMenuBar (p, m);

    SetMenuBarAttribute (m, K236MENUS_FILE_SAVE, ATTR_CALLBACK_DATA, dev);
    SetMenuBarAttribute (m, K236MENUS_FILE_LOAD, ATTR_CALLBACK_DATA, dev);
    SetMenuBarAttribute (m, K236MENUS_FILE_GPIB, ATTR_CALLBACK_DATA, dev);
    SetMenuBarAttribute (m, K236MENUS_SOURCE, ATTR_CALLBACK_DATA, smu->source);
    SetMenuBarAttribute (m, K236MENUS_MEASURE, ATTR_CALLBACK_DATA, smu->measure);

    SetPanelAttribute (p, ATTR_CALLBACK_DATA, dev);

    SetCtrlAttribute (p, K236_SOURCE, ATTR_CALLBACK_DATA, smu->source);

    SetCtrlAttribute (p, K236_SOURCE_I_RANGE, ATTR_CALLBACK_DATA, dev);
    SetCtrlAttribute (p, K236_SOURCE_V_RANGE, ATTR_CALLBACK_DATA, dev);
    SetCtrlAttribute (p, K236_DELAY, ATTR_CALLBACK_DATA, dev);
    SetCtrlAttribute (p, K236_IDENTIFY, ATTR_CALLBACK_DATA, dev);
    SetCtrlAttribute (p, K236_OPERATE, ATTR_CALLBACK_DATA, dev);
    SetCtrlAttribute (p, K236_SELECT, ATTR_CALLBACK_DATA, dev);
    SetCtrlAttribute (p, K236_SENSE, ATTR_CALLBACK_DATA, dev);
    SetCtrlAttribute (p, K236_MEAS_I_RANGE, ATTR_CALLBACK_DATA, dev);
    SetCtrlAttribute (p, K236_MEAS_V_RANGE, ATTR_CALLBACK_DATA, dev);
    SetCtrlAttribute (p, K236_LEVEL, ATTR_CALLBACK_DATA, dev);
    SetCtrlAttribute (p, K236_FILTER, ATTR_CALLBACK_DATA, dev);
    SetCtrlAttribute (p, K236_INTTIME, ATTR_CALLBACK_DATA, dev);
    SetCtrlAttribute (p, K236_SUPPRESS, ATTR_CALLBACK_DATA, dev);

    k236_UpdateControls (p, dev);

    devPanel_Add (p, dev, k236_UpdateReadings);
    DisplayPanel (p);
}
Example #7
0
void UpdateProgressPanel ( int hProgressHandle , char* szNewMainTitle , int iNewNumberOfBars )
{
	if ( hProgressHandle < 1 )
		return;

	if (( iNewNumberOfBars > WAIT_MAX_BARS ) || ( iNewNumberOfBars < 1 ))
		return;
	
	if ( szNewMainTitle != NULL )
		SetPanelAttribute ( hProgressHandle , ATTR_TITLE , szNewMainTitle );
	
	SetPanelAttribute ( hProgressHandle , ATTR_HEIGHT , WAIT_BAR_START + ( WAIT_BAR_STEP * iNewNumberOfBars ) );

	ProcessDrawEvents();
}
/* 配置并弹出信号分析面板 */
void popupPanelForGraph(int pHdl){
	int i = getGraphIndex(pHdl, 0); //Need a index to find one of the six graphs.
	char title[50];
	for(int j=0; j<(READ_LENGTH/24); j++)
		tempData[i][j] = resultData[i][j];
	Delay(0.1);
	for(int z=(READ_LENGTH/24),x = 0; z<(READ_LENGTH/12); z++,x++)
		tempData[i][z] = resultData[i][x];
	// 从uir文件中加载 信号分析面板
	if(PopPanels[i] <=0 ){
		if ((PopPanels[i] = LoadPanel(0, "MainPanel.uir", PopupPanel)) < 0)
			showError("Load PopupPanel Error!");
		DisplayPanel(PopPanels[i]);
		PopGraphs[i] = PopupPanel_PopGraph1;
		GetPanelAttribute(pHdl, ATTR_TITLE, title);
		SetPanelAttribute(PopPanels[i], ATTR_TITLE, title);
		SetCtrlAttribute(PopPanels[i], PopGraphs[i], ATTR_GRID_COLOR, plotGridColor);
		SetCtrlAttribute(PopPanels[i], PopGraphs[i], ATTR_GRAPH_BGCOLOR, VAL_TRANSPARENT);
		//temp SetAxisScalingMode(PopPanels[i], PopGraphs[i], VAL_LEFT_YAXIS, VAL_MANUAL, yAxisRange[0], yAxisRange[1]);
		PopGPlots[i] = PlotY(PopPanels[i], PopGraphs[i], tempData[i], READ_LENGTH/12, 
							 VAL_DOUBLE, VAL_THIN_LINE, VAL_EMPTY_SQUARE, VAL_SOLID,1, plotLineColor);
	}else{
		SetActivePanel(PopPanels[i]);
	}
	
}
/* 辅助函数-根据索引创建-六个Child Panel中的某一个 */
int createChildPanel(char title[], int index){
	int cPanel = 0;
	if (index<3){
		cPanel = NewPanel(panelHdl, title,
		(mHeight+averSpaceV), ((cWidth+averSpaceH)*index + averSpaceH), 
		cHeight, cWidth);
	}else{
		cPanel = NewPanel(panelHdl, title,
		(mHeight+averSpaceV*2+cHeight), ((cWidth+averSpaceH)*(index-3) + averSpaceH),
		cHeight, cWidth);
	}
	SetPanelAttribute(cPanel, ATTR_CONFORM_TO_SYSTEM, 1);
	SetPanelAttribute(cPanel, ATTR_CONFORM_TO_SYSTEM_THEME, 1);
	SetPanelAttribute(cPanel, ATTR_FRAME_STYLE, VAL_OUTLINED_FRAME);
    return cPanel;
}
Example #10
0
int  K2400ControlPanelCallback(int panel, int event, void *callbackData, int eventData1, int eventData2)
{
    gpibioPtr dev = callbackData;
    k2400Ptr smu = dev->device;
    int menubar;

    if ((event == EVENT_KEYPRESS && eventData1 == VAL_ESC_VKEY) || event == EVENT_RIGHT_DOUBLE_CLICK) {
        devPanel_Remove (panel);
		DiscardPanel (panel);
		dev->iPanel = 0;
		SetMenuBarAttribute (acquire_GetMenuBar(), dev->menuitem_id, ATTR_DIMMED, FALSE);
    }

    if (event == EVENT_GOT_FOCUS) {
        menubar = GetPanelMenuBar (panel);
        SetPanelAttribute (panel, ATTR_DIMMED, (dev->status != DEV_REMOTE));
        SetMenuBarAttribute (menubar, K2400MENUS_FILE_SAVE, ATTR_DIMMED, (dev->status != DEV_REMOTE));
        SetMenuBarAttribute (menubar, K2400MENUS_FILE_LOAD, ATTR_DIMMED, (dev->status != DEV_REMOTE));
        SetMenuBarAttribute (menubar, K2400MENUS_SOURCE, ATTR_DIMMED, (dev->status != DEV_REMOTE));
        SetMenuBarAttribute (menubar, K2400MENUS_MEASURE, ATTR_DIMMED, (dev->status != DEV_REMOTE));

        if (!util_TakingData()) k2400_UpdateControls (panel, dev);
    }
    return 0;
}
Example #11
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;
}
Example #12
0
int CVICALLBACK ConfigCMD (int panel, int control, int event,
		void *callbackData, int eventData1, int eventData2)
{
	switch (event)
	{
		case EVENT_COMMIT:
			 DimAction(1);
			  WriteLog();
			  ResetTextBox (panelHandle, PANEL_TEXTBOX, "");
		
			if (ReadConfigFile(BBUCOMMON_CONFIGCMD))
			{
				if (0==InstallPopup(configHandle))
				{
					SetPanelAttribute (configHandle, ATTR_TITLE, "CheckCMD");    
					SetCtrlAttribute (configHandle, CONFIG_BOX, ATTR_ENTER_IS_NEWLINE, 1);
					SetCtrlAttribute (configHandle, CONFIG_BOX, ATTR_TEXT_BGCOLOR, VAL_OFFWHITE);
				}
			}
			else
			{
				SetCtrlVal (panelHandle, PANEL_TEXTBOX, "Read data from cmd.txt error,please check it by manual!\r\n");
			}
					
		
			  DimAction(0);   
			break;
	}
	return 0;
}
Example #13
0
int  K2400MeasControlCallback(int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
{
    acqchanPtr acqchan = callbackData;
    switch (control) {
        case K2400_MEAS_ACQ:
            if (event == EVENT_VAL_CHANGED) {
                GetCtrlVal (panel, control, &acqchan->acquire);
                if (acqchan->acquire) acqchanlist_AddChannel (acqchan);
                    else acqchanlist_RemoveChannel (acqchan);
            }
            break;
        case K2400_MEAS_COEFF:
            if (event == EVENT_COMMIT) {
                GetCtrlVal (panel, control, &acqchan->coeff);
                if (acqchan->p) SetCtrlVal (acqchan->p, ACQDATA_COEFF, acqchan->coeff);
            }
            break;
        case K2400_MEAS_LABEL:
            if (event == EVENT_COMMIT) {
                GetCtrlVal (panel, control, acqchan->channel->label);
                acqchanlist_ReplaceChannel (acqchan);
                if (acqchan->p) SetPanelAttribute (acqchan->p, ATTR_TITLE, acqchan->channel->label);
            }
            break;
        case K2400_MEAS_CLOSE:
            if (event == EVENT_COMMIT) {
                devPanel_Remove(panel);
                
                DiscardPanel (panel);
            }
            break;
    }
    return 0;
}
Example #14
0
File: K213.c Project: gaorlov/DAAS
int  K213ControlPanelCallback(int panel, int event, void *callbackData, int eventData1, int eventData2)
{
    gpibioPtr dev = callbackData;
    k213Ptr quadsrc = dev->device;
    int menubar, port;

    if ((event == EVENT_KEYPRESS && eventData1 == VAL_ESC_VKEY) || (event == EVENT_RIGHT_DOUBLE_CLICK)) {
        devPanel_Remove (panel);

        for (port = 0; port < 4; port++) {
            HidePanel (quadsrc->port[port].panel);
        }
        DiscardPanel (panel);
		dev->iPanel = 0;
		SetMenuBarAttribute (acquire_GetMenuBar(), dev->menuitem_id, ATTR_DIMMED, FALSE);
    }

    if (event == EVENT_GOT_FOCUS && panel == dev->iPanel) {
        menubar = GetPanelMenuBar (panel);
        SetPanelAttribute (panel, ATTR_DIMMED, (dev->status != DEV_REMOTE));
        SetMenuBarAttribute (menubar, K213MENUS_FILE_SAVE, ATTR_DIMMED, (dev->status != DEV_REMOTE));
        SetMenuBarAttribute (menubar, K213MENUS_FILE_LOAD, ATTR_DIMMED, (dev->status != DEV_REMOTE));

        if (!util_TakingData()) k213_UpdateControls (panel, dev);
    }
    return 0;
}
Example #15
0
void das1602Operate (int menubar, int menuItem, void *callbackData, int panel)
{
    MCCdevPtr dev = callbackData;
    das1602Ptr das = dev->device;
    acqchanPtr acqchan;
    int i, x = 0, m;
    if(!das->panel)
    {
        das->panel = LoadPanel(utilG.p, "DAS-1602u.uir", DAS_CTRL);
        das->menu = LoadMenuBar(das->panel, "DAS-1602u.uir", DASMENU);
        SetPanelMenuBar(das->panel, das->menu);
        for(i = 0; i < 8; i ++)
        {
            SetMenuBarAttribute (das->menu, das->Achannels[i]->menuitem_id, ATTR_CALLBACK_DATA, das->Achannels[i]);
            SetMenuBarAttribute (das->menu, das->Achannels[i]->menuitem_id, ATTR_ITEM_NAME, das->Achannels[i]->port.analogueIOport.IO.acqchan->channel->label);
            SetMenuBarAttribute (das->menu, das->Achannels[i]->menuitem_id, ATTR_CHECKED, das->Achannels[i]->port.analogueIOport.IO.acqchan->acquire);
        }
        SetMenuBarAttribute (das->menu, DASMENU_SOURCE_DAC1, ATTR_CALLBACK_DATA, das->Achannels[8]->port.analogueIOport.IO.source);
        SetMenuBarAttribute (das->menu, DASMENU_SOURCE_DAC2, ATTR_CALLBACK_DATA, das->Achannels[9]->port.analogueIOport.IO.source);
        SetMenuBarAttribute (das->menu, DASMENU_SOURCE_DAC1, ATTR_ITEM_NAME, das->Achannels[8]->port.analogueIOport.IO.source->acqchan->channel->label);
        SetMenuBarAttribute (das->menu, DASMENU_SOURCE_DAC2, ATTR_ITEM_NAME, das->Achannels[9]->port.analogueIOport.IO.source->acqchan->channel->label);
        SetCtrlAttribute (das->panel, DAS_CTRL_RANGE, ATTR_DIMMED, 1);
        SetCtrlAttribute (das->panel, DAS_CTRL_ACQ, ATTR_DIMMED, 1);
        
        SetCtrlAttribute (das->panel, DAS_CTRL_INPUT, ATTR_CALLBACK_DATA, das->Achannels[0]);
        SetPanelAttribute (das->panel, ATTR_CALLBACK_DATA, das);
    }
    SetMenuBarAttribute(menubar, menuItem, ATTR_DIMMED, 1);
    devPanel_Add (das->panel, dev, das1602_UpdateReadings);
    DisplayPanel(das->panel);
}
Example #16
0
void usb1208ls_MenuCallback(int menubar, int menuItem, void *callbackData, int panel)
{
    switch (menuItem)
    {
        case USBMENU_MEAS_IN_0:
        case USBMENU_MEAS_IN_1:
        case USBMENU_MEAS_IN_2:
        case USBMENU_MEAS_IN_3:
        
            if(utilG.acq.status != ACQ_BUSY){
                portPtr port = callbackData;
                MCCdevPtr dev = port->port.analogueIOport.IO.acqchan->dev;
                usb1208lsPtr pmd = dev->device;
                port->measPanel = port->measPanel? port->measPanel : LoadPanel(utilG.p, "USB-1208LSu.uir", MEASURE);
                SetCtrlAttribute (port->measPanel, MEASURE_RANGE, ATTR_CALLBACK_DATA, port->port.analogueIOport.IO.acqchan);
                SetCtrlAttribute (port->measPanel, MEASURE_LABEL, ATTR_CALLBACK_DATA, port->port.analogueIOport.IO.acqchan);
                SetCtrlAttribute (port->measPanel, MEASURE_COEFF, ATTR_CALLBACK_DATA, port->port.analogueIOport.IO.acqchan);
                SetCtrlAttribute (port->measPanel, MEASURE_NOTE, ATTR_CALLBACK_DATA, port->port.analogueIOport.IO.acqchan);
                SetCtrlAttribute (port->measPanel, MEASURE_ACQ, ATTR_CALLBACK_DATA, port->port.analogueIOport.IO.acqchan);
                SetPanelAttribute (port->measPanel, ATTR_TITLE, port->port.analogueIOport.IO.acqchan->channel->label);
                
                SetCtrlVal (port->measPanel, MEASURE_LABEL, port->port.analogueIOport.IO.acqchan->channel->label);
                SetCtrlVal (port->measPanel, MEASURE_RANGE, port->port.analogueIOport.range);
                SetCtrlVal (port->measPanel, MEASURE_COEFF, port->port.analogueIOport.IO.acqchan->coeff);
                SetCtrlVal (port->measPanel, MEASURE_NOTE, port->port.analogueIOport.IO.acqchan->note);
                SetCtrlVal (port->measPanel, MEASURE_ACQ, port->port.analogueIOport.IO.acqchan->acquire);
                DisplayPanel (port->measPanel);
            }
            break;
        case USBMENU_SOURCE_DAC1:
        case USBMENU_SOURCE_DAC2:
        case USBMENU_SOURCE_DAC3:
            {
                sourcePtr src = callbackData;
                switch(utilG.exp)
                {
                    case EXP_SOURCE: source_InitPanel(src); break;
                    case EXP_FLOAT : gensrc_InitPanel(src); break;
                }
            }
            break;
        case USBMENU_SOURCE_DAC4:
            {
                portPtr port = callbackData;
                boards_DigitalSourceInit(port);
            }
            break;
        case USBMENU_FILE_SAVE:
            boards_Save(callbackData, usb1208ls_Save);
            break;
        case USBMENU_FILE_LOAD:
            boards_Load(callbackData, usb1208ls_Load);
            break;
    }
}
Example #17
0
//////////////////////////////////////////manualbar callback function/////////////////////////////////////////////////
void CVICALLBACK Config (int menuBar, int menuItem, void *callbackData,
		int panel)
{
			  DimAction(1);
			  WriteLog();
			  ResetTextBox (panelHandle, PANEL_TEXTBOX, "");
			  switch (menuItem)
			  {
			  	case MENUBAR_CONFIG_CONFIGIP:
					if (ReadConfigFile(MENUBAR_CONFIG_CONFIGIP))
					{
						if (0==InstallPopup(configHandle))
						{
							SetPanelAttribute (configHandle, ATTR_TITLE, "CheckBBUIP");
							SetCtrlAttribute (configHandle, CONFIG_BOX, ATTR_ENTER_IS_NEWLINE, 1);
							SetCtrlAttribute (configHandle, CONFIG_BOX, ATTR_TEXT_BGCOLOR, VAL_OFFWHITE);
						}
					
					}
					else
					{
						SetCtrlVal (panelHandle, PANEL_TEXTBOX, "Read data from bbuip.txt error,please check it by manual!\r\n");        
					}
					break;
				case BBUCOMMON_CONFIGCMD:
					if (ReadConfigFile(BBUCOMMON_CONFIGCMD))
					{
						if (0==InstallPopup(configHandle))
						{
							SetPanelAttribute (configHandle, ATTR_TITLE, "CheckCMD");    
							SetCtrlAttribute (configHandle, CONFIG_BOX, ATTR_ENTER_IS_NEWLINE, 1);
							SetCtrlAttribute (configHandle, CONFIG_BOX, ATTR_TEXT_BGCOLOR, VAL_OFFWHITE);
						}
					}
					else
					{
						SetCtrlVal (panelHandle, PANEL_TEXTBOX, "Read data from cmd.txt error,please check it by manual!\r\n");
					}
					
			  }
			  DimAction(0);   
}  
Example #18
0
File: Sr844.c Project: gaorlov/DAAS
int  XYMPControlCallback844(int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
{
    sr844Ptr lia;
    acqchanPtr acqchan;

    acqchan = callbackData;

    switch (control) {
        case SR844_XYMP_NOTE_1:
        case SR844_XYMP_NOTE_2:
        case SR844_XYMP_NOTE_3:
        case SR844_XYMP_NOTE_4:
            AcqDataNoteCallback (panel, control, event, callbackData, eventData1, eventData2);
            break;
        case SR844_XYMP_XACQ:
        case SR844_XYMP_YACQ:
        case SR844_XYMP_RACQ:
        case SR844_XYMP_PACQ:
            if (event == EVENT_VAL_CHANGED) {
                GetCtrlVal (panel, control, &acqchan->acquire);
                if (acqchan->acquire) acqchanlist_AddChannel (acqchan);
                    else acqchanlist_RemoveChannel (acqchan);
            }
            break;
        case SR844_XYMP_XCOEFF:
        case SR844_XYMP_YCOEFF:
        case SR844_XYMP_RCOEFF:
        case SR844_XYMP_PCOEFF:
            if (event == EVENT_COMMIT) {
                GetCtrlVal (panel, control, &acqchan->coeff);
                if (acqchan->p) SetCtrlVal (acqchan->p, ACQDATA_COEFF, acqchan->coeff);
            }
            break;
        case SR844_XYMP_XLABEL:
        case SR844_XYMP_YLABEL:
        case SR844_XYMP_RLABEL:
        case SR844_XYMP_PLABEL:
            if (event == EVENT_COMMIT) {
                GetCtrlVal (panel, control, acqchan->channel->label);
                acqchanlist_ReplaceChannel (acqchan);
                if (acqchan->p) SetPanelAttribute (acqchan->p, ATTR_TITLE, acqchan->channel->label);
            }
            break;
        case SR844_XYMP_CLOSE:
            if (event == EVENT_COMMIT) {
                lia = callbackData;
                devPanel_Remove(panel);
                DiscardPanel (panel);
            }
            break;
    }
	updateGraphSource();
    return 0;
}
Example #19
0
File: Sr844.c Project: gaorlov/DAAS
void OperateSR844 (int menubar, int menuItem, void *callbackData, int panel)
{
    int p, m;
    gpibioPtr dev = callbackData;
    sr844Ptr lia = dev->device;
    char label[256];

    SetMenuBarAttribute (menubar, menuItem, ATTR_DIMMED, TRUE);

	p = dev->iPanel? dev->iPanel: LoadPanel (utilG.p, "sr844u.uir", SR844_CTRL);
    dev->iPanel = p;

	SetPanelPos (p, VAL_AUTO_CENTER, VAL_AUTO_CENTER);

    Fmt (label, "stanford research systems sr844 dsp lock-in amplifier: %s", dev->label);
    SetPanelAttribute (p, ATTR_TITLE, label);
	
	m = LoadMenuBar (p, "sr844u.uir", SR844MENU);
    SetPanelMenuBar (p, m);

    SetMenuBarAttribute (m, SR844MENU_SOURCES_DAC1, ATTR_CALLBACK_DATA, lia->sources[0]);
    SetMenuBarAttribute (m, SR844MENU_SOURCES_DAC2, ATTR_CALLBACK_DATA, lia->sources[1]);
    SetMenuBarAttribute (m, SR844MENU_SOURCES_FREQ, ATTR_CALLBACK_DATA, lia->sources[2]);
    SetMenuBarAttribute (m, SR844MENU_MEASURE_LIA, ATTR_CALLBACK_DATA, lia);
    SetMenuBarAttribute (m, SR844MENU_MEASURE_ADCS, ATTR_CALLBACK_DATA, dev);

	SetPanelAttribute (p, ATTR_CALLBACK_DATA, dev);

    SetCtrlAttribute (p, SR844_CTRL_REF, ATTR_CALLBACK_DATA, dev);
    SetCtrlAttribute (p, SR844_CTRL_TC, ATTR_CALLBACK_DATA, dev);
    SetCtrlAttribute (p, SR844_CTRL_SENS, ATTR_CALLBACK_DATA, dev);
    SetCtrlAttribute (p, SR844_CTRL_AUTOSENSE, ATTR_CALLBACK_DATA, dev);
    SetCtrlAttribute (p, SR844_CTRL_FILTSLOPE, ATTR_CALLBACK_DATA, dev);
	SetCtrlAttribute (p, SR844_CTRL_1MO50O, ATTR_CALLBACK_DATA, dev);
	SetCtrlVal(p, SR844_CTRL_GPIBADDR, dev->paddr);
    sr844_UpdateControls (p, dev);		   ///*/

    devPanel_Add (p, dev, sr844_UpdateReadings);//*/
    DisplayPanel (p);
}
Example #20
0
File: Sr844.c Project: gaorlov/DAAS
int  ADCControlCallback844(int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
{
    sr844Ptr lia;
    acqchanPtr acqchan;

    acqchan = callbackData;

    switch (control) {
        case SR844_ADC_NOTE_1:
        case SR844_ADC_NOTE_2:
            AcqDataNoteCallback (panel, control, event, callbackData, eventData1, eventData2);
            break;
        case SR844_ADC_ACQ_1:
        case SR844_ADC_ACQ_2:
            if (event == EVENT_VAL_CHANGED) {
                GetCtrlVal (panel, control, &acqchan->acquire);
                if (acqchan->acquire) acqchanlist_AddChannel (acqchan);
                    else acqchanlist_RemoveChannel (acqchan);
            }
            break;
        case SR844_ADC_CONVERSION_1:
        case SR844_ADC_CONVERSION_2:
            if (event == EVENT_VAL_CHANGED) {
                GetCtrlVal (panel, control, &acqchan->conversion);
                if (acqchan->p) SetCtrlVal (acqchan->p, ACQDATA_CONV, acqchan->conversion);
            }
            break;
        case SR844_ADC_COEFF_1:
        case SR844_ADC_COEFF_2:
            if (event == EVENT_COMMIT) {
                GetCtrlVal (panel, control, &acqchan->coeff);
                if (acqchan->p) SetCtrlVal (acqchan->p, ACQDATA_COEFF, acqchan->coeff);
            }
            break;
        case SR844_ADC_LABEL_1:
        case SR844_ADC_LABEL_2:
            if (event == EVENT_COMMIT) {
                GetCtrlVal (panel, control, acqchan->channel->label);
                acqchanlist_ReplaceChannel (acqchan);
                if (acqchan->p) SetPanelAttribute (acqchan->p, ATTR_TITLE, acqchan->channel->label);
            }
            break;
        case SR844_ADC_CLOSE:
            if (event == EVENT_COMMIT) {
                lia = callbackData;
                devPanel_Remove(panel);
                DiscardPanel (panel);
            }
            break;
    }
    return 0;
}
Example #21
0
int PRE_OcultarPanel(int iPanel)
{
	int iLeft=0;
	int i=0;
	
	GetPanelAttribute(iPanel, ATTR_LEFT, &iLeft);
	
	i=0;
	while (i<50)
	{
		SetPanelAttribute(iPanel, ATTR_LEFT, iLeft-i);
		DelayWithEventProcessing(0.0);
		i+=10;
	}
	
	SetPanelAttribute (iPanel, ATTR_VSCROLL_OFFSET, 0);
	SetPanelAttribute (iPanel, ATTR_HSCROLL_OFFSET, 0);
	
	HidePanel(iPanel);
	
	PRE_PanelVisible(iPanel);	
	
	return 0;
}
Example #22
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");
}
Example #23
0
File: util.c Project: gaorlov/DAAS
int util_OpenFile(char *path, int action, int ascii)
{
    int handle;
    unsigned int  nBytes, pos, width;
    long size;
    char info[256];

    if (action == FILE_WRITE) {
        handle = OpenFile (path, FILE_WRITE, 0, ascii);
        if (!ascii) FmtFile (handle, "BINARY\n");
    }
    else {
        handle = OpenFile (path, action, 0, 0);
        nBytes = ReadLine (handle, info, 255);
        if (CompareBytes (info, 0, "BINARY", 0, 6, 0) != 0) {
            CloseFile (handle);
            handle = OpenFile (path, action, 0, 1);
            ascii = TRUE;
        }
    }
	if(handle)
    {
		fileP = LoadPanel (0, "utilu.uir", FILESTAT);

    	

    	if (action == FILE_WRITE) {
        	Fmt (info, "Saving file: %s", path);
        	if (ascii) Fmt (info, "%s[a]< (ASCII file...go for coffee!)");
    	} else {
        	GetFileSize (path, &size);
        	Fmt (info, "Loading file: %s (%i kB)", path, size/1000);
        	if (ascii) Fmt (info, "%s[a]< (ASCII file...take a nap!)");
    	}

    	SetCtrlVal (fileP, FILESTAT_TEXT, info);
    	GetCtrlAttribute (fileP, FILESTAT_TEXT, ATTR_WIDTH, &width);
    	SetPanelAttribute (fileP, ATTR_WIDTH, width+12);
    	SetCtrlAttribute (fileP, FILESTAT_TEXT, ATTR_LEFT, 6);

    	SetPanelPos (fileP, VAL_AUTO_CENTER, VAL_AUTO_CENTER);
    	InstallPopup (fileP);
	}
	else
		handle = 0;
	return handle;
}
Example #24
0
int  das1602_MeasureControlCallback (int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
{
    acqchanPtr acqchan = callbackData;
    switch (control)
    {
        case MEASURE_RANGE:
            if (event == EVENT_COMMIT)
            {
                portPtr port = acqchan->upLvl;
                GetCtrlVal (panel, control, &port->port.analogueIOport.range);
            }
            break;
        case MEASURE_LABEL:
            if (event == EVENT_COMMIT)
            {
                portPtr port = acqchan->upLvl;
                MCCdevPtr dev = acqchan->dev;
                das1602Ptr das = dev->device;
                GetCtrlVal(panel, control, acqchan->channel->label);
                acqchanlist_ReplaceChannel(acqchan);
                SetPanelAttribute(panel, ATTR_TITLE, acqchan->channel->label);
                SetMenuBarAttribute (das->menu, port->menuitem_id, ATTR_ITEM_NAME,
                                     acqchan->channel->label);
            }
            break;
        case MEASURE_COEFF:
            if (event == EVENT_COMMIT)
                GetCtrlVal(panel, control, &acqchan->coeff);
            break;
        case MEASURE_ACQ:
            if (event == EVENT_COMMIT && utilG.acq.status != ACQ_BUSY)
            {
                portPtr port = acqchan->upLvl;
                MCCdevPtr dev = acqchan->dev;
                das1602Ptr das = dev->device;
                GetCtrlVal(panel, control, &acqchan->acquire);
                if (acqchan->acquire) acqchanlist_AddChannel(acqchan);
                else acqchanlist_RemoveChannel(acqchan);
                SetMenuBarAttribute (das->menu, port->menuitem_id, ATTR_CHECKED, acqchan->acquire);
            }
            else if(event == EVENT_COMMIT && utilG.acq.status == ACQ_BUSY)
                SetCtrlVal (panel, control, acqchan->acquire);
            break;
    }
    return 0;
}
Example #25
0
void InitAddChannelsCallback(int menubar, int menuItem, void *callbackData, int panel)
{
    int i;
    channelPtr chan;

    chanops.p = LoadPanel (0, "chanopsu.uir", CHANOPS_1);
    
    util_InitClose (chanops.p, CHANOPS_1_CANCEL, TRUE);
    SetPanelPos (chanops.p, 100, 100);

    InstallCtrlCallback (chanops.p, CHANOPS_1_GO,
                         DoChannelAdditionCallback, 0);
    SetPanelAttribute (chanops.p, ATTR_TITLE, "Channel Addition");
    channellist_Copy (chanops.p, CHANOPS_1_CHANNELS);

    InstallPopup (chanops.p);
}
Example #26
0
void das1602_MenuCallback(int menbar, int menuItem, void *callbackData, int panel)
{
    switch (menuItem)
    {
        case DASMENU_MEAS_IN_0:
        case DASMENU_MEAS_IN_1:
        case DASMENU_MEAS_IN_2:
        case DASMENU_MEAS_IN_3:
        case DASMENU_MEAS_IN_4:
        case DASMENU_MEAS_IN_5:
        case DASMENU_MEAS_IN_6:
        case DASMENU_MEAS_IN_7:
            if(utilG.acq.status != ACQ_BUSY){
                portPtr port = callbackData;
                MCCdevPtr dev = port->port.analogueIOport.IO.acqchan->dev;
                das1602Ptr das = dev->device;
                port->menuitem_id = menuItem;
                port->measPanel = port->measPanel? port->measPanel : LoadPanel(utilG.p, "DAS-1602u.uir", MEASURE);
                SetCtrlAttribute (port->measPanel, MEASURE_RANGE, ATTR_CALLBACK_DATA, port->port.analogueIOport.IO.acqchan);
                SetCtrlAttribute (port->measPanel, MEASURE_LABEL, ATTR_CALLBACK_DATA, port->port.analogueIOport.IO.acqchan);
                SetCtrlAttribute (port->measPanel, MEASURE_COEFF, ATTR_CALLBACK_DATA, port->port.analogueIOport.IO.acqchan);
                SetCtrlAttribute (port->measPanel, MEASURE_NOTE, ATTR_CALLBACK_DATA, port->port.analogueIOport.IO.acqchan);
                SetCtrlAttribute (port->measPanel, MEASURE_ACQ, ATTR_CALLBACK_DATA, port->port.analogueIOport.IO.acqchan);
                SetPanelAttribute (port->measPanel, ATTR_TITLE, port->port.analogueIOport.IO.acqchan->channel->label);
                SetCtrlVal (port->measPanel, MEASURE_LABEL, port->port.analogueIOport.IO.acqchan->channel->label);
                SetCtrlVal (port->measPanel, MEASURE_RANGE, port->port.analogueIOport.range);
                SetCtrlVal (port->measPanel, MEASURE_COEFF, port->port.analogueIOport.IO.acqchan->coeff);
                SetCtrlVal (port->measPanel, MEASURE_NOTE, port->port.analogueIOport.IO.acqchan->note);
                SetCtrlVal (port->measPanel, MEASURE_ACQ, port->port.analogueIOport.IO.acqchan->acquire);
                DisplayPanel (port->measPanel);
            }
            break;
        case DASMENU_SOURCE_DAC1:
        case DASMENU_SOURCE_DAC2:
            {
                sourcePtr src = callbackData;
                switch(utilG.exp)
                {
                    case EXP_SOURCE: source_InitPanel(src); break;
                    case EXP_FLOAT : gensrc_InitPanel(src); break;
                }
            }
            break;
    }
}
Example #27
0
void usb1208lsOperate (int menubar, int menuItem, void *callbackData, int panel)
{
    MCCdevPtr dev = callbackData;
    usb1208lsPtr pmd = dev->device;
    acqchanPtr acqchan;
    int i, x = 0, m;
    if(!pmd->panel)
    {
        pmd->panel = LoadPanel(utilG.p, "USB-1208LSu.uir", USB1208LS);
        pmd->menu = LoadMenuBar(pmd->panel, "USB-1208LSu.uir", USBMENU);
        SetPanelMenuBar(pmd->panel, pmd->menu);
        for(i = 0; i < 4; i ++)
        {
            SetMenuBarAttribute (pmd->menu, pmd->aiPorts[i]->menuitem_id, ATTR_CALLBACK_DATA, pmd->aiPorts[i]);
            SetMenuBarAttribute (pmd->menu, pmd->aiPorts[i]->menuitem_id, ATTR_ITEM_NAME, pmd->aiPorts[i]->port.analogueIOport.IO.acqchan->channel->label);
            SetMenuBarAttribute (pmd->menu, pmd->aiPorts[i]->menuitem_id, ATTR_CHECKED, pmd->aiPorts[i]->port.analogueIOport.IO.acqchan->acquire);
        }
        SetMenuBarAttribute (pmd->menu, USBMENU_SOURCE_DAC1, ATTR_CALLBACK_DATA, pmd->aoPorts[0]->port.analogueIOport.IO.source);
        SetMenuBarAttribute (pmd->menu, USBMENU_SOURCE_DAC2, ATTR_CALLBACK_DATA, pmd->aoPorts[1]->port.analogueIOport.IO.source);
        SetMenuBarAttribute (pmd->menu, USBMENU_SOURCE_DAC3, ATTR_CALLBACK_DATA, pmd->aoPorts[2]->port.analogueIOport.IO.source);
        SetMenuBarAttribute (pmd->menu, USBMENU_SOURCE_DAC4, ATTR_CALLBACK_DATA, pmd->doPort);
        SetMenuBarAttribute (pmd->menu, USBMENU_SOURCE_DAC1, ATTR_ITEM_NAME, pmd->aoPorts[0]->port.analogueIOport.IO.source->acqchan->channel->label);
        SetMenuBarAttribute (pmd->menu, USBMENU_SOURCE_DAC2, ATTR_ITEM_NAME, pmd->aoPorts[1]->port.analogueIOport.IO.source->acqchan->channel->label);
        SetMenuBarAttribute (pmd->menu, USBMENU_SOURCE_DAC3, ATTR_ITEM_NAME, pmd->aoPorts[2]->port.analogueIOport.IO.source->acqchan->channel->label);
        
        SetMenuBarAttribute (pmd->menu, USBMENU_FILE_SAVE, ATTR_CALLBACK_DATA, dev);
        SetMenuBarAttribute (pmd->menu, USBMENU_FILE_LOAD, ATTR_CALLBACK_DATA, dev);
        
        SetCtrlAttribute (pmd->panel, USB1208LS_RANGE, ATTR_DIMMED, 1);
        SetCtrlAttribute (pmd->panel, USB1208LS_ACQ, ATTR_DIMMED, 1);
        
        /*SetCtrlAttribute (pmd->panel, USB1208LS_DIGITAL_OUT_0, ATTR_CALLBACK_DATA, pmd->doPort);
        SetCtrlAttribute (pmd->panel, USB1208LS_DIGITAL_OUT_1, ATTR_CALLBACK_DATA, pmd->doPort);
        SetCtrlAttribute (pmd->panel, USB1208LS_DIGITAL_OUT_2, ATTR_CALLBACK_DATA, pmd->doPort);
        SetCtrlAttribute (pmd->panel, USB1208LS_DIGITAL_OUT_3, ATTR_CALLBACK_DATA, pmd->doPort);
        SetCtrlAttribute (pmd->panel, USB1208LS_DIGITAL_OUT_4, ATTR_CALLBACK_DATA, pmd->doPort);            
        SetCtrlAttribute (pmd->panel, USB1208LS_DIGITAL_OUT_5, ATTR_CALLBACK_DATA, pmd->doPort);*/          
        SetCtrlAttribute (pmd->panel, USB1208LS_INPUT, ATTR_CALLBACK_DATA, pmd->aiPorts[0]);
        SetPanelAttribute (pmd->panel, ATTR_CALLBACK_DATA, pmd);
    }
    SetMenuBarAttribute(menubar, menuItem, ATTR_DIMMED, 1);
    devPanel_Add (pmd->panel, dev, usb1208ls_UpdateReadings);
    DisplayPanel(pmd->panel);
}
Example #28
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;
}
Example #29
0
void CVICALLBACK Help (int menuBar, int menuItem, void *callbackData,
		int panel)
{
	if ((outputHandle = LoadPanel (0, "Remotely.uir", OUTPUTVIEW)) < 0)
		 {
		 SetCtrlVal (panelHandle, PANEL_TEXTBOX,  "Load check uptime panel error,please try again!\r\n"); 
	 	 return;
		 }
	 SetPanelAttribute (outputHandle, ATTR_TITLE, "HelpInformation");
	 DimAction(1); 
	 if(WriteOupputBox(1))
	 {
	 	InstallPopup(outputHandle);
	 }
	 else
	 {
	  SetCtrlVal (panelHandle, PANEL_TEXTBOX, "Read data from help.txt error,please check it by manual!\r\n");
	 }
	 DimAction(0);
	
}
Example #30
0
void acquire_UpdatePanelExp (void)
{
    int bTop, cTop, height, bottom;

/* Floating experiment */

    SetCtrlAttribute (acqG.p.setup, ACQSETUP_GEN_POINTS, ATTR_VISIBLE, utilG.exp == EXP_FLOAT);
    SetCtrlAttribute (acqG.p.setup, ACQSETUP_GEN_DELAY, ATTR_VISIBLE, utilG.exp == EXP_FLOAT);
    SetCtrlAttribute (acqG.p.setup, ACQSETUP_GEN_TIME, ATTR_VISIBLE, utilG.exp == EXP_FLOAT);
    SetMenuBarAttribute (acquire_GetMenuBar(), ACQMENUS_EXP_GENERAL, ATTR_CHECKED, utilG.exp == EXP_FLOAT);

/* Source experiment */

    SetCtrlAttribute (acqG.p.setup, ACQSETUP_SRC_LIST, ATTR_VISIBLE, utilG.exp == EXP_SOURCE);
    SetCtrlAttribute (acqG.p.setup, ACQSETUP_SRC_MOVEUP, ATTR_VISIBLE, utilG.exp == EXP_SOURCE);
    SetCtrlAttribute (acqG.p.setup, ACQSETUP_SRC_MOVEDOWN, ATTR_VISIBLE, utilG.exp == EXP_SOURCE);
    SetCtrlAttribute (acqG.p.setup, ACQSETUP_SRC_REMOVE, ATTR_VISIBLE, utilG.exp == EXP_SOURCE);
    SetCtrlAttribute (acqG.p.setup, ACQSETUP_SRC_POINTS, ATTR_VISIBLE, utilG.exp == EXP_SOURCE);
    SetCtrlAttribute (acqG.p.setup, ACQSETUP_SRC_TIME, ATTR_VISIBLE, utilG.exp == EXP_SOURCE);
    SetMenuBarAttribute (acquire_GetMenuBar(), ACQMENUS_EXP_SOURCE, ATTR_CHECKED, utilG.exp == EXP_SOURCE);


    switch (utilG.exp) {
        case EXP_FLOAT:
            GetCtrlAttribute (acqG.p.setup, ACQSETUP_GEN_DELAY, ATTR_TOP, &cTop);
            GetCtrlAttribute (acqG.p.setup, ACQSETUP_GEN_DELAY, ATTR_HEIGHT, &height);
            SetCtrlVal (acqG.p.setup, ACQSETUP_EXPTITLE, "Floating Experiment");
            break;
        case EXP_SOURCE:
            GetCtrlAttribute (acqG.p.setup, ACQSETUP_SRC_POINTS, ATTR_TOP, &cTop);
            GetCtrlAttribute (acqG.p.setup, ACQSETUP_SRC_POINTS, ATTR_HEIGHT, &height);
            SetCtrlVal (acqG.p.setup, ACQSETUP_EXPTITLE, "source control experiment");
            break;
    }

    GetCtrlAttribute (acqG.p.setup, ACQSETUP_BOX_1, ATTR_TOP, &bTop);
    SetCtrlAttribute (acqG.p.setup, ACQSETUP_BOX_1, ATTR_HEIGHT, cTop+height+10-bTop);
    SetPanelAttribute (acqG.p.setup, ATTR_HEIGHT, cTop+height+36);
}