Exemplo n.º 1
0
int main (int argc, char *argv[])
{
	if (InitCVIRTE (0, argv, 0) == 0)
		return -1;	/* out of memory */
	if ((panelHandle = LoadPanel (0, "Remotely.uir", PANEL)) < 0)
		return -1;
	if ((configHandle = LoadPanel (0, "Remotely.uir", CONFIG)) < 0)
		return -1;
	if ((itemHandle = LoadPanel (0, "Remotely.uir", FILE_ITEM)) < 0)
		return -1;
	menubarHandle = GetPanelMenuBar (panelHandle); 
	GetPanelHandleFromTabPage (panelHandle, PANEL_TAB, 0, &bbucommonHandle);
	GetPanelHandleFromTabPage (panelHandle, PANEL_TAB, 1, &rrucommonHandle); 
	GetPanelHandleFromTabPage (panelHandle, PANEL_TAB, 2, &customizingHandle); 
	SetActiveTabPage (panelHandle, PANEL_TAB, 0);
	if(Initial(0, 0)<0 || Initial(1, 0)<0 || Initial(2, 0)<0 || Initial(3, 0)<0)
	{
		SetLed("Read file type information from config.ini to UI error,please try again!",0); 
	}
	WriteLog();
	DisplayPanel (panelHandle);
	RunUserInterface ();
																	 
	return 0;
}
Exemplo n.º 2
0
int main (int argc, char *argv[])
{
    if (InitCVIRTE (0, argv, 0) == 0)
        return -1;  /* out of memory */      
    if ((pBasicFn = LoadPanel (0, "UIRBasicFnct.uir", P_BASIC_FN)) < 0)
        return -1;
    if ((pSystem = LoadPanel (0, "UIRSystem.uir", P_SYSTEM)) < 0)
        return -1;
    if ((pControlPad = LoadPanel (0, "UIRControlPad.uir", P_CTRL_PAD)) < 0)
        return -1;
    
    GetCtrlVal (pBasicFn, P_BASIC_FN_SWH_FNCT_MODE,         &iFnctMode);
    GetCtrlVal (pBasicFn, P_BASIC_FN_SWH_DISPLAY_MODE,      &iDispMode);
    GetCtrlVal (pBasicFn, P_BASIC_FN_SWH_DISPLAY_LAST_FIVE, &iLastFive);
    GetCtrlVal (pBasicFn, P_BASIC_FN_SWITCH_SENSOR,         &iSwitchSens);
    GetCtrlVal (pBasicFn, P_BASIC_FN_SWITCH_DREH_MODE,      &iDrehMode);
    
    SetCtrlAttribute (pSystem, P_SYSTEM_CMD_DEINIT,             ATTR_DIMMED, 1);
    
    DisplayPanel (pBasicFn);
    RunUserInterface ();
    DiscardPanel (pBasicFn);
    
    return 0;
}
Exemplo n.º 3
0
Arquivo: util.c Projeto: 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...");
}
Exemplo n.º 4
0
Arquivo: K213.c Projeto: 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);
}
Exemplo n.º 5
0
void acquire_Init (void)
{
    if (utilG.acq.status != ACQ_NONE) {
        util_ChangeInitMessage ("Acquisition Utilities...");
        util_WriteLog("acquire_Init()\nStarting...\n");
        acqG.p.setup = LoadPanel (utilG.p, "acquireu.uir", ACQSETUP);
        
        //SetPanelPos (acqG.p.setup, VAL_AUTO_CENTER, VAL_AUTO_CENTER);
        // Set default data dir and suffix
        int dirNameLen;
        if(FileExists(DFLT_DATA_DIR, &dirNameLen) ) {
            strcpy(dataFile.dataDir, DFLT_DATA_DIR);
        } else {
            char msg[MAX_PATHNAME_LEN*2];
            sprintf(msg, "Default Data Does not exist:\n%s\nUsing application dir.", DFLT_DATA_DIR);
            MessagePopup ("Acquisition Setup", msg );

            GetProjectDir (dataFile.dataDir);
        }
        SetCtrlVal (acqG.p.setup, ACQSETUP_DATADIR, dataFile.dataDir);
        strcpy(dataFile.fileSuffix, DFLT_FILE_SUFFIX);
        SetCtrlVal(acqG.p.setup, ACQSETUP_FILESUFFIX, dataFile.fileSuffix); 

        // This control is a button on startup panel, "control. acquisition, and analysis"
        InstallCtrlCallback (utilG.p, BG_ACQSETUP, AcqSetupCallback, 0);

    } else SetCtrlAttribute (utilG.p, BG_ACQSETUP, ATTR_VISIBLE, FALSE);
}
Exemplo n.º 6
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);
}
/* 配置并弹出信号分析面板 */
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]);
	}
	
}
Exemplo n.º 8
0
// ----------------------------------------------------------------------------
int __stdcall WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow) {

#ifdef _MSC_VER
  if (InitCVIRTE (0, 0, 0) == 0) return -1;
#endif // _MSC_VER
  
  CVIProfSetCurrentThreadProfiling (1);
  
  int panelHandle=-1; 
  if ((panelHandle = LoadPanel (0, "../assets/frontend.uir", PANEL)) < 0) return -1;
  
  DisplayPanel (panelHandle);
  RunUserInterface ();
  DiscardPanel (panelHandle);
  
  // Not needed
  // CVIProfSetCurrentThreadProfiling (0);
  
  {
    size_t Bytes;
    size_t Blocks;
    // View info in Debug Output Window
    CVIDynamicMemoryInfo ("", &Blocks, &Bytes, DYNAMIC_MEMORY_SHOW_ALLOCATED_MEMORY_SUMMARY);
  }
  
#ifdef _MSC_VER
  _CrtDumpMemoryLeaks();
#endif // _MSC_VER
  
  return 0;
}
Exemplo n.º 9
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;
}
Exemplo n.º 10
0
void main()

