本文整理汇总了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);
}
示例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;
}
示例3: UpdateProgress
void TranscodeDialog::timerEvent(QTimerEvent* e) {
QDialog::timerEvent(e);
if (e->timerId() == progress_timer_.timerId()) {
UpdateProgress();
}
}
示例4: UpdateStatusText
void TranscodeDialog::JobComplete(const QString& filename, bool success) {
(*(success ? &finished_success_ : &finished_failed_))++;
queued_--;
UpdateStatusText();
UpdateProgress();
}
示例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);
}
}
}
示例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);
}
示例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;
}
示例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;
}
}
}
示例9: UpdateProgress
void Organise::timerEvent(QTimerEvent* e) {
QObject::timerEvent(e);
if (e->timerId() == transcode_progress_timer_.timerId()) {
UpdateProgress();
}
}
示例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();
}
}
}
示例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()));
}
示例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)));
}
}
}
}
}
示例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();
}
}
示例14: UpdateProgress
void CDownloads_Bittorrent_Files::OnShowWindow(BOOL bShow, UINT nStatus)
{
CColumnTreeCtrl::OnShowWindow(bShow, nStatus);
if (bShow)
UpdateProgress ();
}
示例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);
}
}
}
}
}