Project

General

Profile

Files » CVI_menu.c

Frédéric Blanc, 2016-01-29 10:30

 
/**
* @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 MENUBAR2_FILE_NEW :
break;
case MENUBAR2_FILE_LOAD :
break;
case MENUBAR2_FILE_SAVE :
break;
case MENUBAR2_FILE_QUIT :
QuitUserInterface (0);
break;
//Menu CONF
case MENUBAR2_CONF_BATT :
SetCtrlVal (T_panel[PANEL_BATT].panel,P_BATT_CHECKBOX_LOOP,Ctrl.mode_loop);
SetCtrlVal (T_panel[PANEL_BATT].panel,P_BATT_NB_LOOP,Ctrl.nb_loop);
SetCtrlVal (T_panel[PANEL_BATT].panel,P_BATT_CHECKBOX_VMIN,Ctrl.vminstop);
SetCtrlVal (T_panel[PANEL_BATT].panel,P_BATT_ID,Ctrl.name_Batt);
SetCtrlAttribute (T_panel[PANEL_BATT].panel,P_BATT_NB_LOOP,ATTR_DIMMED, !Ctrl.mode_loop);
DisplayPanel (T_panel[PANEL_BATT].panel);
break;
case MENUBAR2_CONF_CYCLE :
Set_panel_cycle(1);
DisplayPanel (T_panel[PANEL_CYCLE].panel);
break;
case MENUBAR2_CONF_SAVE :
if (FileSelectPopup (Ctrl.racine, "*.xml","*.xml", "Save consigne", VAL_SAVE_BUTTON,0,1,0,1 ,chn_nom))
{
save_LOG("SAVE setting XML");
save_LOG(chn_nom);
test_LOG(save_consigne_xml(chn_nom));
}
break;
case MENUBAR2_CONF_LOAD :
if (FileSelectPopup (Ctrl.racine, "*.xml","*.xml", "Load consigne", VAL_LOAD_BUTTON,0,1,0,0 ,chn_nom))
{
save_LOG("LOAD setting XML");
save_LOG(chn_nom);
test_LOG(load_consigne_xml(chn_nom));
}
break;
case MENUBAR2_CONF_EDIT :
Ctrl.mode=MODE_EDIT;
fnct_Ctrl_mode(Ctrl.mode);
break;
case MENUBAR2_CONF_SIMUL :
Ctrl.mode=MODE_SIMUL;
fnct_Ctrl_mode(Ctrl.mode);
break;
case MENUBAR2_CONF_SMU :
Ctrl.mode=MODE_SMU;
fnct_Ctrl_mode(Ctrl.mode);
break;
case MENUBAR2_CONF_PWLOAD :
Ctrl.mode=MODE_POWER_LOAD;
fnct_Ctrl_mode(Ctrl.mode);
break;
case MENUBAR2_CONF_PLPM :
Ctrl.mode=MODE_POWER_LOAD_PM;
fnct_Ctrl_mode(Ctrl.mode);
break;
//Menu COM
case MENUBAR2_COM_POWER :
SetPanelAttribute (T_panel[PANEL_PORT].panel, ATTR_TITLE, "Config POWER");
validationSETUP(INST_POWER);
break;
case MENUBAR2_COM_LOAD :
SetPanelAttribute (T_panel[PANEL_PORT].panel, ATTR_TITLE, "Config LOAD");
validationSETUP(INST_LOAD);
break;
case MENUBAR2_COM_PM :
SetPanelAttribute (T_panel[PANEL_PORT].panel, ATTR_TITLE, "Config Power Meter");
validationSETUP(INST_PM);
break;
case MENUBAR2_COM_SMU :
SetPanelAttribute (T_panel[PANEL_PORT].panel, ATTR_TITLE, "Config SMU");
validationSETUP(INST_SMU);
break;
case MENUBAR2_COM_SAS :
SetPanelAttribute (T_panel[PANEL_PORT].panel, ATTR_TITLE, "Config SAS");
validationSETUP(INST_SAS);
break;
case MENUBAR2_COM_TEMP :
SetPanelAttribute (T_panel[PANEL_PORT].panel, ATTR_TITLE, "Config TEMP");
validationSETUP(INST_TEMP);
break;
//Menu WINDOWS
case MENUBAR2_WIN_INIT :
init_reset_panel();
break;
//Menu HELP
case MENUBAR2_HELP_VERBOSE :
Ctrl.verbose=!Ctrl.verbose;
SetMenuBarAttribute (barre_de_menu, MENUBAR2_HELP_VERBOSE, ATTR_CHECKED, Ctrl.verbose);
break;
case MENUBAR2_HELP_LOG :
DisplayPanel (T_panel[PANEL_LOG].panel);
break;
case MENUBAR2_HELP_ABOUT :
DisplayPanel (T_panel[PANEL_ABOUT].panel);
break;
}
}
(2-2/25)