{
int handle, panel, id;
int var;

id = 0;

 panel = LoadPanel (0, "primcvi.uir", mipanel1);

 DisplayPanel (panel);


while (id != mipanel1_salir) 
	{
	GetUserEvent (0, &handle, &id);
	
    GetCtrlVal (panel, mipanel1_pot1, &var);
	SetCtrlVal (panel, mipanel1_tanque1, var);
	
	}

DiscardPanel (panel);

} /* del main */
Exemplo n.º 11
0
int CUpdateDialog::ShowModal()
{
	wxString version(PACKAGE_VERSION, wxConvLocal);
	if (version.empty() || version[0] < '0' || version[0] > '9')
	{
		wxMessageBoxEx(_("Executable contains no version info, cannot check for updates."), _("Check for updates failed"), wxICON_ERROR, parent_);
		return wxID_CANCEL;
	}

	if (!Load(parent_, _T("ID_UPDATE_DIALOG")))
		return wxID_CANCEL;

	LoadPanel(_T("ID_CHECKING_PANEL"));
	LoadPanel(_T("ID_FAILURE_PANEL"));
	LoadPanel(_T("ID_NEWVERSION_PANEL"));
	LoadPanel(_T("ID_LATEST_PANEL"));
	if( panels_.size() != 4 ) {
		return wxID_CANCEL;
	}

	wxAnimation a = CThemeProvider::Get()->CreateAnimation(_T("ART_THROBBER"), wxSize(16,16));
	XRCCTRL(*this, "ID_WAIT_CHECK", wxAnimationCtrl)->SetMinSize(a.GetSize());
	XRCCTRL(*this, "ID_WAIT_CHECK", wxAnimationCtrl)->SetAnimation(a);
	XRCCTRL(*this, "ID_WAIT_CHECK", wxAnimationCtrl)->Play();
	XRCCTRL(*this, "ID_WAIT_DOWNLOAD", wxAnimationCtrl)->SetMinSize(a.GetSize());
	XRCCTRL(*this, "ID_WAIT_DOWNLOAD", wxAnimationCtrl)->SetAnimation(a);
	XRCCTRL(*this, "ID_WAIT_DOWNLOAD", wxAnimationCtrl)->Play();

	Wrap();

	XRCCTRL(*this, "ID_DETAILS", wxTextCtrl)->Hide();

	UpdaterState s = updater_.GetState();
	UpdaterStateChanged( s, updater_.AvailableBuild() );

	updater_.AddHandler(*this);

	updater_.RunIfNeeded();

	int ret = wxDialogEx::ShowModal();
	updater_.RemoveHandler(*this);

	return ret;
}
/* 按钮-Config-打开配置端口面板 */
int CVICALLBACK Config_Com_Btn(int panel, int control, int event,
		void *callbackData, int eventData1, int eventData2) {
	switch(event){
		case EVENT_COMMIT:
			int popConfigPanel = LoadPanel(0, "MainPanel.uir", ConfigP);
			InstallPopup(popConfigPanel);
			break;
	}
	return 0;
}
int main (int argc, char *argv[]) {
	if (InitCVIRTE (0, argv, 0) == 0)
		return -1;	/* out of memory */
	if ((panelHandle = LoadPanel (0, "HelloWorld.uir", PANEL)) < 0)
		return -1;
	DisplayPanel (panelHandle);
	RunUserInterface ();
	DiscardPanel (panelHandle);
	return 0;
}
Exemplo n.º 14
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;
    }
}
int main (int argc, char *argv[]){
	if (InitCVIRTE (0, argv, 0) == 0)
		return -1;	/* out of memory */
	if ((panelHdl = LoadPanel(0, "MainPanel.uir", MainPanel)) < 0)
		return -1;
	initVars(); //init variables
	DisplayPanel (panelHdl);
	RunUserInterface();
	cleanGarbage();
	return 0;
}
Exemplo n.º 16
0
int main (int argc, char *argv[])
{
	if (InitCVIRTE (0, argv, 0) == 0)
		return -1;	/* out of memory */
	if ((mypanel = LoadPanel (0, "display_four_signals.uir", MYPANEL)) < 0)
		return -1;
	DisplayPanel (mypanel);
	RunUserInterface ();
	DiscardPanel (mypanel);
	return 0;
}
//////////////////////////////////////////////////////////////////////
// fe_NewMultiplayerGame::OnCreate() //            \author Logan Jones
//////////////////////////////////////                 \date 7/31/2002
//               
//====================================================================
// Return: BOOL - 
//
BOOL fe_NewMultiplayerGame::OnCreate()
{
	// Load the gui file
	if( bFAILED(LoadGui("NewMulti")) )
		return FALSE;

	// Load the background
	if( bFAILED(LoadPanel("CreateNew")) )
		return FALSE;

	return fe_Wnd::OnCreate();
}
Exemplo n.º 18
0
void AcqInfoCallback(int menubar, int menuItem, void *callbackData, int panel)
{
    if (!acqinfoP) {
        acqinfoP = LoadPanel (utilG.p, "acquireu.uir", ACQINFO);
        if (acqinfoP < 0) acqinfoP = 0;
        else {
            SetPanelPos (acqinfoP, VAL_AUTO_CENTER, VAL_AUTO_CENTER);
            
            DisplayPanel (acqinfoP);
        }
    }
}
Exemplo n.º 19
0
void InitDecimateCallback(int menubar, int menuItem, void *callbackData, int panel)
{
    int i;
    channelPtr chan;

    chanfunc.p = LoadPanel (0, "chanfncu.uir", DECIMATE);
    
    util_InitClose (chanfunc.p, DECIMATE_CLOSE, FALSE);
    SetPanelPos (chanfunc.p, 100, 100);

    channellist_Copy (chanfunc.p, DECIMATE_CHANNELS);

    InstallPopup (chanfunc.p);
}
Exemplo n.º 20
0
Arquivo: K236.c Projeto: 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);
}
Exemplo n.º 21
0
void InitExponentCallback(int menubar, int menuItem, void *callbackData, int panel)
{
    int i;
    channelPtr chan;

    chanfunc.p = LoadPanel (0, "chanfncu.uir", EXPONENT);
    
    util_InitClose (chanfunc.p, EXPONENT_CLOSE, FALSE);
    SetPanelPos (chanfunc.p, 100, 100);

    channellist_Copy (chanfunc.p, EXPONENT_CHANNELS);

    InstallPopup (chanfunc.p);
}
Exemplo n.º 22
0
int main (int argc, char *argv[])
{
    if (InitCVIRTE (0, argv, 0) == 0)
        return -1;	/* out of memory */
    if ((mypanel = LoadPanel (0, "display_histogram.uir", MYPANEL)) < 0)
        return -1;
    DisplayPanel (mypanel);

    SourImage = imaqCreateImage (IMAQ_IMAGE_U8, 2);

    RunUserInterface ();
    DiscardPanel (mypanel);
    return 0;
}
Exemplo n.º 23
0
int main (int argc, char *argv[])
{
	if (InitCVIRTE (0, argv, 0) == 0)
		return -1;	/* out of memory */
	if ((mypanel = LoadPanel (0, "threshold_selection.uir", MYPANEL)) < 0)
		return -1;
	DisplayPanel (mypanel);
	
	sourimage = imaqCreateImage (IMAQ_IMAGE_U8, 2);
	destimage = imaqCreateImage (IMAQ_IMAGE_U8, 2);
	
	RunUserInterface ();
	DiscardPanel (mypanel);
	return 0;
}
Exemplo n.º 24
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");
}
Exemplo n.º 25
0
void dda08Operate (int menubar, int menuItem, void *callbackData, int panel)
{
	MCCdevPtr dev = callbackData;
	dda08Ptr dda = dev->device;
	acqchanPtr acqchan;
	int i, x = 0, m;
	if(!dda->panel)
	{
		dda->panel = LoadPanel(utilG.p, "DDA08u.uir", DDA_CTRL);
		SetCtrlAttribute (dda->panel, DDA_CTRL_RANGE_0, ATTR_CALLBACK_DATA, &dda->Achannels[0]->port.analogueIOport.range);
		SetCtrlAttribute (dda->panel, DDA_CTRL_RANGE_1, ATTR_CALLBACK_DATA, &dda->Achannels[1]->port.analogueIOport.range);
		SetCtrlAttribute (dda->panel, DDA_CTRL_RANGE_2, ATTR_CALLBACK_DATA, &dda->Achannels[2]->port.analogueIOport.range);
		SetCtrlAttribute (dda->panel, DDA_CTRL_RANGE_3, ATTR_CALLBACK_DATA, &dda->Achannels[3]->port.analogueIOport.range);
		SetCtrlAttribute (dda->panel, DDA_CTRL_RANGE_4, ATTR_CALLBACK_DATA, &dda->Achannels[4]->port.analogueIOport.range);
		SetCtrlAttribute (dda->panel, DDA_CTRL_RANGE_5, ATTR_CALLBACK_DATA, &dda->Achannels[5]->port.analogueIOport.range);
		SetCtrlAttribute (dda->panel, DDA_CTRL_RANGE_6, ATTR_CALLBACK_DATA, &dda->Achannels[6]->port.analogueIOport.range);
		SetCtrlAttribute (dda->panel, DDA_CTRL_RANGE_7, ATTR_CALLBACK_DATA, &dda->Achannels[7]->port.analogueIOport.range);
		
		SetCtrlAttribute (dda->panel, DDA_CTRL_ANALOG_OUT_0, ATTR_CALLBACK_DATA, dda->Achannels[0]->port.analogueIOport.IO.source);
		SetCtrlAttribute (dda->panel, DDA_CTRL_ANALOG_OUT_1, ATTR_CALLBACK_DATA, dda->Achannels[1]->port.analogueIOport.IO.source);
		SetCtrlAttribute (dda->panel, DDA_CTRL_ANALOG_OUT_2, ATTR_CALLBACK_DATA, dda->Achannels[2]->port.analogueIOport.IO.source);
		SetCtrlAttribute (dda->panel, DDA_CTRL_ANALOG_OUT_3, ATTR_CALLBACK_DATA, dda->Achannels[3]->port.analogueIOport.IO.source);
		SetCtrlAttribute (dda->panel, DDA_CTRL_ANALOG_OUT_4, ATTR_CALLBACK_DATA, dda->Achannels[4]->port.analogueIOport.IO.source);
		SetCtrlAttribute (dda->panel, DDA_CTRL_ANALOG_OUT_5, ATTR_CALLBACK_DATA, dda->Achannels[5]->port.analogueIOport.IO.source);
		SetCtrlAttribute (dda->panel, DDA_CTRL_ANALOG_OUT_6, ATTR_CALLBACK_DATA, dda->Achannels[6]->port.analogueIOport.IO.source);
		SetCtrlAttribute (dda->panel, DDA_CTRL_ANALOG_OUT_7, ATTR_CALLBACK_DATA, dda->Achannels[7]->port.analogueIOport.IO.source);
		
		SetCtrlAttribute (dda->panel, DDA_CTRL_SOURCE_0, ATTR_CALLBACK_DATA, dda->Achannels[0]->port.analogueIOport.IO.source);
		SetCtrlAttribute (dda->panel, DDA_CTRL_SOURCE_1, ATTR_CALLBACK_DATA, dda->Achannels[1]->port.analogueIOport.IO.source);
		SetCtrlAttribute (dda->panel, DDA_CTRL_SOURCE_2, ATTR_CALLBACK_DATA, dda->Achannels[2]->port.analogueIOport.IO.source);
		SetCtrlAttribute (dda->panel, DDA_CTRL_SOURCE_3, ATTR_CALLBACK_DATA, dda->Achannels[3]->port.analogueIOport.IO.source);
		SetCtrlAttribute (dda->panel, DDA_CTRL_SOURCE_4, ATTR_CALLBACK_DATA, dda->Achannels[4]->port.analogueIOport.IO.source);
		SetCtrlAttribute (dda->panel, DDA_CTRL_SOURCE_5, ATTR_CALLBACK_DATA, dda->Achannels[5]->port.analogueIOport.IO.source);
		SetCtrlAttribute (dda->panel, DDA_CTRL_SOURCE_6, ATTR_CALLBACK_DATA, dda->Achannels[6]->port.analogueIOport.IO.source);
		SetCtrlAttribute (dda->panel, DDA_CTRL_SOURCE_7, ATTR_CALLBACK_DATA, dda->Achannels[7]->port.analogueIOport.IO.source);
		
		SetCtrlAttribute (dda->panel, DDA_CTRL_OUT_ON_0, ATTR_CALLBACK_DATA, dda->buttons[0]);
		SetCtrlAttribute (dda->panel, DDA_CTRL_OUT_ON_1, ATTR_CALLBACK_DATA, dda->buttons[1]);
		SetCtrlAttribute (dda->panel, DDA_CTRL_OUT_ON_2, ATTR_CALLBACK_DATA, dda->buttons[2]);
		SetCtrlAttribute (dda->panel, DDA_CTRL_OUT_ON_3, ATTR_CALLBACK_DATA, dda->buttons[3]);
		SetCtrlAttribute (dda->panel, DDA_CTRL_OUT_ON_4, ATTR_CALLBACK_DATA, dda->buttons[4]);
		SetCtrlAttribute (dda->panel, DDA_CTRL_OUT_ON_5, ATTR_CALLBACK_DATA, dda->buttons[5]);
		SetCtrlAttribute (dda->panel, DDA_CTRL_OUT_ON_6, ATTR_CALLBACK_DATA, dda->buttons[6]);
		SetCtrlAttribute (dda->panel, DDA_CTRL_OUT_ON_7, ATTR_CALLBACK_DATA, dda->buttons[7]);
		
	}
	DisplayPanel(dda->panel);
}
Exemplo n.º 26
0
//Main - displays the GUI
int main (int argc, char *argv[])
{
	//Check for errors
	if (InitCVIRTE (0, argv, 0) == 0)
		return -1;	/* out of memory */
	if ((panelHandle = LoadPanel (0, "pictest.uir", PANEL)) < 0)
		return -1;
	
	//Run GUI
	DisplayPanel (panelHandle);
	
	RunUserInterface ();

	DiscardPanel (panelHandle);
	return 0;
}
Exemplo n.º 27
0
Arquivo: util.c Projeto: 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;
}
Exemplo n.º 28
0
/*---------------------------------------------------------------------------*/
int main (int argc, char *argv[])
{
	if (InitCVIRTE (0, argv, 0) == 0)
		return -1;
	DisableBreakOnLibraryErrors ();
	setup_oscillo();
	setup_SRS();
	generate_xarray ();

	if ((Main_pnl_handle = LoadPanel (0, "ERG.uir", ERG_panel)) < 0)
		return -1;
	
	DisplayPanel (Main_pnl_handle);
	RunUserInterface ();
	DiscardPanel (Main_pnl_handle);
	return 0;
}
Exemplo n.º 29
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);
}
Exemplo n.º 30
0
int CVICALLBACK fit_options (int panel, int control, int event,
							 void *callbackData, int eventData1, int eventData2)
{
	switch (event)
	{
		case EVENT_COMMIT:
		
			if ((Fit_pnl_handle = LoadPanel (0, "Fit_Options.uir", Fit_panel)) < 0)
			return -1;
	
			DisplayPanel (Fit_pnl_handle );  
			RunUserInterface ();
			DiscardPanel (Fit_pnl_handle );
			break;
	}
	return 0;
}