当前位置: 首页>>代码示例>>C++>>正文


C++ UpdateProgress函数代码示例

本文整理汇总了C++中UpdateProgress函数的典型用法代码示例。如果您正苦于以下问题:C++ UpdateProgress函数的具体用法?C++ UpdateProgress怎么用?C++ UpdateProgress使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了UpdateProgress函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Init

void
avtOriginalDataSpatialExtentsQuery::PerformQuery(QueryAttributes *qA)
{
    queryAtts = *qA;
    Init(); 

    std::string floatFormat = queryAtts.GetFloatFormat();
    std::string format ="";
    UpdateProgress(0, 0);

    avtDataObject_p dob = ApplyFilters(GetInput());

    SetTypedInput(dob);

    avtDataset_p input = GetTypedInput();
    double extents[6] = {0., 0., 0., 0., 0., 0.};
    char msg[1024];

    avtDatasetExaminer::GetSpatialExtents(input, extents);
    UnifyMinMax(extents, 6);
    int dim = input->GetInfo().GetAttributes().GetSpatialDimension();
    if (dim == 1)
    {
        format = "The original extents are (" + floatFormat + ", " 
                                              + floatFormat + ")";
        SNPRINTF(msg, 1024,format.c_str(), 
                extents[0], extents[1]);
    }
    else if (dim == 2)
    {
        format = "The original extents are (" + floatFormat + ", " 
                                              + floatFormat + ", " 
                                              + floatFormat + ", " 
                                              + floatFormat + ")";
        SNPRINTF(msg, 1024, format.c_str(), 
            extents[0], extents[1], extents[2], extents[3]);
    }
    else if (dim == 3)
    {
        format = "The original extents are (" + floatFormat + ", " 
                                              + floatFormat + ", " 
                                              + floatFormat + ", " 
                                              + floatFormat + ", " 
                                              + floatFormat + ", " 
                                              + floatFormat + ")";
       SNPRINTF(msg, 1024, format.c_str(),
        extents[0], extents[1], extents[2], extents[3], extents[4], extents[5]);
    }
    doubleVector d;
    for (int i = 0 ; i < 2*dim ; i++)
        d.push_back(extents[i]);
    qA->SetResultsMessage(msg);
    qA->SetResultsValue(d);

    UpdateProgress(1, 0);
}
开发者ID:HarinarayanKrishnan,项目名称:VisIt26RC_Trunk,代码行数:56,代码来源:avtOriginalDataSpatialExtentsQuery.C

示例2: DoEvents

STDMETHODIMP CMktStructureBaseDlg::OnOption(PP::OptionParams *Params, PP::OptionInfo *Results, VARIANT_BOOL bLast)
{
	USES_CONVERSION;

	HRESULT hr = S_OK;
	DoEvents();
	if(m_bCanceled) return hr;
/*
	if(bLast==VARIANT_FALSE && m_opts.m_enProviderType == enMyTrackPriceProvider)
	{
		if( fEQZero(Results->Last) && fEQZero(Results->Bid) && fEQZero(Results->Ask) )
			return S_OK;
	}
*/
	if(bLast==VARIANT_FALSE && Results->ExpirationDate < int(vt_date::GetCurrentDate()))
		return S_OK;

	stocks_map::iterator it =  m_stocks.find (Params->UnderlyingSymbol);
	if (it != m_stocks.end())
	try
	{
		USES_CONVERSION;

		if (bLast)
		{
			it->second.m_bGotOptions = true;
			UpdateProgress(it);
			return hr;
		}
		
		CDBLayout db;
		db.Connect(); 
		
		db.UpdateOptionData (it->second.m_nID, Params, Results);

		db.Disconnect();
		

		CString strMsg;
		strMsg.Format(IDS_MKTSTRUCTURE_GOTOPTION, OLE2T(Params->UnderlyingSymbol),
			OLE2T(Results->Series) );

		it->second.m_lGotOptions++;		
		StatusMessage (strMsg, false);
		UpdateProgress(it);
	}
	catch (_com_error & e)
	{
		ErrorMessage(e);
		Stop();
	}

	return hr;
}
开发者ID:AlexS2172,项目名称:IVRMstandard,代码行数:54,代码来源:MktStructureBaseDlg.cpp

