void AMSimpleBeamConfigurationWizard::back()
{
	int pageId = currentId();
	int pageRelativeId = relativeId();
	if(isWaitPage(pageId))
	{
		((AMWaitPage*)page(pageId))->stopTimer();
		if(relativeId() == 0)
		{
			((AMWaitPage*)page(pageId))->stopTimer();
			QWizard::back();
		}
		else
		{
			while(currentId() != pageWait(pageRelativeId - 1))
			{
				QWizard::back();
			}
			if(currentId() == pageWait(pageRelativeId - 1))
			{
				initializePage(pageWait(pageRelativeId - 1));
			}
		}
	}
	else if (isSetPage(pageId))
	{
		/*
		((AMSimpleSampleSetPage*)page(pageId))->disconnectMouseSignal();
		*/
		if(relativeId() == 0)
		{
			while(currentId() != Page_Intro)
			{
				QWizard::back();
			}
		}
		else
		{
			while(currentId() != pageWait(pageRelativeId))
			{
				QWizard::back();
			}
			if(currentId() == pageWait(pageRelativeId))
			{
				initializePage(pageWait(pageRelativeId));
			}
		}
	}
	else
	{
		QWizard::back();
	}
}
void FilesSelectionWizardPage::baseDirectoryChanged()
{
    QString const baseDir(m_baseDirChooser->path());
    if (baseDir != m_lastBaseDir && QFileInfo(baseDir).isDir())
    {
        m_lastBaseDir = baseDir;
        initializePage();
    }
}
	void InBandAccountRegSecondPage::handleClientError (QXmppClient::Error error)
	{
		qWarning () << Q_FUNC_INFO
				<< error
				<< Client_->socketError ()
				<< Client_->xmppStreamError ();

		if (error == QXmppClient::SocketError &&
				wizard ()->currentPage () == this)
			initializePage ();
	}
Esempio n. 4
0
static void
clearPage (HelpPageEntry *page) {
  if (page->lineTable) {
    while (page->lineCount) {
      HelpLineEntry *line = &page->lineTable[--page->lineCount];

      if (line->characters) free(line->characters);
    }

    free(page->lineTable);
    initializePage(page);
  }
}
Esempio n. 5
0
bool WebPagePopupImpl::initialize(WebViewImpl* webView,
                                  PagePopupClient* popupClient) {
  DCHECK(webView);
  DCHECK(popupClient);
  m_webView = webView;
  m_popupClient = popupClient;

  if (!m_widgetClient || !initializePage())
    return false;
  m_widgetClient->show(WebNavigationPolicy());
  setFocus(true);

  return true;
}
Esempio n. 6
0
	IROM void Flash::findOrCreateActivePage() {
//		INFO("");
		_sequence=0;
		uint32_t sequence;

		for(uint32_t i=0;i< PAGE_COUNT;i++ ) {
			if ( isValidPage(i,sequence) && sequence>_sequence ) {
				_pageIdx=i;
				_sequence=sequence;
			}
		}
		if ( _sequence ==0 ) {
			initializePage(0,1);
			_pageIdx=0;
			_sequence=1;
		}
		findFreeBegin();
//		INFO(" pageIdx : %d freePos : %u ",_pageIdx,_freePos);
		/*		writeItem(2,(uint8_t*)"mqtt/host",10);
		 writeItem(4,(uint8_t*)"mqtt/port",10);*/
	}
