Пример #1
0
int visualizar( CListaTfnos &lista )
{
	pantalla *lapantalla = new pantalla();

	Registro registro;					//Creamos un objeto tipo registro para poder
										//grabar ahí lo que los punteros de la clase
										//acceso lista apunten
	CAccesoTfnos Ver( lista );

	
	int vr;
	lapantalla->bordesup();
	lapantalla->lateral();
	lapantalla->centrado();cout<<"NAVEGACION  ACTIVADA\n";
	lapantalla->lateral();
	lapantalla->bordeinf();
	cout<<"\n\n[1 - Primero]	[2 - Ultimo]	[3 - Anterior]	[4 - Siguiente]";
	
  cout << "\n\n\t\t\tPulse una opcion u\n"
       << "Otro caracter para finalizar\n\n";
  
//MENU DE NAVEGACION. en el usamos las funciones mienbro de la clase CAccesoList



  char car = cin.get(); cin.ignore();
  while ( car == '1' || car == '2' || car == '3' || car == '4' )
  {
    if ( car == '1' )
      vr = Ver.Primero( &registro );
    else if ( car == '2' )
      vr = Ver.Ultimo( &registro );
    else if ( car == '4' )
      vr = Ver.Siguiente( &registro );
    else if ( car == '3' )
      vr = Ver.Anterior( &registro );
    else
      return 0;
    if ( vr )					//Si el valor de vr es 1/0 se muestra el billete o no,
								//según se haya encontrad o no.
	{
		visualbillete(registro);
		cout<<"\n\n[1 - Primero]	[2 - Ultimo]	[3 - Anterior]	[4 - Siguiente]";
		cout<<"\n\no bien pulse otra tecla para salir de la navegacion";
	}
	else
		cout<<"NO HAY MAS!!!!!!\n\nINTRODUCE OTRA OPCION O PULSA CUALQUIER OTRA\nPARA SALIR\n";
		car = cin.get(); cin.ignore();
  }
  delete lapantalla;					//Borramos el puntero pantalla
  return 0;
}
Пример #2
0
void CTestSuiteAoi::AddAoiObject(vector<CAsyAoiSynceeObj*> &vec, uint32 num)
{ 
	for (uint32 i = 0; i < num; i++)
	{
		float x = static_cast<float>((abs(rand())) % MAX_X_POS);
		float y = static_cast<float>((abs(rand())) % MAX_Y_POS);

		CAsyAoiSynceeObj *pObj = CreateAoiObj(CFPos(x, y));

		Ver( ms_mapObjToDir.insert(make_pair(pObj, abs(rand())%4) ).second );

		vec.push_back(pObj);
	}
}
bool CSyncCoreObjectMediator::SetConnection( CSynConnServer* pConn )
{
	if( m_bDisbindingConn )
		return false;

	if( pConn == m_pConn )
		return true;

	if( !IsActive() )
	{
		StopFollowing();
	}

	if( IsMoving() )
		StopMoving();

	if( pConn )
	{
		if( pConn->GetObjectMediator() )
			GenErr( "CSyncCoreObjectMediator::SetConnnection failed, MediatorObject already binded on the connection." );
		
		if( m_pConn )
			GenErr( "CSyncCoreObjectMediator::SetConnectino failed, connection already binded." );

		IntSetConnection(pConn);
		m_pConn->SetMediator(this);
		
		SetClientMainScene();

		m_uAoiBlockCount++;
		IntPostMsgToSelf(new CAoiDecBlockCountCmd);

		CSyncCoreObjectServer::SetEyeSight( m_fZeroDimEyeSight,0 );
	}
	else
	{
		Ver( SetDisbindConnState() );

		IntPostMsgToSelf(new CAoiDisbindConnCmd);
	}

	return true;
}
Пример #4
0
/*!
 * Запуск задачи.
 */