示例3: UpdateProgress

void TranscodeDialog::timerEvent(QTimerEvent* e) {
  QDialog::timerEvent(e);

  if (e->timerId() == progress_timer_.timerId()) {
    UpdateProgress();
  }
}
开发者ID:asiviero,项目名称:Clementine,代码行数:7,代码来源:transcodedialog.cpp

示例4: UpdateStatusText

void TranscodeDialog::JobComplete(const QString& filename, bool success) {
  (*(success ? &finished_success_ : &finished_failed_))++;
  queued_--;

  UpdateStatusText();
  UpdateProgress();
}
开发者ID:asiviero,项目名称:Clementine,代码行数:7,代码来源:transcodedialog.cpp

示例5: GetFileHeaderFromDLName

void UOnlineHotfixManager::OnReadFileComplete(bool bWasSuccessful, const FString& FileName)
{
	if (PendingHotfixFiles.Contains(FileName))
	{
		if (bWasSuccessful)
		{
			FCloudFileHeader* Header = GetFileHeaderFromDLName(FileName);
			check(Header != nullptr);
			UE_LOG(LogHotfixManager, Log, TEXT("Hotfix file (%s) downloaded. Size was (%d)"), *GetFriendlyNameFromDLName(FileName), Header->FileSize);
			// Completion updates the file count and progress updates the byte count
			UpdateProgress(1, 0);
			PendingHotfixFiles.Remove(FileName);
			if (PendingHotfixFiles.Num() == 0)
			{
				// All files have been downloaded so now apply the files
				ApplyHotfix();
			}
		}
		else
		{
			UE_LOG(LogHotfixManager, Error, TEXT("Hotfix file (%s) failed to download"), *GetFriendlyNameFromDLName(FileName));
			TriggerHotfixComplete(EHotfixResult::Failed);
		}
	}
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:25,代码来源:OnlineHotfixManager.cpp

示例6: atsh_compute_SMR

/* atsh_compute_SMR
 * ================
 * computes the SMR data for a set of frames
 * *sound: pointer to an ATS_SOUND structure
 * from_frame: initial frame
 * to_frame: last frame
 */
void atsh_compute_SMR(ATS_SOUND *sound, int from_frame, int to_frame)
{
  ATS_PEAK *peaks;
  int i, j, nValue=0;
  int todo  = to_frame - from_frame;

  peaks = (ATS_PEAK *)malloc(sound->partials * sizeof(ATS_PEAK));
  
  StartProgress("Computing SMR...", FALSE);
  for(i = from_frame; i < to_frame; i++)
    {
      //fprintf(stderr," frm=%d", i);

      make_peaks(sound,peaks,i);
      evaluate_smr(peaks, sound->partials);
      for(j = 0 ; j < sound->partials ; j++)
	{
	  sound->smr[j][i] = peaks[j].smr;
	  //fprintf(stderr,"%8.3f ",sound->smr[j][i] );
	}
    //fprintf(stderr,"\n");
     ++nValue;
      UpdateProgress(nValue,todo);
    }
  EndProgress();
  smr_done=TRUE;
  free(peaks);
}
开发者ID:bion,项目名称:ats,代码行数:35,代码来源:atsh-mask.c

示例7: while

NS_IMETHODIMP
nsIncrementalDownload::OnDataAvailable(nsIRequest *request,
                                       nsISupports *context,
                                       nsIInputStream *input,
                                       uint64_t offset,
                                       uint32_t count)
{
  while (count) {
    uint32_t space = mChunkSize - mChunkLen;
    uint32_t n, len = std::min(space, count);

    nsresult rv = input->Read(&mChunk[mChunkLen], len, &n);
    if (NS_FAILED(rv))
      return rv;
    if (n != len)
      return NS_ERROR_UNEXPECTED;

    count -= n;
    mChunkLen += n;

    if (mChunkLen == mChunkSize) {
      rv = FlushChunk();
      if (NS_FAILED(rv))
        return rv;
    }
  }

  if (PR_Now() > mLastProgressUpdate + UPDATE_PROGRESS_INTERVAL)
    UpdateProgress();

  return NS_OK;
}
开发者ID:Nazi-Nigger,项目名称:gecko-dev,代码行数:32,代码来源:nsIncrementalDownload.cpp

示例8: PeekNamedPipe

void CASW_Map_Builder::ProcessExecution()
{
	DWORD dwCount = 0;
	DWORD dwRead = 0;

	// read from input handle
	PeekNamedPipe(m_hChildStdoutRd, NULL, NULL, NULL, &dwCount, NULL);
	if (dwCount)
	{
		dwCount = MIN (dwCount, 4096 - 1);
		ReadFile(m_hChildStdoutRd, m_szProcessBuffer, dwCount, &dwRead, NULL);
	}
	if(dwRead)
	{
		m_szProcessBuffer[dwRead] = 0;
		UpdateProgress();
		Msg(m_szProcessBuffer);
	}
	// check process termination
	else if ( WaitForSingleObject(m_hProcess, 50) != WAIT_TIMEOUT )
	{
		if(m_bFinishedExecution)
		{
			m_iProcessReturnValue = 0;
			FinishExecution();
		}
		else
		{
			m_bFinishedExecution = true;
		}
	}	
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:32,代码来源:asw_map_builder.cpp

示例9: UpdateProgress

void Organise::timerEvent(QTimerEvent* e) {
  QObject::timerEvent(e);

  if (e->timerId() == transcode_progress_timer_.timerId()) {
    UpdateProgress();
  }
}
开发者ID:BrummbQ,项目名称:Clementine,代码行数:7,代码来源:organise.cpp

示例10: reqCmd

void FileTransferWidget::GetNextFile()
{
    if (m_filesHashIter->hasNext())
    {
        m_speedBytes = 0;
        m_currentFileSize = 0;
        QHash<QString, quint32>::const_iterator currFile = m_filesHashIter->next();
        m_ui->progressBar->setMaximum(currFile.value());
        m_ui->progressBar->setValue(0);
        m_ui->fileSizeLabel->setText(MRIMCommonUtils::GetFileSize(currFile.value()));
        m_ui->doneLabel->setText(MRIMCommonUtils::GetFileSize(0));
        m_ui->statusLabel->setText(tr("Getting file..."));
        m_ui->fileNameLabel->setText(currFile.key());
        m_ui->speedLabel->clear();
        QString reqCmd("MRA_FT_GET_FILE "+currFile.key());        
        m_currentFile.setFileName(m_location+currFile.key());
        m_currentFile.open(QIODevice::WriteOnly);
        SendCmd(reqCmd);
        m_currentStatus = FT_WAIT_FOR_TRANSFER;
        UpdateProgress();
    }
    else
    {
        m_client->Protocol()->FileTransferCompleted(m_req.UniqueId);
        m_currentStatus = FT_TRANSFER_COMPLETED;
        m_socket->disconnectFromHost();
        m_ui->cancelButton->setText(tr("Close"));
        if (m_ui->closeAfterTransfer->checkState() == Qt::Checked)
        {
            close();
        }
    }
}
开发者ID:veksha,项目名称:vekshas-qutim-protocols,代码行数:33,代码来源:filetransferwidget.cpp

示例11: if

void FileTransferWidget::UpdateProgress()
{
    qint64 progress = 0, totalSize = 0;
    if (m_transferMode == TM_RECIEVE_CLIENT)
    {
        progress = m_currentFileSize;
        totalSize = m_filesHashIter->value();
    }
    else if (m_transferMode == TM_SEND_SERVER)
    {
        progress = m_currentFile.pos();
        totalSize = m_currentFile.size();
    }

    m_ui->doneLabel->setText(MRIMCommonUtils::GetFileSize(progress));
    m_ui->progressBar->setValue(progress);
    m_ui->speedLabel->setText(MRIMCommonUtils::GetFileSize(m_speedBytes)+tr("/sec"));
    SetRemainTime();
    m_speedBytes = 0;

    if (progress >= totalSize)
    {
        m_ui->statusLabel->setText(tr("Done!"));
        m_ui->speedLabel->setText("");
        return;
    }

    if ( m_socket->state() == QAbstractSocket::ConnectedState )
        QTimer::singleShot(1000, this, SLOT(UpdateProgress()));
}
开发者ID:veksha,项目名称:vekshas-qutim-protocols,代码行数:30,代码来源:filetransferwidget.cpp

示例12: UpdateProgress

void Pipeline::ResizeStage(ImageList images, Task* task)
{
	// Resize images and split it by resolutions
	QHash<QString, ImageList> imagesByRes;
	for(QString res : task->outputRes)
	{
		imagesByRes[res] = resizer.Run(images, task->sourceRes, res, task->potSize);
		UpdateProgress();
	}

	// Pass images to build atals stage
	if(task->atlas) BuildAtlasStage(imagesByRes, task);

	// Save resized images without building atlas
	else
	{
		for(const QString& resolution : imagesByRes.keys())
		{
			for(auto entry : imagesByRes[resolution])
			{
				QString filename = MakeFilename(entry.first, resolution, ExtensionForFormat(task->outputFormat));
				if(!SaveImage(entry.second, task->outputDir, filename, task->outputFormat))
				{
					errors.push_back(ERROR_MASK.arg(task->name).arg(ERROR_SAVE_MASK.arg(filename)));
				}
			}
		}
	}
}
开发者ID:dreamsxin,项目名称:luna2d,代码行数:29,代码来源:pipeline.cpp

示例13: UpdateProgress

void FileTransferWidget::SendFile(QString aFileName)
{
    if (!m_req.FilesDict.contains(aFileName)) return;

    QFileInfo info = m_req.FilesInfo.at(m_req.FilesDict.keys().indexOf(aFileName,0));
    if (info.exists())
    {
        m_speedBytes = 0;
        if (m_currentFile.isOpen()) m_currentFile.close();
        m_currentFile.setFileName(info.absoluteFilePath());
        m_currentFile.open(QIODevice::ReadOnly);
        m_currentFileChunkSize = m_currentFile.size() < 1360 ? m_currentFile.size() : 1360;

        m_ui->progressBar->setMaximum(m_currentFile.size());
        m_ui->progressBar->setValue(0);
        m_ui->fileSizeLabel->setText(MRIMCommonUtils::GetFileSize(m_currentFile.size()));
        m_ui->doneLabel->setText(MRIMCommonUtils::GetFileSize(0));
        m_ui->speedLabel->clear();
        m_ui->statusLabel->setText(tr("Sending file..."));
        m_ui->fileNameLabel->setText(m_currentFile.fileName());

        UpdateProgress();
        SendFileDataChunk();
    }
}
开发者ID:veksha,项目名称:vekshas-qutim-protocols,代码行数:25,代码来源:filetransferwidget.cpp

示例14: UpdateProgress

void CDownloads_Bittorrent_Files::OnShowWindow(BOOL bShow, UINT nStatus) 
{
	CColumnTreeCtrl::OnShowWindow(bShow, nStatus);
	
	if (bShow)
		UpdateProgress ();
}
开发者ID:HackLinux,项目名称:Free-Download-Manager-vs2010,代码行数:7,代码来源:Downloads_Bittorrent_Files.cpp

示例15: dir

void ParRenamer::CheckFiles(const char* destDir, bool checkPars)
{
	DirBrowser dir(destDir);
	while (const char* filename = dir.Next())
	{
		if (!IsStopped())
		{
			BString<1024> fullFilename("%s%c%s", destDir, PATH_SEPARATOR, filename);

			if (!FileSystem::DirectoryExists(fullFilename))
			{
				m_progressLabel.Format("Checking file %s", filename);
				m_stageProgress = m_fileCount > 0 ? m_curFile * 1000 / m_fileCount / 2 : 1000;
				UpdateProgress();
				m_curFile++;

				if (checkPars)
				{
					CheckParFile(destDir, fullFilename);
				}
				else
				{
					CheckRegularFile(destDir, fullFilename);
				}
			}
		}
	}
}
开发者ID:nzbget,项目名称:nzbget,代码行数:28,代码来源:ParRenamer.cpp


注:本文中的UpdateProgress函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。