示例#1
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;
}
示例#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;
}
示例#3
0
文件: Remotely.c 项目: jufei/BtsShell
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;
}
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;
}
示例#5
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;
}
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;
}
int __declspec(dllexport) __stdcall EditClassPath(CAObjHandle context)
{
    int         error       = 0;
    int         canceled    = 0;                      
    ERRORINFO   errorInfo;
    ErrMsg      errMsg      = "";
    CAObjHandle stepH       = 0;
    CAObjHandle seqFileH    = 0;
    TSModalData modalData   = InitialModalData;

    // Save the context for later reference
    seqContext = context;
  
    // Load the UI panel
    if ((panelHandle = LoadPanelEx (0, "JavaCall.uir", PANEL, __CVIUserHInst)) < 0)
        return -1;

    // Get current step object from sequence context
    tsErrChk(TS_SeqContextGetStep (context, &errorInfo, &stepH));
    
    // Transfer class path from properties of the Java step to the CVI user interface
    tsErrChk(TS_SetCtrlToPropertyVal (stepH, "ClassPath", panelHandle, PANEL_JAVA_CLASSPATH));

    // Start the UI
    tsErrChk (TS_StartModalDialog(context, &errorInfo, &modalData));
    errChk (InstallPopup (panelHandle));
    errChk (canceled = RunUserInterface());

    if (!canceled) 
    {
        TS_SetPropertyToCtrlValEx (panelHandle, PANEL_JAVA_CLASSPATH, stepH, "ClassPath", errMsg);
        // Update the sequence file change count
        TS_SeqContextGetSequenceFile (context, &errorInfo, &seqFileH);
        tsErrChk(TS_SeqFileIncChangeCount (seqFileH, &errorInfo));
    }

Error:  

    // Discard the panels loaded 
    if (panelHandle > 0)
        TS_EndModalDialogAndDiscard (&errorInfo, &modalData, panelHandle);
    
    if (stepH)
        CA_DiscardObjHandle (stepH);
    if(seqFileH)
        CA_DiscardObjHandle (seqFileH);

    // If an error occurred, set the error flag to cause a run-time error in TestStand.
    if (error < 0)
        TS_SetStepError(context, error, errMsg);     
        
    return error;
}
示例#8
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;
}
示例#9
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;
}
示例#10
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;
}
示例#11
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;
}
示例#12
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;
}
示例#13
0
int main (int argc, char *argv[])
{
	int 		panelHandle		=	0; 

	if (InitCVIRTE (0, argv, 0) == 0)
		return -1;	/* out of memory */
	
	if ((panelHandle = LoadPanel (0, "DAQmx_Control_Editor.uir", PANEL)) < 0)
		return -1;
	
	DisplayPanel (panelHandle);
	
	if ( argc > 1 )
		OpenConfigurationFile( argv[1] ); 
	
	UpdateList( panelHandle );
	UpdateCurrentItem( panelHandle ); 
	
	RunUserInterface ();
	
	DiscardPanel (panelHandle);
	
	return 0;
}
示例#14
0
/*---------------------------------------------------------------------------*/
int main (int argc, char *argv[])
{
	init_variables();
	if (InitCVIRTE (0, argv, 0) == 0)
		return -1;
	DisableBreakOnLibraryErrors ();
	setup_oscillo();
	setup_SRS();
	start_shaper();
	generate_xarray ();


	if ((Main_pnl_handle = LoadPanel (0, "ERG.uir", ERG_panel)) < 0)
		return -1;
	mask_folder(Main_pnl_handle,99,EVENT_COMMIT,0,0,0);
	PopulateList();
	strcpy (mask_filename, "flat");
	display_masks();
	DisplayPanel (Main_pnl_handle);
	RunUserInterface ();
	DiscardPanel (Main_pnl_handle);
	stop_shaper();
	return 0;
}