|
/**
|
|
* @brief testeur DCDC
|
|
* @date 17/10/2011
|
|
* @author F.BLANC LAAS-CNRS
|
|
*
|
|
*/
|
|
#include "var.h"
|
|
|
|
/**
|
|
* @brief gestion du menu
|
|
* @param CVI
|
|
* @return CVI
|
|
* @date 25/02/2010
|
|
*
|
|
*/void CVICALLBACK CVI_menu (int menuBar, int menuItem, void *callbackData,
|
|
int panel)
|
|
{
|
|
char chn_nom[MAX_PATHNAME_LEN];
|
|
switch (menuItem)
|
|
{
|
|
//Menu FILE
|
|
case MENU_DCDC_FILE_NEW :
|
|
|
|
break;
|
|
case MENU_DCDC_FILE_LOAD :
|
|
if (FileSelectPopup (Ctrl.racine, "*.xml","*.xml", "Load consigne", VAL_LOAD_BUTTON,0,1,0,0 ,chn_nom))
|
|
{
|
|
load_consigne_xml(chn_nom);
|
|
Set_panel_control();
|
|
}
|
|
break;
|
|
case MENU_DCDC_FILE_SAVE :
|
|
Get_panel_control();
|
|
if (FileSelectPopup (Ctrl.racine, "*.xml","*.xml", "Save consigne", VAL_SAVE_BUTTON,0,1,0,1 ,chn_nom))
|
|
{
|
|
save_consigne_xml(chn_nom);
|
|
}
|
|
break;
|
|
case MENU_DCDC_FILE_QUIT :
|
|
QuitUserInterface (0);
|
|
break;
|
|
//Menu CONF
|
|
case MENU_DCDC_CONF_CONTROL :
|
|
Set_panel_control();
|
|
DisplayPanel (T_panel[PANEL_CONTROL].panel);
|
|
break;
|
|
case MENU_DCDC_CONF_POWER :
|
|
|
|
break;
|
|
case MENU_DCDC_CONF_LOAD :
|
|
|
|
break;
|
|
case MENU_DCDC_CONF_Simul :
|
|
Ctrl.Simul=!Ctrl.Simul;
|
|
SetMenuBarAttribute (barre_de_menu, MENU_DCDC_CONF_Simul, ATTR_CHECKED, Ctrl.Simul);
|
|
SetCtrlAttribute (T_panel[PANEL_MEASURE].panel,P_MEASURE_TEXTSIMUL,ATTR_VISIBLE, Ctrl.Simul);
|
|
if(Ctrl.Simul)
|
|
{
|
|
SetCtrlAttribute (T_panel[PANEL_MEASURE].panel,P_MEASURE_START,ATTR_VISIBLE, 1);
|
|
}
|
|
break;
|
|
//Menu COM
|
|
case MENU_DCDC_COM_POWER :
|
|
SetPanelAttribute (T_panel[PANEL_PORT].panel, ATTR_TITLE, "Config POWER");
|
|
validationSETUP(INST_POWER);
|
|
break;
|
|
case MENU_DCDC_COM_LOAD :
|
|
SetPanelAttribute (T_panel[PANEL_PORT].panel, ATTR_TITLE, "Config LOAD");
|
|
validationSETUP(INST_LOAD);
|
|
break;
|
|
case MENU_DCDC_COM_PM :
|
|
SetPanelAttribute (T_panel[PANEL_PORT].panel, ATTR_TITLE, "Config Power Meter");
|
|
validationSETUP(INST_PM);
|
|
break;
|
|
case MENU_DCDC_COM_AFG :
|
|
SetPanelAttribute (T_panel[PANEL_PORT].panel, ATTR_TITLE, "Config AFG");
|
|
validationSETUP(INST_AFG);
|
|
//init_GBF(INST_AFG);
|
|
break;
|
|
case MENU_DCDC_COM_AFG_2 :
|
|
SetPanelAttribute (T_panel[PANEL_PORT].panel, ATTR_TITLE, "Config AFG 2");
|
|
validationSETUP(INST_AFG_2);
|
|
//init_GBF(INST_AFG_2);
|
|
break;
|
|
//Menu WINDOWS
|
|
case MENU_DCDC_WIN_INIT :
|
|
init_reset_panel();
|
|
break;
|
|
//Menu HELP
|
|
case MENU_DCDC_HELP_VERBOSE :
|
|
Ctrl.verbose=!Ctrl.verbose;
|
|
SetMenuBarAttribute (barre_de_menu, MENU_DCDC_HELP_VERBOSE, ATTR_CHECKED, Ctrl.verbose);
|
|
break;
|
|
case MENU_DCDC_HELP_LOG :
|
|
DisplayPanel (T_panel[PANEL_LOG].panel);
|
|
break;
|
|
case MENU_DCDC_HELP_ABOUT :
|
|
DisplayPanel (T_panel[PANEL_ABOUT].panel);
|
|
break;
|
|
}
|
|
}
|