Esempio n. 7
0
FirstRunWizard::FirstRunWizard( bool startFromTour, QWidget* parent )
    :QDialog( parent ),
      ui( new Ui::FirstRunWizard ),
      m_commitPage( false ),
      m_showWelcome( false ),
      m_bootstrapState( NoBootstrap )
{
#ifdef Q_OS_WIN32
    m_plugins = new unicorn::PluginList;
#endif

    ui->setupUi( this );

    ui->welcome->hide();

    for ( int i = 0 ; i < ui->stackedWidget->count() ; ++i )
    {
        qobject_cast<WizardPage*>(ui->stackedWidget->widget( i ))->setWizard( this );
    }

    connect( ui->next, SIGNAL(clicked()), SLOT(next()));
    connect( ui->back, SIGNAL(clicked()), SLOT(back()));
    connect( ui->skip, SIGNAL(clicked()), SLOT(skip()));
    connect( ui->finish, SIGNAL(clicked()), SLOT(accept()));

    connect( this, SIGNAL( rejected() ), this, SLOT( onRejected() ) );
    connect( this, SIGNAL( accepted() ), this, SLOT( onWizardCompleted() ) );

    connect( aApp, SIGNAL(bootstrapStarted(QString)), SLOT(onBootstrapStarted(QString)));
    connect( aApp, SIGNAL(bootstrapDone(AbstractBootstrapper::BootstrapStatus)), SLOT(onBootstrapDone(AbstractBootstrapper::BootstrapStatus)));

    if ( startFromTour )
        ui->stackedWidget->setCurrentWidget( ui->tourScrobblesPage );
    else
        ui->stackedWidget->setCurrentWidget( ui->loginPage );

    initializePage( ui->stackedWidget->currentWidget() );

    setFixedSize( 750, 450 );
}
Esempio n. 8
0
static unsigned int
addPage (void) {
  if (pageCount == pageLimit) {
    unsigned int newLimit = pageLimit + 1;
    HelpPageEntry *newTable = realloc(pageTable, ARRAY_SIZE(newTable, newLimit));

    if (!newTable) {
      logMallocError();
      return 0;
    }

    pageTable = newTable;
    pageLimit = newLimit;
  }

  {
    HelpPageEntry *page = &pageTable[pageCount];
    initializePage(page);
  }

  return pageCount += 1;
}
Esempio n. 9
0
uint32_t initializeGlobalArrays(uint32_t* arr_n_ptr, uint32_t num_elements, uint32_t stride, uint32_t arr_offset)
{

#ifdef DEBUG
   printf("\nInitializing Array at 0x%x, num_elements= %d, stride= %d, offset= %d, num_cl = %d\n\n",
      arr_n_ptr, num_elements, stride, arr_offset, num_elements / stride); 
#endif

   //randomize array on cacheline strided boundaries
#ifdef DEBUG
   printf("\n-==== Begin two-level randomization of the chase array ====-\n");
#endif

   // check to see if the array is 1-element long...
   if (num_elements == stride)
   {
#ifdef DEBUG
      printf("\nArray is 1 element long, returning....\n");
#endif
      // points back on itself
      arr_n_ptr[0 + arr_offset] = 0 + arr_offset;
      return 0;
   }
      

//   uint32_t num_elements_per_page = PAGE_SZ/sizeof(uint32_t)/stride;
   uint32_t num_elements_per_page = PAGE_SZ/sizeof(uint32_t);
   uint32_t num_accesses_per_page = PAGE_SZ/sizeof(uint32_t)/stride;

     
   uint32_t last_idx = 0;

   // two-level randomization... (this is the outer level for-loop)
   // for each page...
   for(int i=0; i < num_elements; i+=num_elements_per_page)
   {
      uint32_t page_offset = i + arr_offset;

#ifdef DEBUG
      printf("\nStarting New Page: i=%d, page offset = %d, num_elements = %d, num_elements_per_page = %d, num_accesses_per_page = %d\n", 
         i, i, num_elements, num_elements_per_page, num_accesses_per_page);
#endif
         
       
      if ((int32_t) i >= (int32_t) (num_elements - num_elements_per_page)  //is last page?
         && ((num_elements - i) % num_elements_per_page != 0))  //and last page is partial
      {
         num_elements_per_page = num_elements - i; 
         num_accesses_per_page = num_elements_per_page / stride;
#ifdef DEBUG
         printf("last page (partial), new num_elements_per_page = %d\n", 
            num_elements_per_page);
#endif
      }



      last_idx = initializePage(arr_n_ptr, page_offset, num_accesses_per_page, stride);
      // tie this page to the next page...
      arr_n_ptr[last_idx] =  page_offset + (PAGE_SZ/sizeof(uint32_t)); 
#ifdef DEBUG
      printf("  *array[%4d] = %4d, \n", last_idx, arr_n_ptr[last_idx]);
#endif
   }


      //handle the last page ...
      //wrap the array back to the start
      if (last_idx >= num_elements*g_num_requests)
         printf("THIS SHOULD BE CRASHING, last_idx = %u >= num_elements = %u\n",
            last_idx, num_elements*g_num_requests);

      arr_n_ptr[last_idx] = 0 + arr_offset;
#ifdef DEBUG
      printf(" **array[%4d] = %4d (looping back to the start: arr_offset=%d \n", 
         last_idx, arr_n_ptr[last_idx], arr_offset);
#endif

#ifdef PRINT_ARRAY
   printArray(0, arr_n_ptr, num_elements, stride, arr_offset);
#endif
   verifyArray(arr_n_ptr, num_elements, stride, arr_offset);

   return 0;
}
Esempio n. 10
0
SelectProjectPage::SelectProjectPage(QWidget *parent) :
	QWizardPage(parent),
	ui(new Ui::SelectProjectPage)
{
	initializePage();
}
Esempio n. 11
0
int main(){

	//Read workload to array 'workLoad'
	FILE *pRead;
	char baseDir[] ="WorkLoad/workload";
	int wl=2;
	char newDir[10];	
	sprintf(newDir,"%d",wl);
	strcat(baseDir,newDir);	 
	printf("Reading = %s\n", baseDir);
	FILE *fin,*fout;

	fin=fopen(baseDir,"rb");
	
	if(NULL==fin){
		printf("File Read Fail");
	}

	while(fscanf(fin,"%d",&workLoad[RW])!=EOF){
		RW++;
	}

	fclose(fin);
	printf("Total Read = %d\n",RW);
              

	//Initialize the page array.
	

	int it1=0;


	
		P=pageNumArr[1];
		initializePage();
		FIFO();	
				initializePage();
		CLOCK();	
				initializePage();
		LRU();	
	
	
	// for(it1=0;it1<2;it1++){
	// 	P=pageNumArr[it1];
	// 	initializePage();
	// 	FIFO();	
	// }

	// for(it1=0;it1<2;it1++){
	// 	P=pageNumArr[it1];
	// 	initializePage();
	// 	CLOCK();	
	// }

	// for(it1=0;it1<2;it1++){
	// 	P=pageNumArr[it1];
	// 	initializePage();
	// 	LRU();	
	// }
	

	return 0;
}
Esempio n. 12
0
uint32_t initializeGlobalArrays(uint32_t* arr_n_ptr, uint32_t num_elements, uint32_t num_elements_per_page, uint32_t stride, uint32_t interleaving_sz, uint32_t arr_offset)
{

#ifdef DEBUG
   printf("\nInitializing Array at 0x%x, num_elements= %d, stride= %d, offset= %d, num_cl = %d\n\n",
      arr_n_ptr, num_elements, stride, arr_offset, num_elements / stride); 
#endif

   //randomize array on cacheline strided boundaries
#ifdef DEBUG
   printf("\n-==== Begin two-level randomization of the chase array ====-\n");
#endif

   // check to see if the array is 1-element long...
   if (num_elements == stride)
   {
#ifdef DEBUG
      printf("\nArray is 1 element long, returning....\n");
#endif
      // points back on itself
      arr_n_ptr[0 + arr_offset] = 0 + arr_offset;
      return 0;
   }
      

   uint32_t num_accesses_per_page = num_elements_per_page/stride;
   uint32_t num_pages = num_elements / num_elements_per_page;

     
   uint32_t last_idx;

   // two-level randomization... (this is the outer level for-loop)
   // for each page...
   for(int page_idx=0; page_idx < num_pages; page_idx++)
   {
      uint32_t page_offset = arr_offset + page_idx*interleaving_sz;


      last_idx = initializePage(arr_n_ptr, page_offset, num_accesses_per_page, stride);
      // tie this page to the next page...
      arr_n_ptr[last_idx] =  page_offset + interleaving_sz;
#ifdef DEBUG
      printf("  *array[%4d] = %4d, \n", last_idx, arr_n_ptr[last_idx]);
#endif
      }


      //handle the last page ...
      //wrap the array back to the start
      arr_n_ptr[last_idx] = 0 + arr_offset;
#ifdef DEBUG
      printf(" **array[%4d] = %4d (looping back to the start: arr_offset=%d \n", 
         last_idx, arr_n_ptr[last_idx], arr_offset);
#endif

#ifdef PRINT_ARRAY
   printArray(0, arr_n_ptr, num_elements, stride, arr_offset);
#endif
#ifdef VERIFY_ARRAYS
   verifyArray(arr_n_ptr, num_elements, num_elements_per_page, stride, interleaving_sz, arr_offset);
#endif

   return 0;
}
void AMBeamConfigurationWizard::back()
{
	int pageId = currentId();
	int targetPage;
	switch(pageId)
	{
	case Page_Final:
		targetPage = pageWait(numberOfPages() - 1);
		while(currentId() != targetPage)
			QWizard::back();
		if(currentId() == targetPage)
			initializePage(targetPage);
		break;
	default:
		if(isWaitPage(pageId))
		{
			bool reinitialize = true;

			((AMWaitPage*)page(pageId))->stopTimer();

			if(relativeId(pageId) == 0)
			{
				targetPage = Page_Intro;
				reinitialize = false;
			}
			else
			{
				targetPage = pageWait(relativeId(pageId) - 1);
			}

			while(currentId() != targetPage)
			{
				QWizard::back();
			}

			if(currentId() == targetPage && reinitialize)
			{
				initializePage(targetPage);
			}
		}
		else if(isSetPage(pageId))
		{
			bool reinitialize = true;
			if(relativeId(pageId) == 0)
			{
				targetPage = Page_Intro;
				reinitialize = false;
			}
			else
			{
				targetPage = pageWait(relativeId(pageId) - 1);
			}
			while(currentId() != targetPage)
			{
				QWizard::back();
			}
			if(currentId() == targetPage && reinitialize)
			{
				initializePage(targetPage);
			}
		}
		else
		{
			AMGraphicsViewWizard::back();
		}
		break;
	}

}
Esempio n. 14
0
void PanoOptimizePage::slotPanoAction(const DigikamGenericPanoramaPlugin::PanoActionData& ad)
{
    qCDebug(DIGIKAM_DPLUGIN_GENERIC_LOG) << "SlotPanoAction (optimize)";
    qCDebug(DIGIKAM_DPLUGIN_GENERIC_LOG) << "starting, success, canceled, action: " << ad.starting << ad.success << d->canceled << ad.action;

    QString text;

    QMutexLocker lock(&d->progressMutex);

    if (!ad.starting)           // Something is complete...
    {
        if (!ad.success)        // Something is failed...
        {
            if (d->canceled)    // In that case, the error is expected
            {
                return;
            }

            switch (ad.action)
            {
                case PANO_OPTIMIZE:
                case PANO_AUTOCROP:
                {
                    disconnect(d->mngr->thread(), SIGNAL(stepFinished(DigikamGenericPanoramaPlugin::PanoActionData)),
                               this, SLOT(slotPanoAction(DigikamGenericPanoramaPlugin::PanoActionData)));
                    disconnect(d->mngr->thread(), SIGNAL(jobCollectionFinished(DigikamGenericPanoramaPlugin::PanoActionData)),
                               this, SLOT(slotPanoAction(DigikamGenericPanoramaPlugin::PanoActionData)));

                    qCWarning(DIGIKAM_DPLUGIN_GENERIC_LOG) << "Job failed (optimize): " << ad.action;

                    if (d->detailsText->isHidden())
                    {
                        d->title->setText(i18n("<qt>"
                                               "<h1>Optimization has failed.</h1>"
                                               "<p>See processing messages below.</p>"
                                               "</qt>"));
                        d->progressTimer->stop();
                        d->horizonCheckbox->hide();
//                      d->projectionAndSizeCheckbox->hide();
                        d->detailsText->show();
                        d->progressLabel->clear();
                        d->detailsText->setText(ad.message);

                        setComplete(false);
                        emit completeChanged();
                    }
                    break;
                }
                default:
                {
                    qCWarning(DIGIKAM_DPLUGIN_GENERIC_LOG) << "Unknown action (optimize) " << ad.action;
                    break;
                }
            }
        }
        else                    // Something is done...
        {
            switch (ad.action)
            {
                case PANO_OPTIMIZE:
                {
                    return;
                }
                case PANO_AUTOCROP:
                {
                    disconnect(d->mngr->thread(), SIGNAL(stepFinished(DigikamGenericPanoramaPlugin::PanoActionData)),
                               this, SLOT(slotPanoAction(DigikamGenericPanoramaPlugin::PanoActionData)));
                    disconnect(d->mngr->thread(), SIGNAL(jobCollectionFinished(DigikamGenericPanoramaPlugin::PanoActionData)),
                               this, SLOT(slotPanoAction(DigikamGenericPanoramaPlugin::PanoActionData)));

                    d->progressTimer->stop();
                    d->progressLabel->clear();
                    d->optimisationDone = true;

                    emit signalOptimized();
                    initializePage();

                    break;
                }
                default:
                {
                    qCWarning(DIGIKAM_DPLUGIN_GENERIC_LOG) << "Unknown action (optimize) " << ad.action;
                    break;
                }
            }
        }
    }
}