Exemplo n.º 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;
}
Exemplo n.º 2
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.º 3
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.º 4
0
int main (int argc, char *argv[]) {
    if (InitCVIRTE (0, argv, 0) == 0)
        return -1;    /* out of memory */
    
    if (argc != 2) {
        fprintf(stderr, "you must pass the path to a module to test");
        return -1;
    }
    
    char *testModule = argv[1];
    if (!FileExists(testModule, 0)) {
        fprintf(stderr, "you must pass the path to a module to test");
    }
    
    ListType names;
    SymbolParser *parser = MakeParser(testModule);
    names = GetExports(parser);
    
    context = CreateContext();
    LoadTestInfo info = { .parser = parser, .executeOnContext = context->ExecuteTests };
    ListApplyToEach(names, 1, LoadUserTests, &info);
    
    DeleteParser(parser);
    FreeContext(context);
    return 0;
}
Exemplo n.º 5
0
int main (int argc, char *argv[])
{
    if (InitCVIRTE (0, argv, 0) == 0)
        return -1;    /* out of memory */
    
    Game2048 *game = Game2048Create(4, 4, WindowCreateUserInterface);
    Game2048Run(game);
    Game2048Dispose(game);
    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;
}
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.º 8
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;
}
Exemplo n.º 9
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;
}
int __stdcall DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
    switch (fdwReason) {
        case DLL_PROCESS_ATTACH:
            if (InitCVIRTE (hinstDLL, 0, 0) == 0)    /* Needed if linking in external compiler; harmless otherwise */
                return 0;     /* out of memory */
            break;
        case DLL_PROCESS_DETACH:
            CloseCVIRTE ();    /* Needed if linking in external compiler; harmless otherwise */
            break;
    }
    
    return 1;
}
Exemplo n.º 11
0
int __stdcall DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
	switch (fdwReason) {
		case DLL_PROCESS_ATTACH:
			if (InitCVIRTE (hinstDLL, 0, 0) == 0)
				return 0;	  /* out of memory */
			break;
		case DLL_PROCESS_DETACH:
			CloseCVIRTE ();
			break;
	}
	
	return 1;
}
Exemplo n.º 12
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.º 13
0
int main (int argc, char *argv[])
{
	ViSession 			hInstrumentHandle	=	0;
		
	int					bConnectStatus		=	0,
						ChannelsQuantity	=	0; 
							
	double				lfFrequency			=	0.0,
						lfPower				=	0.0;
	
	InitCVIRTE (0, argv, 0 ); 

	SpectrumAnalyzer_Init ( 0 , "GPIB::5" , &hInstrumentHandle , &bConnectStatus , &ChannelsQuantity );
	
	SpectrumAnalyzer_SetFrequency( hInstrumentHandle , 100E6 );
	
	SpectrumAnalyzer_InitiateMeasure( hInstrumentHandle ); 
	SpectrumAnalyzer_WaitForIntrumentDone( hInstrumentHandle , 20.0 );  
	SpectrumAnalyzer_SearchMarkerPeak( hInstrumentHandle );  
	SpectrumAnalyzer_GetMarkerAmplitude( hInstrumentHandle , 1 , &lfPower ); 

						
						
	SpectrumAnalyzer_Reset(hInstrumentHandle);
	
	SpectrumAnalyzer_RecallState( hInstrumentHandle , "calibration" );  
	
	SpectrumAnalyzer_AutoTune( hInstrumentHandle , 20.0 );
		
	SpectrumAnalyzer_PhaseNoise_GetMarker ( hInstrumentHandle , 1 , 1 , &lfFrequency , &lfPower );   
	SpectrumAnalyzer_PhaseNoise_GetMarker ( hInstrumentHandle , 1 , 2 , &lfFrequency , &lfPower );   
	SpectrumAnalyzer_PhaseNoise_GetMarker ( hInstrumentHandle , 1 , 3 , &lfFrequency , &lfPower );   
	SpectrumAnalyzer_PhaseNoise_GetMarker ( hInstrumentHandle , 1 , 4 , &lfFrequency , &lfPower );   
	
	SpectrumAnalyzer_GetMarkerMeasure ( hInstrumentHandle , 0 , 1 , &lfFrequency , &lfPower );
		
	//SpectrumAnalyzer_RecallState( hInstrumentHandle , "spart.state" );
		
	//  

	//SpectrumAnalyzer_WaitForIntrumentDone(hInstrumentHandle,20000);
	
																			   
	SpectrumAnalyzer_Close(&hInstrumentHandle);	
	
	return 0;
	
}
int __stdcall DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
    switch (fdwReason) {
        case DLL_PROCESS_ATTACH:
            if (InitCVIRTE (hinstDLL, 0, 0) == 0)
                return 0;     /* out of memory */
            break;
        case DLL_PROCESS_DETACH:
            if (!CVIRTEHasBeenDetached ())
                CloseCVIRTE (); 
            break;
    }
     
	/* Return 1 to indicate successful initialization */
    return 1;
}
Exemplo n.º 15
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.º 16
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.º 17
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;
}
Exemplo n.º 18
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;
}
static void initCV(void*)
{
    char* dummy_argv[2] = { strdup("NetShrVarInterface"), NULL };
	if (InitCVIRTE (0, dummy_argv, 0) == 0)
		throw std::runtime_error("InitCVIRTE");
}