Exemplo n.º 1
0
int CVICALLBACK pFunctions (int panel, int event, void *callbackData,
                            int eventData1, int eventData2)
{
    switch (event)
    {
        case EVENT_KEYPRESS:
        if(eventData1 == VAL_END_VKEY)            // Escape == Panel schliessen
        {
            if(panel != pBasicFn)
                HidePanel(panel);
        }
        break;
        
        case EVENT_CLOSE:
            if (panel == pSystem)
                HidePanel(pSystem);
            if (panel == pBasicFn)
            {
                PiCardFnct (PI_HOME);
                QuitUserInterface(0);
            }
            if (panel == pControlPad)
                HidePanel(pControlPad);
        break;
    }
    return 0;
}
Exemplo n.º 2
0
Arquivo: K213.c Projeto: 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;
}
Exemplo n.º 3
0
int das1602_PanelCallback (int panel, int event, void *callbackData, int eventData1, int eventData2)
{
    das1602Ptr das = callbackData;
    if((event == EVENT_KEYPRESS && eventData1 == VAL_ESC_VKEY) || event == EVENT_RIGHT_DOUBLE_CLICK)
    {
        MCCdevPtr dev = das->Achannels[0]->port.analogueIOport.IO.acqchan->dev;
        int i;
        for (i = 0; i < 8; i ++)
            if(das->Achannels[i]->measPanel)
                HidePanel(das->Achannels[i]->measPanel);
        devPanel_Remove(panel);
        HidePanel(panel);
        SetMenuBarAttribute (acquire_GetMenuBar(), dev->menuitem_id, ATTR_DIMMED, FALSE);
    }
    return 0;
}
Exemplo n.º 4
0
Arquivo: Sr844.c Projeto: gaorlov/DAAS
void sr844_XYRP_UpdateReadings (int panel, void *lia)
{
    sr844Ptr my_lia = lia;

    SetCtrlVal (panel, SR844_XYMP_XMEAS, my_lia->channels[X]->reading);
    SetCtrlVal (panel, SR844_XYMP_YMEAS, my_lia->channels[Y]->reading);
    SetCtrlVal (panel, SR844_XYMP_RMEAS, my_lia->channels[R]->reading);
    SetCtrlVal (panel, SR844_XYMP_PMEAS, my_lia->channels[T]->reading);
	if(utilG.acq.status == ACQ_BUSY)
		HidePanel(panel);
}
Exemplo n.º 5
0
	/*
int main (int argc, char *argv[])
{
	if (InitCVIRTE (0, argv, 0) == 0)
		return -1;	// out of memory
	if ((panel_open = LoadPanel (0, "Panel_OpenProject.uir", OPPANEL)) < 0)
		return -1;
	DisplayPanel (panel_open);
	RunUserInterface ();
	DiscardPanel (panel_open);
	return 0;
}
*/
int CVICALLBACK OpenProjectCancel (int panel, int control, int event,
		void *callbackData, int eventData1, int eventData2)
{
	switch (event)
	{
		case EVENT_COMMIT:
			HidePanel (panel_open);
			DisplayPanel (panel_main);
			break;
	}
	return 0;
}
Exemplo n.º 6
0
Arquivo: Sr844.c Projeto: gaorlov/DAAS
void sr844_ADC_UpdateReadings (int panel, void *dev)
{
    gpibioPtr my_dev = dev;
    sr844Ptr lia = my_dev->device;

    sr844_GetADCs (my_dev);

    SetCtrlVal (panel, SR844_ADC_MEAS_1, lia->channels[ADC1]->reading);
    SetCtrlVal (panel, SR844_ADC_MEAS_2, lia->channels[ADC2]->reading);
	if(utilG.acq.status == ACQ_BUSY)
		HidePanel(panel);
}
Exemplo n.º 7
0
int CVICALLBACK SaveSetup (int panel, int control, int event,
		void *callbackData, int eventData1, int eventData2)
{
	switch (event)
	{
		case EVENT_COMMIT:
			DisplayPanel (panelHandle_calibration);
			StackPush(&panel_stack, panel);
			HidePanel (panel);
			break;
	}
	return 0;
}
Exemplo n.º 8
0
/** @brief This function gives the button functionality
	@param panel the panel handle of the panel on which the button is used
	@param control the control on which the event is generated
	@param event the type of event generated (i.e. left-click causes EVENT_COMMIT)
	@param *callbackData stores the data returned to the UI handled internally by LabWindows
	@param eventData1 stores ancillary information such as the mouse x-position within the panel
	@param eventData2 stores ancillary information such as the mouse y-position within the panel
	@return 1 or 0 specifies whether or not the event should be swallowed. 0 is default-no and 1 is yes-swallow.

### EXTERNAL VARIABLES
    - extern int @ref panelHandle - "OpenPET.c"
	- extern int @ref panelHandle_timemode_mb - "OpenPET.c"
	- extern int @ref panelHandle_timemode_duc - "OpenPET.c"
	- extern int @ref panelHandle_timemode_db - "OpenPET.c"
	- extern int @ref panelHandle_timemode - "OpenPET.c" 
	- extern Stack @ref panel_stack - "UI_Common.c"
	- extern OpenPETTree @ref current_location - "UI_Common.c"

### ABNORMAL TERMINATION CONDITIONS, ERROR AND WARNING MESSAGES
	Errors may be generated by CVI/LabWindows. The LabWindows documentation is available online 
	at <a href="linkURL"> http://zone.ni.com/reference/en-XX/help/370051V-01/ </a>.
	
###	ALGORITHM
	When the button is clicked, the current location is updated, the proper panel is displayed, and the
	stack is updated.
	
###	DEVELOPMENT HISTORY
       Date    |  Author         |  Email Address     | Ver. |Description Of Change  
	   --------|-----------------|--------------------|------|---------------------
	 08/09/2013| George Netscher | [email protected] | 1.0  |conclusion of summer work
	 
### Copyright (c) 2013 by LBNL. All Rights Reserved.
*/
int CVICALLBACK TimeModeDB (int panel, int control, int event,
		void *callbackData, int eventData1, int eventData2)
{
	switch (event)
	{
		case EVENT_COMMIT:
			// switch on control for DB0...DB7
			switch (control)
			{
				case TIMEMODEDB_BUTTON_0:
					current_location.DB = 0;
					break;
				case TIMEMODEDB_BUTTON_1:
					current_location.DB = 1;
					break;
				case TIMEMODEDB_BUTTON_2:
					current_location.DB = 2;
					break;
				case TIMEMODEDB_BUTTON_3:
					current_location.DB = 3;
					break;
				case TIMEMODEDB_BUTTON_4:
					current_location.DB = 4;
					break;
				case TIMEMODEDB_BUTTON_5:
					current_location.DB = 5;
					break;
				case TIMEMODEDB_BUTTON_6:
					current_location.DB = 6;
					break;
				case TIMEMODEDB_BUTTON_7:
					current_location.DB = 7;
					break;
			}
			
			DisplayPanel (panelHandle_timemode);
			StackPush(&panel_stack, panel); 
			HidePanel (panel);
			break;
	}
	return 0;
}
Exemplo n.º 9
0
/** @brief This function gives the button functionality
	@param panel the panel handle of the panel on which the button is used
	@param control the control on which the event is generated
	@param event the type of event generated (i.e. left-click causes EVENT_COMMIT)
	@param *callbackData stores the data returned to the UI handled internally by LabWindows
	@param eventData1 stores ancillary information such as the mouse x-position within the panel
	@param eventData2 stores ancillary information such as the mouse y-position within the panel
	@return 1 or 0 specifies whether or not the event should be swallowed. 0 is default-no and 1 is yes-swallow.

### EXTERNAL VARIABLES
    - extern int @ref panelHandle - "OpenPET.c"
	- extern int @ref panelHandle_usermode_mb - "OpenPET.c"
	- extern int @ref panelHandle_usermode_duc - "OpenPET.c"
	- extern int @ref panelHandle_usermode_db - "OpenPET.c"
	- extern int @ref panelHandle_usermode - "OpenPET.c" 
	- extern Stack @ref panel_stack - "UI_Common.c"
	- extern OpenPETTree @ref current_location - "UI_Common.c"

### ABNORMAL TERMINATION CONDITIONS, ERROR AND WARNING MESSAGES
	Errors may be generated by CVI/LabWindows. The LabWindows documentation is available online 
	at <a href="linkURL"> http://zone.ni.com/reference/en-XX/help/370051V-01/ </a>.
	
###	ALGORITHM
	When the button is clicked, the current location is updated, the proper panel is displayed, and the
	stack is updated.
	
###	DEVELOPMENT HISTORY
       Date    |  Author         |  Email Address     | Ver. |Description Of Change  
	   --------|-----------------|--------------------|------|---------------------
	 08/09/2013| George Netscher | [email protected] | 1.0  |conclusion of summer work
	 
### Copyright (c) 2013 by LBNL. All Rights Reserved.
*/
int CVICALLBACK UserModeMB (int panel, int control, int event,
		void *callbackData, int eventData1, int eventData2)
{
	switch (event)
	{
		case EVENT_COMMIT:
			// switch on control for MB0...MB7
			switch (control)
			{
				case USERMODEMB_BUTTON_0:
					current_location.MB = 0;
					break;
				case USERMODEMB_BUTTON_1:
					current_location.MB = 1;
					break;
				case USERMODEMB_BUTTON_2:
					current_location.MB = 2;
					break;
				case USERMODEMB_BUTTON_3:
					current_location.MB = 3;
					break;
				case USERMODEMB_BUTTON_4:
					current_location.MB = 4;
					break;
				case USERMODEMB_BUTTON_5:
					current_location.MB = 5;
					break;
				case USERMODEMB_BUTTON_6:
					current_location.MB = 6;
					break;
				case USERMODEMB_BUTTON_7:
					current_location.MB = 7;
					break;
			}
			
			DisplayPanel (panelHandle_usermode_duc);
			StackPush(&panel_stack, panel); 
			HidePanel (panel);
			break;
	}
	return 0;
}
Exemplo n.º 10
0
/** @brief This function gives the button functionality
	@param panel the panel handle of the panel on which the button is used
	@param control the control on which the event is generated
	@param event the type of event generated (i.e. left-click causes EVENT_COMMIT)
	@param *callbackData stores the data returned to the UI handled internally by LabWindows
	@param eventData1 stores ancillary information such as the mouse x-position within the panel
	@param eventData2 stores ancillary information such as the mouse y-position within the panel
	@return 1 or 0 specifies whether or not the event should be swallowed. 0 is default-no and 1 is yes-swallow.

### EXTERNAL VARIABLES
    - extern int @ref panelHandle - "OpenPET.c"
	- extern int @ref panelHandle_fmmode_mb - "OpenPET.c"
	- extern int @ref panelHandle_fmmode_duc - "OpenPET.c"
	- extern int @ref panelHandle_fmmode - "OpenPET.c" 
	- extern Stack @ref panel_stack - "UI_Common.c"
	- extern OpenPETTree @ref current_location - "UI_Common.c"

### ABNORMAL TERMINATION CONDITIONS, ERROR AND WARNING MESSAGES
	Errors may be generated by CVI/LabWindows. The LabWindows documentation is available online 
	at <a href="linkURL"> http://zone.ni.com/reference/en-XX/help/370051V-01/ </a>.
	
###	ALGORITHM
	When the button is clicked, the current location is updated, the proper panel is displayed, and the
	stack is updated.
	
###	DEVELOPMENT HISTORY
       Date    |  Author         |  Email Address     | Ver. |Description Of Change  
	   --------|-----------------|--------------------|------|---------------------
	 08/09/2013| George Netscher | [email protected] | 1.0  |conclusion of summer work
	 
### Copyright (c) 2013 by LBNL. All Rights Reserved.
*/
int CVICALLBACK FloodMapModeDUC (int panel, int control, int event,
		void *callbackData, int eventData1, int eventData2)
{
	switch (event)
	{
		case EVENT_COMMIT:
			// switch on control for DUC0...DUC7
			switch (control)
			{
				case FMMODEDU_BUTTON_0:
					current_location.DUC = 0;
					break;
				case FMMODEDU_BUTTON_1:
					current_location.DUC = 1;
					break;
				case FMMODEDU_BUTTON_2:
					current_location.DUC = 2;
					break;
				case FMMODEDU_BUTTON_3:
					current_location.DUC = 3;
					break;
				case FMMODEDU_BUTTON_4:
					current_location.DUC = 4;
					break;
				case FMMODEDU_BUTTON_5:
					current_location.DUC = 5;
					break;
				case FMMODEDU_BUTTON_6:
					current_location.DUC = 6;
					break;
				case FMMODEDU_BUTTON_7:
					current_location.DUC = 7;
					break;
			}
			
			DisplayPanel (panelHandle_fmmode);
			StackPush(&panel_stack, panel); 
			HidePanel (panel);
			break;
	}
	return 0;
}
Exemplo n.º 11
0
int CVICALLBACK OpenProjectConfirm (int panel, int control, int event,
		void *callbackData, int eventData1, int eventData2)
{
	switch (event)
	{
		case EVENT_COMMIT:
			int i, checked;
/*			for (i = 0; i < projectlist.number; i++)
			{
				IsListItemChecked(panel_open,OPPANEL_TREE_ProjectList,i,&checked);
				if (checked)
				{
					MessagePopup("Number of Projects","checked");
					operatingproject = projectlist.projects[i];
					break;
				}
			}*/
			GetTreeItem(panel_open,OPPANEL_TREE_ProjectList,VAL_ALL,0,0,VAL_NEXT_PLUS_SELF,VAL_SELECTED,&i);
			if (i == -1)
			{
				MessagePopup("打开时出错!","请选中某项后再点击打开按钮");
				return -1;
			}
			if (state_open == 1)
			{
				operatingproject = projectlist.projects[i];
				getDetails(&operatingproject);
				openproject();
			}
			else
			{
				operatinggroupnum = i+1;
				openmeasuregroup();
			}
			HidePanel (panel_open);
			state_open = 0;
			DisplayPanel (panel_main);
			break;
	}
	return 0;
}
Exemplo n.º 12
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;
}
Exemplo n.º 13
0
/** @brief This function gives the tree functionality
	@param panel the panel handle of the panel on which the button is used
	@param control the control on which the event is generated
	@param event the type of event generated (i.e. left-click causes EVENT_COMMIT)
	@param *callbackData stores the data returned to the UI handled internally by LabWindows
	@param eventData1 stores ancillary information such as the mouse x-position within the panel
	@param eventData2 stores ancillary information such as the mouse y-position within the panel
	@return 1 or 0 specifies whether or not the event should be swallowed. 0 is default-no and 1 is yes-swallow.

### EXTERNAL VARIABLES
    - extern int @ref panelHandle - "OpenPET.c"
	- extern int @ref panelHandle_fmmode_mb - "OpenPET.c"
	- extern int @ref panelHandle_fmmode_duc - "OpenPET.c"
	- extern int @ref panelHandle_fmmode - "OpenPET.c" 
	- extern Stack @ref panel_stack - "UI_Common.c"
	- extern OpenPETTree @ref current_location - "UI_Common.c"

### ABNORMAL TERMINATION CONDITIONS, ERROR AND WARNING MESSAGES
	Errors may be generated by CVI/LabWindows. The LabWindows documentation is available online 
	at <a href="linkURL"> http://zone.ni.com/reference/en-XX/help/370051V-01/ </a>.
	
###	ALGORITHM
	The tree item double-clicked on is given as an index in eventData2. The tag is extracted (i.e. MB0DUC1DB2).
	This tag is parsed to specify the new desired location. The new panel is displayed and the stack is
	updated to allow the desired functionality in the back button.
	
###	DEVELOPMENT HISTORY
       Date    |  Author         |  Email Address     | Ver. |Description Of Change  
	   --------|-----------------|--------------------|------|---------------------
	 08/09/2013| George Netscher | [email protected] | 1.0  |conclusion of summer work
	 
### Copyright (c) 2013 by LBNL. All Rights Reserved.
*/
int CVICALLBACK FloodMapModeTree (int panel, int control, int event,
		void *callbackData, int eventData1, int eventData2)
{
	char item_tag[32];
	OpenPETTree new_location;
	int i, idx=0, current_boards[3]={-1,-1,-1};
	
	switch (event)
	{
		case EVENT_COMMIT:

			// eventData2 contains index of tree item double-clicked
			GetTreeItemTag(panel, control, eventData2, item_tag);
			
			// update current_location so panel will initialize properly
			OpenPETTreeInit(&new_location);   // set to (-1, -1, -1, "NULL")
			new_location.mode = current_location.mode;
			
			for(i=0; i<32; i++)
			{
				// walk through tag string and pull out board numbers
				if( isdigit(item_tag[i]) )
				{
					current_boards[idx++] = (int)(item_tag[i] - '0');
				}
			}
			new_location.MB = current_boards[0];
			new_location.DUC = current_boards[1];
			new_location.DB = current_boards[2];
			
			// clear panel stack up to root panel 
			while( StackPeek(&panel_stack) != panelHandle )
			{
				StackPop(&panel_stack);	
			}
			
			// determine proper panel to display
			/*
			if(new_location.DB != -1) 
			{
				StackPush(&panel_stack, panelHandle_fmmode_mb); 
				StackPush(&panel_stack, panelHandle_fmmode_duc); 
				
				HidePanel (panel);				
				DisplayPanel (panelHandle_fmmode);
				
			}
			*/
			if (new_location.DUC != -1)
			{
				HidePanel(panel);				
				StackPush(&panel_stack, panelHandle_fmmode_mb); 
				StackPush(&panel_stack, panelHandle_fmmode_duc); 
				DisplayPanel(panelHandle_fmmode);
			}
			else if (new_location.MB != -1)
			{
				HidePanel(panel);
				StackPush(&panel_stack, panelHandle_fmmode_mb); 
				DisplayPanel(panelHandle_fmmode_duc);
			}
			else if (new_location.MB == -1)
			{
				HidePanel(panel);
				DisplayPanel(panelHandle_fmmode_mb);
			}
			else {
				HidePanel(panel); 
				DisplayPanel(StackPop(&panel_stack));
			}
			
			current_location.MB = new_location.MB;
			current_location.DUC = new_location.DUC;
			current_location.DB = new_location.DB;
			break;
	}
	return 0;
}
Exemplo n.º 14
0
/*****************************************************************************
.
. Función C:			PRE_UbicarPanel
. Responsable:			César Armando Cruz Mendoza
. Descripcion: 			Despliega un panel en pantalla considerando las
.						condiciones de la misma como lo es la posicion del
.						panel anterior y si existe el menu desplegado
. Parámetro de entrada:	Ninguno
. Parámetro de salida:	Referencia a la cadena de caracteres con el mensaje
. Fecha de creación:	31 de Marzo de 2014
.
*****************************************************************************/
int PRE_UbicarPanel(int iPanel)
{
	int iBarra=0;
	int iAlto=0;
	int iAncho=0;
	int iExistePanel=0;
	int iLeftPanelExiste=0;
	static int iPanelAnterior=0;
	

	if (iPanel!=0)
	{
		if (iPanelAnterior != 0)
			GetPanelAttribute (iPanelAnterior, ATTR_LEFT, &iLeftPanelExiste);
	
	
		if ((iPanelAnterior != 0) && (iPanelAnterior != iPanel))
		{
			//implementa la animación de salida
			int i=0;
		
			while (i<60)
			{
				SetPanelAttribute(iPanelAnterior, ATTR_LEFT, iLeftPanelExiste-i);
				DelayWithEventProcessing (.001);
				i+=20;
			}
		
			SetPanelAttribute (iPanelAnterior, ATTR_VSCROLL_OFFSET, 0);
			SetPanelAttribute (iPanelAnterior, ATTR_HSCROLL_OFFSET, 0);
		
			HidePanel(iPanelAnterior);
		}
	
	
		GetPanelAttribute(iPanelMenuPrincipal, ATTR_VISIBLE, &iExistePanel);
		if (iExistePanel==1)
			iLeftPanelExiste = ANCHO_MENU;
	
		GetPanelAttribute (iPanelPrincipal, ATTR_HEIGHT, &iAlto);
		GetPanelAttribute (iPanelPrincipal, ATTR_WIDTH, &iAncho);
	
		GetCtrlAttribute(iPanelPrincipal, pPrincipal_SPLITTER, ATTR_TOP, &iBarra);
	
		SetPanelAttribute(iPanel, ATTR_TOP, iBarra+8);
		SetPanelAttribute(iPanel, ATTR_LEFT, iLeftPanelExiste);
		SetPanelAttribute (iPanel, ATTR_TITLEBAR_VISIBLE, 0);
		SetPanelAttribute (iPanel, ATTR_FRAME_STYLE, VAL_HIDDEN_FRAME);
	
		SetPanelAttribute (iPanel, ATTR_HEIGHT, iAlto-120);
		SetPanelAttribute (iPanel, ATTR_WIDTH, iAncho-iLeftPanelExiste);
	
		GetPanelAttribute(iPanel, ATTR_VISIBLE, &iExistePanel);

		if (iExistePanel==0)
		{
			DisplayPanel(iPanel);
			iPanelVisible = iPanel;
		}
	
		iPanelAnterior = iPanel;
	}
	
	return 0;
}
Exemplo n.º 15
0
Arquivo: util.c Projeto: gaorlov/DAAS
int  util_DiscardPanelCallback(int panel, int event, void *callbackData, int eventData1, int eventData2)
{
    if (((event == EVENT_KEYPRESS) && (eventData1 == VAL_ESC_VKEY)) || (event == EVENT_RIGHT_DOUBLE_CLICK))
		HidePanel (panel);
	return 0;
}
Exemplo n.º 16
0
/** @brief This function gives the tree functionality
	@param panel the panel handle of the panel on which the button is used
	@param control the control on which the event is generated
	@param event the type of event generated (i.e. left-click causes EVENT_COMMIT)
	@param *callbackData stores the data returned to the UI handled internally by LabWindows
	@param eventData1 stores ancillary information such as the mouse x-position within the panel
	@param eventData2 stores ancillary information such as the mouse y-position within the panel
	@return 1 or 0 specifies whether or not the event should be swallowed. 0 is default-no and 1 is yes-swallow.

### EXTERNAL VARIABLES
    - extern int @ref panelHandle - "OpenPET.c"
	- extern int @ref panelHandle_timemode_mb - "OpenPET.c"
	- extern int @ref panelHandle_timemode_duc - "OpenPET.c"
	- extern int @ref panelHandle_timemode_db - "OpenPET.c"
	- extern int @ref panelHandle_timemode - "OpenPET.c" 
	- extern Stack @ref panel_stack - "UI_Common.c"
	- extern OpenPETTree @ref current_location - "UI_Common.c"

### ABNORMAL TERMINATION CONDITIONS, ERROR AND WARNING MESSAGES
	Errors may be generated by CVI/LabWindows. The LabWindows documentation is available online 
	at <a href="linkURL"> http://zone.ni.com/reference/en-XX/help/370051V-01/ </a>.
	
###	ALGORITHM
	The tree item double-clicked on is given as an index in eventData2. The tag is extracted (i.e. MB0DUC1DB2).
	This tag is parsed to specify the new desired location. The new panel is displayed and the stack is
	updated to allow the desired functionality in the back button.
	
###	DEVELOPMENT HISTORY
       Date    |  Author         |  Email Address     | Ver. |Description Of Change  
	   --------|-----------------|--------------------|------|---------------------
	 08/09/2013| George Netscher | [email protected] | 1.0  |conclusion of summer work
	 
### Copyright (c) 2013 by LBNL. All Rights Reserved.
*/
int CVICALLBACK TimeModeDBTree (int panel, int control, int event,
		void *callbackData, int eventData1, int eventData2)
{
	char item_tag[32];
	OpenPETTree new_location;
	int i, idx, current_boards[3]={-1,-1,-1};
	
	switch (event)
	{
		case EVENT_COMMIT:
			// eventData2 contains index of tree item double-clicked
			GetTreeItemTag(panel, control, eventData2, item_tag);
			
			// update current_location so panel will initialize properly
			OpenPETTreeInit(&new_location);   // set to (-1, -1, -1, "NULL")
			new_location.mode = current_location.mode;
			
			if(system_size == 1)
				// large system -> fill in MB, DUC, and DB board locations
				idx = 0;
			else if(system_size == 2)
				// medium system -> fill in DUC and DB board locations
				idx = 1;
			else if(system_size == 3)
				// small system -> only fill in DB board location
				idx = 2;
			for(i=0; i<32; i++)
			{
				// walk through tag string and pull out board numbers
				if( isdigit(item_tag[i]) )
				{
					current_boards[idx++] = (int)(item_tag[i] - '0');
				}
			}
			new_location.MB = current_boards[0];
			new_location.DUC = current_boards[1];
			new_location.DB = current_boards[2];
			
			// clear panel stack up to root panel 
			while( StackPeek(&panel_stack) != panelHandle )
			{
				StackPop(&panel_stack);	
			}
			
			// determine proper panel to display
			if(new_location.DB != -1) 
			{
				if(system_size == 1)
					// large size
					StackPush(&panel_stack, panelHandle_timemode_mb); 
				if(system_size == 1 || system_size == 2)
					// large or medium size
					StackPush(&panel_stack, panelHandle_timemode_duc);
				
				StackPush(&panel_stack, panelHandle_timemode_db);
				
				HidePanel (panel);				
				DisplayPanel (panelHandle_timemode);
				
			}
			else if (new_location.DUC != -1)
			{
				// in small size, this will never be reached because DUC always equals -1
				if(system_size == 1)
					// large size
					StackPush(&panel_stack, panelHandle_timemode_mb); 
				if(system_size == 1 || system_size == 2)
					// large or medium size
					StackPush(&panel_stack, panelHandle_timemode_duc); 
				
				HidePanel(panel);
				DisplayPanel(panelHandle_timemode_db);
			}
			else if (new_location.MB != -1)
			{
				// in small or medium size, this will never be reached because MB always equals -1
				if(system_size == 1)
					// large size
					StackPush(&panel_stack, panelHandle_timemode_mb);
				
				HidePanel(panel);  
				DisplayPanel(panelHandle_timemode_duc);
			}
			else 
			{
				// only large system should reach here
				HidePanel(panel);
				DisplayPanel(panelHandle_timemode_mb);
			}
			
			current_location.MB = new_location.MB;
			current_location.DUC = new_location.DUC;
			current_location.DB = new_location.DB;
			
			break;
	}
	return 0;
}
Exemplo n.º 17
0
void SearchPanel::OnCloseButton(wxCommandEvent& WXUNUSED(evt)) {
	HidePanel();
}
Exemplo n.º 18
0
Arquivo: util.c Projeto: gaorlov/DAAS
int util_HidePanelOnLoseFocus (int panel, int event, void *callbackData, int eventData1, int eventData2)
{
	if (event == EVENT_LOST_FOCUS)
		HidePanel(panel);
	return 0;
}