void AddHostTask::run()
{
  QSqlQuery query;
  query.prepare(LS("SELECT id FROM hosts WHERE hostId = :hostId LIMIT 1;"));
  query.bindValue(LS(":hostId"), SimpleID::encode(m_host.hostId));
  query.exec();

  qint64 key = -1;
  if (query.first())
    key = query.value(0).toLongLong();


  if (key == -1) {
    query.prepare(LS("INSERT INTO hosts (channel,  hostId,  name,  address,  version,  os,  osName,  tz,  date,  geo,  data)"
                               " VALUES (:channel, :hostId, :name, :address, :version, :os, :osName, :tz, :date, :geo, :data)"));

    query.bindValue(LS(":channel"), m_host.channel);
    query.bindValue(LS(":hostId"),  SimpleID::encode(m_host.hostId));
  }
  else {
    query.prepare(LS("UPDATE hosts SET name = :name, address = :address, version = :version, os = :os, osName = :osName, tz = :tz, date = :date, geo = :geo, data = :data WHERE id = :id;"));
    query.bindValue(LS(":id"),      key);
  }

  query.bindValue(LS(":name"),    m_host.name);
  query.bindValue(LS(":address"), m_host.address);
  query.bindValue(LS(":version"), Ver(m_host.version).toString());
  query.bindValue(LS(":os"),      m_host.os);
  query.bindValue(LS(":osName"),  m_host.osName);
  query.bindValue(LS(":tz"),      m_host.tz);
  query.bindValue(LS(":date"),    m_host.date);
  query.bindValue(LS(":geo"),     JSON::generate(m_host.geo));
  query.bindValue(LS(":data"),    JSON::generate(m_host.data));

  query.exec();
}
Пример #5
0
Ver Ver::current()
{
  return Ver(QCoreApplication::applicationVersion());
}
Пример #6
0
//*************************************************************************
// InitPICE()
//
//*************************************************************************
BOOLEAN InitPICE(void)
{
    ULONG ulHandleScancode=0,ulHandleKbdEvent=0;
	ARGS Args;
    KIRQL Dirql;
    KAFFINITY Affinity;
	ULONG ulAddr;

    ENTER_FUNC();

	DPRINT((0,"InitPICE(): trace step 0.5\n"));
    KeyboardIRQL = HalGetInterruptVector(Internal,
				     0,
				     0,
				     KEYBOARD_IRQ,
				     &Dirql,
				     &Affinity);
	DPRINT((0,"KeyboardIRQL: %x\n", KeyboardIRQL));

    DPRINT((0,"InitPICE(): trace step 1\n"));
    // enable monochrome passthrough on BX type chipset
    EnablePassThrough();

    DPRINT((0,"InitPICE(): trace step 2\n"));
    // now load all symbol files described in /etc/pice.conf
    if(!LoadSymbolsFromConfig(FALSE))
    {
        DPRINT((0,"InitPICE: LoadSymbolsFromConfig() failed\n"));
        LEAVE_FUNC();
        return FALSE;
    }

    DPRINT((0,"InitPICE(): trace step 3\n"));
    // init the output console
	// this might be one of the following depending setup
	// a) monochrome card
	// b) serial terminal (TODO)
    if(!ConsoleInit())
    {
        DPRINT((0,"InitPICE: ConsoleInit() failed\n"));
        UnloadSymbols();
        LEAVE_FUNC();
        return FALSE;
    }

    DPRINT((0,"InitPICE(): trace step 4\n"));
    // print the initial screen template
    PrintTemplate();
/*
    DPRINT((0,"InitPICE(): trace step 5\n"));
	// ask the user if he wants to abort the debugger load
    if(!CheckLoadAbort())
	{
		Print(OUTPUT_WINDOW,"pICE: ABORT (abort by user)\n");
        UnloadSymbols();
		ConsoleShutdown();
        LEAVE_FUNC();
		return FALSE;
	}
*/

    DPRINT((0,"InitPICE(): trace step 6\n"));
    // load the file /boot/System.map.
    // !!! It must be consistent with the current kernel at all cost!!!
    if(!LoadExports())
    {
		Print(OUTPUT_WINDOW,"pICE: failed to load exports\n");
        Print(OUTPUT_WINDOW,"press any key to continue...\n");
        while(!GetKeyPolled());
        UnloadSymbols();
		ConsoleShutdown();
        LEAVE_FUNC();
		return FALSE;
    }

    DPRINT((0,"InitPICE(): trace step 7\n"));
	ScanExports("_KernelAddressSpace", &ulAddr);
	my_init_mm = (PMADDRESS_SPACE) ulAddr;
	DPRINT((0,"init_mm %x @ %x\n",&my_init_mm,my_init_mm));
	if(!my_init_mm)
	{
		Print(OUTPUT_WINDOW,"pICE: ABORT (initial memory map not found)\n");
		Print(OUTPUT_WINDOW,"pICE: press any key to continue...\n");
		DbgPrint("pICE: ABORT (initial memory map not found)\n");
		DbgPrint("pICE: press any key to continue...\n");
        while(!GetKeyPolled());
        UnloadSymbols();
		ConsoleShutdown();
        LEAVE_FUNC();
		return FALSE;
	}

	DPRINT((0,"InitPICE(): trace step 7.1\n"));
	ScanExports("_ModuleListHead",&ulAddr);
	pModuleListHead = (LIST_ENTRY*)ulAddr;
    DPRINT((0,"pModuleListHead @ %X\n",pModuleListHead));
	if(!pModuleListHead)
	{
		Print(OUTPUT_WINDOW,"pICE: ABORT (pModuleListHead not found)\n");
		Print(OUTPUT_WINDOW,"pICE: press any key to continue...\n");
        while(!GetKeyPolled());
        UnloadSymbols();
		ConsoleShutdown();
        LEAVE_FUNC();
		return FALSE;
	}

	DPRINT((0,"InitPICE(): trace step 7.2\n"));
	ScanExports("_PsProcessListHead",&ulAddr);
	pPsProcessListHead = (LIST_ENTRY*)ulAddr;
    DPRINT((0,"pPsProcessListHead @ %X\n",pPsProcessListHead));
	if(!pPsProcessListHead)
	{
		Print(OUTPUT_WINDOW,"pICE: ABORT (PsProcessListHead not found)\n");
		Print(OUTPUT_WINDOW,"pICE: press any key to continue...\n");
        while(!GetKeyPolled());
        UnloadSymbols();
		ConsoleShutdown();
        LEAVE_FUNC();
		return FALSE;
	}

    DPRINT((0,"InitPICE(): trace step 8\n"));
    // end of the kernel
	/*
	ScanExports("_end",(PULONG)&kernel_end);
    if(!kernel_end)
	{
		Print(OUTPUT_WINDOW,"pICE: ABORT (kernel size is unknown)\n");
		Print(OUTPUT_WINDOW,"pICE: press any key to continue...\n");
        while(!GetKeyPolled());
		UnloadExports();
        UnloadSymbols();
		ConsoleShutdown();
        LEAVE_FUNC();
		return FALSE;
	}
	*/

    DPRINT((0,"InitPICE(): trace step 9\n"));

	// the loaded module list
	ScanExports("_NameSpaceRoot", &ulAddr);
	pNameSpaceRoot = (PDIRECTORY_OBJECT *)ulAddr;
	DPRINT((0,"pNameSpaceRoot @ %X\n",pNameSpaceRoot));
    if(!pNameSpaceRoot)
	{
		Print(OUTPUT_WINDOW,"pICE: ABORT (couldn't retreive name space root)\n");
		Print(OUTPUT_WINDOW,"pICE: press any key to continue...\n");
        while(!GetKeyPolled());
		UnloadExports();
        UnloadSymbols();
		ConsoleShutdown();
        LEAVE_FUNC();
		return FALSE;
	}

    DPRINT((0,"InitPICE(): trace step 10\n"));
    // setup a linked list for use in module parsing routines.
	if(!InitModuleList(&pdebug_module_head, 100))
	{
		Print(OUTPUT_WINDOW,"pICE: ABORT (couldn't initialize kernel module list)\n");
		Print(OUTPUT_WINDOW,"pICE: press any key to continue...\n");
		FreeModuleList( pdebug_module_head );
        while(!GetKeyPolled());
		UnloadExports();
        UnloadSymbols();
		ConsoleShutdown();
        LEAVE_FUNC();
		return FALSE;
	}
	pdebug_module_tail = pdebug_module_head;

    DPRINT((0,"InitPICE(): trace step 11\n"));
    // do a sanity check on exports
    if(!SanityCheckExports())
    {
		Print(OUTPUT_WINDOW,"pICE: ABORT (exports are conflicting with kernel symbols)\n");
		Print(OUTPUT_WINDOW,"pICE: press any key to continue...\n");
        while(!GetKeyPolled());
		UnloadExports();
        UnloadSymbols();
		ConsoleShutdown();
        LEAVE_FUNC();
		return FALSE;
    }

    DPRINT((0,"InitPICE(): trace step 12\n"));


    DPRINT((0,"InitPICE(): trace step 13\n"));
    // patch the keyboard driver

	if(!PatchKeyboardDriver())
	{
		Print(OUTPUT_WINDOW,"pICE: ABORT (couldn't patch keyboard driver)\n");
		Print(OUTPUT_WINDOW,"pICE: press any key to continue...\n");
        while(!GetKeyPolled());
		UnloadSymbols();
		UnloadExports();
		ConsoleShutdown();
        LEAVE_FUNC();
		return FALSE;
	}

    DPRINT((0,"InitPICE(): trace step 14\n"));
    // partial init of shadow registers
    CurrentCS = GLOBAL_CODE_SEGMENT;
    CurrentEIP = (ULONG)RealIsr;

    CurrentDS = CurrentSS = GLOBAL_DATA_SEGMENT;
    __asm__("\n\t \
            mov %%esp,%%eax\n\t \
            mov %%eax,_CurrentESP\n\t \
            ":::"eax");


    // display version and symbol information
    Ver(NULL);

    // disable HW breakpoints
	__asm__("\n\t \
		xorl %%eax,%%eax\n\t \
		mov %%eax,%%dr6\n\t \
		mov %%eax,%%dr7\n\t \
        mov %%dr0,%%eax\n\t \
        mov %%dr1,%%eax\n\t \
        mov %%dr2,%%eax\n\t \
        mov %%dr3,%%eax"
		:::"eax"
		);

    DPRINT((0,"InitPICE(): trace step 15\n"));
    TakeIdtSnapshot();

    DPRINT((0,"InitPICE(): trace step 16\n"));
    // install all hooks
    InstallTraceHook();
    InstallGlobalKeyboardHook();
    InstallSyscallHook();
    InstallInt3Hook();
    InstallDblFltHook();
    InstallGPFaultHook();
    InstallIntEHook();
    InstallPrintkHook();

    DPRINT((0,"InitPICE(): trace step 16\n"));
    if(ulDoInitialBreak)
    {
        DPRINT((0,"about to do initial break...\n"));

        // simulate an initial break
        __asm__("\n\t \
            pushfl\n\t \
            pushl %cs\n\t \
            pushl $initialreturnpoint\n\t \
            pushl $" STR(REASON_CTRLF) "\n\t \
            jmp NewInt31Handler\n\t \
initialreturnpoint:");
    }
    else